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