@fusion.dev/helix-headless 0.235.1 → 0.237.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/api.json +1 -1
- package/custom-elements.json +1 -1
- package/dist/app-header/root/app-header-root.d.ts +9 -0
- package/dist/app-header/root/app-header-root.js +21 -0
- package/dist/area-chart/root/area-chart-root.d.ts +29 -15
- package/dist/area-chart/root/area-chart-root.js +10 -7
- package/dist/bar-chart/root/bar-chart-root.d.ts +41 -23
- package/dist/bar-chart/root/bar-chart-root.js +15 -10
- package/dist/button/root/button-root.js +1 -1
- package/dist/canvas/root/canvas-root.d.ts +10 -3
- package/dist/canvas/root/canvas-root.js +31 -14
- package/dist/color-input/root/color-input-root.d.ts +4 -2
- package/dist/color-input/root/color-input-root.js +1 -1
- package/dist/combobox/root/combobox-root.d.ts +8 -7
- package/dist/combobox/root/combobox-root.js +7 -3
- package/dist/command/root/command-root.d.ts +22 -2
- package/dist/command/root/command-root.js +39 -5
- package/dist/data-table/root/data-table-root.d.ts +15 -7
- package/dist/data-table/root/data-table-root.js +9 -2
- package/dist/date-picker/root/date-picker-root.d.ts +1 -1
- package/dist/date-picker/root/date-picker-root.js +9 -2
- package/dist/dialog/root/dialog-root.d.ts +13 -3
- package/dist/dialog/root/dialog-root.js +33 -2
- package/dist/donut-chart/root/donut-chart-root.d.ts +23 -1
- package/dist/donut-chart/root/donut-chart-root.js +41 -13
- package/dist/drawer/root/drawer-root.d.ts +10 -2
- package/dist/drawer/root/drawer-root.js +34 -1
- package/dist/filter-input/chip/filter-chip.js +2 -2
- package/dist/find/root/find-root.d.ts +11 -1
- package/dist/find/root/find-root.js +11 -0
- package/dist/heatmap/root/heatmap-root.d.ts +11 -8
- package/dist/heatmap/root/heatmap-root.js +27 -2
- package/dist/kbd/root/kbd-root.d.ts +4 -0
- package/dist/kbd/root/kbd-root.js +2 -1
- package/dist/lightbox/root/lightbox-root.js +3 -2
- package/dist/line-chart/root/line-chart-root.d.ts +36 -23
- package/dist/line-chart/root/line-chart-root.js +20 -13
- package/dist/list/item/list-item.d.ts +2 -1
- package/dist/list/item/list-item.js +4 -1
- package/dist/list/root/list-root.d.ts +33 -8
- package/dist/list/root/list-root.js +17 -3
- package/dist/listbox/root/listbox-root.d.ts +48 -15
- package/dist/listbox/root/listbox-root.js +65 -6
- package/dist/map/root/map-root.js +7 -7
- package/dist/markdown/tree.d.ts +6 -1
- package/dist/markdown/tree.js +1 -1
- package/dist/megamenu/root/megamenu-root.d.ts +19 -0
- package/dist/megamenu/root/megamenu-root.js +24 -0
- package/dist/menu/filter/menu-filter.js +3 -1
- package/dist/menu/item/menu-item.d.ts +12 -0
- package/dist/menu/item/menu-item.js +3 -0
- package/dist/menu/root/menu-root.d.ts +7 -1
- package/dist/menu/root/menu-root.js +6 -3
- package/dist/motion-toggle/root/motion-toggle-root.js +2 -2
- package/dist/notifications/notification/notification.d.ts +1 -0
- package/dist/notifications/notification/notification.js +1 -0
- package/dist/notifications/root/notifications-root.d.ts +7 -5
- package/dist/notifications/root/notifications-root.js +1 -1
- package/dist/number-input/root/number-input-root.d.ts +6 -0
- package/dist/number-input/root/number-input-root.js +14 -4
- package/dist/object-inspector/root/object-inspector-root.d.ts +6 -5
- package/dist/object-inspector/root/object-inspector-root.js +9 -3
- package/dist/option/root/option-root.d.ts +16 -2
- package/dist/option/root/option-root.js +7 -0
- package/dist/pagination/root/pagination-root.d.ts +36 -0
- package/dist/pagination/root/pagination-root.js +55 -2
- package/dist/pin-input/code.js +1 -1
- package/dist/qr-code/root/qr-code-root.d.ts +1 -0
- package/dist/qr-code/root/qr-code-root.js +1 -0
- package/dist/radio/root/radio-root.js +4 -0
- package/dist/rating/root/rating-root.d.ts +1 -0
- package/dist/rating/root/rating-root.js +1 -0
- package/dist/scatter-chart/root/scatter-chart-root.d.ts +6 -0
- package/dist/select/root/select-root.d.ts +27 -1
- package/dist/select/root/select-root.js +34 -3
- package/dist/shortcut-overlay/root/shortcut-overlay-root.d.ts +5 -0
- package/dist/shortcut-overlay/root/shortcut-overlay-root.js +15 -1
- package/dist/skeleton/root/skeleton-root.d.ts +1 -0
- package/dist/skeleton/root/skeleton-root.js +3 -0
- package/dist/sparkline/root/sparkline-root.d.ts +53 -0
- package/dist/sparkline/root/sparkline-root.js +37 -1
- package/dist/spatial-bar-chart/root/spatial-bar-chart-root.d.ts +4 -1
- package/dist/spatial-bar-chart/root/spatial-bar-chart-root.js +2 -2
- package/dist/spatial-ribbon-chart/root/spatial-ribbon-chart-root.d.ts +3 -0
- package/dist/spatial-ribbon-chart/root/spatial-ribbon-chart-root.js +2 -2
- package/dist/spatial-scatter-chart/root/spatial-scatter-chart-root.d.ts +3 -0
- package/dist/spatial-scatter-chart/root/spatial-scatter-chart-root.js +2 -2
- package/dist/spatial-scatter-chart/view.d.ts +17 -8
- package/dist/spatial-scatter-chart/view.js +7 -6
- package/dist/spatial-surface-chart/root/spatial-surface-chart-root.d.ts +3 -0
- package/dist/spatial-surface-chart/root/spatial-surface-chart-root.js +2 -2
- package/dist/spatial-treemap/root/spatial-treemap-root.d.ts +3 -0
- package/dist/spatial-treemap/root/spatial-treemap-root.js +2 -2
- package/dist/splitter/root/splitter-root.js +3 -1
- package/dist/stat/group/stat-group.d.ts +13 -0
- package/dist/stat/group/stat-group.js +22 -1
- package/dist/stat/root/stat-root.d.ts +62 -1
- package/dist/stat/root/stat-root.js +146 -4
- package/dist/table/cell/table-cell.d.ts +1 -0
- package/dist/table/cell/table-cell.js +4 -0
- package/dist/table/column/table-column.d.ts +11 -0
- package/dist/table/column/table-column.js +4 -0
- package/dist/table/root/table-root.d.ts +7 -6
- package/dist/table/root/table-root.js +1 -1
- package/dist/tabs/panel/tab-panel.d.ts +30 -0
- package/dist/tabs/panel/tab-panel.js +28 -3
- package/dist/tabs/root/tabs-root.d.ts +8 -0
- package/dist/tabs/root/tabs-root.js +8 -2
- package/dist/tabs/tab/tab.js +2 -2
- package/dist/tag/root/tag-root.js +2 -2
- package/dist/timeline/root/timeline-root.d.ts +2 -2
- package/dist/timeline/root/timeline-root.js +1 -1
- package/dist/toast/root/toast-root.d.ts +53 -6
- package/dist/toast/root/toast-root.js +158 -1
- package/dist/toggle/root/toggle-root.d.ts +1 -0
- package/dist/toggle/root/toggle-root.js +1 -1
- package/dist/video-playlist/root/video-playlist-root.d.ts +1 -0
- package/dist/video-playlist/root/video-playlist-root.js +2 -0
- package/dist/virtual-list/root/virtual-list-root.d.ts +2 -2
- package/dist/virtual-list/root/virtual-list-root.js +1 -1
- package/examples.json +1 -1
- package/lint.json +1 -1
- package/package.json +5 -5
- package/types/jsx.d.ts +693 -169
- package/types/vue.d.ts +423 -96
- package/types/words.d.ts +51 -12
|
@@ -78,9 +78,9 @@ declare const HelixHeadlessCombobox_base: (new (...args: any[]) => import("@fusi
|
|
|
78
78
|
* @documentation https://fusion.dev/helix/components/combobox
|
|
79
79
|
*
|
|
80
80
|
* @slot - The options.
|
|
81
|
-
* @slot empty - What the list shows when
|
|
81
|
+
* @slot empty - What the list shows when it has no options, for content richer than `empty-text`.
|
|
82
82
|
* @slot end - After the text, for a unit or a clear button.
|
|
83
|
-
* @slot error -
|
|
83
|
+
* @slot error - Content the list shows after `error-text` while it is set, such as a button that tries again.
|
|
84
84
|
* @slot feedback - The message that says what is wrong, for content richer than a string. It shows while there is a message.
|
|
85
85
|
* @slot hint - The hint, for content richer than plain text.
|
|
86
86
|
* @slot indicator - Replaces the caret that shows the field opens a list.
|
|
@@ -109,7 +109,7 @@ declare const HelixHeadlessCombobox_base: (new (...args: any[]) => import("@fusi
|
|
|
109
109
|
* @csspart indicator - The caret.
|
|
110
110
|
* @csspart label - The label above the field.
|
|
111
111
|
* @csspart listbox - The list inside the panel.
|
|
112
|
-
* @csspart listbox-empty - Shown when
|
|
112
|
+
* @csspart listbox-empty - Shown when the list has no options, or typing has hidden every one.
|
|
113
113
|
* @csspart listbox-error - Shown while `error-text` is set.
|
|
114
114
|
* @csspart listbox-feedback - The inner list's error message.
|
|
115
115
|
* @csspart listbox-filter-icon - The icon beside the list's filter field.
|
|
@@ -150,7 +150,7 @@ export declare class HelixHeadlessCombobox extends HelixHeadlessCombobox_base {
|
|
|
150
150
|
protected readonly listed: ListedController;
|
|
151
151
|
/**
|
|
152
152
|
* The key this family's words are registered under, its styled tag:
|
|
153
|
-
* `registerWords('de', { 'helix-combobox': {
|
|
153
|
+
* `registerWords('de', { 'helix-combobox': { noResultsText: 'Keine Treffer' } })`.
|
|
154
154
|
*/
|
|
155
155
|
static words: string;
|
|
156
156
|
protected readonly aria: AriaForwardController;
|
|
@@ -206,7 +206,8 @@ export declare class HelixHeadlessCombobox extends HelixHeadlessCombobox_base {
|
|
|
206
206
|
*/
|
|
207
207
|
createLabel: string;
|
|
208
208
|
/**
|
|
209
|
-
*
|
|
209
|
+
* The text shown when the list has no options. Typing that hides every
|
|
210
|
+
* option shows `no-results-text`.
|
|
210
211
|
*/
|
|
211
212
|
emptyText: string;
|
|
212
213
|
/**
|
|
@@ -287,9 +288,9 @@ export declare class HelixHeadlessCombobox extends HelixHeadlessCombobox_base {
|
|
|
287
288
|
multiple: boolean;
|
|
288
289
|
/**
|
|
289
290
|
* The text shown when typing hides every one of the options, where there are
|
|
290
|
-
* some.
|
|
291
|
+
* some. See Listbox's `no-results-text`.
|
|
291
292
|
*/
|
|
292
|
-
noResultsText
|
|
293
|
+
noResultsText: string;
|
|
293
294
|
/**
|
|
294
295
|
* What opens the list: `input`, typing or pressing Down; `focus`, also
|
|
295
296
|
* arriving in the field, by Tab or a press; or `manual`, only Down, Alt+Down
|
|
@@ -24,7 +24,7 @@ let HelixHeadlessCombobox = class HelixHeadlessCombobox extends MixinControllerO
|
|
|
24
24
|
this.autocomplete = 'off';
|
|
25
25
|
this.creatable = false;
|
|
26
26
|
this.createLabel = 'Add "{value}"';
|
|
27
|
-
this.emptyText = 'No
|
|
27
|
+
this.emptyText = 'No options';
|
|
28
28
|
this.errorText = '';
|
|
29
29
|
this.filterDelay = 0;
|
|
30
30
|
this.listLabel = 'Options';
|
|
@@ -32,6 +32,7 @@ let HelixHeadlessCombobox = class HelixHeadlessCombobox extends MixinControllerO
|
|
|
32
32
|
this.loadingText = 'Loading';
|
|
33
33
|
this.locale = '';
|
|
34
34
|
this.multiple = false;
|
|
35
|
+
this.noResultsText = 'No matches';
|
|
35
36
|
this.openOn = 'input';
|
|
36
37
|
this.placeholder = '';
|
|
37
38
|
this.readOnly = false;
|
|
@@ -596,7 +597,7 @@ let HelixHeadlessCombobox = class HelixHeadlessCombobox extends MixinControllerO
|
|
|
596
597
|
empty-text=${this.emptyText}
|
|
597
598
|
error-text=${this.loadError || this.errorText}
|
|
598
599
|
loading-text=${this.loadingText}
|
|
599
|
-
no-results-text=${this.noResultsText
|
|
600
|
+
no-results-text=${this.noResultsText}
|
|
600
601
|
lang=${handedLocale(this) || nothing}
|
|
601
602
|
result-label=${this.resultLabel ?? ''}
|
|
602
603
|
results-label=${this.resultsLabel}
|
|
@@ -613,7 +614,9 @@ let HelixHeadlessCombobox = class HelixHeadlessCombobox extends MixinControllerO
|
|
|
613
614
|
<slot @slotchange=${() => this.requestUpdate()}></slot>
|
|
614
615
|
<slot name="empty" slot="empty">${this.emptyText}</slot>
|
|
615
616
|
<slot name="loading" slot="loading">${this.loadingText}</slot>
|
|
616
|
-
|
|
617
|
+
<!-- No fallback: the list shows the error words itself and this slot
|
|
618
|
+
after them, so words here would say them twice. -->
|
|
619
|
+
<slot name="error" slot="error"></slot>
|
|
617
620
|
<slot
|
|
618
621
|
name="no-results"
|
|
619
622
|
slot=${this.querySelector?.(':scope > [slot="no-results"]') ? 'no-results' : nothing}
|
|
@@ -752,6 +755,7 @@ __decorate([
|
|
|
752
755
|
property({ type: Boolean })
|
|
753
756
|
], HelixHeadlessCombobox.prototype, "multiple", void 0);
|
|
754
757
|
__decorate([
|
|
758
|
+
words,
|
|
755
759
|
property({ attribute: 'no-results-text' })
|
|
756
760
|
], HelixHeadlessCombobox.prototype, "noResultsText", void 0);
|
|
757
761
|
__decorate([
|
|
@@ -51,7 +51,10 @@ declare const HelixHeadlessCommand_base: (new (...args: any[]) => import("@fusio
|
|
|
51
51
|
* **Keyboard.** Focus goes to the filter field as the palette opens, with no
|
|
52
52
|
* command highlighted, as in React Aria's Autocomplete, so Enter runs nothing
|
|
53
53
|
* until you type or press Down. Typing highlights the first command left, and
|
|
54
|
-
* the highlight moves through the commands while you type.
|
|
54
|
+
* the highlight moves through the commands while you type. Emptying the filter
|
|
55
|
+
* puts the list back as it opened, with no command highlighted and the list at
|
|
56
|
+
* its top. Escape clears the filter before it closes the palette, so a hint
|
|
57
|
+
* for Escape in the `footer` slot says Clear while the filter holds text.
|
|
55
58
|
*
|
|
56
59
|
* | Key | What it does |
|
|
57
60
|
* |---|---|
|
|
@@ -93,7 +96,7 @@ declare const HelixHeadlessCommand_base: (new (...args: any[]) => import("@fusio
|
|
|
93
96
|
*
|
|
94
97
|
* @slot - The commands, and any groups of them.
|
|
95
98
|
* @slot empty - What the palette shows when typing matches no commands, for content richer than `empty-text`.
|
|
96
|
-
* @slot error -
|
|
99
|
+
* @slot error - Content the palette shows after `error-text` while it is set, such as a button that tries again.
|
|
97
100
|
* @slot filter-icon - Replaces the magnifying glass in the filter field.
|
|
98
101
|
* @slot footer - Content under the list, such as the keys that work in the palette.
|
|
99
102
|
* @slot header - Content above the filter field, such as a title or the scope being searched. A heading here does not rename the palette, which `label` names.
|
|
@@ -436,6 +439,23 @@ export declare class HelixHeadlessCommand extends HelixHeadlessCommand_base {
|
|
|
436
439
|
* filter is applied, so the list's update is waited for a turn later.
|
|
437
440
|
*/
|
|
438
441
|
private readonly handleFilter;
|
|
442
|
+
/** Counts filter events, so a start over waits on the latest one only. */
|
|
443
|
+
private filterTurn;
|
|
444
|
+
/** Whether the next emptied filter is an Escape a reader pressed at a query. */
|
|
445
|
+
private escaping;
|
|
446
|
+
/** Notes an Escape pressed while something is typed, before the list clears it. */
|
|
447
|
+
private readonly noteEscape;
|
|
448
|
+
/**
|
|
449
|
+
* Puts the full list back as an opening shows it: no command highlighted,
|
|
450
|
+
* and the list at its top.
|
|
451
|
+
*
|
|
452
|
+
* **An emptied filter is the list a reader opened**, so it looks the same.
|
|
453
|
+
* After Escape cleared a query, the first command left by the query stayed
|
|
454
|
+
* highlighted and the list stayed scrolled about 22 pixels down, cutting the
|
|
455
|
+
* first group's heading, where the same list on opening had no highlight and
|
|
456
|
+
* its heading in full.
|
|
457
|
+
*/
|
|
458
|
+
private startOver;
|
|
439
459
|
/** Whether a child fills the named slot, so it is handed on to the dialog or the list. */
|
|
440
460
|
private fills;
|
|
441
461
|
protected updated(changed: PropertyValues): void;
|
|
@@ -125,10 +125,25 @@ let HelixHeadlessCommand = class HelixHeadlessCommand extends MixinControllerOpe
|
|
|
125
125
|
if (this.typed.trim() === '' && typed.trim() !== '') {
|
|
126
126
|
this.readControls();
|
|
127
127
|
}
|
|
128
|
+
const emptied = this.typed !== '' && typed === '';
|
|
129
|
+
const cleared = this.escaping;
|
|
130
|
+
this.escaping = false;
|
|
128
131
|
this.typed = typed;
|
|
132
|
+
this.filterTurn += 1;
|
|
133
|
+
const turn = this.filterTurn;
|
|
129
134
|
void Promise.resolve()
|
|
130
135
|
.then(() => this.listbox?.updateComplete)
|
|
131
|
-
.then(() =>
|
|
136
|
+
.then(() => {
|
|
137
|
+
this.markStatus();
|
|
138
|
+
if (emptied && cleared && turn === this.filterTurn) {
|
|
139
|
+
this.startOver();
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
this.filterTurn = 0;
|
|
144
|
+
this.escaping = false;
|
|
145
|
+
this.noteEscape = (event) => {
|
|
146
|
+
this.escaping = event.key === 'Escape' && this.typed !== '';
|
|
132
147
|
};
|
|
133
148
|
}
|
|
134
149
|
static { this.words = 'helix-command'; }
|
|
@@ -174,6 +189,7 @@ let HelixHeadlessCommand = class HelixHeadlessCommand extends MixinControllerOpe
|
|
|
174
189
|
auditChildren(this, 'listbox', 'listbox', 'the palette has no working list', true);
|
|
175
190
|
this.addEventListener('helix-before-select', this.swallowOptionSelect);
|
|
176
191
|
this.addEventListener('keydown', this.handleAlternate, { capture: true });
|
|
192
|
+
this.addEventListener('keydown', this.noteEscape, { capture: true });
|
|
177
193
|
this.addEventListener('keydown', this.handleBack);
|
|
178
194
|
this.addEventListener('click', this.handleAlternate, { capture: true });
|
|
179
195
|
document.addEventListener('keydown', this.handleHotkey);
|
|
@@ -188,6 +204,7 @@ let HelixHeadlessCommand = class HelixHeadlessCommand extends MixinControllerOpe
|
|
|
188
204
|
this.unregister?.();
|
|
189
205
|
this.removeEventListener('helix-before-select', this.swallowOptionSelect);
|
|
190
206
|
this.removeEventListener('keydown', this.handleAlternate, { capture: true });
|
|
207
|
+
this.removeEventListener('keydown', this.noteEscape, { capture: true });
|
|
191
208
|
this.removeEventListener('keydown', this.handleBack);
|
|
192
209
|
this.removeEventListener('click', this.handleAlternate, { capture: true });
|
|
193
210
|
document.removeEventListener('keydown', this.handleHotkey);
|
|
@@ -224,6 +241,17 @@ let HelixHeadlessCommand = class HelixHeadlessCommand extends MixinControllerOpe
|
|
|
224
241
|
this.toggleState('empty', settled && !shown);
|
|
225
242
|
this.toggleState('no-results', settled && list.filter !== '' && options.length > 0 && !shown);
|
|
226
243
|
}
|
|
244
|
+
startOver() {
|
|
245
|
+
const list = this.listbox;
|
|
246
|
+
if (!list || this.typed !== '' || list.filter !== '') {
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
list.highlight('none');
|
|
250
|
+
const items = list.shadowRoot?.querySelector('[part="items"]');
|
|
251
|
+
if (items) {
|
|
252
|
+
items.scrollTop = 0;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
227
255
|
fills(name) {
|
|
228
256
|
return this.querySelector?.(`:scope > [slot="${name}"]`) != null;
|
|
229
257
|
}
|
|
@@ -311,7 +339,7 @@ let HelixHeadlessCommand = class HelixHeadlessCommand extends MixinControllerOpe
|
|
|
311
339
|
filter-label=${this.placeholder}
|
|
312
340
|
error-text=${this.loadError || this.errorText}
|
|
313
341
|
loading-text=${this.loadingText}
|
|
314
|
-
no-results-text=${this.noResultsText ??
|
|
342
|
+
no-results-text=${this.noResultsText ?? this.emptyText}
|
|
315
343
|
result-label=${this.resultLabel ?? ''}
|
|
316
344
|
results-label=${this.resultsLabel}
|
|
317
345
|
?loading=${this.loading}
|
|
@@ -328,10 +356,16 @@ let HelixHeadlessCommand = class HelixHeadlessCommand extends MixinControllerOpe
|
|
|
328
356
|
${this.page === '' ? html `<slot></slot>` : html `<slot name=${`page:${this.page}`}></slot>`}
|
|
329
357
|
${this.renderControls()}
|
|
330
358
|
<!-- Handed on with the text as the fallback, for the reason Combobox
|
|
331
|
-
gives: the list's own fallback never shows behind a passed slot.
|
|
332
|
-
|
|
359
|
+
gives: the list's own fallback never shows behind a passed slot.
|
|
360
|
+
The palette's empty line is what typing that matches nothing
|
|
361
|
+
shows, so it goes to the list's no-results line unless the
|
|
362
|
+
no-results slot is filled. With no commands at all, the list's
|
|
363
|
+
own empty line says empty-text. -->
|
|
364
|
+
<slot name="empty" slot=${this.fills('no-results') ? 'empty' : 'no-results'}>${this.emptyText}</slot>
|
|
333
365
|
<slot name="loading" slot="loading">${this.loadingText}</slot>
|
|
334
|
-
|
|
366
|
+
<!-- No fallback: the list shows the error words itself and this slot
|
|
367
|
+
after them, so words here would say them twice. -->
|
|
368
|
+
<slot name="error" slot="error"></slot>
|
|
335
369
|
<!-- Handed on only while something fills it: an assigned slot hides the
|
|
336
370
|
list's own fallback, which is no-results-text or empty-text. -->
|
|
337
371
|
<slot
|
|
@@ -112,9 +112,10 @@ declare const HelixHeadlessDataTable_base: (new (...args: any[]) => import("@fus
|
|
|
112
112
|
* next rows to `rows`, and set `loading` while they are on their way.
|
|
113
113
|
*
|
|
114
114
|
* When a fetch fails, set `error-text`, such as "The files did not load", and
|
|
115
|
-
* put a button that tries again in the `error` slot. The line shows
|
|
116
|
-
* rows in place of the empty and loading lines,
|
|
117
|
-
* the table takes the `error` state. Clear it
|
|
115
|
+
* put a button that tries again in the `error` slot. The line shows the words
|
|
116
|
+
* and then the button, after the rows in place of the empty and loading lines,
|
|
117
|
+
* the live region says it, and the table takes the `error` state. Clear it
|
|
118
|
+
* once you try again.
|
|
118
119
|
*
|
|
119
120
|
* The controls inside the cells leave the tab order, so Tab moves past the
|
|
120
121
|
* whole grid. A windowed table keeps the row holding focus drawn while the
|
|
@@ -196,7 +197,7 @@ declare const HelixHeadlessDataTable_base: (new (...args: any[]) => import("@fus
|
|
|
196
197
|
*
|
|
197
198
|
* @slot - The columns, as `TableColumn` elements, and the first page served as `TableRow` elements, which show until `rows` holds a row.
|
|
198
199
|
* @slot empty - Content shown when there are no rows to show and none are loading, such as a picture and a link. Falls back to `empty-text`, which the live region still says.
|
|
199
|
-
* @slot error - Content shown
|
|
200
|
+
* @slot error - Content shown after `error-text` while it is set, such as a button that tries again.
|
|
200
201
|
* @slot footer - Content below the grid. It replaces the built-in pagination.
|
|
201
202
|
* @slot loading - Content shown while the rows load, such as a spinner. Falls back to `loading-text`, which the live region still says.
|
|
202
203
|
* @slot toolbar - Content above the grid, such as a search field or actions.
|
|
@@ -298,6 +299,7 @@ declare const HelixHeadlessDataTable_base: (new (...args: any[]) => import("@fus
|
|
|
298
299
|
* @csspart toolbar - The region above the grid.
|
|
299
300
|
*
|
|
300
301
|
* @cssproperty --data-table-cell-align - The alignment of the cell's column: `start`, `center`, or `end`. Unset when the column sets none. The component writes it on each cell it draws, and the stylesheet reads it. `Table` sets `--table-cell-align` for the same purpose.
|
|
302
|
+
* @cssproperty --data-table-cell-block-align - Where a cell's content sits from top to bottom in a row taller than it: `start`, `center` or `end`. `center` by default. Set it on the table, or on a row through `::part(row)`; a column's `vertical-align` writes it on each of that column's cells, and wins.
|
|
301
303
|
* @cssproperty --data-table-level - How deep a row is in a tree grid, from 1. The component writes it on each row header cell, and the stylesheet indents by it.
|
|
302
304
|
* @cssproperty --data-table-template - The column track list, worked out from the columns. The component writes it inline on the element that reads it, so setting it has no effect. Set a column's `width` to change it.
|
|
303
305
|
*
|
|
@@ -414,9 +416,9 @@ export declare class HelixHeadlessDataTable extends HelixHeadlessDataTable_base
|
|
|
414
416
|
* files did not load". Set it when a fetch fails, and clear it once you try
|
|
415
417
|
* again. Empty, the default, shows nothing.
|
|
416
418
|
*
|
|
417
|
-
* While it is set, a line after the rows shows it,
|
|
418
|
-
* `error` slot, in place of the empty and loading lines, and
|
|
419
|
-
* says it.
|
|
419
|
+
* While it is set, a line after the rows shows it, followed by your own
|
|
420
|
+
* content in the `error` slot, in place of the empty and loading lines, and
|
|
421
|
+
* the live region says it.
|
|
420
422
|
*/
|
|
421
423
|
errorText: string;
|
|
422
424
|
/**
|
|
@@ -633,6 +635,10 @@ export declare class HelixHeadlessDataTable extends HelixHeadlessDataTable_base
|
|
|
633
635
|
*
|
|
634
636
|
* Wants `row-key`: a selection is a set of identities, and without one the rows
|
|
635
637
|
* are known by their place in the result, which a sort changes.
|
|
638
|
+
*
|
|
639
|
+
* Reflected, because the styled tier lays the headings out by whether a
|
|
640
|
+
* checkbox column leads them: set as a property, as React sets it, the
|
|
641
|
+
* table's first heading took the inset a leading column already gives.
|
|
636
642
|
*/
|
|
637
643
|
selectable: boolean;
|
|
638
644
|
/** The name of the checkbox in the heading that selects every row. */
|
|
@@ -1419,6 +1425,8 @@ export declare class HelixHeadlessDataTable extends HelixHeadlessDataTable_base
|
|
|
1419
1425
|
* the table has, whatever the rows hold, since it scrolls them.
|
|
1420
1426
|
*/
|
|
1421
1427
|
private watchSize;
|
|
1428
|
+
/** Watches the table's own children, which the manual slots need to be told about. */
|
|
1429
|
+
private arrivals;
|
|
1422
1430
|
disconnectedCallback(): void;
|
|
1423
1431
|
/**
|
|
1424
1432
|
* Notes whether Shift is held, before the press reaches a checkbox, whose
|
|
@@ -1288,9 +1288,11 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
|
|
|
1288
1288
|
}
|
|
1289
1289
|
renderCell(column, row, picked, place, stop, header, id) {
|
|
1290
1290
|
const edge = edgeOf(column.textAlign);
|
|
1291
|
+
const block = edgeOf(column.verticalAlign);
|
|
1291
1292
|
const placed = header && this.childField ? this.tree().placed.get(row) : undefined;
|
|
1292
1293
|
const style = [
|
|
1293
1294
|
edge ? `--data-table-cell-align: ${edge}` : '',
|
|
1295
|
+
block ? `--data-table-cell-block-align: ${block}` : '',
|
|
1294
1296
|
placed ? `--data-table-level: ${placed.level}` : '',
|
|
1295
1297
|
]
|
|
1296
1298
|
.filter(Boolean)
|
|
@@ -1453,7 +1455,7 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
|
|
|
1453
1455
|
</div>`;
|
|
1454
1456
|
}
|
|
1455
1457
|
renderError() {
|
|
1456
|
-
return html `<p part="error" role="row"><span role="gridcell"
|
|
1458
|
+
return html `<p part="error" role="row"><span role="gridcell">${this.errorText}<slot name="error"></slot></span></p>`;
|
|
1457
1459
|
}
|
|
1458
1460
|
render() {
|
|
1459
1461
|
const { available, matched, page } = this.view;
|
|
@@ -1543,6 +1545,10 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
|
|
|
1543
1545
|
this.addEventListener('keydown', this.handleGridKey);
|
|
1544
1546
|
this.addEventListener('keydown', this.handleGripKey);
|
|
1545
1547
|
this.addEventListener('helix-before-resize', this.handleResize);
|
|
1548
|
+
if (typeof MutationObserver !== 'undefined') {
|
|
1549
|
+
this.arrivals ??= new MutationObserver(() => this.assign());
|
|
1550
|
+
this.arrivals.observe(this, { childList: true });
|
|
1551
|
+
}
|
|
1546
1552
|
this.watchSize();
|
|
1547
1553
|
}
|
|
1548
1554
|
firstUpdated(changed) {
|
|
@@ -1570,6 +1576,7 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
|
|
|
1570
1576
|
this.removeEventListener('keydown', this.handleGridKey);
|
|
1571
1577
|
this.removeEventListener('keydown', this.handleGripKey);
|
|
1572
1578
|
this.removeEventListener('helix-before-resize', this.handleResize);
|
|
1579
|
+
this.arrivals?.disconnect();
|
|
1573
1580
|
this.sizeObserver?.disconnect();
|
|
1574
1581
|
}
|
|
1575
1582
|
rowPartsOf(row, index) {
|
|
@@ -1996,7 +2003,7 @@ __decorate([
|
|
|
1996
2003
|
property({ attribute: false })
|
|
1997
2004
|
], HelixHeadlessDataTable.prototype, "rows", void 0);
|
|
1998
2005
|
__decorate([
|
|
1999
|
-
property({ type: Boolean })
|
|
2006
|
+
property({ reflect: true, type: Boolean })
|
|
2000
2007
|
], HelixHeadlessDataTable.prototype, "selectable", void 0);
|
|
2001
2008
|
__decorate([
|
|
2002
2009
|
words,
|
|
@@ -98,7 +98,7 @@ declare const HelixHeadlessDatePicker_base: (new (...args: any[]) => import("@fu
|
|
|
98
98
|
* @csspart previous-mark - The glyph on the previous month control, where none is slotted.
|
|
99
99
|
* @csspart selection - The chosen date or range in words, which screen readers hear when it changes. Drawn for screen readers only.
|
|
100
100
|
* @csspart week - One row of days.
|
|
101
|
-
* @csspart weekday - A column header naming a day of the week. It shows the short name and says the full one.
|
|
101
|
+
* @csspart weekday - A column header naming a day of the week. It shows the short name, or the narrow one where short names are long, and says the full one.
|
|
102
102
|
*
|
|
103
103
|
* @cssproperty --date-picker-column-count - How many month columns are drawn, capped at two. `--date-picker-columns` overrides it.
|
|
104
104
|
*
|
|
@@ -18,6 +18,11 @@ const KEYS = new Set([
|
|
|
18
18
|
' ',
|
|
19
19
|
]);
|
|
20
20
|
const firstOf = (year, month) => addMonths(asDate('2000-01-01'), (year - 2000) * 12 + month);
|
|
21
|
+
const columnHeads = (utc) => {
|
|
22
|
+
const short = utc({ weekday: 'short' });
|
|
23
|
+
const long = Array.from({ length: 7 }, (_, day) => short.format(Date.UTC(2026, 0, 4 + day))).some((name) => [...name].length > 4);
|
|
24
|
+
return long ? utc({ weekday: 'narrow' }) : short;
|
|
25
|
+
};
|
|
21
26
|
let HelixHeadlessDatePicker = class HelixHeadlessDatePicker extends MixinPickerFeedback(MixinControllerValue(HelixFormElement)) {
|
|
22
27
|
constructor() {
|
|
23
28
|
super(...arguments);
|
|
@@ -282,7 +287,9 @@ let HelixHeadlessDatePicker = class HelixHeadlessDatePicker extends MixinPickerF
|
|
|
282
287
|
this.previewed = '';
|
|
283
288
|
this.show(date);
|
|
284
289
|
this.updateComplete.then(() => {
|
|
285
|
-
this.renderRoot
|
|
290
|
+
this.renderRoot
|
|
291
|
+
.querySelector('[part~="cell"][tabindex="0"]')
|
|
292
|
+
?.focus({ preventScroll: true });
|
|
286
293
|
});
|
|
287
294
|
}
|
|
288
295
|
select(date) {
|
|
@@ -579,7 +586,7 @@ let HelixHeadlessDatePicker = class HelixHeadlessDatePicker extends MixinPickerF
|
|
|
579
586
|
long: utc({ dateStyle: 'long' }),
|
|
580
587
|
monthName: utc({ month: 'short' }),
|
|
581
588
|
monthYear: utc({ month: 'short', year: 'numeric' }),
|
|
582
|
-
weekday: utc
|
|
589
|
+
weekday: columnHeads(utc),
|
|
583
590
|
weekdayName: utc({ weekday: 'long' }),
|
|
584
591
|
year: utc({ year: 'numeric' }),
|
|
585
592
|
};
|
|
@@ -36,8 +36,10 @@ declare const HelixHeadlessDialog_base: (new (...args: any[]) => import("@fusion
|
|
|
36
36
|
*
|
|
37
37
|
* Set `alert` for a dialog that interrupts to ask for an answer, such as a
|
|
38
38
|
* confirmation before a deletion. It is an `alertdialog`, which a screen reader
|
|
39
|
-
* announces with its description as it opens.
|
|
40
|
-
*
|
|
39
|
+
* announces with its description as it opens. Put the action that dismisses
|
|
40
|
+
* first in the footer, with `autofocus`, so focus starts on the action that
|
|
41
|
+
* destroys nothing. Set
|
|
42
|
+
* `dismissible` to draw a close control, labeled by `dismiss-label`.
|
|
41
43
|
*
|
|
42
44
|
* **Keyboard.** Opening moves focus to the first control in the dialog.
|
|
43
45
|
*
|
|
@@ -57,7 +59,7 @@ declare const HelixHeadlessDialog_base: (new (...args: any[]) => import("@fusion
|
|
|
57
59
|
*
|
|
58
60
|
* @slot - The dialog's content.
|
|
59
61
|
* @slot dismiss-icon - Replaces the glyph inside the close control.
|
|
60
|
-
* @slot footer - The dialog's actions.
|
|
62
|
+
* @slot footer - The dialog's actions, written in the order they are drawn: the one that dismisses first, and the primary one last, at the trailing edge.
|
|
61
63
|
* @slot header - The title, and anything beside it.
|
|
62
64
|
* @slot icon - An icon above the title, for a warning dialog.
|
|
63
65
|
*
|
|
@@ -76,6 +78,7 @@ declare const HelixHeadlessDialog_base: (new (...args: any[]) => import("@fusion
|
|
|
76
78
|
* @cssstate entering - From the moment the dialog opens until its entrance has finished.
|
|
77
79
|
* @cssstate exiting - From the moment the dialog closes until its exit has finished.
|
|
78
80
|
* @cssstate open - While the dialog is open.
|
|
81
|
+
* @cssstate stacked - While the dialog is open over another modal surface that does not hold it, such as a second Dialog or a Drawer.
|
|
79
82
|
*/
|
|
80
83
|
export declare class HelixHeadlessDialog extends HelixHeadlessDialog_base {
|
|
81
84
|
/**
|
|
@@ -234,6 +237,13 @@ export declare class HelixHeadlessDialog extends HelixHeadlessDialog_base {
|
|
|
234
237
|
connectedCallback(): void;
|
|
235
238
|
disconnectedCallback(): void;
|
|
236
239
|
protected updated(changed: PropertyValues): void;
|
|
240
|
+
/**
|
|
241
|
+
* Whether a modal surface opened before this one is still holding the page
|
|
242
|
+
* and is not an ancestor of this one. A dialog written inside another already
|
|
243
|
+
* takes the panel's raised rungs; one opened beside it does not, and in dark
|
|
244
|
+
* the two were one fill under the scrim, measured 1.07:1.
|
|
245
|
+
*/
|
|
246
|
+
private overAnother;
|
|
237
247
|
/** Opens once anything slotted has had its first render. See `updated`. */
|
|
238
248
|
private openWhenSlotted;
|
|
239
249
|
/**
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { AriaForwardController, auditName, CommandController, customElement, drawDismiss, drawDismissGlyph, FocusScopeController, focusableElements, HelixElement, headingsIn, hostAria, internalsOf, lockScroll, MixinControllerOpen, OpenPhaseController, reflectElements, unlockScroll, words, } from '@fusion.dev/helix-core';
|
|
2
|
+
import { AriaForwardController, auditName, autofocusTarget, CommandController, coversPress, customElement, drawDismiss, drawDismissGlyph, FocusScopeController, focusAs, focusableElements, HelixElement, headingsIn, hostAria, internalsOf, lockScroll, MixinControllerOpen, OpenPhaseController, openingFocus, raiseAbove, reflectElements, refocusWithin, scrollHolders, unlockScroll, words, } from '@fusion.dev/helix-core';
|
|
3
3
|
import { html, nothing } from 'lit';
|
|
4
4
|
import { property } from 'lit/decorators.js';
|
|
5
5
|
import { wordsIn } from '../description.js';
|
|
6
6
|
import { closeOnDialogSubmit, commandValue } from '../form-method.js';
|
|
7
|
+
const holds = (outer, inner) => {
|
|
8
|
+
for (let node = inner; node;) {
|
|
9
|
+
if (node === outer) {
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
node = node instanceof ShadowRoot ? node.host : (node.parentNode ?? null);
|
|
13
|
+
}
|
|
14
|
+
return false;
|
|
15
|
+
};
|
|
7
16
|
let HelixHeadlessDialog = class HelixHeadlessDialog extends MixinControllerOpen(HelixElement) {
|
|
8
17
|
constructor() {
|
|
9
18
|
super(...arguments);
|
|
@@ -64,6 +73,9 @@ let HelixHeadlessDialog = class HelixHeadlessDialog extends MixinControllerOpen(
|
|
|
64
73
|
if (!panel || event.target !== panel) {
|
|
65
74
|
return;
|
|
66
75
|
}
|
|
76
|
+
if (coversPress(event)) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
67
79
|
const box = panel.getBoundingClientRect();
|
|
68
80
|
if (event.clientX >= box.left &&
|
|
69
81
|
event.clientX <= box.right &&
|
|
@@ -139,6 +151,7 @@ let HelixHeadlessDialog = class HelixHeadlessDialog extends MixinControllerOpen(
|
|
|
139
151
|
else {
|
|
140
152
|
unlockScroll(this);
|
|
141
153
|
}
|
|
154
|
+
this.toggleState('stacked', this.open && this.overAnother());
|
|
142
155
|
const dialog = this.dialog;
|
|
143
156
|
if (!dialog) {
|
|
144
157
|
return;
|
|
@@ -155,16 +168,34 @@ let HelixHeadlessDialog = class HelixHeadlessDialog extends MixinControllerOpen(
|
|
|
155
168
|
dialog.close();
|
|
156
169
|
}
|
|
157
170
|
}
|
|
171
|
+
overAnother() {
|
|
172
|
+
const holders = scrollHolders();
|
|
173
|
+
const at = holders.indexOf(this);
|
|
174
|
+
return holders.slice(0, at < 0 ? holders.length : at).some((one) => !holds(one, this));
|
|
175
|
+
}
|
|
158
176
|
async openWhenSlotted(dialog) {
|
|
177
|
+
const focusing = openingFocus();
|
|
159
178
|
await Promise.all([...this.children]
|
|
160
179
|
.map((one) => one.updateComplete)
|
|
161
180
|
.filter((one) => one instanceof Promise));
|
|
162
181
|
if (this.open && !dialog.open && this.isConnected) {
|
|
163
182
|
dialog.showModal();
|
|
183
|
+
raiseAbove();
|
|
184
|
+
const marked = await autofocusTarget(this);
|
|
185
|
+
if (marked && this.open && dialog.open) {
|
|
186
|
+
focusAs(marked, focusing);
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
164
189
|
const chose = this.matches(':focus-within') &&
|
|
165
190
|
!(this.renderRoot instanceof ShadowRoot && this.renderRoot.activeElement === dialog);
|
|
166
191
|
if (!chose) {
|
|
167
|
-
focusableElements(this)[0]
|
|
192
|
+
const first = focusableElements(this)[0];
|
|
193
|
+
if (first) {
|
|
194
|
+
focusAs(first, focusing);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
refocusWithin(this, focusing);
|
|
168
199
|
}
|
|
169
200
|
}
|
|
170
201
|
}
|
|
@@ -44,6 +44,9 @@ declare const HelixHeadlessDonutChart_base: typeof HelixElement & (new (...args:
|
|
|
44
44
|
* `empty-text`, "No readings", in the plot, and `loading` shows `loading-text`
|
|
45
45
|
* there until readings arrive. The `empty` and `loading` slots take markup in
|
|
46
46
|
* their place.
|
|
47
|
+
* When the readings did not load, set `error-text`, such as "The visits did
|
|
48
|
+
* not load": it stands in the plot in place of both, and the `error` slot
|
|
49
|
+
* takes a button that tries again, shown after the words.
|
|
47
50
|
*
|
|
48
51
|
* **Keyboard.** The plot is one tab stop.
|
|
49
52
|
*
|
|
@@ -63,6 +66,7 @@ declare const HelixHeadlessDonutChart_base: typeof HelixElement & (new (...args:
|
|
|
63
66
|
*
|
|
64
67
|
* @slot - Content in the middle of the ring, usually a total. It is read by screen readers, while the ring itself is hidden from them.
|
|
65
68
|
* @slot empty - Content shown in place of the ring when the table has no readings. Falls back to `empty-text`.
|
|
69
|
+
* @slot error - Content shown after `error-text` while it is set and there are no readings, such as a button that tries again.
|
|
66
70
|
* @slot loading - Content shown in place of the ring while `loading` is set and there are no readings yet. Falls back to `loading-text`.
|
|
67
71
|
*
|
|
68
72
|
* @event {HelixReadingChangeEvent} helix-reading-change - The slice shown moved, or was put away: `index` is the slice's row, or `-1` for none, with its `label` and the `pointerType` that moved it.
|
|
@@ -70,6 +74,7 @@ declare const HelixHeadlessDonutChart_base: typeof HelixElement & (new (...args:
|
|
|
70
74
|
*
|
|
71
75
|
* @csspart center - The middle of the ring, holding whatever is slotted.
|
|
72
76
|
* @csspart empty - The words in place of the ring when the table has no readings: the `empty` slot, falling back to `empty-text`. Not drawn while the table cannot be read yet, on the server and during hydration.
|
|
77
|
+
* @csspart error - The words in place of the ring while `error-text` is set and there are no readings, followed by the `error` slot. Announced as it appears.
|
|
73
78
|
* @csspart live - The readout: a polite live region that says the slice the keys moved to. Hide it visually.
|
|
74
79
|
* @csspart loading - The words in place of the ring while `loading` is set and there are no readings: the `loading` slot, falling back to `loading-text`.
|
|
75
80
|
* @csspart mark - The invisible point the tooltip is anchored to.
|
|
@@ -104,6 +109,7 @@ declare const HelixHeadlessDonutChart_base: typeof HelixElement & (new (...args:
|
|
|
104
109
|
*
|
|
105
110
|
* @cssstate active - While a slice is shown, under the pointer or the keys, with its tooltip open.
|
|
106
111
|
* @cssstate empty - While the `empty` part stands in place of the ring.
|
|
112
|
+
* @cssstate error - While the `error` part stands in place of the ring.
|
|
107
113
|
* @cssstate loading - While the `loading` part stands in place of the ring.
|
|
108
114
|
*/
|
|
109
115
|
export declare class HelixHeadlessDonutChart extends HelixHeadlessDonutChart_base {
|
|
@@ -244,6 +250,17 @@ export declare class HelixHeadlessDonutChart extends HelixHeadlessDonutChart_bas
|
|
|
244
250
|
* left out here too.
|
|
245
251
|
*/
|
|
246
252
|
protected renderSummary(shares: DonutShare[]): TemplateResult;
|
|
253
|
+
/**
|
|
254
|
+
* The plot with no readings to draw, the ring's track under the words.
|
|
255
|
+
*
|
|
256
|
+
* **The track stays**, so an empty donut is still a donut. The words alone
|
|
257
|
+
* stood in a blank square, which reads as a chart that did not draw, and the
|
|
258
|
+
* frame served before the readings arrive already drew the track: it went
|
|
259
|
+
* the moment the table turned out to be empty.
|
|
260
|
+
*/
|
|
261
|
+
protected renderEmpty(): TemplateResult;
|
|
262
|
+
/** The whole ring the slices are drawn on. */
|
|
263
|
+
private renderTrack;
|
|
247
264
|
/**
|
|
248
265
|
* The ring itself, behind a seam the styled tier can move.
|
|
249
266
|
*
|
|
@@ -271,7 +288,12 @@ export declare class HelixHeadlessDonutChart extends HelixHeadlessDonutChart_bas
|
|
|
271
288
|
* numbers rather than a measurement.
|
|
272
289
|
*/
|
|
273
290
|
private get frame();
|
|
274
|
-
/**
|
|
291
|
+
/**
|
|
292
|
+
* The seam each slice leaves at either end, as a length along the ring:
|
|
293
|
+
* half a `SEAM`, and none where one slice is the whole.
|
|
294
|
+
*/
|
|
295
|
+
private get seam();
|
|
296
|
+
/** One slice, as a dash the length of its share, less the seam at each end. */
|
|
275
297
|
protected renderSegment(share: DonutShare, index: number): TemplateResult;
|
|
276
298
|
/**
|
|
277
299
|
* The same slice again, as a shape with an inside.
|