@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,22 +1,24 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var v = (
|
|
4
|
-
import { defineComponent as
|
|
5
|
-
import { getCustomClass as
|
|
6
|
-
import { resolveAppearance as
|
|
7
|
-
import { DgControl as
|
|
8
|
-
import { cloneDeep as
|
|
9
|
-
function
|
|
1
|
+
var N = Object.defineProperty;
|
|
2
|
+
var T = (a, e, t) => e in a ? N(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
|
|
3
|
+
var v = (a, e, t) => T(a, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { defineComponent as S, ref as y, watch as w, computed as C, createVNode as p, inject as M, onMounted as F, nextTick as R } from "vue";
|
|
5
|
+
import { getCustomClass as k } from "../common/index.esm.js";
|
|
6
|
+
import { resolveAppearance as B, createPropsResolver as U } from "../dynamic-resolver/index.esm.js";
|
|
7
|
+
import { DgControl as E, canvasChanged as z, refreshCanvas as O, UseTemplateDragAndDropRules as A, useDragulaCommonRule as $, useDesignerComponent as q, setPositionOfSelectedComponentBtnGroup as D } from "../designer-canvas/index.esm.js";
|
|
8
|
+
import { cloneDeep as L } from "lodash-es";
|
|
9
|
+
function j(a, e) {
|
|
10
10
|
return { size: e.width || e.height || "" };
|
|
11
11
|
}
|
|
12
|
-
const
|
|
13
|
-
["appearance",
|
|
14
|
-
["size",
|
|
12
|
+
const _ = /* @__PURE__ */ new Map([
|
|
13
|
+
["appearance", B],
|
|
14
|
+
["size", j]
|
|
15
15
|
]);
|
|
16
|
-
function
|
|
17
|
-
return e
|
|
16
|
+
function G(a, e, t) {
|
|
17
|
+
return e.size = {
|
|
18
|
+
width: 220
|
|
19
|
+
}, e.title = "标题", e;
|
|
18
20
|
}
|
|
19
|
-
const
|
|
21
|
+
const H = "https://json-schema.org/draft/2020-12/schema", J = "https://farris-design.gitee.io/list-nav.schema.json", K = "list-nav", Q = "A Farris Container Component", W = "object", X = {
|
|
20
22
|
id: {
|
|
21
23
|
description: "The unique identifier for a list-nav",
|
|
22
24
|
type: "string"
|
|
@@ -71,20 +73,30 @@ const D = "https://json-schema.org/draft/2020-12/schema", L = "https://farris-de
|
|
|
71
73
|
description: "",
|
|
72
74
|
type: "string",
|
|
73
75
|
default: ""
|
|
76
|
+
},
|
|
77
|
+
collapsible: {
|
|
78
|
+
description: "",
|
|
79
|
+
type: "boolean",
|
|
80
|
+
default: !0
|
|
81
|
+
},
|
|
82
|
+
folded: {
|
|
83
|
+
description: "",
|
|
84
|
+
type: "boolean",
|
|
85
|
+
default: !1
|
|
74
86
|
}
|
|
75
|
-
},
|
|
87
|
+
}, Y = [
|
|
76
88
|
"id",
|
|
77
89
|
"type",
|
|
78
90
|
"contents"
|
|
79
|
-
],
|
|
80
|
-
$schema:
|
|
81
|
-
$id:
|
|
82
|
-
title:
|
|
83
|
-
description:
|
|
84
|
-
type:
|
|
85
|
-
properties:
|
|
86
|
-
required:
|
|
87
|
-
},
|
|
91
|
+
], Z = {
|
|
92
|
+
$schema: H,
|
|
93
|
+
$id: J,
|
|
94
|
+
title: K,
|
|
95
|
+
description: Q,
|
|
96
|
+
type: W,
|
|
97
|
+
properties: X,
|
|
98
|
+
required: Y
|
|
99
|
+
}, V = {
|
|
88
100
|
/** 自定义样式 */
|
|
89
101
|
customClass: { type: String, default: "" },
|
|
90
102
|
customStyle: { type: String, default: "" },
|
|
@@ -101,90 +113,95 @@ const D = "https://json-schema.org/draft/2020-12/schema", L = "https://farris-de
|
|
|
101
113
|
/** 控件禁用状态 */
|
|
102
114
|
disabled: { Type: Boolean, default: !1 },
|
|
103
115
|
/** 是否启用拖拽 TODO */
|
|
104
|
-
draggable: { Type: Boolean, default: !1 }
|
|
105
|
-
|
|
116
|
+
draggable: { Type: Boolean, default: !1 },
|
|
117
|
+
/** 控制是否可见 */
|
|
118
|
+
visible: { type: Boolean, default: !0 }
|
|
119
|
+
}, I = U(V, Z, _, G), x = /* @__PURE__ */ S({
|
|
106
120
|
name: "FListNav",
|
|
107
|
-
props:
|
|
121
|
+
props: V,
|
|
108
122
|
emits: ["collapse"],
|
|
109
|
-
setup(
|
|
110
|
-
const t =
|
|
111
|
-
|
|
112
|
-
|
|
123
|
+
setup(a, e) {
|
|
124
|
+
const t = y(a.position), i = y(a.folded), n = y(!1);
|
|
125
|
+
w(() => a.position, (s, l) => {
|
|
126
|
+
s !== l && (t.value = s);
|
|
127
|
+
});
|
|
128
|
+
function o(s) {
|
|
129
|
+
s && s.stopPropagation(), !a.disabled && (n.value = !0, i.value = !i.value, e.emit("collapse", i.value));
|
|
113
130
|
}
|
|
114
|
-
const
|
|
115
|
-
const
|
|
116
|
-
return
|
|
117
|
-
}),
|
|
118
|
-
const
|
|
131
|
+
const r = C(() => {
|
|
132
|
+
const s = {}, l = ["top", "bottom"].indexOf(t.value) > -1 ? "height" : "width";
|
|
133
|
+
return s[l] = i.value ? "0px" : a.size + "px", s;
|
|
134
|
+
}), d = C(() => {
|
|
135
|
+
const s = {
|
|
119
136
|
"f-list-nav": !0,
|
|
120
137
|
"f-list-nav-top": t.value === "top",
|
|
121
138
|
"f-list-nav-left": t.value === "left",
|
|
122
139
|
"f-list-nav-right": t.value === "right",
|
|
123
140
|
"f-list-nav-bottom": t.value === "bottom"
|
|
124
141
|
};
|
|
125
|
-
return
|
|
142
|
+
return k(s, a.customClass);
|
|
126
143
|
});
|
|
127
|
-
return () => p("div", {
|
|
128
|
-
class:
|
|
129
|
-
style:
|
|
144
|
+
return () => a.visible ? p("div", {
|
|
145
|
+
class: d.value,
|
|
146
|
+
style: a.customStyle
|
|
130
147
|
}, [p("div", {
|
|
131
148
|
class: "f-list-nav-in",
|
|
132
|
-
style:
|
|
149
|
+
style: r.value
|
|
133
150
|
}, [p("div", {
|
|
134
151
|
class: "f-list-nav-main"
|
|
135
152
|
}, [e.slots.navHeader && p("div", {
|
|
136
153
|
class: "f-list-nav-header"
|
|
137
|
-
}, [e.slots.navHeader()]), !e.slots.navHeader &&
|
|
154
|
+
}, [e.slots.navHeader()]), !e.slots.navHeader && a.title && p("div", {
|
|
138
155
|
class: "f-list-nav-header"
|
|
139
156
|
}, [p("div", {
|
|
140
157
|
class: "f-list-nav-title"
|
|
141
|
-
}, [
|
|
158
|
+
}, [a.title])]), e.slots.default && p("div", {
|
|
142
159
|
class: "f-list-nav-content"
|
|
143
160
|
}, [e.slots.default()]), e.slots.navContent && p("div", {
|
|
144
161
|
class: "f-list-nav-content"
|
|
145
162
|
}, [e.slots.navContent()]), e.slots.navFooter && p("div", {
|
|
146
163
|
class: "f-list-nav-footer"
|
|
147
|
-
}, [e.slots.navFooter()])]),
|
|
164
|
+
}, [e.slots.navFooter()])]), a.collapsible && p("div", {
|
|
148
165
|
class: ["f-list-nav-toggle-sidebar", {
|
|
149
|
-
disabled:
|
|
166
|
+
disabled: a.disabled,
|
|
150
167
|
active: i.value,
|
|
151
|
-
"splitter-pane-collapse-animate":
|
|
168
|
+
"splitter-pane-collapse-animate": n.value
|
|
152
169
|
}],
|
|
153
|
-
onClick: (
|
|
170
|
+
onClick: (s) => o(s)
|
|
154
171
|
}, [p("span", {
|
|
155
172
|
class: "triangle"
|
|
156
|
-
}, null)])])]);
|
|
173
|
+
}, null)])])]) : null;
|
|
157
174
|
}
|
|
158
|
-
}),
|
|
159
|
-
function
|
|
160
|
-
const { formSchemaUtils: e, formStateMachineUtils: t } =
|
|
161
|
-
function s
|
|
175
|
+
}), ee = y(0);
|
|
176
|
+
function te(a) {
|
|
177
|
+
const { formSchemaUtils: e, formStateMachineUtils: t } = a;
|
|
178
|
+
function i(s, l = "") {
|
|
162
179
|
return {
|
|
163
|
-
path:
|
|
164
|
-
field:
|
|
165
|
-
fullPath:
|
|
180
|
+
path: l + s.code,
|
|
181
|
+
field: s.id,
|
|
182
|
+
fullPath: s.code
|
|
166
183
|
};
|
|
167
184
|
}
|
|
168
|
-
function
|
|
169
|
-
const c = e.getViewModelById(
|
|
170
|
-
return c ? c.states.map((u) =>
|
|
185
|
+
function n(s, l = "") {
|
|
186
|
+
const c = e.getViewModelById(s);
|
|
187
|
+
return c ? c.states.map((u) => i(u, l)) : [];
|
|
171
188
|
}
|
|
172
|
-
function
|
|
173
|
-
const
|
|
174
|
-
if (
|
|
189
|
+
function o(s) {
|
|
190
|
+
const l = e.getRootViewModelId(), c = n(s);
|
|
191
|
+
if (s === l)
|
|
175
192
|
return c;
|
|
176
|
-
const u =
|
|
193
|
+
const u = n(l, "root-component.");
|
|
177
194
|
return [...c, ...u];
|
|
178
195
|
}
|
|
179
|
-
function
|
|
180
|
-
return
|
|
196
|
+
function r(s) {
|
|
197
|
+
return s.binding && s.binding.path || s.id || "";
|
|
181
198
|
}
|
|
182
|
-
function
|
|
199
|
+
function d() {
|
|
183
200
|
return t && t.getRenderStates() || [];
|
|
184
201
|
}
|
|
185
|
-
return { getVariables:
|
|
202
|
+
return { getVariables: o, getControlName: r, getStateMachines: d };
|
|
186
203
|
}
|
|
187
|
-
class
|
|
204
|
+
class ie {
|
|
188
205
|
constructor(e) {
|
|
189
206
|
v(this, "sessionVariables", [
|
|
190
207
|
{
|
|
@@ -233,87 +250,87 @@ class Y {
|
|
|
233
250
|
required: "必填表达式"
|
|
234
251
|
});
|
|
235
252
|
v(this, "getExpressionConverter", (e, t) => ({
|
|
236
|
-
convertFrom: (
|
|
237
|
-
const
|
|
238
|
-
return
|
|
253
|
+
convertFrom: (i, n, o, r) => {
|
|
254
|
+
const d = o.getExpressionRuleValue(e, t || n);
|
|
255
|
+
return d && d.value || "";
|
|
239
256
|
},
|
|
240
|
-
convertTo: (
|
|
241
|
-
var
|
|
242
|
-
if (
|
|
243
|
-
const
|
|
244
|
-
((
|
|
245
|
-
(u) => u.id ===
|
|
246
|
-
)) ?
|
|
257
|
+
convertTo: (i, n, o, r, d) => {
|
|
258
|
+
var s;
|
|
259
|
+
if (n === "dataPicking" && (o != null && o.target)) {
|
|
260
|
+
const l = `${o.target}_dataPicking`;
|
|
261
|
+
((s = o.rules) == null ? void 0 : s.some(
|
|
262
|
+
(u) => u.id === l && u.value
|
|
263
|
+
)) ? i.dictPickingExpressionId = l : delete i.dictPickingExpressionId;
|
|
247
264
|
}
|
|
248
|
-
|
|
265
|
+
r.updateExpression(o);
|
|
249
266
|
}
|
|
250
267
|
}));
|
|
251
268
|
this.formSchemaService = e;
|
|
252
269
|
}
|
|
253
270
|
getExpressionRule(e, t) {
|
|
254
|
-
const
|
|
255
|
-
if (!s)
|
|
256
|
-
return "";
|
|
257
|
-
const i = s.find((n) => n.target === e);
|
|
271
|
+
const i = this.formSchemaService.getExpressions();
|
|
258
272
|
if (!i)
|
|
259
273
|
return "";
|
|
260
|
-
const
|
|
261
|
-
|
|
274
|
+
const n = i.find((r) => r.target === e);
|
|
275
|
+
if (!n)
|
|
276
|
+
return "";
|
|
277
|
+
const o = n.rules.find((r) => r.type === t);
|
|
278
|
+
return o || "";
|
|
262
279
|
}
|
|
263
280
|
// 获取上下文表单变量
|
|
264
281
|
getContextFormVariables() {
|
|
265
282
|
const { module: e } = this.formSchemaService.getFormSchema();
|
|
266
283
|
if (!e.viewmodels || e.viewmodels.length === 0)
|
|
267
284
|
return [];
|
|
268
|
-
const t = this.formSchemaService.getRootViewModelId(),
|
|
269
|
-
if (!
|
|
285
|
+
const t = this.formSchemaService.getRootViewModelId(), i = this.formSchemaService.getViewModelById(t);
|
|
286
|
+
if (!i || !i.states || i.states.length === 0)
|
|
270
287
|
return [];
|
|
271
|
-
const
|
|
272
|
-
return
|
|
273
|
-
|
|
274
|
-
key:
|
|
275
|
-
name:
|
|
276
|
-
description:
|
|
277
|
-
category:
|
|
288
|
+
const n = [];
|
|
289
|
+
return i.states.filter((o) => o.category === "remote").forEach((o) => {
|
|
290
|
+
n.push({
|
|
291
|
+
key: o.code,
|
|
292
|
+
name: o.name,
|
|
293
|
+
description: o.name,
|
|
294
|
+
category: o.category
|
|
278
295
|
});
|
|
279
|
-
}),
|
|
296
|
+
}), n;
|
|
280
297
|
}
|
|
281
|
-
createTreeNode(e, t,
|
|
298
|
+
createTreeNode(e, t, i = "label") {
|
|
282
299
|
return {
|
|
283
300
|
id: e.id,
|
|
284
301
|
name: e.name,
|
|
285
|
-
bindingPath: e[
|
|
302
|
+
bindingPath: e[i],
|
|
286
303
|
parents: t,
|
|
287
304
|
type: "field"
|
|
288
305
|
};
|
|
289
306
|
}
|
|
290
307
|
buildEntityFieldsTreeData(e = null, t) {
|
|
291
|
-
const
|
|
292
|
-
return e == null || e.forEach((
|
|
293
|
-
var
|
|
294
|
-
const
|
|
295
|
-
let
|
|
296
|
-
(
|
|
297
|
-
data:
|
|
298
|
-
children:
|
|
308
|
+
const i = [];
|
|
309
|
+
return e == null || e.forEach((n) => {
|
|
310
|
+
var d;
|
|
311
|
+
const o = this.createTreeNode(n, t);
|
|
312
|
+
let r = [];
|
|
313
|
+
(d = n.type) != null && d.fields && (r = this.buildEntityFieldsTreeData(n.type.fields, [...t, n.label])), i.push({
|
|
314
|
+
data: o,
|
|
315
|
+
children: r,
|
|
299
316
|
expanded: !0
|
|
300
317
|
});
|
|
301
|
-
}),
|
|
318
|
+
}), i;
|
|
302
319
|
}
|
|
303
320
|
buildChildEntityTreeData(e = null, t) {
|
|
304
|
-
const
|
|
305
|
-
return e == null || e.forEach((
|
|
306
|
-
var
|
|
307
|
-
const
|
|
308
|
-
|
|
309
|
-
const
|
|
310
|
-
|
|
311
|
-
data:
|
|
312
|
-
children:
|
|
321
|
+
const i = [];
|
|
322
|
+
return e == null || e.forEach((n) => {
|
|
323
|
+
var s, l;
|
|
324
|
+
const o = this.createTreeNode(n, t);
|
|
325
|
+
o.type = "entity";
|
|
326
|
+
const r = this.buildEntityFieldsTreeData((s = n.type) == null ? void 0 : s.fields, [...t, n.label]), d = this.buildChildEntityTreeData((l = n.type) == null ? void 0 : l.entities, [...t, n.label]);
|
|
327
|
+
d != null && d.length && (r == null || r.push(...d)), i.push({
|
|
328
|
+
data: o,
|
|
329
|
+
children: r || [],
|
|
313
330
|
// 空值回退
|
|
314
331
|
expanded: !0
|
|
315
332
|
});
|
|
316
|
-
}),
|
|
333
|
+
}), i;
|
|
317
334
|
}
|
|
318
335
|
getEntitiesTreeData() {
|
|
319
336
|
const e = this.formSchemaService.getSchemaEntities();
|
|
@@ -322,12 +339,12 @@ class Y {
|
|
|
322
339
|
const t = e[0];
|
|
323
340
|
if (!(t != null && t.type))
|
|
324
341
|
return [];
|
|
325
|
-
const
|
|
326
|
-
return
|
|
342
|
+
const i = this.buildEntityFieldsTreeData(t.type.fields, [t.code]), n = this.buildChildEntityTreeData(t.type.entities, [t.code]);
|
|
343
|
+
return n != null && n.length && (i == null || i.push(...n)), {
|
|
327
344
|
entityCode: t.code,
|
|
328
345
|
fields: [{
|
|
329
346
|
data: this.createTreeNode(t, [], "code"),
|
|
330
|
-
children:
|
|
347
|
+
children: i || []
|
|
331
348
|
}]
|
|
332
349
|
};
|
|
333
350
|
}
|
|
@@ -348,110 +365,110 @@ class Y {
|
|
|
348
365
|
}
|
|
349
366
|
};
|
|
350
367
|
}
|
|
351
|
-
onBeforeOpenExpression(e, t,
|
|
352
|
-
const
|
|
353
|
-
message: ["validate", "required", "dataPicking"].includes(t) &&
|
|
354
|
-
...
|
|
368
|
+
onBeforeOpenExpression(e, t, i) {
|
|
369
|
+
const n = i === "Field" ? e.binding.field : e.id, o = this.getExpressionRule(n, t), r = this.getEntitiesAndVariables(), d = {
|
|
370
|
+
message: ["validate", "required", "dataPicking"].includes(t) && o ? o.message : "",
|
|
371
|
+
...r
|
|
355
372
|
};
|
|
356
|
-
return
|
|
373
|
+
return o.messageType != null && (d.messageType = o.messageType), d;
|
|
357
374
|
}
|
|
358
|
-
buildRule(e, t,
|
|
359
|
-
const { expression:
|
|
360
|
-
id: `${e}_${
|
|
361
|
-
type:
|
|
362
|
-
value:
|
|
375
|
+
buildRule(e, t, i, n) {
|
|
376
|
+
const { expression: o, message: r, messageType: d } = t, s = {
|
|
377
|
+
id: `${e}_${i}`,
|
|
378
|
+
type: i,
|
|
379
|
+
value: o
|
|
363
380
|
};
|
|
364
|
-
return (
|
|
381
|
+
return (i === "validate" || i === "dataPicking" || i === "required") && (s.message = r), i === "dataPicking" && (s.messageType = d), i === "validate" && n && (s.elementId = n), s;
|
|
365
382
|
}
|
|
366
383
|
getExpressionData() {
|
|
367
384
|
const { expressions: e } = this.formSchemaService.getFormSchema().module;
|
|
368
385
|
return e || [];
|
|
369
386
|
}
|
|
370
|
-
updateExpression(e, t,
|
|
371
|
-
const
|
|
372
|
-
let
|
|
373
|
-
const
|
|
374
|
-
if (
|
|
375
|
-
const c =
|
|
387
|
+
updateExpression(e, t, i, n) {
|
|
388
|
+
const o = t === "Field" ? e.binding.field : e.id, r = this.buildRule(o, i, n, e.type === "form-group" ? e.id : "");
|
|
389
|
+
let s = this.getExpressionData().find((c) => c.targetType === t && c.target === o);
|
|
390
|
+
const l = (c) => c.value.trim() === "";
|
|
391
|
+
if (s) {
|
|
392
|
+
const c = s.rules.find((u) => u.id === r.id);
|
|
376
393
|
if (c)
|
|
377
|
-
|
|
394
|
+
l(r) ? s.rules = s.rules.filter((u) => u.id !== r.id) : (Object.assign(c, r), n === "validate" && e.type === "form-group" && (c.elementId = e.id));
|
|
378
395
|
else {
|
|
379
|
-
if (
|
|
396
|
+
if (l(r))
|
|
380
397
|
return null;
|
|
381
|
-
|
|
398
|
+
s.rules = s.rules || [], s.rules.push(r);
|
|
382
399
|
}
|
|
383
400
|
} else {
|
|
384
|
-
if (
|
|
401
|
+
if (l(r))
|
|
385
402
|
return null;
|
|
386
|
-
|
|
387
|
-
target: `${
|
|
388
|
-
rules: [
|
|
403
|
+
s = {
|
|
404
|
+
target: `${o}`,
|
|
405
|
+
rules: [r],
|
|
389
406
|
targetType: t
|
|
390
407
|
};
|
|
391
408
|
}
|
|
392
|
-
return
|
|
393
|
-
}
|
|
394
|
-
getExpressionEditorOptions(e, t,
|
|
395
|
-
return
|
|
396
|
-
var
|
|
397
|
-
const
|
|
398
|
-
return r
|
|
399
|
-
hide: t === "Field" ? !!((
|
|
409
|
+
return s;
|
|
410
|
+
}
|
|
411
|
+
getExpressionEditorOptions(e, t, i, n) {
|
|
412
|
+
return i.reduce((o, r) => {
|
|
413
|
+
var s, l;
|
|
414
|
+
const d = t === "Field" ? (s = e == null ? void 0 : e.binding) == null ? void 0 : s.field : e.id;
|
|
415
|
+
return o[r] = {
|
|
416
|
+
hide: t === "Field" ? !!((l = e == null ? void 0 : e.binding) != null && l.field) : !1,
|
|
400
417
|
description: "",
|
|
401
|
-
title: this.expressionNames[
|
|
418
|
+
title: this.expressionNames[r],
|
|
402
419
|
type: "string",
|
|
403
|
-
$converter: this.getExpressionConverter(
|
|
420
|
+
$converter: this.getExpressionConverter(d),
|
|
404
421
|
refreshPanelAfterChanged: !0,
|
|
405
422
|
editor: {
|
|
406
423
|
type: "expression-editor",
|
|
407
424
|
singleExpand: !1,
|
|
408
|
-
dialogTitle: `${this.expressionNames[
|
|
409
|
-
showMessage:
|
|
410
|
-
showMessageType:
|
|
411
|
-
beforeOpen: () => this.onBeforeOpenExpression(e,
|
|
425
|
+
dialogTitle: `${this.expressionNames[r]}编辑器`,
|
|
426
|
+
showMessage: r === "validate" || r === "dataPicking" || r === "required",
|
|
427
|
+
showMessageType: r === "dataPicking",
|
|
428
|
+
beforeOpen: () => this.onBeforeOpenExpression(e, r, t),
|
|
412
429
|
onSubmitModal: (c) => {
|
|
413
|
-
const u = this.updateExpression(e, t, c,
|
|
414
|
-
if (
|
|
415
|
-
const f = this.buildRule(
|
|
416
|
-
|
|
430
|
+
const u = this.updateExpression(e, t, c, r);
|
|
431
|
+
if (n) {
|
|
432
|
+
const f = this.buildRule(d, c, r);
|
|
433
|
+
n(f);
|
|
417
434
|
}
|
|
418
435
|
return u;
|
|
419
436
|
}
|
|
420
437
|
}
|
|
421
|
-
},
|
|
438
|
+
}, o;
|
|
422
439
|
}, {});
|
|
423
440
|
}
|
|
424
|
-
getExpressionInfo(e, t,
|
|
425
|
-
const
|
|
426
|
-
value:
|
|
427
|
-
targetId:
|
|
441
|
+
getExpressionInfo(e, t, i) {
|
|
442
|
+
const n = t === "Field" ? e.binding.field : e.id, o = this.getExpressionRule(n, i), r = {
|
|
443
|
+
value: o && o.value,
|
|
444
|
+
targetId: n,
|
|
428
445
|
targetType: t,
|
|
429
|
-
expressionType:
|
|
446
|
+
expressionType: i
|
|
430
447
|
};
|
|
431
|
-
return
|
|
448
|
+
return o && o.message && (r.message = o.message), r;
|
|
432
449
|
}
|
|
433
|
-
getExpressionConfig(e, t,
|
|
450
|
+
getExpressionConfig(e, t, i = ["compute", "dependency", "validate"], n) {
|
|
434
451
|
return {
|
|
435
452
|
description: "表达式",
|
|
436
453
|
title: "表达式",
|
|
437
454
|
hide: !e.binding,
|
|
438
455
|
properties: {
|
|
439
|
-
...this.getExpressionEditorOptions(e, t,
|
|
456
|
+
...this.getExpressionEditorOptions(e, t, i, n)
|
|
440
457
|
}
|
|
441
458
|
};
|
|
442
459
|
}
|
|
443
|
-
getExpressionOptions(e, t,
|
|
444
|
-
const
|
|
460
|
+
getExpressionOptions(e, t, i) {
|
|
461
|
+
const n = this.getExpressionInfo(e, t, i);
|
|
445
462
|
return {
|
|
446
|
-
dialogTitle: `${this.expressionNames[
|
|
463
|
+
dialogTitle: `${this.expressionNames[i]}编辑器`,
|
|
447
464
|
singleExpand: !1,
|
|
448
|
-
showMessage:
|
|
449
|
-
beforeOpen: () => this.onBeforeOpenExpression(e,
|
|
450
|
-
expressionInfo:
|
|
465
|
+
showMessage: i === "required",
|
|
466
|
+
beforeOpen: () => this.onBeforeOpenExpression(e, i, t),
|
|
467
|
+
expressionInfo: n
|
|
451
468
|
};
|
|
452
469
|
}
|
|
453
470
|
}
|
|
454
|
-
class
|
|
471
|
+
class se {
|
|
455
472
|
constructor(e, t) {
|
|
456
473
|
v(this, "componentId");
|
|
457
474
|
v(this, "viewModelId");
|
|
@@ -469,8 +486,8 @@ class Z {
|
|
|
469
486
|
type: "object",
|
|
470
487
|
categories: {}
|
|
471
488
|
});
|
|
472
|
-
var
|
|
473
|
-
this.componentId = e, this.designerHostService = t, this.eventsEditorUtils = t.eventsEditorUtils, this.formSchemaUtils = t.formSchemaUtils, this.formMetadataConverter = t.formMetadataConverter, this.viewModelId = ((
|
|
489
|
+
var i;
|
|
490
|
+
this.componentId = e, this.designerHostService = t, this.eventsEditorUtils = t.eventsEditorUtils, this.formSchemaUtils = t.formSchemaUtils, this.formMetadataConverter = t.formMetadataConverter, this.viewModelId = ((i = this.formSchemaUtils) == null ? void 0 : i.getViewModelIdByComponentId(e)) || "", this.designViewModelUtils = t.designViewModelUtils, this.controlCreatorUtils = t.controlCreatorUtils, this.metadataService = t.metadataService, this.schemaService = t.schemaService, this.designerContext = t.designerContext;
|
|
474
491
|
}
|
|
475
492
|
getFormDesignerInstance() {
|
|
476
493
|
var e, t;
|
|
@@ -481,14 +498,14 @@ class Z {
|
|
|
481
498
|
return (e = this.schemaService) == null ? void 0 : e.getTableInfoByViewModelId(this.viewModelId);
|
|
482
499
|
}
|
|
483
500
|
setDesignViewModelField(e) {
|
|
484
|
-
var
|
|
501
|
+
var i;
|
|
485
502
|
const t = e.binding && e.binding.type === "Form" && e.binding.field;
|
|
486
503
|
if (t) {
|
|
487
504
|
if (!this.designViewModelField) {
|
|
488
|
-
const
|
|
489
|
-
this.designViewModelField =
|
|
505
|
+
const n = this.designViewModelUtils.getDgViewModel(this.viewModelId);
|
|
506
|
+
this.designViewModelField = n.fields.find((o) => o.id === t);
|
|
490
507
|
}
|
|
491
|
-
e.updateOn = (
|
|
508
|
+
e.updateOn = (i = this.designViewModelField) == null ? void 0 : i.updateOn;
|
|
492
509
|
}
|
|
493
510
|
}
|
|
494
511
|
getBasicPropConfig(e) {
|
|
@@ -512,17 +529,17 @@ class Z {
|
|
|
512
529
|
valueField: "value",
|
|
513
530
|
idField: "value",
|
|
514
531
|
editable: !1,
|
|
515
|
-
data: [{ value: e.type, name:
|
|
532
|
+
data: [{ value: e.type, name: E[e.type] && E[e.type].name }]
|
|
516
533
|
}
|
|
517
534
|
}
|
|
518
535
|
}
|
|
519
536
|
};
|
|
520
537
|
}
|
|
521
|
-
getAppearanceConfig(e = null, t = {},
|
|
522
|
-
const
|
|
538
|
+
getAppearanceConfig(e = null, t = {}, i) {
|
|
539
|
+
const n = {
|
|
523
540
|
title: "外观",
|
|
524
541
|
description: "Appearance"
|
|
525
|
-
},
|
|
542
|
+
}, o = {
|
|
526
543
|
class: {
|
|
527
544
|
title: "class样式",
|
|
528
545
|
type: "string",
|
|
@@ -538,21 +555,21 @@ class Z {
|
|
|
538
555
|
parentPropertyID: "appearance"
|
|
539
556
|
}
|
|
540
557
|
};
|
|
541
|
-
for (const
|
|
542
|
-
r
|
|
558
|
+
for (const r in t)
|
|
559
|
+
o[r] = Object.assign(o[r] || {}, t[r]);
|
|
543
560
|
return {
|
|
544
|
-
...
|
|
545
|
-
properties: { ...
|
|
546
|
-
setPropertyRelates(
|
|
547
|
-
if (
|
|
548
|
-
switch (
|
|
561
|
+
...n,
|
|
562
|
+
properties: { ...o },
|
|
563
|
+
setPropertyRelates(r, d) {
|
|
564
|
+
if (r) {
|
|
565
|
+
switch (r && r.propertyID) {
|
|
549
566
|
case "class":
|
|
550
567
|
case "style": {
|
|
551
|
-
|
|
568
|
+
z.value++;
|
|
552
569
|
break;
|
|
553
570
|
}
|
|
554
571
|
}
|
|
555
|
-
|
|
572
|
+
i && i(r, e, d);
|
|
556
573
|
}
|
|
557
574
|
}
|
|
558
575
|
};
|
|
@@ -567,49 +584,49 @@ class Z {
|
|
|
567
584
|
* @param expressionType 指定表达式类型,存在属性和表达式类型不一致的情况
|
|
568
585
|
* @returns
|
|
569
586
|
*/
|
|
570
|
-
getPropertyEditorParams(e, t = [],
|
|
571
|
-
const { getVariables:
|
|
587
|
+
getPropertyEditorParams(e, t = [], i = "visible", n = {}, o = {}, r = "") {
|
|
588
|
+
const { getVariables: d, getControlName: s, getStateMachines: l } = te(this.designerHostService), c = this.getRealTargetType(e), u = t && t.length > 0 ? t : ["Const", "Variable", "StateMachine", "Expression"], f = {
|
|
572
589
|
type: "property-editor",
|
|
573
590
|
propertyTypes: u
|
|
574
591
|
};
|
|
575
|
-
return u.map((
|
|
576
|
-
switch (
|
|
592
|
+
return u.map((b) => {
|
|
593
|
+
switch (b) {
|
|
577
594
|
case "Const":
|
|
578
595
|
Object.assign(f, {
|
|
579
596
|
constType: "enum",
|
|
580
597
|
constEnums: [{ id: !0, name: "是" }, { id: !1, name: "否" }]
|
|
581
|
-
},
|
|
598
|
+
}, n);
|
|
582
599
|
break;
|
|
583
600
|
case "Expression":
|
|
584
|
-
f.expressionConfig = this.getExpressionOptions(e, c,
|
|
601
|
+
f.expressionConfig = this.getExpressionOptions(e, c, r || i);
|
|
585
602
|
break;
|
|
586
603
|
case "StateMachine":
|
|
587
|
-
f.stateMachines =
|
|
604
|
+
f.stateMachines = l();
|
|
588
605
|
break;
|
|
589
606
|
case "Variable":
|
|
590
607
|
Object.assign(f, {
|
|
591
|
-
controlName:
|
|
608
|
+
controlName: s(e),
|
|
592
609
|
newVariablePrefix: "is",
|
|
593
610
|
newVariableType: "Boolean",
|
|
594
|
-
variables:
|
|
611
|
+
variables: d(this.viewModelId),
|
|
595
612
|
parentComponentId: this.componentId === "root-component" ? "" : "root-component",
|
|
596
|
-
onBeforeOpenVariables: (
|
|
597
|
-
|
|
613
|
+
onBeforeOpenVariables: (m) => {
|
|
614
|
+
m.value = d(this.viewModelId);
|
|
598
615
|
}
|
|
599
|
-
},
|
|
616
|
+
}, o), this.designerContext.designerMode === "PC_RTC" && (f.newVariablePrefix = "ext_" + f.newVariablePrefix);
|
|
600
617
|
break;
|
|
601
618
|
}
|
|
602
619
|
}), f;
|
|
603
620
|
}
|
|
604
621
|
getVisibleProperty(e, t = "") {
|
|
605
|
-
var
|
|
606
|
-
let
|
|
607
|
-
return t === "gridFieldEditor" ?
|
|
622
|
+
var o;
|
|
623
|
+
let i = ["Const", "Variable", "StateMachine", "Expression"];
|
|
624
|
+
return t === "gridFieldEditor" ? i = ["Const", "Expression"] : t === "form-group" && !((o = e.binding) != null && o.field) ? i = ["Const", "Variable", "StateMachine"] : (t === "dataGrid" || t === "treeGrid" || t === "wizard") && (i = ["Const", "Variable", "Expression"]), {
|
|
608
625
|
visible: {
|
|
609
626
|
title: "是否可见",
|
|
610
627
|
type: "boolean",
|
|
611
628
|
description: "运行时组件是否可见",
|
|
612
|
-
editor: this.getPropertyEditorParams(e,
|
|
629
|
+
editor: this.getPropertyEditorParams(e, i, "visible")
|
|
613
630
|
}
|
|
614
631
|
};
|
|
615
632
|
}
|
|
@@ -619,27 +636,27 @@ class Z {
|
|
|
619
636
|
* @param viewModelId
|
|
620
637
|
* @returns
|
|
621
638
|
*/
|
|
622
|
-
getBehaviorConfig(e, t = "",
|
|
623
|
-
const
|
|
639
|
+
getBehaviorConfig(e, t = "", i = {}, n) {
|
|
640
|
+
const o = {
|
|
624
641
|
title: "行为",
|
|
625
642
|
description: ""
|
|
626
|
-
},
|
|
627
|
-
for (const
|
|
628
|
-
|
|
629
|
-
const
|
|
643
|
+
}, r = this.getVisibleProperty(e, t);
|
|
644
|
+
for (const s in i)
|
|
645
|
+
r[s] = Object.assign(r[s] || {}, i[s]);
|
|
646
|
+
const d = this;
|
|
630
647
|
return {
|
|
631
|
-
...
|
|
632
|
-
properties: { ...
|
|
633
|
-
setPropertyRelates(
|
|
634
|
-
if (
|
|
635
|
-
switch (
|
|
648
|
+
...o,
|
|
649
|
+
properties: { ...r },
|
|
650
|
+
setPropertyRelates(s, l) {
|
|
651
|
+
if (s) {
|
|
652
|
+
switch (s.propertyID) {
|
|
636
653
|
case "disabled":
|
|
637
654
|
case "readonly":
|
|
638
655
|
case "visible":
|
|
639
|
-
|
|
656
|
+
d.afterMutilEditorChanged(e, s);
|
|
640
657
|
break;
|
|
641
658
|
}
|
|
642
|
-
|
|
659
|
+
n && n(s, l);
|
|
643
660
|
}
|
|
644
661
|
}
|
|
645
662
|
};
|
|
@@ -659,11 +676,11 @@ class Z {
|
|
|
659
676
|
* @returns
|
|
660
677
|
*/
|
|
661
678
|
updateElementByParentContainer(e, t) {
|
|
662
|
-
const
|
|
663
|
-
if (!
|
|
679
|
+
const i = t && t.parent && t.parent.schema;
|
|
680
|
+
if (!i)
|
|
664
681
|
return;
|
|
665
|
-
const
|
|
666
|
-
|
|
682
|
+
const n = i.contents.findIndex((r) => r.id === e), o = L(i.contents[n]);
|
|
683
|
+
i.contents.splice(n, 1), i.contents.splice(n, 0, o), O();
|
|
667
684
|
}
|
|
668
685
|
/**
|
|
669
686
|
* 属性编辑器,在编辑过程中会新增变量,此处需要将新增的变量追加到ViewModel中
|
|
@@ -672,18 +689,18 @@ class Z {
|
|
|
672
689
|
* @returns
|
|
673
690
|
*/
|
|
674
691
|
addNewVariableToViewModel(e, t) {
|
|
675
|
-
const
|
|
676
|
-
if (!(
|
|
692
|
+
const i = e.propertyValue;
|
|
693
|
+
if (!(i && typeof i == "object") || !(i.type === "Variable" && i.isNewVariable))
|
|
677
694
|
return;
|
|
678
|
-
const
|
|
679
|
-
id:
|
|
695
|
+
const r = {
|
|
696
|
+
id: i.field,
|
|
680
697
|
category: "locale",
|
|
681
|
-
code:
|
|
682
|
-
name:
|
|
683
|
-
type:
|
|
698
|
+
code: i.fullPath,
|
|
699
|
+
name: i.fullPath,
|
|
700
|
+
type: i.newVariableType || "String",
|
|
684
701
|
isRtcVariable: this.designerContext.designerMode === "PC_RTC" ? !0 : void 0
|
|
685
702
|
};
|
|
686
|
-
delete
|
|
703
|
+
delete i.newVariableType, delete i.isNewVariable, this.formSchemaUtils.getVariableByCode(r.code) || this.formSchemaUtils.getViewModelById("root-viewmodel").states.push(r);
|
|
687
704
|
}
|
|
688
705
|
/**
|
|
689
706
|
* 更新表达式到expressions节点
|
|
@@ -693,17 +710,17 @@ class Z {
|
|
|
693
710
|
const t = e.propertyValue;
|
|
694
711
|
if (!((t && t.type) === "Expression" && t.expressionInfo))
|
|
695
712
|
return;
|
|
696
|
-
const { expressionId:
|
|
713
|
+
const { expressionId: o, expressionInfo: r } = t, { targetId: d, targetType: s, expressionType: l, value: c, message: u } = r, f = this.formSchemaUtils.getModule();
|
|
697
714
|
f.expressions = f.expressions || [];
|
|
698
|
-
const { expressions:
|
|
699
|
-
let
|
|
700
|
-
|
|
701
|
-
const
|
|
702
|
-
if (
|
|
703
|
-
|
|
715
|
+
const { expressions: b } = f;
|
|
716
|
+
let m = b.find((h) => h.target === d);
|
|
717
|
+
m || (m = { target: d, rules: [], targetType: s }, b.push(m));
|
|
718
|
+
const g = m.rules.find((h) => h.type === l);
|
|
719
|
+
if (g)
|
|
720
|
+
g.value = c, g.message = u;
|
|
704
721
|
else {
|
|
705
|
-
const
|
|
706
|
-
|
|
722
|
+
const h = { id: o, type: l, value: c, message: u };
|
|
723
|
+
m.rules.push(h);
|
|
707
724
|
}
|
|
708
725
|
delete t.expressionInfo;
|
|
709
726
|
}
|
|
@@ -714,14 +731,14 @@ class Z {
|
|
|
714
731
|
* @returns
|
|
715
732
|
*/
|
|
716
733
|
clearExpression(e, t) {
|
|
717
|
-
const
|
|
718
|
-
if (
|
|
734
|
+
const i = e.propertyValue;
|
|
735
|
+
if (i && i.type === "Expression")
|
|
719
736
|
return;
|
|
720
|
-
const
|
|
721
|
-
!
|
|
737
|
+
const o = e.propertyID, r = this.formSchemaUtils.getExpressions(), d = t.binding ? t.binding.field : t.id, s = r.find((l) => l.target === d);
|
|
738
|
+
!s || !s.rules || (s.rules = s.rules.filter((l) => l.type !== o));
|
|
722
739
|
}
|
|
723
|
-
getExpressionOptions(e, t,
|
|
724
|
-
return new
|
|
740
|
+
getExpressionOptions(e, t, i) {
|
|
741
|
+
return new ie(this.formSchemaUtils).getExpressionOptions(e, t, i);
|
|
725
742
|
}
|
|
726
743
|
getRealTargetType(e) {
|
|
727
744
|
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";
|
|
@@ -732,17 +749,17 @@ class Z {
|
|
|
732
749
|
type: "events-editor",
|
|
733
750
|
editor: {
|
|
734
751
|
initialData: e,
|
|
735
|
-
viewSourceHandle: (
|
|
736
|
-
var
|
|
737
|
-
((
|
|
752
|
+
viewSourceHandle: (i) => {
|
|
753
|
+
var n;
|
|
754
|
+
((n = i.controller) == null ? void 0 : n.label.indexOf(this.formSchemaUtils.getModule().code)) > -1 && this.eventsEditorUtils.jumpToMethod(i);
|
|
738
755
|
}
|
|
739
756
|
}
|
|
740
757
|
}, t;
|
|
741
758
|
}
|
|
742
759
|
}
|
|
743
|
-
class
|
|
760
|
+
class ne extends se {
|
|
744
761
|
getPropertyConfig(e) {
|
|
745
|
-
return this.propertyConfig.categories.basic = this.getBasicPropConfig(e), this.propertyConfig.categories.appearance = this.getAppearanceConfig(e), this.propertyConfig;
|
|
762
|
+
return this.propertyConfig.categories.basic = this.getBasicPropConfig(e), this.propertyConfig.categories.appearance = this.getAppearanceConfig(e), this.propertyConfig.categories.behavior = this.getBehaviorConfig(e, ""), this.propertyConfig;
|
|
746
763
|
}
|
|
747
764
|
getAppearanceConfig(e) {
|
|
748
765
|
return super.getAppearanceConfig(e, {
|
|
@@ -770,92 +787,161 @@ class ee extends Z {
|
|
|
770
787
|
$converter: "/converter/size.converter",
|
|
771
788
|
parentPropertyID: "size",
|
|
772
789
|
visible: !1
|
|
790
|
+
},
|
|
791
|
+
title: {
|
|
792
|
+
title: "标题",
|
|
793
|
+
type: "string",
|
|
794
|
+
description: "导航标题"
|
|
795
|
+
},
|
|
796
|
+
folded: {
|
|
797
|
+
title: "默认收起",
|
|
798
|
+
type: "boolean",
|
|
799
|
+
description: "初始状态是否将面板默认收起"
|
|
800
|
+
},
|
|
801
|
+
collapsible: {
|
|
802
|
+
title: "是否启用收折",
|
|
803
|
+
type: "boolean",
|
|
804
|
+
description: "是否启用收折特性",
|
|
805
|
+
editor: {
|
|
806
|
+
type: "combo-list",
|
|
807
|
+
textField: "name",
|
|
808
|
+
valueField: "value",
|
|
809
|
+
data: [{
|
|
810
|
+
name: "启用",
|
|
811
|
+
value: !0
|
|
812
|
+
}, {
|
|
813
|
+
name: "不启用",
|
|
814
|
+
value: !1
|
|
815
|
+
}],
|
|
816
|
+
enableClear: !1
|
|
817
|
+
},
|
|
818
|
+
refreshPanelAfterChanged: !0
|
|
819
|
+
},
|
|
820
|
+
position: {
|
|
821
|
+
title: "收折按钮显示位置",
|
|
822
|
+
// 因为控件里这个属性是针对导航面板的,但是属性面板里是针对收折按钮的,位置含义相反,所以在设计器上枚举项也反着写
|
|
823
|
+
type: "enum",
|
|
824
|
+
description: "收折按钮显示位置",
|
|
825
|
+
editor: {
|
|
826
|
+
type: "combo-list",
|
|
827
|
+
textField: "name",
|
|
828
|
+
valueField: "value",
|
|
829
|
+
idField: "value",
|
|
830
|
+
editable: !1,
|
|
831
|
+
data: [{ value: "left", name: "靠右" }, { value: "right", name: "靠左" }, { value: "bottom", name: "靠上" }, { value: "top", name: "靠下" }]
|
|
832
|
+
},
|
|
833
|
+
// visible: propertyData.collapsible,
|
|
834
|
+
visible: !1
|
|
773
835
|
}
|
|
774
|
-
}, (
|
|
775
|
-
switch (
|
|
836
|
+
}, (i, n, o) => {
|
|
837
|
+
switch (i.propertyID) {
|
|
776
838
|
case "width":
|
|
777
|
-
case "height":
|
|
778
|
-
|
|
839
|
+
case "height": {
|
|
840
|
+
ee.value++;
|
|
841
|
+
break;
|
|
842
|
+
}
|
|
843
|
+
case "title": {
|
|
844
|
+
i.needRefreshControlTree = !0;
|
|
779
845
|
break;
|
|
846
|
+
}
|
|
780
847
|
}
|
|
781
848
|
});
|
|
782
849
|
}
|
|
783
850
|
}
|
|
784
|
-
function
|
|
785
|
-
const t = new
|
|
786
|
-
function
|
|
787
|
-
var f,
|
|
788
|
-
return !(!$().basalDragulaRuleForContainer(c, e) || !
|
|
851
|
+
function oe(a, e) {
|
|
852
|
+
const t = new A(), { canAccept: i } = t.getTemplateRule(a, e);
|
|
853
|
+
function n(c) {
|
|
854
|
+
var f, b, m;
|
|
855
|
+
return !(!$().basalDragulaRuleForContainer(c, e) || !i || ((f = a.schema.contents) == null ? void 0 : f.length) === 1 && ((m = (b = a.schema) == null ? void 0 : b.contents[0]) == null ? void 0 : m.type) === E["external-container"].type);
|
|
789
856
|
}
|
|
790
|
-
function
|
|
857
|
+
function o() {
|
|
791
858
|
return "display: flex;flex-direction:column;height:100%";
|
|
792
859
|
}
|
|
793
|
-
function
|
|
794
|
-
|
|
860
|
+
function r() {
|
|
861
|
+
const { canMove: c } = t.getTemplateRule(a, e);
|
|
862
|
+
return c;
|
|
795
863
|
}
|
|
796
|
-
function
|
|
797
|
-
|
|
864
|
+
function d() {
|
|
865
|
+
const { canDelete: c } = t.getTemplateRule(a, e);
|
|
866
|
+
return c;
|
|
798
867
|
}
|
|
799
|
-
function
|
|
800
|
-
|
|
868
|
+
function s() {
|
|
869
|
+
const { canMove: c, canDelete: u } = t.getTemplateRule(a, e);
|
|
870
|
+
return !c && !u;
|
|
801
871
|
}
|
|
802
|
-
function
|
|
803
|
-
const u = new
|
|
872
|
+
function l(c) {
|
|
873
|
+
const u = new ne(c, e), { schema: f } = a;
|
|
804
874
|
return u.getPropertyConfig(f);
|
|
805
875
|
}
|
|
806
876
|
return {
|
|
807
|
-
canAccepts:
|
|
808
|
-
getStyles:
|
|
809
|
-
checkCanMoveComponent:
|
|
810
|
-
checkCanDeleteComponent:
|
|
811
|
-
hideNestedPaddingInDesginerView:
|
|
812
|
-
getPropsConfig:
|
|
877
|
+
canAccepts: n,
|
|
878
|
+
getStyles: o,
|
|
879
|
+
checkCanMoveComponent: r,
|
|
880
|
+
checkCanDeleteComponent: d,
|
|
881
|
+
hideNestedPaddingInDesginerView: s,
|
|
882
|
+
getPropsConfig: l
|
|
813
883
|
};
|
|
814
884
|
}
|
|
815
|
-
const
|
|
885
|
+
const re = /* @__PURE__ */ S({
|
|
816
886
|
name: "FListNavDesign",
|
|
817
|
-
props:
|
|
887
|
+
props: V,
|
|
818
888
|
emits: [],
|
|
819
|
-
setup(
|
|
820
|
-
const t =
|
|
821
|
-
|
|
822
|
-
|
|
889
|
+
setup(a, e) {
|
|
890
|
+
const t = y(), i = y(), n = M("designer-host-service"), o = M("design-item-context"), r = oe(o, n), d = q(t, o, r), s = y(a.position), l = y(!1), c = y(!1);
|
|
891
|
+
w(() => a.position, (g, h) => {
|
|
892
|
+
g !== h && (s.value = g);
|
|
823
893
|
});
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
894
|
+
function u() {
|
|
895
|
+
if (!i.value)
|
|
896
|
+
return;
|
|
897
|
+
const g = i.value.parentElement;
|
|
898
|
+
if (g && g.className && g.className.includes("farris-component-list-nav")) {
|
|
899
|
+
const h = ["top", "bottom"].indexOf(s.value) > -1 ? "height" : "width", P = l.value ? "0px" : a.size + "px";
|
|
900
|
+
g.style[h] = P;
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
F(() => {
|
|
904
|
+
t.value.componentInstance = d, u();
|
|
905
|
+
}), e.expose(d.value);
|
|
827
906
|
function f(g) {
|
|
828
|
-
g && g.stopPropagation(), !
|
|
907
|
+
g && g.stopPropagation(), !a.disabled && (c.value = !0, l.value = !l.value, u(), R(() => {
|
|
908
|
+
D();
|
|
909
|
+
}));
|
|
829
910
|
}
|
|
830
|
-
const
|
|
911
|
+
const b = C(() => ({
|
|
831
912
|
"f-list-nav-main": !0,
|
|
832
|
-
"d-none":
|
|
913
|
+
"d-none": l.value
|
|
914
|
+
})), m = C(() => ({
|
|
915
|
+
[["top", "bottom"].indexOf(s.value) > -1 ? "min-width" : "min-height"]: "200px"
|
|
833
916
|
}));
|
|
834
|
-
return () =>
|
|
835
|
-
|
|
917
|
+
return w(() => a.size, (g, h) => {
|
|
918
|
+
g !== h && u();
|
|
919
|
+
}), () => p("div", {
|
|
920
|
+
class: `f-list-nav f-list-nav-${s.value}`,
|
|
921
|
+
ref: i
|
|
836
922
|
}, [p("div", {
|
|
837
|
-
class: "f-list-nav-in"
|
|
838
|
-
style: u.value
|
|
923
|
+
class: "f-list-nav-in"
|
|
839
924
|
}, [p("div", {
|
|
840
|
-
class:
|
|
925
|
+
class: b.value,
|
|
926
|
+
style: m.value
|
|
841
927
|
}, [e.slots.navHeader && p("div", {
|
|
842
928
|
class: "f-list-nav-header"
|
|
843
|
-
}, [e.slots.navHeader()]), !e.slots.navHeader &&
|
|
929
|
+
}, [e.slots.navHeader()]), !e.slots.navHeader && a.title && p("div", {
|
|
844
930
|
class: "f-list-nav-header"
|
|
845
931
|
}, [p("div", {
|
|
846
932
|
class: "f-list-nav-title"
|
|
847
|
-
}, [
|
|
933
|
+
}, [a.title])]), e.slots.default && p("div", {
|
|
848
934
|
class: "f-list-nav-content drag-container",
|
|
849
935
|
ref: t,
|
|
850
|
-
"data-dragref": `${
|
|
936
|
+
"data-dragref": `${o.schema.id}-container`
|
|
851
937
|
}, [e.slots.default()]), e.slots.navContent && p("div", {
|
|
852
938
|
class: "f-list-nav-content"
|
|
853
939
|
}, [e.slots.navContent()]), e.slots.navFooter && p("div", {
|
|
854
940
|
class: "f-list-nav-footer"
|
|
855
|
-
}, [e.slots.navFooter()])]),
|
|
941
|
+
}, [e.slots.navFooter()])]), a.collapsible && p("div", {
|
|
856
942
|
class: ["f-list-nav-toggle-sidebar", {
|
|
857
|
-
disabled:
|
|
858
|
-
active:
|
|
943
|
+
disabled: a.disabled,
|
|
944
|
+
active: l.value,
|
|
859
945
|
"splitter-pane-collapse-animate": c.value
|
|
860
946
|
}],
|
|
861
947
|
onClick: (g) => f(g)
|
|
@@ -863,20 +949,20 @@ const se = /* @__PURE__ */ M({
|
|
|
863
949
|
class: "triangle"
|
|
864
950
|
}, null)])])]);
|
|
865
951
|
}
|
|
866
|
-
}),
|
|
867
|
-
install(
|
|
868
|
-
|
|
952
|
+
}), fe = {
|
|
953
|
+
install(a) {
|
|
954
|
+
a.component(x.name, x);
|
|
869
955
|
},
|
|
870
|
-
register(
|
|
871
|
-
|
|
956
|
+
register(a, e, t, i) {
|
|
957
|
+
a["list-nav"] = x, e["list-nav"] = I;
|
|
872
958
|
},
|
|
873
|
-
registerDesigner(
|
|
874
|
-
|
|
959
|
+
registerDesigner(a, e, t) {
|
|
960
|
+
a["list-nav"] = re, e["list-nav"] = I;
|
|
875
961
|
}
|
|
876
962
|
};
|
|
877
963
|
export {
|
|
878
964
|
x as FListNav,
|
|
879
|
-
|
|
880
|
-
|
|
965
|
+
fe as default,
|
|
966
|
+
V as listNavProps,
|
|
881
967
|
I as propsResolver
|
|
882
968
|
};
|