@fusion.dev/helix-headless 0.0.0-dev → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +4513 -4483
- package/dist/accordion/item/accordion-item.d.ts +13 -15
- package/dist/accordion/item/accordion-item.js +15 -17
- package/dist/announcement/root/announcement-root.d.ts +7 -25
- package/dist/announcement/root/announcement-root.js +7 -20
- package/dist/app-header/root/app-header-root.d.ts +10 -17
- package/dist/app-header/root/app-header-root.js +9 -18
- package/dist/avatar/group/avatar-group.d.ts +10 -19
- package/dist/avatar/group/avatar-group.js +12 -17
- package/dist/avatar/root/avatar-root.d.ts +8 -8
- package/dist/avatar/root/avatar-root.js +19 -20
- package/dist/badge/root/badge-root.d.ts +6 -6
- package/dist/badge/root/badge-root.js +13 -13
- package/dist/bar-chart/root/bar-chart-root.d.ts +21 -29
- package/dist/bar-chart/root/bar-chart-root.js +42 -57
- package/dist/breadcrumbs/breadcrumb/breadcrumb.d.ts +12 -18
- package/dist/breadcrumbs/breadcrumb/breadcrumb.js +13 -16
- package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +9 -28
- package/dist/breadcrumbs/root/breadcrumbs-root.js +9 -28
- package/dist/button/root/button-root.d.ts +84 -94
- package/dist/button/root/button-root.js +82 -92
- package/dist/callout/root/callout-root.d.ts +4 -5
- package/dist/carousel/root/carousel-root.d.ts +59 -71
- package/dist/carousel/root/carousel-root.js +73 -101
- package/dist/chat/composer/chat-composer.d.ts +29 -33
- package/dist/chat/composer/chat-composer.js +40 -44
- package/dist/chat/message/chat-message.d.ts +25 -25
- package/dist/chat/message/chat-message.js +26 -26
- package/dist/chat/root/chat-root.d.ts +28 -41
- package/dist/chat/root/chat-root.js +27 -40
- package/dist/checkbox/root/checkbox-root.d.ts +10 -12
- package/dist/checkbox/root/checkbox-root.js +29 -35
- package/dist/checkbox-group/root/checkbox-group-root.d.ts +32 -45
- package/dist/checkbox-group/root/checkbox-group-root.js +53 -79
- package/dist/code-block/root/code-block-root.d.ts +3 -4
- package/dist/code-block/root/code-block-root.js +8 -12
- package/dist/color-input/root/color-input-root.d.ts +36 -37
- package/dist/color-input/root/color-input-root.js +29 -34
- package/dist/color-picker/color.d.ts +7 -8
- package/dist/color-picker/color.js +7 -8
- package/dist/color-picker/root/color-picker-root.d.ts +55 -57
- package/dist/color-picker/root/color-picker-root.js +60 -64
- package/dist/combobox/root/combobox-root.d.ts +53 -58
- package/dist/combobox/root/combobox-root.js +85 -94
- package/dist/command/root/command-root.d.ts +8 -8
- package/dist/command/root/command-root.js +29 -33
- package/dist/copy-button/root/copy-button-root.d.ts +21 -24
- package/dist/copy-button/root/copy-button-root.js +25 -35
- package/dist/data-table/root/data-table-root.d.ts +77 -76
- package/dist/data-table/root/data-table-root.js +95 -84
- package/dist/data-table/root/order.d.ts +2 -2
- package/dist/data-table/root/order.js +1 -3
- package/dist/date-input/root/date-input-root.d.ts +88 -93
- package/dist/date-input/root/date-input-root.js +147 -158
- package/dist/date-picker/root/date-picker-root.d.ts +75 -83
- package/dist/date-picker/root/date-picker-root.js +120 -143
- package/dist/dialog/root/dialog-root.d.ts +41 -24
- package/dist/dialog/root/dialog-root.js +47 -24
- package/dist/divider/root/divider-root.d.ts +5 -6
- package/dist/divider/root/divider-root.js +4 -5
- package/dist/donut-chart/root/donut-chart-root.d.ts +22 -25
- package/dist/donut-chart/root/donut-chart-root.js +37 -51
- package/dist/drawer/root/drawer-root.d.ts +24 -29
- package/dist/drawer/root/drawer-root.js +15 -22
- package/dist/drilldown/item/drilldown-item.d.ts +14 -14
- package/dist/drilldown/item/drilldown-item.js +24 -26
- package/dist/drilldown/root/drilldown-root.d.ts +8 -10
- package/dist/drilldown/root/drilldown-root.js +6 -7
- package/dist/element-events.generated.js +1 -1
- package/dist/file-input/root/file-input-root.d.ts +20 -24
- package/dist/file-input/root/file-input-root.js +42 -57
- package/dist/format-date/root/format-date-root.js +1 -1
- package/dist/heatmap/root/buckets.d.ts +8 -8
- package/dist/heatmap/root/buckets.js +8 -8
- package/dist/heatmap/root/heatmap-root.d.ts +57 -63
- package/dist/heatmap/root/heatmap-root.js +72 -83
- package/dist/icon/root/icon-root.d.ts +4 -4
- package/dist/icon/root/icon-root.js +9 -9
- package/dist/icon-button/root/icon-button-root.d.ts +4 -6
- package/dist/icon-button/root/icon-button-root.js +4 -6
- package/dist/image/root/image-root.d.ts +49 -59
- package/dist/image/root/image-root.js +55 -65
- package/dist/index.d.ts +5 -5
- package/dist/index.js +5 -5
- package/dist/input/root/input-root.d.ts +61 -85
- package/dist/input/root/input-root.js +79 -106
- package/dist/kbd/root/kbd-root.d.ts +8 -7
- package/dist/kbd/root/kbd-root.js +71 -11
- package/dist/legend/root/legend-root.d.ts +1 -1
- package/dist/legend/root/legend-root.js +4 -5
- package/dist/line-chart/root/line-chart-root.d.ts +26 -30
- package/dist/line-chart/root/line-chart-root.js +10 -10
- package/dist/list/item/list-item.d.ts +14 -18
- package/dist/list/item/list-item.js +18 -22
- package/dist/list/root/list-root.d.ts +4 -4
- package/dist/list/root/list-root.js +3 -3
- package/dist/listbox/root/listbox-root.d.ts +31 -58
- package/dist/listbox/root/listbox-root.js +66 -109
- package/dist/megamenu/root/megamenu-root.d.ts +34 -35
- package/dist/megamenu/root/megamenu-root.js +53 -58
- package/dist/menu/item/menu-item.d.ts +39 -53
- package/dist/menu/item/menu-item.js +50 -64
- package/dist/menu/root/menu-root.d.ts +30 -40
- package/dist/menu/root/menu-root.js +49 -82
- package/dist/meter/root/meter-root.d.ts +49 -53
- package/dist/meter/root/meter-root.js +22 -27
- package/dist/navigation/root/navigation-root.js +11 -19
- package/dist/notifications/notification/notification.d.ts +16 -22
- package/dist/notifications/notification/notification.js +21 -27
- package/dist/notifications/root/notifications-root.d.ts +31 -39
- package/dist/notifications/root/notifications-root.js +41 -52
- package/dist/number-input/root/number-input-root.d.ts +31 -33
- package/dist/number-input/root/number-input-root.js +37 -39
- package/dist/option/root/option-root.d.ts +73 -74
- package/dist/option/root/option-root.js +62 -64
- package/dist/outline/root/outline-root.d.ts +38 -44
- package/dist/outline/root/outline-root.js +66 -82
- package/dist/pagination/root/pagination-root.d.ts +87 -92
- package/dist/pagination/root/pagination-root.js +116 -123
- package/dist/pagination/size/pagination-size.d.ts +31 -50
- package/dist/pagination/size/pagination-size.js +35 -55
- package/dist/pagination/summary/pagination-summary.d.ts +12 -12
- package/dist/pagination/summary/pagination-summary.js +18 -18
- package/dist/pin-input/root/pin-input-root.d.ts +53 -70
- package/dist/pin-input/root/pin-input-root.js +74 -94
- package/dist/popover/root/popover-root.d.ts +15 -20
- package/dist/popover/root/popover-root.js +19 -36
- package/dist/progress/root/progress-root.d.ts +12 -14
- package/dist/progress/root/progress-root.js +22 -25
- package/dist/qr-code/root/qr-code-root.d.ts +11 -11
- package/dist/qr-code/root/qr-code-root.js +12 -14
- package/dist/radio/group/radio-group.js +19 -26
- package/dist/radio/root/radio-root.d.ts +12 -13
- package/dist/radio/root/radio-root.js +12 -13
- package/dist/rating/root/rating-root.d.ts +25 -30
- package/dist/rating/root/rating-root.js +43 -50
- package/dist/scroll-area/root/scroll-area-root.d.ts +11 -14
- package/dist/scroll-area/root/scroll-area-root.js +39 -33
- package/dist/select/root/select-root.d.ts +7 -12
- package/dist/select/root/select-root.js +40 -55
- package/dist/slider/root/slider-root.d.ts +53 -60
- package/dist/slider/root/slider-root.js +74 -85
- package/dist/sparkline/root/sparkline-root.d.ts +43 -47
- package/dist/sparkline/root/sparkline-root.js +23 -32
- package/dist/speed-dial/item/speed-dial-item.d.ts +6 -6
- package/dist/speed-dial/item/speed-dial-item.js +9 -9
- package/dist/speed-dial/root/speed-dial-root.d.ts +21 -25
- package/dist/speed-dial/root/speed-dial-root.js +32 -40
- package/dist/splitter/root/splitter-root.d.ts +98 -111
- package/dist/splitter/root/splitter-root.js +96 -123
- package/dist/stat/root/stat-root.d.ts +2 -7
- package/dist/stat/root/stat-root.js +0 -5
- package/dist/steps/step/step.d.ts +19 -24
- package/dist/steps/step/step.js +27 -32
- package/dist/switch/root/switch-root.js +2 -2
- package/dist/table/column/table-column.d.ts +54 -60
- package/dist/table/column/table-column.js +95 -68
- package/dist/table/root/table-root.d.ts +5 -6
- package/dist/table/root/table-root.js +7 -10
- package/dist/tabs/panel/tab-panel.d.ts +21 -25
- package/dist/tabs/panel/tab-panel.js +25 -29
- package/dist/tabs/root/tabs-root.d.ts +25 -34
- package/dist/tabs/root/tabs-root.js +22 -28
- package/dist/tabs/tab/tab.d.ts +12 -12
- package/dist/tabs/tab/tab.js +19 -20
- package/dist/textarea/root/textarea-root.d.ts +36 -36
- package/dist/textarea/root/textarea-root.js +43 -47
- package/dist/time-input/root/time-input-root.d.ts +58 -68
- package/dist/time-input/root/time-input-root.js +62 -77
- package/dist/time-picker/root/time-picker-root.d.ts +73 -79
- package/dist/time-picker/root/time-picker-root.js +72 -84
- package/dist/timeline/item/timeline-item.d.ts +8 -11
- package/dist/timeline/item/timeline-item.js +8 -11
- package/dist/timeline/root/timeline-root.d.ts +5 -7
- package/dist/timeline/root/timeline-root.js +5 -7
- package/dist/toast/item/toast-item.d.ts +9 -27
- package/dist/toast/item/toast-item.js +19 -41
- package/dist/toast/root/toast-root.d.ts +10 -14
- package/dist/toast/root/toast-root.js +4 -5
- package/dist/toggle/group/toggle-group.d.ts +6 -15
- package/dist/toggle/group/toggle-group.js +21 -36
- package/dist/toggle/root/toggle-root.d.ts +26 -27
- package/dist/toggle/root/toggle-root.js +30 -31
- package/dist/toolbar/root/toolbar-root.d.ts +7 -10
- package/dist/toolbar/root/toolbar-root.js +10 -14
- package/dist/tooltip/root/tooltip-root.d.ts +52 -59
- package/dist/tooltip/root/tooltip-root.js +98 -93
- package/dist/tour/root/tour-root.d.ts +19 -23
- package/dist/tour/root/tour-root.js +31 -41
- package/dist/tour/stop/tour-stop.d.ts +14 -15
- package/dist/tour/stop/tour-stop.js +31 -34
- package/dist/tree/item/tree-item.d.ts +30 -35
- package/dist/tree/item/tree-item.js +43 -55
- package/dist/tree/root/tree-root.d.ts +7 -10
- package/dist/tree/root/tree-root.js +33 -42
- package/dist/trend/root/trend-root.d.ts +3 -5
- package/dist/trend/root/trend-root.js +5 -9
- package/dist/video/root/video-root.d.ts +100 -124
- package/dist/video/root/video-root.js +142 -176
- package/dist/video-playlist/item/video-playlist-item.d.ts +16 -16
- package/dist/video-playlist/item/video-playlist-item.js +24 -24
- package/dist/video-playlist/menu/video-playlist-menu.d.ts +5 -8
- package/dist/video-playlist/menu/video-playlist-menu.js +20 -29
- package/dist/video-playlist/root/video-playlist-root.d.ts +16 -11
- package/dist/video-playlist/root/video-playlist-root.js +21 -25
- package/dist/virtual-list/root/virtual-list-root.d.ts +8 -12
- package/dist/virtual-list/root/virtual-list-root.js +11 -16
- package/jsx.d.ts +9797 -12561
- package/package.json +6 -6
- package/vue.d.ts +2684 -3228
|
@@ -64,13 +64,12 @@ const fill = (template, page, pages, format = String) => template.replaceAll('{p
|
|
|
64
64
|
* result that has not changed. A consumer driving the view has to be able to
|
|
65
65
|
* hear that without being told an answer changed.
|
|
66
66
|
*
|
|
67
|
-
* **The count and the page-size control are their own elements.**
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* and
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* else.
|
|
67
|
+
* **The count and the page-size control are their own elements.** A slot can
|
|
68
|
+
* only offer one place: at one end of one row, in one order, on one axis.
|
|
69
|
+
* `Pagination.Summary` and `Pagination.Size` sit beside this one instead, so
|
|
70
|
+
* the direction and the order of a footer are the consumer's, which is what
|
|
71
|
+
* they were always going to want. `total` and `page-size` stay here for the
|
|
72
|
+
* arithmetic below and nothing else.
|
|
74
73
|
*
|
|
75
74
|
* **A single page renders nothing.** A control offering one page offers no
|
|
76
75
|
* navigation, and the row it sits in should close over it rather than hold a
|
|
@@ -80,16 +79,16 @@ const fill = (template, page, pages, format = String) => template.replaceAll('{p
|
|
|
80
79
|
* framework reports the difference; a custom state carries the same fact to a
|
|
81
80
|
* stylesheet and none of that to the DOM.
|
|
82
81
|
*
|
|
83
|
-
* **And a page change is announced.**
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
82
|
+
* **And a page change is announced.** Moving the page moves `aria-current` onto
|
|
83
|
+
* a different element, which a screen reader does not announce, so a reader who
|
|
84
|
+
* pressed 5 hears the word "5" from the button they were on and nothing at all
|
|
85
|
+
* about having arrived. A polite live region says where they now are. It ships
|
|
86
|
+
* empty and is filled only on a change, because a region populated as it enters
|
|
87
|
+
* the document announces itself on arrival.
|
|
89
88
|
*
|
|
90
|
-
* `page` is the
|
|
91
|
-
*
|
|
92
|
-
*
|
|
89
|
+
* `page` is what the element holds and `default-page` seeds it. A consumer
|
|
90
|
+
* paging through a router refuses `helix-navigate` and assigns their own, which
|
|
91
|
+
* is how they take the decision.
|
|
93
92
|
*
|
|
94
93
|
* @since 0.1.0
|
|
95
94
|
* @status experimental
|
|
@@ -120,35 +119,25 @@ let HelixHeadlessPagination = class HelixHeadlessPagination extends HelixElement
|
|
|
120
119
|
constructor() {
|
|
121
120
|
super(...arguments);
|
|
122
121
|
/**
|
|
123
|
-
* How many pages
|
|
124
|
-
*
|
|
125
|
-
* Clamped to at least one wherever it is read, so a result that has not
|
|
126
|
-
* loaded yet renders a single page rather than an empty control that then
|
|
127
|
-
* appears and pushes the layout down.
|
|
128
|
-
*
|
|
129
|
-
* Left unset where `total` and `page-size` are both given, since the two of
|
|
130
|
-
* them already say it. A fallback rather than an override: writing this wins,
|
|
131
|
-
* so there is never a question of which of two sources is current.
|
|
122
|
+
* How many pages to show at each end, whatever the current one is.
|
|
132
123
|
*/
|
|
133
|
-
this.
|
|
124
|
+
this.boundaries = 1;
|
|
134
125
|
/**
|
|
135
|
-
*
|
|
126
|
+
* Where the numbers are replaced by a reading of the two.
|
|
136
127
|
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
128
|
+
* A different structure rather than a different look, which is why it is
|
|
129
|
+
* here: the run of pages is gone and a single status line stands in its
|
|
130
|
+
* place. This is the shape a narrow screen wants, and the only shape possible
|
|
131
|
+
* where the total is large enough that no window over it is useful.
|
|
139
132
|
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
133
|
+
* Not reflected, for the reason `ends` is not: it decides what renders, so
|
|
134
|
+
* nothing has to select on it.
|
|
142
135
|
*/
|
|
143
|
-
this.
|
|
136
|
+
this.compact = false;
|
|
144
137
|
/**
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
* Only arithmetic: this does not slice anything, because the component never
|
|
148
|
-
* sees the items. It is what turns `total` into a page count, and nothing
|
|
149
|
-
* else.
|
|
138
|
+
* Page to open on, where nothing declared one.
|
|
150
139
|
*/
|
|
151
|
-
this.
|
|
140
|
+
this.defaultPage = 1;
|
|
152
141
|
/**
|
|
153
142
|
* Whether to offer a jump to the first and last pages.
|
|
154
143
|
*
|
|
@@ -165,17 +154,13 @@ let HelixHeadlessPagination = class HelixHeadlessPagination extends HelixElement
|
|
|
165
154
|
*/
|
|
166
155
|
this.ends = false;
|
|
167
156
|
/**
|
|
168
|
-
*
|
|
169
|
-
*/
|
|
170
|
-
this.defaultPage = 1;
|
|
171
|
-
/**
|
|
172
|
-
* How many pages to show either side of the current one.
|
|
157
|
+
* Accessible name for the control that jumps to the first page.
|
|
173
158
|
*/
|
|
174
|
-
this.
|
|
159
|
+
this.firstLabel = 'First page';
|
|
175
160
|
/**
|
|
176
|
-
*
|
|
161
|
+
* Accessible name for a gap, with `{page}` filled in as where it goes.
|
|
177
162
|
*/
|
|
178
|
-
this.
|
|
163
|
+
this.gapLabel = 'Skip to page {page}';
|
|
179
164
|
/**
|
|
180
165
|
* Address for a page, with `{page}` standing in for its number.
|
|
181
166
|
*
|
|
@@ -184,22 +169,14 @@ let HelixHeadlessPagination = class HelixHeadlessPagination extends HelixElement
|
|
|
184
169
|
* one, and the back button works without the consumer wiring anything.
|
|
185
170
|
*/
|
|
186
171
|
this.href = '';
|
|
187
|
-
/**
|
|
188
|
-
* Where the numbers are replaced by a reading of the two.
|
|
189
|
-
*
|
|
190
|
-
* A different structure rather than a different look, which is why it is
|
|
191
|
-
* here: the run of pages is gone and a single status line stands in its
|
|
192
|
-
* place. This is the shape a narrow screen wants, and the only shape possible
|
|
193
|
-
* where the total is large enough that no window over it is useful.
|
|
194
|
-
*
|
|
195
|
-
* Not reflected, for the reason `ends` is not: it decides what renders, so
|
|
196
|
-
* nothing has to select on it.
|
|
197
|
-
*/
|
|
198
|
-
this.compact = false;
|
|
199
172
|
/**
|
|
200
173
|
* Accessible name for the navigation landmark.
|
|
201
174
|
*/
|
|
202
175
|
this.label = 'Pagination';
|
|
176
|
+
/**
|
|
177
|
+
* Accessible name for the control that jumps to the last page.
|
|
178
|
+
*/
|
|
179
|
+
this.lastLabel = 'Last page';
|
|
203
180
|
/**
|
|
204
181
|
* Locale for the page numbers. Absent uses the runtime's own.
|
|
205
182
|
*
|
|
@@ -214,39 +191,61 @@ let HelixHeadlessPagination = class HelixHeadlessPagination extends HelixElement
|
|
|
214
191
|
* different address from `?page=1234`.
|
|
215
192
|
*/
|
|
216
193
|
this.locale = '';
|
|
194
|
+
/**
|
|
195
|
+
* Accessible name for the control that moves forward.
|
|
196
|
+
*/
|
|
197
|
+
this.nextLabel = 'Next page';
|
|
217
198
|
/**
|
|
218
199
|
* Accessible name for one page, with `{page}` and `{pages}` filled in.
|
|
219
200
|
*/
|
|
220
201
|
this.pageLabel = 'Page {page}';
|
|
221
202
|
/**
|
|
222
|
-
*
|
|
203
|
+
* How many pages there are in total.
|
|
204
|
+
*
|
|
205
|
+
* Clamped to at least one wherever it is read, so a result that has not
|
|
206
|
+
* loaded yet renders a single page rather than an empty control that then
|
|
207
|
+
* appears and pushes the layout down.
|
|
223
208
|
*
|
|
224
|
-
*
|
|
225
|
-
* already
|
|
226
|
-
*
|
|
227
|
-
* existing is that the row is narrow. The numbers are the reading.
|
|
209
|
+
* Left unset where `total` and `page-size` are both given, since the two of
|
|
210
|
+
* them already say it. A fallback rather than an override: writing this wins,
|
|
211
|
+
* so there is never a question of which of two sources is current.
|
|
228
212
|
*/
|
|
229
|
-
this.
|
|
213
|
+
this.pages = 0;
|
|
230
214
|
/**
|
|
231
|
-
*
|
|
215
|
+
* How many items are on a page.
|
|
216
|
+
*
|
|
217
|
+
* Only arithmetic: this does not slice anything, because the component never
|
|
218
|
+
* sees the items. It is what turns `total` into a page count, and nothing
|
|
219
|
+
* else.
|
|
232
220
|
*/
|
|
233
|
-
this.
|
|
221
|
+
this.pageSize = 0;
|
|
234
222
|
/**
|
|
235
|
-
* Accessible name for the control that moves
|
|
223
|
+
* Accessible name for the control that moves back.
|
|
236
224
|
*/
|
|
237
|
-
this.
|
|
225
|
+
this.previousLabel = 'Previous page';
|
|
238
226
|
/**
|
|
239
|
-
*
|
|
227
|
+
* How many pages to show either side of the current one.
|
|
240
228
|
*/
|
|
241
|
-
this.
|
|
229
|
+
this.siblings = 1;
|
|
242
230
|
/**
|
|
243
|
-
*
|
|
231
|
+
* The reading shown in `compact`, with `{page}` and `{pages}` filled in.
|
|
232
|
+
*
|
|
233
|
+
* No noun: the landmark this sits in is already named "Pagination", so
|
|
234
|
+
* "Page 7 of 24" says it twice to a screen reader and takes a third of the
|
|
235
|
+
* width from a control whose whole reason for existing is that the row is
|
|
236
|
+
* narrow. The numbers are the reading.
|
|
244
237
|
*/
|
|
245
|
-
this.
|
|
238
|
+
this.statusLabel = '{page} of {pages}';
|
|
246
239
|
/**
|
|
247
|
-
*
|
|
240
|
+
* How many items there are across every page.
|
|
241
|
+
*
|
|
242
|
+
* What `pages` falls back to together with `page-size`. Unset is the common
|
|
243
|
+
* case, where a consumer knows the page total and not the item total.
|
|
244
|
+
*
|
|
245
|
+
* Nothing is rendered from it. `Pagination.Summary` is what reads a total out
|
|
246
|
+
* to a reader, and takes its own.
|
|
248
247
|
*/
|
|
249
|
-
this.
|
|
248
|
+
this.total = 0;
|
|
250
249
|
/**
|
|
251
250
|
* What the live region says, and nothing until the page has moved once.
|
|
252
251
|
*
|
|
@@ -277,19 +276,17 @@ let HelixHeadlessPagination = class HelixHeadlessPagination extends HelixElement
|
|
|
277
276
|
* The page on show, one-based.
|
|
278
277
|
*
|
|
279
278
|
* An accessor pair, the same shape as the calendar's `month`. Reading gives
|
|
280
|
-
* the page on show; writing
|
|
281
|
-
*
|
|
279
|
+
* the page on show; writing sets it, and `default-page` seeds one the element
|
|
280
|
+
* keeps until somebody does.
|
|
282
281
|
*
|
|
283
282
|
* **Clamped on the way out, because "the page on show" is what it says it
|
|
284
|
-
* gives.**
|
|
285
|
-
* ten-page result
|
|
286
|
-
*
|
|
287
|
-
* not exist while the control in front of them
|
|
283
|
+
* gives.** Returning whatever was written means `default-page="99"` on a
|
|
284
|
+
* ten-page result renders page 10, marks page 10 with `aria-current`, and
|
|
285
|
+
* reports 99, so a consumer syncing their query from this reads a page that
|
|
286
|
+
* does not exist while the control in front of them says otherwise. Not a
|
|
288
287
|
* far-fetched value: it is a bookmarked link after the result shrank.
|
|
289
288
|
*
|
|
290
289
|
* Rounded here too, so `2.7` reads as the 2 it renders.
|
|
291
|
-
*
|
|
292
|
-
*
|
|
293
290
|
*/
|
|
294
291
|
get page() {
|
|
295
292
|
const asked = this.pageState ?? this.defaultPage;
|
|
@@ -322,7 +319,7 @@ let HelixHeadlessPagination = class HelixHeadlessPagination extends HelixElement
|
|
|
322
319
|
}
|
|
323
320
|
return 1;
|
|
324
321
|
}
|
|
325
|
-
/** The page on show
|
|
322
|
+
/** The page on show, which `page` has already clamped. */
|
|
326
323
|
get current() {
|
|
327
324
|
return this.page;
|
|
328
325
|
}
|
|
@@ -379,9 +376,8 @@ let HelixHeadlessPagination = class HelixHeadlessPagination extends HelixElement
|
|
|
379
376
|
* Asks to move, and reports whether the request stood.
|
|
380
377
|
*
|
|
381
378
|
* Announced before it is applied, so `preventDefault()` is a refusal and
|
|
382
|
-
* nothing moves.
|
|
383
|
-
*
|
|
384
|
-
* asked for another one.
|
|
379
|
+
* nothing moves. A consumer who holds the page refuses it and assigns their
|
|
380
|
+
* own.
|
|
385
381
|
*/
|
|
386
382
|
request(next) {
|
|
387
383
|
if (next === this.current || next < 1 || next > this.count) {
|
|
@@ -406,11 +402,9 @@ let HelixHeadlessPagination = class HelixHeadlessPagination extends HelixElement
|
|
|
406
402
|
default name at all: an author's own `aria-label` is an attribute and
|
|
407
403
|
beats internals, so naming it here costs them nothing. */
|
|
408
404
|
hostAria(this.internals, { label: this.label, role: 'navigation' });
|
|
409
|
-
/* Through `toggleState`, which carries the feature test
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
of disappearing, which is the behavior this had before and is not
|
|
413
|
-
broken. */
|
|
405
|
+
/* Through `toggleState`, which carries the feature test: an engine without
|
|
406
|
+
`CustomStateSet` gets a control that renders its one page instead of
|
|
407
|
+
disappearing, which is degraded rather than broken. */
|
|
414
408
|
this.toggleState('empty', this.count <= 1);
|
|
415
409
|
}
|
|
416
410
|
/**
|
|
@@ -481,9 +475,9 @@ let HelixHeadlessPagination = class HelixHeadlessPagination extends HelixElement
|
|
|
481
475
|
* at which it stops being possible. It would also make `Pagination` depend on
|
|
482
476
|
* `Menu` and `Popover` for a case a button already covers.
|
|
483
477
|
*
|
|
484
|
-
* So it is announced rather than hidden
|
|
485
|
-
*
|
|
486
|
-
*
|
|
478
|
+
* So it is announced rather than hidden: a control a reader can reach has to
|
|
479
|
+
* be in the tree, and the label naming its destination is the whole
|
|
480
|
+
* affordance.
|
|
487
481
|
*/
|
|
488
482
|
renderGap(hidden) {
|
|
489
483
|
const to = Math.round((hidden.from + hidden.to) / 2);
|
|
@@ -510,9 +504,8 @@ let HelixHeadlessPagination = class HelixHeadlessPagination extends HelixElement
|
|
|
510
504
|
/**
|
|
511
505
|
* Everything a step needs, computed once, so the markup below is only markup.
|
|
512
506
|
*
|
|
513
|
-
* Split out because the part name has to be a literal.
|
|
514
|
-
*
|
|
515
|
-
* cannot see: nothing pairs it with its `@csspart` and a later rename takes
|
|
507
|
+
* Split out because the part name has to be a literal. A part name is read
|
|
508
|
+
* from the source, so a computed one is a part nothing can see: nothing pairs it with its `@csspart` and a later rename takes
|
|
516
509
|
* the promise silently. With four controls and two shapes each that is eight
|
|
517
510
|
* literals, and eight copies of the arithmetic behind them would be the
|
|
518
511
|
* actual duplication. This is the arithmetic, written once.
|
|
@@ -631,13 +624,13 @@ let HelixHeadlessPagination = class HelixHeadlessPagination extends HelixElement
|
|
|
631
624
|
};
|
|
632
625
|
__decorate([
|
|
633
626
|
property({ type: Number })
|
|
634
|
-
], HelixHeadlessPagination.prototype, "
|
|
627
|
+
], HelixHeadlessPagination.prototype, "boundaries", void 0);
|
|
635
628
|
__decorate([
|
|
636
|
-
property({ type:
|
|
637
|
-
], HelixHeadlessPagination.prototype, "
|
|
629
|
+
property({ type: Boolean })
|
|
630
|
+
], HelixHeadlessPagination.prototype, "compact", void 0);
|
|
638
631
|
__decorate([
|
|
639
|
-
property({ attribute: 'page
|
|
640
|
-
], HelixHeadlessPagination.prototype, "
|
|
632
|
+
property({ attribute: 'default-page', type: Number })
|
|
633
|
+
], HelixHeadlessPagination.prototype, "defaultPage", void 0);
|
|
641
634
|
__decorate([
|
|
642
635
|
property({ type: Boolean })
|
|
643
636
|
], HelixHeadlessPagination.prototype, "ends", void 0);
|
|
@@ -645,47 +638,47 @@ __decorate([
|
|
|
645
638
|
property({ type: Number })
|
|
646
639
|
], HelixHeadlessPagination.prototype, "page", null);
|
|
647
640
|
__decorate([
|
|
648
|
-
property({ attribute: '
|
|
649
|
-
], HelixHeadlessPagination.prototype, "
|
|
650
|
-
__decorate([
|
|
651
|
-
property({ type: Number })
|
|
652
|
-
], HelixHeadlessPagination.prototype, "siblings", void 0);
|
|
641
|
+
property({ attribute: 'first-label' })
|
|
642
|
+
], HelixHeadlessPagination.prototype, "firstLabel", void 0);
|
|
653
643
|
__decorate([
|
|
654
|
-
property({
|
|
655
|
-
], HelixHeadlessPagination.prototype, "
|
|
644
|
+
property({ attribute: 'gap-label' })
|
|
645
|
+
], HelixHeadlessPagination.prototype, "gapLabel", void 0);
|
|
656
646
|
__decorate([
|
|
657
647
|
property()
|
|
658
648
|
], HelixHeadlessPagination.prototype, "href", void 0);
|
|
659
|
-
__decorate([
|
|
660
|
-
property({ type: Boolean })
|
|
661
|
-
], HelixHeadlessPagination.prototype, "compact", void 0);
|
|
662
649
|
__decorate([
|
|
663
650
|
property()
|
|
664
651
|
], HelixHeadlessPagination.prototype, "label", void 0);
|
|
652
|
+
__decorate([
|
|
653
|
+
property({ attribute: 'last-label' })
|
|
654
|
+
], HelixHeadlessPagination.prototype, "lastLabel", void 0);
|
|
665
655
|
__decorate([
|
|
666
656
|
property()
|
|
667
657
|
], HelixHeadlessPagination.prototype, "locale", void 0);
|
|
658
|
+
__decorate([
|
|
659
|
+
property({ attribute: 'next-label' })
|
|
660
|
+
], HelixHeadlessPagination.prototype, "nextLabel", void 0);
|
|
668
661
|
__decorate([
|
|
669
662
|
property({ attribute: 'page-label' })
|
|
670
663
|
], HelixHeadlessPagination.prototype, "pageLabel", void 0);
|
|
671
664
|
__decorate([
|
|
672
|
-
property({
|
|
673
|
-
], HelixHeadlessPagination.prototype, "
|
|
665
|
+
property({ type: Number })
|
|
666
|
+
], HelixHeadlessPagination.prototype, "pages", void 0);
|
|
667
|
+
__decorate([
|
|
668
|
+
property({ attribute: 'page-size', type: Number })
|
|
669
|
+
], HelixHeadlessPagination.prototype, "pageSize", void 0);
|
|
674
670
|
__decorate([
|
|
675
671
|
property({ attribute: 'previous-label' })
|
|
676
672
|
], HelixHeadlessPagination.prototype, "previousLabel", void 0);
|
|
677
673
|
__decorate([
|
|
678
|
-
property({
|
|
679
|
-
], HelixHeadlessPagination.prototype, "
|
|
680
|
-
__decorate([
|
|
681
|
-
property({ attribute: 'first-label' })
|
|
682
|
-
], HelixHeadlessPagination.prototype, "firstLabel", void 0);
|
|
674
|
+
property({ type: Number })
|
|
675
|
+
], HelixHeadlessPagination.prototype, "siblings", void 0);
|
|
683
676
|
__decorate([
|
|
684
|
-
property({ attribute: '
|
|
685
|
-
], HelixHeadlessPagination.prototype, "
|
|
677
|
+
property({ attribute: 'status-label' })
|
|
678
|
+
], HelixHeadlessPagination.prototype, "statusLabel", void 0);
|
|
686
679
|
__decorate([
|
|
687
|
-
property({
|
|
688
|
-
], HelixHeadlessPagination.prototype, "
|
|
680
|
+
property({ type: Number })
|
|
681
|
+
], HelixHeadlessPagination.prototype, "total", void 0);
|
|
689
682
|
__decorate([
|
|
690
683
|
state()
|
|
691
684
|
], HelixHeadlessPagination.prototype, "announcement", void 0);
|
|
@@ -11,37 +11,26 @@ import '../../select/index.js';
|
|
|
11
11
|
* consumer's, and a control that can only sit at one end of one row has taken
|
|
12
12
|
* that decision for them.
|
|
13
13
|
*
|
|
14
|
-
* **`Select`, not a native `<select>`.**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* is the whole product here, and it wins.
|
|
14
|
+
* **`Select`, not a native `<select>`.** Two dropdowns identical closed and
|
|
15
|
+
* different open meet each other in the same footer as a table's filters. The
|
|
16
|
+
* caret is `Select`'s rather than a color literal baked into a data URI,
|
|
17
|
+
* because a background image cannot read `currentColor`, and the label is a
|
|
18
|
+
* real `<label for>` against the trigger's own id.
|
|
20
19
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* `
|
|
24
|
-
* own id, which `Select` already renders and already tests.
|
|
20
|
+
* **The label sits on the row, not above it.** `Select`'s host is a column, and
|
|
21
|
+
* an outer-tree rule beats a `:host` rule, so turning it into a row needs no
|
|
22
|
+
* property on `Select` and nothing written into the consumer's markup.
|
|
25
23
|
*
|
|
26
|
-
* **
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* and nothing written into the consumer's markup.
|
|
24
|
+
* **An empty `sizes` renders nothing**, rather than falling back to the
|
|
25
|
+
* built-in list, which would be a component overruling a consumer who said
|
|
26
|
+
* "none". Same rule as `Pagination` over a single page, and reported the same
|
|
27
|
+
* way, through `ElementInternals.states` rather than an attribute the server
|
|
28
|
+
* never wrote.
|
|
32
29
|
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* over a single page, and reported the same way, through
|
|
38
|
-
* `ElementInternals.states` rather than an attribute the server never wrote.
|
|
39
|
-
*
|
|
40
|
-
* `value` is the controlled property and `default-value` seeds one this owns,
|
|
41
|
-
* the same contract every other stateful element here carries. Changing it
|
|
42
|
-
* announces `helix-before-change`; what a consumer does with that is re-query and move
|
|
43
|
-
* back to page one, which is theirs to decide because only they know whether
|
|
44
|
-
* the reader's position should survive it.
|
|
30
|
+
* `value` is the controlled property and `default-value` seeds one this owns.
|
|
31
|
+
* Changing it announces `helix-before-change`; re-querying and moving back to
|
|
32
|
+
* page one is the consumer's, because only they know whether the reader's
|
|
33
|
+
* position should survive it.
|
|
45
34
|
*
|
|
46
35
|
* @since 0.1.0
|
|
47
36
|
* @status experimental
|
|
@@ -57,28 +46,18 @@ import '../../select/index.js';
|
|
|
57
46
|
*/
|
|
58
47
|
export declare class HelixHeadlessPaginationSize extends HelixElement {
|
|
59
48
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* A string rather than an array, so the whole control is expressible in
|
|
63
|
-
* markup and survives a server render. Anything that is not a positive number
|
|
64
|
-
* is dropped rather than rendered as an option that cannot mean anything.
|
|
49
|
+
* Size to start on, where nothing declared one.
|
|
65
50
|
*/
|
|
66
|
-
|
|
51
|
+
defaultValue: number;
|
|
67
52
|
/**
|
|
68
53
|
* The size in force.
|
|
69
54
|
*
|
|
70
55
|
* Reading gives the real one; writing declares it the consumer's, and
|
|
71
56
|
* `default-value` seeds one this element owns. Same accessor pair as
|
|
72
57
|
* `Pagination.page` and the calendar's `month`.
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
58
|
*/
|
|
76
59
|
get value(): number;
|
|
77
60
|
set value(next: number);
|
|
78
|
-
/**
|
|
79
|
-
* Size to start on, where nothing declared one.
|
|
80
|
-
*/
|
|
81
|
-
defaultValue: number;
|
|
82
61
|
/**
|
|
83
62
|
* The words beside the control.
|
|
84
63
|
*/
|
|
@@ -89,6 +68,14 @@ export declare class HelixHeadlessPaginationSize extends HelixElement {
|
|
|
89
68
|
* Absent uses the runtime's own.
|
|
90
69
|
*/
|
|
91
70
|
locale: string;
|
|
71
|
+
/**
|
|
72
|
+
* The sizes offered, comma separated.
|
|
73
|
+
*
|
|
74
|
+
* A string rather than an array, so the whole control is expressible in
|
|
75
|
+
* markup and survives a server render. Anything that is not a positive number
|
|
76
|
+
* is dropped rather than rendered as an option that cannot mean anything.
|
|
77
|
+
*/
|
|
78
|
+
sizes: string;
|
|
92
79
|
/** The size, whoever set it, and `undefined` until somebody has. */
|
|
93
80
|
private valueState;
|
|
94
81
|
/** Held across every component asking for the same locale. */
|
|
@@ -106,16 +93,10 @@ export declare class HelixHeadlessPaginationSize extends HelixElement {
|
|
|
106
93
|
* wrap this one, pass it a property the base does not know about, or leave it
|
|
107
94
|
* out, without reimplementing the whole template to do any of them.
|
|
108
95
|
*
|
|
109
|
-
* **The tags are interpolated, so each tier renders its own.**
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
* name
|
|
113
|
-
* tier composes an element it does not ship, and the composition cannot be
|
|
114
|
-
* tested here at all, since there is no `helix-select` on this tier to test it
|
|
115
|
-
* against. `tier` resolves the name instead, and the styled subclass changes
|
|
116
|
-
* it in one line rather than reimplementing this method. A tier that renders
|
|
117
|
-
* its own elements is a tier that stands alone, which is the claim the package
|
|
118
|
-
* makes.
|
|
96
|
+
* **The tags are interpolated, so each tier renders its own.** Writing
|
|
97
|
+
* `<helix-select>` out would make this tier compose an element it does not
|
|
98
|
+
* ship and cannot test against, there being no `helix-select` here. `tier`
|
|
99
|
+
* resolves the name instead, and the styled subclass changes it in one line.
|
|
119
100
|
*/
|
|
120
101
|
protected renderSelect(): TemplateResult;
|
|
121
102
|
protected render(): TemplateResult | typeof nothing;
|