@daikin-oss/design-system-web-components 1.6.0 → 2.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 (353) hide show
  1. package/CHANGELOG.md +184 -0
  2. package/custom-elements.json +2639 -1328
  3. package/dist/cjs/base/dds-element.cjs +1 -1
  4. package/dist/cjs/components/accordion-item/daikin-accordion-item.cjs +25 -8
  5. package/dist/cjs/components/accordion-item/daikin-accordion-item.d.cts +1 -0
  6. package/dist/cjs/components/breadcrumb/daikin-breadcrumb.d.cts +1 -1
  7. package/dist/cjs/components/breadcrumb-item/daikin-breadcrumb-item.cjs +9 -6
  8. package/dist/cjs/components/breadcrumb-item/daikin-breadcrumb-item.d.cts +1 -0
  9. package/dist/cjs/components/calendar/daikin-calendar.cjs +73 -26
  10. package/dist/cjs/components/calendar/daikin-calendar.d.cts +13 -0
  11. package/dist/cjs/components/checkbox/daikin-checkbox.cjs +190 -52
  12. package/dist/cjs/components/checkbox/daikin-checkbox.d.cts +18 -0
  13. package/dist/cjs/components/checkbox-group/daikin-checkbox-group.cjs +7 -1
  14. package/dist/cjs/components/checkbox-group/daikin-checkbox-group.d.cts +5 -0
  15. package/dist/cjs/components/chip/daikin-chip.cjs +195 -93
  16. package/dist/cjs/components/chip/daikin-chip.d.cts +20 -0
  17. package/dist/cjs/components/combobox/daikin-combobox.cjs +111 -33
  18. package/dist/cjs/components/combobox/daikin-combobox.d.cts +10 -0
  19. package/dist/cjs/components/date-picker/daikin-date-picker.cjs +243 -65
  20. package/dist/cjs/components/date-picker/daikin-date-picker.d.cts +37 -2
  21. package/dist/cjs/components/drawer/daikin-drawer.cjs +1 -1
  22. package/dist/cjs/components/dropdown/daikin-dropdown.cjs +164 -32
  23. package/dist/cjs/components/dropdown/daikin-dropdown.d.cts +13 -0
  24. package/dist/cjs/components/dropdown-item/daikin-dropdown-item.cjs +13 -6
  25. package/dist/cjs/components/icon-button/daikin-icon-button.cjs +2 -0
  26. package/dist/cjs/components/icon-button/daikin-icon-button.d.cts +2 -0
  27. package/dist/cjs/components/index.cjs +2 -2
  28. package/dist/cjs/components/input-group/daikin-input-group.cjs +88 -30
  29. package/dist/cjs/components/input-group/daikin-input-group.d.cts +10 -0
  30. package/dist/cjs/components/list-item/daikin-list-item.cjs +21 -10
  31. package/dist/cjs/components/list-item/daikin-list-item.d.cts +9 -0
  32. package/dist/cjs/components/logo/daikin-logo.cjs +1 -1
  33. package/dist/cjs/components/logo/daikin-logo.d.cts +2 -2
  34. package/dist/cjs/components/menu/daikin-menu.cjs +2 -2
  35. package/dist/cjs/components/modal-header/daikin-modal-header.cjs +10 -4
  36. package/dist/cjs/components/modal-header/daikin-modal-header.d.cts +1 -0
  37. package/dist/cjs/components/navigation/daikin-navigation.cjs +21 -0
  38. package/dist/cjs/components/navigation/daikin-navigation.d.cts +9 -0
  39. package/dist/cjs/components/navigation-item/daikin-navigation-item.cjs +18 -14
  40. package/dist/cjs/components/pagination/daikin-pagination.cjs +60 -19
  41. package/dist/cjs/components/pagination/daikin-pagination.d.cts +11 -0
  42. package/dist/cjs/components/progress-bar/daikin-progress-bar.cjs +27 -19
  43. package/dist/cjs/components/progress-bar/daikin-progress-bar.d.cts +1 -0
  44. package/dist/cjs/components/radio/daikin-radio.cjs +160 -35
  45. package/dist/cjs/components/radio/daikin-radio.d.cts +26 -0
  46. package/dist/cjs/components/radio-group/daikin-radio-group.cjs +10 -1
  47. package/dist/cjs/components/radio-group/daikin-radio-group.d.cts +4 -0
  48. package/dist/cjs/components/select/daikin-select.cjs +128 -21
  49. package/dist/cjs/components/select/daikin-select.d.cts +11 -0
  50. package/dist/cjs/components/slider/daikin-slider.cjs +61 -16
  51. package/dist/cjs/components/slider/daikin-slider.d.cts +4 -0
  52. package/dist/cjs/components/status-message/daikin-status-message.cjs +1 -0
  53. package/dist/cjs/components/status-message/daikin-status-message.d.cts +2 -0
  54. package/dist/cjs/components/table/daikin-table.cjs +108 -16
  55. package/dist/cjs/components/table/daikin-table.d.cts +58 -1
  56. package/dist/cjs/components/table-cell/daikin-table-cell.cjs +3 -4
  57. package/dist/cjs/components/table-header-cell/daikin-table-header-cell.cjs +21 -15
  58. package/dist/cjs/components/tag/daikin-tag.cjs +99 -20
  59. package/dist/cjs/components/tag/daikin-tag.d.cts +14 -0
  60. package/dist/cjs/components/text-area/daikin-text-area.cjs +22 -2
  61. package/dist/cjs/components/text-field/daikin-text-field.cjs +96 -50
  62. package/dist/cjs/components/text-field/daikin-text-field.d.cts +9 -0
  63. package/dist/cjs/components/text-field/number-utils.cjs +51 -19
  64. package/dist/cjs/components/text-field/number-utils.d.cts +7 -0
  65. package/dist/cjs/components/text-masked-field/daikin-text-masked-field.cjs +31 -7
  66. package/dist/cjs/components/time-picker/daikin-time-picker.cjs +325 -108
  67. package/dist/cjs/components/time-picker/daikin-time-picker.d.cts +57 -14
  68. package/dist/cjs/components/time-picker/index.cjs +2 -2
  69. package/dist/cjs/components/toast-notification-manager/daikin-toast-notification-manager.cjs +1 -1
  70. package/dist/cjs/components/toggle/daikin-toggle.cjs +110 -35
  71. package/dist/cjs/components/toggle/daikin-toggle.d.cts +5 -0
  72. package/dist/cjs/components/tooltip/daikin-tooltip.cjs +1 -1
  73. package/dist/cjs/components/tree-item/daikin-tree-item.cjs +24 -8
  74. package/dist/cjs/components/tree-item/daikin-tree-item.d.cts +1 -0
  75. package/dist/cjs/components/tree-section/daikin-tree-section.cjs +7 -1
  76. package/dist/cjs/components/tree-section/daikin-tree-section.d.cts +1 -0
  77. package/dist/cjs/components/vertical-navigation/daikin-vertical-navigation.cjs +1 -1
  78. package/dist/cjs/components/vertical-navigation-item/daikin-vertical-navigation-item.cjs +248 -38
  79. package/dist/cjs/components/vertical-navigation-item/daikin-vertical-navigation-item.d.cts +17 -7
  80. package/dist/cjs/components/vertical-navigation-menu-item/daikin-vertical-navigation-menu-item.cjs +103 -33
  81. package/dist/cjs/components/vertical-navigation-menu-item/daikin-vertical-navigation-menu-item.d.cts +6 -1
  82. package/dist/cjs/controllers/custom-readonly.cjs +59 -0
  83. package/dist/cjs/controllers/custom-readonly.d.cts +28 -0
  84. package/dist/cjs/index.cjs +2 -2
  85. package/dist/cjs/tailwind.css.cjs +1 -1
  86. package/dist/cjs/utils/calendar-common.cjs +6 -2
  87. package/dist/cjs/utils/calendar-common.d.cts +1 -1
  88. package/dist/cjs/utils/extract-half-width-digits.cjs +11 -0
  89. package/dist/cjs/utils/extract-half-width-digits.d.cts +15 -0
  90. package/dist/cjs-dev/base/dds-element.cjs +1 -1
  91. package/dist/cjs-dev/components/accordion-item/daikin-accordion-item.cjs +25 -8
  92. package/dist/cjs-dev/components/accordion-item/daikin-accordion-item.d.cts +1 -0
  93. package/dist/cjs-dev/components/breadcrumb/daikin-breadcrumb.d.cts +1 -1
  94. package/dist/cjs-dev/components/breadcrumb-item/daikin-breadcrumb-item.cjs +9 -6
  95. package/dist/cjs-dev/components/breadcrumb-item/daikin-breadcrumb-item.d.cts +1 -0
  96. package/dist/cjs-dev/components/calendar/daikin-calendar.cjs +73 -26
  97. package/dist/cjs-dev/components/calendar/daikin-calendar.d.cts +13 -0
  98. package/dist/cjs-dev/components/checkbox/daikin-checkbox.cjs +190 -52
  99. package/dist/cjs-dev/components/checkbox/daikin-checkbox.d.cts +18 -0
  100. package/dist/cjs-dev/components/checkbox-group/daikin-checkbox-group.cjs +7 -1
  101. package/dist/cjs-dev/components/checkbox-group/daikin-checkbox-group.d.cts +5 -0
  102. package/dist/cjs-dev/components/chip/daikin-chip.cjs +195 -93
  103. package/dist/cjs-dev/components/chip/daikin-chip.d.cts +20 -0
  104. package/dist/cjs-dev/components/combobox/daikin-combobox.cjs +111 -33
  105. package/dist/cjs-dev/components/combobox/daikin-combobox.d.cts +10 -0
  106. package/dist/cjs-dev/components/date-picker/daikin-date-picker.cjs +243 -65
  107. package/dist/cjs-dev/components/date-picker/daikin-date-picker.d.cts +37 -2
  108. package/dist/cjs-dev/components/drawer/daikin-drawer.cjs +1 -1
  109. package/dist/cjs-dev/components/dropdown/daikin-dropdown.cjs +164 -32
  110. package/dist/cjs-dev/components/dropdown/daikin-dropdown.d.cts +13 -0
  111. package/dist/cjs-dev/components/dropdown-item/daikin-dropdown-item.cjs +13 -6
  112. package/dist/cjs-dev/components/icon-button/daikin-icon-button.cjs +2 -0
  113. package/dist/cjs-dev/components/icon-button/daikin-icon-button.d.cts +2 -0
  114. package/dist/cjs-dev/components/index.cjs +2 -2
  115. package/dist/cjs-dev/components/input-group/daikin-input-group.cjs +88 -30
  116. package/dist/cjs-dev/components/input-group/daikin-input-group.d.cts +10 -0
  117. package/dist/cjs-dev/components/list-item/daikin-list-item.cjs +21 -10
  118. package/dist/cjs-dev/components/list-item/daikin-list-item.d.cts +9 -0
  119. package/dist/cjs-dev/components/logo/daikin-logo.cjs +1 -1
  120. package/dist/cjs-dev/components/logo/daikin-logo.d.cts +2 -2
  121. package/dist/cjs-dev/components/menu/daikin-menu.cjs +2 -2
  122. package/dist/cjs-dev/components/modal-header/daikin-modal-header.cjs +10 -4
  123. package/dist/cjs-dev/components/modal-header/daikin-modal-header.d.cts +1 -0
  124. package/dist/cjs-dev/components/navigation/daikin-navigation.cjs +21 -0
  125. package/dist/cjs-dev/components/navigation/daikin-navigation.d.cts +9 -0
  126. package/dist/cjs-dev/components/navigation-item/daikin-navigation-item.cjs +18 -14
  127. package/dist/cjs-dev/components/pagination/daikin-pagination.cjs +60 -19
  128. package/dist/cjs-dev/components/pagination/daikin-pagination.d.cts +11 -0
  129. package/dist/cjs-dev/components/progress-bar/daikin-progress-bar.cjs +27 -19
  130. package/dist/cjs-dev/components/progress-bar/daikin-progress-bar.d.cts +1 -0
  131. package/dist/cjs-dev/components/radio/daikin-radio.cjs +160 -35
  132. package/dist/cjs-dev/components/radio/daikin-radio.d.cts +26 -0
  133. package/dist/cjs-dev/components/radio-group/daikin-radio-group.cjs +10 -1
  134. package/dist/cjs-dev/components/radio-group/daikin-radio-group.d.cts +4 -0
  135. package/dist/cjs-dev/components/select/daikin-select.cjs +128 -21
  136. package/dist/cjs-dev/components/select/daikin-select.d.cts +11 -0
  137. package/dist/cjs-dev/components/slider/daikin-slider.cjs +61 -16
  138. package/dist/cjs-dev/components/slider/daikin-slider.d.cts +4 -0
  139. package/dist/cjs-dev/components/status-message/daikin-status-message.cjs +1 -0
  140. package/dist/cjs-dev/components/status-message/daikin-status-message.d.cts +2 -0
  141. package/dist/cjs-dev/components/table/daikin-table.cjs +108 -16
  142. package/dist/cjs-dev/components/table/daikin-table.d.cts +58 -1
  143. package/dist/cjs-dev/components/table-cell/daikin-table-cell.cjs +3 -4
  144. package/dist/cjs-dev/components/table-header-cell/daikin-table-header-cell.cjs +21 -15
  145. package/dist/cjs-dev/components/tag/daikin-tag.cjs +99 -20
  146. package/dist/cjs-dev/components/tag/daikin-tag.d.cts +14 -0
  147. package/dist/cjs-dev/components/text-area/daikin-text-area.cjs +22 -2
  148. package/dist/cjs-dev/components/text-field/daikin-text-field.cjs +96 -50
  149. package/dist/cjs-dev/components/text-field/daikin-text-field.d.cts +9 -0
  150. package/dist/cjs-dev/components/text-field/number-utils.cjs +51 -19
  151. package/dist/cjs-dev/components/text-field/number-utils.d.cts +7 -0
  152. package/dist/cjs-dev/components/text-masked-field/daikin-text-masked-field.cjs +31 -7
  153. package/dist/cjs-dev/components/time-picker/daikin-time-picker.cjs +325 -108
  154. package/dist/cjs-dev/components/time-picker/daikin-time-picker.d.cts +57 -14
  155. package/dist/cjs-dev/components/time-picker/index.cjs +2 -2
  156. package/dist/cjs-dev/components/toast-notification-manager/daikin-toast-notification-manager.cjs +1 -1
  157. package/dist/cjs-dev/components/toggle/daikin-toggle.cjs +110 -35
  158. package/dist/cjs-dev/components/toggle/daikin-toggle.d.cts +5 -0
  159. package/dist/cjs-dev/components/tooltip/daikin-tooltip.cjs +1 -1
  160. package/dist/cjs-dev/components/tree-item/daikin-tree-item.cjs +24 -8
  161. package/dist/cjs-dev/components/tree-item/daikin-tree-item.d.cts +1 -0
  162. package/dist/cjs-dev/components/tree-section/daikin-tree-section.cjs +7 -1
  163. package/dist/cjs-dev/components/tree-section/daikin-tree-section.d.cts +1 -0
  164. package/dist/cjs-dev/components/vertical-navigation/daikin-vertical-navigation.cjs +1 -1
  165. package/dist/cjs-dev/components/vertical-navigation-item/daikin-vertical-navigation-item.cjs +248 -38
  166. package/dist/cjs-dev/components/vertical-navigation-item/daikin-vertical-navigation-item.d.cts +17 -7
  167. package/dist/cjs-dev/components/vertical-navigation-menu-item/daikin-vertical-navigation-menu-item.cjs +103 -33
  168. package/dist/cjs-dev/components/vertical-navigation-menu-item/daikin-vertical-navigation-menu-item.d.cts +6 -1
  169. package/dist/cjs-dev/controllers/custom-readonly.cjs +59 -0
  170. package/dist/cjs-dev/controllers/custom-readonly.d.cts +28 -0
  171. package/dist/cjs-dev/index.cjs +2 -2
  172. package/dist/cjs-dev/tailwind.css.cjs +1 -1
  173. package/dist/cjs-dev/utils/calendar-common.cjs +6 -2
  174. package/dist/cjs-dev/utils/calendar-common.d.cts +1 -1
  175. package/dist/cjs-dev/utils/extract-half-width-digits.cjs +11 -0
  176. package/dist/cjs-dev/utils/extract-half-width-digits.d.cts +15 -0
  177. package/dist/es/base/dds-element.js +1 -1
  178. package/dist/es/components/accordion-item/daikin-accordion-item.d.ts +1 -0
  179. package/dist/es/components/accordion-item/daikin-accordion-item.js +25 -8
  180. package/dist/es/components/breadcrumb/daikin-breadcrumb.d.ts +1 -1
  181. package/dist/es/components/breadcrumb-item/daikin-breadcrumb-item.d.ts +1 -0
  182. package/dist/es/components/breadcrumb-item/daikin-breadcrumb-item.js +9 -6
  183. package/dist/es/components/calendar/daikin-calendar.d.ts +13 -0
  184. package/dist/es/components/calendar/daikin-calendar.js +73 -26
  185. package/dist/es/components/checkbox/daikin-checkbox.d.ts +18 -0
  186. package/dist/es/components/checkbox/daikin-checkbox.js +190 -52
  187. package/dist/es/components/checkbox-group/daikin-checkbox-group.d.ts +5 -0
  188. package/dist/es/components/checkbox-group/daikin-checkbox-group.js +7 -1
  189. package/dist/es/components/chip/daikin-chip.d.ts +20 -0
  190. package/dist/es/components/chip/daikin-chip.js +195 -93
  191. package/dist/es/components/combobox/daikin-combobox.d.ts +10 -0
  192. package/dist/es/components/combobox/daikin-combobox.js +111 -33
  193. package/dist/es/components/date-picker/daikin-date-picker.d.ts +37 -2
  194. package/dist/es/components/date-picker/daikin-date-picker.js +243 -65
  195. package/dist/es/components/drawer/daikin-drawer.js +1 -1
  196. package/dist/es/components/dropdown/daikin-dropdown.d.ts +13 -0
  197. package/dist/es/components/dropdown/daikin-dropdown.js +164 -32
  198. package/dist/es/components/dropdown-item/daikin-dropdown-item.js +13 -6
  199. package/dist/es/components/icon-button/daikin-icon-button.d.ts +2 -0
  200. package/dist/es/components/icon-button/daikin-icon-button.js +2 -0
  201. package/dist/es/components/index.js +4 -4
  202. package/dist/es/components/input-group/daikin-input-group.d.ts +10 -0
  203. package/dist/es/components/input-group/daikin-input-group.js +89 -31
  204. package/dist/es/components/list-item/daikin-list-item.d.ts +9 -0
  205. package/dist/es/components/list-item/daikin-list-item.js +21 -10
  206. package/dist/es/components/logo/daikin-logo.d.ts +2 -2
  207. package/dist/es/components/logo/daikin-logo.js +1 -1
  208. package/dist/es/components/menu/daikin-menu.js +2 -2
  209. package/dist/es/components/modal-header/daikin-modal-header.d.ts +1 -0
  210. package/dist/es/components/modal-header/daikin-modal-header.js +10 -4
  211. package/dist/es/components/navigation/daikin-navigation.d.ts +9 -0
  212. package/dist/es/components/navigation/daikin-navigation.js +22 -1
  213. package/dist/es/components/navigation-item/daikin-navigation-item.js +18 -14
  214. package/dist/es/components/pagination/daikin-pagination.d.ts +11 -0
  215. package/dist/es/components/pagination/daikin-pagination.js +61 -20
  216. package/dist/es/components/progress-bar/daikin-progress-bar.d.ts +1 -0
  217. package/dist/es/components/progress-bar/daikin-progress-bar.js +27 -19
  218. package/dist/es/components/radio/daikin-radio.d.ts +26 -0
  219. package/dist/es/components/radio/daikin-radio.js +160 -35
  220. package/dist/es/components/radio-group/daikin-radio-group.d.ts +4 -0
  221. package/dist/es/components/radio-group/daikin-radio-group.js +10 -1
  222. package/dist/es/components/select/daikin-select.d.ts +11 -0
  223. package/dist/es/components/select/daikin-select.js +128 -21
  224. package/dist/es/components/slider/daikin-slider.d.ts +4 -0
  225. package/dist/es/components/slider/daikin-slider.js +61 -16
  226. package/dist/es/components/status-message/daikin-status-message.d.ts +2 -0
  227. package/dist/es/components/status-message/daikin-status-message.js +1 -0
  228. package/dist/es/components/table/daikin-table.d.ts +58 -1
  229. package/dist/es/components/table/daikin-table.js +109 -17
  230. package/dist/es/components/table-cell/daikin-table-cell.js +3 -4
  231. package/dist/es/components/table-header-cell/daikin-table-header-cell.js +21 -15
  232. package/dist/es/components/tag/daikin-tag.d.ts +14 -0
  233. package/dist/es/components/tag/daikin-tag.js +100 -21
  234. package/dist/es/components/text-area/daikin-text-area.js +22 -2
  235. package/dist/es/components/text-field/daikin-text-field.d.ts +9 -0
  236. package/dist/es/components/text-field/daikin-text-field.js +97 -51
  237. package/dist/es/components/text-field/number-utils.d.ts +7 -0
  238. package/dist/es/components/text-field/number-utils.js +51 -19
  239. package/dist/es/components/text-masked-field/daikin-text-masked-field.js +31 -7
  240. package/dist/es/components/time-picker/daikin-time-picker.d.ts +57 -14
  241. package/dist/es/components/time-picker/daikin-time-picker.js +327 -110
  242. package/dist/es/components/time-picker/index.js +4 -4
  243. package/dist/es/components/toast-notification-manager/daikin-toast-notification-manager.js +1 -1
  244. package/dist/es/components/toggle/daikin-toggle.d.ts +5 -0
  245. package/dist/es/components/toggle/daikin-toggle.js +110 -35
  246. package/dist/es/components/tooltip/daikin-tooltip.js +1 -1
  247. package/dist/es/components/tree-item/daikin-tree-item.d.ts +1 -0
  248. package/dist/es/components/tree-item/daikin-tree-item.js +24 -8
  249. package/dist/es/components/tree-section/daikin-tree-section.d.ts +1 -0
  250. package/dist/es/components/tree-section/daikin-tree-section.js +7 -1
  251. package/dist/es/components/vertical-navigation/daikin-vertical-navigation.js +1 -1
  252. package/dist/es/components/vertical-navigation-item/daikin-vertical-navigation-item.d.ts +17 -7
  253. package/dist/es/components/vertical-navigation-item/daikin-vertical-navigation-item.js +248 -38
  254. package/dist/es/components/vertical-navigation-menu-item/daikin-vertical-navigation-menu-item.d.ts +6 -1
  255. package/dist/es/components/vertical-navigation-menu-item/daikin-vertical-navigation-menu-item.js +104 -34
  256. package/dist/es/controllers/custom-readonly.d.ts +28 -0
  257. package/dist/es/controllers/custom-readonly.js +59 -0
  258. package/dist/es/index.js +4 -4
  259. package/dist/es/tailwind.css.js +1 -1
  260. package/dist/es/utils/calendar-common.d.ts +1 -1
  261. package/dist/es/utils/calendar-common.js +6 -2
  262. package/dist/es/utils/extract-half-width-digits.d.ts +15 -0
  263. package/dist/es/utils/extract-half-width-digits.js +11 -0
  264. package/dist/es-dev/base/dds-element.js +1 -1
  265. package/dist/es-dev/components/accordion-item/daikin-accordion-item.d.ts +1 -0
  266. package/dist/es-dev/components/accordion-item/daikin-accordion-item.js +25 -8
  267. package/dist/es-dev/components/breadcrumb/daikin-breadcrumb.d.ts +1 -1
  268. package/dist/es-dev/components/breadcrumb-item/daikin-breadcrumb-item.d.ts +1 -0
  269. package/dist/es-dev/components/breadcrumb-item/daikin-breadcrumb-item.js +9 -6
  270. package/dist/es-dev/components/calendar/daikin-calendar.d.ts +13 -0
  271. package/dist/es-dev/components/calendar/daikin-calendar.js +73 -26
  272. package/dist/es-dev/components/checkbox/daikin-checkbox.d.ts +18 -0
  273. package/dist/es-dev/components/checkbox/daikin-checkbox.js +190 -52
  274. package/dist/es-dev/components/checkbox-group/daikin-checkbox-group.d.ts +5 -0
  275. package/dist/es-dev/components/checkbox-group/daikin-checkbox-group.js +7 -1
  276. package/dist/es-dev/components/chip/daikin-chip.d.ts +20 -0
  277. package/dist/es-dev/components/chip/daikin-chip.js +195 -93
  278. package/dist/es-dev/components/combobox/daikin-combobox.d.ts +10 -0
  279. package/dist/es-dev/components/combobox/daikin-combobox.js +111 -33
  280. package/dist/es-dev/components/date-picker/daikin-date-picker.d.ts +37 -2
  281. package/dist/es-dev/components/date-picker/daikin-date-picker.js +243 -65
  282. package/dist/es-dev/components/drawer/daikin-drawer.js +1 -1
  283. package/dist/es-dev/components/dropdown/daikin-dropdown.d.ts +13 -0
  284. package/dist/es-dev/components/dropdown/daikin-dropdown.js +164 -32
  285. package/dist/es-dev/components/dropdown-item/daikin-dropdown-item.js +13 -6
  286. package/dist/es-dev/components/icon-button/daikin-icon-button.d.ts +2 -0
  287. package/dist/es-dev/components/icon-button/daikin-icon-button.js +2 -0
  288. package/dist/es-dev/components/index.js +4 -4
  289. package/dist/es-dev/components/input-group/daikin-input-group.d.ts +10 -0
  290. package/dist/es-dev/components/input-group/daikin-input-group.js +89 -31
  291. package/dist/es-dev/components/list-item/daikin-list-item.d.ts +9 -0
  292. package/dist/es-dev/components/list-item/daikin-list-item.js +21 -10
  293. package/dist/es-dev/components/logo/daikin-logo.d.ts +2 -2
  294. package/dist/es-dev/components/logo/daikin-logo.js +1 -1
  295. package/dist/es-dev/components/menu/daikin-menu.js +2 -2
  296. package/dist/es-dev/components/modal-header/daikin-modal-header.d.ts +1 -0
  297. package/dist/es-dev/components/modal-header/daikin-modal-header.js +10 -4
  298. package/dist/es-dev/components/navigation/daikin-navigation.d.ts +9 -0
  299. package/dist/es-dev/components/navigation/daikin-navigation.js +22 -1
  300. package/dist/es-dev/components/navigation-item/daikin-navigation-item.js +18 -14
  301. package/dist/es-dev/components/pagination/daikin-pagination.d.ts +11 -0
  302. package/dist/es-dev/components/pagination/daikin-pagination.js +61 -20
  303. package/dist/es-dev/components/progress-bar/daikin-progress-bar.d.ts +1 -0
  304. package/dist/es-dev/components/progress-bar/daikin-progress-bar.js +27 -19
  305. package/dist/es-dev/components/radio/daikin-radio.d.ts +26 -0
  306. package/dist/es-dev/components/radio/daikin-radio.js +160 -35
  307. package/dist/es-dev/components/radio-group/daikin-radio-group.d.ts +4 -0
  308. package/dist/es-dev/components/radio-group/daikin-radio-group.js +10 -1
  309. package/dist/es-dev/components/select/daikin-select.d.ts +11 -0
  310. package/dist/es-dev/components/select/daikin-select.js +128 -21
  311. package/dist/es-dev/components/slider/daikin-slider.d.ts +4 -0
  312. package/dist/es-dev/components/slider/daikin-slider.js +61 -16
  313. package/dist/es-dev/components/status-message/daikin-status-message.d.ts +2 -0
  314. package/dist/es-dev/components/status-message/daikin-status-message.js +1 -0
  315. package/dist/es-dev/components/table/daikin-table.d.ts +58 -1
  316. package/dist/es-dev/components/table/daikin-table.js +109 -17
  317. package/dist/es-dev/components/table-cell/daikin-table-cell.js +3 -4
  318. package/dist/es-dev/components/table-header-cell/daikin-table-header-cell.js +21 -15
  319. package/dist/es-dev/components/tag/daikin-tag.d.ts +14 -0
  320. package/dist/es-dev/components/tag/daikin-tag.js +100 -21
  321. package/dist/es-dev/components/text-area/daikin-text-area.js +22 -2
  322. package/dist/es-dev/components/text-field/daikin-text-field.d.ts +9 -0
  323. package/dist/es-dev/components/text-field/daikin-text-field.js +97 -51
  324. package/dist/es-dev/components/text-field/number-utils.d.ts +7 -0
  325. package/dist/es-dev/components/text-field/number-utils.js +51 -19
  326. package/dist/es-dev/components/text-masked-field/daikin-text-masked-field.js +31 -7
  327. package/dist/es-dev/components/time-picker/daikin-time-picker.d.ts +57 -14
  328. package/dist/es-dev/components/time-picker/daikin-time-picker.js +327 -110
  329. package/dist/es-dev/components/time-picker/index.js +4 -4
  330. package/dist/es-dev/components/toast-notification-manager/daikin-toast-notification-manager.js +1 -1
  331. package/dist/es-dev/components/toggle/daikin-toggle.d.ts +5 -0
  332. package/dist/es-dev/components/toggle/daikin-toggle.js +110 -35
  333. package/dist/es-dev/components/tooltip/daikin-tooltip.js +1 -1
  334. package/dist/es-dev/components/tree-item/daikin-tree-item.d.ts +1 -0
  335. package/dist/es-dev/components/tree-item/daikin-tree-item.js +24 -8
  336. package/dist/es-dev/components/tree-section/daikin-tree-section.d.ts +1 -0
  337. package/dist/es-dev/components/tree-section/daikin-tree-section.js +7 -1
  338. package/dist/es-dev/components/vertical-navigation/daikin-vertical-navigation.js +1 -1
  339. package/dist/es-dev/components/vertical-navigation-item/daikin-vertical-navigation-item.d.ts +17 -7
  340. package/dist/es-dev/components/vertical-navigation-item/daikin-vertical-navigation-item.js +248 -38
  341. package/dist/es-dev/components/vertical-navigation-menu-item/daikin-vertical-navigation-menu-item.d.ts +6 -1
  342. package/dist/es-dev/components/vertical-navigation-menu-item/daikin-vertical-navigation-menu-item.js +104 -34
  343. package/dist/es-dev/controllers/custom-readonly.d.ts +28 -0
  344. package/dist/es-dev/controllers/custom-readonly.js +59 -0
  345. package/dist/es-dev/index.js +4 -4
  346. package/dist/es-dev/tailwind.css.js +1 -1
  347. package/dist/es-dev/utils/calendar-common.d.ts +1 -1
  348. package/dist/es-dev/utils/calendar-common.js +6 -2
  349. package/dist/es-dev/utils/extract-half-width-digits.d.ts +15 -0
  350. package/dist/es-dev/utils/extract-half-width-digits.js +11 -0
  351. package/icons/logo-negative.svg +16 -9
  352. package/icons/logo-positive.svg +16 -9
  353. package/package.json +6 -5
