fancy-plugins-components 1.0.33 → 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-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/components.d.ts
CHANGED
package/dist/es/components.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
import { default as
|
|
1
|
+
import { default as t } from "./fancy-button/index.vue.js";
|
|
2
|
+
import { default as r } from "./fancy-card/index.vue.js";
|
|
3
|
+
import { default as l } from "./fancy-select-table/index.vue.js";
|
|
3
4
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
t as FancyButton,
|
|
6
|
+
r as FancyCard,
|
|
7
|
+
l as FancySelectTable
|
|
6
8
|
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { SelectTableProps } from './types';
|
|
2
|
+
import { VxeGridInstance } from 'vxe-table';
|
|
3
|
+
type __VLS_Props = SelectTableProps;
|
|
4
|
+
type __VLS_PublicProps = {
|
|
5
|
+
modelValue?: any;
|
|
6
|
+
} & __VLS_Props;
|
|
7
|
+
declare function __VLS_template(): any;
|
|
8
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
9
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
10
|
+
inputRef: import('vue').Ref<HTMLInputElement | undefined, HTMLInputElement | undefined>;
|
|
11
|
+
gridRef: import('vue').Ref<VxeGridInstance | undefined, VxeGridInstance | undefined>;
|
|
12
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
13
|
+
"update:modelValue": (value: any) => any;
|
|
14
|
+
} & {
|
|
15
|
+
blur: (event: FocusEvent) => any;
|
|
16
|
+
focus: (event: FocusEvent) => any;
|
|
17
|
+
select: (row: any) => any;
|
|
18
|
+
clear: () => any;
|
|
19
|
+
"visible-change": (val: boolean) => any;
|
|
20
|
+
"data-error": (event: any) => any;
|
|
21
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
22
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
23
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
24
|
+
onSelect?: ((row: any) => any) | undefined;
|
|
25
|
+
onClear?: (() => any) | undefined;
|
|
26
|
+
"onVisible-change"?: ((val: boolean) => any) | undefined;
|
|
27
|
+
"onData-error"?: ((event: any) => any) | undefined;
|
|
28
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
29
|
+
}>, {
|
|
30
|
+
placeholder: string;
|
|
31
|
+
clearable: boolean;
|
|
32
|
+
filterable: boolean;
|
|
33
|
+
effect: "dark" | "light";
|
|
34
|
+
showArrow: boolean;
|
|
35
|
+
persistent: boolean;
|
|
36
|
+
fallbackPlacements: import('element-plus').Placement[];
|
|
37
|
+
popperContentWidth: number;
|
|
38
|
+
inputDelay: number;
|
|
39
|
+
autoFoucsDropdown: boolean;
|
|
40
|
+
closeTooltipOnClickClear: boolean;
|
|
41
|
+
keepLabelSearch: boolean;
|
|
42
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, any, any>;
|
|
43
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
44
|
+
export default _default;
|
|
45
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
46
|
+
new (): {
|
|
47
|
+
$slots: S;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
@@ -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
|
+
// }
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Placement } from 'element-plus';
|
|
2
|
+
import { VxeGridProps } from 'vxe-table';
|
|
3
|
+
export type SelctTablePageParams = {
|
|
4
|
+
page: number;
|
|
5
|
+
size: number;
|
|
6
|
+
filter: string;
|
|
7
|
+
};
|
|
8
|
+
export type SelectTableDataSource = (data: SelctTablePageParams) => Promise<{
|
|
9
|
+
list: any[];
|
|
10
|
+
total: number;
|
|
11
|
+
} | undefined>;
|
|
12
|
+
export interface SelectTableProps<T extends object = any> {
|
|
13
|
+
/** 表格数据源
|
|
14
|
+
* 目前只支持接口数据源,并且分页
|
|
15
|
+
* 静态数据源???
|
|
16
|
+
*/
|
|
17
|
+
datasource: SelectTableDataSource;
|
|
18
|
+
/** vxe-grid 表格配置 */
|
|
19
|
+
vxeProps: VxeGridProps<T>;
|
|
20
|
+
/** 类似于el-option 的value */
|
|
21
|
+
valueKey: Extract<keyof T, string | number>;
|
|
22
|
+
/** 类似于el-option 的label */
|
|
23
|
+
labelKey: Extract<keyof T, string | number>;
|
|
24
|
+
/** 回显数据使用 */
|
|
25
|
+
cacheData?: {
|
|
26
|
+
[key in keyof T as key extends Extract<keyof T, string | number> | Extract<keyof T, string | number> ? key : never]?: string;
|
|
27
|
+
}[];
|
|
28
|
+
/** 禁用 */
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
/** 清除按钮 */
|
|
31
|
+
clearable?: boolean;
|
|
32
|
+
/** 可搜索 */
|
|
33
|
+
filterable?: boolean;
|
|
34
|
+
placeholder?: string;
|
|
35
|
+
/** 貌似没啥用 */
|
|
36
|
+
effect?: 'dark' | 'light';
|
|
37
|
+
/** 展示tooltip箭头 */
|
|
38
|
+
showArrow?: boolean;
|
|
39
|
+
/** 下拉框的宽度是否与输入框相同 */
|
|
40
|
+
fitInputWidth?: boolean;
|
|
41
|
+
/** 当下拉选择器未被激活并且persistent设置为false,选择器会被删除 */
|
|
42
|
+
persistent?: boolean;
|
|
43
|
+
fallbackPlacements?: Placement[];
|
|
44
|
+
popperContentWidth?: number;
|
|
45
|
+
popperClass?: string;
|
|
46
|
+
loadingText?: string;
|
|
47
|
+
/** 输入防抖 */
|
|
48
|
+
inputDelay?: number;
|
|
49
|
+
/** 聚焦时自动打开tooltip */
|
|
50
|
+
autoFoucsDropdown?: boolean;
|
|
51
|
+
/** 清除按钮点击是否关闭tooltip */
|
|
52
|
+
closeTooltipOnClickClear?: boolean;
|
|
53
|
+
/** 保留上一次选择的label值进行查询 */
|
|
54
|
+
keepLabelSearch?: boolean;
|
|
55
|
+
/** 上下箭头循环,此时只能左右箭头切换分页 */
|
|
56
|
+
upAndDownArrowLoop?: boolean;
|
|
57
|
+
/** 多选 */
|
|
58
|
+
multiple?: boolean;
|
|
59
|
+
tagType?: '' | 'success' | 'info' | 'warning' | 'danger';
|
|
60
|
+
beforeSelect?: ((row: T) => boolean) | ((row: T) => Promise<boolean>);
|
|
61
|
+
}
|
package/dist/es/global.d.ts
CHANGED
package/dist/es/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { installer as t } from "./installer.js";
|
|
2
|
-
import { default as
|
|
2
|
+
import { default as o } from "./fancy-button/index.vue.js";
|
|
3
3
|
import { default as l } from "./fancy-card/index.vue.js";
|
|
4
|
+
import { default as m } from "./fancy-select-table/index.vue.js";
|
|
4
5
|
export {
|
|
5
|
-
|
|
6
|
+
o as FancyButton,
|
|
6
7
|
l as FancyCard,
|
|
8
|
+
m as FancySelectTable,
|
|
7
9
|
t as default
|
|
8
10
|
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { toArray as a, watchImmediate as M, tryOnScopeDispose as O, isClient as E, isObject as $ } from "../../../../../@vueuse_shared@14.2.1_vue@3.5.28_typescript@5.9.3_/node_modules/@vueuse/shared/dist/index.js";
|
|
2
|
+
import { computed as m, toValue as c, watch as R, shallowRef as z, getCurrentInstance as A, onMounted as C, unref as L } from "vue";
|
|
3
|
+
const h = E ? window : void 0;
|
|
4
|
+
function p(o) {
|
|
5
|
+
var i;
|
|
6
|
+
const u = c(o);
|
|
7
|
+
return (i = u?.$el) !== null && i !== void 0 ? i : u;
|
|
8
|
+
}
|
|
9
|
+
function W(...o) {
|
|
10
|
+
const i = (e, t, n, r) => (e.addEventListener(t, n, r), () => e.removeEventListener(t, n, r)), u = m(() => {
|
|
11
|
+
const e = a(c(o[0])).filter((t) => t != null);
|
|
12
|
+
return e.every((t) => typeof t != "string") ? e : void 0;
|
|
13
|
+
});
|
|
14
|
+
return M(() => {
|
|
15
|
+
var e, t;
|
|
16
|
+
return [
|
|
17
|
+
(e = (t = u.value) === null || t === void 0 ? void 0 : t.map((n) => p(n))) !== null && e !== void 0 ? e : [h].filter((n) => n != null),
|
|
18
|
+
a(c(u.value ? o[1] : o[0])),
|
|
19
|
+
a(L(u.value ? o[2] : o[1])),
|
|
20
|
+
c(u.value ? o[3] : o[2])
|
|
21
|
+
];
|
|
22
|
+
}, ([e, t, n, r], d, f) => {
|
|
23
|
+
if (!e?.length || !t?.length || !n?.length) return;
|
|
24
|
+
const v = $(r) ? { ...r } : r, s = e.flatMap((l) => t.flatMap((b) => n.map((y) => i(l, b, y, v))));
|
|
25
|
+
f(() => {
|
|
26
|
+
s.forEach((l) => l());
|
|
27
|
+
});
|
|
28
|
+
}, { flush: "post" });
|
|
29
|
+
}
|
|
30
|
+
// @__NO_SIDE_EFFECTS__
|
|
31
|
+
function P() {
|
|
32
|
+
const o = z(!1), i = A();
|
|
33
|
+
return i && C(() => {
|
|
34
|
+
o.value = !0;
|
|
35
|
+
}, i), o;
|
|
36
|
+
}
|
|
37
|
+
// @__NO_SIDE_EFFECTS__
|
|
38
|
+
function S(o) {
|
|
39
|
+
const i = /* @__PURE__ */ P();
|
|
40
|
+
return m(() => (i.value, !!o()));
|
|
41
|
+
}
|
|
42
|
+
function g(o, i, u = {}) {
|
|
43
|
+
const { window: e = h, ...t } = u;
|
|
44
|
+
let n;
|
|
45
|
+
const r = /* @__PURE__ */ S(() => e && "ResizeObserver" in e), d = () => {
|
|
46
|
+
n && (n.disconnect(), n = void 0);
|
|
47
|
+
}, f = R(m(() => {
|
|
48
|
+
const s = c(o);
|
|
49
|
+
return Array.isArray(s) ? s.map((l) => p(l)) : [p(s)];
|
|
50
|
+
}), (s) => {
|
|
51
|
+
if (d(), r.value && e) {
|
|
52
|
+
n = new ResizeObserver(i);
|
|
53
|
+
for (const l of s) l && n.observe(l, t);
|
|
54
|
+
}
|
|
55
|
+
}, {
|
|
56
|
+
immediate: !0,
|
|
57
|
+
flush: "post"
|
|
58
|
+
}), v = () => {
|
|
59
|
+
d(), f();
|
|
60
|
+
};
|
|
61
|
+
return O(v), {
|
|
62
|
+
isSupported: r,
|
|
63
|
+
stop: v
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
h as defaultWindow,
|
|
68
|
+
E as isClient,
|
|
69
|
+
$ as isObject,
|
|
70
|
+
a as toArray,
|
|
71
|
+
O as tryOnScopeDispose,
|
|
72
|
+
p as unrefElement,
|
|
73
|
+
W as useEventListener,
|
|
74
|
+
P as useMounted,
|
|
75
|
+
g as useResizeObserver,
|
|
76
|
+
S as useSupported,
|
|
77
|
+
M as watchImmediate
|
|
78
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { watch as n, getCurrentScope as r, onScopeDispose as i } from "vue";
|
|
2
|
+
function f(e, t) {
|
|
3
|
+
return r() ? (i(e, t), !0) : !1;
|
|
4
|
+
}
|
|
5
|
+
const s = typeof window < "u" && typeof document < "u";
|
|
6
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
7
|
+
const c = Object.prototype.toString, u = (e) => c.call(e) === "[object Object]";
|
|
8
|
+
function a(e) {
|
|
9
|
+
return Array.isArray(e) ? e : [e];
|
|
10
|
+
}
|
|
11
|
+
function d(e, t, o) {
|
|
12
|
+
return n(e, t, {
|
|
13
|
+
...o,
|
|
14
|
+
immediate: !0
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
s as isClient,
|
|
19
|
+
u as isObject,
|
|
20
|
+
a as toArray,
|
|
21
|
+
f as tryOnScopeDispose,
|
|
22
|
+
d as watchImmediate
|
|
23
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import t from "./_Symbol.js";
|
|
2
|
+
import e from "./_getRawTag.js";
|
|
3
|
+
import o from "./_objectToString.js";
|
|
4
|
+
var i = "[object Null]", f = "[object Undefined]", r = t ? t.toStringTag : void 0;
|
|
5
|
+
function m(n) {
|
|
6
|
+
return n == null ? n === void 0 ? f : i : r && r in Object(n) ? e(n) : o(n);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
m as default
|
|
10
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import e from "./_Symbol.js";
|
|
2
|
+
var o = Object.prototype, c = o.hasOwnProperty, f = o.toString, r = e ? e.toStringTag : void 0;
|
|
3
|
+
function p(t) {
|
|
4
|
+
var a = c.call(t, r), n = t[r];
|
|
5
|
+
try {
|
|
6
|
+
t[r] = void 0;
|
|
7
|
+
var i = !0;
|
|
8
|
+
} catch {
|
|
9
|
+
}
|
|
10
|
+
var g = f.call(t);
|
|
11
|
+
return i && (a ? t[r] = n : delete t[r]), g;
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
p as default
|
|
15
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import S from "./isObject.js";
|
|
2
|
+
import h from "./now.js";
|
|
3
|
+
import W from "./toNumber.js";
|
|
4
|
+
var y = "Expected a function", R = Math.max, A = Math.min;
|
|
5
|
+
function _(x, i, u) {
|
|
6
|
+
var a, d, c, f, n, r, l = 0, E = !1, m = !1, g = !0;
|
|
7
|
+
if (typeof x != "function")
|
|
8
|
+
throw new TypeError(y);
|
|
9
|
+
i = W(i) || 0, S(u) && (E = !!u.leading, m = "maxWait" in u, c = m ? R(W(u.maxWait) || 0, i) : c, g = "trailing" in u ? !!u.trailing : g);
|
|
10
|
+
function v(e) {
|
|
11
|
+
var t = a, o = d;
|
|
12
|
+
return a = d = void 0, l = e, f = x.apply(o, t), f;
|
|
13
|
+
}
|
|
14
|
+
function b(e) {
|
|
15
|
+
return l = e, n = setTimeout(s, i), E ? v(e) : f;
|
|
16
|
+
}
|
|
17
|
+
function C(e) {
|
|
18
|
+
var t = e - r, o = e - l, p = i - t;
|
|
19
|
+
return m ? A(p, c - o) : p;
|
|
20
|
+
}
|
|
21
|
+
function k(e) {
|
|
22
|
+
var t = e - r, o = e - l;
|
|
23
|
+
return r === void 0 || t >= i || t < 0 || m && o >= c;
|
|
24
|
+
}
|
|
25
|
+
function s() {
|
|
26
|
+
var e = h();
|
|
27
|
+
if (k(e))
|
|
28
|
+
return I(e);
|
|
29
|
+
n = setTimeout(s, C(e));
|
|
30
|
+
}
|
|
31
|
+
function I(e) {
|
|
32
|
+
return n = void 0, g && a ? v(e) : (a = d = void 0, f);
|
|
33
|
+
}
|
|
34
|
+
function L() {
|
|
35
|
+
n !== void 0 && clearTimeout(n), l = 0, a = r = d = n = void 0;
|
|
36
|
+
}
|
|
37
|
+
function M() {
|
|
38
|
+
return n === void 0 ? f : I(h());
|
|
39
|
+
}
|
|
40
|
+
function T() {
|
|
41
|
+
var e = h(), t = k(e);
|
|
42
|
+
if (a = arguments, d = this, r = e, t) {
|
|
43
|
+
if (n === void 0)
|
|
44
|
+
return b(r);
|
|
45
|
+
if (m)
|
|
46
|
+
return clearTimeout(n), n = setTimeout(s, i), v(r);
|
|
47
|
+
}
|
|
48
|
+
return n === void 0 && (n = setTimeout(s, i)), f;
|
|
49
|
+
}
|
|
50
|
+
return T.cancel = L, T.flush = M, T;
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
_ as default
|
|
54
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import n from "./_baseTrim.js";
|
|
2
|
+
import f from "./isObject.js";
|
|
3
|
+
import o from "./isSymbol.js";
|
|
4
|
+
var s = NaN, m = /^[-+]0x[0-9a-f]+$/i, p = /^0b[01]+$/i, e = /^0o[0-7]+$/i, b = parseInt;
|
|
5
|
+
function O(r) {
|
|
6
|
+
if (typeof r == "number")
|
|
7
|
+
return r;
|
|
8
|
+
if (o(r))
|
|
9
|
+
return s;
|
|
10
|
+
if (f(r)) {
|
|
11
|
+
var t = typeof r.valueOf == "function" ? r.valueOf() : r;
|
|
12
|
+
r = f(t) ? t + "" : t;
|
|
13
|
+
}
|
|
14
|
+
if (typeof r != "string")
|
|
15
|
+
return r === 0 ? r : +r;
|
|
16
|
+
r = n(r);
|
|
17
|
+
var i = p.test(r);
|
|
18
|
+
return i || e.test(r) ? b(r.slice(2), i ? 2 : 8) : m.test(r) ? s : +r;
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
O as default
|
|
22
|
+
};
|
package/dist/es/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fancy-plugins-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.34",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/es/index.js",
|
|
6
6
|
"module": "./dist/es/index.js",
|
|
@@ -45,16 +45,22 @@
|
|
|
45
45
|
"type": "module",
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@amap/amap-jsapi-loader": "^1.0.1",
|
|
48
|
+
"@element-plus/icons-vue": "^2.3.2",
|
|
48
49
|
"countup.js": "^2.9.0",
|
|
49
50
|
"cropperjs": "^2.1.0",
|
|
50
51
|
"ele-admin-plus": "^1.5.0",
|
|
51
52
|
"element-plus": "^2.13.0",
|
|
52
53
|
"jsbarcode": "^3.12.1",
|
|
53
54
|
"vuedraggable": "^4.1.0",
|
|
55
|
+
"vxe-pc-ui": "4.12.36",
|
|
56
|
+
"vxe-table": "4.17.48",
|
|
57
|
+
"xe-utils": "3.9.1",
|
|
54
58
|
"xgplayer": "^3.0.23"
|
|
55
59
|
},
|
|
56
60
|
"devDependencies": {
|
|
57
61
|
"@amap/amap-jsapi-loader": "^1.0.1",
|
|
62
|
+
"@element-plus/icons-vue": "^2.3.2",
|
|
63
|
+
"@types/lodash-es": "^4.17.12",
|
|
58
64
|
"countup.js": "^2.9.0",
|
|
59
65
|
"cropperjs": "^2.1.0",
|
|
60
66
|
"ele-admin-plus": "^1.5.0",
|
|
@@ -64,6 +70,13 @@
|
|
|
64
70
|
"sass": "^1.97.1",
|
|
65
71
|
"vite-plugin-static-copy": "^3.1.4",
|
|
66
72
|
"vuedraggable": "^4.1.0",
|
|
73
|
+
"vxe-pc-ui": "4.12.36",
|
|
74
|
+
"vxe-table": "4.17.48",
|
|
75
|
+
"xe-utils": "3.9.1",
|
|
67
76
|
"xgplayer": "^3.0.23"
|
|
77
|
+
},
|
|
78
|
+
"dependencies": {
|
|
79
|
+
"@vueuse/core": "^14.2.1",
|
|
80
|
+
"lodash-es": "^4.17.23"
|
|
68
81
|
}
|
|
69
82
|
}
|