@bk2k/ui 0.6.7 → 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 (487) hide show
  1. package/BUILDING.md +88 -2
  2. package/CHANGELOG.md +193 -0
  3. package/USAGE.md +102 -33
  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.d.ts +2 -0
  9. package/dist/charts/frame.js +4 -2
  10. package/dist/clipboard.js +1 -0
  11. package/dist/components/bk-alert.js +2 -1
  12. package/dist/components/bk-avatar-group.js +4 -6
  13. package/dist/components/bk-avatar.d.ts +10 -0
  14. package/dist/components/bk-avatar.js +17 -0
  15. package/dist/components/bk-bar.js +2 -0
  16. package/dist/components/bk-button-group.js +1 -1
  17. package/dist/components/bk-button-top.js +2 -1
  18. package/dist/components/bk-button.d.ts +55 -17
  19. package/dist/components/bk-button.js +71 -24
  20. package/dist/components/bk-card.d.ts +4 -0
  21. package/dist/components/bk-card.js +15 -2
  22. package/dist/components/bk-carousel-controls.d.ts +2 -0
  23. package/dist/components/bk-carousel-controls.js +4 -2
  24. package/dist/components/bk-chart-area.d.ts +6 -0
  25. package/dist/components/bk-chart-bar.d.ts +63 -9
  26. package/dist/components/bk-chart-bar.js +152 -41
  27. package/dist/components/bk-chart-line.d.ts +13 -0
  28. package/dist/components/bk-chart-line.js +11 -1
  29. package/dist/components/bk-chip-group.d.ts +2 -2
  30. package/dist/components/bk-chip-group.js +4 -0
  31. package/dist/components/bk-chip.d.ts +53 -8
  32. package/dist/components/bk-chip.js +43 -7
  33. package/dist/components/bk-code.js +6 -2
  34. package/dist/components/bk-columns.d.ts +11 -0
  35. package/dist/components/bk-columns.js +8 -1
  36. package/dist/components/bk-combobox.d.ts +30 -6
  37. package/dist/components/bk-combobox.js +63 -20
  38. package/dist/components/bk-delta.d.ts +10 -0
  39. package/dist/components/bk-delta.js +8 -6
  40. package/dist/components/bk-dialog.d.ts +16 -6
  41. package/dist/components/bk-dialog.js +20 -8
  42. package/dist/components/bk-disclosure.js +4 -2
  43. package/dist/components/bk-drop-target.d.ts +7 -1
  44. package/dist/components/bk-drop-target.js +20 -4
  45. package/dist/components/bk-error-summary.d.ts +5 -0
  46. package/dist/components/bk-error-summary.js +13 -4
  47. package/dist/components/bk-facts-item.js +8 -6
  48. package/dist/components/bk-facts.d.ts +6 -4
  49. package/dist/components/bk-facts.js +22 -10
  50. package/dist/components/bk-footnote.d.ts +73 -0
  51. package/dist/components/bk-footnote.js +97 -0
  52. package/dist/components/bk-footnotes-item.d.ts +92 -0
  53. package/dist/components/bk-footnotes-item.js +139 -0
  54. package/dist/components/bk-footnotes.d.ts +51 -0
  55. package/dist/components/bk-footnotes.js +43 -0
  56. package/dist/components/bk-icon.js +2 -2
  57. package/dist/components/bk-image-compare.d.ts +33 -5
  58. package/dist/components/bk-image-compare.js +72 -24
  59. package/dist/components/bk-image-crop.d.ts +3 -3
  60. package/dist/components/bk-image-editor.d.ts +1 -1
  61. package/dist/components/bk-image-viewer.d.ts +107 -11
  62. package/dist/components/bk-image-viewer.js +205 -34
  63. package/dist/components/bk-input-inline.d.ts +15 -6
  64. package/dist/components/bk-input-inline.js +22 -6
  65. package/dist/components/bk-input-number.js +2 -1
  66. package/dist/components/bk-input-search.d.ts +1 -1
  67. package/dist/components/bk-input-search.js +2 -1
  68. package/dist/components/bk-input-text.d.ts +11 -0
  69. package/dist/components/bk-input-text.js +17 -3
  70. package/dist/components/bk-input-time-zone.d.ts +3 -0
  71. package/dist/components/bk-input-time.js +2 -1
  72. package/dist/components/bk-item.js +2 -1
  73. package/dist/components/bk-lightbox.d.ts +12 -3
  74. package/dist/components/bk-lightbox.js +6 -3
  75. package/dist/components/bk-link.d.ts +9 -1
  76. package/dist/components/bk-link.js +14 -4
  77. package/dist/components/bk-menu-item.d.ts +40 -0
  78. package/dist/components/bk-menu-item.js +57 -9
  79. package/dist/components/bk-menu-label.js +2 -1
  80. package/dist/components/bk-menu-list.d.ts +1 -0
  81. package/dist/components/bk-menu-list.js +10 -0
  82. package/dist/components/bk-menu.d.ts +8 -1
  83. package/dist/components/bk-menu.js +16 -5
  84. package/dist/components/bk-message-feedback.d.ts +4 -3
  85. package/dist/components/bk-message-feedback.js +7 -5
  86. package/dist/components/bk-message-list.js +2 -1
  87. package/dist/components/bk-message-source.d.ts +1 -2
  88. package/dist/components/bk-message-source.js +3 -11
  89. package/dist/components/bk-message.js +2 -0
  90. package/dist/components/bk-model-viewer.d.ts +12 -1
  91. package/dist/components/bk-model-viewer.js +15 -2
  92. package/dist/components/bk-nav-group.js +1 -1
  93. package/dist/components/bk-nav-item.d.ts +18 -0
  94. package/dist/components/bk-nav-item.js +18 -5
  95. package/dist/components/bk-nav.d.ts +1 -1
  96. package/dist/components/bk-page-cta.js +2 -0
  97. package/dist/components/bk-page-section.d.ts +1 -1
  98. package/dist/components/bk-page-section.js +3 -9
  99. package/dist/components/bk-pane.d.ts +1 -0
  100. package/dist/components/bk-pane.js +7 -5
  101. package/dist/components/bk-panel.d.ts +1 -1
  102. package/dist/components/bk-panel.js +6 -5
  103. package/dist/components/bk-period-nav.d.ts +102 -0
  104. package/dist/components/bk-period-nav.js +69 -0
  105. package/dist/components/bk-picture.d.ts +17 -4
  106. package/dist/components/bk-picture.js +8 -1
  107. package/dist/components/bk-segmented-item.d.ts +24 -4
  108. package/dist/components/bk-segmented-item.js +37 -5
  109. package/dist/components/bk-segmented.js +2 -13
  110. package/dist/components/bk-select-cascade.d.ts +1 -1
  111. package/dist/components/bk-select-tree.d.ts +1 -1
  112. package/dist/components/bk-select.d.ts +1 -1
  113. package/dist/components/bk-select.js +2 -1
  114. package/dist/components/bk-shell-app.d.ts +13 -6
  115. package/dist/components/bk-shell-app.js +47 -11
  116. package/dist/components/bk-shell-sites.d.ts +2 -1
  117. package/dist/components/bk-shell-sites.js +3 -5
  118. package/dist/components/bk-sortable.d.ts +3 -0
  119. package/dist/components/bk-sortable.js +10 -17
  120. package/dist/components/bk-split-grid.d.ts +104 -3
  121. package/dist/components/bk-split-grid.js +425 -2
  122. package/dist/components/bk-split.d.ts +3 -0
  123. package/dist/components/bk-split.js +3 -0
  124. package/dist/components/bk-stat-group.js +2 -1
  125. package/dist/components/bk-stat.d.ts +17 -0
  126. package/dist/components/bk-stat.js +7 -3
  127. package/dist/components/bk-steps.js +2 -1
  128. package/dist/components/bk-surface.d.ts +2 -0
  129. package/dist/components/bk-surface.js +6 -3
  130. package/dist/components/bk-table.d.ts +17 -13
  131. package/dist/components/bk-table.js +94 -15
  132. package/dist/components/bk-tabs-item.d.ts +45 -7
  133. package/dist/components/bk-tabs-item.js +51 -20
  134. package/dist/components/bk-tabs-panel.d.ts +6 -3
  135. package/dist/components/bk-tabs-panel.js +6 -0
  136. package/dist/components/bk-tabs.d.ts +50 -7
  137. package/dist/components/bk-tabs.js +168 -96
  138. package/dist/components/bk-text.js +2 -1
  139. package/dist/components/bk-toast-group.d.ts +3 -1
  140. package/dist/components/bk-toast-group.js +11 -1
  141. package/dist/components/bk-tooltip.d.ts +3 -1
  142. package/dist/components/bk-tooltip.js +2 -1
  143. package/dist/components/bk-video.js +2 -2
  144. package/dist/components/bk-zoom.d.ts +3 -1
  145. package/dist/components/confirm.d.ts +15 -0
  146. package/dist/components/confirm.js +27 -4
  147. package/dist/i18n/de.js +19 -1
  148. package/dist/i18n/en.d.ts +2 -0
  149. package/dist/i18n/en.js +3 -0
  150. package/dist/i18n.d.ts +23 -2
  151. package/dist/i18n.js +35 -4
  152. package/dist/icons/brands-static.d.ts +3 -0
  153. package/dist/icons/brands-static.js +5 -0
  154. package/dist/icons/core.d.ts +1 -0
  155. package/dist/icons/core.js +2 -0
  156. package/dist/icons/load-static.d.ts +3 -0
  157. package/dist/icons/load-static.js +5 -0
  158. package/dist/icons/load.js +1 -0
  159. package/dist/icons/registry.js +1 -1
  160. package/dist/icons/set/save-as.d.ts +3 -0
  161. package/dist/icons/set/save-as.js +7 -0
  162. package/dist/index.d.ts +4 -0
  163. package/dist/index.js +4 -0
  164. package/dist/internal/announcer.d.ts +8 -1
  165. package/dist/internal/announcer.js +26 -10
  166. package/dist/internal/backdrop.d.ts +19 -0
  167. package/dist/internal/backdrop.js +29 -0
  168. package/dist/internal/busy.d.ts +3 -2
  169. package/dist/internal/busy.js +4 -5
  170. package/dist/internal/choice-field.js +1 -1
  171. package/dist/internal/choice-item.d.ts +17 -6
  172. package/dist/internal/choice-item.js +20 -9
  173. package/dist/internal/cloak.d.ts +3 -0
  174. package/dist/internal/cloak.js +7 -0
  175. package/dist/internal/crop-frame.d.ts +1 -1
  176. package/dist/internal/crop-frame.js +2 -7
  177. package/dist/internal/date-field.js +2 -1
  178. package/dist/internal/drag.d.ts +11 -0
  179. package/dist/internal/drag.js +23 -0
  180. package/dist/internal/english-static.d.ts +3 -0
  181. package/dist/internal/english-static.js +5 -0
  182. package/dist/internal/english.d.ts +8 -0
  183. package/dist/internal/english.js +6 -0
  184. package/dist/internal/footnotes.d.ts +56 -0
  185. package/dist/internal/footnotes.js +143 -0
  186. package/dist/internal/handle-menu.d.ts +2 -3
  187. package/dist/internal/handle-menu.js +11 -3
  188. package/dist/internal/late/bk-shell-app.d.ts +4 -0
  189. package/dist/internal/late/bk-shell-app.js +7 -0
  190. package/dist/internal/late/bk-table.d.ts +4 -0
  191. package/dist/internal/late/bk-table.js +17 -0
  192. package/dist/internal/late/handle-menu.d.ts +4 -0
  193. package/dist/internal/late/handle-menu.js +9 -0
  194. package/dist/internal/late/static.d.ts +7 -0
  195. package/dist/internal/late/static.js +5 -0
  196. package/dist/internal/late.d.ts +20 -0
  197. package/dist/internal/late.js +45 -0
  198. package/dist/internal/link.d.ts +2 -0
  199. package/dist/internal/link.js +11 -1
  200. package/dist/internal/own-text.d.ts +8 -0
  201. package/dist/internal/own-text.js +7 -0
  202. package/dist/internal/scope.js +1 -1
  203. package/dist/internal/scroll-lock.d.ts +4 -1
  204. package/dist/internal/scroll-lock.js +17 -4
  205. package/dist/internal/slider.js +2 -1
  206. package/dist/internal/styles.js +3 -0
  207. package/dist/internal/submit.d.ts +23 -0
  208. package/dist/internal/submit.js +57 -0
  209. package/dist/jsx.d.ts +176 -56
  210. package/dist/reset.css +10 -0
  211. package/dist/standalone/all.js +226 -221
  212. package/dist/standalone/appearance.js +1 -1
  213. package/dist/standalone/bk-accordion-item.js +4 -4
  214. package/dist/standalone/bk-accordion.js +2 -2
  215. package/dist/standalone/bk-action-bar.js +3 -3
  216. package/dist/standalone/bk-alert-offline.js +1 -2
  217. package/dist/standalone/bk-alert.js +13 -12
  218. package/dist/standalone/bk-app-state.js +1 -1
  219. package/dist/standalone/bk-attachment.js +4 -4
  220. package/dist/standalone/bk-avatar-group.js +12 -10
  221. package/dist/standalone/bk-avatar.js +14 -4
  222. package/dist/standalone/bk-badge.js +2 -2
  223. package/dist/standalone/bk-bar.js +3 -1
  224. package/dist/standalone/bk-brand.js +3 -3
  225. package/dist/standalone/bk-breadcrumbs.js +5 -5
  226. package/dist/standalone/bk-button-copy.js +5 -5
  227. package/dist/standalone/bk-button-group.js +5 -5
  228. package/dist/standalone/bk-button-share.js +5 -5
  229. package/dist/standalone/bk-button-top.js +9 -8
  230. package/dist/standalone/bk-button.js +74 -34
  231. package/dist/standalone/bk-calendar-event.js +1 -1
  232. package/dist/standalone/bk-calendar-week.js +3 -3
  233. package/dist/standalone/bk-calendar.js +4 -4
  234. package/dist/standalone/bk-card.js +20 -7
  235. package/dist/standalone/bk-carousel-controls.js +7 -6
  236. package/dist/standalone/bk-carousel-item.js +2 -2
  237. package/dist/standalone/bk-carousel.js +1 -1
  238. package/dist/standalone/bk-chart-area.js +1 -1
  239. package/dist/standalone/bk-chart-bar-list.js +8 -8
  240. package/dist/standalone/bk-chart-bar.js +253 -166
  241. package/dist/standalone/bk-chart-bridge.js +7 -7
  242. package/dist/standalone/bk-chart-bullet.js +6 -6
  243. package/dist/standalone/bk-chart-calendar.js +7 -7
  244. package/dist/standalone/bk-chart-heatmap.js +7 -7
  245. package/dist/standalone/bk-chart-histogram.js +5 -5
  246. package/dist/standalone/bk-chart-legend.js +6 -6
  247. package/dist/standalone/bk-chart-line.js +116 -103
  248. package/dist/standalone/bk-chart-mark.js +1 -1
  249. package/dist/standalone/bk-chart-scatter.js +6 -6
  250. package/dist/standalone/bk-chart-sparkline.js +6 -6
  251. package/dist/standalone/bk-chart-stacked-bar.js +7 -7
  252. package/dist/standalone/bk-chart-tracker.js +6 -6
  253. package/dist/standalone/bk-chart-waterfall.js +6 -6
  254. package/dist/standalone/bk-checkbox-group.js +4 -4
  255. package/dist/standalone/bk-checkbox.js +4 -4
  256. package/dist/standalone/bk-chip-group.js +9 -5
  257. package/dist/standalone/bk-chip.js +56 -17
  258. package/dist/standalone/bk-cluster.js +1 -1
  259. package/dist/standalone/bk-code-diff.js +4 -4
  260. package/dist/standalone/bk-code-stack.js +4 -4
  261. package/dist/standalone/bk-code.js +10 -6
  262. package/dist/standalone/bk-color-panel.js +5 -5
  263. package/dist/standalone/bk-columns.js +13 -5
  264. package/dist/standalone/bk-combobox.js +53 -33
  265. package/dist/standalone/bk-command-menu.js +6 -6
  266. package/dist/standalone/bk-command-palette.js +6 -5
  267. package/dist/standalone/bk-composer.js +6 -6
  268. package/dist/standalone/bk-delta.js +11 -10
  269. package/dist/standalone/bk-diagram.js +1 -1
  270. package/dist/standalone/bk-dialog.js +1 -1
  271. package/dist/standalone/bk-disclosure.js +7 -5
  272. package/dist/standalone/bk-divider.js +2 -2
  273. package/dist/standalone/bk-drawer.js +3 -3
  274. package/dist/standalone/bk-drop-target.js +12 -6
  275. package/dist/standalone/bk-empty-state.js +3 -3
  276. package/dist/standalone/bk-error-summary.js +9 -6
  277. package/dist/standalone/bk-facts-item.js +10 -8
  278. package/dist/standalone/bk-facts.js +28 -16
  279. package/dist/standalone/bk-feature.js +3 -3
  280. package/dist/standalone/bk-fieldset.js +3 -3
  281. package/dist/standalone/bk-filter-bar.js +4 -4
  282. package/dist/standalone/bk-folder-browser.js +4 -4
  283. package/dist/standalone/bk-footnote.js +82 -0
  284. package/dist/standalone/bk-footnotes-item.js +122 -0
  285. package/dist/standalone/bk-footnotes.js +37 -0
  286. package/dist/standalone/bk-form-guard.js +2 -2
  287. package/dist/standalone/bk-form-steps.js +3 -3
  288. package/dist/standalone/bk-grid.js +1 -1
  289. package/dist/standalone/bk-icon-tile.js +3 -3
  290. package/dist/standalone/bk-icon.js +1 -1
  291. package/dist/standalone/bk-image-compare.js +88 -47
  292. package/dist/standalone/bk-image-crop.js +6 -6
  293. package/dist/standalone/bk-image-editor.js +2 -1
  294. package/dist/standalone/bk-image-viewer.js +180 -59
  295. package/dist/standalone/bk-input-code.js +4 -4
  296. package/dist/standalone/bk-input-color.js +4 -4
  297. package/dist/standalone/bk-input-date-range.js +2 -2
  298. package/dist/standalone/bk-input-date.js +2 -2
  299. package/dist/standalone/bk-input-file.js +5 -5
  300. package/dist/standalone/bk-input-group.js +4 -4
  301. package/dist/standalone/bk-input-inline.js +17 -10
  302. package/dist/standalone/bk-input-number.js +9 -8
  303. package/dist/standalone/bk-input-rating.js +6 -6
  304. package/dist/standalone/bk-input-rich.js +1 -1
  305. package/dist/standalone/bk-input-search.js +23 -22
  306. package/dist/standalone/bk-input-slider-range.js +5 -5
  307. package/dist/standalone/bk-input-slider.js +5 -5
  308. package/dist/standalone/bk-input-text.js +1 -1
  309. package/dist/standalone/bk-input-time-zone.js +1 -1
  310. package/dist/standalone/bk-input-time.js +29 -28
  311. package/dist/standalone/bk-item-group.js +3 -3
  312. package/dist/standalone/bk-item.js +12 -11
  313. package/dist/standalone/bk-kbd-shortcuts.js +4 -3
  314. package/dist/standalone/bk-kbd.js +68 -1
  315. package/dist/standalone/bk-lightbox.js +11 -7
  316. package/dist/standalone/bk-lines.js +1 -1
  317. package/dist/standalone/bk-link.js +33 -19
  318. package/dist/standalone/bk-listbox-columns.js +6 -6
  319. package/dist/standalone/bk-listbox-item.js +1 -1
  320. package/dist/standalone/bk-listbox-search.js +7 -7
  321. package/dist/standalone/bk-listbox-transfer.js +6 -6
  322. package/dist/standalone/bk-listbox.js +7 -7
  323. package/dist/standalone/bk-logo-wall.js +2 -2
  324. package/dist/standalone/bk-logo.js +3 -3
  325. package/dist/standalone/bk-menu-bar.js +3 -3
  326. package/dist/standalone/bk-menu-context.js +1 -1
  327. package/dist/standalone/bk-menu-divider.js +2 -2
  328. package/dist/standalone/bk-menu-item.js +73 -29
  329. package/dist/standalone/bk-menu-label.js +7 -6
  330. package/dist/standalone/bk-menu-list.js +10 -4
  331. package/dist/standalone/bk-menu.js +19 -10
  332. package/dist/standalone/bk-message-approval.js +4 -4
  333. package/dist/standalone/bk-message-branches.js +3 -3
  334. package/dist/standalone/bk-message-citation.js +10 -10
  335. package/dist/standalone/bk-message-feedback.js +10 -6
  336. package/dist/standalone/bk-message-list.js +6 -5
  337. package/dist/standalone/bk-message-reasoning.js +5 -5
  338. package/dist/standalone/bk-message-source.js +13 -21
  339. package/dist/standalone/bk-message-tool-group.js +5 -5
  340. package/dist/standalone/bk-message-tool.js +5 -5
  341. package/dist/standalone/bk-message.js +6 -4
  342. package/dist/standalone/bk-meter.js +3 -3
  343. package/dist/standalone/bk-model-viewer.js +1 -1
  344. package/dist/standalone/bk-nav-divider.js +2 -2
  345. package/dist/standalone/bk-nav-group.js +6 -6
  346. package/dist/standalone/bk-nav-item.js +31 -23
  347. package/dist/standalone/bk-nav-toc.js +3 -3
  348. package/dist/standalone/bk-nav.js +3 -3
  349. package/dist/standalone/bk-overflow.js +3 -3
  350. package/dist/standalone/bk-page-cta.js +5 -3
  351. package/dist/standalone/bk-page-footer-column.js +2 -2
  352. package/dist/standalone/bk-page-footer.js +3 -3
  353. package/dist/standalone/bk-page-header.js +3 -3
  354. package/dist/standalone/bk-page-hero.js +3 -3
  355. package/dist/standalone/bk-page-pager.js +5 -5
  356. package/dist/standalone/bk-page-section.js +6 -6
  357. package/dist/standalone/bk-pagination.js +6 -6
  358. package/dist/standalone/bk-pane.js +10 -9
  359. package/dist/standalone/bk-panel.js +9 -10
  360. package/dist/standalone/bk-period-nav.js +69 -0
  361. package/dist/standalone/bk-picture.js +24 -15
  362. package/dist/standalone/bk-popover-help.js +3 -3
  363. package/dist/standalone/bk-popover.js +2 -2
  364. package/dist/standalone/bk-presence-cursor.js +2 -2
  365. package/dist/standalone/bk-preview.js +4 -4
  366. package/dist/standalone/bk-progress.js +3 -3
  367. package/dist/standalone/bk-prose.js +3 -3
  368. package/dist/standalone/bk-qr-code.js +1 -1
  369. package/dist/standalone/bk-radio-group.js +4 -4
  370. package/dist/standalone/bk-radio.js +3 -3
  371. package/dist/standalone/bk-rating.js +5 -5
  372. package/dist/standalone/bk-scroll.js +3 -3
  373. package/dist/standalone/bk-segmented-item.js +40 -16
  374. package/dist/standalone/bk-segmented.js +15 -13
  375. package/dist/standalone/bk-select-cascade.js +3 -3
  376. package/dist/standalone/bk-select-tree.js +4 -4
  377. package/dist/standalone/bk-select.js +7 -6
  378. package/dist/standalone/bk-shell-app.js +1 -1217
  379. package/dist/standalone/bk-shell-centered.js +2 -2
  380. package/dist/standalone/bk-shell-sites.js +5 -7
  381. package/dist/standalone/bk-skeleton.js +2 -2
  382. package/dist/standalone/bk-sortable.js +58 -60
  383. package/dist/standalone/bk-spinner.js +2 -2
  384. package/dist/standalone/bk-split-grid.js +318 -41
  385. package/dist/standalone/bk-split.js +9 -6
  386. package/dist/standalone/bk-stack.js +1 -1
  387. package/dist/standalone/bk-stat-group.js +8 -7
  388. package/dist/standalone/bk-stat.js +11 -8
  389. package/dist/standalone/bk-status-dot.js +3 -3
  390. package/dist/standalone/bk-steps-item.js +5 -5
  391. package/dist/standalone/bk-steps.js +8 -7
  392. package/dist/standalone/bk-surface.js +1 -1
  393. package/dist/standalone/bk-swatch-group.js +4 -4
  394. package/dist/standalone/bk-swatch-palette.js +1 -1
  395. package/dist/standalone/bk-swatch.js +2 -2
  396. package/dist/standalone/bk-switch.js +4 -4
  397. package/dist/standalone/bk-table.js +1 -1887
  398. package/dist/standalone/bk-tabs-item.js +58 -35
  399. package/dist/standalone/bk-tabs-panel.js +7 -3
  400. package/dist/standalone/bk-tabs.js +160 -98
  401. package/dist/standalone/bk-tasks-item.js +4 -4
  402. package/dist/standalone/bk-tasks.js +2 -2
  403. package/dist/standalone/bk-testimonial.js +3 -3
  404. package/dist/standalone/bk-text.js +19 -18
  405. package/dist/standalone/bk-time-countdown.js +4 -4
  406. package/dist/standalone/bk-time-relative.js +3 -3
  407. package/dist/standalone/bk-timeline-item.js +4 -4
  408. package/dist/standalone/bk-timeline.js +2 -2
  409. package/dist/standalone/bk-toast-group.js +1 -1
  410. package/dist/standalone/bk-toast.js +4 -4
  411. package/dist/standalone/bk-toolbar.js +2 -2
  412. package/dist/standalone/bk-tooltip.js +8 -7
  413. package/dist/standalone/bk-tree-item.js +6 -6
  414. package/dist/standalone/bk-tree.js +3 -3
  415. package/dist/standalone/bk-video.js +6 -6
  416. package/dist/standalone/bk-visually-hidden.js +2 -2
  417. package/dist/standalone/bk-zoom.js +5 -5
  418. package/dist/standalone/chunks/announcer-D1zrRWwO.js +36 -0
  419. package/dist/standalone/chunks/{appearance-waHnV0kk.js → appearance-CBOJXbmC.js} +1 -1
  420. package/dist/standalone/chunks/{bk-alert-offline-BoMEYxnE.js → bk-alert-offline-Clw0ZSsH.js} +3 -3
  421. package/dist/standalone/chunks/{bk-carousel-B7-9OanA.js → bk-carousel-Biz7t8sL.js} +4 -4
  422. package/dist/standalone/chunks/{bk-diagram-CpOpicmo.js → bk-diagram-D_fQf6SF.js} +5 -5
  423. package/dist/standalone/chunks/{bk-dialog-a2BtUBf2.js → bk-dialog-DwZyUUHh.js} +65 -27
  424. package/dist/standalone/chunks/{bk-icon-DssFsNuB.js → bk-icon-Bp_flKdv.js} +4 -3
  425. package/dist/standalone/chunks/{bk-image-editor-z_Uj83fy.js → bk-image-editor-BADsoLRL.js} +5 -5
  426. package/dist/standalone/chunks/{bk-input-date-range-BQkbPlSJ.js → bk-input-date-range-DHcJ8-5g.js} +2 -2
  427. package/dist/standalone/chunks/{bk-input-rich-Dte_b4Ev.js → bk-input-rich-CFhW6vRa.js} +6 -6
  428. package/dist/standalone/chunks/{bk-input-text-CUNQG1ah.js → bk-input-text-DviyLBqj.js} +63 -54
  429. package/dist/standalone/chunks/{bk-model-viewer-D1XJPgAG.js → bk-model-viewer-w_Ah4Tvs.js} +22 -8
  430. package/dist/standalone/chunks/{bk-qr-code-CbI9rdOK.js → bk-qr-code-CYMovNVl.js} +3 -3
  431. package/dist/standalone/chunks/bk-shell-app-B2lxHit8.js +1235 -0
  432. package/dist/standalone/chunks/{bk-surface-DkIhrWMt.js → bk-surface-D7e0tErs.js} +9 -7
  433. package/dist/standalone/chunks/{bk-swatch-palette-BNNXTP3w.js → bk-swatch-palette-x13JgJQi.js} +6 -6
  434. package/dist/standalone/chunks/bk-table-CP8n_jy7.js +1944 -0
  435. package/dist/standalone/chunks/{bk-toast-group-Cix-Urgi.js → bk-toast-group-CoL6W7uk.js} +27 -24
  436. package/dist/standalone/chunks/{brush-Bn3lPdHN.js → brush-DALmXSru.js} +18 -2
  437. package/dist/standalone/chunks/{busy-B7Mxemwm.js → busy-BUB22mGY.js} +5 -4
  438. package/dist/standalone/chunks/{chart-tokens-D1Exf7BW.js → chart-tokens-DQ4hVSmn.js} +2 -2
  439. package/dist/standalone/chunks/{choice-field-BnuK9mp_.js → choice-field-poOTerh1.js} +6 -6
  440. package/dist/standalone/chunks/{choice-item-B6-9ZRlf.js → choice-item-Cx-nm1js.js} +17 -8
  441. package/dist/standalone/chunks/clipboard-RqIeP9Uz.js +29 -0
  442. package/dist/standalone/chunks/clipboard-UVLSkL4C.js +34 -0
  443. package/dist/standalone/chunks/{crop-frame-poLCGrBG.js → crop-frame-Z9N0QML4.js} +1 -11
  444. package/dist/standalone/chunks/{date-field-BQ5k-DDL.js → date-field-B-fCXa2D.js} +48 -47
  445. package/dist/standalone/chunks/{define-CzVPD4Zi.js → define-DkVeu7e9.js} +1 -1
  446. package/dist/standalone/chunks/drag-DT4__0t9.js +12 -0
  447. package/dist/standalone/chunks/footnotes-BeisMxLk.js +94 -0
  448. package/dist/standalone/chunks/{form-control-D7dqSP9M.js → form-control-CHpfKAKa.js} +2 -2
  449. package/dist/standalone/chunks/{frame-BW1nKuoM.js → frame-xIMVEUCi.js} +7 -4
  450. package/dist/standalone/chunks/handle-menu-BgYUbGO2.js +56 -0
  451. package/dist/standalone/chunks/{heading-text-CV5gBf7k.js → heading-text-CgnCa_q2.js} +1 -1
  452. package/dist/standalone/chunks/{i18n-CNsBRNPu.js → i18n-DFfGgd3d.js} +56 -34
  453. package/dist/standalone/chunks/{i18n-CrZgrRu9.js → i18n-DQAcbHkY.js} +1 -1
  454. package/dist/standalone/chunks/link--YWr8exL.js +69 -0
  455. package/dist/standalone/chunks/{marks-CdqbbJpM.js → marks-pOUDNUf1.js} +2 -2
  456. package/dist/standalone/chunks/{options-DMEc8rQt.js → options-BdC8-KKM.js} +2 -2
  457. package/dist/standalone/chunks/own-text-mpZVnMyX.js +5 -0
  458. package/dist/standalone/chunks/{palettes-CKLHSIPx.js → palettes-J4bQ21ks.js} +2 -2
  459. package/dist/standalone/chunks/{popover-base-oDhxsYMr.js → popover-base-hxo-Vh6E.js} +2 -2
  460. package/dist/standalone/chunks/{prose-BG4oQH-i.js → prose-BiuJgiah.js} +1 -1
  461. package/dist/standalone/chunks/{ramp-EclrETaQ.js → ramp-CGDOcqBZ.js} +1 -1
  462. package/dist/standalone/chunks/save-as-DBGZjczB.js +6 -0
  463. package/dist/standalone/chunks/shortcuts-DPxCSO4M.js +210 -0
  464. package/dist/standalone/chunks/{slider-BWT8Fmwz.js → slider-jp3d-Ld-.js} +15 -14
  465. package/dist/standalone/chunks/{stars-BN9M_9Q1.js → stars-BgKEjDQx.js} +1 -1
  466. package/dist/standalone/chunks/{styles-DwSR-9a3.js → styles-CaeyhYDA.js} +3 -0
  467. package/dist/standalone/chunks/submit-BjBGB8OW.js +42 -0
  468. package/dist/standalone/chunks/{summary-BwL-Gp8w.js → summary-W5s0TFqV.js} +1 -1
  469. package/dist/standalone/chunks/{text-field-CTp2b-Ai.js → text-field-CqhJSAwZ.js} +4 -4
  470. package/dist/standalone/chunks/{toggle-control-DXkgmz7R.js → toggle-control-lvZbQtGW.js} +2 -2
  471. package/dist/standalone/chunks/{tokens-BuahF1lF.js → tokens-C_ul7pL9.js} +4 -3
  472. package/dist/standalone/chunks/{virtual-B-1oN14Y.js → virtual-C_h6sHnm.js} +1 -1
  473. package/dist/standalone/confirm.js +27 -14
  474. package/dist/standalone/i18n-de.js +20 -2
  475. package/dist/standalone/icons.js +100 -98
  476. package/dist/standalone/links.js +1 -1
  477. package/dist/standalone/reset.css +10 -0
  478. package/dist/standalone/toast.js +1 -1
  479. package/dist/standalone/tokens.css +9 -5
  480. package/dist/tokens.css +9 -5
  481. package/dist/tokens.js +4 -3
  482. package/package.json +25 -2
  483. package/dist/standalone/chunks/announcer-haFcvqbe.js +0 -25
  484. package/dist/standalone/chunks/bk-kbd-B7bz8hmV.js +0 -275
  485. package/dist/standalone/chunks/clipboard-DBGdJ-1S.js +0 -61
  486. package/dist/standalone/chunks/handle-menu-DsxWvv4D.js +0 -22
  487. package/dist/standalone/chunks/link-CWSMsx04.js +0 -60
