mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
feat(recursive-list): integrate RecursiveList
with v11 (#1960)
This commit is contained in:
parent
76210d68d4
commit
1c3478f1bc
5 changed files with 13 additions and 26 deletions
|
@ -3095,10 +3095,10 @@ export interface RecursiveListNode {
|
||||||
|
|
||||||
### Props
|
### Props
|
||||||
|
|
||||||
| Prop name | Required | Kind | Reactive | Type | Default value | Description |
|
| Prop name | Required | Kind | Reactive | Type | Default value | Description |
|
||||||
| :-------- | :------- | :--------------- | :------- | --------------------------------------------------------------------------- | ------------------------ | ---------------------------------- |
|
| :-------- | :------- | :--------------- | :------- | ------------------------------------------------------------------------------------------------ | ------------------------ | ---------------------------------- |
|
||||||
| children | No | <code>let</code> | No | <code>Array<RecursiveListNode & { children?: RecursiveListNode[]; }></code> | <code>[]</code> | Specify the children to render |
|
| children | No | <code>let</code> | No | <code>ReadonlyArray<RecursiveListNode & { children?: ReadonlyArray<RecursiveListNode>; }></code> | <code>[]</code> | Specify the children to render |
|
||||||
| type | No | <code>let</code> | No | <code>"unordered" | "ordered" | "ordered-native"</code> | <code>"unordered"</code> | Specify the type of list to render |
|
| type | No | <code>let</code> | No | <code>"unordered" | "ordered" | "ordered-native"</code> | <code>"unordered"</code> | Specify the type of list to render |
|
||||||
|
|
||||||
### Slots
|
### Slots
|
||||||
|
|
||||||
|
|
|
@ -9798,7 +9798,7 @@
|
||||||
"name": "children",
|
"name": "children",
|
||||||
"kind": "let",
|
"kind": "let",
|
||||||
"description": "Specify the children to render",
|
"description": "Specify the children to render",
|
||||||
"type": "Array<RecursiveListNode & { children?: RecursiveListNode[]; }>",
|
"type": "ReadonlyArray<RecursiveListNode & { children?: ReadonlyArray<RecursiveListNode>; }>",
|
||||||
"value": "[]",
|
"value": "[]",
|
||||||
"isFunction": false,
|
"isFunction": false,
|
||||||
"isFunctionDeclaration": false,
|
"isFunctionDeclaration": false,
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify the children to render
|
* Specify the children to render
|
||||||
* @type {Array<RecursiveListNode & { children?: RecursiveListNode[]; }>}
|
* @type {ReadonlyArray<RecursiveListNode & { children?: ReadonlyArray<RecursiveListNode>; }>}
|
||||||
*/
|
*/
|
||||||
export let children = [];
|
export let children = [];
|
||||||
|
|
||||||
|
|
|
@ -4,29 +4,14 @@
|
||||||
const children = [
|
const children = [
|
||||||
{
|
{
|
||||||
text: "Item 1",
|
text: "Item 1",
|
||||||
children: [
|
children: [{ text: "Item 1a", children: [] }],
|
||||||
{
|
|
||||||
text: "Item 1a",
|
|
||||||
children: [{ html: "<h5>HTML content</h5>" }],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "Item 2",
|
text: "Item 2",
|
||||||
children: [
|
children: [{ href: "https://svelte.dev/" }],
|
||||||
{
|
|
||||||
href: "https://svelte.dev/",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
href: "https://svelte.dev/",
|
|
||||||
text: "Link with custom text",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
{
|
{ text: "Item 3" },
|
||||||
text: "Item 3",
|
] as const;
|
||||||
},
|
|
||||||
];
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<RecursiveList type="ordered" children="{children}" />
|
<RecursiveList type="ordered" children="{children}" />
|
||||||
|
|
|
@ -14,7 +14,9 @@ export interface RecursiveListProps extends RestProps {
|
||||||
* Specify the children to render
|
* Specify the children to render
|
||||||
* @default []
|
* @default []
|
||||||
*/
|
*/
|
||||||
children?: Array<RecursiveListNode & { children?: RecursiveListNode[] }>;
|
children?: ReadonlyArray<
|
||||||
|
RecursiveListNode & { children?: ReadonlyArray<RecursiveListNode> }
|
||||||
|
>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify the type of list to render
|
* Specify the type of list to render
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue