@edugis-org/webmapx 0.1.6 → 0.1.8

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.
Files changed (60) hide show
  1. package/dist-lib/{decorate-CWgUV1hU.js → decorate-DnZTfaod.js} +6 -6
  2. package/dist-lib/dist-BIbq3o-p.js +213 -0
  3. package/dist-lib/{dist-Dm6b7XCs.js → dist-CKAaoSoW.js} +2743 -2491
  4. package/dist-lib/{dist-kKlmcBXq.js → dist-CWCNMXMK.js} +1 -1
  5. package/dist-lib/{dist-Ha9LQCut.js → dist-D-5Gmgwo.js} +1 -1
  6. package/dist-lib/{layer-discovery-afWzu5hY.js → layer-discovery-DFP-WHAh.js} +1 -1
  7. package/dist-lib/{leaflet-adapter-D9djjrKv.js → leaflet-adapter-A0rte-c7.js} +1 -1
  8. package/dist-lib/{maplibre-adapter-TFc3e0G9.js → maplibre-adapter-Cy6yX6o7.js} +1 -1
  9. package/dist-lib/ol-tilegrid-Ct4my3IN.js +24 -0
  10. package/dist-lib/openlayers-adapter-B8WtV1tn.js +1462 -0
  11. package/dist-lib/{toast-Cm28o9U6.js → toast-BsoXOdeA.js} +1 -1
  12. package/dist-lib/{webmapx-3d-tool-D4CTD2gB.js → webmapx-3d-tool-CLppA7mK.js} +13 -13
  13. package/dist-lib/{webmapx-base-tool-Dm9NAWLD.js → webmapx-base-tool-DfRa7TlD.js} +1 -1
  14. package/dist-lib/{webmapx-config-edit-tool-BgcSkmmg.js → webmapx-config-edit-tool-BztWspia.js} +21 -21
  15. package/dist-lib/{webmapx-coordinates-tool-B3cuq_hG.js → webmapx-coordinates-tool-EOqZodjr.js} +20 -20
  16. package/dist-lib/{webmapx-core-bundle-BDImi1RE.js → webmapx-core-bundle-CH-5vYXU.js} +607 -1519
  17. package/dist-lib/webmapx-draw-tool-DxQgUF1Q.js +2117 -0
  18. package/dist-lib/{webmapx-geolocation-tool-Rw3-Iad1.js → webmapx-geolocation-tool-DIMh2kIr.js} +26 -25
  19. package/dist-lib/{webmapx-import-layer-tool-DRYviHd5.js → webmapx-import-layer-tool-DMiC1TpU.js} +16 -16
  20. package/dist-lib/{webmapx-info-tool-BJA157cy.js → webmapx-info-tool-D-XbAU9J.js} +56 -56
  21. package/dist-lib/{webmapx-language-osmvector-M5y_lwOg.js → webmapx-language-osmvector-BAw9TR-M.js} +12 -11
  22. package/dist-lib/{webmapx-measure-tool-BXhMJFC6.js → webmapx-measure-tool-CXlg11s8.js} +34 -34
  23. package/dist-lib/{webmapx-modal-tool-eF6Naluv.js → webmapx-modal-tool-Cs7LRrgW.js} +3 -3
  24. package/dist-lib/{webmapx-plugin-tool-D2Hghf9n.js → webmapx-plugin-tool-qe2yTrWB.js} +7 -7
  25. package/dist-lib/{webmapx-print-tool-ob1bOsR5.js → webmapx-print-tool-DrK9sLC7.js} +27 -26
  26. package/dist-lib/{webmapx-search-tool-Cv8BrYvY.js → webmapx-search-tool-H7NisgWH.js} +11 -11
  27. package/dist-lib/webmapx-settings-EHSm-AGU.js +167 -0
  28. package/dist-lib/{webmapx-truearea-tool-CMB4Orm-.js → webmapx-truearea-tool-CSU9mE1D.js} +26 -26
  29. package/dist-lib/{webmapx-view-mode-tool-CUpLNjOj.js → webmapx-view-mode-tool-D1QyQfq8.js} +9 -9
  30. package/dist-lib/webmapx.css +1 -1
  31. package/dist-lib/webmapx.js +22 -21
  32. package/package.json +1 -1
  33. package/dist-lib/WMTS-DCN4zX0-.js +0 -1169
  34. package/dist-lib/alert-GeHlqlN8.js +0 -310
  35. package/dist-lib/button-DFdGkRPQ.js +0 -741
  36. package/dist-lib/checkbox-QoR4S8tV.js +0 -284
  37. package/dist-lib/chunk.36O46B5H-B6ZL7Sm1.js +0 -77
  38. package/dist-lib/chunk.3RPBFEDE-BFO1fHVm.js +0 -138
  39. package/dist-lib/chunk.5JY5FUCG-DTXsslmx.js +0 -1090
  40. package/dist-lib/chunk.6CTB5ZDJ-DjZrBd6Y.js +0 -99
  41. package/dist-lib/chunk.AJ3ENQ5C-Ci7Gm2b6.js +0 -175
  42. package/dist-lib/chunk.LD4M4QGE-CiCfhE8r.js +0 -8
  43. package/dist-lib/chunk.NYIIDP5N-BikXIStD.js +0 -99
  44. package/dist-lib/chunk.RWUUFNUL-DFztA4uV.js +0 -43
  45. package/dist-lib/chunk.SI4ACBFK-CLb9VfMG.js +0 -61
  46. package/dist-lib/chunk.YHLNUJ7P-D-kanrCf.js +0 -503
  47. package/dist-lib/decorators-B35AgiCU.js +0 -351
  48. package/dist-lib/dist-c1PlDAd1.js +0 -2359
  49. package/dist-lib/divider-CPm675yY.js +0 -41
  50. package/dist-lib/icon-CEOgWlro.js +0 -9
  51. package/dist-lib/icon-button-Da_nBTy3.js +0 -408
  52. package/dist-lib/input-CeGntPlT.js +0 -590
  53. package/dist-lib/ol-tilegrid-9VtyxaLG.js +0 -64
  54. package/dist-lib/openlayers-adapter-DVW1KCRv.js +0 -13307
  55. package/dist-lib/option-CBxl1mZP.js +0 -1106
  56. package/dist-lib/rbush-C8k41T4z.js +0 -254
  57. package/dist-lib/spinner-DysxdNG9.js +0 -6
  58. package/dist-lib/tooltip-Cucn1SiD.js +0 -197
  59. package/dist-lib/webmapx-draw-tool-DooAV8cF.js +0 -4336
  60. package/dist-lib/webmapx-settings-DDEJ8aoV.js +0 -479
