@farris/ui-vue 1.7.2-beta.1 → 1.7.2-beta.2
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/components/avatar/index.esm.js +155 -148
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +1 -1
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +226 -224
- package/components/calendar/index.umd.cjs +3 -3
- package/components/collection-property-editor/index.esm.js +225 -223
- package/components/collection-property-editor/index.umd.cjs +2 -2
- package/components/combo-list/index.esm.js +76 -71
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/comment/index.esm.js +169 -167
- package/components/comment/index.umd.cjs +6 -6
- package/components/component/index.esm.js +3691 -3043
- package/components/component/index.umd.cjs +2 -2
- package/components/condition/index.esm.js +2015 -1352
- package/components/condition/index.umd.cjs +2 -2
- package/components/data-grid/index.esm.js +407 -430
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +3082 -3196
- package/components/data-view/index.umd.cjs +1 -1
- package/components/designer-canvas/index.esm.js +3364 -2713
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/drawer/index.esm.js +66 -64
- package/components/drawer/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +1176 -524
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +182 -180
- package/components/dynamic-resolver/index.umd.cjs +2 -2
- package/components/dynamic-view/index.esm.js +531 -455
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +2352 -1700
- package/components/events-editor/index.umd.cjs +3 -3
- package/components/expression-editor/index.esm.js +8 -3
- package/components/expression-editor/index.umd.cjs +2 -2
- package/components/filter-bar/index.esm.js +422 -413
- package/components/filter-bar/index.umd.cjs +2 -2
- package/components/filter-condition-editor/index.esm.js +8 -3
- package/components/filter-condition-editor/index.umd.cjs +1 -1
- package/components/image/index.esm.js +363 -354
- package/components/image/index.umd.cjs +2 -2
- package/components/language-textbox/index.esm.js +189 -187
- package/components/language-textbox/index.umd.cjs +2 -2
- package/components/list-view/index.esm.js +388 -389
- package/components/list-view/index.umd.cjs +5 -5
- package/components/mapping-editor/index.esm.js +1465 -1488
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +180 -173
- package/components/number-range/index.umd.cjs +1 -1
- package/components/order/index.esm.js +815 -811
- package/components/order/index.umd.cjs +5 -5
- package/components/property-panel/index.esm.js +429 -420
- package/components/property-panel/index.umd.cjs +3 -3
- package/components/query-solution/index.esm.js +4746 -4085
- package/components/query-solution/index.umd.cjs +7 -7
- package/components/schema-selector/index.esm.js +1401 -1402
- package/components/schema-selector/index.umd.cjs +5 -5
- package/components/section/index.esm.js +102 -100
- package/components/section/index.umd.cjs +2 -2
- package/components/sort-condition-editor/index.esm.js +8 -3
- package/components/sort-condition-editor/index.umd.cjs +1 -1
- package/components/transfer/index.esm.js +537 -538
- package/components/transfer/index.umd.cjs +5 -5
- package/components/tree-grid/index.esm.js +280 -283
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +200 -202
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +533 -519
- package/components/uploader/index.umd.cjs +2 -2
- package/designer/data-grid/index.esm.js +3806 -3905
- package/designer/data-grid/index.umd.cjs +9 -9
- package/designer/drawer/index.esm.js +188 -186
- package/designer/drawer/index.umd.cjs +2 -2
- package/designer/dynamic-form/index.esm.js +1562 -1073
- package/designer/dynamic-form/index.umd.cjs +2 -2
- package/designer/farris-designer.all.esm.js +9793 -8613
- package/designer/farris-designer.all.umd.cjs +8 -8
- package/designer/list-view/index.esm.js +564 -564
- package/designer/list-view/index.umd.cjs +6 -6
- package/designer/radio-group/index.esm.js +236 -229
- package/designer/radio-group/index.umd.cjs +1 -1
- package/designer/response-layout-editor/index.esm.js +178 -171
- package/designer/response-layout-editor/index.umd.cjs +1 -1
- package/designer/tabs/index.esm.js +3154 -2508
- package/designer/tabs/index.umd.cjs +2 -2
- package/designer/time-picker/index.esm.js +193 -186
- package/designer/time-picker/index.umd.cjs +1 -1
- package/designer/tree-grid/index.esm.js +444 -447
- package/designer/tree-grid/index.umd.cjs +1 -1
- package/farris.all.esm.js +60126 -59649
- package/farris.all.umd.cjs +30 -30
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/components.d.ts +1 -1
- package/types/condition/src/composition/condition-value/dropdown-value.d.ts +4 -0
- package/types/data-grid/index.d.ts +2 -5
- package/types/data-grid/src/data-grid.component.d.ts +1 -2
- package/types/data-view/components/row/hierarchy-row.component.d.ts +2 -2
- package/types/data-view/composition/appearance/use-cell-position.d.ts +1 -1
- package/types/data-view/composition/types.d.ts +0 -4
- package/types/data-view/composition/visualization/use-virtual-scroll.d.ts +2 -2
- package/types/data-view/composition/visualization/use-visual-data-bound.d.ts +2 -3
- package/types/data-view/composition/visualization/use-visual-data-row.d.ts +1 -2
- package/types/designer-canvas/src/composition/dg-control.d.ts +24 -0
- package/types/dynamic-form/designer.d.ts +0 -1
- package/types/dynamic-form/index.d.ts +4 -3
- package/types/dynamic-form/src/designer/dynamic-form.design.component.d.ts +8 -0
- package/types/dynamic-form/src/designer/response-form.design.props.d.ts +14 -0
- package/types/dynamic-form/src/designer/use-dynamic-form-rules.d.ts +2 -0
- package/types/dynamic-form/src/dynamic-form.component.d.ts +8 -0
- package/types/dynamic-form/src/response-form.props.d.ts +13 -1
- package/types/dynamic-form/src/schema/response-form-schema-resolver.d.ts +1 -0
- package/types/dynamic-form/src/types.d.ts +1 -0
- package/types/dynamic-resolver/src/types.d.ts +1 -0
- package/types/dynamic-view/index.d.ts +43 -3
- package/types/dynamic-view/src/components/maps.d.ts +6 -6
- package/types/dynamic-view/src/composition/index.d.ts +5 -0
- package/types/dynamic-view/src/composition/use-utils.d.ts +12 -0
- package/types/dynamic-view/src/dynamic-view.component.d.ts +6 -6
- package/types/language-textbox/index.d.ts +3 -3
- package/types/language-textbox/src/components/language-contents.component.d.ts +1 -1
- package/types/language-textbox/src/language-textbox.component.d.ts +1 -1
- package/types/lookup/src/components/favorite/lookup-favorite.component.d.ts +1 -1
- package/types/lookup/src/components/popup-container.component.d.ts +3 -3
- package/types/property-panel/src/property-panel.component.d.ts +3 -3
- package/types/tree-grid/src/components/data/data-area.component.d.ts +2 -2
- package/types/tree-grid/src/tree-grid.props.d.ts +0 -1
- package/types/tree-view/src/components/data/tree-area.component.d.ts +1 -1
- package/types/tree-view/src/tree-view.props.d.ts +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ref as D, computed as
|
|
2
|
-
import { FButtonEdit as
|
|
3
|
-
import { isPlainObject as
|
|
1
|
+
import { ref as D, computed as B, defineComponent as V, provide as H, onMounted as me, createVNode as h, createTextVNode as R, inject as G } from "vue";
|
|
2
|
+
import { FButtonEdit as fe } from "../button-edit/index.esm.js";
|
|
3
|
+
import { isPlainObject as U, cloneDeep as L } from "lodash-es";
|
|
4
4
|
import { FPropertyPanel as pe } from "../property-panel/index.esm.js";
|
|
5
5
|
import { FTreeView as ve } from "../tree-view/index.esm.js";
|
|
6
6
|
function J(e, t) {
|
|
7
7
|
let n;
|
|
8
|
-
function
|
|
9
|
-
const { properties:
|
|
8
|
+
function a(r) {
|
|
9
|
+
const { properties: l, title: s, ignore: o } = r, i = o && Array.isArray(o), c = Object.keys(l).reduce((p, b) => ((!i || !o.find((T) => T === b)) && (p[b] = l[b].type === "object" && l[b].properties ? a(l[b]) : L(l[b].default)), p), {});
|
|
10
10
|
if (s && (!i || !o.find((p) => p === "id"))) {
|
|
11
11
|
const p = s.toLowerCase().replace(/-/g, "_");
|
|
12
12
|
c.id = `${p}_${Math.random().toString().slice(2, 6)}`;
|
|
@@ -14,9 +14,9 @@ function J(e, t) {
|
|
|
14
14
|
return c;
|
|
15
15
|
}
|
|
16
16
|
function v(r) {
|
|
17
|
-
const { properties:
|
|
17
|
+
const { properties: l, title: s, required: o } = r;
|
|
18
18
|
if (o && Array.isArray(o)) {
|
|
19
|
-
const i = o.reduce((c, p) => (c[p] =
|
|
19
|
+
const i = o.reduce((c, p) => (c[p] = l[p].type === "object" && l[p].properties ? a(l[p]) : L(l[p].default), c), {});
|
|
20
20
|
if (s && o.find((c) => c === "id")) {
|
|
21
21
|
const c = s.toLowerCase().replace(/-/g, "_");
|
|
22
22
|
i.id = `${c}_${Math.random().toString().slice(2, 6)}`;
|
|
@@ -27,23 +27,23 @@ function J(e, t) {
|
|
|
27
27
|
type: s
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
function y(r,
|
|
30
|
+
function y(r, l = {}, s) {
|
|
31
31
|
const o = e[r];
|
|
32
32
|
if (o) {
|
|
33
33
|
let i = v(o);
|
|
34
34
|
const c = t[r];
|
|
35
|
-
return i = c ? c({ getSchemaByType: y }, i,
|
|
35
|
+
return i = c ? c({ getSchemaByType: y }, i, l, s) : i, n != null && n.appendIdentifyForNewControl && n.appendIdentifyForNewControl(i), i;
|
|
36
36
|
}
|
|
37
37
|
return null;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
const s = l
|
|
41
|
-
return Object.keys(s).reduce((o, i) => (Object.prototype.hasOwnProperty.call(r, i) && (o[i] &&
|
|
39
|
+
function S(r, l) {
|
|
40
|
+
const s = a(l);
|
|
41
|
+
return Object.keys(s).reduce((o, i) => (Object.prototype.hasOwnProperty.call(r, i) && (o[i] && U(o[i]) && U(r[i] || !r[i]) ? Object.assign(o[i], r[i] || {}) : o[i] = r[i]), o), s), s;
|
|
42
42
|
}
|
|
43
|
-
function x(r,
|
|
43
|
+
function x(r, l) {
|
|
44
44
|
return Object.keys(r).filter((o) => r[o] != null).reduce((o, i) => {
|
|
45
|
-
if (
|
|
46
|
-
const c =
|
|
45
|
+
if (l.has(i)) {
|
|
46
|
+
const c = l.get(i);
|
|
47
47
|
if (typeof c == "string")
|
|
48
48
|
o[c] = r[i];
|
|
49
49
|
else {
|
|
@@ -55,95 +55,95 @@ function J(e, t) {
|
|
|
55
55
|
return o;
|
|
56
56
|
}, {});
|
|
57
57
|
}
|
|
58
|
-
function g(r,
|
|
59
|
-
const o =
|
|
58
|
+
function g(r, l, s = /* @__PURE__ */ new Map()) {
|
|
59
|
+
const o = S(r, l);
|
|
60
60
|
return x(o, s);
|
|
61
61
|
}
|
|
62
62
|
function u(r) {
|
|
63
63
|
var s;
|
|
64
|
-
const
|
|
65
|
-
if (
|
|
66
|
-
const o = e[
|
|
64
|
+
const l = r.type;
|
|
65
|
+
if (l) {
|
|
66
|
+
const o = e[l];
|
|
67
67
|
if (!o)
|
|
68
68
|
return r;
|
|
69
|
-
const i =
|
|
69
|
+
const i = S(r, o), c = ((s = r.editor) == null ? void 0 : s.type) || "";
|
|
70
70
|
if (c) {
|
|
71
|
-
const p = e[c], b =
|
|
71
|
+
const p = e[c], b = S(r.editor, p);
|
|
72
72
|
i.editor = b;
|
|
73
73
|
}
|
|
74
74
|
return i;
|
|
75
75
|
}
|
|
76
76
|
return r;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function f(r) {
|
|
79
79
|
n = r;
|
|
80
80
|
}
|
|
81
|
-
return { getSchemaByType: y, resolveSchemaWithDefaultValue: u, resolveSchemaToProps: g, mappingSchemaToProps: x, setDesignerContext:
|
|
81
|
+
return { getSchemaByType: y, resolveSchemaWithDefaultValue: u, resolveSchemaToProps: g, mappingSchemaToProps: x, setDesignerContext: f };
|
|
82
82
|
}
|
|
83
83
|
const Q = {}, X = {}, { resolveSchemaWithDefaultValue: ge, resolveSchemaToProps: be, mappingSchemaToProps: ye } = J(Q, X);
|
|
84
84
|
function Ce(e = {}) {
|
|
85
|
-
function t(u,
|
|
85
|
+
function t(u, f, r, l) {
|
|
86
86
|
if (typeof r == "number")
|
|
87
|
-
return
|
|
87
|
+
return l[u].length === r;
|
|
88
88
|
if (typeof r == "object") {
|
|
89
89
|
const s = Object.keys(r)[0], o = r[s];
|
|
90
90
|
if (s === "not")
|
|
91
|
-
return Number(
|
|
91
|
+
return Number(l[u].length) !== Number(o);
|
|
92
92
|
if (s === "moreThan")
|
|
93
|
-
return Number(
|
|
93
|
+
return Number(l[u].length) >= Number(o);
|
|
94
94
|
if (s === "lessThan")
|
|
95
|
-
return Number(
|
|
95
|
+
return Number(l[u].length) <= Number(o);
|
|
96
96
|
}
|
|
97
97
|
return !1;
|
|
98
98
|
}
|
|
99
|
-
function n(u,
|
|
100
|
-
return
|
|
99
|
+
function n(u, f, r, l) {
|
|
100
|
+
return l[u] && l[u].propertyValue && String(l[u].propertyValue.value) === String(r);
|
|
101
101
|
}
|
|
102
|
-
const
|
|
102
|
+
const a = /* @__PURE__ */ new Map([
|
|
103
103
|
["length", t],
|
|
104
104
|
["getProperty", n]
|
|
105
105
|
]);
|
|
106
|
-
Object.keys(e).reduce((u,
|
|
107
|
-
function v(u,
|
|
106
|
+
Object.keys(e).reduce((u, f) => (u.set(f, e[f]), u), a);
|
|
107
|
+
function v(u, f) {
|
|
108
108
|
const r = u;
|
|
109
|
-
return typeof
|
|
110
|
-
if (
|
|
111
|
-
return { target: r, operator: "length", param: null, value:
|
|
112
|
-
const s =
|
|
109
|
+
return typeof f == "number" ? [{ target: r, operator: "length", param: null, value: Number(f) }] : typeof f == "boolean" ? [{ target: r, operator: "getProperty", param: u, value: !!f }] : typeof f == "object" ? Object.keys(f).map((l) => {
|
|
110
|
+
if (l === "length")
|
|
111
|
+
return { target: r, operator: "length", param: null, value: f[l] };
|
|
112
|
+
const s = l, o = f[l];
|
|
113
113
|
return { target: r, operator: "getProperty", param: s, value: o };
|
|
114
114
|
}) : [];
|
|
115
115
|
}
|
|
116
116
|
function y(u) {
|
|
117
|
-
return Object.keys(u).reduce((r,
|
|
118
|
-
const s = v(
|
|
117
|
+
return Object.keys(u).reduce((r, l) => {
|
|
118
|
+
const s = v(l, u[l]);
|
|
119
119
|
return r.push(...s), r;
|
|
120
120
|
}, []);
|
|
121
121
|
}
|
|
122
|
-
function
|
|
123
|
-
if (
|
|
124
|
-
const r =
|
|
125
|
-
return r && r(u.target, u.param, u.value,
|
|
122
|
+
function S(u, f) {
|
|
123
|
+
if (a.has(u.operator)) {
|
|
124
|
+
const r = a.get(u.operator);
|
|
125
|
+
return r && r(u.target, u.param, u.value, f) || !1;
|
|
126
126
|
}
|
|
127
127
|
return !1;
|
|
128
128
|
}
|
|
129
|
-
function x(u,
|
|
130
|
-
return y(u).reduce((s, o) => s &&
|
|
129
|
+
function x(u, f) {
|
|
130
|
+
return y(u).reduce((s, o) => s && S(o, f), !0);
|
|
131
131
|
}
|
|
132
|
-
function g(u,
|
|
133
|
-
const r = Object.keys(u),
|
|
134
|
-
return
|
|
132
|
+
function g(u, f) {
|
|
133
|
+
const r = Object.keys(u), l = r.includes("allOf"), s = r.includes("anyOf"), o = l || s, p = (o ? u[o ? l ? "allOf" : "anyOf" : "allOf"] : [u]).map((T) => x(T, f));
|
|
134
|
+
return l ? !p.includes(!1) : p.includes(!0);
|
|
135
135
|
}
|
|
136
136
|
return { parseValueSchema: g };
|
|
137
137
|
}
|
|
138
|
-
const
|
|
139
|
-
convertTo: (e, t, n,
|
|
138
|
+
const Se = {
|
|
139
|
+
convertTo: (e, t, n, a) => {
|
|
140
140
|
e.appearance || (e.appearance = {}), e.appearance[t] = n;
|
|
141
141
|
},
|
|
142
142
|
convertFrom: (e, t, n) => e.appearance ? e.appearance[t] : e[t]
|
|
143
|
-
}, Se = {
|
|
144
|
-
convertFrom: (e, t, n) => e.buttons && e.buttons.length ? `共 ${e.buttons.length} 项` : "无"
|
|
145
143
|
}, Fe = {
|
|
146
|
-
|
|
144
|
+
convertFrom: (e, t, n) => e.buttons && e.buttons.length ? `共 ${e.buttons.length} 项` : "无"
|
|
145
|
+
}, Te = {
|
|
146
|
+
convertTo: (e, t, n, a) => {
|
|
147
147
|
e.editor && (e.editor[t] = n);
|
|
148
148
|
},
|
|
149
149
|
convertFrom: (e, t, n) => e.editor && Object.prototype.hasOwnProperty.call(e.editor, t) ? e.editor[t] : e[t]
|
|
@@ -201,20 +201,25 @@ const Te = {
|
|
|
201
201
|
"discussion-list": { type: "discussion-list", name: "评论列表" },
|
|
202
202
|
comment: { type: "comment", name: "评论区" },
|
|
203
203
|
"rich-text-editor": { type: "rich-text-editor", name: "富文本", icon: "rich-text-box" },
|
|
204
|
-
calendar: { type: "calendar", name: "日历", icon: "date-picker" }
|
|
205
|
-
|
|
204
|
+
calendar: { type: "calendar", name: "日历", icon: "date-picker" },
|
|
205
|
+
wizard: { type: "wizard", name: "向导", icon: "wizard" },
|
|
206
|
+
"wizard-page": { type: "wizard-page", name: "向导页", icon: "wizard" },
|
|
207
|
+
"wizard-page-detail": { type: "wizard-page-detail", name: "向导详情", icon: "wizard" },
|
|
208
|
+
step: { type: "step", name: "步骤条", icon: "step" },
|
|
209
|
+
"dynamic-form": { type: "dynamic-form", name: "动态表单" }
|
|
210
|
+
}, we = {
|
|
206
211
|
convertFrom: (e, t, n) => {
|
|
207
212
|
var v;
|
|
208
|
-
const
|
|
209
|
-
return ((v = xe[
|
|
213
|
+
const a = e.editor && e.editor[t] ? e.editor[t] : e[t];
|
|
214
|
+
return ((v = xe[a]) == null ? void 0 : v.name) || a;
|
|
210
215
|
}
|
|
211
|
-
},
|
|
212
|
-
convertTo: (e, t, n,
|
|
216
|
+
}, he = {
|
|
217
|
+
convertTo: (e, t, n, a) => {
|
|
213
218
|
e[t] = e[t];
|
|
214
219
|
},
|
|
215
220
|
convertFrom: (e, t, n) => e.editor ? n.getRealEditorType(e.editor.type) : ""
|
|
216
221
|
}, Oe = {
|
|
217
|
-
convertTo: (e, t, n,
|
|
222
|
+
convertTo: (e, t, n, a) => {
|
|
218
223
|
(e.type === "data-grid-column" || e.type === "tree-grid-column") && (e.formatter ? e.formatter[t] = n : e.formatter = {
|
|
219
224
|
[t]: n
|
|
220
225
|
});
|
|
@@ -241,11 +246,13 @@ const Te = {
|
|
|
241
246
|
return e.formatter.customFormat;
|
|
242
247
|
if (t === "type")
|
|
243
248
|
return e.formatter.type || "none";
|
|
249
|
+
if (t === "customFormat")
|
|
250
|
+
return e.formmater.customFormat;
|
|
244
251
|
}
|
|
245
252
|
return "none";
|
|
246
253
|
}
|
|
247
254
|
}, Pe = {
|
|
248
|
-
convertTo: (e, t, n,
|
|
255
|
+
convertTo: (e, t, n, a) => {
|
|
249
256
|
e.command ? e.command[t] = n : e.command = {
|
|
250
257
|
[t]: n
|
|
251
258
|
}, t === "enableType" && n === "default" && (e.command.enable = !0, e.command.commands = [
|
|
@@ -262,38 +269,26 @@ const Te = {
|
|
|
262
269
|
]), t === "enableType" && n === "custom" && (e.command.enable = !0, e.command.commands = [
|
|
263
270
|
{
|
|
264
271
|
value: "add",
|
|
265
|
-
text:
|
|
266
|
-
en: "add",
|
|
267
|
-
"zh-CHS": "增加",
|
|
268
|
-
"zh-CHT": "增加"
|
|
269
|
-
},
|
|
272
|
+
text: "增加",
|
|
270
273
|
type: "link"
|
|
271
274
|
},
|
|
272
275
|
{
|
|
273
276
|
value: "edit",
|
|
274
|
-
text:
|
|
275
|
-
en: "edit",
|
|
276
|
-
"zh-CHS": "编辑",
|
|
277
|
-
"zh-CHT": "編輯"
|
|
278
|
-
},
|
|
277
|
+
text: "编辑",
|
|
279
278
|
type: "danger"
|
|
280
279
|
},
|
|
281
280
|
{
|
|
282
281
|
value: "remove",
|
|
283
|
-
text:
|
|
284
|
-
en: "remove",
|
|
285
|
-
"zh-CHS": "删除",
|
|
286
|
-
"zh-CHT": "刪除"
|
|
287
|
-
},
|
|
282
|
+
text: "删除",
|
|
288
283
|
type: "remove"
|
|
289
284
|
}
|
|
290
285
|
]), t === "enableType" && n === "unable" && (e.command.enable = !1);
|
|
291
286
|
},
|
|
292
287
|
convertFrom: (e, t, n) => {
|
|
293
|
-
var
|
|
288
|
+
var a, v;
|
|
294
289
|
if (e.command) {
|
|
295
290
|
if (t === "enableType") {
|
|
296
|
-
const y = (v = (
|
|
291
|
+
const y = (v = (a = e.command) == null ? void 0 : a.commands) == null ? void 0 : v.find((S) => S.command === "edit" && S.type === "primary");
|
|
297
292
|
return e.command.enable ? y ? "default" : "custom" : "unable";
|
|
298
293
|
}
|
|
299
294
|
if (t === "commands")
|
|
@@ -302,11 +297,13 @@ const Te = {
|
|
|
302
297
|
return e.command.formatter;
|
|
303
298
|
if (t === "count")
|
|
304
299
|
return e.command.count;
|
|
300
|
+
if (t === "columnWidth")
|
|
301
|
+
return e.command.columnWidth || 150;
|
|
305
302
|
}
|
|
306
303
|
return "";
|
|
307
304
|
}
|
|
308
305
|
}, ke = {
|
|
309
|
-
convertTo: (e, t, n,
|
|
306
|
+
convertTo: (e, t, n, a) => {
|
|
310
307
|
e.column ? e.column[t] = n : e.column = {
|
|
311
308
|
[t]: n
|
|
312
309
|
}, t === "fitColumns" && n && (e.column.fitMode || (e.column.fitMode = "average"));
|
|
@@ -321,7 +318,7 @@ const Te = {
|
|
|
321
318
|
return "";
|
|
322
319
|
}
|
|
323
320
|
}, Ee = {
|
|
324
|
-
convertTo: (e, t, n,
|
|
321
|
+
convertTo: (e, t, n, a) => {
|
|
325
322
|
e.summary ? e.summary[t] = n : e.summary = {
|
|
326
323
|
[t]: n
|
|
327
324
|
}, t === "enable" && n && (e.summary ? e.summary.groupFields || (e.summary.groupFields = []) : e.summary = {
|
|
@@ -329,9 +326,12 @@ const Te = {
|
|
|
329
326
|
groupFields: []
|
|
330
327
|
});
|
|
331
328
|
},
|
|
332
|
-
convertFrom: (e, t, n) =>
|
|
329
|
+
convertFrom: (e, t, n) => {
|
|
330
|
+
var a;
|
|
331
|
+
return t === "customSummaryStyle" ? e.summary.customSummaryStyle : t === "position" ? ((a = e.summary) == null ? void 0 : a[t]) || "bottom" : e.summary && t === "enable" ? e.summary.enable : e.type === "data-grid-column" ? e.enableSummary === void 0 ? !1 : e.enableSummary : "";
|
|
332
|
+
}
|
|
333
333
|
}, De = {
|
|
334
|
-
convertTo: (e, t, n,
|
|
334
|
+
convertTo: (e, t, n, a) => {
|
|
335
335
|
e.group ? e.group[t] = n : e.group = {
|
|
336
336
|
[t]: n
|
|
337
337
|
}, t === "enable" && n && (e.group ? e.group.groupFields || (e.group.groupFields = []) : e.group = {
|
|
@@ -348,71 +348,71 @@ const Te = {
|
|
|
348
348
|
return e.group.showSummary;
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
|
-
},
|
|
351
|
+
}, je = {
|
|
352
352
|
convertFrom: (e, t) => e.binding ? e.binding.path : "",
|
|
353
353
|
convertTo: (e, t, n) => {
|
|
354
354
|
if (n && n.length > 0) {
|
|
355
|
-
const
|
|
356
|
-
e.binding || (e.binding = {}), e.binding.type = "Form", e.binding.path =
|
|
355
|
+
const a = n[0];
|
|
356
|
+
e.binding || (e.binding = {}), e.binding.type = "Form", e.binding.path = a.bindingField, e.binding.field = a.id, e.binding.fullPath = a.path, e.path = a.bindingPath;
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
|
-
},
|
|
360
|
-
convertTo: (e, t, n,
|
|
361
|
-
e.pagination || (e.pagination = {}), e.pagination[t] = n;
|
|
359
|
+
}, Ne = {
|
|
360
|
+
convertTo: (e, t, n, a) => {
|
|
361
|
+
e.pagination || (e.pagination = {}), t === "sizeLimits" ? e.pagination.sizeLimits = n.split(",") : e.pagination[t] = n;
|
|
362
362
|
},
|
|
363
|
-
convertFrom: (e, t, n) => e.pagination ? e.pagination[t] : e[t]
|
|
363
|
+
convertFrom: (e, t, n) => e.pagination ? t === "sizeLimits" ? e.pagination.sizeLimits.join(",") : e.pagination[t] : e[t]
|
|
364
364
|
}, Me = {
|
|
365
|
-
convertTo: (e, t, n,
|
|
365
|
+
convertTo: (e, t, n, a) => {
|
|
366
366
|
e.rowNumber || (e.rowNumber = {}), e.rowNumber[t] = n;
|
|
367
367
|
},
|
|
368
368
|
convertFrom: (e, t, n) => e.rowNumber ? e.rowNumber[t] : e[t]
|
|
369
369
|
}, $e = {
|
|
370
|
-
convertTo: (e, t, n,
|
|
370
|
+
convertTo: (e, t, n, a) => {
|
|
371
371
|
e.selection || (e.selection = {}), e.selection[t] = n;
|
|
372
372
|
},
|
|
373
373
|
convertFrom: (e, t, n) => {
|
|
374
|
-
var
|
|
375
|
-
return t === "showCheckbox" ? (
|
|
374
|
+
var a, v;
|
|
375
|
+
return t === "showCheckbox" ? (a = e.selection) != null && a.multiSelect ? !0 : (v = e.selection) == null ? void 0 : v.showCheckbox : e.selection ? e.selection[t] : e[t];
|
|
376
376
|
}
|
|
377
|
-
},
|
|
377
|
+
}, ze = {
|
|
378
378
|
convertFrom: (e, t, n) => e[t] && e[t].length ? `共 ${e[t].length} 项` : ""
|
|
379
|
-
},
|
|
379
|
+
}, Re = {
|
|
380
380
|
convertFrom: (e, t) => e[t] || "",
|
|
381
381
|
convertTo: (e, t, n) => {
|
|
382
382
|
e[t] = n;
|
|
383
383
|
}
|
|
384
|
-
},
|
|
385
|
-
convertTo: (e, t, n,
|
|
384
|
+
}, Be = {
|
|
385
|
+
convertTo: (e, t, n, a) => {
|
|
386
386
|
e.size || (e.size = {}), e.size[t] = n;
|
|
387
387
|
},
|
|
388
388
|
convertFrom: (e, t, n) => e.size ? e.size[t] : e[t]
|
|
389
|
-
},
|
|
389
|
+
}, Le = {
|
|
390
390
|
convertFrom: (e, t, n) => {
|
|
391
|
-
var
|
|
392
|
-
return (
|
|
391
|
+
var a, v;
|
|
392
|
+
return (a = e.formatter) != null && a.data && t === "formatterEnumData" && !e.formatterEnumData ? (v = e.formatter) == null ? void 0 : v.data : e.formatterEnumData;
|
|
393
393
|
}
|
|
394
|
-
},
|
|
395
|
-
convertTo: (e, t, n,
|
|
394
|
+
}, Ae = {
|
|
395
|
+
convertTo: (e, t, n, a) => {
|
|
396
396
|
e.sort || (e.sort = {}), e.sort[t] = n;
|
|
397
397
|
},
|
|
398
398
|
convertFrom: (e, t, n) => {
|
|
399
|
-
var
|
|
399
|
+
var a, v;
|
|
400
400
|
if (t === "mode")
|
|
401
|
-
return ((
|
|
401
|
+
return ((a = e.sort) == null ? void 0 : a.mode) || "client";
|
|
402
402
|
if (t === "multiSort")
|
|
403
403
|
return !!((v = e.sort) != null && v.multiSort);
|
|
404
404
|
}
|
|
405
|
-
},
|
|
406
|
-
convertTo: (e, t, n,
|
|
405
|
+
}, qe = {
|
|
406
|
+
convertTo: (e, t, n, a) => {
|
|
407
407
|
e.filter || (e.filter = {}), e.filter[t] = n;
|
|
408
408
|
},
|
|
409
409
|
convertFrom: (e, t, n) => {
|
|
410
|
-
var
|
|
410
|
+
var a;
|
|
411
411
|
if (t === "mode")
|
|
412
|
-
return ((
|
|
412
|
+
return ((a = e.filter) == null ? void 0 : a.mode) || "client";
|
|
413
413
|
}
|
|
414
|
-
},
|
|
415
|
-
convertTo: (e, t, n,
|
|
414
|
+
}, _e = {
|
|
415
|
+
convertTo: (e, t, n, a) => {
|
|
416
416
|
e.rowOption ? e.rowOption[t] = n : e.rowOption = {
|
|
417
417
|
[t]: n
|
|
418
418
|
};
|
|
@@ -423,11 +423,13 @@ const Te = {
|
|
|
423
423
|
return e.rowOption.customRowStyle;
|
|
424
424
|
if (t === "customCellStyle")
|
|
425
425
|
return e.rowOption.customCellStyle;
|
|
426
|
+
if (t === "height")
|
|
427
|
+
return e.rowOption.height;
|
|
426
428
|
}
|
|
427
429
|
return "";
|
|
428
430
|
}
|
|
429
|
-
},
|
|
430
|
-
convertTo: (e, t, n,
|
|
431
|
+
}, Ie = {
|
|
432
|
+
convertTo: (e, t, n, a) => {
|
|
431
433
|
(e.type === "data-grid-column" || e.type === "tree-grid-column") && (e[t] = n, t === "columnTemplateType" && n === "hyperlink" && (e.onClickLinkCommand ? e.columnTemplate = `
|
|
432
434
|
<span class="f-pretend-link f-cursor-pointer"
|
|
433
435
|
@click="(ctx)=>viewModel.current.${e.onClickLinkCommand || ""}({id: rowData.id,context: ctx})">
|
|
@@ -440,29 +442,29 @@ const Te = {
|
|
|
440
442
|
convertFrom: (e, t, n) => t === "columnTemplate" ? e.columnTemplate : t === "columnTemplateType" ? e.columnTemplateType ? e.columnTemplateType || "default" : e.columnTemplate && !e.onClickLinkCommand ? "custom" : e.columnTemplate && e.onClickLinkCommand ? "hyperlink" : "default" : ""
|
|
441
443
|
};
|
|
442
444
|
function Y(e, t, n) {
|
|
443
|
-
const
|
|
444
|
-
["/converter/appearance.converter",
|
|
445
|
-
["/converter/buttons.converter",
|
|
446
|
-
["/converter/property-editor.converter",
|
|
447
|
-
["/converter/items-count.converter",
|
|
448
|
-
["/converter/type.converter",
|
|
449
|
-
["/converter/change-editor.converter",
|
|
445
|
+
const a = /* @__PURE__ */ new Map([
|
|
446
|
+
["/converter/appearance.converter", Se],
|
|
447
|
+
["/converter/buttons.converter", Fe],
|
|
448
|
+
["/converter/property-editor.converter", Te],
|
|
449
|
+
["/converter/items-count.converter", ze],
|
|
450
|
+
["/converter/type.converter", we],
|
|
451
|
+
["/converter/change-editor.converter", he],
|
|
450
452
|
["/converter/change-formatter.converter", Oe],
|
|
451
453
|
["/converter/column-command.converter", Pe],
|
|
452
454
|
["/converter/column-option.converter", ke],
|
|
453
455
|
["/converter/summary.converter", Ee],
|
|
454
456
|
["/converter/group.converter", De],
|
|
455
|
-
["/converter/form-group-label.converter",
|
|
456
|
-
["/converter/field-selector.converter",
|
|
457
|
-
["/converter/pagination.converter",
|
|
457
|
+
["/converter/form-group-label.converter", Re],
|
|
458
|
+
["/converter/field-selector.converter", je],
|
|
459
|
+
["/converter/pagination.converter", Ne],
|
|
458
460
|
["/converter/row-number.converter", Me],
|
|
459
461
|
["/converter/grid-selection.converter", $e],
|
|
460
|
-
["/converter/size.converter",
|
|
461
|
-
["/converter/change-formatter-enum.converter",
|
|
462
|
-
["/converter/grid-sort.converter",
|
|
463
|
-
["/converter/grid-filter.converter",
|
|
464
|
-
["/converter/row-option.converter",
|
|
465
|
-
["/converter/change-formatter-type.converter",
|
|
462
|
+
["/converter/size.converter", Be],
|
|
463
|
+
["/converter/change-formatter-enum.converter", Le],
|
|
464
|
+
["/converter/grid-sort.converter", Ae],
|
|
465
|
+
["/converter/grid-filter.converter", qe],
|
|
466
|
+
["/converter/row-option.converter", _e],
|
|
467
|
+
["/converter/change-formatter-type.converter", Ie]
|
|
466
468
|
]), v = /* @__PURE__ */ new Map([
|
|
467
469
|
["string", { type: "input-group", enableClear: !1 }],
|
|
468
470
|
["boolean", {
|
|
@@ -488,97 +490,97 @@ function Y(e, t, n) {
|
|
|
488
490
|
["number", { type: "number-spinner", placeholder: "" }],
|
|
489
491
|
["events-editor", { type: "events-editor", hide: !0 }]
|
|
490
492
|
]), y = Ce();
|
|
491
|
-
function
|
|
493
|
+
function S(o, i) {
|
|
492
494
|
return () => y.parseValueSchema(o, i);
|
|
493
495
|
}
|
|
494
496
|
function x(o, i, c) {
|
|
495
|
-
return o.includes("visible") && i.visible !== void 0 ? typeof i.visible == "boolean" ? () => !!i.visible : i.visible === void 0 ? !0 :
|
|
497
|
+
return o.includes("visible") && i.visible !== void 0 ? typeof i.visible == "boolean" ? () => !!i.visible : i.visible === void 0 ? !0 : S(i.visible, c) : () => !0;
|
|
496
498
|
}
|
|
497
499
|
function g(o, i, c) {
|
|
498
|
-
return o.includes("readonly") && i.readonly !== void 0 ? typeof i.readonly == "boolean" ? () => !!i.readonly :
|
|
500
|
+
return o.includes("readonly") && i.readonly !== void 0 ? typeof i.readonly == "boolean" ? () => !!i.readonly : S(i.readonly, c) : () => !1;
|
|
499
501
|
}
|
|
500
502
|
function u(o, i) {
|
|
501
503
|
const c = o.$converter || i;
|
|
502
|
-
return typeof c == "string" && c &&
|
|
504
|
+
return typeof c == "string" && c && a.has(c) ? a.get(c) || null : c || null;
|
|
503
505
|
}
|
|
504
|
-
function
|
|
505
|
-
return Object.keys(o).map((
|
|
506
|
-
const d = D(1),
|
|
507
|
-
|
|
508
|
-
const
|
|
506
|
+
function f(o, i, c, p, b, T = "", P = "") {
|
|
507
|
+
return Object.keys(o).map((F) => {
|
|
508
|
+
const d = D(1), w = F, C = o[F], m = Object.keys(C), $ = C.title, N = C.type, M = v.get(N) || { type: "input-group", enableClear: !1 }, j = C.editor ? Object.assign({}, M, C.editor) : Object.assign({}, M), A = x(m, C, i), z = g(m, C, i);
|
|
509
|
+
j.readonly = j.readonly === void 0 ? z() : j.readonly;
|
|
510
|
+
const q = C.type === "cascade" ? f(C.properties, i, c, p, b, T, P) : [], _ = !0;
|
|
509
511
|
let k = u(C, P);
|
|
510
|
-
const ae =
|
|
512
|
+
const ae = B({
|
|
511
513
|
get() {
|
|
512
514
|
if (d.value) {
|
|
513
|
-
if (["class", "style"].find((de) => de ===
|
|
514
|
-
return k.convertFrom(c,
|
|
515
|
-
const E = c[
|
|
515
|
+
if (["class", "style"].find((de) => de === w) && !k && (k = a.get("/converter/appearance.converter") || null), k && k.convertFrom)
|
|
516
|
+
return k.convertFrom(c, F, b, T);
|
|
517
|
+
const E = c[F];
|
|
516
518
|
return Object.prototype.hasOwnProperty.call(C, "defaultValue") && (E === void 0 || typeof E == "string" && E === "") ? C.type === "boolean" ? C.defaultValue : C.defaultValue || "" : E;
|
|
517
519
|
}
|
|
518
520
|
return null;
|
|
519
521
|
},
|
|
520
522
|
set(E) {
|
|
521
|
-
d.value += 1, k && k.convertTo ? (k.convertTo(p,
|
|
523
|
+
d.value += 1, k && k.convertTo ? (k.convertTo(p, F, E, b, T), k.convertTo(c, F, E, b, T)) : (p[F] = E, c[F] = E);
|
|
522
524
|
}
|
|
523
|
-
}), { refreshPanelAfterChanged: le, description: ce, isExpand: ue, parentPropertyID: se } = C,
|
|
524
|
-
return i[
|
|
525
|
+
}), { refreshPanelAfterChanged: le, description: ce, isExpand: ue, parentPropertyID: se } = C, W = { propertyID: w, propertyName: $, propertyType: N, propertyValue: ae, editor: j, visible: A, readonly: z, cascadeConfig: q, hideCascadeTitle: _, refreshPanelAfterChanged: le, description: ce, isExpand: ue, parentPropertyID: se };
|
|
526
|
+
return i[w] = W, W;
|
|
525
527
|
});
|
|
526
528
|
}
|
|
527
529
|
function r(o, i, c = {}) {
|
|
528
530
|
const p = {}, b = e[o];
|
|
529
531
|
return b && b.categories ? Object.keys(b.categories).map((P) => {
|
|
530
|
-
const O = b.categories[P],
|
|
531
|
-
return { categoryId: P, categoryName:
|
|
532
|
+
const O = b.categories[P], F = O == null ? void 0 : O.title, d = f(O.properties || {}, p, {}, c, i);
|
|
533
|
+
return { categoryId: P, categoryName: F, properties: d };
|
|
532
534
|
}) : [];
|
|
533
535
|
}
|
|
534
|
-
function
|
|
535
|
-
const
|
|
536
|
+
function l(o, i, c, p, b = "") {
|
|
537
|
+
const T = i.$ref.schema, P = i.$ref.converter, O = c[T], F = O.type, d = n(O), w = {}, C = e[F];
|
|
536
538
|
if (C && C.categories) {
|
|
537
|
-
const
|
|
538
|
-
P && Object.keys(
|
|
539
|
-
|
|
539
|
+
const m = C.categories[o], $ = m == null ? void 0 : m.title;
|
|
540
|
+
P && Object.keys(m.properties).forEach((j) => {
|
|
541
|
+
m.properties[j].$converter = P;
|
|
540
542
|
});
|
|
541
|
-
const
|
|
543
|
+
const N = (m == null ? void 0 : m.properties) || {}, M = f(N, w, d, O, p, b);
|
|
542
544
|
return { categoryId: o, categoryName: $, properties: M };
|
|
543
545
|
}
|
|
544
546
|
return { categoryId: o, categoryName: "", properties: [] };
|
|
545
547
|
}
|
|
546
548
|
function s(o, i, c, p, b) {
|
|
547
|
-
const
|
|
548
|
-
let
|
|
549
|
-
if (!(
|
|
550
|
-
const
|
|
551
|
-
return Object.keys(
|
|
552
|
-
const
|
|
553
|
-
if (
|
|
554
|
-
|
|
549
|
+
const T = o.type, P = n(o), O = {};
|
|
550
|
+
let F = b || e[T];
|
|
551
|
+
if (!(F && Object.keys(F).length > 0) && c && c.getPropConfig && (F = c.getPropConfig(p)), F && F.categories) {
|
|
552
|
+
const w = [];
|
|
553
|
+
return Object.keys(F.categories).map((C) => {
|
|
554
|
+
const m = F.categories[C];
|
|
555
|
+
if (m.$ref) {
|
|
556
|
+
w.push(l(C, m, o, i, p));
|
|
555
557
|
return;
|
|
556
558
|
}
|
|
557
|
-
const $ =
|
|
558
|
-
|
|
559
|
-
}),
|
|
559
|
+
const $ = m == null ? void 0 : m.title, N = m == null ? void 0 : m.tabId, M = m == null ? void 0 : m.tabName, j = m == null ? void 0 : m.hide, A = m == null ? void 0 : m.hideTitle, z = f(m.properties || {}, O, P, o, i, p, m.$converter), { setPropertyRelates: q } = m, _ = m == null ? void 0 : m.parentPropertyID;
|
|
560
|
+
w.push({ categoryId: C, categoryName: $, tabId: N, tabName: M, hide: j, properties: z, hideTitle: A, setPropertyRelates: q, parentPropertyID: _ });
|
|
561
|
+
}), w;
|
|
560
562
|
}
|
|
561
563
|
return [];
|
|
562
564
|
}
|
|
563
565
|
return {
|
|
564
566
|
getPropertyConfigBySchema: s,
|
|
565
567
|
getPropertyConfigByType: r,
|
|
566
|
-
propertyConverterMap:
|
|
568
|
+
propertyConverterMap: a
|
|
567
569
|
};
|
|
568
570
|
}
|
|
569
571
|
const Z = {}, K = {};
|
|
570
572
|
Y(Z, K, ge);
|
|
571
|
-
const ee = {}, te = {}, { resolveSchemaWithDefaultValue:
|
|
572
|
-
Y(ne, oe,
|
|
573
|
-
function
|
|
574
|
-
return Q[t.title] = t, X[t.title] =
|
|
573
|
+
const ee = {}, te = {}, { resolveSchemaWithDefaultValue: We } = J(ee, te), ne = {}, oe = {};
|
|
574
|
+
Y(ne, oe, We);
|
|
575
|
+
function He(e, t, n = /* @__PURE__ */ new Map(), a = (S, x, g, u) => x, v = {}, y = (S) => S) {
|
|
576
|
+
return Q[t.title] = t, X[t.title] = a, Z[t.title] = v, K[t.title] = y, ee[t.title] = t, te[t.title] = a, ne[t.title] = v, oe[t.title] = y, (S = {}, x = !0) => {
|
|
575
577
|
if (!x)
|
|
576
|
-
return ye(
|
|
577
|
-
const g = be(
|
|
578
|
+
return ye(S, n);
|
|
579
|
+
const g = be(S, t, n), u = Object.keys(e).reduce((f, r) => (f[r] = e[r].default, f), {});
|
|
578
580
|
return Object.assign(u, g);
|
|
579
581
|
};
|
|
580
582
|
}
|
|
581
|
-
const
|
|
583
|
+
const Ge = "https://json-schema.org/draft/2020-12/schema", Ue = "https://farris-design.gitee.io/collection-property-editor.schema.json", Ve = "collection-property-editor", Je = "A Farris Component", Qe = "object", Xe = {
|
|
582
584
|
id: {
|
|
583
585
|
description: "The unique identifier for collection-property-editor",
|
|
584
586
|
type: "string"
|
|
@@ -630,8 +632,8 @@ const Ue = "https://json-schema.org/draft/2020-12/schema", We = "https://farris-
|
|
|
630
632
|
], Ze = [
|
|
631
633
|
"id"
|
|
632
634
|
], Ke = {
|
|
633
|
-
$schema:
|
|
634
|
-
$id:
|
|
635
|
+
$schema: Ge,
|
|
636
|
+
$id: Ue,
|
|
635
637
|
title: Ve,
|
|
636
638
|
description: Je,
|
|
637
639
|
type: Qe,
|
|
@@ -677,28 +679,28 @@ const Ue = "https://json-schema.org/draft/2020-12/schema", We = "https://farris-
|
|
|
677
679
|
type: String,
|
|
678
680
|
default: "编辑器"
|
|
679
681
|
}
|
|
680
|
-
}, et =
|
|
682
|
+
}, et = He(ie, Ke), tt = /* @__PURE__ */ V({
|
|
681
683
|
name: "CollectionPropertyContainer",
|
|
682
684
|
props: re,
|
|
683
685
|
emits: ["valueChange", "selectionChange"],
|
|
684
686
|
setup(e, t) {
|
|
685
|
-
const n = D(),
|
|
687
|
+
const n = D(), a = D(), {
|
|
686
688
|
idField: v,
|
|
687
689
|
textField: y,
|
|
688
|
-
defaultComponentSchema:
|
|
690
|
+
defaultComponentSchema: S,
|
|
689
691
|
isToolbarHidden: x
|
|
690
|
-
} = e, g = D(e.modelValue), u = D(),
|
|
691
|
-
|
|
692
|
-
const r = D(),
|
|
692
|
+
} = e, g = D(e.modelValue), u = D(), f = D("collection-property-editor");
|
|
693
|
+
H("useFormCommand", e.useFormCommand), H("useFormSchema", e.useFormSchema);
|
|
694
|
+
const r = D(), l = B(() => !g.value || g.value.length === 0), s = [{
|
|
693
695
|
field: y,
|
|
694
696
|
title: "名称",
|
|
695
697
|
width: 340,
|
|
696
698
|
resizable: !0,
|
|
697
699
|
dataType: "string"
|
|
698
|
-
}], o =
|
|
700
|
+
}], o = B(() => g.value.filter((d) => e.visibleCondition ? e.visibleCondition(d) : !0));
|
|
699
701
|
function i() {
|
|
700
|
-
const d =
|
|
701
|
-
return d[v] = d[v] + "_" +
|
|
702
|
+
const d = L(S), w = Math.random().toString().slice(2, 6);
|
|
703
|
+
return d[v] = d[v] + "_" + w, d[y] = d[y] + "_" + w, d;
|
|
702
704
|
}
|
|
703
705
|
function c() {
|
|
704
706
|
const d = i();
|
|
@@ -712,7 +714,7 @@ const Ue = "https://json-schema.org/draft/2020-12/schema", We = "https://farris-
|
|
|
712
714
|
const d = g.value.indexOf(r.value);
|
|
713
715
|
g.value.splice(d, 1), n.value.updateDataSource(o.value), p();
|
|
714
716
|
}
|
|
715
|
-
function
|
|
717
|
+
function T() {
|
|
716
718
|
if (!r.value)
|
|
717
719
|
return;
|
|
718
720
|
const d = g.value.indexOf(r.value);
|
|
@@ -728,35 +730,35 @@ const Ue = "https://json-schema.org/draft/2020-12/schema", We = "https://farris-
|
|
|
728
730
|
r.value = d[0], t.emit("selectionChange", {
|
|
729
731
|
selectedData: r,
|
|
730
732
|
propertyConfig: u
|
|
731
|
-
}),
|
|
733
|
+
}), a.value.updatePropertyConfig(u.value, r.value, !0);
|
|
732
734
|
}
|
|
733
|
-
function
|
|
735
|
+
function F() {
|
|
734
736
|
n.value.updateDataSource(o.value);
|
|
735
737
|
}
|
|
736
|
-
return
|
|
738
|
+
return me(() => {
|
|
737
739
|
p();
|
|
738
|
-
}), () =>
|
|
740
|
+
}), () => h("div", {
|
|
739
741
|
class: "f-utils-fill-flex-column h-100 pt-2 pl-2 border-bottom"
|
|
740
|
-
}, [
|
|
742
|
+
}, [h("div", {
|
|
741
743
|
hidden: x,
|
|
742
744
|
class: "border-bottom pb-2"
|
|
743
|
-
}, [
|
|
745
|
+
}, [h("button", {
|
|
744
746
|
class: "btn btn-primary mr-2",
|
|
745
747
|
onClick: c
|
|
746
|
-
}, [
|
|
748
|
+
}, [R("新增")]), h("button", {
|
|
747
749
|
class: "btn btn-secondary mr-2",
|
|
748
750
|
onClick: b
|
|
749
|
-
}, [
|
|
751
|
+
}, [R("删除")]), h("button", {
|
|
750
752
|
class: "btn btn-secondary mr-2",
|
|
751
753
|
onClick: P
|
|
752
|
-
}, [
|
|
754
|
+
}, [R("上移")]), h("button", {
|
|
753
755
|
class: "btn btn-secondary mr-2",
|
|
754
|
-
onClick:
|
|
755
|
-
}, [
|
|
756
|
+
onClick: T
|
|
757
|
+
}, [R("下移")])]), h("div", {
|
|
756
758
|
class: "f-utils-fill-flex-row"
|
|
757
|
-
}, [
|
|
759
|
+
}, [h("div", {
|
|
758
760
|
class: "f-utils-fill f-utils-overflow-auto"
|
|
759
|
-
}, [
|
|
761
|
+
}, [h(ve, {
|
|
760
762
|
ref: n,
|
|
761
763
|
columns: s,
|
|
762
764
|
data: o.value,
|
|
@@ -766,28 +768,28 @@ const Ue = "https://json-schema.org/draft/2020-12/schema", We = "https://farris-
|
|
|
766
768
|
fit: "true",
|
|
767
769
|
idField: v,
|
|
768
770
|
onSelectionChange: O
|
|
769
|
-
}, null)]),
|
|
770
|
-
hidden:
|
|
771
|
+
}, null)]), h("div", {
|
|
772
|
+
hidden: l.value,
|
|
771
773
|
style: "height:550px;display: flex;"
|
|
772
|
-
}, [
|
|
774
|
+
}, [h(pe, {
|
|
773
775
|
propertyConfig: u.value,
|
|
774
|
-
ref:
|
|
775
|
-
propertyName:
|
|
776
|
+
ref: a,
|
|
777
|
+
propertyName: f.value,
|
|
776
778
|
enableSearch: !1,
|
|
777
|
-
onPropertyChanged:
|
|
779
|
+
onPropertyChanged: F
|
|
778
780
|
}, null)])])]);
|
|
779
781
|
}
|
|
780
|
-
}),
|
|
782
|
+
}), I = /* @__PURE__ */ V({
|
|
781
783
|
name: "FCollectionPropertyEditor",
|
|
782
784
|
props: ie,
|
|
783
785
|
emits: ["valueChange", "selectionChange"],
|
|
784
786
|
setup(e, t) {
|
|
785
|
-
const n = D(),
|
|
786
|
-
let
|
|
787
|
-
return y.value && (e.visibleCondition ?
|
|
787
|
+
const n = D(), a = G("useFormCommand"), v = G("useFormSchema"), y = D(L(e.modelValue) || []), S = B(() => {
|
|
788
|
+
let l = 0;
|
|
789
|
+
return y.value && (e.visibleCondition ? l = y.value.filter(e.visibleCondition).length : l = y.value.length), `共 ${l || 0} 项`;
|
|
788
790
|
});
|
|
789
|
-
function x(
|
|
790
|
-
|
|
791
|
+
function x(l) {
|
|
792
|
+
l && l.forEach((s) => {
|
|
791
793
|
Object.keys(s).forEach((o) => {
|
|
792
794
|
o.indexOf("__fv") > -1 && delete s[o];
|
|
793
795
|
});
|
|
@@ -799,12 +801,12 @@ const Ue = "https://json-schema.org/draft/2020-12/schema", We = "https://farris-
|
|
|
799
801
|
function u() {
|
|
800
802
|
return !0;
|
|
801
803
|
}
|
|
802
|
-
function
|
|
803
|
-
selectedData:
|
|
804
|
+
function f({
|
|
805
|
+
selectedData: l,
|
|
804
806
|
propertyConfig: s
|
|
805
807
|
}) {
|
|
806
808
|
t.emit("selectionChange", {
|
|
807
|
-
selectedData:
|
|
809
|
+
selectedData: l,
|
|
808
810
|
propertyConfig: s
|
|
809
811
|
});
|
|
810
812
|
}
|
|
@@ -829,26 +831,26 @@ const Ue = "https://json-schema.org/draft/2020-12/schema", We = "https://farris-
|
|
|
829
831
|
handle: g
|
|
830
832
|
}]
|
|
831
833
|
};
|
|
832
|
-
return () =>
|
|
833
|
-
modelValue:
|
|
834
|
-
"onUpdate:modelValue": (
|
|
834
|
+
return () => h(fe, {
|
|
835
|
+
modelValue: S.value,
|
|
836
|
+
"onUpdate:modelValue": (l) => S.value = l,
|
|
835
837
|
editable: !1,
|
|
836
838
|
enableTitle: !0,
|
|
837
839
|
inputType: "text",
|
|
838
840
|
buttonBehavior: "Modal",
|
|
839
841
|
modalOptions: r
|
|
840
842
|
}, {
|
|
841
|
-
default: () => [
|
|
843
|
+
default: () => [h("div", {
|
|
842
844
|
class: "h-100 d-flex flex-column"
|
|
843
|
-
}, [
|
|
845
|
+
}, [h(tt, {
|
|
844
846
|
ref: n,
|
|
845
847
|
modelValue: y.value,
|
|
846
|
-
"onUpdate:modelValue": (
|
|
848
|
+
"onUpdate:modelValue": (l) => y.value = l,
|
|
847
849
|
idField: e.idField,
|
|
848
850
|
textField: e.textField,
|
|
849
851
|
defaultComponentSchema: e.defaultComponentSchema,
|
|
850
|
-
onSelectionChange:
|
|
851
|
-
useFormCommand:
|
|
852
|
+
onSelectionChange: f,
|
|
853
|
+
useFormCommand: a,
|
|
852
854
|
useFormSchema: v,
|
|
853
855
|
visibleCondition: e.visibleCondition
|
|
854
856
|
}, null)])]
|
|
@@ -856,10 +858,10 @@ const Ue = "https://json-schema.org/draft/2020-12/schema", We = "https://farris-
|
|
|
856
858
|
}
|
|
857
859
|
}), lt = {
|
|
858
860
|
install(e) {
|
|
859
|
-
e.component(
|
|
861
|
+
e.component(I.name, I);
|
|
860
862
|
},
|
|
861
|
-
register(e, t, n,
|
|
862
|
-
e["collection-property-editor"] =
|
|
863
|
+
register(e, t, n, a) {
|
|
864
|
+
e["collection-property-editor"] = I, t["collection-property-editor"] = et;
|
|
863
865
|
}
|
|
864
866
|
};
|
|
865
867
|
export {
|