evui 3.5.0 → 3.5.2
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/dist/index.js +23148 -0
- package/dist/index.umd.cjs +28 -0
- package/package.json +5 -11
- package/dist/_virtual/_plugin-vue_export-helper.js +0 -9
- package/dist/common/utils.bignumber.js +0 -23
- package/dist/common/utils.debounce.js +0 -66
- package/dist/common/utils.js +0 -64
- package/dist/common/utils.throttle.js +0 -15
- package/dist/components/button/Button.vue.js +0 -65
- package/dist/components/button/index.js +0 -7
- package/dist/components/buttonGroup/ButtonGroup.vue.js +0 -14
- package/dist/components/buttonGroup/index.js +0 -7
- package/dist/components/calendar/Calendar.vue.js +0 -299
- package/dist/components/calendar/index.js +0 -7
- package/dist/components/calendar/uses.js +0 -579
- package/dist/components/chart/Chart.vue.js +0 -261
- package/dist/components/chart/ChartToolbar.vue.js +0 -32
- package/dist/components/chart/chart.core.js +0 -738
- package/dist/components/chart/chartZoom.core.js +0 -221
- package/dist/components/chart/element/element.bar.js +0 -358
- package/dist/components/chart/element/element.bar.time.js +0 -55
- package/dist/components/chart/element/element.heatmap.js +0 -403
- package/dist/components/chart/element/element.line.js +0 -292
- package/dist/components/chart/element/element.pie.js +0 -73
- package/dist/components/chart/element/element.scatter.js +0 -209
- package/dist/components/chart/element/element.tip.js +0 -312
- package/dist/components/chart/helpers/helpers.canvas.js +0 -141
- package/dist/components/chart/helpers/helpers.constant.js +0 -253
- package/dist/components/chart/helpers/helpers.util.js +0 -265
- package/dist/components/chart/index.js +0 -7
- package/dist/components/chart/model/index.js +0 -6
- package/dist/components/chart/model/model.series.js +0 -82
- package/dist/components/chart/model/model.store.js +0 -650
- package/dist/components/chart/plugins/plugins.interaction.js +0 -823
- package/dist/components/chart/plugins/plugins.legend.gradient.js +0 -281
- package/dist/components/chart/plugins/plugins.legend.js +0 -665
- package/dist/components/chart/plugins/plugins.pie.js +0 -86
- package/dist/components/chart/plugins/plugins.scrollbar.js +0 -345
- package/dist/components/chart/plugins/plugins.title.js +0 -43
- package/dist/components/chart/plugins/plugins.tooltip.js +0 -508
- package/dist/components/chart/scale/scale.js +0 -492
- package/dist/components/chart/scale/scale.linear.js +0 -248
- package/dist/components/chart/scale/scale.logarithmic.js +0 -82
- package/dist/components/chart/scale/scale.step.js +0 -227
- package/dist/components/chart/scale/scale.time.category.js +0 -148
- package/dist/components/chart/scale/scale.time.js +0 -95
- package/dist/components/chart/uses.js +0 -479
- package/dist/components/chartBrush/ChartBrush.vue.js +0 -198
- package/dist/components/chartBrush/chartBrush.core.js +0 -265
- package/dist/components/chartBrush/index.js +0 -7
- package/dist/components/chartBrush/uses.js +0 -18
- package/dist/components/chartGroup/ChartGroup.vue.js +0 -128
- package/dist/components/chartGroup/index.js +0 -7
- package/dist/components/chartGroup/uses.js +0 -47
- package/dist/components/checkbox/Checkbox.vue.js +0 -99
- package/dist/components/checkbox/index.js +0 -7
- package/dist/components/checkboxGroup/CheckboxGroup.vue.js +0 -40
- package/dist/components/checkboxGroup/index.js +0 -7
- package/dist/components/contextMenu/ContextMenu.vue.js +0 -70
- package/dist/components/contextMenu/MenuList.vue.js +0 -105
- package/dist/components/contextMenu/index.js +0 -7
- package/dist/components/contextMenu/uses.js +0 -79
- package/dist/components/datePicker/DatePicker.vue.js +0 -310
- package/dist/components/datePicker/index.js +0 -7
- package/dist/components/datePicker/uses.js +0 -190
- package/dist/components/grid/Grid.vue.js +0 -1261
- package/dist/components/grid/GridColumnSetting.vue.js +0 -212
- package/dist/components/grid/GridFilterSetting.vue.js +0 -222
- package/dist/components/grid/GridPagination.vue.js +0 -69
- package/dist/components/grid/GridSummary.vue.js +0 -186
- package/dist/components/grid/GridToolbar.vue.js +0 -15
- package/dist/components/grid/icon/icon-option-button.vue.js +0 -39
- package/dist/components/grid/icon/icon-sort-button.vue.js +0 -56
- package/dist/components/grid/index.js +0 -7
- package/dist/components/grid/uses.js +0 -697
- package/dist/components/icon/Icon.vue.js +0 -50
- package/dist/components/icon/index.js +0 -8
- package/dist/components/inputNumber/InputNumber.vue.js +0 -112
- package/dist/components/inputNumber/index.js +0 -7
- package/dist/components/inputNumber/uses.js +0 -76
- package/dist/components/loading/Loading.vue.js +0 -78
- package/dist/components/loading/index.js +0 -7
- package/dist/components/menu/Menu.vue.js +0 -66
- package/dist/components/menu/MenuItem.vue.js +0 -125
- package/dist/components/menu/index.js +0 -7
- package/dist/components/message/Message.vue.js +0 -122
- package/dist/components/message/index.js +0 -16
- package/dist/components/messageBox/MessageBox.vue.js +0 -216
- package/dist/components/messageBox/index.js +0 -13
- package/dist/components/notification/Notification.vue.js +0 -140
- package/dist/components/notification/index.js +0 -23
- package/dist/components/pagination/Pagination.vue.js +0 -215
- package/dist/components/pagination/index.js +0 -7
- package/dist/components/pagination/pageButton.vue.js +0 -35
- package/dist/components/progress/Progress.vue.js +0 -88
- package/dist/components/progress/index.js +0 -7
- package/dist/components/radio/Radio.vue.js +0 -75
- package/dist/components/radio/index.js +0 -7
- package/dist/components/radioGroup/RadioGroup.vue.js +0 -37
- package/dist/components/radioGroup/index.js +0 -7
- package/dist/components/scheduler/Scheduler.vue.js +0 -128
- package/dist/components/scheduler/index.js +0 -7
- package/dist/components/scheduler/uses.js +0 -73
- package/dist/components/select/Select.vue.js +0 -381
- package/dist/components/select/index.js +0 -7
- package/dist/components/select/uses.js +0 -147
- package/dist/components/slider/Slider.vue.js +0 -243
- package/dist/components/slider/index.js +0 -7
- package/dist/components/slider/uses.js +0 -188
- package/dist/components/tabPanel/TabPanel.vue.js +0 -39
- package/dist/components/tabPanel/index.js +0 -7
- package/dist/components/tabs/Tabs.vue.js +0 -220
- package/dist/components/tabs/index.js +0 -7
- package/dist/components/textField/TextField.vue.js +0 -209
- package/dist/components/textField/index.js +0 -7
- package/dist/components/timePicker/TimePicker.vue.js +0 -227
- package/dist/components/timePicker/index.js +0 -7
- package/dist/components/toggle/Toggle.vue.js +0 -66
- package/dist/components/toggle/index.js +0 -7
- package/dist/components/tree/Tree.vue.js +0 -220
- package/dist/components/tree/TreeNode.vue.js +0 -146
- package/dist/components/tree/index.js +0 -7
- package/dist/components/treeGrid/TreeGrid.vue.js +0 -898
- package/dist/components/treeGrid/TreeGridNode.vue.js +0 -274
- package/dist/components/treeGrid/TreeGridToolbar.vue.js +0 -15
- package/dist/components/treeGrid/index.js +0 -7
- package/dist/components/treeGrid/uses.js +0 -497
- package/dist/components/window/Window.vue.js +0 -211
- package/dist/components/window/index.js +0 -7
- package/dist/components/window/uses.js +0 -345
- package/dist/directives/clickoutside.js +0 -47
- package/dist/main.js +0 -142
- package/dist/package.json.js +0 -4
- package/dist/resolver.js +0 -17
|
@@ -1,497 +0,0 @@
|
|
|
1
|
-
import { getCurrentInstance as y, nextTick as j } from "vue";
|
|
2
|
-
import { numberWithComma as V } from "../../common/utils.js";
|
|
3
|
-
const q = (p) => {
|
|
4
|
-
const { props: c } = y(), { checkInfo: l } = p;
|
|
5
|
-
return {
|
|
6
|
-
isRenderer: (d = {}) => {
|
|
7
|
-
var u;
|
|
8
|
-
return !!((u = d == null ? void 0 : d.render) != null && u.use);
|
|
9
|
-
},
|
|
10
|
-
getComponentName: (d = "") => {
|
|
11
|
-
const u = (o) => o.charAt(0).toUpperCase() + o.slice(1), t = "Renderer";
|
|
12
|
-
let e = "";
|
|
13
|
-
if (d.indexOf("_") !== -1) {
|
|
14
|
-
const o = d.split("_");
|
|
15
|
-
for (let n = 0; n < o.length; n++)
|
|
16
|
-
e += u(o[n]);
|
|
17
|
-
} else
|
|
18
|
-
e = u(d);
|
|
19
|
-
return e + t;
|
|
20
|
-
},
|
|
21
|
-
getConvertValue: (d, u) => {
|
|
22
|
-
let t = d.type === "number" || d.type === "float" ? Number(u) : u;
|
|
23
|
-
return d.type === "number" ? (t = V(u), t = t === !1 ? u : t) : d.type === "float" && (t = t.toFixed(d.decimal ?? 3).replace(/\B(?=(\d{3})+(?!\d))/g, ",")), t;
|
|
24
|
-
},
|
|
25
|
-
getColumnIndex: (d) => c.columns.findIndex((u) => u.field === d),
|
|
26
|
-
setPixelUnit: (d) => {
|
|
27
|
-
let u = d;
|
|
28
|
-
const t = u.toString().indexOf("px") >= 0, e = u.toString().indexOf("%") >= 0;
|
|
29
|
-
return !t && !e && (u = `${u}px`), u;
|
|
30
|
-
},
|
|
31
|
-
checkHeader: (d) => {
|
|
32
|
-
l.isHeaderChecked = !!d.length && d.every((t) => t.checked);
|
|
33
|
-
const u = d.filter((t) => t.uncheckable);
|
|
34
|
-
if (u.length) {
|
|
35
|
-
const t = d.filter((o) => o.checked), e = d.every((o) => u.includes(o));
|
|
36
|
-
l.isHeaderChecked = !e && u.length + t.length === d.length, l.isHeaderUncheckable = e;
|
|
37
|
-
}
|
|
38
|
-
l.isHeaderIndeterminate = !!d.length && d.some((t) => t.checked || t.indeterminate) && !l.isHeaderChecked;
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
}, O = (p) => {
|
|
42
|
-
const { originColumns: c, filteredColumns: l } = p;
|
|
43
|
-
return c.map((r) => {
|
|
44
|
-
const k = l.find((x) => x.index === r.index) ?? {};
|
|
45
|
-
return {
|
|
46
|
-
...r,
|
|
47
|
-
...k
|
|
48
|
-
};
|
|
49
|
-
});
|
|
50
|
-
}, A = (p) => {
|
|
51
|
-
const {
|
|
52
|
-
scrollInfo: c,
|
|
53
|
-
stores: l,
|
|
54
|
-
elementInfo: r,
|
|
55
|
-
resizeInfo: k,
|
|
56
|
-
pageInfo: x,
|
|
57
|
-
summaryScroll: m,
|
|
58
|
-
getPagingData: f,
|
|
59
|
-
updatePagingInfo: C
|
|
60
|
-
} = p, d = (e) => {
|
|
61
|
-
let o = l.showTreeStore;
|
|
62
|
-
x.isClientPaging && (o = f());
|
|
63
|
-
const n = r.body;
|
|
64
|
-
if (n) {
|
|
65
|
-
const i = k.rowHeight, s = n.clientHeight > i ? Math.ceil(n.clientHeight / i) : o.length, a = o.length * i;
|
|
66
|
-
let h = Math.floor(n.scrollTop / i);
|
|
67
|
-
h > o.length - 1 && (h = 0);
|
|
68
|
-
const g = h + s + 1, w = Math.max(h, 0), S = g, b = r.table;
|
|
69
|
-
l.viewStore = o.slice(w, S), c.hasVerticalScrollBar = s < o.length || n.clientHeight < b.clientHeight, c.vScrollTopHeight = w * i, c.vScrollBottomHeight = a - l.viewStore.length * i - c.vScrollTopHeight, e && x.isInfinite && c.vScrollBottomHeight === 0 && (x.prevPage = x.currentPage, x.currentPage = Math.ceil(S / x.perPage) + 1, x.startIndex = S, C({ onScrollEnd: !0 }));
|
|
70
|
-
}
|
|
71
|
-
}, u = () => {
|
|
72
|
-
const e = r.header, o = r.body, n = r.table;
|
|
73
|
-
e.scrollLeft = o.scrollLeft, m.value = o.scrollLeft, c.hasHorizontalScrollBar = o.clientWidth < n.clientWidth;
|
|
74
|
-
};
|
|
75
|
-
return { updateVScroll: d, updateHScroll: u, onScroll: () => {
|
|
76
|
-
const e = r.body, o = e.scrollTop, n = e.scrollLeft, i = c.lastScroll.top, s = c.lastScroll.left, a = n !== s;
|
|
77
|
-
o !== i && e.clientHeight && d(!0), a && u(), c.lastScroll.top = o, c.lastScroll.left = n;
|
|
78
|
-
} };
|
|
79
|
-
}, B = (p) => {
|
|
80
|
-
const { props: c, emit: l } = y(), {
|
|
81
|
-
resizeInfo: r,
|
|
82
|
-
elementInfo: k,
|
|
83
|
-
checkInfo: x,
|
|
84
|
-
stores: m,
|
|
85
|
-
isRenderer: f,
|
|
86
|
-
updateVScroll: C,
|
|
87
|
-
updateHScroll: d,
|
|
88
|
-
contextInfo: u
|
|
89
|
-
} = p, t = () => {
|
|
90
|
-
m.viewStore = m.showTreeStore;
|
|
91
|
-
const i = m.viewStore;
|
|
92
|
-
let s = r.columnWidth;
|
|
93
|
-
r.columnWidth > 0 && (s = r.columnWidth), s = r.columnWidth;
|
|
94
|
-
let a = 0;
|
|
95
|
-
if (r.adjust && k.body) {
|
|
96
|
-
const h = k.body;
|
|
97
|
-
let g = h.offsetWidth;
|
|
98
|
-
const w = h.offsetHeight, S = m.orderedColumns.reduce(
|
|
99
|
-
(b, R) => (R.hide || R.hiddenDisplay || (R.width ? b.totalWidth += R.width : b.emptyCount++), b),
|
|
100
|
-
{ totalWidth: u.customContextMenu.length ? 30 : 0, emptyCount: 0 }
|
|
101
|
-
);
|
|
102
|
-
if (r.rowHeight * i.length > w - r.scrollWidth && (g -= r.scrollWidth), x.useCheckbox.use && (g -= r.minWidth), s = g - S.totalWidth, s > 0) {
|
|
103
|
-
const b = S.emptyCount === 0 ? 0 : Math.floor(s / S.emptyCount);
|
|
104
|
-
a = s - b * S.emptyCount, s = S.emptyCount !== 0 ? b : s;
|
|
105
|
-
} else
|
|
106
|
-
s = r.columnWidth;
|
|
107
|
-
s = s < r.minWidth ? r.minWidth : s, r.columnWidth = s;
|
|
108
|
-
}
|
|
109
|
-
if (m.orderedColumns.forEach((h) => {
|
|
110
|
-
const g = f(h) ? r.rendererMinWidth : r.minWidth;
|
|
111
|
-
h.width && h.width < g && (h.width = g), !h.width && !h.hide && (h.width = s);
|
|
112
|
-
}), a && m.orderedColumns.length) {
|
|
113
|
-
let h = m.orderedColumns.length - 1, g = m.orderedColumns[h];
|
|
114
|
-
for (; h > 0 && g && (g.hide || g.hiddenDisplay); )
|
|
115
|
-
h -= 1, g = m.orderedColumns[h];
|
|
116
|
-
g && (g.width += a);
|
|
117
|
-
}
|
|
118
|
-
r.isResize = !r.isResize;
|
|
119
|
-
}, e = () => {
|
|
120
|
-
j(() => {
|
|
121
|
-
var i, s;
|
|
122
|
-
r.adjust && m.orderedColumns.forEach((a) => {
|
|
123
|
-
var g;
|
|
124
|
-
const h = a;
|
|
125
|
-
return !((g = c.columns[a.index]) != null && g.width) && !h.resized && (h.width = 0), h;
|
|
126
|
-
}, void 0), t(), (i = k.body) != null && i.clientHeight && C(), (s = k.body) != null && s.clientWidth && d();
|
|
127
|
-
});
|
|
128
|
-
};
|
|
129
|
-
return { calculatedColumn: t, onResize: e, onShow: (i) => {
|
|
130
|
-
i && e();
|
|
131
|
-
}, onColumnResize: (i, s) => {
|
|
132
|
-
const a = k.header, h = k.body, g = a.getBoundingClientRect().left, w = a.querySelector(`li[data-index="${i}"]`), S = f(m.orderedColumns[i]) ? r.rendererMinWidth : r.minWidth, b = w.getBoundingClientRect(), R = h.getBoundingClientRect().right - g, P = k.resizeLine, v = b.left - g + S, H = b.right - g, W = s.clientX, z = b.left - g;
|
|
133
|
-
h.style.overflow = "auto", P.style.left = `${H}px`, r.showResizeLine = !0;
|
|
134
|
-
const L = (T) => {
|
|
135
|
-
const E = T.clientX - W, I = H + E;
|
|
136
|
-
let M = Math.max(v, I);
|
|
137
|
-
M = Math.min(R, M), P.style.left = `${M}px`;
|
|
138
|
-
}, F = () => {
|
|
139
|
-
const E = parseInt(P.style.left, 10) - z;
|
|
140
|
-
m.orderedColumns[i] && (m.orderedColumns[i].width = E, m.orderedColumns[i].resized = !0), r.showResizeLine = !1, document.removeEventListener("mousemove", L), e();
|
|
141
|
-
const I = O(m);
|
|
142
|
-
l("resize-column", {
|
|
143
|
-
column: m.orderedColumns[i],
|
|
144
|
-
columns: I
|
|
145
|
-
}), l("change-column-info", {
|
|
146
|
-
type: "resize",
|
|
147
|
-
columns: I
|
|
148
|
-
});
|
|
149
|
-
};
|
|
150
|
-
document.addEventListener("mousemove", L), document.addEventListener("mouseup", F, { once: !0 });
|
|
151
|
-
} };
|
|
152
|
-
}, G = (p) => {
|
|
153
|
-
const { emit: c } = y(), l = p, r = (f, C) => {
|
|
154
|
-
var t;
|
|
155
|
-
const d = f.target.tagName.toLowerCase();
|
|
156
|
-
let u = {};
|
|
157
|
-
return f.target.offsetParent && (d === "td" ? u = f.target.dataset : u = ((t = f.target.closest("td")) == null ? void 0 : t.dataset) ?? {}), {
|
|
158
|
-
event: f,
|
|
159
|
-
rowData: C,
|
|
160
|
-
rowIndex: C.index,
|
|
161
|
-
cellName: u.name,
|
|
162
|
-
cellIndex: u.index
|
|
163
|
-
};
|
|
164
|
-
};
|
|
165
|
-
let k = null;
|
|
166
|
-
return { onRowClick: (f, C) => {
|
|
167
|
-
var d, u;
|
|
168
|
-
return f.target && f.target.parentElement && (f.target.parentElement.classList.contains("row-checkbox-input") || (u = (d = f.target.closest("td")) == null ? void 0 : d.classList) != null && u.contains("row-contextmenu")) ? !1 : (clearTimeout(k), k = setTimeout(() => {
|
|
169
|
-
l.useSelect && (C.selected ? (C.selected = !1, l.multiple ? f.ctrlKey ? l.selectedRow = l.selectedRow.filter((t) => t.index !== C.index) : l.selectedRow = [C] : l.selectedRow = []) : (C.selected = !0, f.ctrlKey && l.multiple && (!l.limitCount || l.limitCount > l.selectedRow.length) ? l.selectedRow.push(C) : l.selectedRow = [C]), c("update:selected", l.selectedRow), c("click-row", r(f, C)));
|
|
170
|
-
}, 100), !0);
|
|
171
|
-
}, onRowDblClick: (f, C) => {
|
|
172
|
-
clearTimeout(k), c("dblclick-row", r(f, C));
|
|
173
|
-
} };
|
|
174
|
-
}, N = (p) => {
|
|
175
|
-
const { checkInfo: c, stores: l, checkHeader: r, pageInfo: k, getPagingData: x } = p, { emit: m } = y(), f = () => c.useCheckbox.mode === "each", C = (o) => {
|
|
176
|
-
const n = l.treeStore.findIndex((i) => i.index === o.index);
|
|
177
|
-
n !== -1 && (l.treeStore[n].checked = o.checked);
|
|
178
|
-
}, d = (o) => {
|
|
179
|
-
f() || o.hasChild && o.children.forEach((n) => {
|
|
180
|
-
const i = n;
|
|
181
|
-
o.checked && !i.checked && !i.uncheckable && c.checkedRows.push(i), o.checked || (c.checkedRows = c.checkedRows.filter(
|
|
182
|
-
(s) => s.index !== i.index
|
|
183
|
-
)), i.checked = o.checked && !i.uncheckable, i.hasChild && d(i);
|
|
184
|
-
});
|
|
185
|
-
}, u = (o) => {
|
|
186
|
-
if (f())
|
|
187
|
-
return;
|
|
188
|
-
const n = o.parent;
|
|
189
|
-
if (n) {
|
|
190
|
-
const i = n.children.every((a) => a.checked);
|
|
191
|
-
n.checked = i && !n.uncheckable;
|
|
192
|
-
const s = n.children.filter((a) => a.uncheckable);
|
|
193
|
-
if (s.length) {
|
|
194
|
-
const a = n.children.filter((h) => h.checked);
|
|
195
|
-
s.length + a.length === n.children.length && (n.checked = !0);
|
|
196
|
-
}
|
|
197
|
-
n.indeterminate = !i && n.children.some((a) => a.checked || a.indeterminate), n.checked ? c.checkedRows.push(n) : c.checkedRows = c.checkedRows.filter(
|
|
198
|
-
(a) => a.index !== n.index
|
|
199
|
-
), n.parent && u(n);
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
return { onCheck: (o, n) => {
|
|
203
|
-
let i = l.store;
|
|
204
|
-
k.isClientPaging && (i = x());
|
|
205
|
-
const s = () => c.useCheckbox.mode === "single", a = () => {
|
|
206
|
-
c.isHeaderChecked && (c.isHeaderChecked = !1);
|
|
207
|
-
}, h = () => {
|
|
208
|
-
s() && c.checkedRows.length > 0 && (c.prevCheckedRow.checked = !1, C(c.prevCheckedRow));
|
|
209
|
-
}, g = (S) => {
|
|
210
|
-
if (s()) {
|
|
211
|
-
c.checkedRows = [S];
|
|
212
|
-
return;
|
|
213
|
-
}
|
|
214
|
-
d(S), u(S), c.checkedRows.push(S), S.indeterminate = !1;
|
|
215
|
-
}, w = (S) => {
|
|
216
|
-
if (s()) {
|
|
217
|
-
c.checkedRows = [];
|
|
218
|
-
return;
|
|
219
|
-
}
|
|
220
|
-
c.checkedRows = c.checkedRows.filter((b) => b.index !== S.index);
|
|
221
|
-
};
|
|
222
|
-
h(), n.checked ? (g(n), r(i)) : (a(), w(n), d(n), u(n)), c.prevCheckedRow = n, m("update:checked", c.checkedRows), m("check-row", o, n.index, n);
|
|
223
|
-
}, onCheckAll: (o) => {
|
|
224
|
-
var s;
|
|
225
|
-
const n = c.isHeaderChecked;
|
|
226
|
-
let i = (s = l.store) == null ? void 0 : s.filter((a) => a.isFilter);
|
|
227
|
-
k.isClientPaging && (i = x()), i.forEach((a) => {
|
|
228
|
-
a.checked = n && !a.uncheckable, a.checked ? c.checkedRows.find((h) => h.index === a.index) || c.checkedRows.push(a) : c.checkedRows = c.checkedRows.filter(
|
|
229
|
-
(h) => h.index !== a.index
|
|
230
|
-
), a.indeterminate = !1;
|
|
231
|
-
}), c.isHeaderIndeterminate = !1, m("update:checked", c.checkedRows), m("check-all", o, c.checkedRows);
|
|
232
|
-
} };
|
|
233
|
-
}, $ = (p) => {
|
|
234
|
-
const { emit: c } = y(), {
|
|
235
|
-
contextInfo: l,
|
|
236
|
-
stores: r,
|
|
237
|
-
selectInfo: k,
|
|
238
|
-
useGridSetting: x,
|
|
239
|
-
columnSettingInfo: m,
|
|
240
|
-
setColumnHidden: f,
|
|
241
|
-
onSort: C
|
|
242
|
-
} = p, d = (o = !0) => {
|
|
243
|
-
const n = [];
|
|
244
|
-
if (o && l.customContextMenu.length) {
|
|
245
|
-
const i = k.selectedRow, s = l.customContextMenu.map((a) => {
|
|
246
|
-
const h = a;
|
|
247
|
-
return h.validate && (h.disabled = !h.validate(h.itemId, i)), h.selectedRow = i ?? [], h;
|
|
248
|
-
});
|
|
249
|
-
n.push(...s);
|
|
250
|
-
}
|
|
251
|
-
l.contextMenuItems = n;
|
|
252
|
-
};
|
|
253
|
-
return {
|
|
254
|
-
setContextMenu: d,
|
|
255
|
-
onContextMenu: (o) => {
|
|
256
|
-
var s, a;
|
|
257
|
-
const i = (a = (s = o.target.closest(".row")) == null ? void 0 : s.dataset) == null ? void 0 : a.index;
|
|
258
|
-
if (i) {
|
|
259
|
-
const h = r.viewStore.findIndex((w) => w.index === Number(i)), g = r.viewStore[h];
|
|
260
|
-
k.selectedRow = [g], d(), c("update:selected", k.selectedRow);
|
|
261
|
-
} else
|
|
262
|
-
k.selectedRow = [], d(!1), c("update:selected", []);
|
|
263
|
-
},
|
|
264
|
-
onColumnContextMenu: (o, n) => {
|
|
265
|
-
var i, s, a, h, g, w;
|
|
266
|
-
if (o.target.className.includes("column-name")) {
|
|
267
|
-
const S = !!n.sortable;
|
|
268
|
-
l.columnMenuItems = [
|
|
269
|
-
{
|
|
270
|
-
text: ((i = l.columnMenuTextInfo) == null ? void 0 : i.hide) ?? "Hide",
|
|
271
|
-
iconClass: "ev-icon-visibility-off",
|
|
272
|
-
disabled: !x.value || r.orderedColumns.length === 1 || !!n.fixed,
|
|
273
|
-
hidden: ((s = l.hiddenColumnMenuItem) == null ? void 0 : s.hide) || !x.value,
|
|
274
|
-
click: () => {
|
|
275
|
-
f(n.field), c("change-column-status", {
|
|
276
|
-
columns: r.updatedColumns
|
|
277
|
-
}), c("change-column-info", {
|
|
278
|
-
type: "display",
|
|
279
|
-
columns: r.updatedColumns
|
|
280
|
-
});
|
|
281
|
-
}
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
text: ((a = l.columnMenuTextInfo) == null ? void 0 : a.ascending) ?? "Ascending",
|
|
285
|
-
iconClass: "ev-icon-allow2-up",
|
|
286
|
-
disabled: !S,
|
|
287
|
-
hidden: (h = l.hiddenColumnMenuItem) == null ? void 0 : h.ascending,
|
|
288
|
-
click: () => C(n, "asc")
|
|
289
|
-
},
|
|
290
|
-
{
|
|
291
|
-
text: ((g = l.columnMenuTextInfo) == null ? void 0 : g.descending) ?? "Descending",
|
|
292
|
-
iconClass: "ev-icon-allow2-down",
|
|
293
|
-
disabled: !S,
|
|
294
|
-
hidden: (w = l.hiddenColumnMenuItem) == null ? void 0 : w.descending,
|
|
295
|
-
click: () => C(n, "desc")
|
|
296
|
-
}
|
|
297
|
-
];
|
|
298
|
-
} else
|
|
299
|
-
l.columnMenuItems.length = 0;
|
|
300
|
-
},
|
|
301
|
-
onGridSettingContextMenu: (o) => {
|
|
302
|
-
const { useDefaultColumnSetting: n, columnSettingTextInfo: i } = m, s = {
|
|
303
|
-
text: (i == null ? void 0 : i.title) ?? "Column List",
|
|
304
|
-
isShowMenu: !0,
|
|
305
|
-
click: () => {
|
|
306
|
-
m.isShowColumnSetting = !0, l.isShowMenuOnClick = !0;
|
|
307
|
-
}
|
|
308
|
-
};
|
|
309
|
-
l.customGridSettingContextMenu.length && (l.gridSettingContextMenuItems = [...l.customGridSettingContextMenu]), n && l.gridSettingContextMenuItems.push(s), l.gridSettingMenu.show(o);
|
|
310
|
-
}
|
|
311
|
-
};
|
|
312
|
-
}, K = (p) => {
|
|
313
|
-
const { emit: c } = y(), { stores: l, onResize: r } = p, k = () => {
|
|
314
|
-
let f = 0;
|
|
315
|
-
const C = [];
|
|
316
|
-
function d(t) {
|
|
317
|
-
const e = {};
|
|
318
|
-
return Object.keys(t).forEach((o) => {
|
|
319
|
-
o !== "children" && (e[o] = t[o]);
|
|
320
|
-
}), e;
|
|
321
|
-
}
|
|
322
|
-
function u(t) {
|
|
323
|
-
const { node: e, level: o, isShow: n, parent: i, uncheckable: s } = t;
|
|
324
|
-
e !== null && typeof e == "object" && (e.index = f++, e.level = o, Object.hasOwnProperty.call(e, "checked") || (e.checked = !1), Object.hasOwnProperty.call(e, "selected") || (e.selected = !1), Object.hasOwnProperty.call(e, "show") || (e.show = n), Object.hasOwnProperty.call(e, "expand") || (e.expand = !0), Object.hasOwnProperty.call(e, "isFilter") || (e.isFilter = !1), Object.hasOwnProperty.call(e, "uncheckable") || (e.uncheckable = s), Object.hasOwnProperty.call(e, "indeterminate") || (e.indeterminate = !1), Object.hasOwnProperty.call(e, "data") || (e.data = d(e)), C.push(e), Object.hasOwnProperty.call(e, "parent") || (e.parent = i), e.children && (e.hasChild = !0, e.children.forEach(
|
|
325
|
-
(a) => u({
|
|
326
|
-
node: a,
|
|
327
|
-
level: o + 1,
|
|
328
|
-
isShow: e.show && e.expand,
|
|
329
|
-
parent: e,
|
|
330
|
-
uncheckable: e.uncheckable
|
|
331
|
-
})
|
|
332
|
-
)));
|
|
333
|
-
}
|
|
334
|
-
return l.treeRows.forEach((t) => {
|
|
335
|
-
u({
|
|
336
|
-
node: t,
|
|
337
|
-
level: 0,
|
|
338
|
-
isShow: !0,
|
|
339
|
-
parent: void 0,
|
|
340
|
-
uncheckable: !1
|
|
341
|
-
});
|
|
342
|
-
}), C;
|
|
343
|
-
}, x = (f, C, d) => {
|
|
344
|
-
f.forEach((u) => {
|
|
345
|
-
const t = u;
|
|
346
|
-
t.show = d && C ? t.isFilter : C, t.hasChild && x(t.children, t.show && t.expand, t.isFilter);
|
|
347
|
-
});
|
|
348
|
-
};
|
|
349
|
-
return { setTreeNodeStore: k, handleExpand: (f) => {
|
|
350
|
-
const C = !f.expand, d = f;
|
|
351
|
-
d.expand = !d.expand, x(d.children, d.expand, d.isFilter), c("toggle-row", { row: d, isExpand: C }), r();
|
|
352
|
-
} };
|
|
353
|
-
}, X = (p) => {
|
|
354
|
-
const {
|
|
355
|
-
stores: c,
|
|
356
|
-
filterInfo: l,
|
|
357
|
-
pageInfo: r,
|
|
358
|
-
getConvertValue: k,
|
|
359
|
-
onResize: x,
|
|
360
|
-
checkHeader: m,
|
|
361
|
-
getPagingData: f,
|
|
362
|
-
updatePagingInfo: C
|
|
363
|
-
} = p, d = (o) => {
|
|
364
|
-
if (!(o != null && o.parent))
|
|
365
|
-
return;
|
|
366
|
-
const { parent: n } = o;
|
|
367
|
-
n.show = !0, n.isFilter = !0, d(n);
|
|
368
|
-
}, u = (o) => {
|
|
369
|
-
if (!(o != null && o.children))
|
|
370
|
-
return;
|
|
371
|
-
const { children: n } = o;
|
|
372
|
-
n.forEach((i) => {
|
|
373
|
-
const s = i;
|
|
374
|
-
s.parent.show && s.parent.expand ? s.show = !0 : s.show = !1, s.isFilter = !0, s.hasChild && u(s);
|
|
375
|
-
});
|
|
376
|
-
};
|
|
377
|
-
let t = null;
|
|
378
|
-
return { onSearch: (o) => {
|
|
379
|
-
t && clearTimeout(t), t = setTimeout(() => {
|
|
380
|
-
l.isSearch = !1, l.searchWord = o;
|
|
381
|
-
const n = c.treeStore;
|
|
382
|
-
n.forEach((i) => {
|
|
383
|
-
i.show = !1, i.isFilter = !1;
|
|
384
|
-
}), o ? (n.filter((s) => {
|
|
385
|
-
let a = !1;
|
|
386
|
-
for (let h = 0; h < c.orderedColumns.length; h++) {
|
|
387
|
-
const g = c.orderedColumns[h] || {};
|
|
388
|
-
let w = s[g.field] ?? null;
|
|
389
|
-
if (g.type = g.type || "string", w !== null && !g.hide && ((g == null ? void 0 : g.searchable) === void 0 || g != null && g.searchable) && (w = k(g, w).toString(), a = w.toLowerCase().includes(o.toString().toLowerCase()), a))
|
|
390
|
-
break;
|
|
391
|
-
}
|
|
392
|
-
return a;
|
|
393
|
-
}).forEach((s) => {
|
|
394
|
-
s.show = !0, s.parent && !s.parent.expand && (s.show = !1), s.isFilter = !0, d(s), u(s);
|
|
395
|
-
}), l.isSearch = !0) : (n.forEach((i) => {
|
|
396
|
-
i.show = !0, i.isFilter = !1;
|
|
397
|
-
}), n.forEach((i) => {
|
|
398
|
-
d(i), u(i);
|
|
399
|
-
})), !o && r.isClientPaging && r.prevPage && (r.currentPage = 1, c.pagingStore = f()), C({ onSearch: !0 }), m(c.store), x();
|
|
400
|
-
}, 500);
|
|
401
|
-
} };
|
|
402
|
-
}, _ = (p) => {
|
|
403
|
-
const { emit: c } = y(), { stores: l, pageInfo: r, sortInfo: k, filterInfo: x, elementInfo: m, clearCheckInfo: f } = p, C = () => {
|
|
404
|
-
const t = (r.currentPage - 1) * r.perPage, e = parseInt(t, 10) + parseInt(r.perPage, 10);
|
|
405
|
-
return l.showTreeStore.slice(t, e);
|
|
406
|
-
}, d = (t) => {
|
|
407
|
-
c("page-change", {
|
|
408
|
-
eventName: t,
|
|
409
|
-
pageInfo: {
|
|
410
|
-
currentPage: r.currentPage,
|
|
411
|
-
prevPage: r.prevPage,
|
|
412
|
-
startIndex: r.startIndex,
|
|
413
|
-
total: r.pageTotal,
|
|
414
|
-
perPage: r.perPage
|
|
415
|
-
},
|
|
416
|
-
sortInfo: {
|
|
417
|
-
field: k.sortField,
|
|
418
|
-
order: k.sortOrder
|
|
419
|
-
},
|
|
420
|
-
searchInfo: {
|
|
421
|
-
searchWord: x.searchWord,
|
|
422
|
-
searchColumns: l.orderedColumns.filter((e) => !e.hide && ((e == null ? void 0 : e.searchable) === void 0 || (e == null ? void 0 : e.searchable))).map((e) => e.field)
|
|
423
|
-
}
|
|
424
|
-
}), r.isInfinite && (t != null && t.onSearch || t != null && t.onSort) && (r.currentPage = 1, m.body.scrollTop = 0, f());
|
|
425
|
-
};
|
|
426
|
-
return { getPagingData: C, updatePagingInfo: d, changePage: (t) => {
|
|
427
|
-
if (r.isClientPaging)
|
|
428
|
-
if (r.prevPage = t, l.showTreeStore.length <= r.perPage)
|
|
429
|
-
l.pagingStore = l.showTreeStore;
|
|
430
|
-
else {
|
|
431
|
-
const e = (r.currentPage - 1) * r.perPage, o = parseInt(e, 10) + parseInt(r.perPage, 10);
|
|
432
|
-
l.pagingStore = l.showTreeStore.slice(e, o), m.body.scrollTop = 0, r.startIndex = e;
|
|
433
|
-
}
|
|
434
|
-
d({ onChangePage: !0 });
|
|
435
|
-
} };
|
|
436
|
-
}, Q = ({ sortInfo: p, stores: c }) => {
|
|
437
|
-
const { emit: l } = y(), r = (t = !0) => t ? ["asc", "desc", "init"] : ["asc", "desc"];
|
|
438
|
-
function k() {
|
|
439
|
-
this.orders = r(), this.dequeue = () => this.orders.shift(), this.enqueue = (t) => this.orders.push(t);
|
|
440
|
-
}
|
|
441
|
-
const x = (t, e = "init") => {
|
|
442
|
-
c.orderedColumns.forEach((o) => {
|
|
443
|
-
o.index === (t == null ? void 0 : t.index) && e ? o.sortOption = { sortType: e } : o.sortOption = { sortType: "init" };
|
|
444
|
-
});
|
|
445
|
-
}, m = () => {
|
|
446
|
-
const t = c.originColumns.filter((e) => e.hiddenDisplay || e.hide);
|
|
447
|
-
t.length && t.forEach((e) => {
|
|
448
|
-
e.sortOption = { sortType: "init" };
|
|
449
|
-
});
|
|
450
|
-
}, f = new k();
|
|
451
|
-
return { onSort: (t, e) => {
|
|
452
|
-
if (t.sortable === void 0 ? !0 : t.sortable) {
|
|
453
|
-
p.sortColumn = t, p.sortField !== (t == null ? void 0 : t.field) && (f.orders = r(), p.sortField = t == null ? void 0 : t.field), e && (f.orders = r(), e === "desc" && (p.sortOrder = f.dequeue(), f.enqueue(p.sortOrder))), p.sortOrder = f.dequeue(), f.enqueue(p.sortOrder), m(), x(t, p.sortOrder);
|
|
454
|
-
const n = O(c);
|
|
455
|
-
l("sort-column", {
|
|
456
|
-
field: p.sortField,
|
|
457
|
-
order: p.sortOrder,
|
|
458
|
-
column: p.sortColumn,
|
|
459
|
-
columns: n
|
|
460
|
-
}), l("change-column-info", {
|
|
461
|
-
type: "sort",
|
|
462
|
-
columns: n
|
|
463
|
-
});
|
|
464
|
-
}
|
|
465
|
-
}, setSortInfo: (t, e = !0) => {
|
|
466
|
-
const o = t == null ? void 0 : t.findIndex(
|
|
467
|
-
(s) => {
|
|
468
|
-
var a;
|
|
469
|
-
return (s == null ? void 0 : s.sortable) && ((a = s == null ? void 0 : s.sortOption) == null ? void 0 : a.sortType) && s.sortOption.sortType !== "init";
|
|
470
|
-
}
|
|
471
|
-
), n = t[o];
|
|
472
|
-
o > -1 && (n.index = o);
|
|
473
|
-
const { sortType: i } = (n == null ? void 0 : n.sortOption) || {};
|
|
474
|
-
p.sortColumn = n, p.sortField = n == null ? void 0 : n.field, p.isSorting = !!i, p.sortOrder = i, x(n, i), e && l("change-column-info", {
|
|
475
|
-
type: "sort",
|
|
476
|
-
columns: O(c)
|
|
477
|
-
});
|
|
478
|
-
}, initSortInfo: (t) => {
|
|
479
|
-
p.isSorting = !1, p.sortOrder = "init", t.forEach((e) => {
|
|
480
|
-
var o;
|
|
481
|
-
(o = e == null ? void 0 : e.sortOption) != null && o.sortType && e.sortOption.sortType !== "init" && (e.sortOption.sortType = "init");
|
|
482
|
-
});
|
|
483
|
-
} };
|
|
484
|
-
};
|
|
485
|
-
export {
|
|
486
|
-
N as checkEvent,
|
|
487
|
-
G as clickEvent,
|
|
488
|
-
q as commonFunctions,
|
|
489
|
-
$ as contextMenuEvent,
|
|
490
|
-
X as filterEvent,
|
|
491
|
-
O as getUpdatedColumns,
|
|
492
|
-
_ as pagingEvent,
|
|
493
|
-
B as resizeEvent,
|
|
494
|
-
A as scrollEvent,
|
|
495
|
-
Q as sortEvent,
|
|
496
|
-
K as treeEvent
|
|
497
|
-
};
|