@designsystem-se/af 38.0.1-beta.2 → 38.2.0

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 (39) hide show
  1. package/components/digi-calendar-datepicker.js +10 -6
  2. package/components/digi-form-checkbox.js +1 -1
  3. package/components/digi-form-error-list.js +33 -1
  4. package/components/digi-form-file-upload.js +23 -9
  5. package/components/digi-form-filter.js +1 -1
  6. package/components/{p-13c09880.js → p-f84f590e.js} +2 -2
  7. package/custom-elements.json +9 -1
  8. package/dist/cjs/digi-arbetsformedlingen.cjs.js +1 -1
  9. package/dist/cjs/digi-calendar-datepicker.cjs.entry.js +8 -6
  10. package/dist/cjs/digi-form-checkbox.cjs.entry.js +2 -2
  11. package/dist/cjs/digi-form-error-list.cjs.entry.js +33 -1
  12. package/dist/cjs/digi-form-file-upload.cjs.entry.js +21 -8
  13. package/dist/cjs/loader.cjs.js +1 -1
  14. package/dist/collection/components/_calendar/calendar-datepicker/calendar-datepicker.js +53 -6
  15. package/dist/collection/components/_form/form-checkbox/form-checkbox.js +8 -5
  16. package/dist/collection/components/_form/form-error-list/form-error-list.js +20 -1
  17. package/dist/collection/components/_form/form-file-upload/form-file-upload.js +41 -8
  18. package/dist/digi-arbetsformedlingen/digi-arbetsformedlingen.esm.js +1 -1
  19. package/dist/digi-arbetsformedlingen/{p-37c0ea9e.entry.js → p-2295239c.entry.js} +1 -1
  20. package/dist/digi-arbetsformedlingen/p-2788683e.entry.js +1 -0
  21. package/dist/digi-arbetsformedlingen/p-42ae53aa.entry.js +1 -0
  22. package/dist/digi-arbetsformedlingen/p-7f155bd5.entry.js +1 -0
  23. package/dist/esm/digi-arbetsformedlingen.js +1 -1
  24. package/dist/esm/digi-calendar-datepicker.entry.js +8 -6
  25. package/dist/esm/digi-form-checkbox.entry.js +2 -2
  26. package/dist/esm/digi-form-error-list.entry.js +33 -1
  27. package/dist/esm/digi-form-file-upload.entry.js +21 -8
  28. package/dist/esm/loader.js +1 -1
  29. package/dist/types/components/_calendar/calendar-datepicker/calendar-datepicker.d.ts +10 -0
  30. package/dist/types/components/_form/form-checkbox/form-checkbox.d.ts +5 -2
  31. package/dist/types/components/_form/form-error-list/form-error-list.d.ts +3 -0
  32. package/dist/types/components/_form/form-file-upload/form-file-upload.d.ts +5 -0
  33. package/dist/types/components.d.ts +29 -4
  34. package/hydrate/index.js +68 -18
  35. package/hydrate/index.mjs +68 -18
  36. package/package.json +1 -1
  37. package/dist/digi-arbetsformedlingen/p-ba3c4861.entry.js +0 -1
  38. package/dist/digi-arbetsformedlingen/p-ef689144.entry.js +0 -1
  39. package/dist/digi-arbetsformedlingen/p-f0a405ca.entry.js +0 -1
@@ -2229,6 +2229,8 @@ const CalendarDatepicker = /*@__PURE__*/ proxyCustomElement(class CalendarDatepi
2229
2229
  this.afCloseOnSelect = false;
2230
2230
  this.afOpenCalendarTo = undefined;
2231
2231
  this.afErrorMessageIsAlert = true;
2232
+ this.afAnnounceIfOptional = false;
2233
+ this.afAnnounceIfOptionalText = undefined;
2232
2234
  }