@@ -1,14 +1,14 @@
1
- import { cva } from "class-variance-authority";
2
1
  import { unsafeCSS, css, html } from "lit";
3
2
  import { state } from "lit/decorators.js";
4
3
  import { ifDefined } from "lit/directives/if-defined.js";
5
4
  import { createRef, ref } from "lit/directives/ref.js";
6
5
  import "../../base/dds-element.js";
7
6
  import { DDSFormElement } from "../../base/dds-form-element.js";
8
- import { property } from "../../base/dds-property.js";
7
+ import { property, oneOf } from "../../base/dds-property.js";
9
8
  import { ddsElement } from "../../base/decorators.js";
10
9
  import "../../base/define.js";
11
10
  import tailwindStyles from "../../tailwind.css.js";
11
+ import { extractHalfWidthDigits } from "../../utils/extract-half-width-digits.js";
12
12
  import "../dropdown-item/daikin-dropdown-item.js";
13
13
  import "../dropdown/daikin-dropdown.js";
14
14
  var __defProp = Object.defineProperty;
@@ -24,23 +24,31 @@ var __decorateClass = (decorators, target, key, kind) => {
24
24
  const VALUE_TIME_REGEX = /^(?:[01][0-9]|2[0-3]):[0-5][0-9]$/;
25
25
  const DEFAULT_MIN_TIME = "00:00";
26
26
  const DEFAULT_MAX_TIME = "23:59";
27
- function to24HourFormat(time, meridiem) {
28
- const [hourInit, minute] = time.split(":").map(Number);
29
- let hour = hourInit;
30
- if (meridiem === "AM") {
31
- if (hour === 12) hour = 0;
32
- } else {
33
- if (hour !== 12) hour += 12;
27
+ function uiToTimeValue(object) {
28
+ if (object.hourCycle === "h23") {
29
+ return formatTimeForUI(formatPartsForUI(object));
34
30
  }
31
+ const [hour12, minute] = formatPartsForUI(object).split(":").map(Number);
32
+ const hour = hour12 % 12 + (object.meridiem === "PM" ? 12 : 0);
35
33
  return `${hour.toString().padStart(2, "0")}:${minute.toString().padStart(2, "0")}`;
36
34
  }
37
- function from24HourFormat(time) {
38
- const [hour, minute] = time.split(":").map(Number);
39
- const meridiem = hour >= 12 ? "PM" : "AM";
40
- let hour12 = hour % 12;
35
+ function timeValueToUI(time, hourCycle) {
36
+ const [hour24, minute] = time.split(":").map(Number);
37
+ if (hourCycle === "h23") {
38
+ return {
39
+ hourCycle: "h23",
40
+ hour: hour24.toString().padStart(2, "0"),
41
+ minute: minute.toString().padStart(2, "0"),
42
+ meridiem: null
43
+ };
44
+ }
45
+ const meridiem = hour24 >= 12 ? "PM" : "AM";
46
+ let hour12 = hour24 % 12;
41
47
  if (hour12 === 0) hour12 = 12;
42
48
  return {
43
- time: `${hour12.toString().padStart(2, "0")}:${minute.toString().padStart(2, "0")}`,
49
+ hourCycle: "h12",
50
+ hour: hour12.toString().padStart(2, "0"),
51
+ minute: minute.toString().padStart(2, "0"),
44
52
  meridiem
45
53
  };
46
54
  }
@@ -110,12 +118,39 @@ function getTimeItemInSelection(selectionStart, selectionEnd) {
110
118
  }
111
119
  return null;
112
120
  }
113
- function calcDigitInput(parts, item, digit, hourDigitIndex) {
121
+ function calcDigitInput(parts, item, digit, hourDigitIndex, hourCycle) {
114
122
  if (!/^\d$/.test(digit)) {
115
123
  return null;
116
124
  }
117
125
  switch (item) {
118
126
  case "hour": {
127
+ if (hourCycle === "h23") {
128
+ if (hourDigitIndex === 1) {
129
+ const firstDigit = parts.hour[1];
130
+ if (firstDigit === "2") {
131
+ if (["0", "1", "2", "3"].includes(digit)) {
132
+ return {
133
+ parts: { ...parts, hour: `2${digit}` },
134
+ done: true
135
+ };
136
+ }
137
+ return {
138
+ parts: { ...parts, hour: `0${digit}` },
139
+ done: true
140
+ };
141
+ }
142
+ if (firstDigit === "0" || firstDigit === "1") {
143
+ return {
144
+ parts: { ...parts, hour: `${firstDigit}${digit}` },
145
+ done: true
146
+ };
147
+ }
148
+ }
149
+ return {
150
+ parts: { ...parts, hour: `0${digit}` },
151
+ done: digit > "2"
152
+ };
153
+ }
119
154
  if (parts.hour === "01" && ["0", "1", "2"].includes(digit)) {
120
155
  return {
121
156
  parts: { ...parts, hour: `1${digit}` },
@@ -147,70 +182,74 @@ function calcDigitInput(parts, item, digit, hourDigitIndex) {
147
182
  }
148
183
  }
149
184
  }
150
- const cvaField = cva(
151
- [
152
- "flex",
153
- "items-center",
154
- "size-full",
155
- "w-23.5",
156
- "bg-ddt-color-common-background-default",
157
- "p-3",
158
- "rounded-sm",
159
- "truncate",
160
- "outline-solid",
161
- "outline-(--color-border)",
162
- "outline-0",
163
- "-outline-offset-2",
164
- "placeholder:text-ddt-color-common-text-secondary",
165
- "[--color-border:var(--color-state-focus,var(--color-base))]",
166
- "border",
167
- "border-(--color-border)",
168
- "enabled:text-ddt-color-common-text-primary",
169
- "enabled:hover:bg-ddt-color-common-surface-hover",
170
- "enabled:active:bg-ddt-color-common-surface-press",
171
- "focus-visible:outline-2",
172
- "disabled:[--color-border:var(--dds-color-common-disabled)]",
173
- "disabled:text-ddt-color-common-disabled",
174
- "disabled:bg-ddt-color-common-background-default",
175
- "disabled:placeholder:text-ddt-color-common-disabled"
176
- ],
177
- {
178
- variants: {
179
- error: {
180
- false: [
181
- "enabled:[--color-base:var(--dds-color-common-neutral-default)]",
182
- "focus-visible:[--color-state-focus:var(--dds-color-common-border-focus)]"
183
- ],
184
- true: ["enabled:[--color-base:var(--dds-color-common-danger-default)]"]
185
- }
186
- }
187
- }
188
- );
185
+ const fieldBaseClass = [
186
+ "flex",
187
+ "items-center",
188
+ "size-full",
189
+ "w-[calc(var(--dds-space-1600)+var(--dds-space-600)+var(--dds-space-100)+var(--dds-space-050))]",
190
+ "bg-ddt-color-common-background-default",
191
+ "px-[calc(var(--dds-padding-30)+0.25rem)]",
192
+ "rounded-sm",
193
+ "truncate",
194
+ "outline-solid",
195
+ "outline-(--color-border)",
196
+ "outline-0",
197
+ "-outline-offset-2",
198
+ "placeholder:text-ddt-color-common-text-secondary",
199
+ "[--color-border:var(--color-state-focus,var(--color-base))]",
200
+ "border",
201
+ "border-(--color-border)",
202
+ "enabled:text-ddt-color-common-text-primary",
203
+ "enabled:hover:bg-ddt-color-common-surface-hover",
204
+ "enabled:active:bg-ddt-color-common-surface-press",
205
+ "focus-visible:outline-2",
206
+ "disabled:[--color-border:var(--dds-color-common-disabled)]",
207
+ "disabled:text-ddt-color-common-disabled",
208
+ "disabled:bg-ddt-color-common-background-default",
209
+ "disabled:placeholder:text-ddt-color-common-disabled"
210
+ ].join(" ");
211
+ function getFieldClass(error) {
212
+ return [
213
+ fieldBaseClass,
214
+ error ? "enabled:[--color-base:var(--dds-color-common-danger-default)]" : "enabled:[--color-base:var(--dds-color-common-neutral-default)] focus-visible:[--color-state-focus:var(--dds-color-common-border-focus)]"
215
+ ].join(" ");
216
+ }
189
217
  let DaikinTimePicker = class extends DDSFormElement {
190
218
  constructor() {
191
219
  super(...arguments);
192
220
  this.disabled = false;
221
+ this.readonly = false;
193
222
  this.required = false;
194
223
  this.error = false;
224
+ this.hourCycle = "h12";
225
+ this.meridiemSingleOpen = true;
195
226
  this._label = null;
196
227
  this._inputValue = "";
197
228
  this._currentSelection = "hour";
198
229
  this._meridiem = "";
199
230
  this._timeInputElement = createRef();
231
+ this._meridiemDropdown = createRef();
200
232
  this._hourDigitIndex = 0;
233
+ this._preCompositionValue = "";
234
+ this._minuteDigitIndex = 0;
201
235
  }
202
236
  /**
203
237
  * Returns the value to be displayed in the input field.
204
- * - If the main value is a valid 24-hour time, returns the 12-hour formatted string for UI display.
238
+ * - If the main value is a valid 24-hour time, returns a display string based on the selected hour cycle.
205
239
  * - If the current input value is not valid or meridiem is empty, returns the raw input value.
206
240
  * - Otherwise, returns null.
207
241
  */
208
242
  get _value() {
209
243
  if (isValidValueTime(this.value)) {
210
- const { time } = from24HourFormat(this.value);
211
- return time;
244
+ const ui = timeValueToUI(this.value, this.hourCycle);
245
+ return formatPartsForUI({ hour: ui.hour, minute: ui.minute });
212
246
  }
213
- if (this._timeValue && !isValidValueTime(this._timeValue) || this._meridiem === "") {
247
+ const needsMeridiem = this.hourCycle === "h12";
248
+ if (this._timeValue && // Show the raw input value when it is not a valid 24h time OR when the
249
+ // UI hour is "00" (intermediate 12h entry state). Without the "00" check,
250
+ // "00:xx" would be treated as valid 24h and the getter would return null,
251
+ // causing Lit to clear the input field.
252
+ (!isValidValueTime(this._timeValue) || parsePartsFromUIValue(this._timeValue).hour === "00") || needsMeridiem && this._meridiem === "") {
214
253
  return this._timeValue;
215
254
  }
216
255
  return null;
@@ -226,8 +265,8 @@ let DaikinTimePicker = class extends DDSFormElement {
226
265
  */
227
266
  _syncMeridiemWithValue() {
228
267
  if (this.value) {
229
- const { meridiem } = from24HourFormat(this.value);
230
- this._meridiem = meridiem;
268
+ const ui = timeValueToUI(this.value, this.hourCycle);
269
+ this._meridiem = ui.meridiem ? ui.meridiem : "";
231
270
  }
232
271
  }
233
272
  get _min() {
@@ -256,10 +295,13 @@ let DaikinTimePicker = class extends DDSFormElement {
256
295
  this._inputValue = "";
257
296
  target.value = "";
258
297
  }
259
- if (target.value.startsWith("00")) {
298
+ const allowZeroHour = this.hourCycle === "h23";
299
+ if (!allowZeroHour && target.value.startsWith("00")) {
260
300
  this._convertZeroHourToTwelve();
301
+ this._updateValue();
261
302
  }
262
303
  this._hourDigitIndex = 0;
304
+ this._minuteDigitIndex = 0;
263
305
  }
264
306
  _handleChange(event) {
265
307
  const target = event.target;
@@ -283,21 +325,103 @@ let DaikinTimePicker = class extends DDSFormElement {
283
325
  this._updateSelection(timeItemInSelection);
284
326
  }
285
327
  }
286
- _handleDigitInput(parts, item, digit, hourDigitIndex) {
287
- if (this._currentSelection === "hour") {
328
+ _handleDigitInput(parts, item, digit, hourDigitIndex, hourCycle) {
329
+ if (item === "hour") {
288
330
  if (hourDigitIndex === 1) {
289
331
  this._hourDigitIndex = 0;
290
332
  } else {
291
333
  this._hourDigitIndex = 1;
292
334
  }
335
+ if (hourDigitIndex === 0) {
336
+ return {
337
+ parts: { ...parts, hour: `0${digit}` },
338
+ done: hourCycle === "h12" ? digit > "1" : digit > "2"
339
+ };
340
+ }
293
341
  }
294
- return calcDigitInput(parts, item, digit, hourDigitIndex);
342
+ if (item === "minute") {
343
+ const minuteDigitIndex = this._minuteDigitIndex;
344
+ if (minuteDigitIndex === 1) {
345
+ this._minuteDigitIndex = 0;
346
+ } else {
347
+ this._minuteDigitIndex = 1;
348
+ }
349
+ if (minuteDigitIndex === 0) {
350
+ return {
351
+ parts: { ...parts, minute: `0${digit}` },
352
+ done: digit > "5"
353
+ };
354
+ }
355
+ }
356
+ return calcDigitInput(parts, item, digit, hourDigitIndex, this.hourCycle);
357
+ }
358
+ // Saves the input's display value when IME composition starts so that
359
+ // _handleCompositionEnd can restore it if the browser inserted raw IME text.
360
+ _handleCompositionStart(event) {
361
+ this._preCompositionValue = event.target.value;
362
+ }
363
+ // Handles compositionend to support full-width and half-width digit input via IME.
364
+ // Full-width digits are converted to half-width, then each digit is applied as if
365
+ // the user had typed them one by one using the existing calcDigitInput logic.
366
+ _handleCompositionEnd(event) {
367
+ if (this.readonly) {
368
+ return;
369
+ }
370
+ const target = event.target;
371
+ const composedText = event.data;
372
+ target.value = this._preCompositionValue || PLACEHOLDER_ALL;
373
+ this._inputValue = target.value;
374
+ const digits = extractHalfWidthDigits(composedText);
375
+ if (digits.length === 0) {
376
+ this._updateInputSelection(target);
377
+ this._updateValue();
378
+ return;
379
+ }
380
+ this._applyDigits(target, digits);
381
+ }
382
+ // Applies a sequence of digit characters to the input starting from the currently
383
+ // selected time item, then commits the result to this.value.
384
+ // Shared by _handleKeyDown (single digit) and _handleCompositionEnd (multiple digits).
385
+ _applyDigits(target, digits) {
386
+ let parts = parsePartsFromUIValue(target.value);
387
+ let currentItem = this._currentSelection;
388
+ for (const digit of digits) {
389
+ const currentIndex = TIME_ITEMS.findIndex(
390
+ ({ type }) => type === currentItem
391
+ );
392
+ if (currentIndex < 0) break;
393
+ const newState = this._handleDigitInput(
394
+ parts,
395
+ currentItem,
396
+ digit,
397
+ this._hourDigitIndex,
398
+ this.hourCycle
399
+ );
400
+ if (newState) {
401
+ parts = newState.parts;
402
+ if (newState.done) {
403
+ const nextIndex = Math.min(currentIndex + 1, TIME_ITEMS.length - 1);
404
+ currentItem = TIME_ITEMS[nextIndex].type;
405
+ }
406
+ }
407
+ }
408
+ const newVal = formatPartsForUI(parts);
409
+ this._inputValue = newVal;
410
+ target.value = newVal;
411
+ this._updateSelection(currentItem);
412
+ this._updateValue();
295
413
  }
296
414
  _handleKeyDown(event) {
415
+ if (this.readonly) {
416
+ return;
417
+ }
418
+ if (event.isComposing || event.key === "Process" || event.keyCode === 229) {
419
+ return;
420
+ }
297
421
  const target = event.target;
298
422
  const key = event.key;
299
423
  const parts = parsePartsFromUIValue(target.value);
300
- if (key === "Backspace") {
424
+ if (key === "Backspace" || key === "Delete") {
301
425
  event.preventDefault();
302
426
  const itemToRemove = this._currentSelection;
303
427
  const placeholder = {
@@ -313,30 +437,12 @@ let DaikinTimePicker = class extends DDSFormElement {
313
437
  target.value = newVal;
314
438
  this._updateSelection(itemToRemove);
315
439
  }
316
- this._updateValue(event);
440
+ this._updateValue();
317
441
  return;
318
442
  }
319
443
  if (/^\d$/.test(key)) {
320
444
  event.preventDefault();
321
- const newState = this._handleDigitInput(
322
- parts,
323
- this._currentSelection,
324
- key,
325
- this._hourDigitIndex
326
- );
327
- if (newState) {
328
- const newVal = formatPartsForUI(newState.parts);
329
- this._inputValue = newVal;
330
- target.value = newVal;
331
- const currentIndex = TIME_ITEMS.findIndex(
332
- ({ type }) => type === this._currentSelection
333
- );
334
- const nextIndex = currentIndex >= 0 ? Math.min(currentIndex + 1, TIME_ITEMS.length - 1) : -1;
335
- this._updateSelection(
336
- newState.done && nextIndex >= 0 ? TIME_ITEMS[nextIndex].type : this._currentSelection
337
- );
338
- }
339
- this._updateValue(event);
445
+ this._applyDigits(target, [key]);
340
446
  return;
341
447
  }
342
448
  const moveOffset = {
@@ -380,7 +486,11 @@ let DaikinTimePicker = class extends DDSFormElement {
380
486
  let minute = parseInt(minuteStr, 10);
381
487
  if (this._currentSelection === "hour") {
382
488
  if (isNaN(hour)) hour = 0;
383
- hour = (hour + offset + 11) % 12 + 1;
489
+ if (this.hourCycle === "h23") {
490
+ hour = (hour + offset + 24) % 24;
491
+ } else {
492
+ hour = (hour + offset + 11) % 12 + 1;
493
+ }
384
494
  } else {
385
495
  if (isNaN(minute)) minute = 0;
386
496
  minute = (minute + offset * Number(this.minutesStep) + 60) % 60;
@@ -393,25 +503,47 @@ let DaikinTimePicker = class extends DDSFormElement {
393
503
  }
394
504
  _handleBeforeInput(event) {
395
505
  event.preventDefault();
396
- this._updateInputSelection(event.target);
506
+ if (!event.isComposing) {
507
+ this._updateSelection(this._currentSelection);
508
+ }
397
509
  }
398
510
  /**
399
- * Updates the value in 24-hour format if the input is valid, keeps UI in 12-hour format.
511
+ * Updates the value in 24-hour format if the input is valid, while preserving the selected UI hour cycle.
400
512
  */
401
513
  _updateValue(event) {
402
514
  const target = (event == null ? void 0 : event.target) || this._timeInputElement.value;
403
515
  if (!target) return;
516
+ const allowZeroHour = this.hourCycle === "h23";
517
+ const needsMeridiem = this.hourCycle === "h12";
404
518
  this._inputValue = target.value;
405
519
  if (target.value === PLACEHOLDER_ALL) {
406
520
  this.error = false;
521
+ this.value = "";
407
522
  return;
408
523
  }
409
- if (this._meridiem === "") {
524
+ if (needsMeridiem && this._meridiem === "") {
410
525
  this.error = true;
526
+ this.value = "";
411
527
  return;
412
528
  }
413
529
  const newTime = tryParseTimeFromUIValue(target.value);
414
- const newValue = newTime != null ? to24HourFormat(newTime, this._meridiem) : "";
530
+ const { hour: uiHour } = parsePartsFromUIValue(target.value);
531
+ if (!allowZeroHour && uiHour === "00") {
532
+ this.error = true;
533
+ this.value = "";
534
+ return;
535
+ }
536
+ const newValue = newTime != null ? uiToTimeValue(
537
+ this.hourCycle === "h23" ? {
538
+ hourCycle: "h23",
539
+ ...parsePartsFromUIValue(newTime),
540
+ meridiem: null
541
+ } : {
542
+ hourCycle: "h12",
543
+ ...parsePartsFromUIValue(newTime),
544
+ meridiem: this._meridiem
545
+ }
546
+ ) : "";
415
547
  this.error = !newValue || isTimeOutOfRange(newValue, this._min, this._max);
416
548
  const changed = newValue !== this.value;
417
549
  this.value = newValue;
@@ -450,13 +582,17 @@ let DaikinTimePicker = class extends DDSFormElement {
450
582
  if (!selection) {
451
583
  return;
452
584
  }
585
+ const allowZeroHour = this.hourCycle === "h23";
453
586
  const itemInfo = TIME_ITEMS.find(({ type }) => type === timeItem);
454
587
  if (itemInfo) {
455
588
  if (itemInfo.type === "minute") {
456
- if (this._inputValue.startsWith("00")) {
589
+ if (!allowZeroHour && this._inputValue.startsWith("00")) {
457
590
  this._convertZeroHourToTwelve();
458
591
  }
459
592
  this._hourDigitIndex = 0;
593
+ if (this._currentSelection !== "minute") {
594
+ this._minuteDigitIndex = 0;
595
+ }
460
596
  }
461
597
  (_a = this._timeInputElement.value) == null ? void 0 : _a.setSelectionRange(
462
598
  itemInfo.range[0],
@@ -466,6 +602,9 @@ let DaikinTimePicker = class extends DDSFormElement {
466
602
  }
467
603
  }
468
604
  _handleDropdownChange(event) {
605
+ if (this.readonly) {
606
+ return;
607
+ }
469
608
  const target = event.target;
470
609
  this._meridiem = target.value;
471
610
  const input = this._timeInputElement.value;
@@ -473,6 +612,33 @@ let DaikinTimePicker = class extends DDSFormElement {
473
612
  this._updateValue();
474
613
  }
475
614
  }
615
+ _closeMeridiemDropdown() {
616
+ const dropdown = this._meridiemDropdown.value;
617
+ if (!dropdown || !dropdown.open) {
618
+ return;
619
+ }
620
+ dropdown.open = false;
621
+ }
622
+ _handleMeridiemDropdownToggle(event) {
623
+ if (!this.meridiemSingleOpen) {
624
+ return;
625
+ }
626
+ const toggleEvent = event;
627
+ if (toggleEvent.newState !== "open") {
628
+ return;
629
+ }
630
+ const root = this.getRootNode();
631
+ if (!(root instanceof Document || root instanceof ShadowRoot)) {
632
+ return;
633
+ }
634
+ const peerTimePickers = root.querySelectorAll("daikin-time-picker");
635
+ for (const peerElement of peerTimePickers) {
636
+ if (peerElement === this) {
637
+ continue;
638
+ }
639
+ peerElement._closeMeridiemDropdown();
640
+ }
641
+ }
476
642
  /**
477
643
  * Focuses on the inner time input.
478
644
  * @param options focus options
@@ -482,38 +648,45 @@ let DaikinTimePicker = class extends DDSFormElement {
482
648
  (_a = this._timeInputElement.value) == null ? void 0 : _a.focus(options);
483
649
  }
484
650
  render() {
651
+ const needsMeridiem = this.hourCycle === "h12";
485
652
  return html`<div
486
653
  role="group"
487
654
  aria-label=${ifDefined(this._label ?? void 0)}
488
- class="flex flex-row h-full gap-2"
655
+ class="flex flex-row h-full gap-2 w-fit"
489
656
  >
490
657
  <input
491
658
  ${ref(this._timeInputElement)}
492
- class=${cvaField({ error: this.error })}
659
+ class=${getFieldClass(this.error)}
493
660
  type="text"
494
661
  name=${ifDefined(this.getBackingProperty("name"))}
495
662
  placeholder=${this.placeholder}
496
663
  .value=${this._value ?? ""}
497
664
  ?disabled=${this.disabled}
665
+ ?readonly=${this.readonly}
498
666
  ?required=${this.required}
499
667
  @change=${this._handleChange}
668
+ @compositionstart=${this._handleCompositionStart}
669
+ @compositionend=${this._handleCompositionEnd}
500
670
  @focusin=${this._handleFocusIn}
501
671
  @focusout=${this._handleFocusOut}
502
672
  @keydown=${this._handleKeyDown}
503
673
  @beforeinput=${this._handleBeforeInput}
504
674
  @mouseup=${this._handleMouseUp}
505
675
  />
506
- <daikin-dropdown
507
- class="w-22"
508
- placeholder="--"
509
- .error=${this.error}
510
- .value=${this._meridiem}
511
- ?disabled=${this.disabled}
512
- @change=${this._handleDropdownChange}
513
- >
514
- <daikin-dropdown-item value="AM">AM</daikin-dropdown-item>
515
- <daikin-dropdown-item value="PM">PM</daikin-dropdown-item>
516
- </daikin-dropdown>
676
+ ${needsMeridiem ? html`<daikin-dropdown
677
+ ${ref(this._meridiemDropdown)}
678
+ class="w-[calc(var(--dds-space-1600)+var(--dds-space-600))]"
679
+ placeholder="--"
680
+ .error=${this.error}
681
+ .value=${this._meridiem}
682
+ ?disabled=${this.disabled}
683
+ ?readonly=${this.readonly}
684
+ @change=${this._handleDropdownChange}
685
+ @toggle=${this._handleMeridiemDropdownToggle}
686
+ >
687
+ <daikin-dropdown-item value="AM">AM</daikin-dropdown-item>
688
+ <daikin-dropdown-item value="PM">PM</daikin-dropdown-item>
689
+ </daikin-dropdown>` : null}
517
690
  </div>`;
518
691
  }
519
692
  willUpdate(changedProperties) {
@@ -529,9 +702,19 @@ let DaikinTimePicker = class extends DDSFormElement {
529
702
  }
530
703
  }
531
704
  }
532
- if (changedProperties.has("value")) {
705
+ if (changedProperties.has("hourCycle")) {
533
706
  if (isValidValueTime(this.value)) {
534
707
  this._syncMeridiemWithValue();
708
+ }
709
+ if (isValidValueTime(this.value)) {
710
+ this.error = isTimeOutOfRange(this.value, this.min, this.max);
711
+ }
712
+ }
713
+ if (changedProperties.has("value")) {
714
+ if (isValidValueTime(this.value)) {
715
+ if (this.hourCycle !== "h23") {
716
+ this._syncMeridiemWithValue();
717
+ }
535
718
  if (isTimeOutOfRange(this.value, this.min, this.max)) {
536
719
  this.error = true;
537
720
  } else {
@@ -552,6 +735,7 @@ let DaikinTimePicker = class extends DDSFormElement {
552
735
  reflectInputGroup(inputGroup) {
553
736
  const isError = !inputGroup.disabled && !!inputGroup.error;
554
737
  this.disabled = !!inputGroup.disabled;
738
+ this.readonly = !!inputGroup.readonly;
555
739
  this.required = !!inputGroup.required;
556
740
  this.error = isError;
557
741
  this._label = inputGroup.label ?? null;
@@ -561,9 +745,27 @@ DaikinTimePicker.styles = css`
561
745
  ${unsafeCSS(tailwindStyles)}
562
746
 
563
747
  :host {
564
- display: flex;
748
+ display: inline-flex;
565
749
  align-items: center;
566
- height: 3rem;
750
+ height: var(--dds-input-height, 3rem);
751
+ width: fit-content;
752
+ }
753
+
754
+ :host([readonly]:not([disabled])) input {
755
+ --color-base: var(--dds-color-common-surface-secondary);
756
+ background-color: var(--dds-color-common-surface-secondary);
757
+ }
758
+
759
+ :host([readonly]:not([disabled])) input:hover,
760
+ :host([readonly]:not([disabled])) input:active {
761
+ --color-base: var(--dds-color-common-surface-secondary);
762
+ background-color: var(--dds-color-common-surface-secondary);
763
+ }
764
+
765
+ :host([readonly][error]:not([disabled])) input,
766
+ :host([readonly][error]:not([disabled])) input:hover,
767
+ :host([readonly][error]:not([disabled])) input:active {
768
+ --color-base: var(--dds-color-common-danger-default);
567
769
  }
568
770
  `;
569
771
  __decorateClass([
@@ -578,12 +780,24 @@ __decorateClass([
578
780
  __decorateClass([
579
781
  property({ type: Boolean, reflect: true })
580
782
  ], DaikinTimePicker.prototype, "disabled", 2);
783
+ __decorateClass([
784
+ property({ type: Boolean, reflect: true })
785
+ ], DaikinTimePicker.prototype, "readonly", 2);
581
786
  __decorateClass([
582
787
  property({ type: Boolean, reflect: true })
583
788
  ], DaikinTimePicker.prototype, "required", 2);
584
789
  __decorateClass([
585
790
  property({ type: Boolean, reflect: true })
586
791
  ], DaikinTimePicker.prototype, "error", 2);
792
+ __decorateClass([
793
+ property({
794
+ type: String,
795
+ reflect: true,
796
+ attribute: "hour-cycle",
797
+ fallbackValue: "h12",
798
+ isAllowedValue: oneOf(["h12", "h23"])
799
+ })
800
+ ], DaikinTimePicker.prototype, "hourCycle", 2);
587
801
  __decorateClass([
588
802
  property({
589
803
  type: String,
@@ -592,6 +806,9 @@ __decorateClass([
592
806
  fallbackValue: "1"
593
807
  })
594
808
  ], DaikinTimePicker.prototype, "minutesStep", 2);
809
+ __decorateClass([
810
+ property({ type: Boolean, reflect: true, attribute: "meridiem-single-open" })
811
+ ], DaikinTimePicker.prototype, "meridiemSingleOpen", 2);
595
812
  __decorateClass([
596
813
  state()
597
814
  ], DaikinTimePicker.prototype, "_label", 2);
@@ -612,11 +829,11 @@ export {
612
829
  calcDigitInput,
613
830
  formatPartsForUI,
614
831
  formatTimeForUI,
615
- from24HourFormat,
616
832
  getTimeItemInSelection,
617
833
  isTimeOutOfRange,
618
834
  isValidValueTime,
619
835
  parsePartsFromUIValue,
620
- to24HourFormat,
621
- tryParseTimeFromUIValue
836
+ timeValueToUI,
837
+ tryParseTimeFromUIValue,
838
+ uiToTimeValue
622
839
  };