@italia/globals 0.1.0-alpha.1 → 1.0.0-alpha.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 (58) hide show
  1. package/custom-elements.json +1655 -168
  2. package/dist/src/base-component/base-component.d.ts +28 -13
  3. package/dist/src/base-component/base-component.d.ts.map +1 -1
  4. package/dist/src/base-component/base-component.js +27 -17
  5. package/dist/src/base-component/base-component.js.map +1 -1
  6. package/dist/src/controllers/aria-keyboard-accordion-controller.d.ts +15 -0
  7. package/dist/src/controllers/aria-keyboard-accordion-controller.d.ts.map +1 -0
  8. package/dist/src/controllers/aria-keyboard-accordion-controller.js +52 -0
  9. package/dist/src/controllers/aria-keyboard-accordion-controller.js.map +1 -0
  10. package/dist/src/controllers/aria-keyboard-list-controller.d.ts +18 -0
  11. package/dist/src/controllers/aria-keyboard-list-controller.d.ts.map +1 -0
  12. package/dist/src/controllers/aria-keyboard-list-controller.js +58 -0
  13. package/dist/src/controllers/aria-keyboard-list-controller.js.map +1 -0
  14. package/dist/src/controllers/collapse-controller.d.ts +12 -0
  15. package/dist/src/controllers/collapse-controller.d.ts.map +1 -0
  16. package/dist/src/controllers/collapse-controller.js +95 -0
  17. package/dist/src/controllers/collapse-controller.js.map +1 -0
  18. package/dist/src/controllers/roving-tabindex-controller.d.ts +85 -0
  19. package/dist/src/controllers/roving-tabindex-controller.d.ts.map +1 -0
  20. package/dist/src/controllers/roving-tabindex-controller.js +200 -0
  21. package/dist/src/controllers/roving-tabindex-controller.js.map +1 -0
  22. package/dist/src/form/form-control.d.ts +61 -0
  23. package/dist/src/form/form-control.d.ts.map +1 -0
  24. package/dist/src/form/form-control.js +259 -0
  25. package/dist/src/form/form-control.js.map +1 -0
  26. package/dist/src/form/form-controller.d.ts +68 -0
  27. package/dist/src/form/form-controller.d.ts.map +1 -0
  28. package/dist/src/form/form-controller.js +398 -0
  29. package/dist/src/form/form-controller.js.map +1 -0
  30. package/dist/src/form/locales/it.d.ts +4 -0
  31. package/dist/src/form/locales/it.d.ts.map +1 -0
  32. package/dist/src/form/locales/it.js +12 -0
  33. package/dist/src/form/locales/it.js.map +1 -0
  34. package/dist/src/index.d.ts +20 -4
  35. package/dist/src/index.d.ts.map +1 -1
  36. package/dist/src/index.js +18 -4
  37. package/dist/src/index.js.map +1 -1
  38. package/dist/src/mixins/validity.d.ts +19 -19
  39. package/dist/src/mixins/validity.d.ts.map +1 -1
  40. package/dist/src/mixins/validity.js +6 -68
  41. package/dist/src/mixins/validity.js.map +1 -1
  42. package/dist/src/stories/formControlReusableStories.d.ts +19 -0
  43. package/dist/src/stories/formControlReusableStories.d.ts.map +1 -0
  44. package/dist/src/stories/formControlReusableStories.js +64 -0
  45. package/dist/src/stories/formControlReusableStories.js.map +1 -0
  46. package/dist/src/stories/reusableUsageGuidelinesStories.d.ts +13 -0
  47. package/dist/src/stories/reusableUsageGuidelinesStories.d.ts.map +1 -0
  48. package/dist/src/stories/reusableUsageGuidelinesStories.js +39 -0
  49. package/dist/src/stories/reusableUsageGuidelinesStories.js.map +1 -0
  50. package/dist/src/window-manager.d.ts +20 -0
  51. package/dist/src/window-manager.d.ts.map +1 -0
  52. package/dist/src/window-manager.js +47 -0
  53. package/dist/src/window-manager.js.map +1 -0
  54. package/package.json +10 -8
  55. package/dist/src/mixins/form.d.ts +0 -363
  56. package/dist/src/mixins/form.d.ts.map +0 -1
  57. package/dist/src/mixins/form.js +0 -36
  58. package/dist/src/mixins/form.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-controller.d.ts","sourceRoot":"","sources":["../../../src/form/form-controller.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,KAAK,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAOhD,eAAO,MAAM,eAAe,EAAE,OAAO,CAAC,eAAe,EAAE,GAAG,CAAC,WAAW,CAAC,CAAiB,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BAAkB,CA6BxB;IAGF,OAAO,CAAC,iBAAiB;IAUzB,OAAO,CAAC,QAAQ;IA8BhB,8DAA8D;IAC9D,OAAO;IAIP,wEAAwE;IACxE,KAAK,CAAC,SAAS,CAAC,EAAE,gBAAgB,GAAG,GAAG;IAIxC,uEAAuE;IACvE,MAAM,CAAC,SAAS,CAAC,EAAE,gBAAgB,GAAG,GAAG;IAMzC;;;OAGG;IACH,WAAW,CAAC,OAAO,EAAE,OAAO;IAmB5B,cAAc;IAMd;;;OAGG;IACH,cAAc;IAKd;;;;;;OAMG;IACH,gBAAgB,CAAC,oBAAoB,CAAC,EAAE,KAAK;CAgB9C"}
