fangguo-component 1.1.2 → 1.1.4

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.
Files changed (150) hide show
  1. package/dist/ArgHover.css +20 -1
  2. package/dist/ArgHover.vue_vue_type_style_index_0_lang-CSymSDRl.js +56 -0
  3. package/dist/ButtonGroup-DqViorHX.js +134 -0
  4. package/dist/ButtonGroup.css +35 -1
  5. package/dist/CitySelect.vue_vue_type_script_setup_true_lang-DZp6834K.js +224 -0
  6. package/dist/ContentTitle-By0Zk1u7.js +30 -0
  7. package/dist/ContentTitle.css +6 -1
  8. package/dist/CustomInputV2-BqhBSO53.js +157 -0
  9. package/dist/CustomInputV2.css +5 -1
  10. package/dist/CustomMultipleInput-DRMTUtkE.js +125 -0
  11. package/dist/CustomMultipleInput.css +8 -1
  12. package/dist/DragResizable.css +126 -1
  13. package/dist/DragResizable.vue_vue_type_style_index_0_lang-BePpQHve.js +331 -0
  14. package/dist/DragSort-5WetnkmW.js +98 -0
  15. package/dist/DragSort.css +5 -1
  16. package/dist/ErrorImage-Ao9kEEUg.js +36 -0
  17. package/dist/ErrorImage.css +4 -1
  18. package/dist/FgCascader.css +37 -1
  19. package/dist/FgCascader.vue_vue_type_style_index_0_lang-CM8FxFLJ.js +2424 -0
  20. package/dist/HSelect-BFkWiCFi.js +671 -0
  21. package/dist/HSelect.css +80 -1
  22. package/dist/HSelectAll.vue_vue_type_script_setup_true_lang-BZX7ch2I.js +50 -0
  23. package/dist/HSelectSJ-DZmtdyjF.js +671 -0
  24. package/dist/HSelectSJ.css +88 -1
  25. package/dist/IdentifyAddress.vue_vue_type_script_setup_true_lang-BCIOF-Oy.js +5202 -0
  26. package/dist/ImageLoupe.vue_vue_type_script_setup_true_lang-BaXHYlDu.js +92 -0
  27. package/dist/LazyComponent.vue_vue_type_script_setup_true_lang-D5KGqlj4.js +107 -0
  28. package/dist/LazyPopover.vue_vue_type_script_setup_true_lang-B2vtU4f4.js +34 -0
  29. package/dist/LoadingBtn-DWm2cY9k.js +87 -0
  30. package/dist/LoadingBtn.css +12 -1
  31. package/dist/MInput-s_P63myh.js +114 -0
  32. package/dist/MInput.css +21 -1
  33. package/dist/MyTable-CHvxPYgk.js +94 -0
  34. package/dist/MyTable.css +33 -1
  35. package/dist/NoRender.vue_vue_type_script_setup_true_lang-B0G6jxPg.js +31 -0
  36. package/dist/SelectAddress-CCepDxu8.js +254 -0
  37. package/dist/SelectAddress.css +18 -1
  38. package/dist/SelectAll.vue_vue_type_script_setup_true_lang-CyzY8ams.js +101 -0
  39. package/dist/SelectAll2.vue_vue_type_script_setup_true_lang-CrsaohxU.js +103 -0
  40. package/dist/SelectCustomAll.css +8 -1
  41. package/dist/SelectCustomAll.vue_vue_type_style_index_0_lang-BEZwlGXa.js +111 -0
  42. package/dist/SelectTimePicker.vue_vue_type_script_setup_true_lang-Dk4TpTBN.js +48 -0
  43. package/dist/SelectTree-DHbWogEU.js +1276 -0
  44. package/dist/SelectTree.css +74 -1
  45. package/dist/SvgIcon-DIg0upEk.js +33 -0
  46. package/dist/TextCopy-th0FAxwl.js +44 -0
  47. package/dist/TextCopy.css +7 -1
  48. package/dist/TextEllipsisTooltip.vue_vue_type_script_setup_true_lang-DVE1CxPm.js +174 -0
  49. package/dist/VirtualTable-Cm_L7q9W.js +703 -0
  50. package/dist/VirtualTable.css +185 -1
  51. package/dist/_commonjsHelpers-DnzVkjQg.js +38 -0
  52. package/dist/_plugin-vue_export-helper-1tPrXgE0.js +10 -0
  53. package/dist/common-B1nSpTGn.js +9669 -0
  54. package/dist/components/VirtualTable/index.js +2 -2
  55. package/dist/components/argHover/index.js +2 -2
  56. package/dist/components/buttonGroup/index.js +2 -2
  57. package/dist/components/cascader/index.js +2 -2
  58. package/dist/components/citySelect/index.js +2 -2
  59. package/dist/components/contentTitle/index.js +2 -2
  60. package/dist/components/customInputV2/index.js +2 -2
  61. package/dist/components/customMultipleInput/index.js +2 -2
  62. package/dist/components/dragResizable/index.js +2 -2
  63. package/dist/components/dragSort/index.js +2 -2
  64. package/dist/components/errorImage/index.js +2 -2
  65. package/dist/components/hSelect/index.js +2 -2
  66. package/dist/components/hSelectAll/index.js +2 -2
  67. package/dist/components/hSelectSJ/index.js +2 -2
  68. package/dist/components/identifyAddress/index.js +2 -2
  69. package/dist/components/imageLoupe/index.js +2 -2
  70. package/dist/components/index.js +62 -62
  71. package/dist/components/lazyComponent/index.js +2 -2
  72. package/dist/components/lazyPopover/index.js +2 -2
  73. package/dist/components/loadingBtn/index.js +2 -2
  74. package/dist/components/mInput/index.js +2 -2
  75. package/dist/components/myTable/index.js +2 -2
  76. package/dist/components/noRender/index.js +2 -2
  77. package/dist/components/selectAddress/index.js +2 -2
  78. package/dist/components/selectAll/index.js +2 -2
  79. package/dist/components/selectAll2/index.js +2 -2
  80. package/dist/components/selectCustomAll/index.js +2 -2
  81. package/dist/components/selectTimePicker/index.js +2 -2
  82. package/dist/components/selectTree/index.js +2 -2
  83. package/dist/components/svgIcon/index.js +2 -2
  84. package/dist/components/textCopy/index.js +2 -2
  85. package/dist/components/textEllipsisTooltip/index.js +2 -2
  86. package/dist/dateShortcuts-DjFC_Txu.js +27 -0
  87. package/dist/directive/index.js +2 -2
  88. package/dist/directive/loading/index.js +2 -2
  89. package/dist/hooks/index.js +2 -2
  90. package/dist/hooks/usePagination/index.js +2 -2
  91. package/dist/index-BPnixsfc.js +103 -0
  92. package/dist/index-C9zyi90j.js +165 -0
  93. package/dist/index-CSMWzzp0.js +8 -0
  94. package/dist/index-DfQiknXJ.js +8 -0
  95. package/dist/index-DzdLpetc.js +29184 -0
  96. package/dist/index-uQXqC9BF.js +68 -0
  97. package/dist/index.css +1 -1
  98. package/dist/index.js +204 -194
  99. package/dist/loading-CGrVcnNl.js +47 -0
  100. package/dist/loading.css +110 -1
  101. package/dist/tools/ImageParserUtils/index.js +17239 -9074
  102. package/dist/tools/common/index.js +86 -86
  103. package/dist/tools/index.js +95 -95
  104. package/dist/usePagination-C63IRXjZ.js +29 -0
  105. package/dist/vue-virtual-scroller.esm-ZgBoGAjX.js +1507 -0
  106. package/package.json +1 -1
  107. package/dist/ArgHover.vue_vue_type_style_index_0_lang-CMhRP09M.js +0 -54
  108. package/dist/ButtonGroup-C0yZEkxK.js +0 -103
  109. package/dist/CitySelect.vue_vue_type_script_setup_true_lang-8EbHD3Nt.js +0 -159
  110. package/dist/ContentTitle-mqrusLjx.js +0 -24
  111. package/dist/CustomInputV2-uARhbFc8.js +0 -135
  112. package/dist/CustomMultipleInput-DDaqoHVU.js +0 -109
  113. package/dist/DragResizable.vue_vue_type_style_index_0_lang-CHv0gJmo.js +0 -179
  114. package/dist/DragSort-CfDeFAIG.js +0 -66
  115. package/dist/ErrorImage-CTP_5sal.js +0 -32
  116. package/dist/FgCascader.vue_vue_type_style_index_0_lang-BUZDDcVn.js +0 -1656
  117. package/dist/HSelect-Drf6YBwO.js +0 -468
  118. package/dist/HSelectAll.vue_vue_type_script_setup_true_lang-Blq9xpfa.js +0 -36
  119. package/dist/HSelectSJ-D3GrXmvj.js +0 -462
  120. package/dist/IdentifyAddress.vue_vue_type_script_setup_true_lang-BJheMI1q.js +0 -4743
  121. package/dist/ImageLoupe.vue_vue_type_script_setup_true_lang-BlX4VbRi.js +0 -79
  122. package/dist/LazyComponent.vue_vue_type_script_setup_true_lang-vNk68D8E.js +0 -82
  123. package/dist/LazyPopover.vue_vue_type_script_setup_true_lang-DcOrcH0T.js +0 -33
  124. package/dist/LoadingBtn-BhbhNboo.js +0 -66
  125. package/dist/MInput-CpoW17Wh.js +0 -101
  126. package/dist/MyTable-DmwyEVJb.js +0 -68
  127. package/dist/NoRender.vue_vue_type_script_setup_true_lang-Do36nSsV.js +0 -30
  128. package/dist/SelectAddress-B4oK5erq.js +0 -173
  129. package/dist/SelectAll.vue_vue_type_script_setup_true_lang-BC3q2U8f.js +0 -79
  130. package/dist/SelectAll2.vue_vue_type_script_setup_true_lang-CaET5eli.js +0 -74
  131. package/dist/SelectCustomAll.vue_vue_type_style_index_0_lang-_wCRO217.js +0 -83
  132. package/dist/SelectTimePicker.vue_vue_type_script_setup_true_lang-Bj0KMOKv.js +0 -45
  133. package/dist/SelectTree-Dm5259kY.js +0 -911
  134. package/dist/SvgIcon-C2ah8E0Z.js +0 -30
  135. package/dist/TextCopy-hOj-Wj2H.js +0 -41
  136. package/dist/TextEllipsisTooltip.vue_vue_type_script_setup_true_lang-aZbEQmbM.js +0 -112
  137. package/dist/VirtualTable-BWugJiQ5.js +0 -349
  138. package/dist/_commonjsHelpers-ByYUsBRP.js +0 -33
  139. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  140. package/dist/common-BIEgCXbl.js +0 -7030
  141. package/dist/dateShortcuts-DDPtAhDI.js +0 -26
  142. package/dist/index-BRcBDlVs.js +0 -68
  143. package/dist/index-CeWudY6u.js +0 -8
  144. package/dist/index-DIX8TpoT.js +0 -118
  145. package/dist/index-DpPsTMp0.js +0 -8
  146. package/dist/index-epuVZjZV.js +0 -103
  147. package/dist/index-uf7oyYDF.js +0 -16847
  148. package/dist/loading-DJVNc0eN.js +0 -36
  149. package/dist/usePagination-CwShBEjA.js +0 -20
  150. package/dist/vue-virtual-scroller.esm-CH-jx4ri.js +0 -1051
