mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
Alignment with Carbon version 10.32 (#588)
* feat(code-snippet): add copy functionality - docs: add custom feedback copy text example * feat(tile): support disabled state for SelectableTile, RadioTile Closes #539 * build(rollup): add clipboard-copy to globals * feat(copy-button): add copy functionality * feat(content-switcher): deprecate the light prop - docs: remove the light variant example * fix(toolbar-search): remove outer div * feat(search): add searchClass prop * fix(composed-modal): set hasScrollingContent class on ModalBody * docs(data-table): add expandable size examples * feat(tooltip): add TooltipFooter component * fix(time-picker): correctly display invalidText * feat(breadcrumb): support overflow menu * feat(multi-select): export inputRef prop * chore(deps-dev): upgrade carbon-components to v10.32.0 * feat(form): add noMargin prop to FormGroup * docs(tooltip): document TooltipFooter * feat(context-menu): support danger kind for ContextMenuOption * feat(data-table): support rendering empty table header in skeleton * refactor(types): use shorter import path in DataTableSkeleton * feat(data-table): allow sorting to be disabled for a specific header * docs(data-table): update example to desort the Protocol header As an example, it makes more sense because all the values ("http") are the same. * fix(context-menu): set initial y offset of context menu based on window height #577 * fix(context-menu): render submenu based on viewport constraints #577
This commit is contained in:
parent
f13e3b100e
commit
fa9b90cd79
61 changed files with 825 additions and 233 deletions
|
@ -1,6 +1,6 @@
|
||||||
# Component Index
|
# Component Index
|
||||||
|
|
||||||
> 166 components exported from carbon-components-svelte@0.31.1.
|
> 167 components exported from carbon-components-svelte@0.31.1.
|
||||||
|
|
||||||
## Components
|
## Components
|
||||||
|
|
||||||
|
@ -167,6 +167,7 @@
|
||||||
- [`ToolbarSearch`](#toolbarsearch)
|
- [`ToolbarSearch`](#toolbarsearch)
|
||||||
- [`Tooltip`](#tooltip)
|
- [`Tooltip`](#tooltip)
|
||||||
- [`TooltipDefinition`](#tooltipdefinition)
|
- [`TooltipDefinition`](#tooltipdefinition)
|
||||||
|
- [`TooltipFooter`](#tooltipfooter)
|
||||||
- [`TooltipIcon`](#tooltipicon)
|
- [`TooltipIcon`](#tooltipicon)
|
||||||
- [`Truncate`](#truncate)
|
- [`Truncate`](#truncate)
|
||||||
- [`UnorderedList`](#unorderedlist)
|
- [`UnorderedList`](#unorderedlist)
|
||||||
|
@ -500,25 +501,25 @@ None.
|
||||||
|
|
||||||
### Props
|
### Props
|
||||||
|
|
||||||
| Prop name | Kind | Reactive | Type | Default value | Description |
|
| Prop name | Kind | Reactive | Type | Default value | Description |
|
||||||
| :-------------------- | :--------------- | :------- | :--------------------------------------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- |
|
| :-------------------- | :--------------- | :------- | :--------------------------------------------------- | ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| ref | <code>let</code> | Yes | <code>null | HTMLPreElement</code> | <code>null</code> | Obtain a reference to the pre HTML element |
|
| ref | <code>let</code> | Yes | <code>null | HTMLPreElement</code> | <code>null</code> | Obtain a reference to the pre HTML element |
|
||||||
| showMoreLess | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to enable the show more/less button |
|
| showMoreLess | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to enable the show more/less button |
|
||||||
| expanded | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to expand a multi-line code snippet (type="multi") |
|
| expanded | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to expand a multi-line code snippet (type="multi") |
|
||||||
| type | <code>let</code> | No | <code>"single" | "inline" | "multi"</code> | <code>"single"</code> | Set the type of code snippet |
|
| type | <code>let</code> | No | <code>"single" | "inline" | "multi"</code> | <code>"single"</code> | Set the type of code snippet |
|
||||||
| code | <code>let</code> | No | <code>string</code> | -- | Set the code snippet text<br />Alternatively, use the default slot (e.g., <CodeSnippet>{`code`}</CodeSnippet>) |
|
| code | <code>let</code> | No | <code>string</code> | -- | Set the code snippet text<br />Alternatively, use the default slot (e.g., <CodeSnippet>{`code`}</CodeSnippet>)<br />You must use the `code` prop to copy the code |
|
||||||
| hideCopyButton | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to hide the copy button |
|
| hideCopyButton | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to hide the copy button |
|
||||||
| disabled | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` for the disabled variant<br />Only applies to the "single", "multi" types |
|
| disabled | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` for the disabled variant<br />Only applies to the "single", "multi" types |
|
||||||
| wrapText | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to wrap the text<br />Note that `type` must be "multi" |
|
| wrapText | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to wrap the text<br />Note that `type` must be "multi" |
|
||||||
| light | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to enable the light variant |
|
| light | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to enable the light variant |
|
||||||
| skeleton | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to display the skeleton state |
|
| skeleton | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to display the skeleton state |
|
||||||
| copyButtonDescription | <code>let</code> | No | <code>string</code> | -- | Specify the ARIA label for the copy button icon |
|
| copyButtonDescription | <code>let</code> | No | <code>string</code> | -- | Specify the ARIA label for the copy button icon |
|
||||||
| copyLabel | <code>let</code> | No | <code>string</code> | -- | Specify the ARIA label of the copy button |
|
| copyLabel | <code>let</code> | No | <code>string</code> | -- | Specify the ARIA label of the copy button |
|
||||||
| feedback | <code>let</code> | No | <code>string</code> | <code>"Copied!"</code> | Specify the feedback text displayed when clicking the snippet |
|
| feedback | <code>let</code> | No | <code>string</code> | <code>"Copied!"</code> | Specify the feedback text displayed when clicking the snippet |
|
||||||
| feedbackTimeout | <code>let</code> | No | <code>number</code> | <code>2000</code> | Set the timeout duration (ms) to display feedback text |
|
| feedbackTimeout | <code>let</code> | No | <code>number</code> | <code>2000</code> | Set the timeout duration (ms) to display feedback text |
|
||||||
| showLessText | <code>let</code> | No | <code>string</code> | <code>"Show less"</code> | Specify the show less text<br />`type` must be "multi" |
|
| showLessText | <code>let</code> | No | <code>string</code> | <code>"Show less"</code> | Specify the show less text<br />`type` must be "multi" |
|
||||||
| showMoreText | <code>let</code> | No | <code>string</code> | <code>"Show more"</code> | Specify the show more text<br />`type` must be "multi" |
|
| showMoreText | <code>let</code> | No | <code>string</code> | <code>"Show more"</code> | Specify the show more text<br />`type` must be "multi" |
|
||||||
| id | <code>let</code> | No | <code>string</code> | <code>"ccs-" + Math.random().toString(36)</code> | Set an id for the code element |
|
| id | <code>let</code> | No | <code>string</code> | <code>"ccs-" + Math.random().toString(36)</code> | Set an id for the code element |
|
||||||
|
|
||||||
### Slots
|
### Slots
|
||||||
|
|
||||||
|
@ -528,13 +529,14 @@ None.
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
|
||||||
| Event name | Type | Detail |
|
| Event name | Type | Detail |
|
||||||
| :----------- | :-------- | :----- |
|
| :----------- | :--------- | :----- |
|
||||||
| click | forwarded | -- |
|
| click | forwarded | -- |
|
||||||
| mouseover | forwarded | -- |
|
| mouseover | forwarded | -- |
|
||||||
| mouseenter | forwarded | -- |
|
| mouseenter | forwarded | -- |
|
||||||
| mouseleave | forwarded | -- |
|
| mouseleave | forwarded | -- |
|
||||||
| animationend | forwarded | -- |
|
| animationend | forwarded | -- |
|
||||||
|
| copy | dispatched | -- |
|
||||||
|
|
||||||
## `CodeSnippetSkeleton`
|
## `CodeSnippetSkeleton`
|
||||||
|
|
||||||
|
@ -798,6 +800,7 @@ None.
|
||||||
| selected | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to use the selected variant |
|
| selected | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to use the selected variant |
|
||||||
| icon | <code>let</code> | Yes | <code>typeof import("carbon-icons-svelte").CarbonIcon</code> | -- | Specify the icon from `carbon-icons-svelte` to render<br />Icon is rendered to the left of the label text |
|
| icon | <code>let</code> | Yes | <code>typeof import("carbon-icons-svelte").CarbonIcon</code> | -- | Specify the icon from `carbon-icons-svelte` to render<br />Icon is rendered to the left of the label text |
|
||||||
| indented | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to indent the label |
|
| indented | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to indent the label |
|
||||||
|
| kind | <code>let</code> | No | <code>"default" | "danger"</code> | <code>"default"</code> | Specify the kind of option |
|
||||||
| disabled | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to enable the disabled state |
|
| disabled | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to enable the disabled state |
|
||||||
| labelText | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the label text<br />Alternatively, use the "labelText" slot (e.g., <span slot="labelText">...</span>) |
|
| labelText | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the label text<br />Alternatively, use the "labelText" slot (e.g., <span slot="labelText">...</span>) |
|
||||||
| shortcutText | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the shortcut text<br />Alternatively, use the "shortcutText" slot (e.g., <span slot="shortcutText">...</span>) |
|
| shortcutText | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the shortcut text<br />Alternatively, use the "shortcutText" slot (e.g., <span slot="shortcutText">...</span>) |
|
||||||
|
@ -869,6 +872,7 @@ None.
|
||||||
| Prop name | Kind | Reactive | Type | Default value | Description |
|
| Prop name | Kind | Reactive | Type | Default value | Description |
|
||||||
| :-------------- | :--------------- | :------- | :------------------ | -------------------------------- | ------------------------------------------------ |
|
| :-------------- | :--------------- | :------- | :------------------ | -------------------------------- | ------------------------------------------------ |
|
||||||
| iconDescription | <code>let</code> | No | <code>string</code> | <code>"Copy to clipboard"</code> | Set the title and ARIA label for the copy button |
|
| iconDescription | <code>let</code> | No | <code>string</code> | <code>"Copy to clipboard"</code> | Set the title and ARIA label for the copy button |
|
||||||
|
| text | <code>let</code> | No | <code>string</code> | -- | Specify the text to copy |
|
||||||
|
|
||||||
### Slots
|
### Slots
|
||||||
|
|
||||||
|
@ -876,10 +880,11 @@ None.
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
|
||||||
| Event name | Type | Detail |
|
| Event name | Type | Detail |
|
||||||
| :----------- | :-------- | :----- |
|
| :----------- | :--------- | :----- |
|
||||||
| click | forwarded | -- |
|
| click | forwarded | -- |
|
||||||
| animationend | forwarded | -- |
|
| animationend | forwarded | -- |
|
||||||
|
| copy | dispatched | -- |
|
||||||
|
|
||||||
## `DataTable`
|
## `DataTable`
|
||||||
|
|
||||||
|
@ -894,7 +899,7 @@ export interface DataTableEmptyHeader {
|
||||||
key: DataTableKey;
|
key: DataTableKey;
|
||||||
empty: boolean;
|
empty: boolean;
|
||||||
display?: (item: Value) => DataTableValue;
|
display?: (item: Value) => DataTableValue;
|
||||||
sort?: (a: DataTableValue, b: DataTableValue) => 0 | -1 | 1;
|
sort?: false | ((a: DataTableValue, b: DataTableValue) => 0 | -1 | 1);
|
||||||
columnMenu?: boolean;
|
columnMenu?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -902,7 +907,7 @@ export interface DataTableNonEmptyHeader {
|
||||||
key: DataTableKey;
|
key: DataTableKey;
|
||||||
value: DataTableValue;
|
value: DataTableValue;
|
||||||
display?: (item: Value) => DataTableValue;
|
display?: (item: Value) => DataTableValue;
|
||||||
sort?: (a: DataTableValue, b: DataTableValue) => 0 | -1 | 1;
|
sort?: false | ((a: DataTableValue, b: DataTableValue) => 0 | -1 | 1);
|
||||||
columnMenu?: boolean;
|
columnMenu?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -952,16 +957,16 @@ export interface DataTableCell {
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
|
||||||
| Event name | Type | Detail |
|
| Event name | Type | Detail |
|
||||||
| :------------------- | :--------- | :----------------------------------------------------------------------------------------------------- |
|
| :------------------- | :--------- | :------------------------------------------------------------------------------------------------------ |
|
||||||
| click | dispatched | <code>{ header?: DataTableHeader; row?: DataTableRow; cell?: DataTableCell; }</code> |
|
| click | dispatched | <code>{ header?: DataTableHeader; row?: DataTableRow; cell?: DataTableCell; }</code> |
|
||||||
| click:header--expand | dispatched | <code>{ expanded: boolean; }</code> |
|
| click:header--expand | dispatched | <code>{ expanded: boolean; }</code> |
|
||||||
| click:header | dispatched | <code>{ header: DataTableHeader; sortDirection: "ascending" | "descending" | "none" }</code> |
|
| click:header | dispatched | <code>{ header: DataTableHeader; sortDirection?: "ascending" | "descending" | "none" }</code> |
|
||||||
| click:row | dispatched | <code>DataTableRow</code> |
|
| click:row | dispatched | <code>DataTableRow</code> |
|
||||||
| mouseenter:row | dispatched | <code>DataTableRow</code> |
|
| mouseenter:row | dispatched | <code>DataTableRow</code> |
|
||||||
| mouseleave:row | dispatched | <code>DataTableRow</code> |
|
| mouseleave:row | dispatched | <code>DataTableRow</code> |
|
||||||
| click:row--expand | dispatched | <code>{ expanded: boolean; row: DataTableRow; }</code> |
|
| click:row--expand | dispatched | <code>{ expanded: boolean; row: DataTableRow; }</code> |
|
||||||
| click:cell | dispatched | <code>DataTableCell</code> |
|
| click:cell | dispatched | <code>DataTableCell</code> |
|
||||||
|
|
||||||
## `DataTableSkeleton`
|
## `DataTableSkeleton`
|
||||||
|
|
||||||
|
@ -1402,12 +1407,13 @@ None.
|
||||||
|
|
||||||
### Props
|
### Props
|
||||||
|
|
||||||
| Prop name | Kind | Reactive | Type | Default value | Description |
|
| Prop name | Kind | Reactive | Type | Default value | Description |
|
||||||
| :---------- | :--------------- | :------- | :------------------- | ------------------ | ------------------------------------------ |
|
| :---------- | :--------------- | :------- | :------------------- | ------------------ | --------------------------------------------- |
|
||||||
| invalid | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to indicate an invalid state |
|
| invalid | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to indicate an invalid state |
|
||||||
| message | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to render a form requirement |
|
| message | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to render a form requirement |
|
||||||
| messageText | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the message text |
|
| noMargin | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` for to remove the bottom margin |
|
||||||
| legendText | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the legend text |
|
| messageText | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the message text |
|
||||||
|
| legendText | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the legend text |
|
||||||
|
|
||||||
### Slots
|
### Slots
|
||||||
|
|
||||||
|
@ -2323,6 +2329,7 @@ export interface MultiSelectItem {
|
||||||
|
|
||||||
| Prop name | Kind | Reactive | Type | Default value | Description |
|
| Prop name | Kind | Reactive | Type | Default value | Description |
|
||||||
| :---------------- | :--------------- | :------- | :--------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
|
| :---------------- | :--------------- | :------- | :--------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
|
||||||
|
| inputRef | <code>let</code> | Yes | <code>null | HTMLInputElement</code> | <code>null</code> | Obtain a reference to the input HTML element |
|
||||||
| open | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to open the dropdown |
|
| open | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to open the dropdown |
|
||||||
| value | <code>let</code> | Yes | <code>string</code> | <code>""</code> | Specify the multiselect value |
|
| value | <code>let</code> | Yes | <code>string</code> | <code>""</code> | Specify the multiselect value |
|
||||||
| selectedIds | <code>let</code> | Yes | <code>MultiSelectItemId[]</code> | <code>[]</code> | Set the selected ids |
|
| selectedIds | <code>let</code> | Yes | <code>MultiSelectItemId[]</code> | <code>[]</code> | Set the selected ids |
|
||||||
|
@ -2576,13 +2583,13 @@ None.
|
||||||
| :--------------- | :--------------- | :------- | :----------------------------------------------------------- | ------------------------------------------------ | ----------------------------------------------------------------- |
|
| :--------------- | :--------------- | :------- | :----------------------------------------------------------- | ------------------------------------------------ | ----------------------------------------------------------------- |
|
||||||
| menuRef | <code>let</code> | Yes | <code>null | HTMLUListElement</code> | <code>null</code> | Obtain a reference to the overflow menu element |
|
| menuRef | <code>let</code> | Yes | <code>null | HTMLUListElement</code> | <code>null</code> | Obtain a reference to the overflow menu element |
|
||||||
| buttonRef | <code>let</code> | Yes | <code>null | HTMLButtonElement</code> | <code>null</code> | Obtain a reference to the trigger button element |
|
| buttonRef | <code>let</code> | Yes | <code>null | HTMLButtonElement</code> | <code>null</code> | Obtain a reference to the trigger button element |
|
||||||
|
| icon | <code>let</code> | Yes | <code>typeof import("carbon-icons-svelte").CarbonIcon</code> | -- | Specify the icon from `carbon-icons-svelte` to render |
|
||||||
| open | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to open the menu |
|
| open | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to open the menu |
|
||||||
| size | <code>let</code> | No | <code>"sm" | "xl"</code> | -- | Specify the size of the overflow menu |
|
| size | <code>let</code> | No | <code>"sm" | "xl"</code> | -- | Specify the size of the overflow menu |
|
||||||
| direction | <code>let</code> | No | <code>"top" | "bottom"</code> | <code>"bottom"</code> | Specify the direction of the overflow menu relative to the button |
|
| direction | <code>let</code> | No | <code>"top" | "bottom"</code> | <code>"bottom"</code> | Specify the direction of the overflow menu relative to the button |
|
||||||
| light | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to enable the light variant |
|
| light | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to enable the light variant |
|
||||||
| flipped | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to flip the menu relative to the button |
|
| flipped | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to flip the menu relative to the button |
|
||||||
| menuOptionsClass | <code>let</code> | No | <code>string</code> | -- | Specify the menu options class |
|
| menuOptionsClass | <code>let</code> | No | <code>string</code> | -- | Specify the menu options class |
|
||||||
| icon | <code>let</code> | No | <code>typeof import("carbon-icons-svelte").CarbonIcon</code> | -- | Specify the icon from `carbon-icons-svelte` to render |
|
|
||||||
| iconClass | <code>let</code> | No | <code>string</code> | -- | Specify the icon class |
|
| iconClass | <code>let</code> | No | <code>string</code> | -- | Specify the icon class |
|
||||||
| iconDescription | <code>let</code> | No | <code>string</code> | <code>"Open and close list of options"</code> | Specify the ARIA label for the icon |
|
| iconDescription | <code>let</code> | No | <code>string</code> | <code>"Open and close list of options"</code> | Specify the ARIA label for the icon |
|
||||||
| id | <code>let</code> | No | <code>string</code> | <code>"ccs-" + Math.random().toString(36)</code> | Set an id for the button element |
|
| id | <code>let</code> | No | <code>string</code> | <code>"ccs-" + Math.random().toString(36)</code> | Set an id for the button element |
|
||||||
|
@ -2945,6 +2952,7 @@ None.
|
||||||
| :-------------- | :--------------- | :------- | :------------------- | ------------------------------------------------ | -------------------------------------------------------- |
|
| :-------------- | :--------------- | :------- | :------------------- | ------------------------------------------------ | -------------------------------------------------------- |
|
||||||
| checked | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to check the tile |
|
| checked | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to check the tile |
|
||||||
| light | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to enable the light variant |
|
| light | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to enable the light variant |
|
||||||
|
| disabled | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to disable the tile |
|
||||||
| value | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the value of the radio input |
|
| value | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the value of the radio input |
|
||||||
| tabindex | <code>let</code> | No | <code>string</code> | <code>"0"</code> | Specify the tabindex |
|
| tabindex | <code>let</code> | No | <code>string</code> | <code>"0"</code> | Specify the tabindex |
|
||||||
| iconDescription | <code>let</code> | No | <code>string</code> | <code>"Tile checkmark"</code> | Specify the ARIA label for the radio tile checkmark icon |
|
| iconDescription | <code>let</code> | No | <code>string</code> | <code>"Tile checkmark"</code> | Specify the ARIA label for the radio tile checkmark icon |
|
||||||
|
@ -3002,6 +3010,7 @@ None.
|
||||||
| value | <code>let</code> | Yes | <code>string</code> | <code>""</code> | Specify the value of the search input |
|
| value | <code>let</code> | Yes | <code>string</code> | <code>""</code> | Specify the value of the search input |
|
||||||
| small | <code>let</code> | No | <code>boolean</code> | <code>false</code> | -- |
|
| small | <code>let</code> | No | <code>boolean</code> | <code>false</code> | -- |
|
||||||
| size | <code>let</code> | No | <code>"sm" | "lg" | "xl"</code> | <code>"xl"</code> | Specify the size of the search input |
|
| size | <code>let</code> | No | <code>"sm" | "lg" | "xl"</code> | <code>"xl"</code> | Specify the size of the search input |
|
||||||
|
| searchClass | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the class name passed to the outer div element |
|
||||||
| skeleton | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to display the skeleton state |
|
| skeleton | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to display the skeleton state |
|
||||||
| light | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to enable the light variant |
|
| light | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to enable the light variant |
|
||||||
| disabled | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to disable the search input |
|
| disabled | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to disable the search input |
|
||||||
|
@ -3158,6 +3167,7 @@ None.
|
||||||
| ref | <code>let</code> | Yes | <code>null | HTMLInputElement</code> | <code>null</code> | Obtain a reference to the input HTML element |
|
| ref | <code>let</code> | Yes | <code>null | HTMLInputElement</code> | <code>null</code> | Obtain a reference to the input HTML element |
|
||||||
| selected | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to select the tile |
|
| selected | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to select the tile |
|
||||||
| light | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to enable the light variant |
|
| light | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to enable the light variant |
|
||||||
|
| disabled | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to disable the tile |
|
||||||
| title | <code>let</code> | No | <code>string</code> | <code>"title"</code> | Specify the title of the selectable tile |
|
| title | <code>let</code> | No | <code>string</code> | <code>"title"</code> | Specify the title of the selectable tile |
|
||||||
| value | <code>let</code> | No | <code>string</code> | <code>"value"</code> | Specify the value of the selectable tile |
|
| value | <code>let</code> | No | <code>string</code> | <code>"value"</code> | Specify the value of the selectable tile |
|
||||||
| tabindex | <code>let</code> | No | <code>string</code> | <code>"0"</code> | Specify the tabindex |
|
| tabindex | <code>let</code> | No | <code>string</code> | <code>"0"</code> | Specify the tabindex |
|
||||||
|
@ -3762,11 +3772,12 @@ None.
|
||||||
|
|
||||||
### Props
|
### Props
|
||||||
|
|
||||||
| Prop name | Kind | Reactive | Type | Default value | Description |
|
| Prop name | Kind | Reactive | Type | Default value | Description |
|
||||||
| :-------------- | :--------------- | :------- | :------------------------ | ------------------------------------------------ | ------------------------------------ |
|
| :-------------- | :--------------- | :------- | :------------------------ | ------------------------------------------------ | ------------------------------------------------------ |
|
||||||
| scope | <code>let</code> | No | <code>string</code> | <code>"col"</code> | Specify the `scope` attribute |
|
| disableSorting | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to disable sorting on this specific cell |
|
||||||
| translateWithId | <code>let</code> | No | <code>() => string</code> | <code>() => ""</code> | Override the default id translations |
|
| scope | <code>let</code> | No | <code>string</code> | <code>"col"</code> | Specify the `scope` attribute |
|
||||||
| id | <code>let</code> | No | <code>string</code> | <code>"ccs-" + Math.random().toString(36)</code> | Set an id for the top-level element |
|
| translateWithId | <code>let</code> | No | <code>() => string</code> | <code>() => ""</code> | Override the default id translations |
|
||||||
|
| id | <code>let</code> | No | <code>string</code> | <code>"ccs-" + Math.random().toString(36)</code> | Set an id for the top-level element |
|
||||||
|
|
||||||
### Slots
|
### Slots
|
||||||
|
|
||||||
|
@ -4464,6 +4475,24 @@ None.
|
||||||
| mouseleave | forwarded | -- |
|
| mouseleave | forwarded | -- |
|
||||||
| focus | forwarded | -- |
|
| focus | forwarded | -- |
|
||||||
|
|
||||||
|
## `TooltipFooter`
|
||||||
|
|
||||||
|
### Props
|
||||||
|
|
||||||
|
| Prop name | Kind | Reactive | Type | Default value | Description |
|
||||||
|
| :------------------- | :--------------- | :------- | :------------------ | ---------------------------------------------- | --------------------------------------------------------------------------- |
|
||||||
|
| selectorPrimaryFocus | <code>let</code> | No | <code>string</code> | <code>"a[href], button:not([disabled])"</code> | Specify a selector to be focused inside the footer when opening the tooltip |
|
||||||
|
|
||||||
|
### Slots
|
||||||
|
|
||||||
|
| Slot name | Default | Props | Fallback |
|
||||||
|
| :-------- | :------ | :---- | :------- |
|
||||||
|
| -- | Yes | -- | -- |
|
||||||
|
|
||||||
|
### Events
|
||||||
|
|
||||||
|
None.
|
||||||
|
|
||||||
## `TooltipIcon`
|
## `TooltipIcon`
|
||||||
|
|
||||||
### Props
|
### Props
|
||||||
|
|
|
@ -11,9 +11,8 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@sveltech/routify": "^1.9.9",
|
"@sveltech/routify": "^1.9.9",
|
||||||
"autoprefixer": "^10.2.3",
|
"autoprefixer": "^10.2.3",
|
||||||
"carbon-components": "10.31.0",
|
"carbon-components": "10.32.0",
|
||||||
"carbon-components-svelte": "../",
|
"carbon-components-svelte": "../",
|
||||||
"clipboard-copy": "^3.1.0",
|
|
||||||
"mdsvex": "^0.8.8",
|
"mdsvex": "^0.8.8",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
"postcss": "^8.2.4",
|
"postcss": "^8.2.4",
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"total": 166,
|
"total": 167,
|
||||||
"components": [
|
"components": [
|
||||||
{
|
{
|
||||||
"moduleName": "Accordion",
|
"moduleName": "Accordion",
|
||||||
|
@ -805,7 +805,7 @@
|
||||||
{
|
{
|
||||||
"name": "code",
|
"name": "code",
|
||||||
"kind": "let",
|
"kind": "let",
|
||||||
"description": "Set the code snippet text\nAlternatively, use the default slot (e.g., <CodeSnippet>{`code`}</CodeSnippet>)",
|
"description": "Set the code snippet text\nAlternatively, use the default slot (e.g., <CodeSnippet>{`code`}</CodeSnippet>)\nYou must use the `code` prop to copy the code",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"isFunction": false,
|
"isFunction": false,
|
||||||
"constant": false,
|
"constant": false,
|
||||||
|
@ -989,7 +989,12 @@
|
||||||
"name": "mouseleave",
|
"name": "mouseleave",
|
||||||
"element": "CodeSnippetSkeleton"
|
"element": "CodeSnippetSkeleton"
|
||||||
},
|
},
|
||||||
{ "type": "forwarded", "name": "animationend", "element": "CopyButton" }
|
{
|
||||||
|
"type": "forwarded",
|
||||||
|
"name": "animationend",
|
||||||
|
"element": "CopyButton"
|
||||||
|
},
|
||||||
|
{ "type": "dispatched", "name": "copy" }
|
||||||
],
|
],
|
||||||
"typedefs": [],
|
"typedefs": [],
|
||||||
"rest_props": { "type": "InlineComponent", "name": "CodeSnippetSkeleton" }
|
"rest_props": { "type": "InlineComponent", "name": "CodeSnippetSkeleton" }
|
||||||
|
@ -1651,6 +1656,16 @@
|
||||||
"moduleName": "ContextMenuOption",
|
"moduleName": "ContextMenuOption",
|
||||||
"filePath": "src/ContextMenu/ContextMenuOption.svelte",
|
"filePath": "src/ContextMenu/ContextMenuOption.svelte",
|
||||||
"props": [
|
"props": [
|
||||||
|
{
|
||||||
|
"name": "kind",
|
||||||
|
"kind": "let",
|
||||||
|
"description": "Specify the kind of option",
|
||||||
|
"type": "\"default\" | \"danger\"",
|
||||||
|
"value": "\"default\"",
|
||||||
|
"isFunction": false,
|
||||||
|
"constant": false,
|
||||||
|
"reactive": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "disabled",
|
"name": "disabled",
|
||||||
"kind": "let",
|
"kind": "let",
|
||||||
|
@ -1857,12 +1872,22 @@
|
||||||
"isFunction": false,
|
"isFunction": false,
|
||||||
"constant": false,
|
"constant": false,
|
||||||
"reactive": false
|
"reactive": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "text",
|
||||||
|
"kind": "let",
|
||||||
|
"description": "Specify the text to copy",
|
||||||
|
"type": "string",
|
||||||
|
"isFunction": false,
|
||||||
|
"constant": false,
|
||||||
|
"reactive": false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"slots": [],
|
"slots": [],
|
||||||
"events": [
|
"events": [
|
||||||
{ "type": "forwarded", "name": "click", "element": "Copy" },
|
{ "type": "forwarded", "name": "click", "element": "Copy" },
|
||||||
{ "type": "forwarded", "name": "animationend", "element": "Copy" }
|
{ "type": "forwarded", "name": "animationend", "element": "Copy" },
|
||||||
|
{ "type": "dispatched", "name": "copy" }
|
||||||
],
|
],
|
||||||
"typedefs": [],
|
"typedefs": [],
|
||||||
"rest_props": { "type": "InlineComponent", "name": "Copy" },
|
"rest_props": { "type": "InlineComponent", "name": "Copy" },
|
||||||
|
@ -2056,7 +2081,7 @@
|
||||||
{
|
{
|
||||||
"type": "dispatched",
|
"type": "dispatched",
|
||||||
"name": "click:header",
|
"name": "click:header",
|
||||||
"detail": "{ header: DataTableHeader; sortDirection: \"ascending\" | \"descending\" | \"none\" }"
|
"detail": "{ header: DataTableHeader; sortDirection?: \"ascending\" | \"descending\" | \"none\" }"
|
||||||
},
|
},
|
||||||
{ "type": "dispatched", "name": "click:row", "detail": "DataTableRow" },
|
{ "type": "dispatched", "name": "click:row", "detail": "DataTableRow" },
|
||||||
{
|
{
|
||||||
|
@ -2092,14 +2117,14 @@
|
||||||
"ts": "type DataTableValue = any"
|
"ts": "type DataTableValue = any"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "{ key: DataTableKey; empty: boolean; display?: (item: Value) => DataTableValue; sort?: (a: DataTableValue, b: DataTableValue) => (0 | -1 | 1); columnMenu?: boolean; }",
|
"type": "{ key: DataTableKey; empty: boolean; display?: (item: Value) => DataTableValue; sort?: false | ((a: DataTableValue, b: DataTableValue) => (0 | -1 | 1)); columnMenu?: boolean; }",
|
||||||
"name": "DataTableEmptyHeader",
|
"name": "DataTableEmptyHeader",
|
||||||
"ts": "interface DataTableEmptyHeader { key: DataTableKey; empty: boolean; display?: (item: Value) => DataTableValue; sort?: (a: DataTableValue, b: DataTableValue) => (0 | -1 | 1); columnMenu?: boolean; }"
|
"ts": "interface DataTableEmptyHeader { key: DataTableKey; empty: boolean; display?: (item: Value) => DataTableValue; sort?: false | ((a: DataTableValue, b: DataTableValue) => (0 | -1 | 1)); columnMenu?: boolean; }"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "{ key: DataTableKey; value: DataTableValue; display?: (item: Value) => DataTableValue; sort?: (a: DataTableValue, b: DataTableValue) => (0 | -1 | 1); columnMenu?: boolean; }",
|
"type": "{ key: DataTableKey; value: DataTableValue; display?: (item: Value) => DataTableValue; sort?: false | ((a: DataTableValue, b: DataTableValue) => (0 | -1 | 1)); columnMenu?: boolean; }",
|
||||||
"name": "DataTableNonEmptyHeader",
|
"name": "DataTableNonEmptyHeader",
|
||||||
"ts": "interface DataTableNonEmptyHeader { key: DataTableKey; value: DataTableValue; display?: (item: Value) => DataTableValue; sort?: (a: DataTableValue, b: DataTableValue) => (0 | -1 | 1); columnMenu?: boolean; }"
|
"ts": "interface DataTableNonEmptyHeader { key: DataTableKey; value: DataTableValue; display?: (item: Value) => DataTableValue; sort?: false | ((a: DataTableValue, b: DataTableValue) => (0 | -1 | 1)); columnMenu?: boolean; }"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "DataTableNonEmptyHeader | DataTableEmptyHeader",
|
"type": "DataTableNonEmptyHeader | DataTableEmptyHeader",
|
||||||
|
@ -2207,10 +2232,7 @@
|
||||||
],
|
],
|
||||||
"typedefs": [],
|
"typedefs": [],
|
||||||
"rest_props": { "type": "Element", "name": "div" },
|
"rest_props": { "type": "Element", "name": "div" },
|
||||||
"extends": {
|
"extends": { "interface": "DataTableHeader", "import": "\"./DataTable\"" }
|
||||||
"interface": "DataTableHeader",
|
|
||||||
"import": "\"../DataTable/DataTable\""
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"moduleName": "DatePicker",
|
"moduleName": "DatePicker",
|
||||||
|
@ -3499,6 +3521,16 @@
|
||||||
"constant": false,
|
"constant": false,
|
||||||
"reactive": false
|
"reactive": false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "noMargin",
|
||||||
|
"kind": "let",
|
||||||
|
"description": "Set to `true` for to remove the bottom margin",
|
||||||
|
"type": "boolean",
|
||||||
|
"value": "false",
|
||||||
|
"isFunction": false,
|
||||||
|
"constant": false,
|
||||||
|
"reactive": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "messageText",
|
"name": "messageText",
|
||||||
"kind": "let",
|
"kind": "let",
|
||||||
|
@ -5766,6 +5798,16 @@
|
||||||
"isFunction": false,
|
"isFunction": false,
|
||||||
"constant": false,
|
"constant": false,
|
||||||
"reactive": false
|
"reactive": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "inputRef",
|
||||||
|
"kind": "let",
|
||||||
|
"description": "Obtain a reference to the input HTML element",
|
||||||
|
"type": "null | HTMLInputElement",
|
||||||
|
"value": "null",
|
||||||
|
"isFunction": false,
|
||||||
|
"constant": false,
|
||||||
|
"reactive": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"slots": [],
|
"slots": [],
|
||||||
|
@ -6354,7 +6396,7 @@
|
||||||
"type": "typeof import(\"carbon-icons-svelte\").CarbonIcon",
|
"type": "typeof import(\"carbon-icons-svelte\").CarbonIcon",
|
||||||
"isFunction": false,
|
"isFunction": false,
|
||||||
"constant": false,
|
"constant": false,
|
||||||
"reactive": false
|
"reactive": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "iconClass",
|
"name": "iconClass",
|
||||||
|
@ -7518,6 +7560,16 @@
|
||||||
"constant": false,
|
"constant": false,
|
||||||
"reactive": false
|
"reactive": false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "disabled",
|
||||||
|
"kind": "let",
|
||||||
|
"description": "Set to `true` to disable the tile",
|
||||||
|
"type": "boolean",
|
||||||
|
"value": "false",
|
||||||
|
"isFunction": false,
|
||||||
|
"constant": false,
|
||||||
|
"reactive": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "value",
|
"name": "value",
|
||||||
"kind": "let",
|
"kind": "let",
|
||||||
|
@ -7690,6 +7742,16 @@
|
||||||
"constant": false,
|
"constant": false,
|
||||||
"reactive": false
|
"reactive": false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "searchClass",
|
||||||
|
"kind": "let",
|
||||||
|
"description": "Specify the class name passed to the outer div element",
|
||||||
|
"type": "string",
|
||||||
|
"value": "\"\"",
|
||||||
|
"isFunction": false,
|
||||||
|
"constant": false,
|
||||||
|
"reactive": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "skeleton",
|
"name": "skeleton",
|
||||||
"kind": "let",
|
"kind": "let",
|
||||||
|
@ -8171,6 +8233,16 @@
|
||||||
"constant": false,
|
"constant": false,
|
||||||
"reactive": false
|
"reactive": false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "disabled",
|
||||||
|
"kind": "let",
|
||||||
|
"description": "Set to `true` to disable the tile",
|
||||||
|
"type": "boolean",
|
||||||
|
"value": "false",
|
||||||
|
"isFunction": false,
|
||||||
|
"constant": false,
|
||||||
|
"reactive": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "title",
|
"name": "title",
|
||||||
"kind": "let",
|
"kind": "let",
|
||||||
|
@ -9369,6 +9441,16 @@
|
||||||
"moduleName": "TableHeader",
|
"moduleName": "TableHeader",
|
||||||
"filePath": "src/DataTable/TableHeader.svelte",
|
"filePath": "src/DataTable/TableHeader.svelte",
|
||||||
"props": [
|
"props": [
|
||||||
|
{
|
||||||
|
"name": "disableSorting",
|
||||||
|
"kind": "let",
|
||||||
|
"description": "Set to `true` to disable sorting on this specific cell",
|
||||||
|
"type": "boolean",
|
||||||
|
"value": "false",
|
||||||
|
"isFunction": false,
|
||||||
|
"constant": false,
|
||||||
|
"reactive": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "scope",
|
"name": "scope",
|
||||||
"kind": "let",
|
"kind": "let",
|
||||||
|
@ -11157,6 +11239,25 @@
|
||||||
"typedefs": [],
|
"typedefs": [],
|
||||||
"rest_props": { "type": "Element", "name": "div" }
|
"rest_props": { "type": "Element", "name": "div" }
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"moduleName": "TooltipFooter",
|
||||||
|
"filePath": "src/Tooltip/TooltipFooter.svelte",
|
||||||
|
"props": [
|
||||||
|
{
|
||||||
|
"name": "selectorPrimaryFocus",
|
||||||
|
"kind": "let",
|
||||||
|
"description": "Specify a selector to be focused inside the footer when opening the tooltip",
|
||||||
|
"type": "string",
|
||||||
|
"value": "\"a[href], button:not([disabled])\"",
|
||||||
|
"isFunction": false,
|
||||||
|
"constant": false,
|
||||||
|
"reactive": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"slots": [{ "name": "__default__", "default": true, "slot_props": "{}" }],
|
||||||
|
"events": [],
|
||||||
|
"typedefs": []
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"moduleName": "TooltipIcon",
|
"moduleName": "TooltipIcon",
|
||||||
"filePath": "src/TooltipIcon/TooltipIcon.svelte",
|
"filePath": "src/TooltipIcon/TooltipIcon.svelte",
|
||||||
|
|
|
@ -2,17 +2,10 @@
|
||||||
export let code = "";
|
export let code = "";
|
||||||
|
|
||||||
import { CodeSnippet } from "carbon-components-svelte";
|
import { CodeSnippet } from "carbon-components-svelte";
|
||||||
import copy from "clipboard-copy";
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<CodeSnippet
|
<CodeSnippet code="{code}" type="inline" />
|
||||||
code="{code}"
|
|
||||||
type="inline"
|
|
||||||
on:click="{() => {
|
|
||||||
copy(code);
|
|
||||||
}}"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
import { CodeSnippet, Button } from "carbon-components-svelte";
|
import { CodeSnippet, Button } from "carbon-components-svelte";
|
||||||
import Launch16 from "carbon-icons-svelte/lib/Launch16";
|
import Launch16 from "carbon-icons-svelte/lib/Launch16";
|
||||||
import copy from "clipboard-copy";
|
|
||||||
import { url } from "@sveltech/routify";
|
import { url } from "@sveltech/routify";
|
||||||
import { theme } from "../store";
|
import { theme } from "../store";
|
||||||
|
|
||||||
|
@ -41,7 +40,7 @@
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<div class="code-override">
|
<div class="code-override">
|
||||||
<CodeSnippet type="multi" on:click="{() => copy(codeRaw)}">
|
<CodeSnippet type="multi" code="{codeRaw}">
|
||||||
{@html code}
|
{@html code}
|
||||||
</CodeSnippet>
|
</CodeSnippet>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -105,7 +105,11 @@
|
||||||
>
|
>
|
||||||
{child.title}
|
{child.title}
|
||||||
{#if deprecated.includes(child.title)}
|
{#if deprecated.includes(child.title)}
|
||||||
<Tag size="sm" type="red" style="margin-top: 0; margin-bottom: 0">
|
<Tag
|
||||||
|
size="sm"
|
||||||
|
type="red"
|
||||||
|
style="margin-top: 0; margin-bottom: 0; cursor: inherit"
|
||||||
|
>
|
||||||
Deprecated
|
Deprecated
|
||||||
</Tag>
|
</Tag>
|
||||||
{/if}
|
{/if}
|
||||||
|
@ -113,7 +117,7 @@
|
||||||
<Tag
|
<Tag
|
||||||
size="sm"
|
size="sm"
|
||||||
type="green"
|
type="green"
|
||||||
style="margin-top: 0; margin-bottom: 0"
|
style="margin-top: 0; margin-bottom: 0; cursor: inherit"
|
||||||
>
|
>
|
||||||
New
|
New
|
||||||
</Tag>
|
</Tag>
|
||||||
|
|
|
@ -6,6 +6,8 @@ components: ["Breadcrumb", "BreadcrumbItem"]
|
||||||
import {
|
import {
|
||||||
Breadcrumb,
|
Breadcrumb,
|
||||||
BreadcrumbItem,
|
BreadcrumbItem,
|
||||||
|
OverflowMenu,
|
||||||
|
OverflowMenuItem
|
||||||
} from "carbon-components-svelte";
|
} from "carbon-components-svelte";
|
||||||
import Preview from "../../components/Preview.svelte";
|
import Preview from "../../components/Preview.svelte";
|
||||||
</script>
|
</script>
|
||||||
|
@ -27,6 +29,20 @@ See the [Breadcrumbs recipe](/recipes/Breadcrumbs) for a reusable breadcrumbs co
|
||||||
<BreadcrumbItem href="/profile" isCurrentPage>Profile</BreadcrumbItem>
|
<BreadcrumbItem href="/profile" isCurrentPage>Profile</BreadcrumbItem>
|
||||||
</Breadcrumb>
|
</Breadcrumb>
|
||||||
|
|
||||||
|
### Overflow menu
|
||||||
|
|
||||||
|
<Breadcrumb>
|
||||||
|
<BreadcrumbItem href="/">Home</BreadcrumbItem>
|
||||||
|
<BreadcrumbItem href="/api">API documentation</BreadcrumbItem>
|
||||||
|
<BreadcrumbItem>
|
||||||
|
<OverflowMenu>
|
||||||
|
<OverflowMenuItem href="/api/data" text="Data" />
|
||||||
|
<OverflowMenuItem href="/api/data/latest" text="Latest" />
|
||||||
|
</OverflowMenu>
|
||||||
|
</BreadcrumbItem>
|
||||||
|
<BreadcrumbItem href="/api/data/latest/usage" isCurrentPage>Usage</BreadcrumbItem>
|
||||||
|
</Breadcrumb>
|
||||||
|
|
||||||
### Skeleton
|
### Skeleton
|
||||||
|
|
||||||
<Breadcrumb noTrailingSlash skeleton count={3} />
|
<Breadcrumb noTrailingSlash skeleton count={3} />
|
|
@ -28,21 +28,27 @@ let comment = `
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<InlineNotification svx-ignore title="Note:" kind="info" hideCloseButton>
|
<InlineNotification svx-ignore title="Note:" kind="info" hideCloseButton>
|
||||||
<div class="body-short-01">By design, the copy button does not copy text to the clipboard. You will need to write your own logic. Refer to the <Link href="/recipes/CopyableCodeSnippet">CopyableCodeSnippet recipe</Link> for an example.</div>
|
<div class="body-short-01">As of version 0.32, the CodeSnippet will copy the provided `code` text when clicking the copy button.</div>
|
||||||
</InlineNotification>
|
</InlineNotification>
|
||||||
|
|
||||||
### Default (single-line)
|
### Default (single-line)
|
||||||
|
|
||||||
<CodeSnippet>yarn add -D carbon-components-svelte</CodeSnippet>
|
<CodeSnippet code="yarn add -D carbon-components-svelte" />
|
||||||
|
|
||||||
### Inline
|
### Inline
|
||||||
|
|
||||||
<CodeSnippet type="inline">rm -rf node_modules/</CodeSnippet>
|
<CodeSnippet type="inline" code="rm -rf node_modules/" />
|
||||||
|
|
||||||
### Multi-line
|
### Multi-line
|
||||||
|
|
||||||
<CodeSnippet type="multi" {code} />
|
<CodeSnippet type="multi" {code} />
|
||||||
|
|
||||||
|
### Custom copy feedback text
|
||||||
|
|
||||||
|
Use the `feedback` prop to override the default copy button feedback text.
|
||||||
|
|
||||||
|
<CodeSnippet type="multi" {code} feedback="Copied to clipboard" />
|
||||||
|
|
||||||
### Hidden copy button
|
### Hidden copy button
|
||||||
|
|
||||||
<CodeSnippet type="multi" {code} hideCopyButton />
|
<CodeSnippet type="multi" {code} hideCopyButton />
|
||||||
|
@ -51,7 +57,7 @@ let comment = `
|
||||||
|
|
||||||
The `disabled` prop applies only to the `"single"` and `"multi"` code snippet types.
|
The `disabled` prop applies only to the `"single"` and `"multi"` code snippet types.
|
||||||
|
|
||||||
<CodeSnippet disabled>yarn add -D carbon-components-svelte</CodeSnippet>
|
<CodeSnippet disabled code="yarn add -D carbon-components-svelte" />
|
||||||
<br />
|
<br />
|
||||||
<CodeSnippet disabled type="multi" code="{comment}" />
|
<CodeSnippet disabled type="multi" code="{comment}" />
|
||||||
|
|
||||||
|
|
|
@ -28,13 +28,6 @@ components: ["ContentSwitcher", "Switch"]
|
||||||
|
|
||||||
<FileSource src="/framed/ContentSwitcher/ContentSwitcherReactive" />
|
<FileSource src="/framed/ContentSwitcher/ContentSwitcherReactive" />
|
||||||
|
|
||||||
### Light variant
|
|
||||||
|
|
||||||
<ContentSwitcher light>
|
|
||||||
<Switch text="Latest news" />
|
|
||||||
<Switch text="Trending" />
|
|
||||||
</ContentSwitcher>
|
|
||||||
|
|
||||||
### Custom switch slot
|
### Custom switch slot
|
||||||
|
|
||||||
<ContentSwitcher>
|
<ContentSwitcher>
|
||||||
|
|
|
@ -4,13 +4,13 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<InlineNotification svx-ignore title="Note:" kind="info" hideCloseButton>
|
<InlineNotification svx-ignore title="Note:" kind="info" hideCloseButton>
|
||||||
<div class="body-short-01">By design, the copy button does not copy text to the clipboard. You will need to write your own logic. Refer to the <Link href="/recipes/CopyableCodeSnippet">CopyableCodeSnippet recipe</Link> for an example.</div>
|
<div class="body-short-01">As of version 0.32, this component will copy the provided `code` text when clicking the button.</div>
|
||||||
</InlineNotification>
|
</InlineNotification>
|
||||||
|
|
||||||
### Default
|
### Default
|
||||||
|
|
||||||
<CopyButton on:click />
|
<CopyButton text="Carbon svelte" />
|
||||||
|
|
||||||
### Custom feedback
|
### Custom feedback text
|
||||||
|
|
||||||
<CopyButton on:click feedback="Copied to clipboard" />
|
<CopyButton text="Carbon svelte" feedback="Copied to clipboard" />
|
|
@ -550,10 +550,16 @@ The slot name for the table header cells is `"cell-header"`.
|
||||||
|
|
||||||
### Sortable
|
### Sortable
|
||||||
|
|
||||||
|
Set `sortable` to `true` to enable table column sorting.
|
||||||
|
|
||||||
|
To disable sorting on a specific column, set `sort` to `false` in the header object passed to the `headers` prop.
|
||||||
|
|
||||||
|
In the example below, the "Protocol" column is not sortable.
|
||||||
|
|
||||||
<DataTable sortable
|
<DataTable sortable
|
||||||
headers="{[
|
headers="{[
|
||||||
{ key: "name", value: "Name" },
|
{ key: "name", value: "Name" },
|
||||||
{ key: "protocol", value: "Protocol" },
|
{ key: "protocol", value: "Protocol", sort: false },
|
||||||
{ key: "port", value: "Port" },
|
{ key: "port", value: "Port" },
|
||||||
{ key: "rule", value: "Rule" }
|
{ key: "rule", value: "Rule" }
|
||||||
]}"
|
]}"
|
||||||
|
@ -757,6 +763,189 @@ In the following example, each row in the sortable data table has an overflow me
|
||||||
</div>
|
</div>
|
||||||
</DataTable>
|
</DataTable>
|
||||||
|
|
||||||
|
### Expandable (compact size)
|
||||||
|
|
||||||
|
<DataTable size="compact" expandable
|
||||||
|
headers="{[
|
||||||
|
{ key: "name", value: "Name" },
|
||||||
|
{ key: "protocol", value: "Protocol" },
|
||||||
|
{ key: "port", value: "Port" },
|
||||||
|
{ key: "rule", value: "Rule" }
|
||||||
|
]}"
|
||||||
|
rows="{[
|
||||||
|
{
|
||||||
|
id: "a",
|
||||||
|
name: "Load Balancer 3",
|
||||||
|
protocol: "HTTP",
|
||||||
|
port: 3000,
|
||||||
|
rule: "Round robin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "b",
|
||||||
|
name: "Load Balancer 1",
|
||||||
|
protocol: "HTTP",
|
||||||
|
port: 443,
|
||||||
|
rule: "Round robin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "c",
|
||||||
|
name: "Load Balancer 2",
|
||||||
|
protocol: "HTTP",
|
||||||
|
port: 80,
|
||||||
|
rule: "DNS delegation"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "d",
|
||||||
|
name: "Load Balancer 6",
|
||||||
|
protocol: "HTTP",
|
||||||
|
port: 3000,
|
||||||
|
rule: "Round robin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "e",
|
||||||
|
name: "Load Balancer 4",
|
||||||
|
protocol: "HTTP",
|
||||||
|
port: 443,
|
||||||
|
rule: "Round robin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "f",
|
||||||
|
name: "Load Balancer 5",
|
||||||
|
protocol: "HTTP",
|
||||||
|
port: 80,
|
||||||
|
rule: "DNS delegation"
|
||||||
|
},
|
||||||
|
]}"
|
||||||
|
>
|
||||||
|
<div slot="expanded-row" let:row>
|
||||||
|
<pre>
|
||||||
|
{JSON.stringify(row, null, 2)}
|
||||||
|
</pre>
|
||||||
|
</div>
|
||||||
|
</DataTable>
|
||||||
|
|
||||||
|
### Expandable (short size)
|
||||||
|
|
||||||
|
<DataTable size="short" expandable
|
||||||
|
headers="{[
|
||||||
|
{ key: "name", value: "Name" },
|
||||||
|
{ key: "protocol", value: "Protocol" },
|
||||||
|
{ key: "port", value: "Port" },
|
||||||
|
{ key: "rule", value: "Rule" }
|
||||||
|
]}"
|
||||||
|
rows="{[
|
||||||
|
{
|
||||||
|
id: "a",
|
||||||
|
name: "Load Balancer 3",
|
||||||
|
protocol: "HTTP",
|
||||||
|
port: 3000,
|
||||||
|
rule: "Round robin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "b",
|
||||||
|
name: "Load Balancer 1",
|
||||||
|
protocol: "HTTP",
|
||||||
|
port: 443,
|
||||||
|
rule: "Round robin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "c",
|
||||||
|
name: "Load Balancer 2",
|
||||||
|
protocol: "HTTP",
|
||||||
|
port: 80,
|
||||||
|
rule: "DNS delegation"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "d",
|
||||||
|
name: "Load Balancer 6",
|
||||||
|
protocol: "HTTP",
|
||||||
|
port: 3000,
|
||||||
|
rule: "Round robin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "e",
|
||||||
|
name: "Load Balancer 4",
|
||||||
|
protocol: "HTTP",
|
||||||
|
port: 443,
|
||||||
|
rule: "Round robin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "f",
|
||||||
|
name: "Load Balancer 5",
|
||||||
|
protocol: "HTTP",
|
||||||
|
port: 80,
|
||||||
|
rule: "DNS delegation"
|
||||||
|
},
|
||||||
|
]}"
|
||||||
|
>
|
||||||
|
<div slot="expanded-row" let:row>
|
||||||
|
<pre>
|
||||||
|
{JSON.stringify(row, null, 2)}
|
||||||
|
</pre>
|
||||||
|
</div>
|
||||||
|
</DataTable>
|
||||||
|
|
||||||
|
### Expandable (tall size)
|
||||||
|
|
||||||
|
<DataTable size="tall" expandable
|
||||||
|
headers="{[
|
||||||
|
{ key: "name", value: "Name" },
|
||||||
|
{ key: "protocol", value: "Protocol" },
|
||||||
|
{ key: "port", value: "Port" },
|
||||||
|
{ key: "rule", value: "Rule" }
|
||||||
|
]}"
|
||||||
|
rows="{[
|
||||||
|
{
|
||||||
|
id: "a",
|
||||||
|
name: "Load Balancer 3",
|
||||||
|
protocol: "HTTP",
|
||||||
|
port: 3000,
|
||||||
|
rule: "Round robin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "b",
|
||||||
|
name: "Load Balancer 1",
|
||||||
|
protocol: "HTTP",
|
||||||
|
port: 443,
|
||||||
|
rule: "Round robin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "c",
|
||||||
|
name: "Load Balancer 2",
|
||||||
|
protocol: "HTTP",
|
||||||
|
port: 80,
|
||||||
|
rule: "DNS delegation"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "d",
|
||||||
|
name: "Load Balancer 6",
|
||||||
|
protocol: "HTTP",
|
||||||
|
port: 3000,
|
||||||
|
rule: "Round robin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "e",
|
||||||
|
name: "Load Balancer 4",
|
||||||
|
protocol: "HTTP",
|
||||||
|
port: 443,
|
||||||
|
rule: "Round robin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "f",
|
||||||
|
name: "Load Balancer 5",
|
||||||
|
protocol: "HTTP",
|
||||||
|
port: 80,
|
||||||
|
rule: "DNS delegation"
|
||||||
|
},
|
||||||
|
]}"
|
||||||
|
>
|
||||||
|
<div slot="expanded-row" let:row>
|
||||||
|
<pre>
|
||||||
|
{JSON.stringify(row, null, 2)}
|
||||||
|
</pre>
|
||||||
|
</div>
|
||||||
|
</DataTable>
|
||||||
|
|
||||||
### Batch expansion
|
### Batch expansion
|
||||||
|
|
||||||
<DataTable batchExpansion
|
<DataTable batchExpansion
|
||||||
|
@ -832,6 +1021,12 @@ In the following example, each row in the sortable data table has an overflow me
|
||||||
|
|
||||||
<DataTableSkeleton headers={[{ value: "Name" }, {value: "Protocol"}, {value:"Port"}, { value: "Rule"}]} rows={10} />
|
<DataTableSkeleton headers={[{ value: "Name" }, {value: "Protocol"}, {value:"Port"}, { value: "Rule"}]} rows={10} />
|
||||||
|
|
||||||
|
### Skeleton with empty header
|
||||||
|
|
||||||
|
Pass an object with `"empty"` set to `true` to render an empty table header column.
|
||||||
|
|
||||||
|
<DataTableSkeleton headers={[{ value: "Name" }, {value: "Protocol"}, {value:"Port"}, { value: "Rule"}, { empty: true }]} rows={10} />
|
||||||
|
|
||||||
### Skeleton without header, toolbar
|
### Skeleton without header, toolbar
|
||||||
|
|
||||||
<DataTableSkeleton showHeader={false} showToolbar={false} />
|
<DataTableSkeleton showHeader={false} showToolbar={false} />
|
||||||
|
|
|
@ -33,4 +33,18 @@ components: ["TileGroup", "RadioTile"]
|
||||||
<RadioTile light value="2">
|
<RadioTile light value="2">
|
||||||
Plus plan
|
Plus plan
|
||||||
</RadioTile>
|
</RadioTile>
|
||||||
|
</TileGroup>
|
||||||
|
|
||||||
|
### Disabled state
|
||||||
|
|
||||||
|
<TileGroup legend="Service pricing tiers">
|
||||||
|
<RadioTile value="0" checked>
|
||||||
|
Lite plan
|
||||||
|
</RadioTile>
|
||||||
|
<RadioTile value="1" disabled>
|
||||||
|
Standard plan
|
||||||
|
</RadioTile>
|
||||||
|
<RadioTile value="2" disabled>
|
||||||
|
Plus plan
|
||||||
|
</RadioTile>
|
||||||
</TileGroup>
|
</TileGroup>
|
|
@ -33,4 +33,18 @@ components: ["SelectableTile"]
|
||||||
<SelectableTile light>
|
<SelectableTile light>
|
||||||
Multi-select Tile
|
Multi-select Tile
|
||||||
</SelectableTile>
|
</SelectableTile>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
### Disabled state
|
||||||
|
|
||||||
|
<div role="group" aria-label="selectable tiles">
|
||||||
|
<SelectableTile selected>
|
||||||
|
Multi-select Tile
|
||||||
|
</SelectableTile>
|
||||||
|
<SelectableTile disabled>
|
||||||
|
Multi-select Tile
|
||||||
|
</SelectableTile>
|
||||||
|
<SelectableTile disabled>
|
||||||
|
Multi-select Tile
|
||||||
|
</SelectableTile>
|
||||||
</div>
|
</div>
|
|
@ -59,7 +59,21 @@ components: ["TimePicker", "TimePickerSelect", "SelectItem"]
|
||||||
</TimePickerSelect>
|
</TimePickerSelect>
|
||||||
</TimePicker>
|
</TimePicker>
|
||||||
|
|
||||||
### Disabled
|
### Invalid state
|
||||||
|
|
||||||
|
<TimePicker invalid invalidText="A valid value is required" labelText="Cron job" placeholder="hh:mm">
|
||||||
|
<TimePickerSelect value="PM">
|
||||||
|
<SelectItem value="am" text="AM" />
|
||||||
|
<SelectItem value="pm" text="PM" />
|
||||||
|
</TimePickerSelect>
|
||||||
|
<TimePickerSelect value="PDT">
|
||||||
|
<SelectItem value="pdt" text="PDT" />
|
||||||
|
<SelectItem value="gmt" text="GMT" />
|
||||||
|
</TimePickerSelect>
|
||||||
|
</TimePicker>
|
||||||
|
|
||||||
|
|
||||||
|
### Disabled state
|
||||||
|
|
||||||
<TimePicker labelText="Cron job" placeholder="hh:mm" disabled>
|
<TimePicker labelText="Cron job" placeholder="hh:mm" disabled>
|
||||||
<TimePickerSelect value="PM" disabled>
|
<TimePickerSelect value="PM" disabled>
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
|
---
|
||||||
|
components: ["Tooltip", "TooltipFooter"]
|
||||||
|
---
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Tooltip, Link, Button } from "carbon-components-svelte";
|
import { Tooltip, TooltipFooter, Link, Button } from "carbon-components-svelte";
|
||||||
import Catalog16 from "carbon-icons-svelte/lib/Catalog16";
|
import Catalog16 from "carbon-icons-svelte/lib/Catalog16";
|
||||||
import Preview from "../../components/Preview.svelte";
|
import Preview from "../../components/Preview.svelte";
|
||||||
</script>
|
</script>
|
||||||
|
@ -45,10 +49,10 @@ By default, the tooltip is triggered by an information icon.
|
||||||
<p>
|
<p>
|
||||||
Resources are provisioned based on your account's organization.
|
Resources are provisioned based on your account's organization.
|
||||||
</p>
|
</p>
|
||||||
<div class="bx--tooltip__footer">
|
<TooltipFooter selectorPrimaryFocus="#d">
|
||||||
<Link href="/">Learn more</Link>
|
<Link href="/">Learn more</Link>
|
||||||
<Button size="small">Manage</Button>
|
<Button id="d" size="small">Manage</Button>
|
||||||
</div>
|
</TooltipFooter>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|
||||||
### Custom icon (component)
|
### Custom icon (component)
|
||||||
|
|
|
@ -42,4 +42,6 @@
|
||||||
<ContextMenuOption id="1" labelText="Reduce noise" />
|
<ContextMenuOption id="1" labelText="Reduce noise" />
|
||||||
<ContextMenuOption id="2" labelText="Auto-sharpen" />
|
<ContextMenuOption id="2" labelText="Auto-sharpen" />
|
||||||
</ContextMenuGroup>
|
</ContextMenuGroup>
|
||||||
|
<ContextMenuDivider />
|
||||||
|
<ContextMenuOption indented kind="danger" labelText="Delete" />
|
||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
<script>
|
|
||||||
export let code = "yarn add -D carbon-component-svelte";
|
|
||||||
|
|
||||||
import { CodeSnippet } from "carbon-components-svelte";
|
|
||||||
import copy from "clipboard-copy";
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<CodeSnippet on:click="{() => copy(code)}" code="{code}" />
|
|
|
@ -9,7 +9,6 @@
|
||||||
} from "carbon-components-svelte";
|
} from "carbon-components-svelte";
|
||||||
import TileCard from "../components/TileCard.svelte";
|
import TileCard from "../components/TileCard.svelte";
|
||||||
import { metatags } from "@sveltech/routify";
|
import { metatags } from "@sveltech/routify";
|
||||||
import copy from "clipboard-copy";
|
|
||||||
|
|
||||||
metatags.title = "Carbon Components Svelte";
|
metatags.title = "Carbon Components Svelte";
|
||||||
metatags.description =
|
metatags.description =
|
||||||
|
@ -53,21 +52,9 @@
|
||||||
<Column>
|
<Column>
|
||||||
<h3>Install</h3>
|
<h3>Install</h3>
|
||||||
<h4>Installing with yarn:</h4>
|
<h4>Installing with yarn:</h4>
|
||||||
<CodeSnippet
|
<CodeSnippet code="{installYarn}" />
|
||||||
code="{installYarn}"
|
|
||||||
on:click="{() => {
|
|
||||||
copy(installYarn);
|
|
||||||
}}"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<h4>Using npm:</h4>
|
<h4>Using npm:</h4>
|
||||||
|
<CodeSnippet code="{installNpm}" />
|
||||||
<CodeSnippet
|
|
||||||
code="{installNpm}"
|
|
||||||
on:click="{() => {
|
|
||||||
copy(installNpm);
|
|
||||||
}}"
|
|
||||||
/>
|
|
||||||
</Column>
|
</Column>
|
||||||
</Row>
|
</Row>
|
||||||
<Row>
|
<Row>
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
---
|
|
||||||
layout: recipe
|
|
||||||
---
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import Preview from "../../components/Preview.svelte";
|
|
||||||
</script>
|
|
||||||
|
|
||||||
The [CodeSnippet](/components/CodeSnippet) and [CopyButton](/components/CopyButton) components do not include logic to copy the supplied `code` text.
|
|
||||||
|
|
||||||
You can use a third party open source module like [clipboard-copy](https://www.npmjs.com/package/clipboard-copy) that is compatible with modern web browsers.
|
|
||||||
|
|
||||||
## clipboard-copy
|
|
||||||
|
|
||||||
This documentation website uses [clipboard-copy](https://www.npmjs.com/package/clipboard-copy).
|
|
||||||
|
|
||||||
<FileSource src="/framed/CopyableCodeSnippet/CopyableCodeSnippet" />
|
|
|
@ -837,25 +837,26 @@ caniuse-lite@^1.0.30001173, caniuse-lite@^1.0.30001178:
|
||||||
integrity sha512-n8JVqXuZMVSPKiPiypjFtDTXc4jWIdjxull0f92WLo7e1MSi3uJ3NvveakSh/aCl1QKFAvIz3vIj0v+0K+FrXw==
|
integrity sha512-n8JVqXuZMVSPKiPiypjFtDTXc4jWIdjxull0f92WLo7e1MSi3uJ3NvveakSh/aCl1QKFAvIz3vIj0v+0K+FrXw==
|
||||||
|
|
||||||
carbon-components-svelte@../:
|
carbon-components-svelte@../:
|
||||||
version "0.30.0"
|
version "0.31.1"
|
||||||
dependencies:
|
dependencies:
|
||||||
carbon-icons-svelte "^10.21.0"
|
carbon-icons-svelte "^10.27.0"
|
||||||
|
clipboard-copy "3.2.0"
|
||||||
flatpickr "4.6.9"
|
flatpickr "4.6.9"
|
||||||
|
|
||||||
carbon-components@10.31.0:
|
carbon-components@10.32.0:
|
||||||
version "10.31.0"
|
version "10.32.0"
|
||||||
resolved "https://registry.yarnpkg.com/carbon-components/-/carbon-components-10.31.0.tgz#050751e7fb4d845b7d1c6e8ac7fdfa9c71403c12"
|
resolved "https://registry.yarnpkg.com/carbon-components/-/carbon-components-10.32.0.tgz#0fbf60ea8fc12cea43ae7860bec844b3c2c0880f"
|
||||||
integrity sha512-gUXRky9rUHavqFLJJQf+Lzouk8GHsXJUjxRgTOUQ6vdBfA0ks6ugwptG8fiFGwCJJht/CW9/YsKb5w8N9a39sg==
|
integrity sha512-LM44X6VhUc+yrZBSz+IW1aT/OGxAS0oiiy/kV7CiDpsUDF5zlPOwgokZbeYLo2mhB1wBZ1q9jwvItZ4zfaZuMw==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@carbon/telemetry" "0.0.0-alpha.6"
|
"@carbon/telemetry" "0.0.0-alpha.6"
|
||||||
flatpickr "4.6.1"
|
flatpickr "4.6.1"
|
||||||
lodash.debounce "^4.0.8"
|
lodash.debounce "^4.0.8"
|
||||||
warning "^3.0.0"
|
warning "^3.0.0"
|
||||||
|
|
||||||
carbon-icons-svelte@^10.21.0:
|
carbon-icons-svelte@^10.27.0:
|
||||||
version "10.21.0"
|
version "10.28.0"
|
||||||
resolved "https://registry.npmjs.org/carbon-icons-svelte/-/carbon-icons-svelte-10.21.0.tgz#9bbdd37d5513d484e9706d6335c121f60f3186c4"
|
resolved "https://registry.yarnpkg.com/carbon-icons-svelte/-/carbon-icons-svelte-10.28.0.tgz#812a6eae858d0c9e043067c714910fcfb6249cd2"
|
||||||
integrity sha512-5NNaRdmbS4N36dUGNj72Ys3VqVjH3fZ69AhYUHx+bH02GFYCwAaE49qjtP77kP7DKMtDV9NmMEti/P/JB83aYQ==
|
integrity sha512-C3K+U2PRy63WHFZme1HQNju89rhVIQmUkfgBrZzcezdutkhXbSPOY+o/MI0B2mDcQ7G9gfhEpqsXET8gBTWfJQ==
|
||||||
|
|
||||||
caseless@~0.12.0:
|
caseless@~0.12.0:
|
||||||
version "0.12.0"
|
version "0.12.0"
|
||||||
|
@ -946,10 +947,10 @@ cli-spinners@^2.2.0:
|
||||||
resolved "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.4.0.tgz#c6256db216b878cfba4720e719cec7cf72685d7f"
|
resolved "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.4.0.tgz#c6256db216b878cfba4720e719cec7cf72685d7f"
|
||||||
integrity sha512-sJAofoarcm76ZGpuooaO0eDy8saEy+YoZBLjC4h8srt4jeBnkYeOgqxgsJQTpyt2LjI5PTfLJHSL+41Yu4fEJA==
|
integrity sha512-sJAofoarcm76ZGpuooaO0eDy8saEy+YoZBLjC4h8srt4jeBnkYeOgqxgsJQTpyt2LjI5PTfLJHSL+41Yu4fEJA==
|
||||||
|
|
||||||
clipboard-copy@^3.1.0:
|
clipboard-copy@3.2.0:
|
||||||
version "3.1.0"
|
version "3.2.0"
|
||||||
resolved "https://registry.npmjs.org/clipboard-copy/-/clipboard-copy-3.1.0.tgz#4c59030a43d4988990564a664baeafba99f78ca4"
|
resolved "https://registry.yarnpkg.com/clipboard-copy/-/clipboard-copy-3.2.0.tgz#3c5b8651d3512dcfad295d77a9eb09e7fac8d5fb"
|
||||||
integrity sha512-Xsu1NddBXB89IUauda5BIq3Zq73UWkjkaQlPQbLNvNsd5WBMnTWPNKYR6HGaySOxGYZ+BKxP2E9X4ElnI3yiPA==
|
integrity sha512-vooFaGFL6ulEP1liiaWFBmmfuPm3cY3y7T9eB83ZTnYc/oFeAKsq3NcDrOkBC8XaauEE8zHQwI7k0+JSYiVQSQ==
|
||||||
|
|
||||||
clipboard@^2.0.0:
|
clipboard@^2.0.0:
|
||||||
version "2.0.6"
|
version "2.0.6"
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"carbon-icons-svelte": "^10.27.0",
|
"carbon-icons-svelte": "^10.27.0",
|
||||||
|
"clipboard-copy": "3.2.0",
|
||||||
"flatpickr": "4.6.9"
|
"flatpickr": "4.6.9"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
@ -31,7 +32,7 @@
|
||||||
"@rollup/plugin-node-resolve": "^11.1.1",
|
"@rollup/plugin-node-resolve": "^11.1.1",
|
||||||
"@tsconfig/svelte": "^1.0.10",
|
"@tsconfig/svelte": "^1.0.10",
|
||||||
"autoprefixer": "^10.2.4",
|
"autoprefixer": "^10.2.4",
|
||||||
"carbon-components": "10.31.0",
|
"carbon-components": "10.32.0",
|
||||||
"gh-pages": "^3.1.0",
|
"gh-pages": "^3.1.0",
|
||||||
"husky": "^4.3.8",
|
"husky": "^4.3.8",
|
||||||
"lint-staged": "^10.5.3",
|
"lint-staged": "^10.5.3",
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"version": "0.31.0",
|
"version": "0.31.1",
|
||||||
"components": {
|
"components": {
|
||||||
"Accordion": {
|
"Accordion": {
|
||||||
"path": "carbon-components-svelte/src/Accordion/Accordion.svelte"
|
"path": "carbon-components-svelte/src/Accordion/Accordion.svelte"
|
||||||
|
|
|
@ -14,7 +14,10 @@ export default ["es", "umd"].map((format) => {
|
||||||
format,
|
format,
|
||||||
file: UMD ? pkg.main : pkg.module,
|
file: UMD ? pkg.main : pkg.module,
|
||||||
name: UMD ? "carbon-components-svelte" : undefined,
|
name: UMD ? "carbon-components-svelte" : undefined,
|
||||||
globals: { flatpickr: "flatpickr" },
|
globals: {
|
||||||
|
flatpickr: "flatpickr",
|
||||||
|
"clipboard-copy": "copy",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
external: Object.keys(pkg.dependencies),
|
external: Object.keys(pkg.dependencies),
|
||||||
plugins: [
|
plugins: [
|
||||||
|
|
|
@ -13,6 +13,10 @@
|
||||||
export let isCurrentPage = false;
|
export let isCurrentPage = false;
|
||||||
|
|
||||||
import Link from "../Link/Link.svelte";
|
import Link from "../Link/Link.svelte";
|
||||||
|
|
||||||
|
import { setContext } from "svelte";
|
||||||
|
|
||||||
|
setContext("BreadcrumbItem", {});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<li
|
<li
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
/**
|
/**
|
||||||
* Set the code snippet text
|
* Set the code snippet text
|
||||||
* Alternatively, use the default slot (e.g., <CodeSnippet>{`code`}</CodeSnippet>)
|
* Alternatively, use the default slot (e.g., <CodeSnippet>{`code`}</CodeSnippet>)
|
||||||
|
* You must use the `code` prop to copy the code
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
export let code = undefined;
|
export let code = undefined;
|
||||||
|
@ -75,18 +76,26 @@
|
||||||
/** Obtain a reference to the pre HTML element */
|
/** Obtain a reference to the pre HTML element */
|
||||||
export let ref = null;
|
export let ref = null;
|
||||||
|
|
||||||
import { tick } from "svelte";
|
import { createEventDispatcher, tick } from "svelte";
|
||||||
|
import copy from "clipboard-copy";
|
||||||
import ChevronDown16 from "carbon-icons-svelte/lib/ChevronDown16/ChevronDown16.svelte";
|
import ChevronDown16 from "carbon-icons-svelte/lib/ChevronDown16/ChevronDown16.svelte";
|
||||||
import Button from "../Button/Button.svelte";
|
import Button from "../Button/Button.svelte";
|
||||||
import Copy from "../Copy/Copy.svelte";
|
import Copy from "../Copy/Copy.svelte";
|
||||||
import CopyButton from "../CopyButton/CopyButton.svelte";
|
import CopyButton from "../CopyButton/CopyButton.svelte";
|
||||||
import CodeSnippetSkeleton from "./CodeSnippetSkeleton.svelte";
|
import CodeSnippetSkeleton from "./CodeSnippetSkeleton.svelte";
|
||||||
|
|
||||||
|
const dispatch = createEventDispatcher();
|
||||||
|
|
||||||
function setShowMoreLess() {
|
function setShowMoreLess() {
|
||||||
const { height } = ref.getBoundingClientRect();
|
const { height } = ref.getBoundingClientRect();
|
||||||
if (height > 0) showMoreLess = ref.getBoundingClientRect().height > 255;
|
if (height > 0) showMoreLess = ref.getBoundingClientRect().height > 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function copyCode() {
|
||||||
|
copy(code);
|
||||||
|
dispatch("copy");
|
||||||
|
}
|
||||||
|
|
||||||
$: expandText = expanded ? showLessText : showMoreText;
|
$: expandText = expanded ? showLessText : showMoreText;
|
||||||
$: if (type === "multi" && ref) {
|
$: if (type === "multi" && ref) {
|
||||||
if (code === undefined) setShowMoreLess();
|
if (code === undefined) setShowMoreLess();
|
||||||
|
@ -138,6 +147,7 @@
|
||||||
{wrapText && 'bx--snippet--wraptext'}"
|
{wrapText && 'bx--snippet--wraptext'}"
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
on:click
|
on:click
|
||||||
|
on:click="{copyCode}"
|
||||||
on:mouseover
|
on:mouseover
|
||||||
on:mouseenter
|
on:mouseenter
|
||||||
on:mouseleave
|
on:mouseleave
|
||||||
|
@ -182,6 +192,7 @@
|
||||||
feedbackTimeout="{feedbackTimeout}"
|
feedbackTimeout="{feedbackTimeout}"
|
||||||
iconDescription="{copyButtonDescription}"
|
iconDescription="{copyButtonDescription}"
|
||||||
on:click
|
on:click
|
||||||
|
on:click="{copyCode}"
|
||||||
on:animationend
|
on:animationend
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
role="{hasScrollingContent ? 'region' : undefined}"
|
role="{hasScrollingContent ? 'region' : undefined}"
|
||||||
class:bx--modal-content="{true}"
|
class:bx--modal-content="{true}"
|
||||||
class:bx--modal-content--with-form="{hasForm}"
|
class:bx--modal-content--with-form="{hasForm}"
|
||||||
|
class:bx--modal-scroll-content="{hasScrollingContent}"
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
|
|
|
@ -6,7 +6,10 @@
|
||||||
/** Set the selected index of the switch item */
|
/** Set the selected index of the switch item */
|
||||||
export let selectedIndex = 0;
|
export let selectedIndex = 0;
|
||||||
|
|
||||||
/** Set to `true` to enable the light variant */
|
/**
|
||||||
|
* Set to `true` to enable the light variant
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
export let light = false;
|
export let light = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
const position = writable([x, y]);
|
const position = writable([x, y]);
|
||||||
const currentIndex = writable(-1);
|
const currentIndex = writable(-1);
|
||||||
const hasPopup = writable(false);
|
const hasPopup = writable(false);
|
||||||
|
const menuOffsetX = writable(0);
|
||||||
const ctx = getContext("ContextMenu");
|
const ctx = getContext("ContextMenu");
|
||||||
|
|
||||||
let options = [];
|
let options = [];
|
||||||
|
@ -44,6 +45,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
setContext("ContextMenu", {
|
setContext("ContextMenu", {
|
||||||
|
menuOffsetX,
|
||||||
currentIndex,
|
currentIndex,
|
||||||
position,
|
position,
|
||||||
close,
|
close,
|
||||||
|
@ -77,8 +79,26 @@
|
||||||
<svelte:window
|
<svelte:window
|
||||||
on:contextmenu|preventDefault="{(e) => {
|
on:contextmenu|preventDefault="{(e) => {
|
||||||
if (level > 1) return;
|
if (level > 1) return;
|
||||||
if (open || x === 0) x = e.x;
|
|
||||||
if (open || y === 0) y = e.y;
|
const { height, width } = ref.getBoundingClientRect();
|
||||||
|
|
||||||
|
if (open || x === 0) {
|
||||||
|
if (window.innerWidth - width < e.x) {
|
||||||
|
x = e.x - width;
|
||||||
|
} else {
|
||||||
|
x = e.x;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (open || y === 0) {
|
||||||
|
menuOffsetX.set(e.x);
|
||||||
|
|
||||||
|
if (window.innerHeight - height < e.y) {
|
||||||
|
y = e.y - height;
|
||||||
|
} else {
|
||||||
|
y = e.y;
|
||||||
|
}
|
||||||
|
}
|
||||||
position.set([x, y]);
|
position.set([x, y]);
|
||||||
open = true;
|
open = true;
|
||||||
}}"
|
}}"
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Specify the kind of option
|
||||||
|
* @type {"default" | "danger"}
|
||||||
|
*/
|
||||||
|
export let kind = "default";
|
||||||
|
|
||||||
/** Set to `true` to enable the disabled state */
|
/** Set to `true` to enable the disabled state */
|
||||||
export let disabled = false;
|
export let disabled = false;
|
||||||
|
|
||||||
|
@ -64,11 +70,16 @@
|
||||||
let role = "menuitem";
|
let role = "menuitem";
|
||||||
let submenuOpen = false;
|
let submenuOpen = false;
|
||||||
let submenuPosition = [0, 0];
|
let submenuPosition = [0, 0];
|
||||||
|
let menuOffsetX = 0;
|
||||||
|
|
||||||
const unsubPosition = ctx.position.subscribe((position) => {
|
const unsubPosition = ctx.position.subscribe((position) => {
|
||||||
rootMenuPosition = position;
|
rootMenuPosition = position;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const unsubMenuOffsetX = ctx.menuOffsetX.subscribe((_menuOffsetX) => {
|
||||||
|
menuOffsetX = _menuOffsetX;
|
||||||
|
});
|
||||||
|
|
||||||
function handleClick(opts = {}) {
|
function handleClick(opts = {}) {
|
||||||
if (disabled) return ctx.close();
|
if (disabled) return ctx.close();
|
||||||
if (subOptions) return;
|
if (subOptions) return;
|
||||||
|
@ -106,6 +117,7 @@
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
unsubPosition();
|
unsubPosition();
|
||||||
|
unsubMenuOffsetX();
|
||||||
if (unsubCurrentIds) unsubCurrentIds();
|
if (unsubCurrentIds) unsubCurrentIds();
|
||||||
if (unsubCurrentId) unsubCurrentId();
|
if (unsubCurrentId) unsubCurrentId();
|
||||||
if (typeof timeoutHover === "number") clearTimeout(timeoutHover);
|
if (typeof timeoutHover === "number") clearTimeout(timeoutHover);
|
||||||
|
@ -118,7 +130,13 @@
|
||||||
$: ctx.setPopup(submenuOpen);
|
$: ctx.setPopup(submenuOpen);
|
||||||
$: if (submenuOpen) {
|
$: if (submenuOpen) {
|
||||||
const { width, y } = ref.getBoundingClientRect();
|
const { width, y } = ref.getBoundingClientRect();
|
||||||
submenuPosition = [rootMenuPosition[0] + width, y];
|
let x = rootMenuPosition[0] + width;
|
||||||
|
|
||||||
|
if (window.innerWidth - menuOffsetX < width) {
|
||||||
|
x = rootMenuPosition[0] - width;
|
||||||
|
}
|
||||||
|
|
||||||
|
submenuPosition = [x, y];
|
||||||
}
|
}
|
||||||
$: {
|
$: {
|
||||||
if (isSelectable) {
|
if (isSelectable) {
|
||||||
|
@ -158,6 +176,7 @@
|
||||||
class:bx--context-menu-option="{true}"
|
class:bx--context-menu-option="{true}"
|
||||||
class:bx--context-menu-option--disabled="{true}"
|
class:bx--context-menu-option--disabled="{true}"
|
||||||
class:bx--context-menu-option--active="{subOptions && submenuOpen}"
|
class:bx--context-menu-option--active="{subOptions && submenuOpen}"
|
||||||
|
class:bx--context-menu-option--danger="{!subOptions && kind === 'danger'}"
|
||||||
indented="{indented}"
|
indented="{indented}"
|
||||||
aria-checked="{isSelectable || isRadio ? selected : undefined}"
|
aria-checked="{isSelectable || isRadio ? selected : undefined}"
|
||||||
data-nested="{ref &&
|
data-nested="{ref &&
|
||||||
|
|
|
@ -4,8 +4,18 @@
|
||||||
/** Set the title and ARIA label for the copy button */
|
/** Set the title and ARIA label for the copy button */
|
||||||
export let iconDescription = "Copy to clipboard";
|
export let iconDescription = "Copy to clipboard";
|
||||||
|
|
||||||
import { Copy } from "../Copy";
|
/**
|
||||||
import Copy16 from "carbon-icons-svelte/lib/Copy16";
|
* Specify the text to copy
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
export let text = undefined;
|
||||||
|
|
||||||
|
import Copy from "../Copy/Copy.svelte";
|
||||||
|
import Copy16 from "carbon-icons-svelte/lib/Copy16/Copy16.svelte";
|
||||||
|
import copy from "clipboard-copy";
|
||||||
|
import { createEventDispatcher } from "svelte";
|
||||||
|
|
||||||
|
const dispatch = createEventDispatcher();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Copy
|
<Copy
|
||||||
|
@ -14,6 +24,12 @@
|
||||||
title="{iconDescription}"
|
title="{iconDescription}"
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
on:click
|
on:click
|
||||||
|
on:click="{() => {
|
||||||
|
if (text !== undefined) {
|
||||||
|
copy(text);
|
||||||
|
dispatch('copy');
|
||||||
|
}
|
||||||
|
}}"
|
||||||
on:animationend
|
on:animationend
|
||||||
>
|
>
|
||||||
<Copy16 class="bx--snippet__icon" />
|
<Copy16 class="bx--snippet__icon" />
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
/**
|
/**
|
||||||
* @typedef {string} DataTableKey
|
* @typedef {string} DataTableKey
|
||||||
* @typedef {any} DataTableValue
|
* @typedef {any} DataTableValue
|
||||||
* @typedef {{ key: DataTableKey; empty: boolean; display?: (item: Value) => DataTableValue; sort?: (a: DataTableValue, b: DataTableValue) => (0 | -1 | 1); columnMenu?: boolean; }} DataTableEmptyHeader
|
* @typedef {{ key: DataTableKey; empty: boolean; display?: (item: Value) => DataTableValue; sort?: false | ((a: DataTableValue, b: DataTableValue) => (0 | -1 | 1)); columnMenu?: boolean; }} DataTableEmptyHeader
|
||||||
* @typedef {{ key: DataTableKey; value: DataTableValue; display?: (item: Value) => DataTableValue; sort?: (a: DataTableValue, b: DataTableValue) => (0 | -1 | 1); columnMenu?: boolean; }} DataTableNonEmptyHeader
|
* @typedef {{ key: DataTableKey; value: DataTableValue; display?: (item: Value) => DataTableValue; sort?: false | ((a: DataTableValue, b: DataTableValue) => (0 | -1 | 1)); columnMenu?: boolean; }} DataTableNonEmptyHeader
|
||||||
* @typedef {DataTableNonEmptyHeader | DataTableEmptyHeader} DataTableHeader
|
* @typedef {DataTableNonEmptyHeader | DataTableEmptyHeader} DataTableHeader
|
||||||
* @typedef {{ id: any; [key: string]: DataTableValue; }} DataTableRow
|
* @typedef {{ id: any; [key: string]: DataTableValue; }} DataTableRow
|
||||||
* @typedef {string} DataTableRowId
|
* @typedef {string} DataTableRowId
|
||||||
|
@ -13,7 +13,7 @@
|
||||||
* @slot {{ row: DataTableRow; cell: DataTableCell; }} cell
|
* @slot {{ row: DataTableRow; cell: DataTableCell; }} cell
|
||||||
* @event {{ header?: DataTableHeader; row?: DataTableRow; cell?: DataTableCell; }} click
|
* @event {{ header?: DataTableHeader; row?: DataTableRow; cell?: DataTableCell; }} click
|
||||||
* @event {{ expanded: boolean; }} click:header--expand
|
* @event {{ expanded: boolean; }} click:header--expand
|
||||||
* @event {{ header: DataTableHeader; sortDirection: "ascending" | "descending" | "none" }} click:header
|
* @event {{ header: DataTableHeader; sortDirection?: "ascending" | "descending" | "none" }} click:header
|
||||||
* @event {DataTableRow} click:row
|
* @event {DataTableRow} click:row
|
||||||
* @event {DataTableRow} mouseenter:row
|
* @event {DataTableRow} mouseenter:row
|
||||||
* @event {DataTableRow} mouseleave:row
|
* @event {DataTableRow} mouseleave:row
|
||||||
|
@ -250,20 +250,26 @@
|
||||||
<th scope="col"></th>
|
<th scope="col"></th>
|
||||||
{:else}
|
{:else}
|
||||||
<TableHeader
|
<TableHeader
|
||||||
|
disableSorting="{header.sort === false}"
|
||||||
on:click="{() => {
|
on:click="{() => {
|
||||||
dispatch('click', { header });
|
dispatch('click', { header });
|
||||||
let active = header.key === $sortHeader.key;
|
|
||||||
let currentSortDirection = active
|
if (header.sort === false) {
|
||||||
? $sortHeader.sortDirection
|
dispatch('click:header', { header });
|
||||||
: 'none';
|
} else {
|
||||||
let sortDirection = sortDirectionMap[currentSortDirection];
|
let active = header.key === $sortHeader.key;
|
||||||
dispatch('click:header', { header, sortDirection });
|
let currentSortDirection = active
|
||||||
sortHeader.set({
|
? $sortHeader.sortDirection
|
||||||
id: sortDirection === 'none' ? null : $thKeys[header.key],
|
: 'none';
|
||||||
key: header.key,
|
let sortDirection = sortDirectionMap[currentSortDirection];
|
||||||
sort: header.sort,
|
dispatch('click:header', { header, sortDirection });
|
||||||
sortDirection,
|
sortHeader.set({
|
||||||
});
|
id: sortDirection === 'none' ? null : $thKeys[header.key],
|
||||||
|
key: header.key,
|
||||||
|
sort: header.sort,
|
||||||
|
sortDirection,
|
||||||
|
});
|
||||||
|
}
|
||||||
}}"
|
}}"
|
||||||
>
|
>
|
||||||
<slot name="cell-header" header="{header}">{header.value}</slot>
|
<slot name="cell-header" header="{header}">{header.value}</slot>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script>
|
<script>
|
||||||
/** @extends {"../DataTable/DataTable"} DataTableHeader */
|
/** @extends {"./DataTable"} DataTableHeader */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify the number of columns
|
* Specify the number of columns
|
||||||
|
@ -77,7 +77,11 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
{#each cols as col (col)}
|
{#each cols as col (col)}
|
||||||
<th>{values[col] || ""}</th>
|
{#if typeof values[col] === "object" && values[col].empty === true}
|
||||||
|
<th></th>
|
||||||
|
{:else}
|
||||||
|
<th>{values[col] || ""}</th>
|
||||||
|
{/if}
|
||||||
{/each}
|
{/each}
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
<script>
|
<script>
|
||||||
|
/** Set to `true` to disable sorting on this specific cell */
|
||||||
|
export let disableSorting = false;
|
||||||
|
|
||||||
/** Specify the `scope` attribute */
|
/** Specify the `scope` attribute */
|
||||||
export let scope = "col";
|
export let scope = "col";
|
||||||
|
|
||||||
|
@ -12,8 +15,8 @@
|
||||||
export let id = "ccs-" + Math.random().toString(36);
|
export let id = "ccs-" + Math.random().toString(36);
|
||||||
|
|
||||||
import { getContext } from "svelte";
|
import { getContext } from "svelte";
|
||||||
import ArrowUp20 from "carbon-icons-svelte/lib/ArrowUp20";
|
import ArrowUp20 from "carbon-icons-svelte/lib/ArrowUp20/ArrowUp20.svelte";
|
||||||
import ArrowsVertical20 from "carbon-icons-svelte/lib/ArrowsVertical20";
|
import ArrowsVertical20 from "carbon-icons-svelte/lib/ArrowsVertical20/ArrowsVertical20.svelte";
|
||||||
|
|
||||||
const { sortHeader, tableSortable, add } = getContext("DataTable");
|
const { sortHeader, tableSortable, add } = getContext("DataTable");
|
||||||
|
|
||||||
|
@ -24,7 +27,7 @@
|
||||||
$: ariaLabel = translateWithId();
|
$: ariaLabel = translateWithId();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if $tableSortable}
|
{#if $tableSortable && !disableSorting}
|
||||||
<th
|
<th
|
||||||
aria-sort="{active ? $sortHeader.sortDirection : 'none'}"
|
aria-sort="{active ? $sortHeader.sortDirection : 'none'}"
|
||||||
scope="{scope}"
|
scope="{scope}"
|
||||||
|
|
|
@ -32,32 +32,33 @@
|
||||||
await tick();
|
await tick();
|
||||||
ref.focus();
|
ref.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$: classes = [
|
||||||
|
expanded && "bx--toolbar-search-container-active",
|
||||||
|
persistent
|
||||||
|
? "bx--toolbar-search-container-persistent"
|
||||||
|
: "bx--toolbar-search-container-expandable",
|
||||||
|
disabled && "bx--toolbar-search-container-disabled",
|
||||||
|
]
|
||||||
|
.filter(Boolean)
|
||||||
|
.join(" ");
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div
|
<Search
|
||||||
tabindex="{expanded || disabled ? '-1' : tabindex}"
|
size="sm"
|
||||||
class:bx--toolbar-action="{true}"
|
tabindex="{tabindex}"
|
||||||
class:bx--toolbar-search-container-active="{expanded}"
|
disabled="{disabled}"
|
||||||
class:bx--toolbar-search-container-expandable="{!persistent}"
|
{...$$restProps}
|
||||||
class:bx--toolbar-search-container-persistent="{persistent}"
|
searchClass="{classes} {$$restProps.class}"
|
||||||
class:bx--toolbar-search-container-disabled="{disabled}"
|
bind:ref
|
||||||
on:click="{expandSearch}"
|
bind:value
|
||||||
|
on:clear
|
||||||
|
on:change
|
||||||
|
on:input
|
||||||
|
on:focus
|
||||||
on:focus="{expandSearch}"
|
on:focus="{expandSearch}"
|
||||||
>
|
on:blur
|
||||||
<Search
|
on:blur="{() => {
|
||||||
size="sm"
|
expanded = !persistent && !!value.length;
|
||||||
tabindex="{expanded ? tabindex : '-1'}"
|
}}"
|
||||||
disabled="{disabled}"
|
/>
|
||||||
{...$$restProps}
|
|
||||||
bind:ref
|
|
||||||
bind:value
|
|
||||||
on:clear
|
|
||||||
on:change
|
|
||||||
on:input
|
|
||||||
on:focus
|
|
||||||
on:blur
|
|
||||||
on:blur="{() => {
|
|
||||||
expanded = !persistent && !!value.length;
|
|
||||||
}}"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
/** Set to `true` to render a form requirement */
|
/** Set to `true` to render a form requirement */
|
||||||
export let message = false;
|
export let message = false;
|
||||||
|
|
||||||
|
/** Set to `true` for to remove the bottom margin */
|
||||||
|
export let noMargin = false;
|
||||||
|
|
||||||
/** Specify the message text */
|
/** Specify the message text */
|
||||||
export let messageText = "";
|
export let messageText = "";
|
||||||
|
|
||||||
|
@ -15,6 +18,7 @@
|
||||||
<fieldset
|
<fieldset
|
||||||
data-invalid="{invalid || undefined}"
|
data-invalid="{invalid || undefined}"
|
||||||
class:bx--fieldset="{true}"
|
class:bx--fieldset="{true}"
|
||||||
|
class:bx--fieldset--no-margin="{noMargin}"
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
on:click
|
on:click
|
||||||
on:mouseover
|
on:mouseover
|
||||||
|
|
|
@ -125,6 +125,9 @@
|
||||||
*/
|
*/
|
||||||
export let name = undefined;
|
export let name = undefined;
|
||||||
|
|
||||||
|
/** Obtain a reference to the input HTML element */
|
||||||
|
export let inputRef = null;
|
||||||
|
|
||||||
import { afterUpdate, createEventDispatcher, setContext } from "svelte";
|
import { afterUpdate, createEventDispatcher, setContext } from "svelte";
|
||||||
import WarningFilled16 from "carbon-icons-svelte/lib/WarningFilled16/WarningFilled16.svelte";
|
import WarningFilled16 from "carbon-icons-svelte/lib/WarningFilled16/WarningFilled16.svelte";
|
||||||
import WarningAltFilled16 from "carbon-icons-svelte/lib/WarningAltFilled16/WarningAltFilled16.svelte";
|
import WarningAltFilled16 from "carbon-icons-svelte/lib/WarningAltFilled16/WarningAltFilled16.svelte";
|
||||||
|
@ -143,7 +146,7 @@
|
||||||
let multiSelectRef = null;
|
let multiSelectRef = null;
|
||||||
let fieldRef = null;
|
let fieldRef = null;
|
||||||
let selectionRef = null;
|
let selectionRef = null;
|
||||||
let inputRef = null;
|
|
||||||
let inputValue = "";
|
let inputValue = "";
|
||||||
let initialSorted = false;
|
let initialSorted = false;
|
||||||
let highlightedIndex = -1;
|
let highlightedIndex = -1;
|
||||||
|
|
|
@ -54,11 +54,19 @@
|
||||||
/** Obtain a reference to the overflow menu element */
|
/** Obtain a reference to the overflow menu element */
|
||||||
export let menuRef = null;
|
export let menuRef = null;
|
||||||
|
|
||||||
import { createEventDispatcher, setContext, afterUpdate } from "svelte";
|
import {
|
||||||
|
createEventDispatcher,
|
||||||
|
getContext,
|
||||||
|
setContext,
|
||||||
|
afterUpdate,
|
||||||
|
} from "svelte";
|
||||||
import { writable } from "svelte/store";
|
import { writable } from "svelte/store";
|
||||||
import OverflowMenuVertical16 from "carbon-icons-svelte/lib/OverflowMenuVertical16/OverflowMenuVertical16.svelte";
|
import OverflowMenuVertical16 from "carbon-icons-svelte/lib/OverflowMenuVertical16/OverflowMenuVertical16.svelte";
|
||||||
|
import OverflowMenuHorizontal16 from "carbon-icons-svelte/lib/OverflowMenuHorizontal16/OverflowMenuHorizontal16.svelte";
|
||||||
|
|
||||||
import { formatStyle } from "./formatStyle";
|
import { formatStyle } from "./formatStyle";
|
||||||
|
|
||||||
|
const ctxBreadcrumbItem = getContext("BreadcrumbItem");
|
||||||
const dispatch = createEventDispatcher();
|
const dispatch = createEventDispatcher();
|
||||||
const items = writable([]);
|
const items = writable([]);
|
||||||
const currentId = writable(undefined);
|
const currentId = writable(undefined);
|
||||||
|
@ -68,6 +76,10 @@
|
||||||
let buttonWidth = undefined;
|
let buttonWidth = undefined;
|
||||||
let onMountAfterUpdate = true;
|
let onMountAfterUpdate = true;
|
||||||
|
|
||||||
|
$: if (ctxBreadcrumbItem) {
|
||||||
|
icon = OverflowMenuHorizontal16;
|
||||||
|
}
|
||||||
|
|
||||||
setContext("OverflowMenu", {
|
setContext("OverflowMenu", {
|
||||||
focusedId,
|
focusedId,
|
||||||
add: ({ id, text, primaryFocus }) => {
|
add: ({ id, text, primaryFocus }) => {
|
||||||
|
@ -123,6 +135,11 @@
|
||||||
} else if (direction === "bottom") {
|
} else if (direction === "bottom") {
|
||||||
menuRef.style.top = height + "px";
|
menuRef.style.top = height + "px";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ctxBreadcrumbItem) {
|
||||||
|
menuRef.style.top = height + 10 + "px";
|
||||||
|
menuRef.style.left = -11 + "px";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!open) {
|
if (!open) {
|
||||||
|
@ -218,6 +235,7 @@
|
||||||
class:bx--overflow-menu-options--light="{light}"
|
class:bx--overflow-menu-options--light="{light}"
|
||||||
class:bx--overflow-menu-options--sm="{size === 'sm'}"
|
class:bx--overflow-menu-options--sm="{size === 'sm'}"
|
||||||
class:bx--overflow-menu-options--xl="{size === 'xl'}"
|
class:bx--overflow-menu-options--xl="{size === 'xl'}"
|
||||||
|
class:bx--breadcrumb-menu-options="{!!ctxBreadcrumbItem}"
|
||||||
class:menuOptionsClass
|
class:menuOptionsClass
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
|
|
|
@ -12,6 +12,9 @@
|
||||||
*/
|
*/
|
||||||
export let size = "xl";
|
export let size = "xl";
|
||||||
|
|
||||||
|
/** Specify the class name passed to the outer div element */
|
||||||
|
export let searchClass = "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to `true` to display the skeleton state
|
* Set to `true` to display the skeleton state
|
||||||
* @type {boolean} [skeleton=false]
|
* @type {boolean} [skeleton=false]
|
||||||
|
@ -98,6 +101,7 @@
|
||||||
class:bx--search--sm="{size === 'sm' || small}"
|
class:bx--search--sm="{size === 'sm' || small}"
|
||||||
class:bx--search--lg="{size === 'lg'}"
|
class:bx--search--lg="{size === 'lg'}"
|
||||||
class:bx--search--xl="{size === 'xl'}"
|
class:bx--search--xl="{size === 'xl'}"
|
||||||
|
class="{searchClass}"
|
||||||
>
|
>
|
||||||
<Search16 class="bx--search-magnifier" />
|
<Search16 class="bx--search-magnifier" />
|
||||||
<label id="{id}-search" for="{id}" class:bx--label="{true}"
|
<label id="{id}-search" for="{id}" class:bx--label="{true}"
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
/** Set to `true` to enable the light variant */
|
/** Set to `true` to enable the light variant */
|
||||||
export let light = false;
|
export let light = false;
|
||||||
|
|
||||||
|
/** Set to `true` to disable the tile */
|
||||||
|
export let disabled = false;
|
||||||
|
|
||||||
/** Specify the value of the radio input */
|
/** Specify the value of the radio input */
|
||||||
export let value = "";
|
export let value = "";
|
||||||
|
|
||||||
|
@ -21,7 +24,7 @@
|
||||||
export let name = "";
|
export let name = "";
|
||||||
|
|
||||||
import { getContext } from "svelte";
|
import { getContext } from "svelte";
|
||||||
import CheckmarkFilled16 from "carbon-icons-svelte/lib/CheckmarkFilled16";
|
import CheckmarkFilled16 from "carbon-icons-svelte/lib/CheckmarkFilled16/CheckmarkFilled16.svelte";
|
||||||
|
|
||||||
const { add, update, selectedValue } = getContext("TileGroup");
|
const { add, update, selectedValue } = getContext("TileGroup");
|
||||||
|
|
||||||
|
@ -36,14 +39,17 @@
|
||||||
name="{name}"
|
name="{name}"
|
||||||
value="{value}"
|
value="{value}"
|
||||||
checked="{checked}"
|
checked="{checked}"
|
||||||
tabindex="{tabindex}"
|
tabindex="{disabled ? undefined : tabindex}"
|
||||||
|
disabled="{disabled}"
|
||||||
class:bx--tile-input="{true}"
|
class:bx--tile-input="{true}"
|
||||||
on:change
|
on:change
|
||||||
on:change="{() => {
|
on:change="{() => {
|
||||||
|
if (disabled) return;
|
||||||
update(value);
|
update(value);
|
||||||
}}"
|
}}"
|
||||||
on:keydown
|
on:keydown
|
||||||
on:keydown="{(e) => {
|
on:keydown="{(e) => {
|
||||||
|
if (disabled) return;
|
||||||
if (e.key === ' ' || e.key === 'Enter') {
|
if (e.key === ' ' || e.key === 'Enter') {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
update(value);
|
update(value);
|
||||||
|
@ -56,6 +62,7 @@
|
||||||
class:bx--tile--selectable="{true}"
|
class:bx--tile--selectable="{true}"
|
||||||
class:bx--tile--is-selected="{checked}"
|
class:bx--tile--is-selected="{checked}"
|
||||||
class:bx--tile--light="{light}"
|
class:bx--tile--light="{light}"
|
||||||
|
class:bx--tile--disabled="{disabled}"
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
on:click
|
on:click
|
||||||
on:mouseover
|
on:mouseover
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
/** Set to `true` to enable the light variant */
|
/** Set to `true` to enable the light variant */
|
||||||
export let light = false;
|
export let light = false;
|
||||||
|
|
||||||
|
/** Set to `true` to disable the tile */
|
||||||
|
export let disabled = false;
|
||||||
|
|
||||||
/** Specify the title of the selectable tile */
|
/** Specify the title of the selectable tile */
|
||||||
export let title = "title";
|
export let title = "title";
|
||||||
|
|
||||||
|
@ -30,11 +33,11 @@
|
||||||
export let ref = null;
|
export let ref = null;
|
||||||
|
|
||||||
import { createEventDispatcher } from "svelte";
|
import { createEventDispatcher } from "svelte";
|
||||||
import CheckmarkFilled16 from "carbon-icons-svelte/lib/CheckmarkFilled16";
|
import CheckmarkFilled16 from "carbon-icons-svelte/lib/CheckmarkFilled16/CheckmarkFilled16.svelte";
|
||||||
|
|
||||||
const dispatch = createEventDispatcher();
|
const dispatch = createEventDispatcher();
|
||||||
|
|
||||||
$: dispatch(selected ? "select" : "deselect", id);
|
$: if (!disabled) dispatch(selected ? "select" : "deselect", id);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<input
|
<input
|
||||||
|
@ -47,17 +50,20 @@
|
||||||
value="{value}"
|
value="{value}"
|
||||||
name="{name}"
|
name="{name}"
|
||||||
title="{title}"
|
title="{title}"
|
||||||
|
disabled="{disabled}"
|
||||||
/>
|
/>
|
||||||
<label
|
<label
|
||||||
for="{id}"
|
for="{id}"
|
||||||
tabindex="{tabindex}"
|
tabindex="{disabled ? undefined : tabindex}"
|
||||||
class:bx--tile="{true}"
|
class:bx--tile="{true}"
|
||||||
class:bx--tile--selectable="{true}"
|
class:bx--tile--selectable="{true}"
|
||||||
class:bx--tile--is-selected="{selected}"
|
class:bx--tile--is-selected="{selected}"
|
||||||
class:bx--tile--light="{light}"
|
class:bx--tile--light="{light}"
|
||||||
|
class:bx--tile--disabled="{disabled}"
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
on:click
|
on:click
|
||||||
on:click|preventDefault="{() => {
|
on:click|preventDefault="{() => {
|
||||||
|
if (disabled) return;
|
||||||
selected = !selected;
|
selected = !selected;
|
||||||
}}"
|
}}"
|
||||||
on:mouseover
|
on:mouseover
|
||||||
|
@ -65,6 +71,7 @@
|
||||||
on:mouseleave
|
on:mouseleave
|
||||||
on:keydown
|
on:keydown
|
||||||
on:keydown="{(e) => {
|
on:keydown="{(e) => {
|
||||||
|
if (disabled) return;
|
||||||
if (e.key === ' ' || e.key === 'Enter') {
|
if (e.key === ' ' || e.key === 'Enter') {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
selected = !selected;
|
selected = !selected;
|
||||||
|
|
|
@ -67,6 +67,7 @@
|
||||||
<div
|
<div
|
||||||
class:bx--time-picker="{true}"
|
class:bx--time-picker="{true}"
|
||||||
class:bx--time-picker--light="{light}"
|
class:bx--time-picker--light="{light}"
|
||||||
|
class:bx--time-picker--invalid="{invalid}"
|
||||||
class:bx--time-picker--sm="{size === 'sm'}"
|
class:bx--time-picker--sm="{size === 'sm'}"
|
||||||
class:bx--time-picker--xl="{size === 'xl'}"
|
class:bx--time-picker--xl="{size === 'xl'}"
|
||||||
class:bx--select--light="{light}"
|
class:bx--select--light="{light}"
|
||||||
|
|
|
@ -63,10 +63,14 @@
|
||||||
/** Obtain a reference to the icon HTML element */
|
/** Obtain a reference to the icon HTML element */
|
||||||
export let refIcon = null;
|
export let refIcon = null;
|
||||||
|
|
||||||
import { createEventDispatcher, afterUpdate } from "svelte";
|
import { createEventDispatcher, afterUpdate, setContext } from "svelte";
|
||||||
|
import { writable } from "svelte/store";
|
||||||
import Information16 from "carbon-icons-svelte/lib/Information16/Information16.svelte";
|
import Information16 from "carbon-icons-svelte/lib/Information16/Information16.svelte";
|
||||||
|
|
||||||
const dispatch = createEventDispatcher();
|
const dispatch = createEventDispatcher();
|
||||||
|
const tooltipOpen = writable(open);
|
||||||
|
|
||||||
|
setContext("Tooltip", { tooltipOpen });
|
||||||
|
|
||||||
function onKeydown(e) {
|
function onKeydown(e) {
|
||||||
if (e.key === "Escape") {
|
if (e.key === "Escape") {
|
||||||
|
@ -143,6 +147,7 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$: tooltipOpen.set(open);
|
||||||
$: dispatch(open ? "open" : "close");
|
$: dispatch(open ? "open" : "close");
|
||||||
$: buttonProps = {
|
$: buttonProps = {
|
||||||
role: "button",
|
role: "button",
|
||||||
|
|
29
src/Tooltip/TooltipFooter.svelte
Normal file
29
src/Tooltip/TooltipFooter.svelte
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
<script>
|
||||||
|
/** Specify a selector to be focused inside the footer when opening the tooltip */
|
||||||
|
export let selectorPrimaryFocus = "a[href], button:not([disabled])";
|
||||||
|
|
||||||
|
import { getContext, onMount } from "svelte";
|
||||||
|
|
||||||
|
let ref = null;
|
||||||
|
let open = false;
|
||||||
|
|
||||||
|
const ctx = getContext("Tooltip");
|
||||||
|
const unsubscribe = ctx.tooltipOpen.subscribe((tooltipOpen) => {
|
||||||
|
open = tooltipOpen;
|
||||||
|
});
|
||||||
|
|
||||||
|
onMount(() => {
|
||||||
|
return () => {
|
||||||
|
unsubscribe();
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
$: if (open && ref) {
|
||||||
|
const node = ref.querySelector(selectorPrimaryFocus);
|
||||||
|
if (node) node.focus();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div bind:this="{ref}" class:bx--tooltip__footer="{true}">
|
||||||
|
<slot />
|
||||||
|
</div>
|
|
@ -1 +1,2 @@
|
||||||
export { default as Tooltip } from "./Tooltip.svelte";
|
export { default as Tooltip } from "./Tooltip.svelte";
|
||||||
|
export { default as TooltipFooter } from "./TooltipFooter.svelte";
|
||||||
|
|
|
@ -121,7 +121,7 @@ export {
|
||||||
export { TimePicker, TimePickerSelect } from "./TimePicker";
|
export { TimePicker, TimePickerSelect } from "./TimePicker";
|
||||||
export { Toggle, ToggleSkeleton } from "./Toggle";
|
export { Toggle, ToggleSkeleton } from "./Toggle";
|
||||||
export { ToggleSmall, ToggleSmallSkeleton } from "./ToggleSmall";
|
export { ToggleSmall, ToggleSmallSkeleton } from "./ToggleSmall";
|
||||||
export { Tooltip } from "./Tooltip";
|
export { Tooltip, TooltipFooter } from "./Tooltip";
|
||||||
export { TooltipDefinition } from "./TooltipDefinition";
|
export { TooltipDefinition } from "./TooltipDefinition";
|
||||||
export { TooltipIcon } from "./TooltipIcon";
|
export { TooltipIcon } from "./TooltipIcon";
|
||||||
export { Truncate } from "./Truncate";
|
export { Truncate } from "./Truncate";
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
<ContextMenu>
|
<ContextMenu>
|
||||||
<ContextMenuOption
|
<ContextMenuOption
|
||||||
|
kind="danger"
|
||||||
indented
|
indented
|
||||||
labelText="Copy"
|
labelText="Copy"
|
||||||
shortcutText="⌘C"
|
shortcutText="⌘C"
|
||||||
|
|
|
@ -10,13 +10,14 @@
|
||||||
Button,
|
Button,
|
||||||
Link,
|
Link,
|
||||||
} from "../types";
|
} from "../types";
|
||||||
|
import type { DataTableHeader } from "../types/DataTable/DataTable";
|
||||||
import Launch16 from "carbon-icons-svelte/lib/Launch16";
|
import Launch16 from "carbon-icons-svelte/lib/Launch16";
|
||||||
|
|
||||||
const headers = [
|
const headers: DataTableHeader[] = [
|
||||||
{ key: "name", value: "Name" },
|
{ key: "name", value: "Name" },
|
||||||
{ key: "protocol", value: "Protocol" },
|
{ key: "protocol", value: "Protocol" },
|
||||||
{ key: "port", value: "Port" },
|
{ key: "port", value: "Port" },
|
||||||
{ key: "rule", value: "Rule" },
|
{ key: "rule", value: "Rule", sort: false },
|
||||||
];
|
];
|
||||||
const rows = [
|
const rows = [
|
||||||
{
|
{
|
||||||
|
@ -249,6 +250,7 @@
|
||||||
{ value: 'Protocol' },
|
{ value: 'Protocol' },
|
||||||
{ value: 'Port' },
|
{ value: 'Port' },
|
||||||
{ value: 'Rule' },
|
{ value: 'Rule' },
|
||||||
|
{ empty: true },
|
||||||
]}"
|
]}"
|
||||||
rows="{10}"
|
rows="{10}"
|
||||||
/>
|
/>
|
||||||
|
|
2
types/CodeSnippet/CodeSnippet.d.ts
vendored
2
types/CodeSnippet/CodeSnippet.d.ts
vendored
|
@ -11,6 +11,7 @@ export interface CodeSnippetProps {
|
||||||
/**
|
/**
|
||||||
* Set the code snippet text
|
* Set the code snippet text
|
||||||
* Alternatively, use the default slot (e.g., <CodeSnippet>{`code`}</CodeSnippet>)
|
* Alternatively, use the default slot (e.g., <CodeSnippet>{`code`}</CodeSnippet>)
|
||||||
|
* You must use the `code` prop to copy the code
|
||||||
*/
|
*/
|
||||||
code?: string;
|
code?: string;
|
||||||
|
|
||||||
|
@ -115,6 +116,7 @@ export default class CodeSnippet extends SvelteComponentTyped<
|
||||||
mouseenter: WindowEventMap["mouseenter"];
|
mouseenter: WindowEventMap["mouseenter"];
|
||||||
mouseleave: WindowEventMap["mouseleave"];
|
mouseleave: WindowEventMap["mouseleave"];
|
||||||
animationend: WindowEventMap["animationend"];
|
animationend: WindowEventMap["animationend"];
|
||||||
|
copy: CustomEvent<any>;
|
||||||
},
|
},
|
||||||
{ default: {} }
|
{ default: {} }
|
||||||
> {}
|
> {}
|
||||||
|
|
6
types/ContextMenu/ContextMenuOption.d.ts
vendored
6
types/ContextMenu/ContextMenuOption.d.ts
vendored
|
@ -3,6 +3,12 @@ import { SvelteComponentTyped } from "svelte";
|
||||||
|
|
||||||
export interface ContextMenuOptionProps
|
export interface ContextMenuOptionProps
|
||||||
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["li"]> {
|
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["li"]> {
|
||||||
|
/**
|
||||||
|
* Specify the kind of option
|
||||||
|
* @default "default"
|
||||||
|
*/
|
||||||
|
kind?: "default" | "danger";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to `true` to enable the disabled state
|
* Set to `true` to enable the disabled state
|
||||||
* @default false
|
* @default false
|
||||||
|
|
6
types/CopyButton/CopyButton.d.ts
vendored
6
types/CopyButton/CopyButton.d.ts
vendored
|
@ -8,6 +8,11 @@ export interface CopyButtonProps extends CopyProps {
|
||||||
* @default "Copy to clipboard"
|
* @default "Copy to clipboard"
|
||||||
*/
|
*/
|
||||||
iconDescription?: string;
|
iconDescription?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the text to copy
|
||||||
|
*/
|
||||||
|
text?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class CopyButton extends SvelteComponentTyped<
|
export default class CopyButton extends SvelteComponentTyped<
|
||||||
|
@ -15,6 +20,7 @@ export default class CopyButton extends SvelteComponentTyped<
|
||||||
{
|
{
|
||||||
click: WindowEventMap["click"];
|
click: WindowEventMap["click"];
|
||||||
animationend: WindowEventMap["animationend"];
|
animationend: WindowEventMap["animationend"];
|
||||||
|
copy: CustomEvent<any>;
|
||||||
},
|
},
|
||||||
{}
|
{}
|
||||||
> {}
|
> {}
|
||||||
|
|
6
types/DataTable/DataTable.d.ts
vendored
6
types/DataTable/DataTable.d.ts
vendored
|
@ -9,7 +9,7 @@ export interface DataTableEmptyHeader {
|
||||||
key: DataTableKey;
|
key: DataTableKey;
|
||||||
empty: boolean;
|
empty: boolean;
|
||||||
display?: (item: Value) => DataTableValue;
|
display?: (item: Value) => DataTableValue;
|
||||||
sort?: (a: DataTableValue, b: DataTableValue) => 0 | -1 | 1;
|
sort?: false | ((a: DataTableValue, b: DataTableValue) => 0 | -1 | 1);
|
||||||
columnMenu?: boolean;
|
columnMenu?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ export interface DataTableNonEmptyHeader {
|
||||||
key: DataTableKey;
|
key: DataTableKey;
|
||||||
value: DataTableValue;
|
value: DataTableValue;
|
||||||
display?: (item: Value) => DataTableValue;
|
display?: (item: Value) => DataTableValue;
|
||||||
sort?: (a: DataTableValue, b: DataTableValue) => 0 | -1 | 1;
|
sort?: false | ((a: DataTableValue, b: DataTableValue) => 0 | -1 | 1);
|
||||||
columnMenu?: boolean;
|
columnMenu?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,7 +141,7 @@ export default class DataTable extends SvelteComponentTyped<
|
||||||
["click:header--expand"]: CustomEvent<{ expanded: boolean }>;
|
["click:header--expand"]: CustomEvent<{ expanded: boolean }>;
|
||||||
["click:header"]: CustomEvent<{
|
["click:header"]: CustomEvent<{
|
||||||
header: DataTableHeader;
|
header: DataTableHeader;
|
||||||
sortDirection: "ascending" | "descending" | "none";
|
sortDirection?: "ascending" | "descending" | "none";
|
||||||
}>;
|
}>;
|
||||||
["click:row"]: CustomEvent<DataTableRow>;
|
["click:row"]: CustomEvent<DataTableRow>;
|
||||||
["mouseenter:row"]: CustomEvent<DataTableRow>;
|
["mouseenter:row"]: CustomEvent<DataTableRow>;
|
||||||
|
|
2
types/DataTable/DataTableSkeleton.d.ts
vendored
2
types/DataTable/DataTableSkeleton.d.ts
vendored
|
@ -1,6 +1,6 @@
|
||||||
/// <reference types="svelte" />
|
/// <reference types="svelte" />
|
||||||
import { SvelteComponentTyped } from "svelte";
|
import { SvelteComponentTyped } from "svelte";
|
||||||
import { DataTableHeader } from "../DataTable/DataTable";
|
import { DataTableHeader } from "./DataTable";
|
||||||
|
|
||||||
export interface DataTableSkeletonProps
|
export interface DataTableSkeletonProps
|
||||||
extends DataTableHeader,
|
extends DataTableHeader,
|
||||||
|
|
6
types/DataTable/TableHeader.d.ts
vendored
6
types/DataTable/TableHeader.d.ts
vendored
|
@ -3,6 +3,12 @@ import { SvelteComponentTyped } from "svelte";
|
||||||
|
|
||||||
export interface TableHeaderProps
|
export interface TableHeaderProps
|
||||||
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["th"]> {
|
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["th"]> {
|
||||||
|
/**
|
||||||
|
* Set to `true` to disable sorting on this specific cell
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
disableSorting?: boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify the `scope` attribute
|
* Specify the `scope` attribute
|
||||||
* @default "col"
|
* @default "col"
|
||||||
|
|
6
types/FormGroup/FormGroup.d.ts
vendored
6
types/FormGroup/FormGroup.d.ts
vendored
|
@ -15,6 +15,12 @@ export interface FormGroupProps
|
||||||
*/
|
*/
|
||||||
message?: boolean;
|
message?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` for to remove the bottom margin
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
noMargin?: boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify the message text
|
* Specify the message text
|
||||||
* @default ""
|
* @default ""
|
||||||
|
|
6
types/MultiSelect/MultiSelect.d.ts
vendored
6
types/MultiSelect/MultiSelect.d.ts
vendored
|
@ -174,6 +174,12 @@ export interface MultiSelectProps
|
||||||
* Specify a name attribute for the select
|
* Specify a name attribute for the select
|
||||||
*/
|
*/
|
||||||
name?: string;
|
name?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obtain a reference to the input HTML element
|
||||||
|
* @default null
|
||||||
|
*/
|
||||||
|
inputRef?: null | HTMLInputElement;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class MultiSelect extends SvelteComponentTyped<
|
export default class MultiSelect extends SvelteComponentTyped<
|
||||||
|
|
6
types/Search/Search.d.ts
vendored
6
types/Search/Search.d.ts
vendored
|
@ -13,6 +13,12 @@ export interface SearchProps {
|
||||||
*/
|
*/
|
||||||
size?: "sm" | "lg" | "xl";
|
size?: "sm" | "lg" | "xl";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the class name passed to the outer div element
|
||||||
|
* @default ""
|
||||||
|
*/
|
||||||
|
searchClass?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to `true` to display the skeleton state
|
* Set to `true` to display the skeleton state
|
||||||
* @default false
|
* @default false
|
||||||
|
|
6
types/Tile/RadioTile.d.ts
vendored
6
types/Tile/RadioTile.d.ts
vendored
|
@ -15,6 +15,12 @@ export interface RadioTileProps
|
||||||
*/
|
*/
|
||||||
light?: boolean;
|
light?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to disable the tile
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
disabled?: boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify the value of the radio input
|
* Specify the value of the radio input
|
||||||
* @default ""
|
* @default ""
|
||||||
|
|
6
types/Tile/SelectableTile.d.ts
vendored
6
types/Tile/SelectableTile.d.ts
vendored
|
@ -15,6 +15,12 @@ export interface SelectableTileProps
|
||||||
*/
|
*/
|
||||||
light?: boolean;
|
light?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to `true` to disable the tile
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
disabled?: boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify the title of the selectable tile
|
* Specify the title of the selectable tile
|
||||||
* @default "title"
|
* @default "title"
|
||||||
|
|
16
types/Tooltip/TooltipFooter.d.ts
vendored
Normal file
16
types/Tooltip/TooltipFooter.d.ts
vendored
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
/// <reference types="svelte" />
|
||||||
|
import { SvelteComponentTyped } from "svelte";
|
||||||
|
|
||||||
|
export interface TooltipFooterProps {
|
||||||
|
/**
|
||||||
|
* Specify a selector to be focused inside the footer when opening the tooltip
|
||||||
|
* @default "a[href], button:not([disabled])"
|
||||||
|
*/
|
||||||
|
selectorPrimaryFocus?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default class TooltipFooter extends SvelteComponentTyped<
|
||||||
|
TooltipFooterProps,
|
||||||
|
{},
|
||||||
|
{ default: {} }
|
||||||
|
> {}
|
1
types/index.d.ts
vendored
1
types/index.d.ts
vendored
|
@ -139,6 +139,7 @@ export { default as ToggleSkeleton } from "./Toggle/ToggleSkeleton";
|
||||||
export { default as ToggleSmall } from "./ToggleSmall/ToggleSmall";
|
export { default as ToggleSmall } from "./ToggleSmall/ToggleSmall";
|
||||||
export { default as ToggleSmallSkeleton } from "./ToggleSmall/ToggleSmallSkeleton";
|
export { default as ToggleSmallSkeleton } from "./ToggleSmall/ToggleSmallSkeleton";
|
||||||
export { default as Tooltip } from "./Tooltip/Tooltip";
|
export { default as Tooltip } from "./Tooltip/Tooltip";
|
||||||
|
export { default as TooltipFooter } from "./Tooltip/TooltipFooter";
|
||||||
export { default as TooltipDefinition } from "./TooltipDefinition/TooltipDefinition";
|
export { default as TooltipDefinition } from "./TooltipDefinition/TooltipDefinition";
|
||||||
export { default as TooltipIcon } from "./TooltipIcon/TooltipIcon";
|
export { default as TooltipIcon } from "./TooltipIcon/TooltipIcon";
|
||||||
export { default as Truncate } from "./Truncate/Truncate";
|
export { default as Truncate } from "./Truncate/Truncate";
|
||||||
|
|
13
yarn.lock
13
yarn.lock
|
@ -453,10 +453,10 @@ caniuse-lite@^1.0.30001181:
|
||||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001183.tgz#7a57ba9d6584119bb5f2bc76d3cc47ba9356b3e2"
|
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001183.tgz#7a57ba9d6584119bb5f2bc76d3cc47ba9356b3e2"
|
||||||
integrity sha512-7JkwTEE1hlRKETbCFd8HDZeLiQIUcl8rC6JgNjvHCNaxOeNmQ9V4LvQXRUsKIV2CC73qKxljwVhToaA3kLRqTw==
|
integrity sha512-7JkwTEE1hlRKETbCFd8HDZeLiQIUcl8rC6JgNjvHCNaxOeNmQ9V4LvQXRUsKIV2CC73qKxljwVhToaA3kLRqTw==
|
||||||
|
|
||||||
carbon-components@10.31.0:
|
carbon-components@10.32.0:
|
||||||
version "10.31.0"
|
version "10.32.0"
|
||||||
resolved "https://registry.yarnpkg.com/carbon-components/-/carbon-components-10.31.0.tgz#050751e7fb4d845b7d1c6e8ac7fdfa9c71403c12"
|
resolved "https://registry.yarnpkg.com/carbon-components/-/carbon-components-10.32.0.tgz#0fbf60ea8fc12cea43ae7860bec844b3c2c0880f"
|
||||||
integrity sha512-gUXRky9rUHavqFLJJQf+Lzouk8GHsXJUjxRgTOUQ6vdBfA0ks6ugwptG8fiFGwCJJht/CW9/YsKb5w8N9a39sg==
|
integrity sha512-LM44X6VhUc+yrZBSz+IW1aT/OGxAS0oiiy/kV7CiDpsUDF5zlPOwgokZbeYLo2mhB1wBZ1q9jwvItZ4zfaZuMw==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@carbon/telemetry" "0.0.0-alpha.6"
|
"@carbon/telemetry" "0.0.0-alpha.6"
|
||||||
flatpickr "4.6.1"
|
flatpickr "4.6.1"
|
||||||
|
@ -540,6 +540,11 @@ cli-truncate@^2.1.0:
|
||||||
slice-ansi "^3.0.0"
|
slice-ansi "^3.0.0"
|
||||||
string-width "^4.2.0"
|
string-width "^4.2.0"
|
||||||
|
|
||||||
|
clipboard-copy@3.2.0:
|
||||||
|
version "3.2.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/clipboard-copy/-/clipboard-copy-3.2.0.tgz#3c5b8651d3512dcfad295d77a9eb09e7fac8d5fb"
|
||||||
|
integrity sha512-vooFaGFL6ulEP1liiaWFBmmfuPm3cY3y7T9eB83ZTnYc/oFeAKsq3NcDrOkBC8XaauEE8zHQwI7k0+JSYiVQSQ==
|
||||||
|
|
||||||
cliui@^7.0.2:
|
cliui@^7.0.2:
|
||||||
version "7.0.4"
|
version "7.0.4"
|
||||||
resolved "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f"
|
resolved "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue