@bk2k/ui 0.6.7 → 0.6.8

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 (226) hide show
  1. package/BUILDING.md +32 -0
  2. package/CHANGELOG.md +57 -0
  3. package/USAGE.md +14 -8
  4. package/custom-elements.json +1 -1
  5. package/dist/charts/frame.d.ts +2 -0
  6. package/dist/charts/frame.js +2 -1
  7. package/dist/components/bk-button.d.ts +18 -3
  8. package/dist/components/bk-button.js +19 -8
  9. package/dist/components/bk-chart-bar.d.ts +46 -9
  10. package/dist/components/bk-chart-bar.js +127 -37
  11. package/dist/components/bk-combobox.d.ts +29 -5
  12. package/dist/components/bk-combobox.js +61 -19
  13. package/dist/components/bk-dialog.d.ts +4 -1
  14. package/dist/components/bk-dialog.js +6 -2
  15. package/dist/components/bk-facts-item.js +8 -6
  16. package/dist/components/bk-facts.d.ts +6 -4
  17. package/dist/components/bk-facts.js +19 -8
  18. package/dist/components/bk-input-time-zone.d.ts +3 -0
  19. package/dist/components/bk-model-viewer.d.ts +12 -1
  20. package/dist/components/bk-model-viewer.js +15 -2
  21. package/dist/components/bk-period-nav.d.ts +102 -0
  22. package/dist/components/bk-period-nav.js +69 -0
  23. package/dist/components/bk-select.js +2 -1
  24. package/dist/components/bk-shell-app.d.ts +3 -2
  25. package/dist/components/bk-shell-app.js +16 -3
  26. package/dist/components/bk-sortable.d.ts +3 -0
  27. package/dist/components/bk-sortable.js +3 -0
  28. package/dist/components/bk-split.d.ts +3 -0
  29. package/dist/components/bk-split.js +3 -0
  30. package/dist/components/bk-table.d.ts +16 -12
  31. package/dist/components/bk-table.js +96 -14
  32. package/dist/i18n/de.js +7 -0
  33. package/dist/i18n.d.ts +7 -0
  34. package/dist/i18n.js +7 -0
  35. package/dist/index.d.ts +1 -0
  36. package/dist/index.js +1 -0
  37. package/dist/internal/cloak.d.ts +3 -0
  38. package/dist/internal/cloak.js +4 -0
  39. package/dist/internal/handle-menu.d.ts +2 -3
  40. package/dist/internal/handle-menu.js +14 -3
  41. package/dist/internal/late.d.ts +15 -0
  42. package/dist/internal/late.js +30 -0
  43. package/dist/jsx.d.ts +36 -5
  44. package/dist/standalone/all.js +119 -118
  45. package/dist/standalone/bk-action-bar.js +1 -1
  46. package/dist/standalone/bk-alert-offline.js +1 -1
  47. package/dist/standalone/bk-alert.js +1 -1
  48. package/dist/standalone/bk-attachment.js +1 -1
  49. package/dist/standalone/bk-avatar-group.js +1 -1
  50. package/dist/standalone/bk-avatar.js +1 -1
  51. package/dist/standalone/bk-breadcrumbs.js +1 -1
  52. package/dist/standalone/bk-button-copy.js +2 -2
  53. package/dist/standalone/bk-button-group.js +2 -2
  54. package/dist/standalone/bk-button-share.js +2 -2
  55. package/dist/standalone/bk-button-top.js +1 -1
  56. package/dist/standalone/bk-button.js +15 -7
  57. package/dist/standalone/bk-calendar-week.js +1 -1
  58. package/dist/standalone/bk-calendar.js +1 -1
  59. package/dist/standalone/bk-card.js +1 -1
  60. package/dist/standalone/bk-carousel-controls.js +2 -2
  61. package/dist/standalone/bk-carousel.js +1 -1
  62. package/dist/standalone/bk-chart-bar-list.js +3 -3
  63. package/dist/standalone/bk-chart-bar.js +164 -105
  64. package/dist/standalone/bk-chart-bridge.js +4 -4
  65. package/dist/standalone/bk-chart-bullet.js +3 -3
  66. package/dist/standalone/bk-chart-calendar.js +4 -4
  67. package/dist/standalone/bk-chart-heatmap.js +4 -4
  68. package/dist/standalone/bk-chart-histogram.js +2 -2
  69. package/dist/standalone/bk-chart-legend.js +3 -3
  70. package/dist/standalone/bk-chart-line.js +5 -5
  71. package/dist/standalone/bk-chart-scatter.js +3 -3
  72. package/dist/standalone/bk-chart-sparkline.js +3 -3
  73. package/dist/standalone/bk-chart-stacked-bar.js +4 -4
  74. package/dist/standalone/bk-chart-tracker.js +3 -3
  75. package/dist/standalone/bk-chart-waterfall.js +2 -2
  76. package/dist/standalone/bk-checkbox-group.js +2 -2
  77. package/dist/standalone/bk-checkbox.js +1 -1
  78. package/dist/standalone/bk-chip-group.js +2 -2
  79. package/dist/standalone/bk-chip.js +2 -2
  80. package/dist/standalone/bk-code-diff.js +1 -1
  81. package/dist/standalone/bk-code-stack.js +2 -2
  82. package/dist/standalone/bk-code.js +2 -2
  83. package/dist/standalone/bk-color-panel.js +2 -2
  84. package/dist/standalone/bk-columns.js +1 -1
  85. package/dist/standalone/bk-combobox.js +49 -30
  86. package/dist/standalone/bk-command-menu.js +2 -2
  87. package/dist/standalone/bk-command-palette.js +3 -3
  88. package/dist/standalone/bk-composer.js +2 -2
  89. package/dist/standalone/bk-delta.js +1 -1
  90. package/dist/standalone/bk-diagram.js +1 -1
  91. package/dist/standalone/bk-dialog.js +1 -1
  92. package/dist/standalone/bk-drawer.js +2 -2
  93. package/dist/standalone/bk-error-summary.js +1 -1
  94. package/dist/standalone/bk-facts-item.js +8 -6
  95. package/dist/standalone/bk-facts.js +19 -8
  96. package/dist/standalone/bk-fieldset.js +1 -1
  97. package/dist/standalone/bk-filter-bar.js +1 -1
  98. package/dist/standalone/bk-folder-browser.js +1 -1
  99. package/dist/standalone/bk-form-guard.js +1 -1
  100. package/dist/standalone/bk-form-steps.js +1 -1
  101. package/dist/standalone/bk-image-compare.js +1 -1
  102. package/dist/standalone/bk-image-crop.js +2 -2
  103. package/dist/standalone/bk-image-editor.js +2 -1
  104. package/dist/standalone/bk-image-viewer.js +1 -1
  105. package/dist/standalone/bk-input-code.js +2 -2
  106. package/dist/standalone/bk-input-color.js +1 -1
  107. package/dist/standalone/bk-input-date-range.js +2 -2
  108. package/dist/standalone/bk-input-date.js +1 -1
  109. package/dist/standalone/bk-input-file.js +2 -2
  110. package/dist/standalone/bk-input-group.js +2 -2
  111. package/dist/standalone/bk-input-inline.js +2 -2
  112. package/dist/standalone/bk-input-number.js +2 -2
  113. package/dist/standalone/bk-input-rating.js +2 -2
  114. package/dist/standalone/bk-input-rich.js +1 -1
  115. package/dist/standalone/bk-input-search.js +1 -1
  116. package/dist/standalone/bk-input-slider-range.js +2 -2
  117. package/dist/standalone/bk-input-slider.js +2 -2
  118. package/dist/standalone/bk-input-text.js +1 -1
  119. package/dist/standalone/bk-input-time.js +3 -3
  120. package/dist/standalone/bk-item.js +1 -1
  121. package/dist/standalone/bk-kbd-shortcuts.js +1 -1
  122. package/dist/standalone/bk-kbd.js +1 -1
  123. package/dist/standalone/bk-lightbox.js +2 -2
  124. package/dist/standalone/bk-listbox-columns.js +2 -2
  125. package/dist/standalone/bk-listbox-search.js +3 -3
  126. package/dist/standalone/bk-listbox-transfer.js +3 -3
  127. package/dist/standalone/bk-listbox.js +2 -2
  128. package/dist/standalone/bk-logo.js +1 -1
  129. package/dist/standalone/bk-menu-bar.js +1 -1
  130. package/dist/standalone/bk-menu-item.js +1 -1
  131. package/dist/standalone/bk-menu-list.js +1 -1
  132. package/dist/standalone/bk-menu.js +2 -2
  133. package/dist/standalone/bk-message-approval.js +1 -1
  134. package/dist/standalone/bk-message-branches.js +1 -1
  135. package/dist/standalone/bk-message-citation.js +1 -1
  136. package/dist/standalone/bk-message-feedback.js +1 -1
  137. package/dist/standalone/bk-message-list.js +1 -1
  138. package/dist/standalone/bk-message-reasoning.js +1 -1
  139. package/dist/standalone/bk-message-source.js +1 -1
  140. package/dist/standalone/bk-message-tool-group.js +1 -1
  141. package/dist/standalone/bk-message-tool.js +1 -1
  142. package/dist/standalone/bk-message.js +1 -1
  143. package/dist/standalone/bk-meter.js +1 -1
  144. package/dist/standalone/bk-model-viewer.js +1 -1
  145. package/dist/standalone/bk-nav-group.js +1 -1
  146. package/dist/standalone/bk-nav-item.js +1 -1
  147. package/dist/standalone/bk-nav-toc.js +1 -1
  148. package/dist/standalone/bk-nav.js +1 -1
  149. package/dist/standalone/bk-overflow.js +1 -1
  150. package/dist/standalone/bk-page-footer.js +1 -1
  151. package/dist/standalone/bk-page-pager.js +1 -1
  152. package/dist/standalone/bk-pagination.js +1 -1
  153. package/dist/standalone/bk-pane.js +1 -1
  154. package/dist/standalone/bk-panel.js +1 -1
  155. package/dist/standalone/bk-period-nav.js +69 -0
  156. package/dist/standalone/bk-picture.js +1 -1
  157. package/dist/standalone/bk-popover-help.js +1 -1
  158. package/dist/standalone/bk-popover.js +1 -1
  159. package/dist/standalone/bk-preview.js +1 -1
  160. package/dist/standalone/bk-progress.js +1 -1
  161. package/dist/standalone/bk-qr-code.js +1 -1
  162. package/dist/standalone/bk-radio-group.js +2 -2
  163. package/dist/standalone/bk-radio.js +1 -1
  164. package/dist/standalone/bk-rating.js +1 -1
  165. package/dist/standalone/bk-scroll.js +1 -1
  166. package/dist/standalone/bk-segmented.js +2 -2
  167. package/dist/standalone/bk-select-cascade.js +1 -1
  168. package/dist/standalone/bk-select-tree.js +1 -1
  169. package/dist/standalone/bk-select.js +3 -2
  170. package/dist/standalone/bk-shell-app.js +42 -38
  171. package/dist/standalone/bk-shell-sites.js +1 -1
  172. package/dist/standalone/bk-sortable.js +7 -4
  173. package/dist/standalone/bk-split-grid.js +1 -1
  174. package/dist/standalone/bk-split.js +7 -4
  175. package/dist/standalone/bk-stat.js +2 -2
  176. package/dist/standalone/bk-steps-item.js +1 -1
  177. package/dist/standalone/bk-swatch-group.js +2 -2
  178. package/dist/standalone/bk-switch.js +2 -2
  179. package/dist/standalone/bk-table.js +130 -80
  180. package/dist/standalone/bk-tabs-item.js +1 -1
  181. package/dist/standalone/bk-tabs.js +1 -1
  182. package/dist/standalone/bk-tasks-item.js +1 -1
  183. package/dist/standalone/bk-text.js +1 -1
  184. package/dist/standalone/bk-time-countdown.js +1 -1
  185. package/dist/standalone/bk-time-relative.js +1 -1
  186. package/dist/standalone/bk-timeline-item.js +1 -1
  187. package/dist/standalone/bk-toast-group.js +1 -1
  188. package/dist/standalone/bk-toast.js +1 -1
  189. package/dist/standalone/bk-tooltip.js +1 -1
  190. package/dist/standalone/bk-tree-item.js +2 -2
  191. package/dist/standalone/bk-video.js +1 -1
  192. package/dist/standalone/bk-zoom.js +3 -3
  193. package/dist/standalone/chunks/{bk-alert-offline-BoMEYxnE.js → bk-alert-offline-B1bQxOZp.js} +1 -1
  194. package/dist/standalone/chunks/{bk-carousel-B7-9OanA.js → bk-carousel-BCwIQhG5.js} +1 -1
  195. package/dist/standalone/chunks/{bk-diagram-CpOpicmo.js → bk-diagram-DWK8CvRZ.js} +2 -2
  196. package/dist/standalone/chunks/{bk-dialog-a2BtUBf2.js → bk-dialog-DX0cPJ1o.js} +7 -3
  197. package/dist/standalone/chunks/{bk-image-editor-z_Uj83fy.js → bk-image-editor-DXEj9gCu.js} +1 -1
  198. package/dist/standalone/chunks/{bk-input-date-range-BQkbPlSJ.js → bk-input-date-range-Cbx_lpf0.js} +1 -1
  199. package/dist/standalone/chunks/{bk-input-rich-Dte_b4Ev.js → bk-input-rich-ZB68vziu.js} +3 -3
  200. package/dist/standalone/chunks/{bk-input-text-CUNQG1ah.js → bk-input-text-DD32uWNO.js} +1 -1
  201. package/dist/standalone/chunks/{bk-kbd-B7bz8hmV.js → bk-kbd-B_TlKzWj.js} +1 -1
  202. package/dist/standalone/chunks/{bk-model-viewer-D1XJPgAG.js → bk-model-viewer-Dr81ahVv.js} +19 -5
  203. package/dist/standalone/chunks/{bk-qr-code-CbI9rdOK.js → bk-qr-code-QaYvZwOR.js} +1 -1
  204. package/dist/standalone/chunks/{bk-toast-group-Cix-Urgi.js → bk-toast-group-BSeO_rPs.js} +1 -1
  205. package/dist/standalone/chunks/{choice-field-BnuK9mp_.js → choice-field-CGvE4tyb.js} +1 -1
  206. package/dist/standalone/chunks/{clipboard-DBGdJ-1S.js → clipboard-BKlrP5rj.js} +1 -28
  207. package/dist/standalone/chunks/clipboard-Crzt1Sh9.js +29 -0
  208. package/dist/standalone/chunks/{date-field-BQ5k-DDL.js → date-field-BlI6grfT.js} +2 -2
  209. package/dist/standalone/chunks/{form-control-D7dqSP9M.js → form-control-CyXQIJ2x.js} +1 -1
  210. package/dist/standalone/chunks/{frame-BW1nKuoM.js → frame-abXBnl8a.js} +3 -1
  211. package/dist/standalone/chunks/handle-menu-ZVR_msk2.js +49 -0
  212. package/dist/standalone/chunks/{i18n-CNsBRNPu.js → i18n-B6Al9xCK.js} +7 -0
  213. package/dist/standalone/chunks/{i18n-CrZgrRu9.js → i18n-BI16HQmm.js} +1 -1
  214. package/dist/standalone/chunks/{marks-CdqbbJpM.js → marks-0kbeB4n8.js} +2 -2
  215. package/dist/standalone/chunks/{popover-base-oDhxsYMr.js → popover-base-ac49G87f.js} +1 -1
  216. package/dist/standalone/chunks/{ramp-EclrETaQ.js → ramp-ggoyjMvC.js} +1 -1
  217. package/dist/standalone/chunks/{summary-BwL-Gp8w.js → summary-BK-B4m5A.js} +1 -1
  218. package/dist/standalone/chunks/{text-field-CTp2b-Ai.js → text-field-4IUUpRHE.js} +2 -2
  219. package/dist/standalone/chunks/{toggle-control-DXkgmz7R.js → toggle-control-ioV2jhNY.js} +1 -1
  220. package/dist/standalone/confirm.js +3 -3
  221. package/dist/standalone/i18n-de.js +8 -1
  222. package/dist/standalone/toast.js +1 -1
  223. package/dist/standalone/tokens.css +4 -1
  224. package/dist/tokens.css +4 -1
  225. package/package.json +1 -1
  226. package/dist/standalone/chunks/handle-menu-DsxWvv4D.js +0 -22
@@ -2,18 +2,18 @@ import { a as e, n as t, s as n, t as r, u as i } from "./chunks/lit-D8x-qXgH.js
2
2
  import { t as a } from "./chunks/style-map-BMvn17E7.js";
3
3
  import { t as o } from "./chunks/if-defined-z_20pBRr.js";
4
4
  import { t as s } from "./chunks/define-CzVPD4Zi.js";
5
- import { t as c } from "./chunks/i18n-CNsBRNPu.js";
5
+ import { t as c } from "./chunks/i18n-B6Al9xCK.js";
6
6
  import { t as l } from "./chunks/styles-DwSR-9a3.js";
7
7
  import { n as u } from "./chunks/events-DQ4e9cPN.js";
8
8
  import { t as d } from "./chunks/link-CWSMsx04.js";
9
9
  import { r as f } from "./chunks/chart-tokens-D1Exf7BW.js";
10
- import { t as p } from "./chunks/i18n-CrZgrRu9.js";
10
+ import { t as p } from "./chunks/i18n-BI16HQmm.js";
11
11
  import { a as m, i as h, n as g, t as _ } from "./chunks/format-DEwvmPPd.js";
12
12
  import { a as v, n as y, t as b } from "./chunks/scale-BcW5wHaU.js";
13
13
  import { t as x } from "./chunks/brush-Bn3lPdHN.js";
