@vonage/vivid 5.30.0 → 5.32.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/bundled/anchored.cjs +1 -1
- package/bundled/anchored.js +25 -26
- package/bundled/calendar-picker.template.cjs +1 -1
- package/bundled/calendar-picker.template.js +5 -5
- package/bundled/char-count.cjs +2 -2
- package/bundled/char-count.js +2 -3
- package/bundled/definition25.cjs +4 -4
- package/bundled/definition25.js +4 -4
- package/bundled/definition4.cjs +17 -10
- package/bundled/definition4.js +17 -10
- package/bundled/form-element.cjs +1 -1
- package/bundled/form-element.js +3 -4
- package/bundled/localized.cjs +1 -1
- package/bundled/localized.js +11 -10
- package/bundled/picker-field.template.cjs +1 -1
- package/bundled/picker-field.template.js +12 -17
- package/bundled/text-field.cjs +1 -1
- package/bundled/text-field.js +1 -1
- package/bundled/time-selection-picker.template.cjs +1 -1
- package/bundled/time-selection-picker.template.js +7 -9
- package/bundled/vivid-element.cjs +1 -1
- package/bundled/vivid-element.js +36 -8
- package/bundled/with-error-text.cjs +1 -1
- package/bundled/with-error-text.js +7 -9
- package/custom-elements.json +237 -1956
- package/lib/accordion-item/accordion-item.d.ts +13 -7
- package/lib/action-group/action-group.d.ts +13 -7
- package/lib/alert/alert.d.ts +26 -14
- package/lib/audio-player/audio-player.d.ts +13 -7
- package/lib/avatar/avatar.d.ts +13 -7
- package/lib/badge/badge.d.ts +13 -7
- package/lib/banner/banner.d.ts +39 -21
- package/lib/breadcrumb/breadcrumb.d.ts +13 -7
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +13 -7
- package/lib/button/button.d.ts +39 -21
- package/lib/calendar-event/calendar-event.d.ts +13 -7
- package/lib/card/card.d.ts +13 -7
- package/lib/checkbox/checkbox.d.ts +84 -48
- package/lib/color-picker/color-picker.d.ts +98 -56
- package/lib/combobox/combobox.d.ts +98 -56
- package/lib/country-group/country-group.d.ts +26 -14
- package/lib/data-grid/data-grid-cell.d.ts +26 -14
- package/lib/data-grid/data-grid-row.d.ts +13 -7
- package/lib/date-picker/date-picker.d.ts +162 -114
- package/lib/date-range-picker/date-range-picker.d.ts +82 -58
- package/lib/date-time-picker/date-time-picker.d.ts +164 -116
- package/lib/dial-pad/dial-pad.d.ts +13 -7
- package/lib/dialog/dialog.d.ts +26 -14
- package/lib/divider/divider.d.ts +13 -7
- package/lib/fab/fab.d.ts +13 -7
- package/lib/file-picker/file-picker.d.ts +98 -56
- package/lib/header/header.d.ts +13 -7
- package/lib/listbox/listbox.d.ts +41 -23
- package/lib/menu/menu.d.ts +30 -18
- package/lib/menu-item/menu-item.d.ts +39 -21
- package/lib/nav/nav.d.ts +13 -7
- package/lib/nav-disclosure/nav-disclosure.d.ts +26 -14
- package/lib/nav-item/nav-item.d.ts +28 -16
- package/lib/note/note.d.ts +13 -7
- package/lib/number-field/number-field.d.ts +124 -70
- package/lib/optgroup/optgroup.d.ts +13 -7
- package/lib/option/option.d.ts +26 -14
- package/lib/pagination/pagination.d.ts +13 -7
- package/lib/popover/popover.d.ts +26 -14
- package/lib/progress/progress.d.ts +13 -7
- package/lib/progress-ring/progress-ring.d.ts +13 -7
- package/lib/radio/radio.d.ts +45 -27
- package/lib/radio-group/radio-group.d.ts +13 -7
- package/lib/range-slider/range-slider.d.ts +40 -22
- package/lib/rich-text-editor/rich-text-editor.d.ts +30 -18
- package/lib/rich-text-editor/rte/feature.d.ts +0 -1
- package/lib/rich-text-editor/rte/features/base.d.ts +9 -0
- package/lib/rich-text-editor/rte/features/bold.d.ts +5 -1
- package/lib/rich-text-editor/rte/features/font-size-picker.d.ts +5 -1
- package/lib/rich-text-editor/rte/features/hard-break.d.ts +4 -0
- package/lib/rich-text-editor/rte/features/inline-image.d.ts +4 -0
- package/lib/rich-text-editor/rte/features/italic.d.ts +5 -1
- package/lib/rich-text-editor/rte/features/link.d.ts +5 -1
- package/lib/rich-text-editor/rte/features/list.d.ts +6 -0
- package/lib/rich-text-editor/rte/features/monospace.d.ts +5 -1
- package/lib/rich-text-editor/rte/features/strikethrough.d.ts +5 -1
- package/lib/rich-text-editor/rte/features/text-color-picker.d.ts +4 -1
- package/lib/rich-text-editor/rte/features/underline.d.ts +5 -1
- package/lib/rich-text-editor/rte/public-interface.d.ts +1 -1
- package/lib/searchable-select/option-tag.d.ts +13 -7
- package/lib/searchable-select/searchable-select.d.ts +124 -70
- package/lib/select/select.d.ts +124 -70
- package/lib/selectable-box/selectable-box.d.ts +13 -7
- package/lib/simple-color-picker/simple-color-picker.d.ts +31 -19
- package/lib/slider/slider.d.ts +39 -21
- package/lib/split-button/split-button.d.ts +39 -21
- package/lib/status/status.d.ts +13 -7
- package/lib/switch/switch.d.ts +26 -14
- package/lib/tab/tab.d.ts +39 -21
- package/lib/tab-panel/tab-panel.d.ts +13 -7
- package/lib/table/table-cell.d.ts +13 -7
- package/lib/table/table-header-cell.d.ts +13 -7
- package/lib/table/table-row.d.ts +13 -7
- package/lib/table/table-sorting-button.d.ts +26 -14
- package/lib/tag/tag.d.ts +39 -21
- package/lib/tag-group/tag-group.d.ts +13 -7
- package/lib/text-area/text-area.d.ts +112 -64
- package/lib/text-field/text-field.d.ts +125 -71
- package/lib/time-picker/time-picker.d.ts +82 -58
- package/lib/toggletip/toggletip.d.ts +30 -18
- package/lib/tooltip/tooltip.d.ts +30 -18
- package/lib/tree-item/tree-item.d.ts +26 -14
- package/lib/tree-view/tree-view.d.ts +13 -7
- package/lib/video-player/video-player.d.ts +13 -7
- package/listbox/index.cjs +1 -1
- package/listbox/index.js +3 -4
- package/nav-item/index.cjs +1 -1
- package/nav-item/index.js +5 -1
- package/number-field/index.cjs +1 -1
- package/number-field/index.js +1 -1
- package/package.json +10 -10
- package/rich-text-editor/index.cjs +1 -1
- package/rich-text-editor/index.js +176 -160
- package/shared/aria/aria-mixin.d.ts +11 -5
- package/shared/aria/delegates-aria.d.ts +13 -7
- package/shared/aria/host-semantics.d.ts +13 -7
- package/shared/color-picker/base-color-picker.d.ts +14 -8
- package/shared/deprecation/replaced-props.d.ts +12 -6
- package/shared/feedback/feedback-message.d.ts +13 -7
- package/shared/feedback/mixins.d.ts +26 -14
- package/shared/foundation/button/button.d.ts +26 -14
- package/shared/foundation/form-associated/form-associated.d.ts +26 -14
- package/shared/foundation/vivid-element/vivid-element.d.ts +43 -25
- package/shared/framework/reactive-controller.d.ts +12 -6
- package/shared/listbox/with-options-filter.d.ts +14 -8
- package/shared/listbox/with-options.d.ts +28 -16
- package/shared/patterns/affix.d.ts +26 -14
- package/shared/patterns/anchored.d.ts +34 -22
- package/shared/patterns/char-count/char-count.d.ts +14 -8
- package/shared/patterns/form-elements/form-element.d.ts +14 -8
- package/shared/patterns/form-elements/with-contextual-help.d.ts +14 -8
- package/shared/patterns/form-elements/with-error-text.d.ts +18 -12
- package/shared/patterns/form-elements/with-success-text.d.ts +13 -7
- package/shared/patterns/kbd-shortcut.d.ts +13 -7
- package/shared/patterns/linkable.d.ts +13 -7
- package/shared/patterns/localized.d.ts +30 -18
- package/shared/patterns/trapped-focus.d.ts +13 -7
- package/shared/picker-field/mixins/calendar-picker.d.ts +41 -29
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +41 -29
- package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.d.ts +13 -7
- package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +41 -29
- package/shared/picker-field/mixins/single-date-picker.d.ts +41 -29
- package/shared/picker-field/mixins/single-value-picker.d.ts +39 -27
- package/shared/picker-field/mixins/time-selection-picker.d.ts +43 -31
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +82 -58
- package/shared/picker-field/picker-field.d.ts +98 -57
- package/unbundled/anchored.cjs +39 -37
- package/unbundled/anchored.js +39 -37
- package/unbundled/calendar-picker.template.cjs +7 -5
- package/unbundled/calendar-picker.template.js +7 -5
- package/unbundled/char-count.cjs +3 -9
- package/unbundled/char-count.js +3 -9
- package/unbundled/definition2.cjs +4 -4
- package/unbundled/definition2.js +4 -4
- package/unbundled/definition5.cjs +17 -10
- package/unbundled/definition5.js +17 -10
- package/unbundled/definition50.cjs +3 -4
- package/unbundled/definition50.js +3 -4
- package/unbundled/definition52.cjs +6 -2
- package/unbundled/definition52.js +6 -2
- package/unbundled/definition55.cjs +1 -1
- package/unbundled/definition55.js +1 -1
- package/unbundled/definition63.cjs +73 -46
- package/unbundled/definition63.js +73 -46
- package/unbundled/form-element.cjs +3 -4
- package/unbundled/form-element.js +3 -4
- package/unbundled/localized.cjs +15 -11
- package/unbundled/localized.js +15 -11
- package/unbundled/picker-field.template.cjs +22 -24
- package/unbundled/picker-field.template.js +22 -24
- package/unbundled/text-field.cjs +1 -1
- package/unbundled/text-field.js +1 -1
- package/unbundled/time-selection-picker.template.cjs +10 -10
- package/unbundled/time-selection-picker.template.js +10 -10
- package/unbundled/vivid-element.cjs +65 -8
- package/unbundled/vivid-element.js +66 -9
- package/unbundled/with-error-text.cjs +11 -10
- package/unbundled/with-error-text.js +11 -10
- package/vivid.api.json +12 -12
|
@@ -38,18 +38,18 @@ var PickerField = class extends WithContextualHelp(WithFeedback(WithErrorText(Fo
|
|
|
38
38
|
constructor() {
|
|
39
39
|
super();
|
|
40
40
|
this.readOnly = false;
|
|
41
|
-
this
|
|
41
|
+
this._onFocusIn = () => {
|
|
42
42
|
this.$emit("focus", void 0, { bubbles: false });
|
|
43
43
|
};
|
|
44
|
-
this
|
|
44
|
+
this._onFocusOut = () => {
|
|
45
45
|
this.$emit("blur", void 0, { bubbles: false });
|
|
46
46
|
};
|
|
47
47
|
this.proxy = document.createElement("input");
|
|
48
|
-
this
|
|
48
|
+
this._localeChangeHandler = { handleChange: () => {
|
|
49
49
|
this._updatePresentationValue();
|
|
50
50
|
} };
|
|
51
51
|
this._popupOpen = false;
|
|
52
|
-
this
|
|
52
|
+
this._dismissOnClickOutside = (event) => {
|
|
53
53
|
if (!this._popupOpen) return;
|
|
54
54
|
const path = event.composedPath();
|
|
55
55
|
if (![this._dialogEl, this._pickerButtonEl].some((element) => path.includes(element))) this._closePopup(false);
|
|
@@ -60,37 +60,35 @@ var PickerField = class extends WithContextualHelp(WithFeedback(WithErrorText(Fo
|
|
|
60
60
|
/** @internal */
|
|
61
61
|
connectedCallback() {
|
|
62
62
|
super.connectedCallback();
|
|
63
|
-
document.addEventListener("click", this
|
|
64
|
-
this.addEventListener("focusin", this
|
|
65
|
-
this.addEventListener("focusout", this
|
|
66
|
-
this
|
|
63
|
+
document.addEventListener("click", this._dismissOnClickOutside);
|
|
64
|
+
this.addEventListener("focusin", this._onFocusIn);
|
|
65
|
+
this.addEventListener("focusout", this._onFocusOut);
|
|
66
|
+
this._startObservingLocaleChanges();
|
|
67
67
|
}
|
|
68
68
|
/** @internal */
|
|
69
69
|
disconnectedCallback() {
|
|
70
70
|
super.disconnectedCallback();
|
|
71
|
-
document.removeEventListener("click", this
|
|
72
|
-
this.removeEventListener("focusin", this
|
|
73
|
-
this.removeEventListener("focusout", this
|
|
74
|
-
this
|
|
71
|
+
document.removeEventListener("click", this._dismissOnClickOutside);
|
|
72
|
+
this.removeEventListener("focusin", this._onFocusIn);
|
|
73
|
+
this.removeEventListener("focusout", this._onFocusOut);
|
|
74
|
+
this._stopObservingLocaleChanges();
|
|
75
75
|
}
|
|
76
|
-
#onFocusIn;
|
|
77
|
-
#onFocusOut;
|
|
78
76
|
/** @internal */
|
|
79
77
|
validate() {
|
|
80
78
|
if (this.proxy) this.proxy.setCustomValidity(this._getCustomValidationError() ?? "");
|
|
81
79
|
super.validate(this._textFieldEl?.querySelector("input") ?? void 0);
|
|
82
80
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
this
|
|
87
|
-
this.#localeChangeObserver.observe(this, ExecutionContext.default);
|
|
81
|
+
/** @internal */
|
|
82
|
+
_startObservingLocaleChanges() {
|
|
83
|
+
this._localeChangeObserver = Observable.binding(() => this.locale, this._localeChangeHandler);
|
|
84
|
+
this._localeChangeObserver.observe(this, ExecutionContext.default);
|
|
88
85
|
}
|
|
89
|
-
|
|
90
|
-
|
|
86
|
+
/** @internal */
|
|
87
|
+
_stopObservingLocaleChanges() {
|
|
88
|
+
this._localeChangeObserver.dispose();
|
|
91
89
|
}
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
/** @internal */
|
|
91
|
+
_openPopupIfPossible() {
|
|
94
92
|
/* v8 ignore else -- @preserve */
|
|
95
93
|
if (!this.readOnly) this._popupOpen = true;
|
|
96
94
|
}
|
|
@@ -124,7 +122,7 @@ var PickerField = class extends WithContextualHelp(WithFeedback(WithErrorText(Fo
|
|
|
124
122
|
/** @internal */
|
|
125
123
|
_onPickerButtonClick() {
|
|
126
124
|
if (this._popupOpen) this._closePopup();
|
|
127
|
-
else this
|
|
125
|
+
else this._openPopupIfPossible();
|
|
128
126
|
}
|
|
129
127
|
/** @internal */
|
|
130
128
|
_onOkClick() {
|
package/unbundled/text-field.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/lib/text-field/text-field.scss?inline
|
|
2
|
-
var text_field_default = ".label-wrapper{align-items:center;gap:var(--label-wrapper-gap,4px);flex-direction:row;display:flex}.label-wrapper[hidden]{display:none}.label:not(slot),.label::slotted(label){flex:0 auto}:host{display:inline-block}.base{--_text-field-gutter-start:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 2.5);--_text-field-gutter-end:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 2.5);--_text-field-icon-size:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 2);--_text-field-block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2)));--_text-field-border-radius:8px;--_text-field-pill-border-radius:24px;grid-template-columns:min-content 1fr max-content;align-items:center;gap:4px;width:100%;display:inline-grid}.base.size-condensed{--_text-field-gutter-start:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 16)) / 2);--_text-field-gutter-end:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 16)) / 2);--_text-field-icon-size:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 8)) / 2);--_text-field-block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 8));--_text-field-border-radius:4px}.base{user-select:none}.base:not(.disabled){--_low-ink-color:var(--vvd-color-neutral-600)}.base.disabled{--_low-ink-color:var(--_appearance-color-text)}.label:not(slot),.label::slotted(label){font:var(--vvd-typography-base);grid-area:1/1/auto/4;box-sizing:initial!important;padding:initial!important;margin:initial!important;color:var(--vvd-color-canvas-text)!important}.char-count+.label:not(slot),.char-count+.label::slotted(label){grid-column:1/3}.char-count{color:var(--_low-ink-color);font:var(--vvd-typography-base)}.label-wrapper{grid-area:1/1/auto/4}.char-count+.label-wrapper{grid-column:1/3}.fieldset{background-color:var(--_appearance-color-fill);font:var(--vvd-typography-base);grid-column:1/4;align-items:center;padding-block:0;transition:color .2s,background-color .2s;display:flex;position:relative}.fieldset:after{border-radius:inherit;block-size:100%;box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);content:\"\";pointer-events:none;inline-size:100%;transition:box-shadow .2s;display:block;position:absolute}.fieldset:focus-visible{outline:none}.base>.fieldset{block-size:var(--_text-field-block-size)}.base:not(.shape-pill) .fieldset{border-radius:var(--_text-field-border-radius)}.base.shape-pill .fieldset{border-radius:var(--_text-field-pill-border-radius)}.wrapper{border-radius:inherit;block-size:100%;inline-size:100%}.control{border-radius:inherit;text-align:start}.control:not(slot),.control::slotted(input){font:inherit;text-align:inherit;outline:#0000;box-sizing:border-box!important;border-radius:inherit!important;width:100%!important;margin:initial!important;appearance:none!important;block-size:100%!important;color:inherit!important;padding-block:0!important;padding-inline:var(--_text-field-gutter-start) var(--_text-field-gutter-end)!important;background-color:#0000!important;border:0!important}.control:not(slot,:focus),.control::slotted(input:not(:focus)){text-overflow:ellipsis!important}.control:not(slot):disabled,.control::slotted(input:disabled){cursor:not-allowed!important;opacity:1!important;-webkit-text-fill-color:var(--_appearance-color-text)!important}.control:not(slot)::placeholder{opacity:1!important;-webkit-text-fill-color:var(--_low-ink-color)!important}.control::slotted(input:-webkit-autofill),.control:not(slot):-webkit-autofill{-webkit-box-shadow:0 0 0 1000px var(--_appearance-color-fill) inset;-webkit-text-fill-color:var(--_appearance-color-text)!important}.control::slotted(input:autofill),.control:not(slot):autofill{-webkit-box-shadow:0 0 0 1000px var(--_appearance-color-fill) inset;-webkit-text-fill-color:var(--_appearance-color-text)!important}.has-icon .control:not(slot),.has-icon .control::slotted(input){padding-inline-start:calc(var(--_text-field-icon-size) + var(--_text-field-gutter-start) * 2)!important}.icon{z-index:1;color:var(--_low-ink-color);font-size:var(--_text-field-icon-size);line-height:1;position:absolute;inset-block-start:50%;inset-inline-start:calc(100% + var(--_text-field-gutter-start));transform:translateY(-50%)}.leading-items-wrapper{position:relative}.base.no-leading .leading-items-wrapper{display:none}.action-items-wrapper{margin-inline-end:4px}.base:not(.action-items) .action-items-wrapper{display:none}@supports selector(:has(*)){.base:not(.has-activedescendant) .fieldset:has(.wrapper .control:focus-within):after{--focus-stroke-gap-color:transparent;box-shadow:0 0 0 4px color-mix(in sRGB, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px))}}@supports not selector(:has(*)){.base:not(.has-activedescendant) .wrapper:focus-within:after{box-shadow:0 0 0 4px color-mix(in sRGB, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px));--focus-stroke-gap-color:transparent;z-index:1;border-radius:inherit;content:\"\";pointer-events:none;display:block;position:absolute;inset:0}}:host([internal-part]) .fieldset{font:var(--vvd-typography-heading-4);background-color:#0000;line-height:1.1}:host([internal-part]) .fieldset:not(:focus-within):after{block-size:1px;inset-block-end:0}@supports selector(:has(*)){:host([internal-part]) .fieldset:has(.action-items-wrapper:focus-within):after{block-size:1px;inset-block-end:0}}:host([internal-part]) .control{text-align:center}slot[name=_mirrored-helper-text]{display:none}";
|
|
2
|
+
var text_field_default = ".label-wrapper{align-items:center;gap:var(--label-wrapper-gap,4px);flex-direction:row;display:flex}.label-wrapper[hidden]{display:none}.label:not(slot),.label::slotted(label){flex:0 auto}:host{display:inline-block}.base{--_text-field-gutter-start:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 2.5);--_text-field-gutter-end:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 2.5);--_text-field-icon-size:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 2);--_text-field-block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2)));--_text-field-border-radius:8px;--_text-field-pill-border-radius:24px;grid-template-columns:min-content 1fr max-content;align-items:center;gap:4px;width:100%;display:inline-grid}.base.size-condensed{--_text-field-gutter-start:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 16)) / 2);--_text-field-gutter-end:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 16)) / 2);--_text-field-icon-size:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 8)) / 2);--_text-field-block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 8));--_text-field-border-radius:4px}.base{user-select:none}.base:not(.disabled){--_low-ink-color:var(--vvd-color-neutral-600)}.base.disabled{--_low-ink-color:var(--_appearance-color-text)}.label:not(slot),.label::slotted(label){font:var(--vvd-typography-base);grid-area:1/1/auto/4;box-sizing:initial!important;padding:initial!important;margin:initial!important;color:var(--vvd-color-canvas-text)!important}.char-count+.label:not(slot),.char-count+.label::slotted(label){grid-column:1/3}.char-count{color:var(--_low-ink-color);font:var(--vvd-typography-base)}.label-wrapper{grid-area:1/1/auto/4}.char-count+.label-wrapper{grid-column:1/3}.fieldset{background-color:var(--_appearance-color-fill);font:var(--vvd-typography-base);max-inline-size:var(--text-field-input-inline-size,auto);grid-column:1/4;align-items:center;padding-block:0;transition:color .2s,background-color .2s;display:flex;position:relative}.fieldset:after{border-radius:inherit;block-size:100%;box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);content:\"\";pointer-events:none;inline-size:100%;transition:box-shadow .2s;display:block;position:absolute}.fieldset:focus-visible{outline:none}.base>.fieldset{block-size:var(--_text-field-block-size)}.base:not(.shape-pill) .fieldset{border-radius:var(--_text-field-border-radius)}.base.shape-pill .fieldset{border-radius:var(--_text-field-pill-border-radius)}.wrapper{border-radius:inherit;block-size:100%;inline-size:100%}.control{border-radius:inherit;text-align:start}.control:not(slot),.control::slotted(input){font:inherit;text-align:inherit;outline:#0000;box-sizing:border-box!important;border-radius:inherit!important;width:100%!important;margin:initial!important;appearance:none!important;block-size:100%!important;color:inherit!important;padding-block:0!important;padding-inline:var(--_text-field-gutter-start) var(--_text-field-gutter-end)!important;background-color:#0000!important;border:0!important}.control:not(slot,:focus),.control::slotted(input:not(:focus)){text-overflow:ellipsis!important}.control:not(slot):disabled,.control::slotted(input:disabled){cursor:not-allowed!important;opacity:1!important;-webkit-text-fill-color:var(--_appearance-color-text)!important}.control:not(slot)::placeholder{opacity:1!important;-webkit-text-fill-color:var(--_low-ink-color)!important}.control::slotted(input:-webkit-autofill),.control:not(slot):-webkit-autofill{-webkit-box-shadow:0 0 0 1000px var(--_appearance-color-fill) inset;-webkit-text-fill-color:var(--_appearance-color-text)!important}.control::slotted(input:autofill),.control:not(slot):autofill{-webkit-box-shadow:0 0 0 1000px var(--_appearance-color-fill) inset;-webkit-text-fill-color:var(--_appearance-color-text)!important}.has-icon .control:not(slot),.has-icon .control::slotted(input){padding-inline-start:calc(var(--_text-field-icon-size) + var(--_text-field-gutter-start) * 2)!important}.icon{z-index:1;color:var(--_low-ink-color);font-size:var(--_text-field-icon-size);line-height:1;position:absolute;inset-block-start:50%;inset-inline-start:calc(100% + var(--_text-field-gutter-start));transform:translateY(-50%)}.leading-items-wrapper{position:relative}.base.no-leading .leading-items-wrapper{display:none}.action-items-wrapper{margin-inline-end:4px}.base:not(.action-items) .action-items-wrapper{display:none}@supports selector(:has(*)){.base:not(.has-activedescendant) .fieldset:has(.wrapper .control:focus-within):after{--focus-stroke-gap-color:transparent;box-shadow:0 0 0 4px color-mix(in sRGB, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px))}}@supports not selector(:has(*)){.base:not(.has-activedescendant) .wrapper:focus-within:after{box-shadow:0 0 0 4px color-mix(in sRGB, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px));--focus-stroke-gap-color:transparent;z-index:1;border-radius:inherit;content:\"\";pointer-events:none;display:block;position:absolute;inset:0}}:host([internal-part]) .fieldset{font:var(--vvd-typography-heading-4);background-color:#0000;line-height:1.1}:host([internal-part]) .fieldset:not(:focus-within):after{block-size:1px;inset-block-end:0}@supports selector(:has(*)){:host([internal-part]) .fieldset:has(.action-items-wrapper:focus-within):after{block-size:1px;inset-block-end:0}}:host([internal-part]) .control{text-align:center}slot[name=_mirrored-helper-text]{display:none}";
|
|
3
3
|
//#endregion
|
|
4
4
|
Object.defineProperty(exports, "text_field_default", {
|
|
5
5
|
enumerable: true,
|
package/unbundled/text-field.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
//#region src/lib/text-field/text-field.scss?inline
|
|
2
|
-
var text_field_default = ".label-wrapper{align-items:center;gap:var(--label-wrapper-gap,4px);flex-direction:row;display:flex}.label-wrapper[hidden]{display:none}.label:not(slot),.label::slotted(label){flex:0 auto}:host{display:inline-block}.base{--_text-field-gutter-start:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 2.5);--_text-field-gutter-end:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 2.5);--_text-field-icon-size:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 2);--_text-field-block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2)));--_text-field-border-radius:8px;--_text-field-pill-border-radius:24px;grid-template-columns:min-content 1fr max-content;align-items:center;gap:4px;width:100%;display:inline-grid}.base.size-condensed{--_text-field-gutter-start:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 16)) / 2);--_text-field-gutter-end:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 16)) / 2);--_text-field-icon-size:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 8)) / 2);--_text-field-block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 8));--_text-field-border-radius:4px}.base{user-select:none}.base:not(.disabled){--_low-ink-color:var(--vvd-color-neutral-600)}.base.disabled{--_low-ink-color:var(--_appearance-color-text)}.label:not(slot),.label::slotted(label){font:var(--vvd-typography-base);grid-area:1/1/auto/4;box-sizing:initial!important;padding:initial!important;margin:initial!important;color:var(--vvd-color-canvas-text)!important}.char-count+.label:not(slot),.char-count+.label::slotted(label){grid-column:1/3}.char-count{color:var(--_low-ink-color);font:var(--vvd-typography-base)}.label-wrapper{grid-area:1/1/auto/4}.char-count+.label-wrapper{grid-column:1/3}.fieldset{background-color:var(--_appearance-color-fill);font:var(--vvd-typography-base);grid-column:1/4;align-items:center;padding-block:0;transition:color .2s,background-color .2s;display:flex;position:relative}.fieldset:after{border-radius:inherit;block-size:100%;box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);content:\"\";pointer-events:none;inline-size:100%;transition:box-shadow .2s;display:block;position:absolute}.fieldset:focus-visible{outline:none}.base>.fieldset{block-size:var(--_text-field-block-size)}.base:not(.shape-pill) .fieldset{border-radius:var(--_text-field-border-radius)}.base.shape-pill .fieldset{border-radius:var(--_text-field-pill-border-radius)}.wrapper{border-radius:inherit;block-size:100%;inline-size:100%}.control{border-radius:inherit;text-align:start}.control:not(slot),.control::slotted(input){font:inherit;text-align:inherit;outline:#0000;box-sizing:border-box!important;border-radius:inherit!important;width:100%!important;margin:initial!important;appearance:none!important;block-size:100%!important;color:inherit!important;padding-block:0!important;padding-inline:var(--_text-field-gutter-start) var(--_text-field-gutter-end)!important;background-color:#0000!important;border:0!important}.control:not(slot,:focus),.control::slotted(input:not(:focus)){text-overflow:ellipsis!important}.control:not(slot):disabled,.control::slotted(input:disabled){cursor:not-allowed!important;opacity:1!important;-webkit-text-fill-color:var(--_appearance-color-text)!important}.control:not(slot)::placeholder{opacity:1!important;-webkit-text-fill-color:var(--_low-ink-color)!important}.control::slotted(input:-webkit-autofill),.control:not(slot):-webkit-autofill{-webkit-box-shadow:0 0 0 1000px var(--_appearance-color-fill) inset;-webkit-text-fill-color:var(--_appearance-color-text)!important}.control::slotted(input:autofill),.control:not(slot):autofill{-webkit-box-shadow:0 0 0 1000px var(--_appearance-color-fill) inset;-webkit-text-fill-color:var(--_appearance-color-text)!important}.has-icon .control:not(slot),.has-icon .control::slotted(input){padding-inline-start:calc(var(--_text-field-icon-size) + var(--_text-field-gutter-start) * 2)!important}.icon{z-index:1;color:var(--_low-ink-color);font-size:var(--_text-field-icon-size);line-height:1;position:absolute;inset-block-start:50%;inset-inline-start:calc(100% + var(--_text-field-gutter-start));transform:translateY(-50%)}.leading-items-wrapper{position:relative}.base.no-leading .leading-items-wrapper{display:none}.action-items-wrapper{margin-inline-end:4px}.base:not(.action-items) .action-items-wrapper{display:none}@supports selector(:has(*)){.base:not(.has-activedescendant) .fieldset:has(.wrapper .control:focus-within):after{--focus-stroke-gap-color:transparent;box-shadow:0 0 0 4px color-mix(in sRGB, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px))}}@supports not selector(:has(*)){.base:not(.has-activedescendant) .wrapper:focus-within:after{box-shadow:0 0 0 4px color-mix(in sRGB, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px));--focus-stroke-gap-color:transparent;z-index:1;border-radius:inherit;content:\"\";pointer-events:none;display:block;position:absolute;inset:0}}:host([internal-part]) .fieldset{font:var(--vvd-typography-heading-4);background-color:#0000;line-height:1.1}:host([internal-part]) .fieldset:not(:focus-within):after{block-size:1px;inset-block-end:0}@supports selector(:has(*)){:host([internal-part]) .fieldset:has(.action-items-wrapper:focus-within):after{block-size:1px;inset-block-end:0}}:host([internal-part]) .control{text-align:center}slot[name=_mirrored-helper-text]{display:none}";
|
|
2
|
+
var text_field_default = ".label-wrapper{align-items:center;gap:var(--label-wrapper-gap,4px);flex-direction:row;display:flex}.label-wrapper[hidden]{display:none}.label:not(slot),.label::slotted(label){flex:0 auto}:host{display:inline-block}.base{--_text-field-gutter-start:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 2.5);--_text-field-gutter-end:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 2.5);--_text-field-icon-size:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 2);--_text-field-block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2)));--_text-field-border-radius:8px;--_text-field-pill-border-radius:24px;grid-template-columns:min-content 1fr max-content;align-items:center;gap:4px;width:100%;display:inline-grid}.base.size-condensed{--_text-field-gutter-start:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 16)) / 2);--_text-field-gutter-end:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 16)) / 2);--_text-field-icon-size:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 8)) / 2);--_text-field-block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 8));--_text-field-border-radius:4px}.base{user-select:none}.base:not(.disabled){--_low-ink-color:var(--vvd-color-neutral-600)}.base.disabled{--_low-ink-color:var(--_appearance-color-text)}.label:not(slot),.label::slotted(label){font:var(--vvd-typography-base);grid-area:1/1/auto/4;box-sizing:initial!important;padding:initial!important;margin:initial!important;color:var(--vvd-color-canvas-text)!important}.char-count+.label:not(slot),.char-count+.label::slotted(label){grid-column:1/3}.char-count{color:var(--_low-ink-color);font:var(--vvd-typography-base)}.label-wrapper{grid-area:1/1/auto/4}.char-count+.label-wrapper{grid-column:1/3}.fieldset{background-color:var(--_appearance-color-fill);font:var(--vvd-typography-base);max-inline-size:var(--text-field-input-inline-size,auto);grid-column:1/4;align-items:center;padding-block:0;transition:color .2s,background-color .2s;display:flex;position:relative}.fieldset:after{border-radius:inherit;block-size:100%;box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);content:\"\";pointer-events:none;inline-size:100%;transition:box-shadow .2s;display:block;position:absolute}.fieldset:focus-visible{outline:none}.base>.fieldset{block-size:var(--_text-field-block-size)}.base:not(.shape-pill) .fieldset{border-radius:var(--_text-field-border-radius)}.base.shape-pill .fieldset{border-radius:var(--_text-field-pill-border-radius)}.wrapper{border-radius:inherit;block-size:100%;inline-size:100%}.control{border-radius:inherit;text-align:start}.control:not(slot),.control::slotted(input){font:inherit;text-align:inherit;outline:#0000;box-sizing:border-box!important;border-radius:inherit!important;width:100%!important;margin:initial!important;appearance:none!important;block-size:100%!important;color:inherit!important;padding-block:0!important;padding-inline:var(--_text-field-gutter-start) var(--_text-field-gutter-end)!important;background-color:#0000!important;border:0!important}.control:not(slot,:focus),.control::slotted(input:not(:focus)){text-overflow:ellipsis!important}.control:not(slot):disabled,.control::slotted(input:disabled){cursor:not-allowed!important;opacity:1!important;-webkit-text-fill-color:var(--_appearance-color-text)!important}.control:not(slot)::placeholder{opacity:1!important;-webkit-text-fill-color:var(--_low-ink-color)!important}.control::slotted(input:-webkit-autofill),.control:not(slot):-webkit-autofill{-webkit-box-shadow:0 0 0 1000px var(--_appearance-color-fill) inset;-webkit-text-fill-color:var(--_appearance-color-text)!important}.control::slotted(input:autofill),.control:not(slot):autofill{-webkit-box-shadow:0 0 0 1000px var(--_appearance-color-fill) inset;-webkit-text-fill-color:var(--_appearance-color-text)!important}.has-icon .control:not(slot),.has-icon .control::slotted(input){padding-inline-start:calc(var(--_text-field-icon-size) + var(--_text-field-gutter-start) * 2)!important}.icon{z-index:1;color:var(--_low-ink-color);font-size:var(--_text-field-icon-size);line-height:1;position:absolute;inset-block-start:50%;inset-inline-start:calc(100% + var(--_text-field-gutter-start));transform:translateY(-50%)}.leading-items-wrapper{position:relative}.base.no-leading .leading-items-wrapper{display:none}.action-items-wrapper{margin-inline-end:4px}.base:not(.action-items) .action-items-wrapper{display:none}@supports selector(:has(*)){.base:not(.has-activedescendant) .fieldset:has(.wrapper .control:focus-within):after{--focus-stroke-gap-color:transparent;box-shadow:0 0 0 4px color-mix(in sRGB, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px))}}@supports not selector(:has(*)){.base:not(.has-activedescendant) .wrapper:focus-within:after{box-shadow:0 0 0 4px color-mix(in sRGB, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px));--focus-stroke-gap-color:transparent;z-index:1;border-radius:inherit;content:\"\";pointer-events:none;display:block;position:absolute;inset:0}}:host([internal-part]) .fieldset{font:var(--vvd-typography-heading-4);background-color:#0000;line-height:1.1}:host([internal-part]) .fieldset:not(:focus-within):after{block-size:1px;inset-block-end:0}@supports selector(:has(*)){:host([internal-part]) .fieldset:has(.action-items-wrapper:focus-within):after{block-size:1px;inset-block-end:0}}:host([internal-part]) .control{text-align:center}slot[name=_mirrored-helper-text]{display:none}";
|
|
3
3
|
//#endregion
|
|
4
4
|
export { text_field_default as t };
|
|
@@ -370,7 +370,7 @@ var TimeSelectionPicker = (Base) => {
|
|
|
370
370
|
super(..._args);
|
|
371
371
|
this.minutesStep = null;
|
|
372
372
|
this.secondsStep = null;
|
|
373
|
-
this
|
|
373
|
+
this._clockChangeHandler = { handleChange: () => {
|
|
374
374
|
if (this.value) this._presentationValue = this._toPresentationValue(this.value);
|
|
375
375
|
} };
|
|
376
376
|
}
|
|
@@ -389,24 +389,24 @@ var TimeSelectionPicker = (Base) => {
|
|
|
389
389
|
if (this._use12hClock) format += " aa";
|
|
390
390
|
return format;
|
|
391
391
|
}
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
this
|
|
396
|
-
this.#clockChangeObserver.observe(this, _microsoft_fast_element.ExecutionContext.default);
|
|
392
|
+
/** @internal */
|
|
393
|
+
_startObservingClockChanges() {
|
|
394
|
+
this._clockChangeObserver = _microsoft_fast_element.Observable.binding(() => this._use12hClock, this._clockChangeHandler);
|
|
395
|
+
this._clockChangeObserver.observe(this, _microsoft_fast_element.ExecutionContext.default);
|
|
397
396
|
}
|
|
398
|
-
|
|
399
|
-
|
|
397
|
+
/** @internal */
|
|
398
|
+
_stopObservingClockChanges() {
|
|
399
|
+
this._clockChangeObserver.dispose();
|
|
400
400
|
}
|
|
401
401
|
/** @internal */
|
|
402
402
|
connectedCallback() {
|
|
403
403
|
super.connectedCallback();
|
|
404
|
-
this
|
|
404
|
+
this._startObservingClockChanges();
|
|
405
405
|
}
|
|
406
406
|
/** @internal */
|
|
407
407
|
disconnectedCallback() {
|
|
408
408
|
super.disconnectedCallback();
|
|
409
|
-
this
|
|
409
|
+
this._stopObservingClockChanges();
|
|
410
410
|
}
|
|
411
411
|
/** @internal */
|
|
412
412
|
_onPickerButtonClick() {
|
|
@@ -370,7 +370,7 @@ var TimeSelectionPicker = (Base) => {
|
|
|
370
370
|
super(..._args);
|
|
371
371
|
this.minutesStep = null;
|
|
372
372
|
this.secondsStep = null;
|
|
373
|
-
this
|
|
373
|
+
this._clockChangeHandler = { handleChange: () => {
|
|
374
374
|
if (this.value) this._presentationValue = this._toPresentationValue(this.value);
|
|
375
375
|
} };
|
|
376
376
|
}
|
|
@@ -389,24 +389,24 @@ var TimeSelectionPicker = (Base) => {
|
|
|
389
389
|
if (this._use12hClock) format += " aa";
|
|
390
390
|
return format;
|
|
391
391
|
}
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
this
|
|
396
|
-
this.#clockChangeObserver.observe(this, ExecutionContext.default);
|
|
392
|
+
/** @internal */
|
|
393
|
+
_startObservingClockChanges() {
|
|
394
|
+
this._clockChangeObserver = Observable.binding(() => this._use12hClock, this._clockChangeHandler);
|
|
395
|
+
this._clockChangeObserver.observe(this, ExecutionContext.default);
|
|
397
396
|
}
|
|
398
|
-
|
|
399
|
-
|
|
397
|
+
/** @internal */
|
|
398
|
+
_stopObservingClockChanges() {
|
|
399
|
+
this._clockChangeObserver.dispose();
|
|
400
400
|
}
|
|
401
401
|
/** @internal */
|
|
402
402
|
connectedCallback() {
|
|
403
403
|
super.connectedCallback();
|
|
404
|
-
this
|
|
404
|
+
this._startObservingClockChanges();
|
|
405
405
|
}
|
|
406
406
|
/** @internal */
|
|
407
407
|
disconnectedCallback() {
|
|
408
408
|
super.disconnectedCallback();
|
|
409
|
-
this
|
|
409
|
+
this._stopObservingClockChanges();
|
|
410
410
|
}
|
|
411
411
|
/** @internal */
|
|
412
412
|
_onPickerButtonClick() {
|
|
@@ -255,14 +255,17 @@ var AriaMixin = (Base) => {
|
|
|
255
255
|
/** Mixin implementing ReactiveControllerHost for custom elements. */
|
|
256
256
|
var ReactiveControllerHostSupport = (Base) => {
|
|
257
257
|
class ReactiveControllerHostSupportElement extends Base {
|
|
258
|
-
|
|
258
|
+
constructor(..._args) {
|
|
259
|
+
super(..._args);
|
|
260
|
+
this._controllers = /* @__PURE__ */ new Set();
|
|
261
|
+
}
|
|
259
262
|
/**
|
|
260
263
|
* Adds a controller to the host, which sets up the controller's lifecycle
|
|
261
264
|
* methods to be called with the host's lifecycle.
|
|
262
265
|
* @internal
|
|
263
266
|
*/
|
|
264
267
|
_addController(controller) {
|
|
265
|
-
this
|
|
268
|
+
this._controllers.add(controller);
|
|
266
269
|
if (this.$fastController.isConnected) controller.hostConnected?.();
|
|
267
270
|
}
|
|
268
271
|
/**
|
|
@@ -270,15 +273,15 @@ var ReactiveControllerHostSupport = (Base) => {
|
|
|
270
273
|
* @internal
|
|
271
274
|
*/
|
|
272
275
|
_removeController(controller) {
|
|
273
|
-
this
|
|
276
|
+
this._controllers.delete(controller);
|
|
274
277
|
}
|
|
275
278
|
connectedCallback() {
|
|
276
279
|
super.connectedCallback();
|
|
277
|
-
for (const controller of this
|
|
280
|
+
for (const controller of this._controllers) controller.hostConnected?.();
|
|
278
281
|
}
|
|
279
282
|
disconnectedCallback() {
|
|
280
283
|
super.disconnectedCallback();
|
|
281
|
-
for (const controller of this
|
|
284
|
+
for (const controller of this._controllers) controller.hostDisconnected?.();
|
|
282
285
|
}
|
|
283
286
|
}
|
|
284
287
|
return ReactiveControllerHostSupportElement;
|
|
@@ -307,7 +310,8 @@ var replaces = (config) => ($target, $prop) => {
|
|
|
307
310
|
*/
|
|
308
311
|
var ReplacedPropHandling = (Base) => {
|
|
309
312
|
class ReplacedPropHandlingElement extends Base {
|
|
310
|
-
|
|
313
|
+
/** @internal */
|
|
314
|
+
_handleReplacedProp(replacedProp) {
|
|
311
315
|
let newDirty = false;
|
|
312
316
|
let deprecatedDirty = false;
|
|
313
317
|
const changeCouldBeFromDeprecated = (source) => deprecatedDirty && replacedProp.fromDeprecated(source[replacedProp.deprecatedPropertyName]) === source[replacedProp.newPropertyName];
|
|
@@ -330,7 +334,7 @@ var ReplacedPropHandling = (Base) => {
|
|
|
330
334
|
}
|
|
331
335
|
constructor(...args) {
|
|
332
336
|
super(...args);
|
|
333
|
-
for (const replacedProp of locateReplacedPropMetadata(this.constructor)) this
|
|
337
|
+
for (const replacedProp of locateReplacedPropMetadata(this.constructor)) this._handleReplacedProp(replacedProp);
|
|
334
338
|
}
|
|
335
339
|
}
|
|
336
340
|
return ReplacedPropHandlingElement;
|
|
@@ -346,7 +350,7 @@ var ReplacedPropHandling = (Base) => {
|
|
|
346
350
|
*/
|
|
347
351
|
var VividElement = class extends AriaMixin(ReplacedPropHandling(ReactiveControllerHostSupport(_microsoft_fast_element.FASTElement))) {
|
|
348
352
|
static {
|
|
349
|
-
this.VIVID_VERSION = "5.
|
|
353
|
+
this.VIVID_VERSION = "5.32.0";
|
|
350
354
|
}
|
|
351
355
|
/**
|
|
352
356
|
* Add data-vvd-component attribute with component name globally,
|
|
@@ -367,6 +371,59 @@ var VividElement = class extends AriaMixin(ReplacedPropHandling(ReactiveControll
|
|
|
367
371
|
super.focus(...args);
|
|
368
372
|
}
|
|
369
373
|
};
|
|
374
|
+
patchElementControllerForCustomElement();
|
|
375
|
+
/**
|
|
376
|
+
* Works around https://github.com/microsoft/fast/issues/7745.
|
|
377
|
+
*
|
|
378
|
+
* `ElementController.forCustomElement` subscribes a closure over the element to
|
|
379
|
+
* the notifier of the element's `FASTElementDefinition` and never unsubscribes.
|
|
380
|
+
* The definition is a per-tag singleton that lives as long as the custom element
|
|
381
|
+
* registry, so every element ever constructed — plus its detached subtree — is
|
|
382
|
+
* retained for the lifetime of the page.
|
|
383
|
+
*
|
|
384
|
+
* This replacement ties the subscription to the element's connected lifetime
|
|
385
|
+
* instead, so a removed element becomes collectable.
|
|
386
|
+
*/
|
|
387
|
+
function patchElementControllerForCustomElement() {
|
|
388
|
+
let strategy = _microsoft_fast_element.ElementController;
|
|
389
|
+
const originalSetStrategy = _microsoft_fast_element.ElementController.setStrategy;
|
|
390
|
+
_microsoft_fast_element.ElementController.setStrategy = function(newStrategy) {
|
|
391
|
+
strategy = newStrategy;
|
|
392
|
+
originalSetStrategy.call(this, newStrategy);
|
|
393
|
+
};
|
|
394
|
+
const subscribers = /* @__PURE__ */ new WeakMap();
|
|
395
|
+
_microsoft_fast_element.ElementController.forCustomElement = function(element, override = false) {
|
|
396
|
+
const existing = element.$fastController;
|
|
397
|
+
if (existing !== void 0 && !override) return existing;
|
|
398
|
+
const definition = _microsoft_fast_element.FASTElementDefinition.getForInstance(element);
|
|
399
|
+
if (definition === void 0) throw new Error("Missing element definition");
|
|
400
|
+
const controller = new strategy(element, definition);
|
|
401
|
+
element.$fastController = controller;
|
|
402
|
+
let subscriber = subscribers.get(element);
|
|
403
|
+
if (subscriber === void 0) {
|
|
404
|
+
subscriber = { handleChange: () => {
|
|
405
|
+
_microsoft_fast_element.ElementController.forCustomElement(element, true);
|
|
406
|
+
element.$fastController.connect();
|
|
407
|
+
} };
|
|
408
|
+
subscribers.set(element, subscriber);
|
|
409
|
+
}
|
|
410
|
+
const definitionSubscriber = subscriber;
|
|
411
|
+
const notifier = _microsoft_fast_element.Observable.getNotifier(definition);
|
|
412
|
+
const connect = controller.connect.bind(controller);
|
|
413
|
+
const disconnect = controller.disconnect.bind(controller);
|
|
414
|
+
controller.connect = () => {
|
|
415
|
+
notifier.subscribe(definitionSubscriber, "template");
|
|
416
|
+
notifier.subscribe(definitionSubscriber, "shadowOptions");
|
|
417
|
+
connect();
|
|
418
|
+
};
|
|
419
|
+
controller.disconnect = () => {
|
|
420
|
+
disconnect();
|
|
421
|
+
notifier.unsubscribe(definitionSubscriber, "template");
|
|
422
|
+
notifier.unsubscribe(definitionSubscriber, "shadowOptions");
|
|
423
|
+
};
|
|
424
|
+
return controller;
|
|
425
|
+
};
|
|
426
|
+
}
|
|
370
427
|
//#endregion
|
|
371
428
|
Object.defineProperty(exports, "VividElement", {
|
|
372
429
|
enumerable: true,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DOM, FASTElement, FASTElementDefinition, Observable, attr, html } from "@microsoft/fast-element";
|
|
1
|
+
import { DOM, ElementController, FASTElement, FASTElementDefinition, Observable, attr, html } from "@microsoft/fast-element";
|
|
2
2
|
//#region src/shared/design-system/createRegisterFunction.ts
|
|
3
3
|
function resolve(templateOrResolveFunction, ctx) {
|
|
4
4
|
if (templateOrResolveFunction instanceof Function) return templateOrResolveFunction(ctx);
|
|
@@ -255,14 +255,17 @@ var AriaMixin = (Base) => {
|
|
|
255
255
|
/** Mixin implementing ReactiveControllerHost for custom elements. */
|
|
256
256
|
var ReactiveControllerHostSupport = (Base) => {
|
|
257
257
|
class ReactiveControllerHostSupportElement extends Base {
|
|
258
|
-
|
|
258
|
+
constructor(..._args) {
|
|
259
|
+
super(..._args);
|
|
260
|
+
this._controllers = /* @__PURE__ */ new Set();
|
|
261
|
+
}
|
|
259
262
|
/**
|
|
260
263
|
* Adds a controller to the host, which sets up the controller's lifecycle
|
|
261
264
|
* methods to be called with the host's lifecycle.
|
|
262
265
|
* @internal
|
|
263
266
|
*/
|
|
264
267
|
_addController(controller) {
|
|
265
|
-
this
|
|
268
|
+
this._controllers.add(controller);
|
|
266
269
|
if (this.$fastController.isConnected) controller.hostConnected?.();
|
|
267
270
|
}
|
|
268
271
|
/**
|
|
@@ -270,15 +273,15 @@ var ReactiveControllerHostSupport = (Base) => {
|
|
|
270
273
|
* @internal
|
|
271
274
|
*/
|
|
272
275
|
_removeController(controller) {
|
|
273
|
-
this
|
|
276
|
+
this._controllers.delete(controller);
|
|
274
277
|
}
|
|
275
278
|
connectedCallback() {
|
|
276
279
|
super.connectedCallback();
|
|
277
|
-
for (const controller of this
|
|
280
|
+
for (const controller of this._controllers) controller.hostConnected?.();
|
|
278
281
|
}
|
|
279
282
|
disconnectedCallback() {
|
|
280
283
|
super.disconnectedCallback();
|
|
281
|
-
for (const controller of this
|
|
284
|
+
for (const controller of this._controllers) controller.hostDisconnected?.();
|
|
282
285
|
}
|
|
283
286
|
}
|
|
284
287
|
return ReactiveControllerHostSupportElement;
|
|
@@ -307,7 +310,8 @@ var replaces = (config) => ($target, $prop) => {
|
|
|
307
310
|
*/
|
|
308
311
|
var ReplacedPropHandling = (Base) => {
|
|
309
312
|
class ReplacedPropHandlingElement extends Base {
|
|
310
|
-
|
|
313
|
+
/** @internal */
|
|
314
|
+
_handleReplacedProp(replacedProp) {
|
|
311
315
|
let newDirty = false;
|
|
312
316
|
let deprecatedDirty = false;
|
|
313
317
|
const changeCouldBeFromDeprecated = (source) => deprecatedDirty && replacedProp.fromDeprecated(source[replacedProp.deprecatedPropertyName]) === source[replacedProp.newPropertyName];
|
|
@@ -330,7 +334,7 @@ var ReplacedPropHandling = (Base) => {
|
|
|
330
334
|
}
|
|
331
335
|
constructor(...args) {
|
|
332
336
|
super(...args);
|
|
333
|
-
for (const replacedProp of locateReplacedPropMetadata(this.constructor)) this
|
|
337
|
+
for (const replacedProp of locateReplacedPropMetadata(this.constructor)) this._handleReplacedProp(replacedProp);
|
|
334
338
|
}
|
|
335
339
|
}
|
|
336
340
|
return ReplacedPropHandlingElement;
|
|
@@ -346,7 +350,7 @@ var ReplacedPropHandling = (Base) => {
|
|
|
346
350
|
*/
|
|
347
351
|
var VividElement = class extends AriaMixin(ReplacedPropHandling(ReactiveControllerHostSupport(FASTElement))) {
|
|
348
352
|
static {
|
|
349
|
-
this.VIVID_VERSION = "5.
|
|
353
|
+
this.VIVID_VERSION = "5.32.0";
|
|
350
354
|
}
|
|
351
355
|
/**
|
|
352
356
|
* Add data-vvd-component attribute with component name globally,
|
|
@@ -367,5 +371,58 @@ var VividElement = class extends AriaMixin(ReplacedPropHandling(ReactiveControll
|
|
|
367
371
|
super.focus(...args);
|
|
368
372
|
}
|
|
369
373
|
};
|
|
374
|
+
patchElementControllerForCustomElement();
|
|
375
|
+
/**
|
|
376
|
+
* Works around https://github.com/microsoft/fast/issues/7745.
|
|
377
|
+
*
|
|
378
|
+
* `ElementController.forCustomElement` subscribes a closure over the element to
|
|
379
|
+
* the notifier of the element's `FASTElementDefinition` and never unsubscribes.
|
|
380
|
+
* The definition is a per-tag singleton that lives as long as the custom element
|
|
381
|
+
* registry, so every element ever constructed — plus its detached subtree — is
|
|
382
|
+
* retained for the lifetime of the page.
|
|
383
|
+
*
|
|
384
|
+
* This replacement ties the subscription to the element's connected lifetime
|
|
385
|
+
* instead, so a removed element becomes collectable.
|
|
386
|
+
*/
|
|
387
|
+
function patchElementControllerForCustomElement() {
|
|
388
|
+
let strategy = ElementController;
|
|
389
|
+
const originalSetStrategy = ElementController.setStrategy;
|
|
390
|
+
ElementController.setStrategy = function(newStrategy) {
|
|
391
|
+
strategy = newStrategy;
|
|
392
|
+
originalSetStrategy.call(this, newStrategy);
|
|
393
|
+
};
|
|
394
|
+
const subscribers = /* @__PURE__ */ new WeakMap();
|
|
395
|
+
ElementController.forCustomElement = function(element, override = false) {
|
|
396
|
+
const existing = element.$fastController;
|
|
397
|
+
if (existing !== void 0 && !override) return existing;
|
|
398
|
+
const definition = FASTElementDefinition.getForInstance(element);
|
|
399
|
+
if (definition === void 0) throw new Error("Missing element definition");
|
|
400
|
+
const controller = new strategy(element, definition);
|
|
401
|
+
element.$fastController = controller;
|
|
402
|
+
let subscriber = subscribers.get(element);
|
|
403
|
+
if (subscriber === void 0) {
|
|
404
|
+
subscriber = { handleChange: () => {
|
|
405
|
+
ElementController.forCustomElement(element, true);
|
|
406
|
+
element.$fastController.connect();
|
|
407
|
+
} };
|
|
408
|
+
subscribers.set(element, subscriber);
|
|
409
|
+
}
|
|
410
|
+
const definitionSubscriber = subscriber;
|
|
411
|
+
const notifier = Observable.getNotifier(definition);
|
|
412
|
+
const connect = controller.connect.bind(controller);
|
|
413
|
+
const disconnect = controller.disconnect.bind(controller);
|
|
414
|
+
controller.connect = () => {
|
|
415
|
+
notifier.subscribe(definitionSubscriber, "template");
|
|
416
|
+
notifier.subscribe(definitionSubscriber, "shadowOptions");
|
|
417
|
+
connect();
|
|
418
|
+
};
|
|
419
|
+
controller.disconnect = () => {
|
|
420
|
+
disconnect();
|
|
421
|
+
notifier.unsubscribe(definitionSubscriber, "template");
|
|
422
|
+
notifier.unsubscribe(definitionSubscriber, "shadowOptions");
|
|
423
|
+
};
|
|
424
|
+
return controller;
|
|
425
|
+
};
|
|
426
|
+
}
|
|
370
427
|
//#endregion
|
|
371
428
|
export { ariaValueProperties as a, subscribeToAriaPropertyChanges as c, createRegisterFunction as d, ariaIdrefsProperties as i, unsubscribeFromAriaPropertyChanges as l, replaces as n, handleAriaPropertyChange as o, ariaAttributeName as r, publishAriaPropertyChange as s, VividElement as t, defineVividComponent as u };
|
|
@@ -6,26 +6,27 @@ var WithErrorText = (Base) => {
|
|
|
6
6
|
class ElementWithErrorText extends Base {
|
|
7
7
|
/** @internal */
|
|
8
8
|
errorTextChanged(_, newErrorText) {
|
|
9
|
-
if (newErrorText) this
|
|
10
|
-
else this
|
|
9
|
+
if (newErrorText) this._forceCustomError(newErrorText);
|
|
10
|
+
else this._clearCustomErrorAndRevalidate();
|
|
11
11
|
}
|
|
12
|
-
#blockValidateCalls = false;
|
|
13
|
-
#originalValidateFn;
|
|
14
12
|
constructor(...args) {
|
|
15
13
|
super(...args);
|
|
16
|
-
this
|
|
14
|
+
this._blockValidateCalls = false;
|
|
15
|
+
this._originalValidateFn = this.validate;
|
|
17
16
|
this.validate = () => {
|
|
18
|
-
if (!this
|
|
17
|
+
if (!this._blockValidateCalls) this._originalValidateFn();
|
|
19
18
|
};
|
|
20
19
|
}
|
|
21
|
-
|
|
20
|
+
/** @internal */
|
|
21
|
+
_forceCustomError(errorMessage) {
|
|
22
22
|
this.setValidity({ customError: true }, errorMessage, this.control);
|
|
23
23
|
this.errorValidationMessage = errorMessage;
|
|
24
|
-
this
|
|
24
|
+
this._blockValidateCalls = true;
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
/** @internal */
|
|
27
|
+
_clearCustomErrorAndRevalidate() {
|
|
27
28
|
this.setValidity({}, "", this.control);
|
|
28
|
-
this
|
|
29
|
+
this._blockValidateCalls = false;
|
|
29
30
|
this.validate();
|
|
30
31
|
}
|
|
31
32
|
}
|
|
@@ -6,26 +6,27 @@ var WithErrorText = (Base) => {
|
|
|
6
6
|
class ElementWithErrorText extends Base {
|
|
7
7
|
/** @internal */
|
|
8
8
|
errorTextChanged(_, newErrorText) {
|
|
9
|
-
if (newErrorText) this
|
|
10
|
-
else this
|
|
9
|
+
if (newErrorText) this._forceCustomError(newErrorText);
|
|
10
|
+
else this._clearCustomErrorAndRevalidate();
|
|
11
11
|
}
|
|
12
|
-
#blockValidateCalls = false;
|
|
13
|
-
#originalValidateFn;
|
|
14
12
|
constructor(...args) {
|
|
15
13
|
super(...args);
|
|
16
|
-
this
|
|
14
|
+
this._blockValidateCalls = false;
|
|
15
|
+
this._originalValidateFn = this.validate;
|
|
17
16
|
this.validate = () => {
|
|
18
|
-
if (!this
|
|
17
|
+
if (!this._blockValidateCalls) this._originalValidateFn();
|
|
19
18
|
};
|
|
20
19
|
}
|
|
21
|
-
|
|
20
|
+
/** @internal */
|
|
21
|
+
_forceCustomError(errorMessage) {
|
|
22
22
|
this.setValidity({ customError: true }, errorMessage, this.control);
|
|
23
23
|
this.errorValidationMessage = errorMessage;
|
|
24
|
-
this
|
|
24
|
+
this._blockValidateCalls = true;
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
/** @internal */
|
|
27
|
+
_clearCustomErrorAndRevalidate() {
|
|
27
28
|
this.setValidity({}, "", this.control);
|
|
28
|
-
this
|
|
29
|
+
this._blockValidateCalls = false;
|
|
29
30
|
this.validate();
|
|
30
31
|
}
|
|
31
32
|
}
|