@farris/ui-vue 1.3.4 → 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 +9 -7
- 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 +746 -730
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +9 -7
- 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 +3096 -3069
- 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 +78 -82
- package/components/event-parameter/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +501 -487
- 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 +487 -472
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.esm.js +440 -433
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.esm.js +594 -587
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.esm.js +2766 -2739
- 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 +314 -298
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.esm.js +862 -843
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +1031 -1015
- 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 +776 -770
- package/components/query-solution/index.umd.cjs +6 -6
- 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 +296 -283
- 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 +634 -619
- 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 +383 -376
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +595 -575
- 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 +5492 -5470
- package/farris.all.umd.cjs +13 -13
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/condition/src/composition/condition-value/input-group-value.d.ts +1 -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
|
@@ -1,32 +1,46 @@
|
|
|
1
1
|
var z = Object.defineProperty;
|
|
2
2
|
var J = (n, e, t) => e in n ? z(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
-
var
|
|
4
|
-
import { defineComponent as
|
|
5
|
-
import { isPlainObject as
|
|
3
|
+
var P = (n, e, t) => J(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { defineComponent as j, onBeforeMount as X, onMounted as F, createVNode as N, ref as D, inject as $, computed as Y } from "vue";
|
|
5
|
+
import { isPlainObject as S, cloneDeep as U } from "lodash-es";
|
|
6
6
|
import { getCustomClass as Z } from "../common/index.esm.js";
|
|
7
|
-
const
|
|
8
|
-
function
|
|
9
|
-
const { properties: e, title: t, ignore: o } = n, a = o && Array.isArray(o), c = Object.keys(e).reduce((r, f) => ((!a || !o.find((m) => m === f)) && (r[f] = e[f].type === "object" && e[f].properties ?
|
|
7
|
+
const q = {}, R = {};
|
|
8
|
+
function A(n) {
|
|
9
|
+
const { properties: e, title: t, ignore: o } = n, a = o && Array.isArray(o), c = Object.keys(e).reduce((r, f) => ((!a || !o.find((m) => m === f)) && (r[f] = e[f].type === "object" && e[f].properties ? A(e[f]) : U(e[f].default)), r), {});
|
|
10
10
|
if (t && (!a || !o.find((r) => r === "id"))) {
|
|
11
11
|
const r = t.toLowerCase().replace(/-/g, "_");
|
|
12
12
|
c.id = `${r}_${Math.random().toString().slice(2, 6)}`;
|
|
13
13
|
}
|
|
14
14
|
return c;
|
|
15
15
|
}
|
|
16
|
+
function I(n) {
|
|
17
|
+
const { properties: e, title: t, required: o } = n;
|
|
18
|
+
if (o && Array.isArray(o)) {
|
|
19
|
+
const a = o.reduce((c, r) => (c[r] = e[r].type === "object" && e[r].properties ? A(e[r]) : U(e[r].default), c), {});
|
|
20
|
+
if (t && o.find((c) => c === "id")) {
|
|
21
|
+
const c = t.toLowerCase().replace(/-/g, "_");
|
|
22
|
+
a.id = `${c}_${Math.random().toString().slice(2, 6)}`;
|
|
23
|
+
}
|
|
24
|
+
return a;
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
type: t
|
|
28
|
+
};
|
|
29
|
+
}
|
|
16
30
|
function G(n, e = {}, t) {
|
|
17
|
-
const o =
|
|
31
|
+
const o = q[n];
|
|
18
32
|
if (o) {
|
|
19
|
-
let a =
|
|
20
|
-
const c =
|
|
33
|
+
let a = I(o);
|
|
34
|
+
const c = R[n];
|
|
21
35
|
return a = c ? c({ getSchemaByType: G }, a, e, t) : a, a;
|
|
22
36
|
}
|
|
23
37
|
return null;
|
|
24
38
|
}
|
|
25
|
-
function I(n, e) {
|
|
26
|
-
const t = U(e);
|
|
27
|
-
return Object.keys(t).reduce((o, a) => (o[a] && $(o[a]) && $(n[a] || !n[a]) ? Object.assign(o[a], n[a] || {}) : o[a] = n[a], o), t), t;
|
|
28
|
-
}
|
|
29
39
|
function K(n, e) {
|
|
40
|
+
const t = A(e);
|
|
41
|
+
return Object.keys(t).reduce((o, a) => (Object.prototype.hasOwnProperty.call(n, a) && (o[a] && S(o[a]) && S(n[a] || !n[a]) ? Object.assign(o[a], n[a] || {}) : o[a] = n[a]), o), t), t;
|
|
42
|
+
}
|
|
43
|
+
function H(n, e) {
|
|
30
44
|
return Object.keys(n).filter((o) => n[o] != null).reduce((o, a) => {
|
|
31
45
|
if (e.has(a)) {
|
|
32
46
|
const c = e.get(a);
|
|
@@ -41,11 +55,11 @@ function K(n, e) {
|
|
|
41
55
|
return o;
|
|
42
56
|
}, {});
|
|
43
57
|
}
|
|
44
|
-
function
|
|
45
|
-
const o =
|
|
46
|
-
return
|
|
58
|
+
function x(n, e, t = /* @__PURE__ */ new Map()) {
|
|
59
|
+
const o = K(n, e);
|
|
60
|
+
return H(o, t);
|
|
47
61
|
}
|
|
48
|
-
function
|
|
62
|
+
function ee(n = {}) {
|
|
49
63
|
function e(i, s, l, p) {
|
|
50
64
|
if (typeof l == "number")
|
|
51
65
|
return p[i].length === l;
|
|
@@ -94,12 +108,12 @@ function x(n = {}) {
|
|
|
94
108
|
return c(i).reduce((d, v) => d && r(v, s), !0);
|
|
95
109
|
}
|
|
96
110
|
function m(i, s) {
|
|
97
|
-
const l = Object.keys(i), p = l.includes("allOf"), d = l.includes("anyOf"), v = p || d, M = (v ? i[v ? p ? "allOf" : "anyOf" : "allOf"] : [i]).map((
|
|
111
|
+
const l = Object.keys(i), p = l.includes("allOf"), d = l.includes("anyOf"), v = p || d, M = (v ? i[v ? p ? "allOf" : "anyOf" : "allOf"] : [i]).map((V) => f(V, s));
|
|
98
112
|
return p ? !M.includes(!1) : M.includes(!0);
|
|
99
113
|
}
|
|
100
114
|
return { parseValueSchema: m };
|
|
101
115
|
}
|
|
102
|
-
const
|
|
116
|
+
const te = {
|
|
103
117
|
button: { type: "button", name: "按钮", icon: "Button" },
|
|
104
118
|
"response-toolbar": { type: "response-toolbar", name: "工具栏", icon: "ButtonGroup" },
|
|
105
119
|
"response-toolbar-item": { type: "response-toolbar-item", name: "按钮", icon: "Button" },
|
|
@@ -139,20 +153,20 @@ const ee = {
|
|
|
139
153
|
"tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏", icon: "TabToolbar" },
|
|
140
154
|
fieldset: { type: "fieldset", name: "分组", icon: "fieldset" },
|
|
141
155
|
"query-solution": { type: "query-solution", name: "筛选方案", icon: "QueryScheme" }
|
|
142
|
-
},
|
|
143
|
-
|
|
144
|
-
function
|
|
145
|
-
return
|
|
146
|
-
const f =
|
|
156
|
+
}, ne = {}, oe = {};
|
|
157
|
+
ee();
|
|
158
|
+
function _(n, e, t = /* @__PURE__ */ new Map(), o = (r, f, m, i) => f, a = {}, c = (r) => r) {
|
|
159
|
+
return q[e.title] = e, R[e.title] = o, ne[e.title] = a, oe[e.title] = c, (r = {}) => {
|
|
160
|
+
const f = x(r, e, t), m = Object.keys(n).reduce((i, s) => (i[s] = n[s].default, i), {});
|
|
147
161
|
return Object.assign(m, f);
|
|
148
162
|
};
|
|
149
163
|
}
|
|
150
|
-
function
|
|
164
|
+
function re(n, e) {
|
|
151
165
|
return { customClass: e.class, customStyle: e.style };
|
|
152
166
|
}
|
|
153
|
-
const
|
|
154
|
-
["appearance",
|
|
155
|
-
]), ae = "https://json-schema.org/draft/2020-12/schema",
|
|
167
|
+
const W = /* @__PURE__ */ new Map([
|
|
168
|
+
["appearance", re]
|
|
169
|
+
]), ae = "https://json-schema.org/draft/2020-12/schema", ce = "https://farris-design.gitee.io/component.schema.json", ie = "component", se = "A Farris Visual Component", le = "object", pe = {
|
|
156
170
|
id: {
|
|
157
171
|
description: "The unique identifier for a component",
|
|
158
172
|
type: "string"
|
|
@@ -203,18 +217,18 @@ const _ = /* @__PURE__ */ new Map([
|
|
|
203
217
|
type: "string",
|
|
204
218
|
default: ""
|
|
205
219
|
}
|
|
206
|
-
},
|
|
220
|
+
}, ue = [
|
|
207
221
|
"id",
|
|
208
222
|
"type",
|
|
209
223
|
"contents"
|
|
210
|
-
],
|
|
224
|
+
], fe = {
|
|
211
225
|
$schema: ae,
|
|
212
|
-
$id:
|
|
213
|
-
title:
|
|
214
|
-
description:
|
|
215
|
-
type:
|
|
216
|
-
properties:
|
|
217
|
-
required:
|
|
226
|
+
$id: ce,
|
|
227
|
+
title: ie,
|
|
228
|
+
description: se,
|
|
229
|
+
type: le,
|
|
230
|
+
properties: pe,
|
|
231
|
+
required: ue
|
|
218
232
|
};
|
|
219
233
|
function Q(n, e, t) {
|
|
220
234
|
return e;
|
|
@@ -225,21 +239,21 @@ const L = {
|
|
|
225
239
|
customStyle: { type: String, default: "" },
|
|
226
240
|
componentType: { type: String, default: "" },
|
|
227
241
|
formColumns: { type: Number, default: 4 }
|
|
228
|
-
},
|
|
242
|
+
}, O = _(L, fe, W, Q), Se = Object.assign({}, L, { componentId: { type: String, default: "" } }), B = /* @__PURE__ */ j({
|
|
229
243
|
name: "FComponent",
|
|
230
244
|
props: L,
|
|
231
245
|
emits: ["init", "afterViewInit"],
|
|
232
246
|
setup(n, e) {
|
|
233
247
|
return X(() => {
|
|
234
248
|
e.emit("init", n.id);
|
|
235
|
-
}),
|
|
249
|
+
}), F(() => {
|
|
236
250
|
e.emit("afterViewInit", n.id);
|
|
237
|
-
}), () =>
|
|
251
|
+
}), () => N("div", {
|
|
238
252
|
class: n.customClass
|
|
239
253
|
}, [e.slots.default && e.slots.default()]);
|
|
240
254
|
}
|
|
241
255
|
});
|
|
242
|
-
function
|
|
256
|
+
function me(n, e, t) {
|
|
243
257
|
var T;
|
|
244
258
|
const o = t && t.getStyles && t.getStyles() || "", a = t && t.getDesignerClass && t.getDesignerClass() || "", c = D();
|
|
245
259
|
function r() {
|
|
@@ -290,7 +304,7 @@ function fe(n, e, t) {
|
|
|
290
304
|
if (t && t.getPropsConfig)
|
|
291
305
|
return t.getPropsConfig(...u);
|
|
292
306
|
}
|
|
293
|
-
function
|
|
307
|
+
function V() {
|
|
294
308
|
t && t.onRemoveComponent && t.onRemoveComponent(), e != null && e.schema.contents && e.schema.contents.map((u) => {
|
|
295
309
|
var C;
|
|
296
310
|
let w = u.id;
|
|
@@ -321,10 +335,10 @@ function fe(n, e, t) {
|
|
|
321
335
|
addNewChildComponentSchema: h,
|
|
322
336
|
triggerBelongedComponentToMoveWhenMoved: !!t && t.triggerBelongedComponentToMoveWhenMoved || D(!1),
|
|
323
337
|
triggerBelongedComponentToDeleteWhenDeleted: !!t && t.triggerBelongedComponentToDeleteWhenDeleted || D(!1),
|
|
324
|
-
onRemoveComponent:
|
|
338
|
+
onRemoveComponent: V
|
|
325
339
|
}, c;
|
|
326
340
|
}
|
|
327
|
-
class
|
|
341
|
+
class de {
|
|
328
342
|
getTemplateRule(e, t) {
|
|
329
343
|
const o = t == null ? void 0 : t.formSchemaUtils, a = o == null ? void 0 : o.getFormTemplateRule(), c = { canAccept: !0, canDelete: !0, canMove: !0 };
|
|
330
344
|
if (!a)
|
|
@@ -416,20 +430,20 @@ class me {
|
|
|
416
430
|
};
|
|
417
431
|
}
|
|
418
432
|
}
|
|
419
|
-
class
|
|
433
|
+
class he {
|
|
420
434
|
constructor(e, t) {
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
435
|
+
P(this, "componentId");
|
|
436
|
+
P(this, "viewModelId");
|
|
437
|
+
P(this, "eventsEditorUtils");
|
|
438
|
+
P(this, "formSchemaUtils");
|
|
439
|
+
P(this, "formMetadataConverter");
|
|
440
|
+
P(this, "designViewModelUtils");
|
|
441
|
+
P(this, "designViewModelField");
|
|
442
|
+
P(this, "controlCreatorUtils");
|
|
443
|
+
P(this, "designerHostService");
|
|
444
|
+
P(this, "schemaService", null);
|
|
445
|
+
P(this, "metadataService", null);
|
|
446
|
+
P(this, "propertyConfig", {
|
|
433
447
|
type: "object",
|
|
434
448
|
categories: {}
|
|
435
449
|
});
|
|
@@ -472,7 +486,7 @@ class de {
|
|
|
472
486
|
type: "combo-list",
|
|
473
487
|
textField: "name",
|
|
474
488
|
valueField: "value",
|
|
475
|
-
data: [{ value: e.type, name:
|
|
489
|
+
data: [{ value: e.type, name: te[e.type].name }]
|
|
476
490
|
}
|
|
477
491
|
}
|
|
478
492
|
}
|
|
@@ -508,11 +522,11 @@ class de {
|
|
|
508
522
|
const o = t && t.parent && t.parent.schema;
|
|
509
523
|
if (!o)
|
|
510
524
|
return;
|
|
511
|
-
const a = o.contents.findIndex((r) => r.id === e), c =
|
|
525
|
+
const a = o.contents.findIndex((r) => r.id === e), c = U(o.contents[a]);
|
|
512
526
|
o.contents.splice(a, 1), o.contents.splice(a, 0, c);
|
|
513
527
|
}
|
|
514
528
|
}
|
|
515
|
-
class
|
|
529
|
+
class ye extends he {
|
|
516
530
|
constructor(e, t) {
|
|
517
531
|
super(e, t);
|
|
518
532
|
}
|
|
@@ -550,8 +564,8 @@ class he extends de {
|
|
|
550
564
|
};
|
|
551
565
|
}
|
|
552
566
|
}
|
|
553
|
-
function
|
|
554
|
-
const t = new
|
|
567
|
+
function ge(n, e) {
|
|
568
|
+
const t = new de(), { canMove: o, canDelete: a } = t.getTemplateRule(n, e);
|
|
555
569
|
function c() {
|
|
556
570
|
return !1;
|
|
557
571
|
}
|
|
@@ -568,13 +582,13 @@ function ye(n, e) {
|
|
|
568
582
|
return " display: inherit;flex-direction: inherit;margin-bottom:10px";
|
|
569
583
|
}
|
|
570
584
|
function s(y) {
|
|
571
|
-
const h = new
|
|
585
|
+
const h = new ye(y, e), { schema: M } = n;
|
|
572
586
|
return h.getPropertyConfig(M);
|
|
573
587
|
}
|
|
574
588
|
function l() {
|
|
575
|
-
var
|
|
589
|
+
var V, T, u, w;
|
|
576
590
|
const y = n == null ? void 0 : n.schema, M = (e == null ? void 0 : e.formSchemaUtils).getViewModelIdByComponentId(y.id);
|
|
577
|
-
if (y.componentType !== "data-grid" && y.componentType !== "form" || !((
|
|
591
|
+
if (y.componentType !== "data-grid" && y.componentType !== "form" || !((V = n.componentInstance) != null && V.value.parent))
|
|
578
592
|
return;
|
|
579
593
|
const g = (T = n.componentInstance) == null ? void 0 : T.value.parent.schema;
|
|
580
594
|
if ((u = g == null ? void 0 : g.toolbar) != null && u.buttons && g.toolbar.buttons.length) {
|
|
@@ -597,9 +611,9 @@ function ye(n, e) {
|
|
|
597
611
|
}
|
|
598
612
|
function d() {
|
|
599
613
|
const y = e == null ? void 0 : e.designViewModelUtils, h = e == null ? void 0 : e.formSchemaUtils, M = n == null ? void 0 : n.schema, g = h.getViewModelIdByComponentId(M.id);
|
|
600
|
-
y.getDgViewModel(g).fields.forEach((
|
|
614
|
+
y.getDgViewModel(g).fields.forEach((V) => {
|
|
601
615
|
if (h.getExpressions() && h.getExpressions().length) {
|
|
602
|
-
const T = h.getExpressions().findIndex((u) => u.fieldId ===
|
|
616
|
+
const T = h.getExpressions().findIndex((u) => u.fieldId === V.id);
|
|
603
617
|
T > -1 && h.getExpressions().splice(T, 1);
|
|
604
618
|
}
|
|
605
619
|
});
|
|
@@ -609,25 +623,25 @@ function ye(n, e) {
|
|
|
609
623
|
}
|
|
610
624
|
return { canAccepts: c, checkCanDeleteComponent: r, checkCanMoveComponent: f, hideNestedPaddingInDesginerView: m, getStyles: i, getPropsConfig: s, onRemoveComponent: v };
|
|
611
625
|
}
|
|
612
|
-
const
|
|
626
|
+
const be = /* @__PURE__ */ j({
|
|
613
627
|
name: "FComponetDesign",
|
|
614
628
|
props: L,
|
|
615
629
|
emits: [],
|
|
616
630
|
setup(n, e) {
|
|
617
|
-
const t = D(), o =
|
|
631
|
+
const t = D(), o = $("designer-host-service"), a = $("design-item-context"), c = ge(a, o), r = me(t, a, c), f = Y(() => Z({
|
|
618
632
|
"drag-container": !0
|
|
619
633
|
}, n == null ? void 0 : n.customClass));
|
|
620
|
-
return
|
|
634
|
+
return F(() => {
|
|
621
635
|
var m, i, s, l;
|
|
622
636
|
t.value.componentInstance = r, ((i = (m = a.parent) == null ? void 0 : m.schema) == null ? void 0 : i.type) === "component-ref" && (r.value.parent = (l = (s = a.parent) == null ? void 0 : s.parent) == null ? void 0 : l.componentInstance);
|
|
623
|
-
}), e.expose(r.value), () =>
|
|
637
|
+
}), e.expose(r.value), () => N("div", {
|
|
624
638
|
ref: t,
|
|
625
639
|
class: f.value,
|
|
626
640
|
style: n.customStyle,
|
|
627
641
|
"data-dragref": `${a.schema.id}-container`
|
|
628
642
|
}, [e.slots.default && e.slots.default()]);
|
|
629
643
|
}
|
|
630
|
-
}),
|
|
644
|
+
}), ve = "https://json-schema.org/draft/2020-12/schema", Me = "https://farris-design.gitee.io/component.schema.json", we = "component-ref", Ce = "A Farris Visual Component", Pe = "object", Ve = {
|
|
631
645
|
id: {
|
|
632
646
|
description: "The unique identifier for a Section",
|
|
633
647
|
type: "string"
|
|
@@ -642,37 +656,37 @@ const ge = /* @__PURE__ */ O({
|
|
|
642
656
|
type: "string",
|
|
643
657
|
default: ""
|
|
644
658
|
}
|
|
645
|
-
},
|
|
659
|
+
}, Te = [
|
|
646
660
|
"id",
|
|
647
661
|
"type",
|
|
648
662
|
"component"
|
|
649
|
-
],
|
|
650
|
-
$schema:
|
|
651
|
-
$id:
|
|
652
|
-
title:
|
|
653
|
-
description:
|
|
654
|
-
type:
|
|
663
|
+
], De = {
|
|
664
|
+
$schema: ve,
|
|
665
|
+
$id: Me,
|
|
666
|
+
title: we,
|
|
667
|
+
description: Ce,
|
|
668
|
+
type: Pe,
|
|
655
669
|
properties: Ve,
|
|
656
|
-
required:
|
|
657
|
-
},
|
|
670
|
+
required: Te
|
|
671
|
+
}, Ee = {
|
|
658
672
|
id: { type: String },
|
|
659
673
|
component: { type: String, default: "" }
|
|
660
|
-
},
|
|
674
|
+
}, ke = _(Ee, De, W, Q), Oe = {
|
|
661
675
|
install(n) {
|
|
662
676
|
n.component(B.name, B);
|
|
663
677
|
},
|
|
664
678
|
register(n, e, t, o) {
|
|
665
|
-
n.component = B, e.component =
|
|
679
|
+
n.component = B, e.component = O;
|
|
666
680
|
},
|
|
667
681
|
registerDesigner(n, e) {
|
|
668
|
-
n.component =
|
|
682
|
+
n.component = be, e.component = O, e["component-ref"] = ke;
|
|
669
683
|
}
|
|
670
684
|
};
|
|
671
685
|
export {
|
|
672
686
|
B as Component,
|
|
673
|
-
|
|
674
|
-
|
|
687
|
+
be as ComponentDesign,
|
|
688
|
+
Se as componentDesignProps,
|
|
675
689
|
L as componentProps,
|
|
676
|
-
|
|
677
|
-
|
|
690
|
+
Oe as default,
|
|
691
|
+
O as propsResolver
|
|
678
692
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(h,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("vue"),require("lodash-es"),require("../common/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../common/index.umd.js"],f):(h=typeof globalThis<"u"?globalThis:h||self,f(h.component={},h.Vue,h.LodashES,h.common))})(this,function(h,f,D,_){"use strict";var ie=Object.defineProperty;var ce=(h,f,D)=>f in h?ie(h,f,{enumerable:!0,configurable:!0,writable:!0,value:D}):h[f]=D;var T=(h,f,D)=>ce(h,typeof f!="symbol"?f+"":f,D);const A={},O={};function j(o){const{properties:e,title:t,ignore:n}=o,r=n&&Array.isArray(n),i=Object.keys(e).reduce((a,d)=>((!r||!n.find(m=>m===d))&&(a[d]=e[d].type==="object"&&e[d].properties?j(e[d]):D.cloneDeep(e[d].default)),a),{});if(t&&(!r||!n.find(a=>a==="id"))){const a=t.toLowerCase().replace(/-/g,"_");i.id=`${a}_${Math.random().toString().slice(2,6)}`}return i}function F(o,e={},t){const n=A[o];if(n){let r=j(n);const i=O[o];return r=i?i({getSchemaByType:F},r,e,t):r,r}return null}function W(o,e){const t=j(e);return Object.keys(t).reduce((n,r)=>(n[r]&&D.isPlainObject(n[r])&&D.isPlainObject(o[r]||!o[r])?Object.assign(n[r],o[r]||{}):n[r]=o[r],n),t),t}function Q(o,e){return Object.keys(o).filter(n=>o[n]!=null).reduce((n,r)=>{if(e.has(r)){const i=e.get(r);if(typeof i=="string")n[i]=o[r];else{const a=i(r,o[r],o);Object.assign(n,a)}}else n[r]=o[r];return n},{})}function z(o,e,t=new Map){const n=W(o,e);return Q(n,t)}function J(o={}){function e(c,s,l,p){if(typeof l=="number")return p[c].length===l;if(typeof l=="object"){const y=Object.keys(l)[0],w=l[y];if(y==="not")return Number(p[c].length)!==Number(w);if(y==="moreThan")return Number(p[c].length)>=Number(w);if(y==="lessThan")return Number(p[c].length)<=Number(w)}return!1}function t(c,s,l,p){return p[c]&&p[c].propertyValue&&String(p[c].propertyValue.value)===String(l)}const n=new Map([["length",e],["getProperty",t]]);Object.keys(o).reduce((c,s)=>(c.set(s,o[s]),c),n);function r(c,s){const l=c;return typeof s=="number"?[{target:l,operator:"length",param:null,value:Number(s)}]:typeof s=="boolean"?[{target:l,operator:"getProperty",param:c,value:!!s}]:typeof s=="object"?Object.keys(s).map(p=>{if(p==="length")return{target:l,operator:"length",param:null,value:s[p]};const y=p,w=s[p];return{target:l,operator:"getProperty",param:y,value:w}}):[]}function i(c){return Object.keys(c).reduce((l,p)=>{const y=r(p,c[p]);return l.push(...y),l},[])}function a(c,s){if(n.has(c.operator)){const l=n.get(c.operator);return l&&l(c.target,c.param,c.value,s)||!1}return!1}function d(c,s){return i(c).reduce((y,w)=>y&&a(w,s),!0)}function m(c,s){const l=Object.keys(c),p=l.includes("allOf"),y=l.includes("anyOf"),w=p||y,C=(w?c[w?p?"allOf":"anyOf":"allOf"]:[c]).map($=>d($,s));return p?!C.includes(!1):C.includes(!0)}return{parseValueSchema:m}}const X={button:{type:"button",name:"按钮",icon:"Button"},"response-toolbar":{type:"response-toolbar",name:"工具栏",icon:"ButtonGroup"},"response-toolbar-item":{type:"response-toolbar-item",name:"按钮",icon:"Button"},"content-container":{type:"content-container",name:"容器",icon:"ContentContainer"},"input-group":{type:"input-group",name:"文本",icon:"TextBox"},textarea:{type:"textarea",name:"多行文本",icon:"MultiTextBox"},lookup:{type:"lookup",name:"帮助",icon:"LookupEdit"},"number-spinner":{type:"number-spinner",name:"数值",icon:"NumericBox"},"date-picker":{type:"date-picker",name:"日期",icon:"DateBox"},switch:{type:"switch",name:"开关",icon:"SwitchField"},"radio-group":{type:"radio-group",name:"单选组",icon:"RadioGroup"},"check-box":{type:"check-box",name:"复选框",icon:"CheckBox"},"check-group":{type:"check-group",name:"复选框组",icon:"CheckGroup"},"combo-list":{type:"combo-list",name:"下拉列表",icon:"EnumField"},"response-form":{type:"response-form",name:"卡片面板",icon:"Form"},"response-layout":{type:"response-layout",name:"布局容器",icon:"ResponseLayout3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"ResponseLayout1"},"tree-grid":{type:"tree-grid",name:"树表格",icon:"TreeGrid"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格",icon:"DataGrid"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块",icon:"Module"},component:{type:"component",name:"组件",icon:"Component"},tabs:{type:"tabs",name:"标签页",icon:"Tab"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮",icon:"Button"},"time-picker":{type:"time-picker",name:"时间选择",icon:"TimePicker"},section:{type:"section",name:"分组面板",icon:"Section"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板",icon:"Splitter"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传",icon:"FileUpload"},"page-header":{type:"page-header",name:"页头",icon:"Header"},"page-footer":{type:"page-footer",name:"页脚",icon:"ModalFooter"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏",icon:"TabToolbar"},fieldset:{type:"fieldset",name:"分组",icon:"fieldset"},"query-solution":{type:"query-solution",name:"筛选方案",icon:"QueryScheme"}},Y={},Z={};J();function N(o,e,t=new Map,n=(a,d,m,c)=>d,r={},i=a=>a){return A[e.title]=e,O[e.title]=n,Y[e.title]=r,Z[e.title]=i,(a={})=>{const d=z(a,e,t),m=Object.keys(o).reduce((c,s)=>(c[s]=o[s].default,c),{});return Object.assign(m,d)}}function I(o,e){return{customClass:e.class,customStyle:e.style}}const q=new Map([["appearance",I]]),K={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/component.schema.json",title:"component",description:"A Farris Visual Component",type:"object",properties:{id:{description:"The unique identifier for a component",type:"string"},type:{description:"The type string of component",type:"string",default:"component"},componentType:{description:"The type string of component",type:"string"},viewModel:{description:"The viewModel string of component",type:"string"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},visible:{description:"",type:"boolean",default:!0},onInit:{description:"初始化事件",type:"string",default:""},onAfterViewInit:{description:"视图初始化后事件",type:"string",default:""}},required:["id","type","contents"]};function R(o,e,t){return e}const k={id:{type:String},customClass:{type:String,default:""},customStyle:{type:String,default:""},componentType:{type:String,default:""},formColumns:{type:Number,default:4}},S=N(k,K,q,R),H=Object.assign({},k,{componentId:{type:String,default:""}}),L=f.defineComponent({name:"FComponent",props:k,emits:["init","afterViewInit"],setup(o,e){return f.onBeforeMount(()=>{e.emit("init",o.id)}),f.onMounted(()=>{e.emit("afterViewInit",o.id)}),()=>f.createVNode("div",{class:o.customClass},[e.slots.default&&e.slots.default()])}});function x(o,e,t){var E;const n=t&&t.getStyles&&t.getStyles()||"",r=t&&t.getDesignerClass&&t.getDesignerClass()||"",i=f.ref();function a(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanMoveComponent?t.checkCanMoveComponent():!0}function d(){return!1}function m(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanDeleteComponent?t.checkCanDeleteComponent():!0}function c(){return(e==null?void 0:e.schema.componentType)==="frame"?!0:t&&t.hideNestedPaddingInDesginerView?t.hideNestedPaddingInDesginerView():!1}function s(u){if(!u||!u.value)return null;if(u.value.schema&&u.value.schema.type==="component")return u.value;const P=f.ref(u==null?void 0:u.value.parent),v=s(P);return v||null}function l(u=e){const{componentInstance:P,designerItemElementRef:v}=u;return!P||!P.value?null:P.value.canMove?v:l(u.parent)}function p(u){return!!t&&t.canAccepts(u)}function y(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function w(){}function b(u,P){P&&t!=null&&t.onAcceptMovedChildElement&&t.onAcceptMovedChildElement(P)}function g(u,P){const{componentType:v}=u;let V=F(v,u,P);t&&t.onResolveNewComponentSchema&&(V=t.onResolveNewComponentSchema(u,V));const B=v.toLowerCase().replace(/-/g,"_");return V&&!V.id&&V.type===v&&(V.id=`${B}_${Math.random().toString().slice(2,6)}`),V}function C(u){}function M(...u){if(t&&t.getPropsConfig)return t.getPropsConfig(...u)}function $(){t&&t.onRemoveComponent&&t.onRemoveComponent(),e!=null&&e.schema.contents&&e.schema.contents.map(u=>{var V;let P=u.id;u.type==="component-ref"&&(P=u.component);const v=o.value.querySelector(`#${P}-design-item`);(V=v==null?void 0:v.componentInstance)!=null&&V.value.onRemoveComponent&&v.componentInstance.value.onRemoveComponent()})}return i.value={canMove:a(),canSelectParent:d(),canDelete:m(),canNested:!c(),contents:e==null?void 0:e.schema.contents,elementRef:o,parent:(E=e==null?void 0:e.parent)==null?void 0:E.componentInstance,schema:e==null?void 0:e.schema,styles:n,designerClass:r,canAccepts:p,getBelongedComponentInstance:s,getDraggableDesignItemElement:l,getDraggingDisplayText:y,getPropConfig:M,getDragScopeElement:w,onAcceptMovedChildElement:b,onChildElementMovedOut:C,addNewChildComponentSchema:g,triggerBelongedComponentToMoveWhenMoved:!!t&&t.triggerBelongedComponentToMoveWhenMoved||f.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!t&&t.triggerBelongedComponentToDeleteWhenDeleted||f.ref(!1),onRemoveComponent:$},i}class ee{getTemplateRule(e,t){const n=t==null?void 0:t.formSchemaUtils,r=n==null?void 0:n.getFormTemplateRule(),i={canAccept:!0,canDelete:!0,canMove:!0};if(!r)return i;const a=this.getComponentContext(e),{componentClassList:d}=a;return d.forEach(m=>{if(!m||!r[m])return;const{canMove:c,canDelete:s,canAccept:l}=r[m];i.canMove=i.canMove&&this.resolveRuleValue(c,a),i.canDelete=i.canDelete&&this.resolveRuleValue(s,a),i.canAccept=i.canAccept&&this.resolveRuleValue(l,a)}),i}resolveRuleValue(e,t){return typeof e=="boolean"?e:this.parseRuleValueSchema(e,t)}parseRuleValueSchema(e,t){const n=e.invalidContext||[];let r=!0;for(const i of n){if(i.firstLevelChild){if(i.firstLevelChild.class){const{firstLevelChildClassList:a}=t;if(a&&!a.includes(i.firstLevelChild.class)){r=!1;continue}}if(i.firstLevelChild.type){const{firstLevelChildSchema:a}=t;if(!a||a.type!==i.firstLevelChild.type){r=!1;continue}}}if(i.secondLevelChild){if(i.secondLevelChild.class){const{secondLevelChildClassList:a}=t;if(a&&!a.includes(i.secondLevelChild.class)){r=!1;continue}}if(i.secondLevelChild.type){const{secondLevelChildSchema:a}=t;if(!a||a.type!==i.secondLevelChild.type){r=!1;continue}}}if(i.parent){if(i.parent.class){const{parentClassList:a}=t;if(a&&!a.includes(i.parent.class)){r=!1;continue}}if(i.parent.type){const{parentSchema:a}=t;if(a&&a.type!==i.parent.type){r=!1;continue}}}r=!0;break}return!r}getComponentContext(e){var b,g,C,M;const t=e.schema,n=t.appearance&&t.appearance.class||"",r=n.split(" ")||[],i=t.contents||[],a=i.length?i[0]:null,d=a&&a.appearance?a.appearance.class:"",m=d?d.split(" "):[],c=(b=a==null?void 0:a.contents)!=null&&b.length?a==null?void 0:a.contents[0]:null,s=c&&c.appearance?c.appearance.class:"",l=s?s.split(" "):[],p=t.type==="component"?(C=(g=e.parent)==null?void 0:g.parent)==null?void 0:C.schema:(M=e.parent)==null?void 0:M.schema,y=p&&p.appearance&&p.appearance.class||"",w=y?y.split(" "):[];return{componentClass:n,componentClassList:r,childContents:i,firstLevelChildSchema:a,firstLevelChildClass:d,firstLevelChildClassList:m,secondLevelChildSchema:c,secondLevelChildClass:s,secondLevelChildClassList:l,parentSchema:p,parentClass:y,parentClassList:w}}}class te{constructor(e,t){T(this,"componentId");T(this,"viewModelId");T(this,"eventsEditorUtils");T(this,"formSchemaUtils");T(this,"formMetadataConverter");T(this,"designViewModelUtils");T(this,"designViewModelField");T(this,"controlCreatorUtils");T(this,"designerHostService");T(this,"schemaService",null);T(this,"metadataService",null);T(this,"propertyConfig",{type:"object",categories:{}});var n;this.componentId=e,this.designerHostService=t,this.eventsEditorUtils=t.eventsEditorUtils,this.formSchemaUtils=t.formSchemaUtils,this.formMetadataConverter=t.formMetadataConverter,this.viewModelId=((n=this.formSchemaUtils)==null?void 0:n.getViewModelIdByComponentId(e))||"",this.designViewModelUtils=t.designViewModelUtils,this.controlCreatorUtils=t.controlCreatorUtils,this.metadataService=t.metadataService,this.schemaService=t.schemaService}getTableInfo(){var e;return(e=this.schemaService)==null?void 0:e.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(e){var n;const t=e.binding&&e.binding.type==="Form"&&e.binding.field;if(t){if(!this.designViewModelField){const r=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=r.fields.find(i=>i.id===t)}e.updateOn=(n=this.designViewModelField)==null?void 0:n.updateOn}}changeFieldEditorType(e,t){}getBasicPropConfig(e){return{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:e.type,name:X[e.type].name}]}}}}}getAppearanceConfig(e=null){return{title:"样式",description:"Appearance",properties:{class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter"}}}}updateElementByParentContainer(e,t){const n=t&&t.parent&&t.parent.schema;if(!n)return;const r=n.contents.findIndex(a=>a.id===e),i=D.cloneDeep(n.contents[r]);n.contents.splice(r,1),n.contents.splice(r,0,i)}}class ne extends te{constructor(e,t){super(e,t)}getPropertyConfig(e){return this.propertyConfig.categories.basic=this.getBasicPropConfig(e),this.propertyConfig.categories.appearance=this.getAppearanceConfig(e),this.getEventPropConfig(e),this.propertyConfig}getEventPropConfig(e){const t=[{label:"onInit",name:"初始化事件"},{label:"onAfterViewInit",name:"视图初始化后事件"}],n=this,r=n.eventsEditorUtils.formProperties(e,n.viewModelId,t),i={};i[n.viewModelId]={type:"events-editor",editor:{initialData:r}},this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:i,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(a,d){const m=a.propertyValue;delete e[n.viewModelId],m&&(m.setPropertyRelates=this.setPropertyRelates,n.eventsEditorUtils.saveRelatedParameters(e,n.viewModelId,m.events,m))}}}}function oe(o,e){const t=new ee,{canMove:n,canDelete:r}=t.getTemplateRule(o,e);function i(){return!1}function a(){return r}function d(){return n}function m(){return!1}function c(){return" display: inherit;flex-direction: inherit;margin-bottom:10px"}function s(b){const g=new ne(b,e),{schema:C}=o;return g.getPropertyConfig(C)}function l(){var $,E,u,P;const b=o==null?void 0:o.schema,C=(e==null?void 0:e.formSchemaUtils).getViewModelIdByComponentId(b.id);if(b.componentType!=="data-grid"&&b.componentType!=="form"||!(($=o.componentInstance)!=null&&$.value.parent))return;const M=(E=o.componentInstance)==null?void 0:E.value.parent.schema;if((u=M==null?void 0:M.toolbar)!=null&&u.buttons&&M.toolbar.buttons.length){M.toolbar.buttons.forEach(V=>{const B=V.onClick,U=B&&B.split(".");if(!U||U.length<3)return;U[U.length-2]===C&&(V.needRemove=!0)}),M.toolbar.buttons=M.toolbar.buttons.filter(V=>!V.needRemove);const v=(P=o.componentInstance)==null?void 0:P.value.parent;v.parent&&v.parent.updateToolbarItems&&v.parent.updateToolbarItems()}}function p(){const b=e==null?void 0:e.designViewModelUtils,g=e==null?void 0:e.formSchemaUtils,C=o==null?void 0:o.schema;if(b&&g){const M=g.getViewModelIdByComponentId(C.id);b.deleteViewModelById(M),g.deleteComponent(C.id)}}function y(){const b=e==null?void 0:e.designViewModelUtils,g=e==null?void 0:e.formSchemaUtils,C=o==null?void 0:o.schema,M=g.getViewModelIdByComponentId(C.id);b.getDgViewModel(M).fields.forEach($=>{if(g.getExpressions()&&g.getExpressions().length){const E=g.getExpressions().findIndex(u=>u.fieldId===$.id);E>-1&&g.getExpressions().splice(E,1)}})}function w(){l(),y(),p()}return{canAccepts:i,checkCanDeleteComponent:a,checkCanMoveComponent:d,hideNestedPaddingInDesginerView:m,getStyles:c,getPropsConfig:s,onRemoveComponent:w}}const G=f.defineComponent({name:"FComponetDesign",props:k,emits:[],setup(o,e){const t=f.ref(),n=f.inject("designer-host-service"),r=f.inject("design-item-context"),i=oe(r,n),a=x(t,r,i),d=f.computed(()=>{const m={"drag-container":!0};return _.getCustomClass(m,o==null?void 0:o.customClass)});return f.onMounted(()=>{var m,c,s,l;t.value.componentInstance=a,((c=(m=r.parent)==null?void 0:m.schema)==null?void 0:c.type)==="component-ref"&&(a.value.parent=(l=(s=r.parent)==null?void 0:s.parent)==null?void 0:l.componentInstance)}),e.expose(a.value),()=>f.createVNode("div",{ref:t,class:d.value,style:o.customStyle,"data-dragref":`${r.schema.id}-container`},[e.slots.default&&e.slots.default()])}}),re=N({id:{type:String},component:{type:String,default:""}},{$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/component.schema.json",title:"component-ref",description:"A Farris Visual Component",type:"object",properties:{id:{description:"The unique identifier for a Section",type:"string"},type:{description:"The type string of Section component",type:"string",default:"component-ref"},component:{description:"",type:"string",default:""}},required:["id","type","component"]},q,R),ae={install(o){o.component(L.name,L)},register(o,e,t,n){o.component=L,e.component=S},registerDesigner(o,e){o.component=G,e.component=S,e["component-ref"]=re}};h.Component=L,h.ComponentDesign=G,h.componentDesignProps=H,h.componentProps=k,h.default=ae,h.propsResolver=S,Object.defineProperties(h,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(h,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("vue"),require("lodash-es"),require("../common/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../common/index.umd.js"],f):(h=typeof globalThis<"u"?globalThis:h||self,f(h.component={},h.Vue,h.LodashES,h.common))})(this,function(h,f,D,G){"use strict";var ce=Object.defineProperty;var se=(h,f,D)=>f in h?ce(h,f,{enumerable:!0,configurable:!0,writable:!0,value:D}):h[f]=D;var T=(h,f,D)=>se(h,typeof f!="symbol"?f+"":f,D);const A={},O={};function S(a){const{properties:e,title:t,ignore:n}=a,r=n&&Array.isArray(n),i=Object.keys(e).reduce((o,d)=>((!r||!n.find(m=>m===d))&&(o[d]=e[d].type==="object"&&e[d].properties?S(e[d]):D.cloneDeep(e[d].default)),o),{});if(t&&(!r||!n.find(o=>o==="id"))){const o=t.toLowerCase().replace(/-/g,"_");i.id=`${o}_${Math.random().toString().slice(2,6)}`}return i}function W(a){const{properties:e,title:t,required:n}=a;if(n&&Array.isArray(n)){const r=n.reduce((i,o)=>(i[o]=e[o].type==="object"&&e[o].properties?S(e[o]):D.cloneDeep(e[o].default),i),{});if(t&&n.find(i=>i==="id")){const i=t.toLowerCase().replace(/-/g,"_");r.id=`${i}_${Math.random().toString().slice(2,6)}`}return r}return{type:t}}function F(a,e={},t){const n=A[a];if(n){let r=W(n);const i=O[a];return r=i?i({getSchemaByType:F},r,e,t):r,r}return null}function Q(a,e){const t=S(e);return Object.keys(t).reduce((n,r)=>(Object.prototype.hasOwnProperty.call(a,r)&&(n[r]&&D.isPlainObject(n[r])&&D.isPlainObject(a[r]||!a[r])?Object.assign(n[r],a[r]||{}):n[r]=a[r]),n),t),t}function z(a,e){return Object.keys(a).filter(n=>a[n]!=null).reduce((n,r)=>{if(e.has(r)){const i=e.get(r);if(typeof i=="string")n[i]=a[r];else{const o=i(r,a[r],a);Object.assign(n,o)}}else n[r]=a[r];return n},{})}function J(a,e,t=new Map){const n=Q(a,e);return z(n,t)}function X(a={}){function e(c,s,l,p){if(typeof l=="number")return p[c].length===l;if(typeof l=="object"){const y=Object.keys(l)[0],w=l[y];if(y==="not")return Number(p[c].length)!==Number(w);if(y==="moreThan")return Number(p[c].length)>=Number(w);if(y==="lessThan")return Number(p[c].length)<=Number(w)}return!1}function t(c,s,l,p){return p[c]&&p[c].propertyValue&&String(p[c].propertyValue.value)===String(l)}const n=new Map([["length",e],["getProperty",t]]);Object.keys(a).reduce((c,s)=>(c.set(s,a[s]),c),n);function r(c,s){const l=c;return typeof s=="number"?[{target:l,operator:"length",param:null,value:Number(s)}]:typeof s=="boolean"?[{target:l,operator:"getProperty",param:c,value:!!s}]:typeof s=="object"?Object.keys(s).map(p=>{if(p==="length")return{target:l,operator:"length",param:null,value:s[p]};const y=p,w=s[p];return{target:l,operator:"getProperty",param:y,value:w}}):[]}function i(c){return Object.keys(c).reduce((l,p)=>{const y=r(p,c[p]);return l.push(...y),l},[])}function o(c,s){if(n.has(c.operator)){const l=n.get(c.operator);return l&&l(c.target,c.param,c.value,s)||!1}return!1}function d(c,s){return i(c).reduce((y,w)=>y&&o(w,s),!0)}function m(c,s){const l=Object.keys(c),p=l.includes("allOf"),y=l.includes("anyOf"),w=p||y,C=(w?c[w?p?"allOf":"anyOf":"allOf"]:[c]).map($=>d($,s));return p?!C.includes(!1):C.includes(!0)}return{parseValueSchema:m}}const Y={button:{type:"button",name:"按钮",icon:"Button"},"response-toolbar":{type:"response-toolbar",name:"工具栏",icon:"ButtonGroup"},"response-toolbar-item":{type:"response-toolbar-item",name:"按钮",icon:"Button"},"content-container":{type:"content-container",name:"容器",icon:"ContentContainer"},"input-group":{type:"input-group",name:"文本",icon:"TextBox"},textarea:{type:"textarea",name:"多行文本",icon:"MultiTextBox"},lookup:{type:"lookup",name:"帮助",icon:"LookupEdit"},"number-spinner":{type:"number-spinner",name:"数值",icon:"NumericBox"},"date-picker":{type:"date-picker",name:"日期",icon:"DateBox"},switch:{type:"switch",name:"开关",icon:"SwitchField"},"radio-group":{type:"radio-group",name:"单选组",icon:"RadioGroup"},"check-box":{type:"check-box",name:"复选框",icon:"CheckBox"},"check-group":{type:"check-group",name:"复选框组",icon:"CheckGroup"},"combo-list":{type:"combo-list",name:"下拉列表",icon:"EnumField"},"response-form":{type:"response-form",name:"卡片面板",icon:"Form"},"response-layout":{type:"response-layout",name:"布局容器",icon:"ResponseLayout3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"ResponseLayout1"},"tree-grid":{type:"tree-grid",name:"树表格",icon:"TreeGrid"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格",icon:"DataGrid"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块",icon:"Module"},component:{type:"component",name:"组件",icon:"Component"},tabs:{type:"tabs",name:"标签页",icon:"Tab"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮",icon:"Button"},"time-picker":{type:"time-picker",name:"时间选择",icon:"TimePicker"},section:{type:"section",name:"分组面板",icon:"Section"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板",icon:"Splitter"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传",icon:"FileUpload"},"page-header":{type:"page-header",name:"页头",icon:"Header"},"page-footer":{type:"page-footer",name:"页脚",icon:"ModalFooter"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏",icon:"TabToolbar"},fieldset:{type:"fieldset",name:"分组",icon:"fieldset"},"query-solution":{type:"query-solution",name:"筛选方案",icon:"QueryScheme"}},Z={},I={};X();function N(a,e,t=new Map,n=(o,d,m,c)=>d,r={},i=o=>o){return A[e.title]=e,O[e.title]=n,Z[e.title]=r,I[e.title]=i,(o={})=>{const d=J(o,e,t),m=Object.keys(a).reduce((c,s)=>(c[s]=a[s].default,c),{});return Object.assign(m,d)}}function K(a,e){return{customClass:e.class,customStyle:e.style}}const q=new Map([["appearance",K]]),H={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/component.schema.json",title:"component",description:"A Farris Visual Component",type:"object",properties:{id:{description:"The unique identifier for a component",type:"string"},type:{description:"The type string of component",type:"string",default:"component"},componentType:{description:"The type string of component",type:"string"},viewModel:{description:"The viewModel string of component",type:"string"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},visible:{description:"",type:"boolean",default:!0},onInit:{description:"初始化事件",type:"string",default:""},onAfterViewInit:{description:"视图初始化后事件",type:"string",default:""}},required:["id","type","contents"]};function R(a,e,t){return e}const L={id:{type:String},customClass:{type:String,default:""},customStyle:{type:String,default:""},componentType:{type:String,default:""},formColumns:{type:Number,default:4}},j=N(L,H,q,R),x=Object.assign({},L,{componentId:{type:String,default:""}}),k=f.defineComponent({name:"FComponent",props:L,emits:["init","afterViewInit"],setup(a,e){return f.onBeforeMount(()=>{e.emit("init",a.id)}),f.onMounted(()=>{e.emit("afterViewInit",a.id)}),()=>f.createVNode("div",{class:a.customClass},[e.slots.default&&e.slots.default()])}});function ee(a,e,t){var E;const n=t&&t.getStyles&&t.getStyles()||"",r=t&&t.getDesignerClass&&t.getDesignerClass()||"",i=f.ref();function o(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanMoveComponent?t.checkCanMoveComponent():!0}function d(){return!1}function m(){return(e==null?void 0:e.schema.componentType)==="frame"?!1:t&&t.checkCanDeleteComponent?t.checkCanDeleteComponent():!0}function c(){return(e==null?void 0:e.schema.componentType)==="frame"?!0:t&&t.hideNestedPaddingInDesginerView?t.hideNestedPaddingInDesginerView():!1}function s(u){if(!u||!u.value)return null;if(u.value.schema&&u.value.schema.type==="component")return u.value;const P=f.ref(u==null?void 0:u.value.parent),v=s(P);return v||null}function l(u=e){const{componentInstance:P,designerItemElementRef:v}=u;return!P||!P.value?null:P.value.canMove?v:l(u.parent)}function p(u){return!!t&&t.canAccepts(u)}function y(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function w(){}function b(u,P){P&&t!=null&&t.onAcceptMovedChildElement&&t.onAcceptMovedChildElement(P)}function g(u,P){const{componentType:v}=u;let V=F(v,u,P);t&&t.onResolveNewComponentSchema&&(V=t.onResolveNewComponentSchema(u,V));const B=v.toLowerCase().replace(/-/g,"_");return V&&!V.id&&V.type===v&&(V.id=`${B}_${Math.random().toString().slice(2,6)}`),V}function C(u){}function M(...u){if(t&&t.getPropsConfig)return t.getPropsConfig(...u)}function $(){t&&t.onRemoveComponent&&t.onRemoveComponent(),e!=null&&e.schema.contents&&e.schema.contents.map(u=>{var V;let P=u.id;u.type==="component-ref"&&(P=u.component);const v=a.value.querySelector(`#${P}-design-item`);(V=v==null?void 0:v.componentInstance)!=null&&V.value.onRemoveComponent&&v.componentInstance.value.onRemoveComponent()})}return i.value={canMove:o(),canSelectParent:d(),canDelete:m(),canNested:!c(),contents:e==null?void 0:e.schema.contents,elementRef:a,parent:(E=e==null?void 0:e.parent)==null?void 0:E.componentInstance,schema:e==null?void 0:e.schema,styles:n,designerClass:r,canAccepts:p,getBelongedComponentInstance:s,getDraggableDesignItemElement:l,getDraggingDisplayText:y,getPropConfig:M,getDragScopeElement:w,onAcceptMovedChildElement:b,onChildElementMovedOut:C,addNewChildComponentSchema:g,triggerBelongedComponentToMoveWhenMoved:!!t&&t.triggerBelongedComponentToMoveWhenMoved||f.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!t&&t.triggerBelongedComponentToDeleteWhenDeleted||f.ref(!1),onRemoveComponent:$},i}class te{getTemplateRule(e,t){const n=t==null?void 0:t.formSchemaUtils,r=n==null?void 0:n.getFormTemplateRule(),i={canAccept:!0,canDelete:!0,canMove:!0};if(!r)return i;const o=this.getComponentContext(e),{componentClassList:d}=o;return d.forEach(m=>{if(!m||!r[m])return;const{canMove:c,canDelete:s,canAccept:l}=r[m];i.canMove=i.canMove&&this.resolveRuleValue(c,o),i.canDelete=i.canDelete&&this.resolveRuleValue(s,o),i.canAccept=i.canAccept&&this.resolveRuleValue(l,o)}),i}resolveRuleValue(e,t){return typeof e=="boolean"?e:this.parseRuleValueSchema(e,t)}parseRuleValueSchema(e,t){const n=e.invalidContext||[];let r=!0;for(const i of n){if(i.firstLevelChild){if(i.firstLevelChild.class){const{firstLevelChildClassList:o}=t;if(o&&!o.includes(i.firstLevelChild.class)){r=!1;continue}}if(i.firstLevelChild.type){const{firstLevelChildSchema:o}=t;if(!o||o.type!==i.firstLevelChild.type){r=!1;continue}}}if(i.secondLevelChild){if(i.secondLevelChild.class){const{secondLevelChildClassList:o}=t;if(o&&!o.includes(i.secondLevelChild.class)){r=!1;continue}}if(i.secondLevelChild.type){const{secondLevelChildSchema:o}=t;if(!o||o.type!==i.secondLevelChild.type){r=!1;continue}}}if(i.parent){if(i.parent.class){const{parentClassList:o}=t;if(o&&!o.includes(i.parent.class)){r=!1;continue}}if(i.parent.type){const{parentSchema:o}=t;if(o&&o.type!==i.parent.type){r=!1;continue}}}r=!0;break}return!r}getComponentContext(e){var b,g,C,M;const t=e.schema,n=t.appearance&&t.appearance.class||"",r=n.split(" ")||[],i=t.contents||[],o=i.length?i[0]:null,d=o&&o.appearance?o.appearance.class:"",m=d?d.split(" "):[],c=(b=o==null?void 0:o.contents)!=null&&b.length?o==null?void 0:o.contents[0]:null,s=c&&c.appearance?c.appearance.class:"",l=s?s.split(" "):[],p=t.type==="component"?(C=(g=e.parent)==null?void 0:g.parent)==null?void 0:C.schema:(M=e.parent)==null?void 0:M.schema,y=p&&p.appearance&&p.appearance.class||"",w=y?y.split(" "):[];return{componentClass:n,componentClassList:r,childContents:i,firstLevelChildSchema:o,firstLevelChildClass:d,firstLevelChildClassList:m,secondLevelChildSchema:c,secondLevelChildClass:s,secondLevelChildClassList:l,parentSchema:p,parentClass:y,parentClassList:w}}}class ne{constructor(e,t){T(this,"componentId");T(this,"viewModelId");T(this,"eventsEditorUtils");T(this,"formSchemaUtils");T(this,"formMetadataConverter");T(this,"designViewModelUtils");T(this,"designViewModelField");T(this,"controlCreatorUtils");T(this,"designerHostService");T(this,"schemaService",null);T(this,"metadataService",null);T(this,"propertyConfig",{type:"object",categories:{}});var n;this.componentId=e,this.designerHostService=t,this.eventsEditorUtils=t.eventsEditorUtils,this.formSchemaUtils=t.formSchemaUtils,this.formMetadataConverter=t.formMetadataConverter,this.viewModelId=((n=this.formSchemaUtils)==null?void 0:n.getViewModelIdByComponentId(e))||"",this.designViewModelUtils=t.designViewModelUtils,this.controlCreatorUtils=t.controlCreatorUtils,this.metadataService=t.metadataService,this.schemaService=t.schemaService}getTableInfo(){var e;return(e=this.schemaService)==null?void 0:e.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(e){var n;const t=e.binding&&e.binding.type==="Form"&&e.binding.field;if(t){if(!this.designViewModelField){const r=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=r.fields.find(i=>i.id===t)}e.updateOn=(n=this.designViewModelField)==null?void 0:n.updateOn}}changeFieldEditorType(e,t){}getBasicPropConfig(e){return{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"combo-list",textField:"name",valueField:"value",data:[{value:e.type,name:Y[e.type].name}]}}}}}getAppearanceConfig(e=null){return{title:"样式",description:"Appearance",properties:{class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter"}}}}updateElementByParentContainer(e,t){const n=t&&t.parent&&t.parent.schema;if(!n)return;const r=n.contents.findIndex(o=>o.id===e),i=D.cloneDeep(n.contents[r]);n.contents.splice(r,1),n.contents.splice(r,0,i)}}class oe extends ne{constructor(e,t){super(e,t)}getPropertyConfig(e){return this.propertyConfig.categories.basic=this.getBasicPropConfig(e),this.propertyConfig.categories.appearance=this.getAppearanceConfig(e),this.getEventPropConfig(e),this.propertyConfig}getEventPropConfig(e){const t=[{label:"onInit",name:"初始化事件"},{label:"onAfterViewInit",name:"视图初始化后事件"}],n=this,r=n.eventsEditorUtils.formProperties(e,n.viewModelId,t),i={};i[n.viewModelId]={type:"events-editor",editor:{initialData:r}},this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:i,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(o,d){const m=o.propertyValue;delete e[n.viewModelId],m&&(m.setPropertyRelates=this.setPropertyRelates,n.eventsEditorUtils.saveRelatedParameters(e,n.viewModelId,m.events,m))}}}}function re(a,e){const t=new te,{canMove:n,canDelete:r}=t.getTemplateRule(a,e);function i(){return!1}function o(){return r}function d(){return n}function m(){return!1}function c(){return" display: inherit;flex-direction: inherit;margin-bottom:10px"}function s(b){const g=new oe(b,e),{schema:C}=a;return g.getPropertyConfig(C)}function l(){var $,E,u,P;const b=a==null?void 0:a.schema,C=(e==null?void 0:e.formSchemaUtils).getViewModelIdByComponentId(b.id);if(b.componentType!=="data-grid"&&b.componentType!=="form"||!(($=a.componentInstance)!=null&&$.value.parent))return;const M=(E=a.componentInstance)==null?void 0:E.value.parent.schema;if((u=M==null?void 0:M.toolbar)!=null&&u.buttons&&M.toolbar.buttons.length){M.toolbar.buttons.forEach(V=>{const B=V.onClick,U=B&&B.split(".");if(!U||U.length<3)return;U[U.length-2]===C&&(V.needRemove=!0)}),M.toolbar.buttons=M.toolbar.buttons.filter(V=>!V.needRemove);const v=(P=a.componentInstance)==null?void 0:P.value.parent;v.parent&&v.parent.updateToolbarItems&&v.parent.updateToolbarItems()}}function p(){const b=e==null?void 0:e.designViewModelUtils,g=e==null?void 0:e.formSchemaUtils,C=a==null?void 0:a.schema;if(b&&g){const M=g.getViewModelIdByComponentId(C.id);b.deleteViewModelById(M),g.deleteComponent(C.id)}}function y(){const b=e==null?void 0:e.designViewModelUtils,g=e==null?void 0:e.formSchemaUtils,C=a==null?void 0:a.schema,M=g.getViewModelIdByComponentId(C.id);b.getDgViewModel(M).fields.forEach($=>{if(g.getExpressions()&&g.getExpressions().length){const E=g.getExpressions().findIndex(u=>u.fieldId===$.id);E>-1&&g.getExpressions().splice(E,1)}})}function w(){l(),y(),p()}return{canAccepts:i,checkCanDeleteComponent:o,checkCanMoveComponent:d,hideNestedPaddingInDesginerView:m,getStyles:c,getPropsConfig:s,onRemoveComponent:w}}const _=f.defineComponent({name:"FComponetDesign",props:L,emits:[],setup(a,e){const t=f.ref(),n=f.inject("designer-host-service"),r=f.inject("design-item-context"),i=re(r,n),o=ee(t,r,i),d=f.computed(()=>{const m={"drag-container":!0};return G.getCustomClass(m,a==null?void 0:a.customClass)});return f.onMounted(()=>{var m,c,s,l;t.value.componentInstance=o,((c=(m=r.parent)==null?void 0:m.schema)==null?void 0:c.type)==="component-ref"&&(o.value.parent=(l=(s=r.parent)==null?void 0:s.parent)==null?void 0:l.componentInstance)}),e.expose(o.value),()=>f.createVNode("div",{ref:t,class:d.value,style:a.customStyle,"data-dragref":`${r.schema.id}-container`},[e.slots.default&&e.slots.default()])}}),ae=N({id:{type:String},component:{type:String,default:""}},{$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/component.schema.json",title:"component-ref",description:"A Farris Visual Component",type:"object",properties:{id:{description:"The unique identifier for a Section",type:"string"},type:{description:"The type string of Section component",type:"string",default:"component-ref"},component:{description:"",type:"string",default:""}},required:["id","type","component"]},q,R),ie={install(a){a.component(k.name,k)},register(a,e,t,n){a.component=k,e.component=j},registerDesigner(a,e){a.component=_,e.component=j,e["component-ref"]=ae}};h.Component=k,h.ComponentDesign=_,h.componentDesignProps=x,h.componentProps=L,h.default=ie,h.propsResolver=j,Object.defineProperties(h,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -251,7 +251,7 @@ class Ln {
|
|
|
251
251
|
throw new Error("Method not implemented.");
|
|
252
252
|
}
|
|
253
253
|
isEmpty() {
|
|
254
|
-
return !this.displayText && !this.value;
|
|
254
|
+
return !this.displayText && !this.value.length;
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
257
|
class Nn {
|
|
@@ -372,7 +372,7 @@ class Hn {
|
|
|
372
372
|
this.value = isNaN(parseFloat(e)) ? null : e;
|
|
373
373
|
}
|
|
374
374
|
isEmpty() {
|
|
375
|
-
return this.value == null;
|
|
375
|
+
return this.value == null || isNaN(this.value);
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
class Dn {
|
|
@@ -573,7 +573,7 @@ function Re(t) {
|
|
|
573
573
|
}
|
|
574
574
|
function Un(t, e) {
|
|
575
575
|
const n = Re(e);
|
|
576
|
-
return Object.keys(n).reduce((o, a) => (o[a] && xe(o[a]) && xe(t[a] || !t[a]) ? Object.assign(o[a], t[a] || {}) : o[a] = t[a], o), n), n;
|
|
576
|
+
return Object.keys(n).reduce((o, a) => (Object.prototype.hasOwnProperty.call(t, a) && (o[a] && xe(o[a]) && xe(t[a] || !t[a]) ? Object.assign(o[a], t[a] || {}) : o[a] = t[a]), o), n), n;
|
|
577
577
|
}
|
|
578
578
|
function Wn(t, e) {
|
|
579
579
|
return Object.keys(t).filter((o) => t[o] != null).reduce((o, a) => {
|
|
@@ -875,7 +875,8 @@ const no = "https://json-schema.org/draft/2020-12/schema", oo = "https://farris-
|
|
|
875
875
|
}
|
|
876
876
|
}, io = [
|
|
877
877
|
"id",
|
|
878
|
-
"type"
|
|
878
|
+
"type",
|
|
879
|
+
"contents"
|
|
879
880
|
], uo = {
|
|
880
881
|
$schema: no,
|
|
881
882
|
$id: oo,
|
|
@@ -919,7 +920,8 @@ const po = "https://json-schema.org/draft/2020-12/schema", mo = "https://farris-
|
|
|
919
920
|
},
|
|
920
921
|
editor: {
|
|
921
922
|
description: "",
|
|
922
|
-
type: "obejct"
|
|
923
|
+
type: "obejct",
|
|
924
|
+
default: {}
|
|
923
925
|
},
|
|
924
926
|
label: {
|
|
925
927
|
description: "",
|
|
@@ -937,7 +939,8 @@ const po = "https://json-schema.org/draft/2020-12/schema", mo = "https://farris-
|
|
|
937
939
|
}
|
|
938
940
|
}, yo = [
|
|
939
941
|
"id",
|
|
940
|
-
"type"
|
|
942
|
+
"type",
|
|
943
|
+
"editor"
|
|
941
944
|
], je = {
|
|
942
945
|
$schema: po,
|
|
943
946
|
$id: mo,
|
|
@@ -1195,7 +1198,6 @@ const To = "https://json-schema.org/draft/2020-12/schema", ko = "https://farris-
|
|
|
1195
1198
|
default: ""
|
|
1196
1199
|
}
|
|
1197
1200
|
}, Eo = [
|
|
1198
|
-
"id",
|
|
1199
1201
|
"type"
|
|
1200
1202
|
], Io = [
|
|
1201
1203
|
"id",
|