dap-design-system 0.62.1 → 0.62.2
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/dist/components/combobox/comboboxBase.d.ts +6 -0
- package/dist/components/combobox/comboboxBase.js +79 -61
- package/dist/components/combobox/comboboxBase.js.map +1 -1
- package/dist/components/datatable/datatable.component.d.ts +2 -0
- package/dist/components/datatable/datatable.component.js +131 -112
- package/dist/components/datatable/datatable.component.js.map +1 -1
- package/dist/components/datatable/datatable.scss.js +1 -1
- package/dist/components/icon-button/icon-button.component.js +15 -12
- package/dist/components/icon-button/icon-button.component.js.map +1 -1
- package/dist/components/input/input-base-element.js +42 -38
- package/dist/components/input/input-base-element.js.map +1 -1
- package/dist/components/input/input.component.d.ts +1 -0
- package/dist/components/input/input.component.js.map +1 -1
- package/dist/components/option-list/option-list.component.js +16 -12
- package/dist/components/option-list/option-list.component.js.map +1 -1
- package/dist/components/select/select.component.js +71 -66
- package/dist/components/select/select.component.js.map +1 -1
- package/dist/components/snackbar/snackbar-message.component.js +16 -18
- package/dist/components/snackbar/snackbar-message.component.js.map +1 -1
- package/dist/components/snackbar/snackbar.component.js +48 -35
- package/dist/components/snackbar/snackbar.component.js.map +1 -1
- package/dist/components/table/table.component.d.ts +3 -0
- package/dist/components/table/table.component.js +30 -27
- package/dist/components/table/table.component.js.map +1 -1
- package/dist/components/textarea/textarea.component.d.ts +6 -1
- package/dist/components/textarea/textarea.component.js +43 -36
- package/dist/components/textarea/textarea.component.js.map +1 -1
- package/dist/components/tooltip/tooltip.component.d.ts +2 -0
- package/dist/components/tooltip/tooltip.component.js +51 -53
- package/dist/components/tooltip/tooltip.component.js.map +1 -1
- package/dist/internal/mixin/labelableMixin.d.ts +3 -0
- package/dist/internal/mixin/labelableMixin.js +15 -12
- package/dist/internal/mixin/labelableMixin.js.map +1 -1
- package/dist/manifest/types/vue/index.d.ts +436 -433
- package/dist/manifest/vscode.html-custom-data.json +152 -148
- package/dist/manifest/web-types.json +745 -735
- package/dist/react/dap-ds-input/index.d.ts +1 -0
- package/dist/react/dap-ds-input/index.js.map +1 -1
- package/dist/react/index.d.ts +18 -18
- package/dist/react-types.ts +18 -18
- package/dist/react.js +80 -80
- package/package.json +1 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { clsx as r } from "../../node_modules/clsx/dist/clsx.js";
|
|
2
2
|
import "../../node_modules/@lit/reactive-element/reactive-element.js";
|
|
3
|
-
import { nothing as b, html as
|
|
3
|
+
import { nothing as b, html as n } from "../../node_modules/lit-html/lit-html.js";
|
|
4
4
|
import "../../node_modules/lit-element/lit-element.js";
|
|
5
|
-
import { property as
|
|
6
|
-
import { state as
|
|
5
|
+
import { property as o } from "../../node_modules/@lit/reactive-element/decorators/property.js";
|
|
6
|
+
import { state as l } from "../../node_modules/@lit/reactive-element/decorators/state.js";
|
|
7
7
|
import { query as m } from "../../node_modules/@lit/reactive-element/decorators/query.js";
|
|
8
8
|
import { queryAssignedElements as h } from "../../node_modules/@lit/reactive-element/decorators/query-assigned-elements.js";
|
|
9
9
|
import { ifDefined as s } from "../../node_modules/lit-html/directives/if-defined.js";
|
|
10
10
|
import { GenericFormElement as y } from "../../internal/mixin/genericFormElement.js";
|
|
11
11
|
import $ from "./_styles/input.scss.js";
|
|
12
12
|
import { unsafeCSS as g } from "../../node_modules/@lit/reactive-element/css-tag.js";
|
|
13
|
-
var x = Object.defineProperty, i = (c, t,
|
|
14
|
-
for (var
|
|
15
|
-
(_ = c[u]) && (
|
|
16
|
-
return
|
|
13
|
+
var x = Object.defineProperty, i = (c, t, d, a) => {
|
|
14
|
+
for (var p = void 0, u = c.length - 1, _; u >= 0; u--)
|
|
15
|
+
(_ = c[u]) && (p = _(t, d, p) || p);
|
|
16
|
+
return p && x(t, d, p), p;
|
|
17
17
|
};
|
|
18
18
|
const f = class f extends y {
|
|
19
19
|
constructor() {
|
|
@@ -31,8 +31,8 @@ const f = class f extends y {
|
|
|
31
31
|
firstUpdated(t) {
|
|
32
32
|
super.firstUpdated(t), this._hasAddonBefore = !!this._addonBeforeNode.length, this._hasAddonAfter = !!this._addonAfterNode.length, this._hasPrefix = !!this._prefixNode.length, this._hasPostfix = !!this._postfixNode.length;
|
|
33
33
|
}
|
|
34
|
-
attributeChangedCallback(t,
|
|
35
|
-
super.attributeChangedCallback(t,
|
|
34
|
+
attributeChangedCallback(t, d, a) {
|
|
35
|
+
super.attributeChangedCallback(t, d, a), t === "value" && this.input && (this.input.value = a);
|
|
36
36
|
}
|
|
37
37
|
formResetCallback() {
|
|
38
38
|
this.internals.setValidity({}), this.internals.setFormValue(this.defaultValue), this.value = this.defaultValue, this.input.value = this.defaultValue || "";
|
|
@@ -48,11 +48,11 @@ const f = class f extends y {
|
|
|
48
48
|
}
|
|
49
49
|
onKeydown(t) {
|
|
50
50
|
this.emit("dds-keydown", { value: this.input.value, originalEvent: t });
|
|
51
|
-
const
|
|
52
|
-
!this.disableEnter && t.key === "Enter" && !
|
|
51
|
+
const d = t.metaKey || t.ctrlKey || t.shiftKey || t.altKey;
|
|
52
|
+
!this.disableEnter && t.key === "Enter" && !d && setTimeout(() => {
|
|
53
53
|
if (!t.defaultPrevented && !t.isComposing) {
|
|
54
|
-
const
|
|
55
|
-
|
|
54
|
+
const a = document.createElement("button");
|
|
55
|
+
a.type = "submit", this.insertAdjacentElement("afterend", a), a.click(), a.remove();
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
58
|
}
|
|
@@ -66,13 +66,13 @@ const f = class f extends y {
|
|
|
66
66
|
*/
|
|
67
67
|
getAriaDescribedBy() {
|
|
68
68
|
const t = [];
|
|
69
|
-
return this.description && t.push("description"), this.feedback && t.push("feedback"), t.length > 0 ? t.join(" ") : void 0;
|
|
69
|
+
return this.description && t.push("description"), this.tooltip && t.push("tooltip-description"), this.feedback && t.push("feedback"), t.length > 0 ? t.join(" ") : void 0;
|
|
70
70
|
}
|
|
71
71
|
handleInvalid(t) {
|
|
72
72
|
t.preventDefault();
|
|
73
73
|
}
|
|
74
74
|
renderDefaultContent() {
|
|
75
|
-
return
|
|
75
|
+
return n` <span
|
|
76
76
|
part="prefix"
|
|
77
77
|
class=${r({ "input__addon-prefix": !!this._hasPrefix })}>
|
|
78
78
|
<slot name="prefix"></slot>
|
|
@@ -82,14 +82,14 @@ const f = class f extends y {
|
|
|
82
82
|
class=${r({
|
|
83
83
|
"input__addon-postfix": this._hasPostfix || this.loading
|
|
84
84
|
})}>
|
|
85
|
-
${this.loading ?
|
|
85
|
+
${this.loading ? n`<dap-ds-spinner size="lg"></dap-ds-spinner>` : b}
|
|
86
86
|
<slot name="postfix"></slot>
|
|
87
87
|
</span>`;
|
|
88
88
|
}
|
|
89
89
|
renderInput(t) {
|
|
90
|
-
return
|
|
90
|
+
return n`
|
|
91
91
|
<div class="label-container">
|
|
92
|
-
${this.label &&
|
|
92
|
+
${this.label && n`<dap-ds-form-label
|
|
93
93
|
part="label"
|
|
94
94
|
id="label"
|
|
95
95
|
for="input"
|
|
@@ -104,10 +104,11 @@ const f = class f extends y {
|
|
|
104
104
|
.hideLabel=${this.hideLabel}
|
|
105
105
|
label=${s(this.label)}>
|
|
106
106
|
</dap-ds-form-label>`}
|
|
107
|
-
${this.tooltip &&
|
|
107
|
+
${this.tooltip && n` <dap-ds-tooltip
|
|
108
108
|
part="tooltip"
|
|
109
109
|
content=${this.tooltip}
|
|
110
|
-
mode
|
|
110
|
+
mode=${this.tooltipTrigger === "hover" ? "tooltip" : "toggle"}
|
|
111
|
+
trigger=${this.tooltipTrigger === "hover" ? "hover focus" : "click"}
|
|
111
112
|
floatingStrategy="fixed"
|
|
112
113
|
placement=${this.tooltipPlacement}>
|
|
113
114
|
<dap-ds-icon-button
|
|
@@ -122,8 +123,11 @@ const f = class f extends y {
|
|
|
122
123
|
class="info-button"></dap-ds-icon>
|
|
123
124
|
</dap-ds-icon-button>
|
|
124
125
|
</dap-ds-tooltip>`}
|
|
126
|
+
${this.tooltip && // The tooltip text lives in the tooltip's shadow root, which an
|
|
127
|
+
// aria-describedby on the input cannot reach; mirror it here instead.
|
|
128
|
+
n`<span id="tooltip-description" hidden>${this.tooltip}</span>`}
|
|
125
129
|
</div>
|
|
126
|
-
${this.description &&
|
|
130
|
+
${this.description && n`
|
|
127
131
|
<dap-ds-typography
|
|
128
132
|
part="description"
|
|
129
133
|
variant="description"
|
|
@@ -221,7 +225,7 @@ const f = class f extends y {
|
|
|
221
225
|
`;
|
|
222
226
|
}
|
|
223
227
|
_renderFeedback() {
|
|
224
|
-
return
|
|
228
|
+
return n`
|
|
225
229
|
<dap-ds-feedback
|
|
226
230
|
part="feedback"
|
|
227
231
|
role="alert"
|
|
@@ -255,52 +259,52 @@ i([
|
|
|
255
259
|
h({ slot: "postfix" })
|
|
256
260
|
], e.prototype, "_postfixNode");
|
|
257
261
|
i([
|
|
258
|
-
|
|
262
|
+
o()
|
|
259
263
|
], e.prototype, "type");
|
|
260
264
|
i([
|
|
261
|
-
|
|
265
|
+
o()
|
|
262
266
|
], e.prototype, "placeholder");
|
|
263
267
|
i([
|
|
264
|
-
|
|
268
|
+
o({ type: Number })
|
|
265
269
|
], e.prototype, "minlength");
|
|
266
270
|
i([
|
|
267
|
-
|
|
271
|
+
o({ type: Number })
|
|
268
272
|
], e.prototype, "maxlength");
|
|
269
273
|
i([
|
|
270
|
-
|
|
274
|
+
o({ type: Number })
|
|
271
275
|
], e.prototype, "min");
|
|
272
276
|
i([
|
|
273
|
-
|
|
277
|
+
o({ type: Number })
|
|
274
278
|
], e.prototype, "max");
|
|
275
279
|
i([
|
|
276
|
-
|
|
280
|
+
o()
|
|
277
281
|
], e.prototype, "pattern");
|
|
278
282
|
i([
|
|
279
|
-
|
|
283
|
+
o({ type: Number })
|
|
280
284
|
], e.prototype, "step");
|
|
281
285
|
i([
|
|
282
|
-
|
|
286
|
+
o()
|
|
283
287
|
], e.prototype, "inputmode");
|
|
284
288
|
i([
|
|
285
|
-
|
|
289
|
+
o({ type: Boolean, reflect: !0 })
|
|
286
290
|
], e.prototype, "loading");
|
|
287
291
|
i([
|
|
288
|
-
|
|
292
|
+
o({ type: Boolean })
|
|
289
293
|
], e.prototype, "manualValueSet");
|
|
290
294
|
i([
|
|
291
|
-
|
|
295
|
+
o({ type: Boolean })
|
|
292
296
|
], e.prototype, "disableEnter");
|
|
293
297
|
i([
|
|
294
|
-
|
|
298
|
+
l()
|
|
295
299
|
], e.prototype, "_hasAddonBefore");
|
|
296
300
|
i([
|
|
297
|
-
|
|
301
|
+
l()
|
|
298
302
|
], e.prototype, "_hasAddonAfter");
|
|
299
303
|
i([
|
|
300
|
-
|
|
304
|
+
l()
|
|
301
305
|
], e.prototype, "_hasPrefix");
|
|
302
306
|
i([
|
|
303
|
-
|
|
307
|
+
l()
|
|
304
308
|
], e.prototype, "_hasPostfix");
|
|
305
309
|
export {
|
|
306
310
|
e as InputBaseElement
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-base-element.js","sources":["../../../src/components/input/input-base-element.ts"],"sourcesContent":["import clsx from 'clsx'\nimport { html, nothing, PropertyValueMap, unsafeCSS } from 'lit'\nimport {\n property,\n query,\n queryAssignedElements,\n state,\n} from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\n\nimport { CommonFormElementSize, InputTypes } from '@/common/types'\nimport { GenericFormElement } from '@/internal/mixin/genericFormElement'\n\nimport styles from './_styles/input.scss?inline'\n\nexport class InputBaseElement extends GenericFormElement {\n @query('#input') input!: HTMLInputElement\n @queryAssignedElements({ slot: 'addon-before' })\n private readonly _addonBeforeNode!: NodeListOf<HTMLElement>\n @queryAssignedElements({ slot: 'addon-after' })\n private readonly _addonAfterNode!: NodeListOf<HTMLElement>\n @queryAssignedElements({ slot: 'prefix' })\n private readonly _prefixNode!: NodeListOf<HTMLElement>\n @queryAssignedElements({ slot: 'postfix' })\n private readonly _postfixNode!: NodeListOf<HTMLElement>\n\n @property() type: InputTypes = 'text'\n @property() placeholder?: string\n @property({ type: Number }) minlength?: number\n @property({ type: Number }) maxlength?: number\n @property({ type: Number }) min?: number\n @property({ type: Number }) max?: number\n @property() pattern?: string\n @property({ type: Number }) step?: number | 'any' = 1\n @property() inputmode?: string\n @property({ type: Boolean, reflect: true }) loading = false\n @property({ type: Boolean }) manualValueSet = false\n @property({ type: Boolean }) disableEnter = false\n @state() private _hasAddonBefore = false\n @state() private _hasAddonAfter = false\n @state() private _hasPrefix = false\n @state() private _hasPostfix = false\n\n static readonly styles = unsafeCSS(styles)\n\n public get nativeControl(): HTMLInputElement {\n return this.shadowRoot?.querySelector('.input__control') as HTMLInputElement\n }\n\n private _handleSlotChange(event: Event) {\n const target = event?.target as HTMLInputElement\n target.setAttribute('slot', 'icon')\n }\n\n protected firstUpdated(\n _changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>,\n ): void {\n super.firstUpdated(_changedProperties)\n // this.role = 'textbox'\n this._hasAddonBefore = !!this._addonBeforeNode.length\n this._hasAddonAfter = !!this._addonAfterNode.length\n this._hasPrefix = !!this._prefixNode.length\n this._hasPostfix = !!this._postfixNode.length\n }\n\n attributeChangedCallback(name: string, oldValue: any, newValue: any) {\n super.attributeChangedCallback(name, oldValue, newValue)\n\n if (name === 'value' && this.input) {\n this.input.value = newValue\n }\n }\n\n onInput = () => {\n if (!this.input.validity.badInput && !this.manualValueSet) {\n this.value = this.input.value\n }\n\n this.emit('dds-input', { value: this.input.value })\n this.setValidity()\n }\n\n formResetCallback() {\n this.internals.setValidity({})\n this.internals.setFormValue(this.defaultValue)\n this.value = this.defaultValue\n this.input.value = this.defaultValue || ''\n }\n\n onBlur() {\n this.emit('dds-blur')\n }\n\n onFocus() {\n this.emit('dds-focus')\n }\n\n onChange() {\n this.value = this.input.value\n\n if (!this.manualValueSet) {\n this.emit('dds-change', { value: this.input.value })\n }\n\n this.setValidity()\n }\n\n onKeydown(event: KeyboardEvent) {\n this.emit('dds-keydown', { value: this.input.value, originalEvent: event })\n\n const hasModifier =\n event.metaKey || event.ctrlKey || event.shiftKey || event.altKey\n\n if (!this.disableEnter && event.key === 'Enter' && !hasModifier) {\n setTimeout(() => {\n if (!event.defaultPrevented && !event.isComposing) {\n const proxy = document.createElement('button')\n proxy.type = 'submit'\n this.insertAdjacentElement('afterend', proxy)\n\n proxy.click()\n proxy.remove()\n }\n })\n }\n }\n\n public get focusElement() {\n return this.input\n }\n\n /**\n * Gets the aria-describedby attribute value by combining description and feedback IDs.\n * @returns {string | undefined} Space-separated IDs or undefined if none exist\n * @private\n */\n private getAriaDescribedBy(): string | undefined {\n const ids: string[] = []\n\n if (this.description) {\n ids.push('description')\n }\n\n if (this.feedback) {\n ids.push('feedback')\n }\n\n return ids.length > 0 ? ids.join(' ') : undefined\n }\n\n handleInvalid(event: Event) {\n event.preventDefault()\n }\n\n renderDefaultContent() {\n return html` <span\n part=\"prefix\"\n class=${clsx({ 'input__addon-prefix': !!this._hasPrefix })}>\n <slot name=\"prefix\"></slot>\n </span>\n <span\n part=\"postfix\"\n class=${clsx({\n 'input__addon-postfix': this._hasPostfix || this.loading,\n })}>\n ${this.loading\n ? html`<dap-ds-spinner size=\"lg\"></dap-ds-spinner>`\n : nothing}\n <slot name=\"postfix\"></slot>\n </span>`\n }\n\n renderInput(content?: unknown) {\n return html`\n <div class=\"label-container\">\n ${this.label &&\n html`<dap-ds-form-label\n part=\"label\"\n id=\"label\"\n for=\"input\"\n .size=${this.effectiveSize}\n .required=${this.required}\n .requiredLabel=${this.requiredLabel}\n .optional=${this.optional}\n .optionalLabel=${this.optionalLabel}\n .disabled=${this.disabled}\n class=${clsx('label')}\n .noMargin=${!!this.description}\n .hideLabel=${this.hideLabel}\n label=${ifDefined(this.label)}>\n </dap-ds-form-label>`}\n ${this.tooltip &&\n html` <dap-ds-tooltip\n part=\"tooltip\"\n content=${this.tooltip}\n mode=\"toggle\"\n floatingStrategy=\"fixed\"\n placement=${this.tooltipPlacement}>\n <dap-ds-icon-button\n clean\n class=\"info-button\"\n slot=\"trigger\"\n aria-label=${this.tooltipAriaLabel}\n size=${this.effectiveSize as 'xs' | 'sm' | 'md' | 'lg'}\n iconSize=${this.effectiveSize === 'xs' ? '16' : '22'}>\n <dap-ds-icon\n name=\"information-line\"\n class=\"info-button\"></dap-ds-icon>\n </dap-ds-icon-button>\n </dap-ds-tooltip>`}\n </div>\n ${this.description &&\n html`\n <dap-ds-typography\n part=\"description\"\n variant=\"description\"\n class=${clsx('input-description')}\n size=${ifDefined(this.effectiveSize as CommonFormElementSize)}\n id=\"description\">\n ${this.description}\n </dap-ds-typography>\n `}\n <span\n part=\"base\"\n class=${clsx(\n 'input',\n `input--${this.effectiveSize}`,\n { 'input--success': this.status === 'success' },\n { 'input--error': this.status === 'error' },\n { 'input--disabled': this.disabled },\n { 'input--readonly': this.readonly },\n { 'input--has-addon-before': !!this._hasAddonBefore },\n { 'input--has-addon-after': !!this._hasAddonAfter },\n { 'input--has-prefix': !!this._hasPrefix },\n { 'input--has-postfix': !!this._hasPostfix || this.loading },\n )}>\n <span\n part=\"addon-before\"\n class=${clsx({\n 'input__addon-before': !!this._hasAddonBefore,\n [`input__addon-before--${this.effectiveSize}`]:\n !!this._hasAddonBefore,\n 'input__addon-before--disabled':\n !!this._hasAddonBefore && this.disabled,\n 'input__addon-before--readonly':\n !!this._hasAddonBefore && this.readonly,\n 'input__addon-before--success':\n !!this._hasAddonBefore && this.status === 'success',\n 'input__addon-before--error':\n !!this._hasAddonBefore && this.status === 'error',\n })}>\n <slot name=\"addon-before\"></slot>\n </span>\n <div class=\"input__container\">\n <input\n id=\"input\"\n class=${clsx(\n 'input__control',\n `input__control--${this.effectiveSize}`,\n { 'input__control--success': this.status === 'success' },\n { 'input__control--error': this.status === 'error' },\n { 'input__control--disabled': this.disabled },\n { 'input__control--readonly': this.readonly },\n { 'input__control--has-addon-before': !!this._hasAddonBefore },\n { 'input__control--has-addon-after': !!this._hasAddonAfter },\n { 'input__control--has-prefix': !!this._hasPrefix },\n {\n 'input__control--has-postfix':\n !!this._hasPostfix || this.loading,\n },\n )}\n part=\"input\"\n name=${ifDefined(this.name ? this.name : undefined)}\n type=${this.type}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?required=${this.required}\n placeholder=${ifDefined(this.placeholder)}\n value=${ifDefined(this.value)}\n minlength=${ifDefined(this.minlength)}\n maxlength=${ifDefined(this.maxlength)}\n aria-labelledby=${ifDefined(this.label ? 'label' : nothing)}\n aria-describedby=${ifDefined(this.getAriaDescribedBy())}\n min=${ifDefined(this.min)}\n max=${ifDefined(this.max)}\n pattern=${ifDefined(this.pattern)}\n step=${ifDefined(this.step as number)}\n inputmode=${ifDefined(this.inputmode)}\n ?autofocus=${this.autofocus}\n autocomplete=${this.autocomplete as any}\n autocapitalize=${ifDefined(this.autocapitalize ? 'on' : 'off')}\n @change=${this.onChange}\n @input=${this.onInput}\n @keydown=${this.onKeydown}\n @invalid=${this.handleInvalid}\n @blur=${this.onBlur}\n @focus=${this.onFocus} />\n ${content ?? this.renderDefaultContent()}\n </div>\n <span\n part=\"addon-after\"\n class=${clsx({\n 'input__addon-after': !!this._hasAddonAfter,\n [`input__addon-after--${this.effectiveSize}`]:\n !!this._hasAddonAfter,\n 'input__addon-after--disabled':\n !!this._hasAddonAfter && this.disabled,\n 'input__addon-after--readonly':\n !!this._hasAddonAfter && this.readonly,\n 'input__addon-after--success':\n !!this._hasAddonAfter && this.status === 'success',\n 'input__addon-after--error':\n !!this._hasAddonAfter && this.status === 'error',\n })}>\n <slot name=\"addon-after\"></slot>\n </span>\n </span>\n ${this.feedback && this._renderFeedback()}\n `\n }\n\n private _renderFeedback() {\n return html`\n <dap-ds-feedback\n part=\"feedback\"\n role=\"alert\"\n feedbackType=${ifDefined(this.feedbackType)}\n feedbackSize=\"${ifDefined(this.effectiveSize as 'lg' | 'sm' | 'xs')}\"\n .subtle=${this.subtle}\n id=\"feedback\">\n <slot\n name=\"feedback-icon\"\n @slotchange=\"${this._handleSlotChange}\"></slot>\n ${this.feedback}\n </dap-ds-feedback>\n `\n }\n}\n"],"names":["_InputBaseElement","GenericFormElement","_a","event","_changedProperties","name","oldValue","newValue","hasModifier","proxy","ids","html","clsx","nothing","content","ifDefined","unsafeCSS","styles","InputBaseElement","__decorateClass","query","queryAssignedElements","property","state"],"mappings":";;;;;;;;;;;;;;;;;AAeO,MAAMA,IAAN,MAAMA,UAAyBC,EAAmB;AAAA,EAAlD,cAAA;AAAA,UAAA,GAAA,SAAA,GAW0B,KAAA,OAAA,QAOqB,KAAA,OAAA,GAEE,KAAA,UAAA,IACR,KAAA,iBAAA,IACF,KAAA,eAAA,IACnC,KAAQ,kBAAkB,IAC1B,KAAQ,iBAAiB,IACzB,KAAQ,aAAa,IACrB,KAAQ,cAAc,IAgC/B,KAAA,UAAU,MAAM;AACd,MAAI,CAAC,KAAK,MAAM,SAAS,YAAY,CAAC,KAAK,mBACpC,KAAA,QAAQ,KAAK,MAAM,QAG1B,KAAK,KAAK,aAAa,EAAE,OAAO,KAAK,MAAM,OAAO,GAClD,KAAK,YAAY;AAAA,IACnB;AAAA,EAAA;AAAA,EAnCA,IAAW,gBAAkC;;AACpC,YAAAC,IAAA,KAAK,eAAL,gBAAAA,EAAiB,cAAc;AAAA,EAAiB;AAAA,EAGjD,kBAAkBC,GAAc;AAE/B,KADQA,KAAA,gBAAAA,EAAO,QACf,aAAa,QAAQ,MAAM;AAAA,EAAA;AAAA,EAG1B,aACRC,GACM;AACN,UAAM,aAAaA,CAAkB,GAErC,KAAK,kBAAkB,CAAC,CAAC,KAAK,iBAAiB,QAC/C,KAAK,iBAAiB,CAAC,CAAC,KAAK,gBAAgB,QAC7C,KAAK,aAAa,CAAC,CAAC,KAAK,YAAY,QACrC,KAAK,cAAc,CAAC,CAAC,KAAK,aAAa;AAAA,EAAA;AAAA,EAGzC,yBAAyBC,GAAcC,GAAeC,GAAe;AAC7D,UAAA,yBAAyBF,GAAMC,GAAUC,CAAQ,GAEnDF,MAAS,WAAW,KAAK,UAC3B,KAAK,MAAM,QAAQE;AAAA,EACrB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;AAAA,EAA3BG,EAAS,EAAE,MAAM,OAAQ,CAAA;AAAA,GAffJ,EAeiB,WAAA,KAAA;AACAC,EAAA;AAAA,EAA3BG,EAAS,EAAE,MAAM,OAAQ,CAAA;AAAA,GAhBfJ,EAgBiB,WAAA,KAAA;AAChBC,EAAA;AAAA,EAAXG,EAAS;AAAA,GAjBCJ,EAiBC,WAAA,SAAA;AACgBC,EAAA;AAAA,EAA3BG,EAAS,EAAE,MAAM,OAAQ,CAAA;AAAA,GAlBfJ,EAkBiB,WAAA,MAAA;AAChBC,EAAA;AAAA,EAAXG,EAAS;AAAA,GAnBCJ,EAmBC,WAAA,WAAA;AACgCC,EAAA;AAAA,EAA3CG,EAAS,EAAE,MAAM,SAAS,SAAS,GAAM,CAAA;AAAA,GApB/BJ,EAoBiC,WAAA,SAAA;AACfC,EAAA;AAAA,EAA5BG,EAAS,EAAE,MAAM,QAAS,CAAA;AAAA,GArBhBJ,EAqBkB,WAAA,gBAAA;AACAC,EAAA;AAAA,EAA5BG,EAAS,EAAE,MAAM,QAAS,CAAA;AAAA,GAtBhBJ,EAsBkB,WAAA,cAAA;AACZC,EAAA;AAAA,EAAhBI,EAAM;AAAA,GAvBIL,EAuBM,WAAA,iBAAA;AACAC,EAAA;AAAA,EAAhBI,EAAM;AAAA,GAxBIL,EAwBM,WAAA,gBAAA;AACAC,EAAA;AAAA,EAAhBI,EAAM;AAAA,GAzBIL,EAyBM,WAAA,YAAA;AACAC,EAAA;AAAA,EAAhBI,EAAM;AAAA,GA1BIL,EA0BM,WAAA,aAAA;"}
|
|
1
|
+
{"version":3,"file":"input-base-element.js","sources":["../../../src/components/input/input-base-element.ts"],"sourcesContent":["import clsx from 'clsx'\nimport { html, nothing, PropertyValueMap, unsafeCSS } from 'lit'\nimport {\n property,\n query,\n queryAssignedElements,\n state,\n} from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\n\nimport { CommonFormElementSize, InputTypes } from '@/common/types'\nimport { GenericFormElement } from '@/internal/mixin/genericFormElement'\n\nimport styles from './_styles/input.scss?inline'\n\nexport class InputBaseElement extends GenericFormElement {\n @query('#input') input!: HTMLInputElement\n @queryAssignedElements({ slot: 'addon-before' })\n private readonly _addonBeforeNode!: NodeListOf<HTMLElement>\n @queryAssignedElements({ slot: 'addon-after' })\n private readonly _addonAfterNode!: NodeListOf<HTMLElement>\n @queryAssignedElements({ slot: 'prefix' })\n private readonly _prefixNode!: NodeListOf<HTMLElement>\n @queryAssignedElements({ slot: 'postfix' })\n private readonly _postfixNode!: NodeListOf<HTMLElement>\n\n @property() type: InputTypes = 'text'\n @property() placeholder?: string\n @property({ type: Number }) minlength?: number\n @property({ type: Number }) maxlength?: number\n @property({ type: Number }) min?: number\n @property({ type: Number }) max?: number\n @property() pattern?: string\n @property({ type: Number }) step?: number | 'any' = 1\n @property() inputmode?: string\n @property({ type: Boolean, reflect: true }) loading = false\n @property({ type: Boolean }) manualValueSet = false\n @property({ type: Boolean }) disableEnter = false\n @state() private _hasAddonBefore = false\n @state() private _hasAddonAfter = false\n @state() private _hasPrefix = false\n @state() private _hasPostfix = false\n\n static readonly styles = unsafeCSS(styles)\n\n public get nativeControl(): HTMLInputElement {\n return this.shadowRoot?.querySelector('.input__control') as HTMLInputElement\n }\n\n private _handleSlotChange(event: Event) {\n const target = event?.target as HTMLInputElement\n target.setAttribute('slot', 'icon')\n }\n\n protected firstUpdated(\n _changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>,\n ): void {\n super.firstUpdated(_changedProperties)\n // this.role = 'textbox'\n this._hasAddonBefore = !!this._addonBeforeNode.length\n this._hasAddonAfter = !!this._addonAfterNode.length\n this._hasPrefix = !!this._prefixNode.length\n this._hasPostfix = !!this._postfixNode.length\n }\n\n attributeChangedCallback(name: string, oldValue: any, newValue: any) {\n super.attributeChangedCallback(name, oldValue, newValue)\n\n if (name === 'value' && this.input) {\n this.input.value = newValue\n }\n }\n\n onInput = () => {\n if (!this.input.validity.badInput && !this.manualValueSet) {\n this.value = this.input.value\n }\n\n this.emit('dds-input', { value: this.input.value })\n this.setValidity()\n }\n\n formResetCallback() {\n this.internals.setValidity({})\n this.internals.setFormValue(this.defaultValue)\n this.value = this.defaultValue\n this.input.value = this.defaultValue || ''\n }\n\n onBlur() {\n this.emit('dds-blur')\n }\n\n onFocus() {\n this.emit('dds-focus')\n }\n\n onChange() {\n this.value = this.input.value\n\n if (!this.manualValueSet) {\n this.emit('dds-change', { value: this.input.value })\n }\n\n this.setValidity()\n }\n\n onKeydown(event: KeyboardEvent) {\n this.emit('dds-keydown', { value: this.input.value, originalEvent: event })\n\n const hasModifier =\n event.metaKey || event.ctrlKey || event.shiftKey || event.altKey\n\n if (!this.disableEnter && event.key === 'Enter' && !hasModifier) {\n setTimeout(() => {\n if (!event.defaultPrevented && !event.isComposing) {\n const proxy = document.createElement('button')\n proxy.type = 'submit'\n this.insertAdjacentElement('afterend', proxy)\n\n proxy.click()\n proxy.remove()\n }\n })\n }\n }\n\n public get focusElement() {\n return this.input\n }\n\n /**\n * Gets the aria-describedby attribute value by combining description and feedback IDs.\n * @returns {string | undefined} Space-separated IDs or undefined if none exist\n * @private\n */\n private getAriaDescribedBy(): string | undefined {\n const ids: string[] = []\n\n if (this.description) {\n ids.push('description')\n }\n\n if (this.tooltip) {\n ids.push('tooltip-description')\n }\n\n if (this.feedback) {\n ids.push('feedback')\n }\n\n return ids.length > 0 ? ids.join(' ') : undefined\n }\n\n handleInvalid(event: Event) {\n event.preventDefault()\n }\n\n renderDefaultContent() {\n return html` <span\n part=\"prefix\"\n class=${clsx({ 'input__addon-prefix': !!this._hasPrefix })}>\n <slot name=\"prefix\"></slot>\n </span>\n <span\n part=\"postfix\"\n class=${clsx({\n 'input__addon-postfix': this._hasPostfix || this.loading,\n })}>\n ${this.loading\n ? html`<dap-ds-spinner size=\"lg\"></dap-ds-spinner>`\n : nothing}\n <slot name=\"postfix\"></slot>\n </span>`\n }\n\n renderInput(content?: unknown) {\n return html`\n <div class=\"label-container\">\n ${this.label &&\n html`<dap-ds-form-label\n part=\"label\"\n id=\"label\"\n for=\"input\"\n .size=${this.effectiveSize}\n .required=${this.required}\n .requiredLabel=${this.requiredLabel}\n .optional=${this.optional}\n .optionalLabel=${this.optionalLabel}\n .disabled=${this.disabled}\n class=${clsx('label')}\n .noMargin=${!!this.description}\n .hideLabel=${this.hideLabel}\n label=${ifDefined(this.label)}>\n </dap-ds-form-label>`}\n ${this.tooltip &&\n html` <dap-ds-tooltip\n part=\"tooltip\"\n content=${this.tooltip}\n mode=${this.tooltipTrigger === 'hover' ? 'tooltip' : 'toggle'}\n trigger=${this.tooltipTrigger === 'hover' ? 'hover focus' : 'click'}\n floatingStrategy=\"fixed\"\n placement=${this.tooltipPlacement}>\n <dap-ds-icon-button\n clean\n class=\"info-button\"\n slot=\"trigger\"\n aria-label=${this.tooltipAriaLabel}\n size=${this.effectiveSize as 'xs' | 'sm' | 'md' | 'lg'}\n iconSize=${this.effectiveSize === 'xs' ? '16' : '22'}>\n <dap-ds-icon\n name=\"information-line\"\n class=\"info-button\"></dap-ds-icon>\n </dap-ds-icon-button>\n </dap-ds-tooltip>`}\n ${this.tooltip &&\n // The tooltip text lives in the tooltip's shadow root, which an\n // aria-describedby on the input cannot reach; mirror it here instead.\n html`<span id=\"tooltip-description\" hidden>${this.tooltip}</span>`}\n </div>\n ${this.description &&\n html`\n <dap-ds-typography\n part=\"description\"\n variant=\"description\"\n class=${clsx('input-description')}\n size=${ifDefined(this.effectiveSize as CommonFormElementSize)}\n id=\"description\">\n ${this.description}\n </dap-ds-typography>\n `}\n <span\n part=\"base\"\n class=${clsx(\n 'input',\n `input--${this.effectiveSize}`,\n { 'input--success': this.status === 'success' },\n { 'input--error': this.status === 'error' },\n { 'input--disabled': this.disabled },\n { 'input--readonly': this.readonly },\n { 'input--has-addon-before': !!this._hasAddonBefore },\n { 'input--has-addon-after': !!this._hasAddonAfter },\n { 'input--has-prefix': !!this._hasPrefix },\n { 'input--has-postfix': !!this._hasPostfix || this.loading },\n )}>\n <span\n part=\"addon-before\"\n class=${clsx({\n 'input__addon-before': !!this._hasAddonBefore,\n [`input__addon-before--${this.effectiveSize}`]:\n !!this._hasAddonBefore,\n 'input__addon-before--disabled':\n !!this._hasAddonBefore && this.disabled,\n 'input__addon-before--readonly':\n !!this._hasAddonBefore && this.readonly,\n 'input__addon-before--success':\n !!this._hasAddonBefore && this.status === 'success',\n 'input__addon-before--error':\n !!this._hasAddonBefore && this.status === 'error',\n })}>\n <slot name=\"addon-before\"></slot>\n </span>\n <div class=\"input__container\">\n <input\n id=\"input\"\n class=${clsx(\n 'input__control',\n `input__control--${this.effectiveSize}`,\n { 'input__control--success': this.status === 'success' },\n { 'input__control--error': this.status === 'error' },\n { 'input__control--disabled': this.disabled },\n { 'input__control--readonly': this.readonly },\n { 'input__control--has-addon-before': !!this._hasAddonBefore },\n { 'input__control--has-addon-after': !!this._hasAddonAfter },\n { 'input__control--has-prefix': !!this._hasPrefix },\n {\n 'input__control--has-postfix':\n !!this._hasPostfix || this.loading,\n },\n )}\n part=\"input\"\n name=${ifDefined(this.name ? this.name : undefined)}\n type=${this.type}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?required=${this.required}\n placeholder=${ifDefined(this.placeholder)}\n value=${ifDefined(this.value)}\n minlength=${ifDefined(this.minlength)}\n maxlength=${ifDefined(this.maxlength)}\n aria-labelledby=${ifDefined(this.label ? 'label' : nothing)}\n aria-describedby=${ifDefined(this.getAriaDescribedBy())}\n min=${ifDefined(this.min)}\n max=${ifDefined(this.max)}\n pattern=${ifDefined(this.pattern)}\n step=${ifDefined(this.step as number)}\n inputmode=${ifDefined(this.inputmode)}\n ?autofocus=${this.autofocus}\n autocomplete=${this.autocomplete as any}\n autocapitalize=${ifDefined(this.autocapitalize ? 'on' : 'off')}\n @change=${this.onChange}\n @input=${this.onInput}\n @keydown=${this.onKeydown}\n @invalid=${this.handleInvalid}\n @blur=${this.onBlur}\n @focus=${this.onFocus} />\n ${content ?? this.renderDefaultContent()}\n </div>\n <span\n part=\"addon-after\"\n class=${clsx({\n 'input__addon-after': !!this._hasAddonAfter,\n [`input__addon-after--${this.effectiveSize}`]:\n !!this._hasAddonAfter,\n 'input__addon-after--disabled':\n !!this._hasAddonAfter && this.disabled,\n 'input__addon-after--readonly':\n !!this._hasAddonAfter && this.readonly,\n 'input__addon-after--success':\n !!this._hasAddonAfter && this.status === 'success',\n 'input__addon-after--error':\n !!this._hasAddonAfter && this.status === 'error',\n })}>\n <slot name=\"addon-after\"></slot>\n </span>\n </span>\n ${this.feedback && this._renderFeedback()}\n `\n }\n\n private _renderFeedback() {\n return html`\n <dap-ds-feedback\n part=\"feedback\"\n role=\"alert\"\n feedbackType=${ifDefined(this.feedbackType)}\n feedbackSize=\"${ifDefined(this.effectiveSize as 'lg' | 'sm' | 'xs')}\"\n .subtle=${this.subtle}\n id=\"feedback\">\n <slot\n name=\"feedback-icon\"\n @slotchange=\"${this._handleSlotChange}\"></slot>\n ${this.feedback}\n </dap-ds-feedback>\n `\n }\n}\n"],"names":["_InputBaseElement","GenericFormElement","_a","event","_changedProperties","name","oldValue","newValue","hasModifier","proxy","ids","html","clsx","nothing","content","ifDefined","unsafeCSS","styles","InputBaseElement","__decorateClass","query","queryAssignedElements","property","state"],"mappings":";;;;;;;;;;;;;;;;;AAeO,MAAMA,IAAN,MAAMA,UAAyBC,EAAmB;AAAA,EAAlD,cAAA;AAAA,UAAA,GAAA,SAAA,GAW0B,KAAA,OAAA,QAOqB,KAAA,OAAA,GAEE,KAAA,UAAA,IACR,KAAA,iBAAA,IACF,KAAA,eAAA,IACnC,KAAQ,kBAAkB,IAC1B,KAAQ,iBAAiB,IACzB,KAAQ,aAAa,IACrB,KAAQ,cAAc,IAgC/B,KAAA,UAAU,MAAM;AACd,MAAI,CAAC,KAAK,MAAM,SAAS,YAAY,CAAC,KAAK,mBACpC,KAAA,QAAQ,KAAK,MAAM,QAG1B,KAAK,KAAK,aAAa,EAAE,OAAO,KAAK,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AAA;AACgCC,EAAA;AAAA,EAA3CG,EAAS,EAAE,MAAM,SAAS,SAAS,GAAM,CAAA;AAAA,GApB/BJ,EAoBiC,WAAA,SAAA;AACfC,EAAA;AAAA,EAA5BG,EAAS,EAAE,MAAM,QAAS,CAAA;AAAA,GArBhBJ,EAqBkB,WAAA,gBAAA;AACAC,EAAA;AAAA,EAA5BG,EAAS,EAAE,MAAM,QAAS,CAAA;AAAA,GAtBhBJ,EAsBkB,WAAA,cAAA;AACZC,EAAA;AAAA,EAAhBI,EAAM;AAAA,GAvBIL,EAuBM,WAAA,iBAAA;AACAC,EAAA;AAAA,EAAhBI,EAAM;AAAA,GAxBIL,EAwBM,WAAA,gBAAA;AACAC,EAAA;AAAA,EAAhBI,EAAM;AAAA,GAzBIL,EAyBM,WAAA,YAAA;AACAC,EAAA;AAAA,EAAhBI,EAAM;AAAA,GA1BIL,EA0BM,WAAA,aAAA;"}
|
|
@@ -17,6 +17,7 @@ import { InputBaseElement } from './input-base-element';
|
|
|
17
17
|
* @property {string} tooltip - The tooltip of the input.
|
|
18
18
|
* @property {'top' | 'right' | 'bottom' | 'left'} tooltipPlacement - The tooltip placement of the input.
|
|
19
19
|
* @property {string} tooltipAriaLabel - The aria label of the tooltip.
|
|
20
|
+
* @property {'click' | 'hover'} tooltipTrigger - How the tooltip opens: `click` (click/Enter, default) or `hover` (hover and keyboard focus).
|
|
20
21
|
* @property {string} feedback - The feedback of the input.
|
|
21
22
|
* @property {'negative' | 'positive' | 'warning'} feedbackType - The feedback type of the input. Can be `negative`, `positive`, or `warning`.
|
|
22
23
|
* @property {'succes' | 'error'} status - The status of the input. Can be `success` or `error`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.component.js","sources":["../../../src/components/input/input.component.ts"],"sourcesContent":["import { InputBaseElement } from './input-base-element'\n\n/**\n * `dap-ds-input`\n * @summary An input is a field used to collect user input.\n * @element dap-ds-input\n * @title - Input\n *\n * @property {string} label - The label of the input.\n * @property {boolean} hideLabel - Visually hides the label while keeping it available to assistive technology. (default: false)\n * @property {string} description - The description of the input.\n * @property {string} optionalLabel - Text of optional label.\n * @property {string} requiredLabel - Text of required indicator. (default: '*')\n * @property {boolean} subtle - Text weight of label. If true the label is subtle. Default value is false.\n * @property {string} value - The value of the input.\n * @property {string} placeholder - The placeholder of the input.\n * @property {boolean} loading - The loading state of the input. Default is false.\n * @property {string} tooltip - The tooltip of the input.\n * @property {'top' | 'right' | 'bottom' | 'left'} tooltipPlacement - The tooltip placement of the input.\n * @property {string} tooltipAriaLabel - The aria label of the tooltip.\n * @property {string} feedback - The feedback of the input.\n * @property {'negative' | 'positive' | 'warning'} feedbackType - The feedback type of the input. Can be `negative`, `positive`, or `warning`.\n * @property {'succes' | 'error'} status - The status of the input. Can be `success` or `error`.\n * @property {'xs' | 'sm' | 'lg'} size - The size of the input. Default is `sm`.\n * @property {string} sizeMap - Responsive size map (e.g. \"xs:lg\").\n * @property {string} name - The name of the input.\n * @property {'text' | 'number' | 'button' | 'color' | 'email' | 'hidden' | 'reset' | 'submit' | 'url' | 'password'| 'file' | 'time'} type - The type of the input. Default is 'text'.\n * @property {boolean} disabled - The disabled state of the input. Default is false.\n * @property {boolean} required - The required state of the input. Default is false.\n * @property {boolean} readonly - The readonly state of the input. Default is false.\n * @property {boolean} autofocus - The autofocus state of the input. Default is false.\n * @property {boolean} autocapitalize - The autocapitalize state of the input. Default is false.\n * @property {number} minlength - The minimum length of the input.\n * @property {number} maxlength - The maximum length of the input.\n * @property {number} min - The minimum value of the number input.\n * @property {number} max - The maximum value of the number input.\n * @property {number} step - The step value of the number input.\n * @property {string} inputmode - The inputmode of the input.\n * @property {string} pattern - The regex pattern of the input.\n *\n * @cssproperty --dds-input-height-xs - The height of the extra small input. (default: var(--dds-spacing-800)).\n * @cssproperty --dds-input-height-sm - The height of the small input. (default: var(--dds-spacing-1000)).\n * @cssproperty --dds-input-height-lg - The height of the large input. (default: var(--dds-spacing-1200)).\n * @cssproperty --dds-input-padding-xs - The padding of the extra small input. (default: 0 var(--dds-spacing-200)).\n * @cssproperty --dds-input-padding-sm - The padding of the small input. (default: 0 var(--dds-spacing-300)).\n * @cssproperty --dds-input-padding-lg - The padding of the large input. (default: 0 var(--dds-spacing-400)).\n * @cssproperty --dds-input-font-size-xs - The font size of the extra small input. (default: var(--dds-font-sm)).\n * @cssproperty --dds-input-font-size-sm - The font size of the small input. (default: var(--dds-font-base)).\n * @cssproperty --dds-input-font-size-lg - The font size of the large input. (default: var(--dds-font-lg)).\n * @cssproperty --dds-input-border - The border of the input. (default: var(--dds-border-width-base) solid var(--dds-border-neutral-base)).\n * @cssproperty --dds-input-background - The background color of the input. (default: var(--dds-fields-background-default)).\n * @cssproperty --dds-input-text-color - The text color of the input. (default: var(--dds-text-neutral-base)).\n * @cssproperty --dds-input-border-radius - The border radius of the input. (default: var(--dds-radius-base)).\n * @cssproperty --dds-input-disabled-border - The border of the disabled input. (default: 0 solid var(--dds-border-neutral-disabled)).\n * @cssproperty --dds-input-disabled-background - The background color of the disabled input. (default: var(--dds-fields-background-disabled)).\n * @cssproperty --dds-input-disabled-text - The text color of the disabled input. (default: var(--dds-text-neutral-disabled)).\n * @cssproperty --dds-input-readonly-border - The border of the readonly input. (default: 0 solid var(--dds-border-neutral-subtle)).\n * @cssproperty --dds-input-readonly-background - The background color of the readonly input. (default: var(--dds-fields-background-read-only)).\n * @cssproperty --dds-input-readonly-text - The text color of the readonly input. (default: var(--dds-text-neutral-subtle)).\n * @cssproperty --dds-input-success-border - The border of the success input. (default: var(--dds-border-width-base) solid var(--dds-border-positive-base)).\n * @cssproperty --dds-input-error-border - The border of the error input. (default: var(--dds-border-width-base) solid var(--dds-border-negative-base)).\n * @cssproperty --dds-input-addon-background - The background color of the input addon. (default: var(--dds-fields-background-default)).\n * @cssproperty --dds-input-addon-success-background - The background color of the success input addon. (default: var(--dds-fields-background-default)).\n * @cssproperty --dds-input-addon-error-background - The background color of the error input addon. (default: var(--dds-fields-background-default)).\n * @cssproperty --dds-input-addon-border-before - The border of the addon before the input. (default: var(--dds-border-width-base) solid var(--dds-border-neutral-base)).\n * @cssproperty --dds-input-addon-border-after - The border of the addon after the input. (default: var(--dds-border-width-base) solid var(--dds-border-neutral-base)).\n * @cssproperty --dds-input-addon-border-width-before - The border width of the addon before the input. (default: var(--dds-border-width-base) 0 var(--dds-border-width-base) var(--dds-border-width-base)).\n * @cssproperty --dds-input-addon-border-width-after - The border width of the addon after the input. (default: var(--dds-border-width-base) var(--dds-border-width-base) var(--dds-border-width-base) 0).\n * @cssproperty --dds-input-addon-success-border - The border of the success addon. (default: var(--dds-border-width-base) solid var(--dds-border-positive-base)).\n * @cssproperty --dds-input-addon-success-border-before - The border of the success addon before the input. (default: var(--dds-border-width-base) solid var(--dds-border-positive-base)).\n * @cssproperty --dds-input-addon-success-border-after - The border of the success addon after the input. (default: var(--dds-border-width-base) solid var(--dds-border-positive-base)).\n * @cssproperty --dds-input-addon-success-border-width-before - The border width of the success addon before the input. (default: var(--dds-border-width-base) 0 var(--dds-border-width-base) var(--dds-border-width-base)).\n * @cssproperty --dds-input-addon-success-border-width-after - The border width of the success addon after the input. (default: var(--dds-border-width-base) var(--dds-border-width-base) var(--dds-border-width-base) 0).\n * @cssproperty --dds-input-addon-error-border-before - The border of the error addon before the input. (default: var(--dds-border-width-base) solid var(--dds-border-negative-base)).\n * @cssproperty --dds-input-addon-error-border-after - The border of the error addon after the input. (default: var(--dds-border-width-base) solid var(--dds-border-negative-base)).\n * @cssproperty --dds-input-addon-error-border-width-before - The border width of the error addon before the input. (default: var(--dds-border-width-base) 0 var(--dds-border-width-base) var(--dds-border-width-base)).\n * @cssproperty --dds-input-addon-error-border-width-after - The border width of the error addon after the input. (default: var(--dds-border-width-base) var(--dds-border-width-base) var(--dds-border-width-base) 0).\n *\n * @event {{ value: string }} dds-change - Fired when the input value changes.\n * @event {{ value: string }} dds-input - Fired when the input value changes.\n * @event {{ value: string, originalEvent: Event }} dds-keydown - Fired when a key is pressed down.\n * @event {{ void }} dds-blur - Fired when the input loses focus.\n * @event {{ void }} dds-focus - Emitted when the input gains focus.\n *\n * @slot postfix - The postfix of the input.\n * @slot prefix - The prefix of the input.\n * @slot addon-before - The addon before the input.\n * @slot addon-after - The addon after the input.\n * @slot feedback-icon - The custom icon of the feedback.\n *\n * @csspart base - The main input container.\n * @csspart input - The input element.\n * @csspart label - The label of the input.\n * @csspart description - The description of the input.\n * @csspart feedback - The feedback of the input.\n * @csspart tooltip - The tooltip of the input.\n * @csspart addon-before - The addon before the input.\n * @csspart addon-after - The addon after the input.\n * @csspart prefix - The prefix of the input.\n * @csspart postfix - The postfix of the input.\n *\n */\nexport default class DapDSInput extends InputBaseElement {\n static tagName = 'dap-ds-input'\n\n render() {\n return this.renderInput()\n }\n}\n"],"names":["_DapDSInput","InputBaseElement","DapDSInput"],"mappings":";AAsGA,MAAqBA,IAArB,MAAqBA,UAAmBC,EAAiB;AAAA,EAGvD,SAAS;AACP,WAAO,KAAK,YAAY;AAAA,EAAA;AAE5B;AALED,EAAO,UAAU;AADnB,IAAqBE,IAArBF;"}
|
|
1
|
+
{"version":3,"file":"input.component.js","sources":["../../../src/components/input/input.component.ts"],"sourcesContent":["import { InputBaseElement } from './input-base-element'\n\n/**\n * `dap-ds-input`\n * @summary An input is a field used to collect user input.\n * @element dap-ds-input\n * @title - Input\n *\n * @property {string} label - The label of the input.\n * @property {boolean} hideLabel - Visually hides the label while keeping it available to assistive technology. (default: false)\n * @property {string} description - The description of the input.\n * @property {string} optionalLabel - Text of optional label.\n * @property {string} requiredLabel - Text of required indicator. (default: '*')\n * @property {boolean} subtle - Text weight of label. If true the label is subtle. Default value is false.\n * @property {string} value - The value of the input.\n * @property {string} placeholder - The placeholder of the input.\n * @property {boolean} loading - The loading state of the input. Default is false.\n * @property {string} tooltip - The tooltip of the input.\n * @property {'top' | 'right' | 'bottom' | 'left'} tooltipPlacement - The tooltip placement of the input.\n * @property {string} tooltipAriaLabel - The aria label of the tooltip.\n * @property {'click' | 'hover'} tooltipTrigger - How the tooltip opens: `click` (click/Enter, default) or `hover` (hover and keyboard focus).\n * @property {string} feedback - The feedback of the input.\n * @property {'negative' | 'positive' | 'warning'} feedbackType - The feedback type of the input. Can be `negative`, `positive`, or `warning`.\n * @property {'succes' | 'error'} status - The status of the input. Can be `success` or `error`.\n * @property {'xs' | 'sm' | 'lg'} size - The size of the input. Default is `sm`.\n * @property {string} sizeMap - Responsive size map (e.g. \"xs:lg\").\n * @property {string} name - The name of the input.\n * @property {'text' | 'number' | 'button' | 'color' | 'email' | 'hidden' | 'reset' | 'submit' | 'url' | 'password'| 'file' | 'time'} type - The type of the input. Default is 'text'.\n * @property {boolean} disabled - The disabled state of the input. Default is false.\n * @property {boolean} required - The required state of the input. Default is false.\n * @property {boolean} readonly - The readonly state of the input. Default is false.\n * @property {boolean} autofocus - The autofocus state of the input. Default is false.\n * @property {boolean} autocapitalize - The autocapitalize state of the input. Default is false.\n * @property {number} minlength - The minimum length of the input.\n * @property {number} maxlength - The maximum length of the input.\n * @property {number} min - The minimum value of the number input.\n * @property {number} max - The maximum value of the number input.\n * @property {number} step - The step value of the number input.\n * @property {string} inputmode - The inputmode of the input.\n * @property {string} pattern - The regex pattern of the input.\n *\n * @cssproperty --dds-input-height-xs - The height of the extra small input. (default: var(--dds-spacing-800)).\n * @cssproperty --dds-input-height-sm - The height of the small input. (default: var(--dds-spacing-1000)).\n * @cssproperty --dds-input-height-lg - The height of the large input. (default: var(--dds-spacing-1200)).\n * @cssproperty --dds-input-padding-xs - The padding of the extra small input. (default: 0 var(--dds-spacing-200)).\n * @cssproperty --dds-input-padding-sm - The padding of the small input. (default: 0 var(--dds-spacing-300)).\n * @cssproperty --dds-input-padding-lg - The padding of the large input. (default: 0 var(--dds-spacing-400)).\n * @cssproperty --dds-input-font-size-xs - The font size of the extra small input. (default: var(--dds-font-sm)).\n * @cssproperty --dds-input-font-size-sm - The font size of the small input. (default: var(--dds-font-base)).\n * @cssproperty --dds-input-font-size-lg - The font size of the large input. (default: var(--dds-font-lg)).\n * @cssproperty --dds-input-border - The border of the input. (default: var(--dds-border-width-base) solid var(--dds-border-neutral-base)).\n * @cssproperty --dds-input-background - The background color of the input. (default: var(--dds-fields-background-default)).\n * @cssproperty --dds-input-text-color - The text color of the input. (default: var(--dds-text-neutral-base)).\n * @cssproperty --dds-input-border-radius - The border radius of the input. (default: var(--dds-radius-base)).\n * @cssproperty --dds-input-disabled-border - The border of the disabled input. (default: 0 solid var(--dds-border-neutral-disabled)).\n * @cssproperty --dds-input-disabled-background - The background color of the disabled input. (default: var(--dds-fields-background-disabled)).\n * @cssproperty --dds-input-disabled-text - The text color of the disabled input. (default: var(--dds-text-neutral-disabled)).\n * @cssproperty --dds-input-readonly-border - The border of the readonly input. (default: 0 solid var(--dds-border-neutral-subtle)).\n * @cssproperty --dds-input-readonly-background - The background color of the readonly input. (default: var(--dds-fields-background-read-only)).\n * @cssproperty --dds-input-readonly-text - The text color of the readonly input. (default: var(--dds-text-neutral-subtle)).\n * @cssproperty --dds-input-success-border - The border of the success input. (default: var(--dds-border-width-base) solid var(--dds-border-positive-base)).\n * @cssproperty --dds-input-error-border - The border of the error input. (default: var(--dds-border-width-base) solid var(--dds-border-negative-base)).\n * @cssproperty --dds-input-addon-background - The background color of the input addon. (default: var(--dds-fields-background-default)).\n * @cssproperty --dds-input-addon-success-background - The background color of the success input addon. (default: var(--dds-fields-background-default)).\n * @cssproperty --dds-input-addon-error-background - The background color of the error input addon. (default: var(--dds-fields-background-default)).\n * @cssproperty --dds-input-addon-border-before - The border of the addon before the input. (default: var(--dds-border-width-base) solid var(--dds-border-neutral-base)).\n * @cssproperty --dds-input-addon-border-after - The border of the addon after the input. (default: var(--dds-border-width-base) solid var(--dds-border-neutral-base)).\n * @cssproperty --dds-input-addon-border-width-before - The border width of the addon before the input. (default: var(--dds-border-width-base) 0 var(--dds-border-width-base) var(--dds-border-width-base)).\n * @cssproperty --dds-input-addon-border-width-after - The border width of the addon after the input. (default: var(--dds-border-width-base) var(--dds-border-width-base) var(--dds-border-width-base) 0).\n * @cssproperty --dds-input-addon-success-border - The border of the success addon. (default: var(--dds-border-width-base) solid var(--dds-border-positive-base)).\n * @cssproperty --dds-input-addon-success-border-before - The border of the success addon before the input. (default: var(--dds-border-width-base) solid var(--dds-border-positive-base)).\n * @cssproperty --dds-input-addon-success-border-after - The border of the success addon after the input. (default: var(--dds-border-width-base) solid var(--dds-border-positive-base)).\n * @cssproperty --dds-input-addon-success-border-width-before - The border width of the success addon before the input. (default: var(--dds-border-width-base) 0 var(--dds-border-width-base) var(--dds-border-width-base)).\n * @cssproperty --dds-input-addon-success-border-width-after - The border width of the success addon after the input. (default: var(--dds-border-width-base) var(--dds-border-width-base) var(--dds-border-width-base) 0).\n * @cssproperty --dds-input-addon-error-border-before - The border of the error addon before the input. (default: var(--dds-border-width-base) solid var(--dds-border-negative-base)).\n * @cssproperty --dds-input-addon-error-border-after - The border of the error addon after the input. (default: var(--dds-border-width-base) solid var(--dds-border-negative-base)).\n * @cssproperty --dds-input-addon-error-border-width-before - The border width of the error addon before the input. (default: var(--dds-border-width-base) 0 var(--dds-border-width-base) var(--dds-border-width-base)).\n * @cssproperty --dds-input-addon-error-border-width-after - The border width of the error addon after the input. (default: var(--dds-border-width-base) var(--dds-border-width-base) var(--dds-border-width-base) 0).\n *\n * @event {{ value: string }} dds-change - Fired when the input value changes.\n * @event {{ value: string }} dds-input - Fired when the input value changes.\n * @event {{ value: string, originalEvent: Event }} dds-keydown - Fired when a key is pressed down.\n * @event {{ void }} dds-blur - Fired when the input loses focus.\n * @event {{ void }} dds-focus - Emitted when the input gains focus.\n *\n * @slot postfix - The postfix of the input.\n * @slot prefix - The prefix of the input.\n * @slot addon-before - The addon before the input.\n * @slot addon-after - The addon after the input.\n * @slot feedback-icon - The custom icon of the feedback.\n *\n * @csspart base - The main input container.\n * @csspart input - The input element.\n * @csspart label - The label of the input.\n * @csspart description - The description of the input.\n * @csspart feedback - The feedback of the input.\n * @csspart tooltip - The tooltip of the input.\n * @csspart addon-before - The addon before the input.\n * @csspart addon-after - The addon after the input.\n * @csspart prefix - The prefix of the input.\n * @csspart postfix - The postfix of the input.\n *\n */\nexport default class DapDSInput extends InputBaseElement {\n static tagName = 'dap-ds-input'\n\n render() {\n return this.renderInput()\n }\n}\n"],"names":["_DapDSInput","InputBaseElement","DapDSInput"],"mappings":";AAuGA,MAAqBA,IAArB,MAAqBA,UAAmBC,EAAiB;AAAA,EAGvD,SAAS;AACP,WAAO,KAAK,YAAY;AAAA,EAAA;AAE5B;AALED,EAAO,UAAU;AADnB,IAAqBE,IAArBF;"}
|
|
@@ -15,18 +15,18 @@ import "../../node_modules/lit-html/lit-html.js";
|
|
|
15
15
|
import "../../node_modules/lit-element/lit-element.js";
|
|
16
16
|
import { property as d } from "../../node_modules/@lit/reactive-element/decorators/property.js";
|
|
17
17
|
import { state as c } from "../../node_modules/@lit/reactive-element/decorators/state.js";
|
|
18
|
-
import { ifDefined as
|
|
19
|
-
import { unsafeStatic as
|
|
20
|
-
import { scrollIntoContainer as
|
|
18
|
+
import { ifDefined as O } from "../../node_modules/lit-html/directives/if-defined.js";
|
|
19
|
+
import { unsafeStatic as y, html as v } from "../../node_modules/lit-html/static.js";
|
|
20
|
+
import { scrollIntoContainer as I } from "../../common/utils.js";
|
|
21
21
|
import { DdsElement as C } from "../../internal/dds-hu-element.js";
|
|
22
22
|
import { SizedMixin as S } from "../../internal/mixin/sizedMixin.js";
|
|
23
23
|
import A from "../option-item/option-item.component.js";
|
|
24
24
|
import E from "./option-list.scss.js";
|
|
25
25
|
import { unsafeCSS as T } from "../../node_modules/@lit/reactive-element/css-tag.js";
|
|
26
|
-
var
|
|
26
|
+
var w = Object.defineProperty, a = (o, e, t, i) => {
|
|
27
27
|
for (var s = void 0, l = o.length - 1, p; l >= 0; l--)
|
|
28
28
|
(p = o[l]) && (s = p(e, t, s) || s);
|
|
29
|
-
return s &&
|
|
29
|
+
return s && w(e, t, s), s;
|
|
30
30
|
};
|
|
31
31
|
const r = class r extends S(C) {
|
|
32
32
|
constructor() {
|
|
@@ -131,6 +131,10 @@ const r = class r extends S(C) {
|
|
|
131
131
|
this.availableOptions = e, this.optionEls = e;
|
|
132
132
|
}
|
|
133
133
|
handleKeydown(e) {
|
|
134
|
+
if (this.focused = !0, e.key === "Tab" || e.key === "Escape") {
|
|
135
|
+
e.key === "Escape" && (e.preventDefault(), this.emit("dds-cancel")), this.emit("dds-keydown", { key: e.key, code: e.code });
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
134
138
|
e.preventDefault(), this.handleKeyCodes(e.key, e.code);
|
|
135
139
|
}
|
|
136
140
|
scrollToActiveOption() {
|
|
@@ -139,7 +143,7 @@ const r = class r extends S(C) {
|
|
|
139
143
|
const e = this.getAllRenderedOptions().find(
|
|
140
144
|
(t) => t.value === this.currentOption.value
|
|
141
145
|
);
|
|
142
|
-
e &&
|
|
146
|
+
e && I(e);
|
|
143
147
|
}
|
|
144
148
|
handleNavigationKey(e) {
|
|
145
149
|
var t;
|
|
@@ -168,7 +172,7 @@ const r = class r extends S(C) {
|
|
|
168
172
|
}
|
|
169
173
|
}
|
|
170
174
|
handleActionKey(e) {
|
|
171
|
-
e === "
|
|
175
|
+
e === "Enter" && (this.setSelectedOption(this.availableOptions[this.selectedIndex]), this.selectionChanged(this.availableOptions[this.selectedIndex]), this.emit("dds-option-change", h({}, this.getEventDetails(this.currentOption))));
|
|
172
176
|
}
|
|
173
177
|
handleTypeheadKey(e) {
|
|
174
178
|
this.searchMode === "typehead" && ((e == null ? void 0 : e.length) === 1 || e === "Backspace") && this.buildQueryString(e);
|
|
@@ -264,7 +268,7 @@ const r = class r extends S(C) {
|
|
|
264
268
|
}
|
|
265
269
|
}
|
|
266
270
|
render() {
|
|
267
|
-
return
|
|
271
|
+
return v`<div
|
|
268
272
|
part="base"
|
|
269
273
|
class=${g("option-list", {
|
|
270
274
|
"option-list--sm": this.size === "sm",
|
|
@@ -273,7 +277,7 @@ const r = class r extends S(C) {
|
|
|
273
277
|
@keydown=${this.handleKeydown}
|
|
274
278
|
@focus=${this.captureFocus}>
|
|
275
279
|
${this.availableOptions.map(
|
|
276
|
-
(e, t) =>
|
|
280
|
+
(e, t) => v`
|
|
277
281
|
<dap-ds-option-item
|
|
278
282
|
size=${this.size}
|
|
279
283
|
part="option-item"
|
|
@@ -281,15 +285,15 @@ const r = class r extends S(C) {
|
|
|
281
285
|
?disabled=${e.disabled}
|
|
282
286
|
?selected=${this.value === e.value}
|
|
283
287
|
?focused=${t === this.selectedIndex}
|
|
284
|
-
label=${
|
|
288
|
+
label=${O(e.label)}
|
|
285
289
|
role="option"
|
|
286
290
|
value=${e.value}
|
|
287
291
|
tabIndex=${e.tabIndex}
|
|
288
292
|
id=${e.id || `dap-ds-option-${e.value}`}
|
|
289
|
-
data-testid=${
|
|
293
|
+
data-testid=${O(e.dataset.testid || void 0)}
|
|
290
294
|
selectable=${this.selectable}
|
|
291
295
|
@click=${this.handleOptionClick}>
|
|
292
|
-
${
|
|
296
|
+
${y(e.innerHTML)}
|
|
293
297
|
</dap-ds-option-item>
|
|
294
298
|
`
|
|
295
299
|
)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"option-list.component.js","sources":["../../../src/components/option-list/option-list.component.ts"],"sourcesContent":["import clsx from 'clsx'\nimport { PropertyValueMap, unsafeCSS } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { html, unsafeStatic } from 'lit/static-html.js'\n\nimport { scrollIntoContainer } from '@/common/utils'\nimport { DdsElement } from '@/internal/dds-hu-element'\nimport { SizedMixin } from '@/internal/mixin/sizedMixin'\n\nimport DapDSOptionItem from '../option-item/option-item.component'\nimport styles from './option-list.scss?inline'\n\n/**\n * `dap-ds-option-list`\n * @summary An option list is a list of selectable options.\n * @element dap-ds-option-list\n * @title - Option list\n *\n * @event {{ void }} dds-cancel - Fired when the escape key is pressed.\n * @event {{ option: DapDSOptionItem, value: string, index: number, text: string }} dds-option-change - Fired when the option list value changes.\n * @event {{ void }} dds-keydown - Fired when a key is pressed down.\n * @event {{ elements: DapDSOptionItem[] }} dds-list-changed - Fired when the available options list changes.\n *\n * @csspart base - The main option list container.\n * @csspart option-item - The option item of the option list.\n * @csspart popup-base - The base of the popup.\n * @csspart option-item-base - The base of the option item.\n * @csspart option-item-label - The label of the option item.\n * @csspart option-item-prefix - The prefix of the option item.\n * @csspart option-item-suffix - The suffix of the option item.\n *\n * @slot - The default slot for the options.\n */\nexport default class DapDSOptionList extends SizedMixin(DdsElement) {\n static tagName = 'dap-ds-option-list'\n\n static dependencies = {\n 'dap-ds-option-item': DapDSOptionItem,\n }\n\n /** The filter text of the option list */\n @property() filterText = ''\n\n /** The value of the option list */\n @property({ type: String, reflect: true }) value?: string\n\n /** The focused state of the option list. */\n @property({ type: Boolean }) focused = false\n\n /** Whether the option list is searchable */\n @property({ type: Boolean }) search = false\n\n /** The search mode of the option list. Default is `none` */\n @property() searchMode: 'none' | 'typehead' | 'autocomplete' | 'manual' =\n 'none'\n\n /**\n * @ignore\n */\n @property({ type: String }) searchOnValueSet = 'true'\n\n /** Whether the option list items are selectable, whether it shows the selected icon */\n @property({ type: String }) selectable = 'true'\n\n /**\n * @ignore\n */\n @property({ type: Array })\n public options?: any[]\n\n /**\n * @ignore\n */\n @property({ type: Boolean }) disableDelaySet = false\n\n queryTimeout: number | undefined\n queryString = ''\n firstLoad = true\n\n @state()\n private currentOption: any\n\n @state()\n public selectedIndex: number\n\n @state()\n private optionEls: DapDSOptionItem[] = []\n\n @state()\n private availableOptions: DapDSOptionItem[] = []\n\n get isAutoComplete() {\n return this.searchMode === 'autocomplete' || this.searchMode === 'manual'\n }\n\n static readonly styles = unsafeCSS(styles)\n\n protected firstUpdated(\n _changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>,\n ): void {\n super.firstUpdated(_changedProperties)\n\n this.setAttribute('role', 'listbox')\n }\n\n getAllOptions() {\n const mainSlot = this.shadowRoot?.querySelector('slot')\n const assignedElement = mainSlot?.assignedElements()[0]\n const embeddedSlot =\n assignedElement?.nodeName === 'SLOT'\n ? (\n mainSlot?.assignedElements()[0] as HTMLSlotElement\n ).assignedElements()\n : mainSlot?.assignedElements()\n\n if (!embeddedSlot) {\n return [...this.querySelectorAll<DapDSOptionItem>('dap-ds-option-item')]\n } else {\n return [...(embeddedSlot as DapDSOptionItem[])]\n }\n }\n\n private getAllRenderedOptions(): DapDSOptionItem[] {\n const ro =\n this.shadowRoot?.querySelectorAll<DapDSOptionItem>('dap-ds-option-item')\n return ro ? [...ro] : []\n }\n\n getAllAvailabeOptions() {\n return this.availableOptions\n }\n\n getActiveOption() {\n if (!this.currentOption) {\n return null\n }\n\n const activeOption = this.getAllRenderedOptions().find(\n el => el.value === this.currentOption.value,\n )\n\n return activeOption\n }\n\n protected updated(\n _changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>,\n ): void {\n super.updated(_changedProperties)\n\n if (\n _changedProperties.has('value') &&\n !_changedProperties.has('currentOption') &&\n this.searchOnValueSet === 'true'\n ) {\n const option = this.availableOptions.find(\n option => option.value === this.value,\n )\n\n if (option) {\n this.changeOption(option, _changedProperties.get('value'))\n\n this.selectedIndex = this.findIndexByValue(\n this.availableOptions,\n this.value,\n )\n\n this.emit('dds-option-change', {\n ...this.getEventDetails(this.currentOption),\n })\n }\n }\n\n if (\n _changedProperties.has('options') ||\n _changedProperties.has('optionEls')\n ) {\n this.availableOptions = this.options || this.optionEls\n this.emit('dds-list-changed', { elements: this.availableOptions })\n }\n }\n\n protected shouldUpdate(\n _changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>,\n ): boolean {\n if (_changedProperties.has('filterText')) {\n if (\n this.filterText &&\n this.searchMode !== 'none' &&\n this.searchMode !== 'manual'\n ) {\n this.filterAvailableOptions()\n this.selectedIndex = 0\n this.setCurrentOption(this.availableOptions[0], false)\n this.emit('dds-list-changed', { elements: this.availableOptions })\n } else if (this.filterText && this.searchMode === 'manual') {\n if (this.selectedIndex === -1 && this.availableOptions.length > 0) {\n this.selectedIndex = 0\n this.setCurrentOption(this.availableOptions[0], false)\n }\n } else if (this.filterText && this.searchMode === 'none') {\n this.filterAvailableOptions()\n this.selectedIndex = -1\n this.setCurrentOption(null, false)\n this.setSelectedOption()\n this.emit('dds-list-changed', { elements: this.availableOptions })\n } else {\n this.availableOptions = this.options || this.optionEls\n this.selectedIndex = -1\n this.setCurrentOption(null, false)\n this.emit('dds-list-changed', { elements: this.availableOptions })\n }\n }\n\n return super.shouldUpdate(_changedProperties)\n }\n\n public filterAvailableOptions(): void {\n const valueLowerCase = this.filterText.toLowerCase()\n this.availableOptions = (this.options || this.optionEls).filter(item => {\n if (!item.disabled) {\n const itemTextLowerCase = item.optionText.toLowerCase()\n return itemTextLowerCase.startsWith(valueLowerCase)\n }\n })\n }\n\n attributeChangedCallback(name: string, oldValue: any, newValue: any) {\n super.attributeChangedCallback(name, oldValue, newValue)\n if (\n name === 'value' &&\n oldValue !== newValue &&\n this.searchOnValueSet === 'true'\n ) {\n if (newValue) {\n const option = this.availableOptions.find(el => el.value === newValue)\n\n this.setSelectedOption(option)\n this.selectionChanged(option)\n\n this.emit('dds-option-change', {\n ...this.getEventDetails(this.currentOption),\n })\n } else {\n this.setSelectedOption()\n this.selectionChanged()\n }\n }\n }\n\n public setOptionsFromSlottedItems(): void {\n const elements = this.getAllOptions()\n this.availableOptions = elements\n this.optionEls = elements\n }\n\n private handleKeydown(event: KeyboardEvent): void {\n event.preventDefault()\n\n this.handleKeyCodes(event.key, event.code)\n }\n\n private scrollToActiveOption(): void {\n if (!this.currentOption) {\n return\n }\n\n const activeOption = this.getAllRenderedOptions().find(\n el => el.value === this.currentOption.value,\n )\n\n if (activeOption) {\n // Scroll only within the list's own scroll container. A plain\n // scrollIntoView would also scroll every ancestor (modal body, page),\n // pushing the trigger out of the viewport and tripping the popup's\n // viewport auto-close so the dropdown snaps shut on open.\n scrollIntoContainer(activeOption)\n }\n }\n\n private handleNavigationKey(key: string): void {\n if (key === 'ArrowDown') {\n this.selectedIndex = this.findNearestEnabled(\n this.availableOptions,\n this.selectedIndex,\n 1,\n )\n } else if (key === 'ArrowUp') {\n const nearest = this.findNearestEnabled(\n this.availableOptions,\n this.selectedIndex,\n this.selectedIndex === -1 ? 1 : -1,\n )\n this.selectedIndex =\n nearest === this.availableOptions.length ? -1 : nearest\n } else if (key === 'Home') {\n this.selectedIndex = this.availableOptions[0]?.disabled\n ? this.findNearestEnabled(this.availableOptions, -1, 1)\n : 0\n } else if (key === 'End') {\n const nearest = this.findNearestEnabled(\n this.availableOptions,\n this.availableOptions.length,\n -1,\n )\n this.selectedIndex =\n nearest === this.availableOptions.length ? -1 : nearest\n }\n }\n\n private handleActionKey(key: string): void {\n if (key === 'Escape') {\n this.emit('dds-cancel')\n } else if (key === 'Enter') {\n this.setSelectedOption(this.availableOptions[this.selectedIndex])\n this.selectionChanged(this.availableOptions[this.selectedIndex])\n this.emit('dds-option-change', {\n ...this.getEventDetails(this.currentOption),\n })\n }\n }\n\n private handleTypeheadKey(key: string): void {\n if (\n this.searchMode === 'typehead' &&\n (key?.length === 1 || key === 'Backspace')\n ) {\n this.buildQueryString(key)\n }\n }\n\n private handleKeyCodes(key: string, keyCode?: string) {\n if (!this.focused) {\n return\n }\n\n this.handleNavigationKey(key)\n this.handleActionKey(key)\n this.handleTypeheadKey(key)\n\n if (this.selectedIndex >= 0) {\n const option = this.availableOptions[this.selectedIndex]\n this.setCurrentOption(option)\n this.emit('dds-keydown', {\n code: keyCode,\n key,\n ...this.getEventDetails(option),\n })\n }\n }\n\n private getEventDetails(option?: DapDSOptionItem) {\n if (!option) {\n return undefined\n }\n\n let opt = option\n\n if (option.tagName !== 'DAP-DS-OPTION-ITEM') {\n opt = option.closest('dap-ds-option-item')!\n }\n\n return {\n opt,\n value: opt?.value,\n text: opt?.optionText,\n index: this.selectedIndex,\n }\n }\n\n private findNearestEnabled(\n allOptions: DapDSOptionItem[],\n current: number,\n step: number,\n ) {\n let nextIndex: number = current\n let nextOption: DapDSOptionItem\n\n do {\n nextIndex += step\n nextOption = allOptions[nextIndex]\n if (nextOption === undefined) {\n break\n }\n } while (nextOption?.disabled)\n\n return nextOption ? nextIndex : current\n }\n\n private findIndexByValue(\n allOptions: DapDSOptionItem[],\n value?: string,\n ): number {\n return allOptions.findIndex(option => option.value === value)\n }\n\n private clearItemFocusStates() {\n this.availableOptions.forEach(el => {\n el.focused = false\n el.tabIndex = -1\n })\n }\n\n // Only set the current option without selecting it, eg: focus\n private setCurrentOption(option?: DapDSOptionItem | null, setFocus = true) {\n this.clearItemFocusStates()\n\n if (option) {\n this.currentOption = option\n option.focused = true\n option.tabIndex = 0\n\n this.emit('dds-current-change', {\n ...this.getEventDetails(option),\n })\n\n if (setFocus) {\n this.setFocusedOption(option)\n } else {\n this.scrollToActiveOption()\n }\n } else {\n this.currentOption = null\n\n this.emit('dds-current-change', null)\n }\n }\n\n private setFocusedOption(option: DapDSOptionItem) {\n const renderedItem = this.getAllRenderedOptions().find(\n el => el.value === option.value,\n )\n\n if (renderedItem) {\n // preventScroll so native focus doesn't scroll ancestor containers (modal\n // body, page); scrollToActiveOption reveals it within the list instead.\n renderedItem.focus({ preventScroll: true })\n }\n }\n\n private setSelectedOption(option?: DapDSOptionItem | undefined) {\n this.availableOptions.forEach(el => (el.selected = false))\n\n if (option) {\n this.currentOption = option\n\n option.selected = true\n }\n }\n\n private selectionChanged(option?: DapDSOptionItem | undefined, value?: any) {\n const oldValue = value || this.value\n\n if (option) {\n if (option.value !== oldValue) {\n this.value = option.value\n }\n }\n }\n\n private changeOption(option: DapDSOptionItem, value?: any) {\n if (option && !option.disabled) {\n this.selectedIndex = this.findIndexByValue(\n this.availableOptions,\n option.value,\n )\n\n this.setSelectedOption(option)\n this.setCurrentOption(option)\n this.selectionChanged(option, value)\n }\n }\n\n private readonly handleOptionClick = (event: MouseEvent) => {\n this.focused = true\n const option = event.target as DapDSOptionItem\n\n if (option && !option.disabled) {\n const isModifierKeyPressed = event.ctrlKey || event.metaKey\n const isAlreadySelected = option.selected\n\n if (isModifierKeyPressed && isAlreadySelected) {\n // Find the empty item (with \"empty\" attribute) to select automatically\n const emptyItem = this.availableOptions.find(opt =>\n opt.hasAttribute('empty'),\n )\n\n if (emptyItem) {\n // Select the empty item automatically\n this.setSelectedOption(emptyItem)\n this.setCurrentOption(emptyItem)\n this.value = emptyItem.value\n this.selectedIndex = this.findIndexByValue(\n this.availableOptions,\n emptyItem.value,\n )\n\n this.emit('dds-option-change', {\n ...this.getEventDetails(emptyItem),\n })\n } else {\n // Fallback to original behavior if no empty item found\n this.setSelectedOption(undefined)\n this.setCurrentOption(null)\n this.value = undefined\n this.selectedIndex = -1\n\n this.emit('dds-option-deselect', {\n option: option,\n value: undefined,\n index: -1,\n text: option.optionText,\n })\n }\n\n return\n }\n\n this.setCurrentOption(option)\n this.setSelectedOption(option)\n this.selectionChanged(option)\n\n this.updateComplete.then(() => {\n this.selectedIndex = this.findIndexByValue(\n this.availableOptions,\n this.value,\n )\n\n if (!this.disableDelaySet) {\n this.emit('dds-option-change', {\n ...this.getEventDetails(this.currentOption),\n })\n }\n })\n } else {\n event.preventDefault()\n event.stopPropagation()\n }\n }\n\n getSearchString = (char: string) => {\n if (typeof this.queryTimeout === 'number') {\n window.clearTimeout(this.queryTimeout)\n }\n\n this.queryTimeout = window.setTimeout(() => {\n this.queryString = ''\n }, 500)\n\n this.queryString += char\n return this.queryString\n }\n\n buildQueryString = (char: string) => {\n const queryString = this.getSearchString(char)\n\n for (const option of this.availableOptions) {\n const label = option.optionText.toLowerCase()\n\n if (label.startsWith(queryString.toLowerCase())) {\n this.selectedIndex = this.findIndexByValue(\n this.availableOptions,\n option.value,\n )\n this.setCurrentOption(option)\n break\n }\n }\n }\n\n private handleInitialFocus(): void {\n if (!this.value && this.selectedIndex < 0) {\n this.selectedIndex = 0\n } else {\n const index = this.value\n ? this.findIndexByValue(this.availableOptions, this.value)\n : this.selectedIndex\n\n if (index !== -1 && !this.isAutoComplete) {\n this.selectedIndex = index\n this.setCurrentOption(this.availableOptions[this.selectedIndex])\n this.setSelectedOption(this.availableOptions[this.selectedIndex])\n if (this.value) {\n this.selectionChanged(this.availableOptions[this.selectedIndex])\n }\n }\n }\n\n if (!this.selectedIndex) {\n this.setCurrentOption(this.availableOptions[0])\n this.setSelectedOption(this.availableOptions[0])\n }\n }\n\n private handleKeyFocus(key: string): void {\n if (this.isAutoComplete || this.searchMode === 'none') {\n this.handleKeyCodes(key)\n this.setCurrentOption(this.availableOptions[this.selectedIndex], false)\n this.setSelectedOption(this.availableOptions[this.selectedIndex])\n }\n\n if (this.searchMode === 'typehead') {\n this.buildQueryString(key)\n }\n }\n\n public captureFocus(key?: string): void {\n this.focused = true\n this.focus()\n\n if (!key) {\n this.handleInitialFocus()\n } else {\n this.handleKeyFocus(key)\n }\n\n // The popup constrains its scroll container's max-height via floating-ui one\n // animation frame after opening. At this point that constraint isn't applied\n // yet (clientHeight === scrollHeight), so the container isn't scrollable and\n // both native focus() scrolling and scrollIntoView are no-ops. Defer the\n // scroll to the next frame so the selected option is actually revealed.\n if (typeof requestAnimationFrame === 'function') {\n requestAnimationFrame(() => this.scrollToActiveOption())\n }\n }\n\n public removeFocus(): void {\n this.focused = false\n this.clearItemFocusStates()\n }\n\n private handleSlotChange() {\n const allOptions = this.getAllOptions()\n this.setOptionsFromSlottedItems()\n\n if (allOptions.length > 0 && this.searchOnValueSet === 'true') {\n const option = allOptions.find(el => el.value === this.value)\n this.setSelectedOption(option)\n this.selectionChanged(option)\n\n if (this.currentOption) {\n this.selectedIndex = this.findIndexByValue(allOptions, this.value)\n this.emit('dds-option-change', {\n ...this.getEventDetails(this.currentOption),\n })\n }\n } else if (allOptions.length > 0 && !this.search && !this.isAutoComplete) {\n const firstOption = allOptions.find(option => !option.disabled)\n this.selectedIndex = 0\n this.setCurrentOption(firstOption, false)\n\n this.emit('dds-current-change', {\n ...this.getEventDetails(firstOption),\n })\n } else if (allOptions.length > 0 && (this.search || this.isAutoComplete)) {\n const firstOption = allOptions.find(option => !option.disabled)\n\n if (\n !this.currentOption ||\n this.currentOption.value !== firstOption?.value\n ) {\n this.selectedIndex = 0\n this.setCurrentOption(firstOption, false)\n }\n }\n }\n\n render() {\n return html`<div\n part=\"base\"\n class=${clsx('option-list', {\n 'option-list--sm': this.size === 'sm',\n 'option-list--lg': this.size === 'lg',\n })}\n @keydown=${this.handleKeydown}\n @focus=${this.captureFocus}>\n ${this.availableOptions.map(\n (option, index) => html`\n <dap-ds-option-item\n size=${this.size}\n part=\"option-item\"\n exportparts=\"base: option-item-base, label: option-item-label, prefix: option-item-prefix, suffix: option-item-suffix\"\n ?disabled=${option.disabled}\n ?selected=${this.value === option.value}\n ?focused=${index === this.selectedIndex}\n label=${ifDefined(option.label)}\n role=\"option\"\n value=${option.value}\n tabIndex=${option.tabIndex}\n id=${option.id || `dap-ds-option-${option.value}`}\n data-testid=${ifDefined(option.dataset.testid || undefined)}\n selectable=${this.selectable}\n @click=${this.handleOptionClick}>\n ${unsafeStatic(option.innerHTML)}\n </dap-ds-option-item>\n `,\n )}\n <slot hidden @slotchange=${this.handleSlotChange}></slot>\n </div> `\n }\n}\n"],"names":["_DapDSOptionList","SizedMixin","DdsElement","event","option","isModifierKeyPressed","isAlreadySelected","emptyItem","opt","__spreadValues","char","queryString","_changedProperties","mainSlot","_a","assignedElement","embeddedSlot","ro","el","valueLowerCase","item","name","oldValue","newValue","elements","activeOption","scrollIntoContainer","key","nearest","keyCode","allOptions","current","step","nextIndex","nextOption","value","setFocus","renderedItem","index","firstOption","html","clsx","ifDefined","unsafeStatic","DapDSOptionItem","unsafeCSS","styles","DapDSOptionList","__decorateClass","property","state"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCqB,MAAAA,IAAA,MAAAA,UAAwBC,EAAWC,CAAU,EAAE;AAAA,EAApE,cAAA;AAAA,UAAA,GAAA,SAAA,GAQ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AkDZ,WAAA,eAAA;AAGCC,EAAA;AAAA,EADPE,EAAM;AAAA,GApDYH,EAqDX,WAAA,WAAA;AAGAC,EAAA;AAAA,EADPE,EAAM;AAAA,GAvDYH,EAwDX,WAAA,kBAAA;"}
|
|
1
|
+
{"version":3,"file":"option-list.component.js","sources":["../../../src/components/option-list/option-list.component.ts"],"sourcesContent":["import clsx from 'clsx'\nimport { PropertyValueMap, unsafeCSS } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { html, unsafeStatic } from 'lit/static-html.js'\n\nimport { scrollIntoContainer } from '@/common/utils'\nimport { DdsElement } from '@/internal/dds-hu-element'\nimport { SizedMixin } from '@/internal/mixin/sizedMixin'\n\nimport DapDSOptionItem from '../option-item/option-item.component'\nimport styles from './option-list.scss?inline'\n\n/**\n * `dap-ds-option-list`\n * @summary An option list is a list of selectable options.\n * @element dap-ds-option-list\n * @title - Option list\n *\n * @event {{ void }} dds-cancel - Fired when the escape key is pressed.\n * @event {{ option: DapDSOptionItem, value: string, index: number, text: string }} dds-option-change - Fired when the option list value changes.\n * @event {{ void }} dds-keydown - Fired when a key is pressed down.\n * @event {{ elements: DapDSOptionItem[] }} dds-list-changed - Fired when the available options list changes.\n *\n * @csspart base - The main option list container.\n * @csspart option-item - The option item of the option list.\n * @csspart popup-base - The base of the popup.\n * @csspart option-item-base - The base of the option item.\n * @csspart option-item-label - The label of the option item.\n * @csspart option-item-prefix - The prefix of the option item.\n * @csspart option-item-suffix - The suffix of the option item.\n *\n * @slot - The default slot for the options.\n */\nexport default class DapDSOptionList extends SizedMixin(DdsElement) {\n static tagName = 'dap-ds-option-list'\n\n static dependencies = {\n 'dap-ds-option-item': DapDSOptionItem,\n }\n\n /** The filter text of the option list */\n @property() filterText = ''\n\n /** The value of the option list */\n @property({ type: String, reflect: true }) value?: string\n\n /** The focused state of the option list. */\n @property({ type: Boolean }) focused = false\n\n /** Whether the option list is searchable */\n @property({ type: Boolean }) search = false\n\n /** The search mode of the option list. Default is `none` */\n @property() searchMode: 'none' | 'typehead' | 'autocomplete' | 'manual' =\n 'none'\n\n /**\n * @ignore\n */\n @property({ type: String }) searchOnValueSet = 'true'\n\n /** Whether the option list items are selectable, whether it shows the selected icon */\n @property({ type: String }) selectable = 'true'\n\n /**\n * @ignore\n */\n @property({ type: Array })\n public options?: any[]\n\n /**\n * @ignore\n */\n @property({ type: Boolean }) disableDelaySet = false\n\n queryTimeout: number | undefined\n queryString = ''\n firstLoad = true\n\n @state()\n private currentOption: any\n\n @state()\n public selectedIndex: number\n\n @state()\n private optionEls: DapDSOptionItem[] = []\n\n @state()\n private availableOptions: DapDSOptionItem[] = []\n\n get isAutoComplete() {\n return this.searchMode === 'autocomplete' || this.searchMode === 'manual'\n }\n\n static readonly styles = unsafeCSS(styles)\n\n protected firstUpdated(\n _changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>,\n ): void {\n super.firstUpdated(_changedProperties)\n\n this.setAttribute('role', 'listbox')\n }\n\n getAllOptions() {\n const mainSlot = this.shadowRoot?.querySelector('slot')\n const assignedElement = mainSlot?.assignedElements()[0]\n const embeddedSlot =\n assignedElement?.nodeName === 'SLOT'\n ? (\n mainSlot?.assignedElements()[0] as HTMLSlotElement\n ).assignedElements()\n : mainSlot?.assignedElements()\n\n if (!embeddedSlot) {\n return [...this.querySelectorAll<DapDSOptionItem>('dap-ds-option-item')]\n } else {\n return [...(embeddedSlot as DapDSOptionItem[])]\n }\n }\n\n private getAllRenderedOptions(): DapDSOptionItem[] {\n const ro =\n this.shadowRoot?.querySelectorAll<DapDSOptionItem>('dap-ds-option-item')\n return ro ? [...ro] : []\n }\n\n getAllAvailabeOptions() {\n return this.availableOptions\n }\n\n getActiveOption() {\n if (!this.currentOption) {\n return null\n }\n\n const activeOption = this.getAllRenderedOptions().find(\n el => el.value === this.currentOption.value,\n )\n\n return activeOption\n }\n\n protected updated(\n _changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>,\n ): void {\n super.updated(_changedProperties)\n\n if (\n _changedProperties.has('value') &&\n !_changedProperties.has('currentOption') &&\n this.searchOnValueSet === 'true'\n ) {\n const option = this.availableOptions.find(\n option => option.value === this.value,\n )\n\n if (option) {\n this.changeOption(option, _changedProperties.get('value'))\n\n this.selectedIndex = this.findIndexByValue(\n this.availableOptions,\n this.value,\n )\n\n this.emit('dds-option-change', {\n ...this.getEventDetails(this.currentOption),\n })\n }\n }\n\n if (\n _changedProperties.has('options') ||\n _changedProperties.has('optionEls')\n ) {\n this.availableOptions = this.options || this.optionEls\n this.emit('dds-list-changed', { elements: this.availableOptions })\n }\n }\n\n protected shouldUpdate(\n _changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>,\n ): boolean {\n if (_changedProperties.has('filterText')) {\n if (\n this.filterText &&\n this.searchMode !== 'none' &&\n this.searchMode !== 'manual'\n ) {\n this.filterAvailableOptions()\n this.selectedIndex = 0\n this.setCurrentOption(this.availableOptions[0], false)\n this.emit('dds-list-changed', { elements: this.availableOptions })\n } else if (this.filterText && this.searchMode === 'manual') {\n if (this.selectedIndex === -1 && this.availableOptions.length > 0) {\n this.selectedIndex = 0\n this.setCurrentOption(this.availableOptions[0], false)\n }\n } else if (this.filterText && this.searchMode === 'none') {\n this.filterAvailableOptions()\n this.selectedIndex = -1\n this.setCurrentOption(null, false)\n this.setSelectedOption()\n this.emit('dds-list-changed', { elements: this.availableOptions })\n } else {\n this.availableOptions = this.options || this.optionEls\n this.selectedIndex = -1\n this.setCurrentOption(null, false)\n this.emit('dds-list-changed', { elements: this.availableOptions })\n }\n }\n\n return super.shouldUpdate(_changedProperties)\n }\n\n public filterAvailableOptions(): void {\n const valueLowerCase = this.filterText.toLowerCase()\n this.availableOptions = (this.options || this.optionEls).filter(item => {\n if (!item.disabled) {\n const itemTextLowerCase = item.optionText.toLowerCase()\n return itemTextLowerCase.startsWith(valueLowerCase)\n }\n })\n }\n\n attributeChangedCallback(name: string, oldValue: any, newValue: any) {\n super.attributeChangedCallback(name, oldValue, newValue)\n if (\n name === 'value' &&\n oldValue !== newValue &&\n this.searchOnValueSet === 'true'\n ) {\n if (newValue) {\n const option = this.availableOptions.find(el => el.value === newValue)\n\n this.setSelectedOption(option)\n this.selectionChanged(option)\n\n this.emit('dds-option-change', {\n ...this.getEventDetails(this.currentOption),\n })\n } else {\n this.setSelectedOption()\n this.selectionChanged()\n }\n }\n }\n\n public setOptionsFromSlottedItems(): void {\n const elements = this.getAllOptions()\n this.availableOptions = elements\n this.optionEls = elements\n }\n\n private handleKeydown(event: KeyboardEvent): void {\n // Keydown only reaches the list while focus is inside it. Focus can arrive\n // via Tab (not captureFocus), so mark the list focused or every key is ignored.\n this.focused = true\n\n // Tab and Escape must always work so keyboard users can leave the list\n // (WCAG 2.1.2). Tab keeps its native behaviour; the host closes the popup.\n if (event.key === 'Tab' || event.key === 'Escape') {\n if (event.key === 'Escape') {\n event.preventDefault()\n this.emit('dds-cancel')\n }\n this.emit('dds-keydown', { key: event.key, code: event.code })\n return\n }\n\n event.preventDefault()\n\n this.handleKeyCodes(event.key, event.code)\n }\n\n private scrollToActiveOption(): void {\n if (!this.currentOption) {\n return\n }\n\n const activeOption = this.getAllRenderedOptions().find(\n el => el.value === this.currentOption.value,\n )\n\n if (activeOption) {\n // Scroll only within the list's own scroll container. A plain\n // scrollIntoView would also scroll every ancestor (modal body, page),\n // pushing the trigger out of the viewport and tripping the popup's\n // viewport auto-close so the dropdown snaps shut on open.\n scrollIntoContainer(activeOption)\n }\n }\n\n private handleNavigationKey(key: string): void {\n if (key === 'ArrowDown') {\n this.selectedIndex = this.findNearestEnabled(\n this.availableOptions,\n this.selectedIndex,\n 1,\n )\n } else if (key === 'ArrowUp') {\n const nearest = this.findNearestEnabled(\n this.availableOptions,\n this.selectedIndex,\n this.selectedIndex === -1 ? 1 : -1,\n )\n this.selectedIndex =\n nearest === this.availableOptions.length ? -1 : nearest\n } else if (key === 'Home') {\n this.selectedIndex = this.availableOptions[0]?.disabled\n ? this.findNearestEnabled(this.availableOptions, -1, 1)\n : 0\n } else if (key === 'End') {\n const nearest = this.findNearestEnabled(\n this.availableOptions,\n this.availableOptions.length,\n -1,\n )\n this.selectedIndex =\n nearest === this.availableOptions.length ? -1 : nearest\n }\n }\n\n private handleActionKey(key: string): void {\n if (key === 'Enter') {\n this.setSelectedOption(this.availableOptions[this.selectedIndex])\n this.selectionChanged(this.availableOptions[this.selectedIndex])\n this.emit('dds-option-change', {\n ...this.getEventDetails(this.currentOption),\n })\n }\n }\n\n private handleTypeheadKey(key: string): void {\n if (\n this.searchMode === 'typehead' &&\n (key?.length === 1 || key === 'Backspace')\n ) {\n this.buildQueryString(key)\n }\n }\n\n private handleKeyCodes(key: string, keyCode?: string) {\n if (!this.focused) {\n return\n }\n\n this.handleNavigationKey(key)\n this.handleActionKey(key)\n this.handleTypeheadKey(key)\n\n if (this.selectedIndex >= 0) {\n const option = this.availableOptions[this.selectedIndex]\n this.setCurrentOption(option)\n this.emit('dds-keydown', {\n code: keyCode,\n key,\n ...this.getEventDetails(option),\n })\n }\n }\n\n private getEventDetails(option?: DapDSOptionItem) {\n if (!option) {\n return undefined\n }\n\n let opt = option\n\n if (option.tagName !== 'DAP-DS-OPTION-ITEM') {\n opt = option.closest('dap-ds-option-item')!\n }\n\n return {\n opt,\n value: opt?.value,\n text: opt?.optionText,\n index: this.selectedIndex,\n }\n }\n\n private findNearestEnabled(\n allOptions: DapDSOptionItem[],\n current: number,\n step: number,\n ) {\n let nextIndex: number = current\n let nextOption: DapDSOptionItem\n\n do {\n nextIndex += step\n nextOption = allOptions[nextIndex]\n if (nextOption === undefined) {\n break\n }\n } while (nextOption?.disabled)\n\n return nextOption ? nextIndex : current\n }\n\n private findIndexByValue(\n allOptions: DapDSOptionItem[],\n value?: string,\n ): number {\n return allOptions.findIndex(option => option.value === value)\n }\n\n private clearItemFocusStates() {\n this.availableOptions.forEach(el => {\n el.focused = false\n el.tabIndex = -1\n })\n }\n\n // Only set the current option without selecting it, eg: focus\n private setCurrentOption(option?: DapDSOptionItem | null, setFocus = true) {\n this.clearItemFocusStates()\n\n if (option) {\n this.currentOption = option\n option.focused = true\n option.tabIndex = 0\n\n this.emit('dds-current-change', {\n ...this.getEventDetails(option),\n })\n\n if (setFocus) {\n this.setFocusedOption(option)\n } else {\n this.scrollToActiveOption()\n }\n } else {\n this.currentOption = null\n\n this.emit('dds-current-change', null)\n }\n }\n\n private setFocusedOption(option: DapDSOptionItem) {\n const renderedItem = this.getAllRenderedOptions().find(\n el => el.value === option.value,\n )\n\n if (renderedItem) {\n // preventScroll so native focus doesn't scroll ancestor containers (modal\n // body, page); scrollToActiveOption reveals it within the list instead.\n renderedItem.focus({ preventScroll: true })\n }\n }\n\n private setSelectedOption(option?: DapDSOptionItem | undefined) {\n this.availableOptions.forEach(el => (el.selected = false))\n\n if (option) {\n this.currentOption = option\n\n option.selected = true\n }\n }\n\n private selectionChanged(option?: DapDSOptionItem | undefined, value?: any) {\n const oldValue = value || this.value\n\n if (option) {\n if (option.value !== oldValue) {\n this.value = option.value\n }\n }\n }\n\n private changeOption(option: DapDSOptionItem, value?: any) {\n if (option && !option.disabled) {\n this.selectedIndex = this.findIndexByValue(\n this.availableOptions,\n option.value,\n )\n\n this.setSelectedOption(option)\n this.setCurrentOption(option)\n this.selectionChanged(option, value)\n }\n }\n\n private readonly handleOptionClick = (event: MouseEvent) => {\n this.focused = true\n const option = event.target as DapDSOptionItem\n\n if (option && !option.disabled) {\n const isModifierKeyPressed = event.ctrlKey || event.metaKey\n const isAlreadySelected = option.selected\n\n if (isModifierKeyPressed && isAlreadySelected) {\n // Find the empty item (with \"empty\" attribute) to select automatically\n const emptyItem = this.availableOptions.find(opt =>\n opt.hasAttribute('empty'),\n )\n\n if (emptyItem) {\n // Select the empty item automatically\n this.setSelectedOption(emptyItem)\n this.setCurrentOption(emptyItem)\n this.value = emptyItem.value\n this.selectedIndex = this.findIndexByValue(\n this.availableOptions,\n emptyItem.value,\n )\n\n this.emit('dds-option-change', {\n ...this.getEventDetails(emptyItem),\n })\n } else {\n // Fallback to original behavior if no empty item found\n this.setSelectedOption(undefined)\n this.setCurrentOption(null)\n this.value = undefined\n this.selectedIndex = -1\n\n this.emit('dds-option-deselect', {\n option: option,\n value: undefined,\n index: -1,\n text: option.optionText,\n })\n }\n\n return\n }\n\n this.setCurrentOption(option)\n this.setSelectedOption(option)\n this.selectionChanged(option)\n\n this.updateComplete.then(() => {\n this.selectedIndex = this.findIndexByValue(\n this.availableOptions,\n this.value,\n )\n\n if (!this.disableDelaySet) {\n this.emit('dds-option-change', {\n ...this.getEventDetails(this.currentOption),\n })\n }\n })\n } else {\n event.preventDefault()\n event.stopPropagation()\n }\n }\n\n getSearchString = (char: string) => {\n if (typeof this.queryTimeout === 'number') {\n window.clearTimeout(this.queryTimeout)\n }\n\n this.queryTimeout = window.setTimeout(() => {\n this.queryString = ''\n }, 500)\n\n this.queryString += char\n return this.queryString\n }\n\n buildQueryString = (char: string) => {\n const queryString = this.getSearchString(char)\n\n for (const option of this.availableOptions) {\n const label = option.optionText.toLowerCase()\n\n if (label.startsWith(queryString.toLowerCase())) {\n this.selectedIndex = this.findIndexByValue(\n this.availableOptions,\n option.value,\n )\n this.setCurrentOption(option)\n break\n }\n }\n }\n\n private handleInitialFocus(): void {\n if (!this.value && this.selectedIndex < 0) {\n this.selectedIndex = 0\n } else {\n const index = this.value\n ? this.findIndexByValue(this.availableOptions, this.value)\n : this.selectedIndex\n\n if (index !== -1 && !this.isAutoComplete) {\n this.selectedIndex = index\n this.setCurrentOption(this.availableOptions[this.selectedIndex])\n this.setSelectedOption(this.availableOptions[this.selectedIndex])\n if (this.value) {\n this.selectionChanged(this.availableOptions[this.selectedIndex])\n }\n }\n }\n\n if (!this.selectedIndex) {\n this.setCurrentOption(this.availableOptions[0])\n this.setSelectedOption(this.availableOptions[0])\n }\n }\n\n private handleKeyFocus(key: string): void {\n if (this.isAutoComplete || this.searchMode === 'none') {\n this.handleKeyCodes(key)\n this.setCurrentOption(this.availableOptions[this.selectedIndex], false)\n this.setSelectedOption(this.availableOptions[this.selectedIndex])\n }\n\n if (this.searchMode === 'typehead') {\n this.buildQueryString(key)\n }\n }\n\n public captureFocus(key?: string): void {\n this.focused = true\n this.focus()\n\n if (!key) {\n this.handleInitialFocus()\n } else {\n this.handleKeyFocus(key)\n }\n\n // The popup constrains its scroll container's max-height via floating-ui one\n // animation frame after opening. At this point that constraint isn't applied\n // yet (clientHeight === scrollHeight), so the container isn't scrollable and\n // both native focus() scrolling and scrollIntoView are no-ops. Defer the\n // scroll to the next frame so the selected option is actually revealed.\n if (typeof requestAnimationFrame === 'function') {\n requestAnimationFrame(() => this.scrollToActiveOption())\n }\n }\n\n public removeFocus(): void {\n this.focused = false\n this.clearItemFocusStates()\n }\n\n private handleSlotChange() {\n const allOptions = this.getAllOptions()\n this.setOptionsFromSlottedItems()\n\n if (allOptions.length > 0 && this.searchOnValueSet === 'true') {\n const option = allOptions.find(el => el.value === this.value)\n this.setSelectedOption(option)\n this.selectionChanged(option)\n\n if (this.currentOption) {\n this.selectedIndex = this.findIndexByValue(allOptions, this.value)\n this.emit('dds-option-change', {\n ...this.getEventDetails(this.currentOption),\n })\n }\n } else if (allOptions.length > 0 && !this.search && !this.isAutoComplete) {\n const firstOption = allOptions.find(option => !option.disabled)\n this.selectedIndex = 0\n this.setCurrentOption(firstOption, false)\n\n this.emit('dds-current-change', {\n ...this.getEventDetails(firstOption),\n })\n } else if (allOptions.length > 0 && (this.search || this.isAutoComplete)) {\n const firstOption = allOptions.find(option => !option.disabled)\n\n if (\n !this.currentOption ||\n this.currentOption.value !== firstOption?.value\n ) {\n this.selectedIndex = 0\n this.setCurrentOption(firstOption, false)\n }\n }\n }\n\n render() {\n return html`<div\n part=\"base\"\n class=${clsx('option-list', {\n 'option-list--sm': this.size === 'sm',\n 'option-list--lg': this.size === 'lg',\n })}\n @keydown=${this.handleKeydown}\n @focus=${this.captureFocus}>\n ${this.availableOptions.map(\n (option, index) => html`\n <dap-ds-option-item\n size=${this.size}\n part=\"option-item\"\n exportparts=\"base: option-item-base, label: option-item-label, prefix: option-item-prefix, suffix: option-item-suffix\"\n ?disabled=${option.disabled}\n ?selected=${this.value === option.value}\n ?focused=${index === this.selectedIndex}\n label=${ifDefined(option.label)}\n role=\"option\"\n value=${option.value}\n tabIndex=${option.tabIndex}\n id=${option.id || `dap-ds-option-${option.value}`}\n data-testid=${ifDefined(option.dataset.testid || undefined)}\n selectable=${this.selectable}\n @click=${this.handleOptionClick}>\n ${unsafeStatic(option.innerHTML)}\n </dap-ds-option-item>\n `,\n )}\n <slot hidden @slotchange=${this.handleSlotChange}></slot>\n </div> `\n }\n}\n"],"names":["_DapDSOptionList","SizedMixin","DdsElement","event","option","isModifierKeyPressed","isAlreadySelected","emptyItem","opt","__spreadValues","char","queryString","_changedProperties","mainSlot","_a","assignedElement","embeddedSlot","ro","el","valueLowerCase","item","name","oldValue","newValue","elements","activeOption","scrollIntoContainer","key","nearest","keyCode","allOptions","current","step","nextIndex","nextOption","value","setFocus","renderedItem","index","firstOption","html","clsx","ifDefined","unsafeStatic","DapDSOptionItem","unsafeCSS","styles","DapDSOptionList","__decorateClass","property","state"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCqB,MAAAA,IAAA,MAAAA,UAAwBC,EAAWC,CAAU,EAAE;AAAA,EAApE,cAAA;AAAA,UAAA,GAAA,SAAA,GAQ2B,KAAA,aAAA,IAMc,KAAA,UAAA,IAGD,KAAA,SAAA,IAIpC,KAAA,aAAA,QAK6C,KAAA,mBAAA,QAGN,KAAA,aAAA,QAWM,KAAA,kBAAA,IAGjC,KAAA,cAAA,IACF,KAAA,YAAA,IASZ,KAAQ,YAA+B,CAAC,GAGxC,KAAQ,mBAAsC,CAAC,GA4Y9B,KAAA,oBAAoB,CAACC,MAAsB;AAC1D,WAAK,UAAU;AACf,YAAMC,IAASD,EAAM;AAEjB,UAAAC,KAAU,CAACA,EAAO,UAAU;AACxB,c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