@fmdevui/fm-dev 1.0.76 → 1.0.78
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/es/component.mjs +7 -2
- package/es/core/ui/components/index.d.ts +807 -2
- package/es/core/ui/components/querycondition/index.vue.d.ts +88 -0
- package/es/core/ui/components/querycondition/moreChoose.vue.d.ts +30 -0
- package/es/core/ui/components/querycondition/renderComp.vue.d.ts +9 -0
- package/es/core/ui/components/querycondition/style/css.d.ts +1 -0
- package/es/core/ui/components/querycondition/style/index.d.ts +1 -0
- package/es/core/ui/components/querycondition/type.d.ts +21 -0
- package/es/core/ui/components/querycondition/useComputed.d.ts +28 -0
- package/es/core/ui/components/selecttable/ClickOutside.d.ts +3 -0
- package/es/core/ui/components/selecttable/index.vue.d.ts +190 -0
- package/es/core/ui/components/selecttable/renderCol.vue.d.ts +21 -0
- package/es/core/ui/components/selecttable/style/css.d.ts +1 -0
- package/es/core/ui/components/selecttable/style/index.d.ts +1 -0
- package/es/core/ui/components/selecttable/type.d.ts +56 -0
- package/es/core/ui/components/selecttable/useVirtualized.d.ts +11 -0
- package/es/index.mjs +1 -1
- package/es/packages/core/index.mjs +1 -1
- package/es/packages/core/ui/components/index.mjs +18 -1
- package/es/packages/core/ui/components/querycondition/index.vue.mjs +5 -0
- package/es/packages/core/ui/components/querycondition/index.vue2.mjs +521 -0
- package/es/packages/core/ui/components/querycondition/moreChoose.vue.mjs +5 -0
- package/es/packages/core/ui/components/querycondition/moreChoose.vue2.mjs +237 -0
- package/es/packages/core/ui/components/querycondition/renderComp.vue.mjs +5 -0
- package/es/packages/core/ui/components/querycondition/renderComp.vue2.mjs +23 -0
- package/es/packages/core/ui/components/querycondition/style/css.mjs +1 -0
- package/es/packages/core/ui/components/querycondition/style/index.mjs +1 -0
- package/es/packages/core/ui/components/querycondition/type.mjs +1 -0
- package/es/packages/core/ui/components/querycondition/useComputed.mjs +104 -0
- package/es/packages/core/ui/components/selecttable/ClickOutside.mjs +69 -0
- package/es/packages/core/ui/components/selecttable/index.vue.mjs +5 -0
- package/es/packages/core/ui/components/selecttable/index.vue2.mjs +816 -0
- package/es/packages/core/ui/components/selecttable/renderCol.vue.mjs +5 -0
- package/es/packages/core/ui/components/selecttable/renderCol.vue2.mjs +28 -0
- package/es/packages/core/ui/components/selecttable/style/css.mjs +1 -0
- package/es/packages/core/ui/components/selecttable/style/index.mjs +1 -0
- package/es/packages/core/ui/components/selecttable/type.mjs +1 -0
- package/es/packages/core/ui/components/selecttable/useVirtualized.mjs +67 -0
- package/index.js +1897 -52
- package/index.min.js +30 -29
- package/index.min.mjs +27 -26
- package/index.mjs +1894 -54
- package/lib/component.js +6 -1
- package/lib/core/ui/components/index.d.ts +807 -2
- package/lib/core/ui/components/querycondition/index.vue.d.ts +88 -0
- package/lib/core/ui/components/querycondition/moreChoose.vue.d.ts +30 -0
- package/lib/core/ui/components/querycondition/renderComp.vue.d.ts +9 -0
- package/lib/core/ui/components/querycondition/style/css.d.ts +1 -0
- package/lib/core/ui/components/querycondition/style/index.d.ts +1 -0
- package/lib/core/ui/components/querycondition/type.d.ts +21 -0
- package/lib/core/ui/components/querycondition/useComputed.d.ts +28 -0
- package/lib/core/ui/components/selecttable/ClickOutside.d.ts +3 -0
- package/lib/core/ui/components/selecttable/index.vue.d.ts +190 -0
- package/lib/core/ui/components/selecttable/renderCol.vue.d.ts +21 -0
- package/lib/core/ui/components/selecttable/style/css.d.ts +1 -0
- package/lib/core/ui/components/selecttable/style/index.d.ts +1 -0
- package/lib/core/ui/components/selecttable/type.d.ts +56 -0
- package/lib/core/ui/components/selecttable/useVirtualized.d.ts +11 -0
- package/lib/index.js +5 -0
- package/lib/packages/core/index.js +5 -0
- package/lib/packages/core/ui/components/index.js +22 -0
- package/lib/packages/core/ui/components/querycondition/index.vue.js +9 -0
- package/lib/packages/core/ui/components/querycondition/index.vue2.js +525 -0
- package/lib/packages/core/ui/components/querycondition/moreChoose.vue.js +9 -0
- package/lib/packages/core/ui/components/querycondition/moreChoose.vue2.js +241 -0
- package/lib/packages/core/ui/components/querycondition/renderComp.vue.js +9 -0
- package/lib/packages/core/ui/components/querycondition/renderComp.vue2.js +27 -0
- package/lib/packages/core/ui/components/querycondition/style/css.js +4 -0
- package/lib/packages/core/ui/components/querycondition/style/index.js +4 -0
- package/lib/packages/core/ui/components/querycondition/type.js +2 -0
- package/lib/packages/core/ui/components/querycondition/useComputed.js +106 -0
- package/lib/packages/core/ui/components/selecttable/ClickOutside.js +73 -0
- package/lib/packages/core/ui/components/selecttable/index.vue.js +9 -0
- package/lib/packages/core/ui/components/selecttable/index.vue2.js +820 -0
- package/lib/packages/core/ui/components/selecttable/renderCol.vue.js +9 -0
- package/lib/packages/core/ui/components/selecttable/renderCol.vue2.js +32 -0
- package/lib/packages/core/ui/components/selecttable/style/css.js +4 -0
- package/lib/packages/core/ui/components/selecttable/style/index.js +4 -0
- package/lib/packages/core/ui/components/selecttable/type.js +2 -0
- package/lib/packages/core/ui/components/selecttable/useVirtualized.js +69 -0
- package/package.json +1 -1
- package/theme-chalk/src/query-condition.scss +118 -0
- package/theme-chalk/src/select-table.scss +71 -0
- package/theme-chalk/t-query-condition.css +1 -0
- package/theme-chalk/t-select-table.css +1 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var svg = require('@element-plus/icons-vue');
|
|
7
|
+
|
|
8
|
+
const _hoisted_1 = { class: "inside_box" };
|
|
9
|
+
const _hoisted_2 = { class: "inside_box_title" };
|
|
10
|
+
const _hoisted_3 = { class: "check-box" };
|
|
11
|
+
const _hoisted_4 = { class: "more_dropdown_icon" };
|
|
12
|
+
const _hoisted_5 = { class: "out_box" };
|
|
13
|
+
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
14
|
+
...{
|
|
15
|
+
name: "MoreChoose"
|
|
16
|
+
},
|
|
17
|
+
__name: "moreChoose",
|
|
18
|
+
props: {
|
|
19
|
+
// 以下拉方式展示更多条件---数据源
|
|
20
|
+
moreCheckList: {
|
|
21
|
+
type: Array,
|
|
22
|
+
default: () => []
|
|
23
|
+
},
|
|
24
|
+
popoverAttrsBind: {
|
|
25
|
+
type: Object,
|
|
26
|
+
default: () => ({})
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
emits: ["getCheckList"],
|
|
30
|
+
setup(__props, { emit: __emit }) {
|
|
31
|
+
const props = __props;
|
|
32
|
+
const checkList = vue.ref([]);
|
|
33
|
+
const isCheckList = vue.ref([]);
|
|
34
|
+
const allcheckList = vue.ref(props.moreCheckList);
|
|
35
|
+
const emit = __emit;
|
|
36
|
+
vue.watch(
|
|
37
|
+
() => props.moreCheckList,
|
|
38
|
+
(list) => {
|
|
39
|
+
allcheckList.value = list;
|
|
40
|
+
},
|
|
41
|
+
{ deep: true }
|
|
42
|
+
);
|
|
43
|
+
vue.watch(
|
|
44
|
+
() => checkList,
|
|
45
|
+
(nval, oval) => {
|
|
46
|
+
let list = [];
|
|
47
|
+
oval.value.forEach((ele) => {
|
|
48
|
+
if (!nval.value.some((val) => val == ele)) {
|
|
49
|
+
list.push(ele);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
isCheckList.value.forEach((ele, j) => {
|
|
53
|
+
if (list.filter((val) => val == ele.label)[0]) {
|
|
54
|
+
delete isCheckList.value[j];
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
{ deep: true }
|
|
59
|
+
);
|
|
60
|
+
const handlecheckAll = () => {
|
|
61
|
+
const allList = JSON.parse(JSON.stringify(allcheckList.value));
|
|
62
|
+
checkList.value = allList.map((item) => item.label);
|
|
63
|
+
isCheckList.value = allList;
|
|
64
|
+
const checkObj = analysisObj(isCheckList.value);
|
|
65
|
+
emit("getCheckList", checkObj);
|
|
66
|
+
};
|
|
67
|
+
const handleReverseCheck = () => {
|
|
68
|
+
const deepCheckList = JSON.parse(JSON.stringify(checkList.value));
|
|
69
|
+
checkList.value = [];
|
|
70
|
+
isCheckList.value = [];
|
|
71
|
+
allcheckList.value.forEach((ele) => {
|
|
72
|
+
if (!deepCheckList.filter((item1) => item1 == ele.label)[0]) {
|
|
73
|
+
checkList.value.push(ele.label);
|
|
74
|
+
isCheckList.value.push(ele);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
const checkObj = analysisObj(isCheckList.value);
|
|
78
|
+
emit("getCheckList", checkObj);
|
|
79
|
+
};
|
|
80
|
+
const handleReset = () => {
|
|
81
|
+
checkList.value = [];
|
|
82
|
+
isCheckList.value = [];
|
|
83
|
+
emit("getCheckList", {});
|
|
84
|
+
};
|
|
85
|
+
const getcheck = (val) => {
|
|
86
|
+
isCheckList.value = [];
|
|
87
|
+
allcheckList.value.forEach((ele, j) => {
|
|
88
|
+
if (val.filter((item1) => item1 == ele.label)[0]) {
|
|
89
|
+
isCheckList.value.push(ele);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
const checkObj = analysisObj(isCheckList.value);
|
|
93
|
+
emit("getCheckList", checkObj);
|
|
94
|
+
};
|
|
95
|
+
const analysisObj = (val) => {
|
|
96
|
+
return val.reduce((obj, item) => {
|
|
97
|
+
obj[item.prop] = {
|
|
98
|
+
label: item?.label,
|
|
99
|
+
comp: item.comp,
|
|
100
|
+
bind: item?.bind,
|
|
101
|
+
list: item?.list,
|
|
102
|
+
eventHandle: item?.eventHandle,
|
|
103
|
+
changeEvent: item?.changeEvent,
|
|
104
|
+
listTypeInfo: item?.listTypeInfo,
|
|
105
|
+
arrLabel: item?.arrLabel,
|
|
106
|
+
arrKey: item?.arrKey,
|
|
107
|
+
slotName: item?.slotName,
|
|
108
|
+
span: item?.span,
|
|
109
|
+
type: item?.type,
|
|
110
|
+
isSelfCom: item && item.isSelfCom || false,
|
|
111
|
+
defaultVal: item?.defaultVal,
|
|
112
|
+
placeholder: item?.placeholder,
|
|
113
|
+
event: item?.event
|
|
114
|
+
};
|
|
115
|
+
return obj;
|
|
116
|
+
}, {});
|
|
117
|
+
};
|
|
118
|
+
return (_ctx, _cache) => {
|
|
119
|
+
const _component_el_button = vue.resolveComponent("el-button");
|
|
120
|
+
const _component_el_checkbox = vue.resolveComponent("el-checkbox");
|
|
121
|
+
const _component_el_checkbox_group = vue.resolveComponent("el-checkbox-group");
|
|
122
|
+
const _component_el_icon = vue.resolveComponent("el-icon");
|
|
123
|
+
const _component_el_popover = vue.resolveComponent("el-popover");
|
|
124
|
+
return allcheckList.value.length > 0 ? (vue.openBlock(), vue.createBlock(_component_el_popover, {
|
|
125
|
+
key: 0,
|
|
126
|
+
"popper-class": "fm_query_condition_more",
|
|
127
|
+
bind: __props.popoverAttrsBind,
|
|
128
|
+
trigger: "click",
|
|
129
|
+
width: "auto",
|
|
130
|
+
ref: "popover"
|
|
131
|
+
}, {
|
|
132
|
+
reference: vue.withCtx(() => [
|
|
133
|
+
vue.createElementVNode("div", _hoisted_4, [
|
|
134
|
+
vue.createElementVNode(
|
|
135
|
+
"span",
|
|
136
|
+
_hoisted_5,
|
|
137
|
+
vue.toDisplayString(__props.popoverAttrsBind.showTxt || "\u66F4\u591A"),
|
|
138
|
+
1
|
|
139
|
+
/* TEXT */
|
|
140
|
+
),
|
|
141
|
+
vue.createVNode(_component_el_icon, null, {
|
|
142
|
+
default: vue.withCtx(() => [
|
|
143
|
+
vue.createVNode(vue.unref(svg.ArrowDown))
|
|
144
|
+
]),
|
|
145
|
+
_: 1
|
|
146
|
+
/* STABLE */
|
|
147
|
+
})
|
|
148
|
+
])
|
|
149
|
+
]),
|
|
150
|
+
default: vue.withCtx(() => [
|
|
151
|
+
vue.createElementVNode("div", _hoisted_1, [
|
|
152
|
+
vue.createElementVNode("div", _hoisted_2, [
|
|
153
|
+
vue.createElementVNode(
|
|
154
|
+
"div",
|
|
155
|
+
null,
|
|
156
|
+
vue.toDisplayString(__props.popoverAttrsBind.title || "\u6240\u6709\u6761\u4EF6"),
|
|
157
|
+
1
|
|
158
|
+
/* TEXT */
|
|
159
|
+
),
|
|
160
|
+
vue.createElementVNode("div", _hoisted_3, [
|
|
161
|
+
vue.createVNode(_component_el_button, {
|
|
162
|
+
size: "small",
|
|
163
|
+
link: "",
|
|
164
|
+
onClick: handlecheckAll
|
|
165
|
+
}, {
|
|
166
|
+
default: vue.withCtx(() => [
|
|
167
|
+
vue.createTextVNode(
|
|
168
|
+
vue.toDisplayString(__props.popoverAttrsBind.allTxt || "\u5168\u9009"),
|
|
169
|
+
1
|
|
170
|
+
/* TEXT */
|
|
171
|
+
)
|
|
172
|
+
]),
|
|
173
|
+
_: 1
|
|
174
|
+
/* STABLE */
|
|
175
|
+
}),
|
|
176
|
+
vue.createVNode(_component_el_button, {
|
|
177
|
+
size: "small",
|
|
178
|
+
link: "",
|
|
179
|
+
onClick: handleReset
|
|
180
|
+
}, {
|
|
181
|
+
default: vue.withCtx(() => [
|
|
182
|
+
vue.createTextVNode(
|
|
183
|
+
vue.toDisplayString(__props.popoverAttrsBind.clearTxt || "\u6E05\u7A7A"),
|
|
184
|
+
1
|
|
185
|
+
/* TEXT */
|
|
186
|
+
)
|
|
187
|
+
]),
|
|
188
|
+
_: 1
|
|
189
|
+
/* STABLE */
|
|
190
|
+
}),
|
|
191
|
+
vue.createVNode(_component_el_button, {
|
|
192
|
+
size: "small",
|
|
193
|
+
link: "",
|
|
194
|
+
onClick: handleReverseCheck
|
|
195
|
+
}, {
|
|
196
|
+
default: vue.withCtx(() => [
|
|
197
|
+
vue.createTextVNode(
|
|
198
|
+
vue.toDisplayString(__props.popoverAttrsBind.reverseTxt || "\u53CD\u9009"),
|
|
199
|
+
1
|
|
200
|
+
/* TEXT */
|
|
201
|
+
)
|
|
202
|
+
]),
|
|
203
|
+
_: 1
|
|
204
|
+
/* STABLE */
|
|
205
|
+
})
|
|
206
|
+
])
|
|
207
|
+
]),
|
|
208
|
+
vue.createVNode(_component_el_checkbox_group, {
|
|
209
|
+
modelValue: checkList.value,
|
|
210
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => checkList.value = $event),
|
|
211
|
+
class: "inside_box_main",
|
|
212
|
+
onChange: getcheck
|
|
213
|
+
}, {
|
|
214
|
+
default: vue.withCtx(() => [
|
|
215
|
+
(vue.openBlock(true), vue.createElementBlock(
|
|
216
|
+
vue.Fragment,
|
|
217
|
+
null,
|
|
218
|
+
vue.renderList(allcheckList.value, (item, index) => {
|
|
219
|
+
return vue.openBlock(), vue.createBlock(_component_el_checkbox, {
|
|
220
|
+
key: index,
|
|
221
|
+
label: item.label,
|
|
222
|
+
value: item.label
|
|
223
|
+
}, null, 8, ["label", "value"]);
|
|
224
|
+
}),
|
|
225
|
+
128
|
|
226
|
+
/* KEYED_FRAGMENT */
|
|
227
|
+
))
|
|
228
|
+
]),
|
|
229
|
+
_: 1
|
|
230
|
+
/* STABLE */
|
|
231
|
+
}, 8, ["modelValue"])
|
|
232
|
+
])
|
|
233
|
+
]),
|
|
234
|
+
_: 1
|
|
235
|
+
/* STABLE */
|
|
236
|
+
}, 8, ["bind"])) : vue.createCommentVNode("v-if", true);
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
exports.default = _sfc_main;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
|
|
7
|
+
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
8
|
+
...{
|
|
9
|
+
name: "RenderComp"
|
|
10
|
+
},
|
|
11
|
+
__name: "renderComp",
|
|
12
|
+
props: {
|
|
13
|
+
render: Function,
|
|
14
|
+
form: Object
|
|
15
|
+
},
|
|
16
|
+
setup(__props) {
|
|
17
|
+
const props = __props;
|
|
18
|
+
const renderComponent = () => {
|
|
19
|
+
return props.render(props?.form);
|
|
20
|
+
};
|
|
21
|
+
return (_ctx, _cache) => {
|
|
22
|
+
return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(renderComponent));
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
exports.default = _sfc_main;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vue = require('vue');
|
|
4
|
+
|
|
5
|
+
function useComputed() {
|
|
6
|
+
const compChildName = vue.computed(() => {
|
|
7
|
+
return (opt) => {
|
|
8
|
+
switch (opt.type) {
|
|
9
|
+
case "checkbox":
|
|
10
|
+
return "el-checkbox";
|
|
11
|
+
case "radio":
|
|
12
|
+
return "el-radio";
|
|
13
|
+
case "select-arr":
|
|
14
|
+
case "select-obj":
|
|
15
|
+
return "el-option";
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
});
|
|
19
|
+
const selectListType = vue.computed(() => {
|
|
20
|
+
return (opt) => {
|
|
21
|
+
if (opt.listTypeInfo) {
|
|
22
|
+
return opt.listTypeInfo[opt.list];
|
|
23
|
+
} else {
|
|
24
|
+
return [];
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
const compChildLabel = vue.computed(() => {
|
|
29
|
+
return (opt, value) => {
|
|
30
|
+
switch (opt.type) {
|
|
31
|
+
case "radio":
|
|
32
|
+
case "checkbox":
|
|
33
|
+
return value[opt.arrLabel || "label"];
|
|
34
|
+
case "el-select-multiple":
|
|
35
|
+
case "select-arr":
|
|
36
|
+
return value[opt.arrLabel || "label"];
|
|
37
|
+
case "select-obj":
|
|
38
|
+
return value;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
const compChildValue = vue.computed(() => {
|
|
43
|
+
return (opt, value, key) => {
|
|
44
|
+
switch (opt.type) {
|
|
45
|
+
case "radio":
|
|
46
|
+
case "checkbox":
|
|
47
|
+
return value[opt.arrKey || "key"];
|
|
48
|
+
case "el-select-multiple":
|
|
49
|
+
case "select-arr":
|
|
50
|
+
return value[opt.arrKey || "key"];
|
|
51
|
+
case "select-obj":
|
|
52
|
+
return key;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
const compChildShowLabel = vue.computed(() => {
|
|
57
|
+
return (opt, value) => {
|
|
58
|
+
switch (opt.type) {
|
|
59
|
+
case "radio":
|
|
60
|
+
case "checkbox":
|
|
61
|
+
return value[opt.arrLabel || "label"];
|
|
62
|
+
case "el-select-multiple":
|
|
63
|
+
case "select-arr":
|
|
64
|
+
return value[opt.arrLabel || "label"];
|
|
65
|
+
case "select-obj":
|
|
66
|
+
return value;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
const getPlaceholder = (row) => {
|
|
71
|
+
let placeholder;
|
|
72
|
+
if (row.comp && typeof row.comp == "string") {
|
|
73
|
+
if (row.comp.includes("input")) {
|
|
74
|
+
placeholder = "\u8BF7\u8F93\u5165" + row.label;
|
|
75
|
+
} else if (row.comp.includes("select") || row.comp.includes("date")) {
|
|
76
|
+
placeholder = "\u8BF7\u9009\u62E9" + row.label;
|
|
77
|
+
} else {
|
|
78
|
+
placeholder = row.label;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return placeholder;
|
|
82
|
+
};
|
|
83
|
+
const getColLength = () => {
|
|
84
|
+
const width = window.innerWidth;
|
|
85
|
+
let colLength = 4;
|
|
86
|
+
if (width > 1e3 && width < 1280) {
|
|
87
|
+
colLength = 3;
|
|
88
|
+
} else if (width > 768 && width <= 1e3) {
|
|
89
|
+
colLength = 2;
|
|
90
|
+
} else if (width <= 768) {
|
|
91
|
+
colLength = 1;
|
|
92
|
+
}
|
|
93
|
+
return colLength;
|
|
94
|
+
};
|
|
95
|
+
return {
|
|
96
|
+
compChildName,
|
|
97
|
+
selectListType,
|
|
98
|
+
compChildLabel,
|
|
99
|
+
compChildValue,
|
|
100
|
+
compChildShowLabel,
|
|
101
|
+
getPlaceholder,
|
|
102
|
+
getColLength
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
exports.useComputed = useComputed;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var core = require('@vueuse/core');
|
|
6
|
+
|
|
7
|
+
const nodeList = /* @__PURE__ */ new Map();
|
|
8
|
+
let startClick;
|
|
9
|
+
if (core.isClient) {
|
|
10
|
+
document.addEventListener("mousedown", (e) => startClick = e);
|
|
11
|
+
document.addEventListener("mouseup", (e) => {
|
|
12
|
+
for (const handlers of nodeList.values()) {
|
|
13
|
+
for (const { documentHandler } of handlers) {
|
|
14
|
+
documentHandler(e, startClick);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function createDocumentHandler(el, binding) {
|
|
20
|
+
let excludes = [];
|
|
21
|
+
if (Array.isArray(binding.arg)) {
|
|
22
|
+
excludes = binding.arg;
|
|
23
|
+
} else if (binding.arg instanceof HTMLElement) {
|
|
24
|
+
excludes.push(binding.arg);
|
|
25
|
+
}
|
|
26
|
+
return function(mouseup, mousedown) {
|
|
27
|
+
const popperRef = binding.instance.popperRef;
|
|
28
|
+
const mouseUpTarget = mouseup.target;
|
|
29
|
+
const mouseDownTarget = mousedown?.target;
|
|
30
|
+
const isBound = !binding || !binding.instance;
|
|
31
|
+
const isTargetExists = !mouseUpTarget || !mouseDownTarget;
|
|
32
|
+
const isContainedByEl = el.contains(mouseUpTarget) || el.contains(mouseDownTarget);
|
|
33
|
+
const isSelf = el === mouseUpTarget;
|
|
34
|
+
const isTargetExcluded = excludes.length && excludes.some((item) => item?.contains(mouseUpTarget)) || excludes.length && excludes.includes(mouseDownTarget);
|
|
35
|
+
const isContainedByPopper = popperRef && (popperRef.contains(mouseUpTarget) || popperRef.contains(mouseDownTarget));
|
|
36
|
+
if (isBound || isTargetExists || isContainedByEl || isSelf || isTargetExcluded || isContainedByPopper) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
binding.value(mouseup, mousedown);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
const ClickOutside = {
|
|
43
|
+
beforeMount(el, binding) {
|
|
44
|
+
if (!nodeList.has(el)) {
|
|
45
|
+
nodeList.set(el, []);
|
|
46
|
+
}
|
|
47
|
+
nodeList.get(el).push({
|
|
48
|
+
documentHandler: createDocumentHandler(el, binding),
|
|
49
|
+
bindingFn: binding.value
|
|
50
|
+
});
|
|
51
|
+
},
|
|
52
|
+
updated(el, binding) {
|
|
53
|
+
if (!nodeList.has(el)) {
|
|
54
|
+
nodeList.set(el, []);
|
|
55
|
+
}
|
|
56
|
+
const handlers = nodeList.get(el);
|
|
57
|
+
const oldHandlerIndex = handlers.findIndex((item) => item.bindingFn === binding.oldValue);
|
|
58
|
+
const newHandler = {
|
|
59
|
+
documentHandler: createDocumentHandler(el, binding),
|
|
60
|
+
bindingFn: binding.value
|
|
61
|
+
};
|
|
62
|
+
if (oldHandlerIndex >= 0) {
|
|
63
|
+
handlers.splice(oldHandlerIndex, 1, newHandler);
|
|
64
|
+
} else {
|
|
65
|
+
handlers.push(newHandler);
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
unmounted(el) {
|
|
69
|
+
nodeList.delete(el);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
exports.default = ClickOutside;
|