@shtabapp/ui-kit 1.62.0 → 1.64.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/SChartBar-BVgwPlYi.js +215 -0
- package/dist/SChartBar-CBU1uCuL.cjs +1 -0
- package/dist/SChartBurnup-Ch3UMa9w.cjs +1 -0
- package/dist/{SChartBurnup-Dxi0MBwo.js → SChartBurnup-DyJHdRlf.js} +75 -75
- package/dist/SChartHorizontalBar-Bv90SV6E.cjs +1 -0
- package/dist/{SChartHorizontalBar-XNasKzaO.js → SChartHorizontalBar-DDo6TfE8.js} +28 -28
- package/dist/{SChartLine-DSQaezYq.js → SChartLine-Cs1JzPEK.js} +29 -29
- package/dist/SChartLine-nIGaef_o.cjs +1 -0
- package/dist/SChartMultiLine-BzoW4ETf.cjs +1 -0
- package/dist/SChartMultiLine-DqCQ7FCv.js +204 -0
- package/dist/{SChartPie-bN8rY-y5.js → SChartPie-Bt3o7LZI.js} +55 -55
- package/dist/SChartPie-Bv5Obcwb.cjs +1 -0
- package/dist/{SChartProgress-BtwqE4xL.js → SChartProgress-uMg4DBpS.js} +30 -30
- package/dist/SChartProgress-xxqrj03o.cjs +1 -0
- package/dist/SChartStackedArea-BNe6FAg8.cjs +1 -0
- package/dist/{SChartStackedArea-BxUex_Di.js → SChartStackedArea-BQGnKp1i.js} +58 -58
- package/dist/SChartStackedBar-D1G-VloG.cjs +1 -0
- package/dist/SChartStackedBar-fiUU9lNp.js +245 -0
- package/dist/SColorPicker-BRSi0Xhm.cjs +1 -0
- package/dist/{SColorPicker-BL-zrskU.js → SColorPicker-Djr-R81h.js} +2 -1
- package/dist/SDropdownMenu-2koPU6IG.js +38 -0
- package/dist/SDropdownMenu-k9SxaFVH.cjs +1 -0
- package/dist/SList-D0PDc8VN.cjs +1 -0
- package/dist/SList-D2K9dNsj.js +465 -0
- package/dist/{SSegmentControl-CAoM03V6.js → SSegmentControl-B9KkAQiG.js} +11 -9
- package/dist/SSegmentControl-OXTka86u.cjs +1 -0
- package/dist/SSelect-CRlkCLik.cjs +1 -0
- package/dist/SSelect-D6taevzT.js +650 -0
- package/dist/STable-NbCfen0n.cjs +1 -0
- package/dist/STable-aS1eGuVB.js +3445 -0
- package/dist/areChartSeriesAligned-DiBX3TTk.cjs +1 -0
- package/dist/{buildChartSeriesPoints-D8Xpfwp7.js → areChartSeriesAligned-DjonrIMm.js} +2 -8
- package/dist/buildChartSeriesPoints-BTyOpkin.js +10 -0
- package/dist/buildChartSeriesPoints-Cqo2ed-n.cjs +1 -0
- package/dist/components/SChartBar/SChartBar.types.d.ts +47 -0
- package/dist/components/SChartBar/SChartBar.types.d.ts.map +1 -0
- package/dist/components/SChartBar/SChartBar.vue.d.ts +11 -0
- package/dist/components/SChartBar/SChartBar.vue.d.ts.map +1 -0
- package/dist/components/SChartBar/index.d.ts +3 -0
- package/dist/components/SChartBar/index.d.ts.map +1 -0
- package/dist/components/SChartBar/utils/buildBarChartConfig.d.ts +16 -0
- package/dist/components/SChartBar/utils/buildBarChartConfig.d.ts.map +1 -0
- package/dist/components/SChartBar/utils/createBarTargetLinePlugin.d.ts +9 -0
- package/dist/components/SChartBar/utils/createBarTargetLinePlugin.d.ts.map +1 -0
- package/dist/components/SChartBar/utils/demoBarSeries.d.ts +9 -0
- package/dist/components/SChartBar/utils/demoBarSeries.d.ts.map +1 -0
- package/dist/components/SChartBar/utils/skeletonBarSeries.d.ts +5 -0
- package/dist/components/SChartBar/utils/skeletonBarSeries.d.ts.map +1 -0
- package/dist/components/SChartMultiLine/SChartMultiLine.types.d.ts +2 -0
- package/dist/components/SChartMultiLine/SChartMultiLine.types.d.ts.map +1 -1
- package/dist/components/SChartMultiLine/SChartMultiLine.vue.d.ts.map +1 -1
- package/dist/components/SChartMultiLine/utils/buildMultiLineChartConfig.d.ts +2 -1
- package/dist/components/SChartMultiLine/utils/buildMultiLineChartConfig.d.ts.map +1 -1
- package/dist/components/SList/SList.vue.d.ts.map +1 -1
- package/dist/components/SList/utils/resolveListItemFields.d.ts +1 -1
- package/dist/components/SList/utils/resolveListItemFields.d.ts.map +1 -1
- package/dist/components/SSegmentControl/SSegmentControl.types.d.ts +2 -0
- package/dist/components/SSegmentControl/SSegmentControl.types.d.ts.map +1 -1
- package/dist/components/SSegmentControl/SSegmentControlItem.vue.d.ts.map +1 -1
- package/dist/components/STable/STable.types.d.ts +317 -0
- package/dist/components/STable/STable.types.d.ts.map +1 -0
- package/dist/components/STable/STable.vue.d.ts +154 -0
- package/dist/components/STable/STable.vue.d.ts.map +1 -0
- package/dist/components/STable/constants/tableSizes.d.ts +76 -0
- package/dist/components/STable/constants/tableSizes.d.ts.map +1 -0
- package/dist/components/STable/index.d.ts +4 -0
- package/dist/components/STable/index.d.ts.map +1 -0
- package/dist/components/STable/parts/STableCellText.vue.d.ts +23 -0
- package/dist/components/STable/parts/STableCellText.vue.d.ts.map +1 -0
- package/dist/components/STable/parts/STableCheckbox.vue.d.ts +17 -0
- package/dist/components/STable/parts/STableCheckbox.vue.d.ts.map +1 -0
- package/dist/components/STable/parts/STableContentRow.vue.d.ts +41 -0
- package/dist/components/STable/parts/STableContentRow.vue.d.ts.map +1 -0
- package/dist/components/STable/parts/STableGroupRow.vue.d.ts +55 -0
- package/dist/components/STable/parts/STableGroupRow.vue.d.ts.map +1 -0
- package/dist/components/STable/parts/STableHeaderCell.vue.d.ts +36 -0
- package/dist/components/STable/parts/STableHeaderCell.vue.d.ts.map +1 -0
- package/dist/components/STable/parts/STableHint.vue.d.ts +7 -0
- package/dist/components/STable/parts/STableHint.vue.d.ts.map +1 -0
- package/dist/components/STable/parts/STablePlaceholderRow.vue.d.ts +25 -0
- package/dist/components/STable/parts/STablePlaceholderRow.vue.d.ts.map +1 -0
- package/dist/components/STable/parts/STableRow.vue.d.ts +67 -0
- package/dist/components/STable/parts/STableRow.vue.d.ts.map +1 -0
- package/dist/components/STable/parts/STableSkeletonRow.vue.d.ts +27 -0
- package/dist/components/STable/parts/STableSkeletonRow.vue.d.ts.map +1 -0
- package/dist/components/STable/utils/tableDndShared.d.ts +17 -0
- package/dist/components/STable/utils/tableDndShared.d.ts.map +1 -0
- package/dist/components/STable/utils/useFlatTableRows.d.ts +62 -0
- package/dist/components/STable/utils/useFlatTableRows.d.ts.map +1 -0
- package/dist/components/STable/utils/useTableCellPlans.d.ts +48 -0
- package/dist/components/STable/utils/useTableCellPlans.d.ts.map +1 -0
- package/dist/components/STable/utils/useTableColumnDnd.d.ts +28 -0
- package/dist/components/STable/utils/useTableColumnDnd.d.ts.map +1 -0
- package/dist/components/STable/utils/useTableColumnResize.d.ts +24 -0
- package/dist/components/STable/utils/useTableColumnResize.d.ts.map +1 -0
- package/dist/components/STable/utils/useTableColumns.d.ts +86 -0
- package/dist/components/STable/utils/useTableColumns.d.ts.map +1 -0
- package/dist/components/STable/utils/useTableGridFocus.d.ts +79 -0
- package/dist/components/STable/utils/useTableGridFocus.d.ts.map +1 -0
- package/dist/components/STable/utils/useTableGridKeyboard.d.ts +36 -0
- package/dist/components/STable/utils/useTableGridKeyboard.d.ts.map +1 -0
- package/dist/components/STable/utils/useTableRenderEntries.d.ts +56 -0
- package/dist/components/STable/utils/useTableRenderEntries.d.ts.map +1 -0
- package/dist/components/STable/utils/useTableRowDnd.d.ts +37 -0
- package/dist/components/STable/utils/useTableRowDnd.d.ts.map +1 -0
- package/dist/components/STable/utils/useTableRowHydration.d.ts +29 -0
- package/dist/components/STable/utils/useTableRowHydration.d.ts.map +1 -0
- package/dist/components/STable/utils/useTableScrollScale.d.ts +34 -0
- package/dist/components/STable/utils/useTableScrollScale.d.ts.map +1 -0
- package/dist/components/STable/utils/useTableSelection.d.ts +27 -0
- package/dist/components/STable/utils/useTableSelection.d.ts.map +1 -0
- package/dist/components/STable/utils/useTableServiceRows.d.ts +57 -0
- package/dist/components/STable/utils/useTableServiceRows.d.ts.map +1 -0
- package/dist/components/STable/utils/useTableSorting.d.ts +21 -0
- package/dist/components/STable/utils/useTableSorting.d.ts.map +1 -0
- package/dist/components/STable/utils/useTableStickyRows.d.ts +38 -0
- package/dist/components/STable/utils/useTableStickyRows.d.ts.map +1 -0
- package/dist/components/STable/utils/useTableStyleVars.d.ts +22 -0
- package/dist/components/STable/utils/useTableStyleVars.d.ts.map +1 -0
- package/dist/components/STable/utils/useTableVirtualRows.d.ts +56 -0
- package/dist/components/STable/utils/useTableVirtualRows.d.ts.map +1 -0
- package/dist/composables/treeKeyboardNavigation.d.ts +26 -0
- package/dist/composables/treeKeyboardNavigation.d.ts.map +1 -0
- package/dist/composables/useFlatTreeList.d.ts +1 -0
- package/dist/composables/useFlatTreeList.d.ts.map +1 -1
- package/dist/{createChartCrosshairPlugin-DwFOncWI.js → createChartCrosshairPlugin-DU5grSok.js} +2 -2
- package/dist/createChartCrosshairPlugin-DfYzBie2.cjs +1 -0
- package/dist/entries/chart-bar.cjs +1 -0
- package/dist/entries/chart-bar.d.ts +3 -0
- package/dist/entries/chart-bar.d.ts.map +1 -0
- package/dist/entries/chart-bar.js +2 -0
- package/dist/entries/chart-burnup.cjs +1 -1
- package/dist/entries/chart-burnup.js +1 -1
- package/dist/entries/chart-horizontal-bar.cjs +1 -1
- package/dist/entries/chart-horizontal-bar.js +1 -1
- package/dist/entries/chart-line.cjs +1 -1
- package/dist/entries/chart-line.js +1 -1
- package/dist/entries/chart-multi-line.cjs +1 -1
- package/dist/entries/chart-multi-line.js +1 -1
- package/dist/entries/chart-pie.cjs +1 -1
- package/dist/entries/chart-pie.js +1 -1
- package/dist/entries/chart-progress.cjs +1 -1
- package/dist/entries/chart-progress.js +1 -1
- package/dist/entries/chart-stacked-area.cjs +1 -1
- package/dist/entries/chart-stacked-area.js +1 -1
- package/dist/entries/chart-stacked-bar.cjs +1 -1
- package/dist/entries/chart-stacked-bar.js +1 -1
- package/dist/entries/color-picker.cjs +1 -1
- package/dist/entries/color-picker.js +1 -1
- package/dist/entries/list.cjs +1 -1
- package/dist/entries/list.js +1 -1
- package/dist/entries/segment-control.cjs +1 -1
- package/dist/entries/segment-control.js +1 -1
- package/dist/entries/select.cjs +1 -1
- package/dist/entries/select.js +1 -1
- package/dist/entries/table.cjs +1 -0
- package/dist/entries/table.d.ts +3 -0
- package/dist/entries/table.d.ts.map +1 -0
- package/dist/entries/table.js +2 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +133 -129
- package/dist/resolveBarStackedSeriesColor-HDSkh6Mw.cjs +1 -0
- package/dist/resolveBarStackedSeriesColor-LpVh1SvQ.js +11 -0
- package/dist/resolveSeriesPaletteColor-B5qoBbXN.cjs +1 -0
- package/dist/{resolveSeriesPaletteColor-BdvGT-PI.js → resolveSeriesPaletteColor-DcLSyk-D.js} +1 -1
- package/dist/{resolveStackedChartContext-DFre3tt0.js → resolveStackedChartContext-CIKVXkDn.js} +6 -6
- package/dist/resolveStackedChartContext-CQbgdV55.cjs +1 -0
- package/dist/treeKeyboardNavigation-BOz2SVus.cjs +1 -0
- package/dist/treeKeyboardNavigation-SmxTdnDz.js +131 -0
- package/dist/uikit-components.css +1 -1
- package/dist/{SChartSkeletonHost-BT96eWSF.js → useChartInteractivity-BATdT86l.js} +126 -126
- package/dist/useChartInteractivity-CXSdHPOw.cjs +1 -0
- package/package.json +19 -3
- package/dist/SChartBurnup-C4x5kik6.cjs +0 -1
- package/dist/SChartHorizontalBar-4H-lgfO4.cjs +0 -1
- package/dist/SChartLine-BF6Klm4j.cjs +0 -1
- package/dist/SChartMultiLine-CrMmphFe.js +0 -198
- package/dist/SChartMultiLine-Ddvfmf__.cjs +0 -1
- package/dist/SChartPie-namQTFla.cjs +0 -1
- package/dist/SChartProgress-DsFHotRv.cjs +0 -1
- package/dist/SChartSkeletonHost-Dt5EjQr5.cjs +0 -1
- package/dist/SChartStackedArea-BLHs3sSH.cjs +0 -1
- package/dist/SChartStackedBar-BJ9LOgSP.js +0 -250
- package/dist/SChartStackedBar-CWNyvUj9.cjs +0 -1
- package/dist/SColorPicker-CvhpJEj1.cjs +0 -1
- package/dist/SList-C39LrsoS.js +0 -590
- package/dist/SList-Du0gqyFs.cjs +0 -1
- package/dist/SSegmentControl-B9jT8Axu.cjs +0 -1
- package/dist/SSelect-BkX3VuCr.js +0 -682
- package/dist/SSelect-CHWKMbB_.cjs +0 -1
- package/dist/buildChartSeriesPoints-Bv3nXvSu.cjs +0 -1
- package/dist/components/SList/utils/treeKeyboardNavigation.d.ts +0 -16
- package/dist/components/SList/utils/treeKeyboardNavigation.d.ts.map +0 -1
- package/dist/createChartCrosshairPlugin-ZZwKUQm8.cjs +0 -1
- package/dist/resolveSeriesPaletteColor-hI4YDdUg.cjs +0 -1
- package/dist/resolveStackedChartContext-Dsxhhhel.cjs +0 -1
|
@@ -0,0 +1,3445 @@
|
|
|
1
|
+
import { n as e, r as t, t as n } from "./SButton.types-CpdHQtyx.js";
|
|
2
|
+
import { t as r } from "./SButton-6AL2ipRT.js";
|
|
3
|
+
import { i, t as a } from "./SCheckbox-BMkOc5cn.js";
|
|
4
|
+
import { i as o } from "./useFloatingOverlay-QcumEYEq.js";
|
|
5
|
+
import { t as s } from "./SDropdown-LOTCtlCX.js";
|
|
6
|
+
import { t as c } from "./SDropdownMenu-2koPU6IG.js";
|
|
7
|
+
import { a as l, o as u, r as d } from "./treeKeyboardNavigation-SmxTdnDz.js";
|
|
8
|
+
import { t as f } from "./SListItem-C1IeCv8M.js";
|
|
9
|
+
import { n as p, r as m, t as h } from "./SToggle-sGw-LSNd.js";
|
|
10
|
+
import { Fragment as g, computed as _, createBlock as v, createCommentVNode as y, createElementBlock as b, createElementVNode as x, createSlots as S, createTextVNode as C, createVNode as w, defineComponent as T, isMemoSame as E, markRaw as D, mergeModels as O, mergeProps as k, nextTick as A, normalizeClass as j, normalizeStyle as M, onBeforeUnmount as N, onMounted as P, openBlock as F, ref as I, renderList as L, renderSlot as R, shallowRef as z, toDisplayString as B, toRaw as V, toValue as H, unref as U, useId as ee, useModel as te, useSlots as ne, useTemplateRef as re, watch as W, withCtx as G, withModifiers as ie } from "vue";
|
|
11
|
+
import { ESSkeletonType as ae, SIcon as oe, SSeparator as se, SSkeleton as K, useUiKitI18n as ce } from "@shtabapp/ui-kit-primitives";
|
|
12
|
+
import { tryOnScopeDispose as le, useElementSize as ue, useEventListener as de, useRafFn as fe, useResizeObserver as pe, useTimeoutFn as me } from "@vueuse/core";
|
|
13
|
+
import { elementScroll as he, observeElementOffset as ge, useVirtualizer as _e } from "@tanstack/vue-virtual";
|
|
14
|
+
import { combine as ve } from "@atlaskit/pragmatic-drag-and-drop/combine";
|
|
15
|
+
import { draggable as ye, dropTargetForElements as be, monitorForElements as q } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
|
|
16
|
+
import { setCustomNativeDragPreview as xe } from "@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview";
|
|
17
|
+
import { pointerOutsideOfPreview as Se } from "@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview";
|
|
18
|
+
import { attachClosestEdge as Ce, extractClosestEdge as we } from "@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge";
|
|
19
|
+
import { disableNativeDragPreview as Te } from "@atlaskit/pragmatic-drag-and-drop/element/disable-native-drag-preview";
|
|
20
|
+
import { autoScrollForElements as Ee } from "@atlaskit/pragmatic-drag-and-drop-auto-scroll/element";
|
|
21
|
+
//#region src/components/STable/STable.types.ts
|
|
22
|
+
var J = /* @__PURE__ */ function(e) {
|
|
23
|
+
return e.LEFT = "left", e.RIGHT = "right", e;
|
|
24
|
+
}({}), De = /* @__PURE__ */ function(e) {
|
|
25
|
+
return e.LEFT = "left", e.CENTER = "center", e.RIGHT = "right", e;
|
|
26
|
+
}({}), Y = /* @__PURE__ */ function(e) {
|
|
27
|
+
return e.ASC = "asc", e.DESC = "desc", e;
|
|
28
|
+
}({}), Oe = /* @__PURE__ */ function(e) {
|
|
29
|
+
return e.DEFAULT = "default", e.COMPLETED = "completed", e;
|
|
30
|
+
}({}), X = /* @__PURE__ */ function(e) {
|
|
31
|
+
return e.DEFAULT = "default", e.DISABLED = "disabled", e.READONLY = "readonly", e.EDITING = "editing", e;
|
|
32
|
+
}({}), ke = /* @__PURE__ */ function(e) {
|
|
33
|
+
return e.AUTO = "auto", e.FIXED = "fixed", e;
|
|
34
|
+
}({}), Ae = /* @__PURE__ */ function(e) {
|
|
35
|
+
return e.FLAT = "flat", e.TREE = "tree", e;
|
|
36
|
+
}({}), je = /* @__PURE__ */ function(e) {
|
|
37
|
+
return e.BEFORE = "before", e.AFTER = "after", e.CHILD = "child", e;
|
|
38
|
+
}({}), Me = /* @__PURE__ */ function(e) {
|
|
39
|
+
return e.NEUTRAL = "neutral", e.SUCCESS = "success", e.WARNING = "warning", e.DANGER = "danger", e;
|
|
40
|
+
}({}), Z = /* @__PURE__ */ function(e) {
|
|
41
|
+
return e.UNCHECKED = "unchecked", e.CHECKED = "checked", e.INDETERMINATE = "indeterminate", e;
|
|
42
|
+
}({}), Q = /* @__PURE__ */ function(e) {
|
|
43
|
+
return e.ROW = "row", e.GROUP = "group", e.DEPTH_FOOTER = "depthFooter", e.LOAD_MORE = "loadMore", e;
|
|
44
|
+
}({}), Ne = 16e6, Pe = 1e5, Fe = 1e9, Ie = 2e3, Le = .3, Re = 1300, ze = "__s-ui-table-filler__", Be = /* @__PURE__ */ T({
|
|
45
|
+
__name: "STableCheckbox",
|
|
46
|
+
props: /*@__PURE__*/ O({
|
|
47
|
+
screenReaderLabel: {},
|
|
48
|
+
indeterminate: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: !1
|
|
51
|
+
}
|
|
52
|
+
}, {
|
|
53
|
+
modelValue: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: !1
|
|
56
|
+
},
|
|
57
|
+
modelModifiers: {}
|
|
58
|
+
}),
|
|
59
|
+
emits: ["update:modelValue"],
|
|
60
|
+
setup(e) {
|
|
61
|
+
let t = te(e, "modelValue"), n = re("checkboxRef");
|
|
62
|
+
return W([n, () => e.screenReaderLabel], () => {
|
|
63
|
+
let t = n.value?.$el, r = t instanceof HTMLElement ? t.querySelector("input") : void 0;
|
|
64
|
+
r && (r.tabIndex = -1, r.setAttribute("aria-label", e.screenReaderLabel));
|
|
65
|
+
}, {
|
|
66
|
+
immediate: !0,
|
|
67
|
+
flush: "post"
|
|
68
|
+
}), (r, o) => (F(), v(U(a), {
|
|
69
|
+
ref_key: "checkboxRef",
|
|
70
|
+
ref: n,
|
|
71
|
+
modelValue: t.value,
|
|
72
|
+
"onUpdate:modelValue": o[0] ||= (e) => t.value = e,
|
|
73
|
+
indeterminate: e.indeterminate,
|
|
74
|
+
size: U(i).EXTRA_SMALL
|
|
75
|
+
}, null, 8, [
|
|
76
|
+
"modelValue",
|
|
77
|
+
"indeterminate",
|
|
78
|
+
"size"
|
|
79
|
+
]));
|
|
80
|
+
}
|
|
81
|
+
}), Ve = [
|
|
82
|
+
"id",
|
|
83
|
+
"aria-colindex",
|
|
84
|
+
"data-column-key",
|
|
85
|
+
"data-row-key",
|
|
86
|
+
"data-section",
|
|
87
|
+
"tabindex"
|
|
88
|
+
], He = /* @__PURE__ */ T({
|
|
89
|
+
__name: "STableContentRow",
|
|
90
|
+
props: {
|
|
91
|
+
cells: {},
|
|
92
|
+
contentColumnKey: {},
|
|
93
|
+
cellClass: {},
|
|
94
|
+
contentClass: {},
|
|
95
|
+
contentStyle: {},
|
|
96
|
+
section: {},
|
|
97
|
+
rowKey: {},
|
|
98
|
+
cellIdPrefix: {},
|
|
99
|
+
focusColumnKey: {}
|
|
100
|
+
},
|
|
101
|
+
setup(e) {
|
|
102
|
+
return (t, n) => (F(), b("tr", null, [(F(!0), b(g, null, L(e.cells, ({ key: n, cellPlan: r }) => (F(), b(g, { key: n }, [r ? (F(), b("td", {
|
|
103
|
+
key: 1,
|
|
104
|
+
id: `${e.cellIdPrefix}${e.rowKey ?? ""}-${r.descriptor.key}`,
|
|
105
|
+
class: j([r.cellClass, e.cellClass]),
|
|
106
|
+
style: M(r.style),
|
|
107
|
+
"aria-colindex": r.descriptor.colIndex,
|
|
108
|
+
"data-column-key": r.descriptor.key,
|
|
109
|
+
"data-row-key": e.rowKey,
|
|
110
|
+
"data-section": e.section,
|
|
111
|
+
tabindex: r.descriptor.key === e.focusColumnKey ? 0 : -1
|
|
112
|
+
}, [r.descriptor.key === e.contentColumnKey ? (F(), b("div", {
|
|
113
|
+
key: 0,
|
|
114
|
+
class: j(e.contentClass),
|
|
115
|
+
style: M(e.contentStyle)
|
|
116
|
+
}, [R(t.$slots, "default")], 6)) : y("", !0)], 14, Ve)) : (F(), b("td", {
|
|
117
|
+
key: 0,
|
|
118
|
+
class: j([
|
|
119
|
+
"s-ui-table__cell",
|
|
120
|
+
"s-ui-table__filler-cell",
|
|
121
|
+
e.cellClass
|
|
122
|
+
]),
|
|
123
|
+
role: "presentation"
|
|
124
|
+
}, null, 2))], 64))), 128))]));
|
|
125
|
+
}
|
|
126
|
+
}), Ue = /* @__PURE__ */ function(e) {
|
|
127
|
+
return e.INDICATOR = "indicator", e.CHECKBOX = "checkbox", e.RIGHT_EDGE = "rightEdge", e.COLUMNS_MANAGER = "columnsManager", e;
|
|
128
|
+
}({}), We = {
|
|
129
|
+
indicator: "indicator",
|
|
130
|
+
checkbox: "checkbox",
|
|
131
|
+
rightEdge: "right-edge",
|
|
132
|
+
columnsManager: "columns-manager"
|
|
133
|
+
}, Ge = new Set(["rightEdge", "columnsManager"]), Ke = (e) => Ge.has(e) ? J.RIGHT : J.LEFT, qe = (e) => e.replace(/[^a-zA-Z0-9_-]/g, "-"), Je = (e) => `--s-ui-table-col-w-${qe(e)}`, Ye = (e) => `--s-ui-table-sticky-${qe(e)}`, Xe = (e) => `--s-ui-table-live-w-${qe(e)}`, Ze = (e) => `--s-ui-table-live-sticky-${qe(e)}`, Qe = (e, t) => e.maxWidth === void 0 ? Infinity : Math.max(0, e.maxWidth - e.baseWidth - t), $e = (e, t, n) => {
|
|
134
|
+
let r = e.reduce((e, t) => e + t.baseWidth, 0), i = 0;
|
|
135
|
+
return e.forEach((a, o) => {
|
|
136
|
+
let s = o === e.length - 1 ? t - i : Math.floor(t * a.baseWidth / r), c = n.get(a.key) ?? 0, l = Math.min(s, Qe(a, c));
|
|
137
|
+
n.set(a.key, c + l), i += l;
|
|
138
|
+
}), t - i;
|
|
139
|
+
}, et = (e) => e ? 430 : 160, tt = (e) => {
|
|
140
|
+
let t = e.filter((e) => e.sticky === J.LEFT), n = t[t.length - 1];
|
|
141
|
+
n && (n.lastStickyLeft = !0);
|
|
142
|
+
let r = e.find((e) => e.sticky === J.RIGHT);
|
|
143
|
+
r && (r.firstStickyRight = !0);
|
|
144
|
+
}, nt = (e, t) => {
|
|
145
|
+
let n = /* @__PURE__ */ new Map(), r = t;
|
|
146
|
+
for (let t = 0; t < e.length && r > 0; t += 1) {
|
|
147
|
+
let t = e.filter((e) => Qe(e, n.get(e.key) ?? 0) > 0);
|
|
148
|
+
if (t.length === 0) return n;
|
|
149
|
+
r = $e(t, r, n);
|
|
150
|
+
}
|
|
151
|
+
return n;
|
|
152
|
+
}, rt = (e, t) => {
|
|
153
|
+
let n = e.reduce((e, t) => e + t.baseWidth, 0), r = e.filter((e) => e.flexible), i = Math.floor(t) - n;
|
|
154
|
+
if (i <= 0 || r.length === 0) return e;
|
|
155
|
+
let a = nt(r, i);
|
|
156
|
+
return e.map((e) => {
|
|
157
|
+
let t = a.get(e.key);
|
|
158
|
+
return t ? {
|
|
159
|
+
...e,
|
|
160
|
+
width: e.baseWidth + t
|
|
161
|
+
} : e;
|
|
162
|
+
});
|
|
163
|
+
}, it = ({ columns: e, columnOrder: t, columnWidths: n, hiddenColumns: r, hasIndicator: i, hasCheckbox: a, hasRightEdge: o, hasColumnsManager: s, columnsResizable: c, columnsDraggable: l, viewportWidth: u }) => {
|
|
164
|
+
let d = _(() => {
|
|
165
|
+
let t = H(e);
|
|
166
|
+
return t.find((e) => e.primary)?.key ?? t[0]?.key;
|
|
167
|
+
}), f = _(() => {
|
|
168
|
+
let n = H(e), i = new Set(r.value ?? []), a = t.value, o = new Map(n.map((e) => [e.key, e])), s = [];
|
|
169
|
+
a ? (a.forEach((e) => {
|
|
170
|
+
o.has(e) && s.push(e);
|
|
171
|
+
}), n.forEach((e) => {
|
|
172
|
+
a.includes(e.key) || s.push(e.key);
|
|
173
|
+
})) : n.forEach((e) => {
|
|
174
|
+
s.push(e.key);
|
|
175
|
+
});
|
|
176
|
+
let c = [];
|
|
177
|
+
s.forEach((e) => {
|
|
178
|
+
let t = o.get(e);
|
|
179
|
+
t && (e !== d.value && i.has(e) || c.push(t));
|
|
180
|
+
});
|
|
181
|
+
let l = [], u = [], f = [], p = [];
|
|
182
|
+
return c.forEach((e) => {
|
|
183
|
+
e.key === d.value ? l.push(e) : e.sticky === J.LEFT ? u.push(e) : e.sticky === J.RIGHT ? p.push(e) : f.push(e);
|
|
184
|
+
}), [
|
|
185
|
+
...l,
|
|
186
|
+
...u,
|
|
187
|
+
...f,
|
|
188
|
+
...p
|
|
189
|
+
];
|
|
190
|
+
}), p = (e, t) => {
|
|
191
|
+
let r = n.value?.[e.key];
|
|
192
|
+
return r ? {
|
|
193
|
+
baseWidth: r,
|
|
194
|
+
flexible: !1
|
|
195
|
+
} : e.width ? {
|
|
196
|
+
baseWidth: e.width,
|
|
197
|
+
flexible: !1
|
|
198
|
+
} : {
|
|
199
|
+
baseWidth: et(t),
|
|
200
|
+
flexible: e.sticky !== J.RIGHT
|
|
201
|
+
};
|
|
202
|
+
}, m = (e) => {
|
|
203
|
+
H(o) && e("rightEdge", 40), H(s) && e("columnsManager", 32);
|
|
204
|
+
}, h = _(() => {
|
|
205
|
+
let e = [], t = H(c), n = H(l), r = (t, n) => {
|
|
206
|
+
let r = Ke(t);
|
|
207
|
+
e.push({
|
|
208
|
+
key: `__s-ui-table-${t}`,
|
|
209
|
+
service: t,
|
|
210
|
+
width: n,
|
|
211
|
+
baseWidth: n,
|
|
212
|
+
flexible: !1,
|
|
213
|
+
minWidth: n,
|
|
214
|
+
maxWidth: n,
|
|
215
|
+
sticky: r,
|
|
216
|
+
align: De.LEFT,
|
|
217
|
+
primary: !1,
|
|
218
|
+
resizable: !1,
|
|
219
|
+
draggable: !1,
|
|
220
|
+
sortable: !1,
|
|
221
|
+
hideable: !1,
|
|
222
|
+
colIndex: 0,
|
|
223
|
+
widthVar: Je(t),
|
|
224
|
+
liveWidthVar: Xe(t),
|
|
225
|
+
stickyOffsetVar: Ye(t),
|
|
226
|
+
liveStickyOffsetVar: Ze(t),
|
|
227
|
+
lastStickyLeft: !1,
|
|
228
|
+
firstStickyRight: !1
|
|
229
|
+
});
|
|
230
|
+
};
|
|
231
|
+
H(i) && r("indicator", 2), H(a) && r("checkbox", 24), f.value.forEach((r) => {
|
|
232
|
+
let i = r.key === d.value, a = i ? J.LEFT : r.sticky, { baseWidth: o, flexible: s } = p(r, i);
|
|
233
|
+
e.push({
|
|
234
|
+
key: r.key,
|
|
235
|
+
column: r,
|
|
236
|
+
width: o,
|
|
237
|
+
baseWidth: o,
|
|
238
|
+
flexible: s,
|
|
239
|
+
minWidth: r.minWidth ?? 60,
|
|
240
|
+
maxWidth: r.maxWidth,
|
|
241
|
+
sticky: a,
|
|
242
|
+
align: r.align ?? De.LEFT,
|
|
243
|
+
primary: i,
|
|
244
|
+
resizable: t && (r.resizable ?? !0),
|
|
245
|
+
draggable: n && !i && (r.draggable ?? !0),
|
|
246
|
+
sortable: r.sortable ?? !1,
|
|
247
|
+
hideable: !i && (r.hideable ?? !0),
|
|
248
|
+
colIndex: 0,
|
|
249
|
+
widthVar: Je(r.key),
|
|
250
|
+
liveWidthVar: Xe(r.key),
|
|
251
|
+
stickyOffsetVar: a ? Ye(r.key) : void 0,
|
|
252
|
+
liveStickyOffsetVar: a ? Ze(r.key) : void 0,
|
|
253
|
+
lastStickyLeft: !1,
|
|
254
|
+
firstStickyRight: !1
|
|
255
|
+
});
|
|
256
|
+
}), m(r);
|
|
257
|
+
let o = 0;
|
|
258
|
+
return e.forEach((e) => {
|
|
259
|
+
e.sticky !== J.RIGHT && (o += 1, e.colIndex = o);
|
|
260
|
+
}), e.forEach((e) => {
|
|
261
|
+
e.sticky === J.RIGHT && (o += 1, e.colIndex = o);
|
|
262
|
+
}), tt(e), e;
|
|
263
|
+
}), g = _(() => rt(h.value, H(u))), v = _(() => g.value.reduce((e, t) => e + t.width, 0)), y = _(() => {
|
|
264
|
+
let e = {}, t = 0;
|
|
265
|
+
g.value.forEach((n) => {
|
|
266
|
+
e[n.widthVar] = `${n.width}px`, n.sticky === J.LEFT && n.stickyOffsetVar && (e[n.stickyOffsetVar] = `${t}px`, t += n.width);
|
|
267
|
+
});
|
|
268
|
+
let n = 0;
|
|
269
|
+
return [...g.value].reverse().forEach((t) => {
|
|
270
|
+
t.sticky === J.RIGHT && t.stickyOffsetVar && (e[t.stickyOffsetVar] = `${n}px`, n += t.width);
|
|
271
|
+
}), e;
|
|
272
|
+
});
|
|
273
|
+
return {
|
|
274
|
+
primaryColumnKey: d,
|
|
275
|
+
orderedDataColumns: f,
|
|
276
|
+
columnDescriptors: g,
|
|
277
|
+
dataColumnDescriptors: _(() => g.value.filter((e) => e.column)),
|
|
278
|
+
columnCssVars: y,
|
|
279
|
+
totalWidth: v,
|
|
280
|
+
columnCount: _(() => g.value.length)
|
|
281
|
+
};
|
|
282
|
+
}, $ = /* @__PURE__ */ function(e) {
|
|
283
|
+
return e.HEADER = "h", e.BODY = "b", e.CREATION = "c", e.AGGREGATE = "a", e;
|
|
284
|
+
}({}), at = "button, a[href], input, select, textarea, [tabindex]", ot = Object.values($), st = (e) => ot.find((t) => t === e), ct = ({ tableRootElement: e, tableElement: t, scrollElement: n, columnDescriptors: r, flatRows: i, snapshot: a, groupColumnKey: o, depthFooterColumnKey: s, loadMoreColumnKey: c, creationColumnKey: l, hasCreationRow: u, hasAggregateRow: d, isRowNavigable: f, pageSize: p, buildCellDomId: m, onBodyRowFocused: h, scrollToRowIndex: g }) => {
|
|
285
|
+
let v = z(), y = z(), b = z(!1), x = z(0), S = _(() => r.value.filter((e) => e.service !== Ue.INDICATOR).map((e) => e.key)), C = _(() => r.value.filter((e) => e.service !== Ue.INDICATOR && e.service !== Ue.COLUMNS_MANAGER).map((e) => e.key)), w = (e) => {
|
|
286
|
+
if (!e) return;
|
|
287
|
+
let t = a.value.getRowIndexByKey(e);
|
|
288
|
+
return t === void 0 ? void 0 : i.value[t];
|
|
289
|
+
}, T = (e) => {
|
|
290
|
+
if (e.kind === Q.ROW) return C.value;
|
|
291
|
+
let t = {
|
|
292
|
+
[Q.ROW]: void 0,
|
|
293
|
+
[Q.GROUP]: H(o),
|
|
294
|
+
[Q.DEPTH_FOOTER]: H(s),
|
|
295
|
+
[Q.LOAD_MORE]: H(c)
|
|
296
|
+
}[e.kind];
|
|
297
|
+
return t ? [t] : [];
|
|
298
|
+
}, E = (e) => {
|
|
299
|
+
if (e.section === "h") return S.value;
|
|
300
|
+
if (e.section === "c") {
|
|
301
|
+
let e = H(l);
|
|
302
|
+
return H(u) && e ? [e] : [];
|
|
303
|
+
}
|
|
304
|
+
if (e.section === "a") return H(d) ? C.value : [];
|
|
305
|
+
let t = w(e.rowKey);
|
|
306
|
+
return t && f(t) ? T(t) : [];
|
|
307
|
+
}, D = (e, t) => {
|
|
308
|
+
if (t && e.includes(t)) return t;
|
|
309
|
+
let n = S.value, r = t ? n.indexOf(t) : -1, i = e[0] ?? "";
|
|
310
|
+
if (r === -1) return i;
|
|
311
|
+
let a = i, o = Infinity;
|
|
312
|
+
return e.forEach((e) => {
|
|
313
|
+
let t = Math.abs(n.indexOf(e) - r);
|
|
314
|
+
t < o && (o = t, a = e);
|
|
315
|
+
}), a;
|
|
316
|
+
}, O = _(() => ({
|
|
317
|
+
section: "h",
|
|
318
|
+
columnKey: D(S.value, y.value)
|
|
319
|
+
})), k = _(() => {
|
|
320
|
+
let e = v.value;
|
|
321
|
+
if (!e) return O.value;
|
|
322
|
+
let t = E(e);
|
|
323
|
+
return t.length === 0 ? O.value : t.includes(e.columnKey) ? e : {
|
|
324
|
+
...e,
|
|
325
|
+
columnKey: D(t, e.columnKey)
|
|
326
|
+
};
|
|
327
|
+
}), j = _(() => i.value.length), M = _(() => j.value + +!!H(u) + +!!H(d)), N = (e) => {
|
|
328
|
+
if (e.section === "h") return 0;
|
|
329
|
+
if (e.section === "c") return j.value + 1;
|
|
330
|
+
if (e.section === "a") return j.value + 1 + +!!H(u);
|
|
331
|
+
let t = e.rowKey === void 0 ? void 0 : a.value.getRowIndexByKey(e.rowKey);
|
|
332
|
+
return t === void 0 ? void 0 : t + 1;
|
|
333
|
+
}, P = (e, t) => {
|
|
334
|
+
if (e <= 0) return {
|
|
335
|
+
section: "h",
|
|
336
|
+
columnKey: D(S.value, t)
|
|
337
|
+
};
|
|
338
|
+
if (e <= j.value) {
|
|
339
|
+
let n = i.value[e - 1];
|
|
340
|
+
if (!n || !f(n)) return;
|
|
341
|
+
let r = T(n);
|
|
342
|
+
return r.length === 0 ? void 0 : {
|
|
343
|
+
section: "b",
|
|
344
|
+
rowKey: n.key,
|
|
345
|
+
columnKey: D(r, t)
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
if (H(u) && e === j.value + 1) {
|
|
349
|
+
let e = H(l);
|
|
350
|
+
return e ? {
|
|
351
|
+
section: "c",
|
|
352
|
+
columnKey: e
|
|
353
|
+
} : void 0;
|
|
354
|
+
}
|
|
355
|
+
if (H(d) && e === M.value) return {
|
|
356
|
+
section: "a",
|
|
357
|
+
columnKey: D(S.value, t)
|
|
358
|
+
};
|
|
359
|
+
}, F = (e, t) => {
|
|
360
|
+
let n = e;
|
|
361
|
+
for (; n >= 0 && n <= M.value;) {
|
|
362
|
+
let e = P(n, y.value);
|
|
363
|
+
if (e) return e;
|
|
364
|
+
n += t;
|
|
365
|
+
}
|
|
366
|
+
}, I = (e) => document.getElementById(m(e)) ?? void 0, L = () => I(k.value), R = () => {
|
|
367
|
+
let t = n.value, r = L();
|
|
368
|
+
if (!t || !r || r.classList.contains("s-ui-table__cell--sticky-left") || r.classList.contains("s-ui-table__cell--sticky-right")) return;
|
|
369
|
+
let i = t.getBoundingClientRect(), a = e.value, o = i.left, s = i.right, c = a?.querySelector("th.s-ui-table__cell--last-sticky-left");
|
|
370
|
+
c && (o = Math.max(o, c.getBoundingClientRect().right));
|
|
371
|
+
let l = a?.querySelector("th.s-ui-table__cell--first-sticky-right");
|
|
372
|
+
l && (s = Math.min(s, l.getBoundingClientRect().left));
|
|
373
|
+
let u = r.getBoundingClientRect();
|
|
374
|
+
if (u.left < o) {
|
|
375
|
+
t.scrollLeft -= o - u.left;
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
u.right > s && (t.scrollLeft += u.right - s);
|
|
379
|
+
}, B = (e, t) => {
|
|
380
|
+
v.value = e, t && (y.value = e.columnKey);
|
|
381
|
+
let n = N(e);
|
|
382
|
+
n !== void 0 && (x.value = n);
|
|
383
|
+
}, V = (e, t) => {
|
|
384
|
+
let n = E(e), r = n.length > 0 && !n.includes(e.columnKey) ? {
|
|
385
|
+
...e,
|
|
386
|
+
columnKey: D(n, e.columnKey)
|
|
387
|
+
} : e;
|
|
388
|
+
if (B(r, t?.updateDesired ?? !0), b.value = !1, r.section === "b" && r.rowKey) {
|
|
389
|
+
h(r.rowKey);
|
|
390
|
+
let e = a.value.getRowIndexByKey(r.rowKey);
|
|
391
|
+
(t?.scroll ?? !0) && e !== void 0 && g(e);
|
|
392
|
+
}
|
|
393
|
+
t?.focusElement !== !1 && A(() => {
|
|
394
|
+
L()?.focus({ preventScroll: !0 }), R();
|
|
395
|
+
});
|
|
396
|
+
}, U = (e, t) => {
|
|
397
|
+
let n = k.value;
|
|
398
|
+
if (t !== 0) {
|
|
399
|
+
let e = E(n), r = e[e.indexOf(n.columnKey) + t];
|
|
400
|
+
r && V({
|
|
401
|
+
...n,
|
|
402
|
+
columnKey: r
|
|
403
|
+
});
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
if (e === 0) return;
|
|
407
|
+
let r = e > 0 ? 1 : -1, i = F((N(n) ?? x.value) + r, r);
|
|
408
|
+
i && V(i, { updateDesired: !1 });
|
|
409
|
+
}, ee = (e) => {
|
|
410
|
+
let t = k.value, n = E(t), r = e === "start" ? n[0] : n[n.length - 1];
|
|
411
|
+
r && V({
|
|
412
|
+
...t,
|
|
413
|
+
columnKey: r
|
|
414
|
+
});
|
|
415
|
+
}, te = (e) => {
|
|
416
|
+
let t = e === "first" ? F(0, 1) : F(M.value, -1);
|
|
417
|
+
if (!t) return;
|
|
418
|
+
let n = E(t), r = e === "first" ? n[0] : n[n.length - 1];
|
|
419
|
+
V(r ? {
|
|
420
|
+
...t,
|
|
421
|
+
columnKey: r
|
|
422
|
+
} : t);
|
|
423
|
+
}, ne = (e) => {
|
|
424
|
+
let t = N(k.value) ?? x.value, n = Math.max(1, Math.round(H(p))), r = Math.min(M.value, Math.max(0, t + e * n)), i = F(r, e) ?? F(r, e === 1 ? -1 : 1);
|
|
425
|
+
i && V(i, { updateDesired: !1 });
|
|
426
|
+
}, re = (e) => {
|
|
427
|
+
let t = [];
|
|
428
|
+
return e.querySelectorAll(at).forEach((e) => {
|
|
429
|
+
!(e instanceof HTMLElement) || e.offsetParent === null || e.hasAttribute("disabled") || e.closest("[aria-hidden=\"true\"]") || t.push(e);
|
|
430
|
+
}), t;
|
|
431
|
+
}, G = () => {
|
|
432
|
+
let e = L(), t = e ? re(e)[0] : void 0;
|
|
433
|
+
return t ? (b.value = !0, t.focus(), !0) : !1;
|
|
434
|
+
}, ie = () => {
|
|
435
|
+
b.value = !1, L()?.focus({ preventScroll: !0 });
|
|
436
|
+
}, ae = (e) => {
|
|
437
|
+
let t = L(), n = t ? re(t) : [];
|
|
438
|
+
if (n.length === 0) return;
|
|
439
|
+
let r = document.activeElement, i = n.findIndex((e) => e === r || r instanceof Node && e.contains(r));
|
|
440
|
+
n[i === -1 ? e === 1 ? 0 : n.length - 1 : (i + e + n.length) % n.length]?.focus();
|
|
441
|
+
}, oe = () => {
|
|
442
|
+
let e = k.value, n = E(e);
|
|
443
|
+
if (n.length > 0) {
|
|
444
|
+
V({
|
|
445
|
+
...e,
|
|
446
|
+
columnKey: D(n, y.value)
|
|
447
|
+
}, {
|
|
448
|
+
scroll: !1,
|
|
449
|
+
updateDesired: !1
|
|
450
|
+
});
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
let r = Math.min(x.value, M.value), i = F(r, -1) ?? F(r, 1);
|
|
454
|
+
if (i) {
|
|
455
|
+
V(i, {
|
|
456
|
+
scroll: !1,
|
|
457
|
+
updateDesired: !1
|
|
458
|
+
});
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
461
|
+
if (S.value.length > 0) {
|
|
462
|
+
V(O.value, {
|
|
463
|
+
scroll: !1,
|
|
464
|
+
updateDesired: !1
|
|
465
|
+
});
|
|
466
|
+
return;
|
|
467
|
+
}
|
|
468
|
+
t.value?.focus();
|
|
469
|
+
};
|
|
470
|
+
W(() => {
|
|
471
|
+
let e = v.value?.rowKey;
|
|
472
|
+
return e === void 0 ? void 0 : a.value.getRowIndexByKey(e);
|
|
473
|
+
}, (e, t) => {
|
|
474
|
+
t === void 0 || e !== void 0 || document.activeElement === document.body && oe();
|
|
475
|
+
}, { flush: "post" });
|
|
476
|
+
let se = (e, t) => {
|
|
477
|
+
B(e, !0), b.value = t, e.section === "b" && e.rowKey && h(e.rowKey);
|
|
478
|
+
}, K = (e, t, n) => {
|
|
479
|
+
let r = k.value;
|
|
480
|
+
return r.section === e && r.rowKey === t && r.columnKey === n;
|
|
481
|
+
}, ce = (e, t, n) => K(e, t, n) ? 0 : -1, le = _(() => {
|
|
482
|
+
let e = k.value;
|
|
483
|
+
return e.section === "b" ? e.rowKey : void 0;
|
|
484
|
+
});
|
|
485
|
+
return {
|
|
486
|
+
focusAddress: k,
|
|
487
|
+
focusedBodyRowKey: le,
|
|
488
|
+
focusBodyRowIndex: _(() => {
|
|
489
|
+
let e = le.value;
|
|
490
|
+
return e === void 0 ? void 0 : a.value.getRowIndexByKey(e);
|
|
491
|
+
}),
|
|
492
|
+
cellEntered: b,
|
|
493
|
+
isCellFocused: K,
|
|
494
|
+
getCellTabIndex: ce,
|
|
495
|
+
moveFocus: U,
|
|
496
|
+
moveToRowEdge: ee,
|
|
497
|
+
moveToGridEdge: te,
|
|
498
|
+
moveByPage: ne,
|
|
499
|
+
focusAddressNow: V,
|
|
500
|
+
syncFocusAddress: se,
|
|
501
|
+
enterCell: G,
|
|
502
|
+
exitCell: ie,
|
|
503
|
+
cycleCellFocus: ae,
|
|
504
|
+
restoreFocusAfterUnmount: oe,
|
|
505
|
+
ensureFocusedCellVisibleHorizontally: R,
|
|
506
|
+
queryFocusedCellElement: L
|
|
507
|
+
};
|
|
508
|
+
}, lt = [
|
|
509
|
+
"data-index",
|
|
510
|
+
"aria-rowindex",
|
|
511
|
+
"aria-level",
|
|
512
|
+
"aria-expanded"
|
|
513
|
+
], ut = [
|
|
514
|
+
"id",
|
|
515
|
+
"aria-colindex",
|
|
516
|
+
"data-column-key",
|
|
517
|
+
"data-row-key",
|
|
518
|
+
"data-section",
|
|
519
|
+
"tabindex"
|
|
520
|
+
], dt = { class: "s-ui-table__group-main" }, ft = { class: "s-ui-table__group-title" }, pt = { class: "s-ui-table__group-counter" }, mt = [
|
|
521
|
+
"id",
|
|
522
|
+
"aria-colindex",
|
|
523
|
+
"data-column-key",
|
|
524
|
+
"data-row-key",
|
|
525
|
+
"data-section",
|
|
526
|
+
"tabindex"
|
|
527
|
+
], ht = /* @__PURE__ */ T({
|
|
528
|
+
__name: "STableGroupRow",
|
|
529
|
+
props: {
|
|
530
|
+
row: {},
|
|
531
|
+
rowIndex: {},
|
|
532
|
+
leadingPlans: {},
|
|
533
|
+
trailingPlans: {},
|
|
534
|
+
groupColumnKey: {},
|
|
535
|
+
treeIndent: {},
|
|
536
|
+
count: {},
|
|
537
|
+
total: {},
|
|
538
|
+
expanded: { type: Boolean },
|
|
539
|
+
active: { type: Boolean },
|
|
540
|
+
title: {},
|
|
541
|
+
stuck: {
|
|
542
|
+
type: Boolean,
|
|
543
|
+
default: !1
|
|
544
|
+
},
|
|
545
|
+
dndRef: { type: Function },
|
|
546
|
+
dragging: {
|
|
547
|
+
type: Boolean,
|
|
548
|
+
default: !1
|
|
549
|
+
},
|
|
550
|
+
dropPosition: {},
|
|
551
|
+
cellIdPrefix: {},
|
|
552
|
+
focusColumnKey: {}
|
|
553
|
+
},
|
|
554
|
+
emits: [
|
|
555
|
+
"toggle",
|
|
556
|
+
"rowClick",
|
|
557
|
+
"menuOpen"
|
|
558
|
+
],
|
|
559
|
+
setup(i, { emit: a }) {
|
|
560
|
+
let l = a, u = ne(), { t: d } = ce(), f = I(!1), p = (e) => {
|
|
561
|
+
l("menuOpen"), e();
|
|
562
|
+
}, m = _(() => ({
|
|
563
|
+
"s-ui-table__group-row--active": i.active,
|
|
564
|
+
"s-ui-table__group-row--collapsed": !i.expanded,
|
|
565
|
+
"s-ui-table__group-row--stuck": i.stuck,
|
|
566
|
+
"s-ui-table__group-row--dragging": i.dragging,
|
|
567
|
+
"s-ui-table__group-row--drop-before": i.dropPosition === "before",
|
|
568
|
+
"s-ui-table__group-row--drop-after": i.dropPosition === "after",
|
|
569
|
+
"s-ui-table__group-row--drop-inside": i.dropPosition === "inside"
|
|
570
|
+
})), h = _(() => {
|
|
571
|
+
if (i.row.depth !== 0) return { paddingInlineStart: `calc(var(--s-ui-dimension-4) + ${i.row.depth * i.treeIndent}px)` };
|
|
572
|
+
}), S = _(() => i.total === void 0 ? String(i.count) : `${i.count}/${i.total}`), C = _(() => i.expanded ? "chevronMiniDown" : "chevronMiniRight"), T = _(() => i.expanded ? d("table.collapse") : d("table.expand"));
|
|
573
|
+
return (a, _) => (F(), b("tr", {
|
|
574
|
+
ref: i.dndRef,
|
|
575
|
+
class: j(["s-ui-table__group-row", m.value]),
|
|
576
|
+
"data-index": i.rowIndex,
|
|
577
|
+
"aria-rowindex": i.rowIndex + 2,
|
|
578
|
+
"aria-level": i.row.depth + 1,
|
|
579
|
+
"aria-expanded": i.row.hasChildren ? i.expanded : void 0,
|
|
580
|
+
onClick: _[3] ||= (e) => l("rowClick", e)
|
|
581
|
+
}, [
|
|
582
|
+
(F(!0), b(g, null, L(i.leadingPlans, (m) => (F(), b("td", {
|
|
583
|
+
id: `${i.cellIdPrefix}${i.row.key}-${m.descriptor.key}`,
|
|
584
|
+
key: m.descriptor.key,
|
|
585
|
+
class: j([m.cellClass, "s-ui-table__group-cell"]),
|
|
586
|
+
style: M(m.style),
|
|
587
|
+
"aria-colindex": m.descriptor.colIndex,
|
|
588
|
+
"data-column-key": m.descriptor.key,
|
|
589
|
+
"data-row-key": i.row.key,
|
|
590
|
+
"data-section": U($).BODY,
|
|
591
|
+
tabindex: m.descriptor.key === i.focusColumnKey ? 0 : -1
|
|
592
|
+
}, [m.descriptor.key === i.groupColumnKey ? (F(), b("div", {
|
|
593
|
+
key: 0,
|
|
594
|
+
class: "s-ui-table__group-content",
|
|
595
|
+
style: M(h.value)
|
|
596
|
+
}, [R(a.$slots, "row", {}, () => [
|
|
597
|
+
w(U(r), {
|
|
598
|
+
class: "s-ui-table__group-chevron",
|
|
599
|
+
appearance: U(n).BARE,
|
|
600
|
+
variant: U(t).NEUTRAL,
|
|
601
|
+
size: U(e).SMALL,
|
|
602
|
+
icon: C.value,
|
|
603
|
+
"aria-label": T.value,
|
|
604
|
+
tabindex: "-1",
|
|
605
|
+
onClick: _[0] ||= ie((e) => l("toggle"), ["stop"])
|
|
606
|
+
}, null, 8, [
|
|
607
|
+
"appearance",
|
|
608
|
+
"variant",
|
|
609
|
+
"size",
|
|
610
|
+
"icon",
|
|
611
|
+
"aria-label"
|
|
612
|
+
]),
|
|
613
|
+
x("div", dt, [R(a.$slots, "title", {}, () => [x("span", ft, B(i.title), 1)]), x("span", pt, B(S.value), 1)]),
|
|
614
|
+
x("div", {
|
|
615
|
+
class: "s-ui-table__group-actions",
|
|
616
|
+
onClick: _[2] ||= ie(() => {}, ["stop"])
|
|
617
|
+
}, [R(a.$slots, "actions"), U(u).menu ? (F(), v(U(s), {
|
|
618
|
+
key: 0,
|
|
619
|
+
modelValue: f.value,
|
|
620
|
+
"onUpdate:modelValue": _[1] ||= (e) => f.value = e,
|
|
621
|
+
placement: U(o).BOTTOM_END,
|
|
622
|
+
"teleport-to": !1
|
|
623
|
+
}, {
|
|
624
|
+
trigger: G(({ toggle: i }) => [w(U(r), {
|
|
625
|
+
class: j(["s-ui-table__group-kebab", { "s-ui-table__group-kebab--open": f.value }]),
|
|
626
|
+
appearance: U(n).BARE,
|
|
627
|
+
variant: U(t).NEUTRAL,
|
|
628
|
+
size: U(e).SMALL,
|
|
629
|
+
icon: "more",
|
|
630
|
+
"aria-label": U(d)("table.groupMenu"),
|
|
631
|
+
tabindex: "-1",
|
|
632
|
+
onClick: (e) => p(i)
|
|
633
|
+
}, null, 8, [
|
|
634
|
+
"class",
|
|
635
|
+
"appearance",
|
|
636
|
+
"variant",
|
|
637
|
+
"size",
|
|
638
|
+
"aria-label",
|
|
639
|
+
"onClick"
|
|
640
|
+
])]),
|
|
641
|
+
content: G(() => [w(U(c), { width: 220 }, {
|
|
642
|
+
default: G(() => [R(a.$slots, "menu")]),
|
|
643
|
+
_: 3
|
|
644
|
+
})]),
|
|
645
|
+
_: 3
|
|
646
|
+
}, 8, ["modelValue", "placement"])) : y("", !0)])
|
|
647
|
+
])], 4)) : y("", !0)], 14, ut))), 128)),
|
|
648
|
+
_[4] ||= x("td", {
|
|
649
|
+
class: "s-ui-table__cell s-ui-table__filler-cell s-ui-table__group-cell",
|
|
650
|
+
role: "presentation"
|
|
651
|
+
}, null, -1),
|
|
652
|
+
(F(!0), b(g, null, L(i.trailingPlans, (e) => (F(), b("td", {
|
|
653
|
+
id: `${i.cellIdPrefix}${i.row.key}-${e.descriptor.key}`,
|
|
654
|
+
key: e.descriptor.key,
|
|
655
|
+
class: j([e.cellClass, "s-ui-table__group-cell"]),
|
|
656
|
+
style: M(e.style),
|
|
657
|
+
"aria-colindex": e.descriptor.colIndex,
|
|
658
|
+
"data-column-key": e.descriptor.key,
|
|
659
|
+
"data-row-key": i.row.key,
|
|
660
|
+
"data-section": U($).BODY,
|
|
661
|
+
tabindex: e.descriptor.key === i.focusColumnKey ? 0 : -1
|
|
662
|
+
}, null, 14, mt))), 128))
|
|
663
|
+
], 10, lt));
|
|
664
|
+
}
|
|
665
|
+
}), gt = {
|
|
666
|
+
key: 0,
|
|
667
|
+
class: "s-ui-table__hint-bubble",
|
|
668
|
+
role: "tooltip"
|
|
669
|
+
}, _t = /* @__PURE__ */ T({
|
|
670
|
+
__name: "STableHint",
|
|
671
|
+
props: { text: {} },
|
|
672
|
+
setup(e) {
|
|
673
|
+
let t = I(!1);
|
|
674
|
+
return (n, r) => (F(), b("span", {
|
|
675
|
+
class: "s-ui-table__hint",
|
|
676
|
+
tabindex: "-1",
|
|
677
|
+
onPointerenter: r[0] ||= (e) => t.value = !0,
|
|
678
|
+
onPointerleave: r[1] ||= (e) => t.value = !1,
|
|
679
|
+
onFocusin: r[2] ||= (e) => t.value = !0,
|
|
680
|
+
onFocusout: r[3] ||= (e) => t.value = !1
|
|
681
|
+
}, [w(U(oe), {
|
|
682
|
+
class: "s-ui-table__hint-icon",
|
|
683
|
+
name: "infoCircle",
|
|
684
|
+
size: 16
|
|
685
|
+
}), t.value ? (F(), b("span", gt, B(e.text), 1)) : y("", !0)], 32));
|
|
686
|
+
}
|
|
687
|
+
}), vt = {
|
|
688
|
+
key: 0,
|
|
689
|
+
class: "s-ui-table__header-grip-area"
|
|
690
|
+
}, yt = { class: "s-ui-table__header-name" }, bt = { class: "s-ui-table__header-title" }, xt = {
|
|
691
|
+
key: 1,
|
|
692
|
+
class: "s-ui-table__header-sort",
|
|
693
|
+
"aria-hidden": "true"
|
|
694
|
+
}, St = { class: "s-ui-table__header-sort-badge" }, Ct = /* @__PURE__ */ T({
|
|
695
|
+
__name: "STableHeaderCell",
|
|
696
|
+
props: {
|
|
697
|
+
descriptor: {},
|
|
698
|
+
sortDirection: {},
|
|
699
|
+
sortIndex: {},
|
|
700
|
+
menuOpen: {
|
|
701
|
+
type: Boolean,
|
|
702
|
+
default: !1
|
|
703
|
+
}
|
|
704
|
+
},
|
|
705
|
+
emits: [
|
|
706
|
+
"update:menuOpen",
|
|
707
|
+
"sortToggle",
|
|
708
|
+
"sortSet",
|
|
709
|
+
"hide"
|
|
710
|
+
],
|
|
711
|
+
setup(i, { emit: a }) {
|
|
712
|
+
let l = a, u = ne(), { t: d } = ce(), p = _(() => !!u.menu || i.descriptor.sortable || i.descriptor.hideable), m = _(() => ({
|
|
713
|
+
"s-ui-table__header-plaque--sorted": !!i.sortDirection,
|
|
714
|
+
"s-ui-table__header-plaque--sortable": i.descriptor.sortable
|
|
715
|
+
})), h = _(() => ({ "s-ui-table__header-actions--open": i.menuOpen })), S = _(() => i.sortDirection === Y.DESC ? "descending" : "ascending"), T = _(() => String(i.sortIndex ?? 1)), E = (e) => {
|
|
716
|
+
i.descriptor.sortable && l("sortToggle", e.shiftKey || e.ctrlKey || e.metaKey);
|
|
717
|
+
}, D = (e, t) => {
|
|
718
|
+
l("sortSet", e), t();
|
|
719
|
+
}, O = (e) => {
|
|
720
|
+
l("hide"), e();
|
|
721
|
+
};
|
|
722
|
+
return (a, _) => (F(), b("div", {
|
|
723
|
+
class: j(["s-ui-table__header-plaque", m.value]),
|
|
724
|
+
onClick: E
|
|
725
|
+
}, [
|
|
726
|
+
i.descriptor.draggable ? (F(), b("span", vt, [w(U(r), {
|
|
727
|
+
class: "s-ui-table__header-grip",
|
|
728
|
+
appearance: U(n).BARE,
|
|
729
|
+
variant: U(t).NEUTRAL,
|
|
730
|
+
size: U(e).SMALL,
|
|
731
|
+
icon: "dragAndDrop",
|
|
732
|
+
"aria-label": U(d)("table.dragColumn"),
|
|
733
|
+
tabindex: "-1",
|
|
734
|
+
onClick: _[0] ||= ie(() => {}, ["stop"])
|
|
735
|
+
}, null, 8, [
|
|
736
|
+
"appearance",
|
|
737
|
+
"variant",
|
|
738
|
+
"size",
|
|
739
|
+
"aria-label"
|
|
740
|
+
])])) : y("", !0),
|
|
741
|
+
x("span", yt, [
|
|
742
|
+
x("span", bt, [R(a.$slots, "default", {}, () => [C(B(i.descriptor.column?.title), 1)])]),
|
|
743
|
+
i.descriptor.column?.description ? (F(), v(_t, {
|
|
744
|
+
key: 0,
|
|
745
|
+
text: i.descriptor.column.description
|
|
746
|
+
}, null, 8, ["text"])) : y("", !0),
|
|
747
|
+
i.sortDirection ? (F(), b("span", xt, [w(U(oe), {
|
|
748
|
+
name: S.value,
|
|
749
|
+
size: 16
|
|
750
|
+
}, null, 8, ["name"]), x("span", St, B(T.value), 1)])) : y("", !0),
|
|
751
|
+
i.descriptor.sortable && !i.sortDirection ? (F(), v(U(r), {
|
|
752
|
+
key: 2,
|
|
753
|
+
class: "s-ui-table__header-sort-button",
|
|
754
|
+
appearance: U(n).BARE,
|
|
755
|
+
variant: U(t).NEUTRAL,
|
|
756
|
+
size: U(e).SMALL,
|
|
757
|
+
icon: "ascending",
|
|
758
|
+
"aria-label": U(d)("table.sortAsc"),
|
|
759
|
+
tabindex: "-1",
|
|
760
|
+
onClick: _[1] ||= ie((e) => l("sortToggle", e.shiftKey || e.ctrlKey || e.metaKey), ["stop"])
|
|
761
|
+
}, null, 8, [
|
|
762
|
+
"appearance",
|
|
763
|
+
"variant",
|
|
764
|
+
"size",
|
|
765
|
+
"aria-label"
|
|
766
|
+
])) : y("", !0)
|
|
767
|
+
]),
|
|
768
|
+
x("span", {
|
|
769
|
+
class: j(["s-ui-table__header-actions", h.value]),
|
|
770
|
+
onClick: _[3] ||= ie(() => {}, ["stop"])
|
|
771
|
+
}, [p.value ? (F(), v(U(s), {
|
|
772
|
+
key: 0,
|
|
773
|
+
"model-value": i.menuOpen,
|
|
774
|
+
placement: U(o).BOTTOM_END,
|
|
775
|
+
"teleport-to": !1,
|
|
776
|
+
"onUpdate:modelValue": _[2] ||= (e) => l("update:menuOpen", e)
|
|
777
|
+
}, {
|
|
778
|
+
trigger: G(({ toggle: i }) => [w(U(r), {
|
|
779
|
+
class: "s-ui-table__header-kebab",
|
|
780
|
+
appearance: U(n).BARE,
|
|
781
|
+
variant: U(t).NEUTRAL,
|
|
782
|
+
size: U(e).SMALL,
|
|
783
|
+
icon: "more",
|
|
784
|
+
"aria-label": U(d)("table.columnMenu"),
|
|
785
|
+
tabindex: "-1",
|
|
786
|
+
onClick: (e) => i()
|
|
787
|
+
}, null, 8, [
|
|
788
|
+
"appearance",
|
|
789
|
+
"variant",
|
|
790
|
+
"size",
|
|
791
|
+
"aria-label",
|
|
792
|
+
"onClick"
|
|
793
|
+
])]),
|
|
794
|
+
content: G(({ close: e }) => [w(U(c), { width: 220 }, {
|
|
795
|
+
default: G(() => [U(u).menu ? R(a.$slots, "menu", { key: 0 }) : (F(), b(g, { key: 1 }, [
|
|
796
|
+
i.descriptor.sortable ? (F(), v(U(f), {
|
|
797
|
+
key: 0,
|
|
798
|
+
title: U(d)("table.sortAsc"),
|
|
799
|
+
"icon-left": "ascending",
|
|
800
|
+
selected: i.sortDirection === U(Y).ASC,
|
|
801
|
+
onClick: (t) => D(U(Y).ASC, e)
|
|
802
|
+
}, null, 8, [
|
|
803
|
+
"title",
|
|
804
|
+
"selected",
|
|
805
|
+
"onClick"
|
|
806
|
+
])) : y("", !0),
|
|
807
|
+
i.descriptor.sortable ? (F(), v(U(f), {
|
|
808
|
+
key: 1,
|
|
809
|
+
title: U(d)("table.sortDesc"),
|
|
810
|
+
"icon-left": "descending",
|
|
811
|
+
selected: i.sortDirection === U(Y).DESC,
|
|
812
|
+
onClick: (t) => D(U(Y).DESC, e)
|
|
813
|
+
}, null, 8, [
|
|
814
|
+
"title",
|
|
815
|
+
"selected",
|
|
816
|
+
"onClick"
|
|
817
|
+
])) : y("", !0),
|
|
818
|
+
i.descriptor.sortable && i.sortDirection ? (F(), v(U(f), {
|
|
819
|
+
key: 2,
|
|
820
|
+
title: U(d)("table.sortReset"),
|
|
821
|
+
"icon-left": "closeMini",
|
|
822
|
+
onClick: (t) => D(void 0, e)
|
|
823
|
+
}, null, 8, ["title", "onClick"])) : y("", !0),
|
|
824
|
+
i.descriptor.hideable ? (F(), v(U(f), {
|
|
825
|
+
key: 3,
|
|
826
|
+
title: U(d)("table.hideColumn"),
|
|
827
|
+
"icon-left": "eyeOff",
|
|
828
|
+
onClick: (t) => O(e)
|
|
829
|
+
}, null, 8, ["title", "onClick"])) : y("", !0)
|
|
830
|
+
], 64))]),
|
|
831
|
+
_: 2
|
|
832
|
+
}, 1024)]),
|
|
833
|
+
_: 3
|
|
834
|
+
}, 8, ["model-value", "placement"])) : y("", !0)], 2)
|
|
835
|
+
], 2));
|
|
836
|
+
}
|
|
837
|
+
}), wt = ["data-index", "aria-rowindex"], Tt = {
|
|
838
|
+
key: 0,
|
|
839
|
+
class: "s-ui-table__cell s-ui-table__filler-cell",
|
|
840
|
+
role: "presentation"
|
|
841
|
+
}, Et = ["data-column-key", "data-row-key"], Dt = {
|
|
842
|
+
key: 0,
|
|
843
|
+
class: "s-ui-table__cell-body"
|
|
844
|
+
}, Ot = /* @__PURE__ */ T({
|
|
845
|
+
__name: "STablePlaceholderRow",
|
|
846
|
+
props: {
|
|
847
|
+
rowIndex: {},
|
|
848
|
+
rowKey: {},
|
|
849
|
+
cells: {},
|
|
850
|
+
rowHeight: {}
|
|
851
|
+
},
|
|
852
|
+
setup(e) {
|
|
853
|
+
let t = _(() => e.rowHeight ? { height: `${e.rowHeight}px` } : void 0);
|
|
854
|
+
return (n, r) => (F(), b("tr", {
|
|
855
|
+
class: "s-ui-table__row s-ui-table__row--placeholder",
|
|
856
|
+
style: M(t.value),
|
|
857
|
+
"data-index": e.rowIndex,
|
|
858
|
+
"aria-rowindex": e.rowIndex + 2,
|
|
859
|
+
"data-placeholder": "true"
|
|
860
|
+
}, [(F(!0), b(g, null, L(e.cells, (t) => (F(), b(g, { key: t.key }, [t.cellPlan ? (F(), b("td", {
|
|
861
|
+
key: 1,
|
|
862
|
+
class: j(t.cellPlan.cellClass),
|
|
863
|
+
style: M(t.cellPlan.style),
|
|
864
|
+
"data-column-key": t.cellPlan.descriptor.key,
|
|
865
|
+
"data-row-key": e.rowKey
|
|
866
|
+
}, [t.cellPlan.descriptor.service ? y("", !0) : (F(), b("div", Dt, [...r[0] ||= [x("span", { class: "s-ui-table__placeholder-bar" }, null, -1)]]))], 14, Et)) : (F(), b("td", Tt))], 64))), 128))], 12, wt));
|
|
867
|
+
}
|
|
868
|
+
}), kt = "__s-ui-table-load-more:", At = "__s-ui-table-depth-footer:", jt = (e) => `${kt}${e}`, Mt = (e) => `${At}${e}`, Nt = u, Pt = (e, t) => {
|
|
869
|
+
let n = e[t];
|
|
870
|
+
if (Array.isArray(n)) return n;
|
|
871
|
+
}, Ft = (e, t) => t ? typeof t == "function" ? t(e) === !0 : e[t] === !0 : !1, It = (e, t) => {
|
|
872
|
+
if (!t) return;
|
|
873
|
+
if (typeof t == "function") return t(e);
|
|
874
|
+
let n = e[t];
|
|
875
|
+
if (typeof n == "string" || typeof n == "number") return n;
|
|
876
|
+
}, Lt = (e, t) => {
|
|
877
|
+
if (!t) return;
|
|
878
|
+
let n = e[t];
|
|
879
|
+
return typeof n == "number" ? n : void 0;
|
|
880
|
+
}, Rt = (e, t, n, r) => D({
|
|
881
|
+
key: e,
|
|
882
|
+
item: t,
|
|
883
|
+
depth: n,
|
|
884
|
+
index: 0,
|
|
885
|
+
kind: Q.ROW,
|
|
886
|
+
hasChildren: !1,
|
|
887
|
+
expanded: !1,
|
|
888
|
+
parentKey: r,
|
|
889
|
+
subtreeEnd: 0
|
|
890
|
+
}), zt = ({ items: e, itemKey: t, childrenKey: n, groupRow: r, expanded: i, depthFooter: a, hasMoreChildrenKey: o }) => {
|
|
891
|
+
let s = /* @__PURE__ */ new WeakMap(), c = (e, t, n) => {
|
|
892
|
+
let r = /* @__PURE__ */ new Map(), i = [], a = (e, i, a) => {
|
|
893
|
+
let s = Nt(e, t);
|
|
894
|
+
if (!s) return;
|
|
895
|
+
let c = {
|
|
896
|
+
key: s,
|
|
897
|
+
item: e,
|
|
898
|
+
parentKey: a,
|
|
899
|
+
depth: i,
|
|
900
|
+
subtreeSize: 0,
|
|
901
|
+
children: void 0,
|
|
902
|
+
row: void 0
|
|
903
|
+
};
|
|
904
|
+
r.set(s, c);
|
|
905
|
+
let l = Pt(e, n);
|
|
906
|
+
return l && o(c, l), c;
|
|
907
|
+
}, o = (e, t) => {
|
|
908
|
+
let n = [];
|
|
909
|
+
t.forEach((t) => {
|
|
910
|
+
let r = a(t, e.depth + 1, e.key);
|
|
911
|
+
r && n.push(r);
|
|
912
|
+
}), e.children = n, e.subtreeSize = n.reduce((e, t) => e + 1 + t.subtreeSize, 0), t.length > 0 && i.push(e.key);
|
|
913
|
+
}, s = [];
|
|
914
|
+
return e.forEach((e) => {
|
|
915
|
+
let t = a(e, 0, void 0);
|
|
916
|
+
t && s.push(t);
|
|
917
|
+
}), D({
|
|
918
|
+
nodeByKey: r,
|
|
919
|
+
roots: s,
|
|
920
|
+
expandableKeys: i
|
|
921
|
+
});
|
|
922
|
+
}, l = _(() => {
|
|
923
|
+
let r = V(H(e)), i = H(t), a = H(n), o = s.get(r);
|
|
924
|
+
if (o && o.itemKeyValue === i && o.childrenKeyValue === a) return o.index;
|
|
925
|
+
let l = c(r, i, a);
|
|
926
|
+
return s.set(r, {
|
|
927
|
+
itemKeyValue: i,
|
|
928
|
+
childrenKeyValue: a,
|
|
929
|
+
index: l
|
|
930
|
+
}), l;
|
|
931
|
+
}), u = _(() => new Set(i.value)), d = /* @__PURE__ */ new WeakMap(), f = (e) => {
|
|
932
|
+
let t = d.get(e);
|
|
933
|
+
if (t) return t;
|
|
934
|
+
let n = /* @__PURE__ */ new Map();
|
|
935
|
+
return d.set(e, n), n;
|
|
936
|
+
}, p = _(() => {
|
|
937
|
+
let t = V(H(e)), { roots: n, nodeByKey: i } = l.value, s = H(r), c = H(a), d = H(o), p = u.value, m = c ? new Set(c.depths) : void 0, h = c?.show ?? (() => !0), g = f(t), _ = [], v = [], y = /* @__PURE__ */ new Map(), b = (e, t, n, r) => (e.index = _.length, e.kind = t, e.hasChildren = n, e.expanded = r, e.subtreeEnd = e.index, _.push(e), e), x = (e, t, n, r) => (e.row ||= Rt(e.key, e.item, e.depth, e.parentKey), b(e.row, t, n, r)), S = (e, t, n) => {
|
|
938
|
+
let r = g.get(e);
|
|
939
|
+
return r || (r = Rt(e, t.item, t.depth + 1, t.key), g.set(e, r)), b(r, n, !1, !1);
|
|
940
|
+
}, C = (e) => {
|
|
941
|
+
d && e.item[d] === !0 && S(jt(e.key), e, Q.LOAD_MORE);
|
|
942
|
+
}, w = (e) => {
|
|
943
|
+
if (m !== void 0 && m.has(e.depth) && h(e.item, e.depth)) {
|
|
944
|
+
let t = S(Mt(e.key), e, Q.DEPTH_FOOTER);
|
|
945
|
+
y.set(e.key, t.index);
|
|
946
|
+
}
|
|
947
|
+
}, T = (e) => s && Ft(e.item, s) ? Q.GROUP : Q.ROW, E = (e) => e.children !== void 0 && e.children.length > 0, O = (e, t, n) => (t || n) && p.has(e.key), k = (e) => {
|
|
948
|
+
let t = T(e), n = t === Q.GROUP, r = E(e), i = O(e, r, n), a = x(e, t, r, i);
|
|
949
|
+
n && v.push(a.index), i && (e.children?.forEach((e) => k(e)), C(e), w(e)), a.subtreeEnd = _.length - 1;
|
|
950
|
+
};
|
|
951
|
+
n.forEach((e) => k(e));
|
|
952
|
+
let A = D(_), j = (e) => i.get(e)?.row ?? g.get(e), M = (e) => {
|
|
953
|
+
let t = j(e);
|
|
954
|
+
return t && A[t.index] === t ? t : void 0;
|
|
955
|
+
};
|
|
956
|
+
return D({
|
|
957
|
+
flatRows: A,
|
|
958
|
+
getRowIndexByKey: (e) => M(e)?.index,
|
|
959
|
+
getSubtreeRangeByKey: (e) => {
|
|
960
|
+
let t = M(e);
|
|
961
|
+
return t ? [t.index, t.subtreeEnd] : void 0;
|
|
962
|
+
},
|
|
963
|
+
groupRowIndexes: v,
|
|
964
|
+
depthFooterIndexByParentKey: y
|
|
965
|
+
});
|
|
966
|
+
}), m = _(() => p.value.flatRows), h = (e) => u.value.has(e), g = (e, t) => {
|
|
967
|
+
l.value.nodeByKey.get(e)?.children?.forEach((e) => {
|
|
968
|
+
t.add(e.key), g(e.key, t);
|
|
969
|
+
});
|
|
970
|
+
};
|
|
971
|
+
return {
|
|
972
|
+
treeIndex: l,
|
|
973
|
+
snapshot: p,
|
|
974
|
+
flatRows: m,
|
|
975
|
+
isExpanded: h,
|
|
976
|
+
toggleExpanded: (e) => {
|
|
977
|
+
let t = new Set(i.value);
|
|
978
|
+
if (t.has(e)) {
|
|
979
|
+
t.delete(e);
|
|
980
|
+
let n = /* @__PURE__ */ new Set();
|
|
981
|
+
g(e, n), n.forEach((e) => {
|
|
982
|
+
t.delete(e);
|
|
983
|
+
});
|
|
984
|
+
} else t.add(e);
|
|
985
|
+
i.value = [...t];
|
|
986
|
+
},
|
|
987
|
+
expandAll: () => {
|
|
988
|
+
i.value = [...l.value.expandableKeys];
|
|
989
|
+
},
|
|
990
|
+
collapseAll: () => {
|
|
991
|
+
i.value = [];
|
|
992
|
+
}
|
|
993
|
+
};
|
|
994
|
+
}, Bt = {
|
|
995
|
+
key: 0,
|
|
996
|
+
class: "s-ui-table__cell-text"
|
|
997
|
+
}, Vt = {
|
|
998
|
+
key: 1,
|
|
999
|
+
class: "s-ui-table__cell-placeholder"
|
|
1000
|
+
}, Ht = /* @__PURE__ */ T({
|
|
1001
|
+
__name: "STableCellText",
|
|
1002
|
+
props: {
|
|
1003
|
+
column: {},
|
|
1004
|
+
item: {}
|
|
1005
|
+
},
|
|
1006
|
+
setup(e) {
|
|
1007
|
+
let t = _(() => It(e.item, e.column.value ?? e.column.key)), n = _(() => t.value !== void 0 && t.value !== "");
|
|
1008
|
+
return (r, i) => n.value ? (F(), b("span", Bt, B(t.value), 1)) : e.column.placeholder ? (F(), b("span", Vt, B(e.column.placeholder), 1)) : y("", !0);
|
|
1009
|
+
}
|
|
1010
|
+
}), Ut = [
|
|
1011
|
+
"id",
|
|
1012
|
+
"data-index",
|
|
1013
|
+
"aria-rowindex",
|
|
1014
|
+
"aria-level",
|
|
1015
|
+
"aria-expanded",
|
|
1016
|
+
"aria-selected"
|
|
1017
|
+
], Wt = [
|
|
1018
|
+
"id",
|
|
1019
|
+
"aria-colindex",
|
|
1020
|
+
"data-column-key",
|
|
1021
|
+
"data-row-key",
|
|
1022
|
+
"data-section",
|
|
1023
|
+
"aria-disabled",
|
|
1024
|
+
"aria-readonly",
|
|
1025
|
+
"tabindex"
|
|
1026
|
+
], Gt = {
|
|
1027
|
+
key: 2,
|
|
1028
|
+
class: "s-ui-table__chevron-spacer"
|
|
1029
|
+
}, Kt = {
|
|
1030
|
+
key: 3,
|
|
1031
|
+
class: "s-ui-table__cell-body-action"
|
|
1032
|
+
}, qt = [
|
|
1033
|
+
"id",
|
|
1034
|
+
"aria-colindex",
|
|
1035
|
+
"data-column-key",
|
|
1036
|
+
"data-row-key",
|
|
1037
|
+
"data-section",
|
|
1038
|
+
"aria-disabled",
|
|
1039
|
+
"aria-readonly",
|
|
1040
|
+
"tabindex"
|
|
1041
|
+
], Jt = {
|
|
1042
|
+
key: 0,
|
|
1043
|
+
class: "s-ui-table__right-edge"
|
|
1044
|
+
}, Yt = {
|
|
1045
|
+
key: 2,
|
|
1046
|
+
class: "s-ui-table__cell-body-action"
|
|
1047
|
+
}, Xt = /* @__PURE__ */ T({
|
|
1048
|
+
__name: "STableRow",
|
|
1049
|
+
props: {
|
|
1050
|
+
row: {},
|
|
1051
|
+
rowIndex: {},
|
|
1052
|
+
rowExpanded: {
|
|
1053
|
+
type: Boolean,
|
|
1054
|
+
default: !1
|
|
1055
|
+
},
|
|
1056
|
+
leadingPlans: {},
|
|
1057
|
+
trailingPlans: {},
|
|
1058
|
+
domId: {},
|
|
1059
|
+
selected: {
|
|
1060
|
+
type: Boolean,
|
|
1061
|
+
default: !1
|
|
1062
|
+
},
|
|
1063
|
+
indeterminate: {
|
|
1064
|
+
type: Boolean,
|
|
1065
|
+
default: !1
|
|
1066
|
+
},
|
|
1067
|
+
rowSelectable: {
|
|
1068
|
+
type: Boolean,
|
|
1069
|
+
default: !1
|
|
1070
|
+
},
|
|
1071
|
+
active: {
|
|
1072
|
+
type: Boolean,
|
|
1073
|
+
default: !1
|
|
1074
|
+
},
|
|
1075
|
+
disabled: {
|
|
1076
|
+
type: Boolean,
|
|
1077
|
+
default: !1
|
|
1078
|
+
},
|
|
1079
|
+
treeIndent: {},
|
|
1080
|
+
rowState: {},
|
|
1081
|
+
extraRowClass: {},
|
|
1082
|
+
dndRef: { type: Function },
|
|
1083
|
+
dragging: {
|
|
1084
|
+
type: Boolean,
|
|
1085
|
+
default: !1
|
|
1086
|
+
},
|
|
1087
|
+
dropPosition: {},
|
|
1088
|
+
placeholder: {
|
|
1089
|
+
type: Boolean,
|
|
1090
|
+
default: !1
|
|
1091
|
+
},
|
|
1092
|
+
placeholderHeight: {},
|
|
1093
|
+
cellIdPrefix: {},
|
|
1094
|
+
focusColumnKey: {}
|
|
1095
|
+
},
|
|
1096
|
+
emits: [
|
|
1097
|
+
"rowClick",
|
|
1098
|
+
"rowContextMenu",
|
|
1099
|
+
"cellClick",
|
|
1100
|
+
"toggleExpand",
|
|
1101
|
+
"toggleSelected"
|
|
1102
|
+
],
|
|
1103
|
+
setup(i, { emit: a }) {
|
|
1104
|
+
let o = a, s = ne(), { t: c } = ce(), l = $.BODY, u = (e) => `${i.cellIdPrefix}${i.row.key}-${e}`, d = (e) => e === i.focusColumnKey ? 0 : -1, f = _(() => [
|
|
1105
|
+
{
|
|
1106
|
+
"s-ui-table__row--selected": i.selected,
|
|
1107
|
+
"s-ui-table__row--active": i.active,
|
|
1108
|
+
"s-ui-table__row--disabled": i.disabled,
|
|
1109
|
+
"s-ui-table__row--dragging": i.dragging,
|
|
1110
|
+
"s-ui-table__row--drop-before": i.dropPosition === "before",
|
|
1111
|
+
"s-ui-table__row--drop-after": i.dropPosition === "after",
|
|
1112
|
+
"s-ui-table__row--drop-inside": i.dropPosition === "inside"
|
|
1113
|
+
},
|
|
1114
|
+
D.value,
|
|
1115
|
+
i.extraRowClass
|
|
1116
|
+
]), p = _(() => {
|
|
1117
|
+
if (!(!i.placeholder || !i.placeholderHeight)) return { height: `${i.placeholderHeight}px` };
|
|
1118
|
+
}), m = (e) => {
|
|
1119
|
+
if (!(!e.chevron || i.row.depth === 0)) return { paddingInlineStart: `calc(var(--s-ui-dimension-4) + ${i.row.depth * i.treeIndent}px)` };
|
|
1120
|
+
}, h = {
|
|
1121
|
+
[Oe.DEFAULT]: void 0,
|
|
1122
|
+
[Oe.COMPLETED]: "s-ui-table__row--state-completed"
|
|
1123
|
+
}, S = {
|
|
1124
|
+
[X.DEFAULT]: void 0,
|
|
1125
|
+
[X.DISABLED]: "s-ui-table__cell-body--state-disabled",
|
|
1126
|
+
[X.READONLY]: "s-ui-table__cell-body--state-readonly",
|
|
1127
|
+
[X.EDITING]: "s-ui-table__cell-body--state-editing"
|
|
1128
|
+
}, C = (e) => {
|
|
1129
|
+
let t = e.descriptor.column?.cellState;
|
|
1130
|
+
return t ? typeof t == "function" ? t(i.row.item) : t : X.DEFAULT;
|
|
1131
|
+
}, w = (e) => S[C(e)], T = (e) => C(e) === X.DISABLED || void 0, E = (e) => C(e) === X.READONLY || void 0, D = _(() => i.rowState ? h[i.rowState] : void 0), O = () => ({
|
|
1132
|
+
...i.row,
|
|
1133
|
+
selected: i.selected,
|
|
1134
|
+
indeterminate: i.indeterminate,
|
|
1135
|
+
active: i.active,
|
|
1136
|
+
disabled: i.disabled,
|
|
1137
|
+
group: i.row.kind === Q.GROUP,
|
|
1138
|
+
toggleExpanded: () => {
|
|
1139
|
+
o("toggleExpand");
|
|
1140
|
+
},
|
|
1141
|
+
toggleSelected: () => {
|
|
1142
|
+
o("toggleSelected");
|
|
1143
|
+
}
|
|
1144
|
+
}), A = (e) => {
|
|
1145
|
+
let t = e.descriptor.column ?? { key: e.descriptor.key };
|
|
1146
|
+
return {
|
|
1147
|
+
...O(),
|
|
1148
|
+
column: t,
|
|
1149
|
+
value: It(i.row.item, t.value ?? t.key),
|
|
1150
|
+
cellState: C(e)
|
|
1151
|
+
};
|
|
1152
|
+
}, N = (e) => {
|
|
1153
|
+
let t = [...i.leadingPlans, ...i.trailingPlans].find((t) => t.descriptor.key === e);
|
|
1154
|
+
return t ? C(t) === X.DISABLED : !1;
|
|
1155
|
+
}, P = (e) => {
|
|
1156
|
+
let t = e.target;
|
|
1157
|
+
if (t instanceof Element) {
|
|
1158
|
+
let n = t.closest("td[data-column-key]")?.getAttribute("data-column-key");
|
|
1159
|
+
n && !N(n) && o("cellClick", n, e);
|
|
1160
|
+
}
|
|
1161
|
+
o("rowClick", e);
|
|
1162
|
+
};
|
|
1163
|
+
return (a, h) => (F(), b("tr", {
|
|
1164
|
+
id: i.domId,
|
|
1165
|
+
ref: i.dndRef,
|
|
1166
|
+
class: j(["s-ui-table__row", f.value]),
|
|
1167
|
+
style: M(p.value),
|
|
1168
|
+
"data-index": i.rowIndex,
|
|
1169
|
+
"aria-rowindex": i.rowIndex + 2,
|
|
1170
|
+
"aria-level": i.row.depth + 1,
|
|
1171
|
+
"aria-expanded": i.row.hasChildren ? i.rowExpanded : void 0,
|
|
1172
|
+
"aria-selected": i.selected || void 0,
|
|
1173
|
+
onClick: P,
|
|
1174
|
+
onContextmenu: h[3] ||= (e) => o("rowContextMenu", e)
|
|
1175
|
+
}, [
|
|
1176
|
+
(F(!0), b(g, null, L(i.leadingPlans, (f) => (F(), b("td", {
|
|
1177
|
+
id: u(f.descriptor.key),
|
|
1178
|
+
key: f.descriptor.key,
|
|
1179
|
+
class: j(f.cellClass),
|
|
1180
|
+
style: M(f.style),
|
|
1181
|
+
"aria-colindex": f.descriptor.colIndex,
|
|
1182
|
+
"data-column-key": f.descriptor.key,
|
|
1183
|
+
"data-row-key": i.row.key,
|
|
1184
|
+
"data-section": U(l),
|
|
1185
|
+
"aria-disabled": T(f),
|
|
1186
|
+
"aria-readonly": E(f),
|
|
1187
|
+
tabindex: d(f.descriptor.key)
|
|
1188
|
+
}, [f.descriptor.service === U(Ue).INDICATOR ? (F(), b(g, { key: 0 }, [i.placeholder ? y("", !0) : R(a.$slots, "indicator", k({
|
|
1189
|
+
key: 0,
|
|
1190
|
+
ref_for: !0
|
|
1191
|
+
}, O()))], 64)) : f.descriptor.service === U(Ue).CHECKBOX ? (F(), b(g, { key: 1 }, [U(s).checkbox && !i.placeholder ? R(a.$slots, "checkbox", k({
|
|
1192
|
+
key: 0,
|
|
1193
|
+
ref_for: !0
|
|
1194
|
+
}, O())) : i.rowSelectable && !i.placeholder ? (F(), v(Be, {
|
|
1195
|
+
key: 1,
|
|
1196
|
+
class: j(["s-ui-table__row-checkbox", { "s-ui-table__row-checkbox--active": i.selected || i.indeterminate }]),
|
|
1197
|
+
"model-value": i.selected,
|
|
1198
|
+
indeterminate: i.indeterminate,
|
|
1199
|
+
"screen-reader-label": U(c)("table.selectRow"),
|
|
1200
|
+
"onUpdate:modelValue": h[0] ||= (e) => o("toggleSelected"),
|
|
1201
|
+
onClick: h[1] ||= ie(() => {}, ["stop"])
|
|
1202
|
+
}, null, 8, [
|
|
1203
|
+
"class",
|
|
1204
|
+
"model-value",
|
|
1205
|
+
"indeterminate",
|
|
1206
|
+
"screen-reader-label"
|
|
1207
|
+
])) : y("", !0)], 64)) : i.placeholder ? (F(), b("div", {
|
|
1208
|
+
key: 2,
|
|
1209
|
+
class: "s-ui-table__cell-body",
|
|
1210
|
+
style: M(m(f))
|
|
1211
|
+
}, [...h[4] ||= [x("span", { class: "s-ui-table__placeholder-bar" }, null, -1)]], 4)) : (F(), b("div", {
|
|
1212
|
+
key: 3,
|
|
1213
|
+
class: j(["s-ui-table__cell-body", w(f)]),
|
|
1214
|
+
style: M(m(f))
|
|
1215
|
+
}, [
|
|
1216
|
+
f.chevron ? (F(), b(g, { key: 0 }, [U(s).chevron ? R(a.$slots, "chevron", k({
|
|
1217
|
+
key: 0,
|
|
1218
|
+
ref_for: !0
|
|
1219
|
+
}, O())) : i.row.hasChildren ? (F(), v(U(r), {
|
|
1220
|
+
key: 1,
|
|
1221
|
+
class: "s-ui-table__chevron",
|
|
1222
|
+
appearance: U(n).BARE,
|
|
1223
|
+
variant: U(t).NEUTRAL,
|
|
1224
|
+
size: U(e).SMALL,
|
|
1225
|
+
icon: i.rowExpanded ? "chevronMiniDown" : "chevronMiniRight",
|
|
1226
|
+
"aria-label": i.rowExpanded ? U(c)("table.collapse") : U(c)("table.expand"),
|
|
1227
|
+
tabindex: "-1",
|
|
1228
|
+
onClick: h[2] ||= ie((e) => o("toggleExpand"), ["stop"])
|
|
1229
|
+
}, null, 8, [
|
|
1230
|
+
"appearance",
|
|
1231
|
+
"variant",
|
|
1232
|
+
"size",
|
|
1233
|
+
"icon",
|
|
1234
|
+
"aria-label"
|
|
1235
|
+
])) : (F(), b("span", Gt))], 64)) : y("", !0),
|
|
1236
|
+
U(s)[`cell:${f.descriptor.key}`] ? R(a.$slots, `cell:${f.descriptor.key}`, k({
|
|
1237
|
+
key: 1,
|
|
1238
|
+
ref_for: !0
|
|
1239
|
+
}, A(f))) : f.descriptor.column ? (F(), v(Ht, {
|
|
1240
|
+
key: 2,
|
|
1241
|
+
column: f.descriptor.column,
|
|
1242
|
+
item: i.row.item
|
|
1243
|
+
}, null, 8, ["column", "item"])) : y("", !0),
|
|
1244
|
+
U(s)["cell-actions"] && !i.placeholder ? (F(), b("span", Kt, [R(a.$slots, "cell-actions", k({ ref_for: !0 }, A(f)))])) : y("", !0)
|
|
1245
|
+
], 6))], 14, Wt))), 128)),
|
|
1246
|
+
h[6] ||= x("td", {
|
|
1247
|
+
class: "s-ui-table__cell s-ui-table__filler-cell",
|
|
1248
|
+
role: "presentation"
|
|
1249
|
+
}, null, -1),
|
|
1250
|
+
(F(!0), b(g, null, L(i.trailingPlans, (e) => (F(), b("td", {
|
|
1251
|
+
id: u(e.descriptor.key),
|
|
1252
|
+
key: e.descriptor.key,
|
|
1253
|
+
class: j(e.cellClass),
|
|
1254
|
+
style: M(e.style),
|
|
1255
|
+
"aria-colindex": e.descriptor.colIndex,
|
|
1256
|
+
"data-column-key": e.descriptor.key,
|
|
1257
|
+
"data-row-key": i.row.key,
|
|
1258
|
+
"data-section": U(l),
|
|
1259
|
+
"aria-disabled": T(e),
|
|
1260
|
+
"aria-readonly": E(e),
|
|
1261
|
+
tabindex: d(e.descriptor.key)
|
|
1262
|
+
}, [e.descriptor.service === U(Ue).RIGHT_EDGE ? (F(), b(g, { key: 0 }, [i.placeholder ? y("", !0) : (F(), b("div", Jt, [R(a.$slots, "right-edge", k({ ref_for: !0 }, O()))]))], 64)) : i.placeholder ? (F(), b("div", {
|
|
1263
|
+
key: 1,
|
|
1264
|
+
class: "s-ui-table__cell-body",
|
|
1265
|
+
style: M(m(e))
|
|
1266
|
+
}, [...h[5] ||= [x("span", { class: "s-ui-table__placeholder-bar" }, null, -1)]], 4)) : (F(), b("div", {
|
|
1267
|
+
key: 2,
|
|
1268
|
+
class: j(["s-ui-table__cell-body", w(e)]),
|
|
1269
|
+
style: M(m(e))
|
|
1270
|
+
}, [U(s)[`cell:${e.descriptor.key}`] ? R(a.$slots, `cell:${e.descriptor.key}`, k({
|
|
1271
|
+
key: 0,
|
|
1272
|
+
ref_for: !0
|
|
1273
|
+
}, A(e))) : e.descriptor.column ? (F(), v(Ht, {
|
|
1274
|
+
key: 1,
|
|
1275
|
+
column: e.descriptor.column,
|
|
1276
|
+
item: i.row.item
|
|
1277
|
+
}, null, 8, ["column", "item"])) : y("", !0), U(s)["cell-actions"] && !i.placeholder ? (F(), b("span", Yt, [R(a.$slots, "cell-actions", k({ ref_for: !0 }, A(e)))])) : y("", !0)], 6))], 14, qt))), 128))
|
|
1278
|
+
], 46, Ut));
|
|
1279
|
+
}
|
|
1280
|
+
}), Zt = {
|
|
1281
|
+
class: "s-ui-table__row s-ui-table__row--skeleton",
|
|
1282
|
+
"aria-hidden": "true"
|
|
1283
|
+
}, Qt = { class: "s-ui-table__cell-body" }, $t = /* @__PURE__ */ T({
|
|
1284
|
+
__name: "STableSkeletonRow",
|
|
1285
|
+
props: {
|
|
1286
|
+
leadingPlans: {},
|
|
1287
|
+
trailingPlans: {}
|
|
1288
|
+
},
|
|
1289
|
+
setup(e) {
|
|
1290
|
+
return (t, n) => (F(), b("tr", Zt, [
|
|
1291
|
+
(F(!0), b(g, null, L(e.leadingPlans, (e) => (F(), b("td", {
|
|
1292
|
+
key: e.descriptor.key,
|
|
1293
|
+
class: j(e.cellClass),
|
|
1294
|
+
style: M(e.style)
|
|
1295
|
+
}, [e.descriptor.column ? R(t.$slots, "default", {
|
|
1296
|
+
key: 0,
|
|
1297
|
+
descriptor: e.descriptor
|
|
1298
|
+
}, () => [x("div", Qt, [w(U(K), {
|
|
1299
|
+
class: "s-ui-table__skeleton",
|
|
1300
|
+
type: e.descriptor.primary ? U(ae).S_TABLE_ROW : U(ae).S_TABLE_CELL
|
|
1301
|
+
}, null, 8, ["type"])])]) : y("", !0)], 6))), 128)),
|
|
1302
|
+
n[0] ||= x("td", {
|
|
1303
|
+
class: "s-ui-table__cell s-ui-table__filler-cell",
|
|
1304
|
+
role: "presentation"
|
|
1305
|
+
}, null, -1),
|
|
1306
|
+
(F(!0), b(g, null, L(e.trailingPlans, (e) => (F(), b("td", {
|
|
1307
|
+
key: e.descriptor.key,
|
|
1308
|
+
class: j(e.cellClass),
|
|
1309
|
+
style: M(e.style)
|
|
1310
|
+
}, null, 6))), 128))
|
|
1311
|
+
]));
|
|
1312
|
+
}
|
|
1313
|
+
}), en = "s-ui-table-column", tn = "s-ui-table-row", nn = (e, t) => e.type === "s-ui-table-column" && e.tableId === t, rn = (e, t) => e.type === "s-ui-table-row" && e.tableId === t, an = ({ tableId: e, tableRootElement: t, enabled: n, columnDescriptors: r, onReorder: i, isResizing: a }) => {
|
|
1314
|
+
let o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = z(), l = z(), u = (e) => r.value.find((t) => t.key === e), d = (e, t) => {
|
|
1315
|
+
let n = u(e), r = u(t);
|
|
1316
|
+
if (!n || !r || r.primary) return !1;
|
|
1317
|
+
let i = (e) => e.sticky ?? "regular";
|
|
1318
|
+
return i(n) === i(r);
|
|
1319
|
+
}, f = (t, r) => {
|
|
1320
|
+
if (!(r instanceof HTMLElement)) {
|
|
1321
|
+
o.forEach((e, t) => {
|
|
1322
|
+
t.isConnected || (e(), o.delete(t), s.delete(t));
|
|
1323
|
+
});
|
|
1324
|
+
return;
|
|
1325
|
+
}
|
|
1326
|
+
if (s.get(r) === t) return;
|
|
1327
|
+
o.get(r)?.(), s.set(r, t);
|
|
1328
|
+
let i = ve(ye({
|
|
1329
|
+
element: r,
|
|
1330
|
+
canDrag: () => {
|
|
1331
|
+
let e = u(t);
|
|
1332
|
+
return !!(H(n) && e?.draggable && !H(a));
|
|
1333
|
+
},
|
|
1334
|
+
getInitialData: () => ({
|
|
1335
|
+
type: en,
|
|
1336
|
+
tableId: e,
|
|
1337
|
+
columnKey: t
|
|
1338
|
+
}),
|
|
1339
|
+
onGenerateDragPreview: ({ nativeSetDragImage: e }) => {
|
|
1340
|
+
let n = u(t);
|
|
1341
|
+
xe({
|
|
1342
|
+
nativeSetDragImage: e,
|
|
1343
|
+
getOffset: Se({
|
|
1344
|
+
x: "8px",
|
|
1345
|
+
y: "8px"
|
|
1346
|
+
}),
|
|
1347
|
+
render: ({ container: e }) => {
|
|
1348
|
+
let r = document.createElement("div");
|
|
1349
|
+
r.className = "s-ui-table__column-drag-preview", r.textContent = n?.column?.title ?? t, e.appendChild(r);
|
|
1350
|
+
}
|
|
1351
|
+
});
|
|
1352
|
+
},
|
|
1353
|
+
onDragStart: () => {
|
|
1354
|
+
c.value = t;
|
|
1355
|
+
},
|
|
1356
|
+
onDrop: () => {
|
|
1357
|
+
c.value = void 0, l.value = void 0;
|
|
1358
|
+
}
|
|
1359
|
+
}), be({
|
|
1360
|
+
element: r,
|
|
1361
|
+
canDrop: ({ source: n }) => nn(n.data, e) && n.data.columnKey !== t && d(n.data.columnKey, t),
|
|
1362
|
+
getData: ({ input: e, element: n }) => Ce({ columnKey: t }, {
|
|
1363
|
+
input: e,
|
|
1364
|
+
element: n,
|
|
1365
|
+
allowedEdges: ["left", "right"]
|
|
1366
|
+
}),
|
|
1367
|
+
onDrag: ({ self: e }) => {
|
|
1368
|
+
let n = we(e.data);
|
|
1369
|
+
if (n === "left" || n === "right") {
|
|
1370
|
+
let e = l.value;
|
|
1371
|
+
(e?.targetKey !== t || e.edge !== n) && (l.value = {
|
|
1372
|
+
targetKey: t,
|
|
1373
|
+
edge: n
|
|
1374
|
+
});
|
|
1375
|
+
}
|
|
1376
|
+
},
|
|
1377
|
+
onDragLeave: () => {
|
|
1378
|
+
l.value?.targetKey === t && (l.value = void 0);
|
|
1379
|
+
}
|
|
1380
|
+
}));
|
|
1381
|
+
o.set(r, i);
|
|
1382
|
+
}, p = q({
|
|
1383
|
+
canMonitor: ({ source: t }) => nn(t.data, e),
|
|
1384
|
+
onDrop: ({ source: t, location: n }) => {
|
|
1385
|
+
c.value = void 0, l.value = void 0;
|
|
1386
|
+
let r = n.current.dropTargets[0];
|
|
1387
|
+
if (!r || !nn(t.data, e)) return;
|
|
1388
|
+
let a = r.data, o = a.columnKey, s = we(a);
|
|
1389
|
+
typeof o != "string" || s !== "left" && s !== "right" || o !== t.data.columnKey && i(t.data.columnKey, o, s);
|
|
1390
|
+
}
|
|
1391
|
+
});
|
|
1392
|
+
N(() => {
|
|
1393
|
+
p(), o.forEach((e) => {
|
|
1394
|
+
e();
|
|
1395
|
+
}), o.clear(), s.clear();
|
|
1396
|
+
});
|
|
1397
|
+
let m = z();
|
|
1398
|
+
return W(l, (e) => {
|
|
1399
|
+
let n = t.value, r = e ? n?.querySelector(`th[data-column-key="${e.targetKey}"]`) : void 0;
|
|
1400
|
+
if (!e || !n || !r) {
|
|
1401
|
+
m.value = void 0;
|
|
1402
|
+
return;
|
|
1403
|
+
}
|
|
1404
|
+
let i = n.getBoundingClientRect(), a = r.getBoundingClientRect(), o = e.edge === "left" ? a.left : a.right;
|
|
1405
|
+
m.value = { left: `${Math.round(o - i.left - 1)}px` };
|
|
1406
|
+
}), {
|
|
1407
|
+
registerColumnHeaderElement: f,
|
|
1408
|
+
draggingColumnKey: c,
|
|
1409
|
+
dropIndicator: l,
|
|
1410
|
+
dropLineStyle: m
|
|
1411
|
+
};
|
|
1412
|
+
}, on = {
|
|
1413
|
+
[De.LEFT]: "s-ui-table__cell--align-left",
|
|
1414
|
+
[De.CENTER]: "s-ui-table__cell--align-center",
|
|
1415
|
+
[De.RIGHT]: "s-ui-table__cell--align-right"
|
|
1416
|
+
}, sn = ({ columnDescriptors: e, hasTreeStructure: t, expandColumnKey: n, primaryColumnKey: r }) => {
|
|
1417
|
+
let i = _(() => e.value.filter((e) => e.sticky !== J.RIGHT)), a = _(() => e.value.filter((e) => e.sticky === J.RIGHT)), o = _(() => {
|
|
1418
|
+
let e = (e) => ({
|
|
1419
|
+
key: e.key,
|
|
1420
|
+
descriptor: e
|
|
1421
|
+
});
|
|
1422
|
+
return [
|
|
1423
|
+
...i.value.map(e),
|
|
1424
|
+
{
|
|
1425
|
+
key: ze,
|
|
1426
|
+
descriptor: void 0
|
|
1427
|
+
},
|
|
1428
|
+
...a.value.map(e)
|
|
1429
|
+
];
|
|
1430
|
+
}), s = (e) => {
|
|
1431
|
+
if (!e.sticky || !e.stickyOffsetVar || !e.liveStickyOffsetVar) return;
|
|
1432
|
+
let t = `var(${e.liveStickyOffsetVar}, var(${e.stickyOffsetVar}))`;
|
|
1433
|
+
return e.sticky === J.LEFT ? { left: t } : { right: t };
|
|
1434
|
+
}, c = (e) => {
|
|
1435
|
+
let t = e.service ? We[e.service] : void 0;
|
|
1436
|
+
return {
|
|
1437
|
+
"s-ui-table__cell--sticky-left": e.sticky === J.LEFT,
|
|
1438
|
+
"s-ui-table__cell--sticky-right": e.sticky === J.RIGHT,
|
|
1439
|
+
"s-ui-table__cell--last-sticky-left": e.lastStickyLeft,
|
|
1440
|
+
"s-ui-table__cell--first-sticky-right": e.firstStickyRight,
|
|
1441
|
+
"s-ui-table__cell--primary": e.primary,
|
|
1442
|
+
[`s-ui-table__cell--service-${t}`]: !!t,
|
|
1443
|
+
[on[e.align]]: !!e.column
|
|
1444
|
+
};
|
|
1445
|
+
}, l = (e) => {
|
|
1446
|
+
if (!H(t) || !e.column) return !1;
|
|
1447
|
+
let i = H(n);
|
|
1448
|
+
return e.key === (i ?? H(r));
|
|
1449
|
+
}, u = (e) => {
|
|
1450
|
+
let t = ["s-ui-table__cell"];
|
|
1451
|
+
return Object.entries(c(e)).forEach(([e, n]) => {
|
|
1452
|
+
n && t.push(e);
|
|
1453
|
+
}), {
|
|
1454
|
+
descriptor: e,
|
|
1455
|
+
cellClass: t.join(" "),
|
|
1456
|
+
style: s(e),
|
|
1457
|
+
chevron: l(e)
|
|
1458
|
+
};
|
|
1459
|
+
}, d = _(() => i.value.map(u)), f = _(() => a.value.map(u));
|
|
1460
|
+
return {
|
|
1461
|
+
leadingDescriptors: i,
|
|
1462
|
+
trailingDescriptors: a,
|
|
1463
|
+
headerCells: o,
|
|
1464
|
+
getStickyCellStyle: s,
|
|
1465
|
+
getHeaderCellClasses: c,
|
|
1466
|
+
leadingCellPlans: d,
|
|
1467
|
+
trailingCellPlans: f,
|
|
1468
|
+
rowCellPlans: _(() => {
|
|
1469
|
+
let e = (e) => ({
|
|
1470
|
+
key: e.descriptor.key,
|
|
1471
|
+
cellPlan: e
|
|
1472
|
+
});
|
|
1473
|
+
return [
|
|
1474
|
+
...d.value.map(e),
|
|
1475
|
+
{
|
|
1476
|
+
key: ze,
|
|
1477
|
+
cellPlan: void 0
|
|
1478
|
+
},
|
|
1479
|
+
...f.value.map(e)
|
|
1480
|
+
];
|
|
1481
|
+
})
|
|
1482
|
+
};
|
|
1483
|
+
}, cn = ({ tableRootElement: e, scrollElement: t, columnDescriptors: n, columnWidths: r, enabled: i, onResizeEnd: a, remeasureRows: o }) => {
|
|
1484
|
+
let s = I(), c = _(() => s.value?.columnKey), l = (e, t) => {
|
|
1485
|
+
let n = Math.max(e.minWidth, t);
|
|
1486
|
+
return e.maxWidth ? Math.min(e.maxWidth, n) : n;
|
|
1487
|
+
}, u = (t, r) => {
|
|
1488
|
+
let i = e.value;
|
|
1489
|
+
if (!i) return;
|
|
1490
|
+
let a = (e) => e.key === t ? r : e.width, o = n.value, s = o.find((e) => e.key === t);
|
|
1491
|
+
s && i.style.setProperty(s.liveWidthVar, `${r}px`);
|
|
1492
|
+
let c = 0;
|
|
1493
|
+
o.forEach((e) => {
|
|
1494
|
+
e.sticky === J.LEFT && e.liveStickyOffsetVar && (i.style.setProperty(e.liveStickyOffsetVar, `${c}px`), c += a(e));
|
|
1495
|
+
});
|
|
1496
|
+
let l = 0;
|
|
1497
|
+
[...o].reverse().forEach((e) => {
|
|
1498
|
+
e.sticky === J.RIGHT && e.liveStickyOffsetVar && (i.style.setProperty(e.liveStickyOffsetVar, `${l}px`), l += a(e));
|
|
1499
|
+
});
|
|
1500
|
+
}, d = () => {
|
|
1501
|
+
let t = e.value;
|
|
1502
|
+
t && n.value.forEach((e) => {
|
|
1503
|
+
t.style.removeProperty(e.liveWidthVar), e.liveStickyOffsetVar && t.style.removeProperty(e.liveStickyOffsetVar);
|
|
1504
|
+
});
|
|
1505
|
+
}, f = (e, t) => {
|
|
1506
|
+
r.value = {
|
|
1507
|
+
...r.value,
|
|
1508
|
+
[e]: t
|
|
1509
|
+
}, a(e, t), o();
|
|
1510
|
+
}, p = (e) => {
|
|
1511
|
+
let t = s.value;
|
|
1512
|
+
t && (s.value = void 0, e && f(t.columnKey, t.liveWidth), d());
|
|
1513
|
+
};
|
|
1514
|
+
return de("pointermove", (e) => {
|
|
1515
|
+
let t = s.value;
|
|
1516
|
+
if (!t || e.pointerId !== t.pointerId) return;
|
|
1517
|
+
let r = n.value.find((e) => e.key === t.columnKey);
|
|
1518
|
+
if (!r) return;
|
|
1519
|
+
let i = l(r, t.startWidth + (e.clientX - t.startClientX));
|
|
1520
|
+
i !== t.liveWidth && (t.liveWidth = i, u(t.columnKey, i));
|
|
1521
|
+
}), de("pointerup", (e) => {
|
|
1522
|
+
s.value && e.pointerId === s.value.pointerId && p(!0);
|
|
1523
|
+
}), de("pointercancel", () => {
|
|
1524
|
+
p(!1);
|
|
1525
|
+
}), de("blur", () => {
|
|
1526
|
+
p(!1);
|
|
1527
|
+
}), de("keydown", (e) => {
|
|
1528
|
+
s.value && e.key === "Escape" && (e.preventDefault(), p(!1));
|
|
1529
|
+
}), {
|
|
1530
|
+
resizingColumnKey: c,
|
|
1531
|
+
handleResizeHandlePointerdown: (e, t) => {
|
|
1532
|
+
if (!H(i)) return;
|
|
1533
|
+
let r = n.value.find((e) => e.key === t);
|
|
1534
|
+
r?.resizable && (e.preventDefault(), e.stopPropagation(), e.isTrusted && e.target instanceof Element && e.target.setPointerCapture(e.pointerId), s.value = {
|
|
1535
|
+
columnKey: t,
|
|
1536
|
+
startClientX: e.clientX,
|
|
1537
|
+
startWidth: r.width,
|
|
1538
|
+
liveWidth: r.width,
|
|
1539
|
+
pointerId: e.pointerId
|
|
1540
|
+
});
|
|
1541
|
+
},
|
|
1542
|
+
handleResizeHandleKeydown: (e, t) => {
|
|
1543
|
+
if (!H(i) || e.key !== "ArrowLeft" && e.key !== "ArrowRight") return;
|
|
1544
|
+
let r = n.value.find((e) => e.key === t);
|
|
1545
|
+
if (!r?.resizable) return;
|
|
1546
|
+
e.preventDefault();
|
|
1547
|
+
let a = e.shiftKey ? 1 : 8, o = e.key === "ArrowRight" ? 1 : -1, s = l(r, r.width + o * a);
|
|
1548
|
+
s !== r.width && f(t, s);
|
|
1549
|
+
},
|
|
1550
|
+
handleResizeHandleDblclick: (e) => {
|
|
1551
|
+
if (!H(i)) return;
|
|
1552
|
+
let r = n.value.find((t) => t.key === e), a = t.value;
|
|
1553
|
+
if (!r?.resizable || !a) return;
|
|
1554
|
+
let o = r.minWidth;
|
|
1555
|
+
a.querySelectorAll(`td[data-column-key="${e}"] .s-ui-table__cell-body`).forEach((e) => {
|
|
1556
|
+
e instanceof HTMLElement && (o = Math.max(o, e.scrollWidth + 8));
|
|
1557
|
+
});
|
|
1558
|
+
let s = l(r, Math.min(640, o));
|
|
1559
|
+
s !== r.width && f(e, s);
|
|
1560
|
+
}
|
|
1561
|
+
};
|
|
1562
|
+
}, ln = ({ gridFocus: e, columnDescriptors: t, flatRows: n, expandColumnKey: r, primaryColumnKey: i, groupColumnKey: a, selectable: o, openMenuColumnKey: s, toggleExpanded: c, toggleRowSelected: l, applySortCycle: u, setColumnMenuOpen: f, resizeColumnByKeyboard: p, onDepthFooterActivate: m, onLoadMoreActivate: h, onRowActivate: g }) => {
|
|
1563
|
+
let _ = () => {
|
|
1564
|
+
let n = e.focusAddress.value.columnKey;
|
|
1565
|
+
return t.value.find((e) => e.key === n);
|
|
1566
|
+
}, v = () => {
|
|
1567
|
+
let t = e.focusBodyRowIndex.value;
|
|
1568
|
+
return t === void 0 ? void 0 : n.value[t];
|
|
1569
|
+
}, y = (e) => e.kind === Q.GROUP ? H(a) : H(r) ?? H(i), b = (t) => {
|
|
1570
|
+
let n = t.target;
|
|
1571
|
+
if (!(n instanceof HTMLElement)) return;
|
|
1572
|
+
let r = n.closest("[data-section]");
|
|
1573
|
+
if (!(r instanceof HTMLElement)) return;
|
|
1574
|
+
let i = st(r.dataset.section ?? null), a = r.dataset.columnKey;
|
|
1575
|
+
!i || !a || e.syncFocusAddress({
|
|
1576
|
+
section: i,
|
|
1577
|
+
rowKey: r.dataset.rowKey,
|
|
1578
|
+
columnKey: a
|
|
1579
|
+
}, r !== n);
|
|
1580
|
+
}, x = (t) => {
|
|
1581
|
+
let r = e.focusAddress.value;
|
|
1582
|
+
if (r.section !== $.BODY || !r.rowKey) return !1;
|
|
1583
|
+
let i = v();
|
|
1584
|
+
if (!i || i.kind === Q.DEPTH_FOOTER || r.columnKey !== y(i)) return !1;
|
|
1585
|
+
let a = d(t, i.key, n.value);
|
|
1586
|
+
return a ? a.type === "select" ? (e.focusAddressNow({
|
|
1587
|
+
section: $.BODY,
|
|
1588
|
+
rowKey: a.rowKey,
|
|
1589
|
+
columnKey: r.columnKey
|
|
1590
|
+
}), !0) : (c(a.rowKey), !0) : !1;
|
|
1591
|
+
}, S = (t) => {
|
|
1592
|
+
let n = e.focusAddress.value;
|
|
1593
|
+
if (n.section === $.HEADER) {
|
|
1594
|
+
let n = _();
|
|
1595
|
+
if (n?.sortable) {
|
|
1596
|
+
u(n.key, t.shiftKey || t.ctrlKey || t.metaKey);
|
|
1597
|
+
return;
|
|
1598
|
+
}
|
|
1599
|
+
e.enterCell();
|
|
1600
|
+
return;
|
|
1601
|
+
}
|
|
1602
|
+
let r = v();
|
|
1603
|
+
if (!r) {
|
|
1604
|
+
e.enterCell();
|
|
1605
|
+
return;
|
|
1606
|
+
}
|
|
1607
|
+
if (r.kind === Q.DEPTH_FOOTER) {
|
|
1608
|
+
m(r);
|
|
1609
|
+
return;
|
|
1610
|
+
}
|
|
1611
|
+
if (r.kind === Q.LOAD_MORE) {
|
|
1612
|
+
h(r);
|
|
1613
|
+
return;
|
|
1614
|
+
}
|
|
1615
|
+
if ((r.hasChildren || r.kind === Q.GROUP) && n.columnKey === y(r)) {
|
|
1616
|
+
c(r.key);
|
|
1617
|
+
return;
|
|
1618
|
+
}
|
|
1619
|
+
e.enterCell() || g(r, t);
|
|
1620
|
+
}, C = (t) => {
|
|
1621
|
+
if (t.key === "Escape") {
|
|
1622
|
+
t.preventDefault(), e.exitCell();
|
|
1623
|
+
return;
|
|
1624
|
+
}
|
|
1625
|
+
t.key === "Tab" && (t.preventDefault(), e.cycleCellFocus(t.shiftKey ? -1 : 1));
|
|
1626
|
+
}, w = (t) => {
|
|
1627
|
+
let n = _();
|
|
1628
|
+
if (!n) return !1;
|
|
1629
|
+
let r = t.key === "ArrowLeft" || t.key === "ArrowRight";
|
|
1630
|
+
if (t.altKey && t.shiftKey && r) return t.preventDefault(), p(n, t.key === "ArrowRight" ? 1 : -1), !0;
|
|
1631
|
+
let i = t.altKey && t.key === "ArrowDown" || t.key === "ContextMenu", a = e.focusAddress.value.section === $.HEADER;
|
|
1632
|
+
return n.column && a && i ? (t.preventDefault(), f(n.key, H(s) !== n.key), !0) : !1;
|
|
1633
|
+
};
|
|
1634
|
+
return {
|
|
1635
|
+
handleGridFocusIn: b,
|
|
1636
|
+
handleGridKeydown: (t) => {
|
|
1637
|
+
if (e.cellEntered.value) {
|
|
1638
|
+
C(t);
|
|
1639
|
+
return;
|
|
1640
|
+
}
|
|
1641
|
+
if (!w(t)) switch (t.key) {
|
|
1642
|
+
case "ArrowRight":
|
|
1643
|
+
t.preventDefault(), x("ArrowRight") || e.moveFocus(0, 1);
|
|
1644
|
+
break;
|
|
1645
|
+
case "ArrowLeft":
|
|
1646
|
+
t.preventDefault(), x("ArrowLeft") || e.moveFocus(0, -1);
|
|
1647
|
+
break;
|
|
1648
|
+
case "ArrowDown":
|
|
1649
|
+
t.preventDefault(), e.moveFocus(1, 0);
|
|
1650
|
+
break;
|
|
1651
|
+
case "ArrowUp":
|
|
1652
|
+
t.preventDefault(), e.moveFocus(-1, 0);
|
|
1653
|
+
break;
|
|
1654
|
+
case "Home":
|
|
1655
|
+
t.preventDefault(), t.ctrlKey || t.metaKey ? e.moveToGridEdge("first") : e.moveToRowEdge("start");
|
|
1656
|
+
break;
|
|
1657
|
+
case "End":
|
|
1658
|
+
t.preventDefault(), t.ctrlKey || t.metaKey ? e.moveToGridEdge("last") : e.moveToRowEdge("end");
|
|
1659
|
+
break;
|
|
1660
|
+
case "PageDown":
|
|
1661
|
+
t.preventDefault(), e.moveByPage(1);
|
|
1662
|
+
break;
|
|
1663
|
+
case "PageUp":
|
|
1664
|
+
t.preventDefault(), e.moveByPage(-1);
|
|
1665
|
+
break;
|
|
1666
|
+
case "F2":
|
|
1667
|
+
t.preventDefault(), e.enterCell();
|
|
1668
|
+
break;
|
|
1669
|
+
case "Enter":
|
|
1670
|
+
t.preventDefault(), S(t);
|
|
1671
|
+
break;
|
|
1672
|
+
case " ":
|
|
1673
|
+
case "Spacebar": {
|
|
1674
|
+
t.preventDefault();
|
|
1675
|
+
let n = e.focusedBodyRowKey.value;
|
|
1676
|
+
if (!H(o) || !n) break;
|
|
1677
|
+
l(n);
|
|
1678
|
+
break;
|
|
1679
|
+
}
|
|
1680
|
+
default: break;
|
|
1681
|
+
}
|
|
1682
|
+
}
|
|
1683
|
+
};
|
|
1684
|
+
}, un = ({ tableId: e, enabled: t, dragMode: n, snapshot: r, scrollElement: i, isRowDraggable: a, dragExpandDelayMs: o, isExpanded: s, onHoverExpand: c, onReorder: l, onTreeDrop: u, resolveRowPreviewTitle: d }) => {
|
|
1685
|
+
let f = /* @__PURE__ */ new Map(), p = z(), m = z(), h = (e) => {
|
|
1686
|
+
if (!(e instanceof HTMLElement)) return;
|
|
1687
|
+
let t = Number(e.dataset.index);
|
|
1688
|
+
if (Number.isInteger(t)) return r.value.flatRows[t];
|
|
1689
|
+
}, g = (e) => {
|
|
1690
|
+
if (!e || !H(t) || e.kind !== Q.ROW && e.kind !== Q.GROUP) return !1;
|
|
1691
|
+
let n = H(a);
|
|
1692
|
+
return n ? n(e.item) !== !1 : !0;
|
|
1693
|
+
}, _ = (e, t) => {
|
|
1694
|
+
let { getSubtreeRangeByKey: n, getRowIndexByKey: i } = r.value, a = n(e), o = i(t);
|
|
1695
|
+
return !a || o === void 0 ? !1 : o >= a[0] && o <= a[1];
|
|
1696
|
+
}, v = me(() => {
|
|
1697
|
+
let e = y.value;
|
|
1698
|
+
e && !s(e) && c(e);
|
|
1699
|
+
}, () => H(o) ?? 500, { immediate: !1 }), y = z(), b = me(() => {
|
|
1700
|
+
S.value = x.value;
|
|
1701
|
+
}, Re, { immediate: !1 }), x = z(), S = z(), C = (e) => {
|
|
1702
|
+
!(e.hasChildren || e.kind === Q.GROUP) || e.expanded || y.value !== e.key && (y.value = e.key, v.stop(), v.start());
|
|
1703
|
+
}, w = () => {
|
|
1704
|
+
v.stop(), y.value = void 0, b.stop(), x.value = void 0, S.value = void 0;
|
|
1705
|
+
}, T = (e, t, r, i) => {
|
|
1706
|
+
if (H(n) === Ae.TREE) {
|
|
1707
|
+
let n = t.getBoundingClientRect(), i = Le * n.height / 2;
|
|
1708
|
+
if (Math.abs(r - (n.top + n.height / 2)) <= i) {
|
|
1709
|
+
if (e.kind === Q.GROUP || S.value === e.key) return je.CHILD;
|
|
1710
|
+
x.value !== e.key && (x.value = e.key, b.stop(), b.start());
|
|
1711
|
+
} else x.value === e.key && (b.stop(), x.value = void 0, S.value = void 0);
|
|
1712
|
+
}
|
|
1713
|
+
return i === "top" ? je.BEFORE : je.AFTER;
|
|
1714
|
+
}, E, D = (e) => {
|
|
1715
|
+
[e, ...e.querySelectorAll("[id], [tabindex]")].forEach((e) => {
|
|
1716
|
+
e.removeAttribute("id"), e.removeAttribute("tabindex");
|
|
1717
|
+
});
|
|
1718
|
+
}, O = (e) => {
|
|
1719
|
+
let t = e.querySelector(".s-ui-table__cell--primary .s-ui-table__cell-body, .s-ui-table__cell--primary .s-ui-table__group-content"), n = t?.closest("td");
|
|
1720
|
+
return t && n ? {
|
|
1721
|
+
content: t,
|
|
1722
|
+
cell: n
|
|
1723
|
+
} : void 0;
|
|
1724
|
+
}, k = (e, t) => {
|
|
1725
|
+
let n = document.createElement("div");
|
|
1726
|
+
n.className = "s-ui-table__row-drag-preview", n.setAttribute("aria-hidden", "true");
|
|
1727
|
+
let r = O(e);
|
|
1728
|
+
if (!r) return n.textContent = t ? d(t) : "", n;
|
|
1729
|
+
let i = r.content.cloneNode(!0);
|
|
1730
|
+
return i instanceof Element && D(i), n.style.inlineSize = `${Math.round(r.cell.getBoundingClientRect().width)}px`, n.appendChild(i), n;
|
|
1731
|
+
}, A = (e, t) => {
|
|
1732
|
+
E && (E.style.transform = `translate(${e + 8}px, ${t + 8}px)`);
|
|
1733
|
+
}, j = (e) => {
|
|
1734
|
+
A(e.clientX, e.clientY);
|
|
1735
|
+
}, M = (e, t, n) => {
|
|
1736
|
+
P(), E = document.createElement("div"), E.className = "s-ui-table__row-drag-layer", E.appendChild(e), document.body.appendChild(E), document.addEventListener("dragover", j), A(t, n);
|
|
1737
|
+
}, P = () => {
|
|
1738
|
+
document.removeEventListener("dragover", j), E?.remove(), E = void 0;
|
|
1739
|
+
}, F = (t) => {
|
|
1740
|
+
if (!(t instanceof HTMLElement)) {
|
|
1741
|
+
f.forEach((e, t) => {
|
|
1742
|
+
t.isConnected || (e(), f.delete(t));
|
|
1743
|
+
});
|
|
1744
|
+
return;
|
|
1745
|
+
}
|
|
1746
|
+
if (f.has(t)) return;
|
|
1747
|
+
let n = ve(ye({
|
|
1748
|
+
element: t,
|
|
1749
|
+
canDrag: () => g(h(t)),
|
|
1750
|
+
getInitialData: () => {
|
|
1751
|
+
let n = h(t);
|
|
1752
|
+
return {
|
|
1753
|
+
type: tn,
|
|
1754
|
+
tableId: e,
|
|
1755
|
+
rowKey: n?.key ?? "",
|
|
1756
|
+
rowIndex: n?.index ?? -1
|
|
1757
|
+
};
|
|
1758
|
+
},
|
|
1759
|
+
onGenerateDragPreview: ({ nativeSetDragImage: e, location: n }) => {
|
|
1760
|
+
let r = k(t, h(t)), { clientX: i, clientY: a } = n.current.input;
|
|
1761
|
+
Te({ nativeSetDragImage: e }), M(r, i, a);
|
|
1762
|
+
},
|
|
1763
|
+
onDragStart: () => {
|
|
1764
|
+
p.value = h(t)?.key;
|
|
1765
|
+
},
|
|
1766
|
+
onDrop: () => {
|
|
1767
|
+
p.value = void 0, m.value = void 0, w(), P();
|
|
1768
|
+
}
|
|
1769
|
+
}), be({
|
|
1770
|
+
element: t,
|
|
1771
|
+
canDrop: ({ source: n }) => {
|
|
1772
|
+
if (!rn(n.data, e)) return !1;
|
|
1773
|
+
let r = h(t);
|
|
1774
|
+
return !r || r.key === n.data.rowKey ? !1 : !_(n.data.rowKey, r.key);
|
|
1775
|
+
},
|
|
1776
|
+
getData: ({ input: e, element: t }) => Ce({ rowKey: h(t)?.key ?? "" }, {
|
|
1777
|
+
input: e,
|
|
1778
|
+
element: t,
|
|
1779
|
+
allowedEdges: ["top", "bottom"]
|
|
1780
|
+
}),
|
|
1781
|
+
onDrag: ({ self: e, location: n }) => {
|
|
1782
|
+
let r = h(t);
|
|
1783
|
+
if (!r) return;
|
|
1784
|
+
C(r);
|
|
1785
|
+
let i = we(e.data), a = i === "top" || i === "bottom" ? i : null, o = T(r, t, n.current.input.clientY, a), s = o === je.CHILD ? r.depth + 1 : r.depth, c = m.value;
|
|
1786
|
+
(c?.targetKey !== r.key || c.action !== o || c.depth !== s) && (m.value = {
|
|
1787
|
+
targetKey: r.key,
|
|
1788
|
+
action: o,
|
|
1789
|
+
depth: s
|
|
1790
|
+
});
|
|
1791
|
+
},
|
|
1792
|
+
onDragLeave: () => {
|
|
1793
|
+
let e = h(t);
|
|
1794
|
+
m.value?.targetKey === e?.key && (m.value = void 0), y.value === e?.key && (v.stop(), y.value = void 0);
|
|
1795
|
+
}
|
|
1796
|
+
}));
|
|
1797
|
+
f.set(t, n);
|
|
1798
|
+
}, I = q({
|
|
1799
|
+
canMonitor: ({ source: t }) => rn(t.data, e),
|
|
1800
|
+
onDrop: ({ source: t, location: i }) => {
|
|
1801
|
+
let a = m.value;
|
|
1802
|
+
if (p.value = void 0, m.value = void 0, w(), !i.current.dropTargets[0] || !a || !rn(t.data, e)) return;
|
|
1803
|
+
let { flatRows: o, getRowIndexByKey: s } = r.value, c = s(t.data.rowKey), d = s(a.targetKey), f = c === void 0 ? void 0 : o[c], h = d === void 0 ? void 0 : o[d];
|
|
1804
|
+
if (!f || !h || f.key === h.key || _(f.key, h.key)) return;
|
|
1805
|
+
if (H(n) === Ae.FLAT) {
|
|
1806
|
+
if (a.action === je.CHILD) return;
|
|
1807
|
+
l({
|
|
1808
|
+
action: a.action,
|
|
1809
|
+
sourceKey: f.key,
|
|
1810
|
+
sourceItem: f.item,
|
|
1811
|
+
targetKey: h.key,
|
|
1812
|
+
targetItem: h.item,
|
|
1813
|
+
sourceIndex: f.index,
|
|
1814
|
+
targetIndex: h.index
|
|
1815
|
+
});
|
|
1816
|
+
return;
|
|
1817
|
+
}
|
|
1818
|
+
let g = a.action === je.CHILD, v = g ? h.key : h.parentKey, y = v === void 0 ? void 0 : s(v), b = y === void 0 ? void 0 : o[y];
|
|
1819
|
+
u({
|
|
1820
|
+
action: a.action,
|
|
1821
|
+
sourceKey: f.key,
|
|
1822
|
+
sourceItem: f.item,
|
|
1823
|
+
targetKey: h.key,
|
|
1824
|
+
targetItem: h.item,
|
|
1825
|
+
parentKey: v,
|
|
1826
|
+
parentItem: b?.item,
|
|
1827
|
+
depth: g ? h.depth + 1 : h.depth
|
|
1828
|
+
});
|
|
1829
|
+
}
|
|
1830
|
+
}), L;
|
|
1831
|
+
return W(i, (t) => {
|
|
1832
|
+
L?.(), L = void 0, t && (L = Ee({
|
|
1833
|
+
element: t,
|
|
1834
|
+
canScroll: ({ source: t }) => rn(t.data, e)
|
|
1835
|
+
}));
|
|
1836
|
+
}, { immediate: !0 }), N(() => {
|
|
1837
|
+
I(), L?.(), P(), f.forEach((e) => {
|
|
1838
|
+
e();
|
|
1839
|
+
}), f.clear();
|
|
1840
|
+
}), {
|
|
1841
|
+
registerRowElement: F,
|
|
1842
|
+
draggingRowKey: p,
|
|
1843
|
+
dropIndicator: m
|
|
1844
|
+
};
|
|
1845
|
+
}, dn = ({ flatRows: e, virtualEnabled: t, windowIndexes: n, uiTotalSize: r, getRowUiOffset: i, activeGroupRowIndex: a, activeDepthFooterRowIndexes: o, leavingDepthFooterRowIndex: s, slidingDepthFooterRowIndexes: c, farDepthFooterRowIndexes: l, activeRowIndex: u }) => {
|
|
1846
|
+
let d = _(() => {
|
|
1847
|
+
let e = [];
|
|
1848
|
+
return a.value !== void 0 && e.push(a.value), e.push(...o.value), u.value !== void 0 && e.push(u.value), e;
|
|
1849
|
+
});
|
|
1850
|
+
return { renderEntries: _(() => {
|
|
1851
|
+
let u = e.value, f = a.value, p = new Set(o.value), m = new Set(c.value), h = new Set(l.value), g = s.value, _ = g === void 0 ? void 0 : i(g), v = _ ? _.end - _.start : void 0, y = [], b = (e, t, n) => e && !t && !n ? v : void 0, x = (e) => {
|
|
1852
|
+
let t = i(e.index), n = p.has(e.index), r = e.index === g, a = m.has(e.index);
|
|
1853
|
+
y.push({
|
|
1854
|
+
row: e,
|
|
1855
|
+
renderKey: e.key,
|
|
1856
|
+
stuckTop: e.index === f,
|
|
1857
|
+
stuckBottom: n,
|
|
1858
|
+
stuckBottomLeaving: r,
|
|
1859
|
+
stuckBottomSliding: a,
|
|
1860
|
+
stuckBottomCoverHeight: b(n, r, a),
|
|
1861
|
+
stuckBottomFar: h.has(e.index),
|
|
1862
|
+
rowHeight: t ? t.end - t.start : void 0
|
|
1863
|
+
});
|
|
1864
|
+
};
|
|
1865
|
+
if (!H(t)) return u.forEach(x), y;
|
|
1866
|
+
let S = r.value, C = n.value.filter((e) => {
|
|
1867
|
+
let t = i(e);
|
|
1868
|
+
return !t || t.end > 0 && t.start < S;
|
|
1869
|
+
}), w = C[0], T = C[C.length - 1], E = /* @__PURE__ */ new Set();
|
|
1870
|
+
d.value.forEach((e) => {
|
|
1871
|
+
u[e] && E.add(e);
|
|
1872
|
+
});
|
|
1873
|
+
let D = [];
|
|
1874
|
+
w !== void 0 && T !== void 0 && D.push({
|
|
1875
|
+
startIndex: w,
|
|
1876
|
+
endIndex: T
|
|
1877
|
+
}), E.forEach((e) => {
|
|
1878
|
+
w !== void 0 && T !== void 0 && e >= w && e <= T || D.push({
|
|
1879
|
+
startIndex: e,
|
|
1880
|
+
endIndex: e
|
|
1881
|
+
});
|
|
1882
|
+
}), D.sort((e, t) => e.startIndex - t.startIndex);
|
|
1883
|
+
let O = 0, k = 0, A = (e) => {
|
|
1884
|
+
y.push({
|
|
1885
|
+
renderKey: `spacer-${O}`,
|
|
1886
|
+
spacer: !0,
|
|
1887
|
+
spacerHeight: Math.max(0, Math.round(e))
|
|
1888
|
+
}), O += 1;
|
|
1889
|
+
}, j = (e) => {
|
|
1890
|
+
let t = i(e.startIndex), n = i(e.endIndex);
|
|
1891
|
+
return !t || !n ? {
|
|
1892
|
+
start: k,
|
|
1893
|
+
height: 0
|
|
1894
|
+
} : {
|
|
1895
|
+
start: t.start,
|
|
1896
|
+
height: n.end - t.start
|
|
1897
|
+
};
|
|
1898
|
+
};
|
|
1899
|
+
return D.forEach((e) => {
|
|
1900
|
+
let { start: t, height: n } = j(e), r = Math.min(S, Math.max(k, t));
|
|
1901
|
+
A(r - k);
|
|
1902
|
+
for (let t = e.startIndex; t <= e.endIndex; t += 1) {
|
|
1903
|
+
let e = u[t];
|
|
1904
|
+
e && x(e);
|
|
1905
|
+
}
|
|
1906
|
+
k = r + n;
|
|
1907
|
+
}), A(S - k), y;
|
|
1908
|
+
}) };
|
|
1909
|
+
}, fn = ({ selected: e, cascade: t, treeIndex: n, groupRow: r, disabledKey: i, isItemSelectable: a }) => {
|
|
1910
|
+
let o = _(() => new Set(e.value)), s = (e) => n.value.nodeByKey.get(e)?.parentKey, c = (e) => {
|
|
1911
|
+
let t = n.value.nodeByKey.get(e);
|
|
1912
|
+
if (!t || Ft(t.item, H(r)) || Ft(t.item, H(i))) return !1;
|
|
1913
|
+
let o = H(a);
|
|
1914
|
+
return o ? o(t.item) !== !1 : !0;
|
|
1915
|
+
}, l = _(() => {
|
|
1916
|
+
let e = [];
|
|
1917
|
+
return n.value.nodeByKey.forEach((t, n) => {
|
|
1918
|
+
c(n) && e.push(n);
|
|
1919
|
+
}), D(e);
|
|
1920
|
+
}), u = _(() => {
|
|
1921
|
+
let e = /* @__PURE__ */ new Map();
|
|
1922
|
+
return o.value.forEach((t) => {
|
|
1923
|
+
let n = s(t);
|
|
1924
|
+
for (; n;) e.set(n, (e.get(n) ?? 0) + 1), n = s(n);
|
|
1925
|
+
}), D(e);
|
|
1926
|
+
}), d = (e) => o.value.has(e), f = (e) => o.value.has(e) ? Z.CHECKED : (u.value.get(e) ?? 0) > 0 ? Z.INDETERMINATE : Z.UNCHECKED, p = (e, t) => {
|
|
1927
|
+
c(e) && t.push(e), n.value.nodeByKey.get(e)?.children?.forEach((e) => {
|
|
1928
|
+
p(e.key, t);
|
|
1929
|
+
});
|
|
1930
|
+
}, m = (e, t) => {
|
|
1931
|
+
let r = n.value.nodeByKey.get(e)?.children;
|
|
1932
|
+
return !r || r.length === 0 ? !1 : r.every((e) => c(e.key) ? t.has(e.key) : m(e.key, t));
|
|
1933
|
+
}, h = (e, t) => {
|
|
1934
|
+
let n = s(e);
|
|
1935
|
+
for (; n;) {
|
|
1936
|
+
if (c(n) && m(n, t)) t.add(n);
|
|
1937
|
+
else if (c(n)) break;
|
|
1938
|
+
n = s(n);
|
|
1939
|
+
}
|
|
1940
|
+
}, g = (e, t) => {
|
|
1941
|
+
let n = s(e);
|
|
1942
|
+
for (; n;) t.delete(n), n = s(n);
|
|
1943
|
+
}, v = (n) => {
|
|
1944
|
+
if (!c(n)) return;
|
|
1945
|
+
let r = new Set(e.value);
|
|
1946
|
+
if (!H(t)) {
|
|
1947
|
+
r.has(n) ? r.delete(n) : r.add(n), e.value = [...r];
|
|
1948
|
+
return;
|
|
1949
|
+
}
|
|
1950
|
+
let i = [];
|
|
1951
|
+
p(n, i), f(n) === Z.UNCHECKED ? (i.forEach((e) => {
|
|
1952
|
+
r.add(e);
|
|
1953
|
+
}), h(n, r)) : (i.forEach((e) => {
|
|
1954
|
+
r.delete(e);
|
|
1955
|
+
}), g(n, r)), e.value = [...r];
|
|
1956
|
+
}, y = _(() => {
|
|
1957
|
+
let e = l.value.length, t = l.value.reduce((e, t) => o.value.has(t) ? e + 1 : e, 0);
|
|
1958
|
+
return e === 0 || t === 0 ? Z.UNCHECKED : t >= e ? Z.CHECKED : Z.INDETERMINATE;
|
|
1959
|
+
});
|
|
1960
|
+
return {
|
|
1961
|
+
isSelected: d,
|
|
1962
|
+
isNodeSelectable: c,
|
|
1963
|
+
getCheckState: f,
|
|
1964
|
+
toggleRow: v,
|
|
1965
|
+
headerCheckState: y,
|
|
1966
|
+
toggleSelectAll: () => {
|
|
1967
|
+
if (y.value === Z.CHECKED) {
|
|
1968
|
+
e.value = [];
|
|
1969
|
+
return;
|
|
1970
|
+
}
|
|
1971
|
+
e.value = [...l.value];
|
|
1972
|
+
},
|
|
1973
|
+
clearSelection: () => {
|
|
1974
|
+
e.value = [];
|
|
1975
|
+
}
|
|
1976
|
+
};
|
|
1977
|
+
}, pn = ({ columns: e, primaryColumnKey: t, treeNodeByKey: n, groupTotalKey: r, depthFooter: i, groupContentColumnKey: a, creationContentColumnKey: o, loadMoreContentColumnKey: s, treeIndent: c, loadingMoreChildrenKeys: l, footerValues: u, stuckDepthFooterRowIndex: d, onDepthFooterClick: f, onLoadMoreChildren: p }) => {
|
|
1978
|
+
let m = _(() => H(e).find((e) => e.key === t.value)), h = _(() => H(i)?.columnKey ?? t.value), g = _(() => H(a) ?? t.value), v = _(() => H(o) ?? t.value), y = _(() => H(s) ?? t.value), b = (e) => n.value.get(e.key)?.subtreeSize ?? 0, x = (e) => Lt(e.item, H(r)), S = (e) => {
|
|
1979
|
+
let t = It(e.item, m.value?.value ?? m.value?.key);
|
|
1980
|
+
return t === void 0 ? void 0 : String(t);
|
|
1981
|
+
}, C = (e) => ({ paddingInlineStart: `calc(var(--s-ui-dimension-4) + ${e * H(c)}px)` }), w = (e) => {
|
|
1982
|
+
f({
|
|
1983
|
+
parentKey: e.parentKey ?? "",
|
|
1984
|
+
parentItem: e.item,
|
|
1985
|
+
depth: e.depth - 1
|
|
1986
|
+
});
|
|
1987
|
+
}, T = (e) => ({
|
|
1988
|
+
parentKey: e.parentKey ?? "",
|
|
1989
|
+
parentItem: e.item,
|
|
1990
|
+
depth: e.depth - 1,
|
|
1991
|
+
stuck: e.index === d.value,
|
|
1992
|
+
click: () => {
|
|
1993
|
+
w(e);
|
|
1994
|
+
}
|
|
1995
|
+
}), E = _(() => new Set(H(l))), D = (e) => e.parentKey ? E.value.has(e.parentKey) : !1, O = (e) => {
|
|
1996
|
+
!e.parentKey || D(e) || p({
|
|
1997
|
+
key: e.parentKey,
|
|
1998
|
+
item: e.item
|
|
1999
|
+
});
|
|
2000
|
+
}, k = (e) => ({
|
|
2001
|
+
parentKey: e.parentKey ?? "",
|
|
2002
|
+
parentItem: e.item,
|
|
2003
|
+
depth: e.depth,
|
|
2004
|
+
loading: D(e),
|
|
2005
|
+
loadMore: () => {
|
|
2006
|
+
O(e);
|
|
2007
|
+
}
|
|
2008
|
+
}), A = (e) => H(u)?.[e];
|
|
2009
|
+
return {
|
|
2010
|
+
depthFooterColumnKey: h,
|
|
2011
|
+
groupColumnKey: g,
|
|
2012
|
+
creationColumnKey: v,
|
|
2013
|
+
loadMoreColumnKey: y,
|
|
2014
|
+
getGroupCount: b,
|
|
2015
|
+
getGroupTotal: x,
|
|
2016
|
+
getGroupTitle: S,
|
|
2017
|
+
getDepthIndentStyle: C,
|
|
2018
|
+
emitDepthFooterClick: w,
|
|
2019
|
+
getDepthFooterSlotScope: T,
|
|
2020
|
+
isLoadMoreRowLoading: D,
|
|
2021
|
+
emitLoadMoreChildren: O,
|
|
2022
|
+
getLoadMoreSlotScope: k,
|
|
2023
|
+
getFooterValueText: (e) => {
|
|
2024
|
+
let t = A(e);
|
|
2025
|
+
return t ? t.limit === void 0 ? String(t.value) : `${t.value}/${t.limit}` : "";
|
|
2026
|
+
},
|
|
2027
|
+
getFooterToneClass: (e) => {
|
|
2028
|
+
let t = A(e)?.tone;
|
|
2029
|
+
return t ? `s-ui-table__aggregate-cell--tone-${t}` : void 0;
|
|
2030
|
+
},
|
|
2031
|
+
getFooterSlotScope: (t) => ({
|
|
2032
|
+
column: H(e).find((e) => e.key === t) ?? { key: t },
|
|
2033
|
+
footerValue: A(t)
|
|
2034
|
+
})
|
|
2035
|
+
};
|
|
2036
|
+
}, mn = ({ sortState: e, onSortChange: t }) => {
|
|
2037
|
+
let n = _(() => new Map(e.value.map((e) => [e.key, e]))), r = (e) => n.value.get(e)?.direction, i = (t) => {
|
|
2038
|
+
if (e.value.length < 2) return;
|
|
2039
|
+
let n = e.value.findIndex((e) => e.key === t);
|
|
2040
|
+
return n === -1 ? void 0 : n + 1;
|
|
2041
|
+
}, a = (n) => {
|
|
2042
|
+
e.value = n, t(n);
|
|
2043
|
+
};
|
|
2044
|
+
return {
|
|
2045
|
+
getColumnSortDirection: r,
|
|
2046
|
+
getColumnSortIndex: i,
|
|
2047
|
+
applySortCycle: (t, n) => {
|
|
2048
|
+
let r = [...e.value], i = r.findIndex((e) => e.key === t), o = i === -1 ? void 0 : r[i], s = o ? o.direction === Y.ASC ? {
|
|
2049
|
+
key: t,
|
|
2050
|
+
direction: Y.DESC
|
|
2051
|
+
} : void 0 : {
|
|
2052
|
+
key: t,
|
|
2053
|
+
direction: Y.ASC
|
|
2054
|
+
};
|
|
2055
|
+
if (!n) {
|
|
2056
|
+
a(s ? [s] : []);
|
|
2057
|
+
return;
|
|
2058
|
+
}
|
|
2059
|
+
i === -1 ? s && r.push(s) : s ? r.splice(i, 1, s) : r.splice(i, 1), a(r);
|
|
2060
|
+
},
|
|
2061
|
+
applySortExact: (t, n) => {
|
|
2062
|
+
let r = [...e.value], i = r.findIndex((e) => e.key === t);
|
|
2063
|
+
if (!n) {
|
|
2064
|
+
i !== -1 && (r.splice(i, 1), a(r));
|
|
2065
|
+
return;
|
|
2066
|
+
}
|
|
2067
|
+
let o = {
|
|
2068
|
+
key: t,
|
|
2069
|
+
direction: n
|
|
2070
|
+
};
|
|
2071
|
+
i === -1 ? r.push(o) : r.splice(i, 1, o), a(r);
|
|
2072
|
+
},
|
|
2073
|
+
getHeaderAriaSort: (e) => {
|
|
2074
|
+
if (!e.column) return;
|
|
2075
|
+
let t = r(e.key);
|
|
2076
|
+
if (t) return t === Y.ASC ? "ascending" : "descending";
|
|
2077
|
+
},
|
|
2078
|
+
getHeaderSlotScope: (e) => e.column ? {
|
|
2079
|
+
column: e.column,
|
|
2080
|
+
sortDirection: r(e.key),
|
|
2081
|
+
sortIndex: i(e.key)
|
|
2082
|
+
} : { column: { key: e.key } }
|
|
2083
|
+
};
|
|
2084
|
+
}, hn = ({ windowIndexes: e, visibleRange: t, getRowKey: n, pinnedRowKey: r, enabled: i }) => {
|
|
2085
|
+
let a = /* @__PURE__ */ new Set(), o = z(/* @__PURE__ */ new Set()), s = [], c = 12, l = 0, u = !1, d = !1, f = 0, p = "", m = () => {
|
|
2086
|
+
l = performance.now(), u = !0, o.value = new Set(a);
|
|
2087
|
+
}, h = (e) => {
|
|
2088
|
+
let t = s.splice(0, e);
|
|
2089
|
+
return t.forEach((e) => {
|
|
2090
|
+
a.add(e);
|
|
2091
|
+
}), t.length;
|
|
2092
|
+
}, g = (e) => {
|
|
2093
|
+
if (e > 34) {
|
|
2094
|
+
c = Math.max(2, Math.floor(c / 2));
|
|
2095
|
+
return;
|
|
2096
|
+
}
|
|
2097
|
+
e < 20 && (c = Math.min(64, c + 2));
|
|
2098
|
+
}, _ = () => {
|
|
2099
|
+
u && (u = !1, g(performance.now() - l));
|
|
2100
|
+
}, v = fe(() => {
|
|
2101
|
+
f = 0, _(), d ? d = !1 : h(c) > 0 && m(), s.length === 0 && v.pause();
|
|
2102
|
+
}, { immediate: !1 }), y = (e) => {
|
|
2103
|
+
let n = t.value, r = n ? (n.startIndex + n.endIndex) / 2 : 0;
|
|
2104
|
+
return [...e].sort((e, t) => Math.abs(e - r) - Math.abs(t - r));
|
|
2105
|
+
}, b = (e) => {
|
|
2106
|
+
let t = [];
|
|
2107
|
+
return y(e).forEach((e) => {
|
|
2108
|
+
let r = n(e);
|
|
2109
|
+
r !== void 0 && !a.has(r) && t.push(r);
|
|
2110
|
+
}), t;
|
|
2111
|
+
}, x = (e) => {
|
|
2112
|
+
let t = H(r), n = t === void 0 ? -1 : e.indexOf(t);
|
|
2113
|
+
return n > 0 && (e.splice(n, 1), e.unshift(t ?? "")), e;
|
|
2114
|
+
}, S = (e) => {
|
|
2115
|
+
let t = new Set(e.map(n)), r = 0;
|
|
2116
|
+
return a.forEach((e) => {
|
|
2117
|
+
t.has(e) || (a.delete(e), r += 1);
|
|
2118
|
+
}), r;
|
|
2119
|
+
}, C = (e) => {
|
|
2120
|
+
e > 0 && (m(), d = !0);
|
|
2121
|
+
}, w = (e) => {
|
|
2122
|
+
(s.length > 0 || e > 0) && v.resume();
|
|
2123
|
+
}, T = (e) => `${e[0]}:${e[e.length - 1]}:${e.length}`, E = (e) => {
|
|
2124
|
+
let t = T(e);
|
|
2125
|
+
if (!H(i) || t === p) return;
|
|
2126
|
+
p = t, s = x(b(e));
|
|
2127
|
+
let n = S(e), r = h(Math.max(0, c - f));
|
|
2128
|
+
f += r, C(n + r), w(r);
|
|
2129
|
+
};
|
|
2130
|
+
return W(e, E, {
|
|
2131
|
+
flush: "sync",
|
|
2132
|
+
immediate: !0
|
|
2133
|
+
}), W(() => H(i), () => {
|
|
2134
|
+
p = "", E(e.value);
|
|
2135
|
+
}), {
|
|
2136
|
+
isRowHydrated: (e) => !H(i) || e === H(r) || o.value.has(e),
|
|
2137
|
+
hydratedKeys: o
|
|
2138
|
+
};
|
|
2139
|
+
}, gn = {
|
|
2140
|
+
pinned: [],
|
|
2141
|
+
sliding: []
|
|
2142
|
+
}, _n = ({ snapshot: e, visibleRange: t, depthFooterSticky: n, bottomVisibleRowIndex: r, getRowOffset: i }) => {
|
|
2143
|
+
let a = _(() => {
|
|
2144
|
+
let n = t.value;
|
|
2145
|
+
if (!n) return;
|
|
2146
|
+
let { flatRows: r, getRowIndexByKey: i } = e.value, a = r[n.startIndex];
|
|
2147
|
+
if (!a) return;
|
|
2148
|
+
let o = a.kind === Q.GROUP ? a.key : a.parentKey;
|
|
2149
|
+
for (; o;) {
|
|
2150
|
+
let e = i(o), t = e === void 0 ? void 0 : r[e];
|
|
2151
|
+
if (!t) return;
|
|
2152
|
+
if (t.kind === Q.GROUP) return t.index;
|
|
2153
|
+
o = t.parentKey;
|
|
2154
|
+
}
|
|
2155
|
+
}), o = (e) => e.kind === Q.DEPTH_FOOTER || e.kind === Q.LOAD_MORE ? e.parentKey : e.key, s = (t) => {
|
|
2156
|
+
let { flatRows: n, getRowIndexByKey: r } = e.value, i = r(t);
|
|
2157
|
+
return i === void 0 ? void 0 : n[i]?.parentKey;
|
|
2158
|
+
}, c = (t) => {
|
|
2159
|
+
let { flatRows: n, depthFooterIndexByParentKey: r } = e.value, i = n[t], a = i ? o(i) : void 0;
|
|
2160
|
+
for (; a;) {
|
|
2161
|
+
let e = r.get(a);
|
|
2162
|
+
if (e !== void 0) return e;
|
|
2163
|
+
a = s(a);
|
|
2164
|
+
}
|
|
2165
|
+
}, l = (e, t) => {
|
|
2166
|
+
let n = i(e)?.start;
|
|
2167
|
+
return n !== void 0 && n - t < 1200;
|
|
2168
|
+
}, u = (e, t) => {
|
|
2169
|
+
let n = [e], r = e;
|
|
2170
|
+
for (; n.length < 6 && l(r, t);) {
|
|
2171
|
+
let e = c(r + 1);
|
|
2172
|
+
if (e === void 0) return n;
|
|
2173
|
+
n.push(e), r = e;
|
|
2174
|
+
}
|
|
2175
|
+
return n;
|
|
2176
|
+
}, d = (e) => {
|
|
2177
|
+
let t = c(e);
|
|
2178
|
+
return t === void 0 ? [] : u(t, i(e)?.end ?? 0);
|
|
2179
|
+
}, f = (t, n) => {
|
|
2180
|
+
let { flatRows: r } = e.value;
|
|
2181
|
+
return [t - 2, t - 1].filter((e) => r[e]?.kind === Q.DEPTH_FOOTER && !n.includes(e));
|
|
2182
|
+
}, p = _(() => {
|
|
2183
|
+
let e = r.value;
|
|
2184
|
+
if (!H(n) || e === void 0) return gn;
|
|
2185
|
+
let t = d(e);
|
|
2186
|
+
return {
|
|
2187
|
+
pinned: t,
|
|
2188
|
+
sliding: f(e, t)
|
|
2189
|
+
};
|
|
2190
|
+
}), m = _(() => {
|
|
2191
|
+
let { pinned: e, sliding: t } = p.value;
|
|
2192
|
+
return [...t, ...e];
|
|
2193
|
+
});
|
|
2194
|
+
return {
|
|
2195
|
+
activeGroupRowIndex: a,
|
|
2196
|
+
activeDepthFooterRowIndex: _(() => p.value.pinned[0]),
|
|
2197
|
+
activeDepthFooterRowIndexes: m,
|
|
2198
|
+
leavingDepthFooterRowIndex: _(() => {
|
|
2199
|
+
let [e, t] = p.value.pinned;
|
|
2200
|
+
return t === void 0 ? void 0 : e;
|
|
2201
|
+
}),
|
|
2202
|
+
slidingDepthFooterRowIndexes: _(() => p.value.sliding),
|
|
2203
|
+
farDepthFooterRowIndexes: _(() => p.value.pinned.slice(2))
|
|
2204
|
+
};
|
|
2205
|
+
}, vn = (e) => typeof e == "number" ? `${e}px` : e || void 0, yn = ({ tfootBarStackHeight: e, hasFooterValues: t, scrollClientWidth: n, columnCssVars: r, totalWidth: i, height: a, maxHeight: o }) => ({
|
|
2206
|
+
rootStyle: _(() => {
|
|
2207
|
+
let i = H(n);
|
|
2208
|
+
return {
|
|
2209
|
+
"--s-ui-table-header-height": "40px",
|
|
2210
|
+
"--s-ui-table-row-min-height": "52px",
|
|
2211
|
+
"--s-ui-table-scrollbar-size": "12px",
|
|
2212
|
+
"--s-ui-table-header-stack": "40px",
|
|
2213
|
+
"--s-ui-table-bottom-stack": `${e.value}px`,
|
|
2214
|
+
"--s-ui-table-footer-bar-height": "40px",
|
|
2215
|
+
"--s-ui-table-create-row-height": "52px",
|
|
2216
|
+
"--s-ui-table-aggregate-offset": H(t) ? "40px" : "0px",
|
|
2217
|
+
...i > 0 ? { "--s-ui-table-viewport-width": `${i}px` } : {},
|
|
2218
|
+
...r.value
|
|
2219
|
+
};
|
|
2220
|
+
}),
|
|
2221
|
+
scrollStyle: _(() => ({
|
|
2222
|
+
height: vn(H(a)),
|
|
2223
|
+
maxHeight: vn(H(o))
|
|
2224
|
+
})),
|
|
2225
|
+
tableStyle: _(() => ({ width: `max(100%, ${i.value}px)` }))
|
|
2226
|
+
}), bn, xn = () => {
|
|
2227
|
+
if (bn !== void 0) return bn;
|
|
2228
|
+
if (typeof document > "u") return bn = Ne, bn;
|
|
2229
|
+
let e = document.createElement("div");
|
|
2230
|
+
e.style.cssText = `position:absolute;visibility:hidden;pointer-events:none;width:1px;height:${Fe}px`, document.body.appendChild(e);
|
|
2231
|
+
let t = e.offsetHeight;
|
|
2232
|
+
return e.remove(), bn = t > 0 ? t : Ne, bn;
|
|
2233
|
+
}, Sn = (e) => e > 16e6 ? xn() - Pe : Infinity, Cn = (e, t, n) => {
|
|
2234
|
+
if (!e) return 0;
|
|
2235
|
+
let r = Math.max(t, Ie);
|
|
2236
|
+
return n > 4 * r ? r : 0;
|
|
2237
|
+
}, wn = (e, t) => !e.active || t <= e.edgeZone ? t : t >= e.maxUiScrollTop - e.edgeZone ? Math.min(e.maxModelScrollTop, e.maxModelScrollTop - (e.maxUiScrollTop - t)) : e.edgeZone + (t - e.edgeZone) * e.ratio, Tn = (e, t) => e.active ? t <= e.edgeZone ? Math.max(0, t) : t >= e.maxModelScrollTop - e.edgeZone ? Math.min(e.maxUiScrollTop, e.maxUiScrollTop - (e.maxModelScrollTop - t)) : e.edgeZone + (t - e.edgeZone) / e.ratio : t, En = (e, t) => e.active === t.active && e.maxUiScrollTop === t.maxUiScrollTop && e.maxModelScrollTop === t.maxModelScrollTop && e.edgeZone === t.edgeZone, Dn = (e, t) => !En(e, t) && (e.active || t.active), On = ({ scrollElement: e, totalSize: t, viewportHeight: n, extraHeight: r, onRescale: i }) => {
|
|
2238
|
+
let a = z(0), o = _(() => {
|
|
2239
|
+
let e = H(t), i = H(r), a = H(n), o = Sn(e), s = e > o, c = s ? o : e, l = Math.max(1, c + i - a), u = Math.max(0, e + i - a), d = Cn(s, a, l);
|
|
2240
|
+
return {
|
|
2241
|
+
active: s,
|
|
2242
|
+
uiHeight: c,
|
|
2243
|
+
maxUiScrollTop: l,
|
|
2244
|
+
maxModelScrollTop: u,
|
|
2245
|
+
edgeZone: d,
|
|
2246
|
+
ratio: s ? (u - 2 * d) / (l - 2 * d) : 1
|
|
2247
|
+
};
|
|
2248
|
+
}), s = (e) => wn(o.value, e), c = (e) => Tn(o.value, e), l = 0, u = -1;
|
|
2249
|
+
de(e, "scroll", () => {
|
|
2250
|
+
let t = e.value;
|
|
2251
|
+
t && (a.value = t.scrollTop, t.scrollTop !== u && (l = s(t.scrollTop)));
|
|
2252
|
+
}, { passive: !0 });
|
|
2253
|
+
let d = _(() => s(a.value)), f = _(() => o.value.active ? d.value - a.value : 0), p = _(() => o.value.uiHeight), m = _(() => o.value.maxModelScrollTop), h = _(() => o.value.active), g = (e, t) => {
|
|
2254
|
+
e.scrollTop = t, a.value = e.scrollTop, u = e.scrollTop, l = s(e.scrollTop);
|
|
2255
|
+
}, v = (e) => e.deltaMode === WheelEvent.DOM_DELTA_LINE ? e.deltaY * 52 : e.deltaMode === WheelEvent.DOM_DELTA_PAGE ? e.deltaY * H(n) : e.deltaY, y = (e) => o.value.active && e.deltaY !== 0 && !e.ctrlKey, b = (t) => {
|
|
2256
|
+
let n = e.value;
|
|
2257
|
+
if (!n || !y(t)) return;
|
|
2258
|
+
let { maxModelScrollTop: r } = o.value, i = Math.max(0, Math.min(r, l + v(t)));
|
|
2259
|
+
i !== l && (t.preventDefault(), g(n, c(i)), l = i, n.scrollLeft += t.deltaX);
|
|
2260
|
+
}, x, S = (t) => {
|
|
2261
|
+
x?.(), x = t ? de(e, "wheel", b, { passive: !1 }) : void 0;
|
|
2262
|
+
};
|
|
2263
|
+
return le(() => {
|
|
2264
|
+
x?.();
|
|
2265
|
+
}), P(() => {
|
|
2266
|
+
W(o, (t, n) => {
|
|
2267
|
+
let r = e.value;
|
|
2268
|
+
!r || !Dn(t, n) || (g(r, Tn(t, l)), i?.(l));
|
|
2269
|
+
}), W(h, S, { immediate: !0 });
|
|
2270
|
+
}), {
|
|
2271
|
+
uiScrollTop: a,
|
|
2272
|
+
modelScrollOffset: d,
|
|
2273
|
+
uiShift: f,
|
|
2274
|
+
uiTotalSize: p,
|
|
2275
|
+
maxModelScrollTop: m,
|
|
2276
|
+
active: h,
|
|
2277
|
+
uiToModel: s,
|
|
2278
|
+
modelToUi: c,
|
|
2279
|
+
setScrollTop: g
|
|
2280
|
+
};
|
|
2281
|
+
}, kn = ({ rowCount: e, enabled: t, autoMeasure: n, estimateRowSize: r, estimateRowSizeByIndex: i, overscan: a, scrollElement: o, getRowKey: s, rowsVersion: c, viewportHeight: l, extraHeight: u }) => {
|
|
2282
|
+
let d, f = On({
|
|
2283
|
+
scrollElement: o,
|
|
2284
|
+
totalSize: () => g.value.getTotalSize(),
|
|
2285
|
+
viewportHeight: l,
|
|
2286
|
+
extraHeight: u,
|
|
2287
|
+
onRescale: (e) => {
|
|
2288
|
+
d?.(e, !1);
|
|
2289
|
+
}
|
|
2290
|
+
}), p = z(0), m = 0, h = (e, t, n) => {
|
|
2291
|
+
let r = Math.round((e - m) / n);
|
|
2292
|
+
m = e, p.value = t ? Math.max(-24, Math.min(24, r)) : 0;
|
|
2293
|
+
}, g = _e(_(() => {
|
|
2294
|
+
let n = H(r);
|
|
2295
|
+
return {
|
|
2296
|
+
count: H(e),
|
|
2297
|
+
enabled: H(t),
|
|
2298
|
+
getScrollElement: () => o.value,
|
|
2299
|
+
estimateSize: (e) => i?.(e) ?? n,
|
|
2300
|
+
getItemKey: s,
|
|
2301
|
+
overscan: H(a),
|
|
2302
|
+
shouldAdjustScrollPositionOnItemSizeChange: () => !1,
|
|
2303
|
+
observeElementOffset: (e, t) => (d = t, ge(e, (e, r) => {
|
|
2304
|
+
let i = f.uiToModel(e);
|
|
2305
|
+
h(i, r, n), t(i, r);
|
|
2306
|
+
})),
|
|
2307
|
+
scrollToFn: (e, t, n) => {
|
|
2308
|
+
he(f.modelToUi(e + (t.adjustments ?? 0)), { behavior: t.behavior }, n);
|
|
2309
|
+
}
|
|
2310
|
+
};
|
|
2311
|
+
})), v = _(() => H(t) ? g.value.getVirtualItems() : []), y = _(() => g.value.getTotalSize()), b = (e, t) => Array.from({ length: Math.max(0, t - e + 1) }, (t, n) => e + n), x = (t, n) => {
|
|
2312
|
+
let r = t[0], i = t[t.length - 1];
|
|
2313
|
+
if (!(!r || !i)) return n > 0 ? [i.index + 1, Math.min(H(e) - 1, i.index + n)] : [Math.max(0, r.index + n), r.index - 1];
|
|
2314
|
+
}, S = _(() => {
|
|
2315
|
+
let e = v.value, t = e.map((e) => e.index), n = p.value, r = n === 0 ? void 0 : x(e, n);
|
|
2316
|
+
if (!r) return t;
|
|
2317
|
+
let i = b(r[0], r[1]);
|
|
2318
|
+
return n > 0 ? [...t, ...i] : [...i, ...t];
|
|
2319
|
+
}), C = /* @__PURE__ */ new Set(), w = (e) => {
|
|
2320
|
+
if (!(e instanceof HTMLElement) || e.dataset.placeholder) return;
|
|
2321
|
+
let t = Number(e.dataset.index);
|
|
2322
|
+
return Number.isInteger(t) ? t : void 0;
|
|
2323
|
+
}, T = (e) => {
|
|
2324
|
+
if (!H(t) || !H(n)) return;
|
|
2325
|
+
let r = o.value;
|
|
2326
|
+
if (!r) return;
|
|
2327
|
+
let i = r.querySelectorAll("tr[data-index]"), a = [];
|
|
2328
|
+
if (i.forEach((t) => {
|
|
2329
|
+
let n = w(t);
|
|
2330
|
+
n === void 0 || !(t instanceof HTMLElement) || (!e || !C.has(s(n))) && a.push(t);
|
|
2331
|
+
}), a.length === 0) return;
|
|
2332
|
+
let c = g.value.measurementsCache, l = r.getBoundingClientRect().top, u = f.uiToModel(r.scrollTop), d = [], p = Infinity;
|
|
2333
|
+
a.forEach((e) => {
|
|
2334
|
+
let t = Number(e.dataset.index), n = e.getBoundingClientRect();
|
|
2335
|
+
d.push([t, Math.round(n.height)]), n.bottom > l + 1 && t < p && (p = t);
|
|
2336
|
+
});
|
|
2337
|
+
let m = 0;
|
|
2338
|
+
d.forEach(([e, t]) => {
|
|
2339
|
+
if (t <= 0) return;
|
|
2340
|
+
C.add(s(e));
|
|
2341
|
+
let n = c[e]?.size;
|
|
2342
|
+
e < p && n !== void 0 && (m += t - n), g.value.resizeItem(e, t);
|
|
2343
|
+
}), m !== 0 && f.setScrollTop(r, f.modelToUi(u + m));
|
|
2344
|
+
};
|
|
2345
|
+
W(S, () => T(!0), { flush: "post" });
|
|
2346
|
+
let E = () => {
|
|
2347
|
+
T(!0);
|
|
2348
|
+
}, D = () => {
|
|
2349
|
+
C.clear(), T(!1);
|
|
2350
|
+
};
|
|
2351
|
+
pe(o, () => {
|
|
2352
|
+
D();
|
|
2353
|
+
}), W(() => H(c), () => {
|
|
2354
|
+
C.clear(), T(!1);
|
|
2355
|
+
}, { flush: "post" });
|
|
2356
|
+
let O = (e, t) => {
|
|
2357
|
+
if (e !== "auto") return e;
|
|
2358
|
+
let n = H(l) - H(u), r = f.modelScrollOffset.value;
|
|
2359
|
+
return t.end >= r + n ? "end" : t.start <= r ? "start" : void 0;
|
|
2360
|
+
}, k = (e, t) => {
|
|
2361
|
+
let n = H(l) - H(u);
|
|
2362
|
+
return e === "start" ? t.start : e === "end" ? t.end - n : t.start - (n - t.size) / 2;
|
|
2363
|
+
}, A = (e, t) => {
|
|
2364
|
+
let n = g.value.measurementsCache, r = n[Math.max(0, Math.min(e, n.length - 1))];
|
|
2365
|
+
if (!r) return;
|
|
2366
|
+
let i = O(t, r);
|
|
2367
|
+
if (!i) return;
|
|
2368
|
+
let a = k(i, r);
|
|
2369
|
+
return Math.max(0, Math.min(f.maxModelScrollTop.value, a));
|
|
2370
|
+
}, j = (e, t = "auto") => {
|
|
2371
|
+
let n = o.value;
|
|
2372
|
+
if (!f.active.value || !n) {
|
|
2373
|
+
g.value.scrollToIndex(e, { align: t });
|
|
2374
|
+
return;
|
|
2375
|
+
}
|
|
2376
|
+
let r = A(e, t);
|
|
2377
|
+
r !== void 0 && f.setScrollTop(n, f.modelToUi(r));
|
|
2378
|
+
}, M = _(() => {
|
|
2379
|
+
if (!(!H(t) || v.value.length === 0)) return g.value.range ?? void 0;
|
|
2380
|
+
}), N = (e) => {
|
|
2381
|
+
let t = g.value.measurementsCache;
|
|
2382
|
+
if (t.length === 0) return;
|
|
2383
|
+
let n = 0, r = t.length - 1;
|
|
2384
|
+
for (; n < r;) {
|
|
2385
|
+
let i = Math.floor((n + r) / 2), a = t[i];
|
|
2386
|
+
if (!a) return;
|
|
2387
|
+
a.end <= e ? n = i + 1 : r = i;
|
|
2388
|
+
}
|
|
2389
|
+
return n;
|
|
2390
|
+
}, P = (e) => {
|
|
2391
|
+
let t = g.value.measurementsCache[e];
|
|
2392
|
+
if (t) return {
|
|
2393
|
+
start: t.start,
|
|
2394
|
+
end: t.end
|
|
2395
|
+
};
|
|
2396
|
+
};
|
|
2397
|
+
return {
|
|
2398
|
+
rowVirtualizer: g,
|
|
2399
|
+
virtualItems: v,
|
|
2400
|
+
windowIndexes: S,
|
|
2401
|
+
totalSize: y,
|
|
2402
|
+
uiTotalSize: f.uiTotalSize,
|
|
2403
|
+
modelScrollOffset: f.modelScrollOffset,
|
|
2404
|
+
scrollCompressed: f.active,
|
|
2405
|
+
measureWindowRows: D,
|
|
2406
|
+
measureNewRows: E,
|
|
2407
|
+
scrollToIndex: j,
|
|
2408
|
+
visibleRange: M,
|
|
2409
|
+
getRowOffset: P,
|
|
2410
|
+
getRowUiOffset: (e) => {
|
|
2411
|
+
let t = P(e);
|
|
2412
|
+
if (!t) return;
|
|
2413
|
+
let n = f.uiShift.value;
|
|
2414
|
+
return {
|
|
2415
|
+
start: t.start - n,
|
|
2416
|
+
end: t.end - n
|
|
2417
|
+
};
|
|
2418
|
+
},
|
|
2419
|
+
getRowIndexAtOffset: N
|
|
2420
|
+
};
|
|
2421
|
+
}, An = [
|
|
2422
|
+
"role",
|
|
2423
|
+
"aria-rowcount",
|
|
2424
|
+
"aria-colcount",
|
|
2425
|
+
"aria-busy"
|
|
2426
|
+
], jn = { class: "s-ui-table__head" }, Mn = {
|
|
2427
|
+
class: "s-ui-table__head-row",
|
|
2428
|
+
"aria-rowindex": 1
|
|
2429
|
+
}, Nn = {
|
|
2430
|
+
key: 0,
|
|
2431
|
+
class: "s-ui-table__header-cell s-ui-table__filler-cell",
|
|
2432
|
+
role: "presentation"
|
|
2433
|
+
}, Pn = [
|
|
2434
|
+
"id",
|
|
2435
|
+
"data-column-key",
|
|
2436
|
+
"data-section",
|
|
2437
|
+
"aria-colindex",
|
|
2438
|
+
"aria-sort",
|
|
2439
|
+
"tabindex"
|
|
2440
|
+
], Fn = {
|
|
2441
|
+
key: 2,
|
|
2442
|
+
class: "s-ui-table__columns-manager"
|
|
2443
|
+
}, In = { class: "s-ui-table__columns-item-main" }, Ln = { class: "s-ui-table__columns-item-title" }, Rn = [
|
|
2444
|
+
"aria-label",
|
|
2445
|
+
"onPointerdown",
|
|
2446
|
+
"onKeydown",
|
|
2447
|
+
"onDblclick"
|
|
2448
|
+
], zn = { class: "s-ui-table__body" }, Bn = {
|
|
2449
|
+
key: 0,
|
|
2450
|
+
class: "s-ui-table__empty-row",
|
|
2451
|
+
"aria-rowindex": 2
|
|
2452
|
+
}, Vn = ["colspan"], Hn = { class: "s-ui-table__empty-content" }, Un = { class: "s-ui-table__empty-text" }, Wn = {
|
|
2453
|
+
key: 0,
|
|
2454
|
+
class: "s-ui-table__spacer",
|
|
2455
|
+
"aria-hidden": "true"
|
|
2456
|
+
}, Gn = ["colspan"], Kn = {
|
|
2457
|
+
key: 0,
|
|
2458
|
+
class: "s-ui-table__foot"
|
|
2459
|
+
}, qn = ["aria-rowindex"], Jn = {
|
|
2460
|
+
key: 0,
|
|
2461
|
+
class: "s-ui-table__aggregate-cell s-ui-table__filler-cell",
|
|
2462
|
+
role: "presentation"
|
|
2463
|
+
}, Yn = [
|
|
2464
|
+
"id",
|
|
2465
|
+
"aria-colindex",
|
|
2466
|
+
"data-column-key",
|
|
2467
|
+
"data-section",
|
|
2468
|
+
"tabindex"
|
|
2469
|
+
], Xn = {
|
|
2470
|
+
key: 1,
|
|
2471
|
+
class: "s-ui-table__aggregate-text"
|
|
2472
|
+
}, Zn = /* @__PURE__ */ T({
|
|
2473
|
+
__name: "STable",
|
|
2474
|
+
props: /*@__PURE__*/ O({
|
|
2475
|
+
items: {},
|
|
2476
|
+
columns: {},
|
|
2477
|
+
itemKey: {
|
|
2478
|
+
type: [String, Function],
|
|
2479
|
+
default: "id"
|
|
2480
|
+
},
|
|
2481
|
+
childrenKey: { default: "children" },
|
|
2482
|
+
groupRow: { type: [String, Function] },
|
|
2483
|
+
groupTotalKey: {},
|
|
2484
|
+
groupContentColumnKey: {},
|
|
2485
|
+
disabledKey: {},
|
|
2486
|
+
selectable: {
|
|
2487
|
+
type: Boolean,
|
|
2488
|
+
default: !1
|
|
2489
|
+
},
|
|
2490
|
+
cascadeSelection: {
|
|
2491
|
+
type: Boolean,
|
|
2492
|
+
default: !1
|
|
2493
|
+
},
|
|
2494
|
+
isItemSelectable: { type: Function },
|
|
2495
|
+
columnsManageable: { type: Boolean },
|
|
2496
|
+
rowState: { type: Function },
|
|
2497
|
+
expandColumnKey: {},
|
|
2498
|
+
expandOnClick: {
|
|
2499
|
+
type: Boolean,
|
|
2500
|
+
default: !1
|
|
2501
|
+
},
|
|
2502
|
+
treeIndent: { default: () => 18 },
|
|
2503
|
+
depthFooter: {},
|
|
2504
|
+
creationRow: {
|
|
2505
|
+
type: Boolean,
|
|
2506
|
+
default: !1
|
|
2507
|
+
},
|
|
2508
|
+
creationContentColumnKey: {},
|
|
2509
|
+
footerValues: {},
|
|
2510
|
+
virtual: {
|
|
2511
|
+
type: Boolean,
|
|
2512
|
+
default: !0
|
|
2513
|
+
},
|
|
2514
|
+
rowHeightMode: { default: () => ke.AUTO },
|
|
2515
|
+
estimateRowSize: { default: () => 52 },
|
|
2516
|
+
overscan: { default: () => 8 },
|
|
2517
|
+
height: {},
|
|
2518
|
+
maxHeight: {},
|
|
2519
|
+
endReachedDistance: { default: 0 },
|
|
2520
|
+
canLoadMore: { type: Function },
|
|
2521
|
+
loading: {
|
|
2522
|
+
type: Boolean,
|
|
2523
|
+
default: !1
|
|
2524
|
+
},
|
|
2525
|
+
loadingMore: {
|
|
2526
|
+
type: Boolean,
|
|
2527
|
+
default: !1
|
|
2528
|
+
},
|
|
2529
|
+
skeletonRowCount: { default: () => 8 },
|
|
2530
|
+
hasMoreChildrenKey: {},
|
|
2531
|
+
loadingMoreChildrenKeys: { default: () => [] },
|
|
2532
|
+
loadMoreContentColumnKey: {},
|
|
2533
|
+
rowsDraggable: {
|
|
2534
|
+
type: Boolean,
|
|
2535
|
+
default: !1
|
|
2536
|
+
},
|
|
2537
|
+
rowsDragMode: {},
|
|
2538
|
+
isRowDraggable: { type: Function },
|
|
2539
|
+
dragExpandDelayMs: { default: () => 500 },
|
|
2540
|
+
columnsResizable: {
|
|
2541
|
+
type: Boolean,
|
|
2542
|
+
default: !0
|
|
2543
|
+
},
|
|
2544
|
+
columnsDraggable: {
|
|
2545
|
+
type: Boolean,
|
|
2546
|
+
default: !0
|
|
2547
|
+
},
|
|
2548
|
+
scrollSeekPlaceholders: {
|
|
2549
|
+
type: Boolean,
|
|
2550
|
+
default: !0
|
|
2551
|
+
},
|
|
2552
|
+
rowClass: { type: Function }
|
|
2553
|
+
}, {
|
|
2554
|
+
modelValue: {},
|
|
2555
|
+
modelModifiers: {},
|
|
2556
|
+
selected: { default: () => [] },
|
|
2557
|
+
selectedModifiers: {},
|
|
2558
|
+
expanded: { default: () => [] },
|
|
2559
|
+
expandedModifiers: {},
|
|
2560
|
+
columnOrder: {},
|
|
2561
|
+
columnOrderModifiers: {},
|
|
2562
|
+
columnWidths: {},
|
|
2563
|
+
columnWidthsModifiers: {},
|
|
2564
|
+
hiddenColumns: {},
|
|
2565
|
+
hiddenColumnsModifiers: {},
|
|
2566
|
+
sortState: { default: () => [] },
|
|
2567
|
+
sortStateModifiers: {}
|
|
2568
|
+
}),
|
|
2569
|
+
emits: /*@__PURE__*/ O([
|
|
2570
|
+
"rowClick",
|
|
2571
|
+
"rowContextMenu",
|
|
2572
|
+
"cellClick",
|
|
2573
|
+
"sortChange",
|
|
2574
|
+
"endReached",
|
|
2575
|
+
"loadMoreChildren",
|
|
2576
|
+
"depthFooterClick",
|
|
2577
|
+
"groupMenuOpen",
|
|
2578
|
+
"columnResizeEnd",
|
|
2579
|
+
"columnReorder",
|
|
2580
|
+
"rowsReorder",
|
|
2581
|
+
"rowsDrop"
|
|
2582
|
+
], [
|
|
2583
|
+
"update:modelValue",
|
|
2584
|
+
"update:selected",
|
|
2585
|
+
"update:expanded",
|
|
2586
|
+
"update:columnOrder",
|
|
2587
|
+
"update:columnWidths",
|
|
2588
|
+
"update:hiddenColumns",
|
|
2589
|
+
"update:sortState"
|
|
2590
|
+
]),
|
|
2591
|
+
setup(i, { expose: a, emit: u }) {
|
|
2592
|
+
let d = te(i, "modelValue"), f = te(i, "selected"), T = te(i, "expanded"), D = te(i, "columnOrder"), O = te(i, "columnWidths"), N = te(i, "hiddenColumns"), P = te(i, "sortState"), I = u, V = ne(), { t: H } = ce(), ae = ee(), K = re("scrollElementRef"), le = re("tableElementRef"), de = re("tableRootRef"), { width: fe, height: pe } = ue(K), { primaryColumnKey: me, columnDescriptors: he, columnCssVars: ge, totalWidth: _e, columnCount: ve } = it({
|
|
2593
|
+
columns: () => i.columns,
|
|
2594
|
+
columnOrder: D,
|
|
2595
|
+
columnWidths: O,
|
|
2596
|
+
hiddenColumns: N,
|
|
2597
|
+
hasIndicator: () => !!V.indicator,
|
|
2598
|
+
hasCheckbox: () => i.selectable,
|
|
2599
|
+
hasRightEdge: () => !!V["right-edge"],
|
|
2600
|
+
hasColumnsManager: () => i.columnsManageable,
|
|
2601
|
+
columnsResizable: () => i.columnsResizable,
|
|
2602
|
+
columnsDraggable: () => i.columnsDraggable,
|
|
2603
|
+
viewportWidth: () => fe.value
|
|
2604
|
+
}), { treeIndex: ye, snapshot: be, flatRows: q, toggleExpanded: xe, expandAll: Se, collapseAll: Ce } = zt({
|
|
2605
|
+
items: () => i.items,
|
|
2606
|
+
itemKey: () => i.itemKey,
|
|
2607
|
+
childrenKey: () => i.childrenKey,
|
|
2608
|
+
groupRow: () => i.groupRow,
|
|
2609
|
+
expanded: T,
|
|
2610
|
+
depthFooter: () => i.depthFooter,
|
|
2611
|
+
hasMoreChildrenKey: () => i.hasMoreChildrenKey
|
|
2612
|
+
}), { leadingDescriptors: we, trailingDescriptors: Te, headerCells: Ee, getStickyCellStyle: J, getHeaderCellClasses: De, leadingCellPlans: Y, trailingCellPlans: Oe, rowCellPlans: X } = sn({
|
|
2613
|
+
columnDescriptors: he,
|
|
2614
|
+
hasTreeStructure: () => Ne.value,
|
|
2615
|
+
expandColumnKey: () => i.expandColumnKey,
|
|
2616
|
+
primaryColumnKey: me
|
|
2617
|
+
}), Me = _(() => he.value.length + 1), Ne = _(() => ye.value.expandableKeys.length > 0), Pe = _(() => Ne.value ? "treegrid" : "grid"), Fe = _(() => q.value.length + 1 + +!!i.creationRow + +!!i.footerValues), Ie = _(() => i.virtual), Le = _(() => ({ "s-ui-table--rows-fixed": i.rowHeightMode === ke.FIXED })), Re = _(() => {
|
|
2618
|
+
let e = 0;
|
|
2619
|
+
return i.footerValues && (e += 40), i.creationRow && (e += 52), e;
|
|
2620
|
+
}), ze = [];
|
|
2621
|
+
W(q, (e) => {
|
|
2622
|
+
ze = e;
|
|
2623
|
+
}, {
|
|
2624
|
+
flush: "sync",
|
|
2625
|
+
immediate: !0
|
|
2626
|
+
});
|
|
2627
|
+
let { windowIndexes: Ve, uiTotalSize: We, modelScrollOffset: Ge, scrollToIndex: Ke, visibleRange: qe, getRowOffset: Je, getRowUiOffset: Ye, getRowIndexAtOffset: Xe, measureWindowRows: Ze, measureNewRows: Qe } = kn({
|
|
2628
|
+
rowCount: () => q.value.length,
|
|
2629
|
+
enabled: Ie,
|
|
2630
|
+
autoMeasure: () => i.rowHeightMode === ke.AUTO,
|
|
2631
|
+
estimateRowSize: () => i.estimateRowSize,
|
|
2632
|
+
estimateRowSizeByIndex: void 0,
|
|
2633
|
+
overscan: () => i.overscan,
|
|
2634
|
+
scrollElement: K,
|
|
2635
|
+
getRowKey: (e) => ze[e]?.key ?? e,
|
|
2636
|
+
rowsVersion: q,
|
|
2637
|
+
viewportHeight: () => pe.value,
|
|
2638
|
+
extraHeight: () => 40 + Re.value
|
|
2639
|
+
}), { isRowHydrated: $e, hydratedKeys: et } = hn({
|
|
2640
|
+
windowIndexes: Ve,
|
|
2641
|
+
visibleRange: qe,
|
|
2642
|
+
getRowKey: (e) => ze[e]?.key,
|
|
2643
|
+
pinnedRowKey: () => d.value,
|
|
2644
|
+
enabled: () => Ie.value && i.scrollSeekPlaceholders
|
|
2645
|
+
});
|
|
2646
|
+
W(et, Qe, { flush: "post" });
|
|
2647
|
+
let { resizingColumnKey: tt, handleResizeHandlePointerdown: nt, handleResizeHandleKeydown: rt, handleResizeHandleDblclick: at } = cn({
|
|
2648
|
+
tableRootElement: de,
|
|
2649
|
+
scrollElement: K,
|
|
2650
|
+
columnDescriptors: he,
|
|
2651
|
+
columnWidths: O,
|
|
2652
|
+
enabled: () => i.columnsResizable,
|
|
2653
|
+
onResizeEnd: (e, t) => {
|
|
2654
|
+
I("columnResizeEnd", {
|
|
2655
|
+
key: e,
|
|
2656
|
+
width: t
|
|
2657
|
+
});
|
|
2658
|
+
},
|
|
2659
|
+
remeasureRows: () => {
|
|
2660
|
+
Ze();
|
|
2661
|
+
}
|
|
2662
|
+
}), ot = _(() => i.rowsDragMode ? i.rowsDragMode : Ne.value ? Ae.TREE : Ae.FLAT), { registerColumnHeaderElement: st, draggingColumnKey: lt, dropLineStyle: ut } = an({
|
|
2663
|
+
tableId: ae,
|
|
2664
|
+
tableRootElement: de,
|
|
2665
|
+
enabled: () => i.columnsDraggable,
|
|
2666
|
+
columnDescriptors: he,
|
|
2667
|
+
onReorder: (e, t, n) => {
|
|
2668
|
+
let r = D.value?.length ? [...D.value] : i.columns.map((e) => e.key);
|
|
2669
|
+
i.columns.forEach((e) => {
|
|
2670
|
+
r.includes(e.key) || r.push(e.key);
|
|
2671
|
+
});
|
|
2672
|
+
let a = r.filter((t) => t !== e), o = a.indexOf(t);
|
|
2673
|
+
if (o === -1) return;
|
|
2674
|
+
let s = n === "left" ? o : o + 1;
|
|
2675
|
+
a.splice(s, 0, e), D.value = a, I("columnReorder", {
|
|
2676
|
+
key: e,
|
|
2677
|
+
toIndex: s,
|
|
2678
|
+
order: a
|
|
2679
|
+
});
|
|
2680
|
+
},
|
|
2681
|
+
isResizing: () => !!tt.value
|
|
2682
|
+
}), dt = (e, t) => {
|
|
2683
|
+
(e instanceof Element || e === null) && st(t, e);
|
|
2684
|
+
}, { registerRowElement: ft, draggingRowKey: pt, dropIndicator: mt } = un({
|
|
2685
|
+
tableId: ae,
|
|
2686
|
+
enabled: () => i.rowsDraggable,
|
|
2687
|
+
dragMode: ot,
|
|
2688
|
+
snapshot: be,
|
|
2689
|
+
scrollElement: K,
|
|
2690
|
+
isRowDraggable: () => i.isRowDraggable,
|
|
2691
|
+
dragExpandDelayMs: () => i.dragExpandDelayMs,
|
|
2692
|
+
isExpanded: (e) => T.value.includes(e),
|
|
2693
|
+
onHoverExpand: (e) => {
|
|
2694
|
+
xe(e);
|
|
2695
|
+
},
|
|
2696
|
+
onReorder: (e) => {
|
|
2697
|
+
I("rowsReorder", e);
|
|
2698
|
+
},
|
|
2699
|
+
onTreeDrop: (e) => {
|
|
2700
|
+
I("rowsDrop", e);
|
|
2701
|
+
},
|
|
2702
|
+
resolveRowPreviewTitle: (e) => Dn(e) ?? e.key
|
|
2703
|
+
}), gt = (e) => {
|
|
2704
|
+
(e instanceof Element || e === null) && ft(e);
|
|
2705
|
+
}, _t = (e) => {
|
|
2706
|
+
let t = mt.value;
|
|
2707
|
+
if (!(!t || t.targetKey !== e)) return t.action === je.CHILD ? "inside" : t.action === je.BEFORE ? "before" : "after";
|
|
2708
|
+
}, { activeGroupRowIndex: vt, activeDepthFooterRowIndex: yt, activeDepthFooterRowIndexes: bt, leavingDepthFooterRowIndex: xt, slidingDepthFooterRowIndexes: St, farDepthFooterRowIndexes: wt } = _n({
|
|
2709
|
+
snapshot: be,
|
|
2710
|
+
visibleRange: qe,
|
|
2711
|
+
depthFooterSticky: () => i.depthFooter?.sticky !== !1,
|
|
2712
|
+
bottomVisibleRowIndex: _(() => {
|
|
2713
|
+
if (!Ie.value || pe.value === 0) return;
|
|
2714
|
+
let e = Ge.value + pe.value - 40 - Re.value;
|
|
2715
|
+
return Xe(Math.max(0, e));
|
|
2716
|
+
}),
|
|
2717
|
+
getRowOffset: Je
|
|
2718
|
+
}), { renderEntries: Tt } = dn({
|
|
2719
|
+
flatRows: q,
|
|
2720
|
+
virtualEnabled: Ie,
|
|
2721
|
+
windowIndexes: Ve,
|
|
2722
|
+
uiTotalSize: We,
|
|
2723
|
+
getRowUiOffset: Ye,
|
|
2724
|
+
activeGroupRowIndex: vt,
|
|
2725
|
+
activeDepthFooterRowIndexes: bt,
|
|
2726
|
+
leavingDepthFooterRowIndex: xt,
|
|
2727
|
+
slidingDepthFooterRowIndexes: St,
|
|
2728
|
+
farDepthFooterRowIndexes: wt,
|
|
2729
|
+
activeRowIndex: _(() => {
|
|
2730
|
+
if (d.value) return be.value.getRowIndexByKey(d.value);
|
|
2731
|
+
})
|
|
2732
|
+
}), Et = _(() => !i.loading && q.value.length === 0), { rootStyle: Dt, scrollStyle: kt, tableStyle: At } = yn({
|
|
2733
|
+
tfootBarStackHeight: Re,
|
|
2734
|
+
hasFooterValues: () => !!i.footerValues,
|
|
2735
|
+
scrollClientWidth: () => fe.value,
|
|
2736
|
+
columnCssVars: ge,
|
|
2737
|
+
totalWidth: _e,
|
|
2738
|
+
height: () => i.height,
|
|
2739
|
+
maxHeight: () => i.maxHeight
|
|
2740
|
+
}), { getColumnSortDirection: jt, getColumnSortIndex: Mt, applySortCycle: Nt, applySortExact: Pt, getHeaderAriaSort: It, getHeaderSlotScope: Lt } = mn({
|
|
2741
|
+
sortState: P,
|
|
2742
|
+
onSortChange: (e) => {
|
|
2743
|
+
I("sortChange", e);
|
|
2744
|
+
}
|
|
2745
|
+
}), Rt = z(), Bt = (e, t) => {
|
|
2746
|
+
Rt.value = t ? e : void 0;
|
|
2747
|
+
}, Vt = (e, t) => {
|
|
2748
|
+
if (!i.columnsResizable || !e.resizable) return;
|
|
2749
|
+
let n = Math.min(e.maxWidth ?? Infinity, Math.max(e.minWidth, e.width + t * 8));
|
|
2750
|
+
n !== e.width && (O.value = {
|
|
2751
|
+
...O.value,
|
|
2752
|
+
[e.key]: n
|
|
2753
|
+
}, I("columnResizeEnd", {
|
|
2754
|
+
key: e.key,
|
|
2755
|
+
width: n
|
|
2756
|
+
}));
|
|
2757
|
+
}, Ht = z(!1), Ut = _(() => i.columns.filter((e) => e.key !== me.value && (e.hideable ?? !0))), Wt = (e) => (N.value ?? []).includes(e), Gt = _(() => {
|
|
2758
|
+
let e = Ut.value.map((e) => {
|
|
2759
|
+
let t = Wt(e.key);
|
|
2760
|
+
return {
|
|
2761
|
+
column: e,
|
|
2762
|
+
hidden: t,
|
|
2763
|
+
classes: { "s-ui-table__columns-item--hidden": t }
|
|
2764
|
+
};
|
|
2765
|
+
});
|
|
2766
|
+
return [e.filter((e) => !e.hidden), e.filter((e) => e.hidden)].filter((e) => e.length > 0);
|
|
2767
|
+
}), Kt = (e) => {
|
|
2768
|
+
let t = new Set(N.value ?? []);
|
|
2769
|
+
t.has(e) ? t.delete(e) : t.add(e), N.value = [...t];
|
|
2770
|
+
}, qt = (e) => {
|
|
2771
|
+
let t = new Set(N.value ?? []);
|
|
2772
|
+
t.add(e), N.value = [...t];
|
|
2773
|
+
}, Jt = fn({
|
|
2774
|
+
selected: f,
|
|
2775
|
+
cascade: () => i.cascadeSelection,
|
|
2776
|
+
treeIndex: ye,
|
|
2777
|
+
groupRow: () => i.groupRow,
|
|
2778
|
+
disabledKey: () => i.disabledKey,
|
|
2779
|
+
isItemSelectable: () => i.isItemSelectable
|
|
2780
|
+
}), Yt = Jt.headerCheckState, Zt = (e) => Jt.isSelected(e), Qt = (e) => i.cascadeSelection && Jt.getCheckState(e) === Z.INDETERMINATE, en = (e) => {
|
|
2781
|
+
Jt.toggleRow(e);
|
|
2782
|
+
}, tn = (e) => Ft(e.item, i.disabledKey), nn = ({ row: e, spacerHeight: t, rowHeight: n, stuckTop: r, stuckBottom: a, stuckBottomLeaving: o, stuckBottomSliding: s, stuckBottomCoverHeight: c, stuckBottomFar: l }, u) => [
|
|
2783
|
+
e ?? t,
|
|
2784
|
+
e?.index,
|
|
2785
|
+
e?.expanded,
|
|
2786
|
+
e?.item,
|
|
2787
|
+
e?.kind,
|
|
2788
|
+
e?.hasChildren,
|
|
2789
|
+
e?.depth,
|
|
2790
|
+
e?.parentKey,
|
|
2791
|
+
e ? Zt(e.key) : !1,
|
|
2792
|
+
e ? Qt(e.key) : !1,
|
|
2793
|
+
e ? d.value === e.key : !1,
|
|
2794
|
+
e ? _r(e.key) : void 0,
|
|
2795
|
+
e ? pt.value === e.key : !1,
|
|
2796
|
+
e ? _t(e.key) : void 0,
|
|
2797
|
+
n,
|
|
2798
|
+
r,
|
|
2799
|
+
a,
|
|
2800
|
+
o,
|
|
2801
|
+
s,
|
|
2802
|
+
c,
|
|
2803
|
+
l,
|
|
2804
|
+
he.value,
|
|
2805
|
+
xn.value,
|
|
2806
|
+
wn.value,
|
|
2807
|
+
u,
|
|
2808
|
+
i.loadingMoreChildrenKeys,
|
|
2809
|
+
i.treeIndent,
|
|
2810
|
+
i.rowClass,
|
|
2811
|
+
i.rowState,
|
|
2812
|
+
i.selectable,
|
|
2813
|
+
i.cascadeSelection,
|
|
2814
|
+
i.rowsDraggable
|
|
2815
|
+
], rn = (e) => {
|
|
2816
|
+
if (e !== void 0) return { "--s-ui-table-stuck-cover-height": `${e}px` };
|
|
2817
|
+
}, on = _(() => Tt.value.map((e) => {
|
|
2818
|
+
let t = e.row?.kind === Q.ROW && !$e(e.row.key);
|
|
2819
|
+
return {
|
|
2820
|
+
...e,
|
|
2821
|
+
placeholder: t,
|
|
2822
|
+
memoKeys: nn(e, t)
|
|
2823
|
+
};
|
|
2824
|
+
})), gn = _(() => Object.keys(V).filter((e) => e.startsWith("cell:"))), vn = (e) => `s-ui-table-${ae}-row-${e}`, bn = (e) => ({
|
|
2825
|
+
...e,
|
|
2826
|
+
selected: Zt(e.key),
|
|
2827
|
+
indeterminate: !1,
|
|
2828
|
+
active: d.value === e.key,
|
|
2829
|
+
disabled: tn(e),
|
|
2830
|
+
group: e.kind === Q.GROUP,
|
|
2831
|
+
toggleExpanded: () => {
|
|
2832
|
+
xe(e.key);
|
|
2833
|
+
},
|
|
2834
|
+
toggleSelected: () => {
|
|
2835
|
+
en(e.key);
|
|
2836
|
+
}
|
|
2837
|
+
}), { depthFooterColumnKey: xn, groupColumnKey: Sn, creationColumnKey: Cn, loadMoreColumnKey: wn, getGroupCount: Tn, getGroupTotal: En, getGroupTitle: Dn, getDepthIndentStyle: On, emitDepthFooterClick: Zn, getDepthFooterSlotScope: Qn, isLoadMoreRowLoading: $n, emitLoadMoreChildren: er, getLoadMoreSlotScope: tr, getFooterValueText: nr, getFooterToneClass: rr, getFooterSlotScope: ir } = pn({
|
|
2838
|
+
columns: () => i.columns,
|
|
2839
|
+
primaryColumnKey: me,
|
|
2840
|
+
treeNodeByKey: _(() => ye.value.nodeByKey),
|
|
2841
|
+
groupTotalKey: () => i.groupTotalKey,
|
|
2842
|
+
depthFooter: () => i.depthFooter,
|
|
2843
|
+
groupContentColumnKey: () => i.groupContentColumnKey,
|
|
2844
|
+
creationContentColumnKey: () => i.creationContentColumnKey,
|
|
2845
|
+
loadMoreContentColumnKey: () => i.loadMoreContentColumnKey,
|
|
2846
|
+
treeIndent: () => i.treeIndent,
|
|
2847
|
+
loadingMoreChildrenKeys: () => i.loadingMoreChildrenKeys,
|
|
2848
|
+
footerValues: () => i.footerValues,
|
|
2849
|
+
stuckDepthFooterRowIndex: yt,
|
|
2850
|
+
onDepthFooterClick: (e) => {
|
|
2851
|
+
I("depthFooterClick", e);
|
|
2852
|
+
},
|
|
2853
|
+
onLoadMoreChildren: (e) => {
|
|
2854
|
+
I("loadMoreChildren", e);
|
|
2855
|
+
}
|
|
2856
|
+
}), ar = (e) => ({
|
|
2857
|
+
...bn(e),
|
|
2858
|
+
count: Tn(e),
|
|
2859
|
+
total: En(e)
|
|
2860
|
+
}), or = (e, t) => {
|
|
2861
|
+
tn(e) || (d.value = e.key, i.expandOnClick && (e.hasChildren || e.kind === Q.GROUP) && xe(e.key), I("rowClick", {
|
|
2862
|
+
key: e.key,
|
|
2863
|
+
item: e.item,
|
|
2864
|
+
event: t
|
|
2865
|
+
}));
|
|
2866
|
+
}, sr = (e, t) => {
|
|
2867
|
+
I("rowContextMenu", {
|
|
2868
|
+
key: e.key,
|
|
2869
|
+
item: e.item,
|
|
2870
|
+
event: t
|
|
2871
|
+
});
|
|
2872
|
+
}, cr = _(() => {
|
|
2873
|
+
let e = /* @__PURE__ */ new Set();
|
|
2874
|
+
return he.value.forEach((t) => {
|
|
2875
|
+
t.column && e.add(t.key);
|
|
2876
|
+
}), e;
|
|
2877
|
+
}), lr = (e, t, n) => {
|
|
2878
|
+
!cr.value.has(t) || tn(e) || I("cellClick", {
|
|
2879
|
+
key: e.key,
|
|
2880
|
+
item: e.item,
|
|
2881
|
+
columnKey: t,
|
|
2882
|
+
event: n
|
|
2883
|
+
});
|
|
2884
|
+
}, ur = (e) => e ? !tn(e) : !1, dr = _(() => {
|
|
2885
|
+
let e = pe.value - 40 - Re.value;
|
|
2886
|
+
return Math.max(1, Math.floor(e / i.estimateRowSize));
|
|
2887
|
+
});
|
|
2888
|
+
l(() => K.value, {
|
|
2889
|
+
distance: () => i.endReachedDistance,
|
|
2890
|
+
canLoadMore: () => i.canLoadMore?.() ?? !0,
|
|
2891
|
+
onEndReached: () => {
|
|
2892
|
+
I("endReached", { direction: "bottom" });
|
|
2893
|
+
}
|
|
2894
|
+
});
|
|
2895
|
+
let fr = (e, t) => {
|
|
2896
|
+
let n = be.value.getRowIndexByKey(e);
|
|
2897
|
+
if (n !== void 0) {
|
|
2898
|
+
if (Ie.value) {
|
|
2899
|
+
Ke(n, t?.align ?? "auto");
|
|
2900
|
+
return;
|
|
2901
|
+
}
|
|
2902
|
+
document.getElementById(vn(e))?.scrollIntoView({ block: t?.align === "center" ? "center" : "nearest" });
|
|
2903
|
+
}
|
|
2904
|
+
}, pr = (e) => `s-ui-table-${ae}-cell-${e.section}-${e.rowKey ?? ""}-${e.columnKey}`, mr = ct({
|
|
2905
|
+
tableRootElement: de,
|
|
2906
|
+
tableElement: le,
|
|
2907
|
+
scrollElement: K,
|
|
2908
|
+
columnDescriptors: he,
|
|
2909
|
+
flatRows: q,
|
|
2910
|
+
snapshot: be,
|
|
2911
|
+
groupColumnKey: Sn,
|
|
2912
|
+
depthFooterColumnKey: xn,
|
|
2913
|
+
loadMoreColumnKey: wn,
|
|
2914
|
+
creationColumnKey: Cn,
|
|
2915
|
+
hasCreationRow: () => !!i.creationRow,
|
|
2916
|
+
hasAggregateRow: () => !!i.footerValues,
|
|
2917
|
+
isRowNavigable: ur,
|
|
2918
|
+
pageSize: dr,
|
|
2919
|
+
buildCellDomId: pr,
|
|
2920
|
+
onBodyRowFocused: (e) => {
|
|
2921
|
+
d.value = e;
|
|
2922
|
+
},
|
|
2923
|
+
scrollToRowIndex: (e) => {
|
|
2924
|
+
let t = q.value[e];
|
|
2925
|
+
t && fr(t.key);
|
|
2926
|
+
}
|
|
2927
|
+
}), hr = `s-ui-table-${ae}-cell-${$.BODY}-`, gr = `s-ui-table-${ae}-cell-${$.CREATION}-`, _r = (e) => mr.focusedBodyRowKey.value === e ? mr.focusAddress.value.columnKey : void 0, vr = (e) => {
|
|
2928
|
+
let t = mr.focusAddress.value;
|
|
2929
|
+
return t.section === e ? t.columnKey : void 0;
|
|
2930
|
+
}, yr = (e, t, n) => mr.getCellTabIndex(e, t, n), { handleGridFocusIn: br, handleGridKeydown: xr } = ln({
|
|
2931
|
+
gridFocus: mr,
|
|
2932
|
+
columnDescriptors: he,
|
|
2933
|
+
flatRows: q,
|
|
2934
|
+
expandColumnKey: () => i.expandColumnKey,
|
|
2935
|
+
primaryColumnKey: me,
|
|
2936
|
+
groupColumnKey: Sn,
|
|
2937
|
+
selectable: () => i.selectable,
|
|
2938
|
+
openMenuColumnKey: Rt,
|
|
2939
|
+
toggleExpanded: xe,
|
|
2940
|
+
toggleRowSelected: (e) => {
|
|
2941
|
+
Jt.toggleRow(e);
|
|
2942
|
+
},
|
|
2943
|
+
applySortCycle: Nt,
|
|
2944
|
+
setColumnMenuOpen: Bt,
|
|
2945
|
+
resizeColumnByKeyboard: Vt,
|
|
2946
|
+
onDepthFooterActivate: Zn,
|
|
2947
|
+
onLoadMoreActivate: er,
|
|
2948
|
+
onRowActivate: (e, t) => {
|
|
2949
|
+
I("rowClick", {
|
|
2950
|
+
key: e.key,
|
|
2951
|
+
item: e.item,
|
|
2952
|
+
event: t
|
|
2953
|
+
});
|
|
2954
|
+
}
|
|
2955
|
+
});
|
|
2956
|
+
return a({
|
|
2957
|
+
focusNavigation: async () => {
|
|
2958
|
+
mr.focusAddressNow(mr.focusAddress.value), await A();
|
|
2959
|
+
},
|
|
2960
|
+
scrollToRow: fr,
|
|
2961
|
+
expandAll: Se,
|
|
2962
|
+
collapseAll: Ce,
|
|
2963
|
+
clearSelection: () => {
|
|
2964
|
+
Jt.clearSelection();
|
|
2965
|
+
},
|
|
2966
|
+
getScrollElement: () => K.value ?? void 0
|
|
2967
|
+
}), (a, l) => (F(), b("div", {
|
|
2968
|
+
ref_key: "tableRootRef",
|
|
2969
|
+
ref: de,
|
|
2970
|
+
class: j(["s-ui-table", Le.value]),
|
|
2971
|
+
style: M(U(Dt))
|
|
2972
|
+
}, [x("div", {
|
|
2973
|
+
ref_key: "scrollElementRef",
|
|
2974
|
+
ref: K,
|
|
2975
|
+
class: "s-ui-table__scroll",
|
|
2976
|
+
style: M(U(kt))
|
|
2977
|
+
}, [x("table", {
|
|
2978
|
+
class: "s-ui-table__table",
|
|
2979
|
+
style: M(U(At)),
|
|
2980
|
+
role: Pe.value,
|
|
2981
|
+
"aria-rowcount": Fe.value,
|
|
2982
|
+
"aria-colcount": U(ve),
|
|
2983
|
+
"aria-busy": i.loading || i.loadingMore || void 0,
|
|
2984
|
+
ref_key: "tableElementRef",
|
|
2985
|
+
ref: le,
|
|
2986
|
+
tabindex: "-1",
|
|
2987
|
+
onKeydown: l[5] ||= (...e) => U(xr) && U(xr)(...e),
|
|
2988
|
+
onFocusin: l[6] ||= (...e) => U(br) && U(br)(...e)
|
|
2989
|
+
}, [
|
|
2990
|
+
x("colgroup", null, [
|
|
2991
|
+
(F(!0), b(g, null, L(U(we), (e) => (F(), b("col", {
|
|
2992
|
+
key: e.key,
|
|
2993
|
+
style: M({ width: `var(${e.liveWidthVar}, var(${e.widthVar}))` })
|
|
2994
|
+
}, null, 4))), 128)),
|
|
2995
|
+
l[7] ||= x("col", { class: "s-ui-table__filler-col" }, null, -1),
|
|
2996
|
+
(F(!0), b(g, null, L(U(Te), (e) => (F(), b("col", {
|
|
2997
|
+
key: e.key,
|
|
2998
|
+
style: M({ width: `var(${e.liveWidthVar}, var(${e.widthVar}))` })
|
|
2999
|
+
}, null, 4))), 128))
|
|
3000
|
+
]),
|
|
3001
|
+
x("thead", jn, [x("tr", Mn, [(F(!0), b(g, null, L(U(Ee), ({ key: i, descriptor: u }) => (F(), b(g, { key: i }, [u ? (F(), b("th", {
|
|
3002
|
+
key: 1,
|
|
3003
|
+
id: pr({
|
|
3004
|
+
section: U($).HEADER,
|
|
3005
|
+
columnKey: u.key
|
|
3006
|
+
}),
|
|
3007
|
+
ref_for: !0,
|
|
3008
|
+
ref: (e) => dt(e, u.key),
|
|
3009
|
+
class: j(["s-ui-table__header-cell", [U(De)(u), { "s-ui-table__header-cell--dragging": U(lt) === u.key }]]),
|
|
3010
|
+
style: M(U(J)(u)),
|
|
3011
|
+
"data-column-key": u.key,
|
|
3012
|
+
"data-section": U($).HEADER,
|
|
3013
|
+
"aria-colindex": u.colIndex,
|
|
3014
|
+
"aria-sort": U(It)(u),
|
|
3015
|
+
tabindex: yr(U($).HEADER, void 0, u.key),
|
|
3016
|
+
scope: "col"
|
|
3017
|
+
}, [u.column ? (F(), v(Ct, {
|
|
3018
|
+
key: 0,
|
|
3019
|
+
descriptor: u,
|
|
3020
|
+
"sort-direction": U(jt)(u.key),
|
|
3021
|
+
"sort-index": U(Mt)(u.key),
|
|
3022
|
+
"menu-open": Rt.value === u.key,
|
|
3023
|
+
"onUpdate:menuOpen": (e) => Bt(u.key, e),
|
|
3024
|
+
onSortToggle: (e) => U(Nt)(u.key, e),
|
|
3025
|
+
onSortSet: (e) => U(Pt)(u.key, e),
|
|
3026
|
+
onHide: (e) => qt(u.key)
|
|
3027
|
+
}, S({ _: 2 }, [U(V)[`header:${u.key}`] ? {
|
|
3028
|
+
name: "default",
|
|
3029
|
+
fn: G(() => [R(a.$slots, `header:${u.key}`, k({ ref_for: !0 }, U(Lt)(u)))]),
|
|
3030
|
+
key: "0"
|
|
3031
|
+
} : void 0, U(V)[`header-menu:${u.key}`] ? {
|
|
3032
|
+
name: "menu",
|
|
3033
|
+
fn: G(() => [R(a.$slots, `header-menu:${u.key}`, k({ ref_for: !0 }, U(Lt)(u)))]),
|
|
3034
|
+
key: "1"
|
|
3035
|
+
} : void 0]), 1032, [
|
|
3036
|
+
"descriptor",
|
|
3037
|
+
"sort-direction",
|
|
3038
|
+
"sort-index",
|
|
3039
|
+
"menu-open",
|
|
3040
|
+
"onUpdate:menuOpen",
|
|
3041
|
+
"onSortToggle",
|
|
3042
|
+
"onSortSet",
|
|
3043
|
+
"onHide"
|
|
3044
|
+
])) : u.service === U(Ue).CHECKBOX ? (F(), v(Be, {
|
|
3045
|
+
key: 1,
|
|
3046
|
+
class: j(["s-ui-table__header-checkbox", { "s-ui-table__header-checkbox--active": U(Yt) !== U(Z).UNCHECKED }]),
|
|
3047
|
+
"model-value": U(Yt) === U(Z).CHECKED,
|
|
3048
|
+
indeterminate: U(Yt) === U(Z).INDETERMINATE,
|
|
3049
|
+
"screen-reader-label": U(Yt) === U(Z).CHECKED ? U(H)("table.deselectAll") : U(H)("table.selectAll"),
|
|
3050
|
+
"onUpdate:modelValue": l[0] ||= (e) => U(Jt).toggleSelectAll()
|
|
3051
|
+
}, null, 8, [
|
|
3052
|
+
"class",
|
|
3053
|
+
"model-value",
|
|
3054
|
+
"indeterminate",
|
|
3055
|
+
"screen-reader-label"
|
|
3056
|
+
])) : u.service === U(Ue).COLUMNS_MANAGER ? (F(), b("div", Fn, [w(U(s), {
|
|
3057
|
+
modelValue: Ht.value,
|
|
3058
|
+
"onUpdate:modelValue": l[1] ||= (e) => Ht.value = e,
|
|
3059
|
+
placement: U(o).BOTTOM_END,
|
|
3060
|
+
shift: "",
|
|
3061
|
+
"fit-viewport": ""
|
|
3062
|
+
}, {
|
|
3063
|
+
trigger: G(({ toggle: i }) => [w(U(r), {
|
|
3064
|
+
class: "s-ui-table__columns-manager-button",
|
|
3065
|
+
appearance: U(n).BARE,
|
|
3066
|
+
variant: U(t).NEUTRAL,
|
|
3067
|
+
size: U(e).SMALL,
|
|
3068
|
+
icon: "tablePlus",
|
|
3069
|
+
"aria-label": U(H)("table.manageColumns"),
|
|
3070
|
+
tabindex: "-1",
|
|
3071
|
+
onClick: (e) => i()
|
|
3072
|
+
}, null, 8, [
|
|
3073
|
+
"appearance",
|
|
3074
|
+
"variant",
|
|
3075
|
+
"size",
|
|
3076
|
+
"aria-label",
|
|
3077
|
+
"onClick"
|
|
3078
|
+
])]),
|
|
3079
|
+
content: G(() => [w(U(c), {
|
|
3080
|
+
class: "s-ui-table__columns-menu",
|
|
3081
|
+
width: 300
|
|
3082
|
+
}, {
|
|
3083
|
+
default: G(() => [R(a.$slots, "columns-menu", {
|
|
3084
|
+
columns: Ut.value,
|
|
3085
|
+
isColumnHidden: Wt,
|
|
3086
|
+
toggleColumn: Kt
|
|
3087
|
+
}, () => [(F(!0), b(g, null, L(Gt.value, (e, t) => (F(), b(g, { key: t }, [t > 0 ? (F(), v(U(se), {
|
|
3088
|
+
key: 0,
|
|
3089
|
+
class: "s-ui-table__columns-separator"
|
|
3090
|
+
})) : y("", !0), (F(!0), b(g, null, L(e, (e) => (F(), v(U(h), {
|
|
3091
|
+
key: e.column.key,
|
|
3092
|
+
class: j(["s-ui-table__columns-item", e.classes]),
|
|
3093
|
+
size: U(m).SMALL,
|
|
3094
|
+
"label-placement": U(p).LEFT,
|
|
3095
|
+
"model-value": !e.hidden,
|
|
3096
|
+
"onUpdate:modelValue": (t) => Kt(e.column.key)
|
|
3097
|
+
}, {
|
|
3098
|
+
default: G(() => [x("span", In, [e.column.icon ? (F(), v(U(oe), {
|
|
3099
|
+
key: 0,
|
|
3100
|
+
name: e.column.icon,
|
|
3101
|
+
size: 16
|
|
3102
|
+
}, null, 8, ["name"])) : y("", !0), x("span", Ln, B(e.column.title ?? e.column.key), 1)])]),
|
|
3103
|
+
_: 2
|
|
3104
|
+
}, 1032, [
|
|
3105
|
+
"class",
|
|
3106
|
+
"size",
|
|
3107
|
+
"label-placement",
|
|
3108
|
+
"model-value",
|
|
3109
|
+
"onUpdate:modelValue"
|
|
3110
|
+
]))), 128))], 64))), 128))])]),
|
|
3111
|
+
_: 3
|
|
3112
|
+
})]),
|
|
3113
|
+
_: 3
|
|
3114
|
+
}, 8, ["modelValue", "placement"])])) : y("", !0), u.resizable ? (F(), b("span", {
|
|
3115
|
+
key: 3,
|
|
3116
|
+
class: j(["s-ui-table__resize-handle", { "s-ui-table__resize-handle--active": U(tt) === u.key }]),
|
|
3117
|
+
role: "separator",
|
|
3118
|
+
"aria-orientation": "vertical",
|
|
3119
|
+
"aria-label": U(H)("table.resizeColumn"),
|
|
3120
|
+
tabindex: "-1",
|
|
3121
|
+
onPointerdown: (e) => U(nt)(e, u.key),
|
|
3122
|
+
onKeydown: (e) => U(rt)(e, u.key),
|
|
3123
|
+
onDblclick: (e) => U(at)(u.key),
|
|
3124
|
+
onClick: l[2] ||= ie(() => {}, ["stop"])
|
|
3125
|
+
}, null, 42, Rn)) : y("", !0)], 14, Pn)) : (F(), b("th", Nn))], 64))), 128))])]),
|
|
3126
|
+
x("tbody", zn, [
|
|
3127
|
+
Et.value ? (F(), b("tr", Bn, [x("td", {
|
|
3128
|
+
class: "s-ui-table__empty-cell",
|
|
3129
|
+
colspan: Me.value
|
|
3130
|
+
}, [x("div", Hn, [R(a.$slots, "empty", {}, () => [x("span", Un, B(U(H)("table.empty")), 1)])])], 8, Vn)])) : y("", !0),
|
|
3131
|
+
i.loading ? (F(!0), b(g, { key: 1 }, L(i.skeletonRowCount, (e) => (F(), v($t, {
|
|
3132
|
+
key: `skeleton-${e}`,
|
|
3133
|
+
"leading-plans": U(Y),
|
|
3134
|
+
"trailing-plans": U(Oe)
|
|
3135
|
+
}, S({ _: 2 }, [U(V)["skeleton-row"] ? {
|
|
3136
|
+
name: "default",
|
|
3137
|
+
fn: G((e) => [R(a.$slots, "skeleton-row", { column: e.descriptor.column })]),
|
|
3138
|
+
key: "0"
|
|
3139
|
+
} : void 0]), 1032, ["leading-plans", "trailing-plans"]))), 128)) : (F(!0), b(g, { key: 2 }, L(on.value, ({ row: o, renderKey: s, spacer: c, spacerHeight: l, rowHeight: u, stuckTop: f, stuckBottom: p, stuckBottomLeaving: m, stuckBottomSliding: h, stuckBottomCoverHeight: _, stuckBottomFar: T, placeholder: D, memoKeys: O }, A, N, P) => {
|
|
3140
|
+
let z = O;
|
|
3141
|
+
if (P && P.el && P.key === s && E(P, z)) return P;
|
|
3142
|
+
let ee = (F(), b(g, { key: s }, [c ? (F(), b("tr", Wn, [x("td", {
|
|
3143
|
+
class: "s-ui-table__spacer-cell",
|
|
3144
|
+
colspan: Me.value,
|
|
3145
|
+
style: M({ height: `${l}px` })
|
|
3146
|
+
}, null, 12, Gn)])) : o && o.kind === U(Q).GROUP ? (F(), v(ht, {
|
|
3147
|
+
key: 1,
|
|
3148
|
+
id: vn(o.key),
|
|
3149
|
+
stuck: f,
|
|
3150
|
+
row: o,
|
|
3151
|
+
"dnd-ref": i.rowsDraggable ? gt : void 0,
|
|
3152
|
+
dragging: U(pt) === o.key,
|
|
3153
|
+
"drop-position": _t(o.key),
|
|
3154
|
+
"row-index": o.index,
|
|
3155
|
+
"leading-plans": U(Y),
|
|
3156
|
+
"trailing-plans": U(Oe),
|
|
3157
|
+
"group-column-key": U(Sn),
|
|
3158
|
+
"tree-indent": i.treeIndent,
|
|
3159
|
+
count: U(Tn)(o),
|
|
3160
|
+
total: U(En)(o),
|
|
3161
|
+
title: U(Dn)(o),
|
|
3162
|
+
expanded: o.expanded,
|
|
3163
|
+
active: d.value === o.key,
|
|
3164
|
+
"cell-id-prefix": hr,
|
|
3165
|
+
"focus-column-key": _r(o.key),
|
|
3166
|
+
onToggle: (e) => U(xe)(o.key),
|
|
3167
|
+
onRowClick: (e) => or(o, e),
|
|
3168
|
+
onMenuOpen: (e) => I("groupMenuOpen", {
|
|
3169
|
+
key: o.key,
|
|
3170
|
+
item: o.item
|
|
3171
|
+
})
|
|
3172
|
+
}, S({ _: 2 }, [
|
|
3173
|
+
U(V)["group-menu"] ? {
|
|
3174
|
+
name: "menu",
|
|
3175
|
+
fn: G(() => [R(a.$slots, "group-menu", k({ ref_for: !0 }, ar(o)))]),
|
|
3176
|
+
key: "0"
|
|
3177
|
+
} : void 0,
|
|
3178
|
+
U(V)["group-row"] ? {
|
|
3179
|
+
name: "row",
|
|
3180
|
+
fn: G(() => [R(a.$slots, "group-row", k({ ref_for: !0 }, ar(o)))]),
|
|
3181
|
+
key: "1"
|
|
3182
|
+
} : void 0,
|
|
3183
|
+
U(V)["group-title"] ? {
|
|
3184
|
+
name: "title",
|
|
3185
|
+
fn: G(() => [R(a.$slots, "group-title", k({ ref_for: !0 }, ar(o)))]),
|
|
3186
|
+
key: "2"
|
|
3187
|
+
} : void 0,
|
|
3188
|
+
U(V)["group-actions"] ? {
|
|
3189
|
+
name: "actions",
|
|
3190
|
+
fn: G(() => [R(a.$slots, "group-actions", k({ ref_for: !0 }, ar(o)))]),
|
|
3191
|
+
key: "3"
|
|
3192
|
+
} : void 0
|
|
3193
|
+
]), 1032, [
|
|
3194
|
+
"id",
|
|
3195
|
+
"stuck",
|
|
3196
|
+
"row",
|
|
3197
|
+
"dnd-ref",
|
|
3198
|
+
"dragging",
|
|
3199
|
+
"drop-position",
|
|
3200
|
+
"row-index",
|
|
3201
|
+
"leading-plans",
|
|
3202
|
+
"trailing-plans",
|
|
3203
|
+
"group-column-key",
|
|
3204
|
+
"tree-indent",
|
|
3205
|
+
"count",
|
|
3206
|
+
"total",
|
|
3207
|
+
"title",
|
|
3208
|
+
"expanded",
|
|
3209
|
+
"active",
|
|
3210
|
+
"focus-column-key",
|
|
3211
|
+
"onToggle",
|
|
3212
|
+
"onRowClick",
|
|
3213
|
+
"onMenuOpen"
|
|
3214
|
+
])) : o && o.kind === U(Q).DEPTH_FOOTER ? (F(), v(He, {
|
|
3215
|
+
key: 2,
|
|
3216
|
+
class: j(["s-ui-table__depth-footer-row", {
|
|
3217
|
+
"s-ui-table__depth-footer-row--stuck": p,
|
|
3218
|
+
"s-ui-table__depth-footer-row--stuck-leaving": m,
|
|
3219
|
+
"s-ui-table__depth-footer-row--stuck-sliding": h,
|
|
3220
|
+
"s-ui-table__depth-footer-row--stuck-covered": _ !== void 0,
|
|
3221
|
+
"s-ui-table__depth-footer-row--stuck-covered-far": T
|
|
3222
|
+
}]),
|
|
3223
|
+
style: M(rn(_)),
|
|
3224
|
+
"data-index": o.index,
|
|
3225
|
+
"aria-rowindex": o.index + 2,
|
|
3226
|
+
cells: U(X),
|
|
3227
|
+
"content-column-key": U(xn),
|
|
3228
|
+
"cell-class": "s-ui-table__depth-footer-cell",
|
|
3229
|
+
"content-class": "s-ui-table__depth-footer-content",
|
|
3230
|
+
"content-style": U(On)(o.depth),
|
|
3231
|
+
section: U($).BODY,
|
|
3232
|
+
"row-key": o.key,
|
|
3233
|
+
"cell-id-prefix": hr,
|
|
3234
|
+
"focus-column-key": _r(o.key)
|
|
3235
|
+
}, {
|
|
3236
|
+
default: G(() => [R(a.$slots, "depth-footer", k({ ref_for: !0 }, U(Qn)(o)))]),
|
|
3237
|
+
_: 2
|
|
3238
|
+
}, 1032, [
|
|
3239
|
+
"class",
|
|
3240
|
+
"style",
|
|
3241
|
+
"data-index",
|
|
3242
|
+
"aria-rowindex",
|
|
3243
|
+
"cells",
|
|
3244
|
+
"content-column-key",
|
|
3245
|
+
"content-style",
|
|
3246
|
+
"section",
|
|
3247
|
+
"row-key",
|
|
3248
|
+
"focus-column-key"
|
|
3249
|
+
])) : o && o.kind === U(Q).LOAD_MORE ? (F(), v(He, {
|
|
3250
|
+
key: 3,
|
|
3251
|
+
class: "s-ui-table__load-more-row",
|
|
3252
|
+
"data-index": o.index,
|
|
3253
|
+
"aria-rowindex": o.index + 2,
|
|
3254
|
+
cells: U(X),
|
|
3255
|
+
"content-column-key": U(wn),
|
|
3256
|
+
"content-class": "s-ui-table__load-more-content",
|
|
3257
|
+
"content-style": U(On)(o.depth),
|
|
3258
|
+
section: U($).BODY,
|
|
3259
|
+
"row-key": o.key,
|
|
3260
|
+
"cell-id-prefix": hr,
|
|
3261
|
+
"focus-column-key": _r(o.key)
|
|
3262
|
+
}, {
|
|
3263
|
+
default: G(() => [R(a.$slots, "load-more", k({ ref_for: !0 }, U(tr)(o)), () => [w(U(r), {
|
|
3264
|
+
appearance: U(n).BARE,
|
|
3265
|
+
variant: U(t).NEUTRAL,
|
|
3266
|
+
size: U(e).SMALL,
|
|
3267
|
+
loading: U($n)(o),
|
|
3268
|
+
tabindex: "-1",
|
|
3269
|
+
onClick: (e) => U(er)(o)
|
|
3270
|
+
}, {
|
|
3271
|
+
default: G(() => [C(B(U(H)("table.loadMore")), 1)]),
|
|
3272
|
+
_: 1
|
|
3273
|
+
}, 8, [
|
|
3274
|
+
"appearance",
|
|
3275
|
+
"variant",
|
|
3276
|
+
"size",
|
|
3277
|
+
"loading",
|
|
3278
|
+
"onClick"
|
|
3279
|
+
])])]),
|
|
3280
|
+
_: 2
|
|
3281
|
+
}, 1032, [
|
|
3282
|
+
"data-index",
|
|
3283
|
+
"aria-rowindex",
|
|
3284
|
+
"cells",
|
|
3285
|
+
"content-column-key",
|
|
3286
|
+
"content-style",
|
|
3287
|
+
"section",
|
|
3288
|
+
"row-key",
|
|
3289
|
+
"focus-column-key"
|
|
3290
|
+
])) : o && D ? (F(), v(Ot, {
|
|
3291
|
+
key: 4,
|
|
3292
|
+
"row-index": o.index,
|
|
3293
|
+
"row-key": o.key,
|
|
3294
|
+
cells: U(X),
|
|
3295
|
+
"row-height": u
|
|
3296
|
+
}, null, 8, [
|
|
3297
|
+
"row-index",
|
|
3298
|
+
"row-key",
|
|
3299
|
+
"cells",
|
|
3300
|
+
"row-height"
|
|
3301
|
+
])) : o ? (F(), v(Xt, {
|
|
3302
|
+
key: 5,
|
|
3303
|
+
row: o,
|
|
3304
|
+
"row-index": o.index,
|
|
3305
|
+
"row-expanded": o.expanded,
|
|
3306
|
+
"leading-plans": U(Y),
|
|
3307
|
+
"trailing-plans": U(Oe),
|
|
3308
|
+
"dnd-ref": i.rowsDraggable ? gt : void 0,
|
|
3309
|
+
dragging: U(pt) === o.key,
|
|
3310
|
+
"drop-position": _t(o.key),
|
|
3311
|
+
"placeholder-height": u,
|
|
3312
|
+
"dom-id": vn(o.key),
|
|
3313
|
+
selected: Zt(o.key),
|
|
3314
|
+
indeterminate: Qt(o.key),
|
|
3315
|
+
"row-selectable": i.selectable && U(Jt).isNodeSelectable(o.key),
|
|
3316
|
+
active: d.value === o.key,
|
|
3317
|
+
disabled: tn(o),
|
|
3318
|
+
"tree-indent": i.treeIndent,
|
|
3319
|
+
"row-state": i.rowState?.(o.item),
|
|
3320
|
+
"extra-row-class": i.rowClass?.(o.item, o),
|
|
3321
|
+
"cell-id-prefix": hr,
|
|
3322
|
+
"focus-column-key": _r(o.key),
|
|
3323
|
+
onRowClick: (e) => or(o, e),
|
|
3324
|
+
onRowContextMenu: (e) => sr(o, e),
|
|
3325
|
+
onCellClick: (e, t) => lr(o, e, t),
|
|
3326
|
+
onToggleExpand: (e) => U(xe)(o.key),
|
|
3327
|
+
onToggleSelected: (e) => en(o.key)
|
|
3328
|
+
}, S({ _: 2 }, [
|
|
3329
|
+
L(gn.value, (e) => ({
|
|
3330
|
+
name: e,
|
|
3331
|
+
fn: G((t) => [R(a.$slots, e, k({ ref_for: !0 }, t))])
|
|
3332
|
+
})),
|
|
3333
|
+
U(V).chevron ? {
|
|
3334
|
+
name: "chevron",
|
|
3335
|
+
fn: G((e) => [R(a.$slots, "chevron", k({ ref_for: !0 }, e))]),
|
|
3336
|
+
key: "0"
|
|
3337
|
+
} : void 0,
|
|
3338
|
+
U(V)["cell-actions"] ? {
|
|
3339
|
+
name: "cell-actions",
|
|
3340
|
+
fn: G((e) => [R(a.$slots, "cell-actions", k({ ref_for: !0 }, e))]),
|
|
3341
|
+
key: "1"
|
|
3342
|
+
} : void 0,
|
|
3343
|
+
U(V).indicator ? {
|
|
3344
|
+
name: "indicator",
|
|
3345
|
+
fn: G((e) => [R(a.$slots, "indicator", k({ ref_for: !0 }, e))]),
|
|
3346
|
+
key: "2"
|
|
3347
|
+
} : void 0,
|
|
3348
|
+
U(V).checkbox ? {
|
|
3349
|
+
name: "checkbox",
|
|
3350
|
+
fn: G((e) => [R(a.$slots, "checkbox", k({ ref_for: !0 }, e))]),
|
|
3351
|
+
key: "3"
|
|
3352
|
+
} : void 0,
|
|
3353
|
+
U(V)["right-edge"] ? {
|
|
3354
|
+
name: "right-edge",
|
|
3355
|
+
fn: G((e) => [R(a.$slots, "right-edge", k({ ref_for: !0 }, e))]),
|
|
3356
|
+
key: "4"
|
|
3357
|
+
} : void 0
|
|
3358
|
+
]), 1032, [
|
|
3359
|
+
"row",
|
|
3360
|
+
"row-index",
|
|
3361
|
+
"row-expanded",
|
|
3362
|
+
"leading-plans",
|
|
3363
|
+
"trailing-plans",
|
|
3364
|
+
"dnd-ref",
|
|
3365
|
+
"dragging",
|
|
3366
|
+
"drop-position",
|
|
3367
|
+
"placeholder-height",
|
|
3368
|
+
"dom-id",
|
|
3369
|
+
"selected",
|
|
3370
|
+
"indeterminate",
|
|
3371
|
+
"row-selectable",
|
|
3372
|
+
"active",
|
|
3373
|
+
"disabled",
|
|
3374
|
+
"tree-indent",
|
|
3375
|
+
"row-state",
|
|
3376
|
+
"extra-row-class",
|
|
3377
|
+
"focus-column-key",
|
|
3378
|
+
"onRowClick",
|
|
3379
|
+
"onRowContextMenu",
|
|
3380
|
+
"onCellClick",
|
|
3381
|
+
"onToggleExpand",
|
|
3382
|
+
"onToggleSelected"
|
|
3383
|
+
])) : y("", !0)], 64));
|
|
3384
|
+
return ee.memo = z, ee;
|
|
3385
|
+
}, l, 3), 128)),
|
|
3386
|
+
i.loadingMore && !i.loading ? (F(!0), b(g, { key: 3 }, L(Math.min(3, i.skeletonRowCount), (e) => (F(), v($t, {
|
|
3387
|
+
key: `skeleton-more-${e}`,
|
|
3388
|
+
"leading-plans": U(Y),
|
|
3389
|
+
"trailing-plans": U(Oe)
|
|
3390
|
+
}, S({ _: 2 }, [U(V)["skeleton-row"] ? {
|
|
3391
|
+
name: "default",
|
|
3392
|
+
fn: G((e) => [R(a.$slots, "skeleton-row", { column: e.descriptor.column })]),
|
|
3393
|
+
key: "0"
|
|
3394
|
+
} : void 0]), 1032, ["leading-plans", "trailing-plans"]))), 128)) : y("", !0)
|
|
3395
|
+
]),
|
|
3396
|
+
i.creationRow || i.footerValues ? (F(), b("tfoot", Kn, [i.creationRow ? (F(), v(He, {
|
|
3397
|
+
key: 0,
|
|
3398
|
+
class: "s-ui-table__create-row",
|
|
3399
|
+
"aria-rowindex": U(q).length + 2,
|
|
3400
|
+
cells: U(X),
|
|
3401
|
+
"content-column-key": U(Cn),
|
|
3402
|
+
"cell-class": "s-ui-table__create-cell",
|
|
3403
|
+
"content-class": "s-ui-table__create-content",
|
|
3404
|
+
section: U($).CREATION,
|
|
3405
|
+
"cell-id-prefix": gr,
|
|
3406
|
+
"focus-column-key": vr(U($).CREATION)
|
|
3407
|
+
}, {
|
|
3408
|
+
default: G(() => [R(a.$slots, "creation-row")]),
|
|
3409
|
+
_: 3
|
|
3410
|
+
}, 8, [
|
|
3411
|
+
"aria-rowindex",
|
|
3412
|
+
"cells",
|
|
3413
|
+
"content-column-key",
|
|
3414
|
+
"section",
|
|
3415
|
+
"focus-column-key"
|
|
3416
|
+
])) : y("", !0), i.footerValues ? (F(), b("tr", {
|
|
3417
|
+
key: 1,
|
|
3418
|
+
class: "s-ui-table__aggregate-row",
|
|
3419
|
+
"aria-rowindex": U(q).length + 2 + +!!i.creationRow
|
|
3420
|
+
}, [(F(!0), b(g, null, L(U(X), ({ key: e, cellPlan: t }) => (F(), b(g, { key: e }, [t ? (F(), b("td", {
|
|
3421
|
+
key: 1,
|
|
3422
|
+
id: pr({
|
|
3423
|
+
section: U($).AGGREGATE,
|
|
3424
|
+
columnKey: t.descriptor.key
|
|
3425
|
+
}),
|
|
3426
|
+
class: j(["s-ui-table__aggregate-cell", [t.cellClass, U(rr)(t.descriptor.key)]]),
|
|
3427
|
+
style: M(t.style),
|
|
3428
|
+
"aria-colindex": t.descriptor.colIndex,
|
|
3429
|
+
"data-column-key": t.descriptor.key,
|
|
3430
|
+
"data-section": U($).AGGREGATE,
|
|
3431
|
+
tabindex: yr(U($).AGGREGATE, void 0, t.descriptor.key)
|
|
3432
|
+
}, [t.descriptor.column ? (F(), b(g, { key: 0 }, [U(V)[`footer:${t.descriptor.key}`] ? R(a.$slots, `footer:${t.descriptor.key}`, k({
|
|
3433
|
+
key: 0,
|
|
3434
|
+
ref_for: !0
|
|
3435
|
+
}, U(ir)(t.descriptor.key))) : (F(), b("span", Xn, B(U(nr)(t.descriptor.key)), 1))], 64)) : y("", !0)], 14, Yn)) : (F(), b("td", Jn))], 64))), 128))], 8, qn)) : y("", !0)])) : y("", !0)
|
|
3436
|
+
], 44, An)], 4), U(ut) ? (F(), b("div", {
|
|
3437
|
+
key: 0,
|
|
3438
|
+
class: "s-ui-table__column-drop-line",
|
|
3439
|
+
style: M(U(ut)),
|
|
3440
|
+
"aria-hidden": "true"
|
|
3441
|
+
}, null, 4)) : y("", !0)], 6));
|
|
3442
|
+
}
|
|
3443
|
+
});
|
|
3444
|
+
//#endregion
|
|
3445
|
+
export { J as a, ke as c, Ae as d, Y as f, De as i, Q as l, X as n, je as o, Z as r, Me as s, Zn as t, Oe as u };
|