@m3e/web 2.1.3 → 2.2.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/README.md +3 -0
- package/dist/all.js +2765 -343
- package/dist/all.js.map +1 -1
- package/dist/all.min.js +77 -41
- package/dist/all.min.js.map +1 -1
- package/dist/app-bar.js +14 -7
- 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 +5 -9
- package/dist/autocomplete.js.map +1 -1
- package/dist/autocomplete.min.js +1 -1
- package/dist/autocomplete.min.js.map +1 -1
- package/dist/bottom-sheet.js +8 -27
- 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/calendar.js +1082 -0
- package/dist/calendar.js.map +1 -0
- package/dist/calendar.min.js +43 -0
- package/dist/calendar.min.js.map +1 -0
- package/dist/chips.js +2 -6
- 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 +23 -9
- package/dist/core-a11y.js.map +1 -1
- package/dist/core-a11y.min.js +4 -4
- package/dist/core-a11y.min.js.map +1 -1
- package/dist/core-anchoring.js +135 -15
- package/dist/core-anchoring.js.map +1 -1
- package/dist/core-anchoring.min.js +1 -1
- package/dist/core-anchoring.min.js.map +1 -1
- package/dist/core.js +101 -1
- 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 +819 -319
- package/dist/custom-elements.json +16252 -11972
- package/dist/datepicker.js +552 -0
- package/dist/datepicker.js.map +1 -0
- package/dist/datepicker.min.js +7 -0
- package/dist/datepicker.min.js.map +1 -0
- package/dist/fab-menu.js +1 -1
- 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/form-field.js +2 -6
- 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/html-custom-data.json +478 -112
- package/dist/menu.js +3 -7
- 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-menu.js +3 -11
- 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 +2 -6
- 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 +3 -7
- 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.map +1 -1
- package/dist/paginator.min.js.map +1 -1
- package/dist/search.js +805 -0
- package/dist/search.js.map +1 -0
- package/dist/search.min.js +7 -0
- package/dist/search.min.js.map +1 -0
- package/dist/select.js +3 -14
- package/dist/select.js.map +1 -1
- package/dist/select.min.js +1 -1
- package/dist/select.min.js.map +1 -1
- package/dist/snackbar.js +2 -6
- package/dist/snackbar.js.map +1 -1
- package/dist/snackbar.min.js +1 -1
- package/dist/snackbar.min.js.map +1 -1
- package/dist/src/all.d.ts +3 -0
- package/dist/src/all.d.ts.map +1 -1
- package/dist/src/app-bar/AppBarElement.d.ts +6 -4
- package/dist/src/app-bar/AppBarElement.d.ts.map +1 -1
- package/dist/src/autocomplete/AutocompleteElement.d.ts +2 -2
- package/dist/src/autocomplete/AutocompleteElement.d.ts.map +1 -1
- package/dist/src/autocomplete/AutocompleteQueryEventDetail.d.ts +12 -0
- package/dist/src/autocomplete/AutocompleteQueryEventDetail.d.ts.map +1 -0
- package/dist/src/autocomplete/QueryEventDetail.d.ts +3 -8
- package/dist/src/autocomplete/QueryEventDetail.d.ts.map +1 -1
- package/dist/src/autocomplete/index.d.ts +1 -0
- package/dist/src/autocomplete/index.d.ts.map +1 -1
- package/dist/src/bottom-sheet/BottomSheetElement.d.ts.map +1 -1
- package/dist/src/calendar/CalendarElement.d.ts +213 -0
- package/dist/src/calendar/CalendarElement.d.ts.map +1 -0
- package/dist/src/calendar/CalendarView.d.ts +3 -0
- package/dist/src/calendar/CalendarView.d.ts.map +1 -0
- package/dist/src/calendar/CalendarViewElementBase.d.ts +28 -0
- package/dist/src/calendar/CalendarViewElementBase.d.ts.map +1 -0
- package/dist/src/calendar/MonthViewElement.d.ts +36 -0
- package/dist/src/calendar/MonthViewElement.d.ts.map +1 -0
- package/dist/src/calendar/MultiYearViewElement.d.ts +27 -0
- package/dist/src/calendar/MultiYearViewElement.d.ts.map +1 -0
- package/dist/src/calendar/YearViewElement.d.ts +27 -0
- package/dist/src/calendar/YearViewElement.d.ts.map +1 -0
- package/dist/src/calendar/index.d.ts +7 -0
- package/dist/src/calendar/index.d.ts.map +1 -0
- package/dist/src/calendar/utils.d.ts +24 -0
- package/dist/src/calendar/utils.d.ts.map +1 -0
- package/dist/src/chips/InputChipSetElement.d.ts.map +1 -1
- package/dist/src/core/a11y/FocusTrapElement.d.ts.map +1 -1
- package/dist/src/core/a11y/InteractivityChecker.d.ts.map +1 -1
- package/dist/src/core/anchoring/AnchorOptions.d.ts +1 -1
- package/dist/src/core/anchoring/AnchorOptions.d.ts.map +1 -1
- package/dist/src/core/anchoring/FloatingPanelElement.d.ts +18 -3
- package/dist/src/core/anchoring/FloatingPanelElement.d.ts.map +1 -1
- package/dist/src/core/anchoring/positionAnchor.d.ts.map +1 -1
- package/dist/src/core/shared/controllers/InertController.d.ts +19 -0
- package/dist/src/core/shared/controllers/InertController.d.ts.map +1 -0
- package/dist/src/core/shared/controllers/index.d.ts +1 -0
- package/dist/src/core/shared/controllers/index.d.ts.map +1 -1
- package/dist/src/core/shared/converters/dateConverter.d.ts +4 -0
- package/dist/src/core/shared/converters/dateConverter.d.ts.map +1 -0
- package/dist/src/core/shared/converters/index.d.ts +1 -0
- package/dist/src/core/shared/converters/index.d.ts.map +1 -1
- package/dist/src/core/shared/utils/index.d.ts +1 -0
- package/dist/src/core/shared/utils/index.d.ts.map +1 -1
- package/dist/src/core/shared/utils/registerStyleSheet.d.ts +7 -0
- package/dist/src/core/shared/utils/registerStyleSheet.d.ts.map +1 -0
- package/dist/src/datepicker/DatepickerElement.d.ts +237 -0
- package/dist/src/datepicker/DatepickerElement.d.ts.map +1 -0
- package/dist/src/datepicker/DatepickerToggleElement.d.ts +21 -0
- package/dist/src/datepicker/DatepickerToggleElement.d.ts.map +1 -0
- package/dist/src/datepicker/DatepickerVariant.d.ts +3 -0
- package/dist/src/datepicker/DatepickerVariant.d.ts.map +1 -0
- package/dist/src/datepicker/index.d.ts +4 -0
- package/dist/src/datepicker/index.d.ts.map +1 -0
- package/dist/src/form-field/FormFieldElement.d.ts.map +1 -1
- package/dist/src/menu/MenuElement.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-rail/NavRailElement.d.ts.map +1 -1
- package/dist/src/option/OptionPanelElement.d.ts.map +1 -1
- package/dist/src/paginator/PageEventDetail.d.ts +6 -11
- package/dist/src/paginator/PageEventDetail.d.ts.map +1 -1
- package/dist/src/paginator/PaginatorElement.d.ts +2 -2
- package/dist/src/paginator/PaginatorElement.d.ts.map +1 -1
- package/dist/src/paginator/PaginatorPageEventDetail.d.ts +12 -0
- package/dist/src/paginator/PaginatorPageEventDetail.d.ts.map +1 -0
- package/dist/src/paginator/index.d.ts +1 -0
- package/dist/src/paginator/index.d.ts.map +1 -1
- package/dist/src/search/SearchBarElement.d.ts +92 -0
- package/dist/src/search/SearchBarElement.d.ts.map +1 -0
- package/dist/src/search/SearchViewElement.d.ts +146 -0
- package/dist/src/search/SearchViewElement.d.ts.map +1 -0
- package/dist/src/search/SearchViewMode.d.ts +3 -0
- package/dist/src/search/SearchViewMode.d.ts.map +1 -0
- package/dist/src/search/SearchViewQueryEventDetail.d.ts +12 -0
- package/dist/src/search/SearchViewQueryEventDetail.d.ts.map +1 -0
- package/dist/src/search/index.d.ts +5 -0
- package/dist/src/search/index.d.ts.map +1 -0
- package/dist/src/search/styles/SearchBarStyle.d.ts +12 -0
- package/dist/src/search/styles/SearchBarStyle.d.ts.map +1 -0
- package/dist/src/search/styles/SearchBarToken.d.ts +27 -0
- package/dist/src/search/styles/SearchBarToken.d.ts.map +1 -0
- package/dist/src/search/styles/SearchViewStyle.d.ts +12 -0
- package/dist/src/search/styles/SearchViewStyle.d.ts.map +1 -0
- package/dist/src/search/styles/SearchViewToken.d.ts +26 -0
- package/dist/src/search/styles/SearchViewToken.d.ts.map +1 -0
- package/dist/src/search/styles/index.d.ts +3 -0
- package/dist/src/search/styles/index.d.ts.map +1 -0
- package/dist/src/select/SelectElement.d.ts.map +1 -1
- package/dist/src/snackbar/SnackbarElement.d.ts.map +1 -1
- package/dist/src/stepper/StepperElement.d.ts.map +1 -1
- package/dist/stepper.js +2 -6
- package/dist/stepper.js.map +1 -1
- package/dist/stepper.min.js +1 -1
- package/dist/stepper.min.js.map +1 -1
- package/dist/tooltip.js +1 -1
- 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 +16 -1
package/dist/all.js
CHANGED
|
@@ -6,21 +6,22 @@
|
|
|
6
6
|
import { __classPrivateFieldGet, __decorate, __classPrivateFieldSet } from 'tslib';
|
|
7
7
|
import { unsafeCSS, css, LitElement, html, nothing, isServer, noChange, svg } from 'lit';
|
|
8
8
|
import { query, property, queryAssignedElements, state } from 'lit/decorators.js';
|
|
9
|
-
import { DesignToken as DesignToken$1, HtmlFor as HtmlFor$1, Role as Role$1, hasAssignedNodes as hasAssignedNodes$1, debounce as debounce$1, customElement as customElement$1, MutationController as MutationController$1, setCustomState as setCustomState$1, deleteCustomState as deleteCustomState$1, prefersReducedMotion as prefersReducedMotion$1, scrollIntoViewIfNeeded as scrollIntoViewIfNeeded$1, forcedColorsActive as forcedColorsActive$1, addCustomState as addCustomState$1, ActionElementBase as ActionElementBase$1,
|
|
9
|
+
import { DesignToken as DesignToken$1, HtmlFor as HtmlFor$1, Role as Role$1, hasAssignedNodes as hasAssignedNodes$1, debounce as debounce$1, customElement as customElement$1, EventAttribute as EventAttribute$1, MutationController as MutationController$1, setCustomState as setCustomState$1, deleteCustomState as deleteCustomState$1, prefersReducedMotion as prefersReducedMotion$1, scrollIntoViewIfNeeded as scrollIntoViewIfNeeded$1, forcedColorsActive as forcedColorsActive$1, addCustomState as addCustomState$1, ActionElementBase as ActionElementBase$1, ReconnectedCallback as ReconnectedCallback$1, SuppressInitialAnimation as SuppressInitialAnimation$1, AttachInternals as AttachInternals$1, VelocityTracker as VelocityTracker$1, ScrollLockController as ScrollLockController$1, InertController as InertController$1, ResizeController as ResizeController$1, focusWhenReady as focusWhenReady$1, hasCustomState as hasCustomState$1, computeCssSize as computeCssSize$1, registerStyleSheet as registerStyleSheet$1, spaceSeparatedStringConverter as spaceSeparatedStringConverter$1, KeyboardClick as KeyboardClick$1, LinkButton as LinkButton$1, FormSubmitter as FormSubmitter$1, Focusable as Focusable$1, DisabledInteractive as DisabledInteractive$1, Disabled as Disabled$1, FocusController as FocusController$1, PressedController as PressedController$1, renderPseudoLink as renderPseudoLink$1, isSelectedMixin as isSelectedMixin$1, dateConverter as dateConverter$1, Labelled as Labelled$1, RequiredConstraintValidation as RequiredConstraintValidation$1, Dirty as Dirty$1, Touched as Touched$1, Required as Required$1, ConstraintValidation as ConstraintValidation$1, CheckedIndeterminate as CheckedIndeterminate$1, FormAssociated as FormAssociated$1, HoverController as HoverController$1, formValue as formValue$1, isDisabledMixin as isDisabledMixin$1, isDisabledInteractiveMixin as isDisabledInteractiveMixin$1, isLinkButtonMixin as isLinkButtonMixin$1, getTextContent as getTextContent$1, Vertical as Vertical$1, Selected as Selected$1, ScrollController as ScrollController$1, isReadOnlyMixin as isReadOnlyMixin$1, interceptProperty as interceptProperty$1, computeLineCount as computeLineCount$1, generateClipPaths as generateClipPaths$1, Checked as Checked$1, AnimationLoopController as AnimationLoopController$1, resolveFragmentUrl as resolveFragmentUrl$1, safeStyleMap as safeStyleMap$1, updateLabels as updateLabels$1, guid as guid$1, IntersectionController as IntersectionController$1, LongPressController as LongPressController$1 } from '@m3e/web/core';
|
|
10
10
|
import { ListKeyManager, M3eLiveAnnouncer, M3eInteractivityChecker, isModifierAllowed, addAriaReferencedId, removeAriaReferencedId, selectionManager, SelectionManager, ListManager, RovingTabIndexManager, M3eAriaDescriber, typeaheadLabel } from '@m3e/web/core/a11y';
|
|
11
11
|
import { M3eOptGroupElement as M3eOptGroupElement$1 } from '@m3e/web/option';
|
|
12
12
|
import { M3eDirectionality } from '@m3e/web/core/bidi';
|
|
13
13
|
import { positionAnchor, M3eFloatingPanelElement } from '@m3e/web/core/anchoring';
|
|
14
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
14
15
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
15
|
-
import {
|
|
16
|
+
import { M3eButtonElement as M3eButtonElement$1 } from '@m3e/web/button';
|
|
16
17
|
import { M3eIconButtonElement as M3eIconButtonElement$1 } from '@m3e/web/icon-button';
|
|
18
|
+
import '@m3e/web/tooltip';
|
|
19
|
+
import { directive, Directive, PartType } from 'lit/directive.js';
|
|
17
20
|
import { M3eBreakpointObserver, Breakpoint } from '@m3e/web/core/layout';
|
|
21
|
+
import '@m3e/web/calendar';
|
|
18
22
|
import { M3eNavBarElement as M3eNavBarElement$1 } from '@m3e/web/nav-bar';
|
|
19
23
|
import '@m3e/web/form-field';
|
|
20
24
|
import '@m3e/web/select';
|
|
21
|
-
import '@m3e/web/tooltip';
|
|
22
|
-
import { classMap } from 'lit/directives/class-map.js';
|
|
23
|
-
import { M3eButtonElement as M3eButtonElement$1 } from '@m3e/web/button';
|
|
24
25
|
import '@m3e/web/button-group';
|
|
25
26
|
import '@m3e/web/slide-group';
|
|
26
27
|
import { M3ePlatform } from '@m3e/web/core/platform';
|
|
@@ -113,7 +114,7 @@ const AppBarToken = {
|
|
|
113
114
|
const AppBarStyle = css`:host { display: block; flex: none; } :host([size="small"]) .base, :host(:not([size="small"]):not([centered])) .heading { padding-inline-start: ${AppBarToken.paddingLeft}; padding-inline-end: ${AppBarToken.paddingRight}; } .base { box-sizing: border-box; display: flex; transition: ${unsafeCSS(`background-color ${DesignToken$1.motion.duration.medium1} ${DesignToken$1.motion.easing.standard},
|
|
114
115
|
box-shadow ${DesignToken$1.motion.duration.medium1} ${DesignToken$1.motion.easing.standard}`)}; } .base:not(.on-scroll) { background-color: ${AppBarToken.containerColor}; box-shadow: ${AppBarToken.containerElevation}; } .base.on-scroll { background-color: ${AppBarToken.containerColorOnScroll}; box-shadow: ${AppBarToken.containerElevationOnScroll}; } .leading-icon, .trailing-icon { display: flex; flex: none; align-items: center; } .leading-icon { min-width: var(--_leading-icon-min-width); } .trailing-icon { min-width: var(--_trailing-icon-min-width); } .heading { display: flex; align-items: center; } :host([size="small"]) .heading { flex: 1 1 auto; } .spacer { flex: 1 1 auto; } .label { display: flex; flex-direction: column; flex: none; } .title { color: ${AppBarToken.titleTextColor}; } .subtitle { color: ${AppBarToken.subtitleTextColor}; } .base:not(.with-title) .title, .base:not(.with-subtitle) .subtitle, .base:not(.with-title):not(.with-subtitle) .label, .base:not(.with-trailing-icon) .trailing-icon { display: none; } :host([size="small"]) .base { align-items: center; } :host([size="small"]) .heading { min-width: 0; } :host([size="small"]) .label { flex: 1 1 auto; min-width: 0; } :host([size="small"]) .title, :host([size="small"]) .subtitle { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } :host(:not([size="small"])) .base { flex-direction: column; } :host([centered]) .title, :host([centered]) .subtitle { text-align: center; } @media (prefers-reduced-motion) { .base { transition: none; } } @media (forced-colors: active) { .base { transition: none; } .base:not(.on-scroll), .base.on-scroll { background-color: Canvas; box-shadow: unset; } .title { color: CanvasText; } .subtitle { color: FieldText; } }`;
|
|
115
116
|
|
|
116
|
-
var _M3eAppBarElement_instances, _M3eAppBarElement_scrollHandler, _M3eAppBarElement_frameLoadHandler, _M3eAppBarElement_handleTitleSlotChange, _M3eAppBarElement_handleSubtitleSlotChange, _M3eAppBarElement_handleLeadingIconSlotChange, _M3eAppBarElement_handleTrailingIconsSlotChange, _M3eAppBarElement_clearCentered, _M3eAppBarElement_computeCentered, _M3eAppBarElement_handleFrameLoad, _M3eAppBarElement_getFrameScrollTop;
|
|
117
|
+
var _M3eAppBarElement_instances, _M3eAppBarElement_scrollHandler, _M3eAppBarElement_frameLoadHandler, _M3eAppBarElement_handleTitleSlotChange, _M3eAppBarElement_handleSubtitleSlotChange, _M3eAppBarElement_handleLeadingIconSlotChange, _M3eAppBarElement_handleTrailingIconsSlotChange, _M3eAppBarElement_handleDeprecatedSlotChange, _M3eAppBarElement_clearCentered, _M3eAppBarElement_computeCentered, _M3eAppBarElement_handleFrameLoad, _M3eAppBarElement_getFrameScrollTop;
|
|
117
118
|
/**
|
|
118
119
|
* A bar, placed a the top of a screen, used to help users navigate through an application.
|
|
119
120
|
*
|
|
@@ -154,10 +155,12 @@ var _M3eAppBarElement_instances, _M3eAppBarElement_scrollHandler, _M3eAppBarElem
|
|
|
154
155
|
*
|
|
155
156
|
* @tag m3e-app-bar
|
|
156
157
|
*
|
|
157
|
-
* @slot leading
|
|
158
|
-
* @slot subtitle - Renders the subtitle.
|
|
159
|
-
* @slot title - Renders the title.
|
|
160
|
-
* @slot trailing
|
|
158
|
+
* @slot leading - Renders content positioned at the start of the bar.
|
|
159
|
+
* @slot subtitle - Renders the subtitle of the bar.
|
|
160
|
+
* @slot title - Renders the title of the bar.
|
|
161
|
+
* @slot trailing - Renders one or more action buttons aligned to the end of the bar.
|
|
162
|
+
* @slot leading-icon - Deprecated: use the `leading` slot.
|
|
163
|
+
* @slot trailing-icon - Deprecated: use the `trailing` slot.
|
|
161
164
|
*
|
|
162
165
|
* @attr centered - Whether the title and subtitle are centered.
|
|
163
166
|
* @attr for - The identifier of the interactive control to which this element is attached.
|
|
@@ -272,9 +275,9 @@ let M3eAppBarElement = class M3eAppBarElement extends HtmlFor$1(Role$1(LitElemen
|
|
|
272
275
|
render() {
|
|
273
276
|
switch (this.size) {
|
|
274
277
|
case "small":
|
|
275
|
-
return html`<div class="base"><div class="leading-icon"><slot name="leading-icon" @slotchange="${__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m",
|
|
278
|
+
return html`<div class="base"><div class="leading-icon"><slot name="leading" @slotchange="${__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_handleLeadingIconSlotChange)}"><slot name="leading-icon" @slotchange="${__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_handleDeprecatedSlotChange)}"></slot></slot></div><div class="heading"><div class="label"><div class="title"><slot name="title" @slotchange="${__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_handleTitleSlotChange)}"></slot></div><div class="subtitle"><slot name="subtitle" @slotchange="${__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_handleSubtitleSlotChange)}"></slot></div></div></div><div class="trailing-icon"><slot name="trailing" @slotchange="${__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_handleTrailingIconsSlotChange)}"><slot name="trailing-icon" @slotchange="${__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_handleDeprecatedSlotChange)}"></slot></slot></div></div>`;
|
|
276
279
|
default:
|
|
277
|
-
return html`<div class="base"><div class="heading"><div class="leading-icon"><slot name="leading-icon" @slotchange="${__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m",
|
|
280
|
+
return html`<div class="base"><div class="heading"><div class="leading-icon"><slot name="leading" @slotchange="${__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_handleLeadingIconSlotChange)}"><slot name="leading-icon" @slotchange="${__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_handleDeprecatedSlotChange)}"></slot></slot></div><div class="spacer"></div><div class="trailing-icon"><slot name="trailing" @slotchange="${__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_handleTrailingIconsSlotChange)}"><slot name="trailing-icon" @slotchange="${__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_handleDeprecatedSlotChange)}"></slot></slot></div></div><div class="spacer"></div><div class="label"><div class="title"><slot name="title" @slotchange="${__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_handleTitleSlotChange)}"></slot></div><div class="subtitle"><slot name="subtitle" @slotchange="${__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_handleSubtitleSlotChange)}"></slot></div></div></div>`;
|
|
278
281
|
}
|
|
279
282
|
}
|
|
280
283
|
/** @private */
|
|
@@ -309,6 +312,11 @@ _M3eAppBarElement_handleTrailingIconsSlotChange = function _M3eAppBarElement_han
|
|
|
309
312
|
setTimeout(() => __classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_computeCentered).call(this), 40);
|
|
310
313
|
}
|
|
311
314
|
};
|
|
315
|
+
_M3eAppBarElement_handleDeprecatedSlotChange = function _M3eAppBarElement_handleDeprecatedSlotChange(e) {
|
|
316
|
+
const deprecatedSlot = e.target.name;
|
|
317
|
+
const useSlot = deprecatedSlot.replace("-icon", "");
|
|
318
|
+
console.warn(`[m3e-app-bar] Slot "${deprecatedSlot}" is deprecated and will be removed in a future release. Use "${useSlot}" instead.`);
|
|
319
|
+
};
|
|
312
320
|
_M3eAppBarElement_clearCentered = function _M3eAppBarElement_clearCentered() {
|
|
313
321
|
this._base?.style.removeProperty("--_leading-icon-min-width");
|
|
314
322
|
this._base?.style.removeProperty("--_trailing-icon-min-width");
|
|
@@ -350,7 +358,7 @@ __decorate([property({
|
|
|
350
358
|
__decorate([debounce$1(40)], M3eAppBarElement.prototype, "_updateScroll", null);
|
|
351
359
|
M3eAppBarElement = __decorate([customElement$1("m3e-app-bar")], M3eAppBarElement);
|
|
352
360
|
|
|
353
|
-
var _M3eAutocompleteElement_instances, _M3eAutocompleteElement_id, _M3eAutocompleteElement_menuId, _M3eAutocompleteElement_clone, _M3eAutocompleteElement_ignoreFocusVisible, _M3eAutocompleteElement_menu, _M3eAutocompleteElement_ignoreHideMenuOnBlur, _M3eAutocompleteElement_inputChanged, _M3eAutocompleteElement_hasFocus, _M3eAutocompleteElement_mutationAbortController, _M3eAutocompleteElement_clickHandler, _M3eAutocompleteElement_formFieldPointerDownHandler, _M3eAutocompleteElement_focusHandler, _M3eAutocompleteElement_blurHandler, _M3eAutocompleteElement_keyDownHandler, _M3eAutocompleteElement_inputHandler, _M3eAutocompleteElement_changeHandler, _M3eAutocompleteElement_menuToggleHandler, _M3eAutocompleteElement_menuPointerDownHandler, _M3eAutocompleteElement_options_get, _M3eAutocompleteElement_input_get, _M3eAutocompleteElement_hasNoDataSlot_get, _M3eAutocompleteElement_hasLoadingSlot_get, _M3eAutocompleteElement_shouldShowMenu_get,
|
|
361
|
+
var _M3eAutocompleteElement_instances, _M3eAutocompleteElement_id, _M3eAutocompleteElement_menuId, _M3eAutocompleteElement_clone, _M3eAutocompleteElement_ignoreFocusVisible, _M3eAutocompleteElement_menu, _M3eAutocompleteElement_ignoreHideMenuOnBlur, _M3eAutocompleteElement_inputChanged, _M3eAutocompleteElement_hasFocus, _M3eAutocompleteElement_mutationAbortController, _M3eAutocompleteElement_clickHandler, _M3eAutocompleteElement_formFieldPointerDownHandler, _M3eAutocompleteElement_focusHandler, _M3eAutocompleteElement_blurHandler, _M3eAutocompleteElement_keyDownHandler, _M3eAutocompleteElement_inputHandler, _M3eAutocompleteElement_changeHandler, _M3eAutocompleteElement_menuToggleHandler, _M3eAutocompleteElement_menuPointerDownHandler, _M3eAutocompleteElement_options_get, _M3eAutocompleteElement_input_get, _M3eAutocompleteElement_hasNoDataSlot_get, _M3eAutocompleteElement_hasLoadingSlot_get, _M3eAutocompleteElement_shouldShowMenu_get, _M3eAutocompleteElement_formField_get, _M3eAutocompleteElement_handleMutation, _M3eAutocompleteElement_handleClick, _M3eAutocompleteElement_handleFormFieldPointerDown, _M3eAutocompleteElement_handleFocus, _M3eAutocompleteElement_handleBlur, _M3eAutocompleteElement_handleInput, _M3eAutocompleteElement_handleChange, _M3eAutocompleteElement_handleKeyDown, _M3eAutocompleteElement_handleMenuPointerDown, _M3eAutocompleteElement_handleMenuToggle, _M3eAutocompleteElement_destroyMenu, _M3eAutocompleteElement_showMenu, _M3eAutocompleteElement_projectClone, _M3eAutocompleteElement_updateMenuState, _M3eAutocompleteElement_hideMenu, _M3eAutocompleteElement_activateOption, _M3eAutocompleteElement_updateSelectionState, _M3eAutocompleteElement_selectOption, _M3eAutocompleteElement_filterOption, _M3eAutocompleteElement_filterOptions, _M3eAutocompleteElement_announceResults, _M3eAutocompleteElement_autoActivate, _M3eAutocompleteElement_deactivateOption;
|
|
354
362
|
var M3eAutocompleteElement_1;
|
|
355
363
|
/**
|
|
356
364
|
* Enhances a text input with suggested options.
|
|
@@ -398,7 +406,7 @@ var M3eAutocompleteElement_1;
|
|
|
398
406
|
* @fires toggle - Emitted when the options menu opens or closes.
|
|
399
407
|
* @fires query - Emitted when the input is focused or when the user modifies its value.
|
|
400
408
|
*/
|
|
401
|
-
let M3eAutocompleteElement = M3eAutocompleteElement_1 = class M3eAutocompleteElement extends HtmlFor$1(LitElement) {
|
|
409
|
+
let M3eAutocompleteElement = M3eAutocompleteElement_1 = class M3eAutocompleteElement extends EventAttribute$1(HtmlFor$1(LitElement), "query") {
|
|
402
410
|
constructor() {
|
|
403
411
|
super();
|
|
404
412
|
_M3eAutocompleteElement_instances.add(this);
|
|
@@ -633,10 +641,6 @@ _M3eAutocompleteElement_hasLoadingSlot_get = function _M3eAutocompleteElement_ha
|
|
|
633
641
|
_M3eAutocompleteElement_shouldShowMenu_get = function _M3eAutocompleteElement_shouldShowMenu_get() {
|
|
634
642
|
return __classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_options_get).some(x => !x.hidden) || this.loading && !this.hideLoading && this.loadingLabel.length > 0 || !this.loading && !this.hideNoData && this.noDataLabel.length > 0;
|
|
635
643
|
};
|
|
636
|
-
_M3eAutocompleteElement_minMenuWidth_get = function _M3eAutocompleteElement_minMenuWidth_get() {
|
|
637
|
-
const formField = __classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_formField_get);
|
|
638
|
-
return `${formField ? formField.menuAnchor.clientWidth : this.control?.clientWidth ?? 0}px`;
|
|
639
|
-
};
|
|
640
644
|
_M3eAutocompleteElement_formField_get = function _M3eAutocompleteElement_formField_get() {
|
|
641
645
|
return this.control?.closest("m3e-form-field") ?? null;
|
|
642
646
|
};
|
|
@@ -857,9 +861,9 @@ _M3eAutocompleteElement_showMenu = function _M3eAutocompleteElement_showMenu() {
|
|
|
857
861
|
__classPrivateFieldGet(this, _M3eAutocompleteElement_menu, "f").classList.add(klass);
|
|
858
862
|
}
|
|
859
863
|
}
|
|
860
|
-
__classPrivateFieldGet(this, _M3eAutocompleteElement_menu, "f").scrollStrategy = "reposition";
|
|
861
864
|
__classPrivateFieldGet(this, _M3eAutocompleteElement_menu, "f").style.overflowX = "hidden";
|
|
862
|
-
__classPrivateFieldGet(this, _M3eAutocompleteElement_menu, "f").
|
|
865
|
+
__classPrivateFieldGet(this, _M3eAutocompleteElement_menu, "f").scrollStrategy = "reposition";
|
|
866
|
+
__classPrivateFieldGet(this, _M3eAutocompleteElement_menu, "f").fitAnchorWidth = true;
|
|
863
867
|
__classPrivateFieldGet(this, _M3eAutocompleteElement_menu, "f").addEventListener("toggle", __classPrivateFieldGet(this, _M3eAutocompleteElement_menuToggleHandler, "f"));
|
|
864
868
|
__classPrivateFieldGet(this, _M3eAutocompleteElement_menu, "f").addEventListener("pointerdown", __classPrivateFieldGet(this, _M3eAutocompleteElement_menuPointerDownHandler, "f"));
|
|
865
869
|
__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "m", _M3eAutocompleteElement_projectClone).call(this);
|
|
@@ -1343,7 +1347,7 @@ let M3eBottomSheetActionElement = class M3eBottomSheetActionElement extends Acti
|
|
|
1343
1347
|
};
|
|
1344
1348
|
M3eBottomSheetActionElement = __decorate([customElement$1("m3e-bottom-sheet-action")], M3eBottomSheetActionElement);
|
|
1345
1349
|
|
|
1346
|
-
var _M3eBottomSheetElement_instances, _M3eBottomSheetElement_documentClickHandler, _M3eBottomSheetElement_documentKeyDownHandler, _M3eBottomSheetElement_windowResizeHandler,
|
|
1350
|
+
var _M3eBottomSheetElement_instances, _M3eBottomSheetElement_documentClickHandler, _M3eBottomSheetElement_documentKeyDownHandler, _M3eBottomSheetElement_windowResizeHandler, _M3eBottomSheetElement_velocityTracker, _M3eBottomSheetElement_scrollLockController, _M3eBottomSheetElement_inertController, _M3eBottomSheetElement_resizeController, _M3eBottomSheetElement_trigger, _M3eBottomSheetElement_dragState, _M3eBottomSheetElement_dragged, _M3eBottomSheetElement_activeDetent, _M3eBottomSheetElement_requestDetent, _M3eBottomSheetElement_cachedContentHeight, _M3eBottomSheetElement_cachedHeaderHeight, _M3eBottomSheetElement_snapAnimation, _M3eBottomSheetElement_initialize, _M3eBottomSheetElement_handleHeaderSlotChange, _M3eBottomSheetElement_handleHeaderPointerDown, _M3eBottomSheetElement_handleHeaderPointerMove, _M3eBottomSheetElement_handleHeaderPointerUp, _M3eBottomSheetElement_handleDocumentClick, _M3eBottomSheetElement_handleDocumentKeyDown, _M3eBottomSheetElement_handleWindowResize, _M3eBottomSheetElement_handleDragHandleClick, _M3eBottomSheetElement_handleDragHandleKeyDown, _M3eBottomSheetElement_getNextHigherDetent, _M3eBottomSheetElement_getNextLowerDetent, _M3eBottomSheetElement_getClosestDetent, _M3eBottomSheetElement_computeDetentHeight, _M3eBottomSheetElement_computeMaxHeight, _M3eBottomSheetElement_computeMinHeight, _M3eBottomSheetElement_computePeekHeight, _M3eBottomSheetElement_computeFitHeight, _M3eBottomSheetElement_handleSectionResize, _M3eBottomSheetElement_snapToDetent, _M3eBottomSheetElement_snapToHeight, _M3eBottomSheetElement_updateHeight;
|
|
1347
1351
|
var M3eBottomSheetElement_1;
|
|
1348
1352
|
/**
|
|
1349
1353
|
* A sheet used to show secondary content anchored to the bottom of the screen.
|
|
@@ -1453,12 +1457,12 @@ let M3eBottomSheetElement = M3eBottomSheetElement_1 = class M3eBottomSheetElemen
|
|
|
1453
1457
|
/** @private */
|
|
1454
1458
|
_M3eBottomSheetElement_windowResizeHandler.set(this, () => __classPrivateFieldGet(this, _M3eBottomSheetElement_instances, "m", _M3eBottomSheetElement_handleWindowResize).call(this));
|
|
1455
1459
|
/** @private */
|
|
1456
|
-
_M3eBottomSheetElement_inerts.set(this, new Array());
|
|
1457
|
-
/** @private */
|
|
1458
1460
|
_M3eBottomSheetElement_velocityTracker.set(this, new VelocityTracker$1());
|
|
1459
1461
|
/** @private */
|
|
1460
1462
|
_M3eBottomSheetElement_scrollLockController.set(this, new ScrollLockController$1(this));
|
|
1461
1463
|
/** @private */
|
|
1464
|
+
_M3eBottomSheetElement_inertController.set(this, new InertController$1(this));
|
|
1465
|
+
/** @private */
|
|
1462
1466
|
_M3eBottomSheetElement_resizeController.set(this, new ResizeController$1(this, {
|
|
1463
1467
|
target: null,
|
|
1464
1468
|
skipInitial: true,
|
|
@@ -1628,7 +1632,7 @@ let M3eBottomSheetElement = M3eBottomSheetElement_1 = class M3eBottomSheetElemen
|
|
|
1628
1632
|
if (this.modal) {
|
|
1629
1633
|
if (this.open) {
|
|
1630
1634
|
__classPrivateFieldSet(this, _M3eBottomSheetElement_trigger, document.activeElement, "f");
|
|
1631
|
-
__classPrivateFieldGet(this,
|
|
1635
|
+
__classPrivateFieldGet(this, _M3eBottomSheetElement_inertController, "f").lock();
|
|
1632
1636
|
__classPrivateFieldGet(this, _M3eBottomSheetElement_scrollLockController, "f").lock();
|
|
1633
1637
|
this.showPopover();
|
|
1634
1638
|
requestAnimationFrame(() => {
|
|
@@ -1644,7 +1648,7 @@ let M3eBottomSheetElement = M3eBottomSheetElement_1 = class M3eBottomSheetElemen
|
|
|
1644
1648
|
}
|
|
1645
1649
|
} else {
|
|
1646
1650
|
__classPrivateFieldGet(this, _M3eBottomSheetElement_instances, "m", _M3eBottomSheetElement_snapToHeight).call(this, 0).then(() => {
|
|
1647
|
-
__classPrivateFieldGet(this,
|
|
1651
|
+
__classPrivateFieldGet(this, _M3eBottomSheetElement_inertController, "f").unlock();
|
|
1648
1652
|
__classPrivateFieldGet(this, _M3eBottomSheetElement_scrollLockController, "f").unlock();
|
|
1649
1653
|
document.removeEventListener("click", __classPrivateFieldGet(this, _M3eBottomSheetElement_documentClickHandler, "f"));
|
|
1650
1654
|
document.removeEventListener("keydown", __classPrivateFieldGet(this, _M3eBottomSheetElement_documentKeyDownHandler, "f"));
|
|
@@ -1667,9 +1671,9 @@ let M3eBottomSheetElement = M3eBottomSheetElement_1 = class M3eBottomSheetElemen
|
|
|
1667
1671
|
_M3eBottomSheetElement_documentClickHandler = new WeakMap();
|
|
1668
1672
|
_M3eBottomSheetElement_documentKeyDownHandler = new WeakMap();
|
|
1669
1673
|
_M3eBottomSheetElement_windowResizeHandler = new WeakMap();
|
|
1670
|
-
_M3eBottomSheetElement_inerts = new WeakMap();
|
|
1671
1674
|
_M3eBottomSheetElement_velocityTracker = new WeakMap();
|
|
1672
1675
|
_M3eBottomSheetElement_scrollLockController = new WeakMap();
|
|
1676
|
+
_M3eBottomSheetElement_inertController = new WeakMap();
|
|
1673
1677
|
_M3eBottomSheetElement_resizeController = new WeakMap();
|
|
1674
1678
|
_M3eBottomSheetElement_trigger = new WeakMap();
|
|
1675
1679
|
_M3eBottomSheetElement_dragState = new WeakMap();
|
|
@@ -1978,27 +1982,8 @@ _M3eBottomSheetElement_updateHeight = function _M3eBottomSheetElement_updateHeig
|
|
|
1978
1982
|
content.inert = height <= __classPrivateFieldGet(this, _M3eBottomSheetElement_instances, "m", _M3eBottomSheetElement_computePeekHeight).call(this);
|
|
1979
1983
|
}
|
|
1980
1984
|
};
|
|
1981
|
-
_M3eBottomSheetElement_applyInert = function _M3eBottomSheetElement_applyInert() {
|
|
1982
|
-
__classPrivateFieldGet(this, _M3eBottomSheetElement_inerts, "f").length = 0;
|
|
1983
|
-
for (let current = this; current.parentNode && current.parentNode !== document.documentElement; current = current.parentNode) {
|
|
1984
|
-
for (const sibling of current.parentNode.children) {
|
|
1985
|
-
if (sibling instanceof HTMLElement && sibling !== current && !sibling.inert) {
|
|
1986
|
-
sibling.inert = true;
|
|
1987
|
-
__classPrivateFieldGet(this, _M3eBottomSheetElement_inerts, "f").push(sibling);
|
|
1988
|
-
}
|
|
1989
|
-
}
|
|
1990
|
-
}
|
|
1991
|
-
};
|
|
1992
|
-
_M3eBottomSheetElement_restoreInert = function _M3eBottomSheetElement_restoreInert() {
|
|
1993
|
-
__classPrivateFieldGet(this, _M3eBottomSheetElement_inerts, "f").forEach(x => x.inert = false);
|
|
1994
|
-
__classPrivateFieldGet(this, _M3eBottomSheetElement_inerts, "f").length = 0;
|
|
1995
|
-
};
|
|
1996
1985
|
(() => {
|
|
1997
|
-
|
|
1998
|
-
const lightDomStyle = new CSSStyleSheet();
|
|
1999
|
-
lightDomStyle.replaceSync(css`@property --_bottom-sheet-height { syntax: "<length>"; inherits: false; initial-value: 50vh; } m3e-bottom-sheet > [slot="header"] { margin-block-end: var(--m3e-bottom-sheet-padding-block, 0.5rem); margin-inline: var(--m3e-bottom-sheet-padding-inline, 1rem); }</length>`.toString());
|
|
2000
|
-
document.adoptedStyleSheets.push(lightDomStyle);
|
|
2001
|
-
}
|
|
1986
|
+
registerStyleSheet$1(css`@property --_bottom-sheet-height { syntax: "<length>"; inherits: false; initial-value: 50vh; } m3e-bottom-sheet > [slot="header"] { margin-block-end: var(--m3e-bottom-sheet-padding-block, 0.5rem); margin-inline: var(--m3e-bottom-sheet-padding-inline, 1rem); }</length>`);
|
|
2002
1987
|
})();
|
|
2003
1988
|
/** The styles of the element. */
|
|
2004
1989
|
M3eBottomSheetElement.styles = css`:host { display: block; position: fixed; left: 50%; top: calc(100vh - var(--_bottom-sheet-height)); margin: 0; padding: 0; outline: none; overflow: hidden; border: none; box-sizing: border-box; width: var(--m3e-bottom-sheet-width, 100%); max-width: var(--m3e-bottom-sheet-max-width, 40rem); height: var(--_bottom-sheet-height); color: var(--m3e-bottom-sheet-color, ${DesignToken$1.color.onSurface}); background-color: var(--m3e-bottom-sheet-container-color, ${DesignToken$1.color.surfaceContainerLow}); } :host(:not(:state(-no-animate))) { transition: ${unsafeCSS(`transform ${DesignToken$1.motion.duration.medium2} ${DesignToken$1.motion.easing.standardDecelerate},
|
|
@@ -3612,142 +3597,1206 @@ __decorate([queryAssignedElements({
|
|
|
3612
3597
|
})], M3eButtonGroupElement.prototype, "buttons", void 0);
|
|
3613
3598
|
M3eButtonGroupElement = __decorate([customElement$1("m3e-button-group")], M3eButtonGroupElement);
|
|
3614
3599
|
|
|
3600
|
+
/** @private */
|
|
3601
|
+
function createDateWithOverflow(year, month, day) {
|
|
3602
|
+
const date = new Date();
|
|
3603
|
+
date.setFullYear(year, month, day);
|
|
3604
|
+
date.setHours(0, 0, 0, 0);
|
|
3605
|
+
return date;
|
|
3606
|
+
}
|
|
3607
|
+
/** @private */
|
|
3608
|
+
function getStartingYear(minDate, maxDate) {
|
|
3609
|
+
if (maxDate) {
|
|
3610
|
+
return maxDate.getFullYear() - YEARS_PER_PAGE + 1;
|
|
3611
|
+
} else if (minDate) {
|
|
3612
|
+
return minDate.getFullYear();
|
|
3613
|
+
}
|
|
3614
|
+
return 0;
|
|
3615
|
+
}
|
|
3616
|
+
/** @private */
|
|
3617
|
+
function euclideanModulo(a, b) {
|
|
3618
|
+
return (a % b + b) % b;
|
|
3619
|
+
}
|
|
3620
|
+
/** @internal */
|
|
3621
|
+
function addCalendarDays(date, days) {
|
|
3622
|
+
return createDateWithOverflow(date.getFullYear(), date.getMonth(), date.getDate() + days);
|
|
3623
|
+
}
|
|
3624
|
+
/** @internal */
|
|
3625
|
+
function addCalendarMonths(date, months) {
|
|
3626
|
+
let newDate = createDateWithOverflow(date.getFullYear(), date.getMonth() + months, date.getDate());
|
|
3627
|
+
if (newDate.getMonth() != ((date.getMonth() + months) % 12 + 12) % 12) {
|
|
3628
|
+
newDate = createDateWithOverflow(newDate.getFullYear(), newDate.getMonth(), 0);
|
|
3629
|
+
}
|
|
3630
|
+
return newDate;
|
|
3631
|
+
}
|
|
3632
|
+
/** @internal */
|
|
3633
|
+
function addCalendarYears(date, years) {
|
|
3634
|
+
return addCalendarMonths(date, years * 12);
|
|
3635
|
+
}
|
|
3636
|
+
/** @internal */
|
|
3637
|
+
function getNumDaysInMonth(date) {
|
|
3638
|
+
return createDateWithOverflow(date.getFullYear(), date.getMonth() + 1, 0).getDate();
|
|
3639
|
+
}
|
|
3640
|
+
/** @internal */
|
|
3641
|
+
function compareDate(first, second) {
|
|
3642
|
+
return first.getFullYear() - second.getFullYear() || first.getMonth() - second.getMonth() || first.getDate() - second.getDate();
|
|
3643
|
+
}
|
|
3644
|
+
/** @internal */
|
|
3645
|
+
function sameDate(first, second) {
|
|
3646
|
+
return first && second ? compareDate(first, second) == 0 : first == second;
|
|
3647
|
+
}
|
|
3648
|
+
/** @internal */
|
|
3649
|
+
function getActiveOffset(activeDate, minDate, maxDate) {
|
|
3650
|
+
return euclideanModulo(activeDate.getFullYear() - getStartingYear(minDate, maxDate), YEARS_PER_PAGE);
|
|
3651
|
+
}
|
|
3652
|
+
/** @internal */
|
|
3653
|
+
function minYearOfPage(activeDate, minDate, maxDate) {
|
|
3654
|
+
return activeDate.getFullYear() - getActiveOffset(activeDate, minDate, maxDate);
|
|
3655
|
+
}
|
|
3656
|
+
/** @internal */
|
|
3657
|
+
function maxYearOfPage(activeDate, minDate, maxDate) {
|
|
3658
|
+
return minYearOfPage(activeDate, minDate, maxDate) + YEARS_PER_PAGE - 1;
|
|
3659
|
+
}
|
|
3660
|
+
/** @internal */
|
|
3661
|
+
function clampDate(date, minDate, maxDate) {
|
|
3662
|
+
if (minDate && compareDate(date, minDate) < 0) return minDate;
|
|
3663
|
+
if (maxDate && compareDate(date, maxDate) > 0) return maxDate;
|
|
3664
|
+
return date;
|
|
3665
|
+
}
|
|
3666
|
+
/** @internal */
|
|
3667
|
+
const YEARS_PER_PAGE = 15;
|
|
3668
|
+
/** @internal */
|
|
3669
|
+
const YEARS_PER_ROW = 3;
|
|
3670
|
+
/** @internal */
|
|
3671
|
+
const MONTHS_PER_ROW = 4;
|
|
3672
|
+
|
|
3615
3673
|
/**
|
|
3616
|
-
*
|
|
3674
|
+
* A base implementation for a view in a calendar. This class must be inherited.
|
|
3617
3675
|
* @internal
|
|
3618
3676
|
*/
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3677
|
+
class CalendarViewElementBase extends LitElement {
|
|
3678
|
+
constructor() {
|
|
3679
|
+
super(...arguments);
|
|
3680
|
+
/** Today's date. */
|
|
3681
|
+
this.today = new Date();
|
|
3682
|
+
/** The selected date. */
|
|
3683
|
+
this.date = null;
|
|
3684
|
+
/** The active date. */
|
|
3685
|
+
this.activeDate = new Date();
|
|
3686
|
+
/** The minimum date that can be selected. */
|
|
3687
|
+
this.minDate = null;
|
|
3688
|
+
/** The maximum date that can be selected. */
|
|
3689
|
+
this.maxDate = null;
|
|
3690
|
+
}
|
|
3691
|
+
/**
|
|
3692
|
+
* Asynchronously focuses the active date.
|
|
3693
|
+
* @returns {Promise<void>} A promise that resolves after the active date has been focused.
|
|
3694
|
+
*/
|
|
3695
|
+
async focusActiveCell() {
|
|
3696
|
+
if (this.isUpdatePending) {
|
|
3697
|
+
await this.updateComplete;
|
|
3698
|
+
}
|
|
3699
|
+
if (this._activeItem) {
|
|
3700
|
+
await focusWhenReady$1(this._activeItem);
|
|
3701
|
+
}
|
|
3702
|
+
}
|
|
3703
|
+
/** @internal */
|
|
3704
|
+
_changeActiveDate(activeDate) {
|
|
3705
|
+
activeDate = clampDate(activeDate, this.minDate, this.maxDate);
|
|
3706
|
+
if (!sameDate(activeDate, this.activeDate)) {
|
|
3707
|
+
this._activeItem?.style.setProperty("--m3e-state-layer-duration", "0ms");
|
|
3708
|
+
this._activeItem?.blur();
|
|
3709
|
+
this._activeItem?.style.removeProperty("--m3e-state-layer-duration");
|
|
3710
|
+
this.activeDate = activeDate;
|
|
3711
|
+
this.dispatchEvent(new Event("active-change", {
|
|
3712
|
+
bubbles: false
|
|
3713
|
+
}));
|
|
3714
|
+
}
|
|
3715
|
+
}
|
|
3716
|
+
}
|
|
3717
|
+
/** The styles of the element. */
|
|
3718
|
+
CalendarViewElementBase.styles = css`:host { display: inline-block; user-select: none; vertical-align: top; } .visually-hidden { position: absolute; appearance: none; visibility: hidden; border: none; outline: none; overflow: hidden; left: 0; height: 1px; width: 1px; margin: -1px; padding: 0; white-space: nowrap; } table { border-collapse: collapse; border-spacing: 0; width: calc(3rem * 7); } td, th { font: inherit; text-align: center; padding: unset; } td { box-sizing: border-box; height: 3rem; padding: 0.25rem; position: relative; } .item, .item > span { position: relative; } .item { display: flex; align-items: center; justify-content: center; border-radius: inherit; outline: none; width: 100%; height: 100%; border-radius: ${DesignToken$1.shape.corner.full}; } .item:not([aria-disabled]) { cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } .touch { position: absolute; height: 3rem; width: 3rem; margin: auto; } td:not(:has(.item[aria-disabled])).selected { color: var(--m3e-calendar-item-selected-color, ${DesignToken$1.color.onPrimary}); --m3e-ripple-color: var(--m3e-calendar-item-selected-ripple-color, ${DesignToken$1.color.onPrimary}); --m3e-state-layer-hover-color: var(--m3e-calendar-item-selected-hover-color, ${DesignToken$1.color.onPrimary}); --m3e-state-layer-focus-color: var(--m3e-calendar-item-selected-focus-color, ${DesignToken$1.color.onPrimary}); } td:not(:has(.item[aria-disabled])).selected .state-layer { background-color: var(--m3e-calendar-item-selected-container-color, ${DesignToken$1.color.primary}); } td.current:not(.selected):not(.special):not(.range-start):not(.range-end) { color: var(--m3e-calendar-item-current-outline-color, ${DesignToken$1.color.primary}); } td.current:not(.selected):not(.special):not(.range-start):not(.range-end) .state-layer { outline-style: solid; outline-offset: -1px; outline-width: var(--m3e-calendar-item-current-outline-thickness, 1px); outline-color: var(--m3e-calendar-item-current-outline-color, ${DesignToken$1.color.primary}); } td:has(.item[aria-disabled]) { color: color-mix( in srgb, var(--m3e-calendar-item-disabled-color, ${DesignToken$1.color.onSurface}) var(--m3e-calendar-item-disabled-color-opacity, 38%), transparent ); } @media (forced-colors: active) { td:not(:has(.item[aria-disabled])).selected { forced-color-adjust: none; color: ButtonFace; } td:not(:has(.item[aria-disabled])).selected .state-layer { background-color: ButtonText; } td:has(.item[aria-disabled]) { color: GrayText; } td.current:not(.selected):not(.special):not(.range-start):not(.range-end) { color: ButtonText; } td.current:not(.selected):not(.special):not(.range-start):not(.range-end) .state-layer { border-color: ButtonText; } }`;
|
|
3719
|
+
__decorate([query(".active > .item")], CalendarViewElementBase.prototype, "_activeItem", void 0);
|
|
3720
|
+
__decorate([property({
|
|
3721
|
+
converter: dateConverter$1
|
|
3722
|
+
})], CalendarViewElementBase.prototype, "today", void 0);
|
|
3723
|
+
__decorate([property({
|
|
3724
|
+
converter: dateConverter$1
|
|
3725
|
+
})], CalendarViewElementBase.prototype, "date", void 0);
|
|
3726
|
+
__decorate([property({
|
|
3727
|
+
attribute: "active-date",
|
|
3728
|
+
converter: dateConverter$1
|
|
3729
|
+
})], CalendarViewElementBase.prototype, "activeDate", void 0);
|
|
3730
|
+
__decorate([property({
|
|
3731
|
+
attribute: "min-date",
|
|
3732
|
+
converter: dateConverter$1
|
|
3733
|
+
})], CalendarViewElementBase.prototype, "minDate", void 0);
|
|
3734
|
+
__decorate([property({
|
|
3735
|
+
attribute: "max-date",
|
|
3736
|
+
converter: dateConverter$1
|
|
3737
|
+
})], CalendarViewElementBase.prototype, "maxDate", void 0);
|
|
3623
3738
|
|
|
3624
3739
|
/**
|
|
3625
|
-
*
|
|
3740
|
+
* Adapted from Angular Material Datepicker
|
|
3741
|
+
* Source: https://github.com/angular/components/blob/main/src/material/datepicker/month-view.ts
|
|
3742
|
+
*
|
|
3743
|
+
* @license MIT
|
|
3744
|
+
* Copyright (c) 2025 Google LLC
|
|
3745
|
+
* See LICENSE file in the project root for full license text.
|
|
3746
|
+
*/
|
|
3747
|
+
var _M3eMonthViewElement_instances, _M3eMonthViewElement_renderItem, _M3eMonthViewElement_handleItemClick, _M3eMonthViewElement_handleItemKeyDown, _M3eMonthViewElement_handleItemMouseEnter, _M3eMonthViewElement_handleItemFocus, _M3eMonthViewElement_setRangeHighlight, _M3eMonthViewElement_clearRangeHighlight;
|
|
3748
|
+
/**
|
|
3749
|
+
* An internal component used to display a single month in a calendar.
|
|
3626
3750
|
* @internal
|
|
3627
3751
|
*/
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3752
|
+
let M3eMonthViewElement = class M3eMonthViewElement extends CalendarViewElementBase {
|
|
3753
|
+
constructor() {
|
|
3754
|
+
super(...arguments);
|
|
3755
|
+
_M3eMonthViewElement_instances.add(this);
|
|
3756
|
+
/** @internal */
|
|
3757
|
+
this._suppressFocusHighlight = true;
|
|
3758
|
+
/** Start of a date range. */
|
|
3759
|
+
this.rangeStart = null;
|
|
3760
|
+
/** End of a date range. */
|
|
3761
|
+
this.rangeEnd = null;
|
|
3762
|
+
/** A function used to determine whether a date cannot be selected. */
|
|
3763
|
+
this.blackoutDates = null;
|
|
3764
|
+
/** A function used to determine whether a date is special. */
|
|
3765
|
+
this.specialDates = null;
|
|
3766
|
+
}
|
|
3767
|
+
/** @inheritdoc */
|
|
3768
|
+
render() {
|
|
3769
|
+
const date = new Date(this.today);
|
|
3770
|
+
date.setDate(1);
|
|
3771
|
+
while (date.getDay() != 0) {
|
|
3772
|
+
date.setDate(date.getDate() + 1);
|
|
3773
|
+
}
|
|
3774
|
+
const weekdays = new Array();
|
|
3775
|
+
const narrowFormat = new Intl.DateTimeFormat(navigator.language, {
|
|
3776
|
+
weekday: "narrow"
|
|
3777
|
+
});
|
|
3778
|
+
const longFormat = new Intl.DateTimeFormat(navigator.language, {
|
|
3779
|
+
weekday: "long"
|
|
3780
|
+
});
|
|
3781
|
+
for (let i = 0; i < 7; i++) {
|
|
3782
|
+
weekdays.push({
|
|
3783
|
+
id: i,
|
|
3784
|
+
narrow: narrowFormat.format(date),
|
|
3785
|
+
long: longFormat.format(date)
|
|
3786
|
+
});
|
|
3787
|
+
date.setDate(date.getDate() + 1);
|
|
3788
|
+
}
|
|
3789
|
+
const year = this.activeDate.getFullYear();
|
|
3790
|
+
const month = this.activeDate.getMonth();
|
|
3791
|
+
const firstDate = new Date(year, month, 1);
|
|
3792
|
+
const lastDate = new Date(year, month + 1, 0);
|
|
3793
|
+
const numDays = lastDate.getDate();
|
|
3794
|
+
let weeks = [];
|
|
3795
|
+
let dayOfWeek = firstDate.getDay();
|
|
3796
|
+
for (let i = 1; i <= numDays; i++) {
|
|
3797
|
+
if (dayOfWeek === 0 || weeks.length === 0) {
|
|
3798
|
+
weeks.push([]);
|
|
3799
|
+
}
|
|
3800
|
+
weeks[weeks.length - 1].push(i);
|
|
3801
|
+
dayOfWeek = (dayOfWeek + 1) % 7;
|
|
3802
|
+
}
|
|
3803
|
+
weeks = weeks.filter(x => !!x.length);
|
|
3804
|
+
return html`<table role="grid"><thead><tr>${weekdays.map(x => html`<th scope="col"><span class="visually-hidden">${x.long}</span><div id="weekday-${x.id}-month-${month}" aria-hidden="true">${x.narrow}</div><m3e-tooltip for="weekday-${x.id}-month-${month}">${x.long}</m3e-tooltip></th>`)}</tr></thead><tbody>${weeks.map((row, i) => html`<tr role="row">${i === 0 && row.length < 7 ? html`<td colspan="${7 - row.length}"></td>` : nothing} ${row.map(y => __classPrivateFieldGet(this, _M3eMonthViewElement_instances, "m", _M3eMonthViewElement_renderItem).call(this, new Date(year, month, y)))} ${i > 0 && row.length < 7 ? html`<td colspan="${7 - row.length}"></td>` : nothing}</tr>`)}</tbody></table>`;
|
|
3805
|
+
}
|
|
3806
|
+
};
|
|
3807
|
+
_M3eMonthViewElement_instances = new WeakSet();
|
|
3808
|
+
_M3eMonthViewElement_renderItem = function _M3eMonthViewElement_renderItem(value) {
|
|
3809
|
+
const long = new Intl.DateTimeFormat(navigator.language, {
|
|
3810
|
+
year: "numeric",
|
|
3811
|
+
month: "long",
|
|
3812
|
+
day: "numeric"
|
|
3813
|
+
}).format(value);
|
|
3814
|
+
const special = this.specialDates?.(value) ?? false;
|
|
3815
|
+
const selected = sameDate(this.date, value);
|
|
3816
|
+
const active = sameDate(this.activeDate, value);
|
|
3817
|
+
const current = sameDate(this.today, value);
|
|
3818
|
+
const disabled = this.minDate && compareDate(value, this.minDate) < 0 || this.maxDate && compareDate(value, this.maxDate) > 0 || this.blackoutDates?.(value) === true;
|
|
3819
|
+
const id = `date-${value.getMonth()}-${value.getDate()}-${value.getFullYear()}`;
|
|
3820
|
+
let range = false,
|
|
3821
|
+
rangeStart = false,
|
|
3822
|
+
rangeEnd = false,
|
|
3823
|
+
rangeStartRange = false;
|
|
3824
|
+
if (this.rangeStart) {
|
|
3825
|
+
if (!this.rangeEnd) {
|
|
3826
|
+
rangeStart = sameDate(value, this.rangeStart);
|
|
3827
|
+
} else {
|
|
3828
|
+
range = compareDate(value, this.rangeStart) > 0 && compareDate(value, this.rangeEnd) < 0;
|
|
3829
|
+
if (!range) {
|
|
3830
|
+
rangeStart = compareDate(value, this.rangeStart) >= 0 && compareDate(value, this.rangeEnd) < 0;
|
|
3831
|
+
if (!rangeStart) {
|
|
3832
|
+
rangeEnd = compareDate(value, this.rangeStart) > 0 && compareDate(value, this.rangeEnd) <= 0;
|
|
3833
|
+
} else {
|
|
3834
|
+
rangeStartRange = true;
|
|
3835
|
+
}
|
|
3836
|
+
}
|
|
3660
3837
|
}
|
|
3661
|
-
}
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
stateLayerColor: unsafeCSS(`var(--m3e-elevated-card-focus-state-layer-color, var(--m3e-card-focus-state-layer-color, ${DesignToken$1.color.onSurface}))`),
|
|
3685
|
-
stateLayerOpacity: unsafeCSS(`var(--m3e-elevated-card-focus-state-layer-opacity, var(--m3e-card-focus-state-layer-opacity, ${DesignToken$1.state.focusStateLayerOpacity}))`),
|
|
3686
|
-
containerElevation: unsafeCSS(`var(--m3e-elevated-card-focus-container-elevation, var(--m3e-card-focus-container-elevation, ${DesignToken$1.elevation.level1}))`)
|
|
3687
|
-
},
|
|
3688
|
-
pressed: {
|
|
3689
|
-
textColor: unsafeCSS(`var(--m3e-elevated-card-pressed-text-color, var(--m3e-card-pressed-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
3690
|
-
stateLayerColor: unsafeCSS(`var(--m3e-elevated-card-pressed-state-layer-color, var(--m3e-card-pressed-state-layer-color, ${DesignToken$1.color.onSurface}))`),
|
|
3691
|
-
stateLayerOpacity: unsafeCSS(`var(--m3e-elevated-card-pressed-state-layer-opacity, var(--m3e-card-pressed-state-layer-opacity, ${DesignToken$1.state.pressedStateLayerOpacity}))`),
|
|
3692
|
-
containerElevation: unsafeCSS(`var(--m3e-elevated-card-pressed-container-elevation, var(--m3e-card-pressed-container-elevation, ${DesignToken$1.elevation.level1}))`)
|
|
3838
|
+
}
|
|
3839
|
+
return html`<td role="gridcell" class="${classMap({
|
|
3840
|
+
current,
|
|
3841
|
+
selected,
|
|
3842
|
+
active,
|
|
3843
|
+
special,
|
|
3844
|
+
range,
|
|
3845
|
+
"range-start": rangeStart,
|
|
3846
|
+
"range-start-range": rangeStartRange,
|
|
3847
|
+
"range-end": rangeEnd
|
|
3848
|
+
})}"><div id="${id}" role="button" class="item" data-value="${value.toISOString()}" tabindex="${active ? "0" : "-1"}" aria-disabled="${ifDefined(disabled || undefined)}" aria-current="${ifDefined(current ? "date" : undefined)}" aria-pressed="${selected || rangeStart || rangeEnd}" @click="${__classPrivateFieldGet(this, _M3eMonthViewElement_instances, "m", _M3eMonthViewElement_handleItemClick)}" @mouseenter="${__classPrivateFieldGet(this, _M3eMonthViewElement_instances, "m", _M3eMonthViewElement_handleItemMouseEnter)}" @focus="${__classPrivateFieldGet(this, _M3eMonthViewElement_instances, "m", _M3eMonthViewElement_handleItemFocus)}" @mouseleave="${__classPrivateFieldGet(this, _M3eMonthViewElement_instances, "m", _M3eMonthViewElement_clearRangeHighlight)}" @blur="${__classPrivateFieldGet(this, _M3eMonthViewElement_instances, "m", _M3eMonthViewElement_clearRangeHighlight)}" @keydown="${__classPrivateFieldGet(this, _M3eMonthViewElement_instances, "m", _M3eMonthViewElement_handleItemKeyDown)}"><m3e-focus-ring class="focus-ring" for="${id}"></m3e-focus-ring><m3e-state-layer class="state-layer" for="${id}" ?disable-hover="${disabled}"></m3e-state-layer><m3e-ripple class="ripple" centered for="${id}" ?disabled="${disabled}"></m3e-ripple><div class="touch"></div><span class="visually-hidden">${long}</span> <span aria-hidden="true">${value.getDate()}</span></div></td>`;
|
|
3849
|
+
};
|
|
3850
|
+
_M3eMonthViewElement_handleItemClick = function _M3eMonthViewElement_handleItemClick(e) {
|
|
3851
|
+
const item = e.currentTarget;
|
|
3852
|
+
if (item.ariaDisabled === "true" || !item.dataset["value"]) return;
|
|
3853
|
+
this.activeDate = new Date(item.dataset["value"]);
|
|
3854
|
+
this.activeDate = clampDate(this.activeDate, this.minDate, this.maxDate);
|
|
3855
|
+
if (this.rangeStart) {
|
|
3856
|
+
if (compareDate(this.activeDate, this.rangeStart) < 0) {
|
|
3857
|
+
this.rangeStart = this.activeDate;
|
|
3858
|
+
this.rangeEnd = null;
|
|
3859
|
+
} else {
|
|
3860
|
+
this.rangeEnd = this.activeDate;
|
|
3693
3861
|
}
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3862
|
+
__classPrivateFieldGet(this, _M3eMonthViewElement_instances, "m", _M3eMonthViewElement_clearRangeHighlight).call(this);
|
|
3863
|
+
}
|
|
3864
|
+
this.dispatchEvent(new Event("change", {
|
|
3865
|
+
bubbles: false
|
|
3866
|
+
}));
|
|
3867
|
+
};
|
|
3868
|
+
_M3eMonthViewElement_handleItemKeyDown = function _M3eMonthViewElement_handleItemKeyDown(e) {
|
|
3869
|
+
let activeDate = this.activeDate;
|
|
3870
|
+
switch (e.key) {
|
|
3871
|
+
case " ":
|
|
3872
|
+
case "Enter":
|
|
3873
|
+
e.preventDefault();
|
|
3874
|
+
e.currentTarget.click();
|
|
3875
|
+
return;
|
|
3876
|
+
case "ArrowLeft":
|
|
3877
|
+
case "Left":
|
|
3878
|
+
activeDate = addCalendarDays(activeDate, M3eDirectionality.current === "rtl" ? 1 : -1);
|
|
3879
|
+
break;
|
|
3880
|
+
case "ArrowRight":
|
|
3881
|
+
case "Right":
|
|
3882
|
+
activeDate = addCalendarDays(activeDate, M3eDirectionality.current === "rtl" ? -1 : 1);
|
|
3883
|
+
break;
|
|
3884
|
+
case "ArrowUp":
|
|
3885
|
+
case "Up":
|
|
3886
|
+
activeDate = addCalendarDays(activeDate, -7);
|
|
3887
|
+
break;
|
|
3888
|
+
case "ArrowDown":
|
|
3889
|
+
case "Down":
|
|
3890
|
+
activeDate = addCalendarDays(activeDate, 7);
|
|
3891
|
+
break;
|
|
3892
|
+
case "Home":
|
|
3893
|
+
activeDate = addCalendarDays(activeDate, 1 - activeDate.getDate());
|
|
3894
|
+
break;
|
|
3895
|
+
case "End":
|
|
3896
|
+
activeDate = addCalendarDays(activeDate, getNumDaysInMonth(activeDate) - activeDate.getDate());
|
|
3897
|
+
break;
|
|
3898
|
+
case "PageUp":
|
|
3899
|
+
activeDate = e.altKey ? addCalendarYears(activeDate, -1) : addCalendarMonths(activeDate, -1);
|
|
3900
|
+
break;
|
|
3901
|
+
case "PageDown":
|
|
3902
|
+
activeDate = e.altKey ? addCalendarYears(activeDate, 1) : addCalendarMonths(activeDate, 1);
|
|
3903
|
+
break;
|
|
3904
|
+
default:
|
|
3905
|
+
return;
|
|
3906
|
+
}
|
|
3907
|
+
e.preventDefault();
|
|
3908
|
+
this._changeActiveDate(activeDate);
|
|
3909
|
+
};
|
|
3910
|
+
_M3eMonthViewElement_handleItemMouseEnter = function _M3eMonthViewElement_handleItemMouseEnter(e) {
|
|
3911
|
+
__classPrivateFieldGet(this, _M3eMonthViewElement_instances, "m", _M3eMonthViewElement_setRangeHighlight).call(this, e.currentTarget);
|
|
3912
|
+
};
|
|
3913
|
+
_M3eMonthViewElement_handleItemFocus = function _M3eMonthViewElement_handleItemFocus(e) {
|
|
3914
|
+
if (!this._suppressFocusHighlight) {
|
|
3915
|
+
__classPrivateFieldGet(this, _M3eMonthViewElement_instances, "m", _M3eMonthViewElement_setRangeHighlight).call(this, e.currentTarget);
|
|
3916
|
+
}
|
|
3917
|
+
};
|
|
3918
|
+
_M3eMonthViewElement_setRangeHighlight = function _M3eMonthViewElement_setRangeHighlight(item) {
|
|
3919
|
+
__classPrivateFieldGet(this, _M3eMonthViewElement_instances, "m", _M3eMonthViewElement_clearRangeHighlight).call(this);
|
|
3920
|
+
if (this.rangeStart && item.dataset["value"]) {
|
|
3921
|
+
if (compareDate(new Date(item.dataset["value"]), this.rangeStart) > 0) {
|
|
3922
|
+
item.parentElement.classList.add("range-highlight-end");
|
|
3923
|
+
}
|
|
3924
|
+
for (const cell of item.closest("table")?.querySelectorAll(".item") ?? []) {
|
|
3925
|
+
if (cell === item) break;
|
|
3926
|
+
const value = new Date(cell.dataset["value"]);
|
|
3927
|
+
if (compareDate(value, this.rangeStart) > 0) {
|
|
3928
|
+
cell.parentElement.classList.add("range-highlight");
|
|
3929
|
+
} else if (compareDate(value, this.rangeStart) >= 0) {
|
|
3930
|
+
cell.parentElement.classList.add("range-highlight-start");
|
|
3931
|
+
}
|
|
3731
3932
|
}
|
|
3732
3933
|
}
|
|
3733
3934
|
};
|
|
3935
|
+
_M3eMonthViewElement_clearRangeHighlight = function _M3eMonthViewElement_clearRangeHighlight() {
|
|
3936
|
+
if (this.rangeStart) {
|
|
3937
|
+
this.shadowRoot?.querySelectorAll(".range-highlight,.range-highlight-end,.range-highlight-start").forEach(x => x.classList.remove("range-highlight", "range-highlight-end", "range-highlight-start"));
|
|
3938
|
+
}
|
|
3939
|
+
};
|
|
3940
|
+
/** The styles of the element. */
|
|
3941
|
+
M3eMonthViewElement.styles = [CalendarViewElementBase.styles, css`thead { font-size: var(--m3e-calendar-weekday-font-size, ${DesignToken$1.typescale.standard.title.small.fontSize}); font-weight: var(--m3e-calendar-weekday-font-weight, ${DesignToken$1.typescale.standard.title.small.fontWeight}); line-height: var(--m3e-calendar-weekday-line-height, ${DesignToken$1.typescale.standard.title.small.lineHeight}); letter-spacing: var(--m3e-calendar-weekday-tracking, ${DesignToken$1.typescale.standard.title.small.tracking}); } th { height: 1.5rem; padding-block-start: 1.875rem; padding-block-end: 1rem; } tbody { font-size: var(--m3e-calendar-date-font-size, ${DesignToken$1.typescale.standard.body.medium.fontSize}); font-weight: var(--m3e-calendar-date-font-weight, ${DesignToken$1.typescale.standard.body.medium.fontWeight}); line-height: var(--m3e-calendar-date-line-height, ${DesignToken$1.typescale.standard.body.medium.lineHeight}); letter-spacing: var(--m3e-calendar-date-tracking, ${DesignToken$1.typescale.standard.body.medium.tracking}); } td:not(:has(.item[aria-disabled])):not(.selected):not(.range-start):not(.range-end).special { color: var(--m3e-calendar-item-special-color, ${DesignToken$1.color.onTertiaryContainer}); --m3e-ripple-color: var(--m3e-calendar-item-special-ripple-color, ${DesignToken$1.color.onTertiaryContainer}); --m3e-state-layer-hover-color: var( --m3e-calendar-item-special-hover-color, ${DesignToken$1.color.onTertiaryContainer} ); --m3e-state-layer-focus-color: var( --m3e-calendar-item-special-focus-color, ${DesignToken$1.color.onTertiaryContainer} ); } td:not(:has(.item[aria-disabled])):not(.selected):not(.range-start):not(.range-end).special .state-layer { background-color: var(--m3e-calendar-item-special-container-color, ${DesignToken$1.color.tertiaryContainer}); } td:not(:has(.item[aria-disabled])).range-start, td:not(:has(.item[aria-disabled])).range-end { color: var(--m3e-calendar-item-selected-color, ${DesignToken$1.color.onPrimary}); --m3e-ripple-color: var(--m3e-calendar-item-selected-ripple-color, ${DesignToken$1.color.onPrimary}); } td:not(:has(.item[aria-disabled])).range-start .state-layer, td:not(:has(.item[aria-disabled])).range-end .state-layer { background-color: var(--m3e-calendar-item-selected-container-color, ${DesignToken$1.color.primary}); } td:not(:has(.item[aria-disabled])).range::before, td:not(:has(.item[aria-disabled])).range-start-range::before, td:not(:has(.item[aria-disabled])).range-end::before { content: ""; position: absolute; left: 0; right: 0; top: 0.25rem; bottom: 0.25rem; background-color: var(--m3e-calendar-range-container-color, ${DesignToken$1.color.primaryContainer}); } td:not(:has(.item[aria-disabled])):not(.selected).range { color: var(--m3e-calendar-range-color, ${DesignToken$1.color.onPrimaryContainer}); } td:not(:has(.item[aria-disabled])).range-start::before { inset-inline-start: 50%; width: 50%; } td:not(:has(.item[aria-disabled])).range-end::before { inset-inline-end: 50%; width: 50%; } td:not(:has(.item[aria-disabled])).range-highlight-start .item::after, td:not(:has(.item[aria-disabled])).range-highlight .item::after, td:not(:has(.item[aria-disabled])).range-highlight-end .item::after { content: ""; position: absolute; top: 0; left: calc(0px - 0.1875rem); right: calc(0px - 0.1875rem); bottom: 0; border-style: dashed; border-color: ${DesignToken$1.color.primary}; border-width: 1px; } td:not(:has(.item[aria-disabled])).range-highlight-start .item::after { margin-inline-start: 50%; } td:not(:has(.item[aria-disabled])).range-highlight-end .item::after { margin-inline-end: 0.1875rem; } td:not(:has(.item[aria-disabled])).range-highlight-start .item::after, td:not(:has(.item[aria-disabled])).range-highlight .item::after { border-inline-style: none; } td:not(:has(.item[aria-disabled])).range-highlight-end .item::after { border-start-end-radius: ${DesignToken$1.shape.corner.full}; border-end-end-radius: ${DesignToken$1.shape.corner.full}; border-inline-start-style: none; } @media (forced-colors: active) { td:not(:has(.item[aria-disabled])).range-start, td:not(:has(.item[aria-disabled])).range-end { forced-color-adjust: none; color: HighlightText; } td:not(:has(.item[aria-disabled])).range-start .state-layer, td:not(:has(.item[aria-disabled])).range-end .state-layer { background-color: Highlight; } td:not(:has(.item[aria-disabled])).range::before, td:not(:has(.item[aria-disabled])).range-start-range::before, td:not(:has(.item[aria-disabled])).range-end::before { background-color: Highlight; } td:not(:has(.item[aria-disabled])):not(.selected).range { forced-color-adjust: none; color: HighlightText; } td:not(:has(.item[aria-disabled])).range-highlight-start .item::after, td:not(:has(.item[aria-disabled])).range-highlight .item::after, td:not(:has(.item[aria-disabled])).range-highlight-end .item::after { border-color: GrayText; } }`];
|
|
3942
|
+
__decorate([property({
|
|
3943
|
+
attribute: "range-start",
|
|
3944
|
+
converter: dateConverter$1
|
|
3945
|
+
})], M3eMonthViewElement.prototype, "rangeStart", void 0);
|
|
3946
|
+
__decorate([property({
|
|
3947
|
+
attribute: "range-end",
|
|
3948
|
+
converter: dateConverter$1
|
|
3949
|
+
})], M3eMonthViewElement.prototype, "rangeEnd", void 0);
|
|
3950
|
+
__decorate([property({
|
|
3951
|
+
attribute: false
|
|
3952
|
+
})], M3eMonthViewElement.prototype, "blackoutDates", void 0);
|
|
3953
|
+
__decorate([property({
|
|
3954
|
+
attribute: false
|
|
3955
|
+
})], M3eMonthViewElement.prototype, "specialDates", void 0);
|
|
3956
|
+
M3eMonthViewElement = __decorate([customElement$1("m3e-month-view")], M3eMonthViewElement);
|
|
3734
3957
|
|
|
3735
3958
|
/**
|
|
3736
|
-
*
|
|
3959
|
+
* Adapted from Angular Material Datepicker
|
|
3960
|
+
* Source: https://github.com/angular/components/blob/main/src/material/datepicker/multi-year-view.ts
|
|
3961
|
+
*
|
|
3962
|
+
* @license MIT
|
|
3963
|
+
* Copyright (c) 2025 Google LLC
|
|
3964
|
+
* See LICENSE file in the project root for full license text.
|
|
3965
|
+
*/
|
|
3966
|
+
var _M3eMultiYearViewElement_instances, _M3eMultiYearViewElement_renderItem, _M3eMultiYearViewElement_handleItemClick, _M3eMultiYearViewElement_handleItemKeyDown;
|
|
3967
|
+
/**
|
|
3968
|
+
* An internal component used to display a year selector in a calendar.
|
|
3737
3969
|
* @internal
|
|
3738
3970
|
*/
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3971
|
+
let M3eMultiYearViewElement = class M3eMultiYearViewElement extends CalendarViewElementBase {
|
|
3972
|
+
constructor() {
|
|
3973
|
+
super(...arguments);
|
|
3974
|
+
_M3eMultiYearViewElement_instances.add(this);
|
|
3975
|
+
}
|
|
3976
|
+
/** @inheritdoc */
|
|
3977
|
+
render() {
|
|
3978
|
+
const years = new Array();
|
|
3979
|
+
const minYear = minYearOfPage(this.activeDate, this.minDate, this.maxDate);
|
|
3980
|
+
for (let i = 0, row = []; i < YEARS_PER_PAGE; i++) {
|
|
3981
|
+
row.push(minYear + i);
|
|
3982
|
+
if (row.length === YEARS_PER_ROW) {
|
|
3983
|
+
years.push(row);
|
|
3984
|
+
row = new Array();
|
|
3985
|
+
}
|
|
3986
|
+
}
|
|
3987
|
+
return html`<table role="grid"><thead aria-hidden="true"><tr><th colspan="${YEARS_PER_ROW}"></th></tr></thead><tbody>${years.map(row => html`<tr role="row">${row.map(year => __classPrivateFieldGet(this, _M3eMultiYearViewElement_instances, "m", _M3eMultiYearViewElement_renderItem).call(this, year))}</tr>`)}</tbody></table>`;
|
|
3988
|
+
}
|
|
3989
|
+
};
|
|
3990
|
+
_M3eMultiYearViewElement_instances = new WeakSet();
|
|
3991
|
+
_M3eMultiYearViewElement_renderItem = function _M3eMultiYearViewElement_renderItem(year) {
|
|
3992
|
+
const yearFormat = new Intl.DateTimeFormat(navigator.language, {
|
|
3993
|
+
year: "numeric"
|
|
3994
|
+
});
|
|
3995
|
+
const active = this.activeDate.getFullYear() === year;
|
|
3996
|
+
const selected = this.date?.getFullYear() === year;
|
|
3997
|
+
const current = this.today.getFullYear() === year;
|
|
3998
|
+
const disabled = this.minDate && year < this.minDate.getFullYear() || this.maxDate && year > this.maxDate.getFullYear();
|
|
3999
|
+
const id = `year-${year}`;
|
|
4000
|
+
return html`<td role="gridcell" class="${classMap({
|
|
4001
|
+
current,
|
|
4002
|
+
selected,
|
|
4003
|
+
active
|
|
4004
|
+
})}"><div id="${id}" class="item" role="button" tabindex="${active ? "0" : "-1"}" data-value="${year}" aria-disabled="${ifDefined(disabled || undefined)}" aria-current="${ifDefined(current ? "date" : undefined)}" aria-pressed="${selected}" @click="${__classPrivateFieldGet(this, _M3eMultiYearViewElement_instances, "m", _M3eMultiYearViewElement_handleItemClick)}" @keydown="${__classPrivateFieldGet(this, _M3eMultiYearViewElement_instances, "m", _M3eMultiYearViewElement_handleItemKeyDown)}"><m3e-focus-ring class="focus-ring" for="${id}"></m3e-focus-ring><m3e-state-layer class="state-layer" for="${id}" ?disable-hover="${disabled}"></m3e-state-layer><m3e-ripple class="ripple" for="${id}" centered ?disabled="${disabled}"></m3e-ripple><div class="touch"></div><span>${yearFormat.format(new Date(year, 0, 1))}</span></div></td>`;
|
|
4005
|
+
};
|
|
4006
|
+
_M3eMultiYearViewElement_handleItemClick = function _M3eMultiYearViewElement_handleItemClick(e) {
|
|
4007
|
+
const item = e.currentTarget;
|
|
4008
|
+
if (item.ariaDisabled === "true" || !item.dataset["value"]) return;
|
|
4009
|
+
this.activeDate = new Date(this.activeDate);
|
|
4010
|
+
this.activeDate.setFullYear(Number(item.dataset["value"]));
|
|
4011
|
+
this.activeDate = clampDate(this.activeDate, this.minDate, this.maxDate);
|
|
4012
|
+
this.dispatchEvent(new Event("change", {
|
|
4013
|
+
bubbles: false
|
|
4014
|
+
}));
|
|
4015
|
+
};
|
|
4016
|
+
_M3eMultiYearViewElement_handleItemKeyDown = function _M3eMultiYearViewElement_handleItemKeyDown(e) {
|
|
4017
|
+
let activeDate = this.activeDate;
|
|
4018
|
+
switch (e.key) {
|
|
4019
|
+
case " ":
|
|
4020
|
+
case "Enter":
|
|
4021
|
+
e.preventDefault();
|
|
4022
|
+
e.currentTarget.click();
|
|
4023
|
+
return;
|
|
4024
|
+
case "ArrowLeft":
|
|
4025
|
+
case "Left":
|
|
4026
|
+
activeDate = addCalendarYears(activeDate, M3eDirectionality.current === "rtl" ? 1 : -1);
|
|
4027
|
+
break;
|
|
4028
|
+
case "ArrowRight":
|
|
4029
|
+
case "Right":
|
|
4030
|
+
activeDate = addCalendarYears(activeDate, M3eDirectionality.current === "rtl" ? -1 : 1);
|
|
4031
|
+
break;
|
|
4032
|
+
case "ArrowUp":
|
|
4033
|
+
case "Up":
|
|
4034
|
+
activeDate = addCalendarYears(activeDate, -YEARS_PER_ROW);
|
|
4035
|
+
break;
|
|
4036
|
+
case "ArrowDown":
|
|
4037
|
+
case "Down":
|
|
4038
|
+
activeDate = addCalendarYears(activeDate, YEARS_PER_ROW);
|
|
4039
|
+
break;
|
|
4040
|
+
case "Home":
|
|
4041
|
+
activeDate = addCalendarYears(activeDate, -getActiveOffset(activeDate, this.minDate, this.maxDate));
|
|
4042
|
+
break;
|
|
4043
|
+
case "End":
|
|
4044
|
+
activeDate = addCalendarYears(activeDate, YEARS_PER_PAGE - getActiveOffset(activeDate, this.minDate, this.maxDate) - 1);
|
|
4045
|
+
break;
|
|
4046
|
+
case "PageUp":
|
|
4047
|
+
activeDate = addCalendarYears(activeDate, e.altKey ? -YEARS_PER_PAGE * 10 : -YEARS_PER_PAGE);
|
|
4048
|
+
break;
|
|
4049
|
+
case "PageDown":
|
|
4050
|
+
activeDate = addCalendarYears(activeDate, e.altKey ? YEARS_PER_PAGE * 10 : YEARS_PER_PAGE);
|
|
4051
|
+
break;
|
|
4052
|
+
default:
|
|
4053
|
+
return;
|
|
4054
|
+
}
|
|
4055
|
+
e.preventDefault();
|
|
4056
|
+
this._changeActiveDate(activeDate);
|
|
4057
|
+
};
|
|
4058
|
+
/** The styles of the element. */
|
|
4059
|
+
M3eMultiYearViewElement.styles = [CalendarViewElementBase.styles, css`.item { height: 2.25rem; } .touch { width: 100%; } th { height: 1rem; } td { padding-inline: 1rem; } tbody { font-size: var(--m3e-calendar-item-font-size, ${DesignToken$1.typescale.standard.body.medium.fontSize}); font-weight: var(--m3e-calendar-item-font-weight, ${DesignToken$1.typescale.standard.body.medium.fontWeight}); line-height: var(--m3e-calendar-item-line-height, ${DesignToken$1.typescale.standard.body.medium.lineHeight}); letter-spacing: var(--m3e-calendar-item-tracking, ${DesignToken$1.typescale.standard.body.medium.tracking}); }`];
|
|
4060
|
+
M3eMultiYearViewElement = __decorate([customElement$1("m3e-multi-year-view")], M3eMultiYearViewElement);
|
|
4061
|
+
|
|
4062
|
+
/**
|
|
4063
|
+
* Adapted from Angular Material Datepicker
|
|
4064
|
+
* Source: https://github.com/angular/components/blob/main/src/material/datepicker/year-view.ts
|
|
4065
|
+
*
|
|
4066
|
+
* @license MIT
|
|
4067
|
+
* Copyright (c) 2025 Google LLC
|
|
4068
|
+
* See LICENSE file in the project root for full license text.
|
|
4069
|
+
*/
|
|
4070
|
+
var _M3eYearViewElement_instances, _M3eYearViewElement_renderItem, _M3eYearViewElement_handleItemClick, _M3eYearViewElement_handleItemKeyDown;
|
|
4071
|
+
/**
|
|
4072
|
+
* An internal component used to display a single year in a calendar.
|
|
4073
|
+
* @internal
|
|
4074
|
+
*/
|
|
4075
|
+
let M3eYearViewElement = class M3eYearViewElement extends CalendarViewElementBase {
|
|
4076
|
+
constructor() {
|
|
4077
|
+
super(...arguments);
|
|
4078
|
+
_M3eYearViewElement_instances.add(this);
|
|
4079
|
+
}
|
|
4080
|
+
/** @inheritdoc */
|
|
4081
|
+
render() {
|
|
4082
|
+
const months = new Array();
|
|
4083
|
+
const shortFormat = new Intl.DateTimeFormat(navigator.language, {
|
|
4084
|
+
month: "short"
|
|
4085
|
+
});
|
|
4086
|
+
const longFormat = new Intl.DateTimeFormat(navigator.language, {
|
|
4087
|
+
month: "long"
|
|
4088
|
+
});
|
|
4089
|
+
const year = this.activeDate.getFullYear();
|
|
4090
|
+
for (let month = 0, row = new Array(); month < 12; month++) {
|
|
4091
|
+
const date = new Date(year, month, 1);
|
|
4092
|
+
row.push({
|
|
4093
|
+
narrow: shortFormat.format(date),
|
|
4094
|
+
long: longFormat.format(date),
|
|
4095
|
+
date: date
|
|
4096
|
+
});
|
|
4097
|
+
if (row.length == MONTHS_PER_ROW) {
|
|
4098
|
+
months.push(row);
|
|
4099
|
+
row = [];
|
|
4100
|
+
}
|
|
4101
|
+
}
|
|
4102
|
+
return html`<table role="grid"><thead aria-hidden="true"><tr><th colspan="${MONTHS_PER_ROW}"></th></tr></thead><tbody>${months.map(row => html`<tr role="row">${row.map(month => __classPrivateFieldGet(this, _M3eYearViewElement_instances, "m", _M3eYearViewElement_renderItem).call(this, month))}</tr>`)}</tbody></table>`;
|
|
4103
|
+
}
|
|
4104
|
+
};
|
|
4105
|
+
_M3eYearViewElement_instances = new WeakSet();
|
|
4106
|
+
_M3eYearViewElement_renderItem = function _M3eYearViewElement_renderItem(month) {
|
|
4107
|
+
const active = this.activeDate.getFullYear() === month.date.getFullYear() && this.activeDate.getMonth() === month.date.getMonth();
|
|
4108
|
+
const selected = this.date?.getFullYear() === month.date.getFullYear() && this.date?.getMonth() === month.date.getMonth();
|
|
4109
|
+
const current = this.today.getFullYear() === month.date.getFullYear() && this.today.getMonth() === month.date.getMonth();
|
|
4110
|
+
const disabled = this.minDate && (month.date.getFullYear() < this.minDate.getFullYear() || month.date.getFullYear() === this.minDate.getFullYear() && month.date.getMonth() < this.minDate.getMonth()) || this.maxDate && (month.date.getFullYear() > this.maxDate.getFullYear() || month.date.getFullYear() === this.maxDate.getFullYear() && month.date.getMonth() > this.maxDate.getMonth());
|
|
4111
|
+
const id = `month-${month.date.getMonth()}`;
|
|
4112
|
+
return html`<td role="gridcell" class="${classMap({
|
|
4113
|
+
current,
|
|
4114
|
+
selected,
|
|
4115
|
+
active
|
|
4116
|
+
})}"><div id="${id}" class="item" role="button" tabindex="${active ? "0" : "-1"}" data-value="${month.date.toISOString()}" aria-disabled="${ifDefined(disabled || undefined)}" aria-current="${ifDefined(current ? "date" : undefined)}" aria-pressed="${selected}" @click="${__classPrivateFieldGet(this, _M3eYearViewElement_instances, "m", _M3eYearViewElement_handleItemClick)}" @keydown="${__classPrivateFieldGet(this, _M3eYearViewElement_instances, "m", _M3eYearViewElement_handleItemKeyDown)}"><m3e-focus-ring class="focus-ring" for="${id}"></m3e-focus-ring><m3e-state-layer class="state-layer" for="${id}" ?disable-hover="${disabled}"></m3e-state-layer><m3e-ripple class="ripple" centered for="${id}" ?disabled="${disabled}"></m3e-ripple><div class="touch"></div><span class="visually-hidden">${month.long}</span> <span aria-hidden="true">${month.narrow}</span></div></td>`;
|
|
4117
|
+
};
|
|
4118
|
+
_M3eYearViewElement_handleItemClick = function _M3eYearViewElement_handleItemClick(e) {
|
|
4119
|
+
const item = e.currentTarget;
|
|
4120
|
+
if (item.ariaDisabled === "true" || !item.dataset["value"]) return;
|
|
4121
|
+
this.activeDate = clampDate(new Date(item.dataset["value"]), this.minDate, this.maxDate);
|
|
4122
|
+
this.dispatchEvent(new Event("change", {
|
|
4123
|
+
bubbles: false
|
|
4124
|
+
}));
|
|
4125
|
+
};
|
|
4126
|
+
_M3eYearViewElement_handleItemKeyDown = function _M3eYearViewElement_handleItemKeyDown(e) {
|
|
4127
|
+
let activeDate = this.activeDate;
|
|
4128
|
+
switch (e.key) {
|
|
4129
|
+
case " ":
|
|
4130
|
+
case "Enter":
|
|
4131
|
+
e.preventDefault();
|
|
4132
|
+
e.currentTarget.click();
|
|
4133
|
+
return;
|
|
4134
|
+
case "ArrowLeft":
|
|
4135
|
+
case "Left":
|
|
4136
|
+
activeDate = addCalendarMonths(activeDate, M3eDirectionality.current === "rtl" ? 1 : -1);
|
|
4137
|
+
break;
|
|
4138
|
+
case "ArrowRight":
|
|
4139
|
+
case "Right":
|
|
4140
|
+
activeDate = addCalendarMonths(activeDate, M3eDirectionality.current === "rtl" ? -1 : 1);
|
|
4141
|
+
break;
|
|
4142
|
+
case "ArrowUp":
|
|
4143
|
+
case "Up":
|
|
4144
|
+
activeDate = addCalendarMonths(activeDate, -4);
|
|
4145
|
+
break;
|
|
4146
|
+
case "ArrowDown":
|
|
4147
|
+
case "Down":
|
|
4148
|
+
activeDate = addCalendarMonths(activeDate, 4);
|
|
4149
|
+
break;
|
|
4150
|
+
case "Home":
|
|
4151
|
+
activeDate = addCalendarMonths(activeDate, -activeDate.getMonth());
|
|
4152
|
+
break;
|
|
4153
|
+
case "End":
|
|
4154
|
+
activeDate = addCalendarMonths(activeDate, 11 - activeDate.getMonth());
|
|
4155
|
+
break;
|
|
4156
|
+
case "PageUp":
|
|
4157
|
+
activeDate = addCalendarYears(activeDate, e.altKey ? -10 : -1);
|
|
4158
|
+
break;
|
|
4159
|
+
case "PageDown":
|
|
4160
|
+
activeDate = addCalendarYears(activeDate, e.altKey ? 10 : 1);
|
|
4161
|
+
break;
|
|
4162
|
+
default:
|
|
4163
|
+
return;
|
|
4164
|
+
}
|
|
4165
|
+
e.preventDefault();
|
|
4166
|
+
this._changeActiveDate(activeDate);
|
|
4167
|
+
};
|
|
4168
|
+
/** The styles of the element. */
|
|
4169
|
+
M3eYearViewElement.styles = [CalendarViewElementBase.styles, css`.item { height: 2.25rem; } .touch { width: 100%; } th { height: 1rem; } td { padding-inline: 0.375rem; } tbody { font-size: var(--m3e-calendar-item-font-size, ${DesignToken$1.typescale.standard.body.medium.fontSize}); font-weight: var(--m3e-calendar-item-font-weight, ${DesignToken$1.typescale.standard.body.medium.fontWeight}); line-height: var(--m3e-calendar-item-line-height, ${DesignToken$1.typescale.standard.body.medium.lineHeight}); letter-spacing: var(--m3e-calendar-item-tracking, ${DesignToken$1.typescale.standard.body.medium.tracking}); }`];
|
|
4170
|
+
M3eYearViewElement = __decorate([customElement$1("m3e-year-view")], M3eYearViewElement);
|
|
4171
|
+
|
|
4172
|
+
/**
|
|
4173
|
+
* Adapted from Angular Material Datepicker
|
|
4174
|
+
* Source: https://github.com/angular/components/blob/main/src/material/datepicker/calendar.ts
|
|
4175
|
+
*
|
|
4176
|
+
* @license MIT
|
|
4177
|
+
* Copyright (c) 2025 Google LLC
|
|
4178
|
+
* See LICENSE file in the project root for full license text.
|
|
4179
|
+
*/
|
|
4180
|
+
var _M3eCalendarElement_instances, _M3eCalendarElement_transitionComplete, _M3eCalendarElement_renderHeader, _M3eCalendarElement_renderView, _M3eCalendarElement_handleDateChange, _M3eCalendarElement_handleMonthChange, _M3eCalendarElement_handleYearChange, _M3eCalendarElement_handleActiveChange, _M3eCalendarElement_getPreviousPeriod, _M3eCalendarElement_getNextPeriod;
|
|
4181
|
+
/**
|
|
4182
|
+
* A calendar used to select a date.
|
|
4183
|
+
*
|
|
4184
|
+
* @description
|
|
4185
|
+
* The `m3e-calendar` component provides structured navigation and selection across
|
|
4186
|
+
* month, year, and multi‑year views. It supports single‑date and range selection,
|
|
4187
|
+
* applies disabled rules including minimum, maximum, and blackout constraints, and
|
|
4188
|
+
* provides styling hooks for special date states.
|
|
4189
|
+
*
|
|
4190
|
+
* @example
|
|
4191
|
+
* The following example illustrates use of the `m3e-calendar`. In this example, a calendar is displayed
|
|
4192
|
+
* with a selected date.
|
|
4193
|
+
*
|
|
4194
|
+
* ```html
|
|
4195
|
+
* <m3e-calendar date="2025-12-13"></m3e-calendar>
|
|
4196
|
+
* ```
|
|
4197
|
+
*
|
|
4198
|
+
* @tag m3e-calendar
|
|
4199
|
+
*
|
|
4200
|
+
* @slot header - Renders the header of the calendar.
|
|
4201
|
+
*
|
|
4202
|
+
* @attr date - The selected date.
|
|
4203
|
+
* @attr max-date - The maximum date that can be selected.
|
|
4204
|
+
* @attr min-date - The minimum date that can be selected.
|
|
4205
|
+
* @attr range-end - End of a date range.
|
|
4206
|
+
* @attr range-start - Start of a date range.
|
|
4207
|
+
* @attr start-at - A date specifying the period (month or year) to start the calendar in.
|
|
4208
|
+
* @attr start-view - The initial view used to select a date.
|
|
4209
|
+
* @attr previous-month-label - The accessible label given to the button used to move to the previous month.
|
|
4210
|
+
* @attr next-month-label - The accessible label given to the button used to move to the next month.
|
|
4211
|
+
* @attr previous-year-label - The accessible label given to the button used to move to the previous year.
|
|
4212
|
+
* @attr next-year-label - The accessible label given to the button used to move to the next year.
|
|
4213
|
+
* @attr previous-multi-year-label - The accessible label given to the button used to move to the previous 24 years.
|
|
4214
|
+
* @attr next-multi-year-label - The accessible label given to the button used to move to the next 24 years.
|
|
4215
|
+
*
|
|
4216
|
+
* @fires change - Emitted when the selected date changes.
|
|
4217
|
+
*
|
|
4218
|
+
* @cssprop --m3e-calendar-container-color - Background color of the container surface.
|
|
4219
|
+
* @cssprop --m3e-calendar-container-elevation - Elevation shadow applied to the container surface.
|
|
4220
|
+
* @cssprop --m3e-calendar-container-shape - Corner radius of the container surface.
|
|
4221
|
+
* @cssprop --m3e-calendar-padding - Padding applied to the calendar header and body.
|
|
4222
|
+
* @cssprop --m3e-calendar-period-button-text-color - Text color used for the period‑navigation buttons in the header.
|
|
4223
|
+
* @cssprop --m3e-calendar-weekday-font-size - Font size of weekday labels in month view.
|
|
4224
|
+
* @cssprop --m3e-calendar-weekday-font-weight - Font weight of weekday labels in month view.
|
|
4225
|
+
* @cssprop --m3e-calendar-weekday-line-height - Line height of weekday labels in month view.
|
|
4226
|
+
* @cssprop --m3e-calendar-weekday-tracking - Letter spacing of weekday labels in month view.
|
|
4227
|
+
* @cssprop --m3e-calendar-date-font-size - Font size of date cells in month view.
|
|
4228
|
+
* @cssprop --m3e-calendar-date-font-weight - Font weight of date cells in month view.
|
|
4229
|
+
* @cssprop --m3e-calendar-date-line-height - Line height of date cells in month view.
|
|
4230
|
+
* @cssprop --m3e-calendar-date-tracking - Letter spacing of date cells in month view.
|
|
4231
|
+
* @cssprop --m3e-calendar-item-font-size - Font size of items in year and multi‑year views.
|
|
4232
|
+
* @cssprop --m3e-calendar-item-font-weight - Font weight of items in year and multi‑year views.
|
|
4233
|
+
* @cssprop --m3e-calendar-item-line-height - Line height of items in year and multi‑year views.
|
|
4234
|
+
* @cssprop --m3e-calendar-item-tracking - Letter spacing of items in year and multi‑year views.
|
|
4235
|
+
* @cssprop --m3e-calendar-item-selected-color - Text color for selected date items.
|
|
4236
|
+
* @cssprop --m3e-calendar-item-selected-container-color - Background color for selected date items.
|
|
4237
|
+
* @cssprop --m3e-calendar-item-selected-ripple-color - Ripple color used when interacting with selected date items.
|
|
4238
|
+
* @cssprop --m3e-calendar-item-selected-hover-color - Hover color used when interacting with selected date items.
|
|
4239
|
+
* @cssprop --m3e-calendar-item-selected-focus-color - Focus color used when interacting with selected date items.
|
|
4240
|
+
* @cssprop --m3e-calendar-item-current-outline-thickness - Outline thickness used to indicate the current date.
|
|
4241
|
+
* @cssprop --m3e-calendar-item-current-outline-color - Outline color used to indicate the current date.
|
|
4242
|
+
* @cssprop --m3e-calendar-item-special-color - Text color for dates marked as special.
|
|
4243
|
+
* @cssprop --m3e-calendar-item-special-container-color - Background color for dates marked as special.
|
|
4244
|
+
* @cssprop --m3e-calendar-item-special-ripple-color - Ripple color used when interacting with dates marked as special.
|
|
4245
|
+
* @cssprop --m3e-calendar-item-special-hover-color - Hover color used when interacting with dates marked as special.
|
|
4246
|
+
* @cssprop --m3e-calendar-item-special-focus-color - Focus color used when interacting with dates marked as special.
|
|
4247
|
+
* @cssprop --m3e-calendar-range-container-color - Background color applied to the selected date range.
|
|
4248
|
+
* @cssprop --m3e-calendar-range-color - Text color for dates within a selected range.
|
|
4249
|
+
* @cssprop --m3e-calendar-item-disabled-color - Color used for disabled date items.
|
|
4250
|
+
* @cssprop --m3e-calendar-item-disabled-color-opacity - Opacity applied to the disabled item color.
|
|
4251
|
+
* @cssprop --m3e-calendar-slide-animation-duration - Duration of slide transitions between calendar views.
|
|
4252
|
+
*/
|
|
4253
|
+
let M3eCalendarElement = class M3eCalendarElement extends LitElement {
|
|
4254
|
+
constructor() {
|
|
4255
|
+
super(...arguments);
|
|
4256
|
+
_M3eCalendarElement_instances.add(this);
|
|
4257
|
+
/** @private */
|
|
4258
|
+
_M3eCalendarElement_transitionComplete.set(this, void 0);
|
|
4259
|
+
/** @private */
|
|
4260
|
+
this._today = new Date();
|
|
4261
|
+
/** @private */
|
|
4262
|
+
this._activeView = "month";
|
|
4263
|
+
/** @private */
|
|
4264
|
+
this._activeDate = new Date();
|
|
4265
|
+
/**
|
|
4266
|
+
* The initial view used to select a date.
|
|
4267
|
+
* @default "month"
|
|
4268
|
+
*/
|
|
4269
|
+
this.startView = "month";
|
|
4270
|
+
/**
|
|
4271
|
+
* The selected date.
|
|
4272
|
+
* @default null
|
|
4273
|
+
*/
|
|
4274
|
+
this.date = null;
|
|
4275
|
+
/**
|
|
4276
|
+
* A date specifying the period (month or year) to start the calendar in.
|
|
4277
|
+
* @default null
|
|
4278
|
+
*/
|
|
4279
|
+
this.startAt = null;
|
|
4280
|
+
/**
|
|
4281
|
+
* The minimum date that can be selected.
|
|
4282
|
+
* @default null
|
|
4283
|
+
*/
|
|
4284
|
+
this.minDate = null;
|
|
4285
|
+
/**
|
|
4286
|
+
* The maximum date that can be selected.
|
|
4287
|
+
* @default null
|
|
4288
|
+
*/
|
|
4289
|
+
this.maxDate = null;
|
|
4290
|
+
/**
|
|
4291
|
+
* Start of a date range.
|
|
4292
|
+
* @default null
|
|
4293
|
+
*/
|
|
4294
|
+
this.rangeStart = null;
|
|
4295
|
+
/**
|
|
4296
|
+
* End of a date range.
|
|
4297
|
+
* @default null
|
|
4298
|
+
*/
|
|
4299
|
+
this.rangeEnd = null;
|
|
4300
|
+
/**
|
|
4301
|
+
* A function used to determine whether a date cannot be selected.
|
|
4302
|
+
* @default null
|
|
4303
|
+
*/
|
|
4304
|
+
this.blackoutDates = null;
|
|
4305
|
+
/**
|
|
4306
|
+
* A function used to determine whether a date is special.
|
|
4307
|
+
* @default null
|
|
4308
|
+
*/
|
|
4309
|
+
this.specialDates = null;
|
|
4310
|
+
/**
|
|
4311
|
+
* The accessible label given to the button used to move to the previous month.
|
|
4312
|
+
* @default "Previous month"
|
|
4313
|
+
*/
|
|
4314
|
+
this.previousMonthLabel = "Previous month";
|
|
4315
|
+
/**
|
|
4316
|
+
* The accessible label given to the button used to move to the previous year.
|
|
4317
|
+
* @default "Previous year"
|
|
4318
|
+
*/
|
|
4319
|
+
this.previousYearLabel = "Previous year";
|
|
4320
|
+
/**
|
|
4321
|
+
* The accessible label given to the button used to move to the previous 24 years.
|
|
4322
|
+
* @default "Previous 24 years"
|
|
4323
|
+
*/
|
|
4324
|
+
this.previousMultiYearLabel = "Previous 24 years";
|
|
4325
|
+
/**
|
|
4326
|
+
* The accessible label given to the button used to move to the next month.
|
|
4327
|
+
* @default "Next month"
|
|
4328
|
+
*/
|
|
4329
|
+
this.nextMonthLabel = "Next month";
|
|
4330
|
+
/**
|
|
4331
|
+
* The accessible label given to the button used to move to the next year.
|
|
4332
|
+
* @default "Next year"
|
|
4333
|
+
*/
|
|
4334
|
+
this.nextYearLabel = "Next year";
|
|
4335
|
+
/**
|
|
4336
|
+
* The accessible label given to the button used to move to the next 24 years.
|
|
4337
|
+
* @default "Next 24 years"
|
|
4338
|
+
*/
|
|
4339
|
+
this.nextMultiYearLabel = "Next 24 years";
|
|
4340
|
+
}
|
|
4341
|
+
/** The label to present for the current period. */
|
|
4342
|
+
get periodLabel() {
|
|
4343
|
+
switch (this._activeView) {
|
|
4344
|
+
case "month":
|
|
4345
|
+
return new Intl.DateTimeFormat(navigator.language, {
|
|
4346
|
+
month: "short",
|
|
4347
|
+
year: "numeric"
|
|
4348
|
+
}).format(this._activeDate);
|
|
4349
|
+
case "year":
|
|
4350
|
+
return new Intl.DateTimeFormat(navigator.language, {
|
|
4351
|
+
year: "numeric"
|
|
4352
|
+
}).format(new Date(this._activeDate.getFullYear(), 0, 1));
|
|
4353
|
+
case "multi-year":
|
|
4354
|
+
return new Intl.DateTimeFormat(navigator.language, {
|
|
4355
|
+
year: "numeric"
|
|
4356
|
+
}).formatRange(new Date(minYearOfPage(this._activeDate, this.minDate, this.maxDate), 0, 1), new Date(maxYearOfPage(this._activeDate, this.minDate, this.maxDate), 0, 1));
|
|
4357
|
+
}
|
|
4358
|
+
}
|
|
4359
|
+
/** Whether the calendar can move to the previous period. */
|
|
4360
|
+
get canMovePreviousPeriod() {
|
|
4361
|
+
if (!this.minDate) return true;
|
|
4362
|
+
switch (this._activeView) {
|
|
4363
|
+
case "month":
|
|
4364
|
+
return new Date(this._activeDate.getFullYear(), this._activeDate.getMonth(), 0) >= this.minDate;
|
|
4365
|
+
case "year":
|
|
4366
|
+
return new Date(this._activeDate.getFullYear() - 1, 12, 1) >= this.minDate;
|
|
4367
|
+
case "multi-year":
|
|
4368
|
+
return new Date(minYearOfPage(this._activeDate, this.minDate, this.maxDate) - 1, 12, 1) >= this.minDate;
|
|
4369
|
+
}
|
|
4370
|
+
}
|
|
4371
|
+
/** Whether the calendar can move to the next period. */
|
|
4372
|
+
get canMoveNextPeriod() {
|
|
4373
|
+
if (!this.maxDate) return true;
|
|
4374
|
+
switch (this._activeView) {
|
|
4375
|
+
case "month":
|
|
4376
|
+
return new Date(this._activeDate.getFullYear(), this._activeDate.getMonth() + 1, 1) <= this.maxDate;
|
|
4377
|
+
case "year":
|
|
4378
|
+
return new Date(this._activeDate.getFullYear() + 1, 1, 1) <= this.maxDate;
|
|
4379
|
+
case "multi-year":
|
|
4380
|
+
return new Date(maxYearOfPage(this._activeDate, this.minDate, this.maxDate) + 1, 12, 1) <= this.maxDate;
|
|
4381
|
+
}
|
|
4382
|
+
}
|
|
4383
|
+
/**
|
|
4384
|
+
* Asynchronously focuses the active date.
|
|
4385
|
+
* @returns {Promise<void>} A promise that resolves after the active date has been focused.
|
|
4386
|
+
*/
|
|
4387
|
+
async focusActiveCell() {
|
|
4388
|
+
if (this.isUpdatePending) {
|
|
4389
|
+
await this.updateComplete;
|
|
4390
|
+
}
|
|
4391
|
+
await this._view?.focusActiveCell();
|
|
4392
|
+
}
|
|
4393
|
+
/** Updates today's date. */
|
|
4394
|
+
updateTodayDate() {
|
|
4395
|
+
this._today = new Date();
|
|
4396
|
+
}
|
|
4397
|
+
/**
|
|
4398
|
+
* Moves the calendar to the previous period.
|
|
4399
|
+
* @returns {Promise<void>} A promise that resolves when the operation is complete.
|
|
4400
|
+
*/
|
|
4401
|
+
async movePreviousPeriod() {
|
|
4402
|
+
if (!this.canMovePreviousPeriod) return;
|
|
4403
|
+
if (prefersReducedMotion$1()) {
|
|
4404
|
+
this._activeDate = __classPrivateFieldGet(this, _M3eCalendarElement_instances, "m", _M3eCalendarElement_getPreviousPeriod).call(this, this._activeView);
|
|
4405
|
+
return;
|
|
4406
|
+
}
|
|
4407
|
+
await __classPrivateFieldGet(this, _M3eCalendarElement_transitionComplete, "f");
|
|
4408
|
+
const views = [...(this.shadowRoot?.querySelectorAll(`.row.${this._activeView} .view`) ?? [])];
|
|
4409
|
+
if (views.length != 3) return;
|
|
4410
|
+
__classPrivateFieldSet(this, _M3eCalendarElement_transitionComplete, new Promise(resolve => {
|
|
4411
|
+
views[0].addEventListener("transitionend", () => {
|
|
4412
|
+
this._activeDate = __classPrivateFieldGet(this, _M3eCalendarElement_instances, "m", _M3eCalendarElement_getPreviousPeriod).call(this, this._activeView);
|
|
4413
|
+
views.forEach(x => x.classList.add("no-animate"));
|
|
4414
|
+
views[1].classList.remove("after");
|
|
4415
|
+
views[0].classList.add("before");
|
|
4416
|
+
setTimeout(() => {
|
|
4417
|
+
views.forEach(x => x.classList.remove("no-animate"));
|
|
4418
|
+
resolve();
|
|
4419
|
+
});
|
|
4420
|
+
}, {
|
|
4421
|
+
once: true
|
|
4422
|
+
});
|
|
4423
|
+
}), "f");
|
|
4424
|
+
this._body.style.overflow = "hidden";
|
|
4425
|
+
views[1].classList.add("after");
|
|
4426
|
+
views[0].classList.remove("before");
|
|
4427
|
+
await __classPrivateFieldGet(this, _M3eCalendarElement_transitionComplete, "f");
|
|
4428
|
+
this._body.style.overflow = "";
|
|
4429
|
+
}
|
|
4430
|
+
/**
|
|
4431
|
+
* Moves the calendar to the next period.
|
|
4432
|
+
* @returns {Promise<void>} A promise that resolves when the operation is complete.
|
|
4433
|
+
*/
|
|
4434
|
+
async moveNextPeriod() {
|
|
4435
|
+
if (!this.canMoveNextPeriod) return;
|
|
4436
|
+
if (prefersReducedMotion$1()) {
|
|
4437
|
+
this._activeDate = __classPrivateFieldGet(this, _M3eCalendarElement_instances, "m", _M3eCalendarElement_getNextPeriod).call(this, this._activeView);
|
|
4438
|
+
return;
|
|
4439
|
+
}
|
|
4440
|
+
await __classPrivateFieldGet(this, _M3eCalendarElement_transitionComplete, "f");
|
|
4441
|
+
const views = [...(this.shadowRoot?.querySelectorAll(`.row.${this._activeView} .view`) ?? [])];
|
|
4442
|
+
if (views.length != 3) return;
|
|
4443
|
+
__classPrivateFieldSet(this, _M3eCalendarElement_transitionComplete, new Promise(resolve => {
|
|
4444
|
+
views[2].addEventListener("transitionend", () => {
|
|
4445
|
+
this._activeDate = __classPrivateFieldGet(this, _M3eCalendarElement_instances, "m", _M3eCalendarElement_getNextPeriod).call(this, this._activeView);
|
|
4446
|
+
views.forEach(x => x.classList.add("no-animate"));
|
|
4447
|
+
views[1].classList.remove("before");
|
|
4448
|
+
views[2].classList.add("after");
|
|
4449
|
+
setTimeout(() => {
|
|
4450
|
+
views.forEach(x => x.classList.remove("no-animate"));
|
|
4451
|
+
resolve();
|
|
4452
|
+
});
|
|
4453
|
+
}, {
|
|
4454
|
+
once: true
|
|
4455
|
+
});
|
|
4456
|
+
}), "f");
|
|
4457
|
+
this._body.style.overflow = "hidden";
|
|
4458
|
+
views[1].classList.add("before");
|
|
4459
|
+
views[2].classList.remove("after");
|
|
4460
|
+
await __classPrivateFieldGet(this, _M3eCalendarElement_transitionComplete, "f");
|
|
4461
|
+
this._body.style.overflow = "";
|
|
4462
|
+
}
|
|
4463
|
+
/**
|
|
4464
|
+
* Toggles the current period.
|
|
4465
|
+
* @returns {Promise<void>} A promise that resolves when the operation is complete.
|
|
4466
|
+
*/
|
|
4467
|
+
async togglePeriod() {
|
|
4468
|
+
await __classPrivateFieldGet(this, _M3eCalendarElement_transitionComplete, "f");
|
|
4469
|
+
this._activeView = this._activeView === "month" ? "multi-year" : "month";
|
|
4470
|
+
await this.focusActiveCell();
|
|
4471
|
+
}
|
|
4472
|
+
/** @inheritdoc */
|
|
4473
|
+
willUpdate(changedProperties) {
|
|
4474
|
+
super.willUpdate(changedProperties);
|
|
4475
|
+
if (changedProperties.has("date")) {
|
|
4476
|
+
this._activeDate = new Date(this.date ?? this._today);
|
|
4477
|
+
}
|
|
4478
|
+
if (changedProperties.has("startAt")) {
|
|
4479
|
+
this._activeDate = new Date(this.startAt ?? this.date ?? this._today);
|
|
4480
|
+
}
|
|
4481
|
+
if (changedProperties.has("startView")) {
|
|
4482
|
+
this._activeView = this.startView;
|
|
4483
|
+
}
|
|
4484
|
+
}
|
|
4485
|
+
/** @inheritdoc */
|
|
4486
|
+
updated(_changedProperties) {
|
|
4487
|
+
super.updated(_changedProperties);
|
|
4488
|
+
if (this._view instanceof M3eMonthViewElement) {
|
|
4489
|
+
if (_changedProperties.has("specialDates") || _changedProperties.has("blackoutDates")) {
|
|
4490
|
+
this.shadowRoot?.querySelectorAll("m3e-month-view").forEach(x => {
|
|
4491
|
+
x.specialDates = this.specialDates;
|
|
4492
|
+
x.blackoutDates = this.blackoutDates;
|
|
4493
|
+
});
|
|
4494
|
+
}
|
|
4495
|
+
}
|
|
4496
|
+
}
|
|
4497
|
+
/** @inheritdoc */
|
|
4498
|
+
render() {
|
|
4499
|
+
return html`<div class="base"><slot name="header">${__classPrivateFieldGet(this, _M3eCalendarElement_instances, "m", _M3eCalendarElement_renderHeader).call(this)}</slot><div class="body ${this._activeView}"><div class="row multi-year">${__classPrivateFieldGet(this, _M3eCalendarElement_instances, "m", _M3eCalendarElement_renderView).call(this, "multi-year", -1)}${__classPrivateFieldGet(this, _M3eCalendarElement_instances, "m", _M3eCalendarElement_renderView).call(this, "multi-year", 0)}${__classPrivateFieldGet(this, _M3eCalendarElement_instances, "m", _M3eCalendarElement_renderView).call(this, "multi-year", 1)}</div><div class="row year">${__classPrivateFieldGet(this, _M3eCalendarElement_instances, "m", _M3eCalendarElement_renderView).call(this, "year", -1)}${__classPrivateFieldGet(this, _M3eCalendarElement_instances, "m", _M3eCalendarElement_renderView).call(this, "year", 0)}${__classPrivateFieldGet(this, _M3eCalendarElement_instances, "m", _M3eCalendarElement_renderView).call(this, "year", 1)}</div><div class="row month">${__classPrivateFieldGet(this, _M3eCalendarElement_instances, "m", _M3eCalendarElement_renderView).call(this, "month", -1)}${__classPrivateFieldGet(this, _M3eCalendarElement_instances, "m", _M3eCalendarElement_renderView).call(this, "month", 0)}${__classPrivateFieldGet(this, _M3eCalendarElement_instances, "m", _M3eCalendarElement_renderView).call(this, "month", 1)}</div></div></div>`;
|
|
4500
|
+
}
|
|
4501
|
+
};
|
|
4502
|
+
_M3eCalendarElement_transitionComplete = new WeakMap();
|
|
4503
|
+
_M3eCalendarElement_instances = new WeakSet();
|
|
4504
|
+
_M3eCalendarElement_renderHeader = function _M3eCalendarElement_renderHeader() {
|
|
4505
|
+
return html`<div class="header"><m3e-button @click="${this.togglePeriod}">${this.periodLabel} <svg class="${classMap({
|
|
4506
|
+
rotate: this._activeView !== "month"
|
|
4507
|
+
})}" slot="trailing-icon" viewBox="0 -960 960 960" fill="currentColor"><path d="M480-360 280-560h400L480-360Z"/></svg></m3e-button><div class="spacer"></div><m3e-icon-button ?disabled="${!this.canMovePreviousPeriod}" @click="${this.movePreviousPeriod}" aria-label="${this._activeView === "month" ? this.previousMonthLabel : this._activeView === "year" ? this.previousYearLabel : this.previousMultiYearLabel}">${M3eDirectionality.current === "ltr" ? html`<svg viewBox="0 -960 960 960" fill="currentColor"><path d="M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z"/></svg>` : html`<svg viewBox="0 -960 960 960" fill="currentColor"><path d="M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z"/></svg>`}</m3e-icon-button><m3e-icon-button ?disabled="${!this.canMoveNextPeriod}" @click="${this.moveNextPeriod}" aria-label="${this._activeView === "month" ? this.nextMonthLabel : this._activeView === "year" ? this.nextYearLabel : this.nextMultiYearLabel}">${M3eDirectionality.current === "ltr" ? html`<svg viewBox="0 -960 960 960" fill="currentColor"><path d="M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z"/></svg>` : html`<svg viewBox="0 -960 960 960" fill="currentColor"><path d="M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z"/></svg>`}</m3e-icon-button></div>`;
|
|
4508
|
+
};
|
|
4509
|
+
_M3eCalendarElement_renderView = function _M3eCalendarElement_renderView(view, offset) {
|
|
4510
|
+
const activeDate = offset < 0 ? __classPrivateFieldGet(this, _M3eCalendarElement_instances, "m", _M3eCalendarElement_getPreviousPeriod).call(this, view) : offset > 0 ? __classPrivateFieldGet(this, _M3eCalendarElement_instances, "m", _M3eCalendarElement_getNextPeriod).call(this, view) : new Date(this._activeDate);
|
|
4511
|
+
switch (view) {
|
|
4512
|
+
case "month":
|
|
4513
|
+
return html`<m3e-month-view class="view ${classMap({
|
|
4514
|
+
before: offset < 0,
|
|
4515
|
+
after: offset > 0,
|
|
4516
|
+
active: view === this._activeView && offset === 0
|
|
4517
|
+
})}" ?inert="${offset !== 0}" today="${this._today.toISOString()}" date="${ifDefined(this.date?.toISOString())}" active-date="${activeDate.toISOString()}" min-date="${ifDefined(this.minDate?.toISOString())}" max-date="${ifDefined(this.maxDate?.toISOString())}" range-start="${ifDefined(this.rangeStart?.toISOString())}" range-end="${ifDefined(this.rangeEnd?.toISOString())}" @active-change="${offset === 0 ? __classPrivateFieldGet(this, _M3eCalendarElement_instances, "m", _M3eCalendarElement_handleActiveChange) : undefined}" @change="${offset === 0 ? __classPrivateFieldGet(this, _M3eCalendarElement_instances, "m", _M3eCalendarElement_handleDateChange) : undefined}"></m3e-month-view>`;
|
|
4518
|
+
case "year":
|
|
4519
|
+
return html`<m3e-year-view class="view ${classMap({
|
|
4520
|
+
before: offset < 0,
|
|
4521
|
+
after: offset > 0,
|
|
4522
|
+
active: view === this._activeView && offset === 0
|
|
4523
|
+
})}" ?inert="${offset !== 0}" today="${this._today.toISOString()}" date="${ifDefined(this.date?.toISOString())}" active-date="${activeDate.toISOString()}" min-date="${ifDefined(this.minDate?.toISOString())}" max-date="${ifDefined(this.maxDate?.toISOString())}" @active-change="${offset === 0 ? __classPrivateFieldGet(this, _M3eCalendarElement_instances, "m", _M3eCalendarElement_handleActiveChange) : undefined}" @change="${offset === 0 ? __classPrivateFieldGet(this, _M3eCalendarElement_instances, "m", _M3eCalendarElement_handleMonthChange) : undefined}"></m3e-year-view>`;
|
|
4524
|
+
case "multi-year":
|
|
4525
|
+
return html`<m3e-multi-year-view class="view ${classMap({
|
|
4526
|
+
before: offset < 0,
|
|
4527
|
+
after: offset > 0,
|
|
4528
|
+
active: view === this._activeView && offset === 0
|
|
4529
|
+
})}" ?inert="${offset !== 0}" today="${this._today.toISOString()}" date="${ifDefined(this.date?.toISOString())}" active-date="${activeDate.toISOString()}" min-date="${ifDefined(this.minDate?.toISOString())}" max-date="${ifDefined(this.maxDate?.toISOString())}" @active-change="${offset === 0 ? __classPrivateFieldGet(this, _M3eCalendarElement_instances, "m", _M3eCalendarElement_handleActiveChange) : undefined}" @change="${offset === 0 ? __classPrivateFieldGet(this, _M3eCalendarElement_instances, "m", _M3eCalendarElement_handleYearChange) : undefined}"></m3e-multi-year-view>`;
|
|
4530
|
+
}
|
|
4531
|
+
};
|
|
4532
|
+
_M3eCalendarElement_handleDateChange = function _M3eCalendarElement_handleDateChange(e) {
|
|
4533
|
+
const monthView = e.currentTarget;
|
|
4534
|
+
this._activeDate = new Date(monthView.activeDate);
|
|
4535
|
+
this.rangeStart = monthView.rangeStart;
|
|
4536
|
+
this.rangeEnd = monthView.rangeEnd;
|
|
4537
|
+
this.date = new Date(this._activeDate);
|
|
4538
|
+
this.dispatchEvent(new Event("change", {
|
|
4539
|
+
bubbles: true
|
|
4540
|
+
}));
|
|
4541
|
+
};
|
|
4542
|
+
_M3eCalendarElement_handleMonthChange = /** @private */
|
|
4543
|
+
async function _M3eCalendarElement_handleMonthChange(e) {
|
|
4544
|
+
this._activeDate = new Date(e.currentTarget.activeDate);
|
|
4545
|
+
this._activeView = "month";
|
|
4546
|
+
this.focusActiveCell();
|
|
4547
|
+
};
|
|
4548
|
+
_M3eCalendarElement_handleYearChange = function _M3eCalendarElement_handleYearChange(e) {
|
|
4549
|
+
this._activeDate = new Date(e.currentTarget.activeDate);
|
|
4550
|
+
this._activeView = "year";
|
|
4551
|
+
this.focusActiveCell();
|
|
4552
|
+
};
|
|
4553
|
+
_M3eCalendarElement_handleActiveChange = /** @private */
|
|
4554
|
+
async function _M3eCalendarElement_handleActiveChange(e) {
|
|
4555
|
+
if (this._view instanceof M3eMonthViewElement) {
|
|
4556
|
+
this._view._suppressFocusHighlight = false;
|
|
4557
|
+
}
|
|
4558
|
+
this._activeDate = new Date(e.currentTarget.activeDate);
|
|
4559
|
+
await this.focusActiveCell();
|
|
4560
|
+
if (this._view instanceof M3eMonthViewElement) {
|
|
4561
|
+
this._view._suppressFocusHighlight = false;
|
|
4562
|
+
}
|
|
4563
|
+
};
|
|
4564
|
+
_M3eCalendarElement_getPreviousPeriod = function _M3eCalendarElement_getPreviousPeriod(view) {
|
|
4565
|
+
const activeDate = new Date(this._activeDate);
|
|
4566
|
+
switch (view) {
|
|
4567
|
+
case "month":
|
|
4568
|
+
activeDate.setMonth(this._activeDate.getMonth() - 1);
|
|
4569
|
+
while (activeDate.getMonth() === this._activeDate.getMonth()) {
|
|
4570
|
+
activeDate.setDate(activeDate.getDate() - 1);
|
|
4571
|
+
}
|
|
4572
|
+
break;
|
|
4573
|
+
case "year":
|
|
4574
|
+
activeDate.setFullYear(this._activeDate.getFullYear() - 1);
|
|
4575
|
+
break;
|
|
4576
|
+
case "multi-year":
|
|
4577
|
+
{
|
|
4578
|
+
activeDate.setDate(1);
|
|
4579
|
+
activeDate.setFullYear(minYearOfPage(this._activeDate, this.minDate, this.maxDate) - 1);
|
|
4580
|
+
}
|
|
4581
|
+
}
|
|
4582
|
+
return activeDate;
|
|
4583
|
+
};
|
|
4584
|
+
_M3eCalendarElement_getNextPeriod = function _M3eCalendarElement_getNextPeriod(view) {
|
|
4585
|
+
const activeDate = new Date(this._activeDate);
|
|
4586
|
+
switch (view) {
|
|
4587
|
+
case "month":
|
|
4588
|
+
activeDate.setMonth(this._activeDate.getMonth() + 1);
|
|
4589
|
+
while (activeDate.getMonth() === this._activeDate.getMonth()) {
|
|
4590
|
+
activeDate.setDate(activeDate.getDate() + 1);
|
|
4591
|
+
}
|
|
4592
|
+
break;
|
|
4593
|
+
case "year":
|
|
4594
|
+
activeDate.setFullYear(this._activeDate.getFullYear() + 1);
|
|
4595
|
+
break;
|
|
4596
|
+
case "multi-year":
|
|
4597
|
+
activeDate.setDate(1);
|
|
4598
|
+
activeDate.setFullYear(maxYearOfPage(this._activeDate, this.minDate, this.maxDate) + 1);
|
|
4599
|
+
break;
|
|
4600
|
+
}
|
|
4601
|
+
return activeDate;
|
|
4602
|
+
};
|
|
4603
|
+
/** The styles of the element. */
|
|
4604
|
+
M3eCalendarElement.styles = css`:host { display: inline-block; vertical-align: top; width: fit-content; height: fit-content; } .base { display: flex; flex-direction: column; width: fit-content; overflow: hidden; padding: var(--m3e-calendar-padding, 0.5rem); background-color: var(--m3e-calendar-container-color); box-shadow: var(--m3e-calendar-container-elevation); border-radius: var(--m3e-calendar-container-shape); } .header { display: flex; align-items: center; --m3e-text-button-label-text-color: var( --m3e-calendar-period-button-text-color, ${DesignToken$1.color.onSurfaceVariant} ); --m3e-text-button-hover-label-text-color: var( --m3e-calendar-period-button-text-color, ${DesignToken$1.color.onSurfaceVariant} ); --m3e-text-button-focus-label-text-color: var( --m3e-calendar-period-button-text-color, ${DesignToken$1.color.onSurfaceVariant} ); --m3e-text-button-pressed-label-text-color: var( --m3e-calendar-period-button-text-color, ${DesignToken$1.color.onSurfaceVariant} ); } .spacer { flex: 1 1 auto; } svg { transition: transform ${DesignToken$1.motion.spring.fastEffects}; } svg.rotate { transform: rotate(-180deg); } .body { position: relative; } .view:not(.no-animate) { transition: ${unsafeCSS(`margin var(--m3e-calendar-slide-animation-duration, ${DesignToken$1.motion.duration.long2}) ${DesignToken$1.motion.easing.standard},
|
|
4605
|
+
visibility var(--m3e-calendar-slide-animation-duration, ${DesignToken$1.motion.duration.long2}) ${DesignToken$1.motion.easing.standard} allow-discrete`)}; } .view.before, .view.after { visibility: hidden; position: absolute; } .view.before { margin-inline-start: -100%; } .view.after { margin-inline-start: 100%; } .view:not(.before):not(.after) { visibility: visible; position: relative; left: 0; margin-inline-start: 0; } .row { opacity: 1; transform: translateY(0); } .row.multi-year { transition: ${unsafeCSS(`transform var(--m3e-calendar-slide-animation-duration, ${DesignToken$1.motion.duration.long2}) ${DesignToken$1.motion.easing.standard} allow-discrete,
|
|
4606
|
+
opacity var(--m3e-calendar-slide-animation-duration, ${DesignToken$1.motion.duration.long2}) ${DesignToken$1.motion.easing.standard} allow-discrete`)}; } .row:not(.multi-year) { transition: ${unsafeCSS(`opacity var(--m3e-calendar-slide-animation-duration, ${DesignToken$1.motion.duration.long2}) ${DesignToken$1.motion.easing.standard} allow-discrete`)}; } .body.month > .row:not(.month), .body.year > .row:not(.year), .body.multi-year > .row:not(.multi-year) { visibility: hidden; position: absolute; transform: translateY(-10%); opacity: 0; } .body.month > .row:not(.month) .view:not(.before):not(.after), .body.year > .row:not(.year) .view:not(.before):not(.after), .body.multi-year > .row:not(.multi-year) .view:not(.before):not(.after) { visibility: hidden; transition: none; } @media (prefers-reduced-motion) { .row:not(.multi-year), .row.multi-year, .view:not(.no-animate), svg { transition: none; } }`;
|
|
4607
|
+
__decorate([state()], M3eCalendarElement.prototype, "_today", void 0);
|
|
4608
|
+
__decorate([state()], M3eCalendarElement.prototype, "_activeView", void 0);
|
|
4609
|
+
__decorate([state()], M3eCalendarElement.prototype, "_activeDate", void 0);
|
|
4610
|
+
__decorate([query(".active")], M3eCalendarElement.prototype, "_view", void 0);
|
|
4611
|
+
__decorate([query(".body")], M3eCalendarElement.prototype, "_body", void 0);
|
|
4612
|
+
__decorate([property({
|
|
4613
|
+
attribute: "start-view"
|
|
4614
|
+
})], M3eCalendarElement.prototype, "startView", void 0);
|
|
4615
|
+
__decorate([property({
|
|
4616
|
+
converter: dateConverter$1
|
|
4617
|
+
})], M3eCalendarElement.prototype, "date", void 0);
|
|
4618
|
+
__decorate([property({
|
|
4619
|
+
attribute: "start-at",
|
|
4620
|
+
converter: dateConverter$1
|
|
4621
|
+
})], M3eCalendarElement.prototype, "startAt", void 0);
|
|
4622
|
+
__decorate([property({
|
|
4623
|
+
attribute: "min-date",
|
|
4624
|
+
converter: dateConverter$1
|
|
4625
|
+
})], M3eCalendarElement.prototype, "minDate", void 0);
|
|
4626
|
+
__decorate([property({
|
|
4627
|
+
attribute: "max-date",
|
|
4628
|
+
converter: dateConverter$1
|
|
4629
|
+
})], M3eCalendarElement.prototype, "maxDate", void 0);
|
|
4630
|
+
__decorate([property({
|
|
4631
|
+
attribute: "range-start",
|
|
4632
|
+
converter: dateConverter$1
|
|
4633
|
+
})], M3eCalendarElement.prototype, "rangeStart", void 0);
|
|
4634
|
+
__decorate([property({
|
|
4635
|
+
attribute: "range-end",
|
|
4636
|
+
converter: dateConverter$1
|
|
4637
|
+
})], M3eCalendarElement.prototype, "rangeEnd", void 0);
|
|
4638
|
+
__decorate([property({
|
|
4639
|
+
attribute: false
|
|
4640
|
+
})], M3eCalendarElement.prototype, "blackoutDates", void 0);
|
|
4641
|
+
__decorate([property({
|
|
4642
|
+
attribute: false
|
|
4643
|
+
})], M3eCalendarElement.prototype, "specialDates", void 0);
|
|
4644
|
+
__decorate([property({
|
|
4645
|
+
attribute: "previous-month-label"
|
|
4646
|
+
})], M3eCalendarElement.prototype, "previousMonthLabel", void 0);
|
|
4647
|
+
__decorate([property({
|
|
4648
|
+
attribute: "previous-year-label"
|
|
4649
|
+
})], M3eCalendarElement.prototype, "previousYearLabel", void 0);
|
|
4650
|
+
__decorate([property({
|
|
4651
|
+
attribute: "previous-multi-year-label"
|
|
4652
|
+
})], M3eCalendarElement.prototype, "previousMultiYearLabel", void 0);
|
|
4653
|
+
__decorate([property({
|
|
4654
|
+
attribute: "next-month-label"
|
|
4655
|
+
})], M3eCalendarElement.prototype, "nextMonthLabel", void 0);
|
|
4656
|
+
__decorate([property({
|
|
4657
|
+
attribute: "next-year-label"
|
|
4658
|
+
})], M3eCalendarElement.prototype, "nextYearLabel", void 0);
|
|
4659
|
+
__decorate([property({
|
|
4660
|
+
attribute: "next-multi-year-label"
|
|
4661
|
+
})], M3eCalendarElement.prototype, "nextMultiYearLabel", void 0);
|
|
4662
|
+
M3eCalendarElement = __decorate([customElement$1("m3e-calendar")], M3eCalendarElement);
|
|
4663
|
+
|
|
4664
|
+
/**
|
|
4665
|
+
* Component design tokens for `M3eCardElement`.
|
|
4666
|
+
* @internal
|
|
4667
|
+
*/
|
|
4668
|
+
const CardToken = {
|
|
4669
|
+
padding: unsafeCSS("var(--m3e-card-padding, 1rem)"),
|
|
4670
|
+
shape: unsafeCSS(`var(--m3e-card-shape, ${DesignToken$1.shape.corner.medium});`)
|
|
4671
|
+
};
|
|
4672
|
+
|
|
4673
|
+
/**
|
|
4674
|
+
* Component design tokens that control the appearance variants of `M3eCardElement`.
|
|
4675
|
+
* @internal
|
|
4676
|
+
*/
|
|
4677
|
+
const CardVariantToken = {
|
|
4678
|
+
filled: {
|
|
4679
|
+
textColor: unsafeCSS(`var(--m3e-filled-card-text-color, var(--m3e-card-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
4680
|
+
containerColor: unsafeCSS(`var(--m3e-filled-card-container-color, var(--m3e-card-container-color, ${DesignToken$1.color.surfaceContainerHighest}))`),
|
|
4681
|
+
containerElevation: unsafeCSS(`var(--m3e-filled-card-container-elevation, var(--m3e-card-container-elevation, ${DesignToken$1.elevation.level0}))`),
|
|
4682
|
+
disabled: {
|
|
4683
|
+
textColor: unsafeCSS(`var(--m3e-filled-card-disabled-text-color, var(--m3e-card-disabled-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
4684
|
+
textOpacity: unsafeCSS(`var(--m3e-filled-card-disabled-text-opacity, var(--m3e-card-disabled-text-opacity, 38%))`),
|
|
4685
|
+
imageOpacity: unsafeCSS(`var(--m3e-filled-card-disabled-image-opacity, var(--m3e-card-disabled-image-opacity, 38%))`),
|
|
4686
|
+
containerColor: unsafeCSS(`var(--m3e-filled-card-disabled-container-color, var(--m3e-card-disabled-container-color, ${DesignToken$1.color.surfaceVariant}))`),
|
|
4687
|
+
containerElevation: unsafeCSS(`var(--m3e-filled-card-disabled-container-elevation, var(--m3e-card-disabled-container-elevation, ${DesignToken$1.elevation.level0}))`),
|
|
4688
|
+
containerElevationColor: unsafeCSS(`var(--m3e-filled-card-disabled-container-elevation-color, var(--m3e-card-disabled-container-elevation-color, ${DesignToken$1.color.onSurface}))`),
|
|
4689
|
+
containerElevationOpacity: unsafeCSS(`var(--m3e-filled-card-disabled-container-elevation-opacity, var(--m3e-card-disabled-container-elevation-opacity, 38%))`),
|
|
4690
|
+
containerOpacity: unsafeCSS(`var(--m3e-filled-card-disabled-container-opacity, var(--m3e-card-disabled-container-opacity, 38%))`)
|
|
4691
|
+
},
|
|
4692
|
+
hover: {
|
|
4693
|
+
textColor: unsafeCSS(`var(--m3e-filled-card-hover-text-color, var(--m3e-card-hover-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
4694
|
+
stateLayerColor: unsafeCSS(`var(--m3e-filled-card-hover-state-layer-color, var(--m3e-card-hover-state-layer-color, ${DesignToken$1.color.onSurface}))`),
|
|
4695
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-filled-card-hover-state-layer-opacity, var(--m3e-card-hover-state-layer-opacity, ${DesignToken$1.state.hoverStateLayerOpacity}))`),
|
|
4696
|
+
containerElevation: unsafeCSS(`var(--m3e-filled-card-hover-container-elevation, var(--m3e-card-hover-container-elevation, ${DesignToken$1.elevation.level1}))`)
|
|
4697
|
+
},
|
|
4698
|
+
focus: {
|
|
4699
|
+
textColor: unsafeCSS(`var(--m3e-filled-card-focus-text-color, var(--m3e-card-focus-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
4700
|
+
stateLayerColor: unsafeCSS(`var(--m3e-filled-card-focus-state-layer-color, var(--m3e-card-focus-state-layer-color, ${DesignToken$1.color.onSurface}))`),
|
|
4701
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-filled-card-focus-state-layer-opacity, var(--m3e-card-focus-state-layer-opacity, ${DesignToken$1.state.focusStateLayerOpacity}))`),
|
|
4702
|
+
containerElevation: unsafeCSS(`var(--m3e-filled-card-focus-container-elevation, var(--m3e-card-focus-container-elevation, ${DesignToken$1.elevation.level0}))`)
|
|
4703
|
+
},
|
|
4704
|
+
pressed: {
|
|
4705
|
+
textColor: unsafeCSS(`var(--m3e-filled-card-pressed-text-color, var(--m3e-card-pressed-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
4706
|
+
stateLayerColor: unsafeCSS(`var(--m3e-filled-card-pressed-state-layer-color, var(--m3e-card-pressed-state-layer-color, ${DesignToken$1.color.onSurface}))`),
|
|
4707
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-filled-card-pressed-state-layer-opacity, var(--m3e-card-pressed-state-layer-opacity, ${DesignToken$1.state.pressedStateLayerOpacity}))`),
|
|
4708
|
+
containerElevation: unsafeCSS(`var(--m3e-filled-card-pressed-container-elevation, var(--m3e-card-pressed-container-elevation, ${DesignToken$1.elevation.level0}))`)
|
|
4709
|
+
}
|
|
4710
|
+
},
|
|
4711
|
+
elevated: {
|
|
4712
|
+
textColor: unsafeCSS(`var(--m3e-elevated-card-text-color, var(--m3e-card-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
4713
|
+
containerColor: unsafeCSS(`var(--m3e-elevated-card-container-color, var(--m3e-card-container-color, ${DesignToken$1.color.surfaceContainerLow}))`),
|
|
4714
|
+
containerElevation: unsafeCSS(`var(--m3e-elevated-card-container-elevation, var(--m3e-card-container-elevation, ${DesignToken$1.elevation.level1}))`),
|
|
4715
|
+
disabled: {
|
|
4716
|
+
textColor: unsafeCSS(`var(--m3e-elevated-card-disabled-text-color, var(--m3e-card-disabled-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
4717
|
+
textOpacity: unsafeCSS(`var(--m3e-elevated-card-disabled-text-opacity, var(--m3e-card-disabled-text-opacity, 38%))`),
|
|
4718
|
+
imageOpacity: unsafeCSS(`var(--m3e-elevated-card-disabled-image-opacity, var(--m3e-card-disabled-image-opacity, 38%))`),
|
|
4719
|
+
containerColor: unsafeCSS(`var(--m3e-elevated-card-disabled-container-color, var(--m3e-card-disabled-container-color, ${DesignToken$1.color.surface}))`),
|
|
4720
|
+
containerElevation: unsafeCSS(`var(--m3e-elevated-card-disabled-container-elevation, var(--m3e-card-disabled-container-elevation, ${DesignToken$1.elevation.level1}))`),
|
|
4721
|
+
containerElevationColor: unsafeCSS(`var(--m3e-elevated-card-disabled-container-elevation-color, var(--m3e-card-disabled-container-elevation-color, ${DesignToken$1.color.onSurface}))`),
|
|
4722
|
+
containerElevationOpacity: unsafeCSS(`var(--m3e-elevated-card-disabled-container-elevation-opacity, var(--m3e-card-disabled-container-elevation-opacity, 38%))`),
|
|
4723
|
+
containerOpacity: unsafeCSS(`var(--m3e-elevated-card-disabled-container-opacity, var(--m3e-card-disabled-container-opacity, 38%))`)
|
|
4724
|
+
},
|
|
4725
|
+
hover: {
|
|
4726
|
+
textColor: unsafeCSS(`var(--m3e-elevated-card-hover-text-color, var(--m3e-card-hover-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
4727
|
+
stateLayerColor: unsafeCSS(`var(--m3e-elevated-card-hover-state-layer-color, var(--m3e-card-hover-state-layer-color, ${DesignToken$1.color.onSurface}))`),
|
|
4728
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-elevated-card-hover-state-layer-opacity, var(--m3e-card-hover-state-layer-opacity, ${DesignToken$1.state.hoverStateLayerOpacity}))`),
|
|
4729
|
+
containerElevation: unsafeCSS(`var(--m3e-elevated-card-hover-container-elevation, var(--m3e-card-hover-container-elevation, ${DesignToken$1.elevation.level2}))`)
|
|
4730
|
+
},
|
|
4731
|
+
focus: {
|
|
4732
|
+
textColor: unsafeCSS(`var(--m3e-elevated-card-focus-text-color, var(--m3e-card-focus-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
4733
|
+
stateLayerColor: unsafeCSS(`var(--m3e-elevated-card-focus-state-layer-color, var(--m3e-card-focus-state-layer-color, ${DesignToken$1.color.onSurface}))`),
|
|
4734
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-elevated-card-focus-state-layer-opacity, var(--m3e-card-focus-state-layer-opacity, ${DesignToken$1.state.focusStateLayerOpacity}))`),
|
|
4735
|
+
containerElevation: unsafeCSS(`var(--m3e-elevated-card-focus-container-elevation, var(--m3e-card-focus-container-elevation, ${DesignToken$1.elevation.level1}))`)
|
|
4736
|
+
},
|
|
4737
|
+
pressed: {
|
|
4738
|
+
textColor: unsafeCSS(`var(--m3e-elevated-card-pressed-text-color, var(--m3e-card-pressed-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
4739
|
+
stateLayerColor: unsafeCSS(`var(--m3e-elevated-card-pressed-state-layer-color, var(--m3e-card-pressed-state-layer-color, ${DesignToken$1.color.onSurface}))`),
|
|
4740
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-elevated-card-pressed-state-layer-opacity, var(--m3e-card-pressed-state-layer-opacity, ${DesignToken$1.state.pressedStateLayerOpacity}))`),
|
|
4741
|
+
containerElevation: unsafeCSS(`var(--m3e-elevated-card-pressed-container-elevation, var(--m3e-card-pressed-container-elevation, ${DesignToken$1.elevation.level1}))`)
|
|
4742
|
+
}
|
|
4743
|
+
},
|
|
4744
|
+
outlined: {
|
|
4745
|
+
textColor: unsafeCSS(`var(--m3e-outlined-card-text-color, var(--m3e-card-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
4746
|
+
containerColor: unsafeCSS(`var(--m3e-outlined-card-container-color, var(--m3e-card-container-color, ${DesignToken$1.color.surface}))`),
|
|
4747
|
+
containerElevation: unsafeCSS(`var(--m3e-outlined-card-container-elevation, var(--m3e-card-container-elevation, ${DesignToken$1.elevation.level0}))`),
|
|
4748
|
+
outlineColor: unsafeCSS(`var(--m3e-outlined-card-outline-color, var(--m3e-card-outline-color, ${DesignToken$1.color.outlineVariant}))`),
|
|
4749
|
+
outlineThickness: unsafeCSS("var(--m3e-outlined-card-outline-thickness, var(--m3e-card-outline-thickness, 1px))"),
|
|
4750
|
+
disabled: {
|
|
4751
|
+
textColor: unsafeCSS(`var(--m3e-outlined-card-disabled-text-color, var(--m3e-card-disabled-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
4752
|
+
textOpacity: unsafeCSS(`var(--m3e-outlined-card-disabled-text-opacity, var(--m3e-card-disabled-text-opacity, 38%))`),
|
|
4753
|
+
imageOpacity: unsafeCSS(`var(--m3e-outlined-card-disabled-image-opacity, var(--m3e-card-disabled-image-opacity, 38%))`),
|
|
4754
|
+
containerElevation: unsafeCSS(`var(--m3e-outlined-card-disabled-container-elevation, var(--m3e-card-disabled-container-elevation, ${DesignToken$1.elevation.level0}))`),
|
|
4755
|
+
containerElevationColor: unsafeCSS(`var(--m3e-outlined-card-disabled-container-elevation-color, var(--m3e-card-disabled-container-elevation-color, ${DesignToken$1.color.onSurface}))`),
|
|
4756
|
+
containerElevationOpacity: unsafeCSS(`var(--m3e-outlined-card-disabled-container-elevation-opacity, var(--m3e-card-disabled-container-elevation-opacity, 38%))`),
|
|
4757
|
+
outlineColor: unsafeCSS(`var(--m3e-outlined-card-disabled-outline-color, var(--m3e-card-disabled-outline-color, ${DesignToken$1.color.outline}))`),
|
|
4758
|
+
outlineOpacity: unsafeCSS(`var(--m3e-outlined-card-disabled-outline-opacity, var(--m3e-card-disabled-outline-opacity, 12%))`)
|
|
4759
|
+
},
|
|
4760
|
+
hover: {
|
|
4761
|
+
textColor: unsafeCSS(`var(--m3e-outlined-card-hover-text-color, var(--m3e-card-hover-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
4762
|
+
stateLayerColor: unsafeCSS(`var(--m3e-outlined-card-hover-state-layer-color, var(--m3e-card-hover-state-layer-color, ${DesignToken$1.color.onSurface}))`),
|
|
4763
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-outlined-card-hover-state-layer-opacity, var(--m3e-card-hover-state-layer-opacity, ${DesignToken$1.state.hoverStateLayerOpacity}))`),
|
|
4764
|
+
containerElevation: unsafeCSS(`var(--m3e-outlined-card-hover-container-elevation, var(--m3e-card-hover-container-elevation, ${DesignToken$1.elevation.level1}))`),
|
|
4765
|
+
outlineColor: unsafeCSS(`var(--m3e-outlined-card-hover-outline-color, var(--m3e-card-hover-outline-color, ${DesignToken$1.color.outlineVariant}))`)
|
|
4766
|
+
},
|
|
4767
|
+
focus: {
|
|
4768
|
+
textColor: unsafeCSS(`var(--m3e-outlined-card-focus-text-color, var(--m3e-card-focus-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
4769
|
+
stateLayerColor: unsafeCSS(`var(--m3e-outlined-card-focus-state-layer-color, var(--m3e-card-focus-state-layer-color, ${DesignToken$1.color.onSurface}))`),
|
|
4770
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-outlined-card-focus-state-layer-opacity, var(--m3e-card-focus-state-layer-opacity, ${DesignToken$1.state.focusStateLayerOpacity}))`),
|
|
4771
|
+
containerElevation: unsafeCSS(`var(--m3e-outlined-card-focus-container-elevation, var(--m3e-card-focus-container-elevation, ${DesignToken$1.elevation.level0}))`),
|
|
4772
|
+
outlineColor: unsafeCSS(`var(--m3e-outlined-card-focus-outline-color, var(--m3e-card-focus-outline-color, ${DesignToken$1.color.onSurface}))`)
|
|
4773
|
+
},
|
|
4774
|
+
pressed: {
|
|
4775
|
+
textColor: unsafeCSS(`var(--m3e-outlined-card-pressed-text-color, var(--m3e-card-pressed-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
4776
|
+
stateLayerColor: unsafeCSS(`var(--m3e-outlined-card-pressed-state-layer-color, var(--m3e-card-pressed-state-layer-color, ${DesignToken$1.color.onSurface}))`),
|
|
4777
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-outlined-card-pressed-state-layer-opacity, var(--m3e-card-pressed-state-layer-opacity, ${DesignToken$1.state.pressedStateLayerOpacity}))`),
|
|
4778
|
+
containerElevation: unsafeCSS(`var(--m3e-outlined-card-pressed-container-elevation, var(--m3e-card-pressed-container-elevation, ${DesignToken$1.elevation.level0}))`),
|
|
4779
|
+
outlineColor: unsafeCSS(`var(--m3e-outlined-card-pressed-outline-color, var(--m3e-card-pressed-outline-color, ${DesignToken$1.color.outlineVariant}))`)
|
|
4780
|
+
}
|
|
4781
|
+
}
|
|
4782
|
+
};
|
|
4783
|
+
|
|
4784
|
+
/**
|
|
4785
|
+
* Baseline styles for `M3eCardElement`.
|
|
4786
|
+
* @internal
|
|
4787
|
+
*/
|
|
4788
|
+
const CardStyle = css`:host { outline: none; } :host(:not([inline])) { display: block; } :host(:not([inline])) .base { display: flex; } :host([inline]) { display: inline-block; vertical-align: middle; } :host([inline]) .base { display: inline-flex; } .base { width: 100%; height: 100%; position: relative; box-sizing: border-box; border-radius: ${CardToken.shape}; transition: ${unsafeCSS(`background-color ${DesignToken$1.motion.duration.short4} ${DesignToken$1.motion.easing.standard},
|
|
4789
|
+
border-color ${DesignToken$1.motion.duration.short4} ${DesignToken$1.motion.easing.standard}`)}; } :host([actionable]) { user-select: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } :host([actionable]:not(:disabled):not([disabled-interactive])) { cursor: pointer; } :host([actionable][disabled-interactive]) { cursor: not-allowed; } :host(:not([actionable])) .focus-ring, :host(:not([actionable])) .state-layer, :host(:not([actionable])) .ripple { display: none; } :host([variant="outlined"]) .base { border-style: solid; } ::slotted([slot="content"]) { flex: 1 1 auto; } ::slotted(img), ::slotted(video) { inset: 0; object-fit: cover; } ::slotted(img[slot="header"]), ::slotted(video[slot="header"]) { border-radius: ${CardToken.shape}; } ::slotted([slot="actions"][end]) { justify-content: flex-end; } ::slotted([slot="header"]), ::slotted([slot="actions"]), ::slotted([slot="footer"]) { flex: none; display: flex; align-items: center; } :host([orientation="vertical"]) .base, :host([orientation="horizontal"]) ::slotted([slot="header"]), :host([orientation="horizontal"]) ::slotted([slot="actions"]), :host([orientation="horizontal"]) ::slotted([slot="footer"]) { flex-direction: column; } :host([orientation="horizontal"]) .base, :host([orientation="vertical"]) ::slotted([slot="header"]), :host([orientation="vertical"]) ::slotted([slot="actions"]), :host([orientation="vertical"]) ::slotted([slot="footer"]) { flex-direction: row; } :host([orientation="horizontal"]) ::slotted(img), :host([orientation="horizontal"]) ::slotted(video) { aspect-ratio: 16 / 9; } .has-content:not(.has-default) slot[name="content"], .has-content.has-default slot:not([name]) { display: inherit; flex-direction: inherit; flex: 1 1 auto; } .has-header slot[name="header"], .has-actions slot[name="actions"], .has-footer slot[name="footer"] { display: inherit; flex-direction: inherit; flex: none; } :host([orientation="vertical"]) .has-content:not(.has-default) slot[name="content"] { margin-inline: ${CardToken.padding}; } :host([orientation="vertical"]) .has-content:not(.has-default):not(.has-header) slot[name="content"] { margin-block-start: ${CardToken.padding}; } :host([orientation="vertical"]) .has-content:not(.has-default):not(.has-actions):not(.has-footer) slot[name="content"] { margin-block-end: ${CardToken.padding}; } :host([orientation="horizontal"]) .has-content:not(.has-default) slot[name="content"] { margin-block: ${CardToken.padding}; } :host([orientation="horizontal"]) .has-content:not(.has-default):not(.has-header) slot[name="content"] { margin-inline-start: ${CardToken.padding}; } :host([orientation="horizontal"]) .has-content:not(.has-default):not(.has-actions):not(.has-footer) slot[name="content"] { margin-inline-end: ${CardToken.padding}; } :host([orientation="vertical"]) .has-header:not(.has-header-media) slot[name="header"] { margin-inline: ${CardToken.padding}; margin-block-start: ${CardToken.padding}; } :host([orientation="horizontal"]) .has-header:not(.has-header-media) slot[name="header"] { margin-inline-start: ${CardToken.padding}; margin-block: ${CardToken.padding}; } .has-actions slot[name="actions"] { margin-inline: ${CardToken.padding}; margin-block: ${CardToken.padding}; } :host([orientation="vertical"]) .has-footer slot[name="footer"] { margin-inline: ${CardToken.padding}; margin-block-end: ${CardToken.padding}; } :host([orientation="horizontal"]) .has-footer slot[name="footer"] { margin-block: ${CardToken.padding}; margin-inline-end: ${CardToken.padding}; } a { all: unset; display: block; position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px; z-index: 1; } @media (forced-colors: active) { .base { transition: none; } :host([variant]) .base { border-style: solid; border-color: CanvasText; border-width: ${CardVariantToken.outlined.outlineThickness ?? unsafeCSS("unset")}; } :host([actionable][variant]:disabled) .base, :host([actionable][variant][disabled-interactive]) .base { color: GrayText; border-color: GrayText; } } @media (prefers-reduced-motion) { .base { transition: none; } }`;
|
|
4790
|
+
|
|
4791
|
+
/** @private */
|
|
4792
|
+
function cardVariantStyle(variant) {
|
|
4793
|
+
return css`:host([variant="${unsafeCSS(variant)}"]) .base { background-color: ${CardVariantToken[variant].containerColor ?? unsafeCSS("unset")}; box-shadow: ${CardVariantToken[variant].containerElevation ?? unsafeCSS("unset")}; border-width: ${CardVariantToken[variant].outlineThickness ?? unsafeCSS("unset")}; } :host([actionable][variant="${unsafeCSS(variant)}"]) .base { --m3e-state-layer-hover-color: ${CardVariantToken[variant].hover.stateLayerColor}; --m3e-state-layer-hover-opacity: ${CardVariantToken[variant].hover.stateLayerOpacity}; --m3e-state-layer-focus-color: ${CardVariantToken[variant].focus.stateLayerColor}; --m3e-state-layer-focus-opacity: ${CardVariantToken[variant].focus.stateLayerOpacity}; --m3e-ripple-color: ${CardVariantToken[variant].pressed.stateLayerColor}; --m3e-ripple-opacity: ${CardVariantToken[variant].pressed.stateLayerOpacity}; --m3e-elevation-level: ${CardVariantToken[variant].containerElevation ?? unsafeCSS("unset")}; --m3e-elevation-hover-level: ${CardVariantToken[variant].hover.containerElevation ?? unsafeCSS("unset")}; --m3e-elevation-focus-level: ${CardVariantToken[variant].focus.containerElevation ?? unsafeCSS("unset")}; --m3e-elevation-pressed-level: ${CardVariantToken[variant].pressed.containerElevation ?? unsafeCSS("unset")}; } :host([variant="${unsafeCSS(variant)}"]) .base { border-color: ${CardVariantToken[variant].outlineColor ?? unsafeCSS("unset")}; } :host([actionable][variant="${unsafeCSS(variant)}"]:focus .base) { border-color: ${CardVariantToken[variant].focus.outlineColor ?? unsafeCSS("unset")}; } :host([actionable][variant="${unsafeCSS(variant)}"]:hover .base) { border-color: ${CardVariantToken[variant].hover.outlineColor ?? unsafeCSS("unset")}; } :host([actionable][variant="${unsafeCSS(variant)}"]) .base.pressed { border-color: ${CardVariantToken[variant].pressed.outlineColor ?? unsafeCSS("unset")}; } :host([variant="${unsafeCSS(variant)}"]) .base { color: ${CardVariantToken[variant].textColor ?? unsafeCSS("unset")}; } :host([actionable][variant="${unsafeCSS(variant)}"]:focus) .base { color: ${CardVariantToken[variant].focus.textColor ?? unsafeCSS("unset")}; } :host([actionable][variant="${unsafeCSS(variant)}"]:hover) .base { color: ${CardVariantToken[variant].hover.textColor ?? unsafeCSS("unset")}; } :host([actionable][variant="${unsafeCSS(variant)}"]) .base.pressed { color: ${CardVariantToken[variant].pressed.textColor ?? unsafeCSS("unset")}; } :host([actionable][variant="${unsafeCSS(variant)}"]:disabled) .base, :host([actionable][variant="${unsafeCSS(variant)}"][disabled-interactive]) .base { --m3e-elevation-level: ${CardVariantToken[variant].disabled.containerElevation ?? unsafeCSS("unset")}; --m3e-elevation-color: color-mix( in srgb, ${CardVariantToken[variant].disabled.containerElevationColor} ${CardVariantToken[variant].disabled.containerElevationOpacity}, transparent ); color: color-mix( in srgb, ${CardVariantToken[variant].disabled.textColor} ${CardVariantToken[variant].disabled.textOpacity}, transparent ); background-color: ${CardVariantToken[variant].disabled.containerColor && CardVariantToken[variant].disabled.containerOpacity ? unsafeCSS(`color-mix(
|
|
4794
|
+
in srgb,
|
|
4795
|
+
${CardVariantToken[variant].disabled.containerColor} ${CardVariantToken[variant].disabled.containerOpacity},
|
|
4796
|
+
transparent
|
|
4797
|
+
)`) : unsafeCSS("unset")}; border-color: ${CardVariantToken[variant].disabled.outlineColor && CardVariantToken[variant].disabled.outlineOpacity ? unsafeCSS(`color-mix(
|
|
4798
|
+
in srgb,
|
|
4799
|
+
${CardVariantToken[variant].disabled.outlineColor} ${CardVariantToken[variant].disabled.outlineOpacity},
|
|
3751
4800
|
transparent
|
|
3752
4801
|
)`) : unsafeCSS("unset")}; } :host([actionable][variant="${unsafeCSS(variant)}"]:disabled) ::slotted(img), :host([actionable][variant="${unsafeCSS(variant)}"][disabled-interactive]) ::slotted(img), :host([actionable][variant="${unsafeCSS(variant)}"]:disabled) ::slotted(video), :host([actionable][variant="${unsafeCSS(variant)}"][disabled-interactive]) ::slotted(video) { opacity: ${CardVariantToken[variant].disabled.imageOpacity}; }`;
|
|
3753
4802
|
}
|
|
@@ -5125,11 +6174,7 @@ _M3eInputChipSetElement_handleInputKeyDown = function _M3eInputChipSetElement_ha
|
|
|
5125
6174
|
}
|
|
5126
6175
|
};
|
|
5127
6176
|
(() => {
|
|
5128
|
-
|
|
5129
|
-
const lightDomStyle = new CSSStyleSheet();
|
|
5130
|
-
lightDomStyle.replaceSync(css`m3e-input-chip-set [slot="input"]::placeholder { user-select: none; color: currentColor; transition: opacity ${DesignToken$1.motion.duration.extraLong1}; } m3e-input-chip-set:not(:focus-within) [slot="input"]::placeholder { opacity: 0; transition: 0s; } m3e-input-chip-set:hover [slot="input"]::placeholder { transition: 0s; } @media (prefers-reduced-motion) { m3e-input-chip-set [slot="input"]::placeholder { transition: none !important; } }`.toString());
|
|
5131
|
-
document.adoptedStyleSheets = [...document.adoptedStyleSheets, lightDomStyle];
|
|
5132
|
-
}
|
|
6177
|
+
registerStyleSheet$1(css`m3e-input-chip-set [slot="input"]::placeholder { user-select: none; color: currentColor; transition: opacity ${DesignToken$1.motion.duration.extraLong1}; } m3e-input-chip-set:not(:focus-within) [slot="input"]::placeholder { opacity: 0; transition: 0s; } m3e-input-chip-set:hover [slot="input"]::placeholder { transition: 0s; } @media (prefers-reduced-motion) { m3e-input-chip-set [slot="input"]::placeholder { transition: none !important; } }`);
|
|
5133
6178
|
})();
|
|
5134
6179
|
/** The styles of the element. */
|
|
5135
6180
|
M3eInputChipSetElement.styles = [M3eChipSetElement.styles, css`::slotted([slot="input"]) { outline: unset; border: unset; background-color: transparent; box-shadow: none; font-family: inherit; font-size: inherit; line-height: initial; letter-spacing: inherit; color: var(--_form-field-input-color, inherit); flex: 1 1 auto; min-width: 0; padding: unset; } ::slotted(m3e-input-chip) { min-width: 0; } span[role="row"], span[role="gridcell"] { display: contents; }`];
|
|
@@ -5776,8 +6821,19 @@ function interceptProperty(target, prop, options) {
|
|
|
5776
6821
|
* Determines whether reduced motion is preferred.
|
|
5777
6822
|
* @returns {boolean} Whether reduced motion is preferred.
|
|
5778
6823
|
*/
|
|
5779
|
-
function prefersReducedMotion() {
|
|
5780
|
-
return isServer || matchMedia("(prefers-reduced-motion)").matches;
|
|
6824
|
+
function prefersReducedMotion() {
|
|
6825
|
+
return isServer || matchMedia("(prefers-reduced-motion)").matches;
|
|
6826
|
+
}
|
|
6827
|
+
|
|
6828
|
+
/**
|
|
6829
|
+
* Registers a constructable stylesheet in the document’s `adoptedStyleSheets`.
|
|
6830
|
+
* @param css - A `CSSResult` (e.g., from `css```) whose text will be injected into a constructable stylesheet.
|
|
6831
|
+
*/
|
|
6832
|
+
function registerStyleSheet(css) {
|
|
6833
|
+
if (typeof window === "undefined") return;
|
|
6834
|
+
const sheet = new CSSStyleSheet();
|
|
6835
|
+
sheet.replaceSync(css.toString());
|
|
6836
|
+
document.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet];
|
|
5781
6837
|
}
|
|
5782
6838
|
|
|
5783
6839
|
/**
|
|
@@ -6079,6 +7135,46 @@ _HoverController_callback = new WeakMap(), _HoverController_startDelays = new We
|
|
|
6079
7135
|
}
|
|
6080
7136
|
};
|
|
6081
7137
|
|
|
7138
|
+
var _InertController_host, _InertController_inerts;
|
|
7139
|
+
/**
|
|
7140
|
+
* A `ReactiveController` that provides safe, predictable inerting of background
|
|
7141
|
+
* content for modal UI surfaces (dialogs, date pickers, fullscreen search views).
|
|
7142
|
+
*/
|
|
7143
|
+
class InertController {
|
|
7144
|
+
constructor(host) {
|
|
7145
|
+
/** @private */_InertController_host.set(this, void 0);
|
|
7146
|
+
/** @private */
|
|
7147
|
+
_InertController_inerts.set(this, new Array());
|
|
7148
|
+
__classPrivateFieldSet(this, _InertController_host, host, "f");
|
|
7149
|
+
host.addController(this);
|
|
7150
|
+
}
|
|
7151
|
+
/**
|
|
7152
|
+
* Locks background content by applying inertness to all non‑modal elements,
|
|
7153
|
+
* isolating the active surface from pointer and keyboard interaction.
|
|
7154
|
+
*/
|
|
7155
|
+
lock() {
|
|
7156
|
+
this.unlock();
|
|
7157
|
+
for (let current = __classPrivateFieldGet(this, _InertController_host, "f"); current.parentNode && current.parentNode !== document.documentElement; current = current.parentNode) {
|
|
7158
|
+
for (const sibling of current.parentNode.children) {
|
|
7159
|
+
if (sibling instanceof HTMLElement && sibling !== current && !sibling.inert) {
|
|
7160
|
+
sibling.inert = true;
|
|
7161
|
+
__classPrivateFieldGet(this, _InertController_inerts, "f").push(sibling);
|
|
7162
|
+
}
|
|
7163
|
+
}
|
|
7164
|
+
}
|
|
7165
|
+
}
|
|
7166
|
+
/** Restores background interactivity by removing inertness previously applied during `lock()`. */
|
|
7167
|
+
unlock() {
|
|
7168
|
+
__classPrivateFieldGet(this, _InertController_inerts, "f").forEach(x => x.inert = false);
|
|
7169
|
+
__classPrivateFieldGet(this, _InertController_inerts, "f").length = 0;
|
|
7170
|
+
}
|
|
7171
|
+
/** @inheritdoc */
|
|
7172
|
+
hostDisconnected() {
|
|
7173
|
+
this.unlock();
|
|
7174
|
+
}
|
|
7175
|
+
}
|
|
7176
|
+
_InertController_host = new WeakMap(), _InertController_inerts = new WeakMap();
|
|
7177
|
+
|
|
6082
7178
|
var _IntersectionController_callback, _IntersectionController_skipInitial, _IntersectionController_observer, _IntersectionController_unobservedUpdate;
|
|
6083
7179
|
/** A `ReactiveController` used to monitor changes in the intersection of a target element with an ancestor element. */
|
|
6084
7180
|
class IntersectionController extends MonitorControllerBase {
|
|
@@ -6677,6 +7773,55 @@ _ScrollLockController_locked = new WeakMap(), _ScrollLockController_scrollTop =
|
|
|
6677
7773
|
return document.documentElement.scrollHeight > document.documentElement.clientHeight;
|
|
6678
7774
|
};
|
|
6679
7775
|
|
|
7776
|
+
/** Converts an ISO‑8601 date to and from a `Date` object. */
|
|
7777
|
+
const dateConverter = {
|
|
7778
|
+
fromAttribute(value) {
|
|
7779
|
+
if (!value) return null;
|
|
7780
|
+
// Matches all four formats:
|
|
7781
|
+
// yyyy-MM-dd
|
|
7782
|
+
// yyyy-MM-ddTHH:mm:ss
|
|
7783
|
+
// yyyy-MM-ddTHH:mm:ssZ
|
|
7784
|
+
// yyyy-MM-ddTHH:mm:ss±HH:mm
|
|
7785
|
+
const isoRegex = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{3}))?)?(Z|[+-]\d{2}:\d{2})?$/;
|
|
7786
|
+
const m = value.match(isoRegex);
|
|
7787
|
+
if (!m) return null;
|
|
7788
|
+
const year = Number(m[1]);
|
|
7789
|
+
const month = Number(m[2]) - 1; // JS months are 0-based
|
|
7790
|
+
const day = Number(m[3]);
|
|
7791
|
+
const hasTime = m[4] !== undefined;
|
|
7792
|
+
const hours = hasTime ? Number(m[4]) : 0;
|
|
7793
|
+
const minutes = hasTime ? Number(m[5]) : 0;
|
|
7794
|
+
const seconds = hasTime ? Number(m[6]) : 0;
|
|
7795
|
+
const ms = hasTime && m[7] ? Number(m[7]) : 0;
|
|
7796
|
+
const tz = m[8];
|
|
7797
|
+
// CASE 1: yyyy-MM-dd → local date (no timezone math)
|
|
7798
|
+
if (!hasTime && !tz) {
|
|
7799
|
+
return new Date(year, month, day);
|
|
7800
|
+
}
|
|
7801
|
+
// CASE 2: yyyy-MM-ddTHH:mm:ss (no timezone) → local datetime
|
|
7802
|
+
if (hasTime && !tz) {
|
|
7803
|
+
return new Date(year, month, day, hours, minutes, seconds, ms);
|
|
7804
|
+
}
|
|
7805
|
+
// CASE 3: yyyy-MM-ddTHH:mm:ssZ → UTC
|
|
7806
|
+
if (tz === "Z") {
|
|
7807
|
+
return new Date(Date.UTC(year, month, day, hours, minutes, seconds, ms));
|
|
7808
|
+
}
|
|
7809
|
+
// CASE 4: yyyy-MM-ddTHH:mm:ss±HH:mm → offset
|
|
7810
|
+
if (tz && /^[+-]\d{2}:\d{2}$/.test(tz)) {
|
|
7811
|
+
const sign = tz.startsWith("-") ? -1 : 1;
|
|
7812
|
+
const [tzH, tzM] = tz.slice(1).split(":").map(Number);
|
|
7813
|
+
const offsetMinutes = sign * (tzH * 60 + tzM);
|
|
7814
|
+
// Convert offset datetime → UTC → local
|
|
7815
|
+
const utc = Date.UTC(year, month, day, hours, minutes, seconds, ms);
|
|
7816
|
+
return new Date(utc - offsetMinutes * 60_000);
|
|
7817
|
+
}
|
|
7818
|
+
return null;
|
|
7819
|
+
},
|
|
7820
|
+
toAttribute(value) {
|
|
7821
|
+
return value?.toISOString() ?? null;
|
|
7822
|
+
}
|
|
7823
|
+
};
|
|
7824
|
+
|
|
6680
7825
|
/** Converts a space-separated attribute in to an array of strings. */
|
|
6681
7826
|
const spaceSeparatedStringConverter = {
|
|
6682
7827
|
fromAttribute(value) {
|
|
@@ -10215,51 +11360,584 @@ M3eTextHighlightElement.styles = css`:host { display: contents; }`;
|
|
|
10215
11360
|
/** @private */
|
|
10216
11361
|
M3eTextHighlightElement.__nextId = 0;
|
|
10217
11362
|
__decorate([property({
|
|
10218
|
-
type: Boolean,
|
|
10219
|
-
reflect: true
|
|
10220
|
-
})], M3eTextHighlightElement.prototype, "disabled", void 0);
|
|
10221
|
-
__decorate([property()], M3eTextHighlightElement.prototype, "term", void 0);
|
|
11363
|
+
type: Boolean,
|
|
11364
|
+
reflect: true
|
|
11365
|
+
})], M3eTextHighlightElement.prototype, "disabled", void 0);
|
|
11366
|
+
__decorate([property()], M3eTextHighlightElement.prototype, "term", void 0);
|
|
11367
|
+
__decorate([property({
|
|
11368
|
+
attribute: "case-sensitive",
|
|
11369
|
+
type: Boolean
|
|
11370
|
+
})], M3eTextHighlightElement.prototype, "caseSensitive", void 0);
|
|
11371
|
+
__decorate([property()], M3eTextHighlightElement.prototype, "mode", void 0);
|
|
11372
|
+
M3eTextHighlightElement = M3eTextHighlightElement_1 = __decorate([customElement("m3e-text-highlight")], M3eTextHighlightElement);
|
|
11373
|
+
|
|
11374
|
+
/**
|
|
11375
|
+
* An inline container which presents an ellipsis when content overflows.
|
|
11376
|
+
*
|
|
11377
|
+
* @description
|
|
11378
|
+
* The `m3e-text-overflow` component truncates inline content with an ellipsis when it
|
|
11379
|
+
* exceeds the available width. It's intended for use inside flex or otherwise
|
|
11380
|
+
* constrained containers to preserve layout while providing predictable, single-line
|
|
11381
|
+
* truncation behavior for long text.
|
|
11382
|
+
*
|
|
11383
|
+
* @example
|
|
11384
|
+
* A typical usage inside a flex container where the heading and trailing actions are
|
|
11385
|
+
* constrained, allowing the center text to truncate with an ellipsis.
|
|
11386
|
+
*
|
|
11387
|
+
* ```html
|
|
11388
|
+
* <div style="display:flex;align-items:center;gap:12px;">
|
|
11389
|
+
* <m3e-icon name="menu"></m3e-icon>
|
|
11390
|
+
* <m3e-text-overflow>Very long title or breadcrumb that should truncate gracefully</m3e-text-overflow>
|
|
11391
|
+
* <m3e-icon name="more_vert"></m3e-icon>
|
|
11392
|
+
* </div>
|
|
11393
|
+
* ```
|
|
11394
|
+
*
|
|
11395
|
+
* @tag m3e-text-overflow
|
|
11396
|
+
*
|
|
11397
|
+
* @slot - Renders the content to truncate with an ellipsis.
|
|
11398
|
+
*/
|
|
11399
|
+
let M3eTextOverflowElement = class M3eTextOverflowElement extends LitElement {
|
|
11400
|
+
/** @inheritdoc */
|
|
11401
|
+
render() {
|
|
11402
|
+
return html`<span class="base"><slot></slot></span>`;
|
|
11403
|
+
}
|
|
11404
|
+
};
|
|
11405
|
+
/** The styles of the element. */
|
|
11406
|
+
M3eTextOverflowElement.styles = css`:host { flex: 1 1 auto; display: inline-flex; align-items: center; flex-wrap: nowrap; min-width: 0; } .base { flex: 1 1 auto; display: inline; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }`;
|
|
11407
|
+
M3eTextOverflowElement = __decorate([customElement("m3e-text-overflow")], M3eTextOverflowElement);
|
|
11408
|
+
|
|
11409
|
+
var _M3eDatepickerElement_instances, _M3eDatepickerElement_breakpointUnobserve, _M3eDatepickerElement_trigger, _M3eDatepickerElement_anchor, _M3eDatepickerElement_anchorCleanup, _M3eDatepickerElement_scrollLockController, _M3eDatepickerElement_inertController, _M3eDatepickerElement_documentClickHandler, _M3eDatepickerElement_documentKeyDownHandler, _M3eDatepickerElement_toggleHandler, _M3eDatepickerElement_renderHeader, _M3eDatepickerElement_handleDocumentClick, _M3eDatepickerElement_handleCalendarChange, _M3eDatepickerElement_handleClearClick, _M3eDatepickerElement_handleDismissClick, _M3eDatepickerElement_handleConfirmClick, _M3eDatepickerElement_handleDocumentKeyDown, _M3eDatepickerElement_updateVariant, _M3eDatepickerElement_updatePosition, _M3eDatepickerElement_clearSelectionState;
|
|
11410
|
+
var M3eDatepickerElement_1;
|
|
11411
|
+
/**
|
|
11412
|
+
* Presents a date picker on a temporary surface.
|
|
11413
|
+
*
|
|
11414
|
+
* @description
|
|
11415
|
+
* The `m3e-datepicker` component provides a date‑selection experience
|
|
11416
|
+
* consistent with Material 3 guidance for layout, motion, and accessibility.
|
|
11417
|
+
* It displays a temporary surface that allows users to select a date or date
|
|
11418
|
+
* range using calendar-based views. The picker supports month, year, and
|
|
11419
|
+
* multi‑year views, enabling users to navigate across time efficiently.
|
|
11420
|
+
*
|
|
11421
|
+
* While open, the picker uses a focused selection flow. Users review their
|
|
11422
|
+
* choice and complete the interaction through confirm, dismiss, or clear
|
|
11423
|
+
* actions, ensuring intentional updates to the field or control that invoked it.
|
|
11424
|
+
*
|
|
11425
|
+
* It accepts and emits plain `Date` values, allowing applications to apply their
|
|
11426
|
+
* own formatting, parsing, and localization.
|
|
11427
|
+
*
|
|
11428
|
+
* @tag m3e-datepicker
|
|
11429
|
+
*
|
|
11430
|
+
* @attr variant - The appearance variant of the picker.
|
|
11431
|
+
* @attr clearable - Whether the user can clear the selected date and close the picker.
|
|
11432
|
+
* @attr date - The selected date.
|
|
11433
|
+
* @attr max-date - The maximum date that can be selected.
|
|
11434
|
+
* @attr min-date - The minimum date that can be selected.
|
|
11435
|
+
* @attr range-end - End of a date range.
|
|
11436
|
+
* @attr range-start - Start of a date range.
|
|
11437
|
+
* @attr start-at - A date specifying the period (month or year) to start the calendar in.
|
|
11438
|
+
* @attr start-view - The initial view used to select a date.
|
|
11439
|
+
* @attr previous-month-label - The accessible label given to the button used to move to the previous month.
|
|
11440
|
+
* @attr next-month-label - The accessible label given to the button used to move to the next month.
|
|
11441
|
+
* @attr previous-year-label - The accessible label given to the button used to move to the previous year.
|
|
11442
|
+
* @attr next-year-label - The accessible label given to the button used to move to the next year.
|
|
11443
|
+
* @attr previous-multi-year-label - The accessible label given to the button used to move to the previous 24 years.
|
|
11444
|
+
* @attr next-multi-year-label - The accessible label given to the button used to move to the next 24 years.
|
|
11445
|
+
* @attr clear-label - The label given to the button used clear the selected date and close the picker.
|
|
11446
|
+
* @attr confirm-label - The label given to the button used apply the selected date and close the picker.
|
|
11447
|
+
* @attr dismiss-label - The label given to the button used discard the selected date and close the picker.
|
|
11448
|
+
* @attr label - The label given to the the picker.
|
|
11449
|
+
*
|
|
11450
|
+
* @fires change - Dispatched when the selected date changes.
|
|
11451
|
+
* @fires beforetoggle - Dispatched before the toggle state changes.
|
|
11452
|
+
* @fires toggle - Dispatched after the toggle state has changed.
|
|
11453
|
+
*
|
|
11454
|
+
* @cssprop --m3e-datepicker-container-padding-block - Block‑axis padding of the date picker container.
|
|
11455
|
+
* @cssprop --m3e-datepicker-container-padding-inline - Inline‑axis padding of the date picker container.
|
|
11456
|
+
* @cssprop --m3e-datepicker-container-color - Background color of the standard container surface.
|
|
11457
|
+
* @cssprop --m3e-datepicker-container-elevation - Elevation shadow applied to the container surface.
|
|
11458
|
+
* @cssprop --m3e-datepicker-modal-headline-font-size - Font size used for the modal headline text.
|
|
11459
|
+
* @cssprop --m3e-datepicker-modal-headline-font-weight - Font weight used for the modal headline text.
|
|
11460
|
+
* @cssprop --m3e-datepicker-modal-headline-line-height - Line height used for the modal headline text.
|
|
11461
|
+
* @cssprop --m3e-datepicker-modal-headline-tracking - Letter spacing used for the modal headline text.
|
|
11462
|
+
* @cssprop --m3e-datepicker-modal-supporting-text-font-size - Font size used for supporting text in modal mode.
|
|
11463
|
+
* @cssprop --m3e-datepicker-modal-supporting-text-font-weight - Font weight used for supporting text in modal mode.
|
|
11464
|
+
* @cssprop --m3e-datepicker-modal-supporting-text-line-height - Line height used for supporting text in modal mode.
|
|
11465
|
+
* @cssprop --m3e-datepicker-modal-supporting-text-tracking - Letter spacing used for supporting text in modal mode.
|
|
11466
|
+
* @cssprop --m3e-datepicker-actions-padding-inline - Inline‑axis padding of the action row.
|
|
11467
|
+
* @cssprop --m3e-datepicker-docked-container-color - Background color of the container in docked mode.
|
|
11468
|
+
* @cssprop --m3e-datepicker-docked-container-shape - Corner radius of the container in docked mode.
|
|
11469
|
+
* @cssprop --m3e-datepicker-modal-container-color - Background color of the container in modal mode.
|
|
11470
|
+
* @cssprop --m3e-datepicker-modal-container-shape - Corner radius of the container in modal mode.
|
|
11471
|
+
* @cssprop --m3e-divider-thickness - Thickness of divider elements within the picker.
|
|
11472
|
+
* @cssprop --m3e-divider-color - Color of divider rules within the picker.
|
|
11473
|
+
* @cssprop --m3e-dialog-scrim-color - Base color used for the modal scrim behind the picker.
|
|
11474
|
+
* @cssprop --m3e-dialog-scrim-opacity - Opacity applied to the scrim color in modal mode.
|
|
11475
|
+
*/
|
|
11476
|
+
let M3eDatepickerElement = M3eDatepickerElement_1 = class M3eDatepickerElement extends SuppressInitialAnimation$1(AttachInternals$1(Role$1(LitElement, "dialog"))) {
|
|
11477
|
+
constructor() {
|
|
11478
|
+
super(...arguments);
|
|
11479
|
+
_M3eDatepickerElement_instances.add(this);
|
|
11480
|
+
/** @private */
|
|
11481
|
+
_M3eDatepickerElement_breakpointUnobserve.set(this, void 0);
|
|
11482
|
+
/** @private */
|
|
11483
|
+
_M3eDatepickerElement_trigger.set(this, void 0);
|
|
11484
|
+
/** @private */
|
|
11485
|
+
_M3eDatepickerElement_anchor.set(this, void 0);
|
|
11486
|
+
/** @private */
|
|
11487
|
+
_M3eDatepickerElement_anchorCleanup.set(this, void 0);
|
|
11488
|
+
/** @private */
|
|
11489
|
+
_M3eDatepickerElement_scrollLockController.set(this, new ScrollLockController$1(this));
|
|
11490
|
+
/** @private */
|
|
11491
|
+
_M3eDatepickerElement_inertController.set(this, new InertController$1(this));
|
|
11492
|
+
/** @private */
|
|
11493
|
+
_M3eDatepickerElement_documentClickHandler.set(this, e => __classPrivateFieldGet(this, _M3eDatepickerElement_instances, "m", _M3eDatepickerElement_handleDocumentClick).call(this, e));
|
|
11494
|
+
/** @private */
|
|
11495
|
+
_M3eDatepickerElement_documentKeyDownHandler.set(this, e => __classPrivateFieldGet(this, _M3eDatepickerElement_instances, "m", _M3eDatepickerElement_handleDocumentKeyDown).call(this, e));
|
|
11496
|
+
/** @private */
|
|
11497
|
+
_M3eDatepickerElement_toggleHandler.set(this, e => {
|
|
11498
|
+
if (e.newState === "closed") {
|
|
11499
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_instances, "m", _M3eDatepickerElement_clearSelectionState).call(this);
|
|
11500
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_anchorCleanup, "f")?.call(this);
|
|
11501
|
+
__classPrivateFieldSet(this, _M3eDatepickerElement_anchorCleanup, undefined, "f");
|
|
11502
|
+
}
|
|
11503
|
+
});
|
|
11504
|
+
/**
|
|
11505
|
+
* The appearance variant of the picker.
|
|
11506
|
+
* @default "docked"
|
|
11507
|
+
*/
|
|
11508
|
+
this.variant = "docked";
|
|
11509
|
+
/**
|
|
11510
|
+
* The initial view used to select a date.
|
|
11511
|
+
* @default "month"
|
|
11512
|
+
*/
|
|
11513
|
+
this.startView = "month";
|
|
11514
|
+
/**
|
|
11515
|
+
* The selected date.
|
|
11516
|
+
* @default null
|
|
11517
|
+
*/
|
|
11518
|
+
this.date = null;
|
|
11519
|
+
/**
|
|
11520
|
+
* A date specifying the period (month or year) to start the calendar in.
|
|
11521
|
+
* @default null
|
|
11522
|
+
*/
|
|
11523
|
+
this.startAt = null;
|
|
11524
|
+
/**
|
|
11525
|
+
* The minimum date that can be selected.
|
|
11526
|
+
* @default null
|
|
11527
|
+
*/
|
|
11528
|
+
this.minDate = null;
|
|
11529
|
+
/**
|
|
11530
|
+
* The maximum date that can be selected.
|
|
11531
|
+
* @default null
|
|
11532
|
+
*/
|
|
11533
|
+
this.maxDate = null;
|
|
11534
|
+
/**
|
|
11535
|
+
* Start of a date range.
|
|
11536
|
+
* @default null
|
|
11537
|
+
*/
|
|
11538
|
+
this.rangeStart = null;
|
|
11539
|
+
/**
|
|
11540
|
+
* End of a date range.
|
|
11541
|
+
* @default null
|
|
11542
|
+
*/
|
|
11543
|
+
this.rangeEnd = null;
|
|
11544
|
+
/**
|
|
11545
|
+
* A function used to determine whether a date cannot be selected.
|
|
11546
|
+
* @default null
|
|
11547
|
+
*/
|
|
11548
|
+
this.blackoutDates = null;
|
|
11549
|
+
/**
|
|
11550
|
+
* A function used to determine whether a date is special.
|
|
11551
|
+
* @default null
|
|
11552
|
+
*/
|
|
11553
|
+
this.specialDates = null;
|
|
11554
|
+
/**
|
|
11555
|
+
* The accessible label given to the button used to move to the previous month.
|
|
11556
|
+
* @default "Previous month"
|
|
11557
|
+
*/
|
|
11558
|
+
this.previousMonthLabel = "Previous month";
|
|
11559
|
+
/**
|
|
11560
|
+
* The accessible label given to the button used to move to the previous year.
|
|
11561
|
+
* @default "Previous year"
|
|
11562
|
+
*/
|
|
11563
|
+
this.previousYearLabel = "Previous year";
|
|
11564
|
+
/**
|
|
11565
|
+
* The accessible label given to the button used to move to the previous 24 years.
|
|
11566
|
+
* @default "Previous 24 years"
|
|
11567
|
+
*/
|
|
11568
|
+
this.previousMultiYearLabel = "Previous 24 years";
|
|
11569
|
+
/**
|
|
11570
|
+
* The accessible label given to the button used to move to the next month.
|
|
11571
|
+
* @default "Next month"
|
|
11572
|
+
*/
|
|
11573
|
+
this.nextMonthLabel = "Next month";
|
|
11574
|
+
/**
|
|
11575
|
+
* The accessible label given to the button used to move to the next year.
|
|
11576
|
+
* @default "Next year"
|
|
11577
|
+
*/
|
|
11578
|
+
this.nextYearLabel = "Next year";
|
|
11579
|
+
/**
|
|
11580
|
+
* The accessible label given to the button used to move to the next 24 years.
|
|
11581
|
+
* @default "Next 24 years"
|
|
11582
|
+
*/
|
|
11583
|
+
this.nextMultiYearLabel = "Next 24 years";
|
|
11584
|
+
/**
|
|
11585
|
+
* Whether the user can clear the selected date and close the picker.
|
|
11586
|
+
* @default false
|
|
11587
|
+
*/
|
|
11588
|
+
this.clearable = false;
|
|
11589
|
+
/**
|
|
11590
|
+
* The label given to the button used clear the selected date and close the picker.
|
|
11591
|
+
* @default "Clear"
|
|
11592
|
+
*/
|
|
11593
|
+
this.clearLabel = "Clear";
|
|
11594
|
+
/**
|
|
11595
|
+
* The label given to the button used apply the selected date and close the picker.
|
|
11596
|
+
* @default "OK"
|
|
11597
|
+
*/
|
|
11598
|
+
this.confirmLabel = "OK";
|
|
11599
|
+
/**
|
|
11600
|
+
* The label given to the button used discard the selected date and close the picker.
|
|
11601
|
+
* @default "Cancel"
|
|
11602
|
+
*/
|
|
11603
|
+
this.dismissLabel = "Cancel";
|
|
11604
|
+
/**
|
|
11605
|
+
* The label given to the the picker.
|
|
11606
|
+
* @default "Select date"
|
|
11607
|
+
*/
|
|
11608
|
+
this.label = "Select date";
|
|
11609
|
+
}
|
|
11610
|
+
/** Whether the picker is open. */
|
|
11611
|
+
get isOpen() {
|
|
11612
|
+
return __classPrivateFieldGet(this, _M3eDatepickerElement_trigger, "f") !== undefined;
|
|
11613
|
+
}
|
|
11614
|
+
/** The current variant applied to the picker. */
|
|
11615
|
+
get currentVariant() {
|
|
11616
|
+
return this._variant ?? (this.variant !== "modal" ? "docked" : "modal");
|
|
11617
|
+
}
|
|
11618
|
+
/** @inheritdoc */
|
|
11619
|
+
connectedCallback() {
|
|
11620
|
+
super.connectedCallback();
|
|
11621
|
+
this.setAttribute("popover", "manual");
|
|
11622
|
+
this.addEventListener("toggle", __classPrivateFieldGet(this, _M3eDatepickerElement_toggleHandler, "f"));
|
|
11623
|
+
document.addEventListener("click", __classPrivateFieldGet(this, _M3eDatepickerElement_documentClickHandler, "f"));
|
|
11624
|
+
document.addEventListener("keydown", __classPrivateFieldGet(this, _M3eDatepickerElement_documentKeyDownHandler, "f"));
|
|
11625
|
+
}
|
|
11626
|
+
/** @inheritdoc */
|
|
11627
|
+
disconnectedCallback() {
|
|
11628
|
+
super.disconnectedCallback();
|
|
11629
|
+
this._variant = undefined;
|
|
11630
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_breakpointUnobserve, "f")?.call(this);
|
|
11631
|
+
deleteCustomState$1(this, "-docked");
|
|
11632
|
+
deleteCustomState$1(this, "-modal");
|
|
11633
|
+
this.removeEventListener("toggle", __classPrivateFieldGet(this, _M3eDatepickerElement_toggleHandler, "f"));
|
|
11634
|
+
document.removeEventListener("click", __classPrivateFieldGet(this, _M3eDatepickerElement_documentClickHandler, "f"));
|
|
11635
|
+
document.removeEventListener("keydown", __classPrivateFieldGet(this, _M3eDatepickerElement_documentKeyDownHandler, "f"));
|
|
11636
|
+
}
|
|
11637
|
+
/**
|
|
11638
|
+
* Opens the picker.
|
|
11639
|
+
* @param {HTMLElement} trigger The element that triggered the picker.
|
|
11640
|
+
* @param {HTMLElement | undefined} anchor The element used to position the picker.
|
|
11641
|
+
* @returns {Promise<void>} A `Promise` that resolves when the picker is opened.
|
|
11642
|
+
*/
|
|
11643
|
+
async show(trigger, anchor) {
|
|
11644
|
+
if (__classPrivateFieldGet(this, _M3eDatepickerElement_trigger, "f") && __classPrivateFieldGet(this, _M3eDatepickerElement_trigger, "f") !== trigger) {
|
|
11645
|
+
this.hide();
|
|
11646
|
+
}
|
|
11647
|
+
if (this.currentVariant === "modal") {
|
|
11648
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_scrollLockController, "f").lock();
|
|
11649
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_inertController, "f").lock();
|
|
11650
|
+
}
|
|
11651
|
+
this._calendar.date = this.date;
|
|
11652
|
+
this._calendar.rangeStart = this.rangeStart;
|
|
11653
|
+
this._calendar.rangeEnd = this.rangeEnd;
|
|
11654
|
+
__classPrivateFieldSet(this, _M3eDatepickerElement_trigger, trigger, "f");
|
|
11655
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_trigger, "f").ariaExpanded = "true";
|
|
11656
|
+
__classPrivateFieldSet(this, _M3eDatepickerElement_anchor, anchor, "f");
|
|
11657
|
+
await __classPrivateFieldGet(this, _M3eDatepickerElement_instances, "m", _M3eDatepickerElement_updatePosition).call(this);
|
|
11658
|
+
this.showPopover();
|
|
11659
|
+
await this._calendar.focusActiveCell();
|
|
11660
|
+
}
|
|
11661
|
+
/**
|
|
11662
|
+
* Hides the picker.
|
|
11663
|
+
* @param {boolean} [restoreFocus=false] Whether to restore focus to the picker's trigger.
|
|
11664
|
+
*/
|
|
11665
|
+
hide(restoreFocus = false) {
|
|
11666
|
+
if (this.currentVariant === "modal") {
|
|
11667
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_scrollLockController, "f").unlock();
|
|
11668
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_inertController, "f").unlock();
|
|
11669
|
+
}
|
|
11670
|
+
this.hidePopover();
|
|
11671
|
+
if (__classPrivateFieldGet(this, _M3eDatepickerElement_trigger, "f")) {
|
|
11672
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_trigger, "f").ariaExpanded = "false";
|
|
11673
|
+
if (restoreFocus) {
|
|
11674
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_trigger, "f").focus();
|
|
11675
|
+
}
|
|
11676
|
+
__classPrivateFieldSet(this, _M3eDatepickerElement_trigger, undefined, "f");
|
|
11677
|
+
}
|
|
11678
|
+
}
|
|
11679
|
+
/**
|
|
11680
|
+
* Toggles the picker.
|
|
11681
|
+
* @param {HTMLElement} trigger The element that triggered the picker.
|
|
11682
|
+
* @param {HTMLElement | undefined} anchor The element used to position the picker.
|
|
11683
|
+
* @returns {Promise<void>} A `Promise` that resolves when the picker is opened or closed.
|
|
11684
|
+
*/
|
|
11685
|
+
async toggle(trigger, anchor) {
|
|
11686
|
+
if (__classPrivateFieldGet(this, _M3eDatepickerElement_trigger, "f")) {
|
|
11687
|
+
this.hide();
|
|
11688
|
+
} else {
|
|
11689
|
+
await this.show(trigger, anchor);
|
|
11690
|
+
}
|
|
11691
|
+
}
|
|
11692
|
+
/** @inheritdoc */
|
|
11693
|
+
render() {
|
|
11694
|
+
return html`<m3e-focus-trap>${__classPrivateFieldGet(this, _M3eDatepickerElement_instances, "m", _M3eDatepickerElement_renderHeader).call(this)}<m3e-calendar class="calendar" start-view="${this.startView}" start-at="${ifDefined(this.startAt?.toISOString())}" min-date="${ifDefined(this.minDate?.toISOString())}" max-date="${ifDefined(this.maxDate?.toISOString())}" @change="${__classPrivateFieldGet(this, _M3eDatepickerElement_instances, "m", _M3eDatepickerElement_handleCalendarChange)}"></m3e-calendar><div class="actions">${this.clearable ? html`<m3e-button @click="${__classPrivateFieldGet(this, _M3eDatepickerElement_instances, "m", _M3eDatepickerElement_handleClearClick)}">${this.clearLabel}</m3e-button>` : nothing}<div class="spacer" aria-hidden="true"></div><m3e-button @click="${__classPrivateFieldGet(this, _M3eDatepickerElement_instances, "m", _M3eDatepickerElement_handleDismissClick)}">${this.dismissLabel}</m3e-button><m3e-button @click="${__classPrivateFieldGet(this, _M3eDatepickerElement_instances, "m", _M3eDatepickerElement_handleConfirmClick)}">${this.confirmLabel}</m3e-button></div></m3e-focus-trap>`;
|
|
11695
|
+
}
|
|
11696
|
+
/** @inheritdoc */
|
|
11697
|
+
willUpdate(changedProperties) {
|
|
11698
|
+
super.willUpdate(changedProperties);
|
|
11699
|
+
if (["date", "rangeStart", "rangeEnd"].some(x => changedProperties.has(x))) {
|
|
11700
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_instances, "m", _M3eDatepickerElement_clearSelectionState).call(this);
|
|
11701
|
+
}
|
|
11702
|
+
if (changedProperties.has("variant")) {
|
|
11703
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_breakpointUnobserve, "f")?.call(this);
|
|
11704
|
+
if (this.variant === "auto") {
|
|
11705
|
+
__classPrivateFieldSet(this, _M3eDatepickerElement_breakpointUnobserve, M3eBreakpointObserver.observe([Breakpoint.XSmall, Breakpoint.Small], matches => {
|
|
11706
|
+
this._variant = matches.get(Breakpoint.XSmall) || matches.get(Breakpoint.Small) ? "modal" : "docked";
|
|
11707
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_instances, "m", _M3eDatepickerElement_updateVariant).call(this);
|
|
11708
|
+
}), "f");
|
|
11709
|
+
} else {
|
|
11710
|
+
this._variant = undefined;
|
|
11711
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_instances, "m", _M3eDatepickerElement_updateVariant).call(this);
|
|
11712
|
+
}
|
|
11713
|
+
}
|
|
11714
|
+
}
|
|
11715
|
+
/** @inheritdoc */
|
|
11716
|
+
updated(_changedProperties) {
|
|
11717
|
+
super.updated(_changedProperties);
|
|
11718
|
+
if (_changedProperties.has("specialDates") || _changedProperties.has("blackoutDates")) {
|
|
11719
|
+
this._calendar.specialDates = this.specialDates;
|
|
11720
|
+
this._calendar.blackoutDates = this.blackoutDates;
|
|
11721
|
+
}
|
|
11722
|
+
}
|
|
11723
|
+
};
|
|
11724
|
+
_M3eDatepickerElement_breakpointUnobserve = new WeakMap();
|
|
11725
|
+
_M3eDatepickerElement_trigger = new WeakMap();
|
|
11726
|
+
_M3eDatepickerElement_anchor = new WeakMap();
|
|
11727
|
+
_M3eDatepickerElement_anchorCleanup = new WeakMap();
|
|
11728
|
+
_M3eDatepickerElement_scrollLockController = new WeakMap();
|
|
11729
|
+
_M3eDatepickerElement_inertController = new WeakMap();
|
|
11730
|
+
_M3eDatepickerElement_documentClickHandler = new WeakMap();
|
|
11731
|
+
_M3eDatepickerElement_documentKeyDownHandler = new WeakMap();
|
|
11732
|
+
_M3eDatepickerElement_toggleHandler = new WeakMap();
|
|
11733
|
+
_M3eDatepickerElement_instances = new WeakSet();
|
|
11734
|
+
_M3eDatepickerElement_renderHeader = function _M3eDatepickerElement_renderHeader() {
|
|
11735
|
+
if (this.currentVariant === "docked") return nothing;
|
|
11736
|
+
const selectedDate = this._date ?? this.date;
|
|
11737
|
+
return html`<div class="supporting-text">${this.label}</div><div class="headline">${selectedDate ? new Intl.DateTimeFormat(navigator.language, {
|
|
11738
|
+
weekday: "short",
|
|
11739
|
+
month: "short",
|
|
11740
|
+
day: "numeric"
|
|
11741
|
+
}).format(selectedDate) : "––"}</div><div class="divider"></div>`;
|
|
11742
|
+
};
|
|
11743
|
+
_M3eDatepickerElement_handleDocumentClick = function _M3eDatepickerElement_handleDocumentClick(e) {
|
|
11744
|
+
if (!e.composedPath().some(x => x instanceof M3eDatepickerElement_1 || x === __classPrivateFieldGet(this, _M3eDatepickerElement_trigger, "f") || x === __classPrivateFieldGet(this, _M3eDatepickerElement_anchor, "f"))) {
|
|
11745
|
+
this.hide();
|
|
11746
|
+
}
|
|
11747
|
+
};
|
|
11748
|
+
_M3eDatepickerElement_handleCalendarChange = function _M3eDatepickerElement_handleCalendarChange() {
|
|
11749
|
+
this._date = this._calendar.date;
|
|
11750
|
+
this._rangeStart = this._calendar.rangeStart;
|
|
11751
|
+
this._rangeEnd = this._calendar.rangeEnd;
|
|
11752
|
+
};
|
|
11753
|
+
_M3eDatepickerElement_handleClearClick = function _M3eDatepickerElement_handleClearClick() {
|
|
11754
|
+
this.date = null;
|
|
11755
|
+
this.rangeStart = null;
|
|
11756
|
+
this.rangeEnd = null;
|
|
11757
|
+
this.hide(true);
|
|
11758
|
+
this.dispatchEvent(new Event("change", {
|
|
11759
|
+
bubbles: true
|
|
11760
|
+
}));
|
|
11761
|
+
};
|
|
11762
|
+
_M3eDatepickerElement_handleDismissClick = function _M3eDatepickerElement_handleDismissClick() {
|
|
11763
|
+
this.hide(true);
|
|
11764
|
+
};
|
|
11765
|
+
_M3eDatepickerElement_handleConfirmClick = function _M3eDatepickerElement_handleConfirmClick() {
|
|
11766
|
+
this.date = this._date ?? this.date;
|
|
11767
|
+
this.rangeStart = this._rangeStart === undefined ? this.rangeStart : this._rangeStart;
|
|
11768
|
+
this.rangeEnd = this._rangeEnd === undefined ? this.rangeEnd : this._rangeEnd;
|
|
11769
|
+
this.hide(true);
|
|
11770
|
+
this.dispatchEvent(new Event("change", {
|
|
11771
|
+
bubbles: true
|
|
11772
|
+
}));
|
|
11773
|
+
};
|
|
11774
|
+
_M3eDatepickerElement_handleDocumentKeyDown = function _M3eDatepickerElement_handleDocumentKeyDown(e) {
|
|
11775
|
+
if (this.isOpen && this.currentVariant === "modal" && e.key === "Escape" && !e.shiftKey && !e.ctrlKey) {
|
|
11776
|
+
e.preventDefault();
|
|
11777
|
+
this.hide(true);
|
|
11778
|
+
}
|
|
11779
|
+
};
|
|
11780
|
+
_M3eDatepickerElement_updateVariant = function _M3eDatepickerElement_updateVariant() {
|
|
11781
|
+
switch (this.currentVariant) {
|
|
11782
|
+
case "docked":
|
|
11783
|
+
this.ariaModal = null;
|
|
11784
|
+
deleteCustomState$1(this, "-modal");
|
|
11785
|
+
addCustomState$1(this, "-docked");
|
|
11786
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_scrollLockController, "f").unlock();
|
|
11787
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_inertController, "f").unlock();
|
|
11788
|
+
break;
|
|
11789
|
+
case "modal":
|
|
11790
|
+
this.ariaModal = "true";
|
|
11791
|
+
deleteCustomState$1(this, "-docked");
|
|
11792
|
+
addCustomState$1(this, "-modal");
|
|
11793
|
+
if (this.isOpen) {
|
|
11794
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_scrollLockController, "f").lock();
|
|
11795
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_inertController, "f").lock();
|
|
11796
|
+
}
|
|
11797
|
+
break;
|
|
11798
|
+
}
|
|
11799
|
+
if (this.isOpen) {
|
|
11800
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_instances, "m", _M3eDatepickerElement_updatePosition).call(this);
|
|
11801
|
+
}
|
|
11802
|
+
};
|
|
11803
|
+
_M3eDatepickerElement_updatePosition = /** @private */
|
|
11804
|
+
async function _M3eDatepickerElement_updatePosition() {
|
|
11805
|
+
if (this.currentVariant === "docked" && __classPrivateFieldGet(this, _M3eDatepickerElement_trigger, "f")) {
|
|
11806
|
+
__classPrivateFieldSet(this, _M3eDatepickerElement_anchorCleanup, await positionAnchor(this, __classPrivateFieldGet(this, _M3eDatepickerElement_anchor, "f") ?? __classPrivateFieldGet(this, _M3eDatepickerElement_trigger, "f"), {
|
|
11807
|
+
position: "bottom-start",
|
|
11808
|
+
inline: true,
|
|
11809
|
+
flip: true,
|
|
11810
|
+
shift: "both"
|
|
11811
|
+
}, (x, y, position) => {
|
|
11812
|
+
setCustomState$1(this, "-top", position.includes("top"));
|
|
11813
|
+
setCustomState$1(this, "-bottom", position.includes("bottom"));
|
|
11814
|
+
if (M3eDirectionality.current === "rtl") {
|
|
11815
|
+
this.style.right = `${window.innerWidth - x - this.clientWidth}px`;
|
|
11816
|
+
this.style.left = "";
|
|
11817
|
+
} else {
|
|
11818
|
+
this.style.left = `${x}px`;
|
|
11819
|
+
this.style.right = "";
|
|
11820
|
+
}
|
|
11821
|
+
this.style.top = `${y}px`;
|
|
11822
|
+
}), "f");
|
|
11823
|
+
} else {
|
|
11824
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_anchorCleanup, "f")?.call(this);
|
|
11825
|
+
__classPrivateFieldSet(this, _M3eDatepickerElement_anchorCleanup, undefined, "f");
|
|
11826
|
+
this.style.left = "";
|
|
11827
|
+
this.style.right = "";
|
|
11828
|
+
this.style.top = "";
|
|
11829
|
+
}
|
|
11830
|
+
};
|
|
11831
|
+
_M3eDatepickerElement_clearSelectionState = function _M3eDatepickerElement_clearSelectionState() {
|
|
11832
|
+
this._date = this._rangeStart = this._rangeEnd = undefined;
|
|
11833
|
+
};
|
|
11834
|
+
/** The styles of the element. */
|
|
11835
|
+
M3eDatepickerElement.styles = css`:host { flex-direction: column; margin: unset; border: unset; padding-block: var(--m3e-datepicker-container-padding-block, 0.75rem); padding-inline: var(--m3e-datepicker-container-padding-inline, 0.25rem); background-color: var(--m3e-datepicker-container-color, ${DesignToken$1.color.surfaceContainer}); box-shadow: var(--m3e-datepicker-container-elevation, ${DesignToken$1.elevation.level3}); opacity: 0; display: none; } .calendar { --m3e-calendar-container-color: transparent; --m3e-calendar-container-elevation: ${DesignToken$1.elevation.level0}; --m3e-calendar-container-shape: ${DesignToken$1.shape.corner.none}; } .headline { font-size: var( --m3e-datepicker-modal-headline-font-size, ${DesignToken$1.typescale.standard.headline.large.fontSize} ); font-weight: var( --m3e-datepicker-modal-headline-font-weight, ${DesignToken$1.typescale.standard.headline.large.fontWeight} ); line-height: var( --m3e-datepicker-modal-headline-line-height, ${DesignToken$1.typescale.standard.headline.large.lineHeight} ); letter-spacing: var( --m3e-datepicker-modal-headline-tracking, ${DesignToken$1.typescale.standard.headline.large.tracking} ); margin-block-start: 2.25rem; margin-block-end: 0.75rem; margin-inline: 1.5rem; } .supporting-text { font-size: var( --m3e-datepicker-modal-supporting-text-font-size, ${DesignToken$1.typescale.standard.label.large.fontSize} ); font-weight: var( --m3e-datepicker-modal-supporting-text-font-weight, ${DesignToken$1.typescale.standard.label.large.fontWeight} ); line-height: var( --m3e-datepicker-modal-supporting-text-line-height, ${DesignToken$1.typescale.standard.label.large.lineHeight} ); letter-spacing: var( --m3e-datepicker-modal-supporting-text-tracking, ${DesignToken$1.typescale.standard.label.large.tracking} ); margin-block-start: 1rem; margin-inline: 1.5rem; } .divider { height: var(--m3e-divider-thickness, 1px); width: 100%; position: relative; } .divider::before { content: ""; box-sizing: border-box; position: absolute; border-bottom: var(--m3e-divider-thickness, 1px) solid var(--m3e-divider-color, ${DesignToken$1.color.outlineVariant}); height: inherit; left: -0.25rem; right: -0.25rem; } .actions { display: flex; align-items: center; column-gap: 0.5rem; padding-inline: var(--m3e-datepicker-actions-padding-inline, 0.5rem); } .spacer { flex: 1 1 auto; } :host(:state(-docked)) { position: absolute; background-color: var(--m3e-datepicker-docked-container-color, ${DesignToken$1.color.surfaceContainer}); border-radius: var(--m3e-datepicker-docked-container-shape, ${DesignToken$1.shape.corner.large}); } :host(:state(-modal)) { position: fixed; inset: 0; margin: auto; transform-origin: top; background-color: var(--m3e-datepicker-modal-container-color, ${DesignToken$1.color.surfaceContainerHigh}); border-radius: var(--m3e-datepicker-modal-container-shape, ${DesignToken$1.shape.corner.extraLarge}); } :host(:not(:state(-no-animate))) { transition: ${unsafeCSS(`opacity ${DesignToken$1.motion.duration.short2} ${DesignToken$1.motion.easing.standard},
|
|
11836
|
+
transform ${DesignToken$1.motion.duration.short2} ${DesignToken$1.motion.easing.standard},
|
|
11837
|
+
overlay ${DesignToken$1.motion.duration.short2} ${DesignToken$1.motion.easing.standard} allow-discrete,
|
|
11838
|
+
display ${DesignToken$1.motion.duration.short2} ${DesignToken$1.motion.easing.standard} allow-discrete`)}; } :host { transform: scaleY(0.8); } :host(:popover-open) { transform: scaleY(1); display: inline-flex; opacity: 1; } :host(:state(-docked))::backdrop { background-color: transparent; } :host(:state(-modal))::backdrop { background-color: color-mix(in srgb, var(--m3e-dialog-scrim-color, ${DesignToken$1.color.scrim}) 0%, transparent); margin-inline-end: -20px; } :host(:state(-modal):not(:popover-open))::backdrop { transition: ${unsafeCSS(`background-color ${DesignToken$1.motion.duration.short3} ${DesignToken$1.motion.easing.standard},
|
|
11839
|
+
overlay ${DesignToken$1.motion.duration.short3} ${DesignToken$1.motion.easing.standard} allow-discrete,
|
|
11840
|
+
visibility ${DesignToken$1.motion.duration.short3} ${DesignToken$1.motion.easing.standard} allow-discrete`)}; } :host(:state(-modal):popover-open)::backdrop { background-color: color-mix( in srgb, var(--m3e-dialog-scrim-color, ${DesignToken$1.color.scrim}) var(--m3e-dialog-scrim-opacity, 32%), transparent ); transition: ${unsafeCSS(`background-color ${DesignToken$1.motion.duration.long2} ${DesignToken$1.motion.easing.standard},
|
|
11841
|
+
overlay ${DesignToken$1.motion.duration.long2} ${DesignToken$1.motion.easing.standard} allow-discrete,
|
|
11842
|
+
visibility ${DesignToken$1.motion.duration.long2} ${DesignToken$1.motion.easing.standard} allow-discrete`)}; } :host(:state(-bottom)) { transform-origin: top; } :host(:state(-top)) { transform-origin: bottom; } @starting-style { :host(:popover-open) { transform: scaleY(0.8); } :host(:state(-modal):popover-open)::backdrop { background-color: color-mix(in srgb, var(--m3e-dialog-scrim-color, ${DesignToken$1.color.scrim}) 0%, transparent); } } @media (prefers-reduced-motion) { :host(:not(:state(-no-animate))) { transition: none; } } @media (forced-colors: active) { :host { background-color: Menu; color: MenuText; border: 1px solid CanvasText; } }`;
|
|
11843
|
+
__decorate([state()], M3eDatepickerElement.prototype, "_date", void 0);
|
|
11844
|
+
__decorate([state()], M3eDatepickerElement.prototype, "_rangeStart", void 0);
|
|
11845
|
+
__decorate([state()], M3eDatepickerElement.prototype, "_rangeEnd", void 0);
|
|
11846
|
+
__decorate([query("m3e-calendar")], M3eDatepickerElement.prototype, "_calendar", void 0);
|
|
11847
|
+
__decorate([state()], M3eDatepickerElement.prototype, "_variant", void 0);
|
|
11848
|
+
__decorate([property()], M3eDatepickerElement.prototype, "variant", void 0);
|
|
11849
|
+
__decorate([property({
|
|
11850
|
+
attribute: "start-view"
|
|
11851
|
+
})], M3eDatepickerElement.prototype, "startView", void 0);
|
|
11852
|
+
__decorate([property({
|
|
11853
|
+
converter: dateConverter$1
|
|
11854
|
+
})], M3eDatepickerElement.prototype, "date", void 0);
|
|
11855
|
+
__decorate([property({
|
|
11856
|
+
attribute: "start-at",
|
|
11857
|
+
converter: dateConverter$1
|
|
11858
|
+
})], M3eDatepickerElement.prototype, "startAt", void 0);
|
|
11859
|
+
__decorate([property({
|
|
11860
|
+
attribute: "min-date",
|
|
11861
|
+
converter: dateConverter$1
|
|
11862
|
+
})], M3eDatepickerElement.prototype, "minDate", void 0);
|
|
11863
|
+
__decorate([property({
|
|
11864
|
+
attribute: "max-date",
|
|
11865
|
+
converter: dateConverter$1
|
|
11866
|
+
})], M3eDatepickerElement.prototype, "maxDate", void 0);
|
|
11867
|
+
__decorate([property({
|
|
11868
|
+
attribute: "range-start",
|
|
11869
|
+
converter: dateConverter$1
|
|
11870
|
+
})], M3eDatepickerElement.prototype, "rangeStart", void 0);
|
|
11871
|
+
__decorate([property({
|
|
11872
|
+
attribute: "range-end",
|
|
11873
|
+
converter: dateConverter$1
|
|
11874
|
+
})], M3eDatepickerElement.prototype, "rangeEnd", void 0);
|
|
11875
|
+
__decorate([property({
|
|
11876
|
+
attribute: false
|
|
11877
|
+
})], M3eDatepickerElement.prototype, "blackoutDates", void 0);
|
|
11878
|
+
__decorate([property({
|
|
11879
|
+
attribute: false
|
|
11880
|
+
})], M3eDatepickerElement.prototype, "specialDates", void 0);
|
|
11881
|
+
__decorate([property({
|
|
11882
|
+
attribute: "previous-month-label"
|
|
11883
|
+
})], M3eDatepickerElement.prototype, "previousMonthLabel", void 0);
|
|
11884
|
+
__decorate([property({
|
|
11885
|
+
attribute: "previous-year-label"
|
|
11886
|
+
})], M3eDatepickerElement.prototype, "previousYearLabel", void 0);
|
|
11887
|
+
__decorate([property({
|
|
11888
|
+
attribute: "previous-multi-year-label"
|
|
11889
|
+
})], M3eDatepickerElement.prototype, "previousMultiYearLabel", void 0);
|
|
11890
|
+
__decorate([property({
|
|
11891
|
+
attribute: "next-month-label"
|
|
11892
|
+
})], M3eDatepickerElement.prototype, "nextMonthLabel", void 0);
|
|
11893
|
+
__decorate([property({
|
|
11894
|
+
attribute: "next-year-label"
|
|
11895
|
+
})], M3eDatepickerElement.prototype, "nextYearLabel", void 0);
|
|
11896
|
+
__decorate([property({
|
|
11897
|
+
attribute: "next-multi-year-label"
|
|
11898
|
+
})], M3eDatepickerElement.prototype, "nextMultiYearLabel", void 0);
|
|
10222
11899
|
__decorate([property({
|
|
10223
|
-
attribute: "case-sensitive",
|
|
10224
11900
|
type: Boolean
|
|
10225
|
-
})],
|
|
10226
|
-
__decorate([property(
|
|
10227
|
-
|
|
11901
|
+
})], M3eDatepickerElement.prototype, "clearable", void 0);
|
|
11902
|
+
__decorate([property({
|
|
11903
|
+
attribute: "clear-label"
|
|
11904
|
+
})], M3eDatepickerElement.prototype, "clearLabel", void 0);
|
|
11905
|
+
__decorate([property({
|
|
11906
|
+
attribute: "confirm-label"
|
|
11907
|
+
})], M3eDatepickerElement.prototype, "confirmLabel", void 0);
|
|
11908
|
+
__decorate([property({
|
|
11909
|
+
attribute: "dismiss-label"
|
|
11910
|
+
})], M3eDatepickerElement.prototype, "dismissLabel", void 0);
|
|
11911
|
+
__decorate([property()], M3eDatepickerElement.prototype, "label", void 0);
|
|
11912
|
+
M3eDatepickerElement = M3eDatepickerElement_1 = __decorate([customElement$1("m3e-datepicker")], M3eDatepickerElement);
|
|
10228
11913
|
|
|
10229
11914
|
/**
|
|
10230
|
-
* An
|
|
10231
|
-
*
|
|
10232
|
-
* @description
|
|
10233
|
-
* The `m3e-text-overflow` component truncates inline content with an ellipsis when it
|
|
10234
|
-
* exceeds the available width. It's intended for use inside flex or otherwise
|
|
10235
|
-
* constrained containers to preserve layout while providing predictable, single-line
|
|
10236
|
-
* truncation behavior for long text.
|
|
10237
|
-
*
|
|
10238
|
-
* @example
|
|
10239
|
-
* A typical usage inside a flex container where the heading and trailing actions are
|
|
10240
|
-
* constrained, allowing the center text to truncate with an ellipsis.
|
|
10241
|
-
*
|
|
10242
|
-
* ```html
|
|
10243
|
-
* <div style="display:flex;align-items:center;gap:12px;">
|
|
10244
|
-
* <m3e-icon name="menu"></m3e-icon>
|
|
10245
|
-
* <m3e-text-overflow>Very long title or breadcrumb that should truncate gracefully</m3e-text-overflow>
|
|
10246
|
-
* <m3e-icon name="more_vert"></m3e-icon>
|
|
10247
|
-
* </div>
|
|
10248
|
-
* ```
|
|
10249
|
-
*
|
|
10250
|
-
* @tag m3e-text-overflow
|
|
10251
|
-
*
|
|
10252
|
-
* @slot - Renders the content to truncate with an ellipsis.
|
|
11915
|
+
* An element, nested within a clickable element, used to toggle a datepicker.
|
|
11916
|
+
* @tag m3e-datepicker-toggle
|
|
10253
11917
|
*/
|
|
10254
|
-
let
|
|
11918
|
+
let M3eDatepickerToggleElement = class M3eDatepickerToggleElement extends HtmlFor$1(ActionElementBase$1) {
|
|
10255
11919
|
/** @inheritdoc */
|
|
10256
|
-
|
|
10257
|
-
|
|
11920
|
+
connectedCallback() {
|
|
11921
|
+
super.connectedCallback();
|
|
11922
|
+
if (this.parentElement) {
|
|
11923
|
+
this.parentElement.ariaHasPopup = "dialog";
|
|
11924
|
+
}
|
|
11925
|
+
}
|
|
11926
|
+
/** @inheritdoc */
|
|
11927
|
+
disconnectedCallback() {
|
|
11928
|
+
super.disconnectedCallback();
|
|
11929
|
+
if (this.parentElement) {
|
|
11930
|
+
this.parentElement.ariaHasPopup = null;
|
|
11931
|
+
}
|
|
11932
|
+
}
|
|
11933
|
+
/** @inheritdoc */
|
|
11934
|
+
_onClick() {
|
|
11935
|
+
if (this.control instanceof M3eDatepickerElement && this.parentElement) {
|
|
11936
|
+
this.control.toggle(this.parentElement, this.closest("m3e-form-field") ?? undefined);
|
|
11937
|
+
}
|
|
10258
11938
|
}
|
|
10259
11939
|
};
|
|
10260
|
-
|
|
10261
|
-
M3eTextOverflowElement.styles = css`:host { flex: 1 1 auto; display: inline-flex; align-items: center; flex-wrap: nowrap; min-width: 0; } .base { flex: 1 1 auto; display: inline; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }`;
|
|
10262
|
-
M3eTextOverflowElement = __decorate([customElement("m3e-text-overflow")], M3eTextOverflowElement);
|
|
11940
|
+
M3eDatepickerToggleElement = __decorate([customElement$1("m3e-datepicker-toggle")], M3eDatepickerToggleElement);
|
|
10263
11941
|
|
|
10264
11942
|
/**
|
|
10265
11943
|
* An element, nested within a clickable element, used to close a parenting dialog.
|
|
@@ -12796,7 +14474,7 @@ let M3eFabMenuElement = class M3eFabMenuElement extends SuppressInitialAnimation
|
|
|
12796
14474
|
__classPrivateFieldSet(this, _M3eFabMenuElement_anchoringCleanup, await positionAnchor(this, trigger, {
|
|
12797
14475
|
position: "top-end",
|
|
12798
14476
|
inline: true,
|
|
12799
|
-
shift:
|
|
14477
|
+
shift: "main",
|
|
12800
14478
|
flip: true,
|
|
12801
14479
|
offset: 8
|
|
12802
14480
|
}, (x, y, position) => {
|
|
@@ -13427,11 +15105,7 @@ _M3eFormFieldElement_handleErrorChange = function _M3eFormFieldElement_handleErr
|
|
|
13427
15105
|
}
|
|
13428
15106
|
};
|
|
13429
15107
|
(() => {
|
|
13430
|
-
|
|
13431
|
-
const lightDomStyle = new CSSStyleSheet();
|
|
13432
|
-
lightDomStyle.replaceSync(css`m3e-form-field input::placeholder, m3e-form-field textarea::placeholder { user-select: none; color: currentColor; transition: opacity ${DesignToken$1.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$1.density.calc(-2)}) / 4); } @media (prefers-reduced-motion) { m3e-form-field input::placeholder, m3e-form-field textarea::placeholder { transition: none !important; } }`.toString());
|
|
13433
|
-
document.adoptedStyleSheets = [...document.adoptedStyleSheets, lightDomStyle];
|
|
13434
|
-
}
|
|
15108
|
+
registerStyleSheet$1(css`m3e-form-field input::placeholder, m3e-form-field textarea::placeholder { user-select: none; color: currentColor; transition: opacity ${DesignToken$1.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$1.density.calc(-2)}) / 4); } @media (prefers-reduced-motion) { m3e-form-field input::placeholder, m3e-form-field textarea::placeholder { transition: none !important; } }`);
|
|
13435
15109
|
})();
|
|
13436
15110
|
/** The styles of the element. */
|
|
13437
15111
|
M3eFormFieldElement.styles = css`:host { display: inline-flex; flex-direction: column; vertical-align: middle; font-size: var(--m3e-form-field-font-size, ${DesignToken$1.typescale.standard.body.large.fontSize}); font-weight: var(--m3e-form-field-font-weight, ${DesignToken$1.typescale.standard.body.large.fontWeight}); line-height: var(--m3e-form-field-line-height, ${DesignToken$1.typescale.standard.body.large.lineHeight}); letter-spacing: var(--m3e-form-field-tracking, ${DesignToken$1.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$1.density.calc(-2)}); --_form-field-label-font-size: var( --m3e-form-field-label-font-size, ${DesignToken$1.typescale.standard.body.small.fontSize} ); --_form-field-label-line-height: var( --m3e-form-field-label-line-height, ${DesignToken$1.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$1.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$1.typescale.standard.body.small.fontSize}); font-weight: var(--m3e-form-field-label-font-weight, ${DesignToken$1.typescale.standard.body.small.fontWeight}); line-height: var(--m3e-form-field-label-line-height, ${DesignToken$1.typescale.standard.body.small.lineHeight}); letter-spacing: var(--m3e-form-field-label-tracking, ${DesignToken$1.typescale.standard.body.small.tracking}); color: var(--_form-field-label-color, inherit); transition: ${unsafeCSS(`top ${DesignToken$1.motion.duration.short4},
|
|
@@ -16551,7 +18225,7 @@ let M3eMenuElement = M3eMenuElement_1 = class M3eMenuElement extends SuppressIni
|
|
|
16551
18225
|
position: this.submenu ? positionX === "before" ? "left-start" : "right-start" : this.positionY === "above" ? positionX === "before" ? "top-end" : "top-start" : positionX === "before" ? "bottom-end" : "bottom-start",
|
|
16552
18226
|
inline: true,
|
|
16553
18227
|
flip: true,
|
|
16554
|
-
shift:
|
|
18228
|
+
shift: "main",
|
|
16555
18229
|
offset: !this.submenu ? 4 : undefined
|
|
16556
18230
|
}, (x, y, position) => {
|
|
16557
18231
|
if (!this.submenu) {
|
|
@@ -16727,11 +18401,7 @@ _M3eMenuElement_deactivate = function _M3eMenuElement_deactivate() {
|
|
|
16727
18401
|
}
|
|
16728
18402
|
};
|
|
16729
18403
|
(() => {
|
|
16730
|
-
|
|
16731
|
-
const lightDomStyle = new CSSStyleSheet();
|
|
16732
|
-
lightDomStyle.replaceSync(css`m3e-menu > m3e-divider { margin-block: var(--m3e-menu-divider-spacing, 0.5rem); }`.toString());
|
|
16733
|
-
document.adoptedStyleSheets = [...document.adoptedStyleSheets, lightDomStyle];
|
|
16734
|
-
}
|
|
18404
|
+
registerStyleSheet$1(css`m3e-menu > m3e-divider { margin-block: var(--m3e-menu-divider-spacing, 0.5rem); }`);
|
|
16735
18405
|
})();
|
|
16736
18406
|
/** The styles of the element. */
|
|
16737
18407
|
M3eMenuElement.styles = css`:host { position: absolute; padding: unset; margin: unset; border: unset; overflow-y: auto; overflow-x: visible; scrollbar-width: ${DesignToken$1.scrollbar.thinWidth}; scrollbar-color: ${DesignToken$1.scrollbar.color}; scroll-padding-block: calc( var(--m3e-focus-ring-thickness, 3px) + var(--m3e-menu-container-padding-block, 0.25rem) ); min-width: var(--m3e-menu-container-min-width, 7rem); max-width: var(--m3e-menu-container-max-width, 17.5rem); max-height: var(--m3e-menu-container-max-height, 17.5rem); box-shadow: var(--m3e-menu-container-elevation, ${DesignToken$1.elevation.level3}); opacity: 0; display: none; } .base { display: flex; flex-direction: column; row-gap: var(--m3e-menu-gap, 0.125rem); min-width: inherit; max-width: inherit; padding-block: var(--m3e-menu-container-padding-block, 0.25rem); padding-inline: var(--m3e-menu-container-padding-inline, 0.25rem); --m3e-focus-ring-outward-offset: 0px; --m3e-focus-ring-growth-factor: 1.5; } :host(:not(:state(-active))) { border-radius: var(--m3e-menu-container-shape, ${DesignToken$1.shape.corner.small}); } :host(:not(:state(-active))) .base { --m3e-menu-item-first-child-shape: ${DesignToken$1.shape.corner.extraSmall}; --m3e-menu-item-last-child-shape: ${DesignToken$1.shape.corner.extraSmall}; } :host(:state(-active)) { border-radius: var(--m3e-menu-active-container-shape, ${DesignToken$1.shape.corner.large}); } :host(:not(:state(-no-animate))) { transition: ${unsafeCSS(`opacity ${DesignToken$1.motion.duration.short2} ${DesignToken$1.motion.easing.standard},
|
|
@@ -17677,11 +19347,7 @@ _M3eNavMenuItemElement_handleCollapsibleEvent = function _M3eNavMenuItemElement_
|
|
|
17677
19347
|
}));
|
|
17678
19348
|
};
|
|
17679
19349
|
(() => {
|
|
17680
|
-
|
|
17681
|
-
const lightDomStyle = new CSSStyleSheet();
|
|
17682
|
-
lightDomStyle.replaceSync(css`m3e-nav-menu-item > m3e-divider { margin-block: var(--m3e-nav-menu-divider-margin, 0.25rem); flex: none; } m3e-nav-menu-item > m3e-nav-menu-item:first-of-type { margin-block-start: var(--m3e-nav-menu-item-vertical-inset, 0.25rem); } m3e-nav-menu-item > m3e-nav-menu-item:last-of-type { margin-block-end: var(--m3e-nav-menu-item-vertical-inset, 0.25rem); }`.toString());
|
|
17683
|
-
document.adoptedStyleSheets = [...document.adoptedStyleSheets, lightDomStyle];
|
|
17684
|
-
}
|
|
19350
|
+
registerStyleSheet$1(css`m3e-nav-menu-item > m3e-divider { margin-block: var(--m3e-nav-menu-divider-margin, 0.25rem); flex: none; } m3e-nav-menu-item > m3e-nav-menu-item:first-of-type { margin-block-start: var(--m3e-nav-menu-item-vertical-inset, 0.25rem); } m3e-nav-menu-item > m3e-nav-menu-item:last-of-type { margin-block-end: var(--m3e-nav-menu-item-vertical-inset, 0.25rem); }`);
|
|
17685
19351
|
})();
|
|
17686
19352
|
/** The styles of the element. */
|
|
17687
19353
|
M3eNavMenuItemElement.styles = css`:host { display: block; flex: none; outline: none; user-select: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } .base { display: flex; align-items: center; position: relative; padding-inline: var(--m3e-nav-menu-item-padding, 1.5rem); height: calc(var(--m3e-nav-menu-item-height, 3.5rem) + ${DesignToken$1.density.calc(-3)}); column-gap: var(--m3e-nav-menu-item-spacing, 0.75rem); font-size: var(--m3e-nav-menu-item-font-size, ${DesignToken$1.typescale.standard.label.large.fontSize}); font-weight: var(--m3e-nav-menu-item-font-weight, ${DesignToken$1.typescale.standard.label.large.fontWeight}); line-height: var(--m3e-nav-menu-item-line-height, ${DesignToken$1.typescale.standard.label.large.lineHeight}); letter-spacing: var(--m3e-nav-menu-item-tracking, ${DesignToken$1.typescale.standard.label.large.tracking}); transition: ${unsafeCSS(`color ${DesignToken$1.motion.duration.short4} ${DesignToken$1.motion.easing.standard},
|
|
@@ -18004,11 +19670,7 @@ _M3eNavMenuElement_updateItemFocusVisible = function _M3eNavMenuElement_updateIt
|
|
|
18004
19670
|
}
|
|
18005
19671
|
};
|
|
18006
19672
|
(() => {
|
|
18007
|
-
|
|
18008
|
-
const lightDomStyle = new CSSStyleSheet();
|
|
18009
|
-
lightDomStyle.replaceSync(css`m3e-nav-menu > m3e-divider { margin-block: var(--m3e-nav-menu-divider-margin, 0.25rem); flex: none; }`.toString());
|
|
18010
|
-
document.adoptedStyleSheets = [...document.adoptedStyleSheets, lightDomStyle];
|
|
18011
|
-
}
|
|
19673
|
+
registerStyleSheet$1(css`m3e-nav-menu > m3e-divider { margin-block: var(--m3e-nav-menu-divider-margin, 0.25rem); flex: none; }`);
|
|
18012
19674
|
})();
|
|
18013
19675
|
/** The styles of the element. */
|
|
18014
19676
|
M3eNavMenuElement.styles = css`:host { display: block; outline: none; overflow-y: auto; overflow-x: hidden; min-height: 0; scrollbar-width: ${DesignToken$1.scrollbar.width}; scrollbar-color: ${DesignToken$1.scrollbar.color}; } .base { width: 100%; display: flex; flex-direction: column; position: relative; min-height: inherit; box-sizing: border-box; padding-block-start: var(--m3e-nav-menu-padding-top, 0.5rem); padding-block-end: var(--m3e-nav-menu-padding-bottom, 0.5rem); padding-inline-start: var(--m3e-nav-menu-padding-left, 0.75rem); padding-inline-end: var(--m3e-nav-menu-padding-right, 0.75rem); }`;
|
|
@@ -18210,11 +19872,7 @@ _M3eNavRailElement_handleKeyDown = function _M3eNavRailElement_handleKeyDown(e)
|
|
|
18210
19872
|
__classPrivateFieldGet(this, _M3eNavRailElement_focusKeyManager, "f").onKeyDown(e);
|
|
18211
19873
|
};
|
|
18212
19874
|
(() => {
|
|
18213
|
-
|
|
18214
|
-
const lightDomStyle = new CSSStyleSheet();
|
|
18215
|
-
lightDomStyle.replaceSync(css`m3e-nav-rail > m3e-icon-button, m3e-nav-rail > m3e-fab { margin-block-end: var(--m3e-nav-rail-button-item-space, 1rem); } m3e-nav-rail:not(:state(-compact)) > m3e-icon-button { margin-inline-start: var(--m3e-nav-rail-expanded-icon-button-inset, 0.5rem); }`.toString());
|
|
18216
|
-
document.adoptedStyleSheets = [...document.adoptedStyleSheets, lightDomStyle];
|
|
18217
|
-
}
|
|
19875
|
+
registerStyleSheet$1(css`m3e-nav-rail > m3e-icon-button, m3e-nav-rail > m3e-fab { margin-block-end: var(--m3e-nav-rail-button-item-space, 1rem); } m3e-nav-rail:not(:state(-compact)) > m3e-icon-button { margin-inline-start: var(--m3e-nav-rail-expanded-icon-button-inset, 0.5rem); }`);
|
|
18218
19876
|
})();
|
|
18219
19877
|
/** The styles of the element. */
|
|
18220
19878
|
M3eNavRailElement.styles = css`:host { display: block; overflow-x: hidden; overflow-y: auto; scrollbar-width: ${DesignToken$1.scrollbar.thinWidth}; scrollbar-color: ${DesignToken$1.scrollbar.color}; } .base { display: flex; width: 100%; min-width: inherit; max-width: inherit; flex-direction: column; padding-block-start: var(--m3e-nav-rail-top-space, 2.75rem); padding-block-end: var(--m3e-nav-rail-bottom-space, 0.5rem); } :host(:state(-compact)) { width: var(--m3e-nav-rail-compact-width, 6rem); } :host(:state(-compact)) ::slotted(m3e-fab) { align-self: center; } :host(:not(:state(-compact))) { min-width: var(--m3e-nav-rail-expanded-min-width, 13.75rem); max-width: var(--m3e-nav-rail-expanded-max-width, 22.5rem); } :host(:not(:state(-compact))) .base { padding-inline: var(--m3e-nav-rail-expanded-inline-padding, 1.25rem); align-items: flex-start; --m3e-horizontal-nav-item-active-indicator-height: var(--m3e-nav-rail-expanded-item-height, 3.5rem); --_nav-item-align-self: stretch; --_nav-item-justify-content: flex-start; } ::slotted(*) { flex: none; } :host(:state(-compact)) ::slotted(m3e-icon-button) { align-self: center; } ::slotted(m3e-fab) { --m3e-fab-container-elevation: ${DesignToken$1.elevation.level0}; --m3e-fab-disabled-container-elevation: ${DesignToken$1.elevation.level0}; --m3e-fab-focus-container-elevation: ${DesignToken$1.elevation.level0}; --m3e-fab-pressed-container-elevation: ${DesignToken$1.elevation.level0}; --m3e-fab-hover-container-elevation: ${DesignToken$1.elevation.level1}; --m3e-fab-lowered-container-elevation: ${DesignToken$1.elevation.level0}; --m3e-fab-lowered-disabled-container-elevation: ${DesignToken$1.elevation.level0}; --m3e-fab-lowered-focus-container-elevation: ${DesignToken$1.elevation.level0}; --m3e-fab-lowered-pressed-container-elevation: ${DesignToken$1.elevation.level0}; --m3e-fab-lowered-hover-container-elevation: ${DesignToken$1.elevation.level1}; }`;
|
|
@@ -18435,7 +20093,7 @@ _M3eOptionElement_handleSlotChange = function _M3eOptionElement_handleSlotChange
|
|
|
18435
20093
|
__classPrivateFieldSet(this, _M3eOptionElement_textContent, getTextContent$1(e.target), "f");
|
|
18436
20094
|
setCustomState$1(this, "-empty", this.isEmpty);
|
|
18437
20095
|
if (this.selected) {
|
|
18438
|
-
this.closest("m3e-select")?.requestUpdate();
|
|
20096
|
+
this.closest("m3e-select")?.requestUpdate?.();
|
|
18439
20097
|
}
|
|
18440
20098
|
};
|
|
18441
20099
|
/** The styles of the element. */
|
|
@@ -18610,11 +20268,7 @@ _M3eOptionPanelElement_handleMutation = function _M3eOptionPanelElement_handleMu
|
|
|
18610
20268
|
}
|
|
18611
20269
|
};
|
|
18612
20270
|
(() => {
|
|
18613
|
-
|
|
18614
|
-
const lightDomStyle = new CSSStyleSheet();
|
|
18615
|
-
lightDomStyle.replaceSync(css`m3e-option-panel > m3e-divider { margin-block: var(--m3e-option-panel-divider-spacing, 0.5rem); } m3e-option-panel m3e-option[hidden], m3e-option-panel m3e-optgroup[hidden] { display: none; }`.toString());
|
|
18616
|
-
document.adoptedStyleSheets = [...document.adoptedStyleSheets, lightDomStyle];
|
|
18617
|
-
}
|
|
20271
|
+
registerStyleSheet$1(css`m3e-option-panel > m3e-divider { margin-block: var(--m3e-option-panel-divider-spacing, 0.5rem); } m3e-option-panel m3e-option[hidden], m3e-option-panel m3e-optgroup[hidden] { display: none; }`);
|
|
18618
20272
|
})();
|
|
18619
20273
|
/** The styles of the element. */
|
|
18620
20274
|
M3eOptionPanelElement.styles = [M3eFloatingPanelElement.styles, css`:host { --m3e-floating-panel-container-shape: var( --m3e-option-panel-container-shape, ${DesignToken$1.shape.corner.large} ); --m3e-floating-panel-container-min-width: var(--m3e-option-panel-container-min-width, 7rem); --m3e-floating-panel-container-max-width: var(--m3e-option-panel-container-max-width, 17.5rem); --m3e-floating-panel-container-max-height: var(--m3e-option-panel-container-max-height, 17.5rem); --m3e-floating-panel-container-color: var( --m3e-option-panel-container-color, ${DesignToken$1.color.surfaceContainer} ); --m3e-floating-panel-container-elevation: var( --m3e-option-panel-container-elevation, ${DesignToken$1.elevation.level3} ); --m3e-floating-panel-container-padding-inline: var(--m3e-option-panel-container-padding-inline, 0.25rem); --m3e-floating-panel-container-padding-block: var(--m3e-option-panel-container-padding-block, 0.25rem); } .base { row-gap: var(--m3e-option-panel-gap, 0.125rem); --m3e-text-highlight-container-color: var( --m3e-option-panel-text-highlight-container-color, ${DesignToken$1.color.tertiaryContainer} ); --m3e-text-highlight-color: var( --m3e-option-panel-text-highlight-color, ${DesignToken$1.color.onTertiaryContainer} ); --m3e-focus-ring-outward-offset: 0px; --m3e-focus-ring-growth-factor: 1.5; } .no-data { display: flex; align-items: center; box-sizing: border-box; min-height: var(--m3e-option-panel-no-data-container-height, 2.75rem); padding: var(--m3e-option-panel-no-data-container-padding, 0.75rem); color: var(--m3e-option-panel-no-data-color, ${DesignToken$1.color.onSurfaceVariant}); font-size: var(--m3e-option-panel-no-data-font-size, ${DesignToken$1.typescale.standard.label.large.fontSize}); font-weight: var( --m3e-option-panel-no-data-font-weight, ${DesignToken$1.typescale.standard.label.large.fontWeight} ); line-height: var( --m3e-option-panel-no-data-line-height, ${DesignToken$1.typescale.standard.label.large.lineHeight} ); letter-spacing: var( --m3e-option-panel-no-data-tracking, ${DesignToken$1.typescale.standard.label.large.tracking} ); } .loading { display: flex; align-items: center; box-sizing: border-box; min-height: var(--m3e-option-panel-loading-container-height, 2.75rem); padding: var(--m3e-option-panel-loading-container-padding, 0.75rem); color: var(--m3e-option-panel-loading-color, ${DesignToken$1.color.onSurfaceVariant}); font-size: var(--m3e-option-panel-loading-font-size, ${DesignToken$1.typescale.standard.label.large.fontSize}); font-weight: var( --m3e-option-panel-loading-font-weight, ${DesignToken$1.typescale.standard.label.large.fontWeight} ); line-height: var( --m3e-option-panel-loading-line-height, ${DesignToken$1.typescale.standard.label.large.lineHeight} ); letter-spacing: var( --m3e-option-panel-loading-tracking, ${DesignToken$1.typescale.standard.label.large.tracking} ); } :host(:state(-no-data)) slot:not([name]), :host(:state(-loading)) slot:not([name]), :host(:state(-loading)) .no-data, :host(:not(:state(-no-data))) .no-data, :host(:not(:state(-with-no-data))) .no-data, :host(:not(:state(-loading))) .loading, :host(:not(:state(-with-loading))) .loading { display: none; } :host(:state(-no-data)) .base, :host(:state(-loading)) .base { overflow-y: hidden; } :host(:state(-with-loading-indicator)) .loading { padding: 0; justify-content: center; }`];
|
|
@@ -19772,103 +21426,890 @@ let M3eRadioGroupElement = class M3eRadioGroupElement extends Labelled$1(Require
|
|
|
19772
21426
|
this[selectionManager].activeItem?.click();
|
|
19773
21427
|
});
|
|
19774
21428
|
}
|
|
19775
|
-
/** The list of attributes corresponding to the registered properties. */
|
|
19776
|
-
static get observedAttributes() {
|
|
19777
|
-
return [...super.observedAttributes, "aria-invalid"];
|
|
19778
|
-
}
|
|
19779
|
-
/** The radios in the group. */
|
|
19780
|
-
get radios() {
|
|
19781
|
-
return this[selectionManager]?.items ?? [];
|
|
19782
|
-
}
|
|
19783
|
-
/** The selected radio. */
|
|
19784
|
-
get selected() {
|
|
19785
|
-
return this[selectionManager]?.selectedItems[0] ?? null;
|
|
21429
|
+
/** The list of attributes corresponding to the registered properties. */
|
|
21430
|
+
static get observedAttributes() {
|
|
21431
|
+
return [...super.observedAttributes, "aria-invalid"];
|
|
21432
|
+
}
|
|
21433
|
+
/** The radios in the group. */
|
|
21434
|
+
get radios() {
|
|
21435
|
+
return this[selectionManager]?.items ?? [];
|
|
21436
|
+
}
|
|
21437
|
+
/** The selected radio. */
|
|
21438
|
+
get selected() {
|
|
21439
|
+
return this[selectionManager]?.selectedItems[0] ?? null;
|
|
21440
|
+
}
|
|
21441
|
+
/** The selected value of the radio group. */
|
|
21442
|
+
get value() {
|
|
21443
|
+
return this.selected?.value ?? null;
|
|
21444
|
+
}
|
|
21445
|
+
/** @inheritdoc */
|
|
21446
|
+
markAsTouched() {
|
|
21447
|
+
super.markAsTouched();
|
|
21448
|
+
this.radios.forEach(x => x.markAsTouched());
|
|
21449
|
+
}
|
|
21450
|
+
/** @inheritdoc */
|
|
21451
|
+
markAsUntouched() {
|
|
21452
|
+
super.markAsUntouched();
|
|
21453
|
+
this.radios.forEach(x => x.markAsUntouched());
|
|
21454
|
+
}
|
|
21455
|
+
/** @inheritdoc */
|
|
21456
|
+
markAsDirty() {
|
|
21457
|
+
super.markAsDirty();
|
|
21458
|
+
this.radios.forEach(x => x.markAsDirty());
|
|
21459
|
+
}
|
|
21460
|
+
/** @inheritdoc */
|
|
21461
|
+
markAsPristine() {
|
|
21462
|
+
super.markAsPristine();
|
|
21463
|
+
this.radios.forEach(x => x.markAsPristine());
|
|
21464
|
+
}
|
|
21465
|
+
/** Synchronizes property values when attributes change. */
|
|
21466
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
21467
|
+
super.attributeChangedCallback(name, oldValue, newValue);
|
|
21468
|
+
switch (name) {
|
|
21469
|
+
case "name":
|
|
21470
|
+
this.radios.forEach(x => x.name = this.name);
|
|
21471
|
+
break;
|
|
21472
|
+
case "aria-invalid":
|
|
21473
|
+
this.radios.forEach(x => {
|
|
21474
|
+
setCustomState$1(x, "-invalid", newValue === "true");
|
|
21475
|
+
x[updateLabels$1]?.();
|
|
21476
|
+
});
|
|
21477
|
+
break;
|
|
21478
|
+
}
|
|
21479
|
+
}
|
|
21480
|
+
/** @inheritdoc */
|
|
21481
|
+
connectedCallback() {
|
|
21482
|
+
super.connectedCallback();
|
|
21483
|
+
this.addEventListener("focusout", __classPrivateFieldGet(this, _M3eRadioGroupElement_focusOutHandler, "f"));
|
|
21484
|
+
__classPrivateFieldSet(this, _M3eRadioGroupElement_directionalitySubscription, M3eDirectionality.observe(() => this[selectionManager].directionality = M3eDirectionality.current), "f");
|
|
21485
|
+
}
|
|
21486
|
+
/** @inheritdoc */
|
|
21487
|
+
disconnectedCallback() {
|
|
21488
|
+
super.disconnectedCallback();
|
|
21489
|
+
this.removeEventListener("focusout", __classPrivateFieldGet(this, _M3eRadioGroupElement_focusOutHandler, "f"));
|
|
21490
|
+
__classPrivateFieldGet(this, _M3eRadioGroupElement_directionalitySubscription, "f")?.call(this);
|
|
21491
|
+
}
|
|
21492
|
+
/** @inheritdoc */
|
|
21493
|
+
update(changedProperties) {
|
|
21494
|
+
super.update(changedProperties);
|
|
21495
|
+
if (changedProperties.has("disabled")) {
|
|
21496
|
+
this.ariaDisabled = null;
|
|
21497
|
+
}
|
|
21498
|
+
if (changedProperties.has("disabled") && (changedProperties.get("disabled") !== undefined || this.disabled)) {
|
|
21499
|
+
this[selectionManager].disabled = this.disabled;
|
|
21500
|
+
}
|
|
21501
|
+
}
|
|
21502
|
+
/** @inheritdoc */
|
|
21503
|
+
render() {
|
|
21504
|
+
return html`<slot @slotchange="${__classPrivateFieldGet(this, _M3eRadioGroupElement_instances, "m", _M3eRadioGroupElement_handleSlotChange)}" @keydown="${__classPrivateFieldGet(this, _M3eRadioGroupElement_instances, "m", _M3eRadioGroupElement_handleKeyDown)}" @change="${__classPrivateFieldGet(this, _M3eRadioGroupElement_instances, "m", _M3eRadioGroupElement_handleChange)}"></slot>`;
|
|
21505
|
+
}
|
|
21506
|
+
};
|
|
21507
|
+
_M3eRadioGroupElement_directionalitySubscription = new WeakMap();
|
|
21508
|
+
_M3eRadioGroupElement_focusOutHandler = new WeakMap();
|
|
21509
|
+
_M3eRadioGroupElement_instances = new WeakSet();
|
|
21510
|
+
_a$5 = selectionManager;
|
|
21511
|
+
_M3eRadioGroupElement_handleSlotChange = function _M3eRadioGroupElement_handleSlotChange() {
|
|
21512
|
+
const {
|
|
21513
|
+
added
|
|
21514
|
+
} = this[selectionManager].setItems([...this.querySelectorAll("m3e-radio")]);
|
|
21515
|
+
added.forEach(x => x.name = x.name || this.name);
|
|
21516
|
+
};
|
|
21517
|
+
_M3eRadioGroupElement_handleKeyDown = function _M3eRadioGroupElement_handleKeyDown(e) {
|
|
21518
|
+
this[selectionManager].onKeyDown(e);
|
|
21519
|
+
};
|
|
21520
|
+
_M3eRadioGroupElement_handleChange = function _M3eRadioGroupElement_handleChange() {
|
|
21521
|
+
this.checkValidity();
|
|
21522
|
+
};
|
|
21523
|
+
/** The styles of the element. */
|
|
21524
|
+
M3eRadioGroupElement.styles = css`:host { display: inline-flex; }`;
|
|
21525
|
+
M3eRadioGroupElement = __decorate([customElement$1("m3e-radio-group")], M3eRadioGroupElement);
|
|
21526
|
+
|
|
21527
|
+
/** @internal */
|
|
21528
|
+
const SearchBarToken = {
|
|
21529
|
+
containerColor: unsafeCSS(`var(--m3e-search-bar-container-color, ${DesignToken$1.color.surfaceContainerHigh})`),
|
|
21530
|
+
leadingIconColor: unsafeCSS(`var(--m3e-search-bar-leading-icon-color, ${DesignToken$1.color.onSurface})`),
|
|
21531
|
+
trailingIconColor: unsafeCSS(`var(--m3e-search-bar-trailing-icon-color, ${DesignToken$1.color.onSurfaceVariant})`),
|
|
21532
|
+
containerHeight: unsafeCSS("var(--m3e-search-bar-container-height, 3.5rem)"),
|
|
21533
|
+
containerShape: unsafeCSS(`var(--m3e-search-bar-container-shape, ${DesignToken$1.shape.corner.full})`),
|
|
21534
|
+
iconSize: unsafeCSS("var(--m3e-search-bar-icon-size, 1.5rem)"),
|
|
21535
|
+
supportingTextColor: unsafeCSS(`var(--m3e-search-bar-supporting-text-color, ${DesignToken$1.color.onSurfaceVariant})`),
|
|
21536
|
+
supportingTextFontSize: unsafeCSS(`var(--m3e-search-bar-supporting-text-font-size, ${DesignToken$1.typescale.standard.body.large.fontSize})`),
|
|
21537
|
+
supportingTextFontWeight: unsafeCSS(`var(--m3e-search-bar-supporting-text-font-weight, ${DesignToken$1.typescale.standard.body.large.fontWeight})`),
|
|
21538
|
+
supportingTextLineHeight: unsafeCSS(`var(--m3e-search-bar-supporting-text-line-height, ${DesignToken$1.typescale.standard.body.large.lineHeight})`),
|
|
21539
|
+
supportingTextTracking: unsafeCSS(`var(--m3e-search-bar-supporting-text-tracking, ${DesignToken$1.typescale.standard.body.large.tracking})`),
|
|
21540
|
+
inputColor: unsafeCSS(`var(--m3e-search-bar-input-color, ${DesignToken$1.color.onSurface})`),
|
|
21541
|
+
inputTextFontSize: unsafeCSS(`var(--m3e-search-bar-input-text-font-size, ${DesignToken$1.typescale.standard.body.large.fontSize})`),
|
|
21542
|
+
inputTextFontWeight: unsafeCSS(`var(--m3e-search-bar-input-text-font-weight, ${DesignToken$1.typescale.standard.body.large.fontWeight})`),
|
|
21543
|
+
inputTextLineHeight: unsafeCSS(`var(--m3e-search-bar-input-text-line-height, ${DesignToken$1.typescale.standard.body.large.lineHeight})`),
|
|
21544
|
+
inputTextTracking: unsafeCSS(`var(--m3e-search-bar-input-text-tracking, ${DesignToken$1.typescale.standard.body.large.tracking})`),
|
|
21545
|
+
leadingSpace: unsafeCSS("var(--m3e-search-bar-leading-space, 0.25rem)"),
|
|
21546
|
+
trailingSpace: unsafeCSS("var(--m3e-search-bar-trailing-space, 0.25rem)"),
|
|
21547
|
+
noActionsLeadingSpace: unsafeCSS("var(--m3e-search-bar-no-actions-leading-space, 1rem)"),
|
|
21548
|
+
noActionsTrailingSpace: unsafeCSS("var(--m3e-search-bar-no-actions-trailing-space, 1rem)"),
|
|
21549
|
+
leadingActionsTrailingSpace: unsafeCSS("var(--m3e-search-bar-leading-actions-trailing-space, 0.25rem)"),
|
|
21550
|
+
trailingActionsLeadingSpace: unsafeCSS("var(--m3e-search-bar-trailing-actions-leading-space, 0.25rem)"),
|
|
21551
|
+
actionsGap: unsafeCSS("var(--m3e-search-bar-actions-gap, 0px)")
|
|
21552
|
+
};
|
|
21553
|
+
|
|
21554
|
+
/**
|
|
21555
|
+
* Light DOM styles for `M3eSearchBarElement`.
|
|
21556
|
+
* @internal
|
|
21557
|
+
*/
|
|
21558
|
+
const SearchBarLightDomStyle = css`m3e-search-bar input[slot="input"]::placeholder { user-select: none; color: ${SearchBarToken.supportingTextColor}; font-size: ${SearchBarToken.supportingTextFontSize}; font-weight: ${SearchBarToken.supportingTextFontWeight}; line-height: ${SearchBarToken.supportingTextLineHeight}; letter-spacing: ${SearchBarToken.supportingTextTracking}; }`;
|
|
21559
|
+
/**
|
|
21560
|
+
* Styles for `M3eSearchBarElement`.
|
|
21561
|
+
* @internal
|
|
21562
|
+
*/
|
|
21563
|
+
const SearchBarStyle = css`:host { display: block; height: ${SearchBarToken.containerHeight}; } .base { cursor: text; display: flex; align-items: center; box-sizing: border-box; width: 100%; height: 100%; border-radius: ${SearchBarToken.containerShape}; background-color: ${SearchBarToken.containerColor}; } .clear { display: flex; align-items: center; justify-content: center; box-sizing: border-box; min-width: 3rem; } :host(:not(:state(-clearable))) .clear { display: none; } :host(:state(-with-leading)) slot[name="leading"], :host(:state(-with-trailing)) slot[name="trailing"] { display: flex; align-items: center; justify-content: center; box-sizing: border-box; min-width: 3rem; padding-inline: 0.25rem; column-gap: calc(0.5rem + ${SearchBarToken.actionsGap}); } ::slotted([slot="input"]) { flex: 1 1 auto; outline: unset; border: unset; background-color: transparent; box-shadow: none; min-width: 0; padding: unset; color: ${SearchBarToken.inputColor}; font-size: ${SearchBarToken.inputTextFontSize}; font-weight: ${SearchBarToken.inputTextFontWeight}; line-height: ${SearchBarToken.inputTextLineHeight}; letter-spacing: ${SearchBarToken.inputTextTracking}; } :host(:state(-with-leading)) .base { padding-inline-start: ${SearchBarToken.leadingSpace}; } :host(:not(:state(-with-leading))) .base { padding-inline-start: ${SearchBarToken.noActionsLeadingSpace}; } :host(:is(:state(-with-trailing), :state(-clearable))) .base { padding-inline-end: ${SearchBarToken.trailingSpace}; } :host(:not(:is(:state(-with-trailing), :state(-clearable)))) .base { padding-inline-end: ${SearchBarToken.noActionsTrailingSpace}; } :host(:state(-with-leading)) ::slotted([slot="input"]) { margin-inline-start: ${SearchBarToken.leadingActionsTrailingSpace}; } :host(:is(:state(-with-trailing), :state(-clearable))) ::slotted([slot="input"]) { margin-inline-end: ${SearchBarToken.trailingActionsLeadingSpace}; } slot[name="leading"] { color: ${SearchBarToken.leadingIconColor}; --m3e-icon-color: ${SearchBarToken.leadingIconColor}; --m3e-icon-button-icon-color: ${SearchBarToken.leadingIconColor}; --m3e-icon-size: ${SearchBarToken.iconSize}; } slot[name="trailing"], .clear { color: ${SearchBarToken.trailingIconColor}; --m3e-icon-color: ${SearchBarToken.trailingIconColor}; --m3e-icon-button-icon-color: ${SearchBarToken.trailingIconColor}; --m3e-icon-size: ${SearchBarToken.iconSize}; } ::slotted(svg[slot="leading"]), ::slotted(svg[slot="trailing"]) { width: 1em; font-size: ${SearchBarToken.iconSize}; } ::slotted([slot="clear-icon"]), .clear-icon { width: 1em; font-size: ${SearchBarToken.iconSize} !important; } slot[name="clear-icon"] { --m3e-icon-size: ${SearchBarToken.iconSize}; } @media (forced-colors: active) { .base { border: 1px var(--_search-bar-forced-color-outline-style, solid) CanvasText; } }`;
|
|
21564
|
+
|
|
21565
|
+
/** @internal */
|
|
21566
|
+
const SearchViewToken = {
|
|
21567
|
+
containerColor: unsafeCSS(`var(--m3e-search-view-container-color, ${DesignToken$1.color.surfaceContainerHigh})`),
|
|
21568
|
+
containedContainerColor: unsafeCSS(`var(--m3e-search-view-contained-container-color, ${DesignToken$1.color.surfaceContainerLow})`),
|
|
21569
|
+
dividerColor: unsafeCSS(`var(--m3e-search-view-divider-color, ${DesignToken$1.color.outline})`),
|
|
21570
|
+
dividerThickness: unsafeCSS(`var(--m3e-search-view-divider-thickness, 1px)`),
|
|
21571
|
+
fullScreenContainerShape: unsafeCSS(`var(--m3e-search-view-full-screen-container-shape, ${DesignToken$1.shape.corner.none})`),
|
|
21572
|
+
fullScreenHeaderContainerHeight: unsafeCSS("var(--m3e-search-view-full-screen-header-container-height, 4.5rem)"),
|
|
21573
|
+
dockedContainerShape: unsafeCSS(`var(--m3e-search-view-docked-container-shape, ${DesignToken$1.shape.corner.extraLarge})`),
|
|
21574
|
+
dockedHeaderContainerHeight: unsafeCSS("var(--m3e-search-view-docked-header-container-height, 3.5rem)"),
|
|
21575
|
+
containedLeadingMargin: unsafeCSS("var(--m3e-search-view-contained-leading-margin, 1.5rem)"),
|
|
21576
|
+
containedTrailingMargin: unsafeCSS("var(--m3e-search-view-contained-trailing-margin, 1.55rem)"),
|
|
21577
|
+
containedFocusedLeadingMargin: unsafeCSS("var(--m3e-search-view-contained-focused-leading-margin, 0.75rem)"),
|
|
21578
|
+
containedFocusedTrailingMargin: unsafeCSS("var(--m3e-search-view-contained-focused-trailing-margin, 0.75rem)"),
|
|
21579
|
+
containedDockedBarResultsGap: unsafeCSS("var(--m3e-search-view-contained-docked-bar-results-gap, 2px)"),
|
|
21580
|
+
containedDockedResultsShape: unsafeCSS(`var(--m3e-search-view-contained-docked-results-shape, ${DesignToken$1.shape.corner.medium})`),
|
|
21581
|
+
containedDockedBarShape: unsafeCSS(`var(--m3e-search-view-contained-docked-bar-shape, ${DesignToken$1.shape.corner.full})`),
|
|
21582
|
+
containedFullScreenBarContainerHeight: unsafeCSS("var(--m3e-search-view-contained-full-screen-bar-container-height, 3.5rem)"),
|
|
21583
|
+
dockedContainerMinHeight: unsafeCSS("var(--m3e-search-view-docked-container-min-height, 240px)"),
|
|
21584
|
+
dockedContainerMaxHeight: unsafeCSS("var(--m3e-search-view-docked-container-max-height, calc(100vh * 0.6667))"),
|
|
21585
|
+
containedDockedResultsSpace: unsafeCSS("var(--m3e-search-view-contained-docked-results-space, 0.25rem)"),
|
|
21586
|
+
dockedResultsBottomSpace: unsafeCSS("var(--m3e-search-view-docked-results-bottom-space, 1rem)"),
|
|
21587
|
+
dockedScrimColor: unsafeCSS(`var(--m3e-search-view-docked-scrim-color, ${DesignToken$1.color.scrim})`),
|
|
21588
|
+
dockedScrimOpacity: unsafeCSS("var(--m3e-search-view-docked-scrim-opacity, 32%)")
|
|
21589
|
+
};
|
|
21590
|
+
|
|
21591
|
+
/**
|
|
21592
|
+
* Light DOM styles for `M3eSearchViewElement`.
|
|
21593
|
+
* @internal
|
|
21594
|
+
*/
|
|
21595
|
+
const SearchViewLightDomStyle = css`m3e-search-view input[slot="input"]::placeholder { user-select: none; color: ${SearchBarToken.supportingTextColor}; font-size: ${SearchBarToken.supportingTextFontSize}; font-weight: ${SearchBarToken.supportingTextFontWeight}; line-height: ${SearchBarToken.supportingTextLineHeight}; letter-spacing: ${SearchBarToken.supportingTextTracking}; }`;
|
|
21596
|
+
/**
|
|
21597
|
+
* Styles for `M3eSearchViewElement`.
|
|
21598
|
+
* @internal
|
|
21599
|
+
*/
|
|
21600
|
+
const SearchViewStyle = css`:host { display: block; } .base { position: relative; width: 100%; } .anchor { position: absolute; width: 100%; visibility: hidden; } .view { display: flex; flex-direction: column; box-sizing: border-box; width: 100%; outline: none; padding: unset; margin: unset; border: unset; } .header { flex: none; display: flex; align-items: center; } .bar { flex: 1 1 auto; } :host(:state(-fullscreen)) .bar { transition: ${unsafeCSS(`margin ${DesignToken$1.motion.duration.short2} ${DesignToken$1.motion.easing.standard}`)}; } :host(:state(-fullscreen)[contained]:not([open])) .bar { margin-inline-start: ${SearchViewToken.containedLeadingMargin}; margin-inline-end: ${SearchViewToken.containedTrailingMargin}; } :host(:state(-fullscreen)[contained][open]) .bar, :host(:state(-fullscreen)[contained][open]) .results { margin-inline-start: ${SearchViewToken.containedFocusedLeadingMargin}; margin-inline-end: ${SearchViewToken.containedFocusedTrailingMargin}; } .icon { display: flex; align-items: center; justify-content: center; box-sizing: border-box; min-width: 3rem; } ::slotted([slot="search-icon"]), .search-icon, ::slotted([slot="close-icon"]), .close-icon { width: 1em; font-size: ${SearchBarToken.iconSize} !important; } .results { overflow: hidden; flex: 1 1 auto; display: flex; flex-direction: column; } .scroll-container { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; scrollbar-color: ${DesignToken$1.scrollbar.color}; } .view:not(:popover-open) .results, .view.closing .results { display: none; } :host(:not(:is(:state(-clearable), [open]))) .clear { display: none; } ::slotted([slot="clear-icon"]), .clear-icon { width: 1em; font-size: ${SearchBarToken.iconSize} !important; } slot[name="clear-icon"] { --m3e-icon-size: ${SearchBarToken.iconSize}; } :host(:state(-fullscreen)) .header { transition: height 150ms cubic-bezier(0.2, 0, 0, 1); } :host(:state(-fullscreen)) .view:popover-open:not(.closing) .header { height: ${SearchViewToken.fullScreenHeaderContainerHeight}; } :host(:state(-fullscreen):not([open])) .header, :host(:state(-fullscreen)[open]) .view.closing .header { height: ${SearchViewToken.containedFullScreenBarContainerHeight}; } :host(:state(-fullscreen)[open]) .bar { --m3e-search-bar-container-height: ${SearchViewToken.containedFullScreenBarContainerHeight}; } :host(:state(-fullscreen)) .anchor { height: ${SearchViewToken.containedFullScreenBarContainerHeight}; } :host(:state(-fullscreen)) .view:popover-open { border-radius: ${SearchViewToken.fullScreenContainerShape}; } :host(:state(-fullscreen)[contained]) .view:popover-open { background-color: ${SearchViewToken.containedContainerColor}; } :host(:state(-fullscreen):not([contained])) .view:popover-open { background-color: ${SearchViewToken.containerColor}; } :host(:state(-docked)[open]) .header, :host(:state(-docked)) .anchor { height: ${SearchViewToken.dockedHeaderContainerHeight}; } :host(:not([contained])[open]) .results { border-top-width: ${SearchViewToken.dividerThickness}; border-top-style: solid; border-top-color: ${SearchViewToken.dividerColor}; } :host(:state(-docked)[contained]) .results { margin-top: ${SearchViewToken.containedDockedBarResultsGap}; } :host(:state(-docked):not([contained])[open]) .view { background-color: ${SearchViewToken.containerColor}; --m3e-search-bar-container-color: ${SearchViewToken.containerColor}; } :host(:state(-docked)[contained]) .results { background-color: ${SearchViewToken.containerColor}; } :host(:state(-docked):not([contained])[open]) .view, :host(:state(-docked)[contained]) .results { border-radius: ${SearchViewToken.dockedContainerShape}; } :host(:state(-docked)) .results { min-height: calc(${SearchViewToken.dockedContainerMinHeight} - ${SearchViewToken.dockedHeaderContainerHeight}); max-height: calc(${SearchViewToken.dockedContainerMaxHeight} - ${SearchViewToken.dockedHeaderContainerHeight}); } :host(:state(-docked)) .scroll-container { scrollbar-width: ${DesignToken$1.scrollbar.thinWidth}; } :host(:state(-docked):not([contained])) .scroll-container { padding-bottom: ${SearchViewToken.dockedResultsBottomSpace}; } :host(:state(-docked)[contained]) .scroll-container { padding: ${SearchViewToken.containedDockedResultsSpace}; } :host(:state(-docked)) .results { transform-origin: top; transition: ${unsafeCSS(`transform ${DesignToken$1.motion.duration.short2} ${DesignToken$1.motion.easing.standard},
|
|
21601
|
+
overlay ${DesignToken$1.motion.duration.short2} ${DesignToken$1.motion.easing.standard} allow-discrete,
|
|
21602
|
+
display ${DesignToken$1.motion.duration.short2} ${DesignToken$1.motion.easing.standard} allow-discrete`)}; } :host(:state(-docked):not([open])) .results { transform: scaleY(0.8); } :host(:state(-docked)[open]) .results { transform: scaleY(1); } @starting-style { :host(:state(-docked)[open]) .results { transform: scaleY(0.8); } } :host(:state(-docked)[contained]) .view { background-color: transparent; } :host(:state(-docked):not([open])) .view { transition: ${unsafeCSS(`border-radius ${DesignToken$1.motion.duration.long2} ${DesignToken$1.motion.easing.standard},
|
|
21603
|
+
background-color ${DesignToken$1.motion.duration.long2} ${DesignToken$1.motion.easing.standard}`)}; } :host(:state(-docked):not([open])) .view::backdrop { transition: ${unsafeCSS(`background-color ${DesignToken$1.motion.duration.short3} ${DesignToken$1.motion.easing.standard},
|
|
21604
|
+
overlay ${DesignToken$1.motion.duration.short3} ${DesignToken$1.motion.easing.standard} allow-discrete,
|
|
21605
|
+
visibility ${DesignToken$1.motion.duration.short3} ${DesignToken$1.motion.easing.standard} allow-discrete`)}; } :host(:state(-docked)) .view::backdrop { background-color: color-mix(in srgb, ${SearchViewToken.dockedScrimColor} 0%, transparent); margin-inline-end: -20px; } :host(:state(-docked)[open]) .view::backdrop { background-color: color-mix( in srgb, ${SearchViewToken.dockedScrimColor} ${SearchViewToken.dockedScrimOpacity}, transparent ); transition: ${unsafeCSS(`background-color ${DesignToken$1.motion.duration.long2} ${DesignToken$1.motion.easing.standard},
|
|
21606
|
+
overlay ${DesignToken$1.motion.duration.long2} ${DesignToken$1.motion.easing.standard} allow-discrete,
|
|
21607
|
+
visibility ${DesignToken$1.motion.duration.long2} ${DesignToken$1.motion.easing.standard} allow-discrete`)}; } @starting-style { :host(:state(-docked)[open]) .view::backdrop { background-color: color-mix(in srgb, ${SearchViewToken.dockedScrimColor} 0%, transparent); } } :host(:state(-fullscreen)) .view:popover-open { width: 100vw; width: 100dvw; height: 100vh; height: 100dvh; overflow: hidden; } @media (prefers-reduced-motion) { :host(:state(-fullscreen)) .bar, :host(:state(-fullscreen)) .header, :host(:state(-docked)) .results, :host(:state(-docked):not([open])) .view, :host(:state(-docked):not([open])) .view::backdrop, :host(:state(-docked)[open]) .view::backdrop { transition: none; } } @media (forced-colors: active) { :host(:not([contained])[open]) .bar { --_search-bar-forced-color-outline-style: none; } :host(:state(-docked):not([contained])[open]) .view, :host(:state(-docked)[contained]) .results { border: 1px solid CanvasText; } :host(:not([contained])[open]) .results { border-top-color: CanvasText; } }`;
|
|
21608
|
+
|
|
21609
|
+
var _M3eSearchBarElement_instances, _M3eSearchBarElement_input, _M3eSearchBarElement_inputInputHandler, _M3eSearchBarElement_renderClearButton, _M3eSearchBarElement_handleContainerClick, _M3eSearchBarElement_handleLeadingSlotChange, _M3eSearchBarElement_handleTrailingSlotChange, _M3eSearchBarElement_handleInputSlotChange, _M3eSearchBarElement_handleInputInput, _M3eSearchBarElement_handleClearClick;
|
|
21610
|
+
/**
|
|
21611
|
+
* A bar that provides a prominent entry point for search.
|
|
21612
|
+
*
|
|
21613
|
+
* @description
|
|
21614
|
+
* The `m3e-search-bar` component provides a prominent entry point for search,
|
|
21615
|
+
* capturing user input and emitting `query` and `clear` events as the text
|
|
21616
|
+
* changes. It reflects focus and interaction states through customizable CSS
|
|
21617
|
+
* properties for container, icons, and text styling.
|
|
21618
|
+
*
|
|
21619
|
+
* @example
|
|
21620
|
+
* The following example illustrates typical usage with a leading icon and the
|
|
21621
|
+
* ability to clear the current search text.
|
|
21622
|
+
* ```html
|
|
21623
|
+
* <m3e-search-bar clearable>
|
|
21624
|
+
* <m3e-icon name="search" slot="leading"></m3e-icon>
|
|
21625
|
+
* <input slot="input" placeholder="Search..." />
|
|
21626
|
+
* </m3e-search-bar>
|
|
21627
|
+
* ```
|
|
21628
|
+
*
|
|
21629
|
+
* @tag m3e-search-bar
|
|
21630
|
+
*
|
|
21631
|
+
* @attr clearable - Whether the bar presents a button used to clear the search term.
|
|
21632
|
+
* @attr clear-label - The accessible label given to the button used to clear the search term.
|
|
21633
|
+
*
|
|
21634
|
+
* @slot leading - Renders content before the input of the bar.
|
|
21635
|
+
* @slot input - Renders the input of the bar.
|
|
21636
|
+
* @slot trailing - Renders content after the input of the bar.
|
|
21637
|
+
*
|
|
21638
|
+
* @fires clear - Dispatched when the search term is cleared.
|
|
21639
|
+
*
|
|
21640
|
+
* @cssprop --m3e-search-bar-container-color - Background color of the search bar container.
|
|
21641
|
+
* @cssprop --m3e-search-bar-leading-icon-color - Color of the leading icon.
|
|
21642
|
+
* @cssprop --m3e-search-bar-trailing-icon-color - Color of the trailing icon.
|
|
21643
|
+
* @cssprop --m3e-search-bar-container-height - Height of the search bar container.
|
|
21644
|
+
* @cssprop --m3e-search-bar-container-shape - Shape (border radius) of the search bar container.
|
|
21645
|
+
* @cssprop --m3e-search-bar-icon-size - Size of icons inside the search bar.
|
|
21646
|
+
* @cssprop --m3e-search-bar-supporting-text-color - Color of the supporting text.
|
|
21647
|
+
* @cssprop --m3e-search-bar-supporting-text-font-size - Font size of the supporting text.
|
|
21648
|
+
* @cssprop --m3e-search-bar-supporting-text-font-weight - Font weight of the supporting text.
|
|
21649
|
+
* @cssprop --m3e-search-bar-supporting-text-line-height - Line height of the supporting text.
|
|
21650
|
+
* @cssprop --m3e-search-bar-supporting-text-tracking - Letter spacing of the supporting text.
|
|
21651
|
+
* @cssprop --m3e-search-bar-input-color - Color of the input text.
|
|
21652
|
+
* @cssprop --m3e-search-bar-input-text-font-size - Font size of the input text.
|
|
21653
|
+
* @cssprop --m3e-search-bar-input-text-font-weight - Font weight of the input text.
|
|
21654
|
+
* @cssprop --m3e-search-bar-input-text-line-height - Line height of the input text.
|
|
21655
|
+
* @cssprop --m3e-search-bar-input-text-tracking - Letter spacing of the input text.
|
|
21656
|
+
* @cssprop --m3e-search-bar-leading-space - Space before the leading icon.
|
|
21657
|
+
* @cssprop --m3e-search-bar-trailing-space - Space after the trailing icon.
|
|
21658
|
+
* @cssprop --m3e-search-bar-no-actions-leading-space - Leading padding when no actions are present.
|
|
21659
|
+
* @cssprop --m3e-search-bar-no-actions-trailing-space - Trailing padding when no actions are present.
|
|
21660
|
+
* @cssprop --m3e-search-bar-leading-actions-trailing-space - Space between leading actions and the input.
|
|
21661
|
+
* @cssprop --m3e-search-bar-trailing-actions-leading-space - Space between the input and trailing actions.
|
|
21662
|
+
* @cssprop --m3e-search-bar-actions-gap - Gap between action icons.
|
|
21663
|
+
*/
|
|
21664
|
+
let M3eSearchBarElement = class M3eSearchBarElement extends EventAttribute$1(AttachInternals$1(LitElement), "clear") {
|
|
21665
|
+
constructor() {
|
|
21666
|
+
super(...arguments);
|
|
21667
|
+
_M3eSearchBarElement_instances.add(this);
|
|
21668
|
+
/** @private */
|
|
21669
|
+
_M3eSearchBarElement_input.set(this, void 0);
|
|
21670
|
+
/** @private */
|
|
21671
|
+
_M3eSearchBarElement_inputInputHandler.set(this, () => __classPrivateFieldGet(this, _M3eSearchBarElement_instances, "m", _M3eSearchBarElement_handleInputInput).call(this));
|
|
21672
|
+
/**
|
|
21673
|
+
* Whether the bar presents a button used to clear the search term.
|
|
21674
|
+
* @default false
|
|
21675
|
+
*/
|
|
21676
|
+
this.clearable = false;
|
|
21677
|
+
/**
|
|
21678
|
+
* The accessible label given to the button used to clear the search term.
|
|
21679
|
+
* @default "Clear"
|
|
21680
|
+
*/
|
|
21681
|
+
this.clearLabel = "Clear";
|
|
21682
|
+
}
|
|
21683
|
+
/** Clears the search term. */
|
|
21684
|
+
clear() {
|
|
21685
|
+
if (!__classPrivateFieldGet(this, _M3eSearchBarElement_input, "f")) return;
|
|
21686
|
+
__classPrivateFieldGet(this, _M3eSearchBarElement_input, "f").value = "";
|
|
21687
|
+
__classPrivateFieldGet(this, _M3eSearchBarElement_instances, "m", _M3eSearchBarElement_handleInputInput).call(this);
|
|
21688
|
+
this.dispatchEvent(new Event("clear", {
|
|
21689
|
+
bubbles: true,
|
|
21690
|
+
composed: true
|
|
21691
|
+
}));
|
|
21692
|
+
}
|
|
21693
|
+
/** @inheritdoc */
|
|
21694
|
+
render() {
|
|
21695
|
+
return html`<div class="base" @click="${__classPrivateFieldGet(this, _M3eSearchBarElement_instances, "m", _M3eSearchBarElement_handleContainerClick)}"><slot name="leading" @slotchange="${__classPrivateFieldGet(this, _M3eSearchBarElement_instances, "m", _M3eSearchBarElement_handleLeadingSlotChange)}"></slot><slot name="input" @slotchange="${__classPrivateFieldGet(this, _M3eSearchBarElement_instances, "m", _M3eSearchBarElement_handleInputSlotChange)}"></slot>${__classPrivateFieldGet(this, _M3eSearchBarElement_instances, "m", _M3eSearchBarElement_renderClearButton).call(this)}<slot name="trailing" @slotchange="${__classPrivateFieldGet(this, _M3eSearchBarElement_instances, "m", _M3eSearchBarElement_handleTrailingSlotChange)}"></slot></div>`;
|
|
21696
|
+
}
|
|
21697
|
+
};
|
|
21698
|
+
_M3eSearchBarElement_input = new WeakMap();
|
|
21699
|
+
_M3eSearchBarElement_inputInputHandler = new WeakMap();
|
|
21700
|
+
_M3eSearchBarElement_instances = new WeakSet();
|
|
21701
|
+
_M3eSearchBarElement_renderClearButton = function _M3eSearchBarElement_renderClearButton() {
|
|
21702
|
+
return this.clearable ? html`<div class="clear"><m3e-icon-button aria-label="${this.clearLabel}" @click="${__classPrivateFieldGet(this, _M3eSearchBarElement_instances, "m", _M3eSearchBarElement_handleClearClick)}"><slot name="clear-icon"><svg class="clear-icon" viewBox="0 -960 960 960" fill="currentColor"><path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"/></svg></slot></m3e-icon-button></div>` : nothing;
|
|
21703
|
+
};
|
|
21704
|
+
_M3eSearchBarElement_handleContainerClick = function _M3eSearchBarElement_handleContainerClick() {
|
|
21705
|
+
if (!this.matches(":focus-within")) {
|
|
21706
|
+
__classPrivateFieldGet(this, _M3eSearchBarElement_input, "f")?.focus();
|
|
21707
|
+
}
|
|
21708
|
+
};
|
|
21709
|
+
_M3eSearchBarElement_handleLeadingSlotChange = function _M3eSearchBarElement_handleLeadingSlotChange(e) {
|
|
21710
|
+
setCustomState$1(this, "-with-leading", hasAssignedNodes$1(e.target));
|
|
21711
|
+
};
|
|
21712
|
+
_M3eSearchBarElement_handleTrailingSlotChange = function _M3eSearchBarElement_handleTrailingSlotChange(e) {
|
|
21713
|
+
setCustomState$1(this, "-with-trailing", hasAssignedNodes$1(e.target));
|
|
21714
|
+
};
|
|
21715
|
+
_M3eSearchBarElement_handleInputSlotChange = function _M3eSearchBarElement_handleInputSlotChange(e) {
|
|
21716
|
+
const input = e.target.assignedElements({
|
|
21717
|
+
flatten: true
|
|
21718
|
+
}).find(x => x instanceof HTMLInputElement);
|
|
21719
|
+
if (input != __classPrivateFieldGet(this, _M3eSearchBarElement_input, "f")) {
|
|
21720
|
+
__classPrivateFieldGet(this, _M3eSearchBarElement_input, "f")?.removeEventListener("input", __classPrivateFieldGet(this, _M3eSearchBarElement_inputInputHandler, "f"));
|
|
21721
|
+
__classPrivateFieldSet(this, _M3eSearchBarElement_input, input, "f");
|
|
21722
|
+
__classPrivateFieldGet(this, _M3eSearchBarElement_input, "f")?.addEventListener("input", __classPrivateFieldGet(this, _M3eSearchBarElement_inputInputHandler, "f"));
|
|
21723
|
+
if (__classPrivateFieldGet(this, _M3eSearchBarElement_input, "f")) {
|
|
21724
|
+
__classPrivateFieldGet(this, _M3eSearchBarElement_input, "f").role = __classPrivateFieldGet(this, _M3eSearchBarElement_input, "f").role || "searchbox";
|
|
21725
|
+
__classPrivateFieldGet(this, _M3eSearchBarElement_input, "f").inputMode = __classPrivateFieldGet(this, _M3eSearchBarElement_input, "f").inputMode || "search";
|
|
21726
|
+
__classPrivateFieldGet(this, _M3eSearchBarElement_input, "f").type = "text";
|
|
21727
|
+
}
|
|
21728
|
+
__classPrivateFieldGet(this, _M3eSearchBarElement_instances, "m", _M3eSearchBarElement_handleInputInput).call(this);
|
|
21729
|
+
}
|
|
21730
|
+
};
|
|
21731
|
+
_M3eSearchBarElement_handleInputInput = function _M3eSearchBarElement_handleInputInput() {
|
|
21732
|
+
setCustomState$1(this, "-clearable", this.clearable && (__classPrivateFieldGet(this, _M3eSearchBarElement_input, "f")?.value ?? "").length > 0);
|
|
21733
|
+
};
|
|
21734
|
+
_M3eSearchBarElement_handleClearClick = function _M3eSearchBarElement_handleClearClick() {
|
|
21735
|
+
this.clear();
|
|
21736
|
+
__classPrivateFieldGet(this, _M3eSearchBarElement_input, "f")?.focus();
|
|
21737
|
+
};
|
|
21738
|
+
(() => {
|
|
21739
|
+
registerStyleSheet$1(SearchBarLightDomStyle);
|
|
21740
|
+
})();
|
|
21741
|
+
/** The styles of the element. */
|
|
21742
|
+
M3eSearchBarElement.styles = SearchBarStyle;
|
|
21743
|
+
__decorate([property({
|
|
21744
|
+
type: Boolean,
|
|
21745
|
+
reflect: true
|
|
21746
|
+
})], M3eSearchBarElement.prototype, "clearable", void 0);
|
|
21747
|
+
__decorate([property({
|
|
21748
|
+
attribute: "clear-label"
|
|
21749
|
+
})], M3eSearchBarElement.prototype, "clearLabel", void 0);
|
|
21750
|
+
M3eSearchBarElement = __decorate([customElement$1("m3e-search-bar")], M3eSearchBarElement);
|
|
21751
|
+
|
|
21752
|
+
var _M3eSearchViewElement_instances, _M3eSearchViewElement_input, _M3eSearchViewElement_closeOnInputFocus, _M3eSearchViewElement_inputInputHandler, _M3eSearchViewElement_inputFocusHandler, _M3eSearchViewElement_inputKeyDownHandler, _M3eSearchViewElement_inputPointerHandler, _M3eSearchViewElement_scrollLockController, _M3eSearchViewElement_inertController, _M3eSearchViewElement_openMode, _M3eSearchViewElement_anchorCleanup, _M3eSearchViewElement_breakpointUnobserve, _M3eSearchViewElement_renderIconOrBackButton, _M3eSearchViewElement_renderIcon, _M3eSearchViewElement_renderBackButton, _M3eSearchViewElement_renderClearButton, _M3eSearchViewElement_handleInputSlotChange, _M3eSearchViewElement_handleInputInput, _M3eSearchViewElement_updateMode, _M3eSearchViewElement_updateClearableState, _M3eSearchViewElement_handleInputFocus, _M3eSearchViewElement_handleCloseClick, _M3eSearchViewElement_handleClearClick, _M3eSearchViewElement_handleInputPointerDown, _M3eSearchViewElement_handleInputKeyDown, _M3eSearchViewElement_handleKeyDown, _M3eSearchViewElement_openDocked, _M3eSearchViewElement_closeDocked, _M3eSearchViewElement_hideDocked, _M3eSearchViewElement_openFullscreen, _M3eSearchViewElement_closeFullscreen;
|
|
21753
|
+
/**
|
|
21754
|
+
* A surface that presents suggestions and results for a search.
|
|
21755
|
+
*
|
|
21756
|
+
* @description
|
|
21757
|
+
* The `m3e-search-view` component presents the surface for suggestions,
|
|
21758
|
+
* history, and results, managing the open and close lifecycle around an
|
|
21759
|
+
* embedded search bar. It emits `query`, `clear`, and `toggle`, events to
|
|
21760
|
+
* support application driven search logic, and exposes CSS properties for
|
|
21761
|
+
* container, shape, spacing, and layout across contained, docked, and full
|
|
21762
|
+
* screen configurations.
|
|
21763
|
+
*
|
|
21764
|
+
* @example
|
|
21765
|
+
* The following example shows a contained view in docked mode with a simple set of search results.
|
|
21766
|
+
* ```html
|
|
21767
|
+
* <m3e-search-view mode="docked" contained>
|
|
21768
|
+
* <input slot="input" placeholder="Search..." />
|
|
21769
|
+
* <m3e-list>
|
|
21770
|
+
* <m3e-list-item>Result One</m3e-list-item>
|
|
21771
|
+
* <m3e-list-item>Result Two</m3e-list-item>
|
|
21772
|
+
* <m3e-list-item>Result Three</m3e-list-item>
|
|
21773
|
+
* </m3e-list>
|
|
21774
|
+
* </m3e-search-view>
|
|
21775
|
+
* ```
|
|
21776
|
+
*
|
|
21777
|
+
* @tag m3e-search-view
|
|
21778
|
+
*
|
|
21779
|
+
* @attr contained - Whether the view features a persistent, filled search container.
|
|
21780
|
+
* @attr mode - The behavior mode of the view.
|
|
21781
|
+
* @attr open - Whether the view is expanded to show results.
|
|
21782
|
+
* @attr clear-label - The accessible label given to the button used to clear the search term.
|
|
21783
|
+
* @attr close-label - The accessible label given to the button used to collapse the view.
|
|
21784
|
+
* @attr hide-search-icon - Whether to hide the search icon.
|
|
21785
|
+
*
|
|
21786
|
+
* @slot - When open, renders the results content of the view.
|
|
21787
|
+
* @slot input - Renders the input of the view.
|
|
21788
|
+
* @slot open-leading - When open, renders content before the input of the view.
|
|
21789
|
+
* @slot open-trailing - When open, renders content after the input of the view.
|
|
21790
|
+
* @slot closed-leading - When closed, renders content before the input of the view.
|
|
21791
|
+
* @slot closed-trailing - When closed, renders content after the input of the view.
|
|
21792
|
+
*
|
|
21793
|
+
* @fires clear - Dispatched when the search term is cleared.
|
|
21794
|
+
* @fires query - Dispatched when the view is opened or when the user modifies the search term.
|
|
21795
|
+
* @fires beforetoggle - Dispatched before the toggle state changes.
|
|
21796
|
+
* @fires toggle - Dispatched after the toggle state has changed.
|
|
21797
|
+
*
|
|
21798
|
+
* @cssprop --m3e-search-view-container-color - Background color of the view container.
|
|
21799
|
+
* @cssprop --m3e-search-view-contained-container-color - Background color of the contained view container.
|
|
21800
|
+
* @cssprop --m3e-search-view-divider-color - Color of the divider separating header and results.
|
|
21801
|
+
* @cssprop --m3e-search-view-divider-thickness - Thickness of the divider separating header and results.
|
|
21802
|
+
* @cssprop --m3e-search-view-full-screen-container-shape - Shape of the fullscreen view container.
|
|
21803
|
+
* @cssprop --m3e-search-view-full-screen-header-container-height - Height of the header container in fullscreen mode.
|
|
21804
|
+
* @cssprop --m3e-search-view-docked-container-shape - Shape of the docked view container.
|
|
21805
|
+
* @cssprop --m3e-search-view-docked-header-container-height - Height of the header container in docked mode.
|
|
21806
|
+
* @cssprop --m3e-search-view-contained-leading-margin - Leading margin for the contained view.
|
|
21807
|
+
* @cssprop --m3e-search-view-contained-trailing-margin - Trailing margin for the contained view.
|
|
21808
|
+
* @cssprop --m3e-search-view-contained-focused-leading-margin - Leading margin when the contained view is focused.
|
|
21809
|
+
* @cssprop --m3e-search-view-contained-focused-trailing-margin - Trailing margin when the contained view is focused.
|
|
21810
|
+
* @cssprop --m3e-search-view-contained-docked-bar-results-gap - Gap between the contained docked bar and results.
|
|
21811
|
+
* @cssprop --m3e-search-view-contained-docked-results-shape - Shape of the results container in contained docked mode.
|
|
21812
|
+
* @cssprop --m3e-search-view-contained-docked-bar-shape - Shape of the bar in contained docked mode.
|
|
21813
|
+
* @cssprop --m3e-search-view-contained-full-screen-bar-container-height - Height of the bar container in contained fullscreen mode.
|
|
21814
|
+
* @cssprop --m3e-search-view-docked-container-min-height - Minimum height of the docked view container.
|
|
21815
|
+
* @cssprop --m3e-search-view-docked-container-max-height - Maximum height of the docked view container.
|
|
21816
|
+
* @cssprop --m3e-search-view-contained-docked-results-space - Space above the results in contained docked mode.
|
|
21817
|
+
* @cssprop --m3e-search-view-docked-results-bottom-space - Space below the results in docked mode.
|
|
21818
|
+
* @cssprop --m3e-search-view-docked-scrim-color - Color of the scrim behind the docked view.
|
|
21819
|
+
* @cssprop --m3e-search-view-docked-scrim-opacity - Opacity of the scrim behind the docked view.
|
|
21820
|
+
*/
|
|
21821
|
+
let M3eSearchViewElement = class M3eSearchViewElement extends EventAttribute$1(AttachInternals$1(LitElement), "clear", "query") {
|
|
21822
|
+
constructor() {
|
|
21823
|
+
super();
|
|
21824
|
+
_M3eSearchViewElement_instances.add(this);
|
|
21825
|
+
/** @private */
|
|
21826
|
+
_M3eSearchViewElement_input.set(this, void 0);
|
|
21827
|
+
/** @private */
|
|
21828
|
+
_M3eSearchViewElement_closeOnInputFocus.set(this, false);
|
|
21829
|
+
/** @private */
|
|
21830
|
+
_M3eSearchViewElement_inputInputHandler.set(this, () => __classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_handleInputInput).call(this));
|
|
21831
|
+
/** @private */
|
|
21832
|
+
_M3eSearchViewElement_inputFocusHandler.set(this, () => __classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_handleInputFocus).call(this));
|
|
21833
|
+
/** @private */
|
|
21834
|
+
_M3eSearchViewElement_inputKeyDownHandler.set(this, e => __classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_handleInputKeyDown).call(this, e));
|
|
21835
|
+
/** @private */
|
|
21836
|
+
_M3eSearchViewElement_inputPointerHandler.set(this, () => __classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_handleInputPointerDown).call(this));
|
|
21837
|
+
/** @private */
|
|
21838
|
+
_M3eSearchViewElement_scrollLockController.set(this, new ScrollLockController$1(this));
|
|
21839
|
+
/** @private */
|
|
21840
|
+
_M3eSearchViewElement_inertController.set(this, new InertController$1(this));
|
|
21841
|
+
/** @private */
|
|
21842
|
+
this._clearable = false;
|
|
21843
|
+
/** @private */
|
|
21844
|
+
_M3eSearchViewElement_openMode.set(this, void 0);
|
|
21845
|
+
/** @private */
|
|
21846
|
+
_M3eSearchViewElement_anchorCleanup.set(this, void 0);
|
|
21847
|
+
/** @private */
|
|
21848
|
+
_M3eSearchViewElement_breakpointUnobserve.set(this, void 0);
|
|
21849
|
+
/**
|
|
21850
|
+
* Whether the view features a persistent, filled search container.
|
|
21851
|
+
* @default false
|
|
21852
|
+
*/
|
|
21853
|
+
this.contained = false;
|
|
21854
|
+
/**
|
|
21855
|
+
* The behavior mode of the view.
|
|
21856
|
+
* @default "docked"
|
|
21857
|
+
*/
|
|
21858
|
+
this.mode = "docked";
|
|
21859
|
+
/**
|
|
21860
|
+
* Whether the view is expanded to show results.
|
|
21861
|
+
* @default false
|
|
21862
|
+
*/
|
|
21863
|
+
this.open = false;
|
|
21864
|
+
/**
|
|
21865
|
+
* The accessible label given to the button used to clear the search term.
|
|
21866
|
+
* @default "Clear"
|
|
21867
|
+
*/
|
|
21868
|
+
this.clearLabel = "Clear";
|
|
21869
|
+
/**
|
|
21870
|
+
* The accessible label given to the button used to collapse the view.
|
|
21871
|
+
* @default "Close"
|
|
21872
|
+
*/
|
|
21873
|
+
this.closeLabel = "Close";
|
|
21874
|
+
/**
|
|
21875
|
+
* Whether to hide the search icon.
|
|
21876
|
+
* @default false;
|
|
21877
|
+
*/
|
|
21878
|
+
this.hideSearchIcon = false;
|
|
21879
|
+
new FocusController$1(this, {
|
|
21880
|
+
callback: focused => this._handleFocusChange(focused)
|
|
21881
|
+
});
|
|
21882
|
+
}
|
|
21883
|
+
/** The current mode applied to the view. */
|
|
21884
|
+
get currentMode() {
|
|
21885
|
+
return this._mode ?? (this.mode !== "fullscreen" ? "docked" : "fullscreen");
|
|
19786
21886
|
}
|
|
19787
|
-
|
|
19788
|
-
|
|
19789
|
-
return this.selected?.value ?? null;
|
|
21887
|
+
set currentMode(value) {
|
|
21888
|
+
this._mode = value;
|
|
19790
21889
|
}
|
|
19791
|
-
/**
|
|
19792
|
-
|
|
19793
|
-
|
|
19794
|
-
this.
|
|
21890
|
+
/** Clears the search term. */
|
|
21891
|
+
clear() {
|
|
21892
|
+
if (!__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")) return;
|
|
21893
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f").value = "";
|
|
21894
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_updateClearableState).call(this);
|
|
21895
|
+
this.dispatchEvent(new CustomEvent("query", {
|
|
21896
|
+
detail: {
|
|
21897
|
+
term: ""
|
|
21898
|
+
},
|
|
21899
|
+
bubbles: true,
|
|
21900
|
+
composed: true
|
|
21901
|
+
}));
|
|
21902
|
+
this.dispatchEvent(new Event("clear", {
|
|
21903
|
+
bubbles: true,
|
|
21904
|
+
composed: true
|
|
21905
|
+
}));
|
|
19795
21906
|
}
|
|
19796
21907
|
/** @inheritdoc */
|
|
19797
|
-
|
|
19798
|
-
super.
|
|
19799
|
-
|
|
21908
|
+
willUpdate(changedProperties) {
|
|
21909
|
+
super.willUpdate(changedProperties);
|
|
21910
|
+
if (changedProperties.has("mode")) {
|
|
21911
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_breakpointUnobserve, "f")?.call(this);
|
|
21912
|
+
const previousMode = changedProperties.get("mode");
|
|
21913
|
+
if (previousMode && previousMode !== this.mode && this.open) {
|
|
21914
|
+
this.open = false;
|
|
21915
|
+
}
|
|
21916
|
+
if (this.mode === "auto") {
|
|
21917
|
+
__classPrivateFieldSet(this, _M3eSearchViewElement_breakpointUnobserve, M3eBreakpointObserver.observe([Breakpoint.XSmall], matches => {
|
|
21918
|
+
const currentMode = this.currentMode;
|
|
21919
|
+
this._mode = matches.get(Breakpoint.XSmall) ? "fullscreen" : "docked";
|
|
21920
|
+
if (currentMode !== this._mode && this.open) {
|
|
21921
|
+
this.open = false;
|
|
21922
|
+
}
|
|
21923
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_updateMode).call(this);
|
|
21924
|
+
}), "f");
|
|
21925
|
+
} else {
|
|
21926
|
+
this._mode = undefined;
|
|
21927
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_updateMode).call(this);
|
|
21928
|
+
}
|
|
21929
|
+
}
|
|
21930
|
+
if (changedProperties.has("_mode")) {
|
|
21931
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_updateMode).call(this);
|
|
21932
|
+
}
|
|
19800
21933
|
}
|
|
19801
21934
|
/** @inheritdoc */
|
|
19802
|
-
|
|
19803
|
-
super.
|
|
19804
|
-
|
|
21935
|
+
updated(_changedProperties) {
|
|
21936
|
+
super.updated(_changedProperties);
|
|
21937
|
+
if (_changedProperties.has("open")) {
|
|
21938
|
+
if (!this.open) {
|
|
21939
|
+
if ((__classPrivateFieldGet(this, _M3eSearchViewElement_openMode, "f") ?? this.currentMode) === "fullscreen") {
|
|
21940
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_closeFullscreen).call(this);
|
|
21941
|
+
} else {
|
|
21942
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_closeDocked).call(this);
|
|
21943
|
+
}
|
|
21944
|
+
} else {
|
|
21945
|
+
if (this.currentMode === "fullscreen") {
|
|
21946
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_openFullscreen).call(this);
|
|
21947
|
+
} else {
|
|
21948
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_openDocked).call(this);
|
|
21949
|
+
}
|
|
21950
|
+
}
|
|
21951
|
+
}
|
|
19805
21952
|
}
|
|
19806
21953
|
/** @inheritdoc */
|
|
19807
|
-
|
|
19808
|
-
|
|
19809
|
-
this.radios.forEach(x => x.markAsPristine());
|
|
21954
|
+
render() {
|
|
21955
|
+
return html`<div class="base"><div class="anchor"></div><div role="${ifDefined(this.open ? "dialog" : undefined)}" aria-modal="${ifDefined(this.open ? "true" : undefined)}" aria-labelledby="${ifDefined(this.open ? "header" : undefined)}" class="view" tabindex="-1" @keydown="${__classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_handleKeyDown)}"><m3e-focus-trap ?disabled="${!this.open}"><div class="header" id="header"><m3e-search-bar class="bar">${__classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_renderIconOrBackButton).call(this)} ${this.open ? html`<slot name="open-leading" slot="leading"></slot>` : html`<slot name="closed-leading" slot="leading"></slot>`}<slot name="input" slot="input" @slotchange="${__classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_handleInputSlotChange)}"></slot>${__classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_renderClearButton).call(this)} ${this.open ? html`<slot name="open-trailing" slot="trailing"></slot>` : html`<slot name="closed-trailing" slot="trailing"></slot>`}</m3e-search-bar></div><div class="results"><div class="scroll-container"><slot></slot></div></div></m3e-focus-trap></div></div>`;
|
|
19810
21956
|
}
|
|
19811
|
-
/**
|
|
19812
|
-
|
|
19813
|
-
|
|
19814
|
-
|
|
19815
|
-
|
|
19816
|
-
this.radios.forEach(x => x.name = this.name);
|
|
19817
|
-
break;
|
|
19818
|
-
case "aria-invalid":
|
|
19819
|
-
this.radios.forEach(x => {
|
|
19820
|
-
setCustomState$1(x, "-invalid", newValue === "true");
|
|
19821
|
-
x[updateLabels$1]?.();
|
|
19822
|
-
});
|
|
19823
|
-
break;
|
|
21957
|
+
/** @private */
|
|
21958
|
+
_handleFocusChange(focused) {
|
|
21959
|
+
if (!focused && this.currentMode === "docked") {
|
|
21960
|
+
this.clear();
|
|
21961
|
+
this.open = false;
|
|
19824
21962
|
}
|
|
19825
21963
|
}
|
|
19826
|
-
|
|
19827
|
-
|
|
19828
|
-
|
|
19829
|
-
|
|
19830
|
-
|
|
21964
|
+
};
|
|
21965
|
+
_M3eSearchViewElement_input = new WeakMap();
|
|
21966
|
+
_M3eSearchViewElement_closeOnInputFocus = new WeakMap();
|
|
21967
|
+
_M3eSearchViewElement_inputInputHandler = new WeakMap();
|
|
21968
|
+
_M3eSearchViewElement_inputFocusHandler = new WeakMap();
|
|
21969
|
+
_M3eSearchViewElement_inputKeyDownHandler = new WeakMap();
|
|
21970
|
+
_M3eSearchViewElement_inputPointerHandler = new WeakMap();
|
|
21971
|
+
_M3eSearchViewElement_scrollLockController = new WeakMap();
|
|
21972
|
+
_M3eSearchViewElement_inertController = new WeakMap();
|
|
21973
|
+
_M3eSearchViewElement_openMode = new WeakMap();
|
|
21974
|
+
_M3eSearchViewElement_anchorCleanup = new WeakMap();
|
|
21975
|
+
_M3eSearchViewElement_breakpointUnobserve = new WeakMap();
|
|
21976
|
+
_M3eSearchViewElement_instances = new WeakSet();
|
|
21977
|
+
_M3eSearchViewElement_renderIconOrBackButton = function _M3eSearchViewElement_renderIconOrBackButton() {
|
|
21978
|
+
if (!this.open && this.hideSearchIcon) return nothing;
|
|
21979
|
+
return html`<div class="icon" slot="leading">${this.open ? __classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_renderBackButton).call(this) : __classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_renderIcon).call(this)}</div>`;
|
|
21980
|
+
};
|
|
21981
|
+
_M3eSearchViewElement_renderIcon = function _M3eSearchViewElement_renderIcon() {
|
|
21982
|
+
return html`<slot name="search-icon"><svg class="search-icon" viewBox="0 -960 960 960" fill="currentColor"><path d="M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z"/></svg></slot>`;
|
|
21983
|
+
};
|
|
21984
|
+
_M3eSearchViewElement_renderBackButton = function _M3eSearchViewElement_renderBackButton() {
|
|
21985
|
+
return html`<m3e-icon-button class="close" slot="leading" aria-label="${this.closeLabel}" @click="${__classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_handleCloseClick)}"><slot name="close-icon"><svg class="close-icon" viewBox="0 -960 960 960" fill="currentColor">${this.currentMode === "docked" ? svg`<path d="m313-440 224 224-57 56-320-320 320-320 57 56-224 224h487v80H313Z"/>` : svg`<path d="M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z"/>`}</svg></slot></m3e-icon-button>`;
|
|
21986
|
+
};
|
|
21987
|
+
_M3eSearchViewElement_renderClearButton = function _M3eSearchViewElement_renderClearButton() {
|
|
21988
|
+
return html`<m3e-icon-button class="clear" slot="trailing" aria-label="${this.open && !this._clearable ? this.closeLabel : this.clearLabel}" @click="${__classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_handleClearClick)}"><slot name="clear-icon"><svg class="clear-icon" viewBox="0 -960 960 960" fill="currentColor"><path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"/></svg></slot></m3e-icon-button>`;
|
|
21989
|
+
};
|
|
21990
|
+
_M3eSearchViewElement_handleInputSlotChange = function _M3eSearchViewElement_handleInputSlotChange(e) {
|
|
21991
|
+
const input = e.target.assignedElements({
|
|
21992
|
+
flatten: true
|
|
21993
|
+
}).find(x => x instanceof HTMLInputElement);
|
|
21994
|
+
if (input != __classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")) {
|
|
21995
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")?.removeEventListener("input", __classPrivateFieldGet(this, _M3eSearchViewElement_inputInputHandler, "f"));
|
|
21996
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")?.removeEventListener("focus", __classPrivateFieldGet(this, _M3eSearchViewElement_inputFocusHandler, "f"));
|
|
21997
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")?.removeEventListener("keydown", __classPrivateFieldGet(this, _M3eSearchViewElement_inputKeyDownHandler, "f"));
|
|
21998
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")?.removeEventListener("pointerdown", __classPrivateFieldGet(this, _M3eSearchViewElement_inputPointerHandler, "f"));
|
|
21999
|
+
__classPrivateFieldSet(this, _M3eSearchViewElement_input, input, "f");
|
|
22000
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")?.addEventListener("input", __classPrivateFieldGet(this, _M3eSearchViewElement_inputInputHandler, "f"));
|
|
22001
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")?.addEventListener("focus", __classPrivateFieldGet(this, _M3eSearchViewElement_inputFocusHandler, "f"));
|
|
22002
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")?.addEventListener("keydown", __classPrivateFieldGet(this, _M3eSearchViewElement_inputKeyDownHandler, "f"));
|
|
22003
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")?.addEventListener("pointerdown", __classPrivateFieldGet(this, _M3eSearchViewElement_inputPointerHandler, "f"));
|
|
22004
|
+
if (__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")) {
|
|
22005
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f").role = __classPrivateFieldGet(this, _M3eSearchViewElement_input, "f").role || "searchbox";
|
|
22006
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f").inputMode = __classPrivateFieldGet(this, _M3eSearchViewElement_input, "f").inputMode || "search";
|
|
22007
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f").type = "text";
|
|
22008
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f").ariaHasPopup = "dialog";
|
|
22009
|
+
}
|
|
22010
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_updateClearableState).call(this);
|
|
22011
|
+
}
|
|
22012
|
+
};
|
|
22013
|
+
_M3eSearchViewElement_handleInputInput = function _M3eSearchViewElement_handleInputInput() {
|
|
22014
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_updateClearableState).call(this);
|
|
22015
|
+
if (this.open) {
|
|
22016
|
+
this.dispatchEvent(new CustomEvent("query", {
|
|
22017
|
+
detail: {
|
|
22018
|
+
term: __classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")?.value ?? ""
|
|
22019
|
+
},
|
|
22020
|
+
bubbles: true,
|
|
22021
|
+
composed: true
|
|
22022
|
+
}));
|
|
22023
|
+
} else {
|
|
22024
|
+
this.open = true;
|
|
19831
22025
|
}
|
|
19832
|
-
|
|
19833
|
-
|
|
19834
|
-
|
|
19835
|
-
|
|
19836
|
-
|
|
22026
|
+
};
|
|
22027
|
+
_M3eSearchViewElement_updateMode = function _M3eSearchViewElement_updateMode() {
|
|
22028
|
+
setCustomState$1(this, "-fullscreen", this.currentMode === "fullscreen");
|
|
22029
|
+
setCustomState$1(this, "-docked", this.currentMode === "docked");
|
|
22030
|
+
};
|
|
22031
|
+
_M3eSearchViewElement_updateClearableState = function _M3eSearchViewElement_updateClearableState() {
|
|
22032
|
+
this._clearable = (__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")?.value ?? "").length > 0;
|
|
22033
|
+
setCustomState$1(this, "-clearable", this._clearable);
|
|
22034
|
+
};
|
|
22035
|
+
_M3eSearchViewElement_handleInputFocus = function _M3eSearchViewElement_handleInputFocus() {
|
|
22036
|
+
this.open = !__classPrivateFieldGet(this, _M3eSearchViewElement_closeOnInputFocus, "f");
|
|
22037
|
+
__classPrivateFieldSet(this, _M3eSearchViewElement_closeOnInputFocus, false, "f");
|
|
22038
|
+
};
|
|
22039
|
+
_M3eSearchViewElement_handleCloseClick = function _M3eSearchViewElement_handleCloseClick() {
|
|
22040
|
+
if (!__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")) return;
|
|
22041
|
+
if (__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f").value) {
|
|
22042
|
+
this.clear();
|
|
19837
22043
|
}
|
|
19838
|
-
|
|
19839
|
-
|
|
19840
|
-
|
|
19841
|
-
|
|
19842
|
-
|
|
22044
|
+
__classPrivateFieldSet(this, _M3eSearchViewElement_closeOnInputFocus, true, "f");
|
|
22045
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")?.focus();
|
|
22046
|
+
};
|
|
22047
|
+
_M3eSearchViewElement_handleClearClick = function _M3eSearchViewElement_handleClearClick() {
|
|
22048
|
+
if (!__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")) return;
|
|
22049
|
+
if (__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f").value) {
|
|
22050
|
+
this.clear();
|
|
22051
|
+
} else {
|
|
22052
|
+
__classPrivateFieldSet(this, _M3eSearchViewElement_closeOnInputFocus, true, "f");
|
|
22053
|
+
}
|
|
22054
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")?.focus();
|
|
22055
|
+
};
|
|
22056
|
+
_M3eSearchViewElement_handleInputPointerDown = function _M3eSearchViewElement_handleInputPointerDown() {
|
|
22057
|
+
if (!this.open && __classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")?.matches(":focus")) {
|
|
22058
|
+
this.open = true;
|
|
22059
|
+
}
|
|
22060
|
+
};
|
|
22061
|
+
_M3eSearchViewElement_handleInputKeyDown = function _M3eSearchViewElement_handleInputKeyDown(e) {
|
|
22062
|
+
if (this.open && e.key === "Escape" && !e.shiftKey && !e.ctrlKey) {
|
|
22063
|
+
e.preventDefault();
|
|
22064
|
+
const input = e.target;
|
|
22065
|
+
if (input.value) {
|
|
22066
|
+
this.clear();
|
|
19843
22067
|
}
|
|
19844
|
-
|
|
19845
|
-
|
|
22068
|
+
this.open = false;
|
|
22069
|
+
}
|
|
22070
|
+
};
|
|
22071
|
+
_M3eSearchViewElement_handleKeyDown = function _M3eSearchViewElement_handleKeyDown(e) {
|
|
22072
|
+
if (this.open && e.key === "Escape" && !e.shiftKey && !e.ctrlKey) {
|
|
22073
|
+
e.preventDefault();
|
|
22074
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_handleCloseClick).call(this);
|
|
22075
|
+
}
|
|
22076
|
+
};
|
|
22077
|
+
_M3eSearchViewElement_openDocked = /** @private */
|
|
22078
|
+
async function _M3eSearchViewElement_openDocked() {
|
|
22079
|
+
if (!this.dispatchEvent(new ToggleEvent("beforetoggle", {
|
|
22080
|
+
oldState: "closed",
|
|
22081
|
+
newState: "open",
|
|
22082
|
+
bubbles: true,
|
|
22083
|
+
composed: true,
|
|
22084
|
+
cancelable: true
|
|
22085
|
+
}))) {
|
|
22086
|
+
this.open = false;
|
|
22087
|
+
return;
|
|
22088
|
+
}
|
|
22089
|
+
__classPrivateFieldSet(this, _M3eSearchViewElement_openMode, this.currentMode, "f");
|
|
22090
|
+
const view = this._view;
|
|
22091
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_anchorCleanup, "f")?.call(this);
|
|
22092
|
+
__classPrivateFieldSet(this, _M3eSearchViewElement_anchorCleanup, await positionAnchor(view, this._anchor, {
|
|
22093
|
+
position: "bottom"
|
|
22094
|
+
}, (x, y) => {
|
|
22095
|
+
const view = this._view;
|
|
22096
|
+
view.style.top = `${y - this._anchor.clientHeight}px`;
|
|
22097
|
+
view.style.width = `${this._anchor.clientWidth}px`;
|
|
22098
|
+
if (M3eDirectionality.current === "rtl") {
|
|
22099
|
+
view.style.right = `${window.innerWidth - x - this.clientWidth}px`;
|
|
22100
|
+
view.style.left = "";
|
|
22101
|
+
} else {
|
|
22102
|
+
view.style.left = `${x}px`;
|
|
22103
|
+
view.style.right = "";
|
|
19846
22104
|
}
|
|
22105
|
+
}), "f");
|
|
22106
|
+
this._anchor.style.position = "relative";
|
|
22107
|
+
view.popover = "manual";
|
|
22108
|
+
view.style.position = "absolute";
|
|
22109
|
+
view.showPopover();
|
|
22110
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_scrollLockController, "f").lock();
|
|
22111
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_inertController, "f").lock();
|
|
22112
|
+
this.dispatchEvent(new ToggleEvent("toggle", {
|
|
22113
|
+
oldState: "closed",
|
|
22114
|
+
newState: "open",
|
|
22115
|
+
bubbles: true,
|
|
22116
|
+
composed: true
|
|
22117
|
+
}));
|
|
22118
|
+
this.dispatchEvent(new CustomEvent("query", {
|
|
22119
|
+
detail: {
|
|
22120
|
+
term: __classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")?.value ?? ""
|
|
22121
|
+
},
|
|
22122
|
+
bubbles: true,
|
|
22123
|
+
composed: true
|
|
22124
|
+
}));
|
|
22125
|
+
};
|
|
22126
|
+
_M3eSearchViewElement_closeDocked = function _M3eSearchViewElement_closeDocked() {
|
|
22127
|
+
const view = this._view;
|
|
22128
|
+
if (view.popover !== "manual") return;
|
|
22129
|
+
if (!this.dispatchEvent(new ToggleEvent("beforetoggle", {
|
|
22130
|
+
oldState: "open",
|
|
22131
|
+
newState: "closed",
|
|
22132
|
+
bubbles: true,
|
|
22133
|
+
composed: true,
|
|
22134
|
+
cancelable: true
|
|
22135
|
+
}))) {
|
|
22136
|
+
this.open = true;
|
|
22137
|
+
return;
|
|
19847
22138
|
}
|
|
19848
|
-
|
|
19849
|
-
|
|
19850
|
-
|
|
22139
|
+
__classPrivateFieldSet(this, _M3eSearchViewElement_openMode, undefined, "f");
|
|
22140
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_scrollLockController, "f").unlock();
|
|
22141
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_inertController, "f").unlock();
|
|
22142
|
+
if (prefersReducedMotion$1()) {
|
|
22143
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_hideDocked).call(this);
|
|
22144
|
+
} else {
|
|
22145
|
+
view.classList.add("closing");
|
|
22146
|
+
view.addEventListener("transitionend", () => __classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_hideDocked).call(this), {
|
|
22147
|
+
once: true
|
|
22148
|
+
});
|
|
19851
22149
|
}
|
|
19852
22150
|
};
|
|
19853
|
-
|
|
19854
|
-
|
|
19855
|
-
|
|
19856
|
-
|
|
19857
|
-
|
|
19858
|
-
|
|
19859
|
-
|
|
19860
|
-
|
|
19861
|
-
|
|
22151
|
+
_M3eSearchViewElement_hideDocked = function _M3eSearchViewElement_hideDocked() {
|
|
22152
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_anchorCleanup, "f")?.call(this);
|
|
22153
|
+
__classPrivateFieldSet(this, _M3eSearchViewElement_anchorCleanup, undefined, "f");
|
|
22154
|
+
const view = this._view;
|
|
22155
|
+
view.classList.remove("closing");
|
|
22156
|
+
view.style.position = "";
|
|
22157
|
+
view.style.width = "";
|
|
22158
|
+
view.style.top = "";
|
|
22159
|
+
view.style.left = "";
|
|
22160
|
+
view.style.right = "";
|
|
22161
|
+
view.hidePopover();
|
|
22162
|
+
view.popover = null;
|
|
22163
|
+
this._anchor.style.position = "";
|
|
22164
|
+
this.dispatchEvent(new ToggleEvent("toggle", {
|
|
22165
|
+
oldState: "open",
|
|
22166
|
+
newState: "closed",
|
|
22167
|
+
bubbles: true,
|
|
22168
|
+
composed: true
|
|
22169
|
+
}));
|
|
19862
22170
|
};
|
|
19863
|
-
|
|
19864
|
-
|
|
22171
|
+
_M3eSearchViewElement_openFullscreen = /** @private */
|
|
22172
|
+
async function _M3eSearchViewElement_openFullscreen() {
|
|
22173
|
+
if (!this.dispatchEvent(new ToggleEvent("beforetoggle", {
|
|
22174
|
+
oldState: "closed",
|
|
22175
|
+
newState: "open",
|
|
22176
|
+
bubbles: true,
|
|
22177
|
+
composed: true,
|
|
22178
|
+
cancelable: true
|
|
22179
|
+
}))) {
|
|
22180
|
+
this.open = false;
|
|
22181
|
+
return;
|
|
22182
|
+
}
|
|
22183
|
+
__classPrivateFieldSet(this, _M3eSearchViewElement_openMode, this.currentMode, "f");
|
|
22184
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_scrollLockController, "f").lock();
|
|
22185
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_inertController, "f").lock();
|
|
22186
|
+
const view = this._view;
|
|
22187
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_anchorCleanup, "f")?.call(this);
|
|
22188
|
+
if (!prefersReducedMotion$1()) {
|
|
22189
|
+
const rect = view.getBoundingClientRect();
|
|
22190
|
+
const startInline = M3eDirectionality.current === "rtl" ? window.innerWidth - rect.right : rect.left;
|
|
22191
|
+
view.style.position = "fixed";
|
|
22192
|
+
view.popover = "manual";
|
|
22193
|
+
view.showPopover();
|
|
22194
|
+
this._anchor.style.position = "relative";
|
|
22195
|
+
view.animate([{
|
|
22196
|
+
transform: `translateX(${startInline}px)`,
|
|
22197
|
+
width: `${rect.width}px`,
|
|
22198
|
+
top: `${rect.top}px`,
|
|
22199
|
+
height: `${rect.height}px`
|
|
22200
|
+
}, {
|
|
22201
|
+
transform: "translateX(0px)",
|
|
22202
|
+
width: "100vw",
|
|
22203
|
+
top: "0px",
|
|
22204
|
+
height: "100vh"
|
|
22205
|
+
}], {
|
|
22206
|
+
duration: 150,
|
|
22207
|
+
easing: "cubic-bezier(0.2, 0.0, 0, 1.0)"
|
|
22208
|
+
});
|
|
22209
|
+
} else {
|
|
22210
|
+
view.style.position = "fixed";
|
|
22211
|
+
view.popover = "manual";
|
|
22212
|
+
view.showPopover();
|
|
22213
|
+
this._anchor.style.position = "relative";
|
|
22214
|
+
}
|
|
22215
|
+
this.dispatchEvent(new ToggleEvent("toggle", {
|
|
22216
|
+
oldState: "closed",
|
|
22217
|
+
newState: "open",
|
|
22218
|
+
bubbles: true,
|
|
22219
|
+
composed: true
|
|
22220
|
+
}));
|
|
22221
|
+
this.dispatchEvent(new CustomEvent("query", {
|
|
22222
|
+
detail: {
|
|
22223
|
+
term: __classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")?.value ?? ""
|
|
22224
|
+
},
|
|
22225
|
+
bubbles: true,
|
|
22226
|
+
composed: true
|
|
22227
|
+
}));
|
|
19865
22228
|
};
|
|
19866
|
-
|
|
19867
|
-
|
|
22229
|
+
_M3eSearchViewElement_closeFullscreen = /** @private */
|
|
22230
|
+
async function _M3eSearchViewElement_closeFullscreen() {
|
|
22231
|
+
const view = this._view;
|
|
22232
|
+
if (view.popover !== "manual") return;
|
|
22233
|
+
if (!this.dispatchEvent(new ToggleEvent("beforetoggle", {
|
|
22234
|
+
oldState: "open",
|
|
22235
|
+
newState: "closed",
|
|
22236
|
+
bubbles: true,
|
|
22237
|
+
composed: true,
|
|
22238
|
+
cancelable: true
|
|
22239
|
+
}))) {
|
|
22240
|
+
this.open = true;
|
|
22241
|
+
return;
|
|
22242
|
+
}
|
|
22243
|
+
__classPrivateFieldSet(this, _M3eSearchViewElement_openMode, undefined, "f");
|
|
22244
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_scrollLockController, "f").unlock();
|
|
22245
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_inertController, "f").unlock();
|
|
22246
|
+
const anchor = this._anchor;
|
|
22247
|
+
if (!prefersReducedMotion$1()) {
|
|
22248
|
+
const start = view.getBoundingClientRect();
|
|
22249
|
+
const end = anchor.getBoundingClientRect();
|
|
22250
|
+
const startInline = M3eDirectionality.current === "rtl" ? window.innerWidth - start.right : start.left;
|
|
22251
|
+
const endInline = M3eDirectionality.current === "rtl" ? window.innerWidth - end.right : end.left;
|
|
22252
|
+
const dx = M3eDirectionality.current === "rtl" ? startInline - endInline : endInline - startInline;
|
|
22253
|
+
view.classList.add("closing");
|
|
22254
|
+
await view.animate([{
|
|
22255
|
+
transform: `translateX(0px)`,
|
|
22256
|
+
width: `${start.width}px`,
|
|
22257
|
+
top: `${start.top}px`,
|
|
22258
|
+
height: `${start.height}px`
|
|
22259
|
+
}, {
|
|
22260
|
+
transform: `translateX(${dx}px)`,
|
|
22261
|
+
width: `${end.width}px`,
|
|
22262
|
+
top: `${end.top}px`,
|
|
22263
|
+
height: `${end.height}px`
|
|
22264
|
+
}], {
|
|
22265
|
+
duration: 150,
|
|
22266
|
+
easing: "cubic-bezier(0.2, 0.0, 0, 1.0)"
|
|
22267
|
+
}).finished;
|
|
22268
|
+
}
|
|
22269
|
+
view.hidePopover();
|
|
22270
|
+
view.style.position = "";
|
|
22271
|
+
view.popover = null;
|
|
22272
|
+
view.classList.remove("closing");
|
|
22273
|
+
anchor.style.position = "";
|
|
22274
|
+
this.dispatchEvent(new ToggleEvent("toggle", {
|
|
22275
|
+
oldState: "open",
|
|
22276
|
+
newState: "closed",
|
|
22277
|
+
bubbles: true,
|
|
22278
|
+
composed: true
|
|
22279
|
+
}));
|
|
19868
22280
|
};
|
|
22281
|
+
(() => {
|
|
22282
|
+
registerStyleSheet$1(SearchViewLightDomStyle);
|
|
22283
|
+
})();
|
|
19869
22284
|
/** The styles of the element. */
|
|
19870
|
-
|
|
19871
|
-
|
|
22285
|
+
M3eSearchViewElement.styles = SearchViewStyle;
|
|
22286
|
+
__decorate([state()], M3eSearchViewElement.prototype, "_clearable", void 0);
|
|
22287
|
+
__decorate([state()], M3eSearchViewElement.prototype, "_mode", void 0);
|
|
22288
|
+
__decorate([query(".anchor")], M3eSearchViewElement.prototype, "_anchor", void 0);
|
|
22289
|
+
__decorate([query(".view")], M3eSearchViewElement.prototype, "_view", void 0);
|
|
22290
|
+
__decorate([property({
|
|
22291
|
+
type: Boolean,
|
|
22292
|
+
reflect: true
|
|
22293
|
+
})], M3eSearchViewElement.prototype, "contained", void 0);
|
|
22294
|
+
__decorate([property({
|
|
22295
|
+
reflect: true
|
|
22296
|
+
})], M3eSearchViewElement.prototype, "mode", void 0);
|
|
22297
|
+
__decorate([property({
|
|
22298
|
+
type: Boolean,
|
|
22299
|
+
reflect: true
|
|
22300
|
+
})], M3eSearchViewElement.prototype, "open", void 0);
|
|
22301
|
+
__decorate([property({
|
|
22302
|
+
attribute: "clear-label"
|
|
22303
|
+
})], M3eSearchViewElement.prototype, "clearLabel", void 0);
|
|
22304
|
+
__decorate([property({
|
|
22305
|
+
attribute: "close-label"
|
|
22306
|
+
})], M3eSearchViewElement.prototype, "closeLabel", void 0);
|
|
22307
|
+
__decorate([property({
|
|
22308
|
+
attribute: "hide-search-icon",
|
|
22309
|
+
type: Boolean
|
|
22310
|
+
})], M3eSearchViewElement.prototype, "hideSearchIcon", void 0);
|
|
22311
|
+
__decorate([debounce$1(40)], M3eSearchViewElement.prototype, "_handleFocusChange", null);
|
|
22312
|
+
M3eSearchViewElement = __decorate([customElement$1("m3e-search-view")], M3eSearchViewElement);
|
|
19872
22313
|
|
|
19873
22314
|
var _M3eButtonSegmentElement_instances, _M3eButtonSegmentElement_clickHandler, _M3eButtonSegmentElement_handleIconSlotChange, _M3eButtonSegmentElement_handleClick;
|
|
19874
22315
|
var M3eButtonSegmentElement_1;
|
|
@@ -20206,7 +22647,7 @@ __decorate([property({
|
|
|
20206
22647
|
})], M3eSegmentedButtonElement.prototype, "hideSelectionIndicator", void 0);
|
|
20207
22648
|
M3eSegmentedButtonElement = __decorate([customElement$1("m3e-segmented-button")], M3eSegmentedButtonElement);
|
|
20208
22649
|
|
|
20209
|
-
var _M3eSelectElement_instances, _M3eSelectElement_clone, _M3eSelectElement_menu, _M3eSelectElement_ignoreKeyUp, _M3eSelectElement_ignoreFocusVisible, _M3eSelectElement_id, _M3eSelectElement_listId, _M3eSelectElement_clickHandler, _M3eSelectElement_keyDownHandler, _M3eSelectElement_keyUpHandler, _M3eSelectElement_menuToggleHandler, _M3eSelectElement_menuPointerDownHandler, _M3eSelectElement_options_get, _M3eSelectElement_selected_get,
|
|
22650
|
+
var _M3eSelectElement_instances, _M3eSelectElement_clone, _M3eSelectElement_menu, _M3eSelectElement_ignoreKeyUp, _M3eSelectElement_ignoreFocusVisible, _M3eSelectElement_id, _M3eSelectElement_listId, _M3eSelectElement_clickHandler, _M3eSelectElement_keyDownHandler, _M3eSelectElement_keyUpHandler, _M3eSelectElement_menuToggleHandler, _M3eSelectElement_menuPointerDownHandler, _M3eSelectElement_options_get, _M3eSelectElement_selected_get, _M3eSelectElement_formField_get, _M3eSelectElement_handleMutation, _M3eSelectElement_handleClick, _M3eSelectElement_handleKeyDown, _M3eSelectElement_handleKeyUp, _M3eSelectElement_handleMenuPointerDown, _M3eSelectElement_handleMenuToggle, _M3eSelectElement_destroyMenu, _M3eSelectElement_toggleMenu, _M3eSelectElement_showMenu, _M3eSelectElement_hideMenu, _M3eSelectElement_activateOption, _M3eSelectElement_updateSelectionState, _M3eSelectElement_selectOption;
|
|
20210
22651
|
var M3eSelectElement_1;
|
|
20211
22652
|
/**
|
|
20212
22653
|
* A form control that allows users to select a value from a set of predefined options.
|
|
@@ -20310,13 +22751,6 @@ let M3eSelectElement = M3eSelectElement_1 = class M3eSelectElement extends Focus
|
|
|
20310
22751
|
* @default ""
|
|
20311
22752
|
*/
|
|
20312
22753
|
this.panelClass = "";
|
|
20313
|
-
new ResizeController$1(this, {
|
|
20314
|
-
callback: () => {
|
|
20315
|
-
if (__classPrivateFieldGet(this, _M3eSelectElement_menu, "f")) {
|
|
20316
|
-
__classPrivateFieldGet(this, _M3eSelectElement_menu, "f").style.minWidth = __classPrivateFieldGet(this, _M3eSelectElement_instances, "a", _M3eSelectElement_minMenuWidth_get);
|
|
20317
|
-
}
|
|
20318
|
-
}
|
|
20319
|
-
});
|
|
20320
22754
|
new MutationController$1(this, {
|
|
20321
22755
|
config: {
|
|
20322
22756
|
childList: true,
|
|
@@ -20434,10 +22868,6 @@ let M3eSelectElement = M3eSelectElement_1 = class M3eSelectElement extends Focus
|
|
|
20434
22868
|
return html`<m3e-focus-ring class="focus-ring"></m3e-focus-ring><div class="base"><m3e-text-overflow><slot name="value">${this.selected.filter(x => !x.isEmpty).map((x, i) => i > 0 ? html`<span>, </span>${x.label}` : x.label)}</slot></m3e-text-overflow><div class="arrow-wrapper" aria-hidden="true"><slot name="arrow"><svg class="arrow" viewBox="0 -960 960 960" fill="currentColor"><path d="M480-360 280-560h400L480-360Z"/></svg></slot></div></div><div class="options" aria-hidden="true"><slot></slot></div>`;
|
|
20435
22869
|
}
|
|
20436
22870
|
};
|
|
20437
|
-
_M3eSelectElement_minMenuWidth_get = function _M3eSelectElement_minMenuWidth_get() {
|
|
20438
|
-
const formField = __classPrivateFieldGet(this, _M3eSelectElement_instances, "a", _M3eSelectElement_formField_get);
|
|
20439
|
-
return `${formField ? formField.menuAnchor.clientWidth : this.clientWidth}px`;
|
|
20440
|
-
};
|
|
20441
22871
|
_M3eSelectElement_formField_get = function _M3eSelectElement_formField_get() {
|
|
20442
22872
|
return this.closest("m3e-form-field");
|
|
20443
22873
|
};
|
|
@@ -20611,7 +23041,7 @@ _M3eSelectElement_showMenu = function _M3eSelectElement_showMenu() {
|
|
|
20611
23041
|
}
|
|
20612
23042
|
}
|
|
20613
23043
|
__classPrivateFieldGet(this, _M3eSelectElement_menu, "f").style.overflowX = "hidden";
|
|
20614
|
-
__classPrivateFieldGet(this, _M3eSelectElement_menu, "f").
|
|
23044
|
+
__classPrivateFieldGet(this, _M3eSelectElement_menu, "f").fitAnchorWidth = true;
|
|
20615
23045
|
__classPrivateFieldGet(this, _M3eSelectElement_menu, "f").addEventListener("toggle", __classPrivateFieldGet(this, _M3eSelectElement_menuToggleHandler, "f"));
|
|
20616
23046
|
__classPrivateFieldGet(this, _M3eSelectElement_menu, "f").addEventListener("pointerdown", __classPrivateFieldGet(this, _M3eSelectElement_menuPointerDownHandler, "f"));
|
|
20617
23047
|
if (__classPrivateFieldGet(this, _M3eSelectElement_clone, "f")) {
|
|
@@ -21741,11 +24171,7 @@ _M3eSnackbarElement_handleBeforeToggle = function _M3eSnackbarElement_handleBefo
|
|
|
21741
24171
|
}
|
|
21742
24172
|
};
|
|
21743
24173
|
(() => {
|
|
21744
|
-
|
|
21745
|
-
const lightDomStyle = new CSSStyleSheet();
|
|
21746
|
-
lightDomStyle.replaceSync(css`m3e-snackbar { margin-inline: auto; }`.toString());
|
|
21747
|
-
document.adoptedStyleSheets = [...document.adoptedStyleSheets, lightDomStyle];
|
|
21748
|
-
}
|
|
24174
|
+
registerStyleSheet$1(css`m3e-snackbar { margin-inline: auto; }`);
|
|
21749
24175
|
})();
|
|
21750
24176
|
/** The styles of the element. */
|
|
21751
24177
|
M3eSnackbarElement.styles = css`:host { position: fixed; top: calc(100vh - var(--_snackbar-height, 0px) - var(--m3e-snackbar-margin, 1rem)); display: inline-flex; align-items: center; min-width: var(--m3e-snackbar-min-width, 21.5rem); max-width: var(--m3e-snackbar-max-width, 42rem); visibility: hidden; border: none; margin: 0; padding: 0; opacity: 0; transform: scale(0.8); transition: ${unsafeCSS(`opacity ${DesignToken$1.motion.duration.short3} ${DesignToken$1.motion.easing.standard},
|
|
@@ -22724,11 +25150,7 @@ _M3eStepperElement_updateDisplayOrder = function _M3eStepperElement_updateDispla
|
|
|
22724
25150
|
}
|
|
22725
25151
|
};
|
|
22726
25152
|
(() => {
|
|
22727
|
-
|
|
22728
|
-
const lightDomStyle = new CSSStyleSheet();
|
|
22729
|
-
lightDomStyle.replaceSync(css`m3e-stepper:not(:state(-vertical)) > .-m3e-step-divider::before { border-bottom-width: var(--m3e-step-divider-thickness, 1px); border-bottom-style: solid; border-bottom-color: var(--m3e-step-divider-color, ${DesignToken$1.color.outline}); } m3e-stepper:not(:state(-vertical)) > [slot="step"]:not(.-m3e-step-divider):not(:first-of-type)::before, m3e-stepper:not(:state(-vertical)) > [slot="step"]:not(.-m3e-step-divider):not(:last-of-type)::after { border-bottom-width: var(--m3e-step-divider-thickness, 1px); border-bottom-style: solid; border-bottom-color: var(--m3e-step-divider-color, ${DesignToken$1.color.outline}); } m3e-stepper:not(:state(-vertical))[label-position="end"] > .-m3e-step-divider { margin-block: auto; } m3e-stepper:not(:state(-vertical))[label-position="below"] > .-m3e-step-divider::before, m3e-stepper:not(:state(-vertical))[label-position="below"] > [slot="step"]:not(.-m3e-step-divider):not(:first-of-type)::before, m3e-stepper:not(:state(-vertical))[label-position="below"] > [slot="step"]:not(.-m3e-step-divider):not(:last-of-type)::after { margin-block-start: calc(var(--m3e-step-padding, 1.5rem) + calc(var(--m3e-step-icon-size, 1.5rem) / 2)); } m3e-stepper:state(-vertical) > [slot="panel"] { margin-inline-start: calc(var(--m3e-step-padding, 1.5rem) + calc(var(--m3e-step-icon-size, 1.5rem) / 2)); } m3e-stepper:state(-vertical) > [slot="panel"]:not(:last-of-type) { border-inline-start-width: var(--m3e-step-divider-thickness, 1px); border-inline-start-style: solid; border-inline-start-color: var(--m3e-step-divider-color, ${DesignToken$1.color.outline}); } m3e-stepper:state(-vertical) > [slot="step"]:not(.-m3e-step-divider):not(:first-of-type)::before, m3e-stepper:state(-vertical) > [slot="step"]:not(.-m3e-step-divider):not(:last-of-type)::after { margin-inline-start: calc(var(--m3e-step-padding, 1.5rem) + calc(var(--m3e-step-icon-size, 1.5rem) / 2)); border-inline-start-width: var(--m3e-step-divider-thickness, 1px); border-inline-start-style: solid; border-inline-start-color: var(--m3e-step-divider-color, ${DesignToken$1.color.outline}); }`.toString());
|
|
22730
|
-
document.adoptedStyleSheets = [...document.adoptedStyleSheets, lightDomStyle];
|
|
22731
|
-
}
|
|
25153
|
+
registerStyleSheet$1(css`m3e-stepper:not(:state(-vertical)) > .-m3e-step-divider::before { border-bottom-width: var(--m3e-step-divider-thickness, 1px); border-bottom-style: solid; border-bottom-color: var(--m3e-step-divider-color, ${DesignToken$1.color.outline}); } m3e-stepper:not(:state(-vertical)) > [slot="step"]:not(.-m3e-step-divider):not(:first-of-type)::before, m3e-stepper:not(:state(-vertical)) > [slot="step"]:not(.-m3e-step-divider):not(:last-of-type)::after { border-bottom-width: var(--m3e-step-divider-thickness, 1px); border-bottom-style: solid; border-bottom-color: var(--m3e-step-divider-color, ${DesignToken$1.color.outline}); } m3e-stepper:not(:state(-vertical))[label-position="end"] > .-m3e-step-divider { margin-block: auto; } m3e-stepper:not(:state(-vertical))[label-position="below"] > .-m3e-step-divider::before, m3e-stepper:not(:state(-vertical))[label-position="below"] > [slot="step"]:not(.-m3e-step-divider):not(:first-of-type)::before, m3e-stepper:not(:state(-vertical))[label-position="below"] > [slot="step"]:not(.-m3e-step-divider):not(:last-of-type)::after { margin-block-start: calc(var(--m3e-step-padding, 1.5rem) + calc(var(--m3e-step-icon-size, 1.5rem) / 2)); } m3e-stepper:state(-vertical) > [slot="panel"] { margin-inline-start: calc(var(--m3e-step-padding, 1.5rem) + calc(var(--m3e-step-icon-size, 1.5rem) / 2)); } m3e-stepper:state(-vertical) > [slot="panel"]:not(:last-of-type) { border-inline-start-width: var(--m3e-step-divider-thickness, 1px); border-inline-start-style: solid; border-inline-start-color: var(--m3e-step-divider-color, ${DesignToken$1.color.outline}); } m3e-stepper:state(-vertical) > [slot="step"]:not(.-m3e-step-divider):not(:first-of-type)::before, m3e-stepper:state(-vertical) > [slot="step"]:not(.-m3e-step-divider):not(:last-of-type)::after { margin-inline-start: calc(var(--m3e-step-padding, 1.5rem) + calc(var(--m3e-step-icon-size, 1.5rem) / 2)); border-inline-start-width: var(--m3e-step-divider-thickness, 1px); border-inline-start-style: solid; border-inline-start-color: var(--m3e-step-divider-color, ${DesignToken$1.color.outline}); }`);
|
|
22732
25154
|
})();
|
|
22733
25155
|
/** The styles of the element. */
|
|
22734
25156
|
M3eStepperElement.styles = css`:host { display: flex; flex-direction: column; position: relative; } :host(:not(:state(-vertical))) .header { display: flex; align-items: flex-start; flex-wrap: nowrap; } :host(:not(:state(-vertical))) ::slotted(.-m3e-step-divider) { flex: 1 1 auto; position: relative; min-width: 2rem; } :host(:not(:state(-vertical))) ::slotted(.-m3e-step-divider)::before { content: ""; position: absolute; left: 0; right: 0; } :host(:not(:state(-vertical)):not([label-position="below"])) ::slotted(.-m3e-step-divider)::before { top: 50%; } :host(:not(:state(-vertical))) ::slotted([slot="step"]) { align-self: stretch; } :host(:not(:state(-vertical))) ::slotted([slot="step"]:not(.-m3e-step-divider):not(:first-of-type))::before, :host(:not(:state(-vertical))) ::slotted([slot="step"]:not(.-m3e-step-divider):not(:last-of-type))::after { content: ""; display: block; position: absolute; top: 0; } :host(:not(:state(-vertical))[label-position="end"]) ::slotted([slot="step"]:not(.-m3e-step-divider):not(:first-of-type))::before, :host(:not(:state(-vertical))[label-position="end"]) ::slotted([slot="step"]:not(.-m3e-step-divider):not(:last-of-type))::after { top: 50%; } :host(:not(:dir(rtl)):not(:state(-vertical))[label-position="end"]) ::slotted([slot="step"]:not(.-m3e-step-divider):not(:first-of-type))::before { left: 0; right: calc(100% - var(--m3e-step-padding, 1.5rem) + var(--m3e-step-divider-inset, 0.5rem)); } :host(:dir(rtl):not(:state(-vertical))[label-position="end"]) ::slotted([slot="step"]:not(.-m3e-step-divider):not(:first-of-type))::before { right: 0; left: calc(100% - var(--m3e-step-padding, 1.5rem) + var(--m3e-step-divider-inset, 0.5rem)); } :host(:not(:dir(rtl)):not(:state(-vertical))[label-position="end"]) ::slotted([slot="step"]:not(.-m3e-step-divider):not(:last-of-type))::after { left: calc(100% - var(--m3e-step-padding, 1.5rem) + var(--m3e-step-divider-inset, 0.5rem)); right: 0; } :host(:dir(rtl):not(:state(-vertical))[label-position="end"]) ::slotted([slot="step"]:not(.-m3e-step-divider):not(:last-of-type))::after { right: calc(100% - var(--m3e-step-padding, 1.5rem) + var(--m3e-step-divider-inset, 0.5rem)); left: 0; } :host(:not(:dir(rtl)):not(:state(-vertical))[label-position="below"]) ::slotted([slot="step"]:not(.-m3e-step-divider):not(:first-of-type))::before { left: 0; right: calc(50% + calc(var(--m3e-step-icon-size, 1.5rem) / 2) + var(--m3e-step-divider-inset, 0.5rem)); } :host(:dir(rtl):not(:state(-vertical))[label-position="below"]) ::slotted([slot="step"]:not(.-m3e-step-divider):not(:first-of-type))::before { right: 0; left: calc(50% + calc(var(--m3e-step-icon-size, 1.5rem) / 2) + var(--m3e-step-divider-inset, 0.5rem)); } :host(:not(:dir(rtl)):not(:state(-vertical))[label-position="below"]) ::slotted([slot="step"]:not(.-m3e-step-divider):not(:last-of-type))::after { left: calc(50% + calc(var(--m3e-step-icon-size, 1.5rem) / 2) + var(--m3e-step-divider-inset, 0.5rem)); right: 0; } :host(:dir(rtl):not(:state(-vertical))[label-position="below"]) ::slotted([slot="step"]:not(.-m3e-step-divider):not(:last-of-type))::after { right: calc(50% + calc(var(--m3e-step-icon-size, 1.5rem) / 2) + var(--m3e-step-divider-inset, 0.5rem)); left: 0; } :host(:not(:state(-vertical))[label-position="below"]) { --_step-direction: column; --_step-label-align-items: center; } :host(:state(-vertical)) .header { display: contents; } :host(:state(-vertical)) ::slotted([slot="step"]:not(.-m3e-step-divider)) { flex: none; } :host(:state(-vertical)) ::slotted([slot="step"]:not(.-m3e-step-divider):not(:first-of-type))::before, :host(:state(-vertical)) ::slotted([slot="step"]:not(.-m3e-step-divider):not(:last-of-type))::after { content: ""; display: block; position: absolute; left: 0; } :host(:state(-vertical)) ::slotted([slot="step"]:not(.-m3e-step-divider):not(:first-of-type))::before { top: 0; bottom: calc(100% - var(--m3e-step-padding, 1.5rem) + var(--m3e-step-divider-inset, 0.5rem)); } :host(:state(-vertical)) ::slotted([slot="step"]:not(.-m3e-step-divider):not(:last-of-type))::after { top: calc(100% - var(--m3e-step-padding, 1.5rem) + var(--m3e-step-divider-inset, 0.5rem)); bottom: 0; } :host(:not(:state(-vertical))) { --m3e-collapsible-animation-duration: 0ms; } :host(:state(-no-animate)) { --m3e-collapsible-animation-duration: 0ms; }`;
|
|
@@ -27722,7 +30144,7 @@ class TooltipElementBase extends HtmlFor$1(ReconnectedCallback$1(AttachInternals
|
|
|
27722
30144
|
position: this._anchorPosition,
|
|
27723
30145
|
inline: true,
|
|
27724
30146
|
flip: true,
|
|
27725
|
-
shift:
|
|
30147
|
+
shift: "main",
|
|
27726
30148
|
offset: TOOLTIP_OFFSET
|
|
27727
30149
|
}, (x, y) => this._updatePosition(this._base, x, y)), "f");
|
|
27728
30150
|
if (!_a.__openTooltips.includes(this)) {
|
|
@@ -28182,5 +30604,5 @@ M3eTooltipElement.styles = css`:host { display: contents; } .base { position: ab
|
|
|
28182
30604
|
__decorate([property()], M3eTooltipElement.prototype, "position", void 0);
|
|
28183
30605
|
M3eTooltipElement = __decorate([customElement$1("m3e-tooltip")], M3eTooltipElement);
|
|
28184
30606
|
|
|
28185
|
-
export { ActionElementBase, AnimationLoopController, AttachInternals, Checked, CheckedIndeterminate, ConstraintValidation, DesignToken, Dirty, Disabled, DisabledInteractive, EventAttribute, FocusController, Focusable, FormAssociated, FormSubmitter, HoverController, HtmlFor, IntersectionController, KeyboardClick, Labelled, LinkButton, LongPressController, M3eAccordionElement, M3eActionListElement, M3eAppBarElement, M3eAssistChipElement, M3eAutocompleteElement, M3eAvatarElement, M3eBadgeElement, M3eBottomSheetActionElement, M3eBottomSheetElement, M3eBottomSheetTriggerElement, M3eButtonElement, M3eButtonGroupElement, M3eButtonSegmentElement, M3eCardElement, M3eCheckboxElement, M3eChipElement, M3eChipSetElement, M3eCircularProgressIndicatorElement, M3eCollapsibleElement, M3eDialogActionElement, M3eDialogElement, M3eDialogTriggerElement, M3eDividerElement, M3eDrawerContainerElement, M3eDrawerToggleElement, M3eElevationElement, M3eExpandableListItemElement, M3eExpansionHeaderElement, M3eExpansionPanelElement, M3eFabElement, M3eFabMenuElement, M3eFabMenuItemElement, M3eFabMenuTriggerElement, M3eFilterChipElement, M3eFilterChipSetElement, M3eFocusRingElement, M3eFormFieldElement, M3eHeadingElement, M3eIconButtonElement, M3eIconElement, M3eInputChipElement, M3eInputChipSetElement, M3eLinearProgressIndicatorElement, M3eListActionElement, M3eListElement, M3eListItemButtonElement, M3eListItemElement, M3eListOptionElement, M3eLoadingIndicatorElement, M3eMenuElement, M3eMenuItemCheckboxElement, M3eMenuItemElement, M3eMenuItemGroupElement, M3eMenuItemRadioElement, M3eMenuTriggerElement, M3eNavBarElement, M3eNavItemElement, M3eNavMenuElement, M3eNavMenuItemElement, M3eNavMenuItemGroupElement, M3eNavRailElement, M3eNavRailToggleElement, M3eOptGroupElement, M3eOptionElement, M3eOptionPanelElement, M3ePaginatorElement, M3ePseudoCheckboxElement, M3ePseudoRadioElement, M3eRadioElement, M3eRadioGroupElement, M3eRichTooltipActionElement, M3eRichTooltipElement, M3eRippleElement, M3eScrollContainerElement, M3eSegmentedButtonElement, M3eSelectElement, M3eSelectionListElement, M3eShapeElement, M3eSlideElement, M3eSlideGroupElement, M3eSliderElement, M3eSliderThumbElement, M3eSnackbar, M3eSnackbarElement, M3eSplitButtonElement, M3eStateLayerElement, M3eStepElement, M3eStepPanelElement, M3eStepperElement, M3eStepperNextElement, M3eStepperPreviousElement, M3eStepperResetElement, M3eSuggestionChipElement, M3eSwitchElement, M3eTabElement, M3eTabPanelElement, M3eTabsElement, M3eTextHighlightElement, M3eTextOverflowElement, M3eTextareaAutosizeElement, M3eThemeElement, M3eTocElement, M3eTocItemElement, M3eToolbarElement, M3eTooltipElement, MutationController, PressedController, ProgressElementIndicatorBase, ReadOnly, ReconnectedCallback, Required, RequiredConstraintValidation, ResizeController, Role, ScrollController, ScrollLockController, Selected, StepperButtonElementBase, SuppressInitialAnimation, TocGenerator, TooltipElementBase, Touched, VelocityTracker, Vertical, addCustomState, checkOrSelect, computeCssSize, computeLineCount, customElement, debounce, defaultValue, deleteCustomState, findFormFieldControl, focusWhenReady, forcedColorsActive, formValue, generateClipPaths, getTextContent, guid, hasAssignedNodes, hasCustomState, hasKeys, interceptProperty, internals, isAttachInternalsMixin, isCheckedIndeterminateMixin, isCheckedMixin, isCheckedOrSelected, isCheckedOrSelectedMixin, isConstraintValidationMixin, isDirtyMixin, isDisabledInteractiveMixin, isDisabledMixin, isFormAssociatedMixin, isFormFieldControl, isFormSubmitterMixin, isHtmlForMixin, isLabelledMixin, isLinkButtonMixin, isReadOnlyMixin, isRequiredConstraintValidationMixin, isRequiredMixin, isSelectedMixin, isTouchedMixin, isVerticalMixin, prefersReducedMotion, renderPseudoLink, resolveElementById, resolveFragmentUrl, safeStyleMap, scrollIntoViewIfNeeded, setCustomState, spaceSeparatedStringConverter, updateLabels, validate };
|
|
30607
|
+
export { ActionElementBase, AnimationLoopController, AttachInternals, CalendarViewElementBase, Checked, CheckedIndeterminate, ConstraintValidation, DesignToken, Dirty, Disabled, DisabledInteractive, EventAttribute, FocusController, Focusable, FormAssociated, FormSubmitter, HoverController, HtmlFor, InertController, IntersectionController, KeyboardClick, Labelled, LinkButton, LongPressController, M3eAccordionElement, M3eActionListElement, M3eAppBarElement, M3eAssistChipElement, M3eAutocompleteElement, M3eAvatarElement, M3eBadgeElement, M3eBottomSheetActionElement, M3eBottomSheetElement, M3eBottomSheetTriggerElement, M3eButtonElement, M3eButtonGroupElement, M3eButtonSegmentElement, M3eCalendarElement, M3eCardElement, M3eCheckboxElement, M3eChipElement, M3eChipSetElement, M3eCircularProgressIndicatorElement, M3eCollapsibleElement, M3eDatepickerElement, M3eDatepickerToggleElement, M3eDialogActionElement, M3eDialogElement, M3eDialogTriggerElement, M3eDividerElement, M3eDrawerContainerElement, M3eDrawerToggleElement, M3eElevationElement, M3eExpandableListItemElement, M3eExpansionHeaderElement, M3eExpansionPanelElement, M3eFabElement, M3eFabMenuElement, M3eFabMenuItemElement, M3eFabMenuTriggerElement, M3eFilterChipElement, M3eFilterChipSetElement, M3eFocusRingElement, M3eFormFieldElement, M3eHeadingElement, M3eIconButtonElement, M3eIconElement, M3eInputChipElement, M3eInputChipSetElement, M3eLinearProgressIndicatorElement, M3eListActionElement, M3eListElement, M3eListItemButtonElement, M3eListItemElement, M3eListOptionElement, M3eLoadingIndicatorElement, M3eMenuElement, M3eMenuItemCheckboxElement, M3eMenuItemElement, M3eMenuItemGroupElement, M3eMenuItemRadioElement, M3eMenuTriggerElement, M3eMonthViewElement, M3eMultiYearViewElement, M3eNavBarElement, M3eNavItemElement, M3eNavMenuElement, M3eNavMenuItemElement, M3eNavMenuItemGroupElement, M3eNavRailElement, M3eNavRailToggleElement, M3eOptGroupElement, M3eOptionElement, M3eOptionPanelElement, M3ePaginatorElement, M3ePseudoCheckboxElement, M3ePseudoRadioElement, M3eRadioElement, M3eRadioGroupElement, M3eRichTooltipActionElement, M3eRichTooltipElement, M3eRippleElement, M3eScrollContainerElement, M3eSearchBarElement, M3eSearchViewElement, M3eSegmentedButtonElement, M3eSelectElement, M3eSelectionListElement, M3eShapeElement, M3eSlideElement, M3eSlideGroupElement, M3eSliderElement, M3eSliderThumbElement, M3eSnackbar, M3eSnackbarElement, M3eSplitButtonElement, M3eStateLayerElement, M3eStepElement, M3eStepPanelElement, M3eStepperElement, M3eStepperNextElement, M3eStepperPreviousElement, M3eStepperResetElement, M3eSuggestionChipElement, M3eSwitchElement, M3eTabElement, M3eTabPanelElement, M3eTabsElement, M3eTextHighlightElement, M3eTextOverflowElement, M3eTextareaAutosizeElement, M3eThemeElement, M3eTocElement, M3eTocItemElement, M3eToolbarElement, M3eTooltipElement, M3eYearViewElement, MutationController, PressedController, ProgressElementIndicatorBase, ReadOnly, ReconnectedCallback, Required, RequiredConstraintValidation, ResizeController, Role, ScrollController, ScrollLockController, Selected, StepperButtonElementBase, SuppressInitialAnimation, TocGenerator, TooltipElementBase, Touched, VelocityTracker, Vertical, addCustomState, checkOrSelect, computeCssSize, computeLineCount, customElement, dateConverter, debounce, defaultValue, deleteCustomState, findFormFieldControl, focusWhenReady, forcedColorsActive, formValue, generateClipPaths, getTextContent, guid, hasAssignedNodes, hasCustomState, hasKeys, interceptProperty, internals, isAttachInternalsMixin, isCheckedIndeterminateMixin, isCheckedMixin, isCheckedOrSelected, isCheckedOrSelectedMixin, isConstraintValidationMixin, isDirtyMixin, isDisabledInteractiveMixin, isDisabledMixin, isFormAssociatedMixin, isFormFieldControl, isFormSubmitterMixin, isHtmlForMixin, isLabelledMixin, isLinkButtonMixin, isReadOnlyMixin, isRequiredConstraintValidationMixin, isRequiredMixin, isSelectedMixin, isTouchedMixin, isVerticalMixin, prefersReducedMotion, registerStyleSheet, renderPseudoLink, resolveElementById, resolveFragmentUrl, safeStyleMap, scrollIntoViewIfNeeded, setCustomState, spaceSeparatedStringConverter, updateLabels, validate };
|
|
28186
30608
|
//# sourceMappingURL=all.js.map
|