@fusion.dev/helix-headless 0.241.2 → 0.242.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/chat/composer/chat-composer.d.ts +8 -1
- package/dist/chat/composer/chat-composer.js +15 -1
- package/dist/chat/message/chat-message.d.ts +12 -0
- package/dist/chat/message/chat-message.js +8 -0
- package/dist/chat/root/chat-root.d.ts +9 -0
- package/dist/chat/root/chat-root.js +13 -1
- package/dist/code-editor/root/code-editor-root.d.ts +1 -0
- package/dist/code-editor/root/code-editor-root.js +1 -1
- package/dist/column-manager/root/column-manager-root.d.ts +30 -2
- package/dist/column-manager/root/column-manager-root.js +73 -9
- package/dist/combobox/root/combobox-root.d.ts +8 -1
- package/dist/combobox/root/combobox-root.js +19 -2
- package/dist/data-table/binding.d.ts +22 -0
- package/dist/data-table/binding.js +52 -7
- package/dist/data-table/root/data-table-root.d.ts +34 -6
- package/dist/data-table/root/data-table-root.js +42 -7
- package/dist/date-input/root/date-input-root.d.ts +8 -1
- package/dist/date-input/root/date-input-root.js +19 -2
- package/dist/date-picker/root/date-picker-root.d.ts +5 -0
- package/dist/date-picker/root/date-picker-root.js +3 -0
- package/dist/editor/root/editor-root.d.ts +1 -0
- package/dist/editor/root/editor-root.js +1 -1
- package/dist/element-events.generated.js +2 -0
- package/dist/file-input/root/file-input-root.d.ts +8 -1
- package/dist/file-input/root/file-input-root.js +19 -2
- package/dist/filter-input/root/filter-input-root.d.ts +8 -1
- package/dist/filter-input/root/filter-input-root.js +13 -1
- package/dist/find/root/find-root.d.ts +1 -0
- package/dist/find/root/find-root.js +4 -4
- package/dist/hover-card/index.d.ts +1 -0
- package/dist/hover-card/index.js +1 -0
- package/dist/hover-card/root/hover-card-root.d.ts +122 -0
- package/dist/hover-card/root/hover-card-root.js +185 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/line-chart/root/line-chart-root.d.ts +7 -1
- package/dist/line-chart/root/line-chart-root.js +6 -0
- package/dist/list/root/list-root.d.ts +12 -1
- package/dist/list/root/list-root.js +11 -1
- package/dist/log/line/log-line.d.ts +11 -0
- package/dist/log/line/log-line.js +8 -0
- package/dist/log/root/log-root.d.ts +9 -0
- package/dist/log/root/log-root.js +13 -1
- package/dist/meter/root/meter-root.d.ts +12 -1
- package/dist/meter/root/meter-root.js +31 -2
- package/dist/navigation/root/navigation-root.d.ts +5 -1
- package/dist/navigation/root/navigation-root.js +13 -1
- package/dist/notifications/root/notifications-root.d.ts +10 -1
- package/dist/notifications/root/notifications-root.js +12 -1
- package/dist/object-inspector/root/object-inspector-root.js +6 -6
- package/dist/pagination/root/pagination-root.d.ts +16 -1
- package/dist/pagination/root/pagination-root.js +19 -1
- package/dist/popover/root/popover-root.d.ts +6 -0
- package/dist/popover/root/popover-root.js +2 -0
- package/dist/progress/root/progress-root.d.ts +11 -1
- package/dist/progress/root/progress-root.js +29 -2
- package/dist/sparkline/root/sparkline-root.d.ts +3 -1
- package/dist/sparkline/root/sparkline-root.js +8 -1
- package/dist/stat/root/stat-root.d.ts +22 -1
- package/dist/stat/root/stat-root.js +27 -4
- package/dist/table/root/table-root.d.ts +22 -5
- package/dist/table/root/table-root.js +13 -1
- package/dist/tabs/root/tabs-root.d.ts +6 -1
- package/dist/tabs/root/tabs-root.js +12 -1
- package/dist/tag/group/tag-group.d.ts +13 -1
- package/dist/tag/group/tag-group.js +12 -1
- package/dist/terminal/root/terminal-root.d.ts +1 -0
- package/dist/terminal/root/terminal-root.js +1 -1
- package/dist/theme-toggle/index.d.ts +1 -0
- package/dist/theme-toggle/index.js +1 -0
- package/dist/theme-toggle/root/theme-toggle-root.d.ts +98 -0
- package/dist/theme-toggle/root/theme-toggle-root.js +68 -0
- package/dist/time-input/root/time-input-root.d.ts +8 -1
- package/dist/time-input/root/time-input-root.js +19 -2
- package/dist/timeline/root/timeline-root.d.ts +10 -1
- package/dist/timeline/root/timeline-root.js +11 -1
- package/dist/toggle/group/toggle-group.d.ts +5 -1
- package/dist/toggle/group/toggle-group.js +12 -2
- package/dist/tree/root/tree-root.d.ts +13 -1
- package/dist/tree/root/tree-root.js +11 -1
- package/dist/trend/root/trend-root.d.ts +14 -1
- package/dist/trend/root/trend-root.js +20 -2
- package/examples.json +1 -1
- package/lint.json +1 -1
- package/package.json +5 -5
- package/types/jsx.d.ts +425 -10
- package/types/svelte.d.ts +2 -0
- package/types/vue.d.ts +249 -8
- package/types/words.d.ts +8 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var HelixHeadlessObjectInspector_1;
|
|
2
2
|
import { __decorate } from "tslib";
|
|
3
|
-
import { AriaForwardController, CopyController, countLabel, customElement, drawStatus, elementById, formatWords, HelixActivateEvent, HelixBeforeActivateEvent, HelixBeforeCloseEvent, HelixBeforeFilterEvent, HelixBeforeOpenEvent, HelixElement, HelixFilterEvent, inlineStep,
|
|
4
|
-
import { caretDown
|
|
3
|
+
import { AriaForwardController, CopyController, countLabel, customElement, drawStatus, elementById, formatWords, HelixActivateEvent, HelixBeforeActivateEvent, HelixBeforeCloseEvent, HelixBeforeFilterEvent, HelixBeforeOpenEvent, HelixElement, HelixFilterEvent, inlineStep, numberConverter, pageRows, requestChange, SCROLLER_RULE, SHUT_RULE, StatusController, scrollItemIntoView, scrollRoom, searchableById, Typeahead, treeArrow, VIRTUAL_RULE, VirtualizeController, words, wordsLocale, } from '@fusion.dev/helix-core';
|
|
4
|
+
import { caretDown } from '@fusion.dev/helix-icons';
|
|
5
5
|
import { html, nothing } from 'lit';
|
|
6
6
|
import { property, state } from 'lit/decorators.js';
|
|
7
7
|
import { repeat } from 'lit/directives/repeat.js';
|
|
@@ -179,7 +179,7 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
|
|
|
179
179
|
};
|
|
180
180
|
}
|
|
181
181
|
static { HelixHeadlessObjectInspector_1 = this; }
|
|
182
|
-
static { this.markRules = [SCROLLER_RULE, VIRTUAL_RULE,
|
|
182
|
+
static { this.markRules = [SCROLLER_RULE, VIRTUAL_RULE, SHUT_RULE]; }
|
|
183
183
|
static { this.words = 'helix-object-inspector'; }
|
|
184
184
|
get active() {
|
|
185
185
|
return this.wanted ?? this.rows[this.cursor]?.path ?? '';
|
|
@@ -465,12 +465,12 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
|
|
|
465
465
|
><div role="gridcell" style="display: contents">${row.branch
|
|
466
466
|
? html `<svg
|
|
467
467
|
part="toggle"
|
|
468
|
-
?data-
|
|
468
|
+
?data-shut=${!row.open}
|
|
469
469
|
fill="currentColor"
|
|
470
|
-
viewBox=${
|
|
470
|
+
viewBox=${caretDown.viewBox}
|
|
471
471
|
aria-hidden="true"
|
|
472
472
|
>
|
|
473
|
-
${unsafeSVG(
|
|
473
|
+
${unsafeSVG(caretDown.content)}
|
|
474
474
|
</svg>`
|
|
475
475
|
: nothing}${row.key === undefined ? nothing : html `<span part="key">${row.key}</span>: `}${this.drawValue(row)}</div>
|
|
476
476
|
</div>`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HelixElement } from '@fusion.dev/helix-core';
|
|
1
|
+
import { HelixElement, IndicatorController, LayoutMotionController } from '@fusion.dev/helix-core';
|
|
2
2
|
import { type CSSResultGroup, type PropertyValues, type TemplateResult } from 'lit';
|
|
3
3
|
/**
|
|
4
4
|
* @summary Controls for moving between the pages of a long set of results.
|
|
@@ -45,6 +45,7 @@ import { type CSSResultGroup, type PropertyValues, type TemplateResult } from 'l
|
|
|
45
45
|
*
|
|
46
46
|
* @csspart first - The control that jumps to the first page, under `ends`.
|
|
47
47
|
* @csspart gap - The control in place of hidden pages, which jumps into them.
|
|
48
|
+
* @csspart indicator - One mark that moves to the page you are on, inside the run. It carries the page's place and size as `--indicator-x`, `--indicator-y`, `--indicator-inline-size` and `--indicator-block-size`, and `data-placed` once it has been placed. Hidden until a stylesheet shows it, so the headless tier lays out as it did without it.
|
|
48
49
|
* @csspart item - One slot in the run, holding a page or a gap.
|
|
49
50
|
* @csspart last - The control that jumps to the last page, under `ends`.
|
|
50
51
|
* @csspart list - The run of pages.
|
|
@@ -408,6 +409,20 @@ export declare class HelixHeadlessPagination extends HelixElement {
|
|
|
408
409
|
protected renderPrevious(): TemplateResult;
|
|
409
410
|
protected renderNext(): TemplateResult;
|
|
410
411
|
protected renderLast(): TemplateResult;
|
|
412
|
+
/**
|
|
413
|
+
* The mark that moves to the page you are on, as the selection mark of
|
|
414
|
+
* `Toggle Group` and `Tabs` moves, so changing page is one mark traveling
|
|
415
|
+
* along the run. Measured against the run, which scrolls it with the pages.
|
|
416
|
+
*/
|
|
417
|
+
protected readonly indicator: IndicatorController;
|
|
418
|
+
/**
|
|
419
|
+
* Sliding the pages along the run as it moves, so going to the next page
|
|
420
|
+
* where the run keeps the current one in its middle reads as the numbers
|
|
421
|
+
* moving along under the mark, and a page coming into the run fades in.
|
|
422
|
+
* Timed by `--pagination-move-duration` and `--pagination-move-easing`,
|
|
423
|
+
* which this tier never sets, so it moves nothing until a stylesheet does.
|
|
424
|
+
*/
|
|
425
|
+
protected readonly motion: LayoutMotionController;
|
|
411
426
|
protected render(): TemplateResult;
|
|
412
427
|
/**
|
|
413
428
|
* The region that says the page moved.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { customElement, deepActiveElement, fillTemplate, formatNumbers, formatWords, HelixBeforeNavigateEvent, HelixElement, HelixNavigateEvent, hostAria, internalsOf, MIRROR_RULE, numberConverter, requestChange, words, wordsLocale, } from '@fusion.dev/helix-core';
|
|
2
|
+
import { customElement, deepActiveElement, fillTemplate, formatNumbers, formatWords, HelixBeforeNavigateEvent, HelixElement, HelixNavigateEvent, hostAria, IndicatorController, internalsOf, LayoutMotionController, MIRROR_RULE, numberConverter, requestChange, words, wordsLocale, } from '@fusion.dev/helix-core';
|
|
3
3
|
import { caretDoubleLeft, caretDoubleRight, caretLeft, caretRight, } from '@fusion.dev/helix-icons';
|
|
4
4
|
import { css, html, nothing, } from 'lit';
|
|
5
5
|
import { property, state } from 'lit/decorators.js';
|
|
@@ -44,6 +44,23 @@ let HelixHeadlessPagination = class HelixHeadlessPagination extends HelixElement
|
|
|
44
44
|
this.used = { control, gap };
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
|
+
this.indicator = new IndicatorController(this, {
|
|
48
|
+
active: () => this.renderRoot?.querySelector('[part~="page"][aria-current="page"]'),
|
|
49
|
+
indicator: () => this.partNamed('indicator'),
|
|
50
|
+
observe: () => [...(this.renderRoot?.querySelectorAll('[part~="page"]') ?? [])],
|
|
51
|
+
surface: () => this.partNamed('list'),
|
|
52
|
+
});
|
|
53
|
+
this.motion = new LayoutMotionController(this, {
|
|
54
|
+
items: () => [...(this.renderRoot?.querySelectorAll('[part="item"]') ?? [])],
|
|
55
|
+
timing: () => {
|
|
56
|
+
const style = getComputedStyle(this);
|
|
57
|
+
return {
|
|
58
|
+
duration: style.getPropertyValue('--pagination-move-duration'),
|
|
59
|
+
easing: style.getPropertyValue('--pagination-move-easing'),
|
|
60
|
+
};
|
|
61
|
+
},
|
|
62
|
+
watch: 'updates',
|
|
63
|
+
});
|
|
47
64
|
}
|
|
48
65
|
static { this.markRules = [MIRROR_RULE]; }
|
|
49
66
|
static { this.words = 'helix-pagination'; }
|
|
@@ -345,6 +362,7 @@ let HelixHeadlessPagination = class HelixHeadlessPagination extends HelixElement
|
|
|
345
362
|
}
|
|
346
363
|
return html `${this.ends ? this.renderFirst() : nothing}${this.renderPrevious()}
|
|
347
364
|
<ol part="list" role="list">
|
|
365
|
+
<li part="indicator" role="none" aria-hidden="true" hidden></li>
|
|
348
366
|
${repeat(this.slots, (slot) => typeof slot === 'number'
|
|
349
367
|
? slot
|
|
350
368
|
: slot.from < this.current
|
|
@@ -175,6 +175,12 @@ export declare class HelixHeadlessPopover extends HelixHeadlessPopover_base {
|
|
|
175
175
|
placement: Placement;
|
|
176
176
|
protected readonly phases: OpenPhaseController;
|
|
177
177
|
private readonly panel;
|
|
178
|
+
/**
|
|
179
|
+
* Heard each time the panel is placed, after its new place is written, for
|
|
180
|
+
* a subclass that moves between two places: the styled tier glides the
|
|
181
|
+
* panel when it moves to another side or alignment while open. Nothing here.
|
|
182
|
+
*/
|
|
183
|
+
protected placed(_placement: Placement): void;
|
|
178
184
|
/**
|
|
179
185
|
* The side of its trigger the panel last landed on, which names the arrow's
|
|
180
186
|
* second part. Undefined until the first placement, which the server never
|
|
@@ -43,6 +43,7 @@ let HelixHeadlessPopover = class HelixHeadlessPopover extends MixinControllerOpe
|
|
|
43
43
|
this.toggleState('placed-right', side === 'right');
|
|
44
44
|
this.toggleState('placed-top', side === 'top');
|
|
45
45
|
this.side = side;
|
|
46
|
+
this.placed(placement);
|
|
46
47
|
},
|
|
47
48
|
open: () => this.open,
|
|
48
49
|
padding: () => this.containerPadding,
|
|
@@ -105,6 +106,7 @@ let HelixHeadlessPopover = class HelixHeadlessPopover extends MixinControllerOpe
|
|
|
105
106
|
this.settled = false;
|
|
106
107
|
}
|
|
107
108
|
static { this.words = 'helix-popover'; }
|
|
109
|
+
placed(_placement) { }
|
|
108
110
|
get slotted() {
|
|
109
111
|
return (this.renderRoot
|
|
110
112
|
?.querySelector('slot:not([name])')
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HelixElement } from '@fusion.dev/helix-core';
|
|
1
|
+
import { CountController, HelixElement } from '@fusion.dev/helix-core';
|
|
2
2
|
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
3
|
/**
|
|
4
4
|
* @summary A bar or ring that shows how far along a task is.
|
|
@@ -49,6 +49,8 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
49
49
|
* @csspart track - The full length the work is measured against.
|
|
50
50
|
* @csspart value - The value shown beside the bar when `show-value` is set.
|
|
51
51
|
*
|
|
52
|
+
* @cssproperty --progress-count-duration - How long the number shown under `show-value` takes to count to a new value. Unset, it changes at once.
|
|
53
|
+
* @cssproperty --progress-count-easing - The curve the number shown counts along.
|
|
52
54
|
* @cssproperty --progress-fraction - The value as a fraction of the range, 0 to 1. Pinned to 1 while indeterminate.
|
|
53
55
|
*
|
|
54
56
|
* @cssstate complete - The value is at `max` and the bar is not indeterminate.
|
|
@@ -180,6 +182,12 @@ export declare class HelixHeadlessProgress extends HelixElement {
|
|
|
180
182
|
private get range();
|
|
181
183
|
/** What is done, as a fraction of the whole, between 0 and 1. */
|
|
182
184
|
get fraction(): number;
|
|
185
|
+
/**
|
|
186
|
+
* Counting the number shown under `show-value` from the one before, so it
|
|
187
|
+
* keeps pace with the fill. Only the shown number counts: the host's
|
|
188
|
+
* `aria-valuenow` and `aria-valuetext` hold the new reading throughout.
|
|
189
|
+
*/
|
|
190
|
+
protected readonly count: CountController;
|
|
183
191
|
protected willUpdate(changed: PropertyValues): void;
|
|
184
192
|
protected updated(changed: PropertyValues): void;
|
|
185
193
|
/**
|
|
@@ -188,6 +196,8 @@ export declare class HelixHeadlessProgress extends HelixElement {
|
|
|
188
196
|
* anything else.
|
|
189
197
|
*/
|
|
190
198
|
private get text();
|
|
199
|
+
/** The number shown under `show-value`: the count while one runs, and the reading at rest. */
|
|
200
|
+
private get shownText();
|
|
191
201
|
/** A label's words changed, so the name is written again. */
|
|
192
202
|
private readonly renamed;
|
|
193
203
|
/** The words on the bar changed, so the reading is said again and the state set. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { customElement, drawStatus, HelixCompleteEvent, HelixElement, hostAria, internalsOf, numberConverter, readingText, StatusController, slotFilled, slotNamed, slottedWords, words, wordsLocale, } from '@fusion.dev/helix-core';
|
|
2
|
+
import { CountController, customElement, drawStatus, HelixCompleteEvent, HelixElement, hostAria, internalsOf, numberConverter, readingText, StatusController, slotFilled, slotNamed, slottedWords, words, wordsLocale, } from '@fusion.dev/helix-core';
|
|
3
3
|
import { html } from 'lit';
|
|
4
4
|
import { property } from 'lit/decorators.js';
|
|
5
5
|
let HelixHeadlessProgress = class HelixHeadlessProgress extends HelixElement {
|
|
@@ -16,6 +16,15 @@ let HelixHeadlessProgress = class HelixHeadlessProgress extends HelixElement {
|
|
|
16
16
|
this.value = 0;
|
|
17
17
|
this.valueText = '';
|
|
18
18
|
this.status = new StatusController(this);
|
|
19
|
+
this.count = new CountController(this, {
|
|
20
|
+
timing: () => {
|
|
21
|
+
const style = getComputedStyle(this);
|
|
22
|
+
return {
|
|
23
|
+
duration: style.getPropertyValue('--progress-count-duration'),
|
|
24
|
+
easing: style.getPropertyValue('--progress-count-easing'),
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
});
|
|
19
28
|
this.renamed = () => {
|
|
20
29
|
this.requestUpdate();
|
|
21
30
|
};
|
|
@@ -38,6 +47,15 @@ let HelixHeadlessProgress = class HelixHeadlessProgress extends HelixElement {
|
|
|
38
47
|
}
|
|
39
48
|
willUpdate(changed) {
|
|
40
49
|
super.willUpdate(changed);
|
|
50
|
+
const was = changed.get('value');
|
|
51
|
+
if (changed.has('value') &&
|
|
52
|
+
this.hasUpdated &&
|
|
53
|
+
was !== undefined &&
|
|
54
|
+
this.showValue &&
|
|
55
|
+
!this.valueText &&
|
|
56
|
+
!this.indeterminate) {
|
|
57
|
+
this.count.start(was, this.value);
|
|
58
|
+
}
|
|
41
59
|
hostAria(internalsOf(this), {
|
|
42
60
|
label: slottedWords(this, ['label']) || this.label || this.fallbackLabel,
|
|
43
61
|
role: 'progressbar',
|
|
@@ -69,6 +87,15 @@ let HelixHeadlessProgress = class HelixHeadlessProgress extends HelixElement {
|
|
|
69
87
|
return (this.valueText ||
|
|
70
88
|
readingText(Math.min(Math.max(this.value, this.range.min), this.range.max), this.fraction, wordsLocale(this), this.formatOptions));
|
|
71
89
|
}
|
|
90
|
+
get shownText() {
|
|
91
|
+
const counting = this.count.counting;
|
|
92
|
+
if (counting === undefined) {
|
|
93
|
+
return this.text;
|
|
94
|
+
}
|
|
95
|
+
const { max, min } = this.range;
|
|
96
|
+
const held = Math.min(Math.max(counting, min), max);
|
|
97
|
+
return readingText(held, Math.min(Math.max((held - min) / (max - min), 0), 1) || 0, wordsLocale(this), this.formatOptions);
|
|
98
|
+
}
|
|
72
99
|
render() {
|
|
73
100
|
const fraction = this.indeterminate ? 1 : this.fraction;
|
|
74
101
|
const ring = html `<svg part="track" aria-hidden="true">
|
|
@@ -86,7 +113,7 @@ let HelixHeadlessProgress = class HelixHeadlessProgress extends HelixElement {
|
|
|
86
113
|
</div>`}
|
|
87
114
|
${this.showValue && !this.indeterminate
|
|
88
115
|
? html `<span part="value" aria-hidden="true"
|
|
89
|
-
>${this.
|
|
116
|
+
>${this.shownText}</span
|
|
90
117
|
>`
|
|
91
118
|
: ''}${drawStatus(this.status)}`;
|
|
92
119
|
}
|
|
@@ -86,7 +86,7 @@ import { nothing, type PropertyValues, type TemplateResult } from 'lit';
|
|
|
86
86
|
* @csspart range - The band between the two values of `range`, drawn behind the line.
|
|
87
87
|
* @csspart readout - The reading a pointer or a key rests on, as the table or `values` writes it, rendered only while there is one. Placed as `cursor` is.
|
|
88
88
|
* @csspart svg - The drawing, which takes focus to be read by key where there is a `label`.
|
|
89
|
-
* @csspart terminus - The mark on the last value.
|
|
89
|
+
* @csspart terminus - The mark on the last value. It carries `data-jumped` for the drawing where the line took a new shape at once, with a value more or fewer, so a stylesheet moving the mark can move it at once too.
|
|
90
90
|
* @csspart wash-end - The far stop of the area's gradient.
|
|
91
91
|
* @csspart wash-start - The stop of the area's gradient that meets the line.
|
|
92
92
|
*
|
|
@@ -263,6 +263,8 @@ export declare class HelixHeadlessSparkline extends HelixElement {
|
|
|
263
263
|
*/
|
|
264
264
|
values: string | readonly number[];
|
|
265
265
|
protected readonly source: SourceController;
|
|
266
|
+
/** How many values the line was last drawn with, so its terminus can tell a line that moves from one that jumps. */
|
|
267
|
+
private drawnCount;
|
|
266
268
|
/**
|
|
267
269
|
* Sends the reading's moves and presses as `helix-reading-change` and
|
|
268
270
|
* `helix-reading-press`, named by the table's row where there is one. Here
|
|
@@ -123,6 +123,8 @@ let HelixHeadlessSparkline = class HelixHeadlessSparkline extends HelixElement {
|
|
|
123
123
|
])
|
|
124
124
|
: [];
|
|
125
125
|
const lastAt = slots.findLastIndex((value) => value !== undefined);
|
|
126
|
+
const jumped = this.drawnCount !== undefined && this.drawnCount !== points.length;
|
|
127
|
+
this.drawnCount = points.length;
|
|
126
128
|
const end = points.length < 2
|
|
127
129
|
? undefined
|
|
128
130
|
: `--chart-terminus-x: ${(x(lastAt) / PLOT_WIDTH) * 100}%; --chart-terminus-y: ${(y(slots[lastAt]) / STRIP_HEIGHT) * 100}%`;
|
|
@@ -175,7 +177,12 @@ let HelixHeadlessSparkline = class HelixHeadlessSparkline extends HelixElement {
|
|
|
175
177
|
</svg>
|
|
176
178
|
${points.length === 0 ? this.renderStatus() : nothing}${points.length < 2 || this.plot === 'bar'
|
|
177
179
|
? nothing
|
|
178
|
-
: html `<span
|
|
180
|
+
: html `<span
|
|
181
|
+
aria-hidden="true"
|
|
182
|
+
?data-jumped=${jumped}
|
|
183
|
+
part="terminus"
|
|
184
|
+
style=${end ?? nothing}
|
|
185
|
+
></span>`}${this.renderLone(points.length < 2 ? undefined : series, at)}${this.renderMarks(slots, at)}${this.renderReading(slots, at)}${named && count > 0 ? this.renderLive(slots) : nothing}${overview === ''
|
|
179
186
|
? nothing
|
|
180
187
|
: html `<span hidden id="sparkline-overview" part="overview">${overview}</span>`}`;
|
|
181
188
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HelixElement } from '@fusion.dev/helix-core';
|
|
1
|
+
import { CountController, HelixElement } from '@fusion.dev/helix-core';
|
|
2
2
|
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
3
|
/**
|
|
4
4
|
* @summary One measurement, with a label that names what it measures.
|
|
@@ -31,6 +31,14 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
31
31
|
* the stat with those breaks, and the slot is hidden while it is. A figure
|
|
32
32
|
* holding an element is shown as it is.
|
|
33
33
|
*
|
|
34
|
+
* **A new `value` counts to the new number** from the one before, so a figure
|
|
35
|
+
* that a dashboard refreshes reads as having moved. A screen reader reads only
|
|
36
|
+
* the new number. The stat times the count from `--stat-count-duration` and
|
|
37
|
+
* `--stat-count-easing`, which the styled tier sets from the duration and
|
|
38
|
+
* easing tokens. Here neither is set, so the figure changes at once until you
|
|
39
|
+
* set them, and under reduced motion it always does. A slotted figure changes
|
|
40
|
+
* at once.
|
|
41
|
+
*
|
|
34
42
|
* **Each slot is a part of the same name**, and `value` for the figure, so a
|
|
35
43
|
* page reaches the label, the unit and the trend from outside. A slot draws no
|
|
36
44
|
* box, so a part passes inherited properties to what is slotted. **The stat
|
|
@@ -54,6 +62,9 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
54
62
|
* @csspart unit - The slot the unit arrives through, drawing no box, as `value` does.
|
|
55
63
|
* @csspart value - The slot the value is written in, or the figure the stat writes from `value` or from slotted text. A slot draws no box, so it takes the inherited properties, such as color and font, and passes them to the value.
|
|
56
64
|
*
|
|
65
|
+
* @cssproperty --stat-count-duration - How long a new `value` takes to count from the one before. Unset, the figure changes at once.
|
|
66
|
+
* @cssproperty --stat-count-easing - The curve a new `value` counts along.
|
|
67
|
+
*
|
|
57
68
|
* @cssstate has-label - Something is slotted into `label`.
|
|
58
69
|
* @cssstate has-trend - Something is slotted into `trend`.
|
|
59
70
|
* @cssstate has-unit - Something is slotted into `unit`.
|
|
@@ -62,6 +73,7 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
62
73
|
* @cssstate stepped-twice - The figure is set two steps smaller, because one step smaller it still does not fit. `stepped` holds as well.
|
|
63
74
|
*/
|
|
64
75
|
export declare class HelixHeadlessStat extends HelixElement {
|
|
76
|
+
protected static markRules: string[];
|
|
65
77
|
/**
|
|
66
78
|
* Which way the label and the value are arranged.
|
|
67
79
|
*
|
|
@@ -113,6 +125,8 @@ export declare class HelixHeadlessStat extends HelixElement {
|
|
|
113
125
|
* Absent leaves the figure to the slot.
|
|
114
126
|
*/
|
|
115
127
|
value?: number;
|
|
128
|
+
/** Counting a new `value` from the one before. */
|
|
129
|
+
protected readonly count: CountController;
|
|
116
130
|
protected willUpdate(changed: PropertyValues): void;
|
|
117
131
|
protected firstUpdated(changed: PropertyValues): void;
|
|
118
132
|
/** Watches the stat's own width, to step the figure down where it does not fit. */
|
|
@@ -171,6 +185,13 @@ export declare class HelixHeadlessStat extends HelixElement {
|
|
|
171
185
|
/** Says which pieces the stat holds, one call apiece so each pairs with its `@cssstate`. */
|
|
172
186
|
private readonly readPieces;
|
|
173
187
|
protected render(): TemplateResult;
|
|
188
|
+
/**
|
|
189
|
+
* The figure written from `value`. **While it counts, the passing numbers
|
|
190
|
+
* are hidden from screen readers** and the number it is counting to is read
|
|
191
|
+
* in their place, so a reader who reaches the stat mid-count hears the new
|
|
192
|
+
* figure and not one of the numbers on the way.
|
|
193
|
+
*/
|
|
194
|
+
private drawFigure;
|
|
174
195
|
}
|
|
175
196
|
declare global {
|
|
176
197
|
interface HTMLElementTagNameMap {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { customElement, formatNumber, formatNumberParts, HelixElement, hostAria, internalsOf, numberConverter, reportRuntime, slotFilled, slottedWords, wordsLocale, } from '@fusion.dev/helix-core';
|
|
2
|
+
import { CountController, customElement, formatNumber, formatNumberParts, HelixElement, hostAria, internalsOf, numberConverter, reportRuntime, SPOKEN_RULE, slotFilled, slottedWords, wordsLocale, } from '@fusion.dev/helix-core';
|
|
3
3
|
import { html, nothing } from 'lit';
|
|
4
4
|
import { property, state } from 'lit/decorators.js';
|
|
5
5
|
const SEPARATORS = new Set([',', '.', "'", '\u2019', ' ', '\u00a0', '\u2009', '\u202f']);
|
|
@@ -8,6 +8,15 @@ let HelixHeadlessStat = class HelixHeadlessStat extends HelixElement {
|
|
|
8
8
|
constructor() {
|
|
9
9
|
super(...arguments);
|
|
10
10
|
this.locale = '';
|
|
11
|
+
this.count = new CountController(this, {
|
|
12
|
+
timing: () => {
|
|
13
|
+
const style = getComputedStyle(this);
|
|
14
|
+
return {
|
|
15
|
+
duration: style.getPropertyValue('--stat-count-duration'),
|
|
16
|
+
easing: style.getPropertyValue('--stat-count-easing'),
|
|
17
|
+
};
|
|
18
|
+
},
|
|
19
|
+
});
|
|
11
20
|
this.slottedRuns = [];
|
|
12
21
|
this.figureRead = false;
|
|
13
22
|
this.refit = () => this.fit();
|
|
@@ -52,8 +61,13 @@ let HelixHeadlessStat = class HelixHeadlessStat extends HelixElement {
|
|
|
52
61
|
this.toggleState('has-trend', filled('trend'));
|
|
53
62
|
};
|
|
54
63
|
}
|
|
64
|
+
static { this.markRules = [SPOKEN_RULE]; }
|
|
55
65
|
willUpdate(changed) {
|
|
56
66
|
super.willUpdate(changed);
|
|
67
|
+
const was = changed.get('value');
|
|
68
|
+
if (changed.has('value') && this.hasUpdated && was !== undefined) {
|
|
69
|
+
this.count.start(was, this.value);
|
|
70
|
+
}
|
|
57
71
|
if (this.childrenKnown && (!this.figureRead || changed.has('locale'))) {
|
|
58
72
|
this.figureRead = true;
|
|
59
73
|
this.readFigure();
|
|
@@ -152,7 +166,9 @@ let HelixHeadlessStat = class HelixHeadlessStat extends HelixElement {
|
|
|
152
166
|
updated(changed) {
|
|
153
167
|
super.updated(changed);
|
|
154
168
|
this.readPieces();
|
|
155
|
-
this.
|
|
169
|
+
if (this.count.counting === undefined) {
|
|
170
|
+
this.fit();
|
|
171
|
+
}
|
|
156
172
|
const given = this.direction;
|
|
157
173
|
if (changed.has('direction') && (given === 'up' || given === 'down' || given === 'neutral')) {
|
|
158
174
|
reportRuntime({
|
|
@@ -165,7 +181,7 @@ let HelixHeadlessStat = class HelixHeadlessStat extends HelixElement {
|
|
|
165
181
|
}
|
|
166
182
|
}
|
|
167
183
|
render() {
|
|
168
|
-
const value = this.value;
|
|
184
|
+
const value = this.count.counting ?? this.value;
|
|
169
185
|
const figure = value === undefined || !Number.isFinite(value)
|
|
170
186
|
? ''
|
|
171
187
|
: formatNumber(value, wordsLocale(this), this.formatOptions);
|
|
@@ -187,10 +203,17 @@ let HelixHeadlessStat = class HelixHeadlessStat extends HelixElement {
|
|
|
187
203
|
}
|
|
188
204
|
const written = figure !== '' || slotted.length > 0;
|
|
189
205
|
return html `<slot name="label" part="label" @slotchange=${() => this.requestUpdate()}></slot>
|
|
190
|
-
${figure === '' ? html `${written ? html `<span part="value">${pieces}</span>` : nothing}<slot part=${written ? nothing : 'value'} ?hidden=${written} @slotchange=${this.readFigure}></slot>` :
|
|
206
|
+
${figure === '' ? html `${written ? html `<span part="value">${pieces}</span>` : nothing}<slot part=${written ? nothing : 'value'} ?hidden=${written} @slotchange=${this.readFigure}></slot>` : this.drawFigure(pieces)}
|
|
191
207
|
<slot name="unit" part="unit" @slotchange=${this.readPieces}></slot>
|
|
192
208
|
<slot name="trend" part="trend" @slotchange=${this.readPieces}></slot>`;
|
|
193
209
|
}
|
|
210
|
+
drawFigure(pieces) {
|
|
211
|
+
const to = this.value;
|
|
212
|
+
if (this.count.counting === undefined || to === undefined) {
|
|
213
|
+
return html `<span part="value">${pieces}</span>`;
|
|
214
|
+
}
|
|
215
|
+
return html `<span part="value" aria-hidden="true">${pieces}</span><span data-spoken>${formatNumber(to, wordsLocale(this), this.formatOptions)}</span>`;
|
|
216
|
+
}
|
|
194
217
|
};
|
|
195
218
|
__decorate([
|
|
196
219
|
property({ reflect: true })
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AriaForwardController, HelixElement } from '@fusion.dev/helix-core';
|
|
1
|
+
import { AriaForwardController, HelixElement, LayoutMotionController } from '@fusion.dev/helix-core';
|
|
2
2
|
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
3
|
import '../../checkbox/index.js';
|
|
4
4
|
import { type HelixHeadlessTableColumn } from '../column/table-column.js';
|
|
@@ -141,10 +141,18 @@ declare const HelixHeadlessTable_base: (new (...args: any[]) => import("@fusion.
|
|
|
141
141
|
* loading lines, the live region says it, and the table takes the `error`
|
|
142
142
|
* state. Clear it once you try again.
|
|
143
143
|
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
144
|
+
* **Rows slide to their places.** When the table sorts, or you add, remove or
|
|
145
|
+
* reorder rows, each one moves from where it was drawn to where it is now, its
|
|
146
|
+
* cells together, and a row you add fades in. The table times it from
|
|
147
|
+
* `--table-move-duration` and `--table-move-easing`, which the styled tier
|
|
148
|
+
* sets from the duration and easing tokens. Here neither is set, so nothing
|
|
149
|
+
* moves until you set them. Under reduced motion nothing moves, whatever they
|
|
150
|
+
* say.
|
|
151
|
+
*
|
|
152
|
+
* The other CSS custom properties listed for this component are written by it
|
|
153
|
+
* and read by the stylesheet that draws it. Do not set them. Each holds a
|
|
154
|
+
* number the component computes and CSS cannot, so the stylesheet can draw the
|
|
155
|
+
* table without measuring anything.
|
|
148
156
|
*
|
|
149
157
|
* @since 0.1.0
|
|
150
158
|
* @status stable
|
|
@@ -195,6 +203,8 @@ declare const HelixHeadlessTable_base: (new (...args: any[]) => import("@fusion.
|
|
|
195
203
|
* @csspart select-all - The heading that holds the checkbox that selects every row.
|
|
196
204
|
* @csspart table - The grid.
|
|
197
205
|
*
|
|
206
|
+
* @cssproperty --table-move-duration - How long a row takes to slide to its new place, or to fade in. Unset, nothing moves.
|
|
207
|
+
* @cssproperty --table-move-easing - The curve a row slides and fades in along.
|
|
198
208
|
* @cssproperty --table-template - The column track list the table works out from its columns. The component writes it inline on the element that reads it, so setting it has no effect. Set `columns` to change the tracks.
|
|
199
209
|
*
|
|
200
210
|
* @cssstate empty - While there are no rows and none are loading.
|
|
@@ -472,6 +482,13 @@ export declare class HelixHeadlessTable extends HelixHeadlessTable_base {
|
|
|
472
482
|
protected get hasRows(): boolean;
|
|
473
483
|
/** The rows the body slot was last given, under `windowed`. */
|
|
474
484
|
private drawnRows;
|
|
485
|
+
/**
|
|
486
|
+
* Sliding each row to its new place when the table sorts or the page changes
|
|
487
|
+
* its rows. Looked for after each update, because the table draws its rows
|
|
488
|
+
* in order by assigning them, and in the table's own box, which scrolls
|
|
489
|
+
* sideways.
|
|
490
|
+
*/
|
|
491
|
+
protected readonly motion: LayoutMotionController;
|
|
475
492
|
/**
|
|
476
493
|
* The rows drawn now, each by its first cell, with its place among the
|
|
477
494
|
* rows. A row is `display: contents` and has no box, and a cell is a grid
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { AriaForwardController, anchorAt, assignSlots, auditName, commaList, customElement, cycle, everyState, followLink, format, formatWords, HelixBeforeSelectEvent, HelixBeforeSortEvent, HelixElement, HelixExpandEvent, HelixLoadMoreEvent, HelixSelectEvent, HelixSortEvent, inRowOrder, MixinCollection, onAndroid, parse, ReorderController, rangeAdd, reflectElements, requestChange, scrollingAncestor, sort, toggleEvery, treeArrow, VIRTUAL_RULE, VirtualizeController, whenHydrated, words, } from '@fusion.dev/helix-core';
|
|
2
|
+
import { AriaForwardController, anchorAt, assignSlots, auditName, commaList, customElement, cycle, everyState, followLink, format, formatWords, HelixBeforeSelectEvent, HelixBeforeSortEvent, HelixElement, HelixExpandEvent, HelixLoadMoreEvent, HelixSelectEvent, HelixSortEvent, inRowOrder, LayoutMotionController, MixinCollection, onAndroid, parse, ReorderController, rangeAdd, reflectElements, requestChange, scrollingAncestor, sort, toggleEvery, treeArrow, VIRTUAL_RULE, VirtualizeController, whenHydrated, words, } from '@fusion.dev/helix-core';
|
|
3
3
|
import { nothing } from 'lit';
|
|
4
4
|
import { property, state } from 'lit/decorators.js';
|
|
5
5
|
import { html } from 'lit/static-html.js';
|
|
@@ -89,6 +89,18 @@ let HelixHeadlessTable = class HelixHeadlessTable extends MixinCollection(HelixE
|
|
|
89
89
|
});
|
|
90
90
|
this.arrangedCount = 0;
|
|
91
91
|
this.drawnRows = [];
|
|
92
|
+
this.motion = new LayoutMotionController(this, {
|
|
93
|
+
items: () => (this.windowed ? this.drawnRows : this.arrangedRows).filter((row) => row instanceof HTMLElement),
|
|
94
|
+
scroller: () => this,
|
|
95
|
+
timing: () => {
|
|
96
|
+
const style = getComputedStyle(this);
|
|
97
|
+
return {
|
|
98
|
+
duration: style.getPropertyValue('--table-move-duration'),
|
|
99
|
+
easing: style.getPropertyValue('--table-move-easing'),
|
|
100
|
+
};
|
|
101
|
+
},
|
|
102
|
+
watch: 'updates',
|
|
103
|
+
});
|
|
92
104
|
this.reorder = new ReorderController(this, {
|
|
93
105
|
axis: 'block',
|
|
94
106
|
box: (key) => this.gripOf(this.rowFor(key))?.getBoundingClientRect(),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AriaForwardController, HelixElement, KeyboardNavigationController } from '@fusion.dev/helix-core';
|
|
1
|
+
import { AriaForwardController, HelixElement, HoverMarkController, KeyboardNavigationController } from '@fusion.dev/helix-core';
|
|
2
2
|
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
3
|
declare const HelixHeadlessTabs_base: (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerActiveInterface) & typeof HelixElement;
|
|
4
4
|
/**
|
|
@@ -85,6 +85,7 @@ declare const HelixHeadlessTabs_base: (new (...args: any[]) => import("@fusion.d
|
|
|
85
85
|
* @event {HelixBeforeActivateEvent} helix-before-activate - Fired before the active tab changes, and cancelable. Canceling it is the only way to block a change.
|
|
86
86
|
* @event {HelixBeforeSelectEvent} helix-before-select - Fired when a tab is chosen. The tab sends it and the root handles it, so you can listen on the root. Cancelable: canceling it stops the change and leaves the decision to you.
|
|
87
87
|
*
|
|
88
|
+
* @csspart highlight - The wash under the pointer, which glides from tab to tab while a mouse or pen moves along them. It carries the tab's place and size as the indicator does, `data-placed` while it is over one, and `data-gliding` from the frame after it arrives. Hidden until a stylesheet shows it, so the headless tier lays out as it did without it.
|
|
88
89
|
* @csspart indicator - The marker that moves to the selected tab. It carries the selected tab's
|
|
89
90
|
* place and size as `--indicator-x`, `--indicator-y`, `--indicator-inline-size` and
|
|
90
91
|
* `--indicator-block-size`, and `data-placed` once it has been placed, for a mark you draw
|
|
@@ -95,6 +96,8 @@ declare const HelixHeadlessTabs_base: (new (...args: any[]) => import("@fusion.d
|
|
|
95
96
|
* @csspart scroll-start - The button that scrolls the strip toward its start, shown under `scroll-controls` while there is more that way.
|
|
96
97
|
* @csspart scroll-start-mark - The glyph on that button, where none is slotted.
|
|
97
98
|
* @csspart tabs - The tab list.
|
|
99
|
+
*
|
|
100
|
+
* @cssstate gliding - While a mouse or pen is over a tab, so the highlight draws the hover wash in place of each tab's own.
|
|
98
101
|
*/
|
|
99
102
|
export declare class HelixHeadlessTabs extends HelixHeadlessTabs_base {
|
|
100
103
|
protected static markRules: string[];
|
|
@@ -105,6 +108,8 @@ export declare class HelixHeadlessTabs extends HelixHeadlessTabs_base {
|
|
|
105
108
|
static words: string;
|
|
106
109
|
protected readonly keys: KeyboardNavigationController;
|
|
107
110
|
private readonly indicator;
|
|
111
|
+
/** Moves the hover wash to whichever tab is under the pointer. A disabled tab takes none. */
|
|
112
|
+
protected readonly highlight: HoverMarkController;
|
|
108
113
|
/** Carries a host `aria-label` and `aria-labelledby` to the tab list. */
|
|
109
114
|
protected readonly aria: AriaForwardController;
|
|
110
115
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { AriaForwardController, auditName, customElement, deepActiveElement, glyphPath, HelixActivateEvent, HelixElement, IndicatorController, isRtl, KeyboardNavigationController, MIRROR_RULE, MixinControllerActive, onUnlessFalse, scrollWithin, whenHydrated, } from '@fusion.dev/helix-core';
|
|
2
|
+
import { AriaForwardController, auditName, customElement, deepActiveElement, glyphPath, HelixActivateEvent, HelixElement, HoverMarkController, IndicatorController, isRtl, KeyboardNavigationController, MIRROR_RULE, MixinControllerActive, onUnlessFalse, scrollWithin, whenHydrated, } from '@fusion.dev/helix-core';
|
|
3
3
|
import { caretDown, caretLeft, caretRight, caretUp } from '@fusion.dev/helix-icons';
|
|
4
4
|
import { html, nothing } from 'lit';
|
|
5
5
|
import { property, state } from 'lit/decorators.js';
|
|
@@ -19,6 +19,16 @@ let HelixHeadlessTabs = class HelixHeadlessTabs extends MixinControllerActive(He
|
|
|
19
19
|
observe: () => this.tabs,
|
|
20
20
|
surface: () => this.partNamed('tabs'),
|
|
21
21
|
});
|
|
22
|
+
this.highlight = new HoverMarkController(this, {
|
|
23
|
+
gliding: (on) => this.toggleState('gliding', on),
|
|
24
|
+
item: (under) => {
|
|
25
|
+
const tabs = this.tabs;
|
|
26
|
+
return under.find((one) => one instanceof HelixHeadlessTab && tabs.includes(one) && !one.disabled);
|
|
27
|
+
},
|
|
28
|
+
mark: () => this.partNamed('highlight'),
|
|
29
|
+
observe: () => this.tabs,
|
|
30
|
+
surface: () => this.partNamed('tabs'),
|
|
31
|
+
});
|
|
22
32
|
this.aria = new AriaForwardController(this, {
|
|
23
33
|
label: true,
|
|
24
34
|
target: () => this.partNamed('tabs'),
|
|
@@ -238,6 +248,7 @@ let HelixHeadlessTabs = class HelixHeadlessTabs extends MixinControllerActive(He
|
|
|
238
248
|
@scroll=${this.scrollControls ? this.measure : nothing}
|
|
239
249
|
>
|
|
240
250
|
${this.renderScroll(-1)}
|
|
251
|
+
<span part="highlight" aria-hidden="true" hidden></span>
|
|
241
252
|
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
242
253
|
<span part="indicator" aria-hidden="true"><slot name="indicator"></slot></span>
|
|
243
254
|
${this.renderScroll(1)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HelixElement, KeyboardNavigationController, type SelectionMode, UpgradeController } from '@fusion.dev/helix-core';
|
|
1
|
+
import { HelixElement, KeyboardNavigationController, LayoutMotionController, type SelectionMode, UpgradeController } from '@fusion.dev/helix-core';
|
|
2
2
|
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
3
|
import { HelixHeadlessTag } from '../root/tag-root.js';
|
|
4
4
|
/** How many tags a group lets a reader select: core's `SelectionMode`. */
|
|
@@ -41,6 +41,13 @@ export type TagSelectionMode = SelectionMode;
|
|
|
41
41
|
* Where only disabled tags are left, the first of them holds the tab stop and
|
|
42
42
|
* takes focus, so the reader stays in the set.
|
|
43
43
|
*
|
|
44
|
+
* **Tags slide to their places.** When you remove a tag, the ones after it
|
|
45
|
+
* close the gap, across a wrap too, and a tag you add fades in. The group
|
|
46
|
+
* times it from `--tag-group-move-duration` and `--tag-group-move-easing`,
|
|
47
|
+
* which the styled tier sets from the duration and easing tokens. Here neither
|
|
48
|
+
* is set, so nothing moves until you set them. Under reduced motion nothing
|
|
49
|
+
* moves, whatever they say.
|
|
50
|
+
*
|
|
44
51
|
* **Typing new tags.** A field where people type tags and press Enter to add
|
|
45
52
|
* each one is Combobox with `multiple` and `allows-custom-value`, or
|
|
46
53
|
* `creatable` to ask first with `helix-create`. It draws each value as a tag,
|
|
@@ -60,6 +67,9 @@ export type TagSelectionMode = SelectionMode;
|
|
|
60
67
|
* @event {HelixDismissEvent} helix-dismiss - A tag's remove button was pressed, or Delete or Backspace on the focused tag. Bubbles from that tag, which is its `target`; remove the tag in response. Cancelable.
|
|
61
68
|
*
|
|
62
69
|
* @csspart empty - Holds the `empty` slot while the group has no tags, rendered only then. Takes focus when the last tag is removed.
|
|
70
|
+
*
|
|
71
|
+
* @cssproperty --tag-group-move-duration - How long a tag takes to slide to its new place, or to fade in. Unset, nothing moves.
|
|
72
|
+
* @cssproperty --tag-group-move-easing - The curve a tag slides and fades in along.
|
|
63
73
|
*/
|
|
64
74
|
export declare class HelixHeadlessTagGroup extends HelixElement {
|
|
65
75
|
/**
|
|
@@ -133,6 +143,8 @@ export declare class HelixHeadlessTagGroup extends HelixElement {
|
|
|
133
143
|
* an array of values is joined.
|
|
134
144
|
*/
|
|
135
145
|
private get written();
|
|
146
|
+
/** Sliding each tag to its new place when the page adds, removes or hides tags. */
|
|
147
|
+
protected readonly motion: LayoutMotionController;
|
|
136
148
|
/** The tags the group holds, in order. */
|
|
137
149
|
get tags(): HelixHeadlessTag[];
|
|
138
150
|
/** The tags a key can land on, which are the ones that are not disabled. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { commaList, customElement, deepActiveElement, deepContains, focusItemOf, HelixElement, hostAria, internalsOf, KeyboardNavigationController, pressedValue, prunedValue, requestValue, rovingStop, slottedWords, typeaheadByWords, UpgradeController, whenHydrated, words, } from '@fusion.dev/helix-core';
|
|
2
|
+
import { commaList, customElement, deepActiveElement, deepContains, focusItemOf, HelixElement, hostAria, internalsOf, KeyboardNavigationController, LayoutMotionController, pressedValue, prunedValue, requestValue, rovingStop, slottedWords, typeaheadByWords, UpgradeController, whenHydrated, words, } from '@fusion.dev/helix-core';
|
|
3
3
|
import { html, nothing } from 'lit';
|
|
4
4
|
import { property } from 'lit/decorators.js';
|
|
5
5
|
import { HelixHeadlessTag } from '../root/tag-root.js';
|
|
@@ -18,6 +18,17 @@ let HelixHeadlessTagGroup = class HelixHeadlessTagGroup extends HelixElement {
|
|
|
18
18
|
typeahead: typeaheadByWords(),
|
|
19
19
|
wrap: false,
|
|
20
20
|
});
|
|
21
|
+
this.motion = new LayoutMotionController(this, {
|
|
22
|
+
items: () => this.tags,
|
|
23
|
+
leaving: () => this.renderRoot,
|
|
24
|
+
timing: () => {
|
|
25
|
+
const style = getComputedStyle(this);
|
|
26
|
+
return {
|
|
27
|
+
duration: style.getPropertyValue('--tag-group-move-duration'),
|
|
28
|
+
easing: style.getPropertyValue('--tag-group-move-easing'),
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
});
|
|
21
32
|
this.handleKeydown = (event) => {
|
|
22
33
|
const tag = this.tagOf(event);
|
|
23
34
|
if (!tag || tag.disabled || event.altKey) {
|
|
@@ -237,6 +237,7 @@ export interface TerminalSink {
|
|
|
237
237
|
* @csspart find-replace-toggle - The button that shows the find bar's replace row, which a terminal does not draw.
|
|
238
238
|
* @csspart find-replace-toggle-button - The replace toggle's inner button.
|
|
239
239
|
* @csspart find-replace-toggle-live - The replace toggle's live region, which speaks while the button is pending.
|
|
240
|
+
* @csspart find-replace-toggle-mark - The caret on the find bar's replace toggle, which points down while the replace row shows and along the line while it is shut.
|
|
240
241
|
* @csspart find-replace-toggle-spinner - The ring the replace toggle turns while it is pending.
|
|
241
242
|
* @csspart find-replace-toggle-text - The box the replace toggle's icon sits in.
|
|
242
243
|
* @csspart find-toggle - The button in the header that opens and closes the find bar. Expanded while it is open.
|