@duetds/components 4.33.0 → 4.34.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 (326) hide show
  1. package/hydrate/index.js +487 -198
  2. package/lib/cjs/{dom-c850c8d7.js → dom-52a4f07a.js} +1 -1
  3. package/lib/cjs/duet-alert.cjs.entry.js +1 -1
  4. package/lib/cjs/duet-badge.cjs.entry.js +1 -1
  5. package/lib/cjs/duet-button_2.cjs.entry.js +2 -2
  6. package/lib/cjs/duet-caption_4.cjs.entry.js +3 -3
  7. package/lib/cjs/duet-card.cjs.entry.js +2 -2
  8. package/lib/cjs/duet-checkbox.cjs.entry.js +1 -1
  9. package/lib/cjs/duet-choice_2.cjs.entry.js +2 -3
  10. package/lib/cjs/duet-collapsible.cjs.entry.js +5 -453
  11. package/lib/cjs/duet-cookie-consent.cjs.entry.js +1 -1
  12. package/lib/cjs/duet-date-picker.cjs.entry.js +2 -2
  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-upload.cjs.entry.js → duet-editable-table_4.cjs.entry.js} +463 -32
  16. package/lib/cjs/duet-empty-state.cjs.entry.js +1 -1
  17. package/lib/cjs/duet-fieldset.cjs.entry.js +62 -0
  18. package/lib/cjs/duet-footer.cjs.entry.js +2 -2
  19. package/lib/cjs/duet-grid_2.cjs.entry.js +26 -3
  20. package/lib/cjs/duet-header_2.cjs.entry.js +220 -47
  21. package/lib/cjs/duet-hero.cjs.entry.js +1 -1
  22. package/lib/cjs/duet-icon.cjs.entry.js +8 -6
  23. package/lib/cjs/duet-input_2.cjs.entry.js +3 -4
  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 +2 -2
  27. package/lib/cjs/duet-notification_2.cjs.entry.js +2 -2
  28. package/lib/cjs/duet-number-input.cjs.entry.js +1 -1
  29. package/lib/cjs/duet-progress.cjs.entry.js +1 -1
  30. package/lib/cjs/duet-radio_2.cjs.entry.js +1 -1
  31. package/lib/cjs/duet-range-slider.cjs.entry.js +1 -1
  32. package/lib/cjs/duet-select.cjs.entry.js +1 -1
  33. package/lib/cjs/duet-step_2.cjs.entry.js +1 -1
  34. package/lib/cjs/duet-tab_2.cjs.entry.js +1 -1
  35. package/lib/cjs/duet-textarea.cjs.entry.js +1 -1
  36. package/lib/cjs/duet-toggle.cjs.entry.js +1 -1
  37. package/lib/cjs/duet-tooltip.cjs.entry.js +1 -1
  38. package/lib/cjs/duet-tray.cjs.entry.js +1 -1
  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-a7a1fb8b.js → focus-utils-30f5dc06.js} +1 -1
  43. package/lib/cjs/form-search-d61b2843.js +8 -0
  44. package/lib/cjs/{index-b724d698.js → index-1c10bbfb.js} +2 -2
  45. package/lib/cjs/loader.cjs.js +3 -3
  46. package/lib/cjs/{shadow-css-e3edeed1.js → shadow-css-e1b62a99.js} +1 -1
  47. package/lib/cjs/token-utils-05bd23b4.js +77 -0
  48. package/lib/cjs/tokens-8596cece.js +459 -0
  49. package/lib/collection/collection-manifest.json +11 -10
  50. package/lib/collection/components/duet-choice/duet-choice.js +0 -1
  51. package/lib/collection/components/duet-collapsible/duet-collapsible.js +4 -1
  52. package/lib/collection/components/duet-editable-table/duet-editable-table-button.js +13 -6
  53. package/lib/collection/components/duet-editable-table/duet-editable-table-item.js +25 -3
  54. package/lib/collection/components/duet-editable-table/duet-editable-table-tabledata.js +3 -3
  55. package/lib/collection/components/duet-editable-table/duet-editable-table.js +58 -2
  56. package/lib/collection/components/duet-footer/duet-footer.css +1 -0
  57. package/lib/collection/components/duet-grid/duet-grid.js +25 -2
  58. package/lib/collection/components/duet-header/duet-header-dropdown.js +27 -0
  59. package/lib/collection/components/duet-header/duet-header-hamburger.js +9 -0
  60. package/lib/collection/components/duet-header/duet-header-icon.js +9 -0
  61. package/lib/collection/components/duet-header/duet-header.css +272 -39
  62. package/lib/collection/components/duet-header/duet-header.js +316 -122
  63. package/lib/collection/components/duet-icon/duet-icon.js +11 -5
  64. package/lib/collection/components/duet-link/duet-link.js +4 -1
  65. package/lib/collection/components/duet-list-item/duet-list-item.css +1 -1
  66. package/lib/collection/components/duet-notification-drawer/duet-notification-drawer.css +4 -3
  67. package/lib/collection/components/duet-table/duet-table.css +42 -17
  68. package/lib/collection/components/duet-table/duet-table.js +2 -2
  69. package/lib/collection/components/duet-upload/duet-upload.js +98 -51
  70. package/lib/collection/components/duet-upload/{duet-upload-editable-item-error.js → upload-editable-item-error.js} +0 -0
  71. package/lib/collection/components/duet-upload/{duet-upload-editable-item-inprogres.js → upload-editable-item-inprogres.js} +0 -0
  72. package/lib/collection/components/duet-upload/{duet-upload-editable-item-success.js → upload-editable-item-success.js} +0 -0
  73. package/lib/collection/components/duet-upload/{duet-upload-validators.js → upload-validators.js} +0 -0
  74. package/lib/collection/components/{duet-upload → duet-upload-aria-status}/duet-upload-aria-status.js +3 -3
  75. package/lib/collection/utils/template-utils.js +33 -0
  76. package/lib/collection/utils/token-utils.js +67 -14
  77. package/lib/custom-elements-bundle/index.js +468 -121
  78. package/lib/duet/duet.esm.js +1 -1
  79. package/lib/duet/duet.js +1 -1
  80. package/lib/duet/{p-060d79be.entry.js → p-08498e46.entry.js} +1 -1
  81. package/lib/duet/p-0bb75f62.system.entry.js +4 -0
  82. package/lib/duet/p-0d546cd6.system.entry.js +4 -0
  83. package/lib/duet/{p-263bc9cd.system.entry.js → p-1164a119.system.entry.js} +1 -1
  84. package/lib/duet/{p-a890da72.entry.js → p-13f72df0.entry.js} +1 -1
  85. package/lib/duet/{p-387823af.system.entry.js → p-15945ba7.system.entry.js} +1 -1
  86. package/lib/duet/{p-35a3794e.js → p-183726f7.js} +0 -0
  87. package/lib/duet/{p-7fee0d23.system.entry.js → p-1842a4db.system.entry.js} +1 -1
  88. package/lib/duet/{p-4607af59.entry.js → p-1a4204b7.entry.js} +1 -1
  89. package/lib/duet/{p-b4e87f02.system.entry.js → p-1d8d319c.system.entry.js} +1 -1
  90. package/lib/duet/{p-9dca5c22.system.entry.js → p-2b1707bd.system.entry.js} +1 -1
  91. package/lib/duet/{p-8b5ca0e7.system.entry.js → p-2c89e016.system.entry.js} +1 -1
  92. package/lib/duet/p-309f9094.entry.js +4 -0
  93. package/lib/duet/{p-67d9a9a9.system.entry.js → p-30f15c84.system.entry.js} +1 -1
  94. package/lib/duet/p-39cd816e.entry.js +4 -0
  95. package/lib/duet/{p-86daec1c.entry.js → p-3d47d6d4.entry.js} +1 -1
  96. package/lib/duet/{p-d744d188.system.entry.js → p-3e9fe1c7.system.entry.js} +1 -1
  97. package/lib/duet/{p-a9859a82.entry.js → p-3ff50cee.entry.js} +1 -1
  98. package/lib/duet/{p-b42d81c3.system.js → p-41938e76.system.js} +1 -1
  99. package/lib/duet/p-420c000b.entry.js +4 -0
  100. package/lib/duet/{p-cdd70b93.entry.js → p-477c6c71.entry.js} +1 -1
  101. package/lib/duet/p-478d2995.entry.js +4 -0
  102. package/lib/duet/p-4b400f7d.system.entry.js +4 -0
  103. package/lib/duet/p-4b480fdc.entry.js +4 -0
  104. package/lib/duet/p-50b4fb2c.js +4 -0
  105. package/lib/duet/{p-987edcd0.js → p-52621211.js} +0 -0
  106. package/lib/duet/{p-94169303.entry.js → p-545dcb04.entry.js} +1 -1
  107. package/lib/duet/{p-8f826843.system.entry.js → p-571015b8.system.entry.js} +1 -1
  108. package/lib/duet/{p-9481e312.entry.js → p-580c57ea.entry.js} +1 -1
  109. package/lib/duet/{p-2bb1460c.entry.js → p-5cf1d847.entry.js} +1 -1
  110. package/lib/duet/{p-c2e77278.entry.js → p-5d2ddf99.entry.js} +1 -1
  111. package/lib/duet/{p-af41d894.system.entry.js → p-5db0676e.system.entry.js} +1 -1
  112. package/lib/duet/p-603a61dc.system.entry.js +4 -0
  113. package/lib/duet/{p-aba68b7b.entry.js → p-6b1b2655.entry.js} +1 -1
  114. package/lib/duet/{p-597d99c7.entry.js → p-6bb9a991.entry.js} +1 -1
  115. package/lib/duet/p-6dc026cf.system.entry.js +4 -0
  116. package/lib/duet/{p-c18a599e.system.js → p-6e4fd6ba.system.js} +0 -0
  117. package/lib/duet/p-71261eb7.entry.js +4 -0
  118. package/lib/duet/{p-751542a0.system.entry.js → p-71a94fb9.system.entry.js} +1 -1
  119. package/lib/duet/{p-e12f2b8b.system.js → p-76b98e4d.system.js} +1 -1
  120. package/lib/duet/{p-f8ce39fb.entry.js → p-80d40375.entry.js} +1 -1
  121. package/lib/duet/{p-548d484e.js → p-80f90fef.js} +1 -1
  122. package/lib/duet/p-8143f3de.js +4 -0
  123. package/lib/duet/{p-bf93a991.entry.js → p-87703af9.entry.js} +1 -1
  124. package/lib/duet/p-8ad673ef.entry.js +4 -0
  125. package/lib/duet/{p-d4118b6e.system.entry.js → p-8adcc2f9.system.entry.js} +1 -1
  126. package/lib/duet/{p-4a87e9ab.system.entry.js → p-8e478364.system.entry.js} +1 -1
  127. package/lib/duet/p-8f477bd6.system.js +4 -0
  128. package/lib/duet/{p-00735436.entry.js → p-8fcaeb1b.entry.js} +1 -1
  129. package/lib/duet/p-93a51797.entry.js +4 -0
  130. package/lib/duet/{p-a5b9c192.system.entry.js → p-95edfcb8.system.entry.js} +1 -1
  131. package/lib/duet/p-97dc72c2.system.entry.js +4 -0
  132. package/lib/duet/p-99cd16d8.system.entry.js +4 -0
  133. package/lib/duet/{p-e964d062.entry.js → p-9c3b48fc.entry.js} +1 -1
  134. package/lib/duet/{p-5826523b.entry.js → p-9dad09a8.entry.js} +1 -1
  135. package/lib/duet/{p-8cb7416d.entry.js → p-9db71699.entry.js} +1 -1
  136. package/lib/duet/{p-b32224fe.system.entry.js → p-a0129887.system.entry.js} +1 -1
  137. package/lib/duet/p-a16a58c1.system.js +4 -0
  138. package/lib/duet/{p-2443bdca.system.entry.js → p-a4c0ce83.system.entry.js} +1 -1
  139. package/lib/duet/{p-48d1eb1f.system.entry.js → p-a9dc4dd9.system.entry.js} +1 -1
  140. package/lib/duet/p-aa5ba0fd.entry.js +4 -0
  141. package/lib/duet/{p-d3a3c3c7.system.entry.js → p-af7685aa.system.entry.js} +1 -1
  142. package/lib/duet/{p-6e6e76db.system.entry.js → p-b061516e.system.entry.js} +1 -1
  143. package/lib/duet/{p-58750bae.system.entry.js → p-b1401fd8.system.entry.js} +1 -1
  144. package/lib/duet/{p-b3744481.entry.js → p-b71cbe4b.entry.js} +1 -1
  145. package/lib/duet/p-c0472744.system.entry.js +4 -0
  146. package/lib/duet/{p-27d80cef.system.entry.js → p-c04ca724.system.entry.js} +1 -1
  147. package/lib/duet/{p-e2a44156.js → p-c33d1202.js} +1 -1
  148. package/lib/duet/{p-374fb7e6.system.entry.js → p-c85583d4.system.entry.js} +1 -1
  149. package/lib/duet/{p-aef1b720.system.entry.js → p-ca2b3f6a.system.entry.js} +1 -1
  150. package/lib/duet/{p-3af5d66f.entry.js → p-ca68c8f0.entry.js} +1 -1
  151. package/lib/duet/{p-acc57c77.entry.js → p-cecdebf3.entry.js} +1 -1
  152. package/lib/duet/p-d004da5f.js +4 -0
  153. package/lib/duet/{p-984576c9.entry.js → p-d1d6dc7a.entry.js} +1 -1
  154. package/lib/duet/{p-794659ac.entry.js → p-d9a93e45.entry.js} +1 -1
  155. package/lib/duet/{p-d1c19f04.system.entry.js → p-dc27e127.system.entry.js} +1 -1
  156. package/lib/duet/p-df37c5cd.entry.js +4 -0
  157. package/lib/duet/{p-6a19b5ec.entry.js → p-e10f1828.entry.js} +1 -1
  158. package/lib/duet/{p-a207b008.entry.js → p-e5120c30.entry.js} +1 -1
  159. package/lib/duet/p-e54705b2.system.js +4 -0
  160. package/lib/duet/{p-0d22396e.system.js → p-e5c1751e.system.js} +0 -0
  161. package/lib/duet/{p-dfe79666.system.entry.js → p-f1c7f166.system.entry.js} +2 -2
  162. package/lib/duet/p-f1dbb4ec.entry.js +4 -0
  163. package/lib/duet/{p-aee24388.system.entry.js → p-f3cd9499.system.entry.js} +1 -1
  164. package/lib/duet/{p-4b6ebe40.system.entry.js → p-f55ea1cc.system.entry.js} +1 -1
  165. package/lib/duet/{p-e76b722f.entry.js → p-f7700f25.entry.js} +1 -1
  166. package/lib/duet/p-fa99eaa4.system.js +4 -0
  167. package/lib/duet/{p-c36b4da0.entry.js → p-fd009368.entry.js} +1 -1
  168. package/lib/duet/{p-237e47b4.system.entry.js → p-fe1a2f0d.system.entry.js} +1 -1
  169. package/lib/duet/p-fe3806e2.system.entry.js +4 -0
  170. package/lib/duet/{p-4e28da18.system.entry.js → p-ffcfbd7a.system.entry.js} +1 -1
  171. package/lib/esm/{dom-58cd15f6.js → dom-5d060ace.js} +1 -1
  172. package/lib/esm/duet-alert.entry.js +1 -1
  173. package/lib/esm/duet-badge.entry.js +1 -1
  174. package/lib/esm/duet-button_2.entry.js +2 -2
  175. package/lib/esm/duet-caption_4.entry.js +3 -3
  176. package/lib/esm/duet-card.entry.js +2 -2
  177. package/lib/esm/duet-checkbox.entry.js +1 -1
  178. package/lib/esm/duet-choice_2.entry.js +2 -3
  179. package/lib/esm/duet-collapsible.entry.js +4 -452
  180. package/lib/esm/duet-cookie-consent.entry.js +1 -1
  181. package/lib/esm/duet-date-picker.entry.js +2 -2
  182. package/lib/esm/duet-divider_2.entry.js +1 -1
  183. package/lib/esm/duet-editable-table-button.entry.js +92 -0
  184. package/lib/esm/{duet-upload.entry.js → duet-editable-table_4.entry.js} +461 -33
  185. package/lib/esm/duet-empty-state.entry.js +1 -1
  186. package/lib/esm/duet-fieldset.entry.js +58 -0
  187. package/lib/esm/duet-footer.entry.js +2 -2
  188. package/lib/esm/duet-grid_2.entry.js +26 -3
  189. package/lib/esm/duet-header_2.entry.js +220 -47
  190. package/lib/esm/duet-hero.entry.js +1 -1
  191. package/lib/esm/duet-icon.entry.js +8 -6
  192. package/lib/esm/duet-input_2.entry.js +2 -3
  193. package/lib/esm/duet-layout.entry.js +1 -1
  194. package/lib/esm/duet-list_2.entry.js +2 -2
  195. package/lib/esm/duet-modal.entry.js +2 -2
  196. package/lib/esm/duet-notification_2.entry.js +2 -2
  197. package/lib/esm/duet-number-input.entry.js +1 -1
  198. package/lib/esm/duet-progress.entry.js +1 -1
  199. package/lib/esm/duet-radio_2.entry.js +1 -1
  200. package/lib/esm/duet-range-slider.entry.js +1 -1
  201. package/lib/esm/duet-select.entry.js +1 -1
  202. package/lib/esm/duet-step_2.entry.js +1 -1
  203. package/lib/esm/duet-tab_2.entry.js +1 -1
  204. package/lib/esm/duet-textarea.entry.js +1 -1
  205. package/lib/esm/duet-toggle.entry.js +1 -1
  206. package/lib/esm/duet-tooltip.entry.js +1 -1
  207. package/lib/esm/duet-tray.entry.js +1 -1
  208. package/lib/esm/duet-upload-aria-status.entry.js +96 -0
  209. package/lib/esm/duet-visually-hidden.entry.js +1 -1
  210. package/lib/esm/duet.js +4 -4
  211. package/lib/esm/{focus-utils-1fe0dcd0.js → focus-utils-bf7d1e80.js} +1 -1
  212. package/lib/esm/form-search-ea8e19ae.js +6 -0
  213. package/lib/esm/{index-84d97bd1.js → index-f813a624.js} +2 -2
  214. package/lib/esm/loader.js +3 -3
  215. package/lib/esm/{shadow-css-7c726abb.js → shadow-css-13d024f4.js} +1 -1
  216. package/lib/esm/token-utils-75f78ca4.js +75 -0
  217. package/lib/esm/tokens-e110dc89.js +453 -0
  218. package/lib/esm-es5/{dom-58cd15f6.js → dom-5d060ace.js} +0 -0
  219. package/lib/esm-es5/duet-alert.entry.js +1 -1
  220. package/lib/esm-es5/duet-badge.entry.js +1 -1
  221. package/lib/esm-es5/duet-button_2.entry.js +1 -1
  222. package/lib/esm-es5/duet-caption_4.entry.js +1 -1
  223. package/lib/esm-es5/duet-card.entry.js +1 -1
  224. package/lib/esm-es5/duet-checkbox.entry.js +1 -1
  225. package/lib/esm-es5/duet-choice_2.entry.js +1 -1
  226. package/lib/esm-es5/duet-collapsible.entry.js +2 -2
  227. package/lib/esm-es5/duet-cookie-consent.entry.js +1 -1
  228. package/lib/esm-es5/duet-date-picker.entry.js +1 -1
  229. package/lib/esm-es5/duet-divider_2.entry.js +1 -1
  230. package/lib/esm-es5/duet-editable-table-button.entry.js +4 -0
  231. package/lib/esm-es5/duet-editable-table_4.entry.js +4 -0
  232. package/lib/esm-es5/duet-empty-state.entry.js +1 -1
  233. package/lib/esm-es5/duet-fieldset.entry.js +4 -0
  234. package/lib/esm-es5/duet-footer.entry.js +1 -1
  235. package/lib/esm-es5/duet-grid_2.entry.js +2 -2
  236. package/lib/esm-es5/duet-header_2.entry.js +2 -2
  237. package/lib/esm-es5/duet-hero.entry.js +1 -1
  238. package/lib/esm-es5/duet-icon.entry.js +1 -1
  239. package/lib/esm-es5/duet-input_2.entry.js +1 -1
  240. package/lib/esm-es5/duet-layout.entry.js +1 -1
  241. package/lib/esm-es5/duet-list_2.entry.js +1 -1
  242. package/lib/esm-es5/duet-modal.entry.js +1 -1
  243. package/lib/esm-es5/duet-notification_2.entry.js +1 -1
  244. package/lib/esm-es5/duet-number-input.entry.js +1 -1
  245. package/lib/esm-es5/duet-progress.entry.js +1 -1
  246. package/lib/esm-es5/duet-radio_2.entry.js +1 -1
  247. package/lib/esm-es5/duet-range-slider.entry.js +1 -1
  248. package/lib/esm-es5/duet-select.entry.js +1 -1
  249. package/lib/esm-es5/duet-step_2.entry.js +1 -1
  250. package/lib/esm-es5/duet-tab_2.entry.js +1 -1
  251. package/lib/esm-es5/duet-textarea.entry.js +1 -1
  252. package/lib/esm-es5/duet-toggle.entry.js +1 -1
  253. package/lib/esm-es5/duet-tooltip.entry.js +1 -1
  254. package/lib/esm-es5/duet-tray.entry.js +1 -1
  255. package/lib/esm-es5/duet-upload-aria-status.entry.js +4 -0
  256. package/lib/esm-es5/duet-visually-hidden.entry.js +1 -1
  257. package/lib/esm-es5/duet.js +1 -1
  258. package/lib/esm-es5/{focus-utils-1fe0dcd0.js → focus-utils-bf7d1e80.js} +1 -1
  259. package/lib/esm-es5/form-search-ea8e19ae.js +4 -0
  260. package/lib/esm-es5/{index-84d97bd1.js → index-f813a624.js} +1 -1
  261. package/lib/esm-es5/loader.js +1 -1
  262. package/lib/esm-es5/{shadow-css-7c726abb.js → shadow-css-13d024f4.js} +0 -0
  263. package/lib/esm-es5/token-utils-75f78ca4.js +4 -0
  264. package/lib/esm-es5/tokens-e110dc89.js +4 -0
  265. package/lib/html.html-data.json +4925 -0
  266. package/lib/types/common-types.d.ts +0 -1
  267. package/lib/types/components/duet-collapsible/duet-collapsible.d.ts +3 -0
  268. package/lib/types/components/duet-editable-table/duet-editable-table-button.d.ts +1 -0
  269. package/lib/types/components/duet-editable-table/duet-editable-table-item.d.ts +5 -1
  270. package/lib/types/components/duet-editable-table/duet-editable-table-tabledata.d.ts +1 -0
  271. package/lib/types/components/duet-editable-table/duet-editable-table.d.ts +10 -0
  272. package/lib/types/components/duet-grid/duet-grid.d.ts +1 -0
  273. package/lib/types/components/duet-header/duet-header-dropdown.d.ts +16 -0
  274. package/lib/types/components/duet-header/duet-header-hamburger.d.ts +2 -0
  275. package/lib/types/components/duet-header/duet-header-icon.d.ts +8 -0
  276. package/lib/types/components/duet-header/duet-header.d.ts +41 -4
  277. package/lib/types/components/duet-icon/duet-icon.d.ts +1 -1
  278. package/lib/types/components/duet-link/duet-link.d.ts +3 -0
  279. package/lib/types/components/duet-table/duet-table.d.ts +1 -1
  280. package/lib/types/components/duet-upload/duet-upload.d.ts +46 -18
  281. package/lib/types/components/duet-upload/{duet-upload-editable-item-error.d.ts → upload-editable-item-error.d.ts} +0 -0
  282. package/lib/types/components/duet-upload/{duet-upload-editable-item-inprogres.d.ts → upload-editable-item-inprogres.d.ts} +0 -0
  283. package/lib/types/components/duet-upload/{duet-upload-editable-item-success.d.ts → upload-editable-item-success.d.ts} +0 -0
  284. package/lib/types/components/duet-upload/{duet-upload-validators.d.ts → upload-validators.d.ts} +0 -0
  285. package/lib/types/components/{duet-upload → duet-upload-aria-status}/duet-upload-aria-status.d.ts +2 -2
  286. package/lib/types/components.d.ts +71 -35
  287. package/lib/types/stencil-public-runtime.d.ts +6 -4
  288. package/lib/types/utils/template-utils.d.ts +13 -0
  289. package/lib/types/utils/token-utils.d.ts +8 -2
  290. package/package.json +13 -13
  291. package/lib/cjs/duet-editable-table-button_3.cjs.entry.js +0 -232
  292. package/lib/cjs/duet-editable-table_3.cjs.entry.js +0 -336
  293. package/lib/cjs/js-utils-33a9dbe3.js +0 -16
  294. package/lib/cjs/token-utils-63a9c8dc.js +0 -30
  295. package/lib/duet/p-10deead0.system.js +0 -4
  296. package/lib/duet/p-1208c84f.entry.js +0 -4
  297. package/lib/duet/p-155ef581.system.entry.js +0 -4
  298. package/lib/duet/p-16c48c5d.entry.js +0 -4
  299. package/lib/duet/p-1797df7b.system.entry.js +0 -4
  300. package/lib/duet/p-1a08fc22.system.entry.js +0 -4
  301. package/lib/duet/p-28e02c08.entry.js +0 -4
  302. package/lib/duet/p-33c58756.entry.js +0 -4
  303. package/lib/duet/p-3c1971d8.js +0 -4
  304. package/lib/duet/p-5ea0cd19.entry.js +0 -4
  305. package/lib/duet/p-63d5bf73.system.entry.js +0 -4
  306. package/lib/duet/p-6cc3be76.system.entry.js +0 -4
  307. package/lib/duet/p-6e363557.system.js +0 -4
  308. package/lib/duet/p-7368b14e.system.entry.js +0 -4
  309. package/lib/duet/p-7e8d5bb9.system.entry.js +0 -4
  310. package/lib/duet/p-81867417.system.js +0 -4
  311. package/lib/duet/p-9d73343a.entry.js +0 -4
  312. package/lib/duet/p-a6a84ec6.entry.js +0 -4
  313. package/lib/duet/p-b25d3769.js +0 -4
  314. package/lib/duet/p-c34329f3.entry.js +0 -4
  315. package/lib/duet/p-de07c7d7.entry.js +0 -4
  316. package/lib/duet/p-f0a4b68d.system.entry.js +0 -4
  317. package/lib/duet/p-f364eb96.entry.js +0 -4
  318. package/lib/esm/duet-editable-table-button_3.entry.js +0 -226
  319. package/lib/esm/duet-editable-table_3.entry.js +0 -330
  320. package/lib/esm/js-utils-b69f17df.js +0 -14
  321. package/lib/esm/token-utils-590d9413.js +0 -28
  322. package/lib/esm-es5/duet-editable-table-button_3.entry.js +0 -4
  323. package/lib/esm-es5/duet-editable-table_3.entry.js +0 -4
  324. package/lib/esm-es5/duet-upload.entry.js +0 -4
  325. package/lib/esm-es5/js-utils-b69f17df.js +0 -4
  326. package/lib/esm-es5/token-utils-590d9413.js +0 -4