@@ -0,0 +1,398 @@
1
+ //
2
+ // We store a WeakMap of forms + controls so we can keep references to all FormControl within a given form. As
3
+ // elements connect and disconnect to/from the DOM, their containing form is used as the key and the form control is
4
+ // added and removed from the form's set, respectively.
5
+ //
6
+ export const formCollections = new WeakMap();
7
+ //
8
+ // We store a WeakMap of reportValidity() overloads so we can override it when form controls connect to the DOM and
9
+ // restore the original behavior when they disconnect.
10
+ //
11
+ const reportValidityOverloads = new WeakMap();
12
+ const checkValidityOverloads = new WeakMap();
13
+ //
14
+ // We store a Set of controls that users have interacted with. This allows us to determine the interaction state
15
+ // without littering the DOM with additional data attributes.
16
+ //
17
+ const userInteractedControls = new WeakSet();
18
+ //
19
+ // We store a WeakMap of interactions for each form control so we can track when all conditions are met for validation.
20
+ //
21
+ const interactions = new WeakMap();
22
+ /** A reactive controller to allow form controls to participate in form submission, validation, etc. */
23
+ export class FormControlController {
24
+ constructor(host, options) {
25
+ this.submittedOnce = false;
26
+ this.handleFormData = (event) => {
27
+ // console.log('handleFormData');
28
+ const disabled = this.options.disabled(this.host);
29
+ const name = this.options.name(this.host);
30
+ const value = this.options.value(this.host);
31
+ const tagName = this.host.tagName.toLowerCase();
32
+ // For buttons, we only submit the value if they were the submitter. This is currently done in doAction() by
33
+ // injecting the name/value on a temporary button, so we can just skip them here.
34
+ const isButton = tagName === 'it-button';
35
+ if (this.host.isConnected &&
36
+ !disabled &&
37
+ !isButton &&
38
+ typeof name === 'string' &&
39
+ name.length > 0 &&
40
+ typeof value !== 'undefined') {
41
+ switch (tagName) {
42
+ case 'it-radio':
43
+ if (this.host.checked) {
44
+ event.formData.append(name, value);
45
+ }
46
+ break;
47
+ case 'it-checkbox':
48
+ if (this.host.checked) {
49
+ if (event.formData.getAll(name).indexOf(value) < 0) {
50
+ // handle group checkbox
51
+ event.formData.append(name, value);
52
+ }
53
+ }
54
+ break;
55
+ case 'it-checkbox-group':
56
+ // non settare valori in formData, perchè ogni singola checkbox setta il suo valore
57
+ break;
58
+ default:
59
+ if (Array.isArray(value)) {
60
+ value.forEach((val) => {
61
+ event.formData.append(name, val.toString());
62
+ });
63
+ }
64
+ else {
65
+ event.formData.append(name, value.toString());
66
+ }
67
+ }
68
+ }
69
+ };
70
+ this.handleFormSubmit = (event) => {
71
+ const disabled = this.options.disabled(this.host);
72
+ const reportValidity = this.options.reportValidity;
73
+ // Update the interacted state for all controls when the form is submitted
74
+ if (this.form && !this.form.noValidate) {
75
+ formCollections.get(this.form)?.forEach((control) => {
76
+ this.setUserInteracted(control, true);
77
+ });
78
+ }
79
+ const resReportValidity = reportValidity(this.host);
80
+ if (this.form && !this.form.noValidate && !disabled && !resReportValidity) {
81
+ event.preventDefault();
82
+ // event.stopImmediatePropagation(); // se lo attiviamo, valida un campo alla volta
83
+ // Scroll al primo controllo non valido
84
+ const formControls = formCollections.get(this.form);
85
+ if (formControls) {
86
+ for (const control of formControls) {
87
+ if (!control.validity?.valid) {
88
+ // Scroll smooth verso il controllo non valido
89
+ control.scrollIntoView({
90
+ behavior: 'smooth',
91
+ block: 'center',
92
+ });
93
+ break;
94
+ }
95
+ }
96
+ }
97
+ }
98
+ this.submittedOnce = true;
99
+ };
100
+ this.handleFormReset = () => {
101
+ this.options.setValue(this.host, '');
102
+ this.submittedOnce = false;
103
+ this.setUserInteracted(this.host, false);
104
+ interactions.set(this.host, []);
105
+ };
106
+ this.handleInteraction = (event) => {
107
+ const emittedEvents = interactions.get(this.host);
108
+ if (!emittedEvents.includes(event.type)) {
109
+ emittedEvents.push(event.type);
110
+ }
111
+ // Mark it as user-interacted as soon as all associated events have been emitted
112
+ if (emittedEvents.length === this.options.assumeInteractionOn.length) {
113
+ this.setUserInteracted(this.host, true);
114
+ }
115
+ };
116
+ this.checkFormValidity = () => {
117
+ // console.log('checkFormValidity');
118
+ //
119
+ // This is very similar to the `reportFormValidity` function, but it does not trigger native constraint validation
120
+ // Allow the user to simply check if the form is valid and handling validity in their own way.
121
+ //
122
+ // We preserve the original method in a WeakMap, but we don't call it from the overload because that would trigger
123
+ // validations in an unexpected order. When the element disconnects, we revert to the original behavior. This won't
124
+ // be necessary once we can use ElementInternals.
125
+ //
126
+ // Note that we're also honoring the form's novalidate attribute.
127
+ //
128
+ if (this.form && !this.form.noValidate) {
129
+ // This seems sloppy, but checking all elements will cover native inputs, Shoelace inputs, and other custom
130
+ // elements that support the constraint validation API.
131
+ const elements = this.form.querySelectorAll('*');
132
+ for (const element of elements) {
133
+ if (typeof element.checkValidity === 'function') {
134
+ if (!element.checkValidity()) {
135
+ return false;
136
+ }
137
+ }
138
+ }
139
+ }
140
+ return true;
141
+ };
142
+ this.reportFormValidity = () => {
143
+ // console.log('reportFormValidity');
144
+ //
145
+ // FormControl work hard to act like regular form controls. They support the Constraint Validation API
146
+ // and its associated methods such as setCustomValidity() and reportValidity(). However, the HTMLFormElement also
147
+ // has a reportValidity() method that will trigger validation on all child controls. Since we're not yet using
148
+ // ElementInternals, we need to overload this method so it looks for any element with the reportValidity() method.
149
+ //
150
+ // We preserve the original method in a WeakMap, but we don't call it from the overload because that would trigger
151
+ // validations in an unexpected order. When the element disconnects, we revert to the original behavior. This won't
152
+ // be necessary once we can use ElementInternals.
153
+ //
154
+ // Note that we're also honoring the form's novalidate attribute.
155
+ //
156
+ if (this.form && !this.form.noValidate) {
157
+ // This seems sloppy, but checking all elements will cover native inputs, Shoelace inputs, and other custom
158
+ // elements that support the constraint validation API.
159
+ const elements = this.form.querySelectorAll('*');
160
+ for (const element of elements) {
161
+ if (typeof element.reportValidity === 'function') {
162
+ if (!element.reportValidity()) {
163
+ return false;
164
+ }
165
+ }
166
+ }
167
+ }
168
+ return true;
169
+ };
170
+ (this.host = host).addController(this);
171
+ this.options = {
172
+ form: (input) => {
173
+ // If there's a form attribute, use it to find the target form by id
174
+ // Controls may not always reflect the 'form' property. For example, `<it-button>` doesn't reflect.
175
+ const formId = input.form;
176
+ if (formId) {
177
+ const root = input.getRootNode();
178
+ const form = root.querySelector(`#${formId}`);
179
+ if (form) {
180
+ return form;
181
+ }
182
+ }
183
+ return input.closest('form');
184
+ },
185
+ name: (input) => input.name,
186
+ value: (input) => input.value,
187
+ disabled: (input) => input.disabled ?? false,
188
+ reportValidity: (input) => typeof input.reportValidity === 'function' ? input.reportValidity() : true,
189
+ checkValidity: (input) => (typeof input.checkValidity === 'function' ? input.checkValidity() : true),
190
+ setValue: (input, value) => {
191
+ // eslint-disable-next-line no-param-reassign
192
+ input.value = value;
193
+ },
194
+ assumeInteractionOn: ['it-input'],
195
+ ...options,
196
+ };
197
+ }
198
+ hostConnected() {
199
+ const form = this.options.form(this.host);
200
+ if (form) {
201
+ this.attachForm(form);
202
+ }
203
+ // Listen for interactions
204
+ interactions.set(this.host, []);
205
+ this.options.assumeInteractionOn.forEach((event) => {
206
+ this.host.addEventListener(event, this.handleInteraction);
207
+ });
208
+ }
209
+ hostDisconnected() {
210
+ this.detachForm();
211
+ // Clean up interactions
212
+ interactions.delete(this.host);
213
+ this.options.assumeInteractionOn.forEach((event) => {
214
+ this.host.removeEventListener(event, this.handleInteraction);
215
+ });
216
+ }
217
+ hostUpdated() {
218
+ const form = this.options.form(this.host);
219
+ // Detach if the form no longer exists
220
+ if (!form) {
221
+ this.detachForm();
222
+ }
223
+ // If the form has changed, reattach it
224
+ if (form && this.form !== form) {
225
+ this.detachForm();
226
+ this.attachForm(form);
227
+ }
228
+ if (this.host.hasUpdated) {
229
+ this.setValidity(this.host.validity.valid);
230
+ }
231
+ }
232
+ attachForm(form) {
233
+ if (form) {
234
+ this.form = form;
235
+ // Add this element to the form's collection
236
+ if (formCollections.has(this.form)) {
237
+ formCollections.get(this.form).add(this.host);
238
+ }
239
+ else {
240
+ formCollections.set(this.form, new Set([this.host]));
241
+ }
242
+ this.form.addEventListener('formdata', this.handleFormData);
243
+ this.form.addEventListener('submit', this.handleFormSubmit);
244
+ this.form.addEventListener('reset', this.handleFormReset);
245
+ // Overload the form's reportValidity() method so it looks at FormControl
246
+ if (!reportValidityOverloads.has(this.form)) {
247
+ reportValidityOverloads.set(this.form, this.form.reportValidity);
248
+ this.form.reportValidity = () => this.reportFormValidity();
249
+ }
250
+ // Overload the form's checkValidity() method so it looks at FormControl
251
+ if (!checkValidityOverloads.has(this.form)) {
252
+ checkValidityOverloads.set(this.form, this.form.checkValidity);
253
+ this.form.checkValidity = () => this.checkFormValidity();
254
+ }
255
+ }
256
+ else {
257
+ this.form = undefined;
258
+ }
259
+ }
260
+ detachForm() {
261
+ if (!this.form)
262
+ return;
263
+ const formCollection = formCollections.get(this.form);
264
+ if (!formCollection) {
265
+ return;
266
+ }
267
+ this.submittedOnce = false;
268
+ // Remove this host from the form's collection
269
+ formCollection.delete(this.host);
270
+ // Check to make sure there's no other form controls in the collection. If we do this
271
+ // without checking if any other controls are still in the collection, then we will wipe out the
272
+ // validity checks for all other elements.
273
+ // see: https://github.com/shoelace-style/shoelace/issues/1703
274
+ if (formCollection.size <= 0) {
275
+ this.form.removeEventListener('formdata', this.handleFormData);
276
+ this.form.removeEventListener('submit', this.handleFormSubmit);
277
+ this.form.removeEventListener('reset', this.handleFormReset);
278
+ // Remove the overload and restore the original method
279
+ if (reportValidityOverloads.has(this.form)) {
280
+ this.form.reportValidity = reportValidityOverloads.get(this.form);
281
+ reportValidityOverloads.delete(this.form);
282
+ }
283
+ if (checkValidityOverloads.has(this.form)) {
284
+ this.form.checkValidity = checkValidityOverloads.get(this.form);
285
+ checkValidityOverloads.delete(this.form);
286
+ }
287
+ // So it looks weird here to not always set the form to undefined. But I _think_ if we unattach this.form here,
288
+ // we end up in this fun spot where future validity checks don't have a reference to the form validity handler.
289
+ // 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.
290
+ this.form = undefined;
291
+ }
292
+ }
293
+ // eslint-disable-next-line class-methods-use-this
294
+ setUserInteracted(el, hasInteracted) {
295
+ if (hasInteracted) {
296
+ userInteractedControls.add(el);
297
+ }
298
+ else {
299
+ userInteractedControls.delete(el);
300
+ }
301
+ el.requestUpdate();
302
+ }
303
+ doAction(type, submitter) {
304
+ // console.log('doaction', type);
305
+ if (this.form) {
306
+ const button = document.createElement('button');
307
+ button.type = type;
308
+ button.style.position = 'absolute';
309
+ button.style.width = '0';
310
+ button.style.height = '0';
311
+ button.style.clipPath = 'inset(50%)';
312
+ button.style.overflow = 'hidden';
313
+ button.style.whiteSpace = 'nowrap';
314
+ // Pass name, value, and form attributes through to the temporary button
315
+ if (submitter) {
316
+ button.name = submitter.name;
317
+ button.value = submitter.value;
318
+ ['formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formtarget'].forEach((attr) => {
319
+ if (submitter.hasAttribute(attr)) {
320
+ button.setAttribute(attr, submitter.getAttribute(attr));
321
+ }
322
+ });
323
+ }
324
+ this.form.append(button);
325
+ button.click();
326
+ button.remove();
327
+ }
328
+ }
329
+ /** Returns the associated `<form>` element, if one exists. */
330
+ getForm() {
331
+ return this.form ?? null;
332
+ }
333
+ /** Resets the form, restoring all the control to their default value */
334
+ reset(submitter) {
335
+ this.doAction('reset', submitter);
336
+ }
337
+ /** Submits the form, triggering validation and form data injection. */
338
+ submit(submitter) {
339
+ // Calling form.submit() bypasses the submit event and constraint validation. To prevent this, we can inject a
340
+ // native submit button into the form, "click" it, then remove it to simulate a standard form submission.
341
+ this.doAction('submit', submitter);
342
+ }
343
+ /**
344
+ * Synchronously sets the form control's validity. Call this when you know the future validity but need to update
345
+ * the host element immediately, i.e. before Lit updates the component in the next update.
346
+ */
347
+ setValidity(isValid) {
348
+ const host = this.host;
349
+ const hasInteracted = Boolean(userInteractedControls.has(host));
350
+ const required = Boolean(host.required);
351
+ //
352
+ // We're mapping the following "states" to data attributes. In the future, we can use ElementInternals.states to
353
+ // create a similar mapping, but instead of [data-invalid] it will look like :--invalid.
354
+ //
355
+ // See this RFC for more details: https://github.com/shoelace-style/shoelace/issues/1011
356
+ //
357
+ host.toggleAttribute('data-required', required);
358
+ host.toggleAttribute('data-optional', !required);
359
+ host.toggleAttribute('data-invalid', !isValid);
360
+ host.toggleAttribute('data-valid', isValid);
361
+ host.toggleAttribute('data-user-invalid', !isValid && hasInteracted);
362
+ host.toggleAttribute('data-user-valid', isValid && hasInteracted);
363
+ }
364
+ userInteracted() {
365
+ const hasInteracted = Boolean(userInteractedControls.has(this.host));
366
+ return hasInteracted;
367
+ }
368
+ /**
369
+ * Updates the form control's validity based on the current value of `host.validity.valid`. Call this when anything
370
+ * that affects constraint validation changes so the component receives the correct validity states.
371
+ */
372
+ updateValidity() {
373
+ const host = this.host;
374
+ this.setValidity(host.validity.valid);
375
+ }
376
+ /**
377
+ * Dispatches a non-bubbling, cancelable custom event of type `it-invalid`.
378
+ * If the `it-invalid` event will be cancelled then the original `invalid`
379
+ * event (which may have been passed as argument) will also be cancelled.
380
+ * If no original `invalid` event has been passed then the `it-invalid`
381
+ * event will be cancelled before being dispatched.
382
+ */
383
+ emitInvalidEvent(originalInvalidEvent) {
384
+ const itInvalidEvent = new CustomEvent('it-invalid', {
385
+ bubbles: false,
386
+ composed: false,
387
+ cancelable: true,
388
+ detail: {},
389
+ });
390
+ if (!originalInvalidEvent) {
391
+ itInvalidEvent.preventDefault();
392
+ }
393
+ if (!this.host.dispatchEvent(itInvalidEvent)) {
394
+ originalInvalidEvent?.preventDefault();
395
+ }
396
+ }
397
+ }
398
+ //# sourceMappingURL=form-controller.js.map
@@ -0,0 +1 @@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rE,IAAI,CAAC,eAAe,CAAC,iBAAiB,EAAE,OAAO,IAAI,aAAa,CAAC,CAAC;IACpE,CAAC;IAED,cAAc;QACZ,MAAM,aAAa,GAAG,OAAO,CAAC,sBAAsB,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAErE,OAAO,aAAa,CAAC;IACvB,CAAC;IAED;;;OAGG;IACH,cAAc;QACZ,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACvB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;IAED;;;;;;OAMG;IACH,gBAAgB,CAAC,oBAA4B;QAC3C,MAAM,cAAc,GAAG,IAAI,WAAW,CAA6B,YAAY,EAAE;YAC/E,OAAO,EAAE,KAAK;YACd,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,IAAI;YAChB,MAAM,EAAE,EAAE;SACX,CAAC,CAAC;QAEH,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC1B,cAAc,CAAC,cAAc,EAAE,CAAC;QAClC,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,EAAE,CAAC;YAC7C,oBAAoB,EAAE,cAAc,EAAE,CAAC;QACzC,CAAC;IACH,CAAC;CACF","sourcesContent":["/* eslint-disable prefer-destructuring */\nimport type { ReactiveController, ReactiveControllerHost } from 'lit';\nimport { FormControl } from './form-control.js';\n\n//\n// We store a WeakMap of forms + controls so we can keep references to all FormControl 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<FormControl>> = 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<FormControl> = 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<FormControl, string[]>();\n\nexport interface FormControlControllerOptions {\n /** A function that returns the form containing the form control. */\n form: (input: FormControl) => HTMLFormElement | null;\n /** A function that returns the form control's name, which will be submitted with the form data. */\n name: (input: FormControl) => string;\n /** A function that returns the form control's current value. */\n value: (input: FormControl) => 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: FormControl) => 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: FormControl) => 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: FormControl) => boolean;\n /** A function that sets the form control's value */\n setValue: (input: FormControl, 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: FormControl & ReactiveControllerHost;\n\n form?: HTMLFormElement | null;\n\n options: FormControlControllerOptions;\n\n submittedOnce: boolean = false;\n\n constructor(host: ReactiveControllerHost & FormControl, 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, `<it-button>` doesn't reflect.\n const formId = input.form;\n\n if (formId) {\n const root = input.getRootNode() as Document | ShadowRoot | HTMLElement;\n const form = root.querySelector(`#${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 disabled: (input) => input.disabled ?? false,\n reportValidity: (input: FormControl) =>\n typeof input.reportValidity === 'function' ? input.reportValidity() : true,\n checkValidity: (input: FormControl) => (typeof input.checkValidity === 'function' ? input.checkValidity() : true),\n setValue: (input, value) => {\n // eslint-disable-next-line no-param-reassign\n input.value = value as string;\n },\n assumeInteractionOn: ['it-input'],\n ...options,\n };\n }\n\n hostConnected() {\n const form = this.options.form(this.host);\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<FormControl>([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 FormControl\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 FormControl\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 this.submittedOnce = false;\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/shoelace-style/shoelace/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 // console.log('handleFormData');\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 const tagName = this.host.tagName.toLowerCase();\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 = tagName === 'it-button';\n\n if (\n this.host.isConnected &&\n !disabled &&\n !isButton &&\n typeof name === 'string' &&\n name.length > 0 &&\n typeof value !== 'undefined'\n ) {\n switch (tagName) {\n case 'it-radio':\n if ((this.host as any).checked) {\n event.formData.append(name, value as string);\n }\n break;\n case 'it-checkbox':\n if ((this.host as any).checked) {\n if (event.formData.getAll(name).indexOf(value as string) < 0) {\n // handle group checkbox\n event.formData.append(name, value as string);\n }\n }\n break;\n case 'it-checkbox-group':\n // non settare valori in formData, perchè ogni singola checkbox setta il suo valore\n break;\n default:\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\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 const resReportValidity = reportValidity(this.host);\n\n if (this.form && !this.form.noValidate && !disabled && !resReportValidity) {\n event.preventDefault();\n // event.stopImmediatePropagation(); // se lo attiviamo, valida un campo alla volta\n\n // Scroll al primo controllo non valido\n const formControls = formCollections.get(this.form);\n if (formControls) {\n for (const control of formControls) {\n if (!control.validity?.valid) {\n // Scroll smooth verso il controllo non valido\n control.scrollIntoView({\n behavior: 'smooth',\n block: 'center',\n });\n break;\n }\n }\n }\n }\n this.submittedOnce = true;\n };\n\n private handleFormReset = () => {\n this.options.setValue(this.host, '');\n this.submittedOnce = false;\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 // console.log('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, Shoelace 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 // console.log('reportFormValidity');\n //\n // FormControl 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, Shoelace 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 // eslint-disable-next-line class-methods-use-this\n private setUserInteracted(el: FormControl, 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 | any) {\n // console.log('doaction', type);\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 | any) {\n this.doAction('reset', submitter);\n }\n\n /** Submits the form, triggering validation and form data injection. */\n submit(submitter?: HTMLInputElement | any) {\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/shoelace-style/shoelace/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 userInteracted() {\n const hasInteracted = Boolean(userInteractedControls.has(this.host));\n\n return 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 `it-invalid`.\n * If the `it-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 `it-invalid`\n * event will be cancelled before being dispatched.\n */\n emitInvalidEvent(originalInvalidEvent?: Event) {\n const itInvalidEvent = new CustomEvent<Record<PropertyKey, never>>('it-invalid', {\n bubbles: false,\n composed: false,\n cancelable: true,\n detail: {},\n });\n\n if (!originalInvalidEvent) {\n itInvalidEvent.preventDefault();\n }\n\n if (!this.host.dispatchEvent(itInvalidEvent)) {\n originalInvalidEvent?.preventDefault();\n }\n }\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import type { DefaultTranslation } from '@italia/i18n';
2
+ declare const translation: DefaultTranslation;
3
+ export default translation;
4
+ //# sourceMappingURL=it.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"it.d.ts","sourceRoot":"","sources":["../../../../src/form/locales/it.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,QAAA,MAAM,WAAW,EAAE,kBAUlB,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,12 @@
1
+ const translation = {
2
+ $code: 'it',
3
+ $name: 'Italiano',
4
+ $dir: 'ltr',
5
+ validityRequired: 'Questo campo è obbligatorio.',
6
+ validityGroupRequired: "Scegli almeno un'opzione",
7
+ validityPattern: 'Il valore non corrisponde al formato richiesto.',
8
+ validityMinlength: 'Il valore deve essere lungo almeno {minlength} caratteri.',
9
+ validityMaxlength: 'Il valore deve essere lungo al massimo {maxlength} caratteri.',
10
+ };
11
+ export default translation;
12
+ //# sourceMappingURL=it.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"it.js","sourceRoot":"","sources":["../../../../src/form/locales/it.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,GAAuB;IACtC,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,UAAU;IACjB,IAAI,EAAE,KAAK;IAEX,gBAAgB,EAAE,8BAA8B;IAChD,qBAAqB,EAAE,0BAA0B;IACjD,eAAe,EAAE,iDAAiD;IAClE,iBAAiB,EAAE,2DAA2D;IAC9E,iBAAiB,EAAE,+DAA+D;CACnF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import type { DefaultTranslation } from '@italia/i18n';\n\nconst translation: DefaultTranslation = {\n $code: 'it',\n $name: 'Italiano',\n $dir: 'ltr',\n\n validityRequired: 'Questo campo è obbligatorio.',\n validityGroupRequired: \"Scegli almeno un'opzione\",\n validityPattern: 'Il valore non corrisponde al formato richiesto.',\n validityMinlength: 'Il valore deve essere lungo almeno {minlength} caratteri.',\n validityMaxlength: 'Il valore deve essere lungo al massimo {maxlength} caratteri.',\n};\n\nexport default translation;\n"]}
@@ -1,10 +1,26 @@
1
1
  import TrackFocus from './utils/track-focus.js';
