@mcp-b/web-components 0.2.22 → 0.3.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/README.md +93 -30
- package/dist/{alert-dialog-D25Oi_TS.js → alert-dialog-CGUwj_0U.js} +1 -1
- package/dist/{button-gg3JJxQZ.js → button-BbabhtKj.js} +121 -77
- package/dist/{button-BQofnUt4.d.ts → button-c5YKsC69.d.ts} +6 -3
- package/dist/{checkbox-DoFcDEKB.d.ts → checkbox-BtoypUxD.d.ts} +0 -6
- package/dist/{checkbox-C96lUDIM.js → checkbox-C97tlcf2.js} +11 -43
- package/dist/{color-input-Gae_-9w-.js → color-input-Dtp1v7A-.js} +14 -54
- package/dist/{color-input-Bky89xg_.d.ts → color-input-S29ZHwHE.d.ts} +0 -5
- package/dist/{color-picker-BYyZavkT.js → color-picker-Mnpc5u6E.js} +8 -4
- package/dist/{combobox-iERnTD3A.js → combobox-D4ji7M2B.js} +12 -33
- package/dist/{combobox-item-D2H1CMxC.d.ts → combobox-item-BnBtZyhw.d.ts} +3 -6
- package/dist/{comparison-B1-nMwmp.d.ts → comparison-CRvbwS7X.d.ts} +1 -0
- package/dist/{comparison-HJ1Zedhs.js → comparison-DQUpvkmg.js} +11 -3
- package/dist/components/alert-dialog/alert-dialog.js +1 -1
- package/dist/components/button/button.d.ts +1 -1
- package/dist/components/button/button.js +1 -1
- package/dist/components/carousel/carousel.js +1 -1
- package/dist/components/checkbox/checkbox.d.ts +1 -1
- package/dist/components/checkbox/checkbox.js +1 -1
- package/dist/components/color-input/color-input.d.ts +1 -1
- package/dist/components/color-input/color-input.js +1 -1
- package/dist/components/color-picker/color-picker.js +1 -1
- package/dist/components/combobox/combobox.d.ts +1 -1
- package/dist/components/combobox/combobox.js +1 -1
- package/dist/components/combobox-item/combobox-item.d.ts +1 -1
- package/dist/components/comparison/comparison.d.ts +1 -1
- package/dist/components/comparison/comparison.js +1 -1
- package/dist/components/copy/copy.js +4 -20
- package/dist/components/date/date.d.ts +1 -1
- package/dist/components/date/date.js +1 -1
- package/dist/components/dialog/dialog.js +1 -1
- package/dist/components/dropdown/dropdown.d.ts +1 -1
- package/dist/components/dropdown/dropdown.js +1 -1
- package/dist/components/expander/expander.js +1 -1
- package/dist/components/file-input/file-input.d.ts +1 -1
- package/dist/components/file-input/file-input.js +1 -1
- package/dist/components/filter-bar/filter-bar.js +1 -1
- package/dist/components/index.d.ts +24 -24
- package/dist/components/index.js +48 -48
- package/dist/components/infinite-scroller/infinite-scroller.js +1 -1
- package/dist/components/intersection-observer/intersection-observer.js +1 -1
- package/dist/components/listbox/listbox.d.ts +1 -1
- package/dist/components/listbox/listbox.js +1 -1
- package/dist/components/mutation-observer/mutation-observer.js +1 -1
- package/dist/components/navicon/navicon.js +1 -1
- package/dist/components/number/number.js +1 -1
- package/dist/components/number-field/number-field.d.ts +1 -1
- package/dist/components/number-field/number-field.js +1 -1
- package/dist/components/pagination/pagination.js +1 -1
- package/dist/components/popover/popover.js +1 -1
- package/dist/components/preview-card/preview-card.js +1 -1
- package/dist/components/radio/radio.d.ts +1 -1
- package/dist/components/radio/radio.js +1 -1
- package/dist/components/radio-item/radio-item.js +1 -1
- package/dist/components/rating/rating.d.ts +1 -1
- package/dist/components/rating/rating.js +1 -1
- package/dist/components/resize-observer/resize-observer.js +1 -1
- package/dist/components/scroller/scroller.js +1 -1
- package/dist/components/search-list/search-list.d.ts +1 -1
- package/dist/components/search-list/search-list.js +1 -1
- package/dist/components/select/select.d.ts +1 -1
- package/dist/components/select/select.js +1 -1
- package/dist/components/share/share.js +1 -1
- package/dist/components/slide-activator/slide-activator.d.ts +1 -1
- package/dist/components/slide-activator/slide-activator.js +1 -1
- package/dist/components/slider/slider.d.ts +1 -1
- package/dist/components/slider/slider.js +1 -1
- package/dist/components/spinner/spinner.js +1 -1
- package/dist/components/splitter/splitter.d.ts +1 -1
- package/dist/components/splitter/splitter.js +1 -1
- package/dist/components/switch/switch.d.ts +1 -1
- package/dist/components/switch/switch.js +1 -1
- package/dist/components/tab-list/tab-list.js +1 -1
- package/dist/components/text-area/text-area.d.ts +1 -1
- package/dist/components/text-area/text-area.js +1 -1
- package/dist/components/text-field/text-field.d.ts +1 -1
- package/dist/components/text-field/text-field.js +1 -1
- package/dist/components/timed-content/timed-content.js +1 -1
- package/dist/components/toast/toast.d.ts +1 -1
- package/dist/components/toast/toast.js +1 -1
- package/dist/components/toast-item/toast-item.js +1 -1
- package/dist/components/toggle-icon/toggle-icon.d.ts +1 -1
- package/dist/components/toggle-icon/toggle-icon.js +1 -1
- package/dist/components/toggle-tag/toggle-tag.d.ts +1 -1
- package/dist/components/toggle-tag/toggle-tag.js +1 -1
- package/dist/components/tooltip/tooltip.js +1 -1
- package/dist/components/transition-group/transition-group.d.ts +1 -1
- package/dist/components/transition-group/transition-group.js +1 -1
- package/dist/components/zoomable-frame/zoomable-frame.js +1 -1
- package/dist/{date-6M6wfa8L.d.ts → date-DtaTBM71.d.ts} +1 -1
- package/dist/docs/custom-elements.json +126 -171
- package/dist/{dropdown-DM4tlF_p.js → dropdown-BPOpCp59.js} +58 -34
- package/dist/{dropdown-Bo00Vlr5.d.ts → dropdown-C5ldJu4g.d.ts} +5 -1
- package/dist/{localize-322EtXNX.d.ts → en-ss05iPjS.d.ts} +4 -1
- package/dist/{file-input-vZFm22Lo.js → file-input-B4VfcfTD.js} +17 -33
- package/dist/{file-input-D2D6YC0B.d.ts → file-input-CgsTcC1R.d.ts} +0 -5
- package/dist/{filter-bar-DJuDlx5f.js → filter-bar-DhQSMr3S.js} +1 -1
- package/dist/index.d.ts +25 -27
- package/dist/index.js +49 -52
- package/dist/{infinite-scroller-BmmtnWNt.js → infinite-scroller-DjeMswwE.js} +2 -2
- package/dist/{intersection-observer-B6TciOAQ.js → intersection-observer-Db0-7ZvZ.js} +1 -1
- package/dist/{listbox-B0geidHW.js → listbox-BGHw-rUd.js} +13 -28
- package/dist/{listbox-DD4ujIJe.d.ts → listbox-DKoMIQA6.d.ts} +3 -5
- package/dist/{mutation-observer-DS8EBuOp.js → mutation-observer-DkhonHyD.js} +1 -1
- package/dist/{number-field-odk4lKXM.d.ts → number-field-T0rzObq9.d.ts} +0 -5
- package/dist/{number-field-BGH7JtNf.js → number-field-yME3rRZT.js} +44 -55
- package/dist/{popover-DJBrJ0za.js → popover-lsI6gqNk.js} +9 -32
- package/dist/{preview-card-C7H1FPfd.js → preview-card-D1msvOWP.js} +1 -1
- package/dist/{radio-8UZAUYXt.js → radio-4Cok4gJI.js} +11 -28
- package/dist/{radio-CieMa4zU.d.ts → radio-B4fz924Q.d.ts} +1 -4
- package/dist/{radio-item-BlhFgXsU.js → radio-item-DpP3GBPV.js} +2 -3
- package/dist/{rating-4xNsWumY.d.ts → rating-8BLXhAVl.d.ts} +1 -3
- package/dist/{rating-C1BcJDIO.js → rating-CSn-nU2R.js} +24 -34
- package/dist/{resize-observer-DcrLhddo.js → resize-observer-Dg9Cm9e5.js} +1 -1
- package/dist/{search-list-Clmrg8EV.js → search-list-BffPIgnw.js} +19 -10
- package/dist/{search-list-n0GYO7rh.d.ts → search-list-Cd3--X7Q.d.ts} +11 -1
- package/dist/{select-CkZK2jJn.d.ts → select-6H_sN4A2.d.ts} +0 -5
- package/dist/{select-DLIaRnA4.js → select-B6nkY6E-.js} +7 -43
- package/dist/{share-bsgXZCl7.js → share-C7dB9NYf.js} +3 -19
- package/dist/{slide-activator-D7bBz69E.d.ts → slide-activator-CB0Ztk_u.d.ts} +1 -0
- package/dist/{slide-activator-Dm1EvZtL.js → slide-activator-Dkv5_KPl.js} +10 -3
- package/dist/{slider-B90Il7x3.js → slider-DY-GuC8T.js} +35 -46
- package/dist/{slider-B0FVsV1o.d.ts → slider-uQQ-T_kn.d.ts} +2 -3
- package/dist/{splitter-MnD4In9H.js → splitter-DzC0hXGN.js} +14 -3
- package/dist/{splitter-DBDJAzsp.d.ts → splitter-KQVgGdvP.d.ts} +1 -0
- package/dist/{switch-Cief9M59.d.ts → switch-BUfFo074.d.ts} +0 -6
- package/dist/{switch-D0hWr37A.js → switch-Chij-EaQ.js} +11 -43
- package/dist/{tab-list-B_Ye_Oj9.js → tab-list-CVOUSpAh.js} +2 -2
- package/dist/{text-area-B_mjCE9W.d.ts → text-area-DFMKyk8y.d.ts} +0 -3
- package/dist/{text-area-Czixaz-_.js → text-area-DZVghSkO.js} +14 -51
- package/dist/{text-field-BClWMp6q.d.ts → text-field-DepP1gei.d.ts} +0 -5
- package/dist/{text-field-Cznb4Afc.js → text-field-gX5RovkE.js} +11 -52
- package/dist/{timed-content-pvEP4l5V.js → timed-content-D00na-5r.js} +1 -0
- package/dist/{toast-cEBVK9NQ.d.ts → toast-CpyA3GYM.d.ts} +1 -1
- package/dist/{toast-DgkBQzQC.js → toast-CxfaWFY_.js} +2 -2
- package/dist/{toggle-icon-4oLDeEt4.js → toggle-icon-B3fZuslO.js} +9 -31
- package/dist/{toggle-icon-DlwMMWZL.d.ts → toggle-icon-sTLCOruF.d.ts} +0 -5
- package/dist/{toggle-tag-1sfTFJtg.js → toggle-tag--Gkp-CJJ.js} +7 -35
- package/dist/{toggle-tag-IVvMGT4R.d.ts → toggle-tag-DDBa6hAg.d.ts} +0 -5
- package/dist/{tooltip-DbyoPFNe.js → tooltip-bSXNhG9l.js} +9 -32
- package/dist/{transition-group-3hnAnwSd.js → transition-group-8PmQx0A5.js} +23 -4
- package/dist/{transition-group-DD_CjSNC.d.ts → transition-group-D134iT1k.d.ts} +8 -0
- package/dist/translations/en.d.ts +1 -5
- package/dist/translations/en.js +3 -6
- package/dist/translations/es.d.ts +1 -1
- package/dist/translations/es.js +2 -5
- package/dist/types/custom-element-jsx.d.ts +26 -10
- package/dist/utilities/anchored-surface.d.ts +36 -0
- package/dist/utilities/anchored-surface.js +46 -0
- package/dist/utilities/copy-feedback.d.ts +16 -0
- package/dist/utilities/copy-feedback.js +33 -0
- package/dist/utilities/form-validity.d.ts +28 -0
- package/dist/utilities/form-validity.js +33 -0
- package/dist/utilities/localize.d.ts +1 -1
- package/dist/utilities/localize.js +1 -0
- package/package.json +3 -2
- package/dist/{carousel-XopKISBQ.js → carousel-DpIqPTuO.js} +1 -1
- package/dist/{date-CJPmOdi9.js → date-CFIR88pX.js} +1 -1
- package/dist/{dialog-Cx46HMaZ.js → dialog-Ddvyn2d_.js} +1 -1
- package/dist/{expander-Bwvxj6Oa.js → expander-CMV4QCha.js} +1 -1
- package/dist/{navicon-_yMHY27-.js → navicon-B-5pY9gq.js} +1 -1
- package/dist/{number-BNtNXNF3.js → number-BYBxfOGw.js} +1 -1
- package/dist/{pagination-CrTQnuNW.js → pagination-VOzVTV8p.js} +1 -1
- package/dist/{scroller-LYgBVyfY.js → scroller-DZATZlDa.js} +1 -1
- package/dist/{spinner-C04Dmc0H.js → spinner-C9lQARtQ.js} +1 -1
- package/dist/{toast-item-CGvz92Qk.js → toast-item-DzSPG25R.js} +1 -1
- package/dist/{zoomable-frame-DxcjLGcF.js → zoomable-frame-BrjVkNMX.js} +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __decorate } from "./decorate-DcF3lt7P.js";
|
|
2
|
-
import "./radio-item-
|
|
2
|
+
import "./radio-item-DpP3GBPV.js";
|
|
3
3
|
import { css, html } from "lit";
|
|
4
4
|
import { property, query, state } from "lit/decorators.js";
|
|
5
5
|
import hostStyles from "@mcp-b/wc-support/styles/host.styles";
|
|
@@ -447,14 +447,6 @@ var SigveloRadio = class extends SigveloFormControlElement {
|
|
|
447
447
|
get focusableAnchor() {
|
|
448
448
|
return this.getItems()[0];
|
|
449
449
|
}
|
|
450
|
-
connectedCallback() {
|
|
451
|
-
super.connectedCallback();
|
|
452
|
-
this.addEventListener("invalid", this.handleHostInvalid);
|
|
453
|
-
}
|
|
454
|
-
disconnectedCallback() {
|
|
455
|
-
super.disconnectedCallback();
|
|
456
|
-
this.removeEventListener("invalid", this.handleHostInvalid);
|
|
457
|
-
}
|
|
458
450
|
firstUpdated() {
|
|
459
451
|
if (this.value) {
|
|
460
452
|
const selectedItem = this.getSelectedItem({ includeDisabled: true });
|
|
@@ -465,26 +457,18 @@ var SigveloRadio = class extends SigveloFormControlElement {
|
|
|
465
457
|
this.updateValidity();
|
|
466
458
|
if (changedProperties.has("value")) this.internals.setFormValue(this.value);
|
|
467
459
|
if (changedProperties.has("disabled")) {
|
|
468
|
-
this.customStates.set("disabled", this.
|
|
460
|
+
this.customStates.set("disabled", this.effectiveDisabled);
|
|
469
461
|
this.updateControllerDisabledState();
|
|
470
462
|
}
|
|
471
|
-
if (this.hadUserInteraction || this.wasSubmitted) {
|
|
472
|
-
this.customStates.set("user-invalid", this.isInvalid);
|
|
473
|
-
this.customStates.set("user-valid", !this.isInvalid);
|
|
474
|
-
} else {
|
|
475
|
-
this.customStates.set("user-invalid", false);
|
|
476
|
-
this.customStates.set("user-valid", false);
|
|
477
|
-
}
|
|
478
463
|
}
|
|
479
464
|
/** @internal Called when a containing fieldset is disabled. */
|
|
480
|
-
formDisabledCallback(
|
|
481
|
-
|
|
465
|
+
formDisabledCallback() {
|
|
466
|
+
super.formDisabledCallback();
|
|
467
|
+
this.updateControllerDisabledState();
|
|
482
468
|
}
|
|
483
469
|
/** @internal Called when the form is reset. */
|
|
484
470
|
formResetCallback() {
|
|
485
|
-
|
|
486
|
-
this.hadUserInteraction = false;
|
|
487
|
-
this.wasSubmitted = false;
|
|
471
|
+
super.formResetCallback();
|
|
488
472
|
const itemToSelect = this.getItems().find((item) => item.getAttribute("value") === this.getAttribute("value"));
|
|
489
473
|
if (itemToSelect) this.setSelectedItem(itemToSelect);
|
|
490
474
|
else this.setSelectedItem(null);
|
|
@@ -494,10 +478,8 @@ var SigveloRadio = class extends SigveloFormControlElement {
|
|
|
494
478
|
if (options?.includeDisabled) return [...this.querySelectorAll("sigvelo-radio-item")];
|
|
495
479
|
else return [...this.querySelectorAll("sigvelo-radio-item:not(:state(disabled))")];
|
|
496
480
|
}
|
|
497
|
-
handleHostInvalid() {
|
|
498
|
-
this.wasSubmitted = true;
|
|
499
|
-
}
|
|
500
481
|
async handleGroupClick(event) {
|
|
482
|
+
if (this.effectiveDisabled) return;
|
|
501
483
|
const selectedItem = this.getSelectedItem();
|
|
502
484
|
const radioItem = event.target.closest("sigvelo-radio-item");
|
|
503
485
|
if (radioItem && !radioItem.disabled && !radioItem.disabledByController) {
|
|
@@ -516,6 +498,7 @@ var SigveloRadio = class extends SigveloFormControlElement {
|
|
|
516
498
|
}
|
|
517
499
|
}
|
|
518
500
|
async handleGroupKeyDown(event) {
|
|
501
|
+
if (this.effectiveDisabled) return;
|
|
519
502
|
const target = event.target.closest("sigvelo-radio-item");
|
|
520
503
|
const radioItems = this.getItems();
|
|
521
504
|
const currentIndex = radioItems.findIndex((item) => item.tabIndex === 0) || 0;
|
|
@@ -550,7 +533,7 @@ var SigveloRadio = class extends SigveloFormControlElement {
|
|
|
550
533
|
const selectedItemIndex = radioItems.findIndex((item) => item === selectedItem);
|
|
551
534
|
const targetIndex = selectedItemIndex > -1 ? selectedItemIndex : 0;
|
|
552
535
|
radioItems.forEach((item, index) => {
|
|
553
|
-
if (this.
|
|
536
|
+
if (this.effectiveDisabled) item.tabIndex = -1;
|
|
554
537
|
else item.tabIndex = index === targetIndex ? 0 : -1;
|
|
555
538
|
});
|
|
556
539
|
}
|
|
@@ -581,7 +564,7 @@ var SigveloRadio = class extends SigveloFormControlElement {
|
|
|
581
564
|
}
|
|
582
565
|
/** Updates the controller disabled state for all radio items */
|
|
583
566
|
updateControllerDisabledState() {
|
|
584
|
-
this.getItems({ includeDisabled: true }).forEach((item) => item.disabledByController = this.
|
|
567
|
+
this.getItems({ includeDisabled: true }).forEach((item) => item.disabledByController = this.effectiveDisabled);
|
|
585
568
|
requestAnimationFrame(() => this.resetRovingTabIndex());
|
|
586
569
|
}
|
|
587
570
|
/** Sets the form control's validity */
|
|
@@ -630,7 +613,7 @@ var SigveloRadio = class extends SigveloFormControlElement {
|
|
|
630
613
|
@click=${this.handleGroupClick}
|
|
631
614
|
@keydown=${this.handleGroupKeyDown}
|
|
632
615
|
>
|
|
633
|
-
<slot @slotchange=${this.
|
|
616
|
+
<slot @slotchange=${this.updateControllerDisabledState}></slot>
|
|
634
617
|
</div>
|
|
635
618
|
`;
|
|
636
619
|
}
|
|
@@ -418,17 +418,14 @@ declare class SigveloRadio extends SigveloFormControlElement {
|
|
|
418
418
|
required: boolean;
|
|
419
419
|
/** Disables the radio control. */
|
|
420
420
|
disabled: boolean;
|
|
421
|
-
connectedCallback(): void;
|
|
422
|
-
disconnectedCallback(): void;
|
|
423
421
|
firstUpdated(): void;
|
|
424
422
|
updated(changedProperties: PropertyValues<this>): void;
|
|
425
423
|
/** @internal Called when a containing fieldset is disabled. */
|
|
426
|
-
formDisabledCallback(
|
|
424
|
+
formDisabledCallback(): void;
|
|
427
425
|
/** @internal Called when the form is reset. */
|
|
428
426
|
formResetCallback(): void;
|
|
429
427
|
/** Gets an array of radio items slotted into the radio. */
|
|
430
428
|
private getItems;
|
|
431
|
-
private handleHostInvalid;
|
|
432
429
|
private handleGroupClick;
|
|
433
430
|
private handleGroupKeyDown;
|
|
434
431
|
/**
|
|
@@ -128,9 +128,8 @@ var radio_item_styles_default = css`
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
:host(:focus-visible:not(:state(disabled))) #visual-box {
|
|
131
|
-
outline: var(--sigvelo-
|
|
132
|
-
|
|
133
|
-
outline-offset: var(--sigvelo-border-width);
|
|
131
|
+
outline: var(--sigvelo-focus-ring);
|
|
132
|
+
outline-offset: var(--sigvelo-focus-offset);
|
|
134
133
|
}
|
|
135
134
|
|
|
136
135
|
:host(:state(disabled)) {
|
|
@@ -330,15 +330,13 @@ declare class SigveloRating extends SigveloFormControlElement {
|
|
|
330
330
|
disconnectedCallback(): void;
|
|
331
331
|
firstUpdated(): void;
|
|
332
332
|
updated(changedProperties: PropertyValues<this>): void;
|
|
333
|
-
|
|
334
|
-
formDisabledCallback(isDisabled: boolean): void;
|
|
333
|
+
formDisabledCallback(): void;
|
|
335
334
|
/** @internal Called when the form is reset. */
|
|
336
335
|
formResetCallback(): void;
|
|
337
336
|
/** Clamps a number to min/max while ensuring it's a valid step interval. */
|
|
338
337
|
private clampAndCeilToStep;
|
|
339
338
|
private handleBlur;
|
|
340
339
|
private handleFocus;
|
|
341
|
-
private handleHostInvalid;
|
|
342
340
|
private handleKeyDown;
|
|
343
341
|
private handleLabelPointerDown;
|
|
344
342
|
private setValueFromCoordinates;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Localize } from "./utilities/localize.js";
|
|
2
1
|
import { t as __decorate } from "./decorate-DcF3lt7P.js";
|
|
2
|
+
import { Localize } from "./utilities/localize.js";
|
|
3
3
|
import { css, html } from "lit";
|
|
4
4
|
import { property, query, state } from "lit/decorators.js";
|
|
5
5
|
import hostStyles from "@mcp-b/wc-support/styles/host.styles";
|
|
@@ -436,11 +436,13 @@ var SigveloRating = class extends SigveloFormControlElement {
|
|
|
436
436
|
}
|
|
437
437
|
connectedCallback() {
|
|
438
438
|
super.connectedCallback();
|
|
439
|
-
this.
|
|
439
|
+
this.draggableRating?.toggle(!(this.effectiveDisabled || this.readonly));
|
|
440
440
|
}
|
|
441
441
|
disconnectedCallback() {
|
|
442
442
|
super.disconnectedCallback();
|
|
443
|
-
this.
|
|
443
|
+
this.draggableRating?.stop();
|
|
444
|
+
this.didDragOverOthers = false;
|
|
445
|
+
this.valueWhenDraggingStarted = void 0;
|
|
444
446
|
}
|
|
445
447
|
firstUpdated() {
|
|
446
448
|
this.draggableRating = new DraggableElement(this.rating, {
|
|
@@ -454,7 +456,7 @@ var SigveloRating = class extends SigveloFormControlElement {
|
|
|
454
456
|
this.setValueFromCoordinates(x);
|
|
455
457
|
if (this.value !== this.valueWhenDraggingStarted) this.didDragOverOthers = true;
|
|
456
458
|
},
|
|
457
|
-
stop: () => {
|
|
459
|
+
stop: (_x, _y, canceled) => {
|
|
458
460
|
if (this.value !== this.valueWhenDraggingStarted) {
|
|
459
461
|
this.dispatchEvent(new SigveloChangeEvent());
|
|
460
462
|
this.dispatchEvent(new Event("change", {
|
|
@@ -463,7 +465,7 @@ var SigveloRating = class extends SigveloFormControlElement {
|
|
|
463
465
|
}));
|
|
464
466
|
this.hadUserInteraction = true;
|
|
465
467
|
}
|
|
466
|
-
if (this.value === this.valueWhenDraggingStarted && !this.didDragOverOthers) this.value = 0;
|
|
468
|
+
if (!canceled && this.value === this.valueWhenDraggingStarted && !this.didDragOverOthers) this.value = 0;
|
|
467
469
|
this.didDragOverOthers = false;
|
|
468
470
|
this.valueWhenDraggingStarted = void 0;
|
|
469
471
|
}
|
|
@@ -476,26 +478,21 @@ var SigveloRating = class extends SigveloFormControlElement {
|
|
|
476
478
|
this.internals.setFormValue(String(this.value));
|
|
477
479
|
}
|
|
478
480
|
if (changedProperties.has("max")) this.value = clamp(this.value, 0, this.max);
|
|
479
|
-
if (changedProperties.has("disabled")) this.customStates.set("disabled", this.
|
|
480
|
-
if (changedProperties.has("disabled") || changedProperties.has("readonly")) this.draggableRating.toggle(!(this.
|
|
481
|
-
if (this.hadUserInteraction || this.wasSubmitted) {
|
|
482
|
-
this.customStates.set("user-invalid", this.isInvalid);
|
|
483
|
-
this.customStates.set("user-valid", !this.isInvalid);
|
|
484
|
-
} else {
|
|
485
|
-
this.customStates.set("user-invalid", false);
|
|
486
|
-
this.customStates.set("user-valid", false);
|
|
487
|
-
}
|
|
481
|
+
if (changedProperties.has("disabled")) this.customStates.set("disabled", this.effectiveDisabled);
|
|
482
|
+
if (changedProperties.has("disabled") || changedProperties.has("readonly")) this.draggableRating.toggle(!(this.effectiveDisabled || this.readonly));
|
|
488
483
|
}
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
this.
|
|
484
|
+
formDisabledCallback() {
|
|
485
|
+
super.formDisabledCallback();
|
|
486
|
+
this.draggableRating?.toggle(!(this.effectiveDisabled || this.readonly));
|
|
487
|
+
if (this.effectiveDisabled) {
|
|
488
|
+
this.didDragOverOthers = false;
|
|
489
|
+
this.valueWhenDraggingStarted = void 0;
|
|
490
|
+
}
|
|
492
491
|
}
|
|
493
492
|
/** @internal Called when the form is reset. */
|
|
494
493
|
formResetCallback() {
|
|
495
494
|
this.value = parseFloat(this.getAttribute("value") ?? "0");
|
|
496
|
-
|
|
497
|
-
this.hadUserInteraction = false;
|
|
498
|
-
this.wasSubmitted = false;
|
|
495
|
+
super.formResetCallback();
|
|
499
496
|
}
|
|
500
497
|
/** Clamps a number to min/max while ensuring it's a valid step interval. */
|
|
501
498
|
clampAndCeilToStep(value) {
|
|
@@ -512,14 +509,11 @@ var SigveloRating = class extends SigveloFormControlElement {
|
|
|
512
509
|
this.customStates.set("focused", true);
|
|
513
510
|
this.dispatchEvent(new SigveloFocusEvent());
|
|
514
511
|
}
|
|
515
|
-
handleHostInvalid() {
|
|
516
|
-
this.wasSubmitted = true;
|
|
517
|
-
}
|
|
518
512
|
handleKeyDown(event) {
|
|
519
513
|
const isRtl = this.localize.dir() === "rtl";
|
|
520
514
|
const oldValue = this.value;
|
|
521
515
|
let newValue = this.value;
|
|
522
|
-
if (this.
|
|
516
|
+
if (this.effectiveDisabled || this.readonly) return;
|
|
523
517
|
if (event.key === "ArrowUp" || event.key === (isRtl ? "ArrowLeft" : "ArrowRight")) {
|
|
524
518
|
event.preventDefault();
|
|
525
519
|
newValue = this.clampAndCeilToStep(newValue + this.step);
|
|
@@ -557,18 +551,14 @@ var SigveloRating = class extends SigveloFormControlElement {
|
|
|
557
551
|
}));
|
|
558
552
|
this.hadUserInteraction = true;
|
|
559
553
|
}
|
|
560
|
-
if (event.key === "Enter"
|
|
561
|
-
const submitter = [...this.internals.form.elements].find((el) => {
|
|
562
|
-
return ["button", "input"].includes(el.localName) && el.type === "submit";
|
|
563
|
-
});
|
|
564
|
-
this.internals.form.requestSubmit(submitter);
|
|
565
|
-
}
|
|
554
|
+
if (event.key === "Enter") this.submitAssociatedForm();
|
|
566
555
|
}
|
|
567
556
|
handleLabelPointerDown(event) {
|
|
568
557
|
event.preventDefault();
|
|
569
|
-
if (!this.
|
|
558
|
+
if (!this.effectiveDisabled) this.rating.focus();
|
|
570
559
|
}
|
|
571
560
|
setValueFromCoordinates(x) {
|
|
561
|
+
if (this.effectiveDisabled || this.readonly) return;
|
|
572
562
|
const isRtl = this.localize.dir() === "rtl";
|
|
573
563
|
const oldValue = this.value;
|
|
574
564
|
const { right, left, width } = this.ratingBoundingClientRect;
|
|
@@ -659,19 +649,19 @@ var SigveloRating = class extends SigveloFormControlElement {
|
|
|
659
649
|
md: this.size === "md",
|
|
660
650
|
lg: this.size === "lg",
|
|
661
651
|
xl: this.size === "xl",
|
|
662
|
-
disabled: this.
|
|
652
|
+
disabled: this.effectiveDisabled,
|
|
663
653
|
readonly: this.readonly
|
|
664
654
|
})}
|
|
665
655
|
role="slider"
|
|
666
656
|
aria-labelledby="label"
|
|
667
657
|
aria-describedby="description"
|
|
668
|
-
aria-disabled=${this.
|
|
658
|
+
aria-disabled=${this.effectiveDisabled ? "true" : "false"}
|
|
669
659
|
aria-readonly=${this.readonly ? "true" : "false"}
|
|
670
660
|
aria-valuemin="0"
|
|
671
661
|
aria-valuenow=${this.value}
|
|
672
662
|
aria-valuetext="${this.localize.term("numberOfTotal", this.value, this.max)}"
|
|
673
663
|
aria-valuemax=${this.max}
|
|
674
|
-
tabindex=${this.
|
|
664
|
+
tabindex=${this.effectiveDisabled || this.readonly ? "-1" : "0"}
|
|
675
665
|
@focus=${this.handleFocus}
|
|
676
666
|
@blur=${this.handleBlur}
|
|
677
667
|
@keydown=${this.handleKeyDown}
|
|
@@ -206,7 +206,7 @@ var SigveloResizeObserver = class extends SigveloElement {
|
|
|
206
206
|
/** Starts or restarts the resize observer. */
|
|
207
207
|
startObserver() {
|
|
208
208
|
this.stopObserver();
|
|
209
|
-
if (this.disabled) return;
|
|
209
|
+
if (!this.isConnected || this.disabled) return;
|
|
210
210
|
this.resizeObserver = new ResizeObserver((entries) => {
|
|
211
211
|
entries.forEach((entry) => {
|
|
212
212
|
const resizeEvent = new SigveloResizeEvent({ entry });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Localize } from "./utilities/localize.js";
|
|
2
1
|
import { t as __decorate } from "./decorate-DcF3lt7P.js";
|
|
2
|
+
import { Localize } from "./utilities/localize.js";
|
|
3
3
|
import { css, html } from "lit";
|
|
4
4
|
import { property, query, state } from "lit/decorators.js";
|
|
5
5
|
import hostStyles from "@mcp-b/wc-support/styles/host.styles";
|
|
@@ -23,6 +23,15 @@ var search_list_styles_default = css`
|
|
|
23
23
|
width: 100%;
|
|
24
24
|
gap: 1em;
|
|
25
25
|
}
|
|
26
|
+
|
|
27
|
+
/*
|
|
28
|
+
* Filtered-out items are marked with the hidden attribute. The browser's own rule for that attribute only reaches
|
|
29
|
+
* the HTML namespace, and an item here is documented as "just about any element" — a marked SVG item would stay on
|
|
30
|
+
* screen — so the list hides its own items rather than leaving it to the user agent.
|
|
31
|
+
*/
|
|
32
|
+
#items slot::slotted([hidden]) {
|
|
33
|
+
display: none;
|
|
34
|
+
}
|
|
26
35
|
`;
|
|
27
36
|
//#endregion
|
|
28
37
|
//#region src/components/search-list/search-list.ts
|
|
@@ -749,7 +758,7 @@ var SigveloSearchList = class extends SigveloElement {
|
|
|
749
758
|
this.items = [];
|
|
750
759
|
this.localize = new Localize(this);
|
|
751
760
|
this.query = "";
|
|
752
|
-
this.
|
|
761
|
+
this.hasVisibleItems = false;
|
|
753
762
|
this.isInitial = false;
|
|
754
763
|
this.resultsMessage = "";
|
|
755
764
|
this.match = "exact";
|
|
@@ -790,7 +799,7 @@ var SigveloSearchList = class extends SigveloElement {
|
|
|
790
799
|
}
|
|
791
800
|
}
|
|
792
801
|
if (changedProperties.has("match")) this.updateResults();
|
|
793
|
-
if (changedProperties.has("
|
|
802
|
+
if (changedProperties.has("hasVisibleItems") || changedProperties.has("query")) this.customStates.set("empty", this.query !== "" && !this.hasVisibleItems);
|
|
794
803
|
if (changedProperties.has("isInitial")) this.customStates.set("initial", this.isInitial);
|
|
795
804
|
}
|
|
796
805
|
/** Gets the controller or returns `null` if one can't be found. */
|
|
@@ -817,7 +826,7 @@ var SigveloSearchList = class extends SigveloElement {
|
|
|
817
826
|
let wasWarned = false;
|
|
818
827
|
this.isInitial = !hasQuery && this.slotsWithContent.has("initial");
|
|
819
828
|
if (!this.isInitial) this.items.forEach((item) => {
|
|
820
|
-
const searchableContent = `${item.textContent || ""} ${item.
|
|
829
|
+
const searchableContent = `${item.textContent || ""} ${item.getAttribute("data-keywords") || ""}`;
|
|
821
830
|
if (hasQuery) {
|
|
822
831
|
let isMatch = false;
|
|
823
832
|
if (this.match === "exact") isMatch = exactSearch(this.query, searchableContent);
|
|
@@ -830,11 +839,11 @@ var SigveloSearchList = class extends SigveloElement {
|
|
|
830
839
|
}
|
|
831
840
|
isMatch = exactSearch(this.query, searchableContent);
|
|
832
841
|
}
|
|
833
|
-
item.hidden
|
|
842
|
+
item.toggleAttribute("hidden", !isMatch);
|
|
834
843
|
if (isMatch) numResults++;
|
|
835
|
-
} else item.hidden
|
|
844
|
+
} else item.removeAttribute("hidden");
|
|
836
845
|
});
|
|
837
|
-
this.
|
|
846
|
+
this.hasVisibleItems = this.isInitial ? true : this.items.some((item) => !item.hasAttribute("hidden"));
|
|
838
847
|
clearTimeout(this.resultsTimeout);
|
|
839
848
|
this.resultsTimeout = setTimeout(() => {
|
|
840
849
|
if (this.isInitial) this.resultsMessage = "";
|
|
@@ -861,17 +870,17 @@ var SigveloSearchList = class extends SigveloElement {
|
|
|
861
870
|
<div id="results" class="vh" role="region" aria-live="polite">${this.resultsMessage}</div>
|
|
862
871
|
|
|
863
872
|
<div id="items" part="items" ?hidden=${showInitial}>
|
|
864
|
-
<slot @slotchange=${this.handleDefaultSlotChange} ?hidden=${!this.
|
|
873
|
+
<slot @slotchange=${this.handleDefaultSlotChange} ?hidden=${!this.hasVisibleItems}></slot>
|
|
865
874
|
</div>
|
|
866
875
|
|
|
867
|
-
<slot name="empty" ?hidden=${this.
|
|
876
|
+
<slot name="empty" ?hidden=${this.hasVisibleItems || showInitial}></slot>
|
|
868
877
|
<slot name="initial" ?hidden=${!showInitial}></slot>
|
|
869
878
|
`;
|
|
870
879
|
}
|
|
871
880
|
};
|
|
872
881
|
__decorate([query("#results")], SigveloSearchList.prototype, "results", void 0);
|
|
873
882
|
__decorate([state()], SigveloSearchList.prototype, "query", void 0);
|
|
874
|
-
__decorate([state()], SigveloSearchList.prototype, "
|
|
883
|
+
__decorate([state()], SigveloSearchList.prototype, "hasVisibleItems", void 0);
|
|
875
884
|
__decorate([state()], SigveloSearchList.prototype, "isInitial", void 0);
|
|
876
885
|
__decorate([state()], SigveloSearchList.prototype, "resultsMessage", void 0);
|
|
877
886
|
__decorate([property({ reflect: true })], SigveloSearchList.prototype, "controller", void 0);
|
|
@@ -722,13 +722,23 @@ import { SigveloElement } from "@mcp-b/wc-support/base/sigvelo-element";
|
|
|
722
722
|
declare class SigveloSearchList extends SigveloElement {
|
|
723
723
|
static observeSlots: boolean;
|
|
724
724
|
static styles: CSSResultGroup;
|
|
725
|
+
/**
|
|
726
|
+
* Items are whatever the consumer slotted in — "just about any element", including SVG. That rules out anything
|
|
727
|
+
* `HTMLElement`-only when filtering them: `dataset` and `hidden` both exist on `HTMLElement` but not on `Element`,
|
|
728
|
+
* and writing `hidden` on an SVG item only creates a dead expando. Filtering goes through the `data-keywords` and
|
|
729
|
+
* `hidden` content attributes instead, which every element carries, and the stylesheet hides the marked ones.
|
|
730
|
+
*/
|
|
725
731
|
private items;
|
|
726
732
|
private debounceTimeout;
|
|
727
733
|
private localize;
|
|
728
734
|
private resultsTimeout;
|
|
729
735
|
results: HTMLElement;
|
|
730
736
|
query: string;
|
|
731
|
-
|
|
737
|
+
/**
|
|
738
|
+
* Whether any slotted item survived the current filter. Not the `empty` state — that one also needs a query.
|
|
739
|
+
* Public like its siblings because Lit keys `changedProperties` on `keyof this`, which excludes private members.
|
|
740
|
+
*/
|
|
741
|
+
hasVisibleItems: boolean;
|
|
732
742
|
isInitial: boolean;
|
|
733
743
|
resultsMessage: string;
|
|
734
744
|
/**
|
|
@@ -472,19 +472,14 @@ declare class SigveloSelect extends SigveloFormControlElement {
|
|
|
472
472
|
autocomplete: string;
|
|
473
473
|
/** Sets the enter key label on virtual keyboards. */
|
|
474
474
|
enterkeyhint: "enter" | "done" | "go" | "next" | "previous" | "search" | "send";
|
|
475
|
-
connectedCallback(): void;
|
|
476
|
-
disconnectedCallback(): void;
|
|
477
475
|
firstUpdated(): void;
|
|
478
476
|
updated(changedProperties: PropertyValues<this>): void;
|
|
479
|
-
/** @internal Called when a containing fieldset is disabled. */
|
|
480
|
-
formDisabledCallback(isDisabled: boolean): void;
|
|
481
477
|
/** @internal Called when the form is reset. */
|
|
482
478
|
formResetCallback(): void;
|
|
483
479
|
private handleBlur;
|
|
484
480
|
private handleVisualBoxPointerDown;
|
|
485
481
|
private handleChange;
|
|
486
482
|
private handleFocus;
|
|
487
|
-
private handleHostInvalid;
|
|
488
483
|
private handleInput;
|
|
489
484
|
private syncOptions;
|
|
490
485
|
/** Sets the form control's validity */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { t as __decorate } from "./decorate-DcF3lt7P.js";
|
|
2
|
+
import { mirrorNativeValidity } from "./utilities/form-validity.js";
|
|
2
3
|
import { css, html } from "lit";
|
|
3
4
|
import { property, query, state } from "lit/decorators.js";
|
|
4
5
|
import hostStyles from "@mcp-b/wc-support/styles/host.styles";
|
|
@@ -473,14 +474,6 @@ var SigveloSelect = class extends SigveloFormControlElement {
|
|
|
473
474
|
get focusableAnchor() {
|
|
474
475
|
return this.textBox;
|
|
475
476
|
}
|
|
476
|
-
connectedCallback() {
|
|
477
|
-
super.connectedCallback();
|
|
478
|
-
this.addEventListener("invalid", this.handleHostInvalid);
|
|
479
|
-
}
|
|
480
|
-
disconnectedCallback() {
|
|
481
|
-
super.disconnectedCallback();
|
|
482
|
-
this.removeEventListener("invalid", this.handleHostInvalid);
|
|
483
|
-
}
|
|
484
477
|
firstUpdated() {
|
|
485
478
|
new MutationObserver(() => this.syncOptions()).observe(this, {
|
|
486
479
|
subtree: true,
|
|
@@ -495,24 +488,11 @@ var SigveloSelect = class extends SigveloFormControlElement {
|
|
|
495
488
|
this.customStates.set("blank", this.value === "");
|
|
496
489
|
this.internals.setFormValue(this.value);
|
|
497
490
|
}
|
|
498
|
-
if (changedProperties.has("disabled")) this.customStates.set("disabled", this.
|
|
499
|
-
if (this.hadUserInteraction || this.wasSubmitted) {
|
|
500
|
-
this.customStates.set("user-invalid", this.isInvalid);
|
|
501
|
-
this.customStates.set("user-valid", !this.isInvalid);
|
|
502
|
-
} else {
|
|
503
|
-
this.customStates.set("user-invalid", false);
|
|
504
|
-
this.customStates.set("user-valid", false);
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
/** @internal Called when a containing fieldset is disabled. */
|
|
508
|
-
formDisabledCallback(isDisabled) {
|
|
509
|
-
this.disabled = isDisabled;
|
|
491
|
+
if (changedProperties.has("disabled")) this.customStates.set("disabled", this.effectiveDisabled);
|
|
510
492
|
}
|
|
511
493
|
/** @internal Called when the form is reset. */
|
|
512
494
|
formResetCallback() {
|
|
513
|
-
|
|
514
|
-
this.hadUserInteraction = false;
|
|
515
|
-
this.wasSubmitted = false;
|
|
495
|
+
super.formResetCallback();
|
|
516
496
|
this.value = this.getAttribute("value") ?? "";
|
|
517
497
|
}
|
|
518
498
|
handleBlur() {
|
|
@@ -541,9 +521,6 @@ var SigveloSelect = class extends SigveloFormControlElement {
|
|
|
541
521
|
this.customStates.set("focused", true);
|
|
542
522
|
this.dispatchEvent(new SigveloFocusEvent());
|
|
543
523
|
}
|
|
544
|
-
handleHostInvalid() {
|
|
545
|
-
this.wasSubmitted = true;
|
|
546
|
-
}
|
|
547
524
|
async handleInput() {
|
|
548
525
|
this.value = this.textBox.value;
|
|
549
526
|
await this.updateComplete;
|
|
@@ -560,21 +537,8 @@ var SigveloSelect = class extends SigveloFormControlElement {
|
|
|
560
537
|
/** Sets the form control's validity */
|
|
561
538
|
async updateValidity() {
|
|
562
539
|
await this.updateComplete;
|
|
563
|
-
const
|
|
564
|
-
|
|
565
|
-
const flags = {
|
|
566
|
-
badInput: this.textBox.validity.badInput,
|
|
567
|
-
customError: hasCustomValidity,
|
|
568
|
-
patternMismatch: this.textBox.validity.patternMismatch,
|
|
569
|
-
rangeOverflow: this.textBox.validity.rangeOverflow,
|
|
570
|
-
rangeUnderflow: this.textBox.validity.rangeUnderflow,
|
|
571
|
-
stepMismatch: this.textBox.validity.stepMismatch,
|
|
572
|
-
tooLong: this.textBox.validity.tooLong,
|
|
573
|
-
tooShort: this.textBox.validity.tooShort,
|
|
574
|
-
typeMismatch: this.textBox.validity.typeMismatch,
|
|
575
|
-
valueMissing: this.textBox.validity.valueMissing
|
|
576
|
-
};
|
|
577
|
-
this.isInvalid = hasCustomValidity ? true : !this.textBox.validity.valid;
|
|
540
|
+
const { flags, validationMessage, isInvalid } = mirrorNativeValidity(this.textBox, this.getCustomValidity());
|
|
541
|
+
this.isInvalid = isInvalid;
|
|
578
542
|
this.internals.setValidity(flags, validationMessage, this.focusableAnchor);
|
|
579
543
|
}
|
|
580
544
|
/** Sets focus to the select. */
|
|
@@ -614,7 +578,7 @@ var SigveloSelect = class extends SigveloFormControlElement {
|
|
|
614
578
|
lg: this.size === "lg",
|
|
615
579
|
xl: this.size === "xl",
|
|
616
580
|
pill: this.pill,
|
|
617
|
-
disabled: this.
|
|
581
|
+
disabled: this.effectiveDisabled
|
|
618
582
|
})}
|
|
619
583
|
@pointerdown=${this.handleVisualBoxPointerDown}
|
|
620
584
|
>
|
|
@@ -624,7 +588,7 @@ var SigveloSelect = class extends SigveloFormControlElement {
|
|
|
624
588
|
id="text-box"
|
|
625
589
|
part="text-box"
|
|
626
590
|
?autofocus=${this.autofocus}
|
|
627
|
-
?disabled=${this.
|
|
591
|
+
?disabled=${this.effectiveDisabled}
|
|
628
592
|
?readonly=${this.readonly}
|
|
629
593
|
?required=${this.required}
|
|
630
594
|
.value=${live(this.value)}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { Localize } from "./utilities/localize.js";
|
|
2
1
|
import { t as __decorate } from "./decorate-DcF3lt7P.js";
|
|
2
|
+
import { Localize } from "./utilities/localize.js";
|
|
3
|
+
import { showCopyFeedback } from "./utilities/copy-feedback.js";
|
|
3
4
|
import { t as copy_styles_default } from "./copy.styles-DWGvGNTP.js";
|
|
4
5
|
import { css, html } from "lit";
|
|
5
6
|
import { property, query } from "lit/decorators.js";
|
|
6
7
|
import hostStyles from "@mcp-b/wc-support/styles/host.styles";
|
|
7
8
|
import { SigveloElement } from "@mcp-b/wc-support/base/sigvelo-element";
|
|
8
|
-
import { animateWithClass } from "@mcp-b/wc-support/utilities/animate";
|
|
9
|
-
import { computePosition, flip } from "@floating-ui/dom";
|
|
10
9
|
//#region src/components/share/share.styles.ts
|
|
11
10
|
var share_styles_default = css`
|
|
12
11
|
sigvelo-button,
|
|
@@ -185,22 +184,7 @@ var SigveloShare = class extends SigveloElement {
|
|
|
185
184
|
}
|
|
186
185
|
/** Shows copy feedback with an animation */
|
|
187
186
|
async showFeedback(message) {
|
|
188
|
-
|
|
189
|
-
this.feedback.textContent = message;
|
|
190
|
-
this.feedback.hidden = false;
|
|
191
|
-
this.feedback.showPopover();
|
|
192
|
-
computePosition(this, this.feedback, {
|
|
193
|
-
placement: this.feedbackPlacement,
|
|
194
|
-
middleware: [flip()]
|
|
195
|
-
}).then(({ x, y }) => {
|
|
196
|
-
Object.assign(this.feedback.style, {
|
|
197
|
-
left: `${x}px`,
|
|
198
|
-
top: `${y}px`
|
|
199
|
-
});
|
|
200
|
-
});
|
|
201
|
-
await animateWithClass(this.feedback, "show");
|
|
202
|
-
this.feedback.hidden = true;
|
|
203
|
-
this.feedback.hidePopover();
|
|
187
|
+
await showCopyFeedback(this, this.feedback, message, this.feedbackPlacement);
|
|
204
188
|
}
|
|
205
189
|
render() {
|
|
206
190
|
return html`
|
|
@@ -404,6 +404,7 @@ declare class SigveloSlideActivator extends SigveloElement {
|
|
|
404
404
|
disabled: boolean;
|
|
405
405
|
/** Draws attention to the track by adding a subtle animation. */
|
|
406
406
|
attention: "shimmer";
|
|
407
|
+
connectedCallback(): void;
|
|
407
408
|
disconnectedCallback(): void;
|
|
408
409
|
firstUpdated(): void;
|
|
409
410
|
updated(changedProperties: PropertyValues<this>): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Localize } from "./utilities/localize.js";
|
|
2
1
|
import "./icon-Df0H7LYB.js";
|
|
3
2
|
import { t as __decorate } from "./decorate-DcF3lt7P.js";
|
|
3
|
+
import { Localize } from "./utilities/localize.js";
|
|
4
4
|
import { css, html } from "lit";
|
|
5
5
|
import { property, query, state } from "lit/decorators.js";
|
|
6
6
|
import hostStyles from "@mcp-b/wc-support/styles/host.styles";
|
|
@@ -608,9 +608,16 @@ var SigveloSlideActivator = class extends SigveloElement {
|
|
|
608
608
|
static {
|
|
609
609
|
this.styles = [hostStyles, slide_activator_styles_default];
|
|
610
610
|
}
|
|
611
|
+
connectedCallback() {
|
|
612
|
+
super.connectedCallback();
|
|
613
|
+
this.draggableThumb?.toggle(!this.disabled);
|
|
614
|
+
}
|
|
611
615
|
disconnectedCallback() {
|
|
612
616
|
super.disconnectedCallback();
|
|
613
617
|
this.cleanupTimers();
|
|
618
|
+
this.draggableThumb?.stop();
|
|
619
|
+
this.isDragging = false;
|
|
620
|
+
if (!this.activated) this.setThumbPosition(0);
|
|
614
621
|
}
|
|
615
622
|
firstUpdated() {
|
|
616
623
|
this.draggableThumb = new DraggableElement(this.thumb, {
|
|
@@ -623,8 +630,8 @@ var SigveloSlideActivator = class extends SigveloElement {
|
|
|
623
630
|
move: (x) => {
|
|
624
631
|
this.handleDrag(x);
|
|
625
632
|
},
|
|
626
|
-
stop: (x) => {
|
|
627
|
-
this.handleDrag(x);
|
|
633
|
+
stop: (x, _y, canceled) => {
|
|
634
|
+
if (!canceled) this.handleDrag(x);
|
|
628
635
|
this.isDragging = false;
|
|
629
636
|
if (!this.activated) this.setThumbPosition(0);
|
|
630
637
|
}
|