@duetds/components 4.30.0 → 4.33.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 (424) hide show
  1. package/hydrate/index.js +1481 -434
  2. package/lib/cjs/{dom-e89ebf90.js → dom-c850c8d7.js} +1 -1
  3. package/lib/cjs/duet-alert.cjs.entry.js +4 -2
  4. package/lib/cjs/duet-badge.cjs.entry.js +2 -2
  5. package/lib/cjs/duet-button_2.cjs.entry.js +6 -5
  6. package/lib/cjs/duet-caption_4.cjs.entry.js +21 -15
  7. package/lib/cjs/duet-card.cjs.entry.js +6 -6
  8. package/lib/cjs/duet-checkbox.cjs.entry.js +2 -2
  9. package/lib/cjs/duet-choice_2.cjs.entry.js +56 -25
  10. package/lib/cjs/duet-collapsible.cjs.entry.js +5 -2
  11. package/lib/cjs/duet-cookie-consent.cjs.entry.js +1 -1
  12. package/lib/cjs/duet-date-picker.cjs.entry.js +23 -13
  13. package/lib/cjs/duet-divider_2.cjs.entry.js +1 -1
  14. package/lib/cjs/duet-editable-table-button_3.cjs.entry.js +232 -0
  15. package/lib/cjs/{duet-table.cjs.entry.js → duet-editable-table_3.cjs.entry.js} +206 -2
  16. package/lib/cjs/duet-empty-state.cjs.entry.js +1 -1
  17. package/lib/cjs/duet-footer.cjs.entry.js +4 -4
  18. package/lib/cjs/duet-grid_2.cjs.entry.js +52 -4
  19. package/lib/cjs/duet-header_2.cjs.entry.js +26 -10
  20. package/lib/cjs/duet-hero.cjs.entry.js +6 -6
  21. package/lib/cjs/duet-icon.cjs.entry.js +6 -14
  22. package/lib/cjs/duet-input_2.cjs.entry.js +7 -7
  23. package/lib/cjs/duet-layout.cjs.entry.js +1 -1
  24. package/lib/cjs/duet-list_2.cjs.entry.js +2 -2
  25. package/lib/cjs/duet-modal.cjs.entry.js +8 -7
  26. package/lib/cjs/duet-notification_2.cjs.entry.js +6 -5
  27. package/lib/cjs/duet-number-input.cjs.entry.js +36 -15
  28. package/lib/cjs/duet-progress.cjs.entry.js +75 -0
  29. package/lib/cjs/duet-radio_2.cjs.entry.js +2 -2
  30. package/lib/cjs/duet-range-slider.cjs.entry.js +2 -2
  31. package/lib/cjs/duet-select.cjs.entry.js +6 -6
  32. package/lib/cjs/duet-step_2.cjs.entry.js +1 -1
  33. package/lib/cjs/duet-tab_2.cjs.entry.js +12 -6
  34. package/lib/cjs/duet-textarea.cjs.entry.js +5 -5
  35. package/lib/cjs/duet-toggle.cjs.entry.js +1 -1
  36. package/lib/cjs/duet-tooltip.cjs.entry.js +21 -10
  37. package/lib/cjs/duet-tray.cjs.entry.js +21 -10
  38. package/lib/cjs/duet-upload.cjs.entry.js +403 -180
  39. package/lib/cjs/duet-visually-hidden.cjs.entry.js +1 -1
  40. package/lib/cjs/duet.cjs.js +4 -4
  41. package/lib/cjs/{focus-utils-7605778f.js → focus-utils-a7a1fb8b.js} +1 -1
  42. package/lib/cjs/{index-0c949193.js → index-b724d698.js} +88 -77
  43. package/lib/cjs/js-utils-33a9dbe3.js +16 -0
  44. package/lib/cjs/{language-utils-70d6a9a4.js → language-utils-aa282901.js} +28 -9
  45. package/lib/cjs/loader.cjs.js +3 -3
  46. package/lib/cjs/{shadow-css-0c8c175b.js → shadow-css-e3edeed1.js} +9 -10
  47. package/lib/cjs/{string-utils-a6de43d8.js → string-utils-267e3dbb.js} +7 -0
  48. package/lib/cjs/{token-utils-13e5d13e.js → token-utils-63a9c8dc.js} +1 -1
  49. package/lib/cjs/{tokens.module-53b3bd92.js → tokens.module-6b2df1c2.js} +2 -0
  50. package/lib/cjs/{watch-options-3877c082.js → watch-options-d88afac0.js} +29 -6
  51. package/lib/collection/collection-manifest.json +15 -8
  52. package/lib/collection/components/duet-alert/duet-alert.js +12 -6
  53. package/lib/collection/components/duet-badge/duet-badge.css +1 -0
  54. package/lib/collection/components/duet-button/duet-button.js +17 -15
  55. package/lib/collection/components/duet-card/duet-card.css +30 -7
  56. package/lib/collection/components/duet-card/duet-card.js +4 -3
  57. package/lib/collection/components/duet-checkbox/duet-checkbox.css +1 -1
  58. package/lib/collection/components/duet-choice/duet-choice.css +16 -3
  59. package/lib/collection/components/duet-choice/duet-choice.js +123 -36
  60. package/lib/collection/components/duet-choice-group/duet-choice-group.css +1 -0
  61. package/lib/collection/components/duet-choice-group/duet-choice-group.js +4 -4
  62. package/lib/collection/components/duet-date-picker/duet-date-picker.css +1 -1
  63. package/lib/collection/components/duet-date-picker/duet-date-picker.js +78 -43
  64. package/lib/collection/components/duet-editable-table/duet-editable-table-button.css +32 -0
  65. package/lib/collection/components/duet-editable-table/duet-editable-table-button.js +218 -0
  66. package/lib/collection/components/duet-editable-table/duet-editable-table-item.css +36 -0
  67. package/lib/collection/components/duet-editable-table/duet-editable-table-item.js +203 -0
  68. package/lib/collection/components/duet-editable-table/duet-editable-table-tabledata.js +13 -0
  69. package/lib/collection/components/duet-editable-table/duet-editable-table.css +16 -0
  70. package/lib/collection/components/duet-editable-table/duet-editable-table.js +348 -0
  71. package/lib/collection/components/duet-footer/duet-footer.js +17 -15
  72. package/lib/collection/components/duet-grid/duet-grid.js +57 -6
  73. package/lib/collection/components/duet-grid-item/duet-grid-item.js +4 -4
  74. package/lib/collection/components/duet-header/duet-header.js +60 -35
  75. package/lib/collection/components/duet-heading/duet-heading.css +4 -0
  76. package/lib/collection/components/duet-heading/duet-heading.js +7 -6
  77. package/lib/collection/components/duet-hero/duet-hero.js +20 -15
  78. package/lib/collection/components/duet-icon/duet-icon.js +2 -6
  79. package/lib/collection/components/duet-icon/icon-utils.js +5 -8
  80. package/lib/collection/components/duet-input/duet-input.css +15 -0
  81. package/lib/collection/components/duet-input/duet-input.js +4 -4
  82. package/lib/collection/components/duet-label/duet-label.css +2 -0
  83. package/lib/collection/components/duet-link/duet-link.js +18 -19
  84. package/lib/collection/components/duet-logo/duet-logo.js +4 -4
  85. package/lib/collection/components/duet-modal/duet-modal.js +22 -17
  86. package/lib/collection/components/duet-notification/duet-notification.js +8 -8
  87. package/lib/collection/components/duet-notification-drawer/duet-notification-drawer.js +20 -15
  88. package/lib/collection/components/duet-number-input/duet-number-input.js +153 -29
  89. package/lib/collection/components/duet-paragraph/duet-paragraph.css +6 -0
  90. package/lib/collection/components/duet-paragraph/duet-paragraph.js +34 -3
  91. package/lib/collection/components/duet-progress/duet-progress.css +103 -0
  92. package/lib/collection/components/duet-progress/duet-progress.js +240 -0
  93. package/lib/collection/components/duet-radio/duet-radio.js +6 -6
  94. package/lib/collection/components/duet-select/duet-select.css +15 -0
  95. package/lib/collection/components/duet-select/duet-select.js +3 -3
  96. package/lib/collection/components/duet-step/duet-step.js +8 -8
  97. package/lib/collection/components/duet-tab-group/duet-tab-group.css +2 -2
  98. package/lib/collection/components/duet-tab-group/duet-tab-group.js +43 -12
  99. package/lib/collection/components/duet-textarea/duet-textarea.css +19 -0
  100. package/lib/collection/components/duet-textarea/duet-textarea.js +5 -4
  101. package/lib/collection/components/duet-tooltip/duet-tooltip.js +82 -20
  102. package/lib/collection/components/duet-tray/duet-tray.js +79 -17
  103. package/lib/collection/components/duet-upload/duet-upload-aria-status.js +217 -0
  104. package/lib/collection/components/duet-upload/duet-upload-editable-item-error.js +16 -0
  105. package/lib/collection/components/duet-upload/duet-upload-editable-item-inprogres.js +8 -0
  106. package/lib/collection/components/duet-upload/duet-upload-editable-item-success.js +30 -0
  107. package/lib/collection/components/duet-upload/duet-upload.css +17 -86
  108. package/lib/collection/components/duet-upload/duet-upload.js +551 -153
  109. package/lib/collection/components/duet-upload/errorcodes.utils.js +16 -4
  110. package/lib/collection/components/duet-upload/xhr.helpers.js +2 -6
  111. package/lib/collection/utils/fixture-utils.js +7 -5
  112. package/lib/collection/utils/js-utils.js +12 -0
  113. package/lib/collection/utils/language-utils.js +26 -9
  114. package/lib/collection/utils/string-utils.js +6 -0
  115. package/lib/collection/utils/watch-options.js +35 -6
  116. package/lib/custom-elements-bundle/index.d.ts +30 -0
  117. package/lib/custom-elements-bundle/index.js +1603 -721
  118. package/lib/duet/duet.esm.js +1 -1
  119. package/lib/duet/duet.js +1 -1
  120. package/lib/duet/{p-4a7911fd.entry.js → p-00735436.entry.js} +1 -1
  121. package/lib/duet/p-060d79be.entry.js +4 -0
  122. package/lib/duet/p-0d22396e.system.js +16 -0
  123. package/lib/duet/p-10deead0.system.js +4 -0
  124. package/lib/duet/p-1208c84f.entry.js +4 -0
  125. package/lib/duet/p-12721178.js +4 -0
  126. package/lib/duet/p-155ef581.system.entry.js +4 -0
  127. package/lib/duet/p-16c48c5d.entry.js +4 -0
  128. package/lib/duet/p-1797df7b.system.entry.js +4 -0
  129. package/lib/duet/p-1a08fc22.system.entry.js +4 -0
  130. package/lib/duet/{p-d1817efe.system.entry.js → p-237e47b4.system.entry.js} +1 -1
  131. package/lib/duet/p-2443bdca.system.entry.js +4 -0
  132. package/lib/duet/p-263bc9cd.system.entry.js +4 -0
  133. package/lib/duet/p-2764f081.js +4 -0
  134. package/lib/duet/p-27d80cef.system.entry.js +4 -0
  135. package/lib/duet/p-28e02c08.entry.js +4 -0
  136. package/lib/duet/{p-f81d8534.entry.js → p-2bb1460c.entry.js} +1 -1
  137. package/lib/duet/p-33c58756.entry.js +4 -0
  138. package/lib/duet/{p-bd9a7d8f.js → p-35a3794e.js} +0 -0
  139. package/lib/duet/{p-bbc229d8.system.entry.js → p-374fb7e6.system.entry.js} +1 -1
  140. package/lib/duet/p-387823af.system.entry.js +4 -0
  141. package/lib/duet/p-3af5d66f.entry.js +4 -0
  142. package/lib/duet/{p-322d1c38.js → p-3c1971d8.js} +1 -1
  143. package/lib/duet/{p-7e108b7e.entry.js → p-4607af59.entry.js} +1 -1
  144. package/lib/duet/p-48d1eb1f.system.entry.js +4 -0
  145. package/lib/duet/p-4a87e9ab.system.entry.js +4 -0
  146. package/lib/duet/{p-031c2cd8.system.entry.js → p-4b6ebe40.system.entry.js} +1 -1
  147. package/lib/duet/p-4e28da18.system.entry.js +4 -0
  148. package/lib/duet/p-548d484e.js +4 -0
  149. package/lib/duet/p-5826523b.entry.js +4 -0
  150. package/lib/duet/{p-ce1374a4.system.entry.js → p-58750bae.system.entry.js} +1 -1
  151. package/lib/duet/p-597d99c7.entry.js +4 -0
  152. package/lib/duet/p-5ea0cd19.entry.js +4 -0
  153. package/lib/duet/p-63d5bf73.system.entry.js +4 -0
  154. package/lib/duet/p-67d9a9a9.system.entry.js +4 -0
  155. package/lib/duet/p-6a19b5ec.entry.js +4 -0
  156. package/lib/duet/p-6cc3be76.system.entry.js +4 -0
  157. package/lib/duet/p-6e363557.system.js +4 -0
  158. package/lib/duet/p-6e6e76db.system.entry.js +4 -0
  159. package/lib/duet/p-70fafc98.system.js +4 -0
  160. package/lib/duet/p-7368b14e.system.entry.js +4 -0
  161. package/lib/duet/p-751542a0.system.entry.js +4 -0
  162. package/lib/duet/p-794659ac.entry.js +4 -0
  163. package/lib/duet/p-7e8d5bb9.system.entry.js +4 -0
  164. package/lib/duet/p-7fee0d23.system.entry.js +4 -0
  165. package/lib/duet/p-81867417.system.js +4 -0
  166. package/lib/duet/p-86daec1c.entry.js +4 -0
  167. package/lib/duet/{p-4265de16.system.entry.js → p-8b5ca0e7.system.entry.js} +1 -1
  168. package/lib/duet/{p-66dde4d2.entry.js → p-8cb7416d.entry.js} +1 -1
  169. package/lib/duet/p-8f826843.system.entry.js +4 -0
  170. package/lib/duet/p-94169303.entry.js +4 -0
  171. package/lib/duet/{p-36007600.entry.js → p-9481e312.entry.js} +1 -1
  172. package/lib/duet/{p-f82709ba.entry.js → p-984576c9.entry.js} +1 -1
  173. package/lib/duet/p-986779fb.js +4 -0
  174. package/lib/duet/p-987edcd0.js +15 -0
  175. package/lib/duet/{p-35e45c19.system.js → p-9a945278.system.js} +1 -1
  176. package/lib/duet/p-9d73343a.entry.js +4 -0
  177. package/lib/duet/{p-e26116e0.system.entry.js → p-9dca5c22.system.entry.js} +1 -1
  178. package/lib/duet/p-a207b008.entry.js +4 -0
  179. package/lib/duet/p-a5b9c192.system.entry.js +4 -0
  180. package/lib/duet/p-a6a84ec6.entry.js +4 -0
  181. package/lib/duet/{p-2d2c45f9.entry.js → p-a890da72.entry.js} +1 -1
  182. package/lib/duet/p-a9859a82.entry.js +4 -0
  183. package/lib/duet/p-aba68b7b.entry.js +4 -0
  184. package/lib/duet/p-acc57c77.entry.js +4 -0
  185. package/lib/duet/{p-2826f987.js → p-ad07f399.js} +1 -1
  186. package/lib/duet/p-aee24388.system.entry.js +4 -0
  187. package/lib/duet/p-aef1b720.system.entry.js +4 -0
  188. package/lib/duet/{p-62806bb6.system.entry.js → p-af41d894.system.entry.js} +1 -1
  189. package/lib/duet/p-b25d3769.js +4 -0
  190. package/lib/duet/{p-dee41056.system.entry.js → p-b32224fe.system.entry.js} +1 -1
  191. package/lib/duet/p-b3744481.entry.js +4 -0
  192. package/lib/duet/{p-de2be65b.system.js → p-b42d81c3.system.js} +1 -1
  193. package/lib/duet/{p-27d538f7.system.entry.js → p-b4e87f02.system.entry.js} +1 -1
  194. package/lib/duet/{p-f71f12ed.entry.js → p-bf93a991.entry.js} +1 -1
  195. package/lib/duet/{p-fd98468a.system.js → p-c18a599e.system.js} +0 -0
  196. package/lib/duet/p-c2e77278.entry.js +4 -0
  197. package/lib/duet/p-c34329f3.entry.js +4 -0
  198. package/lib/duet/{p-59a07cf9.entry.js → p-c36b4da0.entry.js} +1 -1
  199. package/lib/duet/{p-a321a98c.entry.js → p-cdd70b93.entry.js} +1 -1
  200. package/lib/duet/p-d1c19f04.system.entry.js +4 -0
  201. package/lib/duet/{p-f71e337e.system.entry.js → p-d3a3c3c7.system.entry.js} +1 -1
  202. package/lib/duet/{p-345ea4f2.system.entry.js → p-d4118b6e.system.entry.js} +1 -1
  203. package/lib/duet/{p-3dc9d15d.system.entry.js → p-d744d188.system.entry.js} +1 -1
  204. package/lib/duet/p-ddb6344c.system.js +4 -0
  205. package/lib/duet/p-de07c7d7.entry.js +4 -0
  206. package/lib/duet/p-dfe79666.system.entry.js +4 -0
  207. package/lib/duet/p-e12f2b8b.system.js +4 -0
  208. package/lib/duet/p-e2a44156.js +4 -0
  209. package/lib/duet/p-e76b722f.entry.js +4 -0
  210. package/lib/duet/p-e964d062.entry.js +4 -0
  211. package/lib/duet/p-eb55ccd2.system.js +4 -0
  212. package/lib/duet/p-f0a4b68d.system.entry.js +4 -0
  213. package/lib/duet/p-f364eb96.entry.js +4 -0
  214. package/lib/duet/{p-a88df408.entry.js → p-f8ce39fb.entry.js} +1 -1
  215. package/lib/esm/{dom-21034390.js → dom-58cd15f6.js} +1 -1
  216. package/lib/esm/duet-alert.entry.js +4 -2
  217. package/lib/esm/duet-badge.entry.js +2 -2
  218. package/lib/esm/duet-button_2.entry.js +6 -5
  219. package/lib/esm/duet-caption_4.entry.js +21 -15
  220. package/lib/esm/duet-card.entry.js +6 -6
  221. package/lib/esm/duet-checkbox.entry.js +2 -2
  222. package/lib/esm/duet-choice_2.entry.js +57 -26
  223. package/lib/esm/duet-collapsible.entry.js +5 -2
  224. package/lib/esm/duet-cookie-consent.entry.js +1 -1
  225. package/lib/esm/duet-date-picker.entry.js +23 -13
  226. package/lib/esm/duet-divider_2.entry.js +1 -1
  227. package/lib/esm/duet-editable-table-button_3.entry.js +226 -0
  228. package/lib/esm/{duet-table.entry.js → duet-editable-table_3.entry.js} +205 -3
  229. package/lib/esm/duet-empty-state.entry.js +1 -1
  230. package/lib/esm/duet-footer.entry.js +4 -4
  231. package/lib/esm/duet-grid_2.entry.js +52 -4
  232. package/lib/esm/duet-header_2.entry.js +26 -10
  233. package/lib/esm/duet-hero.entry.js +6 -6
  234. package/lib/esm/duet-icon.entry.js +6 -14
  235. package/lib/esm/duet-input_2.entry.js +7 -7
  236. package/lib/esm/duet-layout.entry.js +1 -1
  237. package/lib/esm/duet-list_2.entry.js +2 -2
  238. package/lib/esm/duet-modal.entry.js +8 -7
  239. package/lib/esm/duet-notification_2.entry.js +6 -5
  240. package/lib/esm/duet-number-input.entry.js +36 -15
  241. package/lib/esm/duet-progress.entry.js +71 -0
  242. package/lib/esm/duet-radio_2.entry.js +2 -2
  243. package/lib/esm/duet-range-slider.entry.js +2 -2
  244. package/lib/esm/duet-select.entry.js +6 -6
  245. package/lib/esm/duet-step_2.entry.js +1 -1
  246. package/lib/esm/duet-tab_2.entry.js +12 -6
  247. package/lib/esm/duet-textarea.entry.js +5 -5
  248. package/lib/esm/duet-toggle.entry.js +1 -1
  249. package/lib/esm/duet-tooltip.entry.js +21 -10
  250. package/lib/esm/duet-tray.entry.js +21 -10
  251. package/lib/esm/duet-upload.entry.js +403 -180
  252. package/lib/esm/duet-visually-hidden.entry.js +1 -1
  253. package/lib/esm/duet.js +4 -4
  254. package/lib/esm/{focus-utils-0b12f0df.js → focus-utils-1fe0dcd0.js} +1 -1
  255. package/lib/esm/{index-f70ddc7f.js → index-84d97bd1.js} +88 -78
  256. package/lib/esm/js-utils-b69f17df.js +14 -0
  257. package/lib/esm/{language-utils-ab9c3afc.js → language-utils-344d894c.js} +28 -10
  258. package/lib/esm/loader.js +3 -3
  259. package/lib/esm/{shadow-css-31e2d504.js → shadow-css-7c726abb.js} +9 -10
  260. package/lib/esm/{string-utils-69cf0d09.js → string-utils-2f1793b8.js} +7 -1
  261. package/lib/esm/{token-utils-5a35377f.js → token-utils-590d9413.js} +1 -1
  262. package/lib/esm/{tokens.module-edb66c04.js → tokens.module-49cbf963.js} +3 -1
  263. package/lib/esm/watch-options-dd55bce8.js +57 -0
  264. package/lib/esm-es5/{dom-21034390.js → dom-58cd15f6.js} +0 -0
  265. package/lib/esm-es5/duet-alert.entry.js +1 -1
  266. package/lib/esm-es5/duet-badge.entry.js +1 -1
  267. package/lib/esm-es5/duet-button_2.entry.js +1 -1
  268. package/lib/esm-es5/duet-caption_4.entry.js +2 -2
  269. package/lib/esm-es5/duet-card.entry.js +1 -1
  270. package/lib/esm-es5/duet-checkbox.entry.js +1 -1
  271. package/lib/esm-es5/duet-choice_2.entry.js +2 -2
  272. package/lib/esm-es5/duet-collapsible.entry.js +1 -1
  273. package/lib/esm-es5/duet-cookie-consent.entry.js +1 -1
  274. package/lib/esm-es5/duet-date-picker.entry.js +1 -1
  275. package/lib/esm-es5/duet-divider_2.entry.js +1 -1
  276. package/lib/esm-es5/duet-editable-table-button_3.entry.js +4 -0
  277. package/lib/esm-es5/duet-editable-table_3.entry.js +4 -0
  278. package/lib/esm-es5/duet-empty-state.entry.js +1 -1
  279. package/lib/esm-es5/duet-footer.entry.js +1 -1
  280. package/lib/esm-es5/duet-grid_2.entry.js +2 -2
  281. package/lib/esm-es5/duet-header_2.entry.js +1 -1
  282. package/lib/esm-es5/duet-hero.entry.js +1 -1
  283. package/lib/esm-es5/duet-icon.entry.js +2 -2
  284. package/lib/esm-es5/duet-input_2.entry.js +1 -1
  285. package/lib/esm-es5/duet-layout.entry.js +1 -1
  286. package/lib/esm-es5/duet-list_2.entry.js +1 -1
  287. package/lib/esm-es5/duet-modal.entry.js +1 -1
  288. package/lib/esm-es5/duet-notification_2.entry.js +1 -1
  289. package/lib/esm-es5/duet-number-input.entry.js +2 -2
  290. package/lib/esm-es5/duet-progress.entry.js +4 -0
  291. package/lib/esm-es5/duet-radio_2.entry.js +1 -1
  292. package/lib/esm-es5/duet-range-slider.entry.js +1 -1
  293. package/lib/esm-es5/duet-select.entry.js +1 -1
  294. package/lib/esm-es5/duet-step_2.entry.js +1 -1
  295. package/lib/esm-es5/duet-tab_2.entry.js +2 -2
  296. package/lib/esm-es5/duet-textarea.entry.js +1 -1
  297. package/lib/esm-es5/duet-toggle.entry.js +1 -1
  298. package/lib/esm-es5/duet-tooltip.entry.js +1 -1
  299. package/lib/esm-es5/duet-tray.entry.js +1 -1
  300. package/lib/esm-es5/duet-upload.entry.js +2 -2
  301. package/lib/esm-es5/duet-visually-hidden.entry.js +1 -1
  302. package/lib/esm-es5/duet.js +1 -1
  303. package/lib/esm-es5/{focus-utils-0b12f0df.js → focus-utils-1fe0dcd0.js} +1 -1
  304. package/lib/esm-es5/index-84d97bd1.js +4 -0
  305. package/lib/esm-es5/js-utils-b69f17df.js +4 -0
  306. package/lib/esm-es5/language-utils-344d894c.js +4 -0
  307. package/lib/esm-es5/loader.js +1 -1
  308. package/lib/esm-es5/shadow-css-7c726abb.js +15 -0
  309. package/lib/esm-es5/{string-utils-69cf0d09.js → string-utils-2f1793b8.js} +1 -1
  310. package/lib/esm-es5/{token-utils-5a35377f.js → token-utils-590d9413.js} +1 -1
  311. package/lib/esm-es5/tokens.module-49cbf963.js +4 -0
  312. package/lib/esm-es5/watch-options-dd55bce8.js +4 -0
  313. package/lib/types/components/duet-alert/duet-alert.d.ts +2 -1
  314. package/lib/types/components/duet-button/duet-button.d.ts +1 -1
  315. package/lib/types/components/duet-choice/duet-choice.d.ts +24 -5
  316. package/lib/types/components/duet-date-picker/duet-date-picker.d.ts +15 -9
  317. package/lib/types/components/duet-editable-table/duet-editable-table-button.d.ts +72 -0
  318. package/lib/types/components/duet-editable-table/duet-editable-table-item.d.ts +72 -0
  319. package/lib/types/components/duet-editable-table/duet-editable-table-tabledata.d.ts +7 -0
  320. package/lib/types/components/duet-editable-table/duet-editable-table.d.ts +84 -0
  321. package/lib/types/components/duet-footer/duet-footer.d.ts +1 -1
  322. package/lib/types/components/duet-grid/duet-grid.d.ts +16 -2
  323. package/lib/types/components/duet-header/duet-header.d.ts +21 -5
  324. package/lib/types/components/duet-heading/duet-heading.d.ts +2 -2
  325. package/lib/types/components/duet-hero/duet-hero.d.ts +3 -3
  326. package/lib/types/components/duet-icon/duet-icon.d.ts +1 -1
  327. package/lib/types/components/duet-link/duet-link.d.ts +2 -3
  328. package/lib/types/components/duet-modal/duet-modal.d.ts +3 -3
  329. package/lib/types/components/duet-notification-drawer/duet-notification-drawer.d.ts +3 -3
  330. package/lib/types/components/duet-number-input/duet-number-input.d.ts +21 -0
  331. package/lib/types/components/duet-paragraph/duet-paragraph.d.ts +9 -1
  332. package/lib/types/components/duet-progress/duet-progress.d.ts +64 -0
  333. package/lib/types/components/duet-tab-group/duet-tab-group.d.ts +6 -0
  334. package/lib/types/components/duet-tooltip/duet-tooltip.d.ts +11 -0
  335. package/lib/types/components/duet-tray/duet-tray.d.ts +11 -0
  336. package/lib/types/components/duet-upload/duet-upload-aria-status.d.ts +49 -0
  337. package/lib/types/components/duet-upload/duet-upload-editable-item-error.d.ts +7 -0
  338. package/lib/types/components/duet-upload/duet-upload-editable-item-inprogres.d.ts +7 -0
  339. package/lib/types/components/duet-upload/duet-upload-editable-item-success.d.ts +8 -0
  340. package/lib/types/components/duet-upload/duet-upload.d.ts +94 -25
  341. package/lib/types/components/duet-upload/errorcodes.utils.d.ts +1 -0
  342. package/lib/types/components/duet-upload/xhr.helpers.d.ts +7 -1
  343. package/lib/types/components.d.ts +611 -79
  344. package/lib/types/utils/js-utils.d.ts +1 -0
  345. package/lib/types/utils/language-utils.d.ts +8 -3
  346. package/lib/types/utils/string-utils.d.ts +1 -0
  347. package/lib/types/utils/watch-options.d.ts +2 -0
  348. package/package.json +19 -15
  349. package/hydrate/package.json +0 -6
  350. package/lib/cjs/duet-fieldset.cjs.entry.js +0 -62
  351. package/lib/collection/components/duet-upload/duet-upload-file-list.js +0 -49
  352. package/lib/duet/p-0733c303.system.entry.js +0 -4
  353. package/lib/duet/p-095060cc.js +0 -4
  354. package/lib/duet/p-156864a1.system.entry.js +0 -4
  355. package/lib/duet/p-15c15c6a.js +0 -15
  356. package/lib/duet/p-1911dfe7.system.entry.js +0 -4
  357. package/lib/duet/p-1c41525a.entry.js +0 -4
  358. package/lib/duet/p-1cfe38b1.system.entry.js +0 -4
  359. package/lib/duet/p-2834a302.entry.js +0 -4
  360. package/lib/duet/p-28a3d38f.system.entry.js +0 -4
  361. package/lib/duet/p-2a1a9f9f.entry.js +0 -4
  362. package/lib/duet/p-2a4d7c5b.system.entry.js +0 -4
  363. package/lib/duet/p-3eb36e3d.entry.js +0 -4
  364. package/lib/duet/p-4095dba5.entry.js +0 -4
  365. package/lib/duet/p-418b2ce7.system.js +0 -4
  366. package/lib/duet/p-4289b543.entry.js +0 -4
  367. package/lib/duet/p-43e39d98.system.js +0 -4
  368. package/lib/duet/p-46a3ae43.system.js +0 -4
  369. package/lib/duet/p-4a38cf9d.entry.js +0 -4
  370. package/lib/duet/p-4be8e814.entry.js +0 -4
  371. package/lib/duet/p-4dcea8fb.system.entry.js +0 -4
  372. package/lib/duet/p-591b2137.entry.js +0 -4
  373. package/lib/duet/p-5c5bdb06.system.entry.js +0 -4
  374. package/lib/duet/p-5f70e318.entry.js +0 -4
  375. package/lib/duet/p-62c294d6.system.entry.js +0 -4
  376. package/lib/duet/p-6a356ab1.system.js +0 -4
  377. package/lib/duet/p-6c2729da.js +0 -4
  378. package/lib/duet/p-6f107847.system.entry.js +0 -4
  379. package/lib/duet/p-77a5fe4c.system.js +0 -4
  380. package/lib/duet/p-7809e78b.system.entry.js +0 -4
  381. package/lib/duet/p-7a36d76f.system.entry.js +0 -4
  382. package/lib/duet/p-7ee52f58.entry.js +0 -4
  383. package/lib/duet/p-884693f1.entry.js +0 -4
  384. package/lib/duet/p-89db3b94.entry.js +0 -4
  385. package/lib/duet/p-8cfce39e.system.entry.js +0 -4
  386. package/lib/duet/p-8ffe1461.system.entry.js +0 -4
  387. package/lib/duet/p-9381c2d4.entry.js +0 -4
  388. package/lib/duet/p-9a450c9a.entry.js +0 -4
  389. package/lib/duet/p-9a89ec39.js +0 -4
  390. package/lib/duet/p-9bbfe606.system.entry.js +0 -4
  391. package/lib/duet/p-a6096b05.system.entry.js +0 -4
  392. package/lib/duet/p-a89d5d7c.entry.js +0 -4
  393. package/lib/duet/p-b07055fd.system.entry.js +0 -4
  394. package/lib/duet/p-b4374f0e.entry.js +0 -4
  395. package/lib/duet/p-b456d684.system.entry.js +0 -4
  396. package/lib/duet/p-bd18c93f.js +0 -4
  397. package/lib/duet/p-bddb1c15.system.entry.js +0 -4
  398. package/lib/duet/p-c0b95b58.entry.js +0 -4
  399. package/lib/duet/p-c3688975.entry.js +0 -4
  400. package/lib/duet/p-c4d183e6.entry.js +0 -4
  401. package/lib/duet/p-c9303f9a.entry.js +0 -4
  402. package/lib/duet/p-cd4e8ccf.js +0 -4
  403. package/lib/duet/p-ceb75b35.system.entry.js +0 -4
  404. package/lib/duet/p-cf243bcb.system.entry.js +0 -4
  405. package/lib/duet/p-d37c8a05.system.js +0 -4
  406. package/lib/duet/p-d989af11.entry.js +0 -4
  407. package/lib/duet/p-e58ca7af.system.js +0 -16
  408. package/lib/duet/p-e6128d82.system.entry.js +0 -4
  409. package/lib/duet/p-e86cdc17.entry.js +0 -4
  410. package/lib/duet/p-eadb29c7.entry.js +0 -4
  411. package/lib/duet/p-f30b14d6.system.entry.js +0 -4
  412. package/lib/duet/p-f79f8da1.entry.js +0 -4
  413. package/lib/duet/p-fc397e03.system.entry.js +0 -4
  414. package/lib/esm/duet-fieldset.entry.js +0 -58
  415. package/lib/esm/watch-options-de55ea78.js +0 -35
  416. package/lib/esm-es5/duet-fieldset.entry.js +0 -4
  417. package/lib/esm-es5/duet-table.entry.js +0 -4
  418. package/lib/esm-es5/index-f70ddc7f.js +0 -4
  419. package/lib/esm-es5/language-utils-ab9c3afc.js +0 -4
  420. package/lib/esm-es5/shadow-css-31e2d504.js +0 -15
  421. package/lib/esm-es5/tokens.module-edb66c04.js +0 -4
  422. package/lib/esm-es5/watch-options-de55ea78.js +0 -4
  423. package/lib/html.html-data.json +0 -4556
  424. package/lib/types/components/duet-upload/duet-upload-file-list.d.ts +0 -9