2
- import FormMixin from './mixins/form.js';
3
- import ValidityMixin from './mixins/validity.js';
4
2
  import setAttributes from './directives/setAttributes.js';
5
- export { TrackFocus, FormMixin, ValidityMixin, setAttributes };
3
+ import AriaKeyboardListController from './controllers/aria-keyboard-list-controller.js';
4
+ import { StoryFormControlMethodAndProps } from './stories/formControlReusableStories.js';
5
+ import { CollapsibleOrHiddenContentGuidelines } from './stories/reusableUsageGuidelinesStories.js';
6
+ declare global {
7
+ interface Window {
8
+ _itAnalytics: {
9
+ version: string;
10
+ };
11
+ }
12
+ }
13
+ export { TrackFocus, setAttributes, AriaKeyboardListController };
14
+ export type { AriaKeyboardConfig } from './controllers/aria-keyboard-list-controller.js';
15
+ export { RovingTabindexController } from './controllers/roving-tabindex-controller.js';
16
+ export type { RovingTabindexConfig } from './controllers/roving-tabindex-controller.js';
6
17
  export { BaseComponent, BaseComponentInterface, BaseComponentType, BaseLocalizedComponent, } from './base-component/base-component.js';
7
- export { VALIDATION_STATUS } from './mixins/validity.js';
18
+ export { AriaKeyboardAccordionController, type AriaKeyboardAccordionConfig, } from './controllers/aria-keyboard-accordion-controller.js';
19
+ export { CollapseAnimationController } from './controllers/collapse-controller.js';
20
+ export { FormControl } from './form/form-control.js';
21
+ export { formCollections, FormControlControllerOptions, FormControlController } from './form/form-controller.js';
8
22
  export { cookies } from './utils/cookies.js';
