|
1 | 1 | import { UmbChangeEvent } from '@umbraco-cms/backoffice/event';
|
2 | 2 | import { css, html, customElement, query, state, property } from '@umbraco-cms/backoffice/external/lit';
|
3 |
| -import type { UUIComboboxElement, UUIComboboxEvent } from '@umbraco-cms/backoffice/external/uui'; |
| 3 | +import type { UUISelectEvent } from '@umbraco-cms/backoffice/external/uui'; |
4 | 4 | import { UUIFormControlMixin } from '@umbraco-cms/backoffice/external/uui';
|
5 | 5 | import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
|
6 | 6 | import type { ManifestLocalization } from '@umbraco-cms/backoffice/extension-registry';
|
@@ -59,24 +59,22 @@ export class UmbUiCultureInputElement extends UUIFormControlMixin(UmbLitElement,
|
59 | 59 | return this._selectElement;
|
60 | 60 | }
|
61 | 61 |
|
62 |
| - #onChange(event: UUIComboboxEvent) { |
63 |
| - event.stopPropagation(); |
64 |
| - const target = event.target as UUIComboboxElement; |
65 |
| - |
66 |
| - if (typeof target?.value === 'string') { |
67 |
| - this.value = target.value; |
68 |
| - this.dispatchEvent(new UmbChangeEvent()); |
69 |
| - } |
| 62 | + #onCustomValidationChange(event: UUISelectEvent) { |
| 63 | + this.value = event.target.value.toString(); |
| 64 | + this.dispatchEvent(new UmbChangeEvent()); |
70 | 65 | }
|
71 | 66 |
|
72 | 67 | override render() {
|
73 |
| - return html` <uui-combobox value="${this.value}" @change=${this.#onChange}> |
74 |
| - <uui-combobox-list> |
75 |
| - ${this._options.map( |
76 |
| - (option) => html`<uui-combobox-list-option value="${option.value}">${option.name}</uui-combobox-list-option>`, |
77 |
| - )} |
78 |
| - </uui-combobox-list> |
79 |
| - </uui-combobox>`; |
| 68 | + return html` |
| 69 | + <uui-select |
| 70 | + style="margin-top: var(--uui-size-space-1)" |
| 71 | + @change=${this.#onCustomValidationChange} |
| 72 | + .options=${this._options.map(e => ({ |
| 73 | + name: e.name, |
| 74 | + value: e.value, |
| 75 | + selected: e.value == this.value |
| 76 | + }))}></uui-select> |
| 77 | + `; |
80 | 78 | }
|
81 | 79 |
|
82 | 80 | static override styles = [
|
|
0 commit comments