@synergy-design-system/components 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{chunk.NGM2Y5G5.js → chunk.47O65PF5.js} +2 -2
- package/dist/chunks/{chunk.ZUOBN5Q3.js → chunk.4S27S3RY.js} +2 -2
- package/dist/chunks/{chunk.GCYPKQBG.js → chunk.5EXH7VQY.js} +2 -2
- package/dist/chunks/{chunk.R3CMRBZ7.js → chunk.5T6QTZ6K.js} +3 -3
- package/dist/chunks/{chunk.W5TOVAHB.js → chunk.6UMINMJ4.js} +2 -2
- package/dist/chunks/{chunk.P2LNG2PZ.js → chunk.AMTCNRDE.js} +38 -9
- package/dist/chunks/chunk.AMTCNRDE.js.map +7 -0
- package/dist/chunks/{chunk.VG7NKBOV.js → chunk.CQ2JMH2J.js} +4 -4
- package/dist/chunks/{chunk.LWB5LXJ5.js → chunk.EEBBPMDI.js} +2 -2
- package/dist/chunks/{chunk.ITSSPNRO.js → chunk.EJKKSDGO.js} +2 -2
- package/dist/chunks/{chunk.QAPZLSEL.js → chunk.F75WKKCW.js} +3 -3
- package/dist/chunks/{chunk.4YSX6HUH.js → chunk.GMXJDCBI.js} +2 -2
- package/dist/chunks/{chunk.OUVIH6QL.js → chunk.H6VNYYUH.js} +3 -3
- package/dist/chunks/{chunk.Z3RZUTQU.js → chunk.HG5QC5EW.js} +2 -2
- package/dist/chunks/{chunk.I4ZBEQUH.js → chunk.JAKBHRC4.js} +3 -3
- package/dist/chunks/{chunk.U5AOTLVK.js → chunk.JW6NUJMF.js} +2 -2
- package/dist/chunks/{chunk.2D7KJSSX.js → chunk.KZMLTHDT.js} +4 -4
- package/dist/chunks/{chunk.MBXGNZ7I.js → chunk.L47LNUE3.js} +2 -2
- package/dist/chunks/chunk.LAB4YJYE.js +16 -0
- package/dist/chunks/chunk.LAB4YJYE.js.map +7 -0
- package/dist/chunks/{chunk.2V5UNOVJ.js → chunk.MWDOOCSU.js} +2 -2
- package/dist/chunks/{chunk.MTGT2EG5.js → chunk.N6E3X3S5.js} +2 -2
- package/dist/chunks/{chunk.VM64SQGC.js → chunk.NROSOMZ6.js} +2 -2
- package/dist/chunks/{chunk.5ILVVLJF.js → chunk.OINL3N23.js} +3 -3
- package/dist/chunks/{chunk.R3S3AGUF.js → chunk.PTZNO34T.js} +2 -2
- package/dist/chunks/{chunk.MM2HMAE6.js → chunk.RGXSZCKM.js} +9 -17
- package/dist/chunks/chunk.RGXSZCKM.js.map +7 -0
- package/dist/chunks/{chunk.PTBOOLQE.js → chunk.VIGOUABZ.js} +6 -6
- package/dist/chunks/{chunk.UYF5MTOU.js → chunk.VSUPUWP6.js} +2 -2
- package/dist/chunks/{chunk.AMHJ56Z3.js → chunk.W2K4VNZU.js} +4 -4
- package/dist/chunks/{chunk.AP2QDLP7.js → chunk.WZ7YZYWN.js} +4 -4
- package/dist/chunks/{chunk.V52P6M55.js → chunk.XMUT2KKD.js} +2 -2
- package/dist/chunks/{chunk.V52P6M55.js.map → chunk.XMUT2KKD.js.map} +1 -1
- package/dist/chunks/{chunk.DS3H2UY3.js → chunk.YK3MDRNQ.js} +3 -3
- package/dist/chunks/{chunk.S6PKR3AN.js → chunk.ZLE6SGK3.js} +5 -5
- package/dist/components/button/button.component.js +8 -8
- package/dist/components/button/button.js +9 -9
- package/dist/components/button/button.styles.js +2 -2
- package/dist/components/button-group/button-group.component.js +2 -2
- package/dist/components/button-group/button-group.js +3 -3
- package/dist/components/checkbox/checkbox.component.js +4 -4
- package/dist/components/checkbox/checkbox.js +5 -5
- package/dist/components/icon/icon.component.js +2 -2
- package/dist/components/icon/icon.js +3 -3
- package/dist/components/icon-button/icon-button.component.js +3 -3
- package/dist/components/icon-button/icon-button.js +4 -4
- package/dist/components/input/input.component.js +5 -5
- package/dist/components/input/input.js +6 -6
- package/dist/components/radio/radio.component.js +3 -3
- package/dist/components/radio/radio.js +4 -4
- package/dist/components/radio-button/radio-button.component.js +5 -5
- package/dist/components/radio-button/radio-button.js +6 -6
- package/dist/components/radio-button/radio-button.styles.js +3 -3
- package/dist/components/radio-group/radio-group.component.js +5 -5
- package/dist/components/radio-group/radio-group.js +6 -6
- package/dist/components/spinner/spinner.component.js +3 -3
- package/dist/components/switch/switch.component.js +3 -3
- package/dist/components/switch/switch.js +4 -4
- package/dist/components/tag/tag.component.js +5 -5
- package/dist/components/tag/tag.js +6 -6
- package/dist/components/textarea/textarea.component.js +3 -3
- package/dist/components/textarea/textarea.js +4 -4
- package/dist/custom-elements.json +142 -142
- package/dist/internal/form.d.ts +6 -0
- package/dist/internal/test.d.ts +4 -1
- package/dist/synergy.js +35 -35
- package/dist/translations/de.js +1 -1
- package/dist/utilities/form.js +2 -2
- package/dist/utilities/localize.d.ts +0 -1
- package/dist/utilities/localize.js +1 -1
- package/dist/vscode.html-custom-data.json +17 -17
- package/dist/web-types.json +30 -30
- package/package.json +3 -3
- package/dist/chunks/chunk.MM2HMAE6.js.map +0 -7
- package/dist/chunks/chunk.P2LNG2PZ.js.map +0 -7
- package/dist/chunks/chunk.R6VNLE6N.js +0 -11
- package/dist/chunks/chunk.R6VNLE6N.js.map +0 -7
- /package/dist/chunks/{chunk.NGM2Y5G5.js.map → chunk.47O65PF5.js.map} +0 -0
- /package/dist/chunks/{chunk.ZUOBN5Q3.js.map → chunk.4S27S3RY.js.map} +0 -0
- /package/dist/chunks/{chunk.GCYPKQBG.js.map → chunk.5EXH7VQY.js.map} +0 -0
- /package/dist/chunks/{chunk.R3CMRBZ7.js.map → chunk.5T6QTZ6K.js.map} +0 -0
- /package/dist/chunks/{chunk.W5TOVAHB.js.map → chunk.6UMINMJ4.js.map} +0 -0
- /package/dist/chunks/{chunk.VG7NKBOV.js.map → chunk.CQ2JMH2J.js.map} +0 -0
- /package/dist/chunks/{chunk.LWB5LXJ5.js.map → chunk.EEBBPMDI.js.map} +0 -0
- /package/dist/chunks/{chunk.ITSSPNRO.js.map → chunk.EJKKSDGO.js.map} +0 -0
- /package/dist/chunks/{chunk.QAPZLSEL.js.map → chunk.F75WKKCW.js.map} +0 -0
- /package/dist/chunks/{chunk.4YSX6HUH.js.map → chunk.GMXJDCBI.js.map} +0 -0
- /package/dist/chunks/{chunk.OUVIH6QL.js.map → chunk.H6VNYYUH.js.map} +0 -0
- /package/dist/chunks/{chunk.Z3RZUTQU.js.map → chunk.HG5QC5EW.js.map} +0 -0
- /package/dist/chunks/{chunk.I4ZBEQUH.js.map → chunk.JAKBHRC4.js.map} +0 -0
- /package/dist/chunks/{chunk.U5AOTLVK.js.map → chunk.JW6NUJMF.js.map} +0 -0
- /package/dist/chunks/{chunk.2D7KJSSX.js.map → chunk.KZMLTHDT.js.map} +0 -0
- /package/dist/chunks/{chunk.MBXGNZ7I.js.map → chunk.L47LNUE3.js.map} +0 -0
- /package/dist/chunks/{chunk.2V5UNOVJ.js.map → chunk.MWDOOCSU.js.map} +0 -0
- /package/dist/chunks/{chunk.MTGT2EG5.js.map → chunk.N6E3X3S5.js.map} +0 -0
- /package/dist/chunks/{chunk.VM64SQGC.js.map → chunk.NROSOMZ6.js.map} +0 -0
- /package/dist/chunks/{chunk.5ILVVLJF.js.map → chunk.OINL3N23.js.map} +0 -0
- /package/dist/chunks/{chunk.R3S3AGUF.js.map → chunk.PTZNO34T.js.map} +0 -0
- /package/dist/chunks/{chunk.PTBOOLQE.js.map → chunk.VIGOUABZ.js.map} +0 -0
- /package/dist/chunks/{chunk.UYF5MTOU.js.map → chunk.VSUPUWP6.js.map} +0 -0
- /package/dist/chunks/{chunk.AMHJ56Z3.js.map → chunk.W2K4VNZU.js.map} +0 -0
- /package/dist/chunks/{chunk.AP2QDLP7.js.map → chunk.WZ7YZYWN.js.map} +0 -0
- /package/dist/chunks/{chunk.DS3H2UY3.js.map → chunk.YK3MDRNQ.js.map} +0 -0
- /package/dist/chunks/{chunk.S6PKR3AN.js.map → chunk.ZLE6SGK3.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SynTextarea
|
|
3
|
-
} from "./chunk.
|
|
3
|
+
} from "./chunk.F75WKKCW.js";
|
|
4
4
|
|
|
5
5
|
// src/components/textarea/textarea.ts
|
|
6
6
|
var textarea_default = SynTextarea;
|
|
@@ -9,4 +9,4 @@ SynTextarea.define("syn-textarea");
|
|
|
9
9
|
export {
|
|
10
10
|
textarea_default
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=chunk.
|
|
12
|
+
//# sourceMappingURL=chunk.47O65PF5.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SynSwitch
|
|
3
|
-
} from "./chunk.
|
|
3
|
+
} from "./chunk.YK3MDRNQ.js";
|
|
4
4
|
|
|
5
5
|
// src/components/switch/switch.ts
|
|
6
6
|
var switch_default = SynSwitch;
|
|
@@ -9,4 +9,4 @@ SynSwitch.define("syn-switch");
|
|
|
9
9
|
export {
|
|
10
10
|
switch_default
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=chunk.
|
|
12
|
+
//# sourceMappingURL=chunk.4S27S3RY.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SynIconButton
|
|
3
|
-
} from "./chunk.
|
|
3
|
+
} from "./chunk.5T6QTZ6K.js";
|
|
4
4
|
|
|
5
5
|
// src/components/icon-button/icon-button.ts
|
|
6
6
|
var icon_button_default = SynIconButton;
|
|
@@ -9,4 +9,4 @@ SynIconButton.define("syn-icon-button");
|
|
|
9
9
|
export {
|
|
10
10
|
icon_button_default
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=chunk.
|
|
12
|
+
//# sourceMappingURL=chunk.5EXH7VQY.js.map
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk.2FN5DTS6.js";
|
|
4
4
|
import {
|
|
5
5
|
SynIcon
|
|
6
|
-
} from "./chunk.
|
|
6
|
+
} from "./chunk.NROSOMZ6.js";
|
|
7
7
|
import {
|
|
8
8
|
SynergyElement
|
|
9
|
-
} from "./chunk.
|
|
9
|
+
} from "./chunk.XMUT2KKD.js";
|
|
10
10
|
import {
|
|
11
11
|
__decorateClass
|
|
12
12
|
} from "./chunk.DJOAQ4JU.js";
|
|
@@ -134,4 +134,4 @@ __decorateClass([
|
|
|
134
134
|
export {
|
|
135
135
|
SynIconButton
|
|
136
136
|
};
|
|
137
|
-
//# sourceMappingURL=chunk.
|
|
137
|
+
//# sourceMappingURL=chunk.5T6QTZ6K.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SynButtonGroup
|
|
3
|
-
} from "./chunk.
|
|
3
|
+
} from "./chunk.WZ7YZYWN.js";
|
|
4
4
|
|
|
5
5
|
// src/components/button-group/button-group.ts
|
|
6
6
|
var button_group_default = SynButtonGroup;
|
|
@@ -9,4 +9,4 @@ SynButtonGroup.define("syn-button-group");
|
|
|
9
9
|
export {
|
|
10
10
|
button_group_default
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=chunk.
|
|
12
|
+
//# sourceMappingURL=chunk.6UMINMJ4.js.map
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
// src/internal/form.ts
|
|
7
7
|
var formCollections = /* @__PURE__ */ new WeakMap();
|
|
8
8
|
var reportValidityOverloads = /* @__PURE__ */ new WeakMap();
|
|
9
|
+
var checkValidityOverloads = /* @__PURE__ */ new WeakMap();
|
|
9
10
|
var userInteractedControls = /* @__PURE__ */ new WeakSet();
|
|
10
11
|
var interactions = /* @__PURE__ */ new WeakMap();
|
|
11
12
|
var FormControlController = class {
|
|
@@ -53,6 +54,19 @@ var FormControlController = class {
|
|
|
53
54
|
this.setUserInteracted(this.host, true);
|
|
54
55
|
}
|
|
55
56
|
};
|
|
57
|
+
this.checkFormValidity = () => {
|
|
58
|
+
if (this.form && !this.form.noValidate) {
|
|
59
|
+
const elements = this.form.querySelectorAll("*");
|
|
60
|
+
for (const element of elements) {
|
|
61
|
+
if (typeof element.checkValidity === "function") {
|
|
62
|
+
if (!element.checkValidity()) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return true;
|
|
69
|
+
};
|
|
56
70
|
this.reportFormValidity = () => {
|
|
57
71
|
if (this.form && !this.form.noValidate) {
|
|
58
72
|
const elements = this.form.querySelectorAll("*");
|
|
@@ -69,11 +83,12 @@ var FormControlController = class {
|
|
|
69
83
|
(this.host = host).addController(this);
|
|
70
84
|
this.options = __spreadValues({
|
|
71
85
|
form: (input) => {
|
|
72
|
-
|
|
86
|
+
const formId = input.form;
|
|
87
|
+
if (formId) {
|
|
73
88
|
const root = input.getRootNode();
|
|
74
|
-
const
|
|
75
|
-
if (
|
|
76
|
-
return
|
|
89
|
+
const form = root.getElementById(formId);
|
|
90
|
+
if (form) {
|
|
91
|
+
return form;
|
|
77
92
|
}
|
|
78
93
|
}
|
|
79
94
|
return input.closest("form");
|
|
@@ -86,6 +101,7 @@ var FormControlController = class {
|
|
|
86
101
|
return (_a = input.disabled) != null ? _a : false;
|
|
87
102
|
},
|
|
88
103
|
reportValidity: (input) => typeof input.reportValidity === "function" ? input.reportValidity() : true,
|
|
104
|
+
checkValidity: (input) => typeof input.checkValidity === "function" ? input.checkValidity() : true,
|
|
89
105
|
setValue: (input, value) => input.value = value,
|
|
90
106
|
assumeInteractionOn: ["syn-input"]
|
|
91
107
|
}, options);
|
|
@@ -135,14 +151,23 @@ var FormControlController = class {
|
|
|
135
151
|
reportValidityOverloads.set(this.form, this.form.reportValidity);
|
|
136
152
|
this.form.reportValidity = () => this.reportFormValidity();
|
|
137
153
|
}
|
|
154
|
+
if (!checkValidityOverloads.has(this.form)) {
|
|
155
|
+
checkValidityOverloads.set(this.form, this.form.checkValidity);
|
|
156
|
+
this.form.checkValidity = () => this.checkFormValidity();
|
|
157
|
+
}
|
|
138
158
|
} else {
|
|
139
159
|
this.form = void 0;
|
|
140
160
|
}
|
|
141
161
|
}
|
|
142
162
|
detachForm() {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
163
|
+
if (!this.form)
|
|
164
|
+
return;
|
|
165
|
+
const formCollection = formCollections.get(this.form);
|
|
166
|
+
if (!formCollection) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
formCollection.delete(this.host);
|
|
170
|
+
if (formCollection.size <= 0) {
|
|
146
171
|
this.form.removeEventListener("formdata", this.handleFormData);
|
|
147
172
|
this.form.removeEventListener("submit", this.handleFormSubmit);
|
|
148
173
|
this.form.removeEventListener("reset", this.handleFormReset);
|
|
@@ -150,8 +175,12 @@ var FormControlController = class {
|
|
|
150
175
|
this.form.reportValidity = reportValidityOverloads.get(this.form);
|
|
151
176
|
reportValidityOverloads.delete(this.form);
|
|
152
177
|
}
|
|
178
|
+
if (checkValidityOverloads.has(this.form)) {
|
|
179
|
+
this.form.checkValidity = checkValidityOverloads.get(this.form);
|
|
180
|
+
checkValidityOverloads.delete(this.form);
|
|
181
|
+
}
|
|
182
|
+
this.form = void 0;
|
|
153
183
|
}
|
|
154
|
-
this.form = void 0;
|
|
155
184
|
}
|
|
156
185
|
setUserInteracted(el, hasInteracted) {
|
|
157
186
|
if (hasInteracted) {
|
|
@@ -272,4 +301,4 @@ export {
|
|
|
272
301
|
valueMissingValidityState,
|
|
273
302
|
customErrorValidityState
|
|
274
303
|
};
|
|
275
|
-
//# sourceMappingURL=chunk.
|
|
304
|
+
//# sourceMappingURL=chunk.AMTCNRDE.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/internal/form.ts"],
|
|
4
|
+
"sourcesContent": ["// ---------------------------------------------------------------------\n// \uD83D\uDD12 AUTOGENERATED BY VENDORISM\n// Removing this comment will prevent it from being managed by it.\n// ---------------------------------------------------------------------\n\n/* eslint-disable */\nimport type { ReactiveController, ReactiveControllerHost } from 'lit';\nimport type { SynergyFormControl } from '../internal/synergy-element.js';\nimport type SynButton from '../components/button/button.js';\n\n//\n// We store a WeakMap of forms + controls so we can keep references to all Synergy controls within a given form. As\n// elements connect and disconnect to/from the DOM, their containing form is used as the key and the form control is\n// added and removed from the form's set, respectively.\n//\nexport const formCollections: WeakMap<HTMLFormElement, Set<SynergyFormControl>> = new WeakMap();\n\n//\n// We store a WeakMap of reportValidity() overloads so we can override it when form controls connect to the DOM and\n// restore the original behavior when they disconnect.\n//\nconst reportValidityOverloads: WeakMap<HTMLFormElement, () => boolean> = new WeakMap();\nconst checkValidityOverloads: WeakMap<HTMLFormElement, () => boolean> = new WeakMap();\n\n//\n// We store a Set of controls that users have interacted with. This allows us to determine the interaction state\n// without littering the DOM with additional data attributes.\n//\nconst userInteractedControls: WeakSet<SynergyFormControl> = new WeakSet();\n\n//\n// We store a WeakMap of interactions for each form control so we can track when all conditions are met for validation.\n//\nconst interactions = new WeakMap<SynergyFormControl, string[]>();\n\nexport interface FormControlControllerOptions {\n /** A function that returns the form containing the form control. */\n form: (input: SynergyFormControl) => HTMLFormElement | null;\n /** A function that returns the form control's name, which will be submitted with the form data. */\n name: (input: SynergyFormControl) => string;\n /** A function that returns the form control's current value. */\n value: (input: SynergyFormControl) => unknown | unknown[];\n /** A function that returns the form control's default value. */\n defaultValue: (input: SynergyFormControl) => unknown | unknown[];\n /** A function that returns the form control's current disabled state. If disabled, the value won't be submitted. */\n disabled: (input: SynergyFormControl) => boolean;\n /**\n * A function that maps to the form control's reportValidity() function. When the control is invalid, this will\n * prevent submission and trigger the browser's constraint violation warning.\n */\n reportValidity: (input: SynergyFormControl) => boolean;\n\n /**\n * A function that maps to the form control's `checkValidity()` function. When the control is invalid, this will return false.\n * this is helpful is you want to check validation without triggering the native browser constraint violation warning.\n */\n checkValidity: (input: SynergyFormControl) => boolean;\n /** A function that sets the form control's value */\n setValue: (input: SynergyFormControl, value: unknown) => void;\n /**\n * An array of event names to listen to. When all events in the list are emitted, the control will receive validity\n * states such as user-valid and user-invalid.user interacted validity states. */\n assumeInteractionOn: string[];\n}\n\n/** A reactive controller to allow form controls to participate in form submission, validation, etc. */\nexport class FormControlController implements ReactiveController {\n host: SynergyFormControl & ReactiveControllerHost;\n form?: HTMLFormElement | null;\n options: FormControlControllerOptions;\n\n constructor(host: ReactiveControllerHost & SynergyFormControl, options?: Partial<FormControlControllerOptions>) {\n (this.host = host).addController(this);\n this.options = {\n form: input => {\n // If there's a form attribute, use it to find the target form by id\n // Controls may not always reflect the 'form' property. For example, `<syn-button>` doesn't reflect.\n const formId = input.form;\n\n if (formId) {\n const root = input.getRootNode() as Document | ShadowRoot;\n\n const form = root.getElementById(formId);\n\n if (form) {\n return form as HTMLFormElement;\n }\n }\n\n return input.closest('form');\n },\n name: input => input.name,\n value: input => input.value,\n defaultValue: input => input.defaultValue,\n disabled: input => input.disabled ?? false,\n reportValidity: input => (typeof input.reportValidity === 'function' ? input.reportValidity() : true),\n checkValidity: input => (typeof input.checkValidity === 'function' ? input.checkValidity() : true),\n setValue: (input, value: string) => (input.value = value),\n assumeInteractionOn: ['syn-input'],\n ...options\n };\n }\n\n hostConnected() {\n const form = this.options.form(this.host);\n\n if (form) {\n this.attachForm(form);\n }\n\n // Listen for interactions\n interactions.set(this.host, []);\n this.options.assumeInteractionOn.forEach(event => {\n this.host.addEventListener(event, this.handleInteraction);\n });\n }\n\n hostDisconnected() {\n this.detachForm();\n\n // Clean up interactions\n interactions.delete(this.host);\n this.options.assumeInteractionOn.forEach(event => {\n this.host.removeEventListener(event, this.handleInteraction);\n });\n }\n\n hostUpdated() {\n const form = this.options.form(this.host);\n\n // Detach if the form no longer exists\n if (!form) {\n this.detachForm();\n }\n\n // If the form has changed, reattach it\n if (form && this.form !== form) {\n this.detachForm();\n this.attachForm(form);\n }\n\n if (this.host.hasUpdated) {\n this.setValidity(this.host.validity.valid);\n }\n }\n\n private attachForm(form?: HTMLFormElement) {\n if (form) {\n this.form = form;\n\n // Add this element to the form's collection\n if (formCollections.has(this.form)) {\n formCollections.get(this.form)!.add(this.host);\n } else {\n formCollections.set(this.form, new Set<SynergyFormControl>([this.host]));\n }\n\n this.form.addEventListener('formdata', this.handleFormData);\n this.form.addEventListener('submit', this.handleFormSubmit);\n this.form.addEventListener('reset', this.handleFormReset);\n\n // Overload the form's reportValidity() method so it looks at Synergy form controls\n if (!reportValidityOverloads.has(this.form)) {\n reportValidityOverloads.set(this.form, this.form.reportValidity);\n this.form.reportValidity = () => this.reportFormValidity();\n }\n\n // Overload the form's checkValidity() method so it looks at Synergy form controls\n if (!checkValidityOverloads.has(this.form)) {\n checkValidityOverloads.set(this.form, this.form.checkValidity);\n this.form.checkValidity = () => this.checkFormValidity();\n }\n } else {\n this.form = undefined;\n }\n }\n\n private detachForm() {\n if (!this.form) return;\n\n const formCollection = formCollections.get(this.form);\n\n if (!formCollection) {\n return;\n }\n\n // Remove this host from the form's collection\n formCollection.delete(this.host);\n\n // Check to make sure there's no other form controls in the collection. If we do this\n // without checking if any other controls are still in the collection, then we will wipe out the\n // validity checks for all other elements.\n // see: https://github.com/synergy-design-system/synergy/issues/1703\n if (formCollection.size <= 0) {\n this.form.removeEventListener('formdata', this.handleFormData);\n this.form.removeEventListener('submit', this.handleFormSubmit);\n this.form.removeEventListener('reset', this.handleFormReset);\n\n // Remove the overload and restore the original method\n if (reportValidityOverloads.has(this.form)) {\n this.form.reportValidity = reportValidityOverloads.get(this.form)!;\n reportValidityOverloads.delete(this.form);\n }\n\n if (checkValidityOverloads.has(this.form)) {\n this.form.checkValidity = checkValidityOverloads.get(this.form)!;\n checkValidityOverloads.delete(this.form);\n }\n\n // So it looks weird here to not always set the form to undefined. But I _think_ if we unattach this.form here,\n // we end up in this fun spot where future validity checks don't have a reference to the form validity handler.\n // First form element in sets the validity handler. So we can't clean up `this.form` until there are no other form elements in the form.\n this.form = undefined;\n }\n }\n\n private handleFormData = (event: FormDataEvent) => {\n const disabled = this.options.disabled(this.host);\n const name = this.options.name(this.host);\n const value = this.options.value(this.host);\n\n // For buttons, we only submit the value if they were the submitter. This is currently done in doAction() by\n // injecting the name/value on a temporary button, so we can just skip them here.\n const isButton = this.host.tagName.toLowerCase() === 'syn-button';\n\n if (!disabled && !isButton && typeof name === 'string' && name.length > 0 && typeof value !== 'undefined') {\n if (Array.isArray(value)) {\n (value as unknown[]).forEach(val => {\n event.formData.append(name, (val as string | number | boolean).toString());\n });\n } else {\n event.formData.append(name, (value as string | number | boolean).toString());\n }\n }\n };\n\n private handleFormSubmit = (event: Event) => {\n const disabled = this.options.disabled(this.host);\n const reportValidity = this.options.reportValidity;\n\n // Update the interacted state for all controls when the form is submitted\n if (this.form && !this.form.noValidate) {\n formCollections.get(this.form)?.forEach(control => {\n this.setUserInteracted(control, true);\n });\n }\n\n if (this.form && !this.form.noValidate && !disabled && !reportValidity(this.host)) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n };\n\n private handleFormReset = () => {\n this.options.setValue(this.host, this.options.defaultValue(this.host));\n this.setUserInteracted(this.host, false);\n interactions.set(this.host, []);\n };\n\n private handleInteraction = (event: Event) => {\n const emittedEvents = interactions.get(this.host)!;\n\n if (!emittedEvents.includes(event.type)) {\n emittedEvents.push(event.type);\n }\n\n // Mark it as user-interacted as soon as all associated events have been emitted\n if (emittedEvents.length === this.options.assumeInteractionOn.length) {\n this.setUserInteracted(this.host, true);\n }\n };\n\n private checkFormValidity = () => {\n //\n // This is very similar to the `reportFormValidity` function, but it does not trigger native constraint validation\n // Allow the user to simply check if the form is valid and handling validity in their own way.\n //\n // We preserve the original method in a WeakMap, but we don't call it from the overload because that would trigger\n // validations in an unexpected order. When the element disconnects, we revert to the original behavior. This won't\n // be necessary once we can use ElementInternals.\n //\n // Note that we're also honoring the form's novalidate attribute.\n //\n if (this.form && !this.form.noValidate) {\n // This seems sloppy, but checking all elements will cover native inputs, Synergy inputs, and other custom\n // elements that support the constraint validation API.\n const elements = this.form.querySelectorAll<HTMLInputElement>('*');\n\n for (const element of elements) {\n if (typeof element.checkValidity === 'function') {\n if (!element.checkValidity()) {\n return false;\n }\n }\n }\n }\n\n return true;\n };\n\n private reportFormValidity = () => {\n //\n // Synergy form controls work hard to act like regular form controls. They support the Constraint Validation API\n // and its associated methods such as setCustomValidity() and reportValidity(). However, the HTMLFormElement also\n // has a reportValidity() method that will trigger validation on all child controls. Since we're not yet using\n // ElementInternals, we need to overload this method so it looks for any element with the reportValidity() method.\n //\n // We preserve the original method in a WeakMap, but we don't call it from the overload because that would trigger\n // validations in an unexpected order. When the element disconnects, we revert to the original behavior. This won't\n // be necessary once we can use ElementInternals.\n //\n // Note that we're also honoring the form's novalidate attribute.\n //\n if (this.form && !this.form.noValidate) {\n // This seems sloppy, but checking all elements will cover native inputs, Synergy inputs, and other custom\n // elements that support the constraint validation API.\n const elements = this.form.querySelectorAll<HTMLInputElement>('*');\n\n for (const element of elements) {\n if (typeof element.reportValidity === 'function') {\n if (!element.reportValidity()) {\n return false;\n }\n }\n }\n }\n\n return true;\n };\n\n private setUserInteracted(el: SynergyFormControl, hasInteracted: boolean) {\n if (hasInteracted) {\n userInteractedControls.add(el);\n } else {\n userInteractedControls.delete(el);\n }\n\n el.requestUpdate();\n }\n\n private doAction(type: 'submit' | 'reset', submitter?: HTMLInputElement | SynButton) {\n if (this.form) {\n const button = document.createElement('button');\n button.type = type;\n button.style.position = 'absolute';\n button.style.width = '0';\n button.style.height = '0';\n button.style.clipPath = 'inset(50%)';\n button.style.overflow = 'hidden';\n button.style.whiteSpace = 'nowrap';\n\n // Pass name, value, and form attributes through to the temporary button\n if (submitter) {\n button.name = submitter.name;\n button.value = submitter.value;\n\n ['formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formtarget'].forEach(attr => {\n if (submitter.hasAttribute(attr)) {\n button.setAttribute(attr, submitter.getAttribute(attr)!);\n }\n });\n }\n\n this.form.append(button);\n button.click();\n button.remove();\n }\n }\n\n /** Returns the associated `<form>` element, if one exists. */\n getForm() {\n return this.form ?? null;\n }\n\n /** Resets the form, restoring all the control to their default value */\n reset(submitter?: HTMLInputElement | SynButton) {\n this.doAction('reset', submitter);\n }\n\n /** Submits the form, triggering validation and form data injection. */\n submit(submitter?: HTMLInputElement | SynButton) {\n // Calling form.submit() bypasses the submit event and constraint validation. To prevent this, we can inject a\n // native submit button into the form, \"click\" it, then remove it to simulate a standard form submission.\n this.doAction('submit', submitter);\n }\n\n /**\n * Synchronously sets the form control's validity. Call this when you know the future validity but need to update\n * the host element immediately, i.e. before Lit updates the component in the next update.\n */\n setValidity(isValid: boolean) {\n const host = this.host;\n const hasInteracted = Boolean(userInteractedControls.has(host));\n const required = Boolean(host.required);\n\n //\n // We're mapping the following \"states\" to data attributes. In the future, we can use ElementInternals.states to\n // create a similar mapping, but instead of [data-invalid] it will look like :--invalid.\n //\n // See this RFC for more details: https://github.com/synergy-design-system/synergy/issues/1011\n //\n host.toggleAttribute('data-required', required);\n host.toggleAttribute('data-optional', !required);\n host.toggleAttribute('data-invalid', !isValid);\n host.toggleAttribute('data-valid', isValid);\n host.toggleAttribute('data-user-invalid', !isValid && hasInteracted);\n host.toggleAttribute('data-user-valid', isValid && hasInteracted);\n }\n\n /**\n * Updates the form control's validity based on the current value of `host.validity.valid`. Call this when anything\n * that affects constraint validation changes so the component receives the correct validity states.\n */\n updateValidity() {\n const host = this.host;\n this.setValidity(host.validity.valid);\n }\n\n /**\n * Dispatches a non-bubbling, cancelable custom event of type `syn-invalid`.\n * If the `syn-invalid` event will be cancelled then the original `invalid`\n * event (which may have been passed as argument) will also be cancelled.\n * If no original `invalid` event has been passed then the `syn-invalid`\n * event will be cancelled before being dispatched.\n */\n emitInvalidEvent(originalInvalidEvent?: Event) {\n const slInvalidEvent = new CustomEvent<Record<PropertyKey, never>>('syn-invalid', {\n bubbles: false,\n composed: false,\n cancelable: true,\n detail: {}\n });\n\n if (!originalInvalidEvent) {\n slInvalidEvent.preventDefault();\n }\n\n if (!this.host.dispatchEvent(slInvalidEvent)) {\n originalInvalidEvent?.preventDefault();\n }\n }\n}\n\n/*\n * Predefined common validity states.\n * All of them are read-only.\n */\n\n// A validity state object that represents `valid`\nexport const validValidityState: ValidityState = Object.freeze({\n badInput: false,\n customError: false,\n patternMismatch: false,\n rangeOverflow: false,\n rangeUnderflow: false,\n stepMismatch: false,\n tooLong: false,\n tooShort: false,\n typeMismatch: false,\n valid: true,\n valueMissing: false\n});\n\n// A validity state object that represents `value missing`\nexport const valueMissingValidityState: ValidityState = Object.freeze({\n ...validValidityState,\n valid: false,\n valueMissing: true\n});\n\n// A validity state object that represents a custom error\nexport const customErrorValidityState: ValidityState = Object.freeze({\n ...validValidityState,\n valid: false,\n customError: true\n});\n"],
|
|
5
|
+
"mappings": ";;;;;;AAeO,IAAM,kBAAqE,oBAAI,QAAQ;AAM9F,IAAM,0BAAmE,oBAAI,QAAQ;AACrF,IAAM,yBAAkE,oBAAI,QAAQ;AAMpF,IAAM,yBAAsD,oBAAI,QAAQ;AAKxE,IAAM,eAAe,oBAAI,QAAsC;AAiCxD,IAAM,wBAAN,MAA0D;AAAA,EAK/D,YAAY,MAAmD,SAAiD;AAiJhH,SAAQ,iBAAiB,CAAC,UAAyB;AACjD,YAAM,WAAW,KAAK,QAAQ,SAAS,KAAK,IAAI;AAChD,YAAM,OAAO,KAAK,QAAQ,KAAK,KAAK,IAAI;AACxC,YAAM,QAAQ,KAAK,QAAQ,MAAM,KAAK,IAAI;AAI1C,YAAM,WAAW,KAAK,KAAK,QAAQ,YAAY,MAAM;AAErD,UAAI,CAAC,YAAY,CAAC,YAAY,OAAO,SAAS,YAAY,KAAK,SAAS,KAAK,OAAO,UAAU,aAAa;AACzG,YAAI,MAAM,QAAQ,KAAK,GAAG;AACxB,UAAC,MAAoB,QAAQ,SAAO;AAClC,kBAAM,SAAS,OAAO,MAAO,IAAkC,SAAS,CAAC;AAAA,UAC3E,CAAC;AAAA,QACH,OAAO;AACL,gBAAM,SAAS,OAAO,MAAO,MAAoC,SAAS,CAAC;AAAA,QAC7E;AAAA,MACF;AAAA,IACF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A,MAChF,SAAS;AAAA,MACT,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,QAAQ,CAAC;AAAA,IACX,CAAC;AAED,QAAI,CAAC,sBAAsB;AACzB,qBAAe,eAAe;AAAA,IAChC;AAEA,QAAI,CAAC,KAAK,KAAK,cAAc,cAAc,GAAG;AAC5C,mEAAsB;AAAA,IACxB;AAAA,EACF;AACF;AAQO,IAAM,qBAAoC,OAAO,OAAO;AAAA,EAC7D,UAAU;AAAA,EACV,aAAa;AAAA,EACb,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,SAAS;AAAA,EACT,UAAU;AAAA,EACV,cAAc;AAAA,EACd,OAAO;AAAA,EACP,cAAc;AAChB,CAAC;AAGM,IAAM,4BAA2C,OAAO,OAAO,iCACjE,qBADiE;AAAA,EAEpE,OAAO;AAAA,EACP,cAAc;AAChB,EAAC;AAGM,IAAM,2BAA0C,OAAO,OAAO,iCAChE,qBADgE;AAAA,EAEnE,OAAO;AAAA,EACP,aAAa;AACf,EAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
component_styles_default
|
|
3
|
-
} from "./chunk.O7USYXBT.js";
|
|
4
1
|
import {
|
|
5
2
|
button_custom_styles_default
|
|
6
3
|
} from "./chunk.IUC3AWAU.js";
|
|
4
|
+
import {
|
|
5
|
+
component_styles_default
|
|
6
|
+
} from "./chunk.O7USYXBT.js";
|
|
7
7
|
|
|
8
8
|
// src/components/button/button.styles.ts
|
|
9
9
|
import { css } from "lit";
|
|
@@ -373,4 +373,4 @@ var button_styles_default = css`
|
|
|
373
373
|
export {
|
|
374
374
|
button_styles_default
|
|
375
375
|
};
|
|
376
|
-
//# sourceMappingURL=chunk.
|
|
376
|
+
//# sourceMappingURL=chunk.CQ2JMH2J.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SynButton
|
|
3
|
-
} from "./chunk.
|
|
3
|
+
} from "./chunk.RGXSZCKM.js";
|
|
4
4
|
|
|
5
5
|
// src/components/button/button.ts
|
|
6
6
|
var button_default = SynButton;
|
|
@@ -9,4 +9,4 @@ SynButton.define("syn-button");
|
|
|
9
9
|
export {
|
|
10
10
|
button_default
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=chunk.
|
|
12
|
+
//# sourceMappingURL=chunk.EEBBPMDI.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SynInput
|
|
3
|
-
} from "./chunk.
|
|
3
|
+
} from "./chunk.ZLE6SGK3.js";
|
|
4
4
|
|
|
5
5
|
// src/components/input/input.ts
|
|
6
6
|
var input_default = SynInput;
|
|
@@ -9,4 +9,4 @@ SynInput.define("syn-input");
|
|
|
9
9
|
export {
|
|
10
10
|
input_default
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=chunk.
|
|
12
|
+
//# sourceMappingURL=chunk.EJKKSDGO.js.map
|
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
} from "./chunk.XGXFE6IF.js";
|
|
10
10
|
import {
|
|
11
11
|
FormControlController
|
|
12
|
-
} from "./chunk.
|
|
12
|
+
} from "./chunk.AMTCNRDE.js";
|
|
13
13
|
import {
|
|
14
14
|
watch
|
|
15
15
|
} from "./chunk.VZ7S7YYN.js";
|
|
16
16
|
import {
|
|
17
17
|
SynergyElement
|
|
18
|
-
} from "./chunk.
|
|
18
|
+
} from "./chunk.XMUT2KKD.js";
|
|
19
19
|
import {
|
|
20
20
|
__decorateClass
|
|
21
21
|
} from "./chunk.DJOAQ4JU.js";
|
|
@@ -357,4 +357,4 @@ __decorateClass([
|
|
|
357
357
|
export {
|
|
358
358
|
SynTextarea
|
|
359
359
|
};
|
|
360
|
-
//# sourceMappingURL=chunk.
|
|
360
|
+
//# sourceMappingURL=chunk.F75WKKCW.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SynCheckbox
|
|
3
|
-
} from "./chunk.
|
|
3
|
+
} from "./chunk.W2K4VNZU.js";
|
|
4
4
|
|
|
5
5
|
// src/components/checkbox/checkbox.ts
|
|
6
6
|
var checkbox_default = SynCheckbox;
|
|
@@ -9,4 +9,4 @@ SynCheckbox.define("syn-checkbox");
|
|
|
9
9
|
export {
|
|
10
10
|
checkbox_default
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=chunk.
|
|
12
|
+
//# sourceMappingURL=chunk.GMXJDCBI.js.map
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
} from "./chunk.JBYBQ5TQ.js";
|
|
4
4
|
import {
|
|
5
5
|
SynIcon
|
|
6
|
-
} from "./chunk.
|
|
6
|
+
} from "./chunk.NROSOMZ6.js";
|
|
7
7
|
import {
|
|
8
8
|
watch
|
|
9
9
|
} from "./chunk.VZ7S7YYN.js";
|
|
10
10
|
import {
|
|
11
11
|
SynergyElement
|
|
12
|
-
} from "./chunk.
|
|
12
|
+
} from "./chunk.XMUT2KKD.js";
|
|
13
13
|
import {
|
|
14
14
|
__decorateClass
|
|
15
15
|
} from "./chunk.DJOAQ4JU.js";
|
|
@@ -108,4 +108,4 @@ __decorateClass([
|
|
|
108
108
|
export {
|
|
109
109
|
SynRadio
|
|
110
110
|
};
|
|
111
|
-
//# sourceMappingURL=chunk.
|
|
111
|
+
//# sourceMappingURL=chunk.H6VNYYUH.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
formCollections
|
|
3
|
-
} from "./chunk.
|
|
3
|
+
} from "./chunk.AMTCNRDE.js";
|
|
4
4
|
|
|
5
5
|
// src/utilities/form.ts
|
|
6
6
|
function serialize(form) {
|
|
@@ -39,4 +39,4 @@ export {
|
|
|
39
39
|
serialize,
|
|
40
40
|
getFormControls
|
|
41
41
|
};
|
|
42
|
-
//# sourceMappingURL=chunk.
|
|
42
|
+
//# sourceMappingURL=chunk.HG5QC5EW.js.map
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk.N2I6HVX3.js";
|
|
4
4
|
import {
|
|
5
5
|
LocalizeController
|
|
6
|
-
} from "./chunk.
|
|
6
|
+
} from "./chunk.LAB4YJYE.js";
|
|
7
7
|
import {
|
|
8
8
|
SynergyElement
|
|
9
|
-
} from "./chunk.
|
|
9
|
+
} from "./chunk.XMUT2KKD.js";
|
|
10
10
|
|
|
11
11
|
// src/components/spinner/spinner.component.ts
|
|
12
12
|
import { html } from "lit";
|
|
@@ -29,4 +29,4 @@ SynSpinner.styles = spinner_styles_default;
|
|
|
29
29
|
export {
|
|
30
30
|
SynSpinner
|
|
31
31
|
};
|
|
32
|
-
//# sourceMappingURL=chunk.
|
|
32
|
+
//# sourceMappingURL=chunk.JAKBHRC4.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SynRadioButton
|
|
3
|
-
} from "./chunk.
|
|
3
|
+
} from "./chunk.OINL3N23.js";
|
|
4
4
|
|
|
5
5
|
// src/components/radio-button/radio-button.ts
|
|
6
6
|
var radio_button_default = SynRadioButton;
|
|
@@ -9,4 +9,4 @@ SynRadioButton.define("syn-radio-button");
|
|
|
9
9
|
export {
|
|
10
10
|
radio_button_default
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=chunk.
|
|
12
|
+
//# sourceMappingURL=chunk.JW6NUJMF.js.map
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
} from "./chunk.QHFGD6WW.js";
|
|
4
4
|
import {
|
|
5
5
|
SynIconButton
|
|
6
|
-
} from "./chunk.
|
|
6
|
+
} from "./chunk.5T6QTZ6K.js";
|
|
7
7
|
import {
|
|
8
8
|
LocalizeController
|
|
9
|
-
} from "./chunk.
|
|
9
|
+
} from "./chunk.LAB4YJYE.js";
|
|
10
10
|
import {
|
|
11
11
|
SynergyElement
|
|
12
|
-
} from "./chunk.
|
|
12
|
+
} from "./chunk.XMUT2KKD.js";
|
|
13
13
|
import {
|
|
14
14
|
__decorateClass
|
|
15
15
|
} from "./chunk.DJOAQ4JU.js";
|
|
@@ -72,4 +72,4 @@ __decorateClass([
|
|
|
72
72
|
export {
|
|
73
73
|
SynTag
|
|
74
74
|
};
|
|
75
|
-
//# sourceMappingURL=chunk.
|
|
75
|
+
//# sourceMappingURL=chunk.KZMLTHDT.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SynRadioGroup
|
|
3
|
-
} from "./chunk.
|
|
3
|
+
} from "./chunk.VIGOUABZ.js";
|
|
4
4
|
|
|
5
5
|
// src/components/radio-group/radio-group.ts
|
|
6
6
|
var radio_group_default = SynRadioGroup;
|
|
@@ -9,4 +9,4 @@ SynRadioGroup.define("syn-radio-group");
|
|
|
9
9
|
export {
|
|
10
10
|
radio_group_default
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=chunk.
|
|
12
|
+
//# sourceMappingURL=chunk.L47LNUE3.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
en_default
|
|
3
|
+
} from "./chunk.A3SKDWCT.js";
|
|
4
|
+
|
|
5
|
+
// src/utilities/localize.ts
|
|
6
|
+
import { LocalizeController as DefaultLocalizationController, registerTranslation } from "@shoelace-style/localize";
|
|
7
|
+
import { registerTranslation as registerTranslation2 } from "@shoelace-style/localize";
|
|
8
|
+
var LocalizeController = class extends DefaultLocalizationController {
|
|
9
|
+
};
|
|
10
|
+
registerTranslation(en_default);
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
LocalizeController,
|
|
14
|
+
registerTranslation2 as registerTranslation
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=chunk.LAB4YJYE.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utilities/localize.ts"],
|
|
4
|
+
"sourcesContent": ["// ---------------------------------------------------------------------\n// \uD83D\uDD12 AUTOGENERATED BY VENDORISM\n// Removing this comment will prevent it from being managed by it.\n// ---------------------------------------------------------------------\n\n/* eslint-disable */\nimport { LocalizeController as DefaultLocalizationController, registerTranslation } from '@shoelace-style/localize';\nimport en from '../translations/en.js'; // Register English as the default/fallback language\nimport type { Translation as DefaultTranslation } from '@shoelace-style/localize';\n\n// Extend the controller and apply our own translation interface for better typings\nexport class LocalizeController extends DefaultLocalizationController<Translation> {\n // Technicallly '../translations/en.js' is supposed to work via side-effects. However, by some mystery sometimes the\n // translations don't get bundled as expected resulting in `no translation found` errors.\n // This is basically some extra assurance that our translations get registered prior to our localizer connecting in a component\n // and we don't rely on implicit import ordering.\n static {\n registerTranslation(en);\n }\n}\n\n// Export functions from the localize lib so we have one central place to import them from\nexport { registerTranslation } from '@shoelace-style/localize';\n\nexport interface Translation extends DefaultTranslation {\n $code: string; // e.g. en, en-GB\n $name: string; // e.g. English, Espa\u00F1ol\n $dir: 'ltr' | 'rtl';\n\n carousel: string;\n clearEntry: string;\n close: string;\n copied: string;\n copy: string;\n currentValue: string;\n error: string;\n goToSlide: (slide: number, count: number) => string;\n hidePassword: string;\n loading: string;\n nextSlide: string;\n numOptionsSelected: (num: number) => string;\n previousSlide: string;\n progress: string;\n remove: string;\n resize: string;\n scrollToEnd: string;\n scrollToStart: string;\n selectAColorFromTheScreen: string;\n showPassword: string;\n slideNum: (slide: number) => string;\n toggleColorFormat: string;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AAMA,SAAS,sBAAsB,+BAA+B,2BAA2B;AAgBzF,SAAS,uBAAAA,4BAA2B;AAX7B,IAAM,qBAAN,cAAiC,8BAA2C;AAQnF;AAFI,oBAAoB,UAAE;",
|
|
6
|
+
"names": ["registerTranslation"]
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
button_styles_default
|
|
3
|
-
} from "./chunk.
|
|
3
|
+
} from "./chunk.CQ2JMH2J.js";
|
|
4
4
|
|
|
5
5
|
// src/components/radio-button/radio-button.styles.ts
|
|
6
6
|
import { css } from "lit";
|
|
@@ -34,4 +34,4 @@ var radio_button_styles_default = css`
|
|
|
34
34
|
export {
|
|
35
35
|
radio_button_styles_default
|
|
36
36
|
};
|
|
37
|
-
//# sourceMappingURL=chunk.
|
|
37
|
+
//# sourceMappingURL=chunk.MWDOOCSU.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SynTag
|
|
3
|
-
} from "./chunk.
|
|
3
|
+
} from "./chunk.KZMLTHDT.js";
|
|
4
4
|
|
|
5
5
|
// src/components/tag/tag.ts
|
|
6
6
|
var tag_default = SynTag;
|
|
@@ -9,4 +9,4 @@ SynTag.define("syn-tag");
|
|
|
9
9
|
export {
|
|
10
10
|
tag_default
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=chunk.
|
|
12
|
+
//# sourceMappingURL=chunk.N6E3X3S5.js.map
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./chunk.RSONAU45.js";
|
|
12
12
|
import {
|
|
13
13
|
SynergyElement
|
|
14
|
-
} from "./chunk.
|
|
14
|
+
} from "./chunk.XMUT2KKD.js";
|
|
15
15
|
import {
|
|
16
16
|
__decorateClass
|
|
17
17
|
} from "./chunk.DJOAQ4JU.js";
|
|
@@ -172,4 +172,4 @@ __decorateClass([
|
|
|
172
172
|
export {
|
|
173
173
|
SynIcon
|
|
174
174
|
};
|
|
175
|
-
//# sourceMappingURL=chunk.
|
|
175
|
+
//# sourceMappingURL=chunk.NROSOMZ6.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
radio_button_styles_default
|
|
3
|
-
} from "./chunk.
|
|
3
|
+
} from "./chunk.MWDOOCSU.js";
|
|
4
4
|
import {
|
|
5
5
|
HasSlotController
|
|
6
6
|
} from "./chunk.XGXFE6IF.js";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk.VZ7S7YYN.js";
|
|
10
10
|
import {
|
|
11
11
|
SynergyElement
|
|
12
|
-
} from "./chunk.
|
|
12
|
+
} from "./chunk.XMUT2KKD.js";
|
|
13
13
|
import {
|
|
14
14
|
__decorateClass
|
|
15
15
|
} from "./chunk.DJOAQ4JU.js";
|
|
@@ -124,4 +124,4 @@ __decorateClass([
|
|
|
124
124
|
export {
|
|
125
125
|
SynRadioButton
|
|
126
126
|
};
|
|
127
|
-
//# sourceMappingURL=chunk.
|
|
127
|
+
//# sourceMappingURL=chunk.OINL3N23.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SynIcon
|
|
3
|
-
} from "./chunk.
|
|
3
|
+
} from "./chunk.NROSOMZ6.js";
|
|
4
4
|
|
|
5
5
|
// src/components/icon/icon.ts
|
|
6
6
|
var icon_default = SynIcon;
|
|
@@ -9,4 +9,4 @@ SynIcon.define("syn-icon");
|
|
|
9
9
|
export {
|
|
10
10
|
icon_default
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=chunk.
|
|
12
|
+
//# sourceMappingURL=chunk.PTZNO34T.js.map
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SynSpinner
|
|
3
|
-
} from "./chunk.
|
|
3
|
+
} from "./chunk.JAKBHRC4.js";
|
|
4
4
|
import {
|
|
5
5
|
HasSlotController
|
|
6
6
|
} from "./chunk.XGXFE6IF.js";
|
|
7
7
|
import {
|
|
8
8
|
LocalizeController
|
|
9
|
-
} from "./chunk.
|
|
9
|
+
} from "./chunk.LAB4YJYE.js";
|
|
10
10
|
import {
|
|
11
11
|
FormControlController,
|
|
12
12
|
validValidityState
|
|
13
|
-
} from "./chunk.
|
|
13
|
+
} from "./chunk.AMTCNRDE.js";
|
|
14
14
|
import {
|
|
15
15
|
SynIcon
|
|
16
|
-
} from "./chunk.
|
|
16
|
+
} from "./chunk.NROSOMZ6.js";
|
|
17
17
|
import {
|
|
18
18
|
watch
|
|
19
19
|
} from "./chunk.VZ7S7YYN.js";
|
|
20
|
-
import {
|
|
21
|
-
SynergyElement
|
|
22
|
-
} from "./chunk.V52P6M55.js";
|
|
23
20
|
import {
|
|
24
21
|
button_styles_default
|
|
25
|
-
} from "./chunk.
|
|
22
|
+
} from "./chunk.CQ2JMH2J.js";
|
|
23
|
+
import {
|
|
24
|
+
SynergyElement
|
|
25
|
+
} from "./chunk.XMUT2KKD.js";
|
|
26
26
|
import {
|
|
27
27
|
__decorateClass
|
|
28
28
|
} from "./chunk.DJOAQ4JU.js";
|
|
@@ -36,14 +36,6 @@ var SynButton = class extends SynergyElement {
|
|
|
36
36
|
constructor() {
|
|
37
37
|
super(...arguments);
|
|
38
38
|
this.formControlController = new FormControlController(this, {
|
|
39
|
-
form: (input) => {
|
|
40
|
-
if (input.hasAttribute("form")) {
|
|
41
|
-
const doc = input.getRootNode();
|
|
42
|
-
const formId = input.getAttribute("form");
|
|
43
|
-
return doc.getElementById(formId);
|
|
44
|
-
}
|
|
45
|
-
return input.closest("form");
|
|
46
|
-
},
|
|
47
39
|
assumeInteractionOn: ["click"]
|
|
48
40
|
});
|
|
49
41
|
this.hasSlotController = new HasSlotController(this, "[default]", "prefix", "suffix");
|
|
@@ -277,4 +269,4 @@ __decorateClass([
|
|
|
277
269
|
export {
|
|
278
270
|
SynButton
|
|
279
271
|
};
|
|
280
|
-
//# sourceMappingURL=chunk.
|
|
272
|
+
//# sourceMappingURL=chunk.RGXSZCKM.js.map
|