@politiet/sheriff-web-components 2.9.0 → 2.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/custom-elements.json +1127 -189
  2. package/dist/frameworks/preact.d.ts +7 -1
  3. package/dist/frameworks/preact.d.ts.map +1 -1
  4. package/dist/frameworks/react.d.ts +7 -1
  5. package/dist/frameworks/react.d.ts.map +1 -1
  6. package/dist/frameworks/solidjs.d.ts +2 -0
  7. package/dist/frameworks/solidjs.d.ts.map +1 -1
  8. package/dist/frameworks/svelte.d.ts +2 -0
  9. package/dist/frameworks/svelte.d.ts.map +1 -1
  10. package/dist/frameworks/vue.d.ts +2 -0
  11. package/dist/frameworks/vue.d.ts.map +1 -1
  12. package/dist/index.d.ts +5 -1
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +2 -0
  15. package/dist/index.js.map +1 -1
  16. package/dist/react-wrappers/SDSEnvironmentBannerWrapper.d.ts +3 -0
  17. package/dist/react-wrappers/SDSEnvironmentBannerWrapper.d.ts.map +1 -0
  18. package/dist/react-wrappers/SDSEnvironmentBannerWrapper.js +10 -0
  19. package/dist/react-wrappers/SDSEnvironmentBannerWrapper.js.map +1 -0
  20. package/dist/react-wrappers/SDSInternalHeaderWrapper.d.ts +3 -0
  21. package/dist/react-wrappers/SDSInternalHeaderWrapper.d.ts.map +1 -0
  22. package/dist/react-wrappers/SDSInternalHeaderWrapper.js +10 -0
  23. package/dist/react-wrappers/SDSInternalHeaderWrapper.js.map +1 -0
  24. package/dist/react-wrappers/index.d.ts +2 -0
  25. package/dist/react-wrappers/index.d.ts.map +1 -1
  26. package/dist/react-wrappers/index.js +2 -0
  27. package/dist/react-wrappers/index.js.map +1 -1
  28. package/dist/sds-alert/sds-alert.component.d.ts +2 -2
  29. package/dist/sds-alert/sds-alert.component.d.ts.map +1 -1
  30. package/dist/sds-alert/sds-alert.component.js +3 -2
  31. package/dist/sds-alert/sds-alert.component.js.map +1 -1
  32. package/dist/sds-button/sds-button.component.d.ts +3 -2
  33. package/dist/sds-button/sds-button.component.d.ts.map +1 -1
  34. package/dist/sds-button/sds-button.component.js +4 -3
  35. package/dist/sds-button/sds-button.component.js.map +1 -1
  36. package/dist/sds-card/sds-card.d.ts +2 -2
  37. package/dist/sds-card/sds-card.d.ts.map +1 -1
  38. package/dist/sds-card/sds-card.js +3 -2
  39. package/dist/sds-card/sds-card.js.map +1 -1
  40. package/dist/sds-checkbox/sds-checkbox.d.ts +3 -2
  41. package/dist/sds-checkbox/sds-checkbox.d.ts.map +1 -1
  42. package/dist/sds-checkbox/sds-checkbox.js +3 -2
  43. package/dist/sds-checkbox/sds-checkbox.js.map +1 -1
  44. package/dist/sds-checkbox-group/sds-checkbox-group.d.ts +2 -2
  45. package/dist/sds-checkbox-group/sds-checkbox-group.d.ts.map +1 -1
  46. package/dist/sds-checkbox-group/sds-checkbox-group.js +3 -2
  47. package/dist/sds-checkbox-group/sds-checkbox-group.js.map +1 -1
  48. package/dist/sds-chip/sds-chip.d.ts +2 -2
  49. package/dist/sds-chip/sds-chip.d.ts.map +1 -1
  50. package/dist/sds-chip/sds-chip.js +3 -2
  51. package/dist/sds-chip/sds-chip.js.map +1 -1
  52. package/dist/sds-details/sds-details.d.ts +2 -2
  53. package/dist/sds-details/sds-details.d.ts.map +1 -1
  54. package/dist/sds-details/sds-details.js +3 -2
  55. package/dist/sds-details/sds-details.js.map +1 -1
  56. package/dist/sds-details-group/sds-details-group.d.ts +2 -2
  57. package/dist/sds-details-group/sds-details-group.d.ts.map +1 -1
  58. package/dist/sds-details-group/sds-details-group.js +3 -2
  59. package/dist/sds-details-group/sds-details-group.js.map +1 -1
  60. package/dist/sds-dialog/sds-dialog.component.d.ts +3 -2
  61. package/dist/sds-dialog/sds-dialog.component.d.ts.map +1 -1
  62. package/dist/sds-dialog/sds-dialog.component.js +3 -2
  63. package/dist/sds-dialog/sds-dialog.component.js.map +1 -1
  64. package/dist/sds-environment-banner/sds-environment-banner.component.d.ts +13 -0
  65. package/dist/sds-environment-banner/sds-environment-banner.component.d.ts.map +1 -0
  66. package/dist/sds-environment-banner/sds-environment-banner.component.js +36 -0
  67. package/dist/sds-environment-banner/sds-environment-banner.component.js.map +1 -0
  68. package/dist/sds-environment-banner/sds-environment-banner.d.ts +9 -0
  69. package/dist/sds-environment-banner/sds-environment-banner.d.ts.map +1 -0
  70. package/dist/sds-environment-banner/sds-environment-banner.js +15 -0
  71. package/dist/sds-environment-banner/sds-environment-banner.js.map +1 -0
  72. package/dist/sds-environment-banner/sds-environment-banner.styles.d.ts +2 -0
  73. package/dist/sds-environment-banner/sds-environment-banner.styles.d.ts.map +1 -0
  74. package/dist/sds-environment-banner/sds-environment-banner.styles.js +98 -0
  75. package/dist/sds-environment-banner/sds-environment-banner.styles.js.map +1 -0
  76. package/dist/sds-heading/sds-heading.component.d.ts +2 -2
  77. package/dist/sds-heading/sds-heading.component.d.ts.map +1 -1
  78. package/dist/sds-heading/sds-heading.component.js +3 -2
  79. package/dist/sds-heading/sds-heading.component.js.map +1 -1
  80. package/dist/sds-icon/sds-icon-names.d.ts +1 -1
  81. package/dist/sds-icon/sds-icon-names.d.ts.map +1 -1
  82. package/dist/sds-icon/sds-icon-names.js +484 -0
  83. package/dist/sds-icon/sds-icon-names.js.map +1 -1
  84. package/dist/sds-icon/sds-icon.component.d.ts +2 -2
  85. package/dist/sds-icon/sds-icon.component.d.ts.map +1 -1
  86. package/dist/sds-icon/sds-icon.component.js +3 -2
  87. package/dist/sds-icon/sds-icon.component.js.map +1 -1
  88. package/dist/sds-internal-header/sds-internal-header.component.d.ts +14 -0
  89. package/dist/sds-internal-header/sds-internal-header.component.d.ts.map +1 -0
  90. package/dist/sds-internal-header/sds-internal-header.component.js +54 -0
  91. package/dist/sds-internal-header/sds-internal-header.component.js.map +1 -0
  92. package/dist/sds-internal-header/sds-internal-header.d.ts +10 -0
  93. package/dist/sds-internal-header/sds-internal-header.d.ts.map +1 -0
  94. package/dist/sds-internal-header/sds-internal-header.js +15 -0
  95. package/dist/sds-internal-header/sds-internal-header.js.map +1 -0
  96. package/dist/sds-internal-header/sds-internal-header.styles.d.ts +2 -0
  97. package/dist/sds-internal-header/sds-internal-header.styles.d.ts.map +1 -0
  98. package/dist/sds-internal-header/sds-internal-header.styles.js +122 -0
  99. package/dist/sds-internal-header/sds-internal-header.styles.js.map +1 -0
  100. package/dist/sds-loader/sds-loader.d.ts +2 -2
  101. package/dist/sds-loader/sds-loader.d.ts.map +1 -1
  102. package/dist/sds-loader/sds-loader.js +3 -2
  103. package/dist/sds-loader/sds-loader.js.map +1 -1
  104. package/dist/sds-notification/sds-notification.d.ts +3 -2
  105. package/dist/sds-notification/sds-notification.d.ts.map +1 -1
  106. package/dist/sds-notification/sds-notification.js +3 -2
  107. package/dist/sds-notification/sds-notification.js.map +1 -1
  108. package/dist/sds-popover/sds-popover.d.ts +4 -3
  109. package/dist/sds-popover/sds-popover.d.ts.map +1 -1
  110. package/dist/sds-popover/sds-popover.js +3 -2
  111. package/dist/sds-popover/sds-popover.js.map +1 -1
  112. package/dist/sds-process/sds-process.d.ts +2 -2
  113. package/dist/sds-process/sds-process.d.ts.map +1 -1
  114. package/dist/sds-process/sds-process.js +3 -2
  115. package/dist/sds-process/sds-process.js.map +1 -1
  116. package/dist/sds-process-step/sds-process-step.d.ts +2 -2
  117. package/dist/sds-process-step/sds-process-step.d.ts.map +1 -1
  118. package/dist/sds-process-step/sds-process-step.js +3 -2
  119. package/dist/sds-process-step/sds-process-step.js.map +1 -1
  120. package/dist/sds-radio/sds-radio.d.ts +3 -2
  121. package/dist/sds-radio/sds-radio.d.ts.map +1 -1
  122. package/dist/sds-radio/sds-radio.js +7 -2
  123. package/dist/sds-radio/sds-radio.js.map +1 -1
  124. package/dist/sds-radio-group/sds-radio-group.d.ts +2 -2
  125. package/dist/sds-radio-group/sds-radio-group.d.ts.map +1 -1
  126. package/dist/sds-radio-group/sds-radio-group.js +3 -2
  127. package/dist/sds-radio-group/sds-radio-group.js.map +1 -1
  128. package/dist/sds-select/sds-select.component.d.ts +2 -2
  129. package/dist/sds-select/sds-select.component.d.ts.map +1 -1
  130. package/dist/sds-select/sds-select.component.js +7 -2
  131. package/dist/sds-select/sds-select.component.js.map +1 -1
  132. package/dist/sds-select/sds-select.styles.d.ts.map +1 -1
  133. package/dist/sds-select/sds-select.styles.js +12 -18
  134. package/dist/sds-select/sds-select.styles.js.map +1 -1
  135. package/dist/sds-stepper/sds-stepper.d.ts +2 -2
  136. package/dist/sds-stepper/sds-stepper.d.ts.map +1 -1
  137. package/dist/sds-stepper/sds-stepper.js +3 -2
  138. package/dist/sds-stepper/sds-stepper.js.map +1 -1
  139. package/dist/sds-stepper-step/sds-stepper-step.d.ts +2 -2
  140. package/dist/sds-stepper-step/sds-stepper-step.d.ts.map +1 -1
  141. package/dist/sds-stepper-step/sds-stepper-step.js +4 -3
  142. package/dist/sds-stepper-step/sds-stepper-step.js.map +1 -1
  143. package/dist/sds-switch/sds-switch.d.ts +2 -2
  144. package/dist/sds-switch/sds-switch.d.ts.map +1 -1
  145. package/dist/sds-switch/sds-switch.js +3 -2
  146. package/dist/sds-switch/sds-switch.js.map +1 -1
  147. package/dist/sds-tag/sds-tag.d.ts +2 -2
  148. package/dist/sds-tag/sds-tag.d.ts.map +1 -1
  149. package/dist/sds-tag/sds-tag.js +3 -2
  150. package/dist/sds-tag/sds-tag.js.map +1 -1
  151. package/dist/sds-text/sds-text.component.d.ts +2 -2
  152. package/dist/sds-text/sds-text.component.d.ts.map +1 -1
  153. package/dist/sds-text/sds-text.component.js +3 -2
  154. package/dist/sds-text/sds-text.component.js.map +1 -1
  155. package/dist/sds-textarea/sds-textarea.d.ts +2 -2
  156. package/dist/sds-textarea/sds-textarea.d.ts.map +1 -1
  157. package/dist/sds-textarea/sds-textarea.js +3 -2
  158. package/dist/sds-textarea/sds-textarea.js.map +1 -1
  159. package/dist/sds-textfield/sds-textfield.component.d.ts +68 -0
  160. package/dist/sds-textfield/sds-textfield.component.d.ts.map +1 -0
  161. package/dist/sds-textfield/sds-textfield.component.js +250 -0
  162. package/dist/sds-textfield/sds-textfield.component.js.map +1 -0
  163. package/dist/sds-textfield/sds-textfield.d.ts +3 -66
  164. package/dist/sds-textfield/sds-textfield.d.ts.map +1 -1
  165. package/dist/sds-textfield/sds-textfield.js +2 -241
  166. package/dist/sds-textfield/sds-textfield.js.map +1 -1
  167. package/dist/sds-tooltip/sds-tooltip.d.ts +4 -3
  168. package/dist/sds-tooltip/sds-tooltip.d.ts.map +1 -1
  169. package/dist/sds-tooltip/sds-tooltip.js +3 -2
  170. package/dist/sds-tooltip/sds-tooltip.js.map +1 -1
  171. package/dist/sds-tooltip/sds-tooltip.styles.js +8 -8
  172. package/dist/sds-tooltip/sds-tooltip.styles.js.map +1 -1
  173. package/dist/sheriff-web-components.js +389 -159
  174. package/dist/utils/sds-element.d.ts +5 -0
  175. package/dist/utils/sds-element.d.ts.map +1 -0
  176. package/dist/utils/sds-element.js +9 -0
  177. package/dist/utils/sds-element.js.map +1 -0
  178. package/dist/version.d.ts +2 -0
  179. package/dist/version.d.ts.map +1 -0
  180. package/dist/version.js +3 -0
  181. package/dist/version.js.map +1 -0
  182. package/package.json +18 -4
  183. package/web-types.json +584 -3
