@duetds/components 4.36.1 → 5.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (315) hide show
  1. package/hydrate/index.js +1135 -983
  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 +8 -4
  8. package/lib/cjs/duet-caption_4.cjs.entry.js +3 -3
  9. package/lib/cjs/duet-card.cjs.entry.js +3 -3
  10. package/lib/cjs/duet-checkbox.cjs.entry.js +1 -1
  11. package/lib/cjs/duet-choice_2.cjs.entry.js +4 -4
  12. package/lib/cjs/duet-collapsible.cjs.entry.js +2 -2
  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 -337
  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 +7 -7
  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 +2 -2
  28. package/lib/cjs/duet-notification_2.cjs.entry.js +1 -1
  29. package/lib/cjs/duet-number-input.cjs.entry.js +1 -1
  30. package/lib/cjs/duet-pagination_2.cjs.entry.js +24 -14
  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 +1 -1
  35. package/lib/cjs/duet-select.cjs.entry.js +1 -1
  36. package/lib/cjs/duet-step_2.cjs.entry.js +1 -1
  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-dfd718e8.js → focus-utils-2404e669.js} +1 -1
  45. package/lib/cjs/{index-4f342f1c.js → index-91b9281f.js} +1 -1
  46. package/lib/cjs/js-utils-be1d29ae.js +39 -0
  47. package/lib/cjs/loader.cjs.js +2 -2
  48. package/lib/cjs/{token-utils-f402e205.js → token-utils-ac8432d1.js} +1 -1
  49. package/lib/cjs/{tokens-8596cece.js → tokens-72efc7fd.js} +0 -0
  50. package/lib/cjs/{tokens.module-6b2df1c2.js → tokens.module-6afcc9c1.js} +0 -0
  51. package/lib/collection/collection-manifest.json +14 -11
  52. package/lib/collection/components/duet-action-button/duet-action-button.css +87 -0
  53. package/lib/collection/components/duet-action-button/duet-action-button.js +489 -0
  54. package/lib/collection/components/duet-button/duet-button.js +23 -1
  55. package/lib/collection/components/duet-choice/duet-choice.css +20 -15
  56. package/lib/collection/components/duet-choice/duet-choice.js +10 -8
  57. package/lib/collection/components/duet-date-picker/duet-date-picker.css +2 -57
  58. package/lib/collection/components/duet-date-picker/duet-date-picker.js +2 -6
  59. package/lib/collection/components/duet-editable-table/duet-editable-table-tabledata.js +3 -2
  60. package/lib/collection/components/duet-editable-table/duet-editable-table.css +20 -1
  61. package/lib/collection/components/duet-editable-table/duet-editable-table.js +331 -205
  62. package/lib/collection/components/duet-header/duet-header.css +5 -1
  63. package/lib/collection/components/duet-header/duet-header.js +4 -3
  64. package/lib/collection/components/duet-pagination/duet-pagination.css +3 -62
  65. package/lib/collection/components/duet-pagination/duet-pagination.js +49 -19
  66. package/lib/collection/components/duet-range-stepper/duet-range-stepper.css +4 -55
  67. package/lib/collection/components/duet-range-stepper/duet-range-stepper.js +2 -4
  68. package/lib/collection/components/duet-table/duet-table.css +42 -8
  69. package/lib/collection/components/duet-table/duet-table.js +11 -2
  70. package/lib/collection/components/duet-upload/duet-upload.css +25 -0
  71. package/lib/collection/components/duet-upload/duet-upload.js +270 -166
  72. package/lib/collection/components/duet-upload/upload-validators.js +1 -1
  73. package/lib/collection/utils/fixture-utils.js +3 -1
  74. package/lib/collection/utils/js-utils.js +36 -1
  75. package/lib/custom-elements-bundle/index.d.ts +6 -12
  76. package/lib/custom-elements-bundle/index.js +1148 -1007
  77. package/lib/duet/duet.esm.js +1 -1
  78. package/lib/duet/duet.js +1 -1
  79. package/lib/duet/{p-061835f3.system.entry.js → p-09bdb2b4.system.entry.js} +1 -1
  80. package/lib/duet/{p-1a95aeb6.entry.js → p-0e4b29a3.entry.js} +1 -1
  81. package/lib/duet/{p-65c418f7.system.entry.js → p-16477cd0.system.entry.js} +1 -1
  82. package/lib/duet/p-1c993c62.system.entry.js +4 -0
  83. package/lib/duet/{p-8c53bc24.system.entry.js → p-1f78f660.system.entry.js} +1 -1
  84. package/lib/duet/{p-ef275410.entry.js → p-24442312.entry.js} +1 -1
  85. package/lib/duet/{p-ddb6344c.system.js → p-268c0abb.system.js} +0 -0
  86. package/lib/duet/p-2d602c49.system.entry.js +4 -0
  87. package/lib/duet/{p-946f34b4.system.entry.js → p-305a8332.system.entry.js} +1 -1
  88. package/lib/duet/{p-4fdbc6ff.system.entry.js → p-3724e8bf.system.entry.js} +1 -1
  89. package/lib/duet/{p-5d9affcd.entry.js → p-40deceee.entry.js} +1 -1
  90. package/lib/duet/{p-211b4485.system.entry.js → p-4169371b.system.entry.js} +1 -1
  91. package/lib/duet/{p-9ce0e625.entry.js → p-4306e41d.entry.js} +1 -1
  92. package/lib/duet/{p-5376a9db.entry.js → p-43a310bd.entry.js} +1 -1
  93. package/lib/duet/{p-29255af8.entry.js → p-45c0bd39.entry.js} +1 -1
  94. package/lib/duet/{p-fd2211ab.entry.js → p-47885d97.entry.js} +1 -1
  95. package/lib/duet/{p-615bfc61.system.entry.js → p-4b9af907.system.entry.js} +1 -1
  96. package/lib/duet/{p-1c4721a1.entry.js → p-4f9d6d43.entry.js} +1 -1
  97. package/lib/duet/{p-85100e09.entry.js → p-52f07766.entry.js} +1 -1
  98. package/lib/duet/{p-e8e35258.entry.js → p-567321c9.entry.js} +1 -1
  99. package/lib/duet/p-572ee1f5.entry.js +4 -0
  100. package/lib/duet/{p-cb445018.js → p-5746d88c.js} +1 -1
  101. package/lib/duet/{p-286d2ad2.system.entry.js → p-57f6b52e.system.entry.js} +1 -1
  102. package/lib/duet/p-5a4e576c.entry.js +4 -0
  103. package/lib/duet/{p-fae71c1f.entry.js → p-5ad66dfd.entry.js} +1 -1
  104. package/lib/duet/{p-f6da56c8.entry.js → p-5cc97dae.entry.js} +1 -1
  105. package/lib/duet/{p-03cf3ebf.entry.js → p-5ce39b6b.entry.js} +1 -1
  106. package/lib/duet/{p-46ae601a.entry.js → p-615f0b6f.entry.js} +1 -1
  107. package/lib/duet/{p-83452e8f.entry.js → p-63f6099b.entry.js} +1 -1
  108. package/lib/duet/p-681e93cd.entry.js +4 -0
  109. package/lib/duet/p-6a455a78.system.entry.js +4 -0
  110. package/lib/duet/{p-c52f4de0.system.entry.js → p-6d142621.system.entry.js} +1 -1
  111. package/lib/duet/{p-ca0ee655.system.entry.js → p-6fc73186.system.entry.js} +1 -1
  112. package/lib/duet/{p-e5ce7aad.system.entry.js → p-72469869.system.entry.js} +1 -1
  113. package/lib/duet/{p-20cdb787.entry.js → p-73d3d1bf.entry.js} +1 -1
  114. package/lib/duet/{p-164a7037.system.entry.js → p-763d700b.system.entry.js} +1 -1
  115. package/lib/duet/{p-d9716aec.system.entry.js → p-770fdb8f.system.entry.js} +1 -1
  116. package/lib/duet/{p-4e2532c7.system.js → p-77acbfe4.system.js} +1 -1
  117. package/lib/duet/{p-d21f19cc.system.js → p-7d65b8fc.system.js} +1 -1
  118. package/lib/duet/{p-ffb5fb75.system.entry.js → p-7e1d6ac6.system.entry.js} +1 -1
  119. package/lib/duet/{p-c7fa7dcc.system.entry.js → p-7f58aced.system.entry.js} +1 -1
  120. package/lib/duet/{p-22baf1f8.system.entry.js → p-806dc8b7.system.entry.js} +1 -1
  121. package/lib/duet/{p-fa99eaa4.system.js → p-812b0905.system.js} +0 -0
  122. package/lib/duet/{p-e7b53f4f.system.entry.js → p-854558fd.system.entry.js} +1 -1
  123. package/lib/duet/{p-c514010b.system.entry.js → p-85507ac3.system.entry.js} +1 -1
  124. package/lib/duet/p-8a241b0d.system.js +4 -0
  125. package/lib/duet/p-8ab8531d.entry.js +4 -0
  126. package/lib/duet/{p-eb892975.system.entry.js → p-8ff7380a.system.entry.js} +1 -1
  127. package/lib/duet/p-92639d0b.system.js +4 -0
  128. package/lib/duet/{p-3d1b0105.entry.js → p-97b9a61f.entry.js} +1 -1
  129. package/lib/duet/{p-3bb702e3.system.entry.js → p-97f24160.system.entry.js} +2 -2
  130. package/lib/duet/{p-740b5609.entry.js → p-9816d0ab.entry.js} +1 -1
  131. package/lib/duet/{p-ae14591e.entry.js → p-9c37e704.entry.js} +1 -1
  132. package/lib/duet/p-9c57b94d.system.entry.js +4 -0
  133. package/lib/duet/{p-635dacce.system.entry.js → p-9fa719d0.system.entry.js} +1 -1
  134. package/lib/duet/p-a4c7bb27.system.entry.js +4 -0
  135. package/lib/duet/{p-3c3536be.entry.js → p-a9158499.entry.js} +1 -1
  136. package/lib/duet/{p-e7dd8a15.system.entry.js → p-a934db65.system.entry.js} +1 -1
  137. package/lib/duet/{p-e35d8543.entry.js → p-acb043aa.entry.js} +1 -1
  138. package/lib/duet/{p-7f0e360d.entry.js → p-b2811c51.entry.js} +1 -1
  139. package/lib/duet/{p-d24c6bc1.entry.js → p-b53afa7a.entry.js} +1 -1
  140. package/lib/duet/{p-0366552b.system.entry.js → p-b686f39d.system.entry.js} +1 -1
  141. package/lib/duet/{p-ebc56043.entry.js → p-b6d5be13.entry.js} +1 -1
  142. package/lib/duet/{p-e8303364.system.entry.js → p-bb61f7d8.system.entry.js} +1 -1
  143. package/lib/duet/{p-12941aef.system.entry.js → p-bc895d5f.system.entry.js} +1 -1
  144. package/lib/duet/{p-e47daca7.system.entry.js → p-beca945d.system.entry.js} +1 -1
  145. package/lib/duet/{p-dcaecb5e.js → p-c420e1ab.js} +1 -1
  146. package/lib/duet/{p-5b546064.entry.js → p-c801c899.entry.js} +1 -1
  147. package/lib/duet/{p-3547d108.entry.js → p-c8f1cc9c.entry.js} +1 -1
  148. package/lib/duet/{p-c8ec3b99.entry.js → p-cd8c4a50.entry.js} +1 -1
  149. package/lib/duet/{p-b6dd0933.entry.js → p-ce487a35.entry.js} +1 -1
  150. package/lib/duet/{p-c6df2ea8.system.entry.js → p-ce6e5918.system.entry.js} +1 -1
  151. package/lib/duet/{p-c2d32103.entry.js → p-d03cb5c3.entry.js} +1 -1
  152. package/lib/duet/p-d173c966.entry.js +4 -0
  153. package/lib/duet/{p-79b9e7ef.system.entry.js → p-d414e0f6.system.entry.js} +1 -1
  154. package/lib/duet/{p-8143f3de.js → p-d7bc0102.js} +0 -0
  155. package/lib/duet/{p-24b9e806.entry.js → p-d7d80b8e.entry.js} +1 -1
  156. package/lib/duet/p-d8ed6905.entry.js +4 -0
  157. package/lib/duet/{p-562ae946.entry.js → p-da61c503.entry.js} +1 -1
  158. package/lib/duet/p-dbb4a588.js +4 -0
  159. package/lib/duet/p-dd8fade8.entry.js +4 -0
  160. package/lib/duet/{p-1db7a35b.entry.js → p-de67de41.entry.js} +1 -1
  161. package/lib/duet/{p-9df321b3.system.entry.js → p-def972d1.system.entry.js} +1 -1
  162. package/lib/duet/p-df2d8ec4.entry.js +4 -0
  163. package/lib/duet/{p-05e2c680.system.entry.js → p-e35ea4b9.system.entry.js} +1 -1
  164. package/lib/duet/{p-ad3dad04.system.js → p-e9ab7f0a.system.js} +1 -1
  165. package/lib/duet/{p-7a32ceb3.system.entry.js → p-eb383537.system.entry.js} +1 -1
  166. package/lib/duet/{p-ad07f399.js → p-ed75c8b3.js} +0 -0
  167. package/lib/duet/{p-c18080ad.entry.js → p-ee8682fc.entry.js} +1 -1
  168. package/lib/duet/p-f155c84d.system.entry.js +4 -0
  169. package/lib/duet/{p-d945a4b0.system.entry.js → p-f1b895c8.system.entry.js} +1 -1
  170. package/lib/duet/{p-89e42127.system.entry.js → p-f5af2560.system.entry.js} +1 -1
  171. package/lib/duet/{p-3900577d.system.entry.js → p-f7475d5a.system.entry.js} +1 -1
  172. package/lib/duet/p-f7c7f37d.js +4 -0
  173. package/lib/duet/{p-210d739c.system.entry.js → p-feca1c50.system.entry.js} +1 -1
  174. package/lib/esm/duet-action-button.entry.js +159 -0
  175. package/lib/esm/duet-alert.entry.js +1 -1
  176. package/lib/esm/duet-badge.entry.js +1 -1
  177. package/lib/esm/duet-breadcrumb.entry.js +1 -1
  178. package/lib/esm/duet-breadcrumbs.entry.js +1 -1
  179. package/lib/esm/duet-button_2.entry.js +8 -4
  180. package/lib/esm/duet-caption_4.entry.js +3 -3
  181. package/lib/esm/duet-card.entry.js +3 -3
  182. package/lib/esm/duet-checkbox.entry.js +1 -1
  183. package/lib/esm/duet-choice_2.entry.js +4 -4
  184. package/lib/esm/duet-collapsible.entry.js +2 -2
  185. package/lib/esm/duet-cookie-consent.entry.js +1 -1
  186. package/lib/esm/duet-date-picker.entry.js +4 -4
  187. package/lib/esm/duet-divider_2.entry.js +1 -1
  188. package/lib/esm/{duet-editable-table_4.entry.js → duet-editable-table_3.entry.js} +384 -338
  189. package/lib/esm/duet-empty-state.entry.js +1 -1
  190. package/lib/esm/duet-fieldset.entry.js +1 -1
  191. package/lib/esm/duet-footer.entry.js +1 -1
  192. package/lib/esm/duet-grid_2.entry.js +2 -2
  193. package/lib/esm/duet-header_2.entry.js +7 -7
  194. package/lib/esm/duet-hero.entry.js +1 -1
  195. package/lib/esm/duet-icon.entry.js +3 -3
  196. package/lib/esm/duet-input_2.entry.js +1 -1
  197. package/lib/esm/duet-layout.entry.js +1 -1
  198. package/lib/esm/duet-list_2.entry.js +1 -1
  199. package/lib/esm/duet-modal.entry.js +2 -2
  200. package/lib/esm/duet-notification_2.entry.js +1 -1
  201. package/lib/esm/duet-number-input.entry.js +1 -1
  202. package/lib/esm/duet-pagination_2.entry.js +24 -14
  203. package/lib/esm/duet-progress.entry.js +1 -1
  204. package/lib/esm/duet-radio_2.entry.js +1 -1
  205. package/lib/esm/duet-range-slider.entry.js +2 -2
  206. package/lib/esm/duet-scrollable_3.entry.js +1 -1
  207. package/lib/esm/duet-select.entry.js +1 -1
  208. package/lib/esm/duet-step_2.entry.js +1 -1
  209. package/lib/esm/duet-textarea.entry.js +1 -1
  210. package/lib/esm/duet-toggle.entry.js +1 -1
  211. package/lib/esm/duet-tooltip.entry.js +1 -1
  212. package/lib/esm/duet-tray.entry.js +2 -2
  213. package/lib/esm/duet-upload-aria-status.entry.js +1 -1
  214. package/lib/esm/duet-visually-hidden.entry.js +1 -1
  215. package/lib/esm/duet.js +2 -2
  216. package/lib/esm/{focus-utils-d4e80e1e.js → focus-utils-46b28332.js} +1 -1
  217. package/lib/esm/{index-4a5e7664.js → index-8743db3b.js} +1 -1
  218. package/lib/esm/js-utils-52e0944c.js +36 -0
  219. package/lib/esm/loader.js +2 -2
  220. package/lib/esm/{token-utils-e9a69acf.js → token-utils-e9a0cb88.js} +1 -1
  221. package/lib/esm/{tokens-e110dc89.js → tokens-57d98824.js} +0 -0
  222. package/lib/esm/{tokens.module-49cbf963.js → tokens.module-a13e9683.js} +0 -0
  223. package/lib/esm-es5/duet-action-button.entry.js +4 -0
  224. package/lib/esm-es5/duet-alert.entry.js +1 -1
  225. package/lib/esm-es5/duet-badge.entry.js +1 -1
  226. package/lib/esm-es5/duet-breadcrumb.entry.js +1 -1
  227. package/lib/esm-es5/duet-breadcrumbs.entry.js +1 -1
  228. package/lib/esm-es5/duet-button_2.entry.js +1 -1
  229. package/lib/esm-es5/duet-caption_4.entry.js +1 -1
  230. package/lib/esm-es5/duet-card.entry.js +1 -1
  231. package/lib/esm-es5/duet-checkbox.entry.js +1 -1
  232. package/lib/esm-es5/duet-choice_2.entry.js +1 -1
  233. package/lib/esm-es5/duet-collapsible.entry.js +1 -1
  234. package/lib/esm-es5/duet-cookie-consent.entry.js +1 -1
  235. package/lib/esm-es5/duet-date-picker.entry.js +2 -2
  236. package/lib/esm-es5/duet-divider_2.entry.js +1 -1
  237. package/lib/esm-es5/duet-editable-table_3.entry.js +4 -0
  238. package/lib/esm-es5/duet-empty-state.entry.js +1 -1
  239. package/lib/esm-es5/duet-fieldset.entry.js +1 -1
  240. package/lib/esm-es5/duet-footer.entry.js +1 -1
  241. package/lib/esm-es5/duet-grid_2.entry.js +1 -1
  242. package/lib/esm-es5/duet-header_2.entry.js +1 -1
  243. package/lib/esm-es5/duet-hero.entry.js +1 -1
  244. package/lib/esm-es5/duet-icon.entry.js +1 -1
  245. package/lib/esm-es5/duet-input_2.entry.js +1 -1
  246. package/lib/esm-es5/duet-layout.entry.js +1 -1
  247. package/lib/esm-es5/duet-list_2.entry.js +1 -1
  248. package/lib/esm-es5/duet-modal.entry.js +1 -1
  249. package/lib/esm-es5/duet-notification_2.entry.js +1 -1
  250. package/lib/esm-es5/duet-number-input.entry.js +1 -1
  251. package/lib/esm-es5/duet-pagination_2.entry.js +2 -2
  252. package/lib/esm-es5/duet-progress.entry.js +1 -1
  253. package/lib/esm-es5/duet-radio_2.entry.js +1 -1
  254. package/lib/esm-es5/duet-range-slider.entry.js +1 -1
  255. package/lib/esm-es5/duet-scrollable_3.entry.js +1 -1
  256. package/lib/esm-es5/duet-select.entry.js +1 -1
  257. package/lib/esm-es5/duet-step_2.entry.js +1 -1
  258. package/lib/esm-es5/duet-textarea.entry.js +1 -1
  259. package/lib/esm-es5/duet-toggle.entry.js +1 -1
  260. package/lib/esm-es5/duet-tooltip.entry.js +1 -1
  261. package/lib/esm-es5/duet-tray.entry.js +1 -1
  262. package/lib/esm-es5/duet-upload-aria-status.entry.js +1 -1
  263. package/lib/esm-es5/duet-visually-hidden.entry.js +1 -1
  264. package/lib/esm-es5/duet.js +1 -1
  265. package/lib/esm-es5/focus-utils-46b28332.js +4 -0
  266. package/lib/esm-es5/{index-4a5e7664.js → index-8743db3b.js} +1 -1
  267. package/lib/esm-es5/js-utils-52e0944c.js +4 -0
  268. package/lib/esm-es5/loader.js +1 -1
  269. package/lib/esm-es5/{token-utils-e9a69acf.js → token-utils-e9a0cb88.js} +1 -1
  270. package/lib/esm-es5/{tokens-e110dc89.js → tokens-57d98824.js} +0 -0
  271. package/lib/esm-es5/{tokens.module-49cbf963.js → tokens.module-a13e9683.js} +0 -0
  272. package/lib/html.html-data.json +169 -69
  273. package/lib/types/components/duet-action-button/duet-action-button.d.ts +112 -0
  274. package/lib/types/components/duet-button/duet-button.d.ts +4 -0
  275. package/lib/types/components/duet-editable-table/duet-editable-table-tabledata.d.ts +2 -2
  276. package/lib/types/components/duet-editable-table/duet-editable-table.d.ts +106 -48
  277. package/lib/types/components/duet-header/duet-header.d.ts +1 -0
  278. package/lib/types/components/duet-pagination/duet-pagination.d.ts +7 -2
  279. package/lib/types/components/duet-table/duet-table.d.ts +16 -0
  280. package/lib/types/components/duet-upload/duet-upload.d.ts +68 -58
  281. package/lib/types/components.d.ts +225 -149
  282. package/lib/types/utils/js-utils.d.ts +2 -0
  283. package/package.json +8 -16
  284. package/lib/cjs/duet-editable-table-button.cjs.entry.js +0 -96
  285. package/lib/cjs/js-utils-33a9dbe3.js +0 -16
  286. package/lib/collection/components/duet-editable-table/duet-editable-table-button.css +0 -32
  287. package/lib/collection/components/duet-editable-table/duet-editable-table-button.js +0 -225
  288. package/lib/collection/components/duet-editable-table/duet-editable-table-item.css +0 -36
  289. package/lib/collection/components/duet-editable-table/duet-editable-table-item.js +0 -225
  290. package/lib/duet/p-063fe96d.entry.js +0 -4
  291. package/lib/duet/p-2361986e.entry.js +0 -4
  292. package/lib/duet/p-2eeacf1a.entry.js +0 -4
  293. package/lib/duet/p-396f1bdc.entry.js +0 -4
  294. package/lib/duet/p-493c6d2f.system.entry.js +0 -4
  295. package/lib/duet/p-7b55f33e.entry.js +0 -4
  296. package/lib/duet/p-7e0e2209.system.entry.js +0 -4
  297. package/lib/duet/p-81867417.system.js +0 -4
  298. package/lib/duet/p-a3d7951c.system.entry.js +0 -4
  299. package/lib/duet/p-a619dff3.system.js +0 -4
  300. package/lib/duet/p-b25d3769.js +0 -4
  301. package/lib/duet/p-bf192d9f.entry.js +0 -4
  302. package/lib/duet/p-c76a68aa.system.entry.js +0 -4
  303. package/lib/duet/p-d12b3d21.system.entry.js +0 -4
  304. package/lib/duet/p-ded33218.system.entry.js +0 -4
  305. package/lib/duet/p-e6a69eb8.js +0 -4
  306. package/lib/duet/p-ef4962e8.entry.js +0 -4
  307. package/lib/duet/p-ff21f3c2.entry.js +0 -4
  308. package/lib/esm/duet-editable-table-button.entry.js +0 -92
  309. package/lib/esm/js-utils-b69f17df.js +0 -14
  310. package/lib/esm-es5/duet-editable-table-button.entry.js +0 -4
  311. package/lib/esm-es5/duet-editable-table_4.entry.js +0 -4
  312. package/lib/esm-es5/focus-utils-d4e80e1e.js +0 -4
  313. package/lib/esm-es5/js-utils-b69f17df.js +0 -4
  314. package/lib/types/components/duet-editable-table/duet-editable-table-button.d.ts +0 -73
  315. package/lib/types/components/duet-editable-table/duet-editable-table-item.d.ts +0 -76
@@ -22,25 +22,6 @@ import { makeXhrRequest } from "./xhr.helpers";
22
22
  */
23
23
  export class DuetUpload {
24
24
  constructor() {
25
- /**
26
- * Own Properties
27
- */
28
- this.buttonId = createID("DuetButton");
29
- this.labelId = createID("DuetLabel");
30
- this.uploadId = createID("DuetUpload");
31
- this.editableTableId = createID("DuetEditableTable");
32
- this.filesInProgress = new Map();
33
- this.fileMaxReached = false;
34
- this.bytesMaxReached = false;
35
- this.internalStatusMessageLabel = undefined;
36
- /**
37
- * Properties
38
- */
39
- this.DefaultGroups = {
40
- inprogress: "inprogress",
41
- success: "success",
42
- failure: "failure",
43
- };
44
25
  /**
45
26
  * State() variables
46
27
  */
@@ -62,8 +43,9 @@ export class DuetUpload {
62
43
  {
63
44
  icon: "action-delete",
64
45
  color: "color-danger",
65
- color_hover: "primary-dark",
66
- id: "delete",
46
+ size: "x-small",
47
+ background: "gray-lightest",
48
+ name: "delete",
67
49
  map: ["success", "failure"],
68
50
  label: {
69
51
  fi: "Poista tiedosto",
@@ -74,8 +56,9 @@ export class DuetUpload {
74
56
  {
75
57
  icon: "navigation-close",
76
58
  color: "primary",
77
- color_hover: "primary-dark",
78
- id: "cancel",
59
+ size: "x-small",
60
+ background: "gray-lightest",
61
+ name: "cancel",
79
62
  map: ["inprogress"],
80
63
  label: {
81
64
  fi: "Keskeytä lähetys",
@@ -145,8 +128,8 @@ export class DuetUpload {
145
128
  inProgressWithErrors: "Uploading {filesInProgress}, {filesUploaded} uploaded of {filesTotal}, {filesWithErrors} failed",
146
129
  done: "All {filesTotal} added successfully",
147
130
  doneWithErrors: "Action completed, {filesUploaded} has been added successfully, {filesWithErrors} had errors",
148
- files: "tiedostoa",
149
- file: "tiedosto",
131
+ files: "File",
132
+ file: "file",
150
133
  },
151
134
  };
152
135
  /**
@@ -301,19 +284,72 @@ export class DuetUpload {
301
284
  * by default this is off, setting this to true will limit the users choices to what has been explicitly set
302
285
  */
303
286
  this.limitSelection = false;
287
+ /**
288
+ * Own Properties
289
+ */
290
+ this.buttonId = createID("DuetButton");
291
+ this.labelId = createID("DuetLabel");
292
+ this.uploadId = createID("DuetUpload");
293
+ this.filesInProgress = new Map();
294
+ this.fileMaxReached = false;
295
+ this.bytesMaxReached = false;
296
+ this.internalStatusMessageLabel = undefined;
297
+ /**
298
+ * Properties
299
+ */
300
+ this.DefaultGroups = {
301
+ inprogress: "inprogress",
302
+ success: "success",
303
+ failure: "failure",
304
+ };
305
+ /**
306
+ * Array of group names that you want the editable table to use to display files
307
+ * @required
308
+ * @example [{ id: "success", label: {fi: "Onnistunut", en: "Success", sv: "Alt klart", }}]
309
+ */
310
+ this.groups = [
311
+ {
312
+ id: this.DefaultGroups.inprogress,
313
+ label: {
314
+ fi: "Kesken olevat tiedostot",
315
+ sv: "Filer inprogress",
316
+ en: "Files inprogress",
317
+ },
318
+ },
319
+ {
320
+ id: this.DefaultGroups.success,
321
+ label: {
322
+ fi: "Valmiit tiedostot",
323
+ sv: "Files success",
324
+ en: "Files success",
325
+ },
326
+ },
327
+ {
328
+ id: this.DefaultGroups.failure,
329
+ label: {
330
+ fi: "Tiedostot, joissa on virheitä",
331
+ sv: "Filer med fel",
332
+ en: "Files with errors",
333
+ },
334
+ },
335
+ ];
336
+ this.kick = debounce(() => {
337
+ this.tick = Date.now();
338
+ }, 30); // will trigger re-render
304
339
  /**
305
340
  * Private functions
306
341
  */
307
342
  this.listenForActionEvents = () => {
308
- this.element.addEventListener("duetEditableItemAction", (e) => {
343
+ this.element.addEventListener("duetActionEvent", (e) => {
309
344
  const detail = e.detail;
310
- const { action, keyName, originalEvent } = detail;
345
+ const { action, id, originalEvent } = detail;
346
+ console.log(e);
311
347
  switch (action) {
312
348
  case "delete":
313
- this.onDelete(keyName, originalEvent);
349
+ this.onDelete(id, originalEvent);
314
350
  break;
315
351
  case "cancel":
316
- this.onCancel(keyName, originalEvent);
352
+ this.onCancel(id, originalEvent);
317
353
  break;
318
354
  default:
319
355
  // code block
@@ -371,24 +407,6 @@ export class DuetUpload {
371
407
  return "none";
372
408
  }
373
409
  };
374
- this.convertToDuetEditableTableItems = () => {
375
- // we're always recreating the map - in order to force an update down stream.
376
- const itemData = new Map();
377
- //walk the files Map and convert to DuetEditableTableItemData
378
- this.files.forEach((data, key, _originalMap) => {
379
- const group = this.getGroupFromItemData(data);
380
- const item = this.getItemHTMLFromItemData(data, group);
381
- itemData.set(key, {
382
- uid: data.uid,
383
- item,
384
- group,
385
- });
386
- });
387
- return itemData;
388
- };
389
- this.kick = debounce(() => {
390
- this.tick = Date.now();
391
- }, 30); // will trigger re-render
392
410
  this.genHashName = () => Date.now().toString(36) + Math.random();
393
411
  this.updateValueInMap = (item, key, value, kick = true) => {
394
412
  const fileItem = this.files.get(item);
@@ -449,7 +467,6 @@ export class DuetUpload {
449
467
  this.nativeInput.value = "";
450
468
  };
451
469
  this.startUpload = async (ev, metaData = undefined) => {
452
- await this.setFocus();
453
470
  this.metaData = metaData;
454
471
  this.nativeInput.click();
455
472
  this.onUpload(ev, metaData);
@@ -512,9 +529,18 @@ export class DuetUpload {
512
529
  fileMaxReached: isTotalFileAmountAboveMax,
513
530
  };
514
531
  };
532
+ this.getItemFromUID = (uid) => {
533
+ for (const [key, value] of this.files.entries()) {
534
+ if (value.uid === uid) {
535
+ return { value, key };
536
+ }
537
+ }
538
+ return null;
539
+ };
515
540
  this.onDelete = (key, ev) => {
516
- const deletedItem = this.files.get(key);
517
- this.files.delete(key);
541
+ const retrievedKey = this.getItemFromUID(key).key;
542
+ const deletedItem = this.files.get(retrievedKey);
543
+ this.files.delete(retrievedKey);
518
544
  this.validateTotals();
519
545
  this.kick();
520
546
  this.duetDelete.emit({
@@ -528,8 +554,9 @@ export class DuetUpload {
528
554
  this.resetFormFields();
529
555
  };
530
556
  this.onCancel = (key, ev) => {
531
- const cancelledItem = this.files.get(key);
532
- this.files.delete(key);
557
+ const retrievedKey = this.getItemFromUID(key).key;
558
+ const cancelledItem = this.files.get(retrievedKey);
559
+ this.files.delete(retrievedKey);
533
560
  if (!this.external) {
534
561
  const { xhr } = cancelledItem;
535
562
  xhr.abort();
@@ -579,6 +606,87 @@ export class DuetUpload {
579
606
  data: { files: this.files },
580
607
  });
581
608
  };
609
+ /**
610
+ * @description This functions return sorted map items byg condition which are:
611
+ */
612
+ this.filterMap = () => {
613
+ const all = [...this.files.values()];
614
+ const inprogress = [];
615
+ const failure = [];
616
+ const success = [];
617
+ all.forEach(data => {
618
+ const group = this.getGroupFromItemData(data);
619
+ const item = this.getItemHTMLFromItemData(data, group);
620
+ if (group === this.DefaultGroups.success) {
621
+ success.push({
622
+ uid: data.uid,
623
+ item,
624
+ group,
625
+ });
626
+ }
627
+ else if (group === this.DefaultGroups.inprogress) {
628
+ inprogress.push({
629
+ uid: data.uid,
630
+ item,
631
+ group,
632
+ });
633
+ }
634
+ else if (group === this.DefaultGroups.failure) {
635
+ failure.push({
636
+ uid: data.uid,
637
+ item,
638
+ group,
639
+ });
640
+ }
641
+ else if (data.group) {
642
+ inprogress.push({
643
+ uid: data.uid,
644
+ item,
645
+ group: data.group,
646
+ });
647
+ }
648
+ });
649
+ return {
650
+ inprogress,
651
+ failure,
652
+ success,
653
+ };
654
+ };
655
+ this.getColumns = (group) => {
656
+ return [
657
+ {
658
+ sort_order: 1,
659
+ direction: 1,
660
+ index: 0,
661
+ key: group.id,
662
+ label: group.label,
663
+ },
664
+ ];
665
+ };
666
+ this.getActions = (id) => {
667
+ return this.actions.filter(item => item.map.includes(id));
668
+ };
669
+ this.renderEditableTableGroups = () => {
670
+ const filteredItems = this.filterMap();
671
+ const EditableTables = this.groups.map(group => {
672
+ const currentItems = filteredItems[group.id];
673
+ if (!(currentItems === null || currentItems === void 0 ? void 0 : currentItems.length)) {
674
+ return;
675
+ }
676
+ return (h("duet-table", { variation: "plain", breakpoint: "none", role: "log", margin: this.hideGroups ? "none" : "auto" },
677
+ h("table", { class: "duet-upload-editable-table" },
678
+ h("thead", { class: "duet-upload-editable-table-header" },
679
+ h("tr", null,
680
+ h("th", { class: {
681
+ "duet-upload-editable-table-header-hidden": this.hideGroups,
682
+ } }, !this.hideGroups ? (getLocaleString(group.label)) : (h("duet-visually-hidden", null, getLocaleString(group.label)))))),
683
+ h("tbody", null,
684
+ h("tr", null,
685
+ h("td", { class: "duet-upload-editable-table-data" },
686
+ h("duet-editable-table", { breakpoint: "none", variation: "plain", groupId: group.id, columns: this.getColumns(group), actions: this.getActions(group.id), margin: "none", rows: currentItems })))))));
687
+ });
688
+ return EditableTables;
689
+ };
582
690
  }
583
691
  watchValidHandler(newValue, oldValue) {
584
692
  if (newValue !== oldValue) {
@@ -602,6 +710,84 @@ export class DuetUpload {
602
710
  // listen to the events from the component
603
711
  this.verifyValidity();
604
712
  }
713
+ /**
714
+ * Sets focus on the specified `duet-input`. Use this method instead of the global
715
+ * `input.focus()`.
716
+ */
717
+ async setFocus(options) {
718
+ if (this.nativeInput) {
719
+ this.nativeInput.focus(options);
720
+ }
721
+ return;
722
+ }
723
+ /**
724
+ * Method for invoking the upload sequence
725
+ */
726
+ async upload(metaData = undefined) {
727
+ await this.setFocus();
728
+ this.metaData = metaData;
729
+ this.nativeInput.click();
730
+ return;
731
+ }
732
+ /**
733
+ * Method for forcing a render of the upload list, element.files can be changed externally
734
+ * But it will only rerender on a new Map or a top Level change - this can be used to update
735
+ * the tabular data if the automatic re-render is no sufficient
736
+ */
737
+ async refresh() {
738
+ this.kick();
739
+ await this.setFocus();
740
+ }
741
+ /**
742
+ * Get list of files, divided in errors and valid sections
743
+ */
744
+ async getFiles() {
745
+ if (!this.files || this.files.size === 0) {
746
+ return false;
747
+ }
748
+ return this.getFilesAsArray();
749
+ }
750
+ /**
751
+ * Convenience method for updating the value of a key:value inside an item in the files attribute
752
+ */
753
+ async updateValue(item, key, value) {
754
+ this.updateValueInMap(item, key, value);
755
+ }
756
+ /**
757
+ * render() function
758
+ * Always the last one in the class.
759
+ */
760
+ render() {
761
+ const identifier = this.identifier || this.uploadId;
762
+ let caption = this.description.replace(/{maxfiles}/g, this.maxFiles.toString());
763
+ caption = caption.replace(/{maxbytes}/g, `${Math.floor(this.maxBytes / 1024 / 1024)} MB`);
764
+ caption = caption.replace(/{filetypes}/g, this.allowedExtensions.split(",").join(", "));
765
+ return (h(Host, { class: { "duet-m-0": this.margin === "none" } },
766
+ h("duet-fieldset", { label: this.label, caption: caption },
767
+ h("slot", { name: "header" }),
768
+ !this.files.size && (h("duet-label", { part: this.identifier ? `${this.identifier}-empty-state` : "duet-upload-empty-state", theme: this.theme === "turva" ? "turva" : "default", size: "small", class: {
769
+ "duet-upload-filelist-empty": !this.files.size,
770
+ "duet-upload-filelist": true,
771
+ "duet-upload-filelist-filled": this.files.size,
772
+ }, id: this.labelId, for: identifier }, this.fileListEmpty)),
773
+ !!this.files.size && h("slot", { name: "fileheader" }),
774
+ !!this.files.size && (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 })),
775
+ !!this.files.size && this.renderEditableTableGroups(),
776
+ !!this.files.size && h("slot", { name: "filefooter" }),
777
+ h("duet-spacer", { size: "large" }),
778
+ !this.hideButton && (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)),
779
+ h("duet-spacer", { size: "medium" }),
780
+ (this.fileMaxReached || this.bytesMaxReached) && (h("duet-alert", { part: this.identifier ? `${this.identifier}-error-notification` : "duet-upload-error-notification" },
781
+ this.fileMaxReached && getI18nError("duet-upload-301"),
782
+ this.bytesMaxReached && getI18nError("duet-upload-202"))),
783
+ h("duet-spacer", { size: "medium" }),
784
+ h("duet-visually-hidden", null,
785
+ h("input", { ref: input => {
786
+ this.nativeInput = input;
787
+ }, accept: !this.limitSelection ? undefined : `${this.allowedMimetypes},${this.allowedExtensions}`, onBlur: this.onBlur, onFocus: this.onFocus, onChange: e => this.onChange(e), type: "file", class: {
788
+ "duet-upload": true,
789
+ }, disabled: this.disabled, "aria-hidden": "true", required: this.required, name: this.name, id: this.identifier, multiple: this.multiple, capture: "user" })))));
790
+ }
605
791
  /**
606
792
  * XHR request utilities
607
793
  */
@@ -723,84 +909,6 @@ export class DuetUpload {
723
909
  component: "duet-upload",
724
910
  });
725
911
  }
726
- /**
727
- * Sets focus on the specified `duet-input`. Use this method instead of the global
728
- * `input.focus()`.
729
- */
730
- async setFocus(options) {
731
- if (this.nativeInput) {
732
- this.nativeInput.focus(options);
733
- }
734
- return;
735
- }
736
- /**
737
- * Method for invoking the upload sequence
738
- */
739
- async upload(metaData = undefined) {
740
- await this.setFocus();
741
- this.metaData = metaData;
742
- this.nativeInput.click();
743
- return;
744
- }
745
- /**
746
- * Method for forcing a render of the upload list, element.files can be changed externally
747
- * But it will only rerender on a new Map or a top Level change - this can be used to update
748
- * the tabular data if the automatic re-render is no sufficient
749
- */
750
- async refresh() {
751
- this.kick();
752
- await this.setFocus();
753
- }
754
- /**
755
- * Get list of files, divided in errors and valid sections
756
- */
757
- async getFiles() {
758
- if (!this.files || this.files.size === 0) {
759
- return false;
760
- }
761
- return this.getFilesAsArray();
762
- }
763
- /**
764
- * Convenience method for updating the value of a key:value inside an item in the files attribute
765
- */
766
- async updateValue(item, key, value) {
767
- this.updateValueInMap(item, key, value);
768
- }
769
- /**
770
- * render() function
771
- * Always the last one in the class.
772
- */
773
- render() {
774
- const identifier = this.identifier || this.uploadId;
775
- let caption = this.description.replace(/{maxfiles}/g, this.maxFiles.toString());
776
- caption = caption.replace(/{maxbytes}/g, `${Math.floor(this.maxBytes / 1024 / 1024)} MB`);
777
- caption = caption.replace(/{filetypes}/g, this.allowedExtensions.split(",").join(", "));
778
- return (h(Host, { class: { "duet-m-0": this.margin === "none" } },
779
- h("duet-fieldset", { label: this.label, caption: caption },
780
- h("slot", { name: "header" }),
781
- !this.files.size && (h("duet-label", { part: this.identifier ? `${this.identifier}-empty-state` : "duet-upload-empty-state", theme: this.theme === "turva" ? "turva" : "default", size: "small", class: {
782
- "duet-upload-filelist-empty": !this.files.size,
783
- "duet-upload-filelist": true,
784
- "duet-upload-filelist-filled": this.files.size,
785
- }, id: this.labelId, for: identifier }, this.fileListEmpty)),
786
- !!this.files.size && h("slot", { name: "fileheader" }),
787
- !!this.files.size && (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 })),
788
- !!this.files.size && (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() })),
789
- !!this.files.size && h("slot", { name: "filefooter" }),
790
- h("duet-spacer", { size: "large" }),
791
- !this.hideButton && (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)),
792
- h("duet-spacer", { size: "medium" }),
793
- (this.fileMaxReached || this.bytesMaxReached) && (h("duet-alert", { part: this.identifier ? `${this.identifier}-error-notification` : "duet-upload-error-notification" },
794
- this.fileMaxReached && getI18nError("duet-upload-301"),
795
- this.bytesMaxReached && getI18nError("duet-upload-202"))),
796
- h("duet-spacer", { size: "medium" }),
797
- h("duet-visually-hidden", null,
798
- h("input", { ref: input => {
799
- this.nativeInput = input;
800
- }, accept: !this.limitSelection ? undefined : `${this.allowedMimetypes},${this.allowedExtensions}`, onBlur: this.onBlur, onFocus: this.onFocus, onChange: e => this.onChange(e), type: "file", class: {
801
- "duet-upload": true,
802
- }, disabled: this.disabled, "aria-hidden": "true", required: this.required, name: this.name, id: this.identifier, multiple: this.multiple, capture: "user" })))));
803
- }
804
912
  static get is() { return "duet-upload"; }
805
913
  static get encapsulation() { return "shadow"; }
806
914
  static get originalStyleUrls() { return {
@@ -915,15 +1023,15 @@ export class DuetUpload {
915
1023
  "defaultValue": "false"
916
1024
  },
917
1025
  "actions": {
918
- "type": "string",
1026
+ "type": "unknown",
919
1027
  "mutable": false,
920
1028
  "complexType": {
921
- "original": "DuetEditableTableActions | string",
922
- "resolved": "string | { icon: string; color: string; color_hover: string; id: string; map?: string[]; label?: DuetLangObject; }[]",
1029
+ "original": "DuetEditableTableActions",
1030
+ "resolved": "{ icon: string; color: string; background: string; size: DuetActionButtonIconSize; name: string; map?: string[]; label?: DuetLangObject; }[]",
923
1031
  "references": {
924
1032
  "DuetEditableTableActions": {
925
1033
  "location": "import",
926
- "path": "../duet-editable-table/duet-editable-table-item"
1034
+ "path": "../duet-editable-table/duet-editable-table"
927
1035
  }
928
1036
  }
929
1037
  },
@@ -933,9 +1041,7 @@ export class DuetUpload {
933
1041
  "tags": [],
934
1042
  "text": "Default actions added to the internally used duet-editable-table"
935
1043
  },
936
- "attribute": "actions",
937
- "reflect": false,
938
- "defaultValue": "[\n {\n icon: \"action-delete\",\n color: \"color-danger\",\n color_hover: \"primary-dark\",\n id: \"delete\",\n map: [\"success\", \"failure\"],\n label: {\n fi: \"Poista tiedosto\",\n en: \"Poista tiedosto\",\n sv: \"Ta bort filen\",\n },\n },\n {\n icon: \"navigation-close\",\n color: \"primary\",\n color_hover: \"primary-dark\",\n id: \"cancel\",\n map: [\"inprogress\"],\n label: {\n fi: \"Keskeyt\u00E4 l\u00E4hetys\",\n en: \"Cancel the upload\",\n sv: \"Stop \u00F6verf\u00F6ringen\",\n },\n },\n ]"
1044
+ "defaultValue": "[\n {\n icon: \"action-delete\",\n color: \"color-danger\",\n size: \"x-small\",\n background: \"gray-lightest\",\n name: \"delete\",\n map: [\"success\", \"failure\"],\n label: {\n fi: \"Poista tiedosto\",\n en: \"Poista tiedosto\",\n sv: \"Ta bort filen\",\n },\n },\n {\n icon: \"navigation-close\",\n color: \"primary\",\n size: \"x-small\",\n background: \"gray-lightest\",\n name: \"cancel\",\n map: [\"inprogress\"],\n label: {\n fi: \"Keskeyt\u00E4 l\u00E4hetys\",\n en: \"Cancel the upload\",\n sv: \"Stop \u00F6verf\u00F6ringen\",\n },\n },\n ]"
939
1045
  },
940
1046
  "uri": {
941
1047
  "type": "string",
@@ -1013,7 +1119,7 @@ export class DuetUpload {
1013
1119
  },
1014
1120
  "attribute": "status-label-default",
1015
1121
  "reflect": false,
1016
- "defaultValue": "{\n fi: {\n inProgress: \"L\u00E4hetet\u00E4\u00E4n {filesUploaded} l\u00E4hetett\u00E4v\u00E4st\u00E4 {filesTotal} tiedostosta\",\n inProgressWithErrors:\n \"L\u00E4hetet\u00E4\u00E4n {filesInProgress} tiedostoa, l\u00E4hetetty {filesUploaded} l\u00E4hetett\u00E4v\u00E4st\u00E4 {filesTotal} tiedostosta, {filesWithErrors} tiedostossa on virheit\u00E4\",\n done: \"Kaikki {filesTotal} tiedostoa l\u00E4hetetty onnistuneesti\",\n doneWithErrors:\n \"L\u00E4hetys valmis, {filesUploaded} tiedostoa on l\u00E4hetetty onnistuneesti, {filesWithErrors} tiedostossa oli virheit\u00E4\",\n files: \"tiedostot\",\n file: \"tiedosto\",\n },\n sv: {\n inProgress: \"Adding {filesUploaded} of {filesTotal}\",\n inProgressWithErrors:\n \"Laddar upp {filesInProgress}, {filesUploaded} uppladdad av {filesTotal}, {filesWithErrors} misslyckades\",\n done: \"Alla {filesTotal} har lagts till\",\n doneWithErrors: \"Handling slutf\u00F6rd, {filesUploaded} har lagts till, {filesWithErrors} misslyckades\",\n files: \"filer\",\n file: \"fil\",\n },\n en: {\n inProgress: \"Adding {filesUploaded} of {filesTotal}\",\n inProgressWithErrors:\n \"Uploading {filesInProgress}, {filesUploaded} uploaded of {filesTotal}, {filesWithErrors} failed\",\n done: \"All {filesTotal} added successfully\",\n doneWithErrors: \"Action completed, {filesUploaded} has been added successfully, {filesWithErrors} had errors\",\n files: \"tiedostoa\",\n file: \"tiedosto\",\n },\n }"
1122
+ "defaultValue": "{\n fi: {\n inProgress: \"L\u00E4hetet\u00E4\u00E4n {filesUploaded} l\u00E4hetett\u00E4v\u00E4st\u00E4 {filesTotal} tiedostosta\",\n inProgressWithErrors:\n \"L\u00E4hetet\u00E4\u00E4n {filesInProgress} tiedostoa, l\u00E4hetetty {filesUploaded} l\u00E4hetett\u00E4v\u00E4st\u00E4 {filesTotal} tiedostosta, {filesWithErrors} tiedostossa on virheit\u00E4\",\n done: \"Kaikki {filesTotal} tiedostoa l\u00E4hetetty onnistuneesti\",\n doneWithErrors:\n \"L\u00E4hetys valmis, {filesUploaded} tiedostoa on l\u00E4hetetty onnistuneesti, {filesWithErrors} tiedostossa oli virheit\u00E4\",\n files: \"tiedostot\",\n file: \"tiedosto\",\n },\n sv: {\n inProgress: \"Adding {filesUploaded} of {filesTotal}\",\n inProgressWithErrors:\n \"Laddar upp {filesInProgress}, {filesUploaded} uppladdad av {filesTotal}, {filesWithErrors} misslyckades\",\n done: \"Alla {filesTotal} har lagts till\",\n doneWithErrors: \"Handling slutf\u00F6rd, {filesUploaded} har lagts till, {filesWithErrors} misslyckades\",\n files: \"filer\",\n file: \"fil\",\n },\n en: {\n inProgress: \"Adding {filesUploaded} of {filesTotal}\",\n inProgressWithErrors:\n \"Uploading {filesInProgress}, {filesUploaded} uploaded of {filesTotal}, {filesWithErrors} failed\",\n done: \"All {filesTotal} added successfully\",\n doneWithErrors: \"Action completed, {filesUploaded} has been added successfully, {filesWithErrors} had errors\",\n files: \"File\",\n file: \"file\",\n },\n }"
1017
1123
  },
1018
1124
  "statusMessageLabel": {
1019
1125
  "type": "string",
@@ -1202,34 +1308,6 @@ export class DuetUpload {
1202
1308
  "reflect": false,
1203
1309
  "defaultValue": "false"
1204
1310
  },
1205
- "groups": {
1206
- "type": "string",
1207
- "mutable": false,
1208
- "complexType": {
1209
- "original": "DuetEditableTableGroupNames | string",
1210
- "resolved": "string | { id: string; label: DuetLangObject; actionLabel?: DuetLangObject; }[]",
1211
- "references": {
1212
- "DuetEditableTableGroupNames": {
1213
- "location": "import",
1214
- "path": "../duet-editable-table/duet-editable-table"
1215
- }
1216
- }
1217
- },
1218
- "required": false,
1219
- "optional": false,
1220
- "docs": {
1221
- "tags": [{
1222
- "name": "required",
1223
- "text": undefined
1224
- }, {
1225
- "name": "example",
1226
- "text": "[{ id: \"success\", label: {fi: \"Onnistunut\", en: \"Success\", sv: \"Alt klart\", }}]"
1227
- }],
1228
- "text": "Array of group names that you want the editable table to use to display files"
1229
- },
1230
- "attribute": "groups",
1231
- "reflect": false
1232
- },
1233
1311
  "alignment": {
1234
1312
  "type": "string",
1235
1313
  "mutable": false,
@@ -1628,6 +1706,32 @@ export class DuetUpload {
1628
1706
  },
1629
1707
  "attribute": "value",
1630
1708
  "reflect": false
1709
+ },
1710
+ "groups": {
1711
+ "type": "unknown",
1712
+ "mutable": false,
1713
+ "complexType": {
1714
+ "original": "DuetUploadTableGroupName[]",
1715
+ "resolved": "DuetUploadTableGroupName[]",
1716
+ "references": {
1717
+ "DuetUploadTableGroupName": {
1718
+ "location": "local"
1719
+ }
1720
+ }
1721
+ },
1722
+ "required": false,
1723
+ "optional": false,
1724
+ "docs": {
1725
+ "tags": [{
1726
+ "name": "required",
1727
+ "text": undefined
1728
+ }, {
1729
+ "name": "example",
1730
+ "text": "[{ id: \"success\", label: {fi: \"Onnistunut\", en: \"Success\", sv: \"Alt klart\", }}]"
1731
+ }],
1732
+ "text": "Array of group names that you want the editable table to use to display files"
1733
+ },
1734
+ "defaultValue": "[\n {\n id: this.DefaultGroups.inprogress,\n label: {\n fi: \"Kesken olevat tiedostot\",\n sv: \"Filer inprogress\",\n en: \"Files inprogress\",\n },\n },\n {\n id: this.DefaultGroups.success,\n label: {\n fi: \"Valmiit tiedostot\",\n sv: \"Files success\",\n en: \"Files success\",\n },\n },\n {\n id: this.DefaultGroups.failure,\n label: {\n fi: \"Tiedostot, joissa on virheit\u00E4\",\n sv: \"Filer med fel\",\n en: \"Files with errors\",\n },\n },\n ]"
1631
1735
  }
1632
1736
  }; }
1633
1737
  static get states() { return {
@@ -40,7 +40,7 @@ export const validateFile = (item, validators) => {
40
40
  if (item) {
41
41
  const { name, type, size } = item;
42
42
  const mime = validateFileMime(type, allowedMimetypes);
43
- const ext = validateFileExtension(name, allowedExtensions);
43
+ const ext = validateFileExtension(name.toLowerCase(), allowedExtensions);
44
44
  const bytes = validateFileSize(size, maxBytes);
45
45
  if (!mime) {
46
46
  errorMessage = getError("duet-upload-101");
@@ -28,7 +28,7 @@ function getAllFixturesFiles(dirPath, fixPath = "fixtures", skipFixture = []) {
28
28
  })
29
29
  .forEach(parsed => {
30
30
  const fixtureName = parsed.name.replace(`${component}_`, "");
31
- const fixtureHtml = fs.readFileSync(path.join(parsed.dir, parsed.base), "utf8");
31
+ const fixtureHtml = `<span id="fixture">${fs.readFileSync(path.join(parsed.dir, parsed.base), "utf8")}</fixture>`;
32
32
  fixtures[fixtureName] = fixtureHtml;
33
33
  });
34
34
  return {
@@ -99,10 +99,12 @@ export const fixtureTests = (componentFixtures, minHeight) => {
99
99
  const html = componentFixtures.fixtures[fixtureName];
100
100
  it(`${fixtureName} renders correctly with Turva theme`, async () => {
101
101
  const page = await createPage(htmlFragment(html, "turva", minHeight));
102
+ await page.find("#fixture");
102
103
  expect(await page.screenshot()).toMatchImageSnapshot();
103
104
  });
104
105
  it(`${fixtureName} renders correctly with Lahitapiola theme`, async () => {
105
106
  const page = await createPage(htmlFragment(html, "default", minHeight));
107
+ await page.find("#fixture");
106
108
  expect(await page.screenshot()).toMatchImageSnapshot();
107
109
  });
108
110
  });
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Built with Duet Design System
3
3
  */
4
- export const debounce = (func, timeout = 50) => {
4
+ export const debounce = (func, timeout = 250) => {
5
5
  let timer;
6
6
  return (...args) => {
7
7
  clearTimeout(timer);
@@ -10,3 +10,38 @@ export const debounce = (func, timeout = 50) => {
10
10
  }, timeout);
11
11
  };
12
12
  };
13
+ export function fieldSorter(fields) {
14
+ return function (a, b) {
15
+ return fields
16
+ .map(function (o) {
17
+ let dir = 1;
18
+ if (o[0] === "-") {
19
+ dir = -1;
20
+ o = o.substring(1);
21
+ }
22
+ if (a[o] > b[o]) {
23
+ return dir;
24
+ }
25
+ if (a[o] < b[o]) {
26
+ return -dir;
27
+ }
28
+ return 0;
29
+ })
30
+ .reduce(function firstNonZeroValue(p, n) {
31
+ return p ? p : n;
32
+ }, 0);
33
+ };
34
+ }
35
+ export const memoize = fn => {
36
+ const cache = {};
37
+ return value => {
38
+ if (value in cache) {
39
+ return cache[value];
40
+ }
41
+ else {
42
+ const result = fn(value);
43
+ cache[value] = result;
44
+ return result;
45
+ }
46
+ };
47
+ };
@@ -2,6 +2,12 @@
2
2
 
3
3
  import type { Components, JSX } from "../types/components";
4
4
 
5
+ interface DuetActionButton extends Components.DuetActionButton, HTMLElement {}
6
+ export const DuetActionButton: {
7
+ prototype: DuetActionButton;
8
+ new (): DuetActionButton;
9
+ };
10
+
5
11
  interface DuetAlert extends Components.DuetAlert, HTMLElement {}
6
12
  export const DuetAlert: {
7
13
  prototype: DuetAlert;
@@ -92,18 +98,6 @@ export const DuetEditableTable: {
92
98
  new (): DuetEditableTable;
93
99
  };
94
100
 
95
- interface DuetEditableTableButton extends Components.DuetEditableTableButton, HTMLElement {}
96
- export const DuetEditableTableButton: {
97
- prototype: DuetEditableTableButton;
98
- new (): DuetEditableTableButton;
99
- };
100
-
101
- interface DuetEditableTableItem extends Components.DuetEditableTableItem, HTMLElement {}
102
- export const DuetEditableTableItem: {
103
- prototype: DuetEditableTableItem;
104
- new (): DuetEditableTableItem;
105
- };
106
-
107
101
  interface DuetEmptyState extends Components.DuetEmptyState, HTMLElement {}
108
102
  export const DuetEmptyState: {
109
103
  prototype: DuetEmptyState;