@fusion.dev/helix-headless 0.0.0-dev → 0.0.2
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/custom-elements.json +4513 -4483
- package/dist/accordion/item/accordion-item.d.ts +13 -15
- package/dist/accordion/item/accordion-item.js +15 -17
- package/dist/announcement/root/announcement-root.d.ts +7 -25
- package/dist/announcement/root/announcement-root.js +7 -20
- package/dist/app-header/root/app-header-root.d.ts +10 -17
- package/dist/app-header/root/app-header-root.js +9 -18
- package/dist/avatar/group/avatar-group.d.ts +10 -19
- package/dist/avatar/group/avatar-group.js +12 -17
- package/dist/avatar/root/avatar-root.d.ts +8 -8
- package/dist/avatar/root/avatar-root.js +19 -20
- package/dist/badge/root/badge-root.d.ts +6 -6
- package/dist/badge/root/badge-root.js +13 -13
- package/dist/bar-chart/root/bar-chart-root.d.ts +21 -29
- package/dist/bar-chart/root/bar-chart-root.js +42 -57
- package/dist/breadcrumbs/breadcrumb/breadcrumb.d.ts +12 -18
- package/dist/breadcrumbs/breadcrumb/breadcrumb.js +13 -16
- package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +9 -28
- package/dist/breadcrumbs/root/breadcrumbs-root.js +9 -28
- package/dist/button/root/button-root.d.ts +84 -94
- package/dist/button/root/button-root.js +82 -92
- package/dist/callout/root/callout-root.d.ts +4 -5
- package/dist/carousel/root/carousel-root.d.ts +59 -71
- package/dist/carousel/root/carousel-root.js +73 -101
- package/dist/chat/composer/chat-composer.d.ts +29 -33
- package/dist/chat/composer/chat-composer.js +40 -44
- package/dist/chat/message/chat-message.d.ts +25 -25
- package/dist/chat/message/chat-message.js +26 -26
- package/dist/chat/root/chat-root.d.ts +28 -41
- package/dist/chat/root/chat-root.js +27 -40
- package/dist/checkbox/root/checkbox-root.d.ts +10 -12
- package/dist/checkbox/root/checkbox-root.js +29 -35
- package/dist/checkbox-group/root/checkbox-group-root.d.ts +32 -45
- package/dist/checkbox-group/root/checkbox-group-root.js +53 -79
- package/dist/code-block/root/code-block-root.d.ts +3 -4
- package/dist/code-block/root/code-block-root.js +8 -12
- package/dist/color-input/root/color-input-root.d.ts +36 -37
- package/dist/color-input/root/color-input-root.js +29 -34
- package/dist/color-picker/color.d.ts +7 -8
- package/dist/color-picker/color.js +7 -8
- package/dist/color-picker/root/color-picker-root.d.ts +55 -57
- package/dist/color-picker/root/color-picker-root.js +60 -64
- package/dist/combobox/root/combobox-root.d.ts +53 -58
- package/dist/combobox/root/combobox-root.js +85 -94
- package/dist/command/root/command-root.d.ts +8 -8
- package/dist/command/root/command-root.js +29 -33
- package/dist/copy-button/root/copy-button-root.d.ts +21 -24
- package/dist/copy-button/root/copy-button-root.js +25 -35
- package/dist/data-table/root/data-table-root.d.ts +77 -76
- package/dist/data-table/root/data-table-root.js +95 -84
- package/dist/data-table/root/order.d.ts +2 -2
- package/dist/data-table/root/order.js +1 -3
- package/dist/date-input/root/date-input-root.d.ts +88 -93
- package/dist/date-input/root/date-input-root.js +147 -158
- package/dist/date-picker/root/date-picker-root.d.ts +75 -83
- package/dist/date-picker/root/date-picker-root.js +120 -143
- package/dist/dialog/root/dialog-root.d.ts +41 -24
- package/dist/dialog/root/dialog-root.js +47 -24
- package/dist/divider/root/divider-root.d.ts +5 -6
- package/dist/divider/root/divider-root.js +4 -5
- package/dist/donut-chart/root/donut-chart-root.d.ts +22 -25
- package/dist/donut-chart/root/donut-chart-root.js +37 -51
- package/dist/drawer/root/drawer-root.d.ts +24 -29
- package/dist/drawer/root/drawer-root.js +15 -22
- package/dist/drilldown/item/drilldown-item.d.ts +14 -14
- package/dist/drilldown/item/drilldown-item.js +24 -26
- package/dist/drilldown/root/drilldown-root.d.ts +8 -10
- package/dist/drilldown/root/drilldown-root.js +6 -7
- package/dist/element-events.generated.js +1 -1
- package/dist/file-input/root/file-input-root.d.ts +20 -24
- package/dist/file-input/root/file-input-root.js +42 -57
- package/dist/format-date/root/format-date-root.js +1 -1
- package/dist/heatmap/root/buckets.d.ts +8 -8
- package/dist/heatmap/root/buckets.js +8 -8
- package/dist/heatmap/root/heatmap-root.d.ts +57 -63
- package/dist/heatmap/root/heatmap-root.js +72 -83
- package/dist/icon/root/icon-root.d.ts +4 -4
- package/dist/icon/root/icon-root.js +9 -9
- package/dist/icon-button/root/icon-button-root.d.ts +4 -6
- package/dist/icon-button/root/icon-button-root.js +4 -6
- package/dist/image/root/image-root.d.ts +49 -59
- package/dist/image/root/image-root.js +55 -65
- package/dist/index.d.ts +5 -5
- package/dist/index.js +5 -5
- package/dist/input/root/input-root.d.ts +61 -85
- package/dist/input/root/input-root.js +79 -106
- package/dist/kbd/root/kbd-root.d.ts +8 -7
- package/dist/kbd/root/kbd-root.js +71 -11
- package/dist/legend/root/legend-root.d.ts +1 -1
- package/dist/legend/root/legend-root.js +4 -5
- package/dist/line-chart/root/line-chart-root.d.ts +26 -30
- package/dist/line-chart/root/line-chart-root.js +10 -10
- package/dist/list/item/list-item.d.ts +14 -18
- package/dist/list/item/list-item.js +18 -22
- package/dist/list/root/list-root.d.ts +4 -4
- package/dist/list/root/list-root.js +3 -3
- package/dist/listbox/root/listbox-root.d.ts +31 -58
- package/dist/listbox/root/listbox-root.js +66 -109
- package/dist/megamenu/root/megamenu-root.d.ts +34 -35
- package/dist/megamenu/root/megamenu-root.js +53 -58
- package/dist/menu/item/menu-item.d.ts +39 -53
- package/dist/menu/item/menu-item.js +50 -64
- package/dist/menu/root/menu-root.d.ts +30 -40
- package/dist/menu/root/menu-root.js +49 -82
- package/dist/meter/root/meter-root.d.ts +49 -53
- package/dist/meter/root/meter-root.js +22 -27
- package/dist/navigation/root/navigation-root.js +11 -19
- package/dist/notifications/notification/notification.d.ts +16 -22
- package/dist/notifications/notification/notification.js +21 -27
- package/dist/notifications/root/notifications-root.d.ts +31 -39
- package/dist/notifications/root/notifications-root.js +41 -52
- package/dist/number-input/root/number-input-root.d.ts +31 -33
- package/dist/number-input/root/number-input-root.js +37 -39
- package/dist/option/root/option-root.d.ts +73 -74
- package/dist/option/root/option-root.js +62 -64
- package/dist/outline/root/outline-root.d.ts +38 -44
- package/dist/outline/root/outline-root.js +66 -82
- package/dist/pagination/root/pagination-root.d.ts +87 -92
- package/dist/pagination/root/pagination-root.js +116 -123
- package/dist/pagination/size/pagination-size.d.ts +31 -50
- package/dist/pagination/size/pagination-size.js +35 -55
- package/dist/pagination/summary/pagination-summary.d.ts +12 -12
- package/dist/pagination/summary/pagination-summary.js +18 -18
- package/dist/pin-input/root/pin-input-root.d.ts +53 -70
- package/dist/pin-input/root/pin-input-root.js +74 -94
- package/dist/popover/root/popover-root.d.ts +15 -20
- package/dist/popover/root/popover-root.js +19 -36
- package/dist/progress/root/progress-root.d.ts +12 -14
- package/dist/progress/root/progress-root.js +22 -25
- package/dist/qr-code/root/qr-code-root.d.ts +11 -11
- package/dist/qr-code/root/qr-code-root.js +12 -14
- package/dist/radio/group/radio-group.js +19 -26
- package/dist/radio/root/radio-root.d.ts +12 -13
- package/dist/radio/root/radio-root.js +12 -13
- package/dist/rating/root/rating-root.d.ts +25 -30
- package/dist/rating/root/rating-root.js +43 -50
- package/dist/scroll-area/root/scroll-area-root.d.ts +11 -14
- package/dist/scroll-area/root/scroll-area-root.js +39 -33
- package/dist/select/root/select-root.d.ts +7 -12
- package/dist/select/root/select-root.js +40 -55
- package/dist/slider/root/slider-root.d.ts +53 -60
- package/dist/slider/root/slider-root.js +74 -85
- package/dist/sparkline/root/sparkline-root.d.ts +43 -47
- package/dist/sparkline/root/sparkline-root.js +23 -32
- package/dist/speed-dial/item/speed-dial-item.d.ts +6 -6
- package/dist/speed-dial/item/speed-dial-item.js +9 -9
- package/dist/speed-dial/root/speed-dial-root.d.ts +21 -25
- package/dist/speed-dial/root/speed-dial-root.js +32 -40
- package/dist/splitter/root/splitter-root.d.ts +98 -111
- package/dist/splitter/root/splitter-root.js +96 -123
- package/dist/stat/root/stat-root.d.ts +2 -7
- package/dist/stat/root/stat-root.js +0 -5
- package/dist/steps/step/step.d.ts +19 -24
- package/dist/steps/step/step.js +27 -32
- package/dist/switch/root/switch-root.js +2 -2
- package/dist/table/column/table-column.d.ts +54 -60
- package/dist/table/column/table-column.js +95 -68
- package/dist/table/root/table-root.d.ts +5 -6
- package/dist/table/root/table-root.js +7 -10
- package/dist/tabs/panel/tab-panel.d.ts +21 -25
- package/dist/tabs/panel/tab-panel.js +25 -29
- package/dist/tabs/root/tabs-root.d.ts +25 -34
- package/dist/tabs/root/tabs-root.js +22 -28
- package/dist/tabs/tab/tab.d.ts +12 -12
- package/dist/tabs/tab/tab.js +19 -20
- package/dist/textarea/root/textarea-root.d.ts +36 -36
- package/dist/textarea/root/textarea-root.js +43 -47
- package/dist/time-input/root/time-input-root.d.ts +58 -68
- package/dist/time-input/root/time-input-root.js +62 -77
- package/dist/time-picker/root/time-picker-root.d.ts +73 -79
- package/dist/time-picker/root/time-picker-root.js +72 -84
- package/dist/timeline/item/timeline-item.d.ts +8 -11
- package/dist/timeline/item/timeline-item.js +8 -11
- package/dist/timeline/root/timeline-root.d.ts +5 -7
- package/dist/timeline/root/timeline-root.js +5 -7
- package/dist/toast/item/toast-item.d.ts +9 -27
- package/dist/toast/item/toast-item.js +19 -41
- package/dist/toast/root/toast-root.d.ts +10 -14
- package/dist/toast/root/toast-root.js +4 -5
- package/dist/toggle/group/toggle-group.d.ts +6 -15
- package/dist/toggle/group/toggle-group.js +21 -36
- package/dist/toggle/root/toggle-root.d.ts +26 -27
- package/dist/toggle/root/toggle-root.js +30 -31
- package/dist/toolbar/root/toolbar-root.d.ts +7 -10
- package/dist/toolbar/root/toolbar-root.js +10 -14
- package/dist/tooltip/root/tooltip-root.d.ts +52 -59
- package/dist/tooltip/root/tooltip-root.js +98 -93
- package/dist/tour/root/tour-root.d.ts +19 -23
- package/dist/tour/root/tour-root.js +31 -41
- package/dist/tour/stop/tour-stop.d.ts +14 -15
- package/dist/tour/stop/tour-stop.js +31 -34
- package/dist/tree/item/tree-item.d.ts +30 -35
- package/dist/tree/item/tree-item.js +43 -55
- package/dist/tree/root/tree-root.d.ts +7 -10
- package/dist/tree/root/tree-root.js +33 -42
- package/dist/trend/root/trend-root.d.ts +3 -5
- package/dist/trend/root/trend-root.js +5 -9
- package/dist/video/root/video-root.d.ts +100 -124
- package/dist/video/root/video-root.js +142 -176
- package/dist/video-playlist/item/video-playlist-item.d.ts +16 -16
- package/dist/video-playlist/item/video-playlist-item.js +24 -24
- package/dist/video-playlist/menu/video-playlist-menu.d.ts +5 -8
- package/dist/video-playlist/menu/video-playlist-menu.js +20 -29
- package/dist/video-playlist/root/video-playlist-root.d.ts +16 -11
- package/dist/video-playlist/root/video-playlist-root.js +21 -25
- package/dist/virtual-list/root/virtual-list-root.d.ts +8 -12
- package/dist/virtual-list/root/virtual-list-root.js +11 -16
- package/jsx.d.ts +9797 -12561
- package/package.json +6 -6
- package/vue.d.ts +2684 -3228
|
@@ -34,12 +34,8 @@ import { cycle, format, ordered, parse } from './order.js';
|
|
|
34
34
|
* </helix-data-table>
|
|
35
35
|
* ```
|
|
36
36
|
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* a person wrote out; the repeated `page`, `page-size` and `total` attributes on
|
|
40
|
-
* the three pagination elements are placeholders whose own comments name the fix
|
|
41
|
-
* as "a data table composing a pagination inside itself", and `helix-table`
|
|
42
|
-
* already carried `@aliases DataTable`: a name claimed and not kept.
|
|
37
|
+
* `helix-table` takes rows as markup and is the right component for a table of
|
|
38
|
+
* twelve things a person wrote out.
|
|
43
39
|
*
|
|
44
40
|
* **Sort and filter apply to the whole set, never the page.** Sorting the drawn
|
|
45
41
|
* window is correct on the first screen and wrong on every other one, which is
|
|
@@ -59,10 +55,10 @@ import { cycle, format, ordered, parse } from './order.js';
|
|
|
59
55
|
* `helix-table` where the content has to be in the served HTML and the result is
|
|
60
56
|
* small enough to write out; use this where the result is large, and accept that
|
|
61
57
|
* the first paint is a shell. The obvious workaround, a `columns` property
|
|
62
|
-
* beside the markup columns, is deliberately not offered:
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
58
|
+
* beside the markup columns, is deliberately not offered: it splits one source
|
|
59
|
+
* of truth for the columns into two that nothing checks against each other, and
|
|
60
|
+
* a table rendering one way on the server and another in the browser is that
|
|
61
|
+
* failure with a hydration mismatch on top.
|
|
66
62
|
*
|
|
67
63
|
* **Every axis is controlled or uncontrolled, and that is what makes a server
|
|
68
64
|
* mode fall out rather than be bolted on.** `sort`, `filter`, `page` and
|
|
@@ -102,17 +98,21 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
|
|
|
102
98
|
constructor() {
|
|
103
99
|
super(...arguments);
|
|
104
100
|
/**
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
* A property and not an attribute: it is an array. Left alone this element
|
|
108
|
-
* filters, sorts and pages it; in `server` mode it is the page the consumer
|
|
109
|
-
* already fetched and none of the three is applied.
|
|
110
|
-
*
|
|
111
|
-
* **Read, never written.** Sorting produces a new array rather than reordering
|
|
112
|
-
* this one, because a consumer's array may be the same object their own state
|
|
113
|
-
* holds and reordering it under them is a mutation they did not ask for.
|
|
101
|
+
* Query to open with, where nothing declared one.
|
|
114
102
|
*/
|
|
115
|
-
this.
|
|
103
|
+
this.defaultFilter = '';
|
|
104
|
+
/**
|
|
105
|
+
* Page to open on, where nothing declared one.
|
|
106
|
+
*/
|
|
107
|
+
this.defaultPage = 1;
|
|
108
|
+
/**
|
|
109
|
+
* Page size to open with, where nothing declared one.
|
|
110
|
+
*/
|
|
111
|
+
this.defaultPageSize = 0;
|
|
112
|
+
/**
|
|
113
|
+
* Order to open on, where nothing declared one.
|
|
114
|
+
*/
|
|
115
|
+
this.defaultSort = '';
|
|
116
116
|
/**
|
|
117
117
|
* The field naming a row's stable identity.
|
|
118
118
|
*
|
|
@@ -124,6 +124,10 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
|
|
|
124
124
|
* that works and is worth setting anyway.
|
|
125
125
|
*/
|
|
126
126
|
this.key = '';
|
|
127
|
+
/**
|
|
128
|
+
* Accessible name for the grid.
|
|
129
|
+
*/
|
|
130
|
+
this.label = '';
|
|
127
131
|
/**
|
|
128
132
|
* Whether this element does the work or asks the consumer to.
|
|
129
133
|
*
|
|
@@ -135,6 +139,18 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
|
|
|
135
139
|
* inverts the data flow.
|
|
136
140
|
*/
|
|
137
141
|
this.mode = 'client';
|
|
142
|
+
/**
|
|
143
|
+
* The whole result, in the order it arrived.
|
|
144
|
+
*
|
|
145
|
+
* A property and not an attribute: it is an array. Left alone this element
|
|
146
|
+
* filters, sorts and pages it; in `server` mode it is the page the consumer
|
|
147
|
+
* already fetched and none of the three is applied.
|
|
148
|
+
*
|
|
149
|
+
* **Read, never written.** Sorting produces a new array rather than reordering
|
|
150
|
+
* this one, because a consumer's array may be the same object their own state
|
|
151
|
+
* holds and reordering it under them is a mutation they did not ask for.
|
|
152
|
+
*/
|
|
153
|
+
this.rows = [];
|
|
138
154
|
/**
|
|
139
155
|
* How many rows the whole result has, where this element cannot count them.
|
|
140
156
|
*
|
|
@@ -144,26 +160,6 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
|
|
|
144
160
|
* one that cannot be stale.
|
|
145
161
|
*/
|
|
146
162
|
this.total = 0;
|
|
147
|
-
/**
|
|
148
|
-
* Accessible name for the grid.
|
|
149
|
-
*/
|
|
150
|
-
this.label = '';
|
|
151
|
-
/**
|
|
152
|
-
* Order to open on, where nothing declared one.
|
|
153
|
-
*/
|
|
154
|
-
this.defaultSort = '';
|
|
155
|
-
/**
|
|
156
|
-
* Query to open with, where nothing declared one.
|
|
157
|
-
*/
|
|
158
|
-
this.defaultFilter = '';
|
|
159
|
-
/**
|
|
160
|
-
* Page to open on, where nothing declared one.
|
|
161
|
-
*/
|
|
162
|
-
this.defaultPage = 1;
|
|
163
|
-
/**
|
|
164
|
-
* Page size to open with, where nothing declared one.
|
|
165
|
-
*/
|
|
166
|
-
this.defaultPageSize = 0;
|
|
167
163
|
this.sortState = undefined;
|
|
168
164
|
this.filterState = undefined;
|
|
169
165
|
this.pageState = undefined;
|
|
@@ -229,8 +225,6 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
|
|
|
229
225
|
* Set it and this element defers: a reader's click fires `helix-sort` and
|
|
230
226
|
* changes nothing until a new value arrives. `default-sort` seeds an order this
|
|
231
227
|
* element then owns.
|
|
232
|
-
*
|
|
233
|
-
*
|
|
234
228
|
*/
|
|
235
229
|
get sort() {
|
|
236
230
|
return this.sortState ?? this.defaultSort;
|
|
@@ -246,8 +240,6 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
|
|
|
246
240
|
* One query rather than a predicate per column, which is what a reader means
|
|
247
241
|
* by a search box above a table. It matches on each column's ordering value,
|
|
248
242
|
* so search and sort cannot disagree about what a column holds.
|
|
249
|
-
*
|
|
250
|
-
*
|
|
251
243
|
*/
|
|
252
244
|
get filter() {
|
|
253
245
|
return this.filterState ?? this.defaultFilter;
|
|
@@ -263,8 +255,6 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
|
|
|
263
255
|
* Clamped on the way out, so what this reports is the page it drew: a
|
|
264
256
|
* bookmarked link to page 99 of a result that has since shrunk reads back as
|
|
265
257
|
* the last page rather than as 99.
|
|
266
|
-
*
|
|
267
|
-
*
|
|
268
258
|
*/
|
|
269
259
|
get page() {
|
|
270
260
|
const asked = this.pageState ?? this.defaultPage;
|
|
@@ -312,8 +302,7 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
|
|
|
312
302
|
get tableColumns() {
|
|
313
303
|
/* `?? []` is the server. Lit's element shim carries attributes and not a
|
|
314
304
|
tree, so `children` is undefined there, and this getter is read during
|
|
315
|
-
`render`: spreading it
|
|
316
|
-
family once already. */
|
|
305
|
+
`render`: spreading it throws and takes the whole SSR suite with it. */
|
|
317
306
|
return [...(this.children ?? [])].filter((child) => 'isTableColumn' in child && child.isTableColumn === true);
|
|
318
307
|
}
|
|
319
308
|
/** The columns reduced to what the ordering needs. */
|
|
@@ -346,19 +335,18 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
|
|
|
346
335
|
* which means the out-of-the-box arrangement is the unbounded one and nothing
|
|
347
336
|
* about it says that a result of any size will simply be drawn.
|
|
348
337
|
*
|
|
349
|
-
* **Windowing was
|
|
350
|
-
*
|
|
338
|
+
* **Windowing was refused**, which is worth recording because it is the
|
|
339
|
+
* obvious answer. This element already has two mechanisms: `paginated` with a
|
|
351
340
|
* `page-size`, and `mode="server"` where `rows` is one page, `total` is the
|
|
352
341
|
* whole result and `aria-rowcount` already reports the result rather than the
|
|
353
342
|
* window, which is the hard half of virtualization done correctly. A third
|
|
354
|
-
*
|
|
355
|
-
*
|
|
356
|
-
*
|
|
357
|
-
*
|
|
343
|
+
* would fight the first two, and virtualizing a grid means variable row
|
|
344
|
+
* heights, a sticky header and keeping `aria-rowindex` honest against a result
|
|
345
|
+
* the element is no longer holding. `VirtualizeController` exists for the case
|
|
346
|
+
* where the rows are a flat list and this is not that.
|
|
358
347
|
*
|
|
359
|
-
*
|
|
360
|
-
*
|
|
361
|
-
* server render is one nobody can act on and one that would print per request.
|
|
348
|
+
* Warned once per element, in a browser only: a warning during a server render
|
|
349
|
+
* is one nobody can act on and one that would print per request.
|
|
362
350
|
*/
|
|
363
351
|
warnIfCrowded(drawn) {
|
|
364
352
|
if (this.warnedAboutSize ||
|
|
@@ -528,18 +516,16 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
|
|
|
528
516
|
/**
|
|
529
517
|
* Says on the toolbar and the footer whether anything is in them.
|
|
530
518
|
*
|
|
531
|
-
* **
|
|
532
|
-
*
|
|
533
|
-
*
|
|
534
|
-
*
|
|
535
|
-
*
|
|
536
|
-
* children. Both verified in a browser. A table with no toolbar paid the gap
|
|
537
|
-
* above the grid for one that was not there.
|
|
519
|
+
* **A stylesheet cannot ask.** `[part="toolbar"]:has(> slot:not(:has(*)))` is
|
|
520
|
+
* two faults at once: `:has()` may not be nested inside `:has()`, so the
|
|
521
|
+
* selector fails to parse and the whole rule is discarded; and
|
|
522
|
+
* `slot:not(:has(*))` is as true of a filled slot as of an empty one, because
|
|
523
|
+
* assigned nodes are not a slot's DOM children. Both verified in a browser.
|
|
538
524
|
*/
|
|
539
525
|
markEmpty() {
|
|
540
526
|
this.markRegion('toolbar', ['toolbar']);
|
|
541
527
|
/* The footer is not empty while this element is drawing its own pagination
|
|
542
|
-
into it
|
|
528
|
+
into it. */
|
|
543
529
|
this.markRegion('footer', ['footer'], '[part="pagination"]');
|
|
544
530
|
}
|
|
545
531
|
/**
|
|
@@ -561,6 +547,32 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
|
|
|
561
547
|
super.updated(changed);
|
|
562
548
|
this.markEmpty();
|
|
563
549
|
this.assign();
|
|
550
|
+
this.announceSort();
|
|
551
|
+
}
|
|
552
|
+
/**
|
|
553
|
+
* Tells each column which way it is ordered, if it is the one.
|
|
554
|
+
*
|
|
555
|
+
* **The table owns the sort and the column carries the semantics**, which is
|
|
556
|
+
* the only arrangement that can be right: `role="columnheader"` is on the
|
|
557
|
+
* column, so `aria-sort` has to be there too, and the value is a fact about
|
|
558
|
+
* the table's `sort` rather than about any column. Pushed down here rather
|
|
559
|
+
* than pulled up there, because a column asking its parent would have to know
|
|
560
|
+
* what kind of parent it has, and it is slotted into two.
|
|
561
|
+
*
|
|
562
|
+
* In `updated` and after `assign`, so the order announced is the order the
|
|
563
|
+
* rows are already in. Announced before the rows moved is the sort a reader is
|
|
564
|
+
* told about being one they cannot see yet.
|
|
565
|
+
*/
|
|
566
|
+
announceSort() {
|
|
567
|
+
const current = parse(this.sort);
|
|
568
|
+
for (const column of this.tableColumns) {
|
|
569
|
+
column.sorted =
|
|
570
|
+
current && column.canSort && column.field === current.field
|
|
571
|
+
? current.direction === 'asc'
|
|
572
|
+
? 'ascending'
|
|
573
|
+
: 'descending'
|
|
574
|
+
: undefined;
|
|
575
|
+
}
|
|
564
576
|
}
|
|
565
577
|
renderCell(column, row) {
|
|
566
578
|
return html `<span
|
|
@@ -639,8 +651,7 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
|
|
|
639
651
|
* node passes through the slot in the flattened tree, and does not work in
|
|
640
652
|
* happy-dom, which does not implement that propagation: measured, the host
|
|
641
653
|
* hears the click and the slot does not. A spec written against the slot fails
|
|
642
|
-
* in the suite while the component is correct
|
|
643
|
-
* flattened tree could as easily have gone the other way.
|
|
654
|
+
* in the suite while the component is correct.
|
|
644
655
|
*
|
|
645
656
|
* Added here rather than in the template because there is nothing in the
|
|
646
657
|
* shadow tree to attach it to, and removed on disconnect because this element
|
|
@@ -667,44 +678,44 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
|
|
|
667
678
|
}
|
|
668
679
|
};
|
|
669
680
|
__decorate([
|
|
670
|
-
property({ attribute:
|
|
671
|
-
], HelixHeadlessDataTable.prototype, "
|
|
681
|
+
property({ attribute: 'default-filter' })
|
|
682
|
+
], HelixHeadlessDataTable.prototype, "defaultFilter", void 0);
|
|
672
683
|
__decorate([
|
|
673
|
-
property()
|
|
674
|
-
], HelixHeadlessDataTable.prototype, "
|
|
684
|
+
property({ attribute: 'default-page', type: Number })
|
|
685
|
+
], HelixHeadlessDataTable.prototype, "defaultPage", void 0);
|
|
675
686
|
__decorate([
|
|
676
|
-
property()
|
|
677
|
-
], HelixHeadlessDataTable.prototype, "
|
|
687
|
+
property({ attribute: 'default-page-size', type: Number })
|
|
688
|
+
], HelixHeadlessDataTable.prototype, "defaultPageSize", void 0);
|
|
678
689
|
__decorate([
|
|
679
|
-
property({
|
|
680
|
-
], HelixHeadlessDataTable.prototype, "
|
|
690
|
+
property({ attribute: 'default-sort' })
|
|
691
|
+
], HelixHeadlessDataTable.prototype, "defaultSort", void 0);
|
|
681
692
|
__decorate([
|
|
682
693
|
property()
|
|
683
|
-
], HelixHeadlessDataTable.prototype, "
|
|
694
|
+
], HelixHeadlessDataTable.prototype, "key", void 0);
|
|
684
695
|
__decorate([
|
|
685
696
|
property()
|
|
686
697
|
], HelixHeadlessDataTable.prototype, "sort", null);
|
|
687
698
|
__decorate([
|
|
688
|
-
property(
|
|
689
|
-
], HelixHeadlessDataTable.prototype, "
|
|
699
|
+
property()
|
|
700
|
+
], HelixHeadlessDataTable.prototype, "label", void 0);
|
|
690
701
|
__decorate([
|
|
691
702
|
property()
|
|
692
703
|
], HelixHeadlessDataTable.prototype, "filter", null);
|
|
693
704
|
__decorate([
|
|
694
|
-
property(
|
|
695
|
-
], HelixHeadlessDataTable.prototype, "
|
|
705
|
+
property()
|
|
706
|
+
], HelixHeadlessDataTable.prototype, "mode", void 0);
|
|
696
707
|
__decorate([
|
|
697
708
|
property({ type: Number })
|
|
698
709
|
], HelixHeadlessDataTable.prototype, "page", null);
|
|
699
710
|
__decorate([
|
|
700
|
-
property({ attribute:
|
|
701
|
-
], HelixHeadlessDataTable.prototype, "
|
|
711
|
+
property({ attribute: false })
|
|
712
|
+
], HelixHeadlessDataTable.prototype, "rows", void 0);
|
|
702
713
|
__decorate([
|
|
703
714
|
property({ attribute: 'page-size', type: Number })
|
|
704
715
|
], HelixHeadlessDataTable.prototype, "pageSize", null);
|
|
705
716
|
__decorate([
|
|
706
|
-
property({
|
|
707
|
-
], HelixHeadlessDataTable.prototype, "
|
|
717
|
+
property({ type: Number })
|
|
718
|
+
], HelixHeadlessDataTable.prototype, "total", void 0);
|
|
708
719
|
__decorate([
|
|
709
720
|
property({ type: Boolean })
|
|
710
721
|
], HelixHeadlessDataTable.prototype, "paginated", null);
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
*
|
|
21
21
|
* Not `DataRow`: `@fusion.dev/helix-core` already exports one, for a cell read out of a
|
|
22
22
|
* chart series, and the headless barrel re-exports both. Two different `DataRow`s
|
|
23
|
-
* reaching a consumer through one package is
|
|
24
|
-
*
|
|
23
|
+
* reaching a consumer through one package is an ambiguity TypeScript refuses
|
|
24
|
+
* outright.
|
|
25
25
|
*/
|
|
26
26
|
export type DataRow = Readonly<Record<string, unknown>>;
|
|
27
27
|
/** One column's contribution, reduced to the two functions this module needs. */
|
|
@@ -140,9 +140,7 @@ const text = (value) => {
|
|
|
140
140
|
* **`sign` is applied in here rather than to the result**, and that is why it is
|
|
141
141
|
* a parameter rather than the caller's multiplication. Written the obvious way,
|
|
142
142
|
* as `sign * compare(a, b)`, the constant this returns for a hole flips with the
|
|
143
|
-
* direction and the holes lead a descending sort
|
|
144
|
-
* otherwise for as long as it took the spec to be written, which is the argument
|
|
145
|
-
* for writing the spec.
|
|
143
|
+
* direction and the holes lead a descending sort.
|
|
146
144
|
*/
|
|
147
145
|
const compare = (left, right, sign) => {
|
|
148
146
|
const leftMissing = left === null || left === undefined || left === '';
|
|
@@ -84,70 +84,10 @@ export declare class HelixHeadlessDateInput extends HelixHeadlessDateInput_base
|
|
|
84
84
|
* What the browser may autofill here, as one of the platform's own tokens.
|
|
85
85
|
*
|
|
86
86
|
* Empty leaves the attribute off, which is the browser's default and is what
|
|
87
|
-
* lets autofill work at all
|
|
88
|
-
*
|
|
89
|
-
* consumer had no way to ask for it. See 295.
|
|
87
|
+
* lets autofill work at all: hardcoding `off` here means a birthday or a
|
|
88
|
+
* postal code can never be filled in for a reader.
|
|
90
89
|
*/
|
|
91
90
|
autocomplete: string;
|
|
92
|
-
/**
|
|
93
|
-
* How many dates can be held at once.
|
|
94
|
-
*
|
|
95
|
-
* Absent is one. `range` holds a start and an end, `multiple` holds any
|
|
96
|
-
* number, and both are carried as one comma-separated value: a form field
|
|
97
|
-
* submits a string, and two fields for one question is a different control.
|
|
98
|
-
*/
|
|
99
|
-
mode?: 'range' | 'multiple';
|
|
100
|
-
/**
|
|
101
|
-
* How many months the calendar shows, side by side.
|
|
102
|
-
*
|
|
103
|
-
* Worth more than one mainly for a range, where picking a start in March and
|
|
104
|
-
* an end in April otherwise means paging between them and losing sight of the
|
|
105
|
-
* first. The panel is sized by its content, so this widens it.
|
|
106
|
-
*/
|
|
107
|
-
months: number;
|
|
108
|
-
/**
|
|
109
|
-
* How many dates are shown as tags before the rest are counted, in `multiple`.
|
|
110
|
-
*
|
|
111
|
-
* `0` is all of them, and is the default: a cap that guesses is worse than no
|
|
112
|
-
* cap, because the number that fits depends on the width of the field and the
|
|
113
|
-
* length of what is in it, neither of which this element knows. What a cap is
|
|
114
|
-
* genuinely for is a field in a row or a table cell, where a set of twelve
|
|
115
|
-
* dates would push everything below it down a line at a time.
|
|
116
|
-
*
|
|
117
|
-
* The remainder is counted rather than hidden. "3 more" is a fact a reader can
|
|
118
|
-
* act on, where a row that silently stops is a field that appears to have lost
|
|
119
|
-
* what was put in it, and the count is what tells them there is more to see.
|
|
120
|
-
*/
|
|
121
|
-
maxTags: number;
|
|
122
|
-
/**
|
|
123
|
-
* Earliest date that can be chosen, as `YYYY-MM-DD`.
|
|
124
|
-
*/
|
|
125
|
-
min: string;
|
|
126
|
-
/**
|
|
127
|
-
* How far apart the selectable dates are, in days.
|
|
128
|
-
*
|
|
129
|
-
* `<input type="date" step>`'s own unit, handed to the calendar this renders
|
|
130
|
-
* so the field and the grid agree about which dates exist. Counted from `min`
|
|
131
|
-
* where there is one and from 1 January 1970 where there is not, which is the
|
|
132
|
-
* platform's base.
|
|
133
|
-
*/
|
|
134
|
-
step: number;
|
|
135
|
-
/**
|
|
136
|
-
* Latest date that can be chosen, as `YYYY-MM-DD`.
|
|
137
|
-
*/
|
|
138
|
-
max: string;
|
|
139
|
-
/**
|
|
140
|
-
* Dates that cannot be chosen, as a comma-separated `YYYY-MM-DD` list.
|
|
141
|
-
*/
|
|
142
|
-
disableDates: string;
|
|
143
|
-
/**
|
|
144
|
-
* Days of the week that cannot be chosen, `0` for Sunday through `6`.
|
|
145
|
-
*/
|
|
146
|
-
disableDays: string;
|
|
147
|
-
/**
|
|
148
|
-
* First column of the week in the calendar, `0` for Sunday through `6`.
|
|
149
|
-
*/
|
|
150
|
-
firstDayOfWeek: number;
|
|
151
91
|
/**
|
|
152
92
|
* How a date is written in the field: `short` through `full`, or ISO.
|
|
153
93
|
*
|
|
@@ -173,18 +113,87 @@ export declare class HelixHeadlessDateInput extends HelixHeadlessDateInput_base
|
|
|
173
113
|
* submits and what `min` and `max` compare against.
|
|
174
114
|
*/
|
|
175
115
|
dateStyle: 'full' | 'iso' | 'long' | 'medium' | 'short';
|
|
116
|
+
/**
|
|
117
|
+
* Dates that cannot be chosen, as a comma-separated `YYYY-MM-DD` list.
|
|
118
|
+
*/
|
|
119
|
+
disableDates: string;
|
|
120
|
+
/**
|
|
121
|
+
* Days of the week that cannot be chosen, `0` for Sunday through `6`.
|
|
122
|
+
*/
|
|
123
|
+
disableDays: string;
|
|
124
|
+
/**
|
|
125
|
+
* First column of the week in the calendar, `0` for Sunday through `6`.
|
|
126
|
+
*/
|
|
127
|
+
firstDayOfWeek: number;
|
|
176
128
|
/**
|
|
177
129
|
* Language tag the calendar names its months and days in.
|
|
178
130
|
*/
|
|
179
131
|
locale: string;
|
|
132
|
+
/**
|
|
133
|
+
* Latest date that can be chosen, as `YYYY-MM-DD`.
|
|
134
|
+
*/
|
|
135
|
+
max: string;
|
|
136
|
+
/**
|
|
137
|
+
* How many dates are shown as tags before the rest are counted, in `multiple`.
|
|
138
|
+
*
|
|
139
|
+
* `0` is all of them, and is the default: a cap that guesses is worse than no
|
|
140
|
+
* cap, because the number that fits depends on the width of the field and the
|
|
141
|
+
* length of what is in it, neither of which this element knows. What a cap is
|
|
142
|
+
* genuinely for is a field in a row or a table cell, where a set of twelve
|
|
143
|
+
* dates would push everything below it down a line at a time.
|
|
144
|
+
*
|
|
145
|
+
* The remainder is counted rather than hidden. `+3` is a fact a reader can
|
|
146
|
+
* act on, where a row that silently stops is a field that appears to have lost
|
|
147
|
+
* what was put in it, and the count is what tells them there is more to see.
|
|
148
|
+
*/
|
|
149
|
+
maxTags: number;
|
|
150
|
+
/**
|
|
151
|
+
* Earliest date that can be chosen, as `YYYY-MM-DD`.
|
|
152
|
+
*/
|
|
153
|
+
min: string;
|
|
154
|
+
/**
|
|
155
|
+
* How many dates can be held at once.
|
|
156
|
+
*
|
|
157
|
+
* Absent is one. `range` holds a start and an end, `multiple` holds any
|
|
158
|
+
* number, and both are carried as one comma-separated value: a form field
|
|
159
|
+
* submits a string, and two fields for one question is a different control.
|
|
160
|
+
*/
|
|
161
|
+
mode?: 'range' | 'multiple';
|
|
162
|
+
/**
|
|
163
|
+
* How many months the calendar shows, side by side.
|
|
164
|
+
*
|
|
165
|
+
* Worth more than one mainly for a range, where picking a start in March and
|
|
166
|
+
* an end in April otherwise means paging between them and losing sight of the
|
|
167
|
+
* first. The panel is sized by its content, so this widens it.
|
|
168
|
+
*/
|
|
169
|
+
months: number;
|
|
180
170
|
/**
|
|
181
171
|
* What the field says before a date is in it.
|
|
182
172
|
*/
|
|
183
173
|
placeholder: string;
|
|
184
174
|
/**
|
|
185
|
-
*
|
|
175
|
+
* Whether the control refuses changes while still submitting its value.
|
|
176
|
+
*
|
|
177
|
+
* **Enforced by refusing every request in one place**, which is the seam this
|
|
178
|
+
* component already has: `requestValue` is what every path here comes through,
|
|
179
|
+
* and gating it once is what stops the next call site from being written
|
|
180
|
+
* without the check.
|
|
181
|
+
*
|
|
182
|
+
* Not `disabled`, which is the confusion worth naming: a disabled control
|
|
183
|
+
* submits nothing and leaves the tab order, and a read-only one submits its
|
|
184
|
+
* value and stays reachable, which is what a form showing a value somebody
|
|
185
|
+
* else set needs.
|
|
186
186
|
*/
|
|
187
|
-
|
|
187
|
+
readOnly: boolean;
|
|
188
|
+
/**
|
|
189
|
+
* How far apart the selectable dates are, in days.
|
|
190
|
+
*
|
|
191
|
+
* `<input type="date" step>`'s own unit, handed to the calendar this renders
|
|
192
|
+
* so the field and the grid agree about which dates exist. Counted from `min`
|
|
193
|
+
* where there is one and from 1 January 1970 where there is not, which is the
|
|
194
|
+
* platform's base.
|
|
195
|
+
*/
|
|
196
|
+
step: number;
|
|
188
197
|
/**
|
|
189
198
|
* The overlay, placed against the field rather than the trigger.
|
|
190
199
|
*
|
|
@@ -247,19 +256,9 @@ export declare class HelixHeadlessDateInput extends HelixHeadlessDateInput_base
|
|
|
247
256
|
/** Escape shuts the calendar without moving the date. */
|
|
248
257
|
private readonly handleKeydown;
|
|
249
258
|
/**
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
-
* **Enforced by refusing every request in one place**, which is the seam this
|
|
253
|
-
* component already has: `requestValue` is what every path here comes through,
|
|
254
|
-
* and gating it once is what stops the next call site from being written
|
|
255
|
-
* without the check.
|
|
256
|
-
*
|
|
257
|
-
* Not `disabled`, which is the confusion worth naming: a disabled control
|
|
258
|
-
* submits nothing and leaves the tab order, and a read-only one submits its
|
|
259
|
-
* value and stays reachable, which is what a form showing a value somebody
|
|
260
|
-
* else set needs.
|
|
259
|
+
* Accessible name for the control that opens the calendar.
|
|
261
260
|
*/
|
|
262
|
-
|
|
261
|
+
triggerLabel: string;
|
|
263
262
|
/** Refuses every change while read-only. See `readOnly`. */
|
|
264
263
|
requestValue(next: string): boolean;
|
|
265
264
|
protected firstUpdated(changed: PropertyValues): void;
|
|
@@ -280,9 +279,8 @@ export declare class HelixHeadlessDateInput extends HelixHeadlessDateInput_base
|
|
|
280
279
|
* outside this element and reads as an arrival. Every step is ordinary browser
|
|
281
280
|
* behavior and none of it can be exercised here: `focus()` dispatches no
|
|
282
281
|
* event in an unfocused document, which is what both the test runtime and the
|
|
283
|
-
* available browser pane are. A spec
|
|
284
|
-
*
|
|
285
|
-
* left to look like proof.
|
|
282
|
+
* available browser pane are. A spec for this passes with the guard removed,
|
|
283
|
+
* so there is no spec: it would cover nothing while looking like proof.
|
|
286
284
|
*
|
|
287
285
|
* A flag rather than a better guess, because this element is the one moving
|
|
288
286
|
* the focus and is the only thing that can know so. Cleared synchronously,
|
|
@@ -297,23 +295,21 @@ export declare class HelixHeadlessDateInput extends HelixHeadlessDateInput_base
|
|
|
297
295
|
/**
|
|
298
296
|
* The calendar the field opens, behind a seam the styled tier can move.
|
|
299
297
|
*
|
|
300
|
-
* A method rather than a fragment inline, so a tier above can
|
|
301
|
-
*
|
|
302
|
-
* out, without reimplementing the whole template to do any of them. The tag is
|
|
298
|
+
* A method rather than a fragment inline, so a tier above can replace, wrap
|
|
299
|
+
* or omit it without reimplementing the whole template. The tag is
|
|
303
300
|
* interpolated rather than written, so `tier` resolves it: this renders the
|
|
304
|
-
* headless element, and a styled subclass that sets `tier` renders the styled
|
|
305
|
-
* from the same template.
|
|
301
|
+
* headless element, and a styled subclass that sets `tier` renders the styled
|
|
302
|
+
* one from the same template.
|
|
306
303
|
*/
|
|
307
304
|
protected renderPicker(): TemplateResult;
|
|
308
305
|
/**
|
|
309
306
|
* One chosen date, as a tag, behind a seam the styled tier can move.
|
|
310
307
|
*
|
|
311
|
-
* A method rather than a fragment inline, so a tier above can
|
|
312
|
-
*
|
|
313
|
-
* out, without reimplementing the whole template to do any of them. The tag is
|
|
308
|
+
* A method rather than a fragment inline, so a tier above can replace, wrap
|
|
309
|
+
* or omit it without reimplementing the whole template. The tag is
|
|
314
310
|
* interpolated rather than written, so `tier` resolves it: this renders the
|
|
315
|
-
* headless element, and a styled subclass that sets `tier` renders the styled
|
|
316
|
-
* from the same template.
|
|
311
|
+
* headless element, and a styled subclass that sets `tier` renders the styled
|
|
312
|
+
* one from the same template.
|
|
317
313
|
*/
|
|
318
314
|
protected renderTag(date: string): TemplateResult;
|
|
319
315
|
/**
|
|
@@ -322,15 +318,14 @@ export declare class HelixHeadlessDateInput extends HelixHeadlessDateInput_base
|
|
|
322
318
|
* Slot fallback, so a consumer replaces it by slotting; and a method, so the
|
|
323
319
|
* tier above replaces it by overriding.
|
|
324
320
|
*
|
|
325
|
-
* **A named import rather than `<helix-icon
|
|
326
|
-
* element looked like the tidier of the two and loses on three counts.
|
|
321
|
+
* **A named import rather than `<helix-icon>`**, which loses on three counts.
|
|
327
322
|
* `helix-icon` indexes the whole icon map at runtime, `icons[this.name]`, and
|
|
328
323
|
* no bundler can shake a runtime lookup, so every consumer of any component
|
|
329
324
|
* that renders one ships all 50kB of path data; a named import ships one
|
|
330
325
|
* path. The import is checked when the package compiles, where a `name`
|
|
331
|
-
* string is checked only
|
|
326
|
+
* string is checked only by a later name lookup. And `helix-icon` is not
|
|
332
327
|
* registered on the headless tier at all, which registers `helix-headless-icon`,
|
|
333
|
-
* so a headless consumer
|
|
328
|
+
* so a headless consumer gets an inert unknown element and no mark whatsoever.
|
|
334
329
|
*/
|
|
335
330
|
protected renderTrigger(): TemplateResult;
|
|
336
331
|
protected render(): TemplateResult;
|