mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 19:46:36 +00:00
Tidy
This commit is contained in:
parent
bb3947b139
commit
06f1ece637
4 changed files with 253 additions and 405 deletions
|
@ -409,7 +409,7 @@
|
|||
"kind": "let",
|
||||
"description": "Carbon grid sizes as an object",
|
||||
"type": "Record<BreakpointSize, boolean>",
|
||||
"value": "{\r sm: false,\r md: false,\r lg: false,\r xlg: false,\r max: false,\r }",
|
||||
"value": "{ sm: false, md: false, lg: false, xlg: false, max: false, }",
|
||||
"isFunction": false,
|
||||
"isFunctionDeclaration": false,
|
||||
"isRequired": false,
|
||||
|
@ -1041,7 +1041,7 @@
|
|||
"kind": "let",
|
||||
"description": "By default, this component uses `navigator.clipboard.writeText` API to copy text to the user's clipboard.\n\nProvide a custom function to override this behavior.",
|
||||
"type": "(code: string) => void",
|
||||
"value": "async (code) => {\r try {\r await navigator.clipboard.writeText(code);\r } catch (e) {\r console.log(e);\r }\r }",
|
||||
"value": "async (code) => { try { await navigator.clipboard.writeText(code); } catch (e) { console.log(e); } }",
|
||||
"isFunction": true,
|
||||
"isFunctionDeclaration": false,
|
||||
"isRequired": false,
|
||||
|
@ -1732,7 +1732,7 @@
|
|||
"kind": "function",
|
||||
"description": "Clear the combo box programmatically",
|
||||
"type": "(options?: { focus?: boolean; }) => void",
|
||||
"value": "() => {\r prevSelectedId = null;\r highlightedIndex = -1;\r highlightedId = undefined;\r selectedId = undefined;\r selectedItem = undefined;\r open = false;\r value = \"\";\r if (options?.focus !== false) ref?.focus();\r }",
|
||||
"value": "() => { prevSelectedId = null; highlightedIndex = -1; highlightedId = undefined; selectedId = undefined; selectedItem = undefined; open = false; value = \"\"; if (options?.focus !== false) ref?.focus(); }",
|
||||
"isFunction": true,
|
||||
"isFunctionDeclaration": true,
|
||||
"isRequired": false,
|
||||
|
@ -2322,7 +2322,7 @@
|
|||
"kind": "let",
|
||||
"description": "Override the default copy behavior of using the navigator.clipboard.writeText API to copy text",
|
||||
"type": "(text: string) => void",
|
||||
"value": "async (text) => {\r try {\r await navigator.clipboard.writeText(text);\r } catch (e) {\r console.log(e);\r }\r }",
|
||||
"value": "async (text) => { try { await navigator.clipboard.writeText(text); } catch (e) { console.log(e); } }",
|
||||
"isFunction": true,
|
||||
"isFunctionDeclaration": false,
|
||||
"isRequired": false,
|
||||
|
@ -3791,7 +3791,7 @@
|
|||
"kind": "const",
|
||||
"description": "Programmatically clear the uploaded files",
|
||||
"type": "() => void",
|
||||
"value": "() => {\r files = [];\r }",
|
||||
"value": "() => { files = []; }",
|
||||
"isFunction": true,
|
||||
"isFunctionDeclaration": false,
|
||||
"isRequired": false,
|
||||
|
@ -5397,7 +5397,7 @@
|
|||
{
|
||||
"name": "__default__",
|
||||
"default": true,
|
||||
"fallback": "{result.text}\r\n {#if result.description}<span>– {result.description}</span>{/if}",
|
||||
"fallback": "{result.text}\n {#if result.description}<span>– {result.description}</span>{/if}",
|
||||
"slot_props": "{ result: HeaderSearchResult; index: number }"
|
||||
}
|
||||
],
|
||||
|
@ -5527,7 +5527,7 @@
|
|||
"kind": "const",
|
||||
"description": "Method invoked to load the image provided a `src` value",
|
||||
"type": "(url?: string) => void",
|
||||
"value": "(url) => {\r if (image != null) image = null;\r loaded = false;\r error = false;\r image = new Image();\r image.src = url || src;\r image.onload = () => (loaded = true);\r image.onerror = () => (error = true);\r }",
|
||||
"value": "(url) => { if (image != null) image = null; loaded = false; error = false; image = new Image(); image.src = url || src; image.onload = () => (loaded = true); image.onerror = () => (error = true); }",
|
||||
"isFunction": true,
|
||||
"isFunctionDeclaration": false,
|
||||
"isRequired": false,
|
||||
|
@ -5761,7 +5761,7 @@
|
|||
{
|
||||
"name": "level",
|
||||
"kind": "let",
|
||||
"description": "Specify the layer level and override any existing levels based on hierarchy.",
|
||||
"description": "Specify the layer level to override any existing levels based on hierarchy.",
|
||||
"type": "0 | 1 | 2 ",
|
||||
"isFunction": false,
|
||||
"isFunctionDeclaration": false,
|
||||
|
@ -5772,8 +5772,8 @@
|
|||
{
|
||||
"name": "as",
|
||||
"kind": "let",
|
||||
"description": "Specify the HTML element to render. If none is specified, a `div` is rendered.",
|
||||
"type": "typeof import(\"svelte\").SvelteComponent",
|
||||
"description": "Specify the HTML element to render.",
|
||||
"type": "string",
|
||||
"value": "\"div\"",
|
||||
"isFunction": false,
|
||||
"isFunctionDeclaration": false,
|
||||
|
@ -5792,18 +5792,6 @@
|
|||
"isRequired": false,
|
||||
"constant": false,
|
||||
"reactive": false
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"kind": "let",
|
||||
"description": "Set an id for the Layer component",
|
||||
"type": "string",
|
||||
"value": "\"ccs-\" + Math.random().toString(36)",
|
||||
"isFunction": false,
|
||||
"isFunctionDeclaration": false,
|
||||
"isRequired": false,
|
||||
"constant": false,
|
||||
"reactive": false
|
||||
}
|
||||
],
|
||||
"moduleExports": [],
|
||||
|
@ -6316,8 +6304,8 @@
|
|||
"name": "translationIds",
|
||||
"kind": "const",
|
||||
"description": "Default translation ids",
|
||||
"type": "{\r clearAll: \"clearAll\",\r clearSelection: \"clearSelection\",\r }",
|
||||
"value": "{\r clearAll: \"clearAll\",\r clearSelection: \"clearSelection\",\r }",
|
||||
"type": "{ clearAll: \"clearAll\", clearSelection: \"clearSelection\", }",
|
||||
"value": "{ clearAll: \"clearAll\", clearSelection: \"clearSelection\", }",
|
||||
"isFunction": false,
|
||||
"isFunctionDeclaration": false,
|
||||
"isRequired": false,
|
||||
|
@ -6468,7 +6456,7 @@
|
|||
"kind": "function",
|
||||
"description": "Remove the persisted key value from the browser's local storage",
|
||||
"type": "() => void",
|
||||
"value": "() => {\r localStorage.removeItem(key);\r }",
|
||||
"value": "() => { localStorage.removeItem(key); }",
|
||||
"isFunction": true,
|
||||
"isFunctionDeclaration": true,
|
||||
"isRequired": false,
|
||||
|
@ -6480,7 +6468,7 @@
|
|||
"kind": "function",
|
||||
"description": "Clear all key values from the browser's local storage",
|
||||
"type": "() => void",
|
||||
"value": "() => {\r localStorage.clear();\r }",
|
||||
"value": "() => { localStorage.clear(); }",
|
||||
"isFunction": true,
|
||||
"isFunctionDeclaration": true,
|
||||
"isRequired": false,
|
||||
|
@ -7176,7 +7164,7 @@
|
|||
"kind": "let",
|
||||
"description": "Override the filtering logic\nThe default filtering is an exact string comparison",
|
||||
"type": "(item: MultiSelectItem, value: string) => string",
|
||||
"value": "(item, value) =>\r item.text.toLowerCase().includes(value.trim().toLowerCase())",
|
||||
"value": "(item, value) => item.text.toLowerCase().includes(value.trim().toLowerCase())",
|
||||
"isFunction": true,
|
||||
"isFunctionDeclaration": false,
|
||||
"isRequired": false,
|
||||
|
@ -7236,7 +7224,7 @@
|
|||
"kind": "let",
|
||||
"description": "Override the sorting logic\nThe default sorting compare the item text value",
|
||||
"type": "((a: MultiSelectItem, b: MultiSelectItem) => MultiSelectItem) | (() => void)",
|
||||
"value": "(a, b) =>\r a.text.localeCompare(b.text, locale, { numeric: true })",
|
||||
"value": "(a, b) => a.text.localeCompare(b.text, locale, { numeric: true })",
|
||||
"isFunction": true,
|
||||
"isFunctionDeclaration": false,
|
||||
"isRequired": false,
|
||||
|
@ -7867,7 +7855,7 @@
|
|||
"kind": "const",
|
||||
"description": "Default translation ids",
|
||||
"type": "{ increment: \"increment\"; decrement: \"decrement\" }",
|
||||
"value": "{\r increment: \"increment\",\r decrement: \"decrement\",\r }",
|
||||
"value": "{ increment: \"increment\", decrement: \"decrement\", }",
|
||||
"isFunction": false,
|
||||
"isFunctionDeclaration": false,
|
||||
"isRequired": false,
|
||||
|
@ -8188,7 +8176,7 @@
|
|||
{
|
||||
"name": "menu",
|
||||
"default": false,
|
||||
"fallback": "<svelte:component\r\n this=\"{icon}\"\r\n aria-label=\"{iconDescription}\"\r\n title=\"{iconDescription}\"\r\n class=\"bx--overflow-menu__icon {iconClass}\"\r\n />",
|
||||
"fallback": "<svelte:component\n this=\"{icon}\"\n aria-label=\"{iconDescription}\"\n title=\"{iconDescription}\"\n class=\"bx--overflow-menu__icon {iconClass}\"\n />",
|
||||
"slot_props": "{}"
|
||||
}
|
||||
],
|
||||
|
@ -8325,7 +8313,7 @@
|
|||
{
|
||||
"name": "__default__",
|
||||
"default": true,
|
||||
"fallback": "<div class:bx--overflow-menu-options__option-content=\"{true}\">\r\n {text}\r\n </div>",
|
||||
"fallback": "<div class:bx--overflow-menu-options__option-content=\"{true}\">\n {text}\n </div>",
|
||||
"slot_props": "{}"
|
||||
}
|
||||
],
|
||||
|
@ -8417,7 +8405,7 @@
|
|||
"kind": "let",
|
||||
"description": "Override the item text",
|
||||
"type": "(min: number, max: number) => string",
|
||||
"value": "(min, max) =>\r `${min}–${max} item${max === 1 ? \"\" : \"s\"}`",
|
||||
"value": "(min, max) => `${min}–${max} item${max === 1 ? \"\" : \"s\"}`",
|
||||
"isFunction": true,
|
||||
"isFunctionDeclaration": false,
|
||||
"isRequired": false,
|
||||
|
@ -8429,7 +8417,7 @@
|
|||
"kind": "let",
|
||||
"description": "Override the item range text",
|
||||
"type": "(min: number, max: number, total: number) => string",
|
||||
"value": "(min, max, total) =>\r `${min}–${max} of ${total} item${max === 1 ? \"\" : \"s\"}`",
|
||||
"value": "(min, max, total) => `${min}–${max} of ${total} item${max === 1 ? \"\" : \"s\"}`",
|
||||
"isFunction": true,
|
||||
"isFunctionDeclaration": false,
|
||||
"isRequired": false,
|
||||
|
@ -8513,7 +8501,7 @@
|
|||
"kind": "let",
|
||||
"description": "Override the page range text",
|
||||
"type": "(current: number, total: number) => string",
|
||||
"value": "(current, total) =>\r `of ${total} page${total === 1 ? \"\" : \"s\"}`",
|
||||
"value": "(current, total) => `of ${total} page${total === 1 ? \"\" : \"s\"}`",
|
||||
"isFunction": true,
|
||||
"isFunctionDeclaration": false,
|
||||
"isRequired": false,
|
||||
|
@ -13098,7 +13086,7 @@
|
|||
"kind": "let",
|
||||
"description": "Override the default toggle props",
|
||||
"type": "import(\"../Toggle/Toggle\").ToggleProps & { themes?: [labelA: CarbonTheme, labelB: CarbonTheme]; }",
|
||||
"value": "{\r themes: [\"white\", \"g100\"],\r labelA: \"\",\r labelB: \"\",\r labelText: \"Dark mode\",\r hideLabel: false,\r }",
|
||||
"value": "{ themes: [\"white\", \"g100\"], labelA: \"\", labelB: \"\", labelText: \"Dark mode\", hideLabel: false, }",
|
||||
"isFunction": false,
|
||||
"isFunctionDeclaration": false,
|
||||
"isRequired": false,
|
||||
|
@ -13110,7 +13098,7 @@
|
|||
"kind": "let",
|
||||
"description": "Override the default select props",
|
||||
"type": "import(\"../Select/Select\").SelectProps & { themes?: CarbonTheme[]; }",
|
||||
"value": "{\r themes: themeKeys,\r labelText: \"Themes\",\r hideLabel: false,\r }",
|
||||
"value": "{ themes: themeKeys, labelText: \"Themes\", hideLabel: false, }",
|
||||
"isFunction": false,
|
||||
"isFunctionDeclaration": false,
|
||||
"isRequired": false,
|
||||
|
@ -13887,7 +13875,7 @@
|
|||
"kind": "let",
|
||||
"description": "Override the total items selected text",
|
||||
"type": "(totalSelected: number) => string",
|
||||
"value": "(totalSelected) =>\r `${totalSelected} item${totalSelected === 1 ? \"\" : \"s\"} selected`",
|
||||
"value": "(totalSelected) => `${totalSelected} item${totalSelected === 1 ? \"\" : \"s\"} selected`",
|
||||
"isFunction": true,
|
||||
"isFunctionDeclaration": false,
|
||||
"isRequired": false,
|
||||
|
@ -14604,7 +14592,7 @@
|
|||
"kind": "function",
|
||||
"description": "Programmatically expand all nodes",
|
||||
"type": "() => void",
|
||||
"value": "() => {\r expandedIds = [...nodeIds];\r }",
|
||||
"value": "() => { expandedIds = [...nodeIds]; }",
|
||||
"isFunction": true,
|
||||
"isFunctionDeclaration": true,
|
||||
"isRequired": false,
|
||||
|
@ -14616,7 +14604,7 @@
|
|||
"kind": "function",
|
||||
"description": "Programmatically collapse all nodes",
|
||||
"type": "() => void",
|
||||
"value": "() => {\r expandedIds = [];\r }",
|
||||
"value": "() => { expandedIds = []; }",
|
||||
"isFunction": true,
|
||||
"isFunctionDeclaration": true,
|
||||
"isRequired": false,
|
||||
|
@ -14628,7 +14616,7 @@
|
|||
"kind": "function",
|
||||
"description": "Programmatically expand a subset of nodes.\nExpands all nodes if no argument is provided",
|
||||
"type": "(filterId?: (node: TreeNode) => boolean) => void",
|
||||
"value": "() => {\r expandedIds = nodes\r .filter(\r (node) =>\r filterNode(node) ||\r node.children?.some((child) => filterNode(child) && child.children)\r )\r .map((node) => node.id);\r }",
|
||||
"value": "() => { expandedIds = nodes .filter( (node) => filterNode(node) || node.children?.some((child) => filterNode(child) && child.children) ) .map((node) => node.id); }",
|
||||
"isFunction": true,
|
||||
"isFunctionDeclaration": true,
|
||||
"isRequired": false,
|
||||
|
@ -14640,7 +14628,7 @@
|
|||
"kind": "function",
|
||||
"description": "Programmatically collapse a subset of nodes.\nCollapses all nodes if no argument is provided",
|
||||
"type": "(filterId?: (node: TreeNode) => boolean) => void",
|
||||
"value": "() => {\r expandedIds = nodes\r .filter((node) => expandedIds.includes(node.id) && !filterNode(node))\r .map((node) => node.id);\r }",
|
||||
"value": "() => { expandedIds = nodes .filter((node) => expandedIds.includes(node.id) && !filterNode(node)) .map((node) => node.id); }",
|
||||
"isFunction": true,
|
||||
"isFunctionDeclaration": true,
|
||||
"isRequired": false,
|
||||
|
@ -14652,7 +14640,7 @@
|
|||
"kind": "function",
|
||||
"description": "Programmatically show a node by `id`.\nThe matching node will be expanded, selected, and focused",
|
||||
"type": "(id: TreeNodeId) => void",
|
||||
"value": "() => {\r for (const child of children) {\r const nodes = findNodeById(child, id);\r \r if (nodes) {\r const ids = nodes.map((node) => node.id);\r const nodeIds = new Set(ids);\r \r expandNodes((node) => nodeIds.has(node.id));\r \r const lastId = ids[ids.length - 1];\r \r activeId = lastId;\r selectedIds = [lastId];\r \r tick().then(() => {\r ref?.querySelector(`[id=\"${lastId}\"]`)?.focus();\r });\r \r // Break out of the loop if the node is found.\r break;\r }\r }\r }",
|
||||
"value": "() => { for (const child of children) { const nodes = findNodeById(child, id); if (nodes) { const ids = nodes.map((node) => node.id); const nodeIds = new Set(ids); expandNodes((node) => nodeIds.has(node.id)); const lastId = ids[ids.length - 1]; activeId = lastId; selectedIds = [lastId]; tick().then(() => { ref?.querySelector(`[id=\"${lastId}\"]`)?.focus(); }); // Break out of the loop if the node is found. break; } } }",
|
||||
"isFunction": true,
|
||||
"isFunctionDeclaration": true,
|
||||
"isRequired": false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue