@duetds/components 4.30.1 → 4.33.1

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 (427) hide show
  1. package/hydrate/index.js +1531 -442
  2. package/lib/cjs/{dom-e89ebf90.js → dom-c850c8d7.js} +1 -1
  3. package/lib/cjs/duet-alert.cjs.entry.js +4 -2
  4. package/lib/cjs/duet-badge.cjs.entry.js +2 -2
  5. package/lib/cjs/duet-button_2.cjs.entry.js +6 -5
  6. package/lib/cjs/duet-caption_4.cjs.entry.js +21 -15
  7. package/lib/cjs/duet-card.cjs.entry.js +6 -6
  8. package/lib/cjs/duet-checkbox.cjs.entry.js +2 -2
  9. package/lib/cjs/duet-choice_2.cjs.entry.js +55 -25
  10. package/lib/cjs/duet-collapsible.cjs.entry.js +5 -2
  11. package/lib/cjs/duet-cookie-consent.cjs.entry.js +1 -1
  12. package/lib/cjs/duet-date-picker.cjs.entry.js +23 -13
  13. package/lib/cjs/duet-divider_2.cjs.entry.js +1 -1
  14. package/lib/cjs/duet-editable-table-button.cjs.entry.js +89 -0
  15. package/lib/cjs/duet-editable-table_4.cjs.entry.js +1445 -0
  16. package/lib/cjs/duet-empty-state.cjs.entry.js +1 -1
  17. package/lib/cjs/duet-fieldset.cjs.entry.js +1 -1
  18. package/lib/cjs/duet-footer.cjs.entry.js +4 -4
  19. package/lib/cjs/duet-grid_2.cjs.entry.js +52 -4
  20. package/lib/cjs/duet-header_2.cjs.entry.js +26 -10
  21. package/lib/cjs/duet-hero.cjs.entry.js +6 -6
  22. package/lib/cjs/duet-icon.cjs.entry.js +21 -19
  23. package/lib/cjs/duet-input_2.cjs.entry.js +7 -7
  24. package/lib/cjs/duet-layout.cjs.entry.js +1 -1
  25. package/lib/cjs/duet-list_2.cjs.entry.js +2 -2
  26. package/lib/cjs/duet-modal.cjs.entry.js +8 -7
  27. package/lib/cjs/duet-notification_2.cjs.entry.js +6 -5
  28. package/lib/cjs/duet-number-input.cjs.entry.js +36 -15
  29. package/lib/cjs/duet-progress.cjs.entry.js +75 -0
  30. package/lib/cjs/duet-radio_2.cjs.entry.js +2 -2
  31. package/lib/cjs/duet-range-slider.cjs.entry.js +2 -2
  32. package/lib/cjs/duet-select.cjs.entry.js +6 -6
  33. package/lib/cjs/duet-step_2.cjs.entry.js +1 -1
  34. package/lib/cjs/duet-tab_2.cjs.entry.js +12 -6
  35. package/lib/cjs/duet-textarea.cjs.entry.js +5 -5
  36. package/lib/cjs/duet-toggle.cjs.entry.js +1 -1
  37. package/lib/cjs/duet-tooltip.cjs.entry.js +21 -10
  38. package/lib/cjs/duet-tray.cjs.entry.js +21 -10
  39. package/lib/cjs/duet-upload-aria-status.cjs.entry.js +100 -0
  40. package/lib/cjs/duet-visually-hidden.cjs.entry.js +1 -1
  41. package/lib/cjs/duet.cjs.js +4 -4
  42. package/lib/cjs/{focus-utils-7605778f.js → focus-utils-b609a7a5.js} +1 -1
  43. package/lib/cjs/{index-0c949193.js → index-9a57d969.js} +95 -77
  44. package/lib/cjs/{language-utils-70d6a9a4.js → language-utils-aa282901.js} +28 -9
  45. package/lib/cjs/loader.cjs.js +3 -3
  46. package/lib/cjs/{shadow-css-0c8c175b.js → shadow-css-e3edeed1.js} +9 -10
  47. package/lib/cjs/{string-utils-a6de43d8.js → string-utils-267e3dbb.js} +7 -0
  48. package/lib/cjs/{token-utils-13e5d13e.js → token-utils-63a9c8dc.js} +1 -1
  49. package/lib/cjs/{tokens.module-53b3bd92.js → tokens.module-6b2df1c2.js} +2 -0
  50. package/lib/cjs/{watch-options-3877c082.js → watch-options-d88afac0.js} +29 -6
  51. package/lib/collection/collection-manifest.json +16 -8
  52. package/lib/collection/components/duet-alert/duet-alert.js +12 -6
  53. package/lib/collection/components/duet-badge/duet-badge.css +1 -0
  54. package/lib/collection/components/duet-button/duet-button.js +17 -15
  55. package/lib/collection/components/duet-card/duet-card.css +30 -7
  56. package/lib/collection/components/duet-card/duet-card.js +4 -3
  57. package/lib/collection/components/duet-checkbox/duet-checkbox.css +1 -1
  58. package/lib/collection/components/duet-choice/duet-choice.css +16 -3
  59. package/lib/collection/components/duet-choice/duet-choice.js +122 -36
  60. package/lib/collection/components/duet-choice-group/duet-choice-group.css +1 -0
  61. package/lib/collection/components/duet-choice-group/duet-choice-group.js +4 -4
  62. package/lib/collection/components/duet-date-picker/duet-date-picker.css +1 -1
  63. package/lib/collection/components/duet-date-picker/duet-date-picker.js +78 -43
  64. package/lib/collection/components/duet-editable-table/duet-editable-table-button.css +32 -0
  65. package/lib/collection/components/duet-editable-table/duet-editable-table-button.js +218 -0
  66. package/lib/collection/components/duet-editable-table/duet-editable-table-item.css +36 -0
  67. package/lib/collection/components/duet-editable-table/duet-editable-table-item.js +203 -0
  68. package/lib/collection/components/duet-editable-table/duet-editable-table-tabledata.js +13 -0
  69. package/lib/collection/components/duet-editable-table/duet-editable-table.css +16 -0
  70. package/lib/collection/components/duet-editable-table/duet-editable-table.js +348 -0
  71. package/lib/collection/components/duet-footer/duet-footer.js +17 -15
  72. package/lib/collection/components/duet-grid/duet-grid.js +57 -6
  73. package/lib/collection/components/duet-grid-item/duet-grid-item.js +4 -4
  74. package/lib/collection/components/duet-header/duet-header.js +60 -35
  75. package/lib/collection/components/duet-heading/duet-heading.css +4 -0
  76. package/lib/collection/components/duet-heading/duet-heading.js +7 -6
  77. package/lib/collection/components/duet-hero/duet-hero.js +20 -15
  78. package/lib/collection/components/duet-icon/duet-icon.js +2 -6
  79. package/lib/collection/components/duet-icon/icon-utils.js +20 -13
  80. package/lib/collection/components/duet-input/duet-input.css +15 -0
  81. package/lib/collection/components/duet-input/duet-input.js +4 -4
  82. package/lib/collection/components/duet-label/duet-label.css +2 -0
  83. package/lib/collection/components/duet-link/duet-link.js +18 -19
  84. package/lib/collection/components/duet-logo/duet-logo.js +4 -4
  85. package/lib/collection/components/duet-modal/duet-modal.js +22 -17
  86. package/lib/collection/components/duet-notification/duet-notification.js +8 -8
  87. package/lib/collection/components/duet-notification-drawer/duet-notification-drawer.js +20 -15
  88. package/lib/collection/components/duet-number-input/duet-number-input.js +153 -29
  89. package/lib/collection/components/duet-paragraph/duet-paragraph.css +6 -0
  90. package/lib/collection/components/duet-paragraph/duet-paragraph.js +34 -3
  91. package/lib/collection/components/duet-progress/duet-progress.css +103 -0
  92. package/lib/collection/components/duet-progress/duet-progress.js +240 -0
  93. package/lib/collection/components/duet-radio/duet-radio.js +6 -6
  94. package/lib/collection/components/duet-select/duet-select.css +15 -0
  95. package/lib/collection/components/duet-select/duet-select.js +3 -3
  96. package/lib/collection/components/duet-step/duet-step.js +8 -8
  97. package/lib/collection/components/duet-tab-group/duet-tab-group.css +2 -2
  98. package/lib/collection/components/duet-tab-group/duet-tab-group.js +43 -12
  99. package/lib/collection/components/duet-textarea/duet-textarea.css +19 -0
  100. package/lib/collection/components/duet-textarea/duet-textarea.js +5 -4
  101. package/lib/collection/components/duet-tooltip/duet-tooltip.js +82 -20
  102. package/lib/collection/components/duet-tray/duet-tray.js +79 -17
  103. package/lib/collection/components/duet-upload/duet-upload.css +17 -86
  104. package/lib/collection/components/duet-upload/duet-upload.js +587 -164
  105. package/lib/collection/components/duet-upload/errorcodes.utils.js +16 -4
  106. package/lib/collection/components/duet-upload/upload-editable-item-error.js +16 -0
  107. package/lib/collection/components/duet-upload/upload-editable-item-inprogres.js +8 -0
  108. package/lib/collection/components/duet-upload/upload-editable-item-success.js +30 -0
  109. package/lib/collection/components/duet-upload/{duet-upload-validators.js → upload-validators.js} +0 -0
  110. package/lib/collection/components/duet-upload/xhr.helpers.js +2 -6
  111. package/lib/collection/components/duet-upload-aria-status/duet-upload-aria-status.js +217 -0
  112. package/lib/collection/utils/fixture-utils.js +7 -5
  113. package/lib/collection/utils/js-utils.js +12 -0
  114. package/lib/collection/utils/language-utils.js +26 -9
  115. package/lib/collection/utils/string-utils.js +6 -0
  116. package/lib/collection/utils/watch-options.js +35 -6
  117. package/lib/custom-elements-bundle/index.d.ts +30 -0
  118. package/lib/custom-elements-bundle/index.js +1651 -730
  119. package/lib/duet/duet.esm.js +1 -1
  120. package/lib/duet/duet.js +1 -1
  121. package/lib/duet/p-00210a63.entry.js +4 -0
  122. package/lib/duet/{p-66dde4d2.entry.js → p-0205162d.entry.js} +1 -1
  123. package/lib/duet/{p-3dc9d15d.system.entry.js → p-020a2c42.system.entry.js} +1 -1
  124. package/lib/duet/{p-59a07cf9.entry.js → p-079795e5.entry.js} +1 -1
  125. package/lib/duet/p-09013a48.system.entry.js +4 -0
  126. package/lib/duet/p-0a89315d.entry.js +4 -0
  127. package/lib/duet/p-0d22396e.system.js +16 -0
  128. package/lib/duet/p-0e90f075.system.entry.js +4 -0
  129. package/lib/duet/p-12721178.js +4 -0
  130. package/lib/duet/p-19d7d9d5.system.entry.js +4 -0
  131. package/lib/duet/p-1cbc6269.entry.js +4 -0
  132. package/lib/duet/p-2297d13f.system.entry.js +4 -0
  133. package/lib/duet/p-2764f081.js +4 -0
  134. package/lib/duet/p-2a822e91.system.entry.js +4 -0
  135. package/lib/duet/{p-f81d8534.entry.js → p-2fdcff82.entry.js} +1 -1
  136. package/lib/duet/p-3013c9bb.system.entry.js +4 -0
  137. package/lib/duet/p-3212a556.entry.js +4 -0
  138. package/lib/duet/{p-dee41056.system.entry.js → p-323643af.system.entry.js} +1 -1
  139. package/lib/duet/p-32b7397d.entry.js +4 -0
  140. package/lib/duet/{p-bd9a7d8f.js → p-35a3794e.js} +0 -0
  141. package/lib/duet/p-360086f8.entry.js +4 -0
  142. package/lib/duet/{p-f71f12ed.entry.js → p-37cda933.entry.js} +1 -1
  143. package/lib/duet/{p-62806bb6.system.entry.js → p-3ba62cf1.system.entry.js} +1 -1
  144. package/lib/duet/{p-322d1c38.js → p-3c1971d8.js} +1 -1
  145. package/lib/duet/p-3fd9190b.system.entry.js +4 -0
  146. package/lib/duet/p-43847557.entry.js +4 -0
  147. package/lib/duet/{p-bbc229d8.system.entry.js → p-4b6e8558.system.entry.js} +1 -1
  148. package/lib/duet/p-4c5eedf8.entry.js +4 -0
  149. package/lib/duet/p-4c827f0d.entry.js +4 -0
  150. package/lib/duet/{p-de2be65b.system.js → p-51955fc0.system.js} +1 -1
  151. package/lib/duet/p-5cfc53f9.entry.js +4 -0
  152. package/lib/duet/p-5decc259.system.entry.js +4 -0
  153. package/lib/duet/p-5e0071d6.js +4 -0
  154. package/lib/duet/p-5e77432e.system.entry.js +4 -0
  155. package/lib/duet/{p-ce1374a4.system.entry.js → p-6024e484.system.entry.js} +1 -1
  156. package/lib/duet/p-68008644.entry.js +4 -0
  157. package/lib/duet/p-69385972.system.entry.js +4 -0
  158. package/lib/duet/p-6a4d85ed.system.entry.js +4 -0
  159. package/lib/duet/{p-f82709ba.entry.js → p-6a5ab3eb.entry.js} +1 -1
  160. package/lib/duet/p-6e363557.system.js +4 -0
  161. package/lib/duet/p-6e4b1c0d.entry.js +4 -0
  162. package/lib/duet/p-6f36f647.system.entry.js +4 -0
  163. package/lib/duet/p-6fa6c4fb.system.entry.js +4 -0
  164. package/lib/duet/p-70fafc98.system.js +4 -0
  165. package/lib/duet/p-71a77368.system.entry.js +4 -0
  166. package/lib/duet/p-73f9db25.system.entry.js +4 -0
  167. package/lib/duet/p-74f4a0d8.system.entry.js +4 -0
  168. package/lib/duet/p-7530be48.system.entry.js +4 -0
  169. package/lib/duet/{p-36007600.entry.js → p-75edcaed.entry.js} +1 -1
  170. package/lib/duet/{p-d1817efe.system.entry.js → p-7a8597c2.system.entry.js} +1 -1
  171. package/lib/duet/{p-1cfe38b1.system.entry.js → p-85ad012a.system.entry.js} +1 -1
  172. package/lib/duet/{p-a321a98c.entry.js → p-85e52be8.entry.js} +1 -1
  173. package/lib/duet/p-8aaf3383.entry.js +4 -0
  174. package/lib/duet/p-986779fb.js +4 -0
  175. package/lib/duet/p-987edcd0.js +15 -0
  176. package/lib/duet/{p-35e45c19.system.js → p-9a945278.system.js} +1 -1
  177. package/lib/duet/p-9e79e033.entry.js +4 -0
  178. package/lib/duet/{p-7e108b7e.entry.js → p-9f35d682.entry.js} +1 -1
  179. package/lib/duet/{p-f71e337e.system.entry.js → p-a2a00146.system.entry.js} +1 -1
  180. package/lib/duet/p-a545398c.entry.js +4 -0
  181. package/lib/duet/{p-2826f987.js → p-ad07f399.js} +1 -1
  182. package/lib/duet/{p-4a7911fd.entry.js → p-af49d4f9.entry.js} +1 -1
  183. package/lib/duet/{p-1c41525a.entry.js → p-b25edbbe.entry.js} +1 -1
  184. package/lib/duet/p-b314348c.system.js +4 -0
  185. package/lib/duet/p-b4111e88.system.entry.js +4 -0
  186. package/lib/duet/p-b5c7d304.system.entry.js +4 -0
  187. package/lib/duet/p-b6e9860a.entry.js +4 -0
  188. package/lib/duet/p-ba18b56e.entry.js +4 -0
  189. package/lib/duet/p-bf4596bd.system.entry.js +4 -0
  190. package/lib/duet/{p-4265de16.system.entry.js → p-bf9f6d80.system.entry.js} +1 -1
  191. package/lib/duet/{p-fd98468a.system.js → p-c18a599e.system.js} +0 -0
  192. package/lib/duet/p-c1a1ea1b.js +4 -0
  193. package/lib/duet/p-c742856b.system.entry.js +4 -0
  194. package/lib/duet/p-cbdb9e98.system.entry.js +4 -0
  195. package/lib/duet/{p-27d538f7.system.entry.js → p-cf319832.system.entry.js} +1 -1
  196. package/lib/duet/p-d67fff56.entry.js +4 -0
  197. package/lib/duet/{p-031c2cd8.system.entry.js → p-dd76db9b.system.entry.js} +1 -1
  198. package/lib/duet/p-ddb6344c.system.js +4 -0
  199. package/lib/duet/{p-345ea4f2.system.entry.js → p-de5ec54e.system.entry.js} +1 -1
  200. package/lib/duet/p-df6f39a3.entry.js +4 -0
  201. package/lib/duet/p-e1dc86b5.system.js +4 -0
  202. package/lib/duet/p-e2596ea0.entry.js +4 -0
  203. package/lib/duet/p-e370c18b.entry.js +4 -0
  204. package/lib/duet/{p-e26116e0.system.entry.js → p-e48f3a32.system.entry.js} +1 -1
  205. package/lib/duet/p-e5031543.entry.js +4 -0
  206. package/lib/duet/p-e60ee8b0.entry.js +4 -0
  207. package/lib/duet/p-e70088d5.entry.js +4 -0
  208. package/lib/duet/p-e7b90769.system.entry.js +4 -0
  209. package/lib/duet/{p-a88df408.entry.js → p-e8123a53.entry.js} +1 -1
  210. package/lib/duet/p-eb55ccd2.system.js +4 -0
  211. package/lib/duet/{p-2d2c45f9.entry.js → p-ef7251bf.entry.js} +1 -1
  212. package/lib/duet/p-f0cfe033.system.entry.js +4 -0
  213. package/lib/duet/p-f2a087a8.system.entry.js +4 -0
  214. package/lib/duet/p-f5a55b3c.entry.js +4 -0
  215. package/lib/duet/p-fd613733.entry.js +4 -0
  216. package/lib/esm/{dom-21034390.js → dom-58cd15f6.js} +1 -1
  217. package/lib/esm/duet-alert.entry.js +4 -2
  218. package/lib/esm/duet-badge.entry.js +2 -2
  219. package/lib/esm/duet-button_2.entry.js +6 -5
  220. package/lib/esm/duet-caption_4.entry.js +21 -15
  221. package/lib/esm/duet-card.entry.js +6 -6
  222. package/lib/esm/duet-checkbox.entry.js +2 -2
  223. package/lib/esm/duet-choice_2.entry.js +56 -26
  224. package/lib/esm/duet-collapsible.entry.js +5 -2
  225. package/lib/esm/duet-cookie-consent.entry.js +1 -1
  226. package/lib/esm/duet-date-picker.entry.js +23 -13
  227. package/lib/esm/duet-divider_2.entry.js +1 -1
  228. package/lib/esm/duet-editable-table-button.entry.js +85 -0
  229. package/lib/esm/duet-editable-table_4.entry.js +1438 -0
  230. package/lib/esm/duet-empty-state.entry.js +1 -1
  231. package/lib/esm/duet-fieldset.entry.js +1 -1
  232. package/lib/esm/duet-footer.entry.js +4 -4
  233. package/lib/esm/duet-grid_2.entry.js +52 -4
  234. package/lib/esm/duet-header_2.entry.js +26 -10
  235. package/lib/esm/duet-hero.entry.js +6 -6
  236. package/lib/esm/duet-icon.entry.js +21 -19
  237. package/lib/esm/duet-input_2.entry.js +7 -7
  238. package/lib/esm/duet-layout.entry.js +1 -1
  239. package/lib/esm/duet-list_2.entry.js +2 -2
  240. package/lib/esm/duet-modal.entry.js +8 -7
  241. package/lib/esm/duet-notification_2.entry.js +6 -5
  242. package/lib/esm/duet-number-input.entry.js +36 -15
  243. package/lib/esm/duet-progress.entry.js +71 -0
  244. package/lib/esm/duet-radio_2.entry.js +2 -2
  245. package/lib/esm/duet-range-slider.entry.js +2 -2
  246. package/lib/esm/duet-select.entry.js +6 -6
  247. package/lib/esm/duet-step_2.entry.js +1 -1
  248. package/lib/esm/duet-tab_2.entry.js +12 -6
  249. package/lib/esm/duet-textarea.entry.js +5 -5
  250. package/lib/esm/duet-toggle.entry.js +1 -1
  251. package/lib/esm/duet-tooltip.entry.js +21 -10
  252. package/lib/esm/duet-tray.entry.js +21 -10
  253. package/lib/esm/duet-upload-aria-status.entry.js +96 -0
  254. package/lib/esm/duet-visually-hidden.entry.js +1 -1
  255. package/lib/esm/duet.js +4 -4
  256. package/lib/esm/{focus-utils-0b12f0df.js → focus-utils-aeb6ca93.js} +1 -1
  257. package/lib/esm/{index-f70ddc7f.js → index-e8c7d36f.js} +94 -78
  258. package/lib/esm/{language-utils-ab9c3afc.js → language-utils-344d894c.js} +28 -10
  259. package/lib/esm/loader.js +3 -3
  260. package/lib/esm/{shadow-css-31e2d504.js → shadow-css-7c726abb.js} +9 -10
  261. package/lib/esm/{string-utils-69cf0d09.js → string-utils-2f1793b8.js} +7 -1
  262. package/lib/esm/{token-utils-5a35377f.js → token-utils-590d9413.js} +1 -1
  263. package/lib/esm/{tokens.module-edb66c04.js → tokens.module-49cbf963.js} +3 -1
  264. package/lib/esm/watch-options-dd55bce8.js +57 -0
  265. package/lib/esm-es5/{dom-21034390.js → dom-58cd15f6.js} +0 -0
  266. package/lib/esm-es5/duet-alert.entry.js +1 -1
  267. package/lib/esm-es5/duet-badge.entry.js +1 -1
  268. package/lib/esm-es5/duet-button_2.entry.js +1 -1
  269. package/lib/esm-es5/duet-caption_4.entry.js +2 -2
  270. package/lib/esm-es5/duet-card.entry.js +1 -1
  271. package/lib/esm-es5/duet-checkbox.entry.js +1 -1
  272. package/lib/esm-es5/duet-choice_2.entry.js +1 -1
  273. package/lib/esm-es5/duet-collapsible.entry.js +1 -1
  274. package/lib/esm-es5/duet-cookie-consent.entry.js +1 -1
  275. package/lib/esm-es5/duet-date-picker.entry.js +1 -1
  276. package/lib/esm-es5/duet-divider_2.entry.js +1 -1
  277. package/lib/esm-es5/duet-editable-table-button.entry.js +4 -0
  278. package/lib/esm-es5/duet-editable-table_4.entry.js +4 -0
  279. package/lib/esm-es5/duet-empty-state.entry.js +1 -1
  280. package/lib/esm-es5/duet-fieldset.entry.js +1 -1
  281. package/lib/esm-es5/duet-footer.entry.js +1 -1
  282. package/lib/esm-es5/duet-grid_2.entry.js +2 -2
  283. package/lib/esm-es5/duet-header_2.entry.js +1 -1
  284. package/lib/esm-es5/duet-hero.entry.js +1 -1
  285. package/lib/esm-es5/duet-icon.entry.js +2 -2
  286. package/lib/esm-es5/duet-input_2.entry.js +1 -1
  287. package/lib/esm-es5/duet-layout.entry.js +1 -1
  288. package/lib/esm-es5/duet-list_2.entry.js +1 -1
  289. package/lib/esm-es5/duet-modal.entry.js +1 -1
  290. package/lib/esm-es5/duet-notification_2.entry.js +1 -1
  291. package/lib/esm-es5/duet-number-input.entry.js +2 -2
  292. package/lib/esm-es5/duet-progress.entry.js +4 -0
  293. package/lib/esm-es5/duet-radio_2.entry.js +1 -1
  294. package/lib/esm-es5/duet-range-slider.entry.js +1 -1
  295. package/lib/esm-es5/duet-select.entry.js +1 -1
  296. package/lib/esm-es5/duet-step_2.entry.js +1 -1
  297. package/lib/esm-es5/duet-tab_2.entry.js +2 -2
  298. package/lib/esm-es5/duet-textarea.entry.js +1 -1
  299. package/lib/esm-es5/duet-toggle.entry.js +1 -1
  300. package/lib/esm-es5/duet-tooltip.entry.js +1 -1
  301. package/lib/esm-es5/duet-tray.entry.js +1 -1
  302. package/lib/esm-es5/duet-upload-aria-status.entry.js +4 -0
  303. package/lib/esm-es5/duet-visually-hidden.entry.js +1 -1
  304. package/lib/esm-es5/duet.js +1 -1
  305. package/lib/esm-es5/focus-utils-aeb6ca93.js +4 -0
  306. package/lib/esm-es5/index-e8c7d36f.js +4 -0
  307. package/lib/esm-es5/language-utils-344d894c.js +4 -0
  308. package/lib/esm-es5/loader.js +1 -1
  309. package/lib/esm-es5/shadow-css-7c726abb.js +15 -0
  310. package/lib/esm-es5/{string-utils-69cf0d09.js → string-utils-2f1793b8.js} +1 -1
  311. package/lib/esm-es5/{token-utils-5a35377f.js → token-utils-590d9413.js} +1 -1
  312. package/lib/esm-es5/tokens.module-49cbf963.js +4 -0
  313. package/lib/esm-es5/watch-options-dd55bce8.js +4 -0
  314. package/lib/html.html-data.json +4906 -0
  315. package/lib/types/components/duet-alert/duet-alert.d.ts +2 -1
  316. package/lib/types/components/duet-button/duet-button.d.ts +1 -1
  317. package/lib/types/components/duet-choice/duet-choice.d.ts +24 -5
  318. package/lib/types/components/duet-date-picker/duet-date-picker.d.ts +15 -9
  319. package/lib/types/components/duet-editable-table/duet-editable-table-button.d.ts +72 -0
  320. package/lib/types/components/duet-editable-table/duet-editable-table-item.d.ts +72 -0
  321. package/lib/types/components/duet-editable-table/duet-editable-table-tabledata.d.ts +7 -0
  322. package/lib/types/components/duet-editable-table/duet-editable-table.d.ts +84 -0
  323. package/lib/types/components/duet-footer/duet-footer.d.ts +1 -1
  324. package/lib/types/components/duet-grid/duet-grid.d.ts +16 -2
  325. package/lib/types/components/duet-header/duet-header.d.ts +21 -5
  326. package/lib/types/components/duet-heading/duet-heading.d.ts +2 -2
  327. package/lib/types/components/duet-hero/duet-hero.d.ts +3 -3
  328. package/lib/types/components/duet-icon/duet-icon.d.ts +1 -1
  329. package/lib/types/components/duet-icon/icon-utils.d.ts +1 -1
  330. package/lib/types/components/duet-link/duet-link.d.ts +2 -3
  331. package/lib/types/components/duet-modal/duet-modal.d.ts +3 -3
  332. package/lib/types/components/duet-notification-drawer/duet-notification-drawer.d.ts +3 -3
  333. package/lib/types/components/duet-number-input/duet-number-input.d.ts +21 -0
  334. package/lib/types/components/duet-paragraph/duet-paragraph.d.ts +9 -1
  335. package/lib/types/components/duet-progress/duet-progress.d.ts +64 -0
  336. package/lib/types/components/duet-tab-group/duet-tab-group.d.ts +6 -0
  337. package/lib/types/components/duet-tooltip/duet-tooltip.d.ts +11 -0
  338. package/lib/types/components/duet-tray/duet-tray.d.ts +11 -0
  339. package/lib/types/components/duet-upload/duet-upload.d.ts +124 -31
  340. package/lib/types/components/duet-upload/errorcodes.utils.d.ts +1 -0
  341. package/lib/types/components/duet-upload/upload-editable-item-error.d.ts +7 -0
  342. package/lib/types/components/duet-upload/upload-editable-item-inprogres.d.ts +7 -0
  343. package/lib/types/components/duet-upload/upload-editable-item-success.d.ts +8 -0
  344. package/lib/types/components/duet-upload/{duet-upload-validators.d.ts → upload-validators.d.ts} +0 -0
  345. package/lib/types/components/duet-upload/xhr.helpers.d.ts +7 -1
  346. package/lib/types/components/duet-upload-aria-status/duet-upload-aria-status.d.ts +49 -0
  347. package/lib/types/components.d.ts +619 -87
  348. package/lib/types/utils/js-utils.d.ts +1 -0
  349. package/lib/types/utils/language-utils.d.ts +8 -3
  350. package/lib/types/utils/string-utils.d.ts +1 -0
  351. package/lib/types/utils/watch-options.d.ts +2 -0
  352. package/package.json +20 -15
  353. package/lib/cjs/duet-table.cjs.entry.js +0 -132
  354. package/lib/cjs/duet-upload.cjs.entry.js +0 -866
  355. package/lib/collection/components/duet-upload/duet-upload-file-list.js +0 -49
  356. package/lib/duet/p-0733c303.system.entry.js +0 -4
  357. package/lib/duet/p-095060cc.js +0 -4
  358. package/lib/duet/p-156864a1.system.entry.js +0 -4
  359. package/lib/duet/p-15c15c6a.js +0 -15
  360. package/lib/duet/p-1911dfe7.system.entry.js +0 -4
  361. package/lib/duet/p-2834a302.entry.js +0 -4
  362. package/lib/duet/p-28a3d38f.system.entry.js +0 -4
  363. package/lib/duet/p-2a1a9f9f.entry.js +0 -4
  364. package/lib/duet/p-2a4d7c5b.system.entry.js +0 -4
  365. package/lib/duet/p-4095dba5.entry.js +0 -4
  366. package/lib/duet/p-418b2ce7.system.js +0 -4
  367. package/lib/duet/p-4289b543.entry.js +0 -4
  368. package/lib/duet/p-43e39d98.system.js +0 -4
  369. package/lib/duet/p-46a3ae43.system.js +0 -4
  370. package/lib/duet/p-4a38cf9d.entry.js +0 -4
  371. package/lib/duet/p-4be8e814.entry.js +0 -4
  372. package/lib/duet/p-591b2137.entry.js +0 -4
  373. package/lib/duet/p-5c5bdb06.system.entry.js +0 -4
  374. package/lib/duet/p-5f70e318.entry.js +0 -4
  375. package/lib/duet/p-62c294d6.system.entry.js +0 -4
  376. package/lib/duet/p-6a356ab1.system.js +0 -4
  377. package/lib/duet/p-6c2729da.js +0 -4
  378. package/lib/duet/p-6f107847.system.entry.js +0 -4
  379. package/lib/duet/p-77a5fe4c.system.js +0 -4
  380. package/lib/duet/p-7809e78b.system.entry.js +0 -4
  381. package/lib/duet/p-7a36d76f.system.entry.js +0 -4
  382. package/lib/duet/p-7ee52f58.entry.js +0 -4
  383. package/lib/duet/p-884693f1.entry.js +0 -4
  384. package/lib/duet/p-8977b722.entry.js +0 -4
  385. package/lib/duet/p-89db3b94.entry.js +0 -4
  386. package/lib/duet/p-8cfce39e.system.entry.js +0 -4
  387. package/lib/duet/p-8ffe1461.system.entry.js +0 -4
  388. package/lib/duet/p-9381c2d4.entry.js +0 -4
  389. package/lib/duet/p-9a450c9a.entry.js +0 -4
  390. package/lib/duet/p-9a89ec39.js +0 -4
  391. package/lib/duet/p-9bbfe606.system.entry.js +0 -4
  392. package/lib/duet/p-a0a066cb.system.entry.js +0 -4
  393. package/lib/duet/p-a6096b05.system.entry.js +0 -4
  394. package/lib/duet/p-a89d5d7c.entry.js +0 -4
  395. package/lib/duet/p-b07055fd.system.entry.js +0 -4
  396. package/lib/duet/p-b4374f0e.entry.js +0 -4
  397. package/lib/duet/p-b456d684.system.entry.js +0 -4
  398. package/lib/duet/p-bd18c93f.js +0 -4
  399. package/lib/duet/p-bddb1c15.system.entry.js +0 -4
  400. package/lib/duet/p-c0b95b58.entry.js +0 -4
  401. package/lib/duet/p-c3688975.entry.js +0 -4
  402. package/lib/duet/p-c4d183e6.entry.js +0 -4
  403. package/lib/duet/p-c9303f9a.entry.js +0 -4
  404. package/lib/duet/p-cd4e8ccf.js +0 -4
  405. package/lib/duet/p-ceb75b35.system.entry.js +0 -4
  406. package/lib/duet/p-cf243bcb.system.entry.js +0 -4
  407. package/lib/duet/p-d37c8a05.system.js +0 -4
  408. package/lib/duet/p-d989af11.entry.js +0 -4
  409. package/lib/duet/p-e58ca7af.system.js +0 -16
  410. package/lib/duet/p-e6128d82.system.entry.js +0 -4
  411. package/lib/duet/p-e86cdc17.entry.js +0 -4
  412. package/lib/duet/p-eadb29c7.entry.js +0 -4
  413. package/lib/duet/p-f30b14d6.system.entry.js +0 -4
  414. package/lib/duet/p-f79f8da1.entry.js +0 -4
  415. package/lib/duet/p-fc397e03.system.entry.js +0 -4
  416. package/lib/esm/duet-table.entry.js +0 -128
  417. package/lib/esm/duet-upload.entry.js +0 -862
  418. package/lib/esm/watch-options-de55ea78.js +0 -35
  419. package/lib/esm-es5/duet-table.entry.js +0 -4
  420. package/lib/esm-es5/duet-upload.entry.js +0 -4
  421. package/lib/esm-es5/focus-utils-0b12f0df.js +0 -4
  422. package/lib/esm-es5/index-f70ddc7f.js +0 -4
  423. package/lib/esm-es5/language-utils-ab9c3afc.js +0 -4
  424. package/lib/esm-es5/shadow-css-31e2d504.js +0 -15
  425. package/lib/esm-es5/tokens.module-edb66c04.js +0 -4
  426. package/lib/esm-es5/watch-options-de55ea78.js +0 -4
  427. package/lib/types/components/duet-upload/duet-upload-file-list.d.ts +0 -9
