@designsystem-se/af 37.0.1 → 37.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/digi-code-example.js +1 -1
- package/components/digi-form-checkbox.js +1 -1
- package/components/digi-form-filter.js +1 -1
- package/components/digi-form-radiobutton.js +1 -1
- package/components/digi-form-radiogroup.js +1 -1
- package/components/p-8bdc6d6b.js +157 -0
- package/components/p-9dd1da8c.js +177 -0
- package/dist/cjs/button-size.enum-1fd86b9e.js +7 -0
- package/dist/cjs/button-type.enum-406723db.js +8 -0
- package/dist/cjs/{code-example-variation.enum-1611825e.js → code-example-variation.enum-c6557727.js} +0 -6
- package/dist/cjs/digi-arbetsformedlingen.cjs.js +1 -1
- package/dist/cjs/digi-button_2.cjs.entry.js +262 -0
- package/dist/cjs/digi-calendar-datepicker.cjs.entry.js +6 -3
- package/dist/cjs/digi-code-block_3.cjs.entry.js +22 -7
- package/dist/cjs/digi-code-example.cjs.entry.js +4 -3
- package/dist/cjs/digi-dialog.cjs.entry.js +7 -4
- package/dist/cjs/digi-footer.cjs.entry.js +6 -3
- package/dist/cjs/digi-form-error-list.cjs.entry.js +6 -3
- package/dist/cjs/digi-form-input-search.cjs.entry.js +3 -2
- package/dist/cjs/digi-form-radiogroup.cjs.entry.js +1 -1
- package/dist/cjs/digi-form-receipt.cjs.entry.js +6 -3
- package/dist/cjs/digi-form-select-filter.cjs.entry.js +6 -3
- package/dist/cjs/{digi-form-checkbox.cjs.entry.js → digi-header-avatar.cjs.entry.js} +92 -105
- package/dist/cjs/digi-header-navigation-item.cjs.entry.js +27 -0
- package/dist/cjs/digi-header-navigation.cjs.entry.js +232 -0
- package/dist/cjs/digi-header-notification.cjs.entry.js +23 -0
- package/dist/cjs/digi-header.cjs.entry.js +148 -0
- package/dist/cjs/digi-icon-bars.cjs.entry.js +30 -0
- package/dist/cjs/digi-icon-bell-filled.cjs.entry.js +30 -0
- package/dist/cjs/digi-icon-x.cjs.entry.js +30 -0
- package/dist/cjs/digi-layout-block_2.cjs.entry.js +92 -0
- package/dist/cjs/digi-media-image_2.cjs.entry.js +167 -0
- package/dist/cjs/digi-navigation-pagination.cjs.entry.js +6 -3
- package/dist/cjs/digi-navigation-sidebar-button.cjs.entry.js +30 -0
- package/dist/cjs/digi-notification-alert.cjs.entry.js +6 -3
- package/dist/cjs/digi-notification-error-page.cjs.entry.js +6 -3
- package/dist/cjs/digi-title-logo.cjs.entry.js +135 -0
- package/dist/cjs/digi-tools-feedback.cjs.entry.js +8 -5
- package/dist/cjs/digi-util-breakpoint-observer.cjs.entry.js +48 -0
- package/dist/cjs/digi-util-keydown-handler.cjs.entry.js +83 -0
- package/dist/cjs/{form-input-search-variation.enum-e0e025b1.js → form-input-search-variation.enum-c50239bc.js} +0 -7
- package/dist/cjs/index-7a477838.js +58 -6
- package/dist/cjs/index.cjs.js +45 -42
- package/dist/cjs/layout-container-max-width.enum-7e637f44.js +21 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{typography-variation.enum-118ff8e5.js → typography-variation.enum-50512a4e.js} +0 -20
- package/dist/collection/components/_form/form-checkbox/form-checkbox.css +8 -8
- package/dist/collection/components/_form/form-checkbox/form-checkbox.js +23 -3
- package/dist/collection/components/_form/form-radiobutton/form-radiobutton.css +7 -2
- package/dist/collection/components/_form/form-radiobutton/form-radiobutton.js +23 -3
- package/dist/collection/components/_form/form-radiogroup/form-radiogroup.css +4 -0
- package/dist/collection/styles/src/tokens-documentation/web-AF25.json +866 -666
- package/dist/digi-arbetsformedlingen/digi-arbetsformedlingen.esm.js +1 -1
- package/dist/digi-arbetsformedlingen/index.esm.js +1 -1
- package/dist/digi-arbetsformedlingen/p-00219e81.entry.js +1 -0
- package/{components/p-ff4f4fb8.js → dist/digi-arbetsformedlingen/p-19c30198.entry.js} +1 -163
- package/dist/digi-arbetsformedlingen/p-237cad1c.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-260620fe.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-2698dd2a.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-2a86cc73.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-2b7b69cd.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-300aa9ef.js +1 -0
- package/dist/digi-arbetsformedlingen/p-38627816.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-55f525dd.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-5a602122.js +1 -0
- package/dist/digi-arbetsformedlingen/p-73a6be41.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-75309c9a.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-826ad49e.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-84719680.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-89b457e8.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-95330112.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-9e56568b.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-ac87daf1.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-b328f60b.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-bc3d2778.js +1 -0
- package/dist/digi-arbetsformedlingen/p-c24aab43.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-cd50f570.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-cdf86efc.js +1 -0
- package/dist/digi-arbetsformedlingen/p-d4145a3e.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-dc9b6144.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-e2c92528.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-e6b65415.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-e7e39ee7.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-e844d4cc.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-ee4cb21a.js +1 -0
- package/dist/digi-arbetsformedlingen/p-ee9589e6.js +1 -0
- package/dist/digi-arbetsformedlingen/p-f8391f37.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-fdecd798.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/p-fe409f14.entry.js +1 -0
- package/dist/digi-arbetsformedlingen/styles/src/tokens-documentation/web-AF25.json +866 -666
- package/dist/esm/button-size.enum-d5ff6ff3.js +7 -0
- package/dist/esm/button-type.enum-5250ae0b.js +8 -0
- package/dist/esm/{code-example-variation.enum-e656d235.js → code-example-variation.enum-e9f9fced.js} +1 -7
- package/dist/esm/digi-arbetsformedlingen.js +1 -1
- package/dist/esm/digi-button_2.entry.js +257 -0
- package/dist/esm/digi-calendar-datepicker.entry.js +6 -3
- package/dist/esm/digi-code-block_3.entry.js +21 -6
- package/dist/esm/digi-code-example.entry.js +2 -1
- package/dist/esm/digi-dialog.entry.js +6 -3
- package/dist/esm/digi-footer.entry.js +6 -3
- package/dist/esm/digi-form-error-list.entry.js +6 -3
- package/dist/esm/digi-form-input-search.entry.js +2 -1
- package/dist/esm/digi-form-radiogroup.entry.js +1 -1
- package/dist/esm/digi-form-receipt.entry.js +6 -3
- package/dist/esm/digi-form-select-filter.entry.js +6 -3
- package/dist/esm/{digi-form-checkbox.entry.js → digi-header-avatar.entry.js} +93 -106
- package/dist/esm/digi-header-navigation-item.entry.js +23 -0
- package/dist/esm/digi-header-navigation.entry.js +228 -0
- package/dist/esm/digi-header-notification.entry.js +19 -0
- package/dist/esm/digi-header.entry.js +144 -0
- package/dist/esm/digi-icon-bars.entry.js +26 -0
- package/dist/esm/digi-icon-bell-filled.entry.js +26 -0
- package/dist/esm/digi-icon-x.entry.js +26 -0
- package/dist/esm/digi-layout-block_2.entry.js +87 -0
- package/dist/esm/digi-media-image_2.entry.js +162 -0
- package/dist/esm/digi-navigation-pagination.entry.js +6 -3
- package/dist/esm/digi-navigation-sidebar-button.entry.js +26 -0
- package/dist/esm/digi-notification-alert.entry.js +6 -3
- package/dist/esm/digi-notification-error-page.entry.js +6 -3
- package/dist/esm/digi-title-logo.entry.js +131 -0
- package/dist/esm/digi-tools-feedback.entry.js +6 -3
- package/dist/esm/digi-util-breakpoint-observer.entry.js +44 -0
- package/dist/esm/digi-util-keydown-handler.entry.js +79 -0
- package/dist/esm/{form-input-search-variation.enum-6d8dc10a.js → form-input-search-variation.enum-f9d669f2.js} +1 -8
- package/dist/esm/index-148a7577.js +58 -6
- package/dist/esm/index.js +6 -3
- package/dist/esm/layout-container-max-width.enum-c40018ac.js +21 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{typography-variation.enum-23eeecd2.js → typography-variation.enum-8c3ff25c.js} +1 -21
- package/dist/types/components/_form/form-checkbox/form-checkbox.d.ts +8 -0
- package/dist/types/components/_form/form-radiobutton/form-radiobutton.d.ts +8 -0
- package/hydrate/index.js +37 -9
- package/hydrate/index.mjs +37 -9
- package/package.json +1 -1
- package/components/p-5fd00d55.js +0 -143
- package/dist/cjs/digi-button_17.cjs.entry.js +0 -1120
- package/dist/digi-arbetsformedlingen/p-029c4d40.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-0c77050e.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-2c698144.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-4841b4e1.js +0 -1
- package/dist/digi-arbetsformedlingen/p-51bfa2a9.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-53d9556b.js +0 -1
- package/dist/digi-arbetsformedlingen/p-583d40dc.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-7238fdb8.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-7327f45d.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-750ff498.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-7e125c6e.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-9be9a291.js +0 -1
- package/dist/digi-arbetsformedlingen/p-a2561b9e.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-bd55807c.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-c68bf2b3.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-ccd617cc.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-edcb61eb.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-eeca26b2.entry.js +0 -1
- package/dist/digi-arbetsformedlingen/p-f94db846.entry.js +0 -1
- package/dist/esm/digi-button_17.entry.js +0 -1100
package/dist/cjs/{typography-variation.enum-118ff8e5.js → typography-variation.enum-50512a4e.js}
RENAMED
|
@@ -172,26 +172,6 @@ exports.InfoCardHeadingLevel = void 0;
|
|
|
172
172
|
InfoCardHeadingLevel["H6"] = "h6";
|
|
173
173
|
})(exports.InfoCardHeadingLevel || (exports.InfoCardHeadingLevel = {}));
|
|
174
174
|
|
|
175
|
-
exports.LayoutBlockContainer = void 0;
|
|
176
|
-
(function (LayoutBlockContainer) {
|
|
177
|
-
LayoutBlockContainer["STATIC"] = "static";
|
|
178
|
-
LayoutBlockContainer["FLUID"] = "fluid";
|
|
179
|
-
LayoutBlockContainer["NONE"] = "none";
|
|
180
|
-
})(exports.LayoutBlockContainer || (exports.LayoutBlockContainer = {}));
|
|
181
|
-
|
|
182
|
-
exports.LayoutContainerVariation = void 0;
|
|
183
|
-
(function (LayoutContainerVariation) {
|
|
184
|
-
LayoutContainerVariation["STATIC"] = "static";
|
|
185
|
-
LayoutContainerVariation["FLUID"] = "fluid";
|
|
186
|
-
LayoutContainerVariation["NONE"] = "none";
|
|
187
|
-
})(exports.LayoutContainerVariation || (exports.LayoutContainerVariation = {}));
|
|
188
|
-
|
|
189
|
-
exports.LayoutContainerMaxWidth = void 0;
|
|
190
|
-
(function (LayoutContainerMaxWidth) {
|
|
191
|
-
LayoutContainerMaxWidth["WIDTH_1200"] = "1200";
|
|
192
|
-
LayoutContainerMaxWidth["WIDTH_1400"] = "1400";
|
|
193
|
-
})(exports.LayoutContainerMaxWidth || (exports.LayoutContainerMaxWidth = {}));
|
|
194
|
-
|
|
195
175
|
exports.NotificationAlertHeadingLevel = void 0;
|
|
196
176
|
(function (NotificationAlertHeadingLevel) {
|
|
197
177
|
NotificationAlertHeadingLevel["H1"] = "h1";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
1
2
|
/* http://meyerweb.com/eric/tools/css/reset/
|
|
2
3
|
v2.0 | 20110126
|
|
3
4
|
License: none (public domain)
|
|
@@ -755,6 +756,8 @@ body {
|
|
|
755
756
|
--digi--form-checkbox--border-radius: var(--digi--border-radius--tertiary);
|
|
756
757
|
--digi--form-checkbox--padding--block: var(--digi--gutter--small);
|
|
757
758
|
--digi--form-checkbox--padding--inline: var(--digi--gutter--icon);
|
|
759
|
+
display: block;
|
|
760
|
+
width: fit-content;
|
|
758
761
|
}
|
|
759
762
|
:host .digi-form-checkbox {
|
|
760
763
|
--BACKGROUND--DEFAULT: var(--digi--form-checkbox--background-color);
|
|
@@ -829,7 +832,7 @@ body {
|
|
|
829
832
|
}
|
|
830
833
|
|
|
831
834
|
.digi-form-checkbox__label:last-child {
|
|
832
|
-
|
|
835
|
+
padding-bottom: 0.75rem;
|
|
833
836
|
}
|
|
834
837
|
|
|
835
838
|
.digi-form-checkbox__box {
|
|
@@ -870,22 +873,19 @@ body {
|
|
|
870
873
|
opacity: 1;
|
|
871
874
|
}
|
|
872
875
|
|
|
873
|
-
|
|
876
|
+
/* "Äkta" visuell fokusindikator, dvs när elementet har fokus och användaren navigerar med tangentbordet */
|
|
877
|
+
.digi-form-checkbox__input:focus-visible ~ .digi-form-checkbox__label .digi-form-checkbox__box {
|
|
874
878
|
outline: 2px solid black;
|
|
875
879
|
outline-offset: 2px;
|
|
876
880
|
box-shadow: 0px 0px 0px 5px white;
|
|
877
881
|
}
|
|
878
882
|
|
|
879
|
-
|
|
883
|
+
/* "Tvingad" visuell fokusindikator, används främst när fokus sätts programatiskt */
|
|
884
|
+
.digi-form-checkbox--focus-visible .digi-form-checkbox__input:focus ~ .digi-form-checkbox__label .digi-form-checkbox__box {
|
|
880
885
|
outline: 2px solid black;
|
|
881
886
|
outline-offset: 2px;
|
|
882
887
|
box-shadow: 0px 0px 0px 5px white;
|
|
883
888
|
}
|
|
884
|
-
.digi-form-checkbox--layout-block .digi-form-checkbox__input:focus-visible ~ .digi-form-checkbox__label {
|
|
885
|
-
box-shadow: none;
|
|
886
|
-
outline: var(--digi--focus-outline);
|
|
887
|
-
background-color: var(--digi--form-checkbox--label--background-color--hover);
|
|
888
|
-
}
|
|
889
889
|
|
|
890
890
|
.digi-form-checkbox__description {
|
|
891
891
|
max-width: var(--digi--paragraph-width--medium);
|
|
@@ -14,6 +14,8 @@ export class FormCheckbox {
|
|
|
14
14
|
constructor() {
|
|
15
15
|
this.dirty = false;
|
|
16
16
|
this.touched = false;
|
|
17
|
+
this.focusVisible = false;
|
|
18
|
+
this.focusMethod = null;
|
|
17
19
|
this.afInputRef = undefined;
|
|
18
20
|
this.afLabel = undefined;
|
|
19
21
|
this.afVariation = FormCheckboxVariation.PRIMARY;
|
|
@@ -52,7 +54,16 @@ export class FormCheckbox {
|
|
|
52
54
|
* @en Listens for when focus is set on the custom element and propagates it down to the actual input element.
|
|
53
55
|
*/
|
|
54
56
|
focusOnInput() {
|
|
57
|
+
this.focusVisible = this.focusMethod !== 'pointer';
|
|
55
58
|
this._input.focus();
|
|
59
|
+
this.focusMethod = null;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Lyssnar på pointerdown för att kunna avgöra om fokus sätts via tangentbord eller mus/pekinteraktion.
|
|
63
|
+
* @en Listens for pointerdown to determine if focus is set via keyboard or mouse/touch interaction.
|
|
64
|
+
*/
|
|
65
|
+
handlePointerDown() {
|
|
66
|
+
this.focusMethod = 'pointer';
|
|
56
67
|
}
|
|
57
68
|
componentWillLoad() {
|
|
58
69
|
this.value = this.afValue;
|
|
@@ -65,6 +76,7 @@ export class FormCheckbox {
|
|
|
65
76
|
}
|
|
66
77
|
get cssModifiers() {
|
|
67
78
|
return {
|
|
79
|
+
'digi-form-checkbox--focus-visible': this.focusVisible,
|
|
68
80
|
'digi-form-checkbox--error': this.afValidation === FormCheckboxValidation.ERROR,
|
|
69
81
|
'digi-form-checkbox--warning': this.afValidation === FormCheckboxValidation.WARNING,
|
|
70
82
|
'digi-form-checkbox--primary': this.afVariation === FormCheckboxVariation.PRIMARY,
|
|
@@ -98,7 +110,7 @@ export class FormCheckbox {
|
|
|
98
110
|
this.afOnInput.emit(e);
|
|
99
111
|
}
|
|
100
112
|
render() {
|
|
101
|
-
return (h(Host, { key: '
|
|
113
|
+
return (h(Host, { key: '8d6f8c5187b356f6c17794a9c154daf8f84b220b', tabindex: -1 }, h("div", { key: '7b94a1ae8f7d414393b789ef604212c1bbc09065', class: Object.assign({ 'digi-form-checkbox': true }, this.cssModifiers) }, h("input", { key: '6413ab9c80d4bc22396273ef1fa200ea3c40beb8', class: "digi-form-checkbox__input", ref: (el) => {
|
|
102
114
|
var _a;
|
|
103
115
|
this._input = el;
|
|
104
116
|
(_a = this === null || this === void 0 ? void 0 : this.afInputRef) === null || _a === void 0 ? void 0 : _a.call(this, el);
|
|
@@ -106,7 +118,7 @@ export class FormCheckbox {
|
|
|
106
118
|
? null
|
|
107
119
|
: `${this.afAriaDescribedby ? `${this.afAriaDescribedby} ` : ''}${this.afDescription ? `${this.afId}-description` : ''}`, "aria-labelledby": this.afAriaLabelledby, "aria-label": this.afAriaLabel, "aria-invalid": this.afValidation === FormCheckboxValidation.ERROR
|
|
108
120
|
? 'true'
|
|
109
|
-
: '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: '3637760582c4a4dbc085a4e097e4e50cb1ae1ab9', htmlFor: this.afId, class: "digi-form-checkbox__label" }, h("span", { key: '197c7997b4f660eb4e4e6a537a2cc826bc62893c', class: "digi-form-checkbox__box" }), this.afLabel), !!this.afDescription && (h("p", { key: 'ed8147d1a5c3ba6c8a05c9f821aa11c5aec13d47', id: `${this.afId}-description`, class: "digi-form-checkbox__description" }, this.afDescription)))));
|
|
110
122
|
}
|
|
111
123
|
static get is() { return "digi-form-checkbox"; }
|
|
112
124
|
static get encapsulation() { return "scoped"; }
|
|
@@ -576,7 +588,9 @@ export class FormCheckbox {
|
|
|
576
588
|
static get states() {
|
|
577
589
|
return {
|
|
578
590
|
"dirty": {},
|
|
579
|
-
"touched": {}
|
|
591
|
+
"touched": {},
|
|
592
|
+
"focusVisible": {},
|
|
593
|
+
"focusMethod": {}
|
|
580
594
|
};
|
|
581
595
|
}
|
|
582
596
|
static get events() {
|
|
@@ -771,6 +785,12 @@ export class FormCheckbox {
|
|
|
771
785
|
"target": undefined,
|
|
772
786
|
"capture": false,
|
|
773
787
|
"passive": false
|
|
788
|
+
}, {
|
|
789
|
+
"name": "pointerdown",
|
|
790
|
+
"method": "handlePointerDown",
|
|
791
|
+
"target": undefined,
|
|
792
|
+
"capture": false,
|
|
793
|
+
"passive": true
|
|
774
794
|
}];
|
|
775
795
|
}
|
|
776
796
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
1
2
|
/* http://meyerweb.com/eric/tools/css/reset/
|
|
2
3
|
v2.0 | 20110126
|
|
3
4
|
License: none (public domain)
|
|
@@ -21,6 +22,8 @@ License: none (public domain)
|
|
|
21
22
|
--digi--form-radiobutton--padding: var(--digi--gutter--icon);
|
|
22
23
|
--digi--form-radiobutton--padding--block: var(--digi--gutter--small);
|
|
23
24
|
--digi--form-radiobutton--padding--inline: var(--digi--gutter--icon);
|
|
25
|
+
display: block;
|
|
26
|
+
width: fit-content;
|
|
24
27
|
}
|
|
25
28
|
:host .digi-form-radiobutton {
|
|
26
29
|
--BACKGROUND--DEFAULT: var(--digi--form-radiobutton--background-color);
|
|
@@ -64,7 +67,7 @@ License: none (public domain)
|
|
|
64
67
|
color: var(--digi--color--text--primary);
|
|
65
68
|
font-weight: var(--digi--typography--body--font-weight--desktop);
|
|
66
69
|
cursor: pointer;
|
|
67
|
-
|
|
70
|
+
padding-bottom: 0.75rem;
|
|
68
71
|
}
|
|
69
72
|
|
|
70
73
|
.digi-form-radiobutton__circle {
|
|
@@ -82,13 +85,15 @@ License: none (public domain)
|
|
|
82
85
|
transform: translateY(1px);
|
|
83
86
|
}
|
|
84
87
|
|
|
88
|
+
/* "Äkta" visuell fokusindikator, dvs när elementet har fokus och användaren navigerar med tangentbordet */
|
|
85
89
|
.digi-form-radiobutton__input:focus-visible ~ .digi-form-radiobutton__label .digi-form-radiobutton__circle {
|
|
86
90
|
outline: 2px solid black;
|
|
87
91
|
outline-offset: 2px;
|
|
88
92
|
box-shadow: 0px 0px 0px 5px white;
|
|
89
93
|
}
|
|
90
94
|
|
|
91
|
-
|
|
95
|
+
/* "Tvingad" visuell fokusindikator, används främst när fokus sätts programatiskt */
|
|
96
|
+
.digi-form-radiobutton--focus-visible .digi-form-radiobutton__input:focus ~ .digi-form-radiobutton__label .digi-form-radiobutton__circle {
|
|
92
97
|
outline: 2px solid black;
|
|
93
98
|
outline-offset: 2px;
|
|
94
99
|
box-shadow: 0px 0px 0px 5px white;
|
|
@@ -14,6 +14,8 @@ export class FormRadiobutton {
|
|
|
14
14
|
constructor() {
|
|
15
15
|
this.dirty = false;
|
|
16
16
|
this.touched = false;
|
|
17
|
+
this.focusVisible = false;
|
|
18
|
+
this.focusMethod = null;
|
|
17
19
|
this.afLabel = undefined;
|
|
18
20
|
this.afVariation = FormRadiobuttonVariation.PRIMARY;
|
|
19
21
|
this.afLayout = FormRadiobuttonLayout.INLINE;
|
|
@@ -50,13 +52,23 @@ export class FormRadiobutton {
|
|
|
50
52
|
* @en Listens for when focus is set on the custom element and propagates it down to the actual input element.
|
|
51
53
|
*/
|
|
52
54
|
focusOnInput() {
|
|
55
|
+
this.focusVisible = this.focusMethod !== 'pointer';
|
|
53
56
|
this._input.focus();
|
|
57
|
+
this.focusMethod = null;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Lyssnar på pointerdown för att kunna avgöra om fokus sätts via tangentbord eller mus/pekinteraktion.
|
|
61
|
+
* @en Listens for pointerdown to determine if focus is set via keyboard or mouse/touch interaction.
|
|
62
|
+
*/
|
|
63
|
+
pointerDownHandler() {
|
|
64
|
+
this.focusMethod = 'pointer';
|
|
54
65
|
}
|
|
55
66
|
componentDidLoad() {
|
|
56
67
|
this.afOnReady.emit();
|
|
57
68
|
}
|
|
58
69
|
get cssModifiers() {
|
|
59
70
|
return {
|
|
71
|
+
'digi-form-radiobutton--focus-visible': this.focusVisible,
|
|
60
72
|
'digi-form-radiobutton--error': this.afValidation === FormRadiobuttonValidation.ERROR,
|
|
61
73
|
'digi-form-radiobutton--primary': this.afVariation === FormRadiobuttonVariation.PRIMARY,
|
|
62
74
|
'digi-form-radiobutton--secondary': this.afVariation === FormRadiobuttonVariation.SECONDARY,
|
|
@@ -87,9 +99,9 @@ export class FormRadiobutton {
|
|
|
87
99
|
this.afOnInput.emit(e);
|
|
88
100
|
}
|
|
89
101
|
render() {
|
|
90
|
-
return (h(Host, { key: '
|
|
102
|
+
return (h(Host, { key: 'f70124a9cc34980f21e1a00e0fe6ee05c9357bee', tabindex: -1 }, h("div", { key: 'fd9dcdf5855ef66bc3e3904e33ccf6465e4cf3d5', class: Object.assign({ 'digi-form-radiobutton': true }, this.cssModifiers) }, h("input", { key: '4e8e9c2cf1376b2a1d50cd997ee5bc5667c189cf', class: "digi-form-radiobutton__input", ref: (el) => (this._input = el), onInput: (e) => this.inputHandler(e), onBlur: (e) => this.blurHandler(e), onChange: (e) => this.changeHandler(e), onFocus: (e) => this.focusHandler(e), onFocusout: (e) => this.focusoutHandler(e), "aria-describedby": this.afAriaDescribedby, "aria-labelledby": this.afAriaLabelledby, "aria-invalid": this.afValidation === FormRadiobuttonValidation.ERROR
|
|
91
103
|
? 'true'
|
|
92
|
-
: 'false', required: this.afRequired, id: this.afId, name: this.afName, type: "radio", checked: this.afChecked, value: this.afValue, autofocus: this.afAutofocus ? this.afAutofocus : null }), h("label", { key: '
|
|
104
|
+
: 'false', required: this.afRequired, id: this.afId, name: this.afName, type: "radio", checked: this.afChecked, value: this.afValue, autofocus: this.afAutofocus ? this.afAutofocus : null }), h("label", { key: 'ca650fef6df415c4372f6850792c39d0ed6e7bf3', htmlFor: this.afId, class: "digi-form-radiobutton__label" }, h("span", { key: '62fde4290dd8e0ada2f538c86dfcc167e25565c1', class: "digi-form-radiobutton__circle" }), this.afLabel))));
|
|
93
105
|
}
|
|
94
106
|
static get is() { return "digi-form-radiobutton"; }
|
|
95
107
|
static get encapsulation() { return "scoped"; }
|
|
@@ -445,7 +457,9 @@ export class FormRadiobutton {
|
|
|
445
457
|
static get states() {
|
|
446
458
|
return {
|
|
447
459
|
"dirty": {},
|
|
448
|
-
"touched": {}
|
|
460
|
+
"touched": {},
|
|
461
|
+
"focusVisible": {},
|
|
462
|
+
"focusMethod": {}
|
|
449
463
|
};
|
|
450
464
|
}
|
|
451
465
|
static get events() {
|
|
@@ -643,6 +657,12 @@ export class FormRadiobutton {
|
|
|
643
657
|
"target": undefined,
|
|
644
658
|
"capture": false,
|
|
645
659
|
"passive": false
|
|
660
|
+
}, {
|
|
661
|
+
"name": "pointerdown",
|
|
662
|
+
"method": "pointerDownHandler",
|
|
663
|
+
"target": undefined,
|
|
664
|
+
"capture": false,
|
|
665
|
+
"passive": true
|
|
646
666
|
}];
|
|
647
667
|
}
|
|
648
668
|
}
|