@fusion.dev/helix-headless 0.148.0 → 0.149.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/custom-elements.json +6966 -1798
- package/dist/announcement/root/announcement-root.d.ts +5 -0
- package/dist/announcement/root/announcement-root.js +5 -2
- package/dist/area-chart/root/area-chart-root.d.ts +11 -0
- package/dist/area-chart/root/area-chart-root.js +20 -7
- package/dist/avatar/group/avatar-group.d.ts +10 -2
- package/dist/avatar/group/avatar-group.js +10 -5
- package/dist/badge/count.d.ts +6 -1
- package/dist/badge/count.js +3 -3
- package/dist/badge/root/badge-root.d.ts +6 -2
- package/dist/badge/root/badge-root.js +3 -3
- package/dist/bar-chart/root/bar-chart-root.d.ts +13 -1
- package/dist/bar-chart/root/bar-chart-root.js +17 -4
- package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +8 -1
- package/dist/breadcrumbs/root/breadcrumbs-root.js +5 -2
- package/dist/button/root/button-root.d.ts +10 -1
- package/dist/button/root/button-root.js +3 -2
- package/dist/button-group/root/button-group-root.d.ts +3 -0
- package/dist/button-group/root/button-group-root.js +2 -2
- package/dist/callout/root/callout-root.d.ts +16 -2
- package/dist/callout/root/callout-root.js +16 -4
- package/dist/canvas/describe.d.ts +10 -0
- package/dist/canvas/describe.js +9 -0
- package/dist/canvas/neighbor.d.ts +17 -0
- package/dist/canvas/neighbor.js +1 -0
- package/dist/canvas/node/canvas-node.js +3 -2
- package/dist/canvas/root/canvas-root.d.ts +65 -8
- package/dist/canvas/root/canvas-root.js +115 -49
- package/dist/carousel/root/carousel-root.d.ts +5 -0
- package/dist/carousel/root/carousel-root.js +16 -5
- package/dist/chat/composer/chat-composer.d.ts +5 -0
- package/dist/chat/composer/chat-composer.js +4 -1
- package/dist/chat/message/chat-message.d.ts +9 -5
- package/dist/chat/message/chat-message.js +8 -4
- package/dist/chat/naming.js +2 -2
- package/dist/chat/root/chat-root.d.ts +27 -1
- package/dist/chat/root/chat-root.js +37 -9
- package/dist/checkbox/root/checkbox-root.d.ts +11 -0
- package/dist/checkbox/root/checkbox-root.js +8 -2
- package/dist/checkbox-group/root/checkbox-group-root.d.ts +11 -0
- package/dist/checkbox-group/root/checkbox-group-root.js +11 -3
- package/dist/code-block/root/code-block-root.d.ts +12 -2
- package/dist/code-block/root/code-block-root.js +12 -2
- package/dist/color-input/root/color-input-root.d.ts +13 -0
- package/dist/color-input/root/color-input-root.js +18 -5
- package/dist/color-picker/root/color-picker-root.d.ts +19 -3
- package/dist/color-picker/root/color-picker-root.js +47 -13
- package/dist/combobox/root/combobox-root.d.ts +36 -7
- package/dist/combobox/root/combobox-root.js +37 -12
- package/dist/command/root/command-root.d.ts +15 -6
- package/dist/command/root/command-root.js +9 -4
- package/dist/copy-button/root/copy-button-root.d.ts +5 -0
- package/dist/copy-button/root/copy-button-root.js +7 -2
- package/dist/data-table/root/data-table-root.d.ts +171 -29
- package/dist/data-table/root/data-table-root.js +268 -118
- package/dist/date-input/root/date-input-root.d.ts +32 -9
- package/dist/date-input/root/date-input-root.js +66 -44
- package/dist/date-picker/root/date-picker-root.d.ts +38 -15
- package/dist/date-picker/root/date-picker-root.js +52 -33
- package/dist/dialog/root/dialog-root.d.ts +12 -1
- package/dist/dialog/root/dialog-root.js +11 -4
- package/dist/donut-chart/root/donut-chart-root.d.ts +5 -0
- package/dist/donut-chart/root/donut-chart-root.js +8 -5
- package/dist/drawer/root/drawer-root.d.ts +12 -1
- package/dist/drawer/root/drawer-root.js +9 -2
- package/dist/drilldown/root/drilldown-root.d.ts +5 -0
- package/dist/drilldown/root/drilldown-root.js +4 -1
- package/dist/element-events.generated.js +25 -3
- package/dist/file-input/root/file-input-root.d.ts +18 -3
- package/dist/file-input/root/file-input-root.js +34 -17
- package/dist/filter-input/chip/filter-chip.d.ts +13 -0
- package/dist/filter-input/chip/filter-chip.js +6 -1
- package/dist/filter-input/menu/filter-menu.d.ts +5 -0
- package/dist/filter-input/menu/filter-menu.js +3 -1
- package/dist/filter-input/root/filter-input-root.d.ts +20 -3
- package/dist/filter-input/root/filter-input-root.js +8 -4
- package/dist/format-date/root/format-date-root.d.ts +20 -2
- package/dist/format-date/root/format-date-root.js +5 -2
- package/dist/graph/root/graph-model.d.ts +11 -0
- package/dist/graph/root/graph-model.js +4 -0
- package/dist/graph/root/graph-root.d.ts +78 -9
- package/dist/graph/root/graph-root.js +124 -27
- package/dist/heatmap/root/heatmap-root.d.ts +25 -4
- package/dist/heatmap/root/heatmap-root.js +27 -7
- package/dist/icon-button/root/icon-button-root.d.ts +5 -0
- package/dist/icon-button/root/icon-button-root.js +1 -0
- package/dist/input/root/input-root.d.ts +5 -0
- package/dist/input/root/input-root.js +4 -1
- package/dist/lightbox/root/lightbox-root.d.ts +14 -4
- package/dist/lightbox/root/lightbox-root.js +25 -7
- package/dist/line-chart/root/line-chart-root.d.ts +5 -0
- package/dist/line-chart/root/line-chart-root.js +4 -2
- package/dist/list/item/list-item.d.ts +32 -0
- package/dist/list/item/list-item.js +34 -7
- package/dist/list/root/list-root.d.ts +87 -0
- package/dist/list/root/list-root.js +112 -2
- package/dist/listbox/reorder/index.d.ts +1 -0
- package/dist/listbox/reorder/index.js +4 -0
- package/dist/listbox/reorder/listbox-reorder.d.ts +83 -0
- package/dist/listbox/reorder/listbox-reorder.js +151 -0
- package/dist/listbox/root/listbox-root.d.ts +68 -11
- package/dist/listbox/root/listbox-root.js +41 -9
- package/dist/loader/root/loader-root.d.ts +5 -0
- package/dist/loader/root/loader-root.js +3 -1
- package/dist/map/area/map-area.d.ts +5 -0
- package/dist/map/area/map-area.js +3 -1
- package/dist/map/buildings/map-buildings.d.ts +5 -0
- package/dist/map/buildings/map-buildings.js +3 -1
- package/dist/map/contours/map-contours.d.ts +5 -0
- package/dist/map/contours/map-contours.js +3 -1
- package/dist/map/landcover/map-landcover.d.ts +5 -0
- package/dist/map/landcover/map-landcover.js +3 -1
- package/dist/map/marker/map-marker.d.ts +16 -1
- package/dist/map/marker/map-marker.js +13 -5
- package/dist/map/points/map-points.d.ts +5 -0
- package/dist/map/points/map-points.js +6 -4
- package/dist/map/position/map-position.d.ts +5 -0
- package/dist/map/position/map-position.js +3 -1
- package/dist/map/raster/map-raster.d.ts +5 -0
- package/dist/map/raster/map-raster.js +3 -1
- package/dist/map/root/map-root.d.ts +33 -14
- package/dist/map/root/map-root.js +59 -22
- package/dist/map/route/map-route.d.ts +5 -0
- package/dist/map/route/map-route.js +3 -1
- package/dist/map/terrain/map-terrain.d.ts +5 -0
- package/dist/map/terrain/map-terrain.js +3 -1
- package/dist/menu/root/menu-root.d.ts +5 -0
- package/dist/menu/root/menu-root.js +3 -1
- package/dist/meter/root/meter-root.d.ts +16 -3
- package/dist/meter/root/meter-root.js +12 -5
- package/dist/navigation/root/navigation-root.d.ts +5 -0
- package/dist/navigation/root/navigation-root.js +3 -1
- package/dist/notifications/notification/notification.d.ts +5 -0
- package/dist/notifications/notification/notification.js +3 -1
- package/dist/notifications/root/notifications-root.d.ts +8 -0
- package/dist/notifications/root/notifications-root.js +10 -2
- package/dist/number-input/root/number-input-root.d.ts +21 -8
- package/dist/number-input/root/number-input-root.js +26 -11
- package/dist/object-inspector/root/object-inspector-root.d.ts +51 -12
- package/dist/object-inspector/root/object-inspector-root.js +21 -20
- package/dist/outline/root/outline-root.d.ts +5 -0
- package/dist/outline/root/outline-root.js +3 -1
- package/dist/pagination/root/pagination-root.d.ts +7 -1
- package/dist/pagination/root/pagination-root.js +16 -7
- package/dist/pagination/size/pagination-size.d.ts +7 -3
- package/dist/pagination/size/pagination-size.js +4 -2
- package/dist/pagination/summary/pagination-summary.d.ts +8 -6
- package/dist/pagination/summary/pagination-summary.js +4 -9
- package/dist/pin-input/code.d.ts +6 -6
- package/dist/pin-input/code.js +1 -5
- package/dist/pin-input/root/pin-input-root.d.ts +9 -3
- package/dist/pin-input/root/pin-input-root.js +6 -2
- package/dist/popover/root/popover-root.d.ts +12 -2
- package/dist/popover/root/popover-root.js +10 -4
- package/dist/progress/root/progress-root.d.ts +7 -2
- package/dist/progress/root/progress-root.js +5 -2
- package/dist/qr-code/name.d.ts +3 -2
- package/dist/qr-code/name.js +2 -2
- package/dist/qr-code/root/qr-code-root.d.ts +12 -2
- package/dist/qr-code/root/qr-code-root.js +9 -2
- package/dist/radio/group/radio-group.d.ts +11 -0
- package/dist/radio/group/radio-group.js +8 -2
- package/dist/rating/root/rating-root.d.ts +12 -1
- package/dist/rating/root/rating-root.js +10 -3
- package/dist/scatter-chart/root/scatter-chart-root.d.ts +20 -2
- package/dist/scatter-chart/root/scatter-chart-root.js +20 -5
- package/dist/select/root/select-root.d.ts +11 -0
- package/dist/select/root/select-root.js +13 -3
- package/dist/skip-link/root/skip-link-root.d.ts +5 -0
- package/dist/skip-link/root/skip-link-root.js +3 -1
- package/dist/slider/root/slider-root.d.ts +7 -2
- package/dist/slider/root/slider-root.js +11 -5
- package/dist/sparkline/readings.d.ts +15 -5
- package/dist/sparkline/readings.js +3 -3
- package/dist/sparkline/root/sparkline-root.d.ts +9 -4
- package/dist/sparkline/root/sparkline-root.js +9 -3
- package/dist/speed-dial/root/speed-dial-root.d.ts +5 -0
- package/dist/speed-dial/root/speed-dial-root.js +4 -1
- package/dist/splitter/root/splitter-root.d.ts +6 -1
- package/dist/splitter/root/splitter-root.js +9 -4
- package/dist/steps/root/steps-root.d.ts +9 -2
- package/dist/steps/root/steps-root.js +6 -3
- package/dist/steps/step/step.d.ts +12 -0
- package/dist/steps/step/step.js +11 -2
- package/dist/switch/root/switch-root.d.ts +11 -0
- package/dist/switch/root/switch-root.js +8 -2
- package/dist/table/column/table-column.d.ts +11 -4
- package/dist/table/column/table-column.js +15 -10
- package/dist/table/grid-controller.d.ts +8 -3
- package/dist/table/grid-controller.js +17 -11
- package/dist/table/root/table-root.d.ts +107 -5
- package/dist/table/root/table-root.js +122 -20
- package/dist/table/row/table-row.d.ts +42 -0
- package/dist/table/row/table-row.js +40 -1
- package/dist/tabs/root/tabs-root.d.ts +5 -0
- package/dist/tabs/root/tabs-root.js +3 -1
- package/dist/tag/group/tag-group.d.ts +5 -0
- package/dist/tag/group/tag-group.js +3 -1
- package/dist/tag/root/tag-root.d.ts +14 -1
- package/dist/tag/root/tag-root.js +11 -8
- package/dist/textarea/root/textarea-root.d.ts +5 -0
- package/dist/textarea/root/textarea-root.js +3 -1
- package/dist/time-input/root/time-input-root.d.ts +14 -7
- package/dist/time-input/root/time-input-root.js +43 -32
- package/dist/time-picker/root/time-picker-root.d.ts +15 -7
- package/dist/time-picker/root/time-picker-root.js +25 -12
- package/dist/toast/item/toast-item.d.ts +7 -0
- package/dist/toast/item/toast-item.js +1 -0
- package/dist/toast/root/toast-root.d.ts +9 -1
- package/dist/toast/root/toast-root.js +5 -4
- package/dist/toolbar/root/toolbar-root.d.ts +5 -0
- package/dist/toolbar/root/toolbar-root.js +5 -2
- package/dist/tooltip/root/tooltip-root.d.ts +27 -17
- package/dist/tour/root/tour-root.d.ts +8 -2
- package/dist/tour/root/tour-root.js +4 -2
- package/dist/tour/stop/tour-stop.d.ts +5 -0
- package/dist/tour/stop/tour-stop.js +6 -1
- package/dist/tree/grip.d.ts +5 -0
- package/dist/tree/grip.js +1 -0
- package/dist/tree/item/tree-item.d.ts +24 -0
- package/dist/tree/item/tree-item.js +27 -5
- package/dist/tree/root/tree-root.d.ts +66 -1
- package/dist/tree/root/tree-root.js +77 -5
- package/dist/trend/root/trend-root.d.ts +20 -4
- package/dist/trend/root/trend-root.js +20 -5
- package/dist/video/root/video-root.d.ts +12 -3
- package/dist/video/root/video-root.js +41 -14
- package/dist/video-playlist/menu/video-playlist-menu.d.ts +5 -0
- package/dist/video-playlist/menu/video-playlist-menu.js +3 -1
- package/dist/video-playlist/root/video-playlist-root.d.ts +5 -0
- package/dist/video-playlist/root/video-playlist-root.js +3 -1
- package/dist/virtual-list/root/virtual-list-root.d.ts +19 -3
- package/dist/virtual-list/root/virtual-list-root.js +5 -2
- package/lint.json +1 -1
- package/package.json +9 -8
- package/types/jsx.d.ts +4014 -1862
- package/types/vue.d.ts +1266 -624
- package/types/words.d.ts +3280 -0
- package/dist/toast/hotkey.d.ts +0 -22
- package/dist/toast/hotkey.js +0 -23
|
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { ChildrenController, capturePointer, customElement,
|
|
7
|
+
import { ChildrenController, capturePointer, customElement, formatWords, HelixActivateEvent, HelixElement, HelixSelectEvent, hostAria, inlineStep, isRtl, requestChange, words, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { caretLeft, caretRight, play, stop } from '@fusion.dev/helix-icons';
|
|
9
9
|
import { html, nothing } from 'lit';
|
|
10
10
|
import { property, state } from 'lit/decorators.js';
|
|
@@ -192,6 +192,7 @@ let HelixHeadlessCarousel = class HelixHeadlessCarousel extends HelixElement {
|
|
|
192
192
|
}
|
|
193
193
|
};
|
|
194
194
|
}
|
|
195
|
+
static { this.words = 'helix-carousel'; }
|
|
195
196
|
static { this.shadowRootOptions = {
|
|
196
197
|
...HelixElement.shadowRootOptions,
|
|
197
198
|
slotAssignment: 'manual',
|
|
@@ -415,7 +416,7 @@ let HelixHeadlessCarousel = class HelixHeadlessCarousel extends HelixElement {
|
|
|
415
416
|
if (changed.has('index')) {
|
|
416
417
|
this.showing = undefined;
|
|
417
418
|
if (this.hasUpdated) {
|
|
418
|
-
this.said =
|
|
419
|
+
this.said = formatWords(this, 'slideLabel', {
|
|
419
420
|
count: this.slides.length,
|
|
420
421
|
index: this.index + 1,
|
|
421
422
|
});
|
|
@@ -565,7 +566,7 @@ let HelixHeadlessCarousel = class HelixHeadlessCarousel extends HelixElement {
|
|
|
565
566
|
part="slide"
|
|
566
567
|
role="group"
|
|
567
568
|
aria-roledescription=${this.slideRoleLabel || nothing}
|
|
568
|
-
aria-label=${
|
|
569
|
+
aria-label=${formatWords(this, 'slideLabel', { count: this.slides.length, index: index + 1 })}
|
|
569
570
|
style=${this.paneStyle(index, last, stops)}
|
|
570
571
|
>
|
|
571
572
|
<slot
|
|
@@ -576,14 +577,14 @@ let HelixHeadlessCarousel = class HelixHeadlessCarousel extends HelixElement {
|
|
|
576
577
|
</div>
|
|
577
578
|
${''}<span part="live" aria-live=${rotating ? 'off' : 'polite'}>${this.said}</span>
|
|
578
579
|
${this.slides.length > 1 && this.across !== undefined
|
|
579
|
-
? html `<div part="indicators" role="group" aria-label=${
|
|
580
|
+
? html `<div part="indicators" role="group" aria-label=${formatWords(this, 'indicatorsLabel', { label: this.label })}>
|
|
580
581
|
${''}
|
|
581
582
|
${stops.map((stop, at) => {
|
|
582
583
|
const current = at === showing;
|
|
583
584
|
return html `<button
|
|
584
585
|
part="indicator${current ? ' indicator-current' : ''}"
|
|
585
586
|
type="button"
|
|
586
|
-
aria-label=${
|
|
587
|
+
aria-label=${formatWords(this, 'indicatorLabel', { index: at + 1 })}
|
|
587
588
|
aria-current=${at === place ? 'true' : nothing}
|
|
588
589
|
tabindex=${at === place ? '0' : '-1'}
|
|
589
590
|
?data-current=${current}
|
|
@@ -608,15 +609,18 @@ __decorate([
|
|
|
608
609
|
property({ type: Number })
|
|
609
610
|
], HelixHeadlessCarousel.prototype, "index", null);
|
|
610
611
|
__decorate([
|
|
612
|
+
words,
|
|
611
613
|
property({ attribute: 'indicator-label' })
|
|
612
614
|
], HelixHeadlessCarousel.prototype, "indicatorLabel", void 0);
|
|
613
615
|
__decorate([
|
|
616
|
+
words,
|
|
614
617
|
property({ attribute: 'indicators-label' })
|
|
615
618
|
], HelixHeadlessCarousel.prototype, "indicatorsLabel", void 0);
|
|
616
619
|
__decorate([
|
|
617
620
|
property({ type: Number })
|
|
618
621
|
], HelixHeadlessCarousel.prototype, "interval", void 0);
|
|
619
622
|
__decorate([
|
|
623
|
+
words,
|
|
620
624
|
property()
|
|
621
625
|
], HelixHeadlessCarousel.prototype, "label", void 0);
|
|
622
626
|
__decorate([
|
|
@@ -626,6 +630,7 @@ __decorate([
|
|
|
626
630
|
property({ attribute: 'mouse-drag', reflect: true, type: Boolean })
|
|
627
631
|
], HelixHeadlessCarousel.prototype, "mouseDrag", void 0);
|
|
628
632
|
__decorate([
|
|
633
|
+
words,
|
|
629
634
|
property({ attribute: 'next-label' })
|
|
630
635
|
], HelixHeadlessCarousel.prototype, "nextLabel", void 0);
|
|
631
636
|
__decorate([
|
|
@@ -638,24 +643,30 @@ __decorate([
|
|
|
638
643
|
property({ attribute: 'per-view', converter: COUNT_OR_AUTO, reflect: true })
|
|
639
644
|
], HelixHeadlessCarousel.prototype, "perView", void 0);
|
|
640
645
|
__decorate([
|
|
646
|
+
words,
|
|
641
647
|
property({ attribute: 'previous-label' })
|
|
642
648
|
], HelixHeadlessCarousel.prototype, "previousLabel", void 0);
|
|
643
649
|
__decorate([
|
|
650
|
+
words,
|
|
644
651
|
property({ attribute: 'role-label' })
|
|
645
652
|
], HelixHeadlessCarousel.prototype, "roleLabel", void 0);
|
|
646
653
|
__decorate([
|
|
654
|
+
words,
|
|
647
655
|
property({ attribute: 'slide-label' })
|
|
648
656
|
], HelixHeadlessCarousel.prototype, "slideLabel", void 0);
|
|
649
657
|
__decorate([
|
|
658
|
+
words,
|
|
650
659
|
property({ attribute: 'slide-role-label' })
|
|
651
660
|
], HelixHeadlessCarousel.prototype, "slideRoleLabel", void 0);
|
|
652
661
|
__decorate([
|
|
653
662
|
property({ attribute: 'slides-per-move', type: Number })
|
|
654
663
|
], HelixHeadlessCarousel.prototype, "slidesPerMove", void 0);
|
|
655
664
|
__decorate([
|
|
665
|
+
words,
|
|
656
666
|
property({ attribute: 'start-label' })
|
|
657
667
|
], HelixHeadlessCarousel.prototype, "startLabel", void 0);
|
|
658
668
|
__decorate([
|
|
669
|
+
words,
|
|
659
670
|
property({ attribute: 'stop-label' })
|
|
660
671
|
], HelixHeadlessCarousel.prototype, "stopLabel", void 0);
|
|
661
672
|
__decorate([
|
|
@@ -47,6 +47,11 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
47
47
|
* @csspart tools - The row under the field.
|
|
48
48
|
*/
|
|
49
49
|
export declare class HelixHeadlessChatComposer extends HelixFormElement {
|
|
50
|
+
/**
|
|
51
|
+
* The key this part's words are registered under, its styled tag:
|
|
52
|
+
* `registerWords('de', { 'helix-chat-composer': { sendLabel: 'Senden' } })`.
|
|
53
|
+
*/
|
|
54
|
+
static words: string;
|
|
50
55
|
/**
|
|
51
56
|
* The field's name, read by screen readers.
|
|
52
57
|
*/
|
|
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { customElement, DelayController, HelixFormElement, HelixSendEvent, HelixTypingEvent, hostAria, markRegion, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { customElement, DelayController, HelixFormElement, HelixSendEvent, HelixTypingEvent, hostAria, markRegion, words, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { arrowElbowDownLeft } from '@fusion.dev/helix-icons';
|
|
9
9
|
import { html } from 'lit';
|
|
10
10
|
import { property } from 'lit/decorators.js';
|
|
@@ -43,6 +43,7 @@ let HelixHeadlessChatComposer = class HelixHeadlessChatComposer extends HelixFor
|
|
|
43
43
|
this.send();
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
+
static { this.words = 'helix-chat-composer'; }
|
|
46
47
|
get typing() {
|
|
47
48
|
return this.writing;
|
|
48
49
|
}
|
|
@@ -136,6 +137,7 @@ let HelixHeadlessChatComposer = class HelixHeadlessChatComposer extends HelixFor
|
|
|
136
137
|
}
|
|
137
138
|
};
|
|
138
139
|
__decorate([
|
|
140
|
+
words,
|
|
139
141
|
property()
|
|
140
142
|
], HelixHeadlessChatComposer.prototype, "label", void 0);
|
|
141
143
|
__decorate([
|
|
@@ -145,6 +147,7 @@ __decorate([
|
|
|
145
147
|
property({ type: Number })
|
|
146
148
|
], HelixHeadlessChatComposer.prototype, "rows", void 0);
|
|
147
149
|
__decorate([
|
|
150
|
+
words,
|
|
148
151
|
property({ attribute: 'send-label' })
|
|
149
152
|
], HelixHeadlessChatComposer.prototype, "sendLabel", void 0);
|
|
150
153
|
__decorate([
|
|
@@ -3,8 +3,8 @@ import { nothing, type PropertyValues, type TemplateResult } from 'lit';
|
|
|
3
3
|
/**
|
|
4
4
|
* What a turn that did not send is called, where nobody said otherwise.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* @deprecated The English of `failed-label`, which is now a word property:
|
|
7
|
+
* register its words with `registerWords`. Removed in the next major version.
|
|
8
8
|
*/
|
|
9
9
|
export declare const FAILED_LABEL = "Not sent";
|
|
10
10
|
/**
|
|
@@ -55,6 +55,11 @@ export declare const FAILED_LABEL = "Not sent";
|
|
|
55
55
|
* @csspart time - The turn's time.
|
|
56
56
|
*/
|
|
57
57
|
export declare class HelixHeadlessChatMessage extends HelixElement {
|
|
58
|
+
/**
|
|
59
|
+
* The key this part's words are registered under, its styled tag:
|
|
60
|
+
* `registerWords('de', { 'helix-chat-message': { retryLabel: 'Erneut versuchen' } })`.
|
|
61
|
+
*/
|
|
62
|
+
static words: string;
|
|
58
63
|
/**
|
|
59
64
|
* The turn's time, in any format `Date` parses.
|
|
60
65
|
*/
|
|
@@ -82,9 +87,8 @@ export declare class HelixHeadlessChatMessage extends HelixElement {
|
|
|
82
87
|
*/
|
|
83
88
|
failedLabel: string;
|
|
84
89
|
/**
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
* Empty is the runtime's own.
|
|
90
|
+
* The locale the timestamp and the words are in, as a BCP 47 tag such as
|
|
91
|
+
* `de`. Empty reads the nearest `lang`, then the browser's language.
|
|
88
92
|
*/
|
|
89
93
|
locale: string;
|
|
90
94
|
/**
|
|
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { customElement, HelixElement, HelixSendEvent, hostAria, markRegion, RelativeClockController, relativeTime, requestChange, TONE_MARKS, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { customElement, HelixElement, HelixSendEvent, hostAria, markRegion, RelativeClockController, relativeTime, requestChange, TONE_MARKS, words, wordsLocale, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { html, nothing } from 'lit';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
10
|
import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
|
|
@@ -15,7 +15,7 @@ let HelixHeadlessChatMessage = class HelixHeadlessChatMessage extends HelixEleme
|
|
|
15
15
|
super(...arguments);
|
|
16
16
|
this.at = '';
|
|
17
17
|
this.authorLabel = '';
|
|
18
|
-
this.failedLabel =
|
|
18
|
+
this.failedLabel = 'Not sent';
|
|
19
19
|
this.locale = '';
|
|
20
20
|
this.retryLabel = 'Try again';
|
|
21
21
|
this.sendingLabel = 'Sending';
|
|
@@ -24,7 +24,7 @@ let HelixHeadlessChatMessage = class HelixHeadlessChatMessage extends HelixEleme
|
|
|
24
24
|
this.clock = new RelativeClockController(this, {
|
|
25
25
|
expires: (now) => {
|
|
26
26
|
const moment = this.moment;
|
|
27
|
-
return moment ? relativeTime(this
|
|
27
|
+
return moment ? relativeTime(wordsLocale(this))(moment, now).next : undefined;
|
|
28
28
|
},
|
|
29
29
|
});
|
|
30
30
|
this.handleFill = () => {
|
|
@@ -49,6 +49,7 @@ let HelixHeadlessChatMessage = class HelixHeadlessChatMessage extends HelixEleme
|
|
|
49
49
|
});
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
+
static { this.words = 'helix-chat-message'; }
|
|
52
53
|
get moment() {
|
|
53
54
|
if (this.at === '') {
|
|
54
55
|
return undefined;
|
|
@@ -66,7 +67,7 @@ let HelixHeadlessChatMessage = class HelixHeadlessChatMessage extends HelixEleme
|
|
|
66
67
|
}
|
|
67
68
|
get reading() {
|
|
68
69
|
const moment = this.moment;
|
|
69
|
-
return moment ? relativeTime(this
|
|
70
|
+
return moment ? relativeTime(wordsLocale(this))(moment, new Date(this.clock.now)).text : '';
|
|
70
71
|
}
|
|
71
72
|
get name() {
|
|
72
73
|
return turnName(authorWords(this.author, this.authorLabel, this.turnWords), this.reading, this.turnWords);
|
|
@@ -142,15 +143,18 @@ __decorate([
|
|
|
142
143
|
property({ attribute: 'author-label' })
|
|
143
144
|
], HelixHeadlessChatMessage.prototype, "authorLabel", void 0);
|
|
144
145
|
__decorate([
|
|
146
|
+
words,
|
|
145
147
|
property({ attribute: 'failed-label' })
|
|
146
148
|
], HelixHeadlessChatMessage.prototype, "failedLabel", void 0);
|
|
147
149
|
__decorate([
|
|
148
150
|
property()
|
|
149
151
|
], HelixHeadlessChatMessage.prototype, "locale", void 0);
|
|
150
152
|
__decorate([
|
|
153
|
+
words,
|
|
151
154
|
property({ attribute: 'retry-label' })
|
|
152
155
|
], HelixHeadlessChatMessage.prototype, "retryLabel", void 0);
|
|
153
156
|
__decorate([
|
|
157
|
+
words,
|
|
154
158
|
property({ attribute: 'sending-label' })
|
|
155
159
|
], HelixHeadlessChatMessage.prototype, "sendingLabel", void 0);
|
|
156
160
|
__decorate([
|
package/dist/chat/naming.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { formatMessage } from '@fusion.dev/helix-core';
|
|
2
2
|
export const TURN_WORDS = { me: 'You', sentence: '{author}, {time}', turn: 'Message' };
|
|
3
3
|
export const authorWords = (author, authorLabel, words) => {
|
|
4
4
|
if (authorLabel !== '') {
|
|
@@ -10,5 +10,5 @@ export const authorWords = (author, authorLabel, words) => {
|
|
|
10
10
|
return author === undefined || author === 'them' ? '' : author;
|
|
11
11
|
};
|
|
12
12
|
export const turnName = (author, time, words) => author !== '' && time !== ''
|
|
13
|
-
?
|
|
13
|
+
? formatMessage(words.sentence, { author, time }, '')
|
|
14
14
|
: author || time || words.turn;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChildrenController, HelixElement } from '@fusion.dev/helix-core';
|
|
2
2
|
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
|
-
import {
|
|
3
|
+
import type { HelixHeadlessChatMessage } from '../message/chat-message.js';
|
|
4
4
|
/** One turn handed over as data, which is what `turns` holds. */
|
|
5
5
|
export interface ChatTurn {
|
|
6
6
|
/** When it was said, as anything `Date` parses. */
|
|
@@ -128,6 +128,11 @@ declare const HelixHeadlessChat_base: (new (...args: any[]) => import("@fusion.d
|
|
|
128
128
|
* @csspart typing - The words that say who is typing, in the status band, while `typing` names someone.
|
|
129
129
|
*/
|
|
130
130
|
export declare class HelixHeadlessChat extends HelixHeadlessChat_base {
|
|
131
|
+
/**
|
|
132
|
+
* The key this family's words are registered under, its styled tag:
|
|
133
|
+
* `registerWords('de', { 'helix-chat': { typingLabel: '{author} schreibt' } })`.
|
|
134
|
+
*/
|
|
135
|
+
static words: string;
|
|
131
136
|
/**
|
|
132
137
|
* Slots are assigned manually, so only the turns go into the log.
|
|
133
138
|
*
|
|
@@ -159,6 +164,19 @@ export declare class HelixHeadlessChat extends HelixHeadlessChat_base {
|
|
|
159
164
|
* so a default of true had no attribute that turned it off.
|
|
160
165
|
*/
|
|
161
166
|
defaultPinned: boolean;
|
|
167
|
+
/**
|
|
168
|
+
* What a turn from `turns` that did not send says, and what a screen reader
|
|
169
|
+
* hears before its words. A turn you write as a child says its own
|
|
170
|
+
* `failed-label`.
|
|
171
|
+
*/
|
|
172
|
+
failedLabel: string;
|
|
173
|
+
/**
|
|
174
|
+
* What a screen reader hears for a turn that did not send. `{failed}` is the
|
|
175
|
+
* turn's `failed-label` and `{text}` is its words.
|
|
176
|
+
*/
|
|
177
|
+
failedTurnLabel: string;
|
|
178
|
+
/** The conversation's name, read by screen readers, where `label` is empty. */
|
|
179
|
+
fallbackLabel: string;
|
|
162
180
|
/**
|
|
163
181
|
* Whether there are older turns to load, and whether they are loading.
|
|
164
182
|
*
|
|
@@ -376,6 +394,14 @@ export declare class HelixHeadlessChat extends HelixHeadlessChat_base {
|
|
|
376
394
|
* turn; what they were reading is the one fixed point. It is also idempotent,
|
|
377
395
|
* which is what lets it run beside the browser's own scroll anchoring where
|
|
378
396
|
* there is some: a turn the browser already put back has not moved.
|
|
397
|
+
*
|
|
398
|
+
* **A transcript fed as data writes no scroll offset while the reader
|
|
399
|
+
* scrolls.** Turns drawn above the reader for the first time come out taller
|
|
400
|
+
* or shorter than the estimate, and a write to `scrollTop` to make up for
|
|
401
|
+
* them ends a fling on iOS. While the reader scrolls, the controller holds
|
|
402
|
+
* them instead, in its spacer above the window, and squares the scroll offset
|
|
403
|
+
* once the log is still. The turn noted before a scroll whose event has not
|
|
404
|
+
* arrived is out of date, so that counts as scrolling too.
|
|
379
405
|
*/
|
|
380
406
|
private restore;
|
|
381
407
|
/** Fires `helix-history` once for each time the reader reaches the top. */
|
|
@@ -5,13 +5,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
var HelixHeadlessChat_1;
|
|
8
|
-
import { ChildrenController, customElement,
|
|
8
|
+
import { ChildrenController, customElement, formatWords, HelixBeforePinEvent, HelixElement, HelixHistoryEvent, HelixPinEvent, hostAria, MixinCollection, onUnlessFalse, requestChange, VirtualizeController, whenHydrated, words, wordsConverter, } from '@fusion.dev/helix-core';
|
|
9
9
|
import { nothing } from 'lit';
|
|
10
10
|
import { property, state } from 'lit/decorators.js';
|
|
11
11
|
import { keyed } from 'lit/directives/keyed.js';
|
|
12
12
|
import { repeat } from 'lit/directives/repeat.js';
|
|
13
13
|
import { html } from 'lit/static-html.js';
|
|
14
|
-
import { FAILED_LABEL } from '../message/chat-message.js';
|
|
15
14
|
import { TURN_WORDS } from '../naming.js';
|
|
16
15
|
const REGIONS = ['header', 'actions', 'resume', 'status', 'composer'];
|
|
17
16
|
const SECOND_NAMES = {
|
|
@@ -37,11 +36,15 @@ const spoken = (message) => [...message.childNodes]
|
|
|
37
36
|
.join('')
|
|
38
37
|
.replace(/\s+/g, ' ')
|
|
39
38
|
.trim();
|
|
39
|
+
const drawnInFull = ({ element }) => element.firstElementChild?.hasUpdated !== false;
|
|
40
40
|
let HelixHeadlessChat = class HelixHeadlessChat extends MixinCollection(HelixElement) {
|
|
41
41
|
constructor() {
|
|
42
42
|
super(...arguments);
|
|
43
43
|
this.authorStyles = {};
|
|
44
44
|
this.defaultPinned = true;
|
|
45
|
+
this.failedLabel = 'Not sent';
|
|
46
|
+
this.failedTurnLabel = '{failed}: {text}';
|
|
47
|
+
this.fallbackLabel = 'Conversation';
|
|
45
48
|
this.history = '';
|
|
46
49
|
this.historyText = 'Loading earlier messages';
|
|
47
50
|
this.label = '';
|
|
@@ -67,10 +70,11 @@ let HelixHeadlessChat = class HelixHeadlessChat extends MixinCollection(HelixEle
|
|
|
67
70
|
this.newest = undefined;
|
|
68
71
|
this.pending = new Set();
|
|
69
72
|
this.virtualize = new VirtualizeController(this, {
|
|
73
|
+
anchor: () => !this.pinned && this.virtualize.scrolling(),
|
|
70
74
|
container: () => (this.fed ? this.log : null),
|
|
71
75
|
count: () => this.turns.length,
|
|
72
76
|
estimate: () => HelixHeadlessChat_1.ESTIMATE,
|
|
73
|
-
rows: () => (this.fed ? this.drawn() : []),
|
|
77
|
+
rows: () => (this.fed ? this.drawn().filter(drawnInFull) : []),
|
|
74
78
|
});
|
|
75
79
|
this.filled = undefined;
|
|
76
80
|
this.handleResize = () => {
|
|
@@ -78,6 +82,9 @@ let HelixHeadlessChat = class HelixHeadlessChat extends MixinCollection(HelixEle
|
|
|
78
82
|
this.stick();
|
|
79
83
|
}
|
|
80
84
|
else {
|
|
85
|
+
if (this.fed) {
|
|
86
|
+
this.virtualize.settle();
|
|
87
|
+
}
|
|
81
88
|
this.restore();
|
|
82
89
|
}
|
|
83
90
|
this.remember();
|
|
@@ -108,6 +115,7 @@ let HelixHeadlessChat = class HelixHeadlessChat extends MixinCollection(HelixEle
|
|
|
108
115
|
};
|
|
109
116
|
}
|
|
110
117
|
static { HelixHeadlessChat_1 = this; }
|
|
118
|
+
static { this.words = 'helix-chat'; }
|
|
111
119
|
static { this.shadowRootOptions = {
|
|
112
120
|
...HelixElement.shadowRootOptions,
|
|
113
121
|
slotAssignment: 'manual',
|
|
@@ -159,7 +167,7 @@ let HelixHeadlessChat = class HelixHeadlessChat extends MixinCollection(HelixEle
|
|
|
159
167
|
if (this.fed) {
|
|
160
168
|
return this.turns.map((turn) => ({
|
|
161
169
|
author: turn.author,
|
|
162
|
-
failed:
|
|
170
|
+
failed: this.failedLabel,
|
|
163
171
|
id: this.identity(turn),
|
|
164
172
|
state: turn.state,
|
|
165
173
|
text: turn.text,
|
|
@@ -259,7 +267,7 @@ let HelixHeadlessChat = class HelixHeadlessChat extends MixinCollection(HelixEle
|
|
|
259
267
|
restore() {
|
|
260
268
|
const log = this.log;
|
|
261
269
|
const anchor = this.anchor;
|
|
262
|
-
if (!log || !anchor) {
|
|
270
|
+
if (!log || !anchor || (this.fed && this.virtualize.scrolling())) {
|
|
263
271
|
return;
|
|
264
272
|
}
|
|
265
273
|
const found = this.rendered().find((turn) => turn.id === anchor.id);
|
|
@@ -328,7 +336,9 @@ let HelixHeadlessChat = class HelixHeadlessChat extends MixinCollection(HelixEle
|
|
|
328
336
|
return at < 0 ? [] : turns.slice(at + 1);
|
|
329
337
|
}
|
|
330
338
|
phrase(turn) {
|
|
331
|
-
return turn.state === 'failed'
|
|
339
|
+
return turn.state === 'failed'
|
|
340
|
+
? formatWords(this, 'failedTurnLabel', { failed: turn.failed, text: turn.text })
|
|
341
|
+
: turn.text;
|
|
332
342
|
}
|
|
333
343
|
watchSizes() {
|
|
334
344
|
if (typeof ResizeObserver === 'undefined') {
|
|
@@ -368,7 +378,7 @@ let HelixHeadlessChat = class HelixHeadlessChat extends MixinCollection(HelixEle
|
|
|
368
378
|
}
|
|
369
379
|
willUpdate(changed) {
|
|
370
380
|
super.willUpdate(changed);
|
|
371
|
-
hostAria(this.internals, { label: this.label ||
|
|
381
|
+
hostAria(this.internals, { label: this.label || this.fallbackLabel, role: 'region' });
|
|
372
382
|
if (changed.has('meLabel') || changed.has('messageLabel') || changed.has('turnLabel')) {
|
|
373
383
|
this.words = { me: this.meLabel, sentence: this.messageLabel, turn: this.turnLabel };
|
|
374
384
|
}
|
|
@@ -437,6 +447,7 @@ let HelixHeadlessChat = class HelixHeadlessChat extends MixinCollection(HelixEle
|
|
|
437
447
|
at=${turn.at ?? nothing}
|
|
438
448
|
style=${ownEntry(this.authorStyles, turn.author) ?? nothing}
|
|
439
449
|
.turnWords=${this.words}
|
|
450
|
+
.failedLabel=${this.failedLabel}
|
|
440
451
|
state=${turn.state ?? nothing}
|
|
441
452
|
>${turn.text}</${message}>
|
|
442
453
|
</div>`)}
|
|
@@ -457,7 +468,7 @@ let HelixHeadlessChat = class HelixHeadlessChat extends MixinCollection(HelixEle
|
|
|
457
468
|
part="log"
|
|
458
469
|
role="log"
|
|
459
470
|
aria-live="off"
|
|
460
|
-
aria-label=${this.label ||
|
|
471
|
+
aria-label=${this.label || this.fallbackLabel}
|
|
461
472
|
aria-busy=${busy ? 'true' : nothing}
|
|
462
473
|
?data-windowed=${fed}
|
|
463
474
|
@scroll=${this.handleScroll}
|
|
@@ -476,7 +487,7 @@ let HelixHeadlessChat = class HelixHeadlessChat extends MixinCollection(HelixEle
|
|
|
476
487
|
? nothing
|
|
477
488
|
: html `<span part="typing"
|
|
478
489
|
><span part="indicator" aria-hidden="true"></span
|
|
479
|
-
>${
|
|
490
|
+
>${formatWords(this, 'typingLabel', { author: this.typing })}</span
|
|
480
491
|
>`}
|
|
481
492
|
</div>
|
|
482
493
|
<div part="composer" ?hidden=${!this.has('composer')}>
|
|
@@ -490,19 +501,34 @@ __decorate([
|
|
|
490
501
|
__decorate([
|
|
491
502
|
property({ attribute: 'default-pinned', converter: onUnlessFalse })
|
|
492
503
|
], HelixHeadlessChat.prototype, "defaultPinned", void 0);
|
|
504
|
+
__decorate([
|
|
505
|
+
words,
|
|
506
|
+
property({ attribute: 'failed-label' })
|
|
507
|
+
], HelixHeadlessChat.prototype, "failedLabel", void 0);
|
|
508
|
+
__decorate([
|
|
509
|
+
words,
|
|
510
|
+
property({ attribute: 'failed-turn-label' })
|
|
511
|
+
], HelixHeadlessChat.prototype, "failedTurnLabel", void 0);
|
|
512
|
+
__decorate([
|
|
513
|
+
words,
|
|
514
|
+
property({ attribute: 'fallback-label' })
|
|
515
|
+
], HelixHeadlessChat.prototype, "fallbackLabel", void 0);
|
|
493
516
|
__decorate([
|
|
494
517
|
property()
|
|
495
518
|
], HelixHeadlessChat.prototype, "history", void 0);
|
|
496
519
|
__decorate([
|
|
520
|
+
words,
|
|
497
521
|
property({ attribute: 'history-text' })
|
|
498
522
|
], HelixHeadlessChat.prototype, "historyText", void 0);
|
|
499
523
|
__decorate([
|
|
500
524
|
property()
|
|
501
525
|
], HelixHeadlessChat.prototype, "label", void 0);
|
|
502
526
|
__decorate([
|
|
527
|
+
words,
|
|
503
528
|
property({ attribute: 'me-label' })
|
|
504
529
|
], HelixHeadlessChat.prototype, "meLabel", void 0);
|
|
505
530
|
__decorate([
|
|
531
|
+
words,
|
|
506
532
|
property({ attribute: 'message-label' })
|
|
507
533
|
], HelixHeadlessChat.prototype, "messageLabel", void 0);
|
|
508
534
|
__decorate([
|
|
@@ -512,6 +538,7 @@ __decorate([
|
|
|
512
538
|
property({ type: Number })
|
|
513
539
|
], HelixHeadlessChat.prototype, "threshold", void 0);
|
|
514
540
|
__decorate([
|
|
541
|
+
words,
|
|
515
542
|
property({ attribute: 'turn-label' })
|
|
516
543
|
], HelixHeadlessChat.prototype, "turnLabel", void 0);
|
|
517
544
|
__decorate([
|
|
@@ -521,6 +548,7 @@ __decorate([
|
|
|
521
548
|
property()
|
|
522
549
|
], HelixHeadlessChat.prototype, "typing", void 0);
|
|
523
550
|
__decorate([
|
|
551
|
+
words,
|
|
524
552
|
property({ attribute: 'typing-label' })
|
|
525
553
|
], HelixHeadlessChat.prototype, "typingLabel", void 0);
|
|
526
554
|
__decorate([
|
|
@@ -66,6 +66,11 @@ declare const HelixHeadlessCheckbox_base: (new (...args: any[]) => import("@fusi
|
|
|
66
66
|
* @cssstate invalid - The control has an error to show, from the browser's validation or from your `feedback`.
|
|
67
67
|
*/
|
|
68
68
|
export declare class HelixHeadlessCheckbox extends HelixHeadlessCheckbox_base {
|
|
69
|
+
/**
|
|
70
|
+
* The key this family's words are registered under, its styled tag:
|
|
71
|
+
* `registerWords('de', { 'helix-checkbox': { valueMissingMessage: '...' } })`.
|
|
72
|
+
*/
|
|
73
|
+
static words: string;
|
|
69
74
|
protected readonly aria: AriaForwardController;
|
|
70
75
|
/** A click on the element itself, `click()` or a page's `<label for>`, toggles it. */
|
|
71
76
|
protected readonly clicks: HostClickController;
|
|
@@ -83,6 +88,12 @@ export declare class HelixHeadlessCheckbox extends HelixHeadlessCheckbox_base {
|
|
|
83
88
|
* The value submitted when the box is checked.
|
|
84
89
|
*/
|
|
85
90
|
value: string;
|
|
91
|
+
/**
|
|
92
|
+
* The message reported when the field is required and the box is not ticked.
|
|
93
|
+
* Absent, or empty, is this sentence, or the words registered for the page's
|
|
94
|
+
* locale.
|
|
95
|
+
*/
|
|
96
|
+
valueMissingMessage: string;
|
|
86
97
|
/**
|
|
87
98
|
* Whether the mark draws the dash: from the moment the box is indeterminate
|
|
88
99
|
* until it is checked.
|
|
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { AriaForwardController, customElement, HelixFormElement, HostClickController, MixinControllerChecked, MixinField, slotFilled, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { AriaForwardController, customElement, HelixFormElement, HostClickController, MixinControllerChecked, MixinField, slotFilled, words, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { html, nothing } from 'lit';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
10
|
let HelixHeadlessCheckbox = class HelixHeadlessCheckbox extends MixinControllerChecked(MixinField(HelixFormElement)) {
|
|
@@ -16,6 +16,7 @@ let HelixHeadlessCheckbox = class HelixHeadlessCheckbox extends MixinControllerC
|
|
|
16
16
|
this.clicks = new HostClickController(this, () => this.partNamed('control'));
|
|
17
17
|
this.indeterminate = false;
|
|
18
18
|
this.value = 'on';
|
|
19
|
+
this.valueMissingMessage = 'Tick this box to continue.';
|
|
19
20
|
this.dashed = false;
|
|
20
21
|
this.handleChange = (event) => {
|
|
21
22
|
const input = event.target;
|
|
@@ -43,13 +44,14 @@ let HelixHeadlessCheckbox = class HelixHeadlessCheckbox extends MixinControllerC
|
|
|
43
44
|
}
|
|
44
45
|
};
|
|
45
46
|
}
|
|
47
|
+
static { this.words = 'helix-checkbox'; }
|
|
46
48
|
static { this.shadowRootOptions = {
|
|
47
49
|
...HelixFormElement.shadowRootOptions,
|
|
48
50
|
delegatesFocus: true,
|
|
49
51
|
}; }
|
|
50
52
|
sync() {
|
|
51
53
|
this.internals.setFormValue(this.checked ? this.value : null);
|
|
52
|
-
this.reportRequired(!this.checked,
|
|
54
|
+
this.reportRequired(!this.checked, this.valueMissingMessage, 'control');
|
|
53
55
|
}
|
|
54
56
|
formResetCallback() {
|
|
55
57
|
super.formResetCallback();
|
|
@@ -120,6 +122,10 @@ __decorate([
|
|
|
120
122
|
__decorate([
|
|
121
123
|
property()
|
|
122
124
|
], HelixHeadlessCheckbox.prototype, "value", void 0);
|
|
125
|
+
__decorate([
|
|
126
|
+
words,
|
|
127
|
+
property({ attribute: 'value-missing-message' })
|
|
128
|
+
], HelixHeadlessCheckbox.prototype, "valueMissingMessage", void 0);
|
|
123
129
|
HelixHeadlessCheckbox = __decorate([
|
|
124
130
|
customElement('helix-headless-checkbox')
|
|
125
131
|
], HelixHeadlessCheckbox);
|
|
@@ -71,6 +71,11 @@ declare const HelixHeadlessCheckboxGroup_base: (new (...args: any[]) => import("
|
|
|
71
71
|
* @cssstate invalid - The control has an error to show, from the browser's validation or from your `feedback`.
|
|
72
72
|
*/
|
|
73
73
|
export declare class HelixHeadlessCheckboxGroup extends HelixHeadlessCheckboxGroup_base {
|
|
74
|
+
/**
|
|
75
|
+
* The key this family's words are registered under, its styled tag:
|
|
76
|
+
* `registerWords('de', { 'helix-checkbox-group': { selectAllLabel: 'Alle auswählen' } })`.
|
|
77
|
+
*/
|
|
78
|
+
static words: string;
|
|
74
79
|
/**
|
|
75
80
|
* Whether a box above the set checks or unchecks every enabled box.
|
|
76
81
|
*/
|
|
@@ -88,6 +93,12 @@ export declare class HelixHeadlessCheckboxGroup extends HelixHeadlessCheckboxGro
|
|
|
88
93
|
*/
|
|
89
94
|
get value(): string;
|
|
90
95
|
set value(next: string);
|
|
96
|
+
/**
|
|
97
|
+
* The message reported when the field is required and no box is ticked.
|
|
98
|
+
* Absent, or empty, is this sentence, or the words registered for the page's
|
|
99
|
+
* locale.
|
|
100
|
+
*/
|
|
101
|
+
valueMissingMessage: string;
|
|
91
102
|
/**
|
|
92
103
|
* The checked values, as a list, in the order the boxes are written.
|
|
93
104
|
*
|
|
@@ -5,18 +5,19 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
var HelixHeadlessCheckboxGroup_1;
|
|
8
|
-
import { commaList, customElement, DisabledCascadeController, HelixBeforeChangeEvent, HelixFormElement, hostAria, MixinField, } from '@fusion.dev/helix-core';
|
|
8
|
+
import { commaList, customElement, DisabledCascadeController, HelixBeforeChangeEvent, HelixFormElement, hostAria, MixinField, words, } from '@fusion.dev/helix-core';
|
|
9
9
|
import { nothing } from 'lit';
|
|
10
10
|
import { property } from 'lit/decorators.js';
|
|
11
11
|
import { html } from 'lit/static-html.js';
|
|
12
12
|
import { HelixHeadlessCheckbox } from '../../checkbox/root/checkbox-root.js';
|
|
13
13
|
import '../../checkbox/index.js';
|
|
14
14
|
import { selectAllPress, selectAllState } from '../select-all.js';
|
|
15
|
-
let HelixHeadlessCheckboxGroup =
|
|
15
|
+
let HelixHeadlessCheckboxGroup = class HelixHeadlessCheckboxGroup extends MixinField(HelixFormElement) {
|
|
16
16
|
constructor() {
|
|
17
17
|
super(...arguments);
|
|
18
18
|
this.selectAll = false;
|
|
19
19
|
this.selectAllLabel = 'Select all';
|
|
20
|
+
this.valueMissingMessage = 'Choose at least one to continue.';
|
|
20
21
|
this.declared = [];
|
|
21
22
|
this.checking = undefined;
|
|
22
23
|
this.pending = false;
|
|
@@ -72,6 +73,8 @@ let HelixHeadlessCheckboxGroup = HelixHeadlessCheckboxGroup_1 = class HelixHeadl
|
|
|
72
73
|
this.announceChange();
|
|
73
74
|
};
|
|
74
75
|
}
|
|
76
|
+
static { HelixHeadlessCheckboxGroup_1 = this; }
|
|
77
|
+
static { this.words = 'helix-checkbox-group'; }
|
|
75
78
|
get value() {
|
|
76
79
|
return this.values.join(',');
|
|
77
80
|
}
|
|
@@ -175,7 +178,7 @@ let HelixHeadlessCheckboxGroup = HelixHeadlessCheckboxGroup_1 = class HelixHeadl
|
|
|
175
178
|
}
|
|
176
179
|
validate() {
|
|
177
180
|
this.judged = this.value;
|
|
178
|
-
this.reportRequired(this.judged === '',
|
|
181
|
+
this.reportRequired(this.judged === '', this.valueMissingMessage, 'items');
|
|
179
182
|
}
|
|
180
183
|
updated(changed) {
|
|
181
184
|
super.updated(changed);
|
|
@@ -223,11 +226,16 @@ __decorate([
|
|
|
223
226
|
property({ attribute: 'select-all', type: Boolean })
|
|
224
227
|
], HelixHeadlessCheckboxGroup.prototype, "selectAll", void 0);
|
|
225
228
|
__decorate([
|
|
229
|
+
words,
|
|
226
230
|
property({ attribute: 'select-all-label' })
|
|
227
231
|
], HelixHeadlessCheckboxGroup.prototype, "selectAllLabel", void 0);
|
|
228
232
|
__decorate([
|
|
229
233
|
property()
|
|
230
234
|
], HelixHeadlessCheckboxGroup.prototype, "value", null);
|
|
235
|
+
__decorate([
|
|
236
|
+
words,
|
|
237
|
+
property({ attribute: 'value-missing-message' })
|
|
238
|
+
], HelixHeadlessCheckboxGroup.prototype, "valueMissingMessage", void 0);
|
|
231
239
|
__decorate([
|
|
232
240
|
property({ attribute: false })
|
|
233
241
|
], HelixHeadlessCheckboxGroup.prototype, "values", null);
|