@@ -3,16 +3,19 @@
3
3
  */
4
4
  import { Component, Element, Event, h, Host, Method, Prop, State, Watch } from "@stencil/core";
5
5
  import { createID } from "../../utils/create-id";
6
- import { getLocaleString } from "../../utils/language-utils";
6
+ import { debounce } from "../../utils/js-utils";
7
+ import { getLocaleString, sanitizeString } from "../../utils/language-utils";
7
8
  import { inheritGlobalTheme } from "../../utils/themeable-component";
8
- import { DuetUploadFileList } from "./duet-upload-file-list";
9
- import { validateFile, validateTotalAmountIsAboveMax, validateTotalSizeIsAboveMax } from "./duet-upload-validators";
10
- import { getError } from "./errorcodes.utils";
9
+ import { getError, getI18nError } from "./errorcodes.utils";
10
+ import { ErrorItem } from "./upload-editable-item-error";
11
+ import { ProgressItem } from "./upload-editable-item-inprogres";
12
+ import { SuccessItem } from "./upload-editable-item-success";
13
+ import { validateFile, validateTotalAmountIsAboveMax, validateTotalSizeIsAboveMax } from "./upload-validators";
11
14
  import { makeXhrRequest } from "./xhr.helpers";
12
15
  /**
13
16
  * @slot header - named slot - to place content after description / caption
14
- * @slot fileheader - named slot - to place content above filelist (only displayed when filelist contains items)
15
- * @slot filefooter - named slot - to place content below filelist (only displayed when filelist contains items)
17
+ * @slot fileheader - named slot - to place content above "filelist" (only displayed when "filelist" contains items)
18
+ * @slot filefooter - named slot - to place content below "filelist" (only displayed when "filelist" contains items)
16
19
  */
