@synergy-design-system/components 1.0.0-main.3 → 1.0.0-main.4

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 (144) hide show
  1. package/dist/chunks/chunk.2FIY3TX5.js +32 -0
  2. package/dist/chunks/chunk.2FIY3TX5.js.map +7 -0
  3. package/dist/chunks/chunk.5OIEI73E.js +45 -0
  4. package/dist/chunks/chunk.5OIEI73E.js.map +7 -0
  5. package/dist/chunks/chunk.5PZUAKCS.js +202 -0
  6. package/dist/chunks/chunk.5PZUAKCS.js.map +7 -0
  7. package/dist/chunks/chunk.6C4JXZZN.js +15 -0
  8. package/dist/chunks/chunk.6C4JXZZN.js.map +7 -0
  9. package/dist/chunks/chunk.7EGSHKGV.js +12 -0
  10. package/dist/chunks/chunk.7EGSHKGV.js.map +7 -0
  11. package/dist/chunks/chunk.A3SKDWCT.js +42 -0
  12. package/dist/chunks/chunk.A3SKDWCT.js.map +7 -0
  13. package/dist/chunks/chunk.BQPK6UKU.js +498 -0
  14. package/dist/chunks/chunk.BQPK6UKU.js.map +7 -0
  15. package/dist/chunks/chunk.BREU4ILT.js +28 -0
  16. package/dist/chunks/chunk.BREU4ILT.js.map +7 -0
  17. package/dist/chunks/chunk.C7624ITA.js +30 -0
  18. package/dist/chunks/chunk.C7624ITA.js.map +7 -0
  19. package/dist/chunks/chunk.DJOAQ4JU.js +36 -0
  20. package/dist/chunks/chunk.DJOAQ4JU.js.map +7 -0
  21. package/dist/chunks/chunk.DREO4ZTN.js +10 -0
  22. package/dist/chunks/chunk.DREO4ZTN.js.map +7 -0
  23. package/dist/chunks/chunk.EW2JZPYV.js +12 -0
  24. package/dist/chunks/chunk.EW2JZPYV.js.map +7 -0
  25. package/dist/chunks/chunk.FUYWF5Y2.js +278 -0
  26. package/dist/chunks/chunk.FUYWF5Y2.js.map +7 -0
  27. package/dist/chunks/chunk.ILONRPL4.js +10 -0
  28. package/dist/chunks/chunk.ILONRPL4.js.map +7 -0
  29. package/dist/chunks/chunk.N2I6HVX3.js +71 -0
  30. package/dist/chunks/chunk.N2I6HVX3.js.map +7 -0
  31. package/dist/chunks/chunk.O7USYXBT.js +23 -0
  32. package/dist/chunks/chunk.O7USYXBT.js.map +7 -0
  33. package/dist/chunks/chunk.P22LQI5J.js +376 -0
  34. package/dist/chunks/chunk.P22LQI5J.js.map +7 -0
  35. package/dist/chunks/chunk.Q77OTWF2.js +378 -0
  36. package/dist/chunks/chunk.Q77OTWF2.js.map +7 -0
  37. package/dist/chunks/chunk.R6VNLE6N.js +11 -0
  38. package/dist/chunks/chunk.R6VNLE6N.js.map +7 -0
  39. package/dist/chunks/chunk.SLLG4KJR.js +63 -0
  40. package/dist/chunks/chunk.SLLG4KJR.js.map +7 -0
  41. package/dist/chunks/chunk.U7ZJ22QM.js +128 -0
  42. package/dist/chunks/chunk.U7ZJ22QM.js.map +7 -0
  43. package/dist/chunks/chunk.WDCAHRYG.js +273 -0
  44. package/dist/chunks/chunk.WDCAHRYG.js.map +7 -0
  45. package/dist/chunks/chunk.WTCUSH7V.js +42 -0
  46. package/dist/chunks/chunk.WTCUSH7V.js.map +7 -0
  47. package/dist/chunks/chunk.XGXFE6IF.js +49 -0
  48. package/dist/chunks/chunk.XGXFE6IF.js.map +7 -0
  49. package/dist/components/button/button.component.d.ts +123 -0
  50. package/dist/components/button/button.component.js +24 -0
  51. package/dist/components/button/button.component.js.map +7 -0
  52. package/dist/components/button/button.custom.styles.d.ts +2 -0
  53. package/dist/components/button/button.custom.styles.js +8 -0
  54. package/dist/components/button/button.custom.styles.js.map +7 -0
  55. package/dist/components/button/button.d.ts +8 -0
  56. package/dist/components/button/button.js +25 -0
  57. package/dist/components/button/button.js.map +7 -0
  58. package/dist/components/button/button.styles.d.ts +2 -0
  59. package/dist/components/button/button.styles.js +10 -0
  60. package/dist/components/button/button.styles.js.map +7 -0
  61. package/dist/components/checkbox/checkbox.custom.styles.d.ts +2 -0
  62. package/dist/components/checkbox/checkbox.custom.styles.js +11 -0
  63. package/dist/components/checkbox/checkbox.custom.styles.js.map +7 -0
  64. package/dist/components/icon/icon.component.d.ts +42 -0
  65. package/dist/components/icon/icon.component.js +15 -0
  66. package/dist/components/icon/icon.component.js.map +7 -0
  67. package/dist/components/icon/icon.d.ts +8 -0
  68. package/dist/components/icon/icon.js +19 -0
  69. package/dist/components/icon/icon.js.map +7 -0
  70. package/dist/components/icon/icon.styles.d.ts +2 -0
  71. package/dist/components/icon/icon.styles.js +9 -0
  72. package/dist/components/icon/icon.styles.js.map +7 -0
  73. package/dist/components/icon/library.d.ts +19 -0
  74. package/dist/components/icon/library.default.d.ts +3 -0
  75. package/dist/components/icon/library.default.js +9 -0
  76. package/dist/components/icon/library.default.js.map +7 -0
  77. package/dist/components/icon/library.js +19 -0
  78. package/dist/components/icon/library.js.map +7 -0
  79. package/dist/components/icon/library.system.d.ts +3 -0
  80. package/dist/components/icon/library.system.js +8 -0
  81. package/dist/components/icon/library.system.js.map +7 -0
  82. package/dist/components/input/input.component.d.ts +175 -0
  83. package/dist/components/input/input.component.js +22 -0
  84. package/dist/components/input/input.component.js.map +7 -0
  85. package/dist/components/input/input.custom.styles.d.ts +2 -0
  86. package/dist/components/input/input.custom.styles.js +8 -0
  87. package/dist/components/input/input.custom.styles.js.map +7 -0
  88. package/dist/components/input/input.d.ts +8 -0
  89. package/dist/components/input/input.js +23 -0
  90. package/dist/components/input/input.js.map +7 -0
  91. package/dist/components/input/input.styles.d.ts +2 -0
  92. package/dist/components/input/input.styles.js +10 -0
  93. package/dist/components/input/input.styles.js.map +7 -0
  94. package/dist/components/spinner/spinner.component.d.ts +20 -0
  95. package/dist/components/spinner/spinner.component.js +13 -0
  96. package/dist/components/spinner/spinner.component.js.map +7 -0
  97. package/dist/components/spinner/spinner.styles.d.ts +2 -0
  98. package/dist/components/spinner/spinner.styles.js +9 -0
  99. package/dist/components/spinner/spinner.styles.js.map +7 -0
  100. package/dist/components/textarea/textarea.custom.styles.d.ts +2 -0
  101. package/dist/components/textarea/textarea.custom.styles.js +11 -0
  102. package/dist/components/textarea/textarea.custom.styles.js.map +7 -0
  103. package/dist/custom-elements.json +1870 -0
  104. package/dist/events/events.d.ts +8 -0
  105. package/dist/events/syn-blur.d.ts +6 -0
  106. package/dist/events/syn-change.d.ts +6 -0
  107. package/dist/events/syn-clear.d.ts +6 -0
  108. package/dist/events/syn-error.d.ts +8 -0
  109. package/dist/events/syn-focus.d.ts +6 -0
  110. package/dist/events/syn-input.d.ts +6 -0
  111. package/dist/events/syn-invalid.d.ts +6 -0
  112. package/dist/events/syn-load.d.ts +6 -0
  113. package/dist/internal/default-value.d.ts +2 -0
  114. package/dist/internal/form.d.ts +73 -0
  115. package/dist/internal/slot.d.ts +23 -0
  116. package/dist/internal/synergy-element.d.ts +47 -0
  117. package/dist/internal/test/form-control-base-tests.d.ts +7 -0
  118. package/dist/internal/watch.d.ts +26 -0
  119. package/dist/styles/component.styles.d.ts +2 -0
  120. package/dist/styles/form-control.styles.d.ts +2 -0
  121. package/dist/synergy-autoloader.d.ts +4 -0
  122. package/dist/synergy-autoloader.js +41 -0
  123. package/dist/synergy-autoloader.js.map +7 -0
  124. package/dist/synergy.d.ts +4 -0
  125. package/dist/synergy.js +38 -0
  126. package/dist/synergy.js.map +7 -0
  127. package/dist/translations/de.d.ts +3 -0
  128. package/dist/translations/de.js +46 -0
  129. package/dist/translations/de.js.map +7 -0
  130. package/dist/translations/en.d.ts +3 -0
  131. package/dist/translations/en.js +8 -0
  132. package/dist/translations/en.js.map +7 -0
  133. package/dist/utilities/base-path.d.ts +18 -0
  134. package/dist/utilities/base-path.js +10 -0
  135. package/dist/utilities/base-path.js.map +7 -0
  136. package/dist/utilities/form.d.ts +11 -0
  137. package/dist/utilities/form.js +11 -0
  138. package/dist/utilities/form.js.map +7 -0
  139. package/dist/utilities/localize.d.ts +33 -0
  140. package/dist/utilities/localize.js +11 -0
  141. package/dist/utilities/localize.js.map +7 -0
  142. package/dist/vscode.html-custom-data.json +371 -0
  143. package/dist/web-types.json +738 -0
  144. package/package.json +2 -2
