@nldd/design-system 0.14.0 → 0.16.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 (465) hide show
  1. package/NOTICES.md +1 -1
  2. package/custom-elements.json +1795 -138
  3. package/dist/components/actions/button/button.d.ts +2 -17
  4. package/dist/components/actions/button/button.d.ts.map +1 -1
  5. package/dist/components/actions/button/button.js +18 -34
  6. package/dist/components/actions/button/button.js.map +1 -1
  7. package/dist/components/actions/button/button.template.d.ts.map +1 -1
  8. package/dist/components/actions/button/button.template.js +2 -2
  9. package/dist/components/actions/button/button.template.js.map +1 -1
  10. package/dist/components/actions/button-group/button-group.d.ts +8 -3
  11. package/dist/components/actions/button-group/button-group.d.ts.map +1 -1
  12. package/dist/components/actions/button-group/button-group.js +32 -13
  13. package/dist/components/actions/button-group/button-group.js.map +1 -1
  14. package/dist/components/actions/icon-button/icon-button.d.ts +2 -1
  15. package/dist/components/actions/icon-button/icon-button.d.ts.map +1 -1
  16. package/dist/components/actions/icon-button/icon-button.js +16 -1
  17. package/dist/components/actions/icon-button/icon-button.js.map +1 -1
  18. package/dist/components/actions/icon-button/icon-button.template.d.ts.map +1 -1
  19. package/dist/components/actions/icon-button/icon-button.template.js +2 -2
  20. package/dist/components/actions/icon-button/icon-button.template.js.map +1 -1
  21. package/dist/components/actions/menu/menu-item.d.ts.map +1 -1
  22. package/dist/components/actions/menu/menu-item.js +3 -0
  23. package/dist/components/actions/menu/menu-item.js.map +1 -1
  24. package/dist/components/actions/menu/menu.d.ts +34 -1
  25. package/dist/components/actions/menu/menu.d.ts.map +1 -1
  26. package/dist/components/actions/menu/menu.i18n.d.ts +2 -0
  27. package/dist/components/actions/menu/menu.i18n.d.ts.map +1 -1
  28. package/dist/components/actions/menu/menu.i18n.js +4 -0
  29. package/dist/components/actions/menu/menu.i18n.js.map +1 -1
  30. package/dist/components/actions/menu/menu.js +65 -3
  31. package/dist/components/actions/menu/menu.js.map +1 -1
  32. package/dist/components/actions/split-button/split-button.d.ts +63 -34
  33. package/dist/components/actions/split-button/split-button.d.ts.map +1 -1
  34. package/dist/components/actions/split-button/split-button.i18n.d.ts +1 -1
  35. package/dist/components/actions/split-button/split-button.i18n.js +1 -1
  36. package/dist/components/actions/split-button/split-button.i18n.js.map +1 -1
  37. package/dist/components/actions/split-button/split-button.js +116 -76
  38. package/dist/components/actions/split-button/split-button.js.map +1 -1
  39. package/dist/components/actions/split-button/split-button.styles.d.ts.map +1 -1
  40. package/dist/components/actions/split-button/split-button.styles.js +4 -0
  41. package/dist/components/actions/split-button/split-button.styles.js.map +1 -1
  42. package/dist/components/actions/split-button/split-button.template.d.ts +2 -1
  43. package/dist/components/actions/split-button/split-button.template.d.ts.map +1 -1
  44. package/dist/components/actions/split-button/split-button.template.js +25 -20
  45. package/dist/components/actions/split-button/split-button.template.js.map +1 -1
  46. package/dist/components/actions/toolbar/toolbar.story-sync.d.ts +13 -0
  47. package/dist/components/actions/toolbar/toolbar.story-sync.d.ts.map +1 -0
  48. package/dist/components/actions/toolbar/toolbar.story-sync.js +89 -0
  49. package/dist/components/actions/toolbar/toolbar.story-sync.js.map +1 -0
  50. package/dist/components/components.js +3195 -810
  51. package/dist/components/content/code-viewer/code-viewer.d.ts.map +1 -1
  52. package/dist/components/content/code-viewer/code-viewer.js +3 -0
  53. package/dist/components/content/code-viewer/code-viewer.js.map +1 -1
  54. package/dist/components/content/icon/icon-aliases.d.ts.map +1 -1
  55. package/dist/components/content/icon/icon-aliases.js +4 -0
  56. package/dist/components/content/icon/icon-aliases.js.map +1 -1
  57. package/dist/components/content/rich-text/rich-text.d.ts +4 -1
  58. package/dist/components/content/rich-text/rich-text.d.ts.map +1 -1
  59. package/dist/components/content/rich-text/rich-text.js +4 -1
  60. package/dist/components/content/rich-text/rich-text.js.map +1 -1
  61. package/dist/components/content/title/title.d.ts +8 -0
  62. package/dist/components/content/title/title.d.ts.map +1 -1
  63. package/dist/components/content/title/title.js +8 -0
  64. package/dist/components/content/title/title.js.map +1 -1
  65. package/dist/components/content/title/title.styles.d.ts.map +1 -1
  66. package/dist/components/content/title/title.styles.js +13 -0
  67. package/dist/components/content/title/title.styles.js.map +1 -1
  68. package/dist/components/content/tooltip/tooltip.d.ts +8 -1
  69. package/dist/components/content/tooltip/tooltip.d.ts.map +1 -1
  70. package/dist/components/content/tooltip/tooltip.js +48 -6
  71. package/dist/components/content/tooltip/tooltip.js.map +1 -1
  72. package/dist/components/content/tooltip/tooltip.styles.d.ts.map +1 -1
  73. package/dist/components/content/tooltip/tooltip.styles.js +5 -0
  74. package/dist/components/content/tooltip/tooltip.styles.js.map +1 -1
  75. package/dist/components/{decorate-x12uDAK4.js → decorate-pEFCObfp.js} +1 -1
  76. package/dist/components/{with-translations-DLzmBSkU.js → defer-focus-CkNrCf_g.js} +34 -3
  77. package/dist/components/{dev-checks-BgrW077W.js → dev-checks--aiYe9Pe.js} +100 -4
  78. package/dist/components/{dist-BaLc58I_.js → dist-245LaK9m.js} +1 -1
  79. package/dist/components/{dist-DgjvHvsN.js → dist-4g23YHP0.js} +1 -1
  80. package/dist/components/{dist-YYLChwRq.js → dist-Bf823YyL.js} +1 -1
  81. package/dist/components/{dist-Bm3708s5.js → dist-CeMOOqgP.js} +13 -1
  82. package/dist/components/{dist-CJ9uLG0u.js → dist-DFjwTlJV.js} +1 -1
  83. package/dist/components/forms/form-field/form-field.d.ts +2 -2
  84. package/dist/components/forms/form-field/form-field.d.ts.map +1 -1
  85. package/dist/components/forms/form-field/form-field.js +4 -3
  86. package/dist/components/forms/form-field/form-field.js.map +1 -1
  87. package/dist/components/forms/form-field/form-field.template.d.ts.map +1 -1
  88. package/dist/components/forms/form-field/form-field.template.js +3 -2
  89. package/dist/components/forms/form-field/form-field.template.js.map +1 -1
  90. package/dist/components/forms/validation-list/validation-list.d.ts +26 -0
  91. package/dist/components/forms/validation-list/validation-list.d.ts.map +1 -1
  92. package/dist/components/forms/validation-list/validation-list.i18n.d.ts +12 -0
  93. package/dist/components/forms/validation-list/validation-list.i18n.d.ts.map +1 -0
  94. package/dist/components/forms/validation-list/validation-list.i18n.js +11 -0
  95. package/dist/components/forms/validation-list/validation-list.i18n.js.map +1 -0
  96. package/dist/components/forms/validation-list/validation-list.js +74 -2
  97. package/dist/components/forms/validation-list/validation-list.js.map +1 -1
  98. package/dist/components/{icon-IgCyk9ui.js → icon-BQjRjtKH.js} +3 -1
  99. package/dist/components/{icon-button-B5tH4b3c.js → icon-button-BivCiIpt.js} +124 -21
  100. package/dist/components/index.d.ts +2 -0
  101. package/dist/components/index.d.ts.map +1 -1
  102. package/dist/components/index.js +2 -0
  103. package/dist/components/index.js.map +1 -1
  104. package/dist/components/inputs/checkbox/checkbox.d.ts +0 -5
  105. package/dist/components/inputs/checkbox/checkbox.d.ts.map +1 -1
  106. package/dist/components/inputs/checkbox/checkbox.js +3 -5
  107. package/dist/components/inputs/checkbox/checkbox.js.map +1 -1
  108. package/dist/components/inputs/checkbox/checkbox.styles.js +9 -9
  109. package/dist/components/inputs/checkbox-field/checkbox-field.d.ts.map +1 -1
  110. package/dist/components/inputs/checkbox-field/checkbox-field.js +3 -0
  111. package/dist/components/inputs/checkbox-field/checkbox-field.js.map +1 -1
  112. package/dist/components/inputs/code-editor/code-editor.styles.d.ts.map +1 -1
  113. package/dist/components/inputs/code-editor/code-editor.styles.js +42 -13
  114. package/dist/components/inputs/code-editor/code-editor.styles.js.map +1 -1
  115. package/dist/components/inputs/combo-box/combo-box.d.ts +4 -0
  116. package/dist/components/inputs/combo-box/combo-box.d.ts.map +1 -1
  117. package/dist/components/inputs/combo-box/combo-box.js +12 -0
  118. package/dist/components/inputs/combo-box/combo-box.js.map +1 -1
  119. package/dist/components/inputs/date-field/date-field.i18n.js +4 -4
  120. package/dist/components/inputs/date-field/date-field.i18n.js.map +1 -1
  121. package/dist/components/inputs/date-picker/date-picker.d.ts +3 -3
  122. package/dist/components/inputs/date-picker/date-picker.d.ts.map +1 -1
  123. package/dist/components/inputs/date-picker/date-picker.i18n.d.ts +2 -2
  124. package/dist/components/inputs/date-picker/date-picker.i18n.js +2 -2
  125. package/dist/components/inputs/date-picker/date-picker.i18n.js.map +1 -1
  126. package/dist/components/inputs/date-picker/date-picker.js +3 -0
  127. package/dist/components/inputs/date-picker/date-picker.js.map +1 -1
  128. package/dist/components/inputs/date-picker/date-picker.template.js +2 -2
  129. package/dist/components/inputs/date-picker/date-picker.template.js.map +1 -1
  130. package/dist/components/inputs/dropdown/dropdown.d.ts.map +1 -1
  131. package/dist/components/inputs/dropdown/dropdown.js +5 -1
  132. package/dist/components/inputs/dropdown/dropdown.js.map +1 -1
  133. package/dist/components/inputs/file-field/file-field.d.ts +147 -17
  134. package/dist/components/inputs/file-field/file-field.d.ts.map +1 -1
  135. package/dist/components/inputs/file-field/file-field.drop.d.ts +16 -1
  136. package/dist/components/inputs/file-field/file-field.drop.d.ts.map +1 -1
  137. package/dist/components/inputs/file-field/file-field.drop.js +33 -0
  138. package/dist/components/inputs/file-field/file-field.drop.js.map +1 -1
  139. package/dist/components/inputs/file-field/file-field.i18n.d.ts +11 -1
  140. package/dist/components/inputs/file-field/file-field.i18n.d.ts.map +1 -1
  141. package/dist/components/inputs/file-field/file-field.i18n.js +16 -6
  142. package/dist/components/inputs/file-field/file-field.i18n.js.map +1 -1
  143. package/dist/components/inputs/file-field/file-field.js +419 -74
  144. package/dist/components/inputs/file-field/file-field.js.map +1 -1
  145. package/dist/components/inputs/file-field/file-field.styles.d.ts.map +1 -1
  146. package/dist/components/inputs/file-field/file-field.styles.js +244 -100
  147. package/dist/components/inputs/file-field/file-field.styles.js.map +1 -1
  148. package/dist/components/inputs/file-field/file-field.template.d.ts +2 -1
  149. package/dist/components/inputs/file-field/file-field.template.d.ts.map +1 -1
  150. package/dist/components/inputs/file-field/file-field.template.js +284 -84
  151. package/dist/components/inputs/file-field/file-field.template.js.map +1 -1
  152. package/dist/components/inputs/file-field/file-field.truncate.d.ts +17 -0
  153. package/dist/components/inputs/file-field/file-field.truncate.d.ts.map +1 -1
  154. package/dist/components/inputs/file-field/file-field.truncate.js +26 -3
  155. package/dist/components/inputs/file-field/file-field.truncate.js.map +1 -1
  156. package/dist/components/inputs/number-field/number-field.d.ts.map +1 -1
  157. package/dist/components/inputs/number-field/number-field.js +3 -0
  158. package/dist/components/inputs/number-field/number-field.js.map +1 -1
  159. package/dist/components/inputs/password-field/password-field.d.ts +5 -12
  160. package/dist/components/inputs/password-field/password-field.d.ts.map +1 -1
  161. package/dist/components/inputs/password-field/password-field.i18n.d.ts +8 -0
  162. package/dist/components/inputs/password-field/password-field.i18n.d.ts.map +1 -0
  163. package/dist/components/inputs/password-field/password-field.i18n.js +7 -0
  164. package/dist/components/inputs/password-field/password-field.i18n.js.map +1 -0
  165. package/dist/components/inputs/password-field/password-field.js +10 -23
  166. package/dist/components/inputs/password-field/password-field.js.map +1 -1
  167. package/dist/components/inputs/password-field/password-field.template.js +2 -2
  168. package/dist/components/inputs/password-field/password-field.template.js.map +1 -1
  169. package/dist/components/inputs/radio-button/radio-button.d.ts +0 -5
  170. package/dist/components/inputs/radio-button/radio-button.d.ts.map +1 -1
  171. package/dist/components/inputs/radio-button/radio-button.js +0 -5
  172. package/dist/components/inputs/radio-button/radio-button.js.map +1 -1
  173. package/dist/components/inputs/radio-button/radio-button.styles.js +9 -9
  174. package/dist/components/inputs/radio-button-group/radio-button-group.d.ts.map +1 -1
  175. package/dist/components/inputs/radio-button-group/radio-button-group.js +3 -0
  176. package/dist/components/inputs/radio-button-group/radio-button-group.js.map +1 -1
  177. package/dist/components/inputs/search-field/search-field.d.ts.map +1 -1
  178. package/dist/components/inputs/search-field/search-field.js +3 -0
  179. package/dist/components/inputs/search-field/search-field.js.map +1 -1
  180. package/dist/components/inputs/segmented-control/segmented-control.d.ts.map +1 -1
  181. package/dist/components/inputs/segmented-control/segmented-control.js +5 -0
  182. package/dist/components/inputs/segmented-control/segmented-control.js.map +1 -1
  183. package/dist/components/inputs/slider/slider.d.ts +51 -14
  184. package/dist/components/inputs/slider/slider.d.ts.map +1 -1
  185. package/dist/components/inputs/slider/slider.js +197 -50
  186. package/dist/components/inputs/slider/slider.js.map +1 -1
  187. package/dist/components/inputs/slider/slider.styles.d.ts.map +1 -1
  188. package/dist/components/inputs/slider/slider.styles.js +42 -18
  189. package/dist/components/inputs/slider/slider.styles.js.map +1 -1
  190. package/dist/components/inputs/slider/slider.template.d.ts.map +1 -1
  191. package/dist/components/inputs/slider/slider.template.js +13 -5
  192. package/dist/components/inputs/slider/slider.template.js.map +1 -1
  193. package/dist/components/inputs/stepper/stepper.d.ts.map +1 -1
  194. package/dist/components/inputs/stepper/stepper.js +3 -0
  195. package/dist/components/inputs/stepper/stepper.js.map +1 -1
  196. package/dist/components/inputs/swatch-picker/swatch-picker.d.ts +185 -0
  197. package/dist/components/inputs/swatch-picker/swatch-picker.d.ts.map +1 -0
  198. package/dist/components/inputs/swatch-picker/swatch-picker.i18n.d.ts +22 -0
  199. package/dist/components/inputs/swatch-picker/swatch-picker.i18n.d.ts.map +1 -0
  200. package/dist/components/inputs/swatch-picker/swatch-picker.i18n.js +21 -0
  201. package/dist/components/inputs/swatch-picker/swatch-picker.i18n.js.map +1 -0
  202. package/dist/components/inputs/swatch-picker/swatch-picker.js +485 -0
  203. package/dist/components/inputs/swatch-picker/swatch-picker.js.map +1 -0
  204. package/dist/components/inputs/swatch-picker/swatch-picker.styles.d.ts +3 -0
  205. package/dist/components/inputs/swatch-picker/swatch-picker.styles.d.ts.map +1 -0
  206. package/dist/components/inputs/swatch-picker/swatch-picker.styles.js +177 -0
  207. package/dist/components/inputs/swatch-picker/swatch-picker.styles.js.map +1 -0
  208. package/dist/components/inputs/swatch-picker/swatch-picker.template.d.ts +6 -0
  209. package/dist/components/inputs/swatch-picker/swatch-picker.template.d.ts.map +1 -0
  210. package/dist/components/inputs/swatch-picker/swatch-picker.template.js +44 -0
  211. package/dist/components/inputs/swatch-picker/swatch-picker.template.js.map +1 -0
  212. package/dist/components/inputs/switch/switch.d.ts +0 -5
  213. package/dist/components/inputs/switch/switch.d.ts.map +1 -1
  214. package/dist/components/inputs/switch/switch.js +3 -5
  215. package/dist/components/inputs/switch/switch.js.map +1 -1
  216. package/dist/components/inputs/switch/switch.styles.js +2 -2
  217. package/dist/components/inputs/switch-field/switch-field.d.ts.map +1 -1
  218. package/dist/components/inputs/switch-field/switch-field.js +3 -0
  219. package/dist/components/inputs/switch-field/switch-field.js.map +1 -1
  220. package/dist/components/inputs/text-editor/text-editor.code-copy.js +2 -2
  221. package/dist/components/inputs/text-editor/text-editor.code-copy.js.map +1 -1
  222. package/dist/components/inputs/text-editor/text-editor.cursor.d.ts.map +1 -1
  223. package/dist/components/inputs/text-editor/text-editor.cursor.js +1 -11
  224. package/dist/components/inputs/text-editor/text-editor.cursor.js.map +1 -1
  225. package/dist/components/inputs/text-editor/text-editor.d.ts.map +1 -1
  226. package/dist/components/inputs/text-editor/text-editor.hidden-syntax.d.ts.map +1 -1
  227. package/dist/components/inputs/text-editor/text-editor.hidden-syntax.js +127 -11
  228. package/dist/components/inputs/text-editor/text-editor.hidden-syntax.js.map +1 -1
  229. package/dist/components/inputs/text-editor/text-editor.i18n.d.ts +3 -1
  230. package/dist/components/inputs/text-editor/text-editor.i18n.d.ts.map +1 -1
  231. package/dist/components/inputs/text-editor/text-editor.i18n.js +5 -1
  232. package/dist/components/inputs/text-editor/text-editor.i18n.js.map +1 -1
  233. package/dist/components/inputs/text-editor/text-editor.js +7 -5
  234. package/dist/components/inputs/text-editor/text-editor.js.map +1 -1
  235. package/dist/components/inputs/text-editor/text-editor.markdown.d.ts +3 -0
  236. package/dist/components/inputs/text-editor/text-editor.markdown.d.ts.map +1 -1
  237. package/dist/components/inputs/text-editor/text-editor.markdown.js +9 -1
  238. package/dist/components/inputs/text-editor/text-editor.markdown.js.map +1 -1
  239. package/dist/components/inputs/text-editor/text-editor.mentions.d.ts +7 -2
  240. package/dist/components/inputs/text-editor/text-editor.mentions.d.ts.map +1 -1
  241. package/dist/components/inputs/text-editor/text-editor.mentions.js +47 -145
  242. package/dist/components/inputs/text-editor/text-editor.mentions.js.map +1 -1
  243. package/dist/components/inputs/text-editor/text-editor.styles.d.ts.map +1 -1
  244. package/dist/components/inputs/text-editor/text-editor.styles.js +187 -2
  245. package/dist/components/inputs/text-editor/text-editor.styles.js.map +1 -1
  246. package/dist/components/inputs/text-field/text-field.d.ts.map +1 -1
  247. package/dist/components/inputs/text-field/text-field.js +3 -0
  248. package/dist/components/inputs/text-field/text-field.js.map +1 -1
  249. package/dist/components/inputs/time-field/time-field.i18n.js +3 -3
  250. package/dist/components/inputs/time-field/time-field.i18n.js.map +1 -1
  251. package/dist/components/inputs/time-picker/time-picker.d.ts.map +1 -1
  252. package/dist/components/inputs/time-picker/time-picker.js +3 -0
  253. package/dist/components/inputs/time-picker/time-picker.js.map +1 -1
  254. package/dist/components/inputs/toggle-button/toggle-button.d.ts.map +1 -1
  255. package/dist/components/inputs/toggle-button/toggle-button.js +3 -0
  256. package/dist/components/inputs/toggle-button/toggle-button.js.map +1 -1
  257. package/dist/components/inputs/toggle-button-group/toggle-button-group.d.ts.map +1 -1
  258. package/dist/components/inputs/toggle-button-group/toggle-button-group.js +3 -0
  259. package/dist/components/inputs/toggle-button-group/toggle-button-group.js.map +1 -1
  260. package/dist/components/inputs/token-field/token-field.d.ts +4 -0
  261. package/dist/components/inputs/token-field/token-field.d.ts.map +1 -1
  262. package/dist/components/inputs/token-field/token-field.i18n.d.ts +1 -1
  263. package/dist/components/inputs/token-field/token-field.i18n.js +1 -1
  264. package/dist/components/inputs/token-field/token-field.i18n.js.map +1 -1
  265. package/dist/components/inputs/token-field/token-field.js +12 -0
  266. package/dist/components/inputs/token-field/token-field.js.map +1 -1
  267. package/dist/components/inputs/token-field/token-field.template.js +1 -1
  268. package/dist/components/inputs/token-field/token-field.template.js.map +1 -1
  269. package/dist/components/{just-in-time-education.i18n-BJ5ovWVB.js → just-in-time-education.i18n-S05IOgqk.js} +76 -23
  270. package/dist/components/layout/collection/collection.d.ts +4 -0
  271. package/dist/components/layout/collection/collection.d.ts.map +1 -1
  272. package/dist/components/layout/collection/collection.js +56 -8
  273. package/dist/components/layout/collection/collection.js.map +1 -1
  274. package/dist/components/layout/collection/collection.template.js +1 -1
  275. package/dist/components/layout/collection/collection.template.js.map +1 -1
  276. package/dist/components/layout/page-footer/page-footer.d.ts +2 -0
  277. package/dist/components/layout/page-footer/page-footer.d.ts.map +1 -1
  278. package/dist/components/layout/page-footer/page-footer.js +7 -0
  279. package/dist/components/layout/page-footer/page-footer.js.map +1 -1
  280. package/dist/components/layout/page-footer/page-footer.styles.d.ts.map +1 -1
  281. package/dist/components/layout/page-footer/page-footer.styles.js +33 -11
  282. package/dist/components/layout/page-footer/page-footer.styles.js.map +1 -1
  283. package/dist/components/layout/page-footer/page-footer.template.d.ts.map +1 -1
  284. package/dist/components/layout/page-footer/page-footer.template.js +2 -0
  285. package/dist/components/layout/page-footer/page-footer.template.js.map +1 -1
  286. package/dist/components/layout/page-sections/hero/hero.styles.js +1 -1
  287. package/dist/components/layout/popover/popover.d.ts +19 -7
  288. package/dist/components/layout/popover/popover.d.ts.map +1 -1
  289. package/dist/components/layout/popover/popover.js +25 -8
  290. package/dist/components/layout/popover/popover.js.map +1 -1
  291. package/dist/components/layout/task-board/task-board.d.ts +9 -1
  292. package/dist/components/layout/task-board/task-board.d.ts.map +1 -1
  293. package/dist/components/layout/task-board/task-board.js +67 -4
  294. package/dist/components/layout/task-board/task-board.js.map +1 -1
  295. package/dist/components/{list.i18n-nFB6dZpc.js → list.i18n-CKqbhFQ_.js} +1 -1
  296. package/dist/components/lists-and-tables/cells/cell/cell.d.ts +2 -0
  297. package/dist/components/lists-and-tables/cells/cell/cell.d.ts.map +1 -1
  298. package/dist/components/lists-and-tables/cells/cell/cell.js +2 -1
  299. package/dist/components/lists-and-tables/cells/cell/cell.js.map +1 -1
  300. package/dist/components/lists-and-tables/cells/description-cell/description-cell.d.ts +2 -0
  301. package/dist/components/lists-and-tables/cells/description-cell/description-cell.d.ts.map +1 -1
  302. package/dist/components/lists-and-tables/cells/description-cell/description-cell.js +2 -1
  303. package/dist/components/lists-and-tables/cells/description-cell/description-cell.js.map +1 -1
  304. package/dist/components/lists-and-tables/cells/text-cell/text-cell.d.ts +2 -0
  305. package/dist/components/lists-and-tables/cells/text-cell/text-cell.d.ts.map +1 -1
  306. package/dist/components/lists-and-tables/cells/text-cell/text-cell.js +2 -1
  307. package/dist/components/lists-and-tables/cells/text-cell/text-cell.js.map +1 -1
  308. package/dist/components/lists-and-tables/cells/title-cell/title-cell.d.ts +7 -2
  309. package/dist/components/lists-and-tables/cells/title-cell/title-cell.d.ts.map +1 -1
  310. package/dist/components/lists-and-tables/cells/title-cell/title-cell.js +3 -3
  311. package/dist/components/lists-and-tables/cells/title-cell/title-cell.js.map +1 -1
  312. package/dist/components/lists-and-tables/list/list.i18n.d.ts +1 -1
  313. package/dist/components/lists-and-tables/list/list.i18n.js +1 -1
  314. package/dist/components/lists-and-tables/list/list.js +1 -1
  315. package/dist/components/lists-and-tables/list-item/list-item.d.ts +9 -2
  316. package/dist/components/lists-and-tables/list-item/list-item.d.ts.map +1 -1
  317. package/dist/components/lists-and-tables/list-item/list-item.js +22 -2
  318. package/dist/components/lists-and-tables/list-item/list-item.js.map +1 -1
  319. package/dist/components/lists-and-tables/list-item/list-item.styles.d.ts.map +1 -1
  320. package/dist/components/lists-and-tables/list-item/list-item.styles.js +0 -6
  321. package/dist/components/lists-and-tables/list-item/list-item.styles.js.map +1 -1
  322. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts +1 -1
  323. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts.map +1 -1
  324. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js +14 -2
  325. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js.map +1 -1
  326. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.d.ts +1 -1
  327. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.d.ts.map +1 -1
  328. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.js +1 -2
  329. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.template.js.map +1 -1
  330. package/dist/components/lists-and-tables/table/table.d.ts +24 -0
  331. package/dist/components/lists-and-tables/table/table.d.ts.map +1 -1
  332. package/dist/components/lists-and-tables/table/table.js +52 -4
  333. package/dist/components/lists-and-tables/table/table.js.map +1 -1
  334. package/dist/components/navigation/document-tab-bar/document-tab-bar.d.ts +4 -4
  335. package/dist/components/navigation/document-tab-bar/document-tab-bar.d.ts.map +1 -1
  336. package/dist/components/navigation/document-tab-bar/document-tab-bar.i18n.d.ts +1 -1
  337. package/dist/components/navigation/document-tab-bar/document-tab-bar.i18n.js +1 -1
  338. package/dist/components/navigation/document-tab-bar/document-tab-bar.i18n.js.map +1 -1
  339. package/dist/components/navigation/document-tab-bar/document-tab-bar.js +5 -2
  340. package/dist/components/navigation/document-tab-bar/document-tab-bar.js.map +1 -1
  341. package/dist/components/navigation/document-tab-bar/document-tab-bar.template.js +1 -1
  342. package/dist/components/navigation/document-tab-bar/document-tab-bar.template.js.map +1 -1
  343. package/dist/components/navigation/link/link.styles.d.ts.map +1 -1
  344. package/dist/components/navigation/link/link.styles.js +0 -4
  345. package/dist/components/navigation/link/link.styles.js.map +1 -1
  346. package/dist/components/navigation/link-group/link-group.d.ts +47 -0
  347. package/dist/components/navigation/link-group/link-group.d.ts.map +1 -0
  348. package/dist/components/navigation/link-group/link-group.js +81 -0
  349. package/dist/components/navigation/link-group/link-group.js.map +1 -0
  350. package/dist/components/navigation/link-group/link-group.styles.d.ts +2 -0
  351. package/dist/components/navigation/link-group/link-group.styles.d.ts.map +1 -0
  352. package/dist/components/navigation/link-group/link-group.styles.js +60 -0
  353. package/dist/components/navigation/link-group/link-group.styles.js.map +1 -0
  354. package/dist/components/navigation/link-group/link-group.template.d.ts +3 -0
  355. package/dist/components/navigation/link-group/link-group.template.d.ts.map +1 -0
  356. package/dist/components/navigation/link-group/link-group.template.js +15 -0
  357. package/dist/components/navigation/link-group/link-group.template.js.map +1 -0
  358. package/dist/components/navigation/menu-bar/menu-bar.d.ts.map +1 -1
  359. package/dist/components/navigation/menu-bar/menu-bar.js +4 -0
  360. package/dist/components/navigation/menu-bar/menu-bar.js.map +1 -1
  361. package/dist/components/navigation/menu-bar/menu-bar.styles.d.ts.map +1 -1
  362. package/dist/components/navigation/menu-bar/menu-bar.styles.js +9 -0
  363. package/dist/components/navigation/menu-bar/menu-bar.styles.js.map +1 -1
  364. package/dist/components/navigation/menu-bar/menu-bar.template.d.ts.map +1 -1
  365. package/dist/components/navigation/menu-bar/menu-bar.template.js +25 -19
  366. package/dist/components/navigation/menu-bar/menu-bar.template.js.map +1 -1
  367. package/dist/components/navigation/menu-bar-item/menu-bar-item.d.ts.map +1 -1
  368. package/dist/components/navigation/menu-bar-item/menu-bar-item.js +10 -0
  369. package/dist/components/navigation/menu-bar-item/menu-bar-item.js.map +1 -1
  370. package/dist/components/navigation/pagination/pagination.i18n.d.ts +3 -3
  371. package/dist/components/navigation/pagination/pagination.i18n.js +3 -3
  372. package/dist/components/navigation/pagination/pagination.i18n.js.map +1 -1
  373. package/dist/components/navigation/pagination/pagination.template.js +3 -3
  374. package/dist/components/navigation/pagination/pagination.template.js.map +1 -1
  375. package/dist/components/navigation/tab-bar/tab-bar.d.ts.map +1 -1
  376. package/dist/components/navigation/tab-bar/tab-bar.js +3 -0
  377. package/dist/components/navigation/tab-bar/tab-bar.js.map +1 -1
  378. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.d.ts.map +1 -1
  379. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.js +7 -6
  380. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.js.map +1 -1
  381. package/dist/components/navigation/top-title-bar/top-title-bar.d.ts +11 -0
  382. package/dist/components/navigation/top-title-bar/top-title-bar.d.ts.map +1 -1
  383. package/dist/components/navigation/top-title-bar/top-title-bar.js +37 -0
  384. package/dist/components/navigation/top-title-bar/top-title-bar.js.map +1 -1
  385. package/dist/components/navigation/top-title-bar/top-title-bar.template.js +1 -1
  386. package/dist/components/navigation/top-title-bar/top-title-bar.template.js.map +1 -1
  387. package/dist/components/{nl.generated-Ny3Kwppu.js → nl.generated-CUo20aPV.js} +5 -2
  388. package/dist/components/status-and-feedback/activity-indicator/activity-indicator.d.ts +1 -1
  389. package/dist/components/status-and-feedback/activity-indicator/activity-indicator.js +3 -3
  390. package/dist/components/status-and-feedback/activity-indicator/activity-indicator.js.map +1 -1
  391. package/dist/components/status-and-feedback/inline-dialog/inline-dialog.d.ts +2 -2
  392. package/dist/components/status-and-feedback/inline-dialog/inline-dialog.js +2 -2
  393. package/dist/components/status-and-feedback/inline-dialog/inline-dialog.styles.d.ts.map +1 -1
  394. package/dist/components/status-and-feedback/inline-dialog/inline-dialog.styles.js +9 -2
  395. package/dist/components/status-and-feedback/inline-dialog/inline-dialog.styles.js.map +1 -1
  396. package/dist/components/status-and-feedback/modal-dialog/modal-dialog.d.ts +1 -1
  397. package/dist/components/status-and-feedback/modal-dialog/modal-dialog.js +1 -1
  398. package/dist/components/status-and-feedback/modal-dialog/modal-dialog.styles.d.ts.map +1 -1
  399. package/dist/components/status-and-feedback/modal-dialog/modal-dialog.styles.js +9 -6
  400. package/dist/components/status-and-feedback/modal-dialog/modal-dialog.styles.js.map +1 -1
  401. package/dist/components/{visibility-mixin-DcwzF0_a.js → visibility-mixin-Ce0goNS6.js} +1 -1
  402. package/dist/css/rich-text.css +5 -0
  403. package/dist/css/variables.css +3 -1
  404. package/dist/nldd.min.js +1810 -1008
  405. package/dist/translations/en-US.d.ts.map +1 -1
  406. package/dist/translations/en-US.js +67 -23
  407. package/dist/translations/en-US.js.map +1 -1
  408. package/dist/translations/fy.d.ts +3 -3
  409. package/dist/translations/fy.d.ts.map +1 -1
  410. package/dist/translations/fy.js +82 -23
  411. package/dist/translations/fy.js.map +1 -1
  412. package/dist/translations/nl.generated.d.ts +55 -11
  413. package/dist/translations/nl.generated.d.ts.map +1 -1
  414. package/dist/translations/nl.generated.js +6 -0
  415. package/dist/translations/nl.generated.js.map +1 -1
  416. package/dist/translations/pap-AW.d.ts +3 -3
  417. package/dist/translations/pap-AW.d.ts.map +1 -1
  418. package/dist/translations/pap-AW.js +82 -23
  419. package/dist/translations/pap-AW.js.map +1 -1
  420. package/dist/translations/pap-CW.d.ts +3 -3
  421. package/dist/translations/pap-CW.d.ts.map +1 -1
  422. package/dist/translations/pap-CW.js +82 -23
  423. package/dist/translations/pap-CW.js.map +1 -1
  424. package/dist/types/vue.d.ts +153 -57
  425. package/dist/utilities/carried-context.d.ts +14 -3
  426. package/dist/utilities/carried-context.d.ts.map +1 -1
  427. package/dist/utilities/carried-context.js +12 -5
  428. package/dist/utilities/carried-context.js.map +1 -1
  429. package/dist/utilities/defer-focus.d.ts +24 -0
  430. package/dist/utilities/defer-focus.d.ts.map +1 -0
  431. package/dist/utilities/defer-focus.js +33 -0
  432. package/dist/utilities/defer-focus.js.map +1 -0
  433. package/dist/utilities/dev-rules.generated.d.ts.map +1 -1
  434. package/dist/utilities/dev-rules.generated.js +105 -3
  435. package/dist/utilities/dev-rules.generated.js.map +1 -1
  436. package/dist/utilities/file-drag-and-drop.d.ts +18 -0
  437. package/dist/utilities/file-drag-and-drop.d.ts.map +1 -0
  438. package/dist/utilities/file-drag-and-drop.js +31 -0
  439. package/dist/utilities/file-drag-and-drop.js.map +1 -0
  440. package/dist/utilities/list-items.d.ts +10 -0
  441. package/dist/utilities/list-items.d.ts.map +1 -0
  442. package/dist/utilities/list-items.js +21 -0
  443. package/dist/utilities/list-items.js.map +1 -0
  444. package/dist/utilities/owner-form.d.ts +21 -0
  445. package/dist/utilities/owner-form.d.ts.map +1 -0
  446. package/dist/utilities/owner-form.js +39 -0
  447. package/dist/utilities/owner-form.js.map +1 -0
  448. package/dist/utilities/popover-target.d.ts +25 -0
  449. package/dist/utilities/popover-target.d.ts.map +1 -0
  450. package/dist/utilities/popover-target.js +48 -0
  451. package/dist/utilities/popover-target.js.map +1 -0
  452. package/dist/utilities/popup-anchor-controller.d.ts.map +1 -1
  453. package/dist/utilities/popup-anchor-controller.js +11 -2
  454. package/dist/utilities/popup-anchor-controller.js.map +1 -1
  455. package/dist/utilities/render-marked.d.ts +2 -0
  456. package/dist/utilities/render-marked.d.ts.map +1 -1
  457. package/dist/utilities/render-marked.js +4 -0
  458. package/dist/utilities/render-marked.js.map +1 -1
  459. package/dist/utilities/row-header-mixin.d.ts +31 -0
  460. package/dist/utilities/row-header-mixin.d.ts.map +1 -0
  461. package/dist/utilities/row-header-mixin.js +44 -0
  462. package/dist/utilities/row-header-mixin.js.map +1 -0
  463. package/lint/cli.js +4 -4
  464. package/lint/data.generated.json +1 -1
  465. package/package.json +14 -5