@@ -0,0 +1,226 @@
1
+ /*!
2
+ * Built with Duet Design System
3
+ */
4
+ import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-84d97bd1.js';
5
+ import { g as getLocaleString } from './language-utils-344d894c.js';
6
+ import { i as inheritGlobalTheme } from './themeable-component-572685dd.js';
7
+ import { g as getColorByName } from './token-utils-590d9413.js';
8
+ import { c as createID } from './create-id-981107da.js';
9
+ import './string-utils-2f1793b8.js';
10
+ import './tokens.module-49cbf963.js';
11
+
12
+ const duetEditableTableButtonCss = "*.sc-duet-editable-table-button,*.sc-duet-editable-table-button::after,*.sc-duet-editable-table-button::before{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none}.sc-duet-editable-table-button-h button.sc-duet-editable-table-button{display:flex;align-content:space-between;justify-content:center;min-width:32px;max-width:32px;height:100%;min-height:32px;max-height:32px;padding:0;margin:0;cursor:pointer !important;background-color:transparent;border:1px solid;border-radius:50%}.sc-duet-editable-table-button-h button.sc-duet-editable-table-button duet-icon.sc-duet-editable-table-button{align-self:center}";
13
+
14
+ let DuetEditableTableButton = class {
15
+ constructor(hostRef) {
16
+ registerInstance(this, hostRef);
17
+ this.duetEditableItemAction = createEvent(this, "duetEditableItemAction", 7);
18
+ this.isHovering = false;
19
+ /**
20
+ * Theme of the empty state component.
21
+ */
22
+ this.theme = "";
23
+ /**
24
+ * action items passed from host component
25
+ * @internal
26
+ */
27
+ this.actions = undefined;
28
+ /**
29
+ * uid that gets passed along when the action is emitted
30
+ * @internal
31
+ */
32
+ this.uid = "";
33
+ /**
34
+ * group associated with action
35
+ * @internal
36
+ */
37
+ this.group = "";
38
+ /**
39
+ * key of the item in the map
40
+ * @internal
41
+ */
42
+ this.keyName = "";
43
+ this.onMouseEnter = () => {
44
+ this.isHovering = true;
45
+ };
46
+ this.onMouseLeave = () => {
47
+ this.isHovering = false;
48
+ };
49
+ }
50
+ /**
51
+ /**
52
+ * Component lifecycle events.
53
+ */
54
+ componentWillLoad() {
55
+ inheritGlobalTheme(this);
56
+ }
57
+ /**
58
+ /**
59
+ * private functions
60
+ */
61
+ emitActionEvent(ev) {
62
+ this.duetEditableItemAction.emit({
63
+ originalEvent: ev,
64
+ uid: this.uid,
65
+ group: this.group,
66
+ action: this.actions.id,
67
+ keyName: this.keyName,
68
+ component: "duet-editable-table-item",
69
+ });
70
+ }
71
+ /**
72
+ * render() function
73
+ * Always the last one in the class.
74
+ */
75
+ render() {
76
+ return (h("button", { style: {
77
+ "border-color": this.isHovering
78
+ ? getColorByName(this.actions.color_hover)
79
+ : getColorByName(this.actions.color),
80
+ }, onMouseEnter: this.onMouseEnter, onMouseLeave: this.onMouseLeave, role: "menuitem", class: "duet-editable-table-actions-items-button", "aria-label": this.actions.label ? getLocaleString(this.actions.label) : undefined, onClick: ev => this.emitActionEvent(ev) }, h("duet-icon", { class: "duet-editable-table-actions-items-icon", size: "x-small", name: this.actions.icon, color: this.isHovering ? this.actions.color_hover : this.actions.color, margin: "none" })));
81
+ }
82
+ get el() { return getElement(this); }
83
+ };
84
+ DuetEditableTableButton.style = duetEditableTableButtonCss;
85
+
86
+ const duetFieldsetCss = "*,*::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;margin-bottom:12px !important;display:block;width:100%}:host(.duet-m-0){margin:0 !important}fieldset{border:0}legend{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-legend-wrapper{position:relative;display:block;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;font-weight:600;line-height:1.5;color:#00294d;text-align:left;background:transparent}.duet-theme-turva .duet-legend-wrapper{font-family:\"turva-sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";color:#171c3a}.duet-fieldset-label{margin-bottom:12px !important;margin-top:8px}.duet-legend-has-caption .duet-fieldset-label{margin-bottom:6px !important}.duet-legend-has-tooltip .duet-fieldset-label{padding-right:36px}@media (min-width: 48em){.duet-legend-has-tooltip .duet-fieldset-label{margin-bottom:3px !important;padding-right:0}}@media (min-width: 48em){.duet-legend-has-tooltip.duet-legend-has-caption .duet-fieldset-label{margin-bottom:-3px !important}}.duet-fieldset-caption{margin-bottom:12px !important}.duet-fieldset-help{display:block;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:0.875rem;font-weight:400;line-height:1.25;color:#de2362;border-radius:4px}.duet-fieldset-help span{display:block;margin-top:12px}.duet-theme-turva .duet-fieldset-help{color:#e02a0d}::slotted(duet-tooltip){position:absolute;top:4px;right:0}@media (min-width: 48em){::slotted(duet-tooltip){position:relative;right:auto}}.duet-legend-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);border:0}";
87
+
88
+ let DuetFieldset = class {
89
+ constructor(hostRef) {
90
+ registerInstance(this, hostRef);
91
+ this.errorId = createID("DuetError");
92
+ this.labelId = createID("DuetLabel");
93
+ this.hasTooltip = false;
94
+ /**
95
+ * Theme of the fieldset.
96
+ */
97
+ this.theme = "";
98
+ /**
99
+ * Controls the margin of the component.
100
+ */
101
+ this.margin = "auto";
102
+ /**
103
+ * Visually hide the label, but still show it to screen readers.
104
+ */
105
+ this.labelHidden = false;
106
+ this.checkHasTooltip = () => {
107
+ this.hasTooltip = !!this.element.querySelector("[slot='tooltip']");
108
+ };
109
+ }
110
+ /**
111
+ * Component lifecycle events.
112
+ */
113
+ componentWillLoad() {
114
+ inheritGlobalTheme(this);
115
+ this.checkHasTooltip();
116
+ }
117
+ /**
118
+ * render() function
119
+ * Always the last one in the class.
120
+ */
121
+ render() {
122
+ return (h(Host, { class: { "duet-m-0": this.margin === "none" } }, h("fieldset", { "aria-labelledby": `${this.labelId} ${this.errorId}`, class: {
123
+ "duet-fieldset": true,
124
+ "duet-theme-turva": this.theme === "turva",
125
+ } }, h("legend", { id: this.labelId }, h("span", null, this.label), this.caption && h("span", null, this.caption)), h("div", { class: {
126
+ "duet-legend-wrapper": true,
127
+ "duet-legend-has-caption": !!this.caption,
128
+ "duet-legend-has-tooltip": this.hasTooltip,
129
+ "duet-legend-hidden": this.labelHidden,
130
+ } }, h("div", { class: "duet-fieldset-label" }, h("span", { "aria-hidden": "true" }, this.label), h("slot", { onSlotchange: this.checkHasTooltip, name: "tooltip" })), this.caption && (h("div", { class: "duet-fieldset-caption", "aria-hidden": "true" }, h("duet-caption", { margin: "none" }, this.caption)))), h("slot", null), h("span", { class: "duet-fieldset-help", id: this.errorId, "aria-live": "assertive", "aria-relevant": "additions removals" }, this.error && h("span", null, this.error)))));
131
+ }
132
+ get element() { return getElement(this); }
133
+ };
134
+ DuetFieldset.style = duetFieldsetCss;
135
+
136
+ let DuetUploadAriaStatus = class {
137
+ constructor(hostRef) {
138
+ registerInstance(this, hostRef);
139
+ /**
140
+ * State() variables
141
+ */
142
+ this.statusMessage = null;
143
+ /**
144
+ * State() variables
145
+ */
146
+ this.statusMessageLabel = null;
147
+ /**
148
+ * Adds accessible label that is read aloud
149
+ */
150
+ this.accessibleAriaLive = "polite";
151
+ /**
152
+ * valid file amount
153
+ */
154
+ this.valid = undefined;
155
+ /**
156
+ * total files
157
+ */
158
+ this.total = undefined;
159
+ /**
160
+ * invalid file amount
161
+ */
162
+ this.invalid = undefined;
163
+ /**
164
+ * valid file amount
165
+ */
166
+ this.inprogress = undefined;
167
+ /**
168
+ * Component lifecycle events.
169
+ */
170
+ this.replacePlaceHolders = (statusString) => {
171
+ const addFiles = (amount) => {
172
+ return amount > 1 ? `${amount} ${this.statusMessageLabel.files}` : `${amount} ${this.statusMessageLabel.file}`;
173
+ };
174
+ return statusString
175
+ .replace("{filesUploaded}", addFiles(this.valid))
176
+ .replace("{filesInProgress}", addFiles(this.inprogress))
177
+ .replace("{filesTotal}", addFiles(this.total))
178
+ .replace("{filesWithErrors}", addFiles(this.invalid));
179
+ };
180
+ this.getStatusMessage = () => {
181
+ const { done, inProgress, doneWithErrors, inProgressWithErrors } = this.statusMessageLabel;
182
+ const hasErrors = this.invalid > 0;
183
+ const isInProgress = this.inprogress > 0;
184
+ const isInProgressWithErrors = this.inprogress > 0 && hasErrors;
185
+ const isDone = this.valid === this.total && !isInProgress && !hasErrors;
186
+ const isDoneWithErrors = this.valid + this.invalid === this.total && !isInProgress;
187
+ if (isDone) {
188
+ this.statusMessage = this.replacePlaceHolders(done);
189
+ return;
190
+ }
191
+ else if (isInProgressWithErrors) {
192
+ this.statusMessage = this.replacePlaceHolders(inProgressWithErrors);
193
+ return;
194
+ }
195
+ else if (isInProgress) {
196
+ this.statusMessage = this.replacePlaceHolders(inProgress);
197
+ return;
198
+ }
199
+ else if (isDoneWithErrors) {
200
+ this.statusMessage = this.replacePlaceHolders(doneWithErrors);
201
+ return;
202
+ }
203
+ return;
204
+ };
205
+ }
206
+ watchHandler(newValue, oldValue) {
207
+ if (newValue !== oldValue) {
208
+ this.getStatusMessage();
209
+ }
210
+ }
211
+ /**
212
+ * render() function
213
+ * Always the last one in the class.
214
+ */
215
+ render() {
216
+ return (h(Host, { role: "status", "aria-live": "assertive", "aria-atomic": "true", "aria-relevant": "all" }, h("duet-visually-hidden", null, this.statusMessage)));
217
+ }
218
+ static get watchers() { return {
219
+ "valid": ["watchHandler"],
220
+ "invalid": ["watchHandler"],
221
+ "inprogress": ["watchHandler"],
222
+ "total": ["watchHandler"]
223
+ }; }
224
+ };
225
+
226
+ export { DuetEditableTableButton as duet_editable_table_button, DuetFieldset as duet_fieldset, DuetUploadAriaStatus as duet_upload_aria_status };
@@ -1,9 +1,211 @@
1
1
  /*!
2
2
  * Built with Duet Design System
3
3
  */
