fancy-plugins-components 1.0.32 → 1.0.34
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/es/components.d.ts +1 -0
- package/dist/es/components.js +6 -4
- package/dist/es/fancy-card/index.vue.js +43 -47
- package/dist/es/fancy-select-table/index.d.ts +2 -0
- package/dist/es/fancy-select-table/index.js +4 -0
- package/dist/es/fancy-select-table/index.vue.d.ts +49 -0
- package/dist/es/fancy-select-table/index.vue.js +502 -0
- package/dist/es/fancy-select-table/index.vue2.js +4 -0
- package/dist/es/fancy-select-table/styles/index.js +1 -0
- package/dist/es/fancy-select-table/styles/index.scss +155 -0
- package/dist/es/fancy-select-table/types.d.ts +61 -0
- package/dist/es/global.d.ts +1 -0
- package/dist/es/index.js +4 -2
- package/dist/es/node_modules/.pnpm/@vueuse_core@14.2.1_vue@3.5.28_typescript@5.9.3_/node_modules/@vueuse/core/dist/index.js +78 -0
- package/dist/es/node_modules/.pnpm/@vueuse_shared@14.2.1_vue@3.5.28_typescript@5.9.3_/node_modules/@vueuse/shared/dist/index.js +23 -0
- package/dist/es/node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_Symbol.js +5 -0
- package/dist/es/node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseGetTag.js +10 -0
- package/dist/es/node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseTrim.js +8 -0
- package/dist/es/node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_freeGlobal.js +4 -0
- package/dist/es/node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_getRawTag.js +15 -0
- package/dist/es/node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_objectToString.js +7 -0
- package/dist/es/node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_root.js +5 -0
- package/dist/es/node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_trimmedEndIndex.js +9 -0
- package/dist/es/node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/debounce.js +54 -0
- package/dist/es/node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isObject.js +7 -0
- package/dist/es/node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isObjectLike.js +6 -0
- package/dist/es/node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isSymbol.js +9 -0
- package/dist/es/node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/now.js +7 -0
- package/dist/es/node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/toNumber.js +22 -0
- package/dist/es/styles/index.scss +1 -0
- package/dist/es/types.d.ts +1 -0
- package/package.json +14 -1
- package/dist/es/node_modules/.pnpm/ele-admin-plus@1.5.0_element-plus@2.13.0_vue@3.5.28_typescript@5.9.3___vue@3.5.28_typescript@5.9.3_/node_modules/ele-admin-plus/es/ele-card/index.js +0 -106
- package/dist/es/node_modules/.pnpm/ele-admin-plus@1.5.0_element-plus@2.13.0_vue@3.5.28_typescript@5.9.3___vue@3.5.28_typescript@5.9.3_/node_modules/ele-admin-plus/es/ele-card/props.js +0 -41
- package/dist/es/node_modules/.pnpm/ele-admin-plus@1.5.0_element-plus@2.13.0_vue@3.5.28_typescript@5.9.3___vue@3.5.28_typescript@5.9.3_/node_modules/ele-admin-plus/es/ele-card/style/index.css +0 -1
- package/dist/es/node_modules/.pnpm/ele-admin-plus@1.5.0_element-plus@2.13.0_vue@3.5.28_typescript@5.9.3___vue@3.5.28_typescript@5.9.3_/node_modules/ele-admin-plus/es/ele-config-provider/components/receiver-view.js +0 -40
- package/dist/es/node_modules/.pnpm/ele-admin-plus@1.5.0_element-plus@2.13.0_vue@3.5.28_typescript@5.9.3___vue@3.5.28_typescript@5.9.3_/node_modules/ele-admin-plus/es/ele-config-provider/receiver.js +0 -11
- package/dist/es/node_modules/.pnpm/ele-admin-plus@1.5.0_element-plus@2.13.0_vue@3.5.28_typescript@5.9.3___vue@3.5.28_typescript@5.9.3_/node_modules/ele-admin-plus/es/ele-loading/components/loading-spinner.js +0 -42
- package/dist/es/node_modules/.pnpm/ele-admin-plus@1.5.0_element-plus@2.13.0_vue@3.5.28_typescript@5.9.3___vue@3.5.28_typescript@5.9.3_/node_modules/ele-admin-plus/es/ele-loading/index.js +0 -59
- package/dist/es/node_modules/.pnpm/ele-admin-plus@1.5.0_element-plus@2.13.0_vue@3.5.28_typescript@5.9.3___vue@3.5.28_typescript@5.9.3_/node_modules/ele-admin-plus/es/ele-loading/props.js +0 -30
- package/dist/es/node_modules/.pnpm/ele-admin-plus@1.5.0_element-plus@2.13.0_vue@3.5.28_typescript@5.9.3___vue@3.5.28_typescript@5.9.3_/node_modules/ele-admin-plus/es/ele-loading/style/index.css +0 -1
- package/dist/es/node_modules/.pnpm/ele-admin-plus@1.5.0_element-plus@2.13.0_vue@3.5.28_typescript@5.9.3___vue@3.5.28_typescript@5.9.3_/node_modules/ele-admin-plus/es/ele-qr-code-svg/components/svg-render.js +0 -154
- package/dist/es/node_modules/.pnpm/ele-admin-plus@1.5.0_element-plus@2.13.0_vue@3.5.28_typescript@5.9.3___vue@3.5.28_typescript@5.9.3_/node_modules/ele-admin-plus/es/ele-qr-code-svg/qrcodegen.js +0 -79
- package/dist/es/node_modules/.pnpm/ele-admin-plus@1.5.0_element-plus@2.13.0_vue@3.5.28_typescript@5.9.3___vue@3.5.28_typescript@5.9.3_/node_modules/ele-admin-plus/es/ele-qr-code-svg/util.js +0 -82
- package/dist/es/node_modules/.pnpm/ele-admin-plus@1.5.0_element-plus@2.13.0_vue@3.5.28_typescript@5.9.3___vue@3.5.28_typescript@5.9.3_/node_modules/ele-admin-plus/es/ele-text/index.js +0 -52
- package/dist/es/node_modules/.pnpm/ele-admin-plus@1.5.0_element-plus@2.13.0_vue@3.5.28_typescript@5.9.3___vue@3.5.28_typescript@5.9.3_/node_modules/ele-admin-plus/es/ele-text/props.js +0 -25
- package/dist/es/node_modules/.pnpm/ele-admin-plus@1.5.0_element-plus@2.13.0_vue@3.5.28_typescript@5.9.3___vue@3.5.28_typescript@5.9.3_/node_modules/ele-admin-plus/es/ele-text/style/index.css +0 -1
- package/dist/es/node_modules/.pnpm/ele-admin-plus@1.5.0_element-plus@2.13.0_vue@3.5.28_typescript@5.9.3___vue@3.5.28_typescript@5.9.3_/node_modules/ele-admin-plus/es/ele-watermark/index.js +0 -128
- package/dist/es/node_modules/.pnpm/ele-admin-plus@1.5.0_element-plus@2.13.0_vue@3.5.28_typescript@5.9.3___vue@3.5.28_typescript@5.9.3_/node_modules/ele-admin-plus/es/ele-watermark/props.js +0 -40
- package/dist/es/node_modules/.pnpm/ele-admin-plus@1.5.0_element-plus@2.13.0_vue@3.5.28_typescript@5.9.3___vue@3.5.28_typescript@5.9.3_/node_modules/ele-admin-plus/es/ele-watermark/util.js +0 -129
- package/dist/es/node_modules/.pnpm/ele-admin-plus@1.5.0_element-plus@2.13.0_vue@3.5.28_typescript@5.9.3___vue@3.5.28_typescript@5.9.3_/node_modules/ele-admin-plus/es/icons/ArrowUp.js +0 -21
- package/dist/es/node_modules/.pnpm/ele-admin-plus@1.5.0_element-plus@2.13.0_vue@3.5.28_typescript@5.9.3___vue@3.5.28_typescript@5.9.3_/node_modules/ele-admin-plus/es/utils/common.js +0 -25
- package/dist/es/node_modules/.pnpm/ele-admin-plus@1.5.0_element-plus@2.13.0_vue@3.5.28_typescript@5.9.3___vue@3.5.28_typescript@5.9.3_/node_modules/ele-admin-plus/es/utils/hook.js +0 -33
|
@@ -0,0 +1,502 @@
|
|
|
1
|
+
import { ElTooltip as Oe, ElTag as We, ElIcon as He } from "element-plus/es";
|
|
2
|
+
import "element-plus/es/components/base/style/index";
|
|
3
|
+
import "element-plus/es/components/tooltip/style/index";
|
|
4
|
+
import { EleLoading as $e } from "ele-admin-plus/es";
|
|
5
|
+
import "ele-admin-plus/es/ele-loading/style/index";
|
|
6
|
+
import "element-plus/es/components/icon/style/index";
|
|
7
|
+
import "element-plus/es/components/tag/style/index";
|
|
8
|
+
import { defineComponent as Ne, mergeModels as ee, useModel as Ue, useSlots as je, ref as f, computed as c, reactive as Ge, onMounted as qe, nextTick as d, watch as z, resolveComponent as te, resolveDirective as Je, withDirectives as le, createElementBlock as A, openBlock as k, createVNode as R, withCtx as x, createElementVNode as g, normalizeStyle as ae, renderSlot as E, mergeProps as Qe, toHandlers as Xe, createSlots as Ye, renderList as oe, normalizeProps as Ze, guardReactiveProps as et, withModifiers as I, normalizeClass as P, createCommentVNode as M, Fragment as tt, createTextVNode as lt, toDisplayString as O, unref as y, withKeys as at, vModelText as ot, createBlock as ne } from "vue";
|
|
9
|
+
import { CircleClose as nt, ArrowDown as rt } from "@element-plus/icons-vue";
|
|
10
|
+
import { useEventListener as W, useResizeObserver as H } from "../node_modules/.pnpm/@vueuse_core@14.2.1_vue@3.5.28_typescript@5.9.3_/node_modules/@vueuse/core/dist/index.js";
|
|
11
|
+
import { useFormItem as re, useComposition as st } from "element-plus";
|
|
12
|
+
import "vxe-table";
|
|
13
|
+
import it from "../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/debounce.js";
|
|
14
|
+
const ut = { class: "select-table__selection" }, ct = ["readonly", "disabled", "onKeydown"], dt = ["textContent"], pt = { class: "select-table__dropown-wrapper" }, ft = { class: "pager_content" }, vt = 11, Tt = /* @__PURE__ */ Ne({
|
|
15
|
+
__name: "index",
|
|
16
|
+
props: /* @__PURE__ */ ee({
|
|
17
|
+
datasource: {},
|
|
18
|
+
vxeProps: {},
|
|
19
|
+
valueKey: {},
|
|
20
|
+
labelKey: {},
|
|
21
|
+
cacheData: {},
|
|
22
|
+
disabled: { type: Boolean },
|
|
23
|
+
clearable: { type: Boolean, default: !1 },
|
|
24
|
+
filterable: { type: Boolean, default: !0 },
|
|
25
|
+
placeholder: { default: "请选择" },
|
|
26
|
+
effect: { default: "light" },
|
|
27
|
+
showArrow: { type: Boolean, default: !0 },
|
|
28
|
+
fitInputWidth: { type: Boolean },
|
|
29
|
+
persistent: { type: Boolean, default: !0 },
|
|
30
|
+
fallbackPlacements: { default: () => ["bottom-start", "top-start", "right", "left"] },
|
|
31
|
+
popperContentWidth: { default: 900 },
|
|
32
|
+
popperClass: {},
|
|
33
|
+
loadingText: {},
|
|
34
|
+
inputDelay: { default: 500 },
|
|
35
|
+
autoFoucsDropdown: { type: Boolean, default: !0 },
|
|
36
|
+
closeTooltipOnClickClear: { type: Boolean, default: !0 },
|
|
37
|
+
keepLabelSearch: { type: Boolean, default: !0 },
|
|
38
|
+
upAndDownArrowLoop: { type: Boolean },
|
|
39
|
+
multiple: { type: Boolean },
|
|
40
|
+
tagType: {},
|
|
41
|
+
beforeSelect: {}
|
|
42
|
+
}, {
|
|
43
|
+
modelValue: {},
|
|
44
|
+
modelModifiers: {}
|
|
45
|
+
}),
|
|
46
|
+
emits: /* @__PURE__ */ ee(["focus", "blur", "visible-change", "data-error", "select", "clear"], ["update:modelValue"]),
|
|
47
|
+
setup(u, { expose: se, emit: ie }) {
|
|
48
|
+
const a = u, m = ie, i = Ue(u, "modelValue"), { formItem: $ } = re(), N = je(), U = f(), K = f(), v = f(), S = f(), h = f(), T = f(), ue = c(() => T.value?.popperRef?.contentRef), e = Ge({
|
|
49
|
+
inputHovering: !1,
|
|
50
|
+
isFocused: !1,
|
|
51
|
+
expanded: !1,
|
|
52
|
+
inputValue: "",
|
|
53
|
+
calculatorWidth: 0,
|
|
54
|
+
tableActiveIndex: 0,
|
|
55
|
+
currentLabel: "",
|
|
56
|
+
currentValue: "",
|
|
57
|
+
tooltipVisibleOnFocus: !1,
|
|
58
|
+
selected: []
|
|
59
|
+
}), { isComposing: j, handleCompositionStart: G, handleCompositionUpdate: q, handleCompositionEnd: J } = st({
|
|
60
|
+
afterComposition: (t) => Y(t)
|
|
61
|
+
}), ce = c({
|
|
62
|
+
get() {
|
|
63
|
+
return e.expanded;
|
|
64
|
+
},
|
|
65
|
+
set(t) {
|
|
66
|
+
e.expanded = t;
|
|
67
|
+
}
|
|
68
|
+
}), { form: de } = re(), V = c(() => a.disabled || de?.disabled), F = () => {
|
|
69
|
+
V.value || (e.tooltipVisibleOnFocus ? e.tooltipVisibleOnFocus = !1 : e.expanded = !e.expanded);
|
|
70
|
+
}, pe = (t) => {
|
|
71
|
+
t.target === U.value?.$el && a.autoFoucsDropdown || V.value || e.isFocused || d(() => {
|
|
72
|
+
e.isFocused = !0, m("focus", t), a.autoFoucsDropdown && !e.expanded && (e.expanded = !0, e.tooltipVisibleOnFocus = !0);
|
|
73
|
+
});
|
|
74
|
+
}, fe = (t) => T.value?.isFocusInsideContent(t), Q = (t) => {
|
|
75
|
+
fe(t) || t.target && v.value?.contains(t.target) || t.relatedTarget && v.value?.contains(t.relatedTarget) || (e.isFocused = !1, m("blur", t), e.expanded = !1, e.tooltipVisibleOnFocus = !1);
|
|
76
|
+
}, ve = () => {
|
|
77
|
+
v.value?.contains(document.activeElement) && v.value !== document.activeElement || h.value?.focus();
|
|
78
|
+
};
|
|
79
|
+
W(v, "focus", pe, !0), W(v, "blur", Q, !0), W(v, "click", ve, !0), c(() => a.fitInputWidth);
|
|
80
|
+
const be = f(""), X = () => {
|
|
81
|
+
be.value = `${K.value?.offsetWidth}px`;
|
|
82
|
+
};
|
|
83
|
+
qe(() => {
|
|
84
|
+
X(), H(K, X);
|
|
85
|
+
});
|
|
86
|
+
const ge = (t) => {
|
|
87
|
+
if (e.expanded = !1, e.isFocused) {
|
|
88
|
+
const l = new FocusEvent("focus", t);
|
|
89
|
+
d(() => Q(l));
|
|
90
|
+
}
|
|
91
|
+
}, me = it(() => {
|
|
92
|
+
n.value.currentPage = 1, w();
|
|
93
|
+
}, a.inputDelay), Y = (t) => {
|
|
94
|
+
e.inputValue = t.target.value, e.expanded || (e.expanded = !0), me();
|
|
95
|
+
}, xe = () => {
|
|
96
|
+
e.expanded ? Ke() : F();
|
|
97
|
+
}, ye = c(() => ({
|
|
98
|
+
width: `${Math.max(e.calculatorWidth, vt)}px`
|
|
99
|
+
})), he = () => {
|
|
100
|
+
e.calculatorWidth = S.value?.getBoundingClientRect().width || 0;
|
|
101
|
+
}, we = () => {
|
|
102
|
+
T.value?.updatePopper?.();
|
|
103
|
+
};
|
|
104
|
+
H(S, he), H(v, we);
|
|
105
|
+
const Ce = c(() => a.multiple ? !e.selected.length : !e.inputValue), ke = c(() => e.currentLabel ? e.currentLabel : a.placeholder ? a.placeholder : "请选择"), Re = c(() => a.multiple && e.selected.length && a.clearable && e.inputHovering && !V.value ? !0 : a.clearable && e.inputHovering && i.value && !Array.isArray(i.value) && !V.value), Ve = c(() => !!N.header), Ae = c(() => Object.keys(N).filter((t) => !["header", "footer"].includes(t))), Ie = c(() => "select-table__popper vxe-table--ignore-clear " + (a.popperClass ?? "") + (Ve.value ? " has-header" : "")), _ = f(!1), p = f(), Te = f(), _e = c(() => {
|
|
106
|
+
const t = {
|
|
107
|
+
height: 350,
|
|
108
|
+
rowConfig: {
|
|
109
|
+
isCurrent: !0,
|
|
110
|
+
isHover: !0
|
|
111
|
+
},
|
|
112
|
+
columnConfig: {
|
|
113
|
+
resizable: !0
|
|
114
|
+
},
|
|
115
|
+
...a.vxeProps
|
|
116
|
+
};
|
|
117
|
+
return a.multiple && (t.columns = [
|
|
118
|
+
{ type: "checkbox", align: "center", width: 50 },
|
|
119
|
+
...a.vxeProps?.columns || []
|
|
120
|
+
], t.checkboxConfig = {
|
|
121
|
+
trigger: "row",
|
|
122
|
+
...t.checkboxConfig
|
|
123
|
+
// reserve: true,
|
|
124
|
+
}, t.rowConfig = {
|
|
125
|
+
...t.rowConfig,
|
|
126
|
+
keyField: a.valueKey.toString()
|
|
127
|
+
}), t;
|
|
128
|
+
}), n = f({
|
|
129
|
+
total: 0,
|
|
130
|
+
currentPage: 1,
|
|
131
|
+
pageSize: 20,
|
|
132
|
+
gridTableData: []
|
|
133
|
+
}), De = () => {
|
|
134
|
+
e.selected.forEach((t) => {
|
|
135
|
+
const l = n.value.gridTableData.find(
|
|
136
|
+
(o) => o[a.valueKey] === t[a.valueKey]
|
|
137
|
+
);
|
|
138
|
+
l && p.value?.setCheckboxRow(l, !0);
|
|
139
|
+
});
|
|
140
|
+
}, w = async () => {
|
|
141
|
+
if (!j.value) {
|
|
142
|
+
e.tableActiveIndex = 0, _.value = !0;
|
|
143
|
+
try {
|
|
144
|
+
console.log(e, "ss");
|
|
145
|
+
const { currentPage: t, pageSize: l } = n.value, o = await a.datasource({
|
|
146
|
+
page: t,
|
|
147
|
+
size: l,
|
|
148
|
+
filter: e.inputValue
|
|
149
|
+
});
|
|
150
|
+
if (!o) {
|
|
151
|
+
n.value.total = 0, n.value.gridTableData = [];
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
n.value.total = o.total, n.value.gridTableData = o.list, d(() => {
|
|
155
|
+
d(() => {
|
|
156
|
+
p.value?.focus();
|
|
157
|
+
});
|
|
158
|
+
let b = n.value.gridTableData?.[0];
|
|
159
|
+
if (e.currentValue) {
|
|
160
|
+
const C = o.list.findIndex((B) => B[a.valueKey] === e.currentValue);
|
|
161
|
+
C > -1 && (b = o.list[C], e.tableActiveIndex = C);
|
|
162
|
+
}
|
|
163
|
+
p.value?.setCurrentRow(b), setTimeout(() => {
|
|
164
|
+
p.value?.scrollToRow(b);
|
|
165
|
+
}, 0), d(() => {
|
|
166
|
+
De();
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
} catch (t) {
|
|
170
|
+
m("data-error", t);
|
|
171
|
+
} finally {
|
|
172
|
+
_.value = !1;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
z(
|
|
177
|
+
() => e.expanded,
|
|
178
|
+
(t) => {
|
|
179
|
+
t ? j.value || w() : (a.keepLabelSearch || (e.inputValue = ""), e.tableActiveIndex = 0, n.value = {
|
|
180
|
+
pageSize: n.value.pageSize,
|
|
181
|
+
currentPage: 1,
|
|
182
|
+
total: 0,
|
|
183
|
+
gridTableData: []
|
|
184
|
+
}), m("visible-change", t);
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
const Pe = c(() => Math.ceil(n.value.total / n.value.pageSize)), Z = c(() => n.value.currentPage === Pe.value), D = (t) => {
|
|
188
|
+
const l = n.value.gridTableData[t];
|
|
189
|
+
p.value?.setCurrentRow(l), d(() => {
|
|
190
|
+
p.value?.scrollToRow(l);
|
|
191
|
+
});
|
|
192
|
+
}, Ke = async () => {
|
|
193
|
+
const t = e.tableActiveIndex, l = n.value.gridTableData?.[t];
|
|
194
|
+
if (a.multiple) {
|
|
195
|
+
const o = e.selected.indexOf(l);
|
|
196
|
+
o > -1 ? (e.selected.splice(o, 1), i.value.splice(o, 1)) : (e.selected.push(l), i.value.push(l?.[a.valueKey])), p.value?.setCheckboxRow(l, o === -1);
|
|
197
|
+
} else {
|
|
198
|
+
if (a.beforeSelect && !await a.beforeSelect(l))
|
|
199
|
+
return;
|
|
200
|
+
e.currentLabel = l?.[a.labelKey], e.inputValue = l?.[a.labelKey], i.value = e.currentValue = l?.[a.valueKey], e.expanded = !1, m("select", l);
|
|
201
|
+
}
|
|
202
|
+
d(() => {
|
|
203
|
+
$?.validate("change");
|
|
204
|
+
});
|
|
205
|
+
}, Se = (t) => {
|
|
206
|
+
if (_.value) return;
|
|
207
|
+
const l = t, { currentPage: o, gridTableData: r } = n.value;
|
|
208
|
+
if (l.key === "ArrowDown") {
|
|
209
|
+
if (e.tableActiveIndex + 1 === r.length)
|
|
210
|
+
if (a.upAndDownArrowLoop) {
|
|
211
|
+
e.tableActiveIndex = 0, D(e.tableActiveIndex);
|
|
212
|
+
return;
|
|
213
|
+
} else {
|
|
214
|
+
if (Z.value)
|
|
215
|
+
return;
|
|
216
|
+
n.value.currentPage++, w();
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
e.tableActiveIndex++, D(e.tableActiveIndex);
|
|
220
|
+
return;
|
|
221
|
+
} else if (l.key === "ArrowUp") {
|
|
222
|
+
if (e.tableActiveIndex === 0)
|
|
223
|
+
if (a.upAndDownArrowLoop) {
|
|
224
|
+
e.tableActiveIndex = n.value.gridTableData.length - 1, D(e.tableActiveIndex);
|
|
225
|
+
return;
|
|
226
|
+
} else {
|
|
227
|
+
if (o === 1)
|
|
228
|
+
return;
|
|
229
|
+
n.value.currentPage--, w();
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
e.tableActiveIndex--, D(e.tableActiveIndex);
|
|
233
|
+
return;
|
|
234
|
+
} else if (l.key === "ArrowLeft") {
|
|
235
|
+
if (o === 1)
|
|
236
|
+
return;
|
|
237
|
+
n.value.currentPage--, w();
|
|
238
|
+
return;
|
|
239
|
+
} else if (l.key === "ArrowRight") {
|
|
240
|
+
if (Z.value)
|
|
241
|
+
return;
|
|
242
|
+
n.value.currentPage++, w();
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
}, Fe = {
|
|
246
|
+
keydown({ $event: t }) {
|
|
247
|
+
Se(t);
|
|
248
|
+
},
|
|
249
|
+
async cellClick({ row: t, rowIndex: l }) {
|
|
250
|
+
if (a.multiple) {
|
|
251
|
+
const o = e.selected.indexOf(t);
|
|
252
|
+
o > -1 ? (e.selected.splice(o, 1), i.value.splice(o, 1)) : (e.selected.push(t), i.value.push(t?.[a.valueKey]));
|
|
253
|
+
} else {
|
|
254
|
+
if (a.beforeSelect && !await a.beforeSelect(t))
|
|
255
|
+
return;
|
|
256
|
+
e.currentLabel = t[a.labelKey], e.inputValue = t[a.labelKey], i.value = e.currentValue = t?.[a.valueKey], e.expanded = !1, m("select", t);
|
|
257
|
+
}
|
|
258
|
+
e.tableActiveIndex = l, d(() => {
|
|
259
|
+
$?.validate("change");
|
|
260
|
+
});
|
|
261
|
+
},
|
|
262
|
+
checkboxAll({ checked: t }) {
|
|
263
|
+
const l = i.value, o = n.value.gridTableData.map((r) => r[a.valueKey]);
|
|
264
|
+
t ? (o.forEach((r) => {
|
|
265
|
+
l.includes(r) || i.value.push(r);
|
|
266
|
+
}), n.value.gridTableData.forEach((r) => {
|
|
267
|
+
e.selected.findIndex(
|
|
268
|
+
(C) => r[a.valueKey] === C[a.valueKey]
|
|
269
|
+
) > -1 || e.selected.push(r);
|
|
270
|
+
})) : (i.value = l.filter((r) => !o.includes(r)), e.selected = e.selected.filter((r) => !o.includes(r[a.valueKey]))), d(() => {
|
|
271
|
+
h.value?.focus();
|
|
272
|
+
});
|
|
273
|
+
},
|
|
274
|
+
checkboxChange() {
|
|
275
|
+
d(() => {
|
|
276
|
+
h.value?.focus();
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
}, Be = async () => {
|
|
280
|
+
await w(), d(() => {
|
|
281
|
+
h.value?.focus();
|
|
282
|
+
});
|
|
283
|
+
}, Le = (t) => {
|
|
284
|
+
t.preventDefault(), t.stopPropagation(), a.multiple ? (e.selected = [], i.value = [], p.value?.setAllCheckboxRow(!1)) : (e.currentLabel = "", e.currentValue = "", i.value = ""), e.tableActiveIndex = 0, a.closeTooltipOnClickClear && (e.expanded = !1), e.isFocused = !0, d(() => {
|
|
285
|
+
h.value?.focus(), m("clear");
|
|
286
|
+
});
|
|
287
|
+
};
|
|
288
|
+
z(
|
|
289
|
+
() => a.cacheData,
|
|
290
|
+
(t) => {
|
|
291
|
+
if (!i.value) return;
|
|
292
|
+
const l = t || [], o = a.labelKey, r = a.valueKey;
|
|
293
|
+
if (a.multiple)
|
|
294
|
+
e.selected = [...l];
|
|
295
|
+
else {
|
|
296
|
+
const b = l?.[0];
|
|
297
|
+
e.currentLabel = b?.[o] ?? "", e.currentValue = b?.[r] ?? "", a.keepLabelSearch && (e.inputValue = e.currentLabel);
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
immediate: !0
|
|
302
|
+
}
|
|
303
|
+
), z(
|
|
304
|
+
() => i.value,
|
|
305
|
+
(t) => {
|
|
306
|
+
t || (e.currentLabel = "", e.currentValue = "", e.inputValue = "");
|
|
307
|
+
}
|
|
308
|
+
);
|
|
309
|
+
const ze = (t, l) => {
|
|
310
|
+
i.value = i.value.filter((r) => l[a.valueKey] !== r), p.value?.setCheckboxRow(l, !1);
|
|
311
|
+
const o = e.selected.indexOf(l);
|
|
312
|
+
o > -1 && e.selected.splice(o, 1), m("select", l), t.stopPropagation(), d(() => {
|
|
313
|
+
p.value?.focus();
|
|
314
|
+
});
|
|
315
|
+
};
|
|
316
|
+
return se({
|
|
317
|
+
inputRef: h,
|
|
318
|
+
gridRef: p
|
|
319
|
+
}), (t, l) => {
|
|
320
|
+
const o = We, r = He, b = te("vxe-pager"), C = te("vxe-grid"), B = $e, Ee = Oe, Me = Je("click-outside");
|
|
321
|
+
return le((k(), A("div", {
|
|
322
|
+
ref_key: "selectRef",
|
|
323
|
+
ref: K,
|
|
324
|
+
class: "select-table",
|
|
325
|
+
onMouseenter: l[8] || (l[8] = (s) => e.inputHovering = !0),
|
|
326
|
+
onMouseleave: l[9] || (l[9] = (s) => e.inputHovering = !1)
|
|
327
|
+
}, [
|
|
328
|
+
R(Ee, {
|
|
329
|
+
ref_key: "tooltipRef",
|
|
330
|
+
ref: T,
|
|
331
|
+
visible: ce.value,
|
|
332
|
+
effect: u.effect,
|
|
333
|
+
pure: "",
|
|
334
|
+
"fallback-placements": u.fallbackPlacements,
|
|
335
|
+
persistent: u.persistent,
|
|
336
|
+
trigger: "click",
|
|
337
|
+
"show-arrow": u.showArrow,
|
|
338
|
+
"stop-popper-mouse-event": !1,
|
|
339
|
+
"gpu-acceleration": !1,
|
|
340
|
+
transition: "el-zoom-in-top",
|
|
341
|
+
"popper-class": Ie.value
|
|
342
|
+
}, {
|
|
343
|
+
default: x(() => [
|
|
344
|
+
g("div", {
|
|
345
|
+
ref_key: "wrapperRef",
|
|
346
|
+
ref: v,
|
|
347
|
+
tabindex: "-1",
|
|
348
|
+
class: P(["select-table__wrapper", {
|
|
349
|
+
"is-filterable": u.filterable,
|
|
350
|
+
"is-hovering": e.inputHovering,
|
|
351
|
+
"is-focused": e.isFocused,
|
|
352
|
+
"is-disabled": V.value
|
|
353
|
+
}]),
|
|
354
|
+
onClick: I(F, ["prevent"])
|
|
355
|
+
}, [
|
|
356
|
+
g("div", ut, [
|
|
357
|
+
u.multiple ? (k(!0), A(tt, { key: 0 }, oe(e.selected, (s) => (k(), A("div", {
|
|
358
|
+
class: "select-table__selected-item",
|
|
359
|
+
key: s[u.valueKey]
|
|
360
|
+
}, [
|
|
361
|
+
R(o, {
|
|
362
|
+
"disable-transitions": "",
|
|
363
|
+
closable: "",
|
|
364
|
+
onClose: (L) => ze(L, s)
|
|
365
|
+
}, {
|
|
366
|
+
default: x(() => [
|
|
367
|
+
lt(O(s[u.labelKey]), 1)
|
|
368
|
+
]),
|
|
369
|
+
_: 2
|
|
370
|
+
}, 1032, ["onClose"])
|
|
371
|
+
]))), 128)) : M("", !0),
|
|
372
|
+
g("div", {
|
|
373
|
+
class: P(["select-table__selected-item select-table__input-wrapper", { "is-hidden": !u.filterable }])
|
|
374
|
+
}, [
|
|
375
|
+
le(g("input", {
|
|
376
|
+
ref_key: "inputRef",
|
|
377
|
+
ref: h,
|
|
378
|
+
type: "text",
|
|
379
|
+
"onUpdate:modelValue": l[0] || (l[0] = (s) => e.inputValue = s),
|
|
380
|
+
class: "select-table__input",
|
|
381
|
+
readonly: !u.filterable,
|
|
382
|
+
style: ae(ye.value),
|
|
383
|
+
disabled: V.value,
|
|
384
|
+
onInput: Y,
|
|
385
|
+
onKeydown: at(I(xe, ["stop", "prevent"]), ["enter"]),
|
|
386
|
+
onCompositionstart: l[1] || (l[1] = //@ts-ignore
|
|
387
|
+
(...s) => y(G) && y(G)(...s)),
|
|
388
|
+
onCompositionend: l[2] || (l[2] = //@ts-ignore
|
|
389
|
+
(...s) => y(J) && y(J)(...s)),
|
|
390
|
+
onCompositionupdate: l[3] || (l[3] = //@ts-ignore
|
|
391
|
+
(...s) => y(q) && y(q)(...s)),
|
|
392
|
+
onClick: I(F, ["stop"])
|
|
393
|
+
}, null, 44, ct), [
|
|
394
|
+
[ot, e.inputValue]
|
|
395
|
+
]),
|
|
396
|
+
u.filterable ? (k(), A("span", {
|
|
397
|
+
key: 0,
|
|
398
|
+
ref_key: "calculatorRef",
|
|
399
|
+
ref: S,
|
|
400
|
+
"aria-hidden": "true",
|
|
401
|
+
class: "select-table__input-calculator",
|
|
402
|
+
textContent: O(e.inputValue)
|
|
403
|
+
}, null, 8, dt)) : M("", !0)
|
|
404
|
+
], 2),
|
|
405
|
+
Ce.value ? (k(), A("div", {
|
|
406
|
+
key: 1,
|
|
407
|
+
class: P(["select-table__selected-item select-table__placeholder", { "is-transparent": e.expanded }])
|
|
408
|
+
}, [
|
|
409
|
+
g("span", null, O(ke.value), 1)
|
|
410
|
+
], 2)) : M("", !0)
|
|
411
|
+
]),
|
|
412
|
+
g("div", {
|
|
413
|
+
class: "select-table__suffix",
|
|
414
|
+
onClick: l[5] || (l[5] = I(() => {
|
|
415
|
+
}, ["stop"]))
|
|
416
|
+
}, [
|
|
417
|
+
Re.value ? (k(), ne(r, {
|
|
418
|
+
key: 0,
|
|
419
|
+
ref_key: "clearIconRef",
|
|
420
|
+
ref: U,
|
|
421
|
+
tabindex: "-1",
|
|
422
|
+
onFocus: l[4] || (l[4] = I(() => {
|
|
423
|
+
}, ["stop", "prevent"])),
|
|
424
|
+
class: "select-table__clear",
|
|
425
|
+
onClick: Le
|
|
426
|
+
}, {
|
|
427
|
+
default: x(() => [
|
|
428
|
+
R(y(nt))
|
|
429
|
+
]),
|
|
430
|
+
_: 1
|
|
431
|
+
}, 512)) : (k(), ne(r, {
|
|
432
|
+
key: 1,
|
|
433
|
+
class: P(["select-table__caret", { "is-reverse": e.expanded }])
|
|
434
|
+
}, {
|
|
435
|
+
default: x(() => [
|
|
436
|
+
R(y(rt))
|
|
437
|
+
]),
|
|
438
|
+
_: 1
|
|
439
|
+
}, 8, ["class"]))
|
|
440
|
+
])
|
|
441
|
+
], 2)
|
|
442
|
+
]),
|
|
443
|
+
content: x(() => [
|
|
444
|
+
g("div", pt, [
|
|
445
|
+
g("div", {
|
|
446
|
+
class: "select-table__dropown",
|
|
447
|
+
style: ae({ width: `${u.popperContentWidth ? u.popperContentWidth + "px" : "100%"}` })
|
|
448
|
+
}, [
|
|
449
|
+
R(B, {
|
|
450
|
+
loading: _.value,
|
|
451
|
+
blur: "",
|
|
452
|
+
text: u.loadingText
|
|
453
|
+
}, {
|
|
454
|
+
default: x(() => [
|
|
455
|
+
E(t.$slots, "header"),
|
|
456
|
+
R(C, Qe({
|
|
457
|
+
ref_key: "gridRef",
|
|
458
|
+
ref: p
|
|
459
|
+
}, _e.value, Xe(Fe), {
|
|
460
|
+
data: n.value.gridTableData
|
|
461
|
+
}), Ye({
|
|
462
|
+
pager: x(() => [
|
|
463
|
+
g("div", ft, [
|
|
464
|
+
R(b, {
|
|
465
|
+
ref_key: "pagerRef",
|
|
466
|
+
ref: Te,
|
|
467
|
+
"current-page": n.value.currentPage,
|
|
468
|
+
"onUpdate:currentPage": l[6] || (l[6] = (s) => n.value.currentPage = s),
|
|
469
|
+
"page-size": n.value.pageSize,
|
|
470
|
+
"onUpdate:pageSize": l[7] || (l[7] = (s) => n.value.pageSize = s),
|
|
471
|
+
total: n.value.total,
|
|
472
|
+
onPageChange: Be
|
|
473
|
+
}, null, 8, ["current-page", "page-size", "total"])
|
|
474
|
+
])
|
|
475
|
+
]),
|
|
476
|
+
_: 2
|
|
477
|
+
}, [
|
|
478
|
+
oe(Ae.value, (s) => ({
|
|
479
|
+
name: s,
|
|
480
|
+
fn: x(({ ...L }) => [
|
|
481
|
+
E(t.$slots, s, Ze(et(L)))
|
|
482
|
+
])
|
|
483
|
+
}))
|
|
484
|
+
]), 1040, ["data"]),
|
|
485
|
+
E(t.$slots, "footer")
|
|
486
|
+
]),
|
|
487
|
+
_: 3
|
|
488
|
+
}, 8, ["loading", "text"])
|
|
489
|
+
], 4)
|
|
490
|
+
])
|
|
491
|
+
]),
|
|
492
|
+
_: 3
|
|
493
|
+
}, 8, ["visible", "effect", "fallback-placements", "persistent", "show-arrow", "popper-class"])
|
|
494
|
+
], 32)), [
|
|
495
|
+
[Me, ge, ue.value]
|
|
496
|
+
]);
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
export {
|
|
501
|
+
Tt as default
|
|
502
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.scss'
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
.select-table {
|
|
2
|
+
width: 100%;
|
|
3
|
+
.select-table__wrapper {
|
|
4
|
+
height: 32px;
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
padding: 4px 12px;
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
font-size: 14px;
|
|
10
|
+
border: 1px solid #d9d9d9;
|
|
11
|
+
// border: var(--el-border);
|
|
12
|
+
border-radius: var(--el-border-radius-base);
|
|
13
|
+
background-color: var(--el-fill-color-blank);
|
|
14
|
+
transition: var(--el-transition-duration);
|
|
15
|
+
transform: translateZ(0);
|
|
16
|
+
line-height: 24px;
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
&.is-filterable {
|
|
21
|
+
cursor: text;
|
|
22
|
+
}
|
|
23
|
+
&:not(.is-disabled):hover {
|
|
24
|
+
border-color: #004aff;
|
|
25
|
+
}
|
|
26
|
+
&.is-hovering:not(.is-focused) {
|
|
27
|
+
// box-shadow: 0 0 0 1px var(--el-border-color-hover) inset;
|
|
28
|
+
}
|
|
29
|
+
&.is-focused {
|
|
30
|
+
box-shadow: 0 0 0 2px rgb(204, 219, 255);
|
|
31
|
+
border-color: #004aff;
|
|
32
|
+
}
|
|
33
|
+
&.is-disabled {
|
|
34
|
+
cursor: not-allowed;
|
|
35
|
+
// background-color: var(--el-fill-color-light);
|
|
36
|
+
background: #f5f5f5;
|
|
37
|
+
color: var(--el-text-color-placeholder);
|
|
38
|
+
border-color: #e8e8e8;
|
|
39
|
+
// box-shadow: 0 0 0 1px #e4e7ed inset;
|
|
40
|
+
box-shadow: none;
|
|
41
|
+
&:hover {
|
|
42
|
+
// box-shadow: 0 0 0 1px #e4e7ed inset;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
.select-table__selection {
|
|
46
|
+
flex: 1;
|
|
47
|
+
position: relative;
|
|
48
|
+
min-width: 0;
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-wrap: wrap;
|
|
51
|
+
align-items: center;
|
|
52
|
+
gap: 6px;
|
|
53
|
+
.select-table__selected-item {
|
|
54
|
+
user-select: none;
|
|
55
|
+
color: #606266;
|
|
56
|
+
}
|
|
57
|
+
.select-table__input-wrapper {
|
|
58
|
+
.select-table__input {
|
|
59
|
+
border: none;
|
|
60
|
+
outline: none;
|
|
61
|
+
padding: 0;
|
|
62
|
+
// color: var(--el-select-multiple-input-color);
|
|
63
|
+
color: rgba(0, 0, 0, 0.88);
|
|
64
|
+
appearance: none;
|
|
65
|
+
height: 24px;
|
|
66
|
+
max-width: 100%;
|
|
67
|
+
background-color: transparent;
|
|
68
|
+
}
|
|
69
|
+
.select-table__input-calculator {
|
|
70
|
+
position: absolute;
|
|
71
|
+
left: 0;
|
|
72
|
+
top: 0;
|
|
73
|
+
max-width: 100%;
|
|
74
|
+
visibility: hidden;
|
|
75
|
+
white-space: pre;
|
|
76
|
+
overflow: hidden;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
.is-transparent {
|
|
80
|
+
color: #a8abb2;
|
|
81
|
+
}
|
|
82
|
+
.is-hidden {
|
|
83
|
+
position: absolute;
|
|
84
|
+
opacity: 0;
|
|
85
|
+
}
|
|
86
|
+
.select-table__placeholder {
|
|
87
|
+
position: absolute;
|
|
88
|
+
display: block;
|
|
89
|
+
top: 50%;
|
|
90
|
+
transform: translateY(-50%);
|
|
91
|
+
width: 100%;
|
|
92
|
+
overflow: hidden;
|
|
93
|
+
text-overflow: ellipsis;
|
|
94
|
+
white-space: nowrap;
|
|
95
|
+
color: rgba(0, 0, 0, 0.36);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
.select-table__suffix {
|
|
99
|
+
color: rgba(0, 0, 0, 0.36);
|
|
100
|
+
font-size: 16px;
|
|
101
|
+
display: flex;
|
|
102
|
+
align-items: center;
|
|
103
|
+
.select-table__clear {
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
}
|
|
106
|
+
.select-table__caret {
|
|
107
|
+
transition: var(--el-transition-duration);
|
|
108
|
+
transform: rotate(0);
|
|
109
|
+
cursor: pointer;
|
|
110
|
+
}
|
|
111
|
+
.is-reverse {
|
|
112
|
+
transform: rotate(180deg);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
.select-table__popper {
|
|
118
|
+
border: 1px solid #004aff !important;
|
|
119
|
+
.select-table__dropown-wrapper {
|
|
120
|
+
.select-table__dropown {
|
|
121
|
+
border-radius: 8px;
|
|
122
|
+
overflow: hidden;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
&.is-light {
|
|
126
|
+
.el-popper__arrow {
|
|
127
|
+
&::before {
|
|
128
|
+
border: 1px solid #004aff !important;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
&[data-popper-placement^='bottom'] {
|
|
133
|
+
&.is-light {
|
|
134
|
+
.el-popper__arrow {
|
|
135
|
+
&::before {
|
|
136
|
+
background-color: #e8eefe !important;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
// body .el-popper.is-light > .el-popper__arrow::before {
|
|
143
|
+
// border: 1px solid var(--el-border-color-light);
|
|
144
|
+
// }
|
|
145
|
+
|
|
146
|
+
// .has-header {
|
|
147
|
+
// &.is-light {
|
|
148
|
+
// .el-popper__arrow {
|
|
149
|
+
// &::before {
|
|
150
|
+
// background-color: #ffffff !important;
|
|
151
|
+
// box-shadow: none !important;
|
|
152
|
+
// }
|
|
153
|
+
// }
|
|
154
|
+
// }
|
|
155
|
+
// }
|