@uh-design-system/component-library 0.4.2 → 0.5.1
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/dist/cjs/component-library.cjs.js +2 -2
- package/dist/cjs/ds-accordion_3.cjs.entry.js +11 -11
- package/dist/cjs/ds-checkbox-group.cjs.entry.js +15 -16
- package/dist/cjs/ds-checkbox.cjs.entry.js +42 -35
- package/dist/cjs/ds-input-validity.cjs.entry.js +4 -6
- package/dist/cjs/ds-link-with-arrow.cjs.entry.js +5 -5
- package/dist/cjs/ds-link.cjs.entry.js +5 -5
- package/dist/cjs/ds-text-input.cjs.entry.js +52 -24
- package/dist/cjs/ds-visually-hidden.cjs.entry.js +2 -2
- package/dist/cjs/{index-b2bddcf4.js → index-bf84b124.js} +16 -0
- package/dist/cjs/index.cjs.js +8 -0
- package/dist/cjs/{linkUtils-e911e899.js → linkUtils-695da37c.js} +0 -10
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/store-9bd20f3c.js +207 -0
- package/dist/cjs/{utils-c9113835.js → utils-2ba5e075.js} +10 -0
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/00-foundations/icons/icons.stories.js +1 -0
- package/dist/collection/components/00-foundations/types.js +1 -0
- package/dist/collection/components/01-base-components/ds-accordion/ds-accordion.js +6 -6
- package/dist/collection/components/01-base-components/ds-button/ds-button.css +6 -0
- package/dist/collection/components/01-base-components/ds-button/ds-button.js +1 -1
- package/dist/collection/components/01-base-components/ds-checkbox/ds-checkbox.css +1 -1
- package/dist/collection/components/01-base-components/ds-checkbox/ds-checkbox.js +68 -56
- package/dist/collection/components/01-base-components/ds-checkbox/stories/ds-checkbox.stories.js +1 -0
- package/dist/collection/components/01-base-components/ds-checkbox-group/ds-checkbox-group.js +27 -67
- package/dist/collection/components/01-base-components/ds-icon/ds-icon.js +1 -1
- package/dist/collection/components/01-base-components/ds-input-validity/ds-input-validity.js +5 -8
- package/dist/collection/components/01-base-components/ds-input-validity/stories/ds-input-validity.stories.js +1 -0
- package/dist/collection/components/01-base-components/ds-link/ds-link.js +6 -6
- package/dist/collection/components/01-base-components/ds-link/stories/ds-link.stories.js +1 -1
- package/dist/collection/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.js +6 -6
- package/dist/collection/components/01-base-components/ds-link-with-arrow/stories/ds-link-with-arrow.stories.js +1 -1
- package/dist/collection/components/01-base-components/ds-text-input/ds-text-input.css +6 -0
- package/dist/collection/components/01-base-components/ds-text-input/ds-text-input.js +73 -27
- package/dist/collection/components/01-base-components/ds-text-input/stories/ds-text-input.examples.stories.js +82 -13
- package/dist/collection/components/01-base-components/ds-text-input/stories/ds-text-input.stories.js +6 -7
- package/dist/collection/components/01-base-components/ds-text-input/utils.js +1 -10
- package/dist/collection/components/01-base-components/ds-visually-hidden/ds-visually-hidden.js +1 -1
- package/dist/collection/index.js +1 -1
- package/dist/collection/store.js +13 -0
- package/dist/collection/utils/link/linkUtils.js +0 -9
- package/dist/collection/utils/utils.js +9 -0
- package/dist/component-library/component-library.esm.js +1 -1
- package/dist/component-library/ds-accordion_3.entry.js +1 -1
- package/dist/component-library/ds-checkbox-group.entry.js +1 -1
- package/dist/component-library/ds-checkbox.entry.js +1 -1
- package/dist/component-library/ds-input-validity.entry.js +1 -1
- package/dist/component-library/ds-link-with-arrow.entry.js +1 -1
- package/dist/component-library/ds-link.entry.js +1 -1
- package/dist/component-library/ds-text-input.entry.js +1 -1
- package/dist/component-library/ds-visually-hidden.entry.js +1 -1
- package/dist/component-library/{index-50783b0c.js → index-434995e1.js} +2 -2
- package/dist/component-library/index.esm.js +1 -0
- package/dist/component-library/{linkUtils-fe63ff72.js → linkUtils-3d1b28cf.js} +1 -1
- package/dist/component-library/store-b8d17c10.js +1 -0
- package/dist/component-library/utils-5daa5bc0.js +1 -0
- package/dist/components/ds-accordion.js +6 -6
- package/dist/components/ds-button2.js +2 -2
- package/dist/components/ds-checkbox-group.js +21 -23
- package/dist/components/ds-checkbox2.js +44 -37
- package/dist/components/ds-icon2.js +11 -2
- package/dist/components/ds-input-validity2.js +4 -6
- package/dist/components/ds-link-with-arrow.js +5 -5
- package/dist/components/ds-link.js +5 -5
- package/dist/components/ds-text-input.js +58 -29
- package/dist/components/ds-visually-hidden2.js +1 -1
- package/dist/components/index.js +1 -0
- package/dist/components/index2.js +15 -1
- package/dist/components/linkUtils.js +1 -10
- package/dist/components/store.js +204 -0
- package/dist/esm/component-library.js +3 -3
- package/dist/esm/ds-accordion_3.entry.js +11 -11
- package/dist/esm/ds-checkbox-group.entry.js +15 -16
- package/dist/esm/ds-checkbox.entry.js +42 -35
- package/dist/esm/ds-input-validity.entry.js +4 -6
- package/dist/esm/ds-link-with-arrow.entry.js +5 -5
- package/dist/esm/ds-link.entry.js +5 -5
- package/dist/esm/ds-text-input.entry.js +52 -24
- package/dist/esm/ds-visually-hidden.entry.js +2 -2
- package/dist/esm/{index-50783b0c.js → index-434995e1.js} +15 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/{linkUtils-fe63ff72.js → linkUtils-3d1b28cf.js} +1 -10
- package/dist/esm/loader.js +3 -3
- package/dist/esm/store-b8d17c10.js +204 -0
- package/dist/esm/{utils-b5843ae1.js → utils-5daa5bc0.js} +10 -1
- package/dist/types/components/00-foundations/types.d.ts +3 -0
- package/dist/types/components/01-base-components/ds-checkbox/ds-checkbox.d.ts +14 -14
- package/dist/types/components/01-base-components/ds-checkbox-group/ds-checkbox-group.d.ts +14 -16
- package/dist/types/components/01-base-components/ds-link/ds-link.d.ts +1 -1
- package/dist/types/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.d.ts +1 -1
- package/dist/types/components/01-base-components/ds-text-input/ds-text-input.d.ts +17 -8
- package/dist/types/components/01-base-components/ds-text-input/stories/ds-text-input.examples.stories.d.ts +1 -0
- package/dist/types/components/01-base-components/ds-text-input/utils.d.ts +1 -1
- package/dist/types/components.d.ts +42 -28
- package/dist/types/index.d.ts +1 -0
- package/dist/types/store.d.ts +10 -0
- package/dist/types/utils/link/linkUtils.d.ts +0 -1
- package/dist/types/utils/utils.d.ts +1 -0
- package/package.json +3 -2
- package/dist/component-library/utils-b5843ae1.js +0 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H,
|
|
1
|
+
import { p as proxyCustomElement, H, d as createEvent, h, F as Fragment } from './index2.js';
|
|
2
2
|
import { c as classNames } from './index3.js';
|
|
3
3
|
import { i as inheritAriaAttributes } from './attributes.js';
|
|
4
|
-
import { i as idGenerator, d as defineCustomElement$2 } from './ds-icon2.js';
|
|
5
4
|
import { g as getRequiredText, a as getOptionalText } from './controlUtils.js';
|
|
5
|
+
import { i as isValidation } from './store.js';
|
|
6
|
+
import { g as getAriaLabel, i as idGenerator, d as defineCustomElement$2 } from './ds-icon2.js';
|
|
6
7
|
import { d as defineCustomElement$1 } from './ds-input-validity2.js';
|
|
7
8
|
|
|
8
|
-
const dsCheckboxCss = ".ds-checkbox-fieldset{display:inline-flex;flex-direction:column;border:none;padding:0;margin:0;gap:var(--ds-spacing-3xSmall)}.ds-checkbox-fieldset__legend{padding-inline:0;font-size:var(--ds-fontSize-16);font-weight:var(--ds-fontWeight-semibold);letter-spacing:var(--ds-letterSpacing-wide);line-height:var(--ds-lineHeight-large)}.ds-checkbox-fieldset__assistive-text{display:inline;font-size:var(--ds-fontSize-14);color:var(--ds-textColor-secondary);line-height:var(--ds-lineHeight-large)}.ds-checkbox{display:inline-flex;align-self:flex-start;align-items:center;flex-direction:row;flex-wrap:nowrap;text-wrap:
|
|
9
|
+
const dsCheckboxCss = ".ds-checkbox-fieldset{display:inline-flex;flex-direction:column;border:none;padding:0;margin:0;gap:var(--ds-spacing-3xSmall)}.ds-checkbox-fieldset__legend{padding-inline:0;font-size:var(--ds-fontSize-16);font-weight:var(--ds-fontWeight-semibold);letter-spacing:var(--ds-letterSpacing-wide);line-height:var(--ds-lineHeight-large)}.ds-checkbox-fieldset__assistive-text{display:inline;font-size:var(--ds-fontSize-14);color:var(--ds-textColor-secondary);line-height:var(--ds-lineHeight-large)}.ds-checkbox{display:inline-flex;align-self:flex-start;align-items:center;flex-direction:row;flex-wrap:nowrap;text-wrap:wrap;position:relative;cursor:pointer;user-select:none;width:auto;padding:var(--ds-spacing-xSmall)}.ds-checkbox--no-margin .ds-checkbox__input{margin-right:0}.ds-checkbox--disabled{color:var(--ds-textColor-disabled-onLight)}.ds-checkbox__span--optional{color:var(--ds-textColor-secondary);font-size:var(--ds-fontSize-14)}.ds-checkbox:has(.ds-checkbox__input:disabled){cursor:not-allowed}.ds-checkbox__input{cursor:pointer;-webkit-appearance:none;appearance:none;background-color:var(--ds-bgColor-white);margin:0;display:grid;place-content:center;height:24px;width:24px;margin-right:var(--ds-spacing-xSmall);border-width:var(--ds-borderWidth-thin);border-style:solid;border-color:var(--ds-palette-black-50);}.ds-checkbox__input:focus-visible{box-shadow:0 0 0 var(--ds-borderWidth-thin) var(--ds-borderColor-white);outline-color:var(--ds-borderColor-black);outline-offset:var(--ds-borderWidth-thin);outline-style:solid;outline-width:var(--ds-borderWidth-thin)}.ds-checkbox__input:hover,.ds-checkbox__input:active{border-color:var(--ds-borderColor-default)}.ds-checkbox__input:hover{background-color:var(--ds-bgColor-white-hover)}.ds-checkbox__input:active{background-color:var(--ds-bgColor-white-active)}.ds-checkbox__input:disabled{background-color:var(--ds-bgColor-disabled-onLight);border-color:var(--ds-borderColor-disabled-onLight)}@media (forced-colors: active){.ds-checkbox__input:disabled{border-color:GrayText}}.ds-checkbox__input:checked,.ds-checkbox__input:indeterminate{background-color:var(--ds-bgColor-primary);border-color:var(--ds-borderColor-transparent)}.ds-checkbox__input:checked:hover,.ds-checkbox__input:indeterminate:hover{background-color:var(--ds-bgColor-primary-hover)}.ds-checkbox__input:checked:active,.ds-checkbox__input:indeterminate:active{background-color:var(--ds-bgColor-primary-active)}.ds-checkbox__input:checked:disabled,.ds-checkbox__input:indeterminate:disabled{background-color:var(--ds-bgColor-disabled-onLight)}.ds-checkbox__input:user-invalid,.ds-checkbox__input--invalid,.ds-checkbox__input--invalid:checked,.ds-checkbox__input--invalid:indeterminate{border-color:var(--ds-borderColor-danger)}.ds-checkbox__input:disabled{cursor:not-allowed;color:var(--ds-textColor-disabled-onLight)}.ds-checkbox__input::before{content:\"\";display:block;height:1em;width:1em;background-size:contain;background-repeat:no-repeat;background-position:center}.ds-checkbox__input:checked::before{background-image:url(\"data:image/svg+xml;charset=utf-8,<svg width='16' height='13' viewBox='0 0 16 13' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M5.99997 7.87871L13.606 0.272705L15.7273 2.39403L5.99997 12.1214L0.272644 6.39402L2.39396 4.27271L5.99997 7.87871Z' fill='%23ffffff' /></svg>\")}.ds-checkbox__input:checked:disabled::before{background-image:url(\"data:image/svg+xml;charset=utf-8,<svg width='16' height='13' viewBox='0 0 16 13' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M5.99997 7.87871L13.606 0.272705L15.7273 2.39403L5.99997 12.1214L0.272644 6.39402L2.39396 4.27271L5.99997 7.87871Z' fill='%23999999' /></svg>\")}.ds-checkbox__input:indeterminate::before{background-image:url(\"data:image/svg+xml;charset=utf-8,<svg width='14' height='4' viewBox='0 0 14 4' xmlns='http://www.w3.org/2000/svg'><rect width='13.3333' height='3' transform='matrix(1 0 0 -1 0.333313 3.5)' fill='%23ffffff' /></svg>\")}.ds-checkbox__input:indeterminate:disabled::before{background-image:url(\"data:image/svg+xml;charset=utf-8,<svg width='14' height='4' viewBox='0 0 14 4' xmlns='http://www.w3.org/2000/svg'><rect width='13.3333' height='3' transform='matrix(1 0 0 -1 0.333313 3.5)' fill='%23999999' /></svg>\")}.ds-checkbox-error{display:flex}.ds-checkbox-error--visible{padding-top:var(--ds-spacing-3xSmall);padding-left:var(--ds-spacing-xSmall)}";
|
|
9
10
|
const DsCheckboxStyle0 = dsCheckboxCss;
|
|
10
11
|
|
|
11
12
|
const checkboxIdGenerator = idGenerator('ds-checkbox');
|
|
@@ -14,21 +15,20 @@ const DsCheckbox = proxyCustomElement(class DsCheckbox extends H {
|
|
|
14
15
|
super();
|
|
15
16
|
this.__registerHost();
|
|
16
17
|
this.__attachShadow();
|
|
17
|
-
this.
|
|
18
|
-
this.dsCheckboxError = createEvent(this, "dsCheckboxError", 7);
|
|
18
|
+
this.dsCheckboxInput = createEvent(this, "dsCheckboxInput", 7);
|
|
19
19
|
this.internals = this.attachInternals();
|
|
20
20
|
}
|
|
21
|
+
inputElem;
|
|
21
22
|
labelId;
|
|
22
|
-
|
|
23
|
+
inputValidityId;
|
|
23
24
|
assistiveTextId;
|
|
24
25
|
inheritedAttributes = {};
|
|
25
26
|
initialChecked;
|
|
26
|
-
|
|
27
|
+
labelClicked = false;
|
|
27
28
|
get el() { return this; }
|
|
28
29
|
internals;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
checkboxId;
|
|
30
|
+
dsCheckboxInput;
|
|
31
|
+
identifier = checkboxIdGenerator.next().value;
|
|
32
32
|
checked = false;
|
|
33
33
|
legend;
|
|
34
34
|
assistiveText;
|
|
@@ -44,12 +44,11 @@ const DsCheckbox = proxyCustomElement(class DsCheckbox extends H {
|
|
|
44
44
|
value = this.checked.toString();
|
|
45
45
|
validationMessage;
|
|
46
46
|
setIds = () => {
|
|
47
|
-
this.
|
|
48
|
-
this.
|
|
49
|
-
this.
|
|
50
|
-
this.assistiveTextId = `${this.checkboxId}-assistive-text`;
|
|
47
|
+
this.labelId = `${this.identifier}-label`;
|
|
48
|
+
this.inputValidityId = `${this.identifier}-validity`;
|
|
49
|
+
this.assistiveTextId = `${this.identifier}-assistive-text`;
|
|
51
50
|
};
|
|
52
|
-
|
|
51
|
+
getValidationMessage = () => (!this.errorsDisabled ? this.errorText || this.internals?.validationMessage || this.inputElem?.validationMessage : '');
|
|
53
52
|
getLegendText = () => {
|
|
54
53
|
if (this.required) {
|
|
55
54
|
return getRequiredText(this.legend);
|
|
@@ -71,7 +70,7 @@ const DsCheckbox = proxyCustomElement(class DsCheckbox extends H {
|
|
|
71
70
|
}
|
|
72
71
|
return this.text;
|
|
73
72
|
};
|
|
74
|
-
getAriaDescribedBy = () => [Boolean(this.assistiveText) && this.assistiveTextId, Boolean(this.
|
|
73
|
+
getAriaDescribedBy = () => [Boolean(this.assistiveText) && this.assistiveTextId, Boolean(this.getValidationMessage()) && this.inputValidityId].filter(Boolean).join(' ');
|
|
75
74
|
restoreInitialState = () => {
|
|
76
75
|
this.checked = this.initialChecked;
|
|
77
76
|
this.value = this.checked.toString();
|
|
@@ -83,34 +82,43 @@ const DsCheckbox = proxyCustomElement(class DsCheckbox extends H {
|
|
|
83
82
|
this.value = this.checked.toString();
|
|
84
83
|
this.internals?.setFormValue(this.value);
|
|
85
84
|
};
|
|
86
|
-
emitCheckboxError = () => {
|
|
87
|
-
this.dsCheckboxError.emit(this.getErrorText());
|
|
88
|
-
};
|
|
89
85
|
formResetCallback() {
|
|
90
86
|
this.restoreInitialState();
|
|
91
87
|
}
|
|
92
88
|
componentWillLoad() {
|
|
93
89
|
this.setInitialState();
|
|
94
90
|
this.setIds();
|
|
95
|
-
this.inheritedAttributes = inheritAriaAttributes(this.el, ['aria-label', 'aria-describedby', 'aria-hidden']);
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
this.el.removeAttribute('aria-label');
|
|
100
|
-
}
|
|
101
|
-
componentDidUpdate() {
|
|
102
|
-
this.emitCheckboxError();
|
|
91
|
+
this.inheritedAttributes = inheritAriaAttributes(this.el, ['aria-label', 'aria-describedby', 'aria-hidden', 'aria-invalid']);
|
|
92
|
+
if (isValidation('server') || this.errorText) {
|
|
93
|
+
this.validationMessage = this.getValidationMessage();
|
|
94
|
+
}
|
|
103
95
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
this.
|
|
96
|
+
handleInput = (e) => {
|
|
97
|
+
const target = e.target;
|
|
98
|
+
this.checked = target.checked;
|
|
99
|
+
this.value = target.checked.toString();
|
|
107
100
|
this.internals?.setFormValue(this.value);
|
|
108
|
-
this.
|
|
101
|
+
this.dsCheckboxInput.emit({ id: this.identifier, checked: target.checked });
|
|
102
|
+
if (isValidation('client') && this.validationMessage) {
|
|
103
|
+
this.validationMessage = this.getValidationMessage();
|
|
104
|
+
}
|
|
109
105
|
};
|
|
110
106
|
handleKeyUp = (event) => {
|
|
111
107
|
if (event.key === 'Enter') {
|
|
112
|
-
this.
|
|
108
|
+
this.inputElem.dispatchEvent(new Event('input'));
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
handleBlur = () => {
|
|
112
|
+
if (isValidation('client') && !this.labelClicked) {
|
|
113
|
+
this.validationMessage = this.getValidationMessage();
|
|
113
114
|
}
|
|
115
|
+
this.labelClicked = false;
|
|
116
|
+
};
|
|
117
|
+
handleMouseDown = () => {
|
|
118
|
+
this.labelClicked = true;
|
|
119
|
+
};
|
|
120
|
+
handleMouseUp = () => {
|
|
121
|
+
this.labelClicked = false;
|
|
114
122
|
};
|
|
115
123
|
renderCheckbox() {
|
|
116
124
|
const classes = classNames('ds-checkbox', {
|
|
@@ -120,12 +128,11 @@ const DsCheckbox = proxyCustomElement(class DsCheckbox extends H {
|
|
|
120
128
|
const inputClasses = classNames('ds-checkbox__input', {
|
|
121
129
|
'ds-checkbox__input--invalid': Boolean(this.errorText),
|
|
122
130
|
});
|
|
123
|
-
const errorText = this.getErrorText();
|
|
124
131
|
const errorClasses = classNames('ds-checkbox-error', {
|
|
125
|
-
'ds-checkbox-error--visible': Boolean(
|
|
132
|
+
'ds-checkbox-error--visible': Boolean(this.validationMessage),
|
|
126
133
|
});
|
|
127
134
|
const ariaDescribedBy = this.getAriaDescribedBy();
|
|
128
|
-
return (h(Fragment, null, h("div", null, h("label", { id: this.labelId, class: classes }, h("input", { ref: inputElem => (this.inputElem = inputElem), type: "checkbox", class: inputClasses, checked: this.checked, indeterminate: this.indeterminate,
|
|
135
|
+
return (h(Fragment, null, h("div", null, h("label", { id: this.labelId, class: classes, onMouseDown: this.handleMouseDown, onMouseUp: this.handleMouseUp }, h("input", { ref: inputElem => (this.inputElem = inputElem), type: "checkbox", class: inputClasses, checked: this.checked, indeterminate: this.indeterminate, onInput: this.handleInput, onKeyUp: this.handleKeyUp, onBlur: this.handleBlur, value: this.value, disabled: this.disabled, required: this.required, id: this.identifier, "aria-describedby": ariaDescribedBy, "aria-label": getAriaLabel(this.getCheckboxText(), this.ariaLabel), "aria-invalid": this.errorText ? true : undefined, ...this.inheritedAttributes }), this.getCheckboxText())), !this.errorsDisabled && (h("div", { class: errorClasses }, h("ds-input-validity", { id: this.inputValidityId, text: this.validationMessage, type: "error", role: "alert" })))));
|
|
129
136
|
}
|
|
130
137
|
renderFieldset() {
|
|
131
138
|
const fieldsetClasses = classNames('ds-checkbox-fieldset');
|
|
@@ -142,7 +149,7 @@ const DsCheckbox = proxyCustomElement(class DsCheckbox extends H {
|
|
|
142
149
|
static get formAssociated() { return true; }
|
|
143
150
|
static get style() { return DsCheckboxStyle0; }
|
|
144
151
|
}, [65, "ds-checkbox", {
|
|
145
|
-
"
|
|
152
|
+
"identifier": [1, "id"],
|
|
146
153
|
"checked": [1028],
|
|
147
154
|
"legend": [1],
|
|
148
155
|
"assistiveText": [1, "assistive-text"],
|
|
@@ -154,7 +161,7 @@ const DsCheckbox = proxyCustomElement(class DsCheckbox extends H {
|
|
|
154
161
|
"required": [4],
|
|
155
162
|
"optional": [4],
|
|
156
163
|
"optionalText": [1, "optional-text"],
|
|
157
|
-
"ariaLabel": [
|
|
164
|
+
"ariaLabel": [1, "aria-label"],
|
|
158
165
|
"value": [32],
|
|
159
166
|
"validationMessage": [32]
|
|
160
167
|
}]);
|
|
@@ -890,6 +890,15 @@ function* idGenerator(id) {
|
|
|
890
890
|
yield `${id}-${currentId++}`;
|
|
891
891
|
}
|
|
892
892
|
}
|
|
893
|
+
const getAriaLabel = (text, ariaLabel) => {
|
|
894
|
+
if (!ariaLabel) {
|
|
895
|
+
return undefined;
|
|
896
|
+
}
|
|
897
|
+
if (ariaLabel.startsWith(text)) {
|
|
898
|
+
return ariaLabel;
|
|
899
|
+
}
|
|
900
|
+
return [text, ariaLabel].join(' ');
|
|
901
|
+
};
|
|
893
902
|
|
|
894
903
|
const dsIconCss = ":host{display:flex}.ds-icon--container{display:flex}";
|
|
895
904
|
const DsIconStyle0 = dsIconCss;
|
|
@@ -946,7 +955,7 @@ const DsIcon = proxyCustomElement(class DsIcon extends H {
|
|
|
946
955
|
}
|
|
947
956
|
}
|
|
948
957
|
render() {
|
|
949
|
-
return (h(Fragment, { key: '
|
|
958
|
+
return (h(Fragment, { key: '58309a22dafbad09a1f9e884657aad264261174e' }, h("span", { key: '3295d61af901e74ea7c39d1e7a4b7e083f44794f', class: "ds-icon--container", innerHTML: this.getIcon(), "aria-hidden": this.hidden ? 'true' : 'false' })));
|
|
950
959
|
}
|
|
951
960
|
static get style() { return DsIconStyle0; }
|
|
952
961
|
}, [1, "ds-icon", {
|
|
@@ -972,4 +981,4 @@ function defineCustomElement() {
|
|
|
972
981
|
} });
|
|
973
982
|
}
|
|
974
983
|
|
|
975
|
-
export { DsIcon as D, defineCustomElement as d, idGenerator as i };
|
|
984
|
+
export { DsIcon as D, defineCustomElement as d, getAriaLabel as g, idGenerator as i };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, h
|
|
1
|
+
import { p as proxyCustomElement, H, h } from './index2.js';
|
|
2
2
|
import { c as classNames } from './index3.js';
|
|
3
|
+
import { i as isValidation } from './store.js';
|
|
3
4
|
import { d as defineCustomElement$1 } from './ds-icon2.js';
|
|
4
5
|
|
|
5
6
|
const dsInputValidityCss = ":root{--ds-breakpoint-xSmall:20rem;--ds-breakpoint-small:30rem;--ds-breakpoint-medium:60rem;--ds-breakpoint-large:75rem;--ds-breakpoint-xLarge:90rem}.ds-input-validity{display:flex;align-items:center;margin-top:var(--ds-spacing-2xSmall);gap:var(--ds-spacing-2xSmall)}.ds-input-validity--error{color:var(--ds-textColor-danger)}.ds-input-validity--success{color:var(--ds-textColor-success)}.ds-input-validity ds-icon{display:block;height:1.5rem}.ds-input-validity small{font-family:var(--ds-fontFamily-body);font-size:var(--ds-fontSize-16);font-weight:var(--ds-fontWeight-regular);letter-spacing:var(--ds-letterSpacing-wide);line-height:var(--ds-lineHeight-large)}";
|
|
@@ -13,7 +14,7 @@ const DsInputValidity = proxyCustomElement(class DsInputValidity extends H {
|
|
|
13
14
|
get el() { return this; }
|
|
14
15
|
text;
|
|
15
16
|
type = 'error';
|
|
16
|
-
validityRole
|
|
17
|
+
validityRole;
|
|
17
18
|
identifier;
|
|
18
19
|
componentDidLoad() {
|
|
19
20
|
this.identifier = this.el.getAttribute('id');
|
|
@@ -25,10 +26,7 @@ const DsInputValidity = proxyCustomElement(class DsInputValidity extends H {
|
|
|
25
26
|
'ds-input-validity--success': this.type === 'success',
|
|
26
27
|
});
|
|
27
28
|
const icon = this.type === 'success' ? 'check_circle_fill' : 'warning_fill';
|
|
28
|
-
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
return (h(Fragment, null, this.text && (h("div", { class: classes, role: this.validityRole }, h("ds-icon", { name: icon }), h("small", { id: this.identifier }, this.text)))));
|
|
29
|
+
return (h("div", { key: '2eca152eca6e7b4d7e894ff8aaf50a6d03c3e44f', role: isValidation('client') ? this.validityRole : undefined }, this.text && (h("div", { key: '73e4cd1b3af6a84b9c7cbca813c166bc10e9dd26', class: classes }, h("ds-icon", { key: '4eaad4001e758837f9e8b1aae48292a1c5a1a08f', name: icon }), h("small", { key: '3ee5d39785454b9aab9ae6012f3ad940c1f18df0', id: this.identifier }, this.text)))));
|
|
32
30
|
}
|
|
33
31
|
static get style() { return DsInputValidityStyle0; }
|
|
34
32
|
}, [0, "ds-input-validity", {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h } from './index2.js';
|
|
2
2
|
import { c as classNames } from './index3.js';
|
|
3
3
|
import { i as inheritAriaAttributes } from './attributes.js';
|
|
4
|
-
import { o as opensInNewTab, v as visuallyHiddenAssistiveText
|
|
5
|
-
import { i as idGenerator, d as defineCustomElement$3 } from './ds-icon2.js';
|
|
4
|
+
import { o as opensInNewTab, v as visuallyHiddenAssistiveText } from './linkUtils.js';
|
|
5
|
+
import { g as getAriaLabel, i as idGenerator, d as defineCustomElement$3 } from './ds-icon2.js';
|
|
6
6
|
import { d as defineCustomElement$2 } from './ds-visually-hidden2.js';
|
|
7
7
|
|
|
8
8
|
const dsLinkWithArrowCss = ":root{--ds-breakpoint-xSmall:20rem;--ds-breakpoint-small:30rem;--ds-breakpoint-medium:60rem;--ds-breakpoint-large:75rem;--ds-breakpoint-xLarge:90rem}:host{display:inline-block}.ds-link-with-arrow{display:inline-flex;align-items:center;color:var(--ds-textColor-link);letter-spacing:var(--ds-letterSpacing-wide);font-weight:var(--ds-fontWeight-semibold);font-size:var(--ds-fontSize-16);text-decoration-line:none}.ds-link-with-arrow:focus-visible{box-shadow:0 0 0 var(--ds-borderWidth-thin) var(--ds-borderColor-white);outline-color:var(--ds-borderColor-black);outline-offset:var(--ds-borderWidth-thin);outline-style:solid;outline-width:var(--ds-borderWidth-thin)}@media (min-width: 30rem){.ds-link-with-arrow{font-size:var(--ds-fontSize-18)}}.ds-link-with-arrow__icon{display:inline-flex;width:2em;height:2em;line-height:0;align-items:center;justify-content:center;color:var(--ds-textColor-white);background-color:var(--ds-bgColor-primary)}.ds-link-with-arrow__icon--start{margin-right:var(--ds-spacing-xSmall)}.ds-link-with-arrow__icon--end{margin-left:var(--ds-spacing-xSmall)}:hover slot>.ds-link-with-arrow__icon{outline:10px solid;background-color:var(--ds-bgColor-primary-hover)}:active slot>.ds-link-with-arrow__icon{background-color:var(--ds-bgColor-primary-active)}.ds-link-with-arrow:hover,.ds-link-with-arrow:active{text-decoration-line:underline;text-decoration-style:solid;text-decoration-skip-ink:auto;text-decoration-thickness:7%;text-underline-offset:12%;text-underline-position:from-font}.ds-link-with-arrow:hover{color:var(--ds-textColor-link-hover)}.ds-link-with-arrow:active,.ds-link-with-arrow:focus-visible{color:var(--ds-textColor-link-active)}";
|
|
@@ -25,7 +25,7 @@ const DsLinkWithArrow$1 = proxyCustomElement(class DsLinkWithArrow extends H {
|
|
|
25
25
|
href;
|
|
26
26
|
target;
|
|
27
27
|
language;
|
|
28
|
-
|
|
28
|
+
ariaLabel;
|
|
29
29
|
componentWillLoad() {
|
|
30
30
|
this.inheritedAttributes = inheritAriaAttributes(this.el, ['aria-label']);
|
|
31
31
|
if (opensInNewTab(this.target)) {
|
|
@@ -39,7 +39,7 @@ const DsLinkWithArrow$1 = proxyCustomElement(class DsLinkWithArrow extends H {
|
|
|
39
39
|
'ds-link-with-arrow__icon--start': this.iconPosition === 'start',
|
|
40
40
|
'ds-link-with-arrow__icon--end': this.iconPosition === 'end',
|
|
41
41
|
});
|
|
42
|
-
return (h("a", { key: '
|
|
42
|
+
return (h("a", { key: 'bce4a90f9cc5113ab3d5b300d791d2299e22b7ad', href: this.href, class: classes, rel: this.rel, target: this.target, "aria-label": getAriaLabel(this.text, this.ariaLabel), ...this.inheritedAttributes }, h("slot", { key: '96ba4a33114443aab36d1301cf65c56437b9a85b', name: "iconStart" }, this.iconPosition === 'start' && h("ds-icon", { key: '86d8029de69c1ecb3002a97f5bc0cdbf899b7f91', name: this.icon, class: iconClasses, size: "1.4em" })), this.text, h("slot", { key: '7c2dafaee60253b1f5c22819b1afec83d106234b', name: "iconStart" }, this.iconPosition === 'end' && h("ds-icon", { key: 'a9fb3e2ddee16cce7c6b8fc0fba0b11970567276', name: this.icon, class: iconClasses, size: "1.4em" })), opensInNewTab(this.target) && (h("ds-visually-hidden", { key: 'f93f37d0d10d7a2d51980ff8feb76915cc4823b2', id: this.visuallyHiddenAssistiveTextId }, visuallyHiddenAssistiveText(this.language ?? document.documentElement.lang)))));
|
|
43
43
|
}
|
|
44
44
|
static get style() { return DsLinkWithArrowStyle0; }
|
|
45
45
|
}, [1, "ds-link-with-arrow", {
|
|
@@ -48,7 +48,7 @@ const DsLinkWithArrow$1 = proxyCustomElement(class DsLinkWithArrow extends H {
|
|
|
48
48
|
"href": [1],
|
|
49
49
|
"target": [1],
|
|
50
50
|
"language": [1, "lang"],
|
|
51
|
-
"
|
|
51
|
+
"ariaLabel": [1, "aria-label"]
|
|
52
52
|
}]);
|
|
53
53
|
function defineCustomElement$1() {
|
|
54
54
|
if (typeof customElements === "undefined") {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h } from './index2.js';
|
|
2
2
|
import { c as classNames } from './index3.js';
|
|
3
3
|
import { i as inheritAriaAttributes } from './attributes.js';
|
|
4
|
-
import { o as opensInNewTab, v as visuallyHiddenAssistiveText
|
|
5
|
-
import { i as idGenerator, d as defineCustomElement$3 } from './ds-icon2.js';
|
|
4
|
+
import { o as opensInNewTab, v as visuallyHiddenAssistiveText } from './linkUtils.js';
|
|
5
|
+
import { g as getAriaLabel, i as idGenerator, d as defineCustomElement$3 } from './ds-icon2.js';
|
|
6
6
|
import { d as defineCustomElement$2 } from './ds-visually-hidden2.js';
|
|
7
7
|
|
|
8
8
|
const dsLinkCss = ":root{--ds-breakpoint-xSmall:20rem;--ds-breakpoint-small:30rem;--ds-breakpoint-medium:60rem;--ds-breakpoint-large:75rem;--ds-breakpoint-xLarge:90rem}:host{display:inline-block}.ds-link{display:inline-flex;align-items:center;color:var(--ds-textColor-link);font-weight:var(--ds-fontWeight-regular);letter-spacing:var(--ds-letterSpacing-wide);text-decoration-line:underline;text-decoration-style:solid;text-decoration-skip-ink:auto;text-decoration-thickness:7%;text-underline-offset:12%;text-underline-position:from-font}.ds-link:focus-visible{box-shadow:0 0 0 var(--ds-borderWidth-thin) var(--ds-borderColor-white);outline-color:var(--ds-borderColor-black);outline-offset:var(--ds-borderWidth-thin);outline-style:solid;outline-width:var(--ds-borderWidth-thin)}.ds-link--semibold{font-weight:var(--ds-fontWeight-semibold)}.ds-link--bold{font-weight:var(--ds-fontWeight-bold)}.ds-link--2xLarge{font-size:var(--ds-fontSize-22)}.ds-link--xLarge{font-size:var(--ds-fontSize-20)}.ds-link--large{font-size:var(--ds-fontSize-18)}.ds-link--medium{font-size:var(--ds-fontSize-16)}.ds-link--small{font-size:var(--ds-fontSize-14)}.ds-link--xSmall{font-size:var(--ds-fontSize-12)}.ds-link__icon{height:1em;width:1em}.ds-link__icon--start-inline{margin-right:var(--ds-spacing-3xSmall)}.ds-link__icon--start-standalone{margin-right:var(--ds-spacing-2xSmall)}.ds-link__icon--end-inline{margin-left:var(--ds-spacing-3xSmall)}.ds-link__icon--end-standalone{margin-left:var(--ds-spacing-2xSmall)}.ds-link:hover,.ds-link:active{text-decoration-thickness:13%;text-underline-offset:12%}.ds-link:hover{color:var(--ds-textColor-link-hover)}.ds-link:active{color:var(--ds-textColor-link-active)}.ds-link:visited{color:var(--ds-textColor-link-visited)}.ds-link--standalone{color:var(--ds-textColor-link);text-decoration-line:none}.ds-link--standalone:hover,.ds-link--standalone:active{text-decoration-line:underline}.ds-link--standalone:hover{color:var(--ds-textColor-link-hover)}.ds-link--standalone:active{color:var(--ds-textColor-link-active)}.ds-link--standalone:focus-visible{color:var(--ds-textColor-link)}.ds-link--standalone:visited{color:var(--ds-textColor-link)}";
|
|
@@ -31,7 +31,7 @@ const DsLink$1 = proxyCustomElement(class DsLink extends H {
|
|
|
31
31
|
target;
|
|
32
32
|
download;
|
|
33
33
|
language;
|
|
34
|
-
|
|
34
|
+
ariaLabel;
|
|
35
35
|
componentWillLoad() {
|
|
36
36
|
this.inheritedAttributes = inheritAriaAttributes(this.el, ['aria-label']);
|
|
37
37
|
if (opensInNewTab(this.target)) {
|
|
@@ -48,7 +48,7 @@ const DsLink$1 = proxyCustomElement(class DsLink extends H {
|
|
|
48
48
|
[`ds-link__icon--start-${this.variant}`]: this.iconPosition === 'start',
|
|
49
49
|
[`ds-link__icon--end-${this.variant}`]: this.iconPosition === 'end',
|
|
50
50
|
});
|
|
51
|
-
return (h("a", { key: '
|
|
51
|
+
return (h("a", { key: 'f8e36a029709033379e53cc1c409bc9c0069820e', href: this.href, class: classes, rel: this.rel, target: this.target, download: this.download, "aria-label": getAriaLabel(this.text, this.ariaLabel), ...this.inheritedAttributes }, h("slot", { key: '88f90209b6557942dd956585b5f77632aa647c8e', name: "iconStart" }, this.icon && this.iconPosition === 'start' && h("ds-icon", { key: '87169acfb32913d10d27b35a9c6f714385979aa7', name: this.icon, class: iconClasses, size: "1em", title: this.iconTitle, hidden: this.iconHidden })), this.text, h("slot", { key: 'b38677240eb8bd7c1200c8dc08876ba75e7b3e81', name: "iconEnd" }, this.icon && this.iconPosition === 'end' && h("ds-icon", { key: 'c3088e302a43b4cbc5601a9adff54a3dc27a59dc', name: this.icon, class: iconClasses, size: "1em", title: this.iconTitle, hidden: this.iconHidden })), opensInNewTab(this.target) && (h("ds-visually-hidden", { key: '25ac189fd216148a05fddfc6e384cfbde59e0e22', id: this.visuallyHiddenAssistiveTextId }, visuallyHiddenAssistiveText(this.language ?? document.documentElement.lang)))));
|
|
52
52
|
}
|
|
53
53
|
static get style() { return DsLinkStyle0; }
|
|
54
54
|
}, [1, "ds-link", {
|
|
@@ -64,7 +64,7 @@ const DsLink$1 = proxyCustomElement(class DsLink extends H {
|
|
|
64
64
|
"target": [1],
|
|
65
65
|
"download": [4],
|
|
66
66
|
"language": [1, "lang"],
|
|
67
|
-
"
|
|
67
|
+
"ariaLabel": [1, "aria-label"]
|
|
68
68
|
}]);
|
|
69
69
|
function defineCustomElement$1() {
|
|
70
70
|
if (typeof customElements === "undefined") {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, h, F as Fragment } from './index2.js';
|
|
1
|
+
import { p as proxyCustomElement, H, d as createEvent, h, F as Fragment } from './index2.js';
|
|
2
2
|
import { c as classNames } from './index3.js';
|
|
3
|
-
import { i as idGenerator, d as defineCustomElement$3 } from './ds-icon2.js';
|
|
4
3
|
import { g as getRequiredText, a as getOptionalText } from './controlUtils.js';
|
|
5
|
-
import {
|
|
4
|
+
import { i as isValidation } from './store.js';
|
|
5
|
+
import { g as getAriaLabel, i as idGenerator, d as defineCustomElement$4 } from './ds-icon2.js';
|
|
6
|
+
import { d as defineCustomElement$5 } from './ds-button2.js';
|
|
7
|
+
import { d as defineCustomElement$3 } from './ds-input-validity2.js';
|
|
6
8
|
import { d as defineCustomElement$2 } from './ds-visually-hidden2.js';
|
|
7
9
|
|
|
8
|
-
const dsTextInputCss = ".sc-ds-text-input:root{--ds-breakpoint-xSmall:20rem;--ds-breakpoint-small:30rem;--ds-breakpoint-medium:60rem;--ds-breakpoint-large:75rem;--ds-breakpoint-xLarge:90rem}.sc-ds-text-input-h{display:block;width:288px}@media (min-width: 75rem){.sc-ds-text-input-h{width:320px}}.ds-input--label-container.sc-ds-text-input{margin-block-end:var(--ds-spacing-2xSmall)}.ds-input--label-container.sc-ds-text-input label.sc-ds-text-input{font-family:var(--ds-fontFamily-body);font-size:var(--ds-fontSize-16);font-weight:var(--ds-fontWeight-semibold);letter-spacing:var(--ds-letterSpacing-wide);line-height:var(--ds-lineHeight-large);color:var(--ds-textColor-default)}.ds-input--label-container.sc-ds-text-input small.sc-ds-text-input{font-family:var(--ds-fontFamily-body);font-size:var(--ds-fontSize-14);font-weight:var(--ds-fontWeight-regular);letter-spacing:var(--ds-letterSpacing-wide);line-height:var(--ds-lineHeight-large);display:block;margin-block-start:var(--ds-spacing-3xSmall);color:var(--ds-textColor-secondary)}.ds-input--container.sc-ds-text-input{box-sizing:border-box;width:100%;display:inline-flex;position:relative;align-items:center;border-width:var(--ds-borderWidth-thin);border-style:solid;border-color:var(--ds-borderColor-default);padding-inline:var(--ds-spacing-xSmall)}.ds-input--container.sc-ds-text-input:focus-visible{box-shadow:0 0 0 var(--ds-borderWidth-thin) var(--ds-borderColor-white);outline-color:var(--ds-borderColor-black);outline-offset:var(--ds-borderWidth-thin);outline-style:solid;outline-width:var(--ds-borderWidth-thin)}.ds-input--container.sc-ds-text-input:focus-within{box-shadow:0 0 0 var(--ds-borderWidth-thin) var(--ds-borderColor-white);outline-color:var(--ds-borderColor-black);outline-offset:var(--ds-borderWidth-thin);outline-style:solid;outline-width:var(--ds-borderWidth-thin)}.ds-input--container.invalid.sc-ds-text-input{background-color:var(--ds-bgColor-danger);border-color:var(--ds-borderColor-danger)}.ds-input--container.invalid.sc-ds-text-input:hover:not(.ds-input--container.invalid:focus-within){background-color:var(--ds-bgColor-danger-hover);border-color:var(--ds-borderColor-danger)}.ds-input--container.invalid.active.sc-ds-text-input{background-color:var(--ds-bgColor-danger-active);border-color:var(--ds-borderColor-danger)}.ds-input--container.valid.sc-ds-text-input{background-color:var(--ds-bgColor-success);border-color:var(--ds-borderColor-success)}.ds-input--container.valid.sc-ds-text-input:hover:not(.ds-input--container.valid:focus-within){background-color:var(--ds-bgColor-success-hover);border-color:var(--ds-borderColor-success)}.ds-input--container.valid.active.sc-ds-text-input{background-color:var(--ds-bgColor-success-active);border-color:var(--ds-borderColor-success)}.ds-input--container.readonly.sc-ds-text-input,.ds-input--container.disabled.sc-ds-text-input{background-color:var(--ds-bgColor-disabled-onLight);border-color:var(--ds-borderColor-disabled-onLight)}.ds-input--container.sc-ds-text-input:has(input:active){outline:none}.ds-input--container.sc-ds-text-input:has(input:active):not:has(input:disabled,input.sc-ds-text-input:readonly){border-color:var(--ds-borderColor-default)}.ds-input--container.active.sc-ds-text-input:not(.ds-input--container.disabled,.ds-input--container.readonly.sc-ds-text-input,.ds-input--container.invalid.sc-ds-text-input,.ds-input--container.valid).sc-ds-text-input{border-color:var(--ds-borderColor-default);background-color:var(--ds-bgColor-white-active)}.ds-input--container.sc-ds-text-input:hover:not(.ds-input--container.disabled,.ds-input--container.readonly.sc-ds-text-input,.ds-input--container.active.sc-ds-text-input,.ds-input--container.invalid.sc-ds-text-input,.ds-input--container.valid.sc-ds-text-input,.ds-input--container.sc-ds-text-input:focus-within){border-color:var(--ds-borderColor-default);background-color:var(--ds-bgColor-white-hover)}.ds-input--container.sc-ds-text-input:focus-within:not(.ds-input--container:focus-within.invalid,.ds-input--container.sc-ds-text-input:focus-within.valid,.ds-input--container.sc-ds-text-input:focus-within.readonly){border-color:var(--ds-borderColor-primary)}.ds-input--container.sc-ds-text-input:focus-within *.sc-ds-text-input>ds-button.suffix.sc-ds-text-input>button.sc-ds-text-input:focus-visible{background-clip:padding-box;outline-offset:-5px;box-shadow:none;height:var(--ds-spacing-xLarge);background-color:var(--ds-bgColor-transparent-onLight-hover)}.ds-input--container.sc-ds-text-input>input.sc-ds-text-input{font-family:var(--ds-fontFamily-body);font-size:var(--ds-fontSize-16);font-weight:var(--ds-fontWeight-regular);letter-spacing:var(--ds-letterSpacing-wide);line-height:var(--ds-lineHeight-large);width:100%;box-sizing:border-box;background-color:unset;flex-grow:1;height:var(--ds-spacing-xLarge);line-height:var(--ds-fontSize-24);color:var(--ds-textColor-default);border:none;padding-block:var(--ds-spacing-4xSmall)}.ds-input--container.sc-ds-text-input>input.sc-ds-text-input:disabled{color:var(--ds-textColor-disabled-onLight)}.ds-input--container.sc-ds-text-input>input.sc-ds-text-input:disabled::placeholder{color:var(--ds-textColor-disabled-onLight)}.ds-input--container.sc-ds-text-input>input.sc-ds-text-input::placeholder{font-family:var(--ds-fontFamily-body);font-size:var(--ds-fontSize-16);font-weight:var(--ds-fontWeight-regular);letter-spacing:var(--ds-letterSpacing-wide);line-height:var(--ds-lineHeight-large);color:var(--ds-textColor-secondary)}.ds-input--container.sc-ds-text-input>input.sc-ds-text-input:focus{outline:none;border:none}.ds-input--container.sc-ds-text-input>input[type=number].sc-ds-text-input{-moz-appearance:textfield}.ds-input--container.sc-ds-text-input>input.sc-ds-text-input::-webkit-search-decoration,.ds-input--container.sc-ds-text-input>input.sc-ds-text-input::-webkit-search-cancel-button,.ds-input--container.sc-ds-text-input>input.sc-ds-text-input::-webkit-search-results-button,.ds-input--container.sc-ds-text-input>input.sc-ds-text-input::-webkit-search-results-decoration,.ds-input--container.sc-ds-text-input>input.sc-ds-text-input::-webkit-inner-spin-button,.ds-input--container.sc-ds-text-input>input.sc-ds-text-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.ds-input--container.sc-ds-text-input:has(span.prefix,ds-icon.prefix).sc-ds-text-input{padding-inline-start:var(--ds-spacing-2xSmall)}.ds-input--container.sc-ds-text-input:has(span.prefix,ds-icon.prefix).sc-ds-text-input>input.sc-ds-text-input{padding-inline-start:var(--ds-spacing-2xSmall)}.ds-input--container.sc-ds-text-input:has(ds-button.suffix){padding-inline-end:unset}.ds-input--container.sc-ds-text-input span.prefix.sc-ds-text-input,.ds-input--container.sc-ds-text-input span.suffix.sc-ds-text-input{color:var(--ds-palette-black-70)}.ds-input--container.sc-ds-text-input ds-icon.prefix.sc-ds-text-input,.ds-input--container.sc-ds-text-input-s>[slot=prefix],.ds-input--container .sc-ds-text-input-s>[slot=prefix]{height:1.5rem;color:var(--ds-textColor-default)}.ds-input--container.sc-ds-text-input ds-button.suffix.sc-ds-text-input{margin-top:calc(var(--ds-spacing-3xSmall) * -1);margin-right:calc(var(--ds-spacing-4xSmall) * -1);max-height:40px}.error-text--container.sc-ds-text-input,.success-text--container.sc-ds-text-input{display:flex;align-items:center;margin-top:var(--ds-spacing-2xSmall);gap:var(--ds-spacing-2xSmall)}.error-text--container.sc-ds-text-input ds-icon.sc-ds-text-input,.success-text--container.sc-ds-text-input ds-icon.sc-ds-text-input{display:block;height:1.5rem}.error-text--container.sc-ds-text-input small.sc-ds-text-input,.success-text--container.sc-ds-text-input small.sc-ds-text-input{font-family:var(--ds-fontFamily-body);font-size:var(--ds-fontSize-16);font-weight:var(--ds-fontWeight-regular);letter-spacing:var(--ds-letterSpacing-wide);line-height:var(--ds-lineHeight-large)}.error-text--container.sc-ds-text-input{color:var(--ds-textColor-danger)}.success-text--container.sc-ds-text-input{color:var(--ds-textColor-success)}";
|
|
10
|
+
const dsTextInputCss = ".sc-ds-text-input:root{--ds-breakpoint-xSmall:20rem;--ds-breakpoint-small:30rem;--ds-breakpoint-medium:60rem;--ds-breakpoint-large:75rem;--ds-breakpoint-xLarge:90rem}.no-style-leak.sc-ds-text-input *.sc-ds-text-input,.sc-ds-text-input-h *.sc-ds-text-input{all:unset;box-sizing:border-box;display:block}.sc-ds-text-input-h{display:block;width:288px}@media (min-width: 75rem){.sc-ds-text-input-h{width:320px}}.ds-input--label-container.sc-ds-text-input{margin-block-end:var(--ds-spacing-2xSmall)}.ds-input--label-container.sc-ds-text-input label.sc-ds-text-input{font-family:var(--ds-fontFamily-body);font-size:var(--ds-fontSize-16);font-weight:var(--ds-fontWeight-semibold);letter-spacing:var(--ds-letterSpacing-wide);line-height:var(--ds-lineHeight-large);color:var(--ds-textColor-default)}.ds-input--label-container.sc-ds-text-input small.sc-ds-text-input{font-family:var(--ds-fontFamily-body);font-size:var(--ds-fontSize-14);font-weight:var(--ds-fontWeight-regular);letter-spacing:var(--ds-letterSpacing-wide);line-height:var(--ds-lineHeight-large);display:block;margin-block-start:var(--ds-spacing-3xSmall);color:var(--ds-textColor-secondary)}.ds-input--container.sc-ds-text-input{box-sizing:border-box;width:100%;display:inline-flex;position:relative;align-items:center;border-width:var(--ds-borderWidth-thin);border-style:solid;border-color:var(--ds-borderColor-default);padding-inline:var(--ds-spacing-xSmall)}.ds-input--container.sc-ds-text-input:focus-visible{box-shadow:0 0 0 var(--ds-borderWidth-thin) var(--ds-borderColor-white);outline-color:var(--ds-borderColor-black);outline-offset:var(--ds-borderWidth-thin);outline-style:solid;outline-width:var(--ds-borderWidth-thin)}.ds-input--container.sc-ds-text-input:focus-within{box-shadow:0 0 0 var(--ds-borderWidth-thin) var(--ds-borderColor-white);outline-color:var(--ds-borderColor-black);outline-offset:var(--ds-borderWidth-thin);outline-style:solid;outline-width:var(--ds-borderWidth-thin)}.ds-input--container.invalid.sc-ds-text-input{background-color:var(--ds-bgColor-danger);border-color:var(--ds-borderColor-danger)}.ds-input--container.invalid.sc-ds-text-input:hover:not(.ds-input--container.invalid:focus-within){background-color:var(--ds-bgColor-danger-hover);border-color:var(--ds-borderColor-danger)}.ds-input--container.invalid.active.sc-ds-text-input{background-color:var(--ds-bgColor-danger-active);border-color:var(--ds-borderColor-danger)}.ds-input--container.valid.sc-ds-text-input{background-color:var(--ds-bgColor-success);border-color:var(--ds-borderColor-success)}.ds-input--container.valid.sc-ds-text-input:hover:not(.ds-input--container.valid:focus-within){background-color:var(--ds-bgColor-success-hover);border-color:var(--ds-borderColor-success)}.ds-input--container.valid.active.sc-ds-text-input{background-color:var(--ds-bgColor-success-active);border-color:var(--ds-borderColor-success)}.ds-input--container.readonly.sc-ds-text-input,.ds-input--container.disabled.sc-ds-text-input{background-color:var(--ds-bgColor-disabled-onLight);border-color:var(--ds-borderColor-disabled-onLight)}.ds-input--container.sc-ds-text-input:has(input:active){outline:none}.ds-input--container.sc-ds-text-input:has(input:active):not:has(input:disabled,input.sc-ds-text-input:readonly){border-color:var(--ds-borderColor-default)}.ds-input--container.active.sc-ds-text-input:not(.ds-input--container.disabled,.ds-input--container.readonly.sc-ds-text-input,.ds-input--container.invalid.sc-ds-text-input,.ds-input--container.valid).sc-ds-text-input{border-color:var(--ds-borderColor-default);background-color:var(--ds-bgColor-white-active)}.ds-input--container.sc-ds-text-input:hover:not(.ds-input--container.disabled,.ds-input--container.readonly.sc-ds-text-input,.ds-input--container.active.sc-ds-text-input,.ds-input--container.invalid.sc-ds-text-input,.ds-input--container.valid.sc-ds-text-input,.ds-input--container.sc-ds-text-input:focus-within){border-color:var(--ds-borderColor-default);background-color:var(--ds-bgColor-white-hover)}.ds-input--container.sc-ds-text-input:focus-within:not(.ds-input--container:focus-within.invalid,.ds-input--container.sc-ds-text-input:focus-within.valid,.ds-input--container.sc-ds-text-input:focus-within.readonly){border-color:var(--ds-borderColor-primary)}.ds-input--container.sc-ds-text-input:focus-within *.sc-ds-text-input>ds-button.suffix.sc-ds-text-input>button.sc-ds-text-input:focus-visible{background-clip:padding-box;outline-offset:-5px;box-shadow:none;height:var(--ds-spacing-xLarge);background-color:var(--ds-bgColor-transparent-onLight-hover)}.ds-input--container.sc-ds-text-input>input.sc-ds-text-input{font-family:var(--ds-fontFamily-body);font-size:var(--ds-fontSize-16);font-weight:var(--ds-fontWeight-regular);letter-spacing:var(--ds-letterSpacing-wide);line-height:var(--ds-lineHeight-large);width:100%;box-sizing:border-box;background-color:unset;flex-grow:1;height:var(--ds-spacing-xLarge);line-height:var(--ds-fontSize-24);color:var(--ds-textColor-default);border:none;padding-block:var(--ds-spacing-4xSmall)}.ds-input--container.sc-ds-text-input>input.sc-ds-text-input:disabled{color:var(--ds-textColor-disabled-onLight)}.ds-input--container.sc-ds-text-input>input.sc-ds-text-input:disabled::placeholder{color:var(--ds-textColor-disabled-onLight)}.ds-input--container.sc-ds-text-input>input.sc-ds-text-input::placeholder{font-family:var(--ds-fontFamily-body);font-size:var(--ds-fontSize-16);font-weight:var(--ds-fontWeight-regular);letter-spacing:var(--ds-letterSpacing-wide);line-height:var(--ds-lineHeight-large);color:var(--ds-textColor-secondary)}.ds-input--container.sc-ds-text-input>input.sc-ds-text-input:focus{outline:none;border:none}.ds-input--container.sc-ds-text-input>input[type=number].sc-ds-text-input{-moz-appearance:textfield}.ds-input--container.sc-ds-text-input>input.sc-ds-text-input::-webkit-search-decoration,.ds-input--container.sc-ds-text-input>input.sc-ds-text-input::-webkit-search-cancel-button,.ds-input--container.sc-ds-text-input>input.sc-ds-text-input::-webkit-search-results-button,.ds-input--container.sc-ds-text-input>input.sc-ds-text-input::-webkit-search-results-decoration,.ds-input--container.sc-ds-text-input>input.sc-ds-text-input::-webkit-inner-spin-button,.ds-input--container.sc-ds-text-input>input.sc-ds-text-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.ds-input--container.sc-ds-text-input:has(span.prefix,ds-icon.prefix).sc-ds-text-input{padding-inline-start:var(--ds-spacing-2xSmall)}.ds-input--container.sc-ds-text-input:has(span.prefix,ds-icon.prefix).sc-ds-text-input>input.sc-ds-text-input{padding-inline-start:var(--ds-spacing-2xSmall)}.ds-input--container.sc-ds-text-input:has(ds-button.suffix){padding-inline-end:unset}.ds-input--container.sc-ds-text-input span.prefix.sc-ds-text-input,.ds-input--container.sc-ds-text-input span.suffix.sc-ds-text-input{color:var(--ds-palette-black-70)}.ds-input--container.sc-ds-text-input ds-icon.prefix.sc-ds-text-input,.ds-input--container.sc-ds-text-input-s>[slot=prefix],.ds-input--container .sc-ds-text-input-s>[slot=prefix]{height:1.5rem;color:var(--ds-textColor-default)}.ds-input--container.sc-ds-text-input ds-button.suffix.sc-ds-text-input{margin-top:calc(var(--ds-spacing-3xSmall) * -1);margin-right:calc(var(--ds-spacing-4xSmall) * -1);max-height:40px}.error-text--container.sc-ds-text-input,.success-text--container.sc-ds-text-input{display:flex;align-items:center;margin-top:var(--ds-spacing-2xSmall);gap:var(--ds-spacing-2xSmall)}.error-text--container.sc-ds-text-input ds-icon.sc-ds-text-input,.success-text--container.sc-ds-text-input ds-icon.sc-ds-text-input{display:block;height:1.5rem}.error-text--container.sc-ds-text-input small.sc-ds-text-input,.success-text--container.sc-ds-text-input small.sc-ds-text-input{font-family:var(--ds-fontFamily-body);font-size:var(--ds-fontSize-16);font-weight:var(--ds-fontWeight-regular);letter-spacing:var(--ds-letterSpacing-wide);line-height:var(--ds-lineHeight-large)}.error-text--container.sc-ds-text-input{color:var(--ds-textColor-danger)}.success-text--container.sc-ds-text-input{color:var(--ds-textColor-success)}";
|
|
9
11
|
const DsTextInputStyle0 = dsTextInputCss;
|
|
10
12
|
|
|
11
13
|
const INPUT_TYPE_ICONS_MAP = {
|
|
@@ -16,27 +18,27 @@ const INPUT_TYPE_ACTION_BUTTON_ICON_MAP = {
|
|
|
16
18
|
password: ({ passwordInputVisible }) => (passwordInputVisible ? 'visibility_off_fill' : 'visibility_fill'),
|
|
17
19
|
};
|
|
18
20
|
const inputIdGenerator = idGenerator('ds-input');
|
|
19
|
-
const assistiveTextIdGenerator = idGenerator('ds-assistive-text');
|
|
20
|
-
const visuallyHiddenAssistiveTextIdGenerator = idGenerator('visually-hidden-assistive-text');
|
|
21
|
-
const successTextIdGenerator = idGenerator('success-text');
|
|
22
|
-
const errorTextIdGenerator = idGenerator('error-text');
|
|
23
21
|
const DsTextInput$1 = proxyCustomElement(class DsTextInput extends H {
|
|
24
22
|
constructor() {
|
|
25
23
|
super();
|
|
26
24
|
this.__registerHost();
|
|
25
|
+
this.clear = createEvent(this, "clear", 7);
|
|
26
|
+
this.internals = this.attachInternals();
|
|
27
27
|
}
|
|
28
28
|
suffixButtonElement;
|
|
29
29
|
inputElement;
|
|
30
|
-
assistiveTextId
|
|
31
|
-
visuallyHiddenAssistiveTextId
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
assistiveTextId;
|
|
31
|
+
visuallyHiddenAssistiveTextId;
|
|
32
|
+
errorTextId;
|
|
33
|
+
successTextId;
|
|
34
34
|
hasPrefixSlot = false;
|
|
35
35
|
hasSuffixSlot = false;
|
|
36
36
|
get el() { return this; }
|
|
37
|
+
internals;
|
|
38
|
+
clear;
|
|
37
39
|
label;
|
|
38
40
|
placeholder;
|
|
39
|
-
|
|
41
|
+
identifier = inputIdGenerator.next().value;
|
|
40
42
|
name;
|
|
41
43
|
disabled;
|
|
42
44
|
optional;
|
|
@@ -65,6 +67,14 @@ const DsTextInput$1 = proxyCustomElement(class DsTextInput extends H {
|
|
|
65
67
|
clearButtonVisible = false;
|
|
66
68
|
passwordInputVisible = false;
|
|
67
69
|
inputActive = false;
|
|
70
|
+
validationMessage;
|
|
71
|
+
setIds = () => {
|
|
72
|
+
this.assistiveTextId = `${this.identifier}-assistive-text`;
|
|
73
|
+
this.visuallyHiddenAssistiveTextId = `${this.identifier}-visually-hidden-assistive-text`;
|
|
74
|
+
this.errorTextId = `${this.identifier}-error-text`;
|
|
75
|
+
this.successTextId = `${this.identifier}-success-text`;
|
|
76
|
+
};
|
|
77
|
+
getValidationMessage = () => this.errorText || this.internals?.validationMessage || this.inputElement?.validationMessage;
|
|
68
78
|
async togglePasswordVisibility() {
|
|
69
79
|
return (this.passwordInputVisible = !this.passwordInputVisible);
|
|
70
80
|
}
|
|
@@ -72,6 +82,7 @@ const DsTextInput$1 = proxyCustomElement(class DsTextInput extends H {
|
|
|
72
82
|
this.inputElement.value = '';
|
|
73
83
|
this.inputElement.focus();
|
|
74
84
|
this.clearButtonVisible = false;
|
|
85
|
+
this.clear.emit({ id: this.identifier });
|
|
75
86
|
}
|
|
76
87
|
getLabelText = () => {
|
|
77
88
|
if (this.required) {
|
|
@@ -83,9 +94,27 @@ const DsTextInput$1 = proxyCustomElement(class DsTextInput extends H {
|
|
|
83
94
|
return this.label;
|
|
84
95
|
};
|
|
85
96
|
componentWillLoad() {
|
|
97
|
+
this.setIds();
|
|
86
98
|
this.hasPrefixSlot = !!this.el.querySelector('[slot="prefix"]');
|
|
87
99
|
this.hasSuffixSlot = !!this.el.querySelector('[slot="suffix"]');
|
|
100
|
+
if (isValidation('server') || this.errorText) {
|
|
101
|
+
this.validationMessage = this.getValidationMessage();
|
|
102
|
+
}
|
|
88
103
|
}
|
|
104
|
+
handleInput = (e) => {
|
|
105
|
+
const target = e.target;
|
|
106
|
+
this.clearButtonVisible = !!target.value;
|
|
107
|
+
this.internals?.setFormValue(target.value);
|
|
108
|
+
if (isValidation('client') && this.validationMessage) {
|
|
109
|
+
this.validationMessage = this.getValidationMessage();
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
handleBlur = () => {
|
|
113
|
+
this.hasFocus = false;
|
|
114
|
+
if (isValidation('client')) {
|
|
115
|
+
this.validationMessage = this.getValidationMessage();
|
|
116
|
+
}
|
|
117
|
+
};
|
|
89
118
|
onActionButtonClicked = (e) => {
|
|
90
119
|
e.stopPropagation();
|
|
91
120
|
switch (this.type) {
|
|
@@ -97,13 +126,6 @@ const DsTextInput$1 = proxyCustomElement(class DsTextInput extends H {
|
|
|
97
126
|
return;
|
|
98
127
|
}
|
|
99
128
|
};
|
|
100
|
-
renderValidityMessage(type) {
|
|
101
|
-
const textId = type === 'success' ? this.successTextId : this.errorTextId;
|
|
102
|
-
const text = type === 'success' ? this.successText : this.errorText;
|
|
103
|
-
const icon = type === 'success' ? 'check_circle_fill' : 'warning_fill';
|
|
104
|
-
const className = type + '-text';
|
|
105
|
-
return (h("slot", { name: className }, text && (h("div", { class: `${className}--container` }, h("ds-icon", { name: icon }), h("small", { id: textId, class: className }, text)))));
|
|
106
|
-
}
|
|
107
129
|
renderPrefixContent() {
|
|
108
130
|
if (this.hasPrefixSlot) {
|
|
109
131
|
return h("slot", { name: "prefix" });
|
|
@@ -138,24 +160,25 @@ const DsTextInput$1 = proxyCustomElement(class DsTextInput extends H {
|
|
|
138
160
|
}
|
|
139
161
|
render() {
|
|
140
162
|
const inputType = this.type === 'password' && this.passwordInputVisible ? 'text' : this.type;
|
|
141
|
-
return (h(Fragment, { key: '
|
|
163
|
+
return (h(Fragment, { key: 'efb783f742bb82b01fd6807a628eb693666a819b' }, h("div", { key: 'dde260b136af4b68de1fa15928529f5e57f54c3a', class: "ds-input--label-container" }, h("slot", { key: 'e7ba428a8b8202c9b3e4d9a9c6d4257b0b48d83a', name: "label" }, h("label", { key: '1f28c5fd53249068de50c6d0ea0aa88ccf65a1ec', htmlFor: this.identifier }, this.getLabelText())), h("slot", { key: 'e3c1ea925cfc7f9599ee651da0aeaab98fa806bb', name: "help-text" }, h("small", { key: '671ab99029e2775d964feb012beb8a20912be5e3', id: this.assistiveTextId }, this.assistiveText), h("ds-visually-hidden", { key: '8eb744be9b95ddceb1dd5bed0274d29a26e7ec1d', id: this.visuallyHiddenAssistiveTextId }, this.hiddenAssistiveText))), h("div", { key: 'b7fa7067a52d176b810eb88777423adf50dfd8b9', onMouseDown: () => (this.inputActive = true), onMouseUp: () => (this.inputActive = false), onClick: e => this.handleInputContainerClick(e), class: classNames('ds-input--container', {
|
|
142
164
|
disabled: this.disabled,
|
|
143
165
|
readonly: this.readonly,
|
|
144
166
|
valid: !!this.successText,
|
|
145
167
|
invalid: !!this.errorText,
|
|
146
168
|
focus: this.hasFocus,
|
|
147
169
|
active: !!this.inputActive,
|
|
148
|
-
}) }, this.renderPrefixContent(), h("input", { key: '
|
|
170
|
+
}) }, this.renderPrefixContent(), h("input", { key: 'f619722a0c088fbd99d851b4cc49a220538da0ae', ref: e => (this.inputElement = e), id: this.identifier, name: this.name, "aria-label": getAriaLabel(this.label, this.ariaLabel), "aria-labelledby": this.ariaLabelledBy, "aria-describedby": this.ariaDescribedby ||
|
|
149
171
|
classNames(this.assistiveTextId, this.visuallyHiddenAssistiveTextId, {
|
|
150
|
-
[this.
|
|
151
|
-
[this.
|
|
152
|
-
}), disabled: this.disabled, required: this.required, readonly: this.readonly, value: this.value, type: inputType, min: this.min, max: this.max, maxlength: this.maxlength, pattern: this.pattern, placeholder: this.placeholder, autocomplete: this.autocomplete, onInput:
|
|
172
|
+
[this.errorTextId]: Boolean(this.validationMessage),
|
|
173
|
+
[this.successTextId]: Boolean(this.successText),
|
|
174
|
+
}), "aria-invalid": Boolean(this.validationMessage) ? 'true' : 'false', disabled: this.disabled, required: this.required, readonly: this.readonly, value: this.value, type: inputType, min: this.min, max: this.max, maxlength: this.maxlength, pattern: this.pattern, placeholder: this.placeholder, autocomplete: this.autocomplete, onInput: this.handleInput, onFocus: () => (this.hasFocus = true), onBlur: this.handleBlur }), this.renderSuffixContent()), h("slot", { key: 'b70c638ad0de13e0bfa1c2f0ec366e748ab8e4e2', name: "input-validity" }, h("ds-input-validity", { key: '7c1da6ba8d42add8de43f4926c24c8a64bbe32e2', id: this.errorTextId, text: this.validationMessage, type: "error", role: "alert" }), h("ds-input-validity", { key: '46258021c17e3461ea4a0c2ae720fb44305550c5', id: this.successTextId, text: this.successText, type: "success", role: "status" }))));
|
|
153
175
|
}
|
|
176
|
+
static get formAssociated() { return true; }
|
|
154
177
|
static get style() { return DsTextInputStyle0; }
|
|
155
|
-
}, [
|
|
178
|
+
}, [70, "ds-text-input", {
|
|
156
179
|
"label": [1],
|
|
157
180
|
"placeholder": [1],
|
|
158
|
-
"
|
|
181
|
+
"identifier": [1, "id"],
|
|
159
182
|
"name": [1],
|
|
160
183
|
"disabled": [4],
|
|
161
184
|
"optional": [4],
|
|
@@ -184,6 +207,7 @@ const DsTextInput$1 = proxyCustomElement(class DsTextInput extends H {
|
|
|
184
207
|
"clearButtonVisible": [32],
|
|
185
208
|
"passwordInputVisible": [32],
|
|
186
209
|
"inputActive": [32],
|
|
210
|
+
"validationMessage": [32],
|
|
187
211
|
"togglePasswordVisibility": [64],
|
|
188
212
|
"clearInput": [64]
|
|
189
213
|
}]);
|
|
@@ -191,7 +215,7 @@ function defineCustomElement$1() {
|
|
|
191
215
|
if (typeof customElements === "undefined") {
|
|
192
216
|
return;
|
|
193
217
|
}
|
|
194
|
-
const components = ["ds-text-input", "ds-button", "ds-icon", "ds-visually-hidden"];
|
|
218
|
+
const components = ["ds-text-input", "ds-button", "ds-icon", "ds-input-validity", "ds-visually-hidden"];
|
|
195
219
|
components.forEach(tagName => { switch (tagName) {
|
|
196
220
|
case "ds-text-input":
|
|
197
221
|
if (!customElements.get(tagName)) {
|
|
@@ -200,10 +224,15 @@ function defineCustomElement$1() {
|
|
|
200
224
|
break;
|
|
201
225
|
case "ds-button":
|
|
202
226
|
if (!customElements.get(tagName)) {
|
|
203
|
-
defineCustomElement$
|
|
227
|
+
defineCustomElement$5();
|
|
204
228
|
}
|
|
205
229
|
break;
|
|
206
230
|
case "ds-icon":
|
|
231
|
+
if (!customElements.get(tagName)) {
|
|
232
|
+
defineCustomElement$4();
|
|
233
|
+
}
|
|
234
|
+
break;
|
|
235
|
+
case "ds-input-validity":
|
|
207
236
|
if (!customElements.get(tagName)) {
|
|
208
237
|
defineCustomElement$3();
|
|
209
238
|
}
|
|
@@ -10,7 +10,7 @@ const DsVisuallyHidden = proxyCustomElement(class DsVisuallyHidden extends H {
|
|
|
10
10
|
this.__attachShadow();
|
|
11
11
|
}
|
|
12
12
|
render() {
|
|
13
|
-
return (h("slot", { key: '
|
|
13
|
+
return (h("slot", { key: '083eaed9210a85360479b367769c8904a6089f64' }));
|
|
14
14
|
}
|
|
15
15
|
static get style() { return DsVisuallyHiddenStyle0; }
|
|
16
16
|
}, [1, "ds-visually-hidden"]);
|
package/dist/components/index.js
CHANGED
|
@@ -1269,8 +1269,10 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1269
1269
|
}
|
|
1270
1270
|
}
|
|
1271
1271
|
};
|
|
1272
|
+
var renderingRef = null;
|
|
1272
1273
|
var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
1273
1274
|
try {
|
|
1275
|
+
renderingRef = instance;
|
|
1274
1276
|
instance = instance.render() ;
|
|
1275
1277
|
{
|
|
1276
1278
|
hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
|
|
@@ -1288,8 +1290,10 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
|
1288
1290
|
} catch (e) {
|
|
1289
1291
|
consoleError(e, hostRef.$hostElement$);
|
|
1290
1292
|
}
|
|
1293
|
+
renderingRef = null;
|
|
1291
1294
|
return null;
|
|
1292
1295
|
};
|
|
1296
|
+
var getRenderingRef = () => renderingRef;
|
|
1293
1297
|
var postUpdateComponent = (hostRef) => {
|
|
1294
1298
|
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
1295
1299
|
const elm = hostRef.$hostElement$;
|
|
@@ -1325,6 +1329,16 @@ var postUpdateComponent = (hostRef) => {
|
|
|
1325
1329
|
hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
|
|
1326
1330
|
}
|
|
1327
1331
|
};
|
|
1332
|
+
var forceUpdate = (ref) => {
|
|
1333
|
+
{
|
|
1334
|
+
const hostRef = getHostRef(ref);
|
|
1335
|
+
const isConnected = hostRef.$hostElement$.isConnected;
|
|
1336
|
+
if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
1337
|
+
scheduleUpdate(hostRef, false);
|
|
1338
|
+
}
|
|
1339
|
+
return isConnected;
|
|
1340
|
+
}
|
|
1341
|
+
};
|
|
1328
1342
|
var appDidLoad = (who) => {
|
|
1329
1343
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
1330
1344
|
};
|
|
@@ -1694,4 +1708,4 @@ var setNonce = (nonce) => plt.$nonce$ = nonce;
|
|
|
1694
1708
|
// src/runtime/platform-options.ts
|
|
1695
1709
|
var setPlatformOptions = (opts) => Object.assign(plt, opts);
|
|
1696
1710
|
|
|
1697
|
-
export { Fragment as F, H, setNonce as a, setPlatformOptions as b,
|
|
1711
|
+
export { Fragment as F, H, setNonce as a, setPlatformOptions as b, getRenderingRef as c, createEvent as d, forceUpdate as f, getAssetPath as g, h, proxyCustomElement as p, setAssetPath as s };
|
|
@@ -9,14 +9,5 @@ const visuallyHiddenAssistiveText = (lang) => {
|
|
|
9
9
|
return 'Opens in a new tab';
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
|
-
const getAriaLabel = (text, ariaLabel) => {
|
|
13
|
-
if (!ariaLabel) {
|
|
14
|
-
return undefined;
|
|
15
|
-
}
|
|
16
|
-
if (ariaLabel.startsWith(text)) {
|
|
17
|
-
return ariaLabel;
|
|
18
|
-
}
|
|
19
|
-
return [text, ariaLabel].join(' ');
|
|
20
|
-
};
|
|
21
12
|
|
|
22
|
-
export {
|
|
13
|
+
export { opensInNewTab as o, visuallyHiddenAssistiveText as v };
|