@farris/ui-vue 1.3.5 → 1.3.6
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/accordion/index.esm.js +16 -16
- package/components/accordion/index.umd.cjs +1 -1
- package/components/avatar/index.esm.js +65 -65
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +13 -13
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +504 -490
- package/components/calendar/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +247 -233
- package/components/capsule/index.umd.cjs +1 -1
- package/components/checkbox/index.esm.js +356 -344
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/color-picker/index.esm.js +159 -145
- package/components/color-picker/index.umd.cjs +2 -2
- package/components/combo-list/index.esm.js +127 -128
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +15 -15
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/component/index.esm.js +101 -87
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +7 -5
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +181 -167
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.esm.js +4057 -4304
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +2450 -2467
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +789 -777
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.esm.js +3593 -3585
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/dropdown/index.esm.js +257 -243
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +322 -306
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +177 -163
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/event-parameter/index.esm.js +163 -2643
- package/components/event-parameter/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +500 -486
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/expression-editor/index.esm.js +37 -37
- package/components/expression-editor/index.umd.cjs +1 -1
- package/components/external-container/index.esm.js +485 -470
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.esm.js +2611 -2623
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.esm.js +3825 -3837
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.esm.js +3720 -3712
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +402 -388
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/input-group/index.esm.js +201 -202
- package/components/input-group/index.umd.cjs +1 -1
- package/components/layout/index.esm.js +264 -245
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +157 -143
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.esm.js +312 -296
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.esm.js +4748 -4992
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +4215 -4462
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +169 -155
- package/components/nav/index.umd.cjs +2 -2
- package/components/number-range/index.esm.js +150 -137
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +207 -194
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.esm.js +427 -414
- package/components/order/index.umd.cjs +1 -1
- package/components/page-footer/index.esm.js +22 -22
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +510 -492
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +192 -178
- package/components/pagination/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +234 -220
- package/components/progress/index.umd.cjs +3 -3
- package/components/property-editor/index.esm.js +288 -277
- package/components/property-editor/index.umd.cjs +2 -2
- package/components/property-panel/index.esm.js +62 -61
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.esm.js +3015 -3027
- package/components/query-solution/index.umd.cjs +5 -5
- package/components/radio-button/index.esm.js +64 -64
- package/components/radio-button/index.umd.cjs +1 -1
- package/components/radio-group/index.esm.js +293 -280
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/rate/index.esm.js +222 -208
- package/components/rate/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +187 -173
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.esm.js +554 -542
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +483 -469
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +632 -617
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/search-box/index.esm.js +228 -214
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +419 -406
- package/components/section/index.umd.cjs +1 -1
- package/components/smoke-detector/index.esm.js +162 -148
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/splitter/index.esm.js +308 -284
- package/components/splitter/index.umd.cjs +1 -1
- package/components/step/index.esm.js +279 -265
- package/components/step/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +183 -170
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +307 -294
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tags/index.esm.js +320 -306
- package/components/tags/index.umd.cjs +1 -1
- package/components/text/index.esm.js +245 -231
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +260 -247
- package/components/textarea/index.umd.cjs +1 -1
- package/components/time-picker/index.esm.js +409 -396
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/transfer/index.esm.js +424 -410
- package/components/transfer/index.umd.cjs +1 -1
- package/components/tree-grid/index.esm.js +2994 -3006
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +749 -733
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +325 -311
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +304 -290
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +99 -85
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +947 -933
- package/components/weather/index.umd.cjs +4 -4
- package/farris.all.esm.js +7750 -7990
- package/farris.all.umd.cjs +12 -12
- package/package.json +1 -1
- package/types/data-view/composition/types.d.ts +0 -1
- package/types/entity-binding-selector/composition/use-entity-tree.d.ts +3 -0
- package/types/entity-binding-selector/composition/use-field-tree.d.ts +1 -0
- package/components/event-parameter/index.css +0 -1
- package/types/data-grid/src/components/data/data-grid-area.component.d.ts +0 -8
- package/types/data-grid/src/components/data/data-grid-area.props.d.ts +0 -3
|
@@ -1,48 +1,62 @@
|
|
|
1
|
-
import { defineComponent as j, createVNode as
|
|
2
|
-
import { isPlainObject as
|
|
1
|
+
import { defineComponent as j, createVNode as O, nextTick as _, ref as w, inject as F, computed as G, onMounted as W } from "vue";
|
|
2
|
+
import { isPlainObject as B, cloneDeep as N } from "lodash-es";
|
|
3
3
|
import "bignumber.js";
|
|
4
|
-
const
|
|
5
|
-
function A(
|
|
6
|
-
const { properties: e, title: t, ignore:
|
|
7
|
-
if (t && (!
|
|
8
|
-
const
|
|
9
|
-
c.id = `${
|
|
4
|
+
const $ = {}, V = {};
|
|
5
|
+
function A(o) {
|
|
6
|
+
const { properties: e, title: t, ignore: a } = o, r = a && Array.isArray(a), c = Object.keys(e).reduce((n, u) => ((!r || !a.find((y) => y === u)) && (n[u] = e[u].type === "object" && e[u].properties ? A(e[u]) : N(e[u].default)), n), {});
|
|
7
|
+
if (t && (!r || !a.find((n) => n === "id"))) {
|
|
8
|
+
const n = t.toLowerCase().replace(/-/g, "_");
|
|
9
|
+
c.id = `${n}_${Math.random().toString().slice(2, 6)}`;
|
|
10
10
|
}
|
|
11
11
|
return c;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
const
|
|
15
|
-
if (
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
function U(o) {
|
|
14
|
+
const { properties: e, title: t, required: a } = o;
|
|
15
|
+
if (a && Array.isArray(a)) {
|
|
16
|
+
const r = a.reduce((c, n) => (c[n] = e[n].type === "object" && e[n].properties ? A(e[n]) : N(e[n].default), c), {});
|
|
17
|
+
if (t && a.find((c) => c === "id")) {
|
|
18
|
+
const c = t.toLowerCase().replace(/-/g, "_");
|
|
19
|
+
r.id = `${c}_${Math.random().toString().slice(2, 6)}`;
|
|
20
|
+
}
|
|
21
|
+
return r;
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
type: t
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function q(o, e = {}, t) {
|
|
28
|
+
const a = $[o];
|
|
29
|
+
if (a) {
|
|
30
|
+
let r = U(a);
|
|
31
|
+
const c = V[o];
|
|
32
|
+
return r = c ? c({ getSchemaByType: q }, r, e, t) : r, r;
|
|
19
33
|
}
|
|
20
34
|
return null;
|
|
21
35
|
}
|
|
22
|
-
function
|
|
36
|
+
function z(o, e) {
|
|
23
37
|
const t = A(e);
|
|
24
|
-
return Object.keys(t).reduce((
|
|
38
|
+
return Object.keys(t).reduce((a, r) => (Object.prototype.hasOwnProperty.call(o, r) && (a[r] && B(a[r]) && B(o[r] || !o[r]) ? Object.assign(a[r], o[r] || {}) : a[r] = o[r]), a), t), t;
|
|
25
39
|
}
|
|
26
|
-
function
|
|
27
|
-
return Object.keys(
|
|
28
|
-
if (e.has(
|
|
29
|
-
const c = e.get(
|
|
40
|
+
function Q(o, e) {
|
|
41
|
+
return Object.keys(o).filter((a) => o[a] != null).reduce((a, r) => {
|
|
42
|
+
if (e.has(r)) {
|
|
43
|
+
const c = e.get(r);
|
|
30
44
|
if (typeof c == "string")
|
|
31
|
-
|
|
45
|
+
a[c] = o[r];
|
|
32
46
|
else {
|
|
33
|
-
const
|
|
34
|
-
Object.assign(
|
|
47
|
+
const n = c(r, o[r], o);
|
|
48
|
+
Object.assign(a, n);
|
|
35
49
|
}
|
|
36
50
|
} else
|
|
37
|
-
r
|
|
38
|
-
return
|
|
51
|
+
a[r] = o[r];
|
|
52
|
+
return a;
|
|
39
53
|
}, {});
|
|
40
54
|
}
|
|
41
|
-
function
|
|
42
|
-
const
|
|
43
|
-
return
|
|
55
|
+
function J(o, e, t = /* @__PURE__ */ new Map()) {
|
|
56
|
+
const a = z(o, e);
|
|
57
|
+
return Q(a, t);
|
|
44
58
|
}
|
|
45
|
-
function
|
|
59
|
+
function X(o = {}) {
|
|
46
60
|
function e(i, s, l, p) {
|
|
47
61
|
if (typeof l == "number")
|
|
48
62
|
return p[i].length === l;
|
|
@@ -60,12 +74,12 @@ function J(n = {}) {
|
|
|
60
74
|
function t(i, s, l, p) {
|
|
61
75
|
return p[i] && p[i].propertyValue && String(p[i].propertyValue.value) === String(l);
|
|
62
76
|
}
|
|
63
|
-
const
|
|
77
|
+
const a = /* @__PURE__ */ new Map([
|
|
64
78
|
["length", e],
|
|
65
79
|
["getProperty", t]
|
|
66
80
|
]);
|
|
67
|
-
Object.keys(
|
|
68
|
-
function
|
|
81
|
+
Object.keys(o).reduce((i, s) => (i.set(s, o[s]), i), a);
|
|
82
|
+
function r(i, s) {
|
|
69
83
|
const l = i;
|
|
70
84
|
return typeof s == "number" ? [{ target: l, operator: "length", param: null, value: Number(s) }] : typeof s == "boolean" ? [{ target: l, operator: "getProperty", param: i, value: !!s }] : typeof s == "object" ? Object.keys(s).map((p) => {
|
|
71
85
|
if (p === "length")
|
|
@@ -76,27 +90,27 @@ function J(n = {}) {
|
|
|
76
90
|
}
|
|
77
91
|
function c(i) {
|
|
78
92
|
return Object.keys(i).reduce((l, p) => {
|
|
79
|
-
const m =
|
|
93
|
+
const m = r(p, i[p]);
|
|
80
94
|
return l.push(...m), l;
|
|
81
95
|
}, []);
|
|
82
96
|
}
|
|
83
|
-
function
|
|
84
|
-
if (
|
|
85
|
-
const l =
|
|
97
|
+
function n(i, s) {
|
|
98
|
+
if (a.has(i.operator)) {
|
|
99
|
+
const l = a.get(i.operator);
|
|
86
100
|
return l && l(i.target, i.param, i.value, s) || !1;
|
|
87
101
|
}
|
|
88
102
|
return !1;
|
|
89
103
|
}
|
|
90
104
|
function u(i, s) {
|
|
91
|
-
return c(i).reduce((m, h) => m &&
|
|
105
|
+
return c(i).reduce((m, h) => m && n(h, s), !0);
|
|
92
106
|
}
|
|
93
107
|
function y(i, s) {
|
|
94
|
-
const l = Object.keys(i), p = l.includes("allOf"), m = l.includes("anyOf"), h = p || m, C = (h ? i[h ? p ? "allOf" : "anyOf" : "allOf"] : [i]).map((
|
|
108
|
+
const l = Object.keys(i), p = l.includes("allOf"), m = l.includes("anyOf"), h = p || m, C = (h ? i[h ? p ? "allOf" : "anyOf" : "allOf"] : [i]).map((k) => u(k, s));
|
|
95
109
|
return p ? !C.includes(!1) : C.includes(!0);
|
|
96
110
|
}
|
|
97
111
|
return { parseValueSchema: y };
|
|
98
112
|
}
|
|
99
|
-
const
|
|
113
|
+
const g = {
|
|
100
114
|
button: { type: "button", name: "按钮", icon: "Button" },
|
|
101
115
|
"response-toolbar": { type: "response-toolbar", name: "工具栏", icon: "ButtonGroup" },
|
|
102
116
|
"response-toolbar-item": { type: "response-toolbar-item", name: "按钮", icon: "Button" },
|
|
@@ -136,20 +150,20 @@ const T = {
|
|
|
136
150
|
"tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏", icon: "TabToolbar" },
|
|
137
151
|
fieldset: { type: "fieldset", name: "分组", icon: "fieldset" },
|
|
138
152
|
"query-solution": { type: "query-solution", name: "筛选方案", icon: "QueryScheme" }
|
|
139
|
-
},
|
|
140
|
-
|
|
141
|
-
function
|
|
142
|
-
return
|
|
143
|
-
const u =
|
|
153
|
+
}, Y = {}, Z = {};
|
|
154
|
+
X();
|
|
155
|
+
function H(o, e, t = /* @__PURE__ */ new Map(), a = (n, u, y, i) => u, r = {}, c = (n) => n) {
|
|
156
|
+
return $[e.title] = e, V[e.title] = a, Y[e.title] = r, Z[e.title] = c, (n = {}) => {
|
|
157
|
+
const u = J(n, e, t), y = Object.keys(o).reduce((i, s) => (i[s] = o[s].default, i), {});
|
|
144
158
|
return Object.assign(y, u);
|
|
145
159
|
};
|
|
146
160
|
}
|
|
147
|
-
function
|
|
161
|
+
function K(o, e) {
|
|
148
162
|
return { customClass: e.class, customStyle: e.style };
|
|
149
163
|
}
|
|
150
|
-
const
|
|
151
|
-
["appearance",
|
|
152
|
-
]),
|
|
164
|
+
const x = /* @__PURE__ */ new Map([
|
|
165
|
+
["appearance", K]
|
|
166
|
+
]), I = "https://json-schema.org/draft/2020-12/schema", ee = "https://farris-design.gitee.io/content-container.schema.json", te = "content-container", ne = "A Farris Container Component", oe = "object", re = {
|
|
153
167
|
id: {
|
|
154
168
|
description: "The unique identifier for a Section",
|
|
155
169
|
type: "string"
|
|
@@ -199,15 +213,15 @@ const K = /* @__PURE__ */ new Map([
|
|
|
199
213
|
"id",
|
|
200
214
|
"type",
|
|
201
215
|
"contents"
|
|
202
|
-
],
|
|
203
|
-
$schema:
|
|
204
|
-
$id:
|
|
205
|
-
title:
|
|
206
|
-
description:
|
|
207
|
-
type:
|
|
208
|
-
properties:
|
|
216
|
+
], ce = {
|
|
217
|
+
$schema: I,
|
|
218
|
+
$id: ee,
|
|
219
|
+
title: te,
|
|
220
|
+
description: ne,
|
|
221
|
+
type: oe,
|
|
222
|
+
properties: re,
|
|
209
223
|
required: ae
|
|
210
|
-
},
|
|
224
|
+
}, ie = "content-container", se = "A Farris Container Component", le = "object", pe = {
|
|
211
225
|
basic: {
|
|
212
226
|
description: "Basic Infomation",
|
|
213
227
|
title: "基本信息",
|
|
@@ -250,125 +264,125 @@ const K = /* @__PURE__ */ new Map([
|
|
|
250
264
|
}
|
|
251
265
|
}
|
|
252
266
|
}
|
|
253
|
-
},
|
|
254
|
-
title:
|
|
255
|
-
description:
|
|
256
|
-
type:
|
|
257
|
-
categories:
|
|
267
|
+
}, ue = {
|
|
268
|
+
title: ie,
|
|
269
|
+
description: se,
|
|
270
|
+
type: le,
|
|
271
|
+
categories: pe
|
|
258
272
|
};
|
|
259
|
-
function
|
|
273
|
+
function fe(o, e, t) {
|
|
260
274
|
return e;
|
|
261
275
|
}
|
|
262
276
|
const P = {
|
|
263
277
|
customClass: { type: String, default: "" },
|
|
264
278
|
customStyle: { type: String, default: "" }
|
|
265
|
-
},
|
|
279
|
+
}, E = H(P, ce, x, fe, ue), L = /* @__PURE__ */ j({
|
|
266
280
|
name: "FContentContainer",
|
|
267
281
|
props: P,
|
|
268
282
|
emits: [],
|
|
269
|
-
setup(
|
|
270
|
-
return () =>
|
|
271
|
-
class:
|
|
272
|
-
style:
|
|
283
|
+
setup(o, e) {
|
|
284
|
+
return () => O("div", {
|
|
285
|
+
class: o.customClass,
|
|
286
|
+
style: o.customStyle
|
|
273
287
|
}, [e.slots.default && e.slots.default()]);
|
|
274
288
|
}
|
|
275
289
|
});
|
|
276
|
-
function
|
|
277
|
-
function
|
|
278
|
-
var
|
|
290
|
+
function me() {
|
|
291
|
+
function o(e, t) {
|
|
292
|
+
var n;
|
|
279
293
|
if (!e)
|
|
280
294
|
return !1;
|
|
281
|
-
const
|
|
282
|
-
if (!
|
|
295
|
+
const a = ((n = e.targetContainer) == null ? void 0 : n.componentInstance) && e.targetContainer.componentInstance.value;
|
|
296
|
+
if (!a)
|
|
283
297
|
return !1;
|
|
284
|
-
const
|
|
285
|
-
return !((e.componentCategory === "input" || e.componentType === "form-group") && ![
|
|
298
|
+
const r = a.schema.type, c = t == null ? void 0 : t.formSchemaUtils.getComponentById(a.belongedComponentId);
|
|
299
|
+
return !((e.componentCategory === "input" || e.componentType === "form-group") && ![g["response-layout-item"].type, g["response-form"].type].includes(r) || (e.componentType === g.tabs.type || e.componentType === g.section.type) && ((c == null ? void 0 : c.componentType) !== "frame" || ![g["content-container"].type, g["splitter-pane"].type, g["response-layout-item"].type].includes(r)));
|
|
286
300
|
}
|
|
287
301
|
return {
|
|
288
|
-
basalDragulaRuleForContainer:
|
|
302
|
+
basalDragulaRuleForContainer: o
|
|
289
303
|
};
|
|
290
304
|
}
|
|
291
|
-
class
|
|
305
|
+
class ye {
|
|
292
306
|
getTemplateRule(e, t) {
|
|
293
|
-
const
|
|
294
|
-
if (!
|
|
307
|
+
const a = t == null ? void 0 : t.formSchemaUtils, r = a == null ? void 0 : a.getFormTemplateRule(), c = { canAccept: !0, canDelete: !0, canMove: !0 };
|
|
308
|
+
if (!r)
|
|
295
309
|
return c;
|
|
296
|
-
const
|
|
310
|
+
const n = this.getComponentContext(e), { componentClassList: u } = n;
|
|
297
311
|
return u.forEach((y) => {
|
|
298
|
-
if (!y || !
|
|
312
|
+
if (!y || !r[y])
|
|
299
313
|
return;
|
|
300
|
-
const { canMove: i, canDelete: s, canAccept: l } =
|
|
301
|
-
c.canMove = c.canMove && this.resolveRuleValue(i,
|
|
314
|
+
const { canMove: i, canDelete: s, canAccept: l } = r[y];
|
|
315
|
+
c.canMove = c.canMove && this.resolveRuleValue(i, n), c.canDelete = c.canDelete && this.resolveRuleValue(s, n), c.canAccept = c.canAccept && this.resolveRuleValue(l, n);
|
|
302
316
|
}), c;
|
|
303
317
|
}
|
|
304
318
|
resolveRuleValue(e, t) {
|
|
305
319
|
return typeof e == "boolean" ? e : this.parseRuleValueSchema(e, t);
|
|
306
320
|
}
|
|
307
321
|
parseRuleValueSchema(e, t) {
|
|
308
|
-
const
|
|
309
|
-
let
|
|
310
|
-
for (const c of
|
|
322
|
+
const a = e.invalidContext || [];
|
|
323
|
+
let r = !0;
|
|
324
|
+
for (const c of a) {
|
|
311
325
|
if (c.firstLevelChild) {
|
|
312
326
|
if (c.firstLevelChild.class) {
|
|
313
|
-
const { firstLevelChildClassList:
|
|
314
|
-
if (
|
|
315
|
-
|
|
327
|
+
const { firstLevelChildClassList: n } = t;
|
|
328
|
+
if (n && !n.includes(c.firstLevelChild.class)) {
|
|
329
|
+
r = !1;
|
|
316
330
|
continue;
|
|
317
331
|
}
|
|
318
332
|
}
|
|
319
333
|
if (c.firstLevelChild.type) {
|
|
320
|
-
const { firstLevelChildSchema:
|
|
321
|
-
if (!
|
|
322
|
-
|
|
334
|
+
const { firstLevelChildSchema: n } = t;
|
|
335
|
+
if (!n || n.type !== c.firstLevelChild.type) {
|
|
336
|
+
r = !1;
|
|
323
337
|
continue;
|
|
324
338
|
}
|
|
325
339
|
}
|
|
326
340
|
}
|
|
327
341
|
if (c.secondLevelChild) {
|
|
328
342
|
if (c.secondLevelChild.class) {
|
|
329
|
-
const { secondLevelChildClassList:
|
|
330
|
-
if (
|
|
331
|
-
|
|
343
|
+
const { secondLevelChildClassList: n } = t;
|
|
344
|
+
if (n && !n.includes(c.secondLevelChild.class)) {
|
|
345
|
+
r = !1;
|
|
332
346
|
continue;
|
|
333
347
|
}
|
|
334
348
|
}
|
|
335
349
|
if (c.secondLevelChild.type) {
|
|
336
|
-
const { secondLevelChildSchema:
|
|
337
|
-
if (!
|
|
338
|
-
|
|
350
|
+
const { secondLevelChildSchema: n } = t;
|
|
351
|
+
if (!n || n.type !== c.secondLevelChild.type) {
|
|
352
|
+
r = !1;
|
|
339
353
|
continue;
|
|
340
354
|
}
|
|
341
355
|
}
|
|
342
356
|
}
|
|
343
357
|
if (c.parent) {
|
|
344
358
|
if (c.parent.class) {
|
|
345
|
-
const { parentClassList:
|
|
346
|
-
if (
|
|
347
|
-
|
|
359
|
+
const { parentClassList: n } = t;
|
|
360
|
+
if (n && !n.includes(c.parent.class)) {
|
|
361
|
+
r = !1;
|
|
348
362
|
continue;
|
|
349
363
|
}
|
|
350
364
|
}
|
|
351
365
|
if (c.parent.type) {
|
|
352
|
-
const { parentSchema:
|
|
353
|
-
if (
|
|
354
|
-
|
|
366
|
+
const { parentSchema: n } = t;
|
|
367
|
+
if (n && n.type !== c.parent.type) {
|
|
368
|
+
r = !1;
|
|
355
369
|
continue;
|
|
356
370
|
}
|
|
357
371
|
}
|
|
358
372
|
}
|
|
359
|
-
|
|
373
|
+
r = !0;
|
|
360
374
|
break;
|
|
361
375
|
}
|
|
362
|
-
return !
|
|
376
|
+
return !r;
|
|
363
377
|
}
|
|
364
378
|
getComponentContext(e) {
|
|
365
|
-
var
|
|
366
|
-
const t = e.schema,
|
|
379
|
+
var T, D, C, M;
|
|
380
|
+
const t = e.schema, a = t.appearance && t.appearance.class || "", r = a.split(" ") || [], c = t.contents || [], n = c.length ? c[0] : null, u = n && n.appearance ? n.appearance.class : "", y = u ? u.split(" ") : [], i = (T = n == null ? void 0 : n.contents) != null && T.length ? n == null ? void 0 : n.contents[0] : null, s = i && i.appearance ? i.appearance.class : "", l = s ? s.split(" ") : [], p = t.type === "component" ? (C = (D = e.parent) == null ? void 0 : D.parent) == null ? void 0 : C.schema : (M = e.parent) == null ? void 0 : M.schema, m = p && p.appearance && p.appearance.class || "", h = m ? m.split(" ") : [];
|
|
367
381
|
return {
|
|
368
|
-
componentClass:
|
|
369
|
-
componentClassList:
|
|
382
|
+
componentClass: a,
|
|
383
|
+
componentClassList: r,
|
|
370
384
|
childContents: c,
|
|
371
|
-
firstLevelChildSchema:
|
|
385
|
+
firstLevelChildSchema: n,
|
|
372
386
|
firstLevelChildClass: u,
|
|
373
387
|
firstLevelChildClassList: y,
|
|
374
388
|
secondLevelChildSchema: i,
|
|
@@ -380,45 +394,45 @@ class me {
|
|
|
380
394
|
};
|
|
381
395
|
}
|
|
382
396
|
}
|
|
383
|
-
function
|
|
384
|
-
const t =
|
|
385
|
-
function
|
|
386
|
-
if (!
|
|
397
|
+
function he(o, e) {
|
|
398
|
+
const t = o.schema, a = new ye();
|
|
399
|
+
function r(s) {
|
|
400
|
+
if (!me().basalDragulaRuleForContainer(s, e))
|
|
387
401
|
return !1;
|
|
388
|
-
const { canAccept: p } =
|
|
402
|
+
const { canAccept: p } = a.getTemplateRule(o, e);
|
|
389
403
|
return p;
|
|
390
404
|
}
|
|
391
405
|
function c(s) {
|
|
392
|
-
|
|
406
|
+
_();
|
|
393
407
|
}
|
|
394
|
-
function
|
|
408
|
+
function n() {
|
|
395
409
|
return t.componentType ? "display:inherit;flex-direction:inherit;margin-bottom:10px" : "";
|
|
396
410
|
}
|
|
397
411
|
function u() {
|
|
398
|
-
const { canMove: s } =
|
|
412
|
+
const { canMove: s } = a.getTemplateRule(o, e);
|
|
399
413
|
return s;
|
|
400
414
|
}
|
|
401
415
|
function y() {
|
|
402
|
-
const { canDelete: s } =
|
|
416
|
+
const { canDelete: s } = a.getTemplateRule(o, e);
|
|
403
417
|
return s;
|
|
404
418
|
}
|
|
405
419
|
function i() {
|
|
406
|
-
const { canMove: s, canDelete: l } =
|
|
420
|
+
const { canMove: s, canDelete: l } = a.getTemplateRule(o, e);
|
|
407
421
|
return !s && !l;
|
|
408
422
|
}
|
|
409
423
|
return {
|
|
410
|
-
canAccepts:
|
|
411
|
-
getStyles:
|
|
424
|
+
canAccepts: r,
|
|
425
|
+
getStyles: n,
|
|
412
426
|
onAcceptMovedChildElement: c,
|
|
413
427
|
checkCanMoveComponent: u,
|
|
414
428
|
checkCanDeleteComponent: y,
|
|
415
429
|
hideNestedPaddingInDesginerView: i
|
|
416
430
|
};
|
|
417
431
|
}
|
|
418
|
-
function
|
|
419
|
-
var
|
|
420
|
-
const
|
|
421
|
-
function
|
|
432
|
+
function de(o, e, t) {
|
|
433
|
+
var S;
|
|
434
|
+
const a = t && t.getStyles && t.getStyles() || "", r = t && t.getDesignerClass && t.getDesignerClass() || "", c = w();
|
|
435
|
+
function n() {
|
|
422
436
|
return (e == null ? void 0 : e.schema.componentType) === "frame" ? !1 : t && t.checkCanMoveComponent ? t.checkCanMoveComponent() : !0;
|
|
423
437
|
}
|
|
424
438
|
function u() {
|
|
@@ -435,7 +449,7 @@ function he(n, e, t) {
|
|
|
435
449
|
return null;
|
|
436
450
|
if (f.value.schema && f.value.schema.type === "component")
|
|
437
451
|
return f.value;
|
|
438
|
-
const d =
|
|
452
|
+
const d = w(f == null ? void 0 : f.value.parent), b = s(d);
|
|
439
453
|
return b || null;
|
|
440
454
|
}
|
|
441
455
|
function l(f = e) {
|
|
@@ -450,12 +464,12 @@ function he(n, e, t) {
|
|
|
450
464
|
}
|
|
451
465
|
function h() {
|
|
452
466
|
}
|
|
453
|
-
function
|
|
467
|
+
function T(f, d) {
|
|
454
468
|
d && t != null && t.onAcceptMovedChildElement && t.onAcceptMovedChildElement(d);
|
|
455
469
|
}
|
|
456
470
|
function D(f, d) {
|
|
457
471
|
const { componentType: b } = f;
|
|
458
|
-
let v =
|
|
472
|
+
let v = q(b, f, d);
|
|
459
473
|
t && t.onResolveNewComponentSchema && (v = t.onResolveNewComponentSchema(f, v));
|
|
460
474
|
const R = b.toLowerCase().replace(/-/g, "_");
|
|
461
475
|
return v && !v.id && v.type === b && (v.id = `${R}_${Math.random().toString().slice(2, 6)}`), v;
|
|
@@ -466,88 +480,88 @@ function he(n, e, t) {
|
|
|
466
480
|
if (t && t.getPropsConfig)
|
|
467
481
|
return t.getPropsConfig(...f);
|
|
468
482
|
}
|
|
469
|
-
function
|
|
483
|
+
function k() {
|
|
470
484
|
t && t.onRemoveComponent && t.onRemoveComponent(), e != null && e.schema.contents && e.schema.contents.map((f) => {
|
|
471
485
|
var v;
|
|
472
486
|
let d = f.id;
|
|
473
487
|
f.type === "component-ref" && (d = f.component);
|
|
474
|
-
const b =
|
|
488
|
+
const b = o.value.querySelector(`#${d}-design-item`);
|
|
475
489
|
(v = b == null ? void 0 : b.componentInstance) != null && v.value.onRemoveComponent && b.componentInstance.value.onRemoveComponent();
|
|
476
490
|
});
|
|
477
491
|
}
|
|
478
492
|
return c.value = {
|
|
479
|
-
canMove:
|
|
493
|
+
canMove: n(),
|
|
480
494
|
canSelectParent: u(),
|
|
481
495
|
canDelete: y(),
|
|
482
496
|
canNested: !i(),
|
|
483
497
|
contents: e == null ? void 0 : e.schema.contents,
|
|
484
|
-
elementRef:
|
|
485
|
-
parent: (
|
|
498
|
+
elementRef: o,
|
|
499
|
+
parent: (S = e == null ? void 0 : e.parent) == null ? void 0 : S.componentInstance,
|
|
486
500
|
schema: e == null ? void 0 : e.schema,
|
|
487
|
-
styles:
|
|
488
|
-
designerClass:
|
|
501
|
+
styles: a,
|
|
502
|
+
designerClass: r,
|
|
489
503
|
canAccepts: p,
|
|
490
504
|
getBelongedComponentInstance: s,
|
|
491
505
|
getDraggableDesignItemElement: l,
|
|
492
506
|
getDraggingDisplayText: m,
|
|
493
507
|
getPropConfig: M,
|
|
494
508
|
getDragScopeElement: h,
|
|
495
|
-
onAcceptMovedChildElement:
|
|
509
|
+
onAcceptMovedChildElement: T,
|
|
496
510
|
onChildElementMovedOut: C,
|
|
497
511
|
addNewChildComponentSchema: D,
|
|
498
|
-
triggerBelongedComponentToMoveWhenMoved: !!t && t.triggerBelongedComponentToMoveWhenMoved ||
|
|
499
|
-
triggerBelongedComponentToDeleteWhenDeleted: !!t && t.triggerBelongedComponentToDeleteWhenDeleted ||
|
|
500
|
-
onRemoveComponent:
|
|
512
|
+
triggerBelongedComponentToMoveWhenMoved: !!t && t.triggerBelongedComponentToMoveWhenMoved || w(!1),
|
|
513
|
+
triggerBelongedComponentToDeleteWhenDeleted: !!t && t.triggerBelongedComponentToDeleteWhenDeleted || w(!1),
|
|
514
|
+
onRemoveComponent: k
|
|
501
515
|
}, c;
|
|
502
516
|
}
|
|
503
|
-
const
|
|
504
|
-
function
|
|
505
|
-
let
|
|
517
|
+
const be = ["moz", "ms", "webkit"];
|
|
518
|
+
function ve() {
|
|
519
|
+
let o = 0;
|
|
506
520
|
return (e) => {
|
|
507
|
-
const t = (/* @__PURE__ */ new Date()).getTime(),
|
|
508
|
-
e(t +
|
|
509
|
-
},
|
|
510
|
-
return
|
|
521
|
+
const t = (/* @__PURE__ */ new Date()).getTime(), a = Math.max(0, 16 - (t - o)), r = setTimeout(() => {
|
|
522
|
+
e(t + a);
|
|
523
|
+
}, a);
|
|
524
|
+
return o = t + a, r;
|
|
511
525
|
};
|
|
512
526
|
}
|
|
513
|
-
function
|
|
527
|
+
function Ce() {
|
|
514
528
|
if (typeof window > "u")
|
|
515
529
|
return () => 0;
|
|
516
530
|
if (window.requestAnimationFrame)
|
|
517
531
|
return window.requestAnimationFrame.bind(window);
|
|
518
|
-
const
|
|
519
|
-
return
|
|
532
|
+
const o = be.filter((e) => `${e}RequestAnimationFrame` in window)[0];
|
|
533
|
+
return o ? window[`${o}RequestAnimationFrame`] : ve();
|
|
520
534
|
}
|
|
521
|
-
|
|
522
|
-
function
|
|
523
|
-
return ((e == null ? void 0 : e.split(" ")) || []).reduce((
|
|
535
|
+
Ce();
|
|
536
|
+
function ge(o, e) {
|
|
537
|
+
return ((e == null ? void 0 : e.split(" ")) || []).reduce((a, r) => (r && (a[r] = !0), a), o), o;
|
|
524
538
|
}
|
|
525
539
|
const Te = /* @__PURE__ */ j({
|
|
526
540
|
name: "FContentContainerDesign",
|
|
527
541
|
props: P,
|
|
528
542
|
emits: [],
|
|
529
|
-
setup(
|
|
530
|
-
const t =
|
|
543
|
+
setup(o, e) {
|
|
544
|
+
const t = w(), a = F("designer-host-service"), r = F("design-item-context"), c = he(r, a), n = de(t, r, c), u = G(() => ge({
|
|
531
545
|
"drag-container": !0
|
|
532
|
-
},
|
|
546
|
+
}, o == null ? void 0 : o.customClass));
|
|
533
547
|
return W(() => {
|
|
534
|
-
t.value.componentInstance =
|
|
535
|
-
}), e.expose(
|
|
548
|
+
t.value.componentInstance = n;
|
|
549
|
+
}), e.expose(n.value), () => O("div", {
|
|
536
550
|
ref: t,
|
|
537
551
|
class: u.value,
|
|
538
|
-
style:
|
|
539
|
-
"data-dragref": `${
|
|
552
|
+
style: o.customStyle,
|
|
553
|
+
"data-dragref": `${r.schema.id}-container`
|
|
540
554
|
}, [e.slots.default && e.slots.default()]);
|
|
541
555
|
}
|
|
542
556
|
}), ke = {
|
|
543
|
-
install(
|
|
544
|
-
|
|
557
|
+
install(o) {
|
|
558
|
+
o.component(L.name, L);
|
|
545
559
|
},
|
|
546
|
-
register(
|
|
547
|
-
|
|
560
|
+
register(o, e, t, a) {
|
|
561
|
+
o["content-container"] = L, e["content-container"] = E;
|
|
548
562
|
},
|
|
549
|
-
registerDesigner(
|
|
550
|
-
|
|
563
|
+
registerDesigner(o, e, t) {
|
|
564
|
+
o["content-container"] = Te, e["content-container"] = E;
|
|
551
565
|
}
|
|
552
566
|
};
|
|
553
567
|
export {
|
|
@@ -555,5 +569,5 @@ export {
|
|
|
555
569
|
Te as ContentContainerDesign,
|
|
556
570
|
P as contentContainerProps,
|
|
557
571
|
ke as default,
|
|
558
|
-
|
|
572
|
+
E as propsResolver
|
|
559
573
|
};
|