@bk2k/ui 0.6.8 → 0.7.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 (471) hide show
  1. package/BUILDING.md +56 -2
  2. package/CHANGELOG.md +136 -0
  3. package/USAGE.md +89 -26
  4. package/custom-elements.json +1 -1
  5. package/dist/charts/chart-tokens.js +1 -1
  6. package/dist/charts/fields.d.ts +20 -0
  7. package/dist/charts/fields.js +27 -0
  8. package/dist/charts/frame.js +2 -1
  9. package/dist/clipboard.js +1 -0
  10. package/dist/components/bk-alert.js +2 -1
  11. package/dist/components/bk-avatar-group.js +4 -6
  12. package/dist/components/bk-avatar.d.ts +10 -0
  13. package/dist/components/bk-avatar.js +17 -0
  14. package/dist/components/bk-bar.js +2 -0
  15. package/dist/components/bk-button-group.js +1 -1
  16. package/dist/components/bk-button-top.js +2 -1
  17. package/dist/components/bk-button.d.ts +37 -14
  18. package/dist/components/bk-button.js +52 -16
  19. package/dist/components/bk-card.d.ts +4 -0
  20. package/dist/components/bk-card.js +15 -2
  21. package/dist/components/bk-carousel-controls.d.ts +2 -0
  22. package/dist/components/bk-carousel-controls.js +4 -2
  23. package/dist/components/bk-chart-area.d.ts +6 -0
  24. package/dist/components/bk-chart-bar.d.ts +17 -0
  25. package/dist/components/bk-chart-bar.js +25 -4
  26. package/dist/components/bk-chart-line.d.ts +13 -0
  27. package/dist/components/bk-chart-line.js +11 -1
  28. package/dist/components/bk-chip-group.d.ts +2 -2
  29. package/dist/components/bk-chip-group.js +4 -0
  30. package/dist/components/bk-chip.d.ts +53 -8
  31. package/dist/components/bk-chip.js +43 -7
  32. package/dist/components/bk-code.js +6 -2
  33. package/dist/components/bk-columns.d.ts +11 -0
  34. package/dist/components/bk-columns.js +8 -1
  35. package/dist/components/bk-combobox.d.ts +1 -1
  36. package/dist/components/bk-combobox.js +2 -1
  37. package/dist/components/bk-delta.d.ts +10 -0
  38. package/dist/components/bk-delta.js +8 -6
  39. package/dist/components/bk-dialog.d.ts +12 -5
  40. package/dist/components/bk-dialog.js +14 -6
  41. package/dist/components/bk-disclosure.js +4 -2
  42. package/dist/components/bk-drop-target.d.ts +7 -1
  43. package/dist/components/bk-drop-target.js +20 -4
  44. package/dist/components/bk-error-summary.d.ts +5 -0
  45. package/dist/components/bk-error-summary.js +13 -4
  46. package/dist/components/bk-facts.js +3 -2
  47. package/dist/components/bk-footnote.d.ts +73 -0
  48. package/dist/components/bk-footnote.js +97 -0
  49. package/dist/components/bk-footnotes-item.d.ts +92 -0
  50. package/dist/components/bk-footnotes-item.js +139 -0
  51. package/dist/components/bk-footnotes.d.ts +51 -0
  52. package/dist/components/bk-footnotes.js +43 -0
  53. package/dist/components/bk-icon.js +2 -2
  54. package/dist/components/bk-image-compare.d.ts +33 -5
  55. package/dist/components/bk-image-compare.js +72 -24
  56. package/dist/components/bk-image-crop.d.ts +3 -3
  57. package/dist/components/bk-image-editor.d.ts +1 -1
  58. package/dist/components/bk-image-viewer.d.ts +107 -11
  59. package/dist/components/bk-image-viewer.js +205 -34
  60. package/dist/components/bk-input-inline.d.ts +15 -6
  61. package/dist/components/bk-input-inline.js +22 -6
  62. package/dist/components/bk-input-number.js +2 -1
  63. package/dist/components/bk-input-search.d.ts +1 -1
  64. package/dist/components/bk-input-search.js +2 -1
  65. package/dist/components/bk-input-text.d.ts +11 -0
  66. package/dist/components/bk-input-text.js +17 -3
  67. package/dist/components/bk-input-time.js +2 -1
  68. package/dist/components/bk-item.js +2 -1
  69. package/dist/components/bk-lightbox.d.ts +12 -3
  70. package/dist/components/bk-lightbox.js +6 -3
  71. package/dist/components/bk-link.d.ts +9 -1
  72. package/dist/components/bk-link.js +14 -4
  73. package/dist/components/bk-menu-item.d.ts +40 -0
  74. package/dist/components/bk-menu-item.js +57 -9
  75. package/dist/components/bk-menu-label.js +2 -1
  76. package/dist/components/bk-menu-list.d.ts +1 -0
  77. package/dist/components/bk-menu-list.js +10 -0
  78. package/dist/components/bk-menu.d.ts +8 -1
  79. package/dist/components/bk-menu.js +16 -5
  80. package/dist/components/bk-message-feedback.d.ts +4 -3
  81. package/dist/components/bk-message-feedback.js +7 -5
  82. package/dist/components/bk-message-list.js +2 -1
  83. package/dist/components/bk-message-source.d.ts +1 -2
  84. package/dist/components/bk-message-source.js +3 -11
  85. package/dist/components/bk-message.js +2 -0
  86. package/dist/components/bk-nav-group.js +1 -1
  87. package/dist/components/bk-nav-item.d.ts +18 -0
  88. package/dist/components/bk-nav-item.js +18 -5
  89. package/dist/components/bk-nav.d.ts +1 -1
  90. package/dist/components/bk-page-cta.js +2 -0
  91. package/dist/components/bk-page-section.d.ts +1 -1
  92. package/dist/components/bk-page-section.js +3 -9
  93. package/dist/components/bk-pane.d.ts +1 -0
  94. package/dist/components/bk-pane.js +7 -5
  95. package/dist/components/bk-panel.d.ts +1 -1
  96. package/dist/components/bk-panel.js +6 -5
  97. package/dist/components/bk-picture.d.ts +17 -4
  98. package/dist/components/bk-picture.js +8 -1
  99. package/dist/components/bk-segmented-item.d.ts +24 -4
  100. package/dist/components/bk-segmented-item.js +37 -5
  101. package/dist/components/bk-segmented.js +2 -13
  102. package/dist/components/bk-select-cascade.d.ts +1 -1
  103. package/dist/components/bk-select-tree.d.ts +1 -1
  104. package/dist/components/bk-select.d.ts +1 -1
  105. package/dist/components/bk-shell-app.d.ts +10 -4
  106. package/dist/components/bk-shell-app.js +32 -9
  107. package/dist/components/bk-shell-sites.d.ts +2 -1
  108. package/dist/components/bk-shell-sites.js +3 -5
  109. package/dist/components/bk-sortable.js +7 -17
  110. package/dist/components/bk-split-grid.d.ts +104 -3
  111. package/dist/components/bk-split-grid.js +425 -2
  112. package/dist/components/bk-stat-group.js +2 -1
  113. package/dist/components/bk-stat.d.ts +17 -0
  114. package/dist/components/bk-stat.js +7 -3
  115. package/dist/components/bk-steps.js +2 -1
  116. package/dist/components/bk-surface.d.ts +2 -0
  117. package/dist/components/bk-surface.js +6 -3
  118. package/dist/components/bk-table.d.ts +1 -1
  119. package/dist/components/bk-table.js +9 -12
  120. package/dist/components/bk-tabs-item.d.ts +45 -7
  121. package/dist/components/bk-tabs-item.js +51 -20
  122. package/dist/components/bk-tabs-panel.d.ts +6 -3
  123. package/dist/components/bk-tabs-panel.js +6 -0
  124. package/dist/components/bk-tabs.d.ts +50 -7
  125. package/dist/components/bk-tabs.js +168 -96
  126. package/dist/components/bk-text.js +2 -1
  127. package/dist/components/bk-toast-group.d.ts +3 -1
  128. package/dist/components/bk-toast-group.js +11 -1
  129. package/dist/components/bk-tooltip.d.ts +3 -1
  130. package/dist/components/bk-tooltip.js +2 -1
  131. package/dist/components/bk-video.js +2 -2
  132. package/dist/components/bk-zoom.d.ts +3 -1
  133. package/dist/components/confirm.d.ts +15 -0
  134. package/dist/components/confirm.js +27 -4
  135. package/dist/i18n/de.js +12 -1
  136. package/dist/i18n/en.d.ts +2 -0
  137. package/dist/i18n/en.js +3 -0
  138. package/dist/i18n.d.ts +16 -2
  139. package/dist/i18n.js +28 -4
  140. package/dist/icons/brands-static.d.ts +3 -0
  141. package/dist/icons/brands-static.js +5 -0
  142. package/dist/icons/core.d.ts +1 -0
  143. package/dist/icons/core.js +2 -0
  144. package/dist/icons/load-static.d.ts +3 -0
  145. package/dist/icons/load-static.js +5 -0
  146. package/dist/icons/load.js +1 -0
  147. package/dist/icons/registry.js +1 -1
  148. package/dist/icons/set/save-as.d.ts +3 -0
  149. package/dist/icons/set/save-as.js +7 -0
  150. package/dist/index.d.ts +3 -0
  151. package/dist/index.js +3 -0
  152. package/dist/internal/announcer.d.ts +8 -1
  153. package/dist/internal/announcer.js +26 -10
  154. package/dist/internal/backdrop.d.ts +19 -0
  155. package/dist/internal/backdrop.js +29 -0
  156. package/dist/internal/busy.d.ts +3 -2
  157. package/dist/internal/busy.js +4 -5
  158. package/dist/internal/choice-field.js +1 -1
  159. package/dist/internal/choice-item.d.ts +17 -6
  160. package/dist/internal/choice-item.js +20 -9
  161. package/dist/internal/cloak.js +3 -0
  162. package/dist/internal/crop-frame.d.ts +1 -1
  163. package/dist/internal/crop-frame.js +2 -7
  164. package/dist/internal/date-field.js +2 -1
  165. package/dist/internal/drag.d.ts +11 -0
  166. package/dist/internal/drag.js +23 -0
  167. package/dist/internal/english-static.d.ts +3 -0
  168. package/dist/internal/english-static.js +5 -0
  169. package/dist/internal/english.d.ts +8 -0
  170. package/dist/internal/english.js +6 -0
  171. package/dist/internal/footnotes.d.ts +56 -0
  172. package/dist/internal/footnotes.js +143 -0
  173. package/dist/internal/handle-menu.js +2 -5
  174. package/dist/internal/late/bk-shell-app.d.ts +4 -0
  175. package/dist/internal/late/bk-shell-app.js +7 -0
  176. package/dist/internal/late/bk-table.d.ts +4 -0
  177. package/dist/internal/late/bk-table.js +17 -0
  178. package/dist/internal/late/handle-menu.d.ts +4 -0
  179. package/dist/internal/late/handle-menu.js +9 -0
  180. package/dist/internal/late/static.d.ts +7 -0
  181. package/dist/internal/late/static.js +5 -0
  182. package/dist/internal/late.d.ts +8 -3
  183. package/dist/internal/late.js +19 -4
  184. package/dist/internal/link.d.ts +2 -0
  185. package/dist/internal/link.js +11 -1
  186. package/dist/internal/own-text.d.ts +8 -0
  187. package/dist/internal/own-text.js +7 -0
  188. package/dist/internal/scope.js +1 -1
  189. package/dist/internal/scroll-lock.d.ts +4 -1
  190. package/dist/internal/scroll-lock.js +17 -4
  191. package/dist/internal/slider.js +2 -1
  192. package/dist/internal/styles.js +3 -0
  193. package/dist/internal/submit.d.ts +23 -0
  194. package/dist/internal/submit.js +57 -0
  195. package/dist/jsx.d.ts +141 -52
  196. package/dist/reset.css +10 -0
  197. package/dist/standalone/all.js +226 -222
  198. package/dist/standalone/appearance.js +1 -1
  199. package/dist/standalone/bk-accordion-item.js +4 -4
  200. package/dist/standalone/bk-accordion.js +2 -2
  201. package/dist/standalone/bk-action-bar.js +3 -3
  202. package/dist/standalone/bk-alert-offline.js +1 -2
  203. package/dist/standalone/bk-alert.js +13 -12
  204. package/dist/standalone/bk-app-state.js +1 -1
  205. package/dist/standalone/bk-attachment.js +4 -4
  206. package/dist/standalone/bk-avatar-group.js +12 -10
  207. package/dist/standalone/bk-avatar.js +14 -4
  208. package/dist/standalone/bk-badge.js +2 -2
  209. package/dist/standalone/bk-bar.js +3 -1
  210. package/dist/standalone/bk-brand.js +3 -3
  211. package/dist/standalone/bk-breadcrumbs.js +5 -5
  212. package/dist/standalone/bk-button-copy.js +5 -5
  213. package/dist/standalone/bk-button-group.js +5 -5
  214. package/dist/standalone/bk-button-share.js +5 -5
  215. package/dist/standalone/bk-button-top.js +9 -8
  216. package/dist/standalone/bk-button.js +62 -30
  217. package/dist/standalone/bk-calendar-event.js +1 -1
  218. package/dist/standalone/bk-calendar-week.js +3 -3
  219. package/dist/standalone/bk-calendar.js +4 -4
  220. package/dist/standalone/bk-card.js +20 -7
  221. package/dist/standalone/bk-carousel-controls.js +7 -6
  222. package/dist/standalone/bk-carousel-item.js +2 -2
  223. package/dist/standalone/bk-carousel.js +1 -1
  224. package/dist/standalone/bk-chart-area.js +1 -1
  225. package/dist/standalone/bk-chart-bar-list.js +8 -8
  226. package/dist/standalone/bk-chart-bar.js +145 -117
  227. package/dist/standalone/bk-chart-bridge.js +7 -7
  228. package/dist/standalone/bk-chart-bullet.js +6 -6
  229. package/dist/standalone/bk-chart-calendar.js +7 -7
  230. package/dist/standalone/bk-chart-heatmap.js +7 -7
  231. package/dist/standalone/bk-chart-histogram.js +5 -5
  232. package/dist/standalone/bk-chart-legend.js +6 -6
  233. package/dist/standalone/bk-chart-line.js +116 -103
  234. package/dist/standalone/bk-chart-mark.js +1 -1
  235. package/dist/standalone/bk-chart-scatter.js +6 -6
  236. package/dist/standalone/bk-chart-sparkline.js +6 -6
  237. package/dist/standalone/bk-chart-stacked-bar.js +7 -7
  238. package/dist/standalone/bk-chart-tracker.js +6 -6
  239. package/dist/standalone/bk-chart-waterfall.js +6 -6
  240. package/dist/standalone/bk-checkbox-group.js +4 -4
  241. package/dist/standalone/bk-checkbox.js +4 -4
  242. package/dist/standalone/bk-chip-group.js +9 -5
  243. package/dist/standalone/bk-chip.js +56 -17
  244. package/dist/standalone/bk-cluster.js +1 -1
  245. package/dist/standalone/bk-code-diff.js +4 -4
  246. package/dist/standalone/bk-code-stack.js +4 -4
  247. package/dist/standalone/bk-code.js +10 -6
  248. package/dist/standalone/bk-color-panel.js +5 -5
  249. package/dist/standalone/bk-columns.js +13 -5
  250. package/dist/standalone/bk-combobox.js +9 -8
  251. package/dist/standalone/bk-command-menu.js +6 -6
  252. package/dist/standalone/bk-command-palette.js +6 -5
  253. package/dist/standalone/bk-composer.js +6 -6
  254. package/dist/standalone/bk-delta.js +11 -10
  255. package/dist/standalone/bk-diagram.js +1 -1
  256. package/dist/standalone/bk-dialog.js +1 -1
  257. package/dist/standalone/bk-disclosure.js +7 -5
  258. package/dist/standalone/bk-divider.js +2 -2
  259. package/dist/standalone/bk-drawer.js +3 -3
  260. package/dist/standalone/bk-drop-target.js +12 -6
  261. package/dist/standalone/bk-empty-state.js +3 -3
  262. package/dist/standalone/bk-error-summary.js +9 -6
  263. package/dist/standalone/bk-facts-item.js +2 -2
  264. package/dist/standalone/bk-facts.js +9 -8
  265. package/dist/standalone/bk-feature.js +3 -3
  266. package/dist/standalone/bk-fieldset.js +3 -3
  267. package/dist/standalone/bk-filter-bar.js +4 -4
  268. package/dist/standalone/bk-folder-browser.js +4 -4
  269. package/dist/standalone/bk-footnote.js +82 -0
  270. package/dist/standalone/bk-footnotes-item.js +122 -0
  271. package/dist/standalone/bk-footnotes.js +37 -0
  272. package/dist/standalone/bk-form-guard.js +2 -2
  273. package/dist/standalone/bk-form-steps.js +3 -3
  274. package/dist/standalone/bk-grid.js +1 -1
  275. package/dist/standalone/bk-icon-tile.js +3 -3
  276. package/dist/standalone/bk-icon.js +1 -1
  277. package/dist/standalone/bk-image-compare.js +88 -47
  278. package/dist/standalone/bk-image-crop.js +6 -6
  279. package/dist/standalone/bk-image-editor.js +1 -1
  280. package/dist/standalone/bk-image-viewer.js +180 -59
  281. package/dist/standalone/bk-input-code.js +4 -4
  282. package/dist/standalone/bk-input-color.js +4 -4
  283. package/dist/standalone/bk-input-date-range.js +2 -2
  284. package/dist/standalone/bk-input-date.js +2 -2
  285. package/dist/standalone/bk-input-file.js +5 -5
  286. package/dist/standalone/bk-input-group.js +4 -4
  287. package/dist/standalone/bk-input-inline.js +17 -10
  288. package/dist/standalone/bk-input-number.js +9 -8
  289. package/dist/standalone/bk-input-rating.js +6 -6
  290. package/dist/standalone/bk-input-rich.js +1 -1
  291. package/dist/standalone/bk-input-search.js +23 -22
  292. package/dist/standalone/bk-input-slider-range.js +5 -5
  293. package/dist/standalone/bk-input-slider.js +5 -5
  294. package/dist/standalone/bk-input-text.js +1 -1
  295. package/dist/standalone/bk-input-time-zone.js +1 -1
  296. package/dist/standalone/bk-input-time.js +29 -28
  297. package/dist/standalone/bk-item-group.js +3 -3
  298. package/dist/standalone/bk-item.js +12 -11
  299. package/dist/standalone/bk-kbd-shortcuts.js +4 -3
  300. package/dist/standalone/bk-kbd.js +68 -1
  301. package/dist/standalone/bk-lightbox.js +11 -7
  302. package/dist/standalone/bk-lines.js +1 -1
  303. package/dist/standalone/bk-link.js +33 -19
  304. package/dist/standalone/bk-listbox-columns.js +6 -6
  305. package/dist/standalone/bk-listbox-item.js +1 -1
  306. package/dist/standalone/bk-listbox-search.js +7 -7
  307. package/dist/standalone/bk-listbox-transfer.js +6 -6
  308. package/dist/standalone/bk-listbox.js +7 -7
  309. package/dist/standalone/bk-logo-wall.js +2 -2
  310. package/dist/standalone/bk-logo.js +3 -3
  311. package/dist/standalone/bk-menu-bar.js +3 -3
  312. package/dist/standalone/bk-menu-context.js +1 -1
  313. package/dist/standalone/bk-menu-divider.js +2 -2
  314. package/dist/standalone/bk-menu-item.js +73 -29
  315. package/dist/standalone/bk-menu-label.js +7 -6
  316. package/dist/standalone/bk-menu-list.js +10 -4
  317. package/dist/standalone/bk-menu.js +19 -10
  318. package/dist/standalone/bk-message-approval.js +4 -4
  319. package/dist/standalone/bk-message-branches.js +3 -3
  320. package/dist/standalone/bk-message-citation.js +10 -10
  321. package/dist/standalone/bk-message-feedback.js +10 -6
  322. package/dist/standalone/bk-message-list.js +6 -5
  323. package/dist/standalone/bk-message-reasoning.js +5 -5
  324. package/dist/standalone/bk-message-source.js +13 -21
  325. package/dist/standalone/bk-message-tool-group.js +5 -5
  326. package/dist/standalone/bk-message-tool.js +5 -5
  327. package/dist/standalone/bk-message.js +6 -4
  328. package/dist/standalone/bk-meter.js +3 -3
  329. package/dist/standalone/bk-model-viewer.js +1 -1
  330. package/dist/standalone/bk-nav-divider.js +2 -2
  331. package/dist/standalone/bk-nav-group.js +6 -6
  332. package/dist/standalone/bk-nav-item.js +31 -23
  333. package/dist/standalone/bk-nav-toc.js +3 -3
  334. package/dist/standalone/bk-nav.js +3 -3
  335. package/dist/standalone/bk-overflow.js +3 -3
  336. package/dist/standalone/bk-page-cta.js +5 -3
  337. package/dist/standalone/bk-page-footer-column.js +2 -2
  338. package/dist/standalone/bk-page-footer.js +3 -3
  339. package/dist/standalone/bk-page-header.js +3 -3
  340. package/dist/standalone/bk-page-hero.js +3 -3
  341. package/dist/standalone/bk-page-pager.js +5 -5
  342. package/dist/standalone/bk-page-section.js +6 -6
  343. package/dist/standalone/bk-pagination.js +6 -6
  344. package/dist/standalone/bk-pane.js +10 -9
  345. package/dist/standalone/bk-panel.js +9 -10
  346. package/dist/standalone/bk-period-nav.js +4 -4
  347. package/dist/standalone/bk-picture.js +24 -15
  348. package/dist/standalone/bk-popover-help.js +3 -3
  349. package/dist/standalone/bk-popover.js +2 -2
  350. package/dist/standalone/bk-presence-cursor.js +2 -2
  351. package/dist/standalone/bk-preview.js +4 -4
  352. package/dist/standalone/bk-progress.js +3 -3
  353. package/dist/standalone/bk-prose.js +3 -3
  354. package/dist/standalone/bk-qr-code.js +1 -1
  355. package/dist/standalone/bk-radio-group.js +4 -4
  356. package/dist/standalone/bk-radio.js +3 -3
  357. package/dist/standalone/bk-rating.js +5 -5
  358. package/dist/standalone/bk-scroll.js +3 -3
  359. package/dist/standalone/bk-segmented-item.js +40 -16
  360. package/dist/standalone/bk-segmented.js +15 -13
  361. package/dist/standalone/bk-select-cascade.js +3 -3
  362. package/dist/standalone/bk-select-tree.js +4 -4
  363. package/dist/standalone/bk-select.js +5 -5
  364. package/dist/standalone/bk-shell-app.js +1 -1221
  365. package/dist/standalone/bk-shell-centered.js +2 -2
  366. package/dist/standalone/bk-shell-sites.js +5 -7
  367. package/dist/standalone/bk-skeleton.js +2 -2
  368. package/dist/standalone/bk-sortable.js +55 -60
  369. package/dist/standalone/bk-spinner.js +2 -2
  370. package/dist/standalone/bk-split-grid.js +318 -41
  371. package/dist/standalone/bk-split.js +4 -4
  372. package/dist/standalone/bk-stack.js +1 -1
  373. package/dist/standalone/bk-stat-group.js +8 -7
  374. package/dist/standalone/bk-stat.js +11 -8
  375. package/dist/standalone/bk-status-dot.js +3 -3
  376. package/dist/standalone/bk-steps-item.js +5 -5
  377. package/dist/standalone/bk-steps.js +8 -7
  378. package/dist/standalone/bk-surface.js +1 -1
  379. package/dist/standalone/bk-swatch-group.js +4 -4
  380. package/dist/standalone/bk-swatch-palette.js +1 -1
  381. package/dist/standalone/bk-swatch.js +2 -2
  382. package/dist/standalone/bk-switch.js +4 -4
  383. package/dist/standalone/bk-table.js +1 -1937
  384. package/dist/standalone/bk-tabs-item.js +58 -35
  385. package/dist/standalone/bk-tabs-panel.js +7 -3
  386. package/dist/standalone/bk-tabs.js +160 -98
  387. package/dist/standalone/bk-tasks-item.js +4 -4
  388. package/dist/standalone/bk-tasks.js +2 -2
  389. package/dist/standalone/bk-testimonial.js +3 -3
  390. package/dist/standalone/bk-text.js +19 -18
  391. package/dist/standalone/bk-time-countdown.js +4 -4
  392. package/dist/standalone/bk-time-relative.js +3 -3
  393. package/dist/standalone/bk-timeline-item.js +4 -4
  394. package/dist/standalone/bk-timeline.js +2 -2
  395. package/dist/standalone/bk-toast-group.js +1 -1
  396. package/dist/standalone/bk-toast.js +4 -4
  397. package/dist/standalone/bk-toolbar.js +2 -2
  398. package/dist/standalone/bk-tooltip.js +8 -7
  399. package/dist/standalone/bk-tree-item.js +6 -6
  400. package/dist/standalone/bk-tree.js +3 -3
  401. package/dist/standalone/bk-video.js +6 -6
  402. package/dist/standalone/bk-visually-hidden.js +2 -2
  403. package/dist/standalone/bk-zoom.js +5 -5
  404. package/dist/standalone/chunks/announcer-D1zrRWwO.js +36 -0
  405. package/dist/standalone/chunks/{appearance-waHnV0kk.js → appearance-CBOJXbmC.js} +1 -1
  406. package/dist/standalone/chunks/{bk-alert-offline-B1bQxOZp.js → bk-alert-offline-Clw0ZSsH.js} +3 -3
  407. package/dist/standalone/chunks/{bk-carousel-BCwIQhG5.js → bk-carousel-Biz7t8sL.js} +4 -4
  408. package/dist/standalone/chunks/{bk-diagram-DWK8CvRZ.js → bk-diagram-D_fQf6SF.js} +5 -5
  409. package/dist/standalone/chunks/{bk-dialog-DX0cPJ1o.js → bk-dialog-DwZyUUHh.js} +59 -25
  410. package/dist/standalone/chunks/{bk-icon-DssFsNuB.js → bk-icon-Bp_flKdv.js} +4 -3
  411. package/dist/standalone/chunks/{bk-image-editor-DXEj9gCu.js → bk-image-editor-BADsoLRL.js} +5 -5
  412. package/dist/standalone/chunks/{bk-input-date-range-Cbx_lpf0.js → bk-input-date-range-DHcJ8-5g.js} +2 -2
  413. package/dist/standalone/chunks/{bk-input-rich-ZB68vziu.js → bk-input-rich-CFhW6vRa.js} +6 -6
  414. package/dist/standalone/chunks/{bk-input-text-DD32uWNO.js → bk-input-text-DviyLBqj.js} +63 -54
  415. package/dist/standalone/chunks/{bk-model-viewer-Dr81ahVv.js → bk-model-viewer-w_Ah4Tvs.js} +4 -4
  416. package/dist/standalone/chunks/{bk-qr-code-QaYvZwOR.js → bk-qr-code-CYMovNVl.js} +3 -3
  417. package/dist/standalone/chunks/bk-shell-app-B2lxHit8.js +1235 -0
  418. package/dist/standalone/chunks/{bk-surface-DkIhrWMt.js → bk-surface-D7e0tErs.js} +9 -7
  419. package/dist/standalone/chunks/{bk-swatch-palette-BNNXTP3w.js → bk-swatch-palette-x13JgJQi.js} +6 -6
  420. package/dist/standalone/chunks/bk-table-CP8n_jy7.js +1944 -0
  421. package/dist/standalone/chunks/{bk-toast-group-BSeO_rPs.js → bk-toast-group-CoL6W7uk.js} +27 -24
  422. package/dist/standalone/chunks/{brush-Bn3lPdHN.js → brush-DALmXSru.js} +18 -2
  423. package/dist/standalone/chunks/{busy-B7Mxemwm.js → busy-BUB22mGY.js} +5 -4
  424. package/dist/standalone/chunks/{chart-tokens-D1Exf7BW.js → chart-tokens-DQ4hVSmn.js} +2 -2
  425. package/dist/standalone/chunks/{choice-field-CGvE4tyb.js → choice-field-poOTerh1.js} +6 -6
  426. package/dist/standalone/chunks/{choice-item-B6-9ZRlf.js → choice-item-Cx-nm1js.js} +17 -8
  427. package/dist/standalone/chunks/{clipboard-Crzt1Sh9.js → clipboard-RqIeP9Uz.js} +1 -1
  428. package/dist/standalone/chunks/{clipboard-BKlrP5rj.js → clipboard-UVLSkL4C.js} +1 -1
  429. package/dist/standalone/chunks/{crop-frame-poLCGrBG.js → crop-frame-Z9N0QML4.js} +1 -11
  430. package/dist/standalone/chunks/{date-field-BlI6grfT.js → date-field-B-fCXa2D.js} +48 -47
  431. package/dist/standalone/chunks/{define-CzVPD4Zi.js → define-DkVeu7e9.js} +1 -1
  432. package/dist/standalone/chunks/drag-DT4__0t9.js +12 -0
  433. package/dist/standalone/chunks/footnotes-BeisMxLk.js +94 -0
  434. package/dist/standalone/chunks/{form-control-CyXQIJ2x.js → form-control-CHpfKAKa.js} +2 -2
  435. package/dist/standalone/chunks/{frame-abXBnl8a.js → frame-xIMVEUCi.js} +5 -4
  436. package/dist/standalone/chunks/{handle-menu-ZVR_msk2.js → handle-menu-BgYUbGO2.js} +26 -19
  437. package/dist/standalone/chunks/{heading-text-CV5gBf7k.js → heading-text-CgnCa_q2.js} +1 -1
  438. package/dist/standalone/chunks/{i18n-B6Al9xCK.js → i18n-DFfGgd3d.js} +49 -34
  439. package/dist/standalone/chunks/{i18n-BI16HQmm.js → i18n-DQAcbHkY.js} +1 -1
  440. package/dist/standalone/chunks/link--YWr8exL.js +69 -0
  441. package/dist/standalone/chunks/{marks-0kbeB4n8.js → marks-pOUDNUf1.js} +2 -2
  442. package/dist/standalone/chunks/{options-DMEc8rQt.js → options-BdC8-KKM.js} +2 -2
  443. package/dist/standalone/chunks/own-text-mpZVnMyX.js +5 -0
  444. package/dist/standalone/chunks/{palettes-CKLHSIPx.js → palettes-J4bQ21ks.js} +2 -2
  445. package/dist/standalone/chunks/{popover-base-ac49G87f.js → popover-base-hxo-Vh6E.js} +2 -2
  446. package/dist/standalone/chunks/{prose-BG4oQH-i.js → prose-BiuJgiah.js} +1 -1
  447. package/dist/standalone/chunks/{ramp-ggoyjMvC.js → ramp-CGDOcqBZ.js} +1 -1
  448. package/dist/standalone/chunks/save-as-DBGZjczB.js +6 -0
  449. package/dist/standalone/chunks/shortcuts-DPxCSO4M.js +210 -0
  450. package/dist/standalone/chunks/{slider-BWT8Fmwz.js → slider-jp3d-Ld-.js} +15 -14
  451. package/dist/standalone/chunks/{stars-BN9M_9Q1.js → stars-BgKEjDQx.js} +1 -1
  452. package/dist/standalone/chunks/{styles-DwSR-9a3.js → styles-CaeyhYDA.js} +3 -0
  453. package/dist/standalone/chunks/submit-BjBGB8OW.js +42 -0
  454. package/dist/standalone/chunks/{summary-BK-B4m5A.js → summary-W5s0TFqV.js} +1 -1
  455. package/dist/standalone/chunks/{text-field-4IUUpRHE.js → text-field-CqhJSAwZ.js} +4 -4
  456. package/dist/standalone/chunks/{toggle-control-ioV2jhNY.js → toggle-control-lvZbQtGW.js} +2 -2
  457. package/dist/standalone/chunks/{tokens-BuahF1lF.js → tokens-C_ul7pL9.js} +4 -3
  458. package/dist/standalone/chunks/{virtual-B-1oN14Y.js → virtual-C_h6sHnm.js} +1 -1
  459. package/dist/standalone/confirm.js +27 -14
  460. package/dist/standalone/i18n-de.js +13 -2
  461. package/dist/standalone/icons.js +100 -98
  462. package/dist/standalone/links.js +1 -1
  463. package/dist/standalone/reset.css +10 -0
  464. package/dist/standalone/toast.js +1 -1
  465. package/dist/standalone/tokens.css +6 -5
  466. package/dist/tokens.css +6 -5
  467. package/dist/tokens.js +4 -3
  468. package/package.json +25 -2
  469. package/dist/standalone/chunks/announcer-haFcvqbe.js +0 -25
  470. package/dist/standalone/chunks/bk-kbd-B_TlKzWj.js +0 -275
  471. package/dist/standalone/chunks/link-CWSMsx04.js +0 -60
@@ -5,6 +5,29 @@ export interface SplitGridResizeDetail {
5
5
  /** The row heights as fractions of the available space (adding up to 1); `[1]` for one row. */
6
6
  rowSizes: number[];
7
7
  }
8
+ /** Detail of the `reorder` event. */
9
+ export interface SplitGridReorderDetail {
10
+ /** The pane that moves. */
11
+ pane: HTMLElement;
12
+ /** Its index in `panes` before the move. */
13
+ from: number;
14
+ /** Its index after the move: it takes the place of the pane that it was dropped on. */
15
+ to: number;
16
+ /** All panes in the new order. */
17
+ order: HTMLElement[];
18
+ }
19
+ /** Detail of the `dropoutside` event. */
20
+ export interface SplitGridDropOutsideDetail {
21
+ /** The pane that the user drags. */
22
+ pane: HTMLElement;
23
+ clientX: number;
24
+ clientY: number;
25
+ }
26
+ /** Detail of the `dragoutside` event. */
27
+ export interface SplitGridDragOutsideDetail extends SplitGridDropOutsideDetail {
28
+ /** True once when the pointer comes back over the grid or the drag ends: remove the hover mark then. */
29
+ inside: boolean;
30
+ }
8
31
  declare const parseSizes: (v: string | null) => number[] | undefined;
