mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 19:46:36 +00:00
Add a parameter to prevent close panel when clicking outside.
This commit is contained in:
parent
c1c8309443
commit
8139a49304
5 changed files with 390 additions and 246 deletions
|
@ -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,
|
||||
|
@ -2312,7 +2312,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 +3781,7 @@
|
|||
"kind": "const",
|
||||
"description": "Programmatically clear the uploaded files",
|
||||
"type": "() => void",
|
||||
"value": "() => { files = []; }",
|
||||
"value": "() => {\r files = [];\r }",
|
||||
"isFunction": true,
|
||||
"isFunctionDeclaration": false,
|
||||
"isRequired": false,
|
||||
|
@ -4911,6 +4911,18 @@
|
|||
"isRequired": false,
|
||||
"constant": false,
|
||||
"reactive": false
|
||||
},
|
||||
{
|
||||
"name": "preventCloseOnClickOutside",
|
||||
"kind": "let",
|
||||
"description": "Set to `true` to prevent the panel from closing when clicking outside",
|
||||
"type": "boolean",
|
||||
"value": "false",
|
||||
"isFunction": false,
|
||||
"isFunctionDeclaration": false,
|
||||
"isRequired": false,
|
||||
"constant": false,
|
||||
"reactive": false
|
||||
}
|
||||
],
|
||||
"moduleExports": [],
|
||||
|
@ -5325,7 +5337,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 }"
|
||||
}
|
||||
],
|
||||
|
@ -5455,7 +5467,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,
|
||||
|
@ -6187,8 +6199,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,
|
||||
|
@ -6351,7 +6363,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,
|
||||
|
@ -6363,7 +6375,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,
|
||||
|
@ -7059,7 +7071,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,
|
||||
|
@ -7119,7 +7131,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,
|
||||
|
@ -7744,7 +7756,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,
|
||||
|
@ -8065,7 +8077,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": "{}"
|
||||
}
|
||||
],
|
||||
|
@ -8202,7 +8214,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": "{}"
|
||||
}
|
||||
],
|
||||
|
@ -8294,7 +8306,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,
|
||||
|
@ -8306,7 +8318,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,
|
||||
|
@ -8390,7 +8402,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,
|
||||
|
@ -12891,7 +12903,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,
|
||||
|
@ -12903,7 +12915,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,
|
||||
|
@ -13727,7 +13739,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,
|
||||
|
@ -14444,7 +14456,7 @@
|
|||
"kind": "function",
|
||||
"description": "Programmatically expand all nodes",
|
||||
"type": "() => void",
|
||||
"value": "() => { expandedIds = [...nodeIds]; }",
|
||||
"value": "() => {\r expandedIds = [...nodeIds];\r }",
|
||||
"isFunction": true,
|
||||
"isFunctionDeclaration": true,
|
||||
"isRequired": false,
|
||||
|
@ -14456,7 +14468,7 @@
|
|||
"kind": "function",
|
||||
"description": "Programmatically collapse all nodes",
|
||||
"type": "() => void",
|
||||
"value": "() => { expandedIds = []; }",
|
||||
"value": "() => {\r expandedIds = [];\r }",
|
||||
"isFunction": true,
|
||||
"isFunctionDeclaration": true,
|
||||
"isRequired": false,
|
||||
|
@ -14468,7 +14480,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,
|
||||
|
@ -14480,7 +14492,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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue