@daikin-oss/design-system-web-components 1.2.0 → 1.3.0-next.2

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 (249) hide show
  1. package/CHANGELOG.md +85 -49
  2. package/dist/cjs/base/dds-element.cjs +1 -1
  3. package/dist/cjs/components/accordion-item/daikin-accordion-item.cjs +1 -0
  4. package/dist/cjs/components/avatar/daikin-avatar.cjs +1 -0
  5. package/dist/cjs/components/calendar/daikin-calendar.cjs +2 -0
  6. package/dist/cjs/components/card-header/daikin-card-header.cjs +1 -1
  7. package/dist/cjs/components/carousel/daikin-carousel.cjs +7 -3
  8. package/dist/cjs/components/carousel-item/daikin-carousel-item.cjs +2 -2
  9. package/dist/cjs/components/chip/daikin-chip.cjs +106 -0
  10. package/dist/cjs/components/chip/daikin-chip.d.cts +36 -0
  11. package/dist/cjs/components/chip/index.cjs +7 -0
  12. package/dist/cjs/components/chip/index.d.cts +1 -0
  13. package/dist/cjs/components/combobox/daikin-combobox.cjs +604 -0
  14. package/dist/cjs/components/combobox/daikin-combobox.d.cts +134 -0
  15. package/dist/cjs/components/combobox/index.cjs +8 -0
  16. package/dist/cjs/components/combobox/index.d.cts +1 -0
  17. package/dist/cjs/components/date-picker/daikin-date-picker.cjs +31 -16
  18. package/dist/cjs/components/date-picker/daikin-date-picker.d.cts +2 -1
  19. package/dist/cjs/components/dropdown/daikin-dropdown.cjs +52 -37
  20. package/dist/cjs/components/dropdown/daikin-dropdown.d.cts +4 -3
  21. package/dist/cjs/components/icon/daikin-icon.cjs +117 -12
  22. package/dist/cjs/components/icon/daikin-icon.d.cts +129 -9
  23. package/dist/cjs/components/icon/icons.json.cjs +6 -2
  24. package/dist/cjs/components/icon/icons.json.d.cts +0 -12
  25. package/dist/cjs/components/icon-button/daikin-icon-button.cjs +12 -2
  26. package/dist/cjs/components/icon-button/daikin-icon-button.d.cts +8 -0
  27. package/dist/cjs/components/index.cjs +36 -0
  28. package/dist/cjs/components/index.d.cts +5 -0
  29. package/dist/cjs/components/input-group/daikin-input-group.cjs +1 -1
  30. package/dist/cjs/components/input-group/daikin-input-group.d.cts +40 -13
  31. package/dist/cjs/components/list-item/daikin-list-item.cjs +2 -2
  32. package/dist/cjs/components/modal-header/daikin-modal-header.cjs +1 -1
  33. package/dist/cjs/components/progress-bar/daikin-progress-bar.cjs +3 -3
  34. package/dist/cjs/components/select/daikin-select.cjs +6 -1
  35. package/dist/cjs/components/tab/daikin-tab.cjs +1 -0
  36. package/dist/cjs/components/table/daikin-table.cjs +33 -12
  37. package/dist/cjs/components/table/daikin-table.d.cts +67 -34
  38. package/dist/cjs/components/table-header-cell/daikin-table-header-cell.cjs +31 -6
  39. package/dist/cjs/components/table-header-cell/daikin-table-header-cell.d.cts +7 -0
  40. package/dist/cjs/components/text-field/daikin-text-field.cjs +191 -56
  41. package/dist/cjs/components/text-field/daikin-text-field.d.cts +32 -3
  42. package/dist/cjs/components/text-field/number-utils.cjs +61 -0
  43. package/dist/cjs/components/text-field/number-utils.d.cts +26 -0
  44. package/dist/cjs/components/text-masked-field/daikin-text-masked-field.cjs +312 -0
  45. package/dist/cjs/components/text-masked-field/daikin-text-masked-field.d.cts +136 -0
  46. package/dist/cjs/components/text-masked-field/index.cjs +7 -0
  47. package/dist/cjs/components/text-masked-field/index.d.cts +1 -0
  48. package/dist/cjs/components/time-picker/daikin-time-picker.cjs +577 -0
  49. package/dist/cjs/components/time-picker/daikin-time-picker.d.cts +165 -0
  50. package/dist/cjs/components/time-picker/index.cjs +17 -0
  51. package/dist/cjs/components/time-picker/index.d.cts +1 -0
  52. package/dist/cjs/components/toast-notification-manager/daikin-toast-notification-manager.d.cts +1 -1
  53. package/dist/cjs/components/tooltip/daikin-tooltip.cjs +12 -2
  54. package/dist/cjs/components/tooltip/daikin-tooltip.d.cts +8 -1
  55. package/dist/cjs/controllers/floating-ui-auto-update.cjs +22 -4
  56. package/dist/cjs/controllers/floating-ui-auto-update.d.cts +12 -0
  57. package/dist/cjs/icon-registry.cjs +170 -0
  58. package/dist/cjs/icon-registry.d.cts +120 -0
  59. package/dist/cjs/index.cjs +39 -0
  60. package/dist/cjs/index.d.cts +1 -0
  61. package/dist/cjs/tailwind.css.cjs +1 -1
  62. package/dist/cjs/utils/notification-common.d.cts +2 -2
  63. package/dist/cjs-dev/base/dds-element.cjs +1 -1
  64. package/dist/cjs-dev/components/accordion-item/daikin-accordion-item.cjs +1 -0
  65. package/dist/cjs-dev/components/avatar/daikin-avatar.cjs +1 -0
  66. package/dist/cjs-dev/components/calendar/daikin-calendar.cjs +2 -0
  67. package/dist/cjs-dev/components/card-header/daikin-card-header.cjs +1 -1
  68. package/dist/cjs-dev/components/carousel/daikin-carousel.cjs +7 -3
  69. package/dist/cjs-dev/components/carousel-item/daikin-carousel-item.cjs +2 -2
  70. package/dist/cjs-dev/components/chip/daikin-chip.cjs +106 -0
  71. package/dist/cjs-dev/components/chip/daikin-chip.d.cts +36 -0
  72. package/dist/cjs-dev/components/chip/index.cjs +7 -0
  73. package/dist/cjs-dev/components/chip/index.d.cts +1 -0
  74. package/dist/cjs-dev/components/combobox/daikin-combobox.cjs +604 -0
  75. package/dist/cjs-dev/components/combobox/daikin-combobox.d.cts +134 -0
  76. package/dist/cjs-dev/components/combobox/index.cjs +8 -0
  77. package/dist/cjs-dev/components/combobox/index.d.cts +1 -0
  78. package/dist/cjs-dev/components/date-picker/daikin-date-picker.cjs +31 -16
  79. package/dist/cjs-dev/components/date-picker/daikin-date-picker.d.cts +2 -1
  80. package/dist/cjs-dev/components/dropdown/daikin-dropdown.cjs +52 -37
  81. package/dist/cjs-dev/components/dropdown/daikin-dropdown.d.cts +4 -3
  82. package/dist/cjs-dev/components/icon/daikin-icon.cjs +141 -16
  83. package/dist/cjs-dev/components/icon/daikin-icon.d.cts +129 -9
  84. package/dist/cjs-dev/components/icon/icons.json.cjs +6 -2
  85. package/dist/cjs-dev/components/icon/icons.json.d.cts +0 -12
  86. package/dist/cjs-dev/components/icon-button/daikin-icon-button.cjs +12 -2
  87. package/dist/cjs-dev/components/icon-button/daikin-icon-button.d.cts +8 -0
  88. package/dist/cjs-dev/components/index.cjs +36 -0
  89. package/dist/cjs-dev/components/index.d.cts +5 -0
  90. package/dist/cjs-dev/components/input-group/daikin-input-group.cjs +1 -1
  91. package/dist/cjs-dev/components/input-group/daikin-input-group.d.cts +40 -13
  92. package/dist/cjs-dev/components/list-item/daikin-list-item.cjs +2 -2
  93. package/dist/cjs-dev/components/modal-header/daikin-modal-header.cjs +1 -1
  94. package/dist/cjs-dev/components/progress-bar/daikin-progress-bar.cjs +3 -3
  95. package/dist/cjs-dev/components/select/daikin-select.cjs +6 -1
  96. package/dist/cjs-dev/components/tab/daikin-tab.cjs +1 -0
  97. package/dist/cjs-dev/components/table/daikin-table.cjs +36 -15
  98. package/dist/cjs-dev/components/table/daikin-table.d.cts +67 -34
  99. package/dist/cjs-dev/components/table-header-cell/daikin-table-header-cell.cjs +31 -6
  100. package/dist/cjs-dev/components/table-header-cell/daikin-table-header-cell.d.cts +7 -0
  101. package/dist/cjs-dev/components/text-field/daikin-text-field.cjs +191 -56
  102. package/dist/cjs-dev/components/text-field/daikin-text-field.d.cts +32 -3
  103. package/dist/cjs-dev/components/text-field/number-utils.cjs +64 -0
  104. package/dist/cjs-dev/components/text-field/number-utils.d.cts +26 -0
  105. package/dist/cjs-dev/components/text-masked-field/daikin-text-masked-field.cjs +312 -0
  106. package/dist/cjs-dev/components/text-masked-field/daikin-text-masked-field.d.cts +136 -0
  107. package/dist/cjs-dev/components/text-masked-field/index.cjs +7 -0
  108. package/dist/cjs-dev/components/text-masked-field/index.d.cts +1 -0
  109. package/dist/cjs-dev/components/time-picker/daikin-time-picker.cjs +589 -0
  110. package/dist/cjs-dev/components/time-picker/daikin-time-picker.d.cts +165 -0
  111. package/dist/cjs-dev/components/time-picker/index.cjs +17 -0
  112. package/dist/cjs-dev/components/time-picker/index.d.cts +1 -0
  113. package/dist/cjs-dev/components/toast-notification-manager/daikin-toast-notification-manager.d.cts +1 -1
  114. package/dist/cjs-dev/components/tooltip/daikin-tooltip.cjs +12 -2
  115. package/dist/cjs-dev/components/tooltip/daikin-tooltip.d.cts +8 -1
  116. package/dist/cjs-dev/controllers/floating-ui-auto-update.cjs +22 -4
  117. package/dist/cjs-dev/controllers/floating-ui-auto-update.d.cts +12 -0
  118. package/dist/cjs-dev/icon-registry.cjs +170 -0
  119. package/dist/cjs-dev/icon-registry.d.cts +120 -0
  120. package/dist/cjs-dev/index.cjs +39 -0
  121. package/dist/cjs-dev/index.d.cts +1 -0
  122. package/dist/cjs-dev/tailwind.css.cjs +1 -1
  123. package/dist/cjs-dev/utils/notification-common.d.cts +2 -2
  124. package/dist/es/base/dds-element.js +1 -1
  125. package/dist/es/components/accordion-item/daikin-accordion-item.js +1 -0
  126. package/dist/es/components/avatar/daikin-avatar.js +1 -0
  127. package/dist/es/components/calendar/daikin-calendar.js +2 -0
  128. package/dist/es/components/card-header/daikin-card-header.js +1 -1
  129. package/dist/es/components/carousel/daikin-carousel.js +7 -3
  130. package/dist/es/components/carousel-item/daikin-carousel-item.js +2 -2
  131. package/dist/es/components/chip/daikin-chip.d.ts +36 -0
  132. package/dist/es/components/chip/daikin-chip.js +107 -0
  133. package/dist/es/components/chip/index.d.ts +1 -0
  134. package/dist/es/components/chip/index.js +4 -0
  135. package/dist/es/components/combobox/daikin-combobox.d.ts +134 -0
  136. package/dist/es/components/combobox/daikin-combobox.js +605 -0
  137. package/dist/es/components/combobox/index.d.ts +1 -0
  138. package/dist/es/components/combobox/index.js +5 -0
  139. package/dist/es/components/date-picker/daikin-date-picker.d.ts +2 -1
  140. package/dist/es/components/date-picker/daikin-date-picker.js +32 -17
  141. package/dist/es/components/dropdown/daikin-dropdown.d.ts +4 -3
  142. package/dist/es/components/dropdown/daikin-dropdown.js +52 -37
  143. package/dist/es/components/icon/daikin-icon.d.ts +129 -9
  144. package/dist/es/components/icon/daikin-icon.js +118 -13
  145. package/dist/es/components/icon/icons.json.d.ts +0 -12
  146. package/dist/es/components/icon/icons.json.js +5 -1
  147. package/dist/es/components/icon-button/daikin-icon-button.d.ts +8 -0
  148. package/dist/es/components/icon-button/daikin-icon-button.js +12 -2
  149. package/dist/es/components/index.d.ts +5 -0
  150. package/dist/es/components/index.js +22 -1
  151. package/dist/es/components/input-group/daikin-input-group.d.ts +40 -13
  152. package/dist/es/components/input-group/daikin-input-group.js +1 -1
  153. package/dist/es/components/list-item/daikin-list-item.js +2 -2
  154. package/dist/es/components/modal-header/daikin-modal-header.js +1 -1
  155. package/dist/es/components/progress-bar/daikin-progress-bar.js +3 -3
  156. package/dist/es/components/select/daikin-select.js +6 -1
  157. package/dist/es/components/tab/daikin-tab.js +1 -0
  158. package/dist/es/components/table/daikin-table.d.ts +67 -34
  159. package/dist/es/components/table/daikin-table.js +33 -12
  160. package/dist/es/components/table-header-cell/daikin-table-header-cell.d.ts +7 -0
  161. package/dist/es/components/table-header-cell/daikin-table-header-cell.js +31 -6
  162. package/dist/es/components/text-field/daikin-text-field.d.ts +32 -3
  163. package/dist/es/components/text-field/daikin-text-field.js +191 -56
  164. package/dist/es/components/text-field/number-utils.d.ts +26 -0
  165. package/dist/es/components/text-field/number-utils.js +61 -0
  166. package/dist/es/components/text-masked-field/daikin-text-masked-field.d.ts +136 -0
  167. package/dist/es/components/text-masked-field/daikin-text-masked-field.js +313 -0
  168. package/dist/es/components/text-masked-field/index.d.ts +1 -0
  169. package/dist/es/components/text-masked-field/index.js +4 -0
  170. package/dist/es/components/time-picker/daikin-time-picker.d.ts +165 -0
  171. package/dist/es/components/time-picker/daikin-time-picker.js +578 -0
  172. package/dist/es/components/time-picker/index.d.ts +1 -0
  173. package/dist/es/components/time-picker/index.js +14 -0
  174. package/dist/es/components/toast-notification-manager/daikin-toast-notification-manager.d.ts +1 -1
  175. package/dist/es/components/tooltip/daikin-tooltip.d.ts +8 -1
  176. package/dist/es/components/tooltip/daikin-tooltip.js +12 -2
  177. package/dist/es/controllers/floating-ui-auto-update.d.ts +12 -0
  178. package/dist/es/controllers/floating-ui-auto-update.js +22 -4
  179. package/dist/es/icon-registry.d.ts +120 -0
  180. package/dist/es/icon-registry.js +170 -0
  181. package/dist/es/index.d.ts +1 -0
  182. package/dist/es/index.js +25 -1
  183. package/dist/es/tailwind.css.js +1 -1
  184. package/dist/es/utils/notification-common.d.ts +2 -2
  185. package/dist/es-dev/base/dds-element.js +1 -1
  186. package/dist/es-dev/components/accordion-item/daikin-accordion-item.js +1 -0
  187. package/dist/es-dev/components/avatar/daikin-avatar.js +1 -0
  188. package/dist/es-dev/components/calendar/daikin-calendar.js +2 -0
  189. package/dist/es-dev/components/card-header/daikin-card-header.js +1 -1
  190. package/dist/es-dev/components/carousel/daikin-carousel.js +7 -3
  191. package/dist/es-dev/components/carousel-item/daikin-carousel-item.js +2 -2
  192. package/dist/es-dev/components/chip/daikin-chip.d.ts +36 -0
  193. package/dist/es-dev/components/chip/daikin-chip.js +107 -0
  194. package/dist/es-dev/components/chip/index.d.ts +1 -0
  195. package/dist/es-dev/components/chip/index.js +4 -0
  196. package/dist/es-dev/components/combobox/daikin-combobox.d.ts +134 -0
  197. package/dist/es-dev/components/combobox/daikin-combobox.js +605 -0
  198. package/dist/es-dev/components/combobox/index.d.ts +1 -0
  199. package/dist/es-dev/components/combobox/index.js +5 -0
  200. package/dist/es-dev/components/date-picker/daikin-date-picker.d.ts +2 -1
  201. package/dist/es-dev/components/date-picker/daikin-date-picker.js +32 -17
  202. package/dist/es-dev/components/dropdown/daikin-dropdown.d.ts +4 -3
  203. package/dist/es-dev/components/dropdown/daikin-dropdown.js +52 -37
  204. package/dist/es-dev/components/icon/daikin-icon.d.ts +129 -9
  205. package/dist/es-dev/components/icon/daikin-icon.js +142 -17
  206. package/dist/es-dev/components/icon/icons.json.d.ts +0 -12
  207. package/dist/es-dev/components/icon/icons.json.js +5 -1
  208. package/dist/es-dev/components/icon-button/daikin-icon-button.d.ts +8 -0
  209. package/dist/es-dev/components/icon-button/daikin-icon-button.js +12 -2
  210. package/dist/es-dev/components/index.d.ts +5 -0
  211. package/dist/es-dev/components/index.js +22 -1
  212. package/dist/es-dev/components/input-group/daikin-input-group.d.ts +40 -13
  213. package/dist/es-dev/components/input-group/daikin-input-group.js +1 -1
  214. package/dist/es-dev/components/list-item/daikin-list-item.js +2 -2
  215. package/dist/es-dev/components/modal-header/daikin-modal-header.js +1 -1
  216. package/dist/es-dev/components/progress-bar/daikin-progress-bar.js +3 -3
  217. package/dist/es-dev/components/select/daikin-select.js +6 -1
  218. package/dist/es-dev/components/tab/daikin-tab.js +1 -0
  219. package/dist/es-dev/components/table/daikin-table.d.ts +67 -34
  220. package/dist/es-dev/components/table/daikin-table.js +36 -15
  221. package/dist/es-dev/components/table-header-cell/daikin-table-header-cell.d.ts +7 -0
  222. package/dist/es-dev/components/table-header-cell/daikin-table-header-cell.js +31 -6
  223. package/dist/es-dev/components/text-field/daikin-text-field.d.ts +32 -3
  224. package/dist/es-dev/components/text-field/daikin-text-field.js +191 -56
  225. package/dist/es-dev/components/text-field/number-utils.d.ts +26 -0
  226. package/dist/es-dev/components/text-field/number-utils.js +64 -0
  227. package/dist/es-dev/components/text-masked-field/daikin-text-masked-field.d.ts +136 -0
  228. package/dist/es-dev/components/text-masked-field/daikin-text-masked-field.js +313 -0
  229. package/dist/es-dev/components/text-masked-field/index.d.ts +1 -0
  230. package/dist/es-dev/components/text-masked-field/index.js +4 -0
  231. package/dist/es-dev/components/time-picker/daikin-time-picker.d.ts +165 -0
  232. package/dist/es-dev/components/time-picker/daikin-time-picker.js +590 -0
  233. package/dist/es-dev/components/time-picker/index.d.ts +1 -0
  234. package/dist/es-dev/components/time-picker/index.js +14 -0
  235. package/dist/es-dev/components/toast-notification-manager/daikin-toast-notification-manager.d.ts +1 -1
  236. package/dist/es-dev/components/tooltip/daikin-tooltip.d.ts +8 -1
  237. package/dist/es-dev/components/tooltip/daikin-tooltip.js +12 -2
  238. package/dist/es-dev/controllers/floating-ui-auto-update.d.ts +12 -0
  239. package/dist/es-dev/controllers/floating-ui-auto-update.js +22 -4
  240. package/dist/es-dev/icon-registry.d.ts +120 -0
  241. package/dist/es-dev/icon-registry.js +170 -0
  242. package/dist/es-dev/index.d.ts +1 -0
  243. package/dist/es-dev/index.js +25 -1
  244. package/dist/es-dev/tailwind.css.js +1 -1
  245. package/dist/es-dev/utils/notification-common.d.ts +2 -2
  246. package/icons/number-minus.svg +5 -0
  247. package/icons/number-plus.svg +5 -0
  248. package/package.json +14 -4
  249. package/icons/dropdown-chevron-down.svg +0 -3
@@ -0,0 +1,312 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const classVarianceAuthority = require("class-variance-authority");
4
+ const IMask = require("imask");
5
+ const lit = require("lit");
6
+ const decorators_js = require("lit/decorators.js");
7
+ const ifDefined_js = require("lit/directives/if-defined.js");
8
+ const ref_js = require("lit/directives/ref.js");
9
+ require("../../base/dds-element.cjs");
10
+ const decorators = require("../../base/decorators.cjs");
11
+ require("../../base/define.cjs");
12
+ const ddsFormElement = require("../../base/dds-form-element.cjs");
13
+ const tailwind = require("../../tailwind.css.cjs");
14
+ var __defProp = Object.defineProperty;
15
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
16
+ var __decorateClass = (decorators2, target, key, kind) => {
17
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
18
+ for (var i = decorators2.length - 1, decorator; i >= 0; i--)
19
+ if (decorator = decorators2[i])
20
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
21
+ if (kind && result) __defProp(target, key, result);
22
+ return result;
23
+ };
24
+ const cvaInput = classVarianceAuthority.cva(
25
+ [
26
+ "flex",
27
+ "items-center",
28
+ "w-full",
29
+ "h-full",
30
+ "bg-ddt-color-common-background-default",
31
+ "relative",
32
+ "rounded",
33
+ "overflow-hidden",
34
+ "font-daikinSerif",
35
+ "outline",
36
+ "outline-[--color-border]",
37
+ "outline-0",
38
+ "-outline-offset-2",
39
+ "placeholder:text-ddt-color-common-text-secondary",
40
+ // Define `--color-border` as a CSS variable that references `--color-state-focus` and `--color-base` in that order.
41
+ // `--color-base` indicates the color of the border when the element is normal, hovered, or disabled.
42
+ "define-[--color-state-focus,--color-base]/color-border",
43
+ "border",
44
+ "border-[--color-border]",
45
+ "enabled:text-ddt-color-common-text-primary",
46
+ "enabled:data-[empty]:text-ddt-color-common-text-secondary",
47
+ "enabled:hover:bg-ddt-color-common-surface-hover",
48
+ "enabled:active:bg-ddt-color-common-surface-press",
49
+ "focus-visible:outline-2",
50
+ "disabled:var-color-ddt-color-common-disabled/color-base",
51
+ "disabled:text-ddt-color-common-disabled",
52
+ "disabled:bg-ddt-color-common-background-default",
53
+ "disabled:placeholder:text-ddt-color-common-disabled"
54
+ ],
55
+ {
56
+ variants: {
57
+ error: {
58
+ false: [
59
+ "enabled:var-color-ddt-color-common-neutral-default/color-base",
60
+ "enabled:hover:var-color-ddt-color-common-neutral-hover/color-base",
61
+ "enabled:active:var-color-ddt-color-common-neutral-press/color-base",
62
+ "focus-visible:var-color-ddt-color-common-border-focus/color-state-focus"
63
+ ],
64
+ true: ["enabled:var-color-ddt-color-common-danger-default/color-base"]
65
+ },
66
+ leftIcon: {
67
+ false: ["pl-4"],
68
+ true: ["pl-11"]
69
+ },
70
+ rightIcon: {
71
+ false: ["pr-4"],
72
+ true: ["pr-11"]
73
+ }
74
+ }
75
+ }
76
+ );
77
+ const cvaIcon = classVarianceAuthority.cva(
78
+ ["flex", "items-center", "absolute", "pointer-events-none"],
79
+ {
80
+ variants: {
81
+ icon: {
82
+ left: ["left-3"],
83
+ right: ["right-3"]
84
+ },
85
+ disabled: {
86
+ false: ["text-ddt-color-common-text-primary"],
87
+ true: ["text-ddt-color-common-disabled"]
88
+ }
89
+ }
90
+ }
91
+ );
92
+ exports.DaikinTextMaskedField = class DaikinTextMaskedField extends ddsFormElement.DDSFormElement {
93
+ constructor() {
94
+ super(...arguments);
95
+ this.placeholder = null;
96
+ this.readonly = false;
97
+ this.disabled = false;
98
+ this.required = false;
99
+ this.error = false;
100
+ this.minlength = null;
101
+ this.maxlength = null;
102
+ this.pattern = null;
103
+ this.mask = null;
104
+ this._unmaskedValue = "";
105
+ this._label = null;
106
+ this._hasLeftSlot = false;
107
+ this._hasRightSlot = false;
108
+ this._inputRef = ref_js.createRef();
109
+ this._maskInstance = null;
110
+ }
111
+ _initializeMask() {
112
+ if (!this._inputRef.value || !this.mask) {
113
+ return;
114
+ }
115
+ this._destroyMask();
116
+ const maskOptions = typeof this.mask === "string" ? { mask: this.mask, lazy: false, placeholderChar: "X" } : this.mask;
117
+ this._maskInstance = IMask(this._inputRef.value, maskOptions);
118
+ this._maskInstance.on("accept", () => {
119
+ if (this._maskInstance) {
120
+ this._unmaskedValue = this._maskInstance.unmaskedValue;
121
+ this.value = this._maskInstance.value;
122
+ }
123
+ });
124
+ }
125
+ _destroyMask() {
126
+ var _a;
127
+ (_a = this._maskInstance) == null ? void 0 : _a.destroy();
128
+ this._maskInstance = null;
129
+ }
130
+ /**
131
+ * The unmasked value of the input.
132
+ */
133
+ get unmaskedValue() {
134
+ return this._unmaskedValue;
135
+ }
136
+ set unmaskedValue(value) {
137
+ if (this._maskInstance) {
138
+ this._maskInstance.unmaskedValue = value;
139
+ this.value = this._maskInstance.value;
140
+ this._unmaskedValue = this._maskInstance.unmaskedValue;
141
+ }
142
+ }
143
+ connectedCallback() {
144
+ super.connectedCallback();
145
+ this._initializeMask();
146
+ }
147
+ disconnectedCallback() {
148
+ super.disconnectedCallback();
149
+ this._destroyMask();
150
+ }
151
+ _handleChange(event) {
152
+ this.dispatchEvent(new Event("change", event));
153
+ }
154
+ _handleSlotChange(event) {
155
+ const target = event.target;
156
+ const name = target.name;
157
+ const hasIcon = !!target.assignedNodes().length;
158
+ switch (name) {
159
+ case "left-icon":
160
+ this._hasLeftSlot = hasIcon;
161
+ break;
162
+ case "right-icon":
163
+ this._hasRightSlot = hasIcon;
164
+ break;
165
+ }
166
+ }
167
+ _handleInput(event) {
168
+ this.value = event.target.value;
169
+ }
170
+ _createIcon() {
171
+ return lit.html`<span
172
+ class=${cvaIcon({
173
+ icon: "left",
174
+ disabled: this.disabled
175
+ })}
176
+ >
177
+ <slot
178
+ name="left-icon"
179
+ class="icon-size-6"
180
+ @slotchange=${this._handleSlotChange}
181
+ ></slot>
182
+ </span>
183
+ <span
184
+ class=${cvaIcon({
185
+ icon: "right",
186
+ disabled: this.disabled
187
+ })}
188
+ >
189
+ <slot
190
+ name="right-icon"
191
+ class="icon-size-6"
192
+ @slotchange=${this._handleSlotChange}
193
+ ></slot>
194
+ </span>`;
195
+ }
196
+ render() {
197
+ const error = !this.disabled && this.error;
198
+ const hasLeftSlot = this._hasLeftSlot;
199
+ const hasRightSlot = this._hasRightSlot;
200
+ const leftIcon = hasLeftSlot;
201
+ const rightIcon = hasRightSlot;
202
+ return lit.html`<input
203
+ ${ref_js.ref(this._inputRef)}
204
+ class=${cvaInput({
205
+ error,
206
+ leftIcon,
207
+ rightIcon
208
+ })}
209
+ type="text"
210
+ placeholder=${ifDefined_js.ifDefined(this.placeholder ?? void 0)}
211
+ name=${ifDefined_js.ifDefined(this.name)}
212
+ minlength=${ifDefined_js.ifDefined(this.minlength ?? void 0)}
213
+ maxlength=${ifDefined_js.ifDefined(this.maxlength ?? void 0)}
214
+ pattern=${ifDefined_js.ifDefined(this.pattern ?? void 0)}
215
+ autocomplete=${// eslint-disable-next-line @typescript-eslint/no-explicit-any -- workaround lit-analyzer checking
216
+ ifDefined_js.ifDefined(this.autocomplete)}
217
+ aria-label=${ifDefined_js.ifDefined(this._label ?? void 0)}
218
+ .value=${this.value}
219
+ ?data-empty=${!this._unmaskedValue}
220
+ ?disabled=${this.disabled}
221
+ ?readonly=${this.readonly}
222
+ ?required=${this.required}
223
+ @change=${this._handleChange}
224
+ @input=${this._handleInput}
225
+ />
226
+ ${this._createIcon()}`;
227
+ }
228
+ updated(changedProperties) {
229
+ if (changedProperties.has("mask")) {
230
+ this._destroyMask();
231
+ this._initializeMask();
232
+ }
233
+ if (!changedProperties.has("value")) {
234
+ return;
235
+ }
236
+ this.setFormValue(this.value);
237
+ }
238
+ /**
239
+ * This method is used by `daikin-input-group` to reflect it's attributes to this component.
240
+ * @private
241
+ */
242
+ reflectInputGroup(inputGroup) {
243
+ const isError = !inputGroup.disabled && !!inputGroup.error;
244
+ this.disabled = !!inputGroup.disabled;
245
+ this.required = !!inputGroup.required;
246
+ this.error = isError;
247
+ this._label = inputGroup.label;
248
+ }
249
+ };
250
+ exports.DaikinTextMaskedField.styles = lit.css`
251
+ ${lit.unsafeCSS(tailwind.default)}
252
+
253
+ :host {
254
+ display: flex;
255
+ align-items: center;
256
+ height: 3rem;
257
+ position: relative;
258
+ }
259
+
260
+ input::-ms-reveal {
261
+ display: none !important;
262
+ }
263
+
264
+ input::-ms-clear {
265
+ display: none !important;
266
+ }
267
+ `;
268
+ __decorateClass([
269
+ decorators_js.property({ type: String })
270
+ ], exports.DaikinTextMaskedField.prototype, "placeholder", 2);
271
+ __decorateClass([
272
+ decorators_js.property({ type: Boolean, reflect: true })
273
+ ], exports.DaikinTextMaskedField.prototype, "readonly", 2);
274
+ __decorateClass([
275
+ decorators_js.property({ type: Boolean, reflect: true })
276
+ ], exports.DaikinTextMaskedField.prototype, "disabled", 2);
277
+ __decorateClass([
278
+ decorators_js.property({ type: Boolean, reflect: true })
279
+ ], exports.DaikinTextMaskedField.prototype, "required", 2);
280
+ __decorateClass([
281
+ decorators_js.property({ type: Boolean, reflect: true })
282
+ ], exports.DaikinTextMaskedField.prototype, "error", 2);
283
+ __decorateClass([
284
+ decorators_js.property({ type: Number, reflect: true })
285
+ ], exports.DaikinTextMaskedField.prototype, "minlength", 2);
286
+ __decorateClass([
287
+ decorators_js.property({ type: Number, reflect: true })
288
+ ], exports.DaikinTextMaskedField.prototype, "maxlength", 2);
289
+ __decorateClass([
290
+ decorators_js.property({ type: String, reflect: true })
291
+ ], exports.DaikinTextMaskedField.prototype, "pattern", 2);
292
+ __decorateClass([
293
+ decorators_js.property({ attribute: false })
294
+ ], exports.DaikinTextMaskedField.prototype, "mask", 2);
295
+ __decorateClass([
296
+ decorators_js.property({ type: String, reflect: true })
297
+ ], exports.DaikinTextMaskedField.prototype, "autocomplete", 2);
298
+ __decorateClass([
299
+ decorators_js.state()
300
+ ], exports.DaikinTextMaskedField.prototype, "_unmaskedValue", 2);
301
+ __decorateClass([
302
+ decorators_js.state()
303
+ ], exports.DaikinTextMaskedField.prototype, "_label", 2);
304
+ __decorateClass([
305
+ decorators_js.state()
306
+ ], exports.DaikinTextMaskedField.prototype, "_hasLeftSlot", 2);
307
+ __decorateClass([
308
+ decorators_js.state()
309
+ ], exports.DaikinTextMaskedField.prototype, "_hasRightSlot", 2);
310
+ exports.DaikinTextMaskedField = __decorateClass([
311
+ decorators.ddsElement("daikin-text-masked-field")
312
+ ], exports.DaikinTextMaskedField);
@@ -0,0 +1,136 @@
1
+ import { InputMask, FactoryOpts } from 'imask';
2
+ import { PropertyValues, TemplateResult } from 'lit';
3
+ import { DDSFormElement } from "../../base/dds-form-element.cjs";
4
+ import { DaikinInputGroup } from "../input-group/index.cjs";
5
+ export type { FactoryOpts, InputMask };
6
+ /**
7
+ * The text masked field component is a UI element that allows users to input single-line text data with input masking support.
8
+ * It functions similarly to the HTML `<input type="text">` tag, providing a simple and efficient way for users to enter and edit short pieces of texts with masking functionality using IMask.js.
9
+ * Can be used within `daikin-input-group` component.
10
+ *
11
+ * Hierarchies:
12
+ * - `daikin-text-masked-field` (can be used solely)
13
+ * - `daikin-input-group` > `daikin-text-masked-field`
14
+ *
15
+ * @fires change - A cloned event of a [change event](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event) emitted from the inner `<input>` element.
16
+ * @fires input - A retargeted event of a [input event](https://developer.mozilla.org/en-US/docs/Web/API/Element/input_event).
17
+ *
18
+ * @slot left-icon - Specify the icon you want to use on the left. You can also use something other than `daikin-icon`.
19
+ *
20
+ * @slot right-icon - Specify the icon you want to use on the right. You can also use something other than `daikin-icon`.
21
+ *
22
+ * @example
23
+ *
24
+ * ```js
25
+ * import "@daikin-oss/design-system-web-components/components/text-masked-field/index.js";
26
+ * ```
27
+ *
28
+ * ```html
29
+ * <!-- See `daikin-input-group` component for complete example. -->
30
+ * <daikin-text-masked-field name="name"></daikin-text-masked-field>
31
+ *
32
+ * <script>
33
+ * const textField = document.querySelector("daikin-text-masked-field");
34
+ * textField.mask = "00/00/0000";
35
+ * </script>
36
+ * ```
37
+ */
38
+ export declare class DaikinTextMaskedField extends DDSFormElement {
39
+ static readonly styles: import('lit').CSSResult;
40
+ /**
41
+ * Placeholder text.
42
+ */
43
+ placeholder: string | null;
44
+ /**
45
+ * Whether the text masked field is readonly.
46
+ */
47
+ readonly: boolean;
48
+ /**
49
+ * Whether the text masked field is disabled.
50
+ * Controlled by `daikin-input-group` when used within `daikin-input-group`.
51
+ */
52
+ disabled: boolean;
53
+ /**
54
+ * Whether the text masked field is required.
55
+ * Controlled by `daikin-input-group` when used within `daikin-input-group`.
56
+ */
57
+ required: boolean;
58
+ /**
59
+ * Whether or not to display error states.
60
+ * Ignored if the `disabled` is `true`.
61
+ * Controlled by `daikin-input-group` when used within `daikin-input-group`.
62
+ */
63
+ error: boolean;
64
+ /**
65
+ * Minimum length of value.
66
+ */
67
+ minlength: number | null;
68
+ /**
69
+ * Maximum length of value.
70
+ */
71
+ maxlength: number | null;
72
+ /**
73
+ * The pattern of value.
74
+ */
75
+ pattern: string | null;
76
+ /**
77
+ * Input mask configuration. When provided as a string, it will be used as `{ mask: string, lazy: false }`.
78
+ * When provided as an object, it will be passed directly to IMask.
79
+ *
80
+ * Pattern symbols:
81
+ * - `0` - any digit
82
+ * - `a` - any letter
83
+ * - `*` - any char
84
+ * - `[]` - make input optional
85
+ * - `{}` - include fixed part in unmasked value
86
+ * - `` ` `` - prevent symbols shift back
87
+ * - Other chars are treated as fixed
88
+ * - Use `\\` to escape definition characters (e.g., `\\0`)
89
+ *
90
+ * Examples:
91
+ * - `"00/00/0000"` - date format (MM/DD/YYYY)
92
+ * - `"{#}000[aaa]/NIC-\`*[**]"` - complex pattern with optional parts
93
+ *
94
+ * For more details, see: https://imask.js.org/guide.html#masked-pattern
95
+ */
96
+ mask: string | FactoryOpts | null;
97
+ /**
98
+ * Value of `autocomplete` attribute of the internal `<input>`.
99
+ */
100
+ autocomplete?: HTMLInputElement["autocomplete"];
101
+ private _unmaskedValue;
102
+ /**
103
+ * The label text used as the value of aria-label.
104
+ * Set automatically by `reflectInputGroup` method.
105
+ */
106
+ private _label;
107
+ private _hasLeftSlot;
108
+ private _hasRightSlot;
109
+ private _inputRef;
110
+ private _maskInstance;
111
+ private _initializeMask;
112
+ private _destroyMask;
113
+ /**
114
+ * The unmasked value of the input.
115
+ */
116
+ get unmaskedValue(): string;
117
+ set unmaskedValue(value: string);
118
+ connectedCallback(): void;
119
+ disconnectedCallback(): void;
120
+ private _handleChange;
121
+ private _handleSlotChange;
122
+ private _handleInput;
123
+ private _createIcon;
124
+ render(): TemplateResult<1>;
125
+ updated(changedProperties: PropertyValues<this>): void;
126
+ /**
127
+ * This method is used by `daikin-input-group` to reflect it's attributes to this component.
128
+ * @private
129
+ */
130
+ reflectInputGroup(inputGroup: DaikinInputGroup): void;
131
+ }
132
+ declare global {
133
+ interface HTMLElementTagNameMap {
134
+ "daikin-text-masked-field": DaikinTextMaskedField;
135
+ }
136
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const daikinTextMaskedField = require("./daikin-text-masked-field.cjs");
4
+ Object.defineProperty(exports, "DaikinTextMaskedField", {
5
+ enumerable: true,
6
+ get: () => daikinTextMaskedField.DaikinTextMaskedField
7
+ });
@@ -0,0 +1 @@
1
+ export * from "./daikin-text-masked-field.cjs";