@@ -8,6 +8,7 @@ import { emitDetail } from "../internal/events.js";
8
8
  import { LinkController } from "../internal/link.js";
9
9
  import { adoptChartTokens } from "../charts/chart-tokens.js";
10
10
  import { chartT } from "../charts/i18n.js";
11
+ import { resolveFields, fieldLabel, fieldValue, tooltipFieldsConverter } from "../charts/fields.js";
11
12
  import { axisFormatter, formatPercent, formatTime, formatValue } from "../charts/format.js";
12
13
  import { bandScale, linearScale, niceTicks } from "../charts/scale.js";
13
14
  import { Brush } from "../charts/brush.js";
@@ -23,6 +24,8 @@ class BkChartBar extends LitElement {
23
24
  series: { attribute: false },
24
25
  x: {},
25
26
  xLabel: { attribute: "x-label" },
27
+ detail: {},
28
+ detailLabel: { attribute: "detail-label" },
26
29
  orientation: { reflect: true, useDefault: true },
27
30
  mode: { reflect: true, useDefault: true },
28
31
  labels: { type: Boolean, reflect: true },
@@ -45,7 +48,8 @@ class BkChartBar extends LitElement {
45
48
  table: { type: Boolean, reflect: true },
46
49
  bare: { type: Boolean, reflect: true },
47
50
  variant: { reflect: true, useDefault: true },
48
- valueFormat: { attribute: "value-format", type: Object }
51
+ valueFormat: { attribute: "value-format", type: Object },
52
+ tooltipFields: { attribute: "tooltip-fields", converter: tooltipFieldsConverter }
49
53
  };
50
54
  i18n = new LocalizeController(this);
51
55
  chart = new ChartController(this);
@@ -110,15 +114,52 @@ class BkChartBar extends LitElement {
110
114
  const v = row?.[this.x];
111
115
  return this.rawKey(v) === c || v instanceof Date && this.rawKey(v).startsWith(c) || this.category(row) === c;
112
116
  }
113
- /** The `href` of the link of a category: the template with the values of its row. */
117
+ /**
118
+ * The `href` of the link of a category: the template with the values of its row. A template of one field takes the
119
+ * value as it is. Null when a field of the template has no value in the row.
120
+ */
114
121
  categoryHref(row) {
115
- return (this.href ?? "").replace(/\{([\w-]+)\}/g, (m, key) => {
116
- if (key in row)
117
- return encodeURIComponent(this.rawKey(row[key]));
118
- if (key === "x")
119
- return encodeURIComponent(this.rawKey(row[this.x]));
120
- return m;
122
+ const template = this.href ?? "";
123
+ const known = (key) => key in row || key === "x";
124
+ const field = (key) => key in row ? row[key] : row[this.x];
125
+ const blank = (v) => v === void 0 || v === null || v === "";
126
+ const whole = /^\{([\w-]+)\}$/.exec(template);
127
+ if (whole && known(whole[1])) {
128
+ const v = field(whole[1]);
129
+ return blank(v) ? null : this.rawKey(v);
130
+ }
131
+ let missing = false;
132
+ const href = template.replace(/\{([\w-]+)\}/g, (m, key) => {
133
+ if (!known(key))
134
+ return m;
135
+ const v = field(key);
136
+ if (blank(v))
137
+ missing = true;
138
+ return encodeURIComponent(this.rawKey(v));
121
139
  });
140
+ return missing ? null : href;
141
+ }
142
+ /** True when no series of the row has a value: the category draws placeholders and has no link or button. */
143
+ isEmpty(row) {
144
+ return this.effectiveSeries.every((se) => num(row?.[se.key]) === null);
145
+ }
146
+ /** The second label of a category (the `detail` field), or an empty string. */
147
+ detailText(row) {
148
+ if (!this.detail)
149
+ return "";
150
+ const v = row?.[this.detail];
151
+ if (v instanceof Date)
152
+ return formatTime(this.i18n.locale, v.getTime());
153
+ return v === void 0 || v === null ? "" : String(v);
154
+ }
155
+ /** The name of a category in tooltips and accessible names: the category and its second label. */
156
+ categoryName(row) {
157
+ const category = this.category(row), detail = this.detailText(row);
158
+ return detail ? chartT(this.i18n.locale, "chartCategoryDetail", { category, detail }) : category;
159
+ }
160
+ /** True when the chart reserves room for the mark of a chosen category (links, buttons, or `current`). */
161
+ get marksCurrent() {
162
+ return this.pickMode !== null || this.current !== void 0 && this.current !== null && this.current !== "";
122
163
  }
123
164
  /** Fires `select` for the category `i` of the view. When no listener cancels the event, the category becomes `current`. */
124
165
  choose(i) {
@@ -131,7 +172,8 @@ class BkChartBar extends LitElement {
131
172
  /** The name of the link or button of a category: the category and its values. */
132
173
  categoryLabel(i) {
133
174
  const bars = this.layoutCache?.bars.filter((b) => b.i === i) ?? [];
134
- return bars.map((b) => this.markLabel(b)).join("; ");
175
+ const text = bars.map((b) => this.markLabel(b, false)).join("; ");
176
+ return this.extraFields.length && bars.length ? `${text}; ${this.extraText(this.viewRows[i])}` : text;
135
177
  }
136
178
  static styles = [base, ...chartStyles, css`
137
179
  .plot { height: var(--bk-chart-height); }
@@ -149,9 +191,14 @@ class BkChartBar extends LitElement {
149
191
  }
150
192
  .mark.rest { fill: var(--bk-chart-bar-rest, var(--bk-chart-other)); }
151
193
  text.current { fill: var(--bk-chart-bar-current-label, var(--bk-text)); font-weight: var(--bk-weight-medium); }
194
+ text.detail { fill: var(--bk-chart-bar-detail, var(--bk-chart-label)); }
195
+ .current-mark { fill: var(--bk-chart-bar-current-mark, var(--bk-accent-solid)); }
196
+ .stub { fill: none; stroke: var(--bk-chart-bar-stub, var(--bk-chart-axis)); stroke-width: 1; }
152
197
  @media (forced-colors: active) {
153
198
  .ghost { fill: none; stroke: CanvasText; } .selection { fill: Highlight; stroke: Highlight; }
154
199
  .mark.rest { fill: GrayText; }
200
+ .current-mark { fill: Highlight; }
201
+ .stub { stroke: GrayText; }
155
202
  .cat:hover { outline: var(--bk-border-width) solid Highlight; outline-offset: var(--bk-focus-offset-inset); }
156
203
  }
157
204
  `, markStyles];
@@ -227,7 +274,12 @@ class BkChartBar extends LitElement {
227
274
  }
228
275
  const fs = s.labelSize, font = s.font;
229
276
  const cats = rows.map((r) => this.category(r));
230
- const catW = Math.max(0, ...cats.map((c) => measureText(c, fs, font)));
277
+ const details = rows.map((r) => this.detailText(r));
278
+ const hasDetail = details.some(Boolean);
279
+ const catW = Math.max(0, ...cats.map((c) => measureText(c, fs, font)), ...details.map((d) => measureText(d, fs, font)));
280
+ const empty = rows.map((r) => this.isEmpty(r));
281
+ const lineStep = fs + s.clear;
282
+ const markSpace = this.marksCurrent ? s.clear + s.indicator : 0;
231
283
  const groupThick = (band) => {
232
284
  if (this.contiguous)
233
285
  return { t: Math.max(1, band - s.gap), groupW: Math.max(1, band - s.gap) };
@@ -242,7 +294,7 @@ class BkChartBar extends LitElement {
242
294
  if (!horizontal) {
243
295
  H = this.chart.height;
244
296
  y0 = Math.max(labelPad, fs / 2 + 2);
245
- y1 = H - (fs + 10 + s.clear);
297
+ y1 = H - (fs + 10 + s.clear + (hasDetail ? lineStep : 0) + markSpace);
246
298
  ticks = niceTicks(lo, hi, Math.max(2, Math.round((y1 - y0) / 48)));
247
299
  if (percent)
248
300
  ticks = niceTicks(0, 1, 4);
@@ -253,7 +305,8 @@ class BkChartBar extends LitElement {
253
305
  } else {
254
306
  const per = stacked ? 1 : Math.max(1, k);
255
307
  const groupW2 = this.contiguous ? s.barMax : per * (s.barMax * (1 + gh) + (gh ? s.gap : 0)) + (per - 1) * s.gap;
256
- const band = Math.max(groupW2 / 0.7, s.hitMin + 8);
308
+ const reach = (hasDetail ? lineStep / 2 + fs / 2 : fs / 2) + markSpace;
309
+ const band = Math.max(groupW2 / 0.7, s.hitMin + 8, Math.ceil(2 * reach + 2 * s.clear));
257
310
  x0 = Math.ceil(Math.min(catW, W * 0.35) + 8);
258
311
  y0 = 2;
259
312
  y1 = y0 + n * band;
@@ -276,6 +329,8 @@ class BkChartBar extends LitElement {
276
329
  seriesLabels = series.map((se, j) => ({ j, y: 0, text: se.label }));
277
330
  }
278
331
  }
332
+ if (this.variant === "minimal" && !percent && hi > lo)
333
+ ticks = { ...ticks, min: Math.min(0, lo), max: Math.max(0, hi) };
279
334
  const valueScale = horizontal ? linearScale([ticks.min, ticks.max], [x0, x1]) : linearScale([ticks.min, ticks.max], [y1, y0]);
280
335
  const bands = horizontal ? bandScale(n, [y0, y1]) : bandScale(n, [x0, x1]);
281
336
  const { t, groupW } = groupThick(bands.width);
@@ -325,14 +380,18 @@ class BkChartBar extends LitElement {
325
380
  const hw = stacked ? Math.max(t, Math.min(s.hitMin, bands.width)) : Math.max(t + s.gap, Math.min(s.hitMin, bands.width / Math.max(1, k)));
326
381
  const hx = off + t / 2 - hw / 2;
327
382
  const [hy, hh] = stacked ? [y - s.gap / 2, Math.max(h + s.gap, 4)] : [y0, y1 - y0];
328
- bar = { i, j, value: raw, share, path: v === null ? "" : barPath(off, y, t, h, s.radius, end), x: off, y, w: t, h, hx, hy, hw, hh, ax: off + t / 2, ay: negative ? y + h : y };
383
+ bar = { i, j, value: raw, share, path: v === null ? "" : barPath(off, y, t, h, s.radius, end), x: off, y, w: t, h, hx, hy, hw, hh, ax: off + t / 2, ay: negative ? y + h : y, stub: "" };
329
384
  } else {
330
385
  const x = Math.min(pa, pb), w = Math.abs(pb - pa);
331
386
  const end = !outer ? "none" : negative ? "left" : "right";
332
387
  const hh = stacked ? Math.max(t, Math.min(s.hitMin, bands.width)) : Math.max(t + s.gap, Math.min(s.hitMin, bands.width / Math.max(1, k)));
333
388
  const hy = off + t / 2 - hh / 2;
334
389
  const [hx, hw] = stacked ? [x - s.gap / 2, Math.max(w + s.gap, 4)] : [x0, x1 - x0];
335
- bar = { i, j, value: raw, share, path: v === null ? "" : barPath(x, off, w, t, s.radius, end), x, y: off, w, h: t, hx, hy, hw, hh, ax: negative ? x : x + w, ay: off + t / 2 };
390
+ bar = { i, j, value: raw, share, path: v === null ? "" : barPath(x, off, w, t, s.radius, end), x, y: off, w, h: t, hx, hy, hw, hh, ax: negative ? x : x + w, ay: off + t / 2, stub: "" };
391
+ }
392
+ if (raw === null && (!stacked || empty[i] && j === 0)) {
393
+ const len = Math.max(s.clear, Math.round(t / 2));
394
+ bar.stub = horizontal ? barPath(zero, off, len, t, s.radius, "right") : barPath(off, zero - len, t, len, s.radius, "top");
336
395
  }
337
396
  bars.push(bar);
338
397
  const g = ghostOf(i, j);
@@ -353,14 +412,23 @@ class BkChartBar extends LitElement {
353
412
  if (ys.some((y, idx) => idx && y - ys[idx - 1] < fs + 2))
354
413
  seriesLabels = [];
355
414
  }
356
- return { H, x0, x1, y0, y1, ticks, fmtTick, valueScale, bands, bars, ghosts, marks, cmp: !!cmpRows, t, zero, cats, values, totals, seriesLabels, horizontal, stacked, percent, series, n, k };
415
+ return { H, x0, x1, y0, y1, ticks, fmtTick, valueScale, bands, bars, ghosts, marks, cmp: !!cmpRows, t, zero, cats, details, hasDetail, empty, lineStep, values, totals, seriesLabels, horizontal, stacked, percent, series, n, k };
357
416
  }
358
417
  /* ---------------------------------------------------------------- interaction */
359
- markLabel(b) {
418
+ markLabel(b, extras = true) {
360
419
  const se = this.effectiveSeries[b.j];
361
- const cat = this.category(this.viewRows[b.i]);
362
- const value = this.mode === "percent" && b.value !== null ? `${formatPercent(this.i18n.locale, b.share, 1)} (${this.fmt(b.value)})` : this.fmt(b.value);
363
- return chartT(this.i18n.locale, "chartMark", { category: cat, series: se?.label ?? "", value });
420
+ const cat = this.categoryName(this.viewRows[b.i]);
421
+ const value = b.value === null ? chartT(this.i18n.locale, "chartNoValue") : this.mode === "percent" ? `${formatPercent(this.i18n.locale, b.share, 1)} (${this.fmt(b.value)})` : this.fmt(b.value);
422
+ const text = chartT(this.i18n.locale, "chartMark", { category: cat, series: se?.label ?? "", value });
423
+ return extras && this.extraFields.length ? `${text}; ${this.extraText(this.viewRows[b.i])}` : text;
424
+ }
425
+ /** The extra fields of the tooltip (`tooltip-fields`). */
426
+ get extraFields() {
427
+ return resolveFields(this.tooltipFields);
428
+ }
429
+ /** The extra fields of a row as one text: "Prints 12, Likes 3". */
430
+ extraText(row) {
431
+ return this.extraFields.map((f) => `${fieldLabel(f)} ${fieldValue(this.i18n.locale, row, f)}`).join(", ");
364
432
  }
365
433
  tooltipFor(b) {
366
434
  const series = this.effectiveSeries;
@@ -383,7 +451,9 @@ class BkChartBar extends LitElement {
383
451
  }
384
452
  if (this.mode !== "grouped" && series.length > 1)
385
453
  rows.push({ label: chartT(locale, "chartTotal"), value: this.fmt(total), color: "", marker: "rect", active: false });
386
- return { title: this.category(row), rows, x: b.ax, y: b.ay };
454
+ for (const f of this.extraFields)
455
+ rows.push({ label: fieldLabel(f), value: fieldValue(locale, row, f), color: "", marker: "rect", active: false });
456
+ return { title: this.categoryName(row), rows, x: b.ax, y: b.ay };
387
457
  }
388
458
  enter(b) {
389
459
  this.hot = { i: b.i, j: b.j };
@@ -492,26 +562,31 @@ class BkChartBar extends LitElement {
492
562
  await this.updateComplete;
493
563
  this.renderRoot.querySelector(`.hit[data-i="${i}"][data-j="${j}"]`)?.focus();
494
564
  }
495
- /** Keys on the links or buttons of the categories: arrow keys, Home and End move the focus; Escape hides the tooltip. */
565
+ /**
566
+ * Keys on the links or buttons of the categories: arrow keys, Home and End move the focus; Escape hides the tooltip.
567
+ * The keys skip a category without a link or button. The chart draws from left to right in every writing direction,
568
+ * and the arrow keys follow the drawing.
569
+ */
496
570
  onCategoryKey = async (e) => {
497
- const n = this.viewRows.length;
498
- const from = e.target.closest(".cat");
499
- if (!n || !from)
571
+ const from = e.target.closest("a.cat, button.cat");
572
+ const items = [...this.renderRoot.querySelectorAll("a.cat, button.cat")];
573
+ const at = from ? items.indexOf(from) : -1;
574
+ if (at < 0)
500
575
  return;
501
576
  const h = this.orientation === "horizontal";
502
- let i = Number(from.dataset.i);
577
+ let to = at;
503
578
  switch (e.key) {
504
579
  case (h ? "ArrowDown" : "ArrowRight"):
505
- i = Math.min(n - 1, i + 1);
580
+ to = Math.min(items.length - 1, at + 1);
506
581
  break;
507
582
  case (h ? "ArrowUp" : "ArrowLeft"):
508
- i = Math.max(0, i - 1);
583
+ to = Math.max(0, at - 1);
509
584
  break;
510
585
  case "Home":
511
- i = 0;
586
+ to = 0;
512
587
  break;
513
588
  case "End":
514
- i = n - 1;
589
+ to = items.length - 1;
515
590
  break;
516
591
  case "Escape":
517
592
  this.chart.hideTooltip();
@@ -519,6 +594,7 @@ class BkChartBar extends LitElement {
519
594
  default:
520
595
  return;
521
596
  }
597
+ const i = Number(items[to].dataset.i);
522
598
  e.preventDefault();
523
599
  this.active = { i, j: this.active.j };
524
600
  this.requestUpdate();
@@ -537,13 +613,20 @@ class BkChartBar extends LitElement {
537
613
  const cmp = !!this.compare?.length && this.mode === "grouped" && !this.contiguous;
538
614
  const cmpLabel = this.compareLabel || chartT(locale, "chartPrevious");
539
615
  const columns = [this.xLabel || chartT(locale, "chartCategory")];
616
+ if (this.detail)
617
+ columns.push(this.detailLabel || chartT(locale, "chartDetail"));
540
618
  for (const se of series)
541
619
  columns.push(se.label, ...cmp ? [`${se.label} \xB7 ${cmpLabel}`, `${se.label} \xB7 ${chartT(locale, "chartChange")}`] : []);
542
620
  if (stacked)
543
621
  columns.push(chartT(locale, "chartTotal"));
622
+ const extra = this.extraFields;
623
+ for (const f of extra)
624
+ columns.push(fieldLabel(f));
544
625
  const rows = (this.data ?? []).map((r, i) => {
545
626
  const vs = series.map((s) => num(r[s.key]));
546
627
  const cells = [this.category(r)];
628
+ if (this.detail)
629
+ cells.push(this.detailText(r));
547
630
  vs.forEach((v, j) => {
548
631
  cells.push(this.fmt(v));
549
632
  if (cmp) {
@@ -553,6 +636,8 @@ class BkChartBar extends LitElement {
553
636
  });
554
637
  if (stacked)
555
638
  cells.push(this.fmt(vs.reduce((a, v) => a + (v ?? 0), 0)));
639
+ for (const f of extra)
640
+ cells.push(fieldValue(locale, r, f));
556
641
  return cells;
557
642
  });
558
643
  return { caption: this.heading || chartT(locale, "chartData"), columns, rows };
@@ -581,26 +666,47 @@ class BkChartBar extends LitElement {
581
666
  const cur = this.viewRows.map((r) => this.isCurrent(r));
582
667
  const anyCur = cur.some(Boolean);
583
668
  let catLabels;
669
+ const width = (text) => measureText(text, fs, font);
670
+ const currentMark = (cx, w, base2, anchor) => {
671
+ const mw = Math.max(Math.round(w), Math.round(L.t), s.hitMin);
672
+ const x = anchor === "middle" ? Math.round(cx - mw / 2) : Math.round(cx - mw);
673
+ const y = Math.round(base2 + fs * 0.25 + s.clear / 2);
674
+ return svg`<rect class="current-mark" x=${x} y=${y} width=${mw} height=${s.indicator} rx=${s.indicator / 2}></rect>`;
675
+ };
584
676
  if (!h) {
585
- const maxW = Math.max(...L.cats.map((c) => measureText(c, fs, font)));
586
- const place = (text, i) => {
587
- const half = measureText(text, fs, font) / 2;
588
- return Math.min(Math.max(L.bands.center(i), L.x0 + half), L.x1 - half);
589
- };
677
+ const base1 = L.y1 + fs + 4 + s.clear, base2 = base1 + L.lineStep;
678
+ const maxW = Math.max(...L.cats.map(width), ...L.details.map(width));
679
+ const place = (w, i) => Math.min(Math.max(L.bands.center(i), L.x0 + w / 2), L.x1 - w / 2);
590
680
  const pick = (every2) => L.cats.map((c, i) => {
591
681
  if (i % every2)
592
682
  return null;
593
683
  const text = fitText(c, L.bands.width * every2 - 4, fs, font);
594
- return { text, x: place(text, i), w: measureText(text, fs, font) };
684
+ const detail = L.details[i] ? fitText(L.details[i], L.bands.width * every2 - 4, fs, font) : "";
685
+ const w = Math.max(width(text), width(detail));
686
+ return { text, detail, x: place(w, i), w };
595
687
  });
596
688
  const clear = (shown2) => shown2.filter((p) => p !== null).every((p, j, all) => j === 0 || p.x - p.w / 2 >= all[j - 1].x + all[j - 1].w / 2 + 4);
597
689
  let every = Math.max(1, Math.ceil((maxW + 8) / Math.max(1, L.bands.width)));
598
690
  let shown = pick(every);
599
691
  while (every < L.cats.length && !clear(shown))
600
692
  shown = pick(++every);
601
- catLabels = shown.map((p, i) => p ? svg`<text class=${cur[i] ? "current" : ""} x=${p.x} y=${L.y1 + fs + 4 + s.clear} text-anchor="middle">${p.text}</text>` : svg``);
693
+ catLabels = shown.map((p, i) => {
694
+ const mark = cur[i] ? currentMark(p?.x ?? L.bands.center(i), Math.min(p?.w ?? 0, L.bands.width), L.hasDetail ? base2 : base1, "middle") : nothing;
695
+ if (!p)
696
+ return svg`${mark}`;
697
+ return svg`<text class=${cur[i] ? "current" : ""} x=${p.x} y=${base1} text-anchor="middle">${p.text}</text>
698
+ ${p.detail ? svg`<text class="detail" x=${p.x} y=${base2} text-anchor="middle">${p.detail}</text>` : nothing}${mark}`;
699
+ });
602
700
  } else {
603
- catLabels = L.cats.map((c, i) => svg`<text class=${cur[i] ? "current" : ""} x=${L.x0 - 8} y=${L.bands.center(i)} dy="0.32em" text-anchor="end">${fitText(c, L.x0 - 8, fs, font)}</text>`);
701
+ const room = L.x0 - 8;
702
+ catLabels = L.cats.map((c, i) => {
703
+ const centre = L.bands.center(i);
704
+ const text = fitText(c, room, fs, font), detail = L.details[i] ? fitText(L.details[i], room, fs, font) : "";
705
+ const y1 = L.hasDetail ? centre - L.lineStep / 2 : centre, y2 = centre + L.lineStep / 2;
706
+ const mark = cur[i] ? currentMark(room, Math.max(width(text), width(detail)), (L.hasDetail ? y2 : y1) + fs * 0.32, "end") : nothing;
707
+ return svg`<text class=${cur[i] ? "current" : ""} x=${room} y=${y1} dy="0.32em" text-anchor="end">${text}</text>
708
+ ${detail ? svg`<text class="detail" x=${room} y=${y2} dy="0.32em" text-anchor="end">${detail}</text>` : nothing}${mark}`;
709
+ });
604
710
  }
605
711
  const series = L.series;
606
712
  const hot = this.hot;
@@ -630,6 +736,7 @@ class BkChartBar extends LitElement {
630
736
  const selection = sel && this.selectable ? h ? svg`<rect class="selection" x=${L.x0} y=${L.bands.start(sel[0])} width=${L.x1 - L.x0} height=${(sel[1] - sel[0] + 1) * L.bands.width}></rect>` : svg`<rect class="selection" x=${L.bands.start(sel[0])} y=${L.y0} width=${(sel[1] - sel[0] + 1) * L.bands.width} height=${L.y1 - L.y0}></rect>` : nothing;
631
737
  const marks = L.bars.map((b) => b.path ? svg`<path class="mark ${hot && hot.i === b.i && hot.j === b.j ? "hot" : ""} ${anyCur && !cur[b.i] ? "rest" : ""}" data-slot=${seriesSlot(series[b.j], b.j)}
632
738
  style=${styleMap({ "--_bk-chart-c": seriesColor(series[b.j], b.j, series.length) })} d=${b.path}></path>` : svg``);
739
+ const stubs = L.bars.map((b) => b.stub ? svg`<path class="stub" d=${b.stub}></path>` : svg``);
633
740
  const valueLabels = [];
634
741
  if (this.labels && !L.percent) {
635
742
  const ends = L.stacked ? L.totals.map((tot, i) => {
@@ -670,16 +777,20 @@ class BkChartBar extends LitElement {
670
777
  this.enter(first(i));
671
778
  }
672
779
  };
673
- const cats = L.cats.map((_, i) => mode === "link" ? html`<a class="cat interactive" part="category" data-i=${i} href=${this.links.href(this.categoryHref(this.viewRows[i]))}
780
+ const hrefs = L.cats.map((_, i) => mode === "link" && !L.empty[i] ? this.categoryHref(this.viewRows[i]) : null);
781
+ const live = (i) => mode === "link" ? hrefs[i] !== null : !L.empty[i];
782
+ const tab = live(a.i) ? a.i : L.cats.findIndex((_, i) => live(i));
783
+ const cats = L.cats.map((_, i) => !live(i) ? html`<div class="cat" data-i=${i} role="img" aria-label=${this.categoryLabel(i)} aria-current=${cur[i] ? mode === "link" ? "page" : "true" : nothing}
784
+ style=${styleMap(box(i))} @pointerenter=${() => on.enter(i)}></div>` : mode === "link" ? html`<a class="cat interactive" part="category" data-i=${i} href=${this.links.href(hrefs[i])}
674
785
  target=${ifDefined(this.target)} rel=${ifDefined(this.rel)} aria-current=${cur[i] ? "page" : nothing} aria-label=${this.categoryLabel(i)}
675
- style=${styleMap(box(i))} @click=${this.links.click} @pointerenter=${() => on.enter(i)} @focus=${() => on.focus(i)} @blur=${this.onBlur}></a>` : html`<button type="button" class="cat interactive" part="category" data-i=${i} tabindex=${i === a.i ? 0 : -1}
786
+ style=${styleMap(box(i))} @click=${this.links.click} @pointerenter=${() => on.enter(i)} @focus=${() => on.focus(i)} @blur=${this.onBlur}></a>` : html`<button type="button" class="cat interactive" part="category" data-i=${i} tabindex=${i === tab ? 0 : -1}
676
787
  aria-current=${cur[i] ? "true" : nothing} aria-label=${this.categoryLabel(i)}
677
788
  style=${styleMap(box(i))} @click=${() => this.choose(i)} @pointerenter=${() => on.enter(i)} @focus=${() => on.focus(i)} @blur=${this.onBlur}></button>`);
678
789
  return html`<div class="plot" part="plot" style=${styleMap(h ? { height: `${L.H}px` } : {})}>
679
790
  <svg width=${W} height=${L.H} aria-hidden="true">
680
791
  ${textureDefs()}
681
792
  <g>${grid}${catLabels}</g>
682
- <g>${markGeo.back}${ghosts}${marks}${markGeo.front}</g>
793
+ <g>${markGeo.back}${ghosts}${marks}${stubs}${markGeo.front}</g>
683
794
  <g>${valueLabels}${seriesLabels}</g>
684
795
  </svg>
685
796
  <div class="cats" role=${mode === "button" ? "toolbar" : "group"} aria-orientation=${ifDefined(mode === "button" ? h ? "vertical" : "horizontal" : void 0)}
@@ -699,7 +810,7 @@ class BkChartBar extends LitElement {
699
810
  @keydown=${this.onKey} @pointerleave=${this.onLeave} @pointerdown=${this.onDown} @pointermove=${this.onMove} @pointerup=${this.onUp}>
700
811
  ${textureDefs()}
701
812
  <g aria-hidden="true">${grid}${catLabels}</g>
702
- <g aria-hidden="true">${markGeo.back}${selection}${ghosts}${marks}${markGeo.front}</g>
813
+ <g aria-hidden="true">${markGeo.back}${selection}${ghosts}${marks}${stubs}${markGeo.front}</g>
703
814
  <g aria-hidden="true">${valueLabels}${seriesLabels}</g>
704
815
  <g>${hits}</g>
705
816
  ${ring}
@@ -1,4 +1,5 @@
1
1
  import { LitElement, type PropertyValues, type TemplateResult } from "lit";
2
+ import { type ChartField } from "../charts/fields.js";
2
3
  import { type ChartRow, type ChartSeries } from "../charts/frame.js";
3
4
  import "./bk-chart-legend.js";
4
5
  import "../icons/set/compare.js";
@@ -197,6 +198,12 @@ export declare class BkChartLine extends LitElement {
197
198
  attribute: string;
198
199
  type: ObjectConstructor;
199
200
  };
201
+ tooltipFields: {
202
+ attribute: string;
203
+ converter: {
204
+ fromAttribute(value: string | null): ChartField[];
205
+ };
206
+ };
200
207
  yDirection: {
201
208
  attribute: string;
202
209
  reflect: boolean;
@@ -257,6 +264,12 @@ export declare class BkChartLine extends LitElement {
257
264
  bare: boolean;
258
265
  /** Intl.NumberFormat options for values. */
259
266
  valueFormat: Intl.NumberFormatOptions | undefined;
267
+ /**
268
+ * Fields of the row that the tooltip, the data table and the name of each point list without drawing them.
269
+ * The attribute lists the keys (`tooltip-fields="prints likes"`). The property takes keys or
270
+ * `{ key, label, format }` objects, where `label` names the field and `format` are `Intl.NumberFormat` options.
271
+ */
272
+ tooltipFields: (string | ChartField)[] | undefined;
260
273
  /** `up` (default): larger values are higher. `down`: the value axis runs down. The smallest value is at the top and is the best (a rank). Lines only. */
261
274
  yDirection: "up" | "down";
262
275
  /** The start of the value axis, for example `1` for ranks. Default: a round value below the data (zero with `zero`). With `y-direction="down"` and whole numbers, the default is the smallest value. */
@@ -6,6 +6,7 @@ import { base } from "../internal/styles.js";
6
6
  import { emitDetail } from "../internal/events.js";
7
7
  import { adoptChartTokens } from "../charts/chart-tokens.js";
8
8
  import { chartT } from "../charts/i18n.js";
9
+ import { resolveFields, fieldLabel, fieldValue, tooltipFieldsConverter } from "../charts/fields.js";
9
10
  import { axisFormatter, formatPercent, formatTime, formatValue, timeTickFormatter } from "../charts/format.js";
10
11
  import { linearScale, nearestIndex, niceTicks, ticksFrom, timeTicks } from "../charts/scale.js";
11
12
  import { Brush } from "../charts/brush.js";
@@ -50,6 +51,7 @@ class BkChartLine extends LitElement {
50
51
  table: { type: Boolean, reflect: true },
51
52
  bare: { type: Boolean, reflect: true },
52
53
  valueFormat: { attribute: "value-format", type: Object },
54
+ tooltipFields: { attribute: "tooltip-fields", converter: tooltipFieldsConverter },
53
55
  yDirection: { attribute: "y-direction", reflect: true, useDefault: true },
54
56
  min: { type: Number },
55
57
  toggleable: { type: Boolean, reflect: true },
@@ -435,7 +437,8 @@ class BkChartLine extends LitElement {
435
437
  const row = this.data[this.view[idx]];
436
438
  const shown = new Set(this.visibleKeys);
437
439
  const parts = this.effectiveSeries.filter((se) => shown.has(se.key)).map((se) => `${se.label} ${this.fmt(num(row[se.key]))}`);
438
- return `${this.xText(row)}: ${parts.join(", ")}`;
440
+ const extra = resolveFields(this.tooltipFields).map((f) => `${fieldLabel(f)} ${fieldValue(this.i18n.locale, row, f)}`);
441
+ return `${this.xText(row)}: ${parts.concat(extra).join(", ")}`;
439
442
  }
440
443
  tooltipAt(idx, L) {
441
444
  const locale = this.i18n.locale;
@@ -460,6 +463,8 @@ class BkChartLine extends LitElement {
460
463
  });
461
464
  if (L.stack !== "none" && series.length > 1)
462
465
  rows.push({ label: chartT(locale, "chartTotal"), value: this.fmt(L.totals[idx]) });
466
+ for (const f of resolveFields(this.tooltipFields))
467
+ rows.push({ label: fieldLabel(f), value: fieldValue(locale, row, f) });
463
468
  return { title: this.xText(row), rows, x: L.xScale(L.xs[idx]), y: L.y0, placement: "beside" };
464
469
  }
465
470
  /** The point index nearest to a pointer event. */
@@ -688,6 +693,9 @@ class BkChartLine extends LitElement {
688
693
  }
689
694
  if (stacked)
690
695
  columns.push(chartT(locale, "chartTotal"));
696
+ const extra = resolveFields(this.tooltipFields);
697
+ for (const f of extra)
698
+ columns.push(fieldLabel(f));
691
699
  const rows = this.order.map((i, p) => {
692
700
  const cells = [this.xText(this.data[i])];
693
701
  series.forEach((se, j) => {
@@ -700,6 +708,8 @@ class BkChartLine extends LitElement {
700
708
  });
701
709
  if (stacked)
702
710
  cells.push(this.fmt(series.reduce((a, se) => a + Math.max(0, num(this.data[i][se.key]) ?? 0), 0)));
711
+ for (const f of extra)
712
+ cells.push(fieldValue(locale, this.data[i], f));
703
713
  return cells;
704
714
  });
705
715
  return { caption: this.heading || chartT(locale, "chartData"), columns, rows };
@@ -15,7 +15,7 @@ import "./bk-button.js";
15
15
  * - **Keyboard**: Tab enters the group at the chosen chip (otherwise the chip used last, otherwise the first) and leaves
16
16
  * the group. ←/→ (and ↑/↓) move between the chips. Home/End move to the first and last chip.
17
17
  * Backspace or Delete on a `removable` chip fires the `remove` event of that chip. The app removes the chip then,
18
- * and the focus moves to the next chip. Without `selection` and without a removable chip the
18
+ * and the focus moves to the next chip. On a `removed` chip the same keys fire `restore`. Without `selection` and without a removable chip the
19
19
  * chips are not focusable. They are a list (`role="list"`).
20
20
  * - **Filter chips**: `selection="multiple"` makes every chip a toggle button (`aria-pressed`, the
21
21
  * group a `role="toolbar"`). `selection="single"` makes the group a listbox and every chip an
@@ -52,7 +52,7 @@ import "./bk-button.js";
52
52
  * @keyboard ←, →, ↑, ↓ - Move to the previous or next chip. ← and → follow the writing direction.
53
53
  * @keyboard Home, End - Move to the first or last chip.
54
54
  * @keyboard Space, Enter - With `selection`: choose the focused chip.
55
- * @keyboard Backspace, Delete - Remove a removable chip. The focus moves to the next chip.
55
+ * @keyboard Backspace, Delete - Remove a removable chip. The focus moves to the next chip. On a `removed` chip they restore it (`restore`), and the focus stays.
56
56
  * @a11y With a removable chip or `selection` the group is one stop in the tab order. `selection="single"` makes it a `listbox` and each chip an `option` with `aria-selected`; `selection="multiple"` makes it a `toolbar` of toggle buttons (`aria-pressed`). Without both, the group is a `list` and the chips are not focusable.
57
57
  */
58
58
  export declare class BkChipGroup extends FormControl {
@@ -284,6 +284,10 @@ class BkChipGroup extends FormControl {
284
284
  if (!chip.removable)
285
285
  return;
286
286
  e.preventDefault();
287
+ if (chip.removed) {
288
+ emit(chip, "restore");
289
+ return;
290
+ }
287
291
  this.removedAt = at;
288
292
  emit(chip, "remove");
289
293
  queueMicrotask(() => {