@crowdstrike/glide-core 0.17.1 → 0.18.0
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/LICENSE +1 -1
- package/dist/accordion.d.ts +1 -0
- package/dist/accordion.js +1 -1
- package/dist/button-group.button.d.ts +2 -1
- package/dist/button-group.button.js +1 -1
- package/dist/button-group.d.ts +1 -0
- package/dist/button-group.js +1 -1
- package/dist/button.d.ts +1 -0
- package/dist/button.js +1 -1
- package/dist/checkbox-group.d.ts +3 -1
- package/dist/checkbox-group.js +4 -4
- package/dist/checkbox.d.ts +3 -1
- package/dist/checkbox.js +9 -8
- package/dist/drawer.d.ts +1 -0
- package/dist/drawer.js +1 -1
- package/dist/drawer.styles.js +2 -2
- package/dist/dropdown.d.ts +3 -2
- package/dist/dropdown.js +41 -37
- package/dist/dropdown.option.d.ts +3 -2
- package/dist/dropdown.option.js +1 -1
- package/dist/dropdown.styles.js +2 -2
- package/dist/form-controls-layout.d.ts +1 -1
- package/dist/form-controls-layout.js +1 -1
- package/dist/icon-button.d.ts +1 -0
- package/dist/icon-button.js +1 -1
- package/dist/inline-alert.d.ts +1 -0
- package/dist/inline-alert.js +1 -1
- package/dist/input.d.ts +3 -1
- package/dist/input.js +5 -5
- package/dist/label.d.ts +1 -2
- package/dist/label.js +1 -1
- package/dist/library/localize.test.js +1 -1
- package/dist/library/ow.test.js +1 -2
- package/dist/menu.button.d.ts +2 -1
- package/dist/menu.button.js +1 -1
- package/dist/menu.d.ts +1 -0
- package/dist/menu.js +1 -1
- package/dist/menu.link.d.ts +2 -1
- package/dist/menu.link.js +1 -1
- package/dist/menu.options.d.ts +1 -0
- package/dist/menu.options.js +1 -1
- package/dist/modal.d.ts +1 -1
- package/dist/modal.icon-button.d.ts +1 -0
- package/dist/modal.icon-button.js +1 -1
- package/dist/modal.js +1 -1
- package/dist/modal.styles.js +23 -19
- package/dist/modal.tertiary-icon.d.ts +1 -1
- package/dist/modal.tertiary-icon.js +1 -1
- package/dist/popover.d.ts +1 -0
- package/dist/popover.js +1 -1
- package/dist/radio-group.d.ts +3 -1
- package/dist/radio-group.js +4 -5
- package/dist/radio-group.radio.d.ts +3 -2
- package/dist/radio-group.radio.js +1 -1
- package/dist/split-button.d.ts +1 -0
- package/dist/split-button.js +1 -1
- package/dist/split-button.primary-button.d.ts +1 -0
- package/dist/split-button.primary-button.js +1 -1
- package/dist/split-button.primary-link.d.ts +1 -0
- package/dist/split-button.primary-link.js +1 -1
- package/dist/split-button.secondary-button.d.ts +1 -0
- package/dist/split-button.secondary-button.js +1 -1
- package/dist/tab.d.ts +1 -0
- package/dist/tab.group.d.ts +4 -4
- package/dist/tab.group.js +1 -1
- package/dist/tab.js +1 -1
- package/dist/tab.panel.d.ts +1 -0
- package/dist/tab.panel.js +1 -1
- package/dist/tag.d.ts +1 -0
- package/dist/tag.js +1 -1
- package/dist/textarea.d.ts +3 -1
- package/dist/textarea.js +9 -9
- package/dist/toasts.d.ts +1 -0
- package/dist/toasts.js +1 -1
- package/dist/toasts.toast.js +1 -1
- package/dist/toggle.d.ts +2 -1
- package/dist/toggle.js +1 -1
- package/dist/tooltip.container.d.ts +20 -0
- package/dist/tooltip.container.js +1 -0
- package/dist/tooltip.container.styles.d.ts +2 -0
- package/dist/tooltip.container.styles.js +51 -0
- package/dist/tooltip.d.ts +8 -2
- package/dist/tooltip.js +1 -1
- package/dist/tooltip.styles.js +0 -50
- package/dist/tree.d.ts +4 -3
- package/dist/tree.item.d.ts +1 -1
- package/dist/tree.item.icon-button.d.ts +1 -0
- package/dist/tree.item.icon-button.js +1 -1
- package/dist/tree.item.js +1 -1
- package/dist/tree.item.menu.d.ts +3 -4
- package/dist/tree.item.menu.js +1 -1
- package/dist/tree.js +1 -1
- package/package.json +14 -14
package/dist/dropdown.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
var __decorate=this&&this.__decorate||function(e,t,i,s){var o,l=arguments.length,n=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(l<3?o(n):l>3?o(t,i,n):o(t,i))||n);return l>3&&n&&Object.defineProperty(t,i,n),n};import"./checkbox.js";import"./
|
1
|
+
var __decorate=this&&this.__decorate||function(e,t,i,s){var o,l=arguments.length,n=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(l<3?o(n):l>3?o(t,i,n):o(t,i))||n);return l>3&&n&&Object.defineProperty(t,i,n),n};import"./checkbox.js";import"./icon-button.js";import"./label.js";import"./tooltip.js";import{html,LitElement}from"lit";import{autoUpdate,computePosition,flip,offset}from"@floating-ui/dom";import{classMap}from"lit/directives/class-map.js";import{createRef,ref}from"lit/directives/ref.js";import{customElement,property,state}from"lit/decorators.js";import{ifDefined}from"lit/directives/if-defined.js";import{repeat}from"lit/directives/repeat.js";import{styleMap}from"lit/directives/style-map.js";import{unsafeHTML}from"lit/directives/unsafe-html.js";import{when}from"lit/directives/when.js";import packageJson from"../package.json"with{type:"json"};import GlideCoreDropdownOption from"./dropdown.option.js";import{LocalizeController}from"./library/localize.js";import GlideCoreTag from"./tag.js";import chevronIcon from"./icons/chevron.js";import magnifyingGlassIcon from"./icons/magnifying-glass.js";import ow,{owSlotType}from"./library/ow.js";import pencilIcon from"./icons/pencil.js";import styles from"./dropdown.styles.js";let GlideCoreDropdown=class GlideCoreDropdown extends LitElement{static{this.formAssociated=!0}static{this.shadowRootOptions={...LitElement.shadowRootOptions,mode:"closed"}}static{this.styles=styles}get disabled(){return this.#e}set disabled(e){this.#e=e,this.open&&e?this.#t():this.open&&this.#i()}get filterable(){return this.#s}set filterable(e){this.#s!==e&&e&&!this.multiple?this.#o.value&&this.selectedOptions.length>0&&(this.#o.value.value=this.selectedOptions[0].label,this.inputValue=this.selectedOptions[0].label,this.isInputOverflow=this.#o.value.scrollWidth>this.#o.value.clientWidth):this.#s!==e&&this.#l(),this.#s=e}get open(){return this.#n}set open(e){const t=e!==this.#n;if(this.#n=e,e&&t&&!this.disabled)return this.#i(),void this.dispatchEvent(new Event("toggle",{bubbles:!0,composed:!0}));if(!this.open&&t){!this.multiple&&this.#o.value&&this.selectedOptions.length>0?(this.#o.value.value=this.selectedOptions[0].label,this.inputValue=this.selectedOptions[0].label):(!this.multiple&&this.#o.value&&0===this.selectedOptions.length||this.multiple&&this.#o.value)&&(this.#o.value.value="",this.inputValue=""),this.isFiltering=!1,this.isNoResults=!1,this.isShowSingleSelectIcon=Boolean(this.selectedOptions.at(0)?.value);for(const e of this.#a)e.hidden=!1;this.#t(),this.dispatchEvent(new Event("toggle",{bubbles:!0,composed:!0}))}}get size(){return this.#r}set size(e){if(this.#r=e,this.#p)for(const t of this.#p)t.privateSize=e}get multiple(){return this.#d}set multiple(e){const t=this.#d&&!e,i=!this.#d&&e;this.#d=e,this.isShowSingleSelectIcon=!1;for(const i of this.#a)i.privateMultiple=e,t&&i!==this.lastSelectedOption&&(i.selected=!1);t&&this.lastSelectedOption?.value?this.value=[this.lastSelectedOption.value]:i&&this.lastSelectedOption&&(this.#o.value&&(this.#o.value.value=""),this.lastSelectedOption.privateUpdateCheckbox(),this.#h())}get value(){return this.#c}set value(e){this.#c=e,ow(this.multiple||!this.multiple&&e.length<=1,ow.boolean.true.message("Only one value is allowed when not `multiple`.")),this.#u=!0;for(const t of this.#a)t.selected=e.some((e=>e&&e===t.value));this.#u=!1}get activeOption(){return this.#p?.find((({privateActive:e})=>e))}checkValidity(){this.isCheckingValidity=!0;const e=this.#v.checkValidity();return this.isCheckingValidity=!1,e}click(){this.filterable||this.isFilterable?(this.#o.value?.click(),this.#o.value?.select()):this.#m.value?.click()}get selectedOptions(){return this.#a.filter((e=>e instanceof GlideCoreDropdownOption&&e.selected))}get lastSelectedOption(){return this.#a.findLast((e=>e.selected))}get isAllSelected(){return this.#a.length>0&&this.#a.filter((({selected:e})=>e)).length===this.#a.filter((({disabled:e})=>!e)).length}get isSomeSelected(){return this.#a.some((({selected:e})=>e))}get internalLabel(){const e=this.filterable||this.isFilterable;return e||0!==this.selectedOptions.length?this.multiple||e||!this.selectedOptions.at(-1)?.label?"":this.selectedOptions.at(-1)?.label:this.placeholder}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.#f,{capture:!0})}createRenderRoot(){return this.#g=super.createRenderRoot(),this.#g}disconnectedCallback(){super.disconnectedCallback(),this.form?.removeEventListener("formdata",this.#b),document.removeEventListener("click",this.#f,{capture:!0})}async filter(e){return this.#a.filter((({label:t})=>t.toLowerCase().includes(e.toLowerCase().trim())))}firstUpdated(){if(owSlotType(this.#O.value,[GlideCoreDropdownOption,Text]),this.#E.value&&(this.#E.value.popover="manual"),this.open&&!this.disabled&&this.#i(),!this.multiple&&this.lastSelectedOption&&this.#o.value&&(this.#o.value.value=this.lastSelectedOption.label),this.#w.value){new ResizeObserver((()=>{this.#h()})).observe(this.#w.value)}if(this.#y.value){new ResizeObserver((()=>{this.#y.value&&(this.isInternalLabelOverflow=this.#y.value.scrollWidth>this.#y.value.clientWidth)})).observe(this.#y.value)}if(this.#o.value){new ResizeObserver((()=>{this.#o.value&&(this.isInputOverflow=this.#o.value.scrollWidth>this.#o.value.clientWidth)})).observe(this.#o.value)}}focus(e){this.filterable||this.isFilterable?this.#o.value?.focus(e):this.#m.value?.focus(e)}get form(){return this.#v.form}get validity(){return this.required&&0===this.selectedOptions.length?(this.#v.setValidity({customError:Boolean(this.validityMessage),valueMissing:!0}," ",this.filterable||this.isFilterable?this.#o.value:this.#m.value),this.#v.validity):this.required&&this.#v.validity.valueMissing&&this.selectedOptions.length>0?(this.#v.setValidity({}),this.#v.validity):this.#v.validity}get willValidate(){return this.#v.willValidate}formAssociatedCallback(){this.form?.addEventListener("formdata",this.#b)}formResetCallback(){for(const e of this.#a){e.hasAttribute("selected")||(e.selected=!1)}const e=this.#a.filter((e=>e.hasAttribute("selected"))),t=e.at(-1)?.value;this.#c=this.multiple&&e.length>0?e.map((({value:e})=>e)):!this.multiple&&t?[t]:[]}render(){return html`<div
|
2
2
|
class=${classMap({component:!0,horizontal:"horizontal"===this.orientation,vertical:"vertical"===this.orientation})}
|
3
3
|
@mouseup=${this.#R}
|
4
4
|
${ref(this.#w)}
|
@@ -6,13 +6,13 @@ var __decorate=this&&this.__decorate||function(e,t,i,s){var o,l=arguments.length
|
|
6
6
|
<glide-core-private-label
|
7
7
|
orientation=${this.orientation}
|
8
8
|
split=${ifDefined(this.privateSplit??void 0)}
|
9
|
+
tooltip=${ifDefined(this.tooltip)}
|
9
10
|
?disabled=${this.disabled}
|
10
11
|
?error=${this.#A}
|
11
12
|
?hide=${this.hideLabel}
|
12
13
|
?required=${this.required}
|
13
14
|
>
|
14
15
|
<label for="primary-button" id="label"> ${this.label} </label>
|
15
|
-
<slot name="tooltip" slot="tooltip"></slot>
|
16
16
|
|
17
17
|
<div
|
18
18
|
class="dropdown-and-options"
|
@@ -25,7 +25,7 @@ var __decorate=this&&this.__decorate||function(e,t,i,s){var o,l=arguments.length
|
|
25
25
|
class=${classMap({dropdown:!0,quiet:"quiet"===this.variant,disabled:this.disabled,error:this.#A,readonly:this.readonly,multiple:this.multiple})}
|
26
26
|
@click=${this.#I}
|
27
27
|
@mousedown=${this.#D}
|
28
|
-
${ref(this.#
|
28
|
+
${ref(this.#k)}
|
29
29
|
>
|
30
30
|
<span class="selected-option-labels" id="selected-option-labels">
|
31
31
|
${this.selectedOptions.map((({label:e})=>html`<span data-test="selected-option-label">
|
@@ -36,7 +36,7 @@ var __decorate=this&&this.__decorate||function(e,t,i,s){var o,l=arguments.length
|
|
36
36
|
${when(this.multiple&&this.selectedOptions.length>0,(()=>html`<ul
|
37
37
|
aria-describedby="tag-overflow-text"
|
38
38
|
class="tags"
|
39
|
-
${ref(this.#
|
39
|
+
${ref(this.#F)}
|
40
40
|
>
|
41
41
|
${repeat(this.selectedOptions,(({id:e})=>e),(({id:e,editable:t,label:i,value:s},o)=>html`<li
|
42
42
|
class=${classMap({"tag-container":!0,hidden:o>this.tagOverflowLimit-1})}
|
@@ -52,7 +52,7 @@ var __decorate=this&&this.__decorate||function(e,t,i,s){var o,l=arguments.length
|
|
52
52
|
?disabled=${this.disabled||this.readonly}
|
53
53
|
?private-editable=${t}
|
54
54
|
@edit=${this.#T}
|
55
|
-
@remove=${this.#
|
55
|
+
@remove=${this.#_.bind(this,e)}
|
56
56
|
>
|
57
57
|
${when(s,(()=>html`
|
58
58
|
<slot
|
@@ -72,12 +72,14 @@ var __decorate=this&&this.__decorate||function(e,t,i,s){var o,l=arguments.length
|
|
72
72
|
|
73
73
|
<glide-core-tooltip
|
74
74
|
class=${classMap({"input-tooltip":!0,visible:this.filterable||this.isFilterable})}
|
75
|
+
data-test="input-tooltip"
|
76
|
+
label=${this.inputValue}
|
75
77
|
offset=${8}
|
76
78
|
?disabled=${this.open||!this.isInputOverflow}
|
77
79
|
?open=${!this.open&&this.isInputTooltipOpen}
|
80
|
+
@toggle=${this.#L}
|
81
|
+
screenreader-hidden
|
78
82
|
>
|
79
|
-
<div aria-hidden="true">${this.inputValue}</div>
|
80
|
-
|
81
83
|
<div class="input-container" slot="target">
|
82
84
|
<input
|
83
85
|
aria-activedescendant=${this.ariaActivedescendant}
|
@@ -96,10 +98,10 @@ var __decorate=this&&this.__decorate||function(e,t,i,s){var o,l=arguments.length
|
|
96
98
|
tabindex=${this.disabled?"-1":"0"}
|
97
99
|
?disabled=${this.disabled}
|
98
100
|
?readonly=${this.readonly}
|
99
|
-
@blur=${this.#
|
100
|
-
@focus=${this.#
|
101
|
+
@blur=${this.#B}
|
102
|
+
@focus=${this.#V}
|
101
103
|
@input=${this.#G}
|
102
|
-
@keydown=${this.#
|
104
|
+
@keydown=${this.#M}
|
103
105
|
${ref(this.#o)}
|
104
106
|
/>
|
105
107
|
|
@@ -112,7 +114,7 @@ var __decorate=this&&this.__decorate||function(e,t,i,s){var o,l=arguments.length
|
|
112
114
|
</span>`))}
|
113
115
|
|
114
116
|
<span
|
115
|
-
aria-label=${this.#
|
117
|
+
aria-label=${this.#z.term("itemCount",this.itemCount.toString())}
|
116
118
|
aria-live="assertive"
|
117
119
|
class="item-count"
|
118
120
|
data-test="item-count"
|
@@ -123,12 +125,14 @@ var __decorate=this&&this.__decorate||function(e,t,i,s){var o,l=arguments.length
|
|
123
125
|
|
124
126
|
<glide-core-tooltip
|
125
127
|
class=${classMap({"internal-label-tooltip":!0,visible:Boolean(this.internalLabel)})}
|
128
|
+
data-test="internal-label-tooltip"
|
129
|
+
label=${ifDefined(this.internalLabel)}
|
126
130
|
offset=${8}
|
127
131
|
?disabled=${this.open||this.multiple||this.filterable||this.isFilterable||!this.isInternalLabelOverflow}
|
128
132
|
?open=${!this.open&&this.isInternalLabelTooltipOpen}
|
133
|
+
@toggle=${this.#L}
|
134
|
+
screenreader-hidden
|
129
135
|
>
|
130
|
-
<div aria-hidden="true">${this.internalLabel}</div>
|
131
|
-
|
132
136
|
<div
|
133
137
|
class="internal-label"
|
134
138
|
data-test="internal-label"
|
@@ -159,12 +163,12 @@ var __decorate=this&&this.__decorate||function(e,t,i,s){var o,l=arguments.length
|
|
159
163
|
${when(!this.multiple&&this.selectedOptions.length>0&&this.selectedOptions[0].editable,(()=>html`<glide-core-icon-button
|
160
164
|
class="edit-button"
|
161
165
|
data-test="edit-button"
|
162
|
-
label=${this.#
|
166
|
+
label=${this.#z.term("editOption",this.selectedOptions[0].label)}
|
163
167
|
tabindex=${this.disabled||this.readonly?"-1":"0"}
|
164
168
|
variant="tertiary"
|
165
169
|
?disabled=${this.disabled||this.readonly}
|
166
|
-
@click=${this.#
|
167
|
-
${ref(this.#
|
170
|
+
@click=${this.#N}
|
171
|
+
${ref(this.#j)}
|
168
172
|
>
|
169
173
|
${pencilIcon}
|
170
174
|
</glide-core-icon-button>`))}
|
@@ -181,8 +185,8 @@ var __decorate=this&&this.__decorate||function(e,t,i,s){var o,l=arguments.length
|
|
181
185
|
id="primary-button"
|
182
186
|
tabindex=${this.filterable||this.isFilterable||this.disabled?"-1":"0"}
|
183
187
|
type="button"
|
184
|
-
@focusin=${this.#
|
185
|
-
@focusout=${this.#
|
188
|
+
@focusin=${this.#x}
|
189
|
+
@focusout=${this.#H}
|
186
190
|
${ref(this.#m)}
|
187
191
|
>
|
188
192
|
${when(this.isFiltering,(()=>html`<div data-test="magnifying-glass-icon">
|
@@ -204,36 +208,36 @@ var __decorate=this&&this.__decorate||function(e,t,i,s){var o,l=arguments.length
|
|
204
208
|
id="options"
|
205
209
|
role="listbox"
|
206
210
|
tabindex="-1"
|
207
|
-
@change=${this.#
|
208
|
-
@click=${this.#
|
209
|
-
@focusin=${this.#
|
210
|
-
@mousedown=${this.#
|
211
|
-
@mouseover=${this.#
|
212
|
-
@private-editable-change=${this.#
|
213
|
-
@private-label-change=${this.#
|
214
|
-
@private-selected-change=${this.#
|
215
|
-
@private-value-change=${this.#
|
211
|
+
@change=${this.#q}
|
212
|
+
@click=${this.#U}
|
213
|
+
@focusin=${this.#P}
|
214
|
+
@mousedown=${this.#W}
|
215
|
+
@mouseover=${this.#K}
|
216
|
+
@private-editable-change=${this.#J}
|
217
|
+
@private-label-change=${this.#Q}
|
218
|
+
@private-selected-change=${this.#X}
|
219
|
+
@private-value-change=${this.#Y}
|
216
220
|
>
|
217
221
|
<glide-core-dropdown-option
|
218
222
|
class="select-all"
|
219
223
|
data-test="select-all"
|
220
|
-
label=${this.#
|
224
|
+
label=${this.#z.term("selectAll")}
|
221
225
|
private-size=${this.size}
|
222
226
|
private-multiple
|
223
227
|
?hidden=${!this.selectAll||!this.multiple||this.isFiltering}
|
224
228
|
?private-indeterminate=${this.isSomeSelected&&!this.isAllSelected}
|
225
|
-
${ref(this.#
|
229
|
+
${ref(this.#Z)}
|
226
230
|
></glide-core-dropdown-option>
|
227
231
|
|
228
232
|
<slot
|
229
|
-
class="
|
230
|
-
@slotchange=${this.#
|
233
|
+
class="default-slot"
|
234
|
+
@slotchange=${this.#ee}
|
231
235
|
${ref(this.#O)}
|
232
236
|
></slot>
|
233
237
|
</div>
|
234
238
|
|
235
239
|
${when(this.isNoResults,(()=>html`<div class="no-results">
|
236
|
-
${this.#
|
240
|
+
${this.#z.term("noResults")}
|
237
241
|
</div>`))}
|
238
242
|
|
239
243
|
<footer
|
@@ -243,10 +247,10 @@ var __decorate=this&&this.__decorate||function(e,t,i,s){var o,l=arguments.length
|
|
243
247
|
class=${classMap({"add-button":!0,[this.size]:!0})}
|
244
248
|
data-test="add-button"
|
245
249
|
type="button"
|
246
|
-
@click=${this.#
|
247
|
-
@focusin=${this.#
|
248
|
-
@mouseover=${this.#
|
249
|
-
${ref(this.#
|
250
|
+
@click=${this.#te}
|
251
|
+
@focusin=${this.#ie}
|
252
|
+
@mouseover=${this.#se}
|
253
|
+
${ref(this.#oe)}
|
250
254
|
>
|
251
255
|
${icons.plus} ${this.addButtonLabel}
|
252
256
|
</button>
|
@@ -264,7 +268,7 @@ var __decorate=this&&this.__decorate||function(e,t,i,s){var o,l=arguments.length
|
|
264
268
|
>`))}
|
265
269
|
</div>
|
266
270
|
</glide-core-private-label>
|
267
|
-
</div>`}reportValidity(){this.isReportValidityOrSubmit=!0;const e=this.#v.reportValidity();return this.requestUpdate(),e}setCustomValidity(e){this.validityMessage=e,""===e?this.#v.setValidity({customError:!1},"",this.filterable||this.isFilterable?this.#o.value:this.#m.value):this.#v.setValidity({customError:!0,valueMissing:this.#v.validity.valueMissing}," ",this.filterable||this.isFilterable?this.#o.value:this.#m.value)}setValidity(e,t){this.validityMessage=t,this.#v.setValidity(e," ",this.filterable||this.isFilterable?this.#o.value:this.#m.value)}constructor(){super(),this.hideLabel=!1,this.name="",this.orientation="horizontal",this.readonly=!1,this.selectAll=!1,this.required=!1,this.ariaActivedescendant="",this.inputValue="",this.isBlurring=!1,this.isCheckingValidity=!1,this.isCommunicateItemCountToScreenreaders=!1,this.isFilterable=!1,this.isFiltering=!1,this.isInputOverflow=!1,this.isInputTooltipOpen=!1,this.isInternalLabelOverflow=!1,this.isInternalLabelTooltipOpen=!1,this.isNoResults=!1,this.isReportValidityOrSubmit=!1,this.isShowSingleSelectIcon=!1,this.itemCount=0,this.tagOverflowLimit=0,this.#se=createRef(),this.#w=createRef(),this.#O=createRef(),this.#F=createRef(),this.#N=createRef(),this.#o=createRef(),this.#y=createRef(),this.#oe=!1,this.#e=!1,this.#le=!1,this.#s=!1,this.#d=!1,this.#n=!1,this.#ne=!1,this.#ae=!1,this.#re=!1,this.#pe=!1,this.#u=!1,this.#M=new LocalizeController(this),this.#E=createRef(),this.#m=createRef(),this.#Y=createRef(),this.#r="large",this.#k=createRef(),this.#c=[],this.#f=()=>{this.#oe?setTimeout((()=>{this.#oe=!1})):this.open=!1},this.#b=({formData:e})=>{this.name&&this.value.length>0&&!this.disabled&&e.append(this.name,JSON.stringify(this.value))},this.#v=this.attachInternals(),this.addEventListener("invalid",(e=>{if(e?.preventDefault(),this.isCheckingValidity||this.isBlurring)return;this.isReportValidityOrSubmit=!0;this.form?.querySelector(":invalid")===this&&this.focus()}))}#se;#de;#w;#O;#F;#N;#o;#y;#v;#oe;#e;#le;#s;#d;#n;#ne;#ae;#re;#pe;#u;#M;#E;#he;#m;#Y;#g;#r;#k;#c;#f;#b;#t(){this.#de?.(),this.#E.value?.hidePopover(),this.ariaActivedescendant="",this.activeOption&&(this.#he=this.activeOption,this.activeOption.privateIsTooltipOpen=!1,this.activeOption.privateActive=!1)}get#A(){return!this.disabled&&!this.validity.valid&&this.isReportValidityOrSubmit}#ee(){this.open=!1,this.dispatchEvent(new Event("add",{bubbles:!0,composed:!0}))}#te(){this.activeOption&&(this.activeOption.privateIsTooltipOpen=!1,this.#he=this.activeOption,this.activeOption.privateActive=!1)}#ie(){this.activeOption&&!this.#ne&&(this.#he=this.activeOption,this.activeOption.privateActive=!1)}#R(){this.#oe=!0}#Z(){owSlotType(this.#O.value,[GlideCoreDropdownOption,Text]),this.isFilterable=this.#a.length>10,this.tagOverflowLimit=this.selectedOptions.length;for(const e of this.#a)e.privateSize=this.size,e.privateMultiple=this.multiple;const e=this.#ce?.find((e=>!e.disabled));!this.activeOption&&this.lastSelectedOption?(this.lastSelectedOption.privateActive=!0,this.#he=this.lastSelectedOption,this.ariaActivedescendant=this.open?this.lastSelectedOption.id:""):!this.activeOption&&e&&(this.#he=e,this.ariaActivedescendant=this.open?e.id:"",e.privateActive=!0),this.#Y.value&&(this.#Y.value.selected=this.isAllSelected),this.multiple?this.#c=this.selectedOptions.filter((e=>Boolean(e.value))).map((({value:e})=>e)):this.lastSelectedOption?.value&&(this.#c=[this.lastSelectedOption.value]),this.requestUpdate(),this.updateComplete.then((()=>{!this.multiple&&this.#o.value&&this.lastSelectedOption?.value&&(this.#o.value.value=this.lastSelectedOption.label,this.inputValue=this.lastSelectedOption.label,this.isInputOverflow=this.#o.value.scrollWidth>this.#o.value.clientWidth)}))}#C(e){this.open&&this.#he&&e.relatedTarget===this.#se.value&&(this.#he.privateActive=!0,this.#he.privateIsTooltipOpen=!this.#he.editable)}#S(e){(null===e.relatedTarget||e.relatedTarget instanceof Node&&!this.#g?.contains(e.relatedTarget)&&!this.contains(e.relatedTarget))&&!this.#le&&(this.open=!1,this.isBlurring=!0,this.reportValidity(),this.isBlurring=!1)}#$(e){if(this.disabled||this.readonly)return;if(("Enter"===e.key||" "===e.key)&&e.target===this.#N.value)return void(this.#oe=!0);if(!this.open&&"Enter"===e.key)return void this.form?.requestSubmit();if(this.open&&"ArrowUp"===e.key&&this.#g?.activeElement===this.#se.value)return this.focus(),void(this.#he&&(this.#he.privateActive=!0,this.#he.privateIsEditActive=this.#he.editable,this.#he.privateIsTooltipOpen=!this.#he.privateIsEditActive));if(this.open&&"ArrowDown"===e.key&&this.#g?.activeElement===this.#se.value)return void e.preventDefault();if(this.open&&"ArrowDown"===e.key&&this.addButtonLabel&&this.activeOption===this.#ue?.at(-1)&&(!this.activeOption?.editable||this.activeOption?.privateIsEditActive))return e.preventDefault(),this.activeOption&&(this.#he=this.activeOption,this.activeOption.privateIsTooltipOpen=!1,this.activeOption.privateActive=!1),void this.#se.value?.focus();if("Escape"===e.key)return e.preventDefault(),this.open=!1,void(this.#g?.activeElement===this.#se.value&&this.focus());const t=e.target===this.#m.value||e.target===this.#o.value||e.target instanceof GlideCoreDropdownOption;if(!this.multiple||t){if(!this.open&&[" ","ArrowUp","ArrowDown"].includes(e.key))return e.preventDefault(),this.open=!0,void(this.activeOption&&(this.activeOption.privateIsTooltipOpen=!this.activeOption.privateIsEditActive));if(this.activeOption&&this.open){if("Enter"===e.key||" "===e.key){if(this.activeOption.privateIsEditActive)return this.activeOption.dispatchEvent(new Event("edit",{bubbles:!0,composed:!0})),void(this.open=!1);if("Enter"===e.key&&this.#ue&&this.#ue.length>0||" "===e.key&&!this.filterable&&!this.isFilterable)return this.#pe=!0,e.preventDefault(),this.isFiltering=!1,this.activeOption.selected=!this.multiple||!this.activeOption.selected,this.activeOption===this.#Y.value&&this.#ve(),this.#pe=!1,this.#l(),this.multiple||(this.open=!1),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),void this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}const t=this.#ce?.indexOf(this.activeOption);if("ArrowUp"===e.key&&!e.metaKey&&this.#ce&&"number"==typeof t){e.preventDefault();const i=this.#ce.findLast(((e,i)=>!e.disabled&&i<t));return void(this.activeOption?.privateIsEditActive?(this.activeOption.privateIsEditActive=!1,this.activeOption.privateIsTooltipOpen=!0):i&&0!==t&&(this.activeOption.privateIsEditActive=!1,this.activeOption.privateIsTooltipOpen=!1,this.activeOption.privateActive=!1,this.ariaActivedescendant=i.id,this.#he=i,i.privateActive=!0,i.privateIsEditActive=i.editable,i.privateIsTooltipOpen=!i.editable,i.scrollIntoView({block:"center"})))}if("ArrowDown"===e.key&&!e.metaKey&&this.#ce&&"number"==typeof t){e.preventDefault();const i=this.#ce.find(((e,i)=>!e.disabled&&i>t));return void(this.activeOption.editable&&!this.activeOption.privateIsEditActive?(this.activeOption.privateIsEditActive=!0,this.activeOption.privateIsTooltipOpen=!1):i&&(this.activeOption.privateIsEditActive=!1,this.activeOption.privateIsTooltipOpen=!1,this.activeOption.privateActive=!1,this.ariaActivedescendant=i.id,this.#he=i,i.privateActive=!0,i.privateIsTooltipOpen=!0,i.scrollIntoView({block:"center"})))}if(("ArrowUp"===e.key&&e.metaKey||"Home"===e.key||"PageUp"===e.key)&&this.#ce){e.preventDefault();const t=[...this.#ce].reverse().findLast((e=>!e.disabled));return void(t&&(this.activeOption.privateIsEditActive=!1,this.activeOption.privateIsTooltipOpen=!1,this.activeOption.privateActive=!1,this.ariaActivedescendant=t.id,this.#he=t,t.privateActive=!0,t.privateIsTooltipOpen=!0,t.scrollIntoView({block:"nearest"})))}if(("ArrowDown"===e.key&&e.metaKey||"End"===e.key||"PageDown"===e.key)&&this.#ce){e.preventDefault();const t=[...this.#ce].findLast((e=>!e.disabled));return void(t&&this.activeOption&&(this.activeOption.privateIsEditActive=!1,this.activeOption.privateIsTooltipOpen=!1,this.activeOption.privateActive=!1,this.ariaActivedescendant=t.id,this.#he=t,t.privateActive=!0,t.privateIsTooltipOpen=!0,t.scrollIntoView({block:"nearest"})))}}}}#I(e){if(this.disabled||this.readonly)return;if(this.#le)return void(this.#le=!1);if(e.target instanceof Node&&this.#N.value?.contains(e.target))return void this.selectedOptions[0].dispatchEvent(new Event("edit",{bubbles:!0,composed:!0}));const t=this.filterable||this.isFilterable;if(this.#pe||!this.open||t&&!(e.target instanceof Element&&this.#m.value?.contains(e.target)))return 0!==e.detail?(this.open=!0,this.focus(),this.#ne=!0,void setTimeout((()=>{this.#ne=!1}))):void 0;this.open=!1}#D(e){const t=this.filterable||this.isFilterable,i=e.target instanceof GlideCoreTag;t&&!i?e.target!==this.#o.value&&(e.preventDefault(),this.focus()):i||e.preventDefault()}#z(){this.open=!1}get#a(){return this.#O.value?.assignedElements().filter((e=>e instanceof GlideCoreDropdownOption))??[]}get#p(){const e=this.#O.value?.assignedElements().filter((e=>e instanceof GlideCoreDropdownOption));if(e&&this.#Y.value)return[this.#Y.value,...e]}get#ue(){return this.#O.value?.assignedElements().filter((e=>e instanceof GlideCoreDropdownOption&&!e.hidden))}get#ce(){const e=this.#O.value?.assignedElements().filter((e=>e instanceof GlideCoreDropdownOption&&!e.hidden));return this.#Y.value&&!this.#Y.value.hidden&&e?[this.#Y.value,...e]:e}#_(){this.isCommunicateItemCountToScreenreaders=!1,this.isInputTooltipOpen=!1}#B(){this.#o.value?.select(),this.isInputTooltipOpen=!0}async#G(e){let t;ow(this.#o.value,ow.object.instanceOf(HTMLInputElement)),e.stopPropagation(),this.open=!0,this.isShowSingleSelectIcon=!1,this.inputValue=this.#o.value.value,this.multiple&&""!==this.#o.value.value?this.isFiltering=!0:this.multiple?this.isFiltering=!1:""!==this.#o.value.value&&this.#o.value.value!==this.selectedOptions.at(0)?.label?this.isFiltering=!0:this.isFiltering=!1;try{t=await this.filter(this.#o.value.value)}catch{}if(t){for(const e of this.#a)e.hidden=!t.includes(e);const e=this.#ue?.at(0);e&&this.activeOption?.hidden&&(this.activeOption.privateActive=!1,this.#he=e,this.ariaActivedescendant=e.id,e.privateActive=!0),this.isNoResults=!this.#ue||0===this.#ue.length,this.isCommunicateItemCountToScreenreaders=!0,this.#ue&&(this.itemCount=this.#ue.length)}}#V(e){const t=this.selectedOptions.findLast(((e,t)=>t<=this.tagOverflowLimit-1));if(t&&"Backspace"===e.key&&!e.metaKey&&this.multiple&&this.#o.value&&0===this.#o.value.selectionStart)return this.#le=!0,t.selected=!1,void(this.#le=!1);const i=this.selectedOptions.filter(((e,t)=>t<=this.tagOverflowLimit-1));if(t&&"Backspace"===e.key&&e.metaKey&&this.multiple&&this.#o.value&&0===this.#o.value.selectionStart){this.#le=!0;for(const e of i)e.selected=!1;this.#le=!1}else;}#H(e){e.target instanceof GlideCoreDropdownOption&&(e.target.selected=!e.target.selected),e.target===this.#Y.value&&this.#ve(),this.#l()}#q(e){if(e.target instanceof Element){const t=e.target.closest("glide-core-dropdown-option");if(t instanceof GlideCoreDropdownOption&&t.disabled)return;if(t instanceof GlideCoreDropdownOption&&t.privateIsEditActive)return t.dispatchEvent(new Event("edit",{bubbles:!0,composed:!0})),void(this.open=!1);if(t&&!t.selected)return t.selected=!0,this.#l(),this.multiple||(this.open=!1),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),void this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}));if(t?.selected&&!this.multiple)return void(this.open=!1)}}#K(){this.requestUpdate()}#U(e){e.target instanceof GlideCoreDropdownOption&&(this.activeOption&&(this.activeOption.privateActive=!1),e.target.privateActive=!0,this.#he=e.target)}#J(){this.selectedOptions.length>0&&(this.multiple?(this.requestUpdate(),this.updateComplete.then((()=>{this.#h()}))):(this.filterable||this.isFilterable)&&this.#o.value?(this.#o.value.value=this.selectedOptions[0].label,this.inputValue=this.selectedOptions[0].label,this.isInputOverflow=this.#o.value.scrollWidth>this.#o.value.clientWidth):this.requestUpdate())}#P(e){(this.filterable||this.isFilterable)&&e.preventDefault()}#W(e){if(e.target instanceof GlideCoreDropdownOption&&this.#ce){if(e.target.disabled)return;this.activeOption&&(this.activeOption.privateIsTooltipOpen=!1,this.activeOption.privateActive=!1),this.ariaActivedescendant=e.target.id,this.#he=e.target,e.target.privateActive=!0,e.target.privateIsEditActive=!1,this.#g?.activeElement===this.#se.value&&this.focus()}}#Q(e){e.target!==this.#Y.value&&!this.#re&&this.#Y.value&&(this.#Y.value.selected=this.isAllSelected),this.isShowSingleSelectIcon=!this.multiple&&this.selectedOptions.length>0&&Boolean(this.selectedOptions.at(0)?.value),e.target instanceof GlideCoreDropdownOption&&(this.multiple&&!this.#u?(this.#c=e.target.selected&&e.target.value&&!e.target.disabled?[...this.value,e.target.value]:this.value.filter((t=>e.target instanceof GlideCoreDropdownOption&&t!==e.target.value)),this.#o.value&&!this.#le&&(this.isFiltering=!1,this.#o.value.value="",this.inputValue="")):this.multiple||!e.target.selected||e.target.disabled||(this.#c=e.target.value?[e.target.value]:[],this.#o.value&&(this.isFiltering=!1,this.#o.value.value=e.target.label,this.inputValue=e.target.label))),this.#o.value&&(this.isInputOverflow=this.#o.value.scrollWidth>this.#o.value.clientWidth),this.requestUpdate(),this.updateComplete.then((()=>{this.#h()}))}#X(e){e.target instanceof GlideCoreDropdownOption&&this.multiple&&e.target.selected&&e.detail.new?this.#c=this.value.map((t=>t===e.detail.old?e.detail.new:t)):e.target instanceof GlideCoreDropdownOption&&this.multiple?this.#c=this.value.filter((t=>t!==e.detail.old)):e.target instanceof GlideCoreDropdownOption&&(this.#c=e.detail.new?[e.detail.new]:[])}#j(){this.isInternalLabelTooltipOpen=!0}#x(){this.isInternalLabelTooltipOpen=!1}#T(){this.#le=!0,this.open=!1}async#L(e){this.#le=!0;for(const t of this.#a)t.id===e&&(t.selected=!1,this.#c=this.value.filter((e=>e!==t.value)));const t=this.#k.value?.querySelectorAll("glide-core-tag");if(t&&this.selectedOptions.length>0){const i=[...t].findIndex((t=>t.dataset.id===e)),s=t[i<t.length-1?i+1:i-1];await this.updateComplete,setTimeout((()=>{s?.focus(),this.#le=!1}))}else setTimeout((()=>{this.focus(),this.#le=!1}));this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}#ve(){ow(this.#Y.value,ow.object.instanceOf(GlideCoreDropdownOption)),this.#re=!0;for(const e of this.#a)e.selected=this.#Y.value.selected&&!e.disabled;this.#re=!1}async#h(){if(this.#w.value){const e=this.#w.value.scrollWidth>this.#w.value.clientWidth;e&&this.tagOverflowLimit>1?(this.tagOverflowLimit=this.tagOverflowLimit-1,await this.updateComplete,this.#h()):!e&&!this.#ae&&this.tagOverflowLimit<this.selectedOptions.length?(this.tagOverflowLimit=this.tagOverflowLimit+1,this.#ae=!0,await this.updateComplete,this.#h()):this.#ae=!1}}#i(){this.#de?.(),this.#he&&(this.#he.privateActive=!0,this.ariaActivedescendant=this.#he.id),this.#F.value&&this.#E.value&&(this.#de=autoUpdate(this.#F.value,this.#E.value,(()=>{(async()=>{if(this.#F.value&&this.#E.value){const{x:e,y:t,placement:i}=await computePosition(this.#F.value,this.#E.value,{placement:"bottom-start",middleware:[offset({mainAxis:Number.parseFloat(window.getComputedStyle(document.body).getPropertyValue("--glide-core-spacing-xxs"))*Number.parseFloat(window.getComputedStyle(document.documentElement).fontSize)}),flip()]});this.#E.value.dataset.placement=i,Object.assign(this.#E.value.style,{left:`${e}px`,top:`${t}px`}),this.#E.value?.showPopover()}})()})))}#l(){if((this.filterable||this.isFilterable)&&this.#o.value){this.isFiltering=!1;for(const e of this.#a)e.hidden=!1}}};__decorate([property({attribute:"add-button-label",reflect:!0})],GlideCoreDropdown.prototype,"addButtonLabel",void 0),__decorate([property({reflect:!0,type:Boolean})],GlideCoreDropdown.prototype,"disabled",null),__decorate([property({reflect:!0,type:Boolean})],GlideCoreDropdown.prototype,"filterable",null),__decorate([property({attribute:"hide-label",reflect:!0,type:Boolean})],GlideCoreDropdown.prototype,"hideLabel",void 0),__decorate([property({reflect:!0})],GlideCoreDropdown.prototype,"label",void 0),__decorate([property({reflect:!0})],GlideCoreDropdown.prototype,"name",void 0),__decorate([property({reflect:!0,type:Boolean})],GlideCoreDropdown.prototype,"open",null),__decorate([property({reflect:!0})],GlideCoreDropdown.prototype,"orientation",void 0),__decorate([property({reflect:!0})],GlideCoreDropdown.prototype,"placeholder",void 0),__decorate([property()],GlideCoreDropdown.prototype,"privateSplit",void 0),__decorate([property({reflect:!0,type:Boolean})],GlideCoreDropdown.prototype,"readonly",void 0),__decorate([property({attribute:"select-all",reflect:!0,type:Boolean})],GlideCoreDropdown.prototype,"selectAll",void 0),__decorate([property({reflect:!0})],GlideCoreDropdown.prototype,"size",null),__decorate([property({reflect:!0,type:Boolean})],GlideCoreDropdown.prototype,"multiple",null),__decorate([property({reflect:!0,type:Boolean})],GlideCoreDropdown.prototype,"required",void 0),__decorate([property({type:Array})],GlideCoreDropdown.prototype,"value",null),__decorate([property({reflect:!0})],GlideCoreDropdown.prototype,"variant",void 0),__decorate([state()],GlideCoreDropdown.prototype,"ariaActivedescendant",void 0),__decorate([state()],GlideCoreDropdown.prototype,"inputValue",void 0),__decorate([state()],GlideCoreDropdown.prototype,"isBlurring",void 0),__decorate([state()],GlideCoreDropdown.prototype,"isCheckingValidity",void 0),__decorate([state()],GlideCoreDropdown.prototype,"isCommunicateItemCountToScreenreaders",void 0),__decorate([state()],GlideCoreDropdown.prototype,"isFilterable",void 0),__decorate([state()],GlideCoreDropdown.prototype,"isFiltering",void 0),__decorate([state()],GlideCoreDropdown.prototype,"isInputOverflow",void 0),__decorate([state()],GlideCoreDropdown.prototype,"isInputTooltipOpen",void 0),__decorate([state()],GlideCoreDropdown.prototype,"isInternalLabelOverflow",void 0),__decorate([state()],GlideCoreDropdown.prototype,"isInternalLabelTooltipOpen",void 0),__decorate([state()],GlideCoreDropdown.prototype,"isNoResults",void 0),__decorate([state()],GlideCoreDropdown.prototype,"isReportValidityOrSubmit",void 0),__decorate([state()],GlideCoreDropdown.prototype,"isShowSingleSelectIcon",void 0),__decorate([state()],GlideCoreDropdown.prototype,"itemCount",void 0),__decorate([state()],GlideCoreDropdown.prototype,"tagOverflowLimit",void 0),__decorate([state()],GlideCoreDropdown.prototype,"validityMessage",void 0),GlideCoreDropdown=__decorate([customElement("glide-core-dropdown")],GlideCoreDropdown);export default GlideCoreDropdown;const icons={plus:html`
|
271
|
+
</div>`}reportValidity(){this.isReportValidityOrSubmit=!0;const e=this.#v.reportValidity();return this.requestUpdate(),e}resetValidityFeedback(){this.isReportValidityOrSubmit=!1}setCustomValidity(e){this.validityMessage=e,""===e?this.#v.setValidity({customError:!1},"",this.filterable||this.isFilterable?this.#o.value:this.#m.value):this.#v.setValidity({customError:!0,valueMissing:this.#v.validity.valueMissing}," ",this.filterable||this.isFilterable?this.#o.value:this.#m.value)}setValidity(e,t){this.validityMessage=t,this.#v.setValidity(e," ",this.filterable||this.isFilterable?this.#o.value:this.#m.value)}constructor(){super(),this.hideLabel=!1,this.name="",this.orientation="horizontal",this.readonly=!1,this.selectAll=!1,this.required=!1,this.version=packageJson.version,this.ariaActivedescendant="",this.inputValue="",this.isBlurring=!1,this.isCheckingValidity=!1,this.isCommunicateItemCountToScreenreaders=!1,this.isFilterable=!1,this.isFiltering=!1,this.isInputOverflow=!1,this.isInputTooltipOpen=!1,this.isInternalLabelOverflow=!1,this.isInternalLabelTooltipOpen=!1,this.isNoResults=!1,this.isReportValidityOrSubmit=!1,this.isShowSingleSelectIcon=!1,this.itemCount=0,this.tagOverflowLimit=0,this.#oe=createRef(),this.#w=createRef(),this.#O=createRef(),this.#k=createRef(),this.#j=createRef(),this.#o=createRef(),this.#y=createRef(),this.#le=!1,this.#e=!1,this.#ne=!1,this.#s=!1,this.#d=!1,this.#n=!1,this.#ae=!1,this.#re=!1,this.#pe=!1,this.#de=!1,this.#u=!1,this.#z=new LocalizeController(this),this.#E=createRef(),this.#m=createRef(),this.#Z=createRef(),this.#r="large",this.#F=createRef(),this.#c=[],this.#f=()=>{this.#le?setTimeout((()=>{this.#le=!1})):this.open=!1},this.#b=({formData:e})=>{this.name&&this.value.length>0&&!this.disabled&&e.append(this.name,JSON.stringify(this.value))},this.#v=this.attachInternals(),this.addEventListener("invalid",(e=>{if(e?.preventDefault(),this.isCheckingValidity||this.isBlurring)return;this.isReportValidityOrSubmit=!0;this.form?.querySelector(":invalid")===this&&this.focus()}))}#oe;#he;#w;#O;#k;#j;#o;#y;#v;#le;#e;#ne;#s;#d;#n;#ae;#re;#pe;#de;#u;#z;#E;#ce;#m;#Z;#g;#r;#F;#c;#f;#b;#t(){this.#he?.(),this.#E.value?.hidePopover(),this.ariaActivedescendant="",this.activeOption&&(this.#ce=this.activeOption,this.activeOption.privateIsTooltipOpen=!1,this.activeOption.privateActive=!1)}get#A(){return!this.disabled&&!this.validity.valid&&this.isReportValidityOrSubmit}#te(){this.open=!1,this.dispatchEvent(new Event("add",{bubbles:!0,composed:!0}))}#ie(){this.activeOption&&(this.activeOption.privateIsTooltipOpen=!1,this.#ce=this.activeOption,this.activeOption.privateActive=!1)}#se(){this.activeOption&&!this.#ae&&(this.#ce=this.activeOption,this.activeOption.privateActive=!1)}#R(){this.#le=!0}#ee(){owSlotType(this.#O.value,[GlideCoreDropdownOption,Text]),this.isFilterable=this.#a.length>10,this.tagOverflowLimit=this.selectedOptions.length;for(const e of this.#a)e.privateSize=this.size,e.privateMultiple=this.multiple;const e=this.#ue?.find((e=>!e.disabled));!this.activeOption&&this.lastSelectedOption?(this.lastSelectedOption.privateActive=!0,this.#ce=this.lastSelectedOption,this.ariaActivedescendant=this.open?this.lastSelectedOption.id:""):!this.activeOption&&e&&(this.#ce=e,this.ariaActivedescendant=this.open?e.id:"",e.privateActive=!0),this.#Z.value&&(this.#Z.value.selected=this.isAllSelected),this.multiple?this.#c=this.selectedOptions.filter((e=>Boolean(e.value))).map((({value:e})=>e)):this.lastSelectedOption?.value&&(this.#c=[this.lastSelectedOption.value]),this.requestUpdate(),this.updateComplete.then((()=>{!this.multiple&&this.#o.value&&this.lastSelectedOption?.value&&(this.#o.value.value=this.lastSelectedOption.label,this.inputValue=this.lastSelectedOption.label,this.isInputOverflow=this.#o.value.scrollWidth>this.#o.value.clientWidth)}))}#C(e){this.open&&this.#ce&&e.relatedTarget===this.#oe.value&&(this.#ce.privateActive=!0,this.#ce.privateIsTooltipOpen=!this.#ce.editable)}#S(e){(null===e.relatedTarget||e.relatedTarget instanceof Node&&!this.#g?.contains(e.relatedTarget)&&!this.contains(e.relatedTarget))&&!this.#ne&&(this.open=!1,this.isBlurring=!0,this.reportValidity(),this.isBlurring=!1)}#$(e){if(this.disabled||this.readonly)return;if(("Enter"===e.key||" "===e.key)&&e.target===this.#j.value)return void(this.#le=!0);if(!this.open&&"Enter"===e.key)return void this.form?.requestSubmit();if(this.open&&"ArrowUp"===e.key&&this.#g?.activeElement===this.#oe.value)return this.focus(),void(this.#ce&&(this.#ce.privateActive=!0,this.#ce.privateIsEditActive=this.#ce.editable,this.#ce.privateIsTooltipOpen=!this.#ce.privateIsEditActive));if(this.open&&"ArrowDown"===e.key&&this.#g?.activeElement===this.#oe.value)return void e.preventDefault();if(this.open&&"ArrowDown"===e.key&&this.addButtonLabel&&this.activeOption===this.#ve?.at(-1)&&(!this.activeOption?.editable||this.activeOption?.privateIsEditActive))return e.preventDefault(),this.activeOption&&(this.#ce=this.activeOption,this.activeOption.privateIsTooltipOpen=!1,this.activeOption.privateActive=!1),void this.#oe.value?.focus();if("Escape"===e.key)return e.preventDefault(),this.open=!1,void(this.#g?.activeElement===this.#oe.value&&this.focus());const t=e.target===this.#m.value||e.target===this.#o.value||e.target instanceof GlideCoreDropdownOption;if(!this.multiple||t){if(!this.open&&[" ","ArrowUp","ArrowDown"].includes(e.key))return e.preventDefault(),this.open=!0,void(this.activeOption&&(this.activeOption.privateIsTooltipOpen=!this.activeOption.privateIsEditActive));if(this.activeOption&&this.open){if("Enter"===e.key||" "===e.key){if(this.activeOption.privateIsEditActive)return this.activeOption.dispatchEvent(new Event("edit",{bubbles:!0,composed:!0})),void(this.open=!1);if("Enter"===e.key&&this.#ve&&this.#ve.length>0||" "===e.key&&!this.filterable&&!this.isFilterable)return this.#de=!0,e.preventDefault(),this.isFiltering=!1,this.activeOption.selected=!this.multiple||!this.activeOption.selected,this.activeOption===this.#Z.value&&this.#me(),this.#de=!1,this.#l(),this.multiple||(this.open=!1),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),void this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}const t=this.#ue?.indexOf(this.activeOption);if("ArrowUp"===e.key&&!e.metaKey&&this.#ue&&"number"==typeof t){e.preventDefault();const i=this.#ue.findLast(((e,i)=>!e.disabled&&i<t));return void(this.activeOption?.privateIsEditActive?(this.activeOption.privateIsEditActive=!1,this.activeOption.privateIsTooltipOpen=!0):i&&0!==t&&(this.activeOption.privateIsEditActive=!1,this.activeOption.privateIsTooltipOpen=!1,this.activeOption.privateActive=!1,this.ariaActivedescendant=i.id,this.#ce=i,i.privateActive=!0,i.privateIsEditActive=i.editable,i.privateIsTooltipOpen=!i.editable,i.scrollIntoView({block:"center"})))}if("ArrowDown"===e.key&&!e.metaKey&&this.#ue&&"number"==typeof t){e.preventDefault();const i=this.#ue.find(((e,i)=>!e.disabled&&i>t));return void(this.activeOption.editable&&!this.activeOption.privateIsEditActive?(this.activeOption.privateIsEditActive=!0,this.activeOption.privateIsTooltipOpen=!1):i&&(this.activeOption.privateIsEditActive=!1,this.activeOption.privateIsTooltipOpen=!1,this.activeOption.privateActive=!1,this.ariaActivedescendant=i.id,this.#ce=i,i.privateActive=!0,i.privateIsTooltipOpen=!0,i.scrollIntoView({block:"center"})))}if(("ArrowUp"===e.key&&e.metaKey||"Home"===e.key||"PageUp"===e.key)&&this.#ue){e.preventDefault();const t=[...this.#ue].reverse().findLast((e=>!e.disabled));return void(t&&(this.activeOption.privateIsEditActive=!1,this.activeOption.privateIsTooltipOpen=!1,this.activeOption.privateActive=!1,this.ariaActivedescendant=t.id,this.#ce=t,t.privateActive=!0,t.privateIsTooltipOpen=!0,t.scrollIntoView({block:"nearest"})))}if(("ArrowDown"===e.key&&e.metaKey||"End"===e.key||"PageDown"===e.key)&&this.#ue){e.preventDefault();const t=[...this.#ue].findLast((e=>!e.disabled));return void(t&&this.activeOption&&(this.activeOption.privateIsEditActive=!1,this.activeOption.privateIsTooltipOpen=!1,this.activeOption.privateActive=!1,this.ariaActivedescendant=t.id,this.#ce=t,t.privateActive=!0,t.privateIsTooltipOpen=!0,t.scrollIntoView({block:"nearest"})))}}}}#I(e){if(this.disabled||this.readonly)return;if(this.#ne)return void(this.#ne=!1);if(e.target instanceof Node&&this.#j.value?.contains(e.target))return void this.selectedOptions[0].dispatchEvent(new Event("edit",{bubbles:!0,composed:!0}));const t=this.filterable||this.isFilterable;if(this.#de||!this.open||t&&!(e.target instanceof Element&&this.#m.value?.contains(e.target)))return 0!==e.detail?(this.open=!0,this.focus(),this.#ae=!0,void setTimeout((()=>{this.#ae=!1}))):void 0;this.open=!1}#D(e){const t=this.filterable||this.isFilterable,i=e.target instanceof GlideCoreTag;t&&!i?e.target!==this.#o.value&&(e.preventDefault(),this.focus()):i||e.preventDefault()}#N(){this.open=!1}get#a(){return this.#O.value?.assignedElements().filter((e=>e instanceof GlideCoreDropdownOption))??[]}get#p(){const e=this.#O.value?.assignedElements().filter((e=>e instanceof GlideCoreDropdownOption));if(e&&this.#Z.value)return[this.#Z.value,...e]}get#ve(){return this.#O.value?.assignedElements().filter((e=>e instanceof GlideCoreDropdownOption&&!e.hidden))}get#ue(){const e=this.#O.value?.assignedElements().filter((e=>e instanceof GlideCoreDropdownOption&&!e.hidden));return this.#Z.value&&!this.#Z.value.hidden&&e?[this.#Z.value,...e]:e}#B(){this.isCommunicateItemCountToScreenreaders=!1,this.isInputTooltipOpen=!1}#V(){this.#o.value?.select(),this.isInputTooltipOpen=!0}async#G(e){let t;ow(this.#o.value,ow.object.instanceOf(HTMLInputElement)),e.stopPropagation(),this.open=!0,this.isShowSingleSelectIcon=!1,this.inputValue=this.#o.value.value,this.multiple&&""!==this.#o.value.value?this.isFiltering=!0:this.multiple?this.isFiltering=!1:""!==this.#o.value.value&&this.#o.value.value!==this.selectedOptions.at(0)?.label?this.isFiltering=!0:this.isFiltering=!1;try{t=await this.filter(this.#o.value.value)}catch{}if(t){for(const e of this.#a)e.hidden=!t.includes(e);const e=this.#ve?.at(0);e&&this.activeOption?.hidden&&(this.activeOption.privateActive=!1,this.#ce=e,this.ariaActivedescendant=e.id,e.privateActive=!0),this.isNoResults=!this.#ve||0===this.#ve.length,this.isCommunicateItemCountToScreenreaders=!0,this.#ve&&(this.itemCount=this.#ve.length)}}#M(e){const t=this.selectedOptions.findLast(((e,t)=>t<=this.tagOverflowLimit-1));if(t&&"Backspace"===e.key&&!e.metaKey&&this.multiple&&this.#o.value&&0===this.#o.value.selectionStart)return this.#ne=!0,t.selected=!1,void(this.#ne=!1);const i=this.selectedOptions.filter(((e,t)=>t<=this.tagOverflowLimit-1));if(t&&"Backspace"===e.key&&e.metaKey&&this.multiple&&this.#o.value&&0===this.#o.value.selectionStart){this.#ne=!0;for(const e of i)e.selected=!1;this.#ne=!1}else;}#q(e){e.target instanceof GlideCoreDropdownOption&&(e.target.selected=!e.target.selected),e.target===this.#Z.value&&this.#me(),this.#l()}#U(e){if(e.target instanceof Element){const t=e.target.closest("glide-core-dropdown-option");if(t instanceof GlideCoreDropdownOption&&t.disabled)return;if(t instanceof GlideCoreDropdownOption&&t.privateIsEditActive)return t.dispatchEvent(new Event("edit",{bubbles:!0,composed:!0})),void(this.open=!1);if(t&&!t.selected)return t.selected=!0,this.#l(),this.multiple||(this.open=!1),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),void this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}));if(t?.selected&&!this.multiple)return void(this.open=!1)}}#J(){this.requestUpdate()}#P(e){e.target instanceof GlideCoreDropdownOption&&(this.activeOption&&(this.activeOption.privateActive=!1),e.target.privateActive=!0,this.#ce=e.target)}#Q(){this.selectedOptions.length>0&&(this.multiple?(this.requestUpdate(),this.updateComplete.then((()=>{this.#h()}))):(this.filterable||this.isFilterable)&&this.#o.value?(this.#o.value.value=this.selectedOptions[0].label,this.inputValue=this.selectedOptions[0].label,this.isInputOverflow=this.#o.value.scrollWidth>this.#o.value.clientWidth):this.requestUpdate())}#W(e){(this.filterable||this.isFilterable)&&e.preventDefault()}#K(e){if(e.target instanceof GlideCoreDropdownOption&&this.#ue){if(e.target.disabled)return;this.activeOption&&(this.activeOption.privateIsTooltipOpen=!1,this.activeOption.privateActive=!1),this.ariaActivedescendant=e.target.id,this.#ce=e.target,e.target.privateActive=!0,e.target.privateIsEditActive=!1,this.#g?.activeElement===this.#oe.value&&this.focus()}}#X(e){e.target!==this.#Z.value&&!this.#pe&&this.#Z.value&&(this.#Z.value.selected=this.isAllSelected),this.isShowSingleSelectIcon=!this.multiple&&this.selectedOptions.length>0&&Boolean(this.selectedOptions.at(0)?.value),e.target instanceof GlideCoreDropdownOption&&(this.multiple&&!this.#u?(this.#c=e.target.selected&&e.target.value&&!e.target.disabled?[...this.value,e.target.value]:this.value.filter((t=>e.target instanceof GlideCoreDropdownOption&&t!==e.target.value)),this.#o.value&&!this.#ne&&(this.isFiltering=!1,this.#o.value.value="",this.inputValue="")):this.multiple||!e.target.selected||e.target.disabled||(this.#c=e.target.value?[e.target.value]:[],this.#o.value&&(this.isFiltering=!1,this.#o.value.value=e.target.label,this.inputValue=e.target.label))),this.#o.value&&(this.isInputOverflow=this.#o.value.scrollWidth>this.#o.value.clientWidth),this.requestUpdate(),this.updateComplete.then((()=>{this.#h()}))}#Y(e){e.target instanceof GlideCoreDropdownOption&&this.multiple&&e.target.selected&&e.detail.new?this.#c=this.value.map((t=>t===e.detail.old?e.detail.new:t)):e.target instanceof GlideCoreDropdownOption&&this.multiple?this.#c=this.value.filter((t=>t!==e.detail.old)):e.target instanceof GlideCoreDropdownOption&&(this.#c=e.detail.new?[e.detail.new]:[])}#x(){this.isInternalLabelTooltipOpen=!0}#H(){this.isInternalLabelTooltipOpen=!1}#T(){this.#ne=!0,this.open=!1}async#_(e){this.#ne=!0;for(const t of this.#a)t.id===e&&(t.selected=!1,this.#c=this.value.filter((e=>e!==t.value)));const t=this.#F.value?.querySelectorAll("glide-core-tag");if(t&&this.selectedOptions.length>0){const i=[...t].findIndex((t=>t.dataset.id===e)),s=t[i<t.length-1?i+1:i-1];await this.updateComplete,setTimeout((()=>{s?.focus(),this.#ne=!1}))}else setTimeout((()=>{this.focus(),this.#ne=!1}));this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}#L(e){e.stopPropagation()}#me(){ow(this.#Z.value,ow.object.instanceOf(GlideCoreDropdownOption)),this.#pe=!0;for(const e of this.#a)!this.#Z.value.selected||e.selected||e.disabled?!this.#Z.value.selected&&e.selected&&(e.selected=!1):e.selected=!0;this.#pe=!1}async#h(){if(this.#w.value){const e=this.#w.value.scrollWidth>this.#w.value.clientWidth;e&&this.tagOverflowLimit>1?(this.tagOverflowLimit=this.tagOverflowLimit-1,await this.updateComplete,this.#h()):!e&&!this.#re&&this.tagOverflowLimit<this.selectedOptions.length?(this.tagOverflowLimit=this.tagOverflowLimit+1,this.#re=!0,await this.updateComplete,this.#h()):this.#re=!1}}#i(){this.#a.length>0&&(this.#he?.(),this.#ce&&(this.#ce.privateActive=!0,this.ariaActivedescendant=this.#ce.id),this.#k.value&&this.#E.value&&(this.#he=autoUpdate(this.#k.value,this.#E.value,(()=>{(async()=>{if(this.#k.value&&this.#E.value){const{x:e,y:t,placement:i}=await computePosition(this.#k.value,this.#E.value,{placement:"bottom-start",middleware:[offset({mainAxis:Number.parseFloat(window.getComputedStyle(document.body).getPropertyValue("--glide-core-spacing-xxs"))*Number.parseFloat(window.getComputedStyle(document.documentElement).fontSize)}),flip()]});this.#E.value.dataset.placement=i,Object.assign(this.#E.value.style,{left:`${e}px`,top:`${t}px`}),this.#E.value?.showPopover()}})()}))))}#l(){if((this.filterable||this.isFilterable)&&this.#o.value){this.isFiltering=!1;for(const e of this.#a)e.hidden=!1}}};__decorate([property({attribute:"add-button-label",reflect:!0})],GlideCoreDropdown.prototype,"addButtonLabel",void 0),__decorate([property({reflect:!0,type:Boolean})],GlideCoreDropdown.prototype,"disabled",null),__decorate([property({reflect:!0,type:Boolean})],GlideCoreDropdown.prototype,"filterable",null),__decorate([property({attribute:"hide-label",reflect:!0,type:Boolean})],GlideCoreDropdown.prototype,"hideLabel",void 0),__decorate([property({reflect:!0})],GlideCoreDropdown.prototype,"label",void 0),__decorate([property({reflect:!0})],GlideCoreDropdown.prototype,"name",void 0),__decorate([property({reflect:!0,type:Boolean})],GlideCoreDropdown.prototype,"open",null),__decorate([property({reflect:!0})],GlideCoreDropdown.prototype,"orientation",void 0),__decorate([property({reflect:!0})],GlideCoreDropdown.prototype,"placeholder",void 0),__decorate([property()],GlideCoreDropdown.prototype,"privateSplit",void 0),__decorate([property({reflect:!0,type:Boolean})],GlideCoreDropdown.prototype,"readonly",void 0),__decorate([property({attribute:"select-all",reflect:!0,type:Boolean})],GlideCoreDropdown.prototype,"selectAll",void 0),__decorate([property({reflect:!0})],GlideCoreDropdown.prototype,"size",null),__decorate([property({reflect:!0,type:Boolean})],GlideCoreDropdown.prototype,"multiple",null),__decorate([property({reflect:!0,type:Boolean})],GlideCoreDropdown.prototype,"required",void 0),__decorate([property({reflect:!0})],GlideCoreDropdown.prototype,"tooltip",void 0),__decorate([property({type:Array})],GlideCoreDropdown.prototype,"value",null),__decorate([property({reflect:!0})],GlideCoreDropdown.prototype,"variant",void 0),__decorate([property({reflect:!0})],GlideCoreDropdown.prototype,"version",void 0),__decorate([state()],GlideCoreDropdown.prototype,"ariaActivedescendant",void 0),__decorate([state()],GlideCoreDropdown.prototype,"inputValue",void 0),__decorate([state()],GlideCoreDropdown.prototype,"isBlurring",void 0),__decorate([state()],GlideCoreDropdown.prototype,"isCheckingValidity",void 0),__decorate([state()],GlideCoreDropdown.prototype,"isCommunicateItemCountToScreenreaders",void 0),__decorate([state()],GlideCoreDropdown.prototype,"isFilterable",void 0),__decorate([state()],GlideCoreDropdown.prototype,"isFiltering",void 0),__decorate([state()],GlideCoreDropdown.prototype,"isInputOverflow",void 0),__decorate([state()],GlideCoreDropdown.prototype,"isInputTooltipOpen",void 0),__decorate([state()],GlideCoreDropdown.prototype,"isInternalLabelOverflow",void 0),__decorate([state()],GlideCoreDropdown.prototype,"isInternalLabelTooltipOpen",void 0),__decorate([state()],GlideCoreDropdown.prototype,"isNoResults",void 0),__decorate([state()],GlideCoreDropdown.prototype,"isReportValidityOrSubmit",void 0),__decorate([state()],GlideCoreDropdown.prototype,"isShowSingleSelectIcon",void 0),__decorate([state()],GlideCoreDropdown.prototype,"itemCount",void 0),__decorate([state()],GlideCoreDropdown.prototype,"tagOverflowLimit",void 0),__decorate([state()],GlideCoreDropdown.prototype,"validityMessage",void 0),GlideCoreDropdown=__decorate([customElement("glide-core-dropdown")],GlideCoreDropdown);export default GlideCoreDropdown;const icons={plus:html`
|
268
272
|
<svg
|
269
273
|
aria-hidden="true"
|
270
274
|
viewBox="0 0 16 16"
|
@@ -7,7 +7,7 @@ declare global {
|
|
7
7
|
}
|
8
8
|
}
|
9
9
|
/**
|
10
|
-
* @slot icon - An icon before the label.
|
10
|
+
* @slot icon - An optional icon before the label.
|
11
11
|
*/
|
12
12
|
export default class GlideCoreDropdownOption extends LitElement {
|
13
13
|
#private;
|
@@ -26,8 +26,9 @@ export default class GlideCoreDropdownOption extends LitElement {
|
|
26
26
|
set selected(isSelected: boolean);
|
27
27
|
privateSize: 'small' | 'large';
|
28
28
|
privateActive: boolean;
|
29
|
-
private get isMultiple();
|
30
29
|
privateIsTooltipOpen: boolean;
|
30
|
+
readonly version: string;
|
31
|
+
private get isMultiple();
|
31
32
|
click(): void;
|
32
33
|
connectedCallback(): void;
|
33
34
|
disconnectedCallback(): void;
|
package/dist/dropdown.option.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var __decorate=this&&this.__decorate||function(e,t,i,o){var l,s=arguments.length,
|
1
|
+
var __decorate=this&&this.__decorate||function(e,t,i,o){var l,s=arguments.length,r=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,o);else for(var a=e.length-1;a>=0;a--)(l=e[a])&&(r=(s<3?l(r):s>3?l(t,i,r):l(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r};import"./checkbox.js";import"./tooltip.js";import{html,LitElement}from"lit";import{classMap}from"lit/directives/class-map.js";import{createRef,ref}from"lit/directives/ref.js";import{customElement,property,state}from"lit/decorators.js";import{nanoid}from"nanoid";import{when}from"lit/directives/when.js";import packageJson from"../package.json"with{type:"json"};import checkedIcon from"./icons/checked.js";import pencilIcon from"./icons/pencil.js";import styles from"./dropdown.option.styles.js";let GlideCoreDropdownOption=class GlideCoreDropdownOption extends LitElement{constructor(){super(...arguments),this.privateIndeterminate=!1,this.privateIsEditActive=!1,this.privateMultiple=!1,this.privateSize="large",this.privateActive=!1,this.privateIsTooltipOpen=!1,this.version=packageJson.version,this.isLabelOverflow=!1,this.#e=createRef(),this.#t=createRef(),this.#i=nanoid(),this.#o=!1,this.#l=!1,this.#s="",this.#r=createRef(),this.#a=!1,this.#n=""}static{this.shadowRootOptions={...LitElement.shadowRootOptions,mode:"closed"}}static{this.styles=styles}get disabled(){return this.#o}set disabled(e){this.role=e?"none":"option",this.#o=e}get editable(){return this.#l}set editable(e){this.#l=e,this.dispatchEvent(new Event("private-editable-change",{bubbles:!0}))}get label(){return this.#s}set label(e){this.#s=e,setTimeout((()=>{this.#p()})),this.dispatchEvent(new Event("private-label-change",{bubbles:!0}))}get selected(){return this.#a}set selected(e){if(this.#a=e,this.ariaSelected=e.toString(),this.isMultiple)this.#e.value&&(this.#e.value.checked=e);else for(const e of this.#d)e!==this&&this.selected&&e.selected&&(e.selected=!1);this.dispatchEvent(new Event("private-selected-change",{bubbles:!0}))}get isMultiple(){return this.privateMultiple||this.closest("glide-core-dropdown")?.multiple}click(){this.privateMultiple?this.#e.value?.click():this.#t.value?.click()}connectedCallback(){super.connectedCallback(),this.id=this.#i,this.ariaSelected=this.selected.toString(),this.role=this.disabled?"none":"option",this.tabIndex=-1,this.#c=new IntersectionObserver((()=>{this.checkVisibility()&&this.#p()})),this.#c.observe(this)}disconnectedCallback(){super.disconnectedCallback(),this.#c?.disconnect()}firstUpdated(){this.#e.value&&(this.#e.value.checked=this.selected)}get value(){return this.#n}set value(e){this.dispatchEvent(new CustomEvent("private-value-change",{bubbles:!0,detail:{old:this.value,new:e}})),this.#n=e}async privateUpdateCheckbox(){await this.updateComplete,this.#e.value&&(this.#e.value.checked=this.selected)}render(){return html`<div class="${classMap({component:!0,active:this.privateActive,disabled:this.disabled,[this.privateSize]:!0})}" data-test="component" ${ref(this.#t)}>${when(this.isMultiple,(()=>html`<glide-core-checkbox class="${classMap({checkbox:!0,editable:this.editable,[this.privateSize]:!0})}" data-test="checkbox" label="${this.label??""}" tabindex="-1" private-label-tooltip-offset="${12}" private-size="${this.privateSize}" private-variant="minimal" value="${this.value}" internally-inert @click="${this.#h}" ?disabled="${this.disabled}" ?indeterminate="${this.privateIndeterminate}" ?private-show-label-tooltip="${this.privateIsTooltipOpen}" ?private-disable-label-tooltip="${this.disabled}" ${ref(this.#e)}><slot class="${classMap({"checkbox-icon-slot":!0,[this.privateSize]:!0})}" name="icon" slot="private-icon"></slot></glide-core-checkbox>${when(this.editable,(()=>html`<button class="${classMap({"edit-button":!0,active:this.privateIsEditActive,disabled:this.disabled,multiple:Boolean(this.isMultiple),[this.privateSize]:!0})}" data-test="edit-button" type="button" @mouseover="${this.#v}" @mouseout="${this.#b}">${pencilIcon}</button>`))}`),(()=>html`<div class="${classMap({option:!0,disabled:this.disabled,editable:this.editable,[this.privateSize]:!0})}"><slot class="${classMap({"icon-slot":!0,[this.privateSize]:!0})}" name="icon"></slot><glide-core-tooltip class="tooltip" data-test="tooltip" label="${this.label}" offset="${10}" ?disabled="${!this.isLabelOverflow||this.disabled}" ?open="${this.privateIsTooltipOpen}" screenreader-hidden @toggle="${this.#u}"><div class="label" data-test="label" slot="target" ${ref(this.#r)}>${this.label}</div></glide-core-tooltip>${when(this.selected,(()=>html`<div class="checked-icon-container" data-test="checked-icon-container">${checkedIcon}</div>`))} ${when(this.editable,(()=>html`<button class="${classMap({"edit-button":!0,active:this.privateActive&&this.privateIsEditActive,disabled:this.disabled,[this.privateSize]:!0})}" data-test="edit-button" type="button" @mouseover="${this.#v}" @mouseout="${this.#b}">${pencilIcon}</button>`))}</div>`))}</div>`}#e;#t;#i;#c;#o;#l;#s;#r;#a;#n;get#d(){return[...this.closest("glide-core-dropdown")?.querySelectorAll("glide-core-dropdown-option")??[]]}#h(e){e.stopPropagation()}#b(){this.privateIsEditActive=!1}#v(){this.privateIsEditActive=!0}#u(e){e.stopPropagation()}#p(){this.#r.value&&(this.isLabelOverflow=this.#r.value.scrollWidth>this.#r.value.clientWidth)}};__decorate([property({reflect:!0,type:Boolean})],GlideCoreDropdownOption.prototype,"disabled",null),__decorate([property({reflect:!0,type:Boolean})],GlideCoreDropdownOption.prototype,"editable",null),__decorate([property({reflect:!0})],GlideCoreDropdownOption.prototype,"label",null),__decorate([property({attribute:"private-indeterminate",type:Boolean})],GlideCoreDropdownOption.prototype,"privateIndeterminate",void 0),__decorate([property({type:Boolean})],GlideCoreDropdownOption.prototype,"privateIsEditActive",void 0),__decorate([property({attribute:"private-multiple",type:Boolean})],GlideCoreDropdownOption.prototype,"privateMultiple",void 0),__decorate([property({reflect:!0,type:Boolean})],GlideCoreDropdownOption.prototype,"selected",null),__decorate([property({attribute:"private-size",reflect:!0})],GlideCoreDropdownOption.prototype,"privateSize",void 0),__decorate([property({type:Boolean})],GlideCoreDropdownOption.prototype,"privateActive",void 0),__decorate([property({type:Boolean})],GlideCoreDropdownOption.prototype,"privateIsTooltipOpen",void 0),__decorate([property({reflect:!0})],GlideCoreDropdownOption.prototype,"version",void 0),__decorate([state()],GlideCoreDropdownOption.prototype,"isMultiple",null),__decorate([property({reflect:!0})],GlideCoreDropdownOption.prototype,"value",null),__decorate([state()],GlideCoreDropdownOption.prototype,"isLabelOverflow",void 0),GlideCoreDropdownOption=__decorate([customElement("glide-core-dropdown-option")],GlideCoreDropdownOption);export default GlideCoreDropdownOption;
|
package/dist/dropdown.styles.js
CHANGED
@@ -141,7 +141,7 @@ import{css}from"lit";import focusOutline from"./styles/focus-outline.js";import
|
|
141
141
|
}
|
142
142
|
}
|
143
143
|
|
144
|
-
.
|
144
|
+
.default-slot {
|
145
145
|
display: block;
|
146
146
|
padding: var(--glide-core-spacing-xxxs);
|
147
147
|
}
|
@@ -341,7 +341,7 @@ import{css}from"lit";import focusOutline from"./styles/focus-outline.js";import
|
|
341
341
|
flex-grow: 1;
|
342
342
|
font-family: var(--glide-core-font-sans);
|
343
343
|
font-size: inherit;
|
344
|
-
|
344
|
+
inline-size: 100%;
|
345
345
|
padding-block-end: 0;
|
346
346
|
padding-inline: 0;
|
347
347
|
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import './checkbox.js';
|
2
1
|
import './dropdown.option.js';
|
3
2
|
import './label.js';
|
4
3
|
import { LitElement } from 'lit';
|
@@ -16,6 +15,7 @@ export default class GlideCoreFormControlsLayout extends LitElement {
|
|
16
15
|
static styles: import("lit").CSSResult[];
|
17
16
|
get split(): "left" | "middle";
|
18
17
|
set split(split: 'left' | 'middle');
|
18
|
+
readonly version: string;
|
19
19
|
firstUpdated(): void;
|
20
20
|
render(): import("lit").TemplateResult<1>;
|
21
21
|
}
|
@@ -1 +1 @@
|
|
1
|
-
var __decorate=this&&this.__decorate||function(e,o,t,r){var l,s=arguments.length,i=s<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,o,t,r);else for(var n=e.length-1;n>=0;n--)(l=e[n])&&(i=(s<3?l(i):s>3?l(o,t,i):l(o,t))||i);return s>3&&i&&Object.defineProperty(o,t,i),i};import"./
|
1
|
+
var __decorate=this&&this.__decorate||function(e,o,t,r){var l,s=arguments.length,i=s<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,o,t,r);else for(var n=e.length-1;n>=0;n--)(l=e[n])&&(i=(s<3?l(i):s>3?l(o,t,i):l(o,t))||i);return s>3&&i&&Object.defineProperty(o,t,i),i};import"./dropdown.option.js";import"./label.js";import{html,LitElement}from"lit";import{createRef,ref}from"lit/directives/ref.js";import{customElement,property}from"lit/decorators.js";import packageJson from"../package.json"with{type:"json"};import GlideCoreCheckbox from"./checkbox.js";import GlideCoreCheckboxGroup from"./checkbox-group.js";import GlideCoreDropdown from"./dropdown.js";import GlideCoreInput from"./input.js";import GlideCoreTextArea from"./textarea.js";import ow,{owSlot,owSlotType}from"./library/ow.js";import styles from"./form-controls-layout.styles.js";let GlideCoreFormControlsLayout=class GlideCoreFormControlsLayout extends LitElement{constructor(){super(...arguments),this.version=packageJson.version,this.#e=createRef(),this.#o="left"}static{this.shadowRootOptions={...LitElement.shadowRootOptions,mode:"closed"}}static{this.styles=styles}get split(){return this.#o}set split(e){if(this.#o=e,this.#e.value)for(const e of this.#e.value.assignedElements())"privateSplit"in e&&(e.privateSplit=this.split)}firstUpdated(){owSlot(this.#e.value),owSlotType(this.#e.value,[GlideCoreCheckbox,GlideCoreCheckboxGroup,GlideCoreDropdown,GlideCoreInput,GlideCoreTextArea]),this.#t()}render(){return html`<div class="component"><slot @slotchange="${this.#r}" ${ref(this.#e)}></slot></div>`}#e;#o;#t(){owSlot(this.#e.value);for(const e of this.#e.value.assignedElements())"orientation"in e&&ow("horizontal"===e.orientation,ow.boolean.true.message("Only horizontal controls are supported."))}#r(){owSlot(this.#e.value),owSlotType(this.#e.value,[GlideCoreCheckbox,GlideCoreCheckboxGroup,GlideCoreDropdown,GlideCoreInput,GlideCoreTextArea]),this.#t();for(const e of this.#e.value.assignedElements())"privateSplit"in e&&(e.privateSplit=this.split)}};__decorate([property({reflect:!0})],GlideCoreFormControlsLayout.prototype,"split",null),__decorate([property({reflect:!0})],GlideCoreFormControlsLayout.prototype,"version",void 0),GlideCoreFormControlsLayout=__decorate([customElement("glide-core-form-controls-layout")],GlideCoreFormControlsLayout);export default GlideCoreFormControlsLayout;
|
package/dist/icon-button.d.ts
CHANGED
@@ -17,6 +17,7 @@ export default class GlideCoreIconButton extends LitElement {
|
|
17
17
|
disabled: boolean;
|
18
18
|
label: string;
|
19
19
|
variant: 'primary' | 'secondary' | 'tertiary';
|
20
|
+
readonly version: string;
|
20
21
|
click(): void;
|
21
22
|
firstUpdated(): void;
|
22
23
|
render(): import("lit").TemplateResult<1>;
|
package/dist/icon-button.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var __decorate=this&&this.__decorate||function(t,e,o,r){var i,a=arguments.length,l=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,o,r);else for(var n=t.length-1;n>=0;n--)(i=t[n])&&(l=(a<3?i(l):a>3?i(e,o,l):i(e,o))||l);return a>3&&l&&Object.defineProperty(e,o,l),l};import{LitElement
|
1
|
+
var __decorate=this&&this.__decorate||function(t,e,o,r){var i,a=arguments.length,l=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,o,r);else for(var n=t.length-1;n>=0;n--)(i=t[n])&&(l=(a<3?i(l):a>3?i(e,o,l):i(e,o))||l);return a>3&&l&&Object.defineProperty(e,o,l),l};import{html,LitElement}from"lit";import{classMap}from"lit/directives/class-map.js";import{createRef,ref}from"lit/directives/ref.js";import{customElement,property}from"lit/decorators.js";import{ifDefined}from"lit/directives/if-defined.js";import packageJson from"../package.json"with{type:"json"};import{owSlot}from"./library/ow.js";import styles from"./icon-button.styles.js";let GlideCoreIconButton=class GlideCoreIconButton extends LitElement{constructor(){super(...arguments),this.ariaControls=null,this.ariaExpanded=null,this.ariaHasPopup=null,this.disabled=!1,this.label="",this.variant="primary",this.version=packageJson.version,this.#t=createRef(),this.#e=createRef()}static{this.shadowRootOptions={...LitElement.shadowRootOptions,delegatesFocus:!0,mode:"closed"}}static{this.styles=styles}click(){this.#t.value?.click()}firstUpdated(){owSlot(this.#e.value)}render(){return html`<button aria-controls="${ifDefined(this.ariaControls??void 0)}" aria-expanded="${ifDefined(this.ariaExpanded??void 0)}" aria-haspopup="${ifDefined(this.ariaHasPopup??void 0)}" aria-label="${this.label}" class="${classMap({component:!0,primary:"primary"===this.variant,secondary:"secondary"===this.variant,tertiary:"tertiary"===this.variant})}" data-test="button" type="button" ?disabled="${this.disabled}" ${ref(this.#t)}><slot @slotchange="${this.#o}" ${ref(this.#e)}></slot></button>`}#t;#e;#o(){owSlot(this.#e.value)}};__decorate([property({attribute:"aria-controls",reflect:!0})],GlideCoreIconButton.prototype,"ariaControls",void 0),__decorate([property({attribute:"aria-expanded",reflect:!0})],GlideCoreIconButton.prototype,"ariaExpanded",void 0),__decorate([property({attribute:"aria-haspopup",reflect:!0})],GlideCoreIconButton.prototype,"ariaHasPopup",void 0),__decorate([property({type:Boolean,reflect:!0})],GlideCoreIconButton.prototype,"disabled",void 0),__decorate([property()],GlideCoreIconButton.prototype,"label",void 0),__decorate([property({reflect:!0})],GlideCoreIconButton.prototype,"variant",void 0),__decorate([property({reflect:!0})],GlideCoreIconButton.prototype,"version",void 0),GlideCoreIconButton=__decorate([customElement("glide-core-icon-button")],GlideCoreIconButton);export default GlideCoreIconButton;
|
package/dist/inline-alert.d.ts
CHANGED
@@ -16,6 +16,7 @@ export default class GlideCoreInlineAlert extends LitElement {
|
|
16
16
|
static styles: import("lit").CSSResult[];
|
17
17
|
variant: keyof typeof icons;
|
18
18
|
removable?: boolean | undefined;
|
19
|
+
readonly version: string;
|
19
20
|
firstUpdated(): void;
|
20
21
|
focus(): void;
|
21
22
|
render(): import("lit").TemplateResult<1>;
|
package/dist/inline-alert.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var __decorate=this&&this.__decorate||function(e,t,i
|
1
|
+
var __decorate=this&&this.__decorate||function(e,t,o,i){var l,r=arguments.length,n=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(l=e[a])&&(n=(r<3?l(n):r>3?l(t,o,n):l(t,o))||n);return r>3&&n&&Object.defineProperty(t,o,n),n};import"./icon-button.js";import{html,LitElement}from"lit";import{classMap}from"lit/directives/class-map.js";import{createRef,ref}from"lit/directives/ref.js";import{customElement,property}from"lit/decorators.js";import{styleMap}from"lit/directives/style-map.js";import{when}from"lit/directives/when.js";import packageJson from"../package.json"with{type:"json"};import{owSlot}from"./library/ow.js";import{LocalizeController}from"./library/localize.js";import styles from"./inline-alert.styles.js";import xIcon from"./icons/x.js";let GlideCoreInlineAlert=class GlideCoreInlineAlert extends LitElement{constructor(){super(...arguments),this.variant="informational",this.removable=!1,this.version=packageJson.version,this.#e=100,this.#t=createRef(),this.#o=createRef(),this.#i=!1,this.#l=new LocalizeController(this),this.#r=createRef()}static{this.shadowRootOptions={...LitElement.shadowRootOptions,mode:"closed"}}static{this.styles=styles}firstUpdated(){owSlot(this.#o.value),this.#t.value?.addEventListener("animationend",(()=>{this.#t.value?.classList.remove("added")}),{once:!0})}focus(){this.#r.value?.focus()}render(){return html`<div class="${classMap({component:!0,added:!0,[this.variant]:!0})}" role="alert" aria-labelledby="label" data-test="component" data-animation-duration="${this.#e}" style="--animation-duration: ${this.#e}ms" ${ref(this.#t)}><div aria-hidden="true" class="${classMap({"icon-container":!0,[this.variant]:!0})}">${icons[this.variant]}</div><div id="label" class="content"><slot @slotchange="${this.#n}" ${ref(this.#o)}></slot></div>${when(this.removable,(()=>html`<glide-core-icon-button label="${this.#l.term("closeInlineAlert",this.variant)}" variant="tertiary" class="removal-button" data-test="removal-button" @click="${this.#a}" @keydown="${this.#s}" ${ref(this.#r)}>${xIcon}</glide-core-icon-button>`))}</div>`}#e;#t;#o;#i;#l;#r;#n(){owSlot(this.#o.value)}#a(){this.#i?this.#i=!1:(setTimeout((()=>{this.remove()}),this.#e),this.#t.value?.classList.add("removed"),this.dispatchEvent(new Event("remove",{bubbles:!0,composed:!0})))}#s(e){["Enter"," "].includes(e.key)&&(this.#i=!0,setTimeout((()=>{this.remove()}),this.#e),this.#t.value?.classList.add("removed"),this.dispatchEvent(new Event("remove",{bubbles:!0,composed:!0})))}};__decorate([property({reflect:!0})],GlideCoreInlineAlert.prototype,"variant",void 0),__decorate([property({reflect:!0,type:Boolean})],GlideCoreInlineAlert.prototype,"removable",void 0),__decorate([property({reflect:!0})],GlideCoreInlineAlert.prototype,"version",void 0),GlideCoreInlineAlert=__decorate([customElement("glide-core-inline-alert")],GlideCoreInlineAlert);export default GlideCoreInlineAlert;const icons={informational:html`<svg aria-hidden="true" viewBox="0 0 16 16" fill="none" style="${styleMap({height:"var(--size, 1rem)",width:"var(--size, 1rem)"})}"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.99996 0.666672C3.94987 0.666672 0.666626 3.94992 0.666626 8C0.666626 12.0501 3.94987 15.3333 7.99996 15.3333C12.05 15.3333 15.3333 12.0501 15.3333 8C15.3333 3.94992 12.05 0.666672 7.99996 0.666672ZM8.66663 5.33334C8.66663 4.96515 8.36815 4.66667 7.99996 4.66667C7.63177 4.66667 7.33329 4.96515 7.33329 5.33334V8C7.33329 8.36819 7.63177 8.66667 7.99996 8.66667C8.36815 8.66667 8.66663 8.36819 8.66663 8V5.33334ZM7.99996 10C7.63177 10 7.33329 10.2985 7.33329 10.6667C7.33329 11.0349 7.63177 11.3333 7.99996 11.3333H8.00663C8.37482 11.3333 8.67329 11.0349 8.67329 10.6667C8.67329 10.2985 8.37482 10 8.00663 10H7.99996Z" fill="currentColor"/></svg>`,medium:html`<svg aria-hidden="true" viewBox="0 0 16 16" fill="none" style="${styleMap({height:"var(--size, 1rem)",width:"var(--size, 1rem)"})}"><path fill-rule="evenodd" clip-rule="evenodd" d="M8.54175 1.44697C8.19688 1.29362 7.80317 1.29362 7.45829 1.44697C7.19194 1.5654 7.01892 1.77402 6.89852 1.944C6.78014 2.11113 6.6534 2.33007 6.51402 2.57087L1.00258 12.0906C0.862641 12.3323 0.735472 12.5519 0.649245 12.7383C0.561611 12.9277 0.466542 13.1824 0.496841 13.473C0.536048 13.849 0.733076 14.1908 1.03889 14.4131C1.27522 14.585 1.54321 14.6303 1.75105 14.6493C1.95555 14.6681 2.20932 14.6681 2.48858 14.668H13.5114C13.7907 14.6681 14.0445 14.6681 14.249 14.6493C14.4568 14.6303 14.7248 14.585 14.9612 14.4131C15.267 14.1908 15.464 13.849 15.5032 13.473C15.5335 13.1824 15.4384 12.9277 15.3508 12.7383C15.2646 12.5519 15.1374 12.3323 14.9975 12.0907L9.48601 2.57085C9.34664 2.33006 9.2199 2.11112 9.10153 1.944C8.98113 1.77401 8.80811 1.5654 8.54175 1.44697ZM8.66671 6.33472C8.66671 5.96653 8.36823 5.66806 8.00004 5.66806C7.63185 5.66806 7.33337 5.96653 7.33337 6.33472V9.00139C7.33337 9.36958 7.63185 9.66805 8.00004 9.66805C8.36823 9.66805 8.66671 9.36958 8.66671 9.00139V6.33472ZM8.00004 11.0014C7.63185 11.0014 7.33337 11.2999 7.33337 11.6681C7.33337 12.0362 7.63185 12.3347 8.00004 12.3347H8.00671C8.3749 12.3347 8.67337 12.0362 8.67337 11.6681C8.67337 11.2999 8.3749 11.0014 8.00671 11.0014H8.00004Z" fill="currentColor"/></svg>`,high:html`<svg aria-hidden="true" viewBox="0 0 16 16" fill="none" style="${styleMap({height:"var(--size, 1rem)",width:"var(--size, 1rem)"})}"><path fill-rule="evenodd" clip-rule="evenodd" d="M11.8924 1.33334H4.10768C3.75626 1.33333 3.45307 1.33332 3.20336 1.35372C2.93979 1.37525 2.67765 1.4228 2.42539 1.55132C2.04907 1.74307 1.74311 2.04903 1.55136 2.42536C1.42283 2.67761 1.37529 2.93976 1.35376 3.20332C1.33335 3.45303 1.33336 3.75619 1.33337 4.10762V11.8924C1.33336 12.2438 1.33335 12.547 1.35376 12.7967C1.37529 13.0603 1.42283 13.3224 1.55136 13.5747C1.74311 13.951 2.04907 14.2569 2.42539 14.4487C2.67765 14.5772 2.93979 14.6248 3.20336 14.6463C3.45307 14.6667 3.75624 14.6667 4.10766 14.6667H11.8924C12.2438 14.6667 12.547 14.6667 12.7967 14.6463C13.0603 14.6248 13.3224 14.5772 13.5747 14.4487C13.951 14.2569 14.257 13.951 14.4487 13.5747C14.5773 13.3224 14.6248 13.0603 14.6463 12.7967C14.6667 12.547 14.6667 12.2438 14.6667 11.8924V4.10763C14.6667 3.7562 14.6667 3.45303 14.6463 3.20332C14.6248 2.93976 14.5773 2.67761 14.4487 2.42536C14.257 2.04903 13.951 1.74307 13.5747 1.55132C13.3224 1.4228 13.0603 1.37525 12.7967 1.35372C12.547 1.33332 12.2438 1.33333 11.8924 1.33334ZM8.66671 5.33334C8.66671 4.96515 8.36823 4.66667 8.00004 4.66667C7.63185 4.66667 7.33337 4.96515 7.33337 5.33334V8C7.33337 8.36819 7.63185 8.66667 8.00004 8.66667C8.36823 8.66667 8.66671 8.36819 8.66671 8V5.33334ZM8.00004 10C7.63185 10 7.33337 10.2985 7.33337 10.6667C7.33337 11.0349 7.63185 11.3333 8.00004 11.3333H8.00671C8.3749 11.3333 8.67338 11.0349 8.67338 10.6667C8.67338 10.2985 8.3749 10 8.00671 10H8.00004Z" fill="currentColor"/></svg>`,critical:html`<svg aria-hidden="true" viewBox="0 0 16 16" fill="none" style="${styleMap({height:"var(--size, 1rem)",width:"var(--size, 1rem)"})}"><path fill-rule="evenodd" clip-rule="evenodd" d="M8.26864 0.790031C8.09143 0.753584 7.90865 0.753584 7.73144 0.790031C7.52659 0.832161 7.3435 0.934713 7.19794 1.01624L7.15826 1.03841L2.22493 3.77915L2.18284 3.8024C2.02875 3.88727 1.835 3.99398 1.68622 4.15543C1.55759 4.29502 1.46024 4.46046 1.40069 4.6407C1.33181 4.84916 1.33262 5.07035 1.33326 5.24627L1.33338 5.29435V10.7058L1.33326 10.7538C1.33262 10.9298 1.33181 11.1509 1.40069 11.3594C1.46024 11.5397 1.55759 11.7051 1.68622 11.8447C1.835 12.0061 2.02873 12.1128 2.18281 12.1977L2.22493 12.221L7.15826 14.9617L7.19793 14.9839C7.34349 15.0654 7.52659 15.1679 7.73144 15.2101C7.90865 15.2465 8.09143 15.2465 8.26864 15.2101C8.4735 15.1679 8.65659 15.0654 8.80215 14.9839L8.84182 14.9617L13.7752 12.221L13.8172 12.1977C13.9713 12.1128 14.1651 12.0061 14.3139 11.8447C14.4425 11.7051 14.5398 11.5397 14.5994 11.3594C14.6683 11.1509 14.6675 10.9298 14.6668 10.7538L14.6667 10.7058V5.29435L14.6668 5.24627C14.6675 5.07035 14.6683 4.84916 14.5994 4.6407C14.5398 4.46046 14.4425 4.29502 14.3139 4.15543C14.1651 3.99398 13.9713 3.88727 13.8172 3.8024L13.7752 3.77915L8.84182 1.03841L8.80215 1.01624C8.65659 0.934713 8.47349 0.832161 8.26864 0.790031ZM8.66671 5.33333C8.66671 4.96514 8.36823 4.66667 8.00004 4.66667C7.63185 4.66667 7.33337 4.96514 7.33337 5.33333V8C7.33337 8.36819 7.63185 8.66667 8.00004 8.66667C8.36823 8.66667 8.66671 8.36819 8.66671 8V5.33333ZM8.00004 10C7.63185 10 7.33337 10.2985 7.33337 10.6667C7.33337 11.0349 7.63185 11.3333 8.00004 11.3333H8.00671C8.3749 11.3333 8.67337 11.0349 8.67337 10.6667C8.67337 10.2985 8.3749 10 8.00671 10H8.00004Z" fill="currentColor"/></svg>`};
|
package/dist/input.d.ts
CHANGED
@@ -13,7 +13,6 @@ type SupportedTypes = (typeof SUPPORTED_TYPES)[number];
|
|
13
13
|
* @event input
|
14
14
|
* @event invalid
|
15
15
|
*
|
16
|
-
* @slot tooltip - Content for the tooltip.
|
17
16
|
* @slot description - Additional information or context.
|
18
17
|
* @slot prefix-icon - An optional icon before the input field.
|
19
18
|
* @slot suffix-icon - An optional icon after the input field.
|
@@ -42,6 +41,8 @@ export default class GlideCoreInput extends LitElement {
|
|
42
41
|
disabled: boolean;
|
43
42
|
privateSplit?: 'left' | 'middle';
|
44
43
|
maxlength?: number;
|
44
|
+
readonly version: string;
|
45
|
+
tooltip?: string;
|
45
46
|
get form(): HTMLFormElement | null;
|
46
47
|
get validity(): ValidityState;
|
47
48
|
get willValidate(): boolean;
|
@@ -52,6 +53,7 @@ export default class GlideCoreInput extends LitElement {
|
|
52
53
|
formResetCallback(): void;
|
53
54
|
render(): import("lit").TemplateResult<1>;
|
54
55
|
reportValidity(): boolean;
|
56
|
+
resetValidityFeedback(): void;
|
55
57
|
setCustomValidity(message: string): void;
|
56
58
|
setValidity(flags?: ValidityStateFlags, message?: string): void;
|
57
59
|
constructor();
|