@designsystem-se/af 38.1.0 → 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.
- package/components/digi-calendar-datepicker.js +10 -6
- package/components/digi-form-checkbox.js +1 -1
- package/components/digi-form-error-list.js +33 -1
- package/components/digi-form-filter.js +1 -1
- package/components/{p-13c09880.js → p-f84f590e.js} +2 -2
- package/custom-elements.json +9 -1
- package/dist/cjs/digi-arbetsformedlingen.cjs.js +1 -1
- package/dist/cjs/digi-calendar-datepicker.cjs.entry.js +8 -6
- package/dist/cjs/digi-form-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/digi-form-error-list.cjs.entry.js +33 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/_calendar/calendar-datepicker/calendar-datepicker.js +53 -6
- package/dist/collection/components/_form/form-checkbox/form-checkbox.js +8 -5
- package/dist/collection/components/_form/form-error-list/form-error-list.js +20 -1
- package/dist/collection/design-tokens/components/_logo.variables.scss +17 -15
- package/dist/digi-arbetsformedlingen/digi-arbetsformedlingen.esm.js +1 -1
- package/dist/digi-arbetsformedlingen/{p-37c0ea9e.entry.js → p-2295239c.entry.js} +1 -1
- package/dist/digi-arbetsformedlingen/p-42ae53aa.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-7f155bd5.entry.js +1 -0
- package/dist/esm/digi-arbetsformedlingen.js +1 -1
- package/dist/esm/digi-calendar-datepicker.entry.js +8 -6
- package/dist/esm/digi-form-checkbox.entry.js +2 -2
- package/dist/esm/digi-form-error-list.entry.js +33 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/_calendar/calendar-datepicker/calendar-datepicker.d.ts +10 -0
- package/dist/types/components/_form/form-checkbox/form-checkbox.d.ts +5 -2
- package/dist/types/components/_form/form-error-list/form-error-list.d.ts +3 -0
- package/dist/types/components.d.ts +24 -4
- package/hydrate/index.js +45 -9
- package/hydrate/index.mjs +45 -9
- package/package.json +1 -1
- package/dist/digi-arbetsformedlingen/p-ef689144.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-f0a405ca.entry.js +0 -1
|
@@ -41,6 +41,8 @@ export class CalendarDatepicker {
|
|
|
41
41
|
this.afCloseOnSelect = false;
|
|
42
42
|
this.afOpenCalendarTo = undefined;
|
|
43
43
|
this.afErrorMessageIsAlert = true;
|
|
44
|
+
this.afAnnounceIfOptional = false;
|
|
45
|
+
this.afAnnounceIfOptionalText = undefined;
|
|
44
46
|
}
|
|
45
47
|
afDisableValidationChangeHandler(newVal) {
|
|
46
48
|
if (!newVal) {
|
|
@@ -372,9 +374,9 @@ export class CalendarDatepicker {
|
|
|
372
374
|
return this.afSelectedDates;
|
|
373
375
|
}
|
|
374
376
|
render() {
|
|
375
|
-
return (h(Host, { key: '
|
|
377
|
+
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()
|
|
376
378
|
? FormInputValidation.ERROR
|
|
377
|
-
: this.afValidation, afValidationText: this.getErrorText(), afId: this.afId, afAriaDescribedby: `${this.afId}--validation-message`, afRequired: this.afRequired, afRequiredText: this.afRequiredText, onAfOnChange: (evt) => {
|
|
379
|
+
: 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) => {
|
|
378
380
|
evt.stopImmediatePropagation();
|
|
379
381
|
this.parseInput(evt);
|
|
380
382
|
}, onAfOnBlur: (evt) => {
|
|
@@ -389,11 +391,11 @@ export class CalendarDatepicker {
|
|
|
389
391
|
e.preventDefault();
|
|
390
392
|
const focusableDateButton = this.hostElement.querySelector('.digi-calendar__date[tabindex="0"]');
|
|
391
393
|
focusableDateButton === null || focusableDateButton === void 0 ? void 0 : focusableDateButton.focus();
|
|
392
|
-
} }, h("button", { key: '
|
|
394
|
+
} }, h("button", { key: 'c953ddf0c99cfd3b892941da7da4a887b342fd78', id: this.afId + '-button', class: "digi-calendar-datepicker__input-button", slot: "button", "aria-label": this.showCalendar
|
|
393
395
|
? this.afCloseCalendarAriaLabel
|
|
394
|
-
: this.afOpenCalendarAriaLabel, "aria-controls": "calendar-popup", "aria-expanded": this.showCalendar ? 'true' : 'false', onClick: () => this.toggleCalendar(), type: "button" }, h("digi-icon-calendar-alt", { key: '
|
|
396
|
+
: 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
|
|
395
397
|
? `${_t.calendar.screenReaderInstructions}${this.screenReaderUpdateTrigger ? '\u200B' : ''}`
|
|
396
|
-
: ''), h("digi-calendar", { key: '
|
|
398
|
+
: ''), 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) => {
|
|
397
399
|
evt.stopImmediatePropagation();
|
|
398
400
|
this.parseCalendar(evt);
|
|
399
401
|
}, onKeyDown: (e) => {
|
|
@@ -404,7 +406,7 @@ export class CalendarDatepicker {
|
|
|
404
406
|
return;
|
|
405
407
|
e.preventDefault();
|
|
406
408
|
this.focusOnCalendarInput();
|
|
407
|
-
} })), this.afCloseOnSelect && !this.afMultipleDates && (h("div", { key: '
|
|
409
|
+
} })), this.afCloseOnSelect && !this.afMultipleDates && (h("div", { key: 'd9f3eb470b29a0ab96134f1e4666743efacd7448', class: "digi-calendar-datepicker__selected-date-alert", role: this.errorMessageIsAlert ? 'alert' : null }, this.afSelectedDates.length > 0
|
|
408
410
|
? `${_t.calendar.datepicker.selectedDate}: ${this.datesToInputString(this.afSelectedDates)}`
|
|
409
411
|
: '')))));
|
|
410
412
|
}
|
|
@@ -974,6 +976,51 @@ export class CalendarDatepicker {
|
|
|
974
976
|
"attribute": "af-error-message-is-alert",
|
|
975
977
|
"reflect": false,
|
|
976
978
|
"defaultValue": "true"
|
|
979
|
+
},
|
|
980
|
+
"afAnnounceIfOptional": {
|
|
981
|
+
"type": "boolean",
|
|
982
|
+
"mutable": false,
|
|
983
|
+
"complexType": {
|
|
984
|
+
"original": "boolean",
|
|
985
|
+
"resolved": "boolean",
|
|
986
|
+
"references": {}
|
|
987
|
+
},
|
|
988
|
+
"required": false,
|
|
989
|
+
"optional": false,
|
|
990
|
+
"docs": {
|
|
991
|
+
"tags": [{
|
|
992
|
+
"name": "en",
|
|
993
|
+
"text": "Set this to true if the form contains more required fields than optional fields."
|
|
994
|
+
}],
|
|
995
|
+
"text": "S\u00E4tt denna till true om formul\u00E4ret inneh\u00E5ller fler obligatoriska f\u00E4lt \u00E4n valfria."
|
|
996
|
+
},
|
|
997
|
+
"getter": false,
|
|
998
|
+
"setter": false,
|
|
999
|
+
"attribute": "af-announce-if-optional",
|
|
1000
|
+
"reflect": false,
|
|
1001
|
+
"defaultValue": "false"
|
|
1002
|
+
},
|
|
1003
|
+
"afAnnounceIfOptionalText": {
|
|
1004
|
+
"type": "string",
|
|
1005
|
+
"mutable": false,
|
|
1006
|
+
"complexType": {
|
|
1007
|
+
"original": "string",
|
|
1008
|
+
"resolved": "string",
|
|
1009
|
+
"references": {}
|
|
1010
|
+
},
|
|
1011
|
+
"required": false,
|
|
1012
|
+
"optional": false,
|
|
1013
|
+
"docs": {
|
|
1014
|
+
"tags": [{
|
|
1015
|
+
"name": "en",
|
|
1016
|
+
"text": "Set text for afAnnounceIfOptional."
|
|
1017
|
+
}],
|
|
1018
|
+
"text": "S\u00E4tter text f\u00F6r afAnnounceIfOptional."
|
|
1019
|
+
},
|
|
1020
|
+
"getter": false,
|
|
1021
|
+
"setter": false,
|
|
1022
|
+
"attribute": "af-announce-if-optional-text",
|
|
1023
|
+
"reflect": false
|
|
977
1024
|
}
|
|
978
1025
|
};
|
|
979
1026
|
}
|
|
@@ -110,7 +110,7 @@ export class FormCheckbox {
|
|
|
110
110
|
this.afOnInput.emit(e);
|
|
111
111
|
}
|
|
112
112
|
render() {
|
|
113
|
-
return (h(Host, { key: '
|
|
113
|
+
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) => {
|
|
114
114
|
var _a;
|
|
115
115
|
this._input = el;
|
|
116
116
|
(_a = this === null || this === void 0 ? void 0 : this.afInputRef) === null || _a === void 0 ? void 0 : _a.call(this, el);
|
|
@@ -118,7 +118,7 @@ export class FormCheckbox {
|
|
|
118
118
|
? null
|
|
119
119
|
: `${this.afAriaDescribedby ? `${this.afAriaDescribedby} ` : ''}${this.afDescription ? `${this.afId}-description` : ''}`, "aria-labelledby": this.afAriaLabelledby, "aria-label": this.afAriaLabel, "aria-invalid": this.afValidation === FormCheckboxValidation.ERROR
|
|
120
120
|
? 'true'
|
|
121
|
-
: '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: '
|
|
121
|
+
: '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)))));
|
|
122
122
|
}
|
|
123
123
|
static get is() { return "digi-form-checkbox"; }
|
|
124
124
|
static get encapsulation() { return "scoped"; }
|
|
@@ -573,10 +573,13 @@ export class FormCheckbox {
|
|
|
573
573
|
"optional": false,
|
|
574
574
|
"docs": {
|
|
575
575
|
"tags": [{
|
|
576
|
-
"name": "
|
|
577
|
-
"text": "
|
|
576
|
+
"name": "ignore",
|
|
577
|
+
"text": "S\u00E4tter specifikt tabindex f\u00F6r input. Anv\u00E4nds till v\u00E5r komponent Multifiter\nd\u00E4r vi vill manipulera tabbordningen f\u00F6r att underl\u00E4tta navigeringen f\u00F6r tangentbordsanv\u00E4ndare"
|
|
578
|
+
}, {
|
|
579
|
+
"name": "en",
|
|
580
|
+
"text": "Set specific tabindex for input. Used in our component Multifilter \nwhere we want to manipulate the tab order to facilitate navigation for keyboard users."
|
|
578
581
|
}],
|
|
579
|
-
"text": "
|
|
582
|
+
"text": ""
|
|
580
583
|
},
|
|
581
584
|
"getter": false,
|
|
582
585
|
"setter": false,
|
|
@@ -3,6 +3,7 @@ import { randomIdGenerator } from "../../../global/utils/randomIdGenerator";
|
|
|
3
3
|
import { FormErrorListHeadingLevel } from "./form-error-list-heading-level.enum";
|
|
4
4
|
import { TypographyVariation } from "../../../enums";
|
|
5
5
|
import { NotificationAlertVariation } from "../../_notification/notification-alert/notification-alert-variation.enum";
|
|
6
|
+
import { applyStencilScope } from "../../../global/utils/applyStencilScope/applyStencilScope.util";
|
|
6
7
|
/**
|
|
7
8
|
* @enums FormErrorListHeadingLevel - form-error-list-heading-level.enum.ts
|
|
8
9
|
* @swedishName Felmeddelandelista
|
|
@@ -23,6 +24,24 @@ export class FormErrorList {
|
|
|
23
24
|
async afMSetHeadingFocus() {
|
|
24
25
|
this.setHeadingFocus();
|
|
25
26
|
}
|
|
27
|
+
connectedCallback() {
|
|
28
|
+
this.observer = new MutationObserver((mutations) => {
|
|
29
|
+
const hasChildChanges = mutations.some(mutation => mutation.type === 'childList');
|
|
30
|
+
if (hasChildChanges) {
|
|
31
|
+
const hostElement = this.hostElement.querySelector('.digi-form-error-list');
|
|
32
|
+
applyStencilScope(hostElement, hostElement);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
this.observer.observe(this.hostElement, {
|
|
36
|
+
childList: true,
|
|
37
|
+
subtree: true
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
disconnectedCallback() {
|
|
41
|
+
if (this.observer) {
|
|
42
|
+
this.observer.disconnect();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
26
45
|
componentDidLoad() {
|
|
27
46
|
this.setHeadingFocus();
|
|
28
47
|
this.afOnReady.emit();
|
|
@@ -49,7 +68,7 @@ export class FormErrorList {
|
|
|
49
68
|
this.afOnClickLink.emit({ id });
|
|
50
69
|
}
|
|
51
70
|
render() {
|
|
52
|
-
return (h("div", { key: '
|
|
71
|
+
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' }))));
|
|
53
72
|
}
|
|
54
73
|
static get is() { return "digi-form-error-list"; }
|
|
55
74
|
static get encapsulation() { return "scoped"; }
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
@
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
--digi--
|
|
5
|
-
--digi--
|
|
6
|
-
--digi--
|
|
7
|
-
--digi--
|
|
8
|
-
|
|
9
|
-
--digi--
|
|
10
|
-
--digi--
|
|
11
|
-
--digi--
|
|
12
|
-
--digi--
|
|
13
|
-
|
|
14
|
-
--digi--
|
|
15
|
-
--digi--
|
|
1
|
+
@use '../../../../../../styles/src/digi-styles.utils' as *;
|
|
2
|
+
|
|
3
|
+
@mixin digi-logo--variables() {
|
|
4
|
+
--digi--logo--img--min-width: #{rem(256)};
|
|
5
|
+
--digi--logo--img--max-width:#{rem(292)};
|
|
6
|
+
--digi--logo--img--max-width--large: #{rem(368)};
|
|
7
|
+
--digi--logo--img--max-width--system: #{rem(44)};
|
|
8
|
+
|
|
9
|
+
--digi--logo--padding: 1.375rem;
|
|
10
|
+
--digi--logo--padding--wide: var(--digi--gutter--larger);
|
|
11
|
+
--digi--logo--padding--large: var(--digi--gutter--medium);
|
|
12
|
+
--digi--logo--padding--large--wide: var(--digi--gutter--larger);
|
|
13
|
+
|
|
14
|
+
--digi--logo--primary--symbol: var(--digi--color--logotype--primary--symbol);
|
|
15
|
+
--digi--logo--secondary--symbol: var(--digi--color--logotype--secondary--symbol);
|
|
16
|
+
--digi--logo--primary--text: var(--digi--color--logotype--primary--text);
|
|
17
|
+
--digi--logo--secondary--text: var(--digi--color--logotype--secondary--text);
|
|
16
18
|
}
|