@fusion.dev/helix-headless 0.236.0 → 0.237.1
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 +10 -7
- package/dist/data-table/root/data-table-root.js +6 -1
- 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 +14 -0
- package/dist/option/root/option-root.js +3 -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/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/root/table-root.d.ts +7 -6
- package/dist/table/root/table-root.js +1 -1
- 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 +633 -168
- package/types/vue.d.ts +379 -95
- package/types/words.d.ts +51 -12
|
@@ -52,7 +52,10 @@ declare const HelixHeadlessDrawer_base: (new (...args: any[]) => import("@fusion
|
|
|
52
52
|
* is: the elements in the default slot before the first one that is or holds
|
|
53
53
|
* a control. An `aria-describedby` on the host replaces it.
|
|
54
54
|
*
|
|
55
|
-
* **Keyboard.** Opening moves focus to the
|
|
55
|
+
* **Keyboard.** Opening a modal drawer moves focus to the control marked
|
|
56
|
+
* `autofocus`, or else to the control that closes it: a slotted one whose
|
|
57
|
+
* `command` closes this drawer, such as a Close or Cancel button, and else
|
|
58
|
+
* the close control `dismissible` draws.
|
|
56
59
|
*
|
|
57
60
|
* | Key | What it does |
|
|
58
61
|
* |---|---|
|
|
@@ -86,7 +89,7 @@ declare const HelixHeadlessDrawer_base: (new (...args: any[]) => import("@fusion
|
|
|
86
89
|
*
|
|
87
90
|
* @slot - The drawer's content.
|
|
88
91
|
* @slot dismiss-icon - Replaces the glyph inside the close control.
|
|
89
|
-
* @slot footer - Content pinned below the scrolling area, such as the drawer's actions.
|
|
92
|
+
* @slot footer - Content pinned below the scrolling area, such as the drawer's actions. Write the action that dismisses first and the primary one last.
|
|
90
93
|
* @slot header - Content pinned above the scrolling area.
|
|
91
94
|
*
|
|
92
95
|
* @event {Event} close - Sent from the host after the drawer closes, because the native `close` event does not leave the shadow root.
|
|
@@ -326,6 +329,11 @@ export declare class HelixHeadlessDrawer extends HelixHeadlessDrawer_base {
|
|
|
326
329
|
connectedCallback(): void;
|
|
327
330
|
disconnectedCallback(): void;
|
|
328
331
|
protected updated(changed: PropertyValues): void;
|
|
332
|
+
/**
|
|
333
|
+
* The control that closes this drawer: a slotted one whose `command` closes
|
|
334
|
+
* it, such as Close or Cancel, and else the close control `dismissible` draws.
|
|
335
|
+
*/
|
|
336
|
+
private get closer();
|
|
329
337
|
protected render(): TemplateResult;
|
|
330
338
|
/**
|
|
331
339
|
* The glyph on the close control, behind a seam: slot fallback, so a
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { AriaForwardController, auditName, CommandController, customElement, drawDismiss, drawDismissGlyph, edgeOffset, FocusScopeController, HelixElement, headingsIn, isRtl, lockScroll, MixinControllerOpen, nearest, OpenPhaseController, onUnlessFalse, parseSnapPoints, reflectElements, SwipeController, settleSwipe, snapTravel, swipeAxis, swipeEdge, towardEdge, unlockScroll, words, } from '@fusion.dev/helix-core';
|
|
2
|
+
import { AriaForwardController, auditName, autofocusTarget, CommandController, coversPress, customElement, drawDismiss, drawDismissGlyph, edgeOffset, FocusScopeController, focusAs, focusableElements, HelixElement, headingsIn, isRtl, lockScroll, MixinControllerOpen, nearest, OpenPhaseController, onUnlessFalse, openingFocus, parseSnapPoints, raiseAbove, reflectElements, refocusWithin, SwipeController, settleSwipe, snapTravel, swipeAxis, swipeEdge, towardEdge, unlockScroll, words, } from '@fusion.dev/helix-core';
|
|
3
3
|
import { html, nothing } from 'lit';
|
|
4
4
|
import { property } from 'lit/decorators.js';
|
|
5
5
|
import { wordsIn } from '../../dialog/description.js';
|
|
@@ -93,6 +93,9 @@ let HelixHeadlessDrawer = class HelixHeadlessDrawer extends MixinControllerOpen(
|
|
|
93
93
|
if (!panel || event.target !== panel || !this.modal) {
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
96
|
+
if (coversPress(event)) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
96
99
|
const box = panel.getBoundingClientRect();
|
|
97
100
|
if (event.clientX >= box.left &&
|
|
98
101
|
event.clientX <= box.right &&
|
|
@@ -247,18 +250,48 @@ let HelixHeadlessDrawer = class HelixHeadlessDrawer extends MixinControllerOpen(
|
|
|
247
250
|
headingsIn(this.renderRoot
|
|
248
251
|
.querySelector('slot[name="header"]')
|
|
249
252
|
?.assignedElements({ flatten: true }) ?? []).length > 0);
|
|
253
|
+
const focusing = openingFocus();
|
|
250
254
|
if (this.modal) {
|
|
251
255
|
panel.showModal();
|
|
256
|
+
raiseAbove();
|
|
252
257
|
}
|
|
253
258
|
else {
|
|
254
259
|
panel.show();
|
|
255
260
|
}
|
|
261
|
+
void autofocusTarget(this).then((marked) => {
|
|
262
|
+
if (!this.open) {
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
const first = marked ?? (this.modal ? this.closer : null);
|
|
266
|
+
if (first) {
|
|
267
|
+
focusAs(first, focusing);
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
const chose = this.matches(':focus-within') &&
|
|
271
|
+
!(this.renderRoot instanceof ShadowRoot && this.renderRoot.activeElement === panel);
|
|
272
|
+
const fallback = this.modal && !chose ? focusableElements(this)[0] : undefined;
|
|
273
|
+
if (fallback) {
|
|
274
|
+
focusAs(fallback, focusing);
|
|
275
|
+
}
|
|
276
|
+
else {
|
|
277
|
+
refocusWithin(this, focusing);
|
|
278
|
+
}
|
|
279
|
+
});
|
|
256
280
|
this.restAt(parseSnapPoints(this.snapPoints)[0] ?? 1);
|
|
257
281
|
}
|
|
258
282
|
else if (!this.open && panel.open) {
|
|
259
283
|
panel.close();
|
|
260
284
|
}
|
|
261
285
|
}
|
|
286
|
+
get closer() {
|
|
287
|
+
const closes = [
|
|
288
|
+
...this.querySelectorAll('[command="--close"], [command="close"], [command="request-close"]'),
|
|
289
|
+
].find((one) => {
|
|
290
|
+
const target = one.getAttribute('commandfor');
|
|
291
|
+
return target === null || target === this.id;
|
|
292
|
+
});
|
|
293
|
+
return closes ?? this.renderRoot.querySelector('dialog > button');
|
|
294
|
+
}
|
|
262
295
|
render() {
|
|
263
296
|
const closedBy = this.closedBy ?? (this.modal ? undefined : 'closerequest');
|
|
264
297
|
return html `<dialog
|
|
@@ -29,11 +29,11 @@ let HelixHeadlessFilterChip = class HelixHeadlessFilterChip extends MixinDismiss
|
|
|
29
29
|
const operator = this.operatorLabel !== '' || this.knownChildren.some((child) => child.slot === 'operator');
|
|
30
30
|
const values = !this.childrenKnown ||
|
|
31
31
|
[...this.childNodes].some((node) => node instanceof Element ? node.slot === '' : (node.textContent ?? '').trim() !== '');
|
|
32
|
-
return html `<span part="field"><slot name="field">${this.label}</slot></span>
|
|
32
|
+
return html `<span part="field"><slot name="field" dir="auto">${this.label}</slot></span>
|
|
33
33
|
${operator
|
|
34
34
|
? html `<span part="operator"><slot name="operator">${this.operatorLabel}</slot></span>`
|
|
35
35
|
: nothing}
|
|
36
|
-
<span part="values" ?hidden=${!values}><slot></slot></span>
|
|
36
|
+
<span part="values" ?hidden=${!values}><slot dir="auto"></slot></span>
|
|
37
37
|
${this.dismissible
|
|
38
38
|
? html `<button
|
|
39
39
|
part="dismiss"
|
|
@@ -272,7 +272,17 @@ export declare class HelixHeadlessFind extends HelixHeadlessFind_base {
|
|
|
272
272
|
private offers;
|
|
273
273
|
/** The text selected in the content, where it lies on one line, or nothing. */
|
|
274
274
|
private selectedText;
|
|
275
|
-
/**
|
|
275
|
+
/** Whether a search is waiting for the document to finish parsing. */
|
|
276
|
+
private waitingForParse;
|
|
277
|
+
/**
|
|
278
|
+
* Searches with the finder, and says where the search stands.
|
|
279
|
+
*
|
|
280
|
+
* **A target the parser has not reached yet is searched once it has.** A
|
|
281
|
+
* Find defined by a script in the head upgrades before the element `for`
|
|
282
|
+
* names exists, and searched nothing for good: no matches, with the text on
|
|
283
|
+
* the page. While the document is still loading, a search with no target
|
|
284
|
+
* runs again when parsing ends, as `autofocusTarget` waits for the same.
|
|
285
|
+
*/
|
|
276
286
|
private search;
|
|
277
287
|
/** Takes the last search's marks away, where it drew any. */
|
|
278
288
|
private endSearch;
|
|
@@ -44,6 +44,7 @@ let HelixHeadlessFind = class HelixHeadlessFind extends MixinControllerOpen(Heli
|
|
|
44
44
|
this.announcement = '';
|
|
45
45
|
this.said = 0;
|
|
46
46
|
this.inside = false;
|
|
47
|
+
this.waitingForParse = false;
|
|
47
48
|
this.handleWhere = (event) => {
|
|
48
49
|
this.inside = this.within(event);
|
|
49
50
|
};
|
|
@@ -263,6 +264,16 @@ let HelixHeadlessFind = class HelixHeadlessFind extends MixinControllerOpen(Heli
|
|
|
263
264
|
search(direction) {
|
|
264
265
|
const finder = this.finder;
|
|
265
266
|
if (!finder) {
|
|
267
|
+
const document = this.ownerDocument;
|
|
268
|
+
if (document?.readyState === 'loading' && !this.waitingForParse) {
|
|
269
|
+
this.waitingForParse = true;
|
|
270
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
271
|
+
this.waitingForParse = false;
|
|
272
|
+
if (this.open) {
|
|
273
|
+
this.search('first');
|
|
274
|
+
}
|
|
275
|
+
}, { once: true });
|
|
276
|
+
}
|
|
266
277
|
return;
|
|
267
278
|
}
|
|
268
279
|
if (this.marking !== finder) {
|
|
@@ -75,9 +75,9 @@ declare const HelixHeadlessHeatmap_base: typeof HelixElement & (new (...args: an
|
|
|
75
75
|
* Space, each with the row of the table in `index`.
|
|
76
76
|
*
|
|
77
77
|
* **Nothing to draw.** A table with no readings shows `empty-text`, "No
|
|
78
|
-
* readings",
|
|
79
|
-
* readings arrive. The `empty` and `loading` slots take markup in place
|
|
80
|
-
* either, as on every chart.
|
|
78
|
+
* readings", in place of the cells, and `loading` shows `loading-text` there
|
|
79
|
+
* until readings arrive. The `empty` and `loading` slots take markup in place
|
|
80
|
+
* of either, as on every chart.
|
|
81
81
|
*
|
|
82
82
|
* **Keyboard.** The strip is one tab stop once it has cells.
|
|
83
83
|
*
|
|
@@ -99,10 +99,11 @@ declare const HelixHeadlessHeatmap_base: typeof HelixElement & (new (...args: an
|
|
|
99
99
|
* @aliases Contribution graph, Uptime strip, Calendar heatmap, Activity graph
|
|
100
100
|
* @documentation https://fusion.dev/helix/components/heatmap
|
|
101
101
|
*
|
|
102
|
-
* @slot empty - Content shown
|
|
102
|
+
* @slot empty - Content shown in place of the cells when the table has no readings, such as a link to add the first. Falls back to `empty-text`.
|
|
103
103
|
* @slot end - Below the strip, at the trailing edge: usually the newest date.
|
|
104
|
-
* @slot
|
|
105
|
-
* @slot
|
|
104
|
+
* @slot error - Content shown after `error-text` while it is set and there are no readings, such as a button that tries again.
|
|
105
|
+
* @slot loading - Content shown in place of the cells while `loading` is set and there are no readings yet. Falls back to `loading-text`.
|
|
106
|
+
* @slot start - Below the strip, at the leading edge: usually the oldest date. While a narrow strip drops its oldest readings, the first drawn row stands in its place: its date, as day and short month in the chart's locale, where its heading holds a `<time>`, and its heading's words otherwise.
|
|
106
107
|
* @slot summary - Below the strip, in the middle: a summary of the range shown.
|
|
107
108
|
*
|
|
108
109
|
* @event {Event} change - Fired once a press or a key has changed which cells are selected.
|
|
@@ -114,11 +115,12 @@ declare const HelixHeadlessHeatmap_base: typeof HelixElement & (new (...args: an
|
|
|
114
115
|
* @csspart cell - One reading.
|
|
115
116
|
* @csspart cell-active - The cell the pointer or the keys rest on. Set alongside `cell`.
|
|
116
117
|
* @csspart cell-selected - A cell that is selected, under `selection-mode`. Set alongside `cell`.
|
|
117
|
-
* @csspart empty - The words
|
|
118
|
+
* @csspart empty - The words in place of the cells when the table has no readings: the `empty` slot, falling back to `empty-text`. Not drawn while the table cannot be read yet, on the server and during hydration, there being no document to resolve `for` in.
|
|
118
119
|
* @csspart end - The trailing slot's box.
|
|
120
|
+
* @csspart error - The words in place of the cells while `error-text` is set and there are no readings, followed by the `error` slot. Announced as it appears.
|
|
119
121
|
* @csspart footer - The three-slot row under the strip.
|
|
120
122
|
* @csspart live - The readout: a polite live region that says the cell the keys moved to. Hide it visually.
|
|
121
|
-
* @csspart loading - The words
|
|
123
|
+
* @csspart loading - The words in place of the cells while `loading` is set and there are no readings: the `loading` slot, falling back to `loading-text`.
|
|
122
124
|
* @csspart mark - The invisible point the tooltip is anchored to.
|
|
123
125
|
* @csspart overview - The busiest reading and the total of the readings drawn, written as a sentence for screen readers, which describes the strip. Rendered once there are cells. Hide it visually.
|
|
124
126
|
* @csspart plot - The same element as `strip`, under the name every chart gives the drawing that takes focus.
|
|
@@ -164,6 +166,7 @@ declare const HelixHeadlessHeatmap_base: typeof HelixElement & (new (...args: an
|
|
|
164
166
|
*
|
|
165
167
|
* @cssstate active - While a cell is shown, under the pointer or the keys, with its tooltip open.
|
|
166
168
|
* @cssstate empty - While the `empty` part stands in place of the cells.
|
|
169
|
+
* @cssstate error - While the `error` part stands in place of the cells.
|
|
167
170
|
* @cssstate loading - While the `loading` part stands in place of the cells.
|
|
168
171
|
*/
|
|
169
172
|
export declare class HelixHeadlessHeatmap extends HelixHeadlessHeatmap_base {
|
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { AriaForwardController, byRow, CHART_PLOT, commaList, customElement, drawTooltip, formatWords, HelixElement, HelixReadingChangeEvent, HelixReadingPressEvent, HelixResizeEvent, MixinChartSource, MixinChartStatus, markRegion, numberConverter, pressedValue, rangeAdd, requestValue, StatusController, spokenReading, words, writtenList, writtenNumbers, } from '@fusion.dev/helix-core';
|
|
2
|
+
import { AriaForwardController, byRow, CHART_PLOT, commaList, customElement, drawTooltip, formatWords, HelixElement, HelixReadingChangeEvent, HelixReadingPressEvent, HelixResizeEvent, MixinChartSource, MixinChartStatus, markRegion, numberConverter, pressedValue, rangeAdd, requestValue, StatusController, spokenReading, words, wordsLocale, writtenList, writtenNumbers, } from '@fusion.dev/helix-core';
|
|
3
3
|
import { html, nothing } from 'lit';
|
|
4
4
|
import { property, state } from 'lit/decorators.js';
|
|
5
5
|
import '../../tooltip/index.js';
|
|
6
6
|
import { inSequence, rectangleOf } from '../rectangle.js';
|
|
7
7
|
import { fits, monthPage, overviewOf, toneOf } from './buckets.js';
|
|
8
|
+
const dayOf = (when, locale) => {
|
|
9
|
+
if (!when) {
|
|
10
|
+
return undefined;
|
|
11
|
+
}
|
|
12
|
+
const date = new Date(when);
|
|
13
|
+
if (Number.isNaN(date.getTime())) {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
const dateOnly = /^\d{4}-\d{2}-\d{2}$/.test(when);
|
|
17
|
+
try {
|
|
18
|
+
return new Intl.DateTimeFormat(locale || undefined, {
|
|
19
|
+
day: 'numeric',
|
|
20
|
+
month: 'short',
|
|
21
|
+
...(dateOnly ? { timeZone: 'UTC' } : {}),
|
|
22
|
+
}).format(date);
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
8
28
|
let HelixHeadlessHeatmap = class HelixHeadlessHeatmap extends MixinChartStatus(MixinChartSource(HelixElement)) {
|
|
9
29
|
constructor() {
|
|
10
30
|
super(...arguments);
|
|
@@ -276,6 +296,11 @@ let HelixHeadlessHeatmap = class HelixHeadlessHeatmap extends MixinChartStatus(M
|
|
|
276
296
|
></span>`;
|
|
277
297
|
});
|
|
278
298
|
const at = this.pointer.at;
|
|
299
|
+
const dropped = this.dropped;
|
|
300
|
+
const first = this.sourceRows[dropped];
|
|
301
|
+
const drawnStart = dropped > 0 && this.querySelector(':scope > [slot="start"]') !== null
|
|
302
|
+
? (dayOf(first?.when, wordsLocale(this)) ?? first?.label ?? '')
|
|
303
|
+
: '';
|
|
279
304
|
return html `<div
|
|
280
305
|
aria-activedescendant=${grid && at >= 0 ? `cell-${at}` : nothing}
|
|
281
306
|
aria-describedby=${readable ? 'helix-chart-summary' : nothing}
|
|
@@ -297,7 +322,7 @@ let HelixHeadlessHeatmap = class HelixHeadlessHeatmap extends MixinChartStatus(M
|
|
|
297
322
|
</div>
|
|
298
323
|
${cells.length === 0 ? this.renderStatus() : nothing}
|
|
299
324
|
<div part="footer">
|
|
300
|
-
<span part="start"><slot name="start"></slot
|
|
325
|
+
<span part="start"><slot ?hidden=${drawnStart !== ''} name="start" @slotchange=${() => this.requestUpdate()}></slot>${drawnStart}</span>
|
|
301
326
|
<span part="summary"><slot name="summary"></slot></span>
|
|
302
327
|
<span part="end"><slot name="end"></slot></span>
|
|
303
328
|
</div>${readable ? this.renderOverview(cells) : nothing}${this.status.spoken
|
|
@@ -149,6 +149,10 @@ export declare class HelixHeadlessKbd extends HelixElement {
|
|
|
149
149
|
* so a sheet can draw a cap per key. Written with no space between, so a
|
|
150
150
|
* chord reads as the one label it was. Where the chord is said in words,
|
|
151
151
|
* the parts are hidden from a screen reader, which reads the words.
|
|
152
|
+
*
|
|
153
|
+
* A key drawn as one arrow or technical symbol, such as ⌘, ⇧ or ↵, carries
|
|
154
|
+
* `data-symbol`, so a sheet can draw it in a face that has the glyph at the
|
|
155
|
+
* height of a letter.
|
|
152
156
|
*/
|
|
153
157
|
protected renderChord(): TemplateResult;
|
|
154
158
|
}
|
|
@@ -152,7 +152,7 @@ let HelixHeadlessKbd = class HelixHeadlessKbd extends HelixElement {
|
|
|
152
152
|
renderChord() {
|
|
153
153
|
const { keys, separator, spoken } = this.label;
|
|
154
154
|
const hidden = spoken === '' ? nothing : 'true';
|
|
155
|
-
return html `${keys.map((key, index) => html `${index > 0 && separator !== '' ? html `<span part="separator" aria-hidden=${hidden}>${separator}</span>` : nothing}<span part="key" aria-hidden=${hidden}>${key}</span>`)}`;
|
|
155
|
+
return html `${keys.map((key, index) => html `${index > 0 && separator !== '' ? html `<span part="separator" aria-hidden=${hidden}>${separator}</span>` : nothing}<span part="key" aria-hidden=${hidden} ?data-symbol=${drawnAsSymbol(key)}>${key}</span>`)}`;
|
|
156
156
|
}
|
|
157
157
|
};
|
|
158
158
|
__decorate([
|
|
@@ -177,3 +177,4 @@ HelixHeadlessKbd = __decorate([
|
|
|
177
177
|
customElement('helix-headless-kbd')
|
|
178
178
|
], HelixHeadlessKbd);
|
|
179
179
|
export { HelixHeadlessKbd };
|
|
180
|
+
const drawnAsSymbol = (key) => /^[\u2190-\u21ff\u2300-\u23ff]$/u.test(key);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { auditName, CommandController, customElement, DelayController, deepActiveElement, deepContains, drawDismiss, drawDismissGlyph, FocusScopeController, FullscreenController, formatWords, HelixElement, hostAria, IdleController, inlineStep, internalsOf, isRtl, keyClaimed, lockScroll, MIRROR_RULE, MixinControllerActive, MixinControllerOpen, numberConverter, OpenPhaseController, resolveActiveItem, SwipeController, swipeStep, timeConverter, unlockScroll, whenHydrated, words, } from '@fusion.dev/helix-core';
|
|
2
|
+
import { auditName, CommandController, coversPress, customElement, DelayController, deepActiveElement, deepContains, drawDismiss, drawDismissGlyph, FocusScopeController, FullscreenController, formatWords, HelixElement, hostAria, IdleController, inlineStep, internalsOf, isRtl, keyClaimed, lockScroll, MIRROR_RULE, MixinControllerActive, MixinControllerOpen, numberConverter, OpenPhaseController, raiseAbove, resolveActiveItem, SwipeController, swipeStep, timeConverter, unlockScroll, whenHydrated, words, } from '@fusion.dev/helix-core';
|
|
3
3
|
import { caretLeft, caretRight, minus, plus } from '@fusion.dev/helix-icons';
|
|
4
4
|
import { html, nothing } from 'lit';
|
|
5
5
|
import { property, state } from 'lit/decorators.js';
|
|
@@ -133,7 +133,7 @@ let HelixHeadlessLightbox = class HelixHeadlessLightbox extends MixinControllerA
|
|
|
133
133
|
};
|
|
134
134
|
this.zoomedItem = undefined;
|
|
135
135
|
this.handleBackdrop = (event) => {
|
|
136
|
-
if (this.dragged(event) || !this.onEmptyArea(event)) {
|
|
136
|
+
if (this.dragged(event) || !this.onEmptyArea(event) || coversPress(event)) {
|
|
137
137
|
return;
|
|
138
138
|
}
|
|
139
139
|
this.requestOpen(false);
|
|
@@ -358,6 +358,7 @@ let HelixHeadlessLightbox = class HelixHeadlessLightbox extends MixinControllerA
|
|
|
358
358
|
if (this.open && !dialog.open) {
|
|
359
359
|
auditName(this, () => null, 'lightbox', () => this.label !== '');
|
|
360
360
|
dialog.showModal();
|
|
361
|
+
raiseAbove();
|
|
361
362
|
dialog.focus({ preventScroll: true });
|
|
362
363
|
this.idle.stir();
|
|
363
364
|
}
|
|
@@ -27,8 +27,10 @@ declare const HelixHeadlessLineChart_base: typeof HelixElement & (new (...args:
|
|
|
27
27
|
* `<svg>` that fills its box scales with the box, so the same `font-size` can
|
|
28
28
|
* render at 10px in a narrow chart and 43px in a wide one.
|
|
29
29
|
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
30
|
+
* The scale's numbers stand beside the plot, written in `locale`, at the
|
|
31
|
+
* levels the gridlines rule, and the top of the scale is a level above the
|
|
32
|
+
* highest reading. `value-axis="none"` and `gridlines="none"` take them away,
|
|
33
|
+
* for a chart read for its shape.
|
|
32
34
|
*
|
|
33
35
|
* The table is the accessible representation, and the drawing is hidden from
|
|
34
36
|
* screen readers, who get the numbers. The `summary` part names the chart, from
|
|
@@ -54,6 +56,9 @@ declare const HelixHeadlessLineChart_base: typeof HelixElement & (new (...args:
|
|
|
54
56
|
* `empty-text`, "No readings", in the plot, and `loading` shows `loading-text`
|
|
55
57
|
* there until readings arrive. The `empty` and `loading` slots take markup in
|
|
56
58
|
* their place, such as a link to add the first reading.
|
|
59
|
+
* When the readings did not load, set `error-text`, such as "The visits did
|
|
60
|
+
* not load": it stands in the plot in place of both, and the `error` slot
|
|
61
|
+
* takes a button that tries again, shown after the words.
|
|
57
62
|
*
|
|
58
63
|
* **Keyboard.** The plot is one tab stop.
|
|
59
64
|
*
|
|
@@ -74,17 +79,19 @@ declare const HelixHeadlessLineChart_base: typeof HelixElement & (new (...args:
|
|
|
74
79
|
* @documentation https://fusion.dev/helix/components/line-chart
|
|
75
80
|
*
|
|
76
81
|
* @slot empty - Content shown in place of the drawing when the table has no readings, such as a link to add the first. Falls back to `empty-text`.
|
|
82
|
+
* @slot error - Content shown after `error-text` while it is set and there are no readings, such as a button that tries again.
|
|
77
83
|
* @slot loading - Content shown in place of the drawing while `loading` is set and there are no readings yet. Falls back to `loading-text`.
|
|
78
84
|
*
|
|
79
85
|
* @event {HelixReadingChangeEvent} helix-reading-change - The reading shown moved, or was put away: `index` is the row, or `-1` for none, with its `label`, the `series` the keys rest on, and the `pointerType` that moved it.
|
|
80
86
|
* @event {HelixReadingPressEvent} helix-reading-press - A reading was clicked, tapped, or pressed with Enter or Space, with the same detail as `helix-reading-change`.
|
|
81
87
|
*
|
|
82
88
|
* @csspart area - The wash under one line, where `area` is set.
|
|
83
|
-
* @csspart axis - The numbers of the scale beside the plot,
|
|
89
|
+
* @csspart axis - The numbers of the scale beside the plot, unless `value-axis` is `none`.
|
|
84
90
|
* @csspart band - The band around the reading under the pointer.
|
|
85
91
|
* @csspart baseline - The rule at zero, where zero is inside the range.
|
|
86
92
|
* @csspart empty - The words in place of the drawing when the table has no readings: the `empty` slot, falling back to `empty-text`. Not drawn while the table cannot be read yet, on the server and during hydration.
|
|
87
|
-
* @csspart
|
|
93
|
+
* @csspart error - The words in place of the drawing while `error-text` is set and there are no readings, followed by the `error` slot. Announced as it appears.
|
|
94
|
+
* @csspart gridline - One rule across the plot, unless `gridlines` is `none`.
|
|
88
95
|
* @csspart guide - A rule down the reading a pointer is resting on.
|
|
89
96
|
* @csspart label - One reading's name, placed along the row by `--chart-label-start` and `--chart-label-size` with its text centered. Only the names that fit are drawn, the first and the last always.
|
|
90
97
|
* @csspart labels - The row of reading names, which the names share: lay it out as one grid cell they all stand in.
|
|
@@ -129,6 +136,7 @@ declare const HelixHeadlessLineChart_base: typeof HelixElement & (new (...args:
|
|
|
129
136
|
*
|
|
130
137
|
* @cssstate active - While a reading is shown, under the pointer or the keys, with its tooltip open.
|
|
131
138
|
* @cssstate empty - While the `empty` part stands in the plot.
|
|
139
|
+
* @cssstate error - While the `error` part stands in the plot.
|
|
132
140
|
* @cssstate loading - While the `loading` part stands in the plot.
|
|
133
141
|
*/
|
|
134
142
|
export declare class HelixHeadlessLineChart extends HelixHeadlessLineChart_base {
|
|
@@ -193,9 +201,10 @@ export declare class HelixHeadlessLineChart extends HelixHeadlessLineChart_base
|
|
|
193
201
|
/**
|
|
194
202
|
* Which rules are drawn across the plot, if any.
|
|
195
203
|
*
|
|
196
|
-
* Absent
|
|
197
|
-
*
|
|
198
|
-
*
|
|
204
|
+
* Absent rules the levels, as `value` does, which are the levels the `axis`
|
|
205
|
+
* part numbers: a reading is measured against the rule beside it. `none`
|
|
206
|
+
* draws no rules, for a chart in a card or beside a figure that is read as a
|
|
207
|
+
* shape.
|
|
199
208
|
*
|
|
200
209
|
* `value` rules the axis the readings are *measured* on, at the levels
|
|
201
210
|
* `ticks` picks, which are round numbers anchored to the number line rather
|
|
@@ -204,17 +213,15 @@ export declare class HelixHeadlessLineChart extends HelixHeadlessLineChart_base
|
|
|
204
213
|
* through each reading whose name is drawn, which is what lets a point be
|
|
205
214
|
* traced down to its label across a wide chart. `both` draws both.
|
|
206
215
|
*
|
|
207
|
-
* **A bare `gridlines` means `value`**, and so does anything unrecognized
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
* all: an unrecognized value that draws no rules is indistinguishable from
|
|
211
|
-
* the attribute being absent, which is the one thing a reader cannot debug.
|
|
216
|
+
* **A bare `gridlines` means `value`**, and so does anything unrecognized,
|
|
217
|
+
* so a typo draws the rules the chart rests with. Only `none` takes them
|
|
218
|
+
* away, which is a word nobody types by accident.
|
|
212
219
|
*
|
|
213
220
|
* Furniture rather than data, so the rules are inside the `aria-hidden` plot
|
|
214
221
|
* and reach no reader through the table.
|
|
215
222
|
*/
|
|
216
|
-
gridlines?: 'both' | 'category' | 'value';
|
|
217
|
-
/** Whether the levels are ruled, which is every value but `category`. */
|
|
223
|
+
gridlines?: 'both' | 'category' | 'none' | 'value';
|
|
224
|
+
/** Whether the levels are ruled, which is every value but `category` and `none`. */
|
|
218
225
|
protected get rulesValue(): boolean;
|
|
219
226
|
/** Whether each reading is ruled, which only two values ask for. */
|
|
220
227
|
protected get rulesCategory(): boolean;
|
|
@@ -262,14 +269,19 @@ export declare class HelixHeadlessLineChart extends HelixHeadlessLineChart_base
|
|
|
262
269
|
*/
|
|
263
270
|
terminus?: 'none' | 'ring' | 'square' | 'triangle';
|
|
264
271
|
/**
|
|
265
|
-
*
|
|
266
|
-
* `gridlines` rules, so a reading can be measured off the drawing as well
|
|
267
|
-
* as read from the tooltip.
|
|
272
|
+
* Whether the scale's numbers are drawn beside the plot, the `axis` part.
|
|
268
273
|
*
|
|
269
|
-
* Absent draws
|
|
270
|
-
*
|
|
274
|
+
* Absent draws them, at the levels `gridlines` rules, so a reading can be
|
|
275
|
+
* measured off the drawing as well as read from the tooltip. `none` draws no
|
|
276
|
+
* axis, for a line read for its shape, where the tooltip and the table hold
|
|
277
|
+
* every reading.
|
|
278
|
+
*
|
|
279
|
+
* Reflected, because the stylesheet gives the axis a column of its own unless
|
|
280
|
+
* this is `none`, and undefaulted, so a host carries only what you wrote.
|
|
271
281
|
*/
|
|
272
|
-
valueAxis
|
|
282
|
+
valueAxis?: 'none';
|
|
283
|
+
/** Whether the axis is drawn, which is every value but `none`. */
|
|
284
|
+
protected get drawsAxis(): boolean;
|
|
273
285
|
/** The domain last worked out, held while the series, the hidden ones and `zero` are the same. */
|
|
274
286
|
private ranged;
|
|
275
287
|
/** The domain every series is drawn against, which the tooltip also needs. */
|
|
@@ -324,7 +336,7 @@ export declare class HelixHeadlessLineChart extends HelixHeadlessLineChart_base
|
|
|
324
336
|
private ends;
|
|
325
337
|
protected render(): TemplateResult;
|
|
326
338
|
/**
|
|
327
|
-
* The scale's numbers beside the plot,
|
|
339
|
+
* The scale's numbers beside the plot, unless `value-axis` is `none`, written in the
|
|
328
340
|
* chart's locale. A seam, so a subclass can write the numbers its own way,
|
|
329
341
|
* such as a currency.
|
|
330
342
|
*/
|
|
@@ -417,12 +429,13 @@ export declare class HelixHeadlessLineChart extends HelixHeadlessLineChart_base
|
|
|
417
429
|
/** Whether `dashed` names this series, matched as a heading is. */
|
|
418
430
|
private dashes;
|
|
419
431
|
/**
|
|
420
|
-
* One series
|
|
432
|
+
* One series' wash or its line. The chart draws every wash and then every
|
|
433
|
+
* line, so a line is drawn over its own fill and over every other series'.
|
|
421
434
|
*
|
|
422
435
|
* Each reading sits at its own row, and the line breaks where a row has no
|
|
423
436
|
* reading: a line drawn across a blank claims a value nobody measured.
|
|
424
437
|
*/
|
|
425
|
-
protected renderSeries(one: Series, depth: number, x: (value: number) => number, y: (value: number) => number): TemplateResult;
|
|
438
|
+
protected renderSeries(one: Series, depth: number, x: (value: number) => number, y: (value: number) => number, piece: 'area' | 'line'): TemplateResult;
|
|
426
439
|
/**
|
|
427
440
|
* The reading names, as HTML beside the drawing rather than inside it.
|
|
428
441
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { byRow, CategoryAxisController, CHART_PLOT, columnPoints, commaList, customElement, drawTooltip, drawValueAxis, formatNumbers, HelixElement, HelixReadingChangeEvent, HelixReadingPressEvent, linear, linePath, MIRROR_RULE, MixinChartSource, MixinChartStatus, PLOT_HEIGHT, PLOT_WIDTH, seriesIndex, seriesKey, ticks, unbroken, wordsLocale, } from '@fusion.dev/helix-core';
|
|
2
|
+
import { byRow, CategoryAxisController, CHART_PLOT, columnPoints, commaList, customElement, drawTooltip, drawValueAxis, formatNumbers, HelixElement, HelixReadingChangeEvent, HelixReadingPressEvent, headroom, linear, linePath, MIRROR_RULE, MixinChartSource, MixinChartStatus, PLOT_HEIGHT, PLOT_WIDTH, seriesIndex, seriesKey, ticks, unbroken, wordsLocale, } from '@fusion.dev/helix-core';
|
|
3
3
|
import { html, nothing, svg } from 'lit';
|
|
4
4
|
import { property } from 'lit/decorators.js';
|
|
5
5
|
import '../../tooltip/index.js';
|
|
@@ -10,7 +10,6 @@ let HelixHeadlessLineChart = class HelixHeadlessLineChart extends MixinChartStat
|
|
|
10
10
|
this.area = false;
|
|
11
11
|
this.dashed = '';
|
|
12
12
|
this.markers = false;
|
|
13
|
-
this.valueAxis = false;
|
|
14
13
|
this.drawn = new WeakMap();
|
|
15
14
|
this.unbrokens = new WeakMap();
|
|
16
15
|
this.slots = new WeakMap();
|
|
@@ -26,13 +25,16 @@ let HelixHeadlessLineChart = class HelixHeadlessLineChart extends MixinChartStat
|
|
|
26
25
|
: new HelixReadingChangeEvent(detail));
|
|
27
26
|
}
|
|
28
27
|
get rulesValue() {
|
|
29
|
-
return this.gridlines !==
|
|
28
|
+
return this.gridlines !== 'category' && this.gridlines !== 'none';
|
|
30
29
|
}
|
|
31
30
|
get rulesCategory() {
|
|
32
31
|
return this.gridlines === 'both' || this.gridlines === 'category';
|
|
33
32
|
}
|
|
33
|
+
get drawsAxis() {
|
|
34
|
+
return this.valueAxis !== 'none';
|
|
35
|
+
}
|
|
34
36
|
range(series) {
|
|
35
|
-
const key = `${this.zero} ${series.map((one) => (this.showsSeries(one.name) ? 1 : 0)).join('')}`;
|
|
37
|
+
const key = `${this.zero} ${this.drawsAxis || this.rulesValue} ${series.map((one) => (this.showsSeries(one.name) ? 1 : 0)).join('')}`;
|
|
36
38
|
if (this.ranged?.series === series && this.ranged.key === key) {
|
|
37
39
|
return this.ranged.domain;
|
|
38
40
|
}
|
|
@@ -48,9 +50,10 @@ let HelixHeadlessLineChart = class HelixHeadlessLineChart extends MixinChartStat
|
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
52
|
const [floor, top] = low <= high ? [low, high] : [0, 0];
|
|
51
|
-
const
|
|
53
|
+
const extent = this.zero
|
|
52
54
|
? [Math.min(0, floor), Math.max(0, top)]
|
|
53
55
|
: [floor, top];
|
|
56
|
+
const domain = this.drawsAxis || this.rulesValue ? headroom(extent) : extent;
|
|
54
57
|
this.ranged = { domain, key, series };
|
|
55
58
|
return domain;
|
|
56
59
|
}
|
|
@@ -127,7 +130,7 @@ let HelixHeadlessLineChart = class HelixHeadlessLineChart extends MixinChartStat
|
|
|
127
130
|
}
|
|
128
131
|
const domain = this.range(series);
|
|
129
132
|
const { x, y } = this.scalesOf(domain, readings.length);
|
|
130
|
-
return html `${this.
|
|
133
|
+
return html `${this.drawsAxis ? this.renderAxis(y, domain) : nothing}${this.renderPlot(series, x, y, domain)} ${this.renderLabels(readings)}${this.renderSummary(series)}${this.renderSonify()}${this.renderTable()}`;
|
|
131
134
|
}
|
|
132
135
|
renderAxis(y, domain) {
|
|
133
136
|
return drawValueAxis(domain, (value) => (y(value) / PLOT_HEIGHT) * 100, formatNumbers(wordsLocale(this)), (widest) => `--line-chart-axis: ${widest}ch`);
|
|
@@ -182,7 +185,8 @@ let HelixHeadlessLineChart = class HelixHeadlessLineChart extends MixinChartStat
|
|
|
182
185
|
: svg `<line part="baseline" x1="0" x2=${PLOT_WIDTH} y1=${floor} y2=${floor} />`}
|
|
183
186
|
${this.renderBand(this.readings)}
|
|
184
187
|
${this.renderGuide(x)}
|
|
185
|
-
${series.map((one, depth) => this.renderSeries(one, depth, x, y))}
|
|
188
|
+
${series.map((one, depth) => this.renderSeries(one, depth, x, y, 'area')).reverse()}
|
|
189
|
+
${series.map((one, depth) => this.renderSeries(one, depth, x, y, 'line'))}
|
|
186
190
|
${this.renderMarkers(series, x, y)}
|
|
187
191
|
</svg>
|
|
188
192
|
${this.renderTermini(ends)}
|
|
@@ -190,7 +194,7 @@ let HelixHeadlessLineChart = class HelixHeadlessLineChart extends MixinChartStat
|
|
|
190
194
|
</div>`;
|
|
191
195
|
}
|
|
192
196
|
renderGridlines(x, y, domain, count) {
|
|
193
|
-
if (this.
|
|
197
|
+
if (!this.rulesValue && !this.rulesCategory) {
|
|
194
198
|
return nothing;
|
|
195
199
|
}
|
|
196
200
|
const down = this.rulesCategory
|
|
@@ -289,7 +293,7 @@ let HelixHeadlessLineChart = class HelixHeadlessLineChart extends MixinChartStat
|
|
|
289
293
|
const key = seriesKey(name);
|
|
290
294
|
return this.dashed !== '' && commaList(this.dashed).some((one) => seriesKey(one) === key);
|
|
291
295
|
}
|
|
292
|
-
renderSeries(one, depth, x, y) {
|
|
296
|
+
renderSeries(one, depth, x, y, piece) {
|
|
293
297
|
if (!this.showsSeries(one.name)) {
|
|
294
298
|
return html `${nothing}`;
|
|
295
299
|
}
|
|
@@ -306,14 +310,17 @@ let HelixHeadlessLineChart = class HelixHeadlessLineChart extends MixinChartStat
|
|
|
306
310
|
return `${run.path}L${last[0]},${PLOT_HEIGHT}L${first[0]},${PLOT_HEIGHT}Z`;
|
|
307
311
|
})
|
|
308
312
|
.join('');
|
|
309
|
-
|
|
310
|
-
|
|
313
|
+
if (piece === 'area') {
|
|
314
|
+
return this.area
|
|
315
|
+
? svg `<path
|
|
311
316
|
d=${wash}
|
|
312
317
|
data-series=${index}
|
|
313
318
|
part="area"
|
|
314
319
|
style="--chart-series: var(--chart-series-${index})"
|
|
315
320
|
/>`
|
|
316
|
-
|
|
321
|
+
: html `${nothing}`;
|
|
322
|
+
}
|
|
323
|
+
return svg `<path
|
|
317
324
|
d=${path}
|
|
318
325
|
data-series=${index}
|
|
319
326
|
fill="none"
|
|
@@ -369,7 +376,7 @@ __decorate([
|
|
|
369
376
|
property({ reflect: true })
|
|
370
377
|
], HelixHeadlessLineChart.prototype, "terminus", void 0);
|
|
371
378
|
__decorate([
|
|
372
|
-
property({ attribute: 'value-axis', reflect: true
|
|
379
|
+
property({ attribute: 'value-axis', reflect: true })
|
|
373
380
|
], HelixHeadlessLineChart.prototype, "valueAxis", void 0);
|
|
374
381
|
__decorate([
|
|
375
382
|
property({ reflect: true, type: Boolean })
|
|
@@ -81,7 +81,8 @@ export declare class HelixHeadlessListItem extends HelixElement {
|
|
|
81
81
|
* Takes the row out of reach in a list with `selection-mode`: the arrow keys
|
|
82
82
|
* pass over it and it cannot be selected or acted on. In a list with
|
|
83
83
|
* `disabled-behavior="selection"`, it cannot be selected and is reached and
|
|
84
|
-
* acted on as any row is.
|
|
84
|
+
* acted on as any row is. Anywhere else, a disabled row with `href` does
|
|
85
|
+
* not follow its link.
|
|
85
86
|
*/
|
|
86
87
|
disabled: boolean;
|
|
87
88
|
/**
|
|
@@ -91,6 +91,7 @@ let HelixHeadlessListItem = class HelixHeadlessListItem extends HelixElement {
|
|
|
91
91
|
const tabindex = this.grouped ? (this.focusable ? '0' : '-1') : nothing;
|
|
92
92
|
const labelledby = this.grouped && this.words !== '' ? 'label' : nothing;
|
|
93
93
|
const describedby = this.grouped && this.described ? 'description' : nothing;
|
|
94
|
+
const off = this.disabled && !this.selectionOnly;
|
|
94
95
|
return this.href === ''
|
|
95
96
|
? html `<div
|
|
96
97
|
part="row${this.current === undefined ? '' : ' row-current'}"
|
|
@@ -111,7 +112,9 @@ let HelixHeadlessListItem = class HelixHeadlessListItem extends HelixElement {
|
|
|
111
112
|
@blur=${this.handleCellFocus}
|
|
112
113
|
><a
|
|
113
114
|
part="link"
|
|
114
|
-
href=${this.href}
|
|
115
|
+
href=${off ? nothing : this.href}
|
|
116
|
+
role=${off ? 'link' : nothing}
|
|
117
|
+
aria-disabled=${off ? 'true' : nothing}
|
|
115
118
|
target=${this.target || nothing}
|
|
116
119
|
rel=${this.rel || nothing}
|
|
117
120
|
aria-current=${this.current ?? nothing}
|