@m3e/web 2.0.3 → 2.0.4
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/dist/all.js +564 -462
- package/dist/all.js.map +1 -1
- package/dist/all.min.js +54 -59
- package/dist/all.min.js.map +1 -1
- package/dist/app-bar.js +11 -11
- package/dist/app-bar.js.map +1 -1
- package/dist/app-bar.min.js +1 -1
- package/dist/app-bar.min.js.map +1 -1
- package/dist/autocomplete.js +32 -19
- package/dist/autocomplete.js.map +1 -1
- package/dist/autocomplete.min.js +1 -1
- package/dist/autocomplete.min.js.map +1 -1
- package/dist/avatar.js +2 -3
- package/dist/avatar.js.map +1 -1
- package/dist/avatar.min.js +1 -1
- package/dist/avatar.min.js.map +1 -1
- package/dist/badge.js +3 -3
- package/dist/badge.js.map +1 -1
- package/dist/badge.min.js +1 -1
- package/dist/badge.min.js.map +1 -1
- package/dist/bottom-sheet.js +17 -18
- package/dist/bottom-sheet.js.map +1 -1
- package/dist/bottom-sheet.min.js +1 -1
- package/dist/bottom-sheet.min.js.map +1 -1
- package/dist/button-group.js +8 -8
- package/dist/button-group.js.map +1 -1
- package/dist/button-group.min.js +1 -1
- package/dist/button-group.min.js.map +1 -1
- package/dist/button.js +18 -18
- package/dist/button.js.map +1 -1
- package/dist/button.min.js +1 -1
- package/dist/button.min.js.map +1 -1
- package/dist/card.js +3 -3
- package/dist/card.js.map +1 -1
- package/dist/card.min.js +1 -1
- package/dist/card.min.js.map +1 -1
- package/dist/checkbox.js +4 -4
- package/dist/checkbox.js.map +1 -1
- package/dist/checkbox.min.js +1 -1
- package/dist/checkbox.min.js.map +1 -1
- package/dist/chips.js +58 -45
- package/dist/chips.js.map +1 -1
- package/dist/chips.min.js +1 -1
- package/dist/chips.min.js.map +1 -1
- package/dist/core-a11y.js +28 -2
- package/dist/core-a11y.js.map +1 -1
- package/dist/core-a11y.min.js +4 -13
- package/dist/core-a11y.min.js.map +1 -1
- package/dist/core-bidi.js +3 -5
- package/dist/core-bidi.js.map +1 -1
- package/dist/core-bidi.min.js +2 -2
- package/dist/core-bidi.min.js.map +1 -1
- package/dist/core.js +139 -60
- package/dist/core.js.map +1 -1
- package/dist/core.min.js +1 -1
- package/dist/core.min.js.map +1 -1
- package/dist/css-custom-data.json +332 -542
- package/dist/custom-elements.json +11238 -12197
- package/dist/dialog.js +12 -12
- package/dist/dialog.js.map +1 -1
- package/dist/dialog.min.js +1 -1
- package/dist/dialog.min.js.map +1 -1
- package/dist/divider.js +3 -3
- package/dist/divider.js.map +1 -1
- package/dist/divider.min.js +1 -1
- package/dist/divider.min.js.map +1 -1
- package/dist/drawer-container.js +20 -20
- package/dist/drawer-container.js.map +1 -1
- package/dist/drawer-container.min.js +1 -1
- package/dist/drawer-container.min.js.map +1 -1
- package/dist/expansion-panel.js +7 -7
- package/dist/expansion-panel.js.map +1 -1
- package/dist/expansion-panel.min.js +1 -1
- package/dist/expansion-panel.min.js.map +1 -1
- package/dist/fab-menu.js +12 -12
- package/dist/fab-menu.js.map +1 -1
- package/dist/fab-menu.min.js +1 -1
- package/dist/fab-menu.min.js.map +1 -1
- package/dist/fab.js +5 -5
- package/dist/fab.js.map +1 -1
- package/dist/fab.min.js +1 -1
- package/dist/fab.min.js.map +1 -1
- package/dist/form-field.js +23 -23
- package/dist/form-field.js.map +1 -1
- package/dist/form-field.min.js +3 -3
- package/dist/form-field.min.js.map +1 -1
- package/dist/heading.js +3 -3
- package/dist/heading.js.map +1 -1
- package/dist/heading.min.js +1 -1
- package/dist/heading.min.js.map +1 -1
- package/dist/html-custom-data.json +115 -147
- package/dist/icon-button.js +18 -18
- package/dist/icon-button.js.map +1 -1
- package/dist/icon-button.min.js +1 -1
- package/dist/icon-button.min.js.map +1 -1
- package/dist/icon.js +3 -3
- package/dist/icon.js.map +1 -1
- package/dist/icon.min.js +1 -1
- package/dist/icon.min.js.map +1 -1
- package/dist/list.js +34 -28
- package/dist/list.js.map +1 -1
- package/dist/list.min.js +1 -1
- package/dist/list.min.js.map +1 -1
- package/dist/loading-indicator.js +3 -3
- package/dist/loading-indicator.js.map +1 -1
- package/dist/loading-indicator.min.js +1 -1
- package/dist/loading-indicator.min.js.map +1 -1
- package/dist/menu.js +34 -32
- package/dist/menu.js.map +1 -1
- package/dist/menu.min.js +1 -1
- package/dist/menu.min.js.map +1 -1
- package/dist/nav-bar.js +6 -6
- package/dist/nav-bar.js.map +1 -1
- package/dist/nav-bar.min.js +1 -1
- package/dist/nav-bar.min.js.map +1 -1
- package/dist/nav-menu.js +28 -24
- package/dist/nav-menu.js.map +1 -1
- package/dist/nav-menu.min.js +1 -1
- package/dist/nav-menu.min.js.map +1 -1
- package/dist/nav-rail.js +6 -7
- package/dist/nav-rail.js.map +1 -1
- package/dist/nav-rail.min.js +1 -1
- package/dist/nav-rail.min.js.map +1 -1
- package/dist/option.js +29 -31
- package/dist/option.js.map +1 -1
- package/dist/option.min.js +1 -1
- package/dist/option.min.js.map +1 -1
- package/dist/paginator.js +3 -4
- package/dist/paginator.js.map +1 -1
- package/dist/paginator.min.js +2 -2
- package/dist/paginator.min.js.map +1 -1
- package/dist/progress-indicator.js +4 -4
- package/dist/progress-indicator.js.map +1 -1
- package/dist/progress-indicator.min.js +7 -7
- package/dist/progress-indicator.min.js.map +1 -1
- package/dist/radio-group.js +6 -6
- package/dist/radio-group.js.map +1 -1
- package/dist/radio-group.min.js +1 -1
- package/dist/radio-group.min.js.map +1 -1
- package/dist/segmented-button.js +11 -11
- package/dist/segmented-button.js.map +1 -1
- package/dist/segmented-button.min.js +1 -1
- package/dist/segmented-button.min.js.map +1 -1
- package/dist/select.js +11 -355
- package/dist/select.js.map +1 -1
- package/dist/select.min.js +1 -18
- package/dist/select.min.js.map +1 -1
- package/dist/shape.js +3 -3
- package/dist/shape.js.map +1 -1
- package/dist/shape.min.js +1 -1
- package/dist/shape.min.js.map +1 -1
- package/dist/slide-group.js +3 -3
- package/dist/slide-group.js.map +1 -1
- package/dist/slide-group.min.js +1 -1
- package/dist/slide-group.min.js.map +1 -1
- package/dist/slider.js +10 -10
- package/dist/slider.js.map +1 -1
- package/dist/slider.min.js +1 -1
- package/dist/slider.min.js.map +1 -1
- package/dist/snackbar.js +4 -4
- package/dist/snackbar.js.map +1 -1
- package/dist/snackbar.min.js +1 -1
- package/dist/snackbar.min.js.map +1 -1
- package/dist/split-button.js +3 -3
- package/dist/split-button.js.map +1 -1
- package/dist/split-button.min.js +1 -1
- package/dist/split-button.min.js.map +1 -1
- package/dist/src/autocomplete/AutocompleteElement.d.ts.map +1 -1
- package/dist/src/avatar/AvatarElement.d.ts.map +1 -1
- package/dist/src/bottom-sheet/BottomSheetActionElement.d.ts.map +1 -1
- package/dist/src/bottom-sheet/BottomSheetElement.d.ts +1 -1
- package/dist/src/bottom-sheet/BottomSheetElement.d.ts.map +1 -1
- package/dist/src/bottom-sheet/BottomSheetTriggerElement.d.ts.map +1 -1
- package/dist/src/button/ButtonElement.d.ts +2 -1
- package/dist/src/button/ButtonElement.d.ts.map +1 -1
- package/dist/src/button/styles/ButtonSizeStyle.d.ts.map +1 -1
- package/dist/src/button/styles/ButtonVariantStyle.d.ts.map +1 -1
- package/dist/src/button-group/ButtonGroupElement.d.ts.map +1 -1
- package/dist/src/card/CardElement.d.ts.map +1 -1
- package/dist/src/checkbox/CheckboxElement.d.ts.map +1 -1
- package/dist/src/chips/AssistChipElement.d.ts +3 -1
- package/dist/src/chips/AssistChipElement.d.ts.map +1 -1
- package/dist/src/chips/ChipElement.d.ts +3 -1
- package/dist/src/chips/ChipElement.d.ts.map +1 -1
- package/dist/src/chips/ChipSetElement.d.ts.map +1 -1
- package/dist/src/chips/FilterChipElement.d.ts +3 -1
- package/dist/src/chips/FilterChipElement.d.ts.map +1 -1
- package/dist/src/chips/FilterChipSetElement.d.ts.map +1 -1
- package/dist/src/chips/InputChipElement.d.ts +8 -1
- package/dist/src/chips/InputChipElement.d.ts.map +1 -1
- package/dist/src/chips/InputChipSetElement.d.ts.map +1 -1
- package/dist/src/chips/SuggestionChipElement.d.ts +3 -1
- package/dist/src/chips/SuggestionChipElement.d.ts.map +1 -1
- package/dist/src/core/bidi/Directionality.d.ts.map +1 -1
- package/dist/src/core/shared/controllers/HoverController.d.ts.map +1 -1
- package/dist/src/core/shared/controllers/IntersectionController.d.ts.map +1 -1
- package/dist/src/core/shared/decorators/component.d.ts +19 -0
- package/dist/src/core/shared/decorators/component.d.ts.map +1 -0
- package/dist/src/core/shared/decorators/element.d.ts +19 -0
- package/dist/src/core/shared/decorators/element.d.ts.map +1 -0
- package/dist/src/core/shared/decorators/index.d.ts +1 -0
- package/dist/src/core/shared/decorators/index.d.ts.map +1 -1
- package/dist/src/core/shared/mixins/AttachInternals.d.ts +27 -0
- package/dist/src/core/shared/mixins/AttachInternals.d.ts.map +1 -1
- package/dist/src/core/shared/mixins/Dirty.d.ts +2 -1
- package/dist/src/core/shared/mixins/Dirty.d.ts.map +1 -1
- package/dist/src/core/shared/mixins/HtmlFor.d.ts.map +1 -1
- package/dist/src/core/shared/mixins/Labelled.d.ts.map +1 -1
- package/dist/src/core/shared/mixins/Touched.d.ts +2 -1
- package/dist/src/core/shared/mixins/Touched.d.ts.map +1 -1
- package/dist/src/core/shared/primitives/CollapsibleElement.d.ts +1 -1
- package/dist/src/core/shared/primitives/CollapsibleElement.d.ts.map +1 -1
- package/dist/src/core/shared/primitives/ElevationElement.d.ts.map +1 -1
- package/dist/src/core/shared/primitives/FocusRingElement.d.ts.map +1 -1
- package/dist/src/core/shared/primitives/RippleElement.d.ts.map +1 -1
- package/dist/src/core/shared/primitives/ScrollContainerElement.d.ts +3 -1
- package/dist/src/core/shared/primitives/ScrollContainerElement.d.ts.map +1 -1
- package/dist/src/core/shared/primitives/SlideElement.d.ts +3 -1
- package/dist/src/core/shared/primitives/SlideElement.d.ts.map +1 -1
- package/dist/src/core/shared/primitives/StateLayerElement.d.ts.map +1 -1
- package/dist/src/core/shared/primitives/TextHighlightElement.d.ts.map +1 -1
- package/dist/src/core/shared/primitives/TextOverflowElement.d.ts.map +1 -1
- package/dist/src/core/shared/utils/getState.d.ts +15 -0
- package/dist/src/core/shared/utils/getState.d.ts.map +1 -0
- package/dist/src/dialog/DialogActionElement.d.ts.map +1 -1
- package/dist/src/dialog/DialogElement.d.ts +2 -2
- package/dist/src/dialog/DialogElement.d.ts.map +1 -1
- package/dist/src/dialog/DialogTriggerElement.d.ts.map +1 -1
- package/dist/src/drawer-container/DrawerContainerElement.d.ts +3 -1
- package/dist/src/drawer-container/DrawerContainerElement.d.ts.map +1 -1
- package/dist/src/drawer-container/DrawerToggleElement.d.ts.map +1 -1
- package/dist/src/drawer-container/styles/DrawerContainerStyle.d.ts.map +1 -1
- package/dist/src/expansion-panel/ExpansionHeaderElement.d.ts.map +1 -1
- package/dist/src/fab/FabElement.d.ts.map +1 -1
- package/dist/src/fab-menu/FabMenuElement.d.ts +1 -1
- package/dist/src/fab-menu/FabMenuElement.d.ts.map +1 -1
- package/dist/src/fab-menu/FabMenuItemElement.d.ts.map +1 -1
- package/dist/src/fab-menu/FabMenuTriggerElement.d.ts.map +1 -1
- package/dist/src/form-field/FormFieldElement.d.ts.map +1 -1
- package/dist/src/icon-button/IconButtonElement.d.ts +2 -1
- package/dist/src/icon-button/IconButtonElement.d.ts.map +1 -1
- package/dist/src/icon-button/styles/IconButtonSizeStyle.d.ts.map +1 -1
- package/dist/src/icon-button/styles/IconButtonVariantStyle.d.ts.map +1 -1
- package/dist/src/list/ActionListElement.d.ts.map +1 -1
- package/dist/src/list/ListElement.d.ts +1 -1
- package/dist/src/list/ListElement.d.ts.map +1 -1
- package/dist/src/list/ListItemButtonElement.d.ts.map +1 -1
- package/dist/src/list/ListItemElement.d.ts +1 -1
- package/dist/src/list/ListItemElement.d.ts.map +1 -1
- package/dist/src/list/ListOptionElement.d.ts.map +1 -1
- package/dist/src/list/SelectionListElement.d.ts.map +1 -1
- package/dist/src/menu/MenuElement.d.ts +1 -1
- package/dist/src/menu/MenuElement.d.ts.map +1 -1
- package/dist/src/menu/MenuItemCheckboxElement.d.ts.map +1 -1
- package/dist/src/menu/MenuItemGroupElement.d.ts.map +1 -1
- package/dist/src/menu/MenuItemRadioElement.d.ts.map +1 -1
- package/dist/src/menu/MenuTriggerElement.d.ts.map +1 -1
- package/dist/src/nav-bar/NavBarElement.d.ts +1 -1
- package/dist/src/nav-bar/NavBarElement.d.ts.map +1 -1
- package/dist/src/nav-bar/NavItemElement.d.ts.map +1 -1
- package/dist/src/nav-menu/NavMenuElement.d.ts.map +1 -1
- package/dist/src/nav-menu/NavMenuItemElement.d.ts.map +1 -1
- package/dist/src/nav-menu/NavMenuItemGroupElement.d.ts +1 -1
- package/dist/src/nav-menu/NavMenuItemGroupElement.d.ts.map +1 -1
- package/dist/src/nav-rail/NavRailElement.d.ts.map +1 -1
- package/dist/src/nav-rail/NavRailToggleElement.d.ts.map +1 -1
- package/dist/src/option/OptGroupElement.d.ts.map +1 -1
- package/dist/src/option/OptionElement.d.ts +1 -2
- package/dist/src/option/OptionElement.d.ts.map +1 -1
- package/dist/src/option/OptionPanelElement.d.ts +12 -13
- package/dist/src/option/OptionPanelElement.d.ts.map +1 -1
- package/dist/src/paginator/PaginatorElement.d.ts +0 -1
- package/dist/src/paginator/PaginatorElement.d.ts.map +1 -1
- package/dist/src/radio-group/RadioElement.d.ts.map +1 -1
- package/dist/src/radio-group/RadioGroupElement.d.ts.map +1 -1
- package/dist/src/segmented-button/ButtonSegmentElement.d.ts.map +1 -1
- package/dist/src/segmented-button/SegmentedButtonElement.d.ts.map +1 -1
- package/dist/src/select/SelectElement.d.ts.map +1 -1
- package/dist/src/shape/ShapeElement.d.ts.map +1 -1
- package/dist/src/slider/SliderElement.d.ts +3 -1
- package/dist/src/slider/SliderElement.d.ts.map +1 -1
- package/dist/src/slider/SliderThumbElement.d.ts.map +1 -1
- package/dist/src/stepper/StepElement.d.ts.map +1 -1
- package/dist/src/stepper/StepperElement.d.ts.map +1 -1
- package/dist/src/switch/SwitchElement.d.ts.map +1 -1
- package/dist/src/tabs/TabElement.d.ts.map +1 -1
- package/dist/src/tabs/TabPanelElement.d.ts.map +1 -1
- package/dist/src/tabs/TabsElement.d.ts.map +1 -1
- package/dist/src/toc/TocElement.d.ts.map +1 -1
- package/dist/src/tooltip/RichTooltipActionElement.d.ts.map +1 -1
- package/dist/src/tooltip/TooltipElementBase.d.ts +1 -1
- package/dist/src/tooltip/TooltipElementBase.d.ts.map +1 -1
- package/dist/stepper.js +15 -15
- package/dist/stepper.js.map +1 -1
- package/dist/stepper.min.js +1 -1
- package/dist/stepper.min.js.map +1 -1
- package/dist/switch.js +3 -3
- package/dist/switch.js.map +1 -1
- package/dist/switch.min.js +1 -1
- package/dist/switch.min.js.map +1 -1
- package/dist/tabs.js +10 -10
- package/dist/tabs.js.map +1 -1
- package/dist/tabs.min.js +1 -1
- package/dist/tabs.min.js.map +1 -1
- package/dist/textarea-autosize.js +3 -3
- package/dist/textarea-autosize.js.map +1 -1
- package/dist/textarea-autosize.min.js +2 -2
- package/dist/textarea-autosize.min.js.map +1 -1
- package/dist/theme.js +3 -3
- package/dist/theme.js.map +1 -1
- package/dist/theme.min.js +2 -2
- package/dist/theme.min.js.map +1 -1
- package/dist/toc.js +11 -11
- package/dist/toc.js.map +1 -1
- package/dist/toc.min.js +1 -1
- package/dist/toc.min.js.map +1 -1
- package/dist/toolbar.js +3 -3
- package/dist/toolbar.js.map +1 -1
- package/dist/toolbar.min.js +1 -1
- package/dist/toolbar.min.js.map +1 -1
- package/dist/tooltip.js +8 -8
- package/dist/tooltip.js.map +1 -1
- package/dist/tooltip.min.js +1 -1
- package/dist/tooltip.min.js.map +1 -1
- package/package.json +1 -1
package/dist/form-field.js
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* See LICENSE file in the project root for full license text.
|
|
5
5
|
*/
|
|
6
6
|
import { LitElement, nothing, html, css, unsafeCSS } from 'lit';
|
|
7
|
-
import { query, state, property
|
|
8
|
-
import { AttachInternals, MutationController, ResizeController, FocusController, PressedController, HoverController, isReadOnlyMixin, DesignToken, hasAssignedNodes, interceptProperty, getTextContent } from '@m3e/web/core';
|
|
7
|
+
import { query, state, property } from 'lit/decorators.js';
|
|
8
|
+
import { AttachInternals, MutationController, ResizeController, FocusController, setCustomState, PressedController, HoverController, isReadOnlyMixin, DesignToken, element, hasAssignedNodes, hasCustomState, interceptProperty, getTextContent } from '@m3e/web/core';
|
|
9
9
|
import { M3eAriaDescriber } from '@m3e/web/core/a11y';
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -196,10 +196,10 @@ let M3eFormFieldElement = class M3eFormFieldElement extends AttachInternals(LitE
|
|
|
196
196
|
target: null,
|
|
197
197
|
callback: focused => {
|
|
198
198
|
focused = focused && !(__classPrivateFieldGet(this, _M3eFormFieldElement_control, "f")?.disabled ?? true);
|
|
199
|
-
this
|
|
199
|
+
setCustomState(this, "-no-animate", false);
|
|
200
200
|
__classPrivateFieldSet(this, _M3eFormFieldElement_focused, focused, "f");
|
|
201
201
|
if (focused) {
|
|
202
|
-
this
|
|
202
|
+
setCustomState(this, "-float-label", true);
|
|
203
203
|
} else {
|
|
204
204
|
this._invalid = !(__classPrivateFieldGet(this, _M3eFormFieldElement_control, "f")?.checkValidity?.() ?? true);
|
|
205
205
|
this.notifyControlStateChange();
|
|
@@ -227,7 +227,7 @@ let M3eFormFieldElement = class M3eFormFieldElement extends AttachInternals(LitE
|
|
|
227
227
|
/** @private */
|
|
228
228
|
_M3eFormFieldElement_pressedController.set(this, new PressedController(this, {
|
|
229
229
|
target: null,
|
|
230
|
-
callback: pressed => this
|
|
230
|
+
callback: pressed => setCustomState(this, "-pressed", pressed && !(__classPrivateFieldGet(this, _M3eFormFieldElement_control, "f")?.disabled ?? true))
|
|
231
231
|
}));
|
|
232
232
|
/** @private */
|
|
233
233
|
_M3eFormFieldElement_focused.set(this, false);
|
|
@@ -264,7 +264,7 @@ let M3eFormFieldElement = class M3eFormFieldElement extends AttachInternals(LitE
|
|
|
264
264
|
*/
|
|
265
265
|
this.floatLabel = "auto";
|
|
266
266
|
new HoverController(this, {
|
|
267
|
-
callback: () => this
|
|
267
|
+
callback: () => setCustomState(this, "-no-animate", false)
|
|
268
268
|
});
|
|
269
269
|
}
|
|
270
270
|
/** A reference to the element used to anchor dropdown menus. */
|
|
@@ -281,16 +281,16 @@ let M3eFormFieldElement = class M3eFormFieldElement extends AttachInternals(LitE
|
|
|
281
281
|
*/
|
|
282
282
|
notifyControlStateChange(checkValidity = false) {
|
|
283
283
|
this._required = __classPrivateFieldGet(this, _M3eFormFieldElement_control, "f")?.required === true;
|
|
284
|
-
this
|
|
285
|
-
this
|
|
286
|
-
this
|
|
284
|
+
setCustomState(this, "-required", this._required);
|
|
285
|
+
setCustomState(this, "-disabled", __classPrivateFieldGet(this, _M3eFormFieldElement_control, "f")?.disabled === true);
|
|
286
|
+
setCustomState(this, "-readonly", isReadOnlyMixin(__classPrivateFieldGet(this, _M3eFormFieldElement_control, "f")) && __classPrivateFieldGet(this, _M3eFormFieldElement_control, "f").readOnly === true);
|
|
287
287
|
if (this.floatLabel === "auto") {
|
|
288
|
-
this
|
|
288
|
+
setCustomState(this, "-float-label", __classPrivateFieldGet(this, _M3eFormFieldElement_instances, "a", _M3eFormFieldElement_shouldFloatLabel_get) || __classPrivateFieldGet(this, _M3eFormFieldElement_focused, "f"));
|
|
289
289
|
}
|
|
290
290
|
if (checkValidity) {
|
|
291
291
|
this._invalid = !(__classPrivateFieldGet(this, _M3eFormFieldElement_control, "f")?.checkValidity?.() ?? true);
|
|
292
292
|
}
|
|
293
|
-
this
|
|
293
|
+
setCustomState(this, "-invalid", this._invalid);
|
|
294
294
|
this._validationMessage = __classPrivateFieldGet(this, _M3eFormFieldElement_control, "f")?.validationMessage ?? "";
|
|
295
295
|
if (!this.isUpdatePending) {
|
|
296
296
|
this.performUpdate();
|
|
@@ -300,7 +300,7 @@ let M3eFormFieldElement = class M3eFormFieldElement extends AttachInternals(LitE
|
|
|
300
300
|
connectedCallback() {
|
|
301
301
|
super.connectedCallback();
|
|
302
302
|
// Label animations are disabled on initial paint.
|
|
303
|
-
this
|
|
303
|
+
setCustomState(this, "-no-animate", true);
|
|
304
304
|
}
|
|
305
305
|
/** @inheritdoc */
|
|
306
306
|
disconnectedCallback() {
|
|
@@ -361,15 +361,15 @@ _M3eFormFieldElement_handleLabelSlotChange = function _M3eFormFieldElement_handl
|
|
|
361
361
|
const assignedElements = e.target.assignedElements({
|
|
362
362
|
flatten: true
|
|
363
363
|
});
|
|
364
|
-
this
|
|
364
|
+
setCustomState(this, "-with-label", assignedElements.length > 0);
|
|
365
365
|
this._pseudoLabel = assignedElements[0]?.textContent ?? "";
|
|
366
366
|
};
|
|
367
367
|
_M3eFormFieldElement_handlePrefixSlotChange = function _M3eFormFieldElement_handlePrefixSlotChange(e) {
|
|
368
|
-
this
|
|
368
|
+
setCustomState(this, "-with-prefix", hasAssignedNodes(e.target));
|
|
369
369
|
__classPrivateFieldGet(this, _M3eFormFieldElement_resizeController, "f").observe(this._prefix);
|
|
370
370
|
};
|
|
371
371
|
_M3eFormFieldElement_handleSuffixSlotChange = function _M3eFormFieldElement_handleSuffixSlotChange(e) {
|
|
372
|
-
this
|
|
372
|
+
setCustomState(this, "-with-suffix", hasAssignedNodes(e.target));
|
|
373
373
|
};
|
|
374
374
|
_M3eFormFieldElement_handlePrefixResize = function _M3eFormFieldElement_handlePrefixResize() {
|
|
375
375
|
if (this.variant === "outlined") {
|
|
@@ -421,8 +421,8 @@ _M3eFormFieldElement_changeControl = function _M3eFormFieldElement_changeControl
|
|
|
421
421
|
} else {
|
|
422
422
|
this._base.style.removeProperty("--_form-field-cursor");
|
|
423
423
|
}
|
|
424
|
-
this
|
|
425
|
-
if (this
|
|
424
|
+
setCustomState(this, "-with-select", __classPrivateFieldGet(this, _M3eFormFieldElement_control, "f")?.tagName === "M3E-SELECT");
|
|
425
|
+
if (hasCustomState(this, "-with-select")) {
|
|
426
426
|
this._base.style.setProperty("--_form-field-cursor", "pointer");
|
|
427
427
|
}
|
|
428
428
|
if (__classPrivateFieldGet(this, _M3eFormFieldElement_control, "f")) {
|
|
@@ -474,18 +474,18 @@ _M3eFormFieldElement_handleErrorChange = function _M3eFormFieldElement_handleErr
|
|
|
474
474
|
}
|
|
475
475
|
};
|
|
476
476
|
(() => {
|
|
477
|
-
if (
|
|
477
|
+
if (typeof window !== "undefined") {
|
|
478
478
|
const lightDomStyle = new CSSStyleSheet();
|
|
479
|
-
lightDomStyle.replaceSync(css`m3e-form-field input::placeholder, m3e-form-field textarea::placeholder { user-select: none; color: currentColor; transition: opacity ${DesignToken.motion.duration.extraLong1}; } m3e-form-field[float-label="auto"]:not(
|
|
479
|
+
lightDomStyle.replaceSync(css`m3e-form-field input::placeholder, m3e-form-field textarea::placeholder { user-select: none; color: currentColor; transition: opacity ${DesignToken.motion.duration.extraLong1}; } m3e-form-field[float-label="auto"]:not(:state(-float-label)):state(-with-label) input::placeholder, m3e-form-field[float-label="auto"]:not(:state(-float-label)):state(-with-label) textarea::placeholder { opacity: 0; transition: opacity 0s; } m3e-form-field[variant="outlined"] m3e-input-chip-set { margin-block: calc(calc(3.5rem + ${DesignToken.density.calc(-2)}) / 4); } @media (prefers-reduced-motion) { m3e-form-field input::placeholder, m3e-form-field textarea::placeholder { transition: none !important; } }`.toString());
|
|
480
480
|
document.adoptedStyleSheets = [...document.adoptedStyleSheets, lightDomStyle];
|
|
481
481
|
}
|
|
482
482
|
})();
|
|
483
483
|
/** The styles of the element. */
|
|
484
|
-
M3eFormFieldElement.styles = css`:host { display: inline-flex; flex-direction: column; vertical-align: middle; font-size: var(--m3e-form-field-font-size, ${DesignToken.typescale.standard.body.large.fontSize}); font-weight: var(--m3e-form-field-font-weight, ${DesignToken.typescale.standard.body.large.fontWeight}); line-height: var(--m3e-form-field-line-height, ${DesignToken.typescale.standard.body.large.lineHeight}); letter-spacing: var(--m3e-form-field-tracking, ${DesignToken.typescale.standard.body.large.tracking}); width: var(--m3e-form-field-width, 14.5rem); color: var(--_form-field-color); } :host(:not(
|
|
484
|
+
M3eFormFieldElement.styles = css`:host { display: inline-flex; flex-direction: column; vertical-align: middle; font-size: var(--m3e-form-field-font-size, ${DesignToken.typescale.standard.body.large.fontSize}); font-weight: var(--m3e-form-field-font-weight, ${DesignToken.typescale.standard.body.large.fontWeight}); line-height: var(--m3e-form-field-line-height, ${DesignToken.typescale.standard.body.large.lineHeight}); letter-spacing: var(--m3e-form-field-tracking, ${DesignToken.typescale.standard.body.large.tracking}); width: var(--m3e-form-field-width, 14.5rem); color: var(--_form-field-color); } :host(:not(:state(-disabled))) .base { cursor: var(--_form-field-cursor); } .base { display: flex; align-items: center; position: relative; min-height: calc(3.5rem + ${DesignToken.density.calc(-2)}); --_form-field-label-font-size: var( --m3e-form-field-label-font-size, ${DesignToken.typescale.standard.body.small.fontSize} ); --_form-field-label-line-height: var( --m3e-form-field-label-line-height, ${DesignToken.typescale.standard.body.small.lineHeight} ); } .content { display: flex; align-items: center; position: relative; flex: 1 1 auto; min-width: 0; min-height: var(--m3e-form-field-icon-size, 1.5rem); } .prefix, .suffix { display: flex; align-items: center; position: relative; user-select: none; flex: none; font-size: var(--m3e-form-field-icon-size, 1.5rem); } .prefix-text, .suffix-text { opacity: 1; transition: opacity ${DesignToken.motion.duration.extraLong1}; user-select: none; flex: none; } .input { display: inline-flex; flex-wrap: wrap; flex: 1 1 auto; min-width: 0; } .label { display: flex; position: absolute; pointer-events: none; user-select: none; top: 0; left: 0; right: 0; font-size: var(--m3e-form-field-label-font-size, ${DesignToken.typescale.standard.body.small.fontSize}); font-weight: var(--m3e-form-field-label-font-weight, ${DesignToken.typescale.standard.body.small.fontWeight}); line-height: var(--m3e-form-field-label-line-height, ${DesignToken.typescale.standard.body.small.lineHeight}); letter-spacing: var(--m3e-form-field-label-tracking, ${DesignToken.typescale.standard.body.small.tracking}); color: var(--_form-field-label-color, inherit); transition: ${unsafeCSS(`top ${DesignToken.motion.duration.short4},
|
|
485
485
|
font-size ${DesignToken.motion.duration.short4},
|
|
486
|
-
line-height ${DesignToken.motion.duration.short4}`)}; } :host(
|
|
486
|
+
line-height ${DesignToken.motion.duration.short4}`)}; } :host(:state(-with-select)) .label { margin-inline-end: 1.5rem; } ::slotted([slot="label"]) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .subscript { display: inline-flex; width: 100%; margin-top: 0.25rem; font-size: var(--m3e-form-field-subscript-font-size, ${DesignToken.typescale.standard.body.small.fontSize}); font-weight: var(--m3e-form-field-subscript-font-weight, ${DesignToken.typescale.standard.body.small.fontWeight}); line-height: var(--m3e-form-field-subscript-line-height, ${DesignToken.typescale.standard.body.small.lineHeight}); letter-spacing: var(--m3e-form-field-subscript-tracking, ${DesignToken.typescale.standard.body.small.tracking}); min-height: var(--m3e-form-field-subscript-line-height, ${DesignToken.typescale.standard.body.small.lineHeight}); color: var(--m3e-form-field-subscript-color, ${DesignToken.color.onSurfaceVariant}); } .error, .hint { flex: 1 1 auto; } :host([hide-subscript="always"]) .subscript { display: none; } :host([hide-subscript="auto"]:not(:state(-invalid))) .subscript { opacity: 0; margin-top: 0px; margin-bottom: 0.25rem; transition: ${unsafeCSS(`opacity ${DesignToken.motion.duration.short4},
|
|
487
487
|
margin-top ${DesignToken.motion.duration.short4},
|
|
488
|
-
margin-bottom ${DesignToken.motion.duration.short4}`)}; } :host([hide-subscript="auto"]:not(
|
|
488
|
+
margin-bottom ${DesignToken.motion.duration.short4}`)}; } :host([hide-subscript="auto"]:not(:state(-invalid)):focus-within) .subscript, :host([hide-subscript="auto"]:not(:state(-invalid)):state(-pressed)) .subscript { opacity: 1; margin-top: 0.25rem; margin-bottom: 0; } :host(:state(-invalid)) .hint { display: none; } :host(:not(:state(-invalid))) .error { display: none; } ::slotted(input), ::slotted(textarea), ::slotted(select) { outline: unset; border: unset; background-color: transparent; box-shadow: none; font-family: inherit; font-size: inherit; line-height: inherit; letter-spacing: inherit; color: var(--_form-field-input-color, inherit); flex: 1 1 auto; min-width: 0; padding: unset; } ::slotted(textarea) { scrollbar-width: ${DesignToken.scrollbar.thinWidth}; scrollbar-color: ${DesignToken.scrollbar.color}; } ::slotted(m3e-select), ::slotted(m3e-input-chip-set) { flex: 1 1 auto; min-width: 0; } :host([float-label="auto"]:not(:state(-float-label)):not(:state(-pressed))) .label { font-size: inherit; } :host([float-label="auto"]:not(:state(-float-label)):state(-with-label)) .prefix-text, :host([float-label="auto"]:not(:state(-float-label)):state(-with-label)) .suffix-text { opacity: 0; transition: opacity 0s; } .prefix { margin-inline-start: 1rem; } :host(:state(-with-prefix)) .prefix { margin-inline-end: 1rem; margin-inline-start: 0.75rem; } .suffix { margin-inline-end: 1rem; } :host(:state(-with-suffix)) .suffix { margin-inline-start: 0.25rem; margin-inline-end: 0.5rem; } :host(:state(-with-suffix):state(-with-select)) .suffix { margin-inline-start: unset; } :host(:state(-with-select)) .suffix-text { display: none; } :host([variant="outlined"]) .label { margin-top: calc(0px - var(--_form-field-label-line-height) / 2); } :host([variant="outlined"]) .outline { position: absolute; display: flex; pointer-events: none; left: 0; top: 0; bottom: 0; right: 0; } :host([variant="outlined"]) .pseudo-label { visibility: hidden; margin-inline-end: 0.5rem; font-size: var(--_form-field-label-font-size); line-height: var(--_form-field-label-line-height); letter-spacing: var(--_form-field-label-tracking); max-width: 100%; transition-property: max-width, margin-inline-end; transition-duration: 1ms; } :host([variant="outlined"]:state(-required):not([hide-required-marker])) .pseudo-label { margin-inline-end: 0.25rem; } :host([variant="outlined"][float-label="auto"]:not(:state(-float-label)):not(:state(-pressed))) .pseudo-label { max-width: 0; margin-inline-end: 0px; transition-delay: ${DesignToken.motion.duration.short2}; } :host([variant="outlined"]) .outline-start, :host([variant="outlined"]) .outline-notch, :host([variant="outlined"]) .outline-end { box-sizing: border-box; border-width: var(--_form-field-outline-size, 1px); border-color: var(--_form-field-outline-color); transition: border-color ${DesignToken.motion.duration.short4}; } :host([variant="outlined"]:not(:state(-with-label))) .outline-notch { display: none; } :host([variant="outlined"]) .outline-start { min-width: 0.75rem; border-top-style: solid; border-inline-start-style: solid; border-bottom-style: solid; border-start-start-radius: var(--m3e-outlined-form-field-container-shape, ${DesignToken.shape.corner.extraSmall}); border-end-start-radius: var(--m3e-outlined-form-field-container-shape, ${DesignToken.shape.corner.extraSmall}); } :host([variant="outlined"]) .outline-notch { border-bottom-style: solid; } :host([variant="outlined"]) .outline-end { flex-grow: 1; min-width: 1rem; border-top-style: solid; border-inline-end-style: solid; border-bottom-style: solid; border-start-end-radius: var(--m3e-outlined-form-field-container-shape, ${DesignToken.shape.corner.extraSmall}); border-end-end-radius: var(--m3e-outlined-form-field-container-shape, ${DesignToken.shape.corner.extraSmall}); } :host([variant="outlined"]:state(-with-prefix)) .outline-start { min-width: calc(1.25rem + var(--_prefix-width, 0px) + 0.25rem); } :host([variant="outlined"]:not(:state(-disabled))) .base:hover .outline, :host([variant="outlined"]:not(:state(-disabled)):focus-within) .outline, :host([variant="outlined"]:not(:state(-disabled)):state(-pressed)) .outline { --_form-field-outline-size: 2px; } :host([variant="outlined"]) .subscript { margin-inline: 1rem; width: calc(100% - 2rem); } :host([variant="outlined"]) .content { min-height: calc(3.5rem + ${DesignToken.density.calc(-2)}); --_form-field-label-font-size: var( --m3e-form-field-label-font-size, ${DesignToken.typescale.standard.body.small.fontSize} ); } :host([variant="outlined"][float-label="auto"]:not(:state(-float-label)):not(:state(-pressed))) .label { margin-top: unset; line-height: calc(3.5rem + ${DesignToken.density.calc(-2)}); --_form-field-label-font-size: var( --m3e-form-field-label-font-size, ${DesignToken.typescale.standard.body.small.fontSize} ); } :host([variant="filled"]) .base { --_select-arrow-margin-top: calc( 0px - calc(1rem / max(calc(0 - calc(var(--md-sys-density-scale, 0) + var(--md-sys-density-scale, 0))), 1)) ); } :host([variant="filled"]) .base::before { content: ""; box-sizing: border-box; position: absolute; pointer-events: none; top: 0; left: 0; right: 0; bottom: 0; border-bottom-style: solid; border-width: 1px; border-radius: var(--m3e-form-field-container-shape, ${DesignToken.shape.corner.extraSmallTop}); border-color: var(--_form-field-outline-color); background-color: var(--_form-field-container-color); } :host([variant="filled"]:not(:state(-disabled))) .base:hover::before, :host([variant="filled"]:not(:state(-disabled)):focus-within) .base::before, :host([variant="filled"]:not(:state(-disabled)):state(-pressed)) .base::before { border-width: 3px; } :host([variant="filled"]) .base::after { content: ""; box-sizing: border-box; position: absolute; pointer-events: none; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--_form-field-hover-container-color); transition: background-color ${DesignToken.motion.duration.short4}; } :host([variant="filled"]) .subscript { margin-inline: 1rem; width: calc(100% - 2rem); } :host([variant="filled"]) .content { padding-top: calc(1.5rem + ${DesignToken.density.calc(-2)}); margin-bottom: 0.5rem; } :host([variant="filled"]) .label { top: calc(0.5rem + ${DesignToken.density.calc(-2)}); } :host([variant="filled"][float-label="auto"]:not(:state(-float-label)):not(:state(-pressed))) .label { top: 0px; line-height: calc(3.5rem + ${DesignToken.density.calc(-2)} - 0.0625rem); --_form-field-label-font-size: var( --m3e-form-field-label-font-size, ${DesignToken.typescale.standard.body.small.fontSize} ); } :host(:not(:state(-disabled)):not(:focus-within):not(:state(-pressed))) .base:hover { --_form-field-hover-container-color: color-mix( in srgb, var(--m3e-form-field-hover-container-color, ${DesignToken.color.onSurface}) var(--m3e-form-field-hover-container-opacity, 8%), transparent ); } :host(:not(:state(-disabled)):not(:state(-invalid))) { color: var(--m3e-form-field-color, ${DesignToken.color.onSurface}); } :host([variant="outlined"]:not(:state(-disabled)):not(:state(-invalid))) .base { --_form-field-outline-color: var(--m3e-form-field-outline-color, ${DesignToken.color.outline}); } :host([variant="filled"]:not(:state(-disabled)):not(:state(-invalid))) .base { --_form-field-outline-color: var(--m3e-form-field-outline-color, ${DesignToken.color.onSurfaceVariant}); } :host([variant="outlined"]:not(:state(-disabled)):not(:state(-invalid)):focus-within) .base, :host([variant="outlined"]:not(:state(-disabled)):not(:state(-invalid)):state(-pressed)) .base, :host([variant="filled"]:not(:state(-disabled)):not(:state(-invalid)):focus-within) .base, :host([variant="filled"]:not(:state(-disabled)):not(:state(-invalid)):state(-pressed)) .base { --_form-field-outline-color: var(--m3e-form-field-focused-outline-color, ${DesignToken.color.primary}); --_form-field-label-color: var(--m3e-form-field-focused-color, ${DesignToken.color.primary}); } :host(:not(:state(-disabled))) .base { --_form-field-container-color: var( --m3e-form-field-container-color, ${DesignToken.color.surfaceContainerHighest} ); } :host(:not(:state(-disabled)):state(-invalid)) .base { --_form-field-label-color: var(--m3e-form-field-invalid-color, ${DesignToken.color.error}); --_form-field-outline-color: var(--m3e-form-field-invalid-color, ${DesignToken.color.error}); } :host(:not(:state(-disabled)):state(-invalid)) .subscript { color: var(--m3e-form-field-invalid-color, ${DesignToken.color.error}); } :host(:state(-disabled)) { color: color-mix( in srgb, var(--m3e-form-field-disabled-color, ${DesignToken.color.onSurface}) var(--m3e-form-field-disabled-opacity, 38%), transparent ); } :host(:state(-disabled)) .base { --_form-field-container-color: color-mix( in srgb, var(--m3e-form-field-disabled-container-color, ${DesignToken.color.onSurface}) var(--m3e-form-field-disabled-container-opacity, 4%), transparent ); } :host(:state(-no-animate)) *, :host(:state(-no-animate)) *::before, :host(:state(-no-animate)) *::after { transition: none !important; } @media (forced-colors: active) { :host([variant="filled"]) .base::after { transition: none; } :host { --_form-field-outline-color: CanvasText; } :host(:state(-disabled)) { --_form-field-input-color: GrayText; --_form-field-color: GrayText; --_form-field-label-color: GrayText; --_form-field-outline-color: GrayText; } } @media (prefers-reduced-motion) { .base::before, .prefix-text, .suffix-text, .label, .subscript, .outline-start, .outline-notch, .outline-end, .pseudo-label { transition: none !important; } }`;
|
|
489
489
|
__decorate([query(".base")], M3eFormFieldElement.prototype, "_base", void 0);
|
|
490
490
|
__decorate([query(".prefix")], M3eFormFieldElement.prototype, "_prefix", void 0);
|
|
491
491
|
__decorate([query(".error")], M3eFormFieldElement.prototype, "_error", void 0);
|
|
@@ -510,7 +510,7 @@ __decorate([property({
|
|
|
510
510
|
attribute: "float-label",
|
|
511
511
|
reflect: true
|
|
512
512
|
})], M3eFormFieldElement.prototype, "floatLabel", void 0);
|
|
513
|
-
M3eFormFieldElement = __decorate([
|
|
513
|
+
M3eFormFieldElement = __decorate([element("m3e-form-field")], M3eFormFieldElement);
|
|
514
514
|
|
|
515
515
|
export { M3eFormFieldElement, findFormFieldControl, isFormFieldControl };
|
|
516
516
|
//# sourceMappingURL=form-field.js.map
|