@@ -0,0 +1,671 @@
1
+ import './HSelect.css';var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __async = (__this, __arguments, generator) => {
21
+ return new Promise((resolve, reject) => {
22
+ var fulfilled = (value) => {
23
+ try {
24
+ step(generator.next(value));
25
+ } catch (e) {
26
+ reject(e);
27
+ }
28
+ };
29
+ var rejected = (value) => {
30
+ try {
31
+ step(generator.throw(value));
32
+ } catch (e) {
33
+ reject(e);
34
+ }
35
+ };
36
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
37
+ step((generator = generator.apply(__this, __arguments)).next());
38
+ });
39
+ };
40
+ import { ElPopover, ElIcon, ElTag } from "element-plus/es";
41
+ import { defineComponent, useModel, ref, watch, computed, nextTick, onUnmounted, onMounted, openBlock, createBlock, withCtx, createVNode, unref, createElementBlock, createCommentVNode, toDisplayString, withModifiers, renderSlot, createElementVNode, normalizeClass, normalizeStyle, Fragment, renderList, createTextVNode, withDirectives, vModelText, mergeModels } from "vue";
42
+ import { q as debounce } from "./common-B1nSpTGn.js";
43
+ import { Check, ArrowDown, CircleClose } from "@element-plus/icons-vue";
44
+ import { _ as _sfc_main$1 } from "./LazyPopover.vue_vue_type_script_setup_true_lang-B2vtU4f4.js";
45
+ import { s as script$1, a as script } from "./vue-virtual-scroller.esm-ZgBoGAjX.js";
46
+ import { isEqual } from "lodash-unified";
47
+ import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.js";
48
+ const _hoisted_1 = {
49
+ key: 0,
50
+ class: "select-more-normal-value"
51
+ };
52
+ const _hoisted_2 = { class: "max-w-[64px] overflow-hidden text-ellipsis" };
53
+ const _hoisted_3 = { class: "max-h-[280px] overflow-y-auto" };
54
+ const _hoisted_4 = {
55
+ key: 1,
56
+ class: "select-more-normal-placeholder cursor-default"
57
+ };
58
+ const _hoisted_5 = ["placeholder"];
59
+ const _hoisted_6 = {
60
+ key: 2,
61
+ class: "select-more-normal-placeholder cursor-default"
62
+ };
63
+ const _hoisted_7 = {
64
+ key: 0,
65
+ class: "text-center leading-[30px] text-[#999] text-[12px]"
66
+ };
67
+ const _hoisted_8 = {
68
+ key: 0,
69
+ class: "text-[12px] text-center leading-[30px] text-[#999] h-[200px] flex items-center justify-center"
70
+ };
71
+ const _sfc_main = /* @__PURE__ */ defineComponent({
72
+ __name: "HSelect",
73
+ props: /* @__PURE__ */ mergeModels({
74
+ api: {},
75
+ placeholder: { default: "请选择" },
76
+ multiple: { type: Boolean, default: false },
77
+ optionsKey: {},
78
+ props: {},
79
+ width: { default: 200 },
80
+ popwidth: { default: 200 },
81
+ sparamsKey: { default: {} },
82
+ otherParams: { default: {} },
83
+ stylecss: { default: "" },
84
+ formate: {},
85
+ filterable: { type: Boolean, default: true },
86
+ useInput: { type: Boolean, default: false },
87
+ lazy: { type: Boolean, default: false },
88
+ unuseremote: { type: Boolean, default: false },
89
+ options: { default: () => [] },
90
+ defText: {},
91
+ changeOrgData: {}
92
+ }, {
93
+ "modelValue": {},
94
+ "modelModifiers": {}
95
+ }),
96
+ emits: /* @__PURE__ */ mergeModels(["change", "clear"], ["update:modelValue"]),
97
+ setup(__props, { expose: __expose, emit: __emit }) {
98
+ const modelValue = useModel(__props, "modelValue");
99
+ const emit = __emit;
100
+ const key = /* @__PURE__ */ Symbol("HSelect");
101
+ const defParamsKey = {
102
+ pageNo: "pageNo",
103
+ pageSize: "pageSize",
104
+ total: "total",
105
+ text: "text"
106
+ };
107
+ const prop = __props;
108
+ const paramsKey = ref(__spreadValues(__spreadValues({}, defParamsKey), prop.sparamsKey));
109
+ const isFocused = ref(false);
110
+ const filterText = ref("");
111
+ const input = ref();
112
+ const checkNode = ref([]);
113
+ const data = ref([]);
114
+ const pageParams = ref({
115
+ [paramsKey.value.pageNo]: 1,
116
+ [paramsKey.value.pageSize]: 20
117
+ });
118
+ const dataTotal = ref(0);
119
+ const DynamicScrollerRef = ref();
120
+ const filterHandle = debounce(() => {
121
+ if (!prop.filterable) {
122
+ return;
123
+ }
124
+ loadeMore(true, filterText.value);
125
+ });
126
+ watch(
127
+ () => prop.otherParams,
128
+ (n, o) => {
129
+ if (isEqual(n, o)) {
130
+ return;
131
+ }
132
+ loadeMore(true, filterText.value);
133
+ }
134
+ );
135
+ let curOptions = null;
136
+ const loadStatus = ref("loaded");
137
+ const loadeMore = (reload = false, filter = "") => __async(null, null, function* () {
138
+ if (prop.unuseremote) {
139
+ data.value = prop.options.filter(
140
+ (item) => {
141
+ var _a;
142
+ return (item[labelKey.value] || "").toLocaleLowerCase().includes(filterText.value.toLocaleLowerCase()) || ((_a = item.searchKey || "") == null ? void 0 : _a.toLocaleLowerCase().includes(filterText.value.toLocaleLowerCase()));
143
+ }
144
+ );
145
+ return;
146
+ }
147
+ if (reload) {
148
+ pageParams.value[paramsKey.value.pageNo] = 1;
149
+ loadStatus.value = "loaded";
150
+ }
151
+ if (filter) {
152
+ filterText.value = filter;
153
+ }
154
+ if (loadStatus.value !== "loaded") {
155
+ return;
156
+ }
157
+ loadStatus.value = "loading";
158
+ const arg = prop.filterable ? __spreadValues(__spreadProps(__spreadValues({}, pageParams.value), { [paramsKey.value.text]: filterText.value }), prop.otherParams) : __spreadValues(__spreadValues({}, pageParams.value), prop.otherParams);
159
+ curOptions = JSON.stringify(arg);
160
+ try {
161
+ let res = yield prop.api(arg);
162
+ if (curOptions !== JSON.stringify(arg)) {
163
+ return;
164
+ }
165
+ if (prop.changeOrgData) {
166
+ res = prop.changeOrgData(res);
167
+ }
168
+ data.value = reload ? res.data.list : data.value.concat(res.data.list);
169
+ dataTotal.value = res.data[paramsKey.value.total];
170
+ pageParams.value[paramsKey.value.pageNo]++;
171
+ if (!isFocused.value) {
172
+ initData();
173
+ }
174
+ if (dataTotal.value <= data.value.length) {
175
+ loadStatus.value = "isloadall";
176
+ } else {
177
+ loadStatus.value = "loaded";
178
+ }
179
+ if (filter) {
180
+ const item = data.value.find((item2) => item2[labelKey.value] === filterText.value);
181
+ if (!item) {
182
+ loadeMore(reload);
183
+ }
184
+ return item;
185
+ }
186
+ } catch (error) {
187
+ loadStatus.value = "isloadall";
188
+ data.value = [];
189
+ }
190
+ });
191
+ const scrollHandle = (scrollEvent) => {
192
+ if (prop.unuseremote) {
193
+ return;
194
+ }
195
+ try {
196
+ let main = null;
197
+ const children = scrollEvent.target.children;
198
+ for (let i = 0; i < children.length; i++) {
199
+ if (children[i].className === "vue-recycle-scroller__item-wrapper") {
200
+ main = children[i];
201
+ }
202
+ }
203
+ if (!main) {
204
+ return;
205
+ }
206
+ if (main.offsetHeight - scrollEvent.target.scrollTop < 300 && loadStatus.value === "loaded") {
207
+ loadeMore();
208
+ }
209
+ } catch (e) {
210
+ }
211
+ };
212
+ const valueText = computed(() => {
213
+ return !modelValue.value || prop.multiple ? "" : checkNode.value && !Array.isArray(checkNode.value) ? prop.formate ? prop.formate(checkNode.value) : checkNode.value[labelKey.value] : prop.defText || modelValue.value || prop.placeholder;
214
+ });
215
+ watch(isFocused, () => __async(null, null, function* () {
216
+ var _a, _b;
217
+ if (isFocused.value) {
218
+ if (prop.useInput && valueText.value !== prop.placeholder) {
219
+ filterText.value = valueText.value;
220
+ }
221
+ yield nextTick();
222
+ (_a = input.value) == null ? void 0 : _a.focus();
223
+ prop.lazy && loadeMore(true);
224
+ } else {
225
+ yield nextTick();
226
+ if (prop.useInput && filterText.value) {
227
+ if (!prop.multiple) {
228
+ if (modelValue.value === filterText.value) {
229
+ return;
230
+ }
231
+ modelValue.value = filterText.value;
232
+ const _checkNode = data.value.find((item) => item[valueKey.value] === filterText.value);
233
+ if (_checkNode) {
234
+ checkNode.value = _checkNode;
235
+ } else {
236
+ checkNode.value = null;
237
+ }
238
+ yield nextTick();
239
+ emit("change", modelValue.value, checkNode.value);
240
+ } else {
241
+ if (!modelValue.value.includes(filterText.value)) {
242
+ modelValue.value.push(filterText.value);
243
+ emit("change", modelValue.value, checkNode.value);
244
+ }
245
+ }
246
+ }
247
+ (_b = input.value) == null ? void 0 : _b.blur();
248
+ filterText.value = "";
249
+ !prop.lazy && loadeMore(true);
250
+ }
251
+ }));
252
+ watch(modelValue, (newdata, olddata) => {
253
+ try {
254
+ const _newdata = typeof newdata === "string" ? String(newdata) : JSON.stringify(newdata);
255
+ const _olddata = typeof olddata === "string" ? String(olddata) : JSON.stringify(olddata);
256
+ if (_newdata === _olddata) {
257
+ return;
258
+ }
259
+ initData();
260
+ } catch (err) {
261
+ console.log(err);
262
+ }
263
+ });
264
+ watch(
265
+ () => prop.options,
266
+ () => {
267
+ if (!prop.unuseremote) {
268
+ return;
269
+ }
270
+ data.value = prop.options;
271
+ initData();
272
+ }
273
+ );
274
+ const initData = () => {
275
+ if (prop.unuseremote) {
276
+ if (prop.multiple) {
277
+ if (modelValue.value && modelValue.value.length) {
278
+ const _checkNode = [];
279
+ try {
280
+ modelValue.value.forEach((element) => {
281
+ const item = data.value.find((item2) => item2[valueKey.value] === element);
282
+ if (item) {
283
+ _checkNode.push(item);
284
+ } else {
285
+ console.warn(`HSelect未找到初始化值${element}`);
286
+ }
287
+ });
288
+ } catch (error) {
289
+ console.log(error);
290
+ }
291
+ checkNode.value = _checkNode;
292
+ return;
293
+ }
294
+ checkNode.value = [];
295
+ } else {
296
+ filterText.value = "";
297
+ if (modelValue.value) {
298
+ try {
299
+ const item = data.value.find((item2) => item2[valueKey.value] === modelValue.value);
300
+ if (item) {
301
+ checkNode.value = item;
302
+ } else {
303
+ console.warn(`HSelect未找到初始化值${modelValue.value}`);
304
+ }
305
+ } catch (error) {
306
+ console.warn(error);
307
+ }
308
+ return;
309
+ }
310
+ checkNode.value = null;
311
+ }
312
+ return;
313
+ }
314
+ if (prop.multiple) {
315
+ if (modelValue.value && modelValue.value.length) {
316
+ const _checkNode = [];
317
+ try {
318
+ modelValue.value.forEach((element) => {
319
+ const item = data.value.find((item2) => item2[valueKey.value] === element);
320
+ if (item) {
321
+ _checkNode.push(item);
322
+ }
323
+ });
324
+ } catch (error) {
325
+ console.log(error);
326
+ }
327
+ checkNode.value = _checkNode;
328
+ return;
329
+ }
330
+ checkNode.value = [];
331
+ filterText.value = "";
332
+ } else {
333
+ filterText.value = "";
334
+ if (modelValue.value || modelValue.value === 0) {
335
+ const item = data.value.find((item2) => item2[valueKey.value] === modelValue.value);
336
+ checkNode.value = item || null;
337
+ return;
338
+ }
339
+ checkNode.value = null;
340
+ }
341
+ };
342
+ const labelList = computed(() => {
343
+ try {
344
+ if (typeof checkNode.value === "object") {
345
+ return checkNode.value.length ? checkNode.value.map((item) => prop.formate ? prop.formate(item) : item[labelKey.value]) : modelValue.value;
346
+ }
347
+ return checkNode.value ? prop.formate ? prop.formate(checkNode.value) : checkNode.value[labelKey.value] : modelValue.value || prop.placeholder;
348
+ } catch (error) {
349
+ return prop.multiple ? [] : "";
350
+ }
351
+ });
352
+ const isCheck = (item) => {
353
+ var _a;
354
+ try {
355
+ if (prop.multiple) {
356
+ return (_a = modelValue.value) == null ? void 0 : _a.includes(item[valueKey.value]);
357
+ }
358
+ return modelValue.value === item[valueKey.value];
359
+ } catch (error) {
360
+ return false;
361
+ }
362
+ };
363
+ const closeHandle = (index, val) => {
364
+ modelValue.value.splice(index, 1);
365
+ if (prop.useInput) {
366
+ try {
367
+ const iIndex = checkNode.value.findIndex((node) => node[valueKey.value] === val);
368
+ iIndex !== -1 && checkNode.value.splice(iIndex, 1);
369
+ } catch (error) {
370
+ console.log(error);
371
+ }
372
+ } else {
373
+ checkNode.value.splice(index, 1);
374
+ }
375
+ emit("change", modelValue.value, checkNode.value);
376
+ };
377
+ const valueKey = computed(() => {
378
+ if (prop.props && prop.props.value) {
379
+ return prop.props.value;
380
+ }
381
+ return "id";
382
+ });
383
+ const labelKey = computed(() => {
384
+ if (prop.props && prop.props.label) {
385
+ return prop.props.label;
386
+ }
387
+ return "label";
388
+ });
389
+ const clearCheaked = () => __async(null, null, function* () {
390
+ var _a, _b;
391
+ if (!prop.multiple) {
392
+ modelValue.value = "";
393
+ checkNode.value = null;
394
+ filterText.value = "";
395
+ loadeMore(true);
396
+ if (isFocused.value) {
397
+ (_a = input.value) == null ? void 0 : _a.focus();
398
+ }
399
+ yield nextTick();
400
+ emit("clear");
401
+ emit("change", modelValue.value);
402
+ return;
403
+ }
404
+ modelValue.value = [];
405
+ checkNode.value = [];
406
+ filterText.value = "";
407
+ loadeMore(true);
408
+ yield nextTick();
409
+ emit("clear");
410
+ emit("change", modelValue.value);
411
+ (_b = input.value) == null ? void 0 : _b.focus();
412
+ });
413
+ const clickHandle = (item) => __async(null, null, function* () {
414
+ var _a;
415
+ if (!prop.multiple) {
416
+ modelValue.value = item[valueKey.value];
417
+ checkNode.value = item;
418
+ yield nextTick();
419
+ isFocused.value = false;
420
+ emit("change", modelValue.value, checkNode.value);
421
+ return;
422
+ }
423
+ if (!modelValue.value) modelValue.value = [];
424
+ const index = modelValue.value.findIndex((e) => e === item[valueKey.value]);
425
+ if (index === -1) {
426
+ modelValue.value.push(item[valueKey.value]);
427
+ checkNode.value.push(item);
428
+ emit("change", modelValue.value, checkNode.value);
429
+ } else {
430
+ modelValue.value.splice(index, 1);
431
+ checkNode.value.splice(index, 1);
432
+ emit("change", modelValue.value, checkNode.value);
433
+ }
434
+ (_a = input.value) == null ? void 0 : _a.focus();
435
+ });
436
+ const checkAllNodes = () => {
437
+ var _a;
438
+ checkNode.value = data.value;
439
+ modelValue.value = checkNode.value.map((item) => item[valueKey.value]);
440
+ emit("change", modelValue.value, checkNode.value);
441
+ (_a = input.value) == null ? void 0 : _a.focus();
442
+ };
443
+ __expose({
444
+ modelValue,
445
+ checkAllNodes,
446
+ clearCheaked,
447
+ filterHandle,
448
+ loadeMore,
449
+ checkNode,
450
+ data,
451
+ filterText,
452
+ isFocused
453
+ });
454
+ onUnmounted(() => {
455
+ delete window.clickOutSideList[key];
456
+ const objectSymbols = Object.getOwnPropertySymbols(window.clickOutSideList);
457
+ if (!objectSymbols.length) {
458
+ delete window.clickOutSideList;
459
+ window.removeEventListener("click", window.clickOutSideHandle);
460
+ }
461
+ });
462
+ onMounted(() => {
463
+ !prop.lazy && loadeMore(true);
464
+ if (prop.unuseremote) {
465
+ data.value = prop.options;
466
+ }
467
+ initData();
468
+ if (!window.clickOutSideList) {
469
+ window.clickOutSideList = {
470
+ [key]: isFocused
471
+ };
472
+ window.clickOutSideHandle = function() {
473
+ const objectSymbols = Object.getOwnPropertySymbols(window.clickOutSideList);
474
+ objectSymbols.forEach((i) => {
475
+ window.clickOutSideList[i].value = false;
476
+ });
477
+ };
478
+ window.addEventListener("click", window.clickOutSideHandle);
479
+ } else {
480
+ window.clickOutSideList[key] = isFocused;
481
+ }
482
+ });
483
+ return (_ctx, _cache) => {
484
+ const _component_el_tag = ElTag;
485
+ const _component_el_icon = ElIcon;
486
+ const _component_el_popover = ElPopover;
487
+ return openBlock(), createBlock(_component_el_popover, {
488
+ visible: isFocused.value,
489
+ placement: "bottom-start",
490
+ width: `${__props.popwidth || __props.width}px`
491
+ }, {
492
+ reference: withCtx(() => {
493
+ var _a, _b;
494
+ return [
495
+ createElementVNode("div", {
496
+ class: normalizeClass(["select-more", __props.stylecss]),
497
+ style: normalizeStyle({ width: typeof __props.width === "number" ? __props.width + "px" : __props.width }),
498
+ onClick: _cache[5] || (_cache[5] = withModifiers(($event) => isFocused.value = !isFocused.value, ["stop"]))
499
+ }, [
500
+ createElementVNode("div", {
501
+ class: normalizeClass(["select-more-wrapper", { "is-focused": isFocused.value }])
502
+ }, [
503
+ __props.multiple && ((_a = labelList.value) == null ? void 0 : _a.length) ? (openBlock(), createElementBlock("div", _hoisted_1, [
504
+ createVNode(_component_el_tag, {
505
+ class: "mr-[5px]",
506
+ type: "info",
507
+ closable: "",
508
+ onClose: _cache[0] || (_cache[0] = ($event) => closeHandle(0, labelList.value[0]))
509
+ }, {
510
+ default: withCtx(() => [
511
+ createElementVNode("div", _hoisted_2, toDisplayString(labelList.value[0]), 1)
512
+ ]),
513
+ _: 1
514
+ }),
515
+ labelList.value.length > 1 ? (openBlock(), createBlock(_sfc_main$1, {
516
+ key: 0,
517
+ width: `${__props.popwidth}px`
518
+ }, {
519
+ reference: withCtx(() => [
520
+ createVNode(_component_el_tag, { type: "info" }, {
521
+ default: withCtx(() => [
522
+ createTextVNode("+ " + toDisplayString(labelList.value.length - 1), 1)
523
+ ]),
524
+ _: 1
525
+ })
526
+ ]),
527
+ default: withCtx(() => [
528
+ createElementVNode("div", _hoisted_3, [
529
+ (openBlock(true), createElementBlock(Fragment, null, renderList(labelList.value, (tag, index) => {
530
+ return openBlock(), createElementBlock(Fragment, {
531
+ key: tag[valueKey.value]
532
+ }, [
533
+ index !== 0 ? (openBlock(), createBlock(_component_el_tag, {
534
+ key: 0,
535
+ class: "mr-[5px] mt-[5px]",
536
+ closable: "",
537
+ onClose: ($event) => closeHandle(index, tag)
538
+ }, {
539
+ default: withCtx(() => [
540
+ createTextVNode(toDisplayString(tag), 1)
541
+ ]),
542
+ _: 2
543
+ }, 1032, ["onClose"])) : createCommentVNode("", true)
544
+ ], 64);
545
+ }), 128))
546
+ ])
547
+ ]),
548
+ _: 1
549
+ }, 8, ["width"])) : createCommentVNode("", true)
550
+ ])) : createCommentVNode("", true),
551
+ __props.filterable ? (openBlock(), createElementBlock("div", _hoisted_4, [
552
+ isFocused.value ? withDirectives((openBlock(), createElementBlock("input", {
553
+ key: 0,
554
+ ref_key: "input",
555
+ ref: input,
556
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => filterText.value = $event),
557
+ class: "w-full h-[90%]",
558
+ type: "text",
559
+ placeholder: __props.placeholder,
560
+ onKeydown: _cache[2] || (_cache[2] = withModifiers(() => {
561
+ }, ["stop"])),
562
+ onClick: _cache[3] || (_cache[3] = withModifiers(() => {
563
+ }, ["stop"])),
564
+ onInput: _cache[4] || (_cache[4] = //@ts-ignore
565
+ (...args) => unref(filterHandle) && unref(filterHandle)(...args))
566
+ }, null, 40, _hoisted_5)), [
567
+ [vModelText, filterText.value]
568
+ ]) : (openBlock(), createElementBlock("div", {
569
+ key: 1,
570
+ class: normalizeClass(["text-nowrap", { "text-[#999]": !valueText.value || valueText.value === __props.placeholder }])
571
+ }, toDisplayString(valueText.value || __props.placeholder), 3))
572
+ ])) : createCommentVNode("", true),
573
+ !__props.filterable && !__props.multiple ? (openBlock(), createElementBlock("div", _hoisted_6, [
574
+ createElementVNode("div", {
575
+ class: normalizeClass(["text-nowrap", { "text-[#999]": !valueText.value || valueText.value === __props.placeholder }])
576
+ }, toDisplayString(valueText.value || __props.placeholder), 3)
577
+ ])) : createCommentVNode("", true),
578
+ createElementVNode("div", {
579
+ class: normalizeClass(["select-more-arrow", { "is-focused": isFocused.value }])
580
+ }, [
581
+ createVNode(_component_el_icon, null, {
582
+ default: withCtx(() => [
583
+ createVNode(unref(ArrowDown))
584
+ ]),
585
+ _: 1
586
+ })
587
+ ], 2),
588
+ __props.multiple && ((_b = modelValue.value) == null ? void 0 : _b.length) || !__props.multiple && modelValue.value ? (openBlock(), createElementBlock("div", {
589
+ key: 3,
590
+ class: "select-more-clear",
591
+ onClick: withModifiers(clearCheaked, ["stop"])
592
+ }, [
593
+ createVNode(_component_el_icon, null, {
594
+ default: withCtx(() => [
595
+ createVNode(unref(CircleClose))
596
+ ]),
597
+ _: 1
598
+ })
599
+ ])) : createCommentVNode("", true)
600
+ ], 2)
601
+ ], 6)
602
+ ];
603
+ }),
604
+ default: withCtx(() => [
605
+ createVNode(unref(script$1), {
606
+ ref_key: "DynamicScrollerRef",
607
+ ref: DynamicScrollerRef,
608
+ class: "content-list",
609
+ style: { height: "200px" },
610
+ keyField: __props.optionsKey || valueKey.value,
611
+ "min-item-size": 40,
612
+ items: data.value,
613
+ onScroll: scrollHandle
614
+ }, {
615
+ before: withCtx(() => [
616
+ renderSlot(_ctx.$slots, "header", {
617
+ options: data.value,
618
+ value: modelValue.value,
619
+ nodes: checkNode.value
620
+ }, void 0, true)
621
+ ]),
622
+ default: withCtx(({ item, index, active }) => [
623
+ createVNode(unref(script), {
624
+ item,
625
+ active,
626
+ "data-index": index,
627
+ onClick: withModifiers(($event) => clickHandle(item), ["stop"])
628
+ }, {
629
+ default: withCtx(() => [
630
+ renderSlot(_ctx.$slots, "default", {
631
+ item: __spreadProps(__spreadValues({}, item), { active: isCheck(item) })
632
+ }, () => [
633
+ createElementVNode("div", {
634
+ class: normalizeClass(["item", { active: isCheck(item) }])
635
+ }, [
636
+ createElementVNode("div", null, toDisplayString(__props.formate ? __props.formate(item) : item[labelKey.value]), 1),
637
+ isCheck(item) ? (openBlock(), createBlock(_component_el_icon, { key: 0 }, {
638
+ default: withCtx(() => [
639
+ createVNode(unref(Check))
640
+ ]),
641
+ _: 1
642
+ })) : createCommentVNode("", true)
643
+ ], 2)
644
+ ], true)
645
+ ]),
646
+ _: 2
647
+ }, 1032, ["item", "active", "data-index", "onClick"])
648
+ ]),
649
+ after: withCtx(() => [
650
+ loadStatus.value !== "isloadall" && !prop.unuseremote ? (openBlock(), createElementBlock("div", _hoisted_7, toDisplayString(loadStatus.value === "loading" ? "加载中" : "等待加载"), 1)) : createCommentVNode("", true)
651
+ ]),
652
+ empty: withCtx(() => [
653
+ (loadStatus.value === "isloadall" || __props.unuseremote) && !data.value.length ? (openBlock(), createElementBlock("div", _hoisted_8, " 暂无可用数据 ")) : createCommentVNode("", true)
654
+ ]),
655
+ _: 3
656
+ }, 8, ["keyField", "items"]),
657
+ renderSlot(_ctx.$slots, "footer", {
658
+ options: data.value,
659
+ value: modelValue.value,
660
+ nodes: checkNode.value
661
+ }, void 0, true)
662
+ ]),
663
+ _: 3
664
+ }, 8, ["visible", "width"]);
665
+ };
666
+ }
667
+ });
668
+ const HSelect = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-374d3fe2"]]);
669
+ export {
670
+ HSelect as H
671
+ };