9
23
  export type Constructor<T = {}> = new (...args: any[]) => T;
24
+ export { WindowManager, type ScrollCallback, type ScrollState } from './window-manager.js';
25
+ export { StoryFormControlMethodAndProps, CollapsibleOrHiddenContentGuidelines };
10
26
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,aAAa,MAAM,sBAAsB,CAAC;AACjD,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC;AAC/D,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,MAAM,MAAM,WAAW,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAEhD,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAC1D,OAAO,0BAA0B,MAAM,gDAAgD,CAAC;AACxF,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AACzF,OAAO,EAAE,oCAAoC,EAAE,MAAM,6CAA6C,CAAC;AAEnG,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,YAAY,EAAE;YACZ,OAAO,EAAE,MAAM,CAAC;SACjB,CAAC;KACH;CACF;AAUD,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,0BAA0B,EAAE,CAAC;AACjE,YAAY,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACzF,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AACvF,YAAY,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AACxF,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,+BAA+B,EAC/B,KAAK,2BAA2B,GACjC,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AAEnF,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,4BAA4B,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AACjH,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,MAAM,MAAM,WAAW,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,KAAK,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAE3F,OAAO,EAAE,8BAA8B,EAAE,oCAAoC,EAAE,CAAC"}
package/dist/src/index.js CHANGED
@@ -1,9 +1,23 @@
1
1
  import TrackFocus from './utils/track-focus.js';
