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