@fusion.dev/helix-headless 0.105.0 → 0.107.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 +7324 -3890
- package/dist/accordion/item/accordion-item.d.ts +17 -16
- package/dist/accordion/root/accordion-root.d.ts +13 -17
- package/dist/announcement/root/announcement-root.d.ts +24 -31
- package/dist/app-header/root/app-header-root.d.ts +14 -14
- package/dist/area-chart/root/area-chart-root.d.ts +29 -48
- package/dist/avatar/group/avatar-group.d.ts +6 -8
- package/dist/avatar/root/avatar-root.d.ts +11 -11
- package/dist/badge/root/badge-root.d.ts +14 -15
- package/dist/bar-chart/root/bar-chart-root.d.ts +40 -44
- package/dist/blockquote/root/blockquote-root.d.ts +5 -7
- package/dist/breadcrumbs/breadcrumb/breadcrumb.d.ts +25 -33
- package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +12 -11
- package/dist/button/root/button-root.d.ts +16 -17
- package/dist/button-group/root/button-group-root.d.ts +9 -10
- package/dist/callout/root/callout-root.d.ts +10 -15
- package/dist/canvas/edge/canvas-edge.d.ts +21 -21
- package/dist/canvas/node/canvas-node.d.ts +43 -45
- package/dist/canvas/root/canvas-root.d.ts +100 -99
- package/dist/card/root/card-root.d.ts +10 -12
- package/dist/carousel/root/carousel-root.d.ts +32 -33
- package/dist/chat/composer/chat-composer.d.ts +24 -26
- package/dist/chat/message/chat-message.d.ts +30 -33
- package/dist/chat/root/chat-root.d.ts +63 -80
- package/dist/checkbox/root/checkbox-root.d.ts +30 -32
- package/dist/checkbox-group/root/checkbox-group-root.d.ts +25 -25
- package/dist/code/root/code-root.d.ts +6 -10
- package/dist/code-block/root/code-block-root.d.ts +35 -48
- package/dist/color-input/root/color-input-root.d.ts +52 -56
- package/dist/color-picker/root/color-picker-root.d.ts +49 -49
- package/dist/combobox/root/combobox-root.d.ts +52 -53
- package/dist/command/root/command-root.d.ts +35 -40
- package/dist/copy-button/root/copy-button-root.d.ts +24 -26
- package/dist/data-table/root/data-table-root.d.ts +106 -107
- package/dist/date-input/root/date-input-root.d.ts +54 -53
- package/dist/date-picker/root/date-picker-root.d.ts +25 -21
- package/dist/description-list/item/description-list-item.d.ts +7 -7
- package/dist/description-list/root/description-list-root.d.ts +10 -15
- package/dist/dialog/root/dialog-root.d.ts +22 -19
- package/dist/divider/root/divider-root.d.ts +12 -13
- package/dist/donut-chart/root/donut-chart-root.d.ts +19 -20
- package/dist/drawer/root/drawer-root.d.ts +19 -18
- package/dist/drilldown/item/drilldown-item.d.ts +28 -28
- package/dist/drilldown/root/drilldown-root.d.ts +22 -28
- package/dist/element-events.generated.js +7 -0
- package/dist/empty/root/empty-root.d.ts +16 -19
- package/dist/file-input/root/file-input-root.d.ts +32 -32
- package/dist/filter-input/chip/filter-chip.d.ts +36 -39
- package/dist/filter-input/field/filter-field.d.ts +25 -31
- package/dist/filter-input/menu/filter-menu.d.ts +50 -47
- package/dist/filter-input/operator/filter-operator.d.ts +15 -20
- package/dist/filter-input/root/filter-input-root.d.ts +80 -98
- package/dist/format-date/root/format-date-root.d.ts +19 -27
- package/dist/heatmap/root/heatmap-root.d.ts +40 -41
- package/dist/icon/root/icon-root.d.ts +21 -23
- package/dist/icon-button/root/icon-button-root.d.ts +12 -14
- package/dist/image/root/image-root.d.ts +30 -30
- package/dist/input/root/input-root.d.ts +36 -35
- package/dist/kbd/root/kbd-root.d.ts +13 -15
- package/dist/legend/root/legend-root.d.ts +18 -16
- package/dist/lightbox/item/lightbox-item.d.ts +13 -15
- package/dist/lightbox/root/lightbox-root.d.ts +40 -41
- package/dist/line-chart/root/line-chart-root.d.ts +20 -29
- package/dist/list/item/list-item.d.ts +17 -22
- package/dist/list/root/list-root.d.ts +6 -7
- package/dist/listbox/root/listbox-root.d.ts +42 -41
- package/dist/loader/root/loader-root.d.ts +16 -20
- package/dist/map/area/map-area.d.ts +6 -0
- package/dist/map/area/map-area.js +3 -0
- package/dist/map/buildings/map-buildings.d.ts +45 -0
- package/dist/map/buildings/map-buildings.js +37 -0
- package/dist/map/contours/map-contours.d.ts +61 -0
- package/dist/map/contours/map-contours.js +54 -0
- package/dist/map/index.d.ts +7 -0
- package/dist/map/index.js +5 -0
- package/dist/map/landcover/map-landcover.d.ts +47 -0
- package/dist/map/landcover/map-landcover.js +37 -0
- package/dist/map/marker/map-marker.d.ts +11 -4
- package/dist/map/marker/map-marker.js +13 -1
- package/dist/map/points/map-points.d.ts +7 -1
- package/dist/map/points/map-points.js +3 -0
- package/dist/map/raster/map-raster.d.ts +84 -0
- package/dist/map/raster/map-raster.js +96 -0
- package/dist/map/root/map-root.d.ts +169 -7
- package/dist/map/root/map-root.js +352 -4
- package/dist/map/route/map-route.d.ts +6 -0
- package/dist/map/route/map-route.js +3 -0
- package/dist/map/terrain/map-terrain.d.ts +68 -0
- package/dist/map/terrain/map-terrain.js +58 -0
- package/dist/megamenu/root/megamenu-root.d.ts +27 -25
- package/dist/menu/item/menu-item.d.ts +30 -31
- package/dist/menu/root/menu-root.d.ts +25 -29
- package/dist/meter/root/meter-root.d.ts +22 -21
- package/dist/navigation/root/navigation-root.d.ts +13 -16
- package/dist/notifications/group/notification-group.d.ts +27 -28
- package/dist/notifications/notification/notification.d.ts +35 -42
- package/dist/notifications/root/notifications-root.d.ts +22 -24
- package/dist/number-input/root/number-input-root.d.ts +46 -50
- package/dist/object-inspector/root/object-inspector-root.d.ts +46 -58
- package/dist/option/group/option-group.d.ts +11 -11
- package/dist/option/root/option-root.d.ts +28 -33
- package/dist/outline/root/outline-root.d.ts +18 -17
- package/dist/pagination/root/pagination-root.d.ts +37 -39
- package/dist/pagination/size/pagination-size.d.ts +37 -43
- package/dist/pagination/summary/pagination-summary.d.ts +12 -14
- package/dist/pin-input/root/pin-input-root.d.ts +32 -38
- package/dist/popover/root/popover-root.d.ts +16 -21
- package/dist/progress/root/progress-root.d.ts +16 -14
- package/dist/qr-code/root/qr-code-root.d.ts +22 -25
- package/dist/quote/root/quote-root.d.ts +5 -6
- package/dist/radio/group/radio-group.d.ts +26 -28
- package/dist/radio/root/radio-root.d.ts +24 -28
- package/dist/rating/root/rating-root.d.ts +27 -30
- package/dist/scatter-chart/root/scatter-chart-root.d.ts +43 -55
- package/dist/scroll-area/root/scroll-area-root.d.ts +15 -21
- package/dist/select/root/select-root.d.ts +41 -44
- package/dist/skeleton/root/skeleton-root.d.ts +7 -8
- package/dist/skip-link/root/skip-link-root.d.ts +21 -28
- package/dist/slider/root/slider-root.d.ts +36 -39
- package/dist/sparkline/root/sparkline-root.d.ts +22 -28
- package/dist/speed-dial/item/speed-dial-item.d.ts +21 -21
- package/dist/speed-dial/root/speed-dial-root.d.ts +25 -27
- package/dist/splitter/root/splitter-root.d.ts +37 -41
- package/dist/stat/group/stat-group.d.ts +4 -4
- package/dist/stat/root/stat-root.d.ts +8 -9
- package/dist/steps/root/steps-root.d.ts +11 -14
- package/dist/steps/step/step.d.ts +22 -29
- package/dist/switch/root/switch-root.d.ts +20 -24
- package/dist/table/cell/table-cell.d.ts +18 -8
- package/dist/table/cell/table-cell.js +5 -1
- package/dist/table/column/table-column.d.ts +62 -55
- package/dist/table/root/table-root.d.ts +16 -17
- package/dist/table/row/table-row.d.ts +3 -3
- package/dist/tabs/panel/tab-panel.d.ts +3 -3
- package/dist/tabs/root/tabs-root.d.ts +19 -17
- package/dist/tabs/tab/tab.d.ts +6 -6
- package/dist/tag/root/tag-root.d.ts +11 -12
- package/dist/textarea/root/textarea-root.d.ts +29 -32
- package/dist/time-input/root/time-input-root.d.ts +70 -69
- package/dist/time-picker/root/time-picker-root.d.ts +58 -66
- package/dist/timeline/item/timeline-item.d.ts +18 -24
- package/dist/timeline/root/timeline-root.d.ts +13 -21
- package/dist/toast/item/toast-item.d.ts +21 -22
- package/dist/toast/root/toast-root.d.ts +18 -23
- package/dist/toggle/group/toggle-group.d.ts +23 -25
- package/dist/toggle/root/toggle-root.d.ts +8 -8
- package/dist/toolbar/root/toolbar-root.d.ts +7 -10
- package/dist/tooltip/root/tooltip-root.d.ts +41 -47
- package/dist/tour/root/tour-root.d.ts +24 -26
- package/dist/tour/stop/tour-stop.d.ts +39 -48
- package/dist/tree/item/tree-item.d.ts +23 -25
- package/dist/tree/root/tree-root.d.ts +13 -12
- package/dist/trend/root/trend-root.d.ts +18 -19
- package/dist/video/root/video-root.d.ts +108 -101
- package/dist/video-playlist/item/video-playlist-item.d.ts +23 -28
- package/dist/video-playlist/menu/video-playlist-menu.d.ts +17 -21
- package/dist/video-playlist/root/video-playlist-root.d.ts +21 -25
- package/dist/virtual-list/root/virtual-list-root.d.ts +27 -26
- package/package.json +5 -5
- package/types/jsx.d.ts +10363 -9520
- package/types/svelte.d.ts +5 -0
- package/types/vue.d.ts +1440 -1032
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { HelixElement } from '@fusion.dev/helix-core';
|
|
2
2
|
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
3
|
/**
|
|
4
|
-
* @summary A
|
|
4
|
+
* @summary A labeled group of options inside a listbox.
|
|
5
5
|
*
|
|
6
6
|
* @description
|
|
7
|
-
* A heading over a set
|
|
8
|
-
* because
|
|
9
|
-
*
|
|
10
|
-
* moving through a grouped list exactly as it moves through a flat one.
|
|
7
|
+
* A heading over a set of options. The group holds no selection and no value,
|
|
8
|
+
* because the listbox owns those. Its options are still the listbox's options,
|
|
9
|
+
* so the keyboard moves through a grouped list the same way as a flat one.
|
|
11
10
|
*
|
|
12
|
-
* `role="group"`
|
|
13
|
-
* an option is in
|
|
11
|
+
* The group has `role="group"` and takes its name from the heading, so a screen
|
|
12
|
+
* reader announces which group an option is in, and the heading is not a stop
|
|
13
|
+
* of its own.
|
|
14
14
|
*
|
|
15
15
|
* @since 0.1.0
|
|
16
16
|
* @status stable
|
|
17
17
|
* @aliases OptGroup, Section
|
|
18
18
|
* @documentation https://fusion.dev/helix/components/option
|
|
19
19
|
*
|
|
20
|
-
* @slot - The options in
|
|
21
|
-
* @slot label -
|
|
20
|
+
* @slot - The options in the group.
|
|
21
|
+
* @slot label - The group's heading, for a heading that needs more than plain text.
|
|
22
22
|
*
|
|
23
|
-
* @csspart items - The
|
|
23
|
+
* @csspart items - The element that holds the group's options.
|
|
24
24
|
* @csspart label - The heading.
|
|
25
25
|
*/
|
|
26
26
|
export declare class HelixHeadlessOptionGroup extends HelixElement {
|
|
27
27
|
/**
|
|
28
|
-
* The heading
|
|
28
|
+
* The heading above the group's options.
|
|
29
29
|
*/
|
|
30
30
|
label: string;
|
|
31
31
|
protected willUpdate(changed: PropertyValues): void;
|
|
@@ -21,24 +21,18 @@ export declare const optionsAmong: (elements: readonly Element[]) => HelixHeadle
|
|
|
21
21
|
* @summary One choice in a listbox.
|
|
22
22
|
*
|
|
23
23
|
* @description
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* with a
|
|
28
|
-
*
|
|
29
|
-
* listbox, not any one control that happens to contain one.
|
|
24
|
+
* Options are their own family, separate from Select, because an option belongs
|
|
25
|
+
* to a listbox and several controls contain one. `role="option"` requires an
|
|
26
|
+
* owning `role="listbox"`. A Select is a listbox with a trigger, a Combobox is
|
|
27
|
+
* a listbox with a text input, and a command palette is a listbox in a dialog.
|
|
28
|
+
* `Radio` is a part of its group, because a radio has only one kind of owner.
|
|
30
29
|
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
30
|
+
* Selection works the way it does for a radio. Choosing an option dispatches an
|
|
31
|
+
* event, the listbox decides whether the choice stands, and the listbox sets
|
|
32
|
+
* `selected`.
|
|
33
33
|
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* writes `selected` back. An option that selected itself would be a second
|
|
37
|
-
* answer to which one is chosen.
|
|
38
|
-
*
|
|
39
|
-
* **Nothing here knows about filtering.** A hidden option is hidden by whatever
|
|
40
|
-
* owns it, through `hidden`, because what counts as a match is the listbox's
|
|
41
|
-
* question and differs between a select and a command palette.
|
|
34
|
+
* Filtering belongs to the owner, which hides an option with `hidden`. What
|
|
35
|
+
* counts as a match differs between a select and a command palette.
|
|
42
36
|
*
|
|
43
37
|
* @since 0.1.0
|
|
44
38
|
* @status stable
|
|
@@ -46,18 +40,18 @@ export declare const optionsAmong: (elements: readonly Element[]) => HelixHeadle
|
|
|
46
40
|
* @aliases Item, Choice
|
|
47
41
|
* @documentation https://fusion.dev/helix/components/option
|
|
48
42
|
*
|
|
49
|
-
* @slot - The
|
|
50
|
-
* @slot end -
|
|
51
|
-
* @slot start -
|
|
43
|
+
* @slot - The option's label.
|
|
44
|
+
* @slot end - Content after the label, such as a shortcut or a count.
|
|
45
|
+
* @slot start - Content before the label, such as an icon or an avatar.
|
|
52
46
|
*
|
|
53
|
-
* @event {HelixSelectEvent} helix-select -
|
|
47
|
+
* @event {HelixSelectEvent} helix-select - The option was chosen. Cancelable: canceling it leaves the selection as it was.
|
|
54
48
|
*
|
|
55
|
-
* @csspart description - The
|
|
49
|
+
* @csspart description - The description under the label, when there is one.
|
|
56
50
|
* @csspart item - The row.
|
|
57
|
-
* @csspart item-active - The row the keyboard is on
|
|
58
|
-
* @csspart item-selected - The row of a
|
|
59
|
-
* @csspart label - The
|
|
60
|
-
* @csspart text - The
|
|
51
|
+
* @csspart item-active - The row the keyboard is on. Set alongside `item`.
|
|
52
|
+
* @csspart item-selected - The row of a selected option. Set alongside `item`.
|
|
53
|
+
* @csspart label - The option's label.
|
|
54
|
+
* @csspart text - The label and the description under it, as one column.
|
|
61
55
|
*
|
|
62
56
|
* @cssstate selected - While the option is chosen.
|
|
63
57
|
*/
|
|
@@ -69,7 +63,8 @@ export declare class HelixHeadlessOption extends HelixElement {
|
|
|
69
63
|
*/
|
|
70
64
|
active: boolean;
|
|
71
65
|
/**
|
|
72
|
-
* A second destination for
|
|
66
|
+
* A second destination for the row, opened when you choose it with the
|
|
67
|
+
* modifier key held.
|
|
73
68
|
*
|
|
74
69
|
* **An attribute rather than a second row, which is the whole point.** A
|
|
75
70
|
* palette that offered every component a reference page and a sandbox as
|
|
@@ -86,7 +81,7 @@ export declare class HelixHeadlessOption extends HelixElement {
|
|
|
86
81
|
*/
|
|
87
82
|
alternate: string;
|
|
88
83
|
/**
|
|
89
|
-
*
|
|
84
|
+
* The name of the second destination, announced to screen reader users.
|
|
90
85
|
*
|
|
91
86
|
* A row with two destinations needs both said, or a screen reader is told
|
|
92
87
|
* about one of them and the other is a key nobody mentioned. It goes to
|
|
@@ -96,7 +91,7 @@ export declare class HelixHeadlessOption extends HelixElement {
|
|
|
96
91
|
*/
|
|
97
92
|
alternateLabel: string;
|
|
98
93
|
/**
|
|
99
|
-
* Whether the markup
|
|
94
|
+
* Whether the markup declares this option selected. A form reset returns to it.
|
|
100
95
|
*
|
|
101
96
|
* `<option selected>` reflects to `defaultSelected` and `option.selected` is
|
|
102
97
|
* live state that does not reflect, and those are two different facts. This
|
|
@@ -125,7 +120,7 @@ export declare class HelixHeadlessOption extends HelixElement {
|
|
|
125
120
|
get defaultSelected(): boolean;
|
|
126
121
|
set defaultSelected(next: boolean);
|
|
127
122
|
/**
|
|
128
|
-
* A second line under the
|
|
123
|
+
* A second line under the label that describes the choice.
|
|
129
124
|
*
|
|
130
125
|
* A palette row reads better as a name and a caption than as one sentence
|
|
131
126
|
* carrying both: "Helix" and "the design system" are two facts, and a comma
|
|
@@ -147,7 +142,7 @@ export declare class HelixHeadlessOption extends HelixElement {
|
|
|
147
142
|
*/
|
|
148
143
|
description?: string;
|
|
149
144
|
/**
|
|
150
|
-
*
|
|
145
|
+
* Prevents the option from being chosen.
|
|
151
146
|
*/
|
|
152
147
|
disabled: boolean;
|
|
153
148
|
/**
|
|
@@ -166,11 +161,11 @@ export declare class HelixHeadlessOption extends HelixElement {
|
|
|
166
161
|
*/
|
|
167
162
|
selected: boolean;
|
|
168
163
|
/**
|
|
169
|
-
*
|
|
164
|
+
* The value that identifies the option, and that a form submits.
|
|
170
165
|
*/
|
|
171
166
|
value: string;
|
|
172
167
|
/**
|
|
173
|
-
* The
|
|
168
|
+
* The option's text, which a listbox matches typed text against.
|
|
174
169
|
*
|
|
175
170
|
* Read from the rendered content rather than required as a property, because
|
|
176
171
|
* the content is where a consumer naturally puts it and asking for both is
|
|
@@ -208,7 +203,7 @@ export declare class HelixHeadlessOption extends HelixElement {
|
|
|
208
203
|
* it is in every comparison too.
|
|
209
204
|
*/
|
|
210
205
|
get text(): string;
|
|
211
|
-
/**
|
|
206
|
+
/** Sends `helix-select` for this option. Does nothing when it is disabled. */
|
|
212
207
|
select(): void;
|
|
213
208
|
/**
|
|
214
209
|
* Mirrors the chosen state where a stylesheet can select on it.
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { HelixElement } from '@fusion.dev/helix-core';
|
|
2
2
|
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
3
|
/**
|
|
4
|
-
* @summary Links to the headings on
|
|
4
|
+
* @summary Links to the headings on the page, with the section in view marked.
|
|
5
5
|
*
|
|
6
6
|
* @description
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* Outline is a table of contents for a document. `Navigation` does the same job
|
|
8
|
+
* for a site.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* the page
|
|
10
|
+
* The links are your own anchors. A router renders its own `<a>` and cannot
|
|
11
|
+
* render one inside the outline's shadow root, and the hrefs are fragments on
|
|
12
|
+
* the same page.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
15
|
-
* `IntersectionObserver` with a band near the top fails
|
|
16
|
-
*
|
|
17
|
-
*
|
|
14
|
+
* The current section is decided by the headings' positions. An
|
|
15
|
+
* `IntersectionObserver` with a band near the top fails both ways: when
|
|
16
|
+
* headings are far apart, none is in the band and no section is marked, and
|
|
17
|
+
* when they are close together, several are in the band at once.
|
|
18
18
|
*
|
|
19
19
|
* @since 0.1.0
|
|
20
20
|
* @status stable
|
|
@@ -24,15 +24,15 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
24
24
|
*
|
|
25
25
|
* @slot - The links, as anchors with fragment hrefs.
|
|
26
26
|
*
|
|
27
|
-
* @event {HelixActivateEvent} helix-activate -
|
|
27
|
+
* @event {HelixActivateEvent} helix-activate - Fired when the section in view changes, with its id as the value. It reports the scroll position and cannot be prevented.
|
|
28
28
|
*
|
|
29
|
-
* @csspart indicator - The mark that
|
|
29
|
+
* @csspart indicator - The mark that moves to the section in view.
|
|
30
30
|
* @csspart nav - The navigation landmark.
|
|
31
31
|
*/
|
|
32
32
|
export declare class HelixHeadlessOutline extends HelixElement {
|
|
33
33
|
private readonly indicator;
|
|
34
34
|
/**
|
|
35
|
-
* How
|
|
35
|
+
* How the page scrolls to a section when its link is clicked.
|
|
36
36
|
*
|
|
37
37
|
* The platform's own vocabulary, because this is the platform's own option:
|
|
38
38
|
* `auto` defers to whatever `scroll-behavior` the page has set on its scroll
|
|
@@ -54,12 +54,13 @@ export declare class HelixHeadlessOutline extends HelixElement {
|
|
|
54
54
|
*/
|
|
55
55
|
behavior: ScrollBehavior;
|
|
56
56
|
/**
|
|
57
|
-
*
|
|
57
|
+
* The navigation's name, read by screen readers.
|
|
58
58
|
*/
|
|
59
59
|
label: string;
|
|
60
60
|
/**
|
|
61
|
-
* How far below the top of
|
|
62
|
-
* pixels
|
|
61
|
+
* How far below the top of the scroll container a heading counts as reached,
|
|
62
|
+
* in pixels. The scroll container is the window or the panel the sections
|
|
63
|
+
* scroll in.
|
|
63
64
|
*
|
|
64
65
|
* The reading line. A page with a sticky masthead sets this to its height, or
|
|
65
66
|
* a little more: without it the current section changes as a heading slides
|
|
@@ -67,7 +68,7 @@ export declare class HelixHeadlessOutline extends HelixElement {
|
|
|
67
68
|
*/
|
|
68
69
|
offset: number;
|
|
69
70
|
/**
|
|
70
|
-
* The id of the section
|
|
71
|
+
* The id of the section in view, or empty before anything is measured.
|
|
71
72
|
*
|
|
72
73
|
* Read-only, and a getter rather than a property for that reason: it is
|
|
73
74
|
* derived from where the page is scrolled to, so a consumer setting it would
|
|
@@ -1,37 +1,32 @@
|
|
|
1
1
|
import { HelixElement } from '@fusion.dev/helix-core';
|
|
2
2
|
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
3
|
/**
|
|
4
|
-
* @summary
|
|
4
|
+
* @summary Controls for moving between the pages of a long set of results.
|
|
5
5
|
*
|
|
6
6
|
* @description
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* Set a page and a total, and the component works out which page numbers to
|
|
8
|
+
* show and where the gaps go:
|
|
9
|
+
* `<helix-headless-pagination page="4" pages="12">`. You do not slot a child
|
|
10
|
+
* for each page.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
* `siblings`
|
|
14
|
-
* control
|
|
15
|
-
*
|
|
16
|
-
* one click and the next.
|
|
12
|
+
* The width stays the same as you page. The run around the current page is
|
|
13
|
+
* `siblings` on each side and grows to absorb a gap at either end, so the
|
|
14
|
+
* control shows the same number of slots from the first page to the last, and
|
|
15
|
+
* the buttons do not move under the pointer.
|
|
17
16
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* binary-search step: any page in a set of any size is a handful of presses.
|
|
17
|
+
* A gap appears only where it hides more than one page. A gap is a control: it
|
|
18
|
+
* goes to the middle of the pages it hides, so any page is a few presses away.
|
|
21
19
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
20
|
+
* Set `href` to render every page as an `<a>`, with `{page}` replaced by the
|
|
21
|
+
* page number. The links can be crawled, a middle click opens a tab, and the
|
|
22
|
+
* address bar holds the state. Without `href` the pages are buttons, for a
|
|
23
|
+
* table that pages in place. Either way, a click dispatches `helix-navigate`
|
|
24
|
+
* first. Call `preventDefault()` to stop both the navigation and the page
|
|
25
|
+
* change, for example to hand navigation to a router. There is no
|
|
26
|
+
* `helix-change`, because moving to another page selects nothing.
|
|
28
27
|
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* **The count and the page-size control are their own elements.**
|
|
33
|
-
* `Pagination.Summary` and `Pagination.Size` sit beside this one, because a
|
|
34
|
-
* slot can only offer one place: at one end of one row, in one order.
|
|
28
|
+
* `Pagination.Summary` and `Pagination.Size` are separate elements that you
|
|
29
|
+
* place beside this one, so you choose where they go and in what order.
|
|
35
30
|
*
|
|
36
31
|
* @since 0.1.0
|
|
37
32
|
* @status stable
|
|
@@ -44,22 +39,22 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
44
39
|
* @slot next-icon - The glyph on the forward-one-page control, usually a caret.
|
|
45
40
|
* @slot previous-icon - The glyph on the back-one-page control, usually a caret.
|
|
46
41
|
*
|
|
47
|
-
* @event {HelixNavigateEvent} helix-navigate - Fired before the page changes, and cancelable.
|
|
42
|
+
* @event {HelixNavigateEvent} helix-navigate - Fired before the page changes, and cancelable. Canceling it is the only way to stop a page change.
|
|
48
43
|
*
|
|
49
44
|
* @csspart first - The control that jumps to the first page, under `ends`.
|
|
50
|
-
* @csspart gap - The control
|
|
45
|
+
* @csspart gap - The control in place of hidden pages, which jumps into them.
|
|
51
46
|
* @csspart item - One slot in the run, holding a page or a gap.
|
|
52
47
|
* @csspart last - The control that jumps to the last page, under `ends`.
|
|
53
48
|
* @csspart list - The run of pages.
|
|
54
|
-
* @csspart live - The region that
|
|
55
|
-
* @csspart mark - The glyph on a first, previous, next or last control, where none is slotted.
|
|
49
|
+
* @csspart live - The live region that announces a page change. It is clipped out of view and still read.
|
|
50
|
+
* @csspart mark - The glyph on a first, previous, next, or last control, where none is slotted.
|
|
56
51
|
* @csspart next - The control that moves forward one page.
|
|
57
52
|
* @csspart page - The control for one page.
|
|
58
53
|
* @csspart page-current - The page you are on, beside `page`.
|
|
59
54
|
* @csspart previous - The control that moves back one page.
|
|
60
|
-
* @csspart status - The
|
|
55
|
+
* @csspart status - The text that says which page you are on, in `compact`.
|
|
61
56
|
*
|
|
62
|
-
* @cssstate empty -
|
|
57
|
+
* @cssstate empty - There is one page or none, so there is nothing to page through.
|
|
63
58
|
*/
|
|
64
59
|
export declare class HelixHeadlessPagination extends HelixElement {
|
|
65
60
|
/**
|
|
@@ -67,7 +62,8 @@ export declare class HelixHeadlessPagination extends HelixElement {
|
|
|
67
62
|
*/
|
|
68
63
|
boundaries: number;
|
|
69
64
|
/**
|
|
70
|
-
*
|
|
65
|
+
* Replaces the page numbers with the current page and the page count, as
|
|
66
|
+
* written by `status-label`.
|
|
71
67
|
*
|
|
72
68
|
* A different structure rather than a different look, which is why it is
|
|
73
69
|
* here: the run of pages is gone and a single status line stands in its
|
|
@@ -79,11 +75,11 @@ export declare class HelixHeadlessPagination extends HelixElement {
|
|
|
79
75
|
*/
|
|
80
76
|
compact: boolean;
|
|
81
77
|
/**
|
|
82
|
-
*
|
|
78
|
+
* The page to open on when `page` is not set.
|
|
83
79
|
*/
|
|
84
80
|
defaultPage: number;
|
|
85
81
|
/**
|
|
86
|
-
*
|
|
82
|
+
* Shows controls that jump to the first and last pages.
|
|
87
83
|
*
|
|
88
84
|
* Off by default. The gaps already reach any page in a few presses and the
|
|
89
85
|
* last page is one of the two the run always shows, so on a short set these
|
|
@@ -102,11 +98,11 @@ export declare class HelixHeadlessPagination extends HelixElement {
|
|
|
102
98
|
*/
|
|
103
99
|
firstLabel: string;
|
|
104
100
|
/**
|
|
105
|
-
* Accessible name for a gap
|
|
101
|
+
* Accessible name for a gap. `{page}` is replaced with the page it jumps to.
|
|
106
102
|
*/
|
|
107
103
|
gapLabel: string;
|
|
108
104
|
/**
|
|
109
|
-
*
|
|
105
|
+
* The URL for each page. `{page}` is replaced with the page number.
|
|
110
106
|
*
|
|
111
107
|
* Absent renders buttons. Present renders links, which is what a paged result
|
|
112
108
|
* with its own URL should be: a crawler follows them, a middle click opens
|
|
@@ -140,7 +136,7 @@ export declare class HelixHeadlessPagination extends HelixElement {
|
|
|
140
136
|
*/
|
|
141
137
|
nextLabel: string;
|
|
142
138
|
/**
|
|
143
|
-
* The page
|
|
139
|
+
* The current page, counting from one.
|
|
144
140
|
*
|
|
145
141
|
* An accessor pair, the same shape as the calendar's `month`. Reading gives
|
|
146
142
|
* the page on show; writing sets it, and `default-page` seeds one the element
|
|
@@ -158,7 +154,8 @@ export declare class HelixHeadlessPagination extends HelixElement {
|
|
|
158
154
|
get page(): number;
|
|
159
155
|
set page(next: number);
|
|
160
156
|
/**
|
|
161
|
-
* Accessible name for one page
|
|
157
|
+
* Accessible name for one page. `{page}` and `{pages}` are replaced with the
|
|
158
|
+
* page number and the page count.
|
|
162
159
|
*/
|
|
163
160
|
pageLabel: string;
|
|
164
161
|
/**
|
|
@@ -190,7 +187,8 @@ export declare class HelixHeadlessPagination extends HelixElement {
|
|
|
190
187
|
*/
|
|
191
188
|
siblings: number;
|
|
192
189
|
/**
|
|
193
|
-
* The
|
|
190
|
+
* The text shown in `compact`. `{page}` and `{pages}` are replaced with the
|
|
191
|
+
* current page and the page count.
|
|
194
192
|
*
|
|
195
193
|
* No noun: the landmark this sits in is already named "Pagination", so
|
|
196
194
|
* "Page 7 of 24" says it twice to a screen reader and takes a third of the
|
|
@@ -3,68 +3,62 @@ import { nothing, type PropertyValues, type TemplateResult } from 'lit';
|
|
|
3
3
|
import '../../option/index.js';
|
|
4
4
|
import '../../select/index.js';
|
|
5
5
|
/**
|
|
6
|
-
* @summary
|
|
6
|
+
* @summary A control for choosing how many items each page shows.
|
|
7
7
|
*
|
|
8
8
|
* @description
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* consumer's, and a control that can only sit at one end of one row has taken
|
|
12
|
-
* that decision for them.
|
|
9
|
+
* A separate element that you place beside `Pagination`, like
|
|
10
|
+
* `Pagination.Summary`, so you choose the direction and order of your footer.
|
|
13
11
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* real `<label for>` against the trigger's own id.
|
|
12
|
+
* It uses `Select`, so it matches a table's filter dropdowns in the same
|
|
13
|
+
* footer, both open and closed. The caret is `Select`'s, so it follows
|
|
14
|
+
* `currentColor`, and the label is a real `<label for>` pointing at the
|
|
15
|
+
* trigger's id.
|
|
19
16
|
*
|
|
20
|
-
*
|
|
21
|
-
* an outer-tree rule
|
|
22
|
-
* property on `Select` and nothing
|
|
17
|
+
* The label sits on the same row as the select. `Select`'s host is a column,
|
|
18
|
+
* and an outer-tree rule overrides a `:host` rule, so the row layout needs no
|
|
19
|
+
* property on `Select` and nothing added to your markup.
|
|
23
20
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* way, through `ElementInternals.states` rather than an attribute the server
|
|
28
|
-
* never wrote.
|
|
21
|
+
* An empty `sizes` renders nothing and does not fall back to the built-in list.
|
|
22
|
+
* `Pagination` does the same with a single page, and both report it through
|
|
23
|
+
* `ElementInternals.states`.
|
|
29
24
|
*
|
|
30
|
-
* `value` is the size
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* position should survive it.
|
|
25
|
+
* `value` is the current size, and `default-value` is the size from the markup.
|
|
26
|
+
* Changing it dispatches `helix-before-change`. Re-querying and returning to
|
|
27
|
+
* page one is up to you, because only you know whether the current position
|
|
28
|
+
* should be kept.
|
|
35
29
|
*
|
|
36
30
|
* @since 0.1.0
|
|
37
31
|
* @status stable
|
|
38
32
|
* @aliases Page size, Rows per page
|
|
39
33
|
* @documentation https://fusion.dev/helix/components/pagination
|
|
40
34
|
*
|
|
41
|
-
* @event {HelixBeforeChangeEvent} helix-before-change - Fired before the size changes, and cancelable.
|
|
35
|
+
* @event {HelixBeforeChangeEvent} helix-before-change - Fired before the size changes, and cancelable. Canceling it is the only way to stop a size change.
|
|
42
36
|
*
|
|
43
37
|
* @csspart control - The select.
|
|
44
|
-
* @csspart control-feedback -
|
|
38
|
+
* @csspart control-feedback - The message that says what is wrong with the value.
|
|
45
39
|
* @csspart control-hint - Help under the trigger.
|
|
46
|
-
* @csspart control-indicator - The caret
|
|
47
|
-
* @csspart control-label - The
|
|
48
|
-
* @csspart control-listbox - The list inside
|
|
49
|
-
* @csspart control-listbox-empty -
|
|
50
|
-
* @csspart control-listbox-feedback -
|
|
51
|
-
* @csspart control-listbox-filter-icon - The
|
|
52
|
-
* @csspart control-listbox-filter-mark - The
|
|
40
|
+
* @csspart control-indicator - The caret that shows the control opens.
|
|
41
|
+
* @csspart control-label - The label beside the number.
|
|
42
|
+
* @csspart control-listbox - The list inside the panel.
|
|
43
|
+
* @csspart control-listbox-empty - The text shown when the filter hides every option.
|
|
44
|
+
* @csspart control-listbox-feedback - The inner list's message that says what is wrong with the value.
|
|
45
|
+
* @csspart control-listbox-filter-icon - The icon beside the filter field.
|
|
46
|
+
* @csspart control-listbox-filter-mark - The default icon beside the filter field, shown when none is slotted.
|
|
53
47
|
* @csspart control-listbox-hint - Help under the list.
|
|
54
|
-
* @csspart control-listbox-items - The list
|
|
55
|
-
* @csspart control-listbox-label - The
|
|
56
|
-
* @csspart control-listbox-live - The inner
|
|
57
|
-
* @csspart control-listbox-loading -
|
|
58
|
-
* @csspart control-listbox-search - The region
|
|
59
|
-
* @csspart control-listbox-search-field - The field
|
|
48
|
+
* @csspart control-listbox-items - The list of options.
|
|
49
|
+
* @csspart control-listbox-label - The label above the list.
|
|
50
|
+
* @csspart control-listbox-live - The inner list's `live` part, the region screen readers announce its empty and loading text from.
|
|
51
|
+
* @csspart control-listbox-loading - The text shown while the options load.
|
|
52
|
+
* @csspart control-listbox-search - The region that holds the filter field.
|
|
53
|
+
* @csspart control-listbox-search-field - The filter field.
|
|
60
54
|
* @csspart control-surface - The floating panel.
|
|
61
|
-
* @csspart control-trigger - The closed control, which
|
|
55
|
+
* @csspart control-trigger - The closed control, which shows the chosen size.
|
|
62
56
|
* @csspart control-value - The chosen size inside the trigger.
|
|
63
57
|
* @csspart option - One size on offer.
|
|
64
58
|
* @csspart option-description - The caption under the number, when there is one.
|
|
65
59
|
* @csspart option-item - The row.
|
|
66
60
|
* @csspart option-item-active - The row the keyboard is on.
|
|
67
|
-
* @csspart option-item-selected - The row of the size
|
|
61
|
+
* @csspart option-item-selected - The row of the chosen size.
|
|
68
62
|
* @csspart option-label - The number.
|
|
69
63
|
* @csspart option-text - The number and the caption, as one column.
|
|
70
64
|
*
|
|
@@ -72,11 +66,11 @@ import '../../select/index.js';
|
|
|
72
66
|
*/
|
|
73
67
|
export declare class HelixHeadlessPaginationSize extends HelixElement {
|
|
74
68
|
/**
|
|
75
|
-
*
|
|
69
|
+
* The size to start on when `value` is not set.
|
|
76
70
|
*/
|
|
77
71
|
defaultValue: number;
|
|
78
72
|
/**
|
|
79
|
-
* The
|
|
73
|
+
* The label beside the control.
|
|
80
74
|
*/
|
|
81
75
|
label: string;
|
|
82
76
|
/**
|
|
@@ -94,7 +88,7 @@ export declare class HelixHeadlessPaginationSize extends HelixElement {
|
|
|
94
88
|
*/
|
|
95
89
|
sizes: string;
|
|
96
90
|
/**
|
|
97
|
-
* The
|
|
91
|
+
* The current page size.
|
|
98
92
|
*
|
|
99
93
|
* Reading gives the real one; writing declares it the consumer's, and
|
|
100
94
|
* `default-value` seeds one this element owns. Same accessor pair as
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
import { HelixElement } from '@fusion.dev/helix-core';
|
|
2
2
|
import { type TemplateResult } from 'lit';
|
|
3
3
|
/**
|
|
4
|
-
* @summary
|
|
4
|
+
* @summary Text that shows which items are on the current page, out of the total.
|
|
5
5
|
*
|
|
6
6
|
* @description
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* the page. Inside the run it could only ever be at one end of one row.
|
|
7
|
+
* A separate element from `Pagination`, so you decide where the count goes:
|
|
8
|
+
* above, below, in a table caption, or elsewhere on the page.
|
|
10
9
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
10
|
+
* You set `page`, `page-size`, and `total` on both this element and
|
|
11
|
+
* `Pagination`. They come from your own query, so use the same values for both
|
|
12
|
+
* and the two elements agree.
|
|
14
13
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* on a server: `@lit/context` subscribes from `connectedCallback`, and Lit SSR
|
|
19
|
-
* does not call it.
|
|
14
|
+
* A shared parent cannot pass the values down. Writing attributes onto light
|
|
15
|
+
* DOM children causes hydration errors in frameworks, and `@lit/context`
|
|
16
|
+
* subscribes in `connectedCallback`, which Lit SSR does not call.
|
|
20
17
|
*
|
|
21
18
|
* @since 0.1.0
|
|
22
19
|
* @status stable
|
|
@@ -25,7 +22,8 @@ import { type TemplateResult } from 'lit';
|
|
|
25
22
|
*/
|
|
26
23
|
export declare class HelixHeadlessPaginationSummary extends HelixElement {
|
|
27
24
|
/**
|
|
28
|
-
* The
|
|
25
|
+
* The text shown. `{from}`, `{to}`, and `{total}` are replaced with the first
|
|
26
|
+
* item, the last item, and the item count.
|
|
29
27
|
*
|
|
30
28
|
* A template rather than a prefix and a suffix, because word order is not
|
|
31
29
|
* universal: `format="{total} 件中 {from}-{to} 件"` is one attribute here and
|
|
@@ -47,7 +45,7 @@ export declare class HelixHeadlessPaginationSummary extends HelixElement {
|
|
|
47
45
|
*/
|
|
48
46
|
locale: string;
|
|
49
47
|
/**
|
|
50
|
-
* The page
|
|
48
|
+
* The current page, counting from one.
|
|
51
49
|
*/
|
|
52
50
|
page: number;
|
|
53
51
|
/**
|