@@ -0,0 +1,498 @@
1
+ import {
2
+ input_styles_default
3
+ } from "./chunk.Q77OTWF2.js";
4
+ import {
5
+ HasSlotController
6
+ } from "./chunk.XGXFE6IF.js";
7
+ import {
8
+ LocalizeController
9
+ } from "./chunk.R6VNLE6N.js";
10
+ import {
11
+ FormControlController
12
+ } from "./chunk.WDCAHRYG.js";
13
+ import {
14
+ SynIcon,
15
+ watch
16
+ } from "./chunk.5PZUAKCS.js";
17
+ import {
18
+ SynergyElement
19
+ } from "./chunk.SLLG4KJR.js";
20
+ import {
21
+ __decorateClass
22
+ } from "./chunk.DJOAQ4JU.js";
23
+
24
+ // src/components/input/input.component.ts
25
+ import { classMap } from "lit/directives/class-map.js";
26
+
27
+ // src/internal/default-value.ts
28
+ import { defaultConverter } from "lit";
29
+ var defaultValue = (propertyName = "value") => (proto, key) => {
30
+ const ctor = proto.constructor;
31
+ const attributeChangedCallback = ctor.prototype.attributeChangedCallback;
32
+ ctor.prototype.attributeChangedCallback = function(name, old, value) {
33
+ var _a;
34
+ const options = ctor.getPropertyOptions(propertyName);
35
+ const attributeName = typeof options.attribute === "string" ? options.attribute : propertyName;
36
+ if (name === attributeName) {
37
+ const converter = options.converter || defaultConverter;
38
+ const fromAttribute = typeof converter === "function" ? converter : (_a = converter == null ? void 0 : converter.fromAttribute) != null ? _a : defaultConverter.fromAttribute;
39
+ const newValue = fromAttribute(value, options.type);
40
+ if (this[propertyName] !== newValue) {
41
+ this[key] = newValue;
42
+ }
43
+ }
44
+ attributeChangedCallback.call(this, name, old, value);
45
+ };
46
+ };
47
+
48
+ // src/components/input/input.component.ts
49
+ import { html } from "lit";
50
+ import { ifDefined } from "lit/directives/if-defined.js";
51
+ import { live } from "lit/directives/live.js";
52
+ import { property, query, state } from "lit/decorators.js";
53
+ var SynInput = class extends SynergyElement {
54
+ constructor() {
55
+ super(...arguments);
56
+ this.formControlController = new FormControlController(this, {
57
+ assumeInteractionOn: ["syn-blur", "syn-input"]
58
+ });
59
+ this.hasSlotController = new HasSlotController(this, "help-text", "label", "prefix", "suffix");
60
+ this.localize = new LocalizeController(this);
61
+ this.hasFocus = false;
62
+ this.title = "";
63
+ // make reactive to pass through
64
+ this.__numberInput = Object.assign(document.createElement("input"), { type: "number" });
65
+ this.__dateInput = Object.assign(document.createElement("input"), { type: "date" });
66
+ this.type = "text";
67
+ this.name = "";
68
+ this.value = "";
69
+ this.defaultValue = "";
70
+ this.size = "medium";
71
+ this.label = "";
72
+ this.helpText = "";
73
+ this.clearable = false;
74
+ this.disabled = false;
75
+ this.placeholder = "";
76
+ this.readonly = false;
77
+ this.passwordToggle = false;
78
+ this.passwordVisible = false;
79
+ this.noSpinButtons = false;
80
+ this.form = "";
81
+ this.required = false;
82
+ this.spellcheck = true;
83
+ }
84
+ //
85
+ // NOTE: We use an in-memory input for these getters/setters instead of the one in the template because the properties
86
+ // can be set before the component is rendered.
87
+ //
88
+ /**
89
+ * Gets or sets the current value as a `Date` object. Returns `null` if the value can't be converted. This will use the native `<input type="{{type}}">` implementation and may result in an error.
90
+ */
91
+ get valueAsDate() {
92
+ var _a;
93
+ this.__dateInput.type = this.type;
94
+ this.__dateInput.value = this.value;
95
+ return ((_a = this.input) == null ? void 0 : _a.valueAsDate) || this.__dateInput.valueAsDate;
96
+ }
97
+ set valueAsDate(newValue) {
98
+ this.__dateInput.type = this.type;
99
+ this.__dateInput.valueAsDate = newValue;
100
+ this.value = this.__dateInput.value;
101
+ }
102
+ /** Gets or sets the current value as a number. Returns `NaN` if the value can't be converted. */
103
+ get valueAsNumber() {
104
+ var _a;
105
+ this.__numberInput.value = this.value;
106
+ return ((_a = this.input) == null ? void 0 : _a.valueAsNumber) || this.__numberInput.valueAsNumber;
107
+ }
108
+ set valueAsNumber(newValue) {
109
+ this.__numberInput.valueAsNumber = newValue;
110
+ this.value = this.__numberInput.value;
111
+ }
112
+ /** Gets the validity state object */
113
+ get validity() {
114
+ return this.input.validity;
115
+ }
116
+ /** Gets the validation message */
117
+ get validationMessage() {
118
+ return this.input.validationMessage;
119
+ }
120
+ firstUpdated() {
121
+ this.formControlController.updateValidity();
122
+ }
123
+ handleBlur() {
124
+ this.hasFocus = false;
125
+ this.emit("syn-blur");
126
+ }
127
+ handleChange() {
128
+ this.value = this.input.value;
129
+ this.emit("syn-change");
130
+ }
131
+ handleClearClick(event) {
132
+ this.value = "";
133
+ this.emit("syn-clear");
134
+ this.emit("syn-input");
135
+ this.emit("syn-change");
136
+ this.input.focus();
137
+ event.stopPropagation();
138
+ }
139
+ handleFocus() {
140
+ this.hasFocus = true;
141
+ this.emit("syn-focus");
142
+ }
143
+ handleInput() {
144
+ this.value = this.input.value;
145
+ this.formControlController.updateValidity();
146
+ this.emit("syn-input");
147
+ }
148
+ handleInvalid(event) {
149
+ this.formControlController.setValidity(false);
150
+ this.formControlController.emitInvalidEvent(event);
151
+ }
152
+ handleKeyDown(event) {
153
+ const hasModifier = event.metaKey || event.ctrlKey || event.shiftKey || event.altKey;
154
+ if (event.key === "Enter" && !hasModifier) {
155
+ setTimeout(() => {
156
+ if (!event.defaultPrevented && !event.isComposing) {
157
+ this.formControlController.submit();
158
+ }
159
+ });
160
+ }
161
+ }
162
+ handlePasswordToggle() {
163
+ this.passwordVisible = !this.passwordVisible;
164
+ }
165
+ handleDisabledChange() {
166
+ this.formControlController.setValidity(this.disabled);
167
+ }
168
+ handleStepChange() {
169
+ this.input.step = String(this.step);
170
+ this.formControlController.updateValidity();
171
+ }
172
+ async handleValueChange() {
173
+ await this.updateComplete;
174
+ this.formControlController.updateValidity();
175
+ }
176
+ /** Sets focus on the input. */
177
+ focus(options) {
178
+ this.input.focus(options);
179
+ }
180
+ /** Removes focus from the input. */
181
+ blur() {
182
+ this.input.blur();
183
+ }
184
+ /** Selects all the text in the input. */
185
+ select() {
186
+ this.input.select();
187
+ }
188
+ /** Sets the start and end positions of the text selection (0-based). */
189
+ setSelectionRange(selectionStart, selectionEnd, selectionDirection = "none") {
190
+ this.input.setSelectionRange(selectionStart, selectionEnd, selectionDirection);
191
+ }
192
+ /** Replaces a range of text with a new string. */
193
+ setRangeText(replacement, start, end, selectMode) {
194
+ this.input.setRangeText(replacement, start, end, selectMode);
195
+ if (this.value !== this.input.value) {
196
+ this.value = this.input.value;
197
+ }
198
+ }
199
+ /** Displays the browser picker for an input element (only works if the browser supports it for the input type). */
200
+ showPicker() {
201
+ if ("showPicker" in HTMLInputElement.prototype) {
202
+ this.input.showPicker();
203
+ }
204
+ }
205
+ /** Increments the value of a numeric input type by the value of the step attribute. */
206
+ stepUp() {
207
+ this.input.stepUp();
208
+ if (this.value !== this.input.value) {
209
+ this.value = this.input.value;
210
+ }
211
+ }
212
+ /** Decrements the value of a numeric input type by the value of the step attribute. */
213
+ stepDown() {
214
+ this.input.stepDown();
215
+ if (this.value !== this.input.value) {
216
+ this.value = this.input.value;
217
+ }
218
+ }
219
+ /** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */
220
+ checkValidity() {
221
+ return this.input.checkValidity();
222
+ }
223
+ /** Gets the associated form, if one exists. */
224
+ getForm() {
225
+ return this.formControlController.getForm();
226
+ }
227
+ /** Checks for validity and shows the browser's validation message if the control is invalid. */
228
+ reportValidity() {
229
+ return this.input.reportValidity();
230
+ }
231
+ /** Sets a custom validation message. Pass an empty string to restore validity. */
232
+ setCustomValidity(message) {
233
+ this.input.setCustomValidity(message);
234
+ this.formControlController.updateValidity();
235
+ }
236
+ render() {
237
+ const hasLabelSlot = this.hasSlotController.test("label");
238
+ const hasHelpTextSlot = this.hasSlotController.test("help-text");
239
+ const hasPrefixSlot = this.hasSlotController.test("prefix");
240
+ const hasSuffixSlot = this.hasSlotController.test("suffix");
241
+ const hasLabel = this.label ? true : !!hasLabelSlot;
242
+ const hasHelpText = this.helpText ? true : !!hasHelpTextSlot;
243
+ const hasClearIcon = this.clearable && !this.disabled && !this.readonly;
244
+ const isClearIconVisible = hasClearIcon && (typeof this.value === "number" || this.value.length > 0);
245
+ return html`
246
+ <div
247
+ part="form-control"
248
+ class=${classMap({
249
+ "form-control": true,
250
+ "form-control--small": this.size === "small",
251
+ "form-control--medium": this.size === "medium",
252
+ "form-control--large": this.size === "large",
253
+ "form-control--has-label": hasLabel,
254
+ "form-control--has-help-text": hasHelpText,
255
+ "form-control--has-prefix": hasPrefixSlot,
256
+ "form-control--has-suffix": hasSuffixSlot
257
+ })}
258
+ >
259
+ <label
260
+ part="form-control-label"
261
+ class="form-control__label"
262
+ for="input"
263
+ aria-hidden=${hasLabel ? "false" : "true"}
264
+ >
265
+ <slot name="label">${this.label}</slot>
266
+ </label>
267
+
268
+ <div part="form-control-input" class="form-control-input">
269
+ <div
270
+ part="base"
271
+ class=${classMap({
272
+ input: true,
273
+ // Sizes
274
+ "input--small": this.size === "small",
275
+ "input--medium": this.size === "medium",
276
+ "input--large": this.size === "large",
277
+ // States
278
+ "input--standard": !this.readonly,
279
+ "input--readonly": this.readonly,
280
+ "input--disabled": this.disabled,
281
+ "input--focused": this.hasFocus,
282
+ "input--empty": !this.value,
283
+ "input--no-spin-buttons": this.noSpinButtons
284
+ })}
285
+ >
286
+ <span part="prefix" class="input__prefix">
287
+ <slot name="prefix"></slot>
288
+ </span>
289
+
290
+ <input
291
+ part="input"
292
+ id="input"
293
+ class="input__control"
294
+ type=${this.type === "password" && this.passwordVisible ? "text" : this.type}
295
+ title=${this.title}
296
+ name=${ifDefined(this.name)}
297
+ ?disabled=${this.disabled}
298
+ ?readonly=${this.readonly}
299
+ ?required=${this.required}
300
+ placeholder=${ifDefined(this.placeholder)}
301
+ minlength=${ifDefined(this.minlength)}
302
+ maxlength=${ifDefined(this.maxlength)}
303
+ min=${ifDefined(this.min)}
304
+ max=${ifDefined(this.max)}
305
+ step=${ifDefined(this.step)}
306
+ .value=${live(this.value)}
307
+ autocapitalize=${ifDefined(this.autocapitalize)}
308
+ autocomplete=${ifDefined(this.autocomplete)}
309
+ autocorrect=${ifDefined(this.autocorrect)}
310
+ ?autofocus=${this.autofocus}
311
+ spellcheck=${this.spellcheck}
312
+ pattern=${ifDefined(this.pattern)}
313
+ enterkeyhint=${ifDefined(this.enterkeyhint)}
314
+ inputmode=${ifDefined(this.inputmode)}
315
+ aria-describedby="help-text"
316
+ @change=${this.handleChange}
317
+ @input=${this.handleInput}
318
+ @invalid=${this.handleInvalid}
319
+ @keydown=${this.handleKeyDown}
320
+ @focus=${this.handleFocus}
321
+ @blur=${this.handleBlur}
322
+ />
323
+
324
+ ${hasClearIcon ? html`
325
+ <button
326
+ part="clear-button"
327
+ class=${classMap({
328
+ input__clear: true,
329
+ "input__clear--visible": isClearIconVisible
330
+ })}
331
+ type="button"
332
+ aria-label=${this.localize.term("clearEntry")}
333
+ @click=${this.handleClearClick}
334
+ tabindex="-1"
335
+ >
336
+ <slot name="clear-icon">
337
+ <syn-icon name="x-circle-fill" library="system"></syn-icon>
338
+ </slot>
339
+ </button>
340
+ ` : ""}
341
+ ${this.passwordToggle && !this.disabled ? html`
342
+ <button
343
+ part="password-toggle-button"
344
+ class="input__password-toggle"
345
+ type="button"
346
+ aria-label=${this.localize.term(this.passwordVisible ? "hidePassword" : "showPassword")}
347
+ @click=${this.handlePasswordToggle}
348
+ tabindex="-1"
349
+ >
350
+ ${this.passwordVisible ? html`
351
+ <slot name="show-password-icon">
352
+ <syn-icon name="eye-slash" library="system"></syn-icon>
353
+ </slot>
354
+ ` : html`
355
+ <slot name="hide-password-icon">
356
+ <syn-icon name="eye" library="system"></syn-icon>
357
+ </slot>
358
+ `}
359
+ </button>
360
+ ` : ""}
361
+
362
+ <span part="suffix" class="input__suffix">
363
+ <slot name="suffix"></slot>
364
+ </span>
365
+ </div>
366
+ </div>
367
+
368
+ <div
369
+ part="form-control-help-text"
370
+ id="help-text"
371
+ class="form-control__help-text"
372
+ aria-hidden=${hasHelpText ? "false" : "true"}
373
+ >
374
+ <slot name="help-text">${this.helpText}</slot>
375
+ </div>
376
+ </div>
377
+ `;
378
+ }
379
+ };
380
+ SynInput.styles = input_styles_default;
381
+ SynInput.dependencies = { "syn-icon": SynIcon };
382
+ __decorateClass([
383
+ query(".input__control")
384
+ ], SynInput.prototype, "input", 2);
385
+ __decorateClass([
386
+ state()
387
+ ], SynInput.prototype, "hasFocus", 2);
388
+ __decorateClass([
389
+ property()
390
+ ], SynInput.prototype, "title", 2);
391
+ __decorateClass([
392
+ property({ reflect: true })
393
+ ], SynInput.prototype, "type", 2);
394
+ __decorateClass([
395
+ property()
396
+ ], SynInput.prototype, "name", 2);
397
+ __decorateClass([
398
+ property()
399
+ ], SynInput.prototype, "value", 2);
400
+ __decorateClass([
401
+ defaultValue()
402
+ ], SynInput.prototype, "defaultValue", 2);
403
+ __decorateClass([
404
+ property({ reflect: true })
405
+ ], SynInput.prototype, "size", 2);
406
+ __decorateClass([
407
+ property()
408
+ ], SynInput.prototype, "label", 2);
409
+ __decorateClass([
410
+ property({ attribute: "help-text" })
411
+ ], SynInput.prototype, "helpText", 2);
412
+ __decorateClass([
413
+ property({ type: Boolean })
414
+ ], SynInput.prototype, "clearable", 2);
415
+ __decorateClass([
416
+ property({ type: Boolean, reflect: true })
417
+ ], SynInput.prototype, "disabled", 2);
418
+ __decorateClass([
419
+ property()
420
+ ], SynInput.prototype, "placeholder", 2);
421
+ __decorateClass([
422
+ property({ type: Boolean, reflect: true })
423
+ ], SynInput.prototype, "readonly", 2);
424
+ __decorateClass([
425
+ property({ attribute: "password-toggle", type: Boolean })
426
+ ], SynInput.prototype, "passwordToggle", 2);
427
+ __decorateClass([
428
+ property({ attribute: "password-visible", type: Boolean })
429
+ ], SynInput.prototype, "passwordVisible", 2);
430
+ __decorateClass([
431
+ property({ attribute: "no-spin-buttons", type: Boolean })
432
+ ], SynInput.prototype, "noSpinButtons", 2);
433
+ __decorateClass([
434
+ property({ reflect: true })
435
+ ], SynInput.prototype, "form", 2);
436
+ __decorateClass([
437
+ property({ type: Boolean, reflect: true })
438
+ ], SynInput.prototype, "required", 2);
439
+ __decorateClass([
440
+ property()
441
+ ], SynInput.prototype, "pattern", 2);
442
+ __decorateClass([
443
+ property({ type: Number })
444
+ ], SynInput.prototype, "minlength", 2);
445
+ __decorateClass([
446
+ property({ type: Number })
447
+ ], SynInput.prototype, "maxlength", 2);
448
+ __decorateClass([
449
+ property()
450
+ ], SynInput.prototype, "min", 2);
451
+ __decorateClass([
452
+ property()
453
+ ], SynInput.prototype, "max", 2);
454
+ __decorateClass([
455
+ property()
456
+ ], SynInput.prototype, "step", 2);
457
+ __decorateClass([
458
+ property()
459
+ ], SynInput.prototype, "autocapitalize", 2);
460
+ __decorateClass([
461
+ property()
462
+ ], SynInput.prototype, "autocorrect", 2);
463
+ __decorateClass([
464
+ property()
465
+ ], SynInput.prototype, "autocomplete", 2);
466
+ __decorateClass([
467
+ property({ type: Boolean })
468
+ ], SynInput.prototype, "autofocus", 2);
469
+ __decorateClass([
470
+ property()
471
+ ], SynInput.prototype, "enterkeyhint", 2);
472
+ __decorateClass([
473
+ property({
474
+ type: Boolean,
475
+ converter: {
476
+ // Allow "true|false" attribute values but keep the property boolean
477
+ fromAttribute: (value) => !value || value === "false" ? false : true,
478
+ toAttribute: (value) => value ? "true" : "false"
479
+ }
480
+ })
481
+ ], SynInput.prototype, "spellcheck", 2);
482
+ __decorateClass([
483
+ property()
484
+ ], SynInput.prototype, "inputmode", 2);
485
+ __decorateClass([
486
+ watch("disabled", { waitUntilFirstUpdate: true })
487
+ ], SynInput.prototype, "handleDisabledChange", 1);
488
+ __decorateClass([
489
+ watch("step", { waitUntilFirstUpdate: true })
490
+ ], SynInput.prototype, "handleStepChange", 1);
491
+ __decorateClass([
492
+ watch("value", { waitUntilFirstUpdate: true })
493
+ ], SynInput.prototype, "handleValueChange", 1);
494
+
495
+ export {
496
+ SynInput
497
+ };
498
+ //# sourceMappingURL=chunk.BQPK6UKU.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/components/input/input.component.ts", "../../src/internal/default-value.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 { classMap } from 'lit/directives/class-map.js';\nimport { defaultValue } from '../../internal/default-value.js';\nimport { FormControlController } from '../../internal/form.js';\nimport { HasSlotController } from '../../internal/slot.js';\nimport { html } from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { live } from 'lit/directives/live.js';\nimport { LocalizeController } from '../../utilities/localize.js';\nimport { property, query, state } from 'lit/decorators.js';\nimport { watch } from '../../internal/watch.js';\nimport SynergyElement from '../../internal/synergy-element.js';\nimport SynIcon from '../icon/icon.component.js';\nimport styles from './input.styles.js';\nimport type { CSSResultGroup } from 'lit';\nimport type { SynergyFormControl } from '../../internal/synergy-element.js';\n\n/**\n * @summary Inputs collect data from the user.\n * @documentation https://synergy.style/components/input\n * @status stable\n * @since 2.0\n *\n * @dependency syn-icon\n *\n * @slot label - The input's label. Alternatively, you can use the `label` attribute.\n * @slot prefix - Used to prepend a presentational icon or similar element to the input.\n * @slot suffix - Used to append a presentational icon or similar element to the input.\n * @slot clear-icon - An icon to use in lieu of the default clear icon.\n * @slot show-password-icon - An icon to use in lieu of the default show password icon.\n * @slot hide-password-icon - An icon to use in lieu of the default hide password icon.\n * @slot help-text - Text that describes how to use the input. Alternatively, you can use the `help-text` attribute.\n *\n * @event syn-blur - Emitted when the control loses focus.\n * @event syn-change - Emitted when an alteration to the control's value is committed by the user.\n * @event syn-clear - Emitted when the clear button is activated.\n * @event syn-focus - Emitted when the control gains focus.\n * @event syn-input - Emitted when the control receives input.\n * @event syn-invalid - Emitted when the form control has been checked for validity and its constraints aren't satisfied.\n *\n * @csspart form-control - The form control that wraps the label, input, and help text.\n * @csspart form-control-label - The label's wrapper.\n * @csspart form-control-input - The input's wrapper.\n * @csspart form-control-help-text - The help text's wrapper.\n * @csspart base - The component's base wrapper.\n * @csspart input - The internal `<input>` control.\n * @csspart prefix - The container that wraps the prefix.\n * @csspart clear-button - The clear button.\n * @csspart password-toggle-button - The password toggle button.\n * @csspart suffix - The container that wraps the suffix.\n */\nexport default class SynInput extends SynergyElement implements SynergyFormControl {\n static styles: CSSResultGroup = styles;\n static dependencies = { 'syn-icon': SynIcon };\n\n private readonly formControlController = new FormControlController(this, {\n assumeInteractionOn: ['syn-blur', 'syn-input']\n });\n private readonly hasSlotController = new HasSlotController(this, 'help-text', 'label', 'prefix', 'suffix');\n private readonly localize = new LocalizeController(this);\n\n @query('.input__control') input: HTMLInputElement;\n\n @state() private hasFocus = false;\n @property() title = ''; // make reactive to pass through\n\n private __numberInput = Object.assign(document.createElement('input'), { type: 'number' });\n private __dateInput = Object.assign(document.createElement('input'), { type: 'date' });\n\n /**\n * The type of input. Works the same as a native `<input>` element, but only a subset of types are supported. Defaults\n * to `text`.\n */\n @property({ reflect: true }) type:\n | 'date'\n | 'datetime-local'\n | 'email'\n | 'number'\n | 'password'\n | 'search'\n | 'tel'\n | 'text'\n | 'time'\n | 'url' = 'text';\n\n /** The name of the input, submitted as a name/value pair with form data. */\n @property() name = '';\n\n /** The current value of the input, submitted as a name/value pair with form data. */\n @property() value = '';\n\n /** The default value of the form control. Primarily used for resetting the form control. */\n @defaultValue() defaultValue = '';\n\n /** The input's size. */\n @property({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /** The input's label. If you need to display HTML, use the `label` slot instead. */\n @property() label = '';\n\n /** The input's help text. If you need to display HTML, use the `help-text` slot instead. */\n @property({ attribute: 'help-text' }) helpText = '';\n\n /** Adds a clear button when the input is not empty. */\n @property({ type: Boolean }) clearable = false;\n\n /** Disables the input. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** Placeholder text to show as a hint when the input is empty. */\n @property() placeholder = '';\n\n /** Makes the input readonly. */\n @property({ type: Boolean, reflect: true }) readonly = false;\n\n /** Adds a button to toggle the password's visibility. Only applies to password types. */\n @property({ attribute: 'password-toggle', type: Boolean }) passwordToggle = false;\n\n /** Determines whether or not the password is currently visible. Only applies to password input types. */\n @property({ attribute: 'password-visible', type: Boolean }) passwordVisible = false;\n\n /** Hides the browser's built-in increment/decrement spin buttons for number inputs. */\n @property({ attribute: 'no-spin-buttons', type: Boolean }) noSpinButtons = false;\n\n /**\n * By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you\n * to place the form control outside of a form and associate it with the form that has this `id`. The form must be in\n * the same document or shadow root for this to work.\n */\n @property({ reflect: true }) form = '';\n\n /** Makes the input a required field. */\n @property({ type: Boolean, reflect: true }) required = false;\n\n /** A regular expression pattern to validate input against. */\n @property() pattern: string;\n\n /** The minimum length of input that will be considered valid. */\n @property({ type: Number }) minlength: number;\n\n /** The maximum length of input that will be considered valid. */\n @property({ type: Number }) maxlength: number;\n\n /** The input's minimum value. Only applies to date and number input types. */\n @property() min: number | string;\n\n /** The input's maximum value. Only applies to date and number input types. */\n @property() max: number | string;\n\n /**\n * Specifies the granularity that the value must adhere to, or the special value `any` which means no stepping is\n * implied, allowing any numeric value. Only applies to date and number input types.\n */\n @property() step: number | 'any';\n\n /** Controls whether and how text input is automatically capitalized as it is entered by the user. */\n @property() autocapitalize: 'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters';\n\n /** Indicates whether the browser's autocorrect feature is on or off. */\n @property() autocorrect: 'off' | 'on';\n\n /**\n * Specifies what permission the browser has to provide assistance in filling out form field values. Refer to\n * [this page on MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) for available values.\n */\n @property() autocomplete: string;\n\n /** Indicates that the input should receive focus on page load. */\n @property({ type: Boolean }) autofocus: boolean;\n\n /** Used to customize the label or icon of the Enter key on virtual keyboards. */\n @property() enterkeyhint: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';\n\n /** Enables spell checking on the input. */\n @property({\n type: Boolean,\n converter: {\n // Allow \"true|false\" attribute values but keep the property boolean\n fromAttribute: value => (!value || value === 'false' ? false : true),\n toAttribute: value => (value ? 'true' : 'false')\n }\n })\n spellcheck = true;\n\n /**\n * Tells the browser what type of data will be entered by the user, allowing it to display the appropriate virtual\n * keyboard on supportive devices.\n */\n @property() inputmode: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';\n\n //\n // NOTE: We use an in-memory input for these getters/setters instead of the one in the template because the properties\n // can be set before the component is rendered.\n //\n\n /**\n * Gets or sets the current value as a `Date` object. Returns `null` if the value can't be converted. This will use the native `<input type=\"{{type}}\">` implementation and may result in an error.\n */\n get valueAsDate() {\n this.__dateInput.type = this.type;\n this.__dateInput.value = this.value;\n return this.input?.valueAsDate || this.__dateInput.valueAsDate;\n }\n\n set valueAsDate(newValue: Date | null) {\n this.__dateInput.type = this.type;\n this.__dateInput.valueAsDate = newValue;\n this.value = this.__dateInput.value;\n }\n\n /** Gets or sets the current value as a number. Returns `NaN` if the value can't be converted. */\n get valueAsNumber() {\n this.__numberInput.value = this.value;\n return this.input?.valueAsNumber || this.__numberInput.valueAsNumber;\n }\n\n set valueAsNumber(newValue: number) {\n this.__numberInput.valueAsNumber = newValue;\n this.value = this.__numberInput.value;\n }\n\n /** Gets the validity state object */\n get validity() {\n return this.input.validity;\n }\n\n /** Gets the validation message */\n get validationMessage() {\n return this.input.validationMessage;\n }\n\n firstUpdated() {\n this.formControlController.updateValidity();\n }\n\n private handleBlur() {\n this.hasFocus = false;\n this.emit('syn-blur');\n }\n\n private handleChange() {\n this.value = this.input.value;\n this.emit('syn-change');\n }\n\n private handleClearClick(event: MouseEvent) {\n this.value = '';\n this.emit('syn-clear');\n this.emit('syn-input');\n this.emit('syn-change');\n this.input.focus();\n\n event.stopPropagation();\n }\n\n private handleFocus() {\n this.hasFocus = true;\n this.emit('syn-focus');\n }\n\n private handleInput() {\n this.value = this.input.value;\n this.formControlController.updateValidity();\n this.emit('syn-input');\n }\n\n private handleInvalid(event: Event) {\n this.formControlController.setValidity(false);\n this.formControlController.emitInvalidEvent(event);\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n const hasModifier = event.metaKey || event.ctrlKey || event.shiftKey || event.altKey;\n\n // Pressing enter when focused on an input should submit the form like a native input, but we wait a tick before\n // submitting to allow users to cancel the keydown event if they need to\n if (event.key === 'Enter' && !hasModifier) {\n setTimeout(() => {\n //\n // When using an Input Method Editor (IME), pressing enter will cause the form to submit unexpectedly. One way\n // to check for this is to look at event.isComposing, which will be true when the IME is open.\n //\n // See https://github.com/synergy-design-system/synergy/pull/988\n //\n if (!event.defaultPrevented && !event.isComposing) {\n this.formControlController.submit();\n }\n });\n }\n }\n\n private handlePasswordToggle() {\n this.passwordVisible = !this.passwordVisible;\n }\n\n @watch('disabled', { waitUntilFirstUpdate: true })\n handleDisabledChange() {\n // Disabled form controls are always valid\n this.formControlController.setValidity(this.disabled);\n }\n\n @watch('step', { waitUntilFirstUpdate: true })\n handleStepChange() {\n // If step changes, the value may become invalid so we need to recheck after the update. We set the new step\n // imperatively so we don't have to wait for the next render to report the updated validity.\n this.input.step = String(this.step);\n this.formControlController.updateValidity();\n }\n\n @watch('value', { waitUntilFirstUpdate: true })\n async handleValueChange() {\n await this.updateComplete;\n this.formControlController.updateValidity();\n }\n\n /** Sets focus on the input. */\n focus(options?: FocusOptions) {\n this.input.focus(options);\n }\n\n /** Removes focus from the input. */\n blur() {\n this.input.blur();\n }\n\n /** Selects all the text in the input. */\n select() {\n this.input.select();\n }\n\n /** Sets the start and end positions of the text selection (0-based). */\n setSelectionRange(\n selectionStart: number,\n selectionEnd: number,\n selectionDirection: 'forward' | 'backward' | 'none' = 'none'\n ) {\n this.input.setSelectionRange(selectionStart, selectionEnd, selectionDirection);\n }\n\n /** Replaces a range of text with a new string. */\n setRangeText(\n replacement: string,\n start?: number,\n end?: number,\n selectMode?: 'select' | 'start' | 'end' | 'preserve'\n ) {\n // @ts-expect-error - start, end, and selectMode are optional\n this.input.setRangeText(replacement, start, end, selectMode);\n\n if (this.value !== this.input.value) {\n this.value = this.input.value;\n }\n }\n\n /** Displays the browser picker for an input element (only works if the browser supports it for the input type). */\n showPicker() {\n if ('showPicker' in HTMLInputElement.prototype) {\n this.input.showPicker();\n }\n }\n\n /** Increments the value of a numeric input type by the value of the step attribute. */\n stepUp() {\n this.input.stepUp();\n if (this.value !== this.input.value) {\n this.value = this.input.value;\n }\n }\n\n /** Decrements the value of a numeric input type by the value of the step attribute. */\n stepDown() {\n this.input.stepDown();\n if (this.value !== this.input.value) {\n this.value = this.input.value;\n }\n }\n\n /** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */\n checkValidity() {\n return this.input.checkValidity();\n }\n\n /** Gets the associated form, if one exists. */\n getForm(): HTMLFormElement | null {\n return this.formControlController.getForm();\n }\n\n /** Checks for validity and shows the browser's validation message if the control is invalid. */\n reportValidity() {\n return this.input.reportValidity();\n }\n\n /** Sets a custom validation message. Pass an empty string to restore validity. */\n setCustomValidity(message: string) {\n this.input.setCustomValidity(message);\n this.formControlController.updateValidity();\n }\n\n render() {\n const hasLabelSlot = this.hasSlotController.test('label');\n const hasHelpTextSlot = this.hasSlotController.test('help-text');\n const hasPrefixSlot = this.hasSlotController.test('prefix');\n const hasSuffixSlot = this.hasSlotController.test('suffix');\n const hasLabel = this.label ? true : !!hasLabelSlot;\n const hasHelpText = this.helpText ? true : !!hasHelpTextSlot;\n const hasClearIcon = this.clearable && !this.disabled && !this.readonly;\n const isClearIconVisible = hasClearIcon && (typeof this.value === 'number' || this.value.length > 0);\n\n return html`\n <div\n part=\"form-control\"\n class=${classMap({\n 'form-control': true,\n 'form-control--small': this.size === 'small',\n 'form-control--medium': this.size === 'medium',\n 'form-control--large': this.size === 'large',\n 'form-control--has-label': hasLabel,\n 'form-control--has-help-text': hasHelpText,\n 'form-control--has-prefix': hasPrefixSlot,\n 'form-control--has-suffix': hasSuffixSlot\n })}\n >\n <label\n part=\"form-control-label\"\n class=\"form-control__label\"\n for=\"input\"\n aria-hidden=${hasLabel ? 'false' : 'true'}\n >\n <slot name=\"label\">${this.label}</slot>\n </label>\n\n <div part=\"form-control-input\" class=\"form-control-input\">\n <div\n part=\"base\"\n class=${classMap({\n input: true,\n\n // Sizes\n 'input--small': this.size === 'small',\n 'input--medium': this.size === 'medium',\n 'input--large': this.size === 'large',\n\n // States\n 'input--standard': !this.readonly,\n 'input--readonly': this.readonly,\n 'input--disabled': this.disabled,\n 'input--focused': this.hasFocus,\n 'input--empty': !this.value,\n 'input--no-spin-buttons': this.noSpinButtons\n })}\n >\n <span part=\"prefix\" class=\"input__prefix\">\n <slot name=\"prefix\"></slot>\n </span>\n\n <input\n part=\"input\"\n id=\"input\"\n class=\"input__control\"\n type=${this.type === 'password' && this.passwordVisible ? 'text' : this.type}\n title=${this.title /* An empty title prevents browser validation tooltips from appearing on hover */}\n name=${ifDefined(this.name)}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?required=${this.required}\n placeholder=${ifDefined(this.placeholder)}\n minlength=${ifDefined(this.minlength)}\n maxlength=${ifDefined(this.maxlength)}\n min=${ifDefined(this.min)}\n max=${ifDefined(this.max)}\n step=${ifDefined(this.step as number)}\n .value=${live(this.value)}\n autocapitalize=${ifDefined(this.autocapitalize)}\n autocomplete=${ifDefined(this.autocomplete)}\n autocorrect=${ifDefined(this.autocorrect)}\n ?autofocus=${this.autofocus}\n spellcheck=${this.spellcheck}\n pattern=${ifDefined(this.pattern)}\n enterkeyhint=${ifDefined(this.enterkeyhint)}\n inputmode=${ifDefined(this.inputmode)}\n aria-describedby=\"help-text\"\n @change=${this.handleChange}\n @input=${this.handleInput}\n @invalid=${this.handleInvalid}\n @keydown=${this.handleKeyDown}\n @focus=${this.handleFocus}\n @blur=${this.handleBlur}\n />\n\n ${hasClearIcon\n ? html`\n <button\n part=\"clear-button\"\n class=${classMap({\n input__clear: true,\n 'input__clear--visible': isClearIconVisible\n })}\n type=\"button\"\n aria-label=${this.localize.term('clearEntry')}\n @click=${this.handleClearClick}\n tabindex=\"-1\"\n >\n <slot name=\"clear-icon\">\n <syn-icon name=\"x-circle-fill\" library=\"system\"></syn-icon>\n </slot>\n </button>\n `\n : ''}\n ${this.passwordToggle && !this.disabled\n ? html`\n <button\n part=\"password-toggle-button\"\n class=\"input__password-toggle\"\n type=\"button\"\n aria-label=${this.localize.term(this.passwordVisible ? 'hidePassword' : 'showPassword')}\n @click=${this.handlePasswordToggle}\n tabindex=\"-1\"\n >\n ${this.passwordVisible\n ? html`\n <slot name=\"show-password-icon\">\n <syn-icon name=\"eye-slash\" library=\"system\"></syn-icon>\n </slot>\n `\n : html`\n <slot name=\"hide-password-icon\">\n <syn-icon name=\"eye\" library=\"system\"></syn-icon>\n </slot>\n `}\n </button>\n `\n : ''}\n\n <span part=\"suffix\" class=\"input__suffix\">\n <slot name=\"suffix\"></slot>\n </span>\n </div>\n </div>\n\n <div\n part=\"form-control-help-text\"\n id=\"help-text\"\n class=\"form-control__help-text\"\n aria-hidden=${hasHelpText ? 'false' : 'true'}\n >\n <slot name=\"help-text\">${this.helpText}</slot>\n </div>\n </div>\n `;\n }\n}\n", "// ---------------------------------------------------------------------\n// \uD83D\uDD12 AUTOGENERATED BY VENDORISM\n// Removing this comment will prevent it from being managed by it.\n// ---------------------------------------------------------------------\n\n/* eslint-disable */\n// @defaultValue decorator\n//\n// Runs when the corresponding attribute of the observed property changes, e.g. after calling Element.setAttribute or after updating\n// the observed property.\n//\n// The decorator checks whether the value of the attribute is different from the value of the property and in that case\n// it saves the new value.\n//\n//\n// Usage:\n//\n// @property({ type: Boolean, reflect: true }) checked = false;\n//\n// @defaultValue('checked') defaultChecked = false;\n//\n\nimport { defaultConverter } from 'lit';\nimport type { ReactiveElement } from 'lit';\n\nexport const defaultValue =\n (propertyName = 'value') =>\n (proto: ReactiveElement, key: string) => {\n const ctor = proto.constructor as typeof ReactiveElement;\n\n const attributeChangedCallback = ctor.prototype.attributeChangedCallback;\n ctor.prototype.attributeChangedCallback = function (\n this: ReactiveElement & { [name: string]: unknown },\n name,\n old,\n value\n ) {\n const options = ctor.getPropertyOptions(propertyName);\n const attributeName = typeof options.attribute === 'string' ? options.attribute : propertyName;\n\n if (name === attributeName) {\n const converter = options.converter || defaultConverter;\n const fromAttribute =\n typeof converter === 'function' ? converter : converter?.fromAttribute ?? defaultConverter.fromAttribute;\n\n const newValue: unknown = fromAttribute!(value, options.type);\n\n if (this[propertyName] !== newValue) {\n this[key] = newValue;\n }\n }\n\n attributeChangedCallback.call(this, name, old, value);\n };\n };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAMA,SAAS,gBAAgB;;;ACgBzB,SAAS,wBAAwB;AAG1B,IAAM,eACX,CAAC,eAAe,YAChB,CAAC,OAAwB,QAAgB;AACvC,QAAM,OAAO,MAAM;AAEnB,QAAM,2BAA2B,KAAK,UAAU;AAChD,OAAK,UAAU,2BAA2B,SAExC,MACA,KACA,OACA;AApCN;AAqCM,UAAM,UAAU,KAAK,mBAAmB,YAAY;AACpD,UAAM,gBAAgB,OAAO,QAAQ,cAAc,WAAW,QAAQ,YAAY;AAElF,QAAI,SAAS,eAAe;AAC1B,YAAM,YAAY,QAAQ,aAAa;AACvC,YAAM,gBACJ,OAAO,cAAc,aAAa,aAAY,4CAAW,kBAAX,YAA4B,iBAAiB;AAE7F,YAAM,WAAoB,cAAe,OAAO,QAAQ,IAAI;AAE5D,UAAI,KAAK,YAAY,MAAM,UAAU;AACnC,aAAK,GAAG,IAAI;AAAA,MACd;AAAA,IACF;AAEA,6BAAyB,KAAK,MAAM,MAAM,KAAK,KAAK;AAAA,EACtD;AACF;;;AD5CF,SAAS,YAAY;AACrB,SAAS,iBAAiB;AAC1B,SAAS,YAAY;AAErB,SAAS,UAAU,OAAO,aAAa;AA0CvC,IAAqB,WAArB,cAAsC,eAA6C;AAAA,EAAnF;AAAA;AAIE,SAAiB,wBAAwB,IAAI,sBAAsB,MAAM;AAAA,MACvE,qBAAqB,CAAC,YAAY,WAAW;AAAA,IAC/C,CAAC;AACD,SAAiB,oBAAoB,IAA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A,EACF,CAAC;AAAA,GAlIkB,SAmInB;AAMY;AAAA,EAAX,SAAS;AAAA,GAzIS,SAyIP;AA4GZ;AAAA,EADC,MAAM,YAAY,EAAE,sBAAsB,KAAK,CAAC;AAAA,GApP9B,SAqPnB;AAMA;AAAA,EADC,MAAM,QAAQ,EAAE,sBAAsB,KAAK,CAAC;AAAA,GA1P1B,SA2PnB;AAQM;AAAA,EADL,MAAM,SAAS,EAAE,sBAAsB,KAAK,CAAC;AAAA,GAlQ3B,SAmQb;",
6
+ "names": []
7
+ }
@@ -0,0 +1,28 @@
1
+ import {
2
+ component_styles_default
3
+ } from "./chunk.O7USYXBT.js";
4
+
5
+ // src/components/icon/icon.styles.ts
6
+ import { css } from "lit";
7
+ var icon_styles_default = css`
8
+ /* stylelint-disable */
9
+ ${component_styles_default}
10
+
11
+ :host {
12
+ display: inline-block;
13
+ width: 1em;
14
+ height: 1em;
15
+ box-sizing: content-box !important;
16
+ }
17
+
18
+ svg {
19
+ display: block;
20
+ height: 100%;
21
+ width: 100%;
22
+ }
23
+ `;
24
+
25
+ export {
26
+ icon_styles_default
27
+ };
28
+ //# sourceMappingURL=chunk.BREU4ILT.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/components/icon/icon.styles.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 { css } from 'lit';\nimport componentStyles from '../../styles/component.styles.js';\n\nexport default css`\n\t/* stylelint-disable */\n ${componentStyles}\n\n :host {\n display: inline-block;\n width: 1em;\n height: 1em;\n box-sizing: content-box !important;\n }\n\n svg {\n display: block;\n height: 100%;\n width: 100%;\n }\n`;\n"],
5
+ "mappings": ";;;;;AAMA,SAAS,WAAW;AAGpB,IAAO,sBAAQ;AAAA;AAAA,IAEX,wBAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,30 @@
1
+ // src/utilities/base-path.ts
2
+ var basePath = "";
3
+ function setBasePath(path) {
4
+ basePath = path;
5
+ }
6
+ function getBasePath(subpath = "") {
7
+ if (!basePath) {
8
+ const scripts = [...document.getElementsByTagName("script")];
9
+ const configScript = scripts.find((script) => script.hasAttribute("data-synergy"));
10
+ if (configScript) {
11
+ setBasePath(configScript.getAttribute("data-synergy"));
12
+ } else {
13
+ const fallbackScript = scripts.find((s) => {
14
+ return /synergy(\.min)?\.js($|\?)/.test(s.src) || /synergy-autoloader(\.min)?\.js($|\?)/.test(s.src);
15
+ });
16
+ let path = "";
17
+ if (fallbackScript) {
18
+ path = fallbackScript.getAttribute("src");
19
+ }
20
+ setBasePath(path.split("/").slice(0, -1).join("/"));
21
+ }
22
+ }
23
+ return basePath.replace(/\/$/, "") + (subpath ? `/${subpath.replace(/^\//, "")}` : ``);
24
+ }
25
+
26
+ export {
27
+ setBasePath,
28
+ getBasePath
29
+ };
30
+ //# sourceMappingURL=chunk.C7624ITA.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/utilities/base-path.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 */\nlet basePath = '';\n\n/** Sets the library's base path to the specified directory. */\nexport function setBasePath(path: string) {\n basePath = path;\n}\n\n/**\n * Gets the library's base path.\n *\n * The base path is used to load assets such as icons and images, so it needs to be set for components to work properly.\n * By default, this script will look for a script ending in synergy.js or synergy-autoloader.js and set the base path\n * to the directory that contains that file. To override this behavior, you can add the data-synergy attribute to any\n * script on the page (it probably makes the most sense to attach it to the Synergy script, but it could also be on a\n * bundle). The value can be a local folder or it can point to a CORS-enabled endpoint such as a CDN.\n *\n * <script src=\"bundle.js\" data-synergy=\"/custom/base/path\"></script>\n *\n * Alternatively, you can set the base path manually using the exported setBasePath() function.\n *\n * @param subpath - An optional path to append to the base path.\n */\nexport function getBasePath(subpath = '') {\n if (!basePath) {\n const scripts = [...document.getElementsByTagName('script')] as HTMLScriptElement[];\n const configScript = scripts.find(script => script.hasAttribute('data-synergy'));\n\n if (configScript) {\n // Use the data-synergy attribute\n setBasePath(configScript.getAttribute('data-synergy')!);\n } else {\n const fallbackScript = scripts.find(s => {\n return /synergy(\\.min)?\\.js($|\\?)/.test(s.src) || /synergy-autoloader(\\.min)?\\.js($|\\?)/.test(s.src);\n });\n let path = '';\n\n if (fallbackScript) {\n path = fallbackScript.getAttribute('src')!;\n }\n\n setBasePath(path.split('/').slice(0, -1).join('/'));\n }\n }\n\n // Return the base path without a trailing slash. If one exists, append the subpath separated by a slash.\n return basePath.replace(/\\/$/, '') + (subpath ? `/${subpath.replace(/^\\//, '')}` : ``);\n}\n"],
5
+ "mappings": ";AAMA,IAAI,WAAW;AAGR,SAAS,YAAY,MAAc;AACxC,aAAW;AACb;AAiBO,SAAS,YAAY,UAAU,IAAI;AACxC,MAAI,CAAC,UAAU;AACb,UAAM,UAAU,CAAC,GAAG,SAAS,qBAAqB,QAAQ,CAAC;AAC3D,UAAM,eAAe,QAAQ,KAAK,YAAU,OAAO,aAAa,cAAc,CAAC;AAE/E,QAAI,cAAc;AAEhB,kBAAY,aAAa,aAAa,cAAc,CAAE;AAAA,IACxD,OAAO;AACL,YAAM,iBAAiB,QAAQ,KAAK,OAAK;AACvC,eAAO,4BAA4B,KAAK,EAAE,GAAG,KAAK,uCAAuC,KAAK,EAAE,GAAG;AAAA,MACrG,CAAC;AACD,UAAI,OAAO;AAEX,UAAI,gBAAgB;AAClB,eAAO,eAAe,aAAa,KAAK;AAAA,MAC1C;AAEA,kBAAY,KAAK,MAAM,GAAG,EAAE,MAAM,GAAG,EAAE,EAAE,KAAK,GAAG,CAAC;AAAA,IACpD;AAAA,EACF;AAGA,SAAO,SAAS,QAAQ,OAAO,EAAE,KAAK,UAAU,IAAI,QAAQ,QAAQ,OAAO,EAAE,CAAC,KAAK;AACrF;",
6
+ "names": []
7
+ }