@@ -23,12 +23,38 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
23
23
  * a pick. `accept` and `multiple` hold for a drop too, which the native input
24
24
  * does not do: a drop that does not fit is refused as a whole, the previous
25
25
  * choice stays, and the field says why for a few seconds: "Sleep één
26
- * bestand", or what `accept` takes, named from it ("Het bestand moet een PDF
27
- * zijn"; "Dit bestandstype past niet" where a type in it has no name). A
28
- * dropped folder is refused as well ("Sleep een bestand, geen map"): it
29
- * arrives as a file without a type that cannot be read, and only the drop
30
- * tells it apart, not the drag. The message stays for a few seconds and then
31
- * gives way to the field again.
26
+ * bestand", or what `accept` takes, named from it ("Alleen PDF";
27
+ * "Bestandstype past niet" where a type in it has no name). The
28
+ * message stays for a few seconds and then gives way to the field again.
29
+ * While it shows, the message is a button of its own over the whole field,
30
+ * "Alleen PDF, sluit melding, Bijlage" to a screen reader: a press on it, or
31
+ * Enter, Space or Escape, dismisses it and puts focus on the button of the
32
+ * field again. A field that had focus when the message came gives it to the
33
+ * message, so focus does not fall back to the page.
34
+ *
35
+ * With `multiple`, a dropped folder is read down to the files in it, its
36
+ * subfolders included, and mixed with loose files in one drop if need be. The
37
+ * field then names the folder ("site (124 bestanden)", also "site (1 bestand)"
38
+ * for one), `paths` says where each
39
+ * file sat ("site/css/main.css"), and a form submits each file with its path as
40
+ * its name, as a native folder input does, so two files with one name in
41
+ * different folders stay apart. `accept` holds for every file in it. Without
42
+ * `multiple` a folder is refused ("Sleep bestand, geen map"): one file
43
+ * cannot be a folder. Only a drop tells a folder apart, not the drag. A folder
44
+ * that takes longer than a second to read shows the field empty with an
45
+ * `nldd-activity-indicator` ("Laden" in an area, the circle alone otherwise),
46
+ * as what was chosen gives way to it. An empty or unreadable folder is refused
47
+ * as any other drop, and the previous choice comes back after the message.
48
+ *
49
+ * `directory` offers a folder in the file dialog too. A dialog picks files or a
50
+ * folder, never both, so with it the field says "Bestanden of map kiezen" and
51
+ * a click opens a menu with both where it lands, as a context menu does; the
52
+ * keyboard opens it under the button. An area has room for both, so there it
53
+ * shows "Bestanden kiezen" and "Map kiezen" as two buttons with the drop hint
54
+ * under them, and the surface around them only takes a drop.
55
+ * "Wijzigen" opens the menu under itself. A folder is many files, so `directory`
56
+ * takes several without `multiple`. Safari on iOS picks a folder as well; a
57
+ * browser that cannot opens a dialog for files instead.
32
58
  *
