@fusion.dev/helix-headless 0.241.3 → 0.242.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/chat/composer/chat-composer.d.ts +8 -1
- package/dist/chat/composer/chat-composer.js +15 -1
- package/dist/chat/message/chat-message.d.ts +12 -0
- package/dist/chat/message/chat-message.js +8 -0
- package/dist/chat/root/chat-root.d.ts +9 -0
- package/dist/chat/root/chat-root.js +13 -1
- package/dist/code-editor/root/code-editor-root.d.ts +1 -0
- package/dist/code-editor/root/code-editor-root.js +1 -1
- package/dist/column-manager/root/column-manager-root.d.ts +30 -2
- package/dist/column-manager/root/column-manager-root.js +73 -9
- package/dist/combobox/root/combobox-root.d.ts +8 -1
- package/dist/combobox/root/combobox-root.js +19 -2
- package/dist/data-table/root/data-table-root.d.ts +34 -6
- package/dist/data-table/root/data-table-root.js +42 -7
- package/dist/date-input/root/date-input-root.d.ts +8 -1
- package/dist/date-input/root/date-input-root.js +19 -2
- package/dist/date-picker/root/date-picker-root.d.ts +5 -0
- package/dist/date-picker/root/date-picker-root.js +3 -0
- package/dist/editor/root/editor-root.d.ts +1 -0
- package/dist/editor/root/editor-root.js +1 -1
- package/dist/element-events.generated.js +2 -0
- package/dist/file-input/root/file-input-root.d.ts +8 -1
- package/dist/file-input/root/file-input-root.js +19 -2
- package/dist/filter-input/root/filter-input-root.d.ts +8 -1
- package/dist/filter-input/root/filter-input-root.js +13 -1
- package/dist/find/root/find-root.d.ts +1 -0
- package/dist/find/root/find-root.js +4 -4
- package/dist/hover-card/index.d.ts +1 -0
- package/dist/hover-card/index.js +1 -0
- package/dist/hover-card/root/hover-card-root.d.ts +122 -0
- package/dist/hover-card/root/hover-card-root.js +185 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/line-chart/root/line-chart-root.d.ts +7 -1
- package/dist/line-chart/root/line-chart-root.js +6 -0
- package/dist/list/root/list-root.d.ts +12 -1
- package/dist/list/root/list-root.js +11 -1
- package/dist/log/line/log-line.d.ts +11 -0
- package/dist/log/line/log-line.js +8 -0
- package/dist/log/root/log-root.d.ts +9 -0
- package/dist/log/root/log-root.js +13 -1
- package/dist/meter/root/meter-root.d.ts +12 -1
- package/dist/meter/root/meter-root.js +31 -2
- package/dist/navigation/root/navigation-root.d.ts +5 -1
- package/dist/navigation/root/navigation-root.js +13 -1
- package/dist/notifications/root/notifications-root.d.ts +10 -1
- package/dist/notifications/root/notifications-root.js +12 -1
- package/dist/object-inspector/root/object-inspector-root.js +6 -6
- package/dist/pagination/root/pagination-root.d.ts +16 -1
- package/dist/pagination/root/pagination-root.js +19 -1
- package/dist/popover/root/popover-root.d.ts +6 -0
- package/dist/popover/root/popover-root.js +2 -0
- package/dist/progress/root/progress-root.d.ts +11 -1
- package/dist/progress/root/progress-root.js +29 -2
- package/dist/sparkline/root/sparkline-root.d.ts +3 -1
- package/dist/sparkline/root/sparkline-root.js +8 -1
- package/dist/stat/root/stat-root.d.ts +22 -1
- package/dist/stat/root/stat-root.js +27 -4
- package/dist/table/root/table-root.d.ts +22 -5
- package/dist/table/root/table-root.js +13 -1
- package/dist/tabs/root/tabs-root.d.ts +6 -1
- package/dist/tabs/root/tabs-root.js +12 -1
- package/dist/tag/group/tag-group.d.ts +13 -1
- package/dist/tag/group/tag-group.js +12 -1
- package/dist/terminal/root/terminal-root.d.ts +1 -0
- package/dist/terminal/root/terminal-root.js +1 -1
- package/dist/theme-toggle/index.d.ts +1 -0
- package/dist/theme-toggle/index.js +1 -0
- package/dist/theme-toggle/root/theme-toggle-root.d.ts +98 -0
- package/dist/theme-toggle/root/theme-toggle-root.js +68 -0
- package/dist/time-input/root/time-input-root.d.ts +8 -1
- package/dist/time-input/root/time-input-root.js +19 -2
- package/dist/timeline/root/timeline-root.d.ts +10 -1
- package/dist/timeline/root/timeline-root.js +11 -1
- package/dist/toggle/group/toggle-group.d.ts +5 -1
- package/dist/toggle/group/toggle-group.js +12 -2
- package/dist/tree/root/tree-root.d.ts +13 -1
- package/dist/tree/root/tree-root.js +11 -1
- package/dist/trend/root/trend-root.d.ts +14 -1
- package/dist/trend/root/trend-root.js +20 -2
- package/examples.json +1 -1
- package/lint.json +1 -1
- package/package.json +5 -5
- package/types/jsx.d.ts +425 -10
- package/types/svelte.d.ts +2 -0
- package/types/vue.d.ts +249 -8
- package/types/words.d.ts +8 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HelixFormElement } from '@fusion.dev/helix-core';
|
|
1
|
+
import { HelixFormElement, LayoutMotionController } from '@fusion.dev/helix-core';
|
|
2
2
|
import { nothing, type PropertyValues, type TemplateResult } from 'lit';
|
|
3
3
|
import '../../tooltip/index.js';
|
|
4
4
|
/**
|
|
@@ -439,6 +439,13 @@ export declare class HelixHeadlessChatComposer extends HelixHeadlessChatComposer
|
|
|
439
439
|
* draws, and a picture of a key is not turned round with the text.
|
|
440
440
|
*/
|
|
441
441
|
protected renderSend(): TemplateResult;
|
|
442
|
+
/**
|
|
443
|
+
* Sliding what the draft carries to their new places as they come and go: one arriving
|
|
444
|
+
* fades in, one leaving fades where it was, and the rest close up. Timed by
|
|
445
|
+
* `--chat-composer-move-duration` and `--chat-composer-move-easing`, which this tier never
|
|
446
|
+
* sets, so it moves nothing until a stylesheet does.
|
|
447
|
+
*/
|
|
448
|
+
protected readonly motion: LayoutMotionController;
|
|
442
449
|
/**
|
|
443
450
|
* What the draft carries, the field, and a row of tools under it.
|
|
444
451
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { customElement, DelayController, deepActiveElement, HelixFormElement, hostAria, internalsOf, MixinVoice, markRegion, motionPaused, numberConverter, onMotionChange, pressedOwnControl, reducedMotion, SPOKEN_RULE, timeConverter, words, } from '@fusion.dev/helix-core';
|
|
2
|
+
import { customElement, DelayController, deepActiveElement, HelixFormElement, hostAria, internalsOf, LayoutMotionController, MixinVoice, markRegion, motionPaused, numberConverter, onMotionChange, pressedOwnControl, reducedMotion, SPOKEN_RULE, timeConverter, words, } from '@fusion.dev/helix-core';
|
|
3
3
|
import { arrowElbowDownLeft, stop } from '@fusion.dev/helix-icons';
|
|
4
4
|
import { html, nothing } from 'lit';
|
|
5
5
|
import { property, state } from 'lit/decorators.js';
|
|
@@ -70,6 +70,20 @@ let HelixHeadlessChatComposer = class HelixHeadlessChatComposer extends MixinVoi
|
|
|
70
70
|
this.focused = event.type === 'focus';
|
|
71
71
|
this.turnExamples();
|
|
72
72
|
};
|
|
73
|
+
this.motion = new LayoutMotionController(this, {
|
|
74
|
+
arriveIntoEmpty: true,
|
|
75
|
+
items: () => (this.renderRoot
|
|
76
|
+
?.querySelector('slot[name="attachments"]')
|
|
77
|
+
?.assignedElements() ?? []).filter((one) => one instanceof HTMLElement),
|
|
78
|
+
leaving: () => this.partNamed('attachments'),
|
|
79
|
+
timing: () => {
|
|
80
|
+
const style = getComputedStyle(this);
|
|
81
|
+
return {
|
|
82
|
+
duration: style.getPropertyValue('--chat-composer-move-duration'),
|
|
83
|
+
easing: style.getPropertyValue('--chat-composer-move-easing'),
|
|
84
|
+
};
|
|
85
|
+
},
|
|
86
|
+
});
|
|
73
87
|
this.handleInput = (event) => {
|
|
74
88
|
event.stopPropagation();
|
|
75
89
|
this.value = event.target.value;
|
|
@@ -68,8 +68,20 @@ export declare const FAILED_LABEL = "Not sent";
|
|
|
68
68
|
* @csspart state - The text that names the turn's state, when there is one to show.
|
|
69
69
|
* @csspart time - The turn's time.
|
|
70
70
|
* @csspart work - The box around the `work` slot, above the content.
|
|
71
|
+
*
|
|
72
|
+
* @cssstate arriving - The message was added at the end of a conversation already drawn.
|
|
71
73
|
*/
|
|
72
74
|
export declare class HelixHeadlessChatMessage extends HelixElement {
|
|
75
|
+
/**
|
|
76
|
+
* **Arriving, where it joins the end of a conversation already drawn**:
|
|
77
|
+
* `:state(arriving)`, which a stylesheet can bring it in by. Not where it
|
|
78
|
+
* was there as the conversation first drew, which is what the page came with, not
|
|
79
|
+
* history loaded above, and not inside a conversation that draws its turns from
|
|
80
|
+
* data, which marks its own.
|
|
81
|
+
*/
|
|
82
|
+
connectedCallback(): void;
|
|
83
|
+
/** Whether it joined one already drawn, as `:state(arriving)` says, for the tier above to bring it in by. */
|
|
84
|
+
protected arriving: boolean;
|
|
73
85
|
/**
|
|
74
86
|
* The key this part's words are registered under, its styled tag:
|
|
75
87
|
* `registerWords('de', { 'helix-chat-message': { retryLabel: 'Erneut versuchen' } })`.
|
|
@@ -9,6 +9,7 @@ export const FAILED_LABEL = 'Not sent';
|
|
|
9
9
|
let HelixHeadlessChatMessage = class HelixHeadlessChatMessage extends HelixElement {
|
|
10
10
|
constructor() {
|
|
11
11
|
super(...arguments);
|
|
12
|
+
this.arriving = false;
|
|
12
13
|
this.at = '';
|
|
13
14
|
this.authorLabel = '';
|
|
14
15
|
this.failedLabel = 'Not sent';
|
|
@@ -47,6 +48,13 @@ let HelixHeadlessChatMessage = class HelixHeadlessChatMessage extends HelixEleme
|
|
|
47
48
|
});
|
|
48
49
|
};
|
|
49
50
|
}
|
|
51
|
+
connectedCallback() {
|
|
52
|
+
super.connectedCallback();
|
|
53
|
+
const parent = this.parentElement;
|
|
54
|
+
const later = (one) => one !== null && (one.localName === this.localName || later(one.nextElementSibling));
|
|
55
|
+
this.arriving = parent?.hasUpdated === true && !later(this.nextElementSibling);
|
|
56
|
+
this.toggleState('arriving', this.arriving);
|
|
57
|
+
}
|
|
50
58
|
static { this.words = 'helix-chat-message'; }
|
|
51
59
|
get moment() {
|
|
52
60
|
if (this.at === '') {
|
|
@@ -710,6 +710,15 @@ export declare class HelixHeadlessChat extends HelixHeadlessChat_base {
|
|
|
710
710
|
* different outline.
|
|
711
711
|
*/
|
|
712
712
|
protected renderPlaceholder(): TemplateResult;
|
|
713
|
+
/** The last turn's key and how many turns there were, at the last render, to tell a turn arriving from history loading. */
|
|
714
|
+
private lastTurn;
|
|
715
|
+
/**
|
|
716
|
+
* From which turn on the turns are new at the end of the conversation this
|
|
717
|
+
* render, or none: a turn added after the last one, not history loaded
|
|
718
|
+
* above it and not a turn scrolled back into view. Those take
|
|
719
|
+
* `data-arriving` for this render, which a stylesheet can bring in by.
|
|
720
|
+
*/
|
|
721
|
+
private arrivingFrom;
|
|
713
722
|
/** The turns fed as data, a window of them, between the room the rest would take. */
|
|
714
723
|
private renderTurns;
|
|
715
724
|
/**
|
|
@@ -710,11 +710,23 @@ let HelixHeadlessChat = class HelixHeadlessChat extends MixinCollection(HelixEle
|
|
|
710
710
|
</div>
|
|
711
711
|
</div>`;
|
|
712
712
|
}
|
|
713
|
+
arrivingFrom() {
|
|
714
|
+
const turns = this.turns;
|
|
715
|
+
const keyOf = (at) => turns[at]?.key ?? at;
|
|
716
|
+
const was = this.lastTurn;
|
|
717
|
+
this.lastTurn =
|
|
718
|
+
turns.length > 0 ? { count: turns.length, key: keyOf(turns.length - 1) } : undefined;
|
|
719
|
+
if (!this.hasUpdated || was === undefined || turns.length <= was.count) {
|
|
720
|
+
return Number.POSITIVE_INFINITY;
|
|
721
|
+
}
|
|
722
|
+
return keyOf(was.count - 1) === was.key ? was.count : Number.POSITIVE_INFINITY;
|
|
723
|
+
}
|
|
713
724
|
renderTurns() {
|
|
714
725
|
const { after, before, first, last } = this.virtualize.window;
|
|
715
726
|
const message = this.tag('chat-message');
|
|
727
|
+
const arriving = this.arrivingFrom();
|
|
716
728
|
return html `<div part="before" role="presentation" style="block-size: ${before}px; flex: none"></div>
|
|
717
|
-
${repeat(this.turns.slice(first, last), (turn, offset) => turn.key ?? first + offset, (turn, offset) => html `<div part="turn" data-index=${first + offset}>
|
|
729
|
+
${repeat(this.turns.slice(first, last), (turn, offset) => turn.key ?? first + offset, (turn, offset) => html `<div part="turn" data-index=${first + offset} ?data-arriving=${first + offset >= arriving}>
|
|
718
730
|
<${message}
|
|
719
731
|
exportparts="actions: message-actions, attachments: message-attachments, avatar: message-avatar, body: message-body,
|
|
720
732
|
content: message-content, indicator: message-indicator, mark: message-mark, message,
|
|
@@ -193,6 +193,7 @@ declare const HelixHeadlessCodeEditor_base: (new (...args: any[]) => import("@fu
|
|
|
193
193
|
* @csspart find-replace-toggle - The button that shows the replace field under the find field. Expanded while it shows. Not drawn while `readonly`.
|
|
194
194
|
* @csspart find-replace-toggle-button - The find and replace button's inner button.
|
|
195
195
|
* @csspart find-replace-toggle-live - The find and replace button's live region, which speaks while the button is pending.
|
|
196
|
+
* @csspart find-replace-toggle-mark - The caret on the find bar's replace toggle, which points down while the replace row shows and along the line while it is shut.
|
|
196
197
|
* @csspart find-replace-toggle-spinner - The ring the find and replace button turns while it is pending.
|
|
197
198
|
* @csspart find-replace-toggle-text - The box the find and replace button's icon sits in.
|
|
198
199
|
* @csspart find-toggle - The button in the header that opens and closes the find bar. Expanded while it is open.
|
|
@@ -362,7 +362,7 @@ let HelixHeadlessCodeEditor = class HelixHeadlessCodeEditor extends MixinControl
|
|
|
362
362
|
const find = this.tag('find');
|
|
363
363
|
return html `<${find}
|
|
364
364
|
part="find"
|
|
365
|
-
exportparts="actions: find-actions, bar: find-bar, close: find-close, close-button: find-close-button, close-live: find-close-live, close-spinner: find-close-spinner, close-text: find-close-text, controls: find-controls, controls-toolbar: find-controls-toolbar, count: find-count, field: find-field, live: find-live, match-case: find-match-case, match-case-button: find-match-case-button, match-case-live: find-match-case-live, match-case-pressed: find-match-case-pressed, match-case-spinner: find-match-case-spinner, match-case-text: find-match-case-text, next: find-next, next-button: find-next-button, next-live: find-next-live, next-spinner: find-next-spinner, next-text: find-next-text, previous: find-previous, previous-button: find-previous-button, previous-live: find-previous-live, previous-spinner: find-previous-spinner, previous-text: find-previous-text, regex: find-regex, regex-button: find-regex-button, regex-live: find-regex-live, regex-pressed: find-regex-pressed, regex-spinner: find-regex-spinner, regex-text: find-regex-text, replace: find-replace, replace-all: find-replace-all, replace-all-button: find-replace-all-button, replace-all-live: find-replace-all-live, replace-all-spinner: find-replace-all-spinner, replace-all-text: find-replace-all-text, replace-button: find-replace-button, replace-field: find-replace-field, replace-live: find-replace-live, replace-spinner: find-replace-spinner, replace-text: find-replace-text, replace-toggle: find-replace-toggle, replace-toggle-button: find-replace-toggle-button, replace-toggle-live: find-replace-toggle-live, replace-toggle-spinner: find-replace-toggle-spinner, replace-toggle-text: find-replace-toggle-text, whole-word: find-whole-word, whole-word-button: find-whole-word-button, whole-word-live: find-whole-word-live, whole-word-pressed: find-whole-word-pressed, whole-word-spinner: find-whole-word-spinner, whole-word-text: find-whole-word-text"
|
|
365
|
+
exportparts="actions: find-actions, bar: find-bar, close: find-close, close-button: find-close-button, close-live: find-close-live, close-spinner: find-close-spinner, close-text: find-close-text, controls: find-controls, controls-toolbar: find-controls-toolbar, count: find-count, field: find-field, live: find-live, match-case: find-match-case, match-case-button: find-match-case-button, match-case-live: find-match-case-live, match-case-pressed: find-match-case-pressed, match-case-spinner: find-match-case-spinner, match-case-text: find-match-case-text, next: find-next, next-button: find-next-button, next-live: find-next-live, next-spinner: find-next-spinner, next-text: find-next-text, previous: find-previous, previous-button: find-previous-button, previous-live: find-previous-live, previous-spinner: find-previous-spinner, previous-text: find-previous-text, regex: find-regex, regex-button: find-regex-button, regex-live: find-regex-live, regex-pressed: find-regex-pressed, regex-spinner: find-regex-spinner, regex-text: find-regex-text, replace: find-replace, replace-all: find-replace-all, replace-all-button: find-replace-all-button, replace-all-live: find-replace-all-live, replace-all-spinner: find-replace-all-spinner, replace-all-text: find-replace-all-text, replace-button: find-replace-button, replace-field: find-replace-field, replace-live: find-replace-live, replace-spinner: find-replace-spinner, replace-text: find-replace-text, replace-toggle: find-replace-toggle, replace-toggle-button: find-replace-toggle-button, replace-toggle-live: find-replace-toggle-live, replace-toggle-mark: find-replace-toggle-mark, replace-toggle-spinner: find-replace-toggle-spinner, replace-toggle-text: find-replace-toggle-text, whole-word: find-whole-word, whole-word-button: find-whole-word-button, whole-word-live: find-whole-word-live, whole-word-pressed: find-whole-word-pressed, whole-word-spinner: find-whole-word-spinner, whole-word-text: find-whole-word-text"
|
|
366
366
|
close-label=${this.findCloseLabel}
|
|
367
367
|
controls-label=${this.findControlsLabel}
|
|
368
368
|
invalid-label=${this.findInvalidLabel}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HelixElement } from '@fusion.dev/helix-core';
|
|
1
|
+
import { HelixElement, LayoutMotionController } from '@fusion.dev/helix-core';
|
|
2
2
|
import { type TemplateResult } from 'lit';
|
|
3
3
|
import { TableBinding, type ToolColumn, type ToolTable } from '../../data-table/binding.js';
|
|
4
4
|
import '../../checkbox/index.js';
|
|
@@ -17,7 +17,8 @@ import '../../checkbox/index.js';
|
|
|
17
17
|
* Each row has:
|
|
18
18
|
*
|
|
19
19
|
* - A checkbox that shows or hides the column. The last column showing cannot be hidden.
|
|
20
|
-
* - A grip that moves the column. Drag it, or press Alt with Up or Down.
|
|
20
|
+
* - A grip that moves the column. Drag it, or press Alt with Up or Down. While
|
|
21
|
+
* a row is dragged, a line marks the gap it will land in.
|
|
21
22
|
* - A pin button that pins the column to the start of the row, then to the end, then unpins it.
|
|
22
23
|
* A pinned column stays in view while the table scrolls sideways.
|
|
23
24
|
* - A note that says "Pinned", or "Hidden at this width" for a column the table leaves out
|
|
@@ -58,6 +59,7 @@ import '../../checkbox/index.js';
|
|
|
58
59
|
* @csspart checkbox-mark-checked - Added to `checkbox-mark` while the column shows.
|
|
59
60
|
* @csspart checkbox-mark-dash - Forwarded from the checkbox. Not shown, since a column is shown or hidden.
|
|
60
61
|
* @csspart checkbox-mark-indeterminate - Forwarded from the checkbox. Not shown, since a column is shown or hidden.
|
|
62
|
+
* @csspart drop - The line that marks where a dragged row will land. It carries `data-at` while it marks a gap, and that gap's place down the element as `--_column-manager-drop-y`. Hidden until a stylesheet shows it, so the headless tier lays out as it did without it.
|
|
61
63
|
* @csspart grip - The button that moves a column.
|
|
62
64
|
* @csspart grip-mark - The icon on the grip.
|
|
63
65
|
* @csspart header - The row above the list that holds the title and the reset button.
|
|
@@ -116,9 +118,23 @@ export declare class HelixHeadlessColumnManager extends HelixElement {
|
|
|
116
118
|
private said;
|
|
117
119
|
/** The field being dragged, while a pointer drags one. */
|
|
118
120
|
private dragging;
|
|
121
|
+
/**
|
|
122
|
+
* The gap a dragged row would land in, as its place among the rows, `0`
|
|
123
|
+
* before the first, and how far down the list the middle of that gap is.
|
|
124
|
+
* Absent where dropping would move nothing.
|
|
125
|
+
*/
|
|
126
|
+
private dropGap;
|
|
119
127
|
/** The columns as the list first read them, which Reset puts back. */
|
|
120
128
|
private first;
|
|
121
129
|
protected readonly binding: TableBinding;
|
|
130
|
+
/**
|
|
131
|
+
* Sliding each column's row to its new place as the order changes, by a
|
|
132
|
+
* drop, by Alt with an arrow, by a pin, or by Reset, so the reader sees
|
|
133
|
+
* where a column went rather than the list redrawn in a new order. Timed by
|
|
134
|
+
* `--column-manager-move-duration` and `--column-manager-move-easing`,
|
|
135
|
+
* which this tier never sets, so it moves nothing until a stylesheet does.
|
|
136
|
+
*/
|
|
137
|
+
protected readonly motion: LayoutMotionController;
|
|
122
138
|
/** The bound table, once it is in the tree. */
|
|
123
139
|
get table(): ToolTable | null;
|
|
124
140
|
/** The columns with a field, in the order the table shows them. */
|
|
@@ -136,8 +152,20 @@ export declare class HelixHeadlessColumnManager extends HelixElement {
|
|
|
136
152
|
protected willUpdate(): void;
|
|
137
153
|
private readonly handleKey;
|
|
138
154
|
private readonly handleDragStart;
|
|
155
|
+
/**
|
|
156
|
+
* **The gap under the pointer**: before the row it is over in that row's
|
|
157
|
+
* upper half, after it in the lower half. Measured from the element's top,
|
|
158
|
+
* which the line is placed against, beside the list so the list holds only
|
|
159
|
+
* the columns.
|
|
160
|
+
*/
|
|
139
161
|
private readonly handleDragOver;
|
|
162
|
+
/** Over the list between two rows, the line holds where it was. */
|
|
163
|
+
private readonly handleListOver;
|
|
164
|
+
/** Out of the list, the line goes, and a drop there moves nothing. */
|
|
165
|
+
private readonly handleListLeave;
|
|
166
|
+
/** Moves the dragged row into the gap the line marks. */
|
|
140
167
|
private readonly handleDrop;
|
|
168
|
+
private readonly handleDragEnd;
|
|
141
169
|
protected renderItem(table: ToolTable, column: ToolColumn, onlyShown: boolean): TemplateResult;
|
|
142
170
|
protected render(): TemplateResult;
|
|
143
171
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { customElement, formatWords, HelixElement, words, } from '@fusion.dev/helix-core';
|
|
2
|
+
import { customElement, formatWords, HelixElement, LayoutMotionController, words, } from '@fusion.dev/helix-core';
|
|
3
3
|
import { dotsSixVertical, pushPin, pushPinSlash } from '@fusion.dev/helix-icons';
|
|
4
4
|
import { nothing } from 'lit';
|
|
5
5
|
import { property, state } from 'lit/decorators.js';
|
|
@@ -25,8 +25,20 @@ let HelixHeadlessColumnManager = class HelixHeadlessColumnManager extends HelixE
|
|
|
25
25
|
this.unpinLabel = 'Unpin {name}';
|
|
26
26
|
this.said = '';
|
|
27
27
|
this.dragging = undefined;
|
|
28
|
+
this.dropGap = undefined;
|
|
28
29
|
this.first = undefined;
|
|
29
30
|
this.binding = new TableBinding(this);
|
|
31
|
+
this.motion = new LayoutMotionController(this, {
|
|
32
|
+
items: () => [...(this.renderRoot?.querySelectorAll('[part~="item"]') ?? [])],
|
|
33
|
+
timing: () => {
|
|
34
|
+
const style = getComputedStyle(this);
|
|
35
|
+
return {
|
|
36
|
+
duration: style.getPropertyValue('--column-manager-move-duration'),
|
|
37
|
+
easing: style.getPropertyValue('--column-manager-move-easing'),
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
watch: 'updates',
|
|
41
|
+
});
|
|
30
42
|
this.handleKey = (event, field) => {
|
|
31
43
|
if (!event.altKey || (event.key !== 'ArrowUp' && event.key !== 'ArrowDown')) {
|
|
32
44
|
return;
|
|
@@ -48,21 +60,58 @@ let HelixHeadlessColumnManager = class HelixHeadlessColumnManager extends HelixE
|
|
|
48
60
|
event.dataTransfer.effectAllowed = 'move';
|
|
49
61
|
}
|
|
50
62
|
};
|
|
51
|
-
this.handleDragOver = (event) => {
|
|
63
|
+
this.handleDragOver = (event, field) => {
|
|
64
|
+
const table = this.table;
|
|
65
|
+
if (this.dragging === undefined || !table) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
event.preventDefault();
|
|
69
|
+
const row = event.currentTarget;
|
|
70
|
+
const list = this.partNamed('list');
|
|
71
|
+
const box = row.getBoundingClientRect();
|
|
72
|
+
const after = event.clientY > box.top + box.height / 2;
|
|
73
|
+
const fields = this.columns(table).map((column) => column.field);
|
|
74
|
+
const at = fields.indexOf(field) + (after ? 1 : 0);
|
|
75
|
+
const from = fields.indexOf(this.dragging);
|
|
76
|
+
if (at === from || at === from + 1 || !list) {
|
|
77
|
+
this.dropGap = undefined;
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const half = (Number.parseFloat(getComputedStyle(list).rowGap) || 0) / 2;
|
|
81
|
+
const y = (after ? box.bottom + half : box.top - half) - this.getBoundingClientRect().top;
|
|
82
|
+
if (this.dropGap?.at !== at || this.dropGap.y !== y) {
|
|
83
|
+
this.dropGap = { at, y };
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
this.handleListOver = (event) => {
|
|
52
87
|
if (this.dragging !== undefined) {
|
|
53
88
|
event.preventDefault();
|
|
54
89
|
}
|
|
55
90
|
};
|
|
56
|
-
this.
|
|
91
|
+
this.handleListLeave = (event) => {
|
|
92
|
+
const list = event.currentTarget;
|
|
93
|
+
if (!list.contains(event.relatedTarget)) {
|
|
94
|
+
this.dropGap = undefined;
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
this.handleDrop = (event) => {
|
|
57
98
|
const table = this.table;
|
|
58
99
|
const moving = this.dragging;
|
|
100
|
+
const gap = this.dropGap;
|
|
59
101
|
this.dragging = undefined;
|
|
60
|
-
|
|
102
|
+
this.dropGap = undefined;
|
|
103
|
+
if (!table || moving === undefined || gap === undefined) {
|
|
61
104
|
return;
|
|
62
105
|
}
|
|
63
106
|
event.preventDefault();
|
|
64
107
|
const fields = this.columns(table).map((column) => column.field);
|
|
65
|
-
|
|
108
|
+
const from = fields.indexOf(moving);
|
|
109
|
+
const to = gap.at > from ? gap.at - 1 : gap.at;
|
|
110
|
+
this.moveColumn(moving, to - from);
|
|
111
|
+
};
|
|
112
|
+
this.handleDragEnd = () => {
|
|
113
|
+
this.dragging = undefined;
|
|
114
|
+
this.dropGap = undefined;
|
|
66
115
|
};
|
|
67
116
|
}
|
|
68
117
|
static { this.words = 'helix-column-manager'; }
|
|
@@ -160,9 +209,8 @@ let HelixHeadlessColumnManager = class HelixHeadlessColumnManager extends HelixE
|
|
|
160
209
|
data-field=${field}
|
|
161
210
|
draggable="true"
|
|
162
211
|
@dragstart=${(event) => this.handleDragStart(event, field)}
|
|
163
|
-
@dragend=${
|
|
164
|
-
@dragover=${this.handleDragOver}
|
|
165
|
-
@drop=${(event) => this.handleDrop(event, field)}
|
|
212
|
+
@dragend=${this.handleDragEnd}
|
|
213
|
+
@dragover=${(event) => this.handleDragOver(event, field)}
|
|
166
214
|
@keydown=${(event) => this.handleKey(event, field)}
|
|
167
215
|
>
|
|
168
216
|
<button part="grip" type="button" aria-label=${formatWords(this, 'moveLabel', { name })}
|
|
@@ -199,11 +247,24 @@ let HelixHeadlessColumnManager = class HelixHeadlessColumnManager extends HelixE
|
|
|
199
247
|
<span part="title" id="title">${this.label || this.fallbackLabel}</span>
|
|
200
248
|
<button part="reset" type="button" @click=${() => this.reset()}>${this.resetLabel}</button>
|
|
201
249
|
</div>
|
|
202
|
-
<ul
|
|
250
|
+
<ul
|
|
251
|
+
part="list"
|
|
252
|
+
aria-labelledby="title"
|
|
253
|
+
@dragover=${this.handleListOver}
|
|
254
|
+
@dragleave=${this.handleListLeave}
|
|
255
|
+
@drop=${this.handleDrop}
|
|
256
|
+
>
|
|
203
257
|
${table
|
|
204
258
|
? repeat(columns, (column) => column.field, (column) => this.renderItem(table, column, shownCount <= 1))
|
|
205
259
|
: nothing}
|
|
206
260
|
</ul>
|
|
261
|
+
<span
|
|
262
|
+
part="drop"
|
|
263
|
+
aria-hidden="true"
|
|
264
|
+
hidden
|
|
265
|
+
data-at=${this.dropGap?.at ?? nothing}
|
|
266
|
+
style=${this.dropGap ? `--_column-manager-drop-y: ${this.dropGap.y}px` : nothing}
|
|
267
|
+
></span>
|
|
207
268
|
<span part="live" aria-live="polite">${this.said}</span>`;
|
|
208
269
|
}
|
|
209
270
|
};
|
|
@@ -255,6 +316,9 @@ __decorate([
|
|
|
255
316
|
__decorate([
|
|
256
317
|
state()
|
|
257
318
|
], HelixHeadlessColumnManager.prototype, "dragging", void 0);
|
|
319
|
+
__decorate([
|
|
320
|
+
state()
|
|
321
|
+
], HelixHeadlessColumnManager.prototype, "dropGap", void 0);
|
|
258
322
|
HelixHeadlessColumnManager = __decorate([
|
|
259
323
|
customElement('helix-headless-column-manager')
|
|
260
324
|
], HelixHeadlessColumnManager);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AriaForwardController, HelixFormElement, ListedController, PopoverController, UpgradeController } from '@fusion.dev/helix-core';
|
|
1
|
+
import { AriaForwardController, HelixFormElement, LayoutMotionController, ListedController, PopoverController, UpgradeController } from '@fusion.dev/helix-core';
|
|
2
2
|
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
3
|
import '../../listbox/index.js';
|
|
4
4
|
import '../../tag/root/index.js';
|
|
@@ -153,6 +153,13 @@ export declare class HelixHeadlessCombobox extends HelixHeadlessCombobox_base {
|
|
|
153
153
|
* `registerWords('de', { 'helix-combobox': { noResultsText: 'Keine Treffer' } })`.
|
|
154
154
|
*/
|
|
155
155
|
static words: string;
|
|
156
|
+
/**
|
|
157
|
+
* Sliding the tags to their new places as they come and go: one arriving
|
|
158
|
+
* fades in, one leaving fades where it was, and the rest close up. Timed by
|
|
159
|
+
* `--combobox-move-duration` and `--combobox-move-easing`, which this tier never
|
|
160
|
+
* sets, so it moves nothing until a stylesheet does.
|
|
161
|
+
*/
|
|
162
|
+
protected readonly motion: LayoutMotionController;
|
|
156
163
|
protected readonly aria: AriaForwardController;
|
|
157
164
|
/** The region VoiceOver hears the highlight, the count and a choice from. */
|
|
158
165
|
private readonly status;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { AriaForwardController, afterLinkFollowed, auditChildren, chosenValues, countLabel, customElement, DelayController, drawAutofill, drawStatus, formatWords, HelixBeforeFilterEvent, HelixFilterEvent, HelixFormElement, handedLocale, internalsOf, ListedController, MixinControllerOpen, MixinControllerValue, MixinField, MixinTokens, onApple, PopoverController, reportValues, StatusController, submitImplicitly, timeConverter, UpgradeController, words, wordsLocale, } from '@fusion.dev/helix-core';
|
|
2
|
+
import { AriaForwardController, afterLinkFollowed, auditChildren, chosenValues, countLabel, customElement, DelayController, drawAutofill, drawStatus, formatWords, HelixBeforeFilterEvent, HelixFilterEvent, HelixFormElement, handedLocale, internalsOf, LayoutMotionController, ListedController, MixinControllerOpen, MixinControllerValue, MixinField, MixinTokens, onApple, PopoverController, reportValues, StatusController, submitImplicitly, timeConverter, UpgradeController, words, wordsLocale, } from '@fusion.dev/helix-core';
|
|
3
3
|
import { caretDown } from '@fusion.dev/helix-icons';
|
|
4
4
|
import { nothing } from 'lit';
|
|
5
5
|
import { property, state } from 'lit/decorators.js';
|
|
6
|
+
import { repeat } from 'lit/directives/repeat.js';
|
|
6
7
|
import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
|
|
7
8
|
import { html } from 'lit/static-html.js';
|
|
8
9
|
import { optionsAmong } from '../../option/among.js';
|
|
@@ -15,6 +16,22 @@ let HelixHeadlessCombobox = class HelixHeadlessCombobox extends MixinControllerO
|
|
|
15
16
|
constructor() {
|
|
16
17
|
super(...arguments);
|
|
17
18
|
this.listed = new ListedController(this, 'focus', () => internalsOf(this)?.ariaKeyShortcuts);
|
|
19
|
+
this.motion = new LayoutMotionController(this, {
|
|
20
|
+
arriveIntoEmpty: true,
|
|
21
|
+
items: () => [
|
|
22
|
+
...(this.renderRoot?.querySelectorAll('[part~="tag"]:not([data-leaving])') ??
|
|
23
|
+
[]),
|
|
24
|
+
],
|
|
25
|
+
leaving: () => this.partNamed('field'),
|
|
26
|
+
timing: () => {
|
|
27
|
+
const style = getComputedStyle(this);
|
|
28
|
+
return {
|
|
29
|
+
duration: style.getPropertyValue('--combobox-move-duration'),
|
|
30
|
+
easing: style.getPropertyValue('--combobox-move-easing'),
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
watch: 'updates',
|
|
34
|
+
});
|
|
18
35
|
this.aria = new AriaForwardController(this, {
|
|
19
36
|
target: () => this.partNamed('control'),
|
|
20
37
|
});
|
|
@@ -663,7 +680,7 @@ let HelixHeadlessCombobox = class HelixHeadlessCombobox extends MixinControllerO
|
|
|
663
680
|
<div part="field" @click=${this.handleFieldClick}>
|
|
664
681
|
<slot name="start"></slot>
|
|
665
682
|
${this.multiple && this.chosen.length > 0
|
|
666
|
-
? this.renderTokenRow(this.shown.
|
|
683
|
+
? this.renderTokenRow(repeat(this.shown, (option) => option.value, (option) => this.renderTag(option)), this.restCount)
|
|
667
684
|
: nothing}
|
|
668
685
|
<input
|
|
669
686
|
part="control"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type DataRow, HelixElement } from '@fusion.dev/helix-core';
|
|
1
|
+
import { type DataRow, HelixElement, LayoutMotionController } from '@fusion.dev/helix-core';
|
|
2
2
|
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
3
|
import type { HelixHeadlessTableColumn } from '../../table/column/table-column.js';
|
|
4
4
|
import '../../checkbox/index.js';
|
|
@@ -180,6 +180,16 @@ declare const HelixHeadlessDataTable_base: (new (...args: any[]) => import("@fus
|
|
|
180
180
|
* nothing while a `sort` is set, since the sort decides the order, and a tree
|
|
181
181
|
* grid draws none.
|
|
182
182
|
*
|
|
183
|
+
* **Rows slide to their places.** When the table sorts, or `rows` changes,
|
|
184
|
+
* each row it keeps moves from where it was drawn to where it is now, its
|
|
185
|
+
* cells together, and a row it adds fades in. Set `row-key` so a row is known
|
|
186
|
+
* across the change. The table times it from `--data-table-move-duration` and
|
|
187
|
+
* `--data-table-move-easing`, which the styled tier sets from the duration and
|
|
188
|
+
* easing tokens. Here neither is set, so nothing moves until you set them.
|
|
189
|
+
* Under reduced motion nothing moves, whatever they say. A `windowed` table
|
|
190
|
+
* draws only the rows in view, so a sort that brings in other rows fades them
|
|
191
|
+
* in where they land.
|
|
192
|
+
*
|
|
183
193
|
* **Editable cells.** `editable` on a column lets a reader edit its cells,
|
|
184
194
|
* and `rowEditable` decides row by row. The column's `type` picks the field:
|
|
185
195
|
* text, a number, a date, or a select of an enum's values, and a boolean
|
|
@@ -355,6 +365,7 @@ declare const HelixHeadlessDataTable_base: (new (...args: any[]) => import("@fus
|
|
|
355
365
|
* @csspart pagination - The built-in pagination, when it is shown.
|
|
356
366
|
* @csspart pagination-first - The pagination's button that goes to the first page, shown with `ends`.
|
|
357
367
|
* @csspart pagination-gap - The pagination's marker for pages that are not shown.
|
|
368
|
+
* @csspart pagination-indicator - The pagination's mark that moves to the page you are on.
|
|
358
369
|
* @csspart pagination-item - One item in the pagination's list, holding a page or a gap.
|
|
359
370
|
* @csspart pagination-last - The pagination's button that goes to the last page, shown with `ends`.
|
|
360
371
|
* @csspart pagination-list - The pagination's list of pages.
|
|
@@ -385,6 +396,8 @@ declare const HelixHeadlessDataTable_base: (new (...args: any[]) => import("@fus
|
|
|
385
396
|
* @cssproperty --data-table-cell-align - The alignment of the cell's column: `start`, `center`, or `end`. Unset when the column sets none. The component writes it on each cell it draws, and the stylesheet reads it. `Table` sets `--table-cell-align` for the same purpose.
|
|
386
397
|
* @cssproperty --data-table-cell-block-align - Where a cell's content sits from top to bottom in a row taller than it: `start`, `center` or `end`. `center` by default. Set it on the table, or on a row through `::part(row)`; a column's `vertical-align` writes it on each of that column's cells, and wins.
|
|
387
398
|
* @cssproperty --data-table-level - How deep a row is in a tree grid, from 1. The component writes it on each row header cell, and the stylesheet indents by it.
|
|
399
|
+
* @cssproperty --data-table-move-duration - How long a row takes to slide to its new place, or to fade in. Unset, nothing moves.
|
|
400
|
+
* @cssproperty --data-table-move-easing - The curve a row slides and fades in along.
|
|
388
401
|
* @cssproperty --data-table-pin-offset - How far a pinned column's cell stays from its end of the row, in pixels: the width of the pinned columns before it. The component writes it on each cell of a pinned column, and the stylesheet reads it.
|
|
389
402
|
* @cssproperty --data-table-template - The column track list, worked out from the columns. The component writes it inline on the element that reads it, so setting it has no effect. Set a column's `width` to change it.
|
|
390
403
|
*
|
|
@@ -675,8 +688,9 @@ export declare class HelixHeadlessDataTable extends HelixHeadlessDataTable_base
|
|
|
675
688
|
/**
|
|
676
689
|
* Lets users reorder the columns.
|
|
677
690
|
*
|
|
678
|
-
* Each heading with a `field` gets a grip,
|
|
679
|
-
*
|
|
691
|
+
* Each heading with a `field` gets a grip, moved a place at a time with the
|
|
692
|
+
* arrow keys once it has focus. A pointer drags the grip or the heading
|
|
693
|
+
* itself along the header, and a press that does not travel still sorts.
|
|
680
694
|
*/
|
|
681
695
|
reorderable: boolean;
|
|
682
696
|
/**
|
|
@@ -915,9 +929,9 @@ export declare class HelixHeadlessDataTable extends HelixHeadlessDataTable_base
|
|
|
915
929
|
/** The grid's size as the last render counted it, for the internals. */
|
|
916
930
|
private counts;
|
|
917
931
|
/**
|
|
918
|
-
* A column dragged by its grip. The headings follow the
|
|
919
|
-
* order is asked for once it lets go, so a consumer hears
|
|
920
|
-
* the dozen a drag passes through. The arrow keys on a grip move a column a
|
|
932
|
+
* A column dragged by its grip or its heading. The headings follow the
|
|
933
|
+
* pointer and the order is asked for once it lets go, so a consumer hears
|
|
934
|
+
* one order and not the dozen a drag passes through. The arrow keys on a grip move a column a
|
|
921
935
|
* place each, which `handleGripKey` does, so this only drags.
|
|
922
936
|
*/
|
|
923
937
|
private readonly columnMoves;
|
|
@@ -934,6 +948,20 @@ export declare class HelixHeadlessDataTable extends HelixHeadlessDataTable_base
|
|
|
934
948
|
private lineOf;
|
|
935
949
|
/** Said once, so a table that re-renders does not repeat it. */
|
|
936
950
|
private warnedAboutKey;
|
|
951
|
+
/**
|
|
952
|
+
* Sliding each row it keeps to its new place when the table sorts or `rows`
|
|
953
|
+
* changes. Looked for after each update, because the table draws its rows,
|
|
954
|
+
* and in the box that scrolls them.
|
|
955
|
+
*/
|
|
956
|
+
protected readonly motion: LayoutMotionController;
|
|
957
|
+
/**
|
|
958
|
+
* Sliding each column to its new place when it moves, by its menu, its keys
|
|
959
|
+
* or its grip, the cells under it with it, and fading in a column shown
|
|
960
|
+
* again. Measured by the heading, which is the page's element and keeps who
|
|
961
|
+
* it is across the move; the cells are drawn again in their new places, so
|
|
962
|
+
* the ones under the heading after the move are the ones that slide.
|
|
963
|
+
*/
|
|
964
|
+
protected readonly columnMotion: LayoutMotionController;
|
|
937
965
|
private readonly virtualize;
|
|
938
966
|
/**
|
|
939
967
|
* The rows in the shadow tree, each with the row of the page it drew.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var HelixHeadlessDataTable_1;
|
|
2
2
|
import { __decorate } from "tslib";
|
|
3
|
-
import { anchorAt, arranged, assignSlot, auditChildren, auditServed, commaList, countLabel, customElement, cycle, deepActiveElement, deepContains, everyState, format, formatWords, gridMove, HelixBeforeFilterEvent, HelixBeforeNavigateEvent, HelixBeforeReorderEvent, HelixBeforeSelectEvent, HelixBeforeSortEvent, HelixElement, HelixExpandEvent, HelixFilterEvent, HelixLoadMoreEvent, HelixNavigateEvent, HelixReorderEvent, HelixSelectEvent, HelixSortEvent, handedLocale, hostAria, inlineStep, inRowOrder, internalsOf,
|
|
4
|
-
import { caretDown,
|
|
3
|
+
import { anchorAt, arranged, assignSlot, auditChildren, auditServed, commaList, countLabel, customElement, cycle, deepActiveElement, deepContains, everyState, format, formatWords, gridMove, HelixBeforeFilterEvent, HelixBeforeNavigateEvent, HelixBeforeReorderEvent, HelixBeforeSelectEvent, HelixBeforeSortEvent, HelixElement, HelixExpandEvent, HelixFilterEvent, HelixLoadMoreEvent, HelixNavigateEvent, HelixReorderEvent, HelixSelectEvent, HelixSortEvent, handedLocale, hostAria, inlineStep, inRowOrder, internalsOf, LayoutMotionController, MixinCollection, markMatches, markRegion, numberConverter, onAndroid, ordered, pageRows, parse, placeKey, ReorderController, rangeAdd, reportRuntime, requestChange, requestReorder, SCROLLER_RULE, SHUT_RULE, scrollingAncestor, scrollRoom, selectsAll, Typeahead, toggleEvery, treeArrow, typesCharacter, VIRTUAL_RULE, VirtualizeController, valueAt, whenHydrated, window_, words, wordsLocale, writtenList, } from '@fusion.dev/helix-core';
|
|
4
|
+
import { caretDown, dotsSixVertical } from '@fusion.dev/helix-icons';
|
|
5
5
|
import { nothing } from 'lit';
|
|
6
6
|
import { property, state } from 'lit/decorators.js';
|
|
7
7
|
import { live } from 'lit/directives/live.js';
|
|
@@ -145,7 +145,12 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
|
|
|
145
145
|
},
|
|
146
146
|
enabled: () => this.reorderable,
|
|
147
147
|
grip: (event) => {
|
|
148
|
-
const
|
|
148
|
+
const own = event
|
|
149
|
+
.composedPath()
|
|
150
|
+
.some((node) => node instanceof Element && /^(menu|resizer)/.test(node.getAttribute('part') ?? ''));
|
|
151
|
+
const column = this.partIn(event, 'grip') || (this.partIn(event, 'column') && !own)
|
|
152
|
+
? this.columnFrom(event)
|
|
153
|
+
: undefined;
|
|
149
154
|
return column?.field ? { element: column, key: column.field } : undefined;
|
|
150
155
|
},
|
|
151
156
|
holds: false,
|
|
@@ -183,6 +188,37 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
|
|
|
183
188
|
},
|
|
184
189
|
});
|
|
185
190
|
this.warnedAboutKey = false;
|
|
191
|
+
this.motion = new LayoutMotionController(this, {
|
|
192
|
+
items: () => [...(this.renderRoot?.querySelectorAll('[part~="row"]') ?? [])],
|
|
193
|
+
scroller: () => this.renderRoot?.querySelector('[part="table"]'),
|
|
194
|
+
timing: () => {
|
|
195
|
+
const style = getComputedStyle(this);
|
|
196
|
+
return {
|
|
197
|
+
duration: style.getPropertyValue('--data-table-move-duration'),
|
|
198
|
+
easing: style.getPropertyValue('--data-table-move-easing'),
|
|
199
|
+
};
|
|
200
|
+
},
|
|
201
|
+
watch: 'updates',
|
|
202
|
+
});
|
|
203
|
+
this.columnMotion = new LayoutMotionController(this, {
|
|
204
|
+
boxes: (heading) => {
|
|
205
|
+
const at = this.shownColumns.indexOf(heading) + this.lead;
|
|
206
|
+
return [
|
|
207
|
+
heading,
|
|
208
|
+
...(this.renderRoot?.querySelectorAll(`[part~="row"] > [data-column="${at}"]`) ?? []),
|
|
209
|
+
];
|
|
210
|
+
},
|
|
211
|
+
items: () => this.shownColumns,
|
|
212
|
+
scroller: () => this.renderRoot?.querySelector('[part="table"]'),
|
|
213
|
+
timing: () => {
|
|
214
|
+
const style = getComputedStyle(this);
|
|
215
|
+
return {
|
|
216
|
+
duration: style.getPropertyValue('--data-table-move-duration'),
|
|
217
|
+
easing: style.getPropertyValue('--data-table-move-easing'),
|
|
218
|
+
};
|
|
219
|
+
},
|
|
220
|
+
watch: 'updates',
|
|
221
|
+
});
|
|
186
222
|
this.virtualize = new VirtualizeController(this, {
|
|
187
223
|
container: () => (this.windowed ? this.partNamed('table') : null),
|
|
188
224
|
count: () => this.available,
|
|
@@ -539,7 +575,7 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
|
|
|
539
575
|
};
|
|
540
576
|
}
|
|
541
577
|
static { HelixHeadlessDataTable_1 = this; }
|
|
542
|
-
static { this.markRules = [SCROLLER_RULE, VIRTUAL_RULE,
|
|
578
|
+
static { this.markRules = [SCROLLER_RULE, VIRTUAL_RULE, SHUT_RULE]; }
|
|
543
579
|
static { this.shadowRootOptions = {
|
|
544
580
|
...HelixElement.shadowRootOptions,
|
|
545
581
|
slotAssignment: 'manual',
|
|
@@ -2126,12 +2162,11 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
|
|
|
2126
2162
|
});
|
|
2127
2163
|
}
|
|
2128
2164
|
renderToggle(row, open) {
|
|
2129
|
-
const glyph = open ? caretDown : caretRight;
|
|
2130
2165
|
return html `<span
|
|
2131
2166
|
part="toggle${open ? ' toggle-open' : ''}"
|
|
2132
2167
|
aria-hidden="true"
|
|
2133
2168
|
@click=${() => this.toggleOpen(row, !open)}
|
|
2134
|
-
><svg part="toggle-mark" ?data-
|
|
2169
|
+
><svg part="toggle-mark" ?data-shut=${!open} fill="currentColor" viewBox=${caretDown.viewBox}>${unsafeSVG(caretDown.content)}</svg></span>`;
|
|
2135
2170
|
}
|
|
2136
2171
|
toggleOpen(row, open) {
|
|
2137
2172
|
const next = toggledOpen(this.expanded, this.rowKeyOf(row, -1), open, this.everyKey);
|
|
@@ -2333,7 +2368,7 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
|
|
|
2333
2368
|
${this.paginated
|
|
2334
2369
|
? html `<${pagination}
|
|
2335
2370
|
part="pagination"
|
|
2336
|
-
exportparts="first: pagination-first, gap: pagination-gap, item: pagination-item,
|
|
2371
|
+
exportparts="first: pagination-first, gap: pagination-gap, indicator: pagination-indicator, item: pagination-item,
|
|
2337
2372
|
last: pagination-last, list: pagination-list, live: pagination-live,
|
|
2338
2373
|
mark: pagination-mark, next: pagination-next, page: pagination-page,
|
|
2339
2374
|
page-current: pagination-page-current, previous: pagination-previous,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AriaForwardController, type DateCalendar, HelixFormElement, type MonthCalendar, type MonthSystem } from '@fusion.dev/helix-core';
|
|
1
|
+
import { AriaForwardController, type DateCalendar, HelixFormElement, LayoutMotionController, type MonthCalendar, type MonthSystem } from '@fusion.dev/helix-core';
|
|
2
2
|
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
3
|
import '../../date-picker/index.js';
|
|
4
4
|
import '../../tag/root/index.js';
|
|
@@ -151,6 +151,13 @@ export declare class HelixHeadlessDateInput extends HelixHeadlessDateInput_base
|
|
|
151
151
|
* `registerWords('de', { 'helix-date-input': { triggerLabel: 'Datum auswählen' } })`.
|
|
152
152
|
*/
|
|
153
153
|
static words: string;
|
|
154
|
+
/**
|
|
155
|
+
* Sliding the dates chosen to their new places as they come and go: one arriving
|
|
156
|
+
* fades in, one leaving fades where it was, and the rest close up. Timed by
|
|
157
|
+
* `--date-input-move-duration` and `--date-input-move-easing`, which this tier never
|
|
158
|
+
* sets, so it moves nothing until a stylesheet does.
|
|
159
|
+
*/
|
|
160
|
+
protected readonly motion: LayoutMotionController;
|
|
154
161
|
protected readonly aria: AriaForwardController;
|
|
155
162
|
/**
|
|
156
163
|
* What the browser may autofill here, as one of the platform's own tokens,
|