@fusion.dev/helix-headless 0.235.1 → 0.237.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api.json +1 -1
- package/custom-elements.json +1 -1
- package/dist/app-header/root/app-header-root.d.ts +9 -0
- package/dist/app-header/root/app-header-root.js +21 -0
- package/dist/area-chart/root/area-chart-root.d.ts +29 -15
- package/dist/area-chart/root/area-chart-root.js +10 -7
- package/dist/bar-chart/root/bar-chart-root.d.ts +41 -23
- package/dist/bar-chart/root/bar-chart-root.js +15 -10
- package/dist/button/root/button-root.js +1 -1
- package/dist/canvas/root/canvas-root.d.ts +10 -3
- package/dist/canvas/root/canvas-root.js +31 -14
- package/dist/color-input/root/color-input-root.d.ts +4 -2
- package/dist/color-input/root/color-input-root.js +1 -1
- package/dist/combobox/root/combobox-root.d.ts +8 -7
- package/dist/combobox/root/combobox-root.js +7 -3
- package/dist/command/root/command-root.d.ts +22 -2
- package/dist/command/root/command-root.js +39 -5
- package/dist/data-table/root/data-table-root.d.ts +15 -7
- package/dist/data-table/root/data-table-root.js +9 -2
- package/dist/date-picker/root/date-picker-root.d.ts +1 -1
- package/dist/date-picker/root/date-picker-root.js +9 -2
- package/dist/dialog/root/dialog-root.d.ts +13 -3
- package/dist/dialog/root/dialog-root.js +33 -2
- package/dist/donut-chart/root/donut-chart-root.d.ts +23 -1
- package/dist/donut-chart/root/donut-chart-root.js +41 -13
- package/dist/drawer/root/drawer-root.d.ts +10 -2
- package/dist/drawer/root/drawer-root.js +34 -1
- package/dist/filter-input/chip/filter-chip.js +2 -2
- package/dist/find/root/find-root.d.ts +11 -1
- package/dist/find/root/find-root.js +11 -0
- package/dist/heatmap/root/heatmap-root.d.ts +11 -8
- package/dist/heatmap/root/heatmap-root.js +27 -2
- package/dist/kbd/root/kbd-root.d.ts +4 -0
- package/dist/kbd/root/kbd-root.js +2 -1
- package/dist/lightbox/root/lightbox-root.js +3 -2
- package/dist/line-chart/root/line-chart-root.d.ts +36 -23
- package/dist/line-chart/root/line-chart-root.js +20 -13
- package/dist/list/item/list-item.d.ts +2 -1
- package/dist/list/item/list-item.js +4 -1
- package/dist/list/root/list-root.d.ts +33 -8
- package/dist/list/root/list-root.js +17 -3
- package/dist/listbox/root/listbox-root.d.ts +48 -15
- package/dist/listbox/root/listbox-root.js +65 -6
- package/dist/map/root/map-root.js +7 -7
- package/dist/markdown/tree.d.ts +6 -1
- package/dist/markdown/tree.js +1 -1
- package/dist/megamenu/root/megamenu-root.d.ts +19 -0
- package/dist/megamenu/root/megamenu-root.js +24 -0
- package/dist/menu/filter/menu-filter.js +3 -1
- package/dist/menu/item/menu-item.d.ts +12 -0
- package/dist/menu/item/menu-item.js +3 -0
- package/dist/menu/root/menu-root.d.ts +7 -1
- package/dist/menu/root/menu-root.js +6 -3
- package/dist/motion-toggle/root/motion-toggle-root.js +2 -2
- package/dist/notifications/notification/notification.d.ts +1 -0
- package/dist/notifications/notification/notification.js +1 -0
- package/dist/notifications/root/notifications-root.d.ts +7 -5
- package/dist/notifications/root/notifications-root.js +1 -1
- package/dist/number-input/root/number-input-root.d.ts +6 -0
- package/dist/number-input/root/number-input-root.js +14 -4
- package/dist/object-inspector/root/object-inspector-root.d.ts +6 -5
- package/dist/object-inspector/root/object-inspector-root.js +9 -3
- package/dist/option/root/option-root.d.ts +16 -2
- package/dist/option/root/option-root.js +7 -0
- package/dist/pagination/root/pagination-root.d.ts +36 -0
- package/dist/pagination/root/pagination-root.js +55 -2
- package/dist/pin-input/code.js +1 -1
- package/dist/qr-code/root/qr-code-root.d.ts +1 -0
- package/dist/qr-code/root/qr-code-root.js +1 -0
- package/dist/radio/root/radio-root.js +4 -0
- package/dist/rating/root/rating-root.d.ts +1 -0
- package/dist/rating/root/rating-root.js +1 -0
- package/dist/scatter-chart/root/scatter-chart-root.d.ts +6 -0
- package/dist/select/root/select-root.d.ts +27 -1
- package/dist/select/root/select-root.js +34 -3
- package/dist/shortcut-overlay/root/shortcut-overlay-root.d.ts +5 -0
- package/dist/shortcut-overlay/root/shortcut-overlay-root.js +15 -1
- package/dist/skeleton/root/skeleton-root.d.ts +1 -0
- package/dist/skeleton/root/skeleton-root.js +3 -0
- package/dist/sparkline/root/sparkline-root.d.ts +53 -0
- package/dist/sparkline/root/sparkline-root.js +37 -1
- package/dist/spatial-bar-chart/root/spatial-bar-chart-root.d.ts +4 -1
- package/dist/spatial-bar-chart/root/spatial-bar-chart-root.js +2 -2
- package/dist/spatial-ribbon-chart/root/spatial-ribbon-chart-root.d.ts +3 -0
- package/dist/spatial-ribbon-chart/root/spatial-ribbon-chart-root.js +2 -2
- package/dist/spatial-scatter-chart/root/spatial-scatter-chart-root.d.ts +3 -0
- package/dist/spatial-scatter-chart/root/spatial-scatter-chart-root.js +2 -2
- package/dist/spatial-scatter-chart/view.d.ts +17 -8
- package/dist/spatial-scatter-chart/view.js +7 -6
- package/dist/spatial-surface-chart/root/spatial-surface-chart-root.d.ts +3 -0
- package/dist/spatial-surface-chart/root/spatial-surface-chart-root.js +2 -2
- package/dist/spatial-treemap/root/spatial-treemap-root.d.ts +3 -0
- package/dist/spatial-treemap/root/spatial-treemap-root.js +2 -2
- package/dist/splitter/root/splitter-root.js +3 -1
- package/dist/stat/group/stat-group.d.ts +13 -0
- package/dist/stat/group/stat-group.js +22 -1
- package/dist/stat/root/stat-root.d.ts +62 -1
- package/dist/stat/root/stat-root.js +146 -4
- package/dist/table/cell/table-cell.d.ts +1 -0
- package/dist/table/cell/table-cell.js +4 -0
- package/dist/table/column/table-column.d.ts +11 -0
- package/dist/table/column/table-column.js +4 -0
- package/dist/table/root/table-root.d.ts +7 -6
- package/dist/table/root/table-root.js +1 -1
- package/dist/tabs/panel/tab-panel.d.ts +30 -0
- package/dist/tabs/panel/tab-panel.js +28 -3
- package/dist/tabs/root/tabs-root.d.ts +8 -0
- package/dist/tabs/root/tabs-root.js +8 -2
- package/dist/tabs/tab/tab.js +2 -2
- package/dist/tag/root/tag-root.js +2 -2
- package/dist/timeline/root/timeline-root.d.ts +2 -2
- package/dist/timeline/root/timeline-root.js +1 -1
- package/dist/toast/root/toast-root.d.ts +53 -6
- package/dist/toast/root/toast-root.js +158 -1
- package/dist/toggle/root/toggle-root.d.ts +1 -0
- package/dist/toggle/root/toggle-root.js +1 -1
- package/dist/video-playlist/root/video-playlist-root.d.ts +1 -0
- package/dist/video-playlist/root/video-playlist-root.js +2 -0
- package/dist/virtual-list/root/virtual-list-root.d.ts +2 -2
- package/dist/virtual-list/root/virtual-list-root.js +1 -1
- package/examples.json +1 -1
- package/lint.json +1 -1
- package/package.json +5 -5
- package/types/jsx.d.ts +693 -169
- package/types/vue.d.ts +423 -96
- package/types/words.d.ts +51 -12
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { auditChildren, auditName, customElement, focusItemOf, formatWords, HelixActivateEvent, HelixBeforeChangeEvent, HelixBeforeCheckEvent, HelixCheckEvent, HelixElement, hostAria, internalsOf, KeyboardNavigationController, MixinViewport, numberConverter, requestChange, stopPress, words, } from '@fusion.dev/helix-core';
|
|
3
|
-
import { buildings, cloudRain, dotsNine, leaf, mountains, path, polygon, stack, target, } from '@fusion.dev/helix-icons';
|
|
2
|
+
import { auditChildren, auditName, customElement, drawIcon, focusItemOf, formatWords, HelixActivateEvent, HelixBeforeChangeEvent, HelixBeforeCheckEvent, HelixCheckEvent, HelixElement, hostAria, internalsOf, KeyboardNavigationController, MixinViewport, numberConverter, requestChange, stopPress, words, } from '@fusion.dev/helix-core';
|
|
3
|
+
import { arrowClockwise, arrowCounterClockwise, buildings, cloudRain, dotsNine, leaf, mountains, path, polygon, stack, target, } from '@fusion.dev/helix-icons';
|
|
4
4
|
import { html, nothing } from 'lit';
|
|
5
5
|
import { property, state } from 'lit/decorators.js';
|
|
6
6
|
import { html as staticHtml } from 'lit/static-html.js';
|
|
@@ -525,7 +525,7 @@ let HelixHeadlessMap = class HelixHeadlessMap extends MixinViewport(HelixElement
|
|
|
525
525
|
@click=${() => this.rotate(-ROTATE_STEP)}
|
|
526
526
|
@helix-press=${stopPress}
|
|
527
527
|
>
|
|
528
|
-
<slot name="rotate-left-icon"
|
|
528
|
+
<slot name="rotate-left-icon">${drawIcon(arrowCounterClockwise)}</slot>
|
|
529
529
|
</${button}><${tip} for="rotate-left" content=${this.rotateLeftLabel} exportparts="arrow: tooltip-arrow, arrow-bottom: tooltip-arrow-bottom, arrow-left: tooltip-arrow-left, arrow-right: tooltip-arrow-right, arrow-top: tooltip-arrow-top, surface: tooltip-surface, surface-bottom: tooltip-surface-bottom, surface-left: tooltip-surface-left, surface-right: tooltip-surface-right, surface-top: tooltip-surface-top"></${tip}>`
|
|
530
530
|
: nothing}
|
|
531
531
|
${pan
|
|
@@ -551,7 +551,7 @@ let HelixHeadlessMap = class HelixHeadlessMap extends MixinViewport(HelixElement
|
|
|
551
551
|
@click=${() => this.rotate(ROTATE_STEP)}
|
|
552
552
|
@helix-press=${stopPress}
|
|
553
553
|
>
|
|
554
|
-
<slot name="rotate-right-icon"
|
|
554
|
+
<slot name="rotate-right-icon">${drawIcon(arrowClockwise)}</slot>
|
|
555
555
|
</${button}><${tip} for="rotate-right" content=${this.rotateRightLabel} exportparts="arrow: tooltip-arrow, arrow-bottom: tooltip-arrow-bottom, arrow-left: tooltip-arrow-left, arrow-right: tooltip-arrow-right, arrow-top: tooltip-arrow-top, surface: tooltip-surface, surface-bottom: tooltip-surface-bottom, surface-left: tooltip-surface-left, surface-right: tooltip-surface-right, surface-top: tooltip-surface-top"></${tip}>`
|
|
556
556
|
: nothing}
|
|
557
557
|
${pan
|
|
@@ -640,7 +640,7 @@ let HelixHeadlessMap = class HelixHeadlessMap extends MixinViewport(HelixElement
|
|
|
640
640
|
@click=${this.toggleFullscreen}
|
|
641
641
|
@helix-press=${stopPress}
|
|
642
642
|
>
|
|
643
|
-
<slot name="fullscreen-icon"
|
|
643
|
+
<slot name="fullscreen-icon">${this.controlGlyph('fullscreen')}</slot>
|
|
644
644
|
</${button}><${tip} for="fullscreen" content=${this.fullscreenLabel} exportparts="arrow: tooltip-arrow, arrow-bottom: tooltip-arrow-bottom, arrow-left: tooltip-arrow-left, arrow-right: tooltip-arrow-right, arrow-top: tooltip-arrow-top, surface: tooltip-surface, surface-bottom: tooltip-surface-bottom, surface-left: tooltip-surface-left, surface-right: tooltip-surface-right, surface-top: tooltip-surface-top"></${tip}>`
|
|
645
645
|
: nothing}
|
|
646
646
|
${menu}
|
|
@@ -670,7 +670,7 @@ let HelixHeadlessMap = class HelixHeadlessMap extends MixinViewport(HelixElement
|
|
|
670
670
|
@click=${() => this.zoom(1)}
|
|
671
671
|
@helix-press=${stopPress}
|
|
672
672
|
>
|
|
673
|
-
<slot name="zoom-in-icon"
|
|
673
|
+
<slot name="zoom-in-icon">${this.controlGlyph('zoom-in')}</slot>
|
|
674
674
|
</${button}><${tip} for="zoom-in" content=${this.zoomInLabel} exportparts="arrow: tooltip-arrow, arrow-bottom: tooltip-arrow-bottom, arrow-left: tooltip-arrow-left, arrow-right: tooltip-arrow-right, arrow-top: tooltip-arrow-top, surface: tooltip-surface, surface-bottom: tooltip-surface-bottom, surface-left: tooltip-surface-left, surface-right: tooltip-surface-right, surface-top: tooltip-surface-top"></${tip}>
|
|
675
675
|
<${button}
|
|
676
676
|
part="zoom-out"
|
|
@@ -682,7 +682,7 @@ let HelixHeadlessMap = class HelixHeadlessMap extends MixinViewport(HelixElement
|
|
|
682
682
|
@click=${() => this.zoom(-1)}
|
|
683
683
|
@helix-press=${stopPress}
|
|
684
684
|
>
|
|
685
|
-
<slot name="zoom-out-icon"
|
|
685
|
+
<slot name="zoom-out-icon">${this.controlGlyph('zoom-out')}</slot>
|
|
686
686
|
</${button}><${tip} for="zoom-out" content=${this.zoomOutLabel} exportparts="arrow: tooltip-arrow, arrow-bottom: tooltip-arrow-bottom, arrow-left: tooltip-arrow-left, arrow-right: tooltip-arrow-right, arrow-top: tooltip-arrow-top, surface: tooltip-surface, surface-bottom: tooltip-surface-bottom, surface-left: tooltip-surface-left, surface-right: tooltip-surface-right, surface-top: tooltip-surface-top"></${tip}>`
|
|
687
687
|
: nothing}
|
|
688
688
|
${this.drawsCompass ? this.renderCompass(pan, rotate) : nothing}
|
package/dist/markdown/tree.d.ts
CHANGED
|
@@ -35,8 +35,13 @@ export interface MarkdownTags {
|
|
|
35
35
|
export declare const safeUrl: (url: string) => string | undefined;
|
|
36
36
|
/**
|
|
37
37
|
* Each column's share of a table's width, from its heading's length, between
|
|
38
|
-
*
|
|
38
|
+
* 10 and 24 characters. Set once, from the rows that arrive first, so the
|
|
39
39
|
* columns never move as the rest arrives.
|
|
40
|
+
*
|
|
41
|
+
* **Ten at the least, because a short heading says nothing about its cells.**
|
|
42
|
+
* From a floor of four, "Step" over "Backfill" and "Constraint" took 16% of a
|
|
43
|
+
* 336 pixel table at 390, a 50 pixel column, and both words broke inside
|
|
44
|
+
* themselves. At ten the column is 86 and both fit.
|
|
40
45
|
*/
|
|
41
46
|
export declare const columnShares: (head: string[]) => number[];
|
|
42
47
|
/** A block as the node it draws. `open` reads its end as still arriving. */
|
package/dist/markdown/tree.js
CHANGED
|
@@ -61,7 +61,7 @@ const inlineNodes = (nodes) => nodes.flatMap((node) => {
|
|
|
61
61
|
const inline = (text, open) => inlineNodes(parseInline(text, { open }));
|
|
62
62
|
const aligned = (align) => align === undefined ? {} : { 'data-align': align };
|
|
63
63
|
export const columnShares = (head) => {
|
|
64
|
-
const weights = head.map((cell) => Math.min(24, Math.max(
|
|
64
|
+
const weights = head.map((cell) => Math.min(24, Math.max(10, cell.length)));
|
|
65
65
|
const total = weights.reduce((sum, weight) => sum + weight, 0);
|
|
66
66
|
return weights.map((weight) => Math.round((weight / total) * 10000) / 100);
|
|
67
67
|
};
|
|
@@ -84,7 +84,9 @@ declare const HelixHeadlessMegamenu_base: (new (...args: any[]) => import("@fusi
|
|
|
84
84
|
* @csspart indicator - The `indicator` slot, rendered while the panel is open.
|
|
85
85
|
* @csspart surface - The floating panel that opens.
|
|
86
86
|
* @csspart trigger - The default trigger button, shown when the `trigger` slot is empty.
|
|
87
|
+
* @csspart trigger-indicator - The caret on the default trigger, turned while the panel is open.
|
|
87
88
|
*
|
|
89
|
+
* @cssproperty --megamenu-edge - How far the card keeps from the window's edge, which is as far as the row it sits in starts from it, between 8 and 32 pixels. Written on the card while it is placed, and read there.
|
|
88
90
|
* @cssproperty --megamenu-from-block-size - The height of the panel this one took over from, written on the surface while it is open.
|
|
89
91
|
* @cssproperty --megamenu-from-inline-size - The width of the panel this one took over from, written on the surface while it is open.
|
|
90
92
|
* @cssproperty --megamenu-surface-block-size - The panel's own height, written on the surface while it is open.
|
|
@@ -274,6 +276,23 @@ export declare class HelixHeadlessMegamenu extends HelixHeadlessMegamenu_base {
|
|
|
274
276
|
* the trigger is the honest answer again.
|
|
275
277
|
*/
|
|
276
278
|
private bar;
|
|
279
|
+
/**
|
|
280
|
+
* How far the card keeps from the window's edge: as far as the row it sits
|
|
281
|
+
* in starts from it, between 8 and 32 pixels.
|
|
282
|
+
*
|
|
283
|
+
* At 640 the card slid to 8 pixels from the edge while the navigation it
|
|
284
|
+
* hangs from started at 24, so neither edge of the card lined up with
|
|
285
|
+
* anything on the page. Written on the card as `--megamenu-edge` as well, so
|
|
286
|
+
* a stylesheet can hold the card's width inside the same margin on both
|
|
287
|
+
* sides, and a card as wide as the room then starts where the row does.
|
|
288
|
+
* On the card and not the host: a style written on the host is an attribute
|
|
289
|
+
* a server never sent, and hydration would find it.
|
|
290
|
+
*
|
|
291
|
+
* The row is the first flex or grid box above the trigger in the flat tree,
|
|
292
|
+
* which is what lays destinations out side by side, by fact and not by tag
|
|
293
|
+
* name, as `bar` finds the bar.
|
|
294
|
+
*/
|
|
295
|
+
private edge;
|
|
277
296
|
private timer;
|
|
278
297
|
private pointer;
|
|
279
298
|
private schedule;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
var HelixHeadlessMegamenu_1;
|
|
2
2
|
import { __decorate } from "tslib";
|
|
3
3
|
import { anchorElement, customElement, deepContains, focusableElements, focusItemOf, HelixElement, KeyboardNavigationController, MixinControllerOpen, numberConverter, PopoverController, tellDisclosure, timeConverter, untilReactHydrated, } from '@fusion.dev/helix-core';
|
|
4
|
+
import { caretDown } from '@fusion.dev/helix-icons';
|
|
4
5
|
import { html, nothing } from 'lit';
|
|
5
6
|
import { property, state } from 'lit/decorators.js';
|
|
7
|
+
import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
|
|
6
8
|
import { HandOver } from '../hand-over.js';
|
|
7
9
|
let HelixHeadlessMegamenu = class HelixHeadlessMegamenu extends MixinControllerOpen(HelixElement) {
|
|
8
10
|
constructor() {
|
|
@@ -22,6 +24,7 @@ let HelixHeadlessMegamenu = class HelixHeadlessMegamenu extends MixinControllerO
|
|
|
22
24
|
boundary: () => [...HelixHeadlessMegamenu_1.bar.connected],
|
|
23
25
|
onDismiss: () => this.close(),
|
|
24
26
|
open: () => this.open,
|
|
27
|
+
padding: () => this.edge(),
|
|
25
28
|
place: () => !this.banded,
|
|
26
29
|
placement: () => this.placement,
|
|
27
30
|
surface: () => this.partNamed('surface'),
|
|
@@ -198,6 +201,26 @@ let HelixHeadlessMegamenu = class HelixHeadlessMegamenu extends MixinControllerO
|
|
|
198
201
|
}
|
|
199
202
|
return this.trigger.getBoundingClientRect().bottom;
|
|
200
203
|
}
|
|
204
|
+
edge() {
|
|
205
|
+
let node = this;
|
|
206
|
+
let row = null;
|
|
207
|
+
for (let step = 0; node && step < 4 && !row; step += 1) {
|
|
208
|
+
const up = node.assignedSlot?.parentElement ??
|
|
209
|
+
node.parentElement ??
|
|
210
|
+
(node.parentNode?.host || null);
|
|
211
|
+
if (up && /flex|grid/.test(getComputedStyle(up).display)) {
|
|
212
|
+
row = up;
|
|
213
|
+
}
|
|
214
|
+
node = up;
|
|
215
|
+
}
|
|
216
|
+
const box = (row ?? this).getBoundingClientRect();
|
|
217
|
+
const start = getComputedStyle(this).direction === 'rtl'
|
|
218
|
+
? document.documentElement.clientWidth - box.right
|
|
219
|
+
: box.left;
|
|
220
|
+
const edge = Math.min(32, Math.max(8, Math.round(start)));
|
|
221
|
+
this.partNamed('surface')?.style.setProperty('--megamenu-edge', `${edge}px`);
|
|
222
|
+
return edge;
|
|
223
|
+
}
|
|
201
224
|
schedule(delay, then) {
|
|
202
225
|
this.stop();
|
|
203
226
|
this.timer = setTimeout(then, delay);
|
|
@@ -305,6 +328,7 @@ let HelixHeadlessMegamenu = class HelixHeadlessMegamenu extends MixinControllerO
|
|
|
305
328
|
aria-expanded=${this.open ? 'true' : 'false'}
|
|
306
329
|
>
|
|
307
330
|
${this.label}
|
|
331
|
+
<svg part="trigger-indicator" fill="currentColor" width="1em" height="1em" viewBox=${caretDown.viewBox} aria-hidden="true">${unsafeSVG(caretDown.content)}</svg>
|
|
308
332
|
</button>
|
|
309
333
|
</slot>`;
|
|
310
334
|
}
|
|
@@ -3,7 +3,9 @@ import { html, nothing } from 'lit';
|
|
|
3
3
|
export const drawFilter = (host, rows, busy, onInput) => html `<input
|
|
4
4
|
part="search-field"
|
|
5
5
|
type="text"
|
|
6
|
+
autocapitalize="off"
|
|
6
7
|
autocomplete="off"
|
|
8
|
+
autocorrect="off"
|
|
7
9
|
spellcheck="false"
|
|
8
10
|
.value=${host.filter}
|
|
9
11
|
placeholder=${host.filterLabel}
|
|
@@ -113,7 +115,7 @@ export class MenuFilterController {
|
|
|
113
115
|
}
|
|
114
116
|
status() {
|
|
115
117
|
const { host } = this;
|
|
116
|
-
const count = this.filtering ? this.keptRows.length : -1;
|
|
118
|
+
const count = this.filtering && host.children !== undefined ? this.keptRows.length : -1;
|
|
117
119
|
this.inside.announced =
|
|
118
120
|
count === 0
|
|
119
121
|
? host.noResultsText
|
|
@@ -178,6 +178,18 @@ export declare class HelixHeadlessMenuItem extends HelixElement {
|
|
|
178
178
|
* Where the link opens, for rows that should open outside the current page.
|
|
179
179
|
*/
|
|
180
180
|
target: string;
|
|
181
|
+
/**
|
|
182
|
+
* What the row's action means, from `tone`, the axis for meaning, and a
|
|
183
|
+
* subset of it: `danger` or `neutral`, unset being neutral.
|
|
184
|
+
*
|
|
185
|
+
* **`danger` is for an action that cannot be undone**, such as "Revoke token",
|
|
186
|
+
* "Remove member" or "Delete permanently", placed last, after a divider. A
|
|
187
|
+
* removal that can be undone or reviewed afterwards stays neutral: the color
|
|
188
|
+
* says this one cannot, and it says nothing once every removal wears it. The
|
|
189
|
+
* other five values say a status or a brand role, which a row that does
|
|
190
|
+
* something has neither of. Reflected, for the stylesheet, with no default.
|
|
191
|
+
*/
|
|
192
|
+
tone?: 'danger' | 'neutral';
|
|
181
193
|
/**
|
|
182
194
|
* The row's value, sent in `helix-before-select` when the row is chosen.
|
|
183
195
|
*/
|
|
@@ -364,6 +364,9 @@ __decorate([
|
|
|
364
364
|
__decorate([
|
|
365
365
|
property()
|
|
366
366
|
], HelixHeadlessMenuItem.prototype, "target", void 0);
|
|
367
|
+
__decorate([
|
|
368
|
+
property({ reflect: true })
|
|
369
|
+
], HelixHeadlessMenuItem.prototype, "tone", void 0);
|
|
367
370
|
__decorate([
|
|
368
371
|
property()
|
|
369
372
|
], HelixHeadlessMenuItem.prototype, "value", void 0);
|
|
@@ -231,7 +231,13 @@ export declare class HelixHeadlessMenu extends HelixHeadlessMenu_base {
|
|
|
231
231
|
label: string;
|
|
232
232
|
/** Whether submenus open beside their rows. */
|
|
233
233
|
private get flies();
|
|
234
|
-
/**
|
|
234
|
+
/**
|
|
235
|
+
* The rows of the top page, read through each section.
|
|
236
|
+
*
|
|
237
|
+
* **Nothing on the server**, where an element has no `children`: a menu served
|
|
238
|
+
* with a `filter` already set asked the filter for its count while rendering,
|
|
239
|
+
* and the render threw on the spread.
|
|
240
|
+
*/
|
|
235
241
|
private get topRows();
|
|
236
242
|
/** The rows of a submenu, or of the top page for null. */
|
|
237
243
|
private rowsOf;
|
|
@@ -99,6 +99,9 @@ let HelixHeadlessMenu = class HelixHeadlessMenu extends MixinCollection(MixinCon
|
|
|
99
99
|
});
|
|
100
100
|
this.settledOnce = false;
|
|
101
101
|
this.followRemoved = (records) => {
|
|
102
|
+
if (records.some((one) => [...one.addedNodes, ...one.removedNodes].some((node) => node.slot === 'start'))) {
|
|
103
|
+
this.requestUpdate();
|
|
104
|
+
}
|
|
102
105
|
if (!this.open) {
|
|
103
106
|
return;
|
|
104
107
|
}
|
|
@@ -329,14 +332,14 @@ let HelixHeadlessMenu = class HelixHeadlessMenu extends MixinCollection(MixinCon
|
|
|
329
332
|
return this.submenus === 'flyout';
|
|
330
333
|
}
|
|
331
334
|
get topRows() {
|
|
332
|
-
return [...this.children]
|
|
335
|
+
return [...(this.children ?? [])]
|
|
333
336
|
.filter((child) => child.slot !== 'trigger')
|
|
334
|
-
.flatMap((child) => (isSection(child) ? [...child.children] : [child]))
|
|
337
|
+
.flatMap((child) => (isSection(child) ? [...(child.children ?? [])] : [child]))
|
|
335
338
|
.filter(isItem);
|
|
336
339
|
}
|
|
337
340
|
rowsOf(holder) {
|
|
338
341
|
return holder
|
|
339
|
-
? [...holder.children].filter((child) => child.slot === 'submenu' && isItem(child))
|
|
342
|
+
? [...(holder.children ?? [])].filter((child) => child.slot === 'submenu' && isItem(child))
|
|
340
343
|
: this.topRows;
|
|
341
344
|
}
|
|
342
345
|
reachedRows() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { customElement, drawIcon, HelixElement, motionPaused, onMotionChange, pauseMotion, words, } from '@fusion.dev/helix-core';
|
|
3
|
-
import {
|
|
3
|
+
import { pauseFill, play } from '@fusion.dev/helix-icons';
|
|
4
4
|
import { html } from 'lit';
|
|
5
5
|
import { property, state } from 'lit/decorators.js';
|
|
6
6
|
let HelixHeadlessMotionToggle = class HelixHeadlessMotionToggle extends HelixElement {
|
|
@@ -41,7 +41,7 @@ let HelixHeadlessMotionToggle = class HelixHeadlessMotionToggle extends HelixEle
|
|
|
41
41
|
><span part="icon">${this.renderIcon()}</span><slot></slot></button>`;
|
|
42
42
|
}
|
|
43
43
|
renderIcon() {
|
|
44
|
-
return html `<slot name="icon">${drawIcon(this.paused ? play :
|
|
44
|
+
return html `<slot name="icon">${drawIcon(this.paused ? play : pauseFill)}</slot>`;
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
__decorate([
|
|
@@ -71,6 +71,7 @@ declare const HelixHeadlessNotification_base: (new (...args: any[]) => import("@
|
|
|
71
71
|
* @cssstate actions - While the actions slot holds something, so the words above make room for it.
|
|
72
72
|
* @cssstate controls - The item can be dismissed, so the time gives way to the dismiss control under a pointer.
|
|
73
73
|
* @cssstate read - While it has been read.
|
|
74
|
+
* @cssstate time - While `at` is set, so the row shows a time.
|
|
74
75
|
*/
|
|
75
76
|
export declare class HelixHeadlessNotification extends HelixHeadlessNotification_base {
|
|
76
77
|
/**
|
|
@@ -66,6 +66,7 @@ let HelixHeadlessNotification = class HelixHeadlessNotification extends MixinDis
|
|
|
66
66
|
willUpdate(changed) {
|
|
67
67
|
super.willUpdate(changed);
|
|
68
68
|
this.toggleState('read', this.read);
|
|
69
|
+
this.toggleState('time', this.at !== '');
|
|
69
70
|
}
|
|
70
71
|
updated(changed) {
|
|
71
72
|
super.updated(changed);
|
|
@@ -66,7 +66,7 @@ declare const HelixHeadlessNotifications_base: (new (...args: any[]) => import("
|
|
|
66
66
|
*
|
|
67
67
|
* @slot - The notifications.
|
|
68
68
|
* @slot empty - Replaces the words of `empty-text` in the `empty` part, such as a picture and a line of your own. The live region still says `empty-text`.
|
|
69
|
-
* @slot error -
|
|
69
|
+
* @slot error - Content shown after `error-text` in the `error` part, such as a button that tries again.
|
|
70
70
|
* @slot footer - Below the list, for a link to everything.
|
|
71
71
|
* @slot header - Above the list, for a title and the mark-all control.
|
|
72
72
|
* @slot loading - Replaces the words of `loading-text` in the `loading` part, such as a loader. The live region still says `loading-text`.
|
|
@@ -306,10 +306,12 @@ export declare class HelixHeadlessNotifications extends HelixHeadlessNotificatio
|
|
|
306
306
|
private noteArrivals;
|
|
307
307
|
protected willUpdate(changed: PropertyValues): void;
|
|
308
308
|
/**
|
|
309
|
-
* The error, the empty or the loading line
|
|
310
|
-
* name whose fallback is the words, so a page
|
|
311
|
-
*
|
|
312
|
-
* a
|
|
309
|
+
* The error, the empty or the loading line. The empty and loading lines are
|
|
310
|
+
* each around a slot of the same name whose fallback is the words, so a page
|
|
311
|
+
* can put its own in. The error line keeps its words and puts the `error`
|
|
312
|
+
* slot after them, as Table does, so a button that tries again never stands
|
|
313
|
+
* alone with no reason for it. The error shows under the rows there are,
|
|
314
|
+
* since a page that failed is news even to a feed that holds some.
|
|
313
315
|
*/
|
|
314
316
|
protected renderStatus(hasContent: boolean): TemplateResult | typeof nothing;
|
|
315
317
|
/**
|
|
@@ -231,7 +231,7 @@ let HelixHeadlessNotifications = class HelixHeadlessNotifications extends MixinC
|
|
|
231
231
|
}
|
|
232
232
|
renderStatus(hasContent) {
|
|
233
233
|
if (this.failed) {
|
|
234
|
-
return html `<p part="error"
|
|
234
|
+
return html `<p part="error">${this.loadError || this.errorText}<slot name="error"></slot></p>`;
|
|
235
235
|
}
|
|
236
236
|
if (!this.loading && hasContent) {
|
|
237
237
|
return nothing;
|
|
@@ -91,6 +91,8 @@ declare const HelixHeadlessNumberInput_base: (new (...args: any[]) => import("@f
|
|
|
91
91
|
*
|
|
92
92
|
* @cssstate at-max - The number is at `max`, so it cannot step up, as React Aria's NumberField says with `canIncrement`.
|
|
93
93
|
* @cssstate at-min - The number is at `min`, so it cannot step down.
|
|
94
|
+
* @cssstate has-end - Something is slotted into `end`, such as a unit.
|
|
95
|
+
* @cssstate has-start - Something is slotted into `start`, such as a currency sign.
|
|
94
96
|
* @cssstate invalid - The control has an error to show, from the browser's validation or from your `feedback`.
|
|
95
97
|
* @cssstate scrubbing - The label is being dragged to change the value, under `scrub`, as Zag's scrubber says while it is held.
|
|
96
98
|
*/
|
|
@@ -522,6 +524,10 @@ export declare class HelixHeadlessNumberInput extends HelixHeadlessNumberInput_b
|
|
|
522
524
|
protected renderDecrementIcon(): TemplateResult;
|
|
523
525
|
/** The step up button's icon, behind the same seam as `renderDecrementIcon`. */
|
|
524
526
|
protected renderIncrementIcon(): TemplateResult;
|
|
527
|
+
/** Whether the ends have been read once since the first render. */
|
|
528
|
+
private endsRead;
|
|
529
|
+
/** Says which ends hold something, one call apiece so each pairs with its `@cssstate`. */
|
|
530
|
+
private readonly readEnds;
|
|
525
531
|
protected render(): TemplateResult;
|
|
526
532
|
/**
|
|
527
533
|
* The value as a number, or `NaN` while the control is empty or does not
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { AriaForwardController, appleTouch, customElement, formatNumber, formatWords, numberAsValue as fromNumber, HelixFormElement, holdCaret, internalsOf, MixinControllerValue, MixinField, numberConverter, parseNumber, restoreValue, submitImplicitly, words, wordsLocale, } from '@fusion.dev/helix-core';
|
|
2
|
+
import { AriaForwardController, appleTouch, customElement, formatNumber, formatWords, numberAsValue as fromNumber, HelixFormElement, holdCaret, internalsOf, MixinControllerValue, MixinField, numberConverter, parseNumber, restoreValue, slotFilled, submitImplicitly, words, wordsLocale, } from '@fusion.dev/helix-core';
|
|
3
3
|
import { minus, plus } from '@fusion.dev/helix-icons';
|
|
4
4
|
import { html, nothing } from 'lit';
|
|
5
5
|
import { property, state } from 'lit/decorators.js';
|
|
@@ -224,6 +224,12 @@ let HelixHeadlessNumberInput = class HelixHeadlessNumberInput extends MixinContr
|
|
|
224
224
|
}
|
|
225
225
|
submitImplicitly(this.form);
|
|
226
226
|
};
|
|
227
|
+
this.endsRead = false;
|
|
228
|
+
this.readEnds = () => {
|
|
229
|
+
const filled = (name) => slotFilled(this.renderRoot?.querySelector(`slot[name="${name}"]`));
|
|
230
|
+
this.toggleState('has-start', filled('start'));
|
|
231
|
+
this.toggleState('has-end', filled('end'));
|
|
232
|
+
};
|
|
227
233
|
}
|
|
228
234
|
static { this.words = 'helix-number-input'; }
|
|
229
235
|
get shown() {
|
|
@@ -381,7 +387,7 @@ let HelixHeadlessNumberInput = class HelixHeadlessNumberInput extends MixinContr
|
|
|
381
387
|
internalsOf(this).setValidity({});
|
|
382
388
|
}
|
|
383
389
|
else if (this.required && this.value.trim() === '') {
|
|
384
|
-
internalsOf(this).setValidity({ valueMissing: true }, this.valueMissingMessage || 'Please fill
|
|
390
|
+
internalsOf(this).setValidity({ valueMissing: true }, this.valueMissingMessage || 'Please fill out this field.', control);
|
|
385
391
|
}
|
|
386
392
|
else if (this.value.trim() !== '' && parsed === null) {
|
|
387
393
|
internalsOf(this).setValidity({ badInput: true }, this.badInputMessage, control);
|
|
@@ -425,6 +431,10 @@ let HelixHeadlessNumberInput = class HelixHeadlessNumberInput extends MixinContr
|
|
|
425
431
|
}
|
|
426
432
|
updated(changed) {
|
|
427
433
|
super.updated(changed);
|
|
434
|
+
if (!this.endsRead) {
|
|
435
|
+
this.endsRead = true;
|
|
436
|
+
this.readEnds();
|
|
437
|
+
}
|
|
428
438
|
this.releaseCaret?.();
|
|
429
439
|
this.releaseCaret = undefined;
|
|
430
440
|
this.sync();
|
|
@@ -472,7 +482,7 @@ let HelixHeadlessNumberInput = class HelixHeadlessNumberInput extends MixinContr
|
|
|
472
482
|
>
|
|
473
483
|
${this.renderDecrementIcon()}
|
|
474
484
|
</button>
|
|
475
|
-
<slot name="start"></slot>
|
|
485
|
+
<slot name="start" @slotchange=${this.readEnds}></slot>
|
|
476
486
|
${''}
|
|
477
487
|
<input
|
|
478
488
|
part="control"
|
|
@@ -512,7 +522,7 @@ let HelixHeadlessNumberInput = class HelixHeadlessNumberInput extends MixinContr
|
|
|
512
522
|
@keypress=${this.handleKeypress}
|
|
513
523
|
@wheel=${this.handleWheel}
|
|
514
524
|
/>
|
|
515
|
-
<slot name="end"></slot>
|
|
525
|
+
<slot name="end" @slotchange=${this.readEnds}></slot>
|
|
516
526
|
<button
|
|
517
527
|
part="increment"
|
|
518
528
|
id="increment"
|
|
@@ -113,7 +113,7 @@ export type ObjectInspectorRenderer = (value: unknown, entry: ObjectInspectorEnt
|
|
|
113
113
|
* @csspart after - The space the rows below the drawn rows would take, when `windowed` is set.
|
|
114
114
|
* @csspart before - The space the rows above the drawn rows would take, when `windowed` is set.
|
|
115
115
|
* @csspart boolean - A `true` or `false`.
|
|
116
|
-
* @csspart copy - The copy button, which copies the active row.
|
|
116
|
+
* @csspart copy - The copy button, which copies the active row: at the end of the header where there is one, and beside the tree where there is not.
|
|
117
117
|
* @csspart copy-button - The button inside the copy control.
|
|
118
118
|
* @csspart copy-live - The live region inside the copy button, which says its `pending-label` when the copy becomes pending under focus.
|
|
119
119
|
* @csspart copy-mark - The clipboard icon, and the confirmation icon that replaces it.
|
|
@@ -131,8 +131,8 @@ export type ObjectInspectorRenderer = (value: unknown, entry: ObjectInspectorEnt
|
|
|
131
131
|
* @csspart copy-tooltip-surface-top - The tooltip while it is above the copy button. Set alongside `copy-tooltip-surface`.
|
|
132
132
|
* @csspart count - The number of entries a branch holds.
|
|
133
133
|
* @csspart empty - The row shown in the tree while it has no entries to show: no value, or a filter that matched none. It holds the `empty` slot.
|
|
134
|
-
* @csspart frame - The tree and the copy button beside it.
|
|
135
|
-
* @csspart header - The bar that holds the label, when there is
|
|
134
|
+
* @csspart frame - The tree, and the copy button beside it where there is no header.
|
|
135
|
+
* @csspart header - The bar that holds the label and the copy button, when there is a label.
|
|
136
136
|
* @csspart key - A property name or an array index.
|
|
137
137
|
* @csspart label - The label.
|
|
138
138
|
* @csspart live - How many entries a filter matched, in a region that screen readers announce when it changes. Drawn from the first filter on. Visually hidden in the styled tier.
|
|
@@ -152,6 +152,7 @@ export type ObjectInspectorRenderer = (value: unknown, entry: ObjectInspectorEnt
|
|
|
152
152
|
*
|
|
153
153
|
* @cssstate empty - While the tree has no entries to show: no value, or a filter that matched none.
|
|
154
154
|
* @cssstate filtered - While `filter` holds text.
|
|
155
|
+
* @cssstate labeled - While `label` names the tree, so the header shows and the copy button stands at its end.
|
|
155
156
|
* @cssstate matched - While `filter` holds text and matched at least one entry.
|
|
156
157
|
*/
|
|
157
158
|
export declare class HelixHeadlessObjectInspector extends HelixElement {
|
|
@@ -305,7 +306,7 @@ export declare class HelixHeadlessObjectInspector extends HelixElement {
|
|
|
305
306
|
resultsLabel: string;
|
|
306
307
|
/**
|
|
307
308
|
* The tree's accessible name when `label` is empty and the host names it
|
|
308
|
-
* with neither `aria-label` nor `aria-
|
|
309
|
+
* with neither `aria-label` nor `aria-labeledby`.
|
|
309
310
|
*/
|
|
310
311
|
treeLabel: string;
|
|
311
312
|
/**
|
|
@@ -351,7 +352,7 @@ export declare class HelixHeadlessObjectInspector extends HelixElement {
|
|
|
351
352
|
private readonly typed;
|
|
352
353
|
/** The branches of the last value seen, by path, so a new value can tell old ones from new. */
|
|
353
354
|
private branches;
|
|
354
|
-
/** Carries a host `aria-label` and `aria-
|
|
355
|
+
/** Carries a host `aria-label` and `aria-labeledby` to the tree, which is what takes focus. */
|
|
355
356
|
protected readonly aria: AriaForwardController;
|
|
356
357
|
/** Says how many entries a filter matched. */
|
|
357
358
|
private readonly status;
|
|
@@ -98,7 +98,9 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
|
|
|
98
98
|
break;
|
|
99
99
|
case 'ArrowRight':
|
|
100
100
|
case 'ArrowLeft':
|
|
101
|
-
switch (treeArrow(row, inlineStep(this, event.key) === 1
|
|
101
|
+
switch (treeArrow(row, inlineStep(this.renderRoot.querySelector('[part="tree"]') ?? this, event.key) === 1
|
|
102
|
+
? 1
|
|
103
|
+
: -1)) {
|
|
102
104
|
case 'open':
|
|
103
105
|
case 'close':
|
|
104
106
|
this.toggle(row, !row.open);
|
|
@@ -251,6 +253,7 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
|
|
|
251
253
|
}
|
|
252
254
|
this.toggleState('empty', this.blank);
|
|
253
255
|
this.toggleState('filtered', this.found !== undefined);
|
|
256
|
+
this.toggleState('labeled', this.label !== '');
|
|
254
257
|
this.toggleState('matched', (this.found?.size ?? 0) > 0);
|
|
255
258
|
}
|
|
256
259
|
counted(which, count) {
|
|
@@ -509,7 +512,10 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
|
|
|
509
512
|
shown.splice(kept < first ? 0 : shown.length, 0, [keptRow, kept]);
|
|
510
513
|
}
|
|
511
514
|
const stopless = rows.length > 0 && !shown.some(([, at]) => at === this.cursor);
|
|
512
|
-
|
|
515
|
+
const copy = this.noCopy ? nothing : this.renderCopyButton(rows[this.cursor]);
|
|
516
|
+
return html `${this.label
|
|
517
|
+
? html `<div part="header"><span part="label">${this.label}</span>${copy}</div>`
|
|
518
|
+
: nothing}${this.filterable
|
|
513
519
|
? html `<input
|
|
514
520
|
part="search-field"
|
|
515
521
|
type="search"
|
|
@@ -542,7 +548,7 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
|
|
|
542
548
|
: nothing}
|
|
543
549
|
${this.windowed ? html `<div part="after" role="presentation" style="block-size: ${after}px"></div>` : nothing}
|
|
544
550
|
</div>
|
|
545
|
-
${this.
|
|
551
|
+
${this.label ? nothing : copy}
|
|
546
552
|
</div>
|
|
547
553
|
${drawStatus(this.status)}`;
|
|
548
554
|
}
|
|
@@ -213,6 +213,20 @@ export declare class HelixHeadlessOption extends HelixElement {
|
|
|
213
213
|
* reads the row's words, then `label`.
|
|
214
214
|
*/
|
|
215
215
|
textValue: string;
|
|
216
|
+
/**
|
|
217
|
+
* What the row's action means, from `tone`, the axis for meaning, and a
|
|
218
|
+
* subset of it: `danger` or `neutral`, unset being neutral.
|
|
219
|
+
*
|
|
220
|
+
* **`danger` is for an action that cannot be undone**, such as "Revoke token",
|
|
221
|
+
* "Remove member" or "Delete permanently": in a command palette, where an
|
|
222
|
+
* option is an action, placed last in its group. A choice in a listbox is not
|
|
223
|
+
* an action and keeps the neutral tone. A
|
|
224
|
+
* removal that can be undone or reviewed afterwards stays neutral: the color
|
|
225
|
+
* says this one cannot, and it says nothing once every removal wears it. The
|
|
226
|
+
* other five values say a status or a brand role, which a row that does
|
|
227
|
+
* something has neither of. Reflected, for the stylesheet, with no default.
|
|
228
|
+
*/
|
|
229
|
+
tone?: 'danger' | 'neutral';
|
|
216
230
|
/**
|
|
217
231
|
* The value that identifies the option, and that a form submits.
|
|
218
232
|
*/
|
|
@@ -284,8 +298,8 @@ export declare class HelixHeadlessOption extends HelixElement {
|
|
|
284
298
|
*/
|
|
285
299
|
protected willUpdate(changed: PropertyValues): void;
|
|
286
300
|
/**
|
|
287
|
-
* Reads whether `media`
|
|
288
|
-
* element drew it or hydrated a server's.
|
|
301
|
+
* Reads whether `media` and `indicator` hold anything once the row is drawn,
|
|
302
|
+
* whether this element drew it or hydrated a server's.
|
|
289
303
|
*
|
|
290
304
|
* **`slotchange` alone misses a hydrated option.** A server's shadow root is
|
|
291
305
|
* parsed with the page, so its slots are filled before Lit binds the
|
|
@@ -74,6 +74,10 @@ let HelixHeadlessOption = class HelixHeadlessOption extends HelixElement {
|
|
|
74
74
|
if (media) {
|
|
75
75
|
this.toggleState('has-media', slotFilled(media));
|
|
76
76
|
}
|
|
77
|
+
const indicator = this.renderRoot.querySelector('slot[name="indicator"]');
|
|
78
|
+
if (indicator) {
|
|
79
|
+
this.toggleState('has-indicator', slotFilled(indicator));
|
|
80
|
+
}
|
|
77
81
|
}
|
|
78
82
|
updated(changed) {
|
|
79
83
|
super.updated(changed);
|
|
@@ -171,6 +175,9 @@ __decorate([
|
|
|
171
175
|
__decorate([
|
|
172
176
|
property({ attribute: 'text-value' })
|
|
173
177
|
], HelixHeadlessOption.prototype, "textValue", void 0);
|
|
178
|
+
__decorate([
|
|
179
|
+
property({ reflect: true })
|
|
180
|
+
], HelixHeadlessOption.prototype, "tone", void 0);
|
|
174
181
|
__decorate([
|
|
175
182
|
property()
|
|
176
183
|
], HelixHeadlessOption.prototype, "value", void 0);
|
|
@@ -79,6 +79,9 @@ export declare class HelixHeadlessPagination extends HelixElement {
|
|
|
79
79
|
* place. This is the shape a narrow screen wants, and the only shape possible
|
|
80
80
|
* where the total is large enough that no window over it is useful.
|
|
81
81
|
*
|
|
82
|
+
* Set, it always shows. Unset, the control still folds into it wherever its
|
|
83
|
+
* own width cannot hold the full row on one line, and unfolds when it can.
|
|
84
|
+
*
|
|
82
85
|
* Not reflected, for the reason `ends` is not: it decides what renders, so
|
|
83
86
|
* nothing has to select on it.
|
|
84
87
|
*/
|
|
@@ -228,6 +231,20 @@ export declare class HelixHeadlessPagination extends HelixElement {
|
|
|
228
231
|
* there is not a ninth string to translate for the sake of one of them.
|
|
229
232
|
*/
|
|
230
233
|
private announcement;
|
|
234
|
+
/**
|
|
235
|
+
* Whether the full row does not fit the control's own width, so it shows the
|
|
236
|
+
* compact form until the width can hold the row again. Its own width and not
|
|
237
|
+
* the screen's, so a pagination in a narrow column of a wide page folds too.
|
|
238
|
+
* Decided by the owner on November 3, 2026: a default Pagination wrapped into
|
|
239
|
+
* three rows, back arrow, numbers, forward arrow, at 280 and 390.
|
|
240
|
+
*/
|
|
241
|
+
private narrow;
|
|
242
|
+
/** How wide the full row measured when it last drew, to know when it fits again. */
|
|
243
|
+
private fullWidth;
|
|
244
|
+
/** Watches the control's own width. */
|
|
245
|
+
private widths;
|
|
246
|
+
/** Whether the compact form shows, asked for or forced by a narrow width. */
|
|
247
|
+
private get folded();
|
|
231
248
|
/** The page last announced, so the first render announces nothing. */
|
|
232
249
|
private announced;
|
|
233
250
|
/** The page on show, whoever set it, and `undefined` until somebody has. */
|
|
@@ -296,6 +313,25 @@ export declare class HelixHeadlessPagination extends HelixElement {
|
|
|
296
313
|
private restoreFocus;
|
|
297
314
|
protected willUpdate(changed: PropertyValues): void;
|
|
298
315
|
protected updated(changed: PropertyValues): void;
|
|
316
|
+
connectedCallback(): void;
|
|
317
|
+
disconnectedCallback(): void;
|
|
318
|
+
/**
|
|
319
|
+
* The width the full row takes on one line: each control's own width, the
|
|
320
|
+
* whole run of pages however much of it scrolls, and the gaps between them.
|
|
321
|
+
*/
|
|
322
|
+
private measureRow;
|
|
323
|
+
/**
|
|
324
|
+
* The room the whole run of pages takes in the row: its scroll width, which
|
|
325
|
+
* counts its padding, with its inline margins, which the row counts too.
|
|
326
|
+
* **The margins as well**, since a sheet may pad the run to hold the focus
|
|
327
|
+
* ring and hand the room back with negative margins: measured on November 4,
|
|
328
|
+
* 2026, the run's scroll width alone read 8 pixels wider than the row it
|
|
329
|
+
* sat in, so a two page control in a 1440 page folded to "1 of 2" and, as
|
|
330
|
+
* wide as its folded form, never unfolded.
|
|
331
|
+
*/
|
|
332
|
+
private listWidth;
|
|
333
|
+
/** Folds into the compact form where the full row does not fit, and back where it does. */
|
|
334
|
+
private fit;
|
|
299
335
|
/**
|
|
300
336
|
* Says where the reader now is, once they have moved.
|
|
301
337
|
*
|