@farris/ui-vue 1.3.0 → 1.3.1
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 +1 -1
- package/components/accordion/index.umd.cjs +1 -1
- package/components/avatar/index.esm.js +472 -366
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +1 -1
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +472 -480
- package/components/calendar/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +225 -233
- package/components/capsule/index.umd.cjs +1 -1
- package/components/checkbox/index.esm.js +615 -517
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/color-picker/index.esm.js +325 -333
- package/components/color-picker/index.umd.cjs +2 -2
- package/components/combo-list/index.esm.js +578 -472
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +49 -49
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/common/index.esm.js +832 -722
- package/components/common/index.umd.cjs +1 -1
- package/components/component/index.esm.js +303 -981
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +8 -8
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +335 -1002
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.esm.js +4429 -4312
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +3037 -3020
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +2216 -2119
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.css +1 -1
- package/components/designer-canvas/index.esm.js +914 -883
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/dropdown/index.esm.js +223 -231
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +1691 -2187
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +143 -136
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +250 -258
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/expression-editor/index.esm.js +1 -1
- package/components/expression-editor/index.umd.cjs +1 -1
- package/components/external-container/index.esm.js +2672 -3438
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.esm.js +2965 -2970
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.esm.js +1650 -1602
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.css +1 -1
- package/components/flow-canvas/index.esm.js +684 -675
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +453 -461
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/input-group/index.esm.js +604 -507
- package/components/input-group/index.umd.cjs +1 -1
- package/components/layout/index.esm.js +402 -378
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +348 -1019
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.esm.js +1658 -1666
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.esm.js +5209 -5088
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +4329 -4213
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +905 -1357
- package/components/nav/index.umd.cjs +3 -3
- package/components/number-range/index.esm.js +517 -420
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +588 -491
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.esm.js +1376 -1965
- package/components/order/index.umd.cjs +1 -1
- package/components/page-footer/index.esm.js +1 -1
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +1073 -1905
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +809 -1237
- package/components/pagination/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +198 -206
- package/components/progress/index.umd.cjs +3 -3
- package/components/property-editor/index.esm.js +1297 -1200
- package/components/property-editor/index.umd.cjs +2 -2
- package/components/property-panel/index.esm.js +609 -507
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.esm.js +3391 -3758
- package/components/query-solution/index.umd.cjs +1 -1
- package/components/radio-button/index.esm.js +1 -1
- package/components/radio-button/index.umd.cjs +1 -1
- package/components/radio-group/index.esm.js +544 -447
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/rate/index.esm.js +247 -255
- package/components/rate/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +146 -154
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.esm.js +700 -675
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +956 -1786
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +4963 -5617
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/search-box/index.esm.js +158 -161
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +436 -1124
- package/components/section/index.umd.cjs +1 -1
- package/components/smoke-detector/index.esm.js +92 -100
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/splitter/index.esm.js +571 -1210
- package/components/splitter/index.umd.cjs +1 -1
- package/components/splitter/style.js +2 -0
- package/components/step/index.esm.js +239 -247
- package/components/step/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +445 -348
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +2278 -3031
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tags/index.esm.js +311 -319
- package/components/tags/index.umd.cjs +1 -1
- package/components/text/index.esm.js +215 -223
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +468 -371
- package/components/textarea/index.umd.cjs +1 -1
- package/components/time-picker/index.esm.js +1271 -1174
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/transfer/index.esm.js +469 -477
- package/components/transfer/index.umd.cjs +1 -1
- package/components/tree-grid/index.esm.js +3060 -3065
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +2476 -2481
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +374 -382
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +248 -256
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +414 -1093
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +498 -506
- package/components/weather/index.umd.cjs +5 -5
- package/farris.all.esm.js +20216 -21844
- package/farris.all.umd.cjs +9 -9
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/common/directive/area-response.d.ts +10 -0
- package/types/common/index.d.ts +8 -0
- package/types/common/radio-checkbox/radio-checkbox.props.d.ts +1 -0
- package/types/common/utils/resolve-field.d.ts +2 -0
- package/types/common/utils/use-class.d.ts +7 -0
- package/types/component/src/designer/use-designer-rules.d.ts +2 -2
- package/types/condition/src/types.d.ts +2 -1
- package/types/content-container/src/designer/use-designer-rules.d.ts +3 -3
- package/types/data-grid/index.d.ts +8 -5
- package/types/data-grid/src/data-grid.component.d.ts +3 -2
- package/types/data-grid/src/designer/data-grid.design.component.d.ts +2 -2
- package/types/data-grid/src/designer/use-designer-rules.d.ts +2 -2
- package/types/data-view/components/row/hierarchy-row.component.d.ts +2 -2
- package/types/data-view/composition/data/use-tree-data.d.ts +1 -1
- package/types/data-view/composition/types.d.ts +7 -9
- package/types/designer-canvas/index.d.ts +2 -1
- package/types/designer-canvas/src/composition/rule/use-dragula-common-rule.d.ts +4 -0
- package/types/designer-canvas/src/composition/rule/use-template-rule.d.ts +30 -0
- package/types/designer-canvas/src/composition/types.d.ts +1 -2
- package/types/designer-canvas/src/types.d.ts +2 -1
- package/types/dynamic-form/src/designer/response-form.design.component.d.ts +7 -1
- package/types/dynamic-form/src/designer/use-designer-rules.d.ts +2 -2
- package/types/dynamic-form/src/property-config/form.property-config.d.ts +1 -1
- package/types/dynamic-resolver/src/common/toolbar-resolver.d.ts +1 -1
- package/types/external-container/src/designer/use-designer-rules.d.ts +3 -3
- package/types/layout/src/designer/layout-pane-use-designer-rules.d.ts +3 -3
- package/types/list-nav/src/designer/use-designer-rules.d.ts +3 -0
- package/types/pagination/src/components/buttons/goto-buttons.component.d.ts +2 -2
- package/types/pagination/src/components/buttons/next-buttons.component.d.ts +2 -2
- package/types/pagination/src/components/buttons/previous-buttons.component.d.ts +2 -2
- package/types/pagination/src/components/pages/page-list.component.d.ts +2 -2
- package/types/pagination/src/components/pages/page-number.component.d.ts +2 -2
- package/types/property-panel/index.d.ts +2 -1
- package/types/property-panel/src/composition/entity/input-base-property.d.ts +1 -1
- package/types/query-solution/src/designer/query-solution-config/composition/types.d.ts +34 -27
- package/types/query-solution/src/designer/query-solution-config/composition/use-panel.d.ts +2 -16
- package/types/query-solution/src/designer/query-solution-config/composition/use-property.d.ts +19 -0
- package/types/query-solution/src/designer/query-solution-config/composition/use-querysolution-rules.d.ts +3 -0
- package/types/query-solution/src/designer/query-solution-config/composition/use-transfer.d.ts +1 -1
- package/types/query-solution/src/property-config/query-solution.property-config.d.ts +60 -0
- package/types/query-solution/src/solutions.d.ts +108 -509
- package/types/response-layout-editor/index.d.ts +3 -1
- package/types/response-toolbar/src/designer/use-designer-rules.d.ts +3 -3
- package/types/response-toolbar/src/property-config/response-toolbar-item.property-config.d.ts +1 -0
- package/types/section/src/designer/use-designer-rules.d.ts +3 -3
- package/types/splitter/src/components/splitter-pane.component.d.ts +1 -1
- package/types/splitter/src/designer/splitter-pane-use-designer-rules.d.ts +3 -3
- package/types/splitter/src/designer/splitter-use-designer-rules.d.ts +3 -3
- package/types/tabs/src/designer/tab-page-use-designer-rules.d.ts +3 -3
- package/types/tabs/src/designer/tab-use-designer-rules.d.ts +3 -3
- package/types/tree-grid/index.d.ts +3 -3
- package/types/tree-grid/src/tree-grid.component.d.ts +1 -1
- package/types/designer-canvas/src/composition/rule/use-drag-drop-rules.d.ts +0 -19
- package/types/designer-canvas/src/composition/use-dragula-common-rule.d.ts +0 -4
- package/types/list-nav/src/composition/use-designer-rules.d.ts +0 -3
- package/types/query-solution/src/designer/query-solution-config/composition/mock-data.d.ts +0 -6
|
@@ -1,103 +1,102 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { computed as
|
|
5
|
-
import { isPlainObject as
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return (!i || !r.find((s) => s == "id")) && (c.id = `${e}-${Date.now()}`), c;
|
|
1
|
+
var ee = Object.defineProperty;
|
|
2
|
+
var te = (e, n, t) => n in e ? ee(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
|
|
3
|
+
var v = (e, n, t) => te(e, typeof n != "symbol" ? n + "" : n, t);
|
|
4
|
+
import { computed as F, ref as B, createVNode as E, onMounted as x, nextTick as j, defineComponent as q, watch as L, inject as W } from "vue";
|
|
5
|
+
import { isPlainObject as G, cloneDeep as z } from "lodash-es";
|
|
6
|
+
import N from "bignumber.js";
|
|
7
|
+
import { DgControl as $ } from "../designer-canvas/index.esm.js";
|
|
8
|
+
const Z = {}, X = {};
|
|
9
|
+
function O(e) {
|
|
10
|
+
const { properties: n, title: t, ignore: r } = e, i = r && Array.isArray(r), s = Object.keys(n).reduce((u, p) => ((!i || !r.find((d) => d == p)) && (u[p] = n[p].type === "object" && n[p].properties ? O(n[p]) : z(n[p].default)), u), {});
|
|
11
|
+
return t && (!i || !r.find((u) => u == "id")) && (s.id = `${t}-${Date.now()}`), s;
|
|
13
12
|
}
|
|
14
|
-
function
|
|
15
|
-
const r =
|
|
13
|
+
function J(e, n = {}, t) {
|
|
14
|
+
const r = Z[e];
|
|
16
15
|
if (r) {
|
|
17
|
-
let i =
|
|
18
|
-
const
|
|
19
|
-
return i =
|
|
16
|
+
let i = O(r);
|
|
17
|
+
const s = X[e];
|
|
18
|
+
return i = s ? s({ getSchemaByType: J }, i, n, t) : i, i;
|
|
20
19
|
}
|
|
21
20
|
return null;
|
|
22
21
|
}
|
|
23
|
-
function
|
|
24
|
-
const
|
|
25
|
-
return Object.keys(
|
|
22
|
+
function ne(e, n) {
|
|
23
|
+
const t = O(n);
|
|
24
|
+
return Object.keys(e).reduce((r, i) => (r[i] && G(r[i]) && G(e[i]) ? Object.assign(r[i], e[i]) : r[i] = e[i], r), t), t;
|
|
26
25
|
}
|
|
27
|
-
function
|
|
28
|
-
return Object.keys(
|
|
26
|
+
function oe(e, n) {
|
|
27
|
+
return Object.keys(e).filter((r) => e[r] != null).reduce((r, i) => {
|
|
29
28
|
if (n.has(i)) {
|
|
30
|
-
const
|
|
31
|
-
if (typeof
|
|
32
|
-
r[
|
|
29
|
+
const s = n.get(i);
|
|
30
|
+
if (typeof s == "string")
|
|
31
|
+
r[s] = e[i];
|
|
33
32
|
else {
|
|
34
|
-
const
|
|
35
|
-
Object.assign(r,
|
|
33
|
+
const u = s(i, e[i], e);
|
|
34
|
+
Object.assign(r, u);
|
|
36
35
|
}
|
|
37
36
|
} else
|
|
38
|
-
r[i] =
|
|
37
|
+
r[i] = e[i];
|
|
39
38
|
return r;
|
|
40
39
|
}, {});
|
|
41
40
|
}
|
|
42
|
-
function
|
|
43
|
-
const r =
|
|
44
|
-
return
|
|
41
|
+
function re(e, n, t = /* @__PURE__ */ new Map()) {
|
|
42
|
+
const r = ne(e, n);
|
|
43
|
+
return oe(r, t);
|
|
45
44
|
}
|
|
46
|
-
function
|
|
47
|
-
function n(
|
|
48
|
-
if (typeof
|
|
49
|
-
return
|
|
50
|
-
if (typeof
|
|
51
|
-
const
|
|
52
|
-
if (
|
|
53
|
-
return Number(
|
|
54
|
-
if (
|
|
55
|
-
return Number(
|
|
56
|
-
if (
|
|
57
|
-
return Number(
|
|
45
|
+
function ie(e = {}) {
|
|
46
|
+
function n(a, l, o, c) {
|
|
47
|
+
if (typeof o == "number")
|
|
48
|
+
return c[a].length === o;
|
|
49
|
+
if (typeof o == "object") {
|
|
50
|
+
const f = Object.keys(o)[0], m = o[f];
|
|
51
|
+
if (f === "not")
|
|
52
|
+
return Number(c[a].length) !== Number(m);
|
|
53
|
+
if (f === "moreThan")
|
|
54
|
+
return Number(c[a].length) >= Number(m);
|
|
55
|
+
if (f === "lessThan")
|
|
56
|
+
return Number(c[a].length) <= Number(m);
|
|
58
57
|
}
|
|
59
58
|
return !1;
|
|
60
59
|
}
|
|
61
|
-
function
|
|
62
|
-
return
|
|
60
|
+
function t(a, l, o, c) {
|
|
61
|
+
return c[a] && c[a].propertyValue && String(c[a].propertyValue.value) === String(o);
|
|
63
62
|
}
|
|
64
63
|
const r = /* @__PURE__ */ new Map([
|
|
65
64
|
["length", n],
|
|
66
|
-
["getProperty",
|
|
65
|
+
["getProperty", t]
|
|
67
66
|
]);
|
|
68
|
-
Object.keys(
|
|
69
|
-
function i(
|
|
70
|
-
const
|
|
71
|
-
return typeof l == "number" ? [{ target:
|
|
72
|
-
if (
|
|
73
|
-
return { target:
|
|
74
|
-
const
|
|
75
|
-
return { target:
|
|
67
|
+
Object.keys(e).reduce((a, l) => (a.set(l, e[l]), a), r);
|
|
68
|
+
function i(a, l) {
|
|
69
|
+
const o = a;
|
|
70
|
+
return typeof l == "number" ? [{ target: o, operator: "length", param: null, value: Number(l) }] : typeof l == "boolean" ? [{ target: o, operator: "getProperty", param: a, value: !!l }] : typeof l == "object" ? Object.keys(l).map((c) => {
|
|
71
|
+
if (c === "length")
|
|
72
|
+
return { target: o, operator: "length", param: null, value: l[c] };
|
|
73
|
+
const f = c, m = l[c];
|
|
74
|
+
return { target: o, operator: "getProperty", param: f, value: m };
|
|
76
75
|
}) : [];
|
|
77
76
|
}
|
|
78
|
-
function
|
|
79
|
-
return Object.keys(
|
|
80
|
-
const
|
|
81
|
-
return
|
|
77
|
+
function s(a) {
|
|
78
|
+
return Object.keys(a).reduce((o, c) => {
|
|
79
|
+
const f = i(c, a[c]);
|
|
80
|
+
return o.push(...f), o;
|
|
82
81
|
}, []);
|
|
83
82
|
}
|
|
84
|
-
function
|
|
85
|
-
if (r.has(
|
|
86
|
-
const
|
|
87
|
-
return
|
|
83
|
+
function u(a, l) {
|
|
84
|
+
if (r.has(a.operator)) {
|
|
85
|
+
const o = r.get(a.operator);
|
|
86
|
+
return o && o(a.target, a.param, a.value, l) || !1;
|
|
88
87
|
}
|
|
89
88
|
return !1;
|
|
90
89
|
}
|
|
91
|
-
function p(
|
|
92
|
-
return
|
|
90
|
+
function p(a, l) {
|
|
91
|
+
return s(a).reduce((f, m) => f && u(m, l), !0);
|
|
93
92
|
}
|
|
94
|
-
function
|
|
95
|
-
const
|
|
96
|
-
return
|
|
93
|
+
function d(a, l) {
|
|
94
|
+
const o = Object.keys(a), c = o.includes("allOf"), f = o.includes("anyOf"), m = c || f, w = (m ? a[m ? c ? "allOf" : "anyOf" : "allOf"] : [a]).map((T) => p(T, l));
|
|
95
|
+
return c ? !w.includes(!1) : w.includes(!0);
|
|
97
96
|
}
|
|
98
|
-
return { parseValueSchema:
|
|
97
|
+
return { parseValueSchema: d };
|
|
99
98
|
}
|
|
100
|
-
const
|
|
99
|
+
const y = {
|
|
101
100
|
button: { type: "button", name: "按钮", icon: "Button" },
|
|
102
101
|
"response-toolbar": { type: "response-toolbar", name: "工具栏", icon: "ButtonGroup" },
|
|
103
102
|
"response-toolbar-item": { type: "response-toolbar-item", name: "按钮", icon: "Button" },
|
|
@@ -136,20 +135,20 @@ const f = {
|
|
|
136
135
|
"page-footer": { type: "page-footer", name: "页脚", icon: "ModalFooter" },
|
|
137
136
|
"tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏", icon: "TabToolbar" },
|
|
138
137
|
fieldset: { type: "fieldset", name: "分组", icon: "fieldset" }
|
|
139
|
-
},
|
|
140
|
-
|
|
141
|
-
function
|
|
142
|
-
return
|
|
143
|
-
const p =
|
|
144
|
-
return Object.assign(
|
|
138
|
+
}, ae = {}, le = {};
|
|
139
|
+
ie();
|
|
140
|
+
function se(e, n, t = /* @__PURE__ */ new Map(), r = (u, p, d) => p, i = {}, s = (u) => u) {
|
|
141
|
+
return Z[n.title] = n, X[n.title] = r, ae[n.title] = i, le[n.title] = s, (u = {}) => {
|
|
142
|
+
const p = re(u, n, t), d = Object.keys(e).reduce((a, l) => (a[l] = e[l].default, a), {});
|
|
143
|
+
return Object.assign(d, p);
|
|
145
144
|
};
|
|
146
145
|
}
|
|
147
|
-
function
|
|
146
|
+
function ce(e, n) {
|
|
148
147
|
return { customClass: n.class, customStyle: n.style };
|
|
149
148
|
}
|
|
150
|
-
const
|
|
151
|
-
["appearance",
|
|
152
|
-
]),
|
|
149
|
+
const ue = /* @__PURE__ */ new Map([
|
|
150
|
+
["appearance", ce]
|
|
151
|
+
]), pe = "https://json-schema.org/draft/2020-12/schema", de = "https://farris-design.gitee.io/number-spinner.schema.json", me = "number-spinner", fe = "A Farris Input Component", ye = "object", ge = {
|
|
153
152
|
id: {
|
|
154
153
|
description: "The unique identifier for a number spinner",
|
|
155
154
|
type: "string"
|
|
@@ -250,27 +249,27 @@ const me = /* @__PURE__ */ new Map([
|
|
|
250
249
|
type: "sting",
|
|
251
250
|
default: ""
|
|
252
251
|
}
|
|
253
|
-
},
|
|
252
|
+
}, he = [
|
|
254
253
|
"id",
|
|
255
254
|
"type"
|
|
256
|
-
],
|
|
255
|
+
], be = [
|
|
257
256
|
"id",
|
|
258
257
|
"appearance",
|
|
259
258
|
"binding"
|
|
260
|
-
],
|
|
261
|
-
$schema:
|
|
262
|
-
$id:
|
|
263
|
-
title:
|
|
264
|
-
description:
|
|
265
|
-
type:
|
|
266
|
-
properties:
|
|
267
|
-
required:
|
|
268
|
-
ignore:
|
|
259
|
+
], ve = {
|
|
260
|
+
$schema: pe,
|
|
261
|
+
$id: de,
|
|
262
|
+
title: me,
|
|
263
|
+
description: fe,
|
|
264
|
+
type: ye,
|
|
265
|
+
properties: ge,
|
|
266
|
+
required: he,
|
|
267
|
+
ignore: be
|
|
269
268
|
};
|
|
270
|
-
function
|
|
269
|
+
function Ce(e, n, t) {
|
|
271
270
|
return n;
|
|
272
271
|
}
|
|
273
|
-
const
|
|
272
|
+
const U = {
|
|
274
273
|
/**
|
|
275
274
|
* 组件标识
|
|
276
275
|
*/
|
|
@@ -374,356 +373,347 @@ const q = {
|
|
|
374
373
|
* 作为内嵌编辑器被创建后默认选中文本
|
|
375
374
|
*/
|
|
376
375
|
selectOnCreated: { type: Boolean, default: !1 }
|
|
377
|
-
},
|
|
378
|
-
function
|
|
379
|
-
const { format: i } =
|
|
380
|
-
function
|
|
381
|
-
const
|
|
382
|
-
return !(
|
|
376
|
+
}, Q = se(U, ve, ue, Ce);
|
|
377
|
+
function Y(e, n, t, r) {
|
|
378
|
+
const { format: i } = t, { displayValue: s, getRealValue: u, modelValue: p, onNumberValueChanged: d } = r;
|
|
379
|
+
function a() {
|
|
380
|
+
const b = new N(p.value || 0);
|
|
381
|
+
return !(e.max && !new N(e.max).isNaN() && b.gte(new N(e.max)));
|
|
383
382
|
}
|
|
384
383
|
function l() {
|
|
385
|
-
const
|
|
386
|
-
return !(
|
|
384
|
+
const b = new N(p.value || 0);
|
|
385
|
+
return !(e.min && !new N(e.min).isNaN() && b.lte(new N(e.min)));
|
|
387
386
|
}
|
|
388
|
-
function
|
|
389
|
-
if (
|
|
387
|
+
function o(b) {
|
|
388
|
+
if (e.readonly || e.disabled)
|
|
390
389
|
return;
|
|
391
|
-
const
|
|
392
|
-
if (
|
|
393
|
-
const
|
|
394
|
-
|
|
390
|
+
const w = b === "up" ? a : l, S = b === "up" ? "plus" : "minus";
|
|
391
|
+
if (w()) {
|
|
392
|
+
const C = new N(p.value || 0)[S](Number(e.step)), h = C.toFixed();
|
|
393
|
+
s.value = i(h), d(u(C));
|
|
395
394
|
}
|
|
396
395
|
}
|
|
397
|
-
function
|
|
398
|
-
|
|
396
|
+
function c() {
|
|
397
|
+
o("up");
|
|
399
398
|
}
|
|
400
|
-
function
|
|
401
|
-
|
|
399
|
+
function f() {
|
|
400
|
+
o("down");
|
|
402
401
|
}
|
|
403
|
-
function m(
|
|
404
|
-
|
|
402
|
+
function m(b) {
|
|
403
|
+
c(), b.stopPropagation();
|
|
405
404
|
}
|
|
406
|
-
function
|
|
407
|
-
|
|
405
|
+
function g(b) {
|
|
406
|
+
f(), b.stopPropagation();
|
|
408
407
|
}
|
|
409
|
-
return { canDownward: l, canUpward:
|
|
408
|
+
return { canDownward: l, canUpward: a, downward: f, onClickDownButton: g, onClickUpButton: m, upward: c };
|
|
410
409
|
}
|
|
411
|
-
function H(
|
|
412
|
-
const r =
|
|
413
|
-
prefix:
|
|
414
|
-
suffix:
|
|
415
|
-
decimalSeparator:
|
|
416
|
-
groupSeparator:
|
|
417
|
-
groupSize:
|
|
418
|
-
})), { getValidNumberObject: i, precision:
|
|
419
|
-
function
|
|
420
|
-
return
|
|
421
|
-
}
|
|
422
|
-
function p(
|
|
423
|
-
return
|
|
424
|
-
}
|
|
425
|
-
function
|
|
426
|
-
const l =
|
|
427
|
-
return
|
|
428
|
-
}
|
|
429
|
-
return { cleanFormat:
|
|
410
|
+
function H(e, n, t) {
|
|
411
|
+
const r = F(() => ({
|
|
412
|
+
prefix: e.prefix,
|
|
413
|
+
suffix: e.suffix,
|
|
414
|
+
decimalSeparator: e.decimalSeparator,
|
|
415
|
+
groupSeparator: e.useThousands ? e.groupSeparator : "",
|
|
416
|
+
groupSize: e.groupSize
|
|
417
|
+
})), { getValidNumberObject: i, precision: s } = t;
|
|
418
|
+
function u(a) {
|
|
419
|
+
return a = a == null || a === "" ? "" : String(a), a = a.replace(new RegExp(e.prefix, "g"), "").replace(new RegExp(e.suffix, "g"), "").replace(/,/g, ""), e.groupSeparator && e.groupSeparator !== "," && (a = a.replace(new RegExp(`\\${e.groupSeparator}`, "g"), "")), e.decimalSeparator && e.decimalSeparator !== "." && (a = a.replace(new RegExp(`\\${e.decimalSeparator}`, "g"), ".")), a;
|
|
420
|
+
}
|
|
421
|
+
function p(a, l) {
|
|
422
|
+
return e.precision !== null && e.precision !== void 0 ? a.toFormat(s.value, l) : a.toFormat(l);
|
|
423
|
+
}
|
|
424
|
+
function d(a) {
|
|
425
|
+
const l = u(a), o = new N(l, 10), c = i(o);
|
|
426
|
+
return c.valueOf() === "0" && !e.showZero || c.isNaN() ? "" : e.formatter ? e.formatter(c.toNumber()) : p(c, r.value);
|
|
427
|
+
}
|
|
428
|
+
return { cleanFormat: u, format: d };
|
|
430
429
|
}
|
|
431
|
-
function
|
|
432
|
-
const
|
|
433
|
-
function
|
|
430
|
+
function _(e, n) {
|
|
431
|
+
const t = B(""), r = B(e.modelValue), i = F(() => Number(e.precision) || 0);
|
|
432
|
+
function s(l) {
|
|
434
433
|
return l.toFixed(i.value);
|
|
435
434
|
}
|
|
436
|
-
function
|
|
435
|
+
function u(l) {
|
|
437
436
|
return isNaN(l) || l === null || l === void 0 || l === "";
|
|
438
437
|
}
|
|
439
438
|
function p(l) {
|
|
440
|
-
const
|
|
441
|
-
return
|
|
442
|
-
}
|
|
443
|
-
function
|
|
444
|
-
if (
|
|
445
|
-
return isNaN(Number(l)) ?
|
|
446
|
-
let
|
|
447
|
-
if (
|
|
448
|
-
if (
|
|
439
|
+
const o = u(e.max) ? null : new N(String(e.max), 10), c = u(e.min) ? null : new N(String(e.min), 10);
|
|
440
|
+
return o && l.gt(o) ? o : c && l.lt(c) ? c : l;
|
|
441
|
+
}
|
|
442
|
+
function d(l) {
|
|
443
|
+
if (e.parser)
|
|
444
|
+
return isNaN(Number(l)) ? e.parser(l) : l;
|
|
445
|
+
let o = p(new N(l, 10));
|
|
446
|
+
if (o.isNaN()) {
|
|
447
|
+
if (e.canNull)
|
|
449
448
|
return null;
|
|
450
|
-
const
|
|
451
|
-
if (!
|
|
452
|
-
|
|
449
|
+
const f = new N("" + e.min, 10), m = new N("" + e.max, 10);
|
|
450
|
+
if (!f.isNaN())
|
|
451
|
+
o = f;
|
|
453
452
|
else if (!m.isNaN())
|
|
454
|
-
|
|
453
|
+
o = m;
|
|
455
454
|
else
|
|
456
455
|
return 0;
|
|
457
456
|
}
|
|
458
|
-
return
|
|
457
|
+
return s(o);
|
|
459
458
|
}
|
|
460
|
-
function
|
|
461
|
-
const
|
|
462
|
-
r.value =
|
|
459
|
+
function a(l) {
|
|
460
|
+
const o = Number(l);
|
|
461
|
+
r.value = o, n.emit("update:modelValue", o), n.emit("valueChange", o), n.emit("change", o);
|
|
463
462
|
}
|
|
464
|
-
return { displayValue:
|
|
463
|
+
return { displayValue: t, getRealValue: d, modelValue: r, isEmpty: u, onNumberValueChanged: a, precision: i, getValidNumberObject: p };
|
|
465
464
|
}
|
|
466
|
-
function
|
|
467
|
-
const { cleanFormat:
|
|
468
|
-
function C
|
|
469
|
-
var
|
|
470
|
-
if (
|
|
465
|
+
function we(e, n, t, r, i) {
|
|
466
|
+
const { cleanFormat: s, format: u } = t, { displayValue: p, getRealValue: d, modelValue: a, isEmpty: l, onNumberValueChanged: o } = r, { downward: c, upward: f } = i, m = B(!1), g = F(() => p.value);
|
|
467
|
+
function b(C) {
|
|
468
|
+
var M;
|
|
469
|
+
if (C.stopPropagation(), m.value = !1, e.readonly || e.disabled)
|
|
471
470
|
return;
|
|
472
|
-
let
|
|
473
|
-
|
|
474
|
-
const
|
|
475
|
-
p.value =
|
|
476
|
-
}
|
|
477
|
-
function
|
|
478
|
-
|
|
479
|
-
}
|
|
480
|
-
function
|
|
481
|
-
var
|
|
482
|
-
|
|
483
|
-
let
|
|
484
|
-
|
|
485
|
-
const
|
|
486
|
-
p.value =
|
|
487
|
-
}
|
|
488
|
-
function
|
|
489
|
-
|
|
490
|
-
}
|
|
491
|
-
return { textBoxValue:
|
|
471
|
+
let h = (M = C.target) == null ? void 0 : M.value;
|
|
472
|
+
e.canNull || (h = h || 0);
|
|
473
|
+
const k = s(h);
|
|
474
|
+
p.value = u(k), o(d(k)), n.emit("blur", { event: C, formatted: p.value, value: a.value });
|
|
475
|
+
}
|
|
476
|
+
function w(C) {
|
|
477
|
+
C.stopPropagation(), m.value = !0, !(e.readonly || e.disabled) && (p.value = l(a.value) || !e.showZero && a.value === "0" ? "" : String(a.value), n.emit("focus", { event: C, formatted: p.value, value: a.value }));
|
|
478
|
+
}
|
|
479
|
+
function S(C) {
|
|
480
|
+
var M;
|
|
481
|
+
C.stopPropagation();
|
|
482
|
+
let h = (M = C.target) == null ? void 0 : M.value;
|
|
483
|
+
e.canNull || (h = h || 0);
|
|
484
|
+
const k = s(h);
|
|
485
|
+
p.value = k, o(d(k));
|
|
486
|
+
}
|
|
487
|
+
function T(C) {
|
|
488
|
+
C.key === "ArrowDown" && (C.preventDefault(), c()), C.key === "ArrowUp" && (C.preventDefault(), f()), C.stopPropagation();
|
|
489
|
+
}
|
|
490
|
+
return { textBoxValue: g, onBlurTextBox: b, onFocusTextBox: w, onInput: S, onKeyDown: T, isFocus: m };
|
|
492
491
|
}
|
|
493
|
-
function
|
|
492
|
+
function K(e, n, t) {
|
|
494
493
|
const {
|
|
495
494
|
canDownward: r,
|
|
496
495
|
canUpward: i,
|
|
497
|
-
onClickDownButton:
|
|
498
|
-
onClickUpButton:
|
|
499
|
-
} =
|
|
496
|
+
onClickDownButton: s,
|
|
497
|
+
onClickUpButton: u
|
|
498
|
+
} = t, p = F(() => ({
|
|
500
499
|
"input-group-append": !0,
|
|
501
500
|
"btn-group": !0,
|
|
502
501
|
"btn-group-number": !0
|
|
503
|
-
})),
|
|
502
|
+
})), d = F(() => ({
|
|
504
503
|
btn: !0,
|
|
505
504
|
"btn-secondary": !0,
|
|
506
505
|
"btn-number-flag": !0
|
|
507
|
-
})),
|
|
506
|
+
})), a = F(() => ({
|
|
508
507
|
cursor: i() ? "pointer" : "not-allowed",
|
|
509
508
|
"margin-left": 0
|
|
510
|
-
})), l =
|
|
509
|
+
})), l = F(() => ({
|
|
511
510
|
cursor: r() ? "pointer" : "not-allowed",
|
|
512
511
|
"margin-left": 0
|
|
513
512
|
}));
|
|
514
|
-
return () =>
|
|
513
|
+
return () => E("div", {
|
|
515
514
|
class: p.value
|
|
516
|
-
}, [
|
|
515
|
+
}, [E("button", {
|
|
517
516
|
title: "upButton",
|
|
518
|
-
class:
|
|
519
|
-
style:
|
|
520
|
-
onClick:
|
|
517
|
+
class: d.value,
|
|
518
|
+
style: a.value,
|
|
519
|
+
onClick: u,
|
|
521
520
|
disabled: !i()
|
|
522
|
-
}, [
|
|
521
|
+
}, [E("span", {
|
|
523
522
|
class: "f-icon f-icon-arrow-chevron-up number-arrow-chevron"
|
|
524
|
-
}, null)]),
|
|
523
|
+
}, null)]), E("button", {
|
|
525
524
|
title: "downButton",
|
|
526
|
-
class:
|
|
525
|
+
class: d.value,
|
|
527
526
|
style: l.value,
|
|
528
|
-
onClick:
|
|
527
|
+
onClick: s,
|
|
529
528
|
disabled: !r()
|
|
530
|
-
}, [
|
|
529
|
+
}, [E("span", {
|
|
531
530
|
class: "f-icon f-icon-arrow-chevron-down number-arrow-chevron"
|
|
532
531
|
}, null)])]);
|
|
533
532
|
}
|
|
534
|
-
function
|
|
535
|
-
const r =
|
|
533
|
+
function Se(e, n, t) {
|
|
534
|
+
const r = B(), {
|
|
536
535
|
onBlurTextBox: i,
|
|
537
|
-
onFocusTextBox:
|
|
538
|
-
onInput:
|
|
536
|
+
onFocusTextBox: s,
|
|
537
|
+
onInput: u,
|
|
539
538
|
onKeyDown: p,
|
|
540
|
-
textBoxValue:
|
|
541
|
-
} =
|
|
539
|
+
textBoxValue: d
|
|
540
|
+
} = t, a = F(() => e.disabled || e.readonly || !e.editable ? "" : e.placeholder), l = F(() => ({
|
|
542
541
|
"form-control": !0,
|
|
543
542
|
"f-utils-fill": !0
|
|
544
|
-
})),
|
|
545
|
-
"text-align":
|
|
543
|
+
})), o = F(() => ({
|
|
544
|
+
"text-align": e.textAlign
|
|
546
545
|
}));
|
|
547
|
-
function
|
|
548
|
-
|
|
546
|
+
function c(g) {
|
|
547
|
+
g.stopPropagation();
|
|
549
548
|
}
|
|
550
|
-
function
|
|
551
|
-
|
|
549
|
+
function f() {
|
|
550
|
+
e.selectOnCreated, e.focusOnCreated;
|
|
552
551
|
}
|
|
553
|
-
async function m(
|
|
554
|
-
|
|
552
|
+
async function m(g) {
|
|
553
|
+
s(g), await j, f();
|
|
555
554
|
}
|
|
556
|
-
return
|
|
557
|
-
await
|
|
558
|
-
}), () =>
|
|
555
|
+
return x(async () => {
|
|
556
|
+
await j, f();
|
|
557
|
+
}), () => E("input", {
|
|
559
558
|
ref: r,
|
|
560
559
|
class: l.value,
|
|
561
|
-
style:
|
|
560
|
+
style: o.value,
|
|
562
561
|
type: "text",
|
|
563
|
-
value:
|
|
564
|
-
disabled:
|
|
565
|
-
readonly:
|
|
566
|
-
placeholder:
|
|
562
|
+
value: d.value,
|
|
563
|
+
disabled: e.disabled,
|
|
564
|
+
readonly: e.readonly || !e.editable,
|
|
565
|
+
placeholder: a.value,
|
|
567
566
|
onBlur: i,
|
|
568
|
-
onChange:
|
|
567
|
+
onChange: c,
|
|
569
568
|
onFocus: m,
|
|
570
|
-
onInput:
|
|
569
|
+
onInput: u,
|
|
571
570
|
onKeydown: p
|
|
572
571
|
}, null);
|
|
573
572
|
}
|
|
574
|
-
const
|
|
573
|
+
const P = /* @__PURE__ */ q({
|
|
575
574
|
name: "FNumberSpinner",
|
|
576
|
-
props:
|
|
575
|
+
props: U,
|
|
577
576
|
emits: ["update:modelValue", "valueChange", "change", "blur", "focus", "click", "input"],
|
|
578
|
-
setup(
|
|
579
|
-
const
|
|
577
|
+
setup(e, n) {
|
|
578
|
+
const t = _(e, n), r = H(e, n, t), i = Y(e, n, r, t), s = we(e, n, r, t, i), u = K(e, n, i), {
|
|
580
579
|
displayValue: p,
|
|
581
|
-
modelValue:
|
|
582
|
-
getRealValue:
|
|
583
|
-
} =
|
|
584
|
-
format:
|
|
580
|
+
modelValue: d,
|
|
581
|
+
getRealValue: a
|
|
582
|
+
} = t, l = Se(e, n, s), {
|
|
583
|
+
format: o
|
|
585
584
|
} = r, {
|
|
586
|
-
isFocus:
|
|
587
|
-
} =
|
|
588
|
-
return
|
|
589
|
-
const m =
|
|
590
|
-
p.value =
|
|
591
|
-
}),
|
|
592
|
-
const
|
|
593
|
-
|
|
594
|
-
}),
|
|
595
|
-
m !==
|
|
596
|
-
}),
|
|
597
|
-
p.value =
|
|
598
|
-
}), () =>
|
|
585
|
+
isFocus: c
|
|
586
|
+
} = s, f = F(() => !e.disabled && !e.readonly && e.showButton);
|
|
587
|
+
return x(() => {
|
|
588
|
+
const m = a(e.modelValue);
|
|
589
|
+
p.value = o(m);
|
|
590
|
+
}), L(() => [e.value], ([m]) => {
|
|
591
|
+
const g = a(m);
|
|
592
|
+
d.value = g, p.value = o(g);
|
|
593
|
+
}), L(() => [e.modelValue], ([m]) => {
|
|
594
|
+
m !== d.value && (d.value = m, !c.value && (p.value = o(a(m))));
|
|
595
|
+
}), L(() => [e.precision, e.useThousands, e.prefix, e.suffix, e.showZero], () => {
|
|
596
|
+
p.value = o(d.value);
|
|
597
|
+
}), () => E("div", {
|
|
599
598
|
class: "input-group f-state-hover flex-row f-cmp-number-spinner"
|
|
600
|
-
}, [l(),
|
|
599
|
+
}, [l(), f.value && u()]);
|
|
601
600
|
}
|
|
602
601
|
});
|
|
603
|
-
function
|
|
604
|
-
var
|
|
602
|
+
function ke(e, n, t) {
|
|
603
|
+
var C;
|
|
605
604
|
function r() {
|
|
606
|
-
|
|
605
|
+
t != null && t.resolveComponentContext && t.resolveComponentContext();
|
|
607
606
|
}
|
|
608
607
|
r();
|
|
609
|
-
const i =
|
|
608
|
+
const i = t && t.getStyles && t.getStyles() || "", s = t && t.getDesignerClass && t.getDesignerClass() || "", u = B();
|
|
610
609
|
function p() {
|
|
611
|
-
return (n == null ? void 0 : n.schema.componentType) === "frame" ? !1 :
|
|
610
|
+
return (n == null ? void 0 : n.schema.componentType) === "frame" ? !1 : t && t.checkCanMoveComponent ? t.checkCanMoveComponent() : !0;
|
|
612
611
|
}
|
|
613
|
-
function
|
|
612
|
+
function d() {
|
|
614
613
|
return !1;
|
|
615
614
|
}
|
|
616
|
-
function
|
|
617
|
-
return (n == null ? void 0 : n.schema.componentType) === "frame" ? !1 :
|
|
615
|
+
function a() {
|
|
616
|
+
return (n == null ? void 0 : n.schema.componentType) === "frame" ? !1 : t && t.checkCanDeleteComponent ? t.checkCanDeleteComponent() : !0;
|
|
618
617
|
}
|
|
619
618
|
function l() {
|
|
620
|
-
return (n == null ? void 0 : n.schema.componentType) === "frame" ? !0 :
|
|
619
|
+
return (n == null ? void 0 : n.schema.componentType) === "frame" ? !0 : t && t.hideNestedPaddingInDesginerView ? t.hideNestedPaddingInDesginerView() : !1;
|
|
621
620
|
}
|
|
622
|
-
function
|
|
623
|
-
if (!
|
|
621
|
+
function o(h) {
|
|
622
|
+
if (!h || !h.value)
|
|
624
623
|
return null;
|
|
625
|
-
if (
|
|
626
|
-
return
|
|
627
|
-
const
|
|
624
|
+
if (h.value.schema && h.value.schema.type === "component")
|
|
625
|
+
return h.value;
|
|
626
|
+
const k = B(h == null ? void 0 : h.value.parent), M = o(k);
|
|
628
627
|
return M || null;
|
|
629
628
|
}
|
|
630
|
-
function
|
|
631
|
-
const { componentInstance:
|
|
632
|
-
return !
|
|
629
|
+
function c(h = n) {
|
|
630
|
+
const { componentInstance: k, designerItemElementRef: M } = h;
|
|
631
|
+
return !k || !k.value ? null : k.value.canMove ? M : c(h.parent);
|
|
633
632
|
}
|
|
634
|
-
function
|
|
635
|
-
return !!
|
|
633
|
+
function f(h) {
|
|
634
|
+
return !!t && t.canAccepts(h);
|
|
636
635
|
}
|
|
637
636
|
function m() {
|
|
638
637
|
return (n == null ? void 0 : n.schema.label) || (n == null ? void 0 : n.schema.title) || (n == null ? void 0 : n.schema.name);
|
|
639
638
|
}
|
|
640
|
-
function
|
|
639
|
+
function g() {
|
|
641
640
|
}
|
|
642
|
-
function
|
|
643
|
-
|
|
641
|
+
function b(h, k) {
|
|
642
|
+
k && t != null && t.onAcceptMovedChildElement && t.onAcceptMovedChildElement(k);
|
|
644
643
|
}
|
|
645
|
-
function
|
|
646
|
-
const { componentType: M } =
|
|
647
|
-
let
|
|
648
|
-
|
|
644
|
+
function w(h, k) {
|
|
645
|
+
const { componentType: M } = h;
|
|
646
|
+
let V = J(M, h, k);
|
|
647
|
+
t && t.onResolveNewComponentSchema && (V = t.onResolveNewComponentSchema(h, V));
|
|
649
648
|
const A = M.toLowerCase().replace("-", "_");
|
|
650
|
-
return
|
|
651
|
-
}
|
|
652
|
-
function E(g, h) {
|
|
653
|
-
const M = String(g.getAttribute("data-controltype")), T = g.getAttribute("data-feature"), A = T ? JSON.parse(T) : {};
|
|
654
|
-
A.parentComponentInstance = s.value;
|
|
655
|
-
let x = j(M, A);
|
|
656
|
-
e && e.onAcceptNewChildElement && (x = e.onAcceptNewChildElement(g, h, x));
|
|
657
|
-
const te = M.toLowerCase().replace("-", "_");
|
|
658
|
-
return x && !x.id && x.type === M && (x.id = `${te}_${Math.random().toString().slice(2, 6)}`), x;
|
|
649
|
+
return V && !V.id && V.type === M && (V.id = `${A}_${Math.random().toString().slice(2, 6)}`), V;
|
|
659
650
|
}
|
|
660
|
-
function
|
|
651
|
+
function S(h) {
|
|
661
652
|
}
|
|
662
|
-
function
|
|
663
|
-
if (
|
|
664
|
-
return
|
|
653
|
+
function T(...h) {
|
|
654
|
+
if (t && t.getPropsConfig)
|
|
655
|
+
return t.getPropsConfig(...h);
|
|
665
656
|
}
|
|
666
|
-
return
|
|
657
|
+
return u.value = {
|
|
667
658
|
canMove: p(),
|
|
668
|
-
canSelectParent:
|
|
669
|
-
canDelete:
|
|
659
|
+
canSelectParent: d(),
|
|
660
|
+
canDelete: a(),
|
|
670
661
|
canNested: !l(),
|
|
671
662
|
contents: n == null ? void 0 : n.schema.contents,
|
|
672
|
-
elementRef:
|
|
673
|
-
parent: (
|
|
663
|
+
elementRef: e,
|
|
664
|
+
parent: (C = n == null ? void 0 : n.parent) == null ? void 0 : C.componentInstance,
|
|
674
665
|
schema: n == null ? void 0 : n.schema,
|
|
675
666
|
styles: i,
|
|
676
|
-
designerClass:
|
|
677
|
-
canAccepts:
|
|
678
|
-
getBelongedComponentInstance:
|
|
679
|
-
getDraggableDesignItemElement:
|
|
667
|
+
designerClass: s,
|
|
668
|
+
canAccepts: f,
|
|
669
|
+
getBelongedComponentInstance: o,
|
|
670
|
+
getDraggableDesignItemElement: c,
|
|
680
671
|
getDraggingDisplayText: m,
|
|
681
|
-
getPropConfig:
|
|
682
|
-
getDragScopeElement:
|
|
683
|
-
onAcceptMovedChildElement:
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
addNewChildComponentSchema: F,
|
|
672
|
+
getPropConfig: T,
|
|
673
|
+
getDragScopeElement: g,
|
|
674
|
+
onAcceptMovedChildElement: b,
|
|
675
|
+
onChildElementMovedOut: S,
|
|
676
|
+
addNewChildComponentSchema: w,
|
|
687
677
|
updateDragAndDropRules: r,
|
|
688
|
-
triggerBelongedComponentToMoveWhenMoved: !!
|
|
689
|
-
triggerBelongedComponentToDeleteWhenDeleted: !!
|
|
690
|
-
},
|
|
678
|
+
triggerBelongedComponentToMoveWhenMoved: !!t && t.triggerBelongedComponentToMoveWhenMoved || B(!1),
|
|
679
|
+
triggerBelongedComponentToDeleteWhenDeleted: !!t && t.triggerBelongedComponentToDeleteWhenDeleted || B(!1)
|
|
680
|
+
}, u;
|
|
691
681
|
}
|
|
692
|
-
class
|
|
693
|
-
constructor(n,
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
682
|
+
class Me {
|
|
683
|
+
constructor(n, t) {
|
|
684
|
+
v(this, "componentId");
|
|
685
|
+
v(this, "viewModelId");
|
|
686
|
+
v(this, "eventsEditorUtils");
|
|
687
|
+
v(this, "formSchemaUtils");
|
|
688
|
+
v(this, "formMetadataConverter");
|
|
689
|
+
v(this, "designViewModelUtils");
|
|
690
|
+
v(this, "designViewModelField");
|
|
691
|
+
v(this, "controlCreatorUtils");
|
|
692
|
+
v(this, "designerHostService");
|
|
693
|
+
v(this, "schemaService", null);
|
|
694
|
+
v(this, "metadataService", null);
|
|
695
|
+
v(this, "propertyConfig", {
|
|
706
696
|
type: "object",
|
|
707
697
|
categories: {}
|
|
708
698
|
});
|
|
709
699
|
var r;
|
|
710
|
-
this.componentId = n, this.designerHostService =
|
|
700
|
+
this.componentId = n, this.designerHostService = t, this.eventsEditorUtils = t.eventsEditorUtils, this.formSchemaUtils = t.formSchemaUtils, this.formMetadataConverter = t.formMetadataConverter, this.viewModelId = ((r = this.formSchemaUtils) == null ? void 0 : r.getViewModelIdByComponentId(n)) || "", this.designViewModelUtils = t.designViewModelUtils, this.controlCreatorUtils = t.controlCreatorUtils, this.metadataService = t.metadataService, this.schemaService = t.schemaService;
|
|
711
701
|
}
|
|
712
702
|
getTableInfo() {
|
|
713
703
|
var n;
|
|
714
704
|
return (n = this.schemaService) == null ? void 0 : n.getTableInfoByViewModelId(this.viewModelId);
|
|
715
705
|
}
|
|
716
706
|
setDesignViewModelField(n) {
|
|
717
|
-
const
|
|
718
|
-
if (
|
|
707
|
+
const t = n.binding && n.binding.type === "Form" && n.binding.field;
|
|
708
|
+
if (t) {
|
|
719
709
|
if (!this.designViewModelField) {
|
|
720
710
|
const r = this.designViewModelUtils.getDgViewModel(this.viewModelId);
|
|
721
|
-
this.designViewModelField = r.fields.find((i) => i.id ===
|
|
711
|
+
this.designViewModelField = r.fields.find((i) => i.id === t);
|
|
722
712
|
}
|
|
723
713
|
n.updateOn = this.designViewModelField.updateOn;
|
|
724
714
|
}
|
|
725
715
|
}
|
|
726
|
-
changeFieldEditorType(n,
|
|
716
|
+
changeFieldEditorType(n, t) {
|
|
727
717
|
}
|
|
728
718
|
getBasicPropConfig(n) {
|
|
729
719
|
return {
|
|
@@ -744,7 +734,7 @@ class Te {
|
|
|
744
734
|
type: "combo-list",
|
|
745
735
|
textField: "name",
|
|
746
736
|
valueField: "value",
|
|
747
|
-
data: [{ value: n.type, name:
|
|
737
|
+
data: [{ value: n.type, name: y[n.type].name }]
|
|
748
738
|
}
|
|
749
739
|
}
|
|
750
740
|
}
|
|
@@ -776,12 +766,12 @@ class Te {
|
|
|
776
766
|
* @param componentInstance
|
|
777
767
|
* @returns
|
|
778
768
|
*/
|
|
779
|
-
updateElementByParentContainer(n,
|
|
780
|
-
const r =
|
|
769
|
+
updateElementByParentContainer(n, t) {
|
|
770
|
+
const r = t && t.parent && t.parent.schema;
|
|
781
771
|
if (!r)
|
|
782
772
|
return;
|
|
783
|
-
const i = r.contents.findIndex((
|
|
784
|
-
r.contents.splice(i, 1), r.contents.splice(i, 0,
|
|
773
|
+
const i = r.contents.findIndex((u) => u.id === n), s = z(r.contents[i]);
|
|
774
|
+
r.contents.splice(i, 1), r.contents.splice(i, 0, s);
|
|
785
775
|
}
|
|
786
776
|
}
|
|
787
777
|
const D = class D {
|
|
@@ -789,16 +779,16 @@ const D = class D {
|
|
|
789
779
|
* 根据绑定字段类型获取可用的输入类控件
|
|
790
780
|
*/
|
|
791
781
|
static getEditorTypesByMDataType(n) {
|
|
792
|
-
const
|
|
793
|
-
return
|
|
782
|
+
const t = D.fieldControlTypeMapping[n];
|
|
783
|
+
return t || [{ key: "", value: "" }];
|
|
794
784
|
}
|
|
795
785
|
/**
|
|
796
786
|
* 获取所有输入类控件
|
|
797
787
|
*/
|
|
798
788
|
static getAllInputTypes() {
|
|
799
789
|
const n = [];
|
|
800
|
-
for (let
|
|
801
|
-
D.fieldControlTypeMapping[
|
|
790
|
+
for (let t in D.fieldControlTypeMapping)
|
|
791
|
+
D.fieldControlTypeMapping[t].forEach((r) => {
|
|
802
792
|
n.find((i) => i.key === r.key && i.value === r.value) || n.push({ key: r.key, value: r.value });
|
|
803
793
|
});
|
|
804
794
|
return n;
|
|
@@ -807,68 +797,175 @@ const D = class D {
|
|
|
807
797
|
/**
|
|
808
798
|
* <字段类型,可配置的控件类型列表>的映射
|
|
809
799
|
*/
|
|
810
|
-
|
|
800
|
+
v(D, "fieldControlTypeMapping", {
|
|
811
801
|
String: [
|
|
812
|
-
{ key:
|
|
813
|
-
{ key:
|
|
814
|
-
{ key:
|
|
815
|
-
{ key:
|
|
816
|
-
{ key:
|
|
817
|
-
{ key:
|
|
818
|
-
{ key:
|
|
802
|
+
{ key: y["input-group"].type, value: y["input-group"].name },
|
|
803
|
+
{ key: y.lookup.type, value: y.lookup.name },
|
|
804
|
+
{ key: y["date-picker"].type, value: y["date-picker"].name },
|
|
805
|
+
{ key: y["check-box"].type, value: y["check-box"].name },
|
|
806
|
+
{ key: y["check-group"].type, value: y["check-group"].name },
|
|
807
|
+
{ key: y["radio-group"].type, value: y["radio-group"].name },
|
|
808
|
+
{ key: y["combo-list"].type, value: y["combo-list"].name },
|
|
809
|
+
{ key: y.textarea.type, value: y.textarea.name }
|
|
819
810
|
],
|
|
820
811
|
Text: [
|
|
821
|
-
{ key:
|
|
822
|
-
{ key:
|
|
812
|
+
{ key: y.textarea.type, value: y.textarea.name },
|
|
813
|
+
{ key: y.lookup.type, value: y.lookup.name }
|
|
823
814
|
],
|
|
824
815
|
Decimal: [
|
|
825
|
-
{ key:
|
|
816
|
+
{ key: y["number-spinner"].type, value: y["number-spinner"].name }
|
|
826
817
|
],
|
|
827
818
|
Integer: [
|
|
828
|
-
{ key:
|
|
819
|
+
{ key: y["number-spinner"].type, value: y["number-spinner"].name }
|
|
829
820
|
],
|
|
830
821
|
Number: [
|
|
831
|
-
{ key:
|
|
822
|
+
{ key: y["number-spinner"].type, value: y["number-spinner"].name }
|
|
832
823
|
],
|
|
833
824
|
BigNumber: [
|
|
834
|
-
{ key:
|
|
825
|
+
{ key: y["number-spinner"].type, value: y["number-spinner"].name }
|
|
835
826
|
],
|
|
836
827
|
Date: [
|
|
837
|
-
{ key:
|
|
828
|
+
{ key: y["date-picker"].type, value: y["date-picker"].name }
|
|
838
829
|
],
|
|
839
830
|
DateTime: [
|
|
840
|
-
{ key:
|
|
831
|
+
{ key: y["date-picker"].type, value: y["date-picker"].name }
|
|
841
832
|
],
|
|
842
833
|
Boolean: [
|
|
843
|
-
{ key:
|
|
844
|
-
{ key:
|
|
834
|
+
{ key: y.switch.type, value: y.switch.name },
|
|
835
|
+
{ key: y["check-box"].type, value: y["check-box"].name }
|
|
845
836
|
],
|
|
846
837
|
Enum: [
|
|
847
|
-
{ key:
|
|
848
|
-
{ key:
|
|
838
|
+
{ key: y["combo-list"].type, value: y["combo-list"].name },
|
|
839
|
+
{ key: y["radio-group"].type, value: y["radio-group"].name }
|
|
849
840
|
],
|
|
850
841
|
Object: [
|
|
851
|
-
{ key:
|
|
852
|
-
{ key:
|
|
853
|
-
{ key:
|
|
842
|
+
{ key: y.lookup.type, value: y.lookup.name },
|
|
843
|
+
{ key: y["combo-list"].type, value: y["combo-list"].name },
|
|
844
|
+
{ key: y["radio-group"].type, value: y["radio-group"].name }
|
|
854
845
|
]
|
|
855
846
|
});
|
|
856
|
-
let
|
|
857
|
-
const
|
|
858
|
-
class
|
|
859
|
-
constructor(
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
847
|
+
let I = D;
|
|
848
|
+
const Ne = B(0);
|
|
849
|
+
class Be {
|
|
850
|
+
constructor() {
|
|
851
|
+
/** 控件标题 */
|
|
852
|
+
v(this, "label", "");
|
|
853
|
+
/** 控件id */
|
|
854
|
+
v(this, "id", "");
|
|
855
|
+
/** 每个控件占用的栅格数 */
|
|
856
|
+
v(this, "columnInSM", 12);
|
|
857
|
+
v(this, "columnInMD", 6);
|
|
858
|
+
v(this, "columnInLG", 3);
|
|
859
|
+
v(this, "columnInEL", 2);
|
|
860
|
+
/** 每个控件占用的列数 */
|
|
861
|
+
v(this, "displayWidthInSM", 1);
|
|
862
|
+
v(this, "displayWidthInMD", 1);
|
|
863
|
+
v(this, "displayWidthInLG", 1);
|
|
864
|
+
v(this, "displayWidthInEL", 1);
|
|
865
|
+
/** 编辑器内部默认显示的屏幕大小-----可以去掉 */
|
|
866
|
+
v(this, "displayColumnCountAtBreakPoint", "md");
|
|
867
|
+
/** 控件所在行,传0即可-----编辑器内部使用 */
|
|
868
|
+
v(this, "tagRow", 0);
|
|
869
|
+
/** 控件是否显示上方空白:传0即可-----编辑器内部使用 */
|
|
870
|
+
v(this, "showTopBorder", 0);
|
|
871
|
+
/** 区域,从1开始。卡片内的控件从上往下,从左往右划分区域,遇到分组fieldSet时group+1,分组结束后group+1 */
|
|
872
|
+
v(this, "group", 1);
|
|
873
|
+
/** 控件是否符合标准的class配置(设计器用的) */
|
|
874
|
+
v(this, "isSupportedClass", !0);
|
|
875
|
+
/** 控件所在分组id(设计器用的) */
|
|
876
|
+
v(this, "fieldSetId", "");
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
function Fe(e) {
|
|
880
|
+
let n, t;
|
|
881
|
+
const r = /* @__PURE__ */ new Map();
|
|
882
|
+
let i = [];
|
|
883
|
+
function s(l, o) {
|
|
884
|
+
const f = l.split(" ").filter((S) => S.startsWith("col-"));
|
|
885
|
+
if (f.length === 0) {
|
|
886
|
+
o.isSupportedClass = !1;
|
|
887
|
+
return;
|
|
888
|
+
}
|
|
889
|
+
let m = f.find((S) => /^col-([1-9]|10|11|12)$/.test(S)), g = f.find((S) => /^col-md-([1-9]|10|11|12)$/.test(S)), b = f.find((S) => /^col-xl-([1-9]|10|11|12)$/.test(S)), w = f.find((S) => /^col-el-([1-9]|10|11|12)$/.test(S));
|
|
890
|
+
m = m || "col-12", o.columnInSM = parseInt(m.replace("col-", ""), 10), o.displayWidthInSM = o.columnInSM / 12, o.displayWidthInSM !== 1 && (o.isSupportedClass = !1), g = g || "col-md-" + o.columnInSM, o.columnInMD = parseInt(g.replace("col-md-", ""), 10), o.displayWidthInMD = o.columnInMD / 6, [1, 2].includes(o.displayWidthInMD) || (o.isSupportedClass = !1), b = b || "col-xl-" + o.columnInMD, o.columnInLG = parseInt(b.replace("col-xl-", ""), 10), o.displayWidthInLG = o.columnInLG / 3, [1, 2, 3, 4].includes(o.displayWidthInLG) || (o.isSupportedClass = !1), w = w || "col-el-" + o.columnInLG, o.columnInEL = parseInt(w.replace("col-el-", ""), 10), o.displayWidthInEL = o.columnInEL / 2, [1, 2, 3, 4, 5, 6].includes(o.displayWidthInEL) || (o.isSupportedClass = !1);
|
|
891
|
+
}
|
|
892
|
+
function u(l, o, c, f = !1) {
|
|
893
|
+
let m = !1;
|
|
894
|
+
l.contents.forEach((g) => {
|
|
895
|
+
if (g.type === "fieldset") {
|
|
896
|
+
c += 1, u(g, o, c, !0), m = !0;
|
|
897
|
+
return;
|
|
898
|
+
}
|
|
899
|
+
m && (c += 1, m = !1);
|
|
900
|
+
const b = g.appearance && g.appearance.class, w = new Be();
|
|
901
|
+
b ? s(b, w) : w.isSupportedClass = !1, w.label = g.label || g.id, w.id = g.id, w.group = c, f && (w.fieldSetId = l.id), t === g.id && (n = c), r.set(g.id, g), o.push(w);
|
|
902
|
+
});
|
|
903
|
+
}
|
|
904
|
+
function p(l) {
|
|
905
|
+
const o = e.getComponentById(l);
|
|
906
|
+
if (!o || !o.componentType || !o.componentType.startsWith("form"))
|
|
907
|
+
return { result: !1, message: "只可以在响应式表单组件中调整响应式布局配置" };
|
|
908
|
+
const c = e.selectNode(o, (f) => f.type === $["response-form"].type);
|
|
909
|
+
return !c || !c.contents || c.contents.length === 0 ? { result: !1, message: "Form区域内没有控件,请先添加控件" } : { result: !0, message: "", formNode: c };
|
|
910
|
+
}
|
|
911
|
+
function d(l, o) {
|
|
912
|
+
o = o || l.id;
|
|
913
|
+
const { result: c, message: f, formNode: m } = p(o);
|
|
914
|
+
if (!c)
|
|
915
|
+
return { result: c, message: f };
|
|
916
|
+
t = l.id, i = [], r.clear();
|
|
917
|
+
const g = m.contents[0].type === $.fieldset.type ? 0 : 1;
|
|
918
|
+
u(m, i, g);
|
|
919
|
+
const b = i.find((S) => !S.isSupportedClass);
|
|
920
|
+
return {
|
|
921
|
+
defaultState: {
|
|
922
|
+
defaultGroupNumber: n || 1,
|
|
923
|
+
model: b ? "customize" : "standard"
|
|
924
|
+
},
|
|
925
|
+
importData: i
|
|
926
|
+
};
|
|
927
|
+
}
|
|
928
|
+
function a(l, o) {
|
|
929
|
+
o = o;
|
|
930
|
+
const { result: c, formNode: f } = p(o);
|
|
931
|
+
if (!c)
|
|
932
|
+
return "";
|
|
933
|
+
const m = [];
|
|
934
|
+
return l.forEach((g) => {
|
|
935
|
+
var S;
|
|
936
|
+
const b = r.get(g.id), w = b.appearance && b.appearance.class;
|
|
937
|
+
if (w) {
|
|
938
|
+
const C = w.split(" ").filter((R) => !R.startsWith("col-")), h = "col-" + g.columnInSM, k = "col-md-" + g.columnInMD, M = "col-xl-" + g.columnInLG, V = "col-el-" + g.columnInEL, A = [h, k, M, V].concat(C);
|
|
939
|
+
b.appearance.class = A.join(" ");
|
|
940
|
+
}
|
|
941
|
+
if (g.fieldSetId) {
|
|
942
|
+
const T = f.contents.find((h) => h.id === g.fieldSetId), C = m.find((h) => h.id === g.fieldSetId);
|
|
943
|
+
C ? (S = C.contents) == null || S.push(b) : (m.push(T), T.contents = [b]);
|
|
944
|
+
} else
|
|
945
|
+
m.push(b);
|
|
946
|
+
}), f.contents = m, f.id;
|
|
947
|
+
}
|
|
948
|
+
return {
|
|
949
|
+
checkCanFindFormNode: p,
|
|
950
|
+
checkCanOpenLayoutEditor: d,
|
|
951
|
+
changeFormControlsByResponseLayoutConfig: a,
|
|
952
|
+
getResonseFormLayoutConfig: u
|
|
953
|
+
};
|
|
954
|
+
}
|
|
955
|
+
class Te extends Me {
|
|
956
|
+
constructor(t, r) {
|
|
957
|
+
super(t, r);
|
|
958
|
+
v(this, "responseLayoutEditorFunction");
|
|
959
|
+
this.responseLayoutEditorFunction = Fe(this.formSchemaUtils);
|
|
960
|
+
}
|
|
961
|
+
getPropertyConfig(t, r) {
|
|
962
|
+
return this.propertyConfig.categories.basic = this.getBasicProperties(t, r), this.propertyConfig.categories.appearance = this.getAppearanceProperties(t, r), this.propertyConfig.categories.editor = this.getEditorProperties(t), this.propertyConfig;
|
|
963
|
+
}
|
|
964
|
+
getBasicProperties(t, r) {
|
|
868
965
|
var p;
|
|
869
966
|
var i = this;
|
|
870
|
-
this.setDesignViewModelField(
|
|
871
|
-
const
|
|
967
|
+
this.setDesignViewModelField(t);
|
|
968
|
+
const s = this.formSchemaUtils.getFormMetadataBasicInfo(), u = this.designViewModelUtils.getAllFields2TreeByVMId(this.viewModelId);
|
|
872
969
|
return {
|
|
873
970
|
description: "Basic Information",
|
|
874
971
|
title: "基本信息",
|
|
@@ -890,7 +987,7 @@ class Fe extends Te {
|
|
|
890
987
|
textField: "value",
|
|
891
988
|
valueField: "key",
|
|
892
989
|
editable: !1,
|
|
893
|
-
data: i.designViewModelField ?
|
|
990
|
+
data: i.designViewModelField ? I.getEditorTypesByMDataType((p = i.designViewModelField.type) == null ? void 0 : p.name) : I.getAllInputTypes()
|
|
894
991
|
}
|
|
895
992
|
},
|
|
896
993
|
label: {
|
|
@@ -906,8 +1003,8 @@ class Fe extends Te {
|
|
|
906
1003
|
type: "field-selector",
|
|
907
1004
|
bindingType: { enable: !1 },
|
|
908
1005
|
editorParams: {
|
|
909
|
-
propertyData:
|
|
910
|
-
formBasicInfo:
|
|
1006
|
+
propertyData: t,
|
|
1007
|
+
formBasicInfo: s
|
|
911
1008
|
},
|
|
912
1009
|
columns: [
|
|
913
1010
|
{ field: "name", title: "字段名称" },
|
|
@@ -915,26 +1012,26 @@ class Fe extends Te {
|
|
|
915
1012
|
{ field: "fieldType", title: "字段类型" }
|
|
916
1013
|
],
|
|
917
1014
|
textField: "bindingField",
|
|
918
|
-
data:
|
|
1015
|
+
data: u
|
|
919
1016
|
}
|
|
920
1017
|
}
|
|
921
1018
|
},
|
|
922
|
-
setPropertyRelates(
|
|
923
|
-
if (
|
|
924
|
-
switch (
|
|
1019
|
+
setPropertyRelates(d, a) {
|
|
1020
|
+
if (d)
|
|
1021
|
+
switch (d && d.propertyID) {
|
|
925
1022
|
case "type": {
|
|
926
|
-
i.changeControlType(
|
|
1023
|
+
i.changeControlType(t, d, r);
|
|
927
1024
|
break;
|
|
928
1025
|
}
|
|
929
1026
|
case "label": {
|
|
930
|
-
|
|
1027
|
+
d.needRefreshControlTree = !0;
|
|
931
1028
|
break;
|
|
932
1029
|
}
|
|
933
1030
|
}
|
|
934
1031
|
}
|
|
935
1032
|
};
|
|
936
1033
|
}
|
|
937
|
-
getAppearanceProperties(
|
|
1034
|
+
getAppearanceProperties(t, r) {
|
|
938
1035
|
var i = this;
|
|
939
1036
|
return {
|
|
940
1037
|
title: "样式",
|
|
@@ -961,69 +1058,69 @@ class Fe extends Te {
|
|
|
961
1058
|
refreshPanelAfterChanged: !0,
|
|
962
1059
|
editor: {
|
|
963
1060
|
type: "response-layout-editor-setting",
|
|
964
|
-
initialState: i.responseLayoutEditorFunction.checkCanOpenLayoutEditor(
|
|
1061
|
+
initialState: i.responseLayoutEditorFunction.checkCanOpenLayoutEditor(t, i.componentId)
|
|
965
1062
|
}
|
|
966
1063
|
}
|
|
967
1064
|
},
|
|
968
|
-
setPropertyRelates(
|
|
969
|
-
if (
|
|
970
|
-
switch (
|
|
1065
|
+
setPropertyRelates(s, u) {
|
|
1066
|
+
if (s)
|
|
1067
|
+
switch (s && s.propertyID) {
|
|
971
1068
|
case "responseLayout":
|
|
972
|
-
i.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(
|
|
1069
|
+
i.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(s.propertyValue, i.componentId || t.id), i.updateUnifiedLayoutAfterResponseLayoutChanged(i.componentId), i.updateElementByParentContainer(t.id, r), delete t.responseLayout;
|
|
973
1070
|
break;
|
|
974
1071
|
case "class":
|
|
975
|
-
i.updateUnifiedLayoutAfterControlChanged(
|
|
1072
|
+
i.updateUnifiedLayoutAfterControlChanged(s.propertyValue, t.id, this.componentId), i.updateElementByParentContainer(t.id, r);
|
|
976
1073
|
break;
|
|
977
1074
|
}
|
|
978
1075
|
}
|
|
979
1076
|
};
|
|
980
1077
|
}
|
|
981
|
-
getEditorProperties(
|
|
982
|
-
return this.getComponentConfig(
|
|
1078
|
+
getEditorProperties(t) {
|
|
1079
|
+
return this.getComponentConfig(t);
|
|
983
1080
|
}
|
|
984
1081
|
/**
|
|
985
1082
|
* 卡片控件:切换控件类型后事件
|
|
986
1083
|
* @param propertyData 控件DOM属性
|
|
987
1084
|
* @param newControlType 新控件类型
|
|
988
1085
|
*/
|
|
989
|
-
changeControlType(
|
|
990
|
-
var l,
|
|
991
|
-
const
|
|
992
|
-
if (!
|
|
1086
|
+
changeControlType(t, r, i) {
|
|
1087
|
+
var l, o, c, f;
|
|
1088
|
+
const s = r.propertyValue, u = i && i.parent && i.parent.schema;
|
|
1089
|
+
if (!u)
|
|
993
1090
|
return;
|
|
994
|
-
const p =
|
|
995
|
-
let
|
|
1091
|
+
const p = u.contents.findIndex((m) => m.id === t.id), d = u.contents[p];
|
|
1092
|
+
let a;
|
|
996
1093
|
this.designViewModelField && (this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id, {
|
|
997
1094
|
editor: {
|
|
998
|
-
$type:
|
|
1095
|
+
$type: s
|
|
999
1096
|
},
|
|
1000
1097
|
name: this.designViewModelField.name,
|
|
1001
1098
|
require: this.designViewModelField.require,
|
|
1002
1099
|
readonly: this.designViewModelField.readonly
|
|
1003
|
-
}, !1),
|
|
1004
|
-
id:
|
|
1005
|
-
appearance:
|
|
1006
|
-
size:
|
|
1007
|
-
label:
|
|
1008
|
-
binding:
|
|
1009
|
-
visible:
|
|
1010
|
-
}), Object.assign(
|
|
1011
|
-
isTextArea:
|
|
1012
|
-
placeholder: (l =
|
|
1013
|
-
holdPlace: (
|
|
1014
|
-
readonly: (
|
|
1015
|
-
require: (
|
|
1016
|
-
}),
|
|
1100
|
+
}, !1), a = this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField, s)), a || (a = this.controlCreatorUtils.createFormGroupWithoutField(s)), Object.assign(a, {
|
|
1101
|
+
id: d.id,
|
|
1102
|
+
appearance: d.appearance,
|
|
1103
|
+
size: d.size,
|
|
1104
|
+
label: d.label,
|
|
1105
|
+
binding: d.binding,
|
|
1106
|
+
visible: d.visible
|
|
1107
|
+
}), Object.assign(a.editor, {
|
|
1108
|
+
isTextArea: a.isTextArea && d.isTextArea,
|
|
1109
|
+
placeholder: (l = d.editor) == null ? void 0 : l.placeholder,
|
|
1110
|
+
holdPlace: (o = d.editor) == null ? void 0 : o.holdPlace,
|
|
1111
|
+
readonly: (c = d.editor) == null ? void 0 : c.readonly,
|
|
1112
|
+
require: (f = d.editor) == null ? void 0 : f.require
|
|
1113
|
+
}), u.contents.splice(p, 1), u.contents.splice(p, 0, a), i.schema = Object.assign(d, a), Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(
|
|
1017
1114
|
(m) => m.classList.remove("dgComponentSelected")
|
|
1018
|
-
),
|
|
1115
|
+
), Ne.value++;
|
|
1019
1116
|
}
|
|
1020
|
-
getComponentConfig(
|
|
1021
|
-
const
|
|
1117
|
+
getComponentConfig(t, r = {}, i = {}) {
|
|
1118
|
+
const s = Object.assign({
|
|
1022
1119
|
description: "编辑器",
|
|
1023
1120
|
title: "编辑器",
|
|
1024
1121
|
type: "input-group",
|
|
1025
1122
|
$converter: "/converter/property-editor.converter"
|
|
1026
|
-
}, r),
|
|
1123
|
+
}, r), u = Object.assign({
|
|
1027
1124
|
readonly: {
|
|
1028
1125
|
description: "",
|
|
1029
1126
|
title: "只读",
|
|
@@ -1045,7 +1142,7 @@ class Fe extends Te {
|
|
|
1045
1142
|
type: "string"
|
|
1046
1143
|
}
|
|
1047
1144
|
}, i);
|
|
1048
|
-
return { ...
|
|
1145
|
+
return { ...s, properties: { ...u } };
|
|
1049
1146
|
}
|
|
1050
1147
|
/**
|
|
1051
1148
|
* 修改某一输入控件的样式后更新Form的统一布局配置
|
|
@@ -1053,16 +1150,16 @@ class Fe extends Te {
|
|
|
1053
1150
|
* @param controlId 控件Id
|
|
1054
1151
|
* @param componentId 控件所在组件id
|
|
1055
1152
|
*/
|
|
1056
|
-
updateUnifiedLayoutAfterControlChanged(
|
|
1057
|
-
const
|
|
1058
|
-
let
|
|
1059
|
-
|
|
1153
|
+
updateUnifiedLayoutAfterControlChanged(t, r, i) {
|
|
1154
|
+
const s = t.split(" ");
|
|
1155
|
+
let u = s.find((o) => /^col-([1-9]|10|11|12)$/.test(o)), p = s.find((o) => /^col-md-([1-9]|10|11|12)$/.test(o)), d = s.find((o) => /^col-xl-([1-9]|10|11|12)$/.test(o)), a = s.find((o) => /^col-el-([1-9]|10|11|12)$/.test(o));
|
|
1156
|
+
u = u || "col-12", p = p || "col-md-" + u.replace("col-", ""), d = d || "col-xl-" + p.replace("col-md-", ""), a = a || "col-el-" + d.replace("col-xl-", "");
|
|
1060
1157
|
const l = {
|
|
1061
1158
|
id: r,
|
|
1062
|
-
columnInSM: parseInt(
|
|
1159
|
+
columnInSM: parseInt(u.replace("col-", ""), 10),
|
|
1063
1160
|
columnInMD: parseInt(p.replace("col-md-", ""), 10),
|
|
1064
|
-
columnInLG: parseInt(
|
|
1065
|
-
columnInEL: parseInt(
|
|
1161
|
+
columnInLG: parseInt(d.replace("col-xl-", ""), 10),
|
|
1162
|
+
columnInEL: parseInt(a.replace("col-el-", ""), 10)
|
|
1066
1163
|
};
|
|
1067
1164
|
this.updateUnifiedLayoutAfterResponseLayoutChanged(i, l);
|
|
1068
1165
|
}
|
|
@@ -1071,34 +1168,34 @@ class Fe extends Te {
|
|
|
1071
1168
|
* @param componentId 组件Id
|
|
1072
1169
|
* @param controlLayoutConfig 某单独变动的控件配置项,FormResponseLayoutContext类型
|
|
1073
1170
|
*/
|
|
1074
|
-
updateUnifiedLayoutAfterResponseLayoutChanged(
|
|
1075
|
-
const { formNode: i } = this.responseLayoutEditorFunction.checkCanFindFormNode(
|
|
1171
|
+
updateUnifiedLayoutAfterResponseLayoutChanged(t, r) {
|
|
1172
|
+
const { formNode: i } = this.responseLayoutEditorFunction.checkCanFindFormNode(t);
|
|
1076
1173
|
if (!i || !i.unifiedLayout)
|
|
1077
1174
|
return;
|
|
1078
|
-
const
|
|
1079
|
-
if (this.responseLayoutEditorFunction.getResonseFormLayoutConfig(i,
|
|
1080
|
-
const m =
|
|
1175
|
+
const s = [];
|
|
1176
|
+
if (this.responseLayoutEditorFunction.getResonseFormLayoutConfig(i, s, 1), r) {
|
|
1177
|
+
const m = s.find((g) => g.id === r.id);
|
|
1081
1178
|
Object.assign(m || {}, r);
|
|
1082
1179
|
}
|
|
1083
|
-
const
|
|
1180
|
+
const u = s.map((m) => m.columnInSM), p = s.map((m) => m.columnInMD), d = s.map((m) => m.columnInLG), a = s.map((m) => m.columnInEL), l = this.checkIsUniqueColumn(u) ? u[0] : null, o = this.checkIsUniqueColumn(p) ? p[0] : null, c = this.checkIsUniqueColumn(d) ? d[0] : null, f = this.checkIsUniqueColumn(a) ? a[0] : null;
|
|
1084
1181
|
Object.assign(i.unifiedLayout, {
|
|
1085
1182
|
uniqueColClassInSM: l,
|
|
1086
|
-
uniqueColClassInMD:
|
|
1087
|
-
uniqueColClassInLG:
|
|
1088
|
-
uniqueColClassInEL:
|
|
1183
|
+
uniqueColClassInMD: o,
|
|
1184
|
+
uniqueColClassInLG: c,
|
|
1185
|
+
uniqueColClassInEL: f
|
|
1089
1186
|
});
|
|
1090
1187
|
}
|
|
1091
1188
|
/**
|
|
1092
1189
|
* 校验宽度样式值是否一致
|
|
1093
1190
|
*/
|
|
1094
|
-
checkIsUniqueColumn(
|
|
1095
|
-
const r = new Set(
|
|
1191
|
+
checkIsUniqueColumn(t) {
|
|
1192
|
+
const r = new Set(t);
|
|
1096
1193
|
return Array.from(r).length === 1;
|
|
1097
1194
|
}
|
|
1098
1195
|
}
|
|
1099
|
-
class
|
|
1100
|
-
constructor(n,
|
|
1101
|
-
super(n,
|
|
1196
|
+
class Ve extends Te {
|
|
1197
|
+
constructor(n, t) {
|
|
1198
|
+
super(n, t);
|
|
1102
1199
|
}
|
|
1103
1200
|
getEditorProperties(n) {
|
|
1104
1201
|
return this.getComponentConfig(n, { type: "number-spinner" }, {
|
|
@@ -1129,106 +1226,106 @@ class xe extends Fe {
|
|
|
1129
1226
|
});
|
|
1130
1227
|
}
|
|
1131
1228
|
}
|
|
1132
|
-
function Ee(
|
|
1133
|
-
|
|
1134
|
-
const
|
|
1135
|
-
function i(
|
|
1229
|
+
function Ee(e, n) {
|
|
1230
|
+
e.schema;
|
|
1231
|
+
const t = B(!0), r = B(!0);
|
|
1232
|
+
function i(o) {
|
|
1136
1233
|
return !1;
|
|
1137
1234
|
}
|
|
1138
|
-
function
|
|
1235
|
+
function s() {
|
|
1139
1236
|
return !1;
|
|
1140
1237
|
}
|
|
1141
|
-
function
|
|
1238
|
+
function u() {
|
|
1142
1239
|
return !1;
|
|
1143
1240
|
}
|
|
1144
1241
|
function p() {
|
|
1145
1242
|
return !0;
|
|
1146
1243
|
}
|
|
1147
|
-
function
|
|
1244
|
+
function d(o) {
|
|
1148
1245
|
}
|
|
1149
|
-
function
|
|
1246
|
+
function a() {
|
|
1150
1247
|
}
|
|
1151
|
-
function l(
|
|
1248
|
+
function l(o) {
|
|
1152
1249
|
return null;
|
|
1153
1250
|
}
|
|
1154
1251
|
return {
|
|
1155
1252
|
canAccepts: i,
|
|
1156
|
-
checkCanDeleteComponent:
|
|
1157
|
-
checkCanMoveComponent:
|
|
1253
|
+
checkCanDeleteComponent: s,
|
|
1254
|
+
checkCanMoveComponent: u,
|
|
1158
1255
|
hideNestedPaddingInDesginerView: p,
|
|
1159
|
-
onAcceptMovedChildElement:
|
|
1160
|
-
resolveComponentContext:
|
|
1161
|
-
triggerBelongedComponentToMoveWhenMoved:
|
|
1256
|
+
onAcceptMovedChildElement: d,
|
|
1257
|
+
resolveComponentContext: a,
|
|
1258
|
+
triggerBelongedComponentToMoveWhenMoved: t,
|
|
1162
1259
|
triggerBelongedComponentToDeleteWhenDeleted: r,
|
|
1163
1260
|
getPropsConfig: l
|
|
1164
1261
|
};
|
|
1165
1262
|
}
|
|
1166
|
-
function
|
|
1263
|
+
function De(e, n) {
|
|
1167
1264
|
const {
|
|
1168
|
-
canAccepts:
|
|
1265
|
+
canAccepts: t,
|
|
1169
1266
|
checkCanDeleteComponent: r,
|
|
1170
1267
|
checkCanMoveComponent: i,
|
|
1171
|
-
hideNestedPaddingInDesginerView:
|
|
1172
|
-
onAcceptMovedChildElement:
|
|
1268
|
+
hideNestedPaddingInDesginerView: s,
|
|
1269
|
+
onAcceptMovedChildElement: u,
|
|
1173
1270
|
resolveComponentContext: p,
|
|
1174
|
-
triggerBelongedComponentToMoveWhenMoved:
|
|
1175
|
-
triggerBelongedComponentToDeleteWhenDeleted:
|
|
1176
|
-
} = Ee(
|
|
1177
|
-
function
|
|
1178
|
-
return new
|
|
1271
|
+
triggerBelongedComponentToMoveWhenMoved: d,
|
|
1272
|
+
triggerBelongedComponentToDeleteWhenDeleted: a
|
|
1273
|
+
} = Ee(e), l = e.schema;
|
|
1274
|
+
function o(c, f) {
|
|
1275
|
+
return new Ve(c, n).getPropertyConfig(l, f);
|
|
1179
1276
|
}
|
|
1180
1277
|
return {
|
|
1181
|
-
canAccepts:
|
|
1278
|
+
canAccepts: t,
|
|
1182
1279
|
checkCanDeleteComponent: r,
|
|
1183
1280
|
checkCanMoveComponent: i,
|
|
1184
|
-
hideNestedPaddingInDesginerView:
|
|
1185
|
-
onAcceptMovedChildElement:
|
|
1281
|
+
hideNestedPaddingInDesginerView: s,
|
|
1282
|
+
onAcceptMovedChildElement: u,
|
|
1186
1283
|
resolveComponentContext: p,
|
|
1187
|
-
triggerBelongedComponentToMoveWhenMoved:
|
|
1188
|
-
triggerBelongedComponentToDeleteWhenDeleted:
|
|
1189
|
-
getPropsConfig:
|
|
1284
|
+
triggerBelongedComponentToMoveWhenMoved: d,
|
|
1285
|
+
triggerBelongedComponentToDeleteWhenDeleted: a,
|
|
1286
|
+
getPropsConfig: o
|
|
1190
1287
|
};
|
|
1191
1288
|
}
|
|
1192
|
-
const
|
|
1289
|
+
const Pe = /* @__PURE__ */ q({
|
|
1193
1290
|
name: "FNumberSpinnerDesign",
|
|
1194
|
-
props:
|
|
1291
|
+
props: U,
|
|
1195
1292
|
emits: ["update:modelValue", "valueChange", "change", "blur", "focus", "click", "input"],
|
|
1196
|
-
setup(
|
|
1197
|
-
const
|
|
1198
|
-
|
|
1199
|
-
|
|
1293
|
+
setup(e, n) {
|
|
1294
|
+
const t = _(e, n), r = H(e, n, t), i = Y(e, n, r, t), s = K(e, n, i), u = B(), p = W("designer-host-service"), d = W("design-item-context"), a = De(d, p), l = ke(u, d, a);
|
|
1295
|
+
x(() => {
|
|
1296
|
+
u.value.componentInstance = l, e.readonly = !0;
|
|
1200
1297
|
}), n.expose(l.value);
|
|
1201
|
-
const
|
|
1202
|
-
return () =>
|
|
1203
|
-
ref:
|
|
1298
|
+
const o = B();
|
|
1299
|
+
return () => E("div", {
|
|
1300
|
+
ref: u,
|
|
1204
1301
|
class: "input-group f-state-hover flex-row f-cmp-number-spinner test"
|
|
1205
|
-
}, [
|
|
1206
|
-
ref:
|
|
1302
|
+
}, [E("input", {
|
|
1303
|
+
ref: o,
|
|
1207
1304
|
class: "form-control",
|
|
1208
1305
|
readonly: !0,
|
|
1209
|
-
placeholder:
|
|
1210
|
-
}, null),
|
|
1211
|
-
}
|
|
1212
|
-
}),
|
|
1213
|
-
const n =
|
|
1214
|
-
return n.install = function(
|
|
1215
|
-
|
|
1216
|
-
},
|
|
1306
|
+
placeholder: e.placeholder
|
|
1307
|
+
}, null), s()]);
|
|
1308
|
+
}
|
|
1309
|
+
}), Ie = (e) => {
|
|
1310
|
+
const n = e;
|
|
1311
|
+
return n.install = function(t) {
|
|
1312
|
+
t.component(n.name, e);
|
|
1313
|
+
}, e;
|
|
1217
1314
|
};
|
|
1218
|
-
|
|
1219
|
-
|
|
1315
|
+
P.register = (e, n, t, r) => {
|
|
1316
|
+
e["number-spinner"] = P, n["number-spinner"] = Q;
|
|
1220
1317
|
};
|
|
1221
|
-
|
|
1222
|
-
|
|
1318
|
+
P.registerDesigner = (e, n, t) => {
|
|
1319
|
+
e["number-spinner"] = Pe, n["number-spinner"] = Q;
|
|
1223
1320
|
};
|
|
1224
|
-
const
|
|
1321
|
+
const je = Ie(P);
|
|
1225
1322
|
export {
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1323
|
+
P as FNumberSpinner,
|
|
1324
|
+
je as default,
|
|
1325
|
+
U as numberSpinnerProps,
|
|
1326
|
+
Q as propsResolver,
|
|
1230
1327
|
H as useFormat,
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1328
|
+
_ as useNumber,
|
|
1329
|
+
Y as useSpinner,
|
|
1330
|
+
we as useTextBox
|
|
1234
1331
|
};
|