9
32
  /**
10
33
  * Split grid: panes of the same rank, side by side in columns and rows that fill the element, as a
@@ -40,6 +63,24 @@ declare const parseSizes: (v: string | null) => number[] | undefined;
40
63
  * sizes do not allow that, the panes scroll. Rows are resizable while they share the height
41
64
  * (no `rows`, or `rows` equal to the number of rows). `persist-key` saves the sizes in the app
42
65
  * state, one entry per layout (`split-grid:<persist-key>:<areas or column count>`, `…:rows:<rows>`).
66
+ * - **Moving panes.** An element with `data-split-grid-handle` in a pane (a header) moves the pane. Drag the
67
+ * handle with the mouse, pen or finger: after 4 px the pane is lifted (`--bk-split-grid-drag-opacity`), a ghost
68
+ * with the name of the pane follows the pointer, and the pane under the pointer shows a drop mark. A press on a
69
+ * control in the handle (a button, a field, a link) does not start a drag, and a click without movement stays a
70
+ * click. The handle has `touch-action: none`: on touch the drag starts at once. Escape cancels.
71
+ * The release over another pane fires the cancelable `reorder` event with `detail`
72
+ * `{ pane, from, to, order }`: the pane takes the place of the pane that it was dropped on, and `order` contains
73
+ * all panes in the new order. The element does not move the nodes. The app changes its order and renders again.
74
+ * The sizes stay: `persist-key` keeps them per layout, not per pane, and a new order does not change the layout.
75
+ * While the pointer is outside the grid, `dragoutside` fires once per frame with `detail`
76
+ * `{ pane, clientX, clientY, inside: false }`. One `dragoutside` with `inside: true` follows when the pointer comes
77
+ * back or the drag ends (drop, Escape). The release outside fires `dropoutside` with `{ pane, clientX, clientY }`,
78
+ * for example to open the pane in a window of its own.
79
+ * For the keyboard, make the handle focusable (`tabindex="0"`) and give it a name. Space or Enter picks the pane up,
80
+ * the arrow keys, Home and End choose the place, Space or Enter drops, Escape or Tab cancels. A live region
81
+ * announces each step. The name of a pane is its `data-split-grid-label`, else its `aria-label`, else the text
82
+ * of the handle. A handle that is a native control (a button, a link) keeps its keys. Offer move commands in a
83
+ * menu as well: they need no drag.
43
84
  * - **Zoom.** A pane with `data-zoomed` fills the element. The other panes are hidden until the pane loses `data-zoomed`.
44
85
  * - **Motion.** Panes move to their new place when the layout or the panes change. A new pane
45
86
  * grows in. `leave(panes)` fades panes out before the app removes them. With reduced motion there is no motion.
@@ -51,12 +92,14 @@ declare const parseSizes: (v: string | null) => number[] | undefined;
51
92
  * need more room than it has; while it does, its scroll area is focusable and named (a region,
52
93
  * `label`), so the keyboard can scroll it.
53
94
  *
54
- * i18n keys: `resizeColumn` and `resizeRow` (divider names, `{index}` = number of the column or the
95
+ * i18n keys: `sortableInstructions`, `sortablePickedUp`, `sortableMoved`, `sortableDropped` and `sortableCancelled`
96
+ * (moves of panes). `resizeColumn` and `resizeRow` (divider names, `{index}` = number of the column or the
55
97
  * row before it); override them per instance with `resize-label` and `resize-row-label`. `content` (name of the scroll area); override it with `label`.
56
98
  *
57
99
  * @slot - The panes: element children that are not `hidden`.
58
100
  * @csspart scroller - The scroll area around the panes.
59
- * @csspart cell - The box of one pane (moves and animates).
101
+ * @csspart cell - The box of one pane (moves, animates and shows the drop mark).
102
+ * @csspart ghost - The label with the name of the pane that follows the pointer during a drag.
60
103
  * @csspart divider - Each divider between two columns or two rows (the focusable separator).
61
104
  * @cssprop --bk-split-grid-gap - Space between panes (default --bk-space-components). The dividers are in it.
62
105
  * @cssprop --bk-split-grid-inset - Space inside the edge, so the panes' shadows and rings are not cut off (default --bk-space-1).
@@ -65,13 +108,33 @@ declare const parseSizes: (v: string | null) => number[] | undefined;
65
108
  * @cssprop --bk-split-grid-divider-active - Line of a divider while it is dragged or has keyboard focus (default --bk-accent-solid).
66
109
  * @cssprop --bk-split-grid-divider-width - Thickness of the line (default 3px).
67
110
  * @cssprop --bk-split-grid-divider-inset - Distance of the line from the ends of its divider (default --bk-space-5).
111
+ * @cssprop --bk-split-grid-drag-opacity - Opacity of the pane while the user moves it (default 0.45).
112
+ * @cssprop --bk-split-grid-drop-color - Outline of the pane that a moved pane drops on (default --bk-accent-solid).
113
+ * @cssprop --bk-split-grid-drop-width - Thickness of that outline (default --bk-focus-width).
114
+ * @cssprop --bk-split-grid-drop-radius - Corner radius of that outline (default --bk-radius-container, else --bk-radius-lg).
115
+ * @cssprop --bk-split-grid-ghost-color - Text colour of the ghost (default --bk-text).
116
+ * @cssprop --bk-split-grid-ghost-bg - Background of the ghost (default --bk-layer-overlay-bg).
117
+ * @cssprop --bk-split-grid-ghost-border - Border colour of the ghost (default --bk-layer-overlay-border).
118
+ * @cssprop --bk-split-grid-ghost-shadow - Shadow of the ghost (default --bk-layer-overlay-shadow and the --bk-ring-focus halo).
119
+ * @cssprop --bk-split-grid-ghost-radius - Corner radius of the ghost (default --bk-radius-md).
120
+ * @cssprop --bk-split-grid-ghost-padding - Inline padding of the ghost (default --bk-space-3).
121
+ * @cssprop --bk-split-grid-ghost-max-width - Largest width of the ghost (default --bk-measure-display). It starts at the width of the handle.
122
+ * @cssprop --bk-split-grid-handle-cursor - Cursor over a handle (default grab).
123
+ * @cssprop --bk-split-grid-dragging-cursor - Cursor while the user moves a pane (default grabbing).
124
+ * @fires {CustomEvent<SplitGridReorderDetail>} reorder - Cancelable. When the user drops a pane on another pane; `detail` `{ pane, from, to, order }`. The app renders the new order.
125
+ * @fires {CustomEvent<SplitGridDragOutsideDetail>} dragoutside - Once per frame while the user drags a pane outside the grid (`inside: false`), and once with `inside: true` when the pointer comes back or the drag ends; `detail` `{ pane, clientX, clientY, inside }`.
126
+ * @fires {CustomEvent<SplitGridDropOutsideDetail>} dropoutside - When the user releases a dragged pane outside the grid; `detail` `{ pane, clientX, clientY }`.
68
127
  * @fires {CustomEvent<SplitGridResizeDetail>} resize - When the user moves a divider (once per frame) and when the number of columns that fit changes; `detail` `{ sizes, rowSizes }` (fractions of the available space).
69
128
  * @fires {CustomEvent<SplitGridResizeDetail>} change - When the user finishes resizing or resets the columns or the rows; `detail` `{ sizes, rowSizes }` (fractions of the available space).
70
129
  *
71
130
  * @keyboard ←, → - On a divider between columns: move it by 1 % (with Shift: 10 %), in the writing direction.
72
131
  * @keyboard ↑, ↓ - On a divider between rows: move it by 1 % (with Shift: 10 %).
73
132
  * @keyboard Home, End - On a divider: make the column or the row before it as small or as large as `min` or `min-row` allows.
74
- * @a11y Each divider is a focusable `separator` (`aria-orientation` `vertical` between columns, `horizontal` between rows) with a name (`resizeColumn`, `resizeRow`) and its value in percent. While the panes scroll, the scroll area is a focusable, named `region`.
133
+ * @keyboard Space, Enter - On a focusable handle: pick the pane up, then drop it.
134
+ * @keyboard ←, →, ↑, ↓ - With a pane picked up: choose the previous or next place (← and → in the writing direction), or the pane above or below.
135
+ * @keyboard Home, End - With a pane picked up: choose the first or the last place.
136
+ * @keyboard Escape, Tab - Cancel the move of a pane.
137
+ * @a11y Each divider is a focusable `separator` (`aria-orientation` `vertical` between columns, `horizontal` between rows) with a name (`resizeColumn`, `resizeRow`) and its value in percent. While the panes scroll, the scroll area is a focusable, named `region`. A focused handle gets the instructions as `aria-description` (`sortableInstructions`), unless it has one. The shared live region announces the pick-up, each place, the drop and the cancel of a pane. The ghost is `aria-hidden`.
75
138
  *
76
139
  * @tag bk-split-grid
77
140
  */
