@daikin-oss/design-system-web-components 1.2.0 → 1.3.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 (245) hide show
  1. package/CHANGELOG.md +150 -0
  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 +141 -9
  23. package/dist/cjs/components/icon/icons.json.cjs +5 -1
  24. package/dist/cjs/components/icon-button/daikin-icon-button.cjs +12 -2
  25. package/dist/cjs/components/icon-button/daikin-icon-button.d.cts +8 -0
  26. package/dist/cjs/components/index.cjs +36 -0
  27. package/dist/cjs/components/index.d.cts +5 -0
  28. package/dist/cjs/components/input-group/daikin-input-group.cjs +1 -1
  29. package/dist/cjs/components/input-group/daikin-input-group.d.cts +40 -13
  30. package/dist/cjs/components/list-item/daikin-list-item.cjs +2 -2
  31. package/dist/cjs/components/modal-header/daikin-modal-header.cjs +1 -1
  32. package/dist/cjs/components/progress-bar/daikin-progress-bar.cjs +3 -3
  33. package/dist/cjs/components/select/daikin-select.cjs +6 -1
  34. package/dist/cjs/components/tab/daikin-tab.cjs +1 -0
  35. package/dist/cjs/components/table/daikin-table.cjs +33 -12
  36. package/dist/cjs/components/table/daikin-table.d.cts +67 -34
  37. package/dist/cjs/components/table-header-cell/daikin-table-header-cell.cjs +31 -6
  38. package/dist/cjs/components/table-header-cell/daikin-table-header-cell.d.cts +7 -0
  39. package/dist/cjs/components/text-field/daikin-text-field.cjs +191 -56
  40. package/dist/cjs/components/text-field/daikin-text-field.d.cts +32 -3
  41. package/dist/cjs/components/text-field/number-utils.cjs +61 -0
  42. package/dist/cjs/components/text-field/number-utils.d.cts +26 -0
  43. package/dist/cjs/components/text-masked-field/daikin-text-masked-field.cjs +312 -0
  44. package/dist/cjs/components/text-masked-field/daikin-text-masked-field.d.cts +136 -0
  45. package/dist/cjs/components/text-masked-field/index.cjs +7 -0
  46. package/dist/cjs/components/text-masked-field/index.d.cts +1 -0
  47. package/dist/cjs/components/time-picker/daikin-time-picker.cjs +577 -0
  48. package/dist/cjs/components/time-picker/daikin-time-picker.d.cts +165 -0
  49. package/dist/cjs/components/time-picker/index.cjs +17 -0
  50. package/dist/cjs/components/time-picker/index.d.cts +1 -0
  51. package/dist/cjs/components/toast-notification-manager/daikin-toast-notification-manager.d.cts +1 -1
  52. package/dist/cjs/components/tooltip/daikin-tooltip.cjs +12 -2
  53. package/dist/cjs/components/tooltip/daikin-tooltip.d.cts +8 -1
  54. package/dist/cjs/controllers/floating-ui-auto-update.cjs +22 -4
  55. package/dist/cjs/controllers/floating-ui-auto-update.d.cts +12 -0
  56. package/dist/cjs/icon-registry.cjs +170 -0
  57. package/dist/cjs/icon-registry.d.cts +120 -0
  58. package/dist/cjs/index.cjs +39 -0
  59. package/dist/cjs/index.d.cts +1 -0
  60. package/dist/cjs/tailwind.css.cjs +1 -1
  61. package/dist/cjs/utils/notification-common.d.cts +1 -1
  62. package/dist/cjs-dev/base/dds-element.cjs +1 -1
  63. package/dist/cjs-dev/components/accordion-item/daikin-accordion-item.cjs +1 -0
  64. package/dist/cjs-dev/components/avatar/daikin-avatar.cjs +1 -0
  65. package/dist/cjs-dev/components/calendar/daikin-calendar.cjs +2 -0
  66. package/dist/cjs-dev/components/card-header/daikin-card-header.cjs +1 -1
  67. package/dist/cjs-dev/components/carousel/daikin-carousel.cjs +7 -3
  68. package/dist/cjs-dev/components/carousel-item/daikin-carousel-item.cjs +2 -2
  69. package/dist/cjs-dev/components/chip/daikin-chip.cjs +106 -0
  70. package/dist/cjs-dev/components/chip/daikin-chip.d.cts +36 -0
  71. package/dist/cjs-dev/components/chip/index.cjs +7 -0
  72. package/dist/cjs-dev/components/chip/index.d.cts +1 -0
  73. package/dist/cjs-dev/components/combobox/daikin-combobox.cjs +604 -0
  74. package/dist/cjs-dev/components/combobox/daikin-combobox.d.cts +134 -0
  75. package/dist/cjs-dev/components/combobox/index.cjs +8 -0
  76. package/dist/cjs-dev/components/combobox/index.d.cts +1 -0
  77. package/dist/cjs-dev/components/date-picker/daikin-date-picker.cjs +31 -16
  78. package/dist/cjs-dev/components/date-picker/daikin-date-picker.d.cts +2 -1
  79. package/dist/cjs-dev/components/dropdown/daikin-dropdown.cjs +52 -37
  80. package/dist/cjs-dev/components/dropdown/daikin-dropdown.d.cts +4 -3
  81. package/dist/cjs-dev/components/icon/daikin-icon.cjs +141 -16
  82. package/dist/cjs-dev/components/icon/daikin-icon.d.cts +141 -9
  83. package/dist/cjs-dev/components/icon/icons.json.cjs +5 -1
  84. package/dist/cjs-dev/components/icon-button/daikin-icon-button.cjs +12 -2
  85. package/dist/cjs-dev/components/icon-button/daikin-icon-button.d.cts +8 -0
  86. package/dist/cjs-dev/components/index.cjs +36 -0
  87. package/dist/cjs-dev/components/index.d.cts +5 -0
  88. package/dist/cjs-dev/components/input-group/daikin-input-group.cjs +1 -1
  89. package/dist/cjs-dev/components/input-group/daikin-input-group.d.cts +40 -13
  90. package/dist/cjs-dev/components/list-item/daikin-list-item.cjs +2 -2
  91. package/dist/cjs-dev/components/modal-header/daikin-modal-header.cjs +1 -1
  92. package/dist/cjs-dev/components/progress-bar/daikin-progress-bar.cjs +3 -3
  93. package/dist/cjs-dev/components/select/daikin-select.cjs +6 -1
  94. package/dist/cjs-dev/components/tab/daikin-tab.cjs +1 -0
  95. package/dist/cjs-dev/components/table/daikin-table.cjs +36 -15
  96. package/dist/cjs-dev/components/table/daikin-table.d.cts +67 -34
  97. package/dist/cjs-dev/components/table-header-cell/daikin-table-header-cell.cjs +31 -6
  98. package/dist/cjs-dev/components/table-header-cell/daikin-table-header-cell.d.cts +7 -0
  99. package/dist/cjs-dev/components/text-field/daikin-text-field.cjs +191 -56
  100. package/dist/cjs-dev/components/text-field/daikin-text-field.d.cts +32 -3
  101. package/dist/cjs-dev/components/text-field/number-utils.cjs +64 -0
  102. package/dist/cjs-dev/components/text-field/number-utils.d.cts +26 -0
  103. package/dist/cjs-dev/components/text-masked-field/daikin-text-masked-field.cjs +312 -0
  104. package/dist/cjs-dev/components/text-masked-field/daikin-text-masked-field.d.cts +136 -0
  105. package/dist/cjs-dev/components/text-masked-field/index.cjs +7 -0
  106. package/dist/cjs-dev/components/text-masked-field/index.d.cts +1 -0
  107. package/dist/cjs-dev/components/time-picker/daikin-time-picker.cjs +589 -0
  108. package/dist/cjs-dev/components/time-picker/daikin-time-picker.d.cts +165 -0
  109. package/dist/cjs-dev/components/time-picker/index.cjs +17 -0
  110. package/dist/cjs-dev/components/time-picker/index.d.cts +1 -0
  111. package/dist/cjs-dev/components/toast-notification-manager/daikin-toast-notification-manager.d.cts +1 -1
  112. package/dist/cjs-dev/components/tooltip/daikin-tooltip.cjs +12 -2
  113. package/dist/cjs-dev/components/tooltip/daikin-tooltip.d.cts +8 -1
  114. package/dist/cjs-dev/controllers/floating-ui-auto-update.cjs +22 -4
  115. package/dist/cjs-dev/controllers/floating-ui-auto-update.d.cts +12 -0
  116. package/dist/cjs-dev/icon-registry.cjs +170 -0
  117. package/dist/cjs-dev/icon-registry.d.cts +120 -0
  118. package/dist/cjs-dev/index.cjs +39 -0
  119. package/dist/cjs-dev/index.d.cts +1 -0
  120. package/dist/cjs-dev/tailwind.css.cjs +1 -1
  121. package/dist/cjs-dev/utils/notification-common.d.cts +1 -1
  122. package/dist/es/base/dds-element.js +1 -1
  123. package/dist/es/components/accordion-item/daikin-accordion-item.js +1 -0
  124. package/dist/es/components/avatar/daikin-avatar.js +1 -0
  125. package/dist/es/components/calendar/daikin-calendar.js +2 -0
  126. package/dist/es/components/card-header/daikin-card-header.js +1 -1
  127. package/dist/es/components/carousel/daikin-carousel.js +7 -3
  128. package/dist/es/components/carousel-item/daikin-carousel-item.js +2 -2
  129. package/dist/es/components/chip/daikin-chip.d.ts +36 -0
  130. package/dist/es/components/chip/daikin-chip.js +107 -0
  131. package/dist/es/components/chip/index.d.ts +1 -0
  132. package/dist/es/components/chip/index.js +4 -0
  133. package/dist/es/components/combobox/daikin-combobox.d.ts +134 -0
  134. package/dist/es/components/combobox/daikin-combobox.js +605 -0
  135. package/dist/es/components/combobox/index.d.ts +1 -0
  136. package/dist/es/components/combobox/index.js +5 -0
  137. package/dist/es/components/date-picker/daikin-date-picker.d.ts +2 -1
  138. package/dist/es/components/date-picker/daikin-date-picker.js +32 -17
  139. package/dist/es/components/dropdown/daikin-dropdown.d.ts +4 -3
  140. package/dist/es/components/dropdown/daikin-dropdown.js +52 -37
  141. package/dist/es/components/icon/daikin-icon.d.ts +141 -9
  142. package/dist/es/components/icon/daikin-icon.js +118 -13
  143. package/dist/es/components/icon/icons.json.js +4 -0
  144. package/dist/es/components/icon-button/daikin-icon-button.d.ts +8 -0
  145. package/dist/es/components/icon-button/daikin-icon-button.js +12 -2
  146. package/dist/es/components/index.d.ts +5 -0
  147. package/dist/es/components/index.js +22 -1
  148. package/dist/es/components/input-group/daikin-input-group.d.ts +40 -13
  149. package/dist/es/components/input-group/daikin-input-group.js +1 -1
  150. package/dist/es/components/list-item/daikin-list-item.js +2 -2
  151. package/dist/es/components/modal-header/daikin-modal-header.js +1 -1
  152. package/dist/es/components/progress-bar/daikin-progress-bar.js +3 -3
  153. package/dist/es/components/select/daikin-select.js +6 -1
  154. package/dist/es/components/tab/daikin-tab.js +1 -0
  155. package/dist/es/components/table/daikin-table.d.ts +67 -34
  156. package/dist/es/components/table/daikin-table.js +33 -12
  157. package/dist/es/components/table-header-cell/daikin-table-header-cell.d.ts +7 -0
  158. package/dist/es/components/table-header-cell/daikin-table-header-cell.js +31 -6
  159. package/dist/es/components/text-field/daikin-text-field.d.ts +32 -3
  160. package/dist/es/components/text-field/daikin-text-field.js +191 -56
  161. package/dist/es/components/text-field/number-utils.d.ts +26 -0
  162. package/dist/es/components/text-field/number-utils.js +61 -0
  163. package/dist/es/components/text-masked-field/daikin-text-masked-field.d.ts +136 -0
  164. package/dist/es/components/text-masked-field/daikin-text-masked-field.js +313 -0
  165. package/dist/es/components/text-masked-field/index.d.ts +1 -0
  166. package/dist/es/components/text-masked-field/index.js +4 -0
  167. package/dist/es/components/time-picker/daikin-time-picker.d.ts +165 -0
  168. package/dist/es/components/time-picker/daikin-time-picker.js +578 -0
  169. package/dist/es/components/time-picker/index.d.ts +1 -0
  170. package/dist/es/components/time-picker/index.js +14 -0
  171. package/dist/es/components/toast-notification-manager/daikin-toast-notification-manager.d.ts +1 -1
  172. package/dist/es/components/tooltip/daikin-tooltip.d.ts +8 -1
  173. package/dist/es/components/tooltip/daikin-tooltip.js +12 -2
  174. package/dist/es/controllers/floating-ui-auto-update.d.ts +12 -0
  175. package/dist/es/controllers/floating-ui-auto-update.js +22 -4
  176. package/dist/es/icon-registry.d.ts +120 -0
  177. package/dist/es/icon-registry.js +170 -0
  178. package/dist/es/index.d.ts +1 -0
  179. package/dist/es/index.js +25 -1
  180. package/dist/es/tailwind.css.js +1 -1
  181. package/dist/es/utils/notification-common.d.ts +1 -1
  182. package/dist/es-dev/base/dds-element.js +1 -1
  183. package/dist/es-dev/components/accordion-item/daikin-accordion-item.js +1 -0
  184. package/dist/es-dev/components/avatar/daikin-avatar.js +1 -0
  185. package/dist/es-dev/components/calendar/daikin-calendar.js +2 -0
  186. package/dist/es-dev/components/card-header/daikin-card-header.js +1 -1
  187. package/dist/es-dev/components/carousel/daikin-carousel.js +7 -3
  188. package/dist/es-dev/components/carousel-item/daikin-carousel-item.js +2 -2
  189. package/dist/es-dev/components/chip/daikin-chip.d.ts +36 -0
  190. package/dist/es-dev/components/chip/daikin-chip.js +107 -0
  191. package/dist/es-dev/components/chip/index.d.ts +1 -0
  192. package/dist/es-dev/components/chip/index.js +4 -0
  193. package/dist/es-dev/components/combobox/daikin-combobox.d.ts +134 -0
  194. package/dist/es-dev/components/combobox/daikin-combobox.js +605 -0
  195. package/dist/es-dev/components/combobox/index.d.ts +1 -0
  196. package/dist/es-dev/components/combobox/index.js +5 -0
  197. package/dist/es-dev/components/date-picker/daikin-date-picker.d.ts +2 -1
  198. package/dist/es-dev/components/date-picker/daikin-date-picker.js +32 -17
  199. package/dist/es-dev/components/dropdown/daikin-dropdown.d.ts +4 -3
  200. package/dist/es-dev/components/dropdown/daikin-dropdown.js +52 -37
  201. package/dist/es-dev/components/icon/daikin-icon.d.ts +141 -9
  202. package/dist/es-dev/components/icon/daikin-icon.js +142 -17
  203. package/dist/es-dev/components/icon/icons.json.js +4 -0
  204. package/dist/es-dev/components/icon-button/daikin-icon-button.d.ts +8 -0
  205. package/dist/es-dev/components/icon-button/daikin-icon-button.js +12 -2
  206. package/dist/es-dev/components/index.d.ts +5 -0
  207. package/dist/es-dev/components/index.js +22 -1
  208. package/dist/es-dev/components/input-group/daikin-input-group.d.ts +40 -13
  209. package/dist/es-dev/components/input-group/daikin-input-group.js +1 -1
  210. package/dist/es-dev/components/list-item/daikin-list-item.js +2 -2
  211. package/dist/es-dev/components/modal-header/daikin-modal-header.js +1 -1
  212. package/dist/es-dev/components/progress-bar/daikin-progress-bar.js +3 -3
  213. package/dist/es-dev/components/select/daikin-select.js +6 -1
  214. package/dist/es-dev/components/tab/daikin-tab.js +1 -0
  215. package/dist/es-dev/components/table/daikin-table.d.ts +67 -34
  216. package/dist/es-dev/components/table/daikin-table.js +36 -15
  217. package/dist/es-dev/components/table-header-cell/daikin-table-header-cell.d.ts +7 -0
  218. package/dist/es-dev/components/table-header-cell/daikin-table-header-cell.js +31 -6
  219. package/dist/es-dev/components/text-field/daikin-text-field.d.ts +32 -3
  220. package/dist/es-dev/components/text-field/daikin-text-field.js +191 -56
  221. package/dist/es-dev/components/text-field/number-utils.d.ts +26 -0
  222. package/dist/es-dev/components/text-field/number-utils.js +64 -0
  223. package/dist/es-dev/components/text-masked-field/daikin-text-masked-field.d.ts +136 -0
  224. package/dist/es-dev/components/text-masked-field/daikin-text-masked-field.js +313 -0
  225. package/dist/es-dev/components/text-masked-field/index.d.ts +1 -0
  226. package/dist/es-dev/components/text-masked-field/index.js +4 -0
  227. package/dist/es-dev/components/time-picker/daikin-time-picker.d.ts +165 -0
  228. package/dist/es-dev/components/time-picker/daikin-time-picker.js +590 -0
  229. package/dist/es-dev/components/time-picker/index.d.ts +1 -0
  230. package/dist/es-dev/components/time-picker/index.js +14 -0
  231. package/dist/es-dev/components/toast-notification-manager/daikin-toast-notification-manager.d.ts +1 -1
  232. package/dist/es-dev/components/tooltip/daikin-tooltip.d.ts +8 -1
  233. package/dist/es-dev/components/tooltip/daikin-tooltip.js +12 -2
  234. package/dist/es-dev/controllers/floating-ui-auto-update.d.ts +12 -0
  235. package/dist/es-dev/controllers/floating-ui-auto-update.js +22 -4
  236. package/dist/es-dev/icon-registry.d.ts +120 -0
  237. package/dist/es-dev/icon-registry.js +170 -0
  238. package/dist/es-dev/index.d.ts +1 -0
  239. package/dist/es-dev/index.js +25 -1
  240. package/dist/es-dev/tailwind.css.js +1 -1
  241. package/dist/es-dev/utils/notification-common.d.ts +1 -1
  242. package/icons/number-minus.svg +5 -0
  243. package/icons/number-plus.svg +5 -0
  244. package/package.json +14 -4
  245. package/icons/dropdown-chevron-down.svg +0 -3