@@ -1,13 +1,413 @@
1
1
  /*!
2
2
  * Built with Duet Design System
3
3
  */
4
- import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-84d97bd1.js';
5
- import { c as createID } from './create-id-981107da.js';
6
- import { d as debounce } from './js-utils-b69f17df.js';
7
- import { g as getLocaleString } from './language-utils-344d894c.js';
4
+ import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-f813a624.js';
5
+ import { s as sanitizeString, g as getLocaleString } from './language-utils-344d894c.js';
8
6
  import { i as inheritGlobalTheme } from './themeable-component-572685dd.js';
7
+ import { m as mediaQueryMedium, h as mediaQueryLarge, i as mediaQueryXLarge, j as mediaQueryXxLarge, k as mediaQueryXxxLarge, l as mediaQuerySmall, n as sizeNavigation, s as sizeHeader } from './tokens.module-49cbf963.js';
8
+ import { c as createID } from './create-id-981107da.js';
9
9
  import './string-utils-2f1793b8.js';
10
10
 
11
+ const debounce = (func, timeout = 50) => {
12
+ let timer;
13
+ return (...args) => {
14
+ clearTimeout(timer);
15
+ timer = setTimeout(() => {
16
+ func.apply(undefined, args);
17
+ }, timeout);
18
+ };
19
+ };
20
+
21
+ /**
22
+ * Produces a function which uses template strings to do simple interpolation from objects.
23
+ *
24
+ * Usage:
25
+ * var makeMeKing = generateTemplateFn('${name} is now the king of ${country}!');
26
+ *
27
+ * console.log(makeMeKing({ name: 'Bryan', country: 'Scotland'}));
28
+ * // Logs 'Bryan is now the king of Scotland!'
29
+ */
30
+ const generateTemplateFn = (function () {
31
+ const cache = {};
32
+ function generateTemplate(template) {
33
+ if (typeof template !== "string") {
34
+ template = template.outerHTML;
35
+ }
36
+ let fn = cache[template];
37
+ if (!fn) {
38
+ // Replace ${expressions} (etc) with ${map.expressions}.
39
+ const sanitized = template
40
+ .replace(/\$\{([\s]*[^;\s\{]+[\s]*)\}/g, function (_, match) {
41
+ return `\$\{map.${match.trim()}\}`;
42
+ })
43
+ // Afterwards, replace anything that's not ${map.expressions}' (etc) with a blank string.
44
+ .replace(/(\$\{(?!map\.)[^}]+\})/g, "");
45
+ fn = Function("map", `return \`${sanitized}\``);
46
+ }
47
+ return fn;
48
+ }
49
+ return generateTemplate;
50
+ })();
51
+
52
+ const duetEditableTableCss = "duet-editable-table{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.duet-editable-table-header tr .duet-editable-table-header-hidden{padding:0 !important;font-size:0;border-bottom:0}";
53
+
54
+ let DuetEditableTable = class {
55
+ constructor(hostRef) {
56
+ registerInstance(this, hostRef);
57
+ this.template = undefined;
58
+ /**
59
+ * State() variables
60
+ * @internal
61
+ */
62
+ this.tick = Date.now();
63
+ /**
64
+ * Map of items that contain list of things.
65
+ */
66
+ this.items = new Map();
67
+ /**
68
+ * Key used to set vertical alignment of action buttons
69
+ */
70
+ this.alignment = "middle";
71
+ /**
72
+ * Array of internationalized defaults for the default groups labels.
73
+ */
74
+ this.groupsLabelDefaults = {
75
+ fi: "Kaikki",
76
+ en: "All items",
77
+ sv: "Alla objekt",
78
+ };
79
+ /**
80
+ * Array of internationalized defaults for the default action labels.
81
+ */
82
+ this.actionLabelDefaults = {
83
+ fi: "Toiminnot",
84
+ en: "Actions",
85
+ sv: "Handlingar",
86
+ };
87
+ /**
88
+ * Array of group names that you want the editable table to display (can be used to hide or show groups depending on conditions).
89
+ * @default { id: "all", label: this.groupsLabelDefaults, actionLabel: this.actionLabelDefaults }.
90
+ * @example [{ id: "success", label: {fi: "Onnistunut", en: "Success", sv: "Alt klart", }}].
91
+ */
92
+ this.groups = [
93
+ { id: "all", label: this.groupsLabelDefaults, actionLabel: this.actionLabelDefaults },
94
+ ];
95
+ /**
96
+ * Array of actions that are mapped via the map variable to the various groups defined in group.
97
+ * @default undefined
98
+ * @example [{
99
+ variation: "default",
100
+ icon: "action-edit-2",
101
+ id: "edit",
102
+ map: ["success"],
103
+ label: {
104
+ fi: " Label",
105
+ en: " Label",
106
+ sv: " Label",
107
+ }
108
+ }]
109
+ */
110
+ this.actions = undefined;
111
+ /**
112
+ * Shows or hides the table labels.
113
+ */
114
+ this.hideGroups = false;
115
+ /**
116
+ * Exposes the aria role for optimizing accessibility.
117
+ */
118
+ this.accessibleRole = undefined;
119
+ /**
120
+ * Theme of the table.
121
+ */
122
+ this.theme = "";
123
+ /**
124
+ * Private methods.
125
+ */
126
+ this.kick = debounce(() => {
127
+ this.tick = Date.now();
128
+ }, 100); // will trigger re-render
129
+ /**
130
+ * If a user defines a template section within editable table, try to read an use it.
131
+ */
132
+ this.getTemplate = () => {
133
+ const templateDom = this.element.getElementsByTagName("template");
134
+ if (templateDom === null || templateDom === void 0 ? void 0 : templateDom.length) {
135
+ const templateString = templateDom[0].content.firstElementChild.outerHTML;
136
+ return generateTemplateFn(templateString);
137
+ }
138
+ else {
139
+ return false;
140
+ }
141
+ };
142
+ this.getItemData = (data) => {
143
+ const { item, group, uid } = data;
144
+ if (this.template) {
145
+ return {
146
+ group,
147
+ uid,
148
+ item: this.template(item),
149
+ };
150
+ }
151
+ return { item, group, uid };
152
+ };
153
+ this.filterMap = needle => {
154
+ if (needle === "all") {
155
+ return Array.from(this.items);
156
+ }
157
+ return Array.from(this.items).filter(item => needle === item[1].group);
158
+ };
159
+ }
160
+ /**
161
+ * Component lifecycle events.
162
+ */
163
+ componentWillLoad() {
164
+ // look for a <template> region in the duet-editable-table
165
+ this.template = this.getTemplate();
166
+ // take care of the case where groups and actions are defined as html properties instead of javascript objects
167
+ if (typeof this.groups === "string") {
168
+ this.internalGroupArray = sanitizeString(this.groups);
169
+ }
170
+ else {
171
+ this.internalGroupArray = this.groups;
172
+ }
173
+ if (typeof this.actions === "string") {
174
+ this.internalActionsArray = sanitizeString(this.actions);
175
+ }
176
+ else {
177
+ this.internalActionsArray = this.actions;
178
+ }
179
+ inheritGlobalTheme(this);
180
+ }
181
+ /**
182
+ * Method to force an update of a tabular data array.
183
+ * when called the method will rerender the entire tabular structure.
184
+ */
185
+ async updateTable(passedItems = undefined) {
186
+ this.items = new Map(passedItems || this.items);
187
+ this.kick();
188
+ }
189
+ render() {
190
+ return (h(Host, { class: {
191
+ "duet-theme-turva": this.theme === "turva",
192
+ } }, this.internalGroupArray.map(group => {
193
+ const currentGroup = this.filterMap(group.id);
194
+ if (!currentGroup.length) {
195
+ return;
196
+ }
197
+ return (h("duet-table", { variation: "plain", breakpoint: "none", role: "", margin: this.hideGroups ? "none" : "auto" }, h("table", { class: "duet-editable-table", "aria-role": this.accessibleRole }, h("thead", { class: "duet-editable-table-header" }, h("tr", null, h("th", { class: {
198
+ "duet-editable-table-header-hidden": this.hideGroups,
199
+ } }, !this.hideGroups ? (getLocaleString(group.label)) : (h("duet-visually-hidden", null, getLocaleString(group.label)))), h("th", { class: {
200
+ "duet-editable-table-header-hidden": this.hideGroups,
201
+ } }, h("duet-visually-hidden", null, group.actionLabel
202
+ ? getLocaleString(group.actionLabel)
203
+ : getLocaleString(this.actionLabelDefaults))))), h("tbody", null, currentGroup.map(dataAsArray => {
204
+ const [key, value] = dataAsArray;
205
+ return (h("duet-editable-table-item", { theme: this.theme, keyName: key, data: this.getItemData(value), groupId: group.id, part: group.id, alignment: this.alignment, actions: this.internalActionsArray }));
206
+ })))));
207
+ })));
208
+ }
209
+ get element() { return getElement(this); }
210
+ };
211
+ DuetEditableTable.style = duetEditableTableCss;
212
+
213
+ //simple functional component that renders the data in the table
214
+ const TableData = ({ data, groupId, alignment }, _children) => {
215
+ if (typeof data === "string") {
216
+ return (h("td", { innerHTML: data, class: "duet-editable-table-content", part: `${groupId}content`, style: { verticalAlign: alignment } }));
217
+ }
218
+ else {
219
+ return (h("td", { class: "duet-editable-table-content", part: `${groupId}content`, style: { verticalAlign: alignment } }, data));
220
+ }
221
+ };
222
+
223
+ const duetEditableTableItemCss = "*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{display:table-row;height:32px}.duet-editable-table-content,.duet-editable-table-actions{height:32px;padding:12px 0;vertical-align:middle;break-word:break-all;border-bottom:1px solid #e1e3e6}.duet-editable-table-actions-items{display:flex;justify-content:flex-end}.duet-editable-table-actions-items duet-editable-table-button{padding-left:8px}.duet-editable-table .editable-item-small{font-size:0.75rem;font-weight:400}";
224
+
225
+ let DuetEditableTableItem = class {
226
+ constructor(hostRef) {
227
+ registerInstance(this, hostRef);
228
+ this.duetEditableItemAction = createEvent(this, "duetEditableItemAction", 7);
229
+ this.isHovering = false;
230
+ /**
231
+ * Theme of the empty state component.
232
+ */
233
+ this.theme = "";
234
+ /**
235
+ * Actions that can be performed on the element
236
+ */
237
+ this.actions = undefined;
238
+ /**
239
+ * GroupId used to pierce the shadowdom - gets concatenated with "content & actions" and used as part="groupIDcontent/actions" to pierce the content/Action item
240
+ * @internal
241
+ */
242
+ this.groupId = "";
243
+ /**
244
+ * Key used to set vertical alignment of action buttons
245
+ */
246
+ this.alignment = "middle";
247
+ /**
248
+ * Key used to identify item, when running actions
249
+ */
250
+ this.keyName = "";
251
+ /**
252
+ * Object of data itemsused to render the entire row
253
+ */
254
+ this.data = undefined;
255
+ }
256
+ watchPropHandler(_newValue, _oldValue) {
257
+ // console.log("The new value of activated is: ", _newValue)
258
+ }
259
+ /**
260
+ /**
261
+ * Component lifecycle events.
262
+ */
263
+ componentWillLoad() {
264
+ inheritGlobalTheme(this);
265
+ }
266
+ /**
267
+ /**
268
+ * private functions
269
+ */
270
+ /**
271
+ * render() function
272
+ * Always the last one in the class.
273
+ */
274
+ render() {
275
+ return (h(Host, { role: "row" }, h(TableData, { data: this.data.item, alignment: this.alignment, groupId: this.groupId }), h("td", { class: "duet-editable-table-actions", style: { verticalAlign: this.alignment } }, h("div", { class: "duet-editable-table-actions-items", part: `${this.groupId}actions` }, this.actions.map(result => {
276
+ const { map = undefined } = result;
277
+ // if map has been specified, only show the current action if groupID matches the map array
278
+ if (map && !map.includes(this.groupId)) {
279
+ return;
280
+ }
281
+ return (h("duet-editable-table-button", { keyName: this.keyName, group: this.data.group, uid: this.data.uid, actions: result, theme: this.theme }));
282
+ })))));
283
+ }
284
+ get el() { return getElement(this); }
285
+ static get watchers() { return {
286
+ "data": ["watchPropHandler"]
287
+ }; }
288
+ };
289
+ DuetEditableTableItem.style = duetEditableTableItemCss;
290
+
291
+ const duetTableCss = "duet-table{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;margin-bottom:20px !important;display:block;font-variant-numeric:tabular-nums}duet-table table,duet-table thead,duet-table tbody,duet-table tfoot,duet-table th,duet-table td,duet-table tr{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}duet-table.duet-m-0{margin:0 !important}duet-table table{width:100%;font-family:\"localtapiola-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";font-size:1rem;text-align:left;border-spacing:0;border-collapse:separate}duet-table.duet-theme-turva table{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"}duet-table td{-webkit-hyphens:auto;hyphens:auto;color:#00294d}duet-table.duet-theme-turva td{color:#171c3a}duet-table th{font-weight:600;line-height:1.25;color:#657787;text-align:left}duet-table.duet-theme-turva th{color:#747475}duet-table tbody th{font-weight:600;color:#00294d}duet-table.duet-theme-turva tbody th{color:#171c3a}.duet-table-flattened table,.duet-table-flattened thead,.duet-table-flattened tbody,.duet-table-flattened tfoot,.duet-table-flattened th,.duet-table-flattened td,.duet-table-flattened tr{display:block}.duet-table-flattened thead tr{position:absolute !important;top:0;width:1px !important;height:1px !important;padding:0 !important;overflow:hidden !important;clip:rect(1px, 1px, 1px, 1px) !important;border:0 !important}.duet-table-flattened td{line-height:1.25}.duet-table-flattened td:not(:last-child){margin-bottom:16px !important}.duet-table-flattened tbody td,.duet-table-flattened tbody th,.duet-table-flattened tfoot td{padding:0 !important;text-align:left !important}.duet-table-flattened tbody th{font-weight:600;line-height:1.25;color:#657787;text-align:left}.duet-table-flattened td[data-heading]::before{margin-bottom:4px !important;display:block;font-size:1rem;font-weight:600;color:#00294d;content:attr(data-heading)}.duet-table-flattened.duet-theme-turva td[data-heading]::before{color:#171c3a}.duet-table-sticky thead th{position:sticky;top:0;background:white}.duet-table-striped td,.duet-table-striped th{padding:20px !important}@media (max-width: 35.9375em){.duet-table-striped td,.duet-table-striped th{padding:20px 12px !important}}.duet-table-striped tbody th{background:white}.duet-table-striped.duet-table-sticky thead th{border-bottom:1px solid #e1e3e6}.duet-table-striped.duet-table-sticky.duet-theme-turva thead th{border-bottom-color:#e4e4e6}.duet-table-striped tbody:not(:first-of-type) th{padding-top:40px !important}.duet-table-striped tbody:only-of-type tr:nth-of-type(odd){background:rgba(0, 80, 128, 0.04)}.duet-table-striped.duet-theme-turva tbody:only-of-type tr:nth-of-type(odd){background:rgba(23, 28, 58, 0.04)}.duet-table-striped tbody:not(:only-of-type) tr:nth-of-type(even){background:rgba(0, 80, 128, 0.04)}.duet-table-striped.duet-theme-turva tbody:not(:only-of-type) tr:nth-of-type(even){background:rgba(23, 28, 58, 0.04)}.duet-table-striped tfoot td{border-top:1px solid #e1e3e6}.duet-table-striped.duet-theme-turva tfoot td{border-top-color:#e4e4e6}.duet-table-striped.duet-table-flattened tbody:not(:first-of-type) th{padding-top:20px !important}.duet-table-striped.duet-table-flattened tr{padding:20px !important}.duet-table-striped.duet-table-flattened tfoot td{border-top:0}.duet-table-striped.duet-table-flattened tfoot tr{border-top:1px solid #e1e3e6}.duet-table-striped.duet-table-flattened.duet-theme-turva tfoot tr{border-top-color:#e4e4e6}.duet-table-fixed th,.duet-table-minimal th,.duet-table-plain th{padding:16px !important;border-bottom:1px solid #657787}.duet-table-fixed th:first-child,.duet-table-minimal th:first-child,.duet-table-plain th:first-child{padding-left:0 !important}.duet-table-fixed th:last-child,.duet-table-minimal th:last-child,.duet-table-plain th:last-child{padding-right:0 !important}.duet-theme-turva.duet-table-fixed th,.duet-theme-turva.duet-table-minimal th,.duet-theme-turva.duet-table-plain th{border-bottom-color:#444445}.duet-table-fixed tbody th,.duet-table-minimal tbody th,.duet-table-plain tbody th{padding-top:40px !important;border-bottom-color:#e1e3e6}.duet-theme-turva.duet-table-fixed tbody th,.duet-theme-turva.duet-table-minimal tbody th,.duet-theme-turva.duet-table-plain tbody th{border-bottom-color:#e4e4e6}.duet-table-fixed td,.duet-table-minimal td,.duet-table-plain td{padding:16px !important}.duet-table-fixed td:first-child,.duet-table-minimal td:first-child,.duet-table-plain td:first-child{padding-left:0 !important}.duet-table-fixed td:last-child,.duet-table-minimal td:last-child,.duet-table-plain td:last-child{padding-right:0 !important}.duet-table-fixed tbody td,.duet-table-minimal tbody td,.duet-table-plain tbody td{border-bottom:1px solid #e1e3e6}.duet-theme-turva.duet-table-fixed tbody td,.duet-theme-turva.duet-table-minimal tbody td,.duet-theme-turva.duet-table-plain tbody td{border-bottom-color:#e4e4e6}.duet-table-flattened.duet-table-fixed tbody:first-of-type th,.duet-table-flattened.duet-table-minimal tbody:first-of-type th,.duet-table-flattened.duet-table-plain tbody:first-of-type th{padding-top:0 !important}.duet-table-flattened.duet-table-fixed td,.duet-table-flattened.duet-table-minimal td,.duet-table-flattened.duet-table-plain td,.duet-table-flattened.duet-table-fixed tbody th,.duet-table-flattened.duet-table-minimal tbody th,.duet-table-flattened.duet-table-plain tbody th{border-bottom:0}.duet-table-flattened.duet-table-fixed tr,.duet-table-flattened.duet-table-minimal tr,.duet-table-flattened.duet-table-plain tr{padding:20px 0 !important}.duet-table-flattened.duet-table-fixed tbody th,.duet-table-flattened.duet-table-minimal tbody th,.duet-table-flattened.duet-table-plain tbody th{padding-top:20px !important}.duet-table-flattened.duet-table-fixed tfoot td,.duet-table-flattened.duet-table-minimal tfoot td,.duet-table-flattened.duet-table-plain tfoot td{margin-bottom:4px !important}.duet-table-flattened.duet-table-fixed tbody:not(:only-of-type) tr:first-child,.duet-table-flattened.duet-table-minimal tbody:not(:only-of-type) tr:first-child,.duet-table-flattened.duet-table-plain tbody:not(:only-of-type) tr:first-child{border-bottom:0}.duet-table-plain.duet-table-flattened tbody tr{border-bottom:1px solid #e1e3e6}.duet-table-plain.duet-table-flattened.duet-theme-turva tbody tr{border-bottom-color:#e4e4e6}.duet-table-minimal tbody tr,.duet-table-minimal tbody tr td{vertical-align:top;border-bottom:0 none}.duet-table-minimal tbody tr:last-of-type,.duet-table-minimal tbody tr:last-of-type td{border-bottom:1px solid #e1e3e6}.duet-table-minimal.duet-table-flattened tbody tr,.duet-table-minimal.duet-table-flattened tbody tr td{border-bottom:0 none}.duet-table-minimal.duet-table-flattened tbody tr td[data-heading]::before{display:none}.duet-table-minimal.duet-table-flattened tfoot{border-top:1px solid #e1e3e6}.duet-table-minimal.duet-table-flattened.duet-theme-turva tfoot{border-top-color:#e4e4e6}.duet-table-fixed table{table-layout:fixed}.duet-table-fixed tbody tr,.duet-table-fixed tbody tr td,.duet-table-fixed tbody tr td:first-child{padding:4px !important;vertical-align:text-bottom;border-bottom:0 none}.duet-table-fixed thead{display:none}.duet-table-fixed tbody tr,.duet-table-fixed tbody tr td{border-bottom:0 none}.duet-table-fixed:not(.duet-table-flattened) tfoot{border-top:1px solid #e1e3e6}.duet-table-fixed:not(.duet-table-flattened).duet-theme-turva tfoot{border-top-color:#e4e4e6}.duet-table-scrollable{position:relative;width:100%;overflow-x:auto;background:linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0)), linear-gradient(-90deg, #fff 0%, rgba(255, 255, 255, 0)) 100% 0, radial-gradient(farthest-side at 0% 50%, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0)), radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0)) 100% 0%;background-repeat:no-repeat;background-attachment:local, local, scroll, scroll;background-size:100px 100%, 100px 100%, 12px 100%, 12px 100%}.duet-table-selected-column{background:rgba(0, 119, 179, 0.08)}.duet-theme-turva .duet-table-selected-column{background:rgba(68, 68, 69, 0.08)}";
292
+
293
+ // remove wrapping speech marks.
294
+ // media query tokens are wrapped in speech marks,
295
+ // which need to be removed before use with matchMedia.
296
+ const unwrap = (str) => str.substring(1, str.length - 1);
297
+ const breakpointToToken = {
298
+ none: "all",
299
+ "none-scrollable": "all",
300
+ small: unwrap(mediaQuerySmall),
301
+ medium: unwrap(mediaQueryMedium),
302
+ large: unwrap(mediaQueryLarge),
303
+ "x-large": unwrap(mediaQueryXLarge),
304
+ "xx-large": unwrap(mediaQueryXxLarge),
305
+ "xxx-large": unwrap(mediaQueryXxxLarge),
306
+ };
307
+ const stickyTopValues = {
308
+ none: 0,
309
+ "with-links": parseFloat(sizeNavigation) * 16,
310
+ "without-links": parseFloat(sizeHeader) * 16,
311
+ };
312
+ let DuetTable = class {
313
+ constructor(hostRef) {
314
+ registerInstance(this, hostRef);
315
+ /**
316
+ * Tracks whether the breakpoint is matched. This is set to true by default so that JavaScript disabled in SSR mode we get accessible table data first.
317
+ */
318
+ this.matchesBreakpoint = true;
319
+ /**
320
+ * Controls the margin of the component.
321
+ */
322
+ this.margin = "auto";
323
+ /**
324
+ * Style variation of the table.
325
+ */
326
+ this.variation = "striped";
327
+ /**
328
+ * Controls whether the table has a sticky header.
329
+ * Sticky headers are not compatible with breakpoint="none-scrollable".
330
+ */
331
+ this.sticky = false;
332
+ /**
333
+ * Adjust the distance from top of the viewport (in pixels) when the
334
+ * table header becomes sticky.
335
+ */
336
+ this.stickyDistance = "with-links";
337
+ /**
338
+ * By default the table is responsive - it will be flattened at narrow viewport widths.
339
+ * This prop controls the breakpoint at which the table should be rendered as a _regular_ table.
340
+ * Set to "none" to disable the responsive functionality.
341
+ * Set to "none-scrollable" to disable responsive functionality _and_ allow horizontal scrolling -
342
+ * this is useful for comparison tables where it's important to maintain column and row layout.
343
+ */
344
+ this.breakpoint = "small";
345
+ this.handleMediaQueryChange = (mq) => {
346
+ this.matchesBreakpoint = mq.matches;
347
+ };
348
+ }
349
+ connectedCallback() {
350
+ this.mq = matchMedia(breakpointToToken[this.breakpoint]);
351
+ this.mq.addEventListener("change", this.handleMediaQueryChange);
352
+ this.handleMediaQueryChange(this.mq);
353
+ this.observer = new MutationObserver(() => this.copyHeadingsToCells());
354
+ this.observer.observe(this.element, {
355
+ childList: true,
356
+ subtree: true,
357
+ });
358
+ }
359
+ componentWillLoad() {
360
+ inheritGlobalTheme(this);
361
+ this.copyHeadingsToCells();
362
+ if (this.sticky && this.breakpoint === "none-scrollable") {
363
+ console.warn(`[DUET WARNING]: sticky and breakpoint="none-scrollable" are incompatible. Scrollable takes precedence`);
364
+ }
365
+ if (this.sticky) {
366
+ const stickyTop = stickyTopValues[this.stickyDistance];
367
+ const headingElements = this.element.querySelectorAll("thead th");
368
+ headingElements.forEach(th => (th.style.top = `${stickyTop}px`));
369
+ }
370
+ }
371
+ componentDidLoad() {
372
+ // this clears all pending mutations,
373
+ // that way we avoid dealing with any initial changes
374
+ // and only get genuine mutations as rows are added/removed
375
+ this.observer.takeRecords();
376
+ }
377
+ disconnectedCallback() {
378
+ this.observer.disconnect();
379
+ this.observer = null;
380
+ this.mq.removeListener(this.handleMediaQueryChange);
381
+ this.mq = null;
382
+ this.matchesBreakpoint = true;
383
+ }
384
+ copyHeadingsToCells() {
385
+ const headingElements = this.element.querySelectorAll("thead th");
386
+ const rowElements = this.element.querySelectorAll("tbody tr");
387
+ const headings = Array.from(headingElements).map(th => th.textContent.trim());
388
+ rowElements.forEach(tr => {
389
+ tr.querySelectorAll("td").forEach((td, i) => {
390
+ if (headings[i]) {
391
+ td.dataset.heading = headings[i];
392
+ }
393
+ });
394
+ });
395
+ }
396
+ render() {
397
+ return (h(Host, { class: {
398
+ [`duet-table-${this.variation}`]: true,
399
+ "duet-table-flattened": !this.matchesBreakpoint,
400
+ // sticky only valid when in regular table layout
401
+ "duet-table-sticky": this.matchesBreakpoint && this.sticky,
402
+ "duet-table-scrollable": this.breakpoint === "none-scrollable",
403
+ "duet-m-0": this.margin === "none",
404
+ "duet-theme-turva": this.theme === "turva",
405
+ } }, h("slot", null)));
406
+ }
407
+ get element() { return getElement(this); }
408
+ };
409
+ DuetTable.style = duetTableCss;
410
+
11
411
  const errorCodes = [
12
412
  {
13
413
  type: "default",
@@ -360,7 +760,7 @@ let DuetUpload = class {
360
760
  this.filesInProgress = new Map();
361
761
  this.fileMaxReached = false;
362
762
  this.bytesMaxReached = false;
363
- //region Internally exposed properties
763
+ this.internalStatusMessageLabel = undefined;
364
764
  /**
365
765
  * Properties
366
766
  */
@@ -379,18 +779,18 @@ let DuetUpload = class {
379
779
  */
380
780
  this.external = false;
381
781
  /**
382
- * If set the upload component will not display an upload button, you will have to create on yourself
383
- * and call the exposed methods startUpload
782
+ * If set the upload component will not display an upload button, you will have to create one yourself
783
+ * and call the exposed method startUpload
384
784
  */
385
785
  this.hideButton = false;
386
786
  /**
387
- * Default actions added to all files
787
+ * Default actions added to the internally used duet-editable-table
388
788
  */
389
789
  this.actions = [
390
790
  {
391
791
  icon: "action-delete",
392
792
  color: "color-danger",
393
- color_hover: "category-home",
793
+ color_hover: "primary-dark",
394
794
  id: "delete",
395
795
  map: ["success", "failure"],
396
796
  label: {
@@ -402,7 +802,7 @@ let DuetUpload = class {
402
802
  {
403
803
  icon: "navigation-close",
404
804
  color: "primary",
405
- color_hover: "category-home",
805
+ color_hover: "primary-dark",
406
806
  id: "cancel",
407
807
  map: ["inprogress"],
408
808
  label: {
@@ -413,17 +813,43 @@ let DuetUpload = class {
413
813
  },
414
814
  ];
415
815
  /**
416
- * If enabled the filelist will create links on successfully uploaded items,
816
+ * If enabled the editable-table will display links on successfully uploaded items,
417
817
  * this requires the server can respond with link URIs in the correct format
818
+ * and that the files are accessible to the user
418
819
  */
419
820
  this.showLinks = false;
420
821
  /**
421
822
  * Property to change the aria upload progress text read aloud by screenreaders
422
823
  * @default {
423
- fi: "Lisää liite",
424
- sv: "Lägg till en bilaga",
425
- en: "Choose files",
426
- }
824
+ * fi: {
825
+ * inProgress: "Lähetetään {filesUploaded} lähetettävästä {filesTotal} tiedostosta",
826
+ * inProgressWithErrors:
827
+ * "Lähetetään {filesInProgress} tiedostoa, lähetetty {filesUploaded} lähetettävästä {filesTotal} tiedostosta, {filesWithErrors} tiedostossa on virheitä",
828
+ * done: "Kaikki {filesTotal} tiedostoa lähetetty onnistuneesti",
829
+ * doneWithErrors:
830
+ * "Lähetys valmis, {filesUploaded} tiedostoa on lähetetty onnistuneesti, {filesWithErrors} tiedostossa oli virheitä",
831
+ * files: "tiedostot",
832
+ * file: "tiedosto",
833
+ * },
834
+ * sv: {
835
+ * inProgress: "Adding {filesUploaded} of {filesTotal}",
836
+ * inProgressWithErrors:
837
+ * "Laddar upp {filesInProgress}, {filesUploaded} uppladdad av {filesTotal}, {filesWithErrors} misslyckades",
838
+ * done: "Alla {filesTotal} har lagts till",
839
+ * doneWithErrors: "Handling slutförd, {filesUploaded} har lagts till, {filesWithErrors} misslyckades",
840
+ * files: "filer",
841
+ * file: "fil",
842
+ * },
843
+ * en: {
844
+ * inProgress: "Adding {filesUploaded} of {filesTotal}",
845
+ * inProgressWithErrors:
846
+ * "Uploading {filesInProgress}, {filesUploaded} uploaded of {filesTotal}, {filesWithErrors} failed",
847
+ * done: "All {filesTotal} added successfully",
848
+ * doneWithErrors: "Action completed, {filesUploaded} has been added successfully, {filesWithErrors} had errors",
849
+ * files: "tiedostoa",
850
+ * file: "tiedosto",
851
+ * },
852
+ * }
427
853
  */
428
854
  this.statusLabelDefaults = {
429
855
  fi: {
@@ -456,8 +882,7 @@ let DuetUpload = class {
456
882
  */
457
883
  this.statusMessageLabel = getLocaleString(this.statusLabelDefaults);
458
884
  /**
459
- * Property to change descriptionDefaults defaults on the component.
460
- * normally you would handle these strings on an application level and override @label when needed
885
+ * Property to change button label defaults on the component.
461
886
  * @default {
462
887
  fi: "Lisää liite",
463
888
  sv: "Lägg till en bilaga",
@@ -475,7 +900,7 @@ let DuetUpload = class {
475
900
  */
476
901
  this.buttonLabel = getLocaleString(this.buttonLabelDefaults);
477
902
  /**
478
- * accessible Label of button
903
+ * accessible aria-Label of button
479
904
  */
480
905
  this.accessibleButtonLabel = undefined;
481
906
  /**
@@ -498,6 +923,10 @@ let DuetUpload = class {
498
923
  * browser from displaying its own validation errors.
499
924
  */
500
925
  this.required = false;
926
+ /**
927
+ * Key used to set vertical alignment of action buttons
928
+ */
929
+ this.alignment = "middle";
501
930
  /**
502
931
  * Visually hides the groups labels in the editable table list used to display the list of files
503
932
  */
@@ -507,7 +936,7 @@ let DuetUpload = class {
507
936
  */
508
937
  this.files = new Map();
509
938
  /**
510
- * Property to read if filelist contains errors or not
939
+ * Property to read if the internally used editable-table contains errors or not
511
940
  */
512
941
  this.valid = !this.required;
513
942
  /**
@@ -527,7 +956,6 @@ let DuetUpload = class {
527
956
  this.label = getLocaleString(this.labelDefaults);
528
957
  /**
529
958
  * Property to change descriptionDefaults defaults on the component.
530
- * normally you would handle these strings on an application level and override @label when needed
531
959
  * @default {
532
960
  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.",
533
961
  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.",
@@ -601,7 +1029,6 @@ let DuetUpload = class {
601
1029
  * by default this is off, setting this to true will limit the users choices to what has been explicitly set
602
1030
  */
603
1031
  this.limitSelection = false;
604
- //region Private functions
605
1032
  /**
606
1033
  * Private functions
607
1034
  */
@@ -699,7 +1126,6 @@ let DuetUpload = class {
699
1126
  }
700
1127
  };
701
1128
  this.updateProgress = (ev, name) => {
702
- console.log(this.filesInProgress.size);
703
1129
  const updateProgressHelper = percentComplete => {
704
1130
  this.updateValueInMap(name, "progress", percentComplete);
705
1131
  this.onProgress(name, percentComplete, ev);
@@ -743,6 +1169,10 @@ let DuetUpload = class {
743
1169
  * We reset the form fields to always be able to re-upload files
744
1170
  * and because we handle all uploads and states internally in the component (not relying on native form elements)
745
1171
  */
1172
+ /* TODO: it may be a good idea to just update the list so that this always matches what is in the files map,
1173
+ * 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
1174
+ * TODO: but for now we'll just reset the form fields
1175
+ */
746
1176
  this.nativeInput.value = "";
747
1177
  };
748
1178
  this.startUpload = async (ev, metaData = undefined) => {
@@ -754,8 +1184,6 @@ let DuetUpload = class {
754
1184
  ev.preventDefault();
755
1185
  return;
756
1186
  };
757
- //endregion
758
- //region Eventlisteners for the XHR requests
759
1187
  /**
760
1188
  * Eventlisteners for the XHR requests
761
1189
  */
@@ -884,11 +1312,16 @@ let DuetUpload = class {
884
1312
  this.kick();
885
1313
  }
886
1314
  }
887
- //endregion
888
1315
  /**
889
1316
  * Component lifecycle events.
890
1317
  */
891
1318
  componentWillLoad() {
1319
+ if (typeof this.statusMessageLabel === "string") {
1320
+ this.internalStatusMessageLabel = sanitizeString(this.groups);
1321
+ }
1322
+ else {
1323
+ this.internalStatusMessageLabel = this.statusMessageLabel;
1324
+ }
892
1325
  inheritGlobalTheme(this);
893
1326
  this.listenForActionEvents();
894
1327
  }
@@ -896,8 +1329,6 @@ let DuetUpload = class {
896
1329
  // listen to the events from the component
897
1330
  this.verifyValidity();
898
1331
  }
899
- //endregion
900
- //region XHR requests
901
1332
  /**
902
1333
  * XHR request utilities
903
1334
  */
@@ -945,8 +1376,6 @@ let DuetUpload = class {
945
1376
  onProgress: this.trackProgress,
946
1377
  });
947
1378
  }
948
- //endregion
949
- //region EventHandlers
950
1379
  /**
951
1380
  * Component event handling.
952
1381
  */
@@ -1021,7 +1450,6 @@ let DuetUpload = class {
1021
1450
  component: "duet-upload",
1022
1451
  });
1023
1452
  }
1024
- //endregion
1025
1453
  /**
1026
1454
  * Sets focus on the specified `duet-input`. Use this method instead of the global
1027
1455
  * `input.focus()`.
@@ -1051,7 +1479,7 @@ let DuetUpload = class {
1051
1479
  return this.getFilesAsArray();
1052
1480
  }
1053
1481
  /**
1054
- * Convenience method for updating a of an item in the files attribute
1482
+ * Convenience method for updating the value of a key:value inside an item in the files attribute
1055
1483
  */
1056
1484
  async updateValue(item, key, value) {
1057
1485
  this.updateValueInMap(item, key, value);
@@ -1069,7 +1497,7 @@ let DuetUpload = class {
1069
1497
  "duet-upload-filelist-empty": !this.files.size,
1070
1498
  "duet-upload-filelist": true,
1071
1499
  "duet-upload-filelist-filled": this.files.size,
1072
- }, id: this.labelId, for: identifier }, this.fileListEmpty)), !!this.files.size && h("slot", { name: "fileheader" }), !!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.statusMessageLabel })), !!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() })), !!this.files.size && h("slot", { name: "filefooter" }), h("duet-spacer", { size: "large" }), !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)), h("duet-spacer", { size: "medium" }), (this.fileMaxReached || this.bytesMaxReached) && (h("duet-alert", null, this.fileMaxReached && getI18nError("duet-upload-301"), this.bytesMaxReached && getI18nError("duet-upload-202"))), h("duet-spacer", { size: "medium" }), h("duet-visually-hidden", null, h("input", { ref: input => {
1500
+ }, id: this.labelId, for: identifier }, this.fileListEmpty)), !!this.files.size && h("slot", { name: "fileheader" }), !!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 })), !!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() })), !!this.files.size && h("slot", { name: "filefooter" }), h("duet-spacer", { size: "large" }), !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)), h("duet-spacer", { size: "medium" }), (this.fileMaxReached || this.bytesMaxReached) && (h("duet-alert", null, this.fileMaxReached && getI18nError("duet-upload-301"), this.bytesMaxReached && getI18nError("duet-upload-202"))), h("duet-spacer", { size: "medium" }), h("duet-visually-hidden", null, h("input", { ref: input => {
1073
1501
  this.nativeInput = input;
1074
1502
  }, accept: !this.limitSelection ? undefined : `${this.allowedMimetypes},${this.allowedExtensions}`, onBlur: this.onBlur, onFocus: this.onFocus, onChange: e => this.onChange(e), type: "file", class: {
1075
1503
  "duet-upload": true,
@@ -1082,4 +1510,4 @@ let DuetUpload = class {
1082
1510
  };
1083
1511
  DuetUpload.style = duetUploadCss;
1084
1512
 
1085
- export { DuetUpload as duet_upload };
1513
+ export { DuetEditableTable as duet_editable_table, DuetEditableTableItem as duet_editable_table_item, DuetTable as duet_table, DuetUpload as duet_upload };
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Built with Duet Design System
3
3
  */
4
- import { r as registerInstance, h, H as Host } from './index-84d97bd1.js';
4
+ import { r as registerInstance, h, H as Host } from './index-f813a624.js';
5
5
  import { i as inheritGlobalTheme } from './themeable-component-572685dd.js';
6
6
 
7
7
  const duetEmptyStateCss = "*,*::after,*::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}:host{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:block;width:100%;height:100%}.duet-empty-state{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;width:100%;height:100%;padding:48px;color:#00294d;text-align:center;background:#f5f8fa;border-radius:4px}.duet-empty-state.duet-theme-turva{color:#171c3a;background:#f5f5f7}";