@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 { defineComponent as G, ref as k, computed as
|
|
5
|
-
import { cloneDeep as
|
|
6
|
-
import { useTextBox as K, useClear as
|
|
7
|
-
import { getSchemaByType as
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
var Y = Object.defineProperty;
|
|
2
|
+
var Z = (n, t, e) => t in n ? Y(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
|
+
var g = (n, t, e) => Z(n, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { defineComponent as G, ref as k, computed as E, onMounted as W, createVNode as w, withDirectives as H, vModelText as R, inject as O } from "vue";
|
|
5
|
+
import { isPlainObject as q, cloneDeep as z } from "lodash-es";
|
|
6
|
+
import { useTextBox as K, useClear as ee } from "../common/index.esm.js";
|
|
7
|
+
import { getSchemaByType as j } from "../dynamic-resolver/index.esm.js";
|
|
8
|
+
import { useResponseLayoutEditorSetting as te } from "../response-layout-editor/index.esm.js/src/composition/converter/use-response-layout-editor-setting";
|
|
9
|
+
const J = {}, X = {};
|
|
10
|
+
function N(n) {
|
|
11
|
+
const { properties: t, title: e, ignore: o } = n, r = o && Array.isArray(o), i = Object.keys(t).reduce((l, d) => ((!r || !o.find((p) => p == d)) && (l[d] = t[d].type === "object" && t[d].properties ? N(t[d]) : z(t[d].default)), l), {});
|
|
12
|
+
return (!r || !o.find((l) => l == "id")) && (i.id = `${e}-${Date.now()}`), i;
|
|
12
13
|
}
|
|
13
|
-
function
|
|
14
|
-
const o =
|
|
14
|
+
function U(n, t = {}, e) {
|
|
15
|
+
const o = J[n];
|
|
15
16
|
if (o) {
|
|
16
|
-
let r =
|
|
17
|
-
const
|
|
18
|
-
return r =
|
|
17
|
+
let r = N(o);
|
|
18
|
+
const i = X[n];
|
|
19
|
+
return r = i ? i({ getSchemaByType: U }, r, t, e) : r, r;
|
|
19
20
|
}
|
|
20
21
|
return null;
|
|
21
22
|
}
|
|
22
|
-
function
|
|
23
|
-
const
|
|
24
|
-
return Object.keys(n).reduce((o, r) => (o[r] &&
|
|
23
|
+
function ne(n, t) {
|
|
24
|
+
const e = N(t);
|
|
25
|
+
return Object.keys(n).reduce((o, r) => (o[r] && q(o[r]) && q(n[r]) ? Object.assign(o[r], n[r]) : o[r] = n[r], o), e), e;
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
+
function oe(n, t) {
|
|
27
28
|
return Object.keys(n).filter((o) => n[o] != null).reduce((o, r) => {
|
|
28
|
-
if (
|
|
29
|
-
const
|
|
30
|
-
if (typeof
|
|
31
|
-
o[
|
|
29
|
+
if (t.has(r)) {
|
|
30
|
+
const i = t.get(r);
|
|
31
|
+
if (typeof i == "string")
|
|
32
|
+
o[i] = n[r];
|
|
32
33
|
else {
|
|
33
|
-
const
|
|
34
|
-
Object.assign(o,
|
|
34
|
+
const l = i(r, n[r], n);
|
|
35
|
+
Object.assign(o, l);
|
|
35
36
|
}
|
|
36
37
|
} else
|
|
37
38
|
o[r] = n[r];
|
|
38
39
|
return o;
|
|
39
40
|
}, {});
|
|
40
41
|
}
|
|
41
|
-
function
|
|
42
|
-
const o =
|
|
43
|
-
return
|
|
42
|
+
function re(n, t, e = /* @__PURE__ */ new Map()) {
|
|
43
|
+
const o = ne(n, t);
|
|
44
|
+
return oe(o, e);
|
|
44
45
|
}
|
|
45
|
-
function
|
|
46
|
-
function
|
|
46
|
+
function ae(n = {}) {
|
|
47
|
+
function t(a, u, s, m) {
|
|
47
48
|
if (typeof s == "number")
|
|
48
|
-
return
|
|
49
|
+
return m[a].length === s;
|
|
49
50
|
if (typeof s == "object") {
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
52
|
-
return Number(
|
|
53
|
-
if (
|
|
54
|
-
return Number(
|
|
55
|
-
if (
|
|
56
|
-
return Number(
|
|
51
|
+
const h = Object.keys(s)[0], y = s[h];
|
|
52
|
+
if (h === "not")
|
|
53
|
+
return Number(m[a].length) !== Number(y);
|
|
54
|
+
if (h === "moreThan")
|
|
55
|
+
return Number(m[a].length) >= Number(y);
|
|
56
|
+
if (h === "lessThan")
|
|
57
|
+
return Number(m[a].length) <= Number(y);
|
|
57
58
|
}
|
|
58
59
|
return !1;
|
|
59
60
|
}
|
|
60
|
-
function
|
|
61
|
-
return
|
|
61
|
+
function e(a, u, s, m) {
|
|
62
|
+
return m[a] && m[a].propertyValue && String(m[a].propertyValue.value) === String(s);
|
|
62
63
|
}
|
|
63
64
|
const o = /* @__PURE__ */ new Map([
|
|
64
|
-
["length",
|
|
65
|
-
["getProperty",
|
|
65
|
+
["length", t],
|
|
66
|
+
["getProperty", e]
|
|
66
67
|
]);
|
|
67
|
-
Object.keys(n).reduce((a,
|
|
68
|
-
function r(a,
|
|
68
|
+
Object.keys(n).reduce((a, u) => (a.set(u, n[u]), a), o);
|
|
69
|
+
function r(a, u) {
|
|
69
70
|
const s = a;
|
|
70
|
-
return typeof
|
|
71
|
-
if (
|
|
72
|
-
return { target: s, operator: "length", param: null, value:
|
|
73
|
-
const
|
|
74
|
-
return { target: s, operator: "getProperty", param:
|
|
71
|
+
return typeof u == "number" ? [{ target: s, operator: "length", param: null, value: Number(u) }] : typeof u == "boolean" ? [{ target: s, operator: "getProperty", param: a, value: !!u }] : typeof u == "object" ? Object.keys(u).map((m) => {
|
|
72
|
+
if (m === "length")
|
|
73
|
+
return { target: s, operator: "length", param: null, value: u[m] };
|
|
74
|
+
const h = m, y = u[m];
|
|
75
|
+
return { target: s, operator: "getProperty", param: h, value: y };
|
|
75
76
|
}) : [];
|
|
76
77
|
}
|
|
77
|
-
function
|
|
78
|
-
return Object.keys(a).reduce((s,
|
|
79
|
-
const
|
|
80
|
-
return s.push(...
|
|
78
|
+
function i(a) {
|
|
79
|
+
return Object.keys(a).reduce((s, m) => {
|
|
80
|
+
const h = r(m, a[m]);
|
|
81
|
+
return s.push(...h), s;
|
|
81
82
|
}, []);
|
|
82
83
|
}
|
|
83
|
-
function
|
|
84
|
+
function l(a, u) {
|
|
84
85
|
if (o.has(a.operator)) {
|
|
85
86
|
const s = o.get(a.operator);
|
|
86
|
-
return s && s(a.target, a.param, a.value,
|
|
87
|
+
return s && s(a.target, a.param, a.value, u) || !1;
|
|
87
88
|
}
|
|
88
89
|
return !1;
|
|
89
90
|
}
|
|
90
|
-
function
|
|
91
|
-
return
|
|
91
|
+
function d(a, u) {
|
|
92
|
+
return i(a).reduce((h, y) => h && l(y, u), !0);
|
|
92
93
|
}
|
|
93
|
-
function
|
|
94
|
-
const s = Object.keys(a),
|
|
95
|
-
return
|
|
94
|
+
function p(a, u) {
|
|
95
|
+
const s = Object.keys(a), m = s.includes("allOf"), h = s.includes("anyOf"), y = m || h, V = (y ? a[y ? m ? "allOf" : "anyOf" : "allOf"] : [a]).map((P) => d(P, u));
|
|
96
|
+
return m ? !V.includes(!1) : V.includes(!0);
|
|
96
97
|
}
|
|
97
|
-
return { parseValueSchema:
|
|
98
|
+
return { parseValueSchema: p };
|
|
98
99
|
}
|
|
99
|
-
const
|
|
100
|
+
const c = {
|
|
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 i = {
|
|
|
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
|
+
}, ie = {}, le = {};
|
|
140
|
+
ae();
|
|
141
|
+
function se(n, t, e = /* @__PURE__ */ new Map(), o = (l, d, p) => d, r = {}, i = (l) => l) {
|
|
142
|
+
return J[t.title] = t, X[t.title] = o, ie[t.title] = r, le[t.title] = i, (l = {}) => {
|
|
143
|
+
const d = re(l, t, e), p = Object.keys(n).reduce((a, u) => (a[u] = n[u].default, a), {});
|
|
144
|
+
return Object.assign(p, d);
|
|
143
145
|
};
|
|
144
146
|
}
|
|
145
|
-
function
|
|
146
|
-
return { customClass:
|
|
147
|
+
function ce(n, t) {
|
|
148
|
+
return { customClass: t.class, customStyle: t.style };
|
|
147
149
|
}
|
|
148
|
-
const
|
|
149
|
-
["appearance",
|
|
150
|
-
]),
|
|
150
|
+
const pe = /* @__PURE__ */ new Map([
|
|
151
|
+
["appearance", ce]
|
|
152
|
+
]), ue = "https://json-schema.org/draft/2020-12/schema", de = "https://farris-design.gitee.io/switch.schema.json", me = "textarea", ye = "A Farris Component", fe = "object", he = {
|
|
151
153
|
id: {
|
|
152
154
|
description: "The unique identifier for a textarea",
|
|
153
155
|
type: "string"
|
|
@@ -214,22 +216,22 @@ const ce = /* @__PURE__ */ new Map([
|
|
|
214
216
|
"appearance",
|
|
215
217
|
"binding"
|
|
216
218
|
]
|
|
217
|
-
},
|
|
219
|
+
}, ge = [
|
|
218
220
|
"id",
|
|
219
221
|
"type"
|
|
220
|
-
],
|
|
221
|
-
$schema:
|
|
222
|
-
$id:
|
|
223
|
-
title:
|
|
224
|
-
description:
|
|
225
|
-
type:
|
|
226
|
-
properties:
|
|
227
|
-
required:
|
|
222
|
+
], ve = {
|
|
223
|
+
$schema: ue,
|
|
224
|
+
$id: de,
|
|
225
|
+
title: me,
|
|
226
|
+
description: ye,
|
|
227
|
+
type: fe,
|
|
228
|
+
properties: he,
|
|
229
|
+
required: ge
|
|
228
230
|
};
|
|
229
|
-
function
|
|
230
|
-
return
|
|
231
|
+
function be(n, t, e) {
|
|
232
|
+
return t;
|
|
231
233
|
}
|
|
232
|
-
const
|
|
234
|
+
const $ = {
|
|
233
235
|
/** 自动聚焦 */
|
|
234
236
|
autofocus: { type: Boolean, default: !1 },
|
|
235
237
|
/** 自动完成 */
|
|
@@ -258,37 +260,37 @@ const L = {
|
|
|
258
260
|
showBorder: { Type: Boolean, default: !0 },
|
|
259
261
|
/** 键盘按键索引 */
|
|
260
262
|
tabIndex: { type: Number, default: -1 }
|
|
261
|
-
}, _ =
|
|
263
|
+
}, _ = se($, ve, pe, be), A = /* @__PURE__ */ G({
|
|
262
264
|
name: "FTextarea",
|
|
263
|
-
props:
|
|
265
|
+
props: $,
|
|
264
266
|
emits: ["update:modelValue", "valueChange"],
|
|
265
|
-
setup(n,
|
|
266
|
-
const
|
|
267
|
-
inputGroupClass:
|
|
268
|
-
onBlur:
|
|
269
|
-
onFocus:
|
|
270
|
-
} =
|
|
271
|
-
onMouseEnter:
|
|
267
|
+
setup(n, t) {
|
|
268
|
+
const e = k(), o = k(n.modelValue), r = E(() => n.modelValue), i = K(n, t, o, r), {
|
|
269
|
+
inputGroupClass: l,
|
|
270
|
+
onBlur: d,
|
|
271
|
+
onFocus: p
|
|
272
|
+
} = i, a = ee(n, t, i), {
|
|
273
|
+
onMouseEnter: u,
|
|
272
274
|
onMouseLeave: s,
|
|
273
|
-
clearButtonClass:
|
|
274
|
-
shouldShowClearButton:
|
|
275
|
-
clearButtonStyle:
|
|
276
|
-
} = a,
|
|
277
|
-
var
|
|
278
|
-
v.stopPropagation(),
|
|
279
|
-
},
|
|
280
|
-
v.stopPropagation(),
|
|
275
|
+
clearButtonClass: m,
|
|
276
|
+
shouldShowClearButton: h,
|
|
277
|
+
clearButtonStyle: y
|
|
278
|
+
} = a, T = E(() => n.maxLength ? n.maxLength : n.modelValue.length), x = (v) => {
|
|
279
|
+
var P, F;
|
|
280
|
+
v.stopPropagation(), t.emit("update:modelValue", (P = v.target) == null ? void 0 : P.value), t.emit("valueChange", (F = v.target) == null ? void 0 : F.value);
|
|
281
|
+
}, V = (v) => {
|
|
282
|
+
v.stopPropagation(), e.value.value = "", t.emit("update:modelValue", ""), t.emit("valueChange", "");
|
|
281
283
|
};
|
|
282
284
|
return W(() => {
|
|
283
285
|
}), () => w("div", {
|
|
284
|
-
class:
|
|
285
|
-
onMouseenter:
|
|
286
|
+
class: l.value,
|
|
287
|
+
onMouseenter: u,
|
|
286
288
|
onMouseleave: s,
|
|
287
289
|
style: "position:relative"
|
|
288
|
-
}, [
|
|
290
|
+
}, [H(w("textarea", {
|
|
289
291
|
id: n.id,
|
|
290
292
|
"onUpdate:modelValue": (v) => n.modelValue = v,
|
|
291
|
-
ref:
|
|
293
|
+
ref: e,
|
|
292
294
|
minlength: n.minLength,
|
|
293
295
|
maxlength: n.maxLength ? n.maxLength : null,
|
|
294
296
|
tabindex: n.tabIndex,
|
|
@@ -298,148 +300,148 @@ const L = {
|
|
|
298
300
|
placeholder: n.placeholder,
|
|
299
301
|
autofocus: n.autofocus,
|
|
300
302
|
rows: n.rows,
|
|
301
|
-
onInput:
|
|
302
|
-
onFocus:
|
|
303
|
-
onBlur:
|
|
303
|
+
onInput: x,
|
|
304
|
+
onFocus: p,
|
|
305
|
+
onBlur: d,
|
|
304
306
|
style: "border-radius:6px; padding:5px 10px; width:100%"
|
|
305
|
-
}, null), [[
|
|
307
|
+
}, null), [[R, n.modelValue]]), h.value && w("span", {
|
|
306
308
|
id: "clearIcon",
|
|
307
|
-
class:
|
|
308
|
-
style:
|
|
309
|
-
onClick: (v) =>
|
|
309
|
+
class: m.value,
|
|
310
|
+
style: y.value,
|
|
311
|
+
onClick: (v) => V(v)
|
|
310
312
|
}, [w("i", {
|
|
311
313
|
class: "f-icon modal_close"
|
|
312
314
|
}, null)]), n.showCount && w("span", {
|
|
313
315
|
style: "position: absolute;bottom: 5px;right: 10px"
|
|
314
|
-
}, [`${n.modelValue.length}/${
|
|
316
|
+
}, [`${n.modelValue.length}/${T.value}`])]);
|
|
315
317
|
}
|
|
316
318
|
});
|
|
317
|
-
function
|
|
318
|
-
var
|
|
319
|
+
function Ce(n, t, e) {
|
|
320
|
+
var I;
|
|
319
321
|
function o() {
|
|
320
|
-
|
|
322
|
+
e != null && e.resolveComponentContext && e.resolveComponentContext();
|
|
321
323
|
}
|
|
322
324
|
o();
|
|
323
|
-
const r =
|
|
324
|
-
function
|
|
325
|
-
return (
|
|
325
|
+
const r = e && e.getStyles && e.getStyles() || "", i = e && e.getDesignerClass && e.getDesignerClass() || "", l = k();
|
|
326
|
+
function d() {
|
|
327
|
+
return (t == null ? void 0 : t.schema.componentType) === "frame" ? !1 : e && e.checkCanMoveComponent ? e.checkCanMoveComponent() : !0;
|
|
326
328
|
}
|
|
327
|
-
function
|
|
329
|
+
function p() {
|
|
328
330
|
return !1;
|
|
329
331
|
}
|
|
330
332
|
function a() {
|
|
331
|
-
return (
|
|
333
|
+
return (t == null ? void 0 : t.schema.componentType) === "frame" ? !1 : e && e.checkCanDeleteComponent ? e.checkCanDeleteComponent() : !0;
|
|
332
334
|
}
|
|
333
|
-
function
|
|
334
|
-
return (
|
|
335
|
+
function u() {
|
|
336
|
+
return (t == null ? void 0 : t.schema.componentType) === "frame" ? !0 : e && e.hideNestedPaddingInDesginerView ? e.hideNestedPaddingInDesginerView() : !1;
|
|
335
337
|
}
|
|
336
|
-
function s(
|
|
337
|
-
if (!
|
|
338
|
+
function s(f) {
|
|
339
|
+
if (!f || !f.value)
|
|
338
340
|
return null;
|
|
339
|
-
if (
|
|
340
|
-
return
|
|
341
|
-
const b = k(
|
|
341
|
+
if (f.value.schema && f.value.schema.type === "component")
|
|
342
|
+
return f.value;
|
|
343
|
+
const b = k(f == null ? void 0 : f.value.parent), C = s(b);
|
|
342
344
|
return C || null;
|
|
343
345
|
}
|
|
344
|
-
function
|
|
345
|
-
const { componentInstance: b, designerItemElementRef: C } =
|
|
346
|
-
return !b || !b.value ? null : b.value.canMove ? C :
|
|
346
|
+
function m(f = t) {
|
|
347
|
+
const { componentInstance: b, designerItemElementRef: C } = f;
|
|
348
|
+
return !b || !b.value ? null : b.value.canMove ? C : m(f.parent);
|
|
347
349
|
}
|
|
348
|
-
function f
|
|
349
|
-
return !!
|
|
350
|
+
function h(f) {
|
|
351
|
+
return !!e && e.canAccepts(f);
|
|
350
352
|
}
|
|
351
|
-
function
|
|
352
|
-
return (
|
|
353
|
+
function y() {
|
|
354
|
+
return (t == null ? void 0 : t.schema.label) || (t == null ? void 0 : t.schema.title) || (t == null ? void 0 : t.schema.name);
|
|
353
355
|
}
|
|
354
|
-
function
|
|
356
|
+
function T() {
|
|
355
357
|
}
|
|
356
|
-
function
|
|
357
|
-
b &&
|
|
358
|
+
function x(f, b) {
|
|
359
|
+
b && e != null && e.onAcceptMovedChildElement && e.onAcceptMovedChildElement(b);
|
|
358
360
|
}
|
|
359
|
-
function
|
|
360
|
-
const { componentType: C } =
|
|
361
|
-
let M =
|
|
362
|
-
|
|
363
|
-
const
|
|
364
|
-
return M && !M.id && M.type === C && (M.id = `${
|
|
361
|
+
function V(f, b) {
|
|
362
|
+
const { componentType: C } = f;
|
|
363
|
+
let M = U(C, f, b);
|
|
364
|
+
e && e.onResolveNewComponentSchema && (M = e.onResolveNewComponentSchema(f, M));
|
|
365
|
+
const L = C.toLowerCase().replace("-", "_");
|
|
366
|
+
return M && !M.id && M.type === C && (M.id = `${L}_${Math.random().toString().slice(2, 6)}`), M;
|
|
365
367
|
}
|
|
366
|
-
function v(
|
|
367
|
-
const C = String(
|
|
368
|
-
|
|
369
|
-
let
|
|
370
|
-
|
|
368
|
+
function v(f, b) {
|
|
369
|
+
const C = String(f.getAttribute("data-controltype")), M = f.getAttribute("data-feature"), L = M ? JSON.parse(M) : {};
|
|
370
|
+
L.parentComponentInstance = l.value;
|
|
371
|
+
let B = U(C, L);
|
|
372
|
+
e && e.onAcceptNewChildElement && (B = e.onAcceptNewChildElement(f, b, B));
|
|
371
373
|
const Q = C.toLowerCase().replace("-", "_");
|
|
372
|
-
return
|
|
374
|
+
return B && !B.id && B.type === C && (B.id = `${Q}_${Math.random().toString().slice(2, 6)}`), B;
|
|
373
375
|
}
|
|
374
|
-
function
|
|
376
|
+
function P(f) {
|
|
375
377
|
}
|
|
376
|
-
function F(...
|
|
377
|
-
if (
|
|
378
|
-
return
|
|
378
|
+
function F(...f) {
|
|
379
|
+
if (e && e.getPropsConfig)
|
|
380
|
+
return e.getPropsConfig(...f);
|
|
379
381
|
}
|
|
380
|
-
return
|
|
381
|
-
canMove:
|
|
382
|
-
canSelectParent:
|
|
382
|
+
return l.value = {
|
|
383
|
+
canMove: d(),
|
|
384
|
+
canSelectParent: p(),
|
|
383
385
|
canDelete: a(),
|
|
384
|
-
canNested: !
|
|
385
|
-
contents:
|
|
386
|
+
canNested: !u(),
|
|
387
|
+
contents: t == null ? void 0 : t.schema.contents,
|
|
386
388
|
elementRef: n,
|
|
387
|
-
parent: (
|
|
388
|
-
schema:
|
|
389
|
+
parent: (I = t == null ? void 0 : t.parent) == null ? void 0 : I.componentInstance,
|
|
390
|
+
schema: t == null ? void 0 : t.schema,
|
|
389
391
|
styles: r,
|
|
390
|
-
designerClass:
|
|
391
|
-
canAccepts:
|
|
392
|
+
designerClass: i,
|
|
393
|
+
canAccepts: h,
|
|
392
394
|
getBelongedComponentInstance: s,
|
|
393
|
-
getDraggableDesignItemElement:
|
|
394
|
-
getDraggingDisplayText:
|
|
395
|
+
getDraggableDesignItemElement: m,
|
|
396
|
+
getDraggingDisplayText: y,
|
|
395
397
|
getPropConfig: F,
|
|
396
|
-
getDragScopeElement:
|
|
397
|
-
onAcceptMovedChildElement:
|
|
398
|
+
getDragScopeElement: T,
|
|
399
|
+
onAcceptMovedChildElement: x,
|
|
398
400
|
onAcceptNewChildElement: v,
|
|
399
|
-
onChildElementMovedOut:
|
|
400
|
-
addNewChildComponentSchema:
|
|
401
|
+
onChildElementMovedOut: P,
|
|
402
|
+
addNewChildComponentSchema: V,
|
|
401
403
|
updateDragAndDropRules: o,
|
|
402
|
-
triggerBelongedComponentToMoveWhenMoved: !!
|
|
403
|
-
triggerBelongedComponentToDeleteWhenDeleted: !!
|
|
404
|
-
},
|
|
404
|
+
triggerBelongedComponentToMoveWhenMoved: !!e && e.triggerBelongedComponentToMoveWhenMoved || k(!1),
|
|
405
|
+
triggerBelongedComponentToDeleteWhenDeleted: !!e && e.triggerBelongedComponentToDeleteWhenDeleted || k(!1)
|
|
406
|
+
}, l;
|
|
405
407
|
}
|
|
406
|
-
class
|
|
407
|
-
constructor(
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
408
|
+
class Me {
|
|
409
|
+
constructor(t, e) {
|
|
410
|
+
g(this, "componentId");
|
|
411
|
+
g(this, "viewModelId");
|
|
412
|
+
g(this, "eventsEditorUtils");
|
|
413
|
+
g(this, "formSchemaUtils");
|
|
414
|
+
g(this, "formMetadataConverter");
|
|
415
|
+
g(this, "designViewModelUtils");
|
|
416
|
+
g(this, "designViewModelField");
|
|
417
|
+
g(this, "controlCreatorUtils");
|
|
418
|
+
g(this, "designerHostService");
|
|
419
|
+
g(this, "schemaService", null);
|
|
420
|
+
g(this, "metadataService", null);
|
|
421
|
+
g(this, "propertyConfig", {
|
|
420
422
|
type: "object",
|
|
421
423
|
categories: {}
|
|
422
424
|
});
|
|
423
425
|
var o;
|
|
424
|
-
this.componentId =
|
|
426
|
+
this.componentId = t, this.designerHostService = e, this.eventsEditorUtils = e.eventsEditorUtils, this.formSchemaUtils = e.formSchemaUtils, this.formMetadataConverter = e.formMetadataConverter, this.viewModelId = ((o = this.formSchemaUtils) == null ? void 0 : o.getViewModelIdByComponentId(t)) || "", this.designViewModelUtils = e.designViewModelUtils, this.controlCreatorUtils = e.controlCreatorUtils, this.metadataService = e.metadataService, this.schemaService = e.schemaService;
|
|
425
427
|
}
|
|
426
428
|
getTableInfo() {
|
|
427
|
-
var
|
|
428
|
-
return (
|
|
429
|
+
var t;
|
|
430
|
+
return (t = this.schemaService) == null ? void 0 : t.getTableInfoByViewModelId(this.viewModelId);
|
|
429
431
|
}
|
|
430
|
-
setDesignViewModelField(
|
|
431
|
-
const
|
|
432
|
-
if (
|
|
432
|
+
setDesignViewModelField(t) {
|
|
433
|
+
const e = t.binding && t.binding.type === "Form" && t.binding.field;
|
|
434
|
+
if (e) {
|
|
433
435
|
if (!this.designViewModelField) {
|
|
434
436
|
const o = this.designViewModelUtils.getDgViewModel(this.viewModelId);
|
|
435
|
-
this.designViewModelField = o.fields.find((r) => r.id ===
|
|
437
|
+
this.designViewModelField = o.fields.find((r) => r.id === e);
|
|
436
438
|
}
|
|
437
|
-
|
|
439
|
+
t.updateOn = this.designViewModelField.updateOn;
|
|
438
440
|
}
|
|
439
441
|
}
|
|
440
|
-
changeFieldEditorType(
|
|
442
|
+
changeFieldEditorType(t, e) {
|
|
441
443
|
}
|
|
442
|
-
getBasicPropConfig(
|
|
444
|
+
getBasicPropConfig(t) {
|
|
443
445
|
return {
|
|
444
446
|
description: "Basic Information",
|
|
445
447
|
title: "基本信息",
|
|
@@ -458,13 +460,13 @@ class be {
|
|
|
458
460
|
type: "combo-list",
|
|
459
461
|
textField: "name",
|
|
460
462
|
valueField: "value",
|
|
461
|
-
data: [{ value:
|
|
463
|
+
data: [{ value: t.type, name: c[t.type].name }]
|
|
462
464
|
}
|
|
463
465
|
}
|
|
464
466
|
}
|
|
465
467
|
};
|
|
466
468
|
}
|
|
467
|
-
getAppearanceConfig(
|
|
469
|
+
getAppearanceConfig(t = null) {
|
|
468
470
|
return {
|
|
469
471
|
title: "样式",
|
|
470
472
|
description: "Appearance",
|
|
@@ -484,90 +486,105 @@ class be {
|
|
|
484
486
|
}
|
|
485
487
|
};
|
|
486
488
|
}
|
|
489
|
+
/**
|
|
490
|
+
*
|
|
491
|
+
* @param propertyId
|
|
492
|
+
* @param componentInstance
|
|
493
|
+
* @returns
|
|
494
|
+
*/
|
|
495
|
+
updateElementByParentContainer(t, e) {
|
|
496
|
+
const o = e && e.parent && e.parent.schema;
|
|
497
|
+
if (!o)
|
|
498
|
+
return;
|
|
499
|
+
const r = o.contents.findIndex((l) => l.id === t), i = z(o.contents[r]);
|
|
500
|
+
o.contents.splice(r, 1), o.contents.splice(r, 0, i);
|
|
501
|
+
}
|
|
487
502
|
}
|
|
488
|
-
const
|
|
503
|
+
const S = class S {
|
|
489
504
|
/**
|
|
490
505
|
* 根据绑定字段类型获取可用的输入类控件
|
|
491
506
|
*/
|
|
492
|
-
static getEditorTypesByMDataType(
|
|
493
|
-
const
|
|
494
|
-
return
|
|
507
|
+
static getEditorTypesByMDataType(t) {
|
|
508
|
+
const e = S.fieldControlTypeMapping[t];
|
|
509
|
+
return e || [{ key: "", value: "" }];
|
|
495
510
|
}
|
|
496
511
|
/**
|
|
497
512
|
* 获取所有输入类控件
|
|
498
513
|
*/
|
|
499
514
|
static getAllInputTypes() {
|
|
500
|
-
const
|
|
501
|
-
for (let
|
|
502
|
-
|
|
503
|
-
|
|
515
|
+
const t = [];
|
|
516
|
+
for (let e in S.fieldControlTypeMapping)
|
|
517
|
+
S.fieldControlTypeMapping[e].forEach((o) => {
|
|
518
|
+
t.find((r) => r.key === o.key && r.value === o.value) || t.push({ key: o.key, value: o.value });
|
|
504
519
|
});
|
|
505
|
-
return
|
|
520
|
+
return t;
|
|
506
521
|
}
|
|
507
522
|
};
|
|
508
523
|
/**
|
|
509
524
|
* <字段类型,可配置的控件类型列表>的映射
|
|
510
525
|
*/
|
|
511
|
-
|
|
526
|
+
g(S, "fieldControlTypeMapping", {
|
|
512
527
|
String: [
|
|
513
|
-
{ key:
|
|
514
|
-
{ key:
|
|
515
|
-
{ key:
|
|
516
|
-
{ key:
|
|
517
|
-
{ key:
|
|
518
|
-
{ key:
|
|
519
|
-
{ key:
|
|
528
|
+
{ key: c["input-group"].type, value: c["input-group"].name },
|
|
529
|
+
{ key: c.lookup.type, value: c.lookup.name },
|
|
530
|
+
{ key: c["date-picker"].type, value: c["date-picker"].name },
|
|
531
|
+
{ key: c["check-box"].type, value: c["check-box"].name },
|
|
532
|
+
{ key: c["radio-group"].type, value: c["radio-group"].name },
|
|
533
|
+
{ key: c["combo-list"].type, value: c["combo-list"].name },
|
|
534
|
+
{ key: c.textarea.type, value: c.textarea.name }
|
|
520
535
|
],
|
|
521
536
|
Text: [
|
|
522
|
-
{ key:
|
|
523
|
-
{ key:
|
|
537
|
+
{ key: c.textarea.type, value: c.textarea.name },
|
|
538
|
+
{ key: c.lookup.type, value: c.lookup.name }
|
|
524
539
|
],
|
|
525
540
|
Decimal: [
|
|
526
|
-
{ key:
|
|
541
|
+
{ key: c["number-spinner"].type, value: c["number-spinner"].name }
|
|
527
542
|
],
|
|
528
543
|
Integer: [
|
|
529
|
-
{ key:
|
|
544
|
+
{ key: c["number-spinner"].type, value: c["number-spinner"].name }
|
|
530
545
|
],
|
|
531
546
|
Number: [
|
|
532
|
-
{ key:
|
|
547
|
+
{ key: c["number-spinner"].type, value: c["number-spinner"].name }
|
|
533
548
|
],
|
|
534
549
|
BigNumber: [
|
|
535
|
-
{ key:
|
|
550
|
+
{ key: c["number-spinner"].type, value: c["number-spinner"].name }
|
|
536
551
|
],
|
|
537
552
|
Date: [
|
|
538
|
-
{ key:
|
|
553
|
+
{ key: c["date-picker"].type, value: c["date-picker"].name }
|
|
539
554
|
],
|
|
540
555
|
DateTime: [
|
|
541
|
-
{ key:
|
|
556
|
+
{ key: c["date-picker"].type, value: c["date-picker"].name }
|
|
542
557
|
],
|
|
543
558
|
Boolean: [
|
|
544
|
-
{ key:
|
|
545
|
-
{ key:
|
|
559
|
+
{ key: c.switch.type, value: c.switch.name },
|
|
560
|
+
{ key: c["check-box"].type, value: c["check-box"].name }
|
|
546
561
|
],
|
|
547
562
|
Enum: [
|
|
548
|
-
{ key:
|
|
549
|
-
{ key:
|
|
563
|
+
{ key: c["combo-list"].type, value: c["combo-list"].name },
|
|
564
|
+
{ key: c["radio-group"].type, value: c["radio-group"].name }
|
|
550
565
|
],
|
|
551
566
|
Object: [
|
|
552
|
-
{ key:
|
|
553
|
-
{ key:
|
|
554
|
-
{ key:
|
|
567
|
+
{ key: c.lookup.type, value: c.lookup.name },
|
|
568
|
+
{ key: c["combo-list"].type, value: c["combo-list"].name },
|
|
569
|
+
{ key: c["radio-group"].type, value: c["radio-group"].name }
|
|
555
570
|
]
|
|
556
571
|
});
|
|
557
|
-
let
|
|
558
|
-
const
|
|
559
|
-
class
|
|
560
|
-
constructor(e,
|
|
561
|
-
super(e,
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
572
|
+
let D = S;
|
|
573
|
+
const ke = k(0);
|
|
574
|
+
class we extends Me {
|
|
575
|
+
constructor(e, o) {
|
|
576
|
+
super(e, o);
|
|
577
|
+
g(this, "responseLayoutEditorFunction");
|
|
578
|
+
this.responseLayoutEditorFunction = te(this.formSchemaUtils);
|
|
579
|
+
}
|
|
580
|
+
getPropertyConfig(e, o) {
|
|
581
|
+
return this.propertyConfig.categories.basic = this.getBasicProperties(e, o), this.propertyConfig.categories.appearance = this.getAppearanceProperties(e, o), this.propertyConfig.categories.editor = this.getEditorProperties(e), this.propertyConfig;
|
|
582
|
+
}
|
|
583
|
+
getBasicProperties(e, o) {
|
|
584
|
+
var d;
|
|
585
|
+
var r = this;
|
|
569
586
|
this.setDesignViewModelField(e);
|
|
570
|
-
const
|
|
587
|
+
const i = this.formSchemaUtils.getFormMetadataBasicInfo(), l = this.designViewModelUtils.getAllFields2TreeByVMId(this.viewModelId);
|
|
571
588
|
return {
|
|
572
589
|
description: "Basic Information",
|
|
573
590
|
title: "基本信息",
|
|
@@ -589,7 +606,7 @@ class Me extends be {
|
|
|
589
606
|
textField: "value",
|
|
590
607
|
valueField: "key",
|
|
591
608
|
editable: !1,
|
|
592
|
-
data:
|
|
609
|
+
data: r.designViewModelField ? D.getEditorTypesByMDataType((d = r.designViewModelField.type) == null ? void 0 : d.name) : D.getAllInputTypes()
|
|
593
610
|
}
|
|
594
611
|
},
|
|
595
612
|
label: {
|
|
@@ -606,7 +623,7 @@ class Me extends be {
|
|
|
606
623
|
bindingType: { enable: !1 },
|
|
607
624
|
editorParams: {
|
|
608
625
|
propertyData: e,
|
|
609
|
-
formBasicInfo:
|
|
626
|
+
formBasicInfo: i
|
|
610
627
|
},
|
|
611
628
|
columns: [
|
|
612
629
|
{ field: "name", title: "字段名称" },
|
|
@@ -614,26 +631,27 @@ class Me extends be {
|
|
|
614
631
|
{ field: "fieldType", title: "字段类型" }
|
|
615
632
|
],
|
|
616
633
|
textField: "bindingField",
|
|
617
|
-
data:
|
|
634
|
+
data: l
|
|
618
635
|
}
|
|
619
636
|
}
|
|
620
637
|
},
|
|
621
|
-
setPropertyRelates(
|
|
622
|
-
if (
|
|
623
|
-
switch (
|
|
638
|
+
setPropertyRelates(p, a) {
|
|
639
|
+
if (p)
|
|
640
|
+
switch (p && p.propertyID) {
|
|
624
641
|
case "type": {
|
|
625
|
-
|
|
642
|
+
r.changeControlType(e, p, o);
|
|
626
643
|
break;
|
|
627
644
|
}
|
|
628
645
|
case "label": {
|
|
629
|
-
|
|
646
|
+
p.needRefreshControlTree = !0;
|
|
630
647
|
break;
|
|
631
648
|
}
|
|
632
649
|
}
|
|
633
650
|
}
|
|
634
651
|
};
|
|
635
652
|
}
|
|
636
|
-
getAppearanceProperties(e) {
|
|
653
|
+
getAppearanceProperties(e, o) {
|
|
654
|
+
var r = this;
|
|
637
655
|
return {
|
|
638
656
|
title: "样式",
|
|
639
657
|
description: "Appearance",
|
|
@@ -654,12 +672,25 @@ class Me extends be {
|
|
|
654
672
|
description: "响应式列宽",
|
|
655
673
|
title: "响应式列宽",
|
|
656
674
|
type: "boolean",
|
|
657
|
-
visible: !
|
|
675
|
+
visible: !0,
|
|
676
|
+
// 这个属性,标记当属性变更得时候触发重新更新属性
|
|
677
|
+
refreshPanelAfterChanged: !0,
|
|
658
678
|
editor: {
|
|
659
|
-
type: "response-layout-editor-setting"
|
|
660
|
-
|
|
661
|
-
|
|
679
|
+
type: "response-layout-editor-setting",
|
|
680
|
+
initialState: r.responseLayoutEditorFunction.checkCanOpenLayoutEditor(e, r.componentId)
|
|
681
|
+
}
|
|
662
682
|
}
|
|
683
|
+
},
|
|
684
|
+
setPropertyRelates(i, l) {
|
|
685
|
+
if (i)
|
|
686
|
+
switch (i && i.propertyID) {
|
|
687
|
+
case "responseLayout":
|
|
688
|
+
r.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(i.propertyValue, r.componentId || e.id), r.updateUnifiedLayoutAfterResponseLayoutChanged(r.componentId), r.updateElementByParentContainer(e.id, o), delete e.responseLayout;
|
|
689
|
+
break;
|
|
690
|
+
case "class":
|
|
691
|
+
r.updateUnifiedLayoutAfterControlChanged(i.propertyValue, e.id, this.componentId), r.updateElementByParentContainer(e.id, o);
|
|
692
|
+
break;
|
|
693
|
+
}
|
|
663
694
|
}
|
|
664
695
|
};
|
|
665
696
|
}
|
|
@@ -671,44 +702,44 @@ class Me extends be {
|
|
|
671
702
|
* @param propertyData 控件DOM属性
|
|
672
703
|
* @param newControlType 新控件类型
|
|
673
704
|
*/
|
|
674
|
-
changeControlType(e,
|
|
675
|
-
var
|
|
676
|
-
const
|
|
677
|
-
if (!
|
|
705
|
+
changeControlType(e, o, r) {
|
|
706
|
+
var u, s, m, h;
|
|
707
|
+
const i = o.propertyValue, l = r && r.parent && r.parent.schema;
|
|
708
|
+
if (!l)
|
|
678
709
|
return;
|
|
679
|
-
const
|
|
680
|
-
let
|
|
710
|
+
const d = l.contents.findIndex((y) => y.id === e.id), p = l.contents[d];
|
|
711
|
+
let a;
|
|
681
712
|
this.designViewModelField && (this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id, {
|
|
682
713
|
editor: {
|
|
683
|
-
$type:
|
|
714
|
+
$type: i
|
|
684
715
|
},
|
|
685
716
|
name: this.designViewModelField.name,
|
|
686
717
|
require: this.designViewModelField.require,
|
|
687
718
|
readonly: this.designViewModelField.readonly
|
|
688
|
-
}, !1),
|
|
689
|
-
id:
|
|
690
|
-
appearance:
|
|
691
|
-
size:
|
|
692
|
-
label:
|
|
693
|
-
binding:
|
|
694
|
-
visible:
|
|
695
|
-
}), Object.assign(
|
|
696
|
-
isTextArea:
|
|
697
|
-
placeholder: (
|
|
698
|
-
holdPlace: (
|
|
699
|
-
readonly: (
|
|
700
|
-
require: (
|
|
701
|
-
}),
|
|
702
|
-
(
|
|
703
|
-
),
|
|
704
|
-
}
|
|
705
|
-
getComponentConfig(e,
|
|
706
|
-
const
|
|
719
|
+
}, !1), a = this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField, i)), a || (a = j("form-group") || {}, a.editor = j(i) || {}, delete a.editor.id, delete a.editor.binding, delete a.editor.appearance), Object.assign(a, {
|
|
720
|
+
id: p.id,
|
|
721
|
+
appearance: p.appearance,
|
|
722
|
+
size: p.size,
|
|
723
|
+
label: p.label,
|
|
724
|
+
binding: p.binding,
|
|
725
|
+
visible: p.visible
|
|
726
|
+
}), Object.assign(a.editor, {
|
|
727
|
+
isTextArea: a.isTextArea && p.isTextArea,
|
|
728
|
+
placeholder: (u = p.editor) == null ? void 0 : u.placeholder,
|
|
729
|
+
holdPlace: (s = p.editor) == null ? void 0 : s.holdPlace,
|
|
730
|
+
readonly: (m = p.editor) == null ? void 0 : m.readonly,
|
|
731
|
+
require: (h = p.editor) == null ? void 0 : h.require
|
|
732
|
+
}), l.contents.splice(d, 1), l.contents.splice(d, 0, a), r.schema = Object.assign(p, a), Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(
|
|
733
|
+
(y) => y.classList.remove("dgComponentSelected")
|
|
734
|
+
), ke.value++;
|
|
735
|
+
}
|
|
736
|
+
getComponentConfig(e, o = {}, r = {}) {
|
|
737
|
+
const i = Object.assign({
|
|
707
738
|
description: "编辑器",
|
|
708
739
|
title: "编辑器",
|
|
709
740
|
type: "input-group",
|
|
710
741
|
$converter: "/converter/property-editor.converter"
|
|
711
|
-
},
|
|
742
|
+
}, o), l = Object.assign({
|
|
712
743
|
readonly: {
|
|
713
744
|
description: "",
|
|
714
745
|
title: "只读",
|
|
@@ -729,97 +760,145 @@ class Me extends be {
|
|
|
729
760
|
title: "提示文本",
|
|
730
761
|
type: "string"
|
|
731
762
|
}
|
|
732
|
-
},
|
|
733
|
-
return { ...
|
|
763
|
+
}, r);
|
|
764
|
+
return { ...i, properties: { ...l } };
|
|
765
|
+
}
|
|
766
|
+
/**
|
|
767
|
+
* 修改某一输入控件的样式后更新Form的统一布局配置
|
|
768
|
+
* @param controlClass 控件样式
|
|
769
|
+
* @param controlId 控件Id
|
|
770
|
+
* @param componentId 控件所在组件id
|
|
771
|
+
*/
|
|
772
|
+
updateUnifiedLayoutAfterControlChanged(e, o, r) {
|
|
773
|
+
const i = e.split(" ");
|
|
774
|
+
let l = i.find((s) => /^col-([1-9]|10|11|12)$/.test(s)), d = i.find((s) => /^col-md-([1-9]|10|11|12)$/.test(s)), p = i.find((s) => /^col-xl-([1-9]|10|11|12)$/.test(s)), a = i.find((s) => /^col-el-([1-9]|10|11|12)$/.test(s));
|
|
775
|
+
l = l || "col-12", d = d || "col-md-" + l.replace("col-", ""), p = p || "col-xl-" + d.replace("col-md-", ""), a = a || "col-el-" + p.replace("col-xl-", "");
|
|
776
|
+
const u = {
|
|
777
|
+
id: o,
|
|
778
|
+
columnInSM: parseInt(l.replace("col-", ""), 10),
|
|
779
|
+
columnInMD: parseInt(d.replace("col-md-", ""), 10),
|
|
780
|
+
columnInLG: parseInt(p.replace("col-xl-", ""), 10),
|
|
781
|
+
columnInEL: parseInt(a.replace("col-el-", ""), 10)
|
|
782
|
+
};
|
|
783
|
+
this.updateUnifiedLayoutAfterResponseLayoutChanged(r, u);
|
|
784
|
+
}
|
|
785
|
+
/**
|
|
786
|
+
* 修改控件布局配置后更新Form统一布局配置
|
|
787
|
+
* @param componentId 组件Id
|
|
788
|
+
* @param controlLayoutConfig 某单独变动的控件配置项,FormResponseLayoutContext类型
|
|
789
|
+
*/
|
|
790
|
+
updateUnifiedLayoutAfterResponseLayoutChanged(e, o) {
|
|
791
|
+
const { formNode: r } = this.responseLayoutEditorFunction.checkCanFindFormNode(e);
|
|
792
|
+
if (!r || !r.unifiedLayout)
|
|
793
|
+
return;
|
|
794
|
+
const i = [];
|
|
795
|
+
if (this.responseLayoutEditorFunction.getResonseFormLayoutConfig(r, i, 1), o) {
|
|
796
|
+
const y = i.find((T) => T.id === o.id);
|
|
797
|
+
Object.assign(y || {}, o);
|
|
798
|
+
}
|
|
799
|
+
const l = i.map((y) => y.columnInSM), d = i.map((y) => y.columnInMD), p = i.map((y) => y.columnInLG), a = i.map((y) => y.columnInEL), u = this.checkIsUniqueColumn(l) ? l[0] : null, s = this.checkIsUniqueColumn(d) ? d[0] : null, m = this.checkIsUniqueColumn(p) ? p[0] : null, h = this.checkIsUniqueColumn(a) ? a[0] : null;
|
|
800
|
+
Object.assign(r.unifiedLayout, {
|
|
801
|
+
uniqueColClassInSM: u,
|
|
802
|
+
uniqueColClassInMD: s,
|
|
803
|
+
uniqueColClassInLG: m,
|
|
804
|
+
uniqueColClassInEL: h
|
|
805
|
+
});
|
|
806
|
+
}
|
|
807
|
+
/**
|
|
808
|
+
* 校验宽度样式值是否一致
|
|
809
|
+
*/
|
|
810
|
+
checkIsUniqueColumn(e) {
|
|
811
|
+
const o = new Set(e);
|
|
812
|
+
return Array.from(o).length === 1;
|
|
734
813
|
}
|
|
735
814
|
}
|
|
736
|
-
class
|
|
737
|
-
constructor(
|
|
738
|
-
super(
|
|
815
|
+
class Te extends we {
|
|
816
|
+
constructor(t, e) {
|
|
817
|
+
super(t, e);
|
|
739
818
|
}
|
|
740
819
|
}
|
|
741
|
-
function
|
|
820
|
+
function Be(n, t) {
|
|
742
821
|
n.schema;
|
|
743
|
-
const
|
|
822
|
+
const e = k(!0), o = k(!0);
|
|
744
823
|
function r(s) {
|
|
745
824
|
return !1;
|
|
746
825
|
}
|
|
747
|
-
function
|
|
826
|
+
function i() {
|
|
748
827
|
return !1;
|
|
749
828
|
}
|
|
750
|
-
function
|
|
829
|
+
function l() {
|
|
751
830
|
return !1;
|
|
752
831
|
}
|
|
753
|
-
function
|
|
832
|
+
function d() {
|
|
754
833
|
return !0;
|
|
755
834
|
}
|
|
756
|
-
function
|
|
835
|
+
function p(s) {
|
|
757
836
|
}
|
|
758
837
|
function a() {
|
|
759
838
|
}
|
|
760
|
-
function
|
|
839
|
+
function u(s) {
|
|
761
840
|
return null;
|
|
762
841
|
}
|
|
763
842
|
return {
|
|
764
843
|
canAccepts: r,
|
|
765
|
-
checkCanDeleteComponent:
|
|
766
|
-
checkCanMoveComponent:
|
|
767
|
-
hideNestedPaddingInDesginerView:
|
|
768
|
-
onAcceptMovedChildElement:
|
|
844
|
+
checkCanDeleteComponent: i,
|
|
845
|
+
checkCanMoveComponent: l,
|
|
846
|
+
hideNestedPaddingInDesginerView: d,
|
|
847
|
+
onAcceptMovedChildElement: p,
|
|
769
848
|
resolveComponentContext: a,
|
|
770
|
-
triggerBelongedComponentToMoveWhenMoved:
|
|
849
|
+
triggerBelongedComponentToMoveWhenMoved: e,
|
|
771
850
|
triggerBelongedComponentToDeleteWhenDeleted: o,
|
|
772
|
-
getPropsConfig:
|
|
851
|
+
getPropsConfig: u
|
|
773
852
|
};
|
|
774
853
|
}
|
|
775
|
-
function
|
|
854
|
+
function Ve(n, t) {
|
|
776
855
|
const {
|
|
777
|
-
canAccepts:
|
|
856
|
+
canAccepts: e,
|
|
778
857
|
checkCanDeleteComponent: o,
|
|
779
858
|
checkCanMoveComponent: r,
|
|
780
|
-
hideNestedPaddingInDesginerView:
|
|
781
|
-
onAcceptMovedChildElement:
|
|
782
|
-
resolveComponentContext:
|
|
783
|
-
triggerBelongedComponentToMoveWhenMoved:
|
|
859
|
+
hideNestedPaddingInDesginerView: i,
|
|
860
|
+
onAcceptMovedChildElement: l,
|
|
861
|
+
resolveComponentContext: d,
|
|
862
|
+
triggerBelongedComponentToMoveWhenMoved: p,
|
|
784
863
|
triggerBelongedComponentToDeleteWhenDeleted: a
|
|
785
|
-
} =
|
|
786
|
-
function s(
|
|
787
|
-
return new
|
|
864
|
+
} = Be(n), u = n.schema;
|
|
865
|
+
function s(m, h) {
|
|
866
|
+
return new Te(m, t).getPropertyConfig(u, h);
|
|
788
867
|
}
|
|
789
868
|
return {
|
|
790
|
-
canAccepts:
|
|
869
|
+
canAccepts: e,
|
|
791
870
|
checkCanDeleteComponent: o,
|
|
792
871
|
checkCanMoveComponent: r,
|
|
793
|
-
hideNestedPaddingInDesginerView:
|
|
794
|
-
onAcceptMovedChildElement:
|
|
795
|
-
resolveComponentContext:
|
|
796
|
-
triggerBelongedComponentToMoveWhenMoved:
|
|
872
|
+
hideNestedPaddingInDesginerView: i,
|
|
873
|
+
onAcceptMovedChildElement: l,
|
|
874
|
+
resolveComponentContext: d,
|
|
875
|
+
triggerBelongedComponentToMoveWhenMoved: p,
|
|
797
876
|
triggerBelongedComponentToDeleteWhenDeleted: a,
|
|
798
877
|
getPropsConfig: s
|
|
799
878
|
};
|
|
800
879
|
}
|
|
801
|
-
const
|
|
880
|
+
const Pe = /* @__PURE__ */ G({
|
|
802
881
|
name: "FTextareaDesign",
|
|
803
|
-
props:
|
|
882
|
+
props: $,
|
|
804
883
|
emits: [""],
|
|
805
|
-
setup(n,
|
|
806
|
-
const
|
|
884
|
+
setup(n, t) {
|
|
885
|
+
const e = k(), o = O("designer-host-service"), r = O("design-item-context"), i = Ve(r, o), l = Ce(e, r, i), d = E(() => n.maxLength ? n.maxLength : n.modelValue.length), p = E(() => ({
|
|
807
886
|
position: "relative"
|
|
808
|
-
})), a =
|
|
887
|
+
})), a = E(() => ({
|
|
809
888
|
"box-shadow": "0 0 0 1px #dcdfe6 inset",
|
|
810
889
|
border: "none",
|
|
811
890
|
padding: "5px 10px",
|
|
812
891
|
width: "100%"
|
|
813
|
-
})),
|
|
892
|
+
})), u = {
|
|
814
893
|
position: "absolute",
|
|
815
894
|
bottom: "5px",
|
|
816
895
|
right: "10px"
|
|
817
896
|
};
|
|
818
897
|
return W(() => {
|
|
819
|
-
|
|
820
|
-
}),
|
|
821
|
-
style:
|
|
822
|
-
ref:
|
|
898
|
+
e.value.componentInstance = l;
|
|
899
|
+
}), t.expose(l.value), () => w("div", {
|
|
900
|
+
style: p.value,
|
|
901
|
+
ref: e
|
|
823
902
|
}, [w("textarea", {
|
|
824
903
|
id: n.id,
|
|
825
904
|
tabindex: n.tabIndex,
|
|
@@ -829,25 +908,25 @@ const Be = /* @__PURE__ */ G({
|
|
|
829
908
|
placeholder: n.placeholder,
|
|
830
909
|
rows: n.rows
|
|
831
910
|
}, null), n.showCount && w("span", {
|
|
832
|
-
style:
|
|
833
|
-
}, [`${n.modelValue.length}/${
|
|
911
|
+
style: u
|
|
912
|
+
}, [`${n.modelValue.length}/${d.value}`])]);
|
|
834
913
|
}
|
|
835
|
-
}),
|
|
836
|
-
const
|
|
837
|
-
return
|
|
838
|
-
|
|
914
|
+
}), Se = (n) => {
|
|
915
|
+
const t = n;
|
|
916
|
+
return t.install = function(e) {
|
|
917
|
+
e.component(t.name, n);
|
|
839
918
|
}, n;
|
|
840
919
|
};
|
|
841
|
-
A.register = (n,
|
|
842
|
-
n.textarea = A,
|
|
920
|
+
A.register = (n, t, e, o) => {
|
|
921
|
+
n.textarea = A, t.textarea = _;
|
|
843
922
|
};
|
|
844
|
-
A.registerDesigner = (n,
|
|
845
|
-
n.textarea =
|
|
923
|
+
A.registerDesigner = (n, t, e) => {
|
|
924
|
+
n.textarea = Pe, t.textarea = _;
|
|
846
925
|
};
|
|
847
|
-
const
|
|
926
|
+
const Ue = Se(A);
|
|
848
927
|
export {
|
|
849
928
|
A as FTextarea,
|
|
850
|
-
|
|
929
|
+
Ue as default,
|
|
851
930
|
_ as propsResolver,
|
|
852
|
-
|
|
931
|
+
$ as textAreaProps
|
|
853
932
|
};
|