@duetds/components 4.35.4 → 5.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 (332) hide show
  1. package/hydrate/index.js +1708 -1055
  2. package/lib/cjs/duet-action-button.cjs.entry.js +163 -0
  3. package/lib/cjs/duet-alert.cjs.entry.js +1 -1
  4. package/lib/cjs/duet-badge.cjs.entry.js +1 -1
  5. package/lib/cjs/duet-breadcrumb.cjs.entry.js +1 -1
  6. package/lib/cjs/duet-breadcrumbs.cjs.entry.js +1 -1
  7. package/lib/cjs/duet-button_2.cjs.entry.js +14 -5
  8. package/lib/cjs/duet-caption_4.cjs.entry.js +3 -3
  9. package/lib/cjs/duet-card.cjs.entry.js +4 -4
  10. package/lib/cjs/duet-checkbox.cjs.entry.js +1 -1
  11. package/lib/cjs/duet-choice_2.cjs.entry.js +3 -3
  12. package/lib/cjs/duet-collapsible.cjs.entry.js +4 -4
  13. package/lib/cjs/duet-cookie-consent.cjs.entry.js +1 -1
  14. package/lib/cjs/duet-date-picker.cjs.entry.js +4 -4
  15. package/lib/cjs/duet-divider_2.cjs.entry.js +1 -1
  16. package/lib/cjs/{duet-editable-table_4.cjs.entry.js → duet-editable-table_3.cjs.entry.js} +382 -346
  17. package/lib/cjs/duet-empty-state.cjs.entry.js +1 -1
  18. package/lib/cjs/duet-fieldset.cjs.entry.js +1 -1
  19. package/lib/cjs/duet-footer.cjs.entry.js +1 -1
  20. package/lib/cjs/duet-grid_2.cjs.entry.js +2 -2
  21. package/lib/cjs/duet-header_2.cjs.entry.js +4 -4
  22. package/lib/cjs/duet-hero.cjs.entry.js +1 -1
  23. package/lib/cjs/duet-icon.cjs.entry.js +3 -3
  24. package/lib/cjs/duet-input_2.cjs.entry.js +1 -1
  25. package/lib/cjs/duet-layout.cjs.entry.js +1 -1
  26. package/lib/cjs/duet-list_2.cjs.entry.js +1 -1
  27. package/lib/cjs/duet-modal.cjs.entry.js +3 -3
  28. package/lib/cjs/duet-notification_2.cjs.entry.js +1 -1
  29. package/lib/cjs/duet-number-input.cjs.entry.js +2 -2
  30. package/lib/cjs/duet-pagination_2.cjs.entry.js +458 -0
  31. package/lib/cjs/duet-progress.cjs.entry.js +1 -1
  32. package/lib/cjs/duet-radio_2.cjs.entry.js +1 -1
  33. package/lib/cjs/duet-range-slider.cjs.entry.js +2 -2
  34. package/lib/cjs/duet-scrollable_3.cjs.entry.js +3 -3
  35. package/lib/cjs/duet-select.cjs.entry.js +16 -4
  36. package/lib/cjs/duet-step_2.cjs.entry.js +2 -2
  37. package/lib/cjs/duet-textarea.cjs.entry.js +1 -1
  38. package/lib/cjs/duet-toggle.cjs.entry.js +1 -1
  39. package/lib/cjs/duet-tooltip.cjs.entry.js +1 -1
  40. package/lib/cjs/duet-tray.cjs.entry.js +2 -2
  41. package/lib/cjs/duet-upload-aria-status.cjs.entry.js +1 -1
  42. package/lib/cjs/duet-visually-hidden.cjs.entry.js +1 -1
  43. package/lib/cjs/duet.cjs.js +2 -2
  44. package/lib/cjs/{focus-utils-eb8c5b20.js → focus-utils-7a11c463.js} +1 -1
  45. package/lib/cjs/{index-6ae8090f.js → index-da5d5aaf.js} +4 -1
  46. package/lib/cjs/js-utils-be1d29ae.js +39 -0
  47. package/lib/cjs/{keyboard-utils-b4e3d1d3.js → keyboard-utils-898cfe14.js} +8 -0
  48. package/lib/cjs/loader.cjs.js +2 -2
  49. package/lib/cjs/{token-utils-05bd23b4.js → token-utils-ac8432d1.js} +10 -7
  50. package/lib/cjs/{tokens-8596cece.js → tokens-72efc7fd.js} +0 -0
  51. package/lib/cjs/{tokens.module-6b2df1c2.js → tokens.module-6afcc9c1.js} +0 -0
  52. package/lib/collection/collection-manifest.json +22 -11
  53. package/lib/collection/components/duet-action-button/duet-action-button.css +87 -0
  54. package/lib/collection/components/duet-action-button/duet-action-button.js +489 -0
  55. package/lib/collection/components/duet-button/duet-button.css +3 -0
  56. package/lib/collection/components/duet-button/duet-button.js +50 -1
  57. package/lib/collection/components/duet-card/duet-card.js +1 -1
  58. package/lib/collection/components/duet-collapsible/duet-collapsible.js +2 -1
  59. package/lib/collection/components/duet-date-picker/duet-date-picker.css +2 -57
  60. package/lib/collection/components/duet-date-picker/duet-date-picker.js +2 -6
  61. package/lib/collection/components/duet-editable-table/duet-editable-table-tabledata.js +3 -2
  62. package/lib/collection/components/duet-editable-table/duet-editable-table.css +20 -1
  63. package/lib/collection/components/duet-editable-table/duet-editable-table.js +331 -205
  64. package/lib/collection/components/duet-pagination/duet-pagination-utils.js +9 -0
  65. package/lib/collection/components/duet-pagination/duet-pagination.css +61 -0
  66. package/lib/collection/components/duet-pagination/duet-pagination.js +541 -0
  67. package/lib/collection/components/duet-range-stepper/duet-range-stepper.css +49 -0
  68. package/lib/collection/components/duet-range-stepper/duet-range-stepper.js +340 -0
  69. package/lib/collection/components/duet-select/duet-select.css +26 -0
  70. package/lib/collection/components/duet-select/duet-select.js +39 -4
  71. package/lib/collection/components/duet-tab-group/duet-tab-group.js +5 -1
  72. package/lib/collection/components/duet-table/duet-table.css +42 -8
  73. package/lib/collection/components/duet-table/duet-table.js +11 -2
  74. package/lib/collection/components/duet-upload/duet-upload.css +25 -0
  75. package/lib/collection/components/duet-upload/duet-upload.js +270 -166
  76. package/lib/collection/components/duet-upload/upload-validators.js +1 -1
  77. package/lib/collection/utils/fixture-utils.js +3 -5
  78. package/lib/collection/utils/js-utils.js +36 -1
  79. package/lib/collection/utils/keyboard-utils.js +4 -0
  80. package/lib/collection/utils/test-utils.js +2 -1
  81. package/lib/collection/utils/token-utils.js +33 -6
  82. package/lib/custom-elements-bundle/index.d.ts +18 -12
  83. package/lib/custom-elements-bundle/index.js +1653 -1046
  84. package/lib/duet/duet.esm.js +1 -1
  85. package/lib/duet/duet.js +1 -1
  86. package/lib/duet/{p-503f1286.entry.js → p-00209700.entry.js} +1 -1
  87. package/lib/duet/{p-76fa8882.entry.js → p-01144f93.entry.js} +1 -1
  88. package/lib/duet/{p-ec2aea5f.system.entry.js → p-021bf3a2.system.entry.js} +1 -1
  89. package/lib/duet/{p-0169d57e.entry.js → p-04c6e557.entry.js} +1 -1
  90. package/lib/duet/{p-03a5fe42.system.entry.js → p-06fd151e.system.entry.js} +1 -1
  91. package/lib/duet/p-0988f548.entry.js +4 -0
  92. package/lib/duet/{p-d5a4b17f.system.entry.js → p-0e1130a0.system.entry.js} +1 -1
  93. package/lib/duet/{p-e4e99da0.entry.js → p-0fedc1c6.entry.js} +1 -1
  94. package/lib/duet/{p-2c85e001.system.entry.js → p-111b70c5.system.entry.js} +1 -1
  95. package/lib/duet/p-12825e2c.entry.js +4 -0
  96. package/lib/duet/p-166c09ce.system.entry.js +4 -0
  97. package/lib/duet/{p-8367a2d1.entry.js → p-1be45fc6.entry.js} +1 -1
  98. package/lib/duet/{p-253fd12a.system.entry.js → p-1da57e19.system.entry.js} +1 -1
  99. package/lib/duet/{p-b72ed5ef.system.entry.js → p-21c9efa8.system.entry.js} +1 -1
  100. package/lib/duet/{p-01679b51.entry.js → p-2245c56b.entry.js} +1 -1
  101. package/lib/duet/p-2273fc88.js +4 -0
  102. package/lib/duet/{p-5630828a.system.entry.js → p-232762b3.system.entry.js} +1 -1
  103. package/lib/duet/{p-3025a411.system.js → p-251dc733.system.js} +1 -1
  104. package/lib/duet/{p-ddb6344c.system.js → p-268c0abb.system.js} +0 -0
  105. package/lib/duet/{p-9077cd24.system.entry.js → p-2b6dac5c.system.entry.js} +1 -1
  106. package/lib/duet/{p-bba528b5.entry.js → p-35cdec32.entry.js} +1 -1
  107. package/lib/duet/{p-ee598605.entry.js → p-37bdfcc6.entry.js} +1 -1
  108. package/lib/duet/{p-c3d552d5.entry.js → p-3c7d81b0.entry.js} +1 -1
  109. package/lib/duet/{p-824d2360.system.entry.js → p-3f77090f.system.entry.js} +1 -1
  110. package/lib/duet/{p-7b451394.system.js → p-3fafe82f.system.js} +1 -1
  111. package/lib/duet/{p-2395f96e.system.entry.js → p-4b221aa3.system.entry.js} +1 -1
  112. package/lib/duet/{p-4ea864dd.system.entry.js → p-4b7b1d2a.system.entry.js} +1 -1
  113. package/lib/duet/p-4c282c1a.entry.js +4 -0
  114. package/lib/duet/p-51a7c020.entry.js +4 -0
  115. package/lib/duet/{p-e8ce8394.entry.js → p-5298f6fb.entry.js} +1 -1
  116. package/lib/duet/p-5746d88c.js +4 -0
  117. package/lib/duet/{p-dfd96467.entry.js → p-589c2f28.entry.js} +1 -1
  118. package/lib/duet/{p-f98fca13.system.entry.js → p-592315ca.system.entry.js} +1 -1
  119. package/lib/duet/{p-6cff80cb.system.entry.js → p-59a0ec33.system.entry.js} +1 -1
  120. package/lib/duet/p-5e1f64cb.entry.js +4 -0
  121. package/lib/duet/{p-73b5248d.entry.js → p-608645ed.entry.js} +1 -1
  122. package/lib/duet/{p-8ea92cc5.entry.js → p-683f1962.entry.js} +1 -1
  123. package/lib/duet/{p-55fff1fe.entry.js → p-6932c6d8.entry.js} +1 -1
  124. package/lib/duet/{p-731444f6.entry.js → p-6934cb1b.entry.js} +1 -1
  125. package/lib/duet/{p-caab828f.system.entry.js → p-6d209c01.system.entry.js} +1 -1
  126. package/lib/duet/{p-61198eee.system.entry.js → p-70e5c803.system.entry.js} +1 -1
  127. package/lib/duet/p-74780bca.system.js +4 -0
  128. package/lib/duet/p-74d267d3.system.entry.js +4 -0
  129. package/lib/duet/{p-2bfe8b50.system.entry.js → p-766daacb.system.entry.js} +1 -1
  130. package/lib/duet/p-77acbfe4.system.js +4 -0
  131. package/lib/duet/p-7953cff9.system.entry.js +4 -0
  132. package/lib/duet/{p-01f3fbd4.system.entry.js → p-7e939e57.system.entry.js} +1 -1
  133. package/lib/duet/{p-fa99eaa4.system.js → p-812b0905.system.js} +0 -0
  134. package/lib/duet/{p-c122428f.entry.js → p-814ed07c.entry.js} +1 -1
  135. package/lib/duet/{p-04304e51.entry.js → p-82a0e535.entry.js} +1 -1
  136. package/lib/duet/{p-4a60b131.system.entry.js → p-8338702d.system.entry.js} +1 -1
  137. package/lib/duet/{p-e682d701.system.entry.js → p-85b4b5c0.system.entry.js} +2 -2
  138. package/lib/duet/{p-e3229d0d.entry.js → p-86538787.entry.js} +1 -1
  139. package/lib/duet/p-898f30a5.js +4 -0
  140. package/lib/duet/{p-40a76f20.entry.js → p-8f01f647.entry.js} +1 -1
  141. package/lib/duet/{p-a39a0a45.entry.js → p-8f6def3f.entry.js} +1 -1
  142. package/lib/duet/{p-753098ec.entry.js → p-90464434.entry.js} +1 -1
  143. package/lib/duet/p-92639d0b.system.js +4 -0
  144. package/lib/duet/{p-873e4c51.system.entry.js → p-97f95c02.system.entry.js} +2 -2
  145. package/lib/duet/{p-ea30becb.system.entry.js → p-982deb44.system.entry.js} +1 -1
  146. package/lib/duet/{p-7fd62541.entry.js → p-9dc88c43.entry.js} +1 -1
  147. package/lib/duet/{p-412f58cf.entry.js → p-a37e57d8.entry.js} +1 -1
  148. package/lib/duet/{p-da1f6193.system.entry.js → p-a71510b8.system.entry.js} +1 -1
  149. package/lib/duet/p-a8eec12e.system.entry.js +4 -0
  150. package/lib/duet/{p-4d8cd455.system.entry.js → p-abcfbb23.system.entry.js} +1 -1
  151. package/lib/duet/{p-99262d61.entry.js → p-ac2b38e6.entry.js} +1 -1
  152. package/lib/duet/{p-24b4eefb.system.entry.js → p-ace2cd17.system.entry.js} +1 -1
  153. package/lib/duet/{p-94a2da86.system.entry.js → p-ad278903.system.entry.js} +1 -1
  154. package/lib/duet/{p-a0deb526.entry.js → p-aea907ad.entry.js} +1 -1
  155. package/lib/duet/{p-9690681b.system.entry.js → p-b432d318.system.entry.js} +1 -1
  156. package/lib/duet/{p-44fe8367.system.entry.js → p-b4e75f80.system.entry.js} +1 -1
  157. package/lib/duet/{p-c1b34a78.system.entry.js → p-b8c8105c.system.entry.js} +1 -1
  158. package/lib/duet/{p-efd978ee.entry.js → p-ba7480e9.entry.js} +1 -1
  159. package/lib/duet/p-bc7dba26.entry.js +4 -0
  160. package/lib/duet/{p-a926b44b.entry.js → p-bf06f635.entry.js} +1 -1
  161. package/lib/duet/p-c6ccf366.system.entry.js +4 -0
  162. package/lib/duet/{p-7cdb8bfa.entry.js → p-cd1a767f.entry.js} +1 -1
  163. package/lib/duet/p-d6d9b0c6.system.entry.js +4 -0
  164. package/lib/duet/{p-8143f3de.js → p-d7bc0102.js} +0 -0
  165. package/lib/duet/{p-fb98ac5a.entry.js → p-d9e329c0.entry.js} +1 -1
  166. package/lib/duet/p-dbb4a588.js +4 -0
  167. package/lib/duet/{p-f51f8554.entry.js → p-dc67d989.entry.js} +1 -1
  168. package/lib/duet/{p-a69667c7.entry.js → p-de9ff67c.entry.js} +1 -1
  169. package/lib/duet/{p-0f185a8a.system.entry.js → p-deb8ac4d.system.entry.js} +1 -1
  170. package/lib/duet/p-e2e0bc49.system.js +4 -0
  171. package/lib/duet/{p-6b24111b.system.entry.js → p-e624799f.system.entry.js} +1 -1
  172. package/lib/duet/{p-8973aa31.system.entry.js → p-e887d6db.system.entry.js} +1 -1
  173. package/lib/duet/p-e9c3053b.js +4 -0
  174. package/lib/duet/{p-a212f672.system.entry.js → p-ebed7c5e.system.entry.js} +1 -1
  175. package/lib/duet/{p-ad07f399.js → p-ed75c8b3.js} +0 -0
  176. package/lib/duet/{p-4a931c6c.system.entry.js → p-f020852e.system.entry.js} +1 -1
  177. package/lib/duet/p-f2abd301.entry.js +4 -0
  178. package/lib/duet/{p-fc35b926.system.entry.js → p-f54d1487.system.entry.js} +1 -1
  179. package/lib/duet/{p-17f85b90.entry.js → p-fc44a819.entry.js} +1 -1
  180. package/lib/duet/{p-bc6794bc.system.entry.js → p-fcdd24f8.system.entry.js} +1 -1
  181. package/lib/duet/{p-5e895b06.entry.js → p-fed35d92.entry.js} +1 -1
  182. package/lib/duet/{p-de5c3a36.entry.js → p-ff308f4c.entry.js} +1 -1
  183. package/lib/esm/duet-action-button.entry.js +159 -0
  184. package/lib/esm/duet-alert.entry.js +1 -1
  185. package/lib/esm/duet-badge.entry.js +1 -1
  186. package/lib/esm/duet-breadcrumb.entry.js +1 -1
  187. package/lib/esm/duet-breadcrumbs.entry.js +1 -1
  188. package/lib/esm/duet-button_2.entry.js +14 -5
  189. package/lib/esm/duet-caption_4.entry.js +3 -3
  190. package/lib/esm/duet-card.entry.js +4 -4
  191. package/lib/esm/duet-checkbox.entry.js +1 -1
  192. package/lib/esm/duet-choice_2.entry.js +3 -3
  193. package/lib/esm/duet-collapsible.entry.js +4 -4
  194. package/lib/esm/duet-cookie-consent.entry.js +1 -1
  195. package/lib/esm/duet-date-picker.entry.js +4 -4
  196. package/lib/esm/duet-divider_2.entry.js +1 -1
  197. package/lib/esm/{duet-editable-table_4.entry.js → duet-editable-table_3.entry.js} +384 -347
  198. package/lib/esm/duet-empty-state.entry.js +1 -1
  199. package/lib/esm/duet-fieldset.entry.js +1 -1
  200. package/lib/esm/duet-footer.entry.js +1 -1
  201. package/lib/esm/duet-grid_2.entry.js +2 -2
  202. package/lib/esm/duet-header_2.entry.js +4 -4
  203. package/lib/esm/duet-hero.entry.js +1 -1
  204. package/lib/esm/duet-icon.entry.js +3 -3
  205. package/lib/esm/duet-input_2.entry.js +1 -1
  206. package/lib/esm/duet-layout.entry.js +1 -1
  207. package/lib/esm/duet-list_2.entry.js +1 -1
  208. package/lib/esm/duet-modal.entry.js +3 -3
  209. package/lib/esm/duet-notification_2.entry.js +1 -1
  210. package/lib/esm/duet-number-input.entry.js +2 -2
  211. package/lib/esm/duet-pagination_2.entry.js +453 -0
  212. package/lib/esm/duet-progress.entry.js +1 -1
  213. package/lib/esm/duet-radio_2.entry.js +1 -1
  214. package/lib/esm/duet-range-slider.entry.js +2 -2
  215. package/lib/esm/duet-scrollable_3.entry.js +3 -3
  216. package/lib/esm/duet-select.entry.js +16 -4
  217. package/lib/esm/duet-step_2.entry.js +2 -2
  218. package/lib/esm/duet-textarea.entry.js +1 -1
  219. package/lib/esm/duet-toggle.entry.js +1 -1
  220. package/lib/esm/duet-tooltip.entry.js +1 -1
  221. package/lib/esm/duet-tray.entry.js +2 -2
  222. package/lib/esm/duet-upload-aria-status.entry.js +1 -1
  223. package/lib/esm/duet-visually-hidden.entry.js +1 -1
  224. package/lib/esm/duet.js +2 -2
  225. package/lib/esm/{focus-utils-6db957a7.js → focus-utils-b0b3361f.js} +1 -1
  226. package/lib/esm/{index-828dfb4e.js → index-16f4da7f.js} +4 -1
  227. package/lib/esm/js-utils-52e0944c.js +36 -0
  228. package/lib/esm/{keyboard-utils-584cedd7.js → keyboard-utils-6eb55cd5.js} +5 -1
  229. package/lib/esm/loader.js +2 -2
  230. package/lib/esm/{token-utils-75f78ca4.js → token-utils-e9a0cb88.js} +10 -7
  231. package/lib/esm/{tokens-e110dc89.js → tokens-57d98824.js} +0 -0
  232. package/lib/esm/{tokens.module-49cbf963.js → tokens.module-a13e9683.js} +0 -0
  233. package/lib/esm-es5/duet-action-button.entry.js +4 -0
  234. package/lib/esm-es5/duet-alert.entry.js +1 -1
  235. package/lib/esm-es5/duet-badge.entry.js +1 -1
  236. package/lib/esm-es5/duet-breadcrumb.entry.js +1 -1
  237. package/lib/esm-es5/duet-breadcrumbs.entry.js +1 -1
  238. package/lib/esm-es5/duet-button_2.entry.js +1 -1
  239. package/lib/esm-es5/duet-caption_4.entry.js +1 -1
  240. package/lib/esm-es5/duet-card.entry.js +1 -1
  241. package/lib/esm-es5/duet-checkbox.entry.js +1 -1
  242. package/lib/esm-es5/duet-choice_2.entry.js +1 -1
  243. package/lib/esm-es5/duet-collapsible.entry.js +1 -1
  244. package/lib/esm-es5/duet-cookie-consent.entry.js +1 -1
  245. package/lib/esm-es5/duet-date-picker.entry.js +2 -2
  246. package/lib/esm-es5/duet-divider_2.entry.js +1 -1
  247. package/lib/esm-es5/duet-editable-table_3.entry.js +4 -0
  248. package/lib/esm-es5/duet-empty-state.entry.js +1 -1
  249. package/lib/esm-es5/duet-fieldset.entry.js +1 -1
  250. package/lib/esm-es5/duet-footer.entry.js +1 -1
  251. package/lib/esm-es5/duet-grid_2.entry.js +1 -1
  252. package/lib/esm-es5/duet-header_2.entry.js +1 -1
  253. package/lib/esm-es5/duet-hero.entry.js +1 -1
  254. package/lib/esm-es5/duet-icon.entry.js +1 -1
  255. package/lib/esm-es5/duet-input_2.entry.js +1 -1
  256. package/lib/esm-es5/duet-layout.entry.js +1 -1
  257. package/lib/esm-es5/duet-list_2.entry.js +1 -1
  258. package/lib/esm-es5/duet-modal.entry.js +1 -1
  259. package/lib/esm-es5/duet-notification_2.entry.js +1 -1
  260. package/lib/esm-es5/duet-number-input.entry.js +1 -1
  261. package/lib/esm-es5/duet-pagination_2.entry.js +4 -0
  262. package/lib/esm-es5/duet-progress.entry.js +1 -1
  263. package/lib/esm-es5/duet-radio_2.entry.js +1 -1
  264. package/lib/esm-es5/duet-range-slider.entry.js +1 -1
  265. package/lib/esm-es5/duet-scrollable_3.entry.js +1 -1
  266. package/lib/esm-es5/duet-select.entry.js +2 -2
  267. package/lib/esm-es5/duet-step_2.entry.js +1 -1
  268. package/lib/esm-es5/duet-textarea.entry.js +1 -1
  269. package/lib/esm-es5/duet-toggle.entry.js +1 -1
  270. package/lib/esm-es5/duet-tooltip.entry.js +1 -1
  271. package/lib/esm-es5/duet-tray.entry.js +1 -1
  272. package/lib/esm-es5/duet-upload-aria-status.entry.js +1 -1
  273. package/lib/esm-es5/duet-visually-hidden.entry.js +1 -1
  274. package/lib/esm-es5/duet.js +1 -1
  275. package/lib/esm-es5/focus-utils-b0b3361f.js +4 -0
  276. package/lib/esm-es5/{index-828dfb4e.js → index-16f4da7f.js} +1 -1
  277. package/lib/esm-es5/js-utils-52e0944c.js +4 -0
  278. package/lib/esm-es5/keyboard-utils-6eb55cd5.js +4 -0
  279. package/lib/esm-es5/loader.js +1 -1
  280. package/lib/esm-es5/token-utils-e9a0cb88.js +4 -0
  281. package/lib/esm-es5/{tokens-e110dc89.js → tokens-57d98824.js} +0 -0
  282. package/lib/esm-es5/{tokens.module-49cbf963.js → tokens.module-a13e9683.js} +0 -0
  283. package/lib/html.html-data.json +5266 -0
  284. package/lib/types/components/duet-action-button/duet-action-button.d.ts +112 -0
  285. package/lib/types/components/duet-button/duet-button.d.ts +9 -0
  286. package/lib/types/components/duet-card/duet-card.d.ts +1 -1
  287. package/lib/types/components/duet-collapsible/duet-collapsible.d.ts +1 -0
  288. package/lib/types/components/duet-editable-table/duet-editable-table-tabledata.d.ts +2 -2
  289. package/lib/types/components/duet-editable-table/duet-editable-table.d.ts +106 -48
  290. package/lib/types/components/duet-pagination/duet-pagination-utils.d.ts +1 -0
  291. package/lib/types/components/duet-pagination/duet-pagination.d.ts +105 -0
  292. package/lib/types/components/duet-range-stepper/duet-range-stepper.d.ts +70 -0
  293. package/lib/types/components/duet-select/duet-select.d.ts +5 -0
  294. package/lib/types/components/duet-tab-group/duet-tab-group.d.ts +4 -0
  295. package/lib/types/components/duet-table/duet-table.d.ts +16 -0
  296. package/lib/types/components/duet-upload/duet-upload.d.ts +68 -58
  297. package/lib/types/components.d.ts +402 -140
  298. package/lib/types/utils/js-utils.d.ts +2 -0
  299. package/lib/types/utils/keyboard-utils.d.ts +4 -0
  300. package/lib/types/utils/token-utils.d.ts +2 -0
  301. package/package.json +5 -6
  302. package/lib/cjs/duet-editable-table-button.cjs.entry.js +0 -96
  303. package/lib/collection/components/duet-editable-table/duet-editable-table-button.css +0 -32
  304. package/lib/collection/components/duet-editable-table/duet-editable-table-button.js +0 -225
  305. package/lib/collection/components/duet-editable-table/duet-editable-table-item.css +0 -36
  306. package/lib/collection/components/duet-editable-table/duet-editable-table-item.js +0 -225
  307. package/lib/duet/p-0427e1a5.entry.js +0 -4
  308. package/lib/duet/p-04f9f1bf.js +0 -4
  309. package/lib/duet/p-0f91d386.system.entry.js +0 -4
  310. package/lib/duet/p-227e5196.js +0 -4
  311. package/lib/duet/p-2545734a.entry.js +0 -4
  312. package/lib/duet/p-2b8316ee.system.entry.js +0 -4
  313. package/lib/duet/p-477c2e5c.entry.js +0 -4
  314. package/lib/duet/p-50b4fb2c.js +0 -4
  315. package/lib/duet/p-66bf27b9.system.entry.js +0 -4
  316. package/lib/duet/p-68ecdc4f.system.entry.js +0 -4
  317. package/lib/duet/p-853cd059.js +0 -4
  318. package/lib/duet/p-a16a58c1.system.js +0 -4
  319. package/lib/duet/p-b0c16ee5.entry.js +0 -4
  320. package/lib/duet/p-b3a2a1e8.entry.js +0 -4
  321. package/lib/duet/p-bb12b972.system.js +0 -4
  322. package/lib/duet/p-c63e49e2.system.entry.js +0 -4
  323. package/lib/duet/p-e6349dd2.entry.js +0 -4
  324. package/lib/duet/p-ef3fc3f3.system.js +0 -4
  325. package/lib/esm/duet-editable-table-button.entry.js +0 -92
  326. package/lib/esm-es5/duet-editable-table-button.entry.js +0 -4
  327. package/lib/esm-es5/duet-editable-table_4.entry.js +0 -4
  328. package/lib/esm-es5/focus-utils-6db957a7.js +0 -4
  329. package/lib/esm-es5/keyboard-utils-584cedd7.js +0 -4
  330. package/lib/esm-es5/token-utils-75f78ca4.js +0 -4
  331. package/lib/types/components/duet-editable-table/duet-editable-table-button.d.ts +0 -73
  332. package/lib/types/components/duet-editable-table/duet-editable-table-item.d.ts +0 -76
@@ -5,294 +5,228 @@
5
5
 
6
6
  Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
- const index = require('./index-6ae8090f.js');
8
+ const index = require('./index-da5d5aaf.js');
9
+ const jsUtils = require('./js-utils-be1d29ae.js');
10
+ const keyboardUtils = require('./keyboard-utils-898cfe14.js');
9
11
  const languageUtils = require('./language-utils-aa282901.js');
10
12
  const themeableComponent = require('./themeable-component-0c1be552.js');
11
- const tokens_module = require('./tokens.module-6b2df1c2.js');
13
+ const tokens_module = require('./tokens.module-6afcc9c1.js');
12
14
  const createId = require('./create-id-c3b984b1.js');
13
15
  require('./string-utils-267e3dbb.js');
14
16
 
15
- const debounce = (func, timeout = 50) => {
16
- let timer;
17
- return (...args) => {
18
- clearTimeout(timer);
19
- timer = setTimeout(() => {
20
- func.apply(undefined, args);
21
- }, timeout);
22
- };
23
- };
24
-
25
- /**
26
- * Produces a function which uses template strings to do simple interpolation from objects.
27
- *
28
- * Usage:
29
- * var makeMeKing = generateTemplateFn('${name} is now the king of ${country}!');
30
- *
31
- * console.log(makeMeKing({ name: 'Bryan', country: 'Scotland'}));
32
- * // Logs 'Bryan is now the king of Scotland!'
33
- */
34
- const generateTemplateFn = (function () {
35
- const cache = {};
36
- function generateTemplate(template) {
37
- if (typeof template !== "string") {
38
- template = template.outerHTML;
39
- }
40
- let fn = cache[template];
41
- if (!fn) {
42
- // Replace ${expressions} (etc) with ${map.expressions}.
43
- const sanitized = template
44
- .replace(/\$\{([\s]*[^;\s\{]+[\s]*)\}/g, function (_, match) {
45
- return `\$\{map.${match.trim()}\}`;
46
- })
47
- // Afterwards, replace anything that's not ${map.expressions}' (etc) with a blank string.
48
- .replace(/(\$\{(?!map\.)[^}]+\})/g, "");
49
- fn = Function("map", `return \`${sanitized}\``);
50
- }
51
- return fn;
17
+ //simple functional component that renders the data in the table
18
+ const TableData = ({ data, groupId, alignment }, _children) => {
19
+ const classNames = `duet-editable-table duet-editable-table-content-${groupId}`;
20
+ if (typeof data === "string") {
21
+ return index.h("td", { innerHTML: data, class: classNames, part: `${groupId}content`, style: { verticalAlign: alignment } });
22
+ }
23
+ else {
24
+ return (index.h("td", { class: classNames, part: `${groupId}content`, style: { verticalAlign: alignment } }, data));
52
25
  }
53
- return generateTemplate;
54
- })();
26
+ };
55
27
 
56
- const duetEditableTableCss = "duet-editable-table{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.duet-editable-table-header tr .duet-editable-table-header-hidden{padding:0 !important;font-size:0;border-bottom:0}";
28
+ const duetEditableTableCss = ".sc-duet-editable-table-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.duet-editable-table-actions-menu.sc-duet-editable-table{position:relative;padding:0 !important;margin:0}.duet-editable-table-actions-menu-button.sc-duet-editable-table{position:relative;right:-16px;float:right;padding:0}.duet-editable-table-actions-menu-icon.sc-duet-editable-table .duet-icon.sc-duet-editable-table{max-width:16px;max-height:16px}.duet-editable-table-row.duet-table-action-row.sc-duet-editable-table .duet-text-right.sc-duet-editable-table{text-align:right}.duet-editable-table-header.sc-duet-editable-table tr.sc-duet-editable-table .duet-editable-table-header-hidden.sc-duet-editable-table{padding:0 !important;font-size:0;border-bottom:0}";
57
29
 
58
30
  let DuetEditableTable = class {
59
31
  constructor(hostRef) {
60
32
  index.registerInstance(this, hostRef);
61
- this.template = undefined;
33
+ this.duetTableToggle = index.createEvent(this, "duetTableToggle", 7);
34
+ this.duetMenuClick = index.createEvent(this, "duetMenuClick", 7);
62
35
  /**
63
- * State() variables
64
- * @internal
36
+ * Duet-table: margin of the component.
65
37
  */
66
- this.tick = Date.now();
38
+ this.margin = "auto";
67
39
  /**
68
- * Map of items that contain list of things.
40
+ * Duet-table: Style variation of the table.
69
41
  */
70
- this.items = new Map();
42
+ this.variation = "striped";
71
43
  /**
72
- * Key used to set vertical alignment of action buttons
44
+ * Duet-table: Controls whether the table has a sticky header.
45
+ * Sticky headers are not compatible with breakpoint="none-scrollable".
73
46
  */
74
- this.alignment = "middle";
47
+ this.sticky = false;
48
+ /**
49
+ * Duet-table: Adjust the distance from top of the viewport (in pixels) when the
50
+ * table header becomes sticky.
51
+ */
52
+ this.stickyDistance = "with-links";
75
53
  /**
76
- * Array of internationalized defaults for the default groups labels.
54
+ * Duet-table: By default the table is responsive - it will be flattened at narrow viewport widths.
55
+ * This prop controls the breakpoint at which the table should be rendered as a _regular_ table.
56
+ * Set to "none" to disable the responsive functionality.
57
+ * Set to "none-scrollable" to disable responsive functionality _and_ allow horizontal scrolling -
58
+ * this is useful for comparison tables where it's important to maintain column and row layout.
77
59
  */
78
- this.groupsLabelDefaults = {
79
- fi: "Kaikki",
80
- en: "All items",
81
- sv: "Alla objekt",
82
- };
60
+ this.breakpoint = "small";
83
61
  /**
84
- * Array of internationalized defaults for the default action labels.
62
+ * Define actions for all items in a table
63
+ * An alternative to inline HTML table.
64
+ * required for Sortable tables
65
+ * @default undefined
85
66
  */
86
- this.actionLabelDefaults = {
87
- fi: "Toiminnot",
88
- en: "Actions",
89
- sv: "Handlingar",
90
- };
67
+ this.actions = undefined;
91
68
  /**
92
- * Array of group names that you want the editable table to display (can be used to hide or show groups depending on conditions).
93
- * @default { id: "all", label: this.groupsLabelDefaults, actionLabel: this.actionLabelDefaults }.
94
- * @example [{ id: "success", label: {fi: "Onnistunut", en: "Success", sv: "Alt klart", }}].
69
+ * Define columns for a table
70
+ * An alternative to inline HTML table.
71
+ * required for Sortable tables
72
+ * @default undefined
95
73
  */
96
- this.groups = [
97
- { id: "all", label: this.groupsLabelDefaults, actionLabel: this.actionLabelDefaults },
98
- ];
74
+ this.columns = undefined;
99
75
  /**
100
- * Array of actions that are mapped via the map variable to the various groups defined in group.
76
+ * Define rows for a table
77
+ * An alternative to inline HTML table.
78
+ * required for Sortable tables
101
79
  * @default undefined
102
- * @example [{
103
- variation: "default",
104
- icon: "action-edit-2",
105
- id: "edit",
106
- map: ["success"],
107
- label: {
108
- fi: " Label",
109
- en: " Label",
110
- sv: " Label",
111
- }
112
- }]
113
80
  */
114
- this.actions = undefined;
81
+ this.rows = undefined;
115
82
  /**
116
- * Shows or hides the table labels.
83
+ * Controls whether the table is sortable by headers
117
84
  */
118
- this.hideGroups = false;
85
+ this.sortable = false;
119
86
  /**
120
- * Exposes the aria role for optimizing accessibility.
87
+ * Optional id that get passed to the table and used to setup ::parts
121
88
  */
122
- this.accessibleRole = undefined;
89
+ this.groupId = "";
123
90
  /**
124
91
  * Theme of the table.
125
92
  */
126
93
  this.theme = "";
127
94
  /**
128
- * Private methods.
95
+ * Exposes the aria role for optimizing accessibility.
129
96
  */
130
- this.kick = debounce(() => {
131
- this.tick = Date.now();
132
- }, 100); // will trigger re-render
97
+ this.accessibleRole = undefined;
98
+ this.sortableDefaultLabel = {
99
+ fi: "Järjestä",
100
+ en: "Click to sort",
101
+ sv: "Klicka för att sortera",
102
+ };
103
+ this.actionColumnLabel = {
104
+ en: "Actions for rows",
105
+ fi: "Toiminnot rivillä",
106
+ sv: "Åtgärder för rader",
107
+ };
133
108
  /**
134
- * If a user defines a template section within editable table, try to read an use it.
109
+ * Private methods.
135
110
  */
136
- this.getTemplate = () => {
137
- const templateDom = this.element.getElementsByTagName("template");
138
- if (templateDom === null || templateDom === void 0 ? void 0 : templateDom.length) {
139
- const templateString = templateDom[0].content.firstElementChild.outerHTML;
140
- return generateTemplateFn(templateString);
141
- }
142
- else {
143
- return false;
144
- }
145
- };
146
- this.getItemData = (data) => {
147
- const { item, group, uid } = data;
148
- if (this.template) {
149
- return {
150
- group,
151
- uid,
152
- item: this.template(item),
153
- };
154
- }
155
- return { item, group, uid };
111
+ this.toggleColumn = (column, e) => {
112
+ e.preventDefault();
113
+ const { sort_order, direction, index, key } = column;
114
+ this.duetTableToggle.emit({
115
+ sort_order,
116
+ index,
117
+ direction,
118
+ key,
119
+ component: "duet-editable-table",
120
+ originalEvent: e,
121
+ });
156
122
  };
157
- this.filterMap = needle => {
158
- if (needle === "all") {
159
- return Array.from(this.items);
123
+ this.handleKeyDown = (column, e) => {
124
+ if (keyboardUtils.isKeyboardClick(e)) {
125
+ this.toggleColumn(column, e);
160
126
  }
161
- return Array.from(this.items).filter(item => needle === item[1].group);
162
127
  };
163
128
  }
164
129
  /**
165
130
  * Component lifecycle events.
166
131
  */
167
132
  componentWillLoad() {
168
- // look for a <template> region in the duet-editable-table
169
- this.template = this.getTemplate();
170
- // take care of the case where groups and actions are defined as html properties instead of javascript objects
171
- if (typeof this.groups === "string") {
172
- this.internalGroupArray = languageUtils.sanitizeString(this.groups);
173
- }
174
- else {
175
- this.internalGroupArray = this.groups;
176
- }
177
- if (typeof this.actions === "string") {
178
- this.internalActionsArray = languageUtils.sanitizeString(this.actions);
179
- }
180
- else {
181
- this.internalActionsArray = this.actions;
182
- }
183
133
  themeableComponent.inheritGlobalTheme(this);
184
134
  }
185
- /**
186
- * Method to force an update of a tabular data array.
187
- * when called the method will rerender the entire tabular structure.
188
- */
189
- async updateTable(passedItems = undefined) {
190
- this.items = new Map(passedItems || this.items);
191
- this.kick();
192
- }
193
- render() {
194
- return (index.h(index.Host, { class: {
195
- "duet-theme-turva": this.theme === "turva",
196
- } }, this.internalGroupArray.map(group => {
197
- const currentGroup = this.filterMap(group.id);
198
- if (!currentGroup.length) {
199
- return;
135
+ createLabel(column) {
136
+ const { sort_order, direction, index: index$1, label } = column;
137
+ const i18nLabel = languageUtils.getLocaleString(label);
138
+ if (!this.sortable) {
139
+ return i18nLabel;
140
+ }
141
+ const getButtonIcon = () => {
142
+ // "action-subtract-small" https://cdn.duetds.com/api/icons/2.2.12/lib/assets/action-subtract-small.svg
143
+ // "action-arrow-down-small" https://cdn.duetds.com/api/icons/2.2.12/lib/assets/action-arrow-down-small.svg
144
+ // "action-arrow-up-small" https://cdn.duetds.com/api/icons/2.2.12/lib/assets/action-arrow-up-small.svg
145
+ if (!!sort_order && direction === 1) {
146
+ return "action-arrow-down-small";
200
147
  }
201
- return (index.h("duet-table", { variation: "plain", breakpoint: "none", role: "", margin: this.hideGroups ? "none" : "auto" }, index.h("table", { class: "duet-editable-table", "aria-role": this.accessibleRole }, index.h("thead", { class: "duet-editable-table-header" }, index.h("tr", null, index.h("th", { class: {
202
- "duet-editable-table-header-hidden": this.hideGroups,
203
- } }, !this.hideGroups ? (languageUtils.getLocaleString(group.label)) : (index.h("duet-visually-hidden", null, languageUtils.getLocaleString(group.label)))), index.h("th", { class: {
204
- "duet-editable-table-header-hidden": this.hideGroups,
205
- } }, index.h("duet-visually-hidden", null, group.actionLabel
206
- ? languageUtils.getLocaleString(group.actionLabel)
207
- : languageUtils.getLocaleString(this.actionLabelDefaults))))), index.h("tbody", null, currentGroup.map(dataAsArray => {
208
- const [key, value] = dataAsArray;
209
- return (index.h("duet-editable-table-item", { theme: this.theme, keyName: key, data: this.getItemData(value), groupId: group.id, part: group.id, alignment: this.alignment, actions: this.internalActionsArray }));
210
- })))));
211
- })));
148
+ else if (!!sort_order && direction === -1) {
149
+ return "action-arrow-up-small";
150
+ }
151
+ return "action-subtract-small";
152
+ };
153
+ return (index.h("span", { class: "duet-table-label", "data-index": index$1 }, index.h("duet-button", { size: "small", icon: getButtonIcon(), "icon-size": "medium-small", "accessible-label": languageUtils.getLocaleString(this.sortableDefaultLabel), variation: "plain", margin: "none", "icon-right": true, onClick: event => this.toggleColumn(column, event), onKeyDown: event => this.handleKeyDown(column, event) }, i18nLabel)));
212
154
  }
213
- get element() { return index.getElement(this); }
214
- };
215
- DuetEditableTable.style = duetEditableTableCss;
216
-
217
- //simple functional component that renders the data in the table
218
- const TableData = ({ data, groupId, alignment }, _children) => {
219
- if (typeof data === "string") {
220
- return (index.h("td", { innerHTML: data, class: "duet-editable-table-content", part: `${groupId}content`, style: { verticalAlign: alignment } }));
155
+ getSortedColumns() {
156
+ //create a new array from sort instead of mutating original
157
+ return [...this.columns].sort(jsUtils.fieldSorter(["index"]));
221
158
  }
222
- else {
223
- return (index.h("td", { class: "duet-editable-table-content", part: `${groupId}content`, style: { verticalAlign: alignment } }, data));
159
+ getRowSortOrder() {
160
+ //create a new array from sort instead of mutating original
161
+ const fields = [...this.columns].sort(jsUtils.fieldSorter(["sort_order"]));
162
+ //return only key from objects that have sort_order
163
+ return fields
164
+ .filter(column => column.sort_order)
165
+ .map(column => {
166
+ // add - in-front of descending direction (required by field-sorter)
167
+ return column.direction === -1 ? `-${column.key}` : column.key;
168
+ });
224
169
  }
225
- };
226
-
227
- const duetEditableTableItemCss = "*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{display:table-row;height:32px}.duet-editable-table-content,.duet-editable-table-actions{height:32px;padding:12px 0;vertical-align:middle;break-word:break-all;border-bottom:1px solid #e1e3e6}.duet-editable-table-actions-items{display:flex;justify-content:flex-end}.duet-editable-table-actions-items duet-editable-table-button{padding-left:8px}.duet-editable-table .editable-item-small{font-size:0.75rem;font-weight:400}";
228
-
229
- let DuetEditableTableItem = class {
230
- constructor(hostRef) {
231
- index.registerInstance(this, hostRef);
232
- this.duetEditableItemAction = index.createEvent(this, "duetEditableItemAction", 7);
233
- this.isHovering = false;
234
- /**
235
- * Theme of the empty state component.
236
- */
237
- this.theme = "";
238
- /**
239
- * Actions that can be performed on the element
240
- */
241
- this.actions = undefined;
242
- /**
243
- * GroupId used to pierce the shadowdom - gets concatenated with "content & actions" and used as part="groupIDcontent/actions" to pierce the content/Action item
244
- * @internal
245
- */
246
- this.groupId = "";
247
- /**
248
- * Key used to set vertical alignment of action buttons
249
- */
250
- this.alignment = "middle";
251
- /**
252
- * Key used to identify item, when running actions
253
- */
254
- this.keyName = "";
255
- /**
256
- * Object of data itemsused to render the entire row
257
- */
258
- this.data = undefined;
170
+ renderTableHeader() {
171
+ if (!this.columns) {
172
+ return;
173
+ }
174
+ const sortedColumns = this.getSortedColumns();
175
+ return (index.h("tr", { class: {
176
+ "duet-table-action-header": !!this.actions,
177
+ } }, sortedColumns.map(column => {
178
+ if (column.display !== false) {
179
+ return index.h("th", { scope: "col" }, this.createLabel(column));
180
+ }
181
+ }), this.actions && (index.h("th", { scope: "col", class: "duet-table-action-header-heading" }, this.actions && index.h("duet-visually-hidden", null, languageUtils.getLocaleString(this.actionColumnLabel))))));
259
182
  }
260
- watchPropHandler(_newValue, _oldValue) {
261
- // console.log("The new value of activated is: ", _newValue)
183
+ renderActions(rowItem, index$1) {
184
+ // escape early
185
+ if (!this.actions) {
186
+ return;
187
+ }
188
+ // iterate through actions and add them in the sidebar
189
+ return (index.h("td", { class: "duet-text-right" }, this.actions.map(actionItem => {
190
+ return (index.h("duet-action-button", { actionMeta: Object.assign({}, (rowItem === null || rowItem === void 0 ? void 0 : rowItem.meta) || {}, { index: index$1 }), actionId: (rowItem === null || rowItem === void 0 ? void 0 : rowItem.uid) || (rowItem === null || rowItem === void 0 ? void 0 : rowItem.id) || null, actionName: actionItem.name, theme: this.theme, iconName: actionItem.icon, iconColor: actionItem.color, iconSize: actionItem.size, background: actionItem.background }));
191
+ })));
262
192
  }
263
- /**
264
- /**
265
- * Component lifecycle events.
266
- */
267
- componentWillLoad() {
268
- themeableComponent.inheritGlobalTheme(this);
193
+ renderTableBody() {
194
+ const columns = this.getSortedColumns();
195
+ const rowSortOrder = this.getRowSortOrder();
196
+ const sortedRows = [...this.rows].sort(jsUtils.fieldSorter(rowSortOrder));
197
+ // return a tbody with rows for each item in sortedRows
198
+ return sortedRows.map((row, index$1) => (index.h("tr", { class: {
199
+ "duet-table-action-row": !!this.actions,
200
+ "duet-editable-table-row": true,
201
+ [`duet-editable-table-row-${this.groupId}`]: true,
202
+ }, "data-meta": JSON.stringify(row.meta) }, columns.map(column => {
203
+ //if we don't have any data for this column, try getting an item instead (for backwards compatibility
204
+ const value = row[column.key] ? row[column.key] : row.item;
205
+ if (column.display !== false) {
206
+ return index.h(TableData, { data: value, groupId: this.groupId });
207
+ }
208
+ }), this.actions && this.renderActions(row, index$1))));
269
209
  }
270
210
  /**
271
- /**
272
- * private functions
273
- */
274
- /**
275
- * render() function
276
- * Always the last one in the class.
211
+ * Render Methods
277
212
  */
278
213
  render() {
279
- return (index.h(index.Host, { role: "row" }, index.h(TableData, { data: this.data.item, alignment: this.alignment, groupId: this.groupId }), index.h("td", { class: "duet-editable-table-actions", style: { verticalAlign: this.alignment } }, index.h("div", { class: "duet-editable-table-actions-items", part: `${this.groupId}actions` }, this.actions.map(result => {
280
- const { map = undefined } = result;
281
- // if map has been specified, only show the current action if groupID matches the map array
282
- if (map && !map.includes(this.groupId)) {
283
- return;
284
- }
285
- return (index.h("duet-editable-table-button", { keyName: this.keyName, group: this.data.group, uid: this.data.uid, actions: result, theme: this.theme }));
286
- })))));
214
+ return (index.h(index.Host, { class: {
215
+ [`duet-editable-table-${this.variation}`]: true,
216
+ [`duet-editable-table-${this.theme}`]: true,
217
+ // sticky only valid when in regular table layout
218
+ "duet-editable-table-scrollable": this.breakpoint === "none-scrollable",
219
+ "duet-editable-table-sortable": this.sortable,
220
+ "duet-editable-table-actions": !!this.actions,
221
+ "duet-m-0": this.margin === "none",
222
+ "duet-theme-turva": this.theme === "turva",
223
+ } }, index.h("duet-table", { sticky: this.sticky, stickyDistance: this.stickyDistance, margin: this.margin, theme: this.theme, variation: this.variation, breakpoint: this.breakpoint }, index.h("table", { role: this.accessibleRole }, index.h("caption", null, index.h("slot", { name: "tcaption" })), index.h("thead", null, index.h("tr", null, index.h("td", { class: "duet-editable-table-actions-menu", colSpan: 99 }, index.h("slot", { name: "thead-first" }))), this.renderTableHeader(), index.h("tr", null, index.h("td", { class: "duet-editable-table-actions-menu", colSpan: 99 }, index.h("slot", { name: "thead-last" })))), index.h("tbody", null, this.renderTableBody()), index.h("tfoot", null, index.h("tr", null, index.h("th", { class: "duet-editable-table-footer-menu", colSpan: 99 }, index.h("slot", { name: "tfoot" }))))))));
287
224
  }
288
- get el() { return index.getElement(this); }
289
- static get watchers() { return {
290
- "data": ["watchPropHandler"]
291
- }; }
225
+ get element() { return index.getElement(this); }
292
226
  };
293
- DuetEditableTableItem.style = duetEditableTableItemCss;
227
+ DuetEditableTable.style = duetEditableTableCss;
294
228
 
295
- const duetTableCss = "duet-table{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-bottom:20px !important;display:block;font-variant-numeric:tabular-nums}duet-table table,duet-table thead,duet-table tbody,duet-table tfoot,duet-table th,duet-table td,duet-table tr{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}duet-table.duet-m-0{margin:0 !important}duet-table table{width:100%;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-size:1rem;text-align:left;border-spacing:0;border-collapse:separate}duet-table.duet-theme-turva table{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"}duet-table td{-webkit-hyphens:auto;hyphens:auto;color:#00294d}duet-table.duet-theme-turva td{color:#171c3a}duet-table th{font-weight:600;line-height:1.25;color:#657787;text-align:left}duet-table.duet-theme-turva th{color:#747475}duet-table tbody th{font-weight:600;color:#00294d}duet-table.duet-theme-turva tbody th{color:#171c3a}.duet-table-flattened table,.duet-table-flattened thead,.duet-table-flattened tbody,.duet-table-flattened tfoot,.duet-table-flattened th,.duet-table-flattened td,.duet-table-flattened tr{display:block}.duet-table-flattened thead tr{position:absolute !important;top:0;width:1px !important;height:1px !important;padding:0 !important;overflow:hidden !important;clip:rect(1px, 1px, 1px, 1px) !important;border:0 !important}.duet-table-flattened td{line-height:1.25}.duet-table-flattened td:not(:last-child){margin-bottom:16px !important}.duet-table-flattened tbody td,.duet-table-flattened tbody th,.duet-table-flattened tfoot td{padding:0 !important;text-align:left !important}.duet-table-flattened tbody th{font-weight:600;line-height:1.25;color:#657787;text-align:left}.duet-table-flattened td[data-heading]::before{margin-bottom:4px !important;display:block;font-size:1rem;font-weight:600;color:#00294d;content:attr(data-heading)}.duet-table-flattened.duet-theme-turva td[data-heading]::before{color:#171c3a}.duet-table-sticky thead th{position:sticky;top:0;background:white}.duet-table-striped td,.duet-table-striped th{padding:20px !important}@media (max-width: 35.9375em){.duet-table-striped td,.duet-table-striped th{padding:20px 12px !important}}.duet-table-striped tbody th{background:white}.duet-table-striped.duet-table-sticky thead th{border-bottom:1px solid #e1e3e6}.duet-table-striped.duet-table-sticky.duet-theme-turva thead th{border-bottom-color:#e4e4e6}.duet-table-striped tbody:not(:first-of-type) th{padding-top:40px !important}.duet-table-striped tbody:only-of-type tr:nth-of-type(odd){background:rgba(0, 80, 128, 0.04)}.duet-table-striped.duet-theme-turva tbody:only-of-type tr:nth-of-type(odd){background:rgba(23, 28, 58, 0.04)}.duet-table-striped tbody:not(:only-of-type) tr:nth-of-type(even){background:rgba(0, 80, 128, 0.04)}.duet-table-striped.duet-theme-turva tbody:not(:only-of-type) tr:nth-of-type(even){background:rgba(23, 28, 58, 0.04)}.duet-table-striped tfoot td{border-top:1px solid #e1e3e6}.duet-table-striped.duet-theme-turva tfoot td{border-top-color:#e4e4e6}.duet-table-striped.duet-table-flattened tbody:not(:first-of-type) th{padding-top:20px !important}.duet-table-striped.duet-table-flattened tr{padding:20px !important}.duet-table-striped.duet-table-flattened tfoot td{border-top:0}.duet-table-striped.duet-table-flattened tfoot tr{border-top:1px solid #e1e3e6}.duet-table-striped.duet-table-flattened.duet-theme-turva tfoot tr{border-top-color:#e4e4e6}.duet-table-fixed th,.duet-table-minimal th,.duet-table-plain th{padding:16px !important;border-bottom:1px solid #657787}.duet-table-fixed th:first-child,.duet-table-minimal th:first-child,.duet-table-plain th:first-child{padding-left:0 !important}.duet-table-fixed th:last-child,.duet-table-minimal th:last-child,.duet-table-plain th:last-child{padding-right:0 !important}.duet-theme-turva.duet-table-fixed th,.duet-theme-turva.duet-table-minimal th,.duet-theme-turva.duet-table-plain th{border-bottom-color:#444445}.duet-table-fixed tbody th,.duet-table-minimal tbody th,.duet-table-plain tbody th{padding-top:40px !important;border-bottom-color:#e1e3e6}.duet-theme-turva.duet-table-fixed tbody th,.duet-theme-turva.duet-table-minimal tbody th,.duet-theme-turva.duet-table-plain tbody th{border-bottom-color:#e4e4e6}.duet-table-fixed td,.duet-table-minimal td,.duet-table-plain td{padding:16px !important}.duet-table-fixed td:first-child,.duet-table-minimal td:first-child,.duet-table-plain td:first-child{padding-left:0 !important}.duet-table-fixed td:last-child,.duet-table-minimal td:last-child,.duet-table-plain td:last-child{padding-right:0 !important}.duet-table-fixed tbody td,.duet-table-minimal tbody td,.duet-table-plain tbody td{border-bottom:1px solid #e1e3e6}.duet-theme-turva.duet-table-fixed tbody td,.duet-theme-turva.duet-table-minimal tbody td,.duet-theme-turva.duet-table-plain tbody td{border-bottom-color:#e4e4e6}.duet-table-flattened.duet-table-fixed tbody:first-of-type th,.duet-table-flattened.duet-table-minimal tbody:first-of-type th,.duet-table-flattened.duet-table-plain tbody:first-of-type th{padding-top:0 !important}.duet-table-flattened.duet-table-fixed td,.duet-table-flattened.duet-table-minimal td,.duet-table-flattened.duet-table-plain td,.duet-table-flattened.duet-table-fixed tbody th,.duet-table-flattened.duet-table-minimal tbody th,.duet-table-flattened.duet-table-plain tbody th{border-bottom:0}.duet-table-flattened.duet-table-fixed tr,.duet-table-flattened.duet-table-minimal tr,.duet-table-flattened.duet-table-plain tr{padding:20px 0 !important}.duet-table-flattened.duet-table-fixed tbody th,.duet-table-flattened.duet-table-minimal tbody th,.duet-table-flattened.duet-table-plain tbody th{padding-top:20px !important}.duet-table-flattened.duet-table-fixed tfoot td,.duet-table-flattened.duet-table-minimal tfoot td,.duet-table-flattened.duet-table-plain tfoot td{margin-bottom:4px !important}.duet-table-flattened.duet-table-fixed tbody:not(:only-of-type) tr:first-child,.duet-table-flattened.duet-table-minimal tbody:not(:only-of-type) tr:first-child,.duet-table-flattened.duet-table-plain tbody:not(:only-of-type) tr:first-child{border-bottom:0}.duet-table-plain.duet-table-flattened tbody tr{border-bottom:1px solid #e1e3e6}.duet-table-plain.duet-table-flattened.duet-theme-turva tbody tr{border-bottom-color:#e4e4e6}.duet-table-minimal tbody tr,.duet-table-minimal tbody tr td{vertical-align:top;border-bottom:0 none}.duet-table-minimal tbody tr:last-of-type,.duet-table-minimal tbody tr:last-of-type td{border-bottom:1px solid #e1e3e6}.duet-table-minimal.duet-table-flattened tbody tr,.duet-table-minimal.duet-table-flattened tbody tr td{border-bottom:0 none}.duet-table-minimal.duet-table-flattened tbody tr td[data-heading]::before{display:none}.duet-table-minimal.duet-table-flattened tfoot{border-top:1px solid #e1e3e6}.duet-table-minimal.duet-table-flattened.duet-theme-turva tfoot{border-top-color:#e4e4e6}.duet-table-fixed table{table-layout:fixed}.duet-table-fixed tbody tr,.duet-table-fixed tbody tr td,.duet-table-fixed tbody tr td:first-child{padding:4px !important;vertical-align:text-bottom;border-bottom:0 none}.duet-table-fixed thead{display:none}.duet-table-fixed tbody tr,.duet-table-fixed tbody tr td{border-bottom:0 none}.duet-table-fixed:not(.duet-table-flattened) tfoot{border-top:1px solid #e1e3e6}.duet-table-fixed:not(.duet-table-flattened).duet-theme-turva tfoot{border-top-color:#e4e4e6}.duet-table-scrollable{position:relative;width:100%;overflow-x:auto;background:linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0)), linear-gradient(-90deg, #fff 0%, rgba(255, 255, 255, 0)) 100% 0, radial-gradient(farthest-side at 0% 50%, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0)), radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0)) 100% 0%;background-repeat:no-repeat;background-attachment:local, local, scroll, scroll;background-size:100px 100%, 100px 100%, 12px 100%, 12px 100%}.duet-table-selected-column{background:rgba(0, 119, 179, 0.08)}.duet-theme-turva .duet-table-selected-column{background:rgba(68, 68, 69, 0.08)}";
229
+ const duetTableCss = "duet-table{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-bottom:20px !important;display:block;font-variant-numeric:tabular-nums}duet-table table,duet-table thead,duet-table tbody,duet-table tfoot,duet-table th,duet-table td,duet-table tr{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}duet-table.duet-m-0{margin:0 !important}duet-table table{width:100%;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-size:1rem;text-align:left;border-spacing:0;border-collapse:separate}duet-table.duet-theme-turva table{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"}duet-table td{-webkit-hyphens:auto;hyphens:auto;color:#00294d}duet-table.duet-theme-turva td{color:#171c3a}duet-table th{font-weight:600;line-height:1.25;color:#657787;text-align:left}duet-table.duet-theme-turva th{color:#747475}duet-table tbody th{font-weight:600;color:#00294d}duet-table.duet-theme-turva tbody th{color:#171c3a}duet-table .duet-table-action-row td:last-child{justify-self:end;padding-right:20px !important;white-space:nowrap}.duet-table-flattened tbody tr{display:grid;grid-template-columns:repeat(2, 1fr);grid-auto-rows:auto;gap:10px}.duet-table-flattened tbody tr.duet-table-action-row td:last-child::before{padding:0;content:\"\"}.duet-table-flattened thead tr{position:absolute !important;top:0;width:1px !important;height:1px !important;padding:0 !important;overflow:hidden !important;clip:rect(1px, 1px, 1px, 1px) !important;border:0 !important}.duet-table-flattened td{grid-column:1/2;line-height:1.25}.duet-table-flattened td:not(:last-child){margin-bottom:16px !important}.duet-table-flattened td:first-child{grid-row:1;grid-column:1}.duet-table-flattened td:last-child{grid-row:1;grid-column:2}.duet-table-flattened tbody td,.duet-table-flattened tbody th,.duet-table-flattened tfoot td{padding:0 !important;text-align:left !important}.duet-table-flattened tbody th{font-weight:600;line-height:1.25;color:#657787;text-align:left}.duet-table-flattened td[data-heading]::before{margin-bottom:4px !important;display:block;font-size:1rem;font-weight:600;color:#00294d;content:attr(data-heading)}.duet-table-flattened.duet-theme-turva td[data-heading]::before{color:#171c3a}.duet-table-sticky thead th{position:sticky;top:0;background:white}.duet-table-striped td,.duet-table-striped th{padding:20px !important}@media (max-width: 35.9375em){.duet-table-striped td,.duet-table-striped th{padding:20px 12px !important}}.duet-table-striped tbody th{background:white}.duet-table-striped.duet-table-sticky thead th{border-bottom:1px solid #e1e3e6}.duet-table-striped.duet-table-sticky.duet-theme-turva thead th{border-bottom-color:#e4e4e6}.duet-table-striped tbody:not(:first-of-type) th{padding-top:40px !important}.duet-table-striped tbody:only-of-type tr:nth-of-type(odd){background:rgba(0, 80, 128, 0.04)}.duet-table-striped.duet-theme-turva tbody:only-of-type tr:nth-of-type(odd){background:rgba(23, 28, 58, 0.04)}.duet-table-striped tbody:not(:only-of-type) tr:nth-of-type(even){background:rgba(0, 80, 128, 0.04)}.duet-table-striped.duet-theme-turva tbody:not(:only-of-type) tr:nth-of-type(even){background:rgba(23, 28, 58, 0.04)}.duet-table-striped tfoot td{border-top:1px solid #e1e3e6}.duet-table-striped.duet-theme-turva tfoot td{border-top-color:#e4e4e6}.duet-table-striped.duet-table-flattened tbody:not(:first-of-type) th{padding-top:20px !important}.duet-table-striped.duet-table-flattened tr{padding:20px !important}.duet-table-striped.duet-table-flattened tfoot td{border-top:0}.duet-table-striped.duet-table-flattened tfoot tr{border-top:1px solid #e1e3e6}.duet-table-striped.duet-table-flattened.duet-theme-turva tfoot tr{border-top-color:#e4e4e6}.duet-table-fixed th,.duet-table-minimal th,.duet-table-plain th{padding:16px !important;border-bottom:1px solid #657787}.duet-table-fixed th:first-child,.duet-table-minimal th:first-child,.duet-table-plain th:first-child{padding-left:0 !important}.duet-table-fixed th:last-child,.duet-table-minimal th:last-child,.duet-table-plain th:last-child{padding-right:0 !important}.duet-theme-turva.duet-table-fixed th,.duet-theme-turva.duet-table-minimal th,.duet-theme-turva.duet-table-plain th{border-bottom-color:#444445}.duet-table-fixed tbody th,.duet-table-minimal tbody th,.duet-table-plain tbody th{padding-top:40px !important;border-bottom-color:#e1e3e6}.duet-theme-turva.duet-table-fixed tbody th,.duet-theme-turva.duet-table-minimal tbody th,.duet-theme-turva.duet-table-plain tbody th{border-bottom-color:#e4e4e6}.duet-table-fixed td,.duet-table-minimal td,.duet-table-plain td{padding:16px !important}.duet-table-fixed td:first-child,.duet-table-minimal td:first-child,.duet-table-plain td:first-child{padding-left:0 !important}.duet-table-fixed td:last-child,.duet-table-minimal td:last-child,.duet-table-plain td:last-child{padding-right:0 !important}.duet-table-fixed tbody td,.duet-table-minimal tbody td,.duet-table-plain tbody td{border-bottom:1px solid #e1e3e6}.duet-theme-turva.duet-table-fixed tbody td,.duet-theme-turva.duet-table-minimal tbody td,.duet-theme-turva.duet-table-plain tbody td{border-bottom-color:#e4e4e6}.duet-table-flattened.duet-table-fixed tbody:first-of-type th,.duet-table-flattened.duet-table-minimal tbody:first-of-type th,.duet-table-flattened.duet-table-plain tbody:first-of-type th{padding-top:0 !important}.duet-table-flattened.duet-table-fixed td,.duet-table-flattened.duet-table-minimal td,.duet-table-flattened.duet-table-plain td,.duet-table-flattened.duet-table-fixed tbody th,.duet-table-flattened.duet-table-minimal tbody th,.duet-table-flattened.duet-table-plain tbody th{border-bottom:0}.duet-table-flattened.duet-table-fixed tr,.duet-table-flattened.duet-table-minimal tr,.duet-table-flattened.duet-table-plain tr{padding:20px 0 !important}.duet-table-flattened.duet-table-fixed tbody th,.duet-table-flattened.duet-table-minimal tbody th,.duet-table-flattened.duet-table-plain tbody th{padding-top:20px !important}.duet-table-flattened.duet-table-fixed tfoot td,.duet-table-flattened.duet-table-minimal tfoot td,.duet-table-flattened.duet-table-plain tfoot td{margin-bottom:4px !important}.duet-table-flattened.duet-table-fixed tbody:not(:only-of-type) tr:first-child,.duet-table-flattened.duet-table-minimal tbody:not(:only-of-type) tr:first-child,.duet-table-flattened.duet-table-plain tbody:not(:only-of-type) tr:first-child{border-bottom:0}.duet-table-plain.duet-table-flattened tbody tr{border-bottom:1px solid #e1e3e6}.duet-table-plain.duet-table-flattened.duet-theme-turva tbody tr{border-bottom-color:#e4e4e6}.duet-table-minimal tbody tr,.duet-table-minimal tbody tr td{vertical-align:top;border-bottom:0 none}.duet-table-minimal tbody tr:last-of-type,.duet-table-minimal tbody tr:last-of-type td{border-bottom:1px solid #e1e3e6}.duet-table-minimal.duet-table-flattened tbody tr,.duet-table-minimal.duet-table-flattened tbody tr td{border-bottom:0 none}.duet-table-minimal.duet-table-flattened tbody tr td[data-heading]::before{display:none}.duet-table-minimal.duet-table-flattened tfoot{border-top:1px solid #e1e3e6}.duet-table-minimal.duet-table-flattened.duet-theme-turva tfoot{border-top-color:#e4e4e6}.duet-table-fixed table{table-layout:fixed}.duet-table-fixed tbody tr,.duet-table-fixed tbody tr td,.duet-table-fixed tbody tr td:first-child{padding:4px !important;vertical-align:text-bottom;border-bottom:0 none}.duet-table-fixed thead{display:none}.duet-table-fixed tbody tr,.duet-table-fixed tbody tr td{border-bottom:0 none}.duet-table-fixed:not(.duet-table-flattened) tfoot{border-top:1px solid #e1e3e6}.duet-table-fixed:not(.duet-table-flattened).duet-theme-turva tfoot{border-top-color:#e4e4e6}.duet-table-scrollable{position:relative;width:100%;overflow-x:auto;background:linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0)), linear-gradient(-90deg, #fff 0%, rgba(255, 255, 255, 0)) 100% 0, radial-gradient(farthest-side at 0% 50%, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0)), radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0)) 100% 0%;background-repeat:no-repeat;background-attachment:local, local, scroll, scroll;background-size:100px 100%, 100px 100%, 12px 100%, 12px 100%}.duet-table-selected-column{background:rgba(0, 119, 179, 0.08)}.duet-theme-turva .duet-table-selected-column{background:rgba(68, 68, 69, 0.08)}.duet-table-sortable tbody tr td:first-child,.duet-table-sortable thead tr th:first-child{padding:20px}.duet-table-sortable:not(.duet-table-flattened) tfoot{border-top:1px solid #e1e3e6}.duet-table-sortable:not(.duet-table-flattened).duet-theme-turva tfoot{border-top-color:#e4e4e6}.duet-table-actions table{table-layout:auto}.duet-table-actions thead th:last-child{width:1px;white-space:nowrap}";
296
230
 
297
231
  // remove wrapping speech marks.
298
232
  // media query tokens are wrapped in speech marks,
@@ -352,9 +286,9 @@ let DuetTable = class {
352
286
  }
353
287
  connectedCallback() {
354
288
  this.mq = matchMedia(breakpointToToken[this.breakpoint]);
355
- this.mq.addEventListener("change", this.handleMediaQueryChange);
289
+ this.mq.addEventListener("change", jsUtils.debounce(this.handleMediaQueryChange, 50));
356
290
  this.handleMediaQueryChange(this.mq);
357
- this.observer = new MutationObserver(() => this.copyHeadingsToCells());
291
+ this.observer = new MutationObserver(() => jsUtils.debounce(this.copyHeadingsToCells(), 50));
358
292
  this.observer.observe(this.element, {
359
293
  childList: true,
360
294
  subtree: true,
@@ -385,6 +319,9 @@ let DuetTable = class {
385
319
  this.mq = null;
386
320
  this.matchesBreakpoint = true;
387
321
  }
322
+ /**
323
+ * Local methods.
324
+ */
388
325
  copyHeadingsToCells() {
389
326
  const headingElements = this.element.querySelectorAll("thead th");
390
327
  const rowElements = this.element.querySelectorAll("tbody tr");
@@ -660,7 +597,7 @@ const validateFile = (item, validators) => {
660
597
  if (item) {
661
598
  const { name, type, size } = item;
662
599
  const mime = validateFileMime(type, allowedMimetypes);
663
- const ext = validateFileExtension(name, allowedExtensions);
600
+ const ext = validateFileExtension(name.toLowerCase(), allowedExtensions);
664
601
  const bytes = validateFileSize(size, maxBytes);
665
602
  if (!mime) {
666
603
  errorMessage = getError("duet-upload-101");
@@ -740,7 +677,7 @@ const makeXhrRequest = ({ payload, options, onFailure, onSuccess, onProgress })
740
677
  return xhr;
741
678
  };
742
679
 
743
- const duetUploadCss = "*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}::slotted([slot=header]){margin-bottom:16px}::slotted([slot=fileheader]){margin:16px 0 0 0}::slotted([slot=filefooter]){margin-top:16px}.duet-upload{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.duet-upload-item-size{font-size:0.75rem;font-weight:400}.duet-upload-filelist{margin-bottom:25px}.duet-upload-filelist-empty{display:flex;align-items:center;justify-content:center;width:100%;height:75px;margin:0 auto;font-size:1rem;font-weight:400;background-color:#f5f8fa}";
680
+ const duetUploadCss = "*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}::slotted([slot=header]){margin-bottom:16px}::slotted([slot=fileheader]){margin:16px 0 0 0}::slotted([slot=filefooter]){margin-top:16px}.duet-upload{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.duet-upload-item-size{font-size:0.75rem;font-weight:400}.duet-upload-filelist{margin-bottom:25px}.duet-upload-filelist-empty{display:flex;align-items:center;justify-content:center;width:100%;height:75px;margin:0 auto;font-size:1rem;font-weight:400;background-color:#f5f8fa}.duet-upload-editable-table-header-hidden{display:none}.duet-upload-editable-table tbody .duet-upload-editable-table-data{padding:0 !important;border:0}.duet-upload-editable-table duet-editable-table tfoot,.duet-upload-editable-table duet-editable-table thead{display:none}.duet-upload-editable-table duet-editable-table .duet-editable-table-content{padding-right:0 !important;padding-left:0 !important}.duet-upload-editable-table duet-editable-table duet-table .duet-table-action-row td{padding:0.75rem 0 !important}.duet-upload-editable-table duet-editable-table duet-table .duet-table-action-row td:last-child{padding-right:0 !important}.duet-upload-editable-table duet-editable-table .duet-editable-table-row-inprogress duet-action-button::part(button){border:0}";
744
681
 
745
682
  let DuetUpload = class {
746
683
  constructor(hostRef) {
@@ -754,25 +691,6 @@ let DuetUpload = class {
754
691
  this.duetCancel = index.createEvent(this, "duetCancel", 3);
755
692
  this.duetProgress = index.createEvent(this, "duetProgress", 3);
756
693
  this.duetUpload = index.createEvent(this, "duetUpload", 3);
757
- /**
758
- * Own Properties
759
- */
760
- this.buttonId = createId.createID("DuetButton");
761
- this.labelId = createId.createID("DuetLabel");
762
- this.uploadId = createId.createID("DuetUpload");
763
- this.editableTableId = createId.createID("DuetEditableTable");
764
- this.filesInProgress = new Map();
765
- this.fileMaxReached = false;
766
- this.bytesMaxReached = false;
767
- this.internalStatusMessageLabel = undefined;
768
- /**
769
- * Properties
770
- */
771
- this.DefaultGroups = {
772
- inprogress: "inprogress",
773
- success: "success",
774
- failure: "failure",
775
- };
776
694
  /**
777
695
  * State() variables
778
696
  */
@@ -794,8 +712,9 @@ let DuetUpload = class {
794
712
  {
795
713
  icon: "action-delete",
796
714
  color: "color-danger",
797
- color_hover: "primary-dark",
798
- id: "delete",
715
+ size: "x-small",
716
+ background: "gray-lightest",
717
+ name: "delete",
799
718
  map: ["success", "failure"],
800
719
  label: {
801
720
  fi: "Poista tiedosto",
@@ -806,8 +725,9 @@ let DuetUpload = class {
806
725
  {
807
726
  icon: "navigation-close",
808
727
  color: "primary",
809
- color_hover: "primary-dark",
810
- id: "cancel",
728
+ size: "x-small",
729
+ background: "gray-lightest",
730
+ name: "cancel",
811
731
  map: ["inprogress"],
812
732
  label: {
813
733
  fi: "Keskeytä lähetys",
@@ -877,8 +797,8 @@ let DuetUpload = class {
877
797
  inProgressWithErrors: "Uploading {filesInProgress}, {filesUploaded} uploaded of {filesTotal}, {filesWithErrors} failed",
878
798
  done: "All {filesTotal} added successfully",
879
799
  doneWithErrors: "Action completed, {filesUploaded} has been added successfully, {filesWithErrors} had errors",
880
- files: "tiedostoa",
881
- file: "tiedosto",
800
+ files: "File",
801
+ file: "file",
882
802
  },
883
803
  };
884
804
  /**
@@ -1033,19 +953,72 @@ let DuetUpload = class {
1033
953
  * by default this is off, setting this to true will limit the users choices to what has been explicitly set
1034
954
  */
1035
955
  this.limitSelection = false;
956
+ /**
957
+ * Own Properties
958
+ */
959
+ this.buttonId = createId.createID("DuetButton");
960
+ this.labelId = createId.createID("DuetLabel");
961
+ this.uploadId = createId.createID("DuetUpload");
962
+ this.filesInProgress = new Map();
963
+ this.fileMaxReached = false;
964
+ this.bytesMaxReached = false;
965
+ this.internalStatusMessageLabel = undefined;
966
+ /**
967
+ * Properties
968
+ */
969
+ this.DefaultGroups = {
970
+ inprogress: "inprogress",
971
+ success: "success",
972
+ failure: "failure",
973
+ };
974
+ /**
975
+ * Array of group names that you want the editable table to use to display files
976
+ * @required
977
+ * @example [{ id: "success", label: {fi: "Onnistunut", en: "Success", sv: "Alt klart", }}]
978
+ */
979
+ this.groups = [
980
+ {
981
+ id: this.DefaultGroups.inprogress,
982
+ label: {
983
+ fi: "Kesken olevat tiedostot",
984
+ sv: "Filer inprogress",
985
+ en: "Files inprogress",
986
+ },
987
+ },
988
+ {
989
+ id: this.DefaultGroups.success,
990
+ label: {
991
+ fi: "Valmiit tiedostot",
992
+ sv: "Files success",
993
+ en: "Files success",
994
+ },
995
+ },
996
+ {
997
+ id: this.DefaultGroups.failure,
998
+ label: {
999
+ fi: "Tiedostot, joissa on virheitä",
1000
+ sv: "Filer med fel",
1001
+ en: "Files with errors",
1002
+ },
1003
+ },
1004
+ ];
1005
+ this.kick = jsUtils.debounce(() => {
1006
+ this.tick = Date.now();
1007
+ }, 30); // will trigger re-render
1036
1008
  /**
1037
1009
  * Private functions
1038
1010
  */
1039
1011
  this.listenForActionEvents = () => {
1040
- this.element.addEventListener("duetEditableItemAction", (e) => {
1012
+ this.element.addEventListener("duetActionEvent", (e) => {
1041
1013
  const detail = e.detail;
1042
- const { action, keyName, originalEvent } = detail;
1014
+ const { action, id, originalEvent } = detail;
1015
+ console.log(e);
1043
1016
  switch (action) {
1044
1017
  case "delete":
1045
- this.onDelete(keyName, originalEvent);
1018
+ this.onDelete(id, originalEvent);
1046
1019
  break;
1047
1020
  case "cancel":
1048
- this.onCancel(keyName, originalEvent);
1021
+ this.onCancel(id, originalEvent);
1049
1022
  break;
1050
1023
  // code block
1051
1024
  }
@@ -1102,24 +1075,6 @@ let DuetUpload = class {
1102
1075
  return "none";
1103
1076
  }
1104
1077
  };
1105
- this.convertToDuetEditableTableItems = () => {
1106
- // we're always recreating the map - in order to force an update down stream.
1107
- const itemData = new Map();
1108
- //walk the files Map and convert to DuetEditableTableItemData
1109
- this.files.forEach((data, key, _originalMap) => {
1110
- const group = this.getGroupFromItemData(data);
1111
- const item = this.getItemHTMLFromItemData(data, group);
1112
- itemData.set(key, {
1113
- uid: data.uid,
1114
- item,
1115
- group,
1116
- });
1117
- });
1118
- return itemData;
1119
- };
1120
- this.kick = debounce(() => {
1121
- this.tick = Date.now();
1122
- }, 30); // will trigger re-render
1123
1078
  this.genHashName = () => Date.now().toString(36) + Math.random();
1124
1079
  this.updateValueInMap = (item, key, value, kick = true) => {
1125
1080
  const fileItem = this.files.get(item);
@@ -1180,7 +1135,6 @@ let DuetUpload = class {
1180
1135
  this.nativeInput.value = "";
1181
1136
  };
1182
1137
  this.startUpload = async (ev, metaData = undefined) => {
1183
- await this.setFocus();
1184
1138
  this.metaData = metaData;
1185
1139
  this.nativeInput.click();
1186
1140
  this.onUpload(ev, metaData);
@@ -1243,9 +1197,18 @@ let DuetUpload = class {
1243
1197
  fileMaxReached: isTotalFileAmountAboveMax,
1244
1198
  };
1245
1199
  };
1200
+ this.getItemFromUID = (uid) => {
1201
+ for (const [key, value] of this.files.entries()) {
1202
+ if (value.uid === uid) {
1203
+ return { value, key };
1204
+ }
1205
+ }
1206
+ return null;
1207
+ };
1246
1208
  this.onDelete = (key, ev) => {
1247
- const deletedItem = this.files.get(key);
1248
- this.files.delete(key);
1209
+ const retrievedKey = this.getItemFromUID(key).key;
1210
+ const deletedItem = this.files.get(retrievedKey);
1211
+ this.files.delete(retrievedKey);
1249
1212
  this.validateTotals();
1250
1213
  this.kick();
1251
1214
  this.duetDelete.emit({
@@ -1259,8 +1222,9 @@ let DuetUpload = class {
1259
1222
  this.resetFormFields();
1260
1223
  };
1261
1224
  this.onCancel = (key, ev) => {
1262
- const cancelledItem = this.files.get(key);
1263
- this.files.delete(key);
1225
+ const retrievedKey = this.getItemFromUID(key).key;
1226
+ const cancelledItem = this.files.get(retrievedKey);
1227
+ this.files.delete(retrievedKey);
1264
1228
  if (!this.external) {
1265
1229
  const { xhr } = cancelledItem;
1266
1230
  xhr.abort();
@@ -1310,6 +1274,79 @@ let DuetUpload = class {
1310
1274
  data: { files: this.files },
1311
1275
  });
1312
1276
  };
1277
+ /**
1278
+ * @description This functions return sorted map items byg condition which are:
1279
+ */
1280
+ this.filterMap = () => {
1281
+ const all = [...this.files.values()];
1282
+ const inprogress = [];
1283
+ const failure = [];
1284
+ const success = [];
1285
+ all.forEach(data => {
1286
+ const group = this.getGroupFromItemData(data);
1287
+ const item = this.getItemHTMLFromItemData(data, group);
1288
+ if (group === this.DefaultGroups.success) {
1289
+ success.push({
1290
+ uid: data.uid,
1291
+ item,
1292
+ group,
1293
+ });
1294
+ }
1295
+ else if (group === this.DefaultGroups.inprogress) {
1296
+ inprogress.push({
1297
+ uid: data.uid,
1298
+ item,
1299
+ group,
1300
+ });
1301
+ }
1302
+ else if (group === this.DefaultGroups.failure) {
1303
+ failure.push({
1304
+ uid: data.uid,
1305
+ item,
1306
+ group,
1307
+ });
1308
+ }
1309
+ else if (data.group) {
1310
+ inprogress.push({
1311
+ uid: data.uid,
1312
+ item,
1313
+ group: data.group,
1314
+ });
1315
+ }
1316
+ });
1317
+ return {
1318
+ inprogress,
1319
+ failure,
1320
+ success,
1321
+ };
1322
+ };
1323
+ this.getColumns = (group) => {
1324
+ return [
1325
+ {
1326
+ sort_order: 1,
1327
+ direction: 1,
1328
+ index: 0,
1329
+ key: group.id,
1330
+ label: group.label,
1331
+ },
1332
+ ];
1333
+ };
1334
+ this.getActions = (id) => {
1335
+ return this.actions.filter(item => item.map.includes(id));
1336
+ };
1337
+ this.renderEditableTableGroups = () => {
1338
+ const filteredItems = this.filterMap();
1339
+ const EditableTables = this.groups.map(group => {
1340
+ const currentItems = filteredItems[group.id];
1341
+ if (!(currentItems === null || currentItems === void 0 ? void 0 : currentItems.length)) {
1342
+ return;
1343
+ }
1344
+ return (index.h("duet-table", { variation: "plain", breakpoint: "none", role: "log", margin: this.hideGroups ? "none" : "auto" }, index.h("table", { class: "duet-upload-editable-table" }, index.h("thead", { class: "duet-upload-editable-table-header" }, index.h("tr", null, index.h("th", { class: {
1345
+ "duet-upload-editable-table-header-hidden": this.hideGroups,
1346
+ } }, !this.hideGroups ? (languageUtils.getLocaleString(group.label)) : (index.h("duet-visually-hidden", null, languageUtils.getLocaleString(group.label)))))), index.h("tbody", null, index.h("tr", null, index.h("td", { class: "duet-upload-editable-table-data" }, index.h("duet-editable-table", { breakpoint: "none", variation: "plain", groupId: group.id, columns: this.getColumns(group), actions: this.getActions(group.id), margin: "none", rows: currentItems })))))));
1347
+ });
1348
+ return EditableTables;
1349
+ };
1313
1350
  }
1314
1351
  watchValidHandler(newValue, oldValue) {
1315
1352
  if (newValue !== oldValue) {
@@ -1333,6 +1370,68 @@ let DuetUpload = class {
1333
1370
  // listen to the events from the component
1334
1371
  this.verifyValidity();
1335
1372
  }
1373
+ /**
1374
+ * Sets focus on the specified `duet-input`. Use this method instead of the global
1375
+ * `input.focus()`.
1376
+ */
1377
+ async setFocus(options) {
1378
+ if (this.nativeInput) {
1379
+ this.nativeInput.focus(options);
1380
+ }
1381
+ return;
1382
+ }
1383
+ /**
1384
+ * Method for invoking the upload sequence
1385
+ */
1386
+ async upload(metaData = undefined) {
1387
+ await this.setFocus();
1388
+ this.metaData = metaData;
1389
+ this.nativeInput.click();
1390
+ return;
1391
+ }
1392
+ /**
1393
+ * Method for forcing a render of the upload list, element.files can be changed externally
1394
+ * But it will only rerender on a new Map or a top Level change - this can be used to update
1395
+ * the tabular data if the automatic re-render is no sufficient
1396
+ */
1397
+ async refresh() {
1398
+ this.kick();
1399
+ await this.setFocus();
1400
+ }
1401
+ /**
1402
+ * Get list of files, divided in errors and valid sections
1403
+ */
1404
+ async getFiles() {
1405
+ if (!this.files || this.files.size === 0) {
1406
+ return false;
1407
+ }
1408
+ return this.getFilesAsArray();
1409
+ }
1410
+ /**
1411
+ * Convenience method for updating the value of a key:value inside an item in the files attribute
1412
+ */
1413
+ async updateValue(item, key, value) {
1414
+ this.updateValueInMap(item, key, value);
1415
+ }
1416
+ /**
1417
+ * render() function
1418
+ * Always the last one in the class.
1419
+ */
1420
+ render() {
1421
+ const identifier = this.identifier || this.uploadId;
1422
+ let caption = this.description.replace(/{maxfiles}/g, this.maxFiles.toString());
1423
+ caption = caption.replace(/{maxbytes}/g, `${Math.floor(this.maxBytes / 1024 / 1024)} MB`);
1424
+ caption = caption.replace(/{filetypes}/g, this.allowedExtensions.split(",").join(", "));
1425
+ return (index.h(index.Host, { class: { "duet-m-0": this.margin === "none" } }, index.h("duet-fieldset", { label: this.label, caption: caption }, index.h("slot", { name: "header" }), !this.files.size && (index.h("duet-label", { part: this.identifier ? `${this.identifier}-empty-state` : "duet-upload-empty-state", theme: this.theme === "turva" ? "turva" : "default", size: "small", class: {
1426
+ "duet-upload-filelist-empty": !this.files.size,
1427
+ "duet-upload-filelist": true,
1428
+ "duet-upload-filelist-filled": this.files.size,
1429
+ }, id: this.labelId, for: identifier }, this.fileListEmpty)), !!this.files.size && index.h("slot", { name: "fileheader" }), !!this.files.size && (index.h("duet-upload-aria-status", { invalid: this.getFilesAsArray().invalid.length, valid: this.getFilesAsArray().valid.length, inprogress: this.filesInProgress.size, total: this.files.size, statusMessageLabel: this.internalStatusMessageLabel })), !!this.files.size && this.renderEditableTableGroups(), !!this.files.size && index.h("slot", { name: "filefooter" }), index.h("duet-spacer", { size: "large" }), !this.hideButton && (index.h("duet-button", { id: this.buttonId, onClick: this.startUpload, "accessible-controls": identifier, disabled: this.fileMaxReached, "accessible-label": this.accessibleButtonLabel, "accessible-owns": identifier, size: "small", variation: "secondary", fixed: true, icon: "action-add-circle", part: this.identifier ? `${this.identifier}-button-upload` : "duet-upload-button-upload" }, this.buttonLabel)), index.h("duet-spacer", { size: "medium" }), (this.fileMaxReached || this.bytesMaxReached) && (index.h("duet-alert", { part: this.identifier ? `${this.identifier}-error-notification` : "duet-upload-error-notification" }, this.fileMaxReached && getI18nError("duet-upload-301"), this.bytesMaxReached && getI18nError("duet-upload-202"))), index.h("duet-spacer", { size: "medium" }), index.h("duet-visually-hidden", null, index.h("input", { ref: input => {
1430
+ this.nativeInput = input;
1431
+ }, accept: !this.limitSelection ? undefined : `${this.allowedMimetypes},${this.allowedExtensions}`, onBlur: this.onBlur, onFocus: this.onFocus, onChange: e => this.onChange(e), type: "file", class: {
1432
+ "duet-upload": true,
1433
+ }, disabled: this.disabled, "aria-hidden": "true", required: this.required, name: this.name, id: this.identifier, multiple: this.multiple, capture: "user" })))));
1434
+ }
1336
1435
  /**
1337
1436
  * XHR request utilities
1338
1437
  */
@@ -1454,68 +1553,6 @@ let DuetUpload = class {
1454
1553
  component: "duet-upload",
1455
1554
  });
1456
1555
  }
1457
- /**
1458
- * Sets focus on the specified `duet-input`. Use this method instead of the global
1459
- * `input.focus()`.
1460
- */
1461
- async setFocus(options) {
1462
- if (this.nativeInput) {
1463
- this.nativeInput.focus(options);
1464
- }
1465
- return;
1466
- }
1467
- /**
1468
- * Method for invoking the upload sequence
1469
- */
1470
- async upload(metaData = undefined) {
1471
- await this.setFocus();
1472
- this.metaData = metaData;
1473
- this.nativeInput.click();
1474
- return;
1475
- }
1476
- /**
1477
- * Method for forcing a render of the upload list, element.files can be changed externally
1478
- * But it will only rerender on a new Map or a top Level change - this can be used to update
1479
- * the tabular data if the automatic re-render is no sufficient
1480
- */
1481
- async refresh() {
1482
- this.kick();
1483
- await this.setFocus();
1484
- }
1485
- /**
1486
- * Get list of files, divided in errors and valid sections
1487
- */
1488
- async getFiles() {
1489
- if (!this.files || this.files.size === 0) {
1490
- return false;
1491
- }
1492
- return this.getFilesAsArray();
1493
- }
1494
- /**
1495
- * Convenience method for updating the value of a key:value inside an item in the files attribute
1496
- */
1497
- async updateValue(item, key, value) {
1498
- this.updateValueInMap(item, key, value);
1499
- }
1500
- /**
1501
- * render() function
1502
- * Always the last one in the class.
1503
- */
1504
- render() {
1505
- const identifier = this.identifier || this.uploadId;
1506
- let caption = this.description.replace(/{maxfiles}/g, this.maxFiles.toString());
1507
- caption = caption.replace(/{maxbytes}/g, `${Math.floor(this.maxBytes / 1024 / 1024)} MB`);
1508
- caption = caption.replace(/{filetypes}/g, this.allowedExtensions.split(",").join(", "));
1509
- return (index.h(index.Host, { class: { "duet-m-0": this.margin === "none" } }, index.h("duet-fieldset", { label: this.label, caption: caption }, index.h("slot", { name: "header" }), !this.files.size && (index.h("duet-label", { part: this.identifier ? `${this.identifier}-empty-state` : "duet-upload-empty-state", theme: this.theme === "turva" ? "turva" : "default", size: "small", class: {
1510
- "duet-upload-filelist-empty": !this.files.size,
1511
- "duet-upload-filelist": true,
1512
- "duet-upload-filelist-filled": this.files.size,
1513
- }, id: this.labelId, for: identifier }, this.fileListEmpty)), !!this.files.size && index.h("slot", { name: "fileheader" }), !!this.files.size && (index.h("duet-upload-aria-status", { invalid: this.getFilesAsArray().invalid.length, valid: this.getFilesAsArray().valid.length, inprogress: this.filesInProgress.size, total: this.files.size, statusMessageLabel: this.internalStatusMessageLabel })), !!this.files.size && (index.h("duet-editable-table", { part: this.identifier ? `${this.identifier}-editable-table` : "duet-upload-editable-table", "aria-live": "polite", "aria-relevant": "removals", accessibleRole: "log", id: this.editableTableId, groups: this.groups, actions: this.actions, hideGroups: this.hideGroups, alignment: this.alignment, items: this.convertToDuetEditableTableItems() })), !!this.files.size && index.h("slot", { name: "filefooter" }), index.h("duet-spacer", { size: "large" }), !this.hideButton && (index.h("duet-button", { id: this.buttonId, onClick: this.startUpload, "accessible-controls": identifier, disabled: this.fileMaxReached, "accessible-label": this.accessibleButtonLabel, "accessible-owns": identifier, size: "small", variation: "secondary", fixed: true, icon: "action-add-circle", part: this.identifier ? `${this.identifier}-button-upload` : "duet-upload-button-upload" }, this.buttonLabel)), index.h("duet-spacer", { size: "medium" }), (this.fileMaxReached || this.bytesMaxReached) && (index.h("duet-alert", { part: this.identifier ? `${this.identifier}-error-notification` : "duet-upload-error-notification" }, this.fileMaxReached && getI18nError("duet-upload-301"), this.bytesMaxReached && getI18nError("duet-upload-202"))), index.h("duet-spacer", { size: "medium" }), index.h("duet-visually-hidden", null, index.h("input", { ref: input => {
1514
- this.nativeInput = input;
1515
- }, accept: !this.limitSelection ? undefined : `${this.allowedMimetypes},${this.allowedExtensions}`, onBlur: this.onBlur, onFocus: this.onFocus, onChange: e => this.onChange(e), type: "file", class: {
1516
- "duet-upload": true,
1517
- }, disabled: this.disabled, "aria-hidden": "true", required: this.required, name: this.name, id: this.identifier, multiple: this.multiple, capture: "user" })))));
1518
- }
1519
1556
  get element() { return index.getElement(this); }
1520
1557
  static get watchers() { return {
1521
1558
  "valid": ["watchValidHandler"]
@@ -1524,6 +1561,5 @@ let DuetUpload = class {
1524
1561
  DuetUpload.style = duetUploadCss;
1525
1562
 
1526
1563
  exports.duet_editable_table = DuetEditableTable;
1527
- exports.duet_editable_table_item = DuetEditableTableItem;
1528
1564
  exports.duet_table = DuetTable;
1529
1565
  exports.duet_upload = DuetUpload;