fluentui-svelte 0.5.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 +17 -2
- package/dist/components/dialog/dialog-content.svelte +2 -2
- package/dist/components/dialog/dialog-content.svelte.d.ts +1 -1
- package/dist/components/dialog/dialog-surface.svelte +130 -8
- package/dist/components/dialog/dialog-title.svelte +23 -6
- package/dist/components/dialog/dialog-trigger.svelte +8 -2
- package/dist/components/dialog/dialog-trigger.svelte.d.ts +1 -1
- package/dist/components/dialog/dialog.svelte +22 -11
- package/dist/components/dialog/docs/llms.md +56 -19
- package/dist/components/dialog/types.d.ts +31 -9
- package/dist/components/dialog/utils.d.ts +2 -0
- package/dist/components/dialog/utils.js +1 -0
- 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 +111 -0
- package/dist/components/rating/rating.svelte +247 -0
- package/dist/components/rating/rating.svelte.d.ts +19 -0
- package/dist/components/rating/types.d.ts +44 -0
- package/dist/components/rating/types.js +1 -0
- 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 +383 -0
- package/dist/components/tag/tag-group.d.ts +2 -0
- package/dist/components/tag/tag-group.js +2 -0
- package/dist/components/tag/tag-group.svelte +117 -0
- package/dist/components/tag/tag-group.svelte.d.ts +20 -0
- package/dist/components/tag/tag.svelte +459 -0
- package/dist/components/tag/tag.svelte.d.ts +19 -0
- package/dist/components/tag/types.d.ts +137 -0
- package/dist/components/tag/types.js +1 -0
- package/dist/components/tag-picker/docs/llms.md +298 -0
- package/dist/components/tag-picker/option-group.svelte +51 -0
- package/dist/components/tag-picker/option-group.svelte.d.ts +4 -0
- package/dist/components/tag-picker/option.svelte +82 -0
- package/dist/components/tag-picker/option.svelte.d.ts +4 -0
- package/dist/components/tag-picker/tag-picker.d.ts +2 -0
- package/dist/components/tag-picker/tag-picker.js +2 -0
- package/dist/components/tag-picker/tag-picker.svelte +716 -0
- package/dist/components/tag-picker/tag-picker.svelte.d.ts +21 -0
- package/dist/components/tag-picker/types.d.ts +142 -0
- package/dist/components/tag-picker/types.js +1 -0
- 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 +25 -0
- package/dist/index.js +32 -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/constants.d.ts +0 -4
- package/dist/internal/constants.js +0 -4002
- 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 +51 -37
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
const ID = $props.id();
|
|
8
8
|
|
|
9
9
|
let {
|
|
10
|
-
ref = $bindable(),
|
|
10
|
+
ref = $bindable(null),
|
|
11
11
|
value = `${COMPONENT_NAME}-${ID}`,
|
|
12
12
|
icon,
|
|
13
13
|
closable,
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
* That costs the keys a button would have answered on its own, so they are handled here:
|
|
38
38
|
* `Enter`/`Space` select, and `Delete` closes — the tabs pattern reserves it for exactly that.
|
|
39
39
|
*
|
|
40
|
-
* The close button is
|
|
41
|
-
*
|
|
42
|
-
*
|
|
40
|
+
* The close button is for the pointer only: a tab cannot hold a control of its own, so it is
|
|
41
|
+
* hidden from assistive technology and out of the tab order. `Delete` is what closes the tab
|
|
42
|
+
* from the keyboard, and `aria-keyshortcuts` announces it.
|
|
43
43
|
*/
|
|
44
44
|
const onTabKeydown = (event: KeyboardEvent) => {
|
|
45
45
|
// A key spent inside the close button is already answered; only the tab itself speaks here.
|
|
@@ -73,16 +73,17 @@
|
|
|
73
73
|
```
|
|
74
74
|
-->
|
|
75
75
|
<div
|
|
76
|
+
{...attributes}
|
|
76
77
|
bind:this={ref}
|
|
77
78
|
role="tab"
|
|
78
79
|
tabindex={disabled ? -1 : 0}
|
|
79
80
|
data-value={value}
|
|
80
81
|
aria-selected={active}
|
|
81
82
|
aria-disabled={disabled || undefined}
|
|
83
|
+
aria-keyshortcuts={_closable ? 'Delete' : undefined}
|
|
82
84
|
class={['fs-tab-view-tab', context.config.tabWidthMode, { active, disabled }, classes]}
|
|
83
85
|
onclick={(e: MouseEvent) => invokeHandlers(e, disabled, [() => context.methods.setActiveTab(e, value), onclick])}
|
|
84
86
|
onkeydown={(e: KeyboardEvent) => invokeHandlers(e, disabled, [onTabKeydown, onkeydown])}
|
|
85
|
-
{...attributes}
|
|
86
87
|
>
|
|
87
88
|
{#if icon}
|
|
88
89
|
<span class="fs-tab-view-tab-icon">
|
|
@@ -91,20 +92,17 @@
|
|
|
91
92
|
{/if}
|
|
92
93
|
<span class="fs-tab-view-tab-label">{@render children?.()}</span>
|
|
93
94
|
{#if _closable}
|
|
94
|
-
<
|
|
95
|
-
type="button"
|
|
95
|
+
<span
|
|
96
96
|
class="fs-tab-view-tab-close"
|
|
97
|
-
aria-
|
|
98
|
-
tabindex={-1}
|
|
99
|
-
{disabled}
|
|
97
|
+
aria-hidden="true"
|
|
100
98
|
onclick={(e: MouseEvent) => {
|
|
101
99
|
// The tab underneath would otherwise read the click as "select me".
|
|
102
100
|
e.stopPropagation();
|
|
103
|
-
close(e);
|
|
101
|
+
if (!disabled) close(e);
|
|
104
102
|
}}
|
|
105
103
|
>
|
|
106
104
|
<DismissRegular />
|
|
107
|
-
</
|
|
105
|
+
</span>
|
|
108
106
|
{/if}
|
|
109
107
|
{#if active}
|
|
110
108
|
<!--
|
|
@@ -223,6 +221,10 @@
|
|
|
223
221
|
}
|
|
224
222
|
& .fs-tab-view-tab-close {
|
|
225
223
|
cursor: not-allowed;
|
|
224
|
+
&:hover,
|
|
225
|
+
&:active {
|
|
226
|
+
background: transparent;
|
|
227
|
+
}
|
|
226
228
|
}
|
|
227
229
|
}
|
|
228
230
|
/* Share the strip evenly, within the width a document tab is worth. */
|
|
@@ -274,10 +276,10 @@
|
|
|
274
276
|
background: transparent;
|
|
275
277
|
color: inherit;
|
|
276
278
|
cursor: pointer;
|
|
277
|
-
&:hover
|
|
279
|
+
&:hover {
|
|
278
280
|
background: var(--fs-subtle-fill-secondary);
|
|
279
281
|
}
|
|
280
|
-
&:active
|
|
282
|
+
&:active {
|
|
281
283
|
background: var(--fs-subtle-fill-tertiary);
|
|
282
284
|
}
|
|
283
285
|
& :global(svg) {
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { invokeHandlers } from '../../internal/index.js';
|
|
2
3
|
import { getTabspotAttributes } from 'tabspot';
|
|
3
4
|
import AddRegular from 'fluentui-icons-svelte/AddRegular.svelte';
|
|
4
5
|
import { setTabViewContext, TABSPOT_ITEMS, TABSPOT_SKIP } from './tab-view.svelte.js';
|
|
5
6
|
import type { TabViewContext, TabViewProps } from './types.js';
|
|
6
7
|
|
|
7
8
|
let {
|
|
8
|
-
ref = $bindable(),
|
|
9
|
-
listRef = $bindable(),
|
|
10
|
-
|
|
9
|
+
ref = $bindable(null),
|
|
10
|
+
listRef = $bindable(null),
|
|
11
|
+
listAttributes,
|
|
11
12
|
activeTab = $bindable(''),
|
|
12
13
|
onTabChange,
|
|
13
14
|
closable = false,
|
|
14
15
|
onTabClose,
|
|
15
16
|
showNewTabButton = false,
|
|
16
17
|
onNewTab,
|
|
17
|
-
|
|
18
|
+
newTabButtonAttributes,
|
|
18
19
|
tabWidthMode = 'equal',
|
|
19
20
|
disableTabspot = false,
|
|
20
21
|
class: classes,
|
|
@@ -90,17 +91,23 @@
|
|
|
90
91
|
{/if}
|
|
91
92
|
```
|
|
92
93
|
-->
|
|
93
|
-
<div bind:this={ref} class={['fs-tab-view', classes]}
|
|
94
|
-
<div
|
|
94
|
+
<div {...attributes} bind:this={ref} class={['fs-tab-view', classes]}>
|
|
95
|
+
<div
|
|
96
|
+
{...listAttributes}
|
|
97
|
+
bind:this={listRef}
|
|
98
|
+
role="tablist"
|
|
99
|
+
class={['fs-tab-view-list', listAttributes?.class]}
|
|
100
|
+
{...tabspotAttributes}
|
|
101
|
+
>
|
|
95
102
|
{@render children?.()}
|
|
96
103
|
</div>
|
|
97
104
|
{#if showNewTabButton}
|
|
98
105
|
<button
|
|
106
|
+
{...newTabButtonAttributes}
|
|
99
107
|
type="button"
|
|
100
|
-
class=
|
|
108
|
+
class={['fs-tab-view-new-tab', newTabButtonAttributes?.class]}
|
|
101
109
|
aria-label="Add new tab"
|
|
102
|
-
onclick={(e: MouseEvent) => onNewTab?.
|
|
103
|
-
{...newTabButtonProps}
|
|
110
|
+
onclick={(e: MouseEvent) => invokeHandlers(e, [], [onNewTab, newTabButtonAttributes?.onclick])}
|
|
104
111
|
>
|
|
105
112
|
<AddRegular />
|
|
106
113
|
</button>
|
|
@@ -17,15 +17,15 @@ export type TabViewProps = {
|
|
|
17
17
|
/** The DOM reference of the element wrapping the strip.
|
|
18
18
|
* @bindable
|
|
19
19
|
*/
|
|
20
|
-
ref?: HTMLDivElement;
|
|
20
|
+
ref?: HTMLDivElement | null;
|
|
21
21
|
/** The DOM reference of the tab list.
|
|
22
22
|
* @bindable
|
|
23
23
|
*/
|
|
24
|
-
listRef?: HTMLDivElement;
|
|
25
|
-
/** The
|
|
24
|
+
listRef?: HTMLDivElement | null;
|
|
25
|
+
/** The Attributes to spread on the tab list element, where the `tablist` role and its label belong.
|
|
26
26
|
* @type HTMLAttributes
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
listAttributes?: HTMLAttributes<HTMLDivElement>;
|
|
29
29
|
/** The value of the selected tab.
|
|
30
30
|
* @bindable
|
|
31
31
|
*/
|
|
@@ -47,7 +47,7 @@ export type TabViewProps = {
|
|
|
47
47
|
/** The props to spread on the new tab button.
|
|
48
48
|
* @type HTMLButtonAttributes
|
|
49
49
|
*/
|
|
50
|
-
|
|
50
|
+
newTabButtonAttributes?: HTMLButtonAttributes;
|
|
51
51
|
/** How the tabs take their width: sharing the strip evenly, sizing to their own content, or
|
|
52
52
|
* shrinking to the icon of every tab but the selected one.
|
|
53
53
|
* @default 'equal'
|
|
@@ -63,7 +63,7 @@ export type TabViewTabProps = {
|
|
|
63
63
|
/** The DOM reference of the tab element.
|
|
64
64
|
* @bindable
|
|
65
65
|
*/
|
|
66
|
-
ref?: HTMLDivElement;
|
|
66
|
+
ref?: HTMLDivElement | null;
|
|
67
67
|
/** The value that identifies the tab. Defaults to a generated id. */
|
|
68
68
|
value?: string;
|
|
69
69
|
/** The icon to display before the label.
|
|
@@ -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'>;
|