@farris/ui-vue 1.8.0-alpha.0 → 1.8.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/avatar/index.esm.js +138 -1526
- package/components/avatar/index.umd.cjs +1 -6
- package/components/button/index.css +1 -1
- package/components/button/index.esm.js +15951 -15410
- package/components/button/index.umd.cjs +27 -27
- package/components/calendar/index.esm.js +269 -255
- package/components/calendar/index.umd.cjs +3 -3
- package/components/collection-property-editor/index.esm.js +243 -229
- package/components/collection-property-editor/index.umd.cjs +2 -2
- package/components/combo-list/index.esm.js +32 -32
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/comment/index.esm.js +473 -456
- package/components/comment/index.umd.cjs +6 -6
- package/components/component/index.css +1 -1
- package/components/component/index.esm.js +2503 -2239
- package/components/component/index.umd.cjs +2 -2
- package/components/condition/index.esm.js +1064 -954
- package/components/condition/index.umd.cjs +2 -2
- package/components/data-grid/index.esm.js +1 -1
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/designer-canvas/index.css +1 -1
- package/components/designer-canvas/index.esm.js +3894 -3058
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/drawer/index.esm.js +91 -77
- package/components/drawer/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +220 -215
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +145 -131
- package/components/dynamic-resolver/index.umd.cjs +2 -2
- package/components/dynamic-view/index.esm.js +336 -329
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +1611 -1536
- package/components/events-editor/index.umd.cjs +3 -3
- package/components/expression-editor/index.esm.js +219 -219
- package/components/expression-editor/index.umd.cjs +2 -2
- package/components/external-container/index.esm.js +179 -178
- package/components/external-container/index.umd.cjs +1 -1
- package/components/fieldset/index.esm.js +285 -221
- package/components/fieldset/index.umd.cjs +1 -1
- package/components/filter-bar/index.css +1 -0
- package/components/filter-bar/index.esm.js +1512 -1290
- package/components/filter-bar/index.umd.cjs +7 -7
- package/components/filter-condition-editor/index.esm.js +851 -831
- package/components/filter-condition-editor/index.umd.cjs +3 -3
- package/components/flow-canvas/index.esm.js +520 -501
- package/components/flow-canvas/index.umd.cjs +8 -8
- package/components/image/index.esm.js +101 -79
- package/components/image/index.umd.cjs +3 -3
- package/components/language-textbox/index.esm.js +330 -251
- package/components/language-textbox/index.umd.cjs +2 -2
- package/components/list-nav/index.esm.js +399 -313
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/locale/index.esm.js +3 -0
- package/components/locale/index.umd.cjs +1 -1
- package/components/lookup/index.esm.js +997 -976
- package/components/lookup/index.umd.cjs +2 -2
- package/components/mapping-editor/index.esm.js +725 -705
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/message-box/index.esm.js +542 -522
- package/components/message-box/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +95 -308
- package/components/nav/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +115 -107
- package/components/number-range/index.umd.cjs +2 -2
- package/components/order/index.esm.js +56 -54
- package/components/order/index.umd.cjs +1 -1
- package/components/page-footer/index.esm.js +135 -123
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +266 -222
- package/components/page-header/index.umd.cjs +1 -1
- package/components/property-panel/index.esm.js +402 -375
- package/components/property-panel/index.umd.cjs +4 -4
- package/components/query-solution/index.esm.js +3171 -3061
- package/components/query-solution/index.umd.cjs +7 -7
- package/components/response-toolbar/index.esm.js +1 -1
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +1620 -1608
- package/components/schema-selector/index.umd.cjs +5 -5
- package/components/scroll-navbar/index.esm.js +150 -136
- package/components/scroll-navbar/index.umd.cjs +2 -2
- package/components/section/index.esm.js +323 -311
- package/components/section/index.umd.cjs +2 -2
- package/components/sort-condition-editor/index.esm.js +850 -830
- package/components/sort-condition-editor/index.umd.cjs +3 -3
- package/components/step/index.esm.js +991 -224
- package/components/step/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +356 -334
- package/components/tabs/index.umd.cjs +1 -1
- package/components/wizard/index.esm.js +159 -162
- package/components/wizard/index.umd.cjs +1 -1
- package/designer/avatar/index.esm.js +1721 -0
- package/designer/avatar/index.umd.cjs +6 -0
- package/designer/button-edit/index.esm.js +2 -1
- package/designer/button-edit/index.umd.cjs +1 -1
- package/designer/data-grid/index.esm.js +693 -659
- package/designer/data-grid/index.umd.cjs +6 -6
- package/designer/data-view/index.esm.js +90 -78
- package/designer/data-view/index.umd.cjs +2 -2
- package/designer/date-picker/index.esm.js +203 -203
- package/designer/date-picker/index.umd.cjs +1 -1
- package/designer/drawer/index.esm.js +181 -167
- package/designer/drawer/index.umd.cjs +2 -2
- package/designer/dynamic-form/index.esm.js +228 -206
- package/designer/dynamic-form/index.umd.cjs +2 -2
- package/designer/farris-designer.all.esm.js +10014 -9692
- package/designer/farris-designer.all.umd.cjs +18 -18
- package/designer/index.css +1 -1
- package/designer/input-group/index.esm.js +15 -15
- package/designer/input-group/index.umd.cjs +1 -1
- package/designer/nav/index.esm.js +1719 -0
- package/designer/nav/index.umd.cjs +6 -0
- package/designer/number-spinner/index.esm.js +8 -7
- package/designer/number-spinner/index.umd.cjs +1 -1
- package/designer/radio-group/index.esm.js +133 -125
- package/designer/radio-group/index.umd.cjs +2 -2
- package/designer/response-toolbar/index.esm.js +864 -863
- package/designer/response-toolbar/index.umd.cjs +1 -1
- package/designer/section/index.esm.js +245 -183
- package/designer/section/index.umd.cjs +1 -1
- package/designer/tabs/index.css +1 -1
- package/designer/tabs/index.esm.js +3667 -2810
- package/designer/tabs/index.umd.cjs +2 -2
- package/designer/time-picker/index.esm.js +26 -17
- package/designer/time-picker/index.umd.cjs +2 -2
- package/designer/tree-grid/index.esm.js +69 -37
- package/designer/tree-grid/index.umd.cjs +1 -1
- package/designer/wizard/index.esm.js +110 -110
- package/designer/wizard/index.umd.cjs +3 -3
- package/farris.all.esm.js +39993 -39089
- package/farris.all.umd.cjs +36 -36
- package/index.css +1 -1
- package/locales/filter-bar/ui/en.json +1 -0
- package/locales/filter-bar/ui/zh-CHS.json +1 -0
- package/locales/filter-bar/ui/zh-CHT.json +1 -0
- package/locales/ui/en.json +1 -0
- package/locales/ui/zh-CHS.json +1 -0
- package/locales/ui/zh-CHT.json +1 -0
- package/package.json +1 -1
- package/types/avatar/designer.d.ts +28 -0
- package/types/avatar/index.d.ts +0 -15
- package/types/avatar/src/composition/types.d.ts +3 -0
- package/types/avatar/src/composition/use-file.d.ts +19 -0
- package/types/avatar/src/composition/use-image.d.ts +1 -1
- package/types/avatar/src/designer/avatar.design.props.d.ts +24 -0
- package/types/avatar/src/property-config/avatar.property-config.d.ts +11 -13
- package/types/avatar/src/schema/schema-mapper.d.ts +2 -0
- package/types/components.d.ts +3 -0
- package/types/condition/index.d.ts +18 -6
- package/types/condition/src/condition-fields.component.d.ts +9 -3
- package/types/condition/src/condition-fields.design.component.d.ts +9 -3
- package/types/condition/src/condition-list.component.d.ts +9 -3
- package/types/condition/src/condition.props.d.ts +11 -0
- package/types/data-view/designer/property-config/use-appearance.d.ts +17 -10
- package/types/data-view/designer/property-config/use-pagination.d.ts +0 -6
- package/types/designer-canvas/src/composition/dg-control.d.ts +13 -0
- package/types/dynamic-form/src/component/dynamic-form-label/dynamic-form-label.component.d.ts +3 -0
- package/types/dynamic-form/src/component/dynamic-form-label/dynamic-form-label.props.d.ts +4 -0
- package/types/dynamic-resolver/src/converter/tree-auto-check.converter.d.ts +3 -0
- package/types/dynamic-view/src/components/maps.d.ts +130 -4
- package/types/filter-bar/src/composition/types.d.ts +2 -0
- package/types/filter-bar/src/filter-bar.props.d.ts +0 -1
- package/types/filter-bar/src/locale/locale.d.ts +2 -1
- package/types/filter-bar/src/property-config/filter-bar.property-config.d.ts +0 -1
- package/types/language-textbox/index.d.ts +65 -2
- package/types/language-textbox/src/designer/language-textbox.design.component.d.ts +36 -0
- package/types/language-textbox/src/language-textbox.component.d.ts +38 -1
- package/types/language-textbox/src/language-textbox.props.d.ts +20 -0
- package/types/lookup/src/components/popup-container.component.d.ts +3 -3
- package/types/lookup/src/composition/use-compat.d.ts +28 -0
- package/types/lookup/src/composition/use-state.d.ts +1 -0
- package/types/message-box/src/message-box.service.d.ts +2 -1
- package/types/nav/designer.d.ts +28 -0
- package/types/nav/index.d.ts +24 -20
- package/types/nav/src/designer/nav.design.props.d.ts +29 -0
- package/types/nav/src/designer/use-design-rules.d.ts +3 -0
- package/types/nav/src/property-config/nav.property-config.d.ts +9 -0
- package/types/nav/src/schema/schema-mapper.d.ts +4 -0
- package/types/page-footer/src/designer/use-designer-rules.d.ts +2 -2
- package/types/page-header/src/designer/use-designer-rules.d.ts +2 -2
- package/types/property-panel/src/composition/entity/input-base-property.d.ts +1 -0
- package/types/query-solution/src/designer/query-solution-config/composition/use-util.d.ts +1 -1
- package/types/query-solution/src/designer/query-solution-config/query-solution-config.props.d.ts +1 -1
- package/types/section/src/designer/section.design.props.d.ts +4 -0
- package/types/section/src/property-config/section.property-config.d.ts +39 -0
- package/types/section/src/schema/toolbar-resolver.d.ts +0 -1
- package/types/step/src/designer/use-designer-rules.d.ts +3 -0
- package/types/step/src/designer/use-step-creator.d.ts +6 -0
- package/types/step/src/property-config/step.property-config.d.ts +15 -0
- package/types/step/src/schema/schema-resolver.d.ts +2 -1
- package/types/tabs/src/composition/types.d.ts +4 -0
- package/types/tabs/src/tabs.props.d.ts +6 -0
- package/types/tooltip/index.d.ts +3 -3
- package/types/tooltip/src/tooltip.component.d.ts +2 -2
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
var J = Object.defineProperty;
|
|
2
2
|
var K = (d, e, t) => e in d ? J(d, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[e] = t;
|
|
3
3
|
var h = (d, e, t) => K(d, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { defineComponent as
|
|
5
|
-
import { resolveAppearance as
|
|
6
|
-
import { DgControl as S, canvasChanged as
|
|
7
|
-
import { FormBindingType as
|
|
8
|
-
import { cloneDeep as
|
|
9
|
-
import { useDesignerRules as
|
|
10
|
-
const
|
|
11
|
-
["appearance",
|
|
12
|
-
]),
|
|
4
|
+
import { defineComponent as q, ref as T, computed as F, watch as Q, createVNode as y, inject as $, onMounted as X, nextTick as Y } from "vue";
|
|
5
|
+
import { resolveAppearance as Z, createPropsResolver as H, getPropsResolverGenerator as ee } from "../dynamic-resolver/index.esm.js";
|
|
6
|
+
import { DgControl as S, canvasChanged as te, refreshCanvas as ne, UseTemplateDragAndDropRules as ie, useDragulaCommonRule as se, useDesignerComponent as oe, setPositionOfSelectedComponentBtnGroup as re } from "../designer-canvas/index.esm.js";
|
|
7
|
+
import { FormBindingType as G } from "../property-panel/index.esm.js";
|
|
8
|
+
import { cloneDeep as ae } from "lodash-es";
|
|
9
|
+
import { useDesignerRules as D } from "../dynamic-form/index.esm.js";
|
|
10
|
+
const j = /* @__PURE__ */ new Map([
|
|
11
|
+
["appearance", Z]
|
|
12
|
+
]), le = "https://json-schema.org/draft/2020-12/schema", de = "https://farris-design.gitee.io/fieldset.schema.json", ce = "fieldset", ue = "A Farris Container Component", pe = "object", fe = {
|
|
13
13
|
id: {
|
|
14
14
|
description: "The unique identifier for a fieldset",
|
|
15
15
|
type: "string"
|
|
@@ -36,25 +36,48 @@ const _ = /* @__PURE__ */ new Map([
|
|
|
36
36
|
description: "The title for a fieldset",
|
|
37
37
|
type: "string"
|
|
38
38
|
},
|
|
39
|
+
expandStatus: {
|
|
40
|
+
description: "The expanded status for a fieldset",
|
|
41
|
+
type: "boolean",
|
|
42
|
+
default: !0
|
|
43
|
+
},
|
|
44
|
+
expandLabel: {
|
|
45
|
+
description: "The expanded label for a fieldset",
|
|
46
|
+
type: "string"
|
|
47
|
+
},
|
|
48
|
+
collapseLabel: {
|
|
49
|
+
description: "The collapsed label for a fieldset",
|
|
50
|
+
type: "string"
|
|
51
|
+
},
|
|
39
52
|
contents: {
|
|
40
53
|
description: "",
|
|
41
54
|
type: "array",
|
|
42
55
|
default: []
|
|
56
|
+
},
|
|
57
|
+
visible: {
|
|
58
|
+
description: "",
|
|
59
|
+
type: "boolean",
|
|
60
|
+
default: !0
|
|
61
|
+
},
|
|
62
|
+
sectionCollapseVisible: {
|
|
63
|
+
description: "",
|
|
64
|
+
type: "boolean",
|
|
65
|
+
default: !1
|
|
43
66
|
}
|
|
44
|
-
},
|
|
67
|
+
}, ge = [
|
|
45
68
|
"id",
|
|
46
69
|
"type",
|
|
47
70
|
"contents"
|
|
48
|
-
],
|
|
49
|
-
$schema:
|
|
50
|
-
$id:
|
|
51
|
-
title:
|
|
52
|
-
description:
|
|
53
|
-
type:
|
|
54
|
-
properties:
|
|
55
|
-
required:
|
|
71
|
+
], _ = {
|
|
72
|
+
$schema: le,
|
|
73
|
+
$id: de,
|
|
74
|
+
title: ce,
|
|
75
|
+
description: ue,
|
|
76
|
+
type: pe,
|
|
77
|
+
properties: fe,
|
|
78
|
+
required: ge
|
|
56
79
|
};
|
|
57
|
-
function
|
|
80
|
+
function z(d, e, t) {
|
|
58
81
|
return Object.assign(e, {
|
|
59
82
|
appearance: {
|
|
60
83
|
class: "col-12 px-0"
|
|
@@ -62,32 +85,43 @@ function L(d, e, t) {
|
|
|
62
85
|
title: "分组标题"
|
|
63
86
|
}), e;
|
|
64
87
|
}
|
|
65
|
-
const
|
|
88
|
+
const B = {
|
|
66
89
|
/** 组件自定义样式 */
|
|
67
90
|
customClass: { type: String, default: "" },
|
|
68
91
|
customStyle: { type: String, default: "" },
|
|
69
92
|
/** 标题 */
|
|
70
|
-
title: { type: String, default: "" }
|
|
71
|
-
|
|
93
|
+
title: { type: String, default: "" },
|
|
94
|
+
/** 设置初始是否处于展开状态,支持:true 内容区域被展开|false 内容区域被収折 */
|
|
95
|
+
expandStatus: { type: Boolean, default: !0 },
|
|
96
|
+
/** 展开文本 */
|
|
97
|
+
expandLabel: { type: String, default: "" },
|
|
98
|
+
/** 收起文本 */
|
|
99
|
+
collapseLabel: { type: String, default: "" },
|
|
100
|
+
/** 控制是否可见 */
|
|
101
|
+
visible: { type: Boolean, default: !0 },
|
|
102
|
+
/** 分组面板收折时显示 */
|
|
103
|
+
sectionCollapseVisible: { type: Boolean, default: !1 }
|
|
104
|
+
}, me = Object.assign({}, B, {
|
|
72
105
|
componentId: { type: String, default: "" }
|
|
73
|
-
}),
|
|
74
|
-
|
|
75
|
-
z,
|
|
106
|
+
}), Se = H(B, _, j, z), L = ee(
|
|
107
|
+
B,
|
|
76
108
|
_,
|
|
77
|
-
|
|
78
|
-
|
|
109
|
+
j,
|
|
110
|
+
z
|
|
111
|
+
), R = /* @__PURE__ */ q({
|
|
79
112
|
name: "FFieldset",
|
|
80
|
-
props:
|
|
113
|
+
props: B,
|
|
81
114
|
emits: [],
|
|
82
115
|
setup(d, e) {
|
|
83
|
-
const t = T(
|
|
116
|
+
const t = T(d.expandStatus);
|
|
84
117
|
function n(a, r) {
|
|
85
118
|
a && r && r.split(" ").reduce((u, p) => (u[p] = !0, u), a);
|
|
86
119
|
}
|
|
87
|
-
const
|
|
120
|
+
const i = F(() => {
|
|
88
121
|
const a = {
|
|
89
122
|
"f-section-formgroup": !0,
|
|
90
|
-
"f-state-collapse": !t.value
|
|
123
|
+
"f-state-collapse": !t.value,
|
|
124
|
+
"f-state-visible": d.sectionCollapseVisible
|
|
91
125
|
};
|
|
92
126
|
return n(a, d.customClass), a;
|
|
93
127
|
}), o = F(() => ({
|
|
@@ -96,30 +130,32 @@ const R = {
|
|
|
96
130
|
"f-btn-collapse-expand": !0,
|
|
97
131
|
"f-state-expand": t.value
|
|
98
132
|
}));
|
|
99
|
-
function
|
|
133
|
+
function s() {
|
|
100
134
|
t.value = !t.value;
|
|
101
135
|
}
|
|
102
|
-
return () =>
|
|
103
|
-
|
|
136
|
+
return Q(() => d.expandStatus, (a, r) => {
|
|
137
|
+
a !== r && (t.value = a);
|
|
138
|
+
}), () => d.visible ? y("fieldset", {
|
|
139
|
+
class: i.value,
|
|
104
140
|
style: d.customStyle
|
|
105
|
-
}, [
|
|
141
|
+
}, [y("legend", {
|
|
106
142
|
class: "f-section-formgroup-legend"
|
|
107
|
-
}, [
|
|
143
|
+
}, [y("div", {
|
|
108
144
|
class: "f-header"
|
|
109
|
-
}, [
|
|
145
|
+
}, [y("div", {
|
|
110
146
|
class: "f-title",
|
|
111
|
-
onClick:
|
|
112
|
-
}, [d.title]),
|
|
147
|
+
onClick: s
|
|
148
|
+
}, [d.title]), y("div", {
|
|
113
149
|
class: "f-toolbar",
|
|
114
|
-
onClick:
|
|
115
|
-
}, [
|
|
150
|
+
onClick: s
|
|
151
|
+
}, [y("button", {
|
|
116
152
|
class: o.value
|
|
117
|
-
}, null)])])]),
|
|
153
|
+
}, [y("span", null, [t.value ? d.collapseLabel : d.expandLabel])])])])]), y("div", {
|
|
118
154
|
class: "f-section-formgroup-inputs"
|
|
119
|
-
}, [e.slots.default && e.slots.default()])]);
|
|
155
|
+
}, [e.slots.default && e.slots.default()])]) : null;
|
|
120
156
|
}
|
|
121
157
|
});
|
|
122
|
-
function
|
|
158
|
+
function he(d) {
|
|
123
159
|
const { formSchemaUtils: e, formStateMachineUtils: t } = d;
|
|
124
160
|
function n(r, l = "") {
|
|
125
161
|
return {
|
|
@@ -128,26 +164,26 @@ function ge(d) {
|
|
|
128
164
|
fullPath: r.code
|
|
129
165
|
};
|
|
130
166
|
}
|
|
131
|
-
function
|
|
167
|
+
function i(r, l = "") {
|
|
132
168
|
const u = e.getViewModelById(r);
|
|
133
169
|
return u ? u.states.map((p) => n(p, l)) : [];
|
|
134
170
|
}
|
|
135
171
|
function o(r) {
|
|
136
|
-
const l = e.getRootViewModelId(), u =
|
|
172
|
+
const l = e.getRootViewModelId(), u = i(r);
|
|
137
173
|
if (r === l)
|
|
138
174
|
return u;
|
|
139
|
-
const p =
|
|
175
|
+
const p = i(l, "root-component.");
|
|
140
176
|
return [...u, ...p];
|
|
141
177
|
}
|
|
142
|
-
function
|
|
178
|
+
function s(r) {
|
|
143
179
|
return r.binding && r.binding.path || r.id || "";
|
|
144
180
|
}
|
|
145
181
|
function a() {
|
|
146
182
|
return t && t.getRenderStates() || [];
|
|
147
183
|
}
|
|
148
|
-
return { getVariables: o, getControlName:
|
|
184
|
+
return { getVariables: o, getControlName: s, getStateMachines: a };
|
|
149
185
|
}
|
|
150
|
-
class
|
|
186
|
+
class be {
|
|
151
187
|
constructor(e) {
|
|
152
188
|
h(this, "sessionVariables", [
|
|
153
189
|
{
|
|
@@ -196,19 +232,19 @@ class he {
|
|
|
196
232
|
required: "必填表达式"
|
|
197
233
|
});
|
|
198
234
|
h(this, "getExpressionConverter", (e, t) => ({
|
|
199
|
-
convertFrom: (n,
|
|
200
|
-
const a = o.getExpressionRuleValue(e, t ||
|
|
235
|
+
convertFrom: (n, i, o, s) => {
|
|
236
|
+
const a = o.getExpressionRuleValue(e, t || i);
|
|
201
237
|
return a && a.value || "";
|
|
202
238
|
},
|
|
203
|
-
convertTo: (n,
|
|
239
|
+
convertTo: (n, i, o, s, a) => {
|
|
204
240
|
var r;
|
|
205
|
-
if (
|
|
241
|
+
if (i === "dataPicking" && (o != null && o.target)) {
|
|
206
242
|
const l = `${o.target}_dataPicking`;
|
|
207
243
|
((r = o.rules) == null ? void 0 : r.some(
|
|
208
244
|
(p) => p.id === l && p.value
|
|
209
245
|
)) ? n.dictPickingExpressionId = l : delete n.dictPickingExpressionId;
|
|
210
246
|
}
|
|
211
|
-
|
|
247
|
+
s.updateExpression(o);
|
|
212
248
|
}
|
|
213
249
|
}));
|
|
214
250
|
this.formSchemaService = e;
|
|
@@ -217,10 +253,10 @@ class he {
|
|
|
217
253
|
const n = this.formSchemaService.getExpressions();
|
|
218
254
|
if (!n)
|
|
219
255
|
return "";
|
|
220
|
-
const
|
|
221
|
-
if (!
|
|
256
|
+
const i = n.find((s) => s.target === e);
|
|
257
|
+
if (!i)
|
|
222
258
|
return "";
|
|
223
|
-
const o =
|
|
259
|
+
const o = i.rules.find((s) => s.type === t);
|
|
224
260
|
return o || "";
|
|
225
261
|
}
|
|
226
262
|
// 获取上下文表单变量
|
|
@@ -231,15 +267,15 @@ class he {
|
|
|
231
267
|
const t = this.formSchemaService.getRootViewModelId(), n = this.formSchemaService.getViewModelById(t);
|
|
232
268
|
if (!n || !n.states || n.states.length === 0)
|
|
233
269
|
return [];
|
|
234
|
-
const
|
|
270
|
+
const i = [];
|
|
235
271
|
return n.states.filter((o) => o.category === "remote").forEach((o) => {
|
|
236
|
-
|
|
272
|
+
i.push({
|
|
237
273
|
key: o.code,
|
|
238
274
|
name: o.name,
|
|
239
275
|
description: o.name,
|
|
240
276
|
category: o.category
|
|
241
277
|
});
|
|
242
|
-
}),
|
|
278
|
+
}), i;
|
|
243
279
|
}
|
|
244
280
|
createTreeNode(e, t, n = "label") {
|
|
245
281
|
return {
|
|
@@ -252,27 +288,27 @@ class he {
|
|
|
252
288
|
}
|
|
253
289
|
buildEntityFieldsTreeData(e = null, t) {
|
|
254
290
|
const n = [];
|
|
255
|
-
return e == null || e.forEach((
|
|
291
|
+
return e == null || e.forEach((i) => {
|
|
256
292
|
var a;
|
|
257
|
-
const o = this.createTreeNode(
|
|
258
|
-
let
|
|
259
|
-
(a =
|
|
293
|
+
const o = this.createTreeNode(i, t);
|
|
294
|
+
let s = [];
|
|
295
|
+
(a = i.type) != null && a.fields && (s = this.buildEntityFieldsTreeData(i.type.fields, [...t, i.label])), n.push({
|
|
260
296
|
data: o,
|
|
261
|
-
children:
|
|
297
|
+
children: s,
|
|
262
298
|
expanded: !0
|
|
263
299
|
});
|
|
264
300
|
}), n;
|
|
265
301
|
}
|
|
266
302
|
buildChildEntityTreeData(e = null, t) {
|
|
267
303
|
const n = [];
|
|
268
|
-
return e == null || e.forEach((
|
|
304
|
+
return e == null || e.forEach((i) => {
|
|
269
305
|
var r, l;
|
|
270
|
-
const o = this.createTreeNode(
|
|
306
|
+
const o = this.createTreeNode(i, t);
|
|
271
307
|
o.type = "entity";
|
|
272
|
-
const
|
|
273
|
-
a != null && a.length && (
|
|
308
|
+
const s = this.buildEntityFieldsTreeData((r = i.type) == null ? void 0 : r.fields, [...t, i.label]), a = this.buildChildEntityTreeData((l = i.type) == null ? void 0 : l.entities, [...t, i.label]);
|
|
309
|
+
a != null && a.length && (s == null || s.push(...a)), n.push({
|
|
274
310
|
data: o,
|
|
275
|
-
children:
|
|
311
|
+
children: s || [],
|
|
276
312
|
// 空值回退
|
|
277
313
|
expanded: !0
|
|
278
314
|
});
|
|
@@ -285,8 +321,8 @@ class he {
|
|
|
285
321
|
const t = e[0];
|
|
286
322
|
if (!(t != null && t.type))
|
|
287
323
|
return [];
|
|
288
|
-
const n = this.buildEntityFieldsTreeData(t.type.fields, [t.code]),
|
|
289
|
-
return
|
|
324
|
+
const n = this.buildEntityFieldsTreeData(t.type.fields, [t.code]), i = this.buildChildEntityTreeData(t.type.entities, [t.code]);
|
|
325
|
+
return i != null && i.length && (n == null || n.push(...i)), {
|
|
290
326
|
entityCode: t.code,
|
|
291
327
|
fields: [{
|
|
292
328
|
data: this.createTreeNode(t, [], "code"),
|
|
@@ -312,71 +348,71 @@ class he {
|
|
|
312
348
|
};
|
|
313
349
|
}
|
|
314
350
|
onBeforeOpenExpression(e, t, n) {
|
|
315
|
-
const
|
|
351
|
+
const i = n === "Field" ? e.binding.field : e.id, o = this.getExpressionRule(i, t), s = this.getEntitiesAndVariables(), a = {
|
|
316
352
|
message: ["validate", "required", "dataPicking"].includes(t) && o ? o.message : "",
|
|
317
|
-
...
|
|
353
|
+
...s
|
|
318
354
|
};
|
|
319
355
|
return o.messageType != null && (a.messageType = o.messageType), a;
|
|
320
356
|
}
|
|
321
|
-
buildRule(e, t, n,
|
|
322
|
-
const { expression: o, message:
|
|
357
|
+
buildRule(e, t, n, i) {
|
|
358
|
+
const { expression: o, message: s, messageType: a } = t, r = {
|
|
323
359
|
id: `${e}_${n}`,
|
|
324
360
|
type: n,
|
|
325
361
|
value: o
|
|
326
362
|
};
|
|
327
|
-
return (n === "validate" || n === "dataPicking" || n === "required") && (r.message =
|
|
363
|
+
return (n === "validate" || n === "dataPicking" || n === "required") && (r.message = s), n === "dataPicking" && (r.messageType = a), n === "validate" && i && (r.elementId = i), r;
|
|
328
364
|
}
|
|
329
365
|
getExpressionData() {
|
|
330
366
|
const { expressions: e } = this.formSchemaService.getFormSchema().module;
|
|
331
367
|
return e || [];
|
|
332
368
|
}
|
|
333
|
-
updateExpression(e, t, n,
|
|
334
|
-
const o = t === "Field" ? e.binding.field : e.id,
|
|
369
|
+
updateExpression(e, t, n, i) {
|
|
370
|
+
const o = t === "Field" ? e.binding.field : e.id, s = this.buildRule(o, n, i, e.type === "form-group" ? e.id : "");
|
|
335
371
|
let r = this.getExpressionData().find((u) => u.targetType === t && u.target === o);
|
|
336
372
|
const l = (u) => u.value.trim() === "";
|
|
337
373
|
if (r) {
|
|
338
|
-
const u = r.rules.find((p) => p.id ===
|
|
374
|
+
const u = r.rules.find((p) => p.id === s.id);
|
|
339
375
|
if (u)
|
|
340
|
-
l(
|
|
376
|
+
l(s) ? r.rules = r.rules.filter((p) => p.id !== s.id) : (Object.assign(u, s), i === "validate" && e.type === "form-group" && (u.elementId = e.id));
|
|
341
377
|
else {
|
|
342
|
-
if (l(
|
|
378
|
+
if (l(s))
|
|
343
379
|
return null;
|
|
344
|
-
r.rules = r.rules || [], r.rules.push(
|
|
380
|
+
r.rules = r.rules || [], r.rules.push(s);
|
|
345
381
|
}
|
|
346
382
|
} else {
|
|
347
|
-
if (l(
|
|
383
|
+
if (l(s))
|
|
348
384
|
return null;
|
|
349
385
|
r = {
|
|
350
386
|
target: `${o}`,
|
|
351
|
-
rules: [
|
|
387
|
+
rules: [s],
|
|
352
388
|
targetType: t
|
|
353
389
|
};
|
|
354
390
|
}
|
|
355
391
|
return r;
|
|
356
392
|
}
|
|
357
|
-
getExpressionEditorOptions(e, t, n,
|
|
358
|
-
return n.reduce((o,
|
|
393
|
+
getExpressionEditorOptions(e, t, n, i) {
|
|
394
|
+
return n.reduce((o, s) => {
|
|
359
395
|
var r, l;
|
|
360
396
|
const a = t === "Field" ? (r = e == null ? void 0 : e.binding) == null ? void 0 : r.field : e.id;
|
|
361
|
-
return o[
|
|
397
|
+
return o[s] = {
|
|
362
398
|
hide: t === "Field" ? !!((l = e == null ? void 0 : e.binding) != null && l.field) : !1,
|
|
363
399
|
description: "",
|
|
364
|
-
title: this.expressionNames[
|
|
400
|
+
title: this.expressionNames[s],
|
|
365
401
|
type: "string",
|
|
366
402
|
$converter: this.getExpressionConverter(a),
|
|
367
403
|
refreshPanelAfterChanged: !0,
|
|
368
404
|
editor: {
|
|
369
405
|
type: "expression-editor",
|
|
370
406
|
singleExpand: !1,
|
|
371
|
-
dialogTitle: `${this.expressionNames[
|
|
372
|
-
showMessage:
|
|
373
|
-
showMessageType:
|
|
374
|
-
beforeOpen: () => this.onBeforeOpenExpression(e,
|
|
407
|
+
dialogTitle: `${this.expressionNames[s]}编辑器`,
|
|
408
|
+
showMessage: s === "validate" || s === "dataPicking" || s === "required",
|
|
409
|
+
showMessageType: s === "dataPicking",
|
|
410
|
+
beforeOpen: () => this.onBeforeOpenExpression(e, s, t),
|
|
375
411
|
onSubmitModal: (u) => {
|
|
376
|
-
const p = this.updateExpression(e, t, u,
|
|
377
|
-
if (
|
|
378
|
-
const
|
|
379
|
-
|
|
412
|
+
const p = this.updateExpression(e, t, u, s);
|
|
413
|
+
if (i) {
|
|
414
|
+
const m = this.buildRule(a, u, s);
|
|
415
|
+
i(m);
|
|
380
416
|
}
|
|
381
417
|
return p;
|
|
382
418
|
}
|
|
@@ -385,36 +421,36 @@ class he {
|
|
|
385
421
|
}, {});
|
|
386
422
|
}
|
|
387
423
|
getExpressionInfo(e, t, n) {
|
|
388
|
-
const
|
|
424
|
+
const i = t === "Field" ? e.binding.field : e.id, o = this.getExpressionRule(i, n), s = {
|
|
389
425
|
value: o && o.value,
|
|
390
|
-
targetId:
|
|
426
|
+
targetId: i,
|
|
391
427
|
targetType: t,
|
|
392
428
|
expressionType: n
|
|
393
429
|
};
|
|
394
|
-
return o && o.message && (
|
|
430
|
+
return o && o.message && (s.message = o.message), s;
|
|
395
431
|
}
|
|
396
|
-
getExpressionConfig(e, t, n = ["compute", "dependency", "validate"],
|
|
432
|
+
getExpressionConfig(e, t, n = ["compute", "dependency", "validate"], i) {
|
|
397
433
|
return {
|
|
398
434
|
description: "表达式",
|
|
399
435
|
title: "表达式",
|
|
400
436
|
hide: !e.binding,
|
|
401
437
|
properties: {
|
|
402
|
-
...this.getExpressionEditorOptions(e, t, n,
|
|
438
|
+
...this.getExpressionEditorOptions(e, t, n, i)
|
|
403
439
|
}
|
|
404
440
|
};
|
|
405
441
|
}
|
|
406
442
|
getExpressionOptions(e, t, n) {
|
|
407
|
-
const
|
|
443
|
+
const i = this.getExpressionInfo(e, t, n);
|
|
408
444
|
return {
|
|
409
445
|
dialogTitle: `${this.expressionNames[n]}编辑器`,
|
|
410
446
|
singleExpand: !1,
|
|
411
447
|
showMessage: n === "required",
|
|
412
448
|
beforeOpen: () => this.onBeforeOpenExpression(e, n, t),
|
|
413
|
-
expressionInfo:
|
|
449
|
+
expressionInfo: i
|
|
414
450
|
};
|
|
415
451
|
}
|
|
416
452
|
}
|
|
417
|
-
class
|
|
453
|
+
class ye {
|
|
418
454
|
constructor(e, t) {
|
|
419
455
|
h(this, "componentId");
|
|
420
456
|
h(this, "viewModelId");
|
|
@@ -448,8 +484,8 @@ class be {
|
|
|
448
484
|
const t = e.binding && e.binding.type === "Form" && e.binding.field;
|
|
449
485
|
if (t) {
|
|
450
486
|
if (!this.designViewModelField) {
|
|
451
|
-
const
|
|
452
|
-
this.designViewModelField =
|
|
487
|
+
const i = this.designViewModelUtils.getDgViewModel(this.viewModelId);
|
|
488
|
+
this.designViewModelField = i.fields.find((o) => o.id === t);
|
|
453
489
|
}
|
|
454
490
|
e.updateOn = (n = this.designViewModelField) == null ? void 0 : n.updateOn;
|
|
455
491
|
}
|
|
@@ -482,7 +518,7 @@ class be {
|
|
|
482
518
|
};
|
|
483
519
|
}
|
|
484
520
|
getAppearanceConfig(e = null, t = {}, n) {
|
|
485
|
-
const
|
|
521
|
+
const i = {
|
|
486
522
|
title: "外观",
|
|
487
523
|
description: "Appearance"
|
|
488
524
|
}, o = {
|
|
@@ -501,21 +537,21 @@ class be {
|
|
|
501
537
|
parentPropertyID: "appearance"
|
|
502
538
|
}
|
|
503
539
|
};
|
|
504
|
-
for (const
|
|
505
|
-
o[
|
|
540
|
+
for (const s in t)
|
|
541
|
+
o[s] = Object.assign(o[s] || {}, t[s]);
|
|
506
542
|
return {
|
|
507
|
-
...
|
|
543
|
+
...i,
|
|
508
544
|
properties: { ...o },
|
|
509
|
-
setPropertyRelates(
|
|
510
|
-
if (
|
|
511
|
-
switch (
|
|
545
|
+
setPropertyRelates(s, a) {
|
|
546
|
+
if (s) {
|
|
547
|
+
switch (s && s.propertyID) {
|
|
512
548
|
case "class":
|
|
513
549
|
case "style": {
|
|
514
|
-
|
|
550
|
+
te.value++;
|
|
515
551
|
break;
|
|
516
552
|
}
|
|
517
553
|
}
|
|
518
|
-
n && n(
|
|
554
|
+
n && n(s, e, a);
|
|
519
555
|
}
|
|
520
556
|
}
|
|
521
557
|
};
|
|
@@ -530,39 +566,39 @@ class be {
|
|
|
530
566
|
* @param expressionType 指定表达式类型,存在属性和表达式类型不一致的情况
|
|
531
567
|
* @returns
|
|
532
568
|
*/
|
|
533
|
-
getPropertyEditorParams(e, t = [], n = "visible",
|
|
534
|
-
const { getVariables: a, getControlName: r, getStateMachines: l } =
|
|
569
|
+
getPropertyEditorParams(e, t = [], n = "visible", i = {}, o = {}, s = "") {
|
|
570
|
+
const { getVariables: a, getControlName: r, getStateMachines: l } = he(this.designerHostService), u = this.getRealTargetType(e), p = t && t.length > 0 ? t : ["Const", "Variable", "StateMachine", "Expression"], m = {
|
|
535
571
|
type: "property-editor",
|
|
536
572
|
propertyTypes: p
|
|
537
573
|
};
|
|
538
574
|
return p.map((E) => {
|
|
539
575
|
switch (E) {
|
|
540
576
|
case "Const":
|
|
541
|
-
Object.assign(
|
|
577
|
+
Object.assign(m, {
|
|
542
578
|
constType: "enum",
|
|
543
579
|
constEnums: [{ id: !0, name: "是" }, { id: !1, name: "否" }]
|
|
544
|
-
},
|
|
580
|
+
}, i);
|
|
545
581
|
break;
|
|
546
582
|
case "Expression":
|
|
547
|
-
|
|
583
|
+
m.expressionConfig = this.getExpressionOptions(e, u, s || n);
|
|
548
584
|
break;
|
|
549
585
|
case "StateMachine":
|
|
550
|
-
|
|
586
|
+
m.stateMachines = l();
|
|
551
587
|
break;
|
|
552
588
|
case "Variable":
|
|
553
|
-
Object.assign(
|
|
589
|
+
Object.assign(m, {
|
|
554
590
|
controlName: r(e),
|
|
555
591
|
newVariablePrefix: "is",
|
|
556
592
|
newVariableType: "Boolean",
|
|
557
593
|
variables: a(this.viewModelId),
|
|
558
594
|
parentComponentId: this.componentId === "root-component" ? "" : "root-component",
|
|
559
|
-
onBeforeOpenVariables: (
|
|
560
|
-
|
|
595
|
+
onBeforeOpenVariables: (x) => {
|
|
596
|
+
x.value = a(this.viewModelId);
|
|
561
597
|
}
|
|
562
|
-
}, o), this.designerContext.designerMode === "PC_RTC" && (
|
|
598
|
+
}, o), this.designerContext.designerMode === "PC_RTC" && (m.newVariablePrefix = "ext_" + m.newVariablePrefix);
|
|
563
599
|
break;
|
|
564
600
|
}
|
|
565
|
-
}),
|
|
601
|
+
}), m;
|
|
566
602
|
}
|
|
567
603
|
getVisibleProperty(e, t = "") {
|
|
568
604
|
var o;
|
|
@@ -582,17 +618,17 @@ class be {
|
|
|
582
618
|
* @param viewModelId
|
|
583
619
|
* @returns
|
|
584
620
|
*/
|
|
585
|
-
getBehaviorConfig(e, t = "", n = {},
|
|
621
|
+
getBehaviorConfig(e, t = "", n = {}, i) {
|
|
586
622
|
const o = {
|
|
587
623
|
title: "行为",
|
|
588
624
|
description: ""
|
|
589
|
-
},
|
|
625
|
+
}, s = this.getVisibleProperty(e, t);
|
|
590
626
|
for (const r in n)
|
|
591
|
-
|
|
627
|
+
s[r] = Object.assign(s[r] || {}, n[r]);
|
|
592
628
|
const a = this;
|
|
593
629
|
return {
|
|
594
630
|
...o,
|
|
595
|
-
properties: { ...
|
|
631
|
+
properties: { ...s },
|
|
596
632
|
setPropertyRelates(r, l) {
|
|
597
633
|
if (r) {
|
|
598
634
|
switch (r.propertyID) {
|
|
@@ -602,7 +638,7 @@ class be {
|
|
|
602
638
|
a.afterMutilEditorChanged(e, r);
|
|
603
639
|
break;
|
|
604
640
|
}
|
|
605
|
-
|
|
641
|
+
i && i(r, l);
|
|
606
642
|
}
|
|
607
643
|
}
|
|
608
644
|
};
|
|
@@ -625,8 +661,8 @@ class be {
|
|
|
625
661
|
const n = t && t.parent && t.parent.schema;
|
|
626
662
|
if (!n)
|
|
627
663
|
return;
|
|
628
|
-
const
|
|
629
|
-
n.contents.splice(
|
|
664
|
+
const i = n.contents.findIndex((s) => s.id === e), o = ae(n.contents[i]);
|
|
665
|
+
n.contents.splice(i, 1), n.contents.splice(i, 0, o), ne();
|
|
630
666
|
}
|
|
631
667
|
/**
|
|
632
668
|
* 属性编辑器,在编辑过程中会新增变量,此处需要将新增的变量追加到ViewModel中
|
|
@@ -638,7 +674,7 @@ class be {
|
|
|
638
674
|
const n = e.propertyValue;
|
|
639
675
|
if (!(n && typeof n == "object") || !(n.type === "Variable" && n.isNewVariable))
|
|
640
676
|
return;
|
|
641
|
-
const
|
|
677
|
+
const s = {
|
|
642
678
|
id: n.field,
|
|
643
679
|
category: "locale",
|
|
644
680
|
code: n.fullPath,
|
|
@@ -646,7 +682,7 @@ class be {
|
|
|
646
682
|
type: n.newVariableType || "String",
|
|
647
683
|
isRtcVariable: this.designerContext.designerMode === "PC_RTC" ? !0 : void 0
|
|
648
684
|
};
|
|
649
|
-
delete n.newVariableType, delete n.isNewVariable, this.formSchemaUtils.getVariableByCode(
|
|
685
|
+
delete n.newVariableType, delete n.isNewVariable, this.formSchemaUtils.getVariableByCode(s.code) || this.formSchemaUtils.getViewModelById("root-viewmodel").states.push(s);
|
|
650
686
|
}
|
|
651
687
|
/**
|
|
652
688
|
* 更新表达式到expressions节点
|
|
@@ -656,17 +692,17 @@ class be {
|
|
|
656
692
|
const t = e.propertyValue;
|
|
657
693
|
if (!((t && t.type) === "Expression" && t.expressionInfo))
|
|
658
694
|
return;
|
|
659
|
-
const { expressionId: o, expressionInfo:
|
|
660
|
-
|
|
661
|
-
const { expressions: E } =
|
|
662
|
-
let
|
|
663
|
-
|
|
664
|
-
const
|
|
665
|
-
if (
|
|
666
|
-
|
|
695
|
+
const { expressionId: o, expressionInfo: s } = t, { targetId: a, targetType: r, expressionType: l, value: u, message: p } = s, m = this.formSchemaUtils.getModule();
|
|
696
|
+
m.expressions = m.expressions || [];
|
|
697
|
+
const { expressions: E } = m;
|
|
698
|
+
let x = E.find((V) => V.target === a);
|
|
699
|
+
x || (x = { target: a, rules: [], targetType: r }, E.push(x));
|
|
700
|
+
const v = x.rules.find((V) => V.type === l);
|
|
701
|
+
if (v)
|
|
702
|
+
v.value = u, v.message = p;
|
|
667
703
|
else {
|
|
668
704
|
const V = { id: o, type: l, value: u, message: p };
|
|
669
|
-
|
|
705
|
+
x.rules.push(V);
|
|
670
706
|
}
|
|
671
707
|
delete t.expressionInfo;
|
|
672
708
|
}
|
|
@@ -680,11 +716,11 @@ class be {
|
|
|
680
716
|
const n = e.propertyValue;
|
|
681
717
|
if (n && n.type === "Expression")
|
|
682
718
|
return;
|
|
683
|
-
const o = e.propertyID,
|
|
719
|
+
const o = e.propertyID, s = this.formSchemaUtils.getExpressions(), a = t.binding ? t.binding.field : t.id, r = s.find((l) => l.target === a);
|
|
684
720
|
!r || !r.rules || (r.rules = r.rules.filter((l) => l.type !== o));
|
|
685
721
|
}
|
|
686
722
|
getExpressionOptions(e, t, n) {
|
|
687
|
-
return new
|
|
723
|
+
return new be(this.formSchemaUtils).getExpressionOptions(e, t, n);
|
|
688
724
|
}
|
|
689
725
|
getRealTargetType(e) {
|
|
690
726
|
return ["response-toolbar-item", "tab-toolbar-item", "section-toolbar-item", "drawer-toolbar-item"].indexOf(e.type) > -1 ? "Button" : e.binding && e.binding.field ? "Field" : "Container";
|
|
@@ -696,19 +732,19 @@ class be {
|
|
|
696
732
|
editor: {
|
|
697
733
|
initialData: e,
|
|
698
734
|
viewSourceHandle: (n) => {
|
|
699
|
-
var
|
|
700
|
-
((
|
|
735
|
+
var i;
|
|
736
|
+
((i = n.controller) == null ? void 0 : i.label.indexOf(this.formSchemaUtils.getModule().code)) > -1 && this.eventsEditorUtils.jumpToMethod(n);
|
|
701
737
|
}
|
|
702
738
|
}
|
|
703
739
|
}, t;
|
|
704
740
|
}
|
|
705
741
|
}
|
|
706
|
-
class
|
|
742
|
+
class ve extends ye {
|
|
707
743
|
constructor(e, t) {
|
|
708
744
|
super(e, t);
|
|
709
745
|
}
|
|
710
746
|
getPropertyConfig(e) {
|
|
711
|
-
return this.propertyConfig.categories.basic = this.getBasicPropConfig(e), this.propertyConfig.categories.appearance = this.getAppearanceProperties(e), this.propertyConfig;
|
|
747
|
+
return this.propertyConfig.categories.basic = this.getBasicPropConfig(e), this.propertyConfig.categories.appearance = this.getAppearanceProperties(e), this.propertyConfig.categories.behavior = this.getBehaviorConfig(e, ""), this.propertyConfig;
|
|
712
748
|
}
|
|
713
749
|
getAppearanceProperties(e) {
|
|
714
750
|
const t = this;
|
|
@@ -717,11 +753,39 @@ class ye extends be {
|
|
|
717
753
|
title: "标题",
|
|
718
754
|
type: "string",
|
|
719
755
|
description: "标题"
|
|
756
|
+
},
|
|
757
|
+
expandStatus: {
|
|
758
|
+
title: "默认状态",
|
|
759
|
+
type: "boolean",
|
|
760
|
+
description: "默认面板是展开还是收起",
|
|
761
|
+
editor: {
|
|
762
|
+
type: "combo-list",
|
|
763
|
+
textField: "name",
|
|
764
|
+
valueField: "value",
|
|
765
|
+
data: [{
|
|
766
|
+
name: "展开",
|
|
767
|
+
value: !0
|
|
768
|
+
}, {
|
|
769
|
+
name: "收起",
|
|
770
|
+
value: !1
|
|
771
|
+
}],
|
|
772
|
+
enableClear: !1
|
|
773
|
+
}
|
|
774
|
+
},
|
|
775
|
+
expandLabel: {
|
|
776
|
+
title: "展开文本",
|
|
777
|
+
type: "string",
|
|
778
|
+
description: "展开文本"
|
|
779
|
+
},
|
|
780
|
+
collapseLabel: {
|
|
781
|
+
title: "收起文本",
|
|
782
|
+
type: "string",
|
|
783
|
+
description: "收起文本"
|
|
720
784
|
}
|
|
721
|
-
}, (
|
|
722
|
-
switch (
|
|
785
|
+
}, (i, o, s) => {
|
|
786
|
+
switch (i && i.propertyID) {
|
|
723
787
|
case "title": {
|
|
724
|
-
|
|
788
|
+
i.needRefreshControlTree = !0, t.changeGroupNameInViewModel(o.id, i.propertyValue);
|
|
725
789
|
break;
|
|
726
790
|
}
|
|
727
791
|
}
|
|
@@ -734,18 +798,18 @@ class ye extends be {
|
|
|
734
798
|
var o;
|
|
735
799
|
const n = this.designViewModelUtils.getDgViewModel(this.viewModelId);
|
|
736
800
|
n && n.changeGroupName(e, t);
|
|
737
|
-
const
|
|
738
|
-
(o =
|
|
739
|
-
|
|
801
|
+
const i = this.formSchemaUtils.getViewModelById(this.viewModelId);
|
|
802
|
+
(o = i == null ? void 0 : i.fields) != null && o.length && i.fields.forEach((s) => {
|
|
803
|
+
s.groupId === e && (s.groupName = t);
|
|
740
804
|
});
|
|
741
805
|
}
|
|
742
806
|
}
|
|
743
|
-
function
|
|
744
|
-
const t = new
|
|
807
|
+
function Ce(d, e) {
|
|
808
|
+
const t = new ie(), { canAccept: n } = t.getTemplateRule(d, e), i = d.schema;
|
|
745
809
|
function o() {
|
|
746
810
|
return "f-section-formgroup";
|
|
747
811
|
}
|
|
748
|
-
function
|
|
812
|
+
function s() {
|
|
749
813
|
return !0;
|
|
750
814
|
}
|
|
751
815
|
function a() {
|
|
@@ -755,44 +819,44 @@ function ve(d, e) {
|
|
|
755
819
|
return !1;
|
|
756
820
|
}
|
|
757
821
|
function l(c) {
|
|
758
|
-
const { sourceElement: f } = c, { componentInstance: C } = f,
|
|
759
|
-
if (!
|
|
822
|
+
const { sourceElement: f } = c, { componentInstance: C } = f, g = e == null ? void 0 : e.formSchemaUtils;
|
|
823
|
+
if (!g)
|
|
760
824
|
return !0;
|
|
761
|
-
const
|
|
825
|
+
const w = g.getComponentById(C.value.belongedComponentId), b = g.getViewModelById(w.viewModel), I = g.getComponentById(d.componentInstance.value.belongedComponentId), M = g.getViewModelById(I.viewModel);
|
|
762
826
|
return b != null && b.id && (M != null && M.id) && b.id !== M.id ? b.bindTo === M.bindTo : !0;
|
|
763
827
|
}
|
|
764
828
|
function u(c) {
|
|
765
829
|
const { bindingTargetId: f } = c;
|
|
766
830
|
if (!e)
|
|
767
831
|
return;
|
|
768
|
-
const { formSchemaUtils: C, schemaService:
|
|
832
|
+
const { formSchemaUtils: C, schemaService: g } = e, w = C.getComponentById(d.componentInstance.value.belongedComponentId), b = g.getFieldByIDAndVMID(f, w.viewModel);
|
|
769
833
|
return !!(b != null && b.schemaField);
|
|
770
834
|
}
|
|
771
835
|
function p(c) {
|
|
772
836
|
return c.sourceType === "control" && c.componentCategory === "input" ? !0 : c.sourceType === "move" && c.componentType === "form-group" ? l(c) : c.sourceType === "field" && c.componentCategory === "input" ? u(c) : !1;
|
|
773
837
|
}
|
|
774
|
-
function
|
|
838
|
+
function m(c) {
|
|
775
839
|
return !(!se().basalDragulaRuleForContainer(c, e) || !n || !p(c));
|
|
776
840
|
}
|
|
777
841
|
function E(c) {
|
|
778
|
-
return new
|
|
842
|
+
return new ve(c, e).getPropertyConfig(i);
|
|
779
843
|
}
|
|
780
|
-
function
|
|
781
|
-
var M, P,
|
|
844
|
+
function x(c) {
|
|
845
|
+
var M, P, k, U, N;
|
|
782
846
|
if (!e)
|
|
783
847
|
return;
|
|
784
|
-
const { formSchemaUtils: f, designViewModelUtils: C } = e,
|
|
785
|
-
switch (
|
|
848
|
+
const { formSchemaUtils: f, designViewModelUtils: C } = e, g = c.componentInstance, w = g.value.parent, b = f.getComponentById(g.value.belongedComponentId), I = C.getDgViewModel(b.viewModel);
|
|
849
|
+
switch (w && ((M = w.schema) == null ? void 0 : M.type)) {
|
|
786
850
|
case S.fieldset.type:
|
|
787
851
|
case S["response-form"].type:
|
|
788
852
|
case S["response-layout-item"].type: {
|
|
789
|
-
const A = { groupId:
|
|
853
|
+
const A = { groupId: i.id, groupName: i.title }, W = (k = (P = g.value.schema) == null ? void 0 : P.binding) == null ? void 0 : k.type, O = (N = (U = g.value.schema) == null ? void 0 : U.binding) == null ? void 0 : N.field;
|
|
790
854
|
switch (W) {
|
|
791
|
-
case
|
|
792
|
-
|
|
855
|
+
case G.Form: {
|
|
856
|
+
I.changeField(O, A);
|
|
793
857
|
break;
|
|
794
858
|
}
|
|
795
|
-
case
|
|
859
|
+
case G.Variable: {
|
|
796
860
|
f.modifyViewModelFieldById(b.viewModel, O, A, !0);
|
|
797
861
|
break;
|
|
798
862
|
}
|
|
@@ -801,68 +865,68 @@ function ve(d, e) {
|
|
|
801
865
|
}
|
|
802
866
|
}
|
|
803
867
|
}
|
|
804
|
-
function
|
|
868
|
+
function v(c) {
|
|
805
869
|
if (!c || !c.componentInstance || !e)
|
|
806
870
|
return;
|
|
807
871
|
const f = c.componentInstance, C = f.value.schema;
|
|
808
872
|
if (!C.binding || !C.binding.field)
|
|
809
873
|
return;
|
|
810
|
-
|
|
811
|
-
const { formSchemaUtils:
|
|
812
|
-
|
|
874
|
+
x(c);
|
|
875
|
+
const { formSchemaUtils: g } = e, w = g.getViewModelIdByComponentId(f.value.belongedComponentId), b = g.getViewModelIdByComponentId(d.componentInstance.value.belongedComponentId);
|
|
876
|
+
w !== b && D(d, e).moveInputBetweenComponent(c);
|
|
813
877
|
}
|
|
814
878
|
function V(c, f) {
|
|
815
|
-
var C,
|
|
879
|
+
var C, g, w;
|
|
816
880
|
if (c.componentCategory === "input") {
|
|
817
881
|
const { label: b } = c;
|
|
818
|
-
let
|
|
882
|
+
let I;
|
|
819
883
|
const M = e == null ? void 0 : e.controlCreatorUtils;
|
|
820
|
-
(C = c.bindingSourceContext) != null && C.entityFieldNode ?
|
|
821
|
-
const P =
|
|
822
|
-
return P.resolveFormGroupAppearance(
|
|
884
|
+
(C = c.bindingSourceContext) != null && C.entityFieldNode ? I = M.setFormFieldProperty((g = c.bindingSourceContext) == null ? void 0 : g.entityFieldNode, f == null ? void 0 : f.type) : (I = M.createFormGroupWithoutField(f == null ? void 0 : f.type), I.label = b);
|
|
885
|
+
const P = D(d, e);
|
|
886
|
+
return P.resolveFormGroupAppearance(I), P.syncFieldToViewModel(c, (w = I.editor) == null ? void 0 : w.type, i.id, i.title), I;
|
|
823
887
|
}
|
|
824
888
|
return f;
|
|
825
889
|
}
|
|
826
890
|
return {
|
|
827
|
-
canAccepts:
|
|
891
|
+
canAccepts: m,
|
|
828
892
|
hideNestedPaddingInDesginerView: r,
|
|
829
893
|
getPropsConfig: E,
|
|
830
|
-
checkCanDeleteComponent:
|
|
894
|
+
checkCanDeleteComponent: s,
|
|
831
895
|
checkCanMoveComponent: a,
|
|
832
|
-
onAcceptMovedChildElement:
|
|
896
|
+
onAcceptMovedChildElement: v,
|
|
833
897
|
onResolveNewComponentSchema: V,
|
|
834
898
|
getDesignerClass: o
|
|
835
899
|
};
|
|
836
900
|
}
|
|
837
|
-
const
|
|
901
|
+
const xe = /* @__PURE__ */ q({
|
|
838
902
|
name: "FFieldsetDesign",
|
|
839
903
|
props: me,
|
|
840
904
|
emits: [],
|
|
841
905
|
setup(d, e) {
|
|
842
|
-
const t = T(), n = T(),
|
|
906
|
+
const t = T(), n = T(), i = $("design-item-context"), o = $("designer-host-service"), s = Ce(i, o), a = oe(n, i, s);
|
|
843
907
|
e.expose(a.value);
|
|
844
908
|
const {
|
|
845
909
|
designerContext: r
|
|
846
910
|
} = o;
|
|
847
|
-
|
|
911
|
+
X(() => {
|
|
848
912
|
n.value.componentInstance = a;
|
|
849
913
|
});
|
|
850
914
|
const l = T(!0);
|
|
851
|
-
function u(
|
|
852
|
-
|
|
915
|
+
function u(v, V) {
|
|
916
|
+
v && V && V.split(" ").reduce((f, C) => (f[C] = !0, f), v);
|
|
853
917
|
}
|
|
854
918
|
const p = F(() => {
|
|
855
|
-
const
|
|
919
|
+
const v = {
|
|
856
920
|
"f-section-formgroup": !0,
|
|
857
921
|
"f-state-collapse": !l.value
|
|
858
922
|
};
|
|
859
|
-
return u(
|
|
860
|
-
}),
|
|
861
|
-
const
|
|
923
|
+
return u(v, d.customClass), v;
|
|
924
|
+
}), m = F(() => {
|
|
925
|
+
const v = r && r.designerMode === "Mobile";
|
|
862
926
|
return {
|
|
863
927
|
display: l.value ? "flex" : "none",
|
|
864
928
|
"flex-wrap": "wrap",
|
|
865
|
-
"flex-direction":
|
|
929
|
+
"flex-direction": v ? "column" : "row"
|
|
866
930
|
};
|
|
867
931
|
}), E = F(() => ({
|
|
868
932
|
btn: !0,
|
|
@@ -870,49 +934,49 @@ const Ce = /* @__PURE__ */ j({
|
|
|
870
934
|
"f-btn-collapse-expand": !0,
|
|
871
935
|
"f-state-expand": l.value
|
|
872
936
|
}));
|
|
873
|
-
function
|
|
874
|
-
|
|
875
|
-
|
|
937
|
+
function x(v) {
|
|
938
|
+
v.stopPropagation(), l.value = !l.value, Y(() => {
|
|
939
|
+
re();
|
|
876
940
|
});
|
|
877
941
|
}
|
|
878
|
-
return () =>
|
|
942
|
+
return () => y("fieldset", {
|
|
879
943
|
class: p.value,
|
|
880
944
|
ref: t
|
|
881
|
-
}, [
|
|
945
|
+
}, [y("legend", {
|
|
882
946
|
class: "f-section-formgroup-legend"
|
|
883
|
-
}, [
|
|
947
|
+
}, [y("div", {
|
|
884
948
|
class: "f-header"
|
|
885
|
-
}, [
|
|
949
|
+
}, [y("div", {
|
|
886
950
|
class: "f-title",
|
|
887
|
-
onClick:
|
|
888
|
-
}, [d.title]),
|
|
951
|
+
onClick: x
|
|
952
|
+
}, [d.title]), y("div", {
|
|
889
953
|
class: "f-toolbar",
|
|
890
|
-
onClick:
|
|
891
|
-
}, [
|
|
954
|
+
onClick: x
|
|
955
|
+
}, [y("button", {
|
|
892
956
|
class: E.value
|
|
893
|
-
}, null)])])]),
|
|
894
|
-
"data-dragref": `${
|
|
957
|
+
}, [y("span", null, [l.value ? d.collapseLabel : d.expandLabel])])])])]), y("div", {
|
|
958
|
+
"data-dragref": `${i.schema.id}-container`,
|
|
895
959
|
ref: n,
|
|
896
960
|
class: "f-section-formgroup-inputs drag-container",
|
|
897
|
-
style:
|
|
961
|
+
style: m.value
|
|
898
962
|
}, [e.slots.default && e.slots.default()])]);
|
|
899
963
|
}
|
|
900
|
-
}),
|
|
964
|
+
}), Te = {
|
|
901
965
|
install(d) {
|
|
902
|
-
d.component(
|
|
966
|
+
d.component(R.name, R);
|
|
903
967
|
},
|
|
904
|
-
register(d, e, t, n,
|
|
905
|
-
d.fieldset =
|
|
968
|
+
register(d, e, t, n, i) {
|
|
969
|
+
d.fieldset = R, e.fieldset = L(i);
|
|
906
970
|
},
|
|
907
971
|
registerDesigner(d, e, t, n) {
|
|
908
|
-
d.fieldset =
|
|
972
|
+
d.fieldset = xe, e.fieldset = L(n);
|
|
909
973
|
}
|
|
910
974
|
};
|
|
911
975
|
export {
|
|
912
|
-
|
|
913
|
-
|
|
976
|
+
R as Fieldset,
|
|
977
|
+
Te as default,
|
|
914
978
|
me as fieldsetDesignerProps,
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
979
|
+
B as fieldsetProps,
|
|
980
|
+
Se as propsResolver,
|
|
981
|
+
L as propsResolverGenerator
|
|
918
982
|
};
|