2233
2235
  afDisableValidationChangeHandler(newVal) {
2234
2236
  if (!newVal) {
@@ -2560,9 +2562,9 @@ const CalendarDatepicker = /*@__PURE__*/ proxyCustomElement(class CalendarDatepi
2560
2562
  return this.afSelectedDates;
2561
2563
  }
2562
2564
  render() {
2563
- return (h(Host, { key: '6b080d933e012fe050aee0181f927c3252b0bb7e', tabindex: -1 }, h("div", { key: 'ec59a7f209f7a5e06c62d4443fbca980b1030d12', class: Object.assign({ 'digi-calendar-datepicker': true }, this.cssModifiers), id: `${this.afId}-datepicker` }, h("div", { key: '2bf3bd4f0a82c14c4fb04610dab19767fbba595d', class: "digi-calendar-datepicker__input-field" }, h("digi-form-input", { key: 'ebde8123611c021b60104f75c2e4085e35fb4697', ref: (el) => (this._input = el), class: 'digi-calendar-datepicker__input-component', afLabel: this.afLabel, afLabelDescription: this.afLabelDescription, afName: this.afName, afValue: this.inputValue, afValidation: this.hasBuiltInValidationError()
2565
+ return (h(Host, { key: 'a22b366eece8bdf2a6d66ba7b4561093391ad16d', tabindex: -1 }, h("div", { key: '5ec3557df78bb012f2e10f1852252e78e2470ee3', class: Object.assign({ 'digi-calendar-datepicker': true }, this.cssModifiers), id: `${this.afId}-datepicker` }, h("div", { key: '1215a13021718ac98ad2a4a7a5bae3c456385124', class: "digi-calendar-datepicker__input-field" }, h("digi-form-input", { key: '8794d312452fe11f0f9052bbdd238e5570ec55f0', ref: (el) => (this._input = el), class: 'digi-calendar-datepicker__input-component', afLabel: this.afLabel, afLabelDescription: this.afLabelDescription, afName: this.afName, afValue: this.inputValue, afValidation: this.hasBuiltInValidationError()
2564
2566
  ? FormInputValidation.ERROR
2565
- : this.afValidation, afValidationText: this.getErrorText(), afId: this.afId, afAriaDescribedby: `${this.afId}--validation-message`, afRequired: this.afRequired, afRequiredText: this.afRequiredText, onAfOnChange: (evt) => {
2567
+ : this.afValidation, afValidationText: this.getErrorText(), afId: this.afId, afAriaDescribedby: `${this.afId}--validation-message`, afRequired: this.afRequired, afRequiredText: this.afRequiredText, afAnnounceIfOptional: this.afAnnounceIfOptional, afAnnounceIfOptionalText: this.afAnnounceIfOptionalText, onAfOnChange: (evt) => {
2566
2568
  evt.stopImmediatePropagation();
2567
2569
  this.parseInput(evt);
2568
2570
  }, onAfOnBlur: (evt) => {
@@ -2577,11 +2579,11 @@ const CalendarDatepicker = /*@__PURE__*/ proxyCustomElement(class CalendarDatepi
2577
2579
  e.preventDefault();
2578
2580
  const focusableDateButton = this.hostElement.querySelector('.digi-calendar__date[tabindex="0"]');
2579
2581
  focusableDateButton === null || focusableDateButton === void 0 ? void 0 : focusableDateButton.focus();
2580
- } }, h("button", { key: '04df5ccb789271d7ba2f693b740f316301f9fae0', id: this.afId + '-button', class: "digi-calendar-datepicker__input-button", slot: "button", "aria-label": this.showCalendar
2582
+ } }, h("button", { key: 'c953ddf0c99cfd3b892941da7da4a887b342fd78', id: this.afId + '-button', class: "digi-calendar-datepicker__input-button", slot: "button", "aria-label": this.showCalendar
2581
2583
  ? this.afCloseCalendarAriaLabel
2582
- : this.afOpenCalendarAriaLabel, "aria-controls": "calendar-popup", "aria-expanded": this.showCalendar ? 'true' : 'false', onClick: () => this.toggleCalendar(), type: "button" }, h("digi-icon-calendar-alt", { key: '65b9a472f629bbaa46a64c8a304f358da76b0830', class: "digi-calendar-datepicker__button-icon", slot: "icon" })))), h("div", { key: 'd0df89ce680bb2a0ca7f311b2c0ead0f72dc30b6', class: "digi-calendar-datepicker__calendar", id: "calendar-popup" }, h("p", { key: '9796876e15e88b1599d772863c29fc472da24c69', role: "alert", class: "digi-calendar-datepicker__sr-instructions" }, this.showCalendar
2584
+ : this.afOpenCalendarAriaLabel, "aria-controls": "calendar-popup", "aria-expanded": this.showCalendar ? 'true' : 'false', onClick: () => this.toggleCalendar(), type: "button" }, h("digi-icon-calendar-alt", { key: '46c7387d404b77911b97f31c10e7147bd436c7e3', class: "digi-calendar-datepicker__button-icon", slot: "icon" })))), h("div", { key: '91894a4219afa79d913f558f5d1cc6b410b535ce', class: "digi-calendar-datepicker__calendar", id: "calendar-popup" }, h("p", { key: '989fc17ea7a95aa014a26e09f7db7f59fe53a36b', role: "alert", class: "digi-calendar-datepicker__sr-instructions" }, this.showCalendar
2583
2585
  ? `${_t.calendar.screenReaderInstructions}${this.screenReaderUpdateTrigger ? '\u200B' : ''}`
2584
- : ''), h("digi-calendar", { key: 'bd5f34bcdbcb2276b5080c43479337c514861ba9', afActive: this.showCalendar, afShowWeekNumber: this.afShowWeekNumber, afMultipleDates: this.afMultipleDates, afYearSelect: this.afYearSelect, afSelectedDates: this.getSelectedDates, afMinDate: this.afMinDate, afMaxDate: this.afMaxDate, "aria-hidden": !this.showCalendar, afOpenCalendarTo: this.afOpenCalendarTo, onAfOnDateSelectedChange: (evt) => {
2586
+ : ''), h("digi-calendar", { key: '6e62fb845769eca0a9b8cb21e4a09a5620804d42', afActive: this.showCalendar, afShowWeekNumber: this.afShowWeekNumber, afMultipleDates: this.afMultipleDates, afYearSelect: this.afYearSelect, afSelectedDates: this.getSelectedDates, afMinDate: this.afMinDate, afMaxDate: this.afMaxDate, "aria-hidden": !this.showCalendar, afOpenCalendarTo: this.afOpenCalendarTo, onAfOnDateSelectedChange: (evt) => {
2585
2587
  evt.stopImmediatePropagation();
2586
2588
  this.parseCalendar(evt);
2587
2589
  }, onKeyDown: (e) => {
@@ -2592,7 +2594,7 @@ const CalendarDatepicker = /*@__PURE__*/ proxyCustomElement(class CalendarDatepi
2592
2594
  return;
2593
2595
  e.preventDefault();
2594
2596
  this.focusOnCalendarInput();
2595
- } })), this.afCloseOnSelect && !this.afMultipleDates && (h("div", { key: 'fc150d20f14731e8f67f38c6042e8af4e24eae38', class: "digi-calendar-datepicker__selected-date-alert", role: this.errorMessageIsAlert ? 'alert' : null }, this.afSelectedDates.length > 0
2597
+ } })), this.afCloseOnSelect && !this.afMultipleDates && (h("div", { key: 'd9f3eb470b29a0ab96134f1e4666743efacd7448', class: "digi-calendar-datepicker__selected-date-alert", role: this.errorMessageIsAlert ? 'alert' : null }, this.afSelectedDates.length > 0
2596
2598
  ? `${_t.calendar.datepicker.selectedDate}: ${this.datesToInputString(this.afSelectedDates)}`
2597
2599
  : '')))));
2598
2600
  }
@@ -2630,6 +2632,8 @@ const CalendarDatepicker = /*@__PURE__*/ proxyCustomElement(class CalendarDatepi
2630
2632
  "afCloseOnSelect": [4, "af-close-on-select"],
2631
2633
  "afOpenCalendarTo": [16],
2632
2634
  "afErrorMessageIsAlert": [8, "af-error-message-is-alert"],
2635
+ "afAnnounceIfOptional": [4, "af-announce-if-optional"],
2636
+ "afAnnounceIfOptionalText": [1, "af-announce-if-optional-text"],
2633
2637
  "showWrongFormatError": [32],
2634
2638
  "showDisabledDateError": [32],
2635
2639
  "showCalendar": [32],
@@ -1,4 +1,4 @@
1
- import { F as FormCheckbox, d as defineCustomElement$1 } from './p-13c09880.js';
1
+ import { F as FormCheckbox, d as defineCustomElement$1 } from './p-f84f590e.js';
2
2
 
3
3
  const DigiFormCheckbox = FormCheckbox;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -59,6 +59,20 @@ import { d as defineCustomElement$4 } from './p-4b44f757.js';
59
59
  import { d as defineCustomElement$3 } from './p-75c8d67e.js';
60
60
  import { d as defineCustomElement$2 } from './p-2881b363.js';
61
61
 
62
+ /**
63
+ * Small utility for adding Stencil component scope to dynamically inserted elements
64
+ * (e.g. svg for title logotypes)
65
+ */
66
+ function applyStencilScope(host, root) {
67
+ const scopeClasses = [...host.classList].filter(c => c.startsWith('sc-'));
68
+ if (!scopeClasses.length)
69
+ return;
70
+ root.classList.add(...scopeClasses);
71
+ root.querySelectorAll('*').forEach(el => {
72
+ el.classList.add(...scopeClasses);
73
+ });
74
+ }
75
+
62
76
  const formErrorListCss = ".sc-digi-form-error-list-h{--digi--form-error-list--list--padding:var(--digi--gutter--smaller) 0 0 0;--digi--form-error-list--list--margin:0;--digi--form-error-list--item--padding:var(--digi--padding--smaller) 0 0 0;--digi--form-error-list--item--margin:0}.sc-digi-form-error-list-h .digi-form-error-list.sc-digi-form-error-list ul.sc-digi-form-error-list{list-style:none;padding:var(--digi--form-error-list--list--padding);margin:var(--digi--form-error-list--list--margin)}.sc-digi-form-error-list-h .digi-form-error-list.sc-digi-form-error-list ul.sc-digi-form-error-list>li.sc-digi-form-error-list{list-style:none;padding:var(--digi--form-error-list--item--padding);margin:var(--digi--form-error-list--item--margin)}";
63
77
  const DigiFormErrorListStyle0 = formErrorListCss;
64
78
 
@@ -82,6 +96,24 @@ const FormErrorList = /*@__PURE__*/ proxyCustomElement(class FormErrorList exten
82
96
  async afMSetHeadingFocus() {
83
97
  this.setHeadingFocus();
84
98
  }
99
+ connectedCallback() {
100
+ this.observer = new MutationObserver((mutations) => {
101
+ const hasChildChanges = mutations.some(mutation => mutation.type === 'childList');
102
+ if (hasChildChanges) {
103
+ const hostElement = this.hostElement.querySelector('.digi-form-error-list');
104
+ applyStencilScope(hostElement, hostElement);
105
+ }
106
+ });
107
+ this.observer.observe(this.hostElement, {
108
+ childList: true,
109
+ subtree: true
110
+ });
111
+ }
112
+ disconnectedCallback() {
113
+ if (this.observer) {
114
+ this.observer.disconnect();
115
+ }
116
+ }
85
117
  componentDidLoad() {
86
118
  this.setHeadingFocus();
87
119
  this.afOnReady.emit();
@@ -108,7 +140,7 @@ const FormErrorList = /*@__PURE__*/ proxyCustomElement(class FormErrorList exten
108
140
  this.afOnClickLink.emit({ id });
109
141
  }
110
142
  render() {
111
- return (h("div", { key: '59bc43d4b3dd0149647b50203cc1ae585d829006', class: "digi-form-error-list", id: this.afId }, h("digi-notification-alert", { key: 'a2b034276ff7549c9c0711202020e3753da7808d', ref: (el) => (this._notificationAlert = el), "af-heading": this.afHeading, "af-heading-level": this.afHeadingLevel, "af-variation": NotificationAlertVariation.DANGER }, this.afDescription && (h("digi-typography", { key: '3a61c65373b92a73694770f851c6727e27f853e7', "af-variation": TypographyVariation.SMALL }, h("p", { key: 'a088b4d084f5a6db85cedcb4f469f4dff803f8f6', class: "digi-form-error-list__description" }, this.afDescription))), h("slot", { key: '794c42cdece0d06945255b70a96a6992eb4dcd4c' }))));
143
+ return (h("div", { key: '9471a904e95c6304644d884e15aac90d3b0fbad1', class: "digi-form-error-list", id: this.afId }, h("digi-notification-alert", { key: '13a8bf3037570f929f470cc2a531156d552ca53a', ref: (el) => (this._notificationAlert = el), "af-heading": this.afHeading, "af-heading-level": this.afHeadingLevel, "af-variation": NotificationAlertVariation.DANGER }, this.afDescription && (h("digi-typography", { key: '8e8ef106286f426b0cbcfd904407582e79e8ce24', "af-variation": TypographyVariation.SMALL }, h("p", { key: '51175a8da94efe46a262ce365994aa3c23983f2e', class: "digi-form-error-list__description" }, this.afDescription))), h("slot", { key: 'b9f5287d0e2c0326100a094a48fa5e7ab314b92f' }))));
112
144
  }
113
145
  get hostElement() { return this; }
114
146
  static get style() { return DigiFormErrorListStyle0; }
@@ -125,6 +125,7 @@ const FormFileUpload = /*@__PURE__*/ proxyCustomElement(class FormFileUpload ext
125
125
  * @en Import array with files without triggering upload event. A file object needs to contain an id, status and the file itself.
126
126
  */
127
127
  async afMImportFiles(files) {
128
+ this.resetErrors();
128
129
  if (files && files.length > 0) {
129
130
  for (const importedFile of files) {
130
131
  this.validateFile(importedFile);
@@ -139,6 +140,14 @@ const FormFileUpload = /*@__PURE__*/ proxyCustomElement(class FormFileUpload ext
139
140
  async afMGetFormControlElement() {
140
141
  return this._input;
141
142
  }
143
+ /**
144
+ * Rensar komponentens fillista och eventuella felmeddelanden.
145
+ * @en Clears the component's file list and any error messages.
146
+ */
147
+ async afMClearFiles() {
148
+ this.files = [];
149
+ this.resetErrors();
150
+ }
142
151
  /**
143
152
  * Lyssnar på om fokus sätts på custom-elementet och propagerar ner det till själva input-elementet.
144
153
  * @en Listens for when focus is set on the custom element and propagates it down to the actual input element.
@@ -186,7 +195,11 @@ const FormFileUpload = /*@__PURE__*/ proxyCustomElement(class FormFileUpload ext
186
195
  let exist = false;
187
196
  if (this.files.length > 0) {
188
197
  this.files.forEach((file) => {
189
- if (file.name === fileToCheck.name) {
198
+ if (file['id'] === fileToCheck['id']) {
199
+ exist = true;
200
+ return;
201
+ }
202
+ else if (file.name === fileToCheck.name) {
190
203
  exist = true;
191
204
  }
192
205
  });
@@ -570,22 +583,22 @@ const FormFileUpload = /*@__PURE__*/ proxyCustomElement(class FormFileUpload ext
570
583
  } }, this.renderFiles())));
571
584
  }
572
585
  render() {
573
- return (h(Fragment, { key: '1104991979216e10bd2e137de392134a9dd970f3' }, h("digi-util-breakpoint-observer", { key: '645a8f2849a39c068b77fa7c6ddfd726e834b3b2', onAfOnChange: (e) => this.breakpointHandler(e) }), h("div", { key: 'c6b2785961f0e0b0cb2b2ccb7da42d663b9e9e3b', class: Object.assign({ 'digi-form-file-upload': true }, this.cssModifiers) }, h("digi-form-label", { key: 'd51e788ee53461e075b0f73b600608646c70032f', afFor: this.afId, afLabel: this.afLabel, afDescription: this.afLabelDescription, afRequired: this.afRequired, afAnnounceIfOptional: this.afAnnounceIfOptional, afRequiredText: this.afRequiredText, afAnnounceIfOptionalText: this.afAnnounceIfOptionalText }), h("div", { key: '9df4b7deaca899f1c06bf615065a2fce7eea4bc0', class: {
586
+ return (h(Fragment, { key: 'bec280d44d534a720927ab737b34335600c3fe80' }, h("digi-util-breakpoint-observer", { key: '93983b718eda1869ff95f7a0abe8c6704395a1e0', onAfOnChange: (e) => this.breakpointHandler(e) }), h("div", { key: '23f30473aa0dd681c6c4ea20138d3f13391bb070', class: Object.assign({ 'digi-form-file-upload': true }, this.cssModifiers) }, h("digi-form-label", { key: 'c42a873187b3bf30ddfdb71561d6902a8b2f98fe', afFor: this.afId, afLabel: this.afLabel, afDescription: this.afLabelDescription, afRequired: this.afRequired, afAnnounceIfOptional: this.afAnnounceIfOptional, afRequiredText: this.afRequiredText, afAnnounceIfOptionalText: this.afAnnounceIfOptionalText }), h("div", { key: 'db1082e11bafb320c13a790d639d37ca821617ac', class: {
574
587
  'digi-form-file-upload__upload-area': true,
575
588
  'digi-form-file-upload__upload-area--hover': this.fileHover
576
589
  }, onDrop: (e) => this.handleDrop(e), onDragOver: (e) => this.handleAllowDrop(e), onDragEnter: (e) => this.handleOnDragEnterLeave(e), onDragLeave: (e) => this.handleOnDragEnterLeave(e), onClick: (e) => this.handleInputClick(e) }, this.fileHover &&
577
- this.afVariation != FormFileUploadVariation.SMALL && (h("div", { key: '8c35b4e2523db4f4f892d2f615caedb8bb3a9ebe', class: "digi-form-file-upload__upload-area-overlay" })), h("div", { key: '096b05c159ce7722687cdc0b1a0ff4889a5485e2', class: "digi-form-file-upload__text-area" }, h("button", { key: '97504d954e2f3a0e76d99fb4d5049ddea108a32f', type: "button", id: this.afId + '-button', ref: (el) => {
590
+ this.afVariation != FormFileUploadVariation.SMALL && (h("div", { key: 'f58d5f61b5568263e9b60b255f47e6ef418c78e5', class: "digi-form-file-upload__upload-area-overlay" })), h("div", { key: 'c58c52f7e2c8aa8d17fe510ef90435d488844237', class: "digi-form-file-upload__text-area" }, h("button", { key: '1bb7fa84e0778702d0e77008f7d468d560ac8e17', type: "button", id: this.afId + '-button', ref: (el) => {
578
591
  this._uploadButton = el;
579
592
  }, onClick: (e) => this.handleInputClick(e), class: "digi-form-file-upload__button hidden_mobile", style: {
580
593
  margin: '0'
581
- } }, h("digi-icon-paperclip", { key: 'e47597d6988db6a71c22fb9ab4cfa877be4a48fa', "aria-hidden": "true", class: "digi-form-file-upload__button-icon paper-clip", slot: "icon" }), this.afUploadBtnText
594
+ } }, h("digi-icon-paperclip", { key: 'a84b67ad055682b1c1b013ec948af0935c35ed0c', "aria-hidden": "true", class: "digi-form-file-upload__button-icon paper-clip", slot: "icon" }), this.afUploadBtnText
582
595
  ? this.afUploadBtnText
583
- : _t.form.file_choose), h("input", { key: 'b21162f7873e21a8b3ed2d286ef154b66b95c8ec', ref: (el) => {
596
+ : _t.form.file_choose), h("input", { key: 'd0babe3bcbc5d03f2436c0f4a7ee23a93ecb0474', ref: (el) => {
584
597
  this._input = el;
585
- }, onChange: (e) => this.onButtonUploadFileHandler(e), class: "digi-form-file-upload__input", multiple: true, type: "file", id: this.afId, accept: this.afFileTypes, name: this.afName ? this.afName : null, required: this.afRequired ? this.afRequired : null, onDrop: (e) => this.handleDrop(e), onDragOver: (e) => this.handleAllowDrop(e), "aria-errormessage": "digi-form-file-upload__error", "aria-describedBy": "digi-form-file-upload__error" }), h("span", { key: 'c8e448ef96e9d4f292ec88606526e06935192308' }, this.afVariation !== FormFileUploadVariation.SMALL &&
586
- _t.form.file_dropzone))), h("p", { key: '8c6f1b6190eb4f87bbcd9d50f4c4929cdcf4c026', class: "visually-hidden", role: this.errorMessageIsAlert ? 'alert' : null, "aria-atomic": "true", ref: (el) => {
598
+ }, onChange: (e) => this.onButtonUploadFileHandler(e), class: "digi-form-file-upload__input", multiple: true, type: "file", id: this.afId, accept: this.afFileTypes, name: this.afName ? this.afName : null, required: this.afRequired ? this.afRequired : null, onDrop: (e) => this.handleDrop(e), onDragOver: (e) => this.handleAllowDrop(e), "aria-errormessage": "digi-form-file-upload__error", "aria-describedBy": "digi-form-file-upload__error" }), h("span", { key: '20a4158d0462ee2f871bddb57b9e168d356573ed' }, this.afVariation !== FormFileUploadVariation.SMALL &&
599
+ _t.form.file_dropzone))), h("p", { key: 'ade6d22fde218536ce42daff285a1605ac16bdb1', class: "visually-hidden", role: this.errorMessageIsAlert ? 'alert' : null, "aria-atomic": "true", ref: (el) => {
587
600
  this._srTextContainer = el;
588
- } }), (this.files.length > 0 || this.error) && (h("div", { key: '7faefe886463ce493824665375b3b4ab0aec5753', class: "digi-form-file-upload__files" }, this.renderErrorMessage(), this.renderFileContainer())))));
601
+ } }), (this.files.length > 0 || this.error) && (h("div", { key: '06044ba8e2a5d7e76374af1dfa479c891554ab45', class: "digi-form-file-upload__files" }, this.renderErrorMessage(), this.renderFileContainer())))));
589
602
  }
590
603
  get hostElement() { return this; }
591
604
  static get watchers() { return {
@@ -626,7 +639,8 @@ const FormFileUpload = /*@__PURE__*/ proxyCustomElement(class FormFileUpload ext
626
639
  "afMGetAllFiles": [64],
627
640
  "afMGetValidationState": [64],
628
641
  "afMImportFiles": [64],
629
- "afMGetFormControlElement": [64]
642
+ "afMGetFormControlElement": [64],
643
+ "afMClearFiles": [64]
630
644
  }, [[0, "focus", "focusOnInput"]], {
631
645
  "afValidationText": ["afValidationTextChange"]
632
646
  }]);
@@ -5,7 +5,7 @@ import { d as detectClickOutside } from './p-430607cb.js';
5
5
  import { d as detectFocusOutside } from './p-ee33960b.js';
6
6
  import { _ as _t } from './p-903a27d9.js';
7
7
  import { d as defineCustomElement$4 } from './p-70fad0ea.js';
8
- import { d as defineCustomElement$3 } from './p-13c09880.js';
8
+ import { d as defineCustomElement$3 } from './p-f84f590e.js';
9
9
  import { d as defineCustomElement$2 } from './p-14119afa.js';
10
10
 
11
11
  const formFilterCss = ".sc-digi-form-filter-h{--digi--form-filter--footer--background:var(--digi--color--background--secondary-accent);--digi--form-filter--scroll--max-height:18.75rem;--digi--form-filter--scroll--max-height--large:23.4275rem;--digi--form-filter--scroll--padding:var(--digi--padding--small);--digi--form-filter--reset-button--margin-left:var(--digi--padding--small);--digi--form-filter--legend__border-bottom:var(--digi--border-width--primary) solid var(--digi--color--divider--primary);--digi--form-filter--list--margin:0;--digi--form-filter--list--padding:var(--digi--gutter--small) 0 0 0;--digi--form-filter--item--margin:var(--digi--gutter--small) 0;--digi--form-filter--toggle-icon--transition:ease-in-out 0.2s all;--digi--form-filter--dropdown--box-shadow:0 0.125rem 0.375rem 0 rgba(0, 0, 0, 0.7);--digi--form-filter--dropdown--border-radius:var(--digi--border--radius--primary);--digi--form-filter--dropdown--background:var(--digi--color--background--primary);--digi--form-filter--dropdown--min-width:18.75rem;--digi--form-filter--dropdown--margin-top:var(--digi--gutter--small);--digi--form-filter--dropdown--z-index:999;--digi--form-filter--toggle-button-indicator--color--default:transparent;--digi--form-filter--toggle-button-indicator--color--active:var(--digi--color--marking--indication--primary);--digi--form-filter--toggle-button-indicator--width:0.625rem;--digi--form-filter--toggle-button-indicator--height:0.625rem;--digi--form-filter--toggle-button-indicator--margin-right:var(--digi--margin--small);--digi--form-filter--toggle-button-indicator--margin-left:calc(var(--digi--margin--smaller) * -1);--digi--form-filter--toggle-button--text--margin-right:var(--digi--margin--smaller);--digi--form-filter--toggle-icon--width:0.875rem;--digi--form-filter--toggle-icon--height:0.875rem;--digi--form-filter--legend--font-weight:var(--digi--typography--preamble--font-weight--desktop);--digi--form-filter--legend--font-family:var(--digi--global--typography--font-family--default);--digi--form-filter--legend--font-size:var(--digi--typography--preamble--font-size--desktop)}.sc-digi-form-filter-h .digi-form-filter.sc-digi-form-filter{--INDICATOR--BACKGROUND:var(--digi--form-filter--toggle-button-indicator--color--default);--SCROLL--MAX-HEIGHT:var(--digi--form-filter--scroll--max-height);position:relative}.sc-digi-form-filter-h .digi-form-filter--open.sc-digi-form-filter .digi-form-filter__toggle-icon.sc-digi-form-filter{transform:rotate(-180deg)}.sc-digi-form-filter-h .digi-form-filter__toggle-icon.sc-digi-form-filter{transition:var(--digi--form-filter--toggle-icon--transition)}.sc-digi-form-filter-h .digi-form-filter__toggle-icon.sc-digi-form-filter-s>[slot^=icon],.sc-digi-form-filter-h .digi-form-filter__toggle-icon .sc-digi-form-filter-s>[slot^=icon]{--digi--icon--width:var(--digi--form-filter--toggle-icon--width);--digi--icon--height:var(--digi--form-filter--toggle-icon--height)}.sc-digi-form-filter-h .digi-form-filter__legend.sc-digi-form-filter{font-weight:var(--digi--form-filter--legend--font-weight);font-family:var(--digi--form-filter--legend--font-family);font-size:var(--digi--form-filter--legend--font-size)}.sc-digi-form-filter-h .digi-form-filter__scroll.sc-digi-form-filter{max-height:var(--SCROLL--MAX-HEIGHT);overflow-y:auto;padding:var(--digi--form-filter--scroll--padding);overflow-x:hidden}@media (min-width: 48rem){.sc-digi-form-filter-h .digi-form-filter__scroll.sc-digi-form-filter{--SCROLL--MAX-HEIGHT:var(--digi--form-filter--scroll--max-height--large)}}.sc-digi-form-filter-h .digi-form-filter__scroll.sc-digi-form-filter fieldset.sc-digi-form-filter{border:none}.sc-digi-form-filter-h .digi-form-filter__scroll.sc-digi-form-filter legend.sc-digi-form-filter{width:100%;border-bottom:var(--digi--form-filter--legend__border-bottom);padding-bottom:0.25rem}.sc-digi-form-filter-h .digi-form-filter__scroll.sc-digi-form-filter .legend-hidden.sc-digi-form-filter{border:0;clip:rect(1px, 1px, 1px, 1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sc-digi-form-filter-h .digi-form-filter__footer.sc-digi-form-filter{display:flex;align-items:center;justify-content:center;background:var(--digi--form-filter--footer--background);padding:var(--digi--form-filter--scroll--padding)}.sc-digi-form-filter-h .digi-form-filter__reset-button.sc-digi-form-filter{display:inline-block;margin-left:var(--digi--form-filter--reset-button--margin-left)}.sc-digi-form-filter-h .digi-form-filter__dropdown.sc-digi-form-filter{min-width:var(--digi--form-filter--dropdown--min-width);position:absolute;z-index:var(--digi--form-filter--dropdown--z-index);background:var(--digi--form-filter--dropdown--background);border-radius:var(--digi--form-filter--dropdown--border-radius);box-shadow:var(--digi--form-filter--dropdown--box-shadow);overflow:hidden;margin-top:var(--digi--form-filter--dropdown--margin-top)}@media (min-width: 48rem){.sc-digi-form-filter-h .digi-form-filter__dropdown--right.sc-digi-form-filter{right:0}}.sc-digi-form-filter-h .digi-form-filter__dropdown--hidden.sc-digi-form-filter{display:none}.sc-digi-form-filter-h .digi-form-filter__toggle-button-indicator.sc-digi-form-filter:before{content:\"\";width:var(--digi--form-filter--toggle-button-indicator--width);height:var(--digi--form-filter--toggle-button-indicator--height);background:var(--INDICATOR--BACKGROUND);display:inline-block;margin-right:var(--digi--form-filter--toggle-button-indicator--margin-right);border-radius:50% 50%;overflow:hidden;margin-left:var(--digi--form-filter--toggle-button-indicator--margin-left)}.sc-digi-form-filter-h .digi-form-filter__toggle-button-indicator--active.sc-digi-form-filter{--INDICATOR--BACKGROUND:var(--digi--form-filter--toggle-button-indicator--color--active)}.sc-digi-form-filter-h .digi-form-filter__list.sc-digi-form-filter{margin:var(--digi--form-filter--list--margin);padding:var(--digi--form-filter--list--padding)}.sc-digi-form-filter-h .digi-form-filter__item.sc-digi-form-filter{display:block}.sc-digi-form-filter-h .digi-form-filter__toggle-button-text.sc-digi-form-filter{margin-right:var(--digi--form-filter--toggle-button--text--margin-right)}";
@@ -115,7 +115,7 @@ const FormCheckbox = /*@__PURE__*/ proxyCustomElement(class FormCheckbox extends
115
115
  this.afOnInput.emit(e);
116
116
  }
117
117
  render() {
118
- return (h(Host, { key: '93a52532d5ee8e2b89982b3d06509c16b3656bce', tabindex: -1 }, h("div", { key: '3f2fe30e35c36080d80fdec5c57abf8e310ae14b', class: Object.assign({ 'digi-form-checkbox': true }, this.cssModifiers) }, h("input", { key: 'a45c26da379bff48830f0b03ceebcf24b06c3b17', class: "digi-form-checkbox__input", ref: (el) => {
118
+ return (h(Host, { key: 'e8ca1dfe96537dd438a4b6c206adfc7c9fd64d9c', tabindex: -1 }, h("div", { key: '850911b7ffdcea222b12c2c883cf93b63f703b4f', class: Object.assign({ 'digi-form-checkbox': true }, this.cssModifiers) }, h("input", { key: '923a49d0402e6b3034d3e8e6d43033692695c830', class: "digi-form-checkbox__input", ref: (el) => {
119
119
  var _a;
120
120
  this._input = el;
121
121
  (_a = this === null || this === void 0 ? void 0 : this.afInputRef) === null || _a === void 0 ? void 0 : _a.call(this, el);
@@ -123,7 +123,7 @@ const FormCheckbox = /*@__PURE__*/ proxyCustomElement(class FormCheckbox extends
123
123
  ? null
124
124
  : `${this.afAriaDescribedby ? `${this.afAriaDescribedby} ` : ''}${this.afDescription ? `${this.afId}-description` : ''}`, "aria-labelledby": this.afAriaLabelledby, "aria-label": this.afAriaLabel, "aria-invalid": this.afValidation === FormCheckboxValidation.ERROR
125
125
  ? 'true'
126
- : 'false', required: this.afRequired, id: this.afId, name: this.afName, type: "checkbox", checked: this.afChecked, value: this.afValue, indeterminate: this.afIndeterminate, autofocus: this.afAutofocus ? this.afAutofocus : null }), h("label", { key: '54cd68f1c10fd023e9dd81bd0fabb2920b911c12', htmlFor: this.afId, class: "digi-form-checkbox__label" }, h("span", { key: 'c7184f48868d38d04485a48f214cc3c37d862ba4', class: "digi-form-checkbox__box" }), this.afLabel), !!this.afDescription && (h("p", { key: 'afc00a7de3cef740bdbf23607cd9247887752759', id: `${this.afId}-description`, class: "digi-form-checkbox__description" }, this.afDescription)))));
126
+ : 'false', required: this.afRequired, id: this.afId, name: this.afName, type: "checkbox", checked: this.afChecked, value: this.afValue, indeterminate: this.afIndeterminate, autofocus: this.afAutofocus ? this.afAutofocus : null }), h("label", { key: 'dccbd4e83dbc757483a18ac22d1539ef83dfb534', htmlFor: this.afId, class: "digi-form-checkbox__label" }, h("span", { key: '1cbc88be9d74dab3e04472bc9462712377447d4a', class: "digi-form-checkbox__box" }), this.afLabel), !!this.afDescription && (h("p", { key: 'bdab264d9d13520858c581d2664c0d53171a1415', id: `${this.afId}-description`, class: "digi-form-checkbox__description" }, this.afDescription)))));
127
127
  }
128
128
  get hostElement() { return this; }
129
129
  static get watchers() { return {
@@ -226,6 +226,14 @@
226
226
  "value": ""
227
227
  },
228
228
  "attributes": [
229
+ {
230
+ "name": "af-announce-if-optional",
231
+ "description": "Sätt denna till true om formuläret innehåller fler obligatoriska fält än valfria."
232
+ },
233
+ {
234
+ "name": "af-announce-if-optional-text",
235
+ "description": "Sätter text för afAnnounceIfOptional."
236
+ },
229
237
  {
230
238
  "name": "af-close-calendar-aria-label",
231
239
  "description": "Aria-label till knappen som stänger kalendern"
@@ -772,7 +780,7 @@
772
780
  },
773
781
  {
774
782
  "name": "af-tab-index",
775
- "description": "Tabindex"
783
+ "description": ""
776
784
  },
777
785
  {
778
786
  "name": "af-validation",