@@ -248,6 +311,44 @@ export declare class BkSplitGrid extends LitElement {
248
311
  * at once with reduced motion. If a pane stays, it shows again after a moment.
249
312
  */
250
313
  leave(panes: Element[]): Promise<void>;
314
+ /** The move of a pane, while it lasts (also before the pointer passed the threshold). */
315
+ private drag;
316
+ private panesChanged;
317
+ private restoreFocus;
318
+ /** The pane that an event happened in: the child of the element on its path. */
319
+ private paneOf;
320
+ /** The handle on the path of the event inside `pane`, unless a control lies between (it keeps its press). */
321
+ private handleOf;
322
+ private nameOf;
323
+ private say;
324
+ private cellOf;
325
+ /** Moves the drop mark to the pane at `to` (`from`: no mark). */
326
+ private setTarget;
327
+ private onPaneDown;
328
+ /** Lifts the pane: the look, the ghost, the boxes of the cells. */
329
+ private startDrag;
330
+ /** The boxes of the cells and of the visible area: once at the start and after a scroll, never per move. */
331
+ private measureDrag;
332
+ private onDragScroll;
333
+ private onDragMove;
334
+ /** One frame of a pointer drag: move the ghost, find the target, tell the app about the outside (unless `last`). */
335
+ private dragFrame;
336
+ private emitOutside;
337
+ private onDragUp;
338
+ private onDragCancel;
339
+ /** Escape during a pointer drag. */
340
+ private onDragKey;
341
+ /** A native drag of a link or an image in a handle conflicts with the pointer drag. */
342
+ private onNativeDrag;
343
+ /** Ends a move. With `commit`, a drop on another pane fires `reorder` and a drop outside fires `dropoutside`. */
344
+ private endDrag;
345
+ /** The handle that a key or focus event comes from: a focused handle that is not a native control (it keeps its keys). */
346
+ private keyHandle;
347
+ private onPaneFocusIn;
348
+ private onPaneFocusOut;
349
+ private onPaneKey;
350
+ /** The pane above (-1) or below (1) the one at index `at`: the nearest by the middle of its column. */
351
+ private vertical;
251
352
  private emitSizes;
252
353
  /** Ends a change of the sizes by the user: keep them, reflect them into `sizes` or `row-sizes`, fire `change`. */
253
354
  private commit;
@@ -4,6 +4,9 @@ import { repeat } from "lit/directives/repeat.js";
4
4
  import { define } from "../internal/define.js";
5
5
  import { emitDetail } from "../internal/events.js";
6
6
  import { LocalizeController } from "../i18n.js";
7
+ import { announce } from "../internal/announcer.js";
8
+ import { DRAG_THRESHOLD, INTERACTIVE, preventEvent, suppressClick } from "../internal/drag.js";
9
+ import { adoptLightStyles } from "../internal/light-styles.js";
7
10
  import { StateController } from "../internal/state.js";
8
11
  import { base, grip } from "../internal/styles.js";
9
12
  import { mutationObserver, resizeObserver, lightDom } from "../internal/server.js";
@@ -12,6 +15,13 @@ const MOVE_MS = 260;
12
15
  const ENTER_MS = 220;
13
16
  const LEAVE_MS = 150;
14
17
  const EASE = "cubic-bezier(0.2, 0, 0, 1)";
18
+ const handleStyles = css`
19
+ @layer bk.components {
20
+ bk-split-grid [data-split-grid-handle] { cursor: var(--bk-split-grid-handle-cursor, grab); touch-action: none; }
21
+ bk-split-grid[dragging] [data-split-grid-handle] { cursor: var(--bk-split-grid-dragging-cursor, grabbing); }
22
+ }
23
+ `;
24
+ const NATIVE_CONTROL = "a[href], button, summary, input, select, textarea";
15
25
  const parseSizes = (v) => v ? v.split(/[\s,]+/).map((x) => parseFloat(x)).filter((x) => Number.isFinite(x)) : void 0;
16
26
  const valid = (v, n) => Array.isArray(v) && v.length === n && v.every((x) => typeof x === "number" && x > 0);
17
27
  const normalize = (v) => {
@@ -68,6 +78,11 @@ class BkSplitGrid extends LitElement {
68
78
  this.fr = [];
69
79
  this.rfr = [];
70
80
  this.scrolling = false;
81
+ this.addEventListener("pointerdown", this.onPaneDown);
82
+ this.addEventListener("keydown", this.onPaneKey);
83
+ this.addEventListener("focusin", this.onPaneFocusIn);
84
+ this.addEventListener("focusout", this.onPaneFocusOut);
85
+ this.addEventListener("dragstart", this.onNativeDrag);
71
86
  }
72
87
  /** The panes: element children that are not hidden. */
73
88
  get panes() {
@@ -209,9 +224,11 @@ class BkSplitGrid extends LitElement {
209
224
  this.mutations.observe(this, { childList: true, attributes: true, subtree: false, attributeFilter: ["hidden"] });
210
225
  this.observePanes();
211
226
  this.sizer.observe(this);
227
+ adoptLightStyles(this, handleStyles);
212
228
  }
213
229
  disconnectedCallback() {
214
230
  super.disconnectedCallback();
231
+ this.endDrag(false);
215
232
  this.mutations.disconnect();
216
233
  this.paneObserver.disconnect();
217
234
  this.sizer.disconnect();
@@ -235,6 +252,8 @@ class BkSplitGrid extends LitElement {
235
252
  const moved = panes.length !== this.shown.length || panes.some((t, i) => t !== this.shown[i]) || zoom !== this.shownZoom;
236
253
  if (moved)
237
254
  this.observePanes();
255
+ if (moved && this.drag)
256
+ this.panesChanged = true;
238
257
  const n = this.columnCount;
239
258
  const r = this.rowCount;
240
259
  if (!this.resizing) {
@@ -251,6 +270,10 @@ class BkSplitGrid extends LitElement {
251
270
  this.shownRows = r;
252
271
  }
253
272
  updated() {
273
+ if (this.panesChanged) {
274
+ this.panesChanged = false;
275
+ this.endDrag(false);
276
+ }
254
277
  const cells = this.cells();
255
278
  cells.forEach(([pane, cell]) => {
256
279
  const slot = cell.querySelector("slot");
@@ -305,6 +328,382 @@ class BkSplitGrid extends LitElement {
305
328
  await Promise.all(anims.map((a) => a.finished.catch(() => void 0)));
306
329
  setTimeout(() => anims.forEach((a) => a.cancel()), 500);
307
330
  }
331
+ /* ---------------------------------------------------------------- moving panes */
332
+ /** The move of a pane, while it lasts (also before the pointer passed the threshold). */
333
+ drag = null;
334
+ panesChanged = false;
335
+ restoreFocus = 0;
336
+ /** The pane that an event happened in: the child of the element on its path. */
337
+ paneOf(e) {
338
+ return e.composedPath().find((n) => n instanceof HTMLElement && n.parentElement === this && this.shown.includes(n)) ?? null;
339
+ }
340
+ /** The handle on the path of the event inside `pane`, unless a control lies between (it keeps its press). */
341
+ handleOf(e, pane) {
342
+ const path = e.composedPath();
343
+ const end = path.indexOf(pane);
344
+ const handle = path.slice(0, end < 0 ? path.length : end + 1).find((n) => n instanceof HTMLElement && n.hasAttribute("data-split-grid-handle"));
345
+ if (!handle)
346
+ return null;
347
+ for (const n of path) {
348
+ if (n === handle)
349
+ break;
350
+ if (n instanceof HTMLElement && n.matches(INTERACTIVE) && !handle.shadowRoot?.contains(n))
351
+ return null;
352
+ }
353
+ return handle;
354
+ }
355
+ nameOf(pane, handle) {
356
+ const text = pane.dataset.splitGridLabel || pane.getAttribute("aria-label") || (handle ?? pane.querySelector("[data-split-grid-handle]"))?.textContent || "";
357
+ return text.replace(/\s+/g, " ").trim().slice(0, 80);
358
+ }
359
+ say(key, d, index) {
360
+ announce(this.i18n.t(key, { item: this.nameOf(d.pane, d.handle), position: index + 1, total: this.shown.length }));
361
+ }
362
+ cellOf(index) {
363
+ return this.renderRoot.querySelectorAll(".cell")[index] ?? null;
364
+ }
365
+ /** Moves the drop mark to the pane at `to` (`from`: no mark). */
366
+ setTarget(d, to) {
367
+ if (to === d.to)
368
+ return;
369
+ if (d.to !== d.from)
370
+ this.cellOf(d.to)?.classList.remove("target");
371
+ d.to = to;
372
+ if (to !== d.from)
373
+ this.cellOf(to)?.classList.add("target");
374
+ }
375
+ onPaneDown = (e) => {
376
+ if (this.drag || e.button !== 0 || !e.isPrimary)
377
+ return;
378
+ const pane = this.paneOf(e);
379
+ const handle = pane && this.handleOf(e, pane);
380
+ if (!pane || !handle)
381
+ return;
382
+ const from = this.shown.indexOf(pane);
383
+ this.drag = {
384
+ keyboard: false,
385
+ pane,
386
+ handle,
387
+ from,
388
+ to: from,
389
+ started: false,
390
+ id: e.pointerId,
391
+ x0: e.clientX,
392
+ y0: e.clientY,
393
+ x: e.clientX,
394
+ y: e.clientY,
395
+ offX: 0,
396
+ offY: 0,
397
+ raf: 0,
398
+ rects: null,
399
+ box: null,
400
+ outside: false
401
+ };
402
+ window.addEventListener("pointermove", this.onDragMove, true);
403
+ window.addEventListener("pointerup", this.onDragUp, true);
404
+ window.addEventListener("pointercancel", this.onDragCancel, true);
405
+ };
406
+ /** Lifts the pane: the look, the ghost, the boxes of the cells. */
407
+ startDrag(d) {
408
+ d.started = true;
409
+ try {
410
+ d.handle.setPointerCapture(d.id);
411
+ } catch {
412
+ }
413
+ this.setAttribute("dragging", "");
414
+ this.cellOf(d.from)?.classList.add("dragging");
415
+ getSelection()?.removeAllRanges();
416
+ document.addEventListener("selectstart", preventEvent, true);
417
+ window.addEventListener("touchmove", preventEvent, { passive: false });
418
+ window.addEventListener("keydown", this.onDragKey, true);
419
+ window.addEventListener("scroll", this.onDragScroll, true);
420
+ d.handle.addEventListener("lostpointercapture", this.onDragCancel);
421
+ this.measureDrag(d);
422
+ const ghost = this.renderRoot.querySelector(".ghost");
423
+ if (!ghost)
424
+ return;
425
+ const h = d.handle.getBoundingClientRect();
426
+ ghost.textContent = this.nameOf(d.pane, d.handle);
427
+ ghost.style.inlineSize = `${Math.round(h.width)}px`;
428
+ ghost.style.minBlockSize = `${Math.round(h.height)}px`;
429
+ ghost.style.transform = `translate(${Math.round(h.left)}px, ${Math.round(h.top)}px)`;
430
+ ghost.showPopover?.();
431
+ const g = ghost.getBoundingClientRect();
432
+ d.offX = Math.min(Math.max(d.x0 - h.left, 0), g.width);
433
+ d.offY = Math.min(Math.max(d.y0 - h.top, 0), g.height);
434
+ }
435
+ /** The boxes of the cells and of the visible area: once at the start and after a scroll, never per move. */
436
+ measureDrag(d) {
437
+ d.rects = [...this.renderRoot.querySelectorAll(".cell")].map((c) => c.hidden ? null : c.getBoundingClientRect());
438
+ d.box = (this.renderRoot.querySelector(".scroller") ?? this).getBoundingClientRect();
439
+ }
440
+ onDragScroll = () => {
441
+ if (this.drag)
442
+ this.drag.rects = null;
443
+ };
444
+ onDragMove = (e) => {
445
+ const d = this.drag;
446
+ if (!d || d.keyboard || e.pointerId !== d.id)
447
+ return;
448
+ d.x = e.clientX;
449
+ d.y = e.clientY;
450
+ if (!d.started) {
451
+ if (Math.hypot(d.x - d.x0, d.y - d.y0) < DRAG_THRESHOLD)
452
+ return;
453
+ this.startDrag(d);
454
+ }
455
+ e.preventDefault();
456
+ d.raf ||= requestAnimationFrame(() => this.dragFrame(d));
457
+ };
458
+ /** One frame of a pointer drag: move the ghost, find the target, tell the app about the outside (unless `last`). */
459
+ dragFrame(d, last = false) {
460
+ d.raf = 0;
461
+ if (this.drag !== d)
462
+ return;
463
+ if (!d.rects)
464
+ this.measureDrag(d);
465
+ const ghost = this.renderRoot.querySelector(".ghost");
466
+ if (ghost)
467
+ ghost.style.transform = `translate(${Math.round(d.x - d.offX)}px, ${Math.round(d.y - d.offY)}px)`;
468
+ const b = d.box;
469
+ const inside = d.x >= b.left && d.x <= b.right && d.y >= b.top && d.y <= b.bottom;
470
+ if (!inside) {
471
+ this.setTarget(d, d.from);
472
+ d.outside = true;
473
+ if (!last)
474
+ this.emitOutside("dragoutside", d, false);
475
+ return;
476
+ }
477
+ const at2 = d.rects.findIndex((r) => !!r && d.x >= r.left && d.x <= r.right && d.y >= r.top && d.y <= r.bottom);
478
+ this.setTarget(d, at2 < 0 ? d.from : at2);
479
+ if (d.outside) {
480
+ d.outside = false;
481
+ this.emitOutside("dragoutside", d, true);
482
+ }
483
+ }
484
+ emitOutside(type, d, inside) {
485
+ const point = { pane: d.pane, clientX: d.x, clientY: d.y };
486
+ if (type === "dropoutside")
487
+ emitDetail(this, type, point);
488
+ else
489
+ emitDetail(this, type, { ...point, inside });
490
+ }
491
+ onDragUp = (e) => {
492
+ const d = this.drag;
493
+ if (!d || d.keyboard || e.pointerId !== d.id)
494
+ return;
495
+ if (!d.started) {
496
+ this.endDrag(false);
497
+ return;
498
+ }
499
+ d.x = e.clientX;
500
+ d.y = e.clientY;
501
+ cancelAnimationFrame(d.raf);
502
+ this.dragFrame(d, true);
503
+ suppressClick();
504
+ this.endDrag(true);
505
+ };
506
+ onDragCancel = (e) => {
507
+ const d = this.drag;
508
+ if (!d || d.keyboard || e.pointerId !== d.id)
509
+ return;
510
+ this.endDrag(false);
511
+ };
512
+ /** Escape during a pointer drag. */
513
+ onDragKey = (e) => {
514
+ if (e.key !== "Escape" || !this.drag?.started || this.drag.keyboard)
515
+ return;
516
+ e.preventDefault();
517
+ e.stopPropagation();
518
+ this.endDrag(false);
519
+ };
520
+ /** A native drag of a link or an image in a handle conflicts with the pointer drag. */
521
+ onNativeDrag = (e) => {
522
+ if (this.drag && !this.drag.keyboard)
523
+ e.preventDefault();
524
+ };
525
+ /** Ends a move. With `commit`, a drop on another pane fires `reorder` and a drop outside fires `dropoutside`. */
526
+ endDrag(commit) {
527
+ const d = this.drag;
528
+ if (!d)
529
+ return;
530
+ this.drag = null;
531
+ cancelAnimationFrame(d.raf);
532
+ window.removeEventListener("pointermove", this.onDragMove, true);
533
+ window.removeEventListener("pointerup", this.onDragUp, true);
534
+ window.removeEventListener("pointercancel", this.onDragCancel, true);
535
+ window.removeEventListener("keydown", this.onDragKey, true);
536
+ window.removeEventListener("scroll", this.onDragScroll, true);
537
+ window.removeEventListener("touchmove", preventEvent);
538
+ document.removeEventListener("selectstart", preventEvent, true);
539
+ d.handle.removeEventListener("lostpointercapture", this.onDragCancel);
540
+ if (!d.started && !d.keyboard)
541
+ return;
542
+ if (d.handle.hasPointerCapture?.(d.id))
543
+ d.handle.releasePointerCapture(d.id);
544
+ this.removeAttribute("dragging");
545
+ for (const c of this.renderRoot.querySelectorAll(".cell"))
546
+ c.classList.remove("dragging", "target");
547
+ const ghost = this.renderRoot.querySelector(".ghost");
548
+ if (ghost?.matches(":popover-open"))
549
+ ghost.hidePopover();
550
+ if (d.outside) {
551
+ if (commit)
552
+ this.emitOutside("dropoutside", d, false);
553
+ this.emitOutside("dragoutside", d, true);
554
+ return;
555
+ }
556
+ if (!commit || d.to === d.from) {
557
+ if (d.keyboard)
558
+ this.say(commit ? "sortableDropped" : "sortableCancelled", d, d.from);
559
+ return;
560
+ }
561
+ const order = this.shown.filter((p) => p !== d.pane);
562
+ order.splice(d.to, 0, d.pane);
563
+ if (!emitDetail(this, "reorder", { pane: d.pane, from: d.from, to: d.to, order }, true)) {
564
+ this.say("sortableCancelled", d, d.from);
565
+ return;
566
+ }
567
+ this.say("sortableDropped", d, d.to);
568
+ if (d.keyboard) {
569
+ const handle = d.handle;
570
+ cancelAnimationFrame(this.restoreFocus);
571
+ this.updateComplete.then(() => {
572
+ this.restoreFocus = requestAnimationFrame(() => {
573
+ if (handle.isConnected && !handle.matches(":focus-within"))
574
+ handle.focus({ preventScroll: true });
575
+ });
576
+ });
577
+ }
578
+ }
579
+ /* ---------------------------------------------------------------- moving panes with the keyboard */
580
+ /** The handle that a key or focus event comes from: a focused handle that is not a native control (it keeps its keys). */
581
+ keyHandle(e, pane) {
582
+ const handle = this.handleOf(e, pane);
583
+ return handle && e.composedPath()[0] === handle && !handle.matches(NATIVE_CONTROL) ? handle : null;
584
+ }
585
+ onPaneFocusIn = (e) => {
586
+ const pane = this.paneOf(e);
587
+ const handle = pane && this.keyHandle(e, pane);
588
+ if (handle && !handle.hasAttribute("aria-description")) {
589
+ handle.setAttribute("aria-description", this.i18n.t("sortableInstructions"));
590
+ }
591
+ };
592
+ onPaneFocusOut = (e) => {
593
+ const d = this.drag;
594
+ if (!d?.keyboard)
595
+ return;
596
+ const to = e.relatedTarget;
597
+ if (!to || !d.pane.contains(to))
598
+ this.endDrag(false);
599
+ };
600
+ onPaneKey = (e) => {
601
+ const d = this.drag;
602
+ if (!d) {
603
+ if (e.key !== " " && e.key !== "Enter" || e.altKey || e.ctrlKey || e.metaKey || e.shiftKey)
604
+ return;
605
+ const pane = this.paneOf(e);
606
+ const handle = pane && this.keyHandle(e, pane);
607
+ if (!pane || !handle || this.zoomedPane || this.shown.length < 2)
608
+ return;
609
+ e.preventDefault();
610
+ e.stopPropagation();
611
+ const from = this.shown.indexOf(pane);
612
+ this.drag = {
613
+ keyboard: true,
614
+ pane,
615
+ handle,
616
+ from,
617
+ to: from,
618
+ started: true,
619
+ id: -1,
620
+ x0: 0,
621
+ y0: 0,
622
+ x: 0,
623
+ y: 0,
624
+ offX: 0,
625
+ offY: 0,
626
+ raf: 0,
627
+ rects: null,
628
+ box: null,
629
+ outside: false
630
+ };
631
+ this.cellOf(from)?.classList.add("dragging");
632
+ this.say("sortablePickedUp", this.drag, from);
633
+ return;
634
+ }
635
+ if (!d.keyboard)
636
+ return;
637
+ const last = this.shown.length - 1;
638
+ const rtl = this.matches(":dir(rtl)");
639
+ let to = d.to;
640
+ switch (e.key) {
641
+ case " ":
642
+ case "Enter":
643
+ e.preventDefault();
644
+ e.stopPropagation();
645
+ this.endDrag(true);
646
+ return;
647
+ case "Escape":
648
+ e.preventDefault();
649
+ e.stopPropagation();
650
+ this.endDrag(false);
651
+ return;
652
+ case "Tab":
653
+ this.endDrag(false);
654
+ return;
655
+ case (rtl ? "ArrowRight" : "ArrowLeft"):
656
+ to = Math.max(0, to - 1);
657
+ break;
658
+ case (rtl ? "ArrowLeft" : "ArrowRight"):
659
+ to = Math.min(last, to + 1);
660
+ break;
661
+ case "ArrowUp":
662
+ to = this.vertical(to, -1);
663
+ break;
664
+ case "ArrowDown":
665
+ to = this.vertical(to, 1);
666
+ break;
667
+ case "Home":
668
+ to = 0;
669
+ break;
670
+ case "End":
671
+ to = last;
672
+ break;
673
+ default:
674
+ return;
675
+ }
676
+ e.preventDefault();
677
+ e.stopPropagation();
678
+ if (to === d.to)
679
+ return;
680
+ this.setTarget(d, to);
681
+ this.cellOf(to)?.scrollIntoView({ block: "nearest", inline: "nearest" });
682
+ this.say("sortableMoved", d, to);
683
+ };
684
+ /** The pane above (-1) or below (1) the one at index `at`: the nearest by the middle of its column. */
685
+ vertical(at2, dir) {
686
+ const boxes = [...this.renderRoot.querySelectorAll(".cell")].map((c) => c.getBoundingClientRect());
687
+ const from = boxes[at2];
688
+ if (!from)
689
+ return at2;
690
+ const mid = from.left + from.width / 2;
691
+ let best = at2;
692
+ let score = Infinity;
693
+ boxes.forEach((b, i) => {
694
+ if (i === at2 || b.width === 0)
695
+ return;
696
+ const ahead = dir < 0 ? b.bottom <= from.top + 1 : b.top >= from.bottom - 1;
697
+ if (!ahead)
698
+ return;
699
+ const dist = Math.abs(dir < 0 ? from.top - b.bottom : b.top - from.bottom) * 4 + Math.abs(b.left + b.width / 2 - mid);
700
+ if (dist < score) {
701
+ score = dist;
702
+ best = i;
703
+ }
704
+ });
705
+ return best;
706
+ }
308
707
  emitSizes(type) {
309
708
  emitDetail(this, type, { sizes: [...this.fr], rowSizes: [...this.rfr] });
310
709
  }
@@ -500,8 +899,32 @@ class BkSplitGrid extends LitElement {
500
899
  @media (hover: hover) { .divider:hover::after { background: var(--bk-split-grid-divider-color, var(--bk-line-hover)); } }
501
900
  .divider.active::after, .divider:focus-visible::after { background: var(--bk-split-grid-divider-active, var(--bk-accent-solid)); }
502
901
  @media (prefers-reduced-motion: reduce) { .divider::after { transition: none; } }
902
+
903
+ /* Moving a pane: the lifted pane, the drop mark and the ghost that follows the pointer. */
904
+ :host([dragging]) { user-select: none; -webkit-user-select: none; }
905
+ .cell.dragging { opacity: var(--bk-split-grid-drag-opacity, 0.45); }
906
+ .cell.target {
907
+ outline: var(--bk-split-grid-drop-width, var(--bk-focus-width)) solid var(--bk-split-grid-drop-color, var(--bk-accent-solid));
908
+ outline-offset: var(--bk-focus-offset);
909
+ border-radius: var(--bk-split-grid-drop-radius, var(--bk-radius-container, var(--bk-radius-lg)));
910
+ }
911
+ .ghost {
912
+ position: fixed; inset: 0 auto auto 0; margin: 0; pointer-events: none;
913
+ max-inline-size: var(--bk-split-grid-ghost-max-width, var(--bk-measure-display));
914
+ align-items: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
915
+ padding: 0 var(--bk-split-grid-ghost-padding, var(--bk-space-3));
916
+ color: var(--bk-split-grid-ghost-color, var(--bk-text)); font: inherit; font-size: var(--bk-type-small); font-weight: var(--bk-weight-medium);
917
+ line-height: var(--bk-line-height-body);
918
+ background: var(--bk-split-grid-ghost-bg, var(--bk-layer-overlay-bg));
919
+ border: var(--bk-border-width) solid var(--bk-split-grid-ghost-border, var(--bk-layer-overlay-border));
920
+ border-radius: var(--bk-split-grid-ghost-radius, var(--bk-radius-md));
921
+ box-shadow: var(--bk-split-grid-ghost-shadow, var(--bk-layer-overlay-shadow), var(--bk-ring-focus));
922
+ cursor: var(--bk-split-grid-dragging-cursor, grabbing);
923
+ }
924
+ .ghost:popover-open { display: flex; }
503
925
  @media (forced-colors: active) {
504
926
  .divider.active::after, .divider:focus-visible::after { background: Highlight; }
927
+ .cell.target { outline-color: Highlight; }
505
928
  }
506
929
  `];
507
930
  render() {
@@ -527,7 +950,7 @@ class BkSplitGrid extends LitElement {
527
950
  const roomOf = (axis) => Math.max(1, (axis === "col" ? this.width : this.gridHeight) - this.gapPx * ((axis === "col" ? n : r) - 1));
528
951
  const startOf = (across, k, count) => k === 0 ? "0" : trackStart(across, k, count);
529
952
  const endOf = (across, k, count) => k === across.length - 1 && count === across.length ? "0" : `calc(100% - ${trackEnd(across, k, count)})`;
530
- return html`<div class="scroller" part="scroller" role=${this.scrolling ? "region" : nothing} tabindex=${this.scrolling ? "0" : nothing}
953
+ return html`<div class="scroller" part="scroller" @scroll=${this.onDragScroll} role=${this.scrolling ? "region" : nothing} tabindex=${this.scrolling ? "0" : nothing}
531
954
  aria-label=${this.scrolling ? this.label || this.i18n.t("content") : nothing}><div class="grid ${stacked ? "stacked" : ""}" style=${styleMap({ gridTemplateColumns: columns, minWidth, minHeight, ...rows, ...template })}>
532
955
  ${repeat(panes, (t) => t, (t, i) => html`<div class="cell" part="cell" style=${styleMap({ gridArea: areas ? letters[i] : void 0 })} ?hidden=${!!zoom && zoom !== t}><slot></slot></div>`)}
533
956
  ${this.segments().map(({ axis, index: i, from, to }) => {
@@ -540,7 +963,7 @@ class BkSplitGrid extends LitElement {
540
963
  data-axis=${axis} data-index=${i} style=${styleMap(style)}
541
964
  @pointerdown=${this.onDividerDown} @keydown=${this.onDividerKey} @dblclick=${this.onDividerReset}><span class="bk-grip" aria-hidden="true"></span></div>`;
542
965
  })}
543
- </div></div>`;
966
+ </div></div><div class="ghost" part="ghost" popover="manual" aria-hidden="true"></div>`;
544
967
  }
545
968
  }
546
969
  define("bk-split-grid", BkSplitGrid);
@@ -1,5 +1,6 @@
1
1
  import { LitElement, css, html } from "lit";
2
2
  import { define } from "../internal/define.js";
3
+ import { setHostVars } from "../internal/host-vars.js";
3
4
  import { base } from "../internal/styles.js";
4
5
  class BkStatGroup extends LitElement {
5
6
  static properties = {
@@ -41,7 +42,7 @@ class BkStatGroup extends LitElement {
41
42
  `];
42
43
  willUpdate(changed) {
43
44
  if (changed.has("min"))
44
- this.min ? this.style.setProperty("--_bk-stat-group-min", this.min) : this.style.removeProperty("--_bk-stat-group-min");
45
+ setHostVars(this, { "--_bk-stat-group-min": this.min || "" });
45
46
  }
46
47
  render() {
47
48
  return html`<div class="row" part="row"><slot></slot></div>`;