@six-group/ui-library 0.0.0-insider.03e5196 → 0.0.0-insider.3f37dd4

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 (71) hide show
  1. package/dist/cjs/six-checkbox.cjs.entry.js +57 -46
  2. package/dist/cjs/six-checkbox.cjs.entry.js.map +1 -1
  3. package/dist/cjs/six-input.cjs.entry.js +107 -81
  4. package/dist/cjs/six-input.cjs.entry.js.map +1 -1
  5. package/dist/cjs/six-radio.cjs.entry.js +56 -51
  6. package/dist/cjs/six-radio.cjs.entry.js.map +1 -1
  7. package/dist/cjs/six-range.cjs.entry.js +114 -75
  8. package/dist/cjs/six-range.cjs.entry.js.map +1 -1
  9. package/dist/cjs/six-textarea.cjs.entry.js +97 -74
  10. package/dist/cjs/six-textarea.cjs.entry.js.map +1 -1
  11. package/dist/cjs/slot-ad537f24.js.map +1 -1
  12. package/dist/collection/components/six-checkbox/six-checkbox.js +62 -49
  13. package/dist/collection/components/six-checkbox/six-checkbox.js.map +1 -1
  14. package/dist/collection/components/six-input/six-input.js +130 -117
  15. package/dist/collection/components/six-input/six-input.js.map +1 -1
  16. package/dist/collection/components/six-radio/six-radio.js +60 -53
  17. package/dist/collection/components/six-radio/six-radio.js.map +1 -1
  18. package/dist/collection/components/six-range/six-range.js +121 -76
  19. package/dist/collection/components/six-range/six-range.js.map +1 -1
  20. package/dist/collection/components/six-textarea/six-textarea.js +115 -105
  21. package/dist/collection/components/six-textarea/six-textarea.js.map +1 -1
  22. package/dist/collection/utils/slot.js.map +1 -1
  23. package/dist/components/six-checkbox.js +57 -46
  24. package/dist/components/six-checkbox.js.map +1 -1
  25. package/dist/components/six-input2.js +107 -81
  26. package/dist/components/six-input2.js.map +1 -1
  27. package/dist/components/six-radio.js +56 -51
  28. package/dist/components/six-radio.js.map +1 -1
  29. package/dist/components/six-range.js +114 -75
  30. package/dist/components/six-range.js.map +1 -1
  31. package/dist/components/six-textarea.js +97 -74
  32. package/dist/components/six-textarea.js.map +1 -1
  33. package/dist/components/slot.js.map +1 -1
  34. package/dist/components.json +45 -35
  35. package/dist/esm/six-checkbox.entry.js +57 -46
  36. package/dist/esm/six-checkbox.entry.js.map +1 -1
  37. package/dist/esm/six-input.entry.js +107 -81
  38. package/dist/esm/six-input.entry.js.map +1 -1
  39. package/dist/esm/six-radio.entry.js +56 -51
  40. package/dist/esm/six-radio.entry.js.map +1 -1
  41. package/dist/esm/six-range.entry.js +114 -75
  42. package/dist/esm/six-range.entry.js.map +1 -1
  43. package/dist/esm/six-textarea.entry.js +97 -74
  44. package/dist/esm/six-textarea.entry.js.map +1 -1
  45. package/dist/esm/slot-6f3984c7.js.map +1 -1
  46. package/dist/types/components/six-checkbox/six-checkbox.d.ts +21 -17
  47. package/dist/types/components/six-input/six-input.d.ts +27 -36
  48. package/dist/types/components/six-radio/six-radio.d.ts +10 -11
  49. package/dist/types/components/six-range/six-range.d.ts +24 -20
  50. package/dist/types/components/six-textarea/six-textarea.d.ts +22 -31
  51. package/dist/types/components.d.ts +19 -27
  52. package/dist/ui-library/{p-14f20bbb.entry.js → p-394a2a12.entry.js} +2 -2
  53. package/dist/ui-library/p-394a2a12.entry.js.map +1 -0
  54. package/dist/ui-library/{p-7e0cc4ae.entry.js → p-3c635d0a.entry.js} +2 -2
  55. package/dist/ui-library/p-3c635d0a.entry.js.map +1 -0
  56. package/dist/ui-library/p-5a25d6fb.entry.js +2 -0
  57. package/dist/ui-library/p-5a25d6fb.entry.js.map +1 -0
  58. package/dist/ui-library/{p-90dc6af4.entry.js → p-97cc839c.entry.js} +2 -2
  59. package/dist/ui-library/p-97cc839c.entry.js.map +1 -0
  60. package/dist/ui-library/p-b4dfb7cf.js.map +1 -1
  61. package/dist/ui-library/p-f604e067.entry.js +2 -0
  62. package/dist/ui-library/p-f604e067.entry.js.map +1 -0
  63. package/dist/ui-library/ui-library.esm.js +1 -1
  64. package/package.json +9 -9
  65. package/dist/ui-library/p-0d79b0c6.entry.js +0 -2
  66. package/dist/ui-library/p-0d79b0c6.entry.js.map +0 -1
  67. package/dist/ui-library/p-14f20bbb.entry.js.map +0 -1
  68. package/dist/ui-library/p-7e0cc4ae.entry.js.map +0 -1
  69. package/dist/ui-library/p-90dc6af4.entry.js.map +0 -1
  70. package/dist/ui-library/p-edc96efc.entry.js +0 -2
  71. package/dist/ui-library/p-edc96efc.entry.js.map +0 -1
@@ -14,9 +14,9 @@ import { EmptyPayload } from '../../utils/types';
14
14
  * @part label - The radio label.
15
15
  */