@@ -0,0 +1,68 @@
1
+ import { SDSElement } from '../utils/sds-element';
2
+ import type { SDSFormControlAttributes } from '../mixins/sds-form-control-mixin';
3
+ import { SDS_SIZES } from '../types';
4
+ type InputType = 'hidden' | 'text' | 'search' | 'tel' | 'url' | 'email' | 'password' | 'datetime' | 'date' | 'month' | 'week' | 'time' | 'datetime-local' | 'number' | 'range' | 'color' | 'checkbox' | 'radio' | 'file' | 'submit' | 'image' | 'reset' | 'button';
5
+ type InputSize = Extract<SDS_SIZES, 'lg' | 'md' | 'sm'>;
6
+ export type AutocompleteTypes = 'off' | 'on' | 'name' | 'honorific-prefix' | 'given-name' | 'additional-name' | 'family-name' | 'honorific-suffix' | 'nickname' | 'email' | 'username' | 'new-password' | 'current-password' | 'one-time-code' | 'organization-title' | 'organization' | 'street-address' | 'address-line1' | 'address-line2' | 'address-line3' | 'address-level4' | 'address-level3' | 'address-level2' | 'address-level1' | 'country' | 'country-name' | 'postal-code' | 'cc-name' | 'cc-given-name' | 'cc-additional-name' | 'cc-family-name' | 'cc-number' | 'cc-exp' | 'cc-exp-month' | 'cc-exp-year' | 'cc-csc' | 'cc-type' | 'transaction-currency' | 'transaction-amount' | 'language' | 'bday' | 'bday-day' | 'bday-month' | 'bday-year' | 'sex' | 'tel' | 'tel-country-code' | 'tel-national' | 'tel-area-code' | 'tel-local' | 'tel-extension' | 'impp' | 'url' | 'photo';
7
+ export interface SDSTextFieldProps extends SDSFormControlAttributes {
8
+ autocomplete?: AutocompleteTypes;
9
+ 'error-message'?: string;
10
+ 'help-text'?: string;
11
+ label?: string;
12
+ maxlength?: number;
13
+ minlength?: number;
14
+ min?: number | string;
15
+ max?: number | string;
16
+ pattern?: string;
17
+ placeholder?: string;
18
+ required?: boolean;
19
+ size?: InputSize;
20
+ type?: InputType;
21
+ value?: string;
22
+ }
23
+ declare const SDSTextFieldComponent_base: import("../mixins/types").Constructable<import("../mixins/sds-delegate-interaction-mixin").DelegateInteractionMixinInterface> & import("../mixins/types").Constructable<import("../mixins/sds-event-dispatcher-mixin").SDSEventDispatcherMixinInterface> & import("../mixins/types").Constructable<import("../mixins/sds-form-control-mixin").SDSFormControlMixinInterface> & typeof SDSElement;
24
+ export declare class SDSTextFieldComponent extends SDSTextFieldComponent_base {
25
+ static styles: import("lit").CSSResult[];
26
+ type: SDSTextFieldProps['type'];
27
+ value?: SDSTextFieldProps['value'];
28
+ label?: SDSTextFieldProps['label'];
29
+ placeholder?: SDSTextFieldProps['placeholder'];
30
+ helpText?: SDSTextFieldProps['help-text'];
31
+ errorMessage?: SDSTextFieldProps['error-message'];
32
+ autocomplete?: SDSTextFieldProps['autocomplete'];
33
+ required: SDSTextFieldProps['required'];
34
+ pattern?: SDSTextFieldProps['pattern'];
35
+ minlength?: SDSTextFieldProps['minlength'];
36
+ maxlength?: SDSTextFieldProps['maxlength'];
37
+ min?: SDSTextFieldProps['min'];
38
+ max?: SDSTextFieldProps['max'];
39
+ size: SDSTextFieldProps['size'];
40
+ private hasIcon;
41
+ /** Tracks whether the `label` slot has assigned content. */
42
+ private _hasSlottedLabel;
43
+ control: HTMLInputElement;
44
+ private _defaultValue;
45
+ connectedCallback(): void;
46
+ updated(changedProperties: Map<string | number | symbol, unknown>): void;
47
+ private readonly handleSlotChange;
48
+ private readonly _handleLabelSlotChange;
49
+ updateValidity(): void;
50
+ private readonly _handleInputChange;
51
+ private readonly _handleSelect;
52
+ private readonly _handleFocus;
53
+ private readonly _handleBlur;
54
+ private readonly _handleKeyDown;
55
+ formResetCallback(): void;
56
+ select(): void;
57
+ get selectionStart(): number | null;
58
+ set selectionStart(value: number | null);
59
+ get selectionEnd(): number | null;
60
+ set selectionEnd(value: number | null);
61
+ setSelectionRange(start: number, end: number, direction?: 'forward' | 'backward' | 'none'): void;
62
+ checkValidity(): boolean;
63
+ reportValidity(): boolean;
64
+ setCustomValidity(message: string): void;
65
+ render(): import("lit-html").TemplateResult<1>;
66
+ }
67
+ export {};
68
+ //# sourceMappingURL=sds-textfield.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sds-textfield.component.d.ts","sourceRoot":"","sources":["../../src/sds-textfield/sds-textfield.component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAKlD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAEjF,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,KAAK,SAAS,GACX,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,KAAK,GACL,KAAK,GACL,OAAO,GACP,UAAU,GACV,UAAU,GACV,MAAM,GACN,OAAO,GACP,MAAM,GACN,MAAM,GACN,gBAAgB,GAChB,QA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iB;IAMjB,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC;IAY1E,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAG/B;IAEF,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAErC;IAEO,cAAc;IAYvB,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAUjC;IAEF,OAAO,CAAC,QAAQ,CAAC,aAAa,CAK5B;IAEF,OAAO,CAAC,QAAQ,CAAC,YAAY,CAG3B;IAEF,OAAO,CAAC,QAAQ,CAAC,WAAW,CAI1B;IAEF,OAAO,CAAC,QAAQ,CAAC,cAAc,CA4B7B;IAEF,iBAAiB;IASjB,MAAM,IAAI,IAAI;IAId,IAAI,cAAc,IAAI,MAAM,GAAG,IAAI,CAElC;IAED,IAAI,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAItC;IAED,IAAI,YAAY,IAAI,MAAM,GAAG,IAAI,CAEhC;IACD,IAAI,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAIpC;IAED,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,MAAM,GAAG,IAAI;IAMhG,aAAa,IAAI,OAAO;IAIxB,cAAc,IAAI,OAAO;IAIzB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAK/B,MAAM;CAmDf"}
@@ -0,0 +1,250 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { html, nothing } from 'lit';
8
+ import { SDSElement } from '../utils/sds-element';
9
+ import { property, query, state } from 'lit/decorators.js';
10
+ import { classMap } from 'lit/directives/class-map.js';
11
+ import { ifDefined } from 'lit/directives/if-defined.js';
12
+ import { SDSEventDispatcherMixin, SDSDelegateInteractionMixin, SDSFormControlMixin } from '../mixins';
13
+ import { styles } from './sds-textfield.styles';
14
+ export class SDSTextFieldComponent extends SDSDelegateInteractionMixin(SDSEventDispatcherMixin(SDSFormControlMixin(SDSElement))) {
15
+ constructor() {
16
+ super(...arguments);
17
+ this.type = 'text';
18
+ this.required = false;
19
+ this.size = 'md';
20
+ // State
21
+ this.hasIcon = false;
22
+ /** Tracks whether the `label` slot has assigned content. */
23
+ this._hasSlottedLabel = false;
24
+ this._defaultValue = null;
25
+ this.handleSlotChange = (e) => {
26
+ const slot = e.target;
27
+ this.hasIcon = slot.assignedNodes({ flatten: true }).length > 0;
28
+ };
29
+ this._handleLabelSlotChange = (e) => {
30
+ this._hasSlottedLabel = e.target.assignedNodes().length > 0;
31
+ };
32
+ this._handleInputChange = (event) => {
33
+ event.stopImmediatePropagation();
34
+ if (this.disabled || !(event.target instanceof HTMLInputElement)) {
35
+ return;
36
+ }
37
+ this.value = event.target.value;
38
+ this.internals.setFormValue(this.value === '' ? null : this.value);
39
+ this.updateValidity();
40
+ this.dispatchSheriffEvent(event.type);
41
+ };
42
+ this._handleSelect = (event) => {
43
+ event.stopImmediatePropagation();
44
+ if (!this.disabled) {
45
+ this.dispatchSheriffEvent('select');
46
+ }
47
+ };
48
+ this._handleFocus = (event) => {
49
+ event.stopImmediatePropagation();
50
+ this.dispatchSheriffEvent('focus');
51
+ };
52
+ this._handleBlur = (event) => {
53
+ event.stopImmediatePropagation();
54
+ this.updateValidity();
55
+ this.dispatchSheriffEvent('blur');
56
+ };
57
+ this._handleKeyDown = (event) => {
58
+ event.stopImmediatePropagation();
59
+ const shouldContinue = this.dispatchKeyboardEvent('keydown', event);
60
+ if (!shouldContinue) {
61
+ return;
62
+ }
63
+ if (event.key !== 'Enter') {
64
+ return;
65
+ }
66
+ for (const element of Array.from(this.form?.elements ?? [])) {
67
+ if (element instanceof HTMLButtonElement || element instanceof HTMLInputElement) {
68
+ if (element.type !== 'submit') {
69
+ continue;
70
+ }
71
+ if (element.disabled) {
72
+ return;
73
+ }
74
+ element.click();
75
+ return;
76
+ }
77
+ }
78
+ this.form?.requestSubmit();
79
+ };
80
+ }
81
+ connectedCallback() {
82
+ super.connectedCallback();
83
+ this._defaultValue = this.value ?? null;
84
+ this.internals.setFormValue(this._defaultValue);
85
+ }
86
+ updated(changedProperties) {
87
+ super.updated(changedProperties);
88
+ if (changedProperties.has('value')) {
89
+ this.internals.setFormValue(this.value ?? '');
90
+ if (this.control) {
91
+ this.control.value = this.value ?? '';
92
+ }
93
+ }
94
+ }
95
+ updateValidity() {
96
+ if (!this.control) {
97
+ return;
98
+ }
99
+ if (this.control.checkValidity()) {
100
+ this.internals.setValidity({});
101
+ }
102
+ else {
103
+ this.internals.setValidity({ customError: true }, this.control.validationMessage, this.control);
104
+ }
105
+ }
106
+ formResetCallback() {
107
+ this.internals.setFormValue(this._defaultValue);
108
+ const newValue = this._defaultValue ?? '';
109
+ this.control.value = newValue;
110
+ this.value = newValue;
111
+ this.updateValidity();
112
+ }
113
+ select() {
114
+ if (!this.disabled)
115
+ this.control.select();
116
+ }
117
+ get selectionStart() {
118
+ return this.control ? this.control.selectionStart : null;
119
+ }
120
+ set selectionStart(value) {
121
+ if (this.control && value !== null) {
122
+ this.control.selectionStart = value;
123
+ }
124
+ }
125
+ get selectionEnd() {
126
+ return this.control ? this.control.selectionEnd : null;
127
+ }
128
+ set selectionEnd(value) {
129
+ if (this.control && value !== null) {
130
+ this.control.selectionEnd = value;
131
+ }
132
+ }
133
+ setSelectionRange(start, end, direction) {
134
+ if (this.control) {
135
+ this.control.setSelectionRange(start, end, direction);
136
+ }
137
+ }
138
+ checkValidity() {
139
+ return this.control.checkValidity();
140
+ }
141
+ reportValidity() {
142
+ return this.control.reportValidity();
143
+ }
144
+ setCustomValidity(message) {
145
+ this.control.setCustomValidity(message);
146
+ this.updateValidity();
147
+ }
148
+ render() {
149
+ const textfieldClasses = {
150
+ 'sds-textfield': true,
151
+ 'sds-textfield--error': Boolean(this.errorMessage),
152
+ 'sds-textfield--has-icon': this.hasIcon,
153
+ };
154
+ const describedBy = [this.errorMessage ? 'error-message' : null, this.helpText ? 'help-text' : null].filter(Boolean).join(' ') || undefined;
155
+ const showLabel = this._hasSlottedLabel || Boolean(this.label);
156
+ return html `
157
+ <div class="${classMap(textfieldClasses)}">
158
+ <label for="sds-textfield" class="sds-textfield__label" ?hidden="${!showLabel}">
159
+ ${this.readOnly ? html `<sds-icon name="lock-material-filled" size="m"></sds-icon>` : nothing}
160
+ <slot name="label" @slotchange="${this._handleLabelSlotChange}">${this.label}</slot>
161
+ </label>
162
+ ${this.helpText ? html `<p id="help-text" class="sds-textfield__help-text">${this.helpText}</p>` : nothing}
163
+ <div class="sds-textfield__input-container">
164
+ <input
165
+ part="input"
166
+ class="sds-textfield__input"
167
+ type="${ifDefined(this.type)}"
168
+ id="sds-textfield"
169
+ ?disabled="${this.disabled}"
170
+ ?readonly="${this.readOnly}"
171
+ placeholder="${ifDefined(this.placeholder)}"
172
+ .value="${this.value ?? ''}"
173
+ name="${ifDefined(this.name)}"
174
+ autocomplete="${ifDefined(this.autocomplete)}"
175
+ ?required="${this.required}"
176
+ pattern="${ifDefined(this.pattern)}"
177
+ min="${ifDefined(this.min)}"
178
+ minlength="${ifDefined(this.minlength)}"
179
+ max="${ifDefined(this.max)}"
180
+ maxlength="${ifDefined(this.maxlength)}"
181
+ aria-describedby="${ifDefined(describedBy)}"
182
+ aria-invalid="${this.errorMessage ? 'true' : 'false'}"
183
+ @input="${this._handleInputChange}"
184
+ @change="${this._handleInputChange}"
185
+ @select="${this._handleSelect}"
186
+ @focus="${this._handleFocus}"
187
+ @blur="${this._handleBlur}"
188
+ @keydown="${this._handleKeyDown}"
189
+ />
190
+ <slot name="after" @slotchange="${this.handleSlotChange}" aria-hidden="true"></slot>
191
+ </div>
192
+ ${this.errorMessage ? html `<sds-alert id="error-message" variant="secondary" data-palette="danger"><p slot="message">${this.errorMessage}</p></sds-alert>` : nothing}
193
+ </div>
194
+ `;
195
+ }
196
+ }
197
+ // Styling
198
+ SDSTextFieldComponent.styles = [styles];
199
+ __decorate([
200
+ property({ type: String, reflect: true })
201
+ ], SDSTextFieldComponent.prototype, "type", void 0);
202
+ __decorate([
203
+ property({ type: String })
204
+ ], SDSTextFieldComponent.prototype, "value", void 0);
205
+ __decorate([
206
+ property({ type: String, reflect: true })
207
+ ], SDSTextFieldComponent.prototype, "label", void 0);
208
+ __decorate([
209
+ property({ type: String, reflect: true })
210
+ ], SDSTextFieldComponent.prototype, "placeholder", void 0);
211
+ __decorate([
212
+ property({ type: String, attribute: 'help-text', reflect: true })
213
+ ], SDSTextFieldComponent.prototype, "helpText", void 0);
214
+ __decorate([
215
+ property({ type: String, attribute: 'error-message', reflect: true })
216
+ ], SDSTextFieldComponent.prototype, "errorMessage", void 0);
217
+ __decorate([
218
+ property({ type: String, reflect: true })
219
+ ], SDSTextFieldComponent.prototype, "autocomplete", void 0);
220
+ __decorate([
221
+ property({ type: Boolean, reflect: true })
222
+ ], SDSTextFieldComponent.prototype, "required", void 0);
223
+ __decorate([
224
+ property({ type: String, reflect: true })
225
+ ], SDSTextFieldComponent.prototype, "pattern", void 0);
226
+ __decorate([
227
+ property({ type: Number, reflect: true })
228
+ ], SDSTextFieldComponent.prototype, "minlength", void 0);
229
+ __decorate([
230
+ property({ type: Number, reflect: true })
231
+ ], SDSTextFieldComponent.prototype, "maxlength", void 0);
232
+ __decorate([
233
+ property({ type: String, reflect: true })
234
+ ], SDSTextFieldComponent.prototype, "min", void 0);
235
+ __decorate([
236
+ property({ type: String, reflect: true })
237
+ ], SDSTextFieldComponent.prototype, "max", void 0);
238
+ __decorate([
239
+ property({ type: String, reflect: true })
240
+ ], SDSTextFieldComponent.prototype, "size", void 0);
241
+ __decorate([
242
+ state()
243
+ ], SDSTextFieldComponent.prototype, "hasIcon", void 0);
244
+ __decorate([
245
+ state()
246
+ ], SDSTextFieldComponent.prototype, "_hasSlottedLabel", void 0);
247
+ __decorate([
248
+ query('#sds-textfield')
249
+ ], SDSTextFieldComponent.prototype, "control", void 0);
250
+ //# sourceMappingURL=sds-textfield.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sds-textfield.component.js","sourceRoot":"","sources":["../../src/sds-textfield/sds-textfield.component.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEtG,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAsGhD,MAAM,OAAO,qBAAsB,SAAQ,2BAA2B,CAAC,uBAAuB,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC;IAAhI;;QAI4C,SAAI,GAA8B,MAAM,CAAC;QAOxC,aAAQ,GAAkC,KAAK,CAAC;QAMjD,SAAI,GAA8B,IAAI,CAAC;QAElF,QAAQ;QACS,YAAO,GAAG,KAAK,CAAC;QACjC,4DAA4D;QAC3C,qBAAgB,GAAG,KAAK,CAAC;QAIlC,kBAAa,GAAkB,IAAI,CAAC;QAoB3B,qBAAgB,GAAG,CAAC,CAAQ,EAAE,EAAE;YAChD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AC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sDAAwC;AACvC;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wDAA4C;AAC3C;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wDAA4C;AAC3C;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDAAgC;AAC/B;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDAAgC;AAC/B;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;mDAAwC;AAGjE;IAAhB,KAAK,EAAE;sDAAyB;AAEhB;IAAhB,KAAK,EAAE;+DAAkC;AAEjB;IAAxB,KAAK,CAAC,gBAAgB,CAAC;sDAA4B","sourcesContent":["import { html, nothing } from 'lit';\nimport { SDSElement } from '../utils/sds-element';\nimport { property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { SDSEventDispatcherMixin, SDSDelegateInteractionMixin, SDSFormControlMixin } from '../mixins';\nimport type { SDSFormControlAttributes } from '../mixins/sds-form-control-mixin';\nimport { styles } from './sds-textfield.styles';\nimport { SDS_SIZES } from '../types';\n\ntype InputType =\n\t| 'hidden'\n\t| 'text'\n\t| 'search'\n\t| 'tel'\n\t| 'url'\n\t| 'email'\n\t| 'password'\n\t| 'datetime'\n\t| 'date'\n\t| 'month'\n\t| 'week'\n\t| 'time'\n\t| 'datetime-local'\n\t| 'number'\n\t| 'range'\n\t| 'color'\n\t| 'checkbox'\n\t| 'radio'\n\t| 'file'\n\t| 'submit'\n\t| 'image'\n\t| 'reset'\n\t| 'button';\n\ntype InputSize = Extract<SDS_SIZES, 'lg' | 'md' | 'sm'>;\nexport type AutocompleteTypes =\n\t| 'off'\n\t| 'on'\n\t| 'name'\n\t| 'honorific-prefix'\n\t| 'given-name'\n\t| 'additional-name'\n\t| 'family-name'\n\t| 'honorific-suffix'\n\t| 'nickname'\n\t| 'email'\n\t| 'username'\n\t| 'new-password'\n\t| 'current-password'\n\t| 'one-time-code'\n\t| 'organization-title'\n\t| 'organization'\n\t| 'street-address'\n\t| 'address-line1'\n\t| 'address-line2'\n\t| 'address-line3'\n\t| 'address-level4'\n\t| 'address-level3'\n\t| 'address-level2'\n\t| 'address-level1'\n\t| 'country'\n\t| 'country-name'\n\t| 'postal-code'\n\t| 'cc-name'\n\t| 'cc-given-name'\n\t| 'cc-additional-name'\n\t| 'cc-family-name'\n\t| 'cc-number'\n\t| 'cc-exp'\n\t| 'cc-exp-month'\n\t| 'cc-exp-year'\n\t| 'cc-csc'\n\t| 'cc-type'\n\t| 'transaction-currency'\n\t| 'transaction-amount'\n\t| 'language'\n\t| 'bday'\n\t| 'bday-day'\n\t| 'bday-month'\n\t| 'bday-year'\n\t| 'sex'\n\t| 'tel'\n\t| 'tel-country-code'\n\t| 'tel-national'\n\t| 'tel-area-code'\n\t| 'tel-local'\n\t| 'tel-extension'\n\t| 'impp'\n\t| 'url'\n\t| 'photo';\n\nexport interface SDSTextFieldProps extends SDSFormControlAttributes {\n\tautocomplete?: AutocompleteTypes;\n\t'error-message'?: string;\n\t'help-text'?: string;\n\tlabel?: string;\n\tmaxlength?: number;\n\tminlength?: number;\n\tmin?: number | string;\n\tmax?: number | string;\n\tpattern?: string;\n\tplaceholder?: string;\n\trequired?: boolean;\n\tsize?: InputSize;\n\ttype?: InputType;\n\tvalue?: string;\n}\n\nexport class SDSTextFieldComponent extends SDSDelegateInteractionMixin(SDSEventDispatcherMixin(SDSFormControlMixin(SDSElement))) {\n\t// Styling\n\tstatic override styles = [styles];\n\n\t@property({ type: String, reflect: true }) type: SDSTextFieldProps['type'] = 'text';\n\t@property({ type: String }) value?: SDSTextFieldProps['value'];\n\t@property({ type: String, reflect: true }) label?: SDSTextFieldProps['label'];\n\t@property({ type: String, reflect: true }) placeholder?: SDSTextFieldProps['placeholder'];\n\t@property({ type: String, attribute: 'help-text', reflect: true }) helpText?: SDSTextFieldProps['help-text'];\n\t@property({ type: String, attribute: 'error-message', reflect: true }) errorMessage?: SDSTextFieldProps['error-message'];\n\t@property({ type: String, reflect: true }) autocomplete?: SDSTextFieldProps['autocomplete'];\n\t@property({ type: Boolean, reflect: true }) required: SDSTextFieldProps['required'] = false;\n\t@property({ type: String, reflect: true }) pattern?: SDSTextFieldProps['pattern'];\n\t@property({ type: Number, reflect: true }) minlength?: SDSTextFieldProps['minlength'];\n\t@property({ type: Number, reflect: true }) maxlength?: SDSTextFieldProps['maxlength'];\n\t@property({ type: String, reflect: true }) min?: SDSTextFieldProps['min'];\n\t@property({ type: String, reflect: true }) max?: SDSTextFieldProps['max'];\n\t@property({ type: String, reflect: true }) size: SDSTextFieldProps['size'] = 'md';\n\n\t// State\n\t@state() private hasIcon = false;\n\t/** Tracks whether the `label` slot has assigned content. */\n\t@state() private _hasSlottedLabel = false;\n\n\t@query('#sds-textfield') control!: HTMLInputElement;\n\n\tprivate _defaultValue: string | null = null;\n\n\toverride connectedCallback() {\n\t\tsuper.connectedCallback();\n\t\tthis._defaultValue = this.value ?? null;\n\t\tthis.internals.setFormValue(this._defaultValue);\n\t}\n\n\toverride updated(changedProperties: Map<string | number | symbol, unknown>) {\n\t\tsuper.updated(changedProperties);\n\n\t\tif (changedProperties.has('value')) {\n\t\t\tthis.internals.setFormValue(this.value ?? '');\n\n\t\t\tif (this.control) {\n\t\t\t\tthis.control.value = this.value ?? '';\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate readonly handleSlotChange = (e: Event) => {\n\t\tconst slot = e.target as HTMLSlotElement;\n\t\tthis.hasIcon = slot.assignedNodes({ flatten: true }).length > 0;\n\t};\n\n\tprivate readonly _handleLabelSlotChange = (e: Event) => {\n\t\tthis._hasSlottedLabel = (e.target as HTMLSlotElement).assignedNodes().length > 0;\n\t};\n\n\toverride updateValidity() {\n\t\tif (!this.control) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.control.checkValidity()) {\n\t\t\tthis.internals.setValidity({});\n\t\t} else {\n\t\t\tthis.internals.setValidity({ customError: true }, this.control.validationMessage, this.control);\n\t\t}\n\t}\n\n\tprivate readonly _handleInputChange = (event: InputEvent) => {\n\t\tevent.stopImmediatePropagation();\n\t\tif (this.disabled || !(event.target instanceof HTMLInputElement)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.value = event.target.value;\n\t\tthis.internals.setFormValue(this.value === '' ? null : this.value);\n\t\tthis.updateValidity();\n\t\tthis.dispatchSheriffEvent(event.type);\n\t};\n\n\tprivate readonly _handleSelect = (event: Event) => {\n\t\tevent.stopImmediatePropagation();\n\t\tif (!this.disabled) {\n\t\t\tthis.dispatchSheriffEvent('select');\n\t\t}\n\t};\n\n\tprivate readonly _handleFocus = (event: FocusEvent) => {\n\t\tevent.stopImmediatePropagation();\n\t\tthis.dispatchSheriffEvent('focus');\n\t};\n\n\tprivate readonly _handleBlur = (event: FocusEvent) => {\n\t\tevent.stopImmediatePropagation();\n\t\tthis.updateValidity();\n\t\tthis.dispatchSheriffEvent('blur');\n\t};\n\n\tprivate readonly _handleKeyDown = (event: KeyboardEvent) => {\n\t\tevent.stopImmediatePropagation();\n\n\t\tconst shouldContinue = this.dispatchKeyboardEvent('keydown', event);\n\t\tif (!shouldContinue) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (event.key !== 'Enter') {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (const element of Array.from(this.form?.elements ?? [])) {\n\t\t\tif (element instanceof HTMLButtonElement || element instanceof HTMLInputElement) {\n\t\t\t\tif (element.type !== 'submit') {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (element.disabled) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\telement.click();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tthis.form?.requestSubmit();\n\t};\n\n\tformResetCallback() {\n\t\tthis.internals.setFormValue(this._defaultValue);\n\n\t\tconst newValue = this._defaultValue ?? '';\n\t\tthis.control.value = newValue;\n\t\tthis.value = newValue;\n\t\tthis.updateValidity();\n\t}\n\n\tselect(): void {\n\t\tif (!this.disabled) this.control.select();\n\t}\n\n\tget selectionStart(): number | null {\n\t\treturn this.control ? this.control.selectionStart : null;\n\t}\n\n\tset selectionStart(value: number | null) {\n\t\tif (this.control && value !== null) {\n\t\t\tthis.control.selectionStart = value;\n\t\t}\n\t}\n\n\tget selectionEnd(): number | null {\n\t\treturn this.control ? this.control.selectionEnd : null;\n\t}\n\tset selectionEnd(value: number | null) {\n\t\tif (this.control && value !== null) {\n\t\t\tthis.control.selectionEnd = value;\n\t\t}\n\t}\n\n\tsetSelectionRange(start: number, end: number, direction?: 'forward' | 'backward' | 'none'): void {\n\t\tif (this.control) {\n\t\t\tthis.control.setSelectionRange(start, end, direction);\n\t\t}\n\t}\n\n\tcheckValidity(): boolean {\n\t\treturn this.control.checkValidity();\n\t}\n\n\treportValidity(): boolean {\n\t\treturn this.control.reportValidity();\n\t}\n\n\tsetCustomValidity(message: string): void {\n\t\tthis.control.setCustomValidity(message);\n\t\tthis.updateValidity();\n\t}\n\n\toverride render() {\n\t\tconst textfieldClasses = {\n\t\t\t'sds-textfield': true,\n\t\t\t'sds-textfield--error': Boolean(this.errorMessage),\n\t\t\t'sds-textfield--has-icon': this.hasIcon,\n\t\t};\n\n\t\tconst describedBy = [this.errorMessage ? 'error-message' : null, this.helpText ? 'help-text' : null].filter(Boolean).join(' ') || undefined;\n\n\t\tconst showLabel = this._hasSlottedLabel || Boolean(this.label);\n\n\t\treturn html`\n\t\t\t<div class=\"${classMap(textfieldClasses)}\">\n\t\t\t\t<label for=\"sds-textfield\" class=\"sds-textfield__label\" ?hidden=\"${!showLabel}\">\n\t\t\t\t\t${this.readOnly ? html`<sds-icon name=\"lock-material-filled\" size=\"m\"></sds-icon>` : nothing}\n\t\t\t\t\t<slot name=\"label\" @slotchange=\"${this._handleLabelSlotChange}\">${this.label}</slot>\n\t\t\t\t</label>\n\t\t\t\t${this.helpText ? html`<p id=\"help-text\" class=\"sds-textfield__help-text\">${this.helpText}</p>` : nothing}\n\t\t\t\t<div class=\"sds-textfield__input-container\">\n\t\t\t\t\t<input\n\t\t\t\t\t\tpart=\"input\"\n\t\t\t\t\t\tclass=\"sds-textfield__input\"\n\t\t\t\t\t\ttype=\"${ifDefined(this.type)}\"\n\t\t\t\t\t\tid=\"sds-textfield\"\n\t\t\t\t\t\t?disabled=\"${this.disabled}\"\n\t\t\t\t\t\t?readonly=\"${this.readOnly}\"\n\t\t\t\t\t\tplaceholder=\"${ifDefined(this.placeholder)}\"\n\t\t\t\t\t\t.value=\"${this.value ?? ''}\"\n\t\t\t\t\t\tname=\"${ifDefined(this.name)}\"\n\t\t\t\t\t\tautocomplete=\"${ifDefined(this.autocomplete as any)}\"\n\t\t\t\t\t\t?required=\"${this.required}\"\n\t\t\t\t\t\tpattern=\"${ifDefined(this.pattern)}\"\n\t\t\t\t\t\tmin=\"${ifDefined(this.min)}\"\n\t\t\t\t\t\tminlength=\"${ifDefined(this.minlength)}\"\n\t\t\t\t\t\tmax=\"${ifDefined(this.max)}\"\n\t\t\t\t\t\tmaxlength=\"${ifDefined(this.maxlength)}\"\n\t\t\t\t\t\taria-describedby=\"${ifDefined(describedBy)}\"\n\t\t\t\t\t\taria-invalid=\"${this.errorMessage ? 'true' : 'false'}\"\n\t\t\t\t\t\t@input=\"${this._handleInputChange}\"\n\t\t\t\t\t\t@change=\"${this._handleInputChange}\"\n\t\t\t\t\t\t@select=\"${this._handleSelect}\"\n\t\t\t\t\t\t@focus=\"${this._handleFocus}\"\n\t\t\t\t\t\t@blur=\"${this._handleBlur}\"\n\t\t\t\t\t\t@keydown=\"${this._handleKeyDown}\"\n\t\t\t\t\t/>\n\t\t\t\t\t<slot name=\"after\" @slotchange=\"${this.handleSlotChange}\" aria-hidden=\"true\"></slot>\n\t\t\t\t</div>\n\t\t\t\t${this.errorMessage ? html`<sds-alert id=\"error-message\" variant=\"secondary\" data-palette=\"danger\"><p slot=\"message\">${this.errorMessage}</p></sds-alert>` : nothing}\n\t\t\t</div>\n\t\t`;\n\t}\n}\n"]}
@@ -1,75 +1,12 @@
1
- import { LitElement } from 'lit';
2
- import type { SDSFormControlAttributes } from '../mixins/sds-form-control-mixin';
1
+ import { SDSTextFieldComponent } from './sds-textfield.component';
3
2
  import '../sds-alert/sds-alert';
