fangguo-component 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +68 -36
- package/dist/ArgHover.css +1 -0
- package/dist/ArgHover.vue_vue_type_style_index_0_lang-CMhRP09M.js +54 -0
- package/dist/ButtonGroup-C0yZEkxK.js +103 -0
- package/dist/ButtonGroup.css +1 -0
- package/dist/CitySelect.vue_vue_type_script_setup_true_lang-8EbHD3Nt.js +159 -0
- package/dist/ContentTitle-mqrusLjx.js +24 -0
- package/dist/ContentTitle.css +1 -0
- package/dist/CustomInputV2-DYEcbu5_.js +135 -0
- package/dist/CustomInputV2.css +1 -0
- package/dist/CustomMultipleInput-DDaqoHVU.js +109 -0
- package/dist/CustomMultipleInput.css +1 -0
- package/dist/DragResizable.css +1 -0
- package/dist/DragResizable.vue_vue_type_style_index_0_lang-DYL6TUPE.js +167 -0
- package/dist/DragSort-CfDeFAIG.js +66 -0
- package/dist/DragSort.css +1 -0
- package/dist/ErrorImage-CTP_5sal.js +32 -0
- package/dist/ErrorImage.css +1 -0
- package/dist/FgCascader.css +1 -0
- package/dist/FgCascader.vue_vue_type_style_index_0_lang-OnqaEAao.js +1807 -0
- package/dist/HSelect-Bqz2yTMf.js +468 -0
- package/dist/HSelect.css +1 -0
- package/dist/HSelectAll.vue_vue_type_script_setup_true_lang-C8i6LF_k.js +36 -0
- package/dist/HSelectSJ-BieRp2gG.js +462 -0
- package/dist/HSelectSJ.css +1 -0
- package/dist/IdentifyAddress.vue_vue_type_script_setup_true_lang-BJheMI1q.js +4743 -0
- package/dist/ImageLoupe.vue_vue_type_script_setup_true_lang-BlX4VbRi.js +79 -0
- package/dist/LazyComponent.vue_vue_type_script_setup_true_lang-vNk68D8E.js +82 -0
- package/dist/LazyPopover.vue_vue_type_script_setup_true_lang-DcOrcH0T.js +33 -0
- package/dist/LoadingBtn-BhbhNboo.js +66 -0
- package/dist/LoadingBtn.css +1 -0
- package/dist/{MInput-CO6YUVuZ.js → MInput-CpoW17Wh.js} +6 -6
- package/dist/MInput.css +1 -1
- package/dist/MyTable-DmwyEVJb.js +68 -0
- package/dist/MyTable.css +1 -0
- package/dist/NoRender.vue_vue_type_script_setup_true_lang-Do36nSsV.js +30 -0
- package/dist/SelectAddress-B4oK5erq.js +173 -0
- package/dist/SelectAddress.css +1 -0
- package/dist/SelectAll.vue_vue_type_script_setup_true_lang-BC3q2U8f.js +79 -0
- package/dist/SelectAll2.vue_vue_type_script_setup_true_lang-CaET5eli.js +74 -0
- package/dist/SelectCustomAll.css +1 -0
- package/dist/SelectCustomAll.vue_vue_type_style_index_0_lang-_wCRO217.js +83 -0
- package/dist/SelectTimePicker.vue_vue_type_script_setup_true_lang-Bj0KMOKv.js +45 -0
- package/dist/SelectTree-C7lBZnZH.js +306 -0
- package/dist/SelectTree.css +1 -0
- package/dist/SortTransfer.css +1 -0
- package/dist/SortTransfer.vue_vue_type_style_index_0_lang-C5OmBF3s.js +153 -0
- package/dist/SvgIcon-C2ah8E0Z.js +30 -0
- package/dist/TextCopy.vue_vue_type_script_setup_true_lang-DbhZGH_z.js +29 -0
- package/dist/TextEllipsisTooltip.vue_vue_type_script_setup_true_lang-aZbEQmbM.js +112 -0
- package/dist/TipInput-CIskitOV.js +117 -0
- package/dist/TipInput.css +1 -0
- package/dist/VirtualTable-BYTfwDC1.js +353 -0
- package/dist/VirtualTable.css +1 -0
- package/dist/_commonjsHelpers-ByYUsBRP.js +33 -0
- package/dist/common-BIEgCXbl.js +7030 -0
- package/dist/components/VirtualTable/VirtualTable.vue.d.ts +127 -0
- package/dist/components/VirtualTable/index.d.ts +1 -0
- package/dist/components/VirtualTable/index.js +4 -0
- package/dist/components/argHover/ArgHover.vue.d.ts +51 -0
- package/dist/components/argHover/index.d.ts +1 -0
- package/dist/components/argHover/index.js +4 -0
- package/dist/components/buttonGroup/ButtonGroup.vue.d.ts +17 -0
- package/dist/components/buttonGroup/index.d.ts +1 -0
- package/dist/components/buttonGroup/index.js +4 -0
- package/dist/components/cascader/cascader/{cascader.vue.d.ts → ElCascader.vue.d.ts} +43 -43
- package/dist/components/cascader/cascader/FgCascader.vue.d.ts +4192 -0
- package/dist/components/cascader/cascader/index.d.ts +1 -3
- package/dist/components/cascader/cascader-panel/index.vue.d.ts +8 -8
- package/dist/components/cascader/cascader-panel/menu.vue.d.ts +3 -3
- package/dist/components/cascader/cascader-panel/node.vue.d.ts +2 -2
- package/dist/components/cascader/index.d.ts +1 -3
- package/dist/components/cascader/index.js +1 -1
- package/dist/components/cascader/utils/vue/props/util.d.ts +0 -1
- package/dist/components/cascader/utils/vue/size.d.ts +1 -1
- package/dist/components/citySelect/CitySelect.vue.d.ts +21 -0
- package/dist/components/citySelect/index.d.ts +1 -0
- package/dist/components/citySelect/index.js +4 -0
- package/dist/components/contentTitle/ContentTitle.vue.d.ts +20 -0
- package/dist/components/contentTitle/index.d.ts +1 -0
- package/dist/components/contentTitle/index.js +4 -0
- package/dist/components/customInputV2/CustomInputV2.vue.d.ts +47 -0
- package/dist/components/customInputV2/index.d.ts +1 -0
- package/dist/components/customInputV2/index.js +4 -0
- package/dist/components/customMultipleInput/CustomMultipleInput.vue.d.ts +46 -0
- package/dist/components/customMultipleInput/index.d.ts +1 -0
- package/dist/components/customMultipleInput/index.js +4 -0
- package/dist/components/dragResizable/DragResizable.vue.d.ts +57 -0
- package/dist/components/dragResizable/index.d.ts +1 -0
- package/dist/components/dragResizable/index.js +4 -0
- package/dist/components/dragSort/DragSort.vue.d.ts +34 -0
- package/dist/components/dragSort/index.d.ts +1 -0
- package/dist/components/dragSort/index.js +4 -0
- package/dist/components/errorImage/ErrorImage.vue.d.ts +23 -0
- package/dist/components/errorImage/index.d.ts +1 -0
- package/dist/components/errorImage/index.js +4 -0
- package/dist/components/hSelect/HSelect.vue.d.ts +103 -0
- package/dist/components/hSelect/index.d.ts +1 -0
- package/dist/components/hSelect/index.js +4 -0
- package/dist/components/hSelectAll/HSelectAll.vue.d.ts +10 -0
- package/dist/components/hSelectAll/index.d.ts +1 -0
- package/dist/components/hSelectAll/index.js +4 -0
- package/dist/components/hSelectSJ/HSelectSJ.vue.d.ts +105 -0
- package/dist/components/hSelectSJ/index.d.ts +1 -0
- package/dist/components/hSelectSJ/index.js +4 -0
- package/dist/components/identifyAddress/IdentifyAddress.vue.d.ts +10 -0
- package/dist/components/identifyAddress/index.d.ts +1 -0
- package/dist/components/identifyAddress/index.js +4 -0
- package/dist/components/imageLoupe/ImageLoupe.vue.d.ts +35 -0
- package/dist/components/imageLoupe/index.d.ts +1 -0
- package/dist/components/imageLoupe/index.js +4 -0
- package/dist/components/index.d.ts +31 -0
- package/dist/components/index.js +66 -4
- package/dist/components/lazyComponent/LazyComponent.vue.d.ts +37 -0
- package/dist/components/lazyComponent/index.d.ts +1 -0
- package/dist/components/lazyComponent/index.js +4 -0
- package/dist/components/lazyPopover/LazyPopover.vue.d.ts +31 -0
- package/dist/components/lazyPopover/index.d.ts +1 -0
- package/dist/components/lazyPopover/index.js +4 -0
- package/dist/components/loadingBtn/LoadingBtn.vue.d.ts +34 -0
- package/dist/components/loadingBtn/index.d.ts +1 -0
- package/dist/components/loadingBtn/index.js +4 -0
- package/dist/components/mInput/index.js +1 -1
- package/dist/components/myTable/MyTable.vue.d.ts +46 -0
- package/dist/components/myTable/index.d.ts +1 -0
- package/dist/components/myTable/index.js +4 -0
- package/dist/components/noRender/NoRender.vue.d.ts +23 -0
- package/dist/components/noRender/index.d.ts +1 -0
- package/dist/components/noRender/index.js +4 -0
- package/dist/components/selectAddress/SelectAddress.vue.d.ts +106 -0
- package/dist/components/selectAddress/index.d.ts +1 -0
- package/dist/components/selectAddress/index.js +4 -0
- package/dist/components/selectAll/SelectAll.vue.d.ts +124 -0
- package/dist/components/selectAll/index.d.ts +1 -0
- package/dist/components/selectAll/index.js +4 -0
- package/dist/components/selectAll2/SelectAll2.vue.d.ts +81 -0
- package/dist/components/selectAll2/index.d.ts +1 -0
- package/dist/components/selectAll2/index.js +4 -0
- package/dist/components/selectCustomAll/SelectCustomAll.vue.d.ts +77 -0
- package/dist/components/selectCustomAll/index.d.ts +1 -0
- package/dist/components/selectCustomAll/index.js +4 -0
- package/dist/components/selectTimePicker/SelectTimePicker.vue.d.ts +24 -0
- package/dist/components/selectTimePicker/index.d.ts +1 -0
- package/dist/components/selectTimePicker/index.js +4 -0
- package/dist/components/selectTree/SelectTree.vue.d.ts +39 -0
- package/dist/components/selectTree/index.d.ts +1 -0
- package/dist/components/selectTree/index.js +4 -0
- package/dist/components/sortTransfer/SortTransfer.vue.d.ts +97 -0
- package/dist/components/sortTransfer/index.d.ts +1 -0
- package/dist/components/sortTransfer/index.js +4 -0
- package/dist/components/svgIcon/index.d.ts +1 -0
- package/dist/components/svgIcon/index.js +4 -0
- package/dist/components/textCopy/TextCopy.vue.d.ts +21 -0
- package/dist/components/textCopy/index.d.ts +1 -0
- package/dist/components/textCopy/index.js +4 -0
- package/dist/components/textEllipsisTooltip/TextEllipsisTooltip.vue.d.ts +19 -0
- package/dist/components/textEllipsisTooltip/index.d.ts +1 -0
- package/dist/components/textEllipsisTooltip/index.js +4 -0
- package/dist/components/tipInput/TipInput.vue.d.ts +56 -0
- package/dist/components/tipInput/index.d.ts +1 -0
- package/dist/components/tipInput/index.js +4 -0
- package/dist/dateShortcuts-DDPtAhDI.js +26 -0
- package/dist/debounce-BLrZUqsA.js +84 -0
- package/dist/index-BKzmtfeu.js +72 -0
- package/dist/index-DIX8TpoT.js +118 -0
- package/dist/index-epuVZjZV.js +103 -0
- package/dist/index-uf7oyYDF.js +16847 -0
- package/dist/index.d.ts +161 -5
- package/dist/index.js +197 -46
- package/dist/isEqual-qYQTJBU6.js +506 -0
- package/dist/isObject-CO569sPG.js +35 -0
- package/dist/shims.d.ts +53 -13
- package/dist/tools/ImageParserUtils/common.d.ts +117 -0
- package/dist/tools/ImageParserUtils/etagBrowser.d.ts +4 -0
- package/dist/tools/ImageParserUtils/index.d.ts +7 -0
- package/dist/tools/ImageParserUtils/index.js +13116 -0
- package/dist/tools/ImageParserUtils/parseImage.d.ts +18 -0
- package/dist/tools/ImageParserUtils/parsePSD.d.ts +22 -0
- package/dist/tools/ImageParserUtils/parseTIFF.d.ts +18 -0
- package/dist/tools/common/common.d.ts +335 -23
- package/dist/tools/common/dateShortcuts.d.ts +5 -0
- package/dist/tools/common/index.d.ts +1 -0
- package/dist/tools/common/index.js +86 -5085
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.js +97 -8
- package/package.json +92 -81
- package/dist/cascader.css +0 -1
- package/dist/cascader.vue_vue_type_script_setup_true_lang-HFhhhQva.js +0 -2268
- package/dist/index-DihzpZcR.js +0 -14
- package/dist/index-wUcQXc_Z.js +0 -10
- package/dist/tools/Grid/Grid.d.ts +0 -48
- package/dist/tools/Grid/index.d.ts +0 -1
- package/dist/tools/Grid/index.js +0 -217
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
import './HSelect.css';var ve = Object.defineProperty, de = Object.defineProperties;
|
|
2
|
+
var fe = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var te = Object.getOwnPropertySymbols;
|
|
4
|
+
var pe = Object.prototype.hasOwnProperty, me = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var ue = (o, d, v) => d in o ? ve(o, d, { enumerable: !0, configurable: !0, writable: !0, value: v }) : o[d] = v, N = (o, d) => {
|
|
6
|
+
for (var v in d || (d = {}))
|
|
7
|
+
pe.call(d, v) && ue(o, v, d[v]);
|
|
8
|
+
if (te)
|
|
9
|
+
for (var v of te(d))
|
|
10
|
+
me.call(d, v) && ue(o, v, d[v]);
|
|
11
|
+
return o;
|
|
12
|
+
}, X = (o, d) => de(o, fe(d));
|
|
13
|
+
var P = (o, d, v) => new Promise((t, p) => {
|
|
14
|
+
var B = (m) => {
|
|
15
|
+
try {
|
|
16
|
+
a(v.next(m));
|
|
17
|
+
} catch (c) {
|
|
18
|
+
p(c);
|
|
19
|
+
}
|
|
20
|
+
}, U = (m) => {
|
|
21
|
+
try {
|
|
22
|
+
a(v.throw(m));
|
|
23
|
+
} catch (c) {
|
|
24
|
+
p(c);
|
|
25
|
+
}
|
|
26
|
+
}, a = (m) => m.done ? t(m.value) : Promise.resolve(m.value).then(B, U);
|
|
27
|
+
a((v = v.apply(o, d)).next());
|
|
28
|
+
});
|
|
29
|
+
import { defineComponent as he, useModel as ye, ref as S, watch as J, computed as q, nextTick as V, onUnmounted as we, onMounted as ge, resolveComponent as Y, openBlock as y, createBlock as R, withCtx as f, createVNode as O, unref as z, createElementBlock as b, createCommentVNode as C, toDisplayString as I, withModifiers as E, renderSlot as Z, createElementVNode as H, normalizeClass as j, normalizeStyle as ke, Fragment as oe, renderList as xe, createTextVNode as ne, withDirectives as Se, vModelText as be, mergeModels as re } from "vue";
|
|
30
|
+
import { q as Oe } from "./common-BIEgCXbl.js";
|
|
31
|
+
import { Check as Ce, ArrowDown as Le, CircleClose as Ne } from "@element-plus/icons-vue";
|
|
32
|
+
import { _ as He } from "./LazyPopover.vue_vue_type_script_setup_true_lang-DcOrcH0T.js";
|
|
33
|
+
import { DynamicScroller as $e, DynamicScrollerItem as De } from "vue-virtual-scroller";
|
|
34
|
+
import { i as ze } from "./isEqual-qYQTJBU6.js";
|
|
35
|
+
import { _ as Ie } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
36
|
+
const Ke = {
|
|
37
|
+
key: 0,
|
|
38
|
+
class: "select-more-normal-value"
|
|
39
|
+
}, Te = { class: "max-w-[64px] overflow-hidden text-ellipsis" }, Ve = { class: "max-h-[280px] overflow-y-auto" }, je = {
|
|
40
|
+
key: 1,
|
|
41
|
+
class: "select-more-normal-placeholder cursor-default"
|
|
42
|
+
}, Be = ["placeholder"], Pe = {
|
|
43
|
+
key: 2,
|
|
44
|
+
class: "select-more-normal-placeholder cursor-default"
|
|
45
|
+
}, Ee = {
|
|
46
|
+
key: 0,
|
|
47
|
+
class: "text-center leading-[30px] text-[#999] text-[12px]"
|
|
48
|
+
}, Me = {
|
|
49
|
+
key: 0,
|
|
50
|
+
class: "text-[12px] text-center leading-[30px] text-[#999] h-[200px] flex items-center justify-center"
|
|
51
|
+
}, Ae = /* @__PURE__ */ he({
|
|
52
|
+
__name: "HSelect",
|
|
53
|
+
props: /* @__PURE__ */ re({
|
|
54
|
+
api: {},
|
|
55
|
+
placeholder: { default: "请选择" },
|
|
56
|
+
multiple: { type: Boolean, default: !1 },
|
|
57
|
+
optionsKey: {},
|
|
58
|
+
props: {},
|
|
59
|
+
width: { default: 200 },
|
|
60
|
+
popwidth: { default: 200 },
|
|
61
|
+
sparamsKey: { default: {} },
|
|
62
|
+
otherParams: { default: {} },
|
|
63
|
+
stylecss: { default: "" },
|
|
64
|
+
formate: {},
|
|
65
|
+
filterable: { type: Boolean, default: !0 },
|
|
66
|
+
useInput: { type: Boolean, default: !1 },
|
|
67
|
+
lazy: { type: Boolean, default: !1 },
|
|
68
|
+
unuseremote: { type: Boolean, default: !1 },
|
|
69
|
+
options: { default: () => [] },
|
|
70
|
+
defText: {},
|
|
71
|
+
changeOrgData: {}
|
|
72
|
+
}, {
|
|
73
|
+
modelValue: {},
|
|
74
|
+
modelModifiers: {}
|
|
75
|
+
}),
|
|
76
|
+
emits: /* @__PURE__ */ re(["change", "clear"], ["update:modelValue"]),
|
|
77
|
+
setup(o, { expose: d, emit: v }) {
|
|
78
|
+
const t = ye(o, "modelValue"), p = v, B = /* @__PURE__ */ Symbol("HSelect"), U = {
|
|
79
|
+
pageNo: "pageNo",
|
|
80
|
+
pageSize: "pageSize",
|
|
81
|
+
total: "total",
|
|
82
|
+
text: "text"
|
|
83
|
+
}, a = o, m = S(N(N({}, U), a.sparamsKey)), c = S(!1), i = S(""), $ = S(), u = S([]), s = S([]), M = S({
|
|
84
|
+
[m.value.pageNo]: 1,
|
|
85
|
+
[m.value.pageSize]: 20
|
|
86
|
+
}), _ = S(0), ie = S(), G = Oe(() => {
|
|
87
|
+
a.filterable && x(!0, i.value);
|
|
88
|
+
});
|
|
89
|
+
J(
|
|
90
|
+
() => a.otherParams,
|
|
91
|
+
(l, e) => {
|
|
92
|
+
ze(l, e) || x(!0, i.value);
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
let ee = null;
|
|
96
|
+
const k = S("loaded"), x = (l = !1, e = "") => P(null, null, function* () {
|
|
97
|
+
if (a.unuseremote) {
|
|
98
|
+
s.value = a.options.filter(
|
|
99
|
+
(r) => {
|
|
100
|
+
var D;
|
|
101
|
+
return (r[T.value] || "").toLocaleLowerCase().includes(i.value.toLocaleLowerCase()) || ((D = r.searchKey || "") == null ? void 0 : D.toLocaleLowerCase().includes(i.value.toLocaleLowerCase()));
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
if (l && (M.value[m.value.pageNo] = 1, k.value = "loaded"), e && (i.value = e), k.value !== "loaded")
|
|
107
|
+
return;
|
|
108
|
+
k.value = "loading";
|
|
109
|
+
const n = a.filterable ? N(X(N({}, M.value), { [m.value.text]: i.value }), a.otherParams) : N(N({}, M.value), a.otherParams);
|
|
110
|
+
ee = JSON.stringify(n);
|
|
111
|
+
try {
|
|
112
|
+
let r = yield a.api(n);
|
|
113
|
+
if (ee !== JSON.stringify(n))
|
|
114
|
+
return;
|
|
115
|
+
if (a.changeOrgData && (r = a.changeOrgData(r)), s.value = l ? r.data.list : s.value.concat(r.data.list), _.value = r.data[m.value.total], M.value[m.value.pageNo]++, c.value || A(), _.value <= s.value.length ? k.value = "isloadall" : k.value = "loaded", e) {
|
|
116
|
+
const D = s.value.find((w) => w[T.value] === i.value);
|
|
117
|
+
return D || x(l), D;
|
|
118
|
+
}
|
|
119
|
+
} catch (r) {
|
|
120
|
+
k.value = "isloadall", s.value = [];
|
|
121
|
+
}
|
|
122
|
+
}), se = (l) => {
|
|
123
|
+
if (!a.unuseremote)
|
|
124
|
+
try {
|
|
125
|
+
let e = null;
|
|
126
|
+
const n = l.target.children;
|
|
127
|
+
for (let r = 0; r < n.length; r++)
|
|
128
|
+
n[r].className === "vue-recycle-scroller__item-wrapper" && (e = n[r]);
|
|
129
|
+
if (!e)
|
|
130
|
+
return;
|
|
131
|
+
e.offsetHeight - l.target.scrollTop < 300 && k.value === "loaded" && x();
|
|
132
|
+
} catch (e) {
|
|
133
|
+
}
|
|
134
|
+
}, L = q(() => !t.value || a.multiple ? "" : u.value && !Array.isArray(u.value) ? a.formate ? a.formate(u.value) : u.value[T.value] : a.defText || t.value || a.placeholder);
|
|
135
|
+
J(c, () => P(null, null, function* () {
|
|
136
|
+
var l, e;
|
|
137
|
+
if (c.value)
|
|
138
|
+
a.useInput && L.value !== a.placeholder && (i.value = L.value), yield V(), (l = $.value) == null || l.focus(), a.lazy && x(!0);
|
|
139
|
+
else {
|
|
140
|
+
if (yield V(), a.useInput && i.value)
|
|
141
|
+
if (a.multiple)
|
|
142
|
+
t.value.includes(i.value) || (t.value.push(i.value), p("change", t.value, u.value));
|
|
143
|
+
else {
|
|
144
|
+
if (t.value === i.value)
|
|
145
|
+
return;
|
|
146
|
+
t.value = i.value;
|
|
147
|
+
const n = s.value.find((r) => r[h.value] === i.value);
|
|
148
|
+
n ? u.value = n : u.value = null, yield V(), p("change", t.value, u.value);
|
|
149
|
+
}
|
|
150
|
+
(e = $.value) == null || e.blur(), i.value = "", !a.lazy && x(!0);
|
|
151
|
+
}
|
|
152
|
+
})), J(t, (l, e) => {
|
|
153
|
+
try {
|
|
154
|
+
const n = typeof l == "string" ? String(l) : JSON.stringify(l), r = typeof e == "string" ? String(e) : JSON.stringify(e);
|
|
155
|
+
if (n === r)
|
|
156
|
+
return;
|
|
157
|
+
A();
|
|
158
|
+
} catch (n) {
|
|
159
|
+
console.log(n);
|
|
160
|
+
}
|
|
161
|
+
}), J(
|
|
162
|
+
() => a.options,
|
|
163
|
+
() => {
|
|
164
|
+
a.unuseremote && (s.value = a.options, A());
|
|
165
|
+
}
|
|
166
|
+
);
|
|
167
|
+
const A = () => {
|
|
168
|
+
if (a.unuseremote) {
|
|
169
|
+
if (a.multiple) {
|
|
170
|
+
if (t.value && t.value.length) {
|
|
171
|
+
const l = [];
|
|
172
|
+
try {
|
|
173
|
+
t.value.forEach((e) => {
|
|
174
|
+
const n = s.value.find((r) => r[h.value] === e);
|
|
175
|
+
n ? l.push(n) : console.warn(`HSelect未找到初始化值${e}`);
|
|
176
|
+
});
|
|
177
|
+
} catch (e) {
|
|
178
|
+
console.log(e);
|
|
179
|
+
}
|
|
180
|
+
u.value = l;
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
u.value = [];
|
|
184
|
+
} else {
|
|
185
|
+
if (i.value = "", t.value) {
|
|
186
|
+
try {
|
|
187
|
+
const l = s.value.find((e) => e[h.value] === t.value);
|
|
188
|
+
l ? u.value = l : console.warn(`HSelect未找到初始化值${t.value}`);
|
|
189
|
+
} catch (l) {
|
|
190
|
+
console.warn(l);
|
|
191
|
+
}
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
u.value = null;
|
|
195
|
+
}
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
if (a.multiple) {
|
|
199
|
+
if (t.value && t.value.length) {
|
|
200
|
+
const l = [];
|
|
201
|
+
try {
|
|
202
|
+
t.value.forEach((e) => {
|
|
203
|
+
const n = s.value.find((r) => r[h.value] === e);
|
|
204
|
+
n && l.push(n);
|
|
205
|
+
});
|
|
206
|
+
} catch (e) {
|
|
207
|
+
console.log(e);
|
|
208
|
+
}
|
|
209
|
+
u.value = l;
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
u.value = [], i.value = "";
|
|
213
|
+
} else {
|
|
214
|
+
if (i.value = "", t.value || t.value === 0) {
|
|
215
|
+
const l = s.value.find((e) => e[h.value] === t.value);
|
|
216
|
+
u.value = l || null;
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
u.value = null;
|
|
220
|
+
}
|
|
221
|
+
}, K = q(() => {
|
|
222
|
+
try {
|
|
223
|
+
return typeof u.value == "object" ? u.value.length ? u.value.map((l) => a.formate ? a.formate(l) : l[T.value]) : t.value : u.value ? a.formate ? a.formate(u.value) : u.value[T.value] : t.value || a.placeholder;
|
|
224
|
+
} catch (l) {
|
|
225
|
+
return a.multiple ? [] : "";
|
|
226
|
+
}
|
|
227
|
+
}), Q = (l) => {
|
|
228
|
+
var e;
|
|
229
|
+
try {
|
|
230
|
+
return a.multiple ? (e = t.value) == null ? void 0 : e.includes(l[h.value]) : t.value === l[h.value];
|
|
231
|
+
} catch (n) {
|
|
232
|
+
return !1;
|
|
233
|
+
}
|
|
234
|
+
}, le = (l, e) => {
|
|
235
|
+
if (t.value.splice(l, 1), a.useInput)
|
|
236
|
+
try {
|
|
237
|
+
const n = u.value.findIndex((r) => r[h.value] === e);
|
|
238
|
+
n !== -1 && u.value.splice(n, 1);
|
|
239
|
+
} catch (n) {
|
|
240
|
+
console.log(n);
|
|
241
|
+
}
|
|
242
|
+
else
|
|
243
|
+
u.value.splice(l, 1);
|
|
244
|
+
p("change", t.value, u.value);
|
|
245
|
+
}, h = q(() => a.props && a.props.value ? a.props.value : "id"), T = q(() => a.props && a.props.label ? a.props.label : "label"), ae = () => P(null, null, function* () {
|
|
246
|
+
var l, e;
|
|
247
|
+
if (!a.multiple) {
|
|
248
|
+
t.value = "", u.value = null, i.value = "", x(!0), c.value && ((l = $.value) == null || l.focus()), yield V(), p("clear"), p("change", t.value);
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
t.value = [], u.value = [], i.value = "", x(!0), yield V(), p("clear"), p("change", t.value), (e = $.value) == null || e.focus();
|
|
252
|
+
}), ce = (l) => P(null, null, function* () {
|
|
253
|
+
var n;
|
|
254
|
+
if (!a.multiple) {
|
|
255
|
+
t.value = l[h.value], u.value = l, yield V(), c.value = !1, p("change", t.value, u.value);
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
t.value || (t.value = []);
|
|
259
|
+
const e = t.value.findIndex((r) => r === l[h.value]);
|
|
260
|
+
e === -1 ? (t.value.push(l[h.value]), u.value.push(l), p("change", t.value, u.value)) : (t.value.splice(e, 1), u.value.splice(e, 1), p("change", t.value, u.value)), (n = $.value) == null || n.focus();
|
|
261
|
+
});
|
|
262
|
+
return d({
|
|
263
|
+
modelValue: t,
|
|
264
|
+
checkAllNodes: () => {
|
|
265
|
+
var l;
|
|
266
|
+
u.value = s.value, t.value = u.value.map((e) => e[h.value]), p("change", t.value, u.value), (l = $.value) == null || l.focus();
|
|
267
|
+
},
|
|
268
|
+
clearCheaked: ae,
|
|
269
|
+
filterHandle: G,
|
|
270
|
+
loadeMore: x,
|
|
271
|
+
checkNode: u,
|
|
272
|
+
data: s,
|
|
273
|
+
filterText: i,
|
|
274
|
+
isFocused: c
|
|
275
|
+
}), we(() => {
|
|
276
|
+
delete window.clickOutSideList[B], Object.getOwnPropertySymbols(window.clickOutSideList).length || (delete window.clickOutSideList, window.removeEventListener("click", window.clickOutSideHandle));
|
|
277
|
+
}), ge(() => {
|
|
278
|
+
!a.lazy && x(!0), a.unuseremote && (s.value = a.options), A(), window.clickOutSideList ? window.clickOutSideList[B] = c : (window.clickOutSideList = {
|
|
279
|
+
[B]: c
|
|
280
|
+
}, window.clickOutSideHandle = function() {
|
|
281
|
+
Object.getOwnPropertySymbols(window.clickOutSideList).forEach((e) => {
|
|
282
|
+
window.clickOutSideList[e].value = !1;
|
|
283
|
+
});
|
|
284
|
+
}, window.addEventListener("click", window.clickOutSideHandle));
|
|
285
|
+
}), (l, e) => {
|
|
286
|
+
const n = Y("el-tag"), r = Y("el-icon"), D = Y("el-popover");
|
|
287
|
+
return y(), R(D, {
|
|
288
|
+
visible: c.value,
|
|
289
|
+
placement: "bottom-start",
|
|
290
|
+
width: `${o.popwidth || o.width}px`
|
|
291
|
+
}, {
|
|
292
|
+
reference: f(() => {
|
|
293
|
+
var w, F;
|
|
294
|
+
return [
|
|
295
|
+
H("div", {
|
|
296
|
+
class: j(["select-more", o.stylecss]),
|
|
297
|
+
style: ke({ width: typeof o.width == "number" ? o.width + "px" : o.width }),
|
|
298
|
+
onClick: e[5] || (e[5] = E((g) => c.value = !c.value, ["stop"]))
|
|
299
|
+
}, [
|
|
300
|
+
H("div", {
|
|
301
|
+
class: j(["select-more-wrapper", { "is-focused": c.value }])
|
|
302
|
+
}, [
|
|
303
|
+
o.multiple && ((w = K.value) != null && w.length) ? (y(), b("div", Ke, [
|
|
304
|
+
O(n, {
|
|
305
|
+
class: "mr-[5px]",
|
|
306
|
+
type: "info",
|
|
307
|
+
closable: "",
|
|
308
|
+
onClose: e[0] || (e[0] = (g) => le(0, K.value[0]))
|
|
309
|
+
}, {
|
|
310
|
+
default: f(() => [
|
|
311
|
+
H("div", Te, I(K.value[0]), 1)
|
|
312
|
+
]),
|
|
313
|
+
_: 1
|
|
314
|
+
}),
|
|
315
|
+
K.value.length > 1 ? (y(), R(He, {
|
|
316
|
+
key: 0,
|
|
317
|
+
width: `${o.popwidth}px`
|
|
318
|
+
}, {
|
|
319
|
+
reference: f(() => [
|
|
320
|
+
O(n, { type: "info" }, {
|
|
321
|
+
default: f(() => [
|
|
322
|
+
ne("+ " + I(K.value.length - 1), 1)
|
|
323
|
+
]),
|
|
324
|
+
_: 1
|
|
325
|
+
})
|
|
326
|
+
]),
|
|
327
|
+
default: f(() => [
|
|
328
|
+
H("div", Ve, [
|
|
329
|
+
(y(!0), b(oe, null, xe(K.value, (g, W) => (y(), b(oe, {
|
|
330
|
+
key: g[h.value]
|
|
331
|
+
}, [
|
|
332
|
+
W !== 0 ? (y(), R(n, {
|
|
333
|
+
key: 0,
|
|
334
|
+
class: "mr-[5px] mt-[5px]",
|
|
335
|
+
closable: "",
|
|
336
|
+
onClose: (Je) => le(W, g)
|
|
337
|
+
}, {
|
|
338
|
+
default: f(() => [
|
|
339
|
+
ne(I(g), 1)
|
|
340
|
+
]),
|
|
341
|
+
_: 2
|
|
342
|
+
}, 1032, ["onClose"])) : C("", !0)
|
|
343
|
+
], 64))), 128))
|
|
344
|
+
])
|
|
345
|
+
]),
|
|
346
|
+
_: 1
|
|
347
|
+
}, 8, ["width"])) : C("", !0)
|
|
348
|
+
])) : C("", !0),
|
|
349
|
+
o.filterable ? (y(), b("div", je, [
|
|
350
|
+
c.value ? Se((y(), b("input", {
|
|
351
|
+
key: 0,
|
|
352
|
+
ref_key: "input",
|
|
353
|
+
ref: $,
|
|
354
|
+
"onUpdate:modelValue": e[1] || (e[1] = (g) => i.value = g),
|
|
355
|
+
class: "w-full h-[90%]",
|
|
356
|
+
type: "text",
|
|
357
|
+
placeholder: o.placeholder,
|
|
358
|
+
onKeydown: e[2] || (e[2] = E(() => {
|
|
359
|
+
}, ["stop"])),
|
|
360
|
+
onClick: e[3] || (e[3] = E(() => {
|
|
361
|
+
}, ["stop"])),
|
|
362
|
+
onInput: e[4] || (e[4] = //@ts-ignore
|
|
363
|
+
(...g) => z(G) && z(G)(...g))
|
|
364
|
+
}, null, 40, Be)), [
|
|
365
|
+
[be, i.value]
|
|
366
|
+
]) : (y(), b("div", {
|
|
367
|
+
key: 1,
|
|
368
|
+
class: j(["text-nowrap", { "text-[#999]": !L.value || L.value === o.placeholder }])
|
|
369
|
+
}, I(L.value || o.placeholder), 3))
|
|
370
|
+
])) : C("", !0),
|
|
371
|
+
!o.filterable && !o.multiple ? (y(), b("div", Pe, [
|
|
372
|
+
H("div", {
|
|
373
|
+
class: j(["text-nowrap", { "text-[#999]": !L.value || L.value === o.placeholder }])
|
|
374
|
+
}, I(L.value || o.placeholder), 3)
|
|
375
|
+
])) : C("", !0),
|
|
376
|
+
H("div", {
|
|
377
|
+
class: j(["select-more-arrow", { "is-focused": c.value }])
|
|
378
|
+
}, [
|
|
379
|
+
O(r, null, {
|
|
380
|
+
default: f(() => [
|
|
381
|
+
O(z(Le))
|
|
382
|
+
]),
|
|
383
|
+
_: 1
|
|
384
|
+
})
|
|
385
|
+
], 2),
|
|
386
|
+
o.multiple && ((F = t.value) != null && F.length) || !o.multiple && t.value ? (y(), b("div", {
|
|
387
|
+
key: 3,
|
|
388
|
+
class: "select-more-clear",
|
|
389
|
+
onClick: E(ae, ["stop"])
|
|
390
|
+
}, [
|
|
391
|
+
O(r, null, {
|
|
392
|
+
default: f(() => [
|
|
393
|
+
O(z(Ne))
|
|
394
|
+
]),
|
|
395
|
+
_: 1
|
|
396
|
+
})
|
|
397
|
+
])) : C("", !0)
|
|
398
|
+
], 2)
|
|
399
|
+
], 6)
|
|
400
|
+
];
|
|
401
|
+
}),
|
|
402
|
+
default: f(() => [
|
|
403
|
+
O(z($e), {
|
|
404
|
+
ref_key: "DynamicScrollerRef",
|
|
405
|
+
ref: ie,
|
|
406
|
+
class: "content-list",
|
|
407
|
+
style: { height: "200px" },
|
|
408
|
+
keyField: o.optionsKey || h.value,
|
|
409
|
+
"min-item-size": 40,
|
|
410
|
+
items: s.value,
|
|
411
|
+
onScroll: se
|
|
412
|
+
}, {
|
|
413
|
+
before: f(() => [
|
|
414
|
+
Z(l.$slots, "header", {
|
|
415
|
+
options: s.value,
|
|
416
|
+
value: t.value,
|
|
417
|
+
nodes: u.value
|
|
418
|
+
}, void 0, !0)
|
|
419
|
+
]),
|
|
420
|
+
default: f(({ item: w, index: F, active: g }) => [
|
|
421
|
+
O(z(De), {
|
|
422
|
+
item: w,
|
|
423
|
+
active: g,
|
|
424
|
+
"data-index": F,
|
|
425
|
+
onClick: E((W) => ce(w), ["stop"])
|
|
426
|
+
}, {
|
|
427
|
+
default: f(() => [
|
|
428
|
+
Z(l.$slots, "default", {
|
|
429
|
+
item: X(N({}, w), { active: Q(w) })
|
|
430
|
+
}, () => [
|
|
431
|
+
H("div", {
|
|
432
|
+
class: j(["item", { active: Q(w) }])
|
|
433
|
+
}, [
|
|
434
|
+
H("div", null, I(o.formate ? o.formate(w) : w[T.value]), 1),
|
|
435
|
+
Q(w) ? (y(), R(r, { key: 0 }, {
|
|
436
|
+
default: f(() => [
|
|
437
|
+
O(z(Ce))
|
|
438
|
+
]),
|
|
439
|
+
_: 1
|
|
440
|
+
})) : C("", !0)
|
|
441
|
+
], 2)
|
|
442
|
+
], !0)
|
|
443
|
+
]),
|
|
444
|
+
_: 2
|
|
445
|
+
}, 1032, ["item", "active", "data-index", "onClick"])
|
|
446
|
+
]),
|
|
447
|
+
after: f(() => [
|
|
448
|
+
k.value !== "isloadall" && !a.unuseremote ? (y(), b("div", Ee, I(k.value === "loading" ? "加载中" : "等待加载"), 1)) : C("", !0)
|
|
449
|
+
]),
|
|
450
|
+
empty: f(() => [
|
|
451
|
+
(k.value === "isloadall" || o.unuseremote) && !s.value.length ? (y(), b("div", Me, " 暂无可用数据 ")) : C("", !0)
|
|
452
|
+
]),
|
|
453
|
+
_: 3
|
|
454
|
+
}, 8, ["keyField", "items"]),
|
|
455
|
+
Z(l.$slots, "footer", {
|
|
456
|
+
options: s.value,
|
|
457
|
+
value: t.value,
|
|
458
|
+
nodes: u.value
|
|
459
|
+
}, void 0, !0)
|
|
460
|
+
]),
|
|
461
|
+
_: 3
|
|
462
|
+
}, 8, ["visible", "width"]);
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
}), Ze = /* @__PURE__ */ Ie(Ae, [["__scopeId", "data-v-374d3fe2"]]);
|
|
466
|
+
export {
|
|
467
|
+
Ze as H
|
|
468
|
+
};
|
package/dist/HSelect.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.select-more[data-v-374d3fe2]{width:100%}.select-more .select-more-wrapper[data-v-374d3fe2]{position:relative;display:flex;align-items:center;padding:0 4px;width:100%;min-height:30px;border:1px solid #dcdfe6;border-radius:4px}.select-more .select-more-wrapper.is-focused[data-v-374d3fe2]{border-color:#4485f5}.select-more .select-more-wrapper .select-more-normal-placeholder[data-v-374d3fe2]{overflow:hidden;margin-right:22px;margin-left:4px;line-height:30px;flex:1}.select-more .select-more-wrapper .select-more-normal-placeholder input[data-v-374d3fe2]:focus-visible{outline:none}.select-more .select-more-wrapper .select-more-normal-placeholder div[data-v-374d3fe2]{line-height:30px}.select-more .select-more-wrapper .select-more-normal-value[data-v-374d3fe2]{display:flex}.select-more .select-more-wrapper .select-more-arrow[data-v-374d3fe2]{position:absolute;top:8px;right:10px;z-index:1;color:#a8abb2;transition:all .3s;transform:rotateX(0)}.select-more .select-more-wrapper .select-more-arrow.is-focused[data-v-374d3fe2]{transform:rotate(-180deg)}.select-more .select-more-wrapper:hover .select-more-clear[data-v-374d3fe2]{display:block}.select-more .select-more-wrapper .select-more-clear[data-v-374d3fe2]{position:absolute;top:8px;right:10px;z-index:2;display:none;color:#a8abb2;background:#fff;transition:all .3s;cursor:pointer;transform:rotateX(0)}.content-list[data-v-374d3fe2]{margin:-12px}.content-list .item[data-v-374d3fe2]{display:flex;justify-content:space-between;align-items:center;padding:8px 12px;cursor:pointer}.content-list .item.active[data-v-374d3fe2]{color:#4485f5}.content-list .item[data-v-374d3fe2]:hover{background-color:#f5f7fa}[data-v-374d3fe2] .vue-recycle-scroller__slot{position:sticky;top:0;z-index:10}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { defineComponent as u, useSlots as p, ref as o, openBlock as h, createBlock as v, createSlots as _, withCtx as s, createElementVNode as c, renderSlot as a, toDisplayString as k, renderList as m, unref as S, normalizeProps as H, guardReactiveProps as x } from "vue";
|
|
2
|
+
import { H as A } from "./HSelect-Bqz2yTMf.js";
|
|
3
|
+
const C = { class: "px-[10px] py-[10px] bg-[#fff] border-b cursor-pointer" }, N = /* @__PURE__ */ u({
|
|
4
|
+
__name: "HSelectAll",
|
|
5
|
+
setup(b) {
|
|
6
|
+
const n = Object.keys(p()), r = o(), e = o(!1), d = () => {
|
|
7
|
+
e.value = !e.value, e.value ? r.value.checkAllNodes() : r.value.clearCheaked();
|
|
8
|
+
}, f = () => {
|
|
9
|
+
e.value = !1;
|
|
10
|
+
};
|
|
11
|
+
return (t, g) => (h(), v(A, {
|
|
12
|
+
ref_key: "HSelectRef",
|
|
13
|
+
ref: r,
|
|
14
|
+
onClear: f
|
|
15
|
+
}, _({
|
|
16
|
+
header: s(() => [
|
|
17
|
+
c("div", { onClick: d }, [
|
|
18
|
+
a(t.$slots, "header", { checkAll: e.value }, () => [
|
|
19
|
+
c("div", C, k(e.value ? "全部取消" : "全选当前"), 1)
|
|
20
|
+
])
|
|
21
|
+
])
|
|
22
|
+
]),
|
|
23
|
+
_: 2
|
|
24
|
+
}, [
|
|
25
|
+
m(S(n).filter((l) => !["header"].includes(l)), (l, y) => ({
|
|
26
|
+
name: l,
|
|
27
|
+
fn: s((i) => [
|
|
28
|
+
a(t.$slots, l, H(x(i)))
|
|
29
|
+
])
|
|
30
|
+
}))
|
|
31
|
+
]), 1536));
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
export {
|
|
35
|
+
N as _
|
|
36
|
+
};
|