@api-client/ui 0.5.26 → 0.5.28
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/build/src/elements/app-bar/internals/AppBar.d.ts +1 -1
- package/build/src/elements/app-bar/internals/AppBar.d.ts.map +1 -1
- package/build/src/elements/app-bar/internals/AppBar.js +5 -5
- package/build/src/elements/app-bar/internals/AppBar.js.map +1 -1
- package/build/src/elements/currency/internals/Picker.d.ts +2 -2
- package/build/src/elements/currency/internals/Picker.d.ts.map +1 -1
- package/build/src/elements/currency/internals/Picker.js +13 -12
- package/build/src/elements/currency/internals/Picker.js.map +1 -1
- package/build/src/elements/data-table/DataTable.d.ts +1 -3
- package/build/src/elements/data-table/DataTable.d.ts.map +1 -1
- package/build/src/elements/data-table/DataTable.js +2 -4
- package/build/src/elements/data-table/DataTable.js.map +1 -1
- package/build/src/elements/file-system/internals/Breadcrumbs.d.ts +1 -2
- package/build/src/elements/file-system/internals/Breadcrumbs.d.ts.map +1 -1
- package/build/src/elements/file-system/internals/Breadcrumbs.js +2 -3
- package/build/src/elements/file-system/internals/Breadcrumbs.js.map +1 -1
- package/build/src/elements/navigation/internals/NavigationItem.js +1 -1
- package/build/src/elements/navigation/internals/NavigationItem.js.map +1 -1
- package/build/src/md/list/internals/List.d.ts +4 -2
- package/build/src/md/list/internals/List.d.ts.map +1 -1
- package/build/src/md/list/internals/List.js +16 -6
- package/build/src/md/list/internals/List.js.map +1 -1
- package/build/src/md/list/internals/ListItem.d.ts +10 -1
- package/build/src/md/list/internals/ListItem.d.ts.map +1 -1
- package/build/src/md/list/internals/ListItem.js +74 -8
- package/build/src/md/list/internals/ListItem.js.map +1 -1
- package/build/src/md/list/internals/ListItem.styles.d.ts.map +1 -1
- package/build/src/md/list/internals/ListItem.styles.js +38 -28
- package/build/src/md/list/internals/ListItem.styles.js.map +1 -1
- package/build/src/md/menu/internal/MenuItem.js +4 -4
- package/build/src/md/menu/internal/MenuItem.js.map +1 -1
- package/build/src/md/progress/internals/CircularProgress.d.ts +93 -0
- package/build/src/md/progress/internals/CircularProgress.d.ts.map +1 -0
- package/build/src/md/progress/internals/CircularProgress.js +156 -0
- package/build/src/md/progress/internals/CircularProgress.js.map +1 -0
- package/build/src/md/progress/internals/CircularProgress.styles.d.ts +3 -0
- package/build/src/md/progress/internals/CircularProgress.styles.d.ts.map +1 -0
- package/build/src/md/progress/internals/CircularProgress.styles.js +220 -0
- package/build/src/md/progress/internals/CircularProgress.styles.js.map +1 -0
- package/build/src/md/progress/internals/Range.d.ts +6 -0
- package/build/src/md/progress/internals/Range.d.ts.map +1 -1
- package/build/src/md/progress/internals/Range.js +41 -3
- package/build/src/md/progress/internals/Range.js.map +1 -1
- package/build/src/md/progress/internals/UiProgress.d.ts +0 -7
- package/build/src/md/progress/internals/UiProgress.d.ts.map +1 -1
- package/build/src/md/progress/internals/UiProgress.js +2 -36
- package/build/src/md/progress/internals/UiProgress.js.map +1 -1
- package/build/src/md/progress/ui-circular-progress.d.ts +11 -0
- package/build/src/md/progress/ui-circular-progress.d.ts.map +1 -0
- package/build/src/md/progress/ui-circular-progress.js +27 -0
- package/build/src/md/progress/ui-circular-progress.js.map +1 -0
- package/build/src/md/select/internals/Option.js +2 -2
- package/build/src/md/select/internals/Option.js.map +1 -1
- package/build/src/md/select/internals/Option.styles.d.ts.map +1 -1
- package/build/src/md/select/internals/Option.styles.js +0 -127
- package/build/src/md/select/internals/Option.styles.js.map +1 -1
- package/build/src/md/select/internals/Select.d.ts +11 -1
- package/build/src/md/select/internals/Select.d.ts.map +1 -1
- package/build/src/md/select/internals/Select.js +21 -2
- package/build/src/md/select/internals/Select.js.map +1 -1
- package/demo/elements/currency/index.html +2 -2
- package/demo/elements/navigation/navigation-item.html +4 -0
- package/demo/elements/navigation/navigation-item.ts +19 -0
- package/demo/md/list/list.ts +9 -3
- package/demo/md/progress/progress.ts +24 -1
- package/demo/md/select/index.ts +5 -0
- package/demo/md/tabs/tabs.ts +0 -4
- package/package.json +1 -1
- package/src/elements/app-bar/internals/AppBar.ts +5 -5
- package/src/elements/currency/internals/Picker.ts +17 -16
- package/src/elements/data-table/DataTable.ts +2 -4
- package/src/elements/file-system/internals/Breadcrumbs.ts +2 -3
- package/src/elements/navigation/internals/NavigationItem.ts +1 -1
- package/src/md/list/internals/List.ts +19 -8
- package/src/md/list/internals/ListItem.styles.ts +38 -28
- package/src/md/list/internals/ListItem.ts +55 -8
- package/src/md/menu/internal/MenuItem.ts +4 -4
- package/src/md/progress/internals/CircularProgress.styles.ts +220 -0
- package/src/md/progress/internals/CircularProgress.ts +129 -0
- package/src/md/progress/internals/Range.ts +29 -1
- package/src/md/progress/internals/UiProgress.ts +1 -30
- package/src/md/progress/ui-circular-progress.ts +15 -0
- package/src/md/select/internals/Option.styles.ts +0 -127
- package/src/md/select/internals/Option.ts +2 -2
- package/src/md/select/internals/Select.ts +13 -1
- package/test/elements/currency/CurrencyPicker.accessibility.test.ts +14 -14
- package/test/elements/currency/CurrencyPicker.core.test.ts +6 -6
- package/test/elements/currency/CurrencyPicker.integration.test.ts +2 -2
- package/test/elements/currency/CurrencyPicker.test.ts +10 -10
- package/test/elements/data-table/DataTable.browser.test.ts +2 -2
- package/test/md/menu/MenuItem.test.ts +2 -3
- package/test/md/progress/UiCircularProgressElement.test.ts +481 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../../../src/md/select/internals/Select.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAkC,MAAM,KAAK,CAAA;AACtE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAItD,OAAO,4CAA4C,CAAA;AACnD,OAAO,uBAAuB,CAAA;AAC9B,OAAO,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;AAngBH;;;;;;;GAOG;AACH","sourcesContent":["import { html, LitElement, PropertyValues, TemplateResult } from 'lit'\nimport { property, query, state } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { setDisabled } from '../../../lib/disabled.js'\nimport type UiOption from './Option.js'\nimport type { UiMenuElement } from '../../menu/ui-menu.js'\n\nimport '../../text-field/ui-outlined-text-field.js'\nimport '../../menu/ui-menu.js'\nimport '../../icons/ui-icon.js'\nimport '@material/web/focus/md-focus-ring.js'\n\nexport interface UiSelectChangeEvent {\n value: string | undefined\n item: UiOption | null\n}\n\n/**\n * Material Design 3 Select component that behaves like an outlined text field with dropdown.\n *\n * @fires change - Dispatched when the selection changes. The event is non-bubbling and non-cancelable.\n * The `event.detail` object contains the `value` and `item` properties.\n * @fires open - Dispatched when the dropdown opens\n * @fires close - Dispatched when the dropdown closes\n */\nexport default class UiSelect extends LitElement {\n static readonly formAssociated = true\n #internals = this.attachInternals()\n\n /**\n * The value has a private member so that we can set the value without triggering\n * the side effects.\n */\n #value: string | undefined\n\n /**\n * The currently selected value. Corresponds to the `value` attribute of the selected `ui-option`.\n * When set programmatically, it will update the selected option if a matching option exists.\n *\n * @example\n * ```html\n * <ui-select value=\"apple\">\n * <ui-option value=\"apple\">Apple</ui-option>\n * <ui-option value=\"banana\">Banana</ui-option>\n * </ui-select>\n * ```\n */\n get value(): string | undefined {\n return this.#value\n }\n\n @property({ type: String })\n set value(newValue: string | undefined) {\n const oldValue = this.#value\n if (newValue === oldValue) return\n this.#value = newValue\n this.requestUpdate()\n }\n\n /**\n * The name attribute for form submission. This value will be used as the key\n * when the form is submitted.\n *\n * @example\n * ```html\n * <ui-select name=\"country\" value=\"us\">\n * <ui-option value=\"us\">United States</ui-option>\n * </ui-select>\n * ```\n */\n @property({ type: String }) accessor name: string | undefined\n\n /**\n * The label text displayed in the select field. Provides accessible labeling\n * and is shown as the floating label in the outlined text field.\n *\n * @example\n * ```html\n * <ui-select label=\"Select a country\">\n * <ui-option value=\"us\">United States</ui-option>\n * </ui-select>\n * ```\n */\n @property({ type: String }) accessor label: string | undefined\n\n /**\n * Whether the select is required for form validation. When true, the select\n * must have a value selected for the form to be valid.\n *\n * @default false\n * @example\n * ```html\n * <ui-select required label=\"Required field\">\n * <ui-option value=\"option1\">Option 1</ui-option>\n * </ui-select>\n * ```\n */\n @property({ type: Boolean }) accessor required = false\n\n /**\n * Whether the select is in an invalid state. This is typically set automatically\n * during validation, but can be set manually to indicate validation errors.\n *\n * @example\n * ```html\n * <ui-select invalid invalidText=\"Please select a valid option\">\n * <ui-option value=\"option1\">Option 1</ui-option>\n * </ui-select>\n * ```\n */\n @property({ type: Boolean }) accessor invalid: boolean | undefined\n\n /**\n * The error message to display when the select is invalid. This text is shown\n * below the select field when `invalid` is true.\n *\n * @example\n * ```html\n * <ui-select invalid invalidText=\"This field is required\">\n * <ui-option value=\"option1\">Option 1</ui-option>\n * </ui-select>\n * ```\n */\n @property({ type: String }) accessor invalidText: string | undefined\n\n /**\n * Whether the select is disabled. When disabled, the select cannot be interacted\n * with and will not receive focus or respond to user input.\n *\n * @default false\n * @example\n * ```html\n * <ui-select disabled label=\"Disabled select\">\n * <ui-option value=\"option1\">Option 1</ui-option>\n * </ui-select>\n * ```\n */\n @property({ type: Boolean, reflect: true }) accessor disabled = false\n\n /**\n * Whether the dropdown menu is currently open. This property reflects the\n * current state of the dropdown and can be set programmatically to open/close it.\n *\n * @default false\n * @example\n * ```javascript\n * // Open the dropdown programmatically\n * selectElement.open = true;\n *\n * // Close the dropdown\n * selectElement.open = false;\n * ```\n */\n @property({ type: Boolean, reflect: true }) accessor open = false\n\n @state() accessor selectedOption: UiOption | null = null\n @state() accessor ariaActiveDescendant: string | undefined\n @query('.menu') accessor menu!: UiMenuElement\n\n /**\n * Returns the currently selected option element. This provides access to the\n * full `ui-option` element, not just its value.\n *\n * @readonly\n * @example\n * ```javascript\n * const select = document.querySelector('ui-select');\n * const selectedItem = select.selectedItem;\n * if (selectedItem) {\n * console.log('Selected option:', selectedItem.textContent);\n * }\n * ```\n */\n get selectedItem(): UiOption | null {\n return this.selectedOption\n }\n\n /**\n * Returns the text content that should be displayed in the select field.\n * This is the rendered value of the currently selected option.\n *\n * @readonly\n * @example\n * ```javascript\n * const select = document.querySelector('ui-select');\n * console.log('Display text:', select.renderValue);\n * ```\n */\n get renderValue(): string {\n const item = this.selectedOption\n return item ? item.renderValue : ''\n }\n\n /**\n * Returns the form element that contains this select, if any.\n * Part of the form-associated custom element API.\n *\n * @readonly\n */\n get form(): HTMLFormElement | null {\n return this.#internals.form\n }\n\n /**\n * Returns the validity state of the select element.\n * Part of the form-associated custom element API.\n *\n * @readonly\n */\n get validity(): ValidityState {\n return this.#internals.validity\n }\n\n /**\n * Returns the validation message for the select element.\n * Part of the form-associated custom element API.\n *\n * @readonly\n */\n get validationMessage(): string {\n return this.#internals.validationMessage\n }\n\n /**\n * Returns whether the select element will be validated when the form is submitted.\n * Part of the form-associated custom element API.\n *\n * @readonly\n */\n get willValidate(): boolean {\n return this.#internals.willValidate\n }\n\n /**\n * Checks the validity of the select element and returns true if valid.\n * Part of the form-associated custom element API.\n *\n * @returns {boolean} True if the element is valid, false otherwise\n * @example\n * ```javascript\n * const select = document.querySelector('ui-select');\n * if (!select.checkValidity()) {\n * console.log('Select is invalid:', select.validationMessage);\n * }\n * ```\n */\n checkValidity(): boolean {\n return this.#internals.checkValidity()\n }\n\n constructor() {\n super()\n this.addEventListener('click', this.handleClick.bind(this))\n this.addEventListener('blur', this.handleBlur.bind(this))\n this.addEventListener('keydown', this.handleKeydown.bind(this))\n }\n\n override connectedCallback(): void {\n super.connectedCallback()\n this.setAttribute('role', 'combobox')\n this.setAttribute('aria-haspopup', 'listbox')\n this.setAttribute('aria-controls', 'menu')\n if (!this.disabled) {\n this.setAttribute('tabindex', '0')\n }\n }\n\n /**\n * Resets the select to its initial state. Called automatically when the parent\n * form is reset. Part of the form-associated custom element API.\n *\n * @example\n * ```javascript\n * const select = document.querySelector('ui-select');\n * select.formResetCallback(); // Clears the selection\n * ```\n */\n formResetCallback(): void {\n this.value = undefined\n }\n\n /**\n * Restores the select's state from saved form data. Called automatically when\n * the browser restores form state. Part of the form-associated custom element API.\n *\n * @param {string | null} state - The saved state to restore\n */\n formStateRestoreCallback(state: string | null): void {\n this.value = state ?? undefined\n }\n\n /**\n * Validates the select element and updates its validity state. This is called\n * automatically during property changes, but can be called manually to trigger validation.\n *\n * @example\n * ```javascript\n * const select = document.querySelector('ui-select');\n * select.validate();\n * if (select.invalid) {\n * console.log('Validation failed:', select.invalidText);\n * }\n * ```\n */\n validate(): void {\n let message = ''\n if (this.required && !this.value) {\n message = 'Please select an item.'\n this.#internals.setValidity({ valueMissing: true }, message)\n } else {\n this.#internals.setValidity({})\n }\n this.invalid = !this.#internals.validity.valid\n this.invalidText = message\n }\n\n protected override willUpdate(changedProperties: PropertyValues<this>): void {\n super.willUpdate(changedProperties)\n if (changedProperties.has('disabled')) {\n setDisabled(this, this.disabled)\n }\n if (changedProperties.has('open')) {\n this.handleOpenChange()\n }\n if (changedProperties.has('value')) {\n this.setCurrentOption()\n this.#internals.setFormValue(this.value ?? null)\n this.validate()\n }\n if (changedProperties.has('label')) {\n if (this.label) {\n this.setAttribute('aria-label', this.label)\n } else {\n this.removeAttribute('aria-label')\n }\n }\n }\n\n protected async setCurrentOption(): Promise<void> {\n await this.updateComplete\n if (this.value) {\n const options = this.querySelectorAll<UiOption>('ui-option')\n this.selectedOption = Array.from(options).find((option) => option.value === this.value) || null\n } else {\n this.selectedOption = null\n }\n }\n\n protected handleKeydown(e: KeyboardEvent): void {\n if (this.disabled || e.defaultPrevented) return\n if (this.open) {\n switch (e.key) {\n case 'Tab': {\n // If menu is open and Tab is pressed, close it and allow normal tab navigation\n if (this.open) {\n this.open = false\n }\n break\n }\n case 'Escape': {\n if (this.open) {\n e.preventDefault()\n this.open = false\n this.focus() // Return focus to the select element\n }\n break\n }\n case 'ArrowDown':\n e.preventDefault()\n this.menu.highlightNext()\n return\n case 'ArrowUp':\n e.preventDefault()\n this.menu.highlightPrevious()\n return\n case 'Home':\n e.preventDefault()\n this.menu.highlightFirst()\n return\n case 'End':\n e.preventDefault()\n this.menu.highlightLast()\n return\n case 'Enter':\n case ' ':\n if (this.menu.highlightListItem) {\n e.preventDefault()\n this.menu.notifySelect(this.menu.highlightListItem as UiOption)\n }\n return\n }\n } else {\n switch (e.key) {\n case 'Enter':\n case ' ': {\n if (!this.open) {\n e.preventDefault()\n this.open = true\n }\n break\n }\n case 'ArrowDown':\n case 'ArrowUp': {\n if (!this.open) {\n e.preventDefault()\n this.open = true\n }\n // If menu is open, let the menu handle arrow keys\n break\n }\n }\n }\n }\n\n protected handleBlur(e: FocusEvent): void {\n if (this.disabled) return\n\n // Check if focus is moving to the menu or one of its children\n const relatedTarget = e.relatedTarget as HTMLElement\n\n if (relatedTarget && this.contains(relatedTarget)) {\n // Focus is moving to the menu, keep it open\n return\n }\n\n // Close the menu when focus leaves the component\n this.open = false\n }\n\n protected handleClick(e: Event): void {\n if (this.disabled || e.defaultPrevented) return\n e.preventDefault()\n e.stopPropagation()\n this.open = true\n }\n\n protected async handleOpenChange(): Promise<void> {\n const menu = this.menu\n if (!menu) {\n // The status can be set before the menu is rendered\n return\n }\n this.setAttribute('aria-expanded', String(this.open))\n if (this.open) {\n menu.showPopover()\n // menu.focus()\n if (this.selectedOption) {\n this.menu.highlightItem(this.selectedOption)\n } else {\n this.menu.highlightFirst()\n }\n this.dispatchEvent(new CustomEvent('open', { bubbles: false, composed: true }))\n this.focus()\n } else {\n menu.hidePopover()\n this.dispatchEvent(new CustomEvent('close', { bubbles: false, composed: true }))\n }\n }\n\n handleSelect(e: CustomEvent<{ item: UiOption }>): void {\n e.stopPropagation()\n const item = e.detail.item\n this.selectedOption = item\n this.#value = item.value\n this.open = false\n\n // Dispatch change event\n const changeEvent = new CustomEvent<UiSelectChangeEvent>('change', {\n detail: { value: this.value, item: item },\n bubbles: false,\n composed: true,\n })\n this.dispatchEvent(changeEvent)\n this.focus()\n }\n\n handleHighlightChange(e: CustomEvent<{ item: UiOption | null }>): void {\n this.ariaActiveDescendant = e.detail.item?.id\n }\n\n handleMenuClose(): void {\n this.open = false\n this.focus()\n }\n\n override render(): TemplateResult {\n const classes = classMap({\n 'ui-select': true,\n 'open': this.open,\n 'disabled': this.disabled,\n })\n return html`${this.renderFocusRing()}\n <div class=\"${classes}\" aria-activedescendant=${this.ariaActiveDescendant || ''}>\n ${this.renderInput()} ${this.renderMenu()}\n </div> `\n }\n\n protected renderInput(): TemplateResult {\n return html`<ui-outlined-text-field\n .name=${this.name}\n .label=${this.label}\n .value=${this.renderValue}\n .disabled=${this.disabled}\n .required=${this.required}\n readonly\n tabindex=\"-1\"\n inert\n aria-hidden=\"true\"\n .invalid=${this.invalid}\n .invalidText=${this.invalidText || ''}\n class=\"input\"\n >\n <ui-icon slot=\"suffix\">arrow_drop_down</ui-icon>\n </ui-outlined-text-field>`\n }\n\n protected renderMenu(): TemplateResult {\n return html`<ui-menu\n id=\"menu\"\n class=\"menu\"\n popover=\"auto\"\n selector=\"ui-option\"\n @select=\"${this.handleSelect}\"\n @close=\"${this.handleMenuClose}\"\n @highlightchange=\"${this.handleHighlightChange}\"\n >\n <slot></slot>\n </ui-menu>`\n }\n\n protected renderFocusRing(): TemplateResult {\n return html`<md-focus-ring part=\"focus-ring\" class=\"focus-ring\" .control=\"${this as HTMLElement}\"></md-focus-ring>`\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../../../src/md/select/internals/Select.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAkC,MAAM,KAAK,CAAA;AACtE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA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W,IAAI,EAAE;wBACnB,IAAI,CAAC,cAAc,IAAI,EAAE;;;;8BAInB,CAAA;QAC5B,CAAC;QAES,UAAU;YAClB,OAAO,IAAI,CAAA;;;;;iBAKE,IAAI,CAAC,YAAY;gBAClB,IAAI,CAAC,eAAe;0BACV,IAAI,CAAC,qBAAqB;;;eAGrC,CAAA;QACb,CAAC;QAES,eAAe;YACvB,OAAO,IAAI,CAAA,iEAAiE,IAAmB,oBAAoB,CAAA;QACrH,CAAC;;;AA/gBH;;;;;;;GAOG;AACH","sourcesContent":["import { html, LitElement, PropertyValues, TemplateResult } from 'lit'\nimport { property, query, state } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { setDisabled } from '../../../lib/disabled.js'\nimport type UiOption from './Option.js'\nimport type { UiMenuElement } from '../../menu/ui-menu.js'\n\nimport '../../text-field/ui-outlined-text-field.js'\nimport '../../menu/ui-menu.js'\nimport '../../icons/ui-icon.js'\nimport '@material/web/focus/md-focus-ring.js'\n\nexport interface UiSelectChangeEvent {\n value: string | undefined\n item: UiOption | null\n}\n\n/**\n * Material Design 3 Select component that behaves like an outlined text field with dropdown.\n *\n * @fires change - Dispatched when the selection changes. The event is non-bubbling and non-cancelable.\n * The `event.detail` object contains the `value` and `item` properties.\n * @fires open - Dispatched when the dropdown opens\n * @fires close - Dispatched when the dropdown closes\n */\nexport default class UiSelect extends LitElement {\n static readonly formAssociated = true\n #internals = this.attachInternals()\n\n /**\n * The value has a private member so that we can set the value without triggering\n * the side effects.\n */\n #value: string | undefined\n\n /**\n * The currently selected value. Corresponds to the `value` attribute of the selected `ui-option`.\n * When set programmatically, it will update the selected option if a matching option exists.\n *\n * @attribute\n * @example\n * ```html\n * <ui-select value=\"apple\">\n * <ui-option value=\"apple\">Apple</ui-option>\n * <ui-option value=\"banana\">Banana</ui-option>\n * </ui-select>\n * ```\n */\n get value(): string | undefined {\n return this.#value\n }\n\n @property({ type: String })\n set value(newValue: string | undefined) {\n const oldValue = this.#value\n if (newValue === oldValue) return\n this.#value = newValue\n this.requestUpdate()\n }\n\n /**\n * The name attribute for form submission. This value will be used as the key\n * when the form is submitted.\n *\n * @attribute\n * @example\n * ```html\n * <ui-select name=\"country\" value=\"us\">\n * <ui-option value=\"us\">United States</ui-option>\n * </ui-select>\n * ```\n */\n @property({ type: String }) accessor name: string | undefined\n\n /**\n * The label text displayed in the select field. Provides accessible labeling\n * and is shown as the floating label in the outlined text field.\n *\n * @attribute\n * @example\n * ```html\n * <ui-select label=\"Select a country\">\n * <ui-option value=\"us\">United States</ui-option>\n * </ui-select>\n * ```\n */\n @property({ type: String }) accessor label: string | undefined\n\n /**\n * Whether the select is required for form validation. When true, the select\n * must have a value selected for the form to be valid.\n *\n * @attribute\n * @example\n * ```html\n * <ui-select required label=\"Required field\">\n * <ui-option value=\"option1\">Option 1</ui-option>\n * </ui-select>\n * ```\n */\n @property({ type: Boolean }) accessor required = false\n\n /**\n * Whether the select is in an invalid state. This is typically set automatically\n * during validation, but can be set manually to indicate validation errors.\n *\n * @attribute\n * @example\n * ```html\n * <ui-select invalid invalidText=\"Please select a valid option\">\n * <ui-option value=\"option1\">Option 1</ui-option>\n * </ui-select>\n * ```\n */\n @property({ type: Boolean }) accessor invalid: boolean | undefined\n\n /**\n * The error message to display when the select is invalid. This text is shown\n * below the select field when `invalid` is true.\n *\n * @attribute\n * @example\n * ```html\n * <ui-select invalid invalidText=\"This field is required\">\n * <ui-option value=\"option1\">Option 1</ui-option>\n * </ui-select>\n * ```\n */\n @property({ type: String }) accessor invalidText: string | undefined\n\n /**\n * @attribute\n */\n @property({ type: String }) accessor supportingText: string | undefined\n\n /**\n * Whether the select is disabled. When disabled, the select cannot be interacted\n * with and will not receive focus or respond to user input.\n *\n * @default false\n * @attribute\n * @example\n * ```html\n * <ui-select disabled label=\"Disabled select\">\n * <ui-option value=\"option1\">Option 1</ui-option>\n * </ui-select>\n * ```\n */\n @property({ type: Boolean, reflect: true }) accessor disabled = false\n\n /**\n * Whether the dropdown menu is currently open. This property reflects the\n * current state of the dropdown and can be set programmatically to open/close it.\n *\n * @default false\n * @example\n * ```javascript\n * // Open the dropdown programmatically\n * selectElement.open = true;\n *\n * // Close the dropdown\n * selectElement.open = false;\n * ```\n */\n @property({ type: Boolean, reflect: true }) accessor open = false\n\n @state() accessor selectedOption: UiOption | null = null\n @state() accessor ariaActiveDescendant: string | undefined\n @query('.menu') accessor menu!: UiMenuElement\n\n /**\n * Returns the currently selected option element. This provides access to the\n * full `ui-option` element, not just its value.\n *\n * @readonly\n * @example\n * ```javascript\n * const select = document.querySelector('ui-select');\n * const selectedItem = select.selectedItem;\n * if (selectedItem) {\n * console.log('Selected option:', selectedItem.textContent);\n * }\n * ```\n */\n get selectedItem(): UiOption | null {\n return this.selectedOption\n }\n\n /**\n * Returns the text content that should be displayed in the select field.\n * This is the rendered value of the currently selected option.\n *\n * @readonly\n * @example\n * ```javascript\n * const select = document.querySelector('ui-select');\n * console.log('Display text:', select.renderValue);\n * ```\n */\n get renderValue(): string {\n const item = this.selectedOption\n return item ? item.renderValue : ''\n }\n\n /**\n * Returns the form element that contains this select, if any.\n * Part of the form-associated custom element API.\n *\n * @readonly\n */\n get form(): HTMLFormElement | null {\n return this.#internals.form\n }\n\n /**\n * Returns the validity state of the select element.\n * Part of the form-associated custom element API.\n *\n * @readonly\n */\n get validity(): ValidityState {\n return this.#internals.validity\n }\n\n /**\n * Returns the validation message for the select element.\n * Part of the form-associated custom element API.\n *\n * @readonly\n */\n get validationMessage(): string {\n return this.#internals.validationMessage\n }\n\n /**\n * Returns whether the select element will be validated when the form is submitted.\n * Part of the form-associated custom element API.\n *\n * @readonly\n */\n get willValidate(): boolean {\n return this.#internals.willValidate\n }\n\n /**\n * Checks the validity of the select element and returns true if valid.\n * Part of the form-associated custom element API.\n *\n * @returns {boolean} True if the element is valid, false otherwise\n * @example\n * ```javascript\n * const select = document.querySelector('ui-select');\n * if (!select.checkValidity()) {\n * console.log('Select is invalid:', select.validationMessage);\n * }\n * ```\n */\n checkValidity(): boolean {\n return this.#internals.checkValidity()\n }\n\n constructor() {\n super()\n this.addEventListener('click', this.handleClick.bind(this))\n this.addEventListener('blur', this.handleBlur.bind(this))\n this.addEventListener('keydown', this.handleKeydown.bind(this))\n }\n\n override connectedCallback(): void {\n super.connectedCallback()\n this.setAttribute('role', 'combobox')\n this.setAttribute('aria-haspopup', 'listbox')\n this.setAttribute('aria-controls', 'menu')\n if (!this.disabled) {\n this.setAttribute('tabindex', '0')\n }\n }\n\n /**\n * Resets the select to its initial state. Called automatically when the parent\n * form is reset. Part of the form-associated custom element API.\n *\n * @example\n * ```javascript\n * const select = document.querySelector('ui-select');\n * select.formResetCallback(); // Clears the selection\n * ```\n */\n formResetCallback(): void {\n this.value = undefined\n }\n\n /**\n * Restores the select's state from saved form data. Called automatically when\n * the browser restores form state. Part of the form-associated custom element API.\n *\n * @param {string | null} state - The saved state to restore\n */\n formStateRestoreCallback(state: string | null): void {\n this.value = state ?? undefined\n }\n\n /**\n * Validates the select element and updates its validity state. This is called\n * automatically during property changes, but can be called manually to trigger validation.\n *\n * @example\n * ```javascript\n * const select = document.querySelector('ui-select');\n * select.validate();\n * if (select.invalid) {\n * console.log('Validation failed:', select.invalidText);\n * }\n * ```\n */\n validate(): void {\n let message = ''\n if (this.required && !this.value) {\n message = 'Please select an item.'\n this.#internals.setValidity({ valueMissing: true }, message)\n } else {\n this.#internals.setValidity({})\n }\n this.invalid = !this.#internals.validity.valid\n this.invalidText = message\n }\n\n protected override willUpdate(changedProperties: PropertyValues<this>): void {\n super.willUpdate(changedProperties)\n if (changedProperties.has('disabled')) {\n setDisabled(this, this.disabled)\n }\n if (changedProperties.has('open')) {\n this.handleOpenChange()\n }\n if (changedProperties.has('value')) {\n this.setCurrentOption()\n this.#internals.setFormValue(this.value ?? null)\n this.validate()\n }\n if (changedProperties.has('label')) {\n if (this.label) {\n this.setAttribute('aria-label', this.label)\n } else {\n this.removeAttribute('aria-label')\n }\n }\n }\n\n protected async setCurrentOption(): Promise<void> {\n await this.updateComplete\n if (this.value) {\n const options = this.querySelectorAll<UiOption>('ui-option')\n this.selectedOption = Array.from(options).find((option) => option.value === this.value) || null\n } else {\n this.selectedOption = null\n }\n }\n\n protected handleKeydown(e: KeyboardEvent): void {\n if (this.disabled || e.defaultPrevented) return\n if (this.open) {\n switch (e.key) {\n case 'Tab': {\n // If menu is open and Tab is pressed, close it and allow normal tab navigation\n if (this.open) {\n this.open = false\n }\n break\n }\n case 'Escape': {\n if (this.open) {\n e.preventDefault()\n this.open = false\n this.focus() // Return focus to the select element\n }\n break\n }\n case 'ArrowDown':\n e.preventDefault()\n this.menu.highlightNext()\n return\n case 'ArrowUp':\n e.preventDefault()\n this.menu.highlightPrevious()\n return\n case 'Home':\n e.preventDefault()\n this.menu.highlightFirst()\n return\n case 'End':\n e.preventDefault()\n this.menu.highlightLast()\n return\n case 'Enter':\n case ' ':\n if (this.menu.highlightListItem) {\n e.preventDefault()\n this.menu.notifySelect(this.menu.highlightListItem as UiOption)\n }\n return\n }\n } else {\n switch (e.key) {\n case 'Enter':\n case ' ': {\n if (!this.open) {\n e.preventDefault()\n this.open = true\n }\n break\n }\n case 'ArrowDown':\n case 'ArrowUp': {\n if (!this.open) {\n e.preventDefault()\n this.open = true\n }\n // If menu is open, let the menu handle arrow keys\n break\n }\n }\n }\n }\n\n protected handleBlur(e: FocusEvent): void {\n if (this.disabled) return\n\n // Check if focus is moving to the menu or one of its children\n const relatedTarget = e.relatedTarget as HTMLElement\n\n if (relatedTarget && this.contains(relatedTarget)) {\n // Focus is moving to the menu, keep it open\n return\n }\n\n // Close the menu when focus leaves the component\n this.open = false\n }\n\n protected handleClick(e: Event): void {\n if (this.disabled || e.defaultPrevented) return\n e.preventDefault()\n e.stopPropagation()\n this.open = true\n }\n\n protected async handleOpenChange(): Promise<void> {\n const menu = this.menu\n if (!menu) {\n // The status can be set before the menu is rendered\n return\n }\n this.setAttribute('aria-expanded', String(this.open))\n if (this.open) {\n menu.showPopover()\n // menu.focus()\n if (this.selectedOption) {\n this.menu.highlightItem(this.selectedOption)\n } else {\n this.menu.highlightFirst()\n }\n this.dispatchEvent(new CustomEvent('open', { bubbles: false, composed: true }))\n this.focus()\n } else {\n menu.hidePopover()\n this.dispatchEvent(new CustomEvent('close', { bubbles: false, composed: true }))\n }\n }\n\n handleSelect(e: CustomEvent<{ item: UiOption }>): void {\n e.stopPropagation()\n const item = e.detail.item\n this.selectedOption = item\n this.#value = item.value\n this.open = false\n\n // Dispatch change event\n const changeEvent = new CustomEvent<UiSelectChangeEvent>('change', {\n detail: { value: this.value, item: item },\n bubbles: false,\n composed: true,\n })\n this.dispatchEvent(changeEvent)\n this.focus()\n }\n\n handleHighlightChange(e: CustomEvent<{ item: UiOption | null }>): void {\n this.ariaActiveDescendant = e.detail.item?.id\n }\n\n handleMenuClose(): void {\n this.open = false\n this.focus()\n }\n\n override render(): TemplateResult {\n const classes = classMap({\n 'ui-select': true,\n 'open': this.open,\n 'disabled': this.disabled,\n })\n return html`${this.renderFocusRing()}\n <div class=\"${classes}\" aria-activedescendant=${this.ariaActiveDescendant || ''}>\n ${this.renderInput()} ${this.renderMenu()}\n </div> `\n }\n\n protected renderInput(): TemplateResult {\n return html`<ui-outlined-text-field\n .name=${this.name}\n .label=${this.label}\n .value=${this.renderValue}\n .disabled=${this.disabled}\n .required=${this.required}\n readonly\n tabindex=\"-1\"\n inert\n aria-hidden=\"true\"\n .invalid=${this.invalid}\n .invalidText=${this.invalidText || ''}\n .supportingText=${this.supportingText || ''}\n class=\"input\"\n >\n <ui-icon slot=\"suffix\">arrow_drop_down</ui-icon>\n </ui-outlined-text-field>`\n }\n\n protected renderMenu(): TemplateResult {\n return html`<ui-menu\n id=\"menu\"\n class=\"menu\"\n popover=\"auto\"\n selector=\"ui-option\"\n @select=\"${this.handleSelect}\"\n @close=\"${this.handleMenuClose}\"\n @highlightchange=\"${this.handleHighlightChange}\"\n >\n <slot></slot>\n </ui-menu>`\n }\n\n protected renderFocusRing(): TemplateResult {\n return html`<md-focus-ring part=\"focus-ring\" class=\"focus-ring\" .control=\"${this as HTMLElement}\"></md-focus-ring>`\n }\n}\n"]}
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap"
|
|
12
12
|
rel="stylesheet"
|
|
13
13
|
/>
|
|
14
|
+
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" rel="stylesheet" />
|
|
14
15
|
<link href="../../../src/styles/m3/tokens.css" rel="stylesheet" type="text/css" />
|
|
15
16
|
<link href="../../../src/styles/m3/theme.css" rel="stylesheet" type="text/css" />
|
|
16
17
|
<link href="../../page.css" rel="stylesheet" type="text/css" />
|
|
@@ -67,7 +68,6 @@
|
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
.demo-controls currency-picker {
|
|
70
|
-
flex: 1;
|
|
71
71
|
min-width: 200px;
|
|
72
72
|
}
|
|
73
73
|
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
.demo-controls {
|
|
76
76
|
flex-direction: column;
|
|
77
77
|
}
|
|
78
|
-
|
|
78
|
+
|
|
79
79
|
.demo-controls currency-picker {
|
|
80
80
|
min-width: unset;
|
|
81
81
|
}
|
|
@@ -102,6 +102,25 @@ class ComponentDemoPage extends DemoPage {
|
|
|
102
102
|
<ui-icon slot="icon">drafts</ui-icon>
|
|
103
103
|
</ui-navigation-item>
|
|
104
104
|
</div>
|
|
105
|
+
|
|
106
|
+
<div class="nav-rail wide">
|
|
107
|
+
<ui-navigation-item selected>
|
|
108
|
+
<ui-icon slot="icon">inbox</ui-icon>
|
|
109
|
+
Inbox
|
|
110
|
+
</ui-navigation-item>
|
|
111
|
+
<ui-navigation-item>
|
|
112
|
+
<ui-icon slot="icon">star</ui-icon>
|
|
113
|
+
Starred
|
|
114
|
+
</ui-navigation-item>
|
|
115
|
+
<ui-navigation-item>
|
|
116
|
+
<ui-icon slot="icon">send</ui-icon>
|
|
117
|
+
Sent
|
|
118
|
+
</ui-navigation-item>
|
|
119
|
+
<ui-navigation-item disabled>
|
|
120
|
+
<ui-icon slot="icon">drafts</ui-icon>
|
|
121
|
+
Drafts
|
|
122
|
+
</ui-navigation-item>
|
|
123
|
+
</div>
|
|
105
124
|
</div>
|
|
106
125
|
</section>
|
|
107
126
|
`
|
package/demo/md/list/list.ts
CHANGED
|
@@ -59,18 +59,18 @@ class ComponentDemoPage extends DemoPage {
|
|
|
59
59
|
|
|
60
60
|
<h3 class="title-medium">List example</h3>
|
|
61
61
|
<div class="demo-row">
|
|
62
|
-
<ui-list>
|
|
62
|
+
<ui-list selectActive>
|
|
63
63
|
<ui-list-item image="avatar">
|
|
64
64
|
<span slot="start" class="avatar">PUP</span>
|
|
65
65
|
Pawel Uchida-Psztyc
|
|
66
66
|
<ui-checkbox slot="end"></ui-checkbox>
|
|
67
67
|
</ui-list-item>
|
|
68
|
-
<ui-list-item image="avatar"
|
|
68
|
+
<ui-list-item image="avatar">
|
|
69
69
|
<span slot="start" class="avatar">PUP</span>
|
|
70
70
|
Highlighted item
|
|
71
71
|
<ui-checkbox slot="end"></ui-checkbox>
|
|
72
72
|
</ui-list-item>
|
|
73
|
-
<ui-list-item image="avatar"
|
|
73
|
+
<ui-list-item image="avatar">
|
|
74
74
|
<span slot="start" class="avatar">PUP</span>
|
|
75
75
|
Selected item
|
|
76
76
|
<ui-checkbox slot="end"></ui-checkbox>
|
|
@@ -188,6 +188,12 @@ class ComponentDemoPage extends DemoPage {
|
|
|
188
188
|
@pointerdown="${EventUtils.cancelEvent}"
|
|
189
189
|
></ui-checkbox>
|
|
190
190
|
</ui-list-item>
|
|
191
|
+
</ui-list-item>
|
|
192
|
+
|
|
193
|
+
<ui-list-item static>
|
|
194
|
+
2000,00
|
|
195
|
+
<span slot="end-text">PLN</span>
|
|
196
|
+
</ui-list-item>
|
|
191
197
|
</div>
|
|
192
198
|
</section>
|
|
193
199
|
`
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { html, TemplateResult } from 'lit'
|
|
3
3
|
import { DemoPage } from '../../../src/demo/DemoPage.js'
|
|
4
4
|
import '../../../src/md/progress/ui-progress.js'
|
|
5
|
+
import '../../../src/md/progress/ui-circular-progress.js'
|
|
5
6
|
import '../../../src/md/button/ui-button.js'
|
|
6
7
|
|
|
7
8
|
class ComponentDemoPage extends DemoPage {
|
|
@@ -46,7 +47,7 @@ class ComponentDemoPage extends DemoPage {
|
|
|
46
47
|
return html`
|
|
47
48
|
<a href="../">Back</a>
|
|
48
49
|
${this.imperativeTemplate()} ${this.indeterminateTemplate()} ${this.styledTemplate()} ${this.disabledTemplate()}
|
|
49
|
-
${this.secondaryTemplate()}
|
|
50
|
+
${this.secondaryTemplate()} ${this.circularProgressTemplate()} ${this.circularProgressIndeterminateTemplate()}
|
|
50
51
|
`
|
|
51
52
|
}
|
|
52
53
|
|
|
@@ -132,6 +133,28 @@ class ComponentDemoPage extends DemoPage {
|
|
|
132
133
|
</section>
|
|
133
134
|
`
|
|
134
135
|
}
|
|
136
|
+
|
|
137
|
+
circularProgressTemplate(): TemplateResult {
|
|
138
|
+
return html`
|
|
139
|
+
<section class="demo-section">
|
|
140
|
+
<h2 class="title-large">Circular Progress</h2>
|
|
141
|
+
<div class="demo-row">
|
|
142
|
+
<ui-circular-progress value="40" max="100" aria-label="Circular progress"></ui-circular-progress>
|
|
143
|
+
</div>
|
|
144
|
+
</section>
|
|
145
|
+
`
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
circularProgressIndeterminateTemplate(): TemplateResult {
|
|
149
|
+
return html`
|
|
150
|
+
<section class="demo-section">
|
|
151
|
+
<h2 class="title-large">Circular Indeterminate Progress</h2>
|
|
152
|
+
<div class="demo-row">
|
|
153
|
+
<ui-circular-progress indeterminate aria-label="Circular indeterminate progress"></ui-circular-progress>
|
|
154
|
+
</div>
|
|
155
|
+
</section>
|
|
156
|
+
`
|
|
157
|
+
}
|
|
135
158
|
}
|
|
136
159
|
|
|
137
160
|
const instance = new ComponentDemoPage()
|
package/demo/md/select/index.ts
CHANGED
|
@@ -134,6 +134,7 @@ class ComponentDemoPage extends DemoPage {
|
|
|
134
134
|
handleBasicSelectChange(e: CustomEvent): void {
|
|
135
135
|
const { value } = e.detail
|
|
136
136
|
this.basicSelected = value
|
|
137
|
+
console.log(`Basic select changed: ${value}`)
|
|
137
138
|
const resultElement = document.querySelector('#basic-result')
|
|
138
139
|
if (resultElement) {
|
|
139
140
|
resultElement.textContent = value || 'None'
|
|
@@ -143,6 +144,7 @@ class ComponentDemoPage extends DemoPage {
|
|
|
143
144
|
handleIconSelectChange(e: CustomEvent): void {
|
|
144
145
|
const { value } = e.detail
|
|
145
146
|
this.iconSelected = value
|
|
147
|
+
console.log(`Icon select changed: ${value}`)
|
|
146
148
|
const resultElement = document.querySelector('#icon-result')
|
|
147
149
|
if (resultElement) {
|
|
148
150
|
resultElement.textContent = value || 'None'
|
|
@@ -152,6 +154,7 @@ class ComponentDemoPage extends DemoPage {
|
|
|
152
154
|
handleSupportingSelectChange(e: CustomEvent): void {
|
|
153
155
|
const { value } = e.detail
|
|
154
156
|
this.supportingSelected = value
|
|
157
|
+
console.log(`Supporting select changed: ${value}`)
|
|
155
158
|
const resultElement = document.querySelector('#supporting-result')
|
|
156
159
|
if (resultElement) {
|
|
157
160
|
resultElement.textContent = value || 'None'
|
|
@@ -161,6 +164,7 @@ class ComponentDemoPage extends DemoPage {
|
|
|
161
164
|
handleNoIconSelectChange(e: CustomEvent): void {
|
|
162
165
|
const { value } = e.detail
|
|
163
166
|
this.noIconSelected = value
|
|
167
|
+
console.log(`No icon select changed: ${value}`)
|
|
164
168
|
const resultElement = document.querySelector('#no-icon-result')
|
|
165
169
|
if (resultElement) {
|
|
166
170
|
resultElement.textContent = value || 'None'
|
|
@@ -170,6 +174,7 @@ class ComponentDemoPage extends DemoPage {
|
|
|
170
174
|
handleProgrammaticSelectChange(e: CustomEvent): void {
|
|
171
175
|
const { value } = e.detail
|
|
172
176
|
this.programmaticSelected = value
|
|
177
|
+
console.log(`Programmatic select changed: ${value}`)
|
|
173
178
|
const resultElement = document.querySelector('#programmatic-result')
|
|
174
179
|
if (resultElement) {
|
|
175
180
|
resultElement.textContent = value || 'None'
|
package/demo/md/tabs/tabs.ts
CHANGED
|
@@ -7,10 +7,6 @@ import { iconWrapper } from '../../../src/md/icons/Icons.js'
|
|
|
7
7
|
import { reactive } from '../../../src/decorators/index.js'
|
|
8
8
|
import { TabSelectionDetail } from '../../../src/md/tabs/internals/Tabs.js'
|
|
9
9
|
|
|
10
|
-
import '@material/web/tabs/primary-tab.js'
|
|
11
|
-
import '@material/web/tabs/secondary-tab.js'
|
|
12
|
-
import '@material/web/tabs/tabs.js'
|
|
13
|
-
|
|
14
10
|
const travelIcon = iconWrapper(
|
|
15
11
|
svg`<path d="M8.5 22v-1.5l2-1.5v-5.5L2 16v-2l8.5-5V3.5q0-.625.438-1.062Q11.375 2 12 2t1.062.438q.438.437.438 1.062V9l8.5 5v2l-8.5-2.5V19l2 1.5V22L12 21Z"/>`
|
|
16
12
|
)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LitElement, TemplateResult, html, nothing } from 'lit'
|
|
2
2
|
import { property } from 'lit/decorators.js'
|
|
3
|
-
import '@material/web/iconbutton/icon-button.js'
|
|
4
3
|
import '../../../md/icons/ui-icon.js'
|
|
4
|
+
import '../../../md/icon-button/ui-icon-button.js'
|
|
5
5
|
|
|
6
6
|
export default class AppBar extends LitElement {
|
|
7
7
|
/**
|
|
@@ -31,9 +31,9 @@ export default class AppBar extends LitElement {
|
|
|
31
31
|
return nothing
|
|
32
32
|
}
|
|
33
33
|
return html`
|
|
34
|
-
<
|
|
34
|
+
<ui-icon-button class="back-button">
|
|
35
35
|
<ui-icon icon="arrowBack"></ui-icon>
|
|
36
|
-
</
|
|
36
|
+
</ui-icon-button>
|
|
37
37
|
`
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -43,9 +43,9 @@ export default class AppBar extends LitElement {
|
|
|
43
43
|
return nothing
|
|
44
44
|
}
|
|
45
45
|
return html`
|
|
46
|
-
<
|
|
46
|
+
<ui-icon-button class="menu-button">
|
|
47
47
|
<ui-icon icon="menu"></ui-icon>
|
|
48
|
-
</
|
|
48
|
+
</ui-icon-button>
|
|
49
49
|
`
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { LitElement, html, type TemplateResult, type PropertyValues, nothing } from 'lit'
|
|
2
2
|
import { property, state, query } from 'lit/decorators.js'
|
|
3
3
|
import { repeat } from 'lit/directives/repeat.js'
|
|
4
|
+
import type { UiSelectChangeEvent, UiSelectElement } from '../../../md/select/ui-select.js'
|
|
4
5
|
|
|
5
|
-
import '@material/web/select/outlined-select.js'
|
|
6
|
-
import '@material/web/select/select-option.js'
|
|
7
6
|
import '../../../md/chip/ui-chip-set.js'
|
|
8
7
|
import '../../../md/chip/ui-chip.js'
|
|
8
|
+
import '../../../md/select/ui-select.js'
|
|
9
|
+
import '../../../md/select/ui-option.js'
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Represents a currency with all its display information.
|
|
@@ -184,8 +185,8 @@ export default class CurrencyPicker extends LitElement {
|
|
|
184
185
|
* Reference to the Material Design outlined select element.
|
|
185
186
|
* Used to manage the select's internal state and keep it synchronized with the component's selected property.
|
|
186
187
|
*/
|
|
187
|
-
@query('
|
|
188
|
-
private accessor selectElement!:
|
|
188
|
+
@query('ui-select')
|
|
189
|
+
private accessor selectElement!: UiSelectElement
|
|
189
190
|
|
|
190
191
|
/**
|
|
191
192
|
* Returns the form element that contains this component, if any.
|
|
@@ -525,9 +526,10 @@ export default class CurrencyPicker extends LitElement {
|
|
|
525
526
|
}
|
|
526
527
|
}
|
|
527
528
|
|
|
528
|
-
private handleCurrencySelect(event:
|
|
529
|
+
private handleCurrencySelect(event: CustomEvent<UiSelectChangeEvent>) {
|
|
530
|
+
event.stopPropagation()
|
|
529
531
|
try {
|
|
530
|
-
const select = event.target as
|
|
532
|
+
const select = event.target as UiSelectElement
|
|
531
533
|
const selectedCode = select.value
|
|
532
534
|
|
|
533
535
|
if (!selectedCode) return
|
|
@@ -626,7 +628,6 @@ export default class CurrencyPicker extends LitElement {
|
|
|
626
628
|
|
|
627
629
|
// Update form value using ElementInternals
|
|
628
630
|
this.updateFormValue()
|
|
629
|
-
|
|
630
631
|
this.dispatchEvent(
|
|
631
632
|
new CustomEvent('change', {
|
|
632
633
|
detail: {
|
|
@@ -760,7 +761,7 @@ export default class CurrencyPicker extends LitElement {
|
|
|
760
761
|
|
|
761
762
|
return html`
|
|
762
763
|
<div class="currency-picker" role="group" aria-label="${ariaLabel}">
|
|
763
|
-
<
|
|
764
|
+
<ui-select
|
|
764
765
|
label="${this.label}"
|
|
765
766
|
@change="${this.handleCurrencySelect}"
|
|
766
767
|
menuPositioning="popover"
|
|
@@ -771,23 +772,23 @@ export default class CurrencyPicker extends LitElement {
|
|
|
771
772
|
aria-describedby="${this.supportingText ? 'supporting-text' : ''}"
|
|
772
773
|
aria-invalid="${hasError ? 'true' : 'false'}"
|
|
773
774
|
>
|
|
774
|
-
<
|
|
775
|
-
<div
|
|
776
|
-
</
|
|
775
|
+
<ui-option value="">
|
|
776
|
+
<div>Select a currency...</div>
|
|
777
|
+
</ui-option>
|
|
777
778
|
${repeat(
|
|
778
779
|
this.selectableCurrencies,
|
|
779
780
|
(currency) => currency.code,
|
|
780
781
|
(currency) => html`
|
|
781
|
-
<
|
|
782
|
+
<ui-option value="${currency.code}">
|
|
782
783
|
<div slot="overline">${currency.country}</div>
|
|
783
784
|
<div slot="supporting-text">${currency.name}</div>
|
|
784
|
-
<div slot="
|
|
785
|
+
<div slot="end-text" class="currency-symbol">${currency.symbol}</div>
|
|
785
786
|
<div slot="start" class="flag">${currency.flag}</div>
|
|
786
|
-
<div
|
|
787
|
-
</
|
|
787
|
+
<div>${currency.code}</div>
|
|
788
|
+
</ui-option>
|
|
788
789
|
`
|
|
789
790
|
)}
|
|
790
|
-
</
|
|
791
|
+
</ui-select>
|
|
791
792
|
${this.renderSelected()}${this.renderError()}
|
|
792
793
|
</div>
|
|
793
794
|
`
|
|
@@ -7,10 +7,8 @@ import { ifDefined } from 'lit/directives/if-defined.js'
|
|
|
7
7
|
import { dataAttr } from '../../directives/data-attr.js'
|
|
8
8
|
import { LiveData } from '../../reactive/LiveData.js'
|
|
9
9
|
|
|
10
|
-
import '@material/web/icon/icon.js'
|
|
11
|
-
import '@material/web/menu/menu.js'
|
|
12
|
-
import '@material/web/menu/menu-item.js'
|
|
13
10
|
import '@material/web/focus/md-focus-ring.js'
|
|
11
|
+
import '../../md/icons/ui-icon.js'
|
|
14
12
|
|
|
15
13
|
/**
|
|
16
14
|
* Options for rendering a table cell.
|
|
@@ -1025,7 +1023,7 @@ export abstract class DataTable<T extends object> extends LitElement {
|
|
|
1025
1023
|
<md-focus-ring .inward="${this.overflow ? true : false}"></md-focus-ring>
|
|
1026
1024
|
<div class="cell-content">
|
|
1027
1025
|
${content}
|
|
1028
|
-
${isSortable && sortIcon ? html`<
|
|
1026
|
+
${isSortable && sortIcon ? html`<ui-icon class="sort-icon" role="presentation">${sortIcon}</ui-icon>` : nothing}
|
|
1029
1027
|
</div>
|
|
1030
1028
|
</th> `
|
|
1031
1029
|
}
|
|
@@ -4,9 +4,8 @@ import { LiveData } from '../../../reactive/LiveData.js'
|
|
|
4
4
|
import { type FileBreadcrumb } from '@api-client/core/models/store/File.js'
|
|
5
5
|
import { FolderKind } from '@api-client/core/models/kinds.js'
|
|
6
6
|
|
|
7
|
-
import '@material/web/iconbutton/icon-button.js'
|
|
8
|
-
import '@material/web/icon/icon.js'
|
|
9
7
|
import '@material/web/focus/md-focus-ring.js'
|
|
8
|
+
import '../../../md/icons/ui-icon.js'
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
11
|
* @fires navigate - Dispatched when a navigation item is activated.
|
|
@@ -141,6 +140,6 @@ export default class Breadcrumbs extends LitElement {
|
|
|
141
140
|
}
|
|
142
141
|
|
|
143
142
|
renderSeparator(): TemplateResult {
|
|
144
|
-
return html`<
|
|
143
|
+
return html`<ui-icon class="separator">chevron_right</ui-icon>`
|
|
145
144
|
}
|
|
146
145
|
}
|
|
@@ -44,7 +44,7 @@ export default class NavigationItem extends UiElement {
|
|
|
44
44
|
const { pressed = false } = this
|
|
45
45
|
const containerClasses = classMap({
|
|
46
46
|
'button': true,
|
|
47
|
-
'icon': this.hasIcon,
|
|
47
|
+
'with-icon': this.hasIcon,
|
|
48
48
|
'pressed': pressed,
|
|
49
49
|
'icon-only': this.iconOnly,
|
|
50
50
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { html, LitElement, PropertyValues, TemplateResult } from 'lit'
|
|
1
|
+
import { html, LitElement, type PropertyValues, type TemplateResult } from 'lit'
|
|
2
2
|
import { property, queryAssignedElements } from 'lit/decorators.js'
|
|
3
|
-
import UiListItem from './ListItem.js'
|
|
3
|
+
import type UiListItem from './ListItem.js'
|
|
4
4
|
|
|
5
5
|
const NAVIGATION_KEYS = {
|
|
6
6
|
ArrowDown: 'ArrowDown',
|
|
@@ -61,6 +61,7 @@ export default class UiList extends LitElement {
|
|
|
61
61
|
this.selector = 'ui-list-item'
|
|
62
62
|
this.addEventListener('keydown', this.handleKeydown.bind(this))
|
|
63
63
|
this.addEventListener('click', this.handleClick.bind(this))
|
|
64
|
+
this.addEventListener('focus', this.handleFocusEvent.bind(this))
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
override connectedCallback(): void {
|
|
@@ -71,12 +72,7 @@ export default class UiList extends LitElement {
|
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
override focus(options?: FocusOptions): void {
|
|
74
|
-
|
|
75
|
-
if (activeListItem) {
|
|
76
|
-
activeListItem.focus(options)
|
|
77
|
-
return
|
|
78
|
-
}
|
|
79
|
-
this.activateFirstItem()
|
|
75
|
+
this.handleFocus(options)
|
|
80
76
|
}
|
|
81
77
|
|
|
82
78
|
override firstUpdated(changedProperties: PropertyValues): void {
|
|
@@ -85,6 +81,21 @@ export default class UiList extends LitElement {
|
|
|
85
81
|
this.updateItems()
|
|
86
82
|
}
|
|
87
83
|
|
|
84
|
+
protected handleFocusEvent(event: FocusEvent): void {
|
|
85
|
+
if (event.target !== this) {
|
|
86
|
+
return
|
|
87
|
+
}
|
|
88
|
+
this.handleFocus()
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
protected handleFocus(options?: FocusOptions): void {
|
|
92
|
+
if (this.activeListItem) {
|
|
93
|
+
this.activeListItem.focus(options)
|
|
94
|
+
} else {
|
|
95
|
+
this.activateFirstItem()
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
88
99
|
activateFirstItem(): void {
|
|
89
100
|
this.activeListItem = this.getFirstItem()
|
|
90
101
|
this.activeListItem?.activate()
|