@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.
- package/BUILDING.md +32 -0
- package/CHANGELOG.md +57 -0
- package/USAGE.md +14 -8
- package/custom-elements.json +1 -1
- package/dist/charts/frame.d.ts +2 -0
- package/dist/charts/frame.js +2 -1
- package/dist/components/bk-button.d.ts +18 -3
- package/dist/components/bk-button.js +19 -8
- package/dist/components/bk-chart-bar.d.ts +46 -9
- package/dist/components/bk-chart-bar.js +127 -37
- package/dist/components/bk-combobox.d.ts +29 -5
- package/dist/components/bk-combobox.js +61 -19
- package/dist/components/bk-dialog.d.ts +4 -1
- package/dist/components/bk-dialog.js +6 -2
- package/dist/components/bk-facts-item.js +8 -6
- package/dist/components/bk-facts.d.ts +6 -4
- package/dist/components/bk-facts.js +19 -8
- package/dist/components/bk-input-time-zone.d.ts +3 -0
- package/dist/components/bk-model-viewer.d.ts +12 -1
- package/dist/components/bk-model-viewer.js +15 -2
- package/dist/components/bk-period-nav.d.ts +102 -0
- package/dist/components/bk-period-nav.js +69 -0
- package/dist/components/bk-select.js +2 -1
- package/dist/components/bk-shell-app.d.ts +3 -2
- package/dist/components/bk-shell-app.js +16 -3
- package/dist/components/bk-sortable.d.ts +3 -0
- package/dist/components/bk-sortable.js +3 -0
- package/dist/components/bk-split.d.ts +3 -0
- package/dist/components/bk-split.js +3 -0
- package/dist/components/bk-table.d.ts +16 -12
- package/dist/components/bk-table.js +96 -14
- package/dist/i18n/de.js +7 -0
- package/dist/i18n.d.ts +7 -0
- package/dist/i18n.js +7 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/internal/cloak.d.ts +3 -0
- package/dist/internal/cloak.js +4 -0
- package/dist/internal/handle-menu.d.ts +2 -3
- package/dist/internal/handle-menu.js +14 -3
- package/dist/internal/late.d.ts +15 -0
- package/dist/internal/late.js +30 -0
- package/dist/jsx.d.ts +36 -5
- package/dist/standalone/all.js +119 -118
- package/dist/standalone/bk-action-bar.js +1 -1
- package/dist/standalone/bk-alert-offline.js +1 -1
- package/dist/standalone/bk-alert.js +1 -1
- package/dist/standalone/bk-attachment.js +1 -1
- package/dist/standalone/bk-avatar-group.js +1 -1
- package/dist/standalone/bk-avatar.js +1 -1
- package/dist/standalone/bk-breadcrumbs.js +1 -1
- package/dist/standalone/bk-button-copy.js +2 -2
- package/dist/standalone/bk-button-group.js +2 -2
- package/dist/standalone/bk-button-share.js +2 -2
- package/dist/standalone/bk-button-top.js +1 -1
- package/dist/standalone/bk-button.js +15 -7
- package/dist/standalone/bk-calendar-week.js +1 -1
- package/dist/standalone/bk-calendar.js +1 -1
- package/dist/standalone/bk-card.js +1 -1
- package/dist/standalone/bk-carousel-controls.js +2 -2
- package/dist/standalone/bk-carousel.js +1 -1
- package/dist/standalone/bk-chart-bar-list.js +3 -3
- package/dist/standalone/bk-chart-bar.js +164 -105
- package/dist/standalone/bk-chart-bridge.js +4 -4
- package/dist/standalone/bk-chart-bullet.js +3 -3
- package/dist/standalone/bk-chart-calendar.js +4 -4
- package/dist/standalone/bk-chart-heatmap.js +4 -4
- package/dist/standalone/bk-chart-histogram.js +2 -2
- package/dist/standalone/bk-chart-legend.js +3 -3
- package/dist/standalone/bk-chart-line.js +5 -5
- package/dist/standalone/bk-chart-scatter.js +3 -3
- package/dist/standalone/bk-chart-sparkline.js +3 -3
- package/dist/standalone/bk-chart-stacked-bar.js +4 -4
- package/dist/standalone/bk-chart-tracker.js +3 -3
- package/dist/standalone/bk-chart-waterfall.js +2 -2
- package/dist/standalone/bk-checkbox-group.js +2 -2
- package/dist/standalone/bk-checkbox.js +1 -1
- package/dist/standalone/bk-chip-group.js +2 -2
- package/dist/standalone/bk-chip.js +2 -2
- package/dist/standalone/bk-code-diff.js +1 -1
- package/dist/standalone/bk-code-stack.js +2 -2
- package/dist/standalone/bk-code.js +2 -2
- package/dist/standalone/bk-color-panel.js +2 -2
- package/dist/standalone/bk-columns.js +1 -1
- package/dist/standalone/bk-combobox.js +49 -30
- package/dist/standalone/bk-command-menu.js +2 -2
- package/dist/standalone/bk-command-palette.js +3 -3
- package/dist/standalone/bk-composer.js +2 -2
- package/dist/standalone/bk-delta.js +1 -1
- package/dist/standalone/bk-diagram.js +1 -1
- package/dist/standalone/bk-dialog.js +1 -1
- package/dist/standalone/bk-drawer.js +2 -2
- package/dist/standalone/bk-error-summary.js +1 -1
- package/dist/standalone/bk-facts-item.js +8 -6
- package/dist/standalone/bk-facts.js +19 -8
- package/dist/standalone/bk-fieldset.js +1 -1
- package/dist/standalone/bk-filter-bar.js +1 -1
- package/dist/standalone/bk-folder-browser.js +1 -1
- package/dist/standalone/bk-form-guard.js +1 -1
- package/dist/standalone/bk-form-steps.js +1 -1
- package/dist/standalone/bk-image-compare.js +1 -1
- package/dist/standalone/bk-image-crop.js +2 -2
- package/dist/standalone/bk-image-editor.js +2 -1
- package/dist/standalone/bk-image-viewer.js +1 -1
- package/dist/standalone/bk-input-code.js +2 -2
- package/dist/standalone/bk-input-color.js +1 -1
- package/dist/standalone/bk-input-date-range.js +2 -2
- package/dist/standalone/bk-input-date.js +1 -1
- package/dist/standalone/bk-input-file.js +2 -2
- package/dist/standalone/bk-input-group.js +2 -2
- package/dist/standalone/bk-input-inline.js +2 -2
- package/dist/standalone/bk-input-number.js +2 -2
- package/dist/standalone/bk-input-rating.js +2 -2
- package/dist/standalone/bk-input-rich.js +1 -1
- package/dist/standalone/bk-input-search.js +1 -1
- package/dist/standalone/bk-input-slider-range.js +2 -2
- package/dist/standalone/bk-input-slider.js +2 -2
- package/dist/standalone/bk-input-text.js +1 -1
- package/dist/standalone/bk-input-time.js +3 -3
- package/dist/standalone/bk-item.js +1 -1
- package/dist/standalone/bk-kbd-shortcuts.js +1 -1
- package/dist/standalone/bk-kbd.js +1 -1
- package/dist/standalone/bk-lightbox.js +2 -2
- package/dist/standalone/bk-listbox-columns.js +2 -2
- package/dist/standalone/bk-listbox-search.js +3 -3
- package/dist/standalone/bk-listbox-transfer.js +3 -3
- package/dist/standalone/bk-listbox.js +2 -2
- package/dist/standalone/bk-logo.js +1 -1
- package/dist/standalone/bk-menu-bar.js +1 -1
- package/dist/standalone/bk-menu-item.js +1 -1
- package/dist/standalone/bk-menu-list.js +1 -1
- package/dist/standalone/bk-menu.js +2 -2
- package/dist/standalone/bk-message-approval.js +1 -1
- package/dist/standalone/bk-message-branches.js +1 -1
- package/dist/standalone/bk-message-citation.js +1 -1
- package/dist/standalone/bk-message-feedback.js +1 -1
- package/dist/standalone/bk-message-list.js +1 -1
- package/dist/standalone/bk-message-reasoning.js +1 -1
- package/dist/standalone/bk-message-source.js +1 -1
- package/dist/standalone/bk-message-tool-group.js +1 -1
- package/dist/standalone/bk-message-tool.js +1 -1
- package/dist/standalone/bk-message.js +1 -1
- package/dist/standalone/bk-meter.js +1 -1
- package/dist/standalone/bk-model-viewer.js +1 -1
- package/dist/standalone/bk-nav-group.js +1 -1
- package/dist/standalone/bk-nav-item.js +1 -1
- package/dist/standalone/bk-nav-toc.js +1 -1
- package/dist/standalone/bk-nav.js +1 -1
- package/dist/standalone/bk-overflow.js +1 -1
- package/dist/standalone/bk-page-footer.js +1 -1
- package/dist/standalone/bk-page-pager.js +1 -1
- package/dist/standalone/bk-pagination.js +1 -1
- package/dist/standalone/bk-pane.js +1 -1
- package/dist/standalone/bk-panel.js +1 -1
- package/dist/standalone/bk-period-nav.js +69 -0
- package/dist/standalone/bk-picture.js +1 -1
- package/dist/standalone/bk-popover-help.js +1 -1
- package/dist/standalone/bk-popover.js +1 -1
- package/dist/standalone/bk-preview.js +1 -1
- package/dist/standalone/bk-progress.js +1 -1
- package/dist/standalone/bk-qr-code.js +1 -1
- package/dist/standalone/bk-radio-group.js +2 -2
- package/dist/standalone/bk-radio.js +1 -1
- package/dist/standalone/bk-rating.js +1 -1
- package/dist/standalone/bk-scroll.js +1 -1
- package/dist/standalone/bk-segmented.js +2 -2
- package/dist/standalone/bk-select-cascade.js +1 -1
- package/dist/standalone/bk-select-tree.js +1 -1
- package/dist/standalone/bk-select.js +3 -2
- package/dist/standalone/bk-shell-app.js +42 -38
- package/dist/standalone/bk-shell-sites.js +1 -1
- package/dist/standalone/bk-sortable.js +7 -4
- package/dist/standalone/bk-split-grid.js +1 -1
- package/dist/standalone/bk-split.js +7 -4
- package/dist/standalone/bk-stat.js +2 -2
- package/dist/standalone/bk-steps-item.js +1 -1
- package/dist/standalone/bk-swatch-group.js +2 -2
- package/dist/standalone/bk-switch.js +2 -2
- package/dist/standalone/bk-table.js +130 -80
- package/dist/standalone/bk-tabs-item.js +1 -1
- package/dist/standalone/bk-tabs.js +1 -1
- package/dist/standalone/bk-tasks-item.js +1 -1
- package/dist/standalone/bk-text.js +1 -1
- package/dist/standalone/bk-time-countdown.js +1 -1
- package/dist/standalone/bk-time-relative.js +1 -1
- package/dist/standalone/bk-timeline-item.js +1 -1
- package/dist/standalone/bk-toast-group.js +1 -1
- package/dist/standalone/bk-toast.js +1 -1
- package/dist/standalone/bk-tooltip.js +1 -1
- package/dist/standalone/bk-tree-item.js +2 -2
- package/dist/standalone/bk-video.js +1 -1
- package/dist/standalone/bk-zoom.js +3 -3
- package/dist/standalone/chunks/{bk-alert-offline-BoMEYxnE.js → bk-alert-offline-B1bQxOZp.js} +1 -1
- package/dist/standalone/chunks/{bk-carousel-B7-9OanA.js → bk-carousel-BCwIQhG5.js} +1 -1
- package/dist/standalone/chunks/{bk-diagram-CpOpicmo.js → bk-diagram-DWK8CvRZ.js} +2 -2
- package/dist/standalone/chunks/{bk-dialog-a2BtUBf2.js → bk-dialog-DX0cPJ1o.js} +7 -3
- package/dist/standalone/chunks/{bk-image-editor-z_Uj83fy.js → bk-image-editor-DXEj9gCu.js} +1 -1
- package/dist/standalone/chunks/{bk-input-date-range-BQkbPlSJ.js → bk-input-date-range-Cbx_lpf0.js} +1 -1
- package/dist/standalone/chunks/{bk-input-rich-Dte_b4Ev.js → bk-input-rich-ZB68vziu.js} +3 -3
- package/dist/standalone/chunks/{bk-input-text-CUNQG1ah.js → bk-input-text-DD32uWNO.js} +1 -1
- package/dist/standalone/chunks/{bk-kbd-B7bz8hmV.js → bk-kbd-B_TlKzWj.js} +1 -1
- package/dist/standalone/chunks/{bk-model-viewer-D1XJPgAG.js → bk-model-viewer-Dr81ahVv.js} +19 -5
- package/dist/standalone/chunks/{bk-qr-code-CbI9rdOK.js → bk-qr-code-QaYvZwOR.js} +1 -1
- package/dist/standalone/chunks/{bk-toast-group-Cix-Urgi.js → bk-toast-group-BSeO_rPs.js} +1 -1
- package/dist/standalone/chunks/{choice-field-BnuK9mp_.js → choice-field-CGvE4tyb.js} +1 -1
- package/dist/standalone/chunks/{clipboard-DBGdJ-1S.js → clipboard-BKlrP5rj.js} +1 -28
- package/dist/standalone/chunks/clipboard-Crzt1Sh9.js +29 -0
- package/dist/standalone/chunks/{date-field-BQ5k-DDL.js → date-field-BlI6grfT.js} +2 -2
- package/dist/standalone/chunks/{form-control-D7dqSP9M.js → form-control-CyXQIJ2x.js} +1 -1
- package/dist/standalone/chunks/{frame-BW1nKuoM.js → frame-abXBnl8a.js} +3 -1
- package/dist/standalone/chunks/handle-menu-ZVR_msk2.js +49 -0
- package/dist/standalone/chunks/{i18n-CNsBRNPu.js → i18n-B6Al9xCK.js} +7 -0
- package/dist/standalone/chunks/{i18n-CrZgrRu9.js → i18n-BI16HQmm.js} +1 -1
- package/dist/standalone/chunks/{marks-CdqbbJpM.js → marks-0kbeB4n8.js} +2 -2
- package/dist/standalone/chunks/{popover-base-oDhxsYMr.js → popover-base-ac49G87f.js} +1 -1
- package/dist/standalone/chunks/{ramp-EclrETaQ.js → ramp-ggoyjMvC.js} +1 -1
- package/dist/standalone/chunks/{summary-BwL-Gp8w.js → summary-BK-B4m5A.js} +1 -1
- package/dist/standalone/chunks/{text-field-CTp2b-Ai.js → text-field-4IUUpRHE.js} +2 -2
- package/dist/standalone/chunks/{toggle-control-DXkgmz7R.js → toggle-control-ioV2jhNY.js} +1 -1
- package/dist/standalone/confirm.js +3 -3
- package/dist/standalone/i18n-de.js +8 -1
- package/dist/standalone/toast.js +1 -1
- package/dist/standalone/tokens.css +4 -1
- package/dist/tokens.css +4 -1
- package/package.json +1 -1
- package/dist/standalone/chunks/handle-menu-DsxWvv4D.js +0 -22
|
@@ -5,27 +5,17 @@ import { t as d } from "./chunks/announcer-haFcvqbe.js";
|
|
|
5
5
|
import { i as f, n as p, o as m, t as h } from "./chunks/link-CWSMsx04.js";
|
|
6
6
|
import { i as g, n as _ } from "./chunks/events-DQ4e9cPN.js";
|
|
7
7
|
import { t as v } from "./chunks/state-XYmTmnOw.js";
|
|
8
|
-
import { t as
|
|
9
|
-
import { t as
|
|
10
|
-
import { n as
|
|
11
|
-
import { n as
|
|
12
|
-
import {
|
|
13
|
-
import { c as
|
|
14
|
-
import {
|
|
15
|
-
import { t as M } from "./chunks/i18n-
|
|
8
|
+
import { t as ee } from "./chunks/light-styles-CFbyUU7I.js";
|
|
9
|
+
import { t as y } from "./chunks/slots-BHTtBbPo.js";
|
|
10
|
+
import { n as b, t as x } from "./chunks/busy-B7Mxemwm.js";
|
|
11
|
+
import { n as S, t as C } from "./chunks/virtual-B-1oN14Y.js";
|
|
12
|
+
import { a as w, i as T, n as E, o as D, t as O } from "./chunks/handle-menu-ZVR_msk2.js";
|
|
13
|
+
import { c as k, i as A, n as j } from "./chunks/anchor-CNX3nt2F.js";
|
|
14
|
+
import { t as te } from "./chunks/clipboard-BKlrP5rj.js";
|
|
15
|
+
import { t as M } from "./chunks/i18n-B6Al9xCK.js";
|
|
16
16
|
import { S as N, f as P, t as F } from "./chunks/styles-DwSR-9a3.js";
|
|
17
17
|
import "./bk-button.js";
|
|
18
|
-
import "./bk-checkbox.js";
|
|
19
|
-
import "./bk-filter-bar.js";
|
|
20
18
|
import "./chunks/bk-icon-DssFsNuB.js";
|
|
21
|
-
import "./bk-input-number.js";
|
|
22
|
-
import "./chunks/bk-input-text-CUNQG1ah.js";
|
|
23
|
-
import "./bk-menu-context.js";
|
|
24
|
-
import "./bk-menu-divider.js";
|
|
25
|
-
import "./bk-menu-item.js";
|
|
26
|
-
import "./bk-menu-label.js";
|
|
27
|
-
import "./bk-popover.js";
|
|
28
|
-
import "./bk-skeleton.js";
|
|
29
19
|
import "./chunks/add-CUFUzxGc.js";
|
|
30
20
|
import "./chunks/arrow-back-DJBwVPZy.js";
|
|
31
21
|
import "./chunks/arrow-down-yAm1AGV7.js";
|
|
@@ -43,11 +33,16 @@ import "./chunks/remove-3A4Fpn3J.js";
|
|
|
43
33
|
import "./chunks/unfold-more-CcOFYpUE.js";
|
|
44
34
|
import "./chunks/visibility-off-urFZQ4oB.js";
|
|
45
35
|
// dist/components/bk-table.js
|
|
46
|
-
var I =
|
|
36
|
+
var I = new w(() => import("./bk-checkbox.js")), L = new w(() => Promise.all([import("./bk-filter-bar.js"), import("./bk-popover.js")])), R = new w(() => Promise.all([
|
|
37
|
+
import("./bk-menu-context.js"),
|
|
38
|
+
import("./bk-menu-item.js"),
|
|
39
|
+
import("./bk-menu-divider.js"),
|
|
40
|
+
import("./bk-menu-label.js")
|
|
41
|
+
])), z = new w(() => Promise.all([import("./bk-input-number.js"), import("./bk-input-text.js")])), B = new w(() => import("./bk-skeleton.js")), V = 48, H = 16, U = 64, W = 3, G = 10, K = "[data-bk-select], [data-bk-handle]", q = "button, a[href], input, select, textarea, bk-checkbox, bk-button, bk-switch, bk-link, bk-select, .bk-table-resize, [tabindex]:not(td, th, tr)", J = "button, a[href], input, select, textarea, label, summary, [contenteditable], [role='button'], [tabindex]:not(td, th, tr), [data-row-action], bk-button, bk-button-copy, bk-button-share, bk-checkbox, bk-switch, bk-link, bk-select, bk-menu, bk-input-inline, bk-input-rating", Y = ":scope > table > :is(thead, tbody:not([data-bk-state]), tfoot) > tr:not([data-bk-spacer])", X = (e) => (e ?? "").replace(/\s+/g, " ").trim(), Z = /* @__PURE__ */ new Set(["true", "yes"]), ne = /* @__PURE__ */ new Set([
|
|
47
42
|
"false",
|
|
48
43
|
"no",
|
|
49
44
|
""
|
|
50
|
-
]),
|
|
45
|
+
]), Q = (e) => e == null || e === "" || e === !1 || Array.isArray(e) && e.length === 0, re = (e, t) => e.includes(t) || /["\r\n]/.test(e) ? `"${e.replace(/"/g, "\"\"")}"` : e, ie = a`
|
|
51
46
|
@layer bk.components {
|
|
52
47
|
bk-table > table {
|
|
53
48
|
inline-size: 100%; border-collapse: separate; border-spacing: 0;
|
|
@@ -117,7 +112,7 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
117
112
|
bk-table > table > tbody > tr:has(a[data-row-link][href]) { position: relative; z-index: 0; cursor: pointer; }
|
|
118
113
|
bk-table > table > tbody > tr > * a[data-row-link][href] { color: var(--bk-table-row-link-fg, inherit); font-weight: var(--bk-table-row-link-weight, inherit); text-decoration: none; }
|
|
119
114
|
bk-table > table > tbody > tr > * a[data-row-link][href]::after { content: ""; position: absolute; inset: 0; }
|
|
120
|
-
bk-table > table > tbody > tr:has(a[data-row-link][href]) :is(${t(
|
|
115
|
+
bk-table > table > tbody > tr:has(a[data-row-link][href]) :is(${t(J)}):not([data-row-link]) { position: relative; z-index: 1; }
|
|
121
116
|
bk-table > table > tbody > tr > * a[data-row-link][href]:focus { outline: none; }
|
|
122
117
|
bk-table > table > tbody > tr > * a[data-row-link][href]:focus-visible::after { outline: var(--bk-focus-ring); outline-offset: var(--bk-focus-offset-inset); }
|
|
123
118
|
@media (hover: hover) {
|
|
@@ -303,8 +298,28 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
303
298
|
padding-block-end: var(--bk-table-card-gap, var(--bk-space-2));
|
|
304
299
|
}
|
|
305
300
|
bk-table:state(cards) > table > thead > tr > th { display: block; position: static; padding: 0; border: 0; background: none; inline-size: auto; }
|
|
306
|
-
bk-table:state(cards) > table > thead > tr > th:not(:has(>
|
|
301
|
+
bk-table:state(cards) > table > thead > tr > th:not(:has(> .bk-table-tool, > bk-checkbox)) { ${N} }
|
|
302
|
+
/* The select above the table sorts the cards: the sort buttons of the header cells do not show. */
|
|
303
|
+
bk-table:state(cards) > table > thead > tr > th > .bk-table-sort { ${N} }
|
|
304
|
+
bk-table:state(cards) > table > thead > tr:not(:has(> th > :is(.bk-table-tool, bk-checkbox))) { padding-block-end: 0; }
|
|
307
305
|
bk-table:state(cards) > table > thead > tr > th > .bk-table-resize { display: none; }
|
|
306
|
+
/*
|
|
307
|
+
* The card is the surface of the row: a selected row and the row under the pointer tint the whole card, not the
|
|
308
|
+
* cells inside its padding. The cells have no background of their own in card mode (no stripes, no pin surface).
|
|
309
|
+
*/
|
|
310
|
+
bk-table:state(cards) > table > :is(tbody, tfoot) > tr:not([data-bk-spacer]) > :is(th, td):not([data-bk-handle]) { background: none; }
|
|
311
|
+
bk-table:state(cards) > table > tbody > tr:is([data-selected], [aria-selected="true"]) {
|
|
312
|
+
background-image: linear-gradient(var(--bk-table-selected, var(--bk-selected)), var(--bk-table-selected, var(--bk-selected)));
|
|
313
|
+
}
|
|
314
|
+
@media (hover: hover) {
|
|
315
|
+
bk-table:state(cards)[hover-rows] > table > tbody > tr:hover {
|
|
316
|
+
background-image: linear-gradient(var(--bk-table-row-hover, var(--bk-hover)), var(--bk-table-row-hover, var(--bk-hover)));
|
|
317
|
+
}
|
|
318
|
+
bk-table:state(cards)[hover-rows] > table > tbody > tr:is([data-selected], [aria-selected="true"]):hover {
|
|
319
|
+
background-image: linear-gradient(var(--bk-table-row-hover, var(--bk-hover)), var(--bk-table-row-hover, var(--bk-hover))),
|
|
320
|
+
linear-gradient(var(--bk-table-selected, var(--bk-selected)), var(--bk-table-selected, var(--bk-selected)));
|
|
321
|
+
}
|
|
322
|
+
}
|
|
308
323
|
bk-table:state(cards) > table > :is(tbody, tfoot) > tr {
|
|
309
324
|
margin-block-end: var(--bk-table-card-gap, var(--bk-space-2)); padding: var(--bk-table-card-padding, var(--bk-space-3));
|
|
310
325
|
border: var(--bk-border-width) solid var(--bk-table-card-border, var(--bk-layer-raised-border));
|
|
@@ -333,7 +348,7 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
333
348
|
}
|
|
334
349
|
/* A row header in the body is the title of the card, unless its column gives it another place (data-card). */
|
|
335
350
|
bk-table:state(cards) > table > :is(tbody, tfoot) > tr > [data-bk-card="title"],
|
|
336
|
-
bk-table:state(cards) > table > tbody > tr > th:not([data-bk-card], ${t(
|
|
351
|
+
bk-table:state(cards) > table > tbody > tr > th:not([data-bk-card], ${t(K)}) {
|
|
337
352
|
justify-content: start; text-align: start; font-size: var(--bk-table-card-title-size, var(--bk-type-body, 1em));
|
|
338
353
|
font-weight: var(--bk-table-card-title-weight, var(--bk-weight-semibold, var(--bk-weight-medium)));
|
|
339
354
|
}
|
|
@@ -349,11 +364,12 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
349
364
|
bk-table:state(cards) > table > :is(tbody, tfoot) > tr:has(> [data-bk-card="meta"]) > :is([data-bk-card="meta"], [data-bk-select]) {
|
|
350
365
|
flex: none; order: 0;
|
|
351
366
|
}
|
|
352
|
-
bk-table:state(cards) > table > :is(tbody, tfoot) > tr:has(> [data-bk-card="meta"]) > :is([data-bk-card="title"], th:not([data-bk-card], ${t(
|
|
353
|
-
|
|
367
|
+
bk-table:state(cards) > table > :is(tbody, tfoot) > tr:has(> [data-bk-card="meta"]) > :is([data-bk-card="title"], th:not([data-bk-card], ${t(K)})) {
|
|
368
|
+
/* The title keeps the width of its longest word (at most the card): a meta value that does not fit then wraps under it. */
|
|
369
|
+
flex: 1 1 0; min-inline-size: min(min-content, 100%); order: 0;
|
|
354
370
|
}
|
|
355
371
|
bk-table:state(cards) > table > :is(tbody, tfoot) > tr > [data-bk-card="meta"] {
|
|
356
|
-
justify-content: start; align-items: center; gap: var(--bk-table-card-meta-gap, var(--bk-space-2));
|
|
372
|
+
justify-content: start; align-items: center; gap: var(--bk-table-card-meta-gap, var(--bk-space-2)); max-inline-size: 100%;
|
|
357
373
|
text-align: start; color: var(--bk-table-card-meta-fg, var(--bk-text-muted));
|
|
358
374
|
}
|
|
359
375
|
/* An open row and its detail form one card. The text of the detail starts at the start edge. */
|
|
@@ -377,7 +393,7 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
377
393
|
bk-table > table > tbody > tr > * > .bk-table-disclosure > bk-icon { transition: none; }
|
|
378
394
|
}
|
|
379
395
|
}
|
|
380
|
-
`,
|
|
396
|
+
`, $ = class extends i {
|
|
381
397
|
static properties = {
|
|
382
398
|
variant: {
|
|
383
399
|
reflect: !0,
|
|
@@ -470,8 +486,8 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
470
486
|
menuKind = "resize";
|
|
471
487
|
i18n = new M(this);
|
|
472
488
|
internals = this.attachInternals();
|
|
473
|
-
slots = new
|
|
474
|
-
busyState = new
|
|
489
|
+
slots = new y(this);
|
|
490
|
+
busyState = new x(this, this.i18n);
|
|
475
491
|
keys = /* @__PURE__ */ new Set();
|
|
476
492
|
anchor;
|
|
477
493
|
shift = !1;
|
|
@@ -483,12 +499,12 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
483
499
|
observedTable = null;
|
|
484
500
|
heads = l(() => this.syncAll());
|
|
485
501
|
rowLinks = l(() => this.resolveRowLinks());
|
|
486
|
-
vc = new
|
|
502
|
+
vc = new S(this, {
|
|
487
503
|
scroller: () => this.scroller,
|
|
488
504
|
track: () => this.virtual ? this.body : null,
|
|
489
505
|
rowHeight: "var(--bk-table-row-height, var(--bk-control-lg))"
|
|
490
506
|
});
|
|
491
|
-
loadMore = new
|
|
507
|
+
loadMore = new C(this, {
|
|
492
508
|
sentinel: () => this.virtual ? this.renderRoot.querySelector(".sentinel") : null,
|
|
493
509
|
root: () => this.scroller,
|
|
494
510
|
loading: () => this.busy,
|
|
@@ -519,8 +535,8 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
519
535
|
}
|
|
520
536
|
static styles = [
|
|
521
537
|
F,
|
|
522
|
-
|
|
523
|
-
|
|
538
|
+
b,
|
|
539
|
+
E,
|
|
524
540
|
a`
|
|
525
541
|
:host {
|
|
526
542
|
display: block; min-inline-size: 0;
|
|
@@ -537,6 +553,9 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
537
553
|
.scroller { overflow: auto; flex: 1 1 auto; min-block-size: 0; max-block-size: inherit; overscroll-behavior-inline: contain; }
|
|
538
554
|
.scroller:focus-visible { outline: var(--bk-focus-ring); outline-offset: var(--bk-focus-offset-inset); }
|
|
539
555
|
.filter-bar { margin-block-end: var(--bk-table-filter-bar-gap, var(--bk-space-2)); }
|
|
556
|
+
/* Card mode: the sort of the cards is one select and a button for the direction, above the table. */
|
|
557
|
+
.card-sort { display: flex; align-items: end; gap: var(--bk-table-card-gap, var(--bk-space-2)); margin-block-end: var(--bk-table-card-gap, var(--bk-space-2)); }
|
|
558
|
+
.card-sort bk-select { flex: 1 1 auto; min-inline-size: 0; --bk-field-label-width: max-content; }
|
|
540
559
|
.state { padding: var(--bk-table-state-padding, var(--bk-space-4)); }
|
|
541
560
|
.sentinel { block-size: var(--bk-border-width); }
|
|
542
561
|
.probe { position: absolute; visibility: hidden; pointer-events: none; inline-size: 0; block-size: 0; margin-inline-start: var(--bk-table-cards-below, calc(var(--bk-width-panel) * 1.5)); }
|
|
@@ -547,11 +566,20 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
547
566
|
`
|
|
548
567
|
];
|
|
549
568
|
connectedCallback() {
|
|
550
|
-
super.connectedCallback(),
|
|
569
|
+
super.connectedCallback(), ee(this, ie), this.hasUpdated && this.observe();
|
|
551
570
|
}
|
|
552
571
|
disconnectedCallback() {
|
|
553
572
|
super.disconnectedCallback(), this.sizes.disconnect(), this.heads.disconnect(), this.rowLinks.disconnect(), this.observedTable = null;
|
|
554
573
|
}
|
|
574
|
+
scheduleUpdate() {
|
|
575
|
+
let e = this.lateParts();
|
|
576
|
+
return e ? e.then(() => super.scheduleUpdate()) : super.scheduleUpdate();
|
|
577
|
+
}
|
|
578
|
+
lateParts() {
|
|
579
|
+
this.busy && B.start(), this.navigation === "cell" && z.start();
|
|
580
|
+
let e = L.loaded && R.loaded ? null : this.headRow, t = this.filterable || Object.keys(this.filters ?? {}).length > 0 || !!e?.querySelector(":scope > [data-filter]"), n = this.columnMenu || this.resizable || this.reorderable || !!e?.querySelector(":scope > [data-resizable]");
|
|
581
|
+
return D(this.selection && I.start(), t && L.start(), n && R.start());
|
|
582
|
+
}
|
|
555
583
|
willUpdate(e) {
|
|
556
584
|
if (super.willUpdate(e), this.virtual && this.renderRow ? this.vc.setCount(this.rows?.length ?? 0) : this.vc.count && this.vc.setCount(0), c(this)) {
|
|
557
585
|
this.empty = this.isEmpty;
|
|
@@ -638,21 +666,21 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
638
666
|
return this.dataRows.filter((e) => e.dataset.key !== void 0);
|
|
639
667
|
}
|
|
640
668
|
get columnRows() {
|
|
641
|
-
return [...c(this)?.querySelectorAll(
|
|
669
|
+
return [...c(this)?.querySelectorAll(Y) ?? []].filter((e) => !e.hasAttribute("data-detail"));
|
|
642
670
|
}
|
|
643
671
|
appCells(e) {
|
|
644
|
-
return [...e.cells].filter((e) => !e.matches(
|
|
672
|
+
return [...e.cells].filter((e) => !e.matches(K));
|
|
645
673
|
}
|
|
646
674
|
get number() {
|
|
647
675
|
return new Intl.NumberFormat(this.i18n.locale);
|
|
648
676
|
}
|
|
649
677
|
text(e) {
|
|
650
678
|
let t = e.querySelector(":scope > .bk-table-check");
|
|
651
|
-
if (t) return
|
|
679
|
+
if (t) return X(t.textContent);
|
|
652
680
|
let n = e.querySelector(":scope > .bk-table-sort");
|
|
653
|
-
if (n) return
|
|
681
|
+
if (n) return X(n.textContent);
|
|
654
682
|
let r = e.querySelector(":scope > [data-bk-note]")?.textContent ?? "", i = e.textContent ?? "";
|
|
655
|
-
return
|
|
683
|
+
return X(r && i.endsWith(r) ? i.slice(0, -r.length) : i);
|
|
656
684
|
}
|
|
657
685
|
rowName(e) {
|
|
658
686
|
let t = this.appCells(e).find((e) => e.textContent?.trim());
|
|
@@ -688,13 +716,22 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
688
716
|
}
|
|
689
717
|
t || (t = document.createElement("button"), t.type = "button", t.setAttribute("data-bk-sort", ""), t.append(...[...e.childNodes].filter((e) => !(e instanceof Element && e.matches(".bk-table-tool, .bk-table-resize, .bk-table-sr")))), e.prepend(t)), t.classList.add("bk-table-sort");
|
|
690
718
|
let n = t.querySelector(":scope > .bk-table-sort-icon");
|
|
691
|
-
n || (n = document.createElement("bk-icon"), n.className = "bk-table-sort-icon", t.append(n));
|
|
719
|
+
n || (n = document.createElement("bk-icon"), n.className = "bk-table-sort-icon", t.append(n)), this.cards ? t.getAttribute("tabindex") !== "-1" && t.setAttribute("tabindex", "-1") : t.getAttribute("tabindex") === "-1" && t.removeAttribute("tabindex");
|
|
692
720
|
let r = e.dataset.sort === this.sortKey, i = r ? this.sortDir === "desc" ? "arrow-down" : "arrow-up" : "unfold-more";
|
|
693
721
|
n.getAttribute("name") !== i && n.setAttribute("name", i);
|
|
694
722
|
let a = r ? this.sortDir === "desc" ? "descending" : "ascending" : null;
|
|
695
723
|
a === null ? e.removeAttribute("aria-sort") : e.getAttribute("aria-sort") !== a && e.setAttribute("aria-sort", a);
|
|
696
724
|
}
|
|
697
725
|
}
|
|
726
|
+
onCardSort = (e) => {
|
|
727
|
+
e.stopPropagation();
|
|
728
|
+
let t = e.target.value, n = this.headRow && this.appCells(this.headRow).find((e) => e.dataset.sort === t);
|
|
729
|
+
n && t !== this.sortKey && this.requestSort(n);
|
|
730
|
+
};
|
|
731
|
+
onCardSortDir = () => {
|
|
732
|
+
let e = this.headRow && this.appCells(this.headRow).find((e) => e.dataset.sort === this.sortKey);
|
|
733
|
+
e && this.requestSort(e, this.sortDir === "desc" ? "asc" : "desc");
|
|
734
|
+
};
|
|
698
735
|
requestSort(e, t) {
|
|
699
736
|
let n = e.dataset.sort, r = t ?? (n === this.sortKey ? this.sortDir === "desc" ? "asc" : "desc" : e.dataset.sortDir === "desc" ? "desc" : "asc");
|
|
700
737
|
_(this, "sort", {
|
|
@@ -710,7 +747,7 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
710
747
|
if (r && r.closest("tr") === n) {
|
|
711
748
|
for (let e of t) {
|
|
712
749
|
if (e === n) break;
|
|
713
|
-
if (e === r || e instanceof Element && e.matches(
|
|
750
|
+
if (e === r || e instanceof Element && e.matches(J)) return;
|
|
714
751
|
}
|
|
715
752
|
getSelection()?.toString() || r.dispatchEvent(new MouseEvent(e.type, {
|
|
716
753
|
bubbles: !0,
|
|
@@ -811,7 +848,7 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
811
848
|
serialize(e, t, n) {
|
|
812
849
|
let r = this.headRow, i = /* @__PURE__ */ new Set(), a = r ? this.appCells(r) : [];
|
|
813
850
|
a.forEach((e, t) => e.hasAttribute("data-bk-hidden") && i.add(t));
|
|
814
|
-
let o = (e) => e.dataset.value ?? this.text(e), s = (e) => e.filter((e, t) => !i.has(t)).map((e) =>
|
|
851
|
+
let o = (e) => e.dataset.value ?? this.text(e), s = (e) => e.filter((e, t) => !i.has(t)).map((e) => re(o(e), t)).join(t), c = e.map((e) => s(this.appCells(e)));
|
|
815
852
|
return n && a.length && c.unshift(s(a)), c.join("\r\n");
|
|
816
853
|
}
|
|
817
854
|
exportRows(t) {
|
|
@@ -834,11 +871,11 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
834
871
|
let e = this.selection ? this.exportRows(!0) : [], t = "", n = "";
|
|
835
872
|
if (e.length) t = this.serialize(e, " ", !1), n = this.i18n.t("tableCopiedRows", { count: e.length });
|
|
836
873
|
else {
|
|
837
|
-
let e =
|
|
874
|
+
let e = A()?.closest?.("td, th");
|
|
838
875
|
if (!e || e.closest("bk-table") !== this || this.navigation !== "cell") return !1;
|
|
839
876
|
t = e.dataset.value ?? this.text(e), n = this.i18n.t("copied");
|
|
840
877
|
}
|
|
841
|
-
let r = await
|
|
878
|
+
let r = await te(t);
|
|
842
879
|
return r && d(n), r;
|
|
843
880
|
}
|
|
844
881
|
restoreOpen(e) {
|
|
@@ -938,10 +975,10 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
938
975
|
if (t !== this.filterable && (this.filterable = t, this.requestUpdate()), e) for (let t of this.appCells(e)) {
|
|
939
976
|
let e = this.text(t), n = this.tool(t, "filter", t.hasAttribute("data-filter"));
|
|
940
977
|
if (n) {
|
|
941
|
-
let r = !
|
|
978
|
+
let r = !Q(this.filters?.[t.dataset.filter]);
|
|
942
979
|
n.toggleAttribute("data-active", r);
|
|
943
980
|
let i = this.i18n.t(r ? "tableFilterColumnActive" : "tableFilterColumn", { column: e });
|
|
944
|
-
n.getAttribute("aria-label") !== i && n.setAttribute("aria-label", i),
|
|
981
|
+
n.getAttribute("aria-label") !== i && n.setAttribute("aria-label", i), k(n, {
|
|
945
982
|
haspopup: "dialog",
|
|
946
983
|
expanded: this.filterKey === t.dataset.filter && n === this.filterButton
|
|
947
984
|
});
|
|
@@ -949,7 +986,7 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
949
986
|
let r = this.tool(t, "menu", this.columnMenu);
|
|
950
987
|
if (r) {
|
|
951
988
|
let t = this.i18n.t("tableColumnMenu", { column: e });
|
|
952
|
-
r.getAttribute("aria-label") !== t && r.setAttribute("aria-label", t), r.hasAttribute("aria-haspopup") ||
|
|
989
|
+
r.getAttribute("aria-label") !== t && r.setAttribute("aria-label", t), r.hasAttribute("aria-haspopup") || k(r, {
|
|
953
990
|
haspopup: "menu",
|
|
954
991
|
expanded: !1
|
|
955
992
|
});
|
|
@@ -972,19 +1009,19 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
972
1009
|
filterText(e, t) {
|
|
973
1010
|
let n = this.filterField(e), r = (e) => {
|
|
974
1011
|
let t = String(e);
|
|
975
|
-
return
|
|
1012
|
+
return X(n?.querySelector(`[value="${CSS.escape(t)}"]`)?.textContent) || t;
|
|
976
1013
|
};
|
|
977
1014
|
return Array.isArray(t) ? t.map(r).join(", ") : r(t);
|
|
978
1015
|
}
|
|
979
1016
|
get filterItems() {
|
|
980
1017
|
let e = this.headRow;
|
|
981
|
-
return e ? this.appCells(e).filter((e) => e.dataset.filter && !
|
|
1018
|
+
return e ? this.appCells(e).filter((e) => e.dataset.filter && !Q(this.filters?.[e.dataset.filter])).map((e) => ({
|
|
982
1019
|
key: e.dataset.filter,
|
|
983
1020
|
label: `${this.text(e)}: ${this.filterText(e.dataset.filter, this.filters[e.dataset.filter])}`
|
|
984
1021
|
})) : [];
|
|
985
1022
|
}
|
|
986
1023
|
applyFilters(e) {
|
|
987
|
-
for (let [t, n] of Object.entries(e))
|
|
1024
|
+
for (let [t, n] of Object.entries(e)) Q(n) && delete e[t];
|
|
988
1025
|
return _(this, "filter", { filters: e }, !0) ? (this.filters = e, d(this.i18n.t("filtersActive", { count: Object.keys(e).length })), !0) : !1;
|
|
989
1026
|
}
|
|
990
1027
|
get filterPopover() {
|
|
@@ -1001,19 +1038,19 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
1001
1038
|
if (!i || !a) return;
|
|
1002
1039
|
i.style.left = i.style.top = "0px";
|
|
1003
1040
|
let o = i.getBoundingClientRect(), s = e.getBoundingClientRect(), c = this.matches(":dir(rtl)");
|
|
1004
|
-
i.style.left = `${(c ? s.right : s.left) - o.left}px`, i.style.top = `${s.bottom - o.top}px`, a.show(),
|
|
1041
|
+
i.style.left = `${(c ? s.right : s.left) - o.left}px`, i.style.top = `${s.bottom - o.top}px`, a.show(), k(t, {
|
|
1005
1042
|
haspopup: "dialog",
|
|
1006
1043
|
expanded: !0
|
|
1007
1044
|
});
|
|
1008
1045
|
}
|
|
1009
1046
|
onFilterClose = () => {
|
|
1010
1047
|
let e = this.filterButton;
|
|
1011
|
-
e &&
|
|
1048
|
+
e && k(e, {
|
|
1012
1049
|
haspopup: "dialog",
|
|
1013
1050
|
expanded: !1
|
|
1014
1051
|
});
|
|
1015
|
-
let t =
|
|
1016
|
-
e?.isConnected && (!t || t === document.body ||
|
|
1052
|
+
let t = A(), n = [...this.children].find((e) => e.getAttribute("slot") === `filter-${this.filterKey}`);
|
|
1053
|
+
e?.isConnected && (!t || t === document.body || j(n, t) || j(this.renderRoot, t)) && e.focus(), this.filterKey = void 0;
|
|
1017
1054
|
};
|
|
1018
1055
|
onFilterApply = (e) => {
|
|
1019
1056
|
let t = this.filterKey;
|
|
@@ -1124,13 +1161,13 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
1124
1161
|
return Math.max(96, this.clientWidth);
|
|
1125
1162
|
}
|
|
1126
1163
|
clampWidth(e, t = this.maxWidth()) {
|
|
1127
|
-
return Math.round(Math.min(t, Math.max(
|
|
1164
|
+
return Math.round(Math.min(t, Math.max(V, e)));
|
|
1128
1165
|
}
|
|
1129
1166
|
setValue(e, t, n = this.maxWidth()) {
|
|
1130
1167
|
let r = e.querySelector(":scope > .bk-table-resize");
|
|
1131
1168
|
if (!r) return;
|
|
1132
1169
|
let i = Math.round(t);
|
|
1133
|
-
r.setAttribute("aria-valuenow", String(i)), r.setAttribute("aria-valuemin", String(
|
|
1170
|
+
r.setAttribute("aria-valuenow", String(i)), r.setAttribute("aria-valuemin", String(V)), r.setAttribute("aria-valuemax", String(Math.max(i, Math.round(n)))), r.setAttribute("aria-valuetext", this.i18n.t("tableColumnWidth", { width: this.number.format(i) }));
|
|
1134
1171
|
}
|
|
1135
1172
|
setWidth(e, t, n) {
|
|
1136
1173
|
e.style.inlineSize = e.style.minInlineSize = `${t}px`, this.setValue(e, t, n);
|
|
@@ -1186,7 +1223,7 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
1186
1223
|
s.getAttribute("aria-label") !== l && s.setAttribute("aria-label", l);
|
|
1187
1224
|
}
|
|
1188
1225
|
for (let e of this.columnRows) for (let t of e.cells) {
|
|
1189
|
-
let e = a.has(t.cellIndex) && !t.matches(
|
|
1226
|
+
let e = a.has(t.cellIndex) && !t.matches(K);
|
|
1190
1227
|
t.hasAttribute("data-bk-hidden") !== e && t.toggleAttribute("data-bk-hidden", e);
|
|
1191
1228
|
}
|
|
1192
1229
|
i !== this.resizable && (this.resizable = i), this.syncPins(e);
|
|
@@ -1215,7 +1252,7 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
1215
1252
|
if (e.button !== 0) return;
|
|
1216
1253
|
e.preventDefault(), n.focus(), n.setPointerCapture(e.pointerId);
|
|
1217
1254
|
let r = t.offsetWidth, i = e.clientX, a = this.maxWidth(), o = this.matches(":dir(rtl)") ? -1 : 1, s = !1, c = (e) => {
|
|
1218
|
-
!s && Math.abs(e.clientX - i) <
|
|
1255
|
+
!s && Math.abs(e.clientX - i) < W || (s || n.setAttribute("data-dragging", ""), s = !0, this.setWidth(t, this.clampWidth(r + o * (e.clientX - i), a), a), this.syncPins(t.parentElement));
|
|
1219
1256
|
}, l = (e) => {
|
|
1220
1257
|
n.removeEventListener("pointermove", c), n.removeEventListener("pointerup", l), n.removeEventListener("pointercancel", l), n.removeAttribute("data-dragging"), s ? this.saveWidth(t, t.offsetWidth) : e.type === "pointerup" && this.openColumnMenu(t, "resize", null, e.clientX, e.clientY);
|
|
1221
1258
|
};
|
|
@@ -1230,7 +1267,7 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
1230
1267
|
}
|
|
1231
1268
|
if (!["ArrowLeft", "ArrowRight"].includes(e.key)) return;
|
|
1232
1269
|
e.preventDefault(), e.stopPropagation();
|
|
1233
|
-
let r = e.key === "ArrowRight" !== this.matches(":dir(rtl)"), i = e.shiftKey ?
|
|
1270
|
+
let r = e.key === "ArrowRight" !== this.matches(":dir(rtl)"), i = e.shiftKey ? U : H;
|
|
1234
1271
|
this.resizeTo(n, n.offsetWidth + (r ? i : -i));
|
|
1235
1272
|
}
|
|
1236
1273
|
get columnMenuEl() {
|
|
@@ -1239,7 +1276,7 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
1239
1276
|
async openColumnMenu(e, t, n, r, i) {
|
|
1240
1277
|
if (this.menuColumn = e, this.menuKind = t, this.requestUpdate(), await this.updateComplete, n) {
|
|
1241
1278
|
let e = n.getBoundingClientRect();
|
|
1242
|
-
r = this.matches(":dir(rtl)") ? e.right : e.left, i = e.bottom,
|
|
1279
|
+
r = this.matches(":dir(rtl)") ? e.right : e.left, i = e.bottom, k(n, {
|
|
1243
1280
|
haspopup: "menu",
|
|
1244
1281
|
expanded: !0
|
|
1245
1282
|
});
|
|
@@ -1248,7 +1285,7 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
1248
1285
|
}
|
|
1249
1286
|
onColumnMenuClose = () => {
|
|
1250
1287
|
let e = this.menuColumn?.querySelector(":scope > .bk-table-menu");
|
|
1251
|
-
e &&
|
|
1288
|
+
e && k(e, {
|
|
1252
1289
|
haspopup: "menu",
|
|
1253
1290
|
expanded: !1
|
|
1254
1291
|
});
|
|
@@ -1259,7 +1296,7 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
1259
1296
|
if (!t?.isConnected) return;
|
|
1260
1297
|
let n = e.detail.value, r = this.headRow, i = this.matches(":dir(rtl)");
|
|
1261
1298
|
if (n === "reset") return this.resetWidth(t);
|
|
1262
|
-
if (n === "wider" || n === "narrower") e.preventDefault(), this.resizeTo(t, t.offsetWidth + (n === "wider" ?
|
|
1299
|
+
if (n === "wider" || n === "narrower") e.preventDefault(), this.resizeTo(t, t.offsetWidth + (n === "wider" ? H : -16));
|
|
1263
1300
|
else {
|
|
1264
1301
|
if (n === "sort-asc" || n === "sort-desc") return this.requestSort(t, n === "sort-asc" ? "asc" : "desc");
|
|
1265
1302
|
if (n === "pin-start" || n === "pin-end" || n === "unpin") {
|
|
@@ -1413,7 +1450,7 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
1413
1450
|
e.preventDefault(), t.focus(), t.setPointerCapture(e.pointerId);
|
|
1414
1451
|
let r = e.clientY, i = !1, a = [], o = (e) => {
|
|
1415
1452
|
if (!i) {
|
|
1416
|
-
if (Math.abs(e.clientY - r) <
|
|
1453
|
+
if (Math.abs(e.clientY - r) < W) return;
|
|
1417
1454
|
let t = this.startLift(n, "pointer");
|
|
1418
1455
|
if (!t) return;
|
|
1419
1456
|
i = !0, a = t.rows.map((e) => {
|
|
@@ -1429,7 +1466,7 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
1429
1466
|
t.addEventListener("pointermove", o), t.addEventListener("pointerup", s), t.addEventListener("pointercancel", s);
|
|
1430
1467
|
};
|
|
1431
1468
|
openRowMenu(e, t) {
|
|
1432
|
-
this.handleRow = e, this.requestUpdate(),
|
|
1469
|
+
this.handleRow = e, this.requestUpdate(), T(this, t);
|
|
1433
1470
|
}
|
|
1434
1471
|
get rowActions() {
|
|
1435
1472
|
let e = this.handleRow;
|
|
@@ -1474,7 +1511,7 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
1474
1511
|
let e = this.table, t = this.navigation === "cell", n = this.cards;
|
|
1475
1512
|
this.setRole(e, this.tree ? "treegrid" : t ? "grid" : n ? "table" : null);
|
|
1476
1513
|
for (let t of e.querySelectorAll(":scope > :is(thead, tbody, tfoot)")) this.setRole(t, n ? "rowgroup" : null);
|
|
1477
|
-
for (let e of this.querySelectorAll(
|
|
1514
|
+
for (let e of this.querySelectorAll(Y)) {
|
|
1478
1515
|
this.setRole(e, n ? "row" : null);
|
|
1479
1516
|
let r = e.parentElement?.localName === "thead";
|
|
1480
1517
|
for (let i of e.cells) i.localName === "td" ? this.setRole(i, t || this.tree ? "gridcell" : n ? "cell" : null) : this.setRole(i, n ? r || i.getAttribute("scope") === "col" ? "columnheader" : "rowheader" : null);
|
|
@@ -1492,7 +1529,7 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
1492
1529
|
} else e.hasAttribute("data-bk-tabindex") || e.setAttribute("data-bk-tabindex", e.getAttribute("tabindex") ?? ""), e.getAttribute("tabindex") !== String(t) && e.setAttribute("tabindex", String(t));
|
|
1493
1530
|
}
|
|
1494
1531
|
widgets(e) {
|
|
1495
|
-
return [...e.querySelectorAll(
|
|
1532
|
+
return [...e.querySelectorAll(q)].filter((t) => !t.closest(".bk-table-editor") && !t.closest(".bk-table-sr") && t.closest("td, th") === e);
|
|
1496
1533
|
}
|
|
1497
1534
|
target(e) {
|
|
1498
1535
|
let t = this.widgets(e);
|
|
@@ -1563,7 +1600,7 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
1563
1600
|
}
|
|
1564
1601
|
pageRows() {
|
|
1565
1602
|
let e = this.scroller, t = this.dataRows[0];
|
|
1566
|
-
return !e || !t || e.scrollHeight <= e.clientHeight ?
|
|
1603
|
+
return !e || !t || e.scrollHeight <= e.clientHeight ? G : Math.max(1, Math.floor(e.clientHeight / Math.max(1, t.offsetHeight)) - 1);
|
|
1567
1604
|
}
|
|
1568
1605
|
async onGridKey(e, t) {
|
|
1569
1606
|
let n = t.parentElement, r = this.matches(":dir(rtl)"), i = e.ctrlKey || e.metaKey, a = this.visibleCells(n).indexOf(t), [o, s] = this.rowIndex(n), c = o, l = a;
|
|
@@ -1645,12 +1682,14 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
1645
1682
|
}
|
|
1646
1683
|
async startEdit(e) {
|
|
1647
1684
|
if (this.editing || !e.hasAttribute("data-editable") || this.navigation !== "cell") return;
|
|
1648
|
-
let t =
|
|
1649
|
-
|
|
1685
|
+
let t = z.start();
|
|
1686
|
+
if (t && (await t, this.editing)) return;
|
|
1687
|
+
let n = this.headOf(e), r = e.dataset.value ?? this.text(e), i = document.createElement(e.dataset.field === "number" ? "bk-input-number" : "bk-input-text");
|
|
1688
|
+
i.className = "bk-table-editor", i.setAttribute("size", "sm"), i.setAttribute("aria-label", n ? this.text(n) : ""), i.value = r, e.setAttribute("data-bk-editing", ""), e.append(i), this.editing = {
|
|
1650
1689
|
cell: e,
|
|
1651
|
-
field:
|
|
1652
|
-
old:
|
|
1653
|
-
}, await
|
|
1690
|
+
field: i,
|
|
1691
|
+
old: r
|
|
1692
|
+
}, await i.updateComplete, i.focus(), (i.shadowRoot?.querySelector("input"))?.select?.();
|
|
1654
1693
|
}
|
|
1655
1694
|
commitEdit(e, t = !0) {
|
|
1656
1695
|
let n = this.editing;
|
|
@@ -1783,8 +1822,8 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
1783
1822
|
});
|
|
1784
1823
|
}
|
|
1785
1824
|
syncCheck(e, t) {
|
|
1786
|
-
let n = e.querySelector(":scope > .bk-table-check"), r = e.querySelector(":scope > [data-bk-check-value]"), i = (t ? e.dataset.value ?? [...e.childNodes].filter((e) => e !== n && e.nodeType !== Node.COMMENT_NODE).map((e) => e.textContent).join("") : "").trim().toLowerCase(), a = [this.i18n.t("tableYes"), this.i18n.t("tableNo")].map((e) => e.toLowerCase()), o =
|
|
1787
|
-
if (!(t && (o ||
|
|
1825
|
+
let n = e.querySelector(":scope > .bk-table-check"), r = e.querySelector(":scope > [data-bk-check-value]"), i = (t ? e.dataset.value ?? [...e.childNodes].filter((e) => e !== n && e.nodeType !== Node.COMMENT_NODE).map((e) => e.textContent).join("") : "").trim().toLowerCase(), a = [this.i18n.t("tableYes"), this.i18n.t("tableNo")].map((e) => e.toLowerCase()), o = Z.has(i) || i === a[0];
|
|
1826
|
+
if (!(t && (o || ne.has(i) || i === a[1]))) {
|
|
1788
1827
|
if (!n) return;
|
|
1789
1828
|
n.remove(), r?.replaceWith(...r.childNodes), e.removeAttribute("data-bk-check");
|
|
1790
1829
|
return;
|
|
@@ -1839,7 +1878,7 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
1839
1878
|
let n = c(this)?.querySelector(":scope > table > thead"), r = c(this)?.querySelector(":scope > table > tfoot"), i = this.stickyHeader && n ? `${n.offsetHeight}px` : "", a = this.stickyFooter && r ? `${r.offsetHeight}px` : "";
|
|
1840
1879
|
e && e.style.scrollPaddingBlockStart !== i && (e.style.scrollPaddingBlockStart = i), e && e.style.scrollPaddingBlockEnd !== a && (e.style.scrollPaddingBlockEnd = a);
|
|
1841
1880
|
let o = this.renderRoot.querySelector(".probe"), s = this.responsive === "cards" && !!o && this.clientWidth > 0 && this.clientWidth < parseFloat(getComputedStyle(o).marginInlineStart);
|
|
1842
|
-
s !== this.cards && (s ? this.internals.states.add("cards") : this.internals.states.delete("cards"), this.syncAll());
|
|
1881
|
+
s !== this.cards && (s ? this.internals.states.add("cards") : this.internals.states.delete("cards"), this.syncAll(), this.requestUpdate(), s && this.sortable && import("./bk-select.js"));
|
|
1843
1882
|
let l = this.headRow;
|
|
1844
1883
|
l && l.querySelector("[data-pin]") && this.syncPins(l);
|
|
1845
1884
|
}
|
|
@@ -1848,8 +1887,19 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
1848
1887
|
return this.label || e || this.i18n.t("table");
|
|
1849
1888
|
}
|
|
1850
1889
|
render() {
|
|
1851
|
-
let t = this.menuColumn ? this.text(this.menuColumn) : "", r = this.filterItems, i = this.slots.has("error"), a = this.empty && !this.busy && !i && this.slots.has("empty"), o = this.filterKey ? this.headRow && this.appCells(this.headRow).find((e) => e.dataset.filter === this.filterKey) : null, s = this.i18n.t("tableFilterColumn", { column: o ? this.text(o) : "" })
|
|
1852
|
-
|
|
1890
|
+
let t = this.menuColumn ? this.text(this.menuColumn) : "", r = this.filterItems, i = this.slots.has("error"), a = this.empty && !this.busy && !i && this.slots.has("empty"), o = this.filterKey ? this.headRow && this.appCells(this.headRow).find((e) => e.dataset.filter === this.filterKey) : null, s = this.i18n.t("tableFilterColumn", { column: o ? this.text(o) : "" }), c = this.sortable && this.cards && this.headRow ? this.appCells(this.headRow).filter((e) => e.dataset.sort).map((e) => ({
|
|
1891
|
+
key: e.dataset.sort,
|
|
1892
|
+
text: this.text(e) || e.dataset.sort
|
|
1893
|
+
})) : [], l = this.sortDir === "desc";
|
|
1894
|
+
return e`${c.length ? e`<div class="card-sort" part="card-sort">
|
|
1895
|
+
<bk-select size="sm" label-position="start" label=${this.i18n.t("tableSortBy")} placeholder=${this.sortKey ? n : this.i18n.t("tableSortBy")}
|
|
1896
|
+
.value=${this.sortKey ?? ""} @input=${(e) => e.stopPropagation()} @change=${this.onCardSort}>
|
|
1897
|
+
${c.map((t) => e`<option value=${t.key}>${t.text}</option>`)}
|
|
1898
|
+
</bk-select>
|
|
1899
|
+
<bk-button size="sm" variant="outline" icon=${l ? "arrow-down" : "arrow-up"} ?disabled=${!this.sortKey}
|
|
1900
|
+
label=${this.i18n.t(l ? "tableSortAscending" : "tableSortDescending")} @click=${this.onCardSortDir}></bk-button>
|
|
1901
|
+
</div>` : n}
|
|
1902
|
+
${r.length ? e`<bk-filter-bar class="filter-bar" part="filter-bar" .items=${r}
|
|
1853
1903
|
@remove=${this.onFilterRemove} @clear=${this.onFilterClear}></bk-filter-bar>` : n}
|
|
1854
1904
|
<div class="frame">
|
|
1855
1905
|
<div class="scroller" part="scroller" tabindex=${this.scrolling ? "0" : n} ?inert=${this.busyState.inert && !this.empty}
|
|
@@ -1880,8 +1930,8 @@ var I = 48, L = 16, R = 64, z = 3, B = 10, V = "[data-bk-select], [data-bk-handl
|
|
|
1880
1930
|
</div>
|
|
1881
1931
|
</div>
|
|
1882
1932
|
</bk-popover></div>` : n}
|
|
1883
|
-
${this.reorderable ?
|
|
1933
|
+
${this.reorderable ? O(this.handleRow ? this.i18n.t("sortableHandle", { item: this.rowName(this.handleRow) }) : "", this.rowActions) : n}`;
|
|
1884
1934
|
}
|
|
1885
1935
|
};
|
|
1886
|
-
u("bk-table",
|
|
1887
|
-
export {
|
|
1936
|
+
u("bk-table", $);
|
|
1937
|
+
export { $ as BkTable };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as e, n as t, u as n } from "./chunks/lit-D8x-qXgH.js";
|
|
2
2
|
import { n as r, t as i } from "./chunks/define-CzVPD4Zi.js";
|
|
3
3
|
import { n as a } from "./chunks/events-DQ4e9cPN.js";
|
|
4
|
-
import { t as o } from "./chunks/i18n-
|
|
4
|
+
import { t as o } from "./chunks/i18n-B6Al9xCK.js";
|
|
5
5
|
import { n as s, t as c } from "./chunks/choice-item-B6-9ZRlf.js";
|
|
6
6
|
import { x as l } from "./chunks/styles-DwSR-9a3.js";
|
|
7
7
|
import "./chunks/bk-icon-DssFsNuB.js";
|
|
@@ -4,7 +4,7 @@ import { i as a, n as o, r as s, t as c } from "./chunks/define-CzVPD4Zi.js";
|
|
|
4
4
|
import { i as l, n as u } from "./chunks/anchor-CNX3nt2F.js";
|
|
5
5
|
import { n as d, t as f } from "./chunks/events-DQ4e9cPN.js";
|
|
6
6
|
import { a as p } from "./chunks/link-CWSMsx04.js";
|
|
7
|
-
import { t as m } from "./chunks/i18n-
|
|
7
|
+
import { t as m } from "./chunks/i18n-B6Al9xCK.js";
|
|
8
8
|
import { t as h } from "./chunks/state-XYmTmnOw.js";
|
|
9
9
|
import { t as g, v as _ } from "./chunks/styles-DwSR-9a3.js";
|
|
10
10
|
import { BkTabsItem as v } from "./bk-tabs-item.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
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/define-CzVPD4Zi.js";
|
|
3
|
-
import { t as a } from "./chunks/i18n-
|
|
3
|
+
import { t as a } from "./chunks/i18n-B6Al9xCK.js";
|
|
4
4
|
import { i as o } from "./chunks/events-DQ4e9cPN.js";
|
|
5
5
|
import { t as s } from "./chunks/slots-BHTtBbPo.js";
|
|
6
6
|
import { t as c, v as l, x as u } from "./chunks/styles-DwSR-9a3.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as e, n as t, t as n, u as r } from "./chunks/lit-D8x-qXgH.js";
|
|
2
2
|
import { i, n as a, r as o, t as s } from "./chunks/define-CzVPD4Zi.js";
|
|
3
|
-
import { t as c } from "./chunks/i18n-
|
|
3
|
+
import { t as c } from "./chunks/i18n-B6Al9xCK.js";
|
|
4
4
|
import { i as l } from "./chunks/events-DQ4e9cPN.js";
|
|
5
5
|
import { h as u, o as d, t as f } from "./chunks/styles-DwSR-9a3.js";
|
|
6
6
|
import { t as p } from "./chunks/slots-BHTtBbPo.js";
|
|
@@ -2,7 +2,7 @@ import { a as e, t, u as n } from "./chunks/lit-D8x-qXgH.js";
|
|
|
2
2
|
import { t as r } from "./chunks/announcer-haFcvqbe.js";
|
|
3
3
|
import { t as i } from "./chunks/define-CzVPD4Zi.js";
|
|
4
4
|
import { t as a } from "./chunks/events-DQ4e9cPN.js";
|
|
5
|
-
import { t as o } from "./chunks/i18n-
|
|
5
|
+
import { t as o } from "./chunks/i18n-B6Al9xCK.js";
|
|
6
6
|
import { t as s, x as c } from "./chunks/styles-DwSR-9a3.js";
|
|
7
7
|
import { i as l, s as u } from "./chunks/format-Dj4SzErj.js";
|
|
8
8
|
// dist/components/bk-time-countdown.js
|
|
@@ -1,6 +1,6 @@
|
|
|
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-
|
|
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 { a as o, i as s, o as c, r as l, s as u } from "./chunks/format-Dj4SzErj.js";
|
|
6
6
|
// dist/components/bk-time-relative.js
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./chunks/heading-text-CV5gBf7k.js";
|
|
2
2
|
import { a as t, n, t as r, u as i } from "./chunks/lit-D8x-qXgH.js";
|
|
3
3
|
import { t as a } from "./chunks/define-CzVPD4Zi.js";
|
|
4
|
-
import { t as o } from "./chunks/i18n-
|
|
4
|
+
import { t as o } from "./chunks/i18n-B6Al9xCK.js";
|
|
5
5
|
import { r as s, s as c } from "./chunks/format-Dj4SzErj.js";
|
|
6
6
|
import { t as l } from "./chunks/slots-BHTtBbPo.js";
|
|
7
7
|
import { t as u } from "./chunks/styles-DwSR-9a3.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { t as BkToastGroup, n as toast } from "./chunks/bk-toast-group-
|
|
1
|
+
export { t as BkToastGroup, n as toast } from "./chunks/bk-toast-group-BSeO_rPs.js";
|
|
2
2
|
import "./bk-toast.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
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/define-CzVPD4Zi.js";
|
|
3
|
-
import { t as a } from "./chunks/i18n-
|
|
3
|
+
import { t as a } from "./chunks/i18n-B6Al9xCK.js";
|
|
4
4
|
import { a as o, i as s, n as c, r as l, t as u } from "./chunks/message--qZJ4Gw7.js";
|
|
5
5
|
import { t as d } from "./chunks/slots-BHTtBbPo.js";
|
|
6
6
|
import { t as f } from "./chunks/styles-DwSR-9a3.js";
|
|
@@ -2,7 +2,7 @@ import { a as e, n as t, t as n, u as r } from "./chunks/lit-D8x-qXgH.js";
|
|
|
2
2
|
import { a as i, i as a, s as o, t as s } from "./chunks/anchor-CNX3nt2F.js";
|
|
3
3
|
import { t as c } from "./chunks/define-CzVPD4Zi.js";
|
|
4
4
|
import { t as l } from "./chunks/styles-DwSR-9a3.js";
|
|
5
|
-
import { l as u, n as d } from "./chunks/bk-kbd-
|
|
5
|
+
import { l as u, n as d } from "./chunks/bk-kbd-B_TlKzWj.js";
|
|
6
6
|
// dist/components/bk-tooltip.js
|
|
7
7
|
var f = 100, p = 300, m = null, h = 0, g = class extends n {
|
|
8
8
|
static properties = {
|