@duetds/components 4.32.0 → 4.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (388) hide show
  1. package/hydrate/index.js +2367 -244
  2. package/lib/cjs/{dom-a28e5c5f.js → dom-52a4f07a.js} +1 -1
  3. package/lib/cjs/duet-alert.cjs.entry.js +2 -2
  4. package/lib/cjs/duet-badge.cjs.entry.js +1 -1
  5. package/lib/cjs/duet-button_2.cjs.entry.js +4 -4
  6. package/lib/cjs/duet-caption_4.cjs.entry.js +18 -11
  7. package/lib/cjs/duet-card.cjs.entry.js +3 -3
  8. package/lib/cjs/duet-checkbox.cjs.entry.js +2 -2
  9. package/lib/cjs/duet-choice_2.cjs.entry.js +39 -18
  10. package/lib/cjs/duet-collapsible.cjs.entry.js +5 -450
  11. package/lib/cjs/duet-cookie-consent.cjs.entry.js +1 -1
  12. package/lib/cjs/duet-date-picker.cjs.entry.js +7 -7
  13. package/lib/cjs/duet-divider_2.cjs.entry.js +1 -1
  14. package/lib/cjs/duet-editable-table-button.cjs.entry.js +96 -0
  15. package/lib/cjs/duet-editable-table_4.cjs.entry.js +1520 -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 +3 -3
  19. package/lib/cjs/duet-grid_2.cjs.entry.js +69 -4
  20. package/lib/cjs/duet-header_2.cjs.entry.js +216 -49
  21. package/lib/cjs/duet-hero.cjs.entry.js +2 -2
  22. package/lib/cjs/duet-icon.cjs.entry.js +8 -6
  23. package/lib/cjs/duet-input_2.cjs.entry.js +8 -9
  24. package/lib/cjs/duet-layout.cjs.entry.js +1 -1
  25. package/lib/cjs/duet-list_2.cjs.entry.js +3 -3
  26. package/lib/cjs/duet-modal.cjs.entry.js +3 -3
  27. package/lib/cjs/duet-notification_2.cjs.entry.js +3 -3
  28. package/lib/cjs/duet-number-input.cjs.entry.js +2 -2
  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 +5 -5
  33. package/lib/cjs/duet-step_2.cjs.entry.js +1 -1
  34. package/lib/cjs/duet-tab_2.cjs.entry.js +3 -3
  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 +2 -2
  38. package/lib/cjs/duet-tray.cjs.entry.js +3 -3
  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-55b5a616.js → focus-utils-480ea4e0.js} +1 -1
  43. package/lib/cjs/form-search-d61b2843.js +8 -0
  44. package/lib/cjs/{index-03ed1f55.js → index-6966a494.js} +5 -2
  45. package/lib/cjs/{language-utils-48b8860b.js → language-utils-aa282901.js} +6 -2
  46. package/lib/cjs/loader.cjs.js +3 -3
  47. package/lib/cjs/{shadow-css-6560c90c.js → shadow-css-e1b62a99.js} +9 -10
  48. package/lib/cjs/token-utils-05bd23b4.js +77 -0
  49. package/lib/cjs/tokens-8596cece.js +459 -0
  50. package/lib/cjs/{tokens.module-53b3bd92.js → tokens.module-6b2df1c2.js} +2 -0
  51. package/lib/cjs/{watch-options-3877c082.js → watch-options-d88afac0.js} +29 -6
  52. package/lib/collection/collection-manifest.json +17 -3
  53. package/lib/collection/components/duet-checkbox/duet-checkbox.css +1 -1
  54. package/lib/collection/components/duet-choice/duet-choice.js +94 -21
  55. package/lib/collection/components/duet-collapsible/duet-collapsible.js +4 -1
  56. package/lib/collection/components/duet-date-picker/duet-date-picker.js +9 -9
  57. package/lib/collection/components/duet-editable-table/duet-editable-table-button.css +32 -0
  58. package/lib/collection/components/duet-editable-table/duet-editable-table-button.js +225 -0
  59. package/lib/collection/components/duet-editable-table/duet-editable-table-item.css +36 -0
  60. package/lib/collection/components/duet-editable-table/duet-editable-table-item.js +225 -0
  61. package/lib/collection/components/duet-editable-table/duet-editable-table-tabledata.js +13 -0
  62. package/lib/collection/components/duet-editable-table/duet-editable-table.css +16 -0
  63. package/lib/collection/components/duet-editable-table/duet-editable-table.js +404 -0
  64. package/lib/collection/components/duet-footer/duet-footer.css +1 -0
  65. package/lib/collection/components/duet-grid/duet-grid.js +74 -6
  66. package/lib/collection/components/duet-header/duet-header-dropdown.js +27 -0
  67. package/lib/collection/components/duet-header/duet-header-hamburger.js +9 -0
  68. package/lib/collection/components/duet-header/duet-header-icon.js +9 -0
  69. package/lib/collection/components/duet-header/duet-header.css +272 -39
  70. package/lib/collection/components/duet-header/duet-header.js +310 -122
  71. package/lib/collection/components/duet-heading/duet-heading.css +3 -0
  72. package/lib/collection/components/duet-heading/duet-heading.js +7 -6
  73. package/lib/collection/components/duet-icon/duet-icon.js +5 -3
  74. package/lib/collection/components/duet-input/duet-input.css +15 -0
  75. package/lib/collection/components/duet-input/duet-input.js +4 -4
  76. package/lib/collection/components/duet-link/duet-link.js +4 -1
  77. package/lib/collection/components/duet-list-item/duet-list-item.css +1 -1
  78. package/lib/collection/components/duet-notification-drawer/duet-notification-drawer.css +4 -3
  79. package/lib/collection/components/duet-paragraph/duet-paragraph.css +6 -0
  80. package/lib/collection/components/duet-paragraph/duet-paragraph.js +34 -3
  81. package/lib/collection/components/duet-progress/duet-progress.css +103 -0
  82. package/lib/collection/components/duet-progress/duet-progress.js +240 -0
  83. package/lib/collection/components/duet-select/duet-select.css +15 -0
  84. package/lib/collection/components/duet-select/duet-select.js +3 -3
  85. package/lib/collection/components/duet-tab-group/duet-tab-group.css +2 -2
  86. package/lib/collection/components/duet-table/duet-table.css +42 -17
  87. package/lib/collection/components/duet-table/duet-table.js +2 -2
  88. package/lib/collection/components/duet-textarea/duet-textarea.css +19 -0
  89. package/lib/collection/components/duet-textarea/duet-textarea.js +5 -4
  90. package/lib/collection/components/duet-upload/duet-upload.css +64 -0
  91. package/lib/collection/components/duet-upload/duet-upload.js +1885 -0
  92. package/lib/collection/components/duet-upload/errorcodes.utils.js +32 -0
  93. package/lib/collection/components/duet-upload/mock.helpers.js +91 -0
  94. package/lib/collection/components/duet-upload/upload-editable-item-error.js +16 -0
  95. package/lib/collection/components/duet-upload/upload-editable-item-inprogres.js +8 -0
  96. package/lib/collection/components/duet-upload/upload-editable-item-success.js +30 -0
  97. package/lib/collection/components/duet-upload/upload-validators.js +93 -0
  98. package/lib/collection/components/duet-upload/upload.helpers.js +13 -0
  99. package/lib/collection/components/duet-upload/xhr.helpers.js +30 -0
  100. package/lib/collection/components/duet-upload-aria-status/duet-upload-aria-status.js +217 -0
  101. package/lib/collection/utils/js-utils.js +12 -0
  102. package/lib/collection/utils/language-utils.js +6 -3
  103. package/lib/collection/utils/template-utils.js +33 -0
  104. package/lib/collection/utils/token-utils.js +67 -14
  105. package/lib/collection/utils/watch-options.js +35 -6
  106. package/lib/custom-elements-bundle/index.d.ts +36 -0
  107. package/lib/custom-elements-bundle/index.js +2309 -334
  108. package/lib/duet/duet.esm.js +1 -1
  109. package/lib/duet/duet.js +1 -1
  110. package/lib/duet/{p-92103298.system.entry.js → p-07f43530.system.entry.js} +1 -1
  111. package/lib/duet/{p-cc0bd28f.system.entry.js → p-093bca2f.system.entry.js} +1 -1
  112. package/lib/duet/{p-a678da8c.entry.js → p-0aaf86ba.entry.js} +1 -1
  113. package/lib/duet/{p-94a5fd74.system.entry.js → p-0b0a05ed.system.entry.js} +1 -1
  114. package/lib/duet/{p-00eac879.system.entry.js → p-0be1c660.system.entry.js} +1 -1
  115. package/lib/duet/{p-3b3bac3f.system.entry.js → p-0d66e11b.system.entry.js} +1 -1
  116. package/lib/duet/{p-7331f2fe.system.entry.js → p-0de430e1.system.entry.js} +1 -1
  117. package/lib/duet/{p-3618aaee.entry.js → p-0ef8d711.entry.js} +1 -1
  118. package/lib/duet/p-12721178.js +4 -0
  119. package/lib/duet/{p-c19094dd.entry.js → p-12a08d77.entry.js} +1 -1
  120. package/lib/duet/p-15c9a17c.entry.js +4 -0
  121. package/lib/duet/{p-9cdd361e.js → p-183726f7.js} +0 -0
  122. package/lib/duet/{p-b75c5f13.entry.js → p-18c3eb54.entry.js} +1 -1
  123. package/lib/duet/{p-9542c540.entry.js → p-1b591fa4.entry.js} +1 -1
  124. package/lib/duet/{p-f364ce8b.system.entry.js → p-1bd0f4eb.system.entry.js} +1 -1
  125. package/lib/duet/p-2764f081.js +4 -0
  126. package/lib/duet/p-27bd8744.system.entry.js +4 -0
  127. package/lib/duet/p-289a31cb.entry.js +4 -0
  128. package/lib/duet/{p-8c511832.system.entry.js → p-29b352db.system.entry.js} +1 -1
  129. package/lib/duet/p-2a00f231.system.entry.js +4 -0
  130. package/lib/duet/p-3215e07e.system.entry.js +4 -0
  131. package/lib/duet/{p-ed479d09.system.entry.js → p-338b9955.system.entry.js} +1 -1
  132. package/lib/duet/{p-8740fa38.entry.js → p-33de1029.entry.js} +1 -1
  133. package/lib/duet/p-34ebff3b.entry.js +4 -0
  134. package/lib/duet/{p-b6a0caf8.system.entry.js → p-379d416f.system.entry.js} +1 -1
  135. package/lib/duet/{p-0b9b6393.entry.js → p-39a12eb9.entry.js} +1 -1
  136. package/lib/duet/{p-8652a7ab.system.entry.js → p-39fd8b43.system.entry.js} +1 -1
  137. package/lib/duet/{p-ffc2ffff.entry.js → p-3bafdf7c.entry.js} +1 -1
  138. package/lib/duet/{p-4fcbcecd.system.entry.js → p-3c1ce7e2.system.entry.js} +1 -1
  139. package/lib/duet/p-3da6b84e.entry.js +4 -0
  140. package/lib/duet/p-43c49a72.entry.js +4 -0
  141. package/lib/duet/{p-9f0f5674.entry.js → p-44f4b8ff.entry.js} +1 -1
  142. package/lib/duet/{p-b0bbbdba.system.entry.js → p-4c5ac0c2.system.entry.js} +1 -1
  143. package/lib/duet/p-50b4fb2c.js +4 -0
  144. package/lib/duet/p-51f7ae72.entry.js +4 -0
  145. package/lib/duet/p-52621211.js +15 -0
  146. package/lib/duet/{p-2a3411b5.system.entry.js → p-5443c9ca.system.entry.js} +1 -1
  147. package/lib/duet/{p-abd3bfb4.system.entry.js → p-5610db77.system.entry.js} +1 -1
  148. package/lib/duet/{p-2c0dd9ba.system.entry.js → p-5b409bfb.system.entry.js} +1 -1
  149. package/lib/duet/{p-807b2087.entry.js → p-6353407f.entry.js} +1 -1
  150. package/lib/duet/{p-a89e88a3.js → p-64bf94ee.js} +1 -1
  151. package/lib/duet/{p-2c679963.entry.js → p-64e915ae.entry.js} +1 -1
  152. package/lib/duet/{p-432ba72e.system.entry.js → p-6c237f21.system.entry.js} +1 -1
  153. package/lib/duet/p-6c8521f6.system.entry.js +4 -0
  154. package/lib/duet/{p-a962c8c1.system.js → p-6e4fd6ba.system.js} +0 -0
  155. package/lib/duet/p-70fafc98.system.js +4 -0
  156. package/lib/duet/{p-8002a095.entry.js → p-7347f4ac.entry.js} +1 -1
  157. package/lib/duet/{p-d13874cb.entry.js → p-781bd6db.entry.js} +1 -1
  158. package/lib/duet/{p-5a817929.system.entry.js → p-78e8a689.system.entry.js} +1 -1
  159. package/lib/duet/p-8143f3de.js +4 -0
  160. package/lib/duet/p-81e855e4.system.js +4 -0
  161. package/lib/duet/{p-84ece735.entry.js → p-8224d768.entry.js} +1 -1
  162. package/lib/duet/{p-43dde575.system.entry.js → p-848bb1c2.system.entry.js} +1 -1
  163. package/lib/duet/{p-1391ec53.entry.js → p-880a4afe.entry.js} +1 -1
  164. package/lib/duet/p-8c375429.entry.js +4 -0
  165. package/lib/duet/p-8cb71174.system.entry.js +4 -0
  166. package/lib/duet/p-8d7b68c4.entry.js +4 -0
  167. package/lib/duet/p-8f477bd6.system.js +4 -0
  168. package/lib/duet/p-969c6395.system.entry.js +4 -0
  169. package/lib/duet/p-9c234242.system.entry.js +4 -0
  170. package/lib/duet/{p-f13a0883.entry.js → p-9d7b9084.entry.js} +1 -1
  171. package/lib/duet/p-a0544097.system.entry.js +4 -0
  172. package/lib/duet/p-a16a58c1.system.js +4 -0
  173. package/lib/duet/{p-fb898d94.system.entry.js → p-a4a16d03.system.entry.js} +1 -1
  174. package/lib/duet/p-a4e3b44b.entry.js +4 -0
  175. package/lib/duet/{p-977f2826.entry.js → p-a91673cf.entry.js} +1 -1
  176. package/lib/duet/p-a926944f.entry.js +4 -0
  177. package/lib/duet/{p-2826f987.js → p-ad07f399.js} +1 -1
  178. package/lib/duet/p-b08bce4c.entry.js +4 -0
  179. package/lib/duet/{p-ec3eef3a.entry.js → p-b48a5f80.entry.js} +1 -1
  180. package/lib/duet/p-bb3e3777.entry.js +4 -0
  181. package/lib/duet/{p-fbb7d194.entry.js → p-bbe33d02.entry.js} +1 -1
  182. package/lib/duet/p-be8e1c48.system.entry.js +4 -0
  183. package/lib/duet/{p-68d09837.system.entry.js → p-c56c73ee.system.entry.js} +1 -1
  184. package/lib/duet/p-c63bdc6a.system.entry.js +4 -0
  185. package/lib/duet/{p-c723d36e.system.js → p-c83685a6.system.js} +1 -1
  186. package/lib/duet/p-c8dfc958.system.entry.js +4 -0
  187. package/lib/duet/{p-6cf41bfe.system.entry.js → p-c92f601f.system.entry.js} +1 -1
  188. package/lib/duet/p-d004da5f.js +4 -0
  189. package/lib/duet/p-d49416f8.entry.js +4 -0
  190. package/lib/duet/{p-7a868085.entry.js → p-d581d82d.entry.js} +1 -1
  191. package/lib/duet/p-d6bb4301.entry.js +4 -0
  192. package/lib/duet/p-d9aadc15.entry.js +4 -0
  193. package/lib/duet/p-ddb6344c.system.js +4 -0
  194. package/lib/duet/{p-3040debf.entry.js → p-dde63979.entry.js} +1 -1
  195. package/lib/duet/p-e15ccddc.system.entry.js +4 -0
  196. package/lib/duet/{p-0f2a478e.entry.js → p-e1be37a6.entry.js} +1 -1
  197. package/lib/duet/p-e5c1751e.system.js +16 -0
  198. package/lib/duet/{p-b9683731.entry.js → p-e9209e9f.entry.js} +1 -1
  199. package/lib/duet/p-eb55ccd2.system.js +4 -0
  200. package/lib/duet/{p-b374d7c2.system.js → p-ee1ba0d4.system.js} +1 -1
  201. package/lib/duet/{p-57cb58d4.system.entry.js → p-f4a29a8a.system.entry.js} +2 -2
  202. package/lib/duet/p-f8a0bd32.system.entry.js +4 -0
  203. package/lib/duet/p-f9599dd9.system.entry.js +4 -0
  204. package/lib/duet/p-fa99eaa4.system.js +4 -0
  205. package/lib/duet/p-fd7018e9.js +4 -0
  206. package/lib/duet/{p-19c28d99.system.entry.js → p-fe0cca67.system.entry.js} +1 -1
  207. package/lib/esm/{dom-8516b24e.js → dom-5d060ace.js} +1 -1
  208. package/lib/esm/duet-alert.entry.js +2 -2
  209. package/lib/esm/duet-badge.entry.js +1 -1
  210. package/lib/esm/duet-button_2.entry.js +4 -4
  211. package/lib/esm/duet-caption_4.entry.js +18 -11
  212. package/lib/esm/duet-card.entry.js +3 -3
  213. package/lib/esm/duet-checkbox.entry.js +2 -2
  214. package/lib/esm/duet-choice_2.entry.js +40 -19
  215. package/lib/esm/duet-collapsible.entry.js +4 -449
  216. package/lib/esm/duet-cookie-consent.entry.js +1 -1
  217. package/lib/esm/duet-date-picker.entry.js +7 -7
  218. package/lib/esm/duet-divider_2.entry.js +1 -1
  219. package/lib/esm/duet-editable-table-button.entry.js +92 -0
  220. package/lib/esm/duet-editable-table_4.entry.js +1513 -0
  221. package/lib/esm/duet-empty-state.entry.js +1 -1
  222. package/lib/esm/duet-fieldset.entry.js +1 -1
  223. package/lib/esm/duet-footer.entry.js +3 -3
  224. package/lib/esm/duet-grid_2.entry.js +69 -4
  225. package/lib/esm/duet-header_2.entry.js +216 -49
  226. package/lib/esm/duet-hero.entry.js +2 -2
  227. package/lib/esm/duet-icon.entry.js +8 -6
  228. package/lib/esm/duet-input_2.entry.js +7 -8
  229. package/lib/esm/duet-layout.entry.js +1 -1
  230. package/lib/esm/duet-list_2.entry.js +3 -3
  231. package/lib/esm/duet-modal.entry.js +3 -3
  232. package/lib/esm/duet-notification_2.entry.js +3 -3
  233. package/lib/esm/duet-number-input.entry.js +2 -2
  234. package/lib/esm/duet-progress.entry.js +71 -0
  235. package/lib/esm/duet-radio_2.entry.js +2 -2
  236. package/lib/esm/duet-range-slider.entry.js +2 -2
  237. package/lib/esm/duet-select.entry.js +5 -5
  238. package/lib/esm/duet-step_2.entry.js +1 -1
  239. package/lib/esm/duet-tab_2.entry.js +3 -3
  240. package/lib/esm/duet-textarea.entry.js +5 -5
  241. package/lib/esm/duet-toggle.entry.js +1 -1
  242. package/lib/esm/duet-tooltip.entry.js +2 -2
  243. package/lib/esm/duet-tray.entry.js +3 -3
  244. package/lib/esm/duet-upload-aria-status.entry.js +96 -0
  245. package/lib/esm/duet-visually-hidden.entry.js +1 -1
  246. package/lib/esm/duet.js +4 -4
  247. package/lib/esm/{focus-utils-6a282066.js → focus-utils-48837cfa.js} +1 -1
  248. package/lib/esm/form-search-ea8e19ae.js +6 -0
  249. package/lib/esm/{index-3a265449.js → index-80be4170.js} +5 -2
  250. package/lib/esm/{language-utils-d5c38f65.js → language-utils-344d894c.js} +6 -3
  251. package/lib/esm/loader.js +3 -3
  252. package/lib/esm/{shadow-css-9178c864.js → shadow-css-13d024f4.js} +9 -10
  253. package/lib/esm/token-utils-75f78ca4.js +75 -0
  254. package/lib/esm/tokens-e110dc89.js +453 -0
  255. package/lib/esm/{tokens.module-edb66c04.js → tokens.module-49cbf963.js} +3 -1
  256. package/lib/esm/watch-options-dd55bce8.js +57 -0
  257. package/lib/esm-es5/{dom-8516b24e.js → dom-5d060ace.js} +0 -0
  258. package/lib/esm-es5/duet-alert.entry.js +1 -1
  259. package/lib/esm-es5/duet-badge.entry.js +1 -1
  260. package/lib/esm-es5/duet-button_2.entry.js +1 -1
  261. package/lib/esm-es5/duet-caption_4.entry.js +2 -2
  262. package/lib/esm-es5/duet-card.entry.js +1 -1
  263. package/lib/esm-es5/duet-checkbox.entry.js +1 -1
  264. package/lib/esm-es5/duet-choice_2.entry.js +2 -2
  265. package/lib/esm-es5/duet-collapsible.entry.js +2 -2
  266. package/lib/esm-es5/duet-cookie-consent.entry.js +1 -1
  267. package/lib/esm-es5/duet-date-picker.entry.js +1 -1
  268. package/lib/esm-es5/duet-divider_2.entry.js +1 -1
  269. package/lib/esm-es5/duet-editable-table-button.entry.js +4 -0
  270. package/lib/esm-es5/duet-editable-table_4.entry.js +4 -0
  271. package/lib/esm-es5/duet-empty-state.entry.js +1 -1
  272. package/lib/esm-es5/duet-fieldset.entry.js +1 -1
  273. package/lib/esm-es5/duet-footer.entry.js +1 -1
  274. package/lib/esm-es5/duet-grid_2.entry.js +2 -2
  275. package/lib/esm-es5/duet-header_2.entry.js +2 -2
  276. package/lib/esm-es5/duet-hero.entry.js +1 -1
  277. package/lib/esm-es5/duet-icon.entry.js +1 -1
  278. package/lib/esm-es5/duet-input_2.entry.js +1 -1
  279. package/lib/esm-es5/duet-layout.entry.js +1 -1
  280. package/lib/esm-es5/duet-list_2.entry.js +1 -1
  281. package/lib/esm-es5/duet-modal.entry.js +1 -1
  282. package/lib/esm-es5/duet-notification_2.entry.js +1 -1
  283. package/lib/esm-es5/duet-number-input.entry.js +1 -1
  284. package/lib/esm-es5/duet-progress.entry.js +4 -0
  285. package/lib/esm-es5/duet-radio_2.entry.js +1 -1
  286. package/lib/esm-es5/duet-range-slider.entry.js +1 -1
  287. package/lib/esm-es5/duet-select.entry.js +1 -1
  288. package/lib/esm-es5/duet-step_2.entry.js +1 -1
  289. package/lib/esm-es5/duet-tab_2.entry.js +2 -2
  290. package/lib/esm-es5/duet-textarea.entry.js +1 -1
  291. package/lib/esm-es5/duet-toggle.entry.js +1 -1
  292. package/lib/esm-es5/duet-tooltip.entry.js +1 -1
  293. package/lib/esm-es5/duet-tray.entry.js +1 -1
  294. package/lib/esm-es5/duet-upload-aria-status.entry.js +4 -0
  295. package/lib/esm-es5/duet-visually-hidden.entry.js +1 -1
  296. package/lib/esm-es5/duet.js +1 -1
  297. package/lib/esm-es5/focus-utils-48837cfa.js +4 -0
  298. package/lib/esm-es5/form-search-ea8e19ae.js +4 -0
  299. package/lib/esm-es5/index-80be4170.js +4 -0
  300. package/lib/esm-es5/{language-utils-d5c38f65.js → language-utils-344d894c.js} +1 -1
  301. package/lib/esm-es5/loader.js +1 -1
  302. package/lib/esm-es5/shadow-css-13d024f4.js +15 -0
  303. package/lib/esm-es5/token-utils-75f78ca4.js +4 -0
  304. package/lib/esm-es5/tokens-e110dc89.js +4 -0
  305. package/lib/esm-es5/tokens.module-49cbf963.js +4 -0
  306. package/lib/esm-es5/watch-options-dd55bce8.js +4 -0
  307. package/lib/types/common-types.d.ts +0 -1
  308. package/lib/types/components/duet-choice/duet-choice.d.ts +20 -1
  309. package/lib/types/components/duet-collapsible/duet-collapsible.d.ts +3 -0
  310. package/lib/types/components/duet-date-picker/duet-date-picker.d.ts +5 -5
  311. package/lib/types/components/duet-editable-table/duet-editable-table-button.d.ts +73 -0
  312. package/lib/types/components/duet-editable-table/duet-editable-table-item.d.ts +76 -0
  313. package/lib/types/components/duet-editable-table/duet-editable-table-tabledata.d.ts +8 -0
  314. package/lib/types/components/duet-editable-table/duet-editable-table.d.ts +94 -0
  315. package/lib/types/components/duet-grid/duet-grid.d.ts +17 -2
  316. package/lib/types/components/duet-header/duet-header-dropdown.d.ts +16 -0
  317. package/lib/types/components/duet-header/duet-header-hamburger.d.ts +2 -0
  318. package/lib/types/components/duet-header/duet-header-icon.d.ts +8 -0
  319. package/lib/types/components/duet-header/duet-header.d.ts +41 -4
  320. package/lib/types/components/duet-heading/duet-heading.d.ts +2 -2
  321. package/lib/types/components/duet-link/duet-link.d.ts +3 -0
  322. package/lib/types/components/duet-paragraph/duet-paragraph.d.ts +9 -1
  323. package/lib/types/components/duet-progress/duet-progress.d.ts +64 -0
  324. package/lib/types/components/duet-table/duet-table.d.ts +1 -1
  325. package/lib/types/components/duet-upload/duet-upload.d.ts +408 -0
  326. package/lib/types/components/duet-upload/errorcodes.utils.d.ts +8 -0
  327. package/lib/types/components/duet-upload/mock.helpers.d.ts +2 -0
  328. package/lib/types/components/duet-upload/upload-editable-item-error.d.ts +7 -0
  329. package/lib/types/components/duet-upload/upload-editable-item-inprogres.d.ts +7 -0
  330. package/lib/types/components/duet-upload/upload-editable-item-success.d.ts +8 -0
  331. package/lib/types/components/duet-upload/upload-validators.d.ts +12 -0
  332. package/lib/types/components/duet-upload/upload.helpers.d.ts +1 -0
  333. package/lib/types/components/duet-upload/xhr.helpers.d.ts +18 -0
  334. package/lib/types/components/duet-upload-aria-status/duet-upload-aria-status.d.ts +49 -0
  335. package/lib/types/components.d.ts +835 -29
  336. package/lib/types/stencil-public-runtime.d.ts +6 -4
  337. package/lib/types/utils/js-utils.d.ts +1 -0
  338. package/lib/types/utils/language-utils.d.ts +5 -1
  339. package/lib/types/utils/template-utils.d.ts +13 -0
  340. package/lib/types/utils/token-utils.d.ts +8 -2
  341. package/lib/types/utils/watch-options.d.ts +2 -0
  342. package/package.json +13 -13
  343. package/lib/cjs/duet-table.cjs.entry.js +0 -132
  344. package/lib/cjs/token-utils-13e5d13e.js +0 -30
  345. package/lib/duet/p-0058512b.js +0 -4
  346. package/lib/duet/p-08729381.entry.js +0 -4
  347. package/lib/duet/p-0b00e8d6.system.js +0 -16
  348. package/lib/duet/p-15922601.system.js +0 -4
  349. package/lib/duet/p-194e25ce.system.entry.js +0 -4
  350. package/lib/duet/p-1d87ea02.system.entry.js +0 -4
  351. package/lib/duet/p-2d1e2b23.system.entry.js +0 -4
  352. package/lib/duet/p-322d1c38.js +0 -4
  353. package/lib/duet/p-40d68321.entry.js +0 -4
  354. package/lib/duet/p-418b2ce7.system.js +0 -4
  355. package/lib/duet/p-43e39d98.system.js +0 -4
  356. package/lib/duet/p-4603830b.entry.js +0 -4
  357. package/lib/duet/p-52d7fbec.entry.js +0 -4
  358. package/lib/duet/p-60478325.system.entry.js +0 -4
  359. package/lib/duet/p-64ed7add.entry.js +0 -4
  360. package/lib/duet/p-6a356ab1.system.js +0 -4
  361. package/lib/duet/p-72fd384a.entry.js +0 -4
  362. package/lib/duet/p-753b406c.entry.js +0 -4
  363. package/lib/duet/p-76c00d0c.entry.js +0 -4
  364. package/lib/duet/p-85fe1132.js +0 -4
  365. package/lib/duet/p-8c8e82aa.system.js +0 -4
  366. package/lib/duet/p-9a89ec39.js +0 -4
  367. package/lib/duet/p-a11df1b6.js +0 -15
  368. package/lib/duet/p-a1eccee1.system.entry.js +0 -4
  369. package/lib/duet/p-ade33230.entry.js +0 -4
  370. package/lib/duet/p-b04d738f.system.entry.js +0 -4
  371. package/lib/duet/p-cb827bb7.entry.js +0 -4
  372. package/lib/duet/p-d85fba2c.system.entry.js +0 -4
  373. package/lib/duet/p-dfa90f8a.system.entry.js +0 -4
  374. package/lib/duet/p-e6b9bd1d.entry.js +0 -4
  375. package/lib/duet/p-ee64d6be.system.entry.js +0 -4
  376. package/lib/duet/p-f113671b.system.entry.js +0 -4
  377. package/lib/duet/p-f2f04396.entry.js +0 -4
  378. package/lib/duet/p-fc6624fe.system.entry.js +0 -4
  379. package/lib/esm/duet-table.entry.js +0 -128
  380. package/lib/esm/token-utils-5a35377f.js +0 -28
  381. package/lib/esm/watch-options-de55ea78.js +0 -35
  382. package/lib/esm-es5/duet-table.entry.js +0 -4
  383. package/lib/esm-es5/focus-utils-6a282066.js +0 -4
  384. package/lib/esm-es5/index-3a265449.js +0 -4
  385. package/lib/esm-es5/shadow-css-9178c864.js +0 -15
  386. package/lib/esm-es5/token-utils-5a35377f.js +0 -4
  387. package/lib/esm-es5/tokens.module-edb66c04.js +0 -4
  388. package/lib/esm-es5/watch-options-de55ea78.js +0 -4
