hys-ui 0.1.0 → 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 +137 -1
- package/README.md +18 -6
- package/dist/components/HysAccordion/HysAccordion.vue.js +1 -1
- package/dist/components/HysAccordion/HysAccordion2.vue.js +181 -47
- package/dist/components/HysAlert/HysAlert.vue.js +14 -14
- package/dist/components/HysAnimatedNumber/HysAnimatedNumber.vue.js +23 -20
- 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 -26
- 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 -84
- package/dist/components/HysCalendar/HysCalendar2.vue.js +803 -2
- package/dist/components/HysCard/HysCard.vue.js +1 -1
- package/dist/components/HysCard/HysCard2.vue.js +177 -44
- package/dist/components/HysCascader/HysCascader.vue.js +5 -182
- 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 +5 -39
- package/dist/components/HysCheckbox/HysCheckbox2.vue.js +200 -2
- 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/HysCommandPalette/HysCommandPalette.vue.js +52 -51
- package/dist/components/HysCommentEditor/HysCommentEditor.vue.js +17 -17
- package/dist/components/HysDataGrid/HysDataGrid.vue.js +1 -1
- package/dist/components/HysDataGrid/HysDataGrid2.vue.js +397 -390
- 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/HysDrawer/HysDrawer.vue.js +1 -1
- package/dist/components/HysDrawer/HysDrawer2.vue.js +55 -54
- package/dist/components/HysFileManager/HysFileManager.vue.js +5 -63
- package/dist/components/HysFileManager/HysFileManager2.vue.js +86 -2
- package/dist/components/HysForm/HysForm.vue.js +3 -3
- package/dist/components/HysForm/HysForm2.vue.js +580 -92
- package/dist/components/HysFormItem/HysFormItem.vue.js +5 -69
- package/dist/components/HysFormItem/HysFormItem2.vue.js +521 -2
- package/dist/components/HysGantt/HysGantt.vue.js +5 -264
- package/dist/components/HysGantt/HysGantt2.vue.js +1399 -2
- package/dist/components/HysInput/HysInput.vue.js +2 -2
- package/dist/components/HysInput/HysInput2.vue.js +468 -120
- package/dist/components/HysMention/HysMention.vue.js +2 -2
- package/dist/components/HysMention/HysMention2.vue.js +89 -88
- package/dist/components/HysModal/HysModal.vue.js +2 -2
- package/dist/components/HysModal/HysModal2.vue.js +35 -35
- package/dist/components/HysNotificationCenter/HysNotificationCenter.vue.js +37 -36
- package/dist/components/HysNumberInput/HysNumberInput.vue.js +2 -2
- package/dist/components/HysNumberInput/HysNumberInput2.vue.js +561 -70
- package/dist/components/HysOrgTree/HysOrgTree.vue.js +41 -36
- package/dist/components/HysPagination/HysPagination.vue.js +2 -2
- package/dist/components/HysPagination/HysPagination2.vue.js +93 -91
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix.vue.js +5 -41
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix2.vue.js +101 -2
- 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 +5 -40
- package/dist/components/HysRadioGroup/HysRadioGroup2.vue.js +205 -2
- package/dist/components/HysRating/HysRating.vue.js +1 -1
- package/dist/components/HysRating/HysRating2.vue.js +288 -68
- package/dist/components/HysResizablePanel/HysResizablePanel.vue.js +46 -28
- package/dist/components/HysRichTextEditor/HysRichTextEditor.vue.js +2 -2
- package/dist/components/HysRichTextEditor/HysRichTextEditor2.vue.js +87 -67
- package/dist/components/HysSearch/HysSearch.vue.js +50 -38
- package/dist/components/HysSegmented/HysSegmented.vue.js +5 -58
- 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 -164
- 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/HysSplitPane/HysSplitPane.vue.js +48 -42
- package/dist/components/HysSteps/HysSteps.vue.js +2 -2
- package/dist/components/HysSteps/HysSteps2.vue.js +111 -36
- package/dist/components/HysSwitch/HysSwitch.vue.js +2 -2
- package/dist/components/HysSwitch/HysSwitch2.vue.js +235 -42
- package/dist/components/HysTable/HysTable.vue.js +1 -1
- package/dist/components/HysTable/HysTable2.vue.js +1471 -82
- 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 -66
- package/dist/components/HysTagInput/HysTagInput.vue.js +43 -42
- package/dist/components/HysTextarea/HysTextarea.vue.js +137 -66
- package/dist/components/HysToast/HysToast.vue.js +2 -2
- package/dist/components/HysToast/HysToast2.vue.js +121 -38
- package/dist/components/HysTour/HysTour.vue.js +47 -42
- package/dist/components/HysTransfer/HysTransfer.vue.js +5 -207
- 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 -301
- package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +5 -129
- 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 +97 -78
- 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 +94 -3
- 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/toastEscape.js +16 -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/useDialog.js +16 -16
- package/dist/composables/useFloating.js +98 -52
- package/dist/composables/useGanttDependencies.js +306 -0
- package/dist/composables/useGanttHistory.js +157 -0
- package/dist/composables/useGanttLabelResize.js +100 -0
- package/dist/composables/useHysToast.js +148 -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/config.js +18 -15
- package/dist/index.js +149 -136
- 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 -29
- package/dist/types/components/HysCard/HysCard.vue.d.ts +57 -5
- 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 +55 -27
- 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/HysDrawer/HysDrawer.vue.d.ts +1 -0
- package/dist/types/components/HysFileManager/HysFileManager.vue.d.ts +8 -4
- 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 +88 -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 -33
- package/dist/types/components/HysOrgTree/HysOrgTree.vue.d.ts +4 -1
- package/dist/types/components/HysPagination/HysPagination.vue.d.ts +1 -1
- package/dist/types/components/HysPermissionMatrix/HysPermissionMatrix.vue.d.ts +8 -1
- 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 +62 -17
- package/dist/types/components/HysRating/HysRating.vue.d.ts +85 -5
- package/dist/types/components/HysResizablePanel/HysResizablePanel.vue.d.ts +6 -0
- 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 -14
- 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 +6 -0
- package/dist/types/components/HysSteps/HysSteps.vue.d.ts +65 -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 +55 -7
- package/dist/types/components/HysTour/HysTour.vue.d.ts +5 -3
- package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +55 -30
- 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 +138 -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/toastEscape.d.ts +1 -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/useHysToast.d.ts +50 -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 +38 -7
- package/package.json +47 -11
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useHysRootAttrs as
|
|
3
|
-
import { Settings2 as
|
|
4
|
-
import { useMotion as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
const
|
|
1
|
+
import { defineComponent as Kt, ref as v, watch as D, computed as b, useId as At, nextTick as Me, onDeactivated as Rt, onBeforeUnmount as Et, openBlock as r, createElementBlock as d, mergeProps as Lt, unref as K, createElementVNode as m, createVNode as p, createTextVNode as X, createCommentVNode as k, withCtx as z, toDisplayString as B, createBlock as le, normalizeStyle as G, normalizeClass as fe, Fragment as $, renderList as ye, withModifiers as A, withKeys as pe, resolveDynamicComponent as Xe, renderSlot as Bt } from "vue";
|
|
2
|
+
import { useHysRootAttrs as Ft } from "../../config.js";
|
|
3
|
+
import { Settings2 as Tt, ChevronUp as Ut, ChevronDown as Re, Search as $t, ChevronRight as Ge } from "lucide-vue-next";
|
|
4
|
+
import { useMotion as Ht } from "../../motion/useMotion.js";
|
|
5
|
+
import Nt from "../HysSortableList/HysSortableList.vue.js";
|
|
6
|
+
import Je from "../HysSelect/HysSelect.vue.js";
|
|
7
|
+
import Ve from "../HysInput/HysInput.vue.js";
|
|
8
|
+
import Ee from "../HysCheckbox/HysCheckbox.vue.js";
|
|
9
|
+
import R from "../HysButton/HysButton.vue.js";
|
|
10
|
+
import Ot from "../HysPagination/HysPagination.vue.js";
|
|
11
|
+
const Pt = { class: "hys-ui-pf-grid-toolbar" }, jt = { class: "hys-ui-pf-grid-search" }, qt = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "hys-ui-pf-grid-group-label"
|
|
14
|
-
},
|
|
14
|
+
}, It = {
|
|
15
15
|
key: 1,
|
|
16
16
|
class: "hys-ui-pf-grid-batch"
|
|
17
|
-
},
|
|
17
|
+
}, Wt = { class: "hys-ui-pf-grid-count" }, Xt = {
|
|
18
18
|
key: 0,
|
|
19
19
|
class: "hys-ui-pf-grid-panel"
|
|
20
|
-
},
|
|
20
|
+
}, Gt = {
|
|
21
21
|
key: 0,
|
|
22
22
|
style: { width: "44px" }
|
|
23
|
-
},
|
|
23
|
+
}, Jt = {
|
|
24
24
|
key: 0,
|
|
25
25
|
scope: "col",
|
|
26
26
|
class: "hys-ui-pf-grid-select-col"
|
|
27
|
-
},
|
|
27
|
+
}, Qt = ["data-column-key", "data-drop-position", "draggable", "onDragstart", "onDragover", "onDrop", "aria-sort"], Yt = { class: "hys-ui-pf-grid-head" }, Zt = { class: "hys-ui-pf-grid-sort-group" }, _t = { class: "hys-ui-pf-grid-sort-label" }, el = ["aria-label"], tl = ["aria-label", "onPointerdown", "onKeydown"], ll = ["id"], al = {
|
|
28
28
|
key: 0,
|
|
29
29
|
class: "hys-ui-pf-grid-select-col"
|
|
30
|
-
},
|
|
30
|
+
}, nl = ["data-filter-key", "data-column-key"], ol = { key: 0 }, rl = ["colspan"], sl = {
|
|
31
31
|
key: 0,
|
|
32
32
|
class: "hys-ui-pf-grid-group-row"
|
|
33
|
-
},
|
|
33
|
+
}, il = ["colspan"], ul = ["onClick"], dl = {
|
|
34
34
|
key: 0,
|
|
35
35
|
class: "hys-ui-pf-grid-select-col"
|
|
36
|
-
},
|
|
36
|
+
}, cl = ["data-column-key", "title"], fl = ["onDblclick"], yl = { key: 0 }, vl = ["colspan"], ml = { key: 0 }, pl = { class: "hys-ui-pf-grid-summary-row" }, gl = {
|
|
37
37
|
key: 0,
|
|
38
38
|
class: "hys-ui-pf-grid-select-col"
|
|
39
|
-
},
|
|
39
|
+
}, hl = ["data-column-key"], kl = { class: "hys-ui-pf-grid-footer" }, Qe = 160, Rl = /* @__PURE__ */ Kt({
|
|
40
40
|
__name: "HysDataGrid",
|
|
41
41
|
props: {
|
|
42
42
|
columns: {},
|
|
@@ -60,8 +60,8 @@ const Ft = { class: "hys-ui-pf-grid-toolbar" }, Ht = { class: "hys-ui-pf-grid-se
|
|
|
60
60
|
editable: { type: Boolean }
|
|
61
61
|
},
|
|
62
62
|
emits: ["rowClick", "selectionChange", "columnsChange", "sortChange", "pageChange", "queryChange", "pageSizeChange", "cellEdit", "batchEdit"],
|
|
63
|
-
setup(
|
|
64
|
-
const
|
|
63
|
+
setup(u, { expose: Ye, emit: Ze }) {
|
|
64
|
+
const _e = Ft(), o = u, M = Ze, H = (() => {
|
|
65
65
|
if (!o.storageKey || typeof localStorage > "u") return {};
|
|
66
66
|
try {
|
|
67
67
|
const t = JSON.parse(localStorage.getItem("hys-ui-grid:" + o.storageKey) || "{}");
|
|
@@ -69,732 +69,739 @@ const Ft = { class: "hys-ui-pf-grid-toolbar" }, Ht = { class: "hys-ui-pf-grid-se
|
|
|
69
69
|
} catch {
|
|
70
70
|
return {};
|
|
71
71
|
}
|
|
72
|
-
})(),
|
|
73
|
-
|
|
72
|
+
})(), et = Array.isArray(H.order) ? H.order.filter((t) => typeof t == "string") : [], tt = Array.isArray(H.hidden) ? H.hidden.filter((t) => typeof t == "string") : [], lt = H.widths && typeof H.widths == "object" && !Array.isArray(H.widths) ? Object.fromEntries(Object.entries(H.widths).filter((t) => typeof t[1] == "number" && Number.isFinite(t[1]))) : {}, V = v(et), w = v(tt), g = v(lt), ae = v(null), N = v([]), ge = v(Math.max(1, o.pageSize)), O = v({}), ne = v(""), J = v(""), Q = v([]), Y = v(null), he = v(""), ve = v(""), ke = v(""), P = v([]), C = v(1), h = v([]), Z = v(!1), De = v(null), oe = v(null);
|
|
73
|
+
D(() => o.columns, () => {
|
|
74
74
|
if (!o.columns.length) return;
|
|
75
75
|
const t = o.columns.map((l) => l.key);
|
|
76
|
-
|
|
76
|
+
V.value = [.../* @__PURE__ */ new Set([...V.value.filter((l) => t.includes(l)), ...t])], w.value = [...new Set(w.value.filter((l) => o.columns.some((e) => e.key === l && e.hideable !== !1)))], t.every((l) => w.value.includes(l)) && (w.value = []), g.value = Object.fromEntries(o.columns.filter((l) => g.value[l.key] != null).map((l) => [
|
|
77
77
|
l.key,
|
|
78
|
-
Math.max(l.minWidth || 80, Math.min(l.maxWidth || 800,
|
|
78
|
+
Math.max(l.minWidth || 80, Math.min(l.maxWidth || 800, g.value[l.key]))
|
|
79
79
|
]));
|
|
80
80
|
}, { immediate: !0, deep: !0 });
|
|
81
81
|
function Le() {
|
|
82
82
|
if (!(!o.storageKey || typeof localStorage > "u"))
|
|
83
83
|
try {
|
|
84
|
-
localStorage.setItem("hys-ui-grid:" + o.storageKey, JSON.stringify({ order:
|
|
84
|
+
localStorage.setItem("hys-ui-grid:" + o.storageKey, JSON.stringify({ order: V.value, hidden: w.value, widths: g.value }));
|
|
85
85
|
} catch {
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
Le(),
|
|
89
|
-
Le(),
|
|
88
|
+
Le(), D([V, w, g], () => {
|
|
89
|
+
Le(), M("columnsChange", E.value.map((t) => t.key));
|
|
90
90
|
}, { deep: !0 });
|
|
91
|
-
const
|
|
92
|
-
const l = [.../* @__PURE__ */ new Set([...
|
|
91
|
+
const E = b(() => {
|
|
92
|
+
const l = [.../* @__PURE__ */ new Set([...V.value, ...o.columns.map((e) => e.key)])].filter((e) => !w.value.includes(e)).map((e) => o.columns.find((a) => a.key === e)).filter((e) => !!e);
|
|
93
93
|
return l.length ? l : o.columns;
|
|
94
94
|
});
|
|
95
|
-
|
|
96
|
-
const L = b(() => [...
|
|
97
|
-
async function
|
|
95
|
+
Ye({ resetColumns: We });
|
|
96
|
+
const L = b(() => [...E.value.filter((t) => t.pinned === "left"), ...E.value.filter((t) => !t.pinned), ...E.value.filter((t) => t.pinned === "right")]), j = v(!1), re = v(), Be = At();
|
|
97
|
+
async function Fe(t = !0) {
|
|
98
|
+
var a, n, s;
|
|
99
|
+
if (j.value = !1, !t) return;
|
|
100
|
+
await Me();
|
|
101
|
+
const e = Array.from(((a = oe.value) == null ? void 0 : a.querySelectorAll("thead th[data-column-key]")) || []).find((i) => i.dataset.columnKey === re.value);
|
|
102
|
+
(s = (e == null ? void 0 : e.querySelector(".hys-ui-pf-grid-filter")) || ((n = oe.value) == null ? void 0 : n.querySelector(".hys-ui-pf-grid-filter"))) == null || s.focus({ preventScroll: !0 });
|
|
103
|
+
}
|
|
104
|
+
async function at(t) {
|
|
98
105
|
var e, a;
|
|
99
|
-
|
|
100
|
-
|
|
106
|
+
if (j.value && re.value === t.key) {
|
|
107
|
+
await Fe(!1);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
re.value = t.key, j.value = !0, await Me();
|
|
111
|
+
const l = Array.from(((e = oe.value) == null ? void 0 : e.querySelectorAll("[data-filter-key]")) || []).find((n) => n.dataset.filterKey === t.key);
|
|
101
112
|
(a = l == null ? void 0 : l.querySelector("input")) == null || a.focus({ preventScroll: !0 });
|
|
102
113
|
}
|
|
103
|
-
const
|
|
114
|
+
const nt = b(() => [.../* @__PURE__ */ new Set([...V.value, ...o.columns.map((t) => t.key)])].flatMap((t) => {
|
|
104
115
|
const l = o.columns.find((e) => e.key === t);
|
|
105
116
|
return l ? [{ id: t, label: l.label }] : [];
|
|
106
|
-
})),
|
|
117
|
+
})), ot = b(() => L.value.reduce((t, l) => t + (g.value[l.key] || l.width || 160), o.selectable ? 44 : 0)), rt = b(() => {
|
|
107
118
|
const t = {};
|
|
108
119
|
let l = o.selectable ? 44 : 0;
|
|
109
120
|
for (const a of L.value.filter((n) => n.pinned === "left"))
|
|
110
|
-
t[a.key] = { left: l + "px" }, l +=
|
|
121
|
+
t[a.key] = { left: l + "px" }, l += g.value[a.key] || a.width || 160;
|
|
111
122
|
let e = 0;
|
|
112
123
|
for (const a of [...L.value].reverse().filter((n) => n.pinned === "right"))
|
|
113
|
-
t[a.key] = { right: e + "px" }, e +=
|
|
124
|
+
t[a.key] = { right: e + "px" }, e += g.value[a.key] || a.width || 160;
|
|
114
125
|
return t;
|
|
115
|
-
}),
|
|
116
|
-
|
|
126
|
+
}), be = (t, l = !1) => t.pinned ? { position: "sticky", ...rt.value[t.key], zIndex: l ? 5 : 2 } : {}, se = b(() => Math.max(1, ge.value));
|
|
127
|
+
D(() => o.pageSize, (t) => ge.value = Math.max(1, t)), D(() => o.page, (t) => {
|
|
117
128
|
t != null && (C.value = Math.max(1, t));
|
|
118
129
|
});
|
|
119
|
-
const x = b(() => o.multiSort ?
|
|
130
|
+
const x = b(() => o.multiSort ? N.value : ae.value ? [ae.value] : []), ie = (t, l) => t[l] == null ? "" : String(t[l]), q = b(() => {
|
|
120
131
|
if (o.serverMode) return o.rows;
|
|
121
|
-
const t =
|
|
122
|
-
let l = o.rows.filter((e) => (!t || o.columns.some((a) =>
|
|
132
|
+
const t = ne.value.trim().toLocaleLowerCase();
|
|
133
|
+
let l = o.rows.filter((e) => (!t || o.columns.some((a) => ie(e, a.key).toLocaleLowerCase().includes(t))) && Object.entries(O.value).every(([a, n]) => !n || ie(e, a).toLocaleLowerCase().includes(n.toLocaleLowerCase())));
|
|
123
134
|
return x.value.length && (l = [...l].sort((e, a) => {
|
|
124
|
-
for (const { key: n, direction:
|
|
135
|
+
for (const { key: n, direction: s } of x.value) {
|
|
125
136
|
const i = e[n], y = a[n], f = typeof i == "number" && typeof y == "number" ? i - y : String(i ?? "").localeCompare(String(y ?? ""), "zh-CN", { numeric: !0 });
|
|
126
|
-
if (f) return
|
|
137
|
+
if (f) return s === "asc" ? f : -f;
|
|
127
138
|
}
|
|
128
139
|
return 0;
|
|
129
140
|
})), l;
|
|
130
|
-
}),
|
|
131
|
-
|
|
141
|
+
}), Te = b(() => Math.max(1, Math.ceil((o.serverMode ? o.totalRows ?? o.rows.length : q.value.length) / se.value)));
|
|
142
|
+
D([ne, O, ae, N, () => o.pageSize], () => {
|
|
132
143
|
C.value = 1;
|
|
133
|
-
}, { deep: !0 }),
|
|
144
|
+
}, { deep: !0 }), D(Te, (t) => {
|
|
134
145
|
C.value = Math.min(C.value, t);
|
|
135
146
|
});
|
|
136
|
-
const
|
|
147
|
+
const Ue = b(() => {
|
|
137
148
|
if (!o.treeMode) return q.value;
|
|
138
149
|
const t = q.value, l = new Set(t.map((i) => i[o.rowKey])), e = /* @__PURE__ */ new Map();
|
|
139
150
|
for (const i of t) {
|
|
140
|
-
const y = i[o.parentKey], f = y != null && l.has(y) ? y : null,
|
|
141
|
-
|
|
151
|
+
const y = i[o.parentKey], f = y != null && l.has(y) ? y : null, te = e.get(f) || [];
|
|
152
|
+
te.push(i), e.set(f, te);
|
|
142
153
|
}
|
|
143
|
-
const a = [], n = /* @__PURE__ */ new Set(),
|
|
144
|
-
if (!n.has(i) && (n.add(i), a.push({ ...i, __pfDepth: y, __pfHasChildren: (e.get(i[o.rowKey]) || []).length > 0 }),
|
|
145
|
-
for (const f of e.get(i[o.rowKey]) || [])
|
|
154
|
+
const a = [], n = /* @__PURE__ */ new Set(), s = (i, y) => {
|
|
155
|
+
if (!n.has(i) && (n.add(i), a.push({ ...i, __pfDepth: y, __pfHasChildren: (e.get(i[o.rowKey]) || []).length > 0 }), Q.value.includes(i[o.rowKey])))
|
|
156
|
+
for (const f of e.get(i[o.rowKey]) || []) s(f, y + 1);
|
|
146
157
|
};
|
|
147
|
-
for (const i of e.get(null) || [])
|
|
148
|
-
for (const i of t) n.has(i) ||
|
|
158
|
+
for (const i of e.get(null) || []) s(i, 0);
|
|
159
|
+
for (const i of t) n.has(i) || s(i, 0);
|
|
149
160
|
return a;
|
|
150
|
-
}),
|
|
161
|
+
}), we = b(() => o.serverMode ? Ue.value : Ue.value.slice((C.value - 1) * se.value, C.value * se.value)), _ = (t, l) => {
|
|
151
162
|
const e = t[o.rowKey];
|
|
152
|
-
return typeof e == "string" || typeof e == "number" ? e : l + (C.value - 1) *
|
|
163
|
+
return typeof e == "string" || typeof e == "number" ? e : l + (C.value - 1) * se.value;
|
|
153
164
|
};
|
|
154
|
-
|
|
165
|
+
D(() => o.rows, (t) => {
|
|
155
166
|
if (!o.serverMode) {
|
|
156
167
|
const l = new Set(t.map((a, n) => {
|
|
157
|
-
const
|
|
158
|
-
return typeof
|
|
168
|
+
const s = a[o.rowKey];
|
|
169
|
+
return typeof s == "string" || typeof s == "number" ? s : n;
|
|
159
170
|
})), e = h.value.filter((a) => l.has(a));
|
|
160
|
-
e.length !== h.value.length && (h.value = e,
|
|
171
|
+
e.length !== h.value.length && (h.value = e, M("selectionChange", e));
|
|
161
172
|
}
|
|
162
173
|
});
|
|
163
|
-
const
|
|
164
|
-
if (!
|
|
174
|
+
const $e = b(() => o.columns.filter((t) => t.key !== o.rowKey)), st = (t) => t == null || t === "" ? "(空)" : String(t), it = (t) => JSON.stringify(t ?? null), ut = b(() => {
|
|
175
|
+
if (!J.value) return we.value.map((e, a) => ({ kind: "row", row: e, index: a, key: String(_(e, a)) }));
|
|
165
176
|
const t = /* @__PURE__ */ new Map();
|
|
166
|
-
|
|
167
|
-
const n =
|
|
168
|
-
t.has(n) || t.set(n, { label:
|
|
177
|
+
we.value.forEach((e, a) => {
|
|
178
|
+
const n = it(e[J.value]);
|
|
179
|
+
t.has(n) || t.set(n, { label: st(e[J.value]), rows: [] }), t.get(n).rows.push({ row: e, index: a });
|
|
169
180
|
});
|
|
170
181
|
const l = [];
|
|
171
182
|
for (const [e, a] of t)
|
|
172
|
-
if (l.push({ kind: "group", key: e, label: a.label, count: a.rows.length }), !
|
|
183
|
+
if (l.push({ kind: "group", key: e, label: a.label, count: a.rows.length }), !P.value.includes(e)) for (const n of a.rows) l.push({ kind: "row", key: e + ":" + String(_(n.row, n.index)), row: n.row, index: n.index });
|
|
173
184
|
return l;
|
|
174
185
|
});
|
|
175
|
-
function
|
|
176
|
-
|
|
186
|
+
function dt(t) {
|
|
187
|
+
Q.value = Q.value.includes(t) ? Q.value.filter((l) => l !== t) : [...Q.value, t];
|
|
177
188
|
}
|
|
178
|
-
function
|
|
179
|
-
!o.editable || !l.editable || (
|
|
189
|
+
function ct(t, l) {
|
|
190
|
+
!o.editable || !l.editable || (Y.value = { id: _(t, 0), key: l.key }, he.value = ie(t, l.key));
|
|
180
191
|
}
|
|
181
|
-
function
|
|
182
|
-
|
|
192
|
+
function He(t, l) {
|
|
193
|
+
Y.value && (M("cellEdit", { row: t, rowKey: Y.value.id, column: l.key, value: he.value }), Y.value = null);
|
|
183
194
|
}
|
|
184
|
-
function
|
|
185
|
-
!
|
|
195
|
+
function ft() {
|
|
196
|
+
!ve.value || !h.value.length || (M("batchEdit", { keys: [...h.value], column: ve.value, value: ke.value }), ke.value = "");
|
|
186
197
|
}
|
|
187
|
-
function
|
|
188
|
-
|
|
198
|
+
function yt(t) {
|
|
199
|
+
P.value = P.value.includes(t) ? P.value.filter((l) => l !== t) : [...P.value, t];
|
|
189
200
|
}
|
|
190
|
-
|
|
191
|
-
const
|
|
201
|
+
D(J, () => P.value = []);
|
|
202
|
+
const vt = (t) => {
|
|
192
203
|
if (!t.summary) return "";
|
|
193
204
|
const l = q.value.map((n) => n[t.key]).filter((n) => n != null && n !== "");
|
|
194
205
|
if (t.summary === "count") return String(l.length);
|
|
195
206
|
const e = l.map(Number).filter(Number.isFinite);
|
|
196
207
|
if (!e.length) return "—";
|
|
197
|
-
const a = t.summary === "sum" ? e.reduce((n,
|
|
208
|
+
const a = t.summary === "sum" ? e.reduce((n, s) => n + s, 0) : t.summary === "avg" ? e.reduce((n, s) => n + s, 0) / e.length : t.summary === "min" ? Math.min(...e) : Math.max(...e);
|
|
198
209
|
return new Intl.NumberFormat("zh-CN", { maximumFractionDigits: 2 }).format(a);
|
|
199
|
-
},
|
|
200
|
-
function
|
|
201
|
-
h.value = l ? [.../* @__PURE__ */ new Set([...h.value, t])] : h.value.filter((e) => e !== t),
|
|
210
|
+
}, Ce = b(() => we.value.map((t, l) => _(t, l))), Ne = b(() => Ce.value.length > 0 && Ce.value.every((t) => h.value.includes(t))), mt = b(() => Ce.value.some((t) => h.value.includes(t)));
|
|
211
|
+
function pt(t, l) {
|
|
212
|
+
h.value = l ? [.../* @__PURE__ */ new Set([...h.value, t])] : h.value.filter((e) => e !== t), M("selectionChange", h.value);
|
|
202
213
|
}
|
|
203
|
-
function
|
|
204
|
-
const l = new Set(
|
|
205
|
-
h.value = t ? [.../* @__PURE__ */ new Set([...h.value, ...l])] : h.value.filter((e) => !l.has(e)),
|
|
214
|
+
function gt(t) {
|
|
215
|
+
const l = new Set(Ce.value);
|
|
216
|
+
h.value = t ? [.../* @__PURE__ */ new Set([...h.value, ...l])] : h.value.filter((e) => !l.has(e)), M("selectionChange", h.value);
|
|
206
217
|
}
|
|
207
|
-
function
|
|
218
|
+
function Oe(t, l) {
|
|
208
219
|
if (t.sortable === !1) return;
|
|
209
220
|
const e = l ? { key: t.key, direction: l } : null;
|
|
210
|
-
o.multiSort ? (
|
|
221
|
+
o.multiSort ? (N.value = N.value.filter((a) => a.key !== t.key), e && (N.value = [...N.value, e]), ae.value = N.value[0] ?? null) : (ae.value = e, N.value = e ? [e] : []), M("sortChange", ae.value);
|
|
211
222
|
}
|
|
212
|
-
function
|
|
223
|
+
function ht(t) {
|
|
213
224
|
var e;
|
|
214
225
|
const l = (e = x.value.find((a) => a.key === t.key)) == null ? void 0 : e.direction;
|
|
215
|
-
|
|
226
|
+
Oe(t, l === "asc" ? "desc" : l === "desc" ? null : "asc");
|
|
216
227
|
}
|
|
217
|
-
function
|
|
228
|
+
function Pe(t, l) {
|
|
218
229
|
var a;
|
|
219
230
|
const e = (a = x.value.find((n) => n.key === t.key)) == null ? void 0 : a.direction;
|
|
220
|
-
|
|
231
|
+
Oe(t, e === l ? null : l);
|
|
221
232
|
}
|
|
222
|
-
function
|
|
223
|
-
C.value = Math.max(1, Math.min(t,
|
|
233
|
+
function kt(t) {
|
|
234
|
+
C.value = Math.max(1, Math.min(t, Te.value)), M("pageChange", C.value);
|
|
224
235
|
}
|
|
225
|
-
function
|
|
226
|
-
|
|
236
|
+
function bt(t) {
|
|
237
|
+
ge.value = t, C.value = 1, M("pageSizeChange", t);
|
|
227
238
|
}
|
|
228
|
-
|
|
229
|
-
function
|
|
230
|
-
t.hideable !== !1 && (w.value.includes(t.key) ? w.value = w.value.filter((l) => l !== t.key) :
|
|
239
|
+
D([C, ge, x, ne, O], () => M("queryChange", { page: C.value, pageSize: se.value, sort: [...x.value], search: ne.value, filters: { ...O.value } }), { deep: !0 });
|
|
240
|
+
function wt(t) {
|
|
241
|
+
t.hideable !== !1 && (w.value.includes(t.key) ? w.value = w.value.filter((l) => l !== t.key) : E.value.length > 1 && (w.value = [...w.value, t.key]));
|
|
231
242
|
}
|
|
232
|
-
let
|
|
233
|
-
function
|
|
234
|
-
|
|
243
|
+
let F = null;
|
|
244
|
+
function je(t) {
|
|
245
|
+
F && (g.value = { ...g.value, [F.key]: Math.max(F.min, Math.min(F.max, F.width + t.clientX - F.start)) });
|
|
235
246
|
}
|
|
236
|
-
function
|
|
237
|
-
|
|
247
|
+
function xe() {
|
|
248
|
+
F = null, window.removeEventListener("pointermove", je), window.removeEventListener("pointerup", xe), document.body.style.cursor = "";
|
|
238
249
|
}
|
|
239
|
-
function
|
|
240
|
-
l.resizable !== !1 && (t.preventDefault(), t.stopPropagation(),
|
|
250
|
+
function Ct(t, l) {
|
|
251
|
+
l.resizable !== !1 && (t.preventDefault(), t.stopPropagation(), F = { key: l.key, start: t.clientX, width: g.value[l.key] || l.width || 160, min: l.minWidth || 80, max: l.maxWidth || 800 }, document.body.style.cursor = "col-resize", window.addEventListener("pointermove", je), window.addEventListener("pointerup", xe));
|
|
241
252
|
}
|
|
242
|
-
const { effectiveMotion:
|
|
243
|
-
let
|
|
244
|
-
const
|
|
245
|
-
function
|
|
246
|
-
|
|
247
|
-
for (const t of
|
|
248
|
-
|
|
253
|
+
const { effectiveMotion: Se } = Ht(), ue = v(null), I = v(null);
|
|
254
|
+
let T = 0, de = null, Ke = 0;
|
|
255
|
+
const me = /* @__PURE__ */ new Set();
|
|
256
|
+
function ce() {
|
|
257
|
+
Ke++;
|
|
258
|
+
for (const t of me) t.cancel();
|
|
259
|
+
me.clear();
|
|
249
260
|
}
|
|
250
|
-
|
|
251
|
-
t === "off" &&
|
|
261
|
+
D(Se, (t) => {
|
|
262
|
+
t === "off" && ce();
|
|
252
263
|
});
|
|
253
|
-
function
|
|
254
|
-
cancelAnimationFrame(
|
|
264
|
+
function ee() {
|
|
265
|
+
cancelAnimationFrame(T), T = 0, de = null, ue.value = null, I.value = null;
|
|
255
266
|
}
|
|
256
|
-
function
|
|
257
|
-
if (
|
|
267
|
+
function xt(t, l) {
|
|
268
|
+
if (F || l.reorderable === !1 || !t.dataTransfer) {
|
|
258
269
|
t.preventDefault();
|
|
259
270
|
return;
|
|
260
271
|
}
|
|
261
|
-
|
|
272
|
+
ce(), ue.value = l.key, t.dataTransfer.effectAllowed = "move", t.dataTransfer.setData("text/plain", l.key);
|
|
262
273
|
}
|
|
263
|
-
function
|
|
264
|
-
const l = o.columns.find((e) => e.key ===
|
|
274
|
+
function Ae(t) {
|
|
275
|
+
const l = o.columns.find((e) => e.key === ue.value);
|
|
265
276
|
return !!l && l.key !== t.key && l.reorderable !== !1 && t.reorderable !== !1 && l.pinned === t.pinned;
|
|
266
277
|
}
|
|
267
|
-
function
|
|
278
|
+
function qe(t, l, e) {
|
|
268
279
|
const a = e.getBoundingClientRect();
|
|
269
280
|
return { key: t.key, position: l < a.left + a.width / 2 ? "before" : "after" };
|
|
270
281
|
}
|
|
271
|
-
function
|
|
272
|
-
if (!
|
|
273
|
-
cancelAnimationFrame(
|
|
282
|
+
function St(t, l) {
|
|
283
|
+
if (!Ae(l)) {
|
|
284
|
+
cancelAnimationFrame(T), T = 0, de = null, I.value = null;
|
|
274
285
|
return;
|
|
275
286
|
}
|
|
276
|
-
t.preventDefault(), t.dataTransfer && (t.dataTransfer.dropEffect = "move"),
|
|
287
|
+
t.preventDefault(), t.dataTransfer && (t.dataTransfer.dropEffect = "move"), de = { element: t.currentTarget, column: l, x: t.clientX }, !T && (T = requestAnimationFrame(() => {
|
|
277
288
|
var n;
|
|
278
|
-
|
|
279
|
-
const e =
|
|
280
|
-
if (
|
|
281
|
-
const a =
|
|
282
|
-
(((n =
|
|
289
|
+
T = 0;
|
|
290
|
+
const e = de;
|
|
291
|
+
if (de = null, !e || !Ae(e.column)) return;
|
|
292
|
+
const a = qe(e.column, e.x, e.element);
|
|
293
|
+
(((n = I.value) == null ? void 0 : n.key) !== a.key || I.value.position !== a.position) && (I.value = a);
|
|
283
294
|
}));
|
|
284
295
|
}
|
|
285
|
-
function
|
|
286
|
-
t.relatedTarget instanceof Element && t.relatedTarget.closest("th[data-column-key]") && t.currentTarget.contains(t.relatedTarget) || (cancelAnimationFrame(
|
|
296
|
+
function zt(t) {
|
|
297
|
+
t.relatedTarget instanceof Element && t.relatedTarget.closest("th[data-column-key]") && t.currentTarget.contains(t.relatedTarget) || (cancelAnimationFrame(T), T = 0, de = null, I.value = null);
|
|
287
298
|
}
|
|
288
|
-
function
|
|
299
|
+
function Ie() {
|
|
289
300
|
var t;
|
|
290
|
-
return new Map(Array.from(((t =
|
|
301
|
+
return new Map(Array.from(((t = oe.value) == null ? void 0 : t.querySelectorAll("th[data-column-key]")) || []).map((l) => [
|
|
291
302
|
l.dataset.columnKey,
|
|
292
303
|
l.getBoundingClientRect()
|
|
293
304
|
]));
|
|
294
305
|
}
|
|
295
|
-
function
|
|
306
|
+
function Mt(t) {
|
|
296
307
|
var c;
|
|
297
|
-
if (
|
|
298
|
-
const l = (c =
|
|
308
|
+
if (Se.value === "off") return;
|
|
309
|
+
const l = (c = oe.value) == null ? void 0 : c.querySelector(".hys-ui-pf-grid-scroll");
|
|
299
310
|
if (!l) return;
|
|
300
|
-
const e = l.getBoundingClientRect(), a = Math.max(0, e.top), n = Math.min(window.innerHeight, e.bottom),
|
|
301
|
-
if (a >= n ||
|
|
311
|
+
const e = l.getBoundingClientRect(), a = Math.max(0, e.top), n = Math.min(window.innerHeight, e.bottom), s = Math.max(0, e.left), i = Math.min(window.innerWidth, e.right);
|
|
312
|
+
if (a >= n || s >= i) return;
|
|
302
313
|
const y = /* @__PURE__ */ new Map();
|
|
303
|
-
for (const [
|
|
304
|
-
const S = t.get(
|
|
305
|
-
S && U.right >
|
|
314
|
+
for (const [W, U] of Ie()) {
|
|
315
|
+
const S = t.get(W);
|
|
316
|
+
S && U.right > s && U.left < i && Math.abs(S.left - U.left) > 0.5 && y.set(W, S.left - U.left);
|
|
306
317
|
}
|
|
307
318
|
const f = [];
|
|
308
|
-
for (const
|
|
309
|
-
const U =
|
|
319
|
+
for (const W of Array.from(l.querySelectorAll("thead tr,tbody tr,tfoot tr"))) {
|
|
320
|
+
const U = W.getBoundingClientRect();
|
|
310
321
|
if (U.top >= n) break;
|
|
311
322
|
if (!(U.bottom <= a)) {
|
|
312
|
-
for (const S of Array.from(
|
|
313
|
-
if (S instanceof HTMLElement && y.has(S.dataset.columnKey || "") && f.push(S), f.length >=
|
|
314
|
-
if (f.length >=
|
|
323
|
+
for (const S of Array.from(W.children))
|
|
324
|
+
if (S instanceof HTMLElement && y.has(S.dataset.columnKey || "") && f.push(S), f.length >= Qe) break;
|
|
325
|
+
if (f.length >= Qe) break;
|
|
315
326
|
}
|
|
316
327
|
}
|
|
317
|
-
const
|
|
318
|
-
for (const
|
|
319
|
-
const U = y.get(
|
|
320
|
-
|
|
328
|
+
const te = Se.value === "full" ? 280 : 180;
|
|
329
|
+
for (const W of f) {
|
|
330
|
+
const U = y.get(W.dataset.columnKey), S = W.animate([{ transform: "translateX(" + U + "px)" }, { transform: "translateX(0)" }], { duration: te, easing: "cubic-bezier(.2,.8,.2,1)" });
|
|
331
|
+
me.add(S), S.onfinish = () => me.delete(S), S.oncancel = () => me.delete(S);
|
|
321
332
|
}
|
|
322
333
|
}
|
|
323
|
-
async function
|
|
324
|
-
if (!
|
|
325
|
-
|
|
334
|
+
async function Vt(t, l) {
|
|
335
|
+
if (!Ae(l)) {
|
|
336
|
+
ee();
|
|
326
337
|
return;
|
|
327
338
|
}
|
|
328
339
|
t.preventDefault();
|
|
329
|
-
const e =
|
|
340
|
+
const e = qe(l, t.clientX, t.currentTarget), a = V.value.filter((y) => y !== ue.value), n = a.indexOf(e.key);
|
|
330
341
|
if (n < 0) {
|
|
331
|
-
|
|
342
|
+
ee();
|
|
332
343
|
return;
|
|
333
344
|
}
|
|
334
|
-
if (a.splice(n + (e.position === "after" ? 1 : 0), 0,
|
|
335
|
-
|
|
336
|
-
const
|
|
337
|
-
|
|
345
|
+
if (a.splice(n + (e.position === "after" ? 1 : 0), 0, ue.value), ee(), a.every((y, f) => y === V.value[f])) return;
|
|
346
|
+
ce();
|
|
347
|
+
const s = Ke, i = Se.value === "off" ? /* @__PURE__ */ new Map() : Ie();
|
|
348
|
+
V.value = a, await Me(), s === Ke && Mt(i);
|
|
338
349
|
}
|
|
339
|
-
function
|
|
340
|
-
|
|
350
|
+
function We() {
|
|
351
|
+
ee(), ce(), V.value = o.columns.map((t) => t.key), w.value = [], g.value = {};
|
|
341
352
|
}
|
|
342
|
-
function
|
|
343
|
-
const t =
|
|
353
|
+
function Dt() {
|
|
354
|
+
const t = E.value, l = (s) => '"' + s.replace(/"/g, '""') + '"', e = "\uFEFF" + [t.map((s) => l(s.label)).join(","), ...q.value.map((s) => t.map((i) => l(ie(s, i.key))).join(","))].join(`\r
|
|
344
355
|
`), a = URL.createObjectURL(new Blob([e], { type: "text/csv;charset=utf-8" })), n = document.createElement("a");
|
|
345
356
|
n.href = a, n.download = "projectflow-table.csv", n.click(), setTimeout(() => URL.revokeObjectURL(a), 1e3);
|
|
346
357
|
}
|
|
347
|
-
function
|
|
348
|
-
|
|
349
|
-
}
|
|
350
|
-
return
|
|
351
|
-
t ? (await
|
|
352
|
-
}),
|
|
353
|
-
|
|
354
|
-
}),
|
|
355
|
-
|
|
356
|
-
}), (t, l) => (
|
|
357
|
-
class: ["hys-ui-pf-grid", "hys-ui-pf-grid--" +
|
|
358
|
+
function ze(t) {
|
|
359
|
+
De.value && !De.value.contains(t.target) && (Z.value = !1);
|
|
360
|
+
}
|
|
361
|
+
return D(Z, async (t) => {
|
|
362
|
+
t ? (await Me(), document.addEventListener("pointerdown", ze)) : document.removeEventListener("pointerdown", ze);
|
|
363
|
+
}), Rt(() => {
|
|
364
|
+
ee(), ce(), xe(), Z.value = !1, document.removeEventListener("pointerdown", ze);
|
|
365
|
+
}), Et(() => {
|
|
366
|
+
ee(), ce(), xe(), document.removeEventListener("pointerdown", ze);
|
|
367
|
+
}), (t, l) => (r(), d("section", Lt(K(_e), {
|
|
368
|
+
class: ["hys-ui-pf-grid", "hys-ui-pf-grid--" + u.density],
|
|
358
369
|
"aria-label": "数据表格",
|
|
359
370
|
ref_key: "tableRef",
|
|
360
|
-
ref:
|
|
371
|
+
ref: oe
|
|
361
372
|
}), [
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
l[
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
373
|
+
m("div", Pt, [
|
|
374
|
+
m("label", jt, [
|
|
375
|
+
l[12] || (l[12] = m("span", null, "搜索", -1)),
|
|
376
|
+
p(Ve, {
|
|
377
|
+
size: "sm",
|
|
378
|
+
modelValue: ne.value,
|
|
379
|
+
"onUpdate:modelValue": l[0] || (l[0] = (e) => ne.value = e),
|
|
368
380
|
type: "search",
|
|
369
381
|
placeholder: "搜索全部列…",
|
|
370
382
|
"aria-label": "搜索表格",
|
|
371
383
|
clearable: ""
|
|
372
384
|
}, null, 8, ["modelValue"])
|
|
373
385
|
]),
|
|
374
|
-
|
|
375
|
-
l[
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
386
|
+
u.groupable ? (r(), d("label", qt, [
|
|
387
|
+
l[13] || (l[13] = X("分组 ", -1)),
|
|
388
|
+
p(Je, {
|
|
389
|
+
size: "sm",
|
|
390
|
+
modelValue: J.value,
|
|
391
|
+
"onUpdate:modelValue": l[1] || (l[1] = (e) => J.value = e),
|
|
379
392
|
"aria-label": "按列分组",
|
|
380
|
-
options: [{ label: "不分组", value: "" },
|
|
393
|
+
options: [{ label: "不分组", value: "" }, ...$e.value.map((e) => ({ label: e.label, value: e.key }))]
|
|
381
394
|
}, null, 8, ["modelValue", "options"])
|
|
382
395
|
])) : k("", !0),
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
396
|
+
u.editable && h.value.length ? (r(), d("div", It, [
|
|
397
|
+
p(Je, {
|
|
398
|
+
size: "sm",
|
|
399
|
+
modelValue: ve.value,
|
|
400
|
+
"onUpdate:modelValue": l[2] || (l[2] = (e) => ve.value = e),
|
|
387
401
|
"aria-label": "批量编辑字段",
|
|
388
|
-
options: [{ label: "选择编辑列", value: "" }, ...
|
|
402
|
+
options: [{ label: "选择编辑列", value: "" }, ...u.columns.filter((e) => e.editable).map((e) => ({ label: e.label, value: e.key }))]
|
|
389
403
|
}, null, 8, ["modelValue", "options"]),
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
404
|
+
p(Ve, {
|
|
405
|
+
size: "sm",
|
|
406
|
+
modelValue: ke.value,
|
|
407
|
+
"onUpdate:modelValue": l[3] || (l[3] = (e) => ke.value = e),
|
|
393
408
|
"aria-label": "批量编辑值",
|
|
394
409
|
placeholder: "新值"
|
|
395
410
|
}, null, 8, ["modelValue"]),
|
|
396
|
-
|
|
411
|
+
p(R, {
|
|
397
412
|
variant: "ghost",
|
|
398
413
|
size: "sm",
|
|
399
414
|
type: "button",
|
|
400
|
-
disabled: !
|
|
401
|
-
onClick:
|
|
415
|
+
disabled: !ve.value,
|
|
416
|
+
onClick: ft
|
|
402
417
|
}, {
|
|
403
418
|
default: z(() => [
|
|
404
|
-
|
|
419
|
+
X("应用到 " + B(h.value.length) + " 行", 1)
|
|
405
420
|
]),
|
|
406
421
|
_: 1
|
|
407
422
|
}, 8, ["disabled"])
|
|
408
423
|
])) : k("", !0),
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
size: "sm",
|
|
424
|
-
type: "button",
|
|
425
|
-
onClick: l[5] || (l[5] = (e) => ae.value = !1)
|
|
426
|
-
}, {
|
|
427
|
-
default: z(() => [...l[16] || (l[16] = [
|
|
428
|
-
H("收起筛选", -1)
|
|
429
|
-
])]),
|
|
430
|
-
_: 1
|
|
431
|
-
})
|
|
432
|
-
], 64)) : k("", !0),
|
|
433
|
-
g("span", Pt, E(r.serverMode ? r.totalRows ?? r.rows.length : q.value.length) + " 条记录 · 已选 " + E(h.value.length), 1),
|
|
434
|
-
g("div", {
|
|
424
|
+
j.value ? (r(), le(R, {
|
|
425
|
+
key: 2,
|
|
426
|
+
variant: "ghost",
|
|
427
|
+
size: "sm",
|
|
428
|
+
type: "button",
|
|
429
|
+
onClick: l[4] || (l[4] = (e) => O.value = {})
|
|
430
|
+
}, {
|
|
431
|
+
default: z(() => [...l[14] || (l[14] = [
|
|
432
|
+
X("清空筛选", -1)
|
|
433
|
+
])]),
|
|
434
|
+
_: 1
|
|
435
|
+
})) : k("", !0),
|
|
436
|
+
m("span", Wt, B(u.serverMode ? u.totalRows ?? u.rows.length : q.value.length) + " 条记录 · 已选 " + B(h.value.length), 1),
|
|
437
|
+
m("div", {
|
|
435
438
|
class: "hys-ui-pf-grid-menu",
|
|
436
439
|
ref_key: "menuRef",
|
|
437
|
-
ref:
|
|
440
|
+
ref: De
|
|
438
441
|
}, [
|
|
439
|
-
|
|
442
|
+
p(R, {
|
|
440
443
|
variant: "ghost",
|
|
441
444
|
size: "sm",
|
|
442
445
|
type: "button",
|
|
443
|
-
onClick: l[
|
|
444
|
-
"aria-expanded":
|
|
446
|
+
onClick: l[5] || (l[5] = (e) => Z.value = !Z.value),
|
|
447
|
+
"aria-expanded": Z.value,
|
|
445
448
|
"aria-label": "配置显示列"
|
|
446
449
|
}, {
|
|
447
450
|
default: z(() => [
|
|
448
|
-
|
|
451
|
+
p(K(Tt), {
|
|
449
452
|
size: 16,
|
|
450
453
|
"aria-hidden": "true"
|
|
451
454
|
}),
|
|
452
|
-
l[
|
|
455
|
+
l[15] || (l[15] = X(" 列设置", -1))
|
|
453
456
|
]),
|
|
454
457
|
_: 1
|
|
455
458
|
}, 8, ["aria-expanded"]),
|
|
456
|
-
|
|
457
|
-
l[
|
|
458
|
-
|
|
459
|
+
Z.value ? (r(), d("div", Xt, [
|
|
460
|
+
l[17] || (l[17] = m("strong", null, "显示列与排序", -1)),
|
|
461
|
+
p(Nt, {
|
|
459
462
|
class: "hys-ui-pf-grid-settings-list",
|
|
460
|
-
"model-value":
|
|
461
|
-
"onUpdate:modelValue": l[
|
|
463
|
+
"model-value": nt.value,
|
|
464
|
+
"onUpdate:modelValue": l[6] || (l[6] = (e) => V.value = e.map((a) => a.id))
|
|
462
465
|
}, {
|
|
463
466
|
item: z(({ item: e }) => {
|
|
464
467
|
var a;
|
|
465
468
|
return [
|
|
466
|
-
|
|
469
|
+
p(Ee, {
|
|
467
470
|
"model-value": !w.value.includes(e.id),
|
|
468
471
|
label: e.label,
|
|
469
|
-
disabled: ((a =
|
|
470
|
-
"onUpdate:modelValue": (n) =>
|
|
472
|
+
disabled: ((a = u.columns.find((n) => n.key === e.id)) == null ? void 0 : a.hideable) === !1 || !w.value.includes(e.id) && E.value.length === 1,
|
|
473
|
+
"onUpdate:modelValue": (n) => wt(u.columns.find((s) => s.key === e.id))
|
|
471
474
|
}, null, 8, ["model-value", "label", "disabled", "onUpdate:modelValue"])
|
|
472
475
|
];
|
|
473
476
|
}),
|
|
474
477
|
_: 1
|
|
475
478
|
}, 8, ["model-value"]),
|
|
476
|
-
|
|
479
|
+
p(R, {
|
|
477
480
|
variant: "ghost",
|
|
478
481
|
size: "sm",
|
|
479
482
|
type: "button",
|
|
480
|
-
onClick:
|
|
483
|
+
onClick: We
|
|
481
484
|
}, {
|
|
482
|
-
default: z(() => [...l[
|
|
483
|
-
|
|
485
|
+
default: z(() => [...l[16] || (l[16] = [
|
|
486
|
+
X("恢复默认列", -1)
|
|
484
487
|
])]),
|
|
485
488
|
_: 1
|
|
486
489
|
})
|
|
487
490
|
])) : k("", !0)
|
|
488
491
|
], 512),
|
|
489
|
-
|
|
492
|
+
p(R, {
|
|
490
493
|
variant: "ghost",
|
|
491
494
|
size: "sm",
|
|
492
495
|
type: "button",
|
|
493
|
-
onClick:
|
|
496
|
+
onClick: Dt
|
|
494
497
|
}, {
|
|
495
|
-
default: z(() => [...l[
|
|
496
|
-
|
|
498
|
+
default: z(() => [...l[18] || (l[18] = [
|
|
499
|
+
X("导出 CSV", -1)
|
|
497
500
|
])]),
|
|
498
501
|
_: 1
|
|
499
502
|
})
|
|
500
503
|
]),
|
|
501
|
-
|
|
504
|
+
m("div", {
|
|
502
505
|
class: "hys-ui-pf-grid-scroll",
|
|
503
|
-
onDragleave:
|
|
506
|
+
onDragleave: zt
|
|
504
507
|
}, [
|
|
505
|
-
|
|
506
|
-
class:
|
|
507
|
-
style:
|
|
508
|
+
m("table", {
|
|
509
|
+
class: fe({ "hys-ui-pf-grid-sticky-head": u.stickyHeader }),
|
|
510
|
+
style: G({ minWidth: ot.value + "px" })
|
|
508
511
|
}, [
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
(
|
|
512
|
+
m("colgroup", null, [
|
|
513
|
+
u.selectable ? (r(), d("col", Gt)) : k("", !0),
|
|
514
|
+
(r(!0), d($, null, ye(L.value, (e) => (r(), d("col", {
|
|
512
515
|
key: e.key,
|
|
513
|
-
style:
|
|
516
|
+
style: G({ width: (g.value[e.key] || e.width || 160) + "px" })
|
|
514
517
|
}, null, 4))), 128))
|
|
515
518
|
]),
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
519
|
+
m("thead", null, [
|
|
520
|
+
m("tr", null, [
|
|
521
|
+
u.selectable ? (r(), d("th", Jt, [
|
|
522
|
+
p(Ee, {
|
|
520
523
|
"aria-label": "选择当前页全部行",
|
|
521
|
-
"model-value":
|
|
522
|
-
indeterminate:
|
|
523
|
-
"onUpdate:modelValue":
|
|
524
|
+
"model-value": Ne.value,
|
|
525
|
+
indeterminate: mt.value && !Ne.value,
|
|
526
|
+
"onUpdate:modelValue": gt
|
|
524
527
|
}, null, 8, ["model-value", "indeterminate"])
|
|
525
528
|
])) : k("", !0),
|
|
526
|
-
(
|
|
527
|
-
var a, n,
|
|
528
|
-
return
|
|
529
|
+
(r(!0), d($, null, ye(L.value, (e) => {
|
|
530
|
+
var a, n, s, i, y, f, te;
|
|
531
|
+
return r(), d("th", {
|
|
529
532
|
key: e.key,
|
|
530
533
|
scope: "col",
|
|
531
534
|
"data-column-key": e.key,
|
|
532
|
-
class:
|
|
533
|
-
"data-drop-position": ((a =
|
|
535
|
+
class: fe({ "hys-ui-is-column-dragging": ue.value === e.key }),
|
|
536
|
+
"data-drop-position": ((a = I.value) == null ? void 0 : a.key) === e.key ? I.value.position : void 0,
|
|
534
537
|
draggable: e.reorderable !== !1,
|
|
535
|
-
onDragstart: (c) =>
|
|
536
|
-
onDragend:
|
|
537
|
-
onDragover: (c) =>
|
|
538
|
-
onDrop: (c) =>
|
|
539
|
-
"aria-sort": ((n = x.value.find((c) => c.key === e.key)) == null ? void 0 : n.direction) === "asc" ? "ascending" : ((
|
|
540
|
-
style:
|
|
538
|
+
onDragstart: (c) => xt(c, e),
|
|
539
|
+
onDragend: ee,
|
|
540
|
+
onDragover: (c) => St(c, e),
|
|
541
|
+
onDrop: (c) => Vt(c, e),
|
|
542
|
+
"aria-sort": ((n = x.value.find((c) => c.key === e.key)) == null ? void 0 : n.direction) === "asc" ? "ascending" : ((s = x.value.find((c) => c.key === e.key)) == null ? void 0 : s.direction) === "desc" ? "descending" : "none",
|
|
543
|
+
style: G({ ...be(e, !0), textAlign: e.align || "left" })
|
|
541
544
|
}, [
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
+
m("div", Yt, [
|
|
546
|
+
m("div", Zt, [
|
|
547
|
+
p(R, {
|
|
545
548
|
variant: "ghost",
|
|
546
549
|
size: "sm",
|
|
547
550
|
type: "button",
|
|
548
|
-
class:
|
|
549
|
-
onClick: (c) =>
|
|
551
|
+
class: fe(["hys-ui-pf-grid-sort", { "hys-ui-is-sorted": x.value.some((c) => c.key === e.key) }]),
|
|
552
|
+
onClick: (c) => ht(e)
|
|
550
553
|
}, {
|
|
551
554
|
default: z(() => [
|
|
552
|
-
|
|
555
|
+
m("span", _t, B(e.label), 1)
|
|
553
556
|
]),
|
|
554
557
|
_: 2
|
|
555
558
|
}, 1032, ["class", "onClick"]),
|
|
556
|
-
e.sortable !== !1 ? (
|
|
559
|
+
e.sortable !== !1 ? (r(), d("span", {
|
|
557
560
|
key: 0,
|
|
558
561
|
class: "hys-ui-pf-grid-sort-controls",
|
|
559
562
|
role: "group",
|
|
560
563
|
"aria-label": e.label + "排序"
|
|
561
564
|
}, [
|
|
562
|
-
|
|
565
|
+
p(R, {
|
|
563
566
|
type: "button",
|
|
564
567
|
variant: "ghost",
|
|
565
568
|
size: "sm",
|
|
566
|
-
class:
|
|
569
|
+
class: fe(["hys-ui-pf-grid-sort-direction", { "hys-ui-is-active": ((i = x.value.find((c) => c.key === e.key)) == null ? void 0 : i.direction) === "asc" }]),
|
|
567
570
|
"aria-label": e.label + "升序",
|
|
568
571
|
"aria-pressed": ((y = x.value.find((c) => c.key === e.key)) == null ? void 0 : y.direction) === "asc",
|
|
569
|
-
onClick: A((c) =>
|
|
572
|
+
onClick: A((c) => Pe(e, "asc"), ["stop"])
|
|
570
573
|
}, {
|
|
571
574
|
default: z(() => [
|
|
572
|
-
|
|
575
|
+
p(K(Ut), {
|
|
573
576
|
size: 11,
|
|
574
577
|
"aria-hidden": "true"
|
|
575
578
|
})
|
|
576
579
|
]),
|
|
577
580
|
_: 1
|
|
578
581
|
}, 8, ["class", "aria-label", "aria-pressed", "onClick"]),
|
|
579
|
-
|
|
582
|
+
p(R, {
|
|
580
583
|
type: "button",
|
|
581
584
|
variant: "ghost",
|
|
582
585
|
size: "sm",
|
|
583
|
-
class:
|
|
586
|
+
class: fe(["hys-ui-pf-grid-sort-direction", { "hys-ui-is-active": ((f = x.value.find((c) => c.key === e.key)) == null ? void 0 : f.direction) === "desc" }]),
|
|
584
587
|
"aria-label": e.label + "降序",
|
|
585
|
-
"aria-pressed": ((
|
|
586
|
-
onClick: A((c) =>
|
|
588
|
+
"aria-pressed": ((te = x.value.find((c) => c.key === e.key)) == null ? void 0 : te.direction) === "desc",
|
|
589
|
+
onClick: A((c) => Pe(e, "desc"), ["stop"])
|
|
587
590
|
}, {
|
|
588
591
|
default: z(() => [
|
|
589
|
-
|
|
592
|
+
p(K(Re), {
|
|
590
593
|
size: 11,
|
|
591
594
|
"aria-hidden": "true"
|
|
592
595
|
})
|
|
593
596
|
]),
|
|
594
597
|
_: 1
|
|
595
598
|
}, 8, ["class", "aria-label", "aria-pressed", "onClick"])
|
|
596
|
-
], 8,
|
|
599
|
+
], 8, el)) : k("", !0)
|
|
597
600
|
]),
|
|
598
|
-
e.filterable !== !1 ? (
|
|
601
|
+
e.filterable !== !1 ? (r(), le(R, {
|
|
599
602
|
key: 0,
|
|
600
603
|
variant: "ghost",
|
|
601
604
|
size: "sm",
|
|
602
605
|
type: "button",
|
|
603
|
-
class:
|
|
606
|
+
class: fe(["hys-ui-pf-grid-filter", { "hys-ui-is-filtered": !!O.value[e.key], "hys-ui-is-filtering": j.value && re.value === e.key }]),
|
|
604
607
|
"aria-label": "筛选" + e.label,
|
|
605
|
-
"aria-expanded":
|
|
606
|
-
|
|
608
|
+
"aria-expanded": j.value,
|
|
609
|
+
"aria-controls": K(Be),
|
|
610
|
+
title: j.value && re.value === e.key ? "再次点击收起筛选(Esc)" : "筛选" + e.label,
|
|
611
|
+
onClick: (c) => at(e)
|
|
607
612
|
}, {
|
|
608
613
|
default: z(() => [
|
|
609
|
-
|
|
614
|
+
p(K($t), {
|
|
610
615
|
size: 13,
|
|
611
616
|
"aria-hidden": "true"
|
|
612
617
|
})
|
|
613
618
|
]),
|
|
614
619
|
_: 1
|
|
615
|
-
}, 8, ["aria-label", "
|
|
616
|
-
e.resizable !== !1 ? (
|
|
620
|
+
}, 8, ["aria-label", "aria-expanded", "aria-controls", "title", "class", "onClick"])) : k("", !0),
|
|
621
|
+
e.resizable !== !1 ? (r(), d("span", {
|
|
617
622
|
key: 1,
|
|
618
623
|
class: "hys-ui-pf-grid-resize",
|
|
619
624
|
role: "separator",
|
|
620
625
|
tabindex: "0",
|
|
621
626
|
"aria-label": "调整" + e.label + "列宽",
|
|
622
|
-
onPointerdown: (c) =>
|
|
627
|
+
onPointerdown: (c) => Ct(c, e),
|
|
623
628
|
onKeydown: [
|
|
624
|
-
|
|
625
|
-
|
|
629
|
+
pe(A((c) => g.value = { ...g.value, [e.key]: Math.max(e.minWidth || 80, (g.value[e.key] || e.width || 160) - 10) }, ["prevent"]), ["left"]),
|
|
630
|
+
pe(A((c) => g.value = { ...g.value, [e.key]: Math.min(e.maxWidth || 800, (g.value[e.key] || e.width || 160) + 10) }, ["prevent"]), ["right"])
|
|
626
631
|
]
|
|
627
|
-
}, null, 40,
|
|
632
|
+
}, null, 40, tl)) : k("", !0)
|
|
628
633
|
])
|
|
629
|
-
], 46,
|
|
634
|
+
], 46, Qt);
|
|
630
635
|
}), 128))
|
|
631
636
|
]),
|
|
632
|
-
|
|
637
|
+
j.value ? (r(), d("tr", {
|
|
633
638
|
key: 0,
|
|
634
639
|
class: "hys-ui-pf-grid-filter-row",
|
|
635
|
-
|
|
636
|
-
onKeydown: l[
|
|
640
|
+
id: K(Be),
|
|
641
|
+
onKeydown: l[7] || (l[7] = pe(A((e) => Fe(), ["stop", "prevent"]), ["esc"])),
|
|
642
|
+
"aria-label": "列筛选"
|
|
637
643
|
}, [
|
|
638
|
-
|
|
639
|
-
(
|
|
644
|
+
u.selectable ? (r(), d("td", al)) : k("", !0),
|
|
645
|
+
(r(!0), d($, null, ye(L.value, (e) => (r(), d("td", {
|
|
640
646
|
key: e.key,
|
|
641
647
|
"data-filter-key": e.key,
|
|
642
648
|
"data-column-key": e.key,
|
|
643
|
-
style:
|
|
649
|
+
style: G(be(e))
|
|
644
650
|
}, [
|
|
645
|
-
e.filterable !== !1 ? (
|
|
651
|
+
e.filterable !== !1 ? (r(), le(Ve, {
|
|
646
652
|
key: 0,
|
|
647
|
-
modelValue:
|
|
648
|
-
"onUpdate:modelValue": (a) =>
|
|
653
|
+
modelValue: O.value[e.key],
|
|
654
|
+
"onUpdate:modelValue": (a) => O.value[e.key] = a,
|
|
655
|
+
onFocus: (a) => re.value = e.key,
|
|
649
656
|
"aria-label": "过滤" + e.label,
|
|
650
657
|
placeholder: "筛选…",
|
|
651
658
|
clearable: ""
|
|
652
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "aria-label"])) : k("", !0)
|
|
653
|
-
], 12,
|
|
654
|
-
],
|
|
659
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "onFocus", "aria-label"])) : k("", !0)
|
|
660
|
+
], 12, nl))), 128))
|
|
661
|
+
], 40, ll)) : k("", !0)
|
|
655
662
|
]),
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
colspan:
|
|
663
|
+
m("tbody", null, [
|
|
664
|
+
u.loading ? (r(), d("tr", ol, [
|
|
665
|
+
m("td", {
|
|
666
|
+
colspan: E.value.length + (u.selectable ? 1 : 0),
|
|
660
667
|
class: "hys-ui-pf-grid-empty"
|
|
661
|
-
}, "正在加载…", 8,
|
|
662
|
-
])) : (
|
|
663
|
-
(
|
|
668
|
+
}, "正在加载…", 8, rl)
|
|
669
|
+
])) : (r(), d($, { key: 1 }, [
|
|
670
|
+
(r(!0), d($, null, ye(ut.value, (e) => (r(), d($, {
|
|
664
671
|
key: e.key
|
|
665
672
|
}, [
|
|
666
|
-
e.kind === "group" ? (
|
|
667
|
-
|
|
668
|
-
colspan:
|
|
673
|
+
e.kind === "group" ? (r(), d("tr", sl, [
|
|
674
|
+
m("td", {
|
|
675
|
+
colspan: E.value.length + (u.selectable ? 1 : 0)
|
|
669
676
|
}, [
|
|
670
|
-
|
|
677
|
+
p(R, {
|
|
671
678
|
variant: "ghost",
|
|
672
679
|
size: "sm",
|
|
673
680
|
type: "button",
|
|
674
|
-
"aria-expanded": !
|
|
675
|
-
onClick: (a) =>
|
|
681
|
+
"aria-expanded": !P.value.includes(e.key),
|
|
682
|
+
onClick: (a) => yt(e.key)
|
|
676
683
|
}, {
|
|
677
684
|
default: z(() => {
|
|
678
685
|
var a;
|
|
679
686
|
return [
|
|
680
|
-
(
|
|
687
|
+
(r(), le(Xe(P.value.includes(e.key) ? K(Ge) : K(Re)), {
|
|
681
688
|
size: 15,
|
|
682
689
|
"aria-hidden": "true"
|
|
683
690
|
})),
|
|
684
|
-
|
|
685
|
-
|
|
691
|
+
X(" " + B((a = $e.value.find((n) => n.key === J.value)) == null ? void 0 : a.label) + ":" + B(e.label) + " ", 1),
|
|
692
|
+
m("span", null, "(" + B(e.count) + ")", 1)
|
|
686
693
|
];
|
|
687
694
|
}),
|
|
688
695
|
_: 2
|
|
689
696
|
}, 1032, ["aria-expanded", "onClick"])
|
|
690
|
-
], 8,
|
|
691
|
-
])) : e.row ? (
|
|
697
|
+
], 8, il)
|
|
698
|
+
])) : e.row ? (r(), d("tr", {
|
|
692
699
|
key: 1,
|
|
693
|
-
onClick: (a) =>
|
|
700
|
+
onClick: (a) => M("rowClick", e.row)
|
|
694
701
|
}, [
|
|
695
|
-
|
|
696
|
-
|
|
702
|
+
u.selectable ? (r(), d("td", dl, [
|
|
703
|
+
p(Ee, {
|
|
697
704
|
"aria-label": "选择第" + ((e.index ?? 0) + 1) + "行",
|
|
698
|
-
"model-value": h.value.includes(
|
|
699
|
-
onClick: l[
|
|
705
|
+
"model-value": h.value.includes(_(e.row, e.index ?? 0)),
|
|
706
|
+
onClick: l[8] || (l[8] = A(() => {
|
|
700
707
|
}, ["stop"])),
|
|
701
|
-
"onUpdate:modelValue": (a) =>
|
|
708
|
+
"onUpdate:modelValue": (a) => pt(_(e.row, e.index ?? 0), a)
|
|
702
709
|
}, null, 8, ["aria-label", "model-value", "onUpdate:modelValue"])
|
|
703
710
|
])) : k("", !0),
|
|
704
|
-
(
|
|
705
|
-
var n,
|
|
706
|
-
return
|
|
711
|
+
(r(!0), d($, null, ye(L.value, (a) => {
|
|
712
|
+
var n, s, i, y;
|
|
713
|
+
return r(), d("td", {
|
|
707
714
|
key: a.key,
|
|
708
715
|
"data-column-key": a.key,
|
|
709
|
-
style:
|
|
710
|
-
title:
|
|
716
|
+
style: G({ ...be(a), textAlign: a.align || "left" }),
|
|
717
|
+
title: ie(e.row, a.key)
|
|
711
718
|
}, [
|
|
712
|
-
((n =
|
|
719
|
+
((n = Y.value) == null ? void 0 : n.id) === _(e.row, e.index ?? 0) && ((s = Y.value) == null ? void 0 : s.key) === a.key ? (r(), le(Ve, {
|
|
713
720
|
key: 0,
|
|
714
|
-
modelValue:
|
|
715
|
-
"onUpdate:modelValue": l[
|
|
721
|
+
modelValue: he.value,
|
|
722
|
+
"onUpdate:modelValue": l[9] || (l[9] = (f) => he.value = f),
|
|
716
723
|
class: "hys-ui-pf-grid-edit",
|
|
717
724
|
"aria-label": "编辑" + a.label,
|
|
718
|
-
onClick: l[
|
|
725
|
+
onClick: l[10] || (l[10] = A(() => {
|
|
719
726
|
}, ["stop"])),
|
|
720
727
|
onKeydown: [
|
|
721
|
-
|
|
722
|
-
l[
|
|
728
|
+
pe(A((f) => He(e.row, a), ["stop"]), ["enter"]),
|
|
729
|
+
l[11] || (l[11] = pe(A((f) => Y.value = null, ["stop"]), ["esc"]))
|
|
723
730
|
],
|
|
724
|
-
onFocusout: (f) =>
|
|
725
|
-
}, null, 8, ["modelValue", "aria-label", "onKeydown", "onFocusout"])) : (
|
|
726
|
-
|
|
731
|
+
onFocusout: (f) => He(e.row, a)
|
|
732
|
+
}, null, 8, ["modelValue", "aria-label", "onKeydown", "onFocusout"])) : (r(), d($, { key: 1 }, [
|
|
733
|
+
u.treeMode && a.key === ((i = L.value[0]) == null ? void 0 : i.key) && e.row.__pfHasChildren ? (r(), le(R, {
|
|
727
734
|
key: 0,
|
|
728
735
|
variant: "ghost",
|
|
729
736
|
size: "sm",
|
|
730
737
|
type: "button",
|
|
731
738
|
class: "hys-ui-pf-grid-tree-toggle",
|
|
732
|
-
style:
|
|
733
|
-
"aria-expanded":
|
|
734
|
-
onClick: A((f) =>
|
|
739
|
+
style: G({ marginLeft: Number(e.row.__pfDepth || 0) * 16 + "px" }),
|
|
740
|
+
"aria-expanded": Q.value.includes(e.row[u.rowKey]),
|
|
741
|
+
onClick: A((f) => dt(e.row[u.rowKey]), ["stop"])
|
|
735
742
|
}, {
|
|
736
743
|
default: z(() => [
|
|
737
|
-
(
|
|
744
|
+
(r(), le(Xe(Q.value.includes(e.row[u.rowKey]) ? K(Re) : K(Ge)), {
|
|
738
745
|
size: 15,
|
|
739
746
|
"aria-hidden": "true"
|
|
740
747
|
}))
|
|
741
748
|
]),
|
|
742
749
|
_: 2
|
|
743
|
-
}, 1032, ["style", "aria-expanded", "onClick"])) :
|
|
750
|
+
}, 1032, ["style", "aria-expanded", "onClick"])) : u.treeMode && a.key === ((y = L.value[0]) == null ? void 0 : y.key) ? (r(), d("span", {
|
|
744
751
|
key: 1,
|
|
745
|
-
style:
|
|
752
|
+
style: G({ display: "inline-block", width: Number(e.row.__pfDepth || 0) * 16 + 20 + "px" })
|
|
746
753
|
}, null, 4)) : k("", !0),
|
|
747
|
-
|
|
748
|
-
onDblclick: A((f) =>
|
|
754
|
+
m("span", {
|
|
755
|
+
onDblclick: A((f) => ct(e.row, a), ["stop"])
|
|
749
756
|
}, [
|
|
750
|
-
|
|
757
|
+
Bt(t.$slots, a.key, {
|
|
751
758
|
row: e.row,
|
|
752
759
|
value: e.row[a.key]
|
|
753
760
|
}, () => [
|
|
754
|
-
|
|
761
|
+
X(B(ie(e.row, a.key)), 1)
|
|
755
762
|
], !0)
|
|
756
|
-
], 40,
|
|
763
|
+
], 40, fl)
|
|
757
764
|
], 64))
|
|
758
|
-
], 12,
|
|
765
|
+
], 12, cl);
|
|
759
766
|
}), 128))
|
|
760
|
-
], 8,
|
|
767
|
+
], 8, ul)) : k("", !0)
|
|
761
768
|
], 64))), 128)),
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
colspan:
|
|
769
|
+
we.value.length ? k("", !0) : (r(), d("tr", yl, [
|
|
770
|
+
m("td", {
|
|
771
|
+
colspan: E.value.length + (u.selectable ? 1 : 0),
|
|
765
772
|
class: "hys-ui-pf-grid-empty"
|
|
766
|
-
},
|
|
773
|
+
}, B(u.emptyText), 9, vl)
|
|
767
774
|
]))
|
|
768
775
|
], 64))
|
|
769
776
|
]),
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
(
|
|
777
|
+
u.showSummary && !u.loading && q.value.length ? (r(), d("tfoot", ml, [
|
|
778
|
+
m("tr", pl, [
|
|
779
|
+
u.selectable ? (r(), d("td", gl, "合计")) : k("", !0),
|
|
780
|
+
(r(!0), d($, null, ye(L.value, (e, a) => (r(), d("td", {
|
|
774
781
|
key: e.key,
|
|
775
782
|
"data-column-key": e.key,
|
|
776
|
-
style:
|
|
777
|
-
},
|
|
783
|
+
style: G({ ...be(e), textAlign: e.align || "left" })
|
|
784
|
+
}, B(e.summary ? vt(e) : !u.selectable && a === 0 ? "合计" : ""), 13, hl))), 128))
|
|
778
785
|
])
|
|
779
786
|
])) : k("", !0)
|
|
780
787
|
], 6)
|
|
781
788
|
], 32),
|
|
782
|
-
|
|
783
|
-
|
|
789
|
+
m("footer", kl, [
|
|
790
|
+
p(Ot, {
|
|
784
791
|
page: C.value,
|
|
785
|
-
total:
|
|
786
|
-
"page-size":
|
|
792
|
+
total: u.serverMode ? u.totalRows ?? u.rows.length : q.value.length,
|
|
793
|
+
"page-size": se.value,
|
|
787
794
|
"show-size-changer": !0,
|
|
788
795
|
"show-quick-jumper": !0,
|
|
789
|
-
disabled:
|
|
796
|
+
disabled: u.loading,
|
|
790
797
|
"page-size-options": [10, 12, 20, 50, 100],
|
|
791
|
-
onChange:
|
|
792
|
-
onPageSizeChange:
|
|
798
|
+
onChange: kt,
|
|
799
|
+
onPageSizeChange: bt
|
|
793
800
|
}, null, 8, ["page", "total", "page-size", "disabled"])
|
|
794
801
|
])
|
|
795
802
|
], 16));
|
|
796
803
|
}
|
|
797
804
|
});
|
|
798
805
|
export {
|
|
799
|
-
|
|
806
|
+
Rl as default
|
|
800
807
|
};
|