@haiilo/catalyst 5.3.0 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. package/dist/catalyst/catalyst.css +1127 -39
  2. package/dist/catalyst/catalyst.esm.js +1 -1
  3. package/dist/catalyst/catalyst.esm.js.map +1 -1
  4. package/dist/catalyst/index.cdn.js +7 -0
  5. package/dist/catalyst/index.esm.js +2 -2
  6. package/dist/catalyst/index.esm.js.map +1 -1
  7. package/dist/catalyst/p-ad5fca6b.entry.js +10 -0
  8. package/dist/catalyst/p-ad5fca6b.entry.js.map +1 -0
  9. package/dist/catalyst/{p-d1fb9d96.js → p-ce6a1db2.js} +1 -1
  10. package/dist/catalyst/p-ce6a1db2.js.map +1 -0
  11. package/dist/catalyst/p-d7dc291a.js +2 -0
  12. package/dist/catalyst/p-d7dc291a.js.map +1 -0
  13. package/dist/catalyst/scss/_snippets/_checkbox-hint.scss +20 -0
  14. package/dist/catalyst/scss/index.scss +2 -0
  15. package/dist/catalyst/scss/utils/_border.scss +14 -0
  16. package/dist/catalyst/scss/utils/_media.mixins.scss +0 -1
  17. package/dist/catalyst/scss/utils/_typography.mixins.scss +1 -0
  18. package/dist/catalyst/scss/vendor/_flatpickr.scss +314 -0
  19. package/dist/cjs/cat-alert_25.cjs.entry.js +3391 -506
  20. package/dist/cjs/cat-alert_25.cjs.entry.js.map +1 -1
  21. package/dist/cjs/{cat-icon-registry-671af264.js → cat-icon-registry-6161e2ee.js} +56 -3
  22. package/dist/cjs/cat-icon-registry-6161e2ee.js.map +1 -0
  23. package/dist/cjs/catalyst.cjs.js +3 -3
  24. package/dist/cjs/catalyst.cjs.js.map +1 -1
  25. package/dist/cjs/{index-01312a2e.js → index-4258b31e.js} +8 -1
  26. package/dist/{catalyst/p-d1fb9d96.js.map → cjs/index-4258b31e.js.map} +1 -1
  27. package/dist/cjs/index.cjs.js +13 -15
  28. package/dist/cjs/index.cjs.js.map +1 -1
  29. package/dist/cjs/loader.cjs.js +3 -3
  30. package/dist/cjs/loader.cjs.js.map +1 -1
  31. package/dist/collection/collection-manifest.json +3 -3
  32. package/dist/collection/components/cat-alert/cat-alert.js +5 -5
  33. package/dist/collection/components/cat-alert/cat-alert.js.map +1 -1
  34. package/dist/collection/components/cat-avatar/cat-avatar.js +5 -5
  35. package/dist/collection/components/cat-avatar/cat-avatar.js.map +1 -1
  36. package/dist/collection/components/cat-button/cat-button.css +7 -7
  37. package/dist/collection/components/cat-button/cat-button.js +11 -31
  38. package/dist/collection/components/cat-button/cat-button.js.map +1 -1
  39. package/dist/collection/components/cat-checkbox/cat-checkbox.css +24 -1
  40. package/dist/collection/components/cat-checkbox/cat-checkbox.js +38 -37
  41. package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -1
  42. package/dist/collection/components/cat-datepicker/cat-datepicker.config.js +22 -0
  43. package/dist/collection/components/cat-datepicker/cat-datepicker.config.js.map +1 -0
  44. package/dist/collection/components/cat-datepicker/cat-datepicker.css +18 -0
  45. package/dist/collection/components/cat-datepicker/cat-datepicker.js +669 -0
  46. package/dist/collection/components/cat-datepicker/cat-datepicker.js.map +1 -0
  47. package/dist/collection/components/cat-datepicker/cat-datepicker.locale.js +51 -0
  48. package/dist/collection/components/cat-datepicker/cat-datepicker.locale.js.map +1 -0
  49. package/dist/collection/components/cat-dropdown/cat-dropdown.css +1 -0
  50. package/dist/collection/components/cat-dropdown/cat-dropdown.js +18 -14
  51. package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
  52. package/dist/collection/components/cat-form-group/cat-form-group.js +4 -5
  53. package/dist/collection/components/cat-form-group/cat-form-group.js.map +1 -1
  54. package/dist/collection/components/cat-form-hint/cat-form-hint.js +2 -6
  55. package/dist/collection/components/cat-form-hint/cat-form-hint.js.map +1 -1
  56. package/dist/collection/components/cat-i18n/cat-i18n-registry.js +13 -1
  57. package/dist/collection/components/cat-i18n/cat-i18n-registry.js.map +1 -1
  58. package/dist/collection/components/cat-icon/cat-icon-registry.js +29 -1
  59. package/dist/collection/components/cat-icon/cat-icon-registry.js.map +1 -1
  60. package/dist/collection/components/cat-input/cat-input.css +7 -11
  61. package/dist/collection/components/cat-input/cat-input.js +13 -35
  62. package/dist/collection/components/cat-input/cat-input.js.map +1 -1
  63. package/dist/collection/components/cat-input/input-type.js.map +1 -1
  64. package/dist/collection/components/cat-notification/cat-notification.js +12 -14
  65. package/dist/collection/components/cat-notification/cat-notification.js.map +1 -1
  66. package/dist/collection/components/cat-pagination/cat-pagination.js +28 -6
  67. package/dist/collection/components/cat-pagination/cat-pagination.js.map +1 -1
  68. package/dist/collection/components/cat-radio/cat-radio.css +24 -1
  69. package/dist/collection/components/cat-radio/cat-radio.js +10 -31
  70. package/dist/collection/components/cat-radio/cat-radio.js.map +1 -1
  71. package/dist/collection/components/cat-radio-group/cat-radio-group.js +40 -10
  72. package/dist/collection/components/cat-radio-group/cat-radio-group.js.map +1 -1
  73. package/dist/collection/components/cat-scrollable/cat-scrollable.css +1 -4
  74. package/dist/collection/components/cat-scrollable/cat-scrollable.js +2 -3
  75. package/dist/collection/components/cat-scrollable/cat-scrollable.js.map +1 -1
  76. package/dist/collection/components/cat-select/cat-select.css +8 -11
  77. package/dist/collection/components/cat-select/cat-select.js +76 -62
  78. package/dist/collection/components/cat-select/cat-select.js.map +1 -1
  79. package/dist/collection/components/cat-select-demo/cat-select-demo.js +21 -25
  80. package/dist/collection/components/cat-select-demo/cat-select-demo.js.map +1 -1
  81. package/dist/collection/components/cat-skeleton/cat-skeleton.css +1 -1
  82. package/dist/collection/components/cat-tabs/cat-tabs.js +4 -7
  83. package/dist/collection/components/cat-tabs/cat-tabs.js.map +1 -1
  84. package/dist/collection/components/cat-textarea/cat-textarea.css +9 -12
  85. package/dist/collection/components/cat-textarea/cat-textarea.js +16 -16
  86. package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
  87. package/dist/collection/components/cat-toggle/cat-toggle.css +24 -1
  88. package/dist/collection/components/cat-toggle/cat-toggle.js +37 -36
  89. package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -1
  90. package/dist/collection/components/cat-tooltip/cat-tooltip.css +1 -1
  91. package/dist/collection/components/cat-tooltip/cat-tooltip.js +17 -22
  92. package/dist/collection/components/cat-tooltip/cat-tooltip.js.map +1 -1
  93. package/dist/collection/index.cdn.js +7 -0
  94. package/dist/collection/scss/_snippets/_checkbox-hint.scss +20 -0
  95. package/dist/collection/scss/index.scss +2 -0
  96. package/dist/collection/scss/utils/_border.scss +14 -0
  97. package/dist/collection/scss/utils/_media.mixins.scss +0 -1
  98. package/dist/collection/scss/utils/_typography.mixins.scss +1 -0
  99. package/dist/collection/scss/vendor/_flatpickr.scss +314 -0
  100. package/dist/collection/utils/platform.js +1 -1
  101. package/dist/collection/utils/platform.js.map +1 -1
  102. package/dist/components/cat-alert.js +5 -5
  103. package/dist/components/cat-alert.js.map +1 -1
  104. package/dist/components/cat-avatar2.js +5 -5
  105. package/dist/components/cat-avatar2.js.map +1 -1
  106. package/dist/components/cat-button2.js +13 -17
  107. package/dist/components/cat-button2.js.map +1 -1
  108. package/dist/components/cat-checkbox2.js +15 -16
  109. package/dist/components/cat-checkbox2.js.map +1 -1
  110. package/dist/components/{cat-label.d.ts → cat-datepicker.d.ts} +4 -4
  111. package/dist/components/cat-datepicker.js +2907 -0
  112. package/dist/components/cat-datepicker.js.map +1 -0
  113. package/dist/components/cat-dropdown2.js +188 -66
  114. package/dist/components/cat-dropdown2.js.map +1 -1
  115. package/dist/components/cat-form-group.js +4 -5
  116. package/dist/components/cat-form-group.js.map +1 -1
  117. package/dist/components/cat-form-hint.js +2 -6
  118. package/dist/components/cat-form-hint.js.map +1 -1
  119. package/dist/components/cat-i18n-registry.js +13 -1
  120. package/dist/components/cat-i18n-registry.js.map +1 -1
  121. package/dist/components/cat-icon-registry.js +42 -1
  122. package/dist/components/cat-icon-registry.js.map +1 -1
  123. package/dist/components/cat-input.js +1 -226
  124. package/dist/components/cat-input.js.map +1 -1
  125. package/dist/components/cat-input2.js +223 -0
  126. package/dist/components/cat-input2.js.map +1 -0
  127. package/dist/components/cat-pagination.js +10 -5
  128. package/dist/components/cat-pagination.js.map +1 -1
  129. package/dist/components/cat-radio-group.js +15 -9
  130. package/dist/components/cat-radio-group.js.map +1 -1
  131. package/dist/components/cat-radio.js +6 -13
  132. package/dist/components/cat-radio.js.map +1 -1
  133. package/dist/components/cat-scrollable2.js +9 -8
  134. package/dist/components/cat-scrollable2.js.map +1 -1
  135. package/dist/components/cat-select-demo.js +23 -27
  136. package/dist/components/cat-select-demo.js.map +1 -1
  137. package/dist/components/cat-select2.js +70 -60
  138. package/dist/components/cat-select2.js.map +1 -1
  139. package/dist/components/cat-skeleton2.js +1 -1
  140. package/dist/components/cat-skeleton2.js.map +1 -1
  141. package/dist/components/cat-tabs.js +4 -7
  142. package/dist/components/cat-tabs.js.map +1 -1
  143. package/dist/components/cat-textarea.js +13 -13
  144. package/dist/components/cat-textarea.js.map +1 -1
  145. package/dist/components/cat-toggle.js +15 -16
  146. package/dist/components/cat-toggle.js.map +1 -1
  147. package/dist/components/cat-tooltip.js +18 -23
  148. package/dist/components/cat-tooltip.js.map +1 -1
  149. package/dist/components/floating-ui.dom.esm.js +119 -130
  150. package/dist/components/floating-ui.dom.esm.js.map +1 -1
  151. package/dist/components/index.js +12 -14
  152. package/dist/components/index.js.map +1 -1
  153. package/dist/esm/cat-alert_25.entry.js +3391 -506
  154. package/dist/esm/cat-alert_25.entry.js.map +1 -1
  155. package/dist/esm/{cat-icon-registry-d6b80490.js → cat-icon-registry-f15b29d9.js} +56 -3
  156. package/dist/esm/cat-icon-registry-f15b29d9.js.map +1 -0
  157. package/dist/esm/catalyst.js +4 -4
  158. package/dist/esm/catalyst.js.map +1 -1
  159. package/dist/esm/{index-fc2f91a4.js → index-636ce8d6.js} +8 -1
  160. package/dist/esm/index-636ce8d6.js.map +1 -0
  161. package/dist/esm/index.js +14 -16
  162. package/dist/esm/index.js.map +1 -1
  163. package/dist/esm/loader.js +4 -4
  164. package/dist/esm/loader.js.map +1 -1
  165. package/dist/types/@types/Intl.d.ts +3 -0
  166. package/dist/types/components/cat-button/cat-button.d.ts +0 -5
  167. package/dist/types/components/cat-checkbox/cat-checkbox.d.ts +11 -9
  168. package/dist/types/components/cat-datepicker/cat-datepicker.config.d.ts +1 -0
  169. package/dist/types/components/cat-datepicker/cat-datepicker.d.ts +143 -0
  170. package/dist/types/components/cat-datepicker/cat-datepicker.locale.d.ts +3 -0
  171. package/dist/types/components/cat-i18n/cat-i18n-registry.d.ts +3 -0
  172. package/dist/types/components/cat-input/cat-input.d.ts +2 -6
  173. package/dist/types/components/cat-input/input-type.d.ts +1 -1
  174. package/dist/types/components/cat-pagination/cat-pagination.d.ts +6 -0
  175. package/dist/types/components/cat-radio/cat-radio.d.ts +3 -7
  176. package/dist/types/components/cat-radio-group/cat-radio-group.d.ts +6 -1
  177. package/dist/types/components/cat-select/cat-select.d.ts +6 -1
  178. package/dist/types/components/cat-textarea/cat-textarea.d.ts +4 -4
  179. package/dist/types/components/cat-toggle/cat-toggle.d.ts +10 -8
  180. package/dist/types/components.d.ts +298 -117
  181. package/package.json +21 -19
  182. package/dist/catalyst/p-ba081831.entry.js +0 -10
  183. package/dist/catalyst/p-ba081831.entry.js.map +0 -1
  184. package/dist/catalyst/p-ccfebe33.js +0 -2
  185. package/dist/catalyst/p-ccfebe33.js.map +0 -1
  186. package/dist/cjs/cat-icon-registry-671af264.js.map +0 -1
  187. package/dist/cjs/index-01312a2e.js.map +0 -1
  188. package/dist/collection/components/cat-label/cat-label.css +0 -22
  189. package/dist/collection/components/cat-label/cat-label.js +0 -134
  190. package/dist/collection/components/cat-label/cat-label.js.map +0 -1
  191. package/dist/components/cat-label.js +0 -73
  192. package/dist/components/cat-label.js.map +0 -1
  193. package/dist/esm/cat-icon-registry-d6b80490.js.map +0 -1
  194. package/dist/esm/index-fc2f91a4.js.map +0 -1
  195. package/dist/types/components/cat-label/cat-label.d.ts +0 -27