4
3
  import '../sds-icon/sds-icon';
5
- import { SDS_SIZES } from '../types';
6
- type InputType = 'hidden' | 'text' | 'search' | 'tel' | 'url' | 'email' | 'password' | 'datetime' | 'date' | 'month' | 'week' | 'time' | 'datetime-local' | 'number' | 'range' | 'color' | 'checkbox' | 'radio' | 'file' | 'submit' | 'image' | 'reset' | 'button';
7
- type InputSize = Extract<SDS_SIZES, 'lg' | 'md' | 'sm'>;
8
- export type AutocompleteTypes = 'off' | 'on' | 'name' | 'honorific-prefix' | 'given-name' | 'additional-name' | 'family-name' | 'honorific-suffix' | 'nickname' | 'email' | 'username' | 'new-password' | 'current-password' | 'one-time-code' | 'organization-title' | 'organization' | 'street-address' | 'address-line1' | 'address-line2' | 'address-line3' | 'address-level4' | 'address-level3' | 'address-level2' | 'address-level1' | 'country' | 'country-name' | 'postal-code' | 'cc-name' | 'cc-given-name' | 'cc-additional-name' | 'cc-family-name' | 'cc-number' | 'cc-exp' | 'cc-exp-month' | 'cc-exp-year' | 'cc-csc' | 'cc-type' | 'transaction-currency' | 'transaction-amount' | 'language' | 'bday' | 'bday-day' | 'bday-month' | 'bday-year' | 'sex' | 'tel' | 'tel-country-code' | 'tel-national' | 'tel-area-code' | 'tel-local' | 'tel-extension' | 'impp' | 'url' | 'photo';
9
- export interface SDSTextFieldProps extends SDSFormControlAttributes {
10
- autocomplete?: AutocompleteTypes;
11
- 'error-message'?: string;
12
- 'help-text'?: string;
13
- label?: string;
14
- maxlength?: number;
15
- minlength?: number;
16
- min?: number | string;
17
- max?: number | string;
18
- pattern?: string;
19
- placeholder?: string;
20
- required?: boolean;
21
- size?: InputSize;
22
- type?: InputType;
23
- value?: string;
24
- }
25
- declare const SDSTextField_base: import("../mixins/types").Constructable<import("../mixins/sds-delegate-interaction-mixin").DelegateInteractionMixinInterface> & import("../mixins/types").Constructable<import("../mixins/sds-event-dispatcher-mixin").SDSEventDispatcherMixinInterface> & import("../mixins/types").Constructable<import("../mixins/sds-form-control-mixin").SDSFormControlMixinInterface> & typeof LitElement;
26
- export declare class SDSTextField extends SDSTextField_base {
27
- static styles: import("lit").CSSResult[];
28
- type: SDSTextFieldProps['type'];
29
- value?: SDSTextFieldProps['value'];
30
- label?: SDSTextFieldProps['label'];
31
- placeholder?: SDSTextFieldProps['placeholder'];
32
- helpText?: SDSTextFieldProps['help-text'];
33
- errorMessage?: SDSTextFieldProps['error-message'];
34
- autocomplete?: SDSTextFieldProps['autocomplete'];
35
- required: SDSTextFieldProps['required'];
36
- pattern?: SDSTextFieldProps['pattern'];
37
- minlength?: SDSTextFieldProps['minlength'];
38
- maxlength?: SDSTextFieldProps['maxlength'];
39
- min?: SDSTextFieldProps['min'];
40
- max?: SDSTextFieldProps['max'];
41
- size: SDSTextFieldProps['size'];
42
- private hasIcon;
43
- /** Tracks whether the `label` slot has assigned content. */
44
- private _hasSlottedLabel;
45
- control: HTMLInputElement;
46
- private _defaultValue;
47
- connectedCallback(): void;
48
- updated(changedProperties: Map<string | number | symbol, unknown>): void;
49
- private readonly handleSlotChange;
50
- private readonly _handleLabelSlotChange;
51
- updateValidity(): void;
52
- private readonly _handleInputChange;
53
- private readonly _handleSelect;
54
- private readonly _handleFocus;
55
- private readonly _handleBlur;
56
- private readonly _handleKeyDown;
57
- formResetCallback(): void;
58
- select(): void;
59
- get selectionStart(): number | null;
60
- set selectionStart(value: number | null);
61
- get selectionEnd(): number | null;
62
- set selectionEnd(value: number | null);
63
- setSelectionRange(start: number, end: number, direction?: 'forward' | 'backward' | 'none'): void;
64
- checkValidity(): boolean;
65
- reportValidity(): boolean;
66
- setCustomValidity(message: string): void;
67
- render(): import("lit-html").TemplateResult<1>;
4
+ export type { AutocompleteTypes, SDSTextFieldProps } from './sds-textfield.component';
5
+ export declare class SDSTextField extends SDSTextFieldComponent {
68
6
  }
69
7
  declare global {
70
8
  interface HTMLElementTagNameMap {
71
9
  'sds-textfield': SDSTextField;
72
10
  }
73
11
  }
74
- export {};
75
12
  //# sourceMappingURL=sds-textfield.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sds-textfield.d.ts","sourceRoot":"","sources":["../../src/sds-textfield/sds-textfield.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAiB,MAAM,KAAK,CAAC;AAMhD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAGjF,OAAO,wBAAwB,CAAC;AAChC,OAAO,sBAAsB,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,KAAK,SAAS,GACX,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,KAAK,GACL,KAAK,GACL,OAAO,GACP,UAAU,GACV,UAAU,GACV,MAAM,GACN,OAAO,GACP,MAAM,GACN,MAAM,GACN,gBAAgB,GAChB,QAAQ,GACR,OAAO,GACP,OAAO,GACP,UAAU,GACV,OAAO,GACP,MAAM,GACN,QAAQ,GACR,OAAO,GACP,OAAO,GACP,QAAQ,CAAC;AAEZ,KAAK,SAAS,GAAG,OAAO,CAAC,SAAS,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;AACxD,MAAM,MAAM,iBAAiB,GAC1B,KAAK,GACL,IAAI,GACJ,MAAM,GACN,kBAAkB,GAClB,YAAY,GACZ,iBAAiB,GACjB,aAAa,GACb,kB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