@edugis-org/webmapx 0.1.7 → 0.1.9
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-lib/{decorate-CWgUV1hU.js → decorate-DnZTfaod.js} +6 -6
- package/dist-lib/dist-BIbq3o-p.js +213 -0
- package/dist-lib/{dist-Dm6b7XCs.js → dist-CKAaoSoW.js} +2743 -2491
- package/dist-lib/{dist-kKlmcBXq.js → dist-CWCNMXMK.js} +1 -1
- package/dist-lib/{dist-Ha9LQCut.js → dist-D-5Gmgwo.js} +1 -1
- package/dist-lib/{layer-discovery-afWzu5hY.js → layer-discovery-DFP-WHAh.js} +1 -1
- package/dist-lib/{leaflet-adapter-D9djjrKv.js → leaflet-adapter-A0rte-c7.js} +1 -1
- package/dist-lib/{maplibre-adapter-TFc3e0G9.js → maplibre-adapter-Cy6yX6o7.js} +1 -1
- package/dist-lib/ol-tilegrid-Ct4my3IN.js +24 -0
- package/dist-lib/openlayers-adapter-B8WtV1tn.js +1462 -0
- package/dist-lib/{toast-Cm28o9U6.js → toast-BsoXOdeA.js} +1 -1
- package/dist-lib/{webmapx-3d-tool-D4CTD2gB.js → webmapx-3d-tool-CLppA7mK.js} +13 -13
- package/dist-lib/{webmapx-base-tool-Dm9NAWLD.js → webmapx-base-tool-DfRa7TlD.js} +1 -1
- package/dist-lib/{webmapx-config-edit-tool-BgcSkmmg.js → webmapx-config-edit-tool-BztWspia.js} +21 -21
- package/dist-lib/{webmapx-coordinates-tool-GMfztOzE.js → webmapx-coordinates-tool-DnTSkrRG.js} +20 -20
- package/dist-lib/{webmapx-core-bundle-BDImi1RE.js → webmapx-core-bundle-CH-5vYXU.js} +607 -1519
- package/dist-lib/webmapx-draw-tool-DxQgUF1Q.js +2117 -0
- package/dist-lib/{webmapx-geolocation-tool-Rw3-Iad1.js → webmapx-geolocation-tool-DIMh2kIr.js} +26 -25
- package/dist-lib/{webmapx-import-layer-tool-DRYviHd5.js → webmapx-import-layer-tool-DMiC1TpU.js} +16 -16
- package/dist-lib/{webmapx-info-tool-BJA157cy.js → webmapx-info-tool-D-XbAU9J.js} +56 -56
- package/dist-lib/{webmapx-language-osmvector-M5y_lwOg.js → webmapx-language-osmvector-BAw9TR-M.js} +12 -11
- package/dist-lib/{webmapx-measure-tool-BXhMJFC6.js → webmapx-measure-tool-CXlg11s8.js} +34 -34
- package/dist-lib/{webmapx-modal-tool-eF6Naluv.js → webmapx-modal-tool-Cs7LRrgW.js} +3 -3
- package/dist-lib/{webmapx-plugin-tool-D2Hghf9n.js → webmapx-plugin-tool-qe2yTrWB.js} +7 -7
- package/dist-lib/{webmapx-print-tool-ob1bOsR5.js → webmapx-print-tool-DrK9sLC7.js} +27 -26
- package/dist-lib/{webmapx-search-tool-Cv8BrYvY.js → webmapx-search-tool-H7NisgWH.js} +11 -11
- package/dist-lib/webmapx-settings-EHSm-AGU.js +167 -0
- package/dist-lib/{webmapx-truearea-tool-CMB4Orm-.js → webmapx-truearea-tool-CSU9mE1D.js} +26 -26
- package/dist-lib/{webmapx-view-mode-tool-CUpLNjOj.js → webmapx-view-mode-tool-D1QyQfq8.js} +9 -9
- package/dist-lib/webmapx.css +1 -1
- package/dist-lib/webmapx.js +42 -41
- package/package.json +1 -1
- package/dist-lib/WMTS-DCN4zX0-.js +0 -1169
- package/dist-lib/alert-GeHlqlN8.js +0 -310
- package/dist-lib/button-DFdGkRPQ.js +0 -741
- package/dist-lib/checkbox-QoR4S8tV.js +0 -284
- package/dist-lib/chunk.36O46B5H-B6ZL7Sm1.js +0 -77
- package/dist-lib/chunk.3RPBFEDE-BFO1fHVm.js +0 -138
- package/dist-lib/chunk.5JY5FUCG-DTXsslmx.js +0 -1090
- package/dist-lib/chunk.6CTB5ZDJ-DjZrBd6Y.js +0 -99
- package/dist-lib/chunk.AJ3ENQ5C-Ci7Gm2b6.js +0 -175
- package/dist-lib/chunk.LD4M4QGE-CiCfhE8r.js +0 -8
- package/dist-lib/chunk.NYIIDP5N-BikXIStD.js +0 -99
- package/dist-lib/chunk.RWUUFNUL-DFztA4uV.js +0 -43
- package/dist-lib/chunk.SI4ACBFK-CLb9VfMG.js +0 -61
- package/dist-lib/chunk.YHLNUJ7P-D-kanrCf.js +0 -503
- package/dist-lib/decorators-B35AgiCU.js +0 -351
- package/dist-lib/dist-c1PlDAd1.js +0 -2359
- package/dist-lib/divider-CPm675yY.js +0 -41
- package/dist-lib/icon-CEOgWlro.js +0 -9
- package/dist-lib/icon-button-Da_nBTy3.js +0 -408
- package/dist-lib/input-CeGntPlT.js +0 -590
- package/dist-lib/ol-tilegrid-9VtyxaLG.js +0 -64
- package/dist-lib/openlayers-adapter-DVW1KCRv.js +0 -13307
- package/dist-lib/option-CBxl1mZP.js +0 -1106
- package/dist-lib/rbush-C8k41T4z.js +0 -254
- package/dist-lib/spinner-DysxdNG9.js +0 -6
- package/dist-lib/tooltip-Cucn1SiD.js +0 -197
- package/dist-lib/webmapx-draw-tool-DooAV8cF.js +0 -4336
- package/dist-lib/webmapx-settings-DDEJ8aoV.js +0 -479
|
@@ -1,1106 +0,0 @@
|
|
|
1
|
-
import { a as e, i as t, n } from "./decorators-B35AgiCU.js";
|
|
2
|
-
import { a as r, c as i, i as a, o, s, t as c } from "./chunk.AJ3ENQ5C-Ci7Gm2b6.js";
|
|
3
|
-
import { d as l, f as u, l as d, t as f, u as p } from "./chunk.YHLNUJ7P-D-kanrCf.js";
|
|
4
|
-
import { a as m, t as h } from "./chunk.NYIIDP5N-BikXIStD.js";
|
|
5
|
-
import { t as g } from "./chunk.6CTB5ZDJ-DjZrBd6Y.js";
|
|
6
|
-
import { t as _ } from "./chunk.3RPBFEDE-BFO1fHVm.js";
|
|
7
|
-
import { t as v } from "./chunk.SI4ACBFK-CLb9VfMG.js";
|
|
8
|
-
import { n as y, t as b } from "./chunk.5JY5FUCG-DTXsslmx.js";
|
|
9
|
-
import { n as x } from "./chunk.RWUUFNUL-DFztA4uV.js";
|
|
10
|
-
import { css as S, html as C } from "lit";
|
|
11
|
-
//#region node_modules/@shoelace-style/shoelace/dist/chunks/chunk.V2OL7VMD.js
|
|
12
|
-
var w = S`
|
|
13
|
-
:host {
|
|
14
|
-
display: inline-block;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.tag {
|
|
18
|
-
display: flex;
|
|
19
|
-
align-items: center;
|
|
20
|
-
border: solid 1px;
|
|
21
|
-
line-height: 1;
|
|
22
|
-
white-space: nowrap;
|
|
23
|
-
user-select: none;
|
|
24
|
-
-webkit-user-select: none;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.tag__remove::part(base) {
|
|
28
|
-
color: inherit;
|
|
29
|
-
padding: 0;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/*
|
|
33
|
-
* Variant modifiers
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
|
-
.tag--primary {
|
|
37
|
-
background-color: var(--sl-color-primary-50);
|
|
38
|
-
border-color: var(--sl-color-primary-200);
|
|
39
|
-
color: var(--sl-color-primary-800);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.tag--primary:active > sl-icon-button {
|
|
43
|
-
color: var(--sl-color-primary-600);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.tag--success {
|
|
47
|
-
background-color: var(--sl-color-success-50);
|
|
48
|
-
border-color: var(--sl-color-success-200);
|
|
49
|
-
color: var(--sl-color-success-800);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.tag--success:active > sl-icon-button {
|
|
53
|
-
color: var(--sl-color-success-600);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.tag--neutral {
|
|
57
|
-
background-color: var(--sl-color-neutral-50);
|
|
58
|
-
border-color: var(--sl-color-neutral-200);
|
|
59
|
-
color: var(--sl-color-neutral-800);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.tag--neutral:active > sl-icon-button {
|
|
63
|
-
color: var(--sl-color-neutral-600);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.tag--warning {
|
|
67
|
-
background-color: var(--sl-color-warning-50);
|
|
68
|
-
border-color: var(--sl-color-warning-200);
|
|
69
|
-
color: var(--sl-color-warning-800);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.tag--warning:active > sl-icon-button {
|
|
73
|
-
color: var(--sl-color-warning-600);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.tag--danger {
|
|
77
|
-
background-color: var(--sl-color-danger-50);
|
|
78
|
-
border-color: var(--sl-color-danger-200);
|
|
79
|
-
color: var(--sl-color-danger-800);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.tag--danger:active > sl-icon-button {
|
|
83
|
-
color: var(--sl-color-danger-600);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/*
|
|
87
|
-
* Size modifiers
|
|
88
|
-
*/
|
|
89
|
-
|
|
90
|
-
.tag--small {
|
|
91
|
-
font-size: var(--sl-button-font-size-small);
|
|
92
|
-
height: calc(var(--sl-input-height-small) * 0.8);
|
|
93
|
-
line-height: calc(var(--sl-input-height-small) - var(--sl-input-border-width) * 2);
|
|
94
|
-
border-radius: var(--sl-input-border-radius-small);
|
|
95
|
-
padding: 0 var(--sl-spacing-x-small);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.tag--medium {
|
|
99
|
-
font-size: var(--sl-button-font-size-medium);
|
|
100
|
-
height: calc(var(--sl-input-height-medium) * 0.8);
|
|
101
|
-
line-height: calc(var(--sl-input-height-medium) - var(--sl-input-border-width) * 2);
|
|
102
|
-
border-radius: var(--sl-input-border-radius-medium);
|
|
103
|
-
padding: 0 var(--sl-spacing-small);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.tag--large {
|
|
107
|
-
font-size: var(--sl-button-font-size-large);
|
|
108
|
-
height: calc(var(--sl-input-height-large) * 0.8);
|
|
109
|
-
line-height: calc(var(--sl-input-height-large) - var(--sl-input-border-width) * 2);
|
|
110
|
-
border-radius: var(--sl-input-border-radius-large);
|
|
111
|
-
padding: 0 var(--sl-spacing-medium);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.tag__remove {
|
|
115
|
-
margin-inline-start: var(--sl-spacing-x-small);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/*
|
|
119
|
-
* Pill modifier
|
|
120
|
-
*/
|
|
121
|
-
|
|
122
|
-
.tag--pill {
|
|
123
|
-
border-radius: var(--sl-border-radius-pill);
|
|
124
|
-
}
|
|
125
|
-
`, T = class extends d {
|
|
126
|
-
constructor() {
|
|
127
|
-
super(...arguments), this.localize = new g(this), this.variant = "neutral", this.size = "medium", this.pill = !1, this.removable = !1;
|
|
128
|
-
}
|
|
129
|
-
handleRemoveClick() {
|
|
130
|
-
this.emit("sl-remove");
|
|
131
|
-
}
|
|
132
|
-
render() {
|
|
133
|
-
return C`
|
|
134
|
-
<span
|
|
135
|
-
part="base"
|
|
136
|
-
class=${m({
|
|
137
|
-
tag: !0,
|
|
138
|
-
"tag--primary": this.variant === "primary",
|
|
139
|
-
"tag--success": this.variant === "success",
|
|
140
|
-
"tag--neutral": this.variant === "neutral",
|
|
141
|
-
"tag--warning": this.variant === "warning",
|
|
142
|
-
"tag--danger": this.variant === "danger",
|
|
143
|
-
"tag--text": this.variant === "text",
|
|
144
|
-
"tag--small": this.size === "small",
|
|
145
|
-
"tag--medium": this.size === "medium",
|
|
146
|
-
"tag--large": this.size === "large",
|
|
147
|
-
"tag--pill": this.pill,
|
|
148
|
-
"tag--removable": this.removable
|
|
149
|
-
})}
|
|
150
|
-
>
|
|
151
|
-
<slot part="content" class="tag__content"></slot>
|
|
152
|
-
|
|
153
|
-
${this.removable ? C`
|
|
154
|
-
<sl-icon-button
|
|
155
|
-
part="remove-button"
|
|
156
|
-
exportparts="base:remove-button__base"
|
|
157
|
-
name="x-lg"
|
|
158
|
-
library="system"
|
|
159
|
-
label=${this.localize.term("remove")}
|
|
160
|
-
class="tag__remove"
|
|
161
|
-
@click=${this.handleRemoveClick}
|
|
162
|
-
tabindex="-1"
|
|
163
|
-
></sl-icon-button>
|
|
164
|
-
` : ""}
|
|
165
|
-
</span>
|
|
166
|
-
`;
|
|
167
|
-
}
|
|
168
|
-
};
|
|
169
|
-
T.styles = [p, w], T.dependencies = { "sl-icon-button": i }, u([e({ reflect: !0 })], T.prototype, "variant", 2), u([e({ reflect: !0 })], T.prototype, "size", 2), u([e({
|
|
170
|
-
type: Boolean,
|
|
171
|
-
reflect: !0
|
|
172
|
-
})], T.prototype, "pill", 2), u([e({ type: Boolean })], T.prototype, "removable", 2);
|
|
173
|
-
//#endregion
|
|
174
|
-
//#region node_modules/@shoelace-style/shoelace/dist/chunks/chunk.XNOUITPX.js
|
|
175
|
-
var E = S`
|
|
176
|
-
:host {
|
|
177
|
-
display: block;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
/** The popup */
|
|
181
|
-
.select {
|
|
182
|
-
flex: 1 1 auto;
|
|
183
|
-
display: inline-flex;
|
|
184
|
-
width: 100%;
|
|
185
|
-
position: relative;
|
|
186
|
-
vertical-align: middle;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
.select::part(popup) {
|
|
190
|
-
z-index: var(--sl-z-index-dropdown);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
.select[data-current-placement^='top']::part(popup) {
|
|
194
|
-
transform-origin: bottom;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
.select[data-current-placement^='bottom']::part(popup) {
|
|
198
|
-
transform-origin: top;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
/* Combobox */
|
|
202
|
-
.select__combobox {
|
|
203
|
-
flex: 1;
|
|
204
|
-
display: flex;
|
|
205
|
-
width: 100%;
|
|
206
|
-
min-width: 0;
|
|
207
|
-
position: relative;
|
|
208
|
-
align-items: center;
|
|
209
|
-
justify-content: start;
|
|
210
|
-
font-family: var(--sl-input-font-family);
|
|
211
|
-
font-weight: var(--sl-input-font-weight);
|
|
212
|
-
letter-spacing: var(--sl-input-letter-spacing);
|
|
213
|
-
vertical-align: middle;
|
|
214
|
-
overflow: hidden;
|
|
215
|
-
cursor: pointer;
|
|
216
|
-
transition:
|
|
217
|
-
var(--sl-transition-fast) color,
|
|
218
|
-
var(--sl-transition-fast) border,
|
|
219
|
-
var(--sl-transition-fast) box-shadow,
|
|
220
|
-
var(--sl-transition-fast) background-color;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
.select__display-input {
|
|
224
|
-
position: relative;
|
|
225
|
-
width: 100%;
|
|
226
|
-
font: inherit;
|
|
227
|
-
border: none;
|
|
228
|
-
background: none;
|
|
229
|
-
color: var(--sl-input-color);
|
|
230
|
-
cursor: inherit;
|
|
231
|
-
overflow: hidden;
|
|
232
|
-
padding: 0;
|
|
233
|
-
margin: 0;
|
|
234
|
-
-webkit-appearance: none;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
.select__display-input::placeholder {
|
|
238
|
-
color: var(--sl-input-placeholder-color);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
.select:not(.select--disabled):hover .select__display-input {
|
|
242
|
-
color: var(--sl-input-color-hover);
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
.select__display-input:focus {
|
|
246
|
-
outline: none;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
/* Visually hide the display input when multiple is enabled */
|
|
250
|
-
.select--multiple:not(.select--placeholder-visible) .select__display-input {
|
|
251
|
-
position: absolute;
|
|
252
|
-
z-index: -1;
|
|
253
|
-
top: 0;
|
|
254
|
-
left: 0;
|
|
255
|
-
width: 100%;
|
|
256
|
-
height: 100%;
|
|
257
|
-
opacity: 0;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
.select__value-input {
|
|
261
|
-
position: absolute;
|
|
262
|
-
top: 0;
|
|
263
|
-
left: 0;
|
|
264
|
-
width: 100%;
|
|
265
|
-
height: 100%;
|
|
266
|
-
padding: 0;
|
|
267
|
-
margin: 0;
|
|
268
|
-
opacity: 0;
|
|
269
|
-
z-index: -1;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
.select__tags {
|
|
273
|
-
display: flex;
|
|
274
|
-
flex: 1;
|
|
275
|
-
align-items: center;
|
|
276
|
-
flex-wrap: wrap;
|
|
277
|
-
margin-inline-start: var(--sl-spacing-2x-small);
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
.select__tags::slotted(sl-tag) {
|
|
281
|
-
cursor: pointer !important;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
.select--disabled .select__tags,
|
|
285
|
-
.select--disabled .select__tags::slotted(sl-tag) {
|
|
286
|
-
cursor: not-allowed !important;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
/* Standard selects */
|
|
290
|
-
.select--standard .select__combobox {
|
|
291
|
-
background-color: var(--sl-input-background-color);
|
|
292
|
-
border: solid var(--sl-input-border-width) var(--sl-input-border-color);
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
.select--standard.select--disabled .select__combobox {
|
|
296
|
-
background-color: var(--sl-input-background-color-disabled);
|
|
297
|
-
border-color: var(--sl-input-border-color-disabled);
|
|
298
|
-
color: var(--sl-input-color-disabled);
|
|
299
|
-
opacity: 0.5;
|
|
300
|
-
cursor: not-allowed;
|
|
301
|
-
outline: none;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
.select--standard:not(.select--disabled).select--open .select__combobox,
|
|
305
|
-
.select--standard:not(.select--disabled).select--focused .select__combobox {
|
|
306
|
-
background-color: var(--sl-input-background-color-focus);
|
|
307
|
-
border-color: var(--sl-input-border-color-focus);
|
|
308
|
-
box-shadow: 0 0 0 var(--sl-focus-ring-width) var(--sl-input-focus-ring-color);
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
/* Filled selects */
|
|
312
|
-
.select--filled .select__combobox {
|
|
313
|
-
border: none;
|
|
314
|
-
background-color: var(--sl-input-filled-background-color);
|
|
315
|
-
color: var(--sl-input-color);
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
.select--filled:hover:not(.select--disabled) .select__combobox {
|
|
319
|
-
background-color: var(--sl-input-filled-background-color-hover);
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
.select--filled.select--disabled .select__combobox {
|
|
323
|
-
background-color: var(--sl-input-filled-background-color-disabled);
|
|
324
|
-
opacity: 0.5;
|
|
325
|
-
cursor: not-allowed;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
.select--filled:not(.select--disabled).select--open .select__combobox,
|
|
329
|
-
.select--filled:not(.select--disabled).select--focused .select__combobox {
|
|
330
|
-
background-color: var(--sl-input-filled-background-color-focus);
|
|
331
|
-
outline: var(--sl-focus-ring);
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
/* Sizes */
|
|
335
|
-
.select--small .select__combobox {
|
|
336
|
-
border-radius: var(--sl-input-border-radius-small);
|
|
337
|
-
font-size: var(--sl-input-font-size-small);
|
|
338
|
-
min-height: var(--sl-input-height-small);
|
|
339
|
-
padding-block: 0;
|
|
340
|
-
padding-inline: var(--sl-input-spacing-small);
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
.select--small .select__clear {
|
|
344
|
-
margin-inline-start: var(--sl-input-spacing-small);
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
.select--small .select__prefix::slotted(*) {
|
|
348
|
-
margin-inline-end: var(--sl-input-spacing-small);
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
.select--small.select--multiple:not(.select--placeholder-visible) .select__prefix::slotted(*) {
|
|
352
|
-
margin-inline-start: var(--sl-input-spacing-small);
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
.select--small.select--multiple:not(.select--placeholder-visible) .select__combobox {
|
|
356
|
-
padding-block: 2px;
|
|
357
|
-
padding-inline-start: 0;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
.select--small .select__tags {
|
|
361
|
-
gap: 2px;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
.select--medium .select__combobox {
|
|
365
|
-
border-radius: var(--sl-input-border-radius-medium);
|
|
366
|
-
font-size: var(--sl-input-font-size-medium);
|
|
367
|
-
min-height: var(--sl-input-height-medium);
|
|
368
|
-
padding-block: 0;
|
|
369
|
-
padding-inline: var(--sl-input-spacing-medium);
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
.select--medium .select__clear {
|
|
373
|
-
margin-inline-start: var(--sl-input-spacing-medium);
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
.select--medium .select__prefix::slotted(*) {
|
|
377
|
-
margin-inline-end: var(--sl-input-spacing-medium);
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
.select--medium.select--multiple:not(.select--placeholder-visible) .select__prefix::slotted(*) {
|
|
381
|
-
margin-inline-start: var(--sl-input-spacing-medium);
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
.select--medium.select--multiple:not(.select--placeholder-visible) .select__combobox {
|
|
385
|
-
padding-inline-start: 0;
|
|
386
|
-
padding-block: 3px;
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
.select--medium .select__tags {
|
|
390
|
-
gap: 3px;
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
.select--large .select__combobox {
|
|
394
|
-
border-radius: var(--sl-input-border-radius-large);
|
|
395
|
-
font-size: var(--sl-input-font-size-large);
|
|
396
|
-
min-height: var(--sl-input-height-large);
|
|
397
|
-
padding-block: 0;
|
|
398
|
-
padding-inline: var(--sl-input-spacing-large);
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
.select--large .select__clear {
|
|
402
|
-
margin-inline-start: var(--sl-input-spacing-large);
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
.select--large .select__prefix::slotted(*) {
|
|
406
|
-
margin-inline-end: var(--sl-input-spacing-large);
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
.select--large.select--multiple:not(.select--placeholder-visible) .select__prefix::slotted(*) {
|
|
410
|
-
margin-inline-start: var(--sl-input-spacing-large);
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
.select--large.select--multiple:not(.select--placeholder-visible) .select__combobox {
|
|
414
|
-
padding-inline-start: 0;
|
|
415
|
-
padding-block: 4px;
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
.select--large .select__tags {
|
|
419
|
-
gap: 4px;
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
/* Pills */
|
|
423
|
-
.select--pill.select--small .select__combobox {
|
|
424
|
-
border-radius: var(--sl-input-height-small);
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
.select--pill.select--medium .select__combobox {
|
|
428
|
-
border-radius: var(--sl-input-height-medium);
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
.select--pill.select--large .select__combobox {
|
|
432
|
-
border-radius: var(--sl-input-height-large);
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
/* Prefix and Suffix */
|
|
436
|
-
.select__prefix,
|
|
437
|
-
.select__suffix {
|
|
438
|
-
flex: 0;
|
|
439
|
-
display: inline-flex;
|
|
440
|
-
align-items: center;
|
|
441
|
-
color: var(--sl-input-placeholder-color);
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
.select__suffix::slotted(*) {
|
|
445
|
-
margin-inline-start: var(--sl-spacing-small);
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
/* Clear button */
|
|
449
|
-
.select__clear {
|
|
450
|
-
display: inline-flex;
|
|
451
|
-
align-items: center;
|
|
452
|
-
justify-content: center;
|
|
453
|
-
font-size: inherit;
|
|
454
|
-
color: var(--sl-input-icon-color);
|
|
455
|
-
border: none;
|
|
456
|
-
background: none;
|
|
457
|
-
padding: 0;
|
|
458
|
-
transition: var(--sl-transition-fast) color;
|
|
459
|
-
cursor: pointer;
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
.select__clear:hover {
|
|
463
|
-
color: var(--sl-input-icon-color-hover);
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
.select__clear:focus {
|
|
467
|
-
outline: none;
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
/* Expand icon */
|
|
471
|
-
.select__expand-icon {
|
|
472
|
-
flex: 0 0 auto;
|
|
473
|
-
display: flex;
|
|
474
|
-
align-items: center;
|
|
475
|
-
transition: var(--sl-transition-medium) rotate ease;
|
|
476
|
-
rotate: 0;
|
|
477
|
-
margin-inline-start: var(--sl-spacing-small);
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
.select--open .select__expand-icon {
|
|
481
|
-
rotate: -180deg;
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
/* Listbox */
|
|
485
|
-
.select__listbox {
|
|
486
|
-
display: block;
|
|
487
|
-
position: relative;
|
|
488
|
-
font-family: var(--sl-font-sans);
|
|
489
|
-
font-size: var(--sl-font-size-medium);
|
|
490
|
-
font-weight: var(--sl-font-weight-normal);
|
|
491
|
-
box-shadow: var(--sl-shadow-large);
|
|
492
|
-
background: var(--sl-panel-background-color);
|
|
493
|
-
border: solid var(--sl-panel-border-width) var(--sl-panel-border-color);
|
|
494
|
-
border-radius: var(--sl-border-radius-medium);
|
|
495
|
-
padding-block: var(--sl-spacing-x-small);
|
|
496
|
-
padding-inline: 0;
|
|
497
|
-
overflow: auto;
|
|
498
|
-
overscroll-behavior: none;
|
|
499
|
-
|
|
500
|
-
/* Make sure it adheres to the popup's auto size */
|
|
501
|
-
max-width: var(--auto-size-available-width);
|
|
502
|
-
max-height: var(--auto-size-available-height);
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
.select__listbox ::slotted(sl-divider) {
|
|
506
|
-
--spacing: var(--sl-spacing-x-small);
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
.select__listbox ::slotted(small) {
|
|
510
|
-
display: block;
|
|
511
|
-
font-size: var(--sl-font-size-small);
|
|
512
|
-
font-weight: var(--sl-font-weight-semibold);
|
|
513
|
-
color: var(--sl-color-neutral-500);
|
|
514
|
-
padding-block: var(--sl-spacing-2x-small);
|
|
515
|
-
padding-inline: var(--sl-spacing-x-large);
|
|
516
|
-
}
|
|
517
|
-
`, D = class extends d {
|
|
518
|
-
constructor() {
|
|
519
|
-
super(...arguments), this.formControlController = new _(this, { assumeInteractionOn: ["sl-blur", "sl-input"] }), this.hasSlotController = new h(this, "help-text", "label"), this.localize = new g(this), this.typeToSelectString = "", this.hasFocus = !1, this.displayLabel = "", this.selectedOptions = [], this.valueHasChanged = !1, this.name = "", this._value = "", this.defaultValue = "", this.size = "medium", this.placeholder = "", this.multiple = !1, this.maxOptionsVisible = 3, this.disabled = !1, this.clearable = !1, this.open = !1, this.hoist = !1, this.filled = !1, this.pill = !1, this.label = "", this.placement = "bottom", this.helpText = "", this.form = "", this.required = !1, this.getTag = (e) => C`
|
|
520
|
-
<sl-tag
|
|
521
|
-
part="tag"
|
|
522
|
-
exportparts="
|
|
523
|
-
base:tag__base,
|
|
524
|
-
content:tag__content,
|
|
525
|
-
remove-button:tag__remove-button,
|
|
526
|
-
remove-button__base:tag__remove-button__base
|
|
527
|
-
"
|
|
528
|
-
?pill=${this.pill}
|
|
529
|
-
size=${this.size}
|
|
530
|
-
removable
|
|
531
|
-
@sl-remove=${(t) => this.handleTagRemove(t, e)}
|
|
532
|
-
>
|
|
533
|
-
${e.getTextLabel()}
|
|
534
|
-
</sl-tag>
|
|
535
|
-
`, this.handleDocumentFocusIn = (e) => {
|
|
536
|
-
let t = e.composedPath();
|
|
537
|
-
this && !t.includes(this) && this.hide();
|
|
538
|
-
}, this.handleDocumentKeyDown = (e) => {
|
|
539
|
-
let t = e.target, n = t.closest(".select__clear") !== null, r = t.closest("sl-icon-button") !== null;
|
|
540
|
-
if (!(n || r)) {
|
|
541
|
-
if (e.key === "Escape" && this.open && !this.closeWatcher && (e.preventDefault(), e.stopPropagation(), this.hide(), this.displayInput.focus({ preventScroll: !0 })), e.key === "Enter" || e.key === " " && this.typeToSelectString === "") {
|
|
542
|
-
if (e.preventDefault(), e.stopImmediatePropagation(), !this.open) {
|
|
543
|
-
this.show();
|
|
544
|
-
return;
|
|
545
|
-
}
|
|
546
|
-
this.currentOption && !this.currentOption.disabled && (this.valueHasChanged = !0, this.multiple ? this.toggleOptionSelection(this.currentOption) : this.setSelectedOptions(this.currentOption), this.updateComplete.then(() => {
|
|
547
|
-
this.emit("sl-input"), this.emit("sl-change");
|
|
548
|
-
}), this.multiple || (this.hide(), this.displayInput.focus({ preventScroll: !0 })));
|
|
549
|
-
return;
|
|
550
|
-
}
|
|
551
|
-
if ([
|
|
552
|
-
"ArrowUp",
|
|
553
|
-
"ArrowDown",
|
|
554
|
-
"Home",
|
|
555
|
-
"End"
|
|
556
|
-
].includes(e.key)) {
|
|
557
|
-
let t = this.getAllOptions(), n = t.indexOf(this.currentOption), r = Math.max(0, n);
|
|
558
|
-
if (e.preventDefault(), !this.open && (this.show(), this.currentOption)) return;
|
|
559
|
-
e.key === "ArrowDown" ? (r = n + 1, r > t.length - 1 && (r = 0)) : e.key === "ArrowUp" ? (r = n - 1, r < 0 && (r = t.length - 1)) : e.key === "Home" ? r = 0 : e.key === "End" && (r = t.length - 1), this.setCurrentOption(t[r]);
|
|
560
|
-
}
|
|
561
|
-
if (e.key && e.key.length === 1 || e.key === "Backspace") {
|
|
562
|
-
let t = this.getAllOptions();
|
|
563
|
-
if (e.metaKey || e.ctrlKey || e.altKey) return;
|
|
564
|
-
if (!this.open) {
|
|
565
|
-
if (e.key === "Backspace") return;
|
|
566
|
-
this.show();
|
|
567
|
-
}
|
|
568
|
-
e.stopPropagation(), e.preventDefault(), clearTimeout(this.typeToSelectTimeout), this.typeToSelectTimeout = window.setTimeout(() => this.typeToSelectString = "", 1e3), e.key === "Backspace" ? this.typeToSelectString = this.typeToSelectString.slice(0, -1) : this.typeToSelectString += e.key.toLowerCase();
|
|
569
|
-
for (let e of t) if (e.getTextLabel().toLowerCase().startsWith(this.typeToSelectString)) {
|
|
570
|
-
this.setCurrentOption(e);
|
|
571
|
-
break;
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
}, this.handleDocumentMouseDown = (e) => {
|
|
576
|
-
let t = e.composedPath();
|
|
577
|
-
this && !t.includes(this) && this.hide();
|
|
578
|
-
};
|
|
579
|
-
}
|
|
580
|
-
get value() {
|
|
581
|
-
return this._value;
|
|
582
|
-
}
|
|
583
|
-
set value(e) {
|
|
584
|
-
e = this.multiple ? Array.isArray(e) ? e : e.split(" ") : Array.isArray(e) ? e.join(" ") : e, this._value !== e && (this.valueHasChanged = !0, this._value = e);
|
|
585
|
-
}
|
|
586
|
-
get validity() {
|
|
587
|
-
return this.valueInput.validity;
|
|
588
|
-
}
|
|
589
|
-
get validationMessage() {
|
|
590
|
-
return this.valueInput.validationMessage;
|
|
591
|
-
}
|
|
592
|
-
connectedCallback() {
|
|
593
|
-
super.connectedCallback(), setTimeout(() => {
|
|
594
|
-
this.handleDefaultSlotChange();
|
|
595
|
-
}), this.open = !1;
|
|
596
|
-
}
|
|
597
|
-
addOpenListeners() {
|
|
598
|
-
var e;
|
|
599
|
-
document.addEventListener("focusin", this.handleDocumentFocusIn), document.addEventListener("keydown", this.handleDocumentKeyDown), document.addEventListener("mousedown", this.handleDocumentMouseDown), this.getRootNode() !== document && this.getRootNode().addEventListener("focusin", this.handleDocumentFocusIn), "CloseWatcher" in window && ((e = this.closeWatcher) == null || e.destroy(), this.closeWatcher = new CloseWatcher(), this.closeWatcher.onclose = () => {
|
|
600
|
-
this.open && (this.hide(), this.displayInput.focus({ preventScroll: !0 }));
|
|
601
|
-
});
|
|
602
|
-
}
|
|
603
|
-
removeOpenListeners() {
|
|
604
|
-
var e;
|
|
605
|
-
document.removeEventListener("focusin", this.handleDocumentFocusIn), document.removeEventListener("keydown", this.handleDocumentKeyDown), document.removeEventListener("mousedown", this.handleDocumentMouseDown), this.getRootNode() !== document && this.getRootNode().removeEventListener("focusin", this.handleDocumentFocusIn), (e = this.closeWatcher) == null || e.destroy();
|
|
606
|
-
}
|
|
607
|
-
handleFocus() {
|
|
608
|
-
this.hasFocus = !0, this.displayInput.setSelectionRange(0, 0), this.emit("sl-focus");
|
|
609
|
-
}
|
|
610
|
-
handleBlur() {
|
|
611
|
-
this.hasFocus = !1, this.emit("sl-blur");
|
|
612
|
-
}
|
|
613
|
-
handleLabelClick() {
|
|
614
|
-
this.displayInput.focus();
|
|
615
|
-
}
|
|
616
|
-
handleComboboxMouseDown(e) {
|
|
617
|
-
let t = e.composedPath().some((e) => e instanceof Element && e.tagName.toLowerCase() === "sl-icon-button");
|
|
618
|
-
this.disabled || t || (e.preventDefault(), this.displayInput.focus({ preventScroll: !0 }), this.open = !this.open);
|
|
619
|
-
}
|
|
620
|
-
handleComboboxKeyDown(e) {
|
|
621
|
-
e.key !== "Tab" && (e.stopPropagation(), this.handleDocumentKeyDown(e));
|
|
622
|
-
}
|
|
623
|
-
handleClearClick(e) {
|
|
624
|
-
e.stopPropagation(), this.valueHasChanged = !0, this.value !== "" && (this.setSelectedOptions([]), this.displayInput.focus({ preventScroll: !0 }), this.updateComplete.then(() => {
|
|
625
|
-
this.emit("sl-clear"), this.emit("sl-input"), this.emit("sl-change");
|
|
626
|
-
}));
|
|
627
|
-
}
|
|
628
|
-
handleClearMouseDown(e) {
|
|
629
|
-
e.stopPropagation(), e.preventDefault();
|
|
630
|
-
}
|
|
631
|
-
handleOptionClick(e) {
|
|
632
|
-
let t = e.target.closest("sl-option"), n = this.value;
|
|
633
|
-
t && !t.disabled && (this.valueHasChanged = !0, this.multiple ? this.toggleOptionSelection(t) : this.setSelectedOptions(t), this.updateComplete.then(() => this.displayInput.focus({ preventScroll: !0 })), this.value !== n && this.updateComplete.then(() => {
|
|
634
|
-
this.emit("sl-input"), this.emit("sl-change");
|
|
635
|
-
}), this.multiple || (this.hide(), this.displayInput.focus({ preventScroll: !0 })));
|
|
636
|
-
}
|
|
637
|
-
handleDefaultSlotChange() {
|
|
638
|
-
customElements.get("sl-option") || customElements.whenDefined("sl-option").then(() => this.handleDefaultSlotChange());
|
|
639
|
-
let e = this.getAllOptions(), t = this.valueHasChanged ? this.value : this.defaultValue, n = Array.isArray(t) ? t : [t], r = [];
|
|
640
|
-
e.forEach((e) => r.push(e.value)), this.setSelectedOptions(e.filter((e) => n.includes(e.value)));
|
|
641
|
-
}
|
|
642
|
-
handleTagRemove(e, t) {
|
|
643
|
-
e.stopPropagation(), this.valueHasChanged = !0, this.disabled || (this.toggleOptionSelection(t, !1), this.updateComplete.then(() => {
|
|
644
|
-
this.emit("sl-input"), this.emit("sl-change");
|
|
645
|
-
}));
|
|
646
|
-
}
|
|
647
|
-
getAllOptions() {
|
|
648
|
-
return [...this.querySelectorAll("sl-option")];
|
|
649
|
-
}
|
|
650
|
-
getFirstOption() {
|
|
651
|
-
return this.querySelector("sl-option");
|
|
652
|
-
}
|
|
653
|
-
setCurrentOption(e) {
|
|
654
|
-
this.getAllOptions().forEach((e) => {
|
|
655
|
-
e.current = !1, e.tabIndex = -1;
|
|
656
|
-
}), e && (this.currentOption = e, e.current = !0, e.tabIndex = 0, e.focus());
|
|
657
|
-
}
|
|
658
|
-
setSelectedOptions(e) {
|
|
659
|
-
let t = this.getAllOptions(), n = Array.isArray(e) ? e : [e];
|
|
660
|
-
t.forEach((e) => e.selected = !1), n.length && n.forEach((e) => e.selected = !0), this.selectionChanged();
|
|
661
|
-
}
|
|
662
|
-
toggleOptionSelection(e, t) {
|
|
663
|
-
t === !0 || t === !1 ? e.selected = t : e.selected = !e.selected, this.selectionChanged();
|
|
664
|
-
}
|
|
665
|
-
selectionChanged() {
|
|
666
|
-
let e = this.getAllOptions();
|
|
667
|
-
this.selectedOptions = e.filter((e) => e.selected);
|
|
668
|
-
let t = this.valueHasChanged;
|
|
669
|
-
if (this.multiple) this.value = this.selectedOptions.map((e) => e.value), this.placeholder && this.value.length === 0 ? this.displayLabel = "" : this.displayLabel = this.localize.term("numOptionsSelected", this.selectedOptions.length);
|
|
670
|
-
else {
|
|
671
|
-
let e = this.selectedOptions[0];
|
|
672
|
-
this.value = e?.value ?? "", this.displayLabel = (e?.getTextLabel)?.call(e) ?? "";
|
|
673
|
-
}
|
|
674
|
-
this.valueHasChanged = t, this.updateComplete.then(() => {
|
|
675
|
-
this.formControlController.updateValidity();
|
|
676
|
-
});
|
|
677
|
-
}
|
|
678
|
-
get tags() {
|
|
679
|
-
return this.selectedOptions.map((e, t) => {
|
|
680
|
-
if (t < this.maxOptionsVisible || this.maxOptionsVisible <= 0) {
|
|
681
|
-
let n = this.getTag(e, t);
|
|
682
|
-
return C`<div @sl-remove=${(t) => this.handleTagRemove(t, e)}>
|
|
683
|
-
${typeof n == "string" ? y(n) : n}
|
|
684
|
-
</div>`;
|
|
685
|
-
} else if (t === this.maxOptionsVisible) return C`<sl-tag size=${this.size}>+${this.selectedOptions.length - t}</sl-tag>`;
|
|
686
|
-
return C``;
|
|
687
|
-
});
|
|
688
|
-
}
|
|
689
|
-
handleInvalid(e) {
|
|
690
|
-
this.formControlController.setValidity(!1), this.formControlController.emitInvalidEvent(e);
|
|
691
|
-
}
|
|
692
|
-
handleDisabledChange() {
|
|
693
|
-
this.disabled && (this.open = !1, this.handleOpenChange());
|
|
694
|
-
}
|
|
695
|
-
attributeChangedCallback(e, t, n) {
|
|
696
|
-
if (super.attributeChangedCallback(e, t, n), e === "value") {
|
|
697
|
-
let e = this.valueHasChanged;
|
|
698
|
-
this.value = this.defaultValue, this.valueHasChanged = e;
|
|
699
|
-
}
|
|
700
|
-
}
|
|
701
|
-
handleValueChange() {
|
|
702
|
-
if (!this.valueHasChanged) {
|
|
703
|
-
let e = this.valueHasChanged;
|
|
704
|
-
this.value = this.defaultValue, this.valueHasChanged = e;
|
|
705
|
-
}
|
|
706
|
-
let e = this.getAllOptions(), t = Array.isArray(this.value) ? this.value : [this.value];
|
|
707
|
-
this.setSelectedOptions(e.filter((e) => t.includes(e.value)));
|
|
708
|
-
}
|
|
709
|
-
async handleOpenChange() {
|
|
710
|
-
if (this.open && !this.disabled) {
|
|
711
|
-
this.setCurrentOption(this.selectedOptions[0] || this.getFirstOption()), this.emit("sl-show"), this.addOpenListeners(), await a(this), this.listbox.hidden = !1, this.popup.active = !0, requestAnimationFrame(() => {
|
|
712
|
-
this.setCurrentOption(this.currentOption);
|
|
713
|
-
});
|
|
714
|
-
let { keyframes: e, options: t } = o(this, "select.show", { dir: this.localize.dir() });
|
|
715
|
-
await c(this.popup.popup, e, t), this.currentOption && x(this.currentOption, this.listbox, "vertical", "auto"), this.emit("sl-after-show");
|
|
716
|
-
} else {
|
|
717
|
-
this.emit("sl-hide"), this.removeOpenListeners(), await a(this);
|
|
718
|
-
let { keyframes: e, options: t } = o(this, "select.hide", { dir: this.localize.dir() });
|
|
719
|
-
await c(this.popup.popup, e, t), this.listbox.hidden = !0, this.popup.active = !1, this.emit("sl-after-hide");
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
async show() {
|
|
723
|
-
if (this.open || this.disabled) {
|
|
724
|
-
this.open = !1;
|
|
725
|
-
return;
|
|
726
|
-
}
|
|
727
|
-
return this.open = !0, r(this, "sl-after-show");
|
|
728
|
-
}
|
|
729
|
-
async hide() {
|
|
730
|
-
if (!this.open || this.disabled) {
|
|
731
|
-
this.open = !1;
|
|
732
|
-
return;
|
|
733
|
-
}
|
|
734
|
-
return this.open = !1, r(this, "sl-after-hide");
|
|
735
|
-
}
|
|
736
|
-
checkValidity() {
|
|
737
|
-
return this.valueInput.checkValidity();
|
|
738
|
-
}
|
|
739
|
-
getForm() {
|
|
740
|
-
return this.formControlController.getForm();
|
|
741
|
-
}
|
|
742
|
-
reportValidity() {
|
|
743
|
-
return this.valueInput.reportValidity();
|
|
744
|
-
}
|
|
745
|
-
setCustomValidity(e) {
|
|
746
|
-
this.valueInput.setCustomValidity(e), this.formControlController.updateValidity();
|
|
747
|
-
}
|
|
748
|
-
focus(e) {
|
|
749
|
-
this.displayInput.focus(e);
|
|
750
|
-
}
|
|
751
|
-
blur() {
|
|
752
|
-
this.displayInput.blur();
|
|
753
|
-
}
|
|
754
|
-
render() {
|
|
755
|
-
let e = this.hasSlotController.test("label"), t = this.hasSlotController.test("help-text"), n = this.label ? !0 : !!e, r = this.helpText ? !0 : !!t, i = this.clearable && !this.disabled && this.value.length > 0, a = this.placeholder && this.value && this.value.length <= 0;
|
|
756
|
-
return C`
|
|
757
|
-
<div
|
|
758
|
-
part="form-control"
|
|
759
|
-
class=${m({
|
|
760
|
-
"form-control": !0,
|
|
761
|
-
"form-control--small": this.size === "small",
|
|
762
|
-
"form-control--medium": this.size === "medium",
|
|
763
|
-
"form-control--large": this.size === "large",
|
|
764
|
-
"form-control--has-label": n,
|
|
765
|
-
"form-control--has-help-text": r
|
|
766
|
-
})}
|
|
767
|
-
>
|
|
768
|
-
<label
|
|
769
|
-
id="label"
|
|
770
|
-
part="form-control-label"
|
|
771
|
-
class="form-control__label"
|
|
772
|
-
aria-hidden=${n ? "false" : "true"}
|
|
773
|
-
@click=${this.handleLabelClick}
|
|
774
|
-
>
|
|
775
|
-
<slot name="label">${this.label}</slot>
|
|
776
|
-
</label>
|
|
777
|
-
|
|
778
|
-
<div part="form-control-input" class="form-control-input">
|
|
779
|
-
<sl-popup
|
|
780
|
-
class=${m({
|
|
781
|
-
select: !0,
|
|
782
|
-
"select--standard": !0,
|
|
783
|
-
"select--filled": this.filled,
|
|
784
|
-
"select--pill": this.pill,
|
|
785
|
-
"select--open": this.open,
|
|
786
|
-
"select--disabled": this.disabled,
|
|
787
|
-
"select--multiple": this.multiple,
|
|
788
|
-
"select--focused": this.hasFocus,
|
|
789
|
-
"select--placeholder-visible": a,
|
|
790
|
-
"select--top": this.placement === "top",
|
|
791
|
-
"select--bottom": this.placement === "bottom",
|
|
792
|
-
"select--small": this.size === "small",
|
|
793
|
-
"select--medium": this.size === "medium",
|
|
794
|
-
"select--large": this.size === "large"
|
|
795
|
-
})}
|
|
796
|
-
placement=${this.placement}
|
|
797
|
-
strategy=${this.hoist ? "fixed" : "absolute"}
|
|
798
|
-
flip
|
|
799
|
-
shift
|
|
800
|
-
sync="width"
|
|
801
|
-
auto-size="vertical"
|
|
802
|
-
auto-size-padding="10"
|
|
803
|
-
>
|
|
804
|
-
<div
|
|
805
|
-
part="combobox"
|
|
806
|
-
class="select__combobox"
|
|
807
|
-
slot="anchor"
|
|
808
|
-
@keydown=${this.handleComboboxKeyDown}
|
|
809
|
-
@mousedown=${this.handleComboboxMouseDown}
|
|
810
|
-
>
|
|
811
|
-
<slot part="prefix" name="prefix" class="select__prefix"></slot>
|
|
812
|
-
|
|
813
|
-
<input
|
|
814
|
-
part="display-input"
|
|
815
|
-
class="select__display-input"
|
|
816
|
-
type="text"
|
|
817
|
-
placeholder=${this.placeholder}
|
|
818
|
-
.disabled=${this.disabled}
|
|
819
|
-
.value=${this.displayLabel}
|
|
820
|
-
autocomplete="off"
|
|
821
|
-
spellcheck="false"
|
|
822
|
-
autocapitalize="off"
|
|
823
|
-
readonly
|
|
824
|
-
aria-controls="listbox"
|
|
825
|
-
aria-expanded=${this.open ? "true" : "false"}
|
|
826
|
-
aria-haspopup="listbox"
|
|
827
|
-
aria-labelledby="label"
|
|
828
|
-
aria-disabled=${this.disabled ? "true" : "false"}
|
|
829
|
-
aria-describedby="help-text"
|
|
830
|
-
role="combobox"
|
|
831
|
-
tabindex="0"
|
|
832
|
-
@focus=${this.handleFocus}
|
|
833
|
-
@blur=${this.handleBlur}
|
|
834
|
-
/>
|
|
835
|
-
|
|
836
|
-
${this.multiple ? C`<div part="tags" class="select__tags">${this.tags}</div>` : ""}
|
|
837
|
-
|
|
838
|
-
<input
|
|
839
|
-
class="select__value-input"
|
|
840
|
-
type="text"
|
|
841
|
-
?disabled=${this.disabled}
|
|
842
|
-
?required=${this.required}
|
|
843
|
-
.value=${Array.isArray(this.value) ? this.value.join(", ") : this.value}
|
|
844
|
-
tabindex="-1"
|
|
845
|
-
aria-hidden="true"
|
|
846
|
-
@focus=${() => this.focus()}
|
|
847
|
-
@invalid=${this.handleInvalid}
|
|
848
|
-
/>
|
|
849
|
-
|
|
850
|
-
${i ? C`
|
|
851
|
-
<button
|
|
852
|
-
part="clear-button"
|
|
853
|
-
class="select__clear"
|
|
854
|
-
type="button"
|
|
855
|
-
aria-label=${this.localize.term("clearEntry")}
|
|
856
|
-
@mousedown=${this.handleClearMouseDown}
|
|
857
|
-
@click=${this.handleClearClick}
|
|
858
|
-
tabindex="-1"
|
|
859
|
-
>
|
|
860
|
-
<slot name="clear-icon">
|
|
861
|
-
<sl-icon name="x-circle-fill" library="system"></sl-icon>
|
|
862
|
-
</slot>
|
|
863
|
-
</button>
|
|
864
|
-
` : ""}
|
|
865
|
-
|
|
866
|
-
<slot name="suffix" part="suffix" class="select__suffix"></slot>
|
|
867
|
-
|
|
868
|
-
<slot name="expand-icon" part="expand-icon" class="select__expand-icon">
|
|
869
|
-
<sl-icon library="system" name="chevron-down"></sl-icon>
|
|
870
|
-
</slot>
|
|
871
|
-
</div>
|
|
872
|
-
|
|
873
|
-
<div
|
|
874
|
-
id="listbox"
|
|
875
|
-
role="listbox"
|
|
876
|
-
aria-expanded=${this.open ? "true" : "false"}
|
|
877
|
-
aria-multiselectable=${this.multiple ? "true" : "false"}
|
|
878
|
-
aria-labelledby="label"
|
|
879
|
-
part="listbox"
|
|
880
|
-
class="select__listbox"
|
|
881
|
-
tabindex="-1"
|
|
882
|
-
@mouseup=${this.handleOptionClick}
|
|
883
|
-
@slotchange=${this.handleDefaultSlotChange}
|
|
884
|
-
>
|
|
885
|
-
<slot></slot>
|
|
886
|
-
</div>
|
|
887
|
-
</sl-popup>
|
|
888
|
-
</div>
|
|
889
|
-
|
|
890
|
-
<div
|
|
891
|
-
part="form-control-help-text"
|
|
892
|
-
id="help-text"
|
|
893
|
-
class="form-control__help-text"
|
|
894
|
-
aria-hidden=${r ? "false" : "true"}
|
|
895
|
-
>
|
|
896
|
-
<slot name="help-text">${this.helpText}</slot>
|
|
897
|
-
</div>
|
|
898
|
-
</div>
|
|
899
|
-
`;
|
|
900
|
-
}
|
|
901
|
-
};
|
|
902
|
-
//#endregion
|
|
903
|
-
//#region node_modules/@shoelace-style/shoelace/dist/chunks/chunk.TP2GB2HO.js
|
|
904
|
-
D.styles = [
|
|
905
|
-
p,
|
|
906
|
-
v,
|
|
907
|
-
E
|
|
908
|
-
], D.dependencies = {
|
|
909
|
-
"sl-icon": f,
|
|
910
|
-
"sl-popup": b,
|
|
911
|
-
"sl-tag": T
|
|
912
|
-
}, u([n(".select")], D.prototype, "popup", 2), u([n(".select__combobox")], D.prototype, "combobox", 2), u([n(".select__display-input")], D.prototype, "displayInput", 2), u([n(".select__value-input")], D.prototype, "valueInput", 2), u([n(".select__listbox")], D.prototype, "listbox", 2), u([t()], D.prototype, "hasFocus", 2), u([t()], D.prototype, "displayLabel", 2), u([t()], D.prototype, "currentOption", 2), u([t()], D.prototype, "selectedOptions", 2), u([t()], D.prototype, "valueHasChanged", 2), u([e()], D.prototype, "name", 2), u([t()], D.prototype, "value", 1), u([e({ attribute: "value" })], D.prototype, "defaultValue", 2), u([e({ reflect: !0 })], D.prototype, "size", 2), u([e()], D.prototype, "placeholder", 2), u([e({
|
|
913
|
-
type: Boolean,
|
|
914
|
-
reflect: !0
|
|
915
|
-
})], D.prototype, "multiple", 2), u([e({
|
|
916
|
-
attribute: "max-options-visible",
|
|
917
|
-
type: Number
|
|
918
|
-
})], D.prototype, "maxOptionsVisible", 2), u([e({
|
|
919
|
-
type: Boolean,
|
|
920
|
-
reflect: !0
|
|
921
|
-
})], D.prototype, "disabled", 2), u([e({ type: Boolean })], D.prototype, "clearable", 2), u([e({
|
|
922
|
-
type: Boolean,
|
|
923
|
-
reflect: !0
|
|
924
|
-
})], D.prototype, "open", 2), u([e({ type: Boolean })], D.prototype, "hoist", 2), u([e({
|
|
925
|
-
type: Boolean,
|
|
926
|
-
reflect: !0
|
|
927
|
-
})], D.prototype, "filled", 2), u([e({
|
|
928
|
-
type: Boolean,
|
|
929
|
-
reflect: !0
|
|
930
|
-
})], D.prototype, "pill", 2), u([e()], D.prototype, "label", 2), u([e({ reflect: !0 })], D.prototype, "placement", 2), u([e({ attribute: "help-text" })], D.prototype, "helpText", 2), u([e({ reflect: !0 })], D.prototype, "form", 2), u([e({
|
|
931
|
-
type: Boolean,
|
|
932
|
-
reflect: !0
|
|
933
|
-
})], D.prototype, "required", 2), u([e()], D.prototype, "getTag", 2), u([l("disabled", { waitUntilFirstUpdate: !0 })], D.prototype, "handleDisabledChange", 1), u([l(["defaultValue", "value"], { waitUntilFirstUpdate: !0 })], D.prototype, "handleValueChange", 1), u([l("open", { waitUntilFirstUpdate: !0 })], D.prototype, "handleOpenChange", 1), s("select.show", {
|
|
934
|
-
keyframes: [{
|
|
935
|
-
opacity: 0,
|
|
936
|
-
scale: .9
|
|
937
|
-
}, {
|
|
938
|
-
opacity: 1,
|
|
939
|
-
scale: 1
|
|
940
|
-
}],
|
|
941
|
-
options: {
|
|
942
|
-
duration: 100,
|
|
943
|
-
easing: "ease"
|
|
944
|
-
}
|
|
945
|
-
}), s("select.hide", {
|
|
946
|
-
keyframes: [{
|
|
947
|
-
opacity: 1,
|
|
948
|
-
scale: 1
|
|
949
|
-
}, {
|
|
950
|
-
opacity: 0,
|
|
951
|
-
scale: .9
|
|
952
|
-
}],
|
|
953
|
-
options: {
|
|
954
|
-
duration: 100,
|
|
955
|
-
easing: "ease"
|
|
956
|
-
}
|
|
957
|
-
}), D.define("sl-select");
|
|
958
|
-
//#endregion
|
|
959
|
-
//#region node_modules/@shoelace-style/shoelace/dist/chunks/chunk.FXXKMG2P.js
|
|
960
|
-
var O = S`
|
|
961
|
-
:host {
|
|
962
|
-
display: block;
|
|
963
|
-
user-select: none;
|
|
964
|
-
-webkit-user-select: none;
|
|
965
|
-
}
|
|
966
|
-
|
|
967
|
-
:host(:focus) {
|
|
968
|
-
outline: none;
|
|
969
|
-
}
|
|
970
|
-
|
|
971
|
-
.option {
|
|
972
|
-
position: relative;
|
|
973
|
-
display: flex;
|
|
974
|
-
align-items: center;
|
|
975
|
-
font-family: var(--sl-font-sans);
|
|
976
|
-
font-size: var(--sl-font-size-medium);
|
|
977
|
-
font-weight: var(--sl-font-weight-normal);
|
|
978
|
-
line-height: var(--sl-line-height-normal);
|
|
979
|
-
letter-spacing: var(--sl-letter-spacing-normal);
|
|
980
|
-
color: var(--sl-color-neutral-700);
|
|
981
|
-
padding: var(--sl-spacing-x-small) var(--sl-spacing-medium) var(--sl-spacing-x-small) var(--sl-spacing-x-small);
|
|
982
|
-
transition: var(--sl-transition-fast) fill;
|
|
983
|
-
cursor: pointer;
|
|
984
|
-
}
|
|
985
|
-
|
|
986
|
-
.option--hover:not(.option--current):not(.option--disabled) {
|
|
987
|
-
background-color: var(--sl-color-neutral-100);
|
|
988
|
-
color: var(--sl-color-neutral-1000);
|
|
989
|
-
}
|
|
990
|
-
|
|
991
|
-
.option--current,
|
|
992
|
-
.option--current.option--disabled {
|
|
993
|
-
background-color: var(--sl-color-primary-600);
|
|
994
|
-
color: var(--sl-color-neutral-0);
|
|
995
|
-
opacity: 1;
|
|
996
|
-
}
|
|
997
|
-
|
|
998
|
-
.option--disabled {
|
|
999
|
-
outline: none;
|
|
1000
|
-
opacity: 0.5;
|
|
1001
|
-
cursor: not-allowed;
|
|
1002
|
-
}
|
|
1003
|
-
|
|
1004
|
-
.option__label {
|
|
1005
|
-
flex: 1 1 auto;
|
|
1006
|
-
display: inline-block;
|
|
1007
|
-
line-height: var(--sl-line-height-dense);
|
|
1008
|
-
}
|
|
1009
|
-
|
|
1010
|
-
.option .option__check {
|
|
1011
|
-
flex: 0 0 auto;
|
|
1012
|
-
display: flex;
|
|
1013
|
-
align-items: center;
|
|
1014
|
-
justify-content: center;
|
|
1015
|
-
visibility: hidden;
|
|
1016
|
-
padding-inline-end: var(--sl-spacing-2x-small);
|
|
1017
|
-
}
|
|
1018
|
-
|
|
1019
|
-
.option--selected .option__check {
|
|
1020
|
-
visibility: visible;
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1023
|
-
.option__prefix,
|
|
1024
|
-
.option__suffix {
|
|
1025
|
-
flex: 0 0 auto;
|
|
1026
|
-
display: flex;
|
|
1027
|
-
align-items: center;
|
|
1028
|
-
}
|
|
1029
|
-
|
|
1030
|
-
.option__prefix::slotted(*) {
|
|
1031
|
-
margin-inline-end: var(--sl-spacing-x-small);
|
|
1032
|
-
}
|
|
1033
|
-
|
|
1034
|
-
.option__suffix::slotted(*) {
|
|
1035
|
-
margin-inline-start: var(--sl-spacing-x-small);
|
|
1036
|
-
}
|
|
1037
|
-
|
|
1038
|
-
@media (forced-colors: active) {
|
|
1039
|
-
:host(:hover:not([aria-disabled='true'])) .option {
|
|
1040
|
-
outline: dashed 1px SelectedItem;
|
|
1041
|
-
outline-offset: -1px;
|
|
1042
|
-
}
|
|
1043
|
-
}
|
|
1044
|
-
`, k = class extends d {
|
|
1045
|
-
constructor() {
|
|
1046
|
-
super(...arguments), this.localize = new g(this), this.isInitialized = !1, this.current = !1, this.selected = !1, this.hasHover = !1, this.value = "", this.disabled = !1;
|
|
1047
|
-
}
|
|
1048
|
-
connectedCallback() {
|
|
1049
|
-
super.connectedCallback(), this.setAttribute("role", "option"), this.setAttribute("aria-selected", "false");
|
|
1050
|
-
}
|
|
1051
|
-
handleDefaultSlotChange() {
|
|
1052
|
-
this.isInitialized ? customElements.whenDefined("sl-select").then(() => {
|
|
1053
|
-
let e = this.closest("sl-select");
|
|
1054
|
-
e && e.handleDefaultSlotChange();
|
|
1055
|
-
}) : this.isInitialized = !0;
|
|
1056
|
-
}
|
|
1057
|
-
handleMouseEnter() {
|
|
1058
|
-
this.hasHover = !0;
|
|
1059
|
-
}
|
|
1060
|
-
handleMouseLeave() {
|
|
1061
|
-
this.hasHover = !1;
|
|
1062
|
-
}
|
|
1063
|
-
handleDisabledChange() {
|
|
1064
|
-
this.setAttribute("aria-disabled", this.disabled ? "true" : "false");
|
|
1065
|
-
}
|
|
1066
|
-
handleSelectedChange() {
|
|
1067
|
-
this.setAttribute("aria-selected", this.selected ? "true" : "false");
|
|
1068
|
-
}
|
|
1069
|
-
handleValueChange() {
|
|
1070
|
-
typeof this.value != "string" && (this.value = String(this.value)), this.value.includes(" ") && (console.error("Option values cannot include a space. All spaces have been replaced with underscores.", this), this.value = this.value.replace(/ /g, "_"));
|
|
1071
|
-
}
|
|
1072
|
-
getTextLabel() {
|
|
1073
|
-
let e = this.childNodes, t = "";
|
|
1074
|
-
return [...e].forEach((e) => {
|
|
1075
|
-
e.nodeType === Node.ELEMENT_NODE && (e.hasAttribute("slot") || (t += e.textContent)), e.nodeType === Node.TEXT_NODE && (t += e.textContent);
|
|
1076
|
-
}), t.trim();
|
|
1077
|
-
}
|
|
1078
|
-
render() {
|
|
1079
|
-
return C`
|
|
1080
|
-
<div
|
|
1081
|
-
part="base"
|
|
1082
|
-
class=${m({
|
|
1083
|
-
option: !0,
|
|
1084
|
-
"option--current": this.current,
|
|
1085
|
-
"option--disabled": this.disabled,
|
|
1086
|
-
"option--selected": this.selected,
|
|
1087
|
-
"option--hover": this.hasHover
|
|
1088
|
-
})}
|
|
1089
|
-
@mouseenter=${this.handleMouseEnter}
|
|
1090
|
-
@mouseleave=${this.handleMouseLeave}
|
|
1091
|
-
>
|
|
1092
|
-
<sl-icon part="checked-icon" class="option__check" name="check" library="system" aria-hidden="true"></sl-icon>
|
|
1093
|
-
<slot part="prefix" name="prefix" class="option__prefix"></slot>
|
|
1094
|
-
<slot part="label" class="option__label" @slotchange=${this.handleDefaultSlotChange}></slot>
|
|
1095
|
-
<slot part="suffix" name="suffix" class="option__suffix"></slot>
|
|
1096
|
-
</div>
|
|
1097
|
-
`;
|
|
1098
|
-
}
|
|
1099
|
-
};
|
|
1100
|
-
//#endregion
|
|
1101
|
-
//#region node_modules/@shoelace-style/shoelace/dist/chunks/chunk.JXOKFADN.js
|
|
1102
|
-
k.styles = [p, O], k.dependencies = { "sl-icon": f }, u([n(".option__label")], k.prototype, "defaultSlot", 2), u([t()], k.prototype, "current", 2), u([t()], k.prototype, "selected", 2), u([t()], k.prototype, "hasHover", 2), u([e({ reflect: !0 })], k.prototype, "value", 2), u([e({
|
|
1103
|
-
type: Boolean,
|
|
1104
|
-
reflect: !0
|
|
1105
|
-
})], k.prototype, "disabled", 2), u([l("disabled")], k.prototype, "handleDisabledChange", 1), u([l("selected")], k.prototype, "handleSelectedChange", 1), u([l("value")], k.prototype, "handleValueChange", 1), k.define("sl-option");
|
|
1106
|
-
//#endregion
|