@@ -1,284 +0,0 @@
1
- import { a as e, i as t, n } from "./decorators-B35AgiCU.js";
2
- import { d as r, f as i, l as a, t as o, u as s } from "./chunk.YHLNUJ7P-D-kanrCf.js";
3
- import { a as c, n as l, t as u } from "./chunk.NYIIDP5N-BikXIStD.js";
4
- import { t as d } from "./chunk.3RPBFEDE-BFO1fHVm.js";
5
- import { n as f, r as p } from "./input-CeGntPlT.js";
6
- import { t as m } from "./chunk.SI4ACBFK-CLb9VfMG.js";
7
- import { css as h, html as g } from "lit";
8
- //#region node_modules/@shoelace-style/shoelace/dist/chunks/chunk.R3NF57O3.js
9
- var _ = h`
10
- :host {
11
- display: inline-block;
12
- }
13
-
14
- .checkbox {
15
- position: relative;
16
- display: inline-flex;
17
- align-items: flex-start;
18
- font-family: var(--sl-input-font-family);
19
- font-weight: var(--sl-input-font-weight);
20
- color: var(--sl-input-label-color);
21
- vertical-align: middle;
22
- cursor: pointer;
23
- }
24
-
25
- .checkbox--small {
26
- --toggle-size: var(--sl-toggle-size-small);
27
- font-size: var(--sl-input-font-size-small);
28
- }
29
-
30
- .checkbox--medium {
31
- --toggle-size: var(--sl-toggle-size-medium);
32
- font-size: var(--sl-input-font-size-medium);
33
- }
34
-
35
- .checkbox--large {
36
- --toggle-size: var(--sl-toggle-size-large);
37
- font-size: var(--sl-input-font-size-large);
38
- }
39
-
40
- .checkbox__control {
41
- flex: 0 0 auto;
42
- position: relative;
43
- display: inline-flex;
44
- align-items: center;
45
- justify-content: center;
46
- width: var(--toggle-size);
47
- height: var(--toggle-size);
48
- border: solid var(--sl-input-border-width) var(--sl-input-border-color);
49
- border-radius: 2px;
50
- background-color: var(--sl-input-background-color);
51
- color: var(--sl-color-neutral-0);
52
- transition:
53
- var(--sl-transition-fast) border-color,
54
- var(--sl-transition-fast) background-color,
55
- var(--sl-transition-fast) color,
56
- var(--sl-transition-fast) box-shadow;
57
- }
58
-
59
- .checkbox__input {
60
- position: absolute;
61
- opacity: 0;
62
- padding: 0;
63
- margin: 0;
64
- pointer-events: none;
65
- }
66
-
67
- .checkbox__checked-icon,
68
- .checkbox__indeterminate-icon {
69
- display: inline-flex;
70
- width: var(--toggle-size);
71
- height: var(--toggle-size);
72
- }
73
-
74
- /* Hover */
75
- .checkbox:not(.checkbox--checked):not(.checkbox--disabled) .checkbox__control:hover {
76
- border-color: var(--sl-input-border-color-hover);
77
- background-color: var(--sl-input-background-color-hover);
78
- }
79
-
80
- /* Focus */
81
- .checkbox:not(.checkbox--checked):not(.checkbox--disabled) .checkbox__input:focus-visible ~ .checkbox__control {
82
- outline: var(--sl-focus-ring);
83
- outline-offset: var(--sl-focus-ring-offset);
84
- }
85
-
86
- /* Checked/indeterminate */
87
- .checkbox--checked .checkbox__control,
88
- .checkbox--indeterminate .checkbox__control {
89
- border-color: var(--sl-color-primary-600);
90
- background-color: var(--sl-color-primary-600);
91
- }
92
-
93
- /* Checked/indeterminate + hover */
94
- .checkbox.checkbox--checked:not(.checkbox--disabled) .checkbox__control:hover,
95
- .checkbox.checkbox--indeterminate:not(.checkbox--disabled) .checkbox__control:hover {
96
- border-color: var(--sl-color-primary-500);
97
- background-color: var(--sl-color-primary-500);
98
- }
99
-
100
- /* Checked/indeterminate + focus */
101
- .checkbox.checkbox--checked:not(.checkbox--disabled) .checkbox__input:focus-visible ~ .checkbox__control,
102
- .checkbox.checkbox--indeterminate:not(.checkbox--disabled) .checkbox__input:focus-visible ~ .checkbox__control {
103
- outline: var(--sl-focus-ring);
104
- outline-offset: var(--sl-focus-ring-offset);
105
- }
106
-
107
- /* Disabled */
108
- .checkbox--disabled {
109
- opacity: 0.5;
110
- cursor: not-allowed;
111
- }
112
-
113
- .checkbox__label {
114
- display: inline-block;
115
- color: var(--sl-input-label-color);
116
- line-height: var(--toggle-size);
117
- margin-inline-start: 0.5em;
118
- user-select: none;
119
- -webkit-user-select: none;
120
- }
121
-
122
- :host([required]) .checkbox__label::after {
123
- content: var(--sl-input-required-content);
124
- color: var(--sl-input-required-content-color);
125
- margin-inline-start: var(--sl-input-required-content-offset);
126
- }
127
- `, v = class extends a {
128
- constructor() {
129
- super(...arguments), this.formControlController = new d(this, {
130
- value: (e) => e.checked ? e.value || "on" : void 0,
131
- defaultValue: (e) => e.defaultChecked,
132
- setValue: (e, t) => e.checked = t
133
- }), this.hasSlotController = new u(this, "help-text"), this.hasFocus = !1, this.title = "", this.name = "", this.size = "medium", this.disabled = !1, this.checked = !1, this.indeterminate = !1, this.defaultChecked = !1, this.form = "", this.required = !1, this.helpText = "";
134
- }
135
- get validity() {
136
- return this.input.validity;
137
- }
138
- get validationMessage() {
139
- return this.input.validationMessage;
140
- }
141
- firstUpdated() {
142
- this.formControlController.updateValidity();
143
- }
144
- handleClick() {
145
- this.checked = !this.checked, this.indeterminate = !1, this.emit("sl-change");
146
- }
147
- handleBlur() {
148
- this.hasFocus = !1, this.emit("sl-blur");
149
- }
150
- handleInput() {
151
- this.emit("sl-input");
152
- }
153
- handleInvalid(e) {
154
- this.formControlController.setValidity(!1), this.formControlController.emitInvalidEvent(e);
155
- }
156
- handleFocus() {
157
- this.hasFocus = !0, this.emit("sl-focus");
158
- }
159
- handleDisabledChange() {
160
- this.formControlController.setValidity(this.disabled);
161
- }
162
- handleStateChange() {
163
- this.input.checked = this.checked, this.input.indeterminate = this.indeterminate, this.formControlController.updateValidity();
164
- }
165
- click() {
166
- this.input.click();
167
- }
168
- focus(e) {
169
- this.input.focus(e);
170
- }
171
- blur() {
172
- this.input.blur();
173
- }
174
- checkValidity() {
175
- return this.input.checkValidity();
176
- }
177
- getForm() {
178
- return this.formControlController.getForm();
179
- }
180
- reportValidity() {
181
- return this.input.reportValidity();
182
- }
183
- setCustomValidity(e) {
184
- this.input.setCustomValidity(e), this.formControlController.updateValidity();
185
- }
186
- render() {
187
- let e = this.hasSlotController.test("help-text"), t = this.helpText ? !0 : !!e;
188
- return g`
189
- <div
190
- class=${c({
191
- "form-control": !0,
192
- "form-control--small": this.size === "small",
193
- "form-control--medium": this.size === "medium",
194
- "form-control--large": this.size === "large",
195
- "form-control--has-help-text": t
196
- })}
197
- >
198
- <label
199
- part="base"
200
- class=${c({
201
- checkbox: !0,
202
- "checkbox--checked": this.checked,
203
- "checkbox--disabled": this.disabled,
204
- "checkbox--focused": this.hasFocus,
205
- "checkbox--indeterminate": this.indeterminate,
206
- "checkbox--small": this.size === "small",
207
- "checkbox--medium": this.size === "medium",
208
- "checkbox--large": this.size === "large"
209
- })}
210
- >
211
- <input
212
- class="checkbox__input"
213
- type="checkbox"
214
- title=${this.title}
215
- name=${this.name}
216
- value=${l(this.value)}
217
- .indeterminate=${f(this.indeterminate)}
218
- .checked=${f(this.checked)}
219
- .disabled=${this.disabled}
220
- .required=${this.required}
221
- aria-checked=${this.checked ? "true" : "false"}
222
- aria-describedby="help-text"
223
- @click=${this.handleClick}
224
- @input=${this.handleInput}
225
- @invalid=${this.handleInvalid}
226
- @blur=${this.handleBlur}
227
- @focus=${this.handleFocus}
228
- />
229
-
230
- <span
231
- part="control${this.checked ? " control--checked" : ""}${this.indeterminate ? " control--indeterminate" : ""}"
232
- class="checkbox__control"
233
- >
234
- ${this.checked ? g`
235
- <sl-icon part="checked-icon" class="checkbox__checked-icon" library="system" name="check"></sl-icon>
236
- ` : ""}
237
- ${!this.checked && this.indeterminate ? g`
238
- <sl-icon
239
- part="indeterminate-icon"
240
- class="checkbox__indeterminate-icon"
241
- library="system"
242
- name="indeterminate"
243
- ></sl-icon>
244
- ` : ""}
245
- </span>
246
-
247
- <div part="label" class="checkbox__label">
248
- <slot></slot>
249
- </div>
250
- </label>
251
-
252
- <div
253
- aria-hidden=${t ? "false" : "true"}
254
- class="form-control__help-text"
255
- id="help-text"
256
- part="form-control-help-text"
257
- >
258
- <slot name="help-text">${this.helpText}</slot>
259
- </div>
260
- </div>
261
- `;
262
- }
263
- };
264
- //#endregion
265
- //#region node_modules/@shoelace-style/shoelace/dist/chunks/chunk.D5YQDJ7X.js
266
- v.styles = [
267
- s,
268
- m,
269
- _
270
- ], v.dependencies = { "sl-icon": o }, i([n("input[type=\"checkbox\"]")], v.prototype, "input", 2), i([t()], v.prototype, "hasFocus", 2), i([e()], v.prototype, "title", 2), i([e()], v.prototype, "name", 2), i([e()], v.prototype, "value", 2), i([e({ reflect: !0 })], v.prototype, "size", 2), i([e({
271
- type: Boolean,
272
- reflect: !0
273
- })], v.prototype, "disabled", 2), i([e({
274
- type: Boolean,
275
- reflect: !0
276
- })], v.prototype, "checked", 2), i([e({
277
- type: Boolean,
278
- reflect: !0
279
- })], v.prototype, "indeterminate", 2), i([p("checked")], v.prototype, "defaultChecked", 2), i([e({ reflect: !0 })], v.prototype, "form", 2), i([e({
280
- type: Boolean,
281
- reflect: !0
282
- })], v.prototype, "required", 2), i([e({ attribute: "help-text" })], v.prototype, "helpText", 2), i([r("disabled", { waitUntilFirstUpdate: !0 })], v.prototype, "handleDisabledChange", 1), i([r(["checked", "indeterminate"], { waitUntilFirstUpdate: !0 })], v.prototype, "handleStateChange", 1), v.define("sl-checkbox");
283
- //#endregion
284
- export { v as t };
@@ -1,77 +0,0 @@
1
- import { l as e, u as t } from "./chunk.YHLNUJ7P-D-kanrCf.js";
2
- import { t as n } from "./chunk.6CTB5ZDJ-DjZrBd6Y.js";
3
- import { css as r, html as i } from "lit";
4
- //#region node_modules/@shoelace-style/shoelace/dist/chunks/chunk.7DUCI5S4.js
5
- var a = r`
6
- :host {
7
- --track-width: 2px;
8
- --track-color: rgb(128 128 128 / 25%);
9
- --indicator-color: var(--sl-color-primary-600);
10
- --speed: 2s;
11
-
12
- display: inline-flex;
13
- width: 1em;
14
- height: 1em;
15
- flex: none;
16
- }
17
-
18
- .spinner {
19
- flex: 1 1 auto;
20
- height: 100%;
21
- width: 100%;
22
- }
23
-
24
- .spinner__track,
25
- .spinner__indicator {
26
- fill: none;
27
- stroke-width: var(--track-width);
28
- r: calc(0.5em - var(--track-width) / 2);
29
- cx: 0.5em;
30
- cy: 0.5em;
31
- transform-origin: 50% 50%;
32
- }
33
-
34
- .spinner__track {
35
- stroke: var(--track-color);
36
- transform-origin: 0% 0%;
37
- }
38
-
39
- .spinner__indicator {
40
- stroke: var(--indicator-color);
41
- stroke-linecap: round;
42
- stroke-dasharray: 150% 75%;
43
- animation: spin var(--speed) linear infinite;
44
- }
45
-
46
- @keyframes spin {
47
- 0% {
48
- transform: rotate(0deg);
49
- stroke-dasharray: 0.05em, 3em;
50
- }
51
-
52
- 50% {
53
- transform: rotate(450deg);
54
- stroke-dasharray: 1.375em, 1.375em;
55
- }
56
-
57
- 100% {
58
- transform: rotate(1080deg);
59
- stroke-dasharray: 0.05em, 3em;
60
- }
61
- }
62
- `, o = class extends e {
63
- constructor() {
64
- super(...arguments), this.localize = new n(this);
65
- }
66
- render() {
67
- return i`
68
- <svg part="base" class="spinner" role="progressbar" aria-label=${this.localize.term("loading")}>
69
- <circle class="spinner__track"></circle>
70
- <circle class="spinner__indicator"></circle>
71
- </svg>
72
- `;
73
- }
74
- };
75
- o.styles = [t, a];
76
- //#endregion
77
- export { o as t };
@@ -1,138 +0,0 @@
1
- import { m as e, p as t } from "./chunk.YHLNUJ7P-D-kanrCf.js";
2
- //#region node_modules/@shoelace-style/shoelace/dist/chunks/chunk.3RPBFEDE.js
3
- var n = /* @__PURE__ */ new WeakMap(), r = /* @__PURE__ */ new WeakMap(), i = /* @__PURE__ */ new WeakMap(), a = /* @__PURE__ */ new WeakSet(), o = /* @__PURE__ */ new WeakMap(), s = class {
4
- constructor(t, r) {
5
- this.handleFormData = (e) => {
6
- let t = this.options.disabled(this.host), n = this.options.name(this.host), r = this.options.value(this.host), i = this.host.tagName.toLowerCase() === "sl-button";
7
- this.host.isConnected && !t && !i && typeof n == "string" && n.length > 0 && r !== void 0 && (Array.isArray(r) ? r.forEach((t) => {
8
- e.formData.append(n, t.toString());
9
- }) : e.formData.append(n, r.toString()));
10
- }, this.handleFormSubmit = (e) => {
11
- var t;
12
- let r = this.options.disabled(this.host), i = this.options.reportValidity;
13
- this.form && !this.form.noValidate && ((t = n.get(this.form)) == null || t.forEach((e) => {
14
- this.setUserInteracted(e, !0);
15
- })), this.form && !this.form.noValidate && !r && !i(this.host) && (e.preventDefault(), e.stopImmediatePropagation());
16
- }, this.handleFormReset = () => {
17
- this.options.setValue(this.host, this.options.defaultValue(this.host)), this.setUserInteracted(this.host, !1), o.set(this.host, []);
18
- }, this.handleInteraction = (e) => {
19
- let t = o.get(this.host);
20
- t.includes(e.type) || t.push(e.type), t.length === this.options.assumeInteractionOn.length && this.setUserInteracted(this.host, !0);
21
- }, this.checkFormValidity = () => {
22
- if (this.form && !this.form.noValidate) {
23
- let e = this.form.querySelectorAll("*");
24
- for (let t of e) if (typeof t.checkValidity == "function" && !t.checkValidity()) return !1;
25
- }
26
- return !0;
27
- }, this.reportFormValidity = () => {
28
- if (this.form && !this.form.noValidate) {
29
- let e = this.form.querySelectorAll("*");
30
- for (let t of e) if (typeof t.reportValidity == "function" && !t.reportValidity()) return !1;
31
- }
32
- return !0;
33
- }, (this.host = t).addController(this), this.options = e({
34
- form: (e) => {
35
- let t = e.form;
36
- if (t) {
37
- let n = e.getRootNode().querySelector(`#${t}`);
38
- if (n) return n;
39
- }
40
- return e.closest("form");
41
- },
42
- name: (e) => e.name,
43
- value: (e) => e.value,
44
- defaultValue: (e) => e.defaultValue,
45
- disabled: (e) => e.disabled ?? !1,
46
- reportValidity: (e) => typeof e.reportValidity == "function" ? e.reportValidity() : !0,
47
- checkValidity: (e) => typeof e.checkValidity == "function" ? e.checkValidity() : !0,
48
- setValue: (e, t) => e.value = t,
49
- assumeInteractionOn: ["sl-input"]
50
- }, r);
51
- }
52
- hostConnected() {
53
- let e = this.options.form(this.host);
54
- e && this.attachForm(e), o.set(this.host, []), this.options.assumeInteractionOn.forEach((e) => {
55
- this.host.addEventListener(e, this.handleInteraction);
56
- });
57
- }
58
- hostDisconnected() {
59
- this.detachForm(), o.delete(this.host), this.options.assumeInteractionOn.forEach((e) => {
60
- this.host.removeEventListener(e, this.handleInteraction);
61
- });
62
- }
63
- hostUpdated() {
64
- let e = this.options.form(this.host);
65
- e || this.detachForm(), e && this.form !== e && (this.detachForm(), this.attachForm(e)), this.host.hasUpdated && this.setValidity(this.host.validity.valid);
66
- }
67
- attachForm(e) {
68
- e ? (this.form = e, n.has(this.form) ? n.get(this.form).add(this.host) : n.set(this.form, /* @__PURE__ */ new Set([this.host])), this.form.addEventListener("formdata", this.handleFormData), this.form.addEventListener("submit", this.handleFormSubmit), this.form.addEventListener("reset", this.handleFormReset), r.has(this.form) || (r.set(this.form, this.form.reportValidity), this.form.reportValidity = () => this.reportFormValidity()), i.has(this.form) || (i.set(this.form, this.form.checkValidity), this.form.checkValidity = () => this.checkFormValidity())) : this.form = void 0;
69
- }
70
- detachForm() {
71
- if (!this.form) return;
72
- let e = n.get(this.form);
73
- e && (e.delete(this.host), e.size <= 0 && (this.form.removeEventListener("formdata", this.handleFormData), this.form.removeEventListener("submit", this.handleFormSubmit), this.form.removeEventListener("reset", this.handleFormReset), r.has(this.form) && (this.form.reportValidity = r.get(this.form), r.delete(this.form)), i.has(this.form) && (this.form.checkValidity = i.get(this.form), i.delete(this.form)), this.form = void 0));
74
- }
75
- setUserInteracted(e, t) {
76
- t ? a.add(e) : a.delete(e), e.requestUpdate();
77
- }
78
- doAction(e, t) {
79
- if (this.form) {
80
- let n = document.createElement("button");
81
- n.type = e, n.style.position = "absolute", n.style.width = "0", n.style.height = "0", n.style.clipPath = "inset(50%)", n.style.overflow = "hidden", n.style.whiteSpace = "nowrap", t && (n.name = t.name, n.value = t.value, [
82
- "formaction",
83
- "formenctype",
84
- "formmethod",
85
- "formnovalidate",
86
- "formtarget"
87
- ].forEach((e) => {
88
- t.hasAttribute(e) && n.setAttribute(e, t.getAttribute(e));
89
- })), this.form.append(n), n.click(), n.remove();
90
- }
91
- }
92
- getForm() {
93
- return this.form ?? null;
94
- }
95
- reset(e) {
96
- this.doAction("reset", e);
97
- }
98
- submit(e) {
99
- this.doAction("submit", e);
100
- }
101
- setValidity(e) {
102
- let t = this.host, n = !!a.has(t), r = !!t.required;
103
- t.toggleAttribute("data-required", r), t.toggleAttribute("data-optional", !r), t.toggleAttribute("data-invalid", !e), t.toggleAttribute("data-valid", e), t.toggleAttribute("data-user-invalid", !e && n), t.toggleAttribute("data-user-valid", e && n);
104
- }
105
- updateValidity() {
106
- let e = this.host;
107
- this.setValidity(e.validity.valid);
108
- }
109
- emitInvalidEvent(e) {
110
- let t = new CustomEvent("sl-invalid", {
111
- bubbles: !1,
112
- composed: !1,
113
- cancelable: !0,
114
- detail: {}
115
- });
116
- e || t.preventDefault(), this.host.dispatchEvent(t) || e?.preventDefault();
117
- }
118
- }, c = Object.freeze({
119
- badInput: !1,
120
- customError: !1,
121
- patternMismatch: !1,
122
- rangeOverflow: !1,
123
- rangeUnderflow: !1,
124
- stepMismatch: !1,
125
- tooLong: !1,
126
- tooShort: !1,
127
- typeMismatch: !1,
128
- valid: !0,
129
- valueMissing: !1
130
- }), l = Object.freeze(t(e({}, c), {
131
- valid: !1,
132
- valueMissing: !0
133
- })), u = Object.freeze(t(e({}, c), {
134
- valid: !1,
135
- customError: !0
136
- }));
137
- //#endregion
138
- export { l as i, u as n, c as r, s as t };