hys-ui 0.1.1 → 0.2.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 +111 -0
- package/README.md +3 -1
- package/dist/components/HysAccordion/HysAccordion.vue.js +1 -1
- package/dist/components/HysAccordion/HysAccordion2.vue.js +181 -47
- package/dist/components/HysAutocomplete/HysAutocomplete.vue.js +7 -0
- package/dist/components/HysAutocomplete/HysAutocomplete2.vue.js +627 -0
- package/dist/components/HysAvatar/HysAvatar.vue.js +5 -35
- package/dist/components/HysAvatar/HysAvatar2.vue.js +221 -2
- package/dist/components/HysAvatarGroup/HysAvatarGroup.vue.js +7 -0
- package/dist/components/HysAvatarGroup/HysAvatarGroup2.vue.js +252 -0
- package/dist/components/HysBadge/HysBadge.vue.js +2 -2
- package/dist/components/HysBadge/HysBadge2.vue.js +154 -27
- package/dist/components/HysBreadcrumb/HysBreadcrumb.vue.js +5 -38
- package/dist/components/HysBreadcrumb/HysBreadcrumb2.vue.js +74 -2
- package/dist/components/HysButton/HysButton.vue.js +2 -2
- package/dist/components/HysButton/HysButton2.vue.js +29 -28
- package/dist/components/HysCalendar/HysCalendar.vue.js +5 -92
- package/dist/components/HysCalendar/HysCalendar2.vue.js +803 -2
- package/dist/components/HysCard/HysCard.vue.js +2 -2
- package/dist/components/HysCard/HysCard2.vue.js +175 -42
- package/dist/components/HysCascader/HysCascader.vue.js +5 -194
- package/dist/components/HysCascader/HysCascader2.vue.js +760 -2
- package/dist/components/HysCascader/HysCascaderColumn.vue.js +7 -0
- package/dist/components/HysCascader/HysCascaderColumn2.vue.js +232 -0
- package/dist/components/HysCheckbox/HysCheckbox.vue.js +3 -3
- package/dist/components/HysCheckbox/HysCheckbox2.vue.js +180 -65
- package/dist/components/HysCheckboxGroup/HysCheckboxGroup.vue.js +7 -0
- package/dist/components/HysCheckboxGroup/HysCheckboxGroup2.vue.js +237 -0
- package/dist/components/HysColorPicker/HysColorPicker.vue.js +2 -2
- package/dist/components/HysColorPicker/HysColorPicker2.vue.js +107 -106
- package/dist/components/HysDataGrid/HysDataGrid.vue.js +1 -1
- package/dist/components/HysDataGrid/HysDataGrid2.vue.js +399 -392
- package/dist/components/HysDatePicker/HysDatePicker.vue.js +268 -139
- package/dist/components/HysDatePicker/HysDatePickerControl.vue.js +7 -0
- package/dist/components/HysDatePicker/HysDatePickerControl2.vue.js +807 -0
- package/dist/components/HysDatePicker/HysDatePickerPanel.vue.js +7 -0
- package/dist/components/HysDatePicker/HysDatePickerPanel2.vue.js +357 -0
- package/dist/components/HysDateRangePicker/HysDateRangePicker.vue.js +268 -158
- package/dist/components/HysDivider/HysDivider.vue.js +2 -2
- package/dist/components/HysDivider/HysDivider2.vue.js +33 -13
- package/dist/components/HysFileManager/HysFileManager.vue.js +3 -3
- package/dist/components/HysFileManager/HysFileManager2.vue.js +43 -42
- package/dist/components/HysForm/HysForm.vue.js +3 -3
- package/dist/components/HysForm/HysForm2.vue.js +578 -92
- package/dist/components/HysFormItem/HysFormItem.vue.js +5 -85
- package/dist/components/HysFormItem/HysFormItem2.vue.js +521 -2
- package/dist/components/HysGantt/HysGantt.vue.js +1 -1
- package/dist/components/HysGantt/HysGantt2.vue.js +1369 -272
- package/dist/components/HysInput/HysInput.vue.js +2 -2
- package/dist/components/HysInput/HysInput2.vue.js +467 -120
- package/dist/components/HysMention/HysMention.vue.js +2 -2
- package/dist/components/HysMention/HysMention2.vue.js +89 -88
- package/dist/components/HysNumberInput/HysNumberInput.vue.js +2 -2
- package/dist/components/HysNumberInput/HysNumberInput2.vue.js +561 -79
- package/dist/components/HysOrgTree/HysOrgTree.vue.js +29 -26
- package/dist/components/HysPagination/HysPagination.vue.js +1 -1
- package/dist/components/HysPagination/HysPagination2.vue.js +2 -0
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix.vue.js +2 -2
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix2.vue.js +52 -51
- package/dist/components/HysRadio/HysRadio.vue.js +7 -0
- package/dist/components/HysRadio/HysRadio2.vue.js +180 -0
- package/dist/components/HysRadioGroup/HysRadioGroup.vue.js +2 -2
- package/dist/components/HysRadioGroup/HysRadioGroup2.vue.js +190 -65
- package/dist/components/HysRating/HysRating.vue.js +1 -1
- package/dist/components/HysRating/HysRating2.vue.js +288 -68
- package/dist/components/HysRichTextEditor/HysRichTextEditor.vue.js +1 -1
- package/dist/components/HysRichTextEditor/HysRichTextEditor2.vue.js +70 -69
- package/dist/components/HysSearch/HysSearch.vue.js +37 -36
- package/dist/components/HysSegmented/HysSegmented.vue.js +5 -63
- package/dist/components/HysSegmented/HysSegmented2.vue.js +273 -2
- package/dist/components/HysSelect/HysSelect.vue.js +3 -2
- package/dist/components/HysSelect/HysSelect2.vue.js +859 -185
- package/dist/components/HysSkeleton/HysSkeleton.vue.js +2 -2
- package/dist/components/HysSkeleton/HysSkeleton2.vue.js +126 -29
- package/dist/components/HysSlider/HysSlider.vue.js +2 -2
- package/dist/components/HysSlider/HysSlider2.vue.js +532 -59
- package/dist/components/HysSlider/SliderTooltip.vue.js +7 -0
- package/dist/components/HysSlider/SliderTooltip2.vue.js +156 -0
- package/dist/components/HysSteps/HysSteps.vue.js +1 -1
- package/dist/components/HysSteps/HysSteps2.vue.js +110 -36
- package/dist/components/HysSwitch/HysSwitch.vue.js +2 -2
- package/dist/components/HysSwitch/HysSwitch2.vue.js +232 -50
- package/dist/components/HysTable/HysTable.vue.js +2 -2
- package/dist/components/HysTable/HysTable2.vue.js +1473 -88
- package/dist/components/HysTable/HysTableFilterOptions.vue.js +7 -0
- package/dist/components/HysTable/HysTableFilterOptions2.vue.js +133 -0
- package/dist/components/HysTabs/HysTabs.vue.js +2 -2
- package/dist/components/HysTabs/HysTabs2.vue.js +262 -68
- package/dist/components/HysTagInput/HysTagInput.vue.js +43 -42
- package/dist/components/HysTextarea/HysTextarea.vue.js +138 -77
- package/dist/components/HysTransfer/HysTransfer.vue.js +5 -223
- package/dist/components/HysTransfer/HysTransfer2.vue.js +416 -2
- package/dist/components/HysTransfer/HysTransferPanel.vue.js +7 -0
- package/dist/components/HysTransfer/HysTransferPanel2.vue.js +454 -0
- package/dist/components/HysTree/HysTree.vue.js +2 -3
- package/dist/components/HysTree/HysTree2.vue.js +641 -302
- package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +5 -136
- package/dist/components/HysTreeSelect/HysTreeSelect2.vue.js +558 -2
- package/dist/components/HysTreeSelect/HysTreeSelectPanel.vue.js +7 -0
- package/dist/components/HysTreeSelect/HysTreeSelectPanel2.vue.js +323 -0
- package/dist/components/HysUpload/HysUpload.vue.js +2 -2
- package/dist/components/HysUpload/HysUpload2.vue.js +77 -76
- package/dist/composables/autocomplete.js +50 -0
- package/dist/composables/avatar.js +57 -0
- package/dist/composables/calendar.js +96 -0
- package/dist/composables/cascader.js +79 -0
- package/dist/composables/choice.js +38 -0
- package/dist/composables/choiceModel.js +67 -0
- package/dist/composables/datePicker.js +227 -0
- package/dist/composables/formContext.js +92 -7
- package/dist/composables/formLayout.js +57 -0
- package/dist/composables/formValidation.js +240 -0
- package/dist/composables/ganttConflicts.js +143 -0
- package/dist/composables/numberInput.js +91 -0
- package/dist/composables/rating.js +16 -0
- package/dist/composables/selectOptions.js +54 -0
- package/dist/composables/table.js +150 -0
- package/dist/composables/textInput.js +34 -0
- package/dist/composables/transfer.js +63 -0
- package/dist/composables/tree.js +118 -0
- package/dist/composables/treeSelect.js +71 -0
- package/dist/composables/useCascader.js +438 -0
- package/dist/composables/useDatePicker.js +425 -0
- package/dist/composables/useFloating.js +97 -51
- package/dist/composables/useGanttDependencies.js +306 -0
- package/dist/composables/useGanttHistory.js +157 -0
- package/dist/composables/useGanttLabelResize.js +100 -0
- package/dist/composables/useTable.js +474 -0
- package/dist/composables/useTextareaSize.js +72 -0
- package/dist/composables/useTransfer.js +257 -0
- package/dist/composables/useTree.js +439 -0
- package/dist/composables/useTreeSelect.js +361 -0
- package/dist/index.js +149 -139
- package/dist/style.css +1 -1
- package/dist/types/components/HysAccordion/HysAccordion.vue.d.ts +61 -22
- package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +201 -0
- package/dist/types/components/HysAvatar/HysAvatar.vue.d.ts +28 -15
- package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +99 -0
- package/dist/types/components/HysBadge/HysBadge.vue.d.ts +41 -4
- package/dist/types/components/HysBreadcrumb/HysBreadcrumb.vue.d.ts +38 -10
- package/dist/types/components/HysButton/HysButton.vue.d.ts +0 -1
- package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +119 -31
- package/dist/types/components/HysCard/HysCard.vue.d.ts +55 -7
- package/dist/types/components/HysCascader/HysCascader.vue.d.ts +129 -41
- package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +55 -0
- package/dist/types/components/HysCheckbox/HysCheckbox.vue.d.ts +50 -39
- package/dist/types/components/HysCheckboxGroup/HysCheckboxGroup.vue.d.ts +73 -0
- package/dist/types/components/HysDataGrid/HysDataGrid.vue.d.ts +1 -1
- package/dist/types/components/HysDatePicker/HysDatePicker.vue.d.ts +66 -14
- package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +90 -0
- package/dist/types/components/HysDatePicker/HysDatePickerPanel.vue.d.ts +93 -0
- package/dist/types/components/HysDateRangePicker/HysDateRangePicker.vue.d.ts +66 -14
- package/dist/types/components/HysDivider/HysDivider.vue.d.ts +8 -3
- package/dist/types/components/HysFileManager/HysFileManager.vue.d.ts +2 -2
- package/dist/types/components/HysForm/HysForm.vue.d.ts +110 -18
- package/dist/types/components/HysFormItem/HysFormItem.vue.d.ts +108 -2
- package/dist/types/components/HysGantt/HysGantt.vue.d.ts +82 -4
- package/dist/types/components/HysInput/HysInput.vue.d.ts +52 -29
- package/dist/types/components/HysMention/HysMention.vue.d.ts +2 -2
- package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +93 -35
- package/dist/types/components/HysOrgTree/HysOrgTree.vue.d.ts +1 -0
- package/dist/types/components/HysPagination/HysPagination.vue.d.ts +1 -1
- package/dist/types/components/HysPermissionMatrix/HysPermissionMatrix.vue.d.ts +2 -2
- package/dist/types/components/HysPopover/HysPopover.vue.d.ts +3 -3
- package/dist/types/components/HysProgress/HysProgress.vue.d.ts +1 -1
- package/dist/types/components/HysRadio/HysRadio.vue.d.ts +56 -0
- package/dist/types/components/HysRadioGroup/HysRadioGroup.vue.d.ts +34 -12
- package/dist/types/components/HysRating/HysRating.vue.d.ts +85 -5
- package/dist/types/components/HysRichTextEditor/HysRichTextEditor.vue.d.ts +4 -4
- package/dist/types/components/HysSearch/HysSearch.vue.d.ts +2 -2
- package/dist/types/components/HysSegmented/HysSegmented.vue.d.ts +64 -32
- package/dist/types/components/HysSelect/HysSelect.vue.d.ts +120 -20
- package/dist/types/components/HysSkeleton/HysSkeleton.vue.d.ts +30 -2
- package/dist/types/components/HysSlider/HysSlider.vue.d.ts +66 -9
- package/dist/types/components/HysSlider/SliderTooltip.vue.d.ts +22 -0
- package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +1 -1
- package/dist/types/components/HysSteps/HysSteps.vue.d.ts +64 -9
- package/dist/types/components/HysSwitch/HysSwitch.vue.d.ts +76 -17
- package/dist/types/components/HysTable/HysTable.vue.d.ts +206 -32
- package/dist/types/components/HysTable/HysTableFilterOptions.vue.d.ts +18 -0
- package/dist/types/components/HysTabs/HysTabs.vue.d.ts +76 -23
- package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +5 -5
- package/dist/types/components/HysTextarea/HysTextarea.vue.d.ts +44 -27
- package/dist/types/components/HysToast/HysToast.vue.d.ts +3 -3
- package/dist/types/components/HysTour/HysTour.vue.d.ts +2 -2
- package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +55 -40
- package/dist/types/components/HysTransfer/HysTransferPanel.vue.d.ts +105 -0
- package/dist/types/components/HysTree/HysTree.vue.d.ts +140 -73
- package/dist/types/components/HysTreeSelect/HysTreeSelect.vue.d.ts +102 -23
- package/dist/types/components/HysTreeSelect/HysTreeSelectPanel.vue.d.ts +56 -0
- package/dist/types/composables/autocomplete.d.ts +106 -0
- package/dist/types/composables/avatar.d.ts +70 -0
- package/dist/types/composables/calendar.d.ts +66 -0
- package/dist/types/composables/cascader.d.ts +192 -0
- package/dist/types/composables/choice.d.ts +110 -0
- package/dist/types/composables/choiceModel.d.ts +11 -0
- package/dist/types/composables/datePicker.d.ts +247 -0
- package/dist/types/composables/formContext.d.ts +133 -8
- package/dist/types/composables/formLayout.d.ts +11 -0
- package/dist/types/composables/formValidation.d.ts +13 -0
- package/dist/types/composables/gantt.d.ts +68 -0
- package/dist/types/composables/ganttConflicts.d.ts +30 -0
- package/dist/types/composables/numberInput.d.ts +45 -0
- package/dist/types/composables/rating.d.ts +18 -0
- package/dist/types/composables/segmented.d.ts +15 -0
- package/dist/types/composables/selectOptions.d.ts +44 -0
- package/dist/types/composables/slider.d.ts +21 -0
- package/dist/types/composables/table.d.ts +309 -0
- package/dist/types/composables/textInput.d.ts +76 -0
- package/dist/types/composables/transfer.d.ts +180 -0
- package/dist/types/composables/tree.d.ts +237 -0
- package/dist/types/composables/treeSelect.d.ts +167 -0
- package/dist/types/composables/useCascader.d.ts +162 -0
- package/dist/types/composables/useDatePicker.d.ts +79 -0
- package/dist/types/composables/useFloating.d.ts +8 -5
- package/dist/types/composables/useGanttDependencies.d.ts +83 -0
- package/dist/types/composables/useGanttHistory.d.ts +42 -0
- package/dist/types/composables/useGanttLabelResize.d.ts +23 -0
- package/dist/types/composables/useTable.d.ts +60 -0
- package/dist/types/composables/useTextareaSize.d.ts +3 -0
- package/dist/types/composables/useTransfer.d.ts +58 -0
- package/dist/types/composables/useTree.d.ts +77 -0
- package/dist/types/composables/useTreeSelect.d.ts +117 -0
- package/dist/types/index.d.ts +33 -7
- package/package.json +2 -1
|
@@ -1,109 +1,1494 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { defineComponent as dl, useSlots as yl, ref as M, useId as fl, shallowRef as tt, computed as F, watch as ee, onMounted as vl, onActivated as ml, onUpdated as hl, onDeactivated as pl, onBeforeUnmount as kl, openBlock as u, createElementBlock as c, mergeProps as W, unref as o, renderSlot as S, createCommentVNode as g, createElementVNode as T, toDisplayString as O, createBlock as A, withCtx as te, createTextVNode as D, createVNode as q, Fragment as E, renderList as X, normalizeStyle as he, withModifiers as V, resolveDynamicComponent as Me, normalizeClass as Ae, withKeys as lt, isRef as wl, withDirectives as bl, vShow as gl, Teleport as Pt, normalizeProps as Cl, guardReactiveProps as Sl, nextTick as pe } from "vue";
|
|
2
|
+
import { ChevronUp as xl, ChevronDown as at, ListFilter as Rl, LoaderCircle as ot, ChevronRight as Ot, RotateCw as Tl } from "lucide-vue-next";
|
|
3
|
+
import Et from "../HysCheckbox/HysCheckbox.vue.js";
|
|
4
|
+
import zl from "../HysRadio/HysRadio.vue.js";
|
|
5
|
+
import ce from "../HysButton/HysButton.vue.js";
|
|
6
|
+
import Fl from "../HysInput/HysInput.vue.js";
|
|
7
|
+
import Kt from "../HysPagination/HysPagination.vue.js";
|
|
8
|
+
import Ml from "./HysTableFilterOptions.vue.js";
|
|
9
|
+
import { useHysRootAttrs as Al } from "../../config.js";
|
|
10
|
+
import { useFloating as $t } from "../../composables/useFloating.js";
|
|
11
|
+
import { useTable as Bl } from "../../composables/useTable.js";
|
|
12
|
+
import { tableColumns as Pl, tableBreakpoint as Ol, tableToken as El, tableSummary as Kl, tableValue as Be } from "../../composables/table.js";
|
|
13
|
+
const $l = ["aria-busy"], Hl = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "hys-ui-table-title"
|
|
16
|
+
}, Ll = {
|
|
17
|
+
key: 1,
|
|
18
|
+
class: "hys-ui-table-selection-actions"
|
|
19
|
+
}, Nl = { "aria-live": "polite" }, Wl = ["data-position"], Dl = ["tabindex", "aria-label"], ql = { key: 0 }, Vl = { key: 1 }, jl = ["data-column-key", "data-leaf", "colspan", "rowspan", "scope", "aria-sort", "onClick", "onContextmenu"], Il = {
|
|
20
|
+
key: 1,
|
|
21
|
+
class: "hys-ui-table-sr-only"
|
|
22
|
+
}, Ul = {
|
|
23
|
+
key: 1,
|
|
24
|
+
class: "hys-ui-table-heading"
|
|
25
|
+
}, Jl = { class: "hys-ui-table-label" }, Xl = ["disabled", "onClick"], Ql = { key: 1 }, Yl = {
|
|
26
|
+
key: 2,
|
|
27
|
+
class: "hys-ui-table-sort-controls"
|
|
28
|
+
}, Gl = ["disabled", "aria-label", "aria-pressed", "onClick"], Zl = ["disabled", "aria-label", "aria-expanded", "aria-controls", "onClick"], _l = ["aria-label", "aria-valuenow", "aria-valuemin", "aria-valuemax", "onPointerdown", "onKeydown"], ea = {
|
|
29
|
+
key: 0,
|
|
30
|
+
class: "hys-ui-table-message"
|
|
31
|
+
}, ta = ["colspan"], la = { role: "status" }, aa = ["data-row-key", "aria-selected", "onClick", "onDblclick", "onContextmenu"], oa = ["disabled", "aria-expanded", "aria-label", "onClick"], na = {
|
|
32
|
+
key: 3,
|
|
33
|
+
class: "hys-ui-table-cell-content"
|
|
34
|
+
}, ia = ["disabled", "aria-expanded", "aria-label", "onClick"], sa = {
|
|
35
|
+
key: 1,
|
|
36
|
+
class: "hys-ui-table-tree-spacer"
|
|
37
|
+
}, ra = ["tabindex", "aria-describedby", "onPointerenter", "onFocus"], ua = {
|
|
38
|
+
key: 0,
|
|
39
|
+
class: "hys-ui-table-detail"
|
|
40
|
+
}, ca = ["colspan"], da = {
|
|
41
|
+
key: 0,
|
|
42
|
+
class: "hys-ui-table-message"
|
|
43
|
+
}, ya = ["colspan"], fa = {
|
|
44
|
+
key: 2,
|
|
45
|
+
class: "hys-ui-table-append"
|
|
46
|
+
}, va = ["colspan"], ma = { key: 2 }, ha = ["data-column-key"], pa = {
|
|
47
|
+
key: 2,
|
|
48
|
+
class: "hys-ui-table-footer"
|
|
49
|
+
}, ka = ["data-position"], wa = ["id", "aria-label"], ba = { class: "hys-ui-table-filter-actions" }, ga = ["id"], Ea = /* @__PURE__ */ dl({
|
|
5
50
|
__name: "HysTable",
|
|
6
51
|
props: {
|
|
52
|
+
locale: {},
|
|
7
53
|
columns: {},
|
|
8
54
|
rows: {},
|
|
9
|
-
rowKey: { default: "id" },
|
|
10
|
-
emptyText: {},
|
|
55
|
+
rowKey: { type: [String, Function], default: "id" },
|
|
56
|
+
emptyText: { default: void 0 },
|
|
11
57
|
loading: { type: Boolean },
|
|
58
|
+
disabled: { type: Boolean },
|
|
12
59
|
striped: { type: Boolean },
|
|
13
60
|
bordered: { type: Boolean },
|
|
14
61
|
size: { default: "md" },
|
|
62
|
+
tableLayout: { default: "fixed" },
|
|
15
63
|
caption: {},
|
|
16
|
-
|
|
64
|
+
height: {},
|
|
65
|
+
maxHeight: {},
|
|
66
|
+
stickyHeader: { type: Boolean, default: void 0 },
|
|
67
|
+
showHeader: { type: Boolean, default: !0 },
|
|
68
|
+
fit: { type: Boolean, default: !0 },
|
|
69
|
+
scrollbarAlwaysOn: { type: Boolean },
|
|
70
|
+
scrollbarTabindex: { default: 0 },
|
|
71
|
+
headerRowClassName: {},
|
|
72
|
+
headerRowStyle: {},
|
|
73
|
+
rowClassName: {},
|
|
74
|
+
rowStyle: {},
|
|
75
|
+
cellClassName: {},
|
|
76
|
+
cellStyle: {},
|
|
77
|
+
headerCellClassName: {},
|
|
78
|
+
headerCellStyle: {},
|
|
79
|
+
customRow: {},
|
|
80
|
+
customHeaderRow: {},
|
|
81
|
+
customCell: {},
|
|
82
|
+
customHeaderCell: {},
|
|
83
|
+
selectable: { type: [Boolean, Function], default: void 0 },
|
|
84
|
+
selectionType: { default: "checkbox" },
|
|
85
|
+
selectedRowKeys: {},
|
|
86
|
+
defaultSelectedRowKeys: {},
|
|
87
|
+
reserveSelection: { type: Boolean },
|
|
88
|
+
checkStrictly: { type: Boolean, default: !0 },
|
|
89
|
+
selectOnIndeterminate: { type: Boolean, default: !0 },
|
|
90
|
+
selectionActions: { type: Boolean },
|
|
91
|
+
rangeSelection: { type: Boolean },
|
|
92
|
+
hideSelectAll: { type: Boolean },
|
|
93
|
+
selectionColumn: {},
|
|
94
|
+
getSelectionProps: {},
|
|
95
|
+
highlightCurrentRow: { type: Boolean },
|
|
96
|
+
currentRowKey: {},
|
|
97
|
+
defaultCurrentRowKey: {},
|
|
98
|
+
showIndex: { type: Boolean },
|
|
99
|
+
indexMethod: {},
|
|
100
|
+
sort: {},
|
|
101
|
+
sorts: {},
|
|
102
|
+
defaultSort: {},
|
|
103
|
+
multiSort: { type: Boolean },
|
|
104
|
+
sortOrders: {},
|
|
105
|
+
filters: {},
|
|
106
|
+
defaultFilters: {},
|
|
107
|
+
filterColumnKey: {},
|
|
108
|
+
filterPlacement: {},
|
|
109
|
+
appendFilterTo: { type: [String, Boolean] },
|
|
110
|
+
pagination: { type: [Boolean, Object], default: !1 },
|
|
111
|
+
page: {},
|
|
112
|
+
pageSize: {},
|
|
113
|
+
total: {},
|
|
114
|
+
serverMode: { type: Boolean },
|
|
115
|
+
scrollToFirstRowOnChange: { type: Boolean },
|
|
116
|
+
expandable: { type: Boolean },
|
|
117
|
+
expandedRowKeys: {},
|
|
118
|
+
defaultExpandedRowKeys: {},
|
|
119
|
+
defaultExpandAll: { type: Boolean },
|
|
120
|
+
rowExpandable: {},
|
|
121
|
+
expandOnClickRow: { type: Boolean },
|
|
122
|
+
showExpandColumn: { type: Boolean, default: !0 },
|
|
123
|
+
expandColumnTitle: {},
|
|
124
|
+
expandFixed: { type: [Boolean, String] },
|
|
125
|
+
preserveExpandedContent: { type: Boolean },
|
|
126
|
+
treeMode: { type: Boolean },
|
|
127
|
+
childrenKey: { default: "children" },
|
|
128
|
+
hasChildrenKey: { default: "hasChildren" },
|
|
129
|
+
indent: { default: 18 },
|
|
130
|
+
loadChildren: {},
|
|
131
|
+
showSummary: { type: Boolean },
|
|
132
|
+
sumText: { default: "合计" },
|
|
133
|
+
summaryMethod: {},
|
|
134
|
+
spanMethod: {},
|
|
135
|
+
showOverflowTooltip: { type: Boolean },
|
|
136
|
+
tooltipFormatter: {},
|
|
137
|
+
resizable: { type: Boolean },
|
|
138
|
+
columnWidths: {},
|
|
139
|
+
allowDragLastColumn: { type: Boolean, default: !0 }
|
|
17
140
|
},
|
|
18
|
-
emits: ["rowClick", "sortChange"],
|
|
19
|
-
setup(
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"
|
|
141
|
+
emits: ["rowClick", "rowDblclick", "rowContextmenu", "cellClick", "cellDblclick", "cellContextmenu", "cellMouseEnter", "cellMouseLeave", "headerClick", "headerContextmenu", "update:sort", "update:sorts", "sortChange", "update:filters", "filterChange", "update:selectedRowKeys", "selectionChange", "select", "selectAll", "selectInvert", "selectRange", "update:currentRowKey", "currentChange", "update:expandedRowKeys", "expandChange", "load", "loadError", "childrenChange", "update:filterColumnKey", "filterOpenChange", "update:page", "pageChange", "update:pageSize", "pageSizeChange", "queryChange", "change", "update:columnWidths", "columnResize", "scroll"],
|
|
142
|
+
setup(i, { expose: Ht, emit: Lt }) {
|
|
143
|
+
const r = i, x = Lt, Pe = Al(), Oe = yl(), le = M(), K = M(), Q = M(), de = fl(), nt = M(1024), L = tt({}), Ee = M({}), oe = M(), p = F(() => ({
|
|
144
|
+
emptyText: "暂无数据",
|
|
145
|
+
loadingText: "加载中…",
|
|
146
|
+
selectAll: "选择当前页全部行",
|
|
147
|
+
selectRow: "选择第{index}行",
|
|
148
|
+
expandRow: "展开第{index}行",
|
|
149
|
+
collapseRow: "收起第{index}行",
|
|
150
|
+
expand: "展开",
|
|
151
|
+
collapse: "收起",
|
|
152
|
+
filter: "筛选",
|
|
153
|
+
filterPlaceholder: "输入筛选内容",
|
|
154
|
+
reset: "重置",
|
|
155
|
+
apply: "应用",
|
|
156
|
+
retry: "重试",
|
|
157
|
+
retryLabel: "重新加载子行",
|
|
158
|
+
scrollLabel: "表格滚动区域",
|
|
159
|
+
resizeColumn: "调整{label}列宽",
|
|
160
|
+
sortAsc: "{label}升序",
|
|
161
|
+
sortDesc: "{label}降序",
|
|
162
|
+
filterSearch: "搜索筛选项",
|
|
163
|
+
noFilterMatch: "暂无匹配的筛选项",
|
|
164
|
+
invertSelection: "反选当前页",
|
|
165
|
+
clearSelection: "清空选择",
|
|
166
|
+
selected: "已选 {count} 项",
|
|
167
|
+
...r.locale
|
|
168
|
+
})), ye = (e, l) => e.replace("{index}", String(l)).replace("{label}", String(l)), ke = ({ value: e }) => e;
|
|
169
|
+
function Ke(e) {
|
|
170
|
+
const l = [...r.columns], t = /* @__PURE__ */ new Set();
|
|
171
|
+
for (; l.length; ) {
|
|
172
|
+
const n = l.pop();
|
|
173
|
+
if (!t.has(n)) {
|
|
174
|
+
if (t.add(n), n.type === e) return !0;
|
|
175
|
+
n.children && l.push(...n.children);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return !1;
|
|
179
|
+
}
|
|
180
|
+
function $e(e) {
|
|
181
|
+
let l = "@hys-" + e;
|
|
182
|
+
const t = /* @__PURE__ */ new Set(), n = [...r.columns], d = /* @__PURE__ */ new Set();
|
|
183
|
+
for (; n.length; ) {
|
|
184
|
+
const a = n.pop();
|
|
185
|
+
d.has(a) || (d.add(a), t.add(a.key), a.children && n.push(...a.children));
|
|
186
|
+
}
|
|
187
|
+
for (; t.has(l); ) l += "_";
|
|
188
|
+
return l;
|
|
189
|
+
}
|
|
190
|
+
const Nt = F(() => {
|
|
191
|
+
var l;
|
|
192
|
+
const e = [];
|
|
193
|
+
return r.selectable && !Ke("selection") && e.push({
|
|
194
|
+
key: $e("selection"),
|
|
195
|
+
type: "selection",
|
|
196
|
+
align: "center",
|
|
197
|
+
width: 48,
|
|
198
|
+
fixed: "left",
|
|
199
|
+
resizable: !1,
|
|
200
|
+
...r.selectionColumn,
|
|
201
|
+
label: ((l = r.selectionColumn) == null ? void 0 : l.label) ?? "选择"
|
|
202
|
+
}), (r.expandable || Oe.expand) && !r.treeMode && r.showExpandColumn && !Ke("expand") && e.push({
|
|
203
|
+
key: $e("expand"),
|
|
204
|
+
label: r.expandColumnTitle ?? "展开",
|
|
205
|
+
type: "expand",
|
|
206
|
+
align: "center",
|
|
207
|
+
width: 48,
|
|
208
|
+
fixed: r.expandFixed ?? "left",
|
|
209
|
+
resizable: !1
|
|
210
|
+
}), r.showIndex && !Ke("index") && e.push({
|
|
211
|
+
key: $e("index"),
|
|
212
|
+
label: "序号",
|
|
213
|
+
type: "index",
|
|
214
|
+
align: "center",
|
|
215
|
+
width: 64,
|
|
216
|
+
resizable: !1
|
|
217
|
+
}), [...e, ...r.columns].filter(
|
|
218
|
+
(t) => r.showExpandColumn || t.type !== "expand"
|
|
219
|
+
);
|
|
220
|
+
}), m = F(
|
|
221
|
+
() => Pl(
|
|
222
|
+
Nt.value,
|
|
223
|
+
Ol(nt.value),
|
|
224
|
+
r.showExpandColumn
|
|
225
|
+
)
|
|
226
|
+
), s = Bl(
|
|
227
|
+
r,
|
|
228
|
+
() => m.value.leaves,
|
|
229
|
+
() => !!Oe.expand,
|
|
230
|
+
(e, ...l) => x(e, ...l)
|
|
231
|
+
), {
|
|
232
|
+
busy: k,
|
|
233
|
+
display: Y,
|
|
234
|
+
selectedKeys: fe,
|
|
235
|
+
selectedSet: He,
|
|
236
|
+
expandedKeys: Le,
|
|
237
|
+
expandedSet: $,
|
|
238
|
+
halfSet: it,
|
|
239
|
+
allSelected: st,
|
|
240
|
+
someSelected: Ne,
|
|
241
|
+
sorts: G,
|
|
242
|
+
filters: we,
|
|
243
|
+
page: We,
|
|
244
|
+
pageSize: be,
|
|
245
|
+
total: rt,
|
|
246
|
+
currentKey: ut,
|
|
247
|
+
pending: ne,
|
|
248
|
+
loadErrors: Wt,
|
|
249
|
+
query: De
|
|
250
|
+
} = s, ge = F(
|
|
251
|
+
() => {
|
|
252
|
+
var e;
|
|
253
|
+
return (e = m.value.leaves.find((l) => !l.type || l.type === "default")) == null ? void 0 : e.key;
|
|
254
|
+
}
|
|
255
|
+
), Dt = F(
|
|
256
|
+
() => m.value.leaves.some((e) => e.type === "expand")
|
|
257
|
+
), ct = F(() => {
|
|
258
|
+
if (!r.pagination || s.pagination.value.hideOnSinglePage && rt.value <= be.value)
|
|
259
|
+
return [];
|
|
260
|
+
const e = [
|
|
261
|
+
"top-left",
|
|
262
|
+
"top-center",
|
|
263
|
+
"top-right",
|
|
264
|
+
"bottom-left",
|
|
265
|
+
"bottom-center",
|
|
266
|
+
"bottom-right"
|
|
267
|
+
];
|
|
268
|
+
return [
|
|
269
|
+
...new Set(s.pagination.value.position ?? ["bottom-right"])
|
|
270
|
+
].filter((l) => e.includes(l));
|
|
271
|
+
}), dt = F(() => ({
|
|
272
|
+
page: We.value,
|
|
273
|
+
pageSize: be.value,
|
|
274
|
+
total: rt.value,
|
|
275
|
+
showSizeChanger: s.pagination.value.showSizeChanger ?? !0,
|
|
276
|
+
showQuickJumper: s.pagination.value.showQuickJumper ?? !1,
|
|
277
|
+
showTotal: s.pagination.value.showTotal ?? !0,
|
|
278
|
+
compact: s.pagination.value.compact,
|
|
279
|
+
labels: p.value.paginationLabels,
|
|
280
|
+
pageSizeOptions: s.pagination.value.pageSizeOptions,
|
|
281
|
+
disabled: k.value
|
|
282
|
+
})), qe = Object.freeze({});
|
|
283
|
+
function ie(e) {
|
|
284
|
+
return e ? Object.fromEntries(
|
|
285
|
+
Object.entries(e).filter(
|
|
286
|
+
([l]) => ![
|
|
287
|
+
"key",
|
|
288
|
+
"ref",
|
|
289
|
+
"innerHTML",
|
|
290
|
+
"textContent",
|
|
291
|
+
"is",
|
|
292
|
+
"colspan",
|
|
293
|
+
"rowspan",
|
|
294
|
+
"scope",
|
|
295
|
+
"data-column-key",
|
|
296
|
+
"data-row-key",
|
|
297
|
+
"aria-selected",
|
|
298
|
+
"aria-sort"
|
|
299
|
+
].includes(l)
|
|
300
|
+
)
|
|
301
|
+
) : qe;
|
|
302
|
+
}
|
|
303
|
+
function qt(e) {
|
|
304
|
+
var t, n, d;
|
|
305
|
+
if (!r.customHeaderCell && !e.column.customHeaderCell)
|
|
306
|
+
return qe;
|
|
307
|
+
const l = m.value.leaves.indexOf(e.leaves[0]);
|
|
308
|
+
return W(
|
|
309
|
+
ie((t = r.customHeaderCell) == null ? void 0 : t.call(r, e.column, l)),
|
|
310
|
+
ie((d = (n = e.column).customHeaderCell) == null ? void 0 : d.call(n, e.column, l))
|
|
311
|
+
);
|
|
312
|
+
}
|
|
313
|
+
function Vt(e) {
|
|
314
|
+
var l, t, n;
|
|
315
|
+
return !r.customCell && !e.column.customCell ? qe : W(
|
|
316
|
+
ie((l = r.customCell) == null ? void 0 : l.call(r, e)),
|
|
317
|
+
ie((n = (t = e.column).customCell) == null ? void 0 : n.call(t, e))
|
|
318
|
+
);
|
|
319
|
+
}
|
|
320
|
+
let ve = !1;
|
|
321
|
+
function jt(e, l) {
|
|
322
|
+
const t = ve;
|
|
323
|
+
ve = !1, s.toggleRowSelection(e.key, l, t);
|
|
324
|
+
}
|
|
325
|
+
const yt = F(
|
|
326
|
+
() => r.stickyHeader ?? (r.height !== void 0 || r.maxHeight !== void 0)
|
|
327
|
+
), Ve = F(() => r.columnWidths ?? Ee.value);
|
|
328
|
+
function U(e) {
|
|
329
|
+
var t, n;
|
|
330
|
+
const l = ((t = oe.value) == null ? void 0 : t.key) === e.key ? oe.value.width : ((n = ae.value) == null ? void 0 : n[e.key]) ?? Ve.value[e.key] ?? (typeof e.width == "number" ? e.width : 160);
|
|
331
|
+
return Math.max(
|
|
332
|
+
e.minWidth ?? (e.type && e.type !== "default" ? 36 : 60),
|
|
333
|
+
Math.min(e.maxWidth ?? 2e3, Number.isFinite(l) ? l : 160)
|
|
334
|
+
);
|
|
335
|
+
}
|
|
336
|
+
function It(e) {
|
|
337
|
+
var l;
|
|
338
|
+
return ae.value !== void 0 || ((l = oe.value) == null ? void 0 : l.key) === e.key || Ve.value[e.key] !== void 0 || typeof e.width != "string" ? U(e) + "px" : e.width;
|
|
339
|
+
}
|
|
340
|
+
const ae = M(), Ce = M(!1), ft = F(
|
|
341
|
+
() => m.value.leaves.reduce((e, l) => e + U(l), 0)
|
|
342
|
+
), Ut = F(() => {
|
|
343
|
+
const e = {};
|
|
344
|
+
let l = 0, t = 0;
|
|
345
|
+
for (const n of m.value.leaves)
|
|
346
|
+
n.fixed === "left" && (e[n.key] = { left: l + "px" }, l += L.value[n.key] ?? U(n));
|
|
347
|
+
for (const n of [...m.value.leaves].reverse())
|
|
348
|
+
n.fixed === "right" && (e[n.key] = { right: t + "px" }, t += L.value[n.key] ?? U(n));
|
|
349
|
+
return e;
|
|
350
|
+
});
|
|
351
|
+
function je(e, l = !1) {
|
|
352
|
+
return e.fixed === "left" || e.fixed === "right" ? {
|
|
353
|
+
position: "sticky",
|
|
354
|
+
...Ut.value[e.key],
|
|
355
|
+
zIndex: l ? 6 : 2
|
|
356
|
+
} : {};
|
|
357
|
+
}
|
|
358
|
+
function Jt(e) {
|
|
359
|
+
const l = e.column, t = e.fixed === "right" ? e.leaves.at(-1) : e.leaves[0];
|
|
360
|
+
return {
|
|
361
|
+
...typeof r.headerCellStyle == "function" ? r.headerCellStyle(l, m.value.leaves.indexOf(t)) : r.headerCellStyle,
|
|
362
|
+
...je(t, !0),
|
|
363
|
+
textAlign: l.headerAlign ?? l.align,
|
|
364
|
+
"--hys-ui-table-justify": (l.headerAlign ?? l.align) === "right" ? "flex-end" : (l.headerAlign ?? l.align) === "center" ? "center" : "flex-start"
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
const vt = (e) => typeof e == "number" ? Number.isFinite(e) && e >= 0 ? e + "px" : void 0 : e, Ie = M(/* @__PURE__ */ new Set());
|
|
368
|
+
ee(
|
|
369
|
+
Le,
|
|
370
|
+
() => {
|
|
371
|
+
const e = new Set(Ie.value);
|
|
372
|
+
for (const l of Le.value) e.add(El(l));
|
|
373
|
+
for (const l of e)
|
|
374
|
+
s.graph.value.map.has(l) || e.delete(l);
|
|
375
|
+
Ie.value = e;
|
|
376
|
+
},
|
|
377
|
+
{ immediate: !0 }
|
|
378
|
+
);
|
|
379
|
+
function mt(e) {
|
|
380
|
+
return !!Oe.expand && s.canExpand(e) && ($.value.has(e.token) || r.preserveExpandedContent && Ie.value.has(e.token));
|
|
381
|
+
}
|
|
382
|
+
function H(e, l, t, n) {
|
|
383
|
+
return {
|
|
384
|
+
row: e,
|
|
385
|
+
column: l,
|
|
386
|
+
value: Be(e, l.dataIndex ?? l.key),
|
|
387
|
+
rowIndex: t,
|
|
388
|
+
columnIndex: n
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
function Xt(e) {
|
|
392
|
+
return {
|
|
393
|
+
...typeof r.cellStyle == "function" ? r.cellStyle(e) : r.cellStyle,
|
|
394
|
+
...typeof e.column.cellStyle == "function" ? e.column.cellStyle(e) : e.column.cellStyle,
|
|
395
|
+
...je(e.column),
|
|
396
|
+
textAlign: e.column.align,
|
|
397
|
+
"--hys-ui-table-justify": e.column.align === "right" ? "flex-end" : e.column.align === "center" ? "center" : "flex-start"
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
function Qt(e) {
|
|
401
|
+
return [
|
|
402
|
+
e.column.className,
|
|
403
|
+
typeof r.cellClassName == "function" ? r.cellClassName(e) : r.cellClassName
|
|
404
|
+
];
|
|
405
|
+
}
|
|
406
|
+
function Ue(e) {
|
|
407
|
+
if (e == null) return "";
|
|
408
|
+
if (typeof e != "object") return String(e);
|
|
409
|
+
try {
|
|
410
|
+
return JSON.stringify(e);
|
|
411
|
+
} catch {
|
|
412
|
+
return String(e);
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
function Yt(e) {
|
|
416
|
+
return e.column.formatter ? e.column.formatter(e.row, e.column, e.value, e.rowIndex) : Ue(e.value);
|
|
417
|
+
}
|
|
418
|
+
function Gt(e, l, t) {
|
|
419
|
+
k.value || (x("rowClick", e.row, l, t), r.highlightCurrentRow && s.setCurrentRow(e.key), r.expandOnClickRow && !t.target.closest(
|
|
420
|
+
"button,input,a,textarea,select,[contenteditable]"
|
|
421
|
+
) && s.toggleRowExpansion(e.key));
|
|
422
|
+
}
|
|
423
|
+
const Zt = F(() => {
|
|
424
|
+
var n;
|
|
425
|
+
const e = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set(), t = m.value.leaves;
|
|
426
|
+
for (let d = 0; d < Y.value.length; d++)
|
|
427
|
+
for (let a = 0; a < t.length; a++) {
|
|
428
|
+
const f = d + ":" + a, y = t[a];
|
|
429
|
+
if (l.has(f)) {
|
|
430
|
+
e.set(f, { rowspan: 0, colspan: 0 });
|
|
431
|
+
continue;
|
|
432
|
+
}
|
|
433
|
+
const w = y.type && y.type !== "default" || (n = r.spanMethod) == null ? void 0 : n.call(r, H(Y.value[d].row, y, d, a)), P = Array.isArray(w) ? { rowspan: w[0], colspan: w[1] } : w;
|
|
434
|
+
let z = Math.max(
|
|
435
|
+
0,
|
|
436
|
+
Math.min(Y.value.length - d, Math.floor((P == null ? void 0 : P.rowspan) ?? 1))
|
|
437
|
+
), R = Math.max(
|
|
438
|
+
0,
|
|
439
|
+
Math.min(t.length - a, Math.floor((P == null ? void 0 : P.colspan) ?? 1))
|
|
440
|
+
);
|
|
441
|
+
Number.isFinite(z) || (z = 1), Number.isFinite(R) || (R = 1);
|
|
442
|
+
for (let h = 0; h < z - 1; h++)
|
|
443
|
+
if (mt(Y.value[d + h]) && $.value.has(Y.value[d + h].token)) {
|
|
444
|
+
z = h + 1;
|
|
445
|
+
break;
|
|
446
|
+
}
|
|
447
|
+
for (let h = 1; h < R; h++)
|
|
448
|
+
if (t[a + h].fixed !== y.fixed || t[a + h].type && t[a + h].type !== "default") {
|
|
449
|
+
R = h;
|
|
450
|
+
break;
|
|
451
|
+
}
|
|
452
|
+
e.set(f, { rowspan: z, colspan: R });
|
|
453
|
+
for (let h = 0; h < z; h++)
|
|
454
|
+
for (let v = 0; v < R; v++)
|
|
455
|
+
(h || v) && l.add(d + h + ":" + (a + v));
|
|
456
|
+
}
|
|
457
|
+
return e;
|
|
458
|
+
}), Se = (e, l) => Zt.value.get(e + ":" + l) ?? { rowspan: 1, colspan: 1 }, ht = F(() => {
|
|
459
|
+
var t;
|
|
460
|
+
const e = s.filteredRows.value, l = (t = r.summaryMethod) == null ? void 0 : t.call(r, { columns: m.value.leaves, rows: e });
|
|
461
|
+
return m.value.leaves.map(
|
|
462
|
+
(n, d) => l ? Array.isArray(l) ? l[d] : l[n.key] : n.summary ? Kl(e, n) : n.key === ge.value ? r.sumText : ""
|
|
463
|
+
);
|
|
464
|
+
}), Je = M(), Xe = M(), b = tt(), Z = M([]), pt = M(null), se = F(
|
|
465
|
+
() => r.filterColumnKey === void 0 ? pt.value : r.filterColumnKey
|
|
466
|
+
);
|
|
467
|
+
let Qe = !1;
|
|
468
|
+
async function xe(e, l = !1) {
|
|
469
|
+
var t;
|
|
470
|
+
return e !== null && (k.value || !s.live.value || !m.value.leaves.some(
|
|
471
|
+
(n) => n.key === e && (n.filterable || n.filters)
|
|
472
|
+
)) ? !1 : (Qe = l, pt.value = e, x("update:filterColumnKey", e), se.value === e && Re(), await pe(), se.value === e && Re(), await pe(), s.live.value && se.value === e && (e === null ? !j.value : j.value && ((t = b.value) == null ? void 0 : t.key) === e));
|
|
473
|
+
}
|
|
474
|
+
const B = $t(Je, Xe, {
|
|
475
|
+
get placement() {
|
|
476
|
+
return r.filterPlacement ?? "bottom-end";
|
|
477
|
+
},
|
|
478
|
+
width: () => 260,
|
|
479
|
+
requestOpen(e, l) {
|
|
480
|
+
var t;
|
|
481
|
+
return xe(
|
|
482
|
+
e ? ((t = b.value) == null ? void 0 : t.key) ?? null : null,
|
|
483
|
+
l
|
|
484
|
+
), !1;
|
|
485
|
+
}
|
|
486
|
+
}), j = B.open, _t = B.style;
|
|
487
|
+
function Re() {
|
|
488
|
+
var d, a, f;
|
|
489
|
+
const e = se.value, l = m.value.leaves.find(
|
|
490
|
+
(y) => y.key === e && (y.filterable || y.filters)
|
|
491
|
+
);
|
|
492
|
+
if (k.value || !s.live.value || !l) {
|
|
493
|
+
B.close(Qe, !0), Qe = !1;
|
|
494
|
+
return;
|
|
495
|
+
}
|
|
496
|
+
const t = (a = Array.from(
|
|
497
|
+
((d = Q.value) == null ? void 0 : d.querySelectorAll("th[data-leaf]")) ?? []
|
|
498
|
+
).find((y) => y.dataset.columnKey === e)) == null ? void 0 : a.querySelector(".hys-ui-table-filter");
|
|
499
|
+
if (!t) {
|
|
500
|
+
B.close(!1, !0);
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
const n = ((f = b.value) == null ? void 0 : f.key) !== e || !j.value;
|
|
504
|
+
Je.value = t, b.value = l, n && (Z.value = [...we.value[l.key] ?? []]), B.show(!0), pe(() => {
|
|
505
|
+
var y, w;
|
|
506
|
+
n && j.value && se.value === e && ((w = (y = Xe.value) == null ? void 0 : y.querySelector('input,button,[tabindex="0"]')) == null || w.focus());
|
|
507
|
+
});
|
|
508
|
+
}
|
|
509
|
+
ee(
|
|
510
|
+
[
|
|
511
|
+
se,
|
|
512
|
+
k,
|
|
513
|
+
s.live,
|
|
514
|
+
() => m.value.leaves,
|
|
515
|
+
() => r.showHeader
|
|
516
|
+
],
|
|
517
|
+
Re,
|
|
518
|
+
{ immediate: !0, flush: "post" }
|
|
519
|
+
), ee(
|
|
520
|
+
() => {
|
|
521
|
+
var e;
|
|
522
|
+
return j.value ? ((e = b.value) == null ? void 0 : e.key) ?? null : null;
|
|
523
|
+
},
|
|
524
|
+
(e) => x("filterOpenChange", e)
|
|
525
|
+
);
|
|
526
|
+
async function el(e, l) {
|
|
527
|
+
var t;
|
|
528
|
+
if (!k.value) {
|
|
529
|
+
if (j.value && ((t = b.value) == null ? void 0 : t.key) === e.key) {
|
|
530
|
+
B.close();
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
533
|
+
Je.value = l.currentTarget, await xe(e.key);
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
function kt(e) {
|
|
537
|
+
Z.value = [...e];
|
|
538
|
+
}
|
|
539
|
+
function Te(e) {
|
|
540
|
+
b.value && s.setFilter(b.value.key, Z.value), (e == null ? void 0 : e.closeDropdown) !== !1 && B.close(!0);
|
|
541
|
+
}
|
|
542
|
+
function wt(e) {
|
|
543
|
+
var n;
|
|
544
|
+
const l = b.value;
|
|
545
|
+
Z.value = l != null && l.filterResetToDefault ? [
|
|
546
|
+
...((n = r.defaultFilters) == null ? void 0 : n[l.key]) ?? l.defaultFilterValue ?? []
|
|
547
|
+
] : [];
|
|
548
|
+
const t = e;
|
|
549
|
+
(t == null ? void 0 : t.confirm) !== !1 ? Te(e) : (t == null ? void 0 : t.closeDropdown) === !0 && B.close(!0);
|
|
550
|
+
}
|
|
551
|
+
const bt = M(), gt = M(), _ = tt(), N = $t(bt, gt, {
|
|
552
|
+
placement: "top-start"
|
|
553
|
+
}), Ct = N.open, tl = N.style;
|
|
554
|
+
let me;
|
|
555
|
+
function ll() {
|
|
556
|
+
clearTimeout(me);
|
|
557
|
+
}
|
|
558
|
+
function Ye() {
|
|
559
|
+
clearTimeout(me), me = setTimeout(() => N.close(), 80);
|
|
560
|
+
}
|
|
561
|
+
function St(e, l) {
|
|
562
|
+
clearTimeout(me);
|
|
563
|
+
const t = l.currentTarget;
|
|
564
|
+
k.value || N.restoringFocus.value || !(e.column.showOverflowTooltip ?? r.showOverflowTooltip) || t.scrollWidth <= t.clientWidth + 1 && t.scrollHeight <= t.clientHeight + 1 || (bt.value = t, _.value = e, N.show());
|
|
565
|
+
}
|
|
566
|
+
const al = F(() => {
|
|
567
|
+
var l;
|
|
568
|
+
const e = _.value;
|
|
569
|
+
return e ? ((l = e.column.tooltipFormatter ?? r.tooltipFormatter) == null ? void 0 : l(e)) ?? Ue(e.value) : "";
|
|
570
|
+
});
|
|
571
|
+
let J, Ge = 0, C, Ze = 0, _e = 0;
|
|
572
|
+
function xt() {
|
|
573
|
+
var t, n;
|
|
574
|
+
if (!s.live.value || !le.value) return;
|
|
575
|
+
nt.value = le.value.clientWidth;
|
|
576
|
+
const e = {}, l = (t = Q.value) == null ? void 0 : t.querySelector(
|
|
577
|
+
"tbody tr:not(.hys-ui-table-message):not(.hys-ui-table-detail)"
|
|
578
|
+
);
|
|
579
|
+
for (const d of m.value.leaves) {
|
|
580
|
+
const a = Array.from(
|
|
581
|
+
((n = Q.value) == null ? void 0 : n.querySelectorAll("th[data-leaf]")) ?? []
|
|
582
|
+
).find((y) => y.dataset.columnKey === d.key), f = a ?? Array.from(
|
|
583
|
+
(l == null ? void 0 : l.querySelectorAll(
|
|
584
|
+
"td[data-column-key],th[data-column-key]"
|
|
585
|
+
)) ?? []
|
|
586
|
+
).find((y) => y.dataset.columnKey === d.key);
|
|
587
|
+
f && (e[d.key] = f.getBoundingClientRect().width);
|
|
588
|
+
}
|
|
589
|
+
JSON.stringify(e) !== JSON.stringify(L.value) && (L.value = e);
|
|
590
|
+
}
|
|
591
|
+
function re() {
|
|
592
|
+
cancelAnimationFrame(Ge), Ge = requestAnimationFrame(xt);
|
|
593
|
+
}
|
|
594
|
+
async function ol() {
|
|
595
|
+
await pe(), xt();
|
|
596
|
+
}
|
|
597
|
+
function I() {
|
|
598
|
+
var e, l;
|
|
599
|
+
cancelAnimationFrame(Ze), C && ((l = (e = K.value) == null ? void 0 : e.hasPointerCapture) != null && l.call(e, C.pointerId)) && K.value.releasePointerCapture(C.pointerId), C = void 0, oe.value = void 0, ae.value = void 0, document.removeEventListener("pointermove", zt, !0), document.removeEventListener("pointerup", Mt, !0), document.removeEventListener("pointercancel", ze, !0), document.removeEventListener("keydown", Rt, !0), window.removeEventListener("blur", ze);
|
|
600
|
+
}
|
|
601
|
+
function ze() {
|
|
602
|
+
I();
|
|
603
|
+
}
|
|
604
|
+
function Rt(e) {
|
|
605
|
+
e.key === "Escape" && C && (e.preventDefault(), e.stopImmediatePropagation(), I());
|
|
606
|
+
}
|
|
607
|
+
function Tt() {
|
|
608
|
+
if (!C) return;
|
|
609
|
+
const e = getComputedStyle(le.value).direction === "rtl" ? -1 : 1;
|
|
610
|
+
oe.value = {
|
|
611
|
+
key: C.column.key,
|
|
612
|
+
width: Math.max(
|
|
613
|
+
C.column.minWidth ?? 60,
|
|
614
|
+
Math.min(
|
|
615
|
+
C.column.maxWidth ?? 2e3,
|
|
616
|
+
C.width + (_e - C.start) * e
|
|
617
|
+
)
|
|
618
|
+
)
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
function zt(e) {
|
|
622
|
+
!C || e.pointerId !== C.pointerId || (_e = e.clientX, cancelAnimationFrame(Ze), Ze = requestAnimationFrame(Tt));
|
|
623
|
+
}
|
|
624
|
+
function Ft(e, l, t, n) {
|
|
625
|
+
if (k.value || !s.live.value) return;
|
|
626
|
+
const d = Math.round(
|
|
627
|
+
Math.max(e.minWidth ?? 60, Math.min(e.maxWidth ?? 2e3, l))
|
|
628
|
+
);
|
|
629
|
+
if (d === t) return;
|
|
630
|
+
const a = {
|
|
631
|
+
...Ve.value,
|
|
632
|
+
...L.value,
|
|
633
|
+
...n,
|
|
634
|
+
[e.key]: d
|
|
635
|
+
};
|
|
636
|
+
Ee.value = a, x("update:columnWidths", a), r.columnWidths === void 0 && (Ce.value = !0), x("columnResize", e, d, t), re();
|
|
637
|
+
}
|
|
638
|
+
function Mt(e) {
|
|
639
|
+
var a;
|
|
640
|
+
if (!C || e.pointerId !== C.pointerId) return;
|
|
641
|
+
_e = e.clientX, Tt();
|
|
642
|
+
const { column: l, width: t } = C, n = ((a = oe.value) == null ? void 0 : a.width) ?? t, d = ae.value;
|
|
643
|
+
I(), Ft(l, n, t, d);
|
|
644
|
+
}
|
|
645
|
+
function nl(e, l) {
|
|
646
|
+
var n, d;
|
|
647
|
+
if (k.value || l.button !== 0 || !s.live.value) return;
|
|
648
|
+
B.close(), N.close(), I();
|
|
649
|
+
const t = L.value[e.key] ?? U(e);
|
|
650
|
+
ae.value = { ...L.value }, C = {
|
|
651
|
+
column: e,
|
|
652
|
+
start: l.clientX,
|
|
653
|
+
width: t,
|
|
654
|
+
pointerId: l.pointerId
|
|
655
|
+
}, (d = (n = K.value) == null ? void 0 : n.setPointerCapture) == null || d.call(n, l.pointerId), document.addEventListener("pointermove", zt, !0), document.addEventListener("pointerup", Mt, !0), document.addEventListener("pointercancel", ze, !0), document.addEventListener("keydown", Rt, !0), window.addEventListener("blur", ze);
|
|
656
|
+
}
|
|
657
|
+
function il() {
|
|
658
|
+
k.value || (I(), Ee.value = {}, Ce.value = !1, x("update:columnWidths", {}), re());
|
|
659
|
+
}
|
|
660
|
+
function et(e, l) {
|
|
661
|
+
const t = m.value.leaves.find((n) => n.key === e);
|
|
662
|
+
t && Number.isFinite(l) && Ft(t, l, L.value[e] ?? U(t));
|
|
663
|
+
}
|
|
664
|
+
function sl(e) {
|
|
665
|
+
K.value && (N.close(), x(
|
|
666
|
+
"scroll",
|
|
667
|
+
{
|
|
668
|
+
scrollLeft: K.value.scrollLeft,
|
|
669
|
+
scrollTop: K.value.scrollTop
|
|
670
|
+
},
|
|
671
|
+
e
|
|
672
|
+
));
|
|
673
|
+
}
|
|
674
|
+
function At() {
|
|
675
|
+
J == null || J.disconnect(), typeof ResizeObserver < "u" && (J = new ResizeObserver(re), le.value && J.observe(le.value), Q.value && J.observe(Q.value)), re();
|
|
676
|
+
}
|
|
677
|
+
function Bt() {
|
|
678
|
+
J == null || J.disconnect(), cancelAnimationFrame(Ge), I(), clearTimeout(me), B.close(), N.close();
|
|
679
|
+
}
|
|
680
|
+
ee(k, (e) => {
|
|
681
|
+
e && (I(), B.close(), N.close());
|
|
682
|
+
}), ee(
|
|
683
|
+
() => r.columnWidths,
|
|
684
|
+
() => {
|
|
685
|
+
C && I(), re();
|
|
686
|
+
},
|
|
687
|
+
{ deep: !0 }
|
|
688
|
+
), ee(
|
|
689
|
+
() => m.value.leaves.map((e) => e.key).join("\0"),
|
|
690
|
+
() => {
|
|
691
|
+
b.value && !m.value.leaves.some((e) => {
|
|
692
|
+
var l;
|
|
693
|
+
return e.key === ((l = b.value) == null ? void 0 : l.key);
|
|
694
|
+
}) && B.close(), _.value && !m.value.leaves.some((e) => {
|
|
695
|
+
var l;
|
|
696
|
+
return e.key === ((l = _.value) == null ? void 0 : l.column.key);
|
|
697
|
+
}) && N.close(), C && !m.value.leaves.some((e) => e.key === (C == null ? void 0 : C.column.key)) && I();
|
|
698
|
+
}
|
|
699
|
+
), ee(
|
|
700
|
+
() => r.columns,
|
|
701
|
+
() => {
|
|
702
|
+
I(), B.close(), N.close();
|
|
703
|
+
},
|
|
704
|
+
{ deep: !0 }
|
|
705
|
+
), vl(() => {
|
|
706
|
+
At(), Re();
|
|
707
|
+
}), ml(At), hl(re), pl(Bt), kl(Bt), ee(
|
|
708
|
+
[G, we, We, be],
|
|
709
|
+
() => {
|
|
710
|
+
r.scrollToFirstRowOnChange && K.value && (K.value.scrollTop = 0);
|
|
711
|
+
},
|
|
712
|
+
{ flush: "post" }
|
|
713
|
+
);
|
|
714
|
+
function Fe(e) {
|
|
715
|
+
const l = K.value;
|
|
716
|
+
!s.live.value || !l || (typeof l.scrollTo == "function" ? l.scrollTo(e) : (e.top !== void 0 && (l.scrollTop = e.top), e.left !== void 0 && (l.scrollLeft = e.left)));
|
|
717
|
+
}
|
|
718
|
+
async function rl(e, l = {}) {
|
|
719
|
+
var h, v, ue;
|
|
720
|
+
await pe();
|
|
721
|
+
const t = s.find(e), n = K.value;
|
|
722
|
+
if (!s.live.value || !n || !t || r.loading) return !1;
|
|
723
|
+
const d = Y.value.findIndex((cl) => cl.token === t.token), a = Array.from(
|
|
724
|
+
((h = Q.value) == null ? void 0 : h.querySelectorAll("tbody tr[data-row-key]")) ?? []
|
|
725
|
+
)[d];
|
|
726
|
+
if (d < 0 || !a) return !1;
|
|
727
|
+
const f = n.getBoundingClientRect(), y = a.getBoundingClientRect(), w = yt.value ? ((ue = (v = Q.value) == null ? void 0 : v.querySelector("thead")) == null ? void 0 : ue.getBoundingClientRect().height) ?? 0 : 0, P = y.top - f.top - n.clientTop + n.scrollTop, z = Math.max(0, n.clientHeight - w);
|
|
728
|
+
let R = P - w;
|
|
729
|
+
if (l.block === "center") R -= (z - y.height) / 2;
|
|
730
|
+
else if (l.block === "end") R -= z - y.height;
|
|
731
|
+
else if (!l.block || l.block === "nearest") {
|
|
732
|
+
if (y.top >= f.top + n.clientTop + w && y.bottom <= f.top + n.clientTop + n.clientHeight)
|
|
733
|
+
return !0;
|
|
734
|
+
y.top >= f.top + n.clientTop + w && (R -= z - y.height);
|
|
735
|
+
}
|
|
736
|
+
return Fe({ top: Math.max(0, R), behavior: l.behavior }), !0;
|
|
737
|
+
}
|
|
738
|
+
const ul = F(() => m.value.leaves);
|
|
739
|
+
return Ht({
|
|
740
|
+
element: le,
|
|
741
|
+
viewport: K,
|
|
742
|
+
selectedKeys: fe,
|
|
743
|
+
currentRow: s.currentRow,
|
|
744
|
+
expandedKeys: Le,
|
|
745
|
+
query: De,
|
|
746
|
+
columns: ul,
|
|
747
|
+
clearSelection: s.clearSelection,
|
|
748
|
+
getSelectionRows: s.getSelectionRows,
|
|
749
|
+
getHalfSelectionRows: s.getHalfSelectionRows,
|
|
750
|
+
toggleRowSelection: s.toggleRowSelection,
|
|
751
|
+
toggleAllSelection: s.toggleAllSelection,
|
|
752
|
+
invertSelection: s.invertSelection,
|
|
753
|
+
setCurrentRow: s.setCurrentRow,
|
|
754
|
+
toggleRowExpansion: s.toggleRowExpansion,
|
|
755
|
+
loadRow: s.loadRow,
|
|
756
|
+
updateKeyChildren: s.updateKeyChildren,
|
|
757
|
+
clearSort: () => s.setSort(null),
|
|
758
|
+
setSort: s.setSort,
|
|
759
|
+
clearFilter: s.clearFilter,
|
|
760
|
+
setFilter: s.setFilter,
|
|
761
|
+
showFilter: (e) => xe(e),
|
|
762
|
+
hideFilter: () => xe(null, !0),
|
|
763
|
+
setPage: s.requestPage,
|
|
764
|
+
resizeColumn: et,
|
|
765
|
+
resetColumnWidths: il,
|
|
766
|
+
doLayout: ol,
|
|
767
|
+
scrollTo: Fe,
|
|
768
|
+
setScrollTop: (e) => {
|
|
769
|
+
Number.isFinite(e) && Fe({ top: Math.max(0, e) });
|
|
770
|
+
},
|
|
771
|
+
setScrollLeft: (e) => {
|
|
772
|
+
Number.isFinite(e) && Fe({ left: Math.max(0, e) });
|
|
773
|
+
},
|
|
774
|
+
scrollToRow: rl
|
|
775
|
+
}), (e, l) => (u(), c("div", W({
|
|
776
|
+
ref_key: "element",
|
|
777
|
+
ref: le
|
|
778
|
+
}, o(Pe), {
|
|
779
|
+
class: ["hys-ui-table", [
|
|
780
|
+
"hys-ui-table-" + i.size,
|
|
781
|
+
{
|
|
782
|
+
"hys-ui-table-striped": i.striped,
|
|
783
|
+
"hys-ui-table-bordered": i.bordered,
|
|
784
|
+
"hys-ui-table-sticky": yt.value
|
|
785
|
+
}
|
|
786
|
+
]],
|
|
787
|
+
"aria-busy": i.loading || void 0
|
|
28
788
|
}), [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
789
|
+
e.$slots.title ? (u(), c("div", Hl, [
|
|
790
|
+
S(e.$slots, "title", {
|
|
791
|
+
rows: o(s).filteredRows.value,
|
|
792
|
+
query: o(De)
|
|
793
|
+
}, void 0, !0)
|
|
794
|
+
])) : g("", !0),
|
|
795
|
+
i.selectionActions || e.$slots.selection ? (u(), c("div", Ll, [
|
|
796
|
+
S(e.$slots, "selection", {
|
|
797
|
+
rows: o(s).getSelectionRows(),
|
|
798
|
+
keys: o(fe),
|
|
799
|
+
selectAll: () => o(s).toggleAllSelection(!0),
|
|
800
|
+
invert: o(s).invertSelection,
|
|
801
|
+
clear: o(s).clearSelection
|
|
802
|
+
}, () => [
|
|
803
|
+
T("span", Nl, O(p.value.selected.replace("{count}", String(o(fe).length))), 1),
|
|
804
|
+
i.selectionType !== "radio" ? (u(), A(ce, {
|
|
805
|
+
key: 0,
|
|
806
|
+
size: "sm",
|
|
807
|
+
variant: "secondary",
|
|
808
|
+
disabled: o(k),
|
|
809
|
+
onClick: l[0] || (l[0] = (t) => o(s).toggleAllSelection(!0))
|
|
810
|
+
}, {
|
|
811
|
+
default: te(() => [
|
|
812
|
+
D(O(p.value.selectAll), 1)
|
|
813
|
+
]),
|
|
814
|
+
_: 1
|
|
815
|
+
}, 8, ["disabled"])) : g("", !0),
|
|
816
|
+
i.selectionType !== "radio" ? (u(), A(ce, {
|
|
817
|
+
key: 1,
|
|
818
|
+
size: "sm",
|
|
819
|
+
variant: "secondary",
|
|
820
|
+
disabled: o(k),
|
|
821
|
+
onClick: o(s).invertSelection
|
|
822
|
+
}, {
|
|
823
|
+
default: te(() => [
|
|
824
|
+
D(O(p.value.invertSelection), 1)
|
|
825
|
+
]),
|
|
826
|
+
_: 1
|
|
827
|
+
}, 8, ["disabled", "onClick"])) : g("", !0),
|
|
828
|
+
q(ce, {
|
|
829
|
+
size: "sm",
|
|
830
|
+
variant: "ghost",
|
|
831
|
+
disabled: o(k) || !o(fe).length,
|
|
832
|
+
onClick: o(s).clearSelection
|
|
833
|
+
}, {
|
|
834
|
+
default: te(() => [
|
|
835
|
+
D(O(p.value.clearSelection), 1)
|
|
836
|
+
]),
|
|
837
|
+
_: 1
|
|
838
|
+
}, 8, ["disabled", "onClick"])
|
|
839
|
+
], !0)
|
|
840
|
+
])) : g("", !0),
|
|
841
|
+
(u(!0), c(E, null, X(ct.value.filter(
|
|
842
|
+
(t) => t.startsWith("top-")
|
|
843
|
+
), (t) => (u(), c("div", {
|
|
844
|
+
key: t,
|
|
845
|
+
class: "hys-ui-table-pagination",
|
|
846
|
+
"data-position": t
|
|
847
|
+
}, [
|
|
848
|
+
q(Kt, W({ ref_for: !0 }, dt.value, {
|
|
849
|
+
onChange: l[1] || (l[1] = (n) => o(s).requestPage(n)),
|
|
850
|
+
onPageSizeChange: o(s).changeSize
|
|
851
|
+
}), null, 16, ["onPageSizeChange"])
|
|
852
|
+
], 8, Wl))), 128)),
|
|
853
|
+
T("div", {
|
|
854
|
+
ref_key: "viewport",
|
|
855
|
+
ref: K,
|
|
856
|
+
class: "hys-ui-table-scroll",
|
|
857
|
+
style: he({
|
|
858
|
+
height: vt(i.height),
|
|
859
|
+
maxHeight: vt(i.maxHeight),
|
|
860
|
+
overflowY: i.scrollbarAlwaysOn ? "scroll" : void 0
|
|
861
|
+
}),
|
|
862
|
+
tabindex: i.scrollbarTabindex,
|
|
863
|
+
"aria-label": i.caption || p.value.scrollLabel,
|
|
864
|
+
onScroll: sl
|
|
865
|
+
}, [
|
|
866
|
+
T("table", {
|
|
867
|
+
ref_key: "table",
|
|
868
|
+
ref: Q,
|
|
869
|
+
class: "hys-ui-data-table",
|
|
870
|
+
style: he({
|
|
871
|
+
minWidth: ft.value + "px",
|
|
872
|
+
tableLayout: Ce.value || ae.value ? "fixed" : i.tableLayout,
|
|
873
|
+
width: i.fit && !Ce.value && !ae.value && !Object.keys(i.columnWidths ?? {}).length ? "100%" : ft.value + "px"
|
|
874
|
+
})
|
|
875
|
+
}, [
|
|
876
|
+
i.caption ? (u(), c("caption", ql, O(i.caption), 1)) : g("", !0),
|
|
877
|
+
T("colgroup", null, [
|
|
878
|
+
(u(!0), c(E, null, X(m.value.leaves, (t) => (u(), c("col", {
|
|
879
|
+
key: t.key,
|
|
880
|
+
style: he({ width: It(t) })
|
|
881
|
+
}, null, 4))), 128))
|
|
882
|
+
]),
|
|
883
|
+
i.showHeader ? (u(), c("thead", Vl, [
|
|
884
|
+
(u(!0), c(E, null, X(m.value.headers, (t, n) => {
|
|
885
|
+
var d;
|
|
886
|
+
return u(), c("tr", W(
|
|
887
|
+
{
|
|
888
|
+
key: n,
|
|
889
|
+
class: typeof i.headerRowClassName == "function" ? i.headerRowClassName(
|
|
890
|
+
t.map((a) => a.column),
|
|
891
|
+
n
|
|
892
|
+
) : i.headerRowClassName,
|
|
893
|
+
style: typeof i.headerRowStyle == "function" ? i.headerRowStyle(
|
|
894
|
+
t.map((a) => a.column),
|
|
895
|
+
n
|
|
896
|
+
) : i.headerRowStyle
|
|
897
|
+
},
|
|
898
|
+
{ ref_for: !0 },
|
|
899
|
+
ie(
|
|
900
|
+
(d = i.customHeaderRow) == null ? void 0 : d.call(
|
|
901
|
+
i,
|
|
902
|
+
t.map((a) => a.column),
|
|
903
|
+
n
|
|
904
|
+
)
|
|
905
|
+
)
|
|
906
|
+
), [
|
|
907
|
+
(u(!0), c(E, null, X(t, (a) => {
|
|
908
|
+
var f, y, w, P, z, R, h;
|
|
909
|
+
return u(), c("th", W({
|
|
910
|
+
key: a.key
|
|
911
|
+
}, { ref_for: !0 }, qt(a), {
|
|
912
|
+
"data-column-key": a.column.key,
|
|
913
|
+
"data-leaf": a.column.children ? void 0 : "",
|
|
914
|
+
colspan: a.colspan,
|
|
915
|
+
rowspan: a.rowspan,
|
|
916
|
+
scope: a.column.children ? "colgroup" : "col",
|
|
917
|
+
class: [
|
|
918
|
+
a.column.headerClassName,
|
|
919
|
+
typeof i.headerCellClassName == "function" ? i.headerCellClassName(
|
|
920
|
+
a.column,
|
|
921
|
+
m.value.leaves.indexOf(a.leaves[0])
|
|
922
|
+
) : i.headerCellClassName
|
|
923
|
+
],
|
|
924
|
+
style: Jt(a),
|
|
925
|
+
"aria-sort": a.column.sortable ? ((f = o(G).find((v) => v.key === a.column.key)) == null ? void 0 : f.direction) === "asc" ? "ascending" : ((y = o(G).find((v) => v.key === a.column.key)) == null ? void 0 : y.direction) === "desc" ? "descending" : "none" : void 0,
|
|
926
|
+
onClick: (v) => x("headerClick", a.column, v),
|
|
927
|
+
onContextmenu: (v) => x("headerContextmenu", a.column, v)
|
|
928
|
+
}), [
|
|
929
|
+
a.column.type === "selection" ? S(e.$slots, "selection-header", {
|
|
930
|
+
column: a.column,
|
|
931
|
+
checked: o(st),
|
|
932
|
+
indeterminate: o(Ne),
|
|
933
|
+
disabled: o(k) || !o(s).graph.value.all.some(o(s).eligible),
|
|
934
|
+
toggle: o(s).toggleAllSelection
|
|
935
|
+
}, () => [
|
|
936
|
+
a.column.type === "selection" && i.selectionType !== "radio" && !i.hideSelectAll ? (u(), A(Et, {
|
|
937
|
+
key: 0,
|
|
938
|
+
"model-value": o(st),
|
|
939
|
+
indeterminate: o(Ne),
|
|
940
|
+
disabled: o(k) || !o(s).graph.value.all.some(o(s).eligible),
|
|
941
|
+
"aria-label": p.value.selectAll,
|
|
942
|
+
onClick: l[2] || (l[2] = V(() => {
|
|
943
|
+
}, ["stop"])),
|
|
944
|
+
"onUpdate:modelValue": l[3] || (l[3] = (v) => o(s).toggleAllSelection(
|
|
945
|
+
o(Ne) && !i.selectOnIndeterminate ? !1 : v === !0
|
|
946
|
+
))
|
|
947
|
+
}, {
|
|
948
|
+
default: te(() => {
|
|
949
|
+
var v;
|
|
950
|
+
return [
|
|
951
|
+
(v = i.selectionColumn) != null && v.label ? (u(), c(E, { key: 0 }, [
|
|
952
|
+
D(O(i.selectionColumn.label), 1)
|
|
953
|
+
], 64)) : g("", !0)
|
|
954
|
+
];
|
|
955
|
+
}),
|
|
956
|
+
_: 1
|
|
957
|
+
}, 8, ["model-value", "indeterminate", "disabled", "aria-label"])) : a.column.type === "selection" ? (u(), c("span", Il, "选择")) : g("", !0)
|
|
958
|
+
], !0, 0) : (u(), c("div", Ul, [
|
|
959
|
+
T("div", Jl, [
|
|
960
|
+
a.column.sortable ? (u(), c("button", {
|
|
961
|
+
key: 0,
|
|
962
|
+
type: "button",
|
|
963
|
+
class: "hys-ui-table-sort",
|
|
964
|
+
disabled: o(k),
|
|
965
|
+
onClick: (v) => o(s).toggleSort(a.column)
|
|
966
|
+
}, [
|
|
967
|
+
S(e.$slots, "header-" + a.column.key, {
|
|
968
|
+
column: a.column,
|
|
969
|
+
sorts: o(G)
|
|
970
|
+
}, () => [
|
|
971
|
+
S(e.$slots, "header-cell", {
|
|
972
|
+
column: a.column,
|
|
973
|
+
sorts: o(G)
|
|
974
|
+
}, () => [
|
|
975
|
+
D(O(a.column.label), 1)
|
|
976
|
+
], !0)
|
|
977
|
+
], !0)
|
|
978
|
+
], 8, Xl)) : (u(), c("span", Ql, [
|
|
979
|
+
S(e.$slots, "header-" + a.column.key, {
|
|
980
|
+
column: a.column,
|
|
981
|
+
sorts: o(G)
|
|
982
|
+
}, () => [
|
|
983
|
+
S(e.$slots, "header-cell", {
|
|
984
|
+
column: a.column,
|
|
985
|
+
sorts: o(G)
|
|
986
|
+
}, () => [
|
|
987
|
+
D(O(a.column.label), 1)
|
|
988
|
+
], !0)
|
|
989
|
+
], !0)
|
|
990
|
+
])),
|
|
991
|
+
a.column.sortable ? (u(), c("span", Yl, [
|
|
992
|
+
(u(), c(E, null, X(["asc", "desc"], (v) => T("button", {
|
|
993
|
+
key: v,
|
|
994
|
+
type: "button",
|
|
995
|
+
disabled: o(k),
|
|
996
|
+
"aria-label": ye(
|
|
997
|
+
v === "asc" ? p.value.sortAsc : p.value.sortDesc,
|
|
998
|
+
a.column.label
|
|
999
|
+
),
|
|
1000
|
+
"aria-pressed": o(G).some(
|
|
1001
|
+
(ue) => ue.key === a.column.key && ue.direction === v
|
|
1002
|
+
),
|
|
1003
|
+
onClick: (ue) => o(s).toggleSort(a.column, v)
|
|
1004
|
+
}, [
|
|
1005
|
+
(u(), A(Me(v === "asc" ? o(xl) : o(at)), {
|
|
1006
|
+
size: 12,
|
|
1007
|
+
"aria-hidden": "true"
|
|
1008
|
+
}))
|
|
1009
|
+
], 8, Gl)), 64))
|
|
1010
|
+
])) : g("", !0)
|
|
1011
|
+
]),
|
|
1012
|
+
a.column.filterable || a.column.filters ? (u(), c("button", {
|
|
1013
|
+
key: 0,
|
|
1014
|
+
type: "button",
|
|
1015
|
+
class: Ae(["hys-ui-table-filter", {
|
|
1016
|
+
"hys-ui-table-filter-active": !!((w = o(we)[a.column.key]) != null && w.length)
|
|
1017
|
+
}]),
|
|
1018
|
+
disabled: o(k),
|
|
1019
|
+
"aria-label": p.value.filter + a.column.label,
|
|
1020
|
+
"aria-expanded": o(j) && ((P = b.value) == null ? void 0 : P.key) === a.column.key,
|
|
1021
|
+
"aria-controls": o(de) + "-filter",
|
|
1022
|
+
onClick: V((v) => el(a.column, v), ["stop"])
|
|
1023
|
+
}, [
|
|
1024
|
+
S(e.$slots, "filter-icon", {
|
|
1025
|
+
column: a.column,
|
|
1026
|
+
filtered: !!((z = o(we)[a.column.key]) != null && z.length),
|
|
1027
|
+
open: o(j) && ((R = b.value) == null ? void 0 : R.key) === a.column.key
|
|
1028
|
+
}, () => [
|
|
1029
|
+
q(o(Rl), {
|
|
1030
|
+
size: 14,
|
|
1031
|
+
"aria-hidden": "true"
|
|
1032
|
+
})
|
|
1033
|
+
], !0)
|
|
1034
|
+
], 10, Zl)) : g("", !0),
|
|
1035
|
+
!a.column.children && (a.column.resizable ?? i.resizable) && (i.allowDragLastColumn || a.column.key !== ((h = m.value.leaves.at(-1)) == null ? void 0 : h.key)) && (!a.column.type || a.column.type === "default") ? (u(), c("span", {
|
|
1036
|
+
key: 1,
|
|
1037
|
+
class: "hys-ui-table-resize",
|
|
1038
|
+
role: "separator",
|
|
1039
|
+
"aria-orientation": "vertical",
|
|
1040
|
+
"aria-label": ye(p.value.resizeColumn, a.column.label),
|
|
1041
|
+
tabindex: "0",
|
|
1042
|
+
"aria-valuenow": Math.round(
|
|
1043
|
+
L.value[a.column.key] ?? U(a.column)
|
|
1044
|
+
),
|
|
1045
|
+
"aria-valuemin": a.column.minWidth ?? 60,
|
|
1046
|
+
"aria-valuemax": a.column.maxWidth ?? 2e3,
|
|
1047
|
+
onPointerdown: V((v) => nl(a.column, v), ["prevent", "stop"]),
|
|
1048
|
+
onKeydown: [
|
|
1049
|
+
lt(V((v) => et(
|
|
1050
|
+
a.column.key,
|
|
1051
|
+
(L.value[a.column.key] ?? U(a.column)) - 10
|
|
1052
|
+
), ["prevent"]), ["left"]),
|
|
1053
|
+
lt(V((v) => et(
|
|
1054
|
+
a.column.key,
|
|
1055
|
+
(L.value[a.column.key] ?? U(a.column)) + 10
|
|
1056
|
+
), ["prevent"]), ["right"])
|
|
1057
|
+
]
|
|
1058
|
+
}, null, 40, _l)) : g("", !0)
|
|
1059
|
+
]))
|
|
1060
|
+
], 16, jl);
|
|
1061
|
+
}), 128))
|
|
1062
|
+
], 16);
|
|
57
1063
|
}), 128))
|
|
58
|
-
])
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
colspan: t.columns.length
|
|
64
|
-
}, [
|
|
65
|
-
g(o.$slots, "loading", {}, () => [
|
|
66
|
-
i[0] || (i[0] = k("加载中…", -1))
|
|
67
|
-
], !0)
|
|
68
|
-
], 8, q)
|
|
69
|
-
])) : (s(), l(u, { key: 1 }, [
|
|
70
|
-
(s(!0), l(u, null, b(N.value, (e, r) => {
|
|
71
|
-
var y;
|
|
72
|
-
return s(), l("tr", {
|
|
73
|
-
key: String(e[t.rowKey] ?? r),
|
|
74
|
-
class: w((y = t.rowClassName) == null ? void 0 : y.call(t, e, r)),
|
|
75
|
-
onClick: (n) => m("rowClick", e)
|
|
1064
|
+
])) : g("", !0),
|
|
1065
|
+
T("tbody", null, [
|
|
1066
|
+
i.loading ? (u(), c("tr", ea, [
|
|
1067
|
+
T("td", {
|
|
1068
|
+
colspan: Math.max(1, m.value.leaves.length)
|
|
76
1069
|
}, [
|
|
77
|
-
(
|
|
78
|
-
|
|
79
|
-
|
|
1070
|
+
T("div", la, [
|
|
1071
|
+
S(e.$slots, "loading", {}, () => [
|
|
1072
|
+
q(o(ot), {
|
|
1073
|
+
class: "hys-ui-table-spinner",
|
|
1074
|
+
size: 18
|
|
1075
|
+
}),
|
|
1076
|
+
D(O(p.value.loadingText), 1)
|
|
1077
|
+
], !0)
|
|
1078
|
+
])
|
|
1079
|
+
], 8, ta)
|
|
1080
|
+
])) : (u(), c(E, { key: 1 }, [
|
|
1081
|
+
(u(!0), c(E, null, X(o(Y), (t, n) => {
|
|
1082
|
+
var d;
|
|
1083
|
+
return u(), c(E, {
|
|
1084
|
+
key: t.token
|
|
1085
|
+
}, [
|
|
1086
|
+
T("tr", W({ ref_for: !0 }, ie((d = i.customRow) == null ? void 0 : d.call(i, t.row, n)), {
|
|
1087
|
+
"data-row-key": String(t.key),
|
|
1088
|
+
"aria-selected": i.highlightCurrentRow ? o(ut) === t.key : void 0,
|
|
1089
|
+
class: [
|
|
1090
|
+
typeof i.rowClassName == "function" ? i.rowClassName(t.row, n) : i.rowClassName,
|
|
1091
|
+
{
|
|
1092
|
+
"hys-ui-table-row-current": i.highlightCurrentRow && o(ut) === t.key,
|
|
1093
|
+
"hys-ui-table-row-selected": o(He).has(t.token)
|
|
1094
|
+
}
|
|
1095
|
+
],
|
|
1096
|
+
style: typeof i.rowStyle == "function" ? i.rowStyle(t.row, n) : i.rowStyle,
|
|
1097
|
+
onClick: (a) => Gt(t, n, a),
|
|
1098
|
+
onDblclick: (a) => !o(k) && x("rowDblclick", t.row, n, a),
|
|
1099
|
+
onContextmenu: (a) => x("rowContextmenu", t.row, n, a)
|
|
1100
|
+
}), [
|
|
1101
|
+
(u(!0), c(E, null, X(m.value.leaves, (a, f) => (u(), c(E, {
|
|
1102
|
+
key: a.key
|
|
1103
|
+
}, [
|
|
1104
|
+
Se(n, f).rowspan && Se(n, f).colspan ? (u(), A(Me(a.rowScope ? "th" : "td"), W(
|
|
1105
|
+
{
|
|
1106
|
+
key: 0,
|
|
1107
|
+
ref_for: !0
|
|
1108
|
+
},
|
|
1109
|
+
Vt(
|
|
1110
|
+
H(t.row, a, n, f)
|
|
1111
|
+
),
|
|
1112
|
+
{
|
|
1113
|
+
scope: a.rowScope,
|
|
1114
|
+
"data-column-key": a.key,
|
|
1115
|
+
rowspan: Se(n, f).rowspan,
|
|
1116
|
+
colspan: Se(n, f).colspan,
|
|
1117
|
+
style: Xt(H(t.row, a, n, f)),
|
|
1118
|
+
class: Qt(H(t.row, a, n, f)),
|
|
1119
|
+
onClick: (y) => !o(k) && x(
|
|
1120
|
+
"cellClick",
|
|
1121
|
+
H(t.row, a, n, f),
|
|
1122
|
+
y
|
|
1123
|
+
),
|
|
1124
|
+
onDblclick: (y) => !o(k) && x(
|
|
1125
|
+
"cellDblclick",
|
|
1126
|
+
H(t.row, a, n, f),
|
|
1127
|
+
y
|
|
1128
|
+
),
|
|
1129
|
+
onContextmenu: (y) => x(
|
|
1130
|
+
"cellContextmenu",
|
|
1131
|
+
H(t.row, a, n, f),
|
|
1132
|
+
y
|
|
1133
|
+
),
|
|
1134
|
+
onMouseenter: (y) => x(
|
|
1135
|
+
"cellMouseEnter",
|
|
1136
|
+
H(t.row, a, n, f),
|
|
1137
|
+
y
|
|
1138
|
+
),
|
|
1139
|
+
onMouseleave: (y) => x(
|
|
1140
|
+
"cellMouseLeave",
|
|
1141
|
+
H(t.row, a, n, f),
|
|
1142
|
+
y
|
|
1143
|
+
)
|
|
1144
|
+
}
|
|
1145
|
+
), {
|
|
1146
|
+
default: te(() => {
|
|
1147
|
+
var y;
|
|
1148
|
+
return [
|
|
1149
|
+
a.type === "selection" ? S(e.$slots, "selection-cell", {
|
|
1150
|
+
row: t.row,
|
|
1151
|
+
index: n,
|
|
1152
|
+
column: a,
|
|
1153
|
+
checked: o(He).has(t.token),
|
|
1154
|
+
indeterminate: o(it).has(t.token),
|
|
1155
|
+
disabled: o(k) || !o(s).eligible(t),
|
|
1156
|
+
toggle: (w) => o(s).toggleRowSelection(t.key, w)
|
|
1157
|
+
}, () => {
|
|
1158
|
+
var w, P, z, R;
|
|
1159
|
+
return [
|
|
1160
|
+
i.selectionType === "radio" ? (u(), A(zl, {
|
|
1161
|
+
key: 0,
|
|
1162
|
+
name: o(de) + "-selection",
|
|
1163
|
+
"model-value": o(fe)[0] ?? null,
|
|
1164
|
+
value: t.key,
|
|
1165
|
+
disabled: o(k) || !o(s).eligible(t),
|
|
1166
|
+
"aria-label": ((w = i.getSelectionProps) == null ? void 0 : w.call(i, t.row, t.index).label) ?? ye(p.value.selectRow, n + 1),
|
|
1167
|
+
title: (P = i.getSelectionProps) == null ? void 0 : P.call(i, t.row, t.index).title,
|
|
1168
|
+
onClick: l[4] || (l[4] = V(() => {
|
|
1169
|
+
}, ["stop"])),
|
|
1170
|
+
"onUpdate:modelValue": (h) => o(s).toggleRowSelection(t.key, !0)
|
|
1171
|
+
}, null, 8, ["name", "model-value", "value", "disabled", "aria-label", "title", "onUpdate:modelValue"])) : (u(), A(Et, {
|
|
1172
|
+
key: 1,
|
|
1173
|
+
"model-value": o(He).has(t.token),
|
|
1174
|
+
indeterminate: o(it).has(t.token),
|
|
1175
|
+
disabled: o(k) || !o(s).eligible(t),
|
|
1176
|
+
"aria-label": ((z = i.getSelectionProps) == null ? void 0 : z.call(i, t.row, t.index).label) ?? ye(p.value.selectRow, n + 1),
|
|
1177
|
+
title: (R = i.getSelectionProps) == null ? void 0 : R.call(i, t.row, t.index).title,
|
|
1178
|
+
onClick: l[5] || (l[5] = V((h) => wl(ve) ? ve.value = h.shiftKey : ve = h.shiftKey, ["stop"])),
|
|
1179
|
+
"onUpdate:modelValue": (h) => jt(t, h === !0)
|
|
1180
|
+
}, null, 8, ["model-value", "indeterminate", "disabled", "aria-label", "title", "onUpdate:modelValue"]))
|
|
1181
|
+
];
|
|
1182
|
+
}, !0, 0) : a.type === "index" ? (u(), A(ke, {
|
|
1183
|
+
key: 1,
|
|
1184
|
+
value: typeof a.index == "function" ? a.index(n, t.row) : i.indexMethod ? i.indexMethod(n, t.row) : (typeof a.index == "number" ? a.index : 1) + n + (i.pagination && !i.serverMode ? (o(We) - 1) * o(be) : 0)
|
|
1185
|
+
}, null, 8, ["value"])) : a.type === "expand" && o(s).canExpand(t) ? (u(), c("button", {
|
|
1186
|
+
key: 2,
|
|
1187
|
+
type: "button",
|
|
1188
|
+
class: "hys-ui-table-expand",
|
|
1189
|
+
disabled: o(k),
|
|
1190
|
+
"aria-expanded": o($).has(t.token),
|
|
1191
|
+
"aria-label": ye(
|
|
1192
|
+
o($).has(t.token) ? p.value.collapseRow : p.value.expandRow,
|
|
1193
|
+
n + 1
|
|
1194
|
+
),
|
|
1195
|
+
onClick: V((w) => o(s).toggleRowExpansion(t.key), ["stop"])
|
|
1196
|
+
}, [
|
|
1197
|
+
S(e.$slots, "expand-icon", {
|
|
1198
|
+
row: t.row,
|
|
1199
|
+
index: n,
|
|
1200
|
+
expanded: o($).has(t.token),
|
|
1201
|
+
loading: o(ne).has(t.token),
|
|
1202
|
+
depth: t.depth
|
|
1203
|
+
}, () => [
|
|
1204
|
+
(u(), A(Me(
|
|
1205
|
+
o(ne).has(t.token) ? o(ot) : o($).has(t.token) ? o(at) : o(Ot)
|
|
1206
|
+
), {
|
|
1207
|
+
class: Ae({
|
|
1208
|
+
"hys-ui-table-spinner": o(ne).has(t.token)
|
|
1209
|
+
}),
|
|
1210
|
+
size: 16,
|
|
1211
|
+
"aria-hidden": "true"
|
|
1212
|
+
}, null, 8, ["class"]))
|
|
1213
|
+
], !0)
|
|
1214
|
+
], 8, oa)) : a.type !== "expand" ? (u(), c("div", na, [
|
|
1215
|
+
i.treeMode && a.key === ge.value ? (u(), c("span", {
|
|
1216
|
+
key: 0,
|
|
1217
|
+
class: "hys-ui-table-tree-indent",
|
|
1218
|
+
style: he({
|
|
1219
|
+
width: Math.min(t.depth, 100) * Math.max(0, i.indent) + "px"
|
|
1220
|
+
})
|
|
1221
|
+
}, null, 4)) : g("", !0),
|
|
1222
|
+
i.treeMode && a.key === ge.value && !Dt.value && i.showExpandColumn ? (u(), c(E, { key: 1 }, [
|
|
1223
|
+
o(s).canExpand(t) ? (u(), c("button", {
|
|
1224
|
+
key: 0,
|
|
1225
|
+
type: "button",
|
|
1226
|
+
class: "hys-ui-table-expand",
|
|
1227
|
+
disabled: o(k),
|
|
1228
|
+
"aria-expanded": o($).has(t.token),
|
|
1229
|
+
"aria-label": (o($).has(t.token) ? p.value.collapse : p.value.expand) + Ue(
|
|
1230
|
+
o(Be)(
|
|
1231
|
+
t.row,
|
|
1232
|
+
a.dataIndex ?? a.key
|
|
1233
|
+
)
|
|
1234
|
+
),
|
|
1235
|
+
onClick: V((w) => o(s).toggleRowExpansion(t.key), ["stop"])
|
|
1236
|
+
}, [
|
|
1237
|
+
S(e.$slots, "expand-icon", {
|
|
1238
|
+
row: t.row,
|
|
1239
|
+
index: n,
|
|
1240
|
+
expanded: o($).has(t.token),
|
|
1241
|
+
loading: o(ne).has(t.token),
|
|
1242
|
+
depth: t.depth
|
|
1243
|
+
}, () => [
|
|
1244
|
+
(u(), A(Me(
|
|
1245
|
+
o(ne).has(t.token) ? o(ot) : o($).has(t.token) ? o(at) : o(Ot)
|
|
1246
|
+
), {
|
|
1247
|
+
class: Ae({
|
|
1248
|
+
"hys-ui-table-spinner": o(ne).has(
|
|
1249
|
+
t.token
|
|
1250
|
+
)
|
|
1251
|
+
}),
|
|
1252
|
+
size: 16,
|
|
1253
|
+
"aria-hidden": "true"
|
|
1254
|
+
}, null, 8, ["class"]))
|
|
1255
|
+
], !0)
|
|
1256
|
+
], 8, ia)) : (u(), c("span", sa))
|
|
1257
|
+
], 64)) : g("", !0),
|
|
1258
|
+
T("span", {
|
|
1259
|
+
class: Ae(["hys-ui-table-cell-text", {
|
|
1260
|
+
"hys-ui-table-ellipsis": a.ellipsis || a.showOverflowTooltip || i.showOverflowTooltip
|
|
1261
|
+
}]),
|
|
1262
|
+
tabindex: a.showOverflowTooltip ?? i.showOverflowTooltip ? 0 : void 0,
|
|
1263
|
+
"aria-describedby": o(Ct) && ((y = _.value) == null ? void 0 : y.row) === t.row && _.value.column.key === a.key ? o(de) + "-tooltip" : void 0,
|
|
1264
|
+
onPointerenter: (w) => St(
|
|
1265
|
+
H(t.row, a, n, f),
|
|
1266
|
+
w
|
|
1267
|
+
),
|
|
1268
|
+
onPointerleave: Ye,
|
|
1269
|
+
onFocus: (w) => St(
|
|
1270
|
+
H(t.row, a, n, f),
|
|
1271
|
+
w
|
|
1272
|
+
),
|
|
1273
|
+
onBlur: Ye
|
|
1274
|
+
}, [
|
|
1275
|
+
S(e.$slots, a.key, {
|
|
1276
|
+
row: t.row,
|
|
1277
|
+
value: o(Be)(
|
|
1278
|
+
t.row,
|
|
1279
|
+
a.dataIndex ?? a.key
|
|
1280
|
+
),
|
|
1281
|
+
index: n,
|
|
1282
|
+
column: a
|
|
1283
|
+
}, () => [
|
|
1284
|
+
S(e.$slots, "body-cell", {
|
|
1285
|
+
row: t.row,
|
|
1286
|
+
column: a,
|
|
1287
|
+
value: o(Be)(
|
|
1288
|
+
t.row,
|
|
1289
|
+
a.dataIndex ?? a.key
|
|
1290
|
+
),
|
|
1291
|
+
index: n
|
|
1292
|
+
}, () => [
|
|
1293
|
+
q(ke, {
|
|
1294
|
+
value: Yt(
|
|
1295
|
+
H(
|
|
1296
|
+
t.row,
|
|
1297
|
+
a,
|
|
1298
|
+
n,
|
|
1299
|
+
f
|
|
1300
|
+
)
|
|
1301
|
+
)
|
|
1302
|
+
}, null, 8, ["value"])
|
|
1303
|
+
], !0)
|
|
1304
|
+
], !0)
|
|
1305
|
+
], 42, ra),
|
|
1306
|
+
a.key === ge.value && o(Wt).has(t.token) ? (u(), A(ce, {
|
|
1307
|
+
key: 2,
|
|
1308
|
+
size: "sm",
|
|
1309
|
+
variant: "ghost",
|
|
1310
|
+
"aria-label": p.value.retryLabel,
|
|
1311
|
+
onClick: V((w) => o(s).loadRow(t.key, !0), ["stop"])
|
|
1312
|
+
}, {
|
|
1313
|
+
default: te(() => [
|
|
1314
|
+
q(o(Tl), { size: 13 }),
|
|
1315
|
+
D(O(p.value.retry), 1)
|
|
1316
|
+
]),
|
|
1317
|
+
_: 1
|
|
1318
|
+
}, 8, ["aria-label", "onClick"])) : g("", !0)
|
|
1319
|
+
])) : g("", !0)
|
|
1320
|
+
];
|
|
1321
|
+
}),
|
|
1322
|
+
_: 2
|
|
1323
|
+
}, 1040, ["scope", "data-column-key", "rowspan", "colspan", "style", "class", "onClick", "onDblclick", "onContextmenu", "onMouseenter", "onMouseleave"])) : g("", !0)
|
|
1324
|
+
], 64))), 128))
|
|
1325
|
+
], 16, aa),
|
|
1326
|
+
mt(t) ? bl((u(), c("tr", ua, [
|
|
1327
|
+
T("td", {
|
|
1328
|
+
colspan: Math.max(1, m.value.leaves.length)
|
|
1329
|
+
}, [
|
|
1330
|
+
S(e.$slots, "expand", {
|
|
1331
|
+
row: t.row,
|
|
1332
|
+
index: n,
|
|
1333
|
+
expanded: o($).has(t.token)
|
|
1334
|
+
}, void 0, !0)
|
|
1335
|
+
], 8, ca)
|
|
1336
|
+
], 512)), [
|
|
1337
|
+
[gl, o($).has(t.token)]
|
|
1338
|
+
]) : g("", !0)
|
|
1339
|
+
], 64);
|
|
1340
|
+
}), 128)),
|
|
1341
|
+
o(Y).length ? g("", !0) : (u(), c("tr", da, [
|
|
1342
|
+
T("td", {
|
|
1343
|
+
colspan: Math.max(1, m.value.leaves.length)
|
|
80
1344
|
}, [
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
value: e[n.key],
|
|
84
|
-
index: r
|
|
85
|
-
}, () => [
|
|
86
|
-
k(c(e[n.key]), 1)
|
|
1345
|
+
S(e.$slots, "empty", {}, () => [
|
|
1346
|
+
D(O(i.emptyText ?? p.value.emptyText), 1)
|
|
87
1347
|
], !0)
|
|
88
|
-
],
|
|
89
|
-
]
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
colspan:
|
|
94
|
-
|
|
1348
|
+
], 8, ya)
|
|
1349
|
+
]))
|
|
1350
|
+
], 64)),
|
|
1351
|
+
e.$slots.append ? (u(), c("tr", fa, [
|
|
1352
|
+
T("td", {
|
|
1353
|
+
colspan: Math.max(1, m.value.leaves.length)
|
|
1354
|
+
}, [
|
|
1355
|
+
S(e.$slots, "append", {
|
|
1356
|
+
rows: o(s).filteredRows.value
|
|
1357
|
+
}, void 0, !0)
|
|
1358
|
+
], 8, va)
|
|
1359
|
+
])) : g("", !0)
|
|
1360
|
+
]),
|
|
1361
|
+
i.showSummary && !i.loading ? (u(), c("tfoot", ma, [
|
|
1362
|
+
T("tr", null, [
|
|
1363
|
+
(u(!0), c(E, null, X(m.value.leaves, (t, n) => (u(), c("td", {
|
|
1364
|
+
key: t.key,
|
|
1365
|
+
"data-column-key": t.key,
|
|
1366
|
+
style: he({ ...je(t), textAlign: t.align })
|
|
95
1367
|
}, [
|
|
96
|
-
|
|
97
|
-
|
|
1368
|
+
S(e.$slots, "summary-cell", {
|
|
1369
|
+
column: t,
|
|
1370
|
+
index: n,
|
|
1371
|
+
value: ht.value[n],
|
|
1372
|
+
rows: o(s).filteredRows.value
|
|
1373
|
+
}, () => [
|
|
1374
|
+
q(ke, {
|
|
1375
|
+
value: ht.value[n]
|
|
1376
|
+
}, null, 8, ["value"])
|
|
98
1377
|
], !0)
|
|
99
|
-
],
|
|
100
|
-
])
|
|
101
|
-
],
|
|
102
|
-
])
|
|
103
|
-
])
|
|
104
|
-
|
|
1378
|
+
], 12, ha))), 128))
|
|
1379
|
+
])
|
|
1380
|
+
])) : g("", !0)
|
|
1381
|
+
], 4)
|
|
1382
|
+
], 44, Dl),
|
|
1383
|
+
e.$slots.footer ? (u(), c("div", pa, [
|
|
1384
|
+
S(e.$slots, "footer", {
|
|
1385
|
+
rows: o(s).filteredRows.value,
|
|
1386
|
+
query: o(De)
|
|
1387
|
+
}, void 0, !0)
|
|
1388
|
+
])) : g("", !0),
|
|
1389
|
+
(u(!0), c(E, null, X(ct.value.filter(
|
|
1390
|
+
(t) => t.startsWith("bottom-")
|
|
1391
|
+
), (t) => (u(), c("div", {
|
|
1392
|
+
key: t,
|
|
1393
|
+
class: "hys-ui-table-pagination",
|
|
1394
|
+
"data-position": t
|
|
1395
|
+
}, [
|
|
1396
|
+
q(Kt, W({ ref_for: !0 }, dt.value, {
|
|
1397
|
+
onChange: l[6] || (l[6] = (n) => o(s).requestPage(n)),
|
|
1398
|
+
onPageSizeChange: o(s).changeSize
|
|
1399
|
+
}), null, 16, ["onPageSizeChange"])
|
|
1400
|
+
], 8, ka))), 128)),
|
|
1401
|
+
(u(), A(Pt, {
|
|
1402
|
+
to: i.appendFilterTo || "body",
|
|
1403
|
+
disabled: i.appendFilterTo === !1
|
|
1404
|
+
}, [
|
|
1405
|
+
o(j) && b.value ? (u(), c("div", W({
|
|
1406
|
+
key: 0,
|
|
1407
|
+
id: o(de) + "-filter",
|
|
1408
|
+
ref_key: "filterPanel",
|
|
1409
|
+
ref: Xe
|
|
1410
|
+
}, o(Pe), {
|
|
1411
|
+
class: "hys-ui-table-filter-panel hys-ui-floating-surface",
|
|
1412
|
+
style: o(_t),
|
|
1413
|
+
role: "dialog",
|
|
1414
|
+
"aria-label": p.value.filter + b.value.label
|
|
1415
|
+
}), [
|
|
1416
|
+
S(e.$slots, "filter-dropdown", {
|
|
1417
|
+
column: b.value,
|
|
1418
|
+
open: o(j),
|
|
1419
|
+
values: Z.value,
|
|
1420
|
+
setValues: kt,
|
|
1421
|
+
confirm: Te,
|
|
1422
|
+
clear: wt,
|
|
1423
|
+
close: () => o(B).close(!0)
|
|
1424
|
+
}, () => [
|
|
1425
|
+
T("strong", null, O(b.value.label), 1),
|
|
1426
|
+
b.value.filters ? (u(), A(Ml, {
|
|
1427
|
+
key: b.value.key,
|
|
1428
|
+
values: Z.value,
|
|
1429
|
+
"onUpdate:values": l[7] || (l[7] = (t) => Z.value = t),
|
|
1430
|
+
options: b.value.filters,
|
|
1431
|
+
mode: b.value.filterMode,
|
|
1432
|
+
search: b.value.filterSearch,
|
|
1433
|
+
multiple: b.value.filterMultiple !== !1,
|
|
1434
|
+
disabled: o(k),
|
|
1435
|
+
"search-label": p.value.filterSearch,
|
|
1436
|
+
"empty-text": p.value.noFilterMatch
|
|
1437
|
+
}, null, 8, ["values", "options", "mode", "search", "multiple", "disabled", "search-label", "empty-text"])) : (u(), A(Fl, {
|
|
1438
|
+
key: 1,
|
|
1439
|
+
"model-value": String(Z.value[0] ?? ""),
|
|
1440
|
+
"aria-label": p.value.filter + b.value.label,
|
|
1441
|
+
placeholder: p.value.filterPlaceholder,
|
|
1442
|
+
clearable: "",
|
|
1443
|
+
size: "sm",
|
|
1444
|
+
"onUpdate:modelValue": l[8] || (l[8] = (t) => kt(t ? [t] : [])),
|
|
1445
|
+
onKeydown: lt(V(Te, ["prevent"]), ["enter"])
|
|
1446
|
+
}, null, 8, ["model-value", "aria-label", "placeholder", "onKeydown"])),
|
|
1447
|
+
T("div", ba, [
|
|
1448
|
+
q(ce, {
|
|
1449
|
+
size: "sm",
|
|
1450
|
+
variant: "secondary",
|
|
1451
|
+
onClick: l[9] || (l[9] = (t) => wt())
|
|
1452
|
+
}, {
|
|
1453
|
+
default: te(() => [
|
|
1454
|
+
D(O(p.value.reset), 1)
|
|
1455
|
+
]),
|
|
1456
|
+
_: 1
|
|
1457
|
+
}),
|
|
1458
|
+
q(ce, {
|
|
1459
|
+
size: "sm",
|
|
1460
|
+
onClick: l[10] || (l[10] = (t) => Te())
|
|
1461
|
+
}, {
|
|
1462
|
+
default: te(() => [
|
|
1463
|
+
D(O(p.value.apply), 1)
|
|
1464
|
+
]),
|
|
1465
|
+
_: 1
|
|
1466
|
+
})
|
|
1467
|
+
])
|
|
1468
|
+
], !0)
|
|
1469
|
+
], 16, wa)) : g("", !0)
|
|
1470
|
+
], 8, ["to", "disabled"])),
|
|
1471
|
+
(u(), A(Pt, { to: "body" }, [
|
|
1472
|
+
o(Ct) && _.value ? (u(), c("div", W({
|
|
1473
|
+
key: 0,
|
|
1474
|
+
id: o(de) + "-tooltip",
|
|
1475
|
+
ref_key: "tipPanel",
|
|
1476
|
+
ref: gt
|
|
1477
|
+
}, o(Pe), {
|
|
1478
|
+
class: "hys-ui-table-tooltip hys-ui-floating-tooltip",
|
|
1479
|
+
role: "tooltip",
|
|
1480
|
+
style: o(tl),
|
|
1481
|
+
onPointerenter: ll,
|
|
1482
|
+
onPointerleave: Ye
|
|
1483
|
+
}), [
|
|
1484
|
+
S(e.$slots, "tooltip", Cl(Sl(_.value)), () => [
|
|
1485
|
+
q(ke, { value: al.value }, null, 8, ["value"])
|
|
1486
|
+
], !0)
|
|
1487
|
+
], 16, ga)) : g("", !0)
|
|
1488
|
+
]))
|
|
1489
|
+
], 16, $l));
|
|
105
1490
|
}
|
|
106
1491
|
});
|
|
107
1492
|
export {
|
|
108
|
-
|
|
1493
|
+
Ea as default
|
|
109
1494
|
};
|