@@ -0,0 +1,1885 @@
1
+ /*!
2
+ * Built with Duet Design System
3
+ */
4
+ import { Component, Element, Event, h, Host, Method, Prop, State, Watch } from "@stencil/core";
5
+ import { createID } from "../../utils/create-id";
6
+ import { debounce } from "../../utils/js-utils";
7
+ import { getLocaleString, sanitizeString } from "../../utils/language-utils";
8
+ import { inheritGlobalTheme } from "../../utils/themeable-component";
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";
14
+ import { makeXhrRequest } from "./xhr.helpers";
15
+ /**
16
+ * @slot header - named slot - to place content after description / caption
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)
19
+ */
20
+ export class DuetUpload {
21
+ constructor() {
22
+ /**
23
+ * Own Properties
24
+ */
25
+ this.buttonId = createID("DuetButton");
26
+ this.labelId = createID("DuetLabel");
27
+ this.uploadId = createID("DuetUpload");
28
+ this.editableTableId = createID("DuetEditableTable");
29
+ this.filesInProgress = new Map();
30
+ this.fileMaxReached = false;
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
+ };
41
+ /**
42
+ * State() variables
43
+ */
44
+ this.tick = Date.now();
45
+ /**
46
+ * If external is set to true, the upload component will not actually upload the files, but only keep states
47
+ * it will be up to you to handle the upload and return progress information to the upload-component
48
+ */
49
+ this.external = false;
50
+ /**
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: "primary-dark",
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: "primary-dark",
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
+ }
160
+ */
161
+ this.buttonLabelDefaults = {
162
+ fi: "Lisää liite",
163
+ sv: "Lägg till en bilaga",
164
+ en: "Add an attachment",
165
+ };
166
+ /**
167
+ * Label of button
168
+ * @default { fi: "Lisää liite", sv: "Lägg till en bilaga", en: "Add an attachment" }
169
+ */
170
+ this.buttonLabel = getLocaleString(this.buttonLabelDefaults);
171
+ /**
172
+ * accessible aria-Label of button
173
+ */
174
+ this.accessibleButtonLabel = undefined;
175
+ /**
176
+ * Theme of the input.
177
+ */
178
+ this.theme = "";
179
+ /**
180
+ * Makes the input component disabled. This prevents users from being able to
181
+ * interact with the upload component, and conveys its inactive state to assistive technologies.
182
+ */
183
+ this.disabled = false;
184
+ /**
185
+ * Controls the margin of the component.
186
+ */
187
+ this.margin = "auto";
188
+ /**
189
+ * Set whether the input is required or not. Please note that this is necessary for
190
+ * accessible inputs when the user is required to fill them. When using this property
191
+ * you need to also set “novalidate” attribute to your form element to prevent
192
+ * browser from displaying its own validation errors.
193
+ */
194
+ this.required = false;
195
+ /**
196
+ * Key used to set vertical alignment of action buttons
197
+ */
198
+ this.alignment = "middle";
199
+ /**
200
+ * Visually hides the groups labels in the editable table list used to display the list of files
201
+ */
202
+ this.hideGroups = false;
203
+ /**
204
+ * Map of string that contain list of uploaded files.
205
+ */
206
+ this.files = new Map();
207
+ /**
208
+ * Property to read if the internally used editable-table contains errors or not
209
+ */
210
+ this.valid = !this.required;
211
+ /**
212
+ * Property to change labelDefaults defaults on the component.
213
+ * normally you would handle these strings on an application level and override @label when needed
214
+ * @default { fi: "Lisää liite",sv: "Lägg till en bilaga",en: "Add attachments"}
215
+ */
216
+ this.labelDefaults = {
217
+ fi: "Lisää liite",
218
+ sv: "Lägg till en bilaga",
219
+ en: "Add attachments",
220
+ };
221
+ /**
222
+ * Label for the input.
223
+ * @default { fi: "Lisää liite",sv: "Lägg till en bilaga",en: "Add attachments"}
224
+ */
225
+ this.label = getLocaleString(this.labelDefaults);
226
+ /**
227
+ * Property to change descriptionDefaults defaults on the component.
228
+ * @default {
229
+ 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.",
230
+ 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.",
231
+ 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.",
232
+ }
233
+ */
234
+ this.descriptionDefaults = {
235
+ 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.",
236
+ 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.",
237
+ 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.",
238
+ };
239
+ /**
240
+ * Description for the upload component.
241
+ * @default {
242
+ 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.",
243
+ 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.",
244
+ 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.",
245
+ }
246
+ */
247
+ this.description = getLocaleString(this.descriptionDefaults);
248
+ /**
249
+ * Defaults for the filelist's empty state.
250
+ * @default {
251
+ fi: "Ei vielä lisättyjä tiedostoja.",
252
+ sv: "Inga filer har lagts till ännu.",
253
+ en: "No files added yet.",
254
+ }
255
+ */
256
+ this.fileListEmptyDefaults = {
257
+ fi: "Ei vielä lisättyjä tiedostoja.",
258
+ sv: "Inga filer har lagts till ännu.",
259
+ en: "No files added yet.",
260
+ };
261
+ /**
262
+ * Label for the filelist's empty state.
263
+ * @default { fi: "Ei vielä lisättyjä tiedostoja.",sv: "Inga filer har lagts till ännu.",en: "No files added yet."}
264
+ */
265
+ this.fileListEmpty = getLocaleString(this.fileListEmptyDefaults);
266
+ /**
267
+ * Display the input in error state along with an error message.
268
+ */
269
+ this.error = "";
270
+ /**
271
+ * Use maxBytes to specify the maximum size in Bytes of a file that can be uploaded.
272
+ */
273
+ this.maxBytes = 200000000;
274
+ /**
275
+ * Use maxBytesTotal to specify the maximum size in Bytes of All files combined that can be uploaded.
276
+ */
277
+ this.maxBytesTotal = undefined;
278
+ /**
279
+ * Use maxFiles to specify the maximum amount of files that can be uploaded
280
+ */
281
+ this.maxFiles = 99;
282
+ /**
283
+ * A string of commaseperated file type values that are allowed
284
+ * @example: .pdf,.doc,.docx
285
+ */
286
+ this.allowedExtensions = "all";
287
+ /**
288
+ * A string of commaseperated mime type values that are allowed
289
+ * @example: image/*,application/msword,
290
+ */
291
+ this.allowedMimetypes = "*";
292
+ /**
293
+ * Use multiple to allow the user to select multiple files when uploading
294
+ */
295
+ this.multiple = true;
296
+ /**
297
+ * Use limitSelection to enforce the value in allowedExtension & allowedMimetypes when selecting files,
298
+ * by default this is off, setting this to true will limit the users choices to what has been explicitly set
299
+ */
300
+ this.limitSelection = false;
301
+ /**
302
+ * Private functions
303
+ */
304
+ this.listenForActionEvents = () => {
305
+ this.element.addEventListener("duetEditableItemAction", (e) => {
306
+ const detail = e.detail;
307
+ const { action, keyName, originalEvent } = detail;
308
+ switch (action) {
309
+ case "delete":
310
+ this.onDelete(keyName, originalEvent);
311
+ break;
312
+ case "cancel":
313
+ this.onCancel(keyName, originalEvent);
314
+ break;
315
+ default:
316
+ // code block
317
+ }
318
+ });
319
+ };
320
+ this.verifyValidity = () => {
321
+ const { invalid, valid } = this.getFilesAsArray();
322
+ const oldValid = this.valid;
323
+ this.valid = invalid.length === 0 && valid.length !== 0;
324
+ if (this.valid !== oldValid) {
325
+ this.duetState.emit({
326
+ originalEvent: undefined,
327
+ data: { valid: this.valid, from: "componentWillRender" },
328
+ component: "duet-upload",
329
+ });
330
+ }
331
+ };
332
+ this.getGroupFromItemData = (item) => {
333
+ if (item.valid && item.progress === 100) {
334
+ // if the item has a group, move the file to that group instead
335
+ // of into the standard success group
336
+ if (item.group) {
337
+ return item.group;
338
+ }
339
+ return this.DefaultGroups.success;
340
+ }
341
+ else if (item.progress > 0 && item.progress !== 100) {
342
+ return this.DefaultGroups.inprogress;
343
+ }
344
+ else if (!item.valid) {
345
+ return this.DefaultGroups.failure;
346
+ }
347
+ else if (item.group) {
348
+ return item.group;
349
+ }
350
+ else {
351
+ return "none";
352
+ }
353
+ };
354
+ this.getItemHTMLFromItemData = (data, group) => {
355
+ if (group === this.DefaultGroups.success) {
356
+ return h(SuccessItem, { data: data, showLinks: this.showLinks });
357
+ }
358
+ else if (group === this.DefaultGroups.inprogress) {
359
+ return h(ProgressItem, { progress: data.progress, name: data.item.name });
360
+ }
361
+ else if (group === this.DefaultGroups.failure) {
362
+ return h(ErrorItem, { data: data });
363
+ }
364
+ else if (data.group) {
365
+ return data.html;
366
+ }
367
+ else {
368
+ return "none";
369
+ }
370
+ };
371
+ this.convertToDuetEditableTableItems = () => {
372
+ // we're always recreating the map - in order to force an update down stream.
373
+ const itemData = new Map();
374
+ //walk the files Map and convert to DuetEditableTableItemData
375
+ this.files.forEach((data, key, _originalMap) => {
376
+ const group = this.getGroupFromItemData(data);
377
+ const item = this.getItemHTMLFromItemData(data, group);
378
+ itemData.set(key, {
379
+ uid: data.uid,
380
+ item,
381
+ group,
382
+ });
383
+ });
384
+ return itemData;
385
+ };
386
+ this.kick = debounce(() => {
387
+ this.tick = Date.now();
388
+ }, 30); // will trigger re-render
389
+ this.genHashName = () => Date.now().toString(36) + Math.random();
390
+ this.updateValueInMap = (item, key, value, kick = true) => {
391
+ const fileItem = this.files.get(item);
392
+ fileItem[key] = value;
393
+ this.files.set(item, fileItem);
394
+ if (kick) {
395
+ this.kick();
396
+ }
397
+ };
398
+ this.updateProgress = (ev, name) => {
399
+ const updateProgressHelper = percentComplete => {
400
+ this.updateValueInMap(name, "progress", percentComplete);
401
+ this.onProgress(name, percentComplete, ev);
402
+ };
403
+ if (ev.lengthComputable) {
404
+ const percentComplete = (ev.loaded / ev.total) * 100;
405
+ updateProgressHelper(percentComplete);
406
+ }
407
+ else {
408
+ console.log("cant read progress");
409
+ }
410
+ };
411
+ this.trackProgress = (name, remove = false) => {
412
+ if (remove) {
413
+ this.filesInProgress.delete(name);
414
+ }
415
+ else {
416
+ this.filesInProgress.set(name, "inprogress");
417
+ }
418
+ if (this.filesInProgress.size === 0) {
419
+ this.onDone();
420
+ }
421
+ };
422
+ this.getFilesAsArray = () => {
423
+ const filesInQueue = [];
424
+ const filesInError = [];
425
+ this.files.forEach(value => {
426
+ if (value.valid && !value.deleted) {
427
+ filesInQueue.push(value);
428
+ }
429
+ else if (!value.valid && !value.deleted) {
430
+ filesInError.push(value);
431
+ }
432
+ });
433
+ return { valid: filesInQueue, invalid: filesInError };
434
+ };
435
+ this.resetFormFields = () => {
436
+ /**
437
+ * You cannot modify a FileList, nor remove single items from it
438
+ * This completely removes all items in the FileList
439
+ * We reset the form fields to always be able to re-upload files
440
+ * and because we handle all uploads and states internally in the component (not relying on native form elements)
441
+ */
442
+ /* TODO: it may be a good idea to just update the list so that this always matches what is in the files map,
443
+ * 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
444
+ * TODO: but for now we'll just reset the form fields
445
+ */
446
+ this.nativeInput.value = "";
447
+ };
448
+ this.startUpload = async (ev, metaData = undefined) => {
449
+ await this.setFocus();
450
+ this.metaData = metaData;
451
+ this.nativeInput.click();
452
+ this.onUpload(ev, metaData);
453
+ ev.stopPropagation();
454
+ ev.preventDefault();
455
+ return;
456
+ };
457
+ /**
458
+ * Eventlisteners for the XHR requests
459
+ */
460
+ this.transferComplete = name => {
461
+ this.updateValueInMap(name, "progress", 100, false);
462
+ this.trackProgress(name, true);
463
+ };
464
+ this.transferDone = (xhr, name, status) => {
465
+ this.updateValueInMap(name, "status", status, false);
466
+ this.updateValueInMap(name, "uploaded", true, false);
467
+ try {
468
+ const response = JSON.parse(xhr.response);
469
+ this.updateValueInMap(name, "url", response.url);
470
+ }
471
+ catch (e) {
472
+ this.updateValueInMap(name, "url", null);
473
+ console.error("Server did not respond with expected response {url: string}");
474
+ }
475
+ return;
476
+ };
477
+ this.transferDoneWithFailure = (xhr, name, status) => {
478
+ try {
479
+ const { error } = JSON.parse(xhr.response);
480
+ this.updateValueInMap(name, "error", { message: error.message, type: error.type }, false);
481
+ }
482
+ catch (e) {
483
+ console.error("Server did not respond with expected response error:{message: string, type: int}");
484
+ this.updateValueInMap(name, "error", { type: status }, false);
485
+ }
486
+ this.updateValueInMap(name, "valid", false, true);
487
+ };
488
+ this.transferFailed = name => {
489
+ this.updateValueInMap(name, "error", getError("duet-upload-001"));
490
+ };
491
+ this.transferCanceled = name => {
492
+ this.files.delete(name);
493
+ this.validateTotals(name);
494
+ this.kick();
495
+ };
496
+ this.validateTotals = (name) => {
497
+ const isTotalSizeOverMaxSize = validateTotalSizeIsAboveMax(this.files, this.maxBytesTotal);
498
+ const isTotalFileAmountAboveMax = validateTotalAmountIsAboveMax(this.files, this.maxFiles);
499
+ if (isTotalSizeOverMaxSize && name) {
500
+ this.updateValueInMap(name, "error", getError("duet-upload-202"), false);
501
+ }
502
+ if (isTotalFileAmountAboveMax && name) {
503
+ this.updateValueInMap(name, "error", getError("duet-upload-301"), false);
504
+ }
505
+ this.bytesMaxReached = isTotalSizeOverMaxSize;
506
+ this.fileMaxReached = isTotalFileAmountAboveMax;
507
+ return {
508
+ bytesMaxReached: isTotalSizeOverMaxSize,
509
+ fileMaxReached: isTotalFileAmountAboveMax,
510
+ };
511
+ };
512
+ this.onDelete = (key, ev) => {
513
+ const deletedItem = this.files.get(key);
514
+ this.files.delete(key);
515
+ this.validateTotals();
516
+ this.kick();
517
+ this.duetDelete.emit({
518
+ originalEvent: ev,
519
+ data: { deletion: deletedItem },
520
+ component: "duet-upload",
521
+ });
522
+ if (!this.external) {
523
+ this.makeXHRDeleteRequest(deletedItem);
524
+ }
525
+ this.resetFormFields();
526
+ };
527
+ this.onCancel = (key, ev) => {
528
+ const cancelledItem = this.files.get(key);
529
+ this.files.delete(key);
530
+ if (!this.external) {
531
+ const { xhr } = cancelledItem;
532
+ xhr.abort();
533
+ }
534
+ else {
535
+ this.kick();
536
+ }
537
+ this.resetFormFields();
538
+ this.duetCancel.emit({
539
+ originalEvent: ev,
540
+ data: { cancelled: cancelledItem },
541
+ component: "duet-upload",
542
+ });
543
+ };
544
+ this.onUpload = (ev, metaData) => {
545
+ this.duetUpload.emit({
546
+ originalEvent: ev,
547
+ metaData,
548
+ component: "duet-upload",
549
+ });
550
+ };
551
+ this.onBlur = (ev) => {
552
+ this.duetBlur.emit({
553
+ originalEvent: ev,
554
+ component: "duet-upload",
555
+ });
556
+ };
557
+ this.onProgress = (key, percentComplete, ev) => {
558
+ this.duetChange.emit({
559
+ originalEvent: ev,
560
+ data: {
561
+ key,
562
+ percentComplete,
563
+ },
564
+ component: "duet-upload",
565
+ });
566
+ };
567
+ this.onFocus = (ev) => {
568
+ this.duetFocus.emit({
569
+ originalEvent: ev,
570
+ component: "duet-upload",
571
+ });
572
+ };
573
+ this.onDone = () => {
574
+ this.duetDone.emit({
575
+ component: "duet-upload",
576
+ data: { files: this.files },
577
+ });
578
+ };
579
+ }
580
+ watchValidHandler(newValue, oldValue) {
581
+ if (newValue !== oldValue) {
582
+ this.kick();
583
+ }
584
+ }
585
+ /**
586
+ * Component lifecycle events.
587
+ */
588
+ componentWillLoad() {
589
+ if (typeof this.statusMessageLabel === "string") {
590
+ this.internalStatusMessageLabel = sanitizeString(this.groups);
591
+ }
592
+ else {
593
+ this.internalStatusMessageLabel = this.statusMessageLabel;
594
+ }
595
+ inheritGlobalTheme(this);
596
+ this.listenForActionEvents();
597
+ }
598
+ componentWillRender() {
599
+ // listen to the events from the component
600
+ this.verifyValidity();
601
+ }
602
+ /**
603
+ * XHR request utilities
604
+ */
605
+ makeXHRPostRequest(data) {
606
+ const xhr = new XMLHttpRequest();
607
+ const name = data.get("name");
608
+ xhr.upload.addEventListener("progress", ev => {
609
+ this.updateProgress(ev, name);
610
+ });
611
+ xhr.upload.addEventListener("load", () => {
612
+ this.transferComplete(name);
613
+ });
614
+ xhr.upload.addEventListener("error", () => {
615
+ this.transferFailed(name);
616
+ });
617
+ xhr.upload.addEventListener("abort", () => {
618
+ this.transferCanceled(name);
619
+ });
620
+ return makeXhrRequest({
621
+ payload: { data, name },
622
+ options: { type: "POST", uri: this.uri, xhr, argument: null, headers: null },
623
+ onFailure: this.transferDoneWithFailure,
624
+ onSuccess: this.transferDone,
625
+ onProgress: this.trackProgress,
626
+ });
627
+ }
628
+ makeXHRDeleteRequest(data) {
629
+ const { uid, item } = data;
630
+ const xhr = new XMLHttpRequest();
631
+ // don't present server issues to user on deletes, just remove them from the visible list
632
+ return makeXhrRequest({
633
+ payload: { data: null, name },
634
+ options: {
635
+ type: "DELETE",
636
+ xhr,
637
+ uri: this.uri,
638
+ arguments: `?key=${uid}&name=${item.name}`,
639
+ headers: {
640
+ "x-fileuid": uid,
641
+ "x-filename": item.name,
642
+ },
643
+ },
644
+ onFailure: this.transferDoneWithFailure,
645
+ onSuccess: this.transferDone,
646
+ onProgress: this.trackProgress,
647
+ });
648
+ }
649
+ /**
650
+ * Component event handling.
651
+ */
652
+ async onChange(ev) {
653
+ var _a;
654
+ const selectedFiles = Array.from((_a = this.nativeInput) === null || _a === void 0 ? void 0 : _a.files);
655
+ // FileList is a nice array like structure but
656
+ // to ensure uniqueness of files we use a mapping structure and
657
+ // key to the name (makes it easier to delete as well)
658
+ if (selectedFiles) {
659
+ for (const item of selectedFiles) {
660
+ const { valid, errorMessage, errorType, errorSystem } = validateFile(item, {
661
+ maxBytes: this.maxBytes,
662
+ allowedExtensions: this.allowedExtensions,
663
+ allowedMimetypes: this.allowedMimetypes,
664
+ });
665
+ const uid = this.genHashName();
666
+ const fileListItem = {
667
+ uid,
668
+ item: item,
669
+ size: item.size,
670
+ meta: this.metaData,
671
+ uploaded: false,
672
+ valid,
673
+ error: {
674
+ type: valid ? undefined : errorType,
675
+ message: valid ? undefined : errorMessage,
676
+ system_message: valid ? undefined : errorSystem,
677
+ },
678
+ progress: 0,
679
+ deleted: false,
680
+ xhr: false,
681
+ url: false,
682
+ };
683
+ this.files.set(item.name, fileListItem);
684
+ // validate that we haven't hit any maxfiles or maxbytes limits before we upload
685
+ const { bytesMaxReached, fileMaxReached } = this.validateTotals(item.name);
686
+ if (bytesMaxReached) {
687
+ // in case one of the global maxes have been reached, invalidate the file
688
+ this.updateValueInMap(item.name, "valid", false, false);
689
+ }
690
+ else if (fileMaxReached) {
691
+ // in case one of the global maxes have been reached, invalidate the file
692
+ this.updateValueInMap(item.name, "valid", false, false);
693
+ }
694
+ else if (valid && !this.external) {
695
+ // if all is well AND external file upload handling has not been set, start upload
696
+ const data = new FormData();
697
+ data.append("file", item);
698
+ data.append("uid", uid);
699
+ data.append("name", item.name);
700
+ data.append("metadata", JSON.stringify({ uid, url: this.uri, size: item.size, meta: fileListItem.meta }));
701
+ try {
702
+ fileListItem.xhr = await this.makeXHRPostRequest(data);
703
+ }
704
+ catch (e) {
705
+ // in case one of the global maxes have been reached, invalidate the file
706
+ this.updateValueInMap(item.name, "valid", false, false);
707
+ }
708
+ }
709
+ // kick the stat to force update
710
+ this.kick();
711
+ }
712
+ }
713
+ // reset the form, so that a user may upload a file again (with the same name)
714
+ this.resetFormFields();
715
+ // reset the internal metaData state
716
+ this.metaData = undefined;
717
+ this.duetChange.emit({
718
+ originalEvent: ev,
719
+ data: { files: this.files },
720
+ component: "duet-upload",
721
+ });
722
+ }
723
+ /**
724
+ * Sets focus on the specified `duet-input`. Use this method instead of the global
725
+ * `input.focus()`.
726
+ */
727
+ async setFocus(options) {
728
+ if (this.nativeInput) {
729
+ this.nativeInput.focus(options);
730
+ }
731
+ return;
732
+ }
733
+ /**
734
+ * Method for invoking the upload sequence
735
+ */
736
+ async upload(metaData = undefined) {
737
+ await this.setFocus();
738
+ this.metaData = metaData;
739
+ this.nativeInput.click();
740
+ return;
741
+ }
742
+ /**
743
+ * Get list of files, divided in errors and valid sections
744
+ */
745
+ async getFiles() {
746
+ if (!this.files || this.files.size === 0) {
747
+ return false;
748
+ }
749
+ return this.getFilesAsArray();
750
+ }
751
+ /**
752
+ * Convenience method for updating the value of a key:value inside an item in the files attribute
753
+ */
754
+ async updateValue(item, key, value) {
755
+ this.updateValueInMap(item, key, value);
756
+ }
757
+ /**
758
+ * render() function
759
+ * Always the last one in the class.
760
+ */
761
+ render() {
762
+ const identifier = this.identifier || this.uploadId;
763
+ let caption = this.description.replace(/{maxfiles}/g, this.maxFiles.toString());
764
+ caption = caption.replace(/{maxbytes}/g, `${Math.floor(this.maxBytes / 1024 / 1024)} MB`);
765
+ caption = caption.replace(/{filetypes}/g, this.allowedExtensions.split(",").join(", "));
766
+ return (h(Host, { class: { "duet-m-0": this.margin === "none" } },
767
+ h("duet-fieldset", { label: this.label, caption: caption },
768
+ h("slot", { name: "header" }),
769
+ !this.files.size && (h("duet-label", { theme: this.theme === "turva" ? "turva" : "default", size: "small", class: {
770
+ "duet-upload-filelist-empty": !this.files.size,
771
+ "duet-upload-filelist": true,
772
+ "duet-upload-filelist-filled": this.files.size,
773
+ }, id: this.labelId, for: identifier }, this.fileListEmpty)),
774
+ !!this.files.size && h("slot", { name: "fileheader" }),
775
+ !!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 })),
776
+ !!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, alignment: this.alignment, items: this.convertToDuetEditableTableItems() })),
777
+ !!this.files.size && h("slot", { name: "filefooter" }),
778
+ h("duet-spacer", { size: "large" }),
779
+ !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)),
780
+ h("duet-spacer", { size: "medium" }),
781
+ (this.fileMaxReached || this.bytesMaxReached) && (h("duet-alert", null,
782
+ this.fileMaxReached && getI18nError("duet-upload-301"),
783
+ this.bytesMaxReached && getI18nError("duet-upload-202"))),
784
+ h("duet-spacer", { size: "medium" }),
785
+ h("duet-visually-hidden", null,
786
+ h("input", { ref: input => {
787
+ this.nativeInput = input;
788
+ }, accept: !this.limitSelection ? undefined : `${this.allowedMimetypes},${this.allowedExtensions}`, onBlur: this.onBlur, onFocus: this.onFocus, onChange: e => this.onChange(e), type: "file", class: {
789
+ "duet-upload": true,
790
+ }, disabled: this.disabled, "aria-hidden": "true", required: this.required, name: this.name, id: this.identifier, multiple: this.multiple, capture: "user" })))));
791
+ }
792
+ static get is() { return "duet-upload"; }
793
+ static get encapsulation() { return "shadow"; }
794
+ static get originalStyleUrls() { return {
795
+ "$": ["duet-upload.scss"]
796
+ }; }
797
+ static get styleUrls() { return {
798
+ "$": ["duet-upload.css"]
799
+ }; }
800
+ static get properties() { return {
801
+ "accessibleActiveDescendant": {
802
+ "type": "string",
803
+ "mutable": false,
804
+ "complexType": {
805
+ "original": "string",
806
+ "resolved": "string",
807
+ "references": {}
808
+ },
809
+ "required": false,
810
+ "optional": false,
811
+ "docs": {
812
+ "tags": [],
813
+ "text": "Indicates the id of a related component\u2019s visually focused element."
814
+ },
815
+ "attribute": "accessible-active-descendant",
816
+ "reflect": false
817
+ },
818
+ "accessibleDescribedBy": {
819
+ "type": "string",
820
+ "mutable": false,
821
+ "complexType": {
822
+ "original": "string",
823
+ "resolved": "string",
824
+ "references": {}
825
+ },
826
+ "required": false,
827
+ "optional": false,
828
+ "docs": {
829
+ "tags": [],
830
+ "text": "Indicates the id of a component that describes the upload component."
831
+ },
832
+ "attribute": "accessible-described-by",
833
+ "reflect": false
834
+ },
835
+ "accessibleControls": {
836
+ "type": "string",
837
+ "mutable": false,
838
+ "complexType": {
839
+ "original": "string",
840
+ "resolved": "string",
841
+ "references": {}
842
+ },
843
+ "required": false,
844
+ "optional": false,
845
+ "docs": {
846
+ "tags": [],
847
+ "text": "Use this prop to add an aria-controls attribute. Use the attribute to\nindicate the id of a component controlled by this component."
848
+ },
849
+ "attribute": "accessible-controls",
850
+ "reflect": false
851
+ },
852
+ "accessibleOwns": {
853
+ "type": "string",
854
+ "mutable": false,
855
+ "complexType": {
856
+ "original": "string",
857
+ "resolved": "string",
858
+ "references": {}
859
+ },
860
+ "required": false,
861
+ "optional": false,
862
+ "docs": {
863
+ "tags": [],
864
+ "text": "Indicates the id of a component owned by the input."
865
+ },
866
+ "attribute": "accessible-owns",
867
+ "reflect": false
868
+ },
869
+ "external": {
870
+ "type": "boolean",
871
+ "mutable": false,
872
+ "complexType": {
873
+ "original": "boolean",
874
+ "resolved": "boolean",
875
+ "references": {}
876
+ },
877
+ "required": false,
878
+ "optional": false,
879
+ "docs": {
880
+ "tags": [],
881
+ "text": "If external is set to true, the upload component will not actually upload the files, but only keep states\nit will be up to you to handle the upload and return progress information to the upload-component"
882
+ },
883
+ "attribute": "external",
884
+ "reflect": false,
885
+ "defaultValue": "false"
886
+ },
887
+ "hideButton": {
888
+ "type": "boolean",
889
+ "mutable": false,
890
+ "complexType": {
891
+ "original": "boolean",
892
+ "resolved": "boolean",
893
+ "references": {}
894
+ },
895
+ "required": false,
896
+ "optional": false,
897
+ "docs": {
898
+ "tags": [],
899
+ "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"
900
+ },
901
+ "attribute": "hide-upload-button",
902
+ "reflect": false,
903
+ "defaultValue": "false"
904
+ },
905
+ "actions": {
906
+ "type": "string",
907
+ "mutable": false,
908
+ "complexType": {
909
+ "original": "DuetEditableTableActions | string",
910
+ "resolved": "string | { icon: string; color: string; color_hover: string; id: string; map?: string[]; label?: DuetLangObject; }[]",
911
+ "references": {
912
+ "DuetEditableTableActions": {
913
+ "location": "import",
914
+ "path": "../duet-editable-table/duet-editable-table-item"
915
+ }
916
+ }
917
+ },
918
+ "required": false,
919
+ "optional": false,
920
+ "docs": {
921
+ "tags": [],
922
+ "text": "Default actions added to the internally used duet-editable-table"
923
+ },
924
+ "attribute": "actions",
925
+ "reflect": false,
926
+ "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 ]"
927
+ },
928
+ "uri": {
929
+ "type": "string",
930
+ "mutable": false,
931
+ "complexType": {
932
+ "original": "string",
933
+ "resolved": "string",
934
+ "references": {}
935
+ },
936
+ "required": false,
937
+ "optional": false,
938
+ "docs": {
939
+ "tags": [],
940
+ "text": "Endpoint URI that is capable of receiving the files"
941
+ },
942
+ "attribute": "uri",
943
+ "reflect": false
944
+ },
945
+ "showLinks": {
946
+ "type": "boolean",
947
+ "mutable": false,
948
+ "complexType": {
949
+ "original": "boolean",
950
+ "resolved": "boolean",
951
+ "references": {}
952
+ },
953
+ "required": false,
954
+ "optional": false,
955
+ "docs": {
956
+ "tags": [],
957
+ "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"
958
+ },
959
+ "attribute": "show-links",
960
+ "reflect": false,
961
+ "defaultValue": "false"
962
+ },
963
+ "caption": {
964
+ "type": "string",
965
+ "mutable": false,
966
+ "complexType": {
967
+ "original": "string",
968
+ "resolved": "string",
969
+ "references": {}
970
+ },
971
+ "required": false,
972
+ "optional": false,
973
+ "docs": {
974
+ "tags": [],
975
+ "text": "Caption (underneath label) that can be set as a way of adding extra information"
976
+ },
977
+ "attribute": "caption",
978
+ "reflect": false
979
+ },
980
+ "statusLabelDefaults": {
981
+ "type": "string",
982
+ "mutable": false,
983
+ "complexType": {
984
+ "original": "DuetLangObject | string",
985
+ "resolved": "DuetLangObject | string",
986
+ "references": {
987
+ "DuetLangObject": {
988
+ "location": "import",
989
+ "path": "../../utils/language-utils"
990
+ }
991
+ }
992
+ },
993
+ "required": false,
994
+ "optional": false,
995
+ "docs": {
996
+ "tags": [{
997
+ "name": "default",
998
+ "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}"
999
+ }],
1000
+ "text": "Property to change the aria upload progress text read aloud by screenreaders"
1001
+ },
1002
+ "attribute": "status-label-default",
1003
+ "reflect": false,
1004
+ "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 }"
1005
+ },
1006
+ "statusMessageLabel": {
1007
+ "type": "string",
1008
+ "mutable": false,
1009
+ "complexType": {
1010
+ "original": "StatusMessage | string",
1011
+ "resolved": "string | { inProgress: string; inProgressWithErrors: string; done: string; doneWithErrors: string; file: string; files: string; }",
1012
+ "references": {
1013
+ "StatusMessage": {
1014
+ "location": "import",
1015
+ "path": "../duet-upload-aria-status/duet-upload-aria-status"
1016
+ }
1017
+ }
1018
+ },
1019
+ "required": false,
1020
+ "optional": false,
1021
+ "docs": {
1022
+ "tags": [],
1023
+ "text": "Strings used for the status aria-label"
1024
+ },
1025
+ "attribute": "status-message-label",
1026
+ "reflect": false,
1027
+ "defaultValue": "getLocaleString(\n this.statusLabelDefaults\n )"
1028
+ },
1029
+ "buttonLabelDefaults": {
1030
+ "type": "string",
1031
+ "mutable": false,
1032
+ "complexType": {
1033
+ "original": "DuetLangObject | string",
1034
+ "resolved": "DuetLangObject | string",
1035
+ "references": {
1036
+ "DuetLangObject": {
1037
+ "location": "import",
1038
+ "path": "../../utils/language-utils"
1039
+ }
1040
+ }
1041
+ },
1042
+ "required": false,
1043
+ "optional": false,
1044
+ "docs": {
1045
+ "tags": [{
1046
+ "name": "default",
1047
+ "text": "{\nfi: \"Lis\u00E4\u00E4 liite\",\nsv: \"L\u00E4gg till en bilaga\",\nen: \"Add an attachment\",\n}"
1048
+ }],
1049
+ "text": "Property to change button label defaults on the component."
1050
+ },
1051
+ "attribute": "button-label-default",
1052
+ "reflect": false,
1053
+ "defaultValue": "{\n fi: \"Lis\u00E4\u00E4 liite\",\n sv: \"L\u00E4gg till en bilaga\",\n en: \"Add an attachment\",\n }"
1054
+ },
1055
+ "buttonLabel": {
1056
+ "type": "string",
1057
+ "mutable": false,
1058
+ "complexType": {
1059
+ "original": "string",
1060
+ "resolved": "string",
1061
+ "references": {}
1062
+ },
1063
+ "required": false,
1064
+ "optional": false,
1065
+ "docs": {
1066
+ "tags": [{
1067
+ "name": "default",
1068
+ "text": "{ fi: \"Lis\u00E4\u00E4 liite\", sv: \"L\u00E4gg till en bilaga\", en: \"Add an attachment\" }"
1069
+ }],
1070
+ "text": "Label of button"
1071
+ },
1072
+ "attribute": "button-label",
1073
+ "reflect": false,
1074
+ "defaultValue": "getLocaleString(this.buttonLabelDefaults)"
1075
+ },
1076
+ "accessibleButtonLabel": {
1077
+ "type": "string",
1078
+ "mutable": false,
1079
+ "complexType": {
1080
+ "original": "string",
1081
+ "resolved": "string",
1082
+ "references": {}
1083
+ },
1084
+ "required": false,
1085
+ "optional": false,
1086
+ "docs": {
1087
+ "tags": [],
1088
+ "text": "accessible aria-Label of button"
1089
+ },
1090
+ "attribute": "accessible-button-label",
1091
+ "reflect": false,
1092
+ "defaultValue": "undefined"
1093
+ },
1094
+ "theme": {
1095
+ "type": "string",
1096
+ "mutable": true,
1097
+ "complexType": {
1098
+ "original": "DuetTheme",
1099
+ "resolved": "\"\" | \"default\" | \"turva\"",
1100
+ "references": {
1101
+ "DuetTheme": {
1102
+ "location": "import",
1103
+ "path": "../../common-types"
1104
+ }
1105
+ }
1106
+ },
1107
+ "required": false,
1108
+ "optional": false,
1109
+ "docs": {
1110
+ "tags": [],
1111
+ "text": "Theme of the input."
1112
+ },
1113
+ "attribute": "theme",
1114
+ "reflect": false,
1115
+ "defaultValue": "\"\""
1116
+ },
1117
+ "disabled": {
1118
+ "type": "boolean",
1119
+ "mutable": false,
1120
+ "complexType": {
1121
+ "original": "boolean",
1122
+ "resolved": "boolean",
1123
+ "references": {}
1124
+ },
1125
+ "required": false,
1126
+ "optional": false,
1127
+ "docs": {
1128
+ "tags": [],
1129
+ "text": "Makes the input component disabled. This prevents users from being able to\ninteract with the upload component, and conveys its inactive state to assistive technologies."
1130
+ },
1131
+ "attribute": "disabled",
1132
+ "reflect": true,
1133
+ "defaultValue": "false"
1134
+ },
1135
+ "identifier": {
1136
+ "type": "string",
1137
+ "mutable": false,
1138
+ "complexType": {
1139
+ "original": "string",
1140
+ "resolved": "string",
1141
+ "references": {}
1142
+ },
1143
+ "required": false,
1144
+ "optional": false,
1145
+ "docs": {
1146
+ "tags": [],
1147
+ "text": "Adds a unique identifier for the upload component."
1148
+ },
1149
+ "attribute": "identifier",
1150
+ "reflect": false
1151
+ },
1152
+ "margin": {
1153
+ "type": "string",
1154
+ "mutable": false,
1155
+ "complexType": {
1156
+ "original": "DuetMargin",
1157
+ "resolved": "\"auto\" | \"none\"",
1158
+ "references": {
1159
+ "DuetMargin": {
1160
+ "location": "import",
1161
+ "path": "../../common-types"
1162
+ }
1163
+ }
1164
+ },
1165
+ "required": false,
1166
+ "optional": false,
1167
+ "docs": {
1168
+ "tags": [],
1169
+ "text": "Controls the margin of the component."
1170
+ },
1171
+ "attribute": "margin",
1172
+ "reflect": false,
1173
+ "defaultValue": "\"auto\""
1174
+ },
1175
+ "required": {
1176
+ "type": "boolean",
1177
+ "mutable": false,
1178
+ "complexType": {
1179
+ "original": "boolean",
1180
+ "resolved": "boolean",
1181
+ "references": {}
1182
+ },
1183
+ "required": false,
1184
+ "optional": false,
1185
+ "docs": {
1186
+ "tags": [],
1187
+ "text": "Set whether the input is required or not. Please note that this is necessary for\naccessible inputs when the user is required to fill them. When using this property\nyou need to also set \u201Cnovalidate\u201D attribute to your form element to prevent\nbrowser from displaying its own validation errors."
1188
+ },
1189
+ "attribute": "required",
1190
+ "reflect": false,
1191
+ "defaultValue": "false"
1192
+ },
1193
+ "groups": {
1194
+ "type": "string",
1195
+ "mutable": false,
1196
+ "complexType": {
1197
+ "original": "DuetEditableTableGroupNames | string",
1198
+ "resolved": "string | { id: string; label: DuetLangObject; actionLabel?: DuetLangObject; }[]",
1199
+ "references": {
1200
+ "DuetEditableTableGroupNames": {
1201
+ "location": "import",
1202
+ "path": "../duet-editable-table/duet-editable-table"
1203
+ }
1204
+ }
1205
+ },
1206
+ "required": false,
1207
+ "optional": false,
1208
+ "docs": {
1209
+ "tags": [{
1210
+ "name": "required",
1211
+ "text": undefined
1212
+ }, {
1213
+ "name": "example",
1214
+ "text": "[{ id: \"success\", label: {fi: \"Onnistunut\", en: \"Success\", sv: \"Alt klart\", }}]"
1215
+ }],
1216
+ "text": "Array of group names that you want the editable table to use to display files"
1217
+ },
1218
+ "attribute": "groups",
1219
+ "reflect": false
1220
+ },
1221
+ "alignment": {
1222
+ "type": "string",
1223
+ "mutable": false,
1224
+ "complexType": {
1225
+ "original": "string",
1226
+ "resolved": "string",
1227
+ "references": {}
1228
+ },
1229
+ "required": false,
1230
+ "optional": false,
1231
+ "docs": {
1232
+ "tags": [],
1233
+ "text": "Key used to set vertical alignment of action buttons"
1234
+ },
1235
+ "attribute": "alignment",
1236
+ "reflect": false,
1237
+ "defaultValue": "\"middle\""
1238
+ },
1239
+ "hideGroups": {
1240
+ "type": "boolean",
1241
+ "mutable": false,
1242
+ "complexType": {
1243
+ "original": "boolean",
1244
+ "resolved": "boolean",
1245
+ "references": {}
1246
+ },
1247
+ "required": false,
1248
+ "optional": false,
1249
+ "docs": {
1250
+ "tags": [],
1251
+ "text": "Visually hides the groups labels in the editable table list used to display the list of files"
1252
+ },
1253
+ "attribute": "hide-table-labels",
1254
+ "reflect": false,
1255
+ "defaultValue": "false"
1256
+ },
1257
+ "files": {
1258
+ "type": "unknown",
1259
+ "mutable": true,
1260
+ "complexType": {
1261
+ "original": "StringMap",
1262
+ "resolved": "StringMap",
1263
+ "references": {
1264
+ "StringMap": {
1265
+ "location": "local"
1266
+ }
1267
+ }
1268
+ },
1269
+ "required": false,
1270
+ "optional": false,
1271
+ "docs": {
1272
+ "tags": [],
1273
+ "text": "Map of string that contain list of uploaded files."
1274
+ },
1275
+ "defaultValue": "new Map()"
1276
+ },
1277
+ "valid": {
1278
+ "type": "boolean",
1279
+ "mutable": true,
1280
+ "complexType": {
1281
+ "original": "boolean",
1282
+ "resolved": "boolean",
1283
+ "references": {}
1284
+ },
1285
+ "required": false,
1286
+ "optional": false,
1287
+ "docs": {
1288
+ "tags": [],
1289
+ "text": "Property to read if the internally used editable-table contains errors or not"
1290
+ },
1291
+ "attribute": "valid",
1292
+ "reflect": true,
1293
+ "defaultValue": "!this.required"
1294
+ },
1295
+ "labelDefaults": {
1296
+ "type": "string",
1297
+ "mutable": false,
1298
+ "complexType": {
1299
+ "original": "DuetLangObject | string",
1300
+ "resolved": "DuetLangObject | string",
1301
+ "references": {
1302
+ "DuetLangObject": {
1303
+ "location": "import",
1304
+ "path": "../../utils/language-utils"
1305
+ }
1306
+ }
1307
+ },
1308
+ "required": false,
1309
+ "optional": false,
1310
+ "docs": {
1311
+ "tags": [{
1312
+ "name": "default",
1313
+ "text": "{ fi: \"Lis\u00E4\u00E4 liite\",sv: \"L\u00E4gg till en bilaga\",en: \"Add attachments\"}"
1314
+ }],
1315
+ "text": "Property to change labelDefaults defaults on the component.\nnormally you would handle these strings on an application level and override @label when needed"
1316
+ },
1317
+ "attribute": "label-default",
1318
+ "reflect": false,
1319
+ "defaultValue": "{\n fi: \"Lis\u00E4\u00E4 liite\",\n sv: \"L\u00E4gg till en bilaga\",\n en: \"Add attachments\",\n }"
1320
+ },
1321
+ "label": {
1322
+ "type": "string",
1323
+ "mutable": false,
1324
+ "complexType": {
1325
+ "original": "string",
1326
+ "resolved": "string",
1327
+ "references": {}
1328
+ },
1329
+ "required": false,
1330
+ "optional": false,
1331
+ "docs": {
1332
+ "tags": [{
1333
+ "name": "default",
1334
+ "text": "{ fi: \"Lis\u00E4\u00E4 liite\",sv: \"L\u00E4gg till en bilaga\",en: \"Add attachments\"}"
1335
+ }],
1336
+ "text": "Label for the input."
1337
+ },
1338
+ "attribute": "label",
1339
+ "reflect": false,
1340
+ "defaultValue": "getLocaleString(this.labelDefaults)"
1341
+ },
1342
+ "descriptionDefaults": {
1343
+ "type": "string",
1344
+ "mutable": false,
1345
+ "complexType": {
1346
+ "original": "DuetLangObject | string",
1347
+ "resolved": "DuetLangObject | string",
1348
+ "references": {
1349
+ "DuetLangObject": {
1350
+ "location": "import",
1351
+ "path": "../../utils/language-utils"
1352
+ }
1353
+ }
1354
+ },
1355
+ "required": false,
1356
+ "optional": false,
1357
+ "docs": {
1358
+ "tags": [{
1359
+ "name": "default",
1360
+ "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}"
1361
+ }],
1362
+ "text": "Property to change descriptionDefaults defaults on the component."
1363
+ },
1364
+ "attribute": "description-default",
1365
+ "reflect": false,
1366
+ "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 }"
1367
+ },
1368
+ "description": {
1369
+ "type": "string",
1370
+ "mutable": false,
1371
+ "complexType": {
1372
+ "original": "string",
1373
+ "resolved": "string",
1374
+ "references": {}
1375
+ },
1376
+ "required": false,
1377
+ "optional": false,
1378
+ "docs": {
1379
+ "tags": [{
1380
+ "name": "default",
1381
+ "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}"
1382
+ }],
1383
+ "text": "Description for the upload component."
1384
+ },
1385
+ "attribute": "description",
1386
+ "reflect": false,
1387
+ "defaultValue": "getLocaleString(this.descriptionDefaults)"
1388
+ },
1389
+ "fileListEmptyDefaults": {
1390
+ "type": "string",
1391
+ "mutable": false,
1392
+ "complexType": {
1393
+ "original": "DuetLangObject | string",
1394
+ "resolved": "DuetLangObject | string",
1395
+ "references": {
1396
+ "DuetLangObject": {
1397
+ "location": "import",
1398
+ "path": "../../utils/language-utils"
1399
+ }
1400
+ }
1401
+ },
1402
+ "required": false,
1403
+ "optional": false,
1404
+ "docs": {
1405
+ "tags": [{
1406
+ "name": "default",
1407
+ "text": "{\nfi: \"Ei viel\u00E4 lis\u00E4ttyj\u00E4 tiedostoja.\",\nsv: \"Inga filer har lagts till \u00E4nnu.\",\nen: \"No files added yet.\",\n}"
1408
+ }],
1409
+ "text": "Defaults for the filelist's empty state."
1410
+ },
1411
+ "attribute": "list-empty-default",
1412
+ "reflect": false,
1413
+ "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 }"
1414
+ },
1415
+ "fileListEmpty": {
1416
+ "type": "string",
1417
+ "mutable": false,
1418
+ "complexType": {
1419
+ "original": "string",
1420
+ "resolved": "string",
1421
+ "references": {}
1422
+ },
1423
+ "required": false,
1424
+ "optional": false,
1425
+ "docs": {
1426
+ "tags": [{
1427
+ "name": "default",
1428
+ "text": "{ fi: \"Ei viel\u00E4 lis\u00E4ttyj\u00E4 tiedostoja.\",sv: \"Inga filer har lagts till \u00E4nnu.\",en: \"No files added yet.\"}"
1429
+ }],
1430
+ "text": "Label for the filelist's empty state."
1431
+ },
1432
+ "attribute": "file-list-empty",
1433
+ "reflect": false,
1434
+ "defaultValue": "getLocaleString(this.fileListEmptyDefaults)"
1435
+ },
1436
+ "error": {
1437
+ "type": "string",
1438
+ "mutable": false,
1439
+ "complexType": {
1440
+ "original": "string",
1441
+ "resolved": "string",
1442
+ "references": {}
1443
+ },
1444
+ "required": false,
1445
+ "optional": false,
1446
+ "docs": {
1447
+ "tags": [],
1448
+ "text": "Display the input in error state along with an error message."
1449
+ },
1450
+ "attribute": "error",
1451
+ "reflect": false,
1452
+ "defaultValue": "\"\""
1453
+ },
1454
+ "name": {
1455
+ "type": "string",
1456
+ "mutable": false,
1457
+ "complexType": {
1458
+ "original": "string",
1459
+ "resolved": "string",
1460
+ "references": {}
1461
+ },
1462
+ "required": false,
1463
+ "optional": false,
1464
+ "docs": {
1465
+ "tags": [],
1466
+ "text": "Name of the upload component."
1467
+ },
1468
+ "attribute": "name",
1469
+ "reflect": false
1470
+ },
1471
+ "maxBytes": {
1472
+ "type": "number",
1473
+ "mutable": false,
1474
+ "complexType": {
1475
+ "original": "number",
1476
+ "resolved": "number",
1477
+ "references": {}
1478
+ },
1479
+ "required": false,
1480
+ "optional": false,
1481
+ "docs": {
1482
+ "tags": [],
1483
+ "text": "Use maxBytes to specify the maximum size in Bytes of a file that can be uploaded."
1484
+ },
1485
+ "attribute": "max-bytes",
1486
+ "reflect": false,
1487
+ "defaultValue": "200000000"
1488
+ },
1489
+ "maxBytesTotal": {
1490
+ "type": "number",
1491
+ "mutable": false,
1492
+ "complexType": {
1493
+ "original": "number",
1494
+ "resolved": "number",
1495
+ "references": {}
1496
+ },
1497
+ "required": false,
1498
+ "optional": false,
1499
+ "docs": {
1500
+ "tags": [],
1501
+ "text": "Use maxBytesTotal to specify the maximum size in Bytes of All files combined that can be uploaded."
1502
+ },
1503
+ "attribute": "max-bytes-total",
1504
+ "reflect": false,
1505
+ "defaultValue": "undefined"
1506
+ },
1507
+ "maxFiles": {
1508
+ "type": "number",
1509
+ "mutable": false,
1510
+ "complexType": {
1511
+ "original": "number",
1512
+ "resolved": "number",
1513
+ "references": {}
1514
+ },
1515
+ "required": false,
1516
+ "optional": false,
1517
+ "docs": {
1518
+ "tags": [],
1519
+ "text": "Use maxFiles to specify the maximum amount of files that can be uploaded"
1520
+ },
1521
+ "attribute": "max-files",
1522
+ "reflect": false,
1523
+ "defaultValue": "99"
1524
+ },
1525
+ "allowedExtensions": {
1526
+ "type": "string",
1527
+ "mutable": false,
1528
+ "complexType": {
1529
+ "original": "string",
1530
+ "resolved": "string",
1531
+ "references": {}
1532
+ },
1533
+ "required": false,
1534
+ "optional": false,
1535
+ "docs": {
1536
+ "tags": [{
1537
+ "name": "example",
1538
+ "text": ": .pdf,.doc,.docx"
1539
+ }],
1540
+ "text": "A string of commaseperated file type values that are allowed"
1541
+ },
1542
+ "attribute": "allowed-extensions",
1543
+ "reflect": false,
1544
+ "defaultValue": "\"all\""
1545
+ },
1546
+ "allowedMimetypes": {
1547
+ "type": "string",
1548
+ "mutable": false,
1549
+ "complexType": {
1550
+ "original": "string",
1551
+ "resolved": "string",
1552
+ "references": {}
1553
+ },
1554
+ "required": false,
1555
+ "optional": false,
1556
+ "docs": {
1557
+ "tags": [{
1558
+ "name": "example",
1559
+ "text": ": image/*,application/msword,"
1560
+ }],
1561
+ "text": "A string of commaseperated mime type values that are allowed"
1562
+ },
1563
+ "attribute": "allowed-mimetypes",
1564
+ "reflect": false,
1565
+ "defaultValue": "\"*\""
1566
+ },
1567
+ "multiple": {
1568
+ "type": "boolean",
1569
+ "mutable": false,
1570
+ "complexType": {
1571
+ "original": "boolean",
1572
+ "resolved": "boolean",
1573
+ "references": {}
1574
+ },
1575
+ "required": false,
1576
+ "optional": false,
1577
+ "docs": {
1578
+ "tags": [],
1579
+ "text": "Use multiple to allow the user to select multiple files when uploading"
1580
+ },
1581
+ "attribute": "multiple",
1582
+ "reflect": false,
1583
+ "defaultValue": "true"
1584
+ },
1585
+ "limitSelection": {
1586
+ "type": "boolean",
1587
+ "mutable": false,
1588
+ "complexType": {
1589
+ "original": "boolean",
1590
+ "resolved": "boolean",
1591
+ "references": {}
1592
+ },
1593
+ "required": false,
1594
+ "optional": false,
1595
+ "docs": {
1596
+ "tags": [],
1597
+ "text": "Use limitSelection to enforce the value in allowedExtension & allowedMimetypes when selecting files,\nby default this is off, setting this to true will limit the users choices to what has been explicitly set"
1598
+ },
1599
+ "attribute": "limit-selection",
1600
+ "reflect": false,
1601
+ "defaultValue": "false"
1602
+ },
1603
+ "value": {
1604
+ "type": "string",
1605
+ "mutable": true,
1606
+ "complexType": {
1607
+ "original": "string",
1608
+ "resolved": "string",
1609
+ "references": {}
1610
+ },
1611
+ "required": false,
1612
+ "optional": false,
1613
+ "docs": {
1614
+ "tags": [],
1615
+ "text": "Value of the input."
1616
+ },
1617
+ "attribute": "value",
1618
+ "reflect": false
1619
+ }
1620
+ }; }
1621
+ static get states() { return {
1622
+ "tick": {}
1623
+ }; }
1624
+ static get events() { return [{
1625
+ "method": "duetChange",
1626
+ "name": "duetChange",
1627
+ "bubbles": false,
1628
+ "cancelable": true,
1629
+ "composed": true,
1630
+ "docs": {
1631
+ "tags": [],
1632
+ "text": "Emitted when the value has changed."
1633
+ },
1634
+ "complexType": {
1635
+ "original": "DuetUploadEvent",
1636
+ "resolved": "{ originalEvent?: Event; data?: Record<string, any>; metaData?: Record<string, any>; component: \"duet-upload\"; }",
1637
+ "references": {
1638
+ "DuetUploadEvent": {
1639
+ "location": "local"
1640
+ }
1641
+ }
1642
+ }
1643
+ }, {
1644
+ "method": "duetBlur",
1645
+ "name": "duetBlur",
1646
+ "bubbles": true,
1647
+ "cancelable": true,
1648
+ "composed": true,
1649
+ "docs": {
1650
+ "tags": [],
1651
+ "text": "Emitted when the input loses focus."
1652
+ },
1653
+ "complexType": {
1654
+ "original": "DuetUploadEvent",
1655
+ "resolved": "{ originalEvent?: Event; data?: Record<string, any>; metaData?: Record<string, any>; component: \"duet-upload\"; }",
1656
+ "references": {
1657
+ "DuetUploadEvent": {
1658
+ "location": "local"
1659
+ }
1660
+ }
1661
+ }
1662
+ }, {
1663
+ "method": "duetFocus",
1664
+ "name": "duetFocus",
1665
+ "bubbles": true,
1666
+ "cancelable": true,
1667
+ "composed": true,
1668
+ "docs": {
1669
+ "tags": [],
1670
+ "text": "Emitted when the input has focus."
1671
+ },
1672
+ "complexType": {
1673
+ "original": "DuetUploadEvent",
1674
+ "resolved": "{ originalEvent?: Event; data?: Record<string, any>; metaData?: Record<string, any>; component: \"duet-upload\"; }",
1675
+ "references": {
1676
+ "DuetUploadEvent": {
1677
+ "location": "local"
1678
+ }
1679
+ }
1680
+ }
1681
+ }, {
1682
+ "method": "duetDone",
1683
+ "name": "duetDone",
1684
+ "bubbles": false,
1685
+ "cancelable": true,
1686
+ "composed": true,
1687
+ "docs": {
1688
+ "tags": [],
1689
+ "text": "Emitted when the current upload batch finishes"
1690
+ },
1691
+ "complexType": {
1692
+ "original": "DuetUploadEvent",
1693
+ "resolved": "{ originalEvent?: Event; data?: Record<string, any>; metaData?: Record<string, any>; component: \"duet-upload\"; }",
1694
+ "references": {
1695
+ "DuetUploadEvent": {
1696
+ "location": "local"
1697
+ }
1698
+ }
1699
+ }
1700
+ }, {
1701
+ "method": "duetState",
1702
+ "name": "duetState",
1703
+ "bubbles": false,
1704
+ "cancelable": true,
1705
+ "composed": true,
1706
+ "docs": {
1707
+ "tags": [],
1708
+ "text": "Emitted when the current validation state changes internally"
1709
+ },
1710
+ "complexType": {
1711
+ "original": "DuetUploadEvent",
1712
+ "resolved": "{ originalEvent?: Event; data?: Record<string, any>; metaData?: Record<string, any>; component: \"duet-upload\"; }",
1713
+ "references": {
1714
+ "DuetUploadEvent": {
1715
+ "location": "local"
1716
+ }
1717
+ }
1718
+ }
1719
+ }, {
1720
+ "method": "duetDelete",
1721
+ "name": "duetDelete",
1722
+ "bubbles": false,
1723
+ "cancelable": true,
1724
+ "composed": true,
1725
+ "docs": {
1726
+ "tags": [],
1727
+ "text": "Emitted when a user clicks delete to delete an uploaded file, or a file entry with error"
1728
+ },
1729
+ "complexType": {
1730
+ "original": "DuetUploadEvent",
1731
+ "resolved": "{ originalEvent?: Event; data?: Record<string, any>; metaData?: Record<string, any>; component: \"duet-upload\"; }",
1732
+ "references": {
1733
+ "DuetUploadEvent": {
1734
+ "location": "local"
1735
+ }
1736
+ }
1737
+ }
1738
+ }, {
1739
+ "method": "duetCancel",
1740
+ "name": "duetCancel",
1741
+ "bubbles": false,
1742
+ "cancelable": true,
1743
+ "composed": true,
1744
+ "docs": {
1745
+ "tags": [],
1746
+ "text": "Emitted when a user clicks cancel on an upload in progress"
1747
+ },
1748
+ "complexType": {
1749
+ "original": "DuetUploadEvent",
1750
+ "resolved": "{ originalEvent?: Event; data?: Record<string, any>; metaData?: Record<string, any>; component: \"duet-upload\"; }",
1751
+ "references": {
1752
+ "DuetUploadEvent": {
1753
+ "location": "local"
1754
+ }
1755
+ }
1756
+ }
1757
+ }, {
1758
+ "method": "duetProgress",
1759
+ "name": "duetProgress",
1760
+ "bubbles": false,
1761
+ "cancelable": true,
1762
+ "composed": true,
1763
+ "docs": {
1764
+ "tags": [],
1765
+ "text": "Emitted when the file progress is updated."
1766
+ },
1767
+ "complexType": {
1768
+ "original": "DuetUploadEvent",
1769
+ "resolved": "{ originalEvent?: Event; data?: Record<string, any>; metaData?: Record<string, any>; component: \"duet-upload\"; }",
1770
+ "references": {
1771
+ "DuetUploadEvent": {
1772
+ "location": "local"
1773
+ }
1774
+ }
1775
+ }
1776
+ }, {
1777
+ "method": "duetUpload",
1778
+ "name": "duetUpload",
1779
+ "bubbles": false,
1780
+ "cancelable": true,
1781
+ "composed": true,
1782
+ "docs": {
1783
+ "tags": [],
1784
+ "text": "Emitted when the user clicks the upload button"
1785
+ },
1786
+ "complexType": {
1787
+ "original": "DuetUploadEvent",
1788
+ "resolved": "{ originalEvent?: Event; data?: Record<string, any>; metaData?: Record<string, any>; component: \"duet-upload\"; }",
1789
+ "references": {
1790
+ "DuetUploadEvent": {
1791
+ "location": "local"
1792
+ }
1793
+ }
1794
+ }
1795
+ }]; }
1796
+ static get methods() { return {
1797
+ "setFocus": {
1798
+ "complexType": {
1799
+ "signature": "(options?: FocusOptions) => Promise<void>",
1800
+ "parameters": [{
1801
+ "tags": [],
1802
+ "text": ""
1803
+ }],
1804
+ "references": {
1805
+ "Promise": {
1806
+ "location": "global"
1807
+ },
1808
+ "FocusOptions": {
1809
+ "location": "global"
1810
+ }
1811
+ },
1812
+ "return": "Promise<void>"
1813
+ },
1814
+ "docs": {
1815
+ "text": "Sets focus on the specified `duet-input`. Use this method instead of the global\n`input.focus()`.",
1816
+ "tags": []
1817
+ }
1818
+ },
1819
+ "upload": {
1820
+ "complexType": {
1821
+ "signature": "(metaData?: any | undefined) => Promise<void>",
1822
+ "parameters": [{
1823
+ "tags": [],
1824
+ "text": ""
1825
+ }],
1826
+ "references": {
1827
+ "Promise": {
1828
+ "location": "global"
1829
+ }
1830
+ },
1831
+ "return": "Promise<void>"
1832
+ },
1833
+ "docs": {
1834
+ "text": "Method for invoking the upload sequence",
1835
+ "tags": []
1836
+ }
1837
+ },
1838
+ "getFiles": {
1839
+ "complexType": {
1840
+ "signature": "() => Promise<false | { valid: any[]; invalid: any[]; }>",
1841
+ "parameters": [],
1842
+ "references": {
1843
+ "Promise": {
1844
+ "location": "global"
1845
+ }
1846
+ },
1847
+ "return": "Promise<false | { valid: any[]; invalid: any[]; }>"
1848
+ },
1849
+ "docs": {
1850
+ "text": "Get list of files, divided in errors and valid sections",
1851
+ "tags": []
1852
+ }
1853
+ },
1854
+ "updateValue": {
1855
+ "complexType": {
1856
+ "signature": "(item: string, key: string, value: any) => Promise<void>",
1857
+ "parameters": [{
1858
+ "tags": [],
1859
+ "text": ""
1860
+ }, {
1861
+ "tags": [],
1862
+ "text": ""
1863
+ }, {
1864
+ "tags": [],
1865
+ "text": ""
1866
+ }],
1867
+ "references": {
1868
+ "Promise": {
1869
+ "location": "global"
1870
+ }
1871
+ },
1872
+ "return": "Promise<void>"
1873
+ },
1874
+ "docs": {
1875
+ "text": "Convenience method for updating the value of a key:value inside an item in the files attribute",
1876
+ "tags": []
1877
+ }
1878
+ }
1879
+ }; }
1880
+ static get elementRef() { return "element"; }
1881
+ static get watchers() { return [{
1882
+ "propName": "valid",
1883
+ "methodName": "watchValidHandler"
1884
+ }]; }
1885
+ }