added titleText slot to ComboBox and MultiSelect

This commit is contained in:
sach!n 2023-06-11 13:46:40 -07:00
commit dd0b43cc06
7 changed files with 374 additions and 239 deletions

View file

@ -409,7 +409,7 @@
"kind": "let",
"description": "Carbon grid sizes as an object",
"type": "Record<BreakpointSize, boolean>",
"value": "{ sm: false, md: false, lg: false, xlg: false, max: false, }",
"value": "{\r sm: false,\r md: false,\r lg: false,\r xlg: false,\r max: false,\r }",
"isFunction": false,
"isFunctionDeclaration": false,
"isRequired": false,
@ -1037,7 +1037,7 @@
"kind": "let",
"description": "Override the default copy behavior of using the navigator.clipboard.writeText API to copy text",
"type": "(code: string) => void",
"value": "async (code) => { try { await navigator.clipboard.writeText(code); } catch (e) { console.log(e); } }",
"value": "async (code) => {\r try {\r await navigator.clipboard.writeText(code);\r } catch (e) {\r console.log(e);\r }\r }",
"isFunction": true,
"isFunctionDeclaration": false,
"isRequired": false,
@ -1728,7 +1728,7 @@
"kind": "function",
"description": "Clear the combo box programmatically",
"type": "(options?: { focus?: boolean; }) => void",
"value": "() => { prevSelectedId = null; highlightedIndex = -1; highlightedId = undefined; selectedId = undefined; selectedItem = undefined; open = false; value = \"\"; if (options?.focus !== false) ref?.focus(); }",
"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 }",
"isFunction": true,
"isFunctionDeclaration": true,
"isRequired": false,
@ -1743,6 +1743,12 @@
"default": true,
"fallback": "{itemToString(item)}",
"slot_props": "{ item: ComboBoxItem; index: number }"
},
{
"name": "titleText",
"default": false,
"fallback": "{titleText}",
"slot_props": "{}"
}
],
"events": [
@ -2312,7 +2318,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) => { try { await navigator.clipboard.writeText(text); } catch (e) { console.log(e); } }",
"value": "async (text) => {\r try {\r await navigator.clipboard.writeText(text);\r } catch (e) {\r console.log(e);\r }\r }",
"isFunction": true,
"isFunctionDeclaration": false,
"isRequired": false,
@ -3781,7 +3787,7 @@
"kind": "const",
"description": "Programmatically clear the uploaded files",
"type": "() => void",
"value": "() => { files = []; }",
"value": "() => {\r files = [];\r }",
"isFunction": true,
"isFunctionDeclaration": false,
"isRequired": false,
@ -5332,7 +5338,7 @@
{
"name": "__default__",
"default": true,
"fallback": "{result.text}\n {#if result.description}<span> {result.description}</span>{/if}",
"fallback": "{result.text}\r\n {#if result.description}<span> {result.description}</span>{/if}",
"slot_props": "{ result: HeaderSearchResult; index: number }"
}
],
@ -5462,7 +5468,7 @@
"kind": "const",
"description": "Method invoked to load the image provided a `src` value",
"type": "(url?: string) => void",
"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); }",
"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 }",
"isFunction": true,
"isFunctionDeclaration": false,
"isRequired": false,
@ -6194,8 +6200,8 @@
"name": "translationIds",
"kind": "const",
"description": "Default translation ids",
"type": "{ clearAll: \"clearAll\", clearSelection: \"clearSelection\", }",
"value": "{ clearAll: \"clearAll\", clearSelection: \"clearSelection\", }",
"type": "{\r clearAll: \"clearAll\",\r clearSelection: \"clearSelection\",\r }",
"value": "{\r clearAll: \"clearAll\",\r clearSelection: \"clearSelection\",\r }",
"isFunction": false,
"isFunctionDeclaration": false,
"isRequired": false,
@ -6358,7 +6364,7 @@
"kind": "function",
"description": "Remove the persisted key value from the browser's local storage",
"type": "() => void",
"value": "() => { localStorage.removeItem(key); }",
"value": "() => {\r localStorage.removeItem(key);\r }",
"isFunction": true,
"isFunctionDeclaration": true,
"isRequired": false,
@ -6370,7 +6376,7 @@
"kind": "function",
"description": "Clear all key values from the browser's local storage",
"type": "() => void",
"value": "() => { localStorage.clear(); }",
"value": "() => {\r localStorage.clear();\r }",
"isFunction": true,
"isFunctionDeclaration": true,
"isRequired": false,
@ -7066,7 +7072,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) => item.text.toLowerCase().includes(value.trim().toLowerCase())",
"value": "(item, value) =>\r item.text.toLowerCase().includes(value.trim().toLowerCase())",
"isFunction": true,
"isFunctionDeclaration": false,
"isRequired": false,
@ -7126,7 +7132,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) => a.text.localeCompare(b.text, locale, { numeric: true })",
"value": "(a, b) =>\r a.text.localeCompare(b.text, locale, { numeric: true })",
"isFunction": true,
"isFunctionDeclaration": false,
"isRequired": false,
@ -7354,6 +7360,12 @@
"default": true,
"fallback": "{itemToString(item)}",
"slot_props": "{ item: MultiSelectItem; index: number }"
},
{
"name": "titleText",
"default": false,
"fallback": "{titleText}",
"slot_props": "{}"
}
],
"events": [
@ -7751,7 +7763,7 @@
"kind": "const",
"description": "Default translation ids",
"type": "{ increment: \"increment\"; decrement: \"decrement\" }",
"value": "{ increment: \"increment\", decrement: \"decrement\", }",
"value": "{\r increment: \"increment\",\r decrement: \"decrement\",\r }",
"isFunction": false,
"isFunctionDeclaration": false,
"isRequired": false,
@ -8072,7 +8084,7 @@
{
"name": "menu",
"default": false,
"fallback": "<svelte:component\n this=\"{icon}\"\n aria-label=\"{iconDescription}\"\n title=\"{iconDescription}\"\n class=\"bx--overflow-menu__icon {iconClass}\"\n />",
"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 />",
"slot_props": "{}"
}
],
@ -8209,7 +8221,7 @@
{
"name": "__default__",
"default": true,
"fallback": "<div class:bx--overflow-menu-options__option-content=\"{true}\">\n {text}\n </div>",
"fallback": "<div class:bx--overflow-menu-options__option-content=\"{true}\">\r\n {text}\r\n </div>",
"slot_props": "{}"
}
],
@ -8301,7 +8313,7 @@
"kind": "let",
"description": "Override the item text",
"type": "(min: number, max: number) => string",
"value": "(min, max) => `${min}${max} item${max === 1 ? \"\" : \"s\"}`",
"value": "(min, max) =>\r `${min}${max} item${max === 1 ? \"\" : \"s\"}`",
"isFunction": true,
"isFunctionDeclaration": false,
"isRequired": false,
@ -8313,7 +8325,7 @@
"kind": "let",
"description": "Override the item range text",
"type": "(min: number, max: number, total: number) => string",
"value": "(min, max, total) => `${min}${max} of ${total} item${max === 1 ? \"\" : \"s\"}`",
"value": "(min, max, total) =>\r `${min}${max} of ${total} item${max === 1 ? \"\" : \"s\"}`",
"isFunction": true,
"isFunctionDeclaration": false,
"isRequired": false,
@ -8397,7 +8409,7 @@
"kind": "let",
"description": "Override the page range text",
"type": "(current: number, total: number) => string",
"value": "(current, total) => `of ${total} page${total === 1 ? \"\" : \"s\"}`",
"value": "(current, total) =>\r `of ${total} page${total === 1 ? \"\" : \"s\"}`",
"isFunction": true,
"isFunctionDeclaration": false,
"isRequired": false,
@ -12924,7 +12936,7 @@
"kind": "let",
"description": "Override the default toggle props",
"type": "import(\"../Toggle/Toggle\").ToggleProps & { themes?: [labelA: CarbonTheme, labelB: CarbonTheme]; }",
"value": "{ themes: [\"white\", \"g100\"], labelA: \"\", labelB: \"\", labelText: \"Dark mode\", hideLabel: false, }",
"value": "{\r themes: [\"white\", \"g100\"],\r labelA: \"\",\r labelB: \"\",\r labelText: \"Dark mode\",\r hideLabel: false,\r }",
"isFunction": false,
"isFunctionDeclaration": false,
"isRequired": false,
@ -12936,7 +12948,7 @@
"kind": "let",
"description": "Override the default select props",
"type": "import(\"../Select/Select\").SelectProps & { themes?: CarbonTheme[]; }",
"value": "{ themes: themeKeys, labelText: \"Themes\", hideLabel: false, }",
"value": "{\r themes: themeKeys,\r labelText: \"Themes\",\r hideLabel: false,\r }",
"isFunction": false,
"isFunctionDeclaration": false,
"isRequired": false,
@ -13760,7 +13772,7 @@
"kind": "let",
"description": "Override the total items selected text",
"type": "(totalSelected: number) => string",
"value": "(totalSelected) => `${totalSelected} item${totalSelected === 1 ? \"\" : \"s\"} selected`",
"value": "(totalSelected) =>\r `${totalSelected} item${totalSelected === 1 ? \"\" : \"s\"} selected`",
"isFunction": true,
"isFunctionDeclaration": false,
"isRequired": false,
@ -14477,7 +14489,7 @@
"kind": "function",
"description": "Programmatically expand all nodes",
"type": "() => void",
"value": "() => { expandedIds = [...nodeIds]; }",
"value": "() => {\r expandedIds = [...nodeIds];\r }",
"isFunction": true,
"isFunctionDeclaration": true,
"isRequired": false,
@ -14489,7 +14501,7 @@
"kind": "function",
"description": "Programmatically collapse all nodes",
"type": "() => void",
"value": "() => { expandedIds = []; }",
"value": "() => {\r expandedIds = [];\r }",
"isFunction": true,
"isFunctionDeclaration": true,
"isRequired": false,
@ -14501,7 +14513,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": "() => { expandedIds = nodes .filter( (node) => filterNode(node) || node.children?.some((child) => filterNode(child) && child.children) ) .map((node) => node.id); }",
"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 }",
"isFunction": true,
"isFunctionDeclaration": true,
"isRequired": false,
@ -14513,7 +14525,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": "() => { expandedIds = nodes .filter((node) => expandedIds.includes(node.id) && !filterNode(node)) .map((node) => node.id); }",
"value": "() => {\r expandedIds = nodes\r .filter((node) => expandedIds.includes(node.id) && !filterNode(node))\r .map((node) => node.id);\r }",
"isFunction": true,
"isFunctionDeclaration": true,
"isRequired": false,