2
- import FormMixin from './mixins/form.js';
3
- import ValidityMixin from './mixins/validity.js';
4
2
  import setAttributes from './directives/setAttributes.js';
5
- export { TrackFocus, FormMixin, ValidityMixin, setAttributes };
3
+ import AriaKeyboardListController from './controllers/aria-keyboard-list-controller.js';
4
+ import { StoryFormControlMethodAndProps } from './stories/formControlReusableStories.js';
5
+ import { CollapsibleOrHiddenContentGuidelines } from './stories/reusableUsageGuidelinesStories.js';
6
+ if (typeof window !== 'undefined') {
7
+ window._itAnalytics = window._itAnalytics || {};
8
+ window._itAnalytics = {
9
+ ...window._itAnalytics,
10
+ version: '1.0.0-alpha.4',
11
+ };
12
+ }
13
+ export { TrackFocus, setAttributes, AriaKeyboardListController };
14
+ export { RovingTabindexController } from './controllers/roving-tabindex-controller.js';
6
15
  export { BaseComponent, BaseLocalizedComponent, } from './base-component/base-component.js';
7
- export { VALIDATION_STATUS } from './mixins/validity.js';
16
+ export { AriaKeyboardAccordionController, } from './controllers/aria-keyboard-accordion-controller.js';
17
+ export { CollapseAnimationController } from './controllers/collapse-controller.js';
18
+ export { FormControl } from './form/form-control.js';
19
+ export { formCollections, FormControlController } from './form/form-controller.js';
8
20
  export { cookies } from './utils/cookies.js';
