@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
|
@@ -42,37 +42,39 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
42
42
|
*/
|
|
43
43
|
export declare class HelixHeadlessOption extends HelixElement {
|
|
44
44
|
/**
|
|
45
|
-
* Whether this
|
|
45
|
+
* Whether this is the option the keyboard is on.
|
|
46
|
+
*
|
|
47
|
+
* Written by the listbox.
|
|
46
48
|
*/
|
|
47
|
-
|
|
49
|
+
active: boolean;
|
|
48
50
|
/**
|
|
49
|
-
* A second
|
|
51
|
+
* A second destination for this row, taken with the modifier held.
|
|
50
52
|
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
53
|
+
* **An attribute rather than a second row, which is the whole point.** A
|
|
54
|
+
* palette of eighty-eight components that offered each of them a reference
|
|
55
|
+
* page and a sandbox as separate entries would be a palette of a hundred and
|
|
56
|
+
* seventy-six, and one earns its keep by getting a reader to one thing in
|
|
57
|
+
* three keystrokes. The row already carries the first destination, so the
|
|
58
|
+
* second belongs beside it.
|
|
56
59
|
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* filled, so every option without a caption would carry an empty line. The
|
|
62
|
-
* detection that would avoid it does not exist, `:host(:has())` being invalid
|
|
63
|
-
* and the server having no children to inspect. A property is known at render
|
|
64
|
-
* time, so the component can decline to draw the box at all.
|
|
60
|
+
* Declared here and acted on by whatever owns the list, the same division
|
|
61
|
+
* selection already uses: an option says what it is and the listbox decides
|
|
62
|
+
* what happens. `Command` is the only owner that reads it today, because a
|
|
63
|
+
* select has one destination by definition.
|
|
65
64
|
*
|
|
66
|
-
*
|
|
67
|
-
* string is not a fact a selector needs.
|
|
65
|
+
* Absent is a row with one destination, which is nearly every row.
|
|
68
66
|
*/
|
|
69
|
-
|
|
67
|
+
alternate: string;
|
|
70
68
|
/**
|
|
71
|
-
*
|
|
69
|
+
* What the second destination is, for a reader who cannot see the footer.
|
|
72
70
|
*
|
|
73
|
-
*
|
|
71
|
+
* A row with two destinations needs both said, or a screen reader is told
|
|
72
|
+
* about one of them and the other is a key nobody mentioned. It goes to
|
|
73
|
+
* `aria-description` rather than into the name: the name is the row's own
|
|
74
|
+
* words and stays what a reader searched for, and the second destination is a
|
|
75
|
+
* fact about what pressing a key would do, which is what a description is.
|
|
74
76
|
*/
|
|
75
|
-
|
|
77
|
+
alternateLabel: string;
|
|
76
78
|
/**
|
|
77
79
|
* Whether the markup declared this one chosen, which is what a reset returns to.
|
|
78
80
|
*
|
|
@@ -93,11 +95,31 @@ export declare class HelixHeadlessOption extends HelixElement {
|
|
|
93
95
|
/** What the markup said, read once at construction for the reason above. */
|
|
94
96
|
private seeded;
|
|
95
97
|
/**
|
|
96
|
-
*
|
|
98
|
+
* A second line under the words, for what the choice actually is.
|
|
97
99
|
*
|
|
98
|
-
*
|
|
100
|
+
* A palette row reads better as a name and a caption than as one sentence
|
|
101
|
+
* carrying both: "Helix" and "the design system" are two facts, and a comma
|
|
102
|
+
* between them makes a reader parse the punctuation to find where the name
|
|
103
|
+
* ends. Matching still reads the label, so what somebody types is matched
|
|
104
|
+
* against the name rather than against prose about it.
|
|
105
|
+
*
|
|
106
|
+
* **A property and not a slot, which is the departure worth explaining.** The
|
|
107
|
+
* area rules say a content property is its slot's fallback, and that holds for
|
|
108
|
+
* a region always drawn: `Avatar`'s initials, `Tooltip`'s text. This one is
|
|
109
|
+
* usually absent, and a wrapped slot generates a box whether or not it is
|
|
110
|
+
* filled, so every option without a caption would carry an empty line. The
|
|
111
|
+
* detection that would avoid it does not exist, `:host(:has())` being invalid
|
|
112
|
+
* and the server having no children to inspect. A property is known at render
|
|
113
|
+
* time, so the component can decline to draw the box at all.
|
|
114
|
+
*
|
|
115
|
+
* It does not reflect, per the rule that payload state stays off the host: a
|
|
116
|
+
* string is not a fact a selector needs.
|
|
99
117
|
*/
|
|
100
|
-
|
|
118
|
+
description?: string;
|
|
119
|
+
/**
|
|
120
|
+
* Whether this choice can be made.
|
|
121
|
+
*/
|
|
122
|
+
disabled: boolean;
|
|
101
123
|
/**
|
|
102
124
|
* A shorter name for this choice, for where the row does not fit.
|
|
103
125
|
*
|
|
@@ -108,37 +130,15 @@ export declare class HelixHeadlessOption extends HelixElement {
|
|
|
108
130
|
*/
|
|
109
131
|
label: string;
|
|
110
132
|
/**
|
|
111
|
-
*
|
|
112
|
-
*/
|
|
113
|
-
value: string;
|
|
114
|
-
/**
|
|
115
|
-
* A second destination for this row, taken with the modifier held.
|
|
116
|
-
*
|
|
117
|
-
* **An attribute rather than a second row, which is the whole point.** A
|
|
118
|
-
* palette of eighty-eight components that offered each of them a reference
|
|
119
|
-
* page and a sandbox as separate entries would be a palette of a hundred and
|
|
120
|
-
* seventy-six, and one earns its keep by getting a reader to one thing in
|
|
121
|
-
* three keystrokes. The row already carries the first destination, so the
|
|
122
|
-
* second belongs beside it.
|
|
123
|
-
*
|
|
124
|
-
* Declared here and acted on by whatever owns the list, the same division
|
|
125
|
-
* selection already uses: an option says what it is and the listbox decides
|
|
126
|
-
* what happens. `Command` is the only owner that reads it today, because a
|
|
127
|
-
* select has one destination by definition.
|
|
133
|
+
* Whether this choice is currently chosen.
|
|
128
134
|
*
|
|
129
|
-
*
|
|
135
|
+
* Written by the listbox.
|
|
130
136
|
*/
|
|
131
|
-
|
|
137
|
+
selected: boolean;
|
|
132
138
|
/**
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
* A row with two destinations needs both said, or a screen reader is told
|
|
136
|
-
* about one of them and the other is a key nobody mentioned. It goes to
|
|
137
|
-
* `aria-description` rather than into the name: the name is the row's own
|
|
138
|
-
* words and stays what a reader searched for, and the second destination is a
|
|
139
|
-
* fact about what pressing a key would do, which is what a description is.
|
|
139
|
+
* Identifies this choice, and is what a form submits.
|
|
140
140
|
*/
|
|
141
|
-
|
|
141
|
+
value: string;
|
|
142
142
|
/**
|
|
143
143
|
* The words, for a listbox that has to match text against them.
|
|
144
144
|
*
|
|
@@ -146,20 +146,19 @@ export declare class HelixHeadlessOption extends HelixElement {
|
|
|
146
146
|
* the content is where a consumer naturally puts it and asking for both is
|
|
147
147
|
* asking for two things to disagree.
|
|
148
148
|
*
|
|
149
|
-
* **The default slot's content,
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
* `
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
* fault and a worse one, every row carrying one matching every letter of it.
|
|
149
|
+
* **The default slot's content, never `this.textContent`.** An option holds
|
|
150
|
+
* three slots: the words, plus `start` for an icon and `end` for a shortcut
|
|
151
|
+
* or a count. Neither of the latter two is what a reader searched for, and
|
|
152
|
+
* `textContent` runs both onto the end of it. Measured on a font picker whose
|
|
153
|
+
* options carry a two-letter specimen in `end`: the field read
|
|
154
|
+
* `Noto Sans Linear BAg`, and typing `ag` matched 1,892 of 1,893 options,
|
|
155
|
+
* every row containing the sample. An option with a keyboard shortcut in its
|
|
156
|
+
* end slot has the same fault and a worse one, every row carrying one matching
|
|
157
|
+
* every letter of it.
|
|
158
|
+
*
|
|
159
|
+
* Six things read this: the collapsed field of Select and of Combobox, the
|
|
160
|
+
* listbox's filter, Combobox's match against typed text, its inline
|
|
161
|
+
* completion, and the label on a chosen tag.
|
|
163
162
|
*
|
|
164
163
|
* A node goes to the default slot when it names no other, which is the rule
|
|
165
164
|
* the platform applies at assignment. Asking the same question here rather
|
|
@@ -172,17 +171,17 @@ export declare class HelixHeadlessOption extends HelixElement {
|
|
|
172
171
|
/**
|
|
173
172
|
* Mirrors the chosen state where a stylesheet can select on it.
|
|
174
173
|
*
|
|
175
|
-
* **A custom state and
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
174
|
+
* **A custom state, and never the `selected` attribute.** The parent writes
|
|
175
|
+
* this: a listbox choosing a row, a tab strip moving the tab, a radio group
|
|
176
|
+
* answering for its set. Reflected, that puts the element's own bookkeeping
|
|
177
|
+
* onto markup a consumer wrote and a consumer's server never sent, which React
|
|
178
|
+
* reconciles and reports as a mismatch, and which a serialized element pasted
|
|
179
|
+
* back declares as a choice nobody made. `ElementInternals` holds it instead,
|
|
180
|
+
* where it is not in the DOM at all.
|
|
182
181
|
*
|
|
183
182
|
* Reading `selected` is unaffected and so is writing it: the attribute still
|
|
184
183
|
* seeds the property, which is what `<helix-option selected>` in a consumer's
|
|
185
|
-
* markup means. What stops is the write back.
|
|
184
|
+
* markup means. What stops is the write back.
|
|
186
185
|
*/
|
|
187
186
|
protected willUpdate(changed: PropertyValues): void;
|
|
188
187
|
protected render(): TemplateResult;
|
|
@@ -50,37 +50,12 @@ import { property } from 'lit/decorators.js';
|
|
|
50
50
|
let HelixHeadlessOption = class HelixHeadlessOption extends HelixElement {
|
|
51
51
|
constructor() {
|
|
52
52
|
super(...arguments);
|
|
53
|
-
/**
|
|
54
|
-
* Whether this choice can be made.
|
|
55
|
-
*/
|
|
56
|
-
this.disabled = false;
|
|
57
53
|
/**
|
|
58
54
|
* Whether this is the option the keyboard is on.
|
|
59
55
|
*
|
|
60
56
|
* Written by the listbox.
|
|
61
57
|
*/
|
|
62
58
|
this.active = false;
|
|
63
|
-
/** What the markup said, read once at construction for the reason above. */
|
|
64
|
-
this.seeded = this.hasAttribute('selected');
|
|
65
|
-
/**
|
|
66
|
-
* Whether this choice is currently chosen.
|
|
67
|
-
*
|
|
68
|
-
* Written by the listbox.
|
|
69
|
-
*/
|
|
70
|
-
this.selected = false;
|
|
71
|
-
/**
|
|
72
|
-
* A shorter name for this choice, for where the row does not fit.
|
|
73
|
-
*
|
|
74
|
-
* `<option label>`'s own meaning: the text a chooser shows when it has less
|
|
75
|
-
* room than the row does, which is what a select's closed trigger has. Empty
|
|
76
|
-
* means the row's own content, which is the common case and is why this is not
|
|
77
|
-
* simply the accessible name.
|
|
78
|
-
*/
|
|
79
|
-
this.label = '';
|
|
80
|
-
/**
|
|
81
|
-
* Identifies this choice, and is what a form submits.
|
|
82
|
-
*/
|
|
83
|
-
this.value = '';
|
|
84
59
|
/**
|
|
85
60
|
* A second destination for this row, taken with the modifier held.
|
|
86
61
|
*
|
|
@@ -109,6 +84,31 @@ let HelixHeadlessOption = class HelixHeadlessOption extends HelixElement {
|
|
|
109
84
|
* fact about what pressing a key would do, which is what a description is.
|
|
110
85
|
*/
|
|
111
86
|
this.alternateLabel = '';
|
|
87
|
+
/** What the markup said, read once at construction for the reason above. */
|
|
88
|
+
this.seeded = this.hasAttribute('selected');
|
|
89
|
+
/**
|
|
90
|
+
* Whether this choice can be made.
|
|
91
|
+
*/
|
|
92
|
+
this.disabled = false;
|
|
93
|
+
/**
|
|
94
|
+
* A shorter name for this choice, for where the row does not fit.
|
|
95
|
+
*
|
|
96
|
+
* `<option label>`'s own meaning: the text a chooser shows when it has less
|
|
97
|
+
* room than the row does, which is what a select's closed trigger has. Empty
|
|
98
|
+
* means the row's own content, which is the common case and is why this is not
|
|
99
|
+
* simply the accessible name.
|
|
100
|
+
*/
|
|
101
|
+
this.label = '';
|
|
102
|
+
/**
|
|
103
|
+
* Whether this choice is currently chosen.
|
|
104
|
+
*
|
|
105
|
+
* Written by the listbox.
|
|
106
|
+
*/
|
|
107
|
+
this.selected = false;
|
|
108
|
+
/**
|
|
109
|
+
* Identifies this choice, and is what a form submits.
|
|
110
|
+
*/
|
|
111
|
+
this.value = '';
|
|
112
112
|
}
|
|
113
113
|
/**
|
|
114
114
|
* Whether the markup declared this one chosen, which is what a reset returns to.
|
|
@@ -138,20 +138,19 @@ let HelixHeadlessOption = class HelixHeadlessOption extends HelixElement {
|
|
|
138
138
|
* the content is where a consumer naturally puts it and asking for both is
|
|
139
139
|
* asking for two things to disagree.
|
|
140
140
|
*
|
|
141
|
-
* **The default slot's content,
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
* `
|
|
145
|
-
*
|
|
141
|
+
* **The default slot's content, never `this.textContent`.** An option holds
|
|
142
|
+
* three slots: the words, plus `start` for an icon and `end` for a shortcut
|
|
143
|
+
* or a count. Neither of the latter two is what a reader searched for, and
|
|
144
|
+
* `textContent` runs both onto the end of it. Measured on a font picker whose
|
|
145
|
+
* options carry a two-letter specimen in `end`: the field read
|
|
146
|
+
* `Noto Sans Linear BAg`, and typing `ag` matched 1,892 of 1,893 options,
|
|
147
|
+
* every row containing the sample. An option with a keyboard shortcut in its
|
|
148
|
+
* end slot has the same fault and a worse one, every row carrying one matching
|
|
149
|
+
* every letter of it.
|
|
146
150
|
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
* chosen tag with it. Measured on a font picker whose options carry a
|
|
151
|
-
* two-letter specimen in `end`: the field read `Noto Sans Linear BAg`, and
|
|
152
|
-
* typing `ag` matched 1,892 of 1,893 options, every row containing the
|
|
153
|
-
* sample. An option with a keyboard shortcut in its end slot has the same
|
|
154
|
-
* fault and a worse one, every row carrying one matching every letter of it.
|
|
151
|
+
* Six things read this: the collapsed field of Select and of Combobox, the
|
|
152
|
+
* listbox's filter, Combobox's match against typed text, its inline
|
|
153
|
+
* completion, and the label on a chosen tag.
|
|
155
154
|
*
|
|
156
155
|
* A node goes to the default slot when it names no other, which is the rule
|
|
157
156
|
* the platform applies at assignment. Asking the same question here rather
|
|
@@ -175,17 +174,17 @@ let HelixHeadlessOption = class HelixHeadlessOption extends HelixElement {
|
|
|
175
174
|
/**
|
|
176
175
|
* Mirrors the chosen state where a stylesheet can select on it.
|
|
177
176
|
*
|
|
178
|
-
* **A custom state and
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
177
|
+
* **A custom state, and never the `selected` attribute.** The parent writes
|
|
178
|
+
* this: a listbox choosing a row, a tab strip moving the tab, a radio group
|
|
179
|
+
* answering for its set. Reflected, that puts the element's own bookkeeping
|
|
180
|
+
* onto markup a consumer wrote and a consumer's server never sent, which React
|
|
181
|
+
* reconciles and reports as a mismatch, and which a serialized element pasted
|
|
182
|
+
* back declares as a choice nobody made. `ElementInternals` holds it instead,
|
|
183
|
+
* where it is not in the DOM at all.
|
|
185
184
|
*
|
|
186
185
|
* Reading `selected` is unaffected and so is writing it: the attribute still
|
|
187
186
|
* seeds the property, which is what `<helix-option selected>` in a consumer's
|
|
188
|
-
* markup means. What stops is the write back.
|
|
187
|
+
* markup means. What stops is the write back.
|
|
189
188
|
*/
|
|
190
189
|
willUpdate(changed) {
|
|
191
190
|
super.willUpdate(changed);
|
|
@@ -202,11 +201,10 @@ let HelixHeadlessOption = class HelixHeadlessOption extends HelixElement {
|
|
|
202
201
|
this.alternate !== '' && this.alternateLabel !== '' ? this.alternateLabel : null;
|
|
203
202
|
/* A pointer reaches `select()` the way every other choosable row in this
|
|
204
203
|
library does, from a `@click` in its own template: `Tabs.Tab`,
|
|
205
|
-
`Tree.Item` and `Menu.Item` all bind one.
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
chooses by calling `select()` or by pressing a key. */
|
|
204
|
+
`Tree.Item` and `Menu.Item` all bind one. Nothing else listens for a click
|
|
205
|
+
on an option, so removing this leaves a select the keyboard can use and a
|
|
206
|
+
pointer cannot. A spec that chooses by calling `select()` or by pressing a
|
|
207
|
+
key cannot tell the difference. */
|
|
210
208
|
return html `<div part="item" @click=${() => this.select()}>
|
|
211
209
|
<slot name="start"></slot>
|
|
212
210
|
<span part="text">
|
|
@@ -218,29 +216,29 @@ let HelixHeadlessOption = class HelixHeadlessOption extends HelixElement {
|
|
|
218
216
|
}
|
|
219
217
|
};
|
|
220
218
|
__decorate([
|
|
221
|
-
property({ reflect: true, type: Boolean })
|
|
222
|
-
], HelixHeadlessOption.prototype, "
|
|
219
|
+
property({ attribute: 'data-active', reflect: true, type: Boolean })
|
|
220
|
+
], HelixHeadlessOption.prototype, "active", void 0);
|
|
223
221
|
__decorate([
|
|
224
222
|
property()
|
|
225
|
-
], HelixHeadlessOption.prototype, "
|
|
223
|
+
], HelixHeadlessOption.prototype, "alternate", void 0);
|
|
226
224
|
__decorate([
|
|
227
|
-
property({ attribute: '
|
|
228
|
-
], HelixHeadlessOption.prototype, "
|
|
225
|
+
property({ attribute: 'alternate-label' })
|
|
226
|
+
], HelixHeadlessOption.prototype, "alternateLabel", void 0);
|
|
229
227
|
__decorate([
|
|
230
|
-
property(
|
|
231
|
-
], HelixHeadlessOption.prototype, "
|
|
228
|
+
property()
|
|
229
|
+
], HelixHeadlessOption.prototype, "description", void 0);
|
|
230
|
+
__decorate([
|
|
231
|
+
property({ reflect: true, type: Boolean })
|
|
232
|
+
], HelixHeadlessOption.prototype, "disabled", void 0);
|
|
232
233
|
__decorate([
|
|
233
234
|
property()
|
|
234
235
|
], HelixHeadlessOption.prototype, "label", void 0);
|
|
235
236
|
__decorate([
|
|
236
|
-
property()
|
|
237
|
-
], HelixHeadlessOption.prototype, "
|
|
237
|
+
property({ type: Boolean })
|
|
238
|
+
], HelixHeadlessOption.prototype, "selected", void 0);
|
|
238
239
|
__decorate([
|
|
239
240
|
property()
|
|
240
|
-
], HelixHeadlessOption.prototype, "
|
|
241
|
-
__decorate([
|
|
242
|
-
property({ attribute: 'alternate-label' })
|
|
243
|
-
], HelixHeadlessOption.prototype, "alternateLabel", void 0);
|
|
241
|
+
], HelixHeadlessOption.prototype, "value", void 0);
|
|
244
242
|
HelixHeadlessOption = __decorate([
|
|
245
243
|
customElement('helix-headless-option')
|
|
246
244
|
], HelixHeadlessOption);
|
|
@@ -4,13 +4,11 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
4
4
|
* @summary Links to the headings on this page, marking the one being read.
|
|
5
5
|
*
|
|
6
6
|
* @description
|
|
7
|
-
* A table of contents, named for the job.
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* `Navigation`, which is the same job at the other scale: one navigates a site, the
|
|
13
|
-
* other navigates a document.
|
|
7
|
+
* A table of contents, named for the job. It sits beside `Navigation`, which is
|
|
8
|
+
* the same job at the other scale: one navigates a site, the other navigates a
|
|
9
|
+
* document. `Contents` and `TableOfContents` are both taken by something else,
|
|
10
|
+
* `display: contents` and the `content` part in one case and the `Table` family
|
|
11
|
+
* in the other.
|
|
14
12
|
*
|
|
15
13
|
* **The links are the consumer's own anchors**, the same as `Navigation`. A router
|
|
16
14
|
* renders its own `<a>` and cannot render one inside this shadow root, and the
|
|
@@ -52,18 +50,6 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
52
50
|
*/
|
|
53
51
|
export declare class HelixHeadlessOutline extends HelixElement {
|
|
54
52
|
private readonly indicator;
|
|
55
|
-
/**
|
|
56
|
-
* Accessible name for the navigation.
|
|
57
|
-
*/
|
|
58
|
-
label: string;
|
|
59
|
-
/**
|
|
60
|
-
* How far below the top of the window a heading counts as reached, in pixels.
|
|
61
|
-
*
|
|
62
|
-
* The reading line. A page with a sticky masthead sets this to its height, or
|
|
63
|
-
* a little more: without it the current section changes as a heading slides
|
|
64
|
-
* under the chrome rather than as it reaches the top of what can be seen.
|
|
65
|
-
*/
|
|
66
|
-
offset: number;
|
|
67
53
|
/**
|
|
68
54
|
* How a click on one of these links travels to its section.
|
|
69
55
|
*
|
|
@@ -86,6 +72,18 @@ export declare class HelixHeadlessOutline extends HelixElement {
|
|
|
86
72
|
* JavaScript rather than CSS decides.
|
|
87
73
|
*/
|
|
88
74
|
behavior: ScrollBehavior;
|
|
75
|
+
/**
|
|
76
|
+
* Accessible name for the navigation.
|
|
77
|
+
*/
|
|
78
|
+
label: string;
|
|
79
|
+
/**
|
|
80
|
+
* How far below the top of the window a heading counts as reached, in pixels.
|
|
81
|
+
*
|
|
82
|
+
* The reading line. A page with a sticky masthead sets this to its height, or
|
|
83
|
+
* a little more: without it the current section changes as a heading slides
|
|
84
|
+
* under the chrome rather than as it reaches the top of what can be seen.
|
|
85
|
+
*/
|
|
86
|
+
offset: number;
|
|
89
87
|
/**
|
|
90
88
|
* The id of the section being read, or empty before anything is measured.
|
|
91
89
|
*
|
|
@@ -124,16 +122,16 @@ export declare class HelixHeadlessOutline extends HelixElement {
|
|
|
124
122
|
* leaves the position a hair under the height at the very bottom and an exact
|
|
125
123
|
* comparison never fires.
|
|
126
124
|
*
|
|
127
|
-
* **All three numbers off the same element
|
|
128
|
-
*
|
|
129
|
-
* `documentElement.scrollHeight
|
|
130
|
-
* the viewport is what scrolls, and the body takes that job the
|
|
131
|
-
* becomes a scroll container. Measured on a page whose body is
|
|
125
|
+
* **All three numbers off the same element.** Adding the window's `scrollY`
|
|
126
|
+
* and `innerHeight` and comparing them against
|
|
127
|
+
* `documentElement.scrollHeight` mixes two coordinate systems, which agree
|
|
128
|
+
* only while the viewport is what scrolls, and the body takes that job the
|
|
129
|
+
* moment it becomes a scroll container. Measured on a page whose body is
|
|
132
130
|
* `overflow: clip visible`, which is a pair CSS resolves by making the
|
|
133
131
|
* `visible` axis `auto`: `documentElement.scrollTop` read 1126 at the bottom
|
|
134
132
|
* of the page and `window.scrollY` read 240, so a contents rail never learned
|
|
135
|
-
* it had reached the end and its last item stayed unreachable.
|
|
136
|
-
*
|
|
133
|
+
* it had reached the end and its last item stayed unreachable. This library's
|
|
134
|
+
* own base layer produces exactly that page.
|
|
137
135
|
*
|
|
138
136
|
* `clientHeight` rather than `innerHeight` for the same reason, and because it
|
|
139
137
|
* is the one that excludes a scrollbar, which is what `scrollHeight` is
|
|
@@ -150,9 +148,6 @@ export declare class HelixHeadlessOutline extends HelixElement {
|
|
|
150
148
|
* The two things an `IntersectionObserver` cannot see, and one listener for
|
|
151
149
|
* both.
|
|
152
150
|
*
|
|
153
|
-
* This component's own note said the observer keeps the marker honest without
|
|
154
|
-
* a scroll listener. It was wrong twice.
|
|
155
|
-
*
|
|
156
151
|
* *At the bottom*, arriving at the end of a page changes no intersection: a
|
|
157
152
|
* short last section is fully visible long before the final pixel, so its
|
|
158
153
|
* ratio reached 1 and stopped moving. Nothing fires for the scroll that ends
|
|
@@ -167,27 +162,25 @@ export declare class HelixHeadlessOutline extends HelixElement {
|
|
|
167
162
|
* heading has not crossed yet, and no callback follows for the rest of the
|
|
168
163
|
* way.
|
|
169
164
|
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
* coalesced to one call per frame however many events arrive.
|
|
165
|
+
* Marking once per animation frame while a scroll is happening covers both,
|
|
166
|
+
* where a listener that marks only when its own comparison changes fixes the
|
|
167
|
+
* bottom and cannot fix the settle. The cost is what `mark()` costs, a
|
|
168
|
+
* `getBoundingClientRect` per section on frames a reader is already scrolling
|
|
169
|
+
* through. Passive, and coalesced to one call per frame however many events
|
|
170
|
+
* arrive.
|
|
177
171
|
*/
|
|
178
172
|
private readonly handleScroll;
|
|
179
173
|
/**
|
|
180
174
|
* Gives every section the same reading line the marker uses.
|
|
181
175
|
*
|
|
182
|
-
* `offset`
|
|
183
|
-
*
|
|
184
|
-
* against the very top of the window
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
* it when taking you somewhere, which is the same number meaning two things.
|
|
176
|
+
* `offset` says where the top of the readable area is, so it has to govern
|
|
177
|
+
* where a click lands as much as what the marker calls current. Read by the
|
|
178
|
+
* marker alone, a click puts the heading against the very top of the window
|
|
179
|
+
* and underneath the sticky masthead the consumer measured the offset from,
|
|
180
|
+
* which is the same number meaning two things.
|
|
188
181
|
*
|
|
189
182
|
* `scroll-margin-block-start` rather than an interception, because it is the
|
|
190
|
-
* property the platform provides for exactly this and the UA
|
|
183
|
+
* property the platform provides for exactly this and the UA honors it on
|
|
191
184
|
* ordinary fragment navigation, on `scrollIntoView`, and on a browser
|
|
192
185
|
* restoring a position. Nothing has to be taken over to get it.
|
|
193
186
|
*
|
|
@@ -212,7 +205,8 @@ export declare class HelixHeadlessOutline extends HelixElement {
|
|
|
212
205
|
* The thresholds are what make the trigger frequent enough: an observer fires
|
|
213
206
|
* on entering and leaving, and a long section scrolled slowly crosses neither
|
|
214
207
|
* for a long time. Asking for a callback at each quarter of visibility is
|
|
215
|
-
* cheap
|
|
208
|
+
* cheap. It is still only a trigger: see `handleScroll` for the two cases no
|
|
209
|
+
* intersection can see.
|
|
216
210
|
*/
|
|
217
211
|
private watch;
|
|
218
212
|
/**
|