@uh-design-system/component-library 0.5.2 → 0.6.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/dist/cjs/{utils-3412cbed.js → attributes-BMbXzbwU.js} +2 -28
- package/dist/cjs/component-library.cjs.js +7 -7
- package/dist/cjs/controlUtils-ofqiQxRF.js +42 -0
- package/dist/cjs/ds-accordion.cjs.entry.js +79 -0
- package/dist/cjs/ds-button.cjs.entry.js +107 -0
- package/dist/cjs/ds-card.cjs.entry.js +58 -0
- package/dist/cjs/ds-checkbox-group.cjs.entry.js +109 -49
- package/dist/cjs/ds-checkbox.cjs.entry.js +88 -79
- package/dist/cjs/ds-icon.cjs.entry.js +943 -0
- package/dist/cjs/ds-input-validity.cjs.entry.js +14 -15
- package/dist/cjs/ds-link-with-arrow.cjs.entry.js +21 -20
- package/dist/cjs/ds-link.cjs.entry.js +34 -31
- package/dist/cjs/ds-radio-button-group.cjs.entry.js +153 -0
- package/dist/cjs/ds-radio-button.cjs.entry.js +151 -0
- package/dist/cjs/ds-spinner.cjs.entry.js +62 -0
- package/dist/cjs/ds-text-input.cjs.entry.js +90 -77
- package/dist/cjs/ds-visually-hidden.cjs.entry.js +3 -6
- package/dist/cjs/index-Bp6Dd2i1.js +94 -0
- package/dist/cjs/{store-9bd20f3c.js → index-DwLFyR5p.js} +6 -2
- package/dist/cjs/{index-bf84b124.js → index-Mjp9Y-Sw.js} +701 -55
- package/dist/cjs/index.cjs.js +3 -5
- package/dist/cjs/{linkUtils-695da37c.js → linkUtils-onlbgKdI.js} +4 -2
- package/dist/cjs/loader.cjs.js +3 -5
- package/dist/cjs/utils-BjZTECpy.js +29 -0
- package/dist/collection/accessibility/stories/naming.stories.js +3 -3
- package/dist/collection/collection-manifest.json +78 -3
- package/dist/collection/components/01-base-components/ds-accordion/ds-accordion.css +18 -17
- package/dist/collection/components/01-base-components/ds-accordion/ds-accordion.js +91 -50
- package/dist/collection/components/01-base-components/ds-accordion/stories/ds-accordion.examples.stories.js +6 -6
- package/dist/collection/components/01-base-components/ds-accordion/stories/ds-accordion.features.stories.js +14 -14
- package/dist/collection/components/01-base-components/ds-accordion/stories/ds-accordion.stories.js +24 -66
- package/dist/collection/components/01-base-components/ds-button/ds-button.css +124 -145
- package/dist/collection/components/01-base-components/ds-button/ds-button.js +150 -65
- package/dist/collection/components/01-base-components/ds-button/stories/ds-button.examples.stories.js +121 -23
- package/dist/collection/components/01-base-components/ds-button/stories/ds-button.features.stories.js +49 -42
- package/dist/collection/components/01-base-components/ds-button/stories/ds-button.stories.js +16 -72
- package/dist/collection/components/01-base-components/ds-card/ds-card.css +127 -0
- package/dist/collection/components/01-base-components/ds-card/ds-card.js +303 -0
- package/dist/collection/components/01-base-components/ds-card/stories/ds-card.examples.stories.js +92 -0
- package/dist/collection/components/01-base-components/ds-card/stories/ds-card.features.stories.js +66 -0
- package/dist/collection/components/01-base-components/ds-card/stories/ds-card.stories.js +71 -0
- package/dist/collection/components/01-base-components/ds-checkbox/ds-checkbox.css +46 -46
- package/dist/collection/components/01-base-components/ds-checkbox/ds-checkbox.js +120 -111
- package/dist/collection/components/01-base-components/ds-checkbox/stories/ds-checkbox.features.stories.js +20 -20
- package/dist/collection/components/01-base-components/ds-checkbox/stories/ds-checkbox.stories.js +12 -25
- package/dist/collection/components/01-base-components/ds-checkbox-group/ds-checkbox-group.css +2 -3
- package/dist/collection/components/01-base-components/ds-checkbox-group/ds-checkbox-group.js +214 -63
- package/dist/collection/components/01-base-components/ds-checkbox-group/stories/ds-checkbox-group.features.stories.js +215 -50
- package/dist/collection/components/01-base-components/ds-checkbox-group/stories/ds-checkbox-group.stories.js +30 -28
- package/dist/collection/components/01-base-components/ds-icon/ds-icon.js +36 -31
- package/dist/collection/components/01-base-components/ds-icon/stories/ds-icon.stories.js +10 -37
- package/dist/collection/components/01-base-components/ds-input-validity/ds-input-validity.css +2 -2
- package/dist/collection/components/01-base-components/ds-input-validity/ds-input-validity.js +60 -30
- package/dist/collection/components/01-base-components/ds-input-validity/stories/ds-input-validity.features.stories.js +4 -4
- package/dist/collection/components/01-base-components/ds-input-validity/stories/ds-input-validity.stories.js +4 -9
- package/dist/collection/components/01-base-components/ds-link/ds-link.css +24 -14
- package/dist/collection/components/01-base-components/ds-link/ds-link.js +74 -75
- package/dist/collection/components/01-base-components/ds-link/stories/ds-link.examples.stories.js +27 -27
- package/dist/collection/components/01-base-components/ds-link/stories/ds-link.features.stories.js +38 -21
- package/dist/collection/components/01-base-components/ds-link/stories/ds-link.stories.js +8 -67
- package/dist/collection/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.css +10 -12
- package/dist/collection/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.js +30 -52
- package/dist/collection/components/01-base-components/ds-link-with-arrow/stories/ds-link-with-arrow.examples.stories.js +4 -4
- package/dist/collection/components/01-base-components/ds-link-with-arrow/stories/ds-link-with-arrow.features.stories.js +6 -6
- package/dist/collection/components/01-base-components/ds-link-with-arrow/stories/ds-link-with-arrow.stories.js +4 -28
- package/dist/collection/components/01-base-components/ds-radio-button/ds-radio-button.css +115 -0
- package/dist/collection/components/01-base-components/ds-radio-button/ds-radio-button.js +449 -0
- package/dist/collection/components/01-base-components/ds-radio-button/stories/ds-radio-button.features.stories.js +72 -0
- package/dist/collection/components/01-base-components/ds-radio-button/stories/ds-radio-button.stories.js +22 -0
- package/dist/collection/components/01-base-components/ds-radio-button-group/ds-radio-button-group.css +30 -0
- package/dist/collection/components/01-base-components/ds-radio-button-group/ds-radio-button-group.js +360 -0
- package/dist/collection/components/01-base-components/ds-radio-button-group/stories/ds-radio-button-group.examples.stories.js +42 -0
- package/dist/collection/components/01-base-components/ds-radio-button-group/stories/ds-radio-button-group.features.stories.js +71 -0
- package/dist/collection/components/01-base-components/ds-radio-button-group/stories/ds-radio-button-group.stories.js +60 -0
- package/dist/collection/components/01-base-components/ds-spinner/ds-spinner.css +279 -0
- package/dist/collection/components/01-base-components/ds-spinner/ds-spinner.js +221 -0
- package/dist/collection/components/01-base-components/ds-spinner/stories/ds-spinner.examples.stories.js +120 -0
- package/dist/collection/components/01-base-components/ds-spinner/stories/ds-spinner.features.stories.js +107 -0
- package/dist/collection/components/01-base-components/ds-spinner/stories/ds-spinner.stories.js +14 -0
- package/dist/collection/components/01-base-components/ds-text-input/ds-text-input.css +85 -118
- package/dist/collection/components/01-base-components/ds-text-input/ds-text-input.js +230 -155
- package/dist/collection/components/01-base-components/ds-text-input/stories/ds-text-input.examples.stories.js +26 -21
- package/dist/collection/components/01-base-components/ds-text-input/stories/ds-text-input.features.stories.js +40 -40
- package/dist/collection/components/01-base-components/ds-text-input/stories/ds-text-input.stories.js +30 -56
- package/dist/collection/components/01-base-components/ds-visually-hidden/ds-visually-hidden.js +1 -1
- package/dist/collection/store.js +7 -1
- package/dist/collection/utils/attributes/attributes.js +2 -2
- package/dist/collection/utils/button/buttonUtils.js +14 -0
- package/dist/collection/utils/colours/colourTypes.js +3 -3
- package/dist/collection/utils/colours/colourUtils.js +5 -3
- package/dist/collection/utils/controls/controlUtils.js +35 -1
- package/dist/collection/utils/link/linkUtils.js +3 -2
- package/dist/collection/utils/spinner/spinnerUtils.js +20 -0
- package/dist/collection/utils/tests/testUtils.js +1 -0
- package/dist/collection/utils/typography/typographyUtils.js +3 -3
- package/dist/collection/utils/utils.js +10 -9
- package/dist/component-library/{utils-cfc536bc.js → attributes-BD_lNRxn.js} +1 -1
- package/dist/component-library/component-library.css +1 -1
- package/dist/component-library/component-library.esm.js +1 -1
- package/dist/component-library/controlUtils-CNER0MvM.js +1 -0
- package/dist/component-library/ds-accordion.entry.js +1 -0
- package/dist/component-library/ds-button.entry.js +1 -0
- package/dist/component-library/ds-card.entry.js +1 -0
- 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-icon.entry.js +1 -0
- 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-radio-button-group.entry.js +1 -0
- package/dist/component-library/ds-radio-button.entry.js +1 -0
- package/dist/component-library/ds-spinner.entry.js +1 -0
- 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-BfTCfPZ1.js +6 -0
- package/dist/component-library/index-Cm7V4EAn.js +2 -0
- package/dist/component-library/index-DuYjhvTn.js +1 -0
- package/dist/component-library/index.esm.js +1 -1
- package/dist/component-library/linkUtils-02nCfO0F.js +1 -0
- package/dist/component-library/utils-CqaqnfY4.js +1 -0
- package/dist/components/attributes.js +3 -3
- package/dist/components/controlUtils.js +35 -2
- package/dist/components/ds-accordion.js +58 -42
- package/dist/components/ds-button2.js +78 -39
- package/dist/components/ds-card.d.ts +11 -0
- package/dist/components/ds-card.js +91 -0
- package/dist/components/ds-checkbox-group.js +116 -56
- package/dist/components/ds-checkbox2.js +93 -80
- package/dist/components/ds-icon2.js +292 -292
- package/dist/components/ds-input-validity2.js +17 -14
- package/dist/components/ds-link-with-arrow.js +22 -22
- package/dist/components/ds-link.js +43 -40
- package/dist/components/ds-radio-button-group.d.ts +11 -0
- package/dist/components/ds-radio-button-group.js +185 -0
- package/dist/components/ds-radio-button.d.ts +11 -0
- package/dist/components/ds-radio-button.js +198 -0
- package/dist/components/ds-spinner.d.ts +11 -0
- package/dist/components/ds-spinner.js +6 -0
- package/dist/components/ds-spinner2.js +89 -0
- package/dist/components/ds-text-input.js +126 -104
- package/dist/components/ds-visually-hidden2.js +2 -3
- package/dist/components/index.js +208 -2
- package/dist/components/index2.js +713 -39
- package/dist/components/index3.js +69 -57
- package/dist/components/linkUtils.js +4 -2
- package/dist/docs.d.ts +443 -0
- package/dist/docs.json +4790 -0
- package/dist/esm/{utils-cfc536bc.js → attributes-BD_lNRxn.js} +3 -26
- package/dist/esm/component-library.js +6 -5
- package/dist/esm/controlUtils-CNER0MvM.js +37 -0
- package/dist/esm/ds-accordion.entry.js +77 -0
- package/dist/esm/ds-button.entry.js +105 -0
- package/dist/esm/ds-card.entry.js +56 -0
- package/dist/esm/ds-checkbox-group.entry.js +108 -46
- package/dist/esm/ds-checkbox.entry.js +78 -67
- package/dist/esm/ds-icon.entry.js +941 -0
- package/dist/esm/ds-input-validity.entry.js +14 -13
- package/dist/esm/ds-link-with-arrow.entry.js +21 -18
- package/dist/esm/ds-link.entry.js +34 -29
- package/dist/esm/ds-radio-button-group.entry.js +151 -0
- package/dist/esm/ds-radio-button.entry.js +149 -0
- package/dist/esm/ds-spinner.entry.js +60 -0
- package/dist/esm/ds-text-input.entry.js +88 -73
- package/dist/esm/ds-visually-hidden.entry.js +3 -4
- package/dist/esm/index-BfTCfPZ1.js +92 -0
- package/dist/esm/{index-434995e1.js → index-Cm7V4EAn.js} +699 -34
- package/dist/{components/store.js → esm/index-DuYjhvTn.js} +6 -3
- package/dist/esm/index.js +2 -2
- package/dist/esm/{linkUtils-3d1b28cf.js → linkUtils-02nCfO0F.js} +4 -2
- package/dist/esm/loader.js +4 -4
- package/dist/esm/utils-CqaqnfY4.js +25 -0
- package/dist/hydrate/index.d.ts +271 -0
- package/dist/hydrate/index.js +22280 -0
- package/dist/hydrate/index.mjs +22272 -0
- package/dist/hydrate/package.json +12 -0
- package/dist/styles/helpers.css +15 -0
- package/dist/styles/helpers.css.map +1 -0
- package/dist/styles/mixins/_breakpoints.scss +13 -0
- package/dist/styles/mixins/_focus.scss +26 -0
- package/dist/styles/mixins/_wrapper.scss +5 -0
- package/dist/styles/mixins/imports-default/_imports.scss +2 -0
- package/dist/styles/mixins/tokens/_breakpoints.scss +13 -0
- package/dist/styles/mixins/tokens/_semantic-colours.scss +75 -0
- package/dist/styles/mixins.scss +12 -0
- package/dist/styles/variables.css +176 -0
- package/dist/styles/variables.css.map +1 -0
- package/dist/types/components/01-base-components/ds-accordion/ds-accordion.d.ts +11 -8
- package/dist/types/components/01-base-components/ds-button/ds-button.d.ts +16 -11
- package/dist/types/components/01-base-components/ds-button/stories/ds-button.examples.stories.d.ts +1 -0
- package/dist/types/components/01-base-components/ds-button/stories/ds-button.features.stories.d.ts +1 -0
- package/dist/types/components/01-base-components/ds-card/ds-card.d.ts +20 -0
- package/dist/types/components/01-base-components/ds-card/stories/ds-card.examples.stories.d.ts +8 -0
- package/dist/types/components/01-base-components/ds-card/stories/ds-card.features.stories.d.ts +8 -0
- package/dist/types/components/01-base-components/ds-card/stories/ds-card.stories.d.ts +7 -0
- package/dist/types/components/01-base-components/ds-checkbox/ds-checkbox.d.ts +21 -22
- package/dist/types/components/01-base-components/ds-checkbox-group/ds-checkbox-group.d.ts +21 -11
- package/dist/types/components/01-base-components/ds-checkbox-group/stories/ds-checkbox-group.features.stories.d.ts +3 -0
- package/dist/types/components/01-base-components/ds-icon/ds-icon.d.ts +7 -5
- package/dist/types/components/01-base-components/ds-input-validity/ds-input-validity.d.ts +5 -6
- package/dist/types/components/01-base-components/ds-link/ds-link.d.ts +13 -14
- package/dist/types/components/01-base-components/ds-link/stories/ds-link.features.stories.d.ts +2 -0
- package/dist/types/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.d.ts +5 -7
- package/dist/types/components/01-base-components/ds-radio-button/ds-radio-button.d.ts +44 -0
- package/dist/types/components/01-base-components/ds-radio-button/stories/ds-radio-button.features.stories.d.ts +15 -0
- package/dist/types/components/01-base-components/ds-radio-button/stories/ds-radio-button.stories.d.ts +7 -0
- package/dist/types/components/01-base-components/ds-radio-button-group/ds-radio-button-group.d.ts +34 -0
- package/dist/types/components/01-base-components/ds-radio-button-group/stories/ds-radio-button-group.examples.stories.d.ts +6 -0
- package/dist/types/components/01-base-components/ds-radio-button-group/stories/ds-radio-button-group.features.stories.d.ts +11 -0
- package/dist/types/components/01-base-components/ds-radio-button-group/stories/ds-radio-button-group.stories.d.ts +7 -0
- package/dist/types/components/01-base-components/ds-spinner/ds-spinner.d.ts +17 -0
- package/dist/types/components/01-base-components/ds-spinner/stories/ds-spinner.examples.stories.d.ts +7 -0
- package/dist/types/components/01-base-components/ds-spinner/stories/ds-spinner.features.stories.d.ts +7 -0
- package/dist/types/components/01-base-components/ds-spinner/stories/ds-spinner.stories.d.ts +7 -0
- package/dist/types/components/01-base-components/ds-text-input/ds-text-input.d.ts +37 -32
- package/dist/types/components.d.ts +1287 -228
- package/dist/types/stencil-public-runtime.d.ts +22 -0
- package/dist/types/store.d.ts +6 -1
- package/dist/types/utils/attributes/attributes.d.ts +1 -1
- package/dist/types/utils/button/buttonUtils.d.ts +1 -0
- package/dist/types/utils/colours/colourTypes.d.ts +3 -3
- package/dist/types/utils/controls/controlUtils.d.ts +2 -0
- package/dist/types/utils/link/linkUtils.d.ts +1 -1
- package/dist/types/utils/spinner/spinnerUtils.d.ts +1 -0
- package/dist/types/utils/tests/testUtils.d.ts +1 -0
- package/dist/types/utils/utils.d.ts +2 -1
- package/package.json +40 -36
- package/dist/cjs/controlUtils-041de0fd.js +0 -7
- package/dist/cjs/ds-accordion_3.cjs.entry.js +0 -1095
- package/dist/cjs/index-5b0b9d4c.js +0 -82
- package/dist/component-library/controlUtils-9ca4087b.js +0 -1
- package/dist/component-library/ds-accordion_3.entry.js +0 -1
- package/dist/component-library/index-434995e1.js +0 -2
- package/dist/component-library/index-72ac5051.js +0 -6
- package/dist/component-library/linkUtils-3d1b28cf.js +0 -1
- package/dist/component-library/store-b8d17c10.js +0 -1
- package/dist/esm/controlUtils-9ca4087b.js +0 -4
- package/dist/esm/ds-accordion_3.entry.js +0 -1089
- package/dist/esm/index-72ac5051.js +0 -80
- package/dist/esm/store-b8d17c10.js +0 -204
- package/dist/loader/package.json +0 -11
- /package/dist/cjs/{app-globals-3a1e7e63.js → app-globals-V2Kpy_OQ.js} +0 -0
- /package/dist/component-library/{app-globals-0f993ce5.js → app-globals-DQuL1Twl.js} +0 -0
- /package/dist/esm/{app-globals-0f993ce5.js → app-globals-DQuL1Twl.js} +0 -0
|
@@ -2,7 +2,7 @@ import { Fragment, h } from "@stencil/core";
|
|
|
2
2
|
import classNames from "classnames";
|
|
3
3
|
import { getOptionalText, getRequiredText } from "../../../utils/controls/controlUtils";
|
|
4
4
|
import { isValidation } from "../../../store";
|
|
5
|
-
import { idGenerator
|
|
5
|
+
import { idGenerator } from "../../../utils/utils";
|
|
6
6
|
import { inheritAttributes } from "../../../utils/attributes/attributes";
|
|
7
7
|
const INPUT_TYPE_ICONS_MAP = {
|
|
8
8
|
search: 'search',
|
|
@@ -24,79 +24,86 @@ export class DsTextInput {
|
|
|
24
24
|
hasSuffixSlot = false;
|
|
25
25
|
el;
|
|
26
26
|
internals;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
27
|
+
dsChange;
|
|
28
|
+
dsInput;
|
|
29
|
+
dsClear;
|
|
30
|
+
dsLabel;
|
|
31
|
+
dsPlaceholder;
|
|
32
|
+
dsId = inputIdGenerator.next().value;
|
|
33
|
+
dsName;
|
|
34
|
+
dsDisabled;
|
|
35
|
+
dsOptional;
|
|
36
|
+
dsRequired;
|
|
37
|
+
dsReadonly;
|
|
38
|
+
dsValue;
|
|
39
|
+
dsMin;
|
|
40
|
+
dsMax;
|
|
41
|
+
dsMaxLength;
|
|
42
|
+
dsPattern;
|
|
43
|
+
dsAutocomplete;
|
|
44
|
+
dsOptionalText;
|
|
45
|
+
dsErrorText;
|
|
46
|
+
dsSuccessText;
|
|
47
|
+
dsAssistiveText;
|
|
48
|
+
dsActionButtonAriaLabel;
|
|
49
|
+
dsHiddenAssistiveText;
|
|
50
|
+
dsPrefixText;
|
|
51
|
+
dsSuffixText;
|
|
52
|
+
dsIcon = '';
|
|
53
|
+
dsType = 'text';
|
|
54
|
+
dsAriaLabel;
|
|
55
|
+
dsAriaLabelledby;
|
|
56
|
+
dsAriaDescribedby;
|
|
55
57
|
hasFocus = false;
|
|
56
58
|
clearButtonVisible = false;
|
|
57
59
|
passwordInputVisible = false;
|
|
58
60
|
inputActive = false;
|
|
59
61
|
validationMessage;
|
|
60
62
|
setIds = () => {
|
|
61
|
-
this.assistiveTextId = `${this.
|
|
62
|
-
this.visuallyHiddenAssistiveTextId = `${this.
|
|
63
|
-
this.errorTextId = `${this.
|
|
64
|
-
this.successTextId = `${this.
|
|
63
|
+
this.assistiveTextId = `${this.dsId}-assistive-text`;
|
|
64
|
+
this.visuallyHiddenAssistiveTextId = `${this.dsId}-visually-hidden-assistive-text`;
|
|
65
|
+
this.errorTextId = `${this.dsId}-error-text`;
|
|
66
|
+
this.successTextId = `${this.dsId}-success-text`;
|
|
65
67
|
};
|
|
66
|
-
getValidationMessage = () => this.
|
|
68
|
+
getValidationMessage = () => this.dsErrorText || this.internals?.validationMessage || this.inputElement?.validationMessage;
|
|
67
69
|
async togglePasswordVisibility() {
|
|
68
70
|
return (this.passwordInputVisible = !this.passwordInputVisible);
|
|
69
71
|
}
|
|
70
|
-
async clearInput() {
|
|
71
|
-
this.
|
|
72
|
+
async clearInput(e) {
|
|
73
|
+
this.dsValue = '';
|
|
72
74
|
this.inputElement.focus();
|
|
73
75
|
this.clearButtonVisible = false;
|
|
74
|
-
this.
|
|
76
|
+
this.dsClear.emit({ event: e, value: this.dsValue });
|
|
77
|
+
}
|
|
78
|
+
valueObserver(value) {
|
|
79
|
+
this.dsChange.emit({ value });
|
|
75
80
|
}
|
|
76
81
|
getLabelText = () => {
|
|
77
|
-
if (this.
|
|
78
|
-
return getRequiredText(this.
|
|
82
|
+
if (this.dsRequired) {
|
|
83
|
+
return getRequiredText(this.dsLabel);
|
|
79
84
|
}
|
|
80
|
-
if (this.
|
|
81
|
-
return getOptionalText(this.
|
|
85
|
+
if (this.dsOptional) {
|
|
86
|
+
return getOptionalText(this.dsLabel, this.dsOptionalText);
|
|
82
87
|
}
|
|
83
|
-
return this.
|
|
88
|
+
return this.dsLabel;
|
|
84
89
|
};
|
|
85
90
|
componentWillLoad() {
|
|
86
91
|
this.inheritedAttributes = {
|
|
87
|
-
...inheritAttributes(this, this.el),
|
|
92
|
+
...inheritAttributes(this, this.el, ['id']),
|
|
88
93
|
};
|
|
89
94
|
this.setIds();
|
|
90
95
|
this.hasPrefixSlot = !!this.el.querySelector('[slot="prefix"]');
|
|
91
96
|
this.hasSuffixSlot = !!this.el.querySelector('[slot="suffix"]');
|
|
92
|
-
if (isValidation('server') || this.
|
|
97
|
+
if (isValidation('server') || this.dsErrorText) {
|
|
93
98
|
this.validationMessage = this.getValidationMessage();
|
|
94
99
|
}
|
|
95
100
|
}
|
|
96
101
|
handleInput = (e) => {
|
|
97
102
|
const target = e.target;
|
|
103
|
+
this.dsValue = target.value;
|
|
98
104
|
this.clearButtonVisible = !!target.value;
|
|
99
105
|
this.internals?.setFormValue(target.value);
|
|
106
|
+
this.dsInput.emit({ event: e, value: this.dsValue });
|
|
100
107
|
if (isValidation('client') && this.validationMessage) {
|
|
101
108
|
this.validationMessage = this.getValidationMessage();
|
|
102
109
|
}
|
|
@@ -109,11 +116,12 @@ export class DsTextInput {
|
|
|
109
116
|
};
|
|
110
117
|
onActionButtonClicked = (e) => {
|
|
111
118
|
e.stopPropagation();
|
|
112
|
-
switch (this.
|
|
119
|
+
switch (this.dsType) {
|
|
113
120
|
case 'password':
|
|
114
121
|
return this.togglePasswordVisibility();
|
|
115
122
|
case 'search':
|
|
116
|
-
this.clearInput();
|
|
123
|
+
this.clearInput(e);
|
|
124
|
+
return;
|
|
117
125
|
default:
|
|
118
126
|
return;
|
|
119
127
|
}
|
|
@@ -122,12 +130,12 @@ export class DsTextInput {
|
|
|
122
130
|
if (this.hasPrefixSlot) {
|
|
123
131
|
return h("slot", { name: "prefix" });
|
|
124
132
|
}
|
|
125
|
-
if (this.
|
|
126
|
-
return (h("slot", { name: "prefix" }, h("span", { class: "prefix" }, this.
|
|
133
|
+
if (this.dsPrefixText) {
|
|
134
|
+
return (h("slot", { name: "prefix" }, h("span", { class: "prefix" }, this.dsPrefixText)));
|
|
127
135
|
}
|
|
128
|
-
const prefixIcon = this.
|
|
136
|
+
const prefixIcon = this.dsIcon || INPUT_TYPE_ICONS_MAP[this.dsType];
|
|
129
137
|
if (prefixIcon) {
|
|
130
|
-
return (h("slot", { name: "prefix" }, h("ds-icon", { class: "prefix",
|
|
138
|
+
return (h("slot", { name: "prefix" }, h("ds-icon", { class: "prefix", dsName: prefixIcon })));
|
|
131
139
|
}
|
|
132
140
|
return null;
|
|
133
141
|
}
|
|
@@ -135,13 +143,13 @@ export class DsTextInput {
|
|
|
135
143
|
if (this.hasSuffixSlot) {
|
|
136
144
|
return h("slot", { name: "suffix" });
|
|
137
145
|
}
|
|
138
|
-
if (this.
|
|
139
|
-
return (h("slot", { name: "suffix" }, h("span", { class: "suffix" }, this.
|
|
146
|
+
if (this.dsSuffixText) {
|
|
147
|
+
return (h("slot", { name: "suffix" }, h("span", { class: "suffix" }, this.dsSuffixText)));
|
|
140
148
|
}
|
|
141
|
-
const actionButtonIcon = INPUT_TYPE_ACTION_BUTTON_ICON_MAP[this.
|
|
142
|
-
const ariaPressed = this.
|
|
149
|
+
const actionButtonIcon = INPUT_TYPE_ACTION_BUTTON_ICON_MAP[this.dsType]?.(this) ?? '';
|
|
150
|
+
const ariaPressed = this.dsType === 'password' ? this.passwordInputVisible : undefined;
|
|
143
151
|
if (actionButtonIcon) {
|
|
144
|
-
return (h("slot", { name: "suffix" }, h("ds-button", { ref: e => (this.suffixButtonElement = e),
|
|
152
|
+
return (h("slot", { name: "suffix" }, h("ds-button", { ref: e => (this.suffixButtonElement = e), dsVariant: "supplementary", dsColour: "black", class: "suffix", dsDisabled: false, dsIcon: actionButtonIcon, onClick: this.onActionButtonClicked, "aria-pressed": ariaPressed, "aria-label": this.dsActionButtonAriaLabel })));
|
|
145
153
|
}
|
|
146
154
|
return null;
|
|
147
155
|
}
|
|
@@ -151,19 +159,21 @@ export class DsTextInput {
|
|
|
151
159
|
this.inputElement.focus();
|
|
152
160
|
}
|
|
153
161
|
render() {
|
|
154
|
-
const inputType = this.
|
|
155
|
-
return (h(Fragment, { key: '
|
|
156
|
-
disabled: this.
|
|
157
|
-
readonly: this.
|
|
158
|
-
valid: !!this.
|
|
162
|
+
const inputType = this.dsType === 'password' && this.passwordInputVisible ? 'text' : this.dsType;
|
|
163
|
+
return (h(Fragment, { key: '015e667345613d819eb885bdfde2011eefc60577' }, h("div", { key: 'abc03d3418fb9c648bc4d8039a4602366b6125c8', class: "ds-input__label-container" }, h("slot", { key: '9b660821e35939092570b4f6f449caca22771dcb', name: "label" }, h("label", { key: '96efa9db67a1f51f3380f7a3c350a8da45df9e1e', htmlFor: this.dsId }, this.getLabelText())), h("slot", { key: 'a5cb893f2c69efb68b7557fe5d253b58e7930f4c', name: "assistiveText" }, h("small", { key: '341f60604eb3b795bcaf5d81306dc349d0093647', id: this.assistiveTextId }, this.dsAssistiveText), h("ds-visually-hidden", { key: '613244a6dd9bb180a82c4250514ab74392cbaee8', id: this.visuallyHiddenAssistiveTextId }, this.dsHiddenAssistiveText))), h("div", { key: 'e0fb89582c7651eb00ec0dce5f5c4d0648840237', onMouseDown: () => (this.inputActive = true), onMouseUp: () => (this.inputActive = false), onClick: e => this.handleInputContainerClick(e), class: classNames('ds-input__container', {
|
|
164
|
+
disabled: this.dsDisabled,
|
|
165
|
+
readonly: this.dsReadonly,
|
|
166
|
+
valid: !!this.dsSuccessText,
|
|
159
167
|
invalid: !!this.validationMessage,
|
|
160
168
|
focus: this.hasFocus,
|
|
161
169
|
active: !!this.inputActive,
|
|
162
|
-
}) }, this.renderPrefixContent(), h("input", { key: '
|
|
163
|
-
classNames(
|
|
164
|
-
[this.
|
|
165
|
-
[this.
|
|
166
|
-
|
|
170
|
+
}) }, this.renderPrefixContent(), h("input", { key: '5ad15cf4d756aae913e08bfd71338ea3d80c11b9', ref: e => (this.inputElement = e), id: this.dsId, name: this.dsName, "aria-label": this.dsAriaLabel, "aria-labelledby": this.dsAriaLabelledby, "aria-describedby": this.dsAriaDescribedby ||
|
|
171
|
+
classNames({
|
|
172
|
+
[this.assistiveTextId]: !!this.dsAssistiveText,
|
|
173
|
+
[this.visuallyHiddenAssistiveTextId]: !!this.dsHiddenAssistiveText,
|
|
174
|
+
[this.errorTextId]: !!this.validationMessage,
|
|
175
|
+
[this.successTextId]: !!this.dsSuccessText,
|
|
176
|
+
}), "aria-invalid": this.validationMessage ? 'true' : 'false', disabled: this.dsDisabled, required: this.dsRequired, readonly: this.dsReadonly, value: this.dsValue, type: inputType, min: this.dsMin, max: this.dsMax, maxlength: this.dsMaxLength, pattern: this.dsPattern, placeholder: this.dsPlaceholder, autocomplete: this.dsAutocomplete, onInput: this.handleInput, onFocus: () => (this.hasFocus = true), onBlur: this.handleBlur, ...this.inheritedAttributes }), this.renderSuffixContent()), h("slot", { key: '4e378385106dd578542a99303cd4217e7bf21694', name: "validity" }, h("ds-input-validity", { key: '367fab0f5d7446f99a028e881fa5c8ab8d9829e5', id: this.errorTextId, dsText: this.validationMessage, dsType: "error", dsValidityRole: "alert" }), h("ds-input-validity", { key: '8c35c70e4beb5ade4a5f8f6fb2a35d94be57cd98', id: this.successTextId, dsText: this.dsSuccessText, dsType: "success", dsValidityRole: "status" }))));
|
|
167
177
|
}
|
|
168
178
|
static get is() { return "ds-text-input"; }
|
|
169
179
|
static get encapsulation() { return "scoped"; }
|
|
@@ -180,8 +190,9 @@ export class DsTextInput {
|
|
|
180
190
|
}
|
|
181
191
|
static get properties() {
|
|
182
192
|
return {
|
|
183
|
-
"
|
|
193
|
+
"dsLabel": {
|
|
184
194
|
"type": "string",
|
|
195
|
+
"attribute": "ds-label",
|
|
185
196
|
"mutable": false,
|
|
186
197
|
"complexType": {
|
|
187
198
|
"original": "string",
|
|
@@ -192,15 +203,15 @@ export class DsTextInput {
|
|
|
192
203
|
"optional": true,
|
|
193
204
|
"docs": {
|
|
194
205
|
"tags": [],
|
|
195
|
-
"text": ""
|
|
206
|
+
"text": "Label of the input"
|
|
196
207
|
},
|
|
197
208
|
"getter": false,
|
|
198
209
|
"setter": false,
|
|
199
|
-
"attribute": "label",
|
|
200
210
|
"reflect": false
|
|
201
211
|
},
|
|
202
|
-
"
|
|
212
|
+
"dsPlaceholder": {
|
|
203
213
|
"type": "string",
|
|
214
|
+
"attribute": "ds-placeholder",
|
|
204
215
|
"mutable": false,
|
|
205
216
|
"complexType": {
|
|
206
217
|
"original": "string",
|
|
@@ -211,15 +222,15 @@ export class DsTextInput {
|
|
|
211
222
|
"optional": true,
|
|
212
223
|
"docs": {
|
|
213
224
|
"tags": [],
|
|
214
|
-
"text": ""
|
|
225
|
+
"text": "Passed to the `placeholder` of the `input` element."
|
|
215
226
|
},
|
|
216
227
|
"getter": false,
|
|
217
228
|
"setter": false,
|
|
218
|
-
"attribute": "placeholder",
|
|
219
229
|
"reflect": false
|
|
220
230
|
},
|
|
221
|
-
"
|
|
231
|
+
"dsId": {
|
|
222
232
|
"type": "string",
|
|
233
|
+
"attribute": "ds-id",
|
|
223
234
|
"mutable": false,
|
|
224
235
|
"complexType": {
|
|
225
236
|
"original": "string",
|
|
@@ -230,16 +241,16 @@ export class DsTextInput {
|
|
|
230
241
|
"optional": true,
|
|
231
242
|
"docs": {
|
|
232
243
|
"tags": [],
|
|
233
|
-
"text": ""
|
|
244
|
+
"text": "Passed to the `id` of the `input` element."
|
|
234
245
|
},
|
|
235
246
|
"getter": false,
|
|
236
247
|
"setter": false,
|
|
237
|
-
"attribute": "id",
|
|
238
248
|
"reflect": false,
|
|
239
249
|
"defaultValue": "inputIdGenerator.next().value as string"
|
|
240
250
|
},
|
|
241
|
-
"
|
|
251
|
+
"dsName": {
|
|
242
252
|
"type": "string",
|
|
253
|
+
"attribute": "ds-name",
|
|
243
254
|
"mutable": false,
|
|
244
255
|
"complexType": {
|
|
245
256
|
"original": "string",
|
|
@@ -250,15 +261,15 @@ export class DsTextInput {
|
|
|
250
261
|
"optional": false,
|
|
251
262
|
"docs": {
|
|
252
263
|
"tags": [],
|
|
253
|
-
"text": ""
|
|
264
|
+
"text": "Passed to the `name` attribute of the `input` element."
|
|
254
265
|
},
|
|
255
266
|
"getter": false,
|
|
256
267
|
"setter": false,
|
|
257
|
-
"attribute": "name",
|
|
258
268
|
"reflect": false
|
|
259
269
|
},
|
|
260
|
-
"
|
|
270
|
+
"dsDisabled": {
|
|
261
271
|
"type": "boolean",
|
|
272
|
+
"attribute": "ds-disabled",
|
|
262
273
|
"mutable": false,
|
|
263
274
|
"complexType": {
|
|
264
275
|
"original": "boolean",
|
|
@@ -269,15 +280,15 @@ export class DsTextInput {
|
|
|
269
280
|
"optional": true,
|
|
270
281
|
"docs": {
|
|
271
282
|
"tags": [],
|
|
272
|
-
"text": ""
|
|
283
|
+
"text": "Passed to the `disabled` attribute of the `input` element."
|
|
273
284
|
},
|
|
274
285
|
"getter": false,
|
|
275
286
|
"setter": false,
|
|
276
|
-
"attribute": "disabled",
|
|
277
287
|
"reflect": false
|
|
278
288
|
},
|
|
279
|
-
"
|
|
289
|
+
"dsOptional": {
|
|
280
290
|
"type": "boolean",
|
|
291
|
+
"attribute": "ds-optional",
|
|
281
292
|
"mutable": false,
|
|
282
293
|
"complexType": {
|
|
283
294
|
"original": "boolean",
|
|
@@ -288,15 +299,15 @@ export class DsTextInput {
|
|
|
288
299
|
"optional": true,
|
|
289
300
|
"docs": {
|
|
290
301
|
"tags": [],
|
|
291
|
-
"text": ""
|
|
302
|
+
"text": "Displays indicator that the text input is optional alongside label."
|
|
292
303
|
},
|
|
293
304
|
"getter": false,
|
|
294
305
|
"setter": false,
|
|
295
|
-
"attribute": "optional",
|
|
296
306
|
"reflect": false
|
|
297
307
|
},
|
|
298
|
-
"
|
|
308
|
+
"dsRequired": {
|
|
299
309
|
"type": "boolean",
|
|
310
|
+
"attribute": "ds-required",
|
|
300
311
|
"mutable": false,
|
|
301
312
|
"complexType": {
|
|
302
313
|
"original": "boolean",
|
|
@@ -307,15 +318,15 @@ export class DsTextInput {
|
|
|
307
318
|
"optional": true,
|
|
308
319
|
"docs": {
|
|
309
320
|
"tags": [],
|
|
310
|
-
"text": ""
|
|
321
|
+
"text": "Passed to the `required` attribute of the `input` element."
|
|
311
322
|
},
|
|
312
323
|
"getter": false,
|
|
313
324
|
"setter": false,
|
|
314
|
-
"attribute": "required",
|
|
315
325
|
"reflect": false
|
|
316
326
|
},
|
|
317
|
-
"
|
|
327
|
+
"dsReadonly": {
|
|
318
328
|
"type": "boolean",
|
|
329
|
+
"attribute": "ds-readonly",
|
|
319
330
|
"mutable": false,
|
|
320
331
|
"complexType": {
|
|
321
332
|
"original": "boolean",
|
|
@@ -326,15 +337,15 @@ export class DsTextInput {
|
|
|
326
337
|
"optional": true,
|
|
327
338
|
"docs": {
|
|
328
339
|
"tags": [],
|
|
329
|
-
"text": ""
|
|
340
|
+
"text": "Passed to the `readonly` attribute of the `input` element."
|
|
330
341
|
},
|
|
331
342
|
"getter": false,
|
|
332
343
|
"setter": false,
|
|
333
|
-
"attribute": "readonly",
|
|
334
344
|
"reflect": false
|
|
335
345
|
},
|
|
336
|
-
"
|
|
346
|
+
"dsValue": {
|
|
337
347
|
"type": "string",
|
|
348
|
+
"attribute": "ds-value",
|
|
338
349
|
"mutable": false,
|
|
339
350
|
"complexType": {
|
|
340
351
|
"original": "string",
|
|
@@ -345,15 +356,15 @@ export class DsTextInput {
|
|
|
345
356
|
"optional": true,
|
|
346
357
|
"docs": {
|
|
347
358
|
"tags": [],
|
|
348
|
-
"text": ""
|
|
359
|
+
"text": "Passed to the `value` attribute of the `input` element."
|
|
349
360
|
},
|
|
350
361
|
"getter": false,
|
|
351
362
|
"setter": false,
|
|
352
|
-
"attribute": "value",
|
|
353
363
|
"reflect": false
|
|
354
364
|
},
|
|
355
|
-
"
|
|
365
|
+
"dsMin": {
|
|
356
366
|
"type": "number",
|
|
367
|
+
"attribute": "ds-min",
|
|
357
368
|
"mutable": false,
|
|
358
369
|
"complexType": {
|
|
359
370
|
"original": "number",
|
|
@@ -364,15 +375,15 @@ export class DsTextInput {
|
|
|
364
375
|
"optional": true,
|
|
365
376
|
"docs": {
|
|
366
377
|
"tags": [],
|
|
367
|
-
"text": ""
|
|
378
|
+
"text": "Passed to the `min` attribute of the `input` element."
|
|
368
379
|
},
|
|
369
380
|
"getter": false,
|
|
370
381
|
"setter": false,
|
|
371
|
-
"attribute": "min",
|
|
372
382
|
"reflect": false
|
|
373
383
|
},
|
|
374
|
-
"
|
|
384
|
+
"dsMax": {
|
|
375
385
|
"type": "number",
|
|
386
|
+
"attribute": "ds-max",
|
|
376
387
|
"mutable": false,
|
|
377
388
|
"complexType": {
|
|
378
389
|
"original": "number",
|
|
@@ -383,15 +394,15 @@ export class DsTextInput {
|
|
|
383
394
|
"optional": true,
|
|
384
395
|
"docs": {
|
|
385
396
|
"tags": [],
|
|
386
|
-
"text": ""
|
|
397
|
+
"text": "Passed to the `max` attribute of the `input` element."
|
|
387
398
|
},
|
|
388
399
|
"getter": false,
|
|
389
400
|
"setter": false,
|
|
390
|
-
"attribute": "max",
|
|
391
401
|
"reflect": false
|
|
392
402
|
},
|
|
393
|
-
"
|
|
403
|
+
"dsMaxLength": {
|
|
394
404
|
"type": "number",
|
|
405
|
+
"attribute": "ds-max-length",
|
|
395
406
|
"mutable": false,
|
|
396
407
|
"complexType": {
|
|
397
408
|
"original": "number",
|
|
@@ -402,15 +413,15 @@ export class DsTextInput {
|
|
|
402
413
|
"optional": true,
|
|
403
414
|
"docs": {
|
|
404
415
|
"tags": [],
|
|
405
|
-
"text": ""
|
|
416
|
+
"text": "Passed to the `maxlength` attribute of the `input` element."
|
|
406
417
|
},
|
|
407
418
|
"getter": false,
|
|
408
419
|
"setter": false,
|
|
409
|
-
"attribute": "maxlength",
|
|
410
420
|
"reflect": false
|
|
411
421
|
},
|
|
412
|
-
"
|
|
422
|
+
"dsPattern": {
|
|
413
423
|
"type": "string",
|
|
424
|
+
"attribute": "ds-pattern",
|
|
414
425
|
"mutable": false,
|
|
415
426
|
"complexType": {
|
|
416
427
|
"original": "string",
|
|
@@ -421,15 +432,15 @@ export class DsTextInput {
|
|
|
421
432
|
"optional": true,
|
|
422
433
|
"docs": {
|
|
423
434
|
"tags": [],
|
|
424
|
-
"text": ""
|
|
435
|
+
"text": "Passed to the `pattern` attribute of the `input` element."
|
|
425
436
|
},
|
|
426
437
|
"getter": false,
|
|
427
438
|
"setter": false,
|
|
428
|
-
"attribute": "pattern",
|
|
429
439
|
"reflect": false
|
|
430
440
|
},
|
|
431
|
-
"
|
|
441
|
+
"dsAutocomplete": {
|
|
432
442
|
"type": "string",
|
|
443
|
+
"attribute": "ds-autocomplete",
|
|
433
444
|
"mutable": false,
|
|
434
445
|
"complexType": {
|
|
435
446
|
"original": "string",
|
|
@@ -440,15 +451,15 @@ export class DsTextInput {
|
|
|
440
451
|
"optional": true,
|
|
441
452
|
"docs": {
|
|
442
453
|
"tags": [],
|
|
443
|
-
"text": ""
|
|
454
|
+
"text": "Passed to the `autocomplete` attribute of the `input` element."
|
|
444
455
|
},
|
|
445
456
|
"getter": false,
|
|
446
457
|
"setter": false,
|
|
447
|
-
"attribute": "autocomplete",
|
|
448
458
|
"reflect": false
|
|
449
459
|
},
|
|
450
|
-
"
|
|
460
|
+
"dsOptionalText": {
|
|
451
461
|
"type": "string",
|
|
462
|
+
"attribute": "ds-optional-text",
|
|
452
463
|
"mutable": false,
|
|
453
464
|
"complexType": {
|
|
454
465
|
"original": "string",
|
|
@@ -459,15 +470,15 @@ export class DsTextInput {
|
|
|
459
470
|
"optional": true,
|
|
460
471
|
"docs": {
|
|
461
472
|
"tags": [],
|
|
462
|
-
"text": ""
|
|
473
|
+
"text": "Text shown alongside label, if the text input is set as optional."
|
|
463
474
|
},
|
|
464
475
|
"getter": false,
|
|
465
476
|
"setter": false,
|
|
466
|
-
"attribute": "optional-text",
|
|
467
477
|
"reflect": false
|
|
468
478
|
},
|
|
469
|
-
"
|
|
479
|
+
"dsErrorText": {
|
|
470
480
|
"type": "string",
|
|
481
|
+
"attribute": "ds-error-text",
|
|
471
482
|
"mutable": false,
|
|
472
483
|
"complexType": {
|
|
473
484
|
"original": "string",
|
|
@@ -478,15 +489,15 @@ export class DsTextInput {
|
|
|
478
489
|
"optional": true,
|
|
479
490
|
"docs": {
|
|
480
491
|
"tags": [],
|
|
481
|
-
"text": ""
|
|
492
|
+
"text": "Error message shown below the text input.\nIf set, the text input is shown in an invalid state."
|
|
482
493
|
},
|
|
483
494
|
"getter": false,
|
|
484
495
|
"setter": false,
|
|
485
|
-
"attribute": "error-text",
|
|
486
496
|
"reflect": false
|
|
487
497
|
},
|
|
488
|
-
"
|
|
498
|
+
"dsSuccessText": {
|
|
489
499
|
"type": "string",
|
|
500
|
+
"attribute": "ds-success-text",
|
|
490
501
|
"mutable": false,
|
|
491
502
|
"complexType": {
|
|
492
503
|
"original": "string",
|
|
@@ -497,15 +508,15 @@ export class DsTextInput {
|
|
|
497
508
|
"optional": true,
|
|
498
509
|
"docs": {
|
|
499
510
|
"tags": [],
|
|
500
|
-
"text": ""
|
|
511
|
+
"text": "Success message shown below the text input.\nIf set, the text input is shown in a success state."
|
|
501
512
|
},
|
|
502
513
|
"getter": false,
|
|
503
514
|
"setter": false,
|
|
504
|
-
"attribute": "success-text",
|
|
505
515
|
"reflect": false
|
|
506
516
|
},
|
|
507
|
-
"
|
|
517
|
+
"dsAssistiveText": {
|
|
508
518
|
"type": "string",
|
|
519
|
+
"attribute": "ds-assistive-text",
|
|
509
520
|
"mutable": false,
|
|
510
521
|
"complexType": {
|
|
511
522
|
"original": "string",
|
|
@@ -516,15 +527,15 @@ export class DsTextInput {
|
|
|
516
527
|
"optional": true,
|
|
517
528
|
"docs": {
|
|
518
529
|
"tags": [],
|
|
519
|
-
"text": ""
|
|
530
|
+
"text": "Text for additional information shown below label"
|
|
520
531
|
},
|
|
521
532
|
"getter": false,
|
|
522
533
|
"setter": false,
|
|
523
|
-
"attribute": "assistive-text",
|
|
524
534
|
"reflect": false
|
|
525
535
|
},
|
|
526
|
-
"
|
|
536
|
+
"dsActionButtonAriaLabel": {
|
|
527
537
|
"type": "string",
|
|
538
|
+
"attribute": "ds-action-button-aria-label",
|
|
528
539
|
"mutable": false,
|
|
529
540
|
"complexType": {
|
|
530
541
|
"original": "string",
|
|
@@ -535,15 +546,15 @@ export class DsTextInput {
|
|
|
535
546
|
"optional": true,
|
|
536
547
|
"docs": {
|
|
537
548
|
"tags": [],
|
|
538
|
-
"text": ""
|
|
549
|
+
"text": "Aria-label for action button for text inputs with type `password` or `search`.\nThe action button for `search` text input is the clear button.\nThe action button for `password` text input is the toggle visibility button."
|
|
539
550
|
},
|
|
540
551
|
"getter": false,
|
|
541
552
|
"setter": false,
|
|
542
|
-
"attribute": "action-button-aria-label",
|
|
543
553
|
"reflect": false
|
|
544
554
|
},
|
|
545
|
-
"
|
|
555
|
+
"dsHiddenAssistiveText": {
|
|
546
556
|
"type": "string",
|
|
557
|
+
"attribute": "ds-hidden-assistive-text",
|
|
547
558
|
"mutable": false,
|
|
548
559
|
"complexType": {
|
|
549
560
|
"original": "string",
|
|
@@ -554,15 +565,15 @@ export class DsTextInput {
|
|
|
554
565
|
"optional": true,
|
|
555
566
|
"docs": {
|
|
556
567
|
"tags": [],
|
|
557
|
-
"text": ""
|
|
568
|
+
"text": "Visually hidden additional information for screen readers"
|
|
558
569
|
},
|
|
559
570
|
"getter": false,
|
|
560
571
|
"setter": false,
|
|
561
|
-
"attribute": "hidden-assistive-text",
|
|
562
572
|
"reflect": false
|
|
563
573
|
},
|
|
564
|
-
"
|
|
574
|
+
"dsPrefixText": {
|
|
565
575
|
"type": "string",
|
|
576
|
+
"attribute": "ds-prefix-text",
|
|
566
577
|
"mutable": false,
|
|
567
578
|
"complexType": {
|
|
568
579
|
"original": "string",
|
|
@@ -573,15 +584,15 @@ export class DsTextInput {
|
|
|
573
584
|
"optional": true,
|
|
574
585
|
"docs": {
|
|
575
586
|
"tags": [],
|
|
576
|
-
"text": ""
|
|
587
|
+
"text": "Allows additional elements before or after the input field, such as units (e.g., currency, minutes, country codes)."
|
|
577
588
|
},
|
|
578
589
|
"getter": false,
|
|
579
590
|
"setter": false,
|
|
580
|
-
"attribute": "prefix-text",
|
|
581
591
|
"reflect": false
|
|
582
592
|
},
|
|
583
|
-
"
|
|
593
|
+
"dsSuffixText": {
|
|
584
594
|
"type": "string",
|
|
595
|
+
"attribute": "ds-suffix-text",
|
|
585
596
|
"mutable": false,
|
|
586
597
|
"complexType": {
|
|
587
598
|
"original": "string",
|
|
@@ -592,15 +603,15 @@ export class DsTextInput {
|
|
|
592
603
|
"optional": true,
|
|
593
604
|
"docs": {
|
|
594
605
|
"tags": [],
|
|
595
|
-
"text": ""
|
|
606
|
+
"text": "Allows additional elements before or after the input field, such as units (e.g., currency, minutes, country codes)."
|
|
596
607
|
},
|
|
597
608
|
"getter": false,
|
|
598
609
|
"setter": false,
|
|
599
|
-
"attribute": "suffix-text",
|
|
600
610
|
"reflect": false
|
|
601
611
|
},
|
|
602
|
-
"
|
|
612
|
+
"dsIcon": {
|
|
603
613
|
"type": "string",
|
|
614
|
+
"attribute": "ds-icon",
|
|
604
615
|
"mutable": false,
|
|
605
616
|
"complexType": {
|
|
606
617
|
"original": "string",
|
|
@@ -611,16 +622,16 @@ export class DsTextInput {
|
|
|
611
622
|
"optional": false,
|
|
612
623
|
"docs": {
|
|
613
624
|
"tags": [],
|
|
614
|
-
"text": ""
|
|
625
|
+
"text": "Icon to display at the start of the text input."
|
|
615
626
|
},
|
|
616
627
|
"getter": false,
|
|
617
628
|
"setter": false,
|
|
618
|
-
"attribute": "icon",
|
|
619
629
|
"reflect": false,
|
|
620
630
|
"defaultValue": "''"
|
|
621
631
|
},
|
|
622
|
-
"
|
|
632
|
+
"dsType": {
|
|
623
633
|
"type": "string",
|
|
634
|
+
"attribute": "ds-type",
|
|
624
635
|
"mutable": false,
|
|
625
636
|
"complexType": {
|
|
626
637
|
"original": "DsTextInputType",
|
|
@@ -637,16 +648,16 @@ export class DsTextInput {
|
|
|
637
648
|
"optional": false,
|
|
638
649
|
"docs": {
|
|
639
650
|
"tags": [],
|
|
640
|
-
"text": ""
|
|
651
|
+
"text": "Type of the text input, passed to the `type` attribute of the `input` element.\nA text input of type `search` has an action button to clear the input value if it is not empty.\nA text input of type `password` has an action button to toggle the visibility of the entered input."
|
|
641
652
|
},
|
|
642
653
|
"getter": false,
|
|
643
654
|
"setter": false,
|
|
644
|
-
"attribute": "type",
|
|
645
655
|
"reflect": false,
|
|
646
656
|
"defaultValue": "'text'"
|
|
647
657
|
},
|
|
648
|
-
"
|
|
658
|
+
"dsAriaLabel": {
|
|
649
659
|
"type": "string",
|
|
660
|
+
"attribute": "ds-aria-label",
|
|
650
661
|
"mutable": false,
|
|
651
662
|
"complexType": {
|
|
652
663
|
"original": "string",
|
|
@@ -657,15 +668,15 @@ export class DsTextInput {
|
|
|
657
668
|
"optional": false,
|
|
658
669
|
"docs": {
|
|
659
670
|
"tags": [],
|
|
660
|
-
"text": ""
|
|
671
|
+
"text": "Passed to the `aria-label` attribute of the `input` element."
|
|
661
672
|
},
|
|
662
673
|
"getter": false,
|
|
663
674
|
"setter": false,
|
|
664
|
-
"attribute": "aria-label",
|
|
665
675
|
"reflect": false
|
|
666
676
|
},
|
|
667
|
-
"
|
|
677
|
+
"dsAriaLabelledby": {
|
|
668
678
|
"type": "string",
|
|
679
|
+
"attribute": "ds-aria-labelledby",
|
|
669
680
|
"mutable": false,
|
|
670
681
|
"complexType": {
|
|
671
682
|
"original": "string",
|
|
@@ -676,15 +687,15 @@ export class DsTextInput {
|
|
|
676
687
|
"optional": true,
|
|
677
688
|
"docs": {
|
|
678
689
|
"tags": [],
|
|
679
|
-
"text": ""
|
|
690
|
+
"text": "Passed to the `aria-labelledby` attribute of the `input` element."
|
|
680
691
|
},
|
|
681
692
|
"getter": false,
|
|
682
693
|
"setter": false,
|
|
683
|
-
"attribute": "aria-labelledby",
|
|
684
694
|
"reflect": false
|
|
685
695
|
},
|
|
686
|
-
"
|
|
696
|
+
"dsAriaDescribedby": {
|
|
687
697
|
"type": "string",
|
|
698
|
+
"attribute": "ds-aria-describedby",
|
|
688
699
|
"mutable": false,
|
|
689
700
|
"complexType": {
|
|
690
701
|
"original": "string",
|
|
@@ -695,11 +706,10 @@ export class DsTextInput {
|
|
|
695
706
|
"optional": true,
|
|
696
707
|
"docs": {
|
|
697
708
|
"tags": [],
|
|
698
|
-
"text": ""
|
|
709
|
+
"text": "Passed to the `aria-describedby` attribute of the `input` element."
|
|
699
710
|
},
|
|
700
711
|
"getter": false,
|
|
701
712
|
"setter": false,
|
|
702
|
-
"attribute": "aria-describedby",
|
|
703
713
|
"reflect": false
|
|
704
714
|
}
|
|
705
715
|
};
|
|
@@ -715,23 +725,73 @@ export class DsTextInput {
|
|
|
715
725
|
}
|
|
716
726
|
static get events() {
|
|
717
727
|
return [{
|
|
718
|
-
"method": "
|
|
719
|
-
"name": "
|
|
728
|
+
"method": "dsChange",
|
|
729
|
+
"name": "dsChange",
|
|
730
|
+
"bubbles": true,
|
|
731
|
+
"cancelable": true,
|
|
732
|
+
"composed": true,
|
|
733
|
+
"docs": {
|
|
734
|
+
"tags": [],
|
|
735
|
+
"text": "The `dsChange` event is fired each time the `value` property of\nthe `ds-text-input` element is changed. This may be a side effect\nof other events such as `dsClear` or `dsInput` event, or when the\n`value` property is programmatically changed."
|
|
736
|
+
},
|
|
737
|
+
"complexType": {
|
|
738
|
+
"original": "Omit<DsTextInputEvent, 'event'>",
|
|
739
|
+
"resolved": "{ value: string; }",
|
|
740
|
+
"references": {
|
|
741
|
+
"Omit": {
|
|
742
|
+
"location": "global",
|
|
743
|
+
"id": "global::Omit"
|
|
744
|
+
},
|
|
745
|
+
"DsTextInputEvent": {
|
|
746
|
+
"location": "local",
|
|
747
|
+
"path": "/Users/teemuparssinen/hy/uh-design-system/component-library/packages/component-library/src/components/01-base-components/ds-text-input/ds-text-input.tsx",
|
|
748
|
+
"id": "src/components/01-base-components/ds-text-input/ds-text-input.tsx::DsTextInputEvent"
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
}, {
|
|
753
|
+
"method": "dsInput",
|
|
754
|
+
"name": "dsInput",
|
|
720
755
|
"bubbles": true,
|
|
721
756
|
"cancelable": true,
|
|
722
757
|
"composed": true,
|
|
723
758
|
"docs": {
|
|
724
759
|
"tags": [],
|
|
725
|
-
"text": ""
|
|
760
|
+
"text": "The `dsInput` event is fired when the user modifies the input's value.\nThe event is fired on each keystroke."
|
|
726
761
|
},
|
|
727
762
|
"complexType": {
|
|
728
|
-
"original": "
|
|
729
|
-
"resolved": "
|
|
763
|
+
"original": "DsTextInputEvent<InputEvent>",
|
|
764
|
+
"resolved": "{ event: InputEvent; value: string; }",
|
|
730
765
|
"references": {
|
|
731
|
-
"
|
|
766
|
+
"DsTextInputEvent": {
|
|
732
767
|
"location": "local",
|
|
733
768
|
"path": "/Users/teemuparssinen/hy/uh-design-system/component-library/packages/component-library/src/components/01-base-components/ds-text-input/ds-text-input.tsx",
|
|
734
|
-
"id": "src/components/01-base-components/ds-text-input/ds-text-input.tsx::
|
|
769
|
+
"id": "src/components/01-base-components/ds-text-input/ds-text-input.tsx::DsTextInputEvent"
|
|
770
|
+
},
|
|
771
|
+
"InputEvent": {
|
|
772
|
+
"location": "global",
|
|
773
|
+
"id": "global::InputEvent"
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
}, {
|
|
778
|
+
"method": "dsClear",
|
|
779
|
+
"name": "dsClear",
|
|
780
|
+
"bubbles": true,
|
|
781
|
+
"cancelable": true,
|
|
782
|
+
"composed": true,
|
|
783
|
+
"docs": {
|
|
784
|
+
"tags": [],
|
|
785
|
+
"text": "The `dsClear` event is fired when the clear button of a input of type `search`\nis pressed."
|
|
786
|
+
},
|
|
787
|
+
"complexType": {
|
|
788
|
+
"original": "DsTextInputEvent",
|
|
789
|
+
"resolved": "{ event: Event; value: string; }",
|
|
790
|
+
"references": {
|
|
791
|
+
"DsTextInputEvent": {
|
|
792
|
+
"location": "local",
|
|
793
|
+
"path": "/Users/teemuparssinen/hy/uh-design-system/component-library/packages/component-library/src/components/01-base-components/ds-text-input/ds-text-input.tsx",
|
|
794
|
+
"id": "src/components/01-base-components/ds-text-input/ds-text-input.tsx::DsTextInputEvent"
|
|
735
795
|
}
|
|
736
796
|
}
|
|
737
797
|
}
|
|
@@ -758,12 +818,21 @@ export class DsTextInput {
|
|
|
758
818
|
},
|
|
759
819
|
"clearInput": {
|
|
760
820
|
"complexType": {
|
|
761
|
-
"signature": "() => Promise<void>",
|
|
762
|
-
"parameters": [
|
|
821
|
+
"signature": "(e: Event) => Promise<void>",
|
|
822
|
+
"parameters": [{
|
|
823
|
+
"name": "e",
|
|
824
|
+
"type": "Event",
|
|
825
|
+
"docs": ""
|
|
826
|
+
}],
|
|
763
827
|
"references": {
|
|
764
828
|
"Promise": {
|
|
765
829
|
"location": "global",
|
|
766
830
|
"id": "global::Promise"
|
|
831
|
+
},
|
|
832
|
+
"Event": {
|
|
833
|
+
"location": "import",
|
|
834
|
+
"path": "@stencil/core",
|
|
835
|
+
"id": "../../node_modules/@stencil/core/internal/stencil-core/index.d.ts::Event"
|
|
767
836
|
}
|
|
768
837
|
},
|
|
769
838
|
"return": "Promise<void>"
|
|
@@ -776,5 +845,11 @@ export class DsTextInput {
|
|
|
776
845
|
};
|
|
777
846
|
}
|
|
778
847
|
static get elementRef() { return "el"; }
|
|
848
|
+
static get watchers() {
|
|
849
|
+
return [{
|
|
850
|
+
"propName": "value",
|
|
851
|
+
"methodName": "valueObserver"
|
|
852
|
+
}];
|
|
853
|
+
}
|
|
779
854
|
static get attachInternalsMemberName() { return "internals"; }
|
|
780
855
|
}
|