21
+ export { WindowManager } from './window-manager.js';
22
+ export { StoryFormControlMethodAndProps, CollapsibleOrHiddenContentGuidelines };
9
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,aAAa,MAAM,sBAAsB,CAAC;AACjD,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC;AAC/D,OAAO,EACL,aAAa,EAGb,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["import TrackFocus from './utils/track-focus.js';\nimport FormMixin from './mixins/form.js';\nimport ValidityMixin from './mixins/validity.js';\nimport setAttributes from './directives/setAttributes.js';\n\nexport { TrackFocus, FormMixin, ValidityMixin, setAttributes };\nexport {\n BaseComponent,\n BaseComponentInterface,\n BaseComponentType,\n BaseLocalizedComponent,\n} from './base-component/base-component.js';\nexport { VALIDATION_STATUS } from './mixins/validity.js';\nexport { cookies } from './utils/cookies.js';\nexport type Constructor<T = {}> = new (...args: any[]) => T;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAEhD,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAC1D,OAAO,0BAA0B,MAAM,gDAAgD,CAAC;AACxF,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AACzF,OAAO,EAAE,oCAAoC,EAAE,MAAM,6CAA6C,CAAC;AAUnG,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IAClC,MAAM,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,IAAI,EAAE,CAAC;IAChD,MAAM,CAAC,YAAY,GAAG;QACpB,GAAG,MAAM,CAAC,YAAY;QACtB,OAAO,EAAE,eAAe;KACzB,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,0BAA0B,EAAE,CAAC;AAEjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AAEvF,OAAO,EACL,aAAa,EAGb,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,+BAA+B,GAEhC,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AAEnF,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAgC,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AACjH,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAyC,MAAM,qBAAqB,CAAC;AAE3F,OAAO,EAAE,8BAA8B,EAAE,oCAAoC,EAAE,CAAC","sourcesContent":["import TrackFocus from './utils/track-focus.js';\n\nimport setAttributes from './directives/setAttributes.js';\nimport AriaKeyboardListController from './controllers/aria-keyboard-list-controller.js';\nimport { StoryFormControlMethodAndProps } from './stories/formControlReusableStories.js';\nimport { CollapsibleOrHiddenContentGuidelines } from './stories/reusableUsageGuidelinesStories.js';\n\ndeclare global {\n interface Window {\n _itAnalytics: {\n version: string;\n };\n }\n}\n\nif (typeof window !== 'undefined') {\n window._itAnalytics = window._itAnalytics || {};\n window._itAnalytics = {\n ...window._itAnalytics,\n version: '1.0.0-alpha.4',\n };\n}\n\nexport { TrackFocus, setAttributes, AriaKeyboardListController };\nexport type { AriaKeyboardConfig } from './controllers/aria-keyboard-list-controller.js';\nexport { RovingTabindexController } from './controllers/roving-tabindex-controller.js';\nexport type { RovingTabindexConfig } from './controllers/roving-tabindex-controller.js';\nexport {\n BaseComponent,\n BaseComponentInterface,\n BaseComponentType,\n BaseLocalizedComponent,\n} from './base-component/base-component.js';\nexport {\n AriaKeyboardAccordionController,\n type AriaKeyboardAccordionConfig,\n} from './controllers/aria-keyboard-accordion-controller.js';\nexport { CollapseAnimationController } from './controllers/collapse-controller.js';\n\nexport { FormControl } from './form/form-control.js';\nexport { formCollections, FormControlControllerOptions, FormControlController } from './form/form-controller.js';\nexport { cookies } from './utils/cookies.js';\nexport type Constructor<T = {}> = new (...args: any[]) => T;\nexport { WindowManager, type ScrollCallback, type ScrollState } from './window-manager.js';\n\nexport { StoryFormControlMethodAndProps, CollapsibleOrHiddenContentGuidelines };\n"]}