@@ -0,0 +1,669 @@
1
+ import { h } from '@stencil/core';
2
+ import flatpickr from 'flatpickr';
3
+ import weekSelectPlugin from 'flatpickr/dist/plugins/weekSelect/weekSelect';
4
+ import { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';
5
+ import { getFormat } from './cat-datepicker.config';
6
+ import { getLocale } from './cat-datepicker.locale';
7
+ export class CatDatepickerFlat {
8
+ constructor() {
9
+ this.requiredMarker = 'optional';
10
+ this.horizontal = false;
11
+ this.autoComplete = undefined;
12
+ this.clearable = false;
13
+ this.disabled = false;
14
+ this.hint = undefined;
15
+ this.icon = undefined;
16
+ this.iconRight = false;
17
+ this.identifier = undefined;
18
+ this.label = '';
19
+ this.labelHidden = false;
20
+ this.max = undefined;
21
+ this.min = undefined;
22
+ this.mode = 'date';
23
+ this.name = undefined;
24
+ this.placeholder = undefined;
25
+ this.textPrefix = undefined;
26
+ this.textSuffix = undefined;
27
+ this.readonly = false;
28
+ this.required = false;
29
+ this.step = 5;
30
+ this.value = undefined;
31
+ this.errors = undefined;
32
+ this.errorUpdate = 0;
33
+ this.nativeAttributes = undefined;
34
+ }
35
+ get input() {
36
+ return this._input?.shadowRoot?.querySelector('input') ?? undefined;
37
+ }
38
+ componentDidLoad() {
39
+ const input = this.input;
40
+ if (input) {
41
+ const locale = getLocale(i18n.getLocale());
42
+ const format = getFormat(i18n.getLocale(), this.mode);
43
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
44
+ const plugins = this.mode === 'week' ? [new weekSelectPlugin({})] : [];
45
+ this.pickr = flatpickr(input, {
46
+ locale,
47
+ plugins,
48
+ altInput: true,
49
+ prevArrow: '←',
50
+ nextArrow: '→',
51
+ dateFormat: 'Z',
52
+ altFormat: format,
53
+ ariaDateFormat: format,
54
+ mode: this.mode === 'daterange' ? 'range' : 'single',
55
+ minDate: this.min,
56
+ maxDate: this.max,
57
+ enableTime: this.mode === 'time' || this.mode === 'datetime',
58
+ noCalendar: this.mode === 'time',
59
+ weekNumbers: true,
60
+ minuteIncrement: this.step,
61
+ onChange: (dates, dateStr, flatpickr) => {
62
+ if (this.mode === 'week') {
63
+ this.value = dates[0] ? flatpickr.config.getWeek(dates[0]).toString() : undefined;
64
+ }
65
+ else {
66
+ this.value = dateStr;
67
+ }
68
+ this.catChange.emit(this.value);
69
+ console.log(this.value);
70
+ }
71
+ });
72
+ }
73
+ }
74
+ /**
75
+ * Programmatically move focus to the datepicker. Use this method instead of
76
+ * `input.focus()`.
77
+ *
78
+ * @param options An optional object providing options to control aspects of
79
+ * the focusing process.
80
+ */
81
+ async doFocus(options) {
82
+ this._input?.doFocus(options);
83
+ }
84
+ /**
85
+ * Programmatically remove focus from the datepicker. Use this method instead of
86
+ * `input.blur()`.
87
+ */
88
+ async doBlur() {
89
+ this._input?.doBlur();
90
+ }
91
+ render() {
92
+ return (h("cat-input", { ref: el => (this._input = el), requiredMarker: this.requiredMarker, horizontal: this.horizontal, autoComplete: this.autoComplete, clearable: this.clearable, disabled: this.disabled, hint: this.hint, icon: this.icon, iconRight: this.iconRight, identifier: this.identifier, label: this.label, labelHidden: this.labelHidden, name: this.name, placeholder: this.placeholder, textPrefix: this.textPrefix, textSuffix: this.textSuffix, readonly: this.readonly, required: this.required, value: this.value, errors: this.errors, errorUpdate: this.errorUpdate, nativeAttributes: this.nativeAttributes, onCatChange: e => {
93
+ e.stopPropagation();
94
+ this.pickr?.setDate(e.detail);
95
+ if (this.value !== e.detail || undefined) {
96
+ this.value = e.detail || undefined;
97
+ this.catChange.emit(this.value);
98
+ console.log(this.value);
99
+ }
100
+ }, onCatFocus: e => {
101
+ e.stopPropagation();
102
+ this.catFocus.emit(e.detail);
103
+ }, onCatBlur: e => {
104
+ e.stopPropagation();
105
+ this.catBlur.emit(e.detail);
106
+ } }));
107
+ }
108
+ static get is() { return "cat-datepicker"; }
109
+ static get encapsulation() { return "shadow"; }
110
+ static get originalStyleUrls() {
111
+ return {
112
+ "$": ["cat-datepicker.scss"]
113
+ };
114
+ }
115
+ static get styleUrls() {
116
+ return {
117
+ "$": ["cat-datepicker.css"]
118
+ };
119
+ }
120
+ static get properties() {
121
+ return {
122
+ "requiredMarker": {
123
+ "type": "string",
124
+ "mutable": false,
125
+ "complexType": {
126
+ "original": "'none' | 'required' | 'optional' | 'none!' | 'optional!' | 'required!'",
127
+ "resolved": "\"none!\" | \"none\" | \"optional!\" | \"optional\" | \"required!\" | \"required\"",
128
+ "references": {}
129
+ },
130
+ "required": false,
131
+ "optional": false,
132
+ "docs": {
133
+ "tags": [],
134
+ "text": "Whether the label need a marker to shown if the input is required or optional."
135
+ },
136
+ "attribute": "required-marker",
137
+ "reflect": false,
138
+ "defaultValue": "'optional'"
139
+ },
140
+ "horizontal": {
141
+ "type": "boolean",
142
+ "mutable": false,
143
+ "complexType": {
144
+ "original": "boolean",
145
+ "resolved": "boolean",
146
+ "references": {}
147
+ },
148
+ "required": false,
149
+ "optional": false,
150
+ "docs": {
151
+ "tags": [],
152
+ "text": "Whether the label is on top or left."
153
+ },
154
+ "attribute": "horizontal",
155
+ "reflect": false,
156
+ "defaultValue": "false"
157
+ },
158
+ "autoComplete": {
159
+ "type": "string",
160
+ "mutable": false,
161
+ "complexType": {
162
+ "original": "string",
163
+ "resolved": "string | undefined",
164
+ "references": {}
165
+ },
166
+ "required": false,
167
+ "optional": true,
168
+ "docs": {
169
+ "tags": [],
170
+ "text": "Hint for form autofill feature."
171
+ },
172
+ "attribute": "auto-complete",
173
+ "reflect": false
174
+ },
175
+ "clearable": {
176
+ "type": "boolean",
177
+ "mutable": false,
178
+ "complexType": {
179
+ "original": "boolean",
180
+ "resolved": "boolean",
181
+ "references": {}
182
+ },
183
+ "required": false,
184
+ "optional": false,
185
+ "docs": {
186
+ "tags": [],
187
+ "text": "Whether the input should show a clear button."
188
+ },
189
+ "attribute": "clearable",
190
+ "reflect": false,
191
+ "defaultValue": "false"
192
+ },
193
+ "disabled": {
194
+ "type": "boolean",
195
+ "mutable": false,
196
+ "complexType": {
197
+ "original": "boolean",
198
+ "resolved": "boolean",
199
+ "references": {}
200
+ },
201
+ "required": false,
202
+ "optional": false,
203
+ "docs": {
204
+ "tags": [],
205
+ "text": "Whether the input is disabled."
206
+ },
207
+ "attribute": "disabled",
208
+ "reflect": false,
209
+ "defaultValue": "false"
210
+ },
211
+ "hint": {
212
+ "type": "string",
213
+ "mutable": false,
214
+ "complexType": {
215
+ "original": "string | string[]",
216
+ "resolved": "string | string[] | undefined",
217
+ "references": {}
218
+ },
219
+ "required": false,
220
+ "optional": true,
221
+ "docs": {
222
+ "tags": [],
223
+ "text": "Optional hint text(s) to be displayed with the input."
224
+ },
225
+ "attribute": "hint",
226
+ "reflect": false
227
+ },
228
+ "icon": {
229
+ "type": "string",
230
+ "mutable": false,
231
+ "complexType": {
232
+ "original": "string",
233
+ "resolved": "string | undefined",
234
+ "references": {}
235
+ },
236
+ "required": false,
237
+ "optional": true,
238
+ "docs": {
239
+ "tags": [],
240
+ "text": "The name of an icon to be displayed in the input."
241
+ },
242
+ "attribute": "icon",
243
+ "reflect": false
244
+ },
245
+ "iconRight": {
246
+ "type": "boolean",
247
+ "mutable": false,
248
+ "complexType": {
249
+ "original": "boolean",
250
+ "resolved": "boolean",
251
+ "references": {}
252
+ },
253
+ "required": false,
254
+ "optional": false,
255
+ "docs": {
256
+ "tags": [],
257
+ "text": "Display the icon on the right."
258
+ },
259
+ "attribute": "icon-right",
260
+ "reflect": false,
261
+ "defaultValue": "false"
262
+ },
263
+ "identifier": {
264
+ "type": "string",
265
+ "mutable": false,
266
+ "complexType": {
267
+ "original": "string",
268
+ "resolved": "string | undefined",
269
+ "references": {}
270
+ },
271
+ "required": false,
272
+ "optional": true,
273
+ "docs": {
274
+ "tags": [],
275
+ "text": "A unique identifier for the input."
276
+ },
277
+ "attribute": "identifier",
278
+ "reflect": false
279
+ },
280
+ "label": {
281
+ "type": "string",
282
+ "mutable": false,
283
+ "complexType": {
284
+ "original": "string",
285
+ "resolved": "string",
286
+ "references": {}
287
+ },
288
+ "required": false,
289
+ "optional": false,
290
+ "docs": {
291
+ "tags": [],
292
+ "text": "The label for the input."
293
+ },
294
+ "attribute": "label",
295
+ "reflect": false,
296
+ "defaultValue": "''"
297
+ },
298
+ "labelHidden": {
299
+ "type": "boolean",
300
+ "mutable": false,
301
+ "complexType": {
302
+ "original": "boolean",
303
+ "resolved": "boolean",
304
+ "references": {}
305
+ },
306
+ "required": false,
307
+ "optional": false,
308
+ "docs": {
309
+ "tags": [],
310
+ "text": "Visually hide the label, but still show it to assistive technologies like screen readers."
311
+ },
312
+ "attribute": "label-hidden",
313
+ "reflect": false,
314
+ "defaultValue": "false"
315
+ },
316
+ "max": {
317
+ "type": "string",
318
+ "mutable": false,
319
+ "complexType": {
320
+ "original": "string",
321
+ "resolved": "string | undefined",
322
+ "references": {}
323
+ },
324
+ "required": false,
325
+ "optional": true,
326
+ "docs": {
327
+ "tags": [],
328
+ "text": "A maximum value as ISO Date string, e.g. 2017-03-04T01:23:43.000Z."
329
+ },
330
+ "attribute": "max",
331
+ "reflect": false
332
+ },
333
+ "min": {
334
+ "type": "string",
335
+ "mutable": false,
336
+ "complexType": {
337
+ "original": "string",
338
+ "resolved": "string | undefined",
339
+ "references": {}
340
+ },
341
+ "required": false,
342
+ "optional": true,
343
+ "docs": {
344
+ "tags": [],
345
+ "text": "A minimum value as ISO Date string, e.g. 2017-03-04T01:23:43.000Z."
346
+ },
347
+ "attribute": "min",
348
+ "reflect": false
349
+ },
350
+ "mode": {
351
+ "type": "string",
352
+ "mutable": false,
353
+ "complexType": {
354
+ "original": "'date' | 'time' | 'datetime' | 'daterange' | 'week'",
355
+ "resolved": "\"date\" | \"daterange\" | \"datetime\" | \"time\" | \"week\"",
356
+ "references": {}
357
+ },
358
+ "required": false,
359
+ "optional": false,
360
+ "docs": {
361
+ "tags": [],
362
+ "text": "The mode of the datepicker, to select a date, time, both, a date range or a week number."
363
+ },
364
+ "attribute": "mode",
365
+ "reflect": false,
366
+ "defaultValue": "'date'"
367
+ },
368
+ "name": {
369
+ "type": "string",
370
+ "mutable": false,
371
+ "complexType": {
372
+ "original": "string",
373
+ "resolved": "string | undefined",
374
+ "references": {}
375
+ },
376
+ "required": false,
377
+ "optional": true,
378
+ "docs": {
379
+ "tags": [],
380
+ "text": "The name of the form control. Submitted with the form as part of a name/value pair."
381
+ },
382
+ "attribute": "name",
383
+ "reflect": false
384
+ },
385
+ "placeholder": {
386
+ "type": "string",
387
+ "mutable": false,
388
+ "complexType": {
389
+ "original": "string",
390
+ "resolved": "string | undefined",
391
+ "references": {}
392
+ },
393
+ "required": false,
394
+ "optional": true,
395
+ "docs": {
396
+ "tags": [],
397
+ "text": "The placeholder text to display within the input."
398
+ },
399
+ "attribute": "placeholder",
400
+ "reflect": false
401
+ },
402
+ "textPrefix": {
403
+ "type": "string",
404
+ "mutable": false,
405
+ "complexType": {
406
+ "original": "string",
407
+ "resolved": "string | undefined",
408
+ "references": {}
409
+ },
410
+ "required": false,
411
+ "optional": true,
412
+ "docs": {
413
+ "tags": [],
414
+ "text": "A textual prefix to be displayed in the input."
415
+ },
416
+ "attribute": "text-prefix",
417
+ "reflect": false
418
+ },
419
+ "textSuffix": {
420
+ "type": "string",
421
+ "mutable": false,
422
+ "complexType": {
423
+ "original": "string",
424
+ "resolved": "string | undefined",
425
+ "references": {}
426
+ },
427
+ "required": false,
428
+ "optional": true,
429
+ "docs": {
430
+ "tags": [],
431
+ "text": "A textual suffix to be displayed in the input."
432
+ },
433
+ "attribute": "text-suffix",
434
+ "reflect": false
435
+ },
436
+ "readonly": {
437
+ "type": "boolean",
438
+ "mutable": false,
439
+ "complexType": {
440
+ "original": "boolean",
441
+ "resolved": "boolean",
442
+ "references": {}
443
+ },
444
+ "required": false,
445
+ "optional": false,
446
+ "docs": {
447
+ "tags": [],
448
+ "text": "The value is not editable."
449
+ },
450
+ "attribute": "readonly",
451
+ "reflect": false,
452
+ "defaultValue": "false"
453
+ },
454
+ "required": {
455
+ "type": "boolean",
456
+ "mutable": false,
457
+ "complexType": {
458
+ "original": "boolean",
459
+ "resolved": "boolean",
460
+ "references": {}
461
+ },
462
+ "required": false,
463
+ "optional": false,
464
+ "docs": {
465
+ "tags": [],
466
+ "text": "A value is required or must be check for the form to be submittable."
467
+ },
468
+ "attribute": "required",
469
+ "reflect": false,
470
+ "defaultValue": "false"
471
+ },
472
+ "step": {
473
+ "type": "number",
474
+ "mutable": false,
475
+ "complexType": {
476
+ "original": "number",
477
+ "resolved": "number",
478
+ "references": {}
479
+ },
480
+ "required": false,
481
+ "optional": false,
482
+ "docs": {
483
+ "tags": [],
484
+ "text": "The step size to use when changing the time."
485
+ },
486
+ "attribute": "step",
487
+ "reflect": false,
488
+ "defaultValue": "5"
489
+ },
490
+ "value": {
491
+ "type": "string",
492
+ "mutable": true,
493
+ "complexType": {
494
+ "original": "string",
495
+ "resolved": "string | undefined",
496
+ "references": {}
497
+ },
498
+ "required": false,
499
+ "optional": true,
500
+ "docs": {
501
+ "tags": [],
502
+ "text": "The value as ISO Date string, e.g. 2017-03-04T01:23:43.000Z or as a week number string."
503
+ },
504
+ "attribute": "value",
505
+ "reflect": false
506
+ },
507
+ "errors": {
508
+ "type": "boolean",
509
+ "mutable": false,
510
+ "complexType": {
511
+ "original": "boolean | string[] | ErrorMap",
512
+ "resolved": "boolean | string[] | undefined | { [key: string]: any; }",
513
+ "references": {
514
+ "ErrorMap": {
515
+ "location": "import",
516
+ "path": "../cat-form-hint/cat-form-hint"
517
+ }
518
+ }
519
+ },
520
+ "required": false,
521
+ "optional": true,
522
+ "docs": {
523
+ "tags": [],
524
+ "text": "The validation errors for this input. Will render a hint under the input\nwith the translated error message(s) `error.${key}`. If an object is\npassed, the keys will be used as error keys and the values translation\nparameters.\nIf the value is `true`, the input will be marked as invalid without any\nhints under the input."
525
+ },
526
+ "attribute": "errors",
527
+ "reflect": false
528
+ },
529
+ "errorUpdate": {
530
+ "type": "any",
531
+ "mutable": false,
532
+ "complexType": {
533
+ "original": "boolean | number",
534
+ "resolved": "boolean | number",
535
+ "references": {}
536
+ },
537
+ "required": false,
538
+ "optional": false,
539
+ "docs": {
540
+ "tags": [],
541
+ "text": "Fine-grained control over when the errors are shown. Can be `false` to\nnever show errors, `true` to show errors on blur, or a number to show\nerrors on change with the given delay in milliseconds."
542
+ },
543
+ "attribute": "error-update",
544
+ "reflect": false,
545
+ "defaultValue": "0"
546
+ },
547
+ "nativeAttributes": {
548
+ "type": "unknown",
549
+ "mutable": false,
550
+ "complexType": {
551
+ "original": "{ [key: string]: string }",
552
+ "resolved": "undefined | { [key: string]: string; }",
553
+ "references": {}
554
+ },
555
+ "required": false,
556
+ "optional": true,
557
+ "docs": {
558
+ "tags": [],
559
+ "text": "Attributes that will be added to the native HTML input element."
560
+ }
561
+ }
562
+ };
563
+ }
564
+ static get events() {
565
+ return [{
566
+ "method": "catChange",
567
+ "name": "catChange",
568
+ "bubbles": true,
569
+ "cancelable": true,
570
+ "composed": true,
571
+ "docs": {
572
+ "tags": [],
573
+ "text": "Emitted when the value is changed."
574
+ },
575
+ "complexType": {
576
+ "original": "string",
577
+ "resolved": "string",
578
+ "references": {}
579
+ }
580
+ }, {
581
+ "method": "catFocus",
582
+ "name": "catFocus",
583
+ "bubbles": true,
584
+ "cancelable": true,
585
+ "composed": true,
586
+ "docs": {
587
+ "tags": [],
588
+ "text": "Emitted when the input received focus."
589
+ },
590
+ "complexType": {
591
+ "original": "FocusEvent",
592
+ "resolved": "FocusEvent",
593
+ "references": {
594
+ "FocusEvent": {
595
+ "location": "global"
596
+ }
597
+ }
598
+ }
599
+ }, {
600
+ "method": "catBlur",
601
+ "name": "catBlur",
602
+ "bubbles": true,
603
+ "cancelable": true,
604
+ "composed": true,
605
+ "docs": {
606
+ "tags": [],
607
+ "text": "Emitted when the input loses focus."
608
+ },
609
+ "complexType": {
610
+ "original": "FocusEvent",
611
+ "resolved": "FocusEvent",
612
+ "references": {
613
+ "FocusEvent": {
614
+ "location": "global"
615
+ }
616
+ }
617
+ }
618
+ }];
619
+ }
620
+ static get methods() {
621
+ return {
622
+ "doFocus": {
623
+ "complexType": {
624
+ "signature": "(options?: FocusOptions) => Promise<void>",
625
+ "parameters": [{
626
+ "tags": [{
627
+ "name": "param",
628
+ "text": "options An optional object providing options to control aspects of\nthe focusing process."
629
+ }],
630
+ "text": "An optional object providing options to control aspects of\nthe focusing process."
631
+ }],
632
+ "references": {
633
+ "Promise": {
634
+ "location": "global"
635
+ },
636
+ "FocusOptions": {
637
+ "location": "global"
638
+ }
639
+ },
640
+ "return": "Promise<void>"
641
+ },
642
+ "docs": {
643
+ "text": "Programmatically move focus to the datepicker. Use this method instead of\n`input.focus()`.",
644
+ "tags": [{
645
+ "name": "param",
646
+ "text": "options An optional object providing options to control aspects of\nthe focusing process."
647
+ }]
648
+ }
649
+ },
650
+ "doBlur": {
651
+ "complexType": {
652
+ "signature": "() => Promise<void>",
653
+ "parameters": [],
654
+ "references": {
655
+ "Promise": {
656
+ "location": "global"
657
+ }
658
+ },
659
+ "return": "Promise<void>"
660
+ },
661
+ "docs": {
662
+ "text": "Programmatically remove focus from the datepicker. Use this method instead of\n`input.blur()`.",
663
+ "tags": []
664
+ }
665
+ }
666
+ };
667
+ }
668
+ }
669
+ //# sourceMappingURL=cat-datepicker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cat-datepicker.js","sourceRoot":"","sources":["../../../src/components/cat-datepicker/cat-datepicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAgB,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,SAAS,MAAM,WAAW,CAAC;AAClC,OAAO,gBAAgB,MAAM,8CAA8C,CAAC;AAE5E,OAAO,EAAE,eAAe,IAAI,IAAI,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB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AAC,CAAC,MAAM,CAAC,CAAC;MAC9B,CAAC,GACU,CACd,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, Method, EventEmitter, Prop, h } from '@stencil/core';\nimport flatpickr from 'flatpickr';\nimport weekSelectPlugin from 'flatpickr/dist/plugins/weekSelect/weekSelect';\nimport { ErrorMap } from '../cat-form-hint/cat-form-hint';\nimport { catI18nRegistry as i18n } from '../cat-i18n/cat-i18n-registry';\nimport { getFormat } from './cat-datepicker.config';\nimport { getLocale } from './cat-datepicker.locale';\n\n@Component({\n tag: 'cat-datepicker',\n styleUrl: 'cat-datepicker.scss',\n shadow: true\n})\nexport class CatDatepickerFlat {\n private pickr?: flatpickr.Instance;\n private _input?: HTMLCatInputElement;\n private get input(): HTMLInputElement | undefined {\n return this._input?.shadowRoot?.querySelector('input') ?? undefined;\n }\n\n /**\n * Whether the label need a marker to shown if the input is required or optional.\n */\n @Prop() requiredMarker: 'none' | 'required' | 'optional' | 'none!' | 'optional!' | 'required!' = 'optional';\n\n /**\n * Whether the label is on top or left.\n */\n @Prop() horizontal = false;\n\n /**\n * Hint for form autofill feature.\n */\n @Prop() autoComplete?: string;\n\n /**\n * Whether the input should show a clear button.\n */\n @Prop() clearable = false;\n\n /**\n * Whether the input is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Optional hint text(s) to be displayed with the input.\n */\n @Prop() hint?: string | string[];\n\n /**\n * The name of an icon to be displayed in the input.\n */\n @Prop() icon?: string;\n\n /**\n * Display the icon on the right.\n */\n @Prop() iconRight = false;\n\n /**\n * A unique identifier for the input.\n */\n @Prop() identifier?: string;\n\n /**\n * The label for the input.\n */\n @Prop() label = '';\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @Prop() labelHidden = false;\n\n /**\n * A maximum value as ISO Date string, e.g. 2017-03-04T01:23:43.000Z.\n */\n @Prop() max?: string;\n\n /**\n * A minimum value as ISO Date string, e.g. 2017-03-04T01:23:43.000Z.\n */\n @Prop() min?: string;\n\n /**\n * The mode of the datepicker, to select a date, time, both, a date range or a week number.\n */\n @Prop() mode: 'date' | 'time' | 'datetime' | 'daterange' | 'week' = 'date';\n\n /**\n * The name of the form control. Submitted with the form as part of a name/value pair.\n */\n @Prop() name?: string;\n\n /**\n * The placeholder text to display within the input.\n */\n @Prop() placeholder?: string;\n\n /**\n * A textual prefix to be displayed in the input.\n */\n @Prop() textPrefix?: string;\n\n /**\n * A textual suffix to be displayed in the input.\n */\n @Prop() textSuffix?: string;\n\n /**\n * The value is not editable.\n */\n @Prop() readonly = false;\n\n /**\n * A value is required or must be check for the form to be submittable.\n */\n @Prop() required = false;\n\n /**\n * The step size to use when changing the time.\n */\n @Prop() step = 5;\n\n /**\n * The value as ISO Date string, e.g. 2017-03-04T01:23:43.000Z or as a week number string.\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * The validation errors for this input. Will render a hint under the input\n * with the translated error message(s) `error.${key}`. If an object is\n * passed, the keys will be used as error keys and the values translation\n * parameters.\n * If the value is `true`, the input will be marked as invalid without any\n * hints under the input.\n */\n @Prop() errors?: boolean | string[] | ErrorMap;\n\n /**\n * Fine-grained control over when the errors are shown. Can be `false` to\n * never show errors, `true` to show errors on blur, or a number to show\n * errors on change with the given delay in milliseconds.\n */\n @Prop() errorUpdate: boolean | number = 0;\n\n /**\n * Attributes that will be added to the native HTML input element.\n */\n @Prop() nativeAttributes?: { [key: string]: string };\n\n /**\n * Emitted when the value is changed.\n */\n @Event() catChange!: EventEmitter<string>;\n\n /**\n * Emitted when the input received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentDidLoad() {\n const input = this.input;\n if (input) {\n const locale = getLocale(i18n.getLocale());\n const format = getFormat(i18n.getLocale(), this.mode);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const plugins = this.mode === 'week' ? [new (weekSelectPlugin as any)({})] : [];\n this.pickr = flatpickr(input, {\n locale,\n plugins,\n altInput: true,\n prevArrow: '←',\n nextArrow: '→',\n dateFormat: 'Z',\n altFormat: format,\n ariaDateFormat: format,\n mode: this.mode === 'daterange' ? 'range' : 'single',\n minDate: this.min,\n maxDate: this.max,\n enableTime: this.mode === 'time' || this.mode === 'datetime',\n noCalendar: this.mode === 'time',\n weekNumbers: true,\n minuteIncrement: this.step,\n onChange: (dates, dateStr, flatpickr) => {\n if (this.mode === 'week') {\n this.value = dates[0] ? flatpickr.config.getWeek(dates[0]).toString() : undefined;\n } else {\n this.value = dateStr;\n }\n this.catChange.emit(this.value);\n console.log(this.value);\n }\n });\n }\n }\n\n /**\n * Programmatically move focus to the datepicker. Use this method instead of\n * `input.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async doFocus(options?: FocusOptions): Promise<void> {\n this._input?.doFocus(options);\n }\n\n /**\n * Programmatically remove focus from the datepicker. Use this method instead of\n * `input.blur()`.\n */\n @Method()\n async doBlur(): Promise<void> {\n this._input?.doBlur();\n }\n\n render() {\n return (\n <cat-input\n ref={el => (this._input = el)}\n requiredMarker={this.requiredMarker}\n horizontal={this.horizontal}\n autoComplete={this.autoComplete}\n clearable={this.clearable}\n disabled={this.disabled}\n hint={this.hint}\n icon={this.icon}\n iconRight={this.iconRight}\n identifier={this.identifier}\n label={this.label}\n labelHidden={this.labelHidden}\n name={this.name}\n placeholder={this.placeholder}\n textPrefix={this.textPrefix}\n textSuffix={this.textSuffix}\n readonly={this.readonly}\n required={this.required}\n value={this.value}\n errors={this.errors}\n errorUpdate={this.errorUpdate}\n nativeAttributes={this.nativeAttributes}\n onCatChange={e => {\n e.stopPropagation();\n this.pickr?.setDate(e.detail);\n if (this.value !== e.detail || undefined) {\n this.value = e.detail || undefined;\n this.catChange.emit(this.value);\n console.log(this.value);\n }\n }}\n onCatFocus={e => {\n e.stopPropagation();\n this.catFocus.emit(e.detail);\n }}\n onCatBlur={e => {\n e.stopPropagation();\n this.catBlur.emit(e.detail);\n }}\n ></cat-input>\n );\n }\n}\n"]}