diff --git a/packages/materialdesign-components/src/List/List.svelte b/packages/materialdesign-components/src/List/List.svelte
index 7c0cd34282..ac375da4f3 100644
--- a/packages/materialdesign-components/src/List/List.svelte
+++ b/packages/materialdesign-components/src/List/List.svelte
@@ -1,79 +1,71 @@
-
- {#each items as item, i}
- handleSelectedItem(item)} />
- {#if item.divider}
-
- {/if}
- {/each}
-
+
diff --git a/packages/materialdesign-components/src/List/ListItem.svelte b/packages/materialdesign-components/src/List/ListItem.svelte
index e676099006..ac16b26d95 100644
--- a/packages/materialdesign-components/src/List/ListItem.svelte
+++ b/packages/materialdesign-components/src/List/ListItem.svelte
@@ -1,71 +1,73 @@
- {#if item.leadingIcon}
+ {#if leadingIcon}
- {item.leadingIcon}
+ {leadingIcon}
{/if}
- {#if useDoubleLine}
- {item.text.primary}
- {#if useSecondaryText}
- {item.text.secondary}
- {/if}
- {:else}{item.text}{/if}
+ {#if useTwoLine}
+ {text}
+ {secondaryText}
+ {:else}{text}{/if}
{#if inputElement}
{#if inputElement === 'radiobutton'}
-
+
{:else if inputElement === 'checkbox'}
-
+
{/if}
- {:else if item.trailingIcon}
+ {:else if trailingIcon}
- {item.trailingIcon}
+ {trailingIcon}
{/if}
diff --git a/packages/materialdesign-components/src/List/index.js b/packages/materialdesign-components/src/List/index.js
index 1db72f9273..c7570e4be0 100644
--- a/packages/materialdesign-components/src/List/index.js
+++ b/packages/materialdesign-components/src/List/index.js
@@ -1,2 +1,3 @@
-import "./_style.scss";
-export { default as List } from "./List.svelte";
+import "./_style.scss"
+export { default as List } from "./List.svelte"
+export { default as ListItem } from "./ListItem.svelte"
diff --git a/packages/materialdesign-components/src/Test/TestApp.svelte b/packages/materialdesign-components/src/Test/TestApp.svelte
index c43ceeef74..b6c40fa895 100644
--- a/packages/materialdesign-components/src/Test/TestApp.svelte
+++ b/packages/materialdesign-components/src/Test/TestApp.svelte
@@ -15,6 +15,7 @@
Datatable,
CustomersIndexTable,
List,
+ Icon,
} = props
let currentComponent
@@ -35,6 +36,7 @@
Checkboxgroup,
Radiobutton,
Radiobuttongroup,
+ Icon,
Datatable,
CustomersIndexTable,
List,
diff --git a/packages/materialdesign-components/src/Test/props.js b/packages/materialdesign-components/src/Test/props.js
index 375cff91cb..c10cce0161 100644
--- a/packages/materialdesign-components/src/Test/props.js
+++ b/packages/materialdesign-components/src/Test/props.js
@@ -117,22 +117,39 @@ export const props = {
CustomersIndexTable: indexDatatable(templateOptions)[0].props,
List: {
_component: "@budibase/materialdesign-components/List",
- _children: [],
- variant: "two-line",
- singleSelection: true,
- items: [
+ _children: [
{
- text: { primary: "Curry", secondary: "Chicken or Beef" },
+ _component: "@budibase/materialdesign-components/ListItem",
+ _children: [],
+ variant: "two-line",
+ singleSelection: true,
+ text: "Curry",
+ secondaryText: "Chicken or Beef",
value: 0,
divider: true,
},
{
- text: { primary: "Pastie", secondary: "Bap with Mayo" },
+ _component: "@budibase/materialdesign-components/ListItem",
+ _children: [],
+ variant: "two-line",
+ singleSelection: true,
+ text: "Pastie",
+ secondaryText: "Bap with Mayo",
value: 1,
disabled: true,
},
- { text: { primary: "Fish", secondary: "Salmon or Cod" }, value: 2 },
+ {
+ _component: "@budibase/materialdesign-components/ListItem",
+ _children: [],
+ variant: "two-line",
+ singleSelection: true,
+ text: "Fish",
+ secondaryText: "Salmon or Cod",
+ value: 2,
+ },
],
+ variant: "two-line",
+ singleSelection: true,
onSelect: selected => console.log(selected),
},
}
diff --git a/packages/materialdesign-components/src/index.js b/packages/materialdesign-components/src/index.js
index d3cf736994..5dac37d7b6 100644
--- a/packages/materialdesign-components/src/index.js
+++ b/packages/materialdesign-components/src/index.js
@@ -16,4 +16,4 @@ export {
} from "./Datatable"
export { default as indexDatatable } from "./Templates/indexDatatable"
export { default as recordForm } from "./Templates/recordForm"
-export { List } from "./List"
+export { List, ListItem } from "./List"