17
20
  export class DuetUpload {
18
21
  constructor() {
@@ -22,9 +25,19 @@ export class DuetUpload {
22
25
  this.buttonId = createID("DuetButton");
23
26
  this.labelId = createID("DuetLabel");
24
27
  this.uploadId = createID("DuetUpload");
28
+ this.editableTableId = createID("DuetEditableTable");
25
29
  this.filesInProgress = new Map();
26
30
  this.fileMaxReached = false;
27
31
  this.bytesMaxReached = false;
32
+ this.internalStatusMessageLabel = undefined;
33
+ /**
34
+ * Properties
35
+ */
36
+ this.DefaultGroups = {
37
+ inprogress: "inprogress",
38
+ success: "success",
39
+ failure: "failure",
40
+ };
28
41
  /**
29
42
  * State() variables
30
43
  */
@@ -35,8 +48,115 @@ export class DuetUpload {
35
48
  */
36
49
  this.external = false;
37
50
  /**
38
- * Property to change descriptionDefaults defaults on the component.
39
- * normally you would handle these strings on an application level and override @label when needed
51
+ * If set the upload component will not display an upload button, you will have to create one yourself
52
+ * and call the exposed method startUpload
53
+ */
54
+ this.hideButton = false;
55
+ /**
56
+ * Default actions added to the internally used duet-editable-table
57
+ */
58
+ this.actions = [
59
+ {
60
+ icon: "action-delete",
61
+ color: "color-danger",
62
+ color_hover: "category-home",
63
+ id: "delete",
64
+ map: ["success", "failure"],
65
+ label: {
66
+ fi: "Poista tiedosto",
67
+ en: "Poista tiedosto",
68
+ sv: "Ta bort filen",
69
+ },
70
+ },
71
+ {
72
+ icon: "navigation-close",
73
+ color: "primary",
74
+ color_hover: "category-home",
75
+ id: "cancel",
76
+ map: ["inprogress"],
77
+ label: {
78
+ fi: "Keskeytä lähetys",
79
+ en: "Cancel the upload",
80
+ sv: "Stop överföringen",
81
+ },
82
+ },
83
+ ];
84
+ /**
85
+ * If enabled the editable-table will display links on successfully uploaded items,
86
+ * this requires the server can respond with link URIs in the correct format
87
+ * and that the files are accessible to the user
88
+ */
89
+ this.showLinks = false;
90
+ /**
91
+ * Property to change the aria upload progress text read aloud by screenreaders
92
+ * @default {
93
+ * fi: {
94
+ * inProgress: "Lähetetään {filesUploaded} lähetettävästä {filesTotal} tiedostosta",
95
+ * inProgressWithErrors:
96
+ * "Lähetetään {filesInProgress} tiedostoa, lähetetty {filesUploaded} lähetettävästä {filesTotal} tiedostosta, {filesWithErrors} tiedostossa on virheitä",
97
+ * done: "Kaikki {filesTotal} tiedostoa lähetetty onnistuneesti",
98
+ * doneWithErrors:
99
+ * "Lähetys valmis, {filesUploaded} tiedostoa on lähetetty onnistuneesti, {filesWithErrors} tiedostossa oli virheitä",
100
+ * files: "tiedostot",
101
+ * file: "tiedosto",
102
+ * },
103
+ * sv: {
104
+ * inProgress: "Adding {filesUploaded} of {filesTotal}",
105
+ * inProgressWithErrors:
106
+ * "Laddar upp {filesInProgress}, {filesUploaded} uppladdad av {filesTotal}, {filesWithErrors} misslyckades",
107
+ * done: "Alla {filesTotal} har lagts till",
108
+ * doneWithErrors: "Handling slutförd, {filesUploaded} har lagts till, {filesWithErrors} misslyckades",
109
+ * files: "filer",
110
+ * file: "fil",
111
+ * },
112
+ * en: {
113
+ * inProgress: "Adding {filesUploaded} of {filesTotal}",
114
+ * inProgressWithErrors:
115
+ * "Uploading {filesInProgress}, {filesUploaded} uploaded of {filesTotal}, {filesWithErrors} failed",
116
+ * done: "All {filesTotal} added successfully",
117
+ * doneWithErrors: "Action completed, {filesUploaded} has been added successfully, {filesWithErrors} had errors",
118
+ * files: "tiedostoa",
119
+ * file: "tiedosto",
120
+ * },
121
+ * }
122
+ */
123
+ this.statusLabelDefaults = {
124
+ fi: {
125
+ inProgress: "Lähetetään {filesUploaded} lähetettävästä {filesTotal} tiedostosta",
126
+ inProgressWithErrors: "Lähetetään {filesInProgress} tiedostoa, lähetetty {filesUploaded} lähetettävästä {filesTotal} tiedostosta, {filesWithErrors} tiedostossa on virheitä",
127
+ done: "Kaikki {filesTotal} tiedostoa lähetetty onnistuneesti",
128
+ doneWithErrors: "Lähetys valmis, {filesUploaded} tiedostoa on lähetetty onnistuneesti, {filesWithErrors} tiedostossa oli virheitä",
129
+ files: "tiedostot",
130
+ file: "tiedosto",
131
+ },
132
+ sv: {
133
+ inProgress: "Adding {filesUploaded} of {filesTotal}",
134
+ inProgressWithErrors: "Laddar upp {filesInProgress}, {filesUploaded} uppladdad av {filesTotal}, {filesWithErrors} misslyckades",
135
+ done: "Alla {filesTotal} har lagts till",
136
+ doneWithErrors: "Handling slutförd, {filesUploaded} har lagts till, {filesWithErrors} misslyckades",
137
+ files: "filer",
138
+ file: "fil",
139
+ },
140
+ en: {
141
+ inProgress: "Adding {filesUploaded} of {filesTotal}",
142
+ inProgressWithErrors: "Uploading {filesInProgress}, {filesUploaded} uploaded of {filesTotal}, {filesWithErrors} failed",
143
+ done: "All {filesTotal} added successfully",
144
+ doneWithErrors: "Action completed, {filesUploaded} has been added successfully, {filesWithErrors} had errors",
145
+ files: "tiedostoa",
146
+ file: "tiedosto",
147
+ },
148
+ };
149
+ /**
150
+ * Strings used for the status aria-label
151
+ */
152
+ this.statusMessageLabel = getLocaleString(this.statusLabelDefaults);
153
+ /**
154
+ * Property to change button label defaults on the component.
155
+ * @default {
156
+ fi: "Lisää liite",
157
+ sv: "Lägg till en bilaga",
158
+ en: "Add an attachment",
159
+ }
40
160
  */
41
161
  this.buttonLabelDefaults = {
42
162
  fi: "Lisää liite",
@@ -49,7 +169,7 @@ export class DuetUpload {
49
169
  */
50
170
  this.buttonLabel = getLocaleString(this.buttonLabelDefaults);
51
171
  /**
52
- * accessible Label of button
172
+ * accessible aria-Label of button
53
173
  */
54
174
  this.accessibleButtonLabel = undefined;
55
175
  /**
@@ -72,17 +192,22 @@ export class DuetUpload {
72
192
  * browser from displaying its own validation errors.
73
193
  */
74
194
  this.required = false;
195
+ /**
196
+ * Visually hides the groups labels in the editable table list used to display the list of files
197
+ */
198
+ this.hideGroups = false;
75
199
  /**
76
200
  * Map of string that contain list of uploaded files.
77
201
  */
78
202
  this.files = new Map();
79
203
  /**
80
- * Property to read if filelist contains errors or not
204
+ * Property to read if the internally used editable-table contains errors or not
81
205
  */
82
206
  this.valid = !this.required;
83
207
  /**
84
208
  * Property to change labelDefaults defaults on the component.
85
209
  * normally you would handle these strings on an application level and override @label when needed
210
+ * @default { fi: "Lisää liite",sv: "Lägg till en bilaga",en: "Add attachments"}
86
211
  */
87
212
  this.labelDefaults = {
88
213
  fi: "Lisää liite",
@@ -96,7 +221,11 @@ export class DuetUpload {
96
221
  this.label = getLocaleString(this.labelDefaults);
97
222
  /**
98
223
  * Property to change descriptionDefaults defaults on the component.
99
- * normally you would handle these strings on an application level and override @label when needed
224
+ * @default {
225
+ fi: "Voit liittää {filetypes}-muotoisia tiedostoja sekä yleisimpiä videotiedostoja. Voit lähettää {maxbytes} verran tiedostoja yhdellä kertaa, ja lisätä enintään {maxfiles} liitettä kerrallaan.",
226
+ sv: "Du kan bifoga filer i flg. formater {filetypes} samt de vanligaste videofilerna. Du kan ladda upp {maxbytes} filer åt gången och lägga till upp till {maxfiles} bilagor åt gången.",
227
+ en: "You may attach the following filetypes: {filetypes} - as well as the most common video files. You can upload {maxbytes} of files at a time, and add up to {maxfiles} attachments at a time.",
228
+ }
100
229
  */
101
230
  this.descriptionDefaults = {
102
231
  fi: "Voit liittää {filetypes}-muotoisia tiedostoja sekä yleisimpiä videotiedostoja. Voit lähettää {maxbytes} verran tiedostoja yhdellä kertaa, ja lisätä enintään {maxfiles} liitettä kerrallaan.",
@@ -105,12 +234,20 @@ export class DuetUpload {
105
234
  };
106
235
  /**
107
236
  * Description for the upload component.
108
- * @default ...
237
+ * @default {
238
+ fi: "Voit liittää {filetypes}-muotoisia tiedostoja sekä yleisimpiä videotiedostoja. Voit lähettää {maxbytes} verran tiedostoja yhdellä kertaa, ja lisätä enintään {maxfiles} liitettä kerrallaan.",
239
+ sv: "Du kan bifoga filer i flg. formater {filetypes} samt de vanligaste videofilerna. Du kan ladda upp {maxbytes} filer åt gången och lägga till upp till {maxfiles} bilagor åt gången.",
240
+ en: "You may attach the following filetypes: {filetypes} - as well as the most common video files. You can upload {maxbytes} of files at a time, and add up to {maxfiles} attachments at a time.",
241
+ }
109
242
  */
110
243
  this.description = getLocaleString(this.descriptionDefaults);
111
244
  /**
112
245
  * Defaults for the filelist's empty state.
113
- * @default { fi: "Lisää liite",sv: "Lägg till en bilaga",en: "Add attachments"}
246
+ * @default {
247
+ fi: "Ei vielä lisättyjä tiedostoja.",
248
+ sv: "Inga filer har lagts till ännu.",
249
+ en: "No files added yet.",
250
+ }
114
251
  */
115
252
  this.fileListEmptyDefaults = {
116
253
  fi: "Ei vielä lisättyjä tiedostoja.",
@@ -126,21 +263,6 @@ export class DuetUpload {
126
263
  * Display the input in error state along with an error message.
127
264
  */
128
265
  this.error = "";
129
- /**
130
- * Visually hide the label, but still show it to screen readers.
131
- */
132
- this.labelHidden = false;
133
- /**
134
- * if set, allows capture of media from user camera / microphone
135
- * The capture attribute value is a string that specifies which camera to use for capture
136
- * of image or video data, if the accept attribute indicates that the input should be of
137
- * one of those types. A value of user indicates that the user-facing camera and/or
138
- * microphone should be used. A value of environment specifies that the outward-facing
139
- * camera and/or microphone should be used. If this attribute is missing, the user agent
140
- * is free to decide on its own what to do. If the requested facing mode isn't available,
141
- * the user agent may fall back to its preferred default mode.
142
- */
143
- this.capture = undefined;
144
266
  /**
145
267
  * Use maxBytes to specify the maximum size in Bytes of a file that can be uploaded.
146
268
  */
@@ -175,7 +297,91 @@ export class DuetUpload {
175
297
  /**
176
298
  * Private functions
177
299
  */
178
- this.kick = () => (this.tick = Date.now()); // will trigger re-render
300
+ this.listenForActionEvents = () => {
301
+ this.element.addEventListener("duetEditableItemAction", (e) => {
302
+ const detail = e.detail;
303
+ const { action, keyName, originalEvent } = detail;
304
+ switch (action) {
305
+ case "delete":
306
+ this.onDelete(keyName, originalEvent);
307
+ break;
308
+ case "cancel":
309
+ this.onCancel(keyName, originalEvent);
310
+ break;
311
+ default:
312
+ // code block
313
+ }
314
+ });
315
+ };
316
+ this.verifyValidity = () => {
317
+ const { invalid, valid } = this.getFilesAsArray();
318
+ const oldValid = this.valid;
319
+ this.valid = invalid.length === 0 && valid.length !== 0;
320
+ if (this.valid !== oldValid) {
321
+ this.duetState.emit({
322
+ originalEvent: undefined,
323
+ data: { valid: this.valid, from: "componentWillRender" },
324
+ component: "duet-upload",
325
+ });
326
+ }
327
+ };
328
+ this.getGroupFromItemData = (item) => {
329
+ if (item.valid && item.progress === 100) {
330
+ // if the item has a group, move the file to that group instead
331
+ // of into the standard success group
332
+ if (item.group) {
333
+ return item.group;
334
+ }
335
+ return this.DefaultGroups.success;
336
+ }
337
+ else if (item.progress > 0 && item.progress !== 100) {
338
+ return this.DefaultGroups.inprogress;
339
+ }
340
+ else if (!item.valid) {
341
+ return this.DefaultGroups.failure;
342
+ }
343
+ else if (item.group) {
344
+ return item.group;
345
+ }
346
+ else {
347
+ return "none";
348
+ }
349
+ };
350
+ this.getItemHTMLFromItemData = (data, group) => {
351
+ if (group === this.DefaultGroups.success) {
352
+ return h(SuccessItem, { data: data, showLinks: this.showLinks });
353
+ }
354
+ else if (group === this.DefaultGroups.inprogress) {
355
+ return h(ProgressItem, { progress: data.progress, name: data.item.name });
356
+ }
357
+ else if (group === this.DefaultGroups.failure) {
358
+ return h(ErrorItem, { data: data });
359
+ }
360
+ else if (data.group) {
361
+ return data.html;
362
+ }
363
+ else {
364
+ return "none";
365
+ }
366
+ };
367
+ this.convertToDuetEditableTableItems = () => {
368
+ // we're always recreating the map - in order to force an update down stream.
369
+ const itemData = new Map();
370
+ //walk the files Map and convert to DuetEditableTableItemData
371
+ this.files.forEach((data, key, _originalMap) => {
372
+ const group = this.getGroupFromItemData(data);
373
+ const item = this.getItemHTMLFromItemData(data, group);
374
+ itemData.set(key, {
375
+ uid: data.uid,
376
+ item,
377
+ group,
378
+ });
379
+ });
380
+ return itemData;
381
+ };
382
+ this.kick = debounce(() => {
383
+ this.tick = Date.now();
384
+ }, 30); // will trigger re-render
179
385
  this.genHashName = () => Date.now().toString(36) + Math.random();
180
386
  this.updateValueInMap = (item, key, value, kick = true) => {
181
387
  const fileItem = this.files.get(item);
@@ -186,10 +392,13 @@ export class DuetUpload {
186
392
  }
187
393
  };
188
394
  this.updateProgress = (ev, name) => {
189
- if (ev.lengthComputable) {
190
- const percentComplete = (ev.loaded / ev.total) * 100;
395
+ const updateProgressHelper = percentComplete => {
191
396
  this.updateValueInMap(name, "progress", percentComplete);
192
397
  this.onProgress(name, percentComplete, ev);
398
+ };
399
+ if (ev.lengthComputable) {
400
+ const percentComplete = (ev.loaded / ev.total) * 100;
401
+ updateProgressHelper(percentComplete);
193
402
  }
194
403
  else {
195
404
  console.log("cant read progress");
@@ -226,17 +435,20 @@ export class DuetUpload {
226
435
  * We reset the form fields to always be able to re-upload files
227
436
  * and because we handle all uploads and states internally in the component (not relying on native form elements)
228
437
  */
438
+ /* TODO: it may be a good idea to just update the list so that this always matches what is in the files map,
439
+ * TODO: this would remove the capability of Re-uploading, unless we can catch and remove the user file from the form filelist before the upload is canceled by the browser
440
+ * TODO: but for now we'll just reset the form fields
441
+ */
229
442
  this.nativeInput.value = "";
230
443
  };
231
- this.getI18nError = (errorCode) => {
232
- const errorFromJson = getError(errorCode);
233
- const i18String = getLocaleString(errorFromJson.message);
234
- if (i18String === "" || !i18String) {
235
- return errorFromJson.system_message;
236
- }
237
- else {
238
- return i18String;
239
- }
444
+ this.startUpload = async (ev, metaData = undefined) => {
445
+ await this.setFocus();
446
+ this.metaData = metaData;
447
+ this.nativeInput.click();
448
+ this.onUpload(ev, metaData);
449
+ ev.stopPropagation();
450
+ ev.preventDefault();
451
+ return;
240
452
  };
241
453
  /**
242
454
  * Eventlisteners for the XHR requests
@@ -247,6 +459,7 @@ export class DuetUpload {
247
459
  };
248
460
  this.transferDone = (xhr, name, status) => {
249
461
  this.updateValueInMap(name, "status", status, false);
462
+ this.updateValueInMap(name, "uploaded", true, false);
250
463
  try {
251
464
  const response = JSON.parse(xhr.response);
252
465
  this.updateValueInMap(name, "url", response.url);
@@ -260,12 +473,13 @@ export class DuetUpload {
260
473
  this.transferDoneWithFailure = (xhr, name, status) => {
261
474
  try {
262
475
  const { error } = JSON.parse(xhr.response);
263
- this.updateValueInMap(name, "error", { message: error.message, type: error.type });
476
+ this.updateValueInMap(name, "error", { message: error.message, type: error.type }, false);
264
477
  }
265
478
  catch (e) {
266
479
  console.error("Server did not respond with expected response error:{message: string, type: int}");
267
- this.updateValueInMap(name, "error", { type: status });
480
+ this.updateValueInMap(name, "error", { type: status }, false);
268
481
  }
482
+ this.updateValueInMap(name, "valid", false, true);
269
483
  };
270
484
  this.transferFailed = name => {
271
485
  this.updateValueInMap(name, "error", getError("duet-upload-001"));
@@ -296,15 +510,15 @@ export class DuetUpload {
296
510
  this.files.delete(key);
297
511
  this.validateTotals();
298
512
  this.kick();
299
- if (!this.external) {
300
- this.makeXHRDeleteRequest(deletedItem);
301
- }
302
- this.resetFormFields();
303
513
  this.duetDelete.emit({
304
514
  originalEvent: ev,
305
515
  data: { deletion: deletedItem },
306
516
  component: "duet-upload",
307
517
  });
518
+ if (!this.external) {
519
+ this.makeXHRDeleteRequest(deletedItem);
520
+ }
521
+ this.resetFormFields();
308
522
  };
309
523
  this.onCancel = (key, ev) => {
310
524
  const cancelledItem = this.files.get(key);
@@ -323,9 +537,10 @@ export class DuetUpload {
323
537
  component: "duet-upload",
324
538
  });
325
539
  };
326
- this.onUpload = (ev) => {
540
+ this.onUpload = (ev, metaData) => {
327
541
  this.duetUpload.emit({
328
542
  originalEvent: ev,
543
+ metaData,
329
544
  component: "duet-upload",
330
545
  });
331
546
  };
@@ -357,13 +572,6 @@ export class DuetUpload {
357
572
  data: { files: this.files },
358
573
  });
359
574
  };
360
- this.startUpload = async (ev) => {
361
- await this.setFocus();
362
- this.nativeInput.click();
363
- this.onUpload(ev);
364
- ev.stopPropagation();
365
- ev.preventDefault();
366
- };
367
575
  }
368
576
  watchValidHandler(newValue, oldValue) {
369
577
  if (newValue !== oldValue) {
@@ -374,19 +582,18 @@ export class DuetUpload {
374
582
  * Component lifecycle events.
375
583
  */
376
584
  componentWillLoad() {
585
+ if (typeof this.statusMessageLabel === "string") {
586
+ this.internalStatusMessageLabel = sanitizeString(this.groups);
587
+ }
588
+ else {
589
+ this.internalStatusMessageLabel = this.statusMessageLabel;
590
+ }
377
591
  inheritGlobalTheme(this);
592
+ this.listenForActionEvents();
378
593
  }
379
594
  componentWillRender() {
380
- const { invalid, valid } = this.getFilesAsArray();
381
- const oldValid = this.valid;
382
- this.valid = invalid.length === 0 && valid.length !== 0;
383
- if (this.valid !== oldValid) {
384
- this.duetState.emit({
385
- originalEvent: undefined,
386
- data: { valid: this.valid, from: "componentWillRender" },
387
- component: "duet-upload",
388
- });
389
- }
595
+ // listen to the events from the component
596
+ this.verifyValidity();
390
597
  }
391
598
  /**
392
599
  * XHR request utilities
@@ -406,22 +613,34 @@ export class DuetUpload {
406
613
  xhr.upload.addEventListener("abort", () => {
407
614
  this.transferCanceled(name);
408
615
  });
409
- return makeXhrRequest({ data, name }, { type: "POST", uri: this.uri, xhr, argument: null, headers: null }, this.transferDoneWithFailure, this.transferDone, this.trackProgress);
616
+ return makeXhrRequest({
617
+ payload: { data, name },
618
+ options: { type: "POST", uri: this.uri, xhr, argument: null, headers: null },
619
+ onFailure: this.transferDoneWithFailure,
620
+ onSuccess: this.transferDone,
621
+ onProgress: this.trackProgress,
622
+ });
410
623
  }
411
624
  makeXHRDeleteRequest(data) {
412
625
  const { uid, item } = data;
413
626
  const xhr = new XMLHttpRequest();
414
627
  // don't present server issues to user on deletes, just remove them from the visible list
415
- return makeXhrRequest({ data: null, name }, {
416
- type: "DELETE",
417
- xhr,
418
- uri: this.uri,
419
- arguments: `?key=${uid}&name=${item.name}`,
420
- headers: {
421
- "x-fileuid": uid,
422
- "x-filename": item.name,
423
- },
424
- }, this.transferDoneWithFailure, this.transferDone, this.trackProgress);
628
+ return makeXhrRequest({
629
+ payload: { data: null, name },
630
+ options: {
631
+ type: "DELETE",
632
+ xhr,
633
+ uri: this.uri,
634
+ arguments: `?key=${uid}&name=${item.name}`,
635
+ headers: {
636
+ "x-fileuid": uid,
637
+ "x-filename": item.name,
638
+ },
639
+ },
640
+ onFailure: this.transferDoneWithFailure,
641
+ onSuccess: this.transferDone,
642
+ onProgress: this.trackProgress,
643
+ });
425
644
  }
426
645
  /**
427
646
  * Component event handling.
@@ -431,7 +650,7 @@ export class DuetUpload {
431
650
  const selectedFiles = Array.from((_a = this.nativeInput) === null || _a === void 0 ? void 0 : _a.files);
432
651
  // FileList is a nice array like structure but
433
652
  // to ensure uniqueness of files we use a mapping structure and
434
- // key to the name (makes it easier to delete)
653
+ // key to the name (makes it easier to delete as well)
435
654
  if (selectedFiles) {
436
655
  for (const item of selectedFiles) {
437
656
  const { valid, errorMessage, errorType, errorSystem } = validateFile(item, {
@@ -444,6 +663,8 @@ export class DuetUpload {
444
663
  uid,
445
664
  item: item,
446
665
  size: item.size,
666
+ meta: this.metaData,
667
+ uploaded: false,
447
668
  valid,
448
669
  error: {
449
670
  type: valid ? undefined : errorType,
@@ -472,8 +693,14 @@ export class DuetUpload {
472
693
  data.append("file", item);
473
694
  data.append("uid", uid);
474
695
  data.append("name", item.name);
475
- data.append("metadata", JSON.stringify({ uid, url: this.uri, size: item.size }));
476
- fileListItem.xhr = await this.makeXHRPostRequest(data);
696
+ data.append("metadata", JSON.stringify({ uid, url: this.uri, size: item.size, meta: fileListItem.meta }));
697
+ try {
698
+ fileListItem.xhr = await this.makeXHRPostRequest(data);
699
+ }
700
+ catch (e) {
701
+ // in case one of the global maxes have been reached, invalidate the file
702
+ this.updateValueInMap(item.name, "valid", false, false);
703
+ }
477
704
  }
478
705
  // kick the stat to force update
479
706
  this.kick();
@@ -481,6 +708,8 @@ export class DuetUpload {
481
708
  }
482
709
  // reset the form, so that a user may upload a file again (with the same name)
483
710
  this.resetFormFields();
711
+ // reset the internal metaData state
712
+ this.metaData = undefined;
484
713
  this.duetChange.emit({
485
714
  originalEvent: ev,
486
715
  data: { files: this.files },
@@ -497,6 +726,15 @@ export class DuetUpload {
497
726
  }
498
727
  return;
499
728
  }
729
+ /**
730
+ * Method for invoking the upload sequence
731
+ */
732
+ async upload(metaData = undefined) {
733
+ await this.setFocus();
734
+ this.metaData = metaData;
735
+ this.nativeInput.click();
736
+ return;
737
+ }
500
738
  /**
501
739
  * Get list of files, divided in errors and valid sections
502
740
  */
@@ -506,6 +744,12 @@ export class DuetUpload {
506
744
  }
507
745
  return this.getFilesAsArray();
508
746
  }
747
+ /**
748
+ * Convenience method for updating the value of a key:value inside an item in the files attribute
749
+ */
750
+ async updateValue(item, key, value) {
751
+ this.updateValueInMap(item, key, value);
752
+ }
509
753
  /**
510
754
  * render() function
511
755
  * Always the last one in the class.
@@ -518,26 +762,26 @@ export class DuetUpload {
518
762
  return (h(Host, { class: { "duet-m-0": this.margin === "none" } },
519
763
  h("duet-fieldset", { label: this.label, caption: caption },
520
764
  h("slot", { name: "header" }),
521
- h("duet-label", { theme: this.theme === "turva" ? "turva" : "default", size: "small", class: {
765
+ !this.files.size && (h("duet-label", { theme: this.theme === "turva" ? "turva" : "default", size: "small", class: {
522
766
  "duet-upload-filelist-empty": !this.files.size,
523
767
  "duet-upload-filelist": true,
524
768
  "duet-upload-filelist-filled": this.files.size,
525
- }, id: this.labelId, for: identifier }, !this.files.size && this.fileListEmpty),
769
+ }, id: this.labelId, for: identifier }, this.fileListEmpty)),
526
770
  !!this.files.size && h("slot", { name: "fileheader" }),
527
- h(DuetUploadFileList, { data: this.getFilesAsArray(), onDelete: this.onDelete, onCancel: this.onCancel, getError: this.getI18nError },
528
- h("li", null, "testing something")),
771
+ !!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 })),
772
+ !!this.files.size && (h("duet-editable-table", { "aria-live": "polite", "aria-relevant": "removals", accessibleRole: "log", id: this.editableTableId, groups: this.groups, actions: this.actions, hideGroups: this.hideGroups, items: this.convertToDuetEditableTableItems() })),
529
773
  !!this.files.size && h("slot", { name: "filefooter" }),
530
774
  h("duet-spacer", { size: "large" }),
531
- 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" }, this.buttonLabel),
775
+ !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" }, this.buttonLabel)),
532
776
  h("duet-spacer", { size: "medium" }),
533
777
  (this.fileMaxReached || this.bytesMaxReached) && (h("duet-alert", null,
534
- this.fileMaxReached && this.getI18nError("duet-upload-301"),
535
- this.bytesMaxReached && this.getI18nError("duet-upload-202"))),
778
+ this.fileMaxReached && getI18nError("duet-upload-301"),
779
+ this.bytesMaxReached && getI18nError("duet-upload-202"))),
536
780
  h("duet-spacer", { size: "medium" }),
537
781
  h("duet-visually-hidden", null,
538
782
  h("input", { ref: input => {
539
783
  this.nativeInput = input;
540
- }, accept: this.limitSelection ? undefined : `${this.allowedMimetypes},${this.allowedExtensions}`, onBlur: this.onBlur, onFocus: this.onFocus, onChange: e => this.onChange(e), type: "file", class: {
784
+ }, accept: !this.limitSelection ? undefined : `${this.allowedMimetypes},${this.allowedExtensions}`, onBlur: this.onBlur, onFocus: this.onFocus, onChange: e => this.onChange(e), type: "file", class: {
541
785
  "duet-upload": true,
542
786
  }, disabled: this.disabled, "aria-hidden": "true", required: this.required, name: this.name, id: this.identifier, multiple: this.multiple, capture: "user" })))));
543
787
  }
@@ -636,6 +880,47 @@ export class DuetUpload {
636
880
  "reflect": false,
637
881
  "defaultValue": "false"
638
882
  },
883
+ "hideButton": {
884
+ "type": "boolean",
885
+ "mutable": false,
886
+ "complexType": {
887
+ "original": "boolean",
888
+ "resolved": "boolean",
889
+ "references": {}
890
+ },
891
+ "required": false,
892
+ "optional": false,
893
+ "docs": {
894
+ "tags": [],
895
+ "text": "If set the upload component will not display an upload button, you will have to create one yourself\nand call the exposed method startUpload"
896
+ },
897
+ "attribute": "hide-upload-button",
898
+ "reflect": false,
899
+ "defaultValue": "false"
900
+ },
901
+ "actions": {
902
+ "type": "string",
903
+ "mutable": false,
904
+ "complexType": {
905
+ "original": "DuetEditableTableActions | string",
906
+ "resolved": "string | { icon: string; color: string; color_hover: string; id: string; map?: string[]; label?: DuetLangObject; }[]",
907
+ "references": {
908
+ "DuetEditableTableActions": {
909
+ "location": "import",
910
+ "path": "../duet-editable-table/duet-editable-table-item"
911
+ }
912
+ }
913
+ },
914
+ "required": false,
915
+ "optional": false,
916
+ "docs": {
917
+ "tags": [],
918
+ "text": "Default actions added to the internally used duet-editable-table"
919
+ },
920
+ "attribute": "actions",
921
+ "reflect": false,
922
+ "defaultValue": "[\n {\n icon: \"action-delete\",\n color: \"color-danger\",\n color_hover: \"category-home\",\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: \"category-home\",\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 ]"
923
+ },
639
924
  "uri": {
640
925
  "type": "string",
641
926
  "mutable": false,
@@ -653,6 +938,24 @@ export class DuetUpload {
653
938
  "attribute": "uri",
654
939
  "reflect": false
655
940
  },
941
+ "showLinks": {
942
+ "type": "boolean",
943
+ "mutable": false,
944
+ "complexType": {
945
+ "original": "boolean",
946
+ "resolved": "boolean",
947
+ "references": {}
948
+ },
949
+ "required": false,
950
+ "optional": false,
951
+ "docs": {
952
+ "tags": [],
953
+ "text": "If enabled the editable-table will display links on successfully uploaded items,\nthis requires the server can respond with link URIs in the correct format\nand that the files are accessible to the user"
954
+ },
955
+ "attribute": "show-links",
956
+ "reflect": false,
957
+ "defaultValue": "false"
958
+ },
656
959
  "caption": {
657
960
  "type": "string",
658
961
  "mutable": false,
@@ -670,12 +973,12 @@ export class DuetUpload {
670
973
  "attribute": "caption",
671
974
  "reflect": false
672
975
  },
673
- "buttonLabelDefaults": {
674
- "type": "unknown",
976
+ "statusLabelDefaults": {
977
+ "type": "string",
675
978
  "mutable": false,
676
979
  "complexType": {
677
- "original": "DuetLangObject",
678
- "resolved": "DuetLangObject",
980
+ "original": "DuetLangObject | string",
981
+ "resolved": "DuetLangObject | string",
679
982
  "references": {
680
983
  "DuetLangObject": {
681
984
  "location": "import",
@@ -685,10 +988,64 @@ export class DuetUpload {
685
988
  },
686
989
  "required": false,
687
990
  "optional": false,
991
+ "docs": {
992
+ "tags": [{
993
+ "name": "default",
994
+ "text": "{\nfi: {\ninProgress: \"L\u00E4hetet\u00E4\u00E4n {filesUploaded} l\u00E4hetett\u00E4v\u00E4st\u00E4 {filesTotal} tiedostosta\",\ninProgressWithErrors:\n\"L\u00E4hetet\u00E4\u00E4n {filesInProgress} tiedostoa, l\u00E4hetetty {filesUploaded} l\u00E4hetett\u00E4v\u00E4st\u00E4 {filesTotal} tiedostosta, {filesWithErrors} tiedostossa on virheit\u00E4\",\ndone: \"Kaikki {filesTotal} tiedostoa l\u00E4hetetty onnistuneesti\",\ndoneWithErrors:\n\"L\u00E4hetys valmis, {filesUploaded} tiedostoa on l\u00E4hetetty onnistuneesti, {filesWithErrors} tiedostossa oli virheit\u00E4\",\nfiles: \"tiedostot\",\nfile: \"tiedosto\",\n},\nsv: {\ninProgress: \"Adding {filesUploaded} of {filesTotal}\",\ninProgressWithErrors:\n\"Laddar upp {filesInProgress}, {filesUploaded} uppladdad av {filesTotal}, {filesWithErrors} misslyckades\",\ndone: \"Alla {filesTotal} har lagts till\",\ndoneWithErrors: \"Handling slutf\u00F6rd, {filesUploaded} har lagts till, {filesWithErrors} misslyckades\",\nfiles: \"filer\",\nfile: \"fil\",\n},\nen: {\ninProgress: \"Adding {filesUploaded} of {filesTotal}\",\ninProgressWithErrors:\n\"Uploading {filesInProgress}, {filesUploaded} uploaded of {filesTotal}, {filesWithErrors} failed\",\ndone: \"All {filesTotal} added successfully\",\ndoneWithErrors: \"Action completed, {filesUploaded} has been added successfully, {filesWithErrors} had errors\",\nfiles: \"tiedostoa\",\nfile: \"tiedosto\",\n},\n}"
995
+ }],
996
+ "text": "Property to change the aria upload progress text read aloud by screenreaders"
997
+ },
998
+ "attribute": "status-label-default",
999
+ "reflect": false,
1000
+ "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 }"
1001
+ },
1002
+ "statusMessageLabel": {
1003
+ "type": "string",
1004
+ "mutable": false,
1005
+ "complexType": {
1006
+ "original": "StatusMessage | string",
1007
+ "resolved": "string | { inProgress: string; inProgressWithErrors: string; done: string; doneWithErrors: string; file: string; files: string; }",
1008
+ "references": {
1009
+ "StatusMessage": {
1010
+ "location": "import",
1011
+ "path": "../duet-upload-aria-status/duet-upload-aria-status"
1012
+ }
1013
+ }
1014
+ },
1015
+ "required": false,
1016
+ "optional": false,
688
1017
  "docs": {
689
1018
  "tags": [],
690
- "text": "Property to change descriptionDefaults defaults on the component.\nnormally you would handle these strings on an application level and override @label when needed"
1019
+ "text": "Strings used for the status aria-label"
1020
+ },
1021
+ "attribute": "status-message-label",
1022
+ "reflect": false,
1023
+ "defaultValue": "getLocaleString(\n this.statusLabelDefaults\n )"
1024
+ },
1025
+ "buttonLabelDefaults": {
1026
+ "type": "string",
1027
+ "mutable": false,
1028
+ "complexType": {
1029
+ "original": "DuetLangObject | string",
1030
+ "resolved": "DuetLangObject | string",
1031
+ "references": {
1032
+ "DuetLangObject": {
1033
+ "location": "import",
1034
+ "path": "../../utils/language-utils"
1035
+ }
1036
+ }
1037
+ },
1038
+ "required": false,
1039
+ "optional": false,
1040
+ "docs": {
1041
+ "tags": [{
1042
+ "name": "default",
1043
+ "text": "{\nfi: \"Lis\u00E4\u00E4 liite\",\nsv: \"L\u00E4gg till en bilaga\",\nen: \"Add an attachment\",\n}"
1044
+ }],
1045
+ "text": "Property to change button label defaults on the component."
691
1046
  },
1047
+ "attribute": "button-label-default",
1048
+ "reflect": false,
692
1049
  "defaultValue": "{\n fi: \"Lis\u00E4\u00E4 liite\",\n sv: \"L\u00E4gg till en bilaga\",\n en: \"Add an attachment\",\n }"
693
1050
  },
694
1051
  "buttonLabel": {
@@ -703,8 +1060,8 @@ export class DuetUpload {
703
1060
  "optional": false,
704
1061
  "docs": {
705
1062
  "tags": [{
706
- "text": "{ fi: \"Lis\u00E4\u00E4 liite\", sv: \"L\u00E4gg till en bilaga\", en: \"Add an attachment\" }",
707
- "name": "default"
1063
+ "name": "default",
1064
+ "text": "{ fi: \"Lis\u00E4\u00E4 liite\", sv: \"L\u00E4gg till en bilaga\", en: \"Add an attachment\" }"
708
1065
  }],
709
1066
  "text": "Label of button"
710
1067
  },
@@ -724,7 +1081,7 @@ export class DuetUpload {
724
1081
  "optional": false,
725
1082
  "docs": {
726
1083
  "tags": [],
727
- "text": "accessible Label of button"
1084
+ "text": "accessible aria-Label of button"
728
1085
  },
729
1086
  "attribute": "accessible-button-label",
730
1087
  "reflect": false,
@@ -829,6 +1186,52 @@ export class DuetUpload {
829
1186
  "reflect": false,
830
1187
  "defaultValue": "false"
831
1188
  },
1189
+ "groups": {
1190
+ "type": "string",
1191
+ "mutable": false,
1192
+ "complexType": {
1193
+ "original": "DuetEditableTableGroupNames | string",
1194
+ "resolved": "string | { id: string; label: DuetLangObject; actionLabel?: DuetLangObject; }[]",
1195
+ "references": {
1196
+ "DuetEditableTableGroupNames": {
1197
+ "location": "import",
1198
+ "path": "../duet-editable-table/duet-editable-table"
1199
+ }
1200
+ }
1201
+ },
1202
+ "required": false,
1203
+ "optional": false,
1204
+ "docs": {
1205
+ "tags": [{
1206
+ "name": "required",
1207
+ "text": undefined
1208
+ }, {
1209
+ "name": "example",
1210
+ "text": "[{ id: \"success\", label: {fi: \"Onnistunut\", en: \"Success\", sv: \"Alt klart\", }}]"
1211
+ }],
1212
+ "text": "Array of group names that you want the editable table to use to display files"
1213
+ },
1214
+ "attribute": "groups",
1215
+ "reflect": false
1216
+ },
1217
+ "hideGroups": {
1218
+ "type": "boolean",
1219
+ "mutable": false,
1220
+ "complexType": {
1221
+ "original": "boolean",
1222
+ "resolved": "boolean",
1223
+ "references": {}
1224
+ },
1225
+ "required": false,
1226
+ "optional": false,
1227
+ "docs": {
1228
+ "tags": [],
1229
+ "text": "Visually hides the groups labels in the editable table list used to display the list of files"
1230
+ },
1231
+ "attribute": "hide-table-labels",
1232
+ "reflect": false,
1233
+ "defaultValue": "false"
1234
+ },
832
1235
  "files": {
833
1236
  "type": "unknown",
834
1237
  "mutable": true,
@@ -861,18 +1264,18 @@ export class DuetUpload {
861
1264
  "optional": false,
862
1265
  "docs": {
863
1266
  "tags": [],
864
- "text": "Property to read if filelist contains errors or not"
1267
+ "text": "Property to read if the internally used editable-table contains errors or not"
865
1268
  },
866
1269
  "attribute": "valid",
867
1270
  "reflect": true,
868
1271
  "defaultValue": "!this.required"
869
1272
  },
870
1273
  "labelDefaults": {
871
- "type": "unknown",
1274
+ "type": "string",
872
1275
  "mutable": false,
873
1276
  "complexType": {
874
- "original": "DuetLangObject",
875
- "resolved": "DuetLangObject",
1277
+ "original": "DuetLangObject | string",
1278
+ "resolved": "DuetLangObject | string",
876
1279
  "references": {
877
1280
  "DuetLangObject": {
878
1281
  "location": "import",
@@ -883,9 +1286,14 @@ export class DuetUpload {
883
1286
  "required": false,
884
1287
  "optional": false,
885
1288
  "docs": {
886
- "tags": [],
1289
+ "tags": [{
1290
+ "name": "default",
1291
+ "text": "{ fi: \"Lis\u00E4\u00E4 liite\",sv: \"L\u00E4gg till en bilaga\",en: \"Add attachments\"}"
1292
+ }],
887
1293
  "text": "Property to change labelDefaults defaults on the component.\nnormally you would handle these strings on an application level and override @label when needed"
888
1294
  },
1295
+ "attribute": "label-default",
1296
+ "reflect": false,
889
1297
  "defaultValue": "{\n fi: \"Lis\u00E4\u00E4 liite\",\n sv: \"L\u00E4gg till en bilaga\",\n en: \"Add attachments\",\n }"
890
1298
  },
891
1299
  "label": {
@@ -900,8 +1308,8 @@ export class DuetUpload {
900
1308
  "optional": false,
901
1309
  "docs": {
902
1310
  "tags": [{
903
- "text": "{ fi: \"Lis\u00E4\u00E4 liite\",sv: \"L\u00E4gg till en bilaga\",en: \"Add attachments\"}",
904
- "name": "default"
1311
+ "name": "default",
1312
+ "text": "{ fi: \"Lis\u00E4\u00E4 liite\",sv: \"L\u00E4gg till en bilaga\",en: \"Add attachments\"}"
905
1313
  }],
906
1314
  "text": "Label for the input."
907
1315
  },
@@ -910,11 +1318,11 @@ export class DuetUpload {
910
1318
  "defaultValue": "getLocaleString(this.labelDefaults)"
911
1319
  },
912
1320
  "descriptionDefaults": {
913
- "type": "unknown",
1321
+ "type": "string",
914
1322
  "mutable": false,
915
1323
  "complexType": {
916
- "original": "DuetLangObject",
917
- "resolved": "DuetLangObject",
1324
+ "original": "DuetLangObject | string",
1325
+ "resolved": "DuetLangObject | string",
918
1326
  "references": {
919
1327
  "DuetLangObject": {
920
1328
  "location": "import",
@@ -925,9 +1333,14 @@ export class DuetUpload {
925
1333
  "required": false,
926
1334
  "optional": false,
927
1335
  "docs": {
928
- "tags": [],
929
- "text": "Property to change descriptionDefaults defaults on the component.\nnormally you would handle these strings on an application level and override @label when needed"
1336
+ "tags": [{
1337
+ "name": "default",
1338
+ "text": "{\nfi: \"Voit liitt\u00E4\u00E4 {filetypes}-muotoisia tiedostoja sek\u00E4 yleisimpi\u00E4 videotiedostoja. Voit l\u00E4hett\u00E4\u00E4 {maxbytes} verran tiedostoja yhdell\u00E4 kertaa, ja lis\u00E4t\u00E4 enint\u00E4\u00E4n {maxfiles} liitett\u00E4 kerrallaan.\",\nsv: \"Du kan bifoga filer i flg. formater {filetypes} samt de vanligaste videofilerna. Du kan ladda upp {maxbytes} filer \u00E5t g\u00E5ngen och l\u00E4gga till upp till {maxfiles} bilagor \u00E5t g\u00E5ngen.\",\nen: \"You may attach the following filetypes: {filetypes} - as well as the most common video files. You can upload {maxbytes} of files at a time, and add up to {maxfiles} attachments at a time.\",\n}"
1339
+ }],
1340
+ "text": "Property to change descriptionDefaults defaults on the component."
930
1341
  },
1342
+ "attribute": "description-default",
1343
+ "reflect": false,
931
1344
  "defaultValue": "{\n fi: \"Voit liitt\u00E4\u00E4 {filetypes}-muotoisia tiedostoja sek\u00E4 yleisimpi\u00E4 videotiedostoja. Voit l\u00E4hett\u00E4\u00E4 {maxbytes} verran tiedostoja yhdell\u00E4 kertaa, ja lis\u00E4t\u00E4 enint\u00E4\u00E4n {maxfiles} liitett\u00E4 kerrallaan.\",\n sv: \"Du kan bifoga filer i flg. formater {filetypes} samt de vanligaste videofilerna. Du kan ladda upp {maxbytes} filer \u00E5t g\u00E5ngen och l\u00E4gga till upp till {maxfiles} bilagor \u00E5t g\u00E5ngen.\",\n en: \"You may attach the following filetypes: {filetypes} - as well as the most common video files. You can upload {maxbytes} of files at a time, and add up to {maxfiles} attachments at a time.\",\n }"
932
1345
  },
933
1346
  "description": {
@@ -942,8 +1355,8 @@ export class DuetUpload {
942
1355
  "optional": false,
943
1356
  "docs": {
944
1357
  "tags": [{
945
- "text": "...",
946
- "name": "default"
1358
+ "name": "default",
1359
+ "text": "{\nfi: \"Voit liitt\u00E4\u00E4 {filetypes}-muotoisia tiedostoja sek\u00E4 yleisimpi\u00E4 videotiedostoja. Voit l\u00E4hett\u00E4\u00E4 {maxbytes} verran tiedostoja yhdell\u00E4 kertaa, ja lis\u00E4t\u00E4 enint\u00E4\u00E4n {maxfiles} liitett\u00E4 kerrallaan.\",\nsv: \"Du kan bifoga filer i flg. formater {filetypes} samt de vanligaste videofilerna. Du kan ladda upp {maxbytes} filer \u00E5t g\u00E5ngen och l\u00E4gga till upp till {maxfiles} bilagor \u00E5t g\u00E5ngen.\",\nen: \"You may attach the following filetypes: {filetypes} - as well as the most common video files. You can upload {maxbytes} of files at a time, and add up to {maxfiles} attachments at a time.\",\n}"
947
1360
  }],
948
1361
  "text": "Description for the upload component."
949
1362
  },
@@ -952,11 +1365,11 @@ export class DuetUpload {
952
1365
  "defaultValue": "getLocaleString(this.descriptionDefaults)"
953
1366
  },
954
1367
  "fileListEmptyDefaults": {
955
- "type": "unknown",
1368
+ "type": "string",
956
1369
  "mutable": false,
957
1370
  "complexType": {
958
- "original": "DuetLangObject",
959
- "resolved": "DuetLangObject",
1371
+ "original": "DuetLangObject | string",
1372
+ "resolved": "DuetLangObject | string",
960
1373
  "references": {
961
1374
  "DuetLangObject": {
962
1375
  "location": "import",
@@ -968,11 +1381,13 @@ export class DuetUpload {
968
1381
  "optional": false,
969
1382
  "docs": {
970
1383
  "tags": [{
971
- "text": "{ fi: \"Lis\u00E4\u00E4 liite\",sv: \"L\u00E4gg till en bilaga\",en: \"Add attachments\"}",
972
- "name": "default"
1384
+ "name": "default",
1385
+ "text": "{\nfi: \"Ei viel\u00E4 lis\u00E4ttyj\u00E4 tiedostoja.\",\nsv: \"Inga filer har lagts till \u00E4nnu.\",\nen: \"No files added yet.\",\n}"
973
1386
  }],
974
1387
  "text": "Defaults for the filelist's empty state."
975
1388
  },
1389
+ "attribute": "list-empty-default",
1390
+ "reflect": false,
976
1391
  "defaultValue": "{\n fi: \"Ei viel\u00E4 lis\u00E4ttyj\u00E4 tiedostoja.\",\n sv: \"Inga filer har lagts till \u00E4nnu.\",\n en: \"No files added yet.\",\n }"
977
1392
  },
978
1393
  "fileListEmpty": {
@@ -987,8 +1402,8 @@ export class DuetUpload {
987
1402
  "optional": false,
988
1403
  "docs": {
989
1404
  "tags": [{
990
- "text": "{ fi: \"Ei viel\u00E4 lis\u00E4ttyj\u00E4 tiedostoja.\",sv: \"Inga filer har lagts till \u00E4nnu.\",en: \"No files added yet.\"}",
991
- "name": "default"
1405
+ "name": "default",
1406
+ "text": "{ fi: \"Ei viel\u00E4 lis\u00E4ttyj\u00E4 tiedostoja.\",sv: \"Inga filer har lagts till \u00E4nnu.\",en: \"No files added yet.\"}"
992
1407
  }],
993
1408
  "text": "Label for the filelist's empty state."
994
1409
  },
@@ -1014,24 +1429,6 @@ export class DuetUpload {
1014
1429
  "reflect": false,
1015
1430
  "defaultValue": "\"\""
1016
1431
  },
1017
- "labelHidden": {
1018
- "type": "boolean",
1019
- "mutable": false,
1020
- "complexType": {
1021
- "original": "boolean",
1022
- "resolved": "boolean",
1023
- "references": {}
1024
- },
1025
- "required": false,
1026
- "optional": false,
1027
- "docs": {
1028
- "tags": [],
1029
- "text": "Visually hide the label, but still show it to screen readers."
1030
- },
1031
- "attribute": "label-hidden",
1032
- "reflect": false,
1033
- "defaultValue": "false"
1034
- },
1035
1432
  "name": {
1036
1433
  "type": "string",
1037
1434
  "mutable": false,
@@ -1049,24 +1446,6 @@ export class DuetUpload {
1049
1446
  "attribute": "name",
1050
1447
  "reflect": false
1051
1448
  },
1052
- "capture": {
1053
- "type": "any",
1054
- "mutable": false,
1055
- "complexType": {
1056
- "original": "string | boolean",
1057
- "resolved": "boolean | string",
1058
- "references": {}
1059
- },
1060
- "required": false,
1061
- "optional": false,
1062
- "docs": {
1063
- "tags": [],
1064
- "text": "if set, allows capture of media from user camera / microphone\nThe capture attribute value is a string that specifies which camera to use for capture\nof image or video data, if the accept attribute indicates that the input should be of\none of those types. A value of user indicates that the user-facing camera and/or\nmicrophone should be used. A value of environment specifies that the outward-facing\ncamera and/or microphone should be used. If this attribute is missing, the user agent\nis free to decide on its own what to do. If the requested facing mode isn't available,\nthe user agent may fall back to its preferred default mode."
1065
- },
1066
- "attribute": "capture",
1067
- "reflect": false,
1068
- "defaultValue": "undefined"
1069
- },
1070
1449
  "maxBytes": {
1071
1450
  "type": "number",
1072
1451
  "mutable": false,
@@ -1133,8 +1512,8 @@ export class DuetUpload {
1133
1512
  "optional": false,
1134
1513
  "docs": {
1135
1514
  "tags": [{
1136
- "text": ": .pdf,.doc,.docx",
1137
- "name": "example"
1515
+ "name": "example",
1516
+ "text": ": .pdf,.doc,.docx"
1138
1517
  }],
1139
1518
  "text": "A string of commaseperated file type values that are allowed"
1140
1519
  },
@@ -1154,8 +1533,8 @@ export class DuetUpload {
1154
1533
  "optional": false,
1155
1534
  "docs": {
1156
1535
  "tags": [{
1157
- "text": ": image/*,application/msword,",
1158
- "name": "example"
1536
+ "name": "example",
1537
+ "text": ": image/*,application/msword,"
1159
1538
  }],
1160
1539
  "text": "A string of commaseperated mime type values that are allowed"
1161
1540
  },
@@ -1232,7 +1611,7 @@ export class DuetUpload {
1232
1611
  },
1233
1612
  "complexType": {
1234
1613
  "original": "DuetUploadEvent",
1235
- "resolved": "{ originalEvent?: Event; data?: Record<string, any>; component: \"duet-upload\"; }",
1614
+ "resolved": "{ originalEvent?: Event; data?: Record<string, any>; metaData?: Record<string, any>; component: \"duet-upload\"; }",
1236
1615
  "references": {
1237
1616
  "DuetUploadEvent": {
1238
1617
  "location": "local"
@@ -1251,7 +1630,7 @@ export class DuetUpload {
1251
1630
  },
1252
1631
  "complexType": {
1253
1632
  "original": "DuetUploadEvent",
1254
- "resolved": "{ originalEvent?: Event; data?: Record<string, any>; component: \"duet-upload\"; }",
1633
+ "resolved": "{ originalEvent?: Event; data?: Record<string, any>; metaData?: Record<string, any>; component: \"duet-upload\"; }",
1255
1634
  "references": {
1256
1635
  "DuetUploadEvent": {
1257
1636
  "location": "local"
@@ -1270,7 +1649,7 @@ export class DuetUpload {
1270
1649
  },
1271
1650
  "complexType": {
1272
1651
  "original": "DuetUploadEvent",
1273
- "resolved": "{ originalEvent?: Event; data?: Record<string, any>; component: \"duet-upload\"; }",
1652
+ "resolved": "{ originalEvent?: Event; data?: Record<string, any>; metaData?: Record<string, any>; component: \"duet-upload\"; }",
1274
1653
  "references": {
1275
1654
  "DuetUploadEvent": {
1276
1655
  "location": "local"
@@ -1289,7 +1668,7 @@ export class DuetUpload {
1289
1668
  },
1290
1669
  "complexType": {
1291
1670
  "original": "DuetUploadEvent",
1292
- "resolved": "{ originalEvent?: Event; data?: Record<string, any>; component: \"duet-upload\"; }",
1671
+ "resolved": "{ originalEvent?: Event; data?: Record<string, any>; metaData?: Record<string, any>; component: \"duet-upload\"; }",
1293
1672
  "references": {
1294
1673
  "DuetUploadEvent": {
1295
1674
  "location": "local"
@@ -1308,7 +1687,7 @@ export class DuetUpload {
1308
1687
  },
1309
1688
  "complexType": {
1310
1689
  "original": "DuetUploadEvent",
1311
- "resolved": "{ originalEvent?: Event; data?: Record<string, any>; component: \"duet-upload\"; }",
1690
+ "resolved": "{ originalEvent?: Event; data?: Record<string, any>; metaData?: Record<string, any>; component: \"duet-upload\"; }",
1312
1691
  "references": {
1313
1692
  "DuetUploadEvent": {
1314
1693
  "location": "local"
@@ -1327,7 +1706,7 @@ export class DuetUpload {
1327
1706
  },
1328
1707
  "complexType": {
1329
1708
  "original": "DuetUploadEvent",
1330
- "resolved": "{ originalEvent?: Event; data?: Record<string, any>; component: \"duet-upload\"; }",
1709
+ "resolved": "{ originalEvent?: Event; data?: Record<string, any>; metaData?: Record<string, any>; component: \"duet-upload\"; }",
1331
1710
  "references": {
1332
1711
  "DuetUploadEvent": {
1333
1712
  "location": "local"
@@ -1346,7 +1725,7 @@ export class DuetUpload {
1346
1725
  },
1347
1726
  "complexType": {
1348
1727
  "original": "DuetUploadEvent",
1349
- "resolved": "{ originalEvent?: Event; data?: Record<string, any>; component: \"duet-upload\"; }",
1728
+ "resolved": "{ originalEvent?: Event; data?: Record<string, any>; metaData?: Record<string, any>; component: \"duet-upload\"; }",
1350
1729
  "references": {
1351
1730
  "DuetUploadEvent": {
1352
1731
  "location": "local"
@@ -1365,7 +1744,7 @@ export class DuetUpload {
1365
1744
  },
1366
1745
  "complexType": {
1367
1746
  "original": "DuetUploadEvent",
1368
- "resolved": "{ originalEvent?: Event; data?: Record<string, any>; component: \"duet-upload\"; }",
1747
+ "resolved": "{ originalEvent?: Event; data?: Record<string, any>; metaData?: Record<string, any>; component: \"duet-upload\"; }",
1369
1748
  "references": {
1370
1749
  "DuetUploadEvent": {
1371
1750
  "location": "local"
@@ -1384,7 +1763,7 @@ export class DuetUpload {
1384
1763
  },
1385
1764
  "complexType": {
1386
1765
  "original": "DuetUploadEvent",
1387
- "resolved": "{ originalEvent?: Event; data?: Record<string, any>; component: \"duet-upload\"; }",
1766
+ "resolved": "{ originalEvent?: Event; data?: Record<string, any>; metaData?: Record<string, any>; component: \"duet-upload\"; }",
1388
1767
  "references": {
1389
1768
  "DuetUploadEvent": {
1390
1769
  "location": "local"
@@ -1415,6 +1794,25 @@ export class DuetUpload {
1415
1794
  "tags": []
1416
1795
  }
1417
1796
  },
1797
+ "upload": {
1798
+ "complexType": {
1799
+ "signature": "(metaData?: any | undefined) => Promise<void>",
1800
+ "parameters": [{
1801
+ "tags": [],
1802
+ "text": ""
1803
+ }],
1804
+ "references": {
1805
+ "Promise": {
1806
+ "location": "global"
1807
+ }
1808
+ },
1809
+ "return": "Promise<void>"
1810
+ },
1811
+ "docs": {
1812
+ "text": "Method for invoking the upload sequence",
1813
+ "tags": []
1814
+ }
1815
+ },
1418
1816
  "getFiles": {
1419
1817
  "complexType": {
1420
1818
  "signature": "() => Promise<false | { valid: any[]; invalid: any[]; }>",
@@ -1430,6 +1828,31 @@ export class DuetUpload {
1430
1828
  "text": "Get list of files, divided in errors and valid sections",
1431
1829
  "tags": []
1432
1830
  }
1831
+ },
1832
+ "updateValue": {
1833
+ "complexType": {
1834
+ "signature": "(item: string, key: string, value: any) => Promise<void>",
1835
+ "parameters": [{
1836
+ "tags": [],
1837
+ "text": ""
1838
+ }, {
1839
+ "tags": [],
1840
+ "text": ""
1841
+ }, {
1842
+ "tags": [],
1843
+ "text": ""
1844
+ }],
1845
+ "references": {
1846
+ "Promise": {
1847
+ "location": "global"
1848
+ }
1849
+ },
1850
+ "return": "Promise<void>"
1851
+ },
1852
+ "docs": {
1853
+ "text": "Convenience method for updating the value of a key:value inside an item in the files attribute",
1854
+ "tags": []
1855
+ }
1433
1856
  }
1434
1857
  }; }
1435
1858
  static get elementRef() { return "element"; }