14
- import { a as S, i as C, n as w, o as T, r as E } from "./chunks/marks-CdqbbJpM.js";
15
- import { n as D, t as O } from "./chunks/summary-BwL-Gp8w.js";
16
- import { a as k, c as A, d as j, f as M, i as N, l as P, n as F, o as I, p as L, r as R, s as z, t as B } from "./chunks/frame-BW1nKuoM.js";
14
+ import { a as S, i as C, n as w, o as T, r as E } from "./chunks/marks-0kbeB4n8.js";
15
+ import { n as D, t as O } from "./chunks/summary-BK-B4m5A.js";
16
+ import { a as k, c as A, d as j, f as M, i as N, l as P, n as F, o as I, p as L, r as R, s as z, t as B } from "./chunks/frame-abXBnl8a.js";
17
17
  import "./bk-chart-legend.js";
18
18
  import "./chunks/grid-BV0_DQ5v.js";
19
19
  // dist/components/bk-chart-bar.js
@@ -24,6 +24,8 @@ var V = class extends r {
24
24
  series: { attribute: !1 },
25
25
  x: {},
26
26
  xLabel: { attribute: "x-label" },
27
+ detail: {},
28
+ detailLabel: { attribute: "detail-label" },
27
29
  orientation: {
28
30
  reflect: !0,
29
31
  useDefault: !0
@@ -132,7 +134,35 @@ var V = class extends r {
132
134
  return this.rawKey(n) === t || n instanceof Date && this.rawKey(n).startsWith(t) || this.category(e) === t;
133
135
  }
134
136
  categoryHref(e) {
135
- return (this.href ?? "").replace(/\{([\w-]+)\}/g, (t, n) => n in e ? encodeURIComponent(this.rawKey(e[n])) : n === "x" ? encodeURIComponent(this.rawKey(e[this.x])) : t);
137
+ let t = this.href ?? "", n = (t) => t in e || t === "x", r = (t) => t in e ? e[t] : e[this.x], i = (e) => e == null || e === "", a = /^\{([\w-]+)\}$/.exec(t);
138
+ if (a && n(a[1])) {
139
+ let e = r(a[1]);
140
+ return i(e) ? null : this.rawKey(e);
141
+ }
142
+ let o = !1, s = t.replace(/\{([\w-]+)\}/g, (e, t) => {
143
+ if (!n(t)) return e;
144
+ let a = r(t);
145
+ return i(a) && (o = !0), encodeURIComponent(this.rawKey(a));
146
+ });
147
+ return o ? null : s;
148
+ }
149
+ isEmpty(e) {
150
+ return this.effectiveSeries.every((t) => z(e?.[t.key]) === null);
151
+ }
152
+ detailText(e) {
153
+ if (!this.detail) return "";
154
+ let t = e?.[this.detail];
155
+ return t instanceof Date ? h(this.i18n.locale, t.getTime()) : t == null ? "" : String(t);
156
+ }
157
+ categoryName(e) {
158
+ let t = this.category(e), n = this.detailText(e);
159
+ return n ? p(this.i18n.locale, "chartCategoryDetail", {
160
+ category: t,
161
+ detail: n
162
+ }) : t;
163
+ }
164
+ get marksCurrent() {
165
+ return this.pickMode !== null || this.current !== void 0 && this.current !== null && this.current !== "";
136
166
  }
137
167
  choose(e) {
138
168
  let t = this.viewStart + e, n = this.data[t]?.[this.x], r = {
@@ -167,9 +197,14 @@ var V = class extends r {
167
197
  }
168
198
  .mark.rest { fill: var(--bk-chart-bar-rest, var(--bk-chart-other)); }
169
199
  text.current { fill: var(--bk-chart-bar-current-label, var(--bk-text)); font-weight: var(--bk-weight-medium); }
200
+ text.detail { fill: var(--bk-chart-bar-detail, var(--bk-chart-label)); }
201
+ .current-mark { fill: var(--bk-chart-bar-current-mark, var(--bk-accent-solid)); }
202
+ .stub { fill: none; stroke: var(--bk-chart-bar-stub, var(--bk-chart-axis)); stroke-width: 1; }
170
203
  @media (forced-colors: active) {
171
204
  .ghost { fill: none; stroke: CanvasText; } .selection { fill: Highlight; stroke: Highlight; }
172
205
  .mark.rest { fill: GrayText; }
206
+ .current-mark { fill: Highlight; }
207
+ .stub { stroke: GrayText; }
173
208
  .cat:hover { outline: var(--bk-border-width) solid Highlight; outline-offset: var(--bk-focus-offset-inset); }
174
209
  }
175
210
  `,
@@ -205,7 +240,7 @@ var V = class extends r {
205
240
  }
206
241
  let T = f ? null : w(d);
207
242
  T && (x = Math.min(x, T[0]), C = Math.max(C, T[1]));
208
- let E = t.labelSize, D = t.font, O = r.map((e) => this.category(e)), k = Math.max(0, ...O.map((e) => I(e, E, D))), A = (e) => {
243
+ let E = t.labelSize, D = t.font, O = r.map((e) => this.category(e)), k = r.map((e) => this.detailText(e)), A = k.some(Boolean), j = Math.max(0, ...O.map((e) => I(e, E, D)), ...k.map((e) => I(e, E, D))), M = r.map((e) => this.isEmpty(e)), N = E + t.clear, P = this.marksCurrent ? t.clear + t.indicator : 0, L = (e) => {
209
244
  if (this.contiguous) return {
210
245
  t: Math.max(1, e - t.gap),
211
246
  groupW: Math.max(1, e - t.gap)
@@ -215,124 +250,134 @@ var V = class extends r {
215
250
  t: i,
216
251
  groupW: n * (i * (1 + u) + r) + (n - 1) * t.gap
217
252
  };
218
- }, j, M, N, P, L, R = this.labels ? E + 4 + t.clear + t.gap : 0, B, V;
253
+ }, R, B, V, H, U, W = this.labels ? E + 4 + t.clear + t.gap : 0, G, K;
219
254
  if (o) {
220
- let n = s ? 1 : Math.max(1, a), r = this.contiguous ? t.barMax : n * (t.barMax * (1 + u) + (u ? t.gap : 0)) + (n - 1) * t.gap, o = Math.max(r / .7, t.hitMin + 8);
221
- M = Math.ceil(Math.min(k, e * .35) + 8), P = 2, L = P + i * o, j = this.variant === "minimal" ? L + 2 : L + E + 10 + t.clear, B = f ? v(0, 1, 4) : v(x, C, Math.max(2, Math.round((e - M) / 90))), V = _(g, B.ticks, f ? { style: "percent" } : this.valueFormat);
222
- let c = I(V(B.ticks[B.ticks.length - 1]), E, D), l = this.variant === "minimal" ? 2 : c / 2 + 2;
255
+ let n = s ? 1 : Math.max(1, a), r = this.contiguous ? t.barMax : n * (t.barMax * (1 + u) + (u ? t.gap : 0)) + (n - 1) * t.gap, o = (A ? N / 2 + E / 2 : E / 2) + P, c = Math.max(r / .7, t.hitMin + 8, Math.ceil(2 * o + 2 * t.clear));
256
+ B = Math.ceil(Math.min(j, e * .35) + 8), H = 2, U = H + i * c, R = this.variant === "minimal" ? U + 2 : U + E + 10 + t.clear, G = f ? v(0, 1, 4) : v(x, C, Math.max(2, Math.round((e - B) / 90))), K = _(g, G.ticks, f ? { style: "percent" } : this.valueFormat);
257
+ let l = I(K(G.ticks[G.ticks.length - 1]), E, D), d = this.variant === "minimal" ? 2 : l / 2 + 2;
223
258
  if (this.labels && !f) {
224
259
  let e = Math.max(0, ...p.flatMap((e, t) => s ? [m[t]] : e).map((e) => I(this.fmt(e), E, D)));
225
- l = Math.max(l, e + 8);
260
+ d = Math.max(d, e + 8);
226
261
  }
227
- N = e - l;
262
+ V = e - d;
228
263
  } else {
229
- j = this.chart.height, P = Math.max(R, E / 2 + 2), L = j - (E + 10 + t.clear), B = v(x, C, Math.max(2, Math.round((L - P) / 48))), f && (B = v(0, 1, 4)), V = _(g, B.ticks, f ? { style: "percent" } : this.valueFormat);
230
- let n = Math.max(...B.ticks.map((e) => I(V(e), E, D)));
231
- M = this.variant === "minimal" ? 0 : Math.ceil(n + 8), N = e - 4;
264
+ R = this.chart.height, H = Math.max(W, E / 2 + 2), U = R - (E + 10 + t.clear + (A ? N : 0) + P), G = v(x, C, Math.max(2, Math.round((U - H) / 48))), f && (G = v(0, 1, 4)), K = _(g, G.ticks, f ? { style: "percent" } : this.valueFormat);
265
+ let n = Math.max(...G.ticks.map((e) => I(K(e), E, D)));
266
+ B = this.variant === "minimal" ? 0 : Math.ceil(n + 8), V = e - 4;
232
267
  }
233
- let H = [];
268
+ let q = [];
234
269
  if (!o && s && a >= 2 && a <= 4 && i > 0 && this.seriesLabels !== "none") {
235
270
  let t = Math.max(...n.map((e) => I(e.label, E, D)));
236
- e - M - (t + 12) >= 200 && (N = e - (t + 12), H = n.map((e, t) => ({
271
+ e - B - (t + 12) >= 200 && (V = e - (t + 12), q = n.map((e, t) => ({
237
272
  j: t,
238
273
  y: 0,
239
274
  text: e.label
240
275
  })));
241
276
  }
242
- let U = o ? y([B.min, B.max], [M, N]) : y([B.min, B.max], [L, P]), W = o ? b(i, [P, L]) : b(i, [M, N]), { t: G, groupW: K } = A(W.width), q = U(0), J = [], Y = [];
277
+ let J = o ? y([G.min, G.max], [B, V]) : y([G.min, G.max], [U, H]), Y = o ? b(i, [H, U]) : b(i, [B, V]), { t: X, groupW: ee } = L(Y.width), Z = J(0), Q = [], $ = [];
243
278
  for (let e = 0; e < i; e++) {
244
- let n = W.center(e) - K / 2, r = 0, i = 0, c = s ? p[e].reduce((e, t, n) => t && t > 0 ? n : e, -1) : -1, d = s ? p[e].reduce((e, t, n) => t && t < 0 ? n : e, -1) : -1;
279
+ let n = Y.center(e) - ee / 2, r = 0, i = 0, c = s ? p[e].reduce((e, t, n) => t && t > 0 ? n : e, -1) : -1, d = s ? p[e].reduce((e, t, n) => t && t < 0 ? n : e, -1) : -1;
245
280
  for (let h = 0; h < a; h++) {
246
281
  let g = p[e][h], _ = m[e] || 1, v = g === null ? null : f ? Math.max(0, g) / _ : g, y = g !== null && m[e] ? Math.max(0, g) / m[e] : 0, b = 0, x = v ?? 0, S = !0, C = !0;
247
282
  s && v !== null && (v >= 0 ? (b = r, x = r + v, C = r === 0, r = x, S = h === c) : (b = i, x = i + v, C = i === 0, i = x, S = h === d));
248
- let w = G * (1 + u) + (u ? t.gap : 0), T = s ? n : n + h * (w + t.gap) + (u ? G * u + t.gap : 0), E = U(b), D = U(x);
283
+ let w = X * (1 + u) + (u ? t.gap : 0), T = s ? n : n + h * (w + t.gap) + (u ? X * u + t.gap : 0), E = J(b), D = J(x);
249
284
  if (s && !C && v !== null && v !== 0) {
250
285
  let e = Math.sign(D - E);
251
286
  E += e * t.gap, Math.sign(D - E) !== e && (E = D);
252
287
  }
253
288
  let O = (v ?? 0) < 0, k;
254
289
  if (o) {
255
- let n = Math.min(E, D), r = Math.abs(D - E), i = S ? O ? "left" : "right" : "none", o = s ? Math.max(G, Math.min(t.hitMin, W.width)) : Math.max(G + t.gap, Math.min(t.hitMin, W.width / Math.max(1, a))), c = T + G / 2 - o / 2, [l, u] = s ? [n - t.gap / 2, Math.max(r + t.gap, 4)] : [M, N - M];
290
+ let n = Math.min(E, D), r = Math.abs(D - E), i = S ? O ? "left" : "right" : "none", o = s ? Math.max(X, Math.min(t.hitMin, Y.width)) : Math.max(X + t.gap, Math.min(t.hitMin, Y.width / Math.max(1, a))), c = T + X / 2 - o / 2, [l, u] = s ? [n - t.gap / 2, Math.max(r + t.gap, 4)] : [B, V - B];
256
291
  k = {
257
292
  i: e,
258
293
  j: h,
259
294
  value: g,
260
295
  share: y,
261
- path: v === null ? "" : F(n, T, r, G, t.radius, i),
296
+ path: v === null ? "" : F(n, T, r, X, t.radius, i),
262
297
  x: n,
263
298
  y: T,
264
299
  w: r,
265
- h: G,
300
+ h: X,
266
301
  hx: l,
267
302
  hy: c,
268
303
  hw: u,
269
304
  hh: o,
270
305
  ax: O ? n : n + r,
271
- ay: T + G / 2
306
+ ay: T + X / 2,
307
+ stub: ""
272
308
  };
273
309
  } else {
274
- let n = Math.min(E, D), r = Math.abs(D - E), i = S ? O ? "bottom" : "top" : "none", o = s ? Math.max(G, Math.min(t.hitMin, W.width)) : Math.max(G + t.gap, Math.min(t.hitMin, W.width / Math.max(1, a))), c = T + G / 2 - o / 2, [l, u] = s ? [n - t.gap / 2, Math.max(r + t.gap, 4)] : [P, L - P];
310
+ let n = Math.min(E, D), r = Math.abs(D - E), i = S ? O ? "bottom" : "top" : "none", o = s ? Math.max(X, Math.min(t.hitMin, Y.width)) : Math.max(X + t.gap, Math.min(t.hitMin, Y.width / Math.max(1, a))), c = T + X / 2 - o / 2, [l, u] = s ? [n - t.gap / 2, Math.max(r + t.gap, 4)] : [H, U - H];
275
311
  k = {
276
312
  i: e,
277
313
  j: h,
278
314
  value: g,
279
315
  share: y,
280
- path: v === null ? "" : F(T, n, G, r, t.radius, i),
316
+ path: v === null ? "" : F(T, n, X, r, t.radius, i),
281
317
  x: T,
282
318
  y: n,
283
- w: G,
319
+ w: X,
284
320
  h: r,
285
321
  hx: c,
286
322
  hy: l,
287
323
  hw: o,
288
324
  hh: u,
289
- ax: T + G / 2,
290
- ay: O ? n + r : n
325
+ ax: T + X / 2,
326
+ ay: O ? n + r : n,
327
+ stub: ""
291
328
  };
292
329
  }
293
- J.push(k);
330
+ if (g === null && (!s || M[e] && h === 0)) {
331
+ let e = Math.max(t.clear, Math.round(X / 2));
332
+ k.stub = o ? F(Z, T, e, X, t.radius, "right") : F(T, Z - e, X, e, t.radius, "top");
333
+ }
334
+ Q.push(k);
294
335
  let A = l(e, h);
295
336
  if (A !== null) {
296
- let e = T - G * u - t.gap, n = G * u, r = U(A), i = A < 0 ? o ? "left" : "bottom" : o ? "right" : "top";
297
- Y.push({
337
+ let e = T - X * u - t.gap, n = X * u, r = J(A), i = A < 0 ? o ? "left" : "bottom" : o ? "right" : "top";
338
+ $.push({
298
339
  j: h,
299
- path: o ? F(Math.min(q, r), e, Math.abs(r - q), n, t.radius, i) : F(e, Math.min(q, r), n, Math.abs(r - q), t.radius, i)
340
+ path: o ? F(Math.min(Z, r), e, Math.abs(r - Z), n, t.radius, i) : F(e, Math.min(Z, r), n, Math.abs(r - Z), t.radius, i)
300
341
  });
301
342
  }
302
343
  }
303
344
  }
304
- if (H.length) {
305
- let e = J.filter((e) => e.i === i - 1);
306
- H = H.map((t) => {
345
+ if (q.length) {
346
+ let e = Q.filter((e) => e.i === i - 1);
347
+ q = q.map((t) => {
307
348
  let n = e.find((e) => e.j === t.j);
308
349
  return {
309
350
  ...t,
310
351
  y: n && n.value && n.h >= E ? n.y + n.h / 2 : NaN
311
352
  };
312
353
  }).filter((e) => Number.isFinite(e.y));
313
- let t = H.map((e) => e.y).sort((e, t) => e - t);
314
- t.some((e, n) => n && e - t[n - 1] < E + 2) && (H = []);
354
+ let t = q.map((e) => e.y).sort((e, t) => e - t);
355
+ t.some((e, n) => n && e - t[n - 1] < E + 2) && (q = []);
315
356
  }
316
357
  return {
317
- H: j,
318
- x0: M,
319
- x1: N,
320
- y0: P,
321
- y1: L,
322
- ticks: B,
323
- fmtTick: V,
324
- valueScale: U,
325
- bands: W,
326
- bars: J,
327
- ghosts: Y,
358
+ H: R,
359
+ x0: B,
360
+ x1: V,
361
+ y0: H,
362
+ y1: U,
363
+ ticks: G,
364
+ fmtTick: K,
365
+ valueScale: J,
366
+ bands: Y,
367
+ bars: Q,
368
+ ghosts: $,
328
369
  marks: d,
329
370
  cmp: !!c,
330
- t: G,
331
- zero: q,
371
+ t: X,
372
+ zero: Z,
332
373
  cats: O,
374
+ details: k,
375
+ hasDetail: A,
376
+ empty: M,
377
+ lineStep: N,
333
378
  values: p,
334
379
  totals: m,
335
- seriesLabels: H,
380
+ seriesLabels: q,
336
381
  horizontal: o,
337
382
  stacked: s,
338
383
  percent: f,
@@ -342,7 +387,7 @@ var V = class extends r {
342
387
  };
343
388
  }
344
389
  markLabel(e) {
345
- let t = this.effectiveSeries[e.j], n = this.category(this.viewRows[e.i]), r = this.mode === "percent" && e.value !== null ? `${g(this.i18n.locale, e.share, 1)} (${this.fmt(e.value)})` : this.fmt(e.value);
390
+ let t = this.effectiveSeries[e.j], n = this.categoryName(this.viewRows[e.i]), r = e.value === null ? p(this.i18n.locale, "chartNoValue") : this.mode === "percent" ? `${g(this.i18n.locale, e.share, 1)} (${this.fmt(e.value)})` : this.fmt(e.value);
346
391
  return p(this.i18n.locale, "chartMark", {
347
392
  category: n,
348
393
  series: t?.label ?? "",
@@ -380,7 +425,7 @@ var V = class extends r {
380
425
  marker: "rect",
381
426
  active: !1
382
427
  }), {
383
- title: this.category(n),
428
+ title: this.categoryName(n),
384
429
  rows: a,
385
430
  x: e.ax,
386
431
  y: e.ay
@@ -462,42 +507,44 @@ var V = class extends r {
462
507
  }, this.requestUpdate(), await this.updateComplete, this.renderRoot.querySelector(`.hit[data-i="${r}"][data-j="${i}"]`)?.focus();
463
508
  }
464
509
  onCategoryKey = async (e) => {
465
- let t = this.viewRows.length, n = e.target.closest(".cat");
466
- if (!t || !n) return;
467
- let r = this.orientation === "horizontal", i = Number(n.dataset.i);
510
+ let t = e.target.closest("a.cat, button.cat"), n = [...this.renderRoot.querySelectorAll("a.cat, button.cat")], r = t ? n.indexOf(t) : -1;
511
+ if (r < 0) return;
512
+ let i = this.orientation === "horizontal", a = r;
468
513
  switch (e.key) {
469
- case r ? "ArrowDown" : "ArrowRight":
470
- i = Math.min(t - 1, i + 1);
514
+ case i ? "ArrowDown" : "ArrowRight":
515
+ a = Math.min(n.length - 1, r + 1);
471
516
  break;
472
- case r ? "ArrowUp" : "ArrowLeft":
473
- i = Math.max(0, i - 1);
517
+ case i ? "ArrowUp" : "ArrowLeft":
518
+ a = Math.max(0, r - 1);
474
519
  break;
475
520
  case "Home":
476
- i = 0;
521
+ a = 0;
477
522
  break;
478
523
  case "End":
479
- i = t - 1;
524
+ a = n.length - 1;
480
525
  break;
481
526
  case "Escape":
482
527
  this.chart.hideTooltip();
483
528
  return;
484
529
  default: return;
485
530
  }
531
+ let o = Number(n[a].dataset.i);
486
532
  e.preventDefault(), this.active = {
487
- i,
533
+ i: o,
488
534
  j: this.active.j
489
- }, this.requestUpdate(), await this.updateComplete, this.renderRoot.querySelector(`.cat[data-i="${i}"]`)?.focus();
535
+ }, this.requestUpdate(), await this.updateComplete, this.renderRoot.querySelector(`.cat[data-i="${o}"]`)?.focus();
490
536
  };
491
537
  toggleTable() {
492
538
  this.table = !this.table, this.chart.hideTooltip();
493
539
  }
494
540
  tableModel() {
495
541
  let e = this.i18n.locale, t = this.effectiveSeries, n = this.mode !== "grouped" && t.length > 1, r = !!this.compare?.length && this.mode === "grouped" && !this.contiguous, i = this.compareLabel || p(e, "chartPrevious"), a = [this.xLabel || p(e, "chartCategory")];
542
+ this.detail && a.push(this.detailLabel || p(e, "chartDetail"));
496
543
  for (let n of t) a.push(n.label, ...r ? [`${n.label} · ${i}`, `${n.label} · ${p(e, "chartChange")}`] : []);
497
544
  n && a.push(p(e, "chartTotal"));
498
545
  let o = (this.data ?? []).map((i, a) => {
499
546
  let o = t.map((e) => z(i[e.key])), s = [this.category(i)];
500
- return o.forEach((n, i) => {
547
+ return this.detail && s.push(this.detailText(i)), o.forEach((n, i) => {
501
548
  if (s.push(this.fmt(n)), r) {
502
549
  let r = z(this.compare[a]?.[t[i].key] ?? null);
503
550
  s.push(this.fmt(r), n !== null && r !== null ? D(e, n, r, (e) => this.fmt(e)) : "–");
@@ -522,25 +569,36 @@ var V = class extends r {
522
569
  return f ? d ? n`<line class="axis" x1=${Math.round(t) + .5} x2=${Math.round(t) + .5} y1=${i.y0} y2=${i.y1}></line>` : n`<line class="axis" x1=${i.x0} x2=${i.x1} y1=${Math.round(t) + .5} y2=${Math.round(t) + .5}></line>` : d ? n`<line class=${e === 0 ? "axis" : "grid"} x1=${Math.round(t) + .5} x2=${Math.round(t) + .5} y1=${i.y0} y2=${i.y1}></line>
523
570
  <text class="tick" x=${t} y=${i.y1 + c + 4 + s.clear} text-anchor="middle">${i.fmtTick(e)}</text>` : n`<line class=${e === 0 ? "axis" : "grid"} x1=${i.x0} x2=${i.x1} y1=${Math.round(t) + .5} y2=${Math.round(t) + .5}></line>
524
571
  <text class="tick" x=${i.x0 - 8} y=${t} dy="0.32em" text-anchor="end">${i.fmtTick(e)}</text>`;
525
- }), h = this.viewRows.map((e) => this.isCurrent(e)), g = h.some(Boolean), _;
526
- if (d) _ = i.cats.map((e, t) => n`<text class=${h[t] ? "current" : ""} x=${i.x0 - 8} y=${i.bands.center(t)} dy="0.32em" text-anchor="end">${N(e, i.x0 - 8, c, l)}</text>`);
527
- else {
528
- let e = Math.max(...i.cats.map((e) => I(e, c, l))), t = (e, t) => {
529
- let n = I(e, c, l) / 2;
530
- return Math.min(Math.max(i.bands.center(t), i.x0 + n), i.x1 - n);
531
- }, r = (e) => i.cats.map((n, r) => {
532
- if (r % e) return null;
533
- let a = N(n, i.bands.width * e - 4, c, l);
572
+ }), h = this.viewRows.map((e) => this.isCurrent(e)), g = h.some(Boolean), _, v = (e) => I(e, c, l), y = (e, t, r, a) => {
573
+ let o = Math.max(Math.round(t), Math.round(i.t), s.hitMin), l = Math.round(a === "middle" ? e - o / 2 : e - o), u = Math.round(r + c * .25 + s.clear / 2);
574
+ return n`<rect class="current-mark" x=${l} y=${u} width=${o} height=${s.indicator} rx=${s.indicator / 2}></rect>`;
575
+ };
576
+ if (d) {
577
+ let e = i.x0 - 8;
578
+ _ = i.cats.map((r, a) => {
579
+ let o = i.bands.center(a), s = N(r, e, c, l), u = i.details[a] ? N(i.details[a], e, c, l) : "", d = i.hasDetail ? o - i.lineStep / 2 : o, f = o + i.lineStep / 2, p = h[a] ? y(e, Math.max(v(s), v(u)), (i.hasDetail ? f : d) + c * .32, "end") : t;
580
+ return n`<text class=${h[a] ? "current" : ""} x=${e} y=${d} dy="0.32em" text-anchor="end">${s}</text>
581
+ ${u ? n`<text class="detail" x=${e} y=${f} dy="0.32em" text-anchor="end">${u}</text>` : t}${p}`;
582
+ });
583
+ } else {
584
+ let e = i.y1 + c + 4 + s.clear, r = e + i.lineStep, a = Math.max(...i.cats.map(v), ...i.details.map(v)), o = (e, t) => Math.min(Math.max(i.bands.center(t), i.x0 + e / 2), i.x1 - e / 2), u = (e) => i.cats.map((t, n) => {
585
+ if (n % e) return null;
586
+ let r = N(t, i.bands.width * e - 4, c, l), a = i.details[n] ? N(i.details[n], i.bands.width * e - 4, c, l) : "", s = Math.max(v(r), v(a));
534
587
  return {
535
- text: a,
536
- x: t(a, r),
537
- w: I(a, c, l)
588
+ text: r,
589
+ detail: a,
590
+ x: o(s, n),
591
+ w: s
538
592
  };
539
- }), a = (e) => e.filter((e) => e !== null).every((e, t, n) => t === 0 || e.x - e.w / 2 >= n[t - 1].x + n[t - 1].w / 2 + 4), o = Math.max(1, Math.ceil((e + 8) / Math.max(1, i.bands.width))), u = r(o);
540
- for (; o < i.cats.length && !a(u);) u = r(++o);
541
- _ = u.map((e, t) => e ? n`<text class=${h[t] ? "current" : ""} x=${e.x} y=${i.y1 + c + 4 + s.clear} text-anchor="middle">${e.text}</text>` : n``);
593
+ }), d = (e) => e.filter((e) => e !== null).every((e, t, n) => t === 0 || e.x - e.w / 2 >= n[t - 1].x + n[t - 1].w / 2 + 4), f = Math.max(1, Math.ceil((a + 8) / Math.max(1, i.bands.width))), p = u(f);
594
+ for (; f < i.cats.length && !d(p);) p = u(++f);
595
+ _ = p.map((a, o) => {
596
+ let s = h[o] ? y(a?.x ?? i.bands.center(o), Math.min(a?.w ?? 0, i.bands.width), i.hasDetail ? r : e, "middle") : t;
597
+ return a ? n`<text class=${h[o] ? "current" : ""} x=${a.x} y=${e} text-anchor="middle">${a.text}</text>
598
+ ${a.detail ? n`<text class="detail" x=${a.x} y=${r} text-anchor="middle">${a.detail}</text>` : t}${s}` : n`${s}`;
599
+ });
542
600
  }
543
- let v = i.series, y = this.hot, b = i.ghosts.map((e) => n`<path class="ghost" style=${a({ "--_bk-chart-c": j(v[e.j], e.j, v.length) })} d=${e.path}></path>`), x = T(i.marks, {
601
+ let b = i.series, x = this.hot, S = i.ghosts.map((e) => n`<path class="ghost" style=${a({ "--_bk-chart-c": j(b[e.j], e.j, b.length) })} d=${e.path}></path>`), C = T(i.marks, {
544
602
  vertical: !d,
545
603
  inset: s.clear,
546
604
  x0: i.x0,
@@ -557,8 +615,8 @@ var V = class extends r {
557
615
  let n = i.bands.start(t);
558
616
  return [n, n + i.bands.width];
559
617
  }
560
- }, u), S = this.brush.span, C = S && this.selectable ? d ? n`<rect class="selection" x=${i.x0} y=${i.bands.start(S[0])} width=${i.x1 - i.x0} height=${(S[1] - S[0] + 1) * i.bands.width}></rect>` : n`<rect class="selection" x=${i.bands.start(S[0])} y=${i.y0} width=${(S[1] - S[0] + 1) * i.bands.width} height=${i.y1 - i.y0}></rect>` : t, w = i.bars.map((e) => e.path ? n`<path class="mark ${y && y.i === e.i && y.j === e.j ? "hot" : ""} ${g && !h[e.i] ? "rest" : ""}" data-slot=${M(v[e.j], e.j)}
561
- style=${a({ "--_bk-chart-c": j(v[e.j], e.j, v.length) })} d=${e.path}></path>` : n``), E = [];
618
+ }, u), w = this.brush.span, E = w && this.selectable ? d ? n`<rect class="selection" x=${i.x0} y=${i.bands.start(w[0])} width=${i.x1 - i.x0} height=${(w[1] - w[0] + 1) * i.bands.width}></rect>` : n`<rect class="selection" x=${i.bands.start(w[0])} y=${i.y0} width=${(w[1] - w[0] + 1) * i.bands.width} height=${i.y1 - i.y0}></rect>` : t, D = i.bars.map((e) => e.path ? n`<path class="mark ${x && x.i === e.i && x.j === e.j ? "hot" : ""} ${g && !h[e.i] ? "rest" : ""}" data-slot=${M(b[e.j], e.j)}
619
+ style=${a({ "--_bk-chart-c": j(b[e.j], e.j, b.length) })} d=${e.path}></path>` : n``), O = i.bars.map((e) => e.stub ? n`<path class="stub" d=${e.stub}></path>` : n``), k = [];
562
620
  if (this.labels && !i.percent) {
563
621
  let e = i.stacked ? i.totals.map((e, t) => {
564
622
  let n = i.bars.filter((e) => e.i === t && e.path);
@@ -575,11 +633,11 @@ var V = class extends r {
575
633
  for (let r of e) {
576
634
  if (!r) continue;
577
635
  let e = this.fmt(r.v), a = I(e, c, l);
578
- a > t || !d && r.neg && r.b.y + r.b.h + c + 2 > i.y1 || d && r.neg && r.b.x - a - 4 < i.x0 || E.push(d ? n`<text class="value-label" x=${r.neg ? r.b.x - 4 : r.b.x + r.b.w + 4} y=${r.b.y + r.b.h / 2} dy="0.32em" text-anchor=${r.neg ? "end" : "start"}>${e}</text>` : n`<text class="value-label" x=${r.b.x + r.b.w / 2} y=${r.neg ? r.b.y + r.b.h + c : r.b.y - s.clear - s.gap} text-anchor="middle">${e}</text>`);
636
+ a > t || !d && r.neg && r.b.y + r.b.h + c + 2 > i.y1 || d && r.neg && r.b.x - a - 4 < i.x0 || k.push(d ? n`<text class="value-label" x=${r.neg ? r.b.x - 4 : r.b.x + r.b.w + 4} y=${r.b.y + r.b.h / 2} dy="0.32em" text-anchor=${r.neg ? "end" : "start"}>${e}</text>` : n`<text class="value-label" x=${r.b.x + r.b.w / 2} y=${r.neg ? r.b.y + r.b.h + c : r.b.y - s.clear - s.gap} text-anchor="middle">${e}</text>`);
579
637
  }
580
638
  }
581
- let D = i.seriesLabels.map((e) => n`<text x=${i.x1 + 8} y=${e.y} dy="0.32em">${e.text}</text>`), O = this.active, k = this.pickMode;
582
- if (k) {
639
+ let P = i.seriesLabels.map((e) => n`<text x=${i.x1 + 8} y=${e.y} dy="0.32em">${e.text}</text>`), F = this.active, R = this.pickMode;
640
+ if (R) {
583
641
  let n = (e) => {
584
642
  let t = Math.round(i.bands.start(e)), n = Math.round(i.bands.start(e) + i.bands.width);
585
643
  return d ? {
@@ -593,44 +651,45 @@ var V = class extends r {
593
651
  width: `${n - t}px`,
594
652
  height: `${Math.round(i.H)}px`
595
653
  };
596
- }, s = (e) => i.bars.find((t) => t.i === e && t.j === Math.min(O.j, i.k - 1)) ?? i.bars.find((t) => t.i === e), c = {
654
+ }, s = (e) => i.bars.find((t) => t.i === e && t.j === Math.min(F.j, i.k - 1)) ?? i.bars.find((t) => t.i === e), c = {
597
655
  enter: (e) => this.enter(s(e)),
598
656
  focus: (e) => {
599
657
  this.active = {
600
658
  i: e,
601
- j: O.j
659
+ j: F.j
602
660
  }, this.enter(s(e));
603
661
  }
604
- }, l = i.cats.map((r, i) => k === "link" ? e`<a class="cat interactive" part="category" data-i=${i} href=${this.links.href(this.categoryHref(this.viewRows[i]))}
662
+ }, l = i.cats.map((e, t) => R === "link" && !i.empty[t] ? this.categoryHref(this.viewRows[t]) : null), f = (e) => R === "link" ? l[e] !== null : !i.empty[e], g = f(F.i) ? F.i : i.cats.findIndex((e, t) => f(t)), v = i.cats.map((r, i) => f(i) ? R === "link" ? e`<a class="cat interactive" part="category" data-i=${i} href=${this.links.href(l[i])}
605
663
  target=${o(this.target)} rel=${o(this.rel)} aria-current=${h[i] ? "page" : t} aria-label=${this.categoryLabel(i)}
606
- style=${a(n(i))} @click=${this.links.click} @pointerenter=${() => c.enter(i)} @focus=${() => c.focus(i)} @blur=${this.onBlur}></a>` : e`<button type="button" class="cat interactive" part="category" data-i=${i} tabindex=${i === O.i ? 0 : -1}
664
+ style=${a(n(i))} @click=${this.links.click} @pointerenter=${() => c.enter(i)} @focus=${() => c.focus(i)} @blur=${this.onBlur}></a>` : e`<button type="button" class="cat interactive" part="category" data-i=${i} tabindex=${i === g ? 0 : -1}
607
665
  aria-current=${h[i] ? "true" : t} aria-label=${this.categoryLabel(i)}
608
- style=${a(n(i))} @click=${() => this.choose(i)} @pointerenter=${() => c.enter(i)} @focus=${() => c.focus(i)} @blur=${this.onBlur}></button>`);
666
+ style=${a(n(i))} @click=${() => this.choose(i)} @pointerenter=${() => c.enter(i)} @focus=${() => c.focus(i)} @blur=${this.onBlur}></button>` : e`<div class="cat" data-i=${i} role="img" aria-label=${this.categoryLabel(i)} aria-current=${h[i] ? R === "link" ? "page" : "true" : t}
667
+ style=${a(n(i))} @pointerenter=${() => c.enter(i)}></div>`);
609
668
  return e`<div class="plot" part="plot" style=${a(d ? { height: `${i.H}px` } : {})}>
610
669
  <svg width=${r} height=${i.H} aria-hidden="true">
611
670
  ${L()}
612
671
  <g>${m}${_}</g>
613
- <g>${x.back}${b}${w}${x.front}</g>
614
- <g>${E}${D}</g>
672
+ <g>${C.back}${S}${D}${O}${C.front}</g>
673
+ <g>${k}${P}</g>
615
674
  </svg>
616
- <div class="cats" role=${k === "button" ? "toolbar" : "group"} aria-orientation=${o(k === "button" ? d ? "vertical" : "horizontal" : void 0)}
675
+ <div class="cats" role=${R === "button" ? "toolbar" : "group"} aria-orientation=${o(R === "button" ? d ? "vertical" : "horizontal" : void 0)}
617
676
  aria-label=${this.heading || this.getAttribute("aria-label") || p(u, "chartData")}
618
- @keydown=${this.onCategoryKey} @pointerleave=${this.onLeave}>${l}</div>
677
+ @keydown=${this.onCategoryKey} @pointerleave=${this.onLeave}>${v}</div>
619
678
  </div>`;
620
679
  }
621
- let P = i.bars.map((e) => n`<rect class="hit" data-i=${e.i} data-j=${e.j} role="img" aria-label=${this.markLabel(e)}
622
- tabindex=${e.i === O.i && e.j === O.j ? 0 : -1} x=${e.hx} y=${e.hy} width=${Math.max(1, e.hw)} height=${Math.max(1, e.hh)}
623
- @pointerenter=${() => this.enter(e)} @focus=${(t) => this.onFocus(t, e)} @blur=${this.onBlur}></rect>`), F = this.ring ? i.bars.find((e) => e.i === O.i && e.j === O.j) : void 0, R = F ? n`<rect class="ring" x=${F.x - 3} y=${F.y - 3} width=${F.w + 6}
624
- height=${Math.max(F.h, 1) + 6} rx=${s.radius + 2}></rect>` : t;
680
+ let z = i.bars.map((e) => n`<rect class="hit" data-i=${e.i} data-j=${e.j} role="img" aria-label=${this.markLabel(e)}
681
+ tabindex=${e.i === F.i && e.j === F.j ? 0 : -1} x=${e.hx} y=${e.hy} width=${Math.max(1, e.hw)} height=${Math.max(1, e.hh)}
682
+ @pointerenter=${() => this.enter(e)} @focus=${(t) => this.onFocus(t, e)} @blur=${this.onBlur}></rect>`), B = this.ring ? i.bars.find((e) => e.i === F.i && e.j === F.j) : void 0, V = B ? n`<rect class="ring" x=${B.x - 3} y=${B.y - 3} width=${B.w + 6}
683
+ height=${Math.max(B.h, 1) + 6} rx=${s.radius + 2}></rect>` : t;
625
684
  return e`<div class="plot" part="plot" style=${a(d ? { height: `${i.H}px` } : {})}>
626
685
  <svg width=${r} height=${i.H} role="group" aria-label=${this.heading || p(u, "chartData")}
627
686
  @keydown=${this.onKey} @pointerleave=${this.onLeave} @pointerdown=${this.onDown} @pointermove=${this.onMove} @pointerup=${this.onUp}>
628
687
  ${L()}
629
688
  <g aria-hidden="true">${m}${_}</g>
630
- <g aria-hidden="true">${x.back}${C}${b}${w}${x.front}</g>
631
- <g aria-hidden="true">${E}${D}</g>
632
- <g>${P}</g>
633
- ${R}
689
+ <g aria-hidden="true">${C.back}${E}${S}${D}${O}${C.front}</g>
690
+ <g aria-hidden="true">${k}${P}</g>
691
+ <g>${z}</g>
692
+ ${V}
634
693
  </svg>
635
694
  </div>`;
636
695
  }
@@ -1,13 +1,13 @@
1
1
  import { a as e, n as t, s as n, t as r, u as i } from "./chunks/lit-D8x-qXgH.js";
2
2
  import { t as a } from "./chunks/style-map-BMvn17E7.js";
3
3
  import { t as o } from "./chunks/define-CzVPD4Zi.js";
4
- import { t as s } from "./chunks/i18n-CNsBRNPu.js";
4
+ import { t as s } from "./chunks/i18n-B6Al9xCK.js";
5
5
  import { t as c } from "./chunks/styles-DwSR-9a3.js";
6
6
  import { r as l } from "./chunks/chart-tokens-D1Exf7BW.js";
7
- import { t as u } from "./chunks/i18n-CrZgrRu9.js";
7
+ import { t as u } from "./chunks/i18n-BI16HQmm.js";
8
8
  import { a as d } from "./chunks/format-DEwvmPPd.js";
9
- import { a as f, i as p, n as m, o as h, r as g } from "./chunks/marks-CdqbbJpM.js";
10
- import { c as _, d as v, f as y, i as b, l as x, o as S, r as C, t as w, u as T } from "./chunks/frame-BW1nKuoM.js";
9
+ import { a as f, i as p, n as m, o as h, r as g } from "./chunks/marks-0kbeB4n8.js";
10
+ import { c as _, d as v, f as y, i as b, l as x, o as S, r as C, t as w, u as T } from "./chunks/frame-abXBnl8a.js";
11
11
  import "./bk-chart-mark.js";
12
12
  // dist/components/bk-chart-bridge.js
13
13
  l();
@@ -1,13 +1,13 @@
1
1
  import { a as e, n as t, t as n, u as r } from "./chunks/lit-D8x-qXgH.js";
2
2
  import { t as i } from "./chunks/style-map-BMvn17E7.js";
3
3
  import { t as a } from "./chunks/define-CzVPD4Zi.js";
4
- import { t as o } from "./chunks/i18n-CNsBRNPu.js";
4
+ import { t as o } from "./chunks/i18n-B6Al9xCK.js";
5
5
  import { t as s } from "./chunks/styles-DwSR-9a3.js";
6
6
  import { r as c } from "./chunks/chart-tokens-D1Exf7BW.js";
7
- import { t as l } from "./chunks/i18n-CrZgrRu9.js";
7
+ import { t as l } from "./chunks/i18n-BI16HQmm.js";
8
8
  import { a as u, o as d } from "./chunks/format-DEwvmPPd.js";
9
9
  import { a as f } from "./chunks/scale-BcW5wHaU.js";
10
- import { r as p, t as m } from "./chunks/frame-BW1nKuoM.js";
10
+ import { r as p, t as m } from "./chunks/frame-abXBnl8a.js";
11
11
  // dist/components/bk-chart-bullet.js
12
12
  c();
13
13
  function h(e, t, n, r = 0) {
@@ -1,13 +1,13 @@
1
1
  import { a as e, n as t, s as n, t as r, u as i } from "./chunks/lit-D8x-qXgH.js";
2
2
  import { t as a } from "./chunks/style-map-BMvn17E7.js";
3
3
  import { t as o } from "./chunks/define-CzVPD4Zi.js";
4
- import { t as s } from "./chunks/i18n-CNsBRNPu.js";
4
+ import { t as s } from "./chunks/i18n-B6Al9xCK.js";
5
5
  import { t as c } from "./chunks/styles-DwSR-9a3.js";
6
6
  import { r as l } from "./chunks/chart-tokens-D1Exf7BW.js";
7
- import { t as u } from "./chunks/i18n-CrZgrRu9.js";
7
+ import { t as u } from "./chunks/i18n-BI16HQmm.js";
8
8
  import { a as d, i as f } from "./chunks/format-DEwvmPPd.js";
9
- import { n as p, r as m, t as h } from "./chunks/ramp-EclrETaQ.js";
10
- import { c as g, l as _, o as v, r as y, s as b, t as x } from "./chunks/frame-BW1nKuoM.js";
9
+ import { n as p, r as m, t as h } from "./chunks/ramp-ggoyjMvC.js";
10
+ import { c as g, l as _, o as v, r as y, s as b, t as x } from "./chunks/frame-abXBnl8a.js";
11
11
  // dist/components/bk-chart-calendar.js
12
12
  l();
13
13
  var S = (e) => String(e).padStart(2, "0"), C = (e) => `${e.getFullYear()}-${S(e.getMonth() + 1)}-${S(e.getDate())}`, w = (e, t, n) => new Date(e, t, n, 12);
@@ -1,13 +1,13 @@
1
1
  import { a as e, n as t, s as n, t as r, u as i } from "./chunks/lit-D8x-qXgH.js";
2
2
  import { t as a } from "./chunks/style-map-BMvn17E7.js";
3
3
  import { t as o } from "./chunks/define-CzVPD4Zi.js";
4
- import { t as s } from "./chunks/i18n-CNsBRNPu.js";
4
+ import { t as s } from "./chunks/i18n-B6Al9xCK.js";
5
5
  import { t as c } from "./chunks/styles-DwSR-9a3.js";
6
6
  import { r as l } from "./chunks/chart-tokens-D1Exf7BW.js";
7
- import { t as u } from "./chunks/i18n-CrZgrRu9.js";
7
+ import { t as u } from "./chunks/i18n-BI16HQmm.js";
8
8
  import { a as d } from "./chunks/format-DEwvmPPd.js";
9
- import { n as f, r as p, t as m } from "./chunks/ramp-EclrETaQ.js";
10
- import { c as h, i as g, l as _, o as v, r as y, s as b, t as x } from "./chunks/frame-BW1nKuoM.js";
9
+ import { n as f, r as p, t as m } from "./chunks/ramp-ggoyjMvC.js";
10
+ import { c as h, i as g, l as _, o as v, r as y, s as b, t as x } from "./chunks/frame-abXBnl8a.js";
11
11
  // dist/components/bk-chart-heatmap.js
12
12
  l();
13
13
  var S = class extends r {
@@ -1,9 +1,9 @@
1
1
  import { a as e, t, u as n } from "./chunks/lit-D8x-qXgH.js";
2
2
  import { t as r } from "./chunks/define-CzVPD4Zi.js";
3
- import { t as i } from "./chunks/i18n-CNsBRNPu.js";
3
+ import { t as i } from "./chunks/i18n-B6Al9xCK.js";
4
4
  import { t as a } from "./chunks/styles-DwSR-9a3.js";
5
5
  import { r as o } from "./chunks/chart-tokens-D1Exf7BW.js";
6
- import { t as s } from "./chunks/i18n-CrZgrRu9.js";
6
+ import { t as s } from "./chunks/i18n-BI16HQmm.js";
7
7
  import { a as c } from "./chunks/format-DEwvmPPd.js";
8
8
  import { i as l } from "./chunks/scale-BcW5wHaU.js";
9
9
  import "./bk-chart-bar.js";
@@ -1,12 +1,12 @@
1
1
  import { a as e, n as t, t as n, u as r } from "./chunks/lit-D8x-qXgH.js";
2
2
  import { t as i } from "./chunks/style-map-BMvn17E7.js";
3
3
  import { t as a } from "./chunks/define-CzVPD4Zi.js";
4
- import { t as o } from "./chunks/i18n-CNsBRNPu.js";
4
+ import { t as o } from "./chunks/i18n-B6Al9xCK.js";
5
5
  import { t as s, v as c } from "./chunks/styles-DwSR-9a3.js";
6
6
  import { n as l } from "./chunks/events-DQ4e9cPN.js";
7
7
  import { r as u } from "./chunks/chart-tokens-D1Exf7BW.js";
8
- import { t as d } from "./chunks/i18n-CrZgrRu9.js";
9
- import { d as f } from "./chunks/frame-BW1nKuoM.js";
8
+ import { t as d } from "./chunks/i18n-BI16HQmm.js";
9
+ import { d as f } from "./chunks/frame-abXBnl8a.js";
10
10
  // dist/components/bk-chart-legend.js
11
11
  u();
12
12
  var p = class extends n {