bitboss-ui 3.0.0-beta.75 → 3.0.0-beta.76
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/README.md +5 -5
- package/bin/cli.mjs +16 -10
- package/dist/ai/BbAlert.md +1 -1
- package/dist/ai/BbBreadcrumbs.md +1 -1
- package/dist/ai/BbButton.md +2 -2
- package/dist/ai/BbColorInput.md +1 -1
- package/dist/ai/BbColorPalette.md +1 -1
- package/dist/ai/BbConfirm.md +1 -1
- package/dist/ai/BbDatePicker.md +1 -1
- package/dist/ai/BbDatePickerInput.md +1 -1
- package/dist/ai/BbDialog.md +3 -2
- package/dist/ai/BbDropdown.md +23 -21
- package/dist/ai/BbDropdownButton.md +13 -11
- package/dist/ai/BbGallery.md +3 -2
- package/dist/ai/BbIcon.md +10 -10
- package/dist/ai/BbOffCanvas.md +3 -2
- package/dist/ai/BbPopover.md +1 -1
- package/dist/ai/BbSelect.md +153 -43
- package/dist/ai/BbSelectPopover.md +115 -9
- package/dist/ai/BbTable.md +1 -1
- package/dist/ai/BbTimePicker.md +1 -1
- package/dist/ai/BbTimePickerInput.md +1 -1
- package/dist/ai/GroupedListBox.md +2 -2
- package/dist/ai/ListBox.md +3 -2
- package/dist/ai/changelog.json +153 -7
- package/dist/ai/components.json +12 -12
- package/dist/ai/guides/agent-contract.md +1 -1
- package/dist/ai/guides/calendars-and-digits.md +1 -1
- package/dist/ai/guides/eslint-rules.md +1 -1
- package/dist/ai/guides/icons-policy.md +32 -11
- package/dist/ai/guides/installation-and-plugin-setup.md +24 -23
- package/dist/ai/guides/migration/adoption-checklist.md +1 -1
- package/dist/ai/guides/migration/components/bb-icon.md +4 -4
- package/dist/ai/guides/migration/v2-to-v3.md +48 -19
- package/dist/ai/guides/migration/v3-beta-css-classes.md +18 -3
- package/dist/ai/guides/passthrough.md +58 -58
- package/dist/ai/helpers/inertia/manifest.json +1 -1
- package/dist/ai/manifest/components/BbDialog.tree.json +1 -1
- package/dist/ai/manifest/components/BbDropdown.json +19 -17
- package/dist/ai/manifest/components/BbDropdown.tree.json +9 -9
- package/dist/ai/manifest/components/BbDropdownButton.json +12 -10
- package/dist/ai/manifest/components/BbDropdownButton.tree.json +2 -0
- package/dist/ai/manifest/components/BbGallery.tree.json +1 -1
- package/dist/ai/manifest/components/BbOffCanvas.tree.json +1 -1
- package/dist/ai/manifest/components/BbSelect.json +44 -40
- package/dist/ai/manifest/components/BbSelect.tree.json +2 -1
- package/dist/ai/manifest/components/BbSelectPopover.json +10 -6
- package/dist/ai/manifest/components/BbSelectPopover.tree.json +4 -1
- package/dist/ai/manifest/components/BbTable.tree.json +5 -1
- package/dist/ai/manifest/components/GroupedListBox.json +1 -1
- package/dist/ai/manifest/components/GroupedListBox.tree.json +1 -0
- package/dist/ai/manifest/components/ListBox.json +1 -1
- package/dist/ai/manifest/components/ListBox.tree.json +1 -1
- package/dist/ai/manifest/index.json +2 -2
- package/dist/ai/recipes/inertia/inline-edit-workspace.md +1 -1
- package/dist/ai/recipes/inertia/onboarding.md +1 -1
- package/dist/ai/recipes/nuxt/inline-edit-workspace.md +1 -1
- package/dist/ai/recipes/nuxt/onboarding.md +1 -1
- package/dist/ai/recipes/vue/inline-edit-workspace.md +1 -1
- package/dist/ai/recipes/vue/onboarding.md +2 -2
- package/dist/ai/source/BbAccordion.md +4 -5
- package/dist/ai/source/BbAvatar.md +9 -2
- package/dist/ai/source/BbBadge.md +6 -2
- package/dist/ai/source/BbBreadcrumbs.md +5 -2
- package/dist/ai/source/BbCalendar.md +8 -6
- package/dist/ai/source/BbCarousel.md +10 -6
- package/dist/ai/source/BbColorPalette.md +5 -2
- package/dist/ai/source/BbDatePickerInput.md +7 -2
- package/dist/ai/source/BbDropdown.md +91 -66
- package/dist/ai/source/BbDropdownButton.md +36 -19
- package/dist/ai/source/BbDropdownGroup.md +91 -66
- package/dist/ai/source/BbGallery.md +6 -5
- package/dist/ai/source/BbPagination.md +12 -28
- package/dist/ai/source/BbRating.md +4 -4
- package/dist/ai/source/BbSelect.md +130 -106
- package/dist/ai/source/BbSelectPopover.md +128 -21
- package/dist/ai/source/BbTable.md +42 -9
- package/dist/ai/source/BbTimePickerInput.md +6 -2
- package/dist/ai/source/ClearableButton.md +4 -2
- package/dist/ai/source/ErrorIcon.md +4 -3
- package/dist/ai/source/FlatListBox.md +7 -2
- package/dist/ai/source/GroupedListBox.md +22 -3
- package/dist/ai/source/ListBox.md +7 -1
- package/dist/ai/source/WarningIcon.md +4 -3
- package/dist/assets/svgs/close.svg_raw.js +1 -1
- package/dist/components/BbAccordion/BbAccordion.vue.d.ts +1 -1
- package/dist/components/BbAccordion/BbAccordion.vue_vue_type_script_setup_true_lang.js +35 -34
- package/dist/components/BbAvatar/BbAvatar.vue_vue_type_script_setup_true_lang.js +48 -47
- package/dist/components/BbBadge/BbBadge.vue_vue_type_script_setup_true_lang.js +60 -59
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +128 -127
- package/dist/components/BbCalendar/BbCalendar.vue.d.ts +1 -1
- package/dist/components/BbCalendar/BbCalendar.vue_vue_type_script_setup_true_lang.js +240 -239
- package/dist/components/BbCarousel/BbCarousel.vue_vue_type_script_setup_true_lang.js +500 -499
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +4 -4
- package/dist/components/BbColorPalette/BbColorPalette.vue_vue_type_script_setup_true_lang.js +175 -174
- package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +1 -1
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +2 -2
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +263 -262
- package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +81 -80
- package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +4 -0
- package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +318 -312
- package/dist/components/BbDropdown/DropdownRow.vue_vue_type_script_setup_true_lang.js +47 -46
- package/dist/components/BbDropdown/ptKeys.generated.d.ts +36 -20
- package/dist/components/BbDropdown/types.d.ts +51 -53
- package/dist/components/BbDropdown/types.js +2 -0
- package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +1 -1
- package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +74 -59
- package/dist/components/BbDropdownButton/ptKeys.generated.d.ts +111 -63
- package/dist/components/BbDropdownButton/types.d.ts +12 -10
- package/dist/components/BbDropdownButton/types.js +2 -0
- package/dist/components/BbDropzone/BbDropzone.vue.d.ts +1 -1
- package/dist/components/BbGallery/BbGallery.vue_vue_type_script_setup_true_lang.js +204 -203
- package/dist/components/BbIcon/iconCache.js +1 -1
- package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +1 -1
- package/dist/components/BbPagination/BbPagination.vue.d.ts +2 -2
- package/dist/components/BbPagination/BbPagination.vue_vue_type_script_setup_true_lang.js +138 -136
- package/dist/components/BbProgress/BbProgress.vue.d.ts +1 -1
- package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +4 -4
- package/dist/components/BbRating/BbRating.vue.d.ts +1 -1
- package/dist/components/BbRating/BbRating.vue_vue_type_script_setup_true_lang.js +100 -99
- package/dist/components/BbSelect/BbSelect.vue.d.ts +30 -20
- package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +201 -184
- package/dist/components/BbSelect/ptKeys.generated.d.ts +128 -96
- package/dist/components/BbSelect/types.d.ts +101 -105
- package/dist/components/BbSelect/types.js +1 -27
- package/dist/components/BbSelectPopover/BbSelectPopover.vue.d.ts +6 -3
- package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +617 -585
- package/dist/components/BbSelectPopover/ptKeys.generated.d.ts +22 -10
- package/dist/components/BbSelectPopover/types.d.ts +22 -13
- package/dist/components/BbSelectPopover/types.js +3 -1
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +1 -1
- package/dist/components/BbTable/BbTable.vue.d.ts +1 -1
- package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +1092 -1090
- package/dist/components/BbTable/BbTableDataRow.js +97 -90
- package/dist/components/BbTabs/BbTabs.vue.d.ts +3 -3
- package/dist/components/BbTimePicker/BbTimePicker.vue.d.ts +2 -2
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue.d.ts +2 -2
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +225 -224
- package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +76 -75
- package/dist/components/ClearableButton/ClearableButton.vue_vue_type_script_setup_true_lang.js +9 -8
- package/dist/components/CloseIcon/CloseButton.vue.js +1 -1
- package/dist/components/CloseIcon/CloseButton.vue_vue_type_script_setup_true_lang.js +9 -7
- package/dist/components/ErrorIcon/ErrorIcon.vue_vue_type_script_setup_true_lang.js +8 -6
- package/dist/components/FlatListBox/FlatListBox.vue_vue_type_script_setup_true_lang.js +69 -68
- package/dist/components/GroupedListBox/GroupedListBox.vue_vue_type_script_setup_true_lang.js +166 -165
- package/dist/components/WarningIcon/WarningIcon.vue_vue_type_script_setup_true_lang.js +8 -6
- package/dist/composables/useInternalIcon.js +25 -0
- package/dist/icon-scan.d.ts +1 -1
- package/dist/llms-full.txt +477 -187
- package/dist/llms-medium.txt +25 -24
- package/dist/llms.txt +1 -1
- package/dist/nuxt.js +1 -1
- package/dist/styles.css +2 -2
- package/dist/types/Config.d.ts +8 -1
- package/dist/types/ConfigDefaults.d.ts +10 -2
- package/dist/types/internalIcons.d.ts +89 -0
- package/dist/types/internalIcons.js +158 -0
- package/dist/types/ptComponentMap.d.ts +4 -4
- package/dist/utils/configDefaults.js +75 -64
- package/dist/utils/iconsOption.js +48 -0
- package/dist/utils/versionCheck.js +1 -1
- package/dist/vite-plugin.d.ts +10 -16
- package/dist/vite.js +319 -306
- package/llms.txt +1 -1
- package/package.json +1 -1
- package/scripts/lib/adoption-checklist.json +1 -1
- package/scripts/lib/update-install.mjs +48 -0
- package/scripts/lib/validate-bb-markup.mjs +73 -12
- package/dist/assets/svgs/caret_down.svg_raw.js +0 -3
|
@@ -40,28 +40,29 @@ import { escapeStackDepth as Ze, isTopEscapeEntry as Qe, pushEscapeEntry as $e,
|
|
|
40
40
|
import { GRID_FOCUSABLE as tt, GRID_MANAGED_ATTR as nt, cellWidgets as rt, restoreTabOrder as it, takeOutOfTabOrder as at } from "./gridWidgets.js";
|
|
41
41
|
import ot from "../BbBaseButton/BbBaseButton.vue.js";
|
|
42
42
|
import { runRetry as st } from "../../utils/loadRetry.js";
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
43
|
+
import { useInternalIcon as ct } from "../../composables/useInternalIcon.js";
|
|
44
|
+
import { Fragment as lt, computed as m, createBlock as ut, createCommentVNode as h, createElementBlock as g, createElementVNode as _, createTextVNode as dt, createVNode as ft, defineComponent as v, getCurrentInstance as pt, guardReactiveProps as mt, isReactive as ht, mergeModels as gt, mergeProps as y, nextTick as b, normalizeClass as _t, normalizeProps as vt, normalizeStyle as yt, onBeforeUnmount as x, onBeforeUpdate as bt, onDeactivated as xt, onMounted as St, onUpdated as Ct, openBlock as S, reactive as wt, ref as C, renderList as Tt, renderSlot as Et, resolveDynamicComponent as Dt, shallowRef as Ot, toDisplayString as w, toRaw as kt, toRef as At, unref as T, useAttrs as jt, useModel as Mt, useSlots as Nt, watch as E, watchEffect as Pt, withCtx as Ft, withModifiers as It } from "vue";
|
|
45
|
+
import { defaultRangeExtractor as Lt, elementScroll as Rt, observeElementOffset as zt, observeElementRect as Bt, observeWindowOffset as Vt, observeWindowRect as Ht, useVirtualizer as Ut, windowScroll as Wt } from "@tanstack/vue-virtual";
|
|
45
46
|
// src/components/BbTable/BbTable.vue?vue&type=script&setup=true&lang.ts
|
|
46
|
-
var
|
|
47
|
+
var Gt = {
|
|
47
48
|
key: 0,
|
|
48
49
|
class: "bb-sr-only"
|
|
49
|
-
},
|
|
50
|
+
}, Kt = ["id", "hidden"], qt = ["id"], Jt = ["id"], Yt = {
|
|
50
51
|
"aria-live": "polite",
|
|
51
52
|
class: "bb-table-loading__text bb-sr-only",
|
|
52
53
|
role: "status"
|
|
53
|
-
},
|
|
54
|
+
}, Xt = ["id"], Zt = {
|
|
54
55
|
"aria-live": "polite",
|
|
55
56
|
class: "bb-table__row-reorder-status bb-sr-only",
|
|
56
57
|
role: "status"
|
|
57
|
-
},
|
|
58
|
+
}, Qt = {
|
|
58
59
|
"aria-live": "polite",
|
|
59
60
|
class: "bb-table__reorder-status bb-sr-only",
|
|
60
61
|
role: "status"
|
|
61
|
-
},
|
|
62
|
+
}, $t = ["inert"], en = ["aria-rowindex"], tn = ["tabindex"], nn = { class: "bb-table-header__content bb-sr-only" }, rn = ["tabindex"], an = { class: "bb-table-header__content" }, on = { class: "bb-table-check__label-text bb-sr-only" }, sn = {
|
|
62
63
|
key: 1,
|
|
63
64
|
class: "bb-table-radio__label-text bb-sr-only"
|
|
64
|
-
},
|
|
65
|
+
}, cn = [
|
|
65
66
|
"aria-describedby",
|
|
66
67
|
"aria-sort",
|
|
67
68
|
"data-column-key",
|
|
@@ -70,34 +71,34 @@ var Wt = {
|
|
|
70
71
|
"onFocus",
|
|
71
72
|
"onKeydown",
|
|
72
73
|
"onMousedown"
|
|
73
|
-
],
|
|
74
|
+
], ln = { class: "bb-table-header__content" }, un = {
|
|
74
75
|
key: 1,
|
|
75
76
|
class: "bb-table-header__content"
|
|
76
|
-
},
|
|
77
|
+
}, dn = ["onDblclick", "onPointerdown"], fn = ["tabindex"], pn = { class: "bb-table-header__content bb-sr-only" }, mn = ["aria-rowindex"], hn = ["role"], gn = ["role"], _n = ["role"], vn = {
|
|
77
78
|
key: 0,
|
|
78
79
|
class: "bb-table-skeleton__cell-content"
|
|
79
|
-
},
|
|
80
|
+
}, yn = {
|
|
80
81
|
key: 1,
|
|
81
82
|
class: "bb-table-skeleton__avatar"
|
|
82
|
-
},
|
|
83
|
+
}, bn = {
|
|
83
84
|
key: 2,
|
|
84
85
|
class: "bb-table-skeleton__avatar-text"
|
|
85
|
-
},
|
|
86
|
+
}, xn = { class: "bb-table-skeleton__cell-content" }, Sn = {
|
|
86
87
|
key: 3,
|
|
87
88
|
class: "bb-table-skeleton__image"
|
|
88
|
-
},
|
|
89
|
+
}, Cn = {
|
|
89
90
|
key: 4,
|
|
90
91
|
class: "bb-table-skeleton__badge"
|
|
91
|
-
},
|
|
92
|
+
}, wn = ["role"], Tn = ["aria-rowindex"], En = ["aria-colspan", "role"], Dn = {
|
|
92
93
|
key: 0,
|
|
93
94
|
class: "bb-table-empty__content bb-table-empty__content--failed"
|
|
94
|
-
},
|
|
95
|
+
}, On = { class: "bb-table-empty__failed" }, kn = { class: "bb-table-empty__text" }, An = {
|
|
95
96
|
key: 1,
|
|
96
97
|
class: "bb-table-empty__content"
|
|
97
|
-
},
|
|
98
|
+
}, jn = { class: "bb-table-empty__text" }, Mn = ["data-index"], Nn = ["role"], Pn = "__bb-row-drag", Fn = 500, In = 10, Ln = 1e3, Rn = 48, zn = 10, Bn = "bb-table-resizing", Vn = 5, Hn = 10, Un = 500, Wn = 40, Gn = 12, Kn = 4, qn = 12, Jn = "a, button:not(.bb-table-sort), input, select, textarea, [contenteditable], [role=\"button\"], .bb-table-header__resizer", Yn = 12, Xn = 10, Zn = "a[href], button:not([disabled]), input:not([disabled]):not([type=\"hidden\"]), select:not([disabled]), textarea:not([disabled]), summary, [contenteditable]:not([contenteditable=\"false\"]), [tabindex]:not([tabindex=\"-1\"])", Qn = 600, $n = -1, er = -2, tr = -3, nr = 120, rr = 6, ir = 800, ar = 120, or = 10, D = /*@__PURE__*/ v({
|
|
98
99
|
inheritAttrs: !1,
|
|
99
100
|
__name: "BbTable",
|
|
100
|
-
props: /*@__PURE__*/
|
|
101
|
+
props: /*@__PURE__*/ gt({
|
|
101
102
|
"pt:root": {},
|
|
102
103
|
"pt:root:empty": {},
|
|
103
104
|
"pt:root:loading": {},
|
|
@@ -261,7 +262,7 @@ var Wt = {
|
|
|
261
262
|
},
|
|
262
263
|
highlightedModifiers: {}
|
|
263
264
|
}),
|
|
264
|
-
emits: /*@__PURE__*/
|
|
265
|
+
emits: /*@__PURE__*/ gt([
|
|
265
266
|
"click:row",
|
|
266
267
|
"contextmenu:row",
|
|
267
268
|
"dblclick:row",
|
|
@@ -283,18 +284,18 @@ var Wt = {
|
|
|
283
284
|
"update:order",
|
|
284
285
|
"update:highlighted"
|
|
285
286
|
]),
|
|
286
|
-
setup(v, { emit:
|
|
287
|
-
let D =
|
|
287
|
+
setup(v, { emit: gt }) {
|
|
288
|
+
let D = Mt(v, "selectAll"), sr = Mt(v, "sort"), cr = Mt(v, "order"), lr = Mt(v, "highlighted"), O = v, k = gt, A = Nt(), ur = ct("move", t), dr = ct("sortAsc", n), fr = ct("sortDesc", ""), pr = ct("dragHandle", ""), mr = Mt(O, "expandedItems"), hr = r("BbTable", O, { compact: !1 }), j = Te({
|
|
288
289
|
component: "BbTable",
|
|
289
|
-
attrs:
|
|
290
|
+
attrs: jt(),
|
|
290
291
|
props: O,
|
|
291
292
|
parts: we.parts,
|
|
292
293
|
states: we.states,
|
|
293
294
|
active: {
|
|
294
|
-
loading: () =>
|
|
295
|
+
loading: () => ss.value,
|
|
295
296
|
empty: () => !J.value.length
|
|
296
297
|
}
|
|
297
|
-
}),
|
|
298
|
+
}), gr = (e) => ({
|
|
298
299
|
sorted: !!e,
|
|
299
300
|
sortedDesc: e === "desc"
|
|
300
301
|
});
|
|
@@ -302,56 +303,56 @@ var Wt = {
|
|
|
302
303
|
slotKeys: () => (O.columns ?? []).map((e) => e.key),
|
|
303
304
|
fixedSlots: ["header:prepend", "header:append"]
|
|
304
305
|
});
|
|
305
|
-
let M = C(!!A.actions),
|
|
306
|
-
|
|
307
|
-
let e =
|
|
308
|
-
e !==
|
|
306
|
+
let M = C(!!A.actions), _r = C(!!A.expand), vr = C(!!A.tbody), yr = C(!!A.thead), br = () => Object.keys(A).filter((e) => /:(first|last)$/.test(e)).sort().join(" "), xr = C(br());
|
|
307
|
+
bt(() => {
|
|
308
|
+
let e = br();
|
|
309
|
+
e !== xr.value && (xr.value = e);
|
|
309
310
|
let t = !!A.actions;
|
|
310
|
-
t !== M.value && (M.value = t), !!A.expand !==
|
|
311
|
+
t !== M.value && (M.value = t), !!A.expand !== _r.value && (_r.value = !!A.expand), !!A.tbody !== vr.value && (vr.value = !!A.tbody), !!A.thead !== yr.value && (yr.value = !!A.thead);
|
|
311
312
|
});
|
|
312
|
-
let N = m(() => !!O.keyboardNavigation && !
|
|
313
|
+
let N = m(() => !!O.keyboardNavigation && !vr.value), Sr = m(() => N.value && _r.value), Cr = m(() => Sr.value ? "treegrid" : N.value ? "grid" : "table"), wr = m(() => N.value ? "gridcell" : "cell"), Tr = m(() => new Set(O.columns.filter((e) => e.rowHeader).map((e) => String(e.key)))), Er = m(() => N.value && !yr.value), { getItemValue: Dr } = u(), Or = l().id.value, kr = (e) => `expanded_${Or}_${e}`;
|
|
313
314
|
O.multiple && !Array.isArray(O.modelValue) && Je().throw("BbTable is set for multiple selection but modelValue is not an array.");
|
|
314
|
-
let
|
|
315
|
+
let Ar = ["actions", "select"];
|
|
315
316
|
if (process.env.NODE_ENV !== "production") {
|
|
316
|
-
let e = O.columns.filter((e) =>
|
|
317
|
+
let e = O.columns.filter((e) => Ar.includes(e.key));
|
|
317
318
|
for (let t of e) Je().warn(`BbTable: \`{ key: '${String(t.key)}' }\` is a reserved column and must not appear in \`columns\`. ` + (t.key === "actions" ? "Fill the `#actions` slot instead — the slot creates the column." : "Selection is controlled by the `selectable` prop."));
|
|
318
319
|
}
|
|
319
|
-
let { t:
|
|
320
|
+
let { t: P } = ie(), F = C(), I = C(), { id: jr, parentId: Mr, parentNode: Nr, node: Pr, cssVars: Fr, parentVar: Ir, setTracks: Lr } = re({
|
|
320
321
|
id: () => O.id,
|
|
321
|
-
container: () =>
|
|
322
|
+
container: () => I.value,
|
|
322
323
|
inheritFrom: () => typeof O.inheritColumnWidths == "string" ? O.inheritColumnWidths : void 0
|
|
323
|
-
}),
|
|
324
|
+
}), Rr = m(() => `${jr.value}__caption`), zr = m(() => `${jr.value}__header_instructions`), Br = m(() => `${jr.value}__sort_instructions`), Vr = m(() => !O.multiSort && O.columns.some((e) => e.sortable)), Hr = (e) => {
|
|
324
325
|
let t = [];
|
|
325
|
-
return
|
|
326
|
-
},
|
|
327
|
-
bodyRef:
|
|
328
|
-
containerRef:
|
|
329
|
-
enabled: () =>
|
|
326
|
+
return Ur.value && t.push(zr.value), Vr.value && e.sortable && (Ur.value || Er.value) && t.push(Br.value), t.join(" ") || void 0;
|
|
327
|
+
}, Ur = m(() => !!(O.reorderable || O.resizable)), L = C(null), Wr = C(null), R = m(() => !!O.reorderableRows && !vr.value), Gr = m(() => `${jr.value}__row-reorder-instructions`), Kr = Ce({
|
|
328
|
+
bodyRef: L,
|
|
329
|
+
containerRef: I,
|
|
330
|
+
enabled: () => R.value && !cs.value,
|
|
330
331
|
count: () => Y.value.length,
|
|
331
332
|
indexOf: (e) => Y.value.findIndex((t) => t.valueHash === e),
|
|
332
333
|
itemAt: (e) => {
|
|
333
|
-
let t =
|
|
334
|
-
return !Array.isArray(O.items) ||
|
|
334
|
+
let t = kt(Y.value[e]?.item);
|
|
335
|
+
return !Array.isArray(O.items) || ht(O.items) ? t : O.items.find((e) => kt(e) === t) ?? t;
|
|
335
336
|
},
|
|
336
337
|
valueHashAt: (e) => Y.value[e]?.valueHash,
|
|
337
|
-
spanOf: (e) => q.value ?
|
|
338
|
-
labelAt: (e) => Y.value[e] ? Ue(
|
|
338
|
+
spanOf: (e) => q.value ? Dl(e) : null,
|
|
339
|
+
labelAt: (e) => Y.value[e] ? Ue(Fc(e).cols, Tr.value) : "",
|
|
339
340
|
emit: (e) => k("reorder:rows", e),
|
|
340
341
|
text: {
|
|
341
|
-
lifted: (e, t, n) =>
|
|
342
|
-
position: (e, t) =>
|
|
343
|
-
dropped: (e, t, n) =>
|
|
344
|
-
cancelled: (e, t, n) =>
|
|
342
|
+
lifted: (e, t, n) => P("table.rowLifted", e, t, n).value,
|
|
343
|
+
position: (e, t) => P("table.rowPosition", e, t).value,
|
|
344
|
+
dropped: (e, t, n) => P("table.rowDropped", e, t, n).value,
|
|
345
|
+
cancelled: (e, t, n) => P("table.rowMoveCancelled", e, t, n).value
|
|
345
346
|
}
|
|
346
347
|
});
|
|
347
|
-
x(
|
|
348
|
-
let
|
|
349
|
-
|
|
350
|
-
},
|
|
351
|
-
|
|
348
|
+
x(Kr.stop);
|
|
349
|
+
let qr = (e) => {
|
|
350
|
+
R.value && Kr.onBodyPointerDown(e), li(e);
|
|
351
|
+
}, Jr = C(null), Yr = Ot([]), Xr = wt(/* @__PURE__ */ new Set()), Zr = null, Qr = 0, $r = !1, ei = !1, ti = null, ni = () => {
|
|
352
|
+
ti && clearTimeout(ti.timer), ti = null;
|
|
352
353
|
};
|
|
353
|
-
x(
|
|
354
|
-
let
|
|
354
|
+
x(ni);
|
|
355
|
+
let ri = (e, t, n) => {
|
|
355
356
|
let r = e.getBoundingClientRect(), i = t - r.left, a = n - r.top;
|
|
356
357
|
return {
|
|
357
358
|
contextElement: e,
|
|
@@ -370,182 +371,183 @@ var Wt = {
|
|
|
370
371
|
};
|
|
371
372
|
}
|
|
372
373
|
};
|
|
373
|
-
},
|
|
374
|
+
}, ii = (e) => {
|
|
374
375
|
let t = e.target;
|
|
375
376
|
if (!(t instanceof Element)) return null;
|
|
376
377
|
let n = t.closest(".bb-table__row");
|
|
377
|
-
return !n || n.closest(".bb-table__body") !==
|
|
378
|
-
},
|
|
378
|
+
return !n || n.closest(".bb-table__body") !== L.value || Se(e, n) ? null : n;
|
|
379
|
+
}, ai = (e, t, n, r) => {
|
|
379
380
|
let i = new MouseEvent("contextmenu", {
|
|
380
381
|
bubbles: !0,
|
|
381
382
|
cancelable: !0,
|
|
382
383
|
clientX: t,
|
|
383
384
|
clientY: n
|
|
384
385
|
});
|
|
385
|
-
|
|
386
|
+
Zr = r;
|
|
386
387
|
try {
|
|
387
388
|
e.dispatchEvent(i);
|
|
388
389
|
} finally {
|
|
389
|
-
|
|
390
|
+
Zr = null;
|
|
390
391
|
}
|
|
391
392
|
return i.defaultPrevented;
|
|
392
|
-
},
|
|
393
|
-
let r =
|
|
393
|
+
}, oi = (e, t, n) => {
|
|
394
|
+
let r = Zr;
|
|
394
395
|
if (!O.rowMenu || e.defaultPrevented) return;
|
|
395
|
-
if (e.isTrusted &&
|
|
396
|
+
if (e.isTrusted && Xr.has(t) && performance.now() - Qr < 1e3) {
|
|
396
397
|
e.preventDefault(), e.stopPropagation();
|
|
397
398
|
return;
|
|
398
399
|
}
|
|
399
400
|
let i = O.rowMenu(n);
|
|
400
401
|
if (!xe(i)) return;
|
|
401
|
-
e.preventDefault(), e.stopPropagation(), r && (
|
|
402
|
+
e.preventDefault(), e.stopPropagation(), r && (Qr = performance.now());
|
|
402
403
|
let a = e.currentTarget, o = document.activeElement, s = o instanceof HTMLElement && a.contains(o) ? o : null;
|
|
403
|
-
|
|
404
|
-
let c =
|
|
404
|
+
ei = !0, Xr.clear(), Xr.add(t), Yr.value = i;
|
|
405
|
+
let c = ri(a, e.clientX, e.clientY);
|
|
405
406
|
b(async () => {
|
|
406
|
-
await
|
|
407
|
+
await Jr.value?.open(c, r === "keyboard" ? "keyboard" : "pointer", s), ei = !1;
|
|
407
408
|
});
|
|
408
|
-
},
|
|
409
|
-
!
|
|
410
|
-
},
|
|
411
|
-
if (!O.rowMenu || e.key !== "ContextMenu" && !(e.key === "F10" && e.shiftKey) || !
|
|
409
|
+
}, si = () => {
|
|
410
|
+
!ei && !Jr.value?.isOpen() && Xr.clear();
|
|
411
|
+
}, ci = (e) => {
|
|
412
|
+
if (!O.rowMenu || e.key !== "ContextMenu" && !(e.key === "F10" && e.shiftKey) || !ii(e)) return;
|
|
412
413
|
let t = e.target, n = t.getBoundingClientRect();
|
|
413
|
-
|
|
414
|
-
},
|
|
415
|
-
if (
|
|
414
|
+
ai(t, n.left, n.bottom, "keyboard") && e.preventDefault();
|
|
415
|
+
}, li = (e) => {
|
|
416
|
+
if ($r = !1, ni(), !O.rowMenu || e.pointerType !== "touch" || !ii(e)) return;
|
|
416
417
|
let t = e.target, { clientX: n, clientY: r } = e;
|
|
417
|
-
|
|
418
|
+
ti = {
|
|
418
419
|
x: n,
|
|
419
420
|
y: r,
|
|
420
421
|
timer: setTimeout(() => {
|
|
421
|
-
|
|
422
|
-
},
|
|
422
|
+
ti = null, t.isConnected && ai(t, n, r, "touch") && ($r = !0);
|
|
423
|
+
}, Fn)
|
|
423
424
|
};
|
|
424
|
-
},
|
|
425
|
+
}, ui = [
|
|
425
426
|
[
|
|
426
427
|
"click",
|
|
427
428
|
(e) => {
|
|
428
|
-
|
|
429
|
+
$r && ($r = !1, e.preventDefault(), e.stopPropagation());
|
|
429
430
|
},
|
|
430
431
|
!0
|
|
431
432
|
],
|
|
432
433
|
[
|
|
433
434
|
"keydown",
|
|
434
|
-
|
|
435
|
+
ci,
|
|
435
436
|
!1
|
|
436
437
|
],
|
|
437
438
|
[
|
|
438
439
|
"pointercancel",
|
|
439
|
-
|
|
440
|
+
ni,
|
|
440
441
|
!1
|
|
441
442
|
],
|
|
442
443
|
[
|
|
443
444
|
"pointermove",
|
|
444
445
|
(e) => {
|
|
445
|
-
|
|
446
|
+
ti && Math.hypot(e.clientX - ti.x, e.clientY - ti.y) > In && ni();
|
|
446
447
|
},
|
|
447
448
|
!1
|
|
448
449
|
],
|
|
449
450
|
[
|
|
450
451
|
"pointerup",
|
|
451
|
-
|
|
452
|
+
ni,
|
|
452
453
|
!1
|
|
453
454
|
],
|
|
454
455
|
[
|
|
455
456
|
"touchend",
|
|
456
457
|
(e) => {
|
|
457
|
-
|
|
458
|
+
$r && e.cancelable && e.preventDefault();
|
|
458
459
|
},
|
|
459
460
|
!1
|
|
460
461
|
]
|
|
461
462
|
];
|
|
462
|
-
|
|
463
|
-
for (let [e, t, n] of
|
|
463
|
+
St(() => {
|
|
464
|
+
for (let [e, t, n] of ui) L.value?.addEventListener(e, t, { capture: n });
|
|
464
465
|
}), x(() => {
|
|
465
|
-
for (let [e, t, n] of
|
|
466
|
+
for (let [e, t, n] of ui) L.value?.removeEventListener(e, t, { capture: n });
|
|
466
467
|
});
|
|
467
|
-
let
|
|
468
|
-
describedBy:
|
|
469
|
-
nameFor: (e) =>
|
|
470
|
-
onKeydown:
|
|
471
|
-
|
|
472
|
-
|
|
468
|
+
let di = m(() => R.value ? {
|
|
469
|
+
describedBy: Gr.value,
|
|
470
|
+
nameFor: (e) => P("table.moveRow", e).value.trim(),
|
|
471
|
+
onKeydown: Kr.onKeydown,
|
|
472
|
+
icon: pr.value
|
|
473
|
+
} : null), fi = C(/* @__PURE__ */ new Set()), pi = m(() => {
|
|
474
|
+
let e = new Set(fi.value);
|
|
473
475
|
for (let t of O.columns) t.hidden && e.add(String(t.key));
|
|
474
476
|
return e;
|
|
475
|
-
}),
|
|
476
|
-
let e =
|
|
477
|
+
}), mi = m(() => {
|
|
478
|
+
let e = pi.value;
|
|
477
479
|
return e.size ? O.columns.filter((t) => !e.has(String(t.key))) : O.columns;
|
|
478
|
-
}),
|
|
479
|
-
if (
|
|
480
|
-
let t =
|
|
481
|
-
|
|
480
|
+
}), hi = (e) => {
|
|
481
|
+
if (pi.value.has(e)) return;
|
|
482
|
+
let t = ki(e), n = B.value.indexOf(e), r = !!t && t.contains(document.activeElement) && (Ur.value || Er.value);
|
|
483
|
+
fi.value = /* @__PURE__ */ new Set([...fi.value, e]), k("hide:column", e), r && b(() => Ai(n));
|
|
482
484
|
};
|
|
483
485
|
E(() => O.columns.map((e) => [String(e.key), !!e.hidden]), (e, t) => {
|
|
484
|
-
if (!t || !
|
|
485
|
-
let n = new Map(t), r =
|
|
486
|
+
if (!t || !fi.value.size) return;
|
|
487
|
+
let n = new Map(t), r = fi.value, i = e.filter(([e, t]) => n.has(e) && n.get(e) !== t && r.has(e) && !t);
|
|
486
488
|
if (!i.length) return;
|
|
487
489
|
let a = new Set(r);
|
|
488
490
|
for (let [e] of i) a.delete(e);
|
|
489
|
-
|
|
491
|
+
fi.value = a;
|
|
490
492
|
});
|
|
491
|
-
let
|
|
492
|
-
let e =
|
|
493
|
+
let gi = m(() => O.columns.map((e) => String(e.key))), _i = m(() => new Set(O.columns.filter((e) => e.reorderable === !1).map((e) => String(e.key)))), vi = (e) => _i.value.size ? Pe(ke(e, gi.value), gi.value, _i.value) : ke(e, gi.value), yi = C(null), z = m(() => {
|
|
494
|
+
let e = mi.value, t = yi.value ?? cr.value;
|
|
493
495
|
if (!t.length) return e;
|
|
494
|
-
let n =
|
|
496
|
+
let n = _i.value.size ? vi(t) : t, r = ze(e, n);
|
|
495
497
|
return r.every((t, n) => t === e[n]) ? e : r;
|
|
496
|
-
}),
|
|
497
|
-
let n =
|
|
498
|
+
}), B = m(() => z.value.map((e) => String(e.key))), bi = (e, t) => {
|
|
499
|
+
let n = vi(cr.value), r = xi(e, t);
|
|
498
500
|
if (r === null) return null;
|
|
499
|
-
let i = Re(n,
|
|
501
|
+
let i = Re(n, gi.value, e, r, pi.value);
|
|
500
502
|
return We(i, n) ? null : i;
|
|
501
|
-
},
|
|
502
|
-
let n =
|
|
503
|
+
}, xi = (e, t) => {
|
|
504
|
+
let n = B.value, r = He(n, n.indexOf(e), _i.value);
|
|
503
505
|
return r ? Math.max(r.min, Math.min(r.max, t)) : null;
|
|
504
|
-
},
|
|
506
|
+
}, Si = C("");
|
|
505
507
|
E(() => O.reorderable, () => {
|
|
506
|
-
|
|
508
|
+
Si.value = "";
|
|
507
509
|
});
|
|
508
|
-
let
|
|
509
|
-
let n =
|
|
510
|
-
r < 0 || r === t || (
|
|
511
|
-
},
|
|
512
|
-
let e =
|
|
510
|
+
let Ci = (e, t) => {
|
|
511
|
+
let n = z.value, r = n.findIndex((t) => String(t.key) === e);
|
|
512
|
+
r < 0 || r === t || (Si.value = P("table.columnMoved", n[r].label, r + 1, n.length).value);
|
|
513
|
+
}, wi = C(null), Ti = m(() => {
|
|
514
|
+
let e = B.value, t = wi.value;
|
|
513
515
|
return t !== null && e.includes(t) ? t : e[0] ?? null;
|
|
514
|
-
}),
|
|
516
|
+
}), Ei = (e, t) => {
|
|
515
517
|
if (!t.sortable) return;
|
|
516
518
|
let n = e.target;
|
|
517
519
|
if (!(n instanceof Element)) return;
|
|
518
520
|
let r = e.currentTarget;
|
|
519
521
|
if (!r.contains(n) || n.closest(".bb-table-sort")) return;
|
|
520
|
-
let i = n.closest(
|
|
521
|
-
i && r.contains(i) || (e.shiftKey || !window.getSelection()?.toString()) &&
|
|
522
|
-
},
|
|
522
|
+
let i = n.closest(Jn);
|
|
523
|
+
i && r.contains(i) || (e.shiftKey || !window.getSelection()?.toString()) && za(t.key, e);
|
|
524
|
+
}, Di = (e, t) => {
|
|
523
525
|
if (!t.sortable || !e.shiftKey) return;
|
|
524
526
|
let n = e.target;
|
|
525
527
|
if (!(n instanceof Element)) return;
|
|
526
|
-
let r = n.closest(
|
|
528
|
+
let r = n.closest(Jn), i = e.currentTarget;
|
|
527
529
|
r && i.contains(r) || window.getSelection()?.removeAllRanges();
|
|
528
|
-
},
|
|
529
|
-
|
|
530
|
-
},
|
|
531
|
-
let t =
|
|
532
|
-
n && (
|
|
533
|
-
},
|
|
534
|
-
|
|
535
|
-
let n =
|
|
536
|
-
if (!
|
|
530
|
+
}, Oi = (e) => {
|
|
531
|
+
Ur.value && (wi.value = e);
|
|
532
|
+
}, ki = (e) => F.value?.querySelector(`:scope > .bb-table__head > .bb-table__header-row > [data-column-key="${CSS.escape(e)}"]`) ?? null, Ai = (e) => {
|
|
533
|
+
let t = B.value, n = t[Math.max(0, Math.min(t.length - 1, e))];
|
|
534
|
+
n && (wi.value = n, ki(n)?.focus());
|
|
535
|
+
}, ji = async (e, t) => {
|
|
536
|
+
La = (e.key === "Enter" || e.key === " ") && e.shiftKey;
|
|
537
|
+
let n = Er.value;
|
|
538
|
+
if (!Ur.value && !n) return;
|
|
537
539
|
let r = e.currentTarget, i = e.target;
|
|
538
540
|
if (!(i instanceof Element) || i !== r && !i.closest(".bb-table-sort")) return;
|
|
539
541
|
let a = Xe(r);
|
|
540
542
|
if (e.altKey && !e.ctrlKey && !e.metaKey) {
|
|
541
|
-
if (!
|
|
543
|
+
if (!Ii(t) || e.key !== "ArrowLeft" && e.key !== "ArrowRight") return;
|
|
542
544
|
e.preventDefault();
|
|
543
545
|
let n = e.key === "ArrowRight" !== a, i = V.value[t] ?? r.getBoundingClientRect().width;
|
|
544
|
-
|
|
546
|
+
Gi({ [t]: i + (n ? 1 : -1) * zn });
|
|
545
547
|
return;
|
|
546
548
|
}
|
|
547
549
|
if (e.ctrlKey || e.metaKey) return;
|
|
548
|
-
let o =
|
|
550
|
+
let o = B.value, s = o.indexOf(t);
|
|
549
551
|
if (s < 0) return;
|
|
550
552
|
let c;
|
|
551
553
|
switch (e.key) {
|
|
@@ -563,72 +565,72 @@ var Wt = {
|
|
|
563
565
|
break;
|
|
564
566
|
case "Enter":
|
|
565
567
|
case " ":
|
|
566
|
-
if (i !== r || !
|
|
567
|
-
e.preventDefault(),
|
|
568
|
+
if (i !== r || !z.value[s]?.sortable) return;
|
|
569
|
+
e.preventDefault(), za(t, e);
|
|
568
570
|
return;
|
|
569
571
|
default: return;
|
|
570
572
|
}
|
|
571
573
|
if (n && (!e.shiftKey || !O.reorderable)) return;
|
|
572
574
|
if (e.preventDefault(), !e.shiftKey) {
|
|
573
|
-
|
|
575
|
+
Ai(c);
|
|
574
576
|
return;
|
|
575
577
|
}
|
|
576
578
|
if (!O.reorderable) return;
|
|
577
|
-
let l =
|
|
578
|
-
l && (
|
|
579
|
+
let l = bi(t, c);
|
|
580
|
+
l && (Si.value = "", cr.value = l, wi.value = t, await b(), Mi(t, n), Ni = B.value.indexOf(t) === l.indexOf(t) ? null : {
|
|
579
581
|
key: t,
|
|
580
582
|
index: l.indexOf(t),
|
|
581
583
|
inGrid: n,
|
|
582
|
-
until: Date.now() +
|
|
583
|
-
},
|
|
584
|
-
},
|
|
585
|
-
let n =
|
|
586
|
-
n?.focus(), n && t && n.parentElement && (
|
|
584
|
+
until: Date.now() + Ln
|
|
585
|
+
}, Ci(t, s));
|
|
586
|
+
}, Mi = (e, t) => {
|
|
587
|
+
let n = ki(e);
|
|
588
|
+
n?.focus(), n && t && n.parentElement && (Bc.value = {
|
|
587
589
|
key: null,
|
|
588
590
|
row: -1,
|
|
589
591
|
col: Array.prototype.indexOf.call(n.parentElement.children, n)
|
|
590
592
|
});
|
|
591
|
-
},
|
|
592
|
-
E(
|
|
593
|
-
let t =
|
|
593
|
+
}, Ni = null;
|
|
594
|
+
E(B, (e) => {
|
|
595
|
+
let t = Ni;
|
|
594
596
|
if (!t) return;
|
|
595
597
|
if (Date.now() > t.until) {
|
|
596
|
-
|
|
598
|
+
Ni = null;
|
|
597
599
|
return;
|
|
598
600
|
}
|
|
599
601
|
if (e.indexOf(t.key) !== t.index) return;
|
|
600
|
-
|
|
601
|
-
let n = document.activeElement, r =
|
|
602
|
-
(!n || n === document.body || r?.contains(n)) && n !==
|
|
603
|
-
}, { flush: "post" }), process.env.NODE_ENV !== "production" && (E(
|
|
602
|
+
Ni = null;
|
|
603
|
+
let n = document.activeElement, r = F.value;
|
|
604
|
+
(!n || n === document.body || r?.contains(n)) && n !== ki(t.key) && Mi(t.key, t.inGrid);
|
|
605
|
+
}, { flush: "post" }), process.env.NODE_ENV !== "production" && (E(cr, (e) => {
|
|
604
606
|
new Set(e).size !== e.length && Je().warn("BbTable: `order` lists a key more than once — the first occurrence wins.");
|
|
605
|
-
}, { immediate: !0 }), E(() => O.columns.some((e) => e.snap != null) && (!!O.reorderable ||
|
|
607
|
+
}, { immediate: !0 }), E(() => O.columns.some((e) => e.snap != null) && (!!O.reorderable || z.value !== O.columns), (e) => {
|
|
606
608
|
e && Je().warn("BbTable: `snap` names a PARENT column and the child renders in its own order — it does not compose with `order` / `reorderable` / a `hidden` column on the snapped table itself. Order and hide on the parent (a key-snapped child follows it), or drop the snaps.");
|
|
607
609
|
}, { immediate: !0 }));
|
|
608
|
-
let
|
|
610
|
+
let Pi = m(() => !!O.resizable && !K.value), Fi = m(() => new Set(O.columns.filter((e) => e.resizable === !1).map((e) => String(e.key)))), Ii = (e) => Pi.value && !Fi.value.has(e), V = C({}), Li = C(null), Ri = C(null), zi = (e) => {
|
|
609
611
|
let t = String(e.key);
|
|
610
|
-
return
|
|
611
|
-
},
|
|
612
|
+
return Li.value?.[t] ?? V.value[t] ?? e.width ?? (q.value ? Ya.value[t] : void 0);
|
|
613
|
+
}, Bi = (e) => {
|
|
612
614
|
let t = String(e.key);
|
|
613
|
-
return
|
|
614
|
-
},
|
|
615
|
-
let e = /* @__PURE__ */ new Map(), t =
|
|
616
|
-
for (let i of
|
|
615
|
+
return Li.value?.[t] !== void 0 || t in V.value;
|
|
616
|
+
}, Vi = m(() => Object.keys(Li.value ?? {}).join(" ")), Hi = m(() => /* @__PURE__ */ new Set([...Object.keys(V.value), ...Vi.value.split(" ").filter(Boolean)])), Ui = m(() => {
|
|
617
|
+
let e = /* @__PURE__ */ new Map(), t = Hi.value, n = q.value, r = Ya.value;
|
|
618
|
+
for (let i of z.value) {
|
|
617
619
|
let a = String(i.key), o = n && i.width == null, s = [];
|
|
618
620
|
o && s.push("bb-table__cell--nowrap"), t.has(a) && s.push("bb-table__cell--resized"), (t.has(a) || o && a in r) && s.push("bb-table__cell--clip"), s.length && e.set(a, s.join(" "));
|
|
619
621
|
}
|
|
620
622
|
return e;
|
|
621
|
-
}),
|
|
623
|
+
}), Wi = m(() => Li.value !== null || Object.keys(V.value).length > 0), Gi = (e) => {
|
|
622
624
|
let t = { ...V.value }, n = [];
|
|
623
625
|
for (let [r, i] of Object.entries(e)) {
|
|
624
|
-
let e = Math.max(
|
|
626
|
+
let e = Math.max(Rn, Math.round(i));
|
|
625
627
|
t[r] !== e && (t[r] = e, n.push([r, e]));
|
|
626
628
|
}
|
|
627
629
|
if (n.length) {
|
|
628
630
|
V.value = t;
|
|
629
631
|
for (let [e, t] of n) k("resize:column", e, t);
|
|
630
632
|
}
|
|
631
|
-
},
|
|
633
|
+
}, Ki = (e) => {
|
|
632
634
|
if (!(e in V.value)) return;
|
|
633
635
|
let { [e]: t, ...n } = V.value;
|
|
634
636
|
V.value = n, k("resize:column", e, null);
|
|
@@ -641,43 +643,43 @@ var Wt = {
|
|
|
641
643
|
for (let [e] of i) delete a[e];
|
|
642
644
|
V.value = a;
|
|
643
645
|
});
|
|
644
|
-
let H = null,
|
|
645
|
-
document.removeEventListener("pointermove",
|
|
646
|
-
},
|
|
647
|
-
if (
|
|
646
|
+
let H = null, qi = () => {
|
|
647
|
+
document.removeEventListener("pointermove", Yi), document.removeEventListener("pointerup", Xi), document.removeEventListener("pointercancel", Zi), document.removeEventListener("keydown", Qi, !0), window.removeEventListener("blur", Zi);
|
|
648
|
+
}, Ji = () => {
|
|
649
|
+
if (qi(), H) try {
|
|
648
650
|
H.handle.releasePointerCapture(H.pointerId);
|
|
649
651
|
} catch {}
|
|
650
|
-
document.documentElement.classList.remove(
|
|
651
|
-
},
|
|
652
|
+
document.documentElement.classList.remove(Bn), H = null, Li.value = null, Ri.value = null, F.value && (F.value.style.gridTemplateColumns = Lo.value);
|
|
653
|
+
}, Yi = (e) => {
|
|
652
654
|
if (!H || e.pointerId !== H.pointerId) return;
|
|
653
655
|
let t = (e.clientX - H.x0) * (H.rtl ? -1 : 1);
|
|
654
|
-
t = Math.max(
|
|
656
|
+
t = Math.max(Rn - H.startWidth, t);
|
|
655
657
|
let { neighbour: n } = H;
|
|
656
|
-
e.shiftKey && n ? (t = Math.min(n.startWidth -
|
|
658
|
+
e.shiftKey && n ? (t = Math.min(n.startWidth - Rn, t), Li.value = {
|
|
657
659
|
[H.key]: Math.round(H.startWidth + t),
|
|
658
660
|
[n.key]: Math.round(n.startWidth - t)
|
|
659
|
-
}) :
|
|
660
|
-
},
|
|
661
|
+
}) : Li.value = { [H.key]: Math.round(H.startWidth + t) };
|
|
662
|
+
}, Xi = (e) => {
|
|
661
663
|
if (!H || e.pointerId !== H.pointerId) return;
|
|
662
|
-
let { key: t, startWidth: n, neighbour: r } = H, i =
|
|
663
|
-
if (
|
|
664
|
+
let { key: t, startWidth: n, neighbour: r } = H, i = Li.value;
|
|
665
|
+
if (Ji(), !i) return;
|
|
664
666
|
let a = {};
|
|
665
|
-
i[t] !== Math.round(n) && (a[t] = i[t]), r && i[r.key] !== void 0 && i[r.key] !== Math.round(r.startWidth) && (a[r.key] = i[r.key]),
|
|
666
|
-
},
|
|
667
|
-
H && (e instanceof PointerEvent && e.pointerId !== H.pointerId ||
|
|
668
|
-
},
|
|
669
|
-
H && e.key === "Escape" && (e.preventDefault(), e.stopImmediatePropagation(),
|
|
670
|
-
},
|
|
671
|
-
if (!
|
|
672
|
-
let n =
|
|
667
|
+
i[t] !== Math.round(n) && (a[t] = i[t]), r && i[r.key] !== void 0 && i[r.key] !== Math.round(r.startWidth) && (a[r.key] = i[r.key]), Gi(a);
|
|
668
|
+
}, Zi = (e) => {
|
|
669
|
+
H && (e instanceof PointerEvent && e.pointerId !== H.pointerId || Ji());
|
|
670
|
+
}, Qi = (e) => {
|
|
671
|
+
H && e.key === "Escape" && (e.preventDefault(), e.stopImmediatePropagation(), Ji());
|
|
672
|
+
}, $i = (e, t) => {
|
|
673
|
+
if (!Ii(t) || cs.value || H || !e.isPrimary || e.button !== 0) return;
|
|
674
|
+
let n = ki(t);
|
|
673
675
|
if (!n) return;
|
|
674
676
|
e.preventDefault();
|
|
675
677
|
let r = e.currentTarget;
|
|
676
678
|
try {
|
|
677
679
|
r.setPointerCapture(e.pointerId);
|
|
678
680
|
} catch {}
|
|
679
|
-
document.documentElement.classList.add(
|
|
680
|
-
let i =
|
|
681
|
+
document.documentElement.classList.add(Bn);
|
|
682
|
+
let i = B.value, a = i[i.indexOf(t) + 1], o = a && Ii(a) ? a : void 0, s = o ? ki(o) : null;
|
|
681
683
|
H = {
|
|
682
684
|
pointerId: e.pointerId,
|
|
683
685
|
handle: r,
|
|
@@ -689,37 +691,37 @@ var Wt = {
|
|
|
689
691
|
startWidth: s.getBoundingClientRect().width
|
|
690
692
|
} : null,
|
|
691
693
|
rtl: Ye(n)
|
|
692
|
-
},
|
|
694
|
+
}, Ri.value = t, document.addEventListener("pointermove", Yi), document.addEventListener("pointerup", Xi), document.addEventListener("pointercancel", Zi), document.addEventListener("keydown", Qi, !0), window.addEventListener("blur", Zi);
|
|
693
695
|
};
|
|
694
|
-
x(
|
|
695
|
-
let U = C("idle"),
|
|
696
|
-
let e =
|
|
696
|
+
x(Ji);
|
|
697
|
+
let U = C("idle"), ea = C(null), ta = C(""), na = C(), ra = Symbol("bb-table-column-drag"), W = null, ia = (e) => Math.max(0, Math.min(1, e)), aa = () => {
|
|
698
|
+
let e = eo.value ? I.value?.parentElement ?? null : I.value ?? null;
|
|
697
699
|
for (; e;) {
|
|
698
700
|
let t = getComputedStyle(e).overflowX;
|
|
699
701
|
if (t === "auto" || t === "scroll") return e;
|
|
700
702
|
e = e.parentElement;
|
|
701
703
|
}
|
|
702
704
|
return null;
|
|
703
|
-
},
|
|
705
|
+
}, oa = () => {
|
|
704
706
|
let e = W?.scrollport?.getBoundingClientRect(), t = Math.max(e?.left ?? 0, 0), n = Math.min(e?.right ?? window.innerWidth, window.innerWidth);
|
|
705
707
|
return {
|
|
706
708
|
left: t,
|
|
707
709
|
right: Math.max(t + 1, n)
|
|
708
710
|
};
|
|
709
|
-
},
|
|
710
|
-
let e =
|
|
711
|
+
}, sa = (e) => Array.from(e.children).filter((e) => e instanceof HTMLElement && e.classList.contains("bb-table__cell-column-header") && !!e.dataset.columnKey), ca = () => {
|
|
712
|
+
let e = na.value;
|
|
711
713
|
e?.isConnected && !e.matches(":popover-open") && e.showPopover();
|
|
712
|
-
},
|
|
713
|
-
let e =
|
|
714
|
+
}, la = () => {
|
|
715
|
+
let e = na.value;
|
|
714
716
|
e && e.matches(":popover-open") && e.hidePopover();
|
|
715
|
-
},
|
|
716
|
-
let n =
|
|
717
|
-
n && (n.style.translate = `${e +
|
|
718
|
-
},
|
|
717
|
+
}, ua = (e, t) => {
|
|
718
|
+
let n = na.value;
|
|
719
|
+
n && (n.style.translate = `${e + qn}px ${t + qn}px`);
|
|
720
|
+
}, da = (e) => {
|
|
719
721
|
if (!W || U.value !== "dragging") return;
|
|
720
|
-
let t =
|
|
722
|
+
let t = oa(), n = Math.max(t.left, Math.min(e, t.right - 1)), r = sa(W.row);
|
|
721
723
|
if (r.length < 2) return;
|
|
722
|
-
let i = (e) => e.style.position === "sticky", a = new Map(r.map((e) => [e, e.getBoundingClientRect()])), o = [...r.filter(i), ...r.filter((e) => !i(e))].filter((e) => e.dataset.columnKey !== W.key), s =
|
|
724
|
+
let i = (e) => e.style.position === "sticky", a = new Map(r.map((e) => [e, e.getBoundingClientRect()])), o = [...r.filter(i), ...r.filter((e) => !i(e))].filter((e) => e.dataset.columnKey !== W.key), s = B.value, c = s.indexOf(W.key);
|
|
723
725
|
if (c < 0) return;
|
|
724
726
|
let l = Infinity, u = -Infinity;
|
|
725
727
|
for (let e of a.values()) l = Math.min(l, e.left), u = Math.max(u, e.right);
|
|
@@ -734,82 +736,82 @@ var Wt = {
|
|
|
734
736
|
if (!e) return;
|
|
735
737
|
d = e.dataset.columnKey, f = s.indexOf(d);
|
|
736
738
|
}
|
|
737
|
-
if (f < 0 || (f =
|
|
739
|
+
if (f < 0 || (f = xi(W.key, f) ?? c, f === c)) return;
|
|
738
740
|
let p = f > c;
|
|
739
741
|
if (W.target?.key === d && W.target.after === p) return;
|
|
740
|
-
let ee = Re(W.base,
|
|
742
|
+
let ee = Re(W.base, gi.value, W.key, f, pi.value), te = yi.value ?? W.base;
|
|
741
743
|
We(ee, te) ? W.target = {
|
|
742
744
|
key: d,
|
|
743
745
|
after: p
|
|
744
|
-
} : ((W.rtl ? !p : p) ? n <= W.lastMoveX +
|
|
746
|
+
} : ((W.rtl ? !p : p) ? n <= W.lastMoveX + Kn : n >= W.lastMoveX - Kn) || (W.target = {
|
|
745
747
|
key: d,
|
|
746
748
|
after: p
|
|
747
|
-
}, W.lastMoveX = n,
|
|
748
|
-
},
|
|
749
|
+
}, W.lastMoveX = n, yi.value = ee);
|
|
750
|
+
}, fa = () => {
|
|
749
751
|
if (!W || U.value !== "dragging" || !W.scrollDirection) {
|
|
750
752
|
W && (W.raf = void 0);
|
|
751
753
|
return;
|
|
752
754
|
}
|
|
753
|
-
let e =
|
|
754
|
-
r && (r.scrollLeft += W.scrollDirection * n),
|
|
755
|
-
},
|
|
755
|
+
let e = oa(), t = W.scrollDirection < 0 ? W.lastX - e.left : e.right - W.lastX, n = Math.ceil(Gn * (1 - ia(t / Wn))), r = W.scrollport ?? document.scrollingElement;
|
|
756
|
+
r && (r.scrollLeft += W.scrollDirection * n), da(W.lastX), W.raf = requestAnimationFrame(fa);
|
|
757
|
+
}, pa = () => {
|
|
756
758
|
if (!W) return;
|
|
757
|
-
let e =
|
|
758
|
-
W.scrollDirection = t <
|
|
759
|
-
},
|
|
760
|
-
document.removeEventListener("pointermove",
|
|
761
|
-
},
|
|
759
|
+
let e = oa(), t = W.lastX - e.left, n = e.right - W.lastX;
|
|
760
|
+
W.scrollDirection = t < Wn ? -1 : +(n < Wn), W.scrollDirection && W.raf === void 0 && (W.raf = requestAnimationFrame(fa));
|
|
761
|
+
}, ma = () => {
|
|
762
|
+
document.removeEventListener("pointermove", va), document.removeEventListener("pointerup", ya), document.removeEventListener("pointercancel", ba), document.removeEventListener("keydown", Sa, !0), document.removeEventListener("dragstart", Ca), document.removeEventListener("contextmenu", Ca, !0), window.removeEventListener("blur", ba), W?.row.removeEventListener("lostpointercapture", xa);
|
|
763
|
+
}, ha = () => {
|
|
762
764
|
if (W) {
|
|
763
|
-
clearTimeout(W.timer), W.raf !== void 0 && cancelAnimationFrame(W.raf),
|
|
765
|
+
clearTimeout(W.timer), W.raf !== void 0 && cancelAnimationFrame(W.raf), ma();
|
|
764
766
|
try {
|
|
765
767
|
W.row.hasPointerCapture(W.pointerId) && W.row.releasePointerCapture(W.pointerId);
|
|
766
768
|
} catch {}
|
|
767
|
-
|
|
769
|
+
la(), et(ra), ea.value = null, yi.value = null, U.value = "idle", W = null;
|
|
768
770
|
}
|
|
769
|
-
},
|
|
770
|
-
W && (W.raf !== void 0 && cancelAnimationFrame(W.raf), W.raf = void 0, W.scrollDirection = 0,
|
|
771
|
-
},
|
|
771
|
+
}, ga = () => {
|
|
772
|
+
W && (W.raf !== void 0 && cancelAnimationFrame(W.raf), W.raf = void 0, W.scrollDirection = 0, la(), et(ra), ea.value = null, yi.value = null, U.value = "cancelled");
|
|
773
|
+
}, _a = () => {
|
|
772
774
|
if (W && U.value === "armed") {
|
|
773
775
|
clearTimeout(W.timer), W.timer = void 0;
|
|
774
776
|
try {
|
|
775
777
|
W.row.setPointerCapture(W.pointerId);
|
|
776
778
|
} catch {}
|
|
777
|
-
W.row.addEventListener("lostpointercapture",
|
|
779
|
+
W.row.addEventListener("lostpointercapture", xa), W.base = vi(cr.value), W.rtl = Ye(W.row), W.scrollport = aa(), W.lastMoveX = W.x0, W.target = null, yi.value = W.base, ea.value = W.key, ta.value = W.label, U.value = "dragging", $e(ra), ca(), ua(W.lastX, W.lastY), da(W.lastX), pa();
|
|
778
780
|
}
|
|
779
|
-
},
|
|
781
|
+
}, va = (e) => {
|
|
780
782
|
if (W && e.pointerId === W.pointerId) {
|
|
781
783
|
if (W.lastX = e.clientX, W.lastY = e.clientY, U.value === "armed") {
|
|
782
784
|
let t = Math.hypot(e.clientX - W.x0, e.clientY - W.y0);
|
|
783
785
|
if (W.pointerType === "touch") {
|
|
784
|
-
t >=
|
|
786
|
+
t >= Hn && ha();
|
|
785
787
|
return;
|
|
786
788
|
}
|
|
787
|
-
if (t <
|
|
788
|
-
|
|
789
|
-
} else U.value === "dragging" && (
|
|
789
|
+
if (t < Vn) return;
|
|
790
|
+
_a();
|
|
791
|
+
} else U.value === "dragging" && (ua(e.clientX, e.clientY), da(e.clientX), pa());
|
|
790
792
|
}
|
|
791
|
-
},
|
|
793
|
+
}, ya = (e) => {
|
|
792
794
|
if (!W || e.pointerId !== W.pointerId) return;
|
|
793
|
-
let { key: t } = W, n = W.base ? W.base.filter((e) =>
|
|
794
|
-
|
|
795
|
-
},
|
|
796
|
-
W && (e instanceof PointerEvent && e.pointerId !== W.pointerId ||
|
|
797
|
-
},
|
|
798
|
-
W && U.value === "dragging" &&
|
|
799
|
-
},
|
|
800
|
-
W && U.value === "dragging" && e.key === "Escape" && Qe(
|
|
801
|
-
},
|
|
795
|
+
let { key: t } = W, n = W.base ? W.base.filter((e) => gi.value.includes(e) && !pi.value.has(e)).indexOf(t) : -1, r = U.value === "dragging" && yi.value !== null && !We(yi.value, W.base) ? yi.value : null;
|
|
796
|
+
ha(), r && (Si.value = "", cr.value = r, b(() => Ci(t, n)));
|
|
797
|
+
}, ba = (e) => {
|
|
798
|
+
W && (e instanceof PointerEvent && e.pointerId !== W.pointerId || ha());
|
|
799
|
+
}, xa = () => {
|
|
800
|
+
W && U.value === "dragging" && ha();
|
|
801
|
+
}, Sa = (e) => {
|
|
802
|
+
W && U.value === "dragging" && e.key === "Escape" && Qe(ra) && (e.preventDefault(), e.stopImmediatePropagation(), ga());
|
|
803
|
+
}, Ca = (e) => {
|
|
802
804
|
W && U.value !== "idle" && e.preventDefault();
|
|
803
|
-
},
|
|
804
|
-
if (!O.reorderable ||
|
|
805
|
+
}, wa = (e) => {
|
|
806
|
+
if (!O.reorderable || cs.value || A.thead || !e.isPrimary || e.button !== 0 || W || z.value.length < 2) return;
|
|
805
807
|
let t = e.target;
|
|
806
808
|
if (!(t instanceof Element)) return;
|
|
807
809
|
let n = e.currentTarget, r = t.closest(".bb-table__cell-column-header");
|
|
808
810
|
if (!r || r.parentElement !== n || !r.dataset.columnKey) return;
|
|
809
|
-
let i = t.closest(
|
|
811
|
+
let i = t.closest(Jn);
|
|
810
812
|
if (i && r.contains(i)) return;
|
|
811
|
-
let a = r.dataset.columnKey, o =
|
|
812
|
-
o && (
|
|
813
|
+
let a = r.dataset.columnKey, o = z.value.find((e) => String(e.key) === a);
|
|
814
|
+
o && (_i.value.has(a) || (W = {
|
|
813
815
|
pointerId: e.pointerId,
|
|
814
816
|
pointerType: e.pointerType,
|
|
815
817
|
key: a,
|
|
@@ -827,33 +829,33 @@ var Wt = {
|
|
|
827
829
|
timer: void 0,
|
|
828
830
|
raf: void 0,
|
|
829
831
|
scrollDirection: 0
|
|
830
|
-
}, U.value = "armed", document.addEventListener("pointermove",
|
|
831
|
-
},
|
|
832
|
+
}, U.value = "armed", document.addEventListener("pointermove", va), document.addEventListener("pointerup", ya), document.addEventListener("pointercancel", ba), document.addEventListener("keydown", Sa, !0), document.addEventListener("dragstart", Ca), document.addEventListener("contextmenu", Ca, !0), window.addEventListener("blur", ba), e.pointerType === "touch" && (W.timer = setTimeout(_a, Un))));
|
|
833
|
+
}, Ta = (e) => {
|
|
832
834
|
W && (U.value === "dragging" || U.value === "cancelled") && e.cancelable && e.preventDefault();
|
|
833
835
|
};
|
|
834
|
-
x(
|
|
835
|
-
let
|
|
836
|
-
E(() => Object.keys(
|
|
837
|
-
let
|
|
838
|
-
let e =
|
|
836
|
+
x(ha);
|
|
837
|
+
let Ea = m(() => o(lr.value) ? [] : [lr.value]), { data: Da } = ee({ items: Ea }), { data: Oa } = ee({ items: mr });
|
|
838
|
+
E(() => Object.keys(Oa.value).sort().join("\0"), () => Kr.cancel());
|
|
839
|
+
let ka = pt(), Aa = () => {
|
|
840
|
+
let e = ka?.vnode.props ?? {};
|
|
839
841
|
return "highlighted" in e || "onUpdate:highlighted" in e || G.highlighted !== void 0;
|
|
840
|
-
},
|
|
841
|
-
process.env.NODE_ENV !== "production" && (
|
|
842
|
-
},
|
|
843
|
-
if (!
|
|
844
|
-
t &&
|
|
842
|
+
}, ja = (e) => O.highlightable === !1 || typeof O.highlightable == "function" && !O.highlightable(e), Ma = !1, Na = () => {
|
|
843
|
+
process.env.NODE_ENV !== "production" && (Ma || (Ma = !0, Je().warn("BbTable: `toggleHighlighted` was called from a slot, but highlight is not bound, so nothing happened. Bind `v-model:highlighted`, or provide `highlighted` through `useBbTable(id, { highlighted })`, or drop the call — with nothing bound the table has nowhere to put the value.")));
|
|
844
|
+
}, Pa = (e, { viaSlot: t = !1 } = {}) => {
|
|
845
|
+
if (!Aa()) {
|
|
846
|
+
t && Na();
|
|
845
847
|
return;
|
|
846
848
|
}
|
|
847
|
-
if (
|
|
848
|
-
let n = e.valueHash in
|
|
849
|
-
|
|
850
|
-
},
|
|
851
|
-
let n =
|
|
852
|
-
if (
|
|
849
|
+
if (ja(e.item)) return;
|
|
850
|
+
let n = e.valueHash in Da.value;
|
|
851
|
+
lr.value = n ? null : e.value;
|
|
852
|
+
}, Fa = (e) => !(e.currentTarget instanceof Element) || Se(e, e.currentTarget), Ia = (e) => !Fa(e) && !window.getSelection()?.toString(), La = !1, Ra = (e) => sr.value.find(([t]) => t === e)?.[1] ?? null, za = (e, t) => {
|
|
853
|
+
let n = Ra(e), r = !!t?.shiftKey || t instanceof MouseEvent && t.detail === 0 && La;
|
|
854
|
+
if (La = !1, !O.multiSort && !r) {
|
|
853
855
|
let t = n === null ? "asc" : n === "asc" ? "desc" : null;
|
|
854
|
-
|
|
855
|
-
} else n === null ?
|
|
856
|
-
}, { state: G, isReady:
|
|
856
|
+
sr.value = t ? [[e, t]] : [];
|
|
857
|
+
} else n === null ? sr.value = [...sr.value, [e, "asc"]] : n === "asc" ? sr.value = sr.value.map((t) => t[0] === e ? [e, "desc"] : t) : sr.value = sr.value.filter(([t]) => t !== e);
|
|
858
|
+
}, { state: G, isReady: Ba } = qe(() => jr.value, {
|
|
857
859
|
selected: {
|
|
858
860
|
get: () => O.modelValue,
|
|
859
861
|
set: (e) => k("update:modelValue", e)
|
|
@@ -869,21 +871,21 @@ var Wt = {
|
|
|
869
871
|
}
|
|
870
872
|
},
|
|
871
873
|
sort: {
|
|
872
|
-
get: () =>
|
|
874
|
+
get: () => sr.value,
|
|
873
875
|
set: (e) => {
|
|
874
|
-
|
|
876
|
+
sr.value = e;
|
|
875
877
|
}
|
|
876
878
|
},
|
|
877
879
|
order: {
|
|
878
|
-
get: () =>
|
|
880
|
+
get: () => cr.value,
|
|
879
881
|
set: (e) => {
|
|
880
|
-
|
|
882
|
+
cr.value = e;
|
|
881
883
|
}
|
|
882
884
|
},
|
|
883
885
|
highlighted: {
|
|
884
|
-
get: () =>
|
|
886
|
+
get: () => lr.value,
|
|
885
887
|
set: (e) => {
|
|
886
|
-
|
|
888
|
+
lr.value = e;
|
|
887
889
|
}
|
|
888
890
|
},
|
|
889
891
|
page: { get: () => O.page === void 0 ? O.virtual ? 1 : void 0 : ce(O.page, 1) },
|
|
@@ -896,46 +898,46 @@ var Wt = {
|
|
|
896
898
|
infer: () => Array.isArray(O.items) ? O.items.length : void 0
|
|
897
899
|
},
|
|
898
900
|
totalPages: { get: () => O.totalPages === void 0 ? void 0 : ce(O.totalPages, 1) }
|
|
899
|
-
}),
|
|
900
|
-
|
|
901
|
-
|
|
901
|
+
}), Va = m(() => O.columns.some((e) => e.snap != null)), Ha = m(() => !!O.inheritColumnWidths || Va.value), Ua = m(() => O.fixed || Va.value || mi.value.some((e) => e.width != null) || Wi.value || Ha.value && !!Mr.value), K = m(() => Ha.value && !!Mr.value), Wa = C(""), Ga = C(0);
|
|
902
|
+
Pt(() => {
|
|
903
|
+
Pr.depth = K.value ? (Nr.value?.depth ?? 0) + 1 : 0;
|
|
902
904
|
});
|
|
903
|
-
let
|
|
905
|
+
let Ka = m(() => Ja.value === "drag-handle" || Ja.value === "select" ? Ga.value * Pr.depth : 0), qa = (e, t) => {
|
|
904
906
|
if (!t) return 0;
|
|
905
907
|
if (/^-?[\d.]+px$/.test(t)) return parseFloat(t);
|
|
906
908
|
let n = document.createElement("span");
|
|
907
909
|
n.style.cssText = `position:absolute;visibility:hidden;width:${t}`, e.appendChild(n);
|
|
908
910
|
let r = n.getBoundingClientRect().width;
|
|
909
911
|
return n.remove(), r;
|
|
910
|
-
},
|
|
912
|
+
}, Ja = m(() => {
|
|
911
913
|
if (!K.value) return null;
|
|
912
|
-
let e =
|
|
913
|
-
return e === "drag-handle" &&
|
|
914
|
+
let e = Wa.value || "select";
|
|
915
|
+
return e === "drag-handle" && R.value ? "drag-handle" : e !== "content" && O.selectable ? "select" : "content";
|
|
914
916
|
});
|
|
915
|
-
|
|
916
|
-
|
|
917
|
+
Pt(() => {
|
|
918
|
+
Pr.ordered = !!O.reorderable || cr.value.length > 0;
|
|
917
919
|
});
|
|
918
|
-
let q = m(() => !!O.virtual && !K.value && !A.tbody),
|
|
920
|
+
let q = m(() => !!O.virtual && !K.value && !A.tbody), Ya = C({}), Xa = C({}), Za = C(""), Qa = m(() => q.value && !!Za.value && Po.value.every((e) => !e.contentSized)), $a = (e) => q.value && e.width == null && !Bi(e) && String(e.key) in Ya.value, eo = K, to = (e) => {
|
|
919
921
|
if (typeof e == "number") return `${e}px`;
|
|
920
922
|
let t = e.trim();
|
|
921
923
|
return /^-?\d*\.?\d+$/.test(t) ? `${t}px` : t;
|
|
922
|
-
},
|
|
923
|
-
let e =
|
|
924
|
+
}, no = m(() => Nr.value?.keys ?? []), ro = m(() => +(no.value[0] === "select")), io = m(() => no.value.length), ao = m(() => {
|
|
925
|
+
let e = no.value;
|
|
924
926
|
return e[e.length - 1] === "actions" ? e.length - 1 : e.length;
|
|
925
|
-
}),
|
|
926
|
-
let t =
|
|
927
|
-
return t ?
|
|
928
|
-
},
|
|
929
|
-
if (!
|
|
927
|
+
}), oo = (e) => no.value.indexOf(e), so = (e) => {
|
|
928
|
+
let t = no.value[e];
|
|
929
|
+
return t ? Ir(t, "0px") : "0px";
|
|
930
|
+
}, co = (e, t) => {
|
|
931
|
+
if (!Mr.value || t - e <= 1e-6) return null;
|
|
930
932
|
let n = [];
|
|
931
933
|
for (let r = Math.floor(e); r < Math.ceil(t - 1e-6); r++) {
|
|
932
934
|
let i = Math.min(t, r + 1) - Math.max(e, r);
|
|
933
935
|
if (i <= 1e-6) continue;
|
|
934
|
-
let a =
|
|
936
|
+
let a = so(r);
|
|
935
937
|
n.push(i >= 1 - 1e-6 ? a : `${Number(i.toFixed(4))} * ${a}`);
|
|
936
938
|
}
|
|
937
939
|
return n.length ? n.length === 1 && !n[0].includes("*") ? n[0] : `calc(${n.join(" + ")})` : null;
|
|
938
|
-
},
|
|
940
|
+
}, lo = (e) => {
|
|
939
941
|
let t = /^(.+)\.(\d+)$/.exec(e);
|
|
940
942
|
return t ? {
|
|
941
943
|
key: t[1],
|
|
@@ -944,9 +946,9 @@ var Wt = {
|
|
|
944
946
|
key: e,
|
|
945
947
|
fraction: 0
|
|
946
948
|
};
|
|
947
|
-
},
|
|
949
|
+
}, uo = (e) => {
|
|
948
950
|
if (Array.isArray(e)) {
|
|
949
|
-
let t =
|
|
951
|
+
let t = lo(e[0]), n = lo(e[1]), r = oo(t.key), i = oo(n.key);
|
|
950
952
|
if (r < 0 || i < 0) return null;
|
|
951
953
|
let a = r + t.fraction, o = n.fraction > 0 ? i + n.fraction : i + 1;
|
|
952
954
|
return o > a ? {
|
|
@@ -955,9 +957,9 @@ var Wt = {
|
|
|
955
957
|
explicit: !0
|
|
956
958
|
} : null;
|
|
957
959
|
}
|
|
958
|
-
let t =
|
|
960
|
+
let t = lo(e), n = oo(t.key);
|
|
959
961
|
if (n < 0) {
|
|
960
|
-
let t =
|
|
962
|
+
let t = oo(e);
|
|
961
963
|
return t < 0 ? null : {
|
|
962
964
|
start: t,
|
|
963
965
|
end: t + 1,
|
|
@@ -969,20 +971,20 @@ var Wt = {
|
|
|
969
971
|
end: n + 1,
|
|
970
972
|
explicit: !1
|
|
971
973
|
};
|
|
972
|
-
},
|
|
973
|
-
let e =
|
|
974
|
+
}, fo = m(() => !!Nr.value?.ordered), po = m(() => {
|
|
975
|
+
let e = z.value, t = ro.value, n = ao.value, r = io.value, i = fo.value, a = e.map(() => null), o = /* @__PURE__ */ new Set(), s = (e) => {
|
|
974
976
|
for (let t = Math.floor(e.start); t < e.end - 1e-6; t++) o.add(t);
|
|
975
977
|
};
|
|
976
978
|
i || (e.forEach((e, t) => {
|
|
977
979
|
if (e.snap == null) return;
|
|
978
|
-
let n =
|
|
980
|
+
let n = uo(e.snap);
|
|
979
981
|
n && (a[t] = {
|
|
980
982
|
...n,
|
|
981
983
|
overflow: !1
|
|
982
984
|
}, s(a[t]));
|
|
983
985
|
}), e.forEach((e, r) => {
|
|
984
986
|
if (a[r] || e.snap != null) return;
|
|
985
|
-
let i =
|
|
987
|
+
let i = oo(String(e.key));
|
|
986
988
|
i < t || i >= n || o.has(i) || (a[r] = {
|
|
987
989
|
start: i,
|
|
988
990
|
end: i + 1,
|
|
@@ -1030,10 +1032,10 @@ var Wt = {
|
|
|
1030
1032
|
let i = u[r + 1];
|
|
1031
1033
|
i && !i.overflow && i.start > t.end && (t.end = i.start), r === e.length - 1 && e[r].width == null && (t.end = Math.max(t.end, n));
|
|
1032
1034
|
}), u;
|
|
1033
|
-
}),
|
|
1035
|
+
}), mo = (e) => K.value && e.overflow, ho = m(() => {
|
|
1034
1036
|
let e = /* @__PURE__ */ new Map();
|
|
1035
1037
|
if (!K.value) return e;
|
|
1036
|
-
let t =
|
|
1038
|
+
let t = po.value, n = z.value, r = (e) => !t[e].overflow && zi(n[e]) == null, i = t.length - 1;
|
|
1037
1039
|
for (; i >= 0 && t[i].overflow;) i--;
|
|
1038
1040
|
return t.forEach((a, o) => {
|
|
1039
1041
|
if (!a.overflow || o > i) return;
|
|
@@ -1042,55 +1044,55 @@ var Wt = {
|
|
|
1042
1044
|
for (let e = o + 1; e < t.length && s < 0; e++) r(e) && (s = e);
|
|
1043
1045
|
s < 0 || e.set(s, [...e.get(s) ?? [], String(n[o].key)]);
|
|
1044
1046
|
}), e;
|
|
1045
|
-
}),
|
|
1046
|
-
process.env.NODE_ENV !== "production" && (E(() =>
|
|
1047
|
+
}), go = m(() => new Set([...ho.value.values()].flat()));
|
|
1048
|
+
process.env.NODE_ENV !== "production" && (E(() => Va.value && fo.value, (e) => {
|
|
1047
1049
|
e && Je().warn("BbTable: `snap` targets are ignored under a parent that uses `order` / `reorderable` — the parent's columns can move, so the child inherits by position. Keep the parent's order static (no `reorderable`, an empty `order`) to snap by key.");
|
|
1048
|
-
}, { immediate: !0 }), E(() =>
|
|
1050
|
+
}, { immediate: !0 }), E(() => po.value.find((e) => e.demoted)?.demoted ?? null, (e) => {
|
|
1049
1051
|
e !== null && Je().warn(`BbTable: column '${e}' snaps to a parent column that sits BEFORE the column preceding it — the child's order disagrees with the parent's, so the snap cannot tile and the column flows into the next free parent track instead. Declare the child's columns in the parent's order.`);
|
|
1050
1052
|
}, { immediate: !0 }));
|
|
1051
|
-
let
|
|
1052
|
-
let t =
|
|
1053
|
-
return (t ?
|
|
1054
|
-
},
|
|
1053
|
+
let _o = m(() => po.value.some((e, t) => mo(e) && !go.value.has(String(z.value[t].key)))), vo = (e) => {
|
|
1054
|
+
let t = z.value[e];
|
|
1055
|
+
return (t ? zi(t) : null) == null && !K.value;
|
|
1056
|
+
}, yo = m(() => {
|
|
1055
1057
|
if (!K.value) return -1;
|
|
1056
|
-
let e =
|
|
1058
|
+
let e = z.value;
|
|
1057
1059
|
for (let t = e.length - 1; t >= 0; t--) {
|
|
1058
1060
|
let n = e[t];
|
|
1059
1061
|
if (n.width == null && n.snap == null) return t;
|
|
1060
1062
|
}
|
|
1061
1063
|
return -1;
|
|
1062
|
-
}),
|
|
1063
|
-
let e =
|
|
1064
|
-
return !
|
|
1065
|
-
}),
|
|
1066
|
-
let e =
|
|
1067
|
-
return !
|
|
1068
|
-
}),
|
|
1069
|
-
let e =
|
|
1064
|
+
}), bo = m(() => {
|
|
1065
|
+
let e = po.value, t = e.find((e) => !e.overflow) ?? e[0];
|
|
1066
|
+
return !Ha.value || !Mr.value || !t ? null : co(0, t.start);
|
|
1067
|
+
}), xo = m(() => {
|
|
1068
|
+
let e = po.value, t = e[e.length - 1];
|
|
1069
|
+
return !Ha.value || !Mr.value || !t || _o.value ? null : co(t.end, io.value);
|
|
1070
|
+
}), So = (e) => Pr.tracks[e] ?? null, Co = (e, t, n) => !Ha.value || !Mr.value ? null : n ? t ? `calc(${e ?? "0px"} - ${t})` : null : e, wo = m(() => !!O.selectable || R.value), To = m(() => {
|
|
1071
|
+
let e = So("select"), t = Ka.value;
|
|
1070
1072
|
return e && t ? `calc(${e} + ${t}px)` : e;
|
|
1071
|
-
}),
|
|
1072
|
-
let n = q.value ?
|
|
1073
|
-
return n == null ? e &&
|
|
1074
|
-
},
|
|
1073
|
+
}), Eo = m(() => Co(bo.value, wo.value ? To.value : null, wo.value)), Do = m(() => _o.value ? null : Co(xo.value, M.value ? So("actions") : null, M.value)), Oo = m(() => Eo.value !== null), ko = m(() => Do.value !== null), Ao = (e, t) => {
|
|
1074
|
+
let n = q.value ? Xa.value[t] : null;
|
|
1075
|
+
return n == null ? e && Mo.value ? "minmax(auto, max-content)" : "max-content" : `${n}px`;
|
|
1076
|
+
}, jo = m(() => {
|
|
1075
1077
|
let e = {};
|
|
1076
|
-
if (!
|
|
1077
|
-
let t =
|
|
1078
|
-
return
|
|
1079
|
-
}),
|
|
1080
|
-
let e = [], t =
|
|
1081
|
-
|
|
1082
|
-
key:
|
|
1083
|
-
width:
|
|
1084
|
-
contentSized:
|
|
1078
|
+
if (!Mo.value) return e;
|
|
1079
|
+
let t = bo.value, n = R.value && !!O.selectable, r = Ka.value, i = (e, t) => r && Ja.value === t ? `calc(${e} + ${r}px)` : e, a = Wr.value && r && Ja.value === "drag-handle" ? `calc(${Wr.value} - ${r}px)` : Wr.value;
|
|
1080
|
+
return R.value && !n && t && (e["--min-g"] = i(t, "drag-handle")), O.selectable && t && (R.value ? a && (e["--min-s"] = i(`calc(${t} - ${a})`, "select")) : e["--min-s"] = i(t, "select")), M.value && xo.value && !_o.value && (e["--min-a"] = xo.value), e;
|
|
1081
|
+
}), Mo = m(() => Object.keys(Nr.value?.tracks ?? {}).length > 0), No = (e) => /^(auto|min-content|max-content|(fit-content|minmax)\(.*\)|-?[\d.]+fr)$/.test(e.trim()), Po = m(() => {
|
|
1082
|
+
let e = [], t = R.value && !!O.selectable;
|
|
1083
|
+
R.value && e.push({
|
|
1084
|
+
key: Pn,
|
|
1085
|
+
width: Ao(t ? null : bo.value, Pn),
|
|
1086
|
+
contentSized: Xa.value[Pn] == null
|
|
1085
1087
|
}), O.selectable && e.push({
|
|
1086
1088
|
key: "select",
|
|
1087
|
-
width:
|
|
1088
|
-
contentSized:
|
|
1089
|
+
width: Ao(R.value ? bo.value && Wr.value ? `calc(${bo.value} - ${Wr.value})` : null : bo.value, "select"),
|
|
1090
|
+
contentSized: Xa.value.select == null
|
|
1089
1091
|
});
|
|
1090
|
-
let n =
|
|
1092
|
+
let n = z.value, r = n.length - 1, i = !K.value && n.length > 0 && n.every((e) => e.width != null && !No(to(e.width)));
|
|
1091
1093
|
return n.forEach((t, n) => {
|
|
1092
|
-
let a = String(t.key), o =
|
|
1093
|
-
if (s != null &&
|
|
1094
|
+
let a = String(t.key), o = zi(t), s = o == null ? null : to(o), c = po.value[n], l = null, u = null;
|
|
1095
|
+
if (s != null && No(s) ? u = s : s != null && i && !Bi(t) ? u = `minmax(${s}, ${parseFloat(s) || 1}fr)` : s != null && $a(t) ? u = `minmax(${s}, 1fr)` : s == null ? vo(n) ? u = O.fixed ? "minmax(0, 1fr)" : "auto" : Mo.value ? mo(c) ? u = "min-content" : (l = co(c.start, c.end), l === null && (u = "auto")) : u = "max-content" : l = s, u !== null) {
|
|
1094
1096
|
e.push({
|
|
1095
1097
|
key: a,
|
|
1096
1098
|
width: u,
|
|
@@ -1099,8 +1101,8 @@ var Wt = {
|
|
|
1099
1101
|
return;
|
|
1100
1102
|
}
|
|
1101
1103
|
let d = [];
|
|
1102
|
-
n === 0 &&
|
|
1103
|
-
let f = (
|
|
1104
|
+
n === 0 && Oo.value && d.push("var(--offset-internal-start, 0px)"), n === r && ko.value && d.push("var(--offset-internal-end, 0px)");
|
|
1105
|
+
let f = (ho.value.get(n) ?? []).map((e) => Pr.tracks[e]).filter(Boolean), p = [...d, l].join(" + "), ee = d.length || f.length ? `calc(${[p, ...f].join(" - ")})` : l, te = n === yo.value && !_o.value ? `minmax(${ee}, 1fr)` : ee;
|
|
1104
1106
|
e.push({
|
|
1105
1107
|
key: a,
|
|
1106
1108
|
width: te,
|
|
@@ -1108,187 +1110,187 @@ var Wt = {
|
|
|
1108
1110
|
});
|
|
1109
1111
|
}), M.value && e.push({
|
|
1110
1112
|
key: "actions",
|
|
1111
|
-
width:
|
|
1112
|
-
contentSized:
|
|
1113
|
+
width: Ao(xo.value, "actions"),
|
|
1114
|
+
contentSized: Xa.value.actions == null
|
|
1113
1115
|
}), e;
|
|
1114
|
-
}),
|
|
1115
|
-
let e =
|
|
1116
|
-
for (let n of
|
|
1116
|
+
}), Fo = m(() => {
|
|
1117
|
+
let e = z.value, t = [];
|
|
1118
|
+
for (let n of Po.value) n.contentSized || e.some((e) => String(e.key) === n.key) && t.push(n.key);
|
|
1117
1119
|
return t.join(" ");
|
|
1118
|
-
}),
|
|
1119
|
-
E(
|
|
1120
|
-
H &&
|
|
1120
|
+
}), Io = m(() => new Set(Fo.value.split(" ").filter(Boolean))), Lo = m(() => Po.value.map((e) => e.width).join(" ")), Ro = C(Lo.value), zo = m(() => `grid-template-columns: ${Ro.value}`);
|
|
1121
|
+
E(Lo, (e) => {
|
|
1122
|
+
H && F.value ? F.value.style.gridTemplateColumns = e : Ro.value = e;
|
|
1121
1123
|
}, { flush: "sync" });
|
|
1122
|
-
let
|
|
1124
|
+
let Bo = m(() => {
|
|
1123
1125
|
let e = {};
|
|
1124
|
-
return
|
|
1125
|
-
}),
|
|
1126
|
+
return Eo.value && (e["--offset-start"] = Eo.value), Do.value && (e["--offset-end"] = Do.value), Object.assign(e, jo.value), Pr.depth && (e["--depth"] = String(Pr.depth)), e;
|
|
1127
|
+
}), Vo = C({}), Ho = [
|
|
1126
1128
|
.62,
|
|
1127
1129
|
.42,
|
|
1128
1130
|
.78,
|
|
1129
1131
|
.52
|
|
1130
|
-
],
|
|
1132
|
+
], Uo = (e) => {
|
|
1131
1133
|
let t = ["transparent 0"], n = 0;
|
|
1132
1134
|
return e.forEach((e, r) => {
|
|
1133
|
-
let i =
|
|
1134
|
-
if (a >=
|
|
1135
|
-
let e = Math.round(n +
|
|
1135
|
+
let i = Ho[r % Ho.length], a = Math.round((e - 24) * i);
|
|
1136
|
+
if (a >= Xn) {
|
|
1137
|
+
let e = Math.round(n + Yn);
|
|
1136
1138
|
t.push(`transparent ${e}px`, `currentColor ${e}px ${e + a}px`, `transparent ${e + a}px`);
|
|
1137
1139
|
}
|
|
1138
1140
|
n += e;
|
|
1139
1141
|
}), `linear-gradient(90deg, ${t.join(",")})`;
|
|
1140
|
-
},
|
|
1142
|
+
}, Wo = (e) => {
|
|
1141
1143
|
if (!q.value) {
|
|
1142
|
-
|
|
1144
|
+
Vo.value["--placeholder-bars"] && (Vo.value = {});
|
|
1143
1145
|
return;
|
|
1144
1146
|
}
|
|
1145
1147
|
let t = e.map((e) => parseFloat(e));
|
|
1146
|
-
t.some((e) => !(e >= 0)) || (
|
|
1147
|
-
...
|
|
1148
|
-
"--placeholder-bars":
|
|
1148
|
+
t.some((e) => !(e >= 0)) || (Vo.value = {
|
|
1149
|
+
...Vo.value,
|
|
1150
|
+
"--placeholder-bars": Uo(t)
|
|
1149
1151
|
});
|
|
1150
|
-
},
|
|
1152
|
+
}, Go = () => {
|
|
1151
1153
|
if (!q.value) return;
|
|
1152
|
-
let e = Math.round(
|
|
1154
|
+
let e = Math.round(pl.value || Xc.value);
|
|
1153
1155
|
if (!(e > 0)) return;
|
|
1154
1156
|
let t = `${e}px`;
|
|
1155
|
-
|
|
1156
|
-
...
|
|
1157
|
+
Vo.value["--row-h"] !== t && (Vo.value = {
|
|
1158
|
+
...Vo.value,
|
|
1157
1159
|
"--row-h": t
|
|
1158
1160
|
});
|
|
1159
|
-
},
|
|
1160
|
-
...
|
|
1161
|
-
...K.value ? null : { "--ts":
|
|
1162
|
-
...
|
|
1163
|
-
...
|
|
1164
|
-
...O.fixedHeaders || q.value ? { "--stuck-head-h": `${
|
|
1165
|
-
...
|
|
1166
|
-
})),
|
|
1167
|
-
let e =
|
|
1161
|
+
}, Ko = m(() => ({
|
|
1162
|
+
...Fr.value,
|
|
1163
|
+
...K.value ? null : { "--ts": R.value && !O.selectable ? 1 : 0 },
|
|
1164
|
+
...Bo.value,
|
|
1165
|
+
...Vo.value,
|
|
1166
|
+
...O.fixedHeaders || q.value ? { "--stuck-head-h": `${Yo.value}px` } : null,
|
|
1167
|
+
...Qa.value ? { "--virtual-row-tracks": Za.value } : null
|
|
1168
|
+
})), qo = () => {
|
|
1169
|
+
let e = F.value, t = Po.value.length;
|
|
1168
1170
|
if (!e || !t) return [];
|
|
1169
1171
|
let n = e.querySelector(":scope > .bb-table__head > .bb-table__header-row"), r = [...n ? [n] : [], ...Array.from(e.querySelectorAll(":scope > .bb-table__head > [role=\"row\"], :scope > .bb-table__body > [role=\"row\"]"))].find((e) => e.children.length >= t);
|
|
1170
1172
|
return r ? Array.from(r.children) : [];
|
|
1171
|
-
},
|
|
1172
|
-
let e =
|
|
1173
|
+
}, Jo = "", Yo = C(0), Xo = () => {
|
|
1174
|
+
let e = F.value;
|
|
1173
1175
|
if (!e) return;
|
|
1174
1176
|
if (K.value) {
|
|
1175
1177
|
let t = getComputedStyle(e), n = t.getPropertyValue("--indent-at").trim();
|
|
1176
|
-
n !==
|
|
1177
|
-
let r =
|
|
1178
|
-
r !==
|
|
1178
|
+
n !== Wa.value && (Wa.value = n);
|
|
1179
|
+
let r = qa(e, t.getPropertyValue("--indent").trim());
|
|
1180
|
+
r !== Ga.value && (Ga.value = r);
|
|
1179
1181
|
}
|
|
1180
1182
|
if (O.fixedHeaders || q.value) {
|
|
1181
1183
|
let t = e.querySelector(":scope > .bb-table__head"), n = t ? Math.round(t.getBoundingClientRect().height) : 0;
|
|
1182
|
-
n !==
|
|
1184
|
+
n !== Yo.value && (Yo.value = n);
|
|
1183
1185
|
}
|
|
1184
1186
|
let t = Ve(e);
|
|
1185
1187
|
if (!t) return;
|
|
1186
|
-
let n =
|
|
1188
|
+
let n = Po.value.map((e) => e.key);
|
|
1187
1189
|
if (t.length !== n.length) return;
|
|
1188
|
-
let r = t.join(" "), i = `${
|
|
1189
|
-
if (i ===
|
|
1190
|
-
a &&
|
|
1190
|
+
let r = t.join(" "), i = `${rs.value}|${r}`, a = Qu.value !== Zo;
|
|
1191
|
+
if (i === Jo) {
|
|
1192
|
+
a && Qo(e, t);
|
|
1191
1193
|
return;
|
|
1192
1194
|
}
|
|
1193
|
-
|
|
1195
|
+
Jo = i;
|
|
1194
1196
|
let o = {};
|
|
1195
1197
|
n.forEach((e, n) => {
|
|
1196
1198
|
o[e] = t[n];
|
|
1197
1199
|
});
|
|
1198
|
-
let s =
|
|
1199
|
-
if (u && c && o[c] && (o[c] = `calc(${o[c]} - max(0px, ${u}))`, !O.selectable && !
|
|
1200
|
-
let e = o[
|
|
1201
|
-
|
|
1200
|
+
let s = B.value, c = s[0], l = s[s.length - 1], u = Eo.value, d = Do.value;
|
|
1201
|
+
if (u && c && o[c] && (o[c] = `calc(${o[c]} - max(0px, ${u}))`, !O.selectable && !R.value && bo.value && (o.select = bo.value)), Pn in o) {
|
|
1202
|
+
let e = o[Pn];
|
|
1203
|
+
Wr.value !== e && (Wr.value = e), o.select = o.select ? `calc(${e} + ${o.select})` : e, delete o[Pn];
|
|
1202
1204
|
}
|
|
1203
|
-
let f =
|
|
1204
|
-
f && o.select && c && o[c] && (o.select = `calc(${o.select} - ${f}px)`, o[c] = `calc(${o[c]} + ${f}px)`), d && l && o[l] && (o[l] = `calc(${o[l]} - max(0px, ${d}))`, !M.value &&
|
|
1205
|
+
let f = Ka.value;
|
|
1206
|
+
f && o.select && c && o[c] && (o.select = `calc(${o.select} - ${f}px)`, o[c] = `calc(${o[c]} + ${f}px)`), d && l && o[l] && (o[l] = `calc(${o[l]} - max(0px, ${d}))`, !M.value && xo.value && (o.actions = xo.value));
|
|
1205
1207
|
let p = [
|
|
1206
1208
|
..."select" in o ? ["select"] : [],
|
|
1207
1209
|
...s,
|
|
1208
1210
|
..."actions" in o ? ["actions"] : []
|
|
1209
1211
|
];
|
|
1210
|
-
|
|
1211
|
-
},
|
|
1212
|
-
Ee(e,
|
|
1213
|
-
},
|
|
1214
|
-
if (!
|
|
1215
|
-
|
|
1216
|
-
let e =
|
|
1217
|
-
e.forEach((e) =>
|
|
1212
|
+
jl(t), Wo(t), q.value && (Za.value = r), $o = t, Lr(o, p), (Zu.value.length || a) && Qo(e, t), Zu.value.length && Ec();
|
|
1213
|
+
}, Zo = "", Qo = (e, t) => {
|
|
1214
|
+
Ee(e, Zu.value, t) && (Zo = Qu.value);
|
|
1215
|
+
}, $o = null, es, ts = () => {
|
|
1216
|
+
if (!es) return;
|
|
1217
|
+
es.disconnect();
|
|
1218
|
+
let e = qo();
|
|
1219
|
+
e.forEach((e) => es?.observe(e)), e.length && Xo();
|
|
1218
1220
|
};
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
+
St(() => {
|
|
1222
|
+
es = new ResizeObserver(Xo), ts();
|
|
1221
1223
|
}), x(() => {
|
|
1222
|
-
|
|
1224
|
+
es?.disconnect();
|
|
1223
1225
|
});
|
|
1224
|
-
let
|
|
1225
|
-
E([
|
|
1226
|
-
b(
|
|
1227
|
-
|
|
1226
|
+
let ns = m(() => Po.value.map((e) => e.key).join(" ")), rs = m(() => B.value.join(" "));
|
|
1227
|
+
E([ns, rs], () => {
|
|
1228
|
+
b(ts), requestAnimationFrame(() => {
|
|
1229
|
+
F.value && Xo();
|
|
1228
1230
|
});
|
|
1229
1231
|
}, { flush: "post" });
|
|
1230
|
-
let
|
|
1232
|
+
let is = (e, t) => O.accessibleLabel ? O.accessibleLabel(e, t) : P("table.select", Ue(e, Tr.value)).value, as = m(() => O.selectable ? "fieldset" : "div"), os = m(() => O.legend || O.caption || P("table.selectableLegend").value), ss = m(() => O.loading || _s.value), cs = m(() => ss.value && !O.interactiveWhileLoading), ls = m(() => Ba.value && !o(G.page) && !o(G.perPage) && !o(G.totalItems) && G.page >= 1 && G.perPage > 0 && G.totalItems >= 0), us = m(() => ({
|
|
1231
1233
|
"bb-table": !0,
|
|
1232
1234
|
[`bb-table--align-${O.align}`]: !0,
|
|
1233
|
-
"bb-table--compact":
|
|
1235
|
+
"bb-table--compact": hr.compact,
|
|
1234
1236
|
"bb-table--reorderable": !!O.reorderable,
|
|
1235
|
-
"bb-table--rows-reorderable":
|
|
1236
|
-
"bb-table--resizable":
|
|
1237
|
-
"bb-table--fixed":
|
|
1238
|
-
"bb-table--inherit-widths":
|
|
1239
|
-
[`bb-table--indent-${
|
|
1237
|
+
"bb-table--rows-reorderable": R.value,
|
|
1238
|
+
"bb-table--resizable": Pi.value,
|
|
1239
|
+
"bb-table--fixed": Ua.value,
|
|
1240
|
+
"bb-table--inherit-widths": eo.value,
|
|
1241
|
+
[`bb-table--indent-${Ja.value}`]: !!Ja.value,
|
|
1240
1242
|
"bb-table--fixed-header": O.fixedHeaders || q.value,
|
|
1241
1243
|
"bb-table--virtual": q.value,
|
|
1242
|
-
"bb-table--virtual-flat":
|
|
1243
|
-
"bb-table--loading":
|
|
1244
|
+
"bb-table--virtual-flat": Qa.value,
|
|
1245
|
+
"bb-table--loading": ss.value,
|
|
1244
1246
|
"bb-table--empty": !J.value.length,
|
|
1245
1247
|
"bb-table--selectable": !!O.selectable,
|
|
1246
|
-
"bb-table--overflow-left":
|
|
1247
|
-
"bb-table--overflow-right":
|
|
1248
|
-
"bb-table--pinned-left":
|
|
1249
|
-
"bb-table--pinned-right":
|
|
1248
|
+
"bb-table--overflow-left": cc.value,
|
|
1249
|
+
"bb-table--overflow-right": lc.value,
|
|
1250
|
+
"bb-table--pinned-left": fc.value,
|
|
1251
|
+
"bb-table--pinned-right": pc.value,
|
|
1250
1252
|
"scrollbar-border": !0
|
|
1251
|
-
})),
|
|
1252
|
-
items:
|
|
1253
|
+
})), ds = m(() => mi.value.length + Number(R.value) + Number(!!O.selectable) + Number(M.value)), fs = m(() => Object.fromEntries(O.columns.map((e) => [e.key, Oe(e.key)]))), { getter: ps, clientReproducible: ms, hydratedFromSsr: hs, items: gs, loading: _s, error: vs, retry: ys, ssrMarker: bs } = d({
|
|
1254
|
+
items: At(O, "items"),
|
|
1253
1255
|
marker: !0
|
|
1254
|
-
}),
|
|
1255
|
-
await
|
|
1256
|
-
}, { hasPrefilled:
|
|
1257
|
-
alreadyLoaded:
|
|
1258
|
-
clientReproducible:
|
|
1256
|
+
}), xs = m(() => O.failedText || P("common.failedText").value), Ss = async () => {
|
|
1257
|
+
await ys() === "applied" && ks();
|
|
1258
|
+
}, { hasPrefilled: Cs, whenPrefilled: ws } = p({
|
|
1259
|
+
alreadyLoaded: hs,
|
|
1260
|
+
clientReproducible: ms,
|
|
1259
1261
|
trigger: !0,
|
|
1260
1262
|
fn: async () => {
|
|
1261
|
-
await
|
|
1263
|
+
await ps(void 0, "initial", G.selected) === "applied" && ks();
|
|
1262
1264
|
}
|
|
1263
|
-
}), { data:
|
|
1265
|
+
}), { data: Ts } = ee({ items: m(() => {
|
|
1264
1266
|
let e = G.selected;
|
|
1265
1267
|
return O.multiple ? e ?? [] : e == null ? [] : [e];
|
|
1266
1268
|
}) }), { options: J, baseOptions: Y } = te({
|
|
1267
|
-
disabled:
|
|
1268
|
-
items:
|
|
1269
|
+
disabled: At(() => O.disabled),
|
|
1270
|
+
items: gs,
|
|
1269
1271
|
itemText: void 0,
|
|
1270
1272
|
itemValue: O.itemValue,
|
|
1271
|
-
max:
|
|
1273
|
+
max: At(() => O.max),
|
|
1272
1274
|
selectable: !0,
|
|
1273
|
-
selectedIndexedByHash:
|
|
1274
|
-
}),
|
|
1275
|
-
E(Y, () =>
|
|
1275
|
+
selectedIndexedByHash: Ts
|
|
1276
|
+
}), Es = m(() => !ss.value && !J.value.length);
|
|
1277
|
+
E(Y, () => Kr.sync(), { flush: "post" });
|
|
1276
1278
|
let X = m(() => {
|
|
1277
|
-
let e = new Set(
|
|
1278
|
-
if (!e.size ||
|
|
1279
|
+
let e = new Set(xr.value.split(" ").filter(Boolean));
|
|
1280
|
+
if (!e.size || vr.value || !J.value.length) return {
|
|
1279
1281
|
first: !1,
|
|
1280
1282
|
last: !1
|
|
1281
1283
|
};
|
|
1282
|
-
let t = (t) =>
|
|
1284
|
+
let t = (t) => z.value.some((n) => e.has(`${fs.value[n.key]}:${t}`));
|
|
1283
1285
|
return {
|
|
1284
1286
|
first: t("first"),
|
|
1285
1287
|
last: t("last")
|
|
1286
1288
|
};
|
|
1287
|
-
}),
|
|
1289
|
+
}), Ds = async (e) => {
|
|
1288
1290
|
O.multiple ? G.selected = (G.selected ?? []).concat(e.value) : G.selected = e.value;
|
|
1289
|
-
},
|
|
1291
|
+
}, Os = async (e) => {
|
|
1290
1292
|
if (O.multiple) {
|
|
1291
|
-
let t = { ...
|
|
1293
|
+
let t = { ...Ts.value };
|
|
1292
1294
|
delete t[e.valueHash], G.selected = Object.values(t);
|
|
1293
1295
|
} else G.selected = null;
|
|
1294
1296
|
};
|
|
@@ -1297,11 +1299,11 @@ var Wt = {
|
|
|
1297
1299
|
O.items,
|
|
1298
1300
|
typeof O.items == "function" ? [G.page, G.perPage] : void 0
|
|
1299
1301
|
], async (e, t) => {
|
|
1300
|
-
if (
|
|
1302
|
+
if (Cs.value || await ws(), !Cs.value) return;
|
|
1301
1303
|
let n = (n) => a(e?.[n]) !== a(t?.[n]), r = t && !n(0) && !n(1) && n(2) ? "pagination" : "dependencies";
|
|
1302
|
-
await
|
|
1304
|
+
await ps(void 0, r, G.selected) === "applied" && ks();
|
|
1303
1305
|
}, { debounce: O.depsDebounceTime });
|
|
1304
|
-
let
|
|
1306
|
+
let ks = () => {
|
|
1305
1307
|
if (!O.enforceCoherence) return;
|
|
1306
1308
|
let e = new Set(J.value.map((e) => e.valueHash)), t = (t) => e.has(a(t));
|
|
1307
1309
|
if (O.multiple) {
|
|
@@ -1309,9 +1311,9 @@ var Wt = {
|
|
|
1309
1311
|
e.every(t) || (G.selected = e.filter(t));
|
|
1310
1312
|
} else !o(G.selected) && !t(G.selected) && (G.selected = null);
|
|
1311
1313
|
let n = G.unselected ?? [];
|
|
1312
|
-
n.every(t) || (G.unselected = n.filter(t)), !o(
|
|
1313
|
-
},
|
|
1314
|
-
let n =
|
|
1314
|
+
n.every(t) || (G.unselected = n.filter(t)), !o(lr.value) && !t(lr.value) && (lr.value = null), mr.value.every(t) || (mr.value = mr.value.filter(t));
|
|
1315
|
+
}, As = (e, t) => {
|
|
1316
|
+
let n = Dr(t, e.key);
|
|
1315
1317
|
return e.formatter && (!o(n) || e.formatOnNull !== !1) && (n = e.formatter(n, e.key, t)), o(n) ? e.placeholder ? {
|
|
1316
1318
|
content: e.placeholder,
|
|
1317
1319
|
kind: "placeholder"
|
|
@@ -1322,16 +1324,16 @@ var Wt = {
|
|
|
1322
1324
|
content: n,
|
|
1323
1325
|
kind: "value"
|
|
1324
1326
|
};
|
|
1325
|
-
},
|
|
1326
|
-
let r = () => n().content, i =
|
|
1327
|
+
}, js = (e, t) => As(e, t).content, Ms = (e, t, n) => {
|
|
1328
|
+
let r = () => n().content, i = fs.value[e.key], a = e.align ?? "start";
|
|
1327
1329
|
return {
|
|
1328
1330
|
align: a,
|
|
1329
1331
|
get classes() {
|
|
1330
1332
|
let n = String(e.key);
|
|
1331
|
-
return Fe(
|
|
1333
|
+
return Fe(Gs.value.has(n) ? [
|
|
1332
1334
|
`bb-table__cell--${a}`,
|
|
1333
1335
|
"bb-table__cell--fluid",
|
|
1334
|
-
...
|
|
1336
|
+
...Bs(n, r())
|
|
1335
1337
|
] : [`bb-table__cell--${a}`], O.tdClass, e.tdClass, r(), e.key, t.item);
|
|
1336
1338
|
},
|
|
1337
1339
|
get content() {
|
|
@@ -1344,19 +1346,19 @@ var Wt = {
|
|
|
1344
1346
|
label: e.label,
|
|
1345
1347
|
slotName: i
|
|
1346
1348
|
};
|
|
1347
|
-
},
|
|
1349
|
+
}, Ns = m(() => {
|
|
1348
1350
|
let e = {};
|
|
1349
1351
|
if (O.fixed || K.value || q.value || A.thead) return e;
|
|
1350
|
-
let t = Ge(
|
|
1351
|
-
for (let n of
|
|
1352
|
+
let t = Ge(gs.value ?? []);
|
|
1353
|
+
for (let n of z.value) zi(n) ?? (A[fs.value[n.key]] || (e[String(n.key)] = t.map((e) => w(js(n, e)))));
|
|
1352
1354
|
return e;
|
|
1353
|
-
}),
|
|
1354
|
-
table: () =>
|
|
1355
|
-
container: () =>
|
|
1356
|
-
columns: () =>
|
|
1357
|
-
em: () =>
|
|
1355
|
+
}), Ps = m(() => Z.value?.em ?? 0), Fs = Ke({
|
|
1356
|
+
table: () => F.value,
|
|
1357
|
+
container: () => I.value,
|
|
1358
|
+
columns: () => Us(),
|
|
1359
|
+
em: () => Ps.value,
|
|
1358
1360
|
plan: () => {
|
|
1359
|
-
let { stage: e, hold: t, floors: n, wrapLabels: r } =
|
|
1361
|
+
let { stage: e, hold: t, floors: n, wrapLabels: r } = Js.value;
|
|
1360
1362
|
return JSON.stringify([
|
|
1361
1363
|
e,
|
|
1362
1364
|
t,
|
|
@@ -1364,18 +1366,18 @@ var Wt = {
|
|
|
1364
1366
|
[...r]
|
|
1365
1367
|
]);
|
|
1366
1368
|
}
|
|
1367
|
-
}),
|
|
1368
|
-
|
|
1369
|
+
}), Is = m(() => {
|
|
1370
|
+
Fs.version.value;
|
|
1369
1371
|
let e = {};
|
|
1370
|
-
for (let [t, n] of Object.entries(
|
|
1372
|
+
for (let [t, n] of Object.entries(Ns.value)) e[t] = Be(n, Fs.lookup(t));
|
|
1371
1373
|
return e;
|
|
1372
|
-
}),
|
|
1374
|
+
}), Ls = m(() => {
|
|
1373
1375
|
let e = [];
|
|
1374
|
-
for (let [t, n] of Object.entries(
|
|
1376
|
+
for (let [t, n] of Object.entries(Is.value)) n && e.push(`${t}\u0001${+!!n.prose}\u0001${n.usual}`);
|
|
1375
1377
|
return e.join("");
|
|
1376
|
-
}),
|
|
1378
|
+
}), Rs = m(() => {
|
|
1377
1379
|
let e = /* @__PURE__ */ new Map();
|
|
1378
|
-
for (let t of
|
|
1380
|
+
for (let t of Ls.value.split("")) {
|
|
1379
1381
|
if (!t) continue;
|
|
1380
1382
|
let [n, r, i] = t.split("");
|
|
1381
1383
|
e.set(n, {
|
|
@@ -1384,28 +1386,28 @@ var Wt = {
|
|
|
1384
1386
|
});
|
|
1385
1387
|
}
|
|
1386
1388
|
return e;
|
|
1387
|
-
}),
|
|
1388
|
-
let e =
|
|
1389
|
+
}), zs = m(() => {
|
|
1390
|
+
let e = gs.value ?? [];
|
|
1389
1391
|
if (!je(e.length)) return null;
|
|
1390
1392
|
let t = Ge(e), n = /* @__PURE__ */ new Map();
|
|
1391
|
-
for (let e of
|
|
1393
|
+
for (let e of z.value) A[fs.value[e.key]] || n.set(String(e.key), new Set(t.map((t) => w(js(e, t)).trim())));
|
|
1392
1394
|
return n;
|
|
1393
|
-
}),
|
|
1394
|
-
let n =
|
|
1395
|
+
}), Bs = (e, t) => {
|
|
1396
|
+
let n = Rs.value.get(e);
|
|
1395
1397
|
if (!n) return [];
|
|
1396
1398
|
let r = w(t);
|
|
1397
|
-
return
|
|
1398
|
-
},
|
|
1399
|
-
let e = {}, t =
|
|
1400
|
-
for (let o of
|
|
1399
|
+
return zs.value?.get(e)?.has(r.trim()) === !1 ? [] : De(r, n);
|
|
1400
|
+
}, Vs = m(() => {
|
|
1401
|
+
let e = {}, t = Is.value, n = Z.value?.padEm ?? 1.5, r = Z.value?.head, i = Z.value ? Z.value.rootEm / Z.value.em : 1, a = n / i;
|
|
1402
|
+
for (let o of z.value) {
|
|
1401
1403
|
let s = String(o.key);
|
|
1402
1404
|
if (!(s in t)) continue;
|
|
1403
|
-
let c = o.sortable ? 1.3 : 0, l = Ae(t[s], r ?
|
|
1404
|
-
l.squeeze = (l.squeeze - a) * i + n,
|
|
1405
|
+
let c = o.sortable ? 1.3 : 0, l = Ae(t[s], r ? Ks(o.label ?? "", r.transform) : o.label ?? "", n + Fs.extraPadOf(s), c, r, a, Fs.labelOf(s, c));
|
|
1406
|
+
l.squeeze = (l.squeeze - a) * i + n, Hs(o) || (l.labelWrap = l.label, l.wrapped = l.hard), e[String(o.key)] = l;
|
|
1405
1407
|
}
|
|
1406
1408
|
return e;
|
|
1407
|
-
}),
|
|
1408
|
-
let t =
|
|
1409
|
+
}), Hs = (e) => {
|
|
1410
|
+
let t = fs.value[e.key];
|
|
1409
1411
|
return ![
|
|
1410
1412
|
`${t}:header`,
|
|
1411
1413
|
`${t}:header:prepend`,
|
|
@@ -1413,65 +1415,65 @@ var Wt = {
|
|
|
1413
1415
|
"header:prepend",
|
|
1414
1416
|
"header:append"
|
|
1415
1417
|
].some((e) => A[e]);
|
|
1416
|
-
},
|
|
1417
|
-
let e =
|
|
1418
|
-
return
|
|
1418
|
+
}, Us = () => {
|
|
1419
|
+
let e = Ns.value, t = Number(R.value) + Number(!!O.selectable), n = [];
|
|
1420
|
+
return z.value.forEach((r, i) => {
|
|
1419
1421
|
let a = String(r.key);
|
|
1420
1422
|
a in e && n.push({
|
|
1421
1423
|
key: a,
|
|
1422
1424
|
index: i + t,
|
|
1423
1425
|
values: e[a],
|
|
1424
1426
|
placeholder: r.placeholder || void 0,
|
|
1425
|
-
prose:
|
|
1426
|
-
label:
|
|
1427
|
+
prose: Rs.value.get(a)?.prose ?? !1,
|
|
1428
|
+
label: Hs(r) && r.label || void 0,
|
|
1427
1429
|
dynamic: typeof O.tdClass == "function" || typeof r.tdClass == "function" || typeof O.rowClass == "function"
|
|
1428
1430
|
});
|
|
1429
1431
|
}), n;
|
|
1430
|
-
},
|
|
1432
|
+
}, Ws = m(() => Object.keys(Vs.value).join(" ")), Gs = m(() => new Set(Ws.value.split(" ").filter(Boolean))), Z = C(null), Ks = (e, t) => t === "uppercase" ? e.toUpperCase() : t === "lowercase" ? e.toLowerCase() : t === "capitalize" ? e.replace(/(^|\s)(\S)/g, (e, t, n) => t + n.toUpperCase()) : e, qs = m(() => {
|
|
1431
1433
|
let e = Z.value;
|
|
1432
1434
|
if (!e) return 0;
|
|
1433
|
-
let t =
|
|
1434
|
-
let n =
|
|
1435
|
+
let t = z.value.reduce((e, t) => {
|
|
1436
|
+
let n = zi(t), r = n == null ? "" : to(n);
|
|
1435
1437
|
return e + (/^[\d.]+px$/.test(r) ? parseFloat(r) : 0);
|
|
1436
1438
|
}, 0);
|
|
1437
1439
|
return Math.max(0, (e.width - t) / e.em);
|
|
1438
|
-
}),
|
|
1440
|
+
}), Js = m(() => Me(Vs.value, qs.value, Z.value ? {
|
|
1439
1441
|
em: Z.value.em,
|
|
1440
1442
|
padEm: Z.value.padEm
|
|
1441
|
-
} : void 0)),
|
|
1442
|
-
let { hold: e } =
|
|
1443
|
-
return
|
|
1444
|
-
}),
|
|
1445
|
-
let { floors: e } =
|
|
1443
|
+
} : void 0)), Ys = m(() => {
|
|
1444
|
+
let { hold: e } = Js.value;
|
|
1445
|
+
return Ws.value && e !== "none" ? `bb-table__table--hold-${e}` : void 0;
|
|
1446
|
+
}), Xs = m(() => Js.value.wrapLabels), Zs = m(() => {
|
|
1447
|
+
let { floors: e } = Js.value, t = Z.value, n = t?.padEm ?? 1.5, r = {};
|
|
1446
1448
|
for (let i in e) {
|
|
1447
1449
|
let a = Math.max(0, e[i] - n);
|
|
1448
1450
|
r[i] = { "--floor": t ? `${Ne(e[i], n, t.em)}px` : `calc(${a.toFixed(2)} * var(--bb-fs, 1em))` };
|
|
1449
1451
|
}
|
|
1450
1452
|
return r;
|
|
1451
|
-
}), Q,
|
|
1453
|
+
}), Q, Qs = 0, $s, ec = (e) => {
|
|
1452
1454
|
let t = [];
|
|
1453
1455
|
for (let n = e.parentElement; n; n = n.parentElement) getComputedStyle(n).containerType !== "normal" && t.push(`${n.clientWidth}x${n.clientHeight}`);
|
|
1454
1456
|
return t.join(",");
|
|
1455
|
-
},
|
|
1457
|
+
}, tc = (e) => {
|
|
1456
1458
|
let t = getComputedStyle(e), n = t.getPropertyValue("--bb-fs").trim(), r = [
|
|
1457
1459
|
n,
|
|
1458
1460
|
t.fontSize,
|
|
1459
1461
|
getComputedStyle(document.documentElement).fontSize,
|
|
1460
1462
|
/v(w|h|i|b|min|max)|cq/.test(n) ? `${window.innerWidth}x${window.innerHeight}` : "",
|
|
1461
|
-
/cq/.test(n) ?
|
|
1463
|
+
/cq/.test(n) ? ec(e) : ""
|
|
1462
1464
|
].join("|");
|
|
1463
|
-
if (
|
|
1465
|
+
if ($s?.key === r) return $s.em;
|
|
1464
1466
|
let i = document.createElement("span");
|
|
1465
1467
|
i.style.cssText = "position:absolute;visibility:hidden;font-size:var(--bb-fs,1em)", e.append(i);
|
|
1466
1468
|
let a = parseFloat(getComputedStyle(i).fontSize);
|
|
1467
|
-
return i.remove(),
|
|
1469
|
+
return i.remove(), $s = {
|
|
1468
1470
|
key: r,
|
|
1469
1471
|
em: a
|
|
1470
1472
|
}, a;
|
|
1471
|
-
},
|
|
1472
|
-
let e =
|
|
1473
|
+
}, nc = () => {
|
|
1474
|
+
let e = I.value, t = F.value;
|
|
1473
1475
|
if (!e?.isConnected || !t) return;
|
|
1474
|
-
let n = getComputedStyle(t), r = parseFloat(n.fontSize) || 16, i =
|
|
1476
|
+
let n = getComputedStyle(t), r = parseFloat(n.fontSize) || 16, i = tc(e) || r, a = 2 * (parseFloat(n.getPropertyValue("--px")) || 12) / i, o = 0;
|
|
1475
1477
|
for (let e of t.querySelectorAll(":scope > .bb-table__head > [role=\"row\"] > :is(.bb-table__cell-column-header--row-drag, .bb-table__cell-column-header--select, .bb-table__cell-column-header--actions)")) o += e.getBoundingClientRect().width;
|
|
1476
1478
|
let s = e.clientWidth ? Math.max(1, e.clientWidth - o) : 0, c = t.querySelector(".bb-table-header__content"), l;
|
|
1477
1479
|
if (c) {
|
|
@@ -1490,7 +1492,7 @@ var Wt = {
|
|
|
1490
1492
|
padEm: a,
|
|
1491
1493
|
head: l
|
|
1492
1494
|
});
|
|
1493
|
-
},
|
|
1495
|
+
}, rc = {
|
|
1494
1496
|
units: {
|
|
1495
1497
|
whole: ".bb-table__cell--fluid:is(.bb-table__cell--line, .bb-table__cell--token)",
|
|
1496
1498
|
word: ".bb-table__cell--fluid.bb-table__cell--word"
|
|
@@ -1504,82 +1506,82 @@ var Wt = {
|
|
|
1504
1506
|
word: ".bb-table__cell--fluid:is(.bb-table__cell--line, .bb-table__cell--word)"
|
|
1505
1507
|
},
|
|
1506
1508
|
none: {}
|
|
1507
|
-
},
|
|
1508
|
-
let { stage: e, hold: t, floors: n } =
|
|
1509
|
-
e >= 7 || !Object.keys(n).length ||
|
|
1510
|
-
},
|
|
1511
|
-
|
|
1512
|
-
},
|
|
1513
|
-
cancelAnimationFrame(
|
|
1509
|
+
}, ic = () => {
|
|
1510
|
+
let { stage: e, hold: t, floors: n } = Js.value;
|
|
1511
|
+
e >= 7 || !Object.keys(n).length || Fs.guard(t, rc[t]);
|
|
1512
|
+
}, ac = (e = !1) => {
|
|
1513
|
+
nc(), q.value || (Fs.checkTypography(), Fs.measure(e), b(ic));
|
|
1514
|
+
}, oc = () => {
|
|
1515
|
+
cancelAnimationFrame(Qs), Qs = requestAnimationFrame(() => ac());
|
|
1514
1516
|
};
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
}), E([
|
|
1517
|
+
St(() => {
|
|
1518
|
+
I.value && typeof ResizeObserver < "u" && (q.value || ac(!0), Q = new ResizeObserver(oc), Q.observe(I.value), F.value && !q.value && Q.observe(F.value), Fs.onFontsChanged(() => !q.value && oc()));
|
|
1519
|
+
}), E([F, q], ([e, t], [n]) => {
|
|
1518
1520
|
Q && (n && Q.unobserve(n), e && !t && Q.observe(e));
|
|
1519
1521
|
});
|
|
1520
|
-
let
|
|
1521
|
-
E(
|
|
1522
|
-
Object.entries(e).every(([e, n]) =>
|
|
1523
|
-
}), E(
|
|
1524
|
-
Q && (t && Q.unobserve(t), e && Q.observe(e),
|
|
1522
|
+
let sc = (e, t) => e?.length === t.length && e.every((e, n) => e === t[n]);
|
|
1523
|
+
E(Ns, (e, t) => {
|
|
1524
|
+
Object.entries(e).every(([e, n]) => sc(t?.[e], n)) || (Fs.rowsChanged(), Q && oc());
|
|
1525
|
+
}), E(I, (e, t) => {
|
|
1526
|
+
Q && (t && Q.unobserve(t), e && Q.observe(e), oc());
|
|
1525
1527
|
}), E(() => [
|
|
1526
1528
|
!!O.selectable,
|
|
1527
|
-
|
|
1529
|
+
R.value,
|
|
1528
1530
|
M.value
|
|
1529
|
-
], () => Q &&
|
|
1530
|
-
Q?.disconnect(), cancelAnimationFrame(
|
|
1531
|
+
], () => Q && oc()), x(() => {
|
|
1532
|
+
Q?.disconnect(), cancelAnimationFrame(Qs), Fs.dispose();
|
|
1531
1533
|
});
|
|
1532
|
-
let
|
|
1533
|
-
let t =
|
|
1534
|
-
return t ?
|
|
1534
|
+
let cc = C(!1), lc = C(!1), uc = C(!1), dc = C(!1), fc = C(!1), pc = C(!1), mc, hc = 0, gc = 0, _c = (e) => {
|
|
1535
|
+
let t = $o;
|
|
1536
|
+
return t ? Zu.value.reduce((n, r) => {
|
|
1535
1537
|
let i = typeof r == "number" ? {
|
|
1536
1538
|
index: r,
|
|
1537
1539
|
position: "left"
|
|
1538
1540
|
} : r;
|
|
1539
1541
|
return i.position === e ? n + (parseFloat(t[i.index] ?? "") || 0) : n;
|
|
1540
1542
|
}, 0) : 0;
|
|
1541
|
-
},
|
|
1542
|
-
let e =
|
|
1543
|
+
}, vc = 0, yc = !1, bc = "", xc = () => {
|
|
1544
|
+
let e = I.value;
|
|
1543
1545
|
if (!e) return;
|
|
1544
|
-
let t =
|
|
1545
|
-
|
|
1546
|
-
},
|
|
1547
|
-
let e =
|
|
1546
|
+
let t = vc, n = yc ? t + e.scrollLeft : e.scrollLeft;
|
|
1547
|
+
cc.value = t > 1 && n > 1, lc.value = t > 1 && t - n > 1;
|
|
1548
|
+
}, Sc = () => {
|
|
1549
|
+
let e = I.value;
|
|
1548
1550
|
if (!e) return;
|
|
1549
|
-
|
|
1550
|
-
let t =
|
|
1551
|
-
r !==
|
|
1552
|
-
},
|
|
1553
|
-
|
|
1551
|
+
vc = K.value ? 0 : e.scrollWidth - e.clientWidth, yc = Ye(e), uc.value = !K.value && (vc > 1 || e.scrollHeight - e.clientHeight > 1), Cc();
|
|
1552
|
+
let t = _c(yc ? "right" : "left"), n = _c(yc ? "left" : "right"), r = `${t} ${n}`;
|
|
1553
|
+
r !== bc && (bc = r, e.style.setProperty("--pin-l", `${t}px`), e.style.setProperty("--pin-r", `${n}px`)), K.value || e.style.setProperty("--vw", `${e.clientWidth}px`), fc.value = t > 0, pc.value = n > 0, xc();
|
|
1554
|
+
}, Cc = () => {
|
|
1555
|
+
dc.value = !!I.value?.querySelector(Zn);
|
|
1554
1556
|
};
|
|
1555
|
-
|
|
1556
|
-
let
|
|
1557
|
+
Ct(Cc);
|
|
1558
|
+
let wc = m(() => {
|
|
1557
1559
|
if (N.value) return { tabindex: -1 };
|
|
1558
|
-
if (!
|
|
1559
|
-
if (
|
|
1560
|
+
if (!uc.value) return {};
|
|
1561
|
+
if (dc.value) return { tabindex: -1 };
|
|
1560
1562
|
let e = j.rootAttrs;
|
|
1561
1563
|
return {
|
|
1562
1564
|
tabindex: 0,
|
|
1563
|
-
...(O.caption || e["aria-label"] || e["aria-labelledby"]) &&
|
|
1564
|
-
...O.caption ? { "aria-labelledby":
|
|
1565
|
+
...(O.caption || e["aria-label"] || e["aria-labelledby"]) && as.value === "div" ? { role: "region" } : {},
|
|
1566
|
+
...O.caption ? { "aria-labelledby": Rr.value } : {}
|
|
1565
1567
|
};
|
|
1566
|
-
}),
|
|
1567
|
-
cancelAnimationFrame(
|
|
1568
|
-
},
|
|
1569
|
-
cancelAnimationFrame(
|
|
1568
|
+
}), Tc = () => {
|
|
1569
|
+
cancelAnimationFrame(hc), hc = requestAnimationFrame(xc);
|
|
1570
|
+
}, Ec = () => {
|
|
1571
|
+
cancelAnimationFrame(gc), gc = requestAnimationFrame(Sc);
|
|
1570
1572
|
};
|
|
1571
|
-
|
|
1572
|
-
let e =
|
|
1573
|
-
e && t && (e.addEventListener("scroll",
|
|
1574
|
-
}), E(L, (e, t) => {
|
|
1575
|
-
t?.removeEventListener("scroll", bc), e && (e.addEventListener("scroll", bc, { passive: !0 }), lc && (t && lc.unobserve(t), lc.observe(e), xc()));
|
|
1573
|
+
St(() => {
|
|
1574
|
+
let e = I.value, t = F.value;
|
|
1575
|
+
e && t && (e.addEventListener("scroll", Tc, { passive: !0 }), typeof ResizeObserver < "u" && (mc = new ResizeObserver(Ec), mc.observe(e), mc.observe(t)));
|
|
1576
1576
|
}), E(I, (e, t) => {
|
|
1577
|
-
|
|
1577
|
+
t?.removeEventListener("scroll", Tc), e && (e.addEventListener("scroll", Tc, { passive: !0 }), mc && (t && mc.unobserve(t), mc.observe(e), Ec()));
|
|
1578
|
+
}), E(F, (e, t) => {
|
|
1579
|
+
mc && (t && mc.unobserve(t), e && mc.observe(e), Ec());
|
|
1578
1580
|
}), x(() => {
|
|
1579
|
-
|
|
1581
|
+
I.value?.removeEventListener("scroll", Tc), mc?.disconnect(), cancelAnimationFrame(hc), cancelAnimationFrame(gc);
|
|
1580
1582
|
});
|
|
1581
|
-
let
|
|
1582
|
-
let t = e.align ?? "start", n = `${
|
|
1583
|
+
let Dc = m(() => z.value.map((e) => {
|
|
1584
|
+
let t = e.align ?? "start", n = `${fs.value[e.key]}:header`, r = Ra(e.key), i = r ?? e.sorted, a = i ? i === "asc" ? "ascending" : "descending" : void 0;
|
|
1583
1585
|
return {
|
|
1584
1586
|
align: t,
|
|
1585
1587
|
key: e.key,
|
|
@@ -1590,47 +1592,47 @@ var Wt = {
|
|
|
1590
1592
|
sortDirection: a,
|
|
1591
1593
|
sortOrder: r
|
|
1592
1594
|
};
|
|
1593
|
-
})),
|
|
1595
|
+
})), Oc = (e, t) => [`${fs.value[e]}:header:${t}`, `header:${t}`].filter((e) => A[e]), kc = (e) => {
|
|
1594
1596
|
for (let t of e.names) {
|
|
1595
1597
|
let n = s(A[t], e.scope);
|
|
1596
1598
|
if (n) return n;
|
|
1597
1599
|
}
|
|
1598
1600
|
return null;
|
|
1599
1601
|
};
|
|
1600
|
-
|
|
1601
|
-
let
|
|
1602
|
+
kc.props = ["names", "scope"];
|
|
1603
|
+
let Ac = (e) => ({
|
|
1602
1604
|
classes: e.classes,
|
|
1603
1605
|
columnKey: e.key,
|
|
1604
|
-
items:
|
|
1606
|
+
items: gs.value,
|
|
1605
1607
|
label: e.label,
|
|
1606
1608
|
sortable: e.sortable,
|
|
1607
1609
|
sortOrder: e.sortOrder,
|
|
1608
|
-
toggleSort: (t) =>
|
|
1609
|
-
hideColumn: () =>
|
|
1610
|
-
}),
|
|
1610
|
+
toggleSort: (t) => za(e.key, t),
|
|
1611
|
+
hideColumn: () => hi(e.key)
|
|
1612
|
+
}), jc = (e, t) => {
|
|
1611
1613
|
let n = J.value[e];
|
|
1612
1614
|
return n && n.valueHash === t ? n : J.value.find((e) => e.valueHash === t);
|
|
1613
|
-
},
|
|
1614
|
-
let t = Y.value[e], n =
|
|
1615
|
+
}, Mc = (e) => {
|
|
1616
|
+
let t = Y.value[e], n = z.value, r = m(() => n.map((e) => As(e, t.item))), i = n.map((e, n) => Ms(e, t, () => r.value[n]));
|
|
1615
1617
|
return {
|
|
1616
1618
|
get accessibleLabel() {
|
|
1617
|
-
return
|
|
1619
|
+
return is(i, t.item);
|
|
1618
1620
|
},
|
|
1619
1621
|
cols: i,
|
|
1620
1622
|
get rowClasses() {
|
|
1621
|
-
return Le(O.rowClass,
|
|
1623
|
+
return Le(O.rowClass, z.value, i, t.item);
|
|
1622
1624
|
},
|
|
1623
1625
|
onRowClick: (n) => {
|
|
1624
|
-
let r =
|
|
1625
|
-
r &&
|
|
1626
|
+
let r = jc(e, t.valueHash);
|
|
1627
|
+
r && Ia(n) && (Pa(r), k("click:row", n, r.item));
|
|
1626
1628
|
},
|
|
1627
1629
|
onRowContextMenu: (n) => {
|
|
1628
|
-
let r =
|
|
1629
|
-
r && !
|
|
1630
|
+
let r = jc(e, t.valueHash);
|
|
1631
|
+
r && !Fa(n) && (k("contextmenu:row", n, r.item), oi(n, r.valueHash, r.item));
|
|
1630
1632
|
},
|
|
1631
1633
|
onRowDblClick: (n) => {
|
|
1632
|
-
let r =
|
|
1633
|
-
r && !
|
|
1634
|
+
let r = jc(e, t.valueHash);
|
|
1635
|
+
r && !Fa(n) && k("dblclick:row", n, r.item);
|
|
1634
1636
|
},
|
|
1635
1637
|
item: t.item,
|
|
1636
1638
|
get text() {
|
|
@@ -1639,24 +1641,24 @@ var Wt = {
|
|
|
1639
1641
|
valueHash: t.valueHash,
|
|
1640
1642
|
value: t.value
|
|
1641
1643
|
};
|
|
1642
|
-
},
|
|
1643
|
-
Y.value,
|
|
1644
|
-
for (let e of
|
|
1644
|
+
}, Nc = m(() => {
|
|
1645
|
+
Y.value, fs.value, O.tdClass, O.rowClass, O.accessibleLabel;
|
|
1646
|
+
for (let e of z.value) e.align, e.formatOnNull, e.formatter, e.key, e.label, e.placeholder, e.tdClass;
|
|
1645
1647
|
return /* @__PURE__ */ new Map();
|
|
1646
|
-
}),
|
|
1647
|
-
if (!(!q.value || e.size <=
|
|
1648
|
-
for (let t of e.keys()) if (e.delete(t), e.size <=
|
|
1648
|
+
}), Pc = (e) => {
|
|
1649
|
+
if (!(!q.value || e.size <= Qn)) {
|
|
1650
|
+
for (let t of e.keys()) if (e.delete(t), e.size <= Qn) break;
|
|
1649
1651
|
}
|
|
1650
|
-
},
|
|
1651
|
-
let t =
|
|
1652
|
+
}, Fc = (e) => {
|
|
1653
|
+
let t = Nc.value, n = t.get(e);
|
|
1652
1654
|
if (n) return n;
|
|
1653
|
-
let r =
|
|
1654
|
-
return t.set(e, r),
|
|
1655
|
-
},
|
|
1656
|
-
let t =
|
|
1655
|
+
let r = Mc(e);
|
|
1656
|
+
return t.set(e, r), Pc(t), r;
|
|
1657
|
+
}, Ic = m(() => (Nc.value, $.value, J.value, Da.value, O.selectable, O.highlightable, /* @__PURE__ */ new Map())), Lc = /* @__PURE__ */ new Map(), Rc = /* @__PURE__ */ new WeakMap(), zc = (e) => {
|
|
1658
|
+
let t = Ic.value, n = t.get(e.index);
|
|
1657
1659
|
if (n) return n;
|
|
1658
|
-
let r =
|
|
1659
|
-
if (c && c.item === r.item && c.cols === r.cols && c.onRowClick === r.onRowClick && c.expanded === e.expanded && c.rowIndex === e.rowIndex && c.selected === i.selected &&
|
|
1660
|
+
let r = Fc(e.index), i = J.value[e.index], a = !!i.disabled, o = () => !O.selectable || typeof O.selectable == "function" && !O.selectable(r.item) || a, s = r.valueHash in Da.value, c = Lc.get(r.valueHash);
|
|
1661
|
+
if (c && c.item === r.item && c.cols === r.cols && c.onRowClick === r.onRowClick && c.expanded === e.expanded && c.rowIndex === e.rowIndex && c.selected === i.selected && Rc.get(c) === a && c.highlighted === s) return t.set(e.index, c), Pc(t), c;
|
|
1660
1662
|
let l = {
|
|
1661
1663
|
get accessibleLabel() {
|
|
1662
1664
|
return r.accessibleLabel;
|
|
@@ -1682,43 +1684,43 @@ var Wt = {
|
|
|
1682
1684
|
return o();
|
|
1683
1685
|
},
|
|
1684
1686
|
get highlightable() {
|
|
1685
|
-
return
|
|
1687
|
+
return Aa() && !ja(r.item);
|
|
1686
1688
|
},
|
|
1687
1689
|
expandProps: {},
|
|
1688
|
-
toggleExpanded: () =>
|
|
1689
|
-
toggleHighlighted: () =>
|
|
1690
|
-
toggleSelected: () =>
|
|
1690
|
+
toggleExpanded: () => gu(r.valueHash),
|
|
1691
|
+
toggleHighlighted: () => Pa(r, { viaSlot: !0 }),
|
|
1692
|
+
toggleSelected: () => Au(l)
|
|
1691
1693
|
};
|
|
1692
|
-
return l.expandProps =
|
|
1693
|
-
},
|
|
1694
|
+
return l.expandProps = hu(l), Rc.set(l, a), t.set(e.index, l), Pc(t), Lc.delete(r.valueHash), Lc.set(r.valueHash, l), Lc.size > Qn && Lc.delete(Lc.keys().next().value), l;
|
|
1695
|
+
}, Bc = Ot({
|
|
1694
1696
|
key: null,
|
|
1695
1697
|
row: 0,
|
|
1696
1698
|
col: null
|
|
1697
|
-
}),
|
|
1699
|
+
}), Vc = m(() => {
|
|
1698
1700
|
if (!N.value) return null;
|
|
1699
1701
|
let e = /* @__PURE__ */ new Map();
|
|
1700
1702
|
for (let t of $.value) e.set(t.key, t.virtualIndex);
|
|
1701
1703
|
return e;
|
|
1702
|
-
}),
|
|
1704
|
+
}), Hc = m(() => {
|
|
1703
1705
|
if (!N.value) return null;
|
|
1704
|
-
let e = $.value.length, t =
|
|
1705
|
-
if (n = t.row ===
|
|
1706
|
-
let r = t.col === null && (!
|
|
1706
|
+
let e = $.value.length, t = Bc.value, n;
|
|
1707
|
+
if (n = t.row === er && X.value.first || t.row === tr && X.value.last ? t.row : !e || t.row < 0 ? Er.value ? -1 : e ? 0 : null : (t.key === null ? void 0 : Vc.value?.get(t.key)) ?? i(t.row, 0, e - 1), n === null) return null;
|
|
1708
|
+
let r = t.col === null && (!Sr.value || n < 0) ? 0 : t.col;
|
|
1707
1709
|
return {
|
|
1708
1710
|
row: n,
|
|
1709
1711
|
col: r
|
|
1710
1712
|
};
|
|
1711
|
-
}),
|
|
1712
|
-
let t =
|
|
1713
|
+
}), Uc = (e) => {
|
|
1714
|
+
let t = Hc.value;
|
|
1713
1715
|
return !t || t.row !== e ? -2 : t.col ?? -1;
|
|
1714
|
-
},
|
|
1715
|
-
if (!
|
|
1716
|
-
let t =
|
|
1717
|
-
return !t || t.row !== -1 ? -1 : Math.min(t.col ?? 0,
|
|
1716
|
+
}, Wc = (e) => {
|
|
1717
|
+
if (!Er.value) return;
|
|
1718
|
+
let t = Hc.value;
|
|
1719
|
+
return !t || t.row !== -1 ? -1 : Math.min(t.col ?? 0, ds.value - 1) === e ? 0 : -1;
|
|
1718
1720
|
}, $ = m(() => {
|
|
1719
1721
|
let e = [], t = 0, n = ((G.page ?? 0) - 1) * (G.perPage ?? 0), r = 1 + Number(X.value.first);
|
|
1720
1722
|
return Y.value.forEach((i, a) => {
|
|
1721
|
-
let o = i.valueHash in
|
|
1723
|
+
let o = i.valueHash in Oa.value, s = n + r + a + 1 + t;
|
|
1722
1724
|
e.push({
|
|
1723
1725
|
kind: "row",
|
|
1724
1726
|
index: a,
|
|
@@ -1735,7 +1737,7 @@ var Wt = {
|
|
|
1735
1737
|
rowIndex: s
|
|
1736
1738
|
}));
|
|
1737
1739
|
}), e;
|
|
1738
|
-
}),
|
|
1740
|
+
}), Gc = (e, t, n, r) => {
|
|
1739
1741
|
let i;
|
|
1740
1742
|
return {
|
|
1741
1743
|
kind: t,
|
|
@@ -1744,13 +1746,13 @@ var Wt = {
|
|
|
1744
1746
|
virtualIndex: e.virtualIndex,
|
|
1745
1747
|
height: r,
|
|
1746
1748
|
get item() {
|
|
1747
|
-
return i ??=
|
|
1749
|
+
return i ??= zc(e);
|
|
1748
1750
|
}
|
|
1749
1751
|
};
|
|
1750
|
-
},
|
|
1751
|
-
let e =
|
|
1752
|
+
}, Kc = Ot(null), qc = C(0), Jc = (e) => /^(auto|scroll)$/.test(getComputedStyle(e).overflowY), Yc = () => {
|
|
1753
|
+
let e = I.value, t = L.value, n = F.value;
|
|
1752
1754
|
if (!q.value || !e || !t || !n) {
|
|
1753
|
-
|
|
1755
|
+
Kc.value = null;
|
|
1754
1756
|
return;
|
|
1755
1757
|
}
|
|
1756
1758
|
let r = e.getBoundingClientRect(), i = n.getBoundingClientRect().bottom - r.top, a = getComputedStyle(e).maxHeight !== "none" || e.scrollHeight > e.clientHeight + 1 || e.clientHeight > i + 1, o = window;
|
|
@@ -1758,7 +1760,7 @@ var Wt = {
|
|
|
1758
1760
|
else {
|
|
1759
1761
|
let t = e.parentElement;
|
|
1760
1762
|
for (; t && t !== document.body && t !== document.documentElement;) {
|
|
1761
|
-
if (
|
|
1763
|
+
if (Jc(t)) {
|
|
1762
1764
|
o = t;
|
|
1763
1765
|
break;
|
|
1764
1766
|
}
|
|
@@ -1766,46 +1768,46 @@ var Wt = {
|
|
|
1766
1768
|
}
|
|
1767
1769
|
}
|
|
1768
1770
|
let s = t.querySelector(":scope > .bb-table__edge-row--first"), c = t.getBoundingClientRect().top + (s?.offsetHeight ?? 0), l = o === window ? c + window.scrollY : c - o.getBoundingClientRect().top + o.scrollTop;
|
|
1769
|
-
|
|
1770
|
-
},
|
|
1771
|
-
let e =
|
|
1771
|
+
qc.value !== l && (qc.value = l), Kc.value !== o && (Kc.value = o);
|
|
1772
|
+
}, Xc = C(37), Zc = () => {
|
|
1773
|
+
let e = I.value;
|
|
1772
1774
|
if (!e) return;
|
|
1773
1775
|
let t = parseFloat(getComputedStyle(e).getPropertyValue("--cell-h"));
|
|
1774
|
-
t > 0 && (
|
|
1775
|
-
},
|
|
1776
|
-
if (!q.value || !
|
|
1776
|
+
t > 0 && (Xc.value = t + 1);
|
|
1777
|
+
}, Qc = C(null), $c = (e) => {
|
|
1778
|
+
if (!q.value || !L.value) return;
|
|
1777
1779
|
let t = e.target;
|
|
1778
|
-
for (; t && t.parentElement !==
|
|
1780
|
+
for (; t && t.parentElement !== L.value;) t = t.parentElement;
|
|
1779
1781
|
let n = Number(t?.dataset.index);
|
|
1780
|
-
|
|
1781
|
-
},
|
|
1782
|
+
Qc.value = Number.isInteger(n) ? n : null;
|
|
1783
|
+
}, el = (e) => {
|
|
1782
1784
|
if (!q.value) return;
|
|
1783
1785
|
let t = e.relatedTarget;
|
|
1784
|
-
t &&
|
|
1785
|
-
},
|
|
1786
|
+
t && L.value?.contains(t) || (Qc.value = null);
|
|
1787
|
+
}, tl = C(0), nl = 0, rl = C(!1), il, al = {
|
|
1786
1788
|
offset: 0,
|
|
1787
1789
|
time: 0
|
|
1788
|
-
},
|
|
1789
|
-
|
|
1790
|
-
},
|
|
1791
|
-
clearTimeout(
|
|
1792
|
-
},
|
|
1793
|
-
let t = performance.now(), n = t -
|
|
1794
|
-
if (
|
|
1790
|
+
}, ol = 0, sl = /* @__PURE__ */ new Set(), cl = null, ll = 0, ul = (e) => {
|
|
1791
|
+
ll = ll ? ll * .7 + e * .3 : e;
|
|
1792
|
+
}, dl = () => {
|
|
1793
|
+
clearTimeout(il), il = void 0, rl.value && (rl.value = !1, bl());
|
|
1794
|
+
}, fl = (e) => {
|
|
1795
|
+
let t = performance.now(), n = t - al.time, r = e - al.offset;
|
|
1796
|
+
if (al = {
|
|
1795
1797
|
offset: e,
|
|
1796
1798
|
time: t
|
|
1797
|
-
},
|
|
1798
|
-
let i =
|
|
1799
|
-
if (n > 0 && n < 250 && i &&
|
|
1800
|
-
let e =
|
|
1801
|
-
Math.abs(r) / n *
|
|
1799
|
+
}, ol > 0) return;
|
|
1800
|
+
let i = cl;
|
|
1801
|
+
if (n > 0 && n < 250 && i && ll) {
|
|
1802
|
+
let e = _l?.scrollRect?.height ?? 0, t = (i.end - i.start + e) / 2;
|
|
1803
|
+
Math.abs(r) / n * ll > t && (rl.value = !0);
|
|
1802
1804
|
}
|
|
1803
|
-
clearTimeout(
|
|
1804
|
-
},
|
|
1805
|
-
let e =
|
|
1806
|
-
if (!e?.size || e.size ===
|
|
1807
|
-
if (
|
|
1808
|
-
|
|
1805
|
+
clearTimeout(il), il = setTimeout(dl, ar);
|
|
1806
|
+
}, pl = C(0), ml = -1, hl = !1, gl = () => {
|
|
1807
|
+
let e = _l?.itemSizeCache;
|
|
1808
|
+
if (!e?.size || e.size === ml) return;
|
|
1809
|
+
if (ml = e.size, hl) {
|
|
1810
|
+
Go();
|
|
1809
1811
|
return;
|
|
1810
1812
|
}
|
|
1811
1813
|
let t = /* @__PURE__ */ new Map(), n = 0;
|
|
@@ -1817,78 +1819,78 @@ var Wt = {
|
|
|
1817
1819
|
if (n >= 5) {
|
|
1818
1820
|
let e = 0, r = -1;
|
|
1819
1821
|
for (let [n, i] of t) (i > r || i === r && n < e) && (r = i, e = n);
|
|
1820
|
-
e > 0 && !
|
|
1822
|
+
e > 0 && !hl && (pl.value = e, n >= 20 && (hl = !0));
|
|
1821
1823
|
}
|
|
1822
|
-
|
|
1823
|
-
},
|
|
1824
|
+
Go();
|
|
1825
|
+
}, _l = null, vl = !1;
|
|
1824
1826
|
E(q, (e) => {
|
|
1825
|
-
|
|
1827
|
+
vl = e;
|
|
1826
1828
|
}, { immediate: !0 });
|
|
1827
|
-
let
|
|
1828
|
-
if (
|
|
1829
|
-
let t = q.value ?
|
|
1830
|
-
|
|
1829
|
+
let yl = Ot([]), bl = (e = !1) => {
|
|
1830
|
+
if (nl &&= (cancelAnimationFrame(nl), 0), !_l) return;
|
|
1831
|
+
let t = q.value ? _l.getVirtualItems() : [];
|
|
1832
|
+
tl.value = _l.getTotalSize();
|
|
1831
1833
|
let n = [], r = null;
|
|
1832
1834
|
if (t.length) {
|
|
1833
|
-
let e =
|
|
1835
|
+
let e = _l.measurementsCache, i = $.value.length, a = _l.range, o = a ? a.startIndex : t[0].index, s = a ? a.endIndex : t[t.length - 1].index;
|
|
1834
1836
|
for (let e of t) n.push({
|
|
1835
1837
|
index: e.index,
|
|
1836
1838
|
start: e.start,
|
|
1837
1839
|
end: e.end,
|
|
1838
1840
|
size: e.size
|
|
1839
1841
|
});
|
|
1840
|
-
let c = e?.[Math.max(0, o -
|
|
1842
|
+
let c = e?.[Math.max(0, o - rr)], l = e?.[Math.min(i - 1, s + rr)] ?? c;
|
|
1841
1843
|
c && l && (r = {
|
|
1842
1844
|
start: c.start,
|
|
1843
1845
|
end: l.end
|
|
1844
1846
|
});
|
|
1845
1847
|
}
|
|
1846
|
-
let i = !
|
|
1847
|
-
if (
|
|
1848
|
+
let i = !xl || !r || xl.start !== r.start || xl.end !== r.end;
|
|
1849
|
+
if (xl = r, yl.value = n, !r) return;
|
|
1848
1850
|
if (!e || !i) {
|
|
1849
|
-
|
|
1851
|
+
cl = r;
|
|
1850
1852
|
return;
|
|
1851
1853
|
}
|
|
1852
1854
|
let a = performance.now(), o = r;
|
|
1853
1855
|
b(() => {
|
|
1854
|
-
|
|
1856
|
+
ul(performance.now() - a), cl = o;
|
|
1855
1857
|
});
|
|
1856
|
-
},
|
|
1857
|
-
|
|
1858
|
-
|
|
1858
|
+
}, xl = null, Sl = () => {
|
|
1859
|
+
nl ||= requestAnimationFrame(() => {
|
|
1860
|
+
nl = 0, gl(), bl();
|
|
1859
1861
|
});
|
|
1860
|
-
},
|
|
1861
|
-
t ? (
|
|
1862
|
-
},
|
|
1863
|
-
let e =
|
|
1862
|
+
}, Cl = (e, t) => {
|
|
1863
|
+
t ? (fl(e.getScrollOffset()), bl(!0)) : Sl();
|
|
1864
|
+
}, wl = (e) => $.value[e]?.key ?? e, Tl = (e) => ($.value[e]?.kind === "expand" ? 3 : 1) * (pl.value || Xc.value), El = Ut(m(() => {
|
|
1865
|
+
let e = Kc.value, t = typeof window < "u" && e === window, n = Qc.value, r = Hc.value?.row, i = r != null && r >= 0 ? r : null;
|
|
1864
1866
|
return {
|
|
1865
|
-
onChange:
|
|
1867
|
+
onChange: Cl,
|
|
1866
1868
|
count: q.value ? $.value.length : 0,
|
|
1867
1869
|
enabled: q.value,
|
|
1868
1870
|
getScrollElement: () => e,
|
|
1869
|
-
estimateSize:
|
|
1870
|
-
getItemKey:
|
|
1871
|
-
overscan:
|
|
1872
|
-
scrollMargin:
|
|
1871
|
+
estimateSize: Tl,
|
|
1872
|
+
getItemKey: wl,
|
|
1873
|
+
overscan: rr,
|
|
1874
|
+
scrollMargin: qc.value,
|
|
1873
1875
|
initialRect: {
|
|
1874
1876
|
width: 0,
|
|
1875
|
-
height:
|
|
1877
|
+
height: ir
|
|
1876
1878
|
},
|
|
1877
1879
|
rangeExtractor: (e) => {
|
|
1878
|
-
let t = e.endIndex - e.startIndex >
|
|
1880
|
+
let t = e.endIndex - e.startIndex > nr ? {
|
|
1879
1881
|
...e,
|
|
1880
|
-
endIndex: e.startIndex +
|
|
1881
|
-
} : e, r =
|
|
1882
|
+
endIndex: e.startIndex + nr
|
|
1883
|
+
} : e, r = Lt(t), a = [n, i].filter((t) => t != null && t < e.count && !r.includes(t));
|
|
1882
1884
|
return a.length ? [.../* @__PURE__ */ new Set([...r, ...a])].sort((e, t) => e - t) : r;
|
|
1883
1885
|
},
|
|
1884
|
-
observeElementRect: t ?
|
|
1885
|
-
observeElementOffset: t ?
|
|
1886
|
-
scrollToFn: t ?
|
|
1886
|
+
observeElementRect: t ? Ht : Bt,
|
|
1887
|
+
observeElementOffset: t ? Vt : zt,
|
|
1888
|
+
scrollToFn: t ? Wt : Rt
|
|
1887
1889
|
};
|
|
1888
1890
|
}));
|
|
1889
|
-
|
|
1890
|
-
let
|
|
1891
|
-
let t =
|
|
1891
|
+
_l = El.value;
|
|
1892
|
+
let Dl = (e) => {
|
|
1893
|
+
let t = _l.measurementsCache, n = $.value, r = n.findIndex((t) => t.kind === "row" && t.index === e);
|
|
1892
1894
|
if (r < 0 || !t?.[r]) return null;
|
|
1893
1895
|
let i = n[r + 1]?.kind === "expand" && t[r + 1] ? r + 1 : r;
|
|
1894
1896
|
return {
|
|
@@ -1896,13 +1898,13 @@ var Wt = {
|
|
|
1896
1898
|
end: t[i].end
|
|
1897
1899
|
};
|
|
1898
1900
|
};
|
|
1899
|
-
|
|
1900
|
-
let
|
|
1901
|
-
|
|
1902
|
-
},
|
|
1903
|
-
let t = [], n = 0, r =
|
|
1904
|
-
for (let i = 0; i < e.length && t.length <
|
|
1905
|
-
let e =
|
|
1901
|
+
bl();
|
|
1902
|
+
let Ol = (e) => {
|
|
1903
|
+
vl && _l?.measureElement(e);
|
|
1904
|
+
}, kl = (e) => {
|
|
1905
|
+
let t = [], n = 0, r = rr;
|
|
1906
|
+
for (let i = 0; i < e.length && t.length < nr && !(n >= ir && r-- <= 0); i++) {
|
|
1907
|
+
let e = Tl(i);
|
|
1906
1908
|
t.push({
|
|
1907
1909
|
index: i,
|
|
1908
1910
|
start: n,
|
|
@@ -1911,119 +1913,119 @@ var Wt = {
|
|
|
1911
1913
|
}), n += e;
|
|
1912
1914
|
}
|
|
1913
1915
|
return t;
|
|
1914
|
-
},
|
|
1916
|
+
}, Al = m(() => {
|
|
1915
1917
|
let e = $.value;
|
|
1916
|
-
if (
|
|
1917
|
-
let t =
|
|
1918
|
+
if (Ic.value, !q.value) return e.map((e) => Gc(e, e.kind, e.key, 0));
|
|
1919
|
+
let t = yl.value.length ? yl.value : kl(e);
|
|
1918
1920
|
if (!t.length) return [];
|
|
1919
|
-
let n = [], r =
|
|
1921
|
+
let n = [], r = qc.value, i = rl.value, a = r, o;
|
|
1920
1922
|
for (let r of t) {
|
|
1921
1923
|
let t = e[r.index];
|
|
1922
1924
|
if (!t) continue;
|
|
1923
1925
|
let s = r.start - a;
|
|
1924
|
-
s > .5 && n.push(
|
|
1926
|
+
s > .5 && n.push(Gc(t, "spacer", `s:${t.key}`, s)), i && t.kind === "row" && !sl.has(t.key) ? n.push(Gc(t, "placeholder", `p:${t.key}`, r.size)) : n.push(Gc(t, t.kind, t.key, 0)), a = r.end, o = t;
|
|
1925
1927
|
}
|
|
1926
|
-
let s =
|
|
1927
|
-
return s > .5 && o && n.push(
|
|
1928
|
+
let s = tl.value - (a - r);
|
|
1929
|
+
return s > .5 && o && n.push(Gc(o, "spacer", "s:end", s)), n;
|
|
1928
1930
|
});
|
|
1929
|
-
E(
|
|
1930
|
-
if (q.value) for (let t of e) (t.kind === "row" || t.kind === "expand") &&
|
|
1931
|
+
E(Al, (e) => {
|
|
1932
|
+
if (q.value) for (let t of e) (t.kind === "row" || t.kind === "expand") && sl.add(t.key);
|
|
1931
1933
|
}, { flush: "post" });
|
|
1932
|
-
let
|
|
1933
|
-
let t =
|
|
1934
|
+
let jl = (e) => {
|
|
1935
|
+
let t = F.value;
|
|
1934
1936
|
if (!q.value || !t || !t.querySelector(":scope > .bb-table__body > .bb-table__row")) return;
|
|
1935
|
-
let n =
|
|
1936
|
-
if (
|
|
1937
|
-
if (t.key === "select" || t.key === "actions" || t.key ===
|
|
1938
|
-
if (t.key in
|
|
1937
|
+
let n = z.value, r = null, i = null;
|
|
1938
|
+
if (Po.value.forEach((t, a) => {
|
|
1939
|
+
if (t.key === "select" || t.key === "actions" || t.key === Pn) {
|
|
1940
|
+
if (t.key in Xa.value) return;
|
|
1939
1941
|
let n = parseFloat(e[a]);
|
|
1940
1942
|
if (!(n > 0)) return;
|
|
1941
|
-
(i ??= { ...
|
|
1943
|
+
(i ??= { ...Xa.value })[t.key] = n;
|
|
1942
1944
|
return;
|
|
1943
1945
|
}
|
|
1944
1946
|
let o = n.find((e) => String(e.key) === t.key);
|
|
1945
1947
|
if (!o || o.width != null) return;
|
|
1946
1948
|
let s = String(o.key);
|
|
1947
|
-
if (s in
|
|
1949
|
+
if (s in Ya.value || s in (r ?? {})) return;
|
|
1948
1950
|
let c = parseFloat(e[a]);
|
|
1949
|
-
c > 0 && ((r ??= { ...
|
|
1950
|
-
}), !r && !i ||
|
|
1951
|
+
c > 0 && ((r ??= { ...Ya.value })[s] = c);
|
|
1952
|
+
}), !r && !i || Ml) return;
|
|
1951
1953
|
let a = r, o = i;
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
...
|
|
1954
|
+
Ml = requestAnimationFrame(() => {
|
|
1955
|
+
Ml = 0, a && (Ya.value = {
|
|
1956
|
+
...Ya.value,
|
|
1955
1957
|
...a
|
|
1956
|
-
}), o && (
|
|
1957
|
-
...
|
|
1958
|
+
}), o && (Xa.value = {
|
|
1959
|
+
...Xa.value,
|
|
1958
1960
|
...o
|
|
1959
1961
|
});
|
|
1960
1962
|
});
|
|
1961
|
-
},
|
|
1963
|
+
}, Ml = 0;
|
|
1962
1964
|
E([() => q.value, () => J.value.length === 0], ([e, t]) => {
|
|
1963
|
-
(!e || t) && (Object.keys(
|
|
1964
|
-
}), E(
|
|
1965
|
-
q.value &&
|
|
1965
|
+
(!e || t) && (Object.keys(Ya.value).length && (Ya.value = {}), Object.keys(Xa.value).length && (Xa.value = {}), Za.value = "");
|
|
1966
|
+
}), E(Xc, () => {
|
|
1967
|
+
q.value && El.value.measure();
|
|
1966
1968
|
});
|
|
1967
|
-
let
|
|
1968
|
-
|
|
1969
|
-
let e =
|
|
1969
|
+
let Nl, Pl, Fl = () => {
|
|
1970
|
+
Nl?.disconnect(), Nl = void 0, Pl?.(), Pl = void 0;
|
|
1971
|
+
let e = I.value;
|
|
1970
1972
|
if (!q.value || !e) return;
|
|
1971
1973
|
let t = 0, n = () => {
|
|
1972
1974
|
t ||= requestAnimationFrame(() => {
|
|
1973
|
-
t = 0,
|
|
1975
|
+
t = 0, Yc();
|
|
1974
1976
|
});
|
|
1975
1977
|
};
|
|
1976
|
-
if (
|
|
1978
|
+
if (Kc.value === e) Nl = new ResizeObserver(() => Yc()), Nl.observe(e);
|
|
1977
1979
|
else {
|
|
1978
1980
|
window.addEventListener("resize", n);
|
|
1979
1981
|
let e = new ResizeObserver(n);
|
|
1980
|
-
e.observe(document.documentElement),
|
|
1982
|
+
e.observe(document.documentElement), Pl = () => {
|
|
1981
1983
|
window.removeEventListener("resize", n), e.disconnect(), t && cancelAnimationFrame(t);
|
|
1982
1984
|
};
|
|
1983
1985
|
}
|
|
1984
1986
|
};
|
|
1985
|
-
E(
|
|
1986
|
-
let
|
|
1987
|
+
E(Kc, Fl);
|
|
1988
|
+
let Il;
|
|
1987
1989
|
E(() => [q.value, X.value.first], ([e]) => {
|
|
1988
|
-
|
|
1989
|
-
let t =
|
|
1990
|
-
e && t && typeof ResizeObserver < "u" && (
|
|
1991
|
-
}, { flush: "post" }), x(() =>
|
|
1990
|
+
Il?.disconnect(), Il = void 0, Yc();
|
|
1991
|
+
let t = L.value?.querySelector(":scope > .bb-table__edge-row--first");
|
|
1992
|
+
e && t && typeof ResizeObserver < "u" && (Il = new ResizeObserver(() => requestAnimationFrame(Yc)), Il.observe(t));
|
|
1993
|
+
}, { flush: "post" }), x(() => Il?.disconnect()), E(() => [q.value, $.value.length], () => {
|
|
1992
1994
|
b(() => {
|
|
1993
|
-
|
|
1995
|
+
Zc(), Yc(), Fl(), sl = /* @__PURE__ */ new Set(), ml = -1, hl = !1, bl();
|
|
1994
1996
|
});
|
|
1995
1997
|
}, { flush: "post" });
|
|
1996
|
-
let
|
|
1997
|
-
q.value && Object.keys(
|
|
1998
|
-
let e =
|
|
1999
|
-
t &&
|
|
1998
|
+
let Ll = () => {
|
|
1999
|
+
q.value && Object.keys(Ya.value).length && (Ya.value = {}, b(() => requestAnimationFrame(() => {
|
|
2000
|
+
let e = F.value, t = e ? Ve(e) : null;
|
|
2001
|
+
t && jl(t);
|
|
2000
2002
|
})));
|
|
2001
|
-
},
|
|
2003
|
+
}, Rl, zl = () => {
|
|
2002
2004
|
let e = typeof document < "u" ? document.fonts : void 0;
|
|
2003
|
-
e && !
|
|
2005
|
+
e && !Rl && (e.status !== "loaded" && e.ready.then(Ll), e.addEventListener("loadingdone", Ll), Rl = () => e.removeEventListener("loadingdone", Ll));
|
|
2004
2006
|
};
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
+
St(() => {
|
|
2008
|
+
Zc(), Go(), Yc(), Fl(), bl(), q.value && zl();
|
|
2007
2009
|
}), E(q, (e) => {
|
|
2008
|
-
e &&
|
|
2010
|
+
e && zl(), $o && Wo($o), Go();
|
|
2009
2011
|
}), x(() => {
|
|
2010
|
-
|
|
2012
|
+
Nl?.disconnect(), Pl?.(), Rl?.(), nl && cancelAnimationFrame(nl);
|
|
2011
2013
|
});
|
|
2012
|
-
let
|
|
2013
|
-
let n = e >= 0 ?
|
|
2014
|
+
let Bl = () => new Promise((e) => requestAnimationFrame(() => e())), Vl = () => F.value?.querySelector(":scope > .bb-table__head > .bb-table__header-row") ?? null, Hl = (e) => L.value?.querySelector(`:scope > [role="row"][data-index="${e}"]`) ?? null, Ul = (e) => L.value?.querySelector(`:scope > .bb-table__edge-row--${e === er ? "first" : "last"}`) ?? null, Wl = (e, t) => {
|
|
2015
|
+
let n = e >= 0 ? Hl(e) : e === $n ? Vl() : Ul(e);
|
|
2014
2016
|
if (!n || t === null) return n;
|
|
2015
2017
|
let r = n.children;
|
|
2016
2018
|
return r[Math.min(t, r.length - 1)] ?? null;
|
|
2017
|
-
},
|
|
2018
|
-
let t =
|
|
2019
|
+
}, Gl = (e) => e >= 0 && $.value[e]?.kind === "expand" ? 1 : ds.value, Kl = (e) => {
|
|
2020
|
+
let t = F.value;
|
|
2019
2021
|
if (!t || !(e instanceof Element) || !t.contains(e)) return null;
|
|
2020
2022
|
let n = null;
|
|
2021
2023
|
for (let r = e; r && r !== t;) {
|
|
2022
2024
|
let i = r.parentElement;
|
|
2023
2025
|
if (i && i.parentElement === t && r.getAttribute("role") === "row") {
|
|
2024
2026
|
let t = r, a = i.classList.contains("bb-table__head");
|
|
2025
|
-
if ((a ? !
|
|
2026
|
-
let o = !a && t.classList.contains("bb-table__edge-row"), s = a ?
|
|
2027
|
+
if ((a ? !Er.value : i !== L.value) || a && !t.classList.contains("bb-table__header-row")) return null;
|
|
2028
|
+
let o = !a && t.classList.contains("bb-table__edge-row"), s = a ? $n : o ? t.classList.contains("bb-table__edge-row--first") ? er : tr : Number(t.dataset.index);
|
|
2027
2029
|
if (!Number.isInteger(s)) return null;
|
|
2028
2030
|
if (!n) return {
|
|
2029
2031
|
row: s,
|
|
@@ -2044,19 +2046,19 @@ var Wt = {
|
|
|
2044
2046
|
n = r, r = i;
|
|
2045
2047
|
}
|
|
2046
2048
|
return null;
|
|
2047
|
-
},
|
|
2048
|
-
|
|
2049
|
+
}, ql = async (e, t) => {
|
|
2050
|
+
Bc.value = {
|
|
2049
2051
|
key: e < 0 ? null : $.value[e]?.key ?? null,
|
|
2050
2052
|
row: e,
|
|
2051
2053
|
col: t
|
|
2052
2054
|
};
|
|
2053
|
-
let n =
|
|
2055
|
+
let n = Wl(e, t);
|
|
2054
2056
|
if (!n && e >= 0 && q.value) {
|
|
2055
|
-
|
|
2057
|
+
ol++, dl();
|
|
2056
2058
|
try {
|
|
2057
|
-
for (let r = 0; r < 8 && !n; r++)
|
|
2059
|
+
for (let r = 0; r < 8 && !n; r++) El.value.scrollToIndex(e, { align: "auto" }), await Bl(), await b(), n = Wl(e, t);
|
|
2058
2060
|
} finally {
|
|
2059
|
-
|
|
2061
|
+
ol--;
|
|
2060
2062
|
}
|
|
2061
2063
|
}
|
|
2062
2064
|
if (n && (n.focus(), n.scrollIntoView({
|
|
@@ -2064,96 +2066,96 @@ var Wt = {
|
|
|
2064
2066
|
inline: "nearest"
|
|
2065
2067
|
}), q.value && e >= 0)) for (let e = 0; e < 4; e++) {
|
|
2066
2068
|
let e = n.getBoundingClientRect().top;
|
|
2067
|
-
if (await
|
|
2069
|
+
if (await Bl(), n.scrollIntoView({
|
|
2068
2070
|
block: "nearest",
|
|
2069
2071
|
inline: "nearest"
|
|
2070
2072
|
}), Math.abs(n.getBoundingClientRect().top - e) < .5) break;
|
|
2071
2073
|
}
|
|
2072
|
-
},
|
|
2073
|
-
if (e.closest("[data-bb-table-id]") !==
|
|
2074
|
-
let t =
|
|
2075
|
-
return !!t?.inside && t.cell !==
|
|
2076
|
-
},
|
|
2074
|
+
}, Jl = null, Yl = 0, Xl = (e) => {
|
|
2075
|
+
if (e.closest("[data-bb-table-id]") !== I.value) return !1;
|
|
2076
|
+
let t = Kl(e);
|
|
2077
|
+
return !!t?.inside && t.cell !== Jl;
|
|
2078
|
+
}, Zl = (e) => {
|
|
2077
2079
|
let t = e.querySelectorAll(tt);
|
|
2078
|
-
e.matches("a[href], area[href], button, input:not([type=\"hidden\"]), select, textarea, iframe, summary, audio[controls], video[controls], [contenteditable]:not([contenteditable=\"false\"]), [tabindex]") &&
|
|
2079
|
-
for (let e of t)
|
|
2080
|
-
},
|
|
2081
|
-
for (let t of e.querySelectorAll(`[${nt}]`)) t.closest("[data-bb-table-id]") ===
|
|
2082
|
-
},
|
|
2083
|
-
|
|
2084
|
-
},
|
|
2085
|
-
let e =
|
|
2086
|
-
|
|
2087
|
-
},
|
|
2080
|
+
e.matches("a[href], area[href], button, input:not([type=\"hidden\"]), select, textarea, iframe, summary, audio[controls], video[controls], [contenteditable]:not([contenteditable=\"false\"]), [tabindex]") && Xl(e) && at(e);
|
|
2081
|
+
for (let e of t) Xl(e) && at(e);
|
|
2082
|
+
}, Ql = (e) => {
|
|
2083
|
+
for (let t of e.querySelectorAll(`[${nt}]`)) t.closest("[data-bb-table-id]") === I.value && it(t);
|
|
2084
|
+
}, $l = (e) => {
|
|
2085
|
+
Jl !== e && (eu(), Jl = e, Yl = Ze(), Ql(e));
|
|
2086
|
+
}, eu = () => {
|
|
2087
|
+
let e = Jl;
|
|
2088
|
+
Jl = null, e?.isConnected && N.value && Zl(e);
|
|
2089
|
+
}, tu = (e) => {
|
|
2088
2090
|
let t = rt(e)[0];
|
|
2089
|
-
return t ? (
|
|
2090
|
-
},
|
|
2091
|
-
|
|
2092
|
-
let e =
|
|
2093
|
-
e && (N.value ? (
|
|
2091
|
+
return t ? ($l(e), t.focus(), !0) : !1;
|
|
2092
|
+
}, nu = null, ru = () => {
|
|
2093
|
+
nu?.disconnect(), nu = null;
|
|
2094
|
+
let e = F.value;
|
|
2095
|
+
e && (N.value ? (Zl(e), nu = new MutationObserver((e) => {
|
|
2094
2096
|
for (let t of e) {
|
|
2095
2097
|
if (t.type === "childList") {
|
|
2096
|
-
for (let e of t.addedNodes) e instanceof Element &&
|
|
2098
|
+
for (let e of t.addedNodes) e instanceof Element && Zl(e);
|
|
2097
2099
|
continue;
|
|
2098
2100
|
}
|
|
2099
2101
|
let e = t.target;
|
|
2100
|
-
e.getAttribute("tabindex") !== "-1" && (e.removeAttribute(nt),
|
|
2102
|
+
e.getAttribute("tabindex") !== "-1" && (e.removeAttribute(nt), Zl(e));
|
|
2101
2103
|
}
|
|
2102
|
-
}),
|
|
2104
|
+
}), nu.observe(e, {
|
|
2103
2105
|
childList: !0,
|
|
2104
2106
|
subtree: !0,
|
|
2105
2107
|
attributes: !0,
|
|
2106
2108
|
attributeFilter: ["tabindex"]
|
|
2107
|
-
})) : (
|
|
2109
|
+
})) : (Jl = null, Ql(e)));
|
|
2108
2110
|
};
|
|
2109
|
-
|
|
2110
|
-
let
|
|
2111
|
-
let t =
|
|
2111
|
+
St(ru), E(N, () => b(ru)), x(() => nu?.disconnect());
|
|
2112
|
+
let iu = (e) => {
|
|
2113
|
+
let t = Kl(e.target);
|
|
2112
2114
|
if (!t) return;
|
|
2113
|
-
t.inside && t.cell ?
|
|
2114
|
-
let n =
|
|
2115
|
-
n && n.row === t.row &&
|
|
2115
|
+
t.inside && t.cell ? $l(t.cell) : eu();
|
|
2116
|
+
let n = Hc.value, r = t.cell ?? t.rowEl;
|
|
2117
|
+
n && n.row === t.row && Wl(n.row, n.col) === r || (Bc.value = {
|
|
2116
2118
|
key: t.row < 0 ? null : $.value[t.row]?.key ?? null,
|
|
2117
2119
|
row: t.row,
|
|
2118
2120
|
col: t.cell ? t.col : null
|
|
2119
2121
|
});
|
|
2120
|
-
},
|
|
2121
|
-
N.value &&
|
|
2122
|
+
}, au = (e) => {
|
|
2123
|
+
N.value && iu(e);
|
|
2122
2124
|
};
|
|
2123
|
-
E(
|
|
2124
|
-
t?.removeEventListener("focusin",
|
|
2125
|
-
}, { flush: "sync" }), x(() =>
|
|
2126
|
-
let
|
|
2125
|
+
E(F, (e, t) => {
|
|
2126
|
+
t?.removeEventListener("focusin", au), e?.addEventListener("focusin", au);
|
|
2127
|
+
}, { flush: "sync" }), x(() => F.value?.removeEventListener("focusin", au));
|
|
2128
|
+
let ou = (e) => {
|
|
2127
2129
|
let t = e.relatedTarget;
|
|
2128
|
-
|
|
2129
|
-
},
|
|
2130
|
+
Jl && !(t instanceof Node && Jl.contains(t)) && eu();
|
|
2131
|
+
}, su = (e) => {
|
|
2130
2132
|
let t = $.value[e];
|
|
2131
|
-
O.selectable && t && t.kind === "row" &&
|
|
2132
|
-
},
|
|
2133
|
+
O.selectable && t && t.kind === "row" && ju(zc(t));
|
|
2134
|
+
}, cu = () => !O.selectable || !Su() ? !1 : (bu.value?.click(), !0), lu = (e) => {
|
|
2133
2135
|
e.row >= 0 && $.value[e.row]?.kind === "row" && e.rowEl.click();
|
|
2134
|
-
},
|
|
2136
|
+
}, uu = (e) => e >= 0 ? e : e === tr ? $.value.length : e === er ? -1 : X.value.first ? -2 : -1, du = (e) => {
|
|
2135
2137
|
let t = $.value.length;
|
|
2136
|
-
return e >= t ? X.value.last ?
|
|
2137
|
-
},
|
|
2138
|
-
let r = $.value.length, a = X.value.first ? -1 : 0, o = n ? a :
|
|
2139
|
-
return s < o ? e :
|
|
2140
|
-
},
|
|
2141
|
-
if (e.defaultPrevented ||
|
|
2142
|
-
let t =
|
|
2138
|
+
return e >= t ? X.value.last ? tr : t - 1 : e >= 0 ? e : e === -1 && X.value.first ? er : $n;
|
|
2139
|
+
}, fu = (e, t, n = !1) => {
|
|
2140
|
+
let r = $.value.length, a = X.value.first ? -1 : 0, o = n ? a : Er.value ? a - 1 : a, s = X.value.last ? r : r - 1;
|
|
2141
|
+
return s < o ? e : du(i(uu(e) + t, o, s));
|
|
2142
|
+
}, pu = (e) => {
|
|
2143
|
+
if (e.defaultPrevented || R.value && Kr.onGridKeydown(e)) return;
|
|
2144
|
+
let t = Kl(e.target);
|
|
2143
2145
|
if (!t) return;
|
|
2144
2146
|
let n = e.key;
|
|
2145
2147
|
if (t.inside) {
|
|
2146
|
-
if (!t.cell || !(n === "F2" || n === "Escape" && Ze() <=
|
|
2148
|
+
if (!t.cell || !(n === "F2" || n === "Escape" && Ze() <= Yl) || e.altKey || e.ctrlKey || e.metaKey) return;
|
|
2147
2149
|
e.preventDefault(), e.stopPropagation(), t.cell.focus();
|
|
2148
2150
|
return;
|
|
2149
2151
|
}
|
|
2150
2152
|
if ((e.ctrlKey || e.metaKey) && !e.altKey && n.toLowerCase() === "a") {
|
|
2151
|
-
|
|
2153
|
+
cu() && e.preventDefault();
|
|
2152
2154
|
return;
|
|
2153
2155
|
}
|
|
2154
2156
|
if (e.altKey || e.metaKey || e.shiftKey && n !== " ") return;
|
|
2155
|
-
let r = e.ctrlKey, i = Xe(t.rowEl), a = i ? "ArrowLeft" : "ArrowRight", o = i ? "ArrowRight" : "ArrowLeft", s = $.value.length - 1, c =
|
|
2156
|
-
e.preventDefault(), (n !== t.row || r !== (t.cell ? t.col : null)) &&
|
|
2157
|
+
let r = e.ctrlKey, i = Xe(t.rowEl), a = i ? "ArrowLeft" : "ArrowRight", o = i ? "ArrowRight" : "ArrowLeft", s = $.value.length - 1, c = Sr.value, l = (n, r) => {
|
|
2158
|
+
e.preventDefault(), (n !== t.row || r !== (t.cell ? t.col : null)) && ql(n, r);
|
|
2157
2159
|
}, u = () => e.preventDefault();
|
|
2158
2160
|
if (!t.cell) {
|
|
2159
2161
|
if (!c) return;
|
|
@@ -2161,137 +2163,137 @@ var Wt = {
|
|
|
2161
2163
|
switch (n) {
|
|
2162
2164
|
case "ArrowDown": return l(Math.min(t.row + 1, s), null);
|
|
2163
2165
|
case "ArrowUp": return l(Math.max(t.row - 1, 0), null);
|
|
2164
|
-
case "PageDown": return l(Math.min(t.row +
|
|
2165
|
-
case "PageUp": return l(Math.max(t.row -
|
|
2166
|
+
case "PageDown": return l(Math.min(t.row + or, s), null);
|
|
2167
|
+
case "PageUp": return l(Math.max(t.row - or, 0), null);
|
|
2166
2168
|
case "Home": return l(0, null);
|
|
2167
2169
|
case "End": return l(s, null);
|
|
2168
2170
|
case a:
|
|
2169
2171
|
if (i && !r.expanded) {
|
|
2170
|
-
u(),
|
|
2172
|
+
u(), gu(Y.value[r.index].valueHash);
|
|
2171
2173
|
return;
|
|
2172
2174
|
}
|
|
2173
2175
|
return l(t.row, 0);
|
|
2174
2176
|
case o:
|
|
2175
|
-
u(), i && r.expanded &&
|
|
2177
|
+
u(), i && r.expanded && gu(Y.value[r.index].valueHash);
|
|
2176
2178
|
return;
|
|
2177
2179
|
case "Enter":
|
|
2178
2180
|
case " ":
|
|
2179
|
-
u(), e.shiftKey && n === " " ?
|
|
2181
|
+
u(), e.shiftKey && n === " " ? su(t.row) : lu(t);
|
|
2180
2182
|
return;
|
|
2181
2183
|
}
|
|
2182
2184
|
return;
|
|
2183
2185
|
}
|
|
2184
|
-
let d =
|
|
2186
|
+
let d = Hc.value, f = d && d.row === t.row && d.col !== null ? d.col : t.col, p = (e) => Gl(e) - 1, ee = !!O.selectable && t.col === Number(R.value);
|
|
2185
2187
|
switch (n) {
|
|
2186
2188
|
case a: return l(t.row, Math.min(t.col + 1, p(t.row)));
|
|
2187
2189
|
case o: return t.col > 0 ? l(t.row, t.col - 1) : c && t.row >= 0 ? l(t.row, null) : u();
|
|
2188
|
-
case "ArrowDown": return l(
|
|
2189
|
-
case "ArrowUp": return l(
|
|
2190
|
-
case "PageDown": return l(t.row ===
|
|
2191
|
-
case "PageUp": return l(t.row ===
|
|
2192
|
-
case "Home": return r ? l(
|
|
2190
|
+
case "ArrowDown": return l(fu(t.row, 1), f);
|
|
2191
|
+
case "ArrowUp": return l(fu(t.row, -1), f);
|
|
2192
|
+
case "PageDown": return l(t.row === $n && s < 0 ? t.row : fu(t.row, or), f);
|
|
2193
|
+
case "PageUp": return l(t.row === $n ? t.row : fu(t.row, -10, !0), f);
|
|
2194
|
+
case "Home": return r ? l(fu(t.row, -Infinity), c ? f : 0) : l(t.row, 0);
|
|
2193
2195
|
case "End": {
|
|
2194
2196
|
if (!r) return l(t.row, p(t.row));
|
|
2195
|
-
let e =
|
|
2197
|
+
let e = fu(t.row, Infinity);
|
|
2196
2198
|
return l(e, c ? f : p(e));
|
|
2197
2199
|
}
|
|
2198
2200
|
case "F2":
|
|
2199
|
-
u(),
|
|
2201
|
+
u(), tu(t.cell);
|
|
2200
2202
|
return;
|
|
2201
2203
|
case "Enter":
|
|
2202
2204
|
case " ": {
|
|
2203
|
-
if (u(), t.row ===
|
|
2204
|
-
ee && !e.shiftKey ?
|
|
2205
|
+
if (u(), t.row === $n) {
|
|
2206
|
+
ee && !e.shiftKey ? cu() : n === "Enter" && tu(t.cell);
|
|
2205
2207
|
return;
|
|
2206
2208
|
}
|
|
2207
2209
|
if (n === " " && e.shiftKey) {
|
|
2208
|
-
|
|
2210
|
+
su(t.row);
|
|
2209
2211
|
return;
|
|
2210
2212
|
}
|
|
2211
2213
|
let r = $.value[t.row]?.kind === "row";
|
|
2212
2214
|
if (ee && r) {
|
|
2213
|
-
|
|
2215
|
+
su(t.row);
|
|
2214
2216
|
return;
|
|
2215
2217
|
}
|
|
2216
|
-
if (n === "Enter" &&
|
|
2217
|
-
|
|
2218
|
+
if (n === "Enter" && tu(t.cell)) return;
|
|
2219
|
+
lu(t);
|
|
2218
2220
|
return;
|
|
2219
2221
|
}
|
|
2220
2222
|
}
|
|
2221
|
-
},
|
|
2222
|
-
e.target instanceof HTMLElement && (e.target instanceof HTMLButtonElement || (e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
2223
|
-
},
|
|
2224
|
-
"aria-controls": o(
|
|
2223
|
+
}, mu = (e, t) => {
|
|
2224
|
+
e.target instanceof HTMLElement && (e.target instanceof HTMLButtonElement || (e.key === "Enter" || e.key === " ") && (e.preventDefault(), gu(t)));
|
|
2225
|
+
}, hu = (e) => ({
|
|
2226
|
+
"aria-controls": o(Oa.value[e.valueHash]) ? void 0 : kr(e.valueHash),
|
|
2225
2227
|
"aria-expanded": e.expanded ? "true" : "false",
|
|
2226
2228
|
onClick: (t) => {
|
|
2227
|
-
t.stopPropagation(),
|
|
2229
|
+
t.stopPropagation(), gu(e.valueHash);
|
|
2228
2230
|
},
|
|
2229
|
-
onKeydown: (t) =>
|
|
2230
|
-
}),
|
|
2231
|
+
onKeydown: (t) => mu(t, e.valueHash)
|
|
2232
|
+
}), gu = (e) => {
|
|
2231
2233
|
let t = J.value.find((t) => t.valueHash === e);
|
|
2232
|
-
t && (e in
|
|
2234
|
+
t && (e in Oa.value ? mr.value = mr.value.filter((t) => a(t) !== e) : mr.value = [...mr.value, t.value]);
|
|
2233
2235
|
};
|
|
2234
2236
|
E(D, () => {
|
|
2235
|
-
|
|
2237
|
+
yu.clear(), G.unselected = [], G.selected = [];
|
|
2236
2238
|
});
|
|
2237
|
-
let
|
|
2239
|
+
let _u = m(() => {
|
|
2238
2240
|
let e = Array.isArray(G.selected) ? G.selected.length : 0;
|
|
2239
|
-
return !!(O.multiple && e > 0 && !D.value || D.value &&
|
|
2240
|
-
}),
|
|
2241
|
-
selected: !!D.value && !
|
|
2242
|
-
indeterminate:
|
|
2241
|
+
return !!(O.multiple && e > 0 && !D.value || D.value && yu.size > 0);
|
|
2242
|
+
}), vu = m(() => j.part("selectIcon", {
|
|
2243
|
+
selected: !!D.value && !_u.value,
|
|
2244
|
+
indeterminate: _u.value,
|
|
2243
2245
|
disabled: !!O.disabled
|
|
2244
|
-
})),
|
|
2246
|
+
})), yu = wt(/* @__PURE__ */ new Set());
|
|
2245
2247
|
E(() => G.unselected, (e) => {
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
+
yu.clear(), (e ?? []).forEach((e) => {
|
|
2249
|
+
yu.add(a(e));
|
|
2248
2250
|
});
|
|
2249
2251
|
}, { immediate: !0 });
|
|
2250
|
-
let
|
|
2251
|
-
E([() =>
|
|
2252
|
-
let
|
|
2253
|
-
onBlur: () =>
|
|
2252
|
+
let bu = C(null), xu = ue(), Su = () => !O.disableSelectAll && O.multiple;
|
|
2253
|
+
E([() => _u.value, Su], () => xu.onBlur());
|
|
2254
|
+
let Cu = {
|
|
2255
|
+
onBlur: () => xu.onBlur(),
|
|
2254
2256
|
onChange: (e) => {
|
|
2255
|
-
e.target instanceof HTMLInputElement && (pe(e.target, O.readonly, !!D.value) ? he(
|
|
2257
|
+
e.target instanceof HTMLInputElement && (pe(e.target, O.readonly, !!D.value) ? he(bu.value, _u.value) : (he(bu.value, _u.value), D.value = e.target.checked, me(() => bu.value, () => !!D.value, () => _u.value)));
|
|
2256
2258
|
},
|
|
2257
|
-
onFocus:
|
|
2259
|
+
onFocus: xu.onFocus,
|
|
2258
2260
|
onClick: (e) => de(e, O.readonly),
|
|
2259
2261
|
onKeydown: (e) => fe(e, O.readonly)
|
|
2260
|
-
},
|
|
2262
|
+
}, wu = m(() => ({
|
|
2261
2263
|
...ge("checkbox", {
|
|
2262
2264
|
checked: !!D.value,
|
|
2263
2265
|
disabled: O.disabled,
|
|
2264
|
-
indeterminate:
|
|
2266
|
+
indeterminate: _u.value,
|
|
2265
2267
|
name: `select_all_${O.name || ""}`,
|
|
2266
2268
|
readonly: O.readonly,
|
|
2267
2269
|
required: !1,
|
|
2268
2270
|
value: !0
|
|
2269
2271
|
}),
|
|
2270
|
-
...
|
|
2271
|
-
})),
|
|
2272
|
+
...Cu
|
|
2273
|
+
})), Tu = (e) => {
|
|
2272
2274
|
let t = G.unselected ?? [];
|
|
2273
|
-
|
|
2274
|
-
},
|
|
2275
|
+
Eu(e) ? (Os(e), k("item:unselected", e.value), yu.add(e.valueHash), G.unselected = [...t, e.value]) : (D.value || Ds(e), k("item:selected", e.value), yu.delete(e.valueHash), G.unselected = t.filter((t) => a(t) !== a(e.value)));
|
|
2276
|
+
}, Eu = (e) => D.value && yu.has(e.valueHash) ? !1 : e.selected ? !0 : D.value && !(typeof O.selectable == "function" && !O.selectable(e.item)), Du = m(() => {
|
|
2275
2277
|
let e = /* @__PURE__ */ new Map();
|
|
2276
2278
|
for (let t of J.value) e.set(t.valueHash, t);
|
|
2277
2279
|
return e;
|
|
2278
|
-
}),
|
|
2280
|
+
}), Ou = (e) => {
|
|
2279
2281
|
if (O.disabled || O.readonly || typeof O.selectable == "function" && !O.selectable(e.item)) return !0;
|
|
2280
|
-
let t =
|
|
2282
|
+
let t = Du.value.get(e.valueHash);
|
|
2281
2283
|
return !t || !!t.disabled;
|
|
2282
|
-
},
|
|
2283
|
-
|
|
2284
|
-
},
|
|
2285
|
-
if (
|
|
2286
|
-
let t = (e) => e === void 0 ? -1 : J.value.findIndex((t) => t.valueHash === e), n = t(
|
|
2284
|
+
}, ku, Au = (e) => {
|
|
2285
|
+
Ou(e) || (Tu(e), ku = e.valueHash);
|
|
2286
|
+
}, ju = (e) => {
|
|
2287
|
+
if (Ou(e)) return;
|
|
2288
|
+
let t = (e) => e === void 0 ? -1 : J.value.findIndex((t) => t.valueHash === e), n = t(ku), r = t(e.valueHash);
|
|
2287
2289
|
if (!O.multiple || n < 0 || r < 0) {
|
|
2288
|
-
|
|
2290
|
+
Au(e);
|
|
2289
2291
|
return;
|
|
2290
2292
|
}
|
|
2291
|
-
let i = !
|
|
2293
|
+
let i = !Eu(e), o = n <= r ? 1 : -1, s = [];
|
|
2292
2294
|
for (let e = n; e !== r + o; e += o) {
|
|
2293
2295
|
let t = J.value[e];
|
|
2294
|
-
if (t.disabled ||
|
|
2296
|
+
if (t.disabled || Eu(t) === i) continue;
|
|
2295
2297
|
let { item: n } = Y.value[e];
|
|
2296
2298
|
(typeof O.selectable != "function" || O.selectable(n)) && s.push(t);
|
|
2297
2299
|
}
|
|
@@ -2299,61 +2301,61 @@ var Wt = {
|
|
|
2299
2301
|
let e = O.max - (G.selected ?? []).length;
|
|
2300
2302
|
s = s.slice(0, Math.max(0, e));
|
|
2301
2303
|
}
|
|
2302
|
-
if (
|
|
2304
|
+
if (ku = e.valueHash, !s.length) return;
|
|
2303
2305
|
let c = new Set(s.map((e) => e.valueHash)), l = G.unselected ?? [];
|
|
2304
2306
|
if (i) {
|
|
2305
2307
|
D.value || (G.selected = [...G.selected ?? [], ...s.map((e) => e.value)]), G.unselected = l.filter((e) => !c.has(a(e)));
|
|
2306
|
-
for (let e of s)
|
|
2308
|
+
for (let e of s) yu.delete(e.valueHash), k("item:selected", e.value);
|
|
2307
2309
|
} else {
|
|
2308
2310
|
G.selected = (G.selected ?? []).filter((e) => !c.has(a(e))), G.unselected = [...l, ...s.map((e) => e.value)];
|
|
2309
|
-
for (let e of s)
|
|
2311
|
+
for (let e of s) yu.add(e.valueHash), k("item:unselected", e.value);
|
|
2310
2312
|
}
|
|
2311
|
-
},
|
|
2313
|
+
}, Mu = c((e) => typeof e != "string", JSON.stringify), Nu = m(() => [].concat(G.selected ?? []).map((e) => ({
|
|
2312
2314
|
disabled: O.disabled,
|
|
2313
2315
|
name: O.name,
|
|
2314
2316
|
type: "hidden",
|
|
2315
|
-
value:
|
|
2316
|
-
}))),
|
|
2317
|
+
value: Mu(e)
|
|
2318
|
+
}))), Pu = [
|
|
2317
2319
|
70,
|
|
2318
2320
|
45,
|
|
2319
2321
|
85,
|
|
2320
2322
|
55
|
|
2321
|
-
],
|
|
2323
|
+
], Fu = m(() => i(J.value.length || O.columns.length || 1, 4, 10)), Iu = m(() => {
|
|
2322
2324
|
let e = /* @__PURE__ */ new Map();
|
|
2323
|
-
for (let [t, n] of
|
|
2325
|
+
for (let [t, n] of sr.value) e.has(t) || e.set(t, n);
|
|
2324
2326
|
return e;
|
|
2325
|
-
}),
|
|
2327
|
+
}), Lu = m(() => yt([zo.value, j.table.style])), Ru = m(() => {
|
|
2326
2328
|
let { style: e, ...t } = j.table;
|
|
2327
2329
|
return {
|
|
2328
2330
|
...y({
|
|
2329
|
-
ref:
|
|
2330
|
-
class: ["bb-table__table",
|
|
2331
|
-
role:
|
|
2332
|
-
"aria-labelledby": O.caption ?
|
|
2331
|
+
ref: F,
|
|
2332
|
+
class: ["bb-table__table", Ys.value],
|
|
2333
|
+
role: Cr.value,
|
|
2334
|
+
"aria-labelledby": O.caption ? Rr.value : void 0,
|
|
2333
2335
|
"aria-multiselectable": N.value && O.selectable && O.multiple ? "true" : void 0,
|
|
2334
|
-
"aria-rowcount":
|
|
2336
|
+
"aria-rowcount": Wu.value === void 0 ? void 0 : Wu.value + Ku.value,
|
|
2335
2337
|
...N.value ? {
|
|
2336
|
-
onKeydown:
|
|
2337
|
-
onFocusout:
|
|
2338
|
+
onKeydown: pu,
|
|
2339
|
+
onFocusout: ou
|
|
2338
2340
|
} : {}
|
|
2339
2341
|
}, t),
|
|
2340
|
-
style:
|
|
2342
|
+
style: Lu.value
|
|
2341
2343
|
};
|
|
2342
|
-
}),
|
|
2344
|
+
}), zu = m(() => yt([Ko.value, j.rootAttrs.style])), Bu = m(() => {
|
|
2343
2345
|
let { style: e, ...t } = j.rootAttrs;
|
|
2344
2346
|
return {
|
|
2345
2347
|
...y({
|
|
2346
2348
|
id: O.id,
|
|
2347
|
-
ref:
|
|
2348
|
-
"aria-busy":
|
|
2349
|
-
class:
|
|
2350
|
-
"data-bb-table-id":
|
|
2349
|
+
ref: I,
|
|
2350
|
+
"aria-busy": ss.value,
|
|
2351
|
+
class: us.value,
|
|
2352
|
+
"data-bb-table-id": jr.value,
|
|
2351
2353
|
inert: O.disabled,
|
|
2352
|
-
...
|
|
2354
|
+
...wc.value
|
|
2353
2355
|
}, t),
|
|
2354
|
-
style:
|
|
2356
|
+
style: zu.value
|
|
2355
2357
|
};
|
|
2356
|
-
}),
|
|
2358
|
+
}), Vu = m(() => ({
|
|
2357
2359
|
passthrough: j,
|
|
2358
2360
|
slots: A,
|
|
2359
2361
|
selectable: O.selectable,
|
|
@@ -2361,367 +2363,367 @@ var Wt = {
|
|
|
2361
2363
|
readonly: !!O.readonly,
|
|
2362
2364
|
actions: M.value,
|
|
2363
2365
|
grid: N.value,
|
|
2364
|
-
treegrid:
|
|
2365
|
-
cellRole:
|
|
2366
|
-
rowHeaderKeys:
|
|
2367
|
-
contentInert:
|
|
2368
|
-
hasRowIndex:
|
|
2369
|
-
rowOffset:
|
|
2370
|
-
setSize:
|
|
2371
|
-
columnSpan:
|
|
2372
|
-
inputName:
|
|
2366
|
+
treegrid: Sr.value,
|
|
2367
|
+
cellRole: wr.value,
|
|
2368
|
+
rowHeaderKeys: Tr.value,
|
|
2369
|
+
contentInert: cs.value,
|
|
2370
|
+
hasRowIndex: ls.value,
|
|
2371
|
+
rowOffset: ls.value ? ((G.page ?? 1) - 1) * (G.perPage ?? 0) : 0,
|
|
2372
|
+
setSize: ls.value ? G.totalItems ?? void 0 : void 0,
|
|
2373
|
+
columnSpan: ds.value,
|
|
2374
|
+
inputName: Or,
|
|
2373
2375
|
tdClass: O.tdClass,
|
|
2374
|
-
cellClasses:
|
|
2375
|
-
sortOrders:
|
|
2376
|
-
measureRow:
|
|
2377
|
-
expandRegionId:
|
|
2378
|
-
selectRange:
|
|
2379
|
-
rowReorder:
|
|
2380
|
-
menuRows:
|
|
2381
|
-
})),
|
|
2376
|
+
cellClasses: Ui.value,
|
|
2377
|
+
sortOrders: Iu.value,
|
|
2378
|
+
measureRow: Ol,
|
|
2379
|
+
expandRegionId: kr,
|
|
2380
|
+
selectRange: ju,
|
|
2381
|
+
rowReorder: di.value,
|
|
2382
|
+
menuRows: Xr
|
|
2383
|
+
})), Hu = m(() => ({
|
|
2382
2384
|
passthrough: j,
|
|
2383
2385
|
slots: A,
|
|
2384
2386
|
selectable: !!O.selectable,
|
|
2385
|
-
rowDrag:
|
|
2387
|
+
rowDrag: R.value,
|
|
2386
2388
|
actions: M.value,
|
|
2387
|
-
cellRole:
|
|
2389
|
+
cellRole: wr.value,
|
|
2388
2390
|
grid: N.value,
|
|
2389
|
-
rowHeaderKeys:
|
|
2390
|
-
contentInert:
|
|
2391
|
-
columns:
|
|
2391
|
+
rowHeaderKeys: Tr.value,
|
|
2392
|
+
contentInert: cs.value,
|
|
2393
|
+
columns: z.value.map((e) => {
|
|
2392
2394
|
let t = e.align ?? "start";
|
|
2393
2395
|
return {
|
|
2394
2396
|
key: String(e.key),
|
|
2395
|
-
slotName:
|
|
2396
|
-
classes:
|
|
2397
|
+
slotName: fs.value[e.key],
|
|
2398
|
+
classes: Gs.value.has(String(e.key)) ? [`bb-table__cell--${t}`, "bb-table__cell--fluid"] : [`bb-table__cell--${t}`]
|
|
2397
2399
|
};
|
|
2398
2400
|
}),
|
|
2399
|
-
cellClasses:
|
|
2400
|
-
items:
|
|
2401
|
-
})),
|
|
2401
|
+
cellClasses: Ui.value,
|
|
2402
|
+
items: gs.value ?? []
|
|
2403
|
+
})), Uu = m(() => Wu.value === void 0 ? {
|
|
2402
2404
|
first: void 0,
|
|
2403
2405
|
last: void 0
|
|
2404
2406
|
} : {
|
|
2405
2407
|
first: ((G.page ?? 1) - 1) * (G.perPage ?? 0) + 2,
|
|
2406
|
-
last:
|
|
2407
|
-
}),
|
|
2408
|
-
if (!
|
|
2408
|
+
last: Wu.value
|
|
2409
|
+
}), Wu = m(() => {
|
|
2410
|
+
if (!ls.value || G.totalItems == null) return;
|
|
2409
2411
|
let e = G.totalItems + 1;
|
|
2410
|
-
if (
|
|
2411
|
-
if (!J.value.length) return O.loading ? A.loading ? e : Math.max(e,
|
|
2412
|
+
if (vr.value) return e;
|
|
2413
|
+
if (!J.value.length) return O.loading ? A.loading ? e : Math.max(e, Fu.value + 1) : Math.max(e, 2);
|
|
2412
2414
|
let t = $.value.length - Y.value.length;
|
|
2413
2415
|
return e + Number(X.value.first) + Number(X.value.last) + t;
|
|
2414
|
-
}),
|
|
2415
|
-
let e =
|
|
2416
|
-
|
|
2417
|
-
let n =
|
|
2416
|
+
}), Gu = C(null), Ku = C(0), qu = /* @__PURE__ */ new WeakMap(), Ju = (e) => Array.from(e.querySelectorAll("[role=\"row\"]")).filter((t) => t.parentElement?.closest("[role=\"rowgroup\"], [role=\"table\"], [role=\"grid\"], [role=\"treegrid\"]") === e), Yu = () => {
|
|
2417
|
+
let e = Gu.value, t = e && A.tfoot ? Ju(e) : [];
|
|
2418
|
+
Ku.value = t.length;
|
|
2419
|
+
let n = Wu.value;
|
|
2418
2420
|
t.forEach((e, t) => {
|
|
2419
2421
|
let r = e.getAttribute("aria-rowindex");
|
|
2420
|
-
if (r !== null &&
|
|
2421
|
-
|
|
2422
|
+
if (r !== null && qu.get(e) !== r) {
|
|
2423
|
+
qu.delete(e);
|
|
2422
2424
|
return;
|
|
2423
2425
|
}
|
|
2424
2426
|
if (n === void 0) {
|
|
2425
|
-
r !== null && e.removeAttribute("aria-rowindex"),
|
|
2427
|
+
r !== null && e.removeAttribute("aria-rowindex"), qu.delete(e);
|
|
2426
2428
|
return;
|
|
2427
2429
|
}
|
|
2428
2430
|
let i = String(n + 1 + t);
|
|
2429
|
-
r !== i && e.setAttribute("aria-rowindex", i),
|
|
2431
|
+
r !== i && e.setAttribute("aria-rowindex", i), qu.set(e, i);
|
|
2430
2432
|
});
|
|
2431
|
-
},
|
|
2432
|
-
|
|
2433
|
-
|
|
2433
|
+
}, Xu;
|
|
2434
|
+
St(() => {
|
|
2435
|
+
Yu(), Gu.value && typeof MutationObserver < "u" && (Xu = new MutationObserver(Yu), Xu.observe(Gu.value, {
|
|
2434
2436
|
childList: !0,
|
|
2435
2437
|
subtree: !0,
|
|
2436
2438
|
attributes: !0,
|
|
2437
2439
|
attributeFilter: ["role", "aria-rowindex"]
|
|
2438
2440
|
}));
|
|
2439
|
-
}), E(
|
|
2440
|
-
let
|
|
2441
|
-
let e = [], t = Number(
|
|
2442
|
-
return t && (O.selectable && O.fixedSelect ||
|
|
2441
|
+
}), E(Wu, Yu, { flush: "post" }), x(() => Xu?.disconnect());
|
|
2442
|
+
let Zu = m(() => {
|
|
2443
|
+
let e = [], t = Number(R.value), n = t + +!!O.selectable;
|
|
2444
|
+
return t && (O.selectable && O.fixedSelect || z.value.some((e) => e.fixed === "left")) && e.push({
|
|
2443
2445
|
index: 0,
|
|
2444
2446
|
position: "left"
|
|
2445
2447
|
}), O.selectable && O.fixedSelect && e.push({
|
|
2446
2448
|
index: t,
|
|
2447
2449
|
position: "left"
|
|
2448
|
-
}),
|
|
2450
|
+
}), z.value.forEach((t, r) => {
|
|
2449
2451
|
t.fixed && e.push({
|
|
2450
2452
|
index: r + n,
|
|
2451
2453
|
position: t.fixed
|
|
2452
2454
|
});
|
|
2453
2455
|
}), M.value && O.fixedActions && e.push({
|
|
2454
|
-
index:
|
|
2456
|
+
index: z.value.length + n,
|
|
2455
2457
|
position: "right"
|
|
2456
2458
|
}), e;
|
|
2457
|
-
}),
|
|
2459
|
+
}), Qu = m(() => Zu.value.map((e) => typeof e == "number" ? `${e}:left` : `${e.index}:${e.position}`).join(","));
|
|
2458
2460
|
return E(() => [
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2461
|
+
Al.value,
|
|
2462
|
+
Qu.value,
|
|
2463
|
+
ns.value
|
|
2462
2464
|
], ([, e, t], n) => {
|
|
2463
|
-
let r = n?.[1], i =
|
|
2464
|
-
if (
|
|
2465
|
+
let r = n?.[1], i = Zu.value;
|
|
2466
|
+
if (F.value && (e.length || r?.length)) {
|
|
2465
2467
|
let a = e === r && t === n?.[2];
|
|
2466
|
-
Ee(
|
|
2468
|
+
Ee(F.value, i, a ? $o : null, a) && (Zo = e), e !== r && Ec();
|
|
2467
2469
|
}
|
|
2468
|
-
A.thead && b(
|
|
2469
|
-
}, { flush: "post" }),
|
|
2470
|
-
|
|
2471
|
-
}), (
|
|
2472
|
-
default:
|
|
2473
|
-
|
|
2474
|
-
v.selectable ? (S(), g("legend",
|
|
2470
|
+
A.thead && b(ts);
|
|
2471
|
+
}, { flush: "post" }), xt(() => {
|
|
2472
|
+
Ji(), ha(), Kr.stop();
|
|
2473
|
+
}), (t, n) => (S(), ut(Dt(as.value), vt(mt(Bu.value)), {
|
|
2474
|
+
default: Ft(() => [
|
|
2475
|
+
ft(T(f), { value: T(bs) }, null, 8, ["value"]),
|
|
2476
|
+
v.selectable ? (S(), g("legend", Gt, w(os.value), 1)) : h("", !0),
|
|
2475
2477
|
v.caption ? (S(), g("div", y({
|
|
2476
2478
|
key: 1,
|
|
2477
|
-
id:
|
|
2479
|
+
id: Rr.value,
|
|
2478
2480
|
class: "bb-table__caption",
|
|
2479
2481
|
hidden: !v.displayCaption
|
|
2480
|
-
}, T(j).caption), w(v.caption), 17,
|
|
2482
|
+
}, T(j).caption), w(v.caption), 17, Kt)) : h("", !0),
|
|
2481
2483
|
v.reorderable || v.resizable ? (S(), g("div", {
|
|
2482
2484
|
key: 2,
|
|
2483
|
-
id:
|
|
2485
|
+
id: zr.value,
|
|
2484
2486
|
hidden: ""
|
|
2485
|
-
}, [v.reorderable ? (S(), g(
|
|
2486
|
-
|
|
2487
|
+
}, [v.reorderable ? (S(), g(lt, { key: 0 }, [dt(w(T(P)("table.reorderInstructions").value), 1)], 64)) : h("", !0), v.resizable && !K.value ? (S(), g(lt, { key: 1 }, [dt(w(T(P)("table.resizeInstructions").value), 1)], 64)) : h("", !0)], 8, qt)) : h("", !0),
|
|
2488
|
+
Vr.value ? (S(), g("div", {
|
|
2487
2489
|
key: 3,
|
|
2488
|
-
id:
|
|
2490
|
+
id: Br.value,
|
|
2489
2491
|
hidden: ""
|
|
2490
|
-
}, w(T(
|
|
2491
|
-
_("span",
|
|
2492
|
-
|
|
2493
|
-
id:
|
|
2492
|
+
}, w(T(P)("table.sortInstructions").value), 9, Jt)) : h("", !0),
|
|
2493
|
+
_("span", Yt, w(ss.value ? v.loadingText || T(P)("common.loadingText").value : T(vs) === null ? "" : xs.value), 1),
|
|
2494
|
+
R.value ? (S(), g(lt, { key: 4 }, [_("div", {
|
|
2495
|
+
id: Gr.value,
|
|
2494
2496
|
hidden: ""
|
|
2495
|
-
}, w(T(
|
|
2496
|
-
v.reorderable ? (S(), g(
|
|
2497
|
+
}, w(T(P)("table.rowReorderInstructions").value), 9, Xt), _("span", Zt, w(T(Kr).status.value), 1)], 64)) : h("", !0),
|
|
2498
|
+
v.reorderable ? (S(), g(lt, { key: 5 }, [_("span", Qt, w(Si.value), 1), _("div", {
|
|
2497
2499
|
ref_key: "ghostRef",
|
|
2498
|
-
ref:
|
|
2500
|
+
ref: na,
|
|
2499
2501
|
"aria-hidden": "true",
|
|
2500
2502
|
class: "bb-table-column-ghost",
|
|
2501
2503
|
popover: "manual"
|
|
2502
|
-
}, [
|
|
2504
|
+
}, [ft(e, y({
|
|
2503
2505
|
class: "bb-table__drag-icon",
|
|
2504
|
-
icon: T(
|
|
2506
|
+
icon: T(ur),
|
|
2505
2507
|
size: "1em"
|
|
2506
|
-
}, T(j).dragIcon), null, 16, ["icon"]), _("span", null, w(
|
|
2507
|
-
_("div",
|
|
2508
|
+
}, T(j).dragIcon), null, 16, ["icon"]), _("span", null, w(ta.value), 1)], 512)], 64)) : h("", !0),
|
|
2509
|
+
_("div", vt(mt(Ru.value)), [
|
|
2508
2510
|
_("div", y({
|
|
2509
2511
|
class: ["bb-table__head", {
|
|
2510
2512
|
"bb-table__head--dragging": U.value === "dragging",
|
|
2511
|
-
"bb-table__head--resizing":
|
|
2513
|
+
"bb-table__head--resizing": Ri.value !== null
|
|
2512
2514
|
}],
|
|
2513
|
-
inert:
|
|
2515
|
+
inert: cs.value,
|
|
2514
2516
|
role: "rowgroup"
|
|
2515
|
-
}, T(j).head), [
|
|
2516
|
-
"aria-rowindex":
|
|
2517
|
+
}, T(j).head), [Et(t.$slots, "thead", { empty: Es.value }, () => [_("div", y({
|
|
2518
|
+
"aria-rowindex": ls.value ? 1 : void 0,
|
|
2517
2519
|
class: ["bb-table__header-row", v.headerRowClass],
|
|
2518
2520
|
role: "row",
|
|
2519
|
-
onPointerdown:
|
|
2520
|
-
onTouchmove:
|
|
2521
|
+
onPointerdown: wa,
|
|
2522
|
+
onTouchmove: Ta
|
|
2521
2523
|
}, T(j).headerRow), [
|
|
2522
|
-
|
|
2524
|
+
R.value ? (S(), g("div", y({
|
|
2523
2525
|
key: 0,
|
|
2524
2526
|
class: ["bb-table__cell-column-header bb-table__cell-column-header--row-drag", v.thClass],
|
|
2525
2527
|
role: "columnheader",
|
|
2526
|
-
tabindex:
|
|
2527
|
-
}, T(j).cellColumnHeader), [_("span",
|
|
2528
|
+
tabindex: Wc(0)
|
|
2529
|
+
}, T(j).cellColumnHeader), [_("span", nn, w(T(P)("table.rowReorderHeader").value), 1)], 16, tn)) : h("", !0),
|
|
2528
2530
|
v.selectable ? (S(), g("div", y({
|
|
2529
2531
|
key: 1,
|
|
2530
2532
|
class: ["bb-table__cell-column-header bb-table__cell-column-header--select", v.thClass],
|
|
2531
2533
|
role: "columnheader",
|
|
2532
|
-
tabindex:
|
|
2533
|
-
}, T(j).cellColumnHeader), [
|
|
2534
|
+
tabindex: Wc(Number(R.value))
|
|
2535
|
+
}, T(j).cellColumnHeader), [Et(t.$slots, "select:header", {
|
|
2534
2536
|
multiple: v.multiple,
|
|
2535
2537
|
selectAll: !!D.value,
|
|
2536
|
-
text: v.selectText || T(
|
|
2537
|
-
}, () => [_("span",
|
|
2538
|
+
text: v.selectText || T(P)("table.selectText").value
|
|
2539
|
+
}, () => [_("span", an, [!v.disableSelectAll && v.multiple ? (S(), g("label", {
|
|
2538
2540
|
key: 0,
|
|
2539
|
-
class:
|
|
2541
|
+
class: _t(["bb-table-check__label", { "bb-table-check__label--disabled": v.disabled }])
|
|
2540
2542
|
}, [(S(), g("span", {
|
|
2541
|
-
key:
|
|
2543
|
+
key: _u.value.toString(),
|
|
2542
2544
|
class: "bb-table-check"
|
|
2543
2545
|
}, [_("input", y({
|
|
2544
2546
|
ref_key: "selectAllInput",
|
|
2545
|
-
ref:
|
|
2546
|
-
},
|
|
2547
|
+
ref: bu
|
|
2548
|
+
}, wu.value), null, 16), ft(le, y({
|
|
2547
2549
|
checked: !!D.value,
|
|
2548
2550
|
class: "bb-table__select-icon",
|
|
2549
2551
|
disabled: !!v.disabled,
|
|
2550
|
-
"focus-visible": T(
|
|
2551
|
-
focused: T(
|
|
2552
|
+
"focus-visible": T(xu).focusVisible.value,
|
|
2553
|
+
focused: T(xu).focused.value,
|
|
2552
2554
|
"has-errors": !1,
|
|
2553
2555
|
"has-warnings": !1,
|
|
2554
|
-
indeterminate: !!
|
|
2556
|
+
indeterminate: !!_u.value,
|
|
2555
2557
|
readonly: !!v.readonly
|
|
2556
|
-
},
|
|
2558
|
+
}, vu.value), null, 16, [
|
|
2557
2559
|
"checked",
|
|
2558
2560
|
"disabled",
|
|
2559
2561
|
"focus-visible",
|
|
2560
2562
|
"focused",
|
|
2561
2563
|
"indeterminate",
|
|
2562
2564
|
"readonly"
|
|
2563
|
-
])])), _("span",
|
|
2564
|
-
(S(!0), g(
|
|
2565
|
-
key:
|
|
2566
|
-
"aria-describedby":
|
|
2567
|
-
"aria-sort":
|
|
2568
|
-
class: ["bb-table__cell-column-header", [
|
|
2569
|
-
"bb-table__cell-column-header--edge-start":
|
|
2570
|
-
"bb-table__cell-column-header--edge-end":
|
|
2571
|
-
"bb-table__cell-column-header--clip":
|
|
2572
|
-
"bb-table__cell-column-header--dragging":
|
|
2573
|
-
"bb-table__cell-column-header--locked": v.reorderable &&
|
|
2574
|
-
"bb-table__cell-column-header--sortable":
|
|
2575
|
-
"bb-table__cell-column-header--sorted": !!
|
|
2576
|
-
"bb-table__cell-column-header--sorted-desc":
|
|
2577
|
-
"bb-table__cell-column-header--resizing":
|
|
2578
|
-
"bb-table__cell-column-header--floored":
|
|
2579
|
-
"bb-table__cell-column-header--wrap":
|
|
2565
|
+
])])), _("span", on, w(v.selectAllLabel || T(P)("table.selectAllLabel").value), 1)], 2)) : v.multiple ? h("", !0) : (S(), g("span", sn, w(v.selectText || T(P)("table.selectText").value), 1))])])], 16, rn)) : h("", !0),
|
|
2566
|
+
(S(!0), g(lt, null, Tt(Dc.value, (n, r) => (S(), g("div", y({
|
|
2567
|
+
key: n.key,
|
|
2568
|
+
"aria-describedby": Hr(n),
|
|
2569
|
+
"aria-sort": n.sortDirection ?? (n.sortable ? "none" : void 0),
|
|
2570
|
+
class: ["bb-table__cell-column-header", [n.classes, {
|
|
2571
|
+
"bb-table__cell-column-header--edge-start": r === 0,
|
|
2572
|
+
"bb-table__cell-column-header--edge-end": r === Dc.value.length - 1,
|
|
2573
|
+
"bb-table__cell-column-header--clip": Io.value.has(n.key),
|
|
2574
|
+
"bb-table__cell-column-header--dragging": ea.value === n.key,
|
|
2575
|
+
"bb-table__cell-column-header--locked": v.reorderable && _i.value.has(n.key),
|
|
2576
|
+
"bb-table__cell-column-header--sortable": n.sortable,
|
|
2577
|
+
"bb-table__cell-column-header--sorted": !!n.sortOrder,
|
|
2578
|
+
"bb-table__cell-column-header--sorted-desc": n.sortOrder === "desc",
|
|
2579
|
+
"bb-table__cell-column-header--resizing": Ri.value === n.key,
|
|
2580
|
+
"bb-table__cell-column-header--floored": n.key in Zs.value,
|
|
2581
|
+
"bb-table__cell-column-header--wrap": Xs.value.has(n.key)
|
|
2580
2582
|
}]],
|
|
2581
|
-
style:
|
|
2582
|
-
"data-column-key":
|
|
2583
|
+
style: Zs.value[n.key],
|
|
2584
|
+
"data-column-key": Ur.value || Er.value ? n.key : void 0,
|
|
2583
2585
|
role: "columnheader",
|
|
2584
|
-
tabindex:
|
|
2585
|
-
onClick: (e) =>
|
|
2586
|
-
onFocus: (e) =>
|
|
2587
|
-
onKeydown: (e) =>
|
|
2588
|
-
onMousedown: (e) =>
|
|
2589
|
-
}, { ref_for: !0 }, T(j).part("cellColumnHeader",
|
|
2590
|
-
|
|
2586
|
+
tabindex: Er.value ? Wc(r + Number(R.value) + Number(!!v.selectable)) : Ur.value ? n.key === Ti.value ? 0 : -1 : void 0,
|
|
2587
|
+
onClick: (e) => Ei(e, n),
|
|
2588
|
+
onFocus: (e) => Oi(n.key),
|
|
2589
|
+
onKeydown: (e) => ji(e, n.key),
|
|
2590
|
+
onMousedown: (e) => Di(e, n)
|
|
2591
|
+
}, { ref_for: !0 }, T(j).part("cellColumnHeader", gr(n.sortOrder))), [
|
|
2592
|
+
Oc(n.key, "prepend").length ? (S(), ut(kc, {
|
|
2591
2593
|
key: 0,
|
|
2592
|
-
names:
|
|
2593
|
-
scope:
|
|
2594
|
+
names: Oc(n.key, "prepend"),
|
|
2595
|
+
scope: Ac(n)
|
|
2594
2596
|
}, null, 8, ["names", "scope"])) : h("", !0),
|
|
2595
|
-
|
|
2596
|
-
classes:
|
|
2597
|
-
hideColumn: () =>
|
|
2598
|
-
items: T(
|
|
2599
|
-
label:
|
|
2600
|
-
sortOrder:
|
|
2601
|
-
sortable:
|
|
2602
|
-
toggleSort: (e) =>
|
|
2603
|
-
}, () => [
|
|
2597
|
+
Et(t.$slots, n.slotName, {
|
|
2598
|
+
classes: n.classes,
|
|
2599
|
+
hideColumn: () => hi(n.key),
|
|
2600
|
+
items: T(gs),
|
|
2601
|
+
label: n.label,
|
|
2602
|
+
sortOrder: n.sortOrder,
|
|
2603
|
+
sortable: n.sortable,
|
|
2604
|
+
toggleSort: (e) => za(n.key, e)
|
|
2605
|
+
}, () => [n.sortable ? (S(), ut(ot, {
|
|
2604
2606
|
key: 0,
|
|
2605
|
-
"aria-describedby":
|
|
2606
|
-
class:
|
|
2607
|
-
"bb-table-sort--asc":
|
|
2608
|
-
"bb-table-sort--desc":
|
|
2607
|
+
"aria-describedby": Vr.value && !Ur.value && !Er.value ? Br.value : void 0,
|
|
2608
|
+
class: _t(["bb-table-sort", {
|
|
2609
|
+
"bb-table-sort--asc": n.sortOrder === "asc",
|
|
2610
|
+
"bb-table-sort--desc": n.sortOrder === "desc"
|
|
2609
2611
|
}]),
|
|
2610
|
-
tabindex:
|
|
2612
|
+
tabindex: Ur.value || Er.value ? -1 : void 0,
|
|
2611
2613
|
type: "button",
|
|
2612
|
-
onClick: (e) =>
|
|
2614
|
+
onClick: (e) => za(n.key, e)
|
|
2613
2615
|
}, {
|
|
2614
|
-
default:
|
|
2615
|
-
class: "bb-table__sort-icon",
|
|
2616
|
-
icon: T(
|
|
2616
|
+
default: Ft(() => [_("span", ln, w(n.label), 1), ft(e, y({
|
|
2617
|
+
class: ["bb-table__sort-icon", { "bb-table__sort-icon--own-desc": n.sortOrder === "desc" && !!T(fr) }],
|
|
2618
|
+
icon: n.sortOrder === "desc" && T(fr) ? T(fr) : T(dr),
|
|
2617
2619
|
size: "1em"
|
|
2618
|
-
}, { ref_for: !0 }, T(j).part("sortIcon",
|
|
2620
|
+
}, { ref_for: !0 }, T(j).part("sortIcon", gr(n.sortOrder))), null, 16, ["class", "icon"])]),
|
|
2619
2621
|
_: 2
|
|
2620
2622
|
}, 1032, [
|
|
2621
2623
|
"aria-describedby",
|
|
2622
2624
|
"class",
|
|
2623
2625
|
"tabindex",
|
|
2624
2626
|
"onClick"
|
|
2625
|
-
])) : (S(), g("span",
|
|
2626
|
-
|
|
2627
|
+
])) : (S(), g("span", un, w(n.label), 1))]),
|
|
2628
|
+
Oc(n.key, "append").length ? (S(), ut(kc, {
|
|
2627
2629
|
key: 1,
|
|
2628
|
-
names:
|
|
2629
|
-
scope:
|
|
2630
|
+
names: Oc(n.key, "append"),
|
|
2631
|
+
scope: Ac(n)
|
|
2630
2632
|
}, null, 8, ["names", "scope"])) : h("", !0),
|
|
2631
|
-
|
|
2633
|
+
Ii(String(n.key)) ? (S(), g("div", {
|
|
2632
2634
|
key: 2,
|
|
2633
2635
|
"aria-hidden": "true",
|
|
2634
2636
|
class: "bb-table-header__resizer",
|
|
2635
|
-
onDblclick:
|
|
2636
|
-
onPointerdown: (e) =>
|
|
2637
|
-
}, null, 40,
|
|
2638
|
-
], 16,
|
|
2637
|
+
onDblclick: It((e) => Ki(n.key), ["stop"]),
|
|
2638
|
+
onPointerdown: (e) => $i(e, n.key)
|
|
2639
|
+
}, null, 40, dn)) : h("", !0)
|
|
2640
|
+
], 16, cn))), 128)),
|
|
2639
2641
|
M.value ? (S(), g("div", y({
|
|
2640
2642
|
key: 2,
|
|
2641
2643
|
class: ["bb-table__cell-column-header bb-table__cell-column-header--actions", v.thClass],
|
|
2642
2644
|
role: "columnheader",
|
|
2643
|
-
tabindex:
|
|
2644
|
-
}, T(j).cellColumnHeader), [
|
|
2645
|
-
], 16,
|
|
2645
|
+
tabindex: Wc(ds.value - 1)
|
|
2646
|
+
}, T(j).cellColumnHeader), [Et(t.$slots, "actions:header", { text: v.actionsText || T(P)("table.actionsText").value }, () => [_("span", pn, w(v.actionsText || T(P)("table.actionsText").value), 1)])], 16, fn)) : h("", !0)
|
|
2647
|
+
], 16, en)])], 16, $t),
|
|
2646
2648
|
_("div", y({
|
|
2647
2649
|
ref_key: "bodyRef",
|
|
2648
|
-
ref:
|
|
2650
|
+
ref: L,
|
|
2649
2651
|
class: "bb-table__body",
|
|
2650
2652
|
role: "rowgroup",
|
|
2651
|
-
onPointerdown:
|
|
2652
|
-
onFocusin:
|
|
2653
|
-
onFocusout:
|
|
2654
|
-
}, T(j).body), [
|
|
2653
|
+
onPointerdown: qr,
|
|
2654
|
+
onFocusin: $c,
|
|
2655
|
+
onFocusout: el
|
|
2656
|
+
}, T(j).body), [ss.value && !T(J).length ? Et(t.$slots, "loading", { items: T(gs) }, () => [(S(!0), g(lt, null, Tt(Fu.value, (e, t) => (S(), g("div", {
|
|
2655
2657
|
key: t,
|
|
2656
|
-
"aria-rowindex":
|
|
2658
|
+
"aria-rowindex": ls.value ? t + 2 : void 0,
|
|
2657
2659
|
class: "bb-table-skeleton__row",
|
|
2658
2660
|
role: "row"
|
|
2659
2661
|
}, [
|
|
2660
|
-
|
|
2662
|
+
R.value ? (S(), g("div", {
|
|
2661
2663
|
key: 0,
|
|
2662
2664
|
class: "bb-table-skeleton__cell bb-table-skeleton__cell--row-drag",
|
|
2663
|
-
role:
|
|
2664
|
-
}, null, 8,
|
|
2665
|
+
role: wr.value
|
|
2666
|
+
}, null, 8, hn)) : h("", !0),
|
|
2665
2667
|
v.selectable ? (S(), g("div", {
|
|
2666
2668
|
key: 1,
|
|
2667
2669
|
class: "bb-table-skeleton__cell bb-table-skeleton__cell--select",
|
|
2668
|
-
role:
|
|
2669
|
-
}, [...
|
|
2670
|
-
(S(!0), g(
|
|
2670
|
+
role: wr.value
|
|
2671
|
+
}, [...n[1] ||= [_("div", { class: "bb-table-skeleton__placeholder" }, null, -1)]], 8, gn)) : h("", !0),
|
|
2672
|
+
(S(!0), g(lt, null, Tt(z.value, (e, r) => (S(), g("div", {
|
|
2671
2673
|
key: e.key,
|
|
2672
|
-
class:
|
|
2673
|
-
role:
|
|
2674
|
-
}, [!e.skeleton || e.skeleton === "text" ? (S(), g("div",
|
|
2674
|
+
class: _t(["bb-table-skeleton__cell", [`bb-table-skeleton__cell--${e.skeleton ?? "text"}`]]),
|
|
2675
|
+
role: wr.value
|
|
2676
|
+
}, [!e.skeleton || e.skeleton === "text" ? (S(), g("div", vn, [_("div", {
|
|
2675
2677
|
class: "bb-table-skeleton__line",
|
|
2676
|
-
style:
|
|
2678
|
+
style: yt({ width: `${Pu[(t + r) % 4]}%` })
|
|
2677
2679
|
}, null, 4), _("div", {
|
|
2678
2680
|
class: "bb-table-skeleton__line",
|
|
2679
|
-
style:
|
|
2680
|
-
}, null, 4)])) : e.skeleton === "avatar" ? (S(), g("div",
|
|
2681
|
+
style: yt({ width: `${Pu[(t + r + 2) % 4]}%` })
|
|
2682
|
+
}, null, 4)])) : e.skeleton === "avatar" ? (S(), g("div", yn)) : e.skeleton === "avatar-text" ? (S(), g("div", bn, [n[2] ||= _("div", { class: "bb-table-skeleton__avatar" }, null, -1), _("div", xn, [_("div", {
|
|
2681
2683
|
class: "bb-table-skeleton__line",
|
|
2682
|
-
style:
|
|
2684
|
+
style: yt({ width: `${Pu[(t + r) % 4]}%` })
|
|
2683
2685
|
}, null, 4), _("div", {
|
|
2684
2686
|
class: "bb-table-skeleton__line",
|
|
2685
|
-
style:
|
|
2686
|
-
}, null, 4)])])) : e.skeleton === "image" ? (S(), g("div",
|
|
2687
|
+
style: yt({ width: `${Pu[(t + r + 2) % 4]}%` })
|
|
2688
|
+
}, null, 4)])])) : e.skeleton === "image" ? (S(), g("div", Sn)) : e.skeleton === "badge" ? (S(), g("div", Cn)) : h("", !0)], 10, _n))), 128)),
|
|
2687
2689
|
M.value ? (S(), g("div", {
|
|
2688
2690
|
key: 2,
|
|
2689
2691
|
class: "bb-table-skeleton__cell bb-table-skeleton__cell--actions",
|
|
2690
|
-
role:
|
|
2691
|
-
}, [...
|
|
2692
|
-
], 8,
|
|
2693
|
-
X.value.first ? (S(),
|
|
2692
|
+
role: wr.value
|
|
2693
|
+
}, [...n[3] ||= [_("div", { class: "bb-table-skeleton__placeholder" }, null, -1)]], 8, wn)) : h("", !0)
|
|
2694
|
+
], 8, mn))), 128))], void 0, 0) : T(J).length ? Et(t.$slots, "tbody", {}, () => [
|
|
2695
|
+
X.value.first ? (S(), ut(T(ye), {
|
|
2694
2696
|
key: 0,
|
|
2695
|
-
context:
|
|
2697
|
+
context: Hu.value,
|
|
2696
2698
|
edge: "first",
|
|
2697
2699
|
fixed: v.fixedFirst,
|
|
2698
|
-
"row-index":
|
|
2699
|
-
stop:
|
|
2700
|
+
"row-index": Uu.value.first,
|
|
2701
|
+
stop: Uc(er)
|
|
2700
2702
|
}, null, 8, [
|
|
2701
2703
|
"context",
|
|
2702
2704
|
"fixed",
|
|
2703
2705
|
"row-index",
|
|
2704
2706
|
"stop"
|
|
2705
2707
|
])) : h("", !0),
|
|
2706
|
-
(S(!0), g(
|
|
2708
|
+
(S(!0), g(lt, null, Tt(Al.value, (e) => (S(), g(lt, { key: e.key }, [e.kind === "spacer" ? (S(), g("div", {
|
|
2707
2709
|
key: 0,
|
|
2708
2710
|
"aria-hidden": "true",
|
|
2709
2711
|
class: "bb-table-spacer__row bb-table-placeholder__row",
|
|
2710
|
-
style:
|
|
2712
|
+
style: yt({ height: `${e.height}px` })
|
|
2711
2713
|
}, null, 4)) : e.kind === "placeholder" ? (S(), g("div", {
|
|
2712
2714
|
key: 1,
|
|
2713
2715
|
"aria-hidden": "true",
|
|
2714
2716
|
class: "bb-table-placeholder__row bb-table-placeholder__row--pending",
|
|
2715
2717
|
"data-index": e.virtualIndex,
|
|
2716
|
-
style:
|
|
2717
|
-
}, null, 12,
|
|
2718
|
+
style: yt({ height: `${e.height}px` })
|
|
2719
|
+
}, null, 12, Mn)) : e.kind === "row" ? (S(), ut(T(_e), {
|
|
2718
2720
|
key: 2,
|
|
2719
|
-
context:
|
|
2721
|
+
context: Vu.value,
|
|
2720
2722
|
index: e.index,
|
|
2721
2723
|
item: e.item,
|
|
2722
|
-
"select-blocked":
|
|
2723
|
-
selected:
|
|
2724
|
-
stop:
|
|
2724
|
+
"select-blocked": Ou(e.item),
|
|
2725
|
+
selected: Eu(e.item),
|
|
2726
|
+
stop: Uc(e.virtualIndex),
|
|
2725
2727
|
"virtual-index": e.virtualIndex
|
|
2726
2728
|
}, null, 8, [
|
|
2727
2729
|
"context",
|
|
@@ -2731,12 +2733,12 @@ var Wt = {
|
|
|
2731
2733
|
"selected",
|
|
2732
2734
|
"stop",
|
|
2733
2735
|
"virtual-index"
|
|
2734
|
-
])) : (S(),
|
|
2736
|
+
])) : (S(), ut(T(ve), {
|
|
2735
2737
|
key: 3,
|
|
2736
|
-
context:
|
|
2738
|
+
context: Vu.value,
|
|
2737
2739
|
item: e.item,
|
|
2738
|
-
selected:
|
|
2739
|
-
stop:
|
|
2740
|
+
selected: Eu(e.item),
|
|
2741
|
+
stop: Uc(e.virtualIndex),
|
|
2740
2742
|
"virtual-index": e.virtualIndex
|
|
2741
2743
|
}, null, 8, [
|
|
2742
2744
|
"context",
|
|
@@ -2745,13 +2747,13 @@ var Wt = {
|
|
|
2745
2747
|
"stop",
|
|
2746
2748
|
"virtual-index"
|
|
2747
2749
|
]))], 64))), 128)),
|
|
2748
|
-
X.value.last ? (S(),
|
|
2750
|
+
X.value.last ? (S(), ut(T(ye), {
|
|
2749
2751
|
key: 1,
|
|
2750
|
-
context:
|
|
2752
|
+
context: Hu.value,
|
|
2751
2753
|
edge: "last",
|
|
2752
2754
|
fixed: v.fixedLast,
|
|
2753
|
-
"row-index":
|
|
2754
|
-
stop:
|
|
2755
|
+
"row-index": Uu.value.last,
|
|
2756
|
+
stop: Uc(tr)
|
|
2755
2757
|
}, null, 8, [
|
|
2756
2758
|
"context",
|
|
2757
2759
|
"fixed",
|
|
@@ -2760,36 +2762,36 @@ var Wt = {
|
|
|
2760
2762
|
])) : h("", !0)
|
|
2761
2763
|
], void 0, 2) : (S(), g("div", {
|
|
2762
2764
|
key: 1,
|
|
2763
|
-
"aria-rowindex":
|
|
2765
|
+
"aria-rowindex": ls.value ? 2 : void 0,
|
|
2764
2766
|
class: "bb-table-empty__row",
|
|
2765
2767
|
role: "row"
|
|
2766
2768
|
}, [_("div", {
|
|
2767
|
-
"aria-colspan":
|
|
2769
|
+
"aria-colspan": ds.value,
|
|
2768
2770
|
class: "bb-table-empty__cell",
|
|
2769
|
-
role:
|
|
2770
|
-
}, [T(
|
|
2771
|
+
role: wr.value
|
|
2772
|
+
}, [T(vs) === null ? (S(), g("div", An, [Et(t.$slots, "empty", {}, () => [_("span", jn, w(v.emptyText || T(P)("common.emptyText").value), 1)])])) : (S(), g("div", Dn, [_("span", On, [_("span", kn, w(xs.value), 1), _("button", {
|
|
2771
2773
|
class: "bb-load-retry",
|
|
2772
2774
|
type: "button",
|
|
2773
|
-
onClick:
|
|
2774
|
-
}, w(T(
|
|
2775
|
+
onClick: n[0] ||= (e) => T(st)(e, Ss, () => F.value)
|
|
2776
|
+
}, w(T(P)("common.retryLabel").value), 1)])]))], 8, En)], 8, Tn))], 16),
|
|
2775
2777
|
_("div", y({
|
|
2776
2778
|
ref_key: "footRef",
|
|
2777
|
-
ref:
|
|
2779
|
+
ref: Gu,
|
|
2778
2780
|
class: "bb-table__foot",
|
|
2779
2781
|
role: A.tfoot ? "rowgroup" : void 0
|
|
2780
|
-
}, T(j).foot), [
|
|
2781
|
-
columnCount:
|
|
2782
|
-
empty:
|
|
2783
|
-
})], 16,
|
|
2782
|
+
}, T(j).foot), [Et(t.$slots, "tfoot", {
|
|
2783
|
+
columnCount: ds.value,
|
|
2784
|
+
empty: Es.value
|
|
2785
|
+
})], 16, Nn)
|
|
2784
2786
|
], 16),
|
|
2785
|
-
(S(!0), g(
|
|
2786
|
-
v.rowMenu ? (S(),
|
|
2787
|
+
(S(!0), g(lt, null, Tt(Nu.value, (e) => (S(), g("input", y({ key: e.value }, { ref_for: !0 }, e), null, 16))), 128)),
|
|
2788
|
+
v.rowMenu ? (S(), ut(T(be), {
|
|
2787
2789
|
key: 6,
|
|
2788
2790
|
ref_key: "rowMenuEl",
|
|
2789
|
-
ref:
|
|
2790
|
-
items:
|
|
2791
|
-
label: v.actionsText || T(
|
|
2792
|
-
onHide:
|
|
2791
|
+
ref: Jr,
|
|
2792
|
+
items: Yr.value,
|
|
2793
|
+
label: v.actionsText || T(P)("table.actionsText").value,
|
|
2794
|
+
onHide: si
|
|
2793
2795
|
}, null, 8, ["items", "label"])) : h("", !0)
|
|
2794
2796
|
]),
|
|
2795
2797
|
_: 3
|