4
- import { r as registerInstance, h, H as Host, g as getElement } from './index-f70ddc7f.js';
5
- import { m as mediaQueryMedium, e as mediaQueryLarge, f as mediaQueryXLarge, g as mediaQueryXxLarge, h as mediaQueryXxxLarge, i as mediaQuerySmall, s as sizeNavigation, j as sizeHeader } from './tokens.module-edb66c04.js';
4
+ import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-84d97bd1.js';
5
+ import { d as debounce } from './js-utils-b69f17df.js';
6
+ import { s as sanitizeString, g as getLocaleString } from './language-utils-344d894c.js';
6
7
  import { i as inheritGlobalTheme } from './themeable-component-572685dd.js';
8
+ 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';
9
+ import './string-utils-2f1793b8.js';
10
+
11
+ 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}";
12
+
13
+ let DuetEditableTable = class {
14
+ constructor(hostRef) {
15
+ registerInstance(this, hostRef);
16
+ /**
17
+ * State() variables
18
+ * @internal
19
+ */
20
+ this.tick = Date.now();
21
+ /**
22
+ * Map of items that contain list of things.
23
+ */
24
+ this.items = new Map();
25
+ /**
26
+ * Array of internationalized defaults for the default groups labels.
27
+ */
28
+ this.groupsLabelDefaults = {
29
+ fi: "Kaikki",
30
+ en: "All items",
31
+ sv: "Alla objekt",
32
+ };
33
+ /**
34
+ * Array of internationalized defaults for the default action labels.
35
+ */
36
+ this.actionLabelDefaults = {
37
+ fi: "Toiminnot",
38
+ en: "Actions",
39
+ sv: "Handlingar",
40
+ };
41
+ /**
42
+ * Array of group names that you want the editable table to display (can be used to hide or show groups depending on conditions).
43
+ * @default { id: "all", label: this.groupsLabelDefaults, actionLabel: this.actionLabelDefaults }.
44
+ * @example [{ id: "success", label: {fi: "Onnistunut", en: "Success", sv: "Alt klart", }}].
45
+ */
46
+ this.groups = [
47
+ { id: "all", label: this.groupsLabelDefaults, actionLabel: this.actionLabelDefaults },
48
+ ];
49
+ /**
50
+ * Array of actions that are mapped via the map variable to the various groups defined in group.
51
+ * @default undefined
52
+ * @example [{
53
+ variation: "default",
54
+ icon: "action-edit-2",
55
+ id: "edit",
56
+ map: ["success"],
57
+ label: {
58
+ fi: " Label",
59
+ en: " Label",
60
+ sv: " Label",
61
+ }
62
+ }]
63
+ */
64
+ this.actions = undefined;
65
+ /**
66
+ * Shows or hides the table labels.
67
+ */
68
+ this.hideGroups = false;
69
+ /**
70
+ * Exposes the aria role for optimizing accessibility.
71
+ */
72
+ this.accessibleRole = undefined;
73
+ /**
74
+ * Private methods.
75
+ */
76
+ this.kick = debounce(() => {
77
+ this.tick = Date.now();
78
+ }, 100); // will trigger re-render
79
+ this.filterMap = needle => {
80
+ if (needle === "all") {
81
+ return Array.from(this.items);
82
+ }
83
+ return Array.from(this.items).filter(item => needle === item[1].group);
84
+ };
85
+ }
86
+ /**
87
+ * Component lifecycle events.
88
+ */
89
+ componentWillLoad() {
90
+ if (typeof this.groups === "string") {
91
+ this.internalGroupArray = sanitizeString(this.groups);
92
+ }
93
+ else {
94
+ this.internalGroupArray = this.groups;
95
+ }
96
+ if (typeof this.actions === "string") {
97
+ this.internalActionsArray = sanitizeString(this.actions);
98
+ }
99
+ else {
100
+ this.internalActionsArray = this.actions;
101
+ }
102
+ inheritGlobalTheme(this);
103
+ }
104
+ /**
105
+ * Method to force an update of a tabular data array.
106
+ * when called the method will rerender the entire tabular structure.
107
+ */
108
+ async updateTable(passedItems = undefined) {
109
+ this.items = new Map(passedItems || this.items);
110
+ this.kick();
111
+ }
112
+ render() {
113
+ return (h(Host, { class: {
114
+ "duet-theme-turva": this.theme === "turva",
115
+ } }, this.internalGroupArray.map(group => {
116
+ const currentGroup = this.filterMap(group.id);
117
+ if (!currentGroup.length) {
118
+ return;
119
+ }
120
+ 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: {
121
+ "duet-editable-table-header-hidden": this.hideGroups,
122
+ } }, !this.hideGroups ? (getLocaleString(group.label)) : (h("duet-visually-hidden", null, getLocaleString(group.label)))), h("th", { class: {
123
+ "duet-editable-table-header-hidden": this.hideGroups,
124
+ } }, h("duet-visually-hidden", null, group.actionLabel
125
+ ? getLocaleString(group.actionLabel)
126
+ : getLocaleString(this.actionLabelDefaults))))), h("tbody", null, currentGroup.map(dataAsArray => {
127
+ const [key, value] = dataAsArray;
128
+ return (h("duet-editable-table-item", { keyName: key, data: Object.assign({}, value), groupId: group.id, part: group.id, actions: this.internalActionsArray }));
129
+ })))));
130
+ })));
131
+ }
132
+ get element() { return getElement(this); }
133
+ };
134
+ DuetEditableTable.style = duetEditableTableCss;
135
+
136
+ //simple functional component that renders the data in the table
137
+ const TableData = ({ data, groupId }, _children) => {
138
+ if (typeof data === "string") {
139
+ return h("td", { innerHTML: data, class: "duet-editable-table-content", part: `${groupId}content` });
140
+ }
141
+ else {
142
+ return (h("td", { class: "duet-editable-table-content", part: `${groupId}content` }, data));
143
+ }
144
+ };
145
+
146
+ 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}";
147
+
148
+ let DuetEditableTableItem = class {
149
+ constructor(hostRef) {
150
+ registerInstance(this, hostRef);
151
+ this.duetEditableItemAction = createEvent(this, "duetEditableItemAction", 7);
152
+ this.isHovering = false;
153
+ /**
154
+ * Theme of the empty state component.
155
+ */
156
+ this.theme = "";
157
+ /**
158
+ * Actions that can be performed on the element
159
+ */
160
+ this.actions = undefined;
161
+ /**
162
+ * GroupId used to pierce the shadowdom - gets concatenated with "content & actions" and used as part="groupIDcontent/actions" to pierce the content/Action item
163
+ * @internal
164
+ */
165
+ this.groupId = "";
166
+ /**
167
+ * Key used to identify item, when running actions
168
+ */
169
+ this.keyName = "";
170
+ /**
171
+ * Object of data itemsused to render the entire row
172
+ */
173
+ this.data = undefined;
174
+ }
175
+ watchPropHandler(_newValue, _oldValue) {
176
+ // console.log("The new value of activated is: ", _newValue)
177
+ }
178
+ /**
179
+ /**
180
+ * Component lifecycle events.
181
+ */
182
+ componentWillLoad() {
183
+ inheritGlobalTheme(this);
184
+ }
185
+ /**
186
+ /**
187
+ * private functions
188
+ */
189
+ /**
190
+ * render() function
191
+ * Always the last one in the class.
192
+ */
193
+ render() {
194
+ return (h(Host, { role: "row" }, h(TableData, { data: this.data.item, groupId: this.groupId }), h("td", { class: "duet-editable-table-actions" }, h("div", { class: "duet-editable-table-actions-items", part: `${this.groupId}actions` }, this.actions.map(result => {
195
+ const { map = undefined } = result;
196
+ // if map has been specified, only show the current action if groupID matches the map array
197
+ if (map && !map.includes(this.groupId)) {
198
+ return;
199
+ }
200
+ return (h("duet-editable-table-button", { keyName: this.keyName, group: this.data.group, uid: this.data.uid, actions: result, theme: this.theme }));
201
+ })))));
202
+ }
203
+ get el() { return getElement(this); }
204
+ static get watchers() { return {
205
+ "data": ["watchPropHandler"]
206
+ }; }
207
+ };
208
+ DuetEditableTableItem.style = duetEditableTableItemCss;
7
209
 