@@ -9,9 +9,11 @@ export type HeaderType<T extends string = string> = {
9
9
  /**
10
10
  * The table component is a component that can display multiple data objects in a tabular format.
11
11
  *
12
- * It is modeled on the HTML `<table>` element. However, unlike a normal `<table>` element, this component does not require its child elements to have cells. Instead, it can be made to function as a table by giving the properties `headers` and `rows` appropriate arrays.
12
+ * It is modeled on the HTML `<table>` element. However, unlike a normal `<table>` element, this component generates table structure automatically from data. You must provide the `headers` and `rows` properties to define the table structure and content. You can also customize table cell content by providing custom content in slots.
13
13
  *
14
- * If the contents of the table are plain text only, give them to the `rows` property. However, if you want to give contents other than text, such as buttons or images, you will need to prepare a element with the corresponding `slot` attribute. The value of this attribute must be structured as follows: ``slot=${`cell:${headers[i].key}:${rows[i].id}`}``
14
+ * By specifying the `rows` property, you can only display plain text content. If you need to display richer content within the row cells, such as an icon or a button, provide custom content using the cell slot pattern: ``slot=${`cell:${rows[j].id}:${headers[i].key}`}``
15
+ *
16
+ * By specifying the headers property, you can only display plain text, define text alignment and sorting buttons. If you need to display richer content within the header cells, such as an icon or a button, provide custom content using the cell slot pattern: ``slot=${`header:${headers[i].key}`}``
15
17
  *
16
18
  * The table provides two functions: checkboxes and sorting, and you can select the functions you need.
17
19
  *
@@ -34,19 +36,8 @@ export type HeaderType<T extends string = string> = {
34
36
  * ```
35
37
  *
36
38
  * ```html
37
- * <daikin-table
38
- * .headers="[
39
- * { key: 'name', label: 'Name', sortable: true },
40
- * { key: 'season', label: 'Season', sortable: true },
41
- * { key: 'price', label: 'Price', alignment: 'right', sortable: false },
42
- * ]"
43
- * .rows="[
44
- * { id: '1', name: 'Apple', season: 'Autumn', price: '$2' },
45
- * { id: '2', name: 'Peach', season: 'Summer', price: '$4' },
46
- * { id: '3', name: 'Orange', season: 'Winter', price: '$1' },
47
- * { id: '4', name: 'Strawberry', season: 'Spring', price: '$4' },
48
- * ]"
49
- * >
39
+ * <daikin-table>
40
+ * <!-- By using a slot, you can add a subtitle below the content in the name column for each row. -->
50
41
  * <daikin-table-cell slot="cell:1:name">
51
42
  * Apple
52
43
  * <span slot="subtitle">This is a autumn fruit.</span>
@@ -64,6 +55,22 @@ export type HeaderType<T extends string = string> = {
64
55
  * <span slot="subtitle">This is a spring fruit.</span>
65
56
  * </daikin-table-cell>
66
57
  * </daikin-table>
58
+ *
59
+ * <script>
60
+ * // Set up the table data
61
+ * const tableElement = document.querySelector('daikin-table');
62
+ * tableElement.headers = [
63
+ * { key: 'name', label: 'Name', sortable: true },
64
+ * { key: 'season', label: 'Season', sortable: true },
65
+ * { key: 'price', label: 'Price', alignment: 'right', sortable: false },
66
+ * ];
67
+ * tableElement.rows = [
68
+ * { id: '1', name: 'Apple', season: 'Autumn', price: '$2' },
69
+ * { id: '2', name: 'Peach', season: 'Summer', price: '$4' },
70
+ * { id: '3', name: 'Orange', season: 'Winter', price: '$1' },
71
+ * { id: '4', name: 'Strawberry', season: 'Spring', price: '$4' },
72
+ * ];
73
+ * </script>
67
74
  * ```
68
75
  */
69
76
  export declare class DaikinTable<T extends {
@@ -72,51 +79,75 @@ export declare class DaikinTable<T extends {
72
79
  static readonly styles: import('lit').CSSResult;
73
80
  /**
74
81
  * Headers of the table.
75
- * - key: The value of `key` corresponds to the key, excluding the id of rows. As a whole array, the value of `key` must be unique. Also, only use alphanumeric characters, `$`, and `_` in the `key`.
76
- * - label: This is the text that is displayed in the header cells.
77
- * - alignment: The direction in which the characters are aligned can be omitted. If it is omitted, the characters will be aligned to the left.
78
- * - sortable: If sortable (`sortable = true`), this specifies whether sorting is performed on this column.
82
+ * An array of header configuration objects that define the table columns.
83
+ * Each object must have a unique `key` (used to match row data) and a `label` (displayed text).
84
+ *
85
+ * - key: The `key` value corresponds to the property name in the row data (excluding `id`). All `key` values must be unique within the headers array. Use only alphanumeric characters, `$`, and `_` in the `key`.
86
+ * - label: The text displayed in the header cells.
87
+ * - alignment: The text alignment direction. Defaults to left alignment if omitted.
88
+ * - sortable: When `sortable = true`, enables sorting for this column.
89
+ *
90
+ * @example
91
+ * [
92
+ * { key: 'name', label: 'Name', sortable: true },
93
+ * { key: 'price', label: 'Price', alignment: 'right', sortable: false },
94
+ * ]
79
95
  */
80
96
  headers: readonly HeaderType<Extract<keyof T, string>>[];
81
97
  /**
82
98
  * Rows of the table.
83
- * An array that uses the element `key` in the column as the key and stores the corresponding value.
84
- * As a whole array, the value of `id` should be unique.
99
+ * An array of data objects where each object represents a table row.
100
+ * Each object must have a unique `id` property and properties that match the `key` values defined in `headers`.
101
+ *
102
+ * @example
103
+ * [
104
+ * { id: '1', name: 'Apple', price: '$2' },
105
+ * { id: '2', name: 'Orange', price: '$1' },
106
+ * ]
85
107
  */
86
108
  rows: T[];
87
109
  /**
88
- * Whether or not to enable selection of rows.
89
- * If `true`, a checkbox will be displayed to the left of each row.
110
+ * Whether to enable row selection.
111
+ * When `true`, a checkbox will be displayed to the left of each row.
90
112
  */
91
113
  selectable: boolean;
92
114
  /**
93
- * Whether or not to enable sorting of the rows.
94
- * If `true`, a button for sorting will be displayed to the right of each header cell text.
115
+ * Whether to enable row sorting.
116
+ * When `true`, a sort button will be displayed to the right of each sortable header cell.
95
117
  */
96
118
  sortable: boolean;
97
119
  /**
98
- * An array of `id`s for the `rows` that have been checked.
120
+ * An array of `id` values for the selected rows.
99
121
  */
100
122
  selection: string[];
101
- /**
102
- * Sort order of the table.
103
- */
104
- order: "asc" | "desc" | null;
105
123
  /**
106
124
  * The `key` of the currently sorted column.
125
+ * Used with the `order` property to determine which column is sorted and in which direction.
126
+ *
127
+ * For example, if `sort = "name"` and `order = "asc"`, the table will be sorted by the "name" column in ascending order.
107
128
  */
108
129
  sort: keyof T | null;
109
130
  /**
110
- * Specify this when you want to customize the sort function.
111
- * The function must be ascending, and the return value must be `0`, `1` or `-1`.
131
+ * The sort order of the table.
132
+ * Used with the `sort` property.
133
+ *
134
+ * - "asc": ascending order
135
+ * - "desc": descending order
136
+ *
137
+ * For example, if `sort = "price"` and `order = "desc"`, the table will be sorted by the "price" column in descending order.
138
+ */
139
+ order: "asc" | "desc" | null;
140
+ /**
141
+ * Custom sort function for table columns.
142
+ * The function should return a comparison result for ascending order: `0`, `1`, or `-1`.
112
143
  */
113
144
  sortFunction: {
114
145
  [key in keyof T]?: (a: T, b: T, key: key) => number;
115
146
  } | ((a: T, b: T, key: keyof T) => number) | false | null;
116
147
  private _bulkRowsCheckState;
117
148
  /**
118
- * The rows displayed in the current table.
119
- * Currently this is a sorted `rows`, but pagination may be considered in the future.
149
+ * The rows currently displayed in the table.
150
+ * This is a sorted version of `rows`. Pagination may be added in the future.
120
151
  */
121
152
  private _currentView;
122
153
  private _currentTouchHoverRowId;
@@ -130,6 +161,8 @@ export declare class DaikinTable<T extends {
130
161
  private _handleTouchStart;
131
162
  private _handleTouchEnd;
132
163
  private _updateHeaderCheckboxState;
164
+ private _reflectSlotProperties;
165
+ private _handleSlotChange;
133
166
  render(): import('lit-html').TemplateResult<1>;
134
167
  protected willUpdate(changedProperties: PropertyValues<this>): void;
135
168
  protected updated(changedProperties: PropertyValues<this>): void;
@@ -55,8 +55,8 @@ let DaikinTable = class extends DDSElement {
55
55
  this.selectable = false;
56
56
  this.sortable = false;
57
57
  this.selection = [];
58
- this.order = null;
59
58
  this.sort = null;
59
+ this.order = null;
60
60
  this.sortFunction = null;
61
61
  this._bulkRowsCheckState = "unchecked";
62
62
  this._currentView = [];
@@ -132,28 +132,47 @@ let DaikinTable = class extends DDSElement {
132
132
  const selectionCount = this.selection.length;
133
133
  this._bulkRowsCheckState = this._currentView.length === selectionCount ? "checked" : selectionCount ? "indeterminate" : "unchecked";
134
134
  }
135
+ _reflectSlotProperties() {
136
+ var _a;
137
+ for (const { key } of this.headers) {
138
+ const headerCell = (_a = (this.shadowRoot ?? this).querySelector(
139
+ `slot[name="header:${CSS.escape(String(key))}"]`
140
+ )) == null ? void 0 : _a.assignedElements()[0];
141
+ if ((headerCell == null ? void 0 : headerCell.tagName) !== "DAIKIN-TABLE-HEADER-CELL") {
142
+ continue;
143
+ }
144
+ headerCell.order = this.sort === key ? this.order : null;
145
+ }
146
+ }
147
+ _handleSlotChange() {
148
+ this._reflectSlotProperties();
149
+ }
135
150
  render() {
136
151
  const createHeaderRow = () => repeat(
137
152
  this.headers,
138
153
  ({ key }) => key,
139
- ({ key, label, alignment, sortable }) => html`<th
154
+ ({ key, label, alignment, sortable }) => {
155
+ const currentSort = this.sortable && this.sort === key ? this.order === "asc" ? "ascending" : "descending" : void 0;
156
+ return html`<th
140
157
  class="h-full p-0"
141
- aria-sort=${ifDefined(
142
- this.sortable && this.sort === key ? this.order === "asc" ? "ascending" : "descending" : void 0
143
- )}
158
+ aria-sort=${ifDefined(currentSort)}
144
159
  >
145
160
  <slot
146
161
  name=${`header:${key}`}
162
+ data-key=${key}
147
163
  @change-sort=${(event) => this._handleClickSort(event, key)}
164
+ @slotchange=${this._handleSlotChange}
148
165
  >
149
166
  <daikin-table-header-cell
150
167
  alignment=${alignment ?? "left"}
151
168
  ?sortable=${this.sortable && sortable}
169
+ order=${ifDefined(currentSort && this.order)}
152
170
  >
153
171
  ${label}
154
172
  </daikin-table-header-cell>
155
173
  </slot>
156
- </th>`
174
+ </th>`;
175
+ }
157
176
  );
158
177
  const createRow = (item) => repeat(
159
178
  this.headers,
@@ -226,7 +245,7 @@ let DaikinTable = class extends DDSElement {
226
245
  </div>`;
227
246
  }
228
247
  willUpdate(changedProperties) {
229
- const viewChanged = changedProperties.has("rows") || changedProperties.has("sort") || changedProperties.has("order") || changedProperties.has("sortFunction");
248
+ const viewChanged = changedProperties.has("headers") || changedProperties.has("rows") || changedProperties.has("sort") || changedProperties.has("order") || changedProperties.has("sortFunction");
230
249
  const selectionChanged = changedProperties.has("selection");
231
250
  if (viewChanged) {
232
251
  this._updateCurrentView();
@@ -236,20 +255,22 @@ let DaikinTable = class extends DDSElement {
236
255
  }
237
256
  }
238
257
  updated(changedProperties) {
239
- if (changedProperties.has("headers")) {
240
- {
258
+ {
259
+ if (changedProperties.has("headers")) {
241
260
  if (this.headers.length !== [...new Set(this.headers.map(({ key }) => key))].length) {
242
261
  console.warn("The `key` values in `headers` are duplicated");
243
262
  }
244
263
  }
245
- }
246
- if (changedProperties.has("rows")) {
247
- {
264
+ if (changedProperties.has("rows")) {
248
265
  if (this.rows.length !== [...new Set(this.rows.map(({ id }) => id))].length) {
249
266
  console.warn("The `id` values in `rows` are duplicated");
250
267
  }
251
268
  }
252
269
  }
270
+ const sortChanged = changedProperties.has("headers") || changedProperties.has("sort") || changedProperties.has("order");
271
+ if (sortChanged) {
272
+ this._reflectSlotProperties();
273
+ }
253
274
  }
254
275
  };
255
276
  DaikinTable.styles = css`
@@ -258,7 +279,7 @@ DaikinTable.styles = css`
258
279
  :host {
259
280
  display: block;
260
281
  width: 100%;
261
- overflow: scroll;
282
+ overflow: auto;
262
283
  }
263
284
  `;
264
285
  __decorateClass([
@@ -278,10 +299,10 @@ __decorateClass([
278
299
  ], DaikinTable.prototype, "selection", 2);
279
300
  __decorateClass([
280
301
  property({ type: String, reflect: true })
281
- ], DaikinTable.prototype, "order", 2);
302
+ ], DaikinTable.prototype, "sort", 2);
282
303
  __decorateClass([
283
304
  property({ type: String, reflect: true })
284
- ], DaikinTable.prototype, "sort", 2);
305
+ ], DaikinTable.prototype, "order", 2);
285
306
  __decorateClass([
286
307
  property({ attribute: false })
287
308
  ], DaikinTable.prototype, "sortFunction", 2);
@@ -3,6 +3,7 @@ import { MergeVariantProps } from "../../type-utils.js";
3
3
  declare const cvaHeaderCell: (props?: ({
4
4
  alignment?: "center" | "right" | "left" | null | undefined;
5
5
  sortable?: boolean | null | undefined;
6
+ order?: "desc" | "asc" | null | undefined;
6
7
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
8
  type TableHeaderCellVariantProps = MergeVariantProps<typeof cvaHeaderCell>;
8
9
  /**
@@ -44,6 +45,12 @@ export declare class DaikinTableHeaderCell extends DDSElement {
44
45
  * It also makes the component emit the `change-sort` event when clicked.
45
46
  */
46
47
  sortable: boolean;
48
+ /**
49
+ * The current sort order of the column.
50
+ * Can be "asc", "desc", or null if not sorted.
51
+ * Controlled by `daikin-table`.
52
+ */
53
+ order: TableHeaderCellVariantProps["order"] | null;
47
54
  render(): import('lit-html').TemplateResult<1>;
48
55
  }
49
56
  declare global {
@@ -44,11 +44,31 @@ const cvaHeaderCell = cva(
44
44
  "focus-visible:-outline-offset-2",
45
45
  "focus-visible:outline-ddt-color-common-border-focus",
46
46
  "after:flex-none",
47
- "after:size-6",
48
- "after:i-daikin-sort"
47
+ "after:size-6"
49
48
  ]
49
+ },
50
+ order: {
51
+ asc: [],
52
+ desc: []
50
53
  }
51
- }
54
+ },
55
+ compoundVariants: [
56
+ {
57
+ sortable: true,
58
+ order: null,
59
+ class: ["after:i-daikin-sort"]
60
+ },
61
+ {
62
+ sortable: true,
63
+ order: "asc",
64
+ class: ["after:i-daikin-chevron-up"]
65
+ },
66
+ {
67
+ sortable: true,
68
+ order: "desc",
69
+ class: ["after:i-daikin-chevron-up", "after:rotate-180"]
70
+ }
71
+ ]
52
72
  }
53
73
  );
54
74
  let DaikinTableHeaderCell = class extends DDSElement {
@@ -56,14 +76,16 @@ let DaikinTableHeaderCell = class extends DDSElement {
56
76
  super(...arguments);
57
77
  this.alignment = "left";
58
78
  this.sortable = false;
79
+ this.order = null;
59
80
  }
60
81
  render() {
61
82
  const headerCellCN = cvaHeaderCell({
62
83
  alignment: this.alignment,
63
- sortable: this.sortable
84
+ sortable: this.sortable,
85
+ order: this.order === "asc" || this.order === "desc" ? this.order : null
64
86
  });
65
- const content = html`<slot name="left-icon" class="icon-size-6"></slot>
66
- <slot></slot>`;
87
+ const content = html`<slot name="left-icon" class="icon-size-6"></slot
88
+ ><slot></slot>`;
67
89
  return this.sortable ? html`<button
68
90
  type="button"
69
91
  class=${headerCellCN}
@@ -88,6 +110,9 @@ __decorateClass([
88
110
  __decorateClass([
89
111
  property({ type: Boolean, reflect: true })
90
112
  ], DaikinTableHeaderCell.prototype, "sortable", 2);
113
+ __decorateClass([
114
+ property({ type: String, reflect: true })
115
+ ], DaikinTableHeaderCell.prototype, "order", 2);
91
116
  DaikinTableHeaderCell = __decorateClass([
92
117
  ddsElement("daikin-table-header-cell")
93
118
  ], DaikinTableHeaderCell);
@@ -15,10 +15,18 @@ import { DaikinInputGroup } from "../input-group/index.js";
15
15
  * @fires toggle - Emitted when the user toggles the password mask.
16
16
  *
17
17
  * @slot left-icon - Specify the icon you want to use on the left. You can also use something other than `daikin-icon`.
18
- * Ignored if the type is "search" since the default icon is used.
18
+ * Available only if the type is one of:
19
+ * - `"text"`
20
+ * - `"number"`
21
+ * - `"password"`
22
+ * - `"email"`
23
+ * - `"tel"`
19
24
  *
20
25
  * @slot right-icon - Specify the icon you want to use on the right. You can also use something other than `daikin-icon`.
21
- * Ignored if the type is "search" since the default icon is used.
26
+ * Available only if the type is one of:
27
+ * - `"text"`
28
+ * - `"email"`
29
+ * - `"tel"`
22
30
  *
23
31
  * @example
24
32
  *
@@ -35,8 +43,15 @@ export declare class DaikinTextField extends DDSFormElement {
35
43
  static readonly styles: import('lit').CSSResult;
36
44
  /**
37
45
  * Type of field.
46
+ *
47
+ * - `"text"`: Basic text input with optional left and right icon slots.
48
+ * - `"number"`: Numeric input with increment/decrement buttons, arrow key support, and optional left icon slot.
49
+ * - `"password"`: Password input with show/hide toggle button to control mask of password and optional left icon slot.
50
+ * - `"email"`: Email input with optional left and right icon slots.
51
+ * - `"tel"`: Telephone input with optional left and right icon slots.
52
+ * - `"search"`: Search input with built-in search icon and clear button when value is present.
38
53
  */
39
- type: "text" | "password" | "email" | "tel" | "search";
54
+ type: "text" | "number" | "password" | "email" | "tel" | "search";
40
55
  /**
41
56
  * Placeholder text.
42
57
  */
@@ -69,6 +84,18 @@ export declare class DaikinTextField extends DDSFormElement {
69
84
  * Maximum length of value.
70
85
  */
71
86
  maxlength: number | null;
87
+ /**
88
+ * Interval between values. This is valid when `type="number"`.
89
+ */
90
+ step: string | null;
91
+ /**
92
+ * The minimum value. This is valid when `type="number"`.
93
+ */
94
+ min: string | null;
95
+ /**
96
+ * The maximum value. This is valid when `type="number"`.
97
+ */
98
+ max: string | null;
72
99
  /**
73
100
  * The pattern of value.
74
101
  */
@@ -92,6 +119,8 @@ export declare class DaikinTextField extends DDSFormElement {
92
119
  private _handleSlotChange;
93
120
  private _handleInput;
94
121
  private _handleClearClick;
122
+ private _handleKeyDown;
123
+ private _updateNumberValue;
95
124
  private _createIcon;
96
125
  private _handleShowPasswordClick;
97
126
  render(): TemplateResult<1>;