@fusion.dev/helix-headless 0.144.0 → 0.145.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/custom-elements.json +8312 -881
- package/dist/accordion/item/accordion-item.d.ts +48 -12
- package/dist/accordion/item/accordion-item.js +26 -5
- package/dist/accordion/root/accordion-root.d.ts +6 -0
- package/dist/accordion/root/accordion-root.js +7 -1
- package/dist/announcement/root/announcement-root.d.ts +21 -1
- package/dist/announcement/root/announcement-root.js +36 -1
- package/dist/app-header/root/app-header-root.d.ts +7 -0
- package/dist/app-header/root/app-header-root.js +5 -1
- package/dist/app-header/sectioning.d.ts +7 -0
- package/dist/app-header/sectioning.js +26 -0
- package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +32 -1
- package/dist/breadcrumbs/root/breadcrumbs-root.js +25 -2
- package/dist/canvas/root/canvas-root.d.ts +38 -3
- package/dist/canvas/root/canvas-root.js +121 -40
- package/dist/carousel/root/carousel-root.d.ts +90 -0
- package/dist/carousel/root/carousel-root.js +134 -12
- package/dist/chat/composer/chat-composer.d.ts +38 -6
- package/dist/chat/composer/chat-composer.js +42 -9
- package/dist/chat/message/chat-message.d.ts +32 -1
- package/dist/chat/message/chat-message.js +25 -9
- package/dist/chat/naming.d.ts +22 -0
- package/dist/chat/naming.js +12 -0
- package/dist/chat/relative-clock.d.ts +39 -0
- package/dist/chat/relative-clock.js +31 -0
- package/dist/chat/root/chat-root.d.ts +36 -0
- package/dist/chat/root/chat-root.js +24 -1
- package/dist/code-block/root/code-block-root.d.ts +8 -1
- package/dist/code-block/root/code-block-root.js +5 -5
- package/dist/copy-button/root/copy-button-root.d.ts +21 -1
- package/dist/copy-button/root/copy-button-root.js +2 -2
- package/dist/data-table/root/data-table-root.d.ts +150 -2
- package/dist/data-table/root/data-table-root.js +303 -29
- package/dist/data-table/tree.d.ts +40 -0
- package/dist/data-table/tree.js +55 -0
- package/dist/description-list/item/description-list-item.d.ts +17 -2
- package/dist/description-list/item/description-list-item.js +15 -2
- package/dist/description-list/root/description-list-root.d.ts +27 -1
- package/dist/description-list/root/description-list-root.js +26 -1
- package/dist/drilldown/item/drilldown-item.d.ts +11 -6
- package/dist/drilldown/item/drilldown-item.js +8 -5
- package/dist/drilldown/root/drilldown-root.d.ts +11 -0
- package/dist/drilldown/root/drilldown-root.js +8 -3
- package/dist/element-events.generated.js +53 -8
- package/dist/filter-input/menu/filter-menu.d.ts +3 -0
- package/dist/filter-input/menu/filter-menu.js +8 -4
- package/dist/image/root/image-root.js +9 -1
- package/dist/input/root/input-root.d.ts +1 -1
- package/dist/input/root/input-root.js +2 -2
- package/dist/list/item/list-item.d.ts +68 -1
- package/dist/list/item/list-item.js +66 -4
- package/dist/list/numbering.d.ts +14 -0
- package/dist/list/numbering.js +8 -0
- package/dist/list/root/list-root.d.ts +106 -9
- package/dist/list/root/list-root.js +189 -4
- package/dist/list/selection.d.ts +19 -0
- package/dist/list/selection.js +21 -0
- package/dist/listbox/root/listbox-root.js +1 -2
- package/dist/map/root/map-root.d.ts +6 -2
- package/dist/map/root/map-root.js +5 -2
- package/dist/megamenu/root/megamenu-root.d.ts +21 -0
- package/dist/megamenu/root/megamenu-root.js +16 -2
- package/dist/menu/index.d.ts +1 -0
- package/dist/menu/index.js +1 -0
- package/dist/menu/item/menu-item.d.ts +38 -11
- package/dist/menu/item/menu-item.js +33 -1
- package/dist/menu/root/menu-root.d.ts +25 -1
- package/dist/menu/root/menu-root.js +63 -6
- package/dist/menu/section/menu-section.d.ts +55 -0
- package/dist/menu/section/menu-section.js +60 -0
- package/dist/navigation/root/navigation-root.d.ts +16 -1
- package/dist/navigation/root/navigation-root.js +27 -1
- package/dist/notifications/root/notifications-root.d.ts +18 -0
- package/dist/notifications/root/notifications-root.js +17 -1
- package/dist/object-inspector/root/object-inspector-root.d.ts +97 -16
- package/dist/object-inspector/root/object-inspector-root.js +179 -79
- package/dist/object-inspector/rows.d.ts +57 -0
- package/dist/object-inspector/rows.js +86 -0
- package/dist/outline/levels.d.ts +31 -0
- package/dist/outline/levels.js +23 -0
- package/dist/outline/root/outline-root.d.ts +68 -3
- package/dist/outline/root/outline-root.js +73 -8
- package/dist/pagination/size/pagination-size.d.ts +11 -2
- package/dist/pagination/size/pagination-size.js +19 -4
- package/dist/radio/group/radio-group.d.ts +4 -10
- package/dist/radio/group/radio-group.js +5 -10
- package/dist/rating/root/rating-root.d.ts +1 -1
- package/dist/rating/root/rating-root.js +2 -2
- package/dist/scroll-area/root/scroll-area-root.d.ts +113 -0
- package/dist/scroll-area/root/scroll-area-root.js +218 -3
- package/dist/scroll-area/scrollbar.d.ts +65 -0
- package/dist/scroll-area/scrollbar.js +24 -0
- package/dist/select/root/select-root.js +1 -1
- package/dist/splitter/root/splitter-root.d.ts +13 -0
- package/dist/splitter/root/splitter-root.js +20 -2
- package/dist/splitter/snap.d.ts +9 -0
- package/dist/splitter/snap.js +12 -0
- package/dist/steps/reach.d.ts +15 -0
- package/dist/steps/reach.js +12 -0
- package/dist/steps/root/steps-root.d.ts +30 -0
- package/dist/steps/root/steps-root.js +53 -0
- package/dist/steps/step/step.d.ts +38 -2
- package/dist/steps/step/step.js +28 -6
- package/dist/table/column/table-column.d.ts +11 -0
- package/dist/table/column/table-column.js +6 -1
- package/dist/table/root/table-root.d.ts +101 -0
- package/dist/table/root/table-root.js +166 -5
- package/dist/table/row/table-row.d.ts +47 -1
- package/dist/table/row/table-row.js +39 -2
- package/dist/tabs/panel/tab-panel.d.ts +9 -5
- package/dist/tabs/panel/tab-panel.js +3 -4
- package/dist/tabs/root/tabs-root.d.ts +25 -1
- package/dist/tabs/root/tabs-root.js +21 -3
- package/dist/tabs/tab/tab.d.ts +36 -4
- package/dist/tabs/tab/tab.js +46 -3
- package/dist/timeline/group/timeline-group.d.ts +46 -0
- package/dist/timeline/group/timeline-group.js +37 -0
- package/dist/timeline/index.d.ts +1 -0
- package/dist/timeline/index.js +1 -0
- package/dist/timeline/root/timeline-root.d.ts +10 -3
- package/dist/toast/item/toast-item.d.ts +10 -17
- package/dist/toast/item/toast-item.js +15 -36
- package/dist/toolbar/root/toolbar-root.d.ts +13 -0
- package/dist/toolbar/root/toolbar-root.js +15 -5
- package/dist/tree/item/tree-item.d.ts +54 -1
- package/dist/tree/item/tree-item.js +89 -20
- package/dist/tree/root/tree-root.d.ts +37 -0
- package/dist/tree/root/tree-root.js +51 -6
- package/dist/tree/selection.d.ts +24 -0
- package/dist/tree/selection.js +26 -0
- package/dist/video/media-events.d.ts +49 -0
- package/dist/video/media-events.js +39 -0
- package/dist/video/root/video-root.d.ts +99 -13
- package/dist/video/root/video-root.js +84 -47
- package/dist/video-playlist/menu/video-playlist-menu.d.ts +3 -0
- package/dist/video-playlist/menu/video-playlist-menu.js +2 -1
- package/dist/video-playlist/order.d.ts +41 -0
- package/dist/video-playlist/order.js +34 -0
- package/dist/video-playlist/root/video-playlist-root.d.ts +70 -2
- package/dist/video-playlist/root/video-playlist-root.js +60 -16
- package/dist/virtual-list/controls.d.ts +4 -0
- package/dist/virtual-list/controls.js +30 -0
- package/dist/virtual-list/fill.d.ts +30 -0
- package/dist/virtual-list/fill.js +39 -0
- package/dist/virtual-list/keys.d.ts +15 -0
- package/dist/virtual-list/keys.js +24 -0
- package/dist/virtual-list/root/virtual-list-root.d.ts +155 -23
- package/dist/virtual-list/root/virtual-list-root.js +175 -34
- package/lint.json +1 -1
- package/package.json +5 -5
- package/types/jsx.d.ts +3778 -801
- package/types/svelte.d.ts +2 -0
- package/types/vue.d.ts +782 -215
- package/dist/listbox/range.d.ts +0 -17
- package/dist/listbox/range.js +0 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HelixElement } from '@fusion.dev/helix-core';
|
|
2
|
-
import type
|
|
2
|
+
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
3
|
import '../../button/index.js';
|
|
4
4
|
/**
|
|
5
5
|
* @summary One stage in a sequence.
|
|
@@ -21,6 +21,12 @@ import '../../button/index.js';
|
|
|
21
21
|
* and `::after` from properties the list sets, so the step renders no extra
|
|
22
22
|
* element for them.
|
|
23
23
|
*
|
|
24
|
+
* A finished stage says so in words: the name's button is described by
|
|
25
|
+
* `complete-label`, "Complete" unless you translate it, and a stage that
|
|
26
|
+
* becomes complete while the page is open says it once in a polite live
|
|
27
|
+
* region. The current stage's button carries `aria-current="step"`, and only
|
|
28
|
+
* the button, so the state is said once, on the control.
|
|
29
|
+
*
|
|
24
30
|
* @since 0.1.0
|
|
25
31
|
* @status stable
|
|
26
32
|
* @aliases Stage
|
|
@@ -40,14 +46,21 @@ import '../../button/index.js';
|
|
|
40
46
|
* @csspart label-button - The button inside the label.
|
|
41
47
|
* @csspart label-live - The live region inside that button, rendered only from the first time the button is pending.
|
|
42
48
|
* @csspart label-text - The words on that button, trimmed to their capitals and baseline.
|
|
49
|
+
* @csspart live - The live region that says a stage was completed, rendered from the first time one is.
|
|
43
50
|
* @csspart mark - The glyph inside the marker: a tick, a dot, or an empty ring.
|
|
44
51
|
* @csspart marker - The shape carrying the number or the check.
|
|
52
|
+
* @csspart state - The words that describe a finished stage's button. Hidden.
|
|
45
53
|
*/
|
|
46
54
|
export declare class HelixHeadlessStep extends HelixElement {
|
|
47
55
|
/**
|
|
48
56
|
* Whether this stage is finished.
|
|
49
57
|
*/
|
|
50
58
|
complete: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* The words that tell a screen reader the stage is finished. Translate it
|
|
61
|
+
* with the page.
|
|
62
|
+
*/
|
|
63
|
+
completeLabel: string;
|
|
51
64
|
/**
|
|
52
65
|
* Whether this is the current stage.
|
|
53
66
|
*/
|
|
@@ -56,11 +69,27 @@ export declare class HelixHeadlessStep extends HelixElement {
|
|
|
56
69
|
* Whether the stage is disabled, so the user cannot go to it.
|
|
57
70
|
*/
|
|
58
71
|
disabled: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* @internal Set by a linear sequence: whether the stage is out of reach
|
|
74
|
+
* until the ones before it are finished. A property, because the sequence
|
|
75
|
+
* writes it after the step upgrades.
|
|
76
|
+
*/
|
|
77
|
+
locked: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Whether a reader may pass the stage without finishing it, in a sequence
|
|
80
|
+
* with `linear`. Ark UI's skippable step.
|
|
81
|
+
*/
|
|
82
|
+
optional: boolean;
|
|
59
83
|
/**
|
|
60
84
|
* The value the step sends in `helix-select`.
|
|
61
85
|
*/
|
|
62
86
|
value: string;
|
|
63
|
-
/**
|
|
87
|
+
/** Says a stage was finished, from the first time one is. */
|
|
88
|
+
private readonly status;
|
|
89
|
+
/**
|
|
90
|
+
* Fires `helix-select` for the step, unless the step is `disabled` or a
|
|
91
|
+
* linear sequence has it out of reach.
|
|
92
|
+
*/
|
|
64
93
|
select(): void;
|
|
65
94
|
/**
|
|
66
95
|
* The mark this stage's state calls for.
|
|
@@ -85,6 +114,13 @@ export declare class HelixHeadlessStep extends HelixElement {
|
|
|
85
114
|
*/
|
|
86
115
|
protected renderMarker(): TemplateResult;
|
|
87
116
|
protected willUpdate(changed: PropertyValues): void;
|
|
117
|
+
/**
|
|
118
|
+
* Says a stage that was finished while the page is open, with its name.
|
|
119
|
+
*
|
|
120
|
+
* Only a change after the first update, so a sequence served with its done
|
|
121
|
+
* stages says nothing when it arrives.
|
|
122
|
+
*/
|
|
123
|
+
protected updated(changed: PropertyValues): void;
|
|
88
124
|
/**
|
|
89
125
|
* The step's own label, which is a control because a step can be gone to, behind a seam the styled tier can move.
|
|
90
126
|
*
|
package/dist/steps/step/step.js
CHANGED
|
@@ -4,8 +4,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { customElement, HelixElement, HelixSelectEvent, hostAria } from '@fusion.dev/helix-core';
|
|
7
|
+
import { customElement, drawStatus, HelixElement, HelixSelectEvent, hostAria, StatusController, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { check, circle, record } from '@fusion.dev/helix-icons';
|
|
9
|
+
import { nothing } from 'lit';
|
|
9
10
|
import { property } from 'lit/decorators.js';
|
|
10
11
|
import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
|
|
11
12
|
import { html } from 'lit/static-html.js';
|
|
@@ -14,12 +15,16 @@ let HelixHeadlessStep = class HelixHeadlessStep extends HelixElement {
|
|
|
14
15
|
constructor() {
|
|
15
16
|
super(...arguments);
|
|
16
17
|
this.complete = false;
|
|
18
|
+
this.completeLabel = 'Complete';
|
|
17
19
|
this.current = false;
|
|
18
20
|
this.disabled = false;
|
|
21
|
+
this.locked = false;
|
|
22
|
+
this.optional = false;
|
|
19
23
|
this.value = '';
|
|
24
|
+
this.status = new StatusController(this);
|
|
20
25
|
}
|
|
21
26
|
select() {
|
|
22
|
-
if (this.disabled) {
|
|
27
|
+
if (this.disabled || this.locked) {
|
|
23
28
|
return;
|
|
24
29
|
}
|
|
25
30
|
this.dispatchEvent(new HelixSelectEvent({ value: this.value }));
|
|
@@ -35,18 +40,26 @@ let HelixHeadlessStep = class HelixHeadlessStep extends HelixElement {
|
|
|
35
40
|
willUpdate(changed) {
|
|
36
41
|
super.willUpdate(changed);
|
|
37
42
|
hostAria(this.internals, { role: 'listitem' });
|
|
38
|
-
|
|
43
|
+
}
|
|
44
|
+
updated(changed) {
|
|
45
|
+
super.updated(changed);
|
|
46
|
+
if (changed.get('complete') === false && this.complete) {
|
|
47
|
+
const name = (this.textContent ?? '').replace(/\s+/g, ' ').trim();
|
|
48
|
+
this.status.say(name === '' ? this.completeLabel : `${name}, ${this.completeLabel}`);
|
|
49
|
+
}
|
|
39
50
|
}
|
|
40
51
|
renderLabel() {
|
|
41
52
|
return html `<${this.tag('button')}
|
|
42
53
|
part="label"
|
|
43
54
|
exportparts="button: label-button, live: label-live, text: label-text"
|
|
44
55
|
emphasis="ghost"
|
|
45
|
-
|
|
56
|
+
aria-current=${this.current ? 'step' : nothing}
|
|
57
|
+
aria-describedby=${this.complete ? 'state' : nothing}
|
|
58
|
+
?disabled=${this.disabled || this.locked}
|
|
46
59
|
@click=${this.select}
|
|
47
60
|
>
|
|
48
61
|
<slot></slot>
|
|
49
|
-
</${this.tag('button')}>`;
|
|
62
|
+
</${this.tag('button')}><span id="state" part="state" hidden>${this.complete ? this.completeLabel : ''}</span>`;
|
|
50
63
|
}
|
|
51
64
|
render() {
|
|
52
65
|
return html `<span part="marker" aria-hidden="true">
|
|
@@ -56,18 +69,27 @@ let HelixHeadlessStep = class HelixHeadlessStep extends HelixElement {
|
|
|
56
69
|
${this.renderLabel()}
|
|
57
70
|
<span part="description"><slot name="description"></slot></span>
|
|
58
71
|
</span>
|
|
59
|
-
<div part="content"><slot name="content"></slot></div
|
|
72
|
+
<div part="content"><slot name="content"></slot></div>${drawStatus(this.status)}`;
|
|
60
73
|
}
|
|
61
74
|
};
|
|
62
75
|
__decorate([
|
|
63
76
|
property({ reflect: true, type: Boolean })
|
|
64
77
|
], HelixHeadlessStep.prototype, "complete", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
property({ attribute: 'complete-label' })
|
|
80
|
+
], HelixHeadlessStep.prototype, "completeLabel", void 0);
|
|
65
81
|
__decorate([
|
|
66
82
|
property({ reflect: true, type: Boolean })
|
|
67
83
|
], HelixHeadlessStep.prototype, "current", void 0);
|
|
68
84
|
__decorate([
|
|
69
85
|
property({ reflect: true, type: Boolean })
|
|
70
86
|
], HelixHeadlessStep.prototype, "disabled", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
property({ attribute: false })
|
|
89
|
+
], HelixHeadlessStep.prototype, "locked", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
property({ reflect: true, type: Boolean })
|
|
92
|
+
], HelixHeadlessStep.prototype, "optional", void 0);
|
|
71
93
|
__decorate([
|
|
72
94
|
property()
|
|
73
95
|
], HelixHeadlessStep.prototype, "value", void 0);
|
|
@@ -84,6 +84,7 @@ export declare const edgeOf: (align: string | undefined) => string | undefined;
|
|
|
84
84
|
* @slot - The heading.
|
|
85
85
|
*
|
|
86
86
|
* @event {HelixBeforeResizeEvent} helix-before-resize - The column is about to be resized, with the requested width. Cancelable: cancel it to keep the current width.
|
|
87
|
+
* @event {HelixResizedEvent} helix-resized - Fired after the column is resized, with the new width.
|
|
87
88
|
*
|
|
88
89
|
* @csspart column - The heading cell.
|
|
89
90
|
* @csspart grip - The handle for moving the column, when the table allows it.
|
|
@@ -154,6 +155,16 @@ export declare class HelixHeadlessTableColumn extends HelixElement {
|
|
|
154
155
|
* replaced with the heading text.
|
|
155
156
|
*/
|
|
156
157
|
resizeLabel: string;
|
|
158
|
+
/**
|
|
159
|
+
* Makes this column's cells the headers of their rows, in `DataTable`.
|
|
160
|
+
*
|
|
161
|
+
* A screen reader moving along a row or down a column names the row by its
|
|
162
|
+
* row header, so the cell that identifies a row, a file's name say, is the
|
|
163
|
+
* one to mark. Where no column sets it, `DataTable` makes the first column
|
|
164
|
+
* with a `field` the row header. A `Table`'s cells are your markup, so there
|
|
165
|
+
* a cell is a row header through its own `header` attribute.
|
|
166
|
+
*/
|
|
167
|
+
rowHeader: boolean;
|
|
157
168
|
/**
|
|
158
169
|
* Whether the table can be sorted by this column.
|
|
159
170
|
*
|
|
@@ -5,7 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
var HelixHeadlessTableColumn_1;
|
|
8
|
-
import { customElement, fillTemplate, HelixBeforeResizeEvent, HelixElement, hostAria, inlineStep, isRtl, requestChange, } from '@fusion.dev/helix-core';
|
|
8
|
+
import { customElement, fillTemplate, HelixBeforeResizeEvent, HelixElement, HelixResizedEvent, hostAria, inlineStep, isRtl, requestChange, } from '@fusion.dev/helix-core';
|
|
9
9
|
import { dotsThreeVertical } from '@fusion.dev/helix-icons';
|
|
10
10
|
import { html, nothing } from 'lit';
|
|
11
11
|
import { property, state } from 'lit/decorators.js';
|
|
@@ -37,6 +37,7 @@ let HelixHeadlessTableColumn = class HelixHeadlessTableColumn extends HelixEleme
|
|
|
37
37
|
this.moveLabel = 'Move {name}';
|
|
38
38
|
this.resizable = false;
|
|
39
39
|
this.resizeLabel = 'Resize {name}';
|
|
40
|
+
this.rowHeader = false;
|
|
40
41
|
this.sortable = false;
|
|
41
42
|
this.width = '';
|
|
42
43
|
this.widthLabel = '{width} pixels';
|
|
@@ -172,6 +173,7 @@ let HelixHeadlessTableColumn = class HelixHeadlessTableColumn extends HelixEleme
|
|
|
172
173
|
requestChange({
|
|
173
174
|
apply: (value) => {
|
|
174
175
|
this.width = value;
|
|
176
|
+
this.dispatchEvent(new HelixResizedEvent({ value }));
|
|
175
177
|
},
|
|
176
178
|
event: (value) => new HelixBeforeResizeEvent({ value }),
|
|
177
179
|
host: this,
|
|
@@ -237,6 +239,9 @@ __decorate([
|
|
|
237
239
|
__decorate([
|
|
238
240
|
property({ attribute: 'resize-label' })
|
|
239
241
|
], HelixHeadlessTableColumn.prototype, "resizeLabel", void 0);
|
|
242
|
+
__decorate([
|
|
243
|
+
property({ attribute: 'row-header', type: Boolean })
|
|
244
|
+
], HelixHeadlessTableColumn.prototype, "rowHeader", void 0);
|
|
240
245
|
__decorate([
|
|
241
246
|
property({ reflect: true, type: Boolean })
|
|
242
247
|
], HelixHeadlessTableColumn.prototype, "sortable", void 0);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AriaForwardController, HelixElement } from '@fusion.dev/helix-core';
|
|
2
2
|
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
|
+
import '../../checkbox/index.js';
|
|
3
4
|
import { type HelixHeadlessTableColumn } from '../column/table-column.js';
|
|
4
5
|
declare const HelixHeadlessTable_base: (new (...args: any[]) => import("@fusion.dev/helix-core").CollectionElement) & typeof HelixElement;
|
|
5
6
|
/**
|
|
@@ -21,6 +22,17 @@ declare const HelixHeadlessTable_base: (new (...args: any[]) => import("@fusion.
|
|
|
21
22
|
* the rows in the sorted order. `helix-sort` asks first, so you can refuse it
|
|
22
23
|
* and reorder the rows yourself.
|
|
23
24
|
*
|
|
25
|
+
* The `heading` slot names the table: slot a heading or a line of text into
|
|
26
|
+
* it, and the table is named by its words. An `aria-label` or `aria-labelledby` on the
|
|
27
|
+
* host wins over it.
|
|
28
|
+
*
|
|
29
|
+
* `selectable` adds a column of checkboxes. Each row is known by its `value`,
|
|
30
|
+
* and `selected` holds the chosen keys, comma separated, the same shape
|
|
31
|
+
* `DataTable` uses. The checkbox in the heading selects every row. For a grid
|
|
32
|
+
* a reader moves through with the arrow keys, with typeahead and range
|
|
33
|
+
* selection, use `DataTable`. To act on one row, put a link or a button in a
|
|
34
|
+
* cell.
|
|
35
|
+
*
|
|
24
36
|
* The CSS custom properties listed for this component are written by it and
|
|
25
37
|
* read by the stylesheet that draws it. Do not set them. Each holds a number
|
|
26
38
|
* the component computes and CSS cannot, so the stylesheet can draw the table
|
|
@@ -33,13 +45,29 @@ declare const HelixHeadlessTable_base: (new (...args: any[]) => import("@fusion.
|
|
|
33
45
|
* @documentation https://fusion.dev/helix/components/table
|
|
34
46
|
*
|
|
35
47
|
* @slot - The table's rows.
|
|
48
|
+
* @slot heading - Words that name the table, shown above it, such as a heading.
|
|
36
49
|
*
|
|
50
|
+
* @event {HelixSelectEvent} helix-select - The selection is about to change. The event carries every selected key, separated by commas. Cancelable: cancel it to keep the current selection.
|
|
51
|
+
* @event {HelixSelectedEvent} helix-selected - Fired after the selection changes, with every selected key, separated by commas.
|
|
37
52
|
* @event {HelixSortEvent} helix-sort - A different sort order was requested, as `field:direction`, or empty for the order the rows were written in. Cancelable: cancel it to keep the current order.
|
|
53
|
+
* @event {HelixSortedEvent} helix-sorted - Fired after the sort order changes, with the new order.
|
|
38
54
|
*
|
|
55
|
+
* @csspart checkbox - The checkbox in the heading that selects every row, in a `selectable` table.
|
|
56
|
+
* @csspart checkbox-box - The box drawn for the checkbox's input.
|
|
57
|
+
* @csspart checkbox-control - The checkbox's input.
|
|
58
|
+
* @csspart checkbox-feedback - Forwarded from the checkbox. Not shown in the table.
|
|
59
|
+
* @csspart checkbox-field - The row that holds the checkbox's box.
|
|
60
|
+
* @csspart checkbox-hint - Forwarded from the checkbox. Not shown in the table.
|
|
61
|
+
* @csspart checkbox-label - Forwarded from the checkbox. The label is read by screen readers only.
|
|
62
|
+
* @csspart checkbox-mark - The check mark, or the dash while some rows are selected.
|
|
63
|
+
* @csspart checkbox-mark-checked - Added to `checkbox-mark` while its box is checked.
|
|
64
|
+
* @csspart checkbox-mark-dash - Added to `checkbox-mark` while it draws the dash, which it keeps until its box is checked.
|
|
65
|
+
* @csspart checkbox-mark-indeterminate - Added to `checkbox-mark` while only some rows are selected.
|
|
39
66
|
* @csspart empty - The text shown when there are no rows.
|
|
40
67
|
* @csspart head - The row that holds the column headings. It has `display: contents`, so it takes no space of its own.
|
|
41
68
|
* @csspart live - A live region that repeats the empty and loading text, so screen readers announce it when it changes. Visually hidden in the styled tier.
|
|
42
69
|
* @csspart loading - The text shown while the rows are loading.
|
|
70
|
+
* @csspart select-all - The heading that holds the checkbox that selects every row.
|
|
43
71
|
* @csspart table - The grid.
|
|
44
72
|
*
|
|
45
73
|
* @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.
|
|
@@ -78,6 +106,11 @@ export declare class HelixHeadlessTable extends HelixHeadlessTable_base {
|
|
|
78
106
|
* declared in it has nowhere else to be sized from.
|
|
79
107
|
*/
|
|
80
108
|
columns: string;
|
|
109
|
+
/**
|
|
110
|
+
* The keys selected at the start, separated by commas. Used until `selected`
|
|
111
|
+
* is set.
|
|
112
|
+
*/
|
|
113
|
+
defaultSelected: string;
|
|
81
114
|
/**
|
|
82
115
|
* The starting sort order, used until `sort` is set.
|
|
83
116
|
*/
|
|
@@ -91,6 +124,32 @@ export declare class HelixHeadlessTable extends HelixHeadlessTable_base {
|
|
|
91
124
|
* wins over this.
|
|
92
125
|
*/
|
|
93
126
|
label: string;
|
|
127
|
+
/**
|
|
128
|
+
* Adds a column of checkboxes for selecting rows. Each row is known by its
|
|
129
|
+
* `value`, and by its place among the rows as written where it has none.
|
|
130
|
+
*/
|
|
131
|
+
selectable: boolean;
|
|
132
|
+
/** The name of the checkbox in the heading that selects every row. */
|
|
133
|
+
selectAllLabel: string;
|
|
134
|
+
/**
|
|
135
|
+
* The keys of the selected rows, separated by commas.
|
|
136
|
+
*
|
|
137
|
+
* A reader's press fires `helix-select` first, and refusing it leaves the
|
|
138
|
+
* selection as it was. `default-selected` seeds a selection this element
|
|
139
|
+
* then owns.
|
|
140
|
+
*/
|
|
141
|
+
get selected(): string;
|
|
142
|
+
set selected(next: string);
|
|
143
|
+
/**
|
|
144
|
+
* What screen readers hear when the chosen rows change. `{count}` is how many
|
|
145
|
+
* rows are chosen.
|
|
146
|
+
*/
|
|
147
|
+
selectedLabel: string;
|
|
148
|
+
/**
|
|
149
|
+
* The name of a row's checkbox. `{row}` is replaced with the words of the
|
|
150
|
+
* row's first cell.
|
|
151
|
+
*/
|
|
152
|
+
selectRowLabel: string;
|
|
94
153
|
/**
|
|
95
154
|
* The sort order, as `field:direction`, where `field` is a sortable column's
|
|
96
155
|
* `field`.
|
|
@@ -110,6 +169,9 @@ export declare class HelixHeadlessTable extends HelixHeadlessTable_base {
|
|
|
110
169
|
/** What screen readers hear when the table stops being sorted. */
|
|
111
170
|
unsortedLabel: string;
|
|
112
171
|
private sortState;
|
|
172
|
+
private selectedState;
|
|
173
|
+
/** Whether the heading names the table, so taking it away clears only this element's own name. */
|
|
174
|
+
private headed;
|
|
113
175
|
/**
|
|
114
176
|
* Carries a host `aria-label` and `aria-labelledby` to the grid, which is
|
|
115
177
|
* the element with the `table` role.
|
|
@@ -148,6 +210,39 @@ export declare class HelixHeadlessTable extends HelixHeadlessTable_base {
|
|
|
148
210
|
* new order is said. Not on the first render, which is the table arriving.
|
|
149
211
|
*/
|
|
150
212
|
private news;
|
|
213
|
+
/** The sort as the last render had it, so a selection said beside a sort waits. */
|
|
214
|
+
private heardSortBefore;
|
|
215
|
+
/** The selection last heard, so a render that changed nothing says nothing. */
|
|
216
|
+
private heardSelected;
|
|
217
|
+
/** The rows as written, each with the key `selected` lists it by. */
|
|
218
|
+
private get keyed();
|
|
219
|
+
/** The keys selected now. */
|
|
220
|
+
private get chosen();
|
|
221
|
+
/** Asks for a different set of selected rows, and reports whether the request stood. */
|
|
222
|
+
private requestSelected;
|
|
223
|
+
/**
|
|
224
|
+
* A checkbox this table drew asked to change: a row's, or the one in the
|
|
225
|
+
* heading. Refused, and asked of the selection instead, so a box shows only
|
|
226
|
+
* what `selected` says. A checkbox a consumer put in a cell is theirs and is
|
|
227
|
+
* left alone.
|
|
228
|
+
*/
|
|
229
|
+
private readonly handleToggle;
|
|
230
|
+
/**
|
|
231
|
+
* Tells each row whether it is selected and what its checkbox is called.
|
|
232
|
+
*
|
|
233
|
+
* Pushed down for the reason the sort is: the selection is the table's, and
|
|
234
|
+
* the checkbox is drawn by the row.
|
|
235
|
+
*/
|
|
236
|
+
private markSelected;
|
|
237
|
+
/**
|
|
238
|
+
* Names the table by its heading, where the host names it no other way.
|
|
239
|
+
*
|
|
240
|
+
* Through element reflection, because the heading is the consumer's markup
|
|
241
|
+
* and the table is in this shadow root, which an id cannot reach across.
|
|
242
|
+
*/
|
|
243
|
+
private nameByHeading;
|
|
244
|
+
/** What the heading slot is given. */
|
|
245
|
+
private get headings();
|
|
151
246
|
/**
|
|
152
247
|
* Tells each column which way it is ordered, if it is the one.
|
|
153
248
|
*
|
|
@@ -175,6 +270,8 @@ export declare class HelixHeadlessTable extends HelixHeadlessTable_base {
|
|
|
175
270
|
* track for one that declares neither.
|
|
176
271
|
*/
|
|
177
272
|
private get template();
|
|
273
|
+
/** The tracks of the columns, before any checkbox column. */
|
|
274
|
+
private get tracks();
|
|
178
275
|
/**
|
|
179
276
|
* Tracks for the columns that set nothing, from how much text each holds.
|
|
180
277
|
*
|
|
@@ -195,6 +292,8 @@ export declare class HelixHeadlessTable extends HelixHeadlessTable_base {
|
|
|
195
292
|
* after. Sampled, so a table of thousands of rows reads `SAMPLE` of them.
|
|
196
293
|
*/
|
|
197
294
|
private fitted;
|
|
295
|
+
/** Asks for the render a hydration put off, which reads the rows. */
|
|
296
|
+
protected firstUpdated(changed: PropertyValues): void;
|
|
198
297
|
private readonly handleSlotChange;
|
|
199
298
|
/**
|
|
200
299
|
* Watches the light DOM for rows and columns arriving, leaving and moving.
|
|
@@ -278,6 +377,8 @@ export declare class HelixHeadlessTable extends HelixHeadlessTable_base {
|
|
|
278
377
|
private alignCells;
|
|
279
378
|
protected willUpdate(changed: PropertyValues): void;
|
|
280
379
|
protected updated(changed: PropertyValues): void;
|
|
380
|
+
/** The heading of the checkbox column, which selects every row. */
|
|
381
|
+
private renderSelectAll;
|
|
281
382
|
protected render(): TemplateResult;
|
|
282
383
|
}
|
|
283
384
|
declare global {
|