16
16
  export declare class SixRadio {
17
- inputId: string;
18
- labelId: string;
19
- input: HTMLInputElement;
17
+ private inputId;
18
+ private labelId;
19
+ private nativeInput?;
20
20
  host: HTMLSixRadioElement;
21
21
  hasFocus: boolean;
22
22
  /** The radio's name attribute. */
@@ -41,7 +41,6 @@ export declare class SixRadio {
41
41
  sixFocus: EventEmitter<EmptyPayload>;
42
42
  /** default state whether the radio button should be checked or not when resetting */
43
43
  private defaultState;
44
- connectedCallback(): void;
45
44
  componentWillLoad(): void;
46
45
  /** Sets focus on the radio. */
47
46
  setFocus(options?: FocusOptions): Promise<void>;
@@ -55,12 +54,12 @@ export declare class SixRadio {
55
54
  setCustomValidity(message: string): Promise<void>;
56
55
  /** Resets the formcontrol */
57
56
  reset(): Promise<void>;
58
- getAllRadios(): HTMLSixRadioElement[];
59
- getSiblingRadios(): HTMLSixRadioElement[];
60
- handleClick(): void;
61
- handleBlur(): void;
62
- handleFocus(): void;
63
- handleKeyDown(event: KeyboardEvent): void;
64
- handleMouseDown(event: MouseEvent): void;
57
+ private getAllRadios;
58
+ private getSiblingRadios;
59
+ private handleClick;
60
+ private handleBlur;
61
+ private handleFocus;
62
+ private handleKeyDown;
63
+ private handleMouseDown;
65
64
  render(): any;
66
65
  }
@@ -1,6 +1,5 @@
1
1
  import { EventEmitter } from '../../stencil-public-runtime';
2
2
  import { EmptyPayload } from '../../utils/types';
3
- import { EventListeners } from '../../utils/event-listeners';
4
3
  /**
5
4
  * @since 1.0
6
5
  * @status stable
@@ -16,16 +15,16 @@ import { EventListeners } from '../../utils/event-listeners';
16
15
  * @part tooltip - The range tooltip.
17
16
  */
18
17
  export declare class SixRange {
19
- inputId: string;
20
- labelId: string;
21
- helpTextId: string;
22
- errorTextId: string;
23
- resizeObserver: ResizeObserver;
24
- output: HTMLElement;
25
- input: HTMLInputElement;
26
- customErrorText: string;
27
- customValidation: boolean;
28
- readonly eventListeners: EventListeners;
18
+ private inputId;
19
+ private labelId;
20
+ private helpTextId;
21
+ private customErrorText;
22
+ private customValidation;
23
+ private errorTextId;
24
+ private eventListeners;
25
+ private resizeObserver?;
26
+ private output?;
27
+ private nativeInput?;
29
28
  host: HTMLSixRangeElement;
30
29
  hasFocus: boolean;
31
30
  hasHelpTextSlot: boolean;
@@ -85,17 +84,22 @@ export declare class SixRange {
85
84
  setCustomValidity(message: string): Promise<void>;
86
85
  /** Resets the formcontrol */
87
86
  reset(): Promise<void>;
88
- handleInput(): void;
89
- handleBlur(): void;
90
- handleFocus(): void;
91
- handleSlotChange(): void;
92
- handleTouchStart(): void;
93
- displayError(): boolean;
94
- syncTooltip(): void;
87
+ private handleInput;
88
+ private handleBlur;
89
+ private handleFocus;
90
+ private handleSlotChange;
91
+ private handleTouchStart;
92
+ private displayError;
93
+ private syncTooltip;
94
+ private isFirefox;
95
+ private update;
96
+ /**
97
+ * from https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/range#value
98
+ */
99
+ private getDefaultValue;
95
100
  /**
96
101
  * For Firefox this functionality is not needed because it is supported by standard CSS.
97
102
  */
98
- calculateColorRunnableTrack(): void;
99
- isFirefox(): boolean;
103
+ private calculateColorRunnableTrack;
100
104
  render(): any;
101
105
  }
@@ -1,5 +1,4 @@
1
1
  import { EventEmitter } from '../../stencil-public-runtime';
2
- import { EventListeners } from '../../utils/event-listeners';
3
2
  import { EmptyPayload } from '../../utils/types';
4
3
  /**
5
4
  * @since 1.0
@@ -18,15 +17,15 @@ import { EmptyPayload } from '../../utils/types';
18
17
  * @part help-text - The textarea help text.
19
18
  */
20
19
  export declare class SixTextarea {
21
- inputId: string;
22
- labelId: string;
23
- helpTextId: string;
24
- errorTextId: string;
25
- resizeObserver: ResizeObserver;
26
- textarea: HTMLTextAreaElement;
27
- customErrorText: string;
28
- customValidation: boolean;
29
- readonly eventListeners: EventListeners;
20
+ private inputId;
21
+ private labelId;
22
+ private helpTextId;
23
+ private errorTextId;
24
+ private nativeTextarea?;
25
+ private customErrorText;
26
+ private customValidation;
27
+ private eventListeners;
28
+ private resizeObserver?;
30
29
  host: HTMLSixTextareaElement;
31
30
  hasFocus: boolean;
32
31
  hasHelpTextSlot: boolean;
@@ -45,7 +44,7 @@ export declare class SixTextarea {
45
44
  /** The textarea's error text. Alternatively, you can use the error-text slot. */
46
45
  errorText: string;
47
46
  /** The textarea's placeholder text. */
48
- placeholder: string;
47
+ placeholder?: string;
49
48
  /** The number of rows to display by default. */
50
49
  rows: number;
51
50
  /** Controls how the textarea can be resized. */
@@ -55,9 +54,9 @@ export declare class SixTextarea {
55
54
  /** Set to true for a readonly textarea. */
56
55
  readonly: boolean;
57
56
  /** The minimum length of input that will be considered valid. */
58
- minlength: number;
57
+ minlength?: number;
59
58
  /** The maximum length of input that will be considered valid. */
60
- maxlength: number;
59
+ maxlength?: number;
61
60
  /** The textarea's required attribute. */
62
61
  required: boolean;
63
62
  /**
@@ -68,7 +67,7 @@ export declare class SixTextarea {
68
67
  /** The textarea's autocaptialize attribute. */
69
68
  autocapitalize: string;
70
69
  /** The textarea's autocorrect attribute. */
71
- autocorrect: string;
70
+ autocorrect: 'on' | 'off';
72
71
  /** The textarea's autocomplete attribute. */
73
72
  autocomplete: string;
74
73
  /** The textarea's autofocus attribute. */
@@ -76,7 +75,7 @@ export declare class SixTextarea {
76
75
  /** The textarea's spellcheck attribute. */
77
76
  spellcheck: boolean;
78
77
  /** The textarea's inputmode attribute. */
79
- inputmode: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';
78
+ inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';
80
79
  /** Set to display the error text on blur and not when typing */
81
80
  errorOnBlur: boolean;
82
81
  /** Emitted when the control's value changes. Access the new value via event.target.value. */
@@ -87,14 +86,6 @@ export declare class SixTextarea {
87
86
  sixFocus: EventEmitter<EmptyPayload>;
88
87
  /** Emitted when the control loses focus. Access the new value via event.target.value. */
89
88
  sixBlur: EventEmitter<EmptyPayload>;
90
- /**
91
- * Emitted whenever the value changes. Access the new value via event.target.value.
92
- * six-textarea-value-change will emit whenever the value changes.
93
- * So be it on textarea or when dynamically set. six-textarea-input will only be emitted when the user enters data,
94
- * but not when a value is dynamically set. six-textarea-change will only be emitted when the user either presses enter
95
- * or leaves the textarea field after entering some data.
96
- * */
97
- sixValueChange: EventEmitter<EmptyPayload>;
98
89
  handleLabelChange(): void;
99
90
  handleRowsChange(): void;
100
91
  handleValueChange(): void;
@@ -122,13 +113,13 @@ export declare class SixTextarea {
122
113
  setCustomValidity(message: string): Promise<void>;
123
114
  /** Resets the formcontrol */
124
115
  reset(): Promise<void>;
125
- handleChange(): void;
126
- handleInput(): void;
127
- handleInvalid(): void;
128
- handleBlur(): void;
129
- handleFocus(): void;
130
- handleSlotChange(): void;
131
- setTextareaHeight(): void;
132
- displayError(): boolean;
116
+ private handleChange;
117
+ private handleInput;
118
+ private handleBlur;
119
+ private handleFocus;
120
+ private handleSlotChange;
121
+ private setTextareaHeight;
122
+ private displayError;
123
+ private getValue;
133
124
  render(): any;
134
125
  }
@@ -275,7 +275,7 @@ export namespace Components {
275
275
  */
276
276
  "setFocus": (options?: FocusOptions) => Promise<void>;
277
277
  /**
278
- * The checkbox's value attribute.
278
+ * The value of the checkbox does not mean if it's checked or not, use the `checked` property for that. The value of a checkbox is analogous to the value of an `<input type="checkbox">`, it's only used when the checkbox participates in a native `<form>`.
279
279
  */
280
280
  "value": string;
281
281
  }
@@ -858,7 +858,7 @@ export namespace Components {
858
858
  /**
859
859
  * The input's autocorrect attribute.
860
860
  */
861
- "autocorrect": string;
861
+ "autocorrect": 'on' | 'off';
862
862
  /**
863
863
  * The input's autofocus attribute.
864
864
  */
@@ -890,7 +890,7 @@ export namespace Components {
890
890
  /**
891
891
  * Returns the native input's validity
892
892
  */
893
- "getValidity": () => Promise<ValidityState>;
893
+ "getValidity": () => Promise<ValidityState | undefined>;
894
894
  /**
895
895
  * The input's help text. Alternatively, you can use the help-text slot.
896
896
  */
@@ -898,7 +898,7 @@ export namespace Components {
898
898
  /**
899
899
  * The input's inputmode attribute.
900
900
  */
901
- "inputmode": 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';
901
+ "inputmode"?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';
902
902
  /**
903
903
  * This will be true when the control is in an invalid state. Validity is determined by props such as `type`, `required`, `minlength`, `maxlength`, and `pattern` using the browser's constraint validation API.
904
904
  */
@@ -918,19 +918,19 @@ export namespace Components {
918
918
  /**
919
919
  * The input's maximum value.
920
920
  */
921
- "max": number;
921
+ "max"?: number;
922
922
  /**
923
923
  * The maximum length of input that will be considered valid.
924
924
  */
925
- "maxlength": number;
925
+ "maxlength"?: number;
926
926
  /**
927
927
  * The input's minimum value.
928
928
  */
929
- "min": number;
929
+ "min"?: number;
930
930
  /**
931
931
  * The minimum length of input that will be considered valid.
932
932
  */
933
- "minlength": number;
933
+ "minlength"?: number;
934
934
  /**
935
935
  * The input's name attribute.
936
936
  */
@@ -938,7 +938,7 @@ export namespace Components {
938
938
  /**
939
939
  * A pattern to validate input against.
940
940
  */
941
- "pattern": string;
941
+ "pattern"?: string;
942
942
  /**
943
943
  * Set to true to draw a pill-style input with rounded edges.
944
944
  */
@@ -946,7 +946,7 @@ export namespace Components {
946
946
  /**
947
947
  * The input's placeholder text.
948
948
  */
949
- "placeholder": string;
949
+ "placeholder"?: string;
950
950
  /**
951
951
  * Set to true to make the input readonly.
952
952
  */
@@ -998,7 +998,7 @@ export namespace Components {
998
998
  /**
999
999
  * The input's step attribute.
1000
1000
  */
1001
- "step": number;
1001
+ "step"?: number;
1002
1002
  /**
1003
1003
  * Set to true to add a password toggle button for password inputs.
1004
1004
  */
@@ -1793,7 +1793,7 @@ export namespace Components {
1793
1793
  /**
1794
1794
  * The textarea's autocorrect attribute.
1795
1795
  */
1796
- "autocorrect": string;
1796
+ "autocorrect": 'on' | 'off';
1797
1797
  /**
1798
1798
  * The textarea's autofocus attribute.
1799
1799
  */
@@ -1821,7 +1821,7 @@ export namespace Components {
1821
1821
  /**
1822
1822
  * The textarea's inputmode attribute.
1823
1823
  */
1824
- "inputmode": 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';
1824
+ "inputmode"?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';
1825
1825
  /**
1826
1826
  * This will be true when the control is in an invalid state. Validity is determined by props such as `required`, `minlength`, and `maxlength` using the browser's constraint validation API.
1827
1827
  */
@@ -1833,11 +1833,11 @@ export namespace Components {
1833
1833
  /**
1834
1834
  * The maximum length of input that will be considered valid.
1835
1835
  */
1836
- "maxlength": number;
1836
+ "maxlength"?: number;
1837
1837
  /**
1838
1838
  * The minimum length of input that will be considered valid.
1839
1839
  */
1840
- "minlength": number;
1840
+ "minlength"?: number;
1841
1841
  /**
1842
1842
  * The textarea's name attribute.
1843
1843
  */
@@ -1845,7 +1845,7 @@ export namespace Components {
1845
1845
  /**
1846
1846
  * The textarea's placeholder text.
1847
1847
  */
1848
- "placeholder": string;
1848
+ "placeholder"?: string;
1849
1849
  /**
1850
1850
  * Set to true for a readonly textarea.
1851
1851
  */
@@ -3054,7 +3054,7 @@ declare namespace LocalJSX {
3054
3054
  */
3055
3055
  "required"?: boolean;
3056
3056
  /**
3057
- * The checkbox's value attribute.
3057
+ * The value of the checkbox does not mean if it's checked or not, use the `checked` property for that. The value of a checkbox is analogous to the value of an `<input type="checkbox">`, it's only used when the checkbox participates in a native `<form>`.
3058
3058
  */
3059
3059
  "value"?: string;
3060
3060
  }
@@ -3709,7 +3709,7 @@ declare namespace LocalJSX {
3709
3709
  /**
3710
3710
  * The input's autocorrect attribute.
3711
3711
  */
3712
- "autocorrect"?: string;
3712
+ "autocorrect"?: 'on' | 'off';
3713
3713
  /**
3714
3714
  * The input's autofocus attribute.
3715
3715
  */
@@ -3790,10 +3790,6 @@ declare namespace LocalJSX {
3790
3790
  * Emitted when the control receives input. Access the new value via event.target.value.
3791
3791
  */
3792
3792
  "onSix-input-input"?: (event: SixInputCustomEvent<EmptyPayload>) => void;
3793
- /**
3794
- * Emitted whenever the value changes. Access the new value via event.target.value. six-input-value-change will emit whenever the value changes. So be it on input or when dynamically set. six-input-input will only be emitted when the user enters data, but not when a value is dynamically set. six-input-change will only be emitted when the user either presses enter or leaves the input field after entering some data.
3795
- */
3796
- "onSix-input-value-change"?: (event: SixInputCustomEvent<EmptyPayload>) => void;
3797
3793
  /**
3798
3794
  * A pattern to validate input against.
3799
3795
  */
@@ -4600,7 +4596,7 @@ declare namespace LocalJSX {
4600
4596
  /**
4601
4597
  * The textarea's autocorrect attribute.
4602
4598
  */
4603
- "autocorrect"?: string;
4599
+ "autocorrect"?: 'on' | 'off';
4604
4600
  /**
4605
4601
  * The textarea's autofocus attribute.
4606
4602
  */
@@ -4661,10 +4657,6 @@ declare namespace LocalJSX {
4661
4657
  * Emitted when the control receives input. Access the new value via event.target.value.
4662
4658
  */
4663
4659
  "onSix-textarea-input"?: (event: SixTextareaCustomEvent<EmptyPayload>) => void;
4664
- /**
4665
- * Emitted whenever the value changes. Access the new value via event.target.value. six-textarea-value-change will emit whenever the value changes. So be it on textarea or when dynamically set. six-textarea-input will only be emitted when the user enters data, but not when a value is dynamically set. six-textarea-change will only be emitted when the user either presses enter or leaves the textarea field after entering some data.
4666
- */
4667
- "onSix-textarea-value-change"?: (event: SixTextareaCustomEvent<EmptyPayload>) => void;
4668
4660
  /**
4669
4661
  * The textarea's placeholder text.
4670
4662
  */
@@ -1,2 +1,2 @@
1
- import{r as i,c as t,h as s,g as o}from"./p-ac4f4d45.js";import{F as r}from"./p-79eee01b.js";import{h as e}from"./p-b4dfb7cf.js";import{E as n}from"./p-9a860acc.js";const l=':host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}.form-control .form-control__label{display:none}.form-control .form-control__help-text{display:none}.form-control .form-control__error-text{display:none}.form-control--has-label .form-control__label{display:inline-block;color:var(--six-input-label-color);font-weight:var(--six-font-weight-bold);margin-bottom:var(--six-spacing-x-small)}.form-control--has-label .form-control__label__required::after{color:var(--six-color-danger-800);content:"*"}.form-control--has-label.form-control--small .form-control__label{font-size:var(--six-input-label-font-size-small)}.form-control--has-label.form-control--medium .form-control__label{font-size:var(--six-input-label-font-size-medium)}.form-control--has-label.form-control--large .form-control_label{font-size:var(--six-input-label-font-size-large)}.form-control--has-help-text .form-control__help-text{display:block;color:var(--six-input-help-text-color);margin-top:var(--six-spacing-x-small)}.form-control--has-help-text .form-control__help-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-help-text.form-control--small .form-control__help-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-help-text.form-control--medium .form-control__help-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-help-text.form-control--large .form-control__help-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--has-error-text .form-control__error-text{display:block;color:var(--six-color-danger-800);margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text .form-control__error-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text.form-control--small .form-control__error-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-error-text.form-control--medium .form-control__error-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-error-text.form-control--large .form-control__error-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--disabled .form-control__help-text{color:var(--six-input-help-text-color-disabled)}.form-control--disabled .form-control__label{color:var(--six-input-label-color-disabled)}.form-control--invalid:not(.form-control--disabled) .form-control__label{color:var(--six-input-label-color)}:host{display:block}.input{display:inline-flex;align-items:stretch;justify-content:start;position:relative;width:100%;font-family:var(--six-font-family);font-weight:var(--six-input-font-weight);letter-spacing:var(--six-input-letter-spacing);background-color:var(--six-input-background-color);border:solid var(--six-border-width) var(--six-input-border-color);vertical-align:middle;overflow:hidden;transition:var(--six-transition-fast) color, var(--six-transition-fast) border, var(--six-transition-fast) box-shadow;cursor:text}.input--line{border:none;border-bottom:solid var(--six-border-width) var(--six-input-border-color)}.input:hover:not(.input--disabled){background-color:var(--six-input-background-color-hover);border-color:var(--six-input-border-color-hover)}.input:hover:not(.input--disabled) .input__control{color:var(--six-input-color-hover)}.input.input--focused:not(.input--disabled){background-color:var(--six-input-background-color-focus);border-bottom-color:var(--six-input-border-color-focus);box-shadow:0 1px 0 0 var(--six-input-border-color-focus)}.input.input--focused:not(.input--disabled):not(.input--line){border-color:var(--six-input-border-color-focus);box-shadow:var(--six-input-focus-shadow)}.input.input--focused:not(.input--disabled) .input__control{color:var(--six-input-color-focus)}.input.input--disabled{background-color:var(--six-input-background-color-disabled);border-color:var(--six-input-border-color-disabled);cursor:not-allowed}.input.input--disabled .input__control{color:var(--six-input-color-disabled)}.input.input--disabled .input__control::placeholder{color:var(--six-input-placeholder-color-disabled)}.input.input--invalid:not(.input--disabled):not(.input--focused){border-bottom-color:var(--six-input-border-color-danger)}.input.input--invalid:not(.input--disabled):not(.input--focused):not(.input--line){border-color:var(--six-input-border-color-danger)}.input__control{flex:1 1 auto;font-family:inherit;font-size:var(--six-input-font-size-medium);font-weight:inherit;min-width:0;color:var(--six-input-color);border:none;background:none;box-shadow:none;padding:0;margin:0;cursor:inherit;-webkit-appearance:none}.input__control::-webkit-search-decoration,.input__control::-webkit-search-cancel-button,.input__control::-webkit-search-results-button,.input__control::-webkit-search-results-decoration{-webkit-appearance:none}.input__control:-webkit-autofill,.input__control:-webkit-autofill:hover,.input__control:-webkit-autofill:focus,.input__control:-webkit-autofill:active{box-shadow:0 0 0 var(--six-height-large) var(--six-input-background-color-hover) inset !important;-webkit-text-fill-color:var(--six-color-primary-500)}.input__control::placeholder{color:var(--six-input-placeholder-color);user-select:none}.input__control:focus{outline:none}.input__control::-ms-reveal{display:none}.input__prefix,.input__suffix{display:inline-flex;flex:0 0 auto;align-items:center;cursor:default}.input__prefix ::slotted(six-icon),.input__suffix ::slotted(six-icon){color:var(--six-input-icon-color)}.input.input--disabled ::slotted(six-icon){cursor:not-allowed}.input--small{border-radius:var(--six-input-border-radius-small);font-size:var(--six-input-font-size-small);height:var(--six-height-small)}.input--small .input__control{height:calc(var(--six-height-small) - var(--six-border-width) * 2);margin:0 var(--six-input-spacing-small)}.input--small .input__control__prefix{margin:0 var(--six-input-prefix-spacing-small)}.input--small .input__clear,.input--small .input__password-toggle{margin-right:var(--six-input-spacing-small)}.input--small .input__prefix ::slotted(*){margin-left:var(--six-input-prefix-spacing-small)}.input--small .input__suffix ::slotted(*){margin-right:var(--six-input-prefix-spacing-small)}.input--medium{border-radius:var(--six-input-border-radius-medium);font-size:var(--six-input-font-size-medium);height:var(--six-height-medium)}.input--medium .input__control{height:calc(var(--six-height-medium) - var(--six-border-width) * 2);margin:0 var(--six-input-spacing-medium)}.input--medium .input__control__prefix{margin:0 var(--six-input-prefix-spacing-medium)}.input--medium .input__clear,.input--medium .input__password-toggle{margin-right:var(--six-input-spacing-medium)}.input--medium .input__prefix ::slotted(*){margin-left:var(--six-input-prefix-spacing-medium)}.input--medium .input__suffix ::slotted(*){margin-right:var(--six-input-prefix-spacing-medium)}.input--large{border-radius:var(--six-input-border-radius-large);font-size:var(--six-input-font-size-large);height:var(--six-height-large)}.input--large .input__control{height:calc(var(--six-height-large) - var(--six-border-width) * 2);margin:0 var(--six-input-spacing-large)}.input--large .input__control__prefix{margin:0 var(--six-input-prefix-spacing-large)}.input--large .input__clear,.input--large .input__password-toggle{margin-right:var(--six-input-spacing-large)}.input--large .input__prefix ::slotted(*){margin-left:var(--six-input-prefix-spacing-large)}.input--large .input__suffix ::slotted(*){margin-right:var(--six-input-prefix-spacing-large)}.input--pill.input--small{border-radius:var(--six-height-small)}.input--pill.input--medium{border-radius:var(--six-height-medium)}.input--pill.input--large{border-radius:var(--six-height-large)}.input__clear,.input__password-toggle{display:inline-flex;align-items:center;font-size:inherit;color:var(--six-input-icon-color);border:none;background:none;padding:0;transition:var(--six-transition-fast) color;cursor:pointer}.input__clear:hover,.input__password-toggle:hover{color:var(--six-input-icon-color-hover)}.input__clear:focus,.input__password-toggle:focus{outline:none}.input--empty .input__clear{visibility:hidden}';const a={large:"medium",medium:"small",small:"xSmall"};let h=0;const u=class{constructor(s){i(this,s);this.sixChange=t(this,"six-input-change",7);this.sixClear=t(this,"six-input-clear",7);this.sixInput=t(this,"six-input-input",7);this.sixFocus=t(this,"six-input-focus",7);this.sixBlur=t(this,"six-input-blur",7);this.sixValueChange=t(this,"six-input-value-change",7);this.inputId=`input-${++h}`;this.labelId=`input-label-${h}`;this.helpTextId=`input-help-text-${h}`;this.errorTextId=`input-error-text-${h}`;this.customErrorText="";this.customValidation=false;this.eventListeners=new n;this.defaultValue="";this.hasFocus=false;this.hasHelpTextSlot=false;this.hasErrorTextSlot=false;this.hasLabelSlot=false;this.isPasswordVisible=false;this.type="text";this.size="medium";this.name="";this.value="";this.pill=false;this.label="";this.helpText="";this.errorText="";this.placeholder=undefined;this.disabled=false;this.readonly=false;this.minlength=undefined;this.maxlength=undefined;this.min=undefined;this.max=undefined;this.step=undefined;this.pattern=undefined;this.required=undefined;this.autocapitalize=undefined;this.autocorrect=undefined;this.autocomplete=undefined;this.autofocus=undefined;this.spellcheck=undefined;this.invalid=false;this.clearable=false;this.togglePassword=false;this.inputmode=undefined;this.line=false;this.errorOnBlur=false}handleLabelChange(){this.handleSlotChange()}handleValueChange(){if(!this.input){return}this.input.value=this.value;this.invalid=!this.input.checkValidity();this.sixValueChange.emit()}connectedCallback(){this.handleChange=this.handleChange.bind(this);this.handleInput=this.handleInput.bind(this);this.handleInvalid=this.handleInvalid.bind(this);this.handleBlur=this.handleBlur.bind(this);this.handleFocus=this.handleFocus.bind(this);this.handleClearClick=this.handleClearClick.bind(this);this.handlePasswordToggle=this.handlePasswordToggle.bind(this);this.handleSlotChange=this.handleSlotChange.bind(this);this.host.shadowRoot.addEventListener("slotchange",this.handleSlotChange)}componentWillLoad(){this.defaultValue=this.value;this.handleSlotChange()}componentDidLoad(){this.eventListeners.add(this.input,"invalid",(i=>{if(this.customValidation||!this.hasErrorTextSlot&&!this.errorText&&!this.customErrorText){this.customErrorText=this.input.validationMessage}i.preventDefault()}))}disconnectedCallback(){this.host.shadowRoot.removeEventListener("slotchange",this.handleSlotChange);this.eventListeners.removeAll()}async setFocus(i){this.input.focus(i)}async removeFocus(){this.input.blur()}async select(){return this.input.select()}async setSelectionRange(i,t,s="none"){return this.input.setSelectionRange(i,t,s)}async setRangeText(i,t,s,o="preserve"){this.input.setRangeText(i,t,s,o);if(this.value!==this.input.value){this.value=this.input.value;this.sixChange.emit();this.sixInput.emit()}}async reportValidity(){return this.input.reportValidity()}async checkValidity(){return this.input.validity.valid}async setCustomValidity(i){this.customErrorText="";this.customValidation=i!=="";this.input.setCustomValidity(i);this.invalid=!this.input.checkValidity()}async getValidity(){return this.input.validity}async isValid(){return this.input.validity.valid}async getValidationMessage(){return this.input.validationMessage}async reset(){this.value=this.defaultValue;this.customErrorText="";this.customValidation=false;this.input.setCustomValidity("");this.invalid=false}handleChange(){this.value=this.input.value;this.sixChange.emit()}handleInput(){this.value=this.input.value;this.sixInput.emit()}handleInvalid(){this.invalid=true}handleBlur(){this.hasFocus=false;this.sixBlur.emit()}handleFocus(){this.hasFocus=true;this.sixFocus.emit()}handleClearClick(i){this.value="";this.sixClear.emit();this.sixInput.emit();this.sixChange.emit();this.input.focus();i.stopPropagation()}handlePasswordToggle(){this.isPasswordVisible=!this.isPasswordVisible}handleSlotChange(){this.hasHelpTextSlot=e(this.host,"help-text");this.hasErrorTextSlot=e(this.host,"error-text");this.hasLabelSlot=e(this.host,"label")}displayError(){return this.invalid&&(!this.errorOnBlur||!this.hasFocus)}render(){var i;return s(r,{inputId:this.inputId,label:this.label,labelId:this.labelId,hasLabelSlot:this.hasLabelSlot,helpTextId:this.helpTextId,helpText:this.helpText,hasHelpTextSlot:this.hasHelpTextSlot,errorTextId:this.errorTextId,errorText:this.customErrorText?this.customErrorText:this.errorText,hasErrorTextSlot:this.hasErrorTextSlot,size:this.size,disabled:this.disabled,required:this.required,displayError:this.displayError()},s("div",{part:"base",class:{input:true,"input--small":this.size==="small","input--medium":this.size==="medium","input--large":this.size==="large","input--line":this.line,"input--pill":this.pill,"input--disabled":this.disabled,"input--focused":this.hasFocus,"input--empty":((i=this.value)===null||i===void 0?void 0:i.length)===0,"input--invalid":this.invalid}},s("span",{part:"prefix",class:"input__prefix"},s("slot",{name:"prefix"})),s("input",{part:"input",ref:i=>this.input=i,id:this.inputId,size:1,class:{input__control:true,input__control__prefix:e(this.host,"prefix")},type:this.type==="password"&&this.isPasswordVisible?"text":this.type,name:this.name,placeholder:this.placeholder,disabled:this.disabled,readonly:this.readonly,minLength:this.minlength,maxLength:this.maxlength,min:this.min,max:this.max,step:this.step,value:this.value,autoCapitalize:this.autocapitalize,autoComplete:this.autocomplete,autoCorrect:this.autocorrect,autoFocus:this.autofocus,spellcheck:this.spellcheck,pattern:this.pattern,required:this.required,inputMode:this.inputmode,"aria-labelledby":this.labelId,"aria-describedby":this.helpTextId,"aria-invalid":this.invalid?"true":"false",onChange:this.handleChange,onInput:this.handleInput,onInvalid:this.handleInvalid,onFocus:this.handleFocus,onBlur:this.handleBlur,"data-testid":"input-control"}),this.clearable&&s("button",{part:"clear-button",class:"input__clear",type:"button",onClick:this.handleClearClick,tabindex:"-1","data-testid":"input-clear-button"},s("slot",{name:"clear-icon"},s("six-icon",{size:a[this.size]},"clear"))),this.togglePassword&&s("button",{part:"password-toggle-button",class:"input__password-toggle",type:"button",onClick:this.handlePasswordToggle,tabindex:"-1"},this.isPasswordVisible?s("slot",{name:"show-password-icon"},s("six-icon",{size:a[this.size]},"visibility_off")):s("slot",{name:"hide-password-icon"},s("six-icon",{size:a[this.size]},"visibility"))),s("span",{part:"suffix",class:"input__suffix"},s("slot",{name:"suffix"}))))}get host(){return o(this)}static get watchers(){return{helpText:["handleLabelChange"],errorText:["handleLabelChange"],label:["handleLabelChange"],value:["handleValueChange"]}}};u.style=l;export{u as six_input};
2
- //# sourceMappingURL=p-14f20bbb.entry.js.map
1
+ import{r as i,c as t,h as o,g as r}from"./p-ac4f4d45.js";import{F as s}from"./p-79eee01b.js";import{h as e}from"./p-b4dfb7cf.js";import{E as n}from"./p-9a860acc.js";const l=':host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}.form-control .form-control__label{display:none}.form-control .form-control__help-text{display:none}.form-control .form-control__error-text{display:none}.form-control--has-label .form-control__label{display:inline-block;color:var(--six-input-label-color);font-weight:var(--six-font-weight-bold);margin-bottom:var(--six-spacing-x-small)}.form-control--has-label .form-control__label__required::after{color:var(--six-color-danger-800);content:"*"}.form-control--has-label.form-control--small .form-control__label{font-size:var(--six-input-label-font-size-small)}.form-control--has-label.form-control--medium .form-control__label{font-size:var(--six-input-label-font-size-medium)}.form-control--has-label.form-control--large .form-control_label{font-size:var(--six-input-label-font-size-large)}.form-control--has-help-text .form-control__help-text{display:block;color:var(--six-input-help-text-color);margin-top:var(--six-spacing-x-small)}.form-control--has-help-text .form-control__help-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-help-text.form-control--small .form-control__help-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-help-text.form-control--medium .form-control__help-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-help-text.form-control--large .form-control__help-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--has-error-text .form-control__error-text{display:block;color:var(--six-color-danger-800);margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text .form-control__error-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text.form-control--small .form-control__error-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-error-text.form-control--medium .form-control__error-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-error-text.form-control--large .form-control__error-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--disabled .form-control__help-text{color:var(--six-input-help-text-color-disabled)}.form-control--disabled .form-control__label{color:var(--six-input-label-color-disabled)}.form-control--invalid:not(.form-control--disabled) .form-control__label{color:var(--six-input-label-color)}:host{display:block}.input{display:inline-flex;align-items:stretch;justify-content:start;position:relative;width:100%;font-family:var(--six-font-family);font-weight:var(--six-input-font-weight);letter-spacing:var(--six-input-letter-spacing);background-color:var(--six-input-background-color);border:solid var(--six-border-width) var(--six-input-border-color);vertical-align:middle;overflow:hidden;transition:var(--six-transition-fast) color, var(--six-transition-fast) border, var(--six-transition-fast) box-shadow;cursor:text}.input--line{border:none;border-bottom:solid var(--six-border-width) var(--six-input-border-color)}.input:hover:not(.input--disabled){background-color:var(--six-input-background-color-hover);border-color:var(--six-input-border-color-hover)}.input:hover:not(.input--disabled) .input__control{color:var(--six-input-color-hover)}.input.input--focused:not(.input--disabled){background-color:var(--six-input-background-color-focus);border-bottom-color:var(--six-input-border-color-focus);box-shadow:0 1px 0 0 var(--six-input-border-color-focus)}.input.input--focused:not(.input--disabled):not(.input--line){border-color:var(--six-input-border-color-focus);box-shadow:var(--six-input-focus-shadow)}.input.input--focused:not(.input--disabled) .input__control{color:var(--six-input-color-focus)}.input.input--disabled{background-color:var(--six-input-background-color-disabled);border-color:var(--six-input-border-color-disabled);cursor:not-allowed}.input.input--disabled .input__control{color:var(--six-input-color-disabled)}.input.input--disabled .input__control::placeholder{color:var(--six-input-placeholder-color-disabled)}.input.input--invalid:not(.input--disabled):not(.input--focused){border-bottom-color:var(--six-input-border-color-danger)}.input.input--invalid:not(.input--disabled):not(.input--focused):not(.input--line){border-color:var(--six-input-border-color-danger)}.input__control{flex:1 1 auto;font-family:inherit;font-size:var(--six-input-font-size-medium);font-weight:inherit;min-width:0;color:var(--six-input-color);border:none;background:none;box-shadow:none;padding:0;margin:0;cursor:inherit;-webkit-appearance:none}.input__control::-webkit-search-decoration,.input__control::-webkit-search-cancel-button,.input__control::-webkit-search-results-button,.input__control::-webkit-search-results-decoration{-webkit-appearance:none}.input__control:-webkit-autofill,.input__control:-webkit-autofill:hover,.input__control:-webkit-autofill:focus,.input__control:-webkit-autofill:active{box-shadow:0 0 0 var(--six-height-large) var(--six-input-background-color-hover) inset !important;-webkit-text-fill-color:var(--six-color-primary-500)}.input__control::placeholder{color:var(--six-input-placeholder-color);user-select:none}.input__control:focus{outline:none}.input__control::-ms-reveal{display:none}.input__prefix,.input__suffix{display:inline-flex;flex:0 0 auto;align-items:center;cursor:default}.input__prefix ::slotted(six-icon),.input__suffix ::slotted(six-icon){color:var(--six-input-icon-color)}.input.input--disabled ::slotted(six-icon){cursor:not-allowed}.input--small{border-radius:var(--six-input-border-radius-small);font-size:var(--six-input-font-size-small);height:var(--six-height-small)}.input--small .input__control{height:calc(var(--six-height-small) - var(--six-border-width) * 2);margin:0 var(--six-input-spacing-small)}.input--small .input__control__prefix{margin:0 var(--six-input-prefix-spacing-small)}.input--small .input__clear,.input--small .input__password-toggle{margin-right:var(--six-input-spacing-small)}.input--small .input__prefix ::slotted(*){margin-left:var(--six-input-prefix-spacing-small)}.input--small .input__suffix ::slotted(*){margin-right:var(--six-input-prefix-spacing-small)}.input--medium{border-radius:var(--six-input-border-radius-medium);font-size:var(--six-input-font-size-medium);height:var(--six-height-medium)}.input--medium .input__control{height:calc(var(--six-height-medium) - var(--six-border-width) * 2);margin:0 var(--six-input-spacing-medium)}.input--medium .input__control__prefix{margin:0 var(--six-input-prefix-spacing-medium)}.input--medium .input__clear,.input--medium .input__password-toggle{margin-right:var(--six-input-spacing-medium)}.input--medium .input__prefix ::slotted(*){margin-left:var(--six-input-prefix-spacing-medium)}.input--medium .input__suffix ::slotted(*){margin-right:var(--six-input-prefix-spacing-medium)}.input--large{border-radius:var(--six-input-border-radius-large);font-size:var(--six-input-font-size-large);height:var(--six-height-large)}.input--large .input__control{height:calc(var(--six-height-large) - var(--six-border-width) * 2);margin:0 var(--six-input-spacing-large)}.input--large .input__control__prefix{margin:0 var(--six-input-prefix-spacing-large)}.input--large .input__clear,.input--large .input__password-toggle{margin-right:var(--six-input-spacing-large)}.input--large .input__prefix ::slotted(*){margin-left:var(--six-input-prefix-spacing-large)}.input--large .input__suffix ::slotted(*){margin-right:var(--six-input-prefix-spacing-large)}.input--pill.input--small{border-radius:var(--six-height-small)}.input--pill.input--medium{border-radius:var(--six-height-medium)}.input--pill.input--large{border-radius:var(--six-height-large)}.input__clear,.input__password-toggle{display:inline-flex;align-items:center;font-size:inherit;color:var(--six-input-icon-color);border:none;background:none;padding:0;transition:var(--six-transition-fast) color;cursor:pointer}.input__clear:hover,.input__password-toggle:hover{color:var(--six-input-icon-color-hover)}.input__clear:focus,.input__password-toggle:focus{outline:none}.input--empty .input__clear{visibility:hidden}';const a={large:"medium",medium:"small",small:"xSmall"};let u=0;const h=class{constructor(o){i(this,o);this.sixChange=t(this,"six-input-change",7);this.sixClear=t(this,"six-input-clear",7);this.sixInput=t(this,"six-input-input",7);this.sixFocus=t(this,"six-input-focus",7);this.sixBlur=t(this,"six-input-blur",7);this.inputId=`input-${++u}`;this.labelId=`input-label-${u}`;this.helpTextId=`input-help-text-${u}`;this.errorTextId=`input-error-text-${u}`;this.customErrorText="";this.customValidation=false;this.eventListeners=new n;this.defaultValue="";this.handleChange=()=>{if(this.nativeInput!=null){this.value=this.nativeInput.value;this.sixChange.emit()}};this.handleInput=()=>{if(this.nativeInput!=null){this.value=this.nativeInput.value;this.sixInput.emit()}};this.handleBlur=()=>{this.hasFocus=false;this.sixBlur.emit()};this.handleFocus=()=>{this.hasFocus=true;this.sixFocus.emit()};this.handleClearClick=i=>{this.value="";this.sixClear.emit();this.sixInput.emit();this.sixChange.emit();if(this.nativeInput!=null){this.nativeInput.focus()}i.stopPropagation()};this.handlePasswordToggle=()=>{this.isPasswordVisible=!this.isPasswordVisible};this.handleSlotChange=()=>{this.hasHelpTextSlot=e(this.host,"help-text");this.hasErrorTextSlot=e(this.host,"error-text");this.hasLabelSlot=e(this.host,"label")};this.hasFocus=false;this.hasHelpTextSlot=false;this.hasErrorTextSlot=false;this.hasLabelSlot=false;this.isPasswordVisible=false;this.type="text";this.size="medium";this.name="";this.value="";this.pill=false;this.label="";this.helpText="";this.errorText="";this.placeholder=undefined;this.disabled=false;this.readonly=false;this.minlength=undefined;this.maxlength=undefined;this.min=undefined;this.max=undefined;this.step=undefined;this.pattern=undefined;this.required=false;this.autocapitalize="off";this.autocorrect="off";this.autocomplete="off";this.autofocus=false;this.spellcheck=false;this.invalid=false;this.clearable=false;this.togglePassword=false;this.inputmode=undefined;this.line=false;this.errorOnBlur=false}handleLabelChange(){this.handleSlotChange()}handleValueChange(){this.value=this.getValue();if(this.nativeInput!=null){if(this.nativeInput.value!==this.value){this.nativeInput.value=this.value}this.invalid=!this.nativeInput.checkValidity()}}connectedCallback(){var i;(i=this.host.shadowRoot)===null||i===void 0?void 0:i.addEventListener("slotchange",this.handleSlotChange)}componentWillLoad(){this.defaultValue=this.getValue();this.handleSlotChange()}componentDidLoad(){const i=this.nativeInput;if(i==null){return}this.eventListeners.add(i,"invalid",(t=>{this.invalid=true;if(this.customValidation||!this.hasErrorTextSlot&&this.errorText===""&&this.customErrorText===""){this.customErrorText=i.validationMessage}t.preventDefault()}))}disconnectedCallback(){var i;(i=this.host.shadowRoot)===null||i===void 0?void 0:i.removeEventListener("slotchange",this.handleSlotChange);this.eventListeners.removeAll()}async setFocus(i){var t;(t=this.nativeInput)===null||t===void 0?void 0:t.focus(i)}async removeFocus(){var i;(i=this.nativeInput)===null||i===void 0?void 0:i.blur()}async select(){var i;return(i=this.nativeInput)===null||i===void 0?void 0:i.select()}async setSelectionRange(i,t,o="none"){var r;return(r=this.nativeInput)===null||r===void 0?void 0:r.setSelectionRange(i,t,o)}async setRangeText(i,t,o,r="preserve"){if(this.nativeInput==null){return}this.nativeInput.setRangeText(i,t,o,r);if(this.getValue()!==this.nativeInput.value){this.value=this.nativeInput.value;this.sixChange.emit();this.sixInput.emit()}}async reportValidity(){var i;return(i=this.nativeInput)===null||i===void 0?void 0:i.reportValidity()}async checkValidity(){if(this.nativeInput==null){return true}return this.nativeInput.validity.valid}async setCustomValidity(i){this.customErrorText="";this.customValidation=i!=="";if(this.nativeInput!=null){this.nativeInput.setCustomValidity(i);this.invalid=!this.nativeInput.checkValidity()}}async getValidity(){var i;return(i=this===null||this===void 0?void 0:this.nativeInput)===null||i===void 0?void 0:i.validity}async isValid(){if(this.nativeInput==null){return true}return this.nativeInput.validity.valid}async getValidationMessage(){if(this.nativeInput==null){return""}return this.nativeInput.validationMessage}async reset(){var i;this.value=this.defaultValue;this.customErrorText="";this.customValidation=false;(i=this.nativeInput)===null||i===void 0?void 0:i.setCustomValidity("");this.invalid=false}displayError(){return this.invalid&&(!this.errorOnBlur||!this.hasFocus)}getValue(){var i;return((i=this.value)!==null&&i!==void 0?i:"").toString()}render(){return o(s,{inputId:this.inputId,label:this.label,labelId:this.labelId,hasLabelSlot:this.hasLabelSlot,helpTextId:this.helpTextId,helpText:this.helpText,hasHelpTextSlot:this.hasHelpTextSlot,errorTextId:this.errorTextId,errorText:this.customErrorText!=null?this.customErrorText:this.errorText,hasErrorTextSlot:this.hasErrorTextSlot,size:this.size,disabled:this.disabled,required:this.required,displayError:this.displayError()},o("div",{part:"base",class:{input:true,"input--small":this.size==="small","input--medium":this.size==="medium","input--large":this.size==="large","input--line":this.line,"input--pill":this.pill,"input--disabled":this.disabled,"input--focused":this.hasFocus,"input--empty":this.getValue().length===0,"input--invalid":this.invalid}},o("span",{part:"prefix",class:"input__prefix"},o("slot",{name:"prefix"})),o("input",{part:"input",ref:i=>this.nativeInput=i,id:this.inputId,size:1,class:{input__control:true,input__control__prefix:e(this.host,"prefix")},type:this.type==="password"&&this.isPasswordVisible?"text":this.type,name:this.name,placeholder:this.placeholder,disabled:this.disabled,readonly:this.readonly,minLength:this.minlength,maxLength:this.maxlength,min:this.min,max:this.max,step:this.step,value:this.getValue(),autoCapitalize:this.autocapitalize,autoComplete:this.autocomplete,autoCorrect:this.autocorrect,autoFocus:this.autofocus,spellcheck:this.spellcheck,pattern:this.pattern,required:this.required,inputMode:this.inputmode,"aria-labelledby":this.labelId,"aria-describedby":this.helpTextId,"aria-invalid":this.invalid?"true":"false",onChange:this.handleChange,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur,"data-testid":"input-control"}),this.clearable&&o("button",{part:"clear-button",class:"input__clear",type:"button",onClick:this.handleClearClick,tabindex:"-1","data-testid":"input-clear-button"},o("slot",{name:"clear-icon"},o("six-icon",{size:a[this.size]},"clear"))),this.togglePassword&&o("button",{part:"password-toggle-button",class:"input__password-toggle",type:"button",onClick:this.handlePasswordToggle,tabindex:"-1"},this.isPasswordVisible?o("slot",{name:"show-password-icon"},o("six-icon",{size:a[this.size]},"visibility_off")):o("slot",{name:"hide-password-icon"},o("six-icon",{size:a[this.size]},"visibility"))),o("span",{part:"suffix",class:"input__suffix"},o("slot",{name:"suffix"}))))}get host(){return r(this)}static get watchers(){return{helpText:["handleLabelChange"],errorText:["handleLabelChange"],label:["handleLabelChange"],value:["handleValueChange"]}}};h.style=l;export{h as six_input};
2
+ //# sourceMappingURL=p-394a2a12.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["sixInputCss","ICON_SIZES","large","medium","small","id","SixInput","this","inputId","labelId","helpTextId","errorTextId","customErrorText","customValidation","eventListeners","EventListeners","defaultValue","handleChange","nativeInput","value","sixChange","emit","handleInput","sixInput","handleBlur","hasFocus","sixBlur","handleFocus","sixFocus","handleClearClick","event","sixClear","focus","stopPropagation","handlePasswordToggle","isPasswordVisible","handleSlotChange","hasHelpTextSlot","hasSlot","host","hasErrorTextSlot","hasLabelSlot","handleLabelChange","handleValueChange","getValue","invalid","checkValidity","connectedCallback","_a","shadowRoot","addEventListener","componentWillLoad","componentDidLoad","add","errorText","validationMessage","preventDefault","disconnectedCallback","removeEventListener","removeAll","async","options","blur","select","selectionStart","selectionEnd","selectionDirection","setSelectionRange","replacement","start","end","selectMode","setRangeText","reportValidity","validity","valid","message","setCustomValidity","displayError","errorOnBlur","toString","render","h","FormControl","label","helpText","size","disabled","required","part","class","input","line","pill","length","name","ref","el","input__control","input__control__prefix","type","placeholder","readonly","minLength","minlength","maxLength","maxlength","min","max","step","autoCapitalize","autocapitalize","autoComplete","autocomplete","autoCorrect","autocorrect","autoFocus","autofocus","spellcheck","pattern","inputMode","inputmode","onChange","onInput","onFocus","onBlur","clearable","onClick","tabindex","togglePassword"],"sources":["./src/components/six-input/six-input.scss?tag=six-input&encapsulation=shadow","./src/components/six-input/six-input.tsx"],"sourcesContent":["@import 'src/global/component';\n@import '../../functional-components/form-control/form-control';\n\n:host {\n display: block;\n}\n\n.input {\n display: inline-flex;\n align-items: stretch;\n justify-content: start;\n position: relative;\n width: 100%;\n font-family: var(--six-font-family);\n font-weight: var(--six-input-font-weight);\n letter-spacing: var(--six-input-letter-spacing);\n background-color: var(--six-input-background-color);\n border: solid var(--six-border-width) var(--six-input-border-color);\n vertical-align: middle;\n overflow: hidden;\n transition: var(--six-transition-fast) color, var(--six-transition-fast) border, var(--six-transition-fast) box-shadow;\n cursor: text;\n\n &--line {\n border: none;\n border-bottom: solid var(--six-border-width) var(--six-input-border-color);\n }\n\n &:hover:not(.input--disabled) {\n background-color: var(--six-input-background-color-hover);\n border-color: var(--six-input-border-color-hover);\n\n .input__control {\n color: var(--six-input-color-hover);\n }\n }\n\n &.input--focused:not(.input--disabled) {\n background-color: var(--six-input-background-color-focus);\n\n border-bottom-color: var(--six-input-border-color-focus);\n box-shadow: 0 1px 0 0 var(--six-input-border-color-focus);\n\n &:not(.input--line) {\n border-color: var(--six-input-border-color-focus);\n box-shadow: var(--six-input-focus-shadow);\n }\n\n .input__control {\n color: var(--six-input-color-focus);\n }\n }\n\n &.input--disabled {\n background-color: var(--six-input-background-color-disabled);\n border-color: var(--six-input-border-color-disabled);\n cursor: not-allowed;\n\n .input__control {\n color: var(--six-input-color-disabled);\n\n &::placeholder {\n color: var(--six-input-placeholder-color-disabled);\n }\n }\n }\n\n &.input--invalid:not(.input--disabled):not(.input--focused) {\n border-bottom-color: var(--six-input-border-color-danger);\n\n &:not(.input--line) {\n border-color: var(--six-input-border-color-danger);\n }\n }\n}\n\n.input__control {\n flex: 1 1 auto;\n font-family: inherit;\n font-size: var(--six-input-font-size-medium);\n font-weight: inherit;\n min-width: 0;\n color: var(--six-input-color);\n border: none;\n background: none;\n box-shadow: none;\n padding: 0;\n margin: 0;\n cursor: inherit;\n -webkit-appearance: none;\n\n &::-webkit-search-decoration,\n &::-webkit-search-cancel-button,\n &::-webkit-search-results-button,\n &::-webkit-search-results-decoration {\n -webkit-appearance: none;\n }\n\n &:-webkit-autofill,\n &:-webkit-autofill:hover,\n &:-webkit-autofill:focus,\n &:-webkit-autofill:active {\n box-shadow: 0 0 0 var(--six-height-large) var(--six-input-background-color-hover) inset !important;\n -webkit-text-fill-color: var(--six-color-primary-500);\n }\n\n &::placeholder {\n color: var(--six-input-placeholder-color);\n user-select: none;\n }\n\n &:focus {\n outline: none;\n }\n\n &::-ms-reveal {\n display: none;\n }\n}\n\n.input__prefix,\n.input__suffix {\n display: inline-flex;\n flex: 0 0 auto;\n align-items: center;\n cursor: default;\n\n ::slotted(six-icon) {\n color: var(--six-input-icon-color);\n }\n}\n\n.input {\n &.input--disabled {\n ::slotted(six-icon) {\n cursor: not-allowed;\n }\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Size modifiers\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.input--small {\n border-radius: var(--six-input-border-radius-small);\n font-size: var(--six-input-font-size-small);\n height: var(--six-height-small);\n\n .input__control {\n height: calc(var(--six-height-small) - var(--six-border-width) * 2);\n margin: 0 var(--six-input-spacing-small);\n }\n\n .input__control__prefix {\n margin: 0 var(--six-input-prefix-spacing-small);\n }\n\n .input__clear,\n .input__password-toggle {\n margin-right: var(--six-input-spacing-small);\n }\n\n .input__prefix ::slotted(*) {\n margin-left: var(--six-input-prefix-spacing-small);\n }\n\n .input__suffix ::slotted(*) {\n margin-right: var(--six-input-prefix-spacing-small);\n }\n}\n\n.input--medium {\n border-radius: var(--six-input-border-radius-medium);\n font-size: var(--six-input-font-size-medium);\n height: var(--six-height-medium);\n\n .input__control {\n height: calc(var(--six-height-medium) - var(--six-border-width) * 2);\n margin: 0 var(--six-input-spacing-medium);\n }\n\n .input__control__prefix {\n margin: 0 var(--six-input-prefix-spacing-medium);\n }\n\n .input__clear,\n .input__password-toggle {\n margin-right: var(--six-input-spacing-medium);\n }\n\n .input__prefix ::slotted(*) {\n margin-left: var(--six-input-prefix-spacing-medium);\n }\n\n .input__suffix ::slotted(*) {\n margin-right: var(--six-input-prefix-spacing-medium);\n }\n}\n\n.input--large {\n border-radius: var(--six-input-border-radius-large);\n font-size: var(--six-input-font-size-large);\n height: var(--six-height-large);\n\n .input__control {\n height: calc(var(--six-height-large) - var(--six-border-width) * 2);\n margin: 0 var(--six-input-spacing-large);\n }\n\n .input__control__prefix {\n margin: 0 var(--six-input-prefix-spacing-large);\n }\n\n .input__clear,\n .input__password-toggle {\n margin-right: var(--six-input-spacing-large);\n }\n\n .input__prefix ::slotted(*) {\n margin-left: var(--six-input-prefix-spacing-large);\n }\n\n .input__suffix ::slotted(*) {\n margin-right: var(--six-input-prefix-spacing-large);\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Pill modifier\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.input--pill {\n &.input--small {\n border-radius: var(--six-height-small);\n }\n\n &.input--medium {\n border-radius: var(--six-height-medium);\n }\n\n &.input--large {\n border-radius: var(--six-height-large);\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Clearable + Password Toggle\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.input__clear,\n.input__password-toggle {\n display: inline-flex;\n align-items: center;\n font-size: inherit;\n color: var(--six-input-icon-color);\n border: none;\n background: none;\n padding: 0;\n transition: var(--six-transition-fast) color;\n cursor: pointer;\n\n &:hover {\n color: var(--six-input-icon-color-hover);\n }\n\n &:focus {\n outline: none;\n }\n}\n\n.input--empty .input__clear {\n visibility: hidden;\n}\n","import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport FormControl from '../../functional-components/form-control/form-control';\nimport { hasSlot } from '../../utils/slot';\nimport { EmptyPayload } from '../../utils/types';\nimport { EventListeners } from '../../utils/event-listeners';\n\nconst ICON_SIZES: Record<'small' | 'medium' | 'large', 'xSmall' | 'small' | 'medium'> = {\n large: 'medium',\n medium: 'small',\n small: 'xSmall',\n};\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot label - The input's label. Alternatively, you can use the label prop.\n * @slot prefix - Used to prepend an icon or similar element to the input.\n * @slot suffix - Used to append an icon or similar element to the input.\n * @slot clear-icon - An icon to use in lieu of the default clear icon.\n * @slot show-password-icon - An icon to use in lieu of the default show password icon.\n * @slot hide-password-icon - An icon to use in lieu of the default hide password icon.\n * @slot help-text - Help text that describes how to use the input. Alternatively, you can use the help-text prop.\n * @slot error-text - Error text that is shown for validation errors. Alternatively, you can use the error-text prop.\n *\n * @part base - The component's base wrapper.\n * @part form-control - The form control that wraps the label, input, and help-text.\n * @part label - The input label.\n * @part input - The input control.\n * @part prefix - The input prefix container.\n * @part clear-button - The clear button.\n * @part password-toggle-button - The password toggle button.\n * @part suffix - The input suffix container.\n * @part help-text - The input help text.\n */\n\n@Component({\n tag: 'six-input',\n styleUrl: 'six-input.scss',\n shadow: true,\n})\nexport class SixInput {\n private inputId = `input-${++id}`;\n private labelId = `input-label-${id}`;\n private helpTextId = `input-help-text-${id}`;\n private errorTextId = `input-error-text-${id}`;\n private nativeInput?: HTMLInputElement;\n private customErrorText = '';\n private customValidation = false;\n private eventListeners = new EventListeners();\n\n @Element() host!: HTMLSixInputElement;\n\n @State() hasFocus = false;\n @State() hasHelpTextSlot = false;\n @State() hasErrorTextSlot = false;\n @State() hasLabelSlot = false;\n @State() isPasswordVisible = false;\n\n /** The input's type. */\n @Prop({ reflect: true }) type: 'email' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'url' = 'text';\n\n /** The input's size. */\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /** The input's name attribute. */\n @Prop({ reflect: true }) name = '';\n\n /** The input's value attribute. */\n @Prop({ mutable: true, reflect: true }) value = '';\n\n /** Set to true to draw a pill-style input with rounded edges. */\n @Prop({ reflect: true }) pill = false;\n\n /** The input's label. Alternatively, you can use the label slot. */\n @Prop() label = '';\n\n /** The input's help text. Alternatively, you can use the help-text slot. */\n @Prop() helpText = '';\n\n /** The input's error text. Alternatively, you can use the error-text slot. */\n @Prop() errorText = '';\n\n /** The input's placeholder text. */\n @Prop() placeholder?: string;\n\n /** Set to true to disable the input. */\n @Prop({ reflect: true }) disabled = false;\n\n /** Set to true to make the input readonly. */\n @Prop({ reflect: true }) readonly = false;\n\n /** The minimum length of input that will be considered valid. */\n @Prop({ reflect: true }) minlength?: number;\n\n /** The maximum length of input that will be considered valid. */\n @Prop({ reflect: true }) maxlength?: number;\n\n /** The input's minimum value. */\n @Prop({ reflect: true }) min?: number;\n\n /** The input's maximum value. */\n @Prop({ reflect: true }) max?: number;\n\n /** The input's step attribute. */\n @Prop({ reflect: true }) step?: number;\n\n /** A pattern to validate input against. */\n @Prop({ reflect: true }) pattern?: string;\n\n /** Set to true to make the input a required field. */\n @Prop({ reflect: true }) required = false;\n\n /** The input's autocaptialize attribute. */\n @Prop() autocapitalize = 'off';\n\n /** The input's autocorrect attribute. */\n @Prop() autocorrect: 'on' | 'off' = 'off';\n\n /** The input's autocomplete attribute. */\n @Prop() autocomplete = 'off';\n\n /** The input's autofocus attribute. */\n @Prop() autofocus = false;\n\n /** Enables spell checking on the input. */\n @Prop() spellcheck = false;\n\n /**\n * This will be true when the control is in an invalid state. Validity is determined by props such as `type`,\n * `required`, `minlength`, `maxlength`, and `pattern` using the browser's constraint validation API.\n */\n @Prop({ mutable: true, reflect: true }) invalid = false;\n\n /** Set to true to add a clear button when the input is populated. */\n @Prop() clearable = false;\n\n /** Set to true to add a password toggle button for password inputs. */\n @Prop() togglePassword = false;\n\n /** The input's inputmode attribute. */\n @Prop() inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';\n\n /** Set to render as line */\n @Prop() line = false;\n\n /** Set to display the error text on blur and not when typing */\n @Prop() errorOnBlur = false;\n\n @Watch('helpText')\n @Watch('errorText')\n @Watch('label')\n handleLabelChange() {\n this.handleSlotChange();\n }\n\n @Watch('value')\n handleValueChange() {\n this.value = this.getValue();\n if (this.nativeInput != null) {\n if (this.nativeInput.value !== this.value) {\n this.nativeInput.value = this.value;\n }\n this.invalid = !this.nativeInput.checkValidity();\n }\n }\n\n /** Emitted when the control's value changes. Access the new value via event.target.value. */\n @Event({ eventName: 'six-input-change' }) sixChange!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the clear button is activated. */\n @Event({ eventName: 'six-input-clear' }) sixClear!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control receives input. Access the new value via event.target.value. */\n @Event({ eventName: 'six-input-input' }) sixInput!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control gains focus. */\n @Event({ eventName: 'six-input-focus' }) sixFocus!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control loses focus. Access the new value via event.target.value. */\n @Event({ eventName: 'six-input-blur' }) sixBlur!: EventEmitter<EmptyPayload>;\n\n /** defaultValue which the input will be reverted to when executing reset */\n private defaultValue = '';\n\n connectedCallback() {\n this.host.shadowRoot?.addEventListener('slotchange', this.handleSlotChange);\n }\n\n componentWillLoad() {\n this.defaultValue = this.getValue();\n this.handleSlotChange();\n }\n\n componentDidLoad() {\n const nativeInput = this.nativeInput;\n if (nativeInput == null) {\n return;\n }\n this.eventListeners.add(nativeInput, 'invalid', (event) => {\n this.invalid = true;\n if (this.customValidation || (!this.hasErrorTextSlot && this.errorText === '' && this.customErrorText === '')) {\n this.customErrorText = nativeInput.validationMessage;\n }\n event.preventDefault();\n });\n }\n\n disconnectedCallback() {\n this.host.shadowRoot?.removeEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.removeAll();\n }\n\n /** Sets focus on the input. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.nativeInput?.focus(options);\n }\n\n /** Removes focus from the input. */\n @Method()\n async removeFocus() {\n this.nativeInput?.blur();\n }\n\n /** Selects all the text in the input. */\n @Method()\n async select() {\n return this.nativeInput?.select();\n }\n\n /** Sets the start and end positions of the text selection (0-based). */\n @Method()\n async setSelectionRange(\n selectionStart: number,\n selectionEnd: number,\n selectionDirection: 'forward' | 'backward' | 'none' = 'none'\n ) {\n return this.nativeInput?.setSelectionRange(selectionStart, selectionEnd, selectionDirection);\n }\n\n /** Replaces a range of text with a new string. */\n @Method()\n async setRangeText(\n replacement: string,\n start: number,\n end: number,\n selectMode: 'select' | 'start' | 'end' | 'preserve' = 'preserve'\n ) {\n if (this.nativeInput == null) {\n return;\n }\n this.nativeInput.setRangeText(replacement, start, end, selectMode);\n if (this.getValue() !== this.nativeInput.value) {\n this.value = this.nativeInput.value;\n this.sixChange.emit();\n this.sixInput.emit();\n }\n }\n\n /** Checks for validity and shows the browser's validation message if the control is invalid. */\n @Method()\n async reportValidity() {\n return this.nativeInput?.reportValidity();\n }\n\n /** Checks for validity. */\n @Method()\n async checkValidity(): Promise<boolean> {\n if (this.nativeInput == null) {\n return true;\n }\n return this.nativeInput.validity.valid;\n }\n\n /** Sets a custom validation message. If `message` is not empty, the field will be considered invalid. */\n @Method()\n async setCustomValidity(message: string) {\n this.customErrorText = '';\n this.customValidation = message !== '';\n if (this.nativeInput != null) {\n this.nativeInput.setCustomValidity(message);\n this.invalid = !this.nativeInput.checkValidity();\n }\n }\n\n /** Returns the native input's validity */\n @Method()\n async getValidity(): Promise<ValidityState | undefined> {\n return this?.nativeInput?.validity;\n }\n\n /** Returns the native input's validity */\n @Method()\n async isValid(): Promise<boolean> {\n if (this.nativeInput == null) {\n return true;\n }\n return this.nativeInput.validity.valid;\n }\n\n /** Returns the native input's validationMessage */\n @Method()\n async getValidationMessage() {\n if (this.nativeInput == null) {\n return '';\n }\n return this.nativeInput.validationMessage;\n }\n\n /** Resets the formcontrol */\n @Method()\n async reset() {\n this.value = this.defaultValue;\n this.customErrorText = '';\n this.customValidation = false;\n this.nativeInput?.setCustomValidity('');\n this.invalid = false;\n }\n\n private handleChange = () => {\n if (this.nativeInput != null) {\n this.value = this.nativeInput.value;\n this.sixChange.emit();\n }\n };\n\n private handleInput = () => {\n if (this.nativeInput != null) {\n this.value = this.nativeInput.value;\n this.sixInput.emit();\n }\n };\n\n private handleBlur = () => {\n this.hasFocus = false;\n this.sixBlur.emit();\n };\n\n private handleFocus = () => {\n this.hasFocus = true;\n this.sixFocus.emit();\n };\n\n private handleClearClick = (event: MouseEvent) => {\n this.value = '';\n this.sixClear.emit();\n this.sixInput.emit();\n this.sixChange.emit();\n if (this.nativeInput != null) {\n this.nativeInput.focus();\n }\n event.stopPropagation();\n };\n\n private handlePasswordToggle = () => {\n this.isPasswordVisible = !this.isPasswordVisible;\n };\n\n private handleSlotChange = () => {\n this.hasHelpTextSlot = hasSlot(this.host, 'help-text');\n this.hasErrorTextSlot = hasSlot(this.host, 'error-text');\n this.hasLabelSlot = hasSlot(this.host, 'label');\n };\n\n private displayError() {\n return this.invalid && (!this.errorOnBlur || !this.hasFocus);\n }\n\n private getValue(): string {\n return (this.value ?? '').toString();\n }\n\n render() {\n return (\n <FormControl\n inputId={this.inputId}\n label={this.label}\n labelId={this.labelId}\n hasLabelSlot={this.hasLabelSlot}\n helpTextId={this.helpTextId}\n helpText={this.helpText}\n hasHelpTextSlot={this.hasHelpTextSlot}\n errorTextId={this.errorTextId}\n errorText={this.customErrorText != null ? this.customErrorText : this.errorText}\n hasErrorTextSlot={this.hasErrorTextSlot}\n size={this.size}\n disabled={this.disabled}\n required={this.required}\n displayError={this.displayError()}\n >\n <div\n part=\"base\"\n class={{\n input: true,\n\n // Sizes\n 'input--small': this.size === 'small',\n 'input--medium': this.size === 'medium',\n 'input--large': this.size === 'large',\n\n // States\n 'input--line': this.line,\n 'input--pill': this.pill,\n 'input--disabled': this.disabled,\n 'input--focused': this.hasFocus,\n 'input--empty': this.getValue().length === 0,\n 'input--invalid': this.invalid,\n }}\n >\n <span part=\"prefix\" class=\"input__prefix\">\n <slot name=\"prefix\" />\n </span>\n\n <input\n part=\"input\"\n ref={(el) => (this.nativeInput = el)}\n id={this.inputId}\n size={1} // needed for firefox to overrule the default of 20\n class={{\n input__control: true,\n input__control__prefix: hasSlot(this.host, 'prefix'),\n }}\n type={this.type === 'password' && this.isPasswordVisible ? 'text' : this.type}\n name={this.name}\n placeholder={this.placeholder}\n disabled={this.disabled}\n readonly={this.readonly}\n minLength={this.minlength}\n maxLength={this.maxlength}\n min={this.min}\n max={this.max}\n step={this.step}\n value={this.getValue()}\n autoCapitalize={this.autocapitalize}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n spellcheck={this.spellcheck}\n pattern={this.pattern}\n required={this.required}\n inputMode={this.inputmode}\n aria-labelledby={this.labelId}\n aria-describedby={this.helpTextId}\n aria-invalid={this.invalid ? 'true' : 'false'}\n onChange={this.handleChange}\n onInput={this.handleInput}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n data-testid=\"input-control\"\n />\n\n {this.clearable && (\n <button\n part=\"clear-button\"\n class=\"input__clear\"\n type=\"button\"\n onClick={this.handleClearClick}\n tabindex=\"-1\"\n data-testid=\"input-clear-button\"\n >\n <slot name=\"clear-icon\">\n <six-icon size={ICON_SIZES[this.size]}>clear</six-icon>\n </slot>\n </button>\n )}\n\n {this.togglePassword && (\n <button\n part=\"password-toggle-button\"\n class=\"input__password-toggle\"\n type=\"button\"\n onClick={this.handlePasswordToggle}\n tabindex=\"-1\"\n >\n {this.isPasswordVisible ? (\n <slot name=\"show-password-icon\">\n <six-icon size={ICON_SIZES[this.size]}>visibility_off</six-icon>\n </slot>\n ) : (\n <slot name=\"hide-password-icon\">\n <six-icon size={ICON_SIZES[this.size]}>visibility</six-icon>\n </slot>\n )}\n </button>\n )}\n\n <span part=\"suffix\" class=\"input__suffix\">\n <slot name=\"suffix\" />\n </span>\n </div>\n </FormControl>\n );\n }\n}\n"],"mappings":"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"}
@@ -1,2 +1,2 @@
1
- import{r as t,c as o,h as r,g as i}from"./p-ac4f4d45.js";import{F as e}from"./p-79eee01b.js";import{h as s}from"./p-b4dfb7cf.js";import{E as a}from"./p-9a860acc.js";const l=':host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}.form-control .form-control__label{display:none}.form-control .form-control__help-text{display:none}.form-control .form-control__error-text{display:none}.form-control--has-label .form-control__label{display:inline-block;color:var(--six-input-label-color);font-weight:var(--six-font-weight-bold);margin-bottom:var(--six-spacing-x-small)}.form-control--has-label .form-control__label__required::after{color:var(--six-color-danger-800);content:"*"}.form-control--has-label.form-control--small .form-control__label{font-size:var(--six-input-label-font-size-small)}.form-control--has-label.form-control--medium .form-control__label{font-size:var(--six-input-label-font-size-medium)}.form-control--has-label.form-control--large .form-control_label{font-size:var(--six-input-label-font-size-large)}.form-control--has-help-text .form-control__help-text{display:block;color:var(--six-input-help-text-color);margin-top:var(--six-spacing-x-small)}.form-control--has-help-text .form-control__help-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-help-text.form-control--small .form-control__help-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-help-text.form-control--medium .form-control__help-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-help-text.form-control--large .form-control__help-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--has-error-text .form-control__error-text{display:block;color:var(--six-color-danger-800);margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text .form-control__error-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text.form-control--small .form-control__error-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-error-text.form-control--medium .form-control__error-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-error-text.form-control--large .form-control__error-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--disabled .form-control__help-text{color:var(--six-input-help-text-color-disabled)}.form-control--disabled .form-control__label{color:var(--six-input-label-color-disabled)}.form-control--invalid:not(.form-control--disabled) .form-control__label{color:var(--six-input-label-color)}:host{--thumb-size:14px;--tooltip-offset-y:10px;--track-color:var(--six-color-web-rock-900);--thumb-color:var(--six-color-web-rock-900);--track-height:3px;display:block}.range{position:relative}.range .range__control{-webkit-appearance:none;width:100%;height:var(--six-input-height-medium);background:transparent;line-height:var(--six-input-height-medium);vertical-align:middle}.range .range__control::-webkit-slider-runnable-track{width:100%;height:var(--track-height);border-radius:3px;border:none}.range .range__control::-webkit-slider-thumb{border:none;width:var(--thumb-size);height:var(--thumb-size);border-radius:50%;background-color:var(--thumb-color);-webkit-appearance:none;margin-top:calc(var(--thumb-size) / -2 + var(--track-height) / 2);transition:var(--six-transition-fast) border-color, var(--six-transition-fast) background-color, var(--six-transition-fast) color, var(--six-transition-fast) box-shadow, var(--six-transition-fast) transform;cursor:pointer}.range .range__control:not(:disabled)::-webkit-slider-thumb:hover{background-color:var(--thumb-color)}.range .range__control:not(:disabled):focus::-webkit-slider-thumb{background-color:var(--thumb-color)}.range .range__control:not(:disabled)::-webkit-slider-thumb:active{background-color:var(--thumb-color);cursor:grabbing}.range .range__control::-moz-focus-outer{border:0}.range .range__control::-moz-range-track{width:100%;height:var(--track-height);background-color:var(--six-progress-track-color);border-radius:3px;border:none}.range .range__control::-moz-range-progress{height:var(--track-height);border-radius:3px;background-color:var(--track-color);border:none}.range .range__control::-moz-range-thumb{border:none;height:var(--thumb-size);width:var(--thumb-size);border-radius:50%;background-color:var(--thumb-color);transition:var(--six-transition-fast) border-color, var(--six-transition-fast) background-color, var(--six-transition-fast) color, var(--six-transition-fast) box-shadow, var(--six-transition-fast) transform;cursor:pointer}.range .range__control:not(:disabled)::-moz-range-thumb:hover{background-color:var(--thumb-color)}.range .range__control:not(:disabled):focus::-moz-range-thumb{background-color:var(--thumb-color)}.range .range__control:not(:disabled)::-moz-range-thumb:active{background-color:var(--thumb-color);cursor:grabbing}.range .range__control:focus{outline:none}.range .range__control:disabled::-webkit-slider-thumb{cursor:not-allowed;color:var(--six-color-web-rock-300);border-color:var(--six-color-web-rock-300);background-color:var(--six-color-web-rock-300)}.range .range__control:disabled::-moz-range-thumb{cursor:not-allowed;color:var(--six-color-web-rock-300);border-color:var(--six-color-web-rock-300);background-color:var(--six-color-web-rock-300)}.range__tooltip{position:absolute;z-index:var(--six-z-index-tooltip);left:1px;border-radius:var(--six-border-radius-medium);background-color:var(--six-color-web-rock-900);font-family:var(--six-font-family);font-size:var(--six-tooltip-font-size);font-weight:var(--six-tooltip-font-weight);line-height:var(--six-tooltip-line-height);color:var(--six-color-white);opacity:0;padding:var(--six-spacing-xxx-small) var(--six-spacing-xx-small);transition:var(--six-transition-fast) opacity;pointer-events:none}.range__tooltip::after{content:"";position:absolute;width:0;height:0;left:50%;margin-left:calc(-1 * var(--six-tooltip-arrow-size))}.range--tooltip-visible .range__tooltip{opacity:1}.range--tooltip-top .range__tooltip{top:calc(-1 * var(--thumb-size) - var(--tooltip-offset-y))}.range--tooltip-top .range__tooltip::after{border-top:var(--six-tooltip-arrow-size) solid var(--six-color-web-rock-900);border-left:var(--six-tooltip-arrow-size) solid transparent;border-right:var(--six-tooltip-arrow-size) solid transparent;top:100%}.range--tooltip-bottom .range__tooltip{bottom:calc(-1 * var(--thumb-size) - var(--tooltip-offset-y))}.range--tooltip-bottom .range__tooltip::after{border-bottom:var(--six-tooltip-arrow-size) solid var(--six-color-web-rock-900);border-left:var(--six-tooltip-arrow-size) solid transparent;border-right:var(--six-tooltip-arrow-size) solid transparent;bottom:100%}';let n=0;const h=class{constructor(r){t(this,r);this.sixChange=o(this,"six-range-change",7);this.sixBlur=o(this,"six-range-blur",7);this.sixFocus=o(this,"six-range-focus",7);this.inputId=`input-${++n}`;this.labelId=`input-label-${n}`;this.helpTextId=`input-help-text-${n}`;this.errorTextId=`input-error-text-${n}`;this.customErrorText="";this.customValidation=false;this.eventListeners=new a;this.defaultValue=0;this.hasFocus=false;this.hasHelpTextSlot=false;this.hasLabelSlot=false;this.hasErrorTextSlot=false;this.hasTooltip=false;this.name="";this.value=undefined;this.required=undefined;this.label="";this.helpText="";this.errorText="";this.disabled=false;this.invalid=false;this.min=0;this.max=100;this.step=1;this.tooltip="top";this.tooltipFormatter=t=>t.toString();this.errorOnBlur=false}handleLabelChange(){this.handleSlotChange()}handleValueChange(){if(this.input){this.input.value=this.value;this.calculateColorRunnableTrack()}this.invalid=this.input?!this.input.checkValidity():false}connectedCallback(){this.handleInput=this.handleInput.bind(this);this.handleBlur=this.handleBlur.bind(this);this.handleFocus=this.handleFocus.bind(this);this.handleSlotChange=this.handleSlotChange.bind(this);this.handleTouchStart=this.handleTouchStart.bind(this);this.host.shadowRoot.addEventListener("slotchange",this.handleSlotChange)}componentWillLoad(){if(this.value===undefined||this.value===null)this.value=this.min;if(this.value<this.min)this.value=this.min;if(this.value>this.max)this.value=this.max;this.defaultValue=this.value;this.handleSlotChange()}componentDidLoad(){this.syncTooltip();this.calculateColorRunnableTrack();this.resizeObserver=new ResizeObserver((()=>this.syncTooltip()));this.eventListeners.add(this.input,"invalid",(t=>{if(this.customValidation||!this.hasErrorTextSlot&&!this.errorText&&!this.customErrorText){this.customErrorText=this.input.validationMessage}t.preventDefault()}))}disconnectedCallback(){this.host.shadowRoot.removeEventListener("slotchange",this.handleSlotChange);this.eventListeners.removeAll()}async setFocus(t){this.input.focus(t)}async removeFocus(){this.input.blur()}async setCustomValidity(t){this.customErrorText="";this.customValidation=t!=="";this.input.setCustomValidity(t);this.invalid=!this.input.checkValidity()}async reset(){this.value=this.defaultValue;this.customErrorText="";this.customValidation=false;this.input.setCustomValidity("");this.invalid=false}handleInput(){this.value=Number(this.input.value);this.sixChange.emit();requestAnimationFrame((()=>this.syncTooltip()));requestAnimationFrame((()=>this.calculateColorRunnableTrack()))}handleBlur(){this.hasFocus=false;this.hasTooltip=false;this.sixBlur.emit();this.resizeObserver.unobserve(this.input)}handleFocus(){this.hasFocus=true;this.hasTooltip=true;this.sixFocus.emit();this.resizeObserver.observe(this.input)}handleSlotChange(){this.hasHelpTextSlot=s(this.host,"help-text");this.hasErrorTextSlot=s(this.host,"error-text");this.hasLabelSlot=s(this.host,"label")}handleTouchStart(){this.setFocus()}displayError(){return this.invalid&&(!this.errorOnBlur||!this.hasFocus)}syncTooltip(){if(this.tooltip!=="none"){const t=Math.max(0,(this.value-this.min)/(this.max-this.min));const o=this.input.offsetWidth;const r=this.output.offsetWidth;const i=getComputedStyle(this.input).getPropertyValue("--thumb-size");const e=`calc(${o*t}px - calc(calc(${t} * ${i}) - calc(${i} / 2)))`;this.output.style.transform=`translateX(${e})`;this.output.style.marginLeft=`-${r/2}px`}}calculateColorRunnableTrack(){if(!this.isFirefox()){const t=parseInt(this.input.value,10);const o=parseInt(this.input.min,10);const r=parseInt(this.input.max,10);const i=Math.ceil((t-o)/(r-o)*100);this.input.style.background="-webkit-linear-gradient(left, var(--track-color) 0%, var(--track-color) "+i+"%, var(--six-color-web-rock-300) "+i+"%)"}}isFirefox(){return navigator.userAgent.toLowerCase().indexOf("firefox")>-1}render(){return r(e,{inputId:this.inputId,label:this.label,labelId:this.labelId,hasLabelSlot:this.hasLabelSlot,helpTextId:this.helpTextId,helpText:this.helpText,hasHelpTextSlot:this.hasHelpTextSlot,size:"medium",errorTextId:this.errorTextId,errorText:this.customErrorText?this.customErrorText:this.errorText,hasErrorTextSlot:this.hasErrorTextSlot,disabled:this.disabled,required:this.required,displayError:this.displayError()},r("div",{part:"base",class:{range:true,"range--disabled":this.disabled,"range--focused":this.hasFocus,"range--tooltip-visible":this.hasTooltip,"range--tooltip-top":this.tooltip==="top","range--tooltip-bottom":this.tooltip==="bottom"},onTouchStart:this.handleTouchStart},r("input",{part:"input",ref:t=>this.input=t,type:"range",class:"range__control",name:this.name,disabled:this.disabled,min:this.min,max:this.max,step:this.step,value:this.value,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur}),this.tooltip!=="none"&&r("output",{part:"tooltip",ref:t=>this.output=t,class:"range__tooltip"},this.tooltipFormatter(this.value))))}get host(){return i(this)}static get watchers(){return{label:["handleLabelChange"],errorText:["handleLabelChange"],helpText:["handleLabelChange"],value:["handleValueChange"]}}};h.style=l;export{h as six_range};
2
- //# sourceMappingURL=p-7e0cc4ae.entry.js.map
1
+ import{r as t,c as o,h as r,g as i}from"./p-ac4f4d45.js";import{F as e}from"./p-79eee01b.js";import{h as s}from"./p-b4dfb7cf.js";import{E as a}from"./p-9a860acc.js";const l=':host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}.form-control .form-control__label{display:none}.form-control .form-control__help-text{display:none}.form-control .form-control__error-text{display:none}.form-control--has-label .form-control__label{display:inline-block;color:var(--six-input-label-color);font-weight:var(--six-font-weight-bold);margin-bottom:var(--six-spacing-x-small)}.form-control--has-label .form-control__label__required::after{color:var(--six-color-danger-800);content:"*"}.form-control--has-label.form-control--small .form-control__label{font-size:var(--six-input-label-font-size-small)}.form-control--has-label.form-control--medium .form-control__label{font-size:var(--six-input-label-font-size-medium)}.form-control--has-label.form-control--large .form-control_label{font-size:var(--six-input-label-font-size-large)}.form-control--has-help-text .form-control__help-text{display:block;color:var(--six-input-help-text-color);margin-top:var(--six-spacing-x-small)}.form-control--has-help-text .form-control__help-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-help-text.form-control--small .form-control__help-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-help-text.form-control--medium .form-control__help-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-help-text.form-control--large .form-control__help-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--has-error-text .form-control__error-text{display:block;color:var(--six-color-danger-800);margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text .form-control__error-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text.form-control--small .form-control__error-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-error-text.form-control--medium .form-control__error-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-error-text.form-control--large .form-control__error-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--disabled .form-control__help-text{color:var(--six-input-help-text-color-disabled)}.form-control--disabled .form-control__label{color:var(--six-input-label-color-disabled)}.form-control--invalid:not(.form-control--disabled) .form-control__label{color:var(--six-input-label-color)}:host{--thumb-size:14px;--tooltip-offset-y:10px;--track-color:var(--six-color-web-rock-900);--thumb-color:var(--six-color-web-rock-900);--track-height:3px;display:block}.range{position:relative}.range .range__control{-webkit-appearance:none;width:100%;height:var(--six-input-height-medium);background:transparent;line-height:var(--six-input-height-medium);vertical-align:middle}.range .range__control::-webkit-slider-runnable-track{width:100%;height:var(--track-height);border-radius:3px;border:none}.range .range__control::-webkit-slider-thumb{border:none;width:var(--thumb-size);height:var(--thumb-size);border-radius:50%;background-color:var(--thumb-color);-webkit-appearance:none;margin-top:calc(var(--thumb-size) / -2 + var(--track-height) / 2);transition:var(--six-transition-fast) border-color, var(--six-transition-fast) background-color, var(--six-transition-fast) color, var(--six-transition-fast) box-shadow, var(--six-transition-fast) transform;cursor:pointer}.range .range__control:not(:disabled)::-webkit-slider-thumb:hover{background-color:var(--thumb-color)}.range .range__control:not(:disabled):focus::-webkit-slider-thumb{background-color:var(--thumb-color)}.range .range__control:not(:disabled)::-webkit-slider-thumb:active{background-color:var(--thumb-color);cursor:grabbing}.range .range__control::-moz-focus-outer{border:0}.range .range__control::-moz-range-track{width:100%;height:var(--track-height);background-color:var(--six-progress-track-color);border-radius:3px;border:none}.range .range__control::-moz-range-progress{height:var(--track-height);border-radius:3px;background-color:var(--track-color);border:none}.range .range__control::-moz-range-thumb{border:none;height:var(--thumb-size);width:var(--thumb-size);border-radius:50%;background-color:var(--thumb-color);transition:var(--six-transition-fast) border-color, var(--six-transition-fast) background-color, var(--six-transition-fast) color, var(--six-transition-fast) box-shadow, var(--six-transition-fast) transform;cursor:pointer}.range .range__control:not(:disabled)::-moz-range-thumb:hover{background-color:var(--thumb-color)}.range .range__control:not(:disabled):focus::-moz-range-thumb{background-color:var(--thumb-color)}.range .range__control:not(:disabled)::-moz-range-thumb:active{background-color:var(--thumb-color);cursor:grabbing}.range .range__control:focus{outline:none}.range .range__control:disabled::-webkit-slider-thumb{cursor:not-allowed;color:var(--six-color-web-rock-300);border-color:var(--six-color-web-rock-300);background-color:var(--six-color-web-rock-300)}.range .range__control:disabled::-moz-range-thumb{cursor:not-allowed;color:var(--six-color-web-rock-300);border-color:var(--six-color-web-rock-300);background-color:var(--six-color-web-rock-300)}.range__tooltip{position:absolute;z-index:var(--six-z-index-tooltip);left:1px;border-radius:var(--six-border-radius-medium);background-color:var(--six-color-web-rock-900);font-family:var(--six-font-family);font-size:var(--six-tooltip-font-size);font-weight:var(--six-tooltip-font-weight);line-height:var(--six-tooltip-line-height);color:var(--six-color-white);opacity:0;padding:var(--six-spacing-xxx-small) var(--six-spacing-xx-small);transition:var(--six-transition-fast) opacity;pointer-events:none}.range__tooltip::after{content:"";position:absolute;width:0;height:0;left:50%;margin-left:calc(-1 * var(--six-tooltip-arrow-size))}.range--tooltip-visible .range__tooltip{opacity:1}.range--tooltip-top .range__tooltip{top:calc(-1 * var(--thumb-size) - var(--tooltip-offset-y))}.range--tooltip-top .range__tooltip::after{border-top:var(--six-tooltip-arrow-size) solid var(--six-color-web-rock-900);border-left:var(--six-tooltip-arrow-size) solid transparent;border-right:var(--six-tooltip-arrow-size) solid transparent;top:100%}.range--tooltip-bottom .range__tooltip{bottom:calc(-1 * var(--thumb-size) - var(--tooltip-offset-y))}.range--tooltip-bottom .range__tooltip::after{border-bottom:var(--six-tooltip-arrow-size) solid var(--six-color-web-rock-900);border-left:var(--six-tooltip-arrow-size) solid transparent;border-right:var(--six-tooltip-arrow-size) solid transparent;bottom:100%}';let n=0;const h=class{constructor(r){t(this,r);this.sixChange=o(this,"six-range-change",7);this.sixBlur=o(this,"six-range-blur",7);this.sixFocus=o(this,"six-range-focus",7);this.inputId=`input-${++n}`;this.labelId=`input-label-${n}`;this.helpTextId=`input-help-text-${n}`;this.customErrorText="";this.customValidation=false;this.errorTextId=`input-error-text-${n}`;this.eventListeners=new a;this.defaultValue=0;this.handleInput=()=>{if(this.nativeInput!=null){this.update(parseFloat(this.nativeInput.value))}requestAnimationFrame((()=>{this.sixChange.emit()}))};this.handleBlur=()=>{var t;this.hasFocus=false;this.hasTooltip=false;this.sixBlur.emit();if(this.nativeInput!=null){(t=this.resizeObserver)===null||t===void 0?void 0:t.unobserve(this.nativeInput)}};this.handleFocus=()=>{var t;this.hasFocus=true;this.hasTooltip=true;this.sixFocus.emit();if(this.nativeInput!=null){(t=this.resizeObserver)===null||t===void 0?void 0:t.observe(this.nativeInput)}};this.handleSlotChange=()=>{this.hasHelpTextSlot=s(this.host,"help-text");this.hasErrorTextSlot=s(this.host,"error-text");this.hasLabelSlot=s(this.host,"label")};this.handleTouchStart=()=>{this.setFocus()};this.hasFocus=false;this.hasHelpTextSlot=false;this.hasLabelSlot=false;this.hasErrorTextSlot=false;this.hasTooltip=false;this.name="";this.value=0;this.required=false;this.label="";this.helpText="";this.errorText="";this.disabled=false;this.invalid=false;this.min=0;this.max=100;this.step=1;this.tooltip="top";this.tooltipFormatter=t=>t.toString();this.errorOnBlur=false}handleLabelChange(){this.handleSlotChange()}handleValueChange(){this.update();if(this.nativeInput!=null){this.invalid=!this.nativeInput.checkValidity()}}connectedCallback(){var t;(t=this.host.shadowRoot)===null||t===void 0?void 0:t.addEventListener("slotchange",this.handleSlotChange)}componentWillLoad(){this.update();this.defaultValue=this.value;this.handleSlotChange()}componentDidLoad(){const t=this.nativeInput;if(t==null){return}this.update();this.resizeObserver=new ResizeObserver((()=>this.update()));this.eventListeners.add(t,"invalid",(o=>{if(this.customValidation||!this.hasErrorTextSlot&&this.errorText===""&&this.customErrorText===""){this.customErrorText=t.validationMessage}o.preventDefault()}))}disconnectedCallback(){var t;(t=this.host.shadowRoot)===null||t===void 0?void 0:t.removeEventListener("slotchange",this.handleSlotChange);this.eventListeners.removeAll()}async setFocus(t){var o;(o=this.nativeInput)===null||o===void 0?void 0:o.focus(t)}async removeFocus(){var t;(t=this.nativeInput)===null||t===void 0?void 0:t.blur()}async setCustomValidity(t){this.customErrorText="";this.customValidation=t!=="";if(this.nativeInput!=null){this.nativeInput.setCustomValidity(t);this.invalid=!this.nativeInput.checkValidity()}}async reset(){var t;this.value=this.defaultValue;this.customErrorText="";this.customValidation=false;(t=this.nativeInput)===null||t===void 0?void 0:t.setCustomValidity("");this.invalid=false}displayError(){return this.invalid&&(!this.errorOnBlur||!this.hasFocus)}syncTooltip(t,o,r){if(this.tooltip!=="none"&&this.nativeInput!=null&&this.output!=null){const i=Math.max(0,(r-t)/(o-t));const e=this.nativeInput.offsetWidth;const s=this.output.offsetWidth;const a=getComputedStyle(this.nativeInput).getPropertyValue("--thumb-size");const l=`calc(${e*i}px - calc(calc(${i} * ${a}) - calc(${a} / 2)))`;this.output.style.transform=`translateX(${l})`;this.output.style.marginLeft=`-${s/2}px`}}isFirefox(){return navigator.userAgent.toLowerCase().indexOf("firefox")>-1}update(t){var o,r;if(t!=null){this.value=t}const i=(o=Number(this.min))!==null&&o!==void 0?o:0;const e=(r=Number(this.max))!==null&&r!==void 0?r:0;let s;const a=parseFloat(this.value);if(isNaN(a)){s=this.getDefaultValue(i,e)}else{s=a}if(this.nativeInput!=null){this.nativeInput.value=s.toString();this.value=parseFloat(this.nativeInput.value)}else{this.value=s}this.calculateColorRunnableTrack(i,e,this.value);this.syncTooltip(i,e,this.value)}getDefaultValue(t,o){return o<t?t:t+(o-t)/2}calculateColorRunnableTrack(t,o,r){if(!this.isFirefox()&&this.nativeInput!=null){const i=Math.ceil((r-t)/(o-t)*100);this.nativeInput.style.background="-webkit-linear-gradient(left, var(--track-color) 0%, var(--track-color) "+i+"%, var(--six-color-web-rock-300) "+i+"%)"}}render(){return r(e,{inputId:this.inputId,label:this.label,labelId:this.labelId,hasLabelSlot:this.hasLabelSlot,helpTextId:this.helpTextId,helpText:this.helpText,hasHelpTextSlot:this.hasHelpTextSlot,size:"medium",errorTextId:this.errorTextId,errorText:this.customErrorText!=null?this.customErrorText:this.errorText,hasErrorTextSlot:this.hasErrorTextSlot,disabled:this.disabled,required:this.required,displayError:this.displayError()},r("div",{part:"base",class:{range:true,"range--disabled":this.disabled,"range--focused":this.hasFocus,"range--tooltip-visible":this.hasTooltip,"range--tooltip-top":this.tooltip==="top","range--tooltip-bottom":this.tooltip==="bottom"},onTouchStart:this.handleTouchStart},r("input",{part:"input",ref:t=>this.nativeInput=t,type:"range",class:"range__control",name:this.name,disabled:this.disabled,min:this.min,max:this.max,step:this.step,value:this.value,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur}),this.tooltip!=="none"&&r("output",{part:"tooltip",ref:t=>this.output=t,class:"range__tooltip"},this.tooltipFormatter(this.value))))}get host(){return i(this)}static get watchers(){return{label:["handleLabelChange"],errorText:["handleLabelChange"],helpText:["handleLabelChange"],value:["handleValueChange"],min:["handleValueChange"],max:["handleValueChange"]}}};h.style=l;export{h as six_range};
2
+ //# sourceMappingURL=p-3c635d0a.entry.js.map