33
59
  * While files are dragged over the page, every field marks itself as a place
34
60
  * to put them, and the field under the pointer says it will take them (a field
@@ -38,6 +64,16 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
38
64
  * editable field takes is left alone. On a device without hover there is no
39
65
  * dragging, so the field there drops the hint.
40
66
  *
67
+ * A control reserves the height of every text it can show, so fields of a
68
+ * size are as tall at one width, empty or with a file. Only a field with
69
+ * `directory` reserves the sentence that offers a folder, the longest of them. The name takes the lines
70
+ * that leaves it, and is cut in the middle only once those are full. A narrow
71
+ * field makes more room: below 320px "Wijzigen" and "Wis selectie" go in one
72
+ * menu behind "Toon opties" and a folder is counted as "site (3)", below 240px
73
+ * it leaves out the icon of the format. A refused drop says why in place of
74
+ * the name and the buttons, and an area shows its upload icon in red with it,
75
+ * as it did while the drop was refused.
76
+ *
41
77
  * The surface deliberately does not look like an input field. A border with
42
78
  * field semantics promises you can type into it; here you can only press it or
43
79
  * drop a file on it, so it has the border of a tinted surface instead of
@@ -55,15 +91,20 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
55
91
  * `variant="area"` lays the same field out as a tall surface, for a page where
56
92
  * handing in files is the main task. Empty, it shows an upload icon, the
57
93
  * sentence and the types it takes ("Toegestaan: PDF of JPG"), named from
58
- * `accept`; with a file, the icon of its format, its name and the buttons
94
+ * `accept`; with a file, the icon of its format (a folder for a folder, a
95
+ * stack for several files), its name and the buttons
59
96
  * "Wijzigen" and "Wis selectie" stacked in the middle. Both states have the same
60
- * height, so the page does not move when a file is chosen.
97
+ * height, so the page does not move when a file is chosen: 160px, 120px at
98
+ * `size="sm"`, and a step more with `directory`, whose buttons take a row of
99
+ * their own. Where those buttons no longer fit side by side, below 360px or
100
+ * 300px at `size="sm"`, it is one step taller again.
61
101
  *
62
102
  * @element nldd-file-field
63
103
  * @attr {string} variant - 'control' (default): a row the height of a field. 'area': a tall surface with the upload icon and the accepted types when empty, and the file icon, name and buttons stacked once chosen; both states keep the same height
64
104
  * @attr {string} size - Field size: 'md' (default) | 'sm'. Set automatically by nldd-form-field.
65
105
  * @attr {string} accept - Comma-separated list of accepted file types, forwarded to the input (e.g. ".pdf,image/*")
66
- * @attr {boolean} multiple - Allows choosing more than one file
106
+ * @attr {boolean} multiple - Allows choosing more than one file, and dropping a folder
107
+ * @attr {boolean} directory - Offers a folder beside files, since one dialog picks either: choosing and changing open a menu with both, and an area shows a button for each. Takes several files, as `multiple` does
67
108
  * @attr {string} accessible-label - Accessible label forwarded to the inner input. Set automatically by nldd-form-field.
68
109
  * @attr {string} input-id - Sets the id on the native input. Set automatically by nldd-form-field.
69
110
  * @attr {boolean} valid - Marks the field as valid; shows a check icon on the right, like nldd-dropdown
@@ -74,8 +115,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
74
115
  * @attr {object} translations - Override translation keys; unset keys fall back to Dutch
75
116
  *
76
117
  * @prop {File[]} files - The chosen files. Read-only: browsers forbid setting a file input's value, so there is no `value` attribute and no way to preselect a file.
118
+ * @prop {string[]} paths - Where each of `files` sat, in the same order: its name, or for a file from a dropped folder the path from that folder down. Read-only.
77
119
  *
78
- * @fires change - When the chosen files change, including a clear; detail: { files: File[] }
120
+ * @fires change - When the chosen files change, including a clear; detail: { files: File[], paths: string[] }
79
121
  */
80
122
  import { LitElement } from 'lit';
81
123
  import { property, query, state } from 'lit/decorators.js';
@@ -85,12 +127,19 @@ import { reflectNonDefault } from '../../../utilities/reflect-non-default.js';
85
127
  import { fileFieldStyles } from './file-field.styles.js';
86
128
  import { fileFieldTemplate } from './file-field.template.js';
87
129
  import { nlddFileFieldTranslations } from './file-field.i18n.js';
88
- import { acceptNames, carriesFiles, holdsFolder, fileMatches, typeRuledOut, unwatchDrags, watchDrags, } from './file-field.drop.js';
89
- import { textMeasurer, truncateMiddle } from './file-field.truncate.js';
130
+ import { acceptNames, carriesFiles, holdsFolder, readDrop, fileMatches, typeRuledOut, unwatchDrags, watchDrags, } from './file-field.drop.js';
131
+ import { lineFitter, textMeasurer, truncateMiddle, truncateMiddleToFit } from './file-field.truncate.js';
90
132
  import { DescribedBy } from '../../../utilities/described-by-mixin.js';
91
133
  import { translate } from '../../../utilities/translations.js';
134
+ import { deferFocus } from '../../../utilities/defer-focus.js';
135
+ import { fileDragAndDropAvailable, FileDragAndDropAvailabilityController } from '../../../utilities/file-drag-and-drop.js';
92
136
  /** How long the message of a refused drop stays in the field. */
93
137
  const REJECTION_MS = 4000;
138
+ /** How long a folder is read before the field shows it is busy. Most folders
139
+ * are read sooner, and the field then does not flash. */
140
+ const READING_INDICATOR_DELAY_MS = 1000;
141
+ /** A click this soon after the choose menu closed is the one that closed it. */
142
+ const REOPEN_GUARD_MS = 300;
94
143
  /** The word for a family of types in `accept`, such as `image/*`. */
95
144
  const FAMILY_KEYS = {
96
145
  image: 'components.file-field.image-lowercase',
@@ -105,6 +154,8 @@ let NLDDFileField = class NLDDFileField extends DescribedBy(FormAssociated(LitEl
105
154
  this.size = 'md';
106
155
  this.accept = '';
107
156
  this.multiple = false;
157
+ /** Offers a folder beside files: choosing opens a menu with both. */
158
+ this.directory = false;
108
159
  /** Accessible label forwarded to the inner <input>. Set automatically by nldd-form-field. */
109
160
  this.accessibleLabel = '';
110
161
  this.inputId = '';
@@ -117,6 +168,8 @@ let NLDDFileField = class NLDDFileField extends DescribedBy(FormAssociated(LitEl
117
168
  /** The chosen files. Mirrors the input's FileList; there is no setter, because
118
169
  * browsers refuse a programmatic file selection. */
119
170
  this._files = [];
171
+ /** Where each of `_files` sat, in the same order. */
172
+ this._paths = [];
120
173
  /** @internal Where a dragged file is, seen from this field. */
121
174
  this._drag = 'none';
122
175
  /** @internal Why the file under the pointer would be refused. */
@@ -126,10 +179,28 @@ let NLDDFileField = class NLDDFileField extends DescribedBy(FormAssociated(LitEl
126
179
  this._fittedName = null;
127
180
  /** @internal Whether the name is cut short, and so shows whole in a tooltip. */
128
181
  this._nameTruncated = false;
182
+ /** @internal The name of the chosen folder cut in the middle to fit, or null
183
+ * while it fits or CSS cuts it on one line. */
184
+ this._fittedFolder = null;
185
+ /** @internal The lines the name has room for. */
186
+ this._nameLines = 1;
129
187
  /** @internal What a screen reader hears after a drop that was taken. */
130
188
  this._announcement = '';
189
+ /** @internal Whether a dropped folder has been read for a while now, so the
190
+ * field shows it is busy. */
191
+ this._reading = false;
131
192
  /** @internal Why the last drop was refused; shown for a few seconds. */
132
193
  this._rejection = null;
194
+ /** @internal Whether the choose menu is open, for `expanded` on the button. */
195
+ this._menuOpen = false;
196
+ /** When the choose menu last closed, for the press that closed it. */
197
+ this._menuClosedAt = -Infinity;
198
+ /** Renders again when dragging files becomes possible or not, so the drop
199
+ * hint in the name of the button follows the one on screen. */
200
+ this._fileDrag = new FileDragAndDropAvailabilityController(this);
201
+ /** Counts every pick, drop and clear, so a folder that takes long to read
202
+ * does not overwrite what the user did in the meantime. */
203
+ this._action = 0;
133
204
  this._handleDragOver = (e) => {
134
205
  if (this.disabled || !e.dataTransfer || !carriesFiles(e.dataTransfer))
135
206
  return;
@@ -145,64 +216,108 @@ let NLDDFileField = class NLDDFileField extends DescribedBy(FormAssociated(LitEl
145
216
  e.preventDefault();
146
217
  if (this.disabled)
147
218
  return;
219
+ const action = ++this._action;
220
+ this._stopReading();
148
221
  const files = Array.from(e.dataTransfer.files);
149
222
  const rejection = this._judge(e.dataTransfer, files);
150
223
  if (rejection) {
151
- this._rejection = rejection;
152
- // Shown for a while, then the field reads as itself again: the message
153
- // takes the place of "Bestand kiezen", and a field that kept it looked
154
- // as if it no longer did anything. The status line keeps it for a
155
- // screen reader.
156
- clearTimeout(this._rejectionTimer);
157
- this._rejectionTimer = setTimeout(() => {
158
- this._announcement = this._rejectionText(rejection);
159
- this._rejection = null;
160
- }, REJECTION_MS);
224
+ this._refuse(rejection);
161
225
  return;
162
226
  }
163
- if (this._input)
164
- this._input.files = e.dataTransfer.files;
165
- this._files = files;
166
- this._rejection = null;
167
- // A pick moves focus to the change button, which names the file; a drop
168
- // moves nothing, so it is said.
169
- this._announcement = this._t('components.file-field.file-chosen-text', { name: this._valueLabel() });
170
- this._commit();
227
+ if (holdsFolder(e.dataTransfer)) {
228
+ // A folder with nothing in it, or one the browser could not read (a file
229
+ // gone mid-drop, no permission), says so, as any other refused drop does.
230
+ this._readingTimer = setTimeout(() => {
231
+ this._reading = true;
232
+ }, READING_INDICATOR_DELAY_MS);
233
+ void readDrop(e.dataTransfer).then((dropped) => {
234
+ if (action !== this._action)
235
+ return;
236
+ this._stopReading();
237
+ if (dropped.length)
238
+ this._takeDrop(dropped);
239
+ else
240
+ this._refuse('empty-folder');
241
+ }, () => {
242
+ if (action !== this._action)
243
+ return;
244
+ this._stopReading();
245
+ this._refuse('unreadable-folder');
246
+ });
247
+ return;
248
+ }
249
+ this._takeDrop(files.map((file) => ({ file, path: file.name })));
171
250
  };
251
+ /** Takes the message away, and gives focus back to the button of the field
252
+ * when the message had it, as it goes with the message. */
172
253
  this._clearRejection = () => {
254
+ const hadFocus = this.shadowRoot?.activeElement?.classList.contains('file-field__dismiss-button') ?? false;
173
255
  clearTimeout(this._rejectionTimer);
174
256
  this._rejection = null;
175
257
  this._announcement = '';
258
+ if (hadFocus)
259
+ void this.updateComplete.then(() => this.focus());
176
260
  };
177
261
  this._handleKeydown = (e) => {
178
262
  if (e.key === 'Escape')
179
263
  this._clearRejection();
180
264
  };
181
265
  }
266
+ /** @internal A folder is many files, so `directory` takes several too. */
267
+ get _multiple() {
268
+ return this.multiple || this.directory;
269
+ }
182
270
  get files() {
183
271
  return this._files;
184
272
  }
273
+ /** Where each file sat: its name, or for a file from a dropped folder the
274
+ * path from that folder down ("site/css/main.css"). Same order as `files`. */
275
+ get paths() {
276
+ return this._paths;
277
+ }
278
+ /** @internal Whether the field says why a drop was refused, which a new drag
279
+ * takes the place of. */
280
+ get _refused() {
281
+ return this._rejection !== null && this._drag === 'none';
282
+ }
185
283
  /** @internal */
186
284
  _t(key, vars) {
187
285
  return translate(this.translations, nlddFileFieldTranslations, key, vars);
188
286
  }
189
287
  /** @internal */
190
288
  _chooseLabel() {
191
- return this.multiple
289
+ if (this.directory)
290
+ return this._t('components.file-field.to-choose-files-or-folder-action');
291
+ return this._multiple
192
292
  ? this._t('components.file-field.to-choose-files-action')
193
293
  : this._t('components.file-field.to-choose-file-action');
194
294
  }
195
295
  /**
196
296
  * The native input carries the field's label but is hidden, so it is not in
197
297
  * the accessibility tree. The button is what you tab to, and on its own it
198
- * only says "choose a file" — for which field is the part that matters.
298
+ * does not say for which field, so the label comes in its name.
299
+ *
300
+ * After everything the button shows, and not in place of part of it: a voice
301
+ * command or an audit compares the name with the visible text, and "Bestand
302
+ * kiezen, Bijlage" under "Bestand kiezen of sleep het hierheen" is a mismatch
303
+ * (WCAG 2.5.3). The change button does the same.
304
+ *
305
+ * The drop hint only where it shows: a device without hover cannot drag, so
306
+ * there the hint is gone from the field and from the name alike, and a screen
307
+ * reader is not told to do what cannot be done.
199
308
  *
200
309
  * @internal
201
310
  */
202
311
  _chooseAccessibleLabel() {
203
- if (!this.accessibleLabel)
204
- return '';
205
- return `${this._chooseLabel()}, ${this.accessibleLabel}`;
312
+ const hint = !fileDragAndDropAvailable() ? '' : this._multiple
313
+ ? this._t('components.file-field.drop-hint-multiple-lowercase-text')
314
+ : this._t('components.file-field.drop-hint-lowercase-text');
315
+ const types = this.variant === 'area' ? this._acceptTypes() : null;
316
+ return [
317
+ hint ? `${this._chooseLabel()} ${hint}` : this._chooseLabel(),
318
+ types ? this._t('components.file-field.accepted-types-text', { types }) : '',
319
+ this.accessibleLabel,
320
+ ].filter(Boolean).join(', ');
206
321
  }
207
322
  /**
208
323
  * The change button is where focus lands after a pick, so its name says for
@@ -238,24 +353,42 @@ let NLDDFileField = class NLDDFileField extends DescribedBy(FormAssociated(LitEl
238
353
  _rejectionText(reason) {
239
354
  if (reason === 'count')
240
355
  return this._t('components.file-field.too-many-files-error-text');
241
- if (reason === 'folder') {
242
- return this.multiple
243
- ? this._t('components.file-field.folder-multiple-error-text')
244
- : this._t('components.file-field.folder-error-text');
245
- }
356
+ if (reason === 'folder')
357
+ return this._t('components.file-field.folder-error-text');
358
+ if (reason === 'empty-folder')
359
+ return this._t('components.file-field.empty-folder-error-text');
360
+ if (reason === 'unreadable-folder')
361
+ return this._t('components.file-field.unreadable-folder-error-text');
246
362
  const types = this._acceptTypes();
247
363
  if (!types)
248
364
  return this._t('components.file-field.wrong-file-type-error-text');
249
- return this.multiple
365
+ return this._multiple
250
366
  ? this._t('components.file-field.files-type-error-text', { types })
251
367
  : this._t('components.file-field.file-type-error-text', { types });
252
368
  }
369
+ /** @internal "Toon opties" with what they are for: "Toon opties, rapport.pdf". */
370
+ _moreAccessibleLabel() {
371
+ return `${this._t('components.file-field.show-options-action')}, ${this._valueLabel()}`;
372
+ }
253
373
  /** @internal */
254
374
  _valueLabel() {
375
+ const folder = this._folderName();
376
+ if (folder) {
377
+ return this._files.length === 1
378
+ ? this._t('components.file-field.folder-one-file-text', { folder })
379
+ : this._t('components.file-field.folder-count-text', { folder, count: this._files.length });
380
+ }
255
381
  if (this._files.length === 1)
256
382
  return this._files[0].name;
257
383
  return this._t('components.file-field.file-count-text', { count: this._files.length });
258
384
  }
385
+ /** @internal The folder everything came from, picked or dropped, or null.
386
+ * A folder with one file is still named as a folder, as `paths` has it. */
387
+ _folderName() {
388
+ const folders = new Set(this._paths.map((path) => (path.includes('/') ? path.split('/')[0] : '')));
389
+ const [folder] = folders;
390
+ return folders.size === 1 && folder ? folder : null;
391
+ }
259
392
  connectedCallback() {
260
393
  super.connectedCallback();
261
394
  watchDrags(this);
@@ -268,7 +401,6 @@ let NLDDFileField = class NLDDFileField extends DescribedBy(FormAssociated(LitEl
268
401
  });
269
402
  this.addEventListener('dragover', this._handleDragOver);
270
403
  this.addEventListener('drop', this._handleDrop);
271
- this.addEventListener('pointerdown', this._clearRejection);
272
404
  this.addEventListener('keydown', this._handleKeydown);
273
405
  }
274
406
  disconnectedCallback() {
@@ -276,10 +408,10 @@ let NLDDFileField = class NLDDFileField extends DescribedBy(FormAssociated(LitEl
276
408
  unwatchDrags(this);
277
409
  this._resizeObserver?.disconnect();
278
410
  clearTimeout(this._rejectionTimer);
411
+ this._stopReading();
279
412
  this._observedValue = undefined;
280
413
  this.removeEventListener('dragover', this._handleDragOver);
281
414
  this.removeEventListener('drop', this._handleDrop);
282
- this.removeEventListener('pointerdown', this._clearRejection);
283
415
  this.removeEventListener('keydown', this._handleKeydown);
284
416
  }
285
417
  updated(changed) {
@@ -295,14 +427,20 @@ let NLDDFileField = class NLDDFileField extends DescribedBy(FormAssociated(LitEl
295
427
  await Promise.all(Array.from(buttons, (button) => button.updateComplete));
296
428
  this._fitName();
297
429
  }
298
- /** Cuts the chosen name in the middle to the width it has. Without a width
299
- * (a hidden field), it falls back to the CSS cut of the first render. */
430
+ /** Cuts the chosen name in the middle to the room it has: one line, or in a
431
+ * control as many lines as its texts reserve anyway, so a name never makes
432
+ * the field taller. A folder keeps its count whole and gives up its name.
433
+ * Without a width (a hidden field), it falls back to the CSS cut of the
434
+ * first render. */
300
435
  _fitName() {
301
- const value = this.shadowRoot?.querySelector('.file-field__value');
302
- const name = this.shadowRoot?.querySelector('.file-field__name');
303
- if (this._files.length !== 1 || !value || !name) {
304
- this._fittedName = null;
305
- this._nameTruncated = false;
436
+ const root = this.shadowRoot;
437
+ const value = root?.querySelector('.file-field__value');
438
+ const folder = this._folderName();
439
+ const label = folder
440
+ ? Array.from(root?.querySelectorAll('.file-field__folder') ?? []).find((variant) => variant.checkVisibility())
441
+ : root?.querySelector('.file-field__name');
442
+ if (!value || !label || (!folder && this._files.length !== 1)) {
443
+ this._resetFit();
306
444
  return;
307
445
  }
308
446
  // The buttons beside the name take their width after their own render, so
@@ -316,44 +454,146 @@ let NLDDFileField = class NLDDFileField extends DescribedBy(FormAssociated(LitEl
316
454
  const style = getComputedStyle(value);
317
455
  const width = value.clientWidth - parseFloat(style.paddingLeft) - parseFloat(style.paddingRight);
318
456
  if (width <= 0) {
319
- this._fittedName = null;
320
- this._nameTruncated = false;
457
+ this._resetFit();
321
458
  return;
322
459
  }
323
- const { measure, done } = textMeasurer(name);
324
- try {
325
- const { text, truncated } = truncateMiddle(this._files[0].name, width, measure);
326
- this._fittedName = text;
460
+ const lines = this._nameLinesFor(value);
461
+ this._nameLines = lines;
462
+ if (folder) {
463
+ if (lines === 1) {
464
+ // CSS gives up the name of the folder before its count.
465
+ this._fittedFolder = null;
466
+ this._nameTruncated = false;
467
+ return;
468
+ }
469
+ const text = label.classList.contains('file-field__folder--short')
470
+ ? this._t('components.file-field.folder-count-short-text', { folder, count: this._files.length })
471
+ : this._valueLabel();
472
+ const at = text.indexOf(folder);
473
+ const [before, after] = at < 0 ? ['', ''] : [text.slice(0, at), text.slice(at + folder.length)];
474
+ const { text: fitted, truncated } = this._cutToLines(value, width, lines, folder, (name) => before + name + after, false);
475
+ this._fittedFolder = fitted;
327
476
  this._nameTruncated = truncated;
477
+ return;
478
+ }
479
+ const name = this._files[0].name;
480
+ if (lines === 1) {
481
+ const { measure, done } = textMeasurer(label);
482
+ try {
483
+ const { text, truncated } = truncateMiddle(name, width, measure);
484
+ this._fittedName = text;
485
+ this._nameTruncated = truncated;
486
+ }
487
+ finally {
488
+ done();
489
+ }
490
+ return;
491
+ }
492
+ const { text, truncated } = this._cutToLines(value, width, lines, name);
493
+ this._fittedName = text;
494
+ this._nameTruncated = truncated;
495
+ }
496
+ /** `name` cut in the middle until `shown(name)` fits on `lines` lines. */
497
+ _cutToLines(value, width, lines, name, shown = (text) => text, keepExtension = true) {
498
+ const { fits, done } = lineFitter(value, width, lines);
499
+ try {
500
+ return truncateMiddleToFit(name, (text) => fits(shown(text)), { keepExtension });
328
501
  }
329
502
  finally {
330
503
  done();
331
504
  }
332
505
  }
506
+ /** The lines a control has for its name: what its tallest text takes, the
507
+ * room around a text off. An area shows one. */
508
+ _nameLinesFor(value) {
509
+ const text = this.shadowRoot?.querySelector('.file-field__replace-area .file-field__text');
510
+ if (this.variant === 'area' || !text)
511
+ return 1;
512
+ const style = getComputedStyle(text);
513
+ const room = text.clientHeight - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom);
514
+ return Math.max(1, Math.floor((room + 0.5) / parseFloat(getComputedStyle(value).lineHeight)));
515
+ }
516
+ _resetFit() {
517
+ this._fittedName = null;
518
+ this._fittedFolder = null;
519
+ this._nameTruncated = false;
520
+ this._nameLines = 1;
521
+ }
333
522
  willUpdate(changed) {
334
- if (changed.has('_files')) {
335
- this._fittedName = null;
336
- this._nameTruncated = false;
337
- }
523
+ if (changed.has('_files'))
524
+ this._resetFit();
338
525
  if (changed.has('required'))
339
526
  this._updateValidity();
340
527
  if (changed.has('accessibleLabel'))
341
528
  this.internals.ariaLabel = this.accessibleLabel || null;
342
529
  }
343
530
  /** @internal */
344
- _handleChoose() {
531
+ _handleChoose(e) {
345
532
  this._clearRejection();
533
+ // With a folder on offer, a press asks which of the two: one dialog picks
534
+ // files or a folder, never both.
535
+ const menu = this._chooseMenu;
536
+ if (this.directory && menu && e?.currentTarget instanceof Element) {
537
+ // A press on the field while the menu is open closes it. Light dismiss
538
+ // usually did so on pointerdown already, so this click must not reopen it.
539
+ if (menu.matches(':popover-open')) {
540
+ menu.hidePopover();
541
+ return;
542
+ }
543
+ if (performance.now() - this._menuClosedAt < REOPEN_GUARD_MS)
544
+ return;
545
+ // The field opens it where it was clicked; "Wijzigen" opens it under itself.
546
+ const field = e.currentTarget.classList.contains('file-field__choose-button');
547
+ menu.anchorElement = (field && this._pointAt(e)) || e.currentTarget;
548
+ menu.showPopover();
549
+ return;
550
+ }
346
551
  this._input?.click();
347
552
  }
553
+ /** The point a mouse or a finger pressed, as an element the menu can hang
554
+ * from, so it opens there. Null for the keyboard, whose click has no point
555
+ * (`detail` 0): the menu then hangs under the button. */
556
+ _pointAt(e) {
557
+ const anchor = this._menuAnchor;
558
+ const field = anchor?.parentElement;
559
+ if (!(e instanceof MouseEvent) || e.detail === 0 || !anchor || !field)
560
+ return null;
561
+ const box = field.getBoundingClientRect();
562
+ anchor.style.left = `${e.clientX - box.left}px`;
563
+ anchor.style.top = `${e.clientY - box.top}px`;
564
+ return anchor;
565
+ }
566
+ /** @internal */
567
+ _handleMenuToggle(e) {
568
+ this._menuOpen = e.newState === 'open';
569
+ if (!this._menuOpen)
570
+ this._menuClosedAt = performance.now();
571
+ }
572
+ /** @internal Picked in the menu of a field with `directory`. */
573
+ _chooseFiles() {
574
+ this._input?.click();
575
+ }
576
+ /** @internal Picked in the menu of a field with `directory`. */
577
+ _chooseFolder() {
578
+ this._folderInput?.click();
579
+ }
348
580
  /** @internal */
349
581
  _handleInputChange(e) {
350
582
  e.stopPropagation();
351
583
  const input = e.target;
584
+ this._action++;
585
+ this._stopReading();
586
+ // The other input keeps its previous pick otherwise, and picking that
587
+ // again would fire no change.
588
+ const other = input === this._input ? this._folderInput : this._input;
589
+ if (other)
590
+ other.value = '';
352
591
  // The choose button gives way to the change button once there is a file,
353
592
  // and the other way round, so focus would land on the body.
354
593
  const hadFocus = this.matches(':focus-within');
355
594
  this._files = input.files ? Array.from(input.files) : [];
356
- this._rejection = null;
595
+ this._paths = this._files.map((file) => file.webkitRelativePath || file.name);
596
+ this._clearRejection();
357
597
  this._commit();
358
598
  if (hadFocus)
359
599
  void this.updateComplete.then(() => this.focus());
@@ -364,14 +604,17 @@ let NLDDFileField = class NLDDFileField extends DescribedBy(FormAssociated(LitEl
364
604
  * on names and types; without, a drag only on what it shows before the drop. */
365
605
  _judge(transfer, files) {
366
606
  if (files) {
367
- if (!this.multiple && files.length > 1)
607
+ if (!this._multiple && files.length > 1)
368
608
  return 'count';
369
- if (holdsFolder(transfer))
370
- return 'folder';
609
+ if (holdsFolder(transfer)) {
610
+ // Several files may come from a folder; one file cannot be a folder.
611
+ // The types are judged once the folder is read.
612
+ return this._multiple ? null : 'folder';
613
+ }
371
614
  return files.every((file) => fileMatches(this.accept, file)) ? null : 'type';
372
615
  }
373
616
  const items = Array.from(transfer.items).filter((item) => item.kind === 'file');
374
- if (!this.multiple && items.length > 1)
617
+ if (!this._multiple && items.length > 1)
375
618
  return 'count';
376
619
  return items.some((item) => typeRuledOut(this.accept, item.type)) ? 'type' : null;
377
620
  }
@@ -388,13 +631,73 @@ let NLDDFileField = class NLDDFileField extends DescribedBy(FormAssociated(LitEl
388
631
  this._dragRejection = state === 'over' && transfer ? this._judge(transfer) : null;
389
632
  this._drag = this._dragRejection ? 'rejected' : state;
390
633
  }
634
+ /** A drop that passed the count, with its folders read: judged on the types
635
+ * of the files in it, then taken in place of what the field had. */
636
+ _takeDrop(dropped) {
637
+ if (!dropped.every(({ file }) => fileMatches(this.accept, file))) {
638
+ this._refuse('type');
639
+ return;
640
+ }
641
+ const transfer = new DataTransfer();
642
+ for (const { file } of dropped)
643
+ transfer.items.add(file);
644
+ if (this._input)
645
+ this._input.files = transfer.files;
646
+ if (this._folderInput)
647
+ this._folderInput.value = '';
648
+ this._files = dropped.map(({ file }) => file);
649
+ this._paths = dropped.map(({ path }) => path);
650
+ this._clearRejection();
651
+ // A pick moves focus to the change button, which names the file; a drop
652
+ // moves nothing, so it is said.
653
+ this._announcement = this._t('components.file-field.file-chosen-text', { name: this._valueLabel() });
654
+ this._commit();
655
+ }
656
+ /** Shown for a while, then the field reads as itself again: the message
657
+ * takes the place of "Bestand kiezen", and a field that kept it looked as if
658
+ * it no longer did anything. The status line keeps it for a screen reader. */
659
+ _refuse(rejection) {
660
+ const hadFocus = this.matches(':focus-within');
661
+ this._rejection = rejection;
662
+ clearTimeout(this._rejectionTimer);
663
+ this._rejectionTimer = setTimeout(() => {
664
+ this._clearRejection();
665
+ this._announcement = this._rejectionText(rejection);
666
+ }, REJECTION_MS);
667
+ // The buttons give way to the message, so focus goes to it.
668
+ if (hadFocus)
669
+ void this.updateComplete.then(() => this.focus());
670
+ }
671
+ _stopReading() {
672
+ clearTimeout(this._readingTimer);
673
+ this._reading = false;
674
+ }
675
+ /** @internal A press on the message dismisses it, and does nothing else. */
676
+ _handleDismiss() {
677
+ this._clearRejection();
678
+ void this.updateComplete.then(() => this.focus());
679
+ }
680
+ /** @internal "Alleen PDF, sluit melding, Bijlage": the message as it shows,
681
+ * what a press does, and for which field. */
682
+ _dismissAccessibleLabel() {
683
+ if (!this._rejection)
684
+ return '';
685
+ return [this._rejectionText(this._rejection), this._t('components.file-field.dismiss-message-lowercase-action'), this.accessibleLabel]
686
+ .filter(Boolean)
687
+ .join(', ');
688
+ }
391
689
  /** @internal */
392
690
  _handleClear() {
393
691
  // Clearing the input as well as the array: the element keeps the previous
394
692
  // FileList otherwise, so choosing the same file again would fire no change.
693
+ this._action++;
694
+ this._stopReading();
395
695
  if (this._input)
396
696
  this._input.value = '';
697
+ if (this._folderInput)
698
+ this._folderInput.value = '';
397
699
  this._files = [];
700
+ this._paths = [];
398
701
  this._commit();
399
702
  // Focus would land on the body when the cross unmounts with the last file.
400
703
  void this.updateComplete.then(() => this.focus());
@@ -402,7 +705,7 @@ let NLDDFileField = class NLDDFileField extends DescribedBy(FormAssociated(LitEl
402
705
  _commit() {
403
706
  this.commitFormValue();
404
707
  this.dispatchEvent(new CustomEvent('change', {
405
- detail: { files: this._files },
708
+ detail: { files: this._files, paths: this._paths },
406
709
  bubbles: true,
407
710
  composed: true,
408
711
  }));
@@ -410,15 +713,17 @@ let NLDDFileField = class NLDDFileField extends DescribedBy(FormAssociated(LitEl
410
713
  // — Form participation ————————————————————————————————————————————————————
411
714
  /** Submit one entry per file under `name`, the way a native multiple file
412
715
  * input does. A single file is submitted as itself, so a form with one file
413
- * reads back as a File rather than as FormData wrapping one. */
716
+ * reads back as a File rather than as FormData wrapping one. A file from a
717
+ * dropped folder goes with its path as its file name, which is how a native
718
+ * folder input submits it too. */
414
719
  formValue() {
415
720
  if (!this.name || this._files.length === 0)
416
721
  return null;
417
- if (this._files.length === 1)
722
+ const nested = this._paths.some((path) => path.includes('/'));
723
+ if (this._files.length === 1 && !nested)
418
724
  return this._files[0];
419
725
  const data = new FormData();
420
- for (const file of this._files)
421
- data.append(this.name, file);
726
+ this._files.forEach((file, index) => data.append(this.name, file, this._paths[index] ?? file.name));
422
727
  return data;
423
728
  }
424
729
  commitFormValue() {
@@ -434,16 +739,30 @@ let NLDDFileField = class NLDDFileField extends DescribedBy(FormAssociated(LitEl
434
739
  this.internals.setValidity({});
435
740
  }
436
741
  }
742
+ /** Back to empty, as a clear, but without a change event, as a native
743
+ * input resets: a folder still being read is dropped too. */
437
744
  formResetCallback() {
745
+ this._action++;
746
+ this._stopReading();
747
+ this._clearRejection();
438
748
  if (this._input)
439
749
  this._input.value = '';
750
+ if (this._folderInput)
751
+ this._folderInput.value = '';
440
752
  this._files = [];
753
+ this._paths = [];
441
754
  this.commitFormValue();
442
755
  }
443
- /** The button that opens the dialog: the whole surface while the field is
444
- * empty, "Wijzigen" once it has a file. */
756
+ /** The message of a refused drop while it shows. Otherwise the button that
757
+ * opens the dialog: the whole surface while the field is
758
+ * empty, or the first of its two choices in an area with `directory`, and
759
+ * "Wijzigen" once it has a file, or the menu that holds it in a narrow field. */
445
760
  _chooseButton() {
446
- return this.shadowRoot?.querySelector('.file-field__browse-button, nldd-button') ?? null;
761
+ const dismiss = this.shadowRoot?.querySelector('.file-field__dismiss-button');
762
+ if (dismiss)
763
+ return dismiss;
764
+ const buttons = this.shadowRoot?.querySelectorAll('.file-field__choose-button, .file-field__choose-button-group nldd-button, .file-field__change-button, .file-field__more-button') ?? [];
765
+ return Array.from(buttons).find((button) => button.checkVisibility?.() ?? true) ?? buttons[0] ?? null;
447
766
  }
448
767
  /**
449
768
  * Delegates focus to the choose button rather than the hidden input: an input
@@ -451,6 +770,8 @@ let NLDDFileField = class NLDDFileField extends DescribedBy(FormAssociated(LitEl
451
770
  * sees as the control.
452
771
  */
453
772
  focus(options) {
773
+ if (deferFocus(this, options))
774
+ return;
454
775
  this._chooseButton()?.focus(options);
455
776
  }
456
777
  /** The file input is display:none and therefore not in the accessibility tree.
@@ -478,6 +799,9 @@ __decorate([
478
799
  __decorate([
479
800
  property({ type: Boolean, reflect: true })
480
801
  ], NLDDFileField.prototype, "multiple", void 0);
802
+ __decorate([
803
+ property({ type: Boolean, reflect: true })
804
+ ], NLDDFileField.prototype, "directory", void 0);
481
805
  __decorate([
482
806
  property({ type: String, attribute: 'accessible-label' })
483
807
  ], NLDDFileField.prototype, "accessibleLabel", void 0);
@@ -517,15 +841,36 @@ __decorate([
517
841
  __decorate([
518
842
  state()
519
843
  ], NLDDFileField.prototype, "_nameTruncated", void 0);
844
+ __decorate([
845
+ state()
846
+ ], NLDDFileField.prototype, "_fittedFolder", void 0);
847
+ __decorate([
848
+ state()
849
+ ], NLDDFileField.prototype, "_nameLines", void 0);
520
850
  __decorate([
521
851
  state()
522
852
  ], NLDDFileField.prototype, "_announcement", void 0);
853
+ __decorate([
854
+ state()
855
+ ], NLDDFileField.prototype, "_reading", void 0);
523
856
  __decorate([
524
857
  state()
525
858
  ], NLDDFileField.prototype, "_rejection", void 0);
859
+ __decorate([
860
+ state()
861
+ ], NLDDFileField.prototype, "_menuOpen", void 0);
526
862
  __decorate([
527
863
  query('.file-field__input')
528
864
  ], NLDDFileField.prototype, "_input", void 0);
865
+ __decorate([
866
+ query('.file-field__folder-input')
867
+ ], NLDDFileField.prototype, "_folderInput", void 0);
868
+ __decorate([
869
+ query('.file-field__choose-menu')
870
+ ], NLDDFileField.prototype, "_chooseMenu", void 0);
871
+ __decorate([
872
+ query('.file-field__menu-anchor')
873
+ ], NLDDFileField.prototype, "_menuAnchor", void 0);
529
874
  NLDDFileField = __decorate([
530
875
  customElement('nldd-file-field')
531
876
  ], NLDDFileField);