@universal-material/web 3.0.69 → 3.0.71
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/app-bar/top-app-bar.js +3 -2
- package/app-bar/top-app-bar.js.map +1 -1
- package/button/button-base.d.ts +1 -0
- package/button/button-base.d.ts.map +1 -1
- package/button/button-base.js +7 -18
- package/button/button-base.js.map +1 -1
- package/button/button-base.styles.d.ts +2 -0
- package/button/button-base.styles.d.ts.map +1 -0
- package/button/button-base.styles.js +16 -0
- package/button/button-base.styles.js.map +1 -0
- package/button/button-set.d.ts +1 -1
- package/button/button-set.d.ts.map +1 -1
- package/button/button-set.js +1 -1
- package/button/button-set.js.map +1 -1
- package/button/button-set.styles.d.ts.map +1 -1
- package/button/button-set.styles.js +0 -19
- package/button/button-set.styles.js.map +1 -1
- package/button/button.d.ts +2 -2
- package/button/button.d.ts.map +1 -1
- package/button/button.js +1 -1
- package/button/button.js.map +1 -1
- package/button/button.styles.d.ts.map +1 -1
- package/button/button.styles.js +0 -100
- package/button/button.styles.js.map +1 -1
- package/button/fab.d.ts +2 -2
- package/button/fab.d.ts.map +1 -1
- package/button/fab.js +1 -1
- package/button/fab.js.map +1 -1
- package/button/fab.styles.d.ts.map +1 -1
- package/button/fab.styles.js +0 -100
- package/button/fab.styles.js.map +1 -1
- package/button/icon-button.d.ts +2 -2
- package/button/icon-button.d.ts.map +1 -1
- package/button/icon-button.js +1 -1
- package/button/icon-button.js.map +1 -1
- package/button/icon-button.styles.d.ts.map +1 -1
- package/button/icon-button.styles.js +0 -100
- package/button/icon-button.styles.js.map +1 -1
- package/card/card-content.js +1 -1
- package/card/card-content.js.map +1 -1
- package/card/card-media.js +1 -1
- package/card/card-media.js.map +1 -1
- package/card/card.js +1 -1
- package/card/card.js.map +1 -1
- package/checkbox/checkbox.js +8 -20
- package/checkbox/checkbox.js.map +1 -1
- package/chip/chip-set.d.ts +1 -1
- package/chip/chip-set.d.ts.map +1 -1
- package/chip/chip-set.js +1 -1
- package/chip/chip-set.js.map +1 -1
- package/chip/chip-set.styles.d.ts.map +1 -1
- package/chip/chip-set.styles.js +0 -19
- package/chip/chip-set.styles.js.map +1 -1
- package/chip/chip.d.ts +1 -1
- package/chip/chip.d.ts.map +1 -1
- package/chip/chip.js +39 -54
- package/chip/chip.js.map +1 -1
- package/chip/chip.styles.d.ts.map +1 -1
- package/chip/chip.styles.js +0 -87
- package/chip/chip.styles.js.map +1 -1
- package/chip-field/chip-field.js +72 -86
- package/chip-field/chip-field.js.map +1 -1
- package/custom-elements.json +3207 -2538
- package/dialog/confirm-dialog-builder.js +6 -22
- package/dialog/confirm-dialog-builder.js.map +1 -1
- package/dialog/dialog-builder.js +4 -17
- package/dialog/dialog-builder.js.map +1 -1
- package/dialog/dialog.js +65 -80
- package/dialog/dialog.js.map +1 -1
- package/dialog/message-dialog-builder.js +3 -19
- package/dialog/message-dialog-builder.js.map +1 -1
- package/elevation/elevation.js +1 -1
- package/elevation/elevation.js.map +1 -1
- package/field/field-base.d.ts +2 -2
- package/field/field-base.d.ts.map +1 -1
- package/field/field-base.js +13 -16
- package/field/field-base.js.map +1 -1
- package/field/field-base.styles.js +1 -1
- package/field/field-base.styles.js.map +1 -1
- package/list/list-item.js +1 -1
- package/list/list-item.js.map +1 -1
- package/list/list.js +1 -1
- package/list/list.js.map +1 -1
- package/menu/menu-item.d.ts +12 -6
- package/menu/menu-item.d.ts.map +1 -1
- package/menu/menu-item.js +49 -31
- package/menu/menu-item.js.map +1 -1
- package/menu/menu-item.styles.d.ts.map +1 -1
- package/menu/menu-item.styles.js +15 -90
- package/menu/menu-item.styles.js.map +1 -1
- package/menu/menu.d.ts.map +1 -1
- package/menu/menu.js +129 -134
- package/menu/menu.js.map +1 -1
- package/navigation/drawer-item.d.ts +1 -1
- package/navigation/drawer-item.d.ts.map +1 -1
- package/navigation/drawer-item.js +4 -5
- package/navigation/drawer-item.js.map +1 -1
- package/navigation/drawer-item.styles.d.ts.map +1 -1
- package/navigation/drawer-item.styles.js +0 -87
- package/navigation/drawer-item.styles.js.map +1 -1
- package/navigation/drawer.js +4 -4
- package/navigation/drawer.js.map +1 -1
- package/navigation/side-navigation.js +8 -20
- package/navigation/side-navigation.js.map +1 -1
- package/package.json +18 -18
- package/progress/circular-progress.d.ts +1 -2
- package/progress/circular-progress.d.ts.map +1 -1
- package/progress/circular-progress.js +19 -27
- package/progress/circular-progress.js.map +1 -1
- package/progress/progress-bar.d.ts +1 -2
- package/progress/progress-bar.d.ts.map +1 -1
- package/progress/progress-bar.js +12 -20
- package/progress/progress-bar.js.map +1 -1
- package/radio/radio.js +53 -61
- package/radio/radio.js.map +1 -1
- package/ripple/ripple.js +3 -2
- package/ripple/ripple.js.map +1 -1
- package/select/extended-option.d.ts +5 -0
- package/select/extended-option.d.ts.map +1 -0
- package/select/extended-option.js +2 -0
- package/select/extended-option.js.map +1 -0
- package/select/extended-select.d.ts +6 -0
- package/select/extended-select.d.ts.map +1 -0
- package/select/extended-select.js +2 -0
- package/select/extended-select.js.map +1 -0
- package/select/option.d.ts +10 -0
- package/select/option.d.ts.map +1 -1
- package/select/option.js +84 -74
- package/select/option.js.map +1 -1
- package/select/option.styles.d.ts.map +1 -1
- package/select/option.styles.js +10 -0
- package/select/option.styles.js.map +1 -1
- package/select/select-navigation-controller.d.ts +10 -2
- package/select/select-navigation-controller.d.ts.map +1 -1
- package/select/select-navigation-controller.js +66 -3
- package/select/select-navigation-controller.js.map +1 -1
- package/select/select.d.ts +10 -4
- package/select/select.d.ts.map +1 -1
- package/select/select.js +179 -68
- package/select/select.js.map +1 -1
- package/select/select.styles.d.ts.map +1 -1
- package/select/select.styles.js +15 -6
- package/select/select.styles.js.map +1 -1
- package/shared/button-wrapper.d.ts +2 -0
- package/shared/button-wrapper.d.ts.map +1 -1
- package/shared/button-wrapper.js +18 -22
- package/shared/button-wrapper.js.map +1 -1
- package/shared/button-wrapper.styles.d.ts +2 -0
- package/shared/button-wrapper.styles.d.ts.map +1 -0
- package/shared/button-wrapper.styles.js +63 -0
- package/shared/button-wrapper.styles.js.map +1 -0
- package/shared/compare-text.d.ts +2 -0
- package/shared/compare-text.d.ts.map +1 -0
- package/shared/compare-text.js +5 -0
- package/shared/compare-text.js.map +1 -0
- package/shared/menu-field/menu-field-navigation-controller.d.ts +11 -4
- package/shared/menu-field/menu-field-navigation-controller.d.ts.map +1 -1
- package/shared/menu-field/menu-field-navigation-controller.js +56 -31
- package/shared/menu-field/menu-field-navigation-controller.js.map +1 -1
- package/shared/mixin-attribute-properties.d.ts.map +1 -1
- package/shared/normalize-text.d.ts +1 -1
- package/shared/normalize-text.d.ts.map +1 -1
- package/shared/normalize-text.js +1 -1
- package/shared/normalize-text.js.map +1 -1
- package/shared/selection-control/selection-control-list-item.d.ts.map +1 -1
- package/shared/selection-control/selection-control-list-item.js +7 -7
- package/shared/selection-control/selection-control-list-item.js.map +1 -1
- package/shared/selection-control/selection-control.js +16 -28
- package/shared/selection-control/selection-control.js.map +1 -1
- package/shared/sets/set-base.d.ts +2 -0
- package/shared/sets/set-base.d.ts.map +1 -1
- package/shared/sets/set-base.js +2 -0
- package/shared/sets/set-base.js.map +1 -1
- package/shared/sets/set-base.styles.d.ts +2 -0
- package/shared/sets/set-base.styles.d.ts.map +1 -0
- package/shared/sets/set-base.styles.js +22 -0
- package/shared/sets/set-base.styles.js.map +1 -0
- package/shared/text-field-base/text-field-base.js +6 -6
- package/shared/text-field-base/text-field-base.js.map +1 -1
- package/snackbar/snackbar.d.ts.map +1 -1
- package/snackbar/snackbar.js +13 -7
- package/snackbar/snackbar.js.map +1 -1
- package/switch/switch.js +4 -4
- package/switch/switch.js.map +1 -1
- package/text-field/text-field.d.ts +2 -0
- package/text-field/text-field.d.ts.map +1 -1
- package/text-field/text-field.js +22 -30
- package/text-field/text-field.js.map +1 -1
- package/typeahead/highlight.js +7 -24
- package/typeahead/highlight.js.map +1 -1
- package/typeahead/typeahead.d.ts +3 -0
- package/typeahead/typeahead.d.ts.map +1 -1
- package/typeahead/typeahead.js +184 -180
- package/typeahead/typeahead.js.map +1 -1
package/field/field-base.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-base.js","sourceRoot":"","sources":["../../src/field/field-base.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"field-base.js","sourceRoot":"","sources":["../../src/field/field-base.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,OAAO,EAAW,eAAe,EAAE,MAAM,cAAc,CAAC;AAEjE,OAAO,EAAE,IAAI,EAAkB,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAElF,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGnE,MAAM,OAAgB,WAAY,SAAQ,UAAU;aAClC,WAAM,GAAmB,CAAC,UAAU,EAAE,MAAM,CAAC,AAAvC,CAAwC;IAiB9D,MAAM,CAAC,WAAW,CAAC,WAAwB,EAAE,MAAuB;QAClE,OAAO,IAAI,eAAe,CAAC,WAAW,EAAE;YACtC,OAAO,EAAE,oBAAoB;YAC7B,YAAY,EAAE,MAAM;SACrB,CAAC,CAAC;IACL,CAAC;IAqCD;QACE,KAAK,EAAE,CAAC;QAtDE,YAAO,GAAsC,QAAQ,CAAC;QAOxB,UAAK,GAAG,KAAK,CAAC;QACd,aAAQ,GAAG,KAAK,CAAC;QACjB,YAAO,GAAG,KAAK,CAAC;QAS1D;;;;WAIG;QACsE,mBAAc,GAAG,KAAK,CAAC;QAEhG;;;;WAIG;QACuE,oBAAe,GAAG,KAAK,CAAC;QAElG;;;;WAIG;QACoE,iBAAY,GAAG,KAAK,CAAC;QAcp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lit/context';\nimport { CSSResultGroup } from '@lit/reactive-element/css-tag';\nimport { html, TemplateResult, LitElement, nothing } from 'lit';\nimport { property, query, queryAssignedElements, state } from 'lit/decorators.js';\n\nimport { styles as baseStyles } from '../shared/base.styles.js';\nimport { styles } from './field-base.styles.js';\n\nimport { fieldDefaultsContext } from './field-defaults-context.js';\nimport { UmFieldDefaults } from './field-defaults.js';\n\nexport abstract class UmFieldBase extends LitElement {\n static override styles: CSSResultGroup = [baseStyles, styles];\n\n @consume({context: fieldDefaultsContext, subscribe: true})\n @state()\n private config: UmFieldDefaults | undefined;\n\n @property() variant: 'filled' | 'outlined' | undefined = 'filled';\n\n @property() label: string | undefined;\n @property() counter: string | undefined;\n @property({attribute: 'supporting-text'}) supportingText: string | undefined;\n @property({attribute: 'error-text'}) errorText: string | undefined;\n\n @property({type: Boolean, reflect: true}) empty = false;\n @property({type: Boolean, reflect: true}) disabled = false;\n @property({type: Boolean, reflect: true}) invalid = false;\n\n static setDefaults(contextRoot: HTMLElement, config: UmFieldDefaults): ContextProvider<Context<HTMLElement, UmFieldDefaults>> {\n return new ContextProvider(contextRoot, {\n context: fieldDefaultsContext,\n initialValue: config\n });\n }\n\n /**\n * Whether the field has a leading icon or not\n *\n * _Note:_ Readonly\n */\n @property({type: Boolean, attribute: 'has-leading-icon', reflect: true}) hasLeadingIcon = false;\n\n /**\n * Whether the field has a trailing icon or not\n *\n * _Note:_ Readonly\n */\n @property({type: Boolean, attribute: 'has-trailing-icon', reflect: true}) hasTrailingIcon = false;\n\n /**\n * Whether the field has an error text or not\n *\n * _Note:_ Readonly\n */\n @property({type: Boolean, attribute: 'has-error-text', reflect: true}) hasErrorText = false;\n\n @queryAssignedElements({slot: 'leading-icon', flatten: true})\n private readonly assignedLeadingIcons!: HTMLElement[];\n\n @queryAssignedElements({slot: 'trailing-icon', flatten: true})\n private readonly assignedTrailingIcons!: HTMLElement[];\n\n @queryAssignedElements({slot: 'error-text', flatten: true})\n private readonly assignedErrorTexts!: HTMLElement[];\n\n @query('.label') labelElement!: HTMLElement;\n @query('.container') container!: HTMLElement;\n\n private labelSizeObserver: ResizeObserver | null = null;\n\n constructor() {\n super();\n this.variant = undefined;\n }\n\n protected override render(): TemplateResult {\n return html`\n <div class=\"container ${this.variant ?? this.config?.variant ?? 'filled'}\">\n <slot\n class=\"icon leading-icon\"\n name=\"leading-icon\"\n @slotchange=\"${this.handleLeadingIconSlotChange}\">\n </slot>\n <label class=\"label\" slot=\"label\" id=\"label\">\n <slot name=\"label\">${this.label}</slot>\n </label>\n <div class=\"input-wrapper\" part=\"wrapper\">\n ${this.renderControl()}\n </div>\n <slot\n class=\"icon trailing-icon\"\n name=\"trailing-icon\"\n @slotchange=\"${this.handleTrailingIconSlotChange}\">\n <span>${this.renderDefaultTrailingIcon()}</span>\n </slot>\n </div>\n <div class=\"supporting-text\" id=\"supporting-text\">\n <slot\n class=\"error-text\"\n name=\"error-text\"\n @slotchange=\"${this.handleErrorTextSlotChange}\">\n <div>${this.errorText}</div>\n </slot>\n <slot name=\"supporting-text\" id=\"supporting-text\">\n <div>${this.supportingText}</div>\n </slot>\n <slot class=\"counter\" name=\"counter\">\n <div>${this.counter}</div>\n </slot>\n </div>\n ${this.renderAfterContent()}\n `;\n }\n\n protected abstract renderControl(): TemplateResult;\n protected renderAfterContent(): TemplateResult {\n return html``;\n }\n\n override connectedCallback() {\n super.connectedCallback();\n this.hasLeadingIcon = !!this.assignedLeadingIcons.length;\n\n this.#attach();\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n\n this.labelSizeObserver!.disconnect();\n this.labelSizeObserver = null;\n }\n\n async #attach(): Promise<void> {\n await this.updateComplete;\n this.labelSizeObserver = new ResizeObserver(() => this.setLabelWidthProperties())\n this.labelSizeObserver.observe(this.labelElement);\n this.setLabelWidthProperties();\n }\n\n private handleLeadingIconSlotChange() {\n this.labelElement.style.transition = 'none';\n this.hasLeadingIcon = this.assignedLeadingIcons.length > 0;\n\n setTimeout(() => {\n this.labelElement.style.transition = '';\n });\n }\n\n private handleTrailingIconSlotChange() {\n this.hasTrailingIcon = this.assignedTrailingIcons.length > 0;\n }\n\n private handleErrorTextSlotChange() {\n this.hasErrorText = this.assignedErrorTexts.length > 0;\n }\n\n private setLabelWidthProperties() {\n\n const width = this.labelElement.offsetWidth;\n\n this.style.setProperty('--u-field-label-width', `${width}px`);\n this.style.setProperty('--u-field-label-half-width', `${width / 2}px`);\n\n if (!width) {\n this.container.classList.add('no-label');\n return;\n }\n\n this.container.classList.remove('no-label');\n }\n\n protected renderDefaultTrailingIcon(): TemplateResult | typeof nothing {\n return nothing;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-base.styles.js","sourceRoot":"","sources":["../../src/field/field-base.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqTzB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css `\n :host {\n --_control-line-height: var(--u-field-control-line-height, 1.5rem);\n --_label-line-height: var(--u-field-label-line-height, 1rem);\n --_field-icon-size: var(--u-field-icon-size, 1.5rem);\n --_field-control-padding: var(--u-field-control-padding, 16px);\n --_field-control-inline-padding: var(--u-field-control-inline-padding, var(--_field-control-padding));\n --_field-control-block-padding: var(--u-field-control-block-padding, var(--_field-control-padding));\n --_field-min-height: var(--u-field-min-height, 56px);\n --_field-placeholder-color: var(--u-field-placeholder-color, var(--u-color-on-surface-variant, rgb(73, 69, 79)));\n --_disabled-color: var(--u-field-disabled-color, rgba(var(--u-color-on-surface-rgb, 29, 27, 32), var(--u-field-disabled-opacity, .38)));\n --_disabled-background-color: var(--u-filled-field-disabled-background-color, rgba(var(--u-color-on-surface-rgb, ), var(--u-filled-field-background-disabled-opacity, .12)));\n --_color-primary: var(--u-color-primary, rgb(103, 80, 164));\n --_color-error: var(--u-field-error-color, var(--u-color-error, rgb(179, 38, 30)));\n --_active-indicator-opacity: 1;\n --_vertical-padding: var(--u-field-vertical-padding, 8px);\n --_icon-size: var(--u-field-icon-size, 1.5rem);\n --_icon-padding: var(--u-field-icon-padding, 12px);\n --_icon-color: var(--u-icon-color, var(--u-color-on-surface-variant, rgb(73, 69, 79)));\n --_focus-border-width: var(--u-text-field-focus-border-width, 2px);\n --_field-control-leading-padding: var(--_field-control-inline-padding);\n --_outlined-label-margin: var(--u-outlined-field-label-margin, 12px);\n --_outlined-label-padding: var(--u-outlined-field-label-padding, 4px);\n --u-label-input-start: auto;\n --u-label-input-span-leading-offset: 0;\n --u-label-input-span-trailing-offset: 0;\n --u-text-field-horizontal-padding: 12px;\n display: block;\n }\n\n .container {\n display: flex;\n align-items: center;\n position: relative;\n }\n .container::before, .container::after {\n content: \"\";\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n pointer-events: none;\n }\n .container::before {\n background: var(--u-color-on-surface, rgb(29, 27, 32));\n transition: opacity 150ms;\n opacity: 0;\n }\n .container::after {\n border-width: var(--u-field-border-width, 1px);\n border-color: var(--u-field-border-color, var(--u-color-on-surface-variant, rgb(73, 69, 79)));\n }\n\n @media (hover: hover) {\n :host(:not([disabled]):not([invalid]):hover) .container.filled::before {\n opacity: var(--u-state-hover-opacity, 0.08);\n }\n :host(:not([disabled]):not([invalid]):not(:focus-within):hover) .container::after {\n border-color: var(--u-field-hover-border-color, var(--u-color-on-surface, rgb(29, 27, 32)));\n }\n }\n .icon {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: var(--_icon-size);\n color: var(--_icon-color);\n font-size: var(--_icon-size);\n line-height: var(--_icon-size);\n }\n .icon::slotted(*) {\n flex-shrink: 0;\n }\n\n .leading-icon {\n margin-inline-start: var(--_icon-padding);\n }\n\n .trailing-icon {\n margin-inline-end: var(--_icon-padding);\n }\n\n .label {\n font-family: var(--u-font-family, var(--u-font-family, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", \"Liberation Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"));\n line-height: var(--u-field-label-line-height, var(--u-body-l-line-height, 1.5rem));\n font-size: var(--u-field-label-font-size, var(--u-body-l-font-size, 1rem));\n letter-spacing: var(--u-field-label-letter-spacing, var(--u-body-l-letter-spacing, 0.03125rem));\n font-weight: var(--u-field-label-font-weight, var(--u-body-l-font-weight, var(--u-font-weight-regular, 400)));\n font-size: var(--u-field-label-font-size, var(--u-body-s-font-size, 0.75rem));\n display: block;\n position: absolute;\n inset-inline-start: var(--_field-control-leading-padding);\n margin-bottom: 0;\n line-height: var(--_label-line-height);\n color: var(--u-field-label-color, var(--u-color-on-surface-variant, rgb(73, 69, 79)));\n transition: inset 200ms, font-size 200ms;\n }\n\n .input-wrapper {\n display: flex;\n align-items: center;\n flex: 1;\n padding-block: var(--_vertical-padding);\n padding-inline: var(--_field-control-inline-padding);\n min-height: var(--_field-min-height);\n transition: opacity 150ms;\n }\n\n .input {\n color: var(--u-field-input-text-color, var(--u-color-on-surface, rgb(29, 27, 32)));\n flex: 1;\n }\n .input:focus {\n outline: 0;\n }\n .input select,\n .input input,\n .input ::slotted(*) {\n font-family: var(--u-font-family, var(--u-font-family, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", \"Liberation Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"));\n line-height: var(--u-field-control-line-height, var(--u-body-l-line-height, 1.5rem));\n font-size: var(--u-field-control-font-size, var(--u-body-l-font-size, 1rem));\n letter-spacing: var(--u-field-control-letter-spacing, var(--u-body-l-letter-spacing, 0.03125rem));\n font-weight: var(--u-field-control-font-weight, var(--u-body-l-font-weight, var(--u-font-weight-regular, 400)));\n display: block;\n width: 100%;\n color: var(--u-field-input-text-color, var(--u-color-on-surface, rgb(29, 27, 32)));\n min-height: var(--_control-line-height);\n line-height: var(--_control-line-height);\n padding: 0;\n margin: 0;\n appearance: none;\n background: transparent;\n border: none;\n outline: 0 !important;\n }\n .input,\n .input ::slotted(select),\n .input ::slotted(:is(input, textarea))::placeholder {\n transition: color 150ms 100ms;\n }\n .input ::slotted(:is(input, textarea))::placeholder {\n color: var(--_field-placeholder-color);\n }\n\n .supporting-text {\n font-family: var(--u-font-family, var(--u-font-family, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", \"Liberation Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"));\n line-height: var(--u-field-supporting-text-line-height, var(--u-body-s-line-height, 1rem));\n font-size: var(--u-field-supporting-text-font-size, var(--u-body-s-font-size, 0.75rem));\n letter-spacing: var(--u-field-supporting-text-letter-spacing, var(--u-body-s-letter-spacing, 0.0333333333rem));\n font-weight: var(--u-field-supporting-text-font-weight, var(--u-body-s-font-weight, var(--u-font-weight-regular, 400)));\n display: flex;\n color: var(--u-field-supporting-text, var(--u-color-on-surface-variant, rgb(73, 69, 79)));\n padding-inline: 16px;\n gap: 16px;\n }\n .supporting-text div:empty {\n display: none;\n }\n .supporting-text div,\n .supporting-text ::slotted(*) {\n display: inline-block;\n margin-top: 4px;\n }\n\n .error-text {\n display: none;\n }\n\n .counter div, .counter::slotted(*) {\n margin-inline-start: auto;\n }\n\n :host([has-leading-icon]) {\n --_field-control-leading-padding: calc(var(--_icon-padding) + var(--_icon-size) + var(--_field-control-inline-padding)) ;\n }\n\n :host(:not([has-leading-icon])) .leading-icon {\n display: none;\n }\n\n :host(:not([has-trailing-icon])) .trailing-icon {\n display: none;\n }\n\n :host(:focus-within) {\n --u-field-border-width: var(--_focus-border-width);\n }\n :host(:focus-within) .container::after {\n border-color: var(--u-field-focused-border-color, var(--_color-primary));\n }\n :host(:focus-within) .label {\n color: var(--u-field-label-focused-color, var(--_color-primary));\n }\n\n :host([invalid]) .container::after {\n border-color: var(--u-field-error-border-color, var(--_color-error));\n }\n :host([invalid]) .label {\n color: var(--u-field-label-error-color, var(--_color-error));\n }\n :host([invalid]) .supporting-text {\n color: var(--u-field-supporting-text-error-color, var(--_color-error));\n }\n :host([invalid]) .trailing-icon {\n color: var(--u-field-trailing-icon-error-color, var(--_color-error));\n }\n :host([invalid]) .leading-icon {\n color: var(--u-field-leading-icon-error-color, var(--_icon-color));\n }\n\n :host([invalid]) .supporting-text:has(.error-text div:not(:empty)) .error-text,\n :host([invalid][has-error-text]) .error-text {\n display: contents;\n }\n :host([invalid]) .supporting-text:has(.error-text div:not(:empty)) slot[name=supporting-text],\n :host([invalid][has-error-text]) slot[name=supporting-text] {\n display: none;\n }\n\n .container.filled {\n border-radius: var(--u-field-filled-border-radius, 4px 4px 0 0);\n background-color: var(--u-color-surface-container-highest, rgb(230, 224, 233));\n }\n .container.filled::after {\n border-bottom-style: solid;\n }\n .container.filled:not(.no-label) .input-wrapper {\n padding-top: calc(var(--_vertical-padding) + var(--_label-line-height));\n padding-bottom: var(--_vertical-padding);\n }\n .container.filled .label {\n top: var(--_vertical-padding);\n }\n .container.filled .input ::slotted(:is(input, textarea, select, button)) {\n display: block;\n }\n .container.outlined::after {\n --_mid-point: calc(var(--u-field-label-half-width) + var(--_outlined-label-margin) + var(--_outlined-label-padding));\n border-radius: var(--u-outlined-field-shape-corder, var(--u-shape-corner-small, 8px));\n border-style: solid;\n clip-path: polygon(0 0, var(--_mid-point) 0, var(--_mid-point) var(--_focus-border-width), var(--_mid-point) var(--_focus-border-width), var(--_mid-point) 0, 100% 0, 100% 100%, 0 100%);\n transition: clip-path 100ms;\n }\n .container.outlined .label {\n top: calc(var(--_label-line-height) / -2);\n }\n\n .container.outlined:focus-within::after,\n :host(:not([empty])) .container.outlined::after {\n --_end-point: calc(var(--u-field-label-width) + var(--_outlined-label-margin) + (var(--_outlined-label-padding) * 2));\n clip-path: polygon(0 0, var(--_outlined-label-margin) 0, var(--_outlined-label-margin) var(--_focus-border-width), var(--_end-point) var(--_focus-border-width), var(--_end-point) 0, 100% 0, 100% 100%, 0 100%);\n }\n .container.outlined:focus-within .label,\n :host(:not([empty])) .container.outlined .label {\n inset-inline-start: calc(var(--_outlined-label-margin) + var(--_outlined-label-padding));\n }\n\n :host([empty]) ::slotted(select) {\n color: var(--_field-placeholder-color);\n }\n\n :host([empty]:not(:focus-within)) .label {\n font-size: var(--u-field-label-font-size, var(--u-body-l-font-size, 1rem));\n pointer-events: none;\n top: calc(var(--_field-min-height) / 2 - var(--_label-line-height) / 2);\n }\n :host([empty]:not(:focus-within)) .input-wrapper {\n opacity: 0;\n }\n :host([empty]:not(:focus-within)) .input,\n :host([empty]:not(:focus-within)) ::slotted(:is(input, textarea))::placeholder,\n :host([empty]:not(:focus-within)) ::slotted(select) {\n color: transparent;\n transition: color 150ms;\n }\n\n .container.no-label::after {\n clip-path: none !important;\n }\n\n :host([disabled]) .container .filled {\n background-color: var(--u-filled-field-disabled-background-color, rgba(var(--u-color-on-surface-rgb, 29, 27, 32), var(--u-filled-field-background-disabled-opacity, 0.04)));\n }\n :host([disabled]) .container::after {\n border-color: var(--u-field-disabled-border-color, var(--_disabled-color));\n }\n :host([disabled]) .supporting-text {\n color: var(--u-field-supporting-text-disabled-color, var(--_disabled-color));\n }\n :host([disabled]) .label {\n color: var(--u-field-label-disabled-color, var(--_disabled-color));\n }\n :host([disabled]) .input select,\n :host([disabled]) .input select::placeholder,\n :host([disabled]) .input input,\n :host([disabled]) .input input::placeholder,\n :host([disabled]) .input ::slotted(*),\n :host([disabled]) .input ::slotted(:is(input, textarea))::placeholder {\n color: var(--u-field-input-disabled-color, var(--_disabled-color));\n }\n :host([disabled]) .trailing-icon {\n color: var(--u-field-trailing-icon-disabled-color, var(--_disabled-color));\n }\n :host([disabled]) .leading-icon {\n color: var(--u-field-leading-icon-disabled-color, var(--_disabled-color));\n }\n`;\n"]}
|
|
1
|
+
{"version":3,"file":"field-base.styles.js","sourceRoot":"","sources":["../../src/field/field-base.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqTzB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css `\n :host {\n --_control-line-height: var(--u-field-control-line-height, 1.5rem);\n --_label-line-height: var(--u-field-label-line-height, 1rem);\n --_field-icon-size: var(--u-field-icon-size, 1.5rem);\n --_field-control-padding: var(--u-field-control-padding, 16px);\n --_field-control-inline-padding: var(--u-field-control-inline-padding, var(--_field-control-padding));\n --_field-control-block-padding: var(--u-field-control-block-padding, var(--_field-control-padding));\n --_field-min-height: var(--u-field-min-height, 56px);\n --_field-placeholder-color: var(--u-field-placeholder-color, var(--u-color-on-surface-variant, rgb(73, 69, 79)));\n --_disabled-color: var(--u-field-disabled-color, rgba(var(--u-color-on-surface-rgb, 29, 27, 32), var(--u-field-disabled-opacity, .38)));\n --_disabled-background-color: var(--u-filled-field-disabled-background-color, rgba(var(--u-color-on-surface-rgb, ), var(--u-filled-field-background-disabled-opacity, .12)));\n --_color-primary: var(--u-color-primary, rgb(103, 80, 164));\n --_color-error: var(--u-field-error-color, var(--u-color-error, rgb(179, 38, 30)));\n --_active-indicator-opacity: 1;\n --_vertical-padding: var(--u-field-vertical-padding, 8px);\n --_icon-size: var(--u-field-icon-size, 1.5rem);\n --_icon-padding: var(--u-field-icon-padding, 12px);\n --_icon-color: var(--u-icon-color, var(--u-color-on-surface-variant, rgb(73, 69, 79)));\n --_focus-border-width: var(--u-text-field-focus-border-width, 2px);\n --_field-control-leading-padding: var(--_field-control-inline-padding);\n --_outlined-label-margin: var(--u-outlined-field-label-margin, 12px);\n --_outlined-label-padding: var(--u-outlined-field-label-padding, 4px);\n --u-label-input-start: auto;\n --u-label-input-span-leading-offset: 0;\n --u-label-input-span-trailing-offset: 0;\n --u-text-field-horizontal-padding: 12px;\n display: block;\n }\n\n .container {\n display: flex;\n align-items: center;\n position: relative;\n }\n .container::before, .container::after {\n content: \"\";\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n pointer-events: none;\n }\n .container::before {\n background: var(--u-color-on-surface, rgb(29, 27, 32));\n transition: opacity 150ms;\n opacity: 0;\n }\n .container::after {\n border-width: var(--u-field-border-width, 1px);\n border-color: var(--u-field-border-color, var(--u-color-on-surface-variant, rgb(73, 69, 79)));\n }\n\n @media (hover: hover) {\n :host(:not([disabled]):not([invalid]):hover) .container.filled::before {\n opacity: var(--u-state-hover-opacity, 0.08);\n }\n :host(:not([disabled]):not([invalid]):not(:focus-within):hover) .container::after {\n border-color: var(--u-field-hover-border-color, var(--u-color-on-surface, rgb(29, 27, 32)));\n }\n }\n .icon {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: var(--_icon-size);\n color: var(--_icon-color);\n font-size: var(--_icon-size);\n line-height: var(--_icon-size);\n }\n .icon::slotted(*) {\n flex-shrink: 0;\n }\n\n .leading-icon {\n margin-inline-start: var(--_icon-padding);\n }\n\n .trailing-icon {\n margin-inline-end: var(--_icon-padding);\n }\n\n .label {\n font-family: var(--u-font-family, var(--u-font-family, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", \"Liberation Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"));\n line-height: var(--u-field-label-line-height, var(--u-body-l-line-height, 1.5rem));\n font-size: var(--u-field-label-font-size, var(--u-body-l-font-size, 1rem));\n letter-spacing: var(--u-field-label-letter-spacing, var(--u-body-l-letter-spacing, 0.03125rem));\n font-weight: var(--u-field-label-font-weight, var(--u-body-l-font-weight, var(--u-font-weight-regular, 400)));\n font-size: var(--u-field-label-font-size, var(--u-body-s-font-size, 0.75rem));\n display: block;\n position: absolute;\n inset-inline-start: var(--_field-control-leading-padding);\n margin-bottom: 0;\n line-height: var(--_label-line-height);\n color: var(--u-field-label-color, var(--u-color-on-surface-variant, rgb(73, 69, 79)));\n transition: inset 200ms, font-size 200ms;\n }\n\n .input-wrapper {\n display: flex;\n align-items: center;\n flex: 1;\n padding-block: var(--_vertical-padding);\n padding-inline: var(--_field-control-inline-padding);\n min-height: var(--_field-min-height);\n transition: opacity 150ms;\n }\n\n .input {\n color: var(--u-field-input-text-color, var(--u-color-on-surface, rgb(29, 27, 32)));\n flex: 1;\n }\n .input:focus {\n outline: 0;\n }\n .input select,\n .input input,\n .input ::slotted(*) {\n font-family: var(--u-font-family, var(--u-font-family, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", \"Liberation Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"));\n line-height: var(--u-field-control-line-height, var(--u-body-l-line-height, 1.5rem));\n font-size: var(--u-field-control-font-size, var(--u-body-l-font-size, 1rem));\n letter-spacing: var(--u-field-control-letter-spacing, var(--u-body-l-letter-spacing, 0.03125rem));\n font-weight: var(--u-field-control-font-weight, var(--u-body-l-font-weight, var(--u-font-weight-regular, 400)));\n display: block;\n width: 100%;\n color: var(--u-field-input-text-color, var(--u-color-on-surface, rgb(29, 27, 32)));\n min-height: var(--_control-line-height);\n line-height: var(--_control-line-height);\n padding: 0;\n margin: 0;\n appearance: none;\n background: transparent;\n border: none;\n outline: 0 !important;\n }\n .input,\n .input ::slotted(select),\n .input ::slotted(:is(input, textarea))::placeholder {\n transition: color 150ms 100ms;\n }\n .input ::slotted(:is(input, textarea))::placeholder {\n color: var(--_field-placeholder-color);\n }\n\n .supporting-text {\n font-family: var(--u-font-family, var(--u-font-family, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", \"Liberation Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"));\n line-height: var(--u-field-supporting-text-line-height, var(--u-body-s-line-height, 1rem));\n font-size: var(--u-field-supporting-text-font-size, var(--u-body-s-font-size, 0.75rem));\n letter-spacing: var(--u-field-supporting-text-letter-spacing, var(--u-body-s-letter-spacing, 0.0333333333rem));\n font-weight: var(--u-field-supporting-text-font-weight, var(--u-body-s-font-weight, var(--u-font-weight-regular, 400)));\n display: flex;\n color: var(--u-field-supporting-text, var(--u-color-on-surface-variant, rgb(73, 69, 79)));\n padding-inline: 16px;\n gap: 16px;\n }\n .supporting-text div:empty {\n display: none;\n }\n .supporting-text div,\n .supporting-text ::slotted(*) {\n display: inline-block;\n margin-top: 4px;\n }\n\n .error-text {\n display: none;\n }\n\n .counter div, .counter::slotted(*) {\n margin-inline-start: auto;\n }\n\n :host([has-leading-icon]) {\n --_field-control-leading-padding: calc(var(--_icon-padding) + var(--_icon-size) + var(--_field-control-inline-padding)) ;\n }\n\n :host(:not([has-leading-icon])) .leading-icon {\n display: none;\n }\n\n :host(:not([has-trailing-icon])) .container:has(slot[name=trailing-icon] span:empty) .trailing-icon {\n display: none;\n }\n\n :host(:focus-within) {\n --u-field-border-width: var(--_focus-border-width);\n }\n :host(:focus-within) .container::after {\n border-color: var(--u-field-focused-border-color, var(--_color-primary));\n }\n :host(:focus-within) .label {\n color: var(--u-field-label-focused-color, var(--_color-primary));\n }\n\n :host([invalid]) .container::after {\n border-color: var(--u-field-error-border-color, var(--_color-error));\n }\n :host([invalid]) .label {\n color: var(--u-field-label-error-color, var(--_color-error));\n }\n :host([invalid]) .supporting-text {\n color: var(--u-field-supporting-text-error-color, var(--_color-error));\n }\n :host([invalid]) .trailing-icon {\n color: var(--u-field-trailing-icon-error-color, var(--_color-error));\n }\n :host([invalid]) .leading-icon {\n color: var(--u-field-leading-icon-error-color, var(--_icon-color));\n }\n\n :host([invalid]) .supporting-text:has(.error-text div:not(:empty)) .error-text,\n :host([invalid][has-error-text]) .error-text {\n display: contents;\n }\n :host([invalid]) .supporting-text:has(.error-text div:not(:empty)) slot[name=supporting-text],\n :host([invalid][has-error-text]) slot[name=supporting-text] {\n display: none;\n }\n\n .container.filled {\n border-radius: var(--u-field-filled-border-radius, 4px 4px 0 0);\n background-color: var(--u-color-surface-container-highest, rgb(230, 224, 233));\n }\n .container.filled::after {\n border-bottom-style: solid;\n }\n .container.filled:not(.no-label) .input-wrapper {\n padding-top: calc(var(--_vertical-padding) + var(--_label-line-height));\n padding-bottom: var(--_vertical-padding);\n }\n .container.filled .label {\n top: var(--_vertical-padding);\n }\n .container.filled .input ::slotted(:is(input, textarea, select, button)) {\n display: block;\n }\n .container.outlined::after {\n --_mid-point: calc(var(--u-field-label-half-width) + var(--_outlined-label-margin) + var(--_outlined-label-padding));\n border-radius: var(--u-outlined-field-shape-corder, var(--u-shape-corner-small, 8px));\n border-style: solid;\n clip-path: polygon(0 0, var(--_mid-point) 0, var(--_mid-point) var(--_focus-border-width), var(--_mid-point) var(--_focus-border-width), var(--_mid-point) 0, 100% 0, 100% 100%, 0 100%);\n transition: clip-path 100ms;\n }\n .container.outlined .label {\n top: calc(var(--_label-line-height) / -2);\n }\n\n .container.outlined:focus-within::after,\n :host(:not([empty])) .container.outlined::after {\n --_end-point: calc(var(--u-field-label-width) + var(--_outlined-label-margin) + (var(--_outlined-label-padding) * 2));\n clip-path: polygon(0 0, var(--_outlined-label-margin) 0, var(--_outlined-label-margin) var(--_focus-border-width), var(--_end-point) var(--_focus-border-width), var(--_end-point) 0, 100% 0, 100% 100%, 0 100%);\n }\n .container.outlined:focus-within .label,\n :host(:not([empty])) .container.outlined .label {\n inset-inline-start: calc(var(--_outlined-label-margin) + var(--_outlined-label-padding));\n }\n\n :host([empty]) ::slotted(select) {\n color: var(--_field-placeholder-color);\n }\n\n :host([empty]:not(:focus-within)) .label {\n font-size: var(--u-field-label-font-size, var(--u-body-l-font-size, 1rem));\n pointer-events: none;\n top: calc(var(--_field-min-height) / 2 - var(--_label-line-height) / 2);\n }\n :host([empty]:not(:focus-within)) .input-wrapper {\n opacity: 0;\n }\n :host([empty]:not(:focus-within)) .input,\n :host([empty]:not(:focus-within)) ::slotted(:is(input, textarea))::placeholder,\n :host([empty]:not(:focus-within)) ::slotted(select) {\n color: transparent;\n transition: color 150ms;\n }\n\n .container.no-label::after {\n clip-path: none !important;\n }\n\n :host([disabled]) .container .filled {\n background-color: var(--u-filled-field-disabled-background-color, rgba(var(--u-color-on-surface-rgb, 29, 27, 32), var(--u-filled-field-background-disabled-opacity, 0.04)));\n }\n :host([disabled]) .container::after {\n border-color: var(--u-field-disabled-border-color, var(--_disabled-color));\n }\n :host([disabled]) .supporting-text {\n color: var(--u-field-supporting-text-disabled-color, var(--_disabled-color));\n }\n :host([disabled]) .label {\n color: var(--u-field-label-disabled-color, var(--_disabled-color));\n }\n :host([disabled]) .input select,\n :host([disabled]) .input select::placeholder,\n :host([disabled]) .input input,\n :host([disabled]) .input input::placeholder,\n :host([disabled]) .input ::slotted(*),\n :host([disabled]) .input ::slotted(:is(input, textarea))::placeholder {\n color: var(--u-field-input-disabled-color, var(--_disabled-color));\n }\n :host([disabled]) .trailing-icon {\n color: var(--u-field-trailing-icon-disabled-color, var(--_disabled-color));\n }\n :host([disabled]) .leading-icon {\n color: var(--u-field-leading-icon-disabled-color, var(--_disabled-color));\n }\n`;\n"]}
|
package/list/list-item.js
CHANGED
|
@@ -13,6 +13,7 @@ let UmListItem = class UmListItem extends LitElement {
|
|
|
13
13
|
super(...arguments);
|
|
14
14
|
this.selectable = false;
|
|
15
15
|
}
|
|
16
|
+
static { this.styles = styles; }
|
|
16
17
|
render() {
|
|
17
18
|
const ripple = html `<u-ripple></u-ripple>`;
|
|
18
19
|
return html `
|
|
@@ -22,7 +23,6 @@ let UmListItem = class UmListItem extends LitElement {
|
|
|
22
23
|
<slot name="trailing"></slot>`;
|
|
23
24
|
}
|
|
24
25
|
};
|
|
25
|
-
UmListItem.styles = styles;
|
|
26
26
|
__decorate([
|
|
27
27
|
property({ type: Boolean, reflect: true })
|
|
28
28
|
], UmListItem.prototype, "selectable", void 0);
|
package/list/list-item.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-item.js","sourceRoot":"","sources":["../../src/list/list-item.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAsB,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,OAAO,qBAAqB,CAAC;AAGtB,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,UAAU;IAAnC;;QAGqC,eAAU,GAAG,KAAK,CAAC;IAU/D,CAAC;
|
|
1
|
+
{"version":3,"file":"list-item.js","sourceRoot":"","sources":["../../src/list/list-item.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAsB,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,OAAO,qBAAqB,CAAC;AAGtB,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,UAAU;IAAnC;;QAGqC,eAAU,GAAG,KAAK,CAAC;IAU/D,CAAC;aAZiB,WAAM,GAAG,MAAM,AAAT,CAAU;IAIvB,MAAM;QACb,MAAM,MAAM,GAAG,IAAI,CAAA,uBAAuB,CAAC;QAC3C,OAAO,IAAI,CAAA;QACP,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;;;oCAGN,CAAC;IACnC,CAAC;;AATyC;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;8CAAoB;AAHlD,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CAatB","sourcesContent":["import { html, HTMLTemplateResult, LitElement, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { styles } from './list-item.styles.js';\n\nimport '../ripple/ripple.js';\n\n@customElement('u-list-item')\nexport class UmListItem extends LitElement {\n static override styles = styles;\n\n @property({type: Boolean, reflect: true}) selectable = false;\n\n override render(): HTMLTemplateResult {\n const ripple = html`<u-ripple></u-ripple>`;\n return html`\n ${this.selectable ? ripple : nothing}\n <slot name=\"leading\"></slot>\n <slot></slot>\n <slot name=\"trailing\"></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-list-item': UmListItem;\n }\n}\n"]}
|
package/list/list.js
CHANGED
|
@@ -8,11 +8,11 @@ import { html, LitElement } from 'lit';
|
|
|
8
8
|
import { customElement } from 'lit/decorators.js';
|
|
9
9
|
import { styles } from './list.styles.js';
|
|
10
10
|
let UmList = class UmList extends LitElement {
|
|
11
|
+
static { this.styles = styles; }
|
|
11
12
|
render() {
|
|
12
13
|
return html `<slot></slot>`;
|
|
13
14
|
}
|
|
14
15
|
};
|
|
15
|
-
UmList.styles = styles;
|
|
16
16
|
UmList = __decorate([
|
|
17
17
|
customElement('u-list')
|
|
18
18
|
], UmList);
|
package/list/list.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/list/list.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAsB,UAAU,EAAE,MAAM,KAAK,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAGnC,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,UAAU;
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/list/list.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAsB,UAAU,EAAE,MAAM,KAAK,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAGnC,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,UAAU;aACpB,WAAM,GAAG,MAAM,AAAT,CAAU;IAEvB,MAAM;QACb,OAAO,IAAI,CAAA,eAAe,CAAC;IAC7B,CAAC;;AALU,MAAM;IADlB,aAAa,CAAC,QAAQ,CAAC;GACX,MAAM,CAMlB","sourcesContent":["import { html, HTMLTemplateResult, LitElement } from 'lit';\nimport { customElement } from 'lit/decorators.js';\n\nimport { styles } from './list.styles.js';\n\n@customElement('u-list')\nexport class UmList extends LitElement {\n static override styles = styles;\n\n override render(): HTMLTemplateResult {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-list': UmList;\n }\n}\n"]}
|
package/menu/menu-item.d.ts
CHANGED
|
@@ -1,30 +1,36 @@
|
|
|
1
|
-
import { HTMLTemplateResult } from 'lit';
|
|
1
|
+
import { HTMLTemplateResult, nothing, TemplateResult } from 'lit';
|
|
2
2
|
import { UmButtonWrapper } from '../shared/button-wrapper.js';
|
|
3
3
|
export declare class UmMenuItem extends UmButtonWrapper {
|
|
4
4
|
#private;
|
|
5
|
-
static styles: import("lit").
|
|
5
|
+
static styles: import("lit").CSSResultGroup[];
|
|
6
6
|
/**
|
|
7
7
|
* Force show focus ring
|
|
8
8
|
*/
|
|
9
9
|
get active(): boolean;
|
|
10
10
|
set active(active: boolean);
|
|
11
11
|
/**
|
|
12
|
-
* Whether the
|
|
12
|
+
* Whether the menu item has leading icon or not
|
|
13
13
|
*
|
|
14
14
|
* _Note:_ Readonly
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
hasLeadingIcon: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the menu item has trailing icon or not
|
|
19
|
+
*
|
|
20
|
+
* _Note:_ Readonly
|
|
21
|
+
*/
|
|
22
|
+
hasTrailingIcon: boolean;
|
|
17
23
|
/**
|
|
18
24
|
* Whether the drawer item has badge or not
|
|
19
25
|
*
|
|
20
26
|
* _Note:_ Readonly
|
|
21
27
|
*/
|
|
22
28
|
hasBadge: boolean;
|
|
23
|
-
private readonly assignedIcons;
|
|
24
29
|
innerRole: string;
|
|
25
30
|
connectedCallback(): void;
|
|
31
|
+
disconnectedCallback(): void;
|
|
26
32
|
protected renderContent(): HTMLTemplateResult;
|
|
27
|
-
|
|
33
|
+
protected renderDefaultTrailingIcon(): TemplateResult | typeof nothing;
|
|
28
34
|
}
|
|
29
35
|
declare global {
|
|
30
36
|
interface HTMLElementTagNameMap {
|
package/menu/menu-item.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-item.d.ts","sourceRoot":"","sources":["../../src/menu/menu-item.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,kBAAkB,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"menu-item.d.ts","sourceRoot":"","sources":["../../src/menu/menu-item.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,kBAAkB,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAKxE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,qBACa,UAAW,SAAQ,eAAe;;IAE7C,OAAgB,MAAM,iCAGpB;IAIF;;OAEG;IACH,IACI,MAAM,IAAI,OAAO,CAEpB;IACD,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,EASzB;IAED;;;;OAIG;IACsE,cAAc,UAAS;IAEhG;;;;OAIG;IACuE,eAAe,UAAS;IAElG;;;;OAIG;IAC+D,QAAQ,UAAS;IAE1E,SAAS,SAAc;IAEvB,iBAAiB;IAMjB,oBAAoB;cAQV,aAAa,IAAI,kBAAkB;IAsBtD,SAAS,CAAC,yBAAyB,IAAI,cAAc,GAAG,OAAO,OAAO;CAWvE;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
|
package/menu/menu-item.js
CHANGED
|
@@ -4,32 +4,26 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
-
};
|
|
12
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
13
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
14
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
15
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
16
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
17
|
-
};
|
|
18
|
-
var _UmMenuItem_active;
|
|
19
|
-
import { html } from 'lit';
|
|
20
|
-
import { customElement, property, queryAssignedElements } from 'lit/decorators.js';
|
|
7
|
+
import { html, nothing } from 'lit';
|
|
8
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
21
9
|
import { styles } from './menu-item.styles.js';
|
|
22
10
|
import { UmButtonWrapper } from '../shared/button-wrapper.js';
|
|
23
11
|
let UmMenuItem = class UmMenuItem extends UmButtonWrapper {
|
|
24
12
|
constructor() {
|
|
25
13
|
super(...arguments);
|
|
26
|
-
|
|
14
|
+
this.#active = false;
|
|
27
15
|
/**
|
|
28
|
-
* Whether the
|
|
16
|
+
* Whether the menu item has leading icon or not
|
|
29
17
|
*
|
|
30
18
|
* _Note:_ Readonly
|
|
31
19
|
*/
|
|
32
|
-
this.
|
|
20
|
+
this.hasLeadingIcon = false;
|
|
21
|
+
/**
|
|
22
|
+
* Whether the menu item has trailing icon or not
|
|
23
|
+
*
|
|
24
|
+
* _Note:_ Readonly
|
|
25
|
+
*/
|
|
26
|
+
this.hasTrailingIcon = false;
|
|
33
27
|
/**
|
|
34
28
|
* Whether the drawer item has badge or not
|
|
35
29
|
*
|
|
@@ -37,15 +31,21 @@ let UmMenuItem = class UmMenuItem extends UmButtonWrapper {
|
|
|
37
31
|
*/
|
|
38
32
|
this.hasBadge = false;
|
|
39
33
|
this.innerRole = 'menuitem';
|
|
34
|
+
this.#handleMouseEnter = () => this.dispatchEvent(new CustomEvent('menu-item-mouseenter', { bubbles: true }));
|
|
40
35
|
}
|
|
36
|
+
static { this.styles = [
|
|
37
|
+
UmButtonWrapper.styles,
|
|
38
|
+
styles
|
|
39
|
+
]; }
|
|
40
|
+
#active;
|
|
41
41
|
/**
|
|
42
42
|
* Force show focus ring
|
|
43
43
|
*/
|
|
44
44
|
get active() {
|
|
45
|
-
return
|
|
45
|
+
return this.#active;
|
|
46
46
|
}
|
|
47
47
|
set active(active) {
|
|
48
|
-
|
|
48
|
+
this.#active = active;
|
|
49
49
|
if (active) {
|
|
50
50
|
this.classList.add('force-focus-ring');
|
|
51
51
|
return;
|
|
@@ -55,38 +55,56 @@ let UmMenuItem = class UmMenuItem extends UmButtonWrapper {
|
|
|
55
55
|
connectedCallback() {
|
|
56
56
|
super.connectedCallback();
|
|
57
57
|
this.role = 'presentation';
|
|
58
|
+
this.addEventListener('mouseenter', this.#handleMouseEnter);
|
|
59
|
+
}
|
|
60
|
+
disconnectedCallback() {
|
|
61
|
+
super.disconnectedCallback();
|
|
62
|
+
this.removeEventListener('mouseenter', this.#handleMouseEnter);
|
|
58
63
|
}
|
|
64
|
+
#handleMouseEnter;
|
|
59
65
|
renderContent() {
|
|
60
66
|
return html `
|
|
61
|
-
<div class="icon">
|
|
67
|
+
<div class="icon leading">
|
|
62
68
|
<slot
|
|
63
|
-
name="icon"
|
|
69
|
+
name="leading-icon"
|
|
64
70
|
aria-hidden="true"
|
|
65
|
-
@slotchange="${this
|
|
71
|
+
@slotchange="${this.#handleLeadingIconSlotChange}"></slot>
|
|
66
72
|
</div>
|
|
67
73
|
<span class="label" id="text">
|
|
68
74
|
<slot></slot>
|
|
69
75
|
</span>
|
|
76
|
+
<div class="icon trailing">
|
|
77
|
+
<slot
|
|
78
|
+
name="leading-icon"
|
|
79
|
+
aria-hidden="true"
|
|
80
|
+
@slotchange="${this.#handleTrailingIconSlotChange}">
|
|
81
|
+
<span>${this.renderDefaultTrailingIcon()}</span>
|
|
82
|
+
</slot>
|
|
83
|
+
</div>
|
|
70
84
|
`;
|
|
71
85
|
}
|
|
72
|
-
|
|
73
|
-
|
|
86
|
+
renderDefaultTrailingIcon() {
|
|
87
|
+
return nothing;
|
|
88
|
+
}
|
|
89
|
+
#handleLeadingIconSlotChange(e) {
|
|
90
|
+
this.hasLeadingIcon = e.target.assignedElements({ flatten: true }).length > 0;
|
|
91
|
+
}
|
|
92
|
+
#handleTrailingIconSlotChange(e) {
|
|
93
|
+
this.hasTrailingIcon = e.target.assignedElements({ flatten: true }).length > 0;
|
|
74
94
|
}
|
|
75
95
|
};
|
|
76
|
-
_UmMenuItem_active = new WeakMap();
|
|
77
|
-
UmMenuItem.styles = styles;
|
|
78
96
|
__decorate([
|
|
79
97
|
property({ type: Boolean, reflect: true })
|
|
80
98
|
], UmMenuItem.prototype, "active", null);
|
|
81
99
|
__decorate([
|
|
82
|
-
property({ type: Boolean, attribute: 'has-icon', reflect: true })
|
|
83
|
-
], UmMenuItem.prototype, "
|
|
100
|
+
property({ type: Boolean, attribute: 'has-leading-icon', reflect: true })
|
|
101
|
+
], UmMenuItem.prototype, "hasLeadingIcon", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
property({ type: Boolean, attribute: 'has-trailing-icon', reflect: true })
|
|
104
|
+
], UmMenuItem.prototype, "hasTrailingIcon", void 0);
|
|
84
105
|
__decorate([
|
|
85
106
|
property({ type: Boolean, attribute: 'has-badge', reflect: true })
|
|
86
107
|
], UmMenuItem.prototype, "hasBadge", void 0);
|
|
87
|
-
__decorate([
|
|
88
|
-
queryAssignedElements({ slot: 'icon', flatten: true })
|
|
89
|
-
], UmMenuItem.prototype, "assignedIcons", void 0);
|
|
90
108
|
UmMenuItem = __decorate([
|
|
91
109
|
customElement('u-menu-item')
|
|
92
110
|
], UmMenuItem);
|
package/menu/menu-item.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-item.js","sourceRoot":"","sources":["../../src/menu/menu-item.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"menu-item.js","sourceRoot":"","sources":["../../src/menu/menu-item.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,IAAI,EAAsB,OAAO,EAAkB,MAAM,KAAK,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAGvD,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,eAAe;IAAxC;;QAOL,YAAO,GAAG,KAAK,CAAC;QAoBhB;;;;WAIG;QACsE,mBAAc,GAAG,KAAK,CAAC;QAEhG;;;;WAIG;QACuE,oBAAe,GAAG,KAAK,CAAC;QAElG;;;;WAIG;QAC+D,aAAQ,GAAG,KAAK,CAAC;QAE1E,cAAS,GAAG,UAAU,CAAC;QAahC,sBAAiB,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAC1C,IAAI,WAAW,CAAa,sBAAsB,EAAE,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC,CAAC;IAmC1E,CAAC;aA/FiB,WAAM,GAAG;QACvB,eAAe,CAAC,MAAM;QACtB,MAAM;KACP,AAHqB,CAGpB;IAEF,OAAO,CAAS;IAEhB;;OAEG;IAEH,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACD,IAAI,MAAM,CAAC,MAAe;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QAEtB,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;YACvC,OAAO;QACT,CAAC;QAED,IAAI,CAAC,SAAS,CAA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E,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;mDAAyB;AAOhC;IAAjE,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;4CAAkB;AA9CxE,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CAiGtB","sourcesContent":["\nimport { html, HTMLTemplateResult, nothing, TemplateResult } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { styles } from './menu-item.styles.js';\n\nimport { UmButtonWrapper } from '../shared/button-wrapper.js';\n\n@customElement('u-menu-item')\nexport class UmMenuItem extends UmButtonWrapper {\n\n static override styles = [\n UmButtonWrapper.styles,\n styles\n ];\n\n #active = false;\n\n /**\n * Force show focus ring\n */\n @property({type: Boolean, reflect: true})\n get active(): boolean {\n return this.#active;\n }\n set active(active: boolean) {\n this.#active = active;\n\n if (active) {\n this.classList.add('force-focus-ring');\n return;\n }\n\n this.classList.remove('force-focus-ring');\n }\n\n /**\n * Whether the menu item has leading icon or not\n *\n * _Note:_ Readonly\n */\n @property({type: Boolean, attribute: 'has-leading-icon', reflect: true}) hasLeadingIcon = false;\n\n /**\n * Whether the menu item has trailing icon or not\n *\n * _Note:_ Readonly\n */\n @property({type: Boolean, attribute: 'has-trailing-icon', reflect: true}) hasTrailingIcon = false;\n\n /**\n * Whether the drawer item has badge or not\n *\n * _Note:_ Readonly\n */\n @property({type: Boolean, attribute: 'has-badge', reflect: true}) hasBadge = false;\n\n override innerRole = 'menuitem';\n\n override connectedCallback() {\n super.connectedCallback();\n this.role = 'presentation';\n this.addEventListener('mouseenter', this.#handleMouseEnter);\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('mouseenter', this.#handleMouseEnter);\n }\n\n #handleMouseEnter = () => this.dispatchEvent(\n new CustomEvent<UmMenuItem>('menu-item-mouseenter', {bubbles: true}));\n\n protected override renderContent(): HTMLTemplateResult {\n return html`\n <div class=\"icon leading\">\n <slot\n name=\"leading-icon\"\n aria-hidden=\"true\"\n @slotchange=\"${this.#handleLeadingIconSlotChange}\"></slot>\n </div>\n <span class=\"label\" id=\"text\">\n <slot></slot>\n </span>\n <div class=\"icon trailing\">\n <slot\n name=\"leading-icon\"\n aria-hidden=\"true\"\n @slotchange=\"${this.#handleTrailingIconSlotChange}\">\n <span>${this.renderDefaultTrailingIcon()}</span>\n </slot>\n </div>\n `;\n }\n\n protected renderDefaultTrailingIcon(): TemplateResult | typeof nothing {\n return nothing;\n }\n\n #handleLeadingIconSlotChange(e: Event) {\n this.hasLeadingIcon = (<HTMLSlotElement>e.target).assignedElements({flatten: true}).length > 0;\n }\n\n #handleTrailingIconSlotChange(e: Event) {\n this.hasTrailingIcon = (<HTMLSlotElement>e.target).assignedElements({flatten: true}).length > 0;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-menu-item': UmMenuItem;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-item.styles.d.ts","sourceRoot":"","sources":["../../src/menu/menu-item.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"menu-item.styles.d.ts","sourceRoot":"","sources":["../../src/menu/menu-item.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBA+ClB,CAAC"}
|
package/menu/menu-item.styles.js
CHANGED
|
@@ -1,95 +1,8 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
2
|
export const styles = css `
|
|
3
|
-
:host,
|
|
4
|
-
* {
|
|
5
|
-
--_focus-ring-outline-offset: var(--u-focus-ring-outline-offset, 2px);
|
|
6
|
-
font-family: var(--u-font-family, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");
|
|
7
|
-
box-sizing: border-box;
|
|
8
|
-
outline: 0;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
:host(.force-focus-ring) .focus-ring,
|
|
12
|
-
.focus-ring:focus-visible {
|
|
13
|
-
--_color-primary: var(--u-color-primary, rgb(103, 80, 164));
|
|
14
|
-
animation: u-focus-pulse 500ms ease;
|
|
15
|
-
animation-fill-mode: forwards;
|
|
16
|
-
outline-offset: var(--_focus-ring-outline-offset);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
@keyframes u-focus-pulse {
|
|
20
|
-
0% {
|
|
21
|
-
outline: 0 solid var(--_color-primary);
|
|
22
|
-
}
|
|
23
|
-
50% {
|
|
24
|
-
outline: 6px solid var(--_color-primary);
|
|
25
|
-
}
|
|
26
|
-
100% {
|
|
27
|
-
outline: 4px solid var(--_color-primary);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
:host {
|
|
31
|
-
--_color-primary: var(--u-color-primary, rgb(103, 80, 164));
|
|
32
|
-
-webkit-tap-highlight-color: transparent;
|
|
33
|
-
--u-elevation-level: 0;
|
|
34
|
-
position: relative;
|
|
35
|
-
display: inline-block;
|
|
36
|
-
font-family: var(--u-font-family, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");
|
|
37
|
-
appearance: none !important;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
:host([disabled]) {
|
|
41
|
-
--u-elevation-level: 0 !important;
|
|
42
|
-
background-color: var(--u-button-disabled-background-color, rgba(var(--u-color-on-surface-rgb, 29, 27, 32), var(--u-button-disabled-background-opacity, 0.12))) !important;
|
|
43
|
-
color: var(--u-button-disabled-text-color, rgba(var(--u-color-on-surface-rgb, 29, 27, 32), var(--u-button-disabled-color, 0.38))) !important;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
:host([disabled]) .button {
|
|
47
|
-
cursor: default;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
* {
|
|
51
|
-
color: inherit;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
u-elevation {
|
|
55
|
-
z-index: -1;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.button {
|
|
59
|
-
cursor: pointer;
|
|
60
|
-
position: absolute;
|
|
61
|
-
inset-inline-start: 0;
|
|
62
|
-
inset-block-start: 0;
|
|
63
|
-
width: 100%;
|
|
64
|
-
height: 100%;
|
|
65
|
-
font-family: inherit;
|
|
66
|
-
border-radius: inherit;
|
|
67
|
-
color: inherit;
|
|
68
|
-
border: none;
|
|
69
|
-
margin: 0;
|
|
70
|
-
padding: 0;
|
|
71
|
-
text-align: center;
|
|
72
|
-
white-space: nowrap;
|
|
73
|
-
background: transparent;
|
|
74
|
-
user-select: none;
|
|
75
|
-
text-decoration: none;
|
|
76
|
-
outline: 0;
|
|
77
|
-
z-index: 0;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.content {
|
|
81
|
-
display: inline-flex;
|
|
82
|
-
align-items: center;
|
|
83
|
-
justify-content: center;
|
|
84
|
-
white-space: nowrap;
|
|
85
|
-
border-radius: inherit;
|
|
86
|
-
width: 100%;
|
|
87
|
-
height: 100%;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
3
|
:host {
|
|
91
4
|
display: block;
|
|
92
|
-
--_menu-item-icon-size: var(--u-menu-item-icon-size, 1.
|
|
5
|
+
--_menu-item-icon-size: var(--u-menu-item-icon-size, 1.5rem);
|
|
93
6
|
--_menu-item-padding: var(--u-menu-item-padding, 12px);
|
|
94
7
|
--u-focus-ring-outline-offset: -4px;
|
|
95
8
|
height: var(--u-menu-item-height, 56px);
|
|
@@ -102,24 +15,36 @@ export const styles = css `
|
|
|
102
15
|
font-weight: var(--u-menu-item-label-font-weight, var(--u-label-l-font-weight, var(--u-font-weight-medium, 500)));
|
|
103
16
|
}
|
|
104
17
|
|
|
105
|
-
:host(:not([has-icon])) .
|
|
18
|
+
:host(:not([has-leading-icon])) .leading {
|
|
19
|
+
display: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:host(:not([has-trailing-icon])) .trailing:has(slot[name=trailing-icon] span:empty) {
|
|
106
23
|
display: none;
|
|
107
24
|
}
|
|
108
25
|
|
|
109
26
|
.icon {
|
|
110
27
|
font-size: var(--_menu-item-icon-size);
|
|
111
28
|
line-height: var(--_menu-item-icon-size);
|
|
112
|
-
margin-inline-end: var(--u-menu-item-icon-margin, 12px);
|
|
113
29
|
color: var(--u-menu-item-label-color, var(--u-color-on-surface-variant, rgb(73, 69, 79)));
|
|
114
30
|
}
|
|
115
31
|
|
|
116
32
|
.content {
|
|
117
33
|
justify-content: flex-start;
|
|
34
|
+
gap: var(--u-menu-item-icon-margin, 12px);
|
|
118
35
|
}
|
|
119
36
|
|
|
120
37
|
:host(.force-focus-ring) .button,
|
|
121
38
|
.button:focus-visible {
|
|
122
39
|
border-radius: var(--u-spacing-small, 8px);
|
|
123
40
|
}
|
|
41
|
+
|
|
42
|
+
.label {
|
|
43
|
+
flex: 1;
|
|
44
|
+
max-width: 100%;
|
|
45
|
+
overflow: hidden;
|
|
46
|
+
white-space: nowrap;
|
|
47
|
+
text-overflow: ellipsis;
|
|
48
|
+
}
|
|
124
49
|
`;
|
|
125
50
|
//# sourceMappingURL=menu-item.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-item.styles.js","sourceRoot":"","sources":["../../src/menu/menu-item.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC
|
|
1
|
+
{"version":3,"file":"menu-item.styles.js","sourceRoot":"","sources":["../../src/menu/menu-item.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+CzB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css `\n :host {\n display: block;\n --_menu-item-icon-size: var(--u-menu-item-icon-size, 1.5rem);\n --_menu-item-padding: var(--u-menu-item-padding, 12px);\n --u-focus-ring-outline-offset: -4px;\n height: var(--u-menu-item-height, 56px);\n padding-inline: var(--_menu-item-padding);\n color: var(--u-menu-item-label-color, var(--u-color-on-surface, rgb(29, 27, 32)));\n font-family: var(--u-font-family, var(--u-font-family, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", \"Liberation Sans\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"));\n line-height: var(--u-menu-item-label-line-height, var(--u-label-l-line-height, 1.25rem));\n font-size: var(--u-menu-item-label-font-size, var(--u-label-l-font-size, 0.875rem));\n letter-spacing: var(--u-menu-item-label-letter-spacing, var(--u-label-l-letter-spacing, 0.0071428571rem));\n font-weight: var(--u-menu-item-label-font-weight, var(--u-label-l-font-weight, var(--u-font-weight-medium, 500)));\n }\n\n :host(:not([has-leading-icon])) .leading {\n display: none;\n }\n\n :host(:not([has-trailing-icon])) .trailing:has(slot[name=trailing-icon] span:empty) {\n display: none;\n }\n\n .icon {\n font-size: var(--_menu-item-icon-size);\n line-height: var(--_menu-item-icon-size);\n color: var(--u-menu-item-label-color, var(--u-color-on-surface-variant, rgb(73, 69, 79)));\n }\n\n .content {\n justify-content: flex-start;\n gap: var(--u-menu-item-icon-margin, 12px);\n }\n\n :host(.force-focus-ring) .button,\n .button:focus-visible {\n border-radius: var(--u-spacing-small, 8px);\n }\n\n .label {\n flex: 1;\n max-width: 100%;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n`;\n"]}
|
package/menu/menu.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../src/menu/menu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,kBAAkB,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAM3D,OAAO,2BAA2B,CAAC;AAiCnC,qBACa,MAAO,SAAQ,UAAU;;IAEpC,OAAgB,MAAM,4BAAwB;IAI9C;;OAEG;IACH,IACI,IAAI,IAAI,OAAO,CAElB;IACD,IAAI,IAAI,CAAC,IAAI,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../src/menu/menu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,kBAAkB,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAM3D,OAAO,2BAA2B,CAAC;AAiCnC,qBACa,MAAO,SAAQ,UAAU;;IAEpC,OAAgB,MAAM,4BAAwB;IAI9C;;OAEG;IACH,IACI,IAAI,IAAI,OAAO,CAElB;IACD,IAAI,IAAI,CAAC,IAAI,EAAE,OAAO,EAiCrB;IAE0B,WAAW,EAAE,UAAU,GAAG,OAAO,CAAc;IAE/C,WAAW,UAAS;IAE/C;;;OAGG;IAEH,YAAY,EAAE,YAAY,GAAG,UAAU,GAAG,aAAa,GAAG,WAAW,GAAG,WAAW,GAAG,SAAS,CAAe;IAE9G;;;;;OAKG;IACwB,SAAS,EAAE,UAAU,GAAG,QAAQ,GAAG,YAAY,GAAG,UAAU,CAAc;IAErG;;OAEG;IACoE,aAAa,UAAS;IAE7E,IAAI,EAAG,WAAW,CAAC;IACpB,GAAG,EAAG,WAAW,CAAC;IAEjC,IAAI,eAAe,IAAI,WAAW,CAEjC;IAID,IAAI,aAAa,IAAI,WAAW,GAAG,IAAI,GAAG,SAAS,CAElD;IACD,IAAI,aAAa,CAAC,aAAa,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,EAE9D;cAEkB,MAAM,IAAI,kBAAkB;IA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