@m3e/web 2.1.3 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -2
- package/dist/all.js +2916 -391
- 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 +59 -23
- 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 +1146 -646
- package/dist/custom-elements.json +31433 -26898
- package/dist/datepicker.js +573 -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/drawer-container.js +10 -4
- package/dist/drawer-container.js.map +1 -1
- package/dist/drawer-container.min.js +1 -1
- package/dist/drawer-container.min.js.map +1 -1
- package/dist/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 +553 -187
- 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-bar.js +17 -7
- package/dist/nav-bar.js.map +1 -1
- package/dist/nav-bar.min.js +1 -1
- package/dist/nav-bar.min.js.map +1 -1
- package/dist/nav-menu.js +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 +4 -8
- 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 +821 -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/segmented-button.js +2 -2
- package/dist/segmented-button.js.map +1 -1
- package/dist/segmented-button.min.js.map +1 -1
- package/dist/select.js +4 -15
- 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/split-button.js +1 -1
- package/dist/split-button.js.map +1 -1
- package/dist/split-button.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 +7 -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 +239 -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/drawer-container/DrawerContainerElement.d.ts +2 -2
- package/dist/src/drawer-container/DrawerContainerElement.d.ts.map +1 -1
- 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-bar/NavBarElement.d.ts +3 -1
- package/dist/src/nav-bar/NavBarElement.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 +150 -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/segmented-button/ButtonSegmentElement.d.ts +2 -2
- package/dist/src/select/SelectElement.d.ts.map +1 -1
- package/dist/src/snackbar/SnackbarElement.d.ts.map +1 -1
- package/dist/src/split-button/SplitButtonElement.d.ts +1 -1
- package/dist/src/stepper/StepperElement.d.ts +3 -1
- package/dist/src/stepper/StepperElement.d.ts.map +1 -1
- package/dist/src/switch/SwitchElement.d.ts +2 -2
- package/dist/stepper.js +18 -12
- package/dist/stepper.js.map +1 -1
- package/dist/stepper.min.js +1 -1
- package/dist/stepper.min.js.map +1 -1
- package/dist/switch.js +2 -2
- package/dist/switch.js.map +1 -1
- package/dist/switch.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_clearOptions, _M3eAutocompleteElement_announceResults, _M3eAutocompleteElement_autoActivate, _M3eAutocompleteElement_deactivateOption;
|
|
354
362
|
var M3eAutocompleteElement_1;
|
|
355
363
|
/**
|
|
356
364
|
* Enhances a text input with suggested options.
|
|
@@ -397,8 +405,9 @@ var M3eAutocompleteElement_1;
|
|
|
397
405
|
*
|
|
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.
|
|
408
|
+
* @fires change - Emitted when the committed value changes due to selecting an option or clearing the input.
|
|
400
409
|
*/
|
|
401
|
-
let M3eAutocompleteElement = M3eAutocompleteElement_1 = class M3eAutocompleteElement extends HtmlFor$1(LitElement) {
|
|
410
|
+
let M3eAutocompleteElement = M3eAutocompleteElement_1 = class M3eAutocompleteElement extends EventAttribute$1(HtmlFor$1(LitElement), "query") {
|
|
402
411
|
constructor() {
|
|
403
412
|
super();
|
|
404
413
|
_M3eAutocompleteElement_instances.add(this);
|
|
@@ -441,7 +450,7 @@ let M3eAutocompleteElement = M3eAutocompleteElement_1 = class M3eAutocompleteEle
|
|
|
441
450
|
/** @private */
|
|
442
451
|
_M3eAutocompleteElement_menuPointerDownHandler.set(this, e => __classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "m", _M3eAutocompleteElement_handleMenuPointerDown).call(this, e));
|
|
443
452
|
/** @private */
|
|
444
|
-
this._listKeyManager = new ListKeyManager().withWrap().withHomeAndEnd().withPageUpAndDown().withVerticalOrientation().withSkipPredicate(item => item.disabled || item.hidden).onActiveItemChange(() => {
|
|
453
|
+
this._listKeyManager = new ListKeyManager().withWrap().withHomeAndEnd().withPageUpAndDown().withVerticalOrientation().withSkipPredicate(item => item.disabled || item.hidden === true).onActiveItemChange(() => {
|
|
445
454
|
if (this._listKeyManager.activeItem) {
|
|
446
455
|
__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "m", _M3eAutocompleteElement_activateOption).call(this, this._listKeyManager.activeItem);
|
|
447
456
|
}
|
|
@@ -518,6 +527,15 @@ let M3eAutocompleteElement = M3eAutocompleteElement_1 = class M3eAutocompleteEle
|
|
|
518
527
|
get options() {
|
|
519
528
|
return this._options ?? [];
|
|
520
529
|
}
|
|
530
|
+
/** The selected option. */
|
|
531
|
+
get selected() {
|
|
532
|
+
return this.options.find(x => x.selected) ?? null;
|
|
533
|
+
}
|
|
534
|
+
/** The selected (enabled) value. */
|
|
535
|
+
get value() {
|
|
536
|
+
const selected = this.selected;
|
|
537
|
+
return selected && !selected.disabled ? selected.value : null;
|
|
538
|
+
}
|
|
521
539
|
/** @inheritdoc */
|
|
522
540
|
attach(control) {
|
|
523
541
|
if (!(control instanceof HTMLInputElement)) return;
|
|
@@ -557,6 +575,11 @@ let M3eAutocompleteElement = M3eAutocompleteElement_1 = class M3eAutocompleteEle
|
|
|
557
575
|
clear(restoreFocus = false) {
|
|
558
576
|
if (!__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_input_get)) return;
|
|
559
577
|
__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_input_get).value = "";
|
|
578
|
+
if (__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "m", _M3eAutocompleteElement_clearOptions).call(this)) {
|
|
579
|
+
this.dispatchEvent(new Event("change", {
|
|
580
|
+
bubbles: true
|
|
581
|
+
}));
|
|
582
|
+
}
|
|
560
583
|
__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "m", _M3eAutocompleteElement_filterOptions).call(this);
|
|
561
584
|
if (restoreFocus) {
|
|
562
585
|
__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_input_get).focus();
|
|
@@ -631,11 +654,7 @@ _M3eAutocompleteElement_hasLoadingSlot_get = function _M3eAutocompleteElement_ha
|
|
|
631
654
|
return (__classPrivateFieldGet(this, _M3eAutocompleteElement_clone, "f")?.querySelector("[slot='loading']") ?? null) !== null;
|
|
632
655
|
};
|
|
633
656
|
_M3eAutocompleteElement_shouldShowMenu_get = function _M3eAutocompleteElement_shouldShowMenu_get() {
|
|
634
|
-
return __classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_options_get).some(x =>
|
|
635
|
-
};
|
|
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`;
|
|
657
|
+
return __classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_options_get).some(x => x.hidden === false) || this.loading && !this.hideLoading && this.loadingLabel.length > 0 || !this.loading && !this.hideNoData && this.noDataLabel.length > 0;
|
|
639
658
|
};
|
|
640
659
|
_M3eAutocompleteElement_formField_get = function _M3eAutocompleteElement_formField_get() {
|
|
641
660
|
return this.control?.closest("m3e-form-field") ?? null;
|
|
@@ -715,6 +734,11 @@ _M3eAutocompleteElement_handleInput = function _M3eAutocompleteElement_handleInp
|
|
|
715
734
|
bubbles: true,
|
|
716
735
|
composed: true
|
|
717
736
|
}));
|
|
737
|
+
if (__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_input_get).value === "" && __classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "m", _M3eAutocompleteElement_clearOptions).call(this)) {
|
|
738
|
+
this.dispatchEvent(new Event("change", {
|
|
739
|
+
bubbles: true
|
|
740
|
+
}));
|
|
741
|
+
}
|
|
718
742
|
__classPrivateFieldSet(this, _M3eAutocompleteElement_inputChanged, true, "f");
|
|
719
743
|
try {
|
|
720
744
|
if (!__classPrivateFieldGet(this, _M3eAutocompleteElement_menu, "f")) {
|
|
@@ -731,8 +755,15 @@ _M3eAutocompleteElement_handleInput = function _M3eAutocompleteElement_handleInp
|
|
|
731
755
|
}
|
|
732
756
|
};
|
|
733
757
|
_M3eAutocompleteElement_handleChange = function _M3eAutocompleteElement_handleChange() {
|
|
734
|
-
if (__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_input_get)
|
|
735
|
-
|
|
758
|
+
if (__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_input_get)) {
|
|
759
|
+
const selected = this.selected;
|
|
760
|
+
if (this.required) {
|
|
761
|
+
__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_input_get).value = selected?.label ?? "";
|
|
762
|
+
} else if (selected && selected.label !== __classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_input_get).value && __classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "m", _M3eAutocompleteElement_clearOptions).call(this)) {
|
|
763
|
+
this.dispatchEvent(new Event("change", {
|
|
764
|
+
bubbles: true
|
|
765
|
+
}));
|
|
766
|
+
}
|
|
736
767
|
}
|
|
737
768
|
};
|
|
738
769
|
_M3eAutocompleteElement_handleKeyDown = function _M3eAutocompleteElement_handleKeyDown(e) {
|
|
@@ -838,6 +869,7 @@ _M3eAutocompleteElement_destroyMenu = function _M3eAutocompleteElement_destroyMe
|
|
|
838
869
|
__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_input_get).ariaExpanded = "false";
|
|
839
870
|
__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_input_get).removeAttribute("aria-controls");
|
|
840
871
|
__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_input_get).removeAttribute("aria-owns");
|
|
872
|
+
__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_input_get).removeAttribute("aria-activedescendant");
|
|
841
873
|
}
|
|
842
874
|
this.requestUpdate();
|
|
843
875
|
__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_formField_get)?.notifyControlStateChange();
|
|
@@ -845,6 +877,9 @@ _M3eAutocompleteElement_destroyMenu = function _M3eAutocompleteElement_destroyMe
|
|
|
845
877
|
oldState: e.oldState,
|
|
846
878
|
newState: e.newState
|
|
847
879
|
}));
|
|
880
|
+
if (__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_input_get)?.slot === "input" && __classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_input_get).parentElement?.tagName === "M3E-INPUT-CHIP-SET") {
|
|
881
|
+
__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "m", _M3eAutocompleteElement_clearOptions).call(this);
|
|
882
|
+
}
|
|
848
883
|
};
|
|
849
884
|
_M3eAutocompleteElement_showMenu = function _M3eAutocompleteElement_showMenu() {
|
|
850
885
|
if (__classPrivateFieldGet(this, _M3eAutocompleteElement_menu, "f") || !__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_input_get) || __classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_input_get).readOnly || __classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_input_get).disabled) return;
|
|
@@ -857,9 +892,9 @@ _M3eAutocompleteElement_showMenu = function _M3eAutocompleteElement_showMenu() {
|
|
|
857
892
|
__classPrivateFieldGet(this, _M3eAutocompleteElement_menu, "f").classList.add(klass);
|
|
858
893
|
}
|
|
859
894
|
}
|
|
860
|
-
__classPrivateFieldGet(this, _M3eAutocompleteElement_menu, "f").scrollStrategy = "reposition";
|
|
861
895
|
__classPrivateFieldGet(this, _M3eAutocompleteElement_menu, "f").style.overflowX = "hidden";
|
|
862
|
-
__classPrivateFieldGet(this, _M3eAutocompleteElement_menu, "f").
|
|
896
|
+
__classPrivateFieldGet(this, _M3eAutocompleteElement_menu, "f").scrollStrategy = "reposition";
|
|
897
|
+
__classPrivateFieldGet(this, _M3eAutocompleteElement_menu, "f").fitAnchorWidth = true;
|
|
863
898
|
__classPrivateFieldGet(this, _M3eAutocompleteElement_menu, "f").addEventListener("toggle", __classPrivateFieldGet(this, _M3eAutocompleteElement_menuToggleHandler, "f"));
|
|
864
899
|
__classPrivateFieldGet(this, _M3eAutocompleteElement_menu, "f").addEventListener("pointerdown", __classPrivateFieldGet(this, _M3eAutocompleteElement_menuPointerDownHandler, "f"));
|
|
865
900
|
__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "m", _M3eAutocompleteElement_projectClone).call(this);
|
|
@@ -897,7 +932,6 @@ _M3eAutocompleteElement_updateMenuState = function _M3eAutocompleteElement_updat
|
|
|
897
932
|
};
|
|
898
933
|
_M3eAutocompleteElement_hideMenu = function _M3eAutocompleteElement_hideMenu() {
|
|
899
934
|
__classPrivateFieldGet(this, _M3eAutocompleteElement_menu, "f")?.hide();
|
|
900
|
-
__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_input_get)?.removeAttribute("aria-activedescendant");
|
|
901
935
|
};
|
|
902
936
|
_M3eAutocompleteElement_activateOption = function _M3eAutocompleteElement_activateOption(option, forceFocusVisible = false) {
|
|
903
937
|
if (!__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_input_get)) return;
|
|
@@ -943,8 +977,11 @@ async function _M3eAutocompleteElement_selectOption(option) {
|
|
|
943
977
|
await this.updateComplete;
|
|
944
978
|
}
|
|
945
979
|
if (__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_input_get)) {
|
|
946
|
-
__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_input_get).value = option.
|
|
980
|
+
__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_input_get).value = option.label;
|
|
947
981
|
}
|
|
982
|
+
this.dispatchEvent(new Event("change", {
|
|
983
|
+
bubbles: true
|
|
984
|
+
}));
|
|
948
985
|
__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_formField_get)?.notifyControlStateChange(true);
|
|
949
986
|
};
|
|
950
987
|
_M3eAutocompleteElement_filterOption = function _M3eAutocompleteElement_filterOption(clone, option, term, exactTerm) {
|
|
@@ -972,7 +1009,7 @@ _M3eAutocompleteElement_filterOption = function _M3eAutocompleteElement_filterOp
|
|
|
972
1009
|
};
|
|
973
1010
|
_M3eAutocompleteElement_filterOptions = function _M3eAutocompleteElement_filterOptions() {
|
|
974
1011
|
if (!__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_input_get)) return 0;
|
|
975
|
-
const oldCount = __classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_options_get).filter(x =>
|
|
1012
|
+
const oldCount = __classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_options_get).filter(x => x.hidden === false).length;
|
|
976
1013
|
const shouldAnnounce = !this.loading && __classPrivateFieldGet(this, _M3eAutocompleteElement_inputChanged, "f");
|
|
977
1014
|
__classPrivateFieldSet(this, _M3eAutocompleteElement_inputChanged, false, "f");
|
|
978
1015
|
const exactTerm = __classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_input_get).value;
|
|
@@ -984,7 +1021,7 @@ _M3eAutocompleteElement_filterOptions = function _M3eAutocompleteElement_filterO
|
|
|
984
1021
|
const clone = __classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_options_get)[i];
|
|
985
1022
|
const option = this._options[i];
|
|
986
1023
|
clone.hidden = !__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "m", _M3eAutocompleteElement_filterOption).call(this, clone, option, term, exactTerm);
|
|
987
|
-
if (clone.hidden) {
|
|
1024
|
+
if (clone.hidden === true) {
|
|
988
1025
|
__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "m", _M3eAutocompleteElement_deactivateOption).call(this, clone);
|
|
989
1026
|
deleteCustomState$1(clone, "-first");
|
|
990
1027
|
deleteCustomState$1(clone, "-last");
|
|
@@ -1004,17 +1041,13 @@ _M3eAutocompleteElement_filterOptions = function _M3eAutocompleteElement_filterO
|
|
|
1004
1041
|
last = clone;
|
|
1005
1042
|
}
|
|
1006
1043
|
}
|
|
1007
|
-
if (clone.selected && option.value !== exactTerm) {
|
|
1008
|
-
clone.selected = false;
|
|
1009
|
-
__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "m", _M3eAutocompleteElement_updateSelectionState).call(this, clone);
|
|
1010
|
-
}
|
|
1011
1044
|
}
|
|
1012
1045
|
if (__classPrivateFieldGet(this, _M3eAutocompleteElement_menu, "f")) {
|
|
1013
1046
|
__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "m", _M3eAutocompleteElement_updateMenuState).call(this, __classPrivateFieldGet(this, _M3eAutocompleteElement_menu, "f"), newCount);
|
|
1014
1047
|
}
|
|
1015
1048
|
const groups = __classPrivateFieldGet(this, _M3eAutocompleteElement_menu, "f")?.querySelectorAll("m3e-optgroup") ?? __classPrivateFieldGet(this, _M3eAutocompleteElement_clone, "f")?.querySelectorAll("m3e-optgroup") ?? [];
|
|
1016
1049
|
for (const group of groups) {
|
|
1017
|
-
group.hidden = [...group.querySelectorAll("m3e-option")].every(x => x.hidden);
|
|
1050
|
+
group.hidden = [...group.querySelectorAll("m3e-option")].every(x => x.hidden === true);
|
|
1018
1051
|
}
|
|
1019
1052
|
if (shouldAnnounce) {
|
|
1020
1053
|
__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "m", _M3eAutocompleteElement_announceResults).call(this, oldCount, newCount);
|
|
@@ -1022,6 +1055,17 @@ _M3eAutocompleteElement_filterOptions = function _M3eAutocompleteElement_filterO
|
|
|
1022
1055
|
__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "m", _M3eAutocompleteElement_autoActivate).call(this);
|
|
1023
1056
|
return newCount;
|
|
1024
1057
|
};
|
|
1058
|
+
_M3eAutocompleteElement_clearOptions = function _M3eAutocompleteElement_clearOptions() {
|
|
1059
|
+
const selected = this._listKeyManager.items.filter(x => x.selected);
|
|
1060
|
+
if (selected.length > 0) {
|
|
1061
|
+
selected.forEach(x => {
|
|
1062
|
+
x.selected = false;
|
|
1063
|
+
__classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "m", _M3eAutocompleteElement_updateSelectionState).call(this, x);
|
|
1064
|
+
});
|
|
1065
|
+
return true;
|
|
1066
|
+
}
|
|
1067
|
+
return false;
|
|
1068
|
+
};
|
|
1025
1069
|
_M3eAutocompleteElement_announceResults = function _M3eAutocompleteElement_announceResults(oldCount, newCount) {
|
|
1026
1070
|
if (!__classPrivateFieldGet(this, _M3eAutocompleteElement_hasFocus, "f")) return;
|
|
1027
1071
|
if (newCount == 0) {
|
|
@@ -1037,7 +1081,7 @@ _M3eAutocompleteElement_announceResults = function _M3eAutocompleteElement_annou
|
|
|
1037
1081
|
};
|
|
1038
1082
|
_M3eAutocompleteElement_autoActivate = function _M3eAutocompleteElement_autoActivate() {
|
|
1039
1083
|
if (this.autoActivate && (!this._listKeyManager.activeItem || !this._listKeyManager.activeItem.selected)) {
|
|
1040
|
-
const option = __classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_options_get).find(x => !x.disabled &&
|
|
1084
|
+
const option = __classPrivateFieldGet(this, _M3eAutocompleteElement_instances, "a", _M3eAutocompleteElement_options_get).find(x => !x.disabled && x.hidden === false);
|
|
1041
1085
|
if (option) {
|
|
1042
1086
|
this._listKeyManager.setActiveItem(option);
|
|
1043
1087
|
if (__classPrivateFieldGet(this, _M3eAutocompleteElement_menu, "f")) {
|
|
@@ -1343,7 +1387,7 @@ let M3eBottomSheetActionElement = class M3eBottomSheetActionElement extends Acti
|
|
|
1343
1387
|
};
|
|
1344
1388
|
M3eBottomSheetActionElement = __decorate([customElement$1("m3e-bottom-sheet-action")], M3eBottomSheetActionElement);
|
|
1345
1389
|
|
|
1346
|
-
var _M3eBottomSheetElement_instances, _M3eBottomSheetElement_documentClickHandler, _M3eBottomSheetElement_documentKeyDownHandler, _M3eBottomSheetElement_windowResizeHandler,
|
|
1390
|
+
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
1391
|
var M3eBottomSheetElement_1;
|
|
1348
1392
|
/**
|
|
1349
1393
|
* A sheet used to show secondary content anchored to the bottom of the screen.
|
|
@@ -1453,12 +1497,12 @@ let M3eBottomSheetElement = M3eBottomSheetElement_1 = class M3eBottomSheetElemen
|
|
|
1453
1497
|
/** @private */
|
|
1454
1498
|
_M3eBottomSheetElement_windowResizeHandler.set(this, () => __classPrivateFieldGet(this, _M3eBottomSheetElement_instances, "m", _M3eBottomSheetElement_handleWindowResize).call(this));
|
|
1455
1499
|
/** @private */
|
|
1456
|
-
_M3eBottomSheetElement_inerts.set(this, new Array());
|
|
1457
|
-
/** @private */
|
|
1458
1500
|
_M3eBottomSheetElement_velocityTracker.set(this, new VelocityTracker$1());
|
|
1459
1501
|
/** @private */
|
|
1460
1502
|
_M3eBottomSheetElement_scrollLockController.set(this, new ScrollLockController$1(this));
|
|
1461
1503
|
/** @private */
|
|
1504
|
+
_M3eBottomSheetElement_inertController.set(this, new InertController$1(this));
|
|
1505
|
+
/** @private */
|
|
1462
1506
|
_M3eBottomSheetElement_resizeController.set(this, new ResizeController$1(this, {
|
|
1463
1507
|
target: null,
|
|
1464
1508
|
skipInitial: true,
|
|
@@ -1628,7 +1672,7 @@ let M3eBottomSheetElement = M3eBottomSheetElement_1 = class M3eBottomSheetElemen
|
|
|
1628
1672
|
if (this.modal) {
|
|
1629
1673
|
if (this.open) {
|
|
1630
1674
|
__classPrivateFieldSet(this, _M3eBottomSheetElement_trigger, document.activeElement, "f");
|
|
1631
|
-
__classPrivateFieldGet(this,
|
|
1675
|
+
__classPrivateFieldGet(this, _M3eBottomSheetElement_inertController, "f").lock();
|
|
1632
1676
|
__classPrivateFieldGet(this, _M3eBottomSheetElement_scrollLockController, "f").lock();
|
|
1633
1677
|
this.showPopover();
|
|
1634
1678
|
requestAnimationFrame(() => {
|
|
@@ -1644,7 +1688,7 @@ let M3eBottomSheetElement = M3eBottomSheetElement_1 = class M3eBottomSheetElemen
|
|
|
1644
1688
|
}
|
|
1645
1689
|
} else {
|
|
1646
1690
|
__classPrivateFieldGet(this, _M3eBottomSheetElement_instances, "m", _M3eBottomSheetElement_snapToHeight).call(this, 0).then(() => {
|
|
1647
|
-
__classPrivateFieldGet(this,
|
|
1691
|
+
__classPrivateFieldGet(this, _M3eBottomSheetElement_inertController, "f").unlock();
|
|
1648
1692
|
__classPrivateFieldGet(this, _M3eBottomSheetElement_scrollLockController, "f").unlock();
|
|
1649
1693
|
document.removeEventListener("click", __classPrivateFieldGet(this, _M3eBottomSheetElement_documentClickHandler, "f"));
|
|
1650
1694
|
document.removeEventListener("keydown", __classPrivateFieldGet(this, _M3eBottomSheetElement_documentKeyDownHandler, "f"));
|
|
@@ -1667,9 +1711,9 @@ let M3eBottomSheetElement = M3eBottomSheetElement_1 = class M3eBottomSheetElemen
|
|
|
1667
1711
|
_M3eBottomSheetElement_documentClickHandler = new WeakMap();
|
|
1668
1712
|
_M3eBottomSheetElement_documentKeyDownHandler = new WeakMap();
|
|
1669
1713
|
_M3eBottomSheetElement_windowResizeHandler = new WeakMap();
|
|
1670
|
-
_M3eBottomSheetElement_inerts = new WeakMap();
|
|
1671
1714
|
_M3eBottomSheetElement_velocityTracker = new WeakMap();
|
|
1672
1715
|
_M3eBottomSheetElement_scrollLockController = new WeakMap();
|
|
1716
|
+
_M3eBottomSheetElement_inertController = new WeakMap();
|
|
1673
1717
|
_M3eBottomSheetElement_resizeController = new WeakMap();
|
|
1674
1718
|
_M3eBottomSheetElement_trigger = new WeakMap();
|
|
1675
1719
|
_M3eBottomSheetElement_dragState = new WeakMap();
|
|
@@ -1978,27 +2022,8 @@ _M3eBottomSheetElement_updateHeight = function _M3eBottomSheetElement_updateHeig
|
|
|
1978
2022
|
content.inert = height <= __classPrivateFieldGet(this, _M3eBottomSheetElement_instances, "m", _M3eBottomSheetElement_computePeekHeight).call(this);
|
|
1979
2023
|
}
|
|
1980
2024
|
};
|
|
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
2025
|
(() => {
|
|
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
|
-
}
|
|
2026
|
+
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
2027
|
})();
|
|
2003
2028
|
/** The styles of the element. */
|
|
2004
2029
|
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,187 +3637,1251 @@ __decorate([queryAssignedElements({
|
|
|
3612
3637
|
})], M3eButtonGroupElement.prototype, "buttons", void 0);
|
|
3613
3638
|
M3eButtonGroupElement = __decorate([customElement$1("m3e-button-group")], M3eButtonGroupElement);
|
|
3614
3639
|
|
|
3615
|
-
/**
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3640
|
+
/** @private */
|
|
3641
|
+
function createDateWithOverflow(year, month, day) {
|
|
3642
|
+
const date = new Date();
|
|
3643
|
+
date.setFullYear(year, month, day);
|
|
3644
|
+
date.setHours(0, 0, 0, 0);
|
|
3645
|
+
return date;
|
|
3646
|
+
}
|
|
3647
|
+
/** @private */
|
|
3648
|
+
function getStartingYear(minDate, maxDate) {
|
|
3649
|
+
if (maxDate) {
|
|
3650
|
+
return maxDate.getFullYear() - YEARS_PER_PAGE + 1;
|
|
3651
|
+
} else if (minDate) {
|
|
3652
|
+
return minDate.getFullYear();
|
|
3653
|
+
}
|
|
3654
|
+
return 0;
|
|
3655
|
+
}
|
|
3656
|
+
/** @private */
|
|
3657
|
+
function euclideanModulo(a, b) {
|
|
3658
|
+
return (a % b + b) % b;
|
|
3659
|
+
}
|
|
3660
|
+
/** @internal */
|
|
3661
|
+
function addCalendarDays(date, days) {
|
|
3662
|
+
return createDateWithOverflow(date.getFullYear(), date.getMonth(), date.getDate() + days);
|
|
3663
|
+
}
|
|
3664
|
+
/** @internal */
|
|
3665
|
+
function addCalendarMonths(date, months) {
|
|
3666
|
+
let newDate = createDateWithOverflow(date.getFullYear(), date.getMonth() + months, date.getDate());
|
|
3667
|
+
if (newDate.getMonth() != ((date.getMonth() + months) % 12 + 12) % 12) {
|
|
3668
|
+
newDate = createDateWithOverflow(newDate.getFullYear(), newDate.getMonth(), 0);
|
|
3669
|
+
}
|
|
3670
|
+
return newDate;
|
|
3671
|
+
}
|
|
3672
|
+
/** @internal */
|
|
3673
|
+
function addCalendarYears(date, years) {
|
|
3674
|
+
return addCalendarMonths(date, years * 12);
|
|
3675
|
+
}
|
|
3676
|
+
/** @internal */
|
|
3677
|
+
function getNumDaysInMonth(date) {
|
|
3678
|
+
return createDateWithOverflow(date.getFullYear(), date.getMonth() + 1, 0).getDate();
|
|
3679
|
+
}
|
|
3680
|
+
/** @internal */
|
|
3681
|
+
function compareDate(first, second) {
|
|
3682
|
+
return first.getFullYear() - second.getFullYear() || first.getMonth() - second.getMonth() || first.getDate() - second.getDate();
|
|
3683
|
+
}
|
|
3684
|
+
/** @internal */
|
|
3685
|
+
function sameDate(first, second) {
|
|
3686
|
+
return first && second ? compareDate(first, second) == 0 : first == second;
|
|
3687
|
+
}
|
|
3688
|
+
/** @internal */
|
|
3689
|
+
function getActiveOffset(activeDate, minDate, maxDate) {
|
|
3690
|
+
return euclideanModulo(activeDate.getFullYear() - getStartingYear(minDate, maxDate), YEARS_PER_PAGE);
|
|
3691
|
+
}
|
|
3692
|
+
/** @internal */
|
|
3693
|
+
function minYearOfPage(activeDate, minDate, maxDate) {
|
|
3694
|
+
return activeDate.getFullYear() - getActiveOffset(activeDate, minDate, maxDate);
|
|
3695
|
+
}
|
|
3696
|
+
/** @internal */
|
|
3697
|
+
function maxYearOfPage(activeDate, minDate, maxDate) {
|
|
3698
|
+
return minYearOfPage(activeDate, minDate, maxDate) + YEARS_PER_PAGE - 1;
|
|
3699
|
+
}
|
|
3700
|
+
/** @internal */
|
|
3701
|
+
function clampDate(date, minDate, maxDate) {
|
|
3702
|
+
if (minDate && compareDate(date, minDate) < 0) return minDate;
|
|
3703
|
+
if (maxDate && compareDate(date, maxDate) > 0) return maxDate;
|
|
3704
|
+
return date;
|
|
3705
|
+
}
|
|
3706
|
+
/** @internal */
|
|
3707
|
+
const YEARS_PER_PAGE = 15;
|
|
3708
|
+
/** @internal */
|
|
3709
|
+
const YEARS_PER_ROW = 3;
|
|
3710
|
+
/** @internal */
|
|
3711
|
+
const MONTHS_PER_ROW = 4;
|
|
3623
3712
|
|
|
3624
3713
|
/**
|
|
3625
|
-
*
|
|
3714
|
+
* A base implementation for a view in a calendar. This class must be inherited.
|
|
3626
3715
|
* @internal
|
|
3627
3716
|
*/
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
focus: {
|
|
3650
|
-
textColor: unsafeCSS(`var(--m3e-filled-card-focus-text-color, var(--m3e-card-focus-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
3651
|
-
stateLayerColor: unsafeCSS(`var(--m3e-filled-card-focus-state-layer-color, var(--m3e-card-focus-state-layer-color, ${DesignToken$1.color.onSurface}))`),
|
|
3652
|
-
stateLayerOpacity: unsafeCSS(`var(--m3e-filled-card-focus-state-layer-opacity, var(--m3e-card-focus-state-layer-opacity, ${DesignToken$1.state.focusStateLayerOpacity}))`),
|
|
3653
|
-
containerElevation: unsafeCSS(`var(--m3e-filled-card-focus-container-elevation, var(--m3e-card-focus-container-elevation, ${DesignToken$1.elevation.level0}))`)
|
|
3654
|
-
},
|
|
3655
|
-
pressed: {
|
|
3656
|
-
textColor: unsafeCSS(`var(--m3e-filled-card-pressed-text-color, var(--m3e-card-pressed-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
3657
|
-
stateLayerColor: unsafeCSS(`var(--m3e-filled-card-pressed-state-layer-color, var(--m3e-card-pressed-state-layer-color, ${DesignToken$1.color.onSurface}))`),
|
|
3658
|
-
stateLayerOpacity: unsafeCSS(`var(--m3e-filled-card-pressed-state-layer-opacity, var(--m3e-card-pressed-state-layer-opacity, ${DesignToken$1.state.pressedStateLayerOpacity}))`),
|
|
3659
|
-
containerElevation: unsafeCSS(`var(--m3e-filled-card-pressed-container-elevation, var(--m3e-card-pressed-container-elevation, ${DesignToken$1.elevation.level0}))`)
|
|
3717
|
+
class CalendarViewElementBase extends LitElement {
|
|
3718
|
+
constructor() {
|
|
3719
|
+
super(...arguments);
|
|
3720
|
+
/** Today's date. */
|
|
3721
|
+
this.today = new Date();
|
|
3722
|
+
/** The selected date. */
|
|
3723
|
+
this.date = null;
|
|
3724
|
+
/** The active date. */
|
|
3725
|
+
this.activeDate = new Date();
|
|
3726
|
+
/** The minimum date that can be selected. */
|
|
3727
|
+
this.minDate = null;
|
|
3728
|
+
/** The maximum date that can be selected. */
|
|
3729
|
+
this.maxDate = null;
|
|
3730
|
+
}
|
|
3731
|
+
/**
|
|
3732
|
+
* Asynchronously focuses the active date.
|
|
3733
|
+
* @returns {Promise<void>} A promise that resolves after the active date has been focused.
|
|
3734
|
+
*/
|
|
3735
|
+
async focusActiveCell() {
|
|
3736
|
+
if (this.isUpdatePending) {
|
|
3737
|
+
await this.updateComplete;
|
|
3660
3738
|
}
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
textColor: unsafeCSS(`var(--m3e-elevated-card-text-color, var(--m3e-card-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
3664
|
-
containerColor: unsafeCSS(`var(--m3e-elevated-card-container-color, var(--m3e-card-container-color, ${DesignToken$1.color.surfaceContainerLow}))`),
|
|
3665
|
-
containerElevation: unsafeCSS(`var(--m3e-elevated-card-container-elevation, var(--m3e-card-container-elevation, ${DesignToken$1.elevation.level1}))`),
|
|
3666
|
-
disabled: {
|
|
3667
|
-
textColor: unsafeCSS(`var(--m3e-elevated-card-disabled-text-color, var(--m3e-card-disabled-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
3668
|
-
textOpacity: unsafeCSS(`var(--m3e-elevated-card-disabled-text-opacity, var(--m3e-card-disabled-text-opacity, 38%))`),
|
|
3669
|
-
imageOpacity: unsafeCSS(`var(--m3e-elevated-card-disabled-image-opacity, var(--m3e-card-disabled-image-opacity, 38%))`),
|
|
3670
|
-
containerColor: unsafeCSS(`var(--m3e-elevated-card-disabled-container-color, var(--m3e-card-disabled-container-color, ${DesignToken$1.color.surface}))`),
|
|
3671
|
-
containerElevation: unsafeCSS(`var(--m3e-elevated-card-disabled-container-elevation, var(--m3e-card-disabled-container-elevation, ${DesignToken$1.elevation.level1}))`),
|
|
3672
|
-
containerElevationColor: unsafeCSS(`var(--m3e-elevated-card-disabled-container-elevation-color, var(--m3e-card-disabled-container-elevation-color, ${DesignToken$1.color.onSurface}))`),
|
|
3673
|
-
containerElevationOpacity: unsafeCSS(`var(--m3e-elevated-card-disabled-container-elevation-opacity, var(--m3e-card-disabled-container-elevation-opacity, 38%))`),
|
|
3674
|
-
containerOpacity: unsafeCSS(`var(--m3e-elevated-card-disabled-container-opacity, var(--m3e-card-disabled-container-opacity, 38%))`)
|
|
3675
|
-
},
|
|
3676
|
-
hover: {
|
|
3677
|
-
textColor: unsafeCSS(`var(--m3e-elevated-card-hover-text-color, var(--m3e-card-hover-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
3678
|
-
stateLayerColor: unsafeCSS(`var(--m3e-elevated-card-hover-state-layer-color, var(--m3e-card-hover-state-layer-color, ${DesignToken$1.color.onSurface}))`),
|
|
3679
|
-
stateLayerOpacity: unsafeCSS(`var(--m3e-elevated-card-hover-state-layer-opacity, var(--m3e-card-hover-state-layer-opacity, ${DesignToken$1.state.hoverStateLayerOpacity}))`),
|
|
3680
|
-
containerElevation: unsafeCSS(`var(--m3e-elevated-card-hover-container-elevation, var(--m3e-card-hover-container-elevation, ${DesignToken$1.elevation.level2}))`)
|
|
3681
|
-
},
|
|
3682
|
-
focus: {
|
|
3683
|
-
textColor: unsafeCSS(`var(--m3e-elevated-card-focus-text-color, var(--m3e-card-focus-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
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}))`)
|
|
3739
|
+
if (this._activeItem) {
|
|
3740
|
+
await focusWhenReady$1(this._activeItem);
|
|
3693
3741
|
}
|
|
3694
|
-
}
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
containerElevationColor: unsafeCSS(`var(--m3e-outlined-card-disabled-container-elevation-color, var(--m3e-card-disabled-container-elevation-color, ${DesignToken$1.color.onSurface}))`),
|
|
3707
|
-
containerElevationOpacity: unsafeCSS(`var(--m3e-outlined-card-disabled-container-elevation-opacity, var(--m3e-card-disabled-container-elevation-opacity, 38%))`),
|
|
3708
|
-
outlineColor: unsafeCSS(`var(--m3e-outlined-card-disabled-outline-color, var(--m3e-card-disabled-outline-color, ${DesignToken$1.color.outline}))`),
|
|
3709
|
-
outlineOpacity: unsafeCSS(`var(--m3e-outlined-card-disabled-outline-opacity, var(--m3e-card-disabled-outline-opacity, 12%))`)
|
|
3710
|
-
},
|
|
3711
|
-
hover: {
|
|
3712
|
-
textColor: unsafeCSS(`var(--m3e-outlined-card-hover-text-color, var(--m3e-card-hover-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
3713
|
-
stateLayerColor: unsafeCSS(`var(--m3e-outlined-card-hover-state-layer-color, var(--m3e-card-hover-state-layer-color, ${DesignToken$1.color.onSurface}))`),
|
|
3714
|
-
stateLayerOpacity: unsafeCSS(`var(--m3e-outlined-card-hover-state-layer-opacity, var(--m3e-card-hover-state-layer-opacity, ${DesignToken$1.state.hoverStateLayerOpacity}))`),
|
|
3715
|
-
containerElevation: unsafeCSS(`var(--m3e-outlined-card-hover-container-elevation, var(--m3e-card-hover-container-elevation, ${DesignToken$1.elevation.level1}))`),
|
|
3716
|
-
outlineColor: unsafeCSS(`var(--m3e-outlined-card-hover-outline-color, var(--m3e-card-hover-outline-color, ${DesignToken$1.color.outlineVariant}))`)
|
|
3717
|
-
},
|
|
3718
|
-
focus: {
|
|
3719
|
-
textColor: unsafeCSS(`var(--m3e-outlined-card-focus-text-color, var(--m3e-card-focus-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
3720
|
-
stateLayerColor: unsafeCSS(`var(--m3e-outlined-card-focus-state-layer-color, var(--m3e-card-focus-state-layer-color, ${DesignToken$1.color.onSurface}))`),
|
|
3721
|
-
stateLayerOpacity: unsafeCSS(`var(--m3e-outlined-card-focus-state-layer-opacity, var(--m3e-card-focus-state-layer-opacity, ${DesignToken$1.state.focusStateLayerOpacity}))`),
|
|
3722
|
-
containerElevation: unsafeCSS(`var(--m3e-outlined-card-focus-container-elevation, var(--m3e-card-focus-container-elevation, ${DesignToken$1.elevation.level0}))`),
|
|
3723
|
-
outlineColor: unsafeCSS(`var(--m3e-outlined-card-focus-outline-color, var(--m3e-card-focus-outline-color, ${DesignToken$1.color.onSurface}))`)
|
|
3724
|
-
},
|
|
3725
|
-
pressed: {
|
|
3726
|
-
textColor: unsafeCSS(`var(--m3e-outlined-card-pressed-text-color, var(--m3e-card-pressed-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
3727
|
-
stateLayerColor: unsafeCSS(`var(--m3e-outlined-card-pressed-state-layer-color, var(--m3e-card-pressed-state-layer-color, ${DesignToken$1.color.onSurface}))`),
|
|
3728
|
-
stateLayerOpacity: unsafeCSS(`var(--m3e-outlined-card-pressed-state-layer-opacity, var(--m3e-card-pressed-state-layer-opacity, ${DesignToken$1.state.pressedStateLayerOpacity}))`),
|
|
3729
|
-
containerElevation: unsafeCSS(`var(--m3e-outlined-card-pressed-container-elevation, var(--m3e-card-pressed-container-elevation, ${DesignToken$1.elevation.level0}))`),
|
|
3730
|
-
outlineColor: unsafeCSS(`var(--m3e-outlined-card-pressed-outline-color, var(--m3e-card-pressed-outline-color, ${DesignToken$1.color.outlineVariant}))`)
|
|
3742
|
+
}
|
|
3743
|
+
/** @internal */
|
|
3744
|
+
_changeActiveDate(activeDate) {
|
|
3745
|
+
activeDate = clampDate(activeDate, this.minDate, this.maxDate);
|
|
3746
|
+
if (!sameDate(activeDate, this.activeDate)) {
|
|
3747
|
+
this._activeItem?.style.setProperty("--m3e-state-layer-duration", "0ms");
|
|
3748
|
+
this._activeItem?.blur();
|
|
3749
|
+
this._activeItem?.style.removeProperty("--m3e-state-layer-duration");
|
|
3750
|
+
this.activeDate = activeDate;
|
|
3751
|
+
this.dispatchEvent(new Event("active-change", {
|
|
3752
|
+
bubbles: false
|
|
3753
|
+
}));
|
|
3731
3754
|
}
|
|
3732
3755
|
}
|
|
3733
|
-
}
|
|
3756
|
+
}
|
|
3757
|
+
/** The styles of the element. */
|
|
3758
|
+
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; } }`;
|
|
3759
|
+
__decorate([query(".active > .item")], CalendarViewElementBase.prototype, "_activeItem", void 0);
|
|
3760
|
+
__decorate([property({
|
|
3761
|
+
converter: dateConverter$1
|
|
3762
|
+
})], CalendarViewElementBase.prototype, "today", void 0);
|
|
3763
|
+
__decorate([property({
|
|
3764
|
+
converter: dateConverter$1
|
|
3765
|
+
})], CalendarViewElementBase.prototype, "date", void 0);
|
|
3766
|
+
__decorate([property({
|
|
3767
|
+
attribute: "active-date",
|
|
3768
|
+
converter: dateConverter$1
|
|
3769
|
+
})], CalendarViewElementBase.prototype, "activeDate", void 0);
|
|
3770
|
+
__decorate([property({
|
|
3771
|
+
attribute: "min-date",
|
|
3772
|
+
converter: dateConverter$1
|
|
3773
|
+
})], CalendarViewElementBase.prototype, "minDate", void 0);
|
|
3774
|
+
__decorate([property({
|
|
3775
|
+
attribute: "max-date",
|
|
3776
|
+
converter: dateConverter$1
|
|
3777
|
+
})], CalendarViewElementBase.prototype, "maxDate", void 0);
|
|
3734
3778
|
|
|
3735
3779
|
/**
|
|
3736
|
-
*
|
|
3737
|
-
*
|
|
3780
|
+
* Adapted from Angular Material Datepicker
|
|
3781
|
+
* Source: https://github.com/angular/components/blob/main/src/material/datepicker/month-view.ts
|
|
3782
|
+
*
|
|
3783
|
+
* @license MIT
|
|
3784
|
+
* Copyright (c) 2025 Google LLC
|
|
3785
|
+
* See LICENSE file in the project root for full license text.
|
|
3738
3786
|
*/
|
|
3739
|
-
|
|
3740
|
-
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; } }`;
|
|
3741
|
-
|
|
3742
|
-
/** @private */
|
|
3743
|
-
function cardVariantStyle(variant) {
|
|
3744
|
-
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(
|
|
3745
|
-
in srgb,
|
|
3746
|
-
${CardVariantToken[variant].disabled.containerColor} ${CardVariantToken[variant].disabled.containerOpacity},
|
|
3747
|
-
transparent
|
|
3748
|
-
)`) : unsafeCSS("unset")}; border-color: ${CardVariantToken[variant].disabled.outlineColor && CardVariantToken[variant].disabled.outlineOpacity ? unsafeCSS(`color-mix(
|
|
3749
|
-
in srgb,
|
|
3750
|
-
${CardVariantToken[variant].disabled.outlineColor} ${CardVariantToken[variant].disabled.outlineOpacity},
|
|
3751
|
-
transparent
|
|
3752
|
-
)`) : 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
|
-
}
|
|
3787
|
+
var _M3eMonthViewElement_instances, _M3eMonthViewElement_renderItem, _M3eMonthViewElement_handleItemClick, _M3eMonthViewElement_handleItemKeyDown, _M3eMonthViewElement_handleItemMouseEnter, _M3eMonthViewElement_handleItemFocus, _M3eMonthViewElement_setRangeHighlight, _M3eMonthViewElement_clearRangeHighlight;
|
|
3754
3788
|
/**
|
|
3755
|
-
*
|
|
3789
|
+
* An internal component used to display a single month in a calendar.
|
|
3756
3790
|
* @internal
|
|
3757
3791
|
*/
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3792
|
+
let M3eMonthViewElement = class M3eMonthViewElement extends CalendarViewElementBase {
|
|
3793
|
+
constructor() {
|
|
3794
|
+
super(...arguments);
|
|
3795
|
+
_M3eMonthViewElement_instances.add(this);
|
|
3796
|
+
/** @internal */
|
|
3797
|
+
this._suppressFocusHighlight = true;
|
|
3798
|
+
/** Start of a date range. */
|
|
3799
|
+
this.rangeStart = null;
|
|
3800
|
+
/** End of a date range. */
|
|
3801
|
+
this.rangeEnd = null;
|
|
3802
|
+
/** A function used to determine whether a date cannot be selected. */
|
|
3803
|
+
this.blackoutDates = null;
|
|
3804
|
+
/** A function used to determine whether a date is special. */
|
|
3805
|
+
this.specialDates = null;
|
|
3806
|
+
}
|
|
3807
|
+
/** @inheritdoc */
|
|
3808
|
+
render() {
|
|
3809
|
+
const date = new Date(this.today);
|
|
3810
|
+
date.setDate(1);
|
|
3811
|
+
while (date.getDay() != 0) {
|
|
3812
|
+
date.setDate(date.getDate() + 1);
|
|
3813
|
+
}
|
|
3814
|
+
const weekdays = new Array();
|
|
3815
|
+
const narrowFormat = new Intl.DateTimeFormat(navigator.language, {
|
|
3816
|
+
weekday: "narrow"
|
|
3817
|
+
});
|
|
3818
|
+
const longFormat = new Intl.DateTimeFormat(navigator.language, {
|
|
3819
|
+
weekday: "long"
|
|
3820
|
+
});
|
|
3821
|
+
for (let i = 0; i < 7; i++) {
|
|
3822
|
+
weekdays.push({
|
|
3823
|
+
id: i,
|
|
3824
|
+
narrow: narrowFormat.format(date),
|
|
3825
|
+
long: longFormat.format(date)
|
|
3826
|
+
});
|
|
3827
|
+
date.setDate(date.getDate() + 1);
|
|
3828
|
+
}
|
|
3829
|
+
const year = this.activeDate.getFullYear();
|
|
3830
|
+
const month = this.activeDate.getMonth();
|
|
3831
|
+
const firstDate = new Date(year, month, 1);
|
|
3832
|
+
const lastDate = new Date(year, month + 1, 0);
|
|
3833
|
+
const numDays = lastDate.getDate();
|
|
3834
|
+
let weeks = [];
|
|
3835
|
+
let dayOfWeek = firstDate.getDay();
|
|
3836
|
+
for (let i = 1; i <= numDays; i++) {
|
|
3837
|
+
if (dayOfWeek === 0 || weeks.length === 0) {
|
|
3838
|
+
weeks.push([]);
|
|
3839
|
+
}
|
|
3840
|
+
weeks[weeks.length - 1].push(i);
|
|
3841
|
+
dayOfWeek = (dayOfWeek + 1) % 7;
|
|
3842
|
+
}
|
|
3843
|
+
weeks = weeks.filter(x => !!x.length);
|
|
3844
|
+
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>`;
|
|
3845
|
+
}
|
|
3846
|
+
};
|
|
3847
|
+
_M3eMonthViewElement_instances = new WeakSet();
|
|
3848
|
+
_M3eMonthViewElement_renderItem = function _M3eMonthViewElement_renderItem(value) {
|
|
3849
|
+
const long = new Intl.DateTimeFormat(navigator.language, {
|
|
3850
|
+
year: "numeric",
|
|
3851
|
+
month: "long",
|
|
3852
|
+
day: "numeric"
|
|
3853
|
+
}).format(value);
|
|
3854
|
+
const special = this.specialDates?.(value) ?? false;
|
|
3855
|
+
const selected = sameDate(this.date, value);
|
|
3856
|
+
const active = sameDate(this.activeDate, value);
|
|
3857
|
+
const current = sameDate(this.today, value);
|
|
3858
|
+
const disabled = this.minDate && compareDate(value, this.minDate) < 0 || this.maxDate && compareDate(value, this.maxDate) > 0 || this.blackoutDates?.(value) === true;
|
|
3859
|
+
const id = `date-${value.getMonth()}-${value.getDate()}-${value.getFullYear()}`;
|
|
3860
|
+
let range = false,
|
|
3861
|
+
rangeStart = false,
|
|
3862
|
+
rangeEnd = false,
|
|
3863
|
+
rangeStartRange = false;
|
|
3864
|
+
if (this.rangeStart) {
|
|
3865
|
+
if (!this.rangeEnd) {
|
|
3866
|
+
rangeStart = sameDate(value, this.rangeStart);
|
|
3867
|
+
} else {
|
|
3868
|
+
range = compareDate(value, this.rangeStart) > 0 && compareDate(value, this.rangeEnd) < 0;
|
|
3869
|
+
if (!range) {
|
|
3870
|
+
rangeStart = compareDate(value, this.rangeStart) >= 0 && compareDate(value, this.rangeEnd) < 0;
|
|
3871
|
+
if (!rangeStart) {
|
|
3872
|
+
rangeEnd = compareDate(value, this.rangeStart) > 0 && compareDate(value, this.rangeEnd) <= 0;
|
|
3873
|
+
} else {
|
|
3874
|
+
rangeStartRange = true;
|
|
3875
|
+
}
|
|
3876
|
+
}
|
|
3877
|
+
}
|
|
3878
|
+
}
|
|
3879
|
+
return html`<td role="gridcell" class="${classMap({
|
|
3880
|
+
current,
|
|
3881
|
+
selected,
|
|
3882
|
+
active,
|
|
3883
|
+
special,
|
|
3884
|
+
range,
|
|
3885
|
+
"range-start": rangeStart,
|
|
3886
|
+
"range-start-range": rangeStartRange,
|
|
3887
|
+
"range-end": rangeEnd
|
|
3888
|
+
})}"><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>`;
|
|
3889
|
+
};
|
|
3890
|
+
_M3eMonthViewElement_handleItemClick = function _M3eMonthViewElement_handleItemClick(e) {
|
|
3891
|
+
const item = e.currentTarget;
|
|
3892
|
+
if (item.ariaDisabled === "true" || !item.dataset["value"]) return;
|
|
3893
|
+
this.activeDate = new Date(item.dataset["value"]);
|
|
3894
|
+
this.activeDate = clampDate(this.activeDate, this.minDate, this.maxDate);
|
|
3895
|
+
if (this.rangeStart) {
|
|
3896
|
+
if (compareDate(this.activeDate, this.rangeStart) < 0) {
|
|
3897
|
+
this.rangeStart = this.activeDate;
|
|
3898
|
+
this.rangeEnd = null;
|
|
3899
|
+
} else {
|
|
3900
|
+
this.rangeEnd = this.activeDate;
|
|
3901
|
+
}
|
|
3902
|
+
__classPrivateFieldGet(this, _M3eMonthViewElement_instances, "m", _M3eMonthViewElement_clearRangeHighlight).call(this);
|
|
3903
|
+
}
|
|
3904
|
+
this.dispatchEvent(new Event("change", {
|
|
3905
|
+
bubbles: false
|
|
3906
|
+
}));
|
|
3907
|
+
};
|
|
3908
|
+
_M3eMonthViewElement_handleItemKeyDown = function _M3eMonthViewElement_handleItemKeyDown(e) {
|
|
3909
|
+
let activeDate = this.activeDate;
|
|
3910
|
+
switch (e.key) {
|
|
3911
|
+
case " ":
|
|
3912
|
+
case "Enter":
|
|
3913
|
+
e.preventDefault();
|
|
3914
|
+
e.currentTarget.click();
|
|
3915
|
+
return;
|
|
3916
|
+
case "ArrowLeft":
|
|
3917
|
+
case "Left":
|
|
3918
|
+
activeDate = addCalendarDays(activeDate, M3eDirectionality.current === "rtl" ? 1 : -1);
|
|
3919
|
+
break;
|
|
3920
|
+
case "ArrowRight":
|
|
3921
|
+
case "Right":
|
|
3922
|
+
activeDate = addCalendarDays(activeDate, M3eDirectionality.current === "rtl" ? -1 : 1);
|
|
3923
|
+
break;
|
|
3924
|
+
case "ArrowUp":
|
|
3925
|
+
case "Up":
|
|
3926
|
+
activeDate = addCalendarDays(activeDate, -7);
|
|
3927
|
+
break;
|
|
3928
|
+
case "ArrowDown":
|
|
3929
|
+
case "Down":
|
|
3930
|
+
activeDate = addCalendarDays(activeDate, 7);
|
|
3931
|
+
break;
|
|
3932
|
+
case "Home":
|
|
3933
|
+
activeDate = addCalendarDays(activeDate, 1 - activeDate.getDate());
|
|
3934
|
+
break;
|
|
3935
|
+
case "End":
|
|
3936
|
+
activeDate = addCalendarDays(activeDate, getNumDaysInMonth(activeDate) - activeDate.getDate());
|
|
3937
|
+
break;
|
|
3938
|
+
case "PageUp":
|
|
3939
|
+
activeDate = e.altKey ? addCalendarYears(activeDate, -1) : addCalendarMonths(activeDate, -1);
|
|
3940
|
+
break;
|
|
3941
|
+
case "PageDown":
|
|
3942
|
+
activeDate = e.altKey ? addCalendarYears(activeDate, 1) : addCalendarMonths(activeDate, 1);
|
|
3943
|
+
break;
|
|
3944
|
+
default:
|
|
3945
|
+
return;
|
|
3946
|
+
}
|
|
3947
|
+
e.preventDefault();
|
|
3948
|
+
this._changeActiveDate(activeDate);
|
|
3949
|
+
};
|
|
3950
|
+
_M3eMonthViewElement_handleItemMouseEnter = function _M3eMonthViewElement_handleItemMouseEnter(e) {
|
|
3951
|
+
__classPrivateFieldGet(this, _M3eMonthViewElement_instances, "m", _M3eMonthViewElement_setRangeHighlight).call(this, e.currentTarget);
|
|
3952
|
+
};
|
|
3953
|
+
_M3eMonthViewElement_handleItemFocus = function _M3eMonthViewElement_handleItemFocus(e) {
|
|
3954
|
+
if (!this._suppressFocusHighlight) {
|
|
3955
|
+
__classPrivateFieldGet(this, _M3eMonthViewElement_instances, "m", _M3eMonthViewElement_setRangeHighlight).call(this, e.currentTarget);
|
|
3956
|
+
}
|
|
3957
|
+
};
|
|
3958
|
+
_M3eMonthViewElement_setRangeHighlight = function _M3eMonthViewElement_setRangeHighlight(item) {
|
|
3959
|
+
__classPrivateFieldGet(this, _M3eMonthViewElement_instances, "m", _M3eMonthViewElement_clearRangeHighlight).call(this);
|
|
3960
|
+
if (this.rangeStart && item.dataset["value"]) {
|
|
3961
|
+
if (compareDate(new Date(item.dataset["value"]), this.rangeStart) > 0) {
|
|
3962
|
+
item.parentElement.classList.add("range-highlight-end");
|
|
3963
|
+
}
|
|
3964
|
+
for (const cell of item.closest("table")?.querySelectorAll(".item") ?? []) {
|
|
3965
|
+
if (cell === item) break;
|
|
3966
|
+
const value = new Date(cell.dataset["value"]);
|
|
3967
|
+
if (compareDate(value, this.rangeStart) > 0) {
|
|
3968
|
+
cell.parentElement.classList.add("range-highlight");
|
|
3969
|
+
} else if (compareDate(value, this.rangeStart) >= 0) {
|
|
3970
|
+
cell.parentElement.classList.add("range-highlight-start");
|
|
3971
|
+
}
|
|
3972
|
+
}
|
|
3973
|
+
}
|
|
3974
|
+
};
|
|
3975
|
+
_M3eMonthViewElement_clearRangeHighlight = function _M3eMonthViewElement_clearRangeHighlight() {
|
|
3976
|
+
if (this.rangeStart) {
|
|
3977
|
+
this.shadowRoot?.querySelectorAll(".range-highlight,.range-highlight-end,.range-highlight-start").forEach(x => x.classList.remove("range-highlight", "range-highlight-end", "range-highlight-start"));
|
|
3978
|
+
}
|
|
3979
|
+
};
|
|
3980
|
+
/** The styles of the element. */
|
|
3981
|
+
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; } }`];
|
|
3982
|
+
__decorate([property({
|
|
3983
|
+
attribute: "range-start",
|
|
3984
|
+
converter: dateConverter$1
|
|
3985
|
+
})], M3eMonthViewElement.prototype, "rangeStart", void 0);
|
|
3986
|
+
__decorate([property({
|
|
3987
|
+
attribute: "range-end",
|
|
3988
|
+
converter: dateConverter$1
|
|
3989
|
+
})], M3eMonthViewElement.prototype, "rangeEnd", void 0);
|
|
3990
|
+
__decorate([property({
|
|
3991
|
+
attribute: false
|
|
3992
|
+
})], M3eMonthViewElement.prototype, "blackoutDates", void 0);
|
|
3993
|
+
__decorate([property({
|
|
3994
|
+
attribute: false
|
|
3995
|
+
})], M3eMonthViewElement.prototype, "specialDates", void 0);
|
|
3996
|
+
M3eMonthViewElement = __decorate([customElement$1("m3e-month-view")], M3eMonthViewElement);
|
|
3997
|
+
|
|
3998
|
+
/**
|
|
3999
|
+
* Adapted from Angular Material Datepicker
|
|
4000
|
+
* Source: https://github.com/angular/components/blob/main/src/material/datepicker/multi-year-view.ts
|
|
4001
|
+
*
|
|
4002
|
+
* @license MIT
|
|
4003
|
+
* Copyright (c) 2025 Google LLC
|
|
4004
|
+
* See LICENSE file in the project root for full license text.
|
|
4005
|
+
*/
|
|
4006
|
+
var _M3eMultiYearViewElement_instances, _M3eMultiYearViewElement_renderItem, _M3eMultiYearViewElement_handleItemClick, _M3eMultiYearViewElement_handleItemKeyDown;
|
|
4007
|
+
/**
|
|
4008
|
+
* An internal component used to display a year selector in a calendar.
|
|
4009
|
+
* @internal
|
|
4010
|
+
*/
|
|
4011
|
+
let M3eMultiYearViewElement = class M3eMultiYearViewElement extends CalendarViewElementBase {
|
|
4012
|
+
constructor() {
|
|
4013
|
+
super(...arguments);
|
|
4014
|
+
_M3eMultiYearViewElement_instances.add(this);
|
|
4015
|
+
}
|
|
4016
|
+
/** @inheritdoc */
|
|
4017
|
+
render() {
|
|
4018
|
+
const years = new Array();
|
|
4019
|
+
const minYear = minYearOfPage(this.activeDate, this.minDate, this.maxDate);
|
|
4020
|
+
for (let i = 0, row = []; i < YEARS_PER_PAGE; i++) {
|
|
4021
|
+
row.push(minYear + i);
|
|
4022
|
+
if (row.length === YEARS_PER_ROW) {
|
|
4023
|
+
years.push(row);
|
|
4024
|
+
row = new Array();
|
|
4025
|
+
}
|
|
4026
|
+
}
|
|
4027
|
+
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>`;
|
|
4028
|
+
}
|
|
4029
|
+
};
|
|
4030
|
+
_M3eMultiYearViewElement_instances = new WeakSet();
|
|
4031
|
+
_M3eMultiYearViewElement_renderItem = function _M3eMultiYearViewElement_renderItem(year) {
|
|
4032
|
+
const yearFormat = new Intl.DateTimeFormat(navigator.language, {
|
|
4033
|
+
year: "numeric"
|
|
4034
|
+
});
|
|
4035
|
+
const active = this.activeDate.getFullYear() === year;
|
|
4036
|
+
const selected = this.date?.getFullYear() === year;
|
|
4037
|
+
const current = this.today.getFullYear() === year;
|
|
4038
|
+
const disabled = this.minDate && year < this.minDate.getFullYear() || this.maxDate && year > this.maxDate.getFullYear();
|
|
4039
|
+
const id = `year-${year}`;
|
|
4040
|
+
return html`<td role="gridcell" class="${classMap({
|
|
4041
|
+
current,
|
|
4042
|
+
selected,
|
|
4043
|
+
active
|
|
4044
|
+
})}"><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>`;
|
|
4045
|
+
};
|
|
4046
|
+
_M3eMultiYearViewElement_handleItemClick = function _M3eMultiYearViewElement_handleItemClick(e) {
|
|
4047
|
+
const item = e.currentTarget;
|
|
4048
|
+
if (item.ariaDisabled === "true" || !item.dataset["value"]) return;
|
|
4049
|
+
this.activeDate = new Date(this.activeDate);
|
|
4050
|
+
this.activeDate.setFullYear(Number(item.dataset["value"]));
|
|
4051
|
+
this.activeDate = clampDate(this.activeDate, this.minDate, this.maxDate);
|
|
4052
|
+
this.dispatchEvent(new Event("change", {
|
|
4053
|
+
bubbles: false
|
|
4054
|
+
}));
|
|
4055
|
+
};
|
|
4056
|
+
_M3eMultiYearViewElement_handleItemKeyDown = function _M3eMultiYearViewElement_handleItemKeyDown(e) {
|
|
4057
|
+
let activeDate = this.activeDate;
|
|
4058
|
+
switch (e.key) {
|
|
4059
|
+
case " ":
|
|
4060
|
+
case "Enter":
|
|
4061
|
+
e.preventDefault();
|
|
4062
|
+
e.currentTarget.click();
|
|
4063
|
+
return;
|
|
4064
|
+
case "ArrowLeft":
|
|
4065
|
+
case "Left":
|
|
4066
|
+
activeDate = addCalendarYears(activeDate, M3eDirectionality.current === "rtl" ? 1 : -1);
|
|
4067
|
+
break;
|
|
4068
|
+
case "ArrowRight":
|
|
4069
|
+
case "Right":
|
|
4070
|
+
activeDate = addCalendarYears(activeDate, M3eDirectionality.current === "rtl" ? -1 : 1);
|
|
4071
|
+
break;
|
|
4072
|
+
case "ArrowUp":
|
|
4073
|
+
case "Up":
|
|
4074
|
+
activeDate = addCalendarYears(activeDate, -YEARS_PER_ROW);
|
|
4075
|
+
break;
|
|
4076
|
+
case "ArrowDown":
|
|
4077
|
+
case "Down":
|
|
4078
|
+
activeDate = addCalendarYears(activeDate, YEARS_PER_ROW);
|
|
4079
|
+
break;
|
|
4080
|
+
case "Home":
|
|
4081
|
+
activeDate = addCalendarYears(activeDate, -getActiveOffset(activeDate, this.minDate, this.maxDate));
|
|
4082
|
+
break;
|
|
4083
|
+
case "End":
|
|
4084
|
+
activeDate = addCalendarYears(activeDate, YEARS_PER_PAGE - getActiveOffset(activeDate, this.minDate, this.maxDate) - 1);
|
|
4085
|
+
break;
|
|
4086
|
+
case "PageUp":
|
|
4087
|
+
activeDate = addCalendarYears(activeDate, e.altKey ? -YEARS_PER_PAGE * 10 : -YEARS_PER_PAGE);
|
|
4088
|
+
break;
|
|
4089
|
+
case "PageDown":
|
|
4090
|
+
activeDate = addCalendarYears(activeDate, e.altKey ? YEARS_PER_PAGE * 10 : YEARS_PER_PAGE);
|
|
4091
|
+
break;
|
|
4092
|
+
default:
|
|
4093
|
+
return;
|
|
4094
|
+
}
|
|
4095
|
+
e.preventDefault();
|
|
4096
|
+
this._changeActiveDate(activeDate);
|
|
4097
|
+
};
|
|
4098
|
+
/** The styles of the element. */
|
|
4099
|
+
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}); }`];
|
|
4100
|
+
M3eMultiYearViewElement = __decorate([customElement$1("m3e-multi-year-view")], M3eMultiYearViewElement);
|
|
4101
|
+
|
|
4102
|
+
/**
|
|
4103
|
+
* Adapted from Angular Material Datepicker
|
|
4104
|
+
* Source: https://github.com/angular/components/blob/main/src/material/datepicker/year-view.ts
|
|
4105
|
+
*
|
|
4106
|
+
* @license MIT
|
|
4107
|
+
* Copyright (c) 2025 Google LLC
|
|
4108
|
+
* See LICENSE file in the project root for full license text.
|
|
4109
|
+
*/
|
|
4110
|
+
var _M3eYearViewElement_instances, _M3eYearViewElement_renderItem, _M3eYearViewElement_handleItemClick, _M3eYearViewElement_handleItemKeyDown;
|
|
4111
|
+
/**
|
|
4112
|
+
* An internal component used to display a single year in a calendar.
|
|
4113
|
+
* @internal
|
|
4114
|
+
*/
|
|
4115
|
+
let M3eYearViewElement = class M3eYearViewElement extends CalendarViewElementBase {
|
|
4116
|
+
constructor() {
|
|
4117
|
+
super(...arguments);
|
|
4118
|
+
_M3eYearViewElement_instances.add(this);
|
|
4119
|
+
}
|
|
4120
|
+
/** @inheritdoc */
|
|
4121
|
+
render() {
|
|
4122
|
+
const months = new Array();
|
|
4123
|
+
const shortFormat = new Intl.DateTimeFormat(navigator.language, {
|
|
4124
|
+
month: "short"
|
|
4125
|
+
});
|
|
4126
|
+
const longFormat = new Intl.DateTimeFormat(navigator.language, {
|
|
4127
|
+
month: "long"
|
|
4128
|
+
});
|
|
4129
|
+
const year = this.activeDate.getFullYear();
|
|
4130
|
+
for (let month = 0, row = new Array(); month < 12; month++) {
|
|
4131
|
+
const date = new Date(year, month, 1);
|
|
4132
|
+
row.push({
|
|
4133
|
+
narrow: shortFormat.format(date),
|
|
4134
|
+
long: longFormat.format(date),
|
|
4135
|
+
date: date
|
|
4136
|
+
});
|
|
4137
|
+
if (row.length == MONTHS_PER_ROW) {
|
|
4138
|
+
months.push(row);
|
|
4139
|
+
row = [];
|
|
4140
|
+
}
|
|
4141
|
+
}
|
|
4142
|
+
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>`;
|
|
4143
|
+
}
|
|
4144
|
+
};
|
|
4145
|
+
_M3eYearViewElement_instances = new WeakSet();
|
|
4146
|
+
_M3eYearViewElement_renderItem = function _M3eYearViewElement_renderItem(month) {
|
|
4147
|
+
const active = this.activeDate.getFullYear() === month.date.getFullYear() && this.activeDate.getMonth() === month.date.getMonth();
|
|
4148
|
+
const selected = this.date?.getFullYear() === month.date.getFullYear() && this.date?.getMonth() === month.date.getMonth();
|
|
4149
|
+
const current = this.today.getFullYear() === month.date.getFullYear() && this.today.getMonth() === month.date.getMonth();
|
|
4150
|
+
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());
|
|
4151
|
+
const id = `month-${month.date.getMonth()}`;
|
|
4152
|
+
return html`<td role="gridcell" class="${classMap({
|
|
4153
|
+
current,
|
|
4154
|
+
selected,
|
|
4155
|
+
active
|
|
4156
|
+
})}"><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>`;
|
|
4157
|
+
};
|
|
4158
|
+
_M3eYearViewElement_handleItemClick = function _M3eYearViewElement_handleItemClick(e) {
|
|
4159
|
+
const item = e.currentTarget;
|
|
4160
|
+
if (item.ariaDisabled === "true" || !item.dataset["value"]) return;
|
|
4161
|
+
this.activeDate = clampDate(new Date(item.dataset["value"]), this.minDate, this.maxDate);
|
|
4162
|
+
this.dispatchEvent(new Event("change", {
|
|
4163
|
+
bubbles: false
|
|
4164
|
+
}));
|
|
4165
|
+
};
|
|
4166
|
+
_M3eYearViewElement_handleItemKeyDown = function _M3eYearViewElement_handleItemKeyDown(e) {
|
|
4167
|
+
let activeDate = this.activeDate;
|
|
4168
|
+
switch (e.key) {
|
|
4169
|
+
case " ":
|
|
4170
|
+
case "Enter":
|
|
4171
|
+
e.preventDefault();
|
|
4172
|
+
e.currentTarget.click();
|
|
4173
|
+
return;
|
|
4174
|
+
case "ArrowLeft":
|
|
4175
|
+
case "Left":
|
|
4176
|
+
activeDate = addCalendarMonths(activeDate, M3eDirectionality.current === "rtl" ? 1 : -1);
|
|
4177
|
+
break;
|
|
4178
|
+
case "ArrowRight":
|
|
4179
|
+
case "Right":
|
|
4180
|
+
activeDate = addCalendarMonths(activeDate, M3eDirectionality.current === "rtl" ? -1 : 1);
|
|
4181
|
+
break;
|
|
4182
|
+
case "ArrowUp":
|
|
4183
|
+
case "Up":
|
|
4184
|
+
activeDate = addCalendarMonths(activeDate, -4);
|
|
4185
|
+
break;
|
|
4186
|
+
case "ArrowDown":
|
|
4187
|
+
case "Down":
|
|
4188
|
+
activeDate = addCalendarMonths(activeDate, 4);
|
|
4189
|
+
break;
|
|
4190
|
+
case "Home":
|
|
4191
|
+
activeDate = addCalendarMonths(activeDate, -activeDate.getMonth());
|
|
4192
|
+
break;
|
|
4193
|
+
case "End":
|
|
4194
|
+
activeDate = addCalendarMonths(activeDate, 11 - activeDate.getMonth());
|
|
4195
|
+
break;
|
|
4196
|
+
case "PageUp":
|
|
4197
|
+
activeDate = addCalendarYears(activeDate, e.altKey ? -10 : -1);
|
|
4198
|
+
break;
|
|
4199
|
+
case "PageDown":
|
|
4200
|
+
activeDate = addCalendarYears(activeDate, e.altKey ? 10 : 1);
|
|
4201
|
+
break;
|
|
4202
|
+
default:
|
|
4203
|
+
return;
|
|
4204
|
+
}
|
|
4205
|
+
e.preventDefault();
|
|
4206
|
+
this._changeActiveDate(activeDate);
|
|
4207
|
+
};
|
|
4208
|
+
/** The styles of the element. */
|
|
4209
|
+
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}); }`];
|
|
4210
|
+
M3eYearViewElement = __decorate([customElement$1("m3e-year-view")], M3eYearViewElement);
|
|
4211
|
+
|
|
4212
|
+
/**
|
|
4213
|
+
* Adapted from Angular Material Datepicker
|
|
4214
|
+
* Source: https://github.com/angular/components/blob/main/src/material/datepicker/calendar.ts
|
|
4215
|
+
*
|
|
4216
|
+
* @license MIT
|
|
4217
|
+
* Copyright (c) 2025 Google LLC
|
|
4218
|
+
* See LICENSE file in the project root for full license text.
|
|
4219
|
+
*/
|
|
4220
|
+
var _M3eCalendarElement_instances, _M3eCalendarElement_transitionComplete, _M3eCalendarElement_renderHeader, _M3eCalendarElement_renderView, _M3eCalendarElement_handleDateChange, _M3eCalendarElement_handleMonthChange, _M3eCalendarElement_handleYearChange, _M3eCalendarElement_handleActiveChange, _M3eCalendarElement_getPreviousPeriod, _M3eCalendarElement_getNextPeriod;
|
|
4221
|
+
/**
|
|
4222
|
+
* A calendar used to select a date.
|
|
4223
|
+
*
|
|
4224
|
+
* @description
|
|
4225
|
+
* The `m3e-calendar` component provides structured navigation and selection across
|
|
4226
|
+
* month, year, and multi‑year views. It supports single‑date and range selection,
|
|
4227
|
+
* applies disabled rules including minimum, maximum, and blackout constraints, and
|
|
4228
|
+
* provides styling hooks for special date states.
|
|
4229
|
+
*
|
|
4230
|
+
* @example
|
|
4231
|
+
* The following example illustrates use of the `m3e-calendar`. In this example, a calendar is displayed
|
|
4232
|
+
* with a selected date.
|
|
4233
|
+
*
|
|
4234
|
+
* ```html
|
|
4235
|
+
* <m3e-calendar date="2025-12-13"></m3e-calendar>
|
|
4236
|
+
* ```
|
|
4237
|
+
*
|
|
4238
|
+
* @tag m3e-calendar
|
|
4239
|
+
*
|
|
4240
|
+
* @slot header - Renders the header of the calendar.
|
|
4241
|
+
*
|
|
4242
|
+
* @attr date - The selected date.
|
|
4243
|
+
* @attr max-date - The maximum date that can be selected.
|
|
4244
|
+
* @attr min-date - The minimum date that can be selected.
|
|
4245
|
+
* @attr range-end - End of a date range.
|
|
4246
|
+
* @attr range-start - Start of a date range.
|
|
4247
|
+
* @attr start-at - A date specifying the period (month or year) to start the calendar in.
|
|
4248
|
+
* @attr start-view - The initial view used to select a date.
|
|
4249
|
+
* @attr previous-month-label - The accessible label given to the button used to move to the previous month.
|
|
4250
|
+
* @attr next-month-label - The accessible label given to the button used to move to the next month.
|
|
4251
|
+
* @attr previous-year-label - The accessible label given to the button used to move to the previous year.
|
|
4252
|
+
* @attr next-year-label - The accessible label given to the button used to move to the next year.
|
|
4253
|
+
* @attr previous-multi-year-label - The accessible label given to the button used to move to the previous 24 years.
|
|
4254
|
+
* @attr next-multi-year-label - The accessible label given to the button used to move to the next 24 years.
|
|
4255
|
+
*
|
|
4256
|
+
* @fires change - Emitted when the selected date changes.
|
|
4257
|
+
*
|
|
4258
|
+
* @cssprop --m3e-calendar-container-color - Background color of the container surface.
|
|
4259
|
+
* @cssprop --m3e-calendar-container-elevation - Elevation shadow applied to the container surface.
|
|
4260
|
+
* @cssprop --m3e-calendar-container-shape - Corner radius of the container surface.
|
|
4261
|
+
* @cssprop --m3e-calendar-padding - Padding applied to the calendar header and body.
|
|
4262
|
+
* @cssprop --m3e-calendar-period-button-text-color - Text color used for the period‑navigation buttons in the header.
|
|
4263
|
+
* @cssprop --m3e-calendar-weekday-font-size - Font size of weekday labels in month view.
|
|
4264
|
+
* @cssprop --m3e-calendar-weekday-font-weight - Font weight of weekday labels in month view.
|
|
4265
|
+
* @cssprop --m3e-calendar-weekday-line-height - Line height of weekday labels in month view.
|
|
4266
|
+
* @cssprop --m3e-calendar-weekday-tracking - Letter spacing of weekday labels in month view.
|
|
4267
|
+
* @cssprop --m3e-calendar-date-font-size - Font size of date cells in month view.
|
|
4268
|
+
* @cssprop --m3e-calendar-date-font-weight - Font weight of date cells in month view.
|
|
4269
|
+
* @cssprop --m3e-calendar-date-line-height - Line height of date cells in month view.
|
|
4270
|
+
* @cssprop --m3e-calendar-date-tracking - Letter spacing of date cells in month view.
|
|
4271
|
+
* @cssprop --m3e-calendar-item-font-size - Font size of items in year and multi‑year views.
|
|
4272
|
+
* @cssprop --m3e-calendar-item-font-weight - Font weight of items in year and multi‑year views.
|
|
4273
|
+
* @cssprop --m3e-calendar-item-line-height - Line height of items in year and multi‑year views.
|
|
4274
|
+
* @cssprop --m3e-calendar-item-tracking - Letter spacing of items in year and multi‑year views.
|
|
4275
|
+
* @cssprop --m3e-calendar-item-selected-color - Text color for selected date items.
|
|
4276
|
+
* @cssprop --m3e-calendar-item-selected-container-color - Background color for selected date items.
|
|
4277
|
+
* @cssprop --m3e-calendar-item-selected-ripple-color - Ripple color used when interacting with selected date items.
|
|
4278
|
+
* @cssprop --m3e-calendar-item-selected-hover-color - Hover color used when interacting with selected date items.
|
|
4279
|
+
* @cssprop --m3e-calendar-item-selected-focus-color - Focus color used when interacting with selected date items.
|
|
4280
|
+
* @cssprop --m3e-calendar-item-current-outline-thickness - Outline thickness used to indicate the current date.
|
|
4281
|
+
* @cssprop --m3e-calendar-item-current-outline-color - Outline color used to indicate the current date.
|
|
4282
|
+
* @cssprop --m3e-calendar-item-special-color - Text color for dates marked as special.
|
|
4283
|
+
* @cssprop --m3e-calendar-item-special-container-color - Background color for dates marked as special.
|
|
4284
|
+
* @cssprop --m3e-calendar-item-special-ripple-color - Ripple color used when interacting with dates marked as special.
|
|
4285
|
+
* @cssprop --m3e-calendar-item-special-hover-color - Hover color used when interacting with dates marked as special.
|
|
4286
|
+
* @cssprop --m3e-calendar-item-special-focus-color - Focus color used when interacting with dates marked as special.
|
|
4287
|
+
* @cssprop --m3e-calendar-range-container-color - Background color applied to the selected date range.
|
|
4288
|
+
* @cssprop --m3e-calendar-range-color - Text color for dates within a selected range.
|
|
4289
|
+
* @cssprop --m3e-calendar-item-disabled-color - Color used for disabled date items.
|
|
4290
|
+
* @cssprop --m3e-calendar-item-disabled-color-opacity - Opacity applied to the disabled item color.
|
|
4291
|
+
* @cssprop --m3e-calendar-slide-animation-duration - Duration of slide transitions between calendar views.
|
|
4292
|
+
*/
|
|
4293
|
+
let M3eCalendarElement = class M3eCalendarElement extends LitElement {
|
|
4294
|
+
constructor() {
|
|
4295
|
+
super(...arguments);
|
|
4296
|
+
_M3eCalendarElement_instances.add(this);
|
|
4297
|
+
/** @private */
|
|
4298
|
+
_M3eCalendarElement_transitionComplete.set(this, void 0);
|
|
4299
|
+
/** @private */
|
|
4300
|
+
this._today = new Date();
|
|
4301
|
+
/** @private */
|
|
4302
|
+
this._activeView = "month";
|
|
4303
|
+
/** @private */
|
|
4304
|
+
this._activeDate = new Date();
|
|
4305
|
+
/**
|
|
4306
|
+
* The initial view used to select a date.
|
|
4307
|
+
* @default "month"
|
|
4308
|
+
*/
|
|
4309
|
+
this.startView = "month";
|
|
4310
|
+
/**
|
|
4311
|
+
* The selected date.
|
|
4312
|
+
* @default null
|
|
4313
|
+
*/
|
|
4314
|
+
this.date = null;
|
|
4315
|
+
/**
|
|
4316
|
+
* A date specifying the period (month or year) to start the calendar in.
|
|
4317
|
+
* @default null
|
|
4318
|
+
*/
|
|
4319
|
+
this.startAt = null;
|
|
4320
|
+
/**
|
|
4321
|
+
* The minimum date that can be selected.
|
|
4322
|
+
* @default null
|
|
4323
|
+
*/
|
|
4324
|
+
this.minDate = null;
|
|
4325
|
+
/**
|
|
4326
|
+
* The maximum date that can be selected.
|
|
4327
|
+
* @default null
|
|
4328
|
+
*/
|
|
4329
|
+
this.maxDate = null;
|
|
4330
|
+
/**
|
|
4331
|
+
* Start of a date range.
|
|
4332
|
+
* @default null
|
|
4333
|
+
*/
|
|
4334
|
+
this.rangeStart = null;
|
|
4335
|
+
/**
|
|
4336
|
+
* End of a date range.
|
|
4337
|
+
* @default null
|
|
4338
|
+
*/
|
|
4339
|
+
this.rangeEnd = null;
|
|
4340
|
+
/**
|
|
4341
|
+
* A function used to determine whether a date cannot be selected.
|
|
4342
|
+
* @default null
|
|
4343
|
+
*/
|
|
4344
|
+
this.blackoutDates = null;
|
|
4345
|
+
/**
|
|
4346
|
+
* A function used to determine whether a date is special.
|
|
4347
|
+
* @default null
|
|
4348
|
+
*/
|
|
4349
|
+
this.specialDates = null;
|
|
4350
|
+
/**
|
|
4351
|
+
* The accessible label given to the button used to move to the previous month.
|
|
4352
|
+
* @default "Previous month"
|
|
4353
|
+
*/
|
|
4354
|
+
this.previousMonthLabel = "Previous month";
|
|
4355
|
+
/**
|
|
4356
|
+
* The accessible label given to the button used to move to the previous year.
|
|
4357
|
+
* @default "Previous year"
|
|
4358
|
+
*/
|
|
4359
|
+
this.previousYearLabel = "Previous year";
|
|
4360
|
+
/**
|
|
4361
|
+
* The accessible label given to the button used to move to the previous 24 years.
|
|
4362
|
+
* @default "Previous 24 years"
|
|
4363
|
+
*/
|
|
4364
|
+
this.previousMultiYearLabel = "Previous 24 years";
|
|
4365
|
+
/**
|
|
4366
|
+
* The accessible label given to the button used to move to the next month.
|
|
4367
|
+
* @default "Next month"
|
|
4368
|
+
*/
|
|
4369
|
+
this.nextMonthLabel = "Next month";
|
|
4370
|
+
/**
|
|
4371
|
+
* The accessible label given to the button used to move to the next year.
|
|
4372
|
+
* @default "Next year"
|
|
4373
|
+
*/
|
|
4374
|
+
this.nextYearLabel = "Next year";
|
|
4375
|
+
/**
|
|
4376
|
+
* The accessible label given to the button used to move to the next 24 years.
|
|
4377
|
+
* @default "Next 24 years"
|
|
4378
|
+
*/
|
|
4379
|
+
this.nextMultiYearLabel = "Next 24 years";
|
|
4380
|
+
}
|
|
4381
|
+
/** The label to present for the current period. */
|
|
4382
|
+
get periodLabel() {
|
|
4383
|
+
switch (this._activeView) {
|
|
4384
|
+
case "month":
|
|
4385
|
+
return new Intl.DateTimeFormat(navigator.language, {
|
|
4386
|
+
month: "short",
|
|
4387
|
+
year: "numeric"
|
|
4388
|
+
}).format(this._activeDate);
|
|
4389
|
+
case "year":
|
|
4390
|
+
return new Intl.DateTimeFormat(navigator.language, {
|
|
4391
|
+
year: "numeric"
|
|
4392
|
+
}).format(new Date(this._activeDate.getFullYear(), 0, 1));
|
|
4393
|
+
case "multi-year":
|
|
4394
|
+
return new Intl.DateTimeFormat(navigator.language, {
|
|
4395
|
+
year: "numeric"
|
|
4396
|
+
}).formatRange(new Date(minYearOfPage(this._activeDate, this.minDate, this.maxDate), 0, 1), new Date(maxYearOfPage(this._activeDate, this.minDate, this.maxDate), 0, 1));
|
|
4397
|
+
}
|
|
4398
|
+
}
|
|
4399
|
+
/** Whether the calendar can move to the previous period. */
|
|
4400
|
+
get canMovePreviousPeriod() {
|
|
4401
|
+
if (!this.minDate) return true;
|
|
4402
|
+
switch (this._activeView) {
|
|
4403
|
+
case "month":
|
|
4404
|
+
return new Date(this._activeDate.getFullYear(), this._activeDate.getMonth(), 0) >= this.minDate;
|
|
4405
|
+
case "year":
|
|
4406
|
+
return new Date(this._activeDate.getFullYear() - 1, 12, 1) >= this.minDate;
|
|
4407
|
+
case "multi-year":
|
|
4408
|
+
return new Date(minYearOfPage(this._activeDate, this.minDate, this.maxDate) - 1, 12, 1) >= this.minDate;
|
|
4409
|
+
}
|
|
4410
|
+
}
|
|
4411
|
+
/** Whether the calendar can move to the next period. */
|
|
4412
|
+
get canMoveNextPeriod() {
|
|
4413
|
+
if (!this.maxDate) return true;
|
|
4414
|
+
switch (this._activeView) {
|
|
4415
|
+
case "month":
|
|
4416
|
+
return new Date(this._activeDate.getFullYear(), this._activeDate.getMonth() + 1, 1) <= this.maxDate;
|
|
4417
|
+
case "year":
|
|
4418
|
+
return new Date(this._activeDate.getFullYear() + 1, 1, 1) <= this.maxDate;
|
|
4419
|
+
case "multi-year":
|
|
4420
|
+
return new Date(maxYearOfPage(this._activeDate, this.minDate, this.maxDate) + 1, 12, 1) <= this.maxDate;
|
|
4421
|
+
}
|
|
4422
|
+
}
|
|
4423
|
+
/**
|
|
4424
|
+
* Asynchronously focuses the active date.
|
|
4425
|
+
* @returns {Promise<void>} A promise that resolves after the active date has been focused.
|
|
4426
|
+
*/
|
|
4427
|
+
async focusActiveCell() {
|
|
4428
|
+
if (this.isUpdatePending) {
|
|
4429
|
+
await this.updateComplete;
|
|
4430
|
+
}
|
|
4431
|
+
await this._view?.focusActiveCell();
|
|
4432
|
+
}
|
|
4433
|
+
/** Updates today's date. */
|
|
4434
|
+
updateTodayDate() {
|
|
4435
|
+
this._today = new Date();
|
|
4436
|
+
}
|
|
4437
|
+
/**
|
|
4438
|
+
* Moves the calendar to the previous period.
|
|
4439
|
+
* @returns {Promise<void>} A promise that resolves when the operation is complete.
|
|
4440
|
+
*/
|
|
4441
|
+
async movePreviousPeriod() {
|
|
4442
|
+
if (!this.canMovePreviousPeriod) return;
|
|
4443
|
+
if (prefersReducedMotion$1()) {
|
|
4444
|
+
this._activeDate = __classPrivateFieldGet(this, _M3eCalendarElement_instances, "m", _M3eCalendarElement_getPreviousPeriod).call(this, this._activeView);
|
|
4445
|
+
return;
|
|
4446
|
+
}
|
|
4447
|
+
await __classPrivateFieldGet(this, _M3eCalendarElement_transitionComplete, "f");
|
|
4448
|
+
const views = [...(this.shadowRoot?.querySelectorAll(`.row.${this._activeView} .view`) ?? [])];
|
|
4449
|
+
if (views.length != 3) return;
|
|
4450
|
+
__classPrivateFieldSet(this, _M3eCalendarElement_transitionComplete, new Promise(resolve => {
|
|
4451
|
+
views[0].addEventListener("transitionend", () => {
|
|
4452
|
+
this._activeDate = __classPrivateFieldGet(this, _M3eCalendarElement_instances, "m", _M3eCalendarElement_getPreviousPeriod).call(this, this._activeView);
|
|
4453
|
+
views.forEach(x => x.classList.add("no-animate"));
|
|
4454
|
+
views[1].classList.remove("after");
|
|
4455
|
+
views[0].classList.add("before");
|
|
4456
|
+
setTimeout(() => {
|
|
4457
|
+
views.forEach(x => x.classList.remove("no-animate"));
|
|
4458
|
+
resolve();
|
|
4459
|
+
});
|
|
4460
|
+
}, {
|
|
4461
|
+
once: true
|
|
4462
|
+
});
|
|
4463
|
+
}), "f");
|
|
4464
|
+
this._body.style.overflow = "hidden";
|
|
4465
|
+
views[1].classList.add("after");
|
|
4466
|
+
views[0].classList.remove("before");
|
|
4467
|
+
await __classPrivateFieldGet(this, _M3eCalendarElement_transitionComplete, "f");
|
|
4468
|
+
this._body.style.overflow = "";
|
|
4469
|
+
}
|
|
4470
|
+
/**
|
|
4471
|
+
* Moves the calendar to the next period.
|
|
4472
|
+
* @returns {Promise<void>} A promise that resolves when the operation is complete.
|
|
4473
|
+
*/
|
|
4474
|
+
async moveNextPeriod() {
|
|
4475
|
+
if (!this.canMoveNextPeriod) return;
|
|
4476
|
+
if (prefersReducedMotion$1()) {
|
|
4477
|
+
this._activeDate = __classPrivateFieldGet(this, _M3eCalendarElement_instances, "m", _M3eCalendarElement_getNextPeriod).call(this, this._activeView);
|
|
4478
|
+
return;
|
|
4479
|
+
}
|
|
4480
|
+
await __classPrivateFieldGet(this, _M3eCalendarElement_transitionComplete, "f");
|
|
4481
|
+
const views = [...(this.shadowRoot?.querySelectorAll(`.row.${this._activeView} .view`) ?? [])];
|
|
4482
|
+
if (views.length != 3) return;
|
|
4483
|
+
__classPrivateFieldSet(this, _M3eCalendarElement_transitionComplete, new Promise(resolve => {
|
|
4484
|
+
views[2].addEventListener("transitionend", () => {
|
|
4485
|
+
this._activeDate = __classPrivateFieldGet(this, _M3eCalendarElement_instances, "m", _M3eCalendarElement_getNextPeriod).call(this, this._activeView);
|
|
4486
|
+
views.forEach(x => x.classList.add("no-animate"));
|
|
4487
|
+
views[1].classList.remove("before");
|
|
4488
|
+
views[2].classList.add("after");
|
|
4489
|
+
setTimeout(() => {
|
|
4490
|
+
views.forEach(x => x.classList.remove("no-animate"));
|
|
4491
|
+
resolve();
|
|
4492
|
+
});
|
|
4493
|
+
}, {
|
|
4494
|
+
once: true
|
|
4495
|
+
});
|
|
4496
|
+
}), "f");
|
|
4497
|
+
this._body.style.overflow = "hidden";
|
|
4498
|
+
views[1].classList.add("before");
|
|
4499
|
+
views[2].classList.remove("after");
|
|
4500
|
+
await __classPrivateFieldGet(this, _M3eCalendarElement_transitionComplete, "f");
|
|
4501
|
+
this._body.style.overflow = "";
|
|
4502
|
+
}
|
|
4503
|
+
/**
|
|
4504
|
+
* Toggles the current period.
|
|
4505
|
+
* @returns {Promise<void>} A promise that resolves when the operation is complete.
|
|
4506
|
+
*/
|
|
4507
|
+
async togglePeriod() {
|
|
4508
|
+
await __classPrivateFieldGet(this, _M3eCalendarElement_transitionComplete, "f");
|
|
4509
|
+
this._activeView = this._activeView === "month" ? "multi-year" : "month";
|
|
4510
|
+
await this.focusActiveCell();
|
|
4511
|
+
}
|
|
4512
|
+
/** @inheritdoc */
|
|
4513
|
+
willUpdate(changedProperties) {
|
|
4514
|
+
super.willUpdate(changedProperties);
|
|
4515
|
+
if (changedProperties.has("date")) {
|
|
4516
|
+
this._activeDate = new Date(this.date ?? this._today);
|
|
4517
|
+
}
|
|
4518
|
+
if (changedProperties.has("startAt")) {
|
|
4519
|
+
this._activeDate = new Date(this.startAt ?? this.date ?? this._today);
|
|
4520
|
+
}
|
|
4521
|
+
if (changedProperties.has("startView")) {
|
|
4522
|
+
this._activeView = this.startView;
|
|
4523
|
+
}
|
|
4524
|
+
}
|
|
4525
|
+
/** @inheritdoc */
|
|
4526
|
+
updated(_changedProperties) {
|
|
4527
|
+
super.updated(_changedProperties);
|
|
4528
|
+
if (this._view instanceof M3eMonthViewElement) {
|
|
4529
|
+
if (_changedProperties.has("specialDates") || _changedProperties.has("blackoutDates")) {
|
|
4530
|
+
this.shadowRoot?.querySelectorAll("m3e-month-view").forEach(x => {
|
|
4531
|
+
x.specialDates = this.specialDates;
|
|
4532
|
+
x.blackoutDates = this.blackoutDates;
|
|
4533
|
+
});
|
|
4534
|
+
}
|
|
4535
|
+
}
|
|
4536
|
+
}
|
|
4537
|
+
/** @inheritdoc */
|
|
4538
|
+
render() {
|
|
4539
|
+
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>`;
|
|
4540
|
+
}
|
|
4541
|
+
};
|
|
4542
|
+
_M3eCalendarElement_transitionComplete = new WeakMap();
|
|
4543
|
+
_M3eCalendarElement_instances = new WeakSet();
|
|
4544
|
+
_M3eCalendarElement_renderHeader = function _M3eCalendarElement_renderHeader() {
|
|
4545
|
+
return html`<div class="header"><m3e-button @click="${this.togglePeriod}">${this.periodLabel} <svg class="${classMap({
|
|
4546
|
+
rotate: this._activeView !== "month"
|
|
4547
|
+
})}" 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>`;
|
|
4548
|
+
};
|
|
4549
|
+
_M3eCalendarElement_renderView = function _M3eCalendarElement_renderView(view, offset) {
|
|
4550
|
+
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);
|
|
4551
|
+
switch (view) {
|
|
4552
|
+
case "month":
|
|
4553
|
+
return html`<m3e-month-view class="view ${classMap({
|
|
4554
|
+
before: offset < 0,
|
|
4555
|
+
after: offset > 0,
|
|
4556
|
+
active: view === this._activeView && offset === 0
|
|
4557
|
+
})}" ?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>`;
|
|
4558
|
+
case "year":
|
|
4559
|
+
return html`<m3e-year-view class="view ${classMap({
|
|
4560
|
+
before: offset < 0,
|
|
4561
|
+
after: offset > 0,
|
|
4562
|
+
active: view === this._activeView && offset === 0
|
|
4563
|
+
})}" ?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>`;
|
|
4564
|
+
case "multi-year":
|
|
4565
|
+
return html`<m3e-multi-year-view class="view ${classMap({
|
|
4566
|
+
before: offset < 0,
|
|
4567
|
+
after: offset > 0,
|
|
4568
|
+
active: view === this._activeView && offset === 0
|
|
4569
|
+
})}" ?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>`;
|
|
4570
|
+
}
|
|
4571
|
+
};
|
|
4572
|
+
_M3eCalendarElement_handleDateChange = function _M3eCalendarElement_handleDateChange(e) {
|
|
4573
|
+
const monthView = e.currentTarget;
|
|
4574
|
+
this._activeDate = new Date(monthView.activeDate);
|
|
4575
|
+
this.rangeStart = monthView.rangeStart;
|
|
4576
|
+
this.rangeEnd = monthView.rangeEnd;
|
|
4577
|
+
this.date = new Date(this._activeDate);
|
|
4578
|
+
this.dispatchEvent(new Event("change", {
|
|
4579
|
+
bubbles: true
|
|
4580
|
+
}));
|
|
4581
|
+
};
|
|
4582
|
+
_M3eCalendarElement_handleMonthChange = /** @private */
|
|
4583
|
+
async function _M3eCalendarElement_handleMonthChange(e) {
|
|
4584
|
+
this._activeDate = new Date(e.currentTarget.activeDate);
|
|
4585
|
+
this._activeView = "month";
|
|
4586
|
+
this.focusActiveCell();
|
|
4587
|
+
};
|
|
4588
|
+
_M3eCalendarElement_handleYearChange = function _M3eCalendarElement_handleYearChange(e) {
|
|
4589
|
+
this._activeDate = new Date(e.currentTarget.activeDate);
|
|
4590
|
+
this._activeView = "year";
|
|
4591
|
+
this.focusActiveCell();
|
|
4592
|
+
};
|
|
4593
|
+
_M3eCalendarElement_handleActiveChange = /** @private */
|
|
4594
|
+
async function _M3eCalendarElement_handleActiveChange(e) {
|
|
4595
|
+
if (this._view instanceof M3eMonthViewElement) {
|
|
4596
|
+
this._view._suppressFocusHighlight = false;
|
|
4597
|
+
}
|
|
4598
|
+
this._activeDate = new Date(e.currentTarget.activeDate);
|
|
4599
|
+
await this.focusActiveCell();
|
|
4600
|
+
if (this._view instanceof M3eMonthViewElement) {
|
|
4601
|
+
this._view._suppressFocusHighlight = false;
|
|
4602
|
+
}
|
|
4603
|
+
};
|
|
4604
|
+
_M3eCalendarElement_getPreviousPeriod = function _M3eCalendarElement_getPreviousPeriod(view) {
|
|
4605
|
+
const activeDate = new Date(this._activeDate);
|
|
4606
|
+
switch (view) {
|
|
4607
|
+
case "month":
|
|
4608
|
+
activeDate.setMonth(this._activeDate.getMonth() - 1);
|
|
4609
|
+
while (activeDate.getMonth() === this._activeDate.getMonth()) {
|
|
4610
|
+
activeDate.setDate(activeDate.getDate() - 1);
|
|
4611
|
+
}
|
|
4612
|
+
break;
|
|
4613
|
+
case "year":
|
|
4614
|
+
activeDate.setFullYear(this._activeDate.getFullYear() - 1);
|
|
4615
|
+
break;
|
|
4616
|
+
case "multi-year":
|
|
4617
|
+
{
|
|
4618
|
+
activeDate.setDate(1);
|
|
4619
|
+
activeDate.setFullYear(minYearOfPage(this._activeDate, this.minDate, this.maxDate) - 1);
|
|
4620
|
+
}
|
|
4621
|
+
}
|
|
4622
|
+
return activeDate;
|
|
4623
|
+
};
|
|
4624
|
+
_M3eCalendarElement_getNextPeriod = function _M3eCalendarElement_getNextPeriod(view) {
|
|
4625
|
+
const activeDate = new Date(this._activeDate);
|
|
4626
|
+
switch (view) {
|
|
4627
|
+
case "month":
|
|
4628
|
+
activeDate.setMonth(this._activeDate.getMonth() + 1);
|
|
4629
|
+
while (activeDate.getMonth() === this._activeDate.getMonth()) {
|
|
4630
|
+
activeDate.setDate(activeDate.getDate() + 1);
|
|
4631
|
+
}
|
|
4632
|
+
break;
|
|
4633
|
+
case "year":
|
|
4634
|
+
activeDate.setFullYear(this._activeDate.getFullYear() + 1);
|
|
4635
|
+
break;
|
|
4636
|
+
case "multi-year":
|
|
4637
|
+
activeDate.setDate(1);
|
|
4638
|
+
activeDate.setFullYear(maxYearOfPage(this._activeDate, this.minDate, this.maxDate) + 1);
|
|
4639
|
+
break;
|
|
4640
|
+
}
|
|
4641
|
+
return activeDate;
|
|
4642
|
+
};
|
|
4643
|
+
/** The styles of the element. */
|
|
4644
|
+
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},
|
|
4645
|
+
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,
|
|
4646
|
+
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; } }`;
|
|
4647
|
+
__decorate([state()], M3eCalendarElement.prototype, "_today", void 0);
|
|
4648
|
+
__decorate([state()], M3eCalendarElement.prototype, "_activeView", void 0);
|
|
4649
|
+
__decorate([state()], M3eCalendarElement.prototype, "_activeDate", void 0);
|
|
4650
|
+
__decorate([query(".active")], M3eCalendarElement.prototype, "_view", void 0);
|
|
4651
|
+
__decorate([query(".body")], M3eCalendarElement.prototype, "_body", void 0);
|
|
4652
|
+
__decorate([property({
|
|
4653
|
+
attribute: "start-view"
|
|
4654
|
+
})], M3eCalendarElement.prototype, "startView", void 0);
|
|
4655
|
+
__decorate([property({
|
|
4656
|
+
converter: dateConverter$1
|
|
4657
|
+
})], M3eCalendarElement.prototype, "date", void 0);
|
|
4658
|
+
__decorate([property({
|
|
4659
|
+
attribute: "start-at",
|
|
4660
|
+
converter: dateConverter$1
|
|
4661
|
+
})], M3eCalendarElement.prototype, "startAt", void 0);
|
|
4662
|
+
__decorate([property({
|
|
4663
|
+
attribute: "min-date",
|
|
4664
|
+
converter: dateConverter$1
|
|
4665
|
+
})], M3eCalendarElement.prototype, "minDate", void 0);
|
|
4666
|
+
__decorate([property({
|
|
4667
|
+
attribute: "max-date",
|
|
4668
|
+
converter: dateConverter$1
|
|
4669
|
+
})], M3eCalendarElement.prototype, "maxDate", void 0);
|
|
4670
|
+
__decorate([property({
|
|
4671
|
+
attribute: "range-start",
|
|
4672
|
+
converter: dateConverter$1
|
|
4673
|
+
})], M3eCalendarElement.prototype, "rangeStart", void 0);
|
|
4674
|
+
__decorate([property({
|
|
4675
|
+
attribute: "range-end",
|
|
4676
|
+
converter: dateConverter$1
|
|
4677
|
+
})], M3eCalendarElement.prototype, "rangeEnd", void 0);
|
|
4678
|
+
__decorate([property({
|
|
4679
|
+
attribute: false
|
|
4680
|
+
})], M3eCalendarElement.prototype, "blackoutDates", void 0);
|
|
4681
|
+
__decorate([property({
|
|
4682
|
+
attribute: false
|
|
4683
|
+
})], M3eCalendarElement.prototype, "specialDates", void 0);
|
|
4684
|
+
__decorate([property({
|
|
4685
|
+
attribute: "previous-month-label"
|
|
4686
|
+
})], M3eCalendarElement.prototype, "previousMonthLabel", void 0);
|
|
4687
|
+
__decorate([property({
|
|
4688
|
+
attribute: "previous-year-label"
|
|
4689
|
+
})], M3eCalendarElement.prototype, "previousYearLabel", void 0);
|
|
4690
|
+
__decorate([property({
|
|
4691
|
+
attribute: "previous-multi-year-label"
|
|
4692
|
+
})], M3eCalendarElement.prototype, "previousMultiYearLabel", void 0);
|
|
4693
|
+
__decorate([property({
|
|
4694
|
+
attribute: "next-month-label"
|
|
4695
|
+
})], M3eCalendarElement.prototype, "nextMonthLabel", void 0);
|
|
4696
|
+
__decorate([property({
|
|
4697
|
+
attribute: "next-year-label"
|
|
4698
|
+
})], M3eCalendarElement.prototype, "nextYearLabel", void 0);
|
|
4699
|
+
__decorate([property({
|
|
4700
|
+
attribute: "next-multi-year-label"
|
|
4701
|
+
})], M3eCalendarElement.prototype, "nextMultiYearLabel", void 0);
|
|
4702
|
+
M3eCalendarElement = __decorate([customElement$1("m3e-calendar")], M3eCalendarElement);
|
|
4703
|
+
|
|
4704
|
+
/**
|
|
4705
|
+
* Component design tokens for `M3eCardElement`.
|
|
4706
|
+
* @internal
|
|
4707
|
+
*/
|
|
4708
|
+
const CardToken = {
|
|
4709
|
+
padding: unsafeCSS("var(--m3e-card-padding, 1rem)"),
|
|
4710
|
+
shape: unsafeCSS(`var(--m3e-card-shape, ${DesignToken$1.shape.corner.medium});`)
|
|
4711
|
+
};
|
|
4712
|
+
|
|
4713
|
+
/**
|
|
4714
|
+
* Component design tokens that control the appearance variants of `M3eCardElement`.
|
|
4715
|
+
* @internal
|
|
4716
|
+
*/
|
|
4717
|
+
const CardVariantToken = {
|
|
4718
|
+
filled: {
|
|
4719
|
+
textColor: unsafeCSS(`var(--m3e-filled-card-text-color, var(--m3e-card-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
4720
|
+
containerColor: unsafeCSS(`var(--m3e-filled-card-container-color, var(--m3e-card-container-color, ${DesignToken$1.color.surfaceContainerHighest}))`),
|
|
4721
|
+
containerElevation: unsafeCSS(`var(--m3e-filled-card-container-elevation, var(--m3e-card-container-elevation, ${DesignToken$1.elevation.level0}))`),
|
|
4722
|
+
disabled: {
|
|
4723
|
+
textColor: unsafeCSS(`var(--m3e-filled-card-disabled-text-color, var(--m3e-card-disabled-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
4724
|
+
textOpacity: unsafeCSS(`var(--m3e-filled-card-disabled-text-opacity, var(--m3e-card-disabled-text-opacity, 38%))`),
|
|
4725
|
+
imageOpacity: unsafeCSS(`var(--m3e-filled-card-disabled-image-opacity, var(--m3e-card-disabled-image-opacity, 38%))`),
|
|
4726
|
+
containerColor: unsafeCSS(`var(--m3e-filled-card-disabled-container-color, var(--m3e-card-disabled-container-color, ${DesignToken$1.color.surfaceVariant}))`),
|
|
4727
|
+
containerElevation: unsafeCSS(`var(--m3e-filled-card-disabled-container-elevation, var(--m3e-card-disabled-container-elevation, ${DesignToken$1.elevation.level0}))`),
|
|
4728
|
+
containerElevationColor: unsafeCSS(`var(--m3e-filled-card-disabled-container-elevation-color, var(--m3e-card-disabled-container-elevation-color, ${DesignToken$1.color.onSurface}))`),
|
|
4729
|
+
containerElevationOpacity: unsafeCSS(`var(--m3e-filled-card-disabled-container-elevation-opacity, var(--m3e-card-disabled-container-elevation-opacity, 38%))`),
|
|
4730
|
+
containerOpacity: unsafeCSS(`var(--m3e-filled-card-disabled-container-opacity, var(--m3e-card-disabled-container-opacity, 38%))`)
|
|
4731
|
+
},
|
|
4732
|
+
hover: {
|
|
4733
|
+
textColor: unsafeCSS(`var(--m3e-filled-card-hover-text-color, var(--m3e-card-hover-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
4734
|
+
stateLayerColor: unsafeCSS(`var(--m3e-filled-card-hover-state-layer-color, var(--m3e-card-hover-state-layer-color, ${DesignToken$1.color.onSurface}))`),
|
|
4735
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-filled-card-hover-state-layer-opacity, var(--m3e-card-hover-state-layer-opacity, ${DesignToken$1.state.hoverStateLayerOpacity}))`),
|
|
4736
|
+
containerElevation: unsafeCSS(`var(--m3e-filled-card-hover-container-elevation, var(--m3e-card-hover-container-elevation, ${DesignToken$1.elevation.level1}))`)
|
|
4737
|
+
},
|
|
4738
|
+
focus: {
|
|
4739
|
+
textColor: unsafeCSS(`var(--m3e-filled-card-focus-text-color, var(--m3e-card-focus-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
4740
|
+
stateLayerColor: unsafeCSS(`var(--m3e-filled-card-focus-state-layer-color, var(--m3e-card-focus-state-layer-color, ${DesignToken$1.color.onSurface}))`),
|
|
4741
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-filled-card-focus-state-layer-opacity, var(--m3e-card-focus-state-layer-opacity, ${DesignToken$1.state.focusStateLayerOpacity}))`),
|
|
4742
|
+
containerElevation: unsafeCSS(`var(--m3e-filled-card-focus-container-elevation, var(--m3e-card-focus-container-elevation, ${DesignToken$1.elevation.level0}))`)
|
|
4743
|
+
},
|
|
4744
|
+
pressed: {
|
|
4745
|
+
textColor: unsafeCSS(`var(--m3e-filled-card-pressed-text-color, var(--m3e-card-pressed-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
4746
|
+
stateLayerColor: unsafeCSS(`var(--m3e-filled-card-pressed-state-layer-color, var(--m3e-card-pressed-state-layer-color, ${DesignToken$1.color.onSurface}))`),
|
|
4747
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-filled-card-pressed-state-layer-opacity, var(--m3e-card-pressed-state-layer-opacity, ${DesignToken$1.state.pressedStateLayerOpacity}))`),
|
|
4748
|
+
containerElevation: unsafeCSS(`var(--m3e-filled-card-pressed-container-elevation, var(--m3e-card-pressed-container-elevation, ${DesignToken$1.elevation.level0}))`)
|
|
4749
|
+
}
|
|
4750
|
+
},
|
|
4751
|
+
elevated: {
|
|
4752
|
+
textColor: unsafeCSS(`var(--m3e-elevated-card-text-color, var(--m3e-card-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
4753
|
+
containerColor: unsafeCSS(`var(--m3e-elevated-card-container-color, var(--m3e-card-container-color, ${DesignToken$1.color.surfaceContainerLow}))`),
|
|
4754
|
+
containerElevation: unsafeCSS(`var(--m3e-elevated-card-container-elevation, var(--m3e-card-container-elevation, ${DesignToken$1.elevation.level1}))`),
|
|
4755
|
+
disabled: {
|
|
4756
|
+
textColor: unsafeCSS(`var(--m3e-elevated-card-disabled-text-color, var(--m3e-card-disabled-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
4757
|
+
textOpacity: unsafeCSS(`var(--m3e-elevated-card-disabled-text-opacity, var(--m3e-card-disabled-text-opacity, 38%))`),
|
|
4758
|
+
imageOpacity: unsafeCSS(`var(--m3e-elevated-card-disabled-image-opacity, var(--m3e-card-disabled-image-opacity, 38%))`),
|
|
4759
|
+
containerColor: unsafeCSS(`var(--m3e-elevated-card-disabled-container-color, var(--m3e-card-disabled-container-color, ${DesignToken$1.color.surface}))`),
|
|
4760
|
+
containerElevation: unsafeCSS(`var(--m3e-elevated-card-disabled-container-elevation, var(--m3e-card-disabled-container-elevation, ${DesignToken$1.elevation.level1}))`),
|
|
4761
|
+
containerElevationColor: unsafeCSS(`var(--m3e-elevated-card-disabled-container-elevation-color, var(--m3e-card-disabled-container-elevation-color, ${DesignToken$1.color.onSurface}))`),
|
|
4762
|
+
containerElevationOpacity: unsafeCSS(`var(--m3e-elevated-card-disabled-container-elevation-opacity, var(--m3e-card-disabled-container-elevation-opacity, 38%))`),
|
|
4763
|
+
containerOpacity: unsafeCSS(`var(--m3e-elevated-card-disabled-container-opacity, var(--m3e-card-disabled-container-opacity, 38%))`)
|
|
4764
|
+
},
|
|
4765
|
+
hover: {
|
|
4766
|
+
textColor: unsafeCSS(`var(--m3e-elevated-card-hover-text-color, var(--m3e-card-hover-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
4767
|
+
stateLayerColor: unsafeCSS(`var(--m3e-elevated-card-hover-state-layer-color, var(--m3e-card-hover-state-layer-color, ${DesignToken$1.color.onSurface}))`),
|
|
4768
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-elevated-card-hover-state-layer-opacity, var(--m3e-card-hover-state-layer-opacity, ${DesignToken$1.state.hoverStateLayerOpacity}))`),
|
|
4769
|
+
containerElevation: unsafeCSS(`var(--m3e-elevated-card-hover-container-elevation, var(--m3e-card-hover-container-elevation, ${DesignToken$1.elevation.level2}))`)
|
|
4770
|
+
},
|
|
4771
|
+
focus: {
|
|
4772
|
+
textColor: unsafeCSS(`var(--m3e-elevated-card-focus-text-color, var(--m3e-card-focus-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
4773
|
+
stateLayerColor: unsafeCSS(`var(--m3e-elevated-card-focus-state-layer-color, var(--m3e-card-focus-state-layer-color, ${DesignToken$1.color.onSurface}))`),
|
|
4774
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-elevated-card-focus-state-layer-opacity, var(--m3e-card-focus-state-layer-opacity, ${DesignToken$1.state.focusStateLayerOpacity}))`),
|
|
4775
|
+
containerElevation: unsafeCSS(`var(--m3e-elevated-card-focus-container-elevation, var(--m3e-card-focus-container-elevation, ${DesignToken$1.elevation.level1}))`)
|
|
4776
|
+
},
|
|
4777
|
+
pressed: {
|
|
4778
|
+
textColor: unsafeCSS(`var(--m3e-elevated-card-pressed-text-color, var(--m3e-card-pressed-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
4779
|
+
stateLayerColor: unsafeCSS(`var(--m3e-elevated-card-pressed-state-layer-color, var(--m3e-card-pressed-state-layer-color, ${DesignToken$1.color.onSurface}))`),
|
|
4780
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-elevated-card-pressed-state-layer-opacity, var(--m3e-card-pressed-state-layer-opacity, ${DesignToken$1.state.pressedStateLayerOpacity}))`),
|
|
4781
|
+
containerElevation: unsafeCSS(`var(--m3e-elevated-card-pressed-container-elevation, var(--m3e-card-pressed-container-elevation, ${DesignToken$1.elevation.level1}))`)
|
|
4782
|
+
}
|
|
4783
|
+
},
|
|
4784
|
+
outlined: {
|
|
4785
|
+
textColor: unsafeCSS(`var(--m3e-outlined-card-text-color, var(--m3e-card-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
4786
|
+
containerColor: unsafeCSS(`var(--m3e-outlined-card-container-color, var(--m3e-card-container-color, ${DesignToken$1.color.surface}))`),
|
|
4787
|
+
containerElevation: unsafeCSS(`var(--m3e-outlined-card-container-elevation, var(--m3e-card-container-elevation, ${DesignToken$1.elevation.level0}))`),
|
|
4788
|
+
outlineColor: unsafeCSS(`var(--m3e-outlined-card-outline-color, var(--m3e-card-outline-color, ${DesignToken$1.color.outlineVariant}))`),
|
|
4789
|
+
outlineThickness: unsafeCSS("var(--m3e-outlined-card-outline-thickness, var(--m3e-card-outline-thickness, 1px))"),
|
|
4790
|
+
disabled: {
|
|
4791
|
+
textColor: unsafeCSS(`var(--m3e-outlined-card-disabled-text-color, var(--m3e-card-disabled-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
4792
|
+
textOpacity: unsafeCSS(`var(--m3e-outlined-card-disabled-text-opacity, var(--m3e-card-disabled-text-opacity, 38%))`),
|
|
4793
|
+
imageOpacity: unsafeCSS(`var(--m3e-outlined-card-disabled-image-opacity, var(--m3e-card-disabled-image-opacity, 38%))`),
|
|
4794
|
+
containerElevation: unsafeCSS(`var(--m3e-outlined-card-disabled-container-elevation, var(--m3e-card-disabled-container-elevation, ${DesignToken$1.elevation.level0}))`),
|
|
4795
|
+
containerElevationColor: unsafeCSS(`var(--m3e-outlined-card-disabled-container-elevation-color, var(--m3e-card-disabled-container-elevation-color, ${DesignToken$1.color.onSurface}))`),
|
|
4796
|
+
containerElevationOpacity: unsafeCSS(`var(--m3e-outlined-card-disabled-container-elevation-opacity, var(--m3e-card-disabled-container-elevation-opacity, 38%))`),
|
|
4797
|
+
outlineColor: unsafeCSS(`var(--m3e-outlined-card-disabled-outline-color, var(--m3e-card-disabled-outline-color, ${DesignToken$1.color.outline}))`),
|
|
4798
|
+
outlineOpacity: unsafeCSS(`var(--m3e-outlined-card-disabled-outline-opacity, var(--m3e-card-disabled-outline-opacity, 12%))`)
|
|
4799
|
+
},
|
|
4800
|
+
hover: {
|
|
4801
|
+
textColor: unsafeCSS(`var(--m3e-outlined-card-hover-text-color, var(--m3e-card-hover-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
4802
|
+
stateLayerColor: unsafeCSS(`var(--m3e-outlined-card-hover-state-layer-color, var(--m3e-card-hover-state-layer-color, ${DesignToken$1.color.onSurface}))`),
|
|
4803
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-outlined-card-hover-state-layer-opacity, var(--m3e-card-hover-state-layer-opacity, ${DesignToken$1.state.hoverStateLayerOpacity}))`),
|
|
4804
|
+
containerElevation: unsafeCSS(`var(--m3e-outlined-card-hover-container-elevation, var(--m3e-card-hover-container-elevation, ${DesignToken$1.elevation.level1}))`),
|
|
4805
|
+
outlineColor: unsafeCSS(`var(--m3e-outlined-card-hover-outline-color, var(--m3e-card-hover-outline-color, ${DesignToken$1.color.outlineVariant}))`)
|
|
4806
|
+
},
|
|
4807
|
+
focus: {
|
|
4808
|
+
textColor: unsafeCSS(`var(--m3e-outlined-card-focus-text-color, var(--m3e-card-focus-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
4809
|
+
stateLayerColor: unsafeCSS(`var(--m3e-outlined-card-focus-state-layer-color, var(--m3e-card-focus-state-layer-color, ${DesignToken$1.color.onSurface}))`),
|
|
4810
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-outlined-card-focus-state-layer-opacity, var(--m3e-card-focus-state-layer-opacity, ${DesignToken$1.state.focusStateLayerOpacity}))`),
|
|
4811
|
+
containerElevation: unsafeCSS(`var(--m3e-outlined-card-focus-container-elevation, var(--m3e-card-focus-container-elevation, ${DesignToken$1.elevation.level0}))`),
|
|
4812
|
+
outlineColor: unsafeCSS(`var(--m3e-outlined-card-focus-outline-color, var(--m3e-card-focus-outline-color, ${DesignToken$1.color.onSurface}))`)
|
|
4813
|
+
},
|
|
4814
|
+
pressed: {
|
|
4815
|
+
textColor: unsafeCSS(`var(--m3e-outlined-card-pressed-text-color, var(--m3e-card-pressed-text-color, ${DesignToken$1.color.onSurface}))`),
|
|
4816
|
+
stateLayerColor: unsafeCSS(`var(--m3e-outlined-card-pressed-state-layer-color, var(--m3e-card-pressed-state-layer-color, ${DesignToken$1.color.onSurface}))`),
|
|
4817
|
+
stateLayerOpacity: unsafeCSS(`var(--m3e-outlined-card-pressed-state-layer-opacity, var(--m3e-card-pressed-state-layer-opacity, ${DesignToken$1.state.pressedStateLayerOpacity}))`),
|
|
4818
|
+
containerElevation: unsafeCSS(`var(--m3e-outlined-card-pressed-container-elevation, var(--m3e-card-pressed-container-elevation, ${DesignToken$1.elevation.level0}))`),
|
|
4819
|
+
outlineColor: unsafeCSS(`var(--m3e-outlined-card-pressed-outline-color, var(--m3e-card-pressed-outline-color, ${DesignToken$1.color.outlineVariant}))`)
|
|
4820
|
+
}
|
|
4821
|
+
}
|
|
4822
|
+
};
|
|
4823
|
+
|
|
4824
|
+
/**
|
|
4825
|
+
* Baseline styles for `M3eCardElement`.
|
|
4826
|
+
* @internal
|
|
4827
|
+
*/
|
|
4828
|
+
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},
|
|
4829
|
+
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; } }`;
|
|
4830
|
+
|
|
4831
|
+
/** @private */
|
|
4832
|
+
function cardVariantStyle(variant) {
|
|
4833
|
+
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(
|
|
4834
|
+
in srgb,
|
|
4835
|
+
${CardVariantToken[variant].disabled.containerColor} ${CardVariantToken[variant].disabled.containerOpacity},
|
|
4836
|
+
transparent
|
|
4837
|
+
)`) : unsafeCSS("unset")}; border-color: ${CardVariantToken[variant].disabled.outlineColor && CardVariantToken[variant].disabled.outlineOpacity ? unsafeCSS(`color-mix(
|
|
4838
|
+
in srgb,
|
|
4839
|
+
${CardVariantToken[variant].disabled.outlineColor} ${CardVariantToken[variant].disabled.outlineOpacity},
|
|
4840
|
+
transparent
|
|
4841
|
+
)`) : 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}; }`;
|
|
4842
|
+
}
|
|
4843
|
+
/**
|
|
4844
|
+
* Appearance variant styles for `M3eCardElement`.
|
|
4845
|
+
* @internal
|
|
4846
|
+
*/
|
|
4847
|
+
const CardVariantStyle = [cardVariantStyle("filled"), cardVariantStyle("elevated"), cardVariantStyle("outlined")];
|
|
4848
|
+
|
|
4849
|
+
var _M3eCardElement_instances, _M3eCardElement_clickHandler, _M3eCardElement_handleHeaderSlotChange, _M3eCardElement_handleContentSlotChange, _M3eCardElement_handleDefaultSlotChange, _M3eCardElement_handleActionsSlotChange, _M3eCardElement_handleFooterSlotChange, _M3eCardElement_handleClick;
|
|
4850
|
+
/**
|
|
4851
|
+
* A content container for text, images (or other media), and actions in the context of a single subject.
|
|
4852
|
+
*
|
|
4853
|
+
* @description
|
|
4854
|
+
* The `m3e-card` component is a flexible, expressive container for presenting a unified subject—text,
|
|
4855
|
+
* media, and actions—on a visually distinct surface. It supports multiple appearance variants via the
|
|
4856
|
+
* `variant` attribute: `filled` (default, for solid emphasis), `outlined` (for subtle framing with a border),
|
|
4857
|
+
* and `elevated` (for depth and motion with shadow elevation).
|
|
4858
|
+
*
|
|
4859
|
+
* Cards can be made actionable, responding to user interaction when the `actionable` attribute is set, and can be
|
|
4860
|
+
* presented inline with surrounding content using the `inline` attribute.
|
|
4861
|
+
*
|
|
4862
|
+
* It supports both vertical and horizontal layouts through the `orientation` attribute. Content organization is
|
|
4863
|
+
* enabled via dedicated slots for `header`, `content`, `actions`, and `footer`, or developers can use the default
|
|
4864
|
+
* slot for custom layouts.
|
|
4865
|
+
*
|
|
4866
|
+
* The component provides dynamic elevation, adaptive shape, and expressive color theming, and responds to interaction states
|
|
4867
|
+
* (hover, focus, press, disabled) with smooth motion and visual feedback, ensuring clarity, accessibility,
|
|
4868
|
+
* and a cohesive user experience in accordance with Material Design 3 guidelines.
|
|
4869
|
+
*
|
|
4870
|
+
* @example
|
|
4871
|
+
* The following example illustrates each of the dedicated slots of a card.
|
|
4872
|
+
* ```html
|
|
4873
|
+
* <m3e-card>
|
|
4874
|
+
* <div slot="header">Header section</div>
|
|
4875
|
+
* <div slot="content">Content section</div>
|
|
4876
|
+
* <div slot="actions">Actions section</div>
|
|
4877
|
+
* <div slot="footer">Footer section</div>
|
|
4878
|
+
* </m3e-card>
|
|
4879
|
+
* ```
|
|
4880
|
+
*
|
|
4881
|
+
* @tag m3e-card
|
|
4882
|
+
*
|
|
4883
|
+
* @slot - Renders the content of the card without padding.
|
|
4884
|
+
* @slot header - Renders the header of the card.
|
|
3796
4885
|
* @slot content - Renders the content of the card with padding.
|
|
3797
4886
|
* @slot actions - Renders the actions of the card.
|
|
3798
4887
|
* @slot footer - Renders the footer of the card.
|
|
@@ -5125,11 +6214,7 @@ _M3eInputChipSetElement_handleInputKeyDown = function _M3eInputChipSetElement_ha
|
|
|
5125
6214
|
}
|
|
5126
6215
|
};
|
|
5127
6216
|
(() => {
|
|
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
|
-
}
|
|
6217
|
+
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
6218
|
})();
|
|
5134
6219
|
/** The styles of the element. */
|
|
5135
6220
|
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; }`];
|
|
@@ -5780,6 +6865,17 @@ function prefersReducedMotion() {
|
|
|
5780
6865
|
return isServer || matchMedia("(prefers-reduced-motion)").matches;
|
|
5781
6866
|
}
|
|
5782
6867
|
|
|
6868
|
+
/**
|
|
6869
|
+
* Registers a constructable stylesheet in the document's `adoptedStyleSheets`.
|
|
6870
|
+
* @param css - A `CSSResult` (e.g., from `css```) whose text will be injected into a constructable stylesheet.
|
|
6871
|
+
*/
|
|
6872
|
+
function registerStyleSheet(css) {
|
|
6873
|
+
if (typeof window === "undefined") return;
|
|
6874
|
+
const sheet = new CSSStyleSheet();
|
|
6875
|
+
sheet.replaceSync(css.toString());
|
|
6876
|
+
document.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet];
|
|
6877
|
+
}
|
|
6878
|
+
|
|
5783
6879
|
/**
|
|
5784
6880
|
* Resolves an element by ID, waiting for document readiness if needed.
|
|
5785
6881
|
* @param {string} id - The element ID to resolve.
|
|
@@ -6079,6 +7175,46 @@ _HoverController_callback = new WeakMap(), _HoverController_startDelays = new We
|
|
|
6079
7175
|
}
|
|
6080
7176
|
};
|
|
6081
7177
|
|
|
7178
|
+
var _InertController_host, _InertController_inerts;
|
|
7179
|
+
/**
|
|
7180
|
+
* A `ReactiveController` that provides safe, predictable inerting of background
|
|
7181
|
+
* content for modal UI surfaces (dialogs, date pickers, fullscreen search views).
|
|
7182
|
+
*/
|
|
7183
|
+
class InertController {
|
|
7184
|
+
constructor(host) {
|
|
7185
|
+
/** @private */_InertController_host.set(this, void 0);
|
|
7186
|
+
/** @private */
|
|
7187
|
+
_InertController_inerts.set(this, new Array());
|
|
7188
|
+
__classPrivateFieldSet(this, _InertController_host, host, "f");
|
|
7189
|
+
host.addController(this);
|
|
7190
|
+
}
|
|
7191
|
+
/**
|
|
7192
|
+
* Locks background content by applying inertness to all non‑modal elements,
|
|
7193
|
+
* isolating the active surface from pointer and keyboard interaction.
|
|
7194
|
+
*/
|
|
7195
|
+
lock() {
|
|
7196
|
+
this.unlock();
|
|
7197
|
+
for (let current = __classPrivateFieldGet(this, _InertController_host, "f"); current.parentNode && current.parentNode !== document.documentElement; current = current.parentNode) {
|
|
7198
|
+
for (const sibling of current.parentNode.children) {
|
|
7199
|
+
if (sibling instanceof HTMLElement && sibling !== current && !sibling.inert) {
|
|
7200
|
+
sibling.inert = true;
|
|
7201
|
+
__classPrivateFieldGet(this, _InertController_inerts, "f").push(sibling);
|
|
7202
|
+
}
|
|
7203
|
+
}
|
|
7204
|
+
}
|
|
7205
|
+
}
|
|
7206
|
+
/** Restores background interactivity by removing inertness previously applied during `lock()`. */
|
|
7207
|
+
unlock() {
|
|
7208
|
+
__classPrivateFieldGet(this, _InertController_inerts, "f").forEach(x => x.inert = false);
|
|
7209
|
+
__classPrivateFieldGet(this, _InertController_inerts, "f").length = 0;
|
|
7210
|
+
}
|
|
7211
|
+
/** @inheritdoc */
|
|
7212
|
+
hostDisconnected() {
|
|
7213
|
+
this.unlock();
|
|
7214
|
+
}
|
|
7215
|
+
}
|
|
7216
|
+
_InertController_host = new WeakMap(), _InertController_inerts = new WeakMap();
|
|
7217
|
+
|
|
6082
7218
|
var _IntersectionController_callback, _IntersectionController_skipInitial, _IntersectionController_observer, _IntersectionController_unobservedUpdate;
|
|
6083
7219
|
/** A `ReactiveController` used to monitor changes in the intersection of a target element with an ancestor element. */
|
|
6084
7220
|
class IntersectionController extends MonitorControllerBase {
|
|
@@ -6677,6 +7813,55 @@ _ScrollLockController_locked = new WeakMap(), _ScrollLockController_scrollTop =
|
|
|
6677
7813
|
return document.documentElement.scrollHeight > document.documentElement.clientHeight;
|
|
6678
7814
|
};
|
|
6679
7815
|
|
|
7816
|
+
/** Converts an ISO‑8601 date to and from a `Date` object. */
|
|
7817
|
+
const dateConverter = {
|
|
7818
|
+
fromAttribute(value) {
|
|
7819
|
+
if (!value) return null;
|
|
7820
|
+
// Matches all four formats:
|
|
7821
|
+
// yyyy-MM-dd
|
|
7822
|
+
// yyyy-MM-ddTHH:mm:ss
|
|
7823
|
+
// yyyy-MM-ddTHH:mm:ssZ
|
|
7824
|
+
// yyyy-MM-ddTHH:mm:ss±HH:mm
|
|
7825
|
+
const isoRegex = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{3}))?)?(Z|[+-]\d{2}:\d{2})?$/;
|
|
7826
|
+
const m = value.match(isoRegex);
|
|
7827
|
+
if (!m) return null;
|
|
7828
|
+
const year = Number(m[1]);
|
|
7829
|
+
const month = Number(m[2]) - 1; // JS months are 0-based
|
|
7830
|
+
const day = Number(m[3]);
|
|
7831
|
+
const hasTime = m[4] !== undefined;
|
|
7832
|
+
const hours = hasTime ? Number(m[4]) : 0;
|
|
7833
|
+
const minutes = hasTime ? Number(m[5]) : 0;
|
|
7834
|
+
const seconds = hasTime ? Number(m[6]) : 0;
|
|
7835
|
+
const ms = hasTime && m[7] ? Number(m[7]) : 0;
|
|
7836
|
+
const tz = m[8];
|
|
7837
|
+
// CASE 1: yyyy-MM-dd → local date (no timezone math)
|
|
7838
|
+
if (!hasTime && !tz) {
|
|
7839
|
+
return new Date(year, month, day);
|
|
7840
|
+
}
|
|
7841
|
+
// CASE 2: yyyy-MM-ddTHH:mm:ss (no timezone) → local datetime
|
|
7842
|
+
if (hasTime && !tz) {
|
|
7843
|
+
return new Date(year, month, day, hours, minutes, seconds, ms);
|
|
7844
|
+
}
|
|
7845
|
+
// CASE 3: yyyy-MM-ddTHH:mm:ssZ → UTC
|
|
7846
|
+
if (tz === "Z") {
|
|
7847
|
+
return new Date(Date.UTC(year, month, day, hours, minutes, seconds, ms));
|
|
7848
|
+
}
|
|
7849
|
+
// CASE 4: yyyy-MM-ddTHH:mm:ss±HH:mm → offset
|
|
7850
|
+
if (tz && /^[+-]\d{2}:\d{2}$/.test(tz)) {
|
|
7851
|
+
const sign = tz.startsWith("-") ? -1 : 1;
|
|
7852
|
+
const [tzH, tzM] = tz.slice(1).split(":").map(Number);
|
|
7853
|
+
const offsetMinutes = sign * (tzH * 60 + tzM);
|
|
7854
|
+
// Convert offset datetime → UTC → local
|
|
7855
|
+
const utc = Date.UTC(year, month, day, hours, minutes, seconds, ms);
|
|
7856
|
+
return new Date(utc - offsetMinutes * 60_000);
|
|
7857
|
+
}
|
|
7858
|
+
return null;
|
|
7859
|
+
},
|
|
7860
|
+
toAttribute(value) {
|
|
7861
|
+
return value?.toISOString() ?? null;
|
|
7862
|
+
}
|
|
7863
|
+
};
|
|
7864
|
+
|
|
6680
7865
|
/** Converts a space-separated attribute in to an array of strings. */
|
|
6681
7866
|
const spaceSeparatedStringConverter = {
|
|
6682
7867
|
fromAttribute(value) {
|
|
@@ -10251,15 +11436,569 @@ M3eTextHighlightElement = M3eTextHighlightElement_1 = __decorate([customElement(
|
|
|
10251
11436
|
*
|
|
10252
11437
|
* @slot - Renders the content to truncate with an ellipsis.
|
|
10253
11438
|
*/
|
|
10254
|
-
let M3eTextOverflowElement = class M3eTextOverflowElement extends LitElement {
|
|
11439
|
+
let M3eTextOverflowElement = class M3eTextOverflowElement extends LitElement {
|
|
11440
|
+
/** @inheritdoc */
|
|
11441
|
+
render() {
|
|
11442
|
+
return html`<span class="base"><slot></slot></span>`;
|
|
11443
|
+
}
|
|
11444
|
+
};
|
|
11445
|
+
/** The styles of the element. */
|
|
11446
|
+
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; }`;
|
|
11447
|
+
M3eTextOverflowElement = __decorate([customElement("m3e-text-overflow")], M3eTextOverflowElement);
|
|
11448
|
+
|
|
11449
|
+
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_initBreakpointMonitoring, _M3eDatepickerElement_updateVariant, _M3eDatepickerElement_updatePosition, _M3eDatepickerElement_clearAnchoring, _M3eDatepickerElement_clearSelectionState;
|
|
11450
|
+
var M3eDatepickerElement_1;
|
|
11451
|
+
/**
|
|
11452
|
+
* Presents a date picker on a temporary surface.
|
|
11453
|
+
*
|
|
11454
|
+
* @description
|
|
11455
|
+
* The `m3e-datepicker` component provides a date‑selection experience
|
|
11456
|
+
* consistent with Material 3 guidance for layout, motion, and accessibility.
|
|
11457
|
+
* It displays a temporary surface that allows users to select a date or date
|
|
11458
|
+
* range using calendar-based views. The picker supports month, year, and
|
|
11459
|
+
* multi‑year views, enabling users to navigate across time efficiently.
|
|
11460
|
+
*
|
|
11461
|
+
* While open, the picker uses a focused selection flow. Users review their
|
|
11462
|
+
* choice and complete the interaction through confirm, dismiss, or clear
|
|
11463
|
+
* actions, ensuring intentional updates to the field or control that invoked it.
|
|
11464
|
+
*
|
|
11465
|
+
* It accepts and emits plain `Date` values, allowing applications to apply their
|
|
11466
|
+
* own formatting, parsing, and localization.
|
|
11467
|
+
*
|
|
11468
|
+
* @tag m3e-datepicker
|
|
11469
|
+
*
|
|
11470
|
+
* @attr variant - The appearance variant of the picker.
|
|
11471
|
+
* @attr clearable - Whether the user can clear the selected date and close the picker.
|
|
11472
|
+
* @attr date - The selected date.
|
|
11473
|
+
* @attr max-date - The maximum date that can be selected.
|
|
11474
|
+
* @attr min-date - The minimum date that can be selected.
|
|
11475
|
+
* @attr range-end - End of a date range.
|
|
11476
|
+
* @attr range-start - Start of a date range.
|
|
11477
|
+
* @attr start-at - A date specifying the period (month or year) to start the calendar in.
|
|
11478
|
+
* @attr start-view - The initial view used to select a date.
|
|
11479
|
+
* @attr previous-month-label - The accessible label given to the button used to move to the previous month.
|
|
11480
|
+
* @attr next-month-label - The accessible label given to the button used to move to the next month.
|
|
11481
|
+
* @attr previous-year-label - The accessible label given to the button used to move to the previous year.
|
|
11482
|
+
* @attr next-year-label - The accessible label given to the button used to move to the next year.
|
|
11483
|
+
* @attr previous-multi-year-label - The accessible label given to the button used to move to the previous 24 years.
|
|
11484
|
+
* @attr next-multi-year-label - The accessible label given to the button used to move to the next 24 years.
|
|
11485
|
+
* @attr clear-label - The label given to the button used clear the selected date and close the picker.
|
|
11486
|
+
* @attr confirm-label - The label given to the button used apply the selected date and close the picker.
|
|
11487
|
+
* @attr dismiss-label - The label given to the button used discard the selected date and close the picker.
|
|
11488
|
+
* @attr label - The label given to the the picker.
|
|
11489
|
+
*
|
|
11490
|
+
* @fires change - Dispatched when the selected date changes.
|
|
11491
|
+
* @fires beforetoggle - Dispatched before the toggle state changes.
|
|
11492
|
+
* @fires toggle - Dispatched after the toggle state has changed.
|
|
11493
|
+
*
|
|
11494
|
+
* @cssprop --m3e-datepicker-container-padding-block - Block‑axis padding of the date picker container.
|
|
11495
|
+
* @cssprop --m3e-datepicker-container-padding-inline - Inline‑axis padding of the date picker container.
|
|
11496
|
+
* @cssprop --m3e-datepicker-container-color - Background color of the standard container surface.
|
|
11497
|
+
* @cssprop --m3e-datepicker-container-elevation - Elevation shadow applied to the container surface.
|
|
11498
|
+
* @cssprop --m3e-datepicker-modal-headline-font-size - Font size used for the modal headline text.
|
|
11499
|
+
* @cssprop --m3e-datepicker-modal-headline-font-weight - Font weight used for the modal headline text.
|
|
11500
|
+
* @cssprop --m3e-datepicker-modal-headline-line-height - Line height used for the modal headline text.
|
|
11501
|
+
* @cssprop --m3e-datepicker-modal-headline-tracking - Letter spacing used for the modal headline text.
|
|
11502
|
+
* @cssprop --m3e-datepicker-modal-supporting-text-font-size - Font size used for supporting text in modal mode.
|
|
11503
|
+
* @cssprop --m3e-datepicker-modal-supporting-text-font-weight - Font weight used for supporting text in modal mode.
|
|
11504
|
+
* @cssprop --m3e-datepicker-modal-supporting-text-line-height - Line height used for supporting text in modal mode.
|
|
11505
|
+
* @cssprop --m3e-datepicker-modal-supporting-text-tracking - Letter spacing used for supporting text in modal mode.
|
|
11506
|
+
* @cssprop --m3e-datepicker-actions-padding-inline - Inline‑axis padding of the action row.
|
|
11507
|
+
* @cssprop --m3e-datepicker-docked-container-color - Background color of the container in docked mode.
|
|
11508
|
+
* @cssprop --m3e-datepicker-docked-container-shape - Corner radius of the container in docked mode.
|
|
11509
|
+
* @cssprop --m3e-datepicker-modal-container-color - Background color of the container in modal mode.
|
|
11510
|
+
* @cssprop --m3e-datepicker-modal-container-shape - Corner radius of the container in modal mode.
|
|
11511
|
+
* @cssprop --m3e-divider-thickness - Thickness of divider elements within the picker.
|
|
11512
|
+
* @cssprop --m3e-divider-color - Color of divider rules within the picker.
|
|
11513
|
+
* @cssprop --m3e-dialog-scrim-color - Base color used for the modal scrim behind the picker.
|
|
11514
|
+
* @cssprop --m3e-dialog-scrim-opacity - Opacity applied to the scrim color in modal mode.
|
|
11515
|
+
*/
|
|
11516
|
+
let M3eDatepickerElement = M3eDatepickerElement_1 = class M3eDatepickerElement extends SuppressInitialAnimation$1(ReconnectedCallback$1(AttachInternals$1(Role$1(LitElement, "dialog")))) {
|
|
11517
|
+
constructor() {
|
|
11518
|
+
super(...arguments);
|
|
11519
|
+
_M3eDatepickerElement_instances.add(this);
|
|
11520
|
+
/** @private */
|
|
11521
|
+
_M3eDatepickerElement_breakpointUnobserve.set(this, void 0);
|
|
11522
|
+
/** @private */
|
|
11523
|
+
_M3eDatepickerElement_trigger.set(this, void 0);
|
|
11524
|
+
/** @private */
|
|
11525
|
+
_M3eDatepickerElement_anchor.set(this, void 0);
|
|
11526
|
+
/** @private */
|
|
11527
|
+
_M3eDatepickerElement_anchorCleanup.set(this, void 0);
|
|
11528
|
+
/** @private */
|
|
11529
|
+
_M3eDatepickerElement_scrollLockController.set(this, new ScrollLockController$1(this));
|
|
11530
|
+
/** @private */
|
|
11531
|
+
_M3eDatepickerElement_inertController.set(this, new InertController$1(this));
|
|
11532
|
+
/** @private */
|
|
11533
|
+
_M3eDatepickerElement_documentClickHandler.set(this, e => __classPrivateFieldGet(this, _M3eDatepickerElement_instances, "m", _M3eDatepickerElement_handleDocumentClick).call(this, e));
|
|
11534
|
+
/** @private */
|
|
11535
|
+
_M3eDatepickerElement_documentKeyDownHandler.set(this, e => __classPrivateFieldGet(this, _M3eDatepickerElement_instances, "m", _M3eDatepickerElement_handleDocumentKeyDown).call(this, e));
|
|
11536
|
+
/** @private */
|
|
11537
|
+
_M3eDatepickerElement_toggleHandler.set(this, e => {
|
|
11538
|
+
if (e.newState === "closed") {
|
|
11539
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_instances, "m", _M3eDatepickerElement_clearSelectionState).call(this);
|
|
11540
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_anchorCleanup, "f")?.call(this);
|
|
11541
|
+
__classPrivateFieldSet(this, _M3eDatepickerElement_anchorCleanup, undefined, "f");
|
|
11542
|
+
}
|
|
11543
|
+
});
|
|
11544
|
+
/**
|
|
11545
|
+
* The appearance variant of the picker.
|
|
11546
|
+
* @default "docked"
|
|
11547
|
+
*/
|
|
11548
|
+
this.variant = "docked";
|
|
11549
|
+
/**
|
|
11550
|
+
* The initial view used to select a date.
|
|
11551
|
+
* @default "month"
|
|
11552
|
+
*/
|
|
11553
|
+
this.startView = "month";
|
|
11554
|
+
/**
|
|
11555
|
+
* The selected date.
|
|
11556
|
+
* @default null
|
|
11557
|
+
*/
|
|
11558
|
+
this.date = null;
|
|
11559
|
+
/**
|
|
11560
|
+
* A date specifying the period (month or year) to start the calendar in.
|
|
11561
|
+
* @default null
|
|
11562
|
+
*/
|
|
11563
|
+
this.startAt = null;
|
|
11564
|
+
/**
|
|
11565
|
+
* The minimum date that can be selected.
|
|
11566
|
+
* @default null
|
|
11567
|
+
*/
|
|
11568
|
+
this.minDate = null;
|
|
11569
|
+
/**
|
|
11570
|
+
* The maximum date that can be selected.
|
|
11571
|
+
* @default null
|
|
11572
|
+
*/
|
|
11573
|
+
this.maxDate = null;
|
|
11574
|
+
/**
|
|
11575
|
+
* Start of a date range.
|
|
11576
|
+
* @default null
|
|
11577
|
+
*/
|
|
11578
|
+
this.rangeStart = null;
|
|
11579
|
+
/**
|
|
11580
|
+
* End of a date range.
|
|
11581
|
+
* @default null
|
|
11582
|
+
*/
|
|
11583
|
+
this.rangeEnd = null;
|
|
11584
|
+
/**
|
|
11585
|
+
* A function used to determine whether a date cannot be selected.
|
|
11586
|
+
* @default null
|
|
11587
|
+
*/
|
|
11588
|
+
this.blackoutDates = null;
|
|
11589
|
+
/**
|
|
11590
|
+
* A function used to determine whether a date is special.
|
|
11591
|
+
* @default null
|
|
11592
|
+
*/
|
|
11593
|
+
this.specialDates = null;
|
|
11594
|
+
/**
|
|
11595
|
+
* The accessible label given to the button used to move to the previous month.
|
|
11596
|
+
* @default "Previous month"
|
|
11597
|
+
*/
|
|
11598
|
+
this.previousMonthLabel = "Previous month";
|
|
11599
|
+
/**
|
|
11600
|
+
* The accessible label given to the button used to move to the previous year.
|
|
11601
|
+
* @default "Previous year"
|
|
11602
|
+
*/
|
|
11603
|
+
this.previousYearLabel = "Previous year";
|
|
11604
|
+
/**
|
|
11605
|
+
* The accessible label given to the button used to move to the previous 24 years.
|
|
11606
|
+
* @default "Previous 24 years"
|
|
11607
|
+
*/
|
|
11608
|
+
this.previousMultiYearLabel = "Previous 24 years";
|
|
11609
|
+
/**
|
|
11610
|
+
* The accessible label given to the button used to move to the next month.
|
|
11611
|
+
* @default "Next month"
|
|
11612
|
+
*/
|
|
11613
|
+
this.nextMonthLabel = "Next month";
|
|
11614
|
+
/**
|
|
11615
|
+
* The accessible label given to the button used to move to the next year.
|
|
11616
|
+
* @default "Next year"
|
|
11617
|
+
*/
|
|
11618
|
+
this.nextYearLabel = "Next year";
|
|
11619
|
+
/**
|
|
11620
|
+
* The accessible label given to the button used to move to the next 24 years.
|
|
11621
|
+
* @default "Next 24 years"
|
|
11622
|
+
*/
|
|
11623
|
+
this.nextMultiYearLabel = "Next 24 years";
|
|
11624
|
+
/**
|
|
11625
|
+
* Whether the user can clear the selected date and close the picker.
|
|
11626
|
+
* @default false
|
|
11627
|
+
*/
|
|
11628
|
+
this.clearable = false;
|
|
11629
|
+
/**
|
|
11630
|
+
* The label given to the button used clear the selected date and close the picker.
|
|
11631
|
+
* @default "Clear"
|
|
11632
|
+
*/
|
|
11633
|
+
this.clearLabel = "Clear";
|
|
11634
|
+
/**
|
|
11635
|
+
* The label given to the button used apply the selected date and close the picker.
|
|
11636
|
+
* @default "OK"
|
|
11637
|
+
*/
|
|
11638
|
+
this.confirmLabel = "OK";
|
|
11639
|
+
/**
|
|
11640
|
+
* The label given to the button used discard the selected date and close the picker.
|
|
11641
|
+
* @default "Cancel"
|
|
11642
|
+
*/
|
|
11643
|
+
this.dismissLabel = "Cancel";
|
|
11644
|
+
/**
|
|
11645
|
+
* The label given to the the picker.
|
|
11646
|
+
* @default "Select date"
|
|
11647
|
+
*/
|
|
11648
|
+
this.label = "Select date";
|
|
11649
|
+
}
|
|
11650
|
+
/** Whether the picker is open. */
|
|
11651
|
+
get isOpen() {
|
|
11652
|
+
return __classPrivateFieldGet(this, _M3eDatepickerElement_trigger, "f") !== undefined;
|
|
11653
|
+
}
|
|
11654
|
+
/** The current variant applied to the picker. */
|
|
11655
|
+
get currentVariant() {
|
|
11656
|
+
return this._variant ?? (this.variant !== "modal" ? "docked" : "modal");
|
|
11657
|
+
}
|
|
11658
|
+
/** @inheritdoc */
|
|
11659
|
+
connectedCallback() {
|
|
11660
|
+
super.connectedCallback();
|
|
11661
|
+
this.setAttribute("popover", "manual");
|
|
11662
|
+
this.addEventListener("toggle", __classPrivateFieldGet(this, _M3eDatepickerElement_toggleHandler, "f"));
|
|
11663
|
+
document.addEventListener("click", __classPrivateFieldGet(this, _M3eDatepickerElement_documentClickHandler, "f"));
|
|
11664
|
+
document.addEventListener("keydown", __classPrivateFieldGet(this, _M3eDatepickerElement_documentKeyDownHandler, "f"));
|
|
11665
|
+
}
|
|
11666
|
+
/** @inheritdoc */
|
|
11667
|
+
disconnectedCallback() {
|
|
11668
|
+
super.disconnectedCallback();
|
|
11669
|
+
this._variant = undefined;
|
|
11670
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_breakpointUnobserve, "f")?.call(this);
|
|
11671
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_instances, "m", _M3eDatepickerElement_clearAnchoring).call(this);
|
|
11672
|
+
deleteCustomState$1(this, "-docked");
|
|
11673
|
+
deleteCustomState$1(this, "-modal");
|
|
11674
|
+
this.removeEventListener("toggle", __classPrivateFieldGet(this, _M3eDatepickerElement_toggleHandler, "f"));
|
|
11675
|
+
document.removeEventListener("click", __classPrivateFieldGet(this, _M3eDatepickerElement_documentClickHandler, "f"));
|
|
11676
|
+
document.removeEventListener("keydown", __classPrivateFieldGet(this, _M3eDatepickerElement_documentKeyDownHandler, "f"));
|
|
11677
|
+
}
|
|
11678
|
+
/** @inheritdoc */
|
|
11679
|
+
reconnectedCallback() {
|
|
11680
|
+
super.reconnectedCallback();
|
|
11681
|
+
if (this.variant === "auto") {
|
|
11682
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_instances, "m", _M3eDatepickerElement_initBreakpointMonitoring).call(this);
|
|
11683
|
+
}
|
|
11684
|
+
}
|
|
11685
|
+
/**
|
|
11686
|
+
* Opens the picker.
|
|
11687
|
+
* @param {HTMLElement} trigger The element that triggered the picker.
|
|
11688
|
+
* @param {HTMLElement | undefined} anchor The element used to position the picker.
|
|
11689
|
+
* @returns {Promise<void>} A `Promise` that resolves when the picker is opened.
|
|
11690
|
+
*/
|
|
11691
|
+
async show(trigger, anchor) {
|
|
11692
|
+
if (__classPrivateFieldGet(this, _M3eDatepickerElement_trigger, "f") && __classPrivateFieldGet(this, _M3eDatepickerElement_trigger, "f") !== trigger) {
|
|
11693
|
+
this.hide();
|
|
11694
|
+
}
|
|
11695
|
+
if (this.currentVariant === "modal") {
|
|
11696
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_scrollLockController, "f").lock();
|
|
11697
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_inertController, "f").lock();
|
|
11698
|
+
}
|
|
11699
|
+
const calendar = this._calendar;
|
|
11700
|
+
calendar.date = this.date;
|
|
11701
|
+
calendar.rangeStart = this.rangeStart;
|
|
11702
|
+
calendar.rangeEnd = this.rangeEnd;
|
|
11703
|
+
// Reset the start-view
|
|
11704
|
+
calendar.requestUpdate("startView");
|
|
11705
|
+
if (calendar.isUpdatePending) {
|
|
11706
|
+
await calendar.updateComplete;
|
|
11707
|
+
}
|
|
11708
|
+
__classPrivateFieldSet(this, _M3eDatepickerElement_trigger, trigger, "f");
|
|
11709
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_trigger, "f").ariaExpanded = "true";
|
|
11710
|
+
__classPrivateFieldSet(this, _M3eDatepickerElement_anchor, anchor, "f");
|
|
11711
|
+
await __classPrivateFieldGet(this, _M3eDatepickerElement_instances, "m", _M3eDatepickerElement_updatePosition).call(this);
|
|
11712
|
+
this.showPopover();
|
|
11713
|
+
await this._calendar.focusActiveCell();
|
|
11714
|
+
}
|
|
11715
|
+
/**
|
|
11716
|
+
* Hides the picker.
|
|
11717
|
+
* @param {boolean} [restoreFocus=false] Whether to restore focus to the picker's trigger.
|
|
11718
|
+
*/
|
|
11719
|
+
hide(restoreFocus = false) {
|
|
11720
|
+
if (this.currentVariant === "modal") {
|
|
11721
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_scrollLockController, "f").unlock();
|
|
11722
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_inertController, "f").unlock();
|
|
11723
|
+
}
|
|
11724
|
+
this.hidePopover();
|
|
11725
|
+
if (__classPrivateFieldGet(this, _M3eDatepickerElement_trigger, "f")) {
|
|
11726
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_trigger, "f").ariaExpanded = "false";
|
|
11727
|
+
if (restoreFocus) {
|
|
11728
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_trigger, "f").focus();
|
|
11729
|
+
}
|
|
11730
|
+
__classPrivateFieldSet(this, _M3eDatepickerElement_trigger, undefined, "f");
|
|
11731
|
+
}
|
|
11732
|
+
}
|
|
11733
|
+
/**
|
|
11734
|
+
* Toggles the picker.
|
|
11735
|
+
* @param {HTMLElement} trigger The element that triggered the picker.
|
|
11736
|
+
* @param {HTMLElement | undefined} anchor The element used to position the picker.
|
|
11737
|
+
* @returns {Promise<void>} A `Promise` that resolves when the picker is opened or closed.
|
|
11738
|
+
*/
|
|
11739
|
+
async toggle(trigger, anchor) {
|
|
11740
|
+
if (__classPrivateFieldGet(this, _M3eDatepickerElement_trigger, "f")) {
|
|
11741
|
+
this.hide();
|
|
11742
|
+
} else {
|
|
11743
|
+
await this.show(trigger, anchor);
|
|
11744
|
+
}
|
|
11745
|
+
}
|
|
11746
|
+
/** @inheritdoc */
|
|
11747
|
+
render() {
|
|
11748
|
+
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>`;
|
|
11749
|
+
}
|
|
11750
|
+
/** @inheritdoc */
|
|
11751
|
+
willUpdate(changedProperties) {
|
|
11752
|
+
super.willUpdate(changedProperties);
|
|
11753
|
+
if (["date", "rangeStart", "rangeEnd"].some(x => changedProperties.has(x))) {
|
|
11754
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_instances, "m", _M3eDatepickerElement_clearSelectionState).call(this);
|
|
11755
|
+
}
|
|
11756
|
+
if (changedProperties.has("variant")) {
|
|
11757
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_breakpointUnobserve, "f")?.call(this);
|
|
11758
|
+
if (this.variant === "auto") {
|
|
11759
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_instances, "m", _M3eDatepickerElement_initBreakpointMonitoring).call(this);
|
|
11760
|
+
} else {
|
|
11761
|
+
this._variant = undefined;
|
|
11762
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_instances, "m", _M3eDatepickerElement_updateVariant).call(this);
|
|
11763
|
+
}
|
|
11764
|
+
}
|
|
11765
|
+
}
|
|
11766
|
+
/** @inheritdoc */
|
|
11767
|
+
updated(_changedProperties) {
|
|
11768
|
+
super.updated(_changedProperties);
|
|
11769
|
+
if (_changedProperties.has("specialDates") || _changedProperties.has("blackoutDates")) {
|
|
11770
|
+
this._calendar.specialDates = this.specialDates;
|
|
11771
|
+
this._calendar.blackoutDates = this.blackoutDates;
|
|
11772
|
+
}
|
|
11773
|
+
}
|
|
11774
|
+
};
|
|
11775
|
+
_M3eDatepickerElement_breakpointUnobserve = new WeakMap();
|
|
11776
|
+
_M3eDatepickerElement_trigger = new WeakMap();
|
|
11777
|
+
_M3eDatepickerElement_anchor = new WeakMap();
|
|
11778
|
+
_M3eDatepickerElement_anchorCleanup = new WeakMap();
|
|
11779
|
+
_M3eDatepickerElement_scrollLockController = new WeakMap();
|
|
11780
|
+
_M3eDatepickerElement_inertController = new WeakMap();
|
|
11781
|
+
_M3eDatepickerElement_documentClickHandler = new WeakMap();
|
|
11782
|
+
_M3eDatepickerElement_documentKeyDownHandler = new WeakMap();
|
|
11783
|
+
_M3eDatepickerElement_toggleHandler = new WeakMap();
|
|
11784
|
+
_M3eDatepickerElement_instances = new WeakSet();
|
|
11785
|
+
_M3eDatepickerElement_renderHeader = function _M3eDatepickerElement_renderHeader() {
|
|
11786
|
+
if (this.currentVariant === "docked") return nothing;
|
|
11787
|
+
const selectedDate = this._date ?? this.date;
|
|
11788
|
+
return html`<div class="supporting-text">${this.label}</div><div class="headline">${selectedDate ? new Intl.DateTimeFormat(navigator.language, {
|
|
11789
|
+
weekday: "short",
|
|
11790
|
+
month: "short",
|
|
11791
|
+
day: "numeric"
|
|
11792
|
+
}).format(selectedDate) : "––"}</div><div class="divider"></div>`;
|
|
11793
|
+
};
|
|
11794
|
+
_M3eDatepickerElement_handleDocumentClick = function _M3eDatepickerElement_handleDocumentClick(e) {
|
|
11795
|
+
if (!e.composedPath().some(x => x instanceof M3eDatepickerElement_1 || x === __classPrivateFieldGet(this, _M3eDatepickerElement_trigger, "f") || x === __classPrivateFieldGet(this, _M3eDatepickerElement_anchor, "f"))) {
|
|
11796
|
+
this.hide();
|
|
11797
|
+
}
|
|
11798
|
+
};
|
|
11799
|
+
_M3eDatepickerElement_handleCalendarChange = function _M3eDatepickerElement_handleCalendarChange() {
|
|
11800
|
+
this._date = this._calendar.date;
|
|
11801
|
+
this._rangeStart = this._calendar.rangeStart;
|
|
11802
|
+
this._rangeEnd = this._calendar.rangeEnd;
|
|
11803
|
+
};
|
|
11804
|
+
_M3eDatepickerElement_handleClearClick = function _M3eDatepickerElement_handleClearClick() {
|
|
11805
|
+
this.date = null;
|
|
11806
|
+
this.rangeStart = null;
|
|
11807
|
+
this.rangeEnd = null;
|
|
11808
|
+
this.hide(true);
|
|
11809
|
+
this.dispatchEvent(new Event("change", {
|
|
11810
|
+
bubbles: true
|
|
11811
|
+
}));
|
|
11812
|
+
};
|
|
11813
|
+
_M3eDatepickerElement_handleDismissClick = function _M3eDatepickerElement_handleDismissClick() {
|
|
11814
|
+
this.hide(true);
|
|
11815
|
+
};
|
|
11816
|
+
_M3eDatepickerElement_handleConfirmClick = function _M3eDatepickerElement_handleConfirmClick() {
|
|
11817
|
+
this.date = this._date ?? this.date;
|
|
11818
|
+
this.rangeStart = this._rangeStart === undefined ? this.rangeStart : this._rangeStart;
|
|
11819
|
+
this.rangeEnd = this._rangeEnd === undefined ? this.rangeEnd : this._rangeEnd;
|
|
11820
|
+
this.hide(true);
|
|
11821
|
+
this.dispatchEvent(new Event("change", {
|
|
11822
|
+
bubbles: true
|
|
11823
|
+
}));
|
|
11824
|
+
};
|
|
11825
|
+
_M3eDatepickerElement_handleDocumentKeyDown = function _M3eDatepickerElement_handleDocumentKeyDown(e) {
|
|
11826
|
+
if (this.isOpen && this.currentVariant === "modal" && e.key === "Escape" && !e.shiftKey && !e.ctrlKey) {
|
|
11827
|
+
e.preventDefault();
|
|
11828
|
+
this.hide(true);
|
|
11829
|
+
}
|
|
11830
|
+
};
|
|
11831
|
+
_M3eDatepickerElement_initBreakpointMonitoring = function _M3eDatepickerElement_initBreakpointMonitoring() {
|
|
11832
|
+
__classPrivateFieldSet(this, _M3eDatepickerElement_breakpointUnobserve, M3eBreakpointObserver.observe([Breakpoint.XSmall, Breakpoint.Small], matches => {
|
|
11833
|
+
this._variant = matches.get(Breakpoint.XSmall) || matches.get(Breakpoint.Small) ? "modal" : "docked";
|
|
11834
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_instances, "m", _M3eDatepickerElement_updateVariant).call(this);
|
|
11835
|
+
}), "f");
|
|
11836
|
+
};
|
|
11837
|
+
_M3eDatepickerElement_updateVariant = function _M3eDatepickerElement_updateVariant() {
|
|
11838
|
+
switch (this.currentVariant) {
|
|
11839
|
+
case "docked":
|
|
11840
|
+
this.ariaModal = null;
|
|
11841
|
+
deleteCustomState$1(this, "-modal");
|
|
11842
|
+
addCustomState$1(this, "-docked");
|
|
11843
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_scrollLockController, "f").unlock();
|
|
11844
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_inertController, "f").unlock();
|
|
11845
|
+
break;
|
|
11846
|
+
case "modal":
|
|
11847
|
+
this.ariaModal = "true";
|
|
11848
|
+
deleteCustomState$1(this, "-docked");
|
|
11849
|
+
addCustomState$1(this, "-modal");
|
|
11850
|
+
if (this.isOpen) {
|
|
11851
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_scrollLockController, "f").lock();
|
|
11852
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_inertController, "f").lock();
|
|
11853
|
+
}
|
|
11854
|
+
break;
|
|
11855
|
+
}
|
|
11856
|
+
if (this.isOpen) {
|
|
11857
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_instances, "m", _M3eDatepickerElement_updatePosition).call(this);
|
|
11858
|
+
}
|
|
11859
|
+
};
|
|
11860
|
+
_M3eDatepickerElement_updatePosition = /** @private */
|
|
11861
|
+
async function _M3eDatepickerElement_updatePosition() {
|
|
11862
|
+
if (this.currentVariant === "docked" && __classPrivateFieldGet(this, _M3eDatepickerElement_trigger, "f")) {
|
|
11863
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_anchorCleanup, "f")?.call(this);
|
|
11864
|
+
__classPrivateFieldSet(this, _M3eDatepickerElement_anchorCleanup, await positionAnchor(this, __classPrivateFieldGet(this, _M3eDatepickerElement_anchor, "f") ?? __classPrivateFieldGet(this, _M3eDatepickerElement_trigger, "f"), {
|
|
11865
|
+
position: "bottom-start",
|
|
11866
|
+
inline: true,
|
|
11867
|
+
flip: true,
|
|
11868
|
+
shift: "both"
|
|
11869
|
+
}, (x, y, position) => {
|
|
11870
|
+
setCustomState$1(this, "-top", position.includes("top"));
|
|
11871
|
+
setCustomState$1(this, "-bottom", position.includes("bottom"));
|
|
11872
|
+
if (M3eDirectionality.current === "rtl") {
|
|
11873
|
+
this.style.right = `${window.innerWidth - x - this.clientWidth}px`;
|
|
11874
|
+
this.style.left = "";
|
|
11875
|
+
} else {
|
|
11876
|
+
this.style.left = `${x}px`;
|
|
11877
|
+
this.style.right = "";
|
|
11878
|
+
}
|
|
11879
|
+
this.style.top = `${y}px`;
|
|
11880
|
+
}), "f");
|
|
11881
|
+
} else {
|
|
11882
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_instances, "m", _M3eDatepickerElement_clearAnchoring).call(this);
|
|
11883
|
+
}
|
|
11884
|
+
};
|
|
11885
|
+
_M3eDatepickerElement_clearAnchoring = function _M3eDatepickerElement_clearAnchoring() {
|
|
11886
|
+
__classPrivateFieldGet(this, _M3eDatepickerElement_anchorCleanup, "f")?.call(this);
|
|
11887
|
+
__classPrivateFieldSet(this, _M3eDatepickerElement_anchorCleanup, undefined, "f");
|
|
11888
|
+
this.style.left = "";
|
|
11889
|
+
this.style.right = "";
|
|
11890
|
+
this.style.top = "";
|
|
11891
|
+
};
|
|
11892
|
+
_M3eDatepickerElement_clearSelectionState = function _M3eDatepickerElement_clearSelectionState() {
|
|
11893
|
+
this._date = this._rangeStart = this._rangeEnd = undefined;
|
|
11894
|
+
};
|
|
11895
|
+
/** The styles of the element. */
|
|
11896
|
+
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},
|
|
11897
|
+
transform ${DesignToken$1.motion.duration.short2} ${DesignToken$1.motion.easing.standard},
|
|
11898
|
+
overlay ${DesignToken$1.motion.duration.short2} ${DesignToken$1.motion.easing.standard} allow-discrete,
|
|
11899
|
+
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},
|
|
11900
|
+
overlay ${DesignToken$1.motion.duration.short3} ${DesignToken$1.motion.easing.standard} allow-discrete,
|
|
11901
|
+
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},
|
|
11902
|
+
overlay ${DesignToken$1.motion.duration.long2} ${DesignToken$1.motion.easing.standard} allow-discrete,
|
|
11903
|
+
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; } }`;
|
|
11904
|
+
__decorate([state()], M3eDatepickerElement.prototype, "_date", void 0);
|
|
11905
|
+
__decorate([state()], M3eDatepickerElement.prototype, "_rangeStart", void 0);
|
|
11906
|
+
__decorate([state()], M3eDatepickerElement.prototype, "_rangeEnd", void 0);
|
|
11907
|
+
__decorate([query("m3e-calendar")], M3eDatepickerElement.prototype, "_calendar", void 0);
|
|
11908
|
+
__decorate([state()], M3eDatepickerElement.prototype, "_variant", void 0);
|
|
11909
|
+
__decorate([property()], M3eDatepickerElement.prototype, "variant", void 0);
|
|
11910
|
+
__decorate([property({
|
|
11911
|
+
attribute: "start-view"
|
|
11912
|
+
})], M3eDatepickerElement.prototype, "startView", void 0);
|
|
11913
|
+
__decorate([property({
|
|
11914
|
+
converter: dateConverter$1
|
|
11915
|
+
})], M3eDatepickerElement.prototype, "date", void 0);
|
|
11916
|
+
__decorate([property({
|
|
11917
|
+
attribute: "start-at",
|
|
11918
|
+
converter: dateConverter$1
|
|
11919
|
+
})], M3eDatepickerElement.prototype, "startAt", void 0);
|
|
11920
|
+
__decorate([property({
|
|
11921
|
+
attribute: "min-date",
|
|
11922
|
+
converter: dateConverter$1
|
|
11923
|
+
})], M3eDatepickerElement.prototype, "minDate", void 0);
|
|
11924
|
+
__decorate([property({
|
|
11925
|
+
attribute: "max-date",
|
|
11926
|
+
converter: dateConverter$1
|
|
11927
|
+
})], M3eDatepickerElement.prototype, "maxDate", void 0);
|
|
11928
|
+
__decorate([property({
|
|
11929
|
+
attribute: "range-start",
|
|
11930
|
+
converter: dateConverter$1
|
|
11931
|
+
})], M3eDatepickerElement.prototype, "rangeStart", void 0);
|
|
11932
|
+
__decorate([property({
|
|
11933
|
+
attribute: "range-end",
|
|
11934
|
+
converter: dateConverter$1
|
|
11935
|
+
})], M3eDatepickerElement.prototype, "rangeEnd", void 0);
|
|
11936
|
+
__decorate([property({
|
|
11937
|
+
attribute: false
|
|
11938
|
+
})], M3eDatepickerElement.prototype, "blackoutDates", void 0);
|
|
11939
|
+
__decorate([property({
|
|
11940
|
+
attribute: false
|
|
11941
|
+
})], M3eDatepickerElement.prototype, "specialDates", void 0);
|
|
11942
|
+
__decorate([property({
|
|
11943
|
+
attribute: "previous-month-label"
|
|
11944
|
+
})], M3eDatepickerElement.prototype, "previousMonthLabel", void 0);
|
|
11945
|
+
__decorate([property({
|
|
11946
|
+
attribute: "previous-year-label"
|
|
11947
|
+
})], M3eDatepickerElement.prototype, "previousYearLabel", void 0);
|
|
11948
|
+
__decorate([property({
|
|
11949
|
+
attribute: "previous-multi-year-label"
|
|
11950
|
+
})], M3eDatepickerElement.prototype, "previousMultiYearLabel", void 0);
|
|
11951
|
+
__decorate([property({
|
|
11952
|
+
attribute: "next-month-label"
|
|
11953
|
+
})], M3eDatepickerElement.prototype, "nextMonthLabel", void 0);
|
|
11954
|
+
__decorate([property({
|
|
11955
|
+
attribute: "next-year-label"
|
|
11956
|
+
})], M3eDatepickerElement.prototype, "nextYearLabel", void 0);
|
|
11957
|
+
__decorate([property({
|
|
11958
|
+
attribute: "next-multi-year-label"
|
|
11959
|
+
})], M3eDatepickerElement.prototype, "nextMultiYearLabel", void 0);
|
|
11960
|
+
__decorate([property({
|
|
11961
|
+
type: Boolean
|
|
11962
|
+
})], M3eDatepickerElement.prototype, "clearable", void 0);
|
|
11963
|
+
__decorate([property({
|
|
11964
|
+
attribute: "clear-label"
|
|
11965
|
+
})], M3eDatepickerElement.prototype, "clearLabel", void 0);
|
|
11966
|
+
__decorate([property({
|
|
11967
|
+
attribute: "confirm-label"
|
|
11968
|
+
})], M3eDatepickerElement.prototype, "confirmLabel", void 0);
|
|
11969
|
+
__decorate([property({
|
|
11970
|
+
attribute: "dismiss-label"
|
|
11971
|
+
})], M3eDatepickerElement.prototype, "dismissLabel", void 0);
|
|
11972
|
+
__decorate([property()], M3eDatepickerElement.prototype, "label", void 0);
|
|
11973
|
+
M3eDatepickerElement = M3eDatepickerElement_1 = __decorate([customElement$1("m3e-datepicker")], M3eDatepickerElement);
|
|
11974
|
+
|
|
11975
|
+
/**
|
|
11976
|
+
* An element, nested within a clickable element, used to toggle a datepicker.
|
|
11977
|
+
* @tag m3e-datepicker-toggle
|
|
11978
|
+
*/
|
|
11979
|
+
let M3eDatepickerToggleElement = class M3eDatepickerToggleElement extends HtmlFor$1(ActionElementBase$1) {
|
|
10255
11980
|
/** @inheritdoc */
|
|
10256
|
-
|
|
10257
|
-
|
|
11981
|
+
connectedCallback() {
|
|
11982
|
+
super.connectedCallback();
|
|
11983
|
+
if (this.parentElement) {
|
|
11984
|
+
this.parentElement.ariaHasPopup = "dialog";
|
|
11985
|
+
}
|
|
11986
|
+
}
|
|
11987
|
+
/** @inheritdoc */
|
|
11988
|
+
disconnectedCallback() {
|
|
11989
|
+
super.disconnectedCallback();
|
|
11990
|
+
if (this.parentElement) {
|
|
11991
|
+
this.parentElement.ariaHasPopup = null;
|
|
11992
|
+
}
|
|
11993
|
+
}
|
|
11994
|
+
/** @inheritdoc */
|
|
11995
|
+
_onClick() {
|
|
11996
|
+
if (this.control instanceof M3eDatepickerElement && this.parentElement) {
|
|
11997
|
+
this.control.toggle(this.parentElement, this.closest("m3e-form-field") ?? undefined);
|
|
11998
|
+
}
|
|
10258
11999
|
}
|
|
10259
12000
|
};
|
|
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);
|
|
12001
|
+
M3eDatepickerToggleElement = __decorate([customElement$1("m3e-datepicker-toggle")], M3eDatepickerToggleElement);
|
|
10263
12002
|
|
|
10264
12003
|
/**
|
|
10265
12004
|
* An element, nested within a clickable element, used to close a parenting dialog.
|
|
@@ -10689,7 +12428,7 @@ const DrawerContainerStyle = css`:host { display: block; position: relative; ove
|
|
|
10689
12428
|
visibility ${DesignToken$1.motion.duration.medium4} ${DesignToken$1.motion.easing.standard} allow-discrete`)}; } @starting-style { .scrim { opacity: 0; } } :host(:state(-start-push)[start]) .scrim, :host(:state(-end-push)[end]) .scrim, :host(:state(-start-over)[start]) .scrim, :host(:state(-end-over)[end]) .scrim { visibility: visible; opacity: ${DrawerContainerToken.scrimOpacity}; } :host(:state(-start-push)) .start, :host(:state(-start-over)) .start { border-start-end-radius: ${DrawerContainerToken.cornerShape}; border-end-end-radius: ${DrawerContainerToken.cornerShape}; } :host(:state(-end-push)) .end, :host(:state(-end-over)) .end { border-start-start-radius: ${DrawerContainerToken.cornerShape}; border-end-start-radius: ${DrawerContainerToken.cornerShape}; } :host(:state(-start-push)) .start, :host(:state(-end-push)) .end, :host(:state(-start-over)) .start, :host(:state(-end-over)) .end { background-color: ${DrawerContainerToken.modalContainerColor}; box-shadow: ${DrawerContainerToken.modalContainerElevation}; } :host([start-divider]) .start { border-inline-end-color: transparent; border-inline-end-width: ${DrawerContainerToken.dividerThickness}; border-inline-end-style: solid; box-sizing: border-box; } :host([start-divider]:state(-start-side)[start]:not(:state(-end-push)[end]):not(:state(-end-over)[end])) .start { border-inline-end-color: ${DrawerContainerToken.dividerColor}; } :host([end-divider]) .end { border-inline-start-color: transparent; border-inline-start-width: ${DrawerContainerToken.dividerThickness}; border-inline-start-style: solid; box-sizing: border-box; } :host([end-divider]:state(-end-side)[end]:not(:state(-start-push)[start]):not(:state(-start-over)[start])) .end { border-inline-start-color: ${DrawerContainerToken.dividerColor}; } :host(:state(-no-animate)) .start, :host(:state(-no-animate)) .end, :host(:state(-no-animate)) .content { transition: none; } @media (forced-colors: active) { .start, .end { background-color: Canvas; box-shadow: unset; transition: ${unsafeCSS(`margin ${DesignToken$1.motion.duration.medium4} ${DesignToken$1.motion.easing.standard},
|
|
10690
12429
|
visibility ${DesignToken$1.motion.duration.medium4} ${DesignToken$1.motion.easing.standard} allow-discrete`)}; } :host(:state(-start-push)) .start, :host(:state(-end-push)) .end, :host(:state(-start-over)) .start, :host(:state(-end-over)) .end { background-color: Canvas; box-shadow: unset; border-color: CanvasText; } .start, .end { border-style: solid; border-color: Canvas; border-width: 1px; } .start { border-inline-start-style: none; } .end { border-inline-end-style: none; } :host([start-divider]:state(-start-side)[start]:not(:state(-end-push)[end]):not(:state(-end-over)[end])) .start { border-inline-end-color: GrayText; } :host([end-divider]:state(-end-side)[end]:not(:state(-start-push)[start]):not(:state(-start-over)[start])) .end { border-inline-start-color: GrayText; } } @media (prefers-reduced-motion) { .start, .end, .content, .scrim { transition: none; } }`;
|
|
10691
12430
|
|
|
10692
|
-
var _M3eDrawerContainerElement_instances, _M3eDrawerContainerElement_breakpointUnobserve, _M3eDrawerContainerElement_disableStartFocusTrap, _M3eDrawerContainerElement_disableEndFocusTrap, _M3eDrawerContainerElement_resizeController, _M3eDrawerContainerElement_initialize, _M3eDrawerContainerElement_handleScrimClick, _M3eDrawerContainerElement_handleStartSlotChange, _M3eDrawerContainerElement_handleEndSlotChange, _M3eDrawerContainerElement_handleDrawerResize, _M3eDrawerContainerElement_clearMode, _M3eDrawerContainerElement_updateMode;
|
|
12431
|
+
var _M3eDrawerContainerElement_instances, _M3eDrawerContainerElement_breakpointUnobserve, _M3eDrawerContainerElement_disableStartFocusTrap, _M3eDrawerContainerElement_disableEndFocusTrap, _M3eDrawerContainerElement_resizeController, _M3eDrawerContainerElement_initialize, _M3eDrawerContainerElement_handleScrimClick, _M3eDrawerContainerElement_handleStartSlotChange, _M3eDrawerContainerElement_handleEndSlotChange, _M3eDrawerContainerElement_handleDrawerResize, _M3eDrawerContainerElement_initBreakpointMonitoring, _M3eDrawerContainerElement_clearMode, _M3eDrawerContainerElement_updateMode;
|
|
10693
12432
|
/**
|
|
10694
12433
|
* A container for one or two sliding drawers.
|
|
10695
12434
|
*
|
|
@@ -10734,8 +12473,8 @@ var _M3eDrawerContainerElement_instances, _M3eDrawerContainerElement_breakpointU
|
|
|
10734
12473
|
* @cssprop --m3e-drawer-container-elevation - The elevation level of the drawer container.
|
|
10735
12474
|
* @cssprop --m3e-drawer-container-width - The width of the drawer container.
|
|
10736
12475
|
* @cssprop --m3e-drawer-container-scrim-opacity - The opacity of the scrim behind the drawer.
|
|
10737
|
-
* @cssprop --m3e-modal-drawer-start-shape - The shape of the drawer
|
|
10738
|
-
* @cssprop --m3e-modal-drawer-end-shape - The shape of the drawer
|
|
12476
|
+
* @cssprop --m3e-modal-drawer-start-shape - The shape of the drawer's start edge (typically left in LTR).
|
|
12477
|
+
* @cssprop --m3e-modal-drawer-end-shape - The shape of the drawer's end edge (typically right in LTR).
|
|
10739
12478
|
* @cssprop --m3e-modal-drawer-container-color - The background color of the modal drawer container.
|
|
10740
12479
|
* @cssprop --m3e-modal-drawer-elevation - The elevation level of the modal drawer container.
|
|
10741
12480
|
* @cssprop --m3e-drawer-divider-color - The color of the divider between drawer sections.
|
|
@@ -10809,7 +12548,7 @@ let M3eDrawerContainerElement = class M3eDrawerContainerElement extends Reconnec
|
|
|
10809
12548
|
if (changedProperties.has("startMode") || changedProperties.has("endMode")) {
|
|
10810
12549
|
__classPrivateFieldGet(this, _M3eDrawerContainerElement_breakpointUnobserve, "f")?.call(this);
|
|
10811
12550
|
if (this.startMode === "auto" || this.endMode === "auto") {
|
|
10812
|
-
|
|
12551
|
+
__classPrivateFieldGet(this, _M3eDrawerContainerElement_instances, "m", _M3eDrawerContainerElement_initBreakpointMonitoring).call(this);
|
|
10813
12552
|
} else {
|
|
10814
12553
|
__classPrivateFieldGet(this, _M3eDrawerContainerElement_instances, "m", _M3eDrawerContainerElement_updateMode).call(this);
|
|
10815
12554
|
}
|
|
@@ -10834,6 +12573,9 @@ let M3eDrawerContainerElement = class M3eDrawerContainerElement extends Reconnec
|
|
|
10834
12573
|
reconnectedCallback() {
|
|
10835
12574
|
super.reconnectedCallback();
|
|
10836
12575
|
__classPrivateFieldGet(this, _M3eDrawerContainerElement_instances, "m", _M3eDrawerContainerElement_initialize).call(this);
|
|
12576
|
+
if (this.startMode === "auto" || this.endMode === "auto") {
|
|
12577
|
+
__classPrivateFieldGet(this, _M3eDrawerContainerElement_instances, "m", _M3eDrawerContainerElement_initBreakpointMonitoring).call(this);
|
|
12578
|
+
}
|
|
10837
12579
|
}
|
|
10838
12580
|
/** @inheritdoc */
|
|
10839
12581
|
firstUpdated(_changedProperties) {
|
|
@@ -10888,6 +12630,9 @@ _M3eDrawerContainerElement_handleDrawerResize = function _M3eDrawerContainerElem
|
|
|
10888
12630
|
deleteCustomState$1(this, "-no-animate");
|
|
10889
12631
|
}
|
|
10890
12632
|
};
|
|
12633
|
+
_M3eDrawerContainerElement_initBreakpointMonitoring = function _M3eDrawerContainerElement_initBreakpointMonitoring() {
|
|
12634
|
+
__classPrivateFieldSet(this, _M3eDrawerContainerElement_breakpointUnobserve, M3eBreakpointObserver.observe([Breakpoint.XSmall, Breakpoint.Small], matches => __classPrivateFieldGet(this, _M3eDrawerContainerElement_instances, "m", _M3eDrawerContainerElement_updateMode).call(this, matches, true)), "f");
|
|
12635
|
+
};
|
|
10891
12636
|
_M3eDrawerContainerElement_clearMode = function _M3eDrawerContainerElement_clearMode() {
|
|
10892
12637
|
deleteCustomState$1(this, "-start-over");
|
|
10893
12638
|
deleteCustomState$1(this, "-start-push");
|
|
@@ -12796,7 +14541,7 @@ let M3eFabMenuElement = class M3eFabMenuElement extends SuppressInitialAnimation
|
|
|
12796
14541
|
__classPrivateFieldSet(this, _M3eFabMenuElement_anchoringCleanup, await positionAnchor(this, trigger, {
|
|
12797
14542
|
position: "top-end",
|
|
12798
14543
|
inline: true,
|
|
12799
|
-
shift:
|
|
14544
|
+
shift: "main",
|
|
12800
14545
|
flip: true,
|
|
12801
14546
|
offset: 8
|
|
12802
14547
|
}, (x, y, position) => {
|
|
@@ -13427,11 +15172,7 @@ _M3eFormFieldElement_handleErrorChange = function _M3eFormFieldElement_handleErr
|
|
|
13427
15172
|
}
|
|
13428
15173
|
};
|
|
13429
15174
|
(() => {
|
|
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
|
-
}
|
|
15175
|
+
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
15176
|
})();
|
|
13436
15177
|
/** The styles of the element. */
|
|
13437
15178
|
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 +18292,7 @@ let M3eMenuElement = M3eMenuElement_1 = class M3eMenuElement extends SuppressIni
|
|
|
16551
18292
|
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
18293
|
inline: true,
|
|
16553
18294
|
flip: true,
|
|
16554
|
-
shift:
|
|
18295
|
+
shift: "main",
|
|
16555
18296
|
offset: !this.submenu ? 4 : undefined
|
|
16556
18297
|
}, (x, y, position) => {
|
|
16557
18298
|
if (!this.submenu) {
|
|
@@ -16727,11 +18468,7 @@ _M3eMenuElement_deactivate = function _M3eMenuElement_deactivate() {
|
|
|
16727
18468
|
}
|
|
16728
18469
|
};
|
|
16729
18470
|
(() => {
|
|
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
|
-
}
|
|
18471
|
+
registerStyleSheet$1(css`m3e-menu > m3e-divider { margin-block: var(--m3e-menu-divider-spacing, 0.5rem); }`);
|
|
16735
18472
|
})();
|
|
16736
18473
|
/** The styles of the element. */
|
|
16737
18474
|
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},
|
|
@@ -17090,7 +18827,7 @@ _M3eMenuItemRadioElement_handleMouseEnter = function _M3eMenuItemRadioElement_ha
|
|
|
17090
18827
|
M3eMenuItemRadioElement.styles = M3eMenuItemCheckboxElement.styles;
|
|
17091
18828
|
M3eMenuItemRadioElement = __decorate([customElement$1("m3e-menu-item-radio")], M3eMenuItemRadioElement);
|
|
17092
18829
|
|
|
17093
|
-
var _M3eNavBarElement_instances, _M3eNavBarElement_breakpointUnobserve, _M3eNavBarElement_handleSlotChange, _M3eNavBarElement_handleChange, _a$6;
|
|
18830
|
+
var _M3eNavBarElement_instances, _M3eNavBarElement_breakpointUnobserve, _M3eNavBarElement_initBreakpointMonitoring, _M3eNavBarElement_handleSlotChange, _M3eNavBarElement_handleChange, _a$6;
|
|
17094
18831
|
/**
|
|
17095
18832
|
* A horizontal bar, typically used on smaller devices, that allows a user to switch between 3-5 views.
|
|
17096
18833
|
*
|
|
@@ -17122,7 +18859,7 @@ var _M3eNavBarElement_instances, _M3eNavBarElement_breakpointUnobserve, _M3eNavB
|
|
|
17122
18859
|
* @cssprop --m3e-nav-bar-container-color - Background color of the navigation bar container.
|
|
17123
18860
|
* @cssprop --m3e-nav-bar-vertical-item-width - Minimum width of vertical nav items.
|
|
17124
18861
|
*/
|
|
17125
|
-
let M3eNavBarElement = class M3eNavBarElement extends AttachInternals$1(Role$1(LitElement, "navigation")) {
|
|
18862
|
+
let M3eNavBarElement = class M3eNavBarElement extends ReconnectedCallback$1(AttachInternals$1(Role$1(LitElement, "navigation"))) {
|
|
17126
18863
|
constructor() {
|
|
17127
18864
|
super(...arguments);
|
|
17128
18865
|
_M3eNavBarElement_instances.add(this);
|
|
@@ -17158,15 +18895,19 @@ let M3eNavBarElement = class M3eNavBarElement extends AttachInternals$1(Role$1(L
|
|
|
17158
18895
|
__classPrivateFieldGet(this, _M3eNavBarElement_breakpointUnobserve, "f")?.call(this);
|
|
17159
18896
|
}
|
|
17160
18897
|
/** @inheritdoc */
|
|
18898
|
+
reconnectedCallback() {
|
|
18899
|
+
super.reconnectedCallback();
|
|
18900
|
+
if (this.mode === "auto") {
|
|
18901
|
+
__classPrivateFieldGet(this, _M3eNavBarElement_instances, "m", _M3eNavBarElement_initBreakpointMonitoring).call(this);
|
|
18902
|
+
}
|
|
18903
|
+
}
|
|
18904
|
+
/** @inheritdoc */
|
|
17161
18905
|
willUpdate(changedProperties) {
|
|
17162
18906
|
super.willUpdate(changedProperties);
|
|
17163
18907
|
if (changedProperties.has("mode")) {
|
|
17164
18908
|
__classPrivateFieldGet(this, _M3eNavBarElement_breakpointUnobserve, "f")?.call(this);
|
|
17165
18909
|
if (this.mode === "auto") {
|
|
17166
|
-
|
|
17167
|
-
this._mode = matches.get(Breakpoint.XSmall) || matches.get(Breakpoint.Small) ? "compact" : "expanded";
|
|
17168
|
-
this._updateItems();
|
|
17169
|
-
}), "f");
|
|
18910
|
+
__classPrivateFieldGet(this, _M3eNavBarElement_instances, "m", _M3eNavBarElement_initBreakpointMonitoring).call(this);
|
|
17170
18911
|
} else {
|
|
17171
18912
|
this._mode = undefined;
|
|
17172
18913
|
this._updateItems();
|
|
@@ -17194,6 +18935,12 @@ let M3eNavBarElement = class M3eNavBarElement extends AttachInternals$1(Role$1(L
|
|
|
17194
18935
|
_M3eNavBarElement_breakpointUnobserve = new WeakMap();
|
|
17195
18936
|
_M3eNavBarElement_instances = new WeakSet();
|
|
17196
18937
|
_a$6 = selectionManager;
|
|
18938
|
+
_M3eNavBarElement_initBreakpointMonitoring = function _M3eNavBarElement_initBreakpointMonitoring() {
|
|
18939
|
+
__classPrivateFieldSet(this, _M3eNavBarElement_breakpointUnobserve, M3eBreakpointObserver.observe([Breakpoint.XSmall, Breakpoint.Small], matches => {
|
|
18940
|
+
this._mode = matches.get(Breakpoint.XSmall) || matches.get(Breakpoint.Small) ? "compact" : "expanded";
|
|
18941
|
+
this._updateItems();
|
|
18942
|
+
}), "f");
|
|
18943
|
+
};
|
|
17197
18944
|
_M3eNavBarElement_handleSlotChange = function _M3eNavBarElement_handleSlotChange() {
|
|
17198
18945
|
this[selectionManager].setItems([...this.querySelectorAll("m3e-nav-item")]);
|
|
17199
18946
|
this._updateItems();
|
|
@@ -17677,11 +19424,7 @@ _M3eNavMenuItemElement_handleCollapsibleEvent = function _M3eNavMenuItemElement_
|
|
|
17677
19424
|
}));
|
|
17678
19425
|
};
|
|
17679
19426
|
(() => {
|
|
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
|
-
}
|
|
19427
|
+
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
19428
|
})();
|
|
17686
19429
|
/** The styles of the element. */
|
|
17687
19430
|
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 +19747,7 @@ _M3eNavMenuElement_updateItemFocusVisible = function _M3eNavMenuElement_updateIt
|
|
|
18004
19747
|
}
|
|
18005
19748
|
};
|
|
18006
19749
|
(() => {
|
|
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
|
-
}
|
|
19750
|
+
registerStyleSheet$1(css`m3e-nav-menu > m3e-divider { margin-block: var(--m3e-nav-menu-divider-margin, 0.25rem); flex: none; }`);
|
|
18012
19751
|
})();
|
|
18013
19752
|
/** The styles of the element. */
|
|
18014
19753
|
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 +19949,7 @@ _M3eNavRailElement_handleKeyDown = function _M3eNavRailElement_handleKeyDown(e)
|
|
|
18210
19949
|
__classPrivateFieldGet(this, _M3eNavRailElement_focusKeyManager, "f").onKeyDown(e);
|
|
18211
19950
|
};
|
|
18212
19951
|
(() => {
|
|
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
|
-
}
|
|
19952
|
+
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
19953
|
})();
|
|
18219
19954
|
/** The styles of the element. */
|
|
18220
19955
|
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 +20170,7 @@ _M3eOptionElement_handleSlotChange = function _M3eOptionElement_handleSlotChange
|
|
|
18435
20170
|
__classPrivateFieldSet(this, _M3eOptionElement_textContent, getTextContent$1(e.target), "f");
|
|
18436
20171
|
setCustomState$1(this, "-empty", this.isEmpty);
|
|
18437
20172
|
if (this.selected) {
|
|
18438
|
-
this.closest("m3e-select")?.requestUpdate();
|
|
20173
|
+
this.closest("m3e-select")?.requestUpdate?.();
|
|
18439
20174
|
}
|
|
18440
20175
|
};
|
|
18441
20176
|
/** The styles of the element. */
|
|
@@ -18591,7 +20326,7 @@ _M3eOptionPanelElement_handleMutation = function _M3eOptionPanelElement_handleMu
|
|
|
18591
20326
|
let last;
|
|
18592
20327
|
for (let i = 0; i < options.length; i++) {
|
|
18593
20328
|
const option = options[i];
|
|
18594
|
-
if (option.hidden) {
|
|
20329
|
+
if (option.hidden === true) {
|
|
18595
20330
|
deleteCustomState$1(option, "-first");
|
|
18596
20331
|
deleteCustomState$1(option, "-last");
|
|
18597
20332
|
} else if (!first && !(option.parentElement instanceof M3eOptGroupElement)) {
|
|
@@ -18610,11 +20345,7 @@ _M3eOptionPanelElement_handleMutation = function _M3eOptionPanelElement_handleMu
|
|
|
18610
20345
|
}
|
|
18611
20346
|
};
|
|
18612
20347
|
(() => {
|
|
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
|
-
}
|
|
20348
|
+
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
20349
|
})();
|
|
18619
20350
|
/** The styles of the element. */
|
|
18620
20351
|
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 +21503,906 @@ let M3eRadioGroupElement = class M3eRadioGroupElement extends Labelled$1(Require
|
|
|
19772
21503
|
this[selectionManager].activeItem?.click();
|
|
19773
21504
|
});
|
|
19774
21505
|
}
|
|
19775
|
-
/** The list of attributes corresponding to the registered properties. */
|
|
19776
|
-
static get observedAttributes() {
|
|
19777
|
-
return [...super.observedAttributes, "aria-invalid"];
|
|
21506
|
+
/** The list of attributes corresponding to the registered properties. */
|
|
21507
|
+
static get observedAttributes() {
|
|
21508
|
+
return [...super.observedAttributes, "aria-invalid"];
|
|
21509
|
+
}
|
|
21510
|
+
/** The radios in the group. */
|
|
21511
|
+
get radios() {
|
|
21512
|
+
return this[selectionManager]?.items ?? [];
|
|
21513
|
+
}
|
|
21514
|
+
/** The selected radio. */
|
|
21515
|
+
get selected() {
|
|
21516
|
+
return this[selectionManager]?.selectedItems[0] ?? null;
|
|
21517
|
+
}
|
|
21518
|
+
/** The selected value of the radio group. */
|
|
21519
|
+
get value() {
|
|
21520
|
+
return this.selected?.value ?? null;
|
|
21521
|
+
}
|
|
21522
|
+
/** @inheritdoc */
|
|
21523
|
+
markAsTouched() {
|
|
21524
|
+
super.markAsTouched();
|
|
21525
|
+
this.radios.forEach(x => x.markAsTouched());
|
|
21526
|
+
}
|
|
21527
|
+
/** @inheritdoc */
|
|
21528
|
+
markAsUntouched() {
|
|
21529
|
+
super.markAsUntouched();
|
|
21530
|
+
this.radios.forEach(x => x.markAsUntouched());
|
|
21531
|
+
}
|
|
21532
|
+
/** @inheritdoc */
|
|
21533
|
+
markAsDirty() {
|
|
21534
|
+
super.markAsDirty();
|
|
21535
|
+
this.radios.forEach(x => x.markAsDirty());
|
|
21536
|
+
}
|
|
21537
|
+
/** @inheritdoc */
|
|
21538
|
+
markAsPristine() {
|
|
21539
|
+
super.markAsPristine();
|
|
21540
|
+
this.radios.forEach(x => x.markAsPristine());
|
|
21541
|
+
}
|
|
21542
|
+
/** Synchronizes property values when attributes change. */
|
|
21543
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
21544
|
+
super.attributeChangedCallback(name, oldValue, newValue);
|
|
21545
|
+
switch (name) {
|
|
21546
|
+
case "name":
|
|
21547
|
+
this.radios.forEach(x => x.name = this.name);
|
|
21548
|
+
break;
|
|
21549
|
+
case "aria-invalid":
|
|
21550
|
+
this.radios.forEach(x => {
|
|
21551
|
+
setCustomState$1(x, "-invalid", newValue === "true");
|
|
21552
|
+
x[updateLabels$1]?.();
|
|
21553
|
+
});
|
|
21554
|
+
break;
|
|
21555
|
+
}
|
|
21556
|
+
}
|
|
21557
|
+
/** @inheritdoc */
|
|
21558
|
+
connectedCallback() {
|
|
21559
|
+
super.connectedCallback();
|
|
21560
|
+
this.addEventListener("focusout", __classPrivateFieldGet(this, _M3eRadioGroupElement_focusOutHandler, "f"));
|
|
21561
|
+
__classPrivateFieldSet(this, _M3eRadioGroupElement_directionalitySubscription, M3eDirectionality.observe(() => this[selectionManager].directionality = M3eDirectionality.current), "f");
|
|
21562
|
+
}
|
|
21563
|
+
/** @inheritdoc */
|
|
21564
|
+
disconnectedCallback() {
|
|
21565
|
+
super.disconnectedCallback();
|
|
21566
|
+
this.removeEventListener("focusout", __classPrivateFieldGet(this, _M3eRadioGroupElement_focusOutHandler, "f"));
|
|
21567
|
+
__classPrivateFieldGet(this, _M3eRadioGroupElement_directionalitySubscription, "f")?.call(this);
|
|
21568
|
+
}
|
|
21569
|
+
/** @inheritdoc */
|
|
21570
|
+
update(changedProperties) {
|
|
21571
|
+
super.update(changedProperties);
|
|
21572
|
+
if (changedProperties.has("disabled")) {
|
|
21573
|
+
this.ariaDisabled = null;
|
|
21574
|
+
}
|
|
21575
|
+
if (changedProperties.has("disabled") && (changedProperties.get("disabled") !== undefined || this.disabled)) {
|
|
21576
|
+
this[selectionManager].disabled = this.disabled;
|
|
21577
|
+
}
|
|
21578
|
+
}
|
|
21579
|
+
/** @inheritdoc */
|
|
21580
|
+
render() {
|
|
21581
|
+
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>`;
|
|
21582
|
+
}
|
|
21583
|
+
};
|
|
21584
|
+
_M3eRadioGroupElement_directionalitySubscription = new WeakMap();
|
|
21585
|
+
_M3eRadioGroupElement_focusOutHandler = new WeakMap();
|
|
21586
|
+
_M3eRadioGroupElement_instances = new WeakSet();
|
|
21587
|
+
_a$5 = selectionManager;
|
|
21588
|
+
_M3eRadioGroupElement_handleSlotChange = function _M3eRadioGroupElement_handleSlotChange() {
|
|
21589
|
+
const {
|
|
21590
|
+
added
|
|
21591
|
+
} = this[selectionManager].setItems([...this.querySelectorAll("m3e-radio")]);
|
|
21592
|
+
added.forEach(x => x.name = x.name || this.name);
|
|
21593
|
+
};
|
|
21594
|
+
_M3eRadioGroupElement_handleKeyDown = function _M3eRadioGroupElement_handleKeyDown(e) {
|
|
21595
|
+
this[selectionManager].onKeyDown(e);
|
|
21596
|
+
};
|
|
21597
|
+
_M3eRadioGroupElement_handleChange = function _M3eRadioGroupElement_handleChange() {
|
|
21598
|
+
this.checkValidity();
|
|
21599
|
+
};
|
|
21600
|
+
/** The styles of the element. */
|
|
21601
|
+
M3eRadioGroupElement.styles = css`:host { display: inline-flex; }`;
|
|
21602
|
+
M3eRadioGroupElement = __decorate([customElement$1("m3e-radio-group")], M3eRadioGroupElement);
|
|
21603
|
+
|
|
21604
|
+
/** @internal */
|
|
21605
|
+
const SearchBarToken = {
|
|
21606
|
+
containerColor: unsafeCSS(`var(--m3e-search-bar-container-color, ${DesignToken$1.color.surfaceContainerHigh})`),
|
|
21607
|
+
leadingIconColor: unsafeCSS(`var(--m3e-search-bar-leading-icon-color, ${DesignToken$1.color.onSurface})`),
|
|
21608
|
+
trailingIconColor: unsafeCSS(`var(--m3e-search-bar-trailing-icon-color, ${DesignToken$1.color.onSurfaceVariant})`),
|
|
21609
|
+
containerHeight: unsafeCSS("var(--m3e-search-bar-container-height, 3.5rem)"),
|
|
21610
|
+
containerShape: unsafeCSS(`var(--m3e-search-bar-container-shape, ${DesignToken$1.shape.corner.full})`),
|
|
21611
|
+
iconSize: unsafeCSS("var(--m3e-search-bar-icon-size, 1.5rem)"),
|
|
21612
|
+
supportingTextColor: unsafeCSS(`var(--m3e-search-bar-supporting-text-color, ${DesignToken$1.color.onSurfaceVariant})`),
|
|
21613
|
+
supportingTextFontSize: unsafeCSS(`var(--m3e-search-bar-supporting-text-font-size, ${DesignToken$1.typescale.standard.body.large.fontSize})`),
|
|
21614
|
+
supportingTextFontWeight: unsafeCSS(`var(--m3e-search-bar-supporting-text-font-weight, ${DesignToken$1.typescale.standard.body.large.fontWeight})`),
|
|
21615
|
+
supportingTextLineHeight: unsafeCSS(`var(--m3e-search-bar-supporting-text-line-height, ${DesignToken$1.typescale.standard.body.large.lineHeight})`),
|
|
21616
|
+
supportingTextTracking: unsafeCSS(`var(--m3e-search-bar-supporting-text-tracking, ${DesignToken$1.typescale.standard.body.large.tracking})`),
|
|
21617
|
+
inputColor: unsafeCSS(`var(--m3e-search-bar-input-color, ${DesignToken$1.color.onSurface})`),
|
|
21618
|
+
inputTextFontSize: unsafeCSS(`var(--m3e-search-bar-input-text-font-size, ${DesignToken$1.typescale.standard.body.large.fontSize})`),
|
|
21619
|
+
inputTextFontWeight: unsafeCSS(`var(--m3e-search-bar-input-text-font-weight, ${DesignToken$1.typescale.standard.body.large.fontWeight})`),
|
|
21620
|
+
inputTextLineHeight: unsafeCSS(`var(--m3e-search-bar-input-text-line-height, ${DesignToken$1.typescale.standard.body.large.lineHeight})`),
|
|
21621
|
+
inputTextTracking: unsafeCSS(`var(--m3e-search-bar-input-text-tracking, ${DesignToken$1.typescale.standard.body.large.tracking})`),
|
|
21622
|
+
leadingSpace: unsafeCSS("var(--m3e-search-bar-leading-space, 0.25rem)"),
|
|
21623
|
+
trailingSpace: unsafeCSS("var(--m3e-search-bar-trailing-space, 0.25rem)"),
|
|
21624
|
+
noActionsLeadingSpace: unsafeCSS("var(--m3e-search-bar-no-actions-leading-space, 1rem)"),
|
|
21625
|
+
noActionsTrailingSpace: unsafeCSS("var(--m3e-search-bar-no-actions-trailing-space, 1rem)"),
|
|
21626
|
+
leadingActionsTrailingSpace: unsafeCSS("var(--m3e-search-bar-leading-actions-trailing-space, 0.25rem)"),
|
|
21627
|
+
trailingActionsLeadingSpace: unsafeCSS("var(--m3e-search-bar-trailing-actions-leading-space, 0.25rem)"),
|
|
21628
|
+
actionsGap: unsafeCSS("var(--m3e-search-bar-actions-gap, 0px)")
|
|
21629
|
+
};
|
|
21630
|
+
|
|
21631
|
+
/**
|
|
21632
|
+
* Light DOM styles for `M3eSearchBarElement`.
|
|
21633
|
+
* @internal
|
|
21634
|
+
*/
|
|
21635
|
+
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}; }`;
|
|
21636
|
+
/**
|
|
21637
|
+
* Styles for `M3eSearchBarElement`.
|
|
21638
|
+
* @internal
|
|
21639
|
+
*/
|
|
21640
|
+
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; } }`;
|
|
21641
|
+
|
|
21642
|
+
/** @internal */
|
|
21643
|
+
const SearchViewToken = {
|
|
21644
|
+
containerColor: unsafeCSS(`var(--m3e-search-view-container-color, ${DesignToken$1.color.surfaceContainerHigh})`),
|
|
21645
|
+
containedContainerColor: unsafeCSS(`var(--m3e-search-view-contained-container-color, ${DesignToken$1.color.surfaceContainerLow})`),
|
|
21646
|
+
dividerColor: unsafeCSS(`var(--m3e-search-view-divider-color, ${DesignToken$1.color.outline})`),
|
|
21647
|
+
dividerThickness: unsafeCSS(`var(--m3e-search-view-divider-thickness, 1px)`),
|
|
21648
|
+
fullScreenContainerShape: unsafeCSS(`var(--m3e-search-view-full-screen-container-shape, ${DesignToken$1.shape.corner.none})`),
|
|
21649
|
+
fullScreenHeaderContainerHeight: unsafeCSS("var(--m3e-search-view-full-screen-header-container-height, 4.5rem)"),
|
|
21650
|
+
dockedContainerShape: unsafeCSS(`var(--m3e-search-view-docked-container-shape, ${DesignToken$1.shape.corner.extraLarge})`),
|
|
21651
|
+
dockedHeaderContainerHeight: unsafeCSS("var(--m3e-search-view-docked-header-container-height, 3.5rem)"),
|
|
21652
|
+
containedLeadingMargin: unsafeCSS("var(--m3e-search-view-contained-leading-margin, 1.5rem)"),
|
|
21653
|
+
containedTrailingMargin: unsafeCSS("var(--m3e-search-view-contained-trailing-margin, 1.55rem)"),
|
|
21654
|
+
containedFocusedLeadingMargin: unsafeCSS("var(--m3e-search-view-contained-focused-leading-margin, 0.75rem)"),
|
|
21655
|
+
containedFocusedTrailingMargin: unsafeCSS("var(--m3e-search-view-contained-focused-trailing-margin, 0.75rem)"),
|
|
21656
|
+
containedDockedBarResultsGap: unsafeCSS("var(--m3e-search-view-contained-docked-bar-results-gap, 2px)"),
|
|
21657
|
+
containedDockedResultsShape: unsafeCSS(`var(--m3e-search-view-contained-docked-results-shape, ${DesignToken$1.shape.corner.medium})`),
|
|
21658
|
+
containedDockedBarShape: unsafeCSS(`var(--m3e-search-view-contained-docked-bar-shape, ${DesignToken$1.shape.corner.full})`),
|
|
21659
|
+
containedFullScreenBarContainerHeight: unsafeCSS("var(--m3e-search-view-contained-full-screen-bar-container-height, 3.5rem)"),
|
|
21660
|
+
dockedContainerMinHeight: unsafeCSS("var(--m3e-search-view-docked-container-min-height, 240px)"),
|
|
21661
|
+
dockedContainerMaxHeight: unsafeCSS("var(--m3e-search-view-docked-container-max-height, calc(100vh * 0.6667))"),
|
|
21662
|
+
containedDockedResultsSpace: unsafeCSS("var(--m3e-search-view-contained-docked-results-space, 0.25rem)"),
|
|
21663
|
+
dockedResultsBottomSpace: unsafeCSS("var(--m3e-search-view-docked-results-bottom-space, 1rem)"),
|
|
21664
|
+
dockedScrimColor: unsafeCSS(`var(--m3e-search-view-docked-scrim-color, ${DesignToken$1.color.scrim})`),
|
|
21665
|
+
dockedScrimOpacity: unsafeCSS("var(--m3e-search-view-docked-scrim-opacity, 32%)")
|
|
21666
|
+
};
|
|
21667
|
+
|
|
21668
|
+
/**
|
|
21669
|
+
* Light DOM styles for `M3eSearchViewElement`.
|
|
21670
|
+
* @internal
|
|
21671
|
+
*/
|
|
21672
|
+
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}; }`;
|
|
21673
|
+
/**
|
|
21674
|
+
* Styles for `M3eSearchViewElement`.
|
|
21675
|
+
* @internal
|
|
21676
|
+
*/
|
|
21677
|
+
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},
|
|
21678
|
+
overlay ${DesignToken$1.motion.duration.short2} ${DesignToken$1.motion.easing.standard} allow-discrete,
|
|
21679
|
+
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},
|
|
21680
|
+
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},
|
|
21681
|
+
overlay ${DesignToken$1.motion.duration.short3} ${DesignToken$1.motion.easing.standard} allow-discrete,
|
|
21682
|
+
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},
|
|
21683
|
+
overlay ${DesignToken$1.motion.duration.long2} ${DesignToken$1.motion.easing.standard} allow-discrete,
|
|
21684
|
+
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; } }`;
|
|
21685
|
+
|
|
21686
|
+
var _M3eSearchBarElement_instances, _M3eSearchBarElement_input, _M3eSearchBarElement_inputInputHandler, _M3eSearchBarElement_renderClearButton, _M3eSearchBarElement_handleContainerClick, _M3eSearchBarElement_handleLeadingSlotChange, _M3eSearchBarElement_handleTrailingSlotChange, _M3eSearchBarElement_handleInputSlotChange, _M3eSearchBarElement_handleInputInput, _M3eSearchBarElement_handleClearClick;
|
|
21687
|
+
/**
|
|
21688
|
+
* A bar that provides a prominent entry point for search.
|
|
21689
|
+
*
|
|
21690
|
+
* @description
|
|
21691
|
+
* The `m3e-search-bar` component provides a prominent entry point for search,
|
|
21692
|
+
* capturing user input and emitting `query` and `clear` events as the text
|
|
21693
|
+
* changes. It reflects focus and interaction states through customizable CSS
|
|
21694
|
+
* properties for container, icons, and text styling.
|
|
21695
|
+
*
|
|
21696
|
+
* @example
|
|
21697
|
+
* The following example illustrates typical usage with a leading icon and the
|
|
21698
|
+
* ability to clear the current search text.
|
|
21699
|
+
* ```html
|
|
21700
|
+
* <m3e-search-bar clearable>
|
|
21701
|
+
* <m3e-icon name="search" slot="leading"></m3e-icon>
|
|
21702
|
+
* <input slot="input" placeholder="Search..." />
|
|
21703
|
+
* </m3e-search-bar>
|
|
21704
|
+
* ```
|
|
21705
|
+
*
|
|
21706
|
+
* @tag m3e-search-bar
|
|
21707
|
+
*
|
|
21708
|
+
* @attr clearable - Whether the bar presents a button used to clear the search term.
|
|
21709
|
+
* @attr clear-label - The accessible label given to the button used to clear the search term.
|
|
21710
|
+
*
|
|
21711
|
+
* @slot leading - Renders content before the input of the bar.
|
|
21712
|
+
* @slot input - Renders the input of the bar.
|
|
21713
|
+
* @slot trailing - Renders content after the input of the bar.
|
|
21714
|
+
*
|
|
21715
|
+
* @fires clear - Dispatched when the search term is cleared.
|
|
21716
|
+
*
|
|
21717
|
+
* @cssprop --m3e-search-bar-container-color - Background color of the search bar container.
|
|
21718
|
+
* @cssprop --m3e-search-bar-leading-icon-color - Color of the leading icon.
|
|
21719
|
+
* @cssprop --m3e-search-bar-trailing-icon-color - Color of the trailing icon.
|
|
21720
|
+
* @cssprop --m3e-search-bar-container-height - Height of the search bar container.
|
|
21721
|
+
* @cssprop --m3e-search-bar-container-shape - Shape (border radius) of the search bar container.
|
|
21722
|
+
* @cssprop --m3e-search-bar-icon-size - Size of icons inside the search bar.
|
|
21723
|
+
* @cssprop --m3e-search-bar-supporting-text-color - Color of the supporting text.
|
|
21724
|
+
* @cssprop --m3e-search-bar-supporting-text-font-size - Font size of the supporting text.
|
|
21725
|
+
* @cssprop --m3e-search-bar-supporting-text-font-weight - Font weight of the supporting text.
|
|
21726
|
+
* @cssprop --m3e-search-bar-supporting-text-line-height - Line height of the supporting text.
|
|
21727
|
+
* @cssprop --m3e-search-bar-supporting-text-tracking - Letter spacing of the supporting text.
|
|
21728
|
+
* @cssprop --m3e-search-bar-input-color - Color of the input text.
|
|
21729
|
+
* @cssprop --m3e-search-bar-input-text-font-size - Font size of the input text.
|
|
21730
|
+
* @cssprop --m3e-search-bar-input-text-font-weight - Font weight of the input text.
|
|
21731
|
+
* @cssprop --m3e-search-bar-input-text-line-height - Line height of the input text.
|
|
21732
|
+
* @cssprop --m3e-search-bar-input-text-tracking - Letter spacing of the input text.
|
|
21733
|
+
* @cssprop --m3e-search-bar-leading-space - Space before the leading icon.
|
|
21734
|
+
* @cssprop --m3e-search-bar-trailing-space - Space after the trailing icon.
|
|
21735
|
+
* @cssprop --m3e-search-bar-no-actions-leading-space - Leading padding when no actions are present.
|
|
21736
|
+
* @cssprop --m3e-search-bar-no-actions-trailing-space - Trailing padding when no actions are present.
|
|
21737
|
+
* @cssprop --m3e-search-bar-leading-actions-trailing-space - Space between leading actions and the input.
|
|
21738
|
+
* @cssprop --m3e-search-bar-trailing-actions-leading-space - Space between the input and trailing actions.
|
|
21739
|
+
* @cssprop --m3e-search-bar-actions-gap - Gap between action icons.
|
|
21740
|
+
*/
|
|
21741
|
+
let M3eSearchBarElement = class M3eSearchBarElement extends EventAttribute$1(AttachInternals$1(LitElement), "clear") {
|
|
21742
|
+
constructor() {
|
|
21743
|
+
super(...arguments);
|
|
21744
|
+
_M3eSearchBarElement_instances.add(this);
|
|
21745
|
+
/** @private */
|
|
21746
|
+
_M3eSearchBarElement_input.set(this, void 0);
|
|
21747
|
+
/** @private */
|
|
21748
|
+
_M3eSearchBarElement_inputInputHandler.set(this, () => __classPrivateFieldGet(this, _M3eSearchBarElement_instances, "m", _M3eSearchBarElement_handleInputInput).call(this));
|
|
21749
|
+
/**
|
|
21750
|
+
* Whether the bar presents a button used to clear the search term.
|
|
21751
|
+
* @default false
|
|
21752
|
+
*/
|
|
21753
|
+
this.clearable = false;
|
|
21754
|
+
/**
|
|
21755
|
+
* The accessible label given to the button used to clear the search term.
|
|
21756
|
+
* @default "Clear"
|
|
21757
|
+
*/
|
|
21758
|
+
this.clearLabel = "Clear";
|
|
21759
|
+
}
|
|
21760
|
+
/** Clears the search term. */
|
|
21761
|
+
clear() {
|
|
21762
|
+
if (!__classPrivateFieldGet(this, _M3eSearchBarElement_input, "f")) return;
|
|
21763
|
+
__classPrivateFieldGet(this, _M3eSearchBarElement_input, "f").value = "";
|
|
21764
|
+
__classPrivateFieldGet(this, _M3eSearchBarElement_instances, "m", _M3eSearchBarElement_handleInputInput).call(this);
|
|
21765
|
+
this.dispatchEvent(new Event("clear", {
|
|
21766
|
+
bubbles: true,
|
|
21767
|
+
composed: true
|
|
21768
|
+
}));
|
|
21769
|
+
}
|
|
21770
|
+
/** @inheritdoc */
|
|
21771
|
+
render() {
|
|
21772
|
+
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>`;
|
|
21773
|
+
}
|
|
21774
|
+
};
|
|
21775
|
+
_M3eSearchBarElement_input = new WeakMap();
|
|
21776
|
+
_M3eSearchBarElement_inputInputHandler = new WeakMap();
|
|
21777
|
+
_M3eSearchBarElement_instances = new WeakSet();
|
|
21778
|
+
_M3eSearchBarElement_renderClearButton = function _M3eSearchBarElement_renderClearButton() {
|
|
21779
|
+
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;
|
|
21780
|
+
};
|
|
21781
|
+
_M3eSearchBarElement_handleContainerClick = function _M3eSearchBarElement_handleContainerClick() {
|
|
21782
|
+
if (!this.matches(":focus-within")) {
|
|
21783
|
+
__classPrivateFieldGet(this, _M3eSearchBarElement_input, "f")?.focus();
|
|
21784
|
+
}
|
|
21785
|
+
};
|
|
21786
|
+
_M3eSearchBarElement_handleLeadingSlotChange = function _M3eSearchBarElement_handleLeadingSlotChange(e) {
|
|
21787
|
+
setCustomState$1(this, "-with-leading", hasAssignedNodes$1(e.target));
|
|
21788
|
+
};
|
|
21789
|
+
_M3eSearchBarElement_handleTrailingSlotChange = function _M3eSearchBarElement_handleTrailingSlotChange(e) {
|
|
21790
|
+
setCustomState$1(this, "-with-trailing", hasAssignedNodes$1(e.target));
|
|
21791
|
+
};
|
|
21792
|
+
_M3eSearchBarElement_handleInputSlotChange = function _M3eSearchBarElement_handleInputSlotChange(e) {
|
|
21793
|
+
const input = e.target.assignedElements({
|
|
21794
|
+
flatten: true
|
|
21795
|
+
}).find(x => x instanceof HTMLInputElement);
|
|
21796
|
+
if (input != __classPrivateFieldGet(this, _M3eSearchBarElement_input, "f")) {
|
|
21797
|
+
__classPrivateFieldGet(this, _M3eSearchBarElement_input, "f")?.removeEventListener("input", __classPrivateFieldGet(this, _M3eSearchBarElement_inputInputHandler, "f"));
|
|
21798
|
+
__classPrivateFieldSet(this, _M3eSearchBarElement_input, input, "f");
|
|
21799
|
+
__classPrivateFieldGet(this, _M3eSearchBarElement_input, "f")?.addEventListener("input", __classPrivateFieldGet(this, _M3eSearchBarElement_inputInputHandler, "f"));
|
|
21800
|
+
if (__classPrivateFieldGet(this, _M3eSearchBarElement_input, "f")) {
|
|
21801
|
+
__classPrivateFieldGet(this, _M3eSearchBarElement_input, "f").role = __classPrivateFieldGet(this, _M3eSearchBarElement_input, "f").role || "searchbox";
|
|
21802
|
+
__classPrivateFieldGet(this, _M3eSearchBarElement_input, "f").inputMode = __classPrivateFieldGet(this, _M3eSearchBarElement_input, "f").inputMode || "search";
|
|
21803
|
+
__classPrivateFieldGet(this, _M3eSearchBarElement_input, "f").type = "text";
|
|
21804
|
+
}
|
|
21805
|
+
__classPrivateFieldGet(this, _M3eSearchBarElement_instances, "m", _M3eSearchBarElement_handleInputInput).call(this);
|
|
21806
|
+
}
|
|
21807
|
+
};
|
|
21808
|
+
_M3eSearchBarElement_handleInputInput = function _M3eSearchBarElement_handleInputInput() {
|
|
21809
|
+
setCustomState$1(this, "-clearable", this.clearable && (__classPrivateFieldGet(this, _M3eSearchBarElement_input, "f")?.value ?? "").length > 0);
|
|
21810
|
+
};
|
|
21811
|
+
_M3eSearchBarElement_handleClearClick = function _M3eSearchBarElement_handleClearClick() {
|
|
21812
|
+
this.clear();
|
|
21813
|
+
__classPrivateFieldGet(this, _M3eSearchBarElement_input, "f")?.focus();
|
|
21814
|
+
};
|
|
21815
|
+
(() => {
|
|
21816
|
+
registerStyleSheet$1(SearchBarLightDomStyle);
|
|
21817
|
+
})();
|
|
21818
|
+
/** The styles of the element. */
|
|
21819
|
+
M3eSearchBarElement.styles = SearchBarStyle;
|
|
21820
|
+
__decorate([property({
|
|
21821
|
+
type: Boolean,
|
|
21822
|
+
reflect: true
|
|
21823
|
+
})], M3eSearchBarElement.prototype, "clearable", void 0);
|
|
21824
|
+
__decorate([property({
|
|
21825
|
+
attribute: "clear-label"
|
|
21826
|
+
})], M3eSearchBarElement.prototype, "clearLabel", void 0);
|
|
21827
|
+
M3eSearchBarElement = __decorate([customElement$1("m3e-search-bar")], M3eSearchBarElement);
|
|
21828
|
+
|
|
21829
|
+
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_initBreakpointMonitoring, _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;
|
|
21830
|
+
/**
|
|
21831
|
+
* A surface that presents suggestions and results for a search.
|
|
21832
|
+
*
|
|
21833
|
+
* @description
|
|
21834
|
+
* The `m3e-search-view` component presents the surface for suggestions,
|
|
21835
|
+
* history, and results, managing the open and close lifecycle around an
|
|
21836
|
+
* embedded search bar. It emits `query`, `clear`, and `toggle`, events to
|
|
21837
|
+
* support application driven search logic, and exposes CSS properties for
|
|
21838
|
+
* container, shape, spacing, and layout across contained, docked, and full
|
|
21839
|
+
* screen configurations.
|
|
21840
|
+
*
|
|
21841
|
+
* @example
|
|
21842
|
+
* The following example shows a contained view in docked mode with a simple set of search results.
|
|
21843
|
+
* ```html
|
|
21844
|
+
* <m3e-search-view mode="docked" contained>
|
|
21845
|
+
* <input slot="input" placeholder="Search..." />
|
|
21846
|
+
* <m3e-list>
|
|
21847
|
+
* <m3e-list-item>Result One</m3e-list-item>
|
|
21848
|
+
* <m3e-list-item>Result Two</m3e-list-item>
|
|
21849
|
+
* <m3e-list-item>Result Three</m3e-list-item>
|
|
21850
|
+
* </m3e-list>
|
|
21851
|
+
* </m3e-search-view>
|
|
21852
|
+
* ```
|
|
21853
|
+
*
|
|
21854
|
+
* @tag m3e-search-view
|
|
21855
|
+
*
|
|
21856
|
+
* @attr contained - Whether the view features a persistent, filled search container.
|
|
21857
|
+
* @attr mode - The behavior mode of the view.
|
|
21858
|
+
* @attr open - Whether the view is expanded to show results.
|
|
21859
|
+
* @attr clear-label - The accessible label given to the button used to clear the search term.
|
|
21860
|
+
* @attr close-label - The accessible label given to the button used to collapse the view.
|
|
21861
|
+
* @attr hide-search-icon - Whether to hide the search icon.
|
|
21862
|
+
*
|
|
21863
|
+
* @slot - When open, renders the results content of the view.
|
|
21864
|
+
* @slot input - Renders the input of the view.
|
|
21865
|
+
* @slot open-leading - When open, renders content before the input of the view.
|
|
21866
|
+
* @slot open-trailing - When open, renders content after the input of the view.
|
|
21867
|
+
* @slot closed-leading - When closed, renders content before the input of the view.
|
|
21868
|
+
* @slot closed-trailing - When closed, renders content after the input of the view.
|
|
21869
|
+
*
|
|
21870
|
+
* @fires clear - Dispatched when the search term is cleared.
|
|
21871
|
+
* @fires query - Dispatched when the view is opened or when the user modifies the search term.
|
|
21872
|
+
* @fires beforetoggle - Dispatched before the toggle state changes.
|
|
21873
|
+
* @fires toggle - Dispatched after the toggle state has changed.
|
|
21874
|
+
*
|
|
21875
|
+
* @cssprop --m3e-search-view-container-color - Background color of the view container.
|
|
21876
|
+
* @cssprop --m3e-search-view-contained-container-color - Background color of the contained view container.
|
|
21877
|
+
* @cssprop --m3e-search-view-divider-color - Color of the divider separating header and results.
|
|
21878
|
+
* @cssprop --m3e-search-view-divider-thickness - Thickness of the divider separating header and results.
|
|
21879
|
+
* @cssprop --m3e-search-view-full-screen-container-shape - Shape of the fullscreen view container.
|
|
21880
|
+
* @cssprop --m3e-search-view-full-screen-header-container-height - Height of the header container in fullscreen mode.
|
|
21881
|
+
* @cssprop --m3e-search-view-docked-container-shape - Shape of the docked view container.
|
|
21882
|
+
* @cssprop --m3e-search-view-docked-header-container-height - Height of the header container in docked mode.
|
|
21883
|
+
* @cssprop --m3e-search-view-contained-leading-margin - Leading margin for the contained view.
|
|
21884
|
+
* @cssprop --m3e-search-view-contained-trailing-margin - Trailing margin for the contained view.
|
|
21885
|
+
* @cssprop --m3e-search-view-contained-focused-leading-margin - Leading margin when the contained view is focused.
|
|
21886
|
+
* @cssprop --m3e-search-view-contained-focused-trailing-margin - Trailing margin when the contained view is focused.
|
|
21887
|
+
* @cssprop --m3e-search-view-contained-docked-bar-results-gap - Gap between the contained docked bar and results.
|
|
21888
|
+
* @cssprop --m3e-search-view-contained-docked-results-shape - Shape of the results container in contained docked mode.
|
|
21889
|
+
* @cssprop --m3e-search-view-contained-docked-bar-shape - Shape of the bar in contained docked mode.
|
|
21890
|
+
* @cssprop --m3e-search-view-contained-full-screen-bar-container-height - Height of the bar container in contained fullscreen mode.
|
|
21891
|
+
* @cssprop --m3e-search-view-docked-container-min-height - Minimum height of the docked view container.
|
|
21892
|
+
* @cssprop --m3e-search-view-docked-container-max-height - Maximum height of the docked view container.
|
|
21893
|
+
* @cssprop --m3e-search-view-contained-docked-results-space - Space above the results in contained docked mode.
|
|
21894
|
+
* @cssprop --m3e-search-view-docked-results-bottom-space - Space below the results in docked mode.
|
|
21895
|
+
* @cssprop --m3e-search-view-docked-scrim-color - Color of the scrim behind the docked view.
|
|
21896
|
+
* @cssprop --m3e-search-view-docked-scrim-opacity - Opacity of the scrim behind the docked view.
|
|
21897
|
+
*/
|
|
21898
|
+
let M3eSearchViewElement = class M3eSearchViewElement extends EventAttribute$1(ReconnectedCallback$1(AttachInternals$1(LitElement)), "clear", "query") {
|
|
21899
|
+
constructor() {
|
|
21900
|
+
super();
|
|
21901
|
+
_M3eSearchViewElement_instances.add(this);
|
|
21902
|
+
/** @private */
|
|
21903
|
+
_M3eSearchViewElement_input.set(this, void 0);
|
|
21904
|
+
/** @private */
|
|
21905
|
+
_M3eSearchViewElement_closeOnInputFocus.set(this, false);
|
|
21906
|
+
/** @private */
|
|
21907
|
+
_M3eSearchViewElement_inputInputHandler.set(this, () => __classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_handleInputInput).call(this));
|
|
21908
|
+
/** @private */
|
|
21909
|
+
_M3eSearchViewElement_inputFocusHandler.set(this, () => __classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_handleInputFocus).call(this));
|
|
21910
|
+
/** @private */
|
|
21911
|
+
_M3eSearchViewElement_inputKeyDownHandler.set(this, e => __classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_handleInputKeyDown).call(this, e));
|
|
21912
|
+
/** @private */
|
|
21913
|
+
_M3eSearchViewElement_inputPointerHandler.set(this, () => __classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_handleInputPointerDown).call(this));
|
|
21914
|
+
/** @private */
|
|
21915
|
+
_M3eSearchViewElement_scrollLockController.set(this, new ScrollLockController$1(this));
|
|
21916
|
+
/** @private */
|
|
21917
|
+
_M3eSearchViewElement_inertController.set(this, new InertController$1(this));
|
|
21918
|
+
/** @private */
|
|
21919
|
+
this._clearable = false;
|
|
21920
|
+
/** @private */
|
|
21921
|
+
_M3eSearchViewElement_openMode.set(this, void 0);
|
|
21922
|
+
/** @private */
|
|
21923
|
+
_M3eSearchViewElement_anchorCleanup.set(this, void 0);
|
|
21924
|
+
/** @private */
|
|
21925
|
+
_M3eSearchViewElement_breakpointUnobserve.set(this, void 0);
|
|
21926
|
+
/**
|
|
21927
|
+
* Whether the view features a persistent, filled search container.
|
|
21928
|
+
* @default false
|
|
21929
|
+
*/
|
|
21930
|
+
this.contained = false;
|
|
21931
|
+
/**
|
|
21932
|
+
* The behavior mode of the view.
|
|
21933
|
+
* @default "docked"
|
|
21934
|
+
*/
|
|
21935
|
+
this.mode = "docked";
|
|
21936
|
+
/**
|
|
21937
|
+
* Whether the view is expanded to show results.
|
|
21938
|
+
* @default false
|
|
21939
|
+
*/
|
|
21940
|
+
this.open = false;
|
|
21941
|
+
/**
|
|
21942
|
+
* The accessible label given to the button used to clear the search term.
|
|
21943
|
+
* @default "Clear"
|
|
21944
|
+
*/
|
|
21945
|
+
this.clearLabel = "Clear";
|
|
21946
|
+
/**
|
|
21947
|
+
* The accessible label given to the button used to collapse the view.
|
|
21948
|
+
* @default "Close"
|
|
21949
|
+
*/
|
|
21950
|
+
this.closeLabel = "Close";
|
|
21951
|
+
/**
|
|
21952
|
+
* Whether to hide the search icon.
|
|
21953
|
+
* @default false;
|
|
21954
|
+
*/
|
|
21955
|
+
this.hideSearchIcon = false;
|
|
21956
|
+
new FocusController$1(this, {
|
|
21957
|
+
callback: focused => this._handleFocusChange(focused)
|
|
21958
|
+
});
|
|
21959
|
+
}
|
|
21960
|
+
/** The current mode applied to the view. */
|
|
21961
|
+
get currentMode() {
|
|
21962
|
+
return this._mode ?? (this.mode !== "fullscreen" ? "docked" : "fullscreen");
|
|
19778
21963
|
}
|
|
19779
|
-
|
|
19780
|
-
|
|
19781
|
-
return this[selectionManager]?.items ?? [];
|
|
21964
|
+
set currentMode(value) {
|
|
21965
|
+
this._mode = value;
|
|
19782
21966
|
}
|
|
19783
|
-
/**
|
|
19784
|
-
|
|
19785
|
-
|
|
21967
|
+
/** Clears the search term. */
|
|
21968
|
+
clear() {
|
|
21969
|
+
if (!__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")) return;
|
|
21970
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f").value = "";
|
|
21971
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_updateClearableState).call(this);
|
|
21972
|
+
this.dispatchEvent(new CustomEvent("query", {
|
|
21973
|
+
detail: {
|
|
21974
|
+
term: ""
|
|
21975
|
+
},
|
|
21976
|
+
bubbles: true,
|
|
21977
|
+
composed: true
|
|
21978
|
+
}));
|
|
21979
|
+
this.dispatchEvent(new Event("clear", {
|
|
21980
|
+
bubbles: true,
|
|
21981
|
+
composed: true
|
|
21982
|
+
}));
|
|
19786
21983
|
}
|
|
19787
|
-
/**
|
|
19788
|
-
|
|
19789
|
-
|
|
21984
|
+
/** @inheritdoc */
|
|
21985
|
+
disconnectedCallback() {
|
|
21986
|
+
super.disconnectedCallback();
|
|
21987
|
+
this._mode = undefined;
|
|
21988
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_breakpointUnobserve, "f")?.call(this);
|
|
19790
21989
|
}
|
|
19791
21990
|
/** @inheritdoc */
|
|
19792
|
-
|
|
19793
|
-
super.
|
|
19794
|
-
this.
|
|
21991
|
+
reconnectedCallback() {
|
|
21992
|
+
super.reconnectedCallback();
|
|
21993
|
+
if (this.mode === "auto") {
|
|
21994
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_initBreakpointMonitoring).call(this);
|
|
21995
|
+
}
|
|
19795
21996
|
}
|
|
19796
21997
|
/** @inheritdoc */
|
|
19797
|
-
|
|
19798
|
-
super.
|
|
19799
|
-
|
|
21998
|
+
willUpdate(changedProperties) {
|
|
21999
|
+
super.willUpdate(changedProperties);
|
|
22000
|
+
if (changedProperties.has("mode")) {
|
|
22001
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_breakpointUnobserve, "f")?.call(this);
|
|
22002
|
+
const previousMode = changedProperties.get("mode");
|
|
22003
|
+
if (previousMode && previousMode !== this.mode && this.open) {
|
|
22004
|
+
this.open = false;
|
|
22005
|
+
}
|
|
22006
|
+
if (this.mode === "auto") {
|
|
22007
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_initBreakpointMonitoring).call(this);
|
|
22008
|
+
} else {
|
|
22009
|
+
this._mode = undefined;
|
|
22010
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_updateMode).call(this);
|
|
22011
|
+
}
|
|
22012
|
+
}
|
|
22013
|
+
if (changedProperties.has("_mode")) {
|
|
22014
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_updateMode).call(this);
|
|
22015
|
+
}
|
|
19800
22016
|
}
|
|
19801
22017
|
/** @inheritdoc */
|
|
19802
|
-
|
|
19803
|
-
super.
|
|
19804
|
-
|
|
22018
|
+
updated(_changedProperties) {
|
|
22019
|
+
super.updated(_changedProperties);
|
|
22020
|
+
if (_changedProperties.has("open")) {
|
|
22021
|
+
if (!this.open) {
|
|
22022
|
+
if ((__classPrivateFieldGet(this, _M3eSearchViewElement_openMode, "f") ?? this.currentMode) === "fullscreen") {
|
|
22023
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_closeFullscreen).call(this);
|
|
22024
|
+
} else {
|
|
22025
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_closeDocked).call(this);
|
|
22026
|
+
}
|
|
22027
|
+
} else {
|
|
22028
|
+
if (this.currentMode === "fullscreen") {
|
|
22029
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_openFullscreen).call(this);
|
|
22030
|
+
} else {
|
|
22031
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_openDocked).call(this);
|
|
22032
|
+
}
|
|
22033
|
+
}
|
|
22034
|
+
}
|
|
19805
22035
|
}
|
|
19806
22036
|
/** @inheritdoc */
|
|
19807
|
-
|
|
19808
|
-
|
|
19809
|
-
this.radios.forEach(x => x.markAsPristine());
|
|
22037
|
+
render() {
|
|
22038
|
+
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
22039
|
}
|
|
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;
|
|
22040
|
+
/** @private */
|
|
22041
|
+
_handleFocusChange(focused) {
|
|
22042
|
+
if (!focused && this.currentMode === "docked") {
|
|
22043
|
+
this.clear();
|
|
22044
|
+
this.open = false;
|
|
19824
22045
|
}
|
|
19825
22046
|
}
|
|
19826
|
-
|
|
19827
|
-
|
|
19828
|
-
|
|
19829
|
-
|
|
19830
|
-
|
|
22047
|
+
};
|
|
22048
|
+
_M3eSearchViewElement_input = new WeakMap();
|
|
22049
|
+
_M3eSearchViewElement_closeOnInputFocus = new WeakMap();
|
|
22050
|
+
_M3eSearchViewElement_inputInputHandler = new WeakMap();
|
|
22051
|
+
_M3eSearchViewElement_inputFocusHandler = new WeakMap();
|
|
22052
|
+
_M3eSearchViewElement_inputKeyDownHandler = new WeakMap();
|
|
22053
|
+
_M3eSearchViewElement_inputPointerHandler = new WeakMap();
|
|
22054
|
+
_M3eSearchViewElement_scrollLockController = new WeakMap();
|
|
22055
|
+
_M3eSearchViewElement_inertController = new WeakMap();
|
|
22056
|
+
_M3eSearchViewElement_openMode = new WeakMap();
|
|
22057
|
+
_M3eSearchViewElement_anchorCleanup = new WeakMap();
|
|
22058
|
+
_M3eSearchViewElement_breakpointUnobserve = new WeakMap();
|
|
22059
|
+
_M3eSearchViewElement_instances = new WeakSet();
|
|
22060
|
+
_M3eSearchViewElement_renderIconOrBackButton = function _M3eSearchViewElement_renderIconOrBackButton() {
|
|
22061
|
+
if (!this.open && this.hideSearchIcon) return nothing;
|
|
22062
|
+
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>`;
|
|
22063
|
+
};
|
|
22064
|
+
_M3eSearchViewElement_renderIcon = function _M3eSearchViewElement_renderIcon() {
|
|
22065
|
+
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>`;
|
|
22066
|
+
};
|
|
22067
|
+
_M3eSearchViewElement_renderBackButton = function _M3eSearchViewElement_renderBackButton() {
|
|
22068
|
+
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>`;
|
|
22069
|
+
};
|
|
22070
|
+
_M3eSearchViewElement_renderClearButton = function _M3eSearchViewElement_renderClearButton() {
|
|
22071
|
+
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>`;
|
|
22072
|
+
};
|
|
22073
|
+
_M3eSearchViewElement_initBreakpointMonitoring = function _M3eSearchViewElement_initBreakpointMonitoring() {
|
|
22074
|
+
__classPrivateFieldSet(this, _M3eSearchViewElement_breakpointUnobserve, M3eBreakpointObserver.observe([Breakpoint.XSmall], matches => {
|
|
22075
|
+
const currentMode = this.currentMode;
|
|
22076
|
+
this._mode = matches.get(Breakpoint.XSmall) ? "fullscreen" : "docked";
|
|
22077
|
+
if (currentMode !== this._mode && this.open) {
|
|
22078
|
+
this.open = false;
|
|
22079
|
+
}
|
|
22080
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_updateMode).call(this);
|
|
22081
|
+
}), "f");
|
|
22082
|
+
};
|
|
22083
|
+
_M3eSearchViewElement_handleInputSlotChange = function _M3eSearchViewElement_handleInputSlotChange(e) {
|
|
22084
|
+
const input = e.target.assignedElements({
|
|
22085
|
+
flatten: true
|
|
22086
|
+
}).find(x => x instanceof HTMLInputElement);
|
|
22087
|
+
if (input != __classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")) {
|
|
22088
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")?.removeEventListener("input", __classPrivateFieldGet(this, _M3eSearchViewElement_inputInputHandler, "f"));
|
|
22089
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")?.removeEventListener("focus", __classPrivateFieldGet(this, _M3eSearchViewElement_inputFocusHandler, "f"));
|
|
22090
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")?.removeEventListener("keydown", __classPrivateFieldGet(this, _M3eSearchViewElement_inputKeyDownHandler, "f"));
|
|
22091
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")?.removeEventListener("pointerdown", __classPrivateFieldGet(this, _M3eSearchViewElement_inputPointerHandler, "f"));
|
|
22092
|
+
__classPrivateFieldSet(this, _M3eSearchViewElement_input, input, "f");
|
|
22093
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")?.addEventListener("input", __classPrivateFieldGet(this, _M3eSearchViewElement_inputInputHandler, "f"));
|
|
22094
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")?.addEventListener("focus", __classPrivateFieldGet(this, _M3eSearchViewElement_inputFocusHandler, "f"));
|
|
22095
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")?.addEventListener("keydown", __classPrivateFieldGet(this, _M3eSearchViewElement_inputKeyDownHandler, "f"));
|
|
22096
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")?.addEventListener("pointerdown", __classPrivateFieldGet(this, _M3eSearchViewElement_inputPointerHandler, "f"));
|
|
22097
|
+
if (__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")) {
|
|
22098
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f").role = __classPrivateFieldGet(this, _M3eSearchViewElement_input, "f").role || "searchbox";
|
|
22099
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f").inputMode = __classPrivateFieldGet(this, _M3eSearchViewElement_input, "f").inputMode || "search";
|
|
22100
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f").type = "text";
|
|
22101
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f").ariaHasPopup = "dialog";
|
|
22102
|
+
}
|
|
22103
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_updateClearableState).call(this);
|
|
22104
|
+
}
|
|
22105
|
+
};
|
|
22106
|
+
_M3eSearchViewElement_handleInputInput = function _M3eSearchViewElement_handleInputInput() {
|
|
22107
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_updateClearableState).call(this);
|
|
22108
|
+
if (this.open) {
|
|
22109
|
+
this.dispatchEvent(new CustomEvent("query", {
|
|
22110
|
+
detail: {
|
|
22111
|
+
term: __classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")?.value ?? ""
|
|
22112
|
+
},
|
|
22113
|
+
bubbles: true,
|
|
22114
|
+
composed: true
|
|
22115
|
+
}));
|
|
22116
|
+
} else {
|
|
22117
|
+
this.open = true;
|
|
19831
22118
|
}
|
|
19832
|
-
|
|
19833
|
-
|
|
19834
|
-
|
|
19835
|
-
|
|
19836
|
-
|
|
22119
|
+
};
|
|
22120
|
+
_M3eSearchViewElement_updateMode = function _M3eSearchViewElement_updateMode() {
|
|
22121
|
+
setCustomState$1(this, "-fullscreen", this.currentMode === "fullscreen");
|
|
22122
|
+
setCustomState$1(this, "-docked", this.currentMode === "docked");
|
|
22123
|
+
};
|
|
22124
|
+
_M3eSearchViewElement_updateClearableState = function _M3eSearchViewElement_updateClearableState() {
|
|
22125
|
+
this._clearable = (__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")?.value ?? "").length > 0;
|
|
22126
|
+
setCustomState$1(this, "-clearable", this._clearable);
|
|
22127
|
+
};
|
|
22128
|
+
_M3eSearchViewElement_handleInputFocus = function _M3eSearchViewElement_handleInputFocus() {
|
|
22129
|
+
this.open = !__classPrivateFieldGet(this, _M3eSearchViewElement_closeOnInputFocus, "f");
|
|
22130
|
+
__classPrivateFieldSet(this, _M3eSearchViewElement_closeOnInputFocus, false, "f");
|
|
22131
|
+
};
|
|
22132
|
+
_M3eSearchViewElement_handleCloseClick = function _M3eSearchViewElement_handleCloseClick() {
|
|
22133
|
+
if (!__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")) return;
|
|
22134
|
+
if (__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f").value) {
|
|
22135
|
+
this.clear();
|
|
19837
22136
|
}
|
|
19838
|
-
|
|
19839
|
-
|
|
19840
|
-
|
|
19841
|
-
|
|
19842
|
-
|
|
22137
|
+
__classPrivateFieldSet(this, _M3eSearchViewElement_closeOnInputFocus, true, "f");
|
|
22138
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")?.focus();
|
|
22139
|
+
};
|
|
22140
|
+
_M3eSearchViewElement_handleClearClick = function _M3eSearchViewElement_handleClearClick() {
|
|
22141
|
+
if (!__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")) return;
|
|
22142
|
+
if (__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f").value) {
|
|
22143
|
+
this.clear();
|
|
22144
|
+
} else {
|
|
22145
|
+
__classPrivateFieldSet(this, _M3eSearchViewElement_closeOnInputFocus, true, "f");
|
|
22146
|
+
}
|
|
22147
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")?.focus();
|
|
22148
|
+
};
|
|
22149
|
+
_M3eSearchViewElement_handleInputPointerDown = function _M3eSearchViewElement_handleInputPointerDown() {
|
|
22150
|
+
if (!this.open && __classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")?.matches(":focus")) {
|
|
22151
|
+
this.open = true;
|
|
22152
|
+
}
|
|
22153
|
+
};
|
|
22154
|
+
_M3eSearchViewElement_handleInputKeyDown = function _M3eSearchViewElement_handleInputKeyDown(e) {
|
|
22155
|
+
if (this.open && e.key === "Escape" && !e.shiftKey && !e.ctrlKey) {
|
|
22156
|
+
e.preventDefault();
|
|
22157
|
+
const input = e.target;
|
|
22158
|
+
if (input.value) {
|
|
22159
|
+
this.clear();
|
|
19843
22160
|
}
|
|
19844
|
-
|
|
19845
|
-
|
|
22161
|
+
this.open = false;
|
|
22162
|
+
}
|
|
22163
|
+
};
|
|
22164
|
+
_M3eSearchViewElement_handleKeyDown = function _M3eSearchViewElement_handleKeyDown(e) {
|
|
22165
|
+
if (this.open && e.key === "Escape" && !e.shiftKey && !e.ctrlKey) {
|
|
22166
|
+
e.preventDefault();
|
|
22167
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_handleCloseClick).call(this);
|
|
22168
|
+
}
|
|
22169
|
+
};
|
|
22170
|
+
_M3eSearchViewElement_openDocked = /** @private */
|
|
22171
|
+
async function _M3eSearchViewElement_openDocked() {
|
|
22172
|
+
if (!this.dispatchEvent(new ToggleEvent("beforetoggle", {
|
|
22173
|
+
oldState: "closed",
|
|
22174
|
+
newState: "open",
|
|
22175
|
+
bubbles: true,
|
|
22176
|
+
composed: true,
|
|
22177
|
+
cancelable: true
|
|
22178
|
+
}))) {
|
|
22179
|
+
this.open = false;
|
|
22180
|
+
return;
|
|
22181
|
+
}
|
|
22182
|
+
__classPrivateFieldSet(this, _M3eSearchViewElement_openMode, this.currentMode, "f");
|
|
22183
|
+
const view = this._view;
|
|
22184
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_anchorCleanup, "f")?.call(this);
|
|
22185
|
+
__classPrivateFieldSet(this, _M3eSearchViewElement_anchorCleanup, await positionAnchor(view, this._anchor, {
|
|
22186
|
+
position: "bottom"
|
|
22187
|
+
}, (x, y) => {
|
|
22188
|
+
const view = this._view;
|
|
22189
|
+
view.style.top = `${y - this._anchor.clientHeight}px`;
|
|
22190
|
+
view.style.width = `${this._anchor.clientWidth}px`;
|
|
22191
|
+
if (M3eDirectionality.current === "rtl") {
|
|
22192
|
+
view.style.right = `${window.innerWidth - x - this.clientWidth}px`;
|
|
22193
|
+
view.style.left = "";
|
|
22194
|
+
} else {
|
|
22195
|
+
view.style.left = `${x}px`;
|
|
22196
|
+
view.style.right = "";
|
|
19846
22197
|
}
|
|
22198
|
+
}), "f");
|
|
22199
|
+
this._anchor.style.position = "relative";
|
|
22200
|
+
view.popover = "manual";
|
|
22201
|
+
view.style.position = "absolute";
|
|
22202
|
+
view.showPopover();
|
|
22203
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_scrollLockController, "f").lock();
|
|
22204
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_inertController, "f").lock();
|
|
22205
|
+
this.dispatchEvent(new ToggleEvent("toggle", {
|
|
22206
|
+
oldState: "closed",
|
|
22207
|
+
newState: "open",
|
|
22208
|
+
bubbles: true,
|
|
22209
|
+
composed: true
|
|
22210
|
+
}));
|
|
22211
|
+
this.dispatchEvent(new CustomEvent("query", {
|
|
22212
|
+
detail: {
|
|
22213
|
+
term: __classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")?.value ?? ""
|
|
22214
|
+
},
|
|
22215
|
+
bubbles: true,
|
|
22216
|
+
composed: true
|
|
22217
|
+
}));
|
|
22218
|
+
};
|
|
22219
|
+
_M3eSearchViewElement_closeDocked = function _M3eSearchViewElement_closeDocked() {
|
|
22220
|
+
const view = this._view;
|
|
22221
|
+
if (view.popover !== "manual") return;
|
|
22222
|
+
if (!this.dispatchEvent(new ToggleEvent("beforetoggle", {
|
|
22223
|
+
oldState: "open",
|
|
22224
|
+
newState: "closed",
|
|
22225
|
+
bubbles: true,
|
|
22226
|
+
composed: true,
|
|
22227
|
+
cancelable: true
|
|
22228
|
+
}))) {
|
|
22229
|
+
this.open = true;
|
|
22230
|
+
return;
|
|
19847
22231
|
}
|
|
19848
|
-
|
|
19849
|
-
|
|
19850
|
-
|
|
22232
|
+
__classPrivateFieldSet(this, _M3eSearchViewElement_openMode, undefined, "f");
|
|
22233
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_scrollLockController, "f").unlock();
|
|
22234
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_inertController, "f").unlock();
|
|
22235
|
+
if (prefersReducedMotion$1()) {
|
|
22236
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_hideDocked).call(this);
|
|
22237
|
+
} else {
|
|
22238
|
+
view.classList.add("closing");
|
|
22239
|
+
view.addEventListener("transitionend", () => __classPrivateFieldGet(this, _M3eSearchViewElement_instances, "m", _M3eSearchViewElement_hideDocked).call(this), {
|
|
22240
|
+
once: true
|
|
22241
|
+
});
|
|
19851
22242
|
}
|
|
19852
22243
|
};
|
|
19853
|
-
|
|
19854
|
-
|
|
19855
|
-
|
|
19856
|
-
|
|
19857
|
-
|
|
19858
|
-
|
|
19859
|
-
|
|
19860
|
-
|
|
19861
|
-
|
|
22244
|
+
_M3eSearchViewElement_hideDocked = function _M3eSearchViewElement_hideDocked() {
|
|
22245
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_anchorCleanup, "f")?.call(this);
|
|
22246
|
+
__classPrivateFieldSet(this, _M3eSearchViewElement_anchorCleanup, undefined, "f");
|
|
22247
|
+
const view = this._view;
|
|
22248
|
+
view.classList.remove("closing");
|
|
22249
|
+
view.style.position = "";
|
|
22250
|
+
view.style.width = "";
|
|
22251
|
+
view.style.top = "";
|
|
22252
|
+
view.style.left = "";
|
|
22253
|
+
view.style.right = "";
|
|
22254
|
+
view.hidePopover();
|
|
22255
|
+
view.popover = null;
|
|
22256
|
+
this._anchor.style.position = "";
|
|
22257
|
+
this.dispatchEvent(new ToggleEvent("toggle", {
|
|
22258
|
+
oldState: "open",
|
|
22259
|
+
newState: "closed",
|
|
22260
|
+
bubbles: true,
|
|
22261
|
+
composed: true
|
|
22262
|
+
}));
|
|
19862
22263
|
};
|
|
19863
|
-
|
|
19864
|
-
|
|
22264
|
+
_M3eSearchViewElement_openFullscreen = /** @private */
|
|
22265
|
+
async function _M3eSearchViewElement_openFullscreen() {
|
|
22266
|
+
if (!this.dispatchEvent(new ToggleEvent("beforetoggle", {
|
|
22267
|
+
oldState: "closed",
|
|
22268
|
+
newState: "open",
|
|
22269
|
+
bubbles: true,
|
|
22270
|
+
composed: true,
|
|
22271
|
+
cancelable: true
|
|
22272
|
+
}))) {
|
|
22273
|
+
this.open = false;
|
|
22274
|
+
return;
|
|
22275
|
+
}
|
|
22276
|
+
__classPrivateFieldSet(this, _M3eSearchViewElement_openMode, this.currentMode, "f");
|
|
22277
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_scrollLockController, "f").lock();
|
|
22278
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_inertController, "f").lock();
|
|
22279
|
+
const view = this._view;
|
|
22280
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_anchorCleanup, "f")?.call(this);
|
|
22281
|
+
if (!prefersReducedMotion$1()) {
|
|
22282
|
+
const rect = view.getBoundingClientRect();
|
|
22283
|
+
const startInline = M3eDirectionality.current === "rtl" ? window.innerWidth - rect.right : rect.left;
|
|
22284
|
+
view.style.position = "fixed";
|
|
22285
|
+
view.popover = "manual";
|
|
22286
|
+
view.showPopover();
|
|
22287
|
+
this._anchor.style.position = "relative";
|
|
22288
|
+
view.animate([{
|
|
22289
|
+
transform: `translateX(${startInline}px)`,
|
|
22290
|
+
width: `${rect.width}px`,
|
|
22291
|
+
top: `${rect.top}px`,
|
|
22292
|
+
height: `${rect.height}px`
|
|
22293
|
+
}, {
|
|
22294
|
+
transform: "translateX(0px)",
|
|
22295
|
+
width: "100vw",
|
|
22296
|
+
top: "0px",
|
|
22297
|
+
height: "100vh"
|
|
22298
|
+
}], {
|
|
22299
|
+
duration: 150,
|
|
22300
|
+
easing: "cubic-bezier(0.2, 0.0, 0, 1.0)"
|
|
22301
|
+
});
|
|
22302
|
+
} else {
|
|
22303
|
+
view.style.position = "fixed";
|
|
22304
|
+
view.popover = "manual";
|
|
22305
|
+
view.showPopover();
|
|
22306
|
+
this._anchor.style.position = "relative";
|
|
22307
|
+
}
|
|
22308
|
+
this.dispatchEvent(new ToggleEvent("toggle", {
|
|
22309
|
+
oldState: "closed",
|
|
22310
|
+
newState: "open",
|
|
22311
|
+
bubbles: true,
|
|
22312
|
+
composed: true
|
|
22313
|
+
}));
|
|
22314
|
+
this.dispatchEvent(new CustomEvent("query", {
|
|
22315
|
+
detail: {
|
|
22316
|
+
term: __classPrivateFieldGet(this, _M3eSearchViewElement_input, "f")?.value ?? ""
|
|
22317
|
+
},
|
|
22318
|
+
bubbles: true,
|
|
22319
|
+
composed: true
|
|
22320
|
+
}));
|
|
19865
22321
|
};
|
|
19866
|
-
|
|
19867
|
-
|
|
22322
|
+
_M3eSearchViewElement_closeFullscreen = /** @private */
|
|
22323
|
+
async function _M3eSearchViewElement_closeFullscreen() {
|
|
22324
|
+
const view = this._view;
|
|
22325
|
+
if (view.popover !== "manual") return;
|
|
22326
|
+
if (!this.dispatchEvent(new ToggleEvent("beforetoggle", {
|
|
22327
|
+
oldState: "open",
|
|
22328
|
+
newState: "closed",
|
|
22329
|
+
bubbles: true,
|
|
22330
|
+
composed: true,
|
|
22331
|
+
cancelable: true
|
|
22332
|
+
}))) {
|
|
22333
|
+
this.open = true;
|
|
22334
|
+
return;
|
|
22335
|
+
}
|
|
22336
|
+
__classPrivateFieldSet(this, _M3eSearchViewElement_openMode, undefined, "f");
|
|
22337
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_scrollLockController, "f").unlock();
|
|
22338
|
+
__classPrivateFieldGet(this, _M3eSearchViewElement_inertController, "f").unlock();
|
|
22339
|
+
const anchor = this._anchor;
|
|
22340
|
+
if (!prefersReducedMotion$1()) {
|
|
22341
|
+
const start = view.getBoundingClientRect();
|
|
22342
|
+
const end = anchor.getBoundingClientRect();
|
|
22343
|
+
const startInline = M3eDirectionality.current === "rtl" ? window.innerWidth - start.right : start.left;
|
|
22344
|
+
const endInline = M3eDirectionality.current === "rtl" ? window.innerWidth - end.right : end.left;
|
|
22345
|
+
const dx = M3eDirectionality.current === "rtl" ? startInline - endInline : endInline - startInline;
|
|
22346
|
+
view.classList.add("closing");
|
|
22347
|
+
await view.animate([{
|
|
22348
|
+
transform: `translateX(0px)`,
|
|
22349
|
+
width: `${start.width}px`,
|
|
22350
|
+
top: `${start.top}px`,
|
|
22351
|
+
height: `${start.height}px`
|
|
22352
|
+
}, {
|
|
22353
|
+
transform: `translateX(${dx}px)`,
|
|
22354
|
+
width: `${end.width}px`,
|
|
22355
|
+
top: `${end.top}px`,
|
|
22356
|
+
height: `${end.height}px`
|
|
22357
|
+
}], {
|
|
22358
|
+
duration: 150,
|
|
22359
|
+
easing: "cubic-bezier(0.2, 0.0, 0, 1.0)"
|
|
22360
|
+
}).finished;
|
|
22361
|
+
}
|
|
22362
|
+
view.hidePopover();
|
|
22363
|
+
view.style.position = "";
|
|
22364
|
+
view.popover = null;
|
|
22365
|
+
view.classList.remove("closing");
|
|
22366
|
+
anchor.style.position = "";
|
|
22367
|
+
this.dispatchEvent(new ToggleEvent("toggle", {
|
|
22368
|
+
oldState: "open",
|
|
22369
|
+
newState: "closed",
|
|
22370
|
+
bubbles: true,
|
|
22371
|
+
composed: true
|
|
22372
|
+
}));
|
|
19868
22373
|
};
|
|
22374
|
+
(() => {
|
|
22375
|
+
registerStyleSheet$1(SearchViewLightDomStyle);
|
|
22376
|
+
})();
|
|
19869
22377
|
/** The styles of the element. */
|
|
19870
|
-
|
|
19871
|
-
|
|
22378
|
+
M3eSearchViewElement.styles = SearchViewStyle;
|
|
22379
|
+
__decorate([state()], M3eSearchViewElement.prototype, "_clearable", void 0);
|
|
22380
|
+
__decorate([state()], M3eSearchViewElement.prototype, "_mode", void 0);
|
|
22381
|
+
__decorate([query(".anchor")], M3eSearchViewElement.prototype, "_anchor", void 0);
|
|
22382
|
+
__decorate([query(".view")], M3eSearchViewElement.prototype, "_view", void 0);
|
|
22383
|
+
__decorate([property({
|
|
22384
|
+
type: Boolean,
|
|
22385
|
+
reflect: true
|
|
22386
|
+
})], M3eSearchViewElement.prototype, "contained", void 0);
|
|
22387
|
+
__decorate([property({
|
|
22388
|
+
reflect: true
|
|
22389
|
+
})], M3eSearchViewElement.prototype, "mode", void 0);
|
|
22390
|
+
__decorate([property({
|
|
22391
|
+
type: Boolean,
|
|
22392
|
+
reflect: true
|
|
22393
|
+
})], M3eSearchViewElement.prototype, "open", void 0);
|
|
22394
|
+
__decorate([property({
|
|
22395
|
+
attribute: "clear-label"
|
|
22396
|
+
})], M3eSearchViewElement.prototype, "clearLabel", void 0);
|
|
22397
|
+
__decorate([property({
|
|
22398
|
+
attribute: "close-label"
|
|
22399
|
+
})], M3eSearchViewElement.prototype, "closeLabel", void 0);
|
|
22400
|
+
__decorate([property({
|
|
22401
|
+
attribute: "hide-search-icon",
|
|
22402
|
+
type: Boolean
|
|
22403
|
+
})], M3eSearchViewElement.prototype, "hideSearchIcon", void 0);
|
|
22404
|
+
__decorate([debounce$1(40)], M3eSearchViewElement.prototype, "_handleFocusChange", null);
|
|
22405
|
+
M3eSearchViewElement = __decorate([customElement$1("m3e-search-view")], M3eSearchViewElement);
|
|
19872
22406
|
|
|
19873
22407
|
var _M3eButtonSegmentElement_instances, _M3eButtonSegmentElement_clickHandler, _M3eButtonSegmentElement_handleIconSlotChange, _M3eButtonSegmentElement_handleClick;
|
|
19874
22408
|
var M3eButtonSegmentElement_1;
|
|
@@ -19916,8 +22450,8 @@ var M3eButtonSegmentElement_1;
|
|
|
19916
22450
|
* @fires click - Emitted when the element is clicked.
|
|
19917
22451
|
*
|
|
19918
22452
|
* @cssprop --m3e-segmented-button-height - Total height of the segmented button.
|
|
19919
|
-
* @cssprop --m3e-segmented-button-outline-thickness - Thickness of the button
|
|
19920
|
-
* @cssprop --m3e-segmented-button-outline-color - Color of the button
|
|
22453
|
+
* @cssprop --m3e-segmented-button-outline-thickness - Thickness of the button's border.
|
|
22454
|
+
* @cssprop --m3e-segmented-button-outline-color - Color of the button's border.
|
|
19921
22455
|
* @cssprop --m3e-segmented-button-padding-start - Padding on the leading edge of the button content.
|
|
19922
22456
|
* @cssprop --m3e-segmented-button-padding-end - Padding on the trailing edge of the button content.
|
|
19923
22457
|
* @cssprop --m3e-segmented-button-spacing - Horizontal gap between icon and label.
|
|
@@ -20206,7 +22740,7 @@ __decorate([property({
|
|
|
20206
22740
|
})], M3eSegmentedButtonElement.prototype, "hideSelectionIndicator", void 0);
|
|
20207
22741
|
M3eSegmentedButtonElement = __decorate([customElement$1("m3e-segmented-button")], M3eSegmentedButtonElement);
|
|
20208
22742
|
|
|
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,
|
|
22743
|
+
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
22744
|
var M3eSelectElement_1;
|
|
20211
22745
|
/**
|
|
20212
22746
|
* A form control that allows users to select a value from a set of predefined options.
|
|
@@ -20310,13 +22844,6 @@ let M3eSelectElement = M3eSelectElement_1 = class M3eSelectElement extends Focus
|
|
|
20310
22844
|
* @default ""
|
|
20311
22845
|
*/
|
|
20312
22846
|
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
22847
|
new MutationController$1(this, {
|
|
20321
22848
|
config: {
|
|
20322
22849
|
childList: true,
|
|
@@ -20434,10 +22961,6 @@ let M3eSelectElement = M3eSelectElement_1 = class M3eSelectElement extends Focus
|
|
|
20434
22961
|
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
22962
|
}
|
|
20436
22963
|
};
|
|
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
22964
|
_M3eSelectElement_formField_get = function _M3eSelectElement_formField_get() {
|
|
20442
22965
|
return this.closest("m3e-form-field");
|
|
20443
22966
|
};
|
|
@@ -20582,6 +23105,7 @@ _M3eSelectElement_destroyMenu = function _M3eSelectElement_destroyMenu(e) {
|
|
|
20582
23105
|
this.ariaExpanded = "false";
|
|
20583
23106
|
this.removeAttribute("aria-controls");
|
|
20584
23107
|
this.removeAttribute("aria-owns");
|
|
23108
|
+
this.removeAttribute("aria-activedescendant");
|
|
20585
23109
|
this.requestUpdate();
|
|
20586
23110
|
deleteCustomState$1(this, "-open");
|
|
20587
23111
|
__classPrivateFieldGet(this, _M3eSelectElement_instances, "a", _M3eSelectElement_formField_get)?.notifyControlStateChange();
|
|
@@ -20611,7 +23135,7 @@ _M3eSelectElement_showMenu = function _M3eSelectElement_showMenu() {
|
|
|
20611
23135
|
}
|
|
20612
23136
|
}
|
|
20613
23137
|
__classPrivateFieldGet(this, _M3eSelectElement_menu, "f").style.overflowX = "hidden";
|
|
20614
|
-
__classPrivateFieldGet(this, _M3eSelectElement_menu, "f").
|
|
23138
|
+
__classPrivateFieldGet(this, _M3eSelectElement_menu, "f").fitAnchorWidth = true;
|
|
20615
23139
|
__classPrivateFieldGet(this, _M3eSelectElement_menu, "f").addEventListener("toggle", __classPrivateFieldGet(this, _M3eSelectElement_menuToggleHandler, "f"));
|
|
20616
23140
|
__classPrivateFieldGet(this, _M3eSelectElement_menu, "f").addEventListener("pointerdown", __classPrivateFieldGet(this, _M3eSelectElement_menuPointerDownHandler, "f"));
|
|
20617
23141
|
if (__classPrivateFieldGet(this, _M3eSelectElement_clone, "f")) {
|
|
@@ -20630,7 +23154,6 @@ _M3eSelectElement_showMenu = function _M3eSelectElement_showMenu() {
|
|
|
20630
23154
|
_M3eSelectElement_hideMenu = function _M3eSelectElement_hideMenu() {
|
|
20631
23155
|
if (!__classPrivateFieldGet(this, _M3eSelectElement_menu, "f")) return;
|
|
20632
23156
|
__classPrivateFieldGet(this, _M3eSelectElement_menu, "f").hide();
|
|
20633
|
-
this.removeAttribute("aria-activedescendant");
|
|
20634
23157
|
deleteCustomState$1(this, "-open");
|
|
20635
23158
|
};
|
|
20636
23159
|
_M3eSelectElement_activateOption = function _M3eSelectElement_activateOption(option) {
|
|
@@ -21741,11 +24264,7 @@ _M3eSnackbarElement_handleBeforeToggle = function _M3eSnackbarElement_handleBefo
|
|
|
21741
24264
|
}
|
|
21742
24265
|
};
|
|
21743
24266
|
(() => {
|
|
21744
|
-
|
|
21745
|
-
const lightDomStyle = new CSSStyleSheet();
|
|
21746
|
-
lightDomStyle.replaceSync(css`m3e-snackbar { margin-inline: auto; }`.toString());
|
|
21747
|
-
document.adoptedStyleSheets = [...document.adoptedStyleSheets, lightDomStyle];
|
|
21748
|
-
}
|
|
24267
|
+
registerStyleSheet$1(css`m3e-snackbar { margin-inline: auto; }`);
|
|
21749
24268
|
})();
|
|
21750
24269
|
/** The styles of the element. */
|
|
21751
24270
|
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},
|
|
@@ -21844,7 +24363,7 @@ var _M3eSplitButtonElement_instances, _M3eSplitButtonElement_leadingButton, _M3e
|
|
|
21844
24363
|
* `filled`, `tonal`, and `outlined` variants, and adapts to all button sizes. The leading button triggers
|
|
21845
24364
|
* the main action, while the trailing icon button reveals additional options, enabling efficient workflows
|
|
21846
24365
|
* and clear visual hierarchy. The split button ensures accessible, adaptive, and visually harmonious
|
|
21847
|
-
* interactions, reflecting Material 3
|
|
24366
|
+
* interactions, reflecting Material 3's principles of clarity, flexibility, and expressive design.
|
|
21848
24367
|
*
|
|
21849
24368
|
* @example
|
|
21850
24369
|
* The following example illustrates use of the `m3e-split-button` to combine the `m3e-button`,
|
|
@@ -22408,7 +24927,7 @@ class StepperButtonElementBase extends ActionElementBase$1 {
|
|
|
22408
24927
|
}
|
|
22409
24928
|
_StepperButtonElementBase_action = new WeakMap();
|
|
22410
24929
|
|
|
22411
|
-
var _M3eStepperElement_instances, _M3eStepperElement_breakpointUnobserve, _M3eStepperElement_renderHeader, _M3eStepperElement_handleChange, _M3eStepperElement_handleSlotChange, _M3eStepperElement_handleKeyDown, _M3eStepperElement_handleSelectedChange, _M3eStepperElement_checkValidity, _M3eStepperElement_updateDisplayOrder, _a$3;
|
|
24930
|
+
var _M3eStepperElement_instances, _M3eStepperElement_breakpointUnobserve, _M3eStepperElement_renderHeader, _M3eStepperElement_handleChange, _M3eStepperElement_handleSlotChange, _M3eStepperElement_handleKeyDown, _M3eStepperElement_handleSelectedChange, _M3eStepperElement_checkValidity, _M3eStepperElement_initBreakpointMonitoring, _M3eStepperElement_updateDisplayOrder, _a$3;
|
|
22412
24931
|
/**
|
|
22413
24932
|
* Provides a wizard-like workflow by dividing content into logical steps.
|
|
22414
24933
|
*
|
|
@@ -22474,7 +24993,7 @@ var _M3eStepperElement_instances, _M3eStepperElement_breakpointUnobserve, _M3eSt
|
|
|
22474
24993
|
* @cssprop --m3e-step-divider-color - Color of the divider line between steps.
|
|
22475
24994
|
* @cssprop --m3e-step-divider-inset - Inset offset for divider alignment within step layout.
|
|
22476
24995
|
*/
|
|
22477
|
-
let M3eStepperElement = class M3eStepperElement extends AttachInternals$1(LitElement) {
|
|
24996
|
+
let M3eStepperElement = class M3eStepperElement extends ReconnectedCallback$1(AttachInternals$1(LitElement)) {
|
|
22478
24997
|
constructor() {
|
|
22479
24998
|
super(...arguments);
|
|
22480
24999
|
_M3eStepperElement_instances.add(this);
|
|
@@ -22604,15 +25123,19 @@ let M3eStepperElement = class M3eStepperElement extends AttachInternals$1(LitEle
|
|
|
22604
25123
|
__classPrivateFieldGet(this, _M3eStepperElement_breakpointUnobserve, "f")?.call(this);
|
|
22605
25124
|
}
|
|
22606
25125
|
/** @inheritdoc */
|
|
25126
|
+
reconnectedCallback() {
|
|
25127
|
+
super.reconnectedCallback();
|
|
25128
|
+
if (this.orientation === "auto") {
|
|
25129
|
+
__classPrivateFieldGet(this, _M3eStepperElement_instances, "m", _M3eStepperElement_initBreakpointMonitoring).call(this);
|
|
25130
|
+
}
|
|
25131
|
+
}
|
|
25132
|
+
/** @inheritdoc */
|
|
22607
25133
|
willUpdate(changedProperties) {
|
|
22608
25134
|
super.willUpdate(changedProperties);
|
|
22609
25135
|
if (changedProperties.has("orientation")) {
|
|
22610
25136
|
__classPrivateFieldGet(this, _M3eStepperElement_breakpointUnobserve, "f")?.call(this);
|
|
22611
25137
|
if (this.orientation === "auto") {
|
|
22612
|
-
|
|
22613
|
-
this._orientation = matches.get(Breakpoint.XSmall) ? "vertical" : "horizontal";
|
|
22614
|
-
__classPrivateFieldGet(this, _M3eStepperElement_instances, "m", _M3eStepperElement_updateDisplayOrder).call(this);
|
|
22615
|
-
}), "f");
|
|
25138
|
+
__classPrivateFieldGet(this, _M3eStepperElement_instances, "m", _M3eStepperElement_initBreakpointMonitoring).call(this);
|
|
22616
25139
|
} else {
|
|
22617
25140
|
this._orientation = undefined;
|
|
22618
25141
|
__classPrivateFieldGet(this, _M3eStepperElement_instances, "m", _M3eStepperElement_updateDisplayOrder).call(this);
|
|
@@ -22704,6 +25227,12 @@ _M3eStepperElement_checkValidity = function _M3eStepperElement_checkValidity() {
|
|
|
22704
25227
|
}
|
|
22705
25228
|
return valid;
|
|
22706
25229
|
};
|
|
25230
|
+
_M3eStepperElement_initBreakpointMonitoring = function _M3eStepperElement_initBreakpointMonitoring() {
|
|
25231
|
+
__classPrivateFieldSet(this, _M3eStepperElement_breakpointUnobserve, M3eBreakpointObserver.observe([Breakpoint.XSmall], matches => {
|
|
25232
|
+
this._orientation = matches.get(Breakpoint.XSmall) ? "vertical" : "horizontal";
|
|
25233
|
+
__classPrivateFieldGet(this, _M3eStepperElement_instances, "m", _M3eStepperElement_updateDisplayOrder).call(this);
|
|
25234
|
+
}), "f");
|
|
25235
|
+
};
|
|
22707
25236
|
_M3eStepperElement_updateDisplayOrder = function _M3eStepperElement_updateDisplayOrder() {
|
|
22708
25237
|
this[selectionManager].vertical = (this._orientation ?? this.orientation) === "vertical";
|
|
22709
25238
|
setCustomState$1(this, "-vertical", this[selectionManager].vertical);
|
|
@@ -22724,11 +25253,7 @@ _M3eStepperElement_updateDisplayOrder = function _M3eStepperElement_updateDispla
|
|
|
22724
25253
|
}
|
|
22725
25254
|
};
|
|
22726
25255
|
(() => {
|
|
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
|
-
}
|
|
25256
|
+
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
25257
|
})();
|
|
22733
25258
|
/** The styles of the element. */
|
|
22734
25259
|
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; }`;
|
|
@@ -22947,8 +25472,8 @@ var _M3eSwitchElement_instances, _M3eSwitchElement_clickHandler, _M3eSwitchEleme
|
|
|
22947
25472
|
* @cssprop --m3e-switch-unselected-icon-size - Size of the icon in the unselected state.
|
|
22948
25473
|
* @cssprop --m3e-switch-track-height - Height of the switch track.
|
|
22949
25474
|
* @cssprop --m3e-switch-track-width - Width of the switch track.
|
|
22950
|
-
* @cssprop --m3e-switch-track-outline-color - Color of the track
|
|
22951
|
-
* @cssprop --m3e-switch-track-outline-width - Thickness of the track
|
|
25475
|
+
* @cssprop --m3e-switch-track-outline-color - Color of the track's outline.
|
|
25476
|
+
* @cssprop --m3e-switch-track-outline-width - Thickness of the track's outline.
|
|
22952
25477
|
* @cssprop --m3e-switch-track-shape - Corner shape of the track.
|
|
22953
25478
|
* @cssprop --m3e-switch-selected-track-color - Track color when selected.
|
|
22954
25479
|
* @cssprop --m3e-switch-unselected-track-color - Track color when unselected.
|
|
@@ -27722,7 +30247,7 @@ class TooltipElementBase extends HtmlFor$1(ReconnectedCallback$1(AttachInternals
|
|
|
27722
30247
|
position: this._anchorPosition,
|
|
27723
30248
|
inline: true,
|
|
27724
30249
|
flip: true,
|
|
27725
|
-
shift:
|
|
30250
|
+
shift: "main",
|
|
27726
30251
|
offset: TOOLTIP_OFFSET
|
|
27727
30252
|
}, (x, y) => this._updatePosition(this._base, x, y)), "f");
|
|
27728
30253
|
if (!_a.__openTooltips.includes(this)) {
|
|
@@ -28182,5 +30707,5 @@ M3eTooltipElement.styles = css`:host { display: contents; } .base { position: ab
|
|
|
28182
30707
|
__decorate([property()], M3eTooltipElement.prototype, "position", void 0);
|
|
28183
30708
|
M3eTooltipElement = __decorate([customElement$1("m3e-tooltip")], M3eTooltipElement);
|
|
28184
30709
|
|
|
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 };
|
|
30710
|
+
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
30711
|
//# sourceMappingURL=all.js.map
|