8
210
  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-minimal th,.duet-table-plain th{padding:16px !important;border-bottom:1px solid #657787}.duet-table-minimal th:first-child,.duet-table-plain th:first-child{padding-left:0 !important}.duet-table-minimal th:last-child,.duet-table-plain th:last-child{padding-right:0 !important}.duet-theme-turva.duet-table-minimal th,.duet-theme-turva.duet-table-plain th{border-bottom-color:#444445}.duet-table-minimal tbody th,.duet-table-plain tbody th{padding-top:40px !important;border-bottom-color:#e1e3e6}.duet-theme-turva.duet-table-minimal tbody th,.duet-theme-turva.duet-table-plain tbody th{border-bottom-color:#e4e4e6}.duet-table-minimal td,.duet-table-plain td{padding:16px !important}.duet-table-minimal td:first-child,.duet-table-plain td:first-child{padding-left:0 !important}.duet-table-minimal td:last-child,.duet-table-plain td:last-child{padding-right:0 !important}.duet-table-minimal tbody td,.duet-table-plain tbody td{border-bottom:1px solid #e1e3e6}.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-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-minimal td,.duet-table-flattened.duet-table-plain td,.duet-table-flattened.duet-table-minimal tbody th,.duet-table-flattened.duet-table-plain tbody th{border-bottom:0}.duet-table-flattened.duet-table-minimal tr,.duet-table-flattened.duet-table-plain tr{padding:20px 0 !important}.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-minimal tfoot td,.duet-table-flattened.duet-table-plain tfoot td{margin-bottom:4px !important}.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-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)}";
9
211
 
@@ -125,4 +327,4 @@ let DuetTable = class {
125
327
  };
126
328
  DuetTable.style = duetTableCss;
127
329
 
128
- export { DuetTable as duet_table };
330
+ export { DuetEditableTable as duet_editable_table, DuetEditableTableItem as duet_editable_table_item, DuetTable as duet_table };
@@ -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-f70ddc7f.js';
4
+ import { r as registerInstance, h, H as Host } from './index-84d97bd1.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}";
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * Built with Duet Design System
3
3
  */
4
- import { r as registerInstance, c as createEvent$1, h, F as Fragment, g as getElement } from './index-f70ddc7f.js';
4
+ import { r as registerInstance, c as createEvent$1, h, F as Fragment, g as getElement } from './index-84d97bd1.js';
5
5
  import { a as actionNewWindowSmall } from './action-new-window-small-1945be91.js';
6
6
  import { D as DuetStringsExternalDefaults } from './common-strings-97e04e4b.js';
7
- import { a as getLanguage, g as getLocaleString } from './language-utils-ab9c3afc.js';
8
- import { p as parsePossibleJSON } from './string-utils-69cf0d09.js';
7
+ import { a as getLanguage, g as getLocaleString } from './language-utils-344d894c.js';
8
+ import { p as parsePossibleJSON } from './string-utils-2f1793b8.js';
9
9
  import { i as inheritGlobalTheme } from './themeable-component-572685dd.js';
10
10
 
11
11
  var actionArrowRight={"title":"action-arrow-right","tags":"action arrow right caret","svg":"<svg fill=\"currentColor\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\"><path d=\"M5.499 24a.752.752 0 0 1-.53-1.281L15.689 12 4.969 1.28c-.142-.141-.22-.33-.22-.53s.078-.389.22-.53c.141-.142.33-.22.53-.22s.389.078.53.22l10.72 10.72a1.5 1.5 0 0 1 .001 2.119L6.029 23.78a.743.743 0 0 1-.53.22z\"/></svg>"};
@@ -71,7 +71,7 @@ let DuetFooter = class {
71
71
  * Adds accessible label for tooltip that is shown in external link (url & external have both been set)
72
72
  * @default {fi: "Avautuu uuteen ikkunaan",sv: "Öppnas i nytt fönster",en: "Opens in a new window"}
73
73
  */
74
- this.accessibleLabelExternal = getLocaleString(this.accessibleLabelExternalDefaults);
74
+ this.accessibleLabelExternal = getLocaleString(this.accessibleLabelExternalDefaults, this.language);
75
75
  /**
76
76
  * Component event handling.
77
77
  */
@@ -1,8 +1,8 @@
1
1
  /*!
2
2
  * Built with Duet Design System
3
3
  */
4
- import { r as registerInstance, h, g as getElement, H as Host } from './index-f70ddc7f.js';
5
- import { w as watchForOptions } from './watch-options-de55ea78.js';
4
+ import { r as registerInstance, h, g as getElement, H as Host } from './index-84d97bd1.js';
5
+ import { w as watchForOptions, a as watchForElement } from './watch-options-dd55bce8.js';
6
6
  import { i as inheritGlobalTheme } from './themeable-component-572685dd.js';
7
7
 
8
8
  const duetGridCss = ".sc-duet-grid-h{box-sizing:border-box;padding:0;margin:0;background:transparent;border:0;-moz-appearance:none;-webkit-appearance:none;appearance:none;display:flex !important;flex-direction:column !important;align-items:flex-start !important;justify-content:flex-start !important;width:100%;max-width:100%;height:auto}@media (min-width: 36em){.duet-grid-breakpoint-small.sc-duet-grid-h{flex-direction:row !important}}@media (min-width: 48em){.duet-grid-breakpoint-medium.sc-duet-grid-h{flex-direction:row !important}}@media (min-width: 64.0625em){.duet-grid-breakpoint-x-large.sc-duet-grid-h{flex-direction:row !important}}.duet-grid-wrap.sc-duet-grid-h{flex-wrap:wrap !important}.duet-no-stacking.sc-duet-grid-h{flex-direction:row !important}.duet-grid-direction-vertical.duet-grid-breakpoint-small.sc-duet-grid-h{flex-direction:column !important}@media (min-width: 36em){.duet-grid-direction-vertical.duet-grid-breakpoint-small.sc-duet-grid-h{flex-direction:column !important}}.duet-grid-direction-vertical.duet-grid-breakpoint-medium.sc-duet-grid-h{flex-direction:column !important}@media (min-width: 48em){.duet-grid-direction-vertical.duet-grid-breakpoint-medium.sc-duet-grid-h{flex-direction:column !important}}.duet-grid-direction-vertical.duet-grid-breakpoint-x-large.sc-duet-grid-h{flex-direction:column !important}@media (min-width: 64.0625em){.duet-grid-direction-vertical.duet-grid-breakpoint-x-large.sc-duet-grid-h{flex-direction:column !important}}.duet-grid-align-top.duet-no-stacking.sc-duet-grid-h{align-items:flex-start !important}.duet-grid-align-bottom.duet-no-stacking.sc-duet-grid-h{align-items:flex-end !important}.duet-grid-align-center.duet-no-stacking.sc-duet-grid-h{align-items:center !important}.duet-grid-align-stretch.duet-no-stacking.sc-duet-grid-h{align-items:stretch !important}.duet-grid-align-baseline.duet-no-stacking.sc-duet-grid-h{align-items:baseline !important}@media (min-width: 36em){.duet-grid-align-top.duet-grid-breakpoint-small.sc-duet-grid-h{align-items:flex-start !important}}@media (min-width: 36em){.duet-grid-align-bottom.duet-grid-breakpoint-small.sc-duet-grid-h{align-items:flex-end !important}}@media (min-width: 36em){.duet-grid-align-center.duet-grid-breakpoint-small.sc-duet-grid-h{align-items:center !important}}@media (min-width: 36em){.duet-grid-align-stretch.duet-grid-breakpoint-small.sc-duet-grid-h{align-items:stretch !important}}@media (min-width: 36em){.duet-grid-align-baseline.duet-grid-breakpoint-small.sc-duet-grid-h{align-items:baseline !important}}@media (min-width: 48em){.duet-grid-align-top.duet-grid-breakpoint-medium.sc-duet-grid-h{align-items:flex-start !important}}@media (min-width: 48em){.duet-grid-align-bottom.duet-grid-breakpoint-medium.sc-duet-grid-h{align-items:flex-end !important}}@media (min-width: 48em){.duet-grid-align-center.duet-grid-breakpoint-medium.sc-duet-grid-h{align-items:center !important}}@media (min-width: 48em){.duet-grid-align-stretch.duet-grid-breakpoint-medium.sc-duet-grid-h{align-items:stretch !important}}@media (min-width: 48em){.duet-grid-align-baseline.duet-grid-breakpoint-medium.sc-duet-grid-h{align-items:baseline !important}}@media (min-width: 64.0625em){.duet-grid-align-top.duet-grid-breakpoint-x-large.sc-duet-grid-h{align-items:flex-start !important}}@media (min-width: 64.0625em){.duet-grid-align-bottom.duet-grid-breakpoint-x-large.sc-duet-grid-h{align-items:flex-end !important}}@media (min-width: 64.0625em){.duet-grid-align-center.duet-grid-breakpoint-x-large.sc-duet-grid-h{align-items:center !important}}@media (min-width: 64.0625em){.duet-grid-align-stretch.duet-grid-breakpoint-x-large.sc-duet-grid-h{align-items:stretch !important}}@media (min-width: 64.0625em){.duet-grid-align-baseline.duet-grid-breakpoint-x-large.sc-duet-grid-h{align-items:baseline !important}}.duet-grid-distribution-left.sc-duet-grid-h{justify-content:flex-start !important}.duet-grid-distribution-right.sc-duet-grid-h{justify-content:flex-end !important}.duet-grid-distribution-center.sc-duet-grid-h{justify-content:center !important}.duet-grid-distribution-between.sc-duet-grid-h{justify-content:space-between !important}.duet-grid-distribution-around.sc-duet-grid-h{justify-content:space-around !important}.duet-grid-distribution-evenly.sc-duet-grid-h{justify-content:space-evenly !important}@media (max-width: 35.9375em){.duet-grid-mobile-left.sc-duet-grid-h{align-items:flex-start !important;justify-content:flex-start !important;text-align:left !important}}@media (max-width: 35.9375em){.duet-grid-mobile-center.sc-duet-grid-h{align-items:center !important;justify-content:center !important;text-align:center !important}.duet-grid-mobile-center.sc-duet-grid-h *.sc-duet-grid{text-align:center !important}}@media (max-width: 35.9375em){.duet-grid-mobile-right.sc-duet-grid-h{align-items:flex-end !important;justify-content:flex-end !important;text-align:right !important}.duet-grid-mobile-right.sc-duet-grid-h *.sc-duet-grid{text-align:right !important}}";
@@ -13,6 +13,7 @@ function isGridItem(element) {
13
13
  let DuetGrid = class {
14
14
  constructor(hostRef) {
15
15
  registerInstance(this, hostRef);
16
+ this.distributeFormElement = false;
16
17
  /**
17
18
  * Enable or disable the automatic responsive behaviour of the grid component.
18
19
  * Setting this option to "true" makes sure that contents are stacked vertically
@@ -29,7 +30,9 @@ let DuetGrid = class {
29
30
  */
30
31
  this.direction = "horizontal";
31
32
  /**
32
- * Adjusts the vertical alignment of the grid items.
33
+ * Adjusts the vertical alignment of the grid items, if set to "form_distribute"
34
+ * the grid will try to calculate correct paddings for any duet-input fields inside duet-grid-items,
35
+ * so that they align even when displaying errors.
33
36
  */
34
37
  this.alignment = "top";
35
38
  /**
@@ -41,14 +44,34 @@ let DuetGrid = class {
41
44
  */
42
45
  this.mobile = "";
43
46
  }
47
+ /**
48
+ * Private functions
49
+ */
50
+ /**
51
+ * Returns the element height including margins
52
+ * @param element - element
53
+ * @returns {number}
54
+ */
55
+ outerHeight(element) {
56
+ const height = element.offsetHeight, style = window.getComputedStyle(element);
57
+ return ["top", "bottom"]
58
+ .map(side => parseInt(style[`margin-${side}`]))
59
+ .reduce((total, side) => total + side, height);
60
+ }
44
61
  /**
45
62
  * Component lifecycle events.
46
63
  */
47
64
  async connectedCallback() {
48
65
  const el = this.element;
66
+ this.distributeFormElement = this.alignment === "form_distribute";
49
67
  this.mutationO = watchForOptions(el, "duet-grid-item", () => {
50
68
  this.updateGridItems();
51
69
  });
70
+ if (this.distributeFormElement) {
71
+ this.mutation1 = watchForElement(el, "duet-input", () => {
72
+ this.updateGridItemsWithInputFields();
73
+ });
74
+ }
52
75
  this.updateGridItems();
53
76
  }
54
77
  disconnectedCallback() {
@@ -56,6 +79,10 @@ let DuetGrid = class {
56
79
  this.mutationO.disconnect();
57
80
  this.mutationO = undefined;
58
81
  }
82
+ if (this.mutation1) {
83
+ this.mutation1.disconnect();
84
+ this.mutation1 = undefined;
85
+ }
59
86
  }
60
87
  /**
61
88
  * Local methods
@@ -67,6 +94,27 @@ let DuetGrid = class {
67
94
  item.breakpoint = this.breakpoint;
68
95
  });
69
96
  }
97
+ async updateGridItemsWithInputFields() {
98
+ const items = Array.from(this.element.children).filter(isGridItem);
99
+ let maxHeight = 0;
100
+ const sizes = [];
101
+ items.forEach(item => {
102
+ const inputErrorDom = item.querySelector("span.duet-input-error");
103
+ const height = inputErrorDom ? this.outerHeight(inputErrorDom) : 0;
104
+ sizes.push(height);
105
+ });
106
+ maxHeight = Math.max(...sizes);
107
+ items.forEach(item => {
108
+ const inputErrorDom = item.querySelector("span.duet-input-error");
109
+ const height = inputErrorDom ? this.outerHeight(inputErrorDom) : 0;
110
+ if (height < maxHeight) {
111
+ item.setAttribute("style", `padding-bottom: ${maxHeight - height}px;`);
112
+ }
113
+ else if (height === maxHeight) {
114
+ item.setAttribute("style", `padding-bottom: 0px;`);
115
+ }
116
+ });
117
+ }
70
118
  /**
71
119
  * render() function
72
120
  * Always the last one in the class.
@@ -76,7 +124,7 @@ let DuetGrid = class {
76
124
  "duet-grid": true,
77
125
  "duet-no-stacking": !this.responsive,
78
126
  "duet-grid-align-top": this.alignment === "top",
79
- "duet-grid-align-bottom": this.alignment === "bottom",
127
+ "duet-grid-align-bottom": this.alignment === "bottom" || this.alignment === "form_distribute",
80
128
  "duet-grid-align-center": this.alignment === "center",
81
129
  "duet-grid-align-stretch": this.alignment === "stretch",
82
130
  "duet-grid-align-baseline": this.alignment === "baseline",