fluentui-svelte 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/app-surface/app-surface.svelte +96 -0
- package/dist/components/app-surface/app-surface.svelte.d.ts +22 -0
- package/dist/components/app-surface/docs/llms.md +73 -0
- package/dist/components/app-surface/types.d.ts +19 -0
- package/dist/components/app-surface/types.js +1 -0
- package/dist/components/app-window/app-window.d.ts +3 -0
- package/dist/components/app-window/app-window.js +3 -0
- package/dist/components/app-window/app-window.svelte +193 -0
- package/dist/components/app-window/app-window.svelte.d.ts +25 -0
- package/dist/components/app-window/docs/llms.md +119 -0
- package/dist/components/app-window/types.d.ts +66 -0
- package/dist/components/app-window/types.js +1 -0
- package/dist/components/auto-suggest-box/auto-suggest-box.svelte +47 -31
- package/dist/components/auto-suggest-box/auto-suggest-box.svelte.d.ts +2 -2
- package/dist/components/auto-suggest-box/docs/llms.md +34 -33
- package/dist/components/auto-suggest-box/option.svelte +6 -4
- package/dist/components/auto-suggest-box/types.d.ts +13 -16
- package/dist/components/avatar/avatar.svelte +4 -3
- package/dist/components/avatar/docs/llms.md +1 -1
- package/dist/components/avatar/type.d.ts +1 -1
- package/dist/components/badge/badge-icon.svelte +2 -2
- package/dist/components/badge/badge.svelte +2 -2
- package/dist/components/badge/docs/llms.md +2 -2
- package/dist/components/badge/types.d.ts +2 -2
- package/dist/components/breadcrumb/breadcrumb-button.svelte +2 -2
- package/dist/components/breadcrumb/breadcrumb-divider.svelte +2 -2
- package/dist/components/breadcrumb/breadcrumb-item.svelte +2 -2
- package/dist/components/breadcrumb/breadcrumb.svelte +10 -5
- package/dist/components/breadcrumb/docs/llms.md +11 -11
- package/dist/components/breadcrumb/types.d.ts +7 -7
- package/dist/components/button/button.svelte +2 -2
- package/dist/components/button/docs/llms.md +17 -17
- package/dist/components/button/split-button.svelte +7 -7
- package/dist/components/button/types.d.ts +5 -5
- package/dist/components/calendar-date-picker/calendar-date-picker.svelte +98 -10
- package/dist/components/calendar-date-picker/calendar-date-picker.svelte.d.ts +1 -1
- package/dist/components/calendar-date-picker/docs/llms.md +19 -14
- package/dist/components/calendar-date-picker/types.d.ts +22 -8
- package/dist/components/calendar-view/calendar-view-days.svelte +3 -2
- package/dist/components/calendar-view/calendar-view-grid.js +8 -3
- package/dist/components/calendar-view/calendar-view-item.svelte +10 -4
- package/dist/components/calendar-view/calendar-view-months.svelte +3 -2
- package/dist/components/calendar-view/calendar-view-years.svelte +3 -2
- package/dist/components/calendar-view/calendar-view.svelte +11 -4
- package/dist/components/calendar-view/calendar-view.svelte.js +5 -0
- package/dist/components/calendar-view/docs/llms.md +20 -19
- package/dist/components/calendar-view/types.d.ts +6 -1
- package/dist/components/card/card-footer.svelte +2 -2
- package/dist/components/card/card-header.svelte +5 -4
- package/dist/components/card/card-preview.svelte +13 -2
- package/dist/components/card/card.svelte +5 -5
- package/dist/components/card/docs/llms.md +22 -21
- package/dist/components/card/types.d.ts +8 -4
- package/dist/components/checkbox/checkbox.svelte +47 -26
- package/dist/components/checkbox/checkbox.svelte.d.ts +3 -24
- package/dist/components/checkbox/docs/llms.md +24 -23
- package/dist/components/checkbox/types.d.ts +10 -23
- package/dist/components/date-picker/date-picker.svelte +98 -27
- package/dist/components/date-picker/date-picker.svelte.d.ts +1 -1
- package/dist/components/date-picker/docs/llms.md +23 -20
- package/dist/components/date-picker/types.d.ts +24 -15
- package/dist/components/dialog/dialog-actions.svelte +2 -2
- package/dist/components/dialog/dialog-content.svelte +2 -2
- package/dist/components/dialog/dialog-surface.svelte +102 -9
- package/dist/components/dialog/dialog-title.svelte +2 -2
- package/dist/components/dialog/dialog-trigger.svelte +2 -2
- package/dist/components/dialog/dialog.svelte +22 -11
- package/dist/components/dialog/docs/llms.md +56 -19
- package/dist/components/dialog/types.d.ts +25 -7
- package/dist/components/divider/divider.svelte +6 -4
- package/dist/components/divider/types.d.ts +1 -1
- package/dist/components/dropdown/docs/llms.md +30 -28
- package/dist/components/dropdown/dropdown-option.svelte +17 -5
- package/dist/components/dropdown/dropdown.svelte +182 -84
- package/dist/components/dropdown/dropdown.svelte.d.ts +1 -1
- package/dist/components/dropdown/types.d.ts +26 -20
- package/dist/components/dropdown-select/docs/llms.md +24 -22
- package/dist/components/dropdown-select/dropdown-select-option.svelte +2 -2
- package/dist/components/dropdown-select/dropdown-select.svelte +42 -7
- package/dist/components/dropdown-select/types.d.ts +4 -4
- package/dist/components/expander/docs/llms.md +3 -3
- package/dist/components/expander/expander.svelte +13 -8
- package/dist/components/expander/types.d.ts +5 -5
- package/dist/components/flyout/docs/llms.md +1 -1
- package/dist/components/flyout/flyout.svelte +17 -6
- package/dist/components/flyout/types.d.ts +1 -1
- package/dist/components/hyperlink/docs/llms.md +6 -6
- package/dist/components/hyperlink/hyperlink.svelte +13 -4
- package/dist/components/hyperlink/types.d.ts +1 -1
- package/dist/components/info-bar/docs/llms.md +11 -10
- package/dist/components/info-bar/info-bar.svelte +3 -2
- package/dist/components/info-bar/types.d.ts +4 -0
- package/dist/components/label/docs/llms.md +75 -22
- package/dist/components/label/label-context.d.ts +14 -0
- package/dist/components/label/label-context.js +10 -0
- package/dist/components/label/label.svelte +153 -30
- package/dist/components/label/label.svelte.d.ts +1 -1
- package/dist/components/label/types.d.ts +48 -4
- package/dist/components/list-view/docs/llms.md +103 -33
- package/dist/components/list-view/list-view-item-branch.svelte +257 -0
- package/dist/components/list-view/list-view-item-branch.svelte.d.ts +4 -0
- package/dist/components/list-view/list-view-item.svelte +164 -46
- package/dist/components/list-view/list-view-item.svelte.d.ts +5 -5
- package/dist/components/list-view/list-view.svelte +73 -25
- package/dist/components/list-view/types.d.ts +71 -8
- package/dist/components/list-view/utils.d.ts +10 -0
- package/dist/components/list-view/utils.js +17 -1
- package/dist/components/menu/docs/llms.md +98 -15
- package/dist/components/menu/menu-command-bar-item.svelte +61 -0
- package/dist/components/menu/menu-command-bar-item.svelte.d.ts +14 -0
- package/dist/components/menu/menu-command-bar.svelte +218 -0
- package/dist/components/menu/menu-command-bar.svelte.d.ts +21 -0
- package/dist/components/menu/menu-group.svelte +6 -3
- package/dist/components/menu/menu-item-checkbox.svelte +5 -4
- package/dist/components/menu/menu-item-radio.svelte +5 -4
- package/dist/components/menu/menu-item-switch.svelte +5 -4
- package/dist/components/menu/menu-item.svelte +5 -5
- package/dist/components/menu/menu-item.svelte.d.ts +2 -3
- package/dist/components/menu/menu-list.svelte +10 -1
- package/dist/components/menu/menu-popover.svelte +9 -5
- package/dist/components/menu/menu-trigger.svelte +2 -1
- package/dist/components/menu/menu.svelte.js +1 -0
- package/dist/components/menu/types.d.ts +62 -7
- package/dist/components/number-box/docs/llms.md +6 -4
- package/dist/components/number-box/number-box.svelte +35 -29
- package/dist/components/number-box/number-box.svelte.d.ts +1 -1
- package/dist/components/number-box/types.d.ts +1 -1
- package/dist/components/persona/docs/llms.md +29 -25
- package/dist/components/persona/persona.svelte +8 -6
- package/dist/components/persona/types.d.ts +4 -3
- package/dist/components/progress-bar/docs/llms.md +13 -13
- package/dist/components/progress-bar/progress-bar.svelte +6 -6
- package/dist/components/progress-bar/types.d.ts +4 -4
- package/dist/components/progress-ring/docs/llms.md +14 -14
- package/dist/components/progress-ring/progress-ring.svelte +5 -5
- package/dist/components/progress-ring/types.d.ts +3 -3
- package/dist/components/radio-button/docs/llms.md +11 -8
- package/dist/components/radio-button/radio-button.svelte +38 -12
- package/dist/components/radio-button/radio-button.svelte.d.ts +1 -1
- package/dist/components/radio-button/types.d.ts +11 -8
- package/dist/components/rating/docs/llms.md +15 -14
- package/dist/components/rating/rating.svelte +66 -29
- package/dist/components/rating/rating.svelte.d.ts +1 -1
- package/dist/components/rating/types.d.ts +8 -8
- package/dist/components/side-nav/docs/llms.md +110 -0
- package/dist/components/side-nav/side-nav-branch.svelte +43 -0
- package/dist/components/side-nav/side-nav-branch.svelte.d.ts +4 -0
- package/dist/components/side-nav/side-nav-item.svelte +75 -0
- package/dist/components/side-nav/side-nav-item.svelte.d.ts +25 -0
- package/dist/components/side-nav/side-nav-list.svelte +32 -0
- package/dist/components/side-nav/side-nav-list.svelte.d.ts +7 -0
- package/dist/components/side-nav/side-nav.d.ts +2 -0
- package/dist/components/side-nav/side-nav.js +2 -0
- package/dist/components/side-nav/side-nav.svelte +355 -0
- package/dist/components/side-nav/side-nav.svelte.d.ts +24 -0
- package/dist/components/side-nav/types.d.ts +149 -0
- package/dist/components/side-nav/types.js +1 -0
- package/dist/components/skeleton/docs/llms.md +1 -1
- package/dist/components/skeleton/skeleton.svelte +2 -2
- package/dist/components/skeleton/types.d.ts +1 -1
- package/dist/components/slider/docs/llms.md +31 -28
- package/dist/components/slider/slider.svelte +126 -61
- package/dist/components/slider/slider.svelte.d.ts +1 -3
- package/dist/components/slider/types.d.ts +21 -14
- package/dist/components/tab-view/docs/llms.md +7 -7
- package/dist/components/tab-view/tab-view-tab.svelte +16 -14
- package/dist/components/tab-view/tab-view.svelte +16 -9
- package/dist/components/tab-view/types.d.ts +6 -6
- package/dist/components/table/docs/llms.md +38 -33
- package/dist/components/table/table-body.svelte +2 -2
- package/dist/components/table/table-cell-actions.svelte +8 -2
- package/dist/components/table/table-cell-layout.svelte +2 -2
- package/dist/components/table/table-cell.svelte +2 -2
- package/dist/components/table/table-header-cell.svelte +2 -2
- package/dist/components/table/table-header.svelte +2 -2
- package/dist/components/table/table-row.svelte +2 -2
- package/dist/components/table/table-selection-cell.svelte +6 -6
- package/dist/components/table/table.svelte +2 -2
- package/dist/components/table/types.d.ts +11 -11
- package/dist/components/tag/docs/llms.md +26 -26
- package/dist/components/tag/tag-group.svelte +2 -2
- package/dist/components/tag/tag.svelte +13 -12
- package/dist/components/tag/types.d.ts +6 -4
- package/dist/components/tag-picker/docs/llms.md +61 -55
- package/dist/components/tag-picker/option-group.svelte +17 -4
- package/dist/components/tag-picker/option-group.svelte.d.ts +1 -1
- package/dist/components/tag-picker/option.svelte +15 -4
- package/dist/components/tag-picker/tag-picker.svelte +137 -65
- package/dist/components/tag-picker/tag-picker.svelte.d.ts +2 -2
- package/dist/components/tag-picker/types.d.ts +36 -16
- package/dist/components/text-box/docs/llms.md +31 -4
- package/dist/components/text-box/text-box-button.svelte +3 -3
- package/dist/components/text-box/text-box-button.svelte.d.ts +1 -1
- package/dist/components/text-box/text-box.svelte +41 -14
- package/dist/components/text-box/types.d.ts +5 -5
- package/dist/components/textarea/docs/llms.md +4 -3
- package/dist/components/textarea/textarea.svelte +14 -6
- package/dist/components/textarea/types.d.ts +2 -4
- package/dist/components/time-picker/docs/llms.md +18 -15
- package/dist/components/time-picker/time-picker.svelte +133 -33
- package/dist/components/time-picker/time-picker.svelte.d.ts +1 -1
- package/dist/components/time-picker/types.d.ts +23 -13
- package/dist/components/title-bar/docs/llms.md +382 -0
- package/dist/components/title-bar/title-bar-left-controls.svelte +215 -0
- package/dist/components/title-bar/title-bar-left-controls.svelte.d.ts +22 -0
- package/dist/components/title-bar/title-bar-right-controls.svelte +190 -0
- package/dist/components/title-bar/title-bar-right-controls.svelte.d.ts +27 -0
- package/dist/components/title-bar/title-bar.d.ts +3 -0
- package/dist/components/title-bar/title-bar.js +4 -0
- package/dist/components/title-bar/title-bar.svelte +224 -0
- package/dist/components/title-bar/title-bar.svelte.d.ts +26 -0
- package/dist/components/title-bar/types.d.ts +165 -0
- package/dist/components/title-bar/types.js +1 -0
- package/dist/components/toggle-switch/docs/llms.md +11 -9
- package/dist/components/toggle-switch/toggle-switch.svelte +23 -14
- package/dist/components/toggle-switch/toggle-switch.svelte.d.ts +1 -1
- package/dist/components/toggle-switch/types.d.ts +12 -10
- package/dist/components/tooltip/docs/llms.md +1 -1
- package/dist/components/tooltip/tooltip.svelte +5 -4
- package/dist/components/tooltip/types.d.ts +1 -1
- package/dist/components/top-nav/docs/llms.md +1 -1
- package/dist/components/top-nav/top-nav-item.svelte +2 -2
- package/dist/components/top-nav/top-nav.svelte +2 -2
- package/dist/components/top-nav/types.d.ts +2 -2
- package/dist/components/tree-view/docs/llms.md +11 -11
- package/dist/components/tree-view/tree-view-item-content.svelte +3 -3
- package/dist/components/tree-view/tree-view-item.svelte +13 -5
- package/dist/components/tree-view/tree-view.svelte +20 -5
- package/dist/components/tree-view/tree-view.svelte.d.ts +1 -1
- package/dist/components/tree-view/tree-view.svelte.js +31 -3
- package/dist/components/tree-view/types.d.ts +7 -3
- package/dist/index.d.ts +18 -0
- package/dist/index.js +20 -0
- package/dist/internal/components/dynamic-carousel/dynamic-carousel.svelte +26 -5
- package/dist/internal/components/dynamic-carousel/dynamic-carousel.svelte.d.ts +2 -0
- package/dist/internal/index.d.ts +1 -0
- package/dist/internal/index.js +1 -0
- package/dist/internal/native-field.svelte.d.ts +44 -0
- package/dist/internal/native-field.svelte.js +85 -0
- package/dist/internal/utils.d.ts +16 -2
- package/dist/internal/utils.js +25 -3
- package/dist/types/index.d.ts +3 -3
- package/package.json +50 -36
|
@@ -135,7 +135,7 @@ Other components that can be used within the table include:
|
|
|
135
135
|
<TableRow>
|
|
136
136
|
<TableSelectionCell
|
|
137
137
|
checked={allSelected ? true : someSelected ? 'mixed' : false}
|
|
138
|
-
|
|
138
|
+
checkboxProps={{ 'aria-label': 'Select all rows' }}
|
|
139
139
|
onclick={() => (selected = allSelected ? [] : items.map((item) => item.file))}
|
|
140
140
|
/>
|
|
141
141
|
<TableHeaderCell>File</TableHeaderCell>
|
|
@@ -149,7 +149,7 @@ Other components that can be used within the table include:
|
|
|
149
149
|
appearance={isSelected ? 'brand' : 'none'}
|
|
150
150
|
onclick={() => toggleRow(item.file)}
|
|
151
151
|
>
|
|
152
|
-
<TableSelectionCell checked={isSelected}
|
|
152
|
+
<TableSelectionCell checked={isSelected} checkboxProps={{ 'aria-label': 'Select row' }} />
|
|
153
153
|
<TableCell>{item.file}</TableCell>
|
|
154
154
|
</TableRow>
|
|
155
155
|
{/each}
|
|
@@ -177,11 +177,7 @@ Set `type="radio"` on the selection cell when only one row can be selected at a
|
|
|
177
177
|
{#each items as item (item.file)}
|
|
178
178
|
{@const isPicked = picked === item.file}
|
|
179
179
|
<TableRow aria-selected={isPicked} appearance={isPicked ? 'brand' : 'none'} onclick={() => (picked = item.file)}>
|
|
180
|
-
<TableSelectionCell
|
|
181
|
-
type="radio"
|
|
182
|
-
checked={isPicked}
|
|
183
|
-
radioIndicator={{ name: 'file', 'aria-label': 'Select row' }}
|
|
184
|
-
/>
|
|
180
|
+
<TableSelectionCell type="radio" checked={isPicked} radioProps={{ name: 'file', 'aria-label': 'Select row' }} />
|
|
185
181
|
<TableCell>{item.file}</TableCell>
|
|
186
182
|
</TableRow>
|
|
187
183
|
{/each}
|
|
@@ -195,7 +191,7 @@ Set `type="radio"` on the selection cell when only one row can be selected at a
|
|
|
195
191
|
|
|
196
192
|
```svelte
|
|
197
193
|
<TableRow aria-selected={isSelected} appearance={isSelected ? 'brand' : 'none'} onclick={() => toggleSubtle(item.file)}>
|
|
198
|
-
<TableSelectionCell subtle checked={isSelected}
|
|
194
|
+
<TableSelectionCell subtle checked={isSelected} checkboxProps={{ 'aria-label': 'Select row' }} />
|
|
199
195
|
<TableCell>{item.file}</TableCell>
|
|
200
196
|
</TableRow>
|
|
201
197
|
```
|
|
@@ -356,6 +352,15 @@ The table renders whatever you put inside it, so any virtualization library work
|
|
|
356
352
|
import SvelteVirtualList from '@humanspeak/svelte-virtual-list';
|
|
357
353
|
|
|
358
354
|
const rows = Array.from({ length: 2000 }, (_, i) => ({ id: i, file: `Document ${i + 1}` }));
|
|
355
|
+
|
|
356
|
+
// The virtualizer names its viewport a region, which a rowgroup cannot hold between itself and its rows.
|
|
357
|
+
const presentational = (node) => {
|
|
358
|
+
const region = node.querySelector('[role="region"]');
|
|
359
|
+
region?.setAttribute('role', 'none');
|
|
360
|
+
// A name or a tab stop would keep the role. The rows are reached with the arrow keys of the table.
|
|
361
|
+
region?.removeAttribute('aria-label');
|
|
362
|
+
region?.removeAttribute('tabindex');
|
|
363
|
+
};
|
|
359
364
|
</script>
|
|
360
365
|
|
|
361
366
|
<Table noNativeElements style="min-width: 520px;" aria-label="Virtualized table" aria-rowcount={rows.length + 1}>
|
|
@@ -364,7 +369,7 @@ The table renders whatever you put inside it, so any virtualization library work
|
|
|
364
369
|
<TableHeaderCell>File</TableHeaderCell>
|
|
365
370
|
</TableRow>
|
|
366
371
|
</TableHeader>
|
|
367
|
-
<TableBody style="height: 320px;">
|
|
372
|
+
<TableBody style="height: 320px;" {@attach presentational}>
|
|
368
373
|
<SvelteVirtualList items={rows} defaultEstimatedItemHeight={44}>
|
|
369
374
|
{#snippet renderItem(row, index)}
|
|
370
375
|
<TableRow aria-rowindex={index + 2}>
|
|
@@ -487,17 +492,17 @@ The table renders whatever you put inside it, so any virtualization library work
|
|
|
487
492
|
<!-- DO NOT EDIT THIS SECTION (propsmith generated) -->
|
|
488
493
|
<!-- props:TableSelectionCellProps -->
|
|
489
494
|
|
|
490
|
-
| Name
|
|
491
|
-
|
|
|
492
|
-
| `as`
|
|
493
|
-
| `ref` _bindable_
|
|
494
|
-
| `type`
|
|
495
|
-
| `checked`
|
|
496
|
-
| `subtle`
|
|
497
|
-
| `invisible`
|
|
498
|
-
| `
|
|
499
|
-
| `
|
|
500
|
-
| HTML Attributes
|
|
495
|
+
| Name | Type | Default | Description |
|
|
496
|
+
| ---------------- | ---------------------------------------------- | ------------ | ------------------------------------------------------------------------------ |
|
|
497
|
+
| `as` | `'td'` | `'div'` | `'td'` | The HTML element to render the cell as. Inherited from the table by default. |
|
|
498
|
+
| `ref` _bindable_ | `HTMLTableCellElement` | `HTMLDivElement` | | The DOM reference of the cell element. |
|
|
499
|
+
| `type` | `'checkbox'` | `'radio'` | `'checkbox'` | A table can have two kinds of selection modes. |
|
|
500
|
+
| `checked` | `boolean` | `'mixed'` | `false` | Whether the row is selected. `'mixed'` renders the indeterminate state. |
|
|
501
|
+
| `subtle` | `boolean` | `false` | Only shows the indicator when it is checked, or the row is hovered or focused. |
|
|
502
|
+
| `invisible` | `boolean` | `false` | Hides the indicator while it keeps taking up the same space. |
|
|
503
|
+
| `checkboxProps` | `CheckboxProps` | | The props to spread on the checkbox rendered when `type` is `'checkbox'`. |
|
|
504
|
+
| `radioProps` | `RadioButtonProps` | | The props to spread on the radio button rendered when `type` is `'radio'`. |
|
|
505
|
+
| HTML Attributes | | | |
|
|
501
506
|
|
|
502
507
|
<!-- /props:TableSelectionCellProps -->
|
|
503
508
|
|
|
@@ -506,14 +511,14 @@ The table renders whatever you put inside it, so any virtualization library work
|
|
|
506
511
|
<!-- DO NOT EDIT THIS SECTION (propsmith generated) -->
|
|
507
512
|
<!-- props:TableCellLayoutProps -->
|
|
508
513
|
|
|
509
|
-
| Name | Type
|
|
510
|
-
| ---------------- |
|
|
511
|
-
| `ref` _bindable_ | `HTMLDivElement`
|
|
512
|
-
| `media` | `Snippet` | `Component`
|
|
513
|
-
| `description` | `string`
|
|
514
|
-
| `appearance` | `'primary'`
|
|
515
|
-
| `truncate` | `boolean`
|
|
516
|
-
| HTML Attributes |
|
|
514
|
+
| Name | Type | Default | Description |
|
|
515
|
+
| ---------------- | ------------------------------ | ------- | ------------------------------------------------------------------------------ |
|
|
516
|
+
| `ref` _bindable_ | `HTMLDivElement` | `null` | | The DOM reference of the layout element. |
|
|
517
|
+
| `media` | `Snippet` | `Component` | | An icon, an avatar or any other visual element placed before the main content. |
|
|
518
|
+
| `description` | `string` | | A second line of text that describes or complements the main content. |
|
|
519
|
+
| `appearance` | `'primary'` | | Emphasizes the cell by enlarging the media and bolding the main content. |
|
|
520
|
+
| `truncate` | `boolean` | | Clips the content with an ellipsis instead of letting it wrap. |
|
|
521
|
+
| HTML Attributes | | | |
|
|
517
522
|
|
|
518
523
|
<!-- /props:TableCellLayoutProps -->
|
|
519
524
|
|
|
@@ -522,10 +527,10 @@ The table renders whatever you put inside it, so any virtualization library work
|
|
|
522
527
|
<!-- DO NOT EDIT THIS SECTION (propsmith generated) -->
|
|
523
528
|
<!-- props:TableCellActionsProps -->
|
|
524
529
|
|
|
525
|
-
| Name | Type
|
|
526
|
-
| ---------------- |
|
|
527
|
-
| `ref` _bindable_ | `HTMLDivElement` | | The DOM reference of the actions element. |
|
|
528
|
-
| `visible` | `boolean`
|
|
529
|
-
| HTML Attributes |
|
|
530
|
+
| Name | Type | Default | Description |
|
|
531
|
+
| ---------------- | ------------------------------ | ------- | ------------------------------------------------------------------------------------ |
|
|
532
|
+
| `ref` _bindable_ | `HTMLDivElement` | `null` | | The DOM reference of the actions element. |
|
|
533
|
+
| `visible` | `boolean` | | Keeps the actions on screen instead of waiting for the row to be hovered or focused. |
|
|
534
|
+
| HTML Attributes | | | |
|
|
530
535
|
|
|
531
536
|
<!-- /props:TableCellActionsProps -->
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { getTag, requireTableContext } from './table.svelte.js';
|
|
3
3
|
import type { TableBodyProps, TableDOM } from './types.js';
|
|
4
4
|
|
|
5
|
-
let { as, ref = $bindable(), class: classes, children, ...attributes }: TableBodyProps<Tag> = $props();
|
|
5
|
+
let { as, ref = $bindable(null), class: classes, children, ...attributes }: TableBodyProps<Tag> = $props();
|
|
6
6
|
|
|
7
7
|
const context = requireTableContext();
|
|
8
8
|
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
|
|
14
14
|
<svelte:element
|
|
15
15
|
this={_as}
|
|
16
|
+
{...attributes}
|
|
16
17
|
bind:this={ref as TableDOM[Tag]}
|
|
17
18
|
role={_as === 'div' ? 'rowgroup' : undefined}
|
|
18
19
|
class={['fs-table-body', { flex: _as === 'div' }, classes]}
|
|
19
|
-
{...attributes}
|
|
20
20
|
>
|
|
21
21
|
{@render children?.()}
|
|
22
22
|
</svelte:element>
|
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
import { requireTableContext } from './table.svelte.js';
|
|
3
3
|
import type { TableCellActionsProps } from './types.js';
|
|
4
4
|
|
|
5
|
-
let {
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
visible = false,
|
|
8
|
+
class: classes,
|
|
9
|
+
children,
|
|
10
|
+
...attributes
|
|
11
|
+
}: TableCellActionsProps = $props();
|
|
6
12
|
|
|
7
13
|
requireTableContext();
|
|
8
14
|
</script>
|
|
@@ -21,7 +27,7 @@
|
|
|
21
27
|
</TableCell>
|
|
22
28
|
```
|
|
23
29
|
-->
|
|
24
|
-
<div bind:this={ref} class={['fs-table-cell-actions', { visible }, classes]}
|
|
30
|
+
<div {...attributes} bind:this={ref} class={['fs-table-cell-actions', { visible }, classes]}>
|
|
25
31
|
{@render children?.()}
|
|
26
32
|
</div>
|
|
27
33
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import type { TableCellLayoutProps } from './types.js';
|
|
4
4
|
|
|
5
5
|
let {
|
|
6
|
-
ref = $bindable(),
|
|
6
|
+
ref = $bindable(null),
|
|
7
7
|
media: Media,
|
|
8
8
|
description,
|
|
9
9
|
appearance,
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
</TableCell>
|
|
26
26
|
```
|
|
27
27
|
-->
|
|
28
|
-
<div bind:this={ref} class={['fs-table-cell-layout', appearance, { truncate }, classes]}
|
|
28
|
+
<div {...attributes} bind:this={ref} class={['fs-table-cell-layout', appearance, { truncate }, classes]}>
|
|
29
29
|
{#if Media}
|
|
30
30
|
<span class="media">
|
|
31
31
|
<RenderSoC SoC={Media} args={{ class: 'fs-table-cell-media' }} />
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
let {
|
|
6
6
|
as,
|
|
7
|
-
ref = $bindable(),
|
|
7
|
+
ref = $bindable(null),
|
|
8
8
|
focusMode = 'cell',
|
|
9
9
|
class: classes,
|
|
10
10
|
children,
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
|
|
37
37
|
<svelte:element
|
|
38
38
|
this={_as}
|
|
39
|
+
{...attributes}
|
|
39
40
|
bind:this={ref as TableDOM[Tag]}
|
|
40
41
|
role={enableTabspot ? 'gridcell' : _as === 'div' ? 'cell' : undefined}
|
|
41
42
|
data-fs-focus-mode={enableTabspot ? focusMode : undefined}
|
|
@@ -43,7 +44,6 @@
|
|
|
43
44
|
style:width={width === undefined ? undefined : `${width}px`}
|
|
44
45
|
{@attach enableTabspot || resizableColumns ? colIndex((i) => (index = i)) : undefined}
|
|
45
46
|
{@attach enableTabspot && focusMode === 'group' ? focusGroup : undefined}
|
|
46
|
-
{...attributes}
|
|
47
47
|
>
|
|
48
48
|
{@render children?.()}
|
|
49
49
|
</svelte:element>
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
let {
|
|
9
9
|
as,
|
|
10
|
-
ref = $bindable(),
|
|
10
|
+
ref = $bindable(null),
|
|
11
11
|
sortable,
|
|
12
12
|
sortDirection,
|
|
13
13
|
sortIcon,
|
|
@@ -87,6 +87,7 @@
|
|
|
87
87
|
|
|
88
88
|
<svelte:element
|
|
89
89
|
this={_as}
|
|
90
|
+
{...attributes}
|
|
90
91
|
bind:this={ref as TableDOM[Tag]}
|
|
91
92
|
role={_as === 'div' ? 'columnheader' : undefined}
|
|
92
93
|
scope={_as === 'th' ? 'col' : undefined}
|
|
@@ -96,7 +97,6 @@
|
|
|
96
97
|
style:width={width === undefined ? undefined : `${width}px`}
|
|
97
98
|
{@attach enableTabspot || _resizable ? colIndex((i) => (index = i)) : undefined}
|
|
98
99
|
{@attach enableTabspot && _focusMode === 'group' ? focusGroup : undefined}
|
|
99
|
-
{...attributes}
|
|
100
100
|
>
|
|
101
101
|
<span class="inner">
|
|
102
102
|
{#if _sortable}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { getTag, requireTableContext } from './table.svelte.js';
|
|
3
3
|
import type { TableDOM, TableHeaderProps } from './types.js';
|
|
4
4
|
|
|
5
|
-
let { as, ref = $bindable(), class: classes, children, ...attributes }: TableHeaderProps<Tag> = $props();
|
|
5
|
+
let { as, ref = $bindable(null), class: classes, children, ...attributes }: TableHeaderProps<Tag> = $props();
|
|
6
6
|
|
|
7
7
|
const context = requireTableContext();
|
|
8
8
|
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
|
|
14
14
|
<svelte:element
|
|
15
15
|
this={_as}
|
|
16
|
+
{...attributes}
|
|
16
17
|
bind:this={ref as TableDOM[Tag]}
|
|
17
18
|
role={_as === 'div' ? 'rowgroup' : undefined}
|
|
18
19
|
class={['fs-table-header', classes]}
|
|
19
|
-
{...attributes}
|
|
20
20
|
>
|
|
21
21
|
{@render children?.()}
|
|
22
22
|
</svelte:element>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
let {
|
|
6
6
|
as,
|
|
7
|
-
ref = $bindable(),
|
|
7
|
+
ref = $bindable(null),
|
|
8
8
|
appearance = 'none',
|
|
9
9
|
class: classes,
|
|
10
10
|
onclick,
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
|
|
22
22
|
<svelte:element
|
|
23
23
|
this={_as}
|
|
24
|
+
{...attributes}
|
|
24
25
|
bind:this={ref as TableDOM[Tag]}
|
|
25
26
|
role={_as === 'div' ? 'row' : undefined}
|
|
26
27
|
class={['fs-table-row', appearance, { flex: _as === 'div' }, classes]}
|
|
27
28
|
{@attach onclick ? selectOnSpace : undefined}
|
|
28
29
|
{onclick}
|
|
29
|
-
{...attributes}
|
|
30
30
|
>
|
|
31
31
|
{@render children?.()}
|
|
32
32
|
</svelte:element>
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
|
|
7
7
|
let {
|
|
8
8
|
as,
|
|
9
|
-
ref = $bindable(),
|
|
9
|
+
ref = $bindable(null),
|
|
10
10
|
type = 'checkbox',
|
|
11
11
|
checked = false,
|
|
12
12
|
subtle = false,
|
|
13
13
|
invisible = false,
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
checkboxProps,
|
|
15
|
+
radioProps,
|
|
16
16
|
class: classes,
|
|
17
17
|
onclick,
|
|
18
18
|
...attributes
|
|
@@ -30,22 +30,22 @@
|
|
|
30
30
|
|
|
31
31
|
<svelte:element
|
|
32
32
|
this={_as}
|
|
33
|
+
{...attributes}
|
|
33
34
|
bind:this={ref as TableDOM[Tag]}
|
|
34
35
|
role={enableTabspot ? 'gridcell' : _as === 'div' ? 'cell' : undefined}
|
|
35
36
|
class={['fs-table-selection-cell', { flex: _as === 'div', subtle, invisible, checked: !!checked }, classes]}
|
|
36
37
|
{@attach enableTabspot ? colIndex() : undefined}
|
|
37
38
|
{@attach onclick ? selectOnSpace : undefined}
|
|
38
39
|
{onclick}
|
|
39
|
-
{...attributes}
|
|
40
40
|
>
|
|
41
41
|
<!--
|
|
42
42
|
The indicator answers the pointer itself, and the click still reaches the row underneath, so
|
|
43
43
|
hitting it selects the row rather than only ticking a box the consumer never hears about.
|
|
44
44
|
-->
|
|
45
45
|
{#if type === 'radio'}
|
|
46
|
-
<RadioButton checked={checked === true}
|
|
46
|
+
<RadioButton {...radioProps} checked={checked === true} />
|
|
47
47
|
{:else}
|
|
48
|
-
<Checkbox
|
|
48
|
+
<Checkbox {...checkboxProps} checked={checked === true} indeterminate={checked === 'mixed'} />
|
|
49
49
|
{/if}
|
|
50
50
|
</svelte:element>
|
|
51
51
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
let {
|
|
8
8
|
as,
|
|
9
|
-
ref = $bindable(),
|
|
9
|
+
ref = $bindable(null),
|
|
10
10
|
size = 'medium',
|
|
11
11
|
noNativeElements = false,
|
|
12
12
|
sortable = false,
|
|
@@ -131,6 +131,7 @@
|
|
|
131
131
|
-->
|
|
132
132
|
<svelte:element
|
|
133
133
|
this={_as}
|
|
134
|
+
{...attributes}
|
|
134
135
|
bind:this={ref as TableDOM[Tag]}
|
|
135
136
|
role={enableTabspot ? 'grid' : _as === 'div' ? 'table' : undefined}
|
|
136
137
|
class={[
|
|
@@ -140,7 +141,6 @@
|
|
|
140
141
|
classes
|
|
141
142
|
]}
|
|
142
143
|
{...tabspotAttributes}
|
|
143
|
-
{...attributes}
|
|
144
144
|
>
|
|
145
145
|
{@render children?.()}
|
|
146
146
|
</svelte:element>
|
|
@@ -28,7 +28,7 @@ export type TableProps<Tag extends 'table' | 'div' = 'table'> = {
|
|
|
28
28
|
* @type HTMLTableElement | HTMLDivElement
|
|
29
29
|
* @bindable
|
|
30
30
|
*/
|
|
31
|
-
ref?: TableDOM[Tag] | HTMLDivElement;
|
|
31
|
+
ref?: TableDOM[Tag] | HTMLDivElement | null;
|
|
32
32
|
/** Affects the sizes of all table subcomponents.
|
|
33
33
|
* @default 'medium'
|
|
34
34
|
*/
|
|
@@ -102,7 +102,7 @@ export type TableHeaderProps<Tag extends 'thead' | 'div' = 'thead'> = {
|
|
|
102
102
|
* @type HTMLTableSectionElement | HTMLDivElement
|
|
103
103
|
* @bindable
|
|
104
104
|
*/
|
|
105
|
-
ref?: TableDOM[Tag] | HTMLDivElement;
|
|
105
|
+
ref?: TableDOM[Tag] | HTMLDivElement | null;
|
|
106
106
|
} & PolymorphicProps<Tag>;
|
|
107
107
|
/** @propsmith TableHeaderCellProps */
|
|
108
108
|
export type TableHeaderCellProps<Tag extends 'th' | 'div' = 'th'> = {
|
|
@@ -115,7 +115,7 @@ export type TableHeaderCellProps<Tag extends 'th' | 'div' = 'th'> = {
|
|
|
115
115
|
* @type HTMLTableCellElement | HTMLDivElement
|
|
116
116
|
* @bindable
|
|
117
117
|
*/
|
|
118
|
-
ref?: TableDOM[Tag] | HTMLDivElement;
|
|
118
|
+
ref?: TableDOM[Tag] | HTMLDivElement | null;
|
|
119
119
|
/** Whether the column is sortable. Inherited from the table by default. */
|
|
120
120
|
sortable?: boolean;
|
|
121
121
|
/** The direction the column is currently sorted in. Also sets `aria-sort`. */
|
|
@@ -162,7 +162,7 @@ export type TableBodyProps<Tag extends 'tbody' | 'div' = 'tbody'> = {
|
|
|
162
162
|
* @type HTMLTableSectionElement | HTMLDivElement
|
|
163
163
|
* @bindable
|
|
164
164
|
*/
|
|
165
|
-
ref?: TableDOM[Tag] | HTMLDivElement;
|
|
165
|
+
ref?: TableDOM[Tag] | HTMLDivElement | null;
|
|
166
166
|
} & PolymorphicProps<Tag>;
|
|
167
167
|
/** @propsmith TableRowProps */
|
|
168
168
|
export type TableRowProps<Tag extends 'tr' | 'div' = 'tr'> = {
|
|
@@ -175,7 +175,7 @@ export type TableRowProps<Tag extends 'tr' | 'div' = 'tr'> = {
|
|
|
175
175
|
* @type HTMLTableRowElement | HTMLDivElement
|
|
176
176
|
* @bindable
|
|
177
177
|
*/
|
|
178
|
-
ref?: TableDOM[Tag] | HTMLDivElement;
|
|
178
|
+
ref?: TableDOM[Tag] | HTMLDivElement | null;
|
|
179
179
|
/** How the row is filled. Intended to mark a selected row.
|
|
180
180
|
* @default 'none'
|
|
181
181
|
*/
|
|
@@ -192,7 +192,7 @@ export type TableCellProps<Tag extends 'td' | 'div' = 'td'> = {
|
|
|
192
192
|
* @type HTMLTableCellElement | HTMLDivElement
|
|
193
193
|
* @bindable
|
|
194
194
|
*/
|
|
195
|
-
ref?: TableDOM[Tag] | HTMLDivElement;
|
|
195
|
+
ref?: TableDOM[Tag] | HTMLDivElement | null;
|
|
196
196
|
/** How the arrow keys treat the cell. `'group'` holds the focusable content of the cell out of
|
|
197
197
|
* the tab order until `Enter` steps in, and `Escape` steps back out. `'none'` skips the cell
|
|
198
198
|
* altogether. Only read when the table sets `enableTabspot`.
|
|
@@ -211,7 +211,7 @@ export type TableSelectionCellProps<Tag extends 'td' | 'div' = 'td'> = {
|
|
|
211
211
|
* @type HTMLTableCellElement | HTMLDivElement
|
|
212
212
|
* @bindable
|
|
213
213
|
*/
|
|
214
|
-
ref?: TableDOM[Tag] | HTMLDivElement;
|
|
214
|
+
ref?: TableDOM[Tag] | HTMLDivElement | null;
|
|
215
215
|
/** A table can have two kinds of selection modes.
|
|
216
216
|
* @default 'checkbox'
|
|
217
217
|
*/
|
|
@@ -232,18 +232,18 @@ export type TableSelectionCellProps<Tag extends 'td' | 'div' = 'td'> = {
|
|
|
232
232
|
/** The props to spread on the checkbox rendered when `type` is `'checkbox'`.
|
|
233
233
|
* @type CheckboxProps
|
|
234
234
|
*/
|
|
235
|
-
|
|
235
|
+
checkboxProps?: Omit<CheckboxProps, 'checked' | 'indeterminate' | 'children'>;
|
|
236
236
|
/** The props to spread on the radio button rendered when `type` is `'radio'`.
|
|
237
237
|
* @type RadioButtonProps
|
|
238
238
|
*/
|
|
239
|
-
|
|
239
|
+
radioProps?: Omit<RadioButtonProps, 'checked' | 'group'>;
|
|
240
240
|
} & PolymorphicProps<Tag>;
|
|
241
241
|
/** @propsmith TableCellLayoutProps */
|
|
242
242
|
export type TableCellLayoutProps = {
|
|
243
243
|
/** The DOM reference of the layout element.
|
|
244
244
|
* @bindable
|
|
245
245
|
*/
|
|
246
|
-
ref?: HTMLDivElement;
|
|
246
|
+
ref?: HTMLDivElement | null;
|
|
247
247
|
/** An icon, an avatar or any other visual element placed before the main content.
|
|
248
248
|
* @type Snippet | Component
|
|
249
249
|
*/
|
|
@@ -264,7 +264,7 @@ export type TableCellActionsProps = {
|
|
|
264
264
|
/** The DOM reference of the actions element.
|
|
265
265
|
* @bindable
|
|
266
266
|
*/
|
|
267
|
-
ref?: HTMLDivElement;
|
|
267
|
+
ref?: HTMLDivElement | null;
|
|
268
268
|
/** Keeps the actions on screen instead of waiting for the row to be hovered or focused. */
|
|
269
269
|
visible?: boolean;
|
|
270
270
|
} & PolymorphicProps<'div'>;
|
|
@@ -79,7 +79,7 @@ Tell screen readers about the dismiss action. Either let the dismiss icon name t
|
|
|
79
79
|
|
|
80
80
|
### Interactive (primary action)
|
|
81
81
|
|
|
82
|
-
An interactive tag has a primary action (`onclick`) and, when it is dismissible, a secondary one that dismisses it. The dismiss button is named after both buttons, "Primary text Dismiss", through `aria-labelledby`. Use `
|
|
82
|
+
An interactive tag has a primary action (`onclick`) and, when it is dismissible, a secondary one that dismisses it. The dismiss button is named after both buttons, "Primary text Dismiss", through `aria-labelledby`. Use `primaryButtonAttributes` and `dismissButtonAttributes` to reach the buttons: a custom `id` on the primary button is followed by the dismiss button, and `aria-label` together with `aria-labelledby: undefined` gives the dismiss button a name that stands on its own.
|
|
83
83
|
|
|
84
84
|
```svelte
|
|
85
85
|
<script>
|
|
@@ -88,7 +88,7 @@ An interactive tag has a primary action (`onclick`) and, when it is dismissible,
|
|
|
88
88
|
|
|
89
89
|
<Tag interactive dismissible onclick={() => clicks++}>Clicked {clicks} times</Tag>
|
|
90
90
|
<Tag interactive>Without dismiss</Tag>
|
|
91
|
-
<Tag interactive dismissible
|
|
91
|
+
<Tag interactive dismissible dismissButtonAttributes={{ 'aria-label': 'Remove Tag', 'aria-labelledby': undefined }}>
|
|
92
92
|
Own accessible name
|
|
93
93
|
</Tag>
|
|
94
94
|
<Button disabled={clicks === 0} onclick={() => (clicks = 0)}>Reset the example</Button>
|
|
@@ -185,29 +185,29 @@ A tag supports `medium`, `small` and `extra-small` sizes. The default is `medium
|
|
|
185
185
|
<!-- DO NOT EDIT THIS SECTION (propsmith generated) -->
|
|
186
186
|
<!-- props:TagProps -->
|
|
187
187
|
|
|
188
|
-
| Name
|
|
189
|
-
|
|
|
190
|
-
| `appearance`
|
|
191
|
-
| `size`
|
|
192
|
-
| `shape`
|
|
193
|
-
| `disabled`
|
|
194
|
-
| `selected`
|
|
195
|
-
| `dismissible`
|
|
196
|
-
| `interactive`
|
|
197
|
-
| `value`
|
|
198
|
-
| `icon`
|
|
199
|
-
| `media`
|
|
200
|
-
| `secondaryText`
|
|
201
|
-
| `dismissIcon`
|
|
202
|
-
| `dismissLabel`
|
|
203
|
-
| `onDismiss`
|
|
204
|
-
| `onclick`
|
|
205
|
-
| `onkeydown`
|
|
206
|
-
| `
|
|
207
|
-
| `
|
|
208
|
-
| `children`
|
|
209
|
-
| `ref` _bindable_
|
|
210
|
-
| HTML Attributes
|
|
188
|
+
| Name | Type | Default | Description |
|
|
189
|
+
| ------------------------- | --------------------------------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
190
|
+
| `appearance` | `'filled'` | `'outline'` | `'brand'` | `'filled'` | The tag can have a filled, outlined or brand appearance. Falls back to the `appearance` of the `TagGroup` it is in. |
|
|
191
|
+
| `size` | `'extra-small'` | `'small'` | `'medium'` | `'medium'` | The tag comes in three sizes. Falls back to the `size` of the `TagGroup` it is in. |
|
|
192
|
+
| `shape` | `'circular'` | `'rounded'` | `'square'` | `'circular'` | The tag can have a circular, rounded or square shape. |
|
|
193
|
+
| `disabled` | `boolean` | `false` | Shows that the tag cannot be interacted with. A tag inside a disabled `TagGroup` is disabled too. |
|
|
194
|
+
| `selected` | `boolean` | `false` | Paints the tag as selected. Inside a `TagGroup` an interactive tag takes its selected state from the `selectedValues` of the group instead. |
|
|
195
|
+
| `dismissible` | `boolean` | `false` | Shows a dismiss icon and lets the tag be dismissed. Falls back to the `dismissible` of the `TagGroup` it is in. A tag that is not interactive becomes a single button: activating it, or pressing Delete or Backspace on it, dismisses it. |
|
|
196
|
+
| `interactive` | `boolean` | `false` | Renders the tag as an interaction tag: a primary button that carries the action, followed, when the tag is dismissible, by a separate dismiss button. Use it for a tag that has a primary action, and a plain tag for one that does not. |
|
|
197
|
+
| `value` | `string` | | Identifies the tag inside a `TagGroup`. It is what `onDismiss` and `onTagSelect` report. Falls back to a generated id. |
|
|
198
|
+
| `icon` | `Snippet` | `Component` | | An icon rendered before the text. Do not use it together with `media`. |
|
|
199
|
+
| `media` | `Snippet` | `Component` | | A visual element rendered before the text, usually an `Avatar`. Do not use it together with `icon`. |
|
|
200
|
+
| `secondaryText` | `string` | `Snippet` | | A second line of text that describes or complements the main text. |
|
|
201
|
+
| `dismissIcon` | `Snippet` | `Component` | `DismissRegular` | The icon of the dismiss control. |
|
|
202
|
+
| `dismissLabel` | `string` | `'Dismiss'` | The accessible name of the dismiss control. When the tag is named through `aria-label` or `aria-labelledby` instead, the dismiss icon is hidden from assistive technologies. |
|
|
203
|
+
| `onDismiss` | `(e: MouseEvent` | `KeyboardEvent, value: string) => void` | | Called when the tag is dismissed. The consumer owns the data: the tag does not remove itself. |
|
|
204
|
+
| `onclick` | `(e: MouseEvent) => void` | | Called when the tag is activated. On an interactive tag it is the click of the primary button. |
|
|
205
|
+
| `onkeydown` | `(e: KeyboardEvent) => void` | | Called when a key is pressed on the tag. |
|
|
206
|
+
| `primaryButtonAttributes` | `HTMLButtonAttributes` | | Attributes for the primary button of an interactive tag, for example `aria-haspopup`. If you give it a custom `id`, the dismiss button is named after it. |
|
|
207
|
+
| `dismissButtonAttributes` | `HTMLButtonAttributes` | | Attributes for the dismiss button of an interactive tag. Use `aria-label` together with `aria-labelledby: undefined` to give the button a name that stands on its own. |
|
|
208
|
+
| `children` | `Snippet` | | The primary text of the tag. |
|
|
209
|
+
| `ref` _bindable_ | `HTMLElement` | `null` | | The DOM reference of the tag element. |
|
|
210
|
+
| HTML Attributes | | | |
|
|
211
211
|
|
|
212
212
|
<!-- /props:TagProps -->
|
|
213
213
|
|
|
@@ -377,7 +377,7 @@ A group can set the default size of all its tags. It supports `medium`, `small`
|
|
|
377
377
|
| `onDismiss` | `(e: MouseEvent` | `KeyboardEvent, data: { value: string }) => void` | | Called when a tag of the group is dismissed. The consumer owns the data: the group does not remove the tag. |
|
|
378
378
|
| `role` | `HTMLAttributes<HTMLDivElement>['role']` | `'toolbar'` | The role of the group. Use `list` together with `role="listitem"` on each tag when none of them is actionable. |
|
|
379
379
|
| `children` | `Snippet` | | The tags of the group. |
|
|
380
|
-
| `ref` _bindable_ | `HTMLDivElement`
|
|
380
|
+
| `ref` _bindable_ | `HTMLDivElement` | `null` | | The DOM reference of the group element. |
|
|
381
381
|
| HTML Attributes | | | |
|
|
382
382
|
|
|
383
383
|
<!-- /props:TagGroupProps -->
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
onDismiss,
|
|
16
16
|
role = 'toolbar',
|
|
17
17
|
class: classes,
|
|
18
|
-
ref = $bindable(),
|
|
18
|
+
ref = $bindable(null),
|
|
19
19
|
children,
|
|
20
20
|
...attributes
|
|
21
21
|
}: TagGroupProps = $props();
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
</TagGroup>
|
|
98
98
|
```
|
|
99
99
|
-->
|
|
100
|
-
<div bind:this={ref} class={['fs-tag-group', size ?? 'medium', classes]} {role} {...tabspotAttrs}
|
|
100
|
+
<div {...attributes} bind:this={ref} class={['fs-tag-group', size ?? 'medium', classes]} {role} {...tabspotAttrs}>
|
|
101
101
|
{@render children?.()}
|
|
102
102
|
</div>
|
|
103
103
|
|