@farris/ui-vue 1.7.2-beta.1 → 1.7.2-beta.2
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 +155 -148
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +1 -1
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +226 -224
- package/components/calendar/index.umd.cjs +3 -3
- package/components/collection-property-editor/index.esm.js +225 -223
- package/components/collection-property-editor/index.umd.cjs +2 -2
- package/components/combo-list/index.esm.js +76 -71
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/comment/index.esm.js +169 -167
- package/components/comment/index.umd.cjs +6 -6
- package/components/component/index.esm.js +3691 -3043
- package/components/component/index.umd.cjs +2 -2
- package/components/condition/index.esm.js +2015 -1352
- package/components/condition/index.umd.cjs +2 -2
- package/components/data-grid/index.esm.js +407 -430
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +3082 -3196
- package/components/data-view/index.umd.cjs +1 -1
- package/components/designer-canvas/index.esm.js +3364 -2713
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/drawer/index.esm.js +66 -64
- package/components/drawer/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +1176 -524
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +182 -180
- package/components/dynamic-resolver/index.umd.cjs +2 -2
- package/components/dynamic-view/index.esm.js +531 -455
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +2352 -1700
- package/components/events-editor/index.umd.cjs +3 -3
- package/components/expression-editor/index.esm.js +8 -3
- package/components/expression-editor/index.umd.cjs +2 -2
- package/components/filter-bar/index.esm.js +422 -413
- package/components/filter-bar/index.umd.cjs +2 -2
- package/components/filter-condition-editor/index.esm.js +8 -3
- package/components/filter-condition-editor/index.umd.cjs +1 -1
- package/components/image/index.esm.js +363 -354
- package/components/image/index.umd.cjs +2 -2
- package/components/language-textbox/index.esm.js +189 -187
- package/components/language-textbox/index.umd.cjs +2 -2
- package/components/list-view/index.esm.js +388 -389
- package/components/list-view/index.umd.cjs +5 -5
- package/components/mapping-editor/index.esm.js +1465 -1488
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +180 -173
- package/components/number-range/index.umd.cjs +1 -1
- package/components/order/index.esm.js +815 -811
- package/components/order/index.umd.cjs +5 -5
- package/components/property-panel/index.esm.js +429 -420
- package/components/property-panel/index.umd.cjs +3 -3
- package/components/query-solution/index.esm.js +4746 -4085
- package/components/query-solution/index.umd.cjs +7 -7
- package/components/schema-selector/index.esm.js +1401 -1402
- package/components/schema-selector/index.umd.cjs +5 -5
- package/components/section/index.esm.js +102 -100
- package/components/section/index.umd.cjs +2 -2
- package/components/sort-condition-editor/index.esm.js +8 -3
- package/components/sort-condition-editor/index.umd.cjs +1 -1
- package/components/transfer/index.esm.js +537 -538
- package/components/transfer/index.umd.cjs +5 -5
- package/components/tree-grid/index.esm.js +280 -283
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +200 -202
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +533 -519
- package/components/uploader/index.umd.cjs +2 -2
- package/designer/data-grid/index.esm.js +3806 -3905
- package/designer/data-grid/index.umd.cjs +9 -9
- package/designer/drawer/index.esm.js +188 -186
- package/designer/drawer/index.umd.cjs +2 -2
- package/designer/dynamic-form/index.esm.js +1562 -1073
- package/designer/dynamic-form/index.umd.cjs +2 -2
- package/designer/farris-designer.all.esm.js +9793 -8613
- package/designer/farris-designer.all.umd.cjs +8 -8
- package/designer/list-view/index.esm.js +564 -564
- package/designer/list-view/index.umd.cjs +6 -6
- package/designer/radio-group/index.esm.js +236 -229
- package/designer/radio-group/index.umd.cjs +1 -1
- package/designer/response-layout-editor/index.esm.js +178 -171
- package/designer/response-layout-editor/index.umd.cjs +1 -1
- package/designer/tabs/index.esm.js +3154 -2508
- package/designer/tabs/index.umd.cjs +2 -2
- package/designer/time-picker/index.esm.js +193 -186
- package/designer/time-picker/index.umd.cjs +1 -1
- package/designer/tree-grid/index.esm.js +444 -447
- package/designer/tree-grid/index.umd.cjs +1 -1
- package/farris.all.esm.js +60126 -59649
- package/farris.all.umd.cjs +30 -30
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/components.d.ts +1 -1
- package/types/condition/src/composition/condition-value/dropdown-value.d.ts +4 -0
- package/types/data-grid/index.d.ts +2 -5
- package/types/data-grid/src/data-grid.component.d.ts +1 -2
- package/types/data-view/components/row/hierarchy-row.component.d.ts +2 -2
- package/types/data-view/composition/appearance/use-cell-position.d.ts +1 -1
- package/types/data-view/composition/types.d.ts +0 -4
- package/types/data-view/composition/visualization/use-virtual-scroll.d.ts +2 -2
- package/types/data-view/composition/visualization/use-visual-data-bound.d.ts +2 -3
- package/types/data-view/composition/visualization/use-visual-data-row.d.ts +1 -2
- package/types/designer-canvas/src/composition/dg-control.d.ts +24 -0
- package/types/dynamic-form/designer.d.ts +0 -1
- package/types/dynamic-form/index.d.ts +4 -3
- package/types/dynamic-form/src/designer/dynamic-form.design.component.d.ts +8 -0
- package/types/dynamic-form/src/designer/response-form.design.props.d.ts +14 -0
- package/types/dynamic-form/src/designer/use-dynamic-form-rules.d.ts +2 -0
- package/types/dynamic-form/src/dynamic-form.component.d.ts +8 -0
- package/types/dynamic-form/src/response-form.props.d.ts +13 -1
- package/types/dynamic-form/src/schema/response-form-schema-resolver.d.ts +1 -0
- package/types/dynamic-form/src/types.d.ts +1 -0
- package/types/dynamic-resolver/src/types.d.ts +1 -0
- package/types/dynamic-view/index.d.ts +43 -3
- package/types/dynamic-view/src/components/maps.d.ts +6 -6
- package/types/dynamic-view/src/composition/index.d.ts +5 -0
- package/types/dynamic-view/src/composition/use-utils.d.ts +12 -0
- package/types/dynamic-view/src/dynamic-view.component.d.ts +6 -6
- package/types/language-textbox/index.d.ts +3 -3
- package/types/language-textbox/src/components/language-contents.component.d.ts +1 -1
- package/types/language-textbox/src/language-textbox.component.d.ts +1 -1
- package/types/lookup/src/components/favorite/lookup-favorite.component.d.ts +1 -1
- package/types/lookup/src/components/popup-container.component.d.ts +3 -3
- package/types/property-panel/src/property-panel.component.d.ts +3 -3
- package/types/tree-grid/src/components/data/data-area.component.d.ts +2 -2
- package/types/tree-grid/src/tree-grid.props.d.ts +0 -1
- package/types/tree-view/src/components/data/tree-area.component.d.ts +1 -1
- package/types/tree-view/src/tree-view.props.d.ts +0 -1
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { dynamicFormGroupProps as
|
|
5
|
-
import { schemaMap as
|
|
6
|
-
import { defineComponent as
|
|
7
|
-
import { DgControl as
|
|
8
|
-
import { useGuid as
|
|
9
|
-
import { BaseControlProperty as
|
|
10
|
-
import { useResponseLayoutEditorSetting as
|
|
1
|
+
var Ae = Object.defineProperty;
|
|
2
|
+
var Re = (e, t, n) => t in e ? Ae(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var ie = (e, t, n) => Re(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { dynamicFormGroupProps as we, FDynamicFormLabel as Ue, dynamicFormInputProps as qe, FDynamicFormGroup as Se, FResponseForm as Ge, FDynamicFormInput as ze } from "../../components/dynamic-form/index.esm.js";
|
|
5
|
+
import { schemaMap as Ze, resolveAppearance as We, createPropsResolver as ae, propertyConfigSchemaMapForDesigner as Je, createFormGroupEditorResolver as _e } from "../../components/dynamic-resolver/index.esm.js";
|
|
6
|
+
import { defineComponent as ee, ref as R, inject as Y, onMounted as ne, computed as H, withDirectives as ke, createVNode as D, createTextVNode as Q, resolveDirective as Ie, watch as le, reactive as ge, mergeProps as Pe } from "vue";
|
|
7
|
+
import { DgControl as p, refreshCanvas as Xe, UseTemplateDragAndDropRules as Qe, useDragulaCommonRule as Ye, useDesignerComponent as ce } from "../../components/designer-canvas/index.esm.js";
|
|
8
|
+
import { useGuid as be, FormSchemaEntityField$Type as ve, FormSchemaEntityFieldTypeName as he, areaResponseDirective as He, getCustomClass as fe, useThirdComponent as Ve, useTextBoxDesign as Ke } from "../../components/common/index.esm.js";
|
|
9
|
+
import { BaseControlProperty as et, FormBindingType as K, InputBaseProperty as tt } from "../../components/property-panel/index.esm.js";
|
|
10
|
+
import { useResponseLayoutEditorSetting as nt } from "../response-layout-editor/index.esm.js";
|
|
11
|
+
import { createPropsResolver as xe } from "../../components/designer/index.esm.js";
|
|
12
|
+
import { cloneDeep as de, mergeWith as ot, merge as rt, isPlainObject as Ce } from "lodash-es";
|
|
13
|
+
import { loadRegister as it, useComponentManager as at, useBindingData as st, useEntityState as lt, useDynamicViewUtils as ct, componentMap as ue, resolverMap as ut } from "../../components/dynamic-view/index.esm.js";
|
|
14
|
+
import { LocaleService as dt } from "../../components/locale/index.esm.js";
|
|
11
15
|
import "../../components/accordion/index.esm.js";
|
|
12
16
|
import "../../components/avatar/index.esm.js";
|
|
13
17
|
import "../button-edit/index.esm.js";
|
|
@@ -17,7 +21,7 @@ import "../capsule/index.esm.js";
|
|
|
17
21
|
import "../checkbox/index.esm.js";
|
|
18
22
|
import "../checkbox-group/index.esm.js";
|
|
19
23
|
import "../../components/color-picker/index.esm.js";
|
|
20
|
-
import
|
|
24
|
+
import se from "../../components/combo-list/index.esm.js";
|
|
21
25
|
import "../../components/content-container/index.esm.js";
|
|
22
26
|
import "../data-grid/index.esm.js";
|
|
23
27
|
import "../date-picker/index.esm.js";
|
|
@@ -68,7 +72,6 @@ import "../drawer/index.esm.js";
|
|
|
68
72
|
import "../../components/html-template/index.esm.js";
|
|
69
73
|
import "../../components/image/index.esm.js";
|
|
70
74
|
import "../../components/comment/index.esm.js";
|
|
71
|
-
import { isPlainObject as fe, cloneDeep as ae } from "lodash-es";
|
|
72
75
|
import "../../components/combo-tree/index.esm.js";
|
|
73
76
|
import "../../components/events-editor/index.esm.js";
|
|
74
77
|
import "../../components/field-selector/index.esm.js";
|
|
@@ -85,439 +88,1109 @@ import "../../components/expression-editor/index.esm.js";
|
|
|
85
88
|
import "../../components/code-editor/index.esm.js";
|
|
86
89
|
import "../../components/collection-property-editor/index.esm.js";
|
|
87
90
|
import "../modal/index.esm.js";
|
|
88
|
-
import { FMessageBoxService as
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
errors: { type: Object, default: null },
|
|
109
|
-
fill: { type: Boolean, default: !1 }
|
|
110
|
-
};
|
|
111
|
-
function Ye(e, t) {
|
|
112
|
-
function n(h, a = null) {
|
|
113
|
-
if (a)
|
|
114
|
-
return a;
|
|
115
|
-
const f = e.getComponentById(t);
|
|
116
|
-
return e.selectNode(f, (i) => i.id === h);
|
|
117
|
-
}
|
|
118
|
-
function o(h) {
|
|
119
|
-
const a = e.getComponentById(h);
|
|
120
|
-
return !(!a || !a.componentType || !a.componentType.startsWith("form"));
|
|
121
|
-
}
|
|
122
|
-
function r(h) {
|
|
123
|
-
const a = new Set(h);
|
|
124
|
-
return Array.from(a).length === 1;
|
|
125
|
-
}
|
|
126
|
-
function m(h) {
|
|
127
|
-
const a = n(h.id), f = Xe(e), i = [];
|
|
128
|
-
f.getResonseFormLayoutConfig(a, i, 1);
|
|
129
|
-
const s = i.map(($) => $.columnInSM), g = i.map(($) => $.columnInMD), c = i.map(($) => $.columnInLG), p = i.map(($) => $.columnInEL), v = r(s) ? s[0] : 0, b = r(g) ? g[0] : 0, C = r(c) ? c[0] : 0, D = r(p) ? p[0] : 0;
|
|
91
|
+
import { FMessageBoxService as pt } from "../../components/message-box/index.esm.js";
|
|
92
|
+
function mt(e, t) {
|
|
93
|
+
function n(T, l = null) {
|
|
94
|
+
if (l)
|
|
95
|
+
return l;
|
|
96
|
+
const b = e.getComponentById(t);
|
|
97
|
+
return e.selectNode(b, (i) => i.id === T);
|
|
98
|
+
}
|
|
99
|
+
function o(T) {
|
|
100
|
+
const l = e.getComponentById(T);
|
|
101
|
+
return !(!l || !l.componentType || !l.componentType.startsWith("form"));
|
|
102
|
+
}
|
|
103
|
+
function a(T) {
|
|
104
|
+
const l = new Set(T);
|
|
105
|
+
return Array.from(l).length === 1;
|
|
106
|
+
}
|
|
107
|
+
function m(T) {
|
|
108
|
+
const l = n(T.id), b = nt(e), i = [];
|
|
109
|
+
b.getResonseFormLayoutConfig(l, i, 1);
|
|
110
|
+
const c = i.map((O) => O.columnInSM), F = i.map((O) => O.columnInMD), u = i.map((O) => O.columnInLG), f = i.map((O) => O.columnInEL), w = a(c) ? c[0] : 0, k = a(F) ? F[0] : 0, h = a(u) ? u[0] : 0, j = a(f) ? f[0] : 0;
|
|
130
111
|
return {
|
|
131
|
-
uniqueColClassInSM:
|
|
132
|
-
uniqueColClassInMD:
|
|
133
|
-
uniqueColClassInLG:
|
|
134
|
-
uniqueColClassInEL:
|
|
112
|
+
uniqueColClassInSM: w,
|
|
113
|
+
uniqueColClassInMD: k,
|
|
114
|
+
uniqueColClassInLG: h,
|
|
115
|
+
uniqueColClassInEL: j
|
|
135
116
|
};
|
|
136
117
|
}
|
|
137
|
-
function
|
|
138
|
-
let
|
|
139
|
-
if (
|
|
140
|
-
const
|
|
141
|
-
|
|
118
|
+
function g(T, l) {
|
|
119
|
+
let b, i, c, F, u = [];
|
|
120
|
+
if (T) {
|
|
121
|
+
const O = T.split(" "), N = O.filter((B) => B.startsWith("col-"));
|
|
122
|
+
b = N.find((B) => /^col-([1-9]|10|11|12)$/.test(B)), i = N.find((B) => /^col-md-([1-9]|10|11|12)$/.test(B)), c = N.find((B) => /^col-xl-([1-9]|10|11|12)$/.test(B)), F = N.find((B) => /^col-el-([1-9]|10|11|12)$/.test(B)), u = O.filter((B) => !B.startsWith("col-"));
|
|
142
123
|
}
|
|
143
|
-
const
|
|
144
|
-
return [
|
|
124
|
+
const f = l.uniqueColClassInSM ? "col-" + l.uniqueColClassInSM : b, w = l.uniqueColClassInMD ? "col-md-" + l.uniqueColClassInMD : i, k = l.uniqueColClassInLG ? "col-xl-" + l.uniqueColClassInLG : c, h = l.uniqueColClassInEL ? "col-el-" + l.uniqueColClassInEL : F;
|
|
125
|
+
return [f, w, k, h].concat(u).join(" ");
|
|
145
126
|
}
|
|
146
|
-
function
|
|
147
|
-
|
|
148
|
-
if (i.type ===
|
|
149
|
-
|
|
127
|
+
function V(T, l, b) {
|
|
128
|
+
T = n(b, T), T.contents.forEach((i) => {
|
|
129
|
+
if (i.type === p["dynamic-form"].type)
|
|
130
|
+
return;
|
|
131
|
+
if (i.type === p.fieldset.type) {
|
|
132
|
+
V(i, l, i.id);
|
|
150
133
|
return;
|
|
151
134
|
}
|
|
152
135
|
i.appearance || (i.appearance = {});
|
|
153
|
-
const
|
|
154
|
-
i.appearance.class =
|
|
136
|
+
const c = i.appearance.class;
|
|
137
|
+
i.appearance.class = g(c, l);
|
|
155
138
|
});
|
|
156
139
|
}
|
|
157
|
-
return { checkIsInFormComponent: o, assembleUnifiedLayoutContext: m, changeFormControlsByUnifiedLayoutConfig:
|
|
140
|
+
return { checkIsInFormComponent: o, assembleUnifiedLayoutContext: m, changeFormControlsByUnifiedLayoutConfig: V, changeControlClassInByColumn: g };
|
|
158
141
|
}
|
|
159
|
-
class
|
|
142
|
+
class Me extends et {
|
|
160
143
|
constructor(t, n) {
|
|
161
144
|
super(t, n);
|
|
162
145
|
}
|
|
163
146
|
getPropertyConfig(t, n) {
|
|
164
147
|
const o = this;
|
|
165
148
|
this.propertyConfig.categories.basic = this.getBasicPropConfig(t);
|
|
166
|
-
const { checkIsInFormComponent:
|
|
167
|
-
|
|
149
|
+
const { checkIsInFormComponent: a, assembleUnifiedLayoutContext: m, changeFormControlsByUnifiedLayoutConfig: g, changeControlClassInByColumn: V } = mt(this.formSchemaUtils, this.componentId), T = this.getAppearanceConfig(t), l = a(this.componentId);
|
|
150
|
+
T.properties.adaptForLanguage = {
|
|
168
151
|
title: "控件布局响应国际化",
|
|
169
152
|
description: "启用国际化后:简体中文、繁体中文环境下控件标签与输入框在一行展示,其他语言环境下控件标签与输入框上下排列。",
|
|
170
|
-
visible:
|
|
153
|
+
visible: t.formType === "dynamic" || l,
|
|
171
154
|
type: "boolean"
|
|
172
|
-
},
|
|
155
|
+
}, T.properties.labelAutoOverflow = {
|
|
173
156
|
title: "控件标签换行",
|
|
174
157
|
description: "控件标签字数超长时,换行显示。控件标签与输入框在一行展示时,此属性有效。",
|
|
175
|
-
visible:
|
|
158
|
+
visible: t.formType === "dynamic" || l,
|
|
176
159
|
type: "boolean"
|
|
177
|
-
},
|
|
160
|
+
}, T.properties.formType = {
|
|
161
|
+
title: "控件来源",
|
|
162
|
+
description: "",
|
|
163
|
+
type: "enum",
|
|
164
|
+
editor: {
|
|
165
|
+
readonly: t.type === "dynamic-form",
|
|
166
|
+
type: "combo-list",
|
|
167
|
+
textField: "name",
|
|
168
|
+
valueField: "value",
|
|
169
|
+
data: [
|
|
170
|
+
{
|
|
171
|
+
value: "static",
|
|
172
|
+
name: "静态"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
value: "dynamic",
|
|
176
|
+
name: "动态"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
value: "mixed",
|
|
180
|
+
name: "混合"
|
|
181
|
+
}
|
|
182
|
+
]
|
|
183
|
+
},
|
|
184
|
+
refreshPanelAfterChanged: !0
|
|
185
|
+
}, T.properties.unifiedLayout = {
|
|
178
186
|
title: "统一布局配置",
|
|
179
187
|
description: "统一配置卡片区域内所有控件的宽度,只支持标准模式",
|
|
180
|
-
visible:
|
|
188
|
+
visible: t.formType === "dynamic" || l,
|
|
181
189
|
refreshPanelAfterChanged: !0,
|
|
182
190
|
editor: {
|
|
183
191
|
type: "response-form-layout-setting",
|
|
184
192
|
initialState: m(t)
|
|
185
193
|
}
|
|
186
|
-
},
|
|
187
|
-
if (
|
|
188
|
-
switch (
|
|
194
|
+
}, T.setPropertyRelates = function(i, c) {
|
|
195
|
+
if (i)
|
|
196
|
+
switch (i && i.propertyID) {
|
|
189
197
|
case "unifiedLayout": {
|
|
190
|
-
|
|
198
|
+
t.formType === "dynamic" ? t.layout = V("", i.propertyValue) : (g(null, i.propertyValue, t.id), o.updateElementByParentContainer(t.id, n));
|
|
191
199
|
break;
|
|
192
200
|
}
|
|
193
201
|
case "labelAutoOverflow": {
|
|
194
|
-
o.setLabelAutoOverflow(t,
|
|
202
|
+
o.setLabelAutoOverflow(t, i.propertyValue), Xe();
|
|
195
203
|
break;
|
|
196
204
|
}
|
|
197
205
|
}
|
|
198
|
-
}, this.propertyConfig.categories.appearance =
|
|
206
|
+
}, this.propertyConfig.categories.appearance = T;
|
|
207
|
+
let b = {};
|
|
208
|
+
if (t.formType && ["dynamic", "mixed"].indexOf(t.formType) > -1) {
|
|
209
|
+
const i = this.getPropertyEditorParams(t, ["Variable", "Custom"], "fields", {}, { newVariablePrefix: "", newVariableType: "Array" }), c = this.getPropertyEditorParams(t, ["Variable", "Custom"], "formData", {}, { newVariablePrefix: "", newVariableType: "Object" });
|
|
210
|
+
b = {
|
|
211
|
+
fields: {
|
|
212
|
+
title: "动态控件列表",
|
|
213
|
+
type: "string",
|
|
214
|
+
description: "动态控件列表",
|
|
215
|
+
editor: i
|
|
216
|
+
},
|
|
217
|
+
formData: {
|
|
218
|
+
title: "动态控件列表初始值",
|
|
219
|
+
type: "string",
|
|
220
|
+
description: "动态控件列表初始值",
|
|
221
|
+
editor: c
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
return this.propertyConfig.categories.behavior = this.getBehaviorConfig(t, "", b, (i, c) => {
|
|
226
|
+
switch (i.propertyID) {
|
|
227
|
+
case "fields":
|
|
228
|
+
case "formData":
|
|
229
|
+
o.afterMutilEditorChanged(t, i);
|
|
230
|
+
break;
|
|
231
|
+
}
|
|
232
|
+
}), this.propertyConfig;
|
|
199
233
|
}
|
|
200
234
|
setLabelAutoOverflow(t, n, o) {
|
|
201
235
|
if (!o) {
|
|
202
|
-
const
|
|
203
|
-
o = this.formSchemaUtils.selectNode(
|
|
236
|
+
const a = this.formSchemaUtils.getComponentById(this.componentId);
|
|
237
|
+
o = this.formSchemaUtils.selectNode(a, (m) => m.id === t.id);
|
|
204
238
|
}
|
|
205
|
-
o && o.contents && o.contents.length && o.contents.forEach((
|
|
206
|
-
if (
|
|
207
|
-
this.setLabelAutoOverflow(null, n,
|
|
239
|
+
o && o.contents && o.contents.length && o.contents.forEach((a) => {
|
|
240
|
+
if (a.type === p.fieldset.type) {
|
|
241
|
+
this.setLabelAutoOverflow(null, n, a);
|
|
208
242
|
return;
|
|
209
243
|
}
|
|
210
|
-
|
|
244
|
+
a.appearance || (a.appearance = {
|
|
211
245
|
class: ""
|
|
212
|
-
}),
|
|
246
|
+
}), a.appearance.class || (a.appearance.class = ""), n ? a.appearance.class.includes("farris-group-multi-label") || (a.appearance.class = a.appearance.class + " farris-group-multi-label") : a.appearance.class = a.appearance.class.replace("farris-group-multi-label", "").trim();
|
|
213
247
|
});
|
|
214
248
|
}
|
|
215
249
|
}
|
|
216
|
-
function
|
|
217
|
-
const n = e.schema, o = new
|
|
218
|
-
function
|
|
219
|
-
const { sourceElement:
|
|
220
|
-
if (!
|
|
250
|
+
function ft(e, t) {
|
|
251
|
+
const n = e.schema, o = new Qe(), { canMove: a, canAccept: m, canDelete: g } = o.getTemplateRule(e, t);
|
|
252
|
+
function V(s, y) {
|
|
253
|
+
const { sourceElement: C } = s, { componentInstance: r } = C, d = t == null ? void 0 : t.formSchemaUtils;
|
|
254
|
+
if (!d)
|
|
221
255
|
return !0;
|
|
222
|
-
const
|
|
223
|
-
return
|
|
256
|
+
const v = d.getComponentById(r.value.belongedComponentId), P = d.getViewModelById(v.viewModel), x = d.getComponentById(e.componentInstance.value.belongedComponentId), I = d.getViewModelById(x.viewModel);
|
|
257
|
+
return y ? P != null && P.id && (I != null && I.id) && P.id !== I.id ? P.bindTo === I.bindTo : !0 : (P == null ? void 0 : P.id) === (I == null ? void 0 : I.id);
|
|
224
258
|
}
|
|
225
|
-
function
|
|
226
|
-
const { bindingTargetId:
|
|
259
|
+
function T(s) {
|
|
260
|
+
const { bindingTargetId: y } = s;
|
|
227
261
|
if (!t)
|
|
228
262
|
return;
|
|
229
|
-
const { formSchemaUtils:
|
|
230
|
-
return !!(
|
|
263
|
+
const { formSchemaUtils: C, schemaService: r } = t, d = C.getComponentById(e.componentInstance.value.belongedComponentId), v = r.getFieldByIDAndVMID(y, d.viewModel);
|
|
264
|
+
return !!(v != null && v.schemaField);
|
|
231
265
|
}
|
|
232
|
-
function
|
|
233
|
-
const
|
|
234
|
-
if (
|
|
235
|
-
if (
|
|
266
|
+
function l(s) {
|
|
267
|
+
const y = o.getComponentContext(e);
|
|
268
|
+
if (y && y.componentClassList && y.componentClassList.includes("f-form-layout") && y.componentClassList.includes("farris-form")) {
|
|
269
|
+
if (s.sourceType === "control" && (s.componentCategory === "input" || s.componentType && ["fieldset", "dynamic-form"].indexOf(s.componentType) > -1))
|
|
236
270
|
return !0;
|
|
237
|
-
if (
|
|
238
|
-
if (
|
|
239
|
-
return
|
|
240
|
-
if (
|
|
241
|
-
return
|
|
271
|
+
if (s.sourceType === "move") {
|
|
272
|
+
if (s.componentType === "form-group")
|
|
273
|
+
return V(s, !0);
|
|
274
|
+
if (s.componentType === "fieldset")
|
|
275
|
+
return V(s, !1);
|
|
276
|
+
if (s.componentType === "dynamic-form")
|
|
277
|
+
return !0;
|
|
242
278
|
}
|
|
243
|
-
return
|
|
279
|
+
return s.sourceType === "field" && s.componentCategory === "input" ? T(s) : !1;
|
|
244
280
|
}
|
|
245
281
|
return !0;
|
|
246
282
|
}
|
|
247
|
-
function
|
|
248
|
-
return !(!
|
|
249
|
-
}
|
|
250
|
-
function i(
|
|
251
|
-
var
|
|
252
|
-
const
|
|
253
|
-
if (
|
|
254
|
-
const
|
|
255
|
-
switch (
|
|
256
|
-
case
|
|
257
|
-
|
|
283
|
+
function b(s) {
|
|
284
|
+
return !(!Ye().basalDragulaRuleForContainer(s, t) || !m || !l(s));
|
|
285
|
+
}
|
|
286
|
+
function i(s) {
|
|
287
|
+
var I;
|
|
288
|
+
const y = s.componentInstance, C = y.value.schema, r = t == null ? void 0 : t.formSchemaUtils, d = t == null ? void 0 : t.designViewModelUtils, v = r.getViewModelIdByComponentId(y.value.belongedComponentId), P = d.getDgViewModel(v), x = y.value.parent;
|
|
289
|
+
if (x && p.fieldset && ((I = x.schema) == null ? void 0 : I.type) === p.fieldset.type && P) {
|
|
290
|
+
const $ = { groupId: null, groupName: null };
|
|
291
|
+
switch (C.binding.type) {
|
|
292
|
+
case K.Form: {
|
|
293
|
+
P.changeField(C.binding.field, $);
|
|
258
294
|
break;
|
|
259
295
|
}
|
|
260
|
-
case
|
|
261
|
-
|
|
296
|
+
case K.Variable: {
|
|
297
|
+
r.modifyViewModelFieldById(v, C.binding.field, $, !0);
|
|
262
298
|
break;
|
|
263
299
|
}
|
|
264
300
|
}
|
|
265
301
|
}
|
|
266
302
|
}
|
|
267
|
-
function s
|
|
268
|
-
const
|
|
269
|
-
|
|
270
|
-
const
|
|
271
|
-
|
|
303
|
+
function c(s, y, C) {
|
|
304
|
+
const r = y.fields.find((I) => I.id === s), d = t == null ? void 0 : t.designViewModelUtils, v = d.getDgViewModel(y.id), P = v.fields.find((I) => I.id === s);
|
|
305
|
+
v.removeField([s]);
|
|
306
|
+
const x = d.getDgViewModel(C);
|
|
307
|
+
x.addField(P), r.fieldSchema && x.changeField(P.id, r.fieldSchema);
|
|
272
308
|
}
|
|
273
|
-
function
|
|
274
|
-
const
|
|
275
|
-
if (
|
|
276
|
-
|
|
309
|
+
function F(s, y, C, r = []) {
|
|
310
|
+
const d = y.id, v = s.binding.field, P = y.fields.findIndex((I) => I.id === v);
|
|
311
|
+
if (P > -1 && (C.fields.push(y.fields[P]), y.fields.splice(P, 1)), d === "root-viewmodel" && C.id !== "root-viewmodel") {
|
|
312
|
+
s.binding.path && !s.binding.path.includes("root-component.") && (s.binding.path = "root-component." + s.binding.path);
|
|
277
313
|
return;
|
|
278
314
|
}
|
|
279
|
-
if (
|
|
280
|
-
|
|
315
|
+
if (C.id === "root-viewmodel" && d !== "root-viewmodel" && s.binding.path && s.binding.path.includes("root-component.")) {
|
|
316
|
+
s.binding.path = s.binding.path.replace("root-component.", "");
|
|
281
317
|
return;
|
|
282
318
|
}
|
|
283
|
-
const
|
|
284
|
-
|
|
319
|
+
const x = y.states.find((I) => I.id === v);
|
|
320
|
+
x && (C.states = C.states ? C.states : [], C.states.findIndex((I) => I.id === x.id) < 0 && (C.states.push(x), r.push(x.id)));
|
|
285
321
|
}
|
|
286
|
-
function
|
|
287
|
-
var
|
|
288
|
-
if (!
|
|
322
|
+
function u(s, y, C, r = []) {
|
|
323
|
+
var P;
|
|
324
|
+
if (!s)
|
|
289
325
|
return;
|
|
290
|
-
const
|
|
291
|
-
Object.keys(
|
|
292
|
-
if (
|
|
326
|
+
const d = y.id === "root-viewmodel" && C.id !== "root-viewmodel", v = C.id === "root-viewmodel" && y.id !== "root-viewmodel";
|
|
327
|
+
Object.keys(s).forEach((x) => {
|
|
328
|
+
if (x === "binding")
|
|
293
329
|
return;
|
|
294
|
-
const
|
|
295
|
-
if (
|
|
296
|
-
if (
|
|
297
|
-
|
|
330
|
+
const I = s[x];
|
|
331
|
+
if (I && typeof I == "object" && I.type === K.Variable && I.field) {
|
|
332
|
+
if (d) {
|
|
333
|
+
I.path && !I.path.includes("root-component.") && (I.path = "root-component." + I.path);
|
|
298
334
|
return;
|
|
299
335
|
}
|
|
300
|
-
if (
|
|
301
|
-
|
|
336
|
+
if (v && I.path && I.path.includes("root-component.")) {
|
|
337
|
+
I.path = I.path.replace("root-component.", "");
|
|
302
338
|
return;
|
|
303
339
|
}
|
|
304
|
-
const
|
|
305
|
-
if (
|
|
306
|
-
|
|
307
|
-
const L =
|
|
340
|
+
const $ = y.states.find((L) => L.id === I.field);
|
|
341
|
+
if ($) {
|
|
342
|
+
r.push($.id), C.states = C.states ? C.states : [];
|
|
343
|
+
const L = C.states.find((A) => A.code === $.code);
|
|
308
344
|
if (L)
|
|
309
|
-
|
|
345
|
+
I.field = L.id;
|
|
310
346
|
else {
|
|
311
|
-
const
|
|
312
|
-
|
|
347
|
+
const A = Object.assign({}, { newId: be().guid() }, $);
|
|
348
|
+
C.states.push(A), I.field = A.newId;
|
|
313
349
|
}
|
|
314
350
|
}
|
|
315
351
|
}
|
|
316
|
-
}), (
|
|
317
|
-
|
|
352
|
+
}), (P = C.states) != null && P.length && C.states.map((x) => {
|
|
353
|
+
x.newId && (x.id = x.newId, delete x.newId);
|
|
318
354
|
});
|
|
319
355
|
}
|
|
320
|
-
function
|
|
321
|
-
if (
|
|
322
|
-
for (const
|
|
323
|
-
|
|
356
|
+
function f(s, y, C) {
|
|
357
|
+
if (s && (y(s, C), s.contents))
|
|
358
|
+
for (const r of s.contents)
|
|
359
|
+
f(r, y, C);
|
|
324
360
|
}
|
|
325
|
-
function
|
|
326
|
-
if (!
|
|
361
|
+
function w(s = [], y) {
|
|
362
|
+
if (!s.length)
|
|
327
363
|
return;
|
|
328
|
-
const
|
|
329
|
-
|
|
330
|
-
const L =
|
|
331
|
-
L && typeof L == "object" && L.type ===
|
|
332
|
-
}),
|
|
364
|
+
const C = t == null ? void 0 : t.formSchemaUtils, r = C.getComponentByViewModelId(y), d = [], v = (x, I) => {
|
|
365
|
+
x && (Object.keys(x).forEach(($) => {
|
|
366
|
+
const L = x[$];
|
|
367
|
+
L && typeof L == "object" && L.type === K.Variable && s.includes(L.field) && !I.includes(L.field) && I.push(L.field);
|
|
368
|
+
}), x.editor && v(x.editor, I));
|
|
333
369
|
};
|
|
334
|
-
|
|
335
|
-
const
|
|
336
|
-
|
|
337
|
-
|
|
370
|
+
f(r, v, d);
|
|
371
|
+
const P = C.getViewModelById(y);
|
|
372
|
+
s.forEach((x) => {
|
|
373
|
+
d.includes(x) || (P.states = P.states.filter((I) => I.id !== x));
|
|
338
374
|
});
|
|
339
375
|
}
|
|
340
|
-
function
|
|
341
|
-
const
|
|
342
|
-
id:
|
|
343
|
-
code:
|
|
344
|
-
name:
|
|
345
|
-
}),
|
|
346
|
-
return
|
|
347
|
-
host:
|
|
348
|
-
handler:
|
|
349
|
-
}),
|
|
350
|
-
}
|
|
351
|
-
function
|
|
352
|
-
var
|
|
353
|
-
const
|
|
354
|
-
if (!
|
|
376
|
+
function k(s) {
|
|
377
|
+
const y = be().guid(), C = Object.assign({}, s, {
|
|
378
|
+
id: y,
|
|
379
|
+
code: s.code + y.slice(0, 4),
|
|
380
|
+
name: s.name + y.slice(0, 4)
|
|
381
|
+
}), v = (t == null ? void 0 : t.formSchemaUtils).getCommands().find((P) => P.id === s.cmpId);
|
|
382
|
+
return v && v.refedHandlers.push({
|
|
383
|
+
host: y,
|
|
384
|
+
handler: s.handlerName
|
|
385
|
+
}), C;
|
|
386
|
+
}
|
|
387
|
+
function h(s, y, C) {
|
|
388
|
+
var $, L, A;
|
|
389
|
+
const r = {}, d = s.type === "form-group" && s.editor ? s.editor.type : s.type, v = ($ = Ze[d]) == null ? void 0 : $.events;
|
|
390
|
+
if (!v)
|
|
355
391
|
return;
|
|
356
|
-
Object.keys(
|
|
357
|
-
const
|
|
358
|
-
if (
|
|
359
|
-
const
|
|
360
|
-
if (
|
|
361
|
-
let
|
|
362
|
-
|
|
392
|
+
Object.keys(s).forEach((G) => {
|
|
393
|
+
const U = Object.keys(v).find((q) => q === G);
|
|
394
|
+
if (U && s[U]) {
|
|
395
|
+
const q = y.commands.find((S) => S.code === s[U]);
|
|
396
|
+
if (q) {
|
|
397
|
+
let S = r[q.code];
|
|
398
|
+
S || (S = k(q), r[q.code] = S, C.commands.push(S)), s[U] = S.code;
|
|
363
399
|
}
|
|
364
400
|
}
|
|
365
401
|
});
|
|
366
|
-
const
|
|
367
|
-
if (((L =
|
|
368
|
-
const
|
|
369
|
-
|
|
370
|
-
if (
|
|
371
|
-
const
|
|
372
|
-
if (!
|
|
402
|
+
const x = (t == null ? void 0 : t.designViewModelUtils).getDgViewModel(C.id), I = ["valueChanging", "valueChanged"];
|
|
403
|
+
if (((L = s.binding) == null ? void 0 : L.type) === K.Form) {
|
|
404
|
+
const G = (A = C.fields) == null ? void 0 : A.find((U) => U.id === s.binding.field);
|
|
405
|
+
G && I.forEach((U) => {
|
|
406
|
+
if (G[U]) {
|
|
407
|
+
const q = y.commands.find((S) => S.code === G[U]);
|
|
408
|
+
if (!q)
|
|
373
409
|
return;
|
|
374
|
-
if (
|
|
375
|
-
|
|
410
|
+
if (r[q.code])
|
|
411
|
+
x.changeField(G.id, { [U]: r[q.code].code });
|
|
376
412
|
else {
|
|
377
|
-
const
|
|
378
|
-
|
|
413
|
+
const S = k(q);
|
|
414
|
+
r[q.code] = S, C.commands.push(S), x.changeField(G.id, { [U]: S.code });
|
|
379
415
|
}
|
|
380
416
|
}
|
|
381
417
|
});
|
|
382
418
|
}
|
|
383
419
|
}
|
|
384
|
-
function
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
420
|
+
function j(s) {
|
|
421
|
+
var I, $;
|
|
422
|
+
const y = t == null ? void 0 : t.formSchemaUtils, C = s.componentInstance, r = C.value.schema, d = y.getViewModelIdByComponentId(C.value.belongedComponentId), v = y.getViewModelById(d), P = y.getComponentById(e.componentInstance.value.belongedComponentId), x = y.getViewModelById(P.viewModel);
|
|
423
|
+
if (d !== x.id) {
|
|
424
|
+
const L = (I = r.binding) == null ? void 0 : I.type, A = ($ = r.binding) == null ? void 0 : $.field, G = [];
|
|
425
|
+
switch (L) {
|
|
426
|
+
case K.Form: {
|
|
427
|
+
c(A, v, x.id);
|
|
391
428
|
break;
|
|
392
429
|
}
|
|
393
|
-
case
|
|
394
|
-
|
|
430
|
+
case K.Variable: {
|
|
431
|
+
F(r, v, x, G);
|
|
395
432
|
break;
|
|
396
433
|
}
|
|
397
434
|
}
|
|
398
|
-
|
|
435
|
+
u(r, v, x, G), u(r.editor, v, x, G), h(r, v, x), d !== "root-viewmodel" && w(G, d);
|
|
399
436
|
}
|
|
400
437
|
}
|
|
401
|
-
function
|
|
402
|
-
|
|
438
|
+
function O(s) {
|
|
439
|
+
var r;
|
|
440
|
+
if (!s || !s.componentInstance)
|
|
441
|
+
return;
|
|
442
|
+
const C = s.componentInstance.value.schema;
|
|
443
|
+
if (C.type === "dynamic-form") {
|
|
444
|
+
const d = ((r = C == null ? void 0 : C.appearance) == null ? void 0 : r.class) || "";
|
|
445
|
+
d.indexOf("col-12") < 0 && (C.appearance = {
|
|
446
|
+
...C.appearance,
|
|
447
|
+
class: d + " col-12 px-0"
|
|
448
|
+
}), j(s);
|
|
403
449
|
return;
|
|
404
|
-
|
|
405
|
-
!
|
|
450
|
+
}
|
|
451
|
+
!C.binding || !C.binding.field || (i(s), j(s));
|
|
406
452
|
}
|
|
407
|
-
function
|
|
453
|
+
function N() {
|
|
408
454
|
return n.componentType ? "display:inherit;flex-direction:inherit;margin-bottom:10px" : "";
|
|
409
455
|
}
|
|
410
|
-
function B(
|
|
411
|
-
let
|
|
412
|
-
switch (
|
|
456
|
+
function B(s) {
|
|
457
|
+
let y = "";
|
|
458
|
+
switch (s) {
|
|
413
459
|
case 1: {
|
|
414
|
-
|
|
460
|
+
y = "col-12 col-md-12 col-xl-12 col-el-12";
|
|
415
461
|
break;
|
|
416
462
|
}
|
|
417
463
|
case 2: {
|
|
418
|
-
|
|
464
|
+
y = "col-12 col-md-6 col-xl-6 col-el-6";
|
|
419
465
|
break;
|
|
420
466
|
}
|
|
421
467
|
case 3: {
|
|
422
|
-
|
|
468
|
+
y = "col-12 col-md-6 col-xl-4 col-el-4";
|
|
423
469
|
break;
|
|
424
470
|
}
|
|
425
471
|
case 4: {
|
|
426
|
-
|
|
472
|
+
y = "col-12 col-md-6 col-xl-3 col-el-2";
|
|
427
473
|
break;
|
|
428
474
|
}
|
|
429
475
|
}
|
|
430
|
-
return
|
|
476
|
+
return y;
|
|
431
477
|
}
|
|
432
|
-
function
|
|
433
|
-
let
|
|
478
|
+
function Z(s, y) {
|
|
479
|
+
let C = !1;
|
|
434
480
|
if (e.schema && Object.prototype.hasOwnProperty.call(e.schema, "labelAutoOverflow"))
|
|
435
|
-
|
|
481
|
+
C = e.schema.labelAutoOverflow;
|
|
436
482
|
else {
|
|
437
|
-
const
|
|
438
|
-
|
|
483
|
+
const r = t == null ? void 0 : t.formSchemaUtils, d = r == null ? void 0 : r.selectNode(y, (v) => v.type === p["response-form"].type);
|
|
484
|
+
d && (C = d.labelAutoOverflow);
|
|
485
|
+
}
|
|
486
|
+
return C && (s += " farris-group-multi-label"), s;
|
|
487
|
+
}
|
|
488
|
+
function z(s) {
|
|
489
|
+
const y = e.componentInstance.value.getBelongedComponentInstance(e.componentInstance);
|
|
490
|
+
if (y && y.schema && y.schema.componentType) {
|
|
491
|
+
const { formColumns: C } = y.schema;
|
|
492
|
+
let r = B(C);
|
|
493
|
+
r = t == null ? void 0 : t.formSchemaUtils.getControlClassByFormUnifiedLayout(r, y.schema.id, e.schema), r = Z(r, y.schema), s.appearance || (s.appearance = {}), s.appearance.class = r;
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
function E(s, y, C, r) {
|
|
497
|
+
const { bindingSourceContext: d, parentComponentInstance: v } = s;
|
|
498
|
+
if (d != null && d.entityFieldNode && v) {
|
|
499
|
+
const P = t == null ? void 0 : t.designViewModelUtils, I = (t == null ? void 0 : t.formSchemaUtils).getViewModelIdByComponentId(v.belongedComponentId), $ = P.getDgViewModel(I);
|
|
500
|
+
$.removeField([d.entityFieldNode.id]), $.addField(d.designViewModelField), y && $.changeField(d.entityFieldNode.id, { editor: { $type: y }, groupId: C, groupName: r });
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
function M(s, y) {
|
|
504
|
+
var v, P, x;
|
|
505
|
+
const C = n;
|
|
506
|
+
if ((C.appearance && C.appearance.class || "").split(" ").includes("f-form-layout") && s.componentCategory === "input") {
|
|
507
|
+
const { label: I } = s;
|
|
508
|
+
let $;
|
|
509
|
+
const L = t == null ? void 0 : t.controlCreatorUtils;
|
|
510
|
+
return (v = s.bindingSourceContext) != null && v.entityFieldNode ? $ = L.setFormFieldProperty((P = s.bindingSourceContext) == null ? void 0 : P.entityFieldNode, y == null ? void 0 : y.type) : ($ = L.createFormGroupWithoutField(y == null ? void 0 : y.type), $.label = I), z($), E(s, (x = $.editor) == null ? void 0 : x.type), $;
|
|
511
|
+
}
|
|
512
|
+
return s.componentType === "dynamic-form" && (y.appearance = {
|
|
513
|
+
class: "col-12",
|
|
514
|
+
...y.appearance
|
|
515
|
+
}), y;
|
|
516
|
+
}
|
|
517
|
+
function _() {
|
|
518
|
+
return a;
|
|
519
|
+
}
|
|
520
|
+
function W() {
|
|
521
|
+
return g;
|
|
522
|
+
}
|
|
523
|
+
function X() {
|
|
524
|
+
return !1;
|
|
525
|
+
}
|
|
526
|
+
function J(s) {
|
|
527
|
+
return new Me(s, t).getPropertyConfig(n, e.componentInstance.value);
|
|
528
|
+
}
|
|
529
|
+
return {
|
|
530
|
+
canAccepts: b,
|
|
531
|
+
checkCanDeleteComponent: W,
|
|
532
|
+
checkCanMoveComponent: _,
|
|
533
|
+
getStyles: N,
|
|
534
|
+
getPropsConfig: J,
|
|
535
|
+
hideNestedPaddingInDesginerView: X,
|
|
536
|
+
onAcceptMovedChildElement: O,
|
|
537
|
+
onResolveNewComponentSchema: M,
|
|
538
|
+
moveInputBetweenComponent: j,
|
|
539
|
+
resolveFormGroupAppearance: z,
|
|
540
|
+
syncFieldToViewModel: E
|
|
541
|
+
};
|
|
542
|
+
}
|
|
543
|
+
const yt = "root-viewmodel";
|
|
544
|
+
class gt {
|
|
545
|
+
constructor(t, n) {
|
|
546
|
+
ie(this, "formSchemaUtils");
|
|
547
|
+
ie(this, "controlCreatorUtils");
|
|
548
|
+
ie(this, "designViewModelUtils");
|
|
549
|
+
this.resolver = t, this.designerHostService = n, this.formSchemaUtils = this.designerHostService.formSchemaUtils, this.controlCreatorUtils = this.designerHostService.controlCreatorUtils, this.designViewModelUtils = this.designerHostService.designViewModelUtils;
|
|
550
|
+
}
|
|
551
|
+
createComponent(t) {
|
|
552
|
+
const n = this.createComponentRefNode(t), o = this.createComponentNode(t), a = this.createViewModeNode(t), m = this.formSchemaUtils.getFormSchema();
|
|
553
|
+
return m.module.viewmodels.push(a), m.module.components.push(o), this.designViewModelUtils.assembleDesignViewModel(), n;
|
|
554
|
+
}
|
|
555
|
+
createComponentRefNode(t) {
|
|
556
|
+
const n = this.resolver.getSchemaByType("component-ref");
|
|
557
|
+
return Object.assign(n, {
|
|
558
|
+
id: `${t.componentId}-component-ref`,
|
|
559
|
+
component: `${t.componentId}-component`
|
|
560
|
+
}), n;
|
|
561
|
+
}
|
|
562
|
+
createComponentNode(t) {
|
|
563
|
+
const n = this.resolver.getSchemaByType("component"), o = this.createFormComponentContents(t);
|
|
564
|
+
return Object.assign(n, {
|
|
565
|
+
id: `${t.componentId}-component`,
|
|
566
|
+
viewModel: `${t.componentId}-component-viewmodel`,
|
|
567
|
+
componentType: t.componentType,
|
|
568
|
+
appearance: {
|
|
569
|
+
class: this.getFormComponentClass(t)
|
|
570
|
+
},
|
|
571
|
+
formColumns: t.formColumns,
|
|
572
|
+
contents: o
|
|
573
|
+
}), n;
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* 获取卡片组件层级的class样式
|
|
577
|
+
*/
|
|
578
|
+
getFormComponentClass(t) {
|
|
579
|
+
var o, a;
|
|
580
|
+
const { templateId: n } = this.formSchemaUtils.getFormSchema().module;
|
|
581
|
+
if (n === "double-list-in-tab-template" && ((a = (o = t.parentComponentInstance) == null ? void 0 : o.schema) == null ? void 0 : a.type) === "tab-page") {
|
|
582
|
+
const m = t.parentComponentInstance.parent && t.parentComponentInstance.parent.schema;
|
|
583
|
+
if ((m == null ? void 0 : m.type) === "tabs" && (m == null ? void 0 : m.fill) === !0)
|
|
584
|
+
return "f-struct-wrapper f-utils-fill-flex-column";
|
|
585
|
+
}
|
|
586
|
+
return "f-struct-wrapper";
|
|
587
|
+
}
|
|
588
|
+
createFormComponentContents(t) {
|
|
589
|
+
var V, T;
|
|
590
|
+
const n = this.resolver.getSchemaByType("section");
|
|
591
|
+
Object.assign(n, {
|
|
592
|
+
id: t.componentId + "-form-section",
|
|
593
|
+
appearance: {
|
|
594
|
+
class: "f-section-form f-section-in-mainsubcard"
|
|
595
|
+
},
|
|
596
|
+
mainTitle: t.componentName
|
|
597
|
+
});
|
|
598
|
+
const o = this.resolver.getSchemaByType("response-form"), a = [];
|
|
599
|
+
Object.assign(o, {
|
|
600
|
+
id: t.componentId + "-form",
|
|
601
|
+
appearance: {
|
|
602
|
+
class: "f-form-layout farris-form farris-form-controls-inline"
|
|
603
|
+
},
|
|
604
|
+
contents: a,
|
|
605
|
+
controlsInline: !0
|
|
606
|
+
}), n.contents = [o];
|
|
607
|
+
const { selectedFields: m } = t;
|
|
608
|
+
m == null || m.forEach((l) => {
|
|
609
|
+
if (l.$type === ve.SimpleField) {
|
|
610
|
+
const b = de(l), i = this.resolveControlClassByFormColumns(t), c = this.controlCreatorUtils.setFormFieldProperty(b, "", i);
|
|
611
|
+
c && a.push(c);
|
|
612
|
+
}
|
|
613
|
+
});
|
|
614
|
+
const { templateId: g } = this.formSchemaUtils.getFormSchema().module;
|
|
615
|
+
if (g === "double-list-in-tab-template" && ((T = (V = t.parentComponentInstance) == null ? void 0 : V.schema) == null ? void 0 : T.type) === "tab-page") {
|
|
616
|
+
const l = t.parentComponentInstance.parent && t.parentComponentInstance.parent.schema;
|
|
617
|
+
(l == null ? void 0 : l.type) === "tabs" && (l == null ? void 0 : l.fill) === !0 && (n.appearance.class = "f-section-grid f-section-in-main px-0 pt-0", n.fill = !0);
|
|
618
|
+
}
|
|
619
|
+
return [n];
|
|
620
|
+
}
|
|
621
|
+
resolveControlClassByFormColumns(t) {
|
|
622
|
+
let n = "";
|
|
623
|
+
switch (t.formColumns) {
|
|
624
|
+
case 1: {
|
|
625
|
+
n = "col-12 col-md-12 col-xl-12 col-el-12";
|
|
626
|
+
break;
|
|
627
|
+
}
|
|
628
|
+
case 2: {
|
|
629
|
+
n = "col-12 col-md-6 col-xl-6 col-el-6";
|
|
630
|
+
break;
|
|
631
|
+
}
|
|
632
|
+
case 3: {
|
|
633
|
+
n = "col-12 col-md-6 col-xl-4 col-el-4";
|
|
634
|
+
break;
|
|
635
|
+
}
|
|
636
|
+
case 4: {
|
|
637
|
+
n = "col-12 col-md-6 col-xl-3 col-el-2";
|
|
638
|
+
break;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
return n;
|
|
642
|
+
}
|
|
643
|
+
/**
|
|
644
|
+
* 添加viewModel节点
|
|
645
|
+
*/
|
|
646
|
+
createViewModeNode(t) {
|
|
647
|
+
return {
|
|
648
|
+
id: `${t.componentId}-component-viewmodel`,
|
|
649
|
+
code: `${t.componentId}-component-viewmodel`,
|
|
650
|
+
name: t.componentName,
|
|
651
|
+
bindTo: t.bindTo,
|
|
652
|
+
parent: yt,
|
|
653
|
+
fields: this.assembleViewModelFields(t),
|
|
654
|
+
commands: [],
|
|
655
|
+
states: [],
|
|
656
|
+
enableValidation: !0
|
|
657
|
+
};
|
|
658
|
+
}
|
|
659
|
+
/**
|
|
660
|
+
* 组装viewModel fields 节点
|
|
661
|
+
*/
|
|
662
|
+
assembleViewModelFields(t) {
|
|
663
|
+
const n = [], { selectedFields: o } = t;
|
|
664
|
+
return o == null || o.forEach((a) => {
|
|
665
|
+
if (a.$type === ve.SimpleField) {
|
|
666
|
+
let m = "blur";
|
|
667
|
+
const g = a.type.name;
|
|
668
|
+
(g === he.Enum || g === he.Boolean) && (m = "change"), n.push({
|
|
669
|
+
type: "Form",
|
|
670
|
+
id: a.id,
|
|
671
|
+
fieldName: a.bindingField,
|
|
672
|
+
groupId: null,
|
|
673
|
+
groupName: null,
|
|
674
|
+
updateOn: m,
|
|
675
|
+
fieldSchema: {}
|
|
676
|
+
});
|
|
677
|
+
}
|
|
678
|
+
}), n;
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
function ye(e, t, n, o) {
|
|
682
|
+
var m, g, V, T, l, b;
|
|
683
|
+
const a = n.parentComponentInstance;
|
|
684
|
+
if (a && o) {
|
|
685
|
+
const i = (m = a.schema) == null ? void 0 : m.type, F = {
|
|
686
|
+
componentId: `form-${Math.random().toString(36).slice(2, 6)}`,
|
|
687
|
+
componentName: ((g = n.bindingSourceContext) == null ? void 0 : g.entityTitle) || ((T = (V = n.bindingSourceContext) == null ? void 0 : V.bindingEntity) == null ? void 0 : T.name) || "标题",
|
|
688
|
+
componentType: "form",
|
|
689
|
+
formColumns: i === "splitter-pane" ? 1 : 4,
|
|
690
|
+
parentContainerId: a.schema.id,
|
|
691
|
+
parentComponentInstance: a,
|
|
692
|
+
bindTo: ((l = n.bindingSourceContext) == null ? void 0 : l.bindTo) || "/",
|
|
693
|
+
selectedFields: (b = n.bindingSourceContext) == null ? void 0 : b.bindingEntityFields
|
|
694
|
+
};
|
|
695
|
+
return new gt(e, o).createComponent(F);
|
|
696
|
+
} else
|
|
697
|
+
return t;
|
|
698
|
+
}
|
|
699
|
+
function bt(e, t, n) {
|
|
700
|
+
return t;
|
|
701
|
+
}
|
|
702
|
+
function vt(e, t, n, o) {
|
|
703
|
+
return t.formType = "dynamic", t.layout = "col-12 col-md-6 col-xl-3 col-el-2", t;
|
|
704
|
+
}
|
|
705
|
+
const oe = /* @__PURE__ */ new Map([
|
|
706
|
+
["appearance", We]
|
|
707
|
+
]), ht = /* @__PURE__ */ new Map([]), Ct = "https://json-schema.org/draft/2020-12/schema", Ft = "https://farris-design.gitee.io/response-form.schema.json", Tt = "response-form", wt = "A Farris Data Collection Component", kt = "object", It = {
|
|
708
|
+
id: {
|
|
709
|
+
description: "The unique identifier for a form group",
|
|
710
|
+
type: "string"
|
|
711
|
+
},
|
|
712
|
+
type: {
|
|
713
|
+
description: "The type string of form group component",
|
|
714
|
+
type: "string",
|
|
715
|
+
default: "response-form"
|
|
716
|
+
},
|
|
717
|
+
appearance: {
|
|
718
|
+
description: "",
|
|
719
|
+
type: "object",
|
|
720
|
+
properties: {
|
|
721
|
+
class: {
|
|
722
|
+
type: "string"
|
|
723
|
+
},
|
|
724
|
+
style: {
|
|
725
|
+
type: "string"
|
|
726
|
+
}
|
|
727
|
+
},
|
|
728
|
+
default: {}
|
|
729
|
+
},
|
|
730
|
+
contents: {
|
|
731
|
+
description: "",
|
|
732
|
+
type: "array",
|
|
733
|
+
default: []
|
|
734
|
+
},
|
|
735
|
+
visible: {
|
|
736
|
+
description: "",
|
|
737
|
+
type: "boolean",
|
|
738
|
+
default: !0
|
|
739
|
+
},
|
|
740
|
+
labelAutoOverflow: {
|
|
741
|
+
description: "",
|
|
742
|
+
type: "boolean",
|
|
743
|
+
default: !1
|
|
744
|
+
},
|
|
745
|
+
adaptForLanguage: {
|
|
746
|
+
description: "",
|
|
747
|
+
type: "boolean",
|
|
748
|
+
default: !0
|
|
749
|
+
},
|
|
750
|
+
layout: {
|
|
751
|
+
description: "",
|
|
752
|
+
type: "string",
|
|
753
|
+
default: "col-12 col-md-6 col-xl-3 col-el-2"
|
|
754
|
+
},
|
|
755
|
+
fields: {
|
|
756
|
+
description: "",
|
|
757
|
+
type: "array"
|
|
758
|
+
},
|
|
759
|
+
formData: {
|
|
760
|
+
description: "",
|
|
761
|
+
type: "object"
|
|
762
|
+
},
|
|
763
|
+
formType: {
|
|
764
|
+
description: "",
|
|
765
|
+
type: "string",
|
|
766
|
+
default: "static"
|
|
767
|
+
}
|
|
768
|
+
}, Pt = [
|
|
769
|
+
"id",
|
|
770
|
+
"type",
|
|
771
|
+
"contents"
|
|
772
|
+
], De = {
|
|
773
|
+
$schema: Ct,
|
|
774
|
+
$id: Ft,
|
|
775
|
+
title: Tt,
|
|
776
|
+
description: wt,
|
|
777
|
+
type: kt,
|
|
778
|
+
properties: It,
|
|
779
|
+
required: Pt
|
|
780
|
+
}, Vt = "https://json-schema.org/draft/2020-12/schema", xt = "https://farris-design.gitee.io/dynamic-form.schema.json", Mt = "dynamic-form", Dt = "A Farris Data Collection Component", Bt = "object", Et = {
|
|
781
|
+
id: {
|
|
782
|
+
description: "The unique identifier for a form group",
|
|
783
|
+
type: "string"
|
|
784
|
+
},
|
|
785
|
+
type: {
|
|
786
|
+
description: "The type string of form group component",
|
|
787
|
+
type: "string",
|
|
788
|
+
default: "dynamic-form"
|
|
789
|
+
},
|
|
790
|
+
appearance: {
|
|
791
|
+
description: "",
|
|
792
|
+
type: "object",
|
|
793
|
+
properties: {
|
|
794
|
+
class: {
|
|
795
|
+
type: "string"
|
|
796
|
+
},
|
|
797
|
+
style: {
|
|
798
|
+
type: "string"
|
|
799
|
+
}
|
|
800
|
+
},
|
|
801
|
+
default: {}
|
|
802
|
+
},
|
|
803
|
+
contents: {
|
|
804
|
+
description: "",
|
|
805
|
+
type: "array",
|
|
806
|
+
default: []
|
|
807
|
+
},
|
|
808
|
+
visible: {
|
|
809
|
+
description: "",
|
|
810
|
+
type: "boolean",
|
|
811
|
+
default: !0
|
|
812
|
+
},
|
|
813
|
+
labelAutoOverflow: {
|
|
814
|
+
description: "",
|
|
815
|
+
type: "boolean",
|
|
816
|
+
default: !1
|
|
817
|
+
},
|
|
818
|
+
adaptForLanguage: {
|
|
819
|
+
description: "",
|
|
820
|
+
type: "boolean",
|
|
821
|
+
default: !0
|
|
822
|
+
},
|
|
823
|
+
formType: {
|
|
824
|
+
description: "",
|
|
825
|
+
type: "string",
|
|
826
|
+
default: "dynamic"
|
|
827
|
+
},
|
|
828
|
+
layout: {
|
|
829
|
+
description: "",
|
|
830
|
+
type: "string",
|
|
831
|
+
default: "col-12 col-md-6 col-xl-3 col-el-2"
|
|
832
|
+
},
|
|
833
|
+
fields: {
|
|
834
|
+
description: "",
|
|
835
|
+
type: "array"
|
|
836
|
+
},
|
|
837
|
+
formData: {
|
|
838
|
+
description: "",
|
|
839
|
+
type: "object"
|
|
840
|
+
}
|
|
841
|
+
}, $t = [
|
|
842
|
+
"id",
|
|
843
|
+
"type",
|
|
844
|
+
"contents"
|
|
845
|
+
], Be = {
|
|
846
|
+
$schema: Vt,
|
|
847
|
+
$id: xt,
|
|
848
|
+
title: Mt,
|
|
849
|
+
description: Dt,
|
|
850
|
+
type: Bt,
|
|
851
|
+
properties: Et,
|
|
852
|
+
required: $t
|
|
853
|
+
}, re = {
|
|
854
|
+
customClass: { type: String, default: "" },
|
|
855
|
+
customStyle: { type: String, defaut: "" },
|
|
856
|
+
/** 控制是否可见 */
|
|
857
|
+
visible: { type: Boolean, default: !0 },
|
|
858
|
+
/** 内部控件布局是否响应国际化 */
|
|
859
|
+
adaptForLanguage: { type: Boolean, default: !0 },
|
|
860
|
+
/** 绑定动态字段 */
|
|
861
|
+
fields: { type: Array, default: [] },
|
|
862
|
+
/** 绑定动态字段的值*/
|
|
863
|
+
formData: { type: Object, default: null },
|
|
864
|
+
/** 为动态字段指定样式*/
|
|
865
|
+
layout: { type: String, default: "col-12 col-md-6 col-xl-3 col-el-2" }
|
|
866
|
+
}, Ot = Object.assign({}, re, {
|
|
867
|
+
// 是否渲染form层级
|
|
868
|
+
canRenderForm: { type: Boolean, default: !0 },
|
|
869
|
+
callback: { type: Function }
|
|
870
|
+
}), jt = ae(re, De, oe, ye), Lt = ae(re, Be, oe, ye), Ee = Object.assign({}, re, {
|
|
871
|
+
componentId: { type: String, default: "" },
|
|
872
|
+
formType: { type: String, default: "static" }
|
|
873
|
+
}), Nt = xe(re, De, oe, ye), At = xe(re, Be, oe, vt), pe = /* @__PURE__ */ ee({
|
|
874
|
+
name: "FResponseFormDesign",
|
|
875
|
+
directives: {
|
|
876
|
+
"area-response": He
|
|
877
|
+
},
|
|
878
|
+
props: Ee,
|
|
879
|
+
emits: [],
|
|
880
|
+
setup(e, t) {
|
|
881
|
+
const n = R(), o = Y("design-item-context"), a = Y("designer-host-service"), m = ft(o, a), g = ce(n, o, m);
|
|
882
|
+
ne(() => {
|
|
883
|
+
n.value.componentInstance = g;
|
|
884
|
+
}), t.expose(g.value);
|
|
885
|
+
const V = H(() => fe({
|
|
886
|
+
"drag-container": !0
|
|
887
|
+
}, e.customClass));
|
|
888
|
+
return () => ke(D("div", {
|
|
889
|
+
ref: n,
|
|
890
|
+
class: V.value,
|
|
891
|
+
style: e.customClass,
|
|
892
|
+
"data-dragref": `${o.schema.id}-container`,
|
|
893
|
+
"data-associate": `${o.schema.id}-component`
|
|
894
|
+
}, [t.slots.default && t.slots.default(), ["dynamic", "mixed"].indexOf(e.formType) > -1 && D("div", {
|
|
895
|
+
class: "no-drag w-100 col-12",
|
|
896
|
+
style: "height: 50px;display: flex;justify-content: center;align-items: center;overflow: hidden;margin-bottom: 0;color: #315585; background-color: #dfedff; border-color: #d2e6ff;"
|
|
897
|
+
}, [Q("��̬����")])]), [[Ie("area-response")]]);
|
|
898
|
+
}
|
|
899
|
+
});
|
|
900
|
+
function Rt(e, t) {
|
|
901
|
+
function n(g) {
|
|
902
|
+
const V = e.schema;
|
|
903
|
+
return new Me(g, t).getPropertyConfig(V, e.componentInstance.value);
|
|
904
|
+
}
|
|
905
|
+
function o() {
|
|
906
|
+
return !1;
|
|
907
|
+
}
|
|
908
|
+
function a() {
|
|
909
|
+
return !0;
|
|
910
|
+
}
|
|
911
|
+
function m() {
|
|
912
|
+
return !0;
|
|
913
|
+
}
|
|
914
|
+
return {
|
|
915
|
+
getPropsConfig: n,
|
|
916
|
+
canAccepts: o,
|
|
917
|
+
checkCanDeleteComponent: a,
|
|
918
|
+
checkCanMoveComponent: m
|
|
919
|
+
};
|
|
920
|
+
}
|
|
921
|
+
const Ut = /* @__PURE__ */ ee({
|
|
922
|
+
name: "FDynamicFormDesign",
|
|
923
|
+
props: Ee,
|
|
924
|
+
emits: [],
|
|
925
|
+
setup(e, t) {
|
|
926
|
+
const n = R(), o = Y("design-item-context"), a = Y("designer-host-service"), m = Rt(o, a), g = ce(n, o, m);
|
|
927
|
+
ne(() => {
|
|
928
|
+
n.value.componentInstance = g;
|
|
929
|
+
}), t.expose(g.value);
|
|
930
|
+
const V = H(() => fe({
|
|
931
|
+
"drag-container": !0
|
|
932
|
+
}, e.customClass));
|
|
933
|
+
return () => D("div", {
|
|
934
|
+
ref: n,
|
|
935
|
+
class: V.value,
|
|
936
|
+
style: e.customStyle
|
|
937
|
+
}, [D("div", {
|
|
938
|
+
class: "no-drag w-100",
|
|
939
|
+
style: "height: 50px;display: flex;justify-content: center;align-items: center;overflow: hidden;margin-bottom: 0;color: #315585; background-color: #dfedff; border-color: #d2e6ff;"
|
|
940
|
+
}, [Q("动态表单")])]);
|
|
941
|
+
}
|
|
942
|
+
}), qt = /* @__PURE__ */ ee({
|
|
943
|
+
name: "FDynamicForm",
|
|
944
|
+
props: Ot,
|
|
945
|
+
emits: ["update:modelValue", "event"],
|
|
946
|
+
setup(e, t) {
|
|
947
|
+
const n = R(e.fields), o = /* @__PURE__ */ new Map(), a = R(e.callback);
|
|
948
|
+
it();
|
|
949
|
+
const m = at(), g = R(e.formData || {}), V = st(g, t);
|
|
950
|
+
lt(n.value).setup();
|
|
951
|
+
const l = /* @__PURE__ */ new Map(), b = R(e.canRenderForm), {
|
|
952
|
+
mergeArray: i,
|
|
953
|
+
resolveCallbacks: c,
|
|
954
|
+
resolveEvents: F
|
|
955
|
+
} = ct(), u = H(() => {
|
|
956
|
+
const r = dt.getLocale(), d = e.fields && e.fields.length > 0, v = {
|
|
957
|
+
"f-form-layout": d,
|
|
958
|
+
"farris-form": d
|
|
959
|
+
};
|
|
960
|
+
return e.adaptForLanguage && r && (v["farris-form-controls-inline"] = r !== "en"), fe(v, e.customClass);
|
|
961
|
+
});
|
|
962
|
+
function f() {
|
|
963
|
+
function r(d, v) {
|
|
964
|
+
const {
|
|
965
|
+
id: P
|
|
966
|
+
} = d || {}, {
|
|
967
|
+
field: x
|
|
968
|
+
} = d.binding || {};
|
|
969
|
+
return {
|
|
970
|
+
modelValue: v.getValue(P),
|
|
971
|
+
"onUpdate:modelValue": (I) => {
|
|
972
|
+
v.setValue(P, x || P, I);
|
|
973
|
+
}
|
|
974
|
+
};
|
|
975
|
+
}
|
|
976
|
+
return {
|
|
977
|
+
resolve: r
|
|
978
|
+
};
|
|
979
|
+
}
|
|
980
|
+
function w(r) {
|
|
981
|
+
const d = f();
|
|
982
|
+
return V.getValue(r.id) === void 0 && Object.hasOwnProperty.call(r, "modelValue") && V.setValue(r.id, void 0, r.modelValue), d.resolve(r, V);
|
|
983
|
+
}
|
|
984
|
+
function k(r) {
|
|
985
|
+
const d = {};
|
|
986
|
+
return r && Object.entries(r).forEach(([v, P]) => {
|
|
987
|
+
d[v] = () => Array.isArray(P) ? P.map((x) => N(x)) : N(P);
|
|
988
|
+
}), d;
|
|
989
|
+
}
|
|
990
|
+
function h(r) {
|
|
991
|
+
return r.type ? r.type : r.fields ? "fieldset" : "form-group";
|
|
992
|
+
}
|
|
993
|
+
function j(r) {
|
|
994
|
+
const d = h(r);
|
|
995
|
+
let v = r.customClass;
|
|
996
|
+
v || (v = d === "form-group" ? e.layout : "col-12 px-0");
|
|
997
|
+
const {
|
|
998
|
+
fields: P,
|
|
999
|
+
customClass: x,
|
|
1000
|
+
...I
|
|
1001
|
+
} = r, $ = {
|
|
1002
|
+
...F(r, t, d)
|
|
1003
|
+
}, L = {
|
|
1004
|
+
...c(r, a, d)
|
|
1005
|
+
};
|
|
1006
|
+
return {
|
|
1007
|
+
props: {
|
|
1008
|
+
...{
|
|
1009
|
+
...I,
|
|
1010
|
+
customClass: v,
|
|
1011
|
+
...w(r)
|
|
1012
|
+
},
|
|
1013
|
+
key: r.id,
|
|
1014
|
+
ref: (U) => {
|
|
1015
|
+
if (U && r.id && !m.has(r.id)) {
|
|
1016
|
+
m.register(r.id, U);
|
|
1017
|
+
const q = {
|
|
1018
|
+
token: r.id,
|
|
1019
|
+
name: "component:ready",
|
|
1020
|
+
type: h(r),
|
|
1021
|
+
payloads: [R(U)],
|
|
1022
|
+
schema: r
|
|
1023
|
+
};
|
|
1024
|
+
t.emit("event", q);
|
|
1025
|
+
}
|
|
1026
|
+
},
|
|
1027
|
+
onVnodeUnmounted: (U) => {
|
|
1028
|
+
if (r.id && m.has(r.id)) {
|
|
1029
|
+
m.remove(r.id);
|
|
1030
|
+
const q = {
|
|
1031
|
+
token: r.id,
|
|
1032
|
+
name: "component:unmounted",
|
|
1033
|
+
type: h(r),
|
|
1034
|
+
payloads: [U],
|
|
1035
|
+
schema: r
|
|
1036
|
+
};
|
|
1037
|
+
t.emit("event", q);
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
},
|
|
1041
|
+
eventProps: $,
|
|
1042
|
+
callbackProps: L
|
|
1043
|
+
};
|
|
1044
|
+
}
|
|
1045
|
+
function O(r, d) {
|
|
1046
|
+
return Array.isArray(r) ? r.map((v) => d(v)) : d(r);
|
|
1047
|
+
}
|
|
1048
|
+
function N(r, d) {
|
|
1049
|
+
var L;
|
|
1050
|
+
const v = h(r), P = ue[v];
|
|
1051
|
+
if (r.id && o.set(r.id, r), !P)
|
|
1052
|
+
return null;
|
|
1053
|
+
const x = () => r.fields ? r.fields.map((A) => N(A)) : null, I = (A, G, U) => {
|
|
1054
|
+
let q;
|
|
1055
|
+
return U && U.length > 0 ? q = D(A, {
|
|
1056
|
+
...G
|
|
1057
|
+
}, U) : q = D(A, {
|
|
1058
|
+
...G
|
|
1059
|
+
}, null), q;
|
|
1060
|
+
}, $ = ((L = l.get(r.id)) == null ? void 0 : L.props) || {};
|
|
1061
|
+
return r.fields && r.fields.length > 0 ? I(P, $, [x()]) : r.slots ? I(P, $, [...Object.values(k(r.slots))]) : I(P, $);
|
|
1062
|
+
}
|
|
1063
|
+
function B(r) {
|
|
1064
|
+
const d = h(r);
|
|
1065
|
+
if (!ue[d])
|
|
1066
|
+
return;
|
|
1067
|
+
const {
|
|
1068
|
+
props: P,
|
|
1069
|
+
eventProps: x,
|
|
1070
|
+
callbackProps: I
|
|
1071
|
+
} = j(r), $ = ut[d], L = $ ? $.editorResolver : null, {
|
|
1072
|
+
componentEventProps: A,
|
|
1073
|
+
editorEventProps: G
|
|
1074
|
+
} = x, {
|
|
1075
|
+
componentCallbackProps: U,
|
|
1076
|
+
editorCallbackProps: q
|
|
1077
|
+
} = I;
|
|
1078
|
+
if (A && Object.keys(A).length > 0 && Object.assign(P, A), U && Object.keys(U).length > 0 && Object.assign(P, U), L && G && Object.keys(G).length > 0) {
|
|
1079
|
+
const S = L.resolve(r);
|
|
1080
|
+
Object.assign(S, G);
|
|
1081
|
+
}
|
|
1082
|
+
if (L && q && Object.keys(q).length > 0) {
|
|
1083
|
+
const S = L.resolve(r);
|
|
1084
|
+
Object.assign(S, q);
|
|
1085
|
+
}
|
|
1086
|
+
if (P && Object.keys(P).length > 0) {
|
|
1087
|
+
const S = l.get(r.id);
|
|
1088
|
+
S ? rt(S == null ? void 0 : S.props, P) : l.set(r.id, ge({
|
|
1089
|
+
props: P
|
|
1090
|
+
}));
|
|
1091
|
+
}
|
|
1092
|
+
!r.fields || !Array.isArray(r.fields) || r.fields.forEach((S) => B(S));
|
|
1093
|
+
}
|
|
1094
|
+
function Z(r) {
|
|
1095
|
+
const d = h(r);
|
|
1096
|
+
ue[d] && (z(r), !(!r.fields || !Array.isArray(r.fields)) && r.fields.forEach((P) => Z(P)));
|
|
1097
|
+
}
|
|
1098
|
+
function z(r) {
|
|
1099
|
+
const d = w(r);
|
|
1100
|
+
if (d && Object.keys(d).length > 0) {
|
|
1101
|
+
const v = l.get(r.id);
|
|
1102
|
+
if (!v)
|
|
1103
|
+
l.set(r.id, ge({
|
|
1104
|
+
props: d
|
|
1105
|
+
}));
|
|
1106
|
+
else {
|
|
1107
|
+
const P = {
|
|
1108
|
+
...v == null ? void 0 : v.props
|
|
1109
|
+
};
|
|
1110
|
+
Object.keys(d).forEach((x) => {
|
|
1111
|
+
P[x] = d[x];
|
|
1112
|
+
}), Object.assign(v == null ? void 0 : v.props, P);
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
ne(() => {
|
|
1117
|
+
}), le(() => e.formData, (r) => {
|
|
1118
|
+
g.value = r;
|
|
1119
|
+
}), le(() => g.value, (r) => {
|
|
1120
|
+
O(n.value, Z);
|
|
1121
|
+
}, {
|
|
1122
|
+
deep: !0
|
|
1123
|
+
});
|
|
1124
|
+
function E(r) {
|
|
1125
|
+
r && O(n.value, B);
|
|
1126
|
+
}
|
|
1127
|
+
le(() => e.fields, (r) => {
|
|
1128
|
+
o.clear(), m.clear(), g.value = e.formData || {}, l.clear(), n.value = r, E(r);
|
|
1129
|
+
}), E(e.fields);
|
|
1130
|
+
function M(r) {
|
|
1131
|
+
r.$forceUpdate && r.$forceUpdate();
|
|
1132
|
+
}
|
|
1133
|
+
function _(r) {
|
|
1134
|
+
return V.getValue(r);
|
|
1135
|
+
}
|
|
1136
|
+
function W() {
|
|
1137
|
+
return g.value;
|
|
439
1138
|
}
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
if (d && d.schema && d.schema.componentType) {
|
|
445
|
-
const { formColumns: F } = d.schema;
|
|
446
|
-
let k = B(F);
|
|
447
|
-
k = t == null ? void 0 : t.formSchemaUtils.getControlClassByFormUnifiedLayout(k, d.schema.id, e.schema), k = q(k, d.schema), l.appearance || (l.appearance = {}), l.appearance.class = k;
|
|
1139
|
+
function X(r, d) {
|
|
1140
|
+
V.setValue(r, void 0, d);
|
|
1141
|
+
const v = o.get(r);
|
|
1142
|
+
v && z(v);
|
|
448
1143
|
}
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
if (I != null && I.entityFieldNode && x) {
|
|
453
|
-
const E = t == null ? void 0 : t.designViewModelUtils, T = (t == null ? void 0 : t.formSchemaUtils).getViewModelIdByComponentId(x.belongedComponentId), S = E.getDgViewModel(T);
|
|
454
|
-
S.removeField([I.entityFieldNode.id]), S.addField(I.designViewModelField), d && S.changeField(I.entityFieldNode.id, { editor: { $type: d }, groupId: F, groupName: k });
|
|
1144
|
+
function J(r) {
|
|
1145
|
+
var d;
|
|
1146
|
+
return (d = l.get(r)) == null ? void 0 : d.props;
|
|
455
1147
|
}
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
const F = n;
|
|
460
|
-
if ((F.appearance && F.appearance.class || "").split(" ").includes("f-form-layout") && l.componentCategory === "input") {
|
|
461
|
-
const { label: T } = l;
|
|
462
|
-
let S;
|
|
463
|
-
const L = t == null ? void 0 : t.controlCreatorUtils;
|
|
464
|
-
return (x = l.bindingSourceContext) != null && x.entityFieldNode ? S = L.setFormFieldProperty((E = l.bindingSourceContext) == null ? void 0 : E.entityFieldNode, d == null ? void 0 : d.type) : (S = L.createFormGroupWithoutField(d == null ? void 0 : d.type), S.label = T), R(S), N(l, (V = S.editor) == null ? void 0 : V.type), S;
|
|
1148
|
+
function s(r, d) {
|
|
1149
|
+
const v = l.get(r);
|
|
1150
|
+
ot(v == null ? void 0 : v.props, d, i);
|
|
465
1151
|
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
function _() {
|
|
475
|
-
return !1;
|
|
476
|
-
}
|
|
477
|
-
function G(l) {
|
|
478
|
-
return new He(l, t).getPropertyConfig(n, e.componentInstance.value);
|
|
479
|
-
}
|
|
480
|
-
return {
|
|
481
|
-
canAccepts: f,
|
|
482
|
-
checkCanDeleteComponent: J,
|
|
483
|
-
checkCanMoveComponent: z,
|
|
484
|
-
getStyles: O,
|
|
485
|
-
getPropsConfig: G,
|
|
486
|
-
hideNestedPaddingInDesginerView: _,
|
|
487
|
-
onAcceptMovedChildElement: $,
|
|
488
|
-
onResolveNewComponentSchema: M,
|
|
489
|
-
moveInputBetweenComponent: D,
|
|
490
|
-
resolveFormGroupAppearance: R,
|
|
491
|
-
syncFieldToViewModel: N
|
|
492
|
-
};
|
|
493
|
-
}
|
|
494
|
-
const le = /* @__PURE__ */ ne({
|
|
495
|
-
name: "FResponseFormDesign",
|
|
496
|
-
directives: {
|
|
497
|
-
"area-response": ze
|
|
498
|
-
},
|
|
499
|
-
props: Ce,
|
|
500
|
-
emits: [],
|
|
501
|
-
setup(e, t) {
|
|
502
|
-
const n = A(), o = Y("design-item-context"), r = Y("designer-host-service"), m = Ke(o, r), y = ce(n, o, m);
|
|
503
|
-
ie(() => {
|
|
504
|
-
n.value.componentInstance = y;
|
|
505
|
-
}), t.expose(y.value);
|
|
506
|
-
const w = K(() => {
|
|
507
|
-
const h = e.customClass.split(" "), a = {
|
|
508
|
-
"drag-container": !0
|
|
509
|
-
};
|
|
510
|
-
return h.reduce((f, i) => (f[i] = !0, f), a), a;
|
|
1152
|
+
t.expose({
|
|
1153
|
+
componentManager: m,
|
|
1154
|
+
rerender: M,
|
|
1155
|
+
getProps: J,
|
|
1156
|
+
setProps: s,
|
|
1157
|
+
getControlValue: _,
|
|
1158
|
+
setControlValue: X,
|
|
1159
|
+
getValues: W
|
|
511
1160
|
});
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
1161
|
+
function y() {
|
|
1162
|
+
return b.value && ke(D("div", {
|
|
1163
|
+
class: u.value,
|
|
1164
|
+
style: e.customStyle
|
|
1165
|
+
}, [t.slots.default && t.slots.default(), n.value && n.value.length > 0 && O(n.value, N)]), [[Ie("area-response")]]);
|
|
1166
|
+
}
|
|
1167
|
+
function C() {
|
|
1168
|
+
return !b.value && n.value && n.value.length > 0 && O(n.value, N);
|
|
1169
|
+
}
|
|
1170
|
+
return () => e.visible ? y() || C() : null;
|
|
519
1171
|
}
|
|
520
|
-
}),
|
|
1172
|
+
}), St = {
|
|
1173
|
+
id: { type: String, default: "" },
|
|
1174
|
+
customClass: { type: String, default: "" },
|
|
1175
|
+
customStyle: { type: String, default: "" },
|
|
1176
|
+
/** 筛选组件配置器,具体配置项可查看各组件文档 */
|
|
1177
|
+
editor: { type: Object, default: {} },
|
|
1178
|
+
label: { type: String, default: "" },
|
|
1179
|
+
/** value is uncertain because type is uncertain, default value should not be set */
|
|
1180
|
+
modelValue: { type: [String, Boolean, Array, Number], default: null },
|
|
1181
|
+
// readonly: { type: Boolean, default: false },
|
|
1182
|
+
visible: { type: Boolean, default: !0 },
|
|
1183
|
+
required: { type: Boolean, default: !1 },
|
|
1184
|
+
showLabel: { type: Boolean, default: !0 },
|
|
1185
|
+
/**
|
|
1186
|
+
* visible相当于showLabel为true,none相当于showLabel为false
|
|
1187
|
+
*/
|
|
1188
|
+
showLabelType: { type: String, default: "visible" },
|
|
1189
|
+
type: { type: String, default: "input-group" },
|
|
1190
|
+
componentId: { type: String, default: "" },
|
|
1191
|
+
errors: { type: Object, default: null },
|
|
1192
|
+
fill: { type: Boolean, default: !1 }
|
|
1193
|
+
}, Gt = {}, zt = {}, { globalStorageKey: Lr } = Ve(), Zt = {
|
|
521
1194
|
id: { Type: String, default: "" },
|
|
522
1195
|
/** 是否自动完成 */
|
|
523
1196
|
autocomplete: { Type: String, default: "off" },
|
|
@@ -600,7 +1273,7 @@ const le = /* @__PURE__ */ ne({
|
|
|
600
1273
|
* 是否启用快捷键
|
|
601
1274
|
*/
|
|
602
1275
|
keyboard: { type: Boolean, default: !0 }
|
|
603
|
-
},
|
|
1276
|
+
}, $e = [
|
|
604
1277
|
{ key: "none", value: "无" },
|
|
605
1278
|
{ key: "cellNumber", value: "手机号" },
|
|
606
1279
|
{ key: "tel", value: "座机号/传真号" },
|
|
@@ -612,7 +1285,7 @@ const le = /* @__PURE__ */ ne({
|
|
|
612
1285
|
{ key: "subjectCode", value: "10位数字会计科目代码" },
|
|
613
1286
|
{ key: "custom", value: "自定义" }
|
|
614
1287
|
];
|
|
615
|
-
function
|
|
1288
|
+
function Wt(e) {
|
|
616
1289
|
switch (e) {
|
|
617
1290
|
case "none":
|
|
618
1291
|
return "";
|
|
@@ -639,22 +1312,22 @@ function ot(e) {
|
|
|
639
1312
|
}
|
|
640
1313
|
return "";
|
|
641
1314
|
}
|
|
642
|
-
function
|
|
1315
|
+
function Jt(e) {
|
|
643
1316
|
var t;
|
|
644
|
-
return "请输入正确的" + ((t =
|
|
1317
|
+
return "请输入正确的" + ((t = $e.find((n) => n.key === e)) == null ? void 0 : t.value);
|
|
645
1318
|
}
|
|
646
|
-
const
|
|
1319
|
+
const _t = {
|
|
647
1320
|
convertTo: (e, t, n, o) => {
|
|
648
|
-
e.editor.formatValidation || (e.editor.formatValidation = { type: "none" }), e.editor.formatValidation.type = n, e.editor.formatValidation.expression =
|
|
1321
|
+
e.editor.formatValidation || (e.editor.formatValidation = { type: "none" }), e.editor.formatValidation.type = n, e.editor.formatValidation.expression = Wt(n), e.editor.formatValidation.message = Jt(n);
|
|
649
1322
|
},
|
|
650
1323
|
convertFrom: (e, t, n) => e.editor.formatValidation ? t === "type" ? e.editor.formatValidation[t] || "none" : e.editor.formatValidation[t] : "none"
|
|
651
|
-
},
|
|
1324
|
+
}, Fe = {
|
|
652
1325
|
convertTo: (e, t, n, o) => {
|
|
653
1326
|
e.editor.formatValidation || (e.editor.formatValidation = { type: "none" }), e.editor.formatValidation[t] = n;
|
|
654
1327
|
},
|
|
655
1328
|
convertFrom: (e, t, n) => e.editor.formatValidation ? e.editor.formatValidation[t] : e.editor[t]
|
|
656
1329
|
};
|
|
657
|
-
class
|
|
1330
|
+
class Xt extends tt {
|
|
658
1331
|
constructor(t, n) {
|
|
659
1332
|
super(t, n);
|
|
660
1333
|
}
|
|
@@ -662,11 +1335,11 @@ class at extends _e {
|
|
|
662
1335
|
return super.getPropertyConfig(t, n), this.propertyConfig.categories.formatValidation = this.getFormatValidation(t), this.propertyConfig;
|
|
663
1336
|
}
|
|
664
1337
|
getEditorProperties(t) {
|
|
665
|
-
var o,
|
|
1338
|
+
var o, a;
|
|
666
1339
|
let n;
|
|
667
1340
|
if (((o = t == null ? void 0 : t.binding) == null ? void 0 : o.type) === "Form") {
|
|
668
1341
|
const m = this.schemaService.getFieldByIDAndVMID(t.binding.field, this.viewModelId);
|
|
669
|
-
(
|
|
1342
|
+
(a = m == null ? void 0 : m.schemaField) != null && a.type && (n = m.schemaField.type.length);
|
|
670
1343
|
}
|
|
671
1344
|
return this.getComponentConfig(t, {}, {
|
|
672
1345
|
maxLength: {
|
|
@@ -704,11 +1377,11 @@ class at extends _e {
|
|
|
704
1377
|
});
|
|
705
1378
|
}
|
|
706
1379
|
getGridFieldEdtiorProperties(t) {
|
|
707
|
-
var o,
|
|
1380
|
+
var o, a;
|
|
708
1381
|
let n;
|
|
709
1382
|
if (((o = t == null ? void 0 : t.binding) == null ? void 0 : o.type) === "Form") {
|
|
710
1383
|
const m = this.schemaService.getFieldByIDAndVMID(t.binding.field, this.viewModelId);
|
|
711
|
-
(
|
|
1384
|
+
(a = m == null ? void 0 : m.schemaField) != null && a.type && (n = m.schemaField.type.length);
|
|
712
1385
|
}
|
|
713
1386
|
return this.getComponentConfig(t, {}, {
|
|
714
1387
|
maxLength: {
|
|
@@ -745,7 +1418,7 @@ class at extends _e {
|
|
|
745
1418
|
});
|
|
746
1419
|
}
|
|
747
1420
|
getFormatValidation(t) {
|
|
748
|
-
var o,
|
|
1421
|
+
var o, a, m, g;
|
|
749
1422
|
const n = {
|
|
750
1423
|
title: "输入格式校验",
|
|
751
1424
|
description: "输入校验",
|
|
@@ -762,152 +1435,152 @@ class at extends _e {
|
|
|
762
1435
|
valueField: "key",
|
|
763
1436
|
idField: "key",
|
|
764
1437
|
editable: !1,
|
|
765
|
-
data:
|
|
1438
|
+
data: $e
|
|
766
1439
|
},
|
|
767
1440
|
refreshPanelAfterChanged: !0,
|
|
768
|
-
$converter:
|
|
1441
|
+
$converter: _t,
|
|
769
1442
|
parentPropertyID: "formatValidation"
|
|
770
1443
|
}
|
|
771
1444
|
}
|
|
772
1445
|
};
|
|
773
|
-
return (
|
|
1446
|
+
return (a = t.editor.formatValidation) != null && a.type && ((m = t.editor.formatValidation) == null ? void 0 : m.type) !== "none" && (n.properties.message = {
|
|
774
1447
|
title: "输入错误提示",
|
|
775
1448
|
type: "string",
|
|
776
1449
|
description: "输入错误提示",
|
|
777
|
-
$converter:
|
|
1450
|
+
$converter: Fe,
|
|
778
1451
|
parentPropertyID: "formatValidation"
|
|
779
|
-
}), ((
|
|
1452
|
+
}), ((g = t.editor.formatValidation) == null ? void 0 : g.type) === "custom" && (n.properties.expression = {
|
|
780
1453
|
title: "匹配正则",
|
|
781
1454
|
type: "string",
|
|
782
1455
|
description: "匹配正则",
|
|
783
|
-
$converter:
|
|
1456
|
+
$converter: Fe,
|
|
784
1457
|
parentPropertyID: "formatValidation"
|
|
785
1458
|
}), n;
|
|
786
1459
|
}
|
|
787
1460
|
}
|
|
788
|
-
function
|
|
1461
|
+
function Qt(e, t) {
|
|
789
1462
|
const n = e.schema;
|
|
790
|
-
function o(
|
|
791
|
-
return new
|
|
1463
|
+
function o(a, m) {
|
|
1464
|
+
return new Xt(a, t).getPropertyConfig(n, m);
|
|
792
1465
|
}
|
|
793
1466
|
return { getPropsConfig: o };
|
|
794
1467
|
}
|
|
795
|
-
const
|
|
1468
|
+
const Yt = /* @__PURE__ */ ee({
|
|
796
1469
|
name: "FInputGroupDesign",
|
|
797
|
-
props:
|
|
1470
|
+
props: Zt,
|
|
798
1471
|
emits: ["updateExtendInfo", "clear", "valueChange", "clickHandle", "blurHandle", "focusHandle", "enterHandle", "iconMouseEnter", "iconMouseLeave", "keyupHandle", "keydownHandle", "inputClick"],
|
|
799
1472
|
setup(e, t) {
|
|
800
|
-
const n =
|
|
1473
|
+
const n = R(e.modelValue), o = R(e.modelValue), a = Ke(e, t, n, o), {
|
|
801
1474
|
inputGroupClass: m,
|
|
802
|
-
inputType:
|
|
803
|
-
inputGroupStyle:
|
|
804
|
-
} =
|
|
805
|
-
return
|
|
806
|
-
|
|
807
|
-
}), t.expose(
|
|
1475
|
+
inputType: g,
|
|
1476
|
+
inputGroupStyle: V
|
|
1477
|
+
} = a, T = R(), l = Y("designer-host-service"), b = Y("design-item-context"), i = Qt(b, l), c = ce(T, b, i), F = H(() => e.showType === "password" ? "password" : "");
|
|
1478
|
+
return ne(() => {
|
|
1479
|
+
T.value.componentInstance = c;
|
|
1480
|
+
}), t.expose(c.value), () => D("div", {
|
|
808
1481
|
id: "inputGroup",
|
|
809
|
-
ref:
|
|
1482
|
+
ref: T,
|
|
810
1483
|
class: m.value,
|
|
811
|
-
style:
|
|
812
|
-
}, [
|
|
1484
|
+
style: V.value
|
|
1485
|
+
}, [D("input", {
|
|
813
1486
|
class: "form-control",
|
|
814
1487
|
type: e.showType,
|
|
815
1488
|
placeholder: e.placeholder,
|
|
816
|
-
value:
|
|
817
|
-
}, null), e.showType === "password" && e.enableViewPassword &&
|
|
1489
|
+
value: F.value
|
|
1490
|
+
}, null), e.showType === "password" && e.enableViewPassword && D("span", {
|
|
818
1491
|
class: "input-group-append"
|
|
819
|
-
}, [
|
|
1492
|
+
}, [D("span", {
|
|
820
1493
|
class: "input-group-text"
|
|
821
|
-
}, [
|
|
1494
|
+
}, [D("span", {
|
|
822
1495
|
class: "f-icon f-icon-eye"
|
|
823
1496
|
}, null)])])]);
|
|
824
1497
|
}
|
|
825
1498
|
});
|
|
826
|
-
function
|
|
827
|
-
function e(
|
|
828
|
-
const
|
|
829
|
-
return
|
|
1499
|
+
function Ht() {
|
|
1500
|
+
function e(g, V) {
|
|
1501
|
+
const T = zt[g];
|
|
1502
|
+
return T ? T(V) : {};
|
|
830
1503
|
}
|
|
831
|
-
function t(
|
|
832
|
-
return
|
|
1504
|
+
function t(g) {
|
|
1505
|
+
return Gt[g] || Yt;
|
|
833
1506
|
}
|
|
834
|
-
function n(
|
|
1507
|
+
function n(g) {
|
|
835
1508
|
}
|
|
836
|
-
function o(
|
|
1509
|
+
function o(g) {
|
|
837
1510
|
}
|
|
838
|
-
function
|
|
1511
|
+
function a(g) {
|
|
839
1512
|
}
|
|
840
|
-
function m(
|
|
1513
|
+
function m(g) {
|
|
841
1514
|
}
|
|
842
|
-
return { getChangeFunctionName: n, getClearFunctionName: o, resolveEditorProps: e, resolveEditorType: t, getMousedownFunctionName:
|
|
1515
|
+
return { getChangeFunctionName: n, getClearFunctionName: o, resolveEditorProps: e, resolveEditorType: t, getMousedownFunctionName: a, getMouseupFunctionName: m };
|
|
843
1516
|
}
|
|
844
|
-
function
|
|
845
|
-
function t(
|
|
1517
|
+
function Kt(e = {}) {
|
|
1518
|
+
function t(l, b, i, c) {
|
|
846
1519
|
if (typeof i == "number")
|
|
847
|
-
return
|
|
1520
|
+
return c[l].length === i;
|
|
848
1521
|
if (typeof i == "object") {
|
|
849
|
-
const
|
|
850
|
-
if (
|
|
851
|
-
return Number(
|
|
852
|
-
if (
|
|
853
|
-
return Number(
|
|
854
|
-
if (
|
|
855
|
-
return Number(
|
|
1522
|
+
const F = Object.keys(i)[0], u = i[F];
|
|
1523
|
+
if (F === "not")
|
|
1524
|
+
return Number(c[l].length) !== Number(u);
|
|
1525
|
+
if (F === "moreThan")
|
|
1526
|
+
return Number(c[l].length) >= Number(u);
|
|
1527
|
+
if (F === "lessThan")
|
|
1528
|
+
return Number(c[l].length) <= Number(u);
|
|
856
1529
|
}
|
|
857
1530
|
return !1;
|
|
858
1531
|
}
|
|
859
|
-
function n(
|
|
860
|
-
return
|
|
1532
|
+
function n(l, b, i, c) {
|
|
1533
|
+
return c[l] && c[l].propertyValue && String(c[l].propertyValue.value) === String(i);
|
|
861
1534
|
}
|
|
862
1535
|
const o = /* @__PURE__ */ new Map([
|
|
863
1536
|
["length", t],
|
|
864
1537
|
["getProperty", n]
|
|
865
1538
|
]);
|
|
866
|
-
Object.keys(e).reduce((
|
|
867
|
-
function
|
|
868
|
-
const i =
|
|
869
|
-
return typeof
|
|
870
|
-
if (
|
|
871
|
-
return { target: i, operator: "length", param: null, value:
|
|
872
|
-
const
|
|
873
|
-
return { target: i, operator: "getProperty", param:
|
|
1539
|
+
Object.keys(e).reduce((l, b) => (l.set(b, e[b]), l), o);
|
|
1540
|
+
function a(l, b) {
|
|
1541
|
+
const i = l;
|
|
1542
|
+
return typeof b == "number" ? [{ target: i, operator: "length", param: null, value: Number(b) }] : typeof b == "boolean" ? [{ target: i, operator: "getProperty", param: l, value: !!b }] : typeof b == "object" ? Object.keys(b).map((c) => {
|
|
1543
|
+
if (c === "length")
|
|
1544
|
+
return { target: i, operator: "length", param: null, value: b[c] };
|
|
1545
|
+
const F = c, u = b[c];
|
|
1546
|
+
return { target: i, operator: "getProperty", param: F, value: u };
|
|
874
1547
|
}) : [];
|
|
875
1548
|
}
|
|
876
|
-
function m(
|
|
877
|
-
return Object.keys(
|
|
878
|
-
const
|
|
879
|
-
return i.push(...
|
|
1549
|
+
function m(l) {
|
|
1550
|
+
return Object.keys(l).reduce((i, c) => {
|
|
1551
|
+
const F = a(c, l[c]);
|
|
1552
|
+
return i.push(...F), i;
|
|
880
1553
|
}, []);
|
|
881
1554
|
}
|
|
882
|
-
function
|
|
883
|
-
if (o.has(
|
|
884
|
-
const i = o.get(
|
|
885
|
-
return i && i(
|
|
1555
|
+
function g(l, b) {
|
|
1556
|
+
if (o.has(l.operator)) {
|
|
1557
|
+
const i = o.get(l.operator);
|
|
1558
|
+
return i && i(l.target, l.param, l.value, b) || !1;
|
|
886
1559
|
}
|
|
887
1560
|
return !1;
|
|
888
1561
|
}
|
|
889
|
-
function
|
|
890
|
-
return m(
|
|
1562
|
+
function V(l, b) {
|
|
1563
|
+
return m(l).reduce((F, u) => F && g(u, b), !0);
|
|
891
1564
|
}
|
|
892
|
-
function
|
|
893
|
-
const i = Object.keys(
|
|
894
|
-
return
|
|
1565
|
+
function T(l, b) {
|
|
1566
|
+
const i = Object.keys(l), c = i.includes("allOf"), F = i.includes("anyOf"), u = c || F, k = (u ? l[u ? c ? "allOf" : "anyOf" : "allOf"] : [l]).map((j) => V(j, b));
|
|
1567
|
+
return c ? !k.includes(!1) : k.includes(!0);
|
|
895
1568
|
}
|
|
896
|
-
return { parseValueSchema:
|
|
1569
|
+
return { parseValueSchema: T };
|
|
897
1570
|
}
|
|
898
|
-
const
|
|
1571
|
+
const en = {
|
|
899
1572
|
convertTo: (e, t, n, o) => {
|
|
900
1573
|
e.appearance || (e.appearance = {}), e.appearance[t] = n;
|
|
901
1574
|
},
|
|
902
1575
|
convertFrom: (e, t, n) => e.appearance ? e.appearance[t] : e[t]
|
|
903
|
-
},
|
|
1576
|
+
}, tn = {
|
|
904
1577
|
convertFrom: (e, t, n) => e.buttons && e.buttons.length ? `共 ${e.buttons.length} 项` : "无"
|
|
905
|
-
},
|
|
1578
|
+
}, nn = {
|
|
906
1579
|
convertTo: (e, t, n, o) => {
|
|
907
1580
|
e.editor && (e.editor[t] = n);
|
|
908
1581
|
},
|
|
909
1582
|
convertFrom: (e, t, n) => e.editor && Object.prototype.hasOwnProperty.call(e.editor, t) ? e.editor[t] : e[t]
|
|
910
|
-
},
|
|
1583
|
+
}, on = {
|
|
911
1584
|
button: { type: "button", name: "按钮" },
|
|
912
1585
|
"response-toolbar": { type: "response-toolbar", name: "工具栏" },
|
|
913
1586
|
"response-toolbar-item": { type: "response-toolbar-item", name: "按钮" },
|
|
@@ -961,19 +1634,24 @@ const pt = {
|
|
|
961
1634
|
"discussion-list": { type: "discussion-list", name: "评论列表" },
|
|
962
1635
|
comment: { type: "comment", name: "评论区" },
|
|
963
1636
|
"rich-text-editor": { type: "rich-text-editor", name: "富文本", icon: "rich-text-box" },
|
|
964
|
-
calendar: { type: "calendar", name: "日历", icon: "date-picker" }
|
|
965
|
-
|
|
1637
|
+
calendar: { type: "calendar", name: "日历", icon: "date-picker" },
|
|
1638
|
+
wizard: { type: "wizard", name: "向导", icon: "wizard" },
|
|
1639
|
+
"wizard-page": { type: "wizard-page", name: "向导页", icon: "wizard" },
|
|
1640
|
+
"wizard-page-detail": { type: "wizard-page-detail", name: "向导详情", icon: "wizard" },
|
|
1641
|
+
step: { type: "step", name: "步骤条", icon: "step" },
|
|
1642
|
+
"dynamic-form": { type: "dynamic-form", name: "动态表单" }
|
|
1643
|
+
}, rn = {
|
|
966
1644
|
convertFrom: (e, t, n) => {
|
|
967
|
-
var
|
|
1645
|
+
var a;
|
|
968
1646
|
const o = e.editor && e.editor[t] ? e.editor[t] : e[t];
|
|
969
|
-
return ((
|
|
1647
|
+
return ((a = on[o]) == null ? void 0 : a.name) || o;
|
|
970
1648
|
}
|
|
971
|
-
},
|
|
1649
|
+
}, an = {
|
|
972
1650
|
convertTo: (e, t, n, o) => {
|
|
973
1651
|
e[t] = e[t];
|
|
974
1652
|
},
|
|
975
1653
|
convertFrom: (e, t, n) => e.editor ? n.getRealEditorType(e.editor.type) : ""
|
|
976
|
-
},
|
|
1654
|
+
}, sn = {
|
|
977
1655
|
convertTo: (e, t, n, o) => {
|
|
978
1656
|
(e.type === "data-grid-column" || e.type === "tree-grid-column") && (e.formatter ? e.formatter[t] = n : e.formatter = {
|
|
979
1657
|
[t]: n
|
|
@@ -1001,10 +1679,12 @@ const pt = {
|
|
|
1001
1679
|
return e.formatter.customFormat;
|
|
1002
1680
|
if (t === "type")
|
|
1003
1681
|
return e.formatter.type || "none";
|
|
1682
|
+
if (t === "customFormat")
|
|
1683
|
+
return e.formmater.customFormat;
|
|
1004
1684
|
}
|
|
1005
1685
|
return "none";
|
|
1006
1686
|
}
|
|
1007
|
-
},
|
|
1687
|
+
}, ln = {
|
|
1008
1688
|
convertTo: (e, t, n, o) => {
|
|
1009
1689
|
e.command ? e.command[t] = n : e.command = {
|
|
1010
1690
|
[t]: n
|
|
@@ -1022,38 +1702,26 @@ const pt = {
|
|
|
1022
1702
|
]), t === "enableType" && n === "custom" && (e.command.enable = !0, e.command.commands = [
|
|
1023
1703
|
{
|
|
1024
1704
|
value: "add",
|
|
1025
|
-
text:
|
|
1026
|
-
en: "add",
|
|
1027
|
-
"zh-CHS": "增加",
|
|
1028
|
-
"zh-CHT": "增加"
|
|
1029
|
-
},
|
|
1705
|
+
text: "增加",
|
|
1030
1706
|
type: "link"
|
|
1031
1707
|
},
|
|
1032
1708
|
{
|
|
1033
1709
|
value: "edit",
|
|
1034
|
-
text:
|
|
1035
|
-
en: "edit",
|
|
1036
|
-
"zh-CHS": "编辑",
|
|
1037
|
-
"zh-CHT": "編輯"
|
|
1038
|
-
},
|
|
1710
|
+
text: "编辑",
|
|
1039
1711
|
type: "danger"
|
|
1040
1712
|
},
|
|
1041
1713
|
{
|
|
1042
1714
|
value: "remove",
|
|
1043
|
-
text:
|
|
1044
|
-
en: "remove",
|
|
1045
|
-
"zh-CHS": "删除",
|
|
1046
|
-
"zh-CHT": "刪除"
|
|
1047
|
-
},
|
|
1715
|
+
text: "删除",
|
|
1048
1716
|
type: "remove"
|
|
1049
1717
|
}
|
|
1050
1718
|
]), t === "enableType" && n === "unable" && (e.command.enable = !1);
|
|
1051
1719
|
},
|
|
1052
1720
|
convertFrom: (e, t, n) => {
|
|
1053
|
-
var o,
|
|
1721
|
+
var o, a;
|
|
1054
1722
|
if (e.command) {
|
|
1055
1723
|
if (t === "enableType") {
|
|
1056
|
-
const m = (
|
|
1724
|
+
const m = (a = (o = e.command) == null ? void 0 : o.commands) == null ? void 0 : a.find((g) => g.command === "edit" && g.type === "primary");
|
|
1057
1725
|
return e.command.enable ? m ? "default" : "custom" : "unable";
|
|
1058
1726
|
}
|
|
1059
1727
|
if (t === "commands")
|
|
@@ -1062,10 +1730,12 @@ const pt = {
|
|
|
1062
1730
|
return e.command.formatter;
|
|
1063
1731
|
if (t === "count")
|
|
1064
1732
|
return e.command.count;
|
|
1733
|
+
if (t === "columnWidth")
|
|
1734
|
+
return e.command.columnWidth || 150;
|
|
1065
1735
|
}
|
|
1066
1736
|
return "";
|
|
1067
1737
|
}
|
|
1068
|
-
},
|
|
1738
|
+
}, cn = {
|
|
1069
1739
|
convertTo: (e, t, n, o) => {
|
|
1070
1740
|
e.column ? e.column[t] = n : e.column = {
|
|
1071
1741
|
[t]: n
|
|
@@ -1080,7 +1750,7 @@ const pt = {
|
|
|
1080
1750
|
}
|
|
1081
1751
|
return "";
|
|
1082
1752
|
}
|
|
1083
|
-
},
|
|
1753
|
+
}, un = {
|
|
1084
1754
|
convertTo: (e, t, n, o) => {
|
|
1085
1755
|
e.summary ? e.summary[t] = n : e.summary = {
|
|
1086
1756
|
[t]: n
|
|
@@ -1089,8 +1759,11 @@ const pt = {
|
|
|
1089
1759
|
groupFields: []
|
|
1090
1760
|
});
|
|
1091
1761
|
},
|
|
1092
|
-
convertFrom: (e, t, n) =>
|
|
1093
|
-
|
|
1762
|
+
convertFrom: (e, t, n) => {
|
|
1763
|
+
var o;
|
|
1764
|
+
return t === "customSummaryStyle" ? e.summary.customSummaryStyle : t === "position" ? ((o = e.summary) == null ? void 0 : o[t]) || "bottom" : e.summary && t === "enable" ? e.summary.enable : e.type === "data-grid-column" ? e.enableSummary === void 0 ? !1 : e.enableSummary : "";
|
|
1765
|
+
}
|
|
1766
|
+
}, dn = {
|
|
1094
1767
|
convertTo: (e, t, n, o) => {
|
|
1095
1768
|
e.group ? e.group[t] = n : e.group = {
|
|
1096
1769
|
[t]: n
|
|
@@ -1108,7 +1781,7 @@ const pt = {
|
|
|
1108
1781
|
return e.group.showSummary;
|
|
1109
1782
|
}
|
|
1110
1783
|
}
|
|
1111
|
-
},
|
|
1784
|
+
}, pn = {
|
|
1112
1785
|
convertFrom: (e, t) => e.binding ? e.binding.path : "",
|
|
1113
1786
|
convertTo: (e, t, n) => {
|
|
1114
1787
|
if (n && n.length > 0) {
|
|
@@ -1116,53 +1789,53 @@ const pt = {
|
|
|
1116
1789
|
e.binding || (e.binding = {}), e.binding.type = "Form", e.binding.path = o.bindingField, e.binding.field = o.id, e.binding.fullPath = o.path, e.path = o.bindingPath;
|
|
1117
1790
|
}
|
|
1118
1791
|
}
|
|
1119
|
-
},
|
|
1792
|
+
}, mn = {
|
|
1120
1793
|
convertTo: (e, t, n, o) => {
|
|
1121
|
-
e.pagination || (e.pagination = {}), e.pagination[t] = n;
|
|
1794
|
+
e.pagination || (e.pagination = {}), t === "sizeLimits" ? e.pagination.sizeLimits = n.split(",") : e.pagination[t] = n;
|
|
1122
1795
|
},
|
|
1123
|
-
convertFrom: (e, t, n) => e.pagination ? e.pagination[t] : e[t]
|
|
1124
|
-
},
|
|
1796
|
+
convertFrom: (e, t, n) => e.pagination ? t === "sizeLimits" ? e.pagination.sizeLimits.join(",") : e.pagination[t] : e[t]
|
|
1797
|
+
}, fn = {
|
|
1125
1798
|
convertTo: (e, t, n, o) => {
|
|
1126
1799
|
e.rowNumber || (e.rowNumber = {}), e.rowNumber[t] = n;
|
|
1127
1800
|
},
|
|
1128
1801
|
convertFrom: (e, t, n) => e.rowNumber ? e.rowNumber[t] : e[t]
|
|
1129
|
-
},
|
|
1802
|
+
}, yn = {
|
|
1130
1803
|
convertTo: (e, t, n, o) => {
|
|
1131
1804
|
e.selection || (e.selection = {}), e.selection[t] = n;
|
|
1132
1805
|
},
|
|
1133
1806
|
convertFrom: (e, t, n) => {
|
|
1134
|
-
var o,
|
|
1135
|
-
return t === "showCheckbox" ? (o = e.selection) != null && o.multiSelect ? !0 : (
|
|
1807
|
+
var o, a;
|
|
1808
|
+
return t === "showCheckbox" ? (o = e.selection) != null && o.multiSelect ? !0 : (a = e.selection) == null ? void 0 : a.showCheckbox : e.selection ? e.selection[t] : e[t];
|
|
1136
1809
|
}
|
|
1137
|
-
},
|
|
1810
|
+
}, gn = {
|
|
1138
1811
|
convertFrom: (e, t, n) => e[t] && e[t].length ? `共 ${e[t].length} 项` : ""
|
|
1139
|
-
},
|
|
1812
|
+
}, bn = {
|
|
1140
1813
|
convertFrom: (e, t) => e[t] || "",
|
|
1141
1814
|
convertTo: (e, t, n) => {
|
|
1142
1815
|
e[t] = n;
|
|
1143
1816
|
}
|
|
1144
|
-
},
|
|
1817
|
+
}, vn = {
|
|
1145
1818
|
convertTo: (e, t, n, o) => {
|
|
1146
1819
|
e.size || (e.size = {}), e.size[t] = n;
|
|
1147
1820
|
},
|
|
1148
1821
|
convertFrom: (e, t, n) => e.size ? e.size[t] : e[t]
|
|
1149
|
-
},
|
|
1822
|
+
}, hn = {
|
|
1150
1823
|
convertFrom: (e, t, n) => {
|
|
1151
|
-
var o,
|
|
1152
|
-
return (o = e.formatter) != null && o.data && t === "formatterEnumData" && !e.formatterEnumData ? (
|
|
1824
|
+
var o, a;
|
|
1825
|
+
return (o = e.formatter) != null && o.data && t === "formatterEnumData" && !e.formatterEnumData ? (a = e.formatter) == null ? void 0 : a.data : e.formatterEnumData;
|
|
1153
1826
|
}
|
|
1154
|
-
},
|
|
1827
|
+
}, Cn = {
|
|
1155
1828
|
convertTo: (e, t, n, o) => {
|
|
1156
1829
|
e.sort || (e.sort = {}), e.sort[t] = n;
|
|
1157
1830
|
},
|
|
1158
1831
|
convertFrom: (e, t, n) => {
|
|
1159
|
-
var o,
|
|
1832
|
+
var o, a;
|
|
1160
1833
|
if (t === "mode")
|
|
1161
1834
|
return ((o = e.sort) == null ? void 0 : o.mode) || "client";
|
|
1162
1835
|
if (t === "multiSort")
|
|
1163
|
-
return !!((
|
|
1836
|
+
return !!((a = e.sort) != null && a.multiSort);
|
|
1164
1837
|
}
|
|
1165
|
-
},
|
|
1838
|
+
}, Fn = {
|
|
1166
1839
|
convertTo: (e, t, n, o) => {
|
|
1167
1840
|
e.filter || (e.filter = {}), e.filter[t] = n;
|
|
1168
1841
|
},
|
|
@@ -1171,7 +1844,7 @@ const pt = {
|
|
|
1171
1844
|
if (t === "mode")
|
|
1172
1845
|
return ((o = e.filter) == null ? void 0 : o.mode) || "client";
|
|
1173
1846
|
}
|
|
1174
|
-
},
|
|
1847
|
+
}, Tn = {
|
|
1175
1848
|
convertTo: (e, t, n, o) => {
|
|
1176
1849
|
e.rowOption ? e.rowOption[t] = n : e.rowOption = {
|
|
1177
1850
|
[t]: n
|
|
@@ -1183,10 +1856,12 @@ const pt = {
|
|
|
1183
1856
|
return e.rowOption.customRowStyle;
|
|
1184
1857
|
if (t === "customCellStyle")
|
|
1185
1858
|
return e.rowOption.customCellStyle;
|
|
1859
|
+
if (t === "height")
|
|
1860
|
+
return e.rowOption.height;
|
|
1186
1861
|
}
|
|
1187
1862
|
return "";
|
|
1188
1863
|
}
|
|
1189
|
-
},
|
|
1864
|
+
}, wn = {
|
|
1190
1865
|
convertTo: (e, t, n, o) => {
|
|
1191
1866
|
(e.type === "data-grid-column" || e.type === "tree-grid-column") && (e[t] = n, t === "columnTemplateType" && n === "hyperlink" && (e.onClickLinkCommand ? e.columnTemplate = `
|
|
1192
1867
|
<span class="f-pretend-link f-cursor-pointer"
|
|
@@ -1199,31 +1874,31 @@ const pt = {
|
|
|
1199
1874
|
},
|
|
1200
1875
|
convertFrom: (e, t, n) => t === "columnTemplate" ? e.columnTemplate : t === "columnTemplateType" ? e.columnTemplateType ? e.columnTemplateType || "default" : e.columnTemplate && !e.onClickLinkCommand ? "custom" : e.columnTemplate && e.onClickLinkCommand ? "hyperlink" : "default" : ""
|
|
1201
1876
|
};
|
|
1202
|
-
function
|
|
1877
|
+
function kn(e, t, n) {
|
|
1203
1878
|
const o = /* @__PURE__ */ new Map([
|
|
1204
|
-
["/converter/appearance.converter",
|
|
1205
|
-
["/converter/buttons.converter",
|
|
1206
|
-
["/converter/property-editor.converter",
|
|
1207
|
-
["/converter/items-count.converter",
|
|
1208
|
-
["/converter/type.converter",
|
|
1209
|
-
["/converter/change-editor.converter",
|
|
1210
|
-
["/converter/change-formatter.converter",
|
|
1211
|
-
["/converter/column-command.converter",
|
|
1212
|
-
["/converter/column-option.converter",
|
|
1213
|
-
["/converter/summary.converter",
|
|
1214
|
-
["/converter/group.converter",
|
|
1215
|
-
["/converter/form-group-label.converter",
|
|
1216
|
-
["/converter/field-selector.converter",
|
|
1217
|
-
["/converter/pagination.converter",
|
|
1218
|
-
["/converter/row-number.converter",
|
|
1219
|
-
["/converter/grid-selection.converter",
|
|
1220
|
-
["/converter/size.converter",
|
|
1221
|
-
["/converter/change-formatter-enum.converter",
|
|
1222
|
-
["/converter/grid-sort.converter",
|
|
1223
|
-
["/converter/grid-filter.converter",
|
|
1224
|
-
["/converter/row-option.converter",
|
|
1225
|
-
["/converter/change-formatter-type.converter",
|
|
1226
|
-
]),
|
|
1879
|
+
["/converter/appearance.converter", en],
|
|
1880
|
+
["/converter/buttons.converter", tn],
|
|
1881
|
+
["/converter/property-editor.converter", nn],
|
|
1882
|
+
["/converter/items-count.converter", gn],
|
|
1883
|
+
["/converter/type.converter", rn],
|
|
1884
|
+
["/converter/change-editor.converter", an],
|
|
1885
|
+
["/converter/change-formatter.converter", sn],
|
|
1886
|
+
["/converter/column-command.converter", ln],
|
|
1887
|
+
["/converter/column-option.converter", cn],
|
|
1888
|
+
["/converter/summary.converter", un],
|
|
1889
|
+
["/converter/group.converter", dn],
|
|
1890
|
+
["/converter/form-group-label.converter", bn],
|
|
1891
|
+
["/converter/field-selector.converter", pn],
|
|
1892
|
+
["/converter/pagination.converter", mn],
|
|
1893
|
+
["/converter/row-number.converter", fn],
|
|
1894
|
+
["/converter/grid-selection.converter", yn],
|
|
1895
|
+
["/converter/size.converter", vn],
|
|
1896
|
+
["/converter/change-formatter-enum.converter", hn],
|
|
1897
|
+
["/converter/grid-sort.converter", Cn],
|
|
1898
|
+
["/converter/grid-filter.converter", Fn],
|
|
1899
|
+
["/converter/row-option.converter", Tn],
|
|
1900
|
+
["/converter/change-formatter-type.converter", wn]
|
|
1901
|
+
]), a = /* @__PURE__ */ new Map([
|
|
1227
1902
|
["string", { type: "input-group", enableClear: !1 }],
|
|
1228
1903
|
["boolean", {
|
|
1229
1904
|
type: "combo-list",
|
|
@@ -1247,186 +1922,186 @@ function Nt(e, t, n) {
|
|
|
1247
1922
|
["array", { type: "button-edit" }],
|
|
1248
1923
|
["number", { type: "number-spinner", placeholder: "" }],
|
|
1249
1924
|
["events-editor", { type: "events-editor", hide: !0 }]
|
|
1250
|
-
]), m =
|
|
1251
|
-
function
|
|
1252
|
-
return () => m.parseValueSchema(
|
|
1253
|
-
}
|
|
1254
|
-
function
|
|
1255
|
-
return
|
|
1256
|
-
}
|
|
1257
|
-
function
|
|
1258
|
-
return
|
|
1259
|
-
}
|
|
1260
|
-
function
|
|
1261
|
-
const
|
|
1262
|
-
return typeof
|
|
1263
|
-
}
|
|
1264
|
-
function
|
|
1265
|
-
return Object.keys(
|
|
1266
|
-
const
|
|
1267
|
-
|
|
1268
|
-
const
|
|
1269
|
-
let
|
|
1270
|
-
const
|
|
1925
|
+
]), m = Kt();
|
|
1926
|
+
function g(u, f) {
|
|
1927
|
+
return () => m.parseValueSchema(u, f);
|
|
1928
|
+
}
|
|
1929
|
+
function V(u, f, w) {
|
|
1930
|
+
return u.includes("visible") && f.visible !== void 0 ? typeof f.visible == "boolean" ? () => !!f.visible : f.visible === void 0 ? !0 : g(f.visible, w) : () => !0;
|
|
1931
|
+
}
|
|
1932
|
+
function T(u, f, w) {
|
|
1933
|
+
return u.includes("readonly") && f.readonly !== void 0 ? typeof f.readonly == "boolean" ? () => !!f.readonly : g(f.readonly, w) : () => !1;
|
|
1934
|
+
}
|
|
1935
|
+
function l(u, f) {
|
|
1936
|
+
const w = u.$converter || f;
|
|
1937
|
+
return typeof w == "string" && w && o.has(w) ? o.get(w) || null : w || null;
|
|
1938
|
+
}
|
|
1939
|
+
function b(u, f, w, k, h, j = "", O = "") {
|
|
1940
|
+
return Object.keys(u).map((B) => {
|
|
1941
|
+
const Z = R(1), z = B, E = u[B], M = Object.keys(E), _ = E.title, W = E.type, X = a.get(W) || { type: "input-group", enableClear: !1 }, J = E.editor ? Object.assign({}, X, E.editor) : Object.assign({}, X), s = V(M, E, f), y = T(M, E, f);
|
|
1942
|
+
J.readonly = J.readonly === void 0 ? y() : J.readonly;
|
|
1943
|
+
const C = E.type === "cascade" ? b(E.properties, f, w, k, h, j, O) : [], r = !0;
|
|
1944
|
+
let d = l(E, O);
|
|
1945
|
+
const v = H({
|
|
1271
1946
|
get() {
|
|
1272
|
-
if (
|
|
1273
|
-
if (["class", "style"].find((
|
|
1274
|
-
return
|
|
1275
|
-
const
|
|
1276
|
-
return Object.prototype.hasOwnProperty.call(
|
|
1947
|
+
if (Z.value) {
|
|
1948
|
+
if (["class", "style"].find((G) => G === z) && !d && (d = o.get("/converter/appearance.converter") || null), d && d.convertFrom)
|
|
1949
|
+
return d.convertFrom(w, B, h, j);
|
|
1950
|
+
const A = w[B];
|
|
1951
|
+
return Object.prototype.hasOwnProperty.call(E, "defaultValue") && (A === void 0 || typeof A == "string" && A === "") ? E.type === "boolean" ? E.defaultValue : E.defaultValue || "" : A;
|
|
1277
1952
|
}
|
|
1278
1953
|
return null;
|
|
1279
1954
|
},
|
|
1280
|
-
set(
|
|
1281
|
-
|
|
1955
|
+
set(A) {
|
|
1956
|
+
Z.value += 1, d && d.convertTo ? (d.convertTo(k, B, A, h, j), d.convertTo(w, B, A, h, j)) : (k[B] = A, w[B] = A);
|
|
1282
1957
|
}
|
|
1283
|
-
}), { refreshPanelAfterChanged:
|
|
1284
|
-
return
|
|
1958
|
+
}), { refreshPanelAfterChanged: P, description: x, isExpand: I, parentPropertyID: $ } = E, L = { propertyID: z, propertyName: _, propertyType: W, propertyValue: v, editor: J, visible: s, readonly: y, cascadeConfig: C, hideCascadeTitle: r, refreshPanelAfterChanged: P, description: x, isExpand: I, parentPropertyID: $ };
|
|
1959
|
+
return f[z] = L, L;
|
|
1285
1960
|
});
|
|
1286
1961
|
}
|
|
1287
|
-
function i(
|
|
1288
|
-
const
|
|
1289
|
-
return
|
|
1290
|
-
const
|
|
1291
|
-
return { categoryId:
|
|
1962
|
+
function i(u, f, w = {}) {
|
|
1963
|
+
const k = {}, h = e[u];
|
|
1964
|
+
return h && h.categories ? Object.keys(h.categories).map((O) => {
|
|
1965
|
+
const N = h.categories[O], B = N == null ? void 0 : N.title, Z = b(N.properties || {}, k, {}, w, f);
|
|
1966
|
+
return { categoryId: O, categoryName: B, properties: Z };
|
|
1292
1967
|
}) : [];
|
|
1293
1968
|
}
|
|
1294
|
-
function
|
|
1295
|
-
const
|
|
1296
|
-
if (
|
|
1297
|
-
const M =
|
|
1298
|
-
|
|
1299
|
-
M.properties[
|
|
1969
|
+
function c(u, f, w, k, h = "") {
|
|
1970
|
+
const j = f.$ref.schema, O = f.$ref.converter, N = w[j], B = N.type, Z = n(N), z = {}, E = e[B];
|
|
1971
|
+
if (E && E.categories) {
|
|
1972
|
+
const M = E.categories[u], _ = M == null ? void 0 : M.title;
|
|
1973
|
+
O && Object.keys(M.properties).forEach((J) => {
|
|
1974
|
+
M.properties[J].$converter = O;
|
|
1300
1975
|
});
|
|
1301
|
-
const
|
|
1302
|
-
return { categoryId:
|
|
1976
|
+
const W = (M == null ? void 0 : M.properties) || {}, X = b(W, z, Z, N, k, h);
|
|
1977
|
+
return { categoryId: u, categoryName: _, properties: X };
|
|
1303
1978
|
}
|
|
1304
|
-
return { categoryId:
|
|
1305
|
-
}
|
|
1306
|
-
function
|
|
1307
|
-
const
|
|
1308
|
-
let B =
|
|
1309
|
-
if (!(B && Object.keys(B).length > 0) &&
|
|
1310
|
-
const
|
|
1311
|
-
return Object.keys(B.categories).map((
|
|
1312
|
-
const M = B.categories[
|
|
1979
|
+
return { categoryId: u, categoryName: "", properties: [] };
|
|
1980
|
+
}
|
|
1981
|
+
function F(u, f, w, k, h) {
|
|
1982
|
+
const j = u.type, O = n(u), N = {};
|
|
1983
|
+
let B = h || e[j];
|
|
1984
|
+
if (!(B && Object.keys(B).length > 0) && w && w.getPropConfig && (B = w.getPropConfig(k)), B && B.categories) {
|
|
1985
|
+
const z = [];
|
|
1986
|
+
return Object.keys(B.categories).map((E) => {
|
|
1987
|
+
const M = B.categories[E];
|
|
1313
1988
|
if (M.$ref) {
|
|
1314
|
-
|
|
1989
|
+
z.push(c(E, M, u, f, k));
|
|
1315
1990
|
return;
|
|
1316
1991
|
}
|
|
1317
|
-
const
|
|
1318
|
-
|
|
1319
|
-
}),
|
|
1992
|
+
const _ = M == null ? void 0 : M.title, W = M == null ? void 0 : M.tabId, X = M == null ? void 0 : M.tabName, J = M == null ? void 0 : M.hide, s = M == null ? void 0 : M.hideTitle, y = b(M.properties || {}, N, O, u, f, k, M.$converter), { setPropertyRelates: C } = M, r = M == null ? void 0 : M.parentPropertyID;
|
|
1993
|
+
z.push({ categoryId: E, categoryName: _, tabId: W, tabName: X, hide: J, properties: y, hideTitle: s, setPropertyRelates: C, parentPropertyID: r });
|
|
1994
|
+
}), z;
|
|
1320
1995
|
}
|
|
1321
1996
|
return [];
|
|
1322
1997
|
}
|
|
1323
1998
|
return {
|
|
1324
|
-
getPropertyConfigBySchema:
|
|
1999
|
+
getPropertyConfigBySchema: F,
|
|
1325
2000
|
getPropertyConfigByType: i,
|
|
1326
2001
|
propertyConverterMap: o
|
|
1327
2002
|
};
|
|
1328
2003
|
}
|
|
1329
|
-
function
|
|
2004
|
+
function In(e, t) {
|
|
1330
2005
|
let n;
|
|
1331
2006
|
function o(i) {
|
|
1332
|
-
const { properties:
|
|
1333
|
-
if (
|
|
1334
|
-
const
|
|
1335
|
-
|
|
2007
|
+
const { properties: c, title: F, ignore: u } = i, f = u && Array.isArray(u), w = Object.keys(c).reduce((k, h) => ((!f || !u.find((j) => j === h)) && (k[h] = c[h].type === "object" && c[h].properties ? o(c[h]) : de(c[h].default)), k), {});
|
|
2008
|
+
if (F && (!f || !u.find((k) => k === "id"))) {
|
|
2009
|
+
const k = F.toLowerCase().replace(/-/g, "_");
|
|
2010
|
+
w.id = `${k}_${Math.random().toString().slice(2, 6)}`;
|
|
1336
2011
|
}
|
|
1337
|
-
return
|
|
1338
|
-
}
|
|
1339
|
-
function
|
|
1340
|
-
const { properties:
|
|
1341
|
-
if (
|
|
1342
|
-
const
|
|
1343
|
-
if (
|
|
1344
|
-
const
|
|
1345
|
-
|
|
2012
|
+
return w;
|
|
2013
|
+
}
|
|
2014
|
+
function a(i) {
|
|
2015
|
+
const { properties: c, title: F, required: u } = i;
|
|
2016
|
+
if (u && Array.isArray(u)) {
|
|
2017
|
+
const f = u.reduce((w, k) => (w[k] = c[k].type === "object" && c[k].properties ? o(c[k]) : de(c[k].default), w), {});
|
|
2018
|
+
if (F && u.find((w) => w === "id")) {
|
|
2019
|
+
const w = F.toLowerCase().replace(/-/g, "_");
|
|
2020
|
+
f.id = `${w}_${Math.random().toString().slice(2, 6)}`;
|
|
1346
2021
|
}
|
|
1347
|
-
return
|
|
2022
|
+
return f;
|
|
1348
2023
|
}
|
|
1349
2024
|
return {
|
|
1350
|
-
type:
|
|
2025
|
+
type: F
|
|
1351
2026
|
};
|
|
1352
2027
|
}
|
|
1353
|
-
function m(i,
|
|
1354
|
-
const
|
|
1355
|
-
if (
|
|
1356
|
-
let
|
|
1357
|
-
const
|
|
1358
|
-
return
|
|
2028
|
+
function m(i, c = {}, F) {
|
|
2029
|
+
const u = e[i];
|
|
2030
|
+
if (u) {
|
|
2031
|
+
let f = a(u);
|
|
2032
|
+
const w = t[i];
|
|
2033
|
+
return f = w ? w({ getSchemaByType: m }, f, c, F) : f, n != null && n.appendIdentifyForNewControl && n.appendIdentifyForNewControl(f), f;
|
|
1359
2034
|
}
|
|
1360
2035
|
return null;
|
|
1361
2036
|
}
|
|
1362
|
-
function
|
|
1363
|
-
const
|
|
1364
|
-
return Object.keys(
|
|
2037
|
+
function g(i, c) {
|
|
2038
|
+
const F = o(c);
|
|
2039
|
+
return Object.keys(F).reduce((u, f) => (Object.prototype.hasOwnProperty.call(i, f) && (u[f] && Ce(u[f]) && Ce(i[f] || !i[f]) ? Object.assign(u[f], i[f] || {}) : u[f] = i[f]), u), F), F;
|
|
1365
2040
|
}
|
|
1366
|
-
function
|
|
1367
|
-
return Object.keys(i).filter((
|
|
1368
|
-
if (
|
|
1369
|
-
const
|
|
1370
|
-
if (typeof
|
|
1371
|
-
|
|
2041
|
+
function V(i, c) {
|
|
2042
|
+
return Object.keys(i).filter((u) => i[u] != null).reduce((u, f) => {
|
|
2043
|
+
if (c.has(f)) {
|
|
2044
|
+
const w = c.get(f);
|
|
2045
|
+
if (typeof w == "string")
|
|
2046
|
+
u[w] = i[f];
|
|
1372
2047
|
else {
|
|
1373
|
-
const
|
|
1374
|
-
Object.assign(
|
|
2048
|
+
const k = w(f, i[f], i);
|
|
2049
|
+
Object.assign(u, k);
|
|
1375
2050
|
}
|
|
1376
2051
|
} else
|
|
1377
|
-
|
|
1378
|
-
return
|
|
2052
|
+
u[f] = i[f];
|
|
2053
|
+
return u;
|
|
1379
2054
|
}, {});
|
|
1380
2055
|
}
|
|
1381
|
-
function
|
|
1382
|
-
const
|
|
1383
|
-
return
|
|
2056
|
+
function T(i, c, F = /* @__PURE__ */ new Map()) {
|
|
2057
|
+
const u = g(i, c);
|
|
2058
|
+
return V(u, F);
|
|
1384
2059
|
}
|
|
1385
|
-
function
|
|
1386
|
-
var
|
|
1387
|
-
const
|
|
1388
|
-
if (
|
|
1389
|
-
const
|
|
1390
|
-
if (!
|
|
2060
|
+
function l(i) {
|
|
2061
|
+
var F;
|
|
2062
|
+
const c = i.type;
|
|
2063
|
+
if (c) {
|
|
2064
|
+
const u = e[c];
|
|
2065
|
+
if (!u)
|
|
1391
2066
|
return i;
|
|
1392
|
-
const
|
|
1393
|
-
if (
|
|
1394
|
-
const
|
|
1395
|
-
|
|
2067
|
+
const f = g(i, u), w = ((F = i.editor) == null ? void 0 : F.type) || "";
|
|
2068
|
+
if (w) {
|
|
2069
|
+
const k = e[w], h = g(i.editor, k);
|
|
2070
|
+
f.editor = h;
|
|
1396
2071
|
}
|
|
1397
|
-
return
|
|
2072
|
+
return f;
|
|
1398
2073
|
}
|
|
1399
2074
|
return i;
|
|
1400
2075
|
}
|
|
1401
|
-
function
|
|
2076
|
+
function b(i) {
|
|
1402
2077
|
n = i;
|
|
1403
2078
|
}
|
|
1404
|
-
return { getSchemaByType: m, resolveSchemaWithDefaultValue:
|
|
2079
|
+
return { getSchemaByType: m, resolveSchemaWithDefaultValue: l, resolveSchemaToProps: T, mappingSchemaToProps: V, setDesignerContext: b };
|
|
1405
2080
|
}
|
|
1406
|
-
const
|
|
1407
|
-
|
|
1408
|
-
const { globalStorageKey:
|
|
2081
|
+
const Pn = {}, Vn = {}, { resolveSchemaWithDefaultValue: xn } = In(Pn, Vn), Mn = {}, Dn = {};
|
|
2082
|
+
kn(Mn, Dn, xn);
|
|
2083
|
+
const { globalStorageKey: Nr } = Ve(), te = class te {
|
|
1409
2084
|
/**
|
|
1410
2085
|
* 根据绑定字段类型获取可用的输入类控件
|
|
1411
2086
|
*/
|
|
1412
2087
|
static getEditorTypesByMDataType(t, n = !1, o = "") {
|
|
1413
2088
|
if (n)
|
|
1414
|
-
return [{ key:
|
|
1415
|
-
let
|
|
1416
|
-
if (o === "data-grid-column" && (
|
|
1417
|
-
const m = [
|
|
1418
|
-
|
|
2089
|
+
return [{ key: p["language-textbox"].type, value: p["language-textbox"].name }];
|
|
2090
|
+
let a = te.fieldControlTypeMapping[t];
|
|
2091
|
+
if (o === "data-grid-column" && (a != null && a.length)) {
|
|
2092
|
+
const m = [p["check-group"].type, p["radio-group"].type, p.image.type, p["rich-text-editor"].type];
|
|
2093
|
+
a = a.filter((g) => !m.includes(g.key));
|
|
1419
2094
|
}
|
|
1420
|
-
return
|
|
2095
|
+
return a;
|
|
1421
2096
|
}
|
|
1422
2097
|
/**
|
|
1423
2098
|
* 获取所有输入类控件
|
|
1424
2099
|
*/
|
|
1425
2100
|
static getAllInputTypes() {
|
|
1426
2101
|
const t = [];
|
|
1427
|
-
for (const n in
|
|
1428
|
-
|
|
1429
|
-
t.find((
|
|
2102
|
+
for (const n in te.fieldControlTypeMapping)
|
|
2103
|
+
te.fieldControlTypeMapping[n].forEach((o) => {
|
|
2104
|
+
t.find((a) => a.key === o.key && a.value === o.value) || t.push({ key: o.key, value: o.value });
|
|
1430
2105
|
});
|
|
1431
2106
|
return t;
|
|
1432
2107
|
}
|
|
@@ -1436,425 +2111,266 @@ const { globalStorageKey: rr } = he(), ee = class ee {
|
|
|
1436
2111
|
*/
|
|
1437
2112
|
static mappingDomPropAndSchemaProp(t, n) {
|
|
1438
2113
|
var m;
|
|
1439
|
-
const o = (m = t.editor) == null ? void 0 : m.type,
|
|
1440
|
-
return (t.type ===
|
|
2114
|
+
const o = (m = t.editor) == null ? void 0 : m.type, a = [];
|
|
2115
|
+
return (t.type === p["data-grid-column"].type || t.type === p["tree-grid-column"].type) && n && n.categoryId && n.categoryId.indexOf("gridFieldEditor") < 0 && a.push({ domField: "title", schemaField: "name" }), a.push({ domField: "label", schemaField: "name" }), a.push({ domField: "editor.required", schemaField: "require" }), a.push({ domField: "editor.readonly", schemaField: "readonly" }), (o === p["input-group"].type || o === p.textarea.type || o === p["number-spinner"].type) && a.push({ domField: "editor.maxLength", schemaField: "type.length" }), o === p["number-spinner"].type && a.push({ domField: "editor.precision", schemaField: "type.precision" }), (t.type === p["data-grid-column"].type || t.type === p["tree-grid-column"].type) && a.push({ domField: "formatter.precision", schemaField: "type.precision" }), (o === p["combo-list"].type || o === p["radio-group"].type) && a.push({ domField: "editor.data", schemaField: "type.enumValues" }), (t.type === p["data-grid-column"].type || t.type === p["tree-grid-column"].type) && a.push({ domField: "formatter.data", schemaField: "type.enumValues" }), o === p["date-picker"].type && (a.push({ domField: "editor.displayFormat", schemaField: "editor.format" }), a.push({ domField: "editor.fieldType", schemaField: "type.name" })), o === p["number-spinner"].type && (a.push({ domField: "editor.max", schemaField: "editor.maxValue" }), a.push({ domField: "editor.min", schemaField: "editor.minValue" })), o === p.lookup.type && (a.push({ domField: "editor.dataSource", schemaField: "editor.dataSource" }), a.push({ domField: "editor.valueField", schemaField: "editor.valueField" }), a.push({ domField: "editor.textField", schemaField: "editor.textField" }), a.push({ domField: "editor.displayType", schemaField: "editor.displayType" }), a.push({ domField: "editor.mapFields", schemaField: "editor.mapFields" }), a.push({ domField: "editor.helpId", schemaField: "editor.helpId" })), a.push({ domField: "path", schemaField: "bindingPath" }), a.push({ domField: "binding.path", schemaField: "bindingField" }), a.push({ domField: "binding.fullPath", schemaField: "path" }), (t.type === p["data-grid-column"].type || t.type === p["tree-grid-column"].type) && a.push({ domField: "field", schemaField: "bindingPath" }), a;
|
|
1441
2116
|
}
|
|
1442
2117
|
};
|
|
1443
2118
|
/**
|
|
1444
2119
|
* <字段类型,可配置的控件类型列表>的映射
|
|
1445
2120
|
*/
|
|
1446
|
-
te
|
|
2121
|
+
ie(te, "fieldControlTypeMapping", {
|
|
1447
2122
|
String: [
|
|
1448
|
-
{ key:
|
|
1449
|
-
{ key:
|
|
1450
|
-
{ key:
|
|
1451
|
-
{ key:
|
|
1452
|
-
{ key:
|
|
1453
|
-
{ key:
|
|
1454
|
-
{ key:
|
|
1455
|
-
{ key:
|
|
1456
|
-
{ key:
|
|
1457
|
-
{ key:
|
|
1458
|
-
{ key:
|
|
2123
|
+
{ key: p["input-group"].type, value: p["input-group"].name },
|
|
2124
|
+
{ key: p.lookup.type, value: p.lookup.name },
|
|
2125
|
+
{ key: p.image.type, value: p.image.name },
|
|
2126
|
+
{ key: p["date-picker"].type, value: p["date-picker"].name },
|
|
2127
|
+
{ key: p.switch.type, value: p.switch.name },
|
|
2128
|
+
{ key: p["check-box"].type, value: p["check-box"].name },
|
|
2129
|
+
{ key: p["check-group"].type, value: p["check-group"].name },
|
|
2130
|
+
{ key: p["radio-group"].type, value: p["radio-group"].name },
|
|
2131
|
+
{ key: p["combo-list"].type, value: p["combo-list"].name },
|
|
2132
|
+
{ key: p.textarea.type, value: p.textarea.name },
|
|
2133
|
+
{ key: p["time-picker"].type, value: p["time-picker"].name }
|
|
1459
2134
|
],
|
|
1460
2135
|
Text: [
|
|
1461
|
-
{ key:
|
|
1462
|
-
{ key:
|
|
1463
|
-
{ key:
|
|
1464
|
-
{ key:
|
|
2136
|
+
{ key: p.textarea.type, value: p.textarea.name },
|
|
2137
|
+
{ key: p.lookup.type, value: p.lookup.name },
|
|
2138
|
+
{ key: p.image.type, value: p.image.name },
|
|
2139
|
+
{ key: p["rich-text-editor"].type, value: p["rich-text-editor"].name }
|
|
1465
2140
|
],
|
|
1466
2141
|
Decimal: [
|
|
1467
|
-
{ key:
|
|
2142
|
+
{ key: p["number-spinner"].type, value: p["number-spinner"].name }
|
|
1468
2143
|
],
|
|
1469
2144
|
Integer: [
|
|
1470
|
-
{ key:
|
|
2145
|
+
{ key: p["number-spinner"].type, value: p["number-spinner"].name }
|
|
1471
2146
|
],
|
|
1472
2147
|
Number: [
|
|
1473
|
-
{ key:
|
|
1474
|
-
{ key:
|
|
1475
|
-
{ key:
|
|
2148
|
+
{ key: p["number-spinner"].type, value: p["number-spinner"].name },
|
|
2149
|
+
{ key: p.switch.type, value: p.switch.name },
|
|
2150
|
+
{ key: p["check-box"].type, value: p["check-box"].name }
|
|
1476
2151
|
],
|
|
1477
2152
|
BigNumber: [
|
|
1478
|
-
{ key:
|
|
2153
|
+
{ key: p["number-spinner"].type, value: p["number-spinner"].name }
|
|
1479
2154
|
],
|
|
1480
2155
|
Date: [
|
|
1481
|
-
{ key:
|
|
2156
|
+
{ key: p["date-picker"].type, value: p["date-picker"].name }
|
|
1482
2157
|
],
|
|
1483
2158
|
DateTime: [
|
|
1484
|
-
{ key:
|
|
2159
|
+
{ key: p["date-picker"].type, value: p["date-picker"].name }
|
|
1485
2160
|
],
|
|
1486
2161
|
Boolean: [
|
|
1487
|
-
{ key:
|
|
1488
|
-
{ key:
|
|
2162
|
+
{ key: p.switch.type, value: p.switch.name },
|
|
2163
|
+
{ key: p["check-box"].type, value: p["check-box"].name }
|
|
1489
2164
|
],
|
|
1490
2165
|
Enum: [
|
|
1491
|
-
{ key:
|
|
1492
|
-
{ key:
|
|
2166
|
+
{ key: p["combo-list"].type, value: p["combo-list"].name },
|
|
2167
|
+
{ key: p["radio-group"].type, value: p["radio-group"].name }
|
|
1493
2168
|
],
|
|
1494
2169
|
Object: [
|
|
1495
|
-
{ key:
|
|
1496
|
-
{ key:
|
|
1497
|
-
{ key:
|
|
2170
|
+
{ key: p.lookup.type, value: p.lookup.name },
|
|
2171
|
+
{ key: p["combo-list"].type, value: p["combo-list"].name },
|
|
2172
|
+
{ key: p["radio-group"].type, value: p["radio-group"].name }
|
|
1498
2173
|
]
|
|
1499
2174
|
});
|
|
1500
|
-
let
|
|
1501
|
-
var
|
|
1502
|
-
function
|
|
2175
|
+
let Te = te;
|
|
2176
|
+
var me = /* @__PURE__ */ ((e) => (e.Form = "Form", e.Variable = "Variable", e))(me || {}), Oe = /* @__PURE__ */ ((e) => (e.SimpleField = "SimpleField", e.ComplexField = "ComplexField", e))(Oe || {});
|
|
2177
|
+
function Bn(e, t, n) {
|
|
1503
2178
|
function o() {
|
|
1504
|
-
const
|
|
1505
|
-
if (!
|
|
2179
|
+
const g = n.componentId;
|
|
2180
|
+
if (!g)
|
|
1506
2181
|
return !1;
|
|
1507
|
-
const
|
|
1508
|
-
if (!
|
|
2182
|
+
const V = e.formSchemaUtils.getViewModelIdByComponentId(g);
|
|
2183
|
+
if (!V)
|
|
1509
2184
|
return !1;
|
|
1510
|
-
const { schema:
|
|
1511
|
-
return !(!i || i.$type !==
|
|
2185
|
+
const { schema: T } = t, { designViewModelUtils: l } = e, b = l.getDgViewModel(V), i = b == null ? void 0 : b.fields.find((c) => c.id === T.binding.field);
|
|
2186
|
+
return !(!i || i.$type !== Oe.SimpleField);
|
|
1512
2187
|
}
|
|
1513
|
-
function
|
|
1514
|
-
const { schema:
|
|
1515
|
-
return !!e.formSchemaUtils.getVariableById(
|
|
2188
|
+
function a() {
|
|
2189
|
+
const { schema: g } = t;
|
|
2190
|
+
return !!e.formSchemaUtils.getVariableById(g.binding.field);
|
|
1516
2191
|
}
|
|
1517
2192
|
function m() {
|
|
1518
|
-
var
|
|
1519
|
-
const { schema:
|
|
1520
|
-
let
|
|
1521
|
-
if (!e || !((
|
|
1522
|
-
return
|
|
1523
|
-
switch (
|
|
1524
|
-
case
|
|
1525
|
-
|
|
2193
|
+
var T;
|
|
2194
|
+
const { schema: g } = t;
|
|
2195
|
+
let V = !0;
|
|
2196
|
+
if (!e || !((T = g.binding) != null && T.field))
|
|
2197
|
+
return V;
|
|
2198
|
+
switch (g.binding.type) {
|
|
2199
|
+
case me.Form: {
|
|
2200
|
+
V = o();
|
|
1526
2201
|
break;
|
|
1527
2202
|
}
|
|
1528
|
-
case
|
|
1529
|
-
|
|
2203
|
+
case me.Variable:
|
|
2204
|
+
V = a();
|
|
1530
2205
|
}
|
|
1531
|
-
return
|
|
2206
|
+
return V;
|
|
1532
2207
|
}
|
|
1533
2208
|
return { checkBindingFieldValidation: m };
|
|
1534
2209
|
}
|
|
1535
|
-
const
|
|
2210
|
+
const En = /* @__PURE__ */ ee({
|
|
1536
2211
|
name: "FDynamicFormGroupDesign",
|
|
1537
|
-
props:
|
|
2212
|
+
props: we,
|
|
1538
2213
|
emits: ["change", "update:modelValue"],
|
|
1539
2214
|
setup(e, t) {
|
|
1540
|
-
var
|
|
1541
|
-
const n =
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
2215
|
+
var z;
|
|
2216
|
+
const n = R(e.id), o = R(e.customClass), a = R(e.editor), m = R(e.label), g = R(e.modelValue), V = R(!0), T = R(((z = e.editor) == null ? void 0 : z.required) === !0), l = R(e.showLabel), b = R(), i = R(e.editor.type || "input-group"), c = Y("designer-host-service"), F = Y("design-item-context"), u = H(() => l.value ? e.showLabelType : "none"), {
|
|
2217
|
+
resolveEditorProps: f,
|
|
2218
|
+
resolveEditorType: w
|
|
2219
|
+
} = Ht(), k = H(() => {
|
|
2220
|
+
const E = {
|
|
2221
|
+
"form-group": !0,
|
|
2222
|
+
"farris-form-group": !0,
|
|
2223
|
+
"common-group": !0,
|
|
2224
|
+
"q-state-readonly": V.value,
|
|
2225
|
+
"form-group-in-canvas": !0,
|
|
2226
|
+
"align-items-start": a.value.type === "textarea" || a.value.type === "rich-text-editor"
|
|
2227
|
+
};
|
|
2228
|
+
return E["form-group--has-" + i.value] = !0, E;
|
|
2229
|
+
}), h = H(() => {
|
|
2230
|
+
const E = a.value.type || "input-group", M = w(E), _ = f(E, a.value);
|
|
2231
|
+
return () => D(M, Pe({
|
|
2232
|
+
ref: b
|
|
2233
|
+
}, _, {
|
|
2234
|
+
modelValue: g.value,
|
|
2235
|
+
"onUpdate:modelValue": (W) => g.value = W
|
|
1559
2236
|
}), null);
|
|
1560
2237
|
});
|
|
1561
|
-
|
|
1562
|
-
var
|
|
1563
|
-
n.value =
|
|
1564
|
-
...
|
|
1565
|
-
}, m.value =
|
|
2238
|
+
le([() => e.id, () => e.customClass, () => e.editor, () => e.label, () => e.modelValue, () => e.readonly, () => e.showLabel], ([E, M, _, W, X, J, s]) => {
|
|
2239
|
+
var y;
|
|
2240
|
+
n.value = E, o.value = M, a.value = {
|
|
2241
|
+
..._
|
|
2242
|
+
}, m.value = W, g.value = X, V.value = J, T.value = ((y = a.value) == null ? void 0 : y.required) === !0, l.value = s;
|
|
1566
2243
|
}, {
|
|
1567
2244
|
deep: !0
|
|
1568
2245
|
});
|
|
1569
|
-
const
|
|
1570
|
-
checkBindingFieldValidation:
|
|
1571
|
-
} =
|
|
1572
|
-
function
|
|
1573
|
-
const
|
|
1574
|
-
return
|
|
2246
|
+
const O = !Y("external-container-id"), {
|
|
2247
|
+
checkBindingFieldValidation: N
|
|
2248
|
+
} = Bn(c, F, e);
|
|
2249
|
+
function B() {
|
|
2250
|
+
const E = O ? N() : !0;
|
|
2251
|
+
return D(Ue, {
|
|
1575
2252
|
id: `${n.value}-lable`,
|
|
1576
|
-
showType:
|
|
1577
|
-
required:
|
|
2253
|
+
showType: u.value,
|
|
2254
|
+
required: T.value,
|
|
1578
2255
|
text: m.value,
|
|
1579
2256
|
title: m.value,
|
|
1580
|
-
valid:
|
|
2257
|
+
valid: E,
|
|
1581
2258
|
inValidTip: "绑定信息已失效,请切换绑定或移除控件"
|
|
1582
2259
|
}, null);
|
|
1583
2260
|
}
|
|
1584
|
-
const
|
|
2261
|
+
const Z = H(() => {
|
|
1585
2262
|
if (e.fill)
|
|
1586
2263
|
return {
|
|
1587
2264
|
maxWidth: "none"
|
|
1588
2265
|
};
|
|
1589
2266
|
});
|
|
1590
2267
|
return t.expose({
|
|
1591
|
-
editorRef:
|
|
1592
|
-
}), () =>
|
|
2268
|
+
editorRef: b
|
|
2269
|
+
}), () => D("div", {
|
|
1593
2270
|
id: `${n.value}-input-group`,
|
|
1594
2271
|
class: o.value
|
|
1595
|
-
}, [
|
|
2272
|
+
}, [D("div", {
|
|
1596
2273
|
class: "farris-group-wrap",
|
|
1597
|
-
style:
|
|
1598
|
-
}, [
|
|
1599
|
-
class:
|
|
1600
|
-
}, [
|
|
2274
|
+
style: Z.value
|
|
2275
|
+
}, [D("div", {
|
|
2276
|
+
class: k.value
|
|
2277
|
+
}, [B(), D("div", {
|
|
1601
2278
|
class: "farris-input-wrap"
|
|
1602
|
-
}, [
|
|
2279
|
+
}, [h.value()])])])]);
|
|
1603
2280
|
}
|
|
1604
2281
|
});
|
|
1605
|
-
function
|
|
2282
|
+
function $n(e, t) {
|
|
1606
2283
|
function n() {
|
|
1607
2284
|
return !0;
|
|
1608
2285
|
}
|
|
1609
2286
|
function o() {
|
|
1610
2287
|
return !0;
|
|
1611
2288
|
}
|
|
1612
|
-
function
|
|
2289
|
+
function a() {
|
|
1613
2290
|
return !1;
|
|
1614
2291
|
}
|
|
1615
2292
|
function m() {
|
|
1616
2293
|
return !0;
|
|
1617
2294
|
}
|
|
1618
|
-
function
|
|
1619
|
-
var
|
|
1620
|
-
const
|
|
1621
|
-
if (!
|
|
2295
|
+
function g(i) {
|
|
2296
|
+
var k;
|
|
2297
|
+
const c = t == null ? void 0 : t.designViewModelUtils, F = t == null ? void 0 : t.formSchemaUtils, u = (k = e == null ? void 0 : e.componentInstance.value) == null ? void 0 : k.belongedComponentId;
|
|
2298
|
+
if (!u || !c || !F)
|
|
1622
2299
|
return;
|
|
1623
|
-
const
|
|
1624
|
-
|
|
1625
|
-
}
|
|
1626
|
-
function
|
|
1627
|
-
const
|
|
1628
|
-
if (
|
|
1629
|
-
let
|
|
1630
|
-
if (
|
|
1631
|
-
var
|
|
1632
|
-
if (
|
|
2300
|
+
const f = F.getViewModelIdByComponentId(u), w = c.getDgViewModel(f);
|
|
2301
|
+
w && w.removeField([i]);
|
|
2302
|
+
}
|
|
2303
|
+
function V(i, c) {
|
|
2304
|
+
const F = t == null ? void 0 : t.formSchemaUtils, { schema: u } = e;
|
|
2305
|
+
if (F.getComponents().find((w) => {
|
|
2306
|
+
let k = F.getControlsInCmpWidthBinding(w.viewModel, i);
|
|
2307
|
+
if (k = k.filter((h) => {
|
|
2308
|
+
var O;
|
|
2309
|
+
if (h.id === u.id)
|
|
1633
2310
|
return !1;
|
|
1634
|
-
const
|
|
1635
|
-
if (
|
|
2311
|
+
const j = c.type === "visible" ? h[c.type] : (O = h.editor) == null ? void 0 : O[c.type];
|
|
2312
|
+
if (j && j.type === "Expression" && j.expressionId === c.id)
|
|
1636
2313
|
return !0;
|
|
1637
|
-
}),
|
|
2314
|
+
}), k.length)
|
|
1638
2315
|
return !0;
|
|
1639
2316
|
}))
|
|
1640
2317
|
return !0;
|
|
1641
2318
|
}
|
|
1642
|
-
function
|
|
1643
|
-
var
|
|
1644
|
-
const
|
|
1645
|
-
if (
|
|
1646
|
-
const
|
|
1647
|
-
|
|
1648
|
-
var
|
|
1649
|
-
switch (
|
|
2319
|
+
function T(i) {
|
|
2320
|
+
var u;
|
|
2321
|
+
const c = t == null ? void 0 : t.formSchemaUtils, { schema: F } = e;
|
|
2322
|
+
if (c.getExpressions().length) {
|
|
2323
|
+
const f = c.getExpressions(), w = f.findIndex((k) => k.target === i);
|
|
2324
|
+
w > -1 && ((u = f[w].rules) == null || u.map((k) => {
|
|
2325
|
+
var h;
|
|
2326
|
+
switch (k.type) {
|
|
1650
2327
|
case "visible":
|
|
1651
2328
|
case "readonly":
|
|
1652
2329
|
case "required": {
|
|
1653
|
-
const
|
|
1654
|
-
|
|
2330
|
+
const j = k.type === "visible" ? F[k.type] : (h = F.editor) == null ? void 0 : h[k.type];
|
|
2331
|
+
j && j.type === "Expression" && j.expressionId === k.id && (V(i, k) || (k.needDelete = !0));
|
|
1655
2332
|
break;
|
|
1656
2333
|
}
|
|
1657
2334
|
default:
|
|
1658
|
-
|
|
2335
|
+
V(i, k) || (k.needDelete = !0);
|
|
1659
2336
|
}
|
|
1660
|
-
}),
|
|
2337
|
+
}), f[w].rules = f[w].rules.filter((k) => !k.needDelete));
|
|
1661
2338
|
}
|
|
1662
2339
|
}
|
|
1663
|
-
function
|
|
1664
|
-
var
|
|
1665
|
-
const i = (
|
|
1666
|
-
((
|
|
2340
|
+
function l() {
|
|
2341
|
+
var c, F;
|
|
2342
|
+
const i = (c = e == null ? void 0 : e.parent) == null ? void 0 : c.componentInstance.value;
|
|
2343
|
+
((F = i == null ? void 0 : i.schema) == null ? void 0 : F.type) === p["response-layout-item"].type && (i != null && i.schema.appearance.class) && (i.schema.appearance.class = i.schema.appearance.class.replace("f-form-layout", ""), i.schema.appearance.class = i.schema.appearance.class.replace("farris-form", ""), i.schema.appearance.class = i.schema.appearance.class.replace("farris-form-controls-inline", ""), i.schema.appearance.class = i.schema.appearance.class.replace("farris-form-auto", ""), i.schema.appearance.class = i.schema.appearance.class.trim().replace(" ", " "));
|
|
1667
2344
|
}
|
|
1668
|
-
function
|
|
1669
|
-
const { schema: i } = e,
|
|
1670
|
-
|
|
2345
|
+
function b() {
|
|
2346
|
+
const { schema: i } = e, c = i.binding && i.binding.field;
|
|
2347
|
+
c && (g(c), T(c)), l();
|
|
1671
2348
|
}
|
|
1672
2349
|
return {
|
|
1673
|
-
canAccepts:
|
|
2350
|
+
canAccepts: a,
|
|
1674
2351
|
checkCanDeleteComponent: o,
|
|
1675
2352
|
checkCanMoveComponent: n,
|
|
1676
2353
|
hideNestedPaddingInDesginerView: m,
|
|
1677
|
-
onRemoveComponent:
|
|
2354
|
+
onRemoveComponent: b
|
|
1678
2355
|
};
|
|
1679
2356
|
}
|
|
1680
|
-
const
|
|
2357
|
+
const On = /* @__PURE__ */ ee({
|
|
1681
2358
|
name: "FFormGroupDesign",
|
|
1682
|
-
props:
|
|
2359
|
+
props: St,
|
|
1683
2360
|
emits: [],
|
|
1684
2361
|
setup(e, t) {
|
|
1685
|
-
const n =
|
|
1686
|
-
return
|
|
1687
|
-
n.value.componentInstance =
|
|
1688
|
-
var
|
|
1689
|
-
let
|
|
1690
|
-
return
|
|
2362
|
+
const n = R(), o = Y("design-item-context"), a = Y("designer-host-service"), m = $n(o, a), g = ce(n, o, m);
|
|
2363
|
+
return ne(() => {
|
|
2364
|
+
n.value.componentInstance = g, g.value.getPropConfig = (...V) => {
|
|
2365
|
+
var l, b, i;
|
|
2366
|
+
let T = Je[e.editor.type];
|
|
2367
|
+
return T && Object.keys(T).length === 0 && ((l = n.value) != null && l.editorRef) && ((i = (b = n.value) == null ? void 0 : b.editorRef) != null && i.getPropConfig) && (T = n.value.editorRef.getPropConfig(...V, g.value)), T;
|
|
1691
2368
|
};
|
|
1692
|
-
}), t.expose(
|
|
2369
|
+
}), t.expose(g.value), () => D(En, Pe(e, {
|
|
1693
2370
|
ref: n
|
|
1694
2371
|
}), null);
|
|
1695
2372
|
}
|
|
1696
|
-
}),
|
|
1697
|
-
["appearance", Oe]
|
|
1698
|
-
]), zt = /* @__PURE__ */ new Map([]), Wt = "root-viewmodel";
|
|
1699
|
-
class Jt {
|
|
1700
|
-
constructor(t, n) {
|
|
1701
|
-
te(this, "formSchemaUtils");
|
|
1702
|
-
te(this, "controlCreatorUtils");
|
|
1703
|
-
te(this, "designViewModelUtils");
|
|
1704
|
-
this.resolver = t, this.designerHostService = n, this.formSchemaUtils = this.designerHostService.formSchemaUtils, this.controlCreatorUtils = this.designerHostService.controlCreatorUtils, this.designViewModelUtils = this.designerHostService.designViewModelUtils;
|
|
1705
|
-
}
|
|
1706
|
-
createComponent(t) {
|
|
1707
|
-
const n = this.createComponentRefNode(t), o = this.createComponentNode(t), r = this.createViewModeNode(t), m = this.formSchemaUtils.getFormSchema();
|
|
1708
|
-
return m.module.viewmodels.push(r), m.module.components.push(o), this.designViewModelUtils.assembleDesignViewModel(), n;
|
|
1709
|
-
}
|
|
1710
|
-
createComponentRefNode(t) {
|
|
1711
|
-
const n = this.resolver.getSchemaByType("component-ref");
|
|
1712
|
-
return Object.assign(n, {
|
|
1713
|
-
id: `${t.componentId}-component-ref`,
|
|
1714
|
-
component: `${t.componentId}-component`
|
|
1715
|
-
}), n;
|
|
1716
|
-
}
|
|
1717
|
-
createComponentNode(t) {
|
|
1718
|
-
const n = this.resolver.getSchemaByType("component"), o = this.createFormComponentContents(t);
|
|
1719
|
-
return Object.assign(n, {
|
|
1720
|
-
id: `${t.componentId}-component`,
|
|
1721
|
-
viewModel: `${t.componentId}-component-viewmodel`,
|
|
1722
|
-
componentType: t.componentType,
|
|
1723
|
-
appearance: {
|
|
1724
|
-
class: this.getFormComponentClass(t)
|
|
1725
|
-
},
|
|
1726
|
-
formColumns: t.formColumns,
|
|
1727
|
-
contents: o
|
|
1728
|
-
}), n;
|
|
1729
|
-
}
|
|
1730
|
-
/**
|
|
1731
|
-
* 获取卡片组件层级的class样式
|
|
1732
|
-
*/
|
|
1733
|
-
getFormComponentClass(t) {
|
|
1734
|
-
var o, r;
|
|
1735
|
-
const { templateId: n } = this.formSchemaUtils.getFormSchema().module;
|
|
1736
|
-
if (n === "double-list-in-tab-template" && ((r = (o = t.parentComponentInstance) == null ? void 0 : o.schema) == null ? void 0 : r.type) === "tab-page") {
|
|
1737
|
-
const m = t.parentComponentInstance.parent && t.parentComponentInstance.parent.schema;
|
|
1738
|
-
if ((m == null ? void 0 : m.type) === "tabs" && (m == null ? void 0 : m.fill) === !0)
|
|
1739
|
-
return "f-struct-wrapper f-utils-fill-flex-column";
|
|
1740
|
-
}
|
|
1741
|
-
return "f-struct-wrapper";
|
|
1742
|
-
}
|
|
1743
|
-
createFormComponentContents(t) {
|
|
1744
|
-
var w, h;
|
|
1745
|
-
const n = this.resolver.getSchemaByType("section");
|
|
1746
|
-
Object.assign(n, {
|
|
1747
|
-
id: t.componentId + "-form-section",
|
|
1748
|
-
appearance: {
|
|
1749
|
-
class: "f-section-form f-section-in-mainsubcard"
|
|
1750
|
-
},
|
|
1751
|
-
mainTitle: t.componentName
|
|
1752
|
-
});
|
|
1753
|
-
const o = this.resolver.getSchemaByType("response-form"), r = [];
|
|
1754
|
-
Object.assign(o, {
|
|
1755
|
-
id: t.componentId + "-form",
|
|
1756
|
-
appearance: {
|
|
1757
|
-
class: "f-form-layout farris-form farris-form-controls-inline"
|
|
1758
|
-
},
|
|
1759
|
-
contents: r,
|
|
1760
|
-
controlsInline: !0
|
|
1761
|
-
}), n.contents = [o];
|
|
1762
|
-
const { selectedFields: m } = t;
|
|
1763
|
-
m == null || m.forEach((a) => {
|
|
1764
|
-
if (a.$type === de.SimpleField) {
|
|
1765
|
-
const f = ae(a), i = this.resolveControlClassByFormColumns(t), s = this.controlCreatorUtils.setFormFieldProperty(f, "", i);
|
|
1766
|
-
s && r.push(s);
|
|
1767
|
-
}
|
|
1768
|
-
});
|
|
1769
|
-
const { templateId: y } = this.formSchemaUtils.getFormSchema().module;
|
|
1770
|
-
if (y === "double-list-in-tab-template" && ((h = (w = t.parentComponentInstance) == null ? void 0 : w.schema) == null ? void 0 : h.type) === "tab-page") {
|
|
1771
|
-
const a = t.parentComponentInstance.parent && t.parentComponentInstance.parent.schema;
|
|
1772
|
-
(a == null ? void 0 : a.type) === "tabs" && (a == null ? void 0 : a.fill) === !0 && (n.appearance.class = "f-section-grid f-section-in-main px-0 pt-0", n.fill = !0);
|
|
1773
|
-
}
|
|
1774
|
-
return [n];
|
|
1775
|
-
}
|
|
1776
|
-
resolveControlClassByFormColumns(t) {
|
|
1777
|
-
let n = "";
|
|
1778
|
-
switch (t.formColumns) {
|
|
1779
|
-
case 1: {
|
|
1780
|
-
n = "col-12 col-md-12 col-xl-12 col-el-12";
|
|
1781
|
-
break;
|
|
1782
|
-
}
|
|
1783
|
-
case 2: {
|
|
1784
|
-
n = "col-12 col-md-6 col-xl-6 col-el-6";
|
|
1785
|
-
break;
|
|
1786
|
-
}
|
|
1787
|
-
case 3: {
|
|
1788
|
-
n = "col-12 col-md-6 col-xl-4 col-el-4";
|
|
1789
|
-
break;
|
|
1790
|
-
}
|
|
1791
|
-
case 4: {
|
|
1792
|
-
n = "col-12 col-md-6 col-xl-3 col-el-2";
|
|
1793
|
-
break;
|
|
1794
|
-
}
|
|
1795
|
-
}
|
|
1796
|
-
return n;
|
|
1797
|
-
}
|
|
1798
|
-
/**
|
|
1799
|
-
* 添加viewModel节点
|
|
1800
|
-
*/
|
|
1801
|
-
createViewModeNode(t) {
|
|
1802
|
-
return {
|
|
1803
|
-
id: `${t.componentId}-component-viewmodel`,
|
|
1804
|
-
code: `${t.componentId}-component-viewmodel`,
|
|
1805
|
-
name: t.componentName,
|
|
1806
|
-
bindTo: t.bindTo,
|
|
1807
|
-
parent: Wt,
|
|
1808
|
-
fields: this.assembleViewModelFields(t),
|
|
1809
|
-
commands: [],
|
|
1810
|
-
states: [],
|
|
1811
|
-
enableValidation: !0
|
|
1812
|
-
};
|
|
1813
|
-
}
|
|
1814
|
-
/**
|
|
1815
|
-
* 组装viewModel fields 节点
|
|
1816
|
-
*/
|
|
1817
|
-
assembleViewModelFields(t) {
|
|
1818
|
-
const n = [], { selectedFields: o } = t;
|
|
1819
|
-
return o == null || o.forEach((r) => {
|
|
1820
|
-
if (r.$type === de.SimpleField) {
|
|
1821
|
-
let m = "blur";
|
|
1822
|
-
const y = r.type.name;
|
|
1823
|
-
(y === me.Enum || y === me.Boolean) && (m = "change"), n.push({
|
|
1824
|
-
type: "Form",
|
|
1825
|
-
id: r.id,
|
|
1826
|
-
fieldName: r.bindingField,
|
|
1827
|
-
groupId: null,
|
|
1828
|
-
groupName: null,
|
|
1829
|
-
updateOn: m,
|
|
1830
|
-
fieldSchema: {}
|
|
1831
|
-
});
|
|
1832
|
-
}
|
|
1833
|
-
}), n;
|
|
1834
|
-
}
|
|
1835
|
-
}
|
|
1836
|
-
function _t(e, t, n, o) {
|
|
1837
|
-
var m, y, w, h, a, f;
|
|
1838
|
-
const r = n.parentComponentInstance;
|
|
1839
|
-
if (r && o) {
|
|
1840
|
-
const i = (m = r.schema) == null ? void 0 : m.type, g = {
|
|
1841
|
-
componentId: `form-${Math.random().toString(36).slice(2, 6)}`,
|
|
1842
|
-
componentName: ((y = n.bindingSourceContext) == null ? void 0 : y.entityTitle) || ((h = (w = n.bindingSourceContext) == null ? void 0 : w.bindingEntity) == null ? void 0 : h.name) || "标题",
|
|
1843
|
-
componentType: "form",
|
|
1844
|
-
formColumns: i === "splitter-pane" ? 1 : 4,
|
|
1845
|
-
parentContainerId: r.schema.id,
|
|
1846
|
-
parentComponentInstance: r,
|
|
1847
|
-
bindTo: ((a = n.bindingSourceContext) == null ? void 0 : a.bindTo) || "/",
|
|
1848
|
-
selectedFields: (f = n.bindingSourceContext) == null ? void 0 : f.bindingEntityFields
|
|
1849
|
-
};
|
|
1850
|
-
return new Jt(e, o).createComponent(g);
|
|
1851
|
-
} else
|
|
1852
|
-
return t;
|
|
1853
|
-
}
|
|
1854
|
-
function Xt(e, t, n) {
|
|
1855
|
-
return t;
|
|
1856
|
-
}
|
|
1857
|
-
const Qt = "https://json-schema.org/draft/2020-12/schema", Yt = "https://farris-design.gitee.io/grid-field-editor.schema.json", Ht = "response-form-layout-setting", Kt = "A Farris Data Grid Component", en = "object", tn = {
|
|
2373
|
+
}), jn = "https://json-schema.org/draft/2020-12/schema", Ln = "https://farris-design.gitee.io/grid-field-editor.schema.json", Nn = "response-form-layout-setting", An = "A Farris Data Grid Component", Rn = "object", Un = {
|
|
1858
2374
|
id: {
|
|
1859
2375
|
description: "The unique identifier for a Input Group",
|
|
1860
2376
|
type: "string"
|
|
@@ -1868,18 +2384,18 @@ const Qt = "https://json-schema.org/draft/2020-12/schema", Yt = "https://farris-
|
|
|
1868
2384
|
description: "",
|
|
1869
2385
|
type: "object"
|
|
1870
2386
|
}
|
|
1871
|
-
},
|
|
2387
|
+
}, qn = [
|
|
1872
2388
|
"id",
|
|
1873
2389
|
"type"
|
|
1874
|
-
],
|
|
1875
|
-
$schema:
|
|
1876
|
-
$id:
|
|
1877
|
-
title:
|
|
1878
|
-
description:
|
|
1879
|
-
type:
|
|
1880
|
-
properties:
|
|
1881
|
-
required:
|
|
1882
|
-
},
|
|
2390
|
+
], Sn = {
|
|
2391
|
+
$schema: jn,
|
|
2392
|
+
$id: Ln,
|
|
2393
|
+
title: Nn,
|
|
2394
|
+
description: An,
|
|
2395
|
+
type: Rn,
|
|
2396
|
+
properties: Un,
|
|
2397
|
+
required: qn
|
|
2398
|
+
}, je = {
|
|
1883
2399
|
initialState: {
|
|
1884
2400
|
type: Object,
|
|
1885
2401
|
default: {
|
|
@@ -1889,142 +2405,142 @@ const Qt = "https://json-schema.org/draft/2020-12/schema", Yt = "https://farris-
|
|
|
1889
2405
|
uniqueColClassInEL: 2
|
|
1890
2406
|
}
|
|
1891
2407
|
}
|
|
1892
|
-
},
|
|
2408
|
+
}, Gn = ae(je, Sn, ht, bt), zn = /* @__PURE__ */ ee({
|
|
1893
2409
|
name: "FResponseFormLayoutSetting",
|
|
1894
|
-
props:
|
|
2410
|
+
props: je,
|
|
1895
2411
|
emits: ["change"],
|
|
1896
2412
|
setup(e, t) {
|
|
1897
|
-
const n = [1], o = [1, 2],
|
|
1898
|
-
let
|
|
1899
|
-
const
|
|
1900
|
-
function
|
|
1901
|
-
const
|
|
1902
|
-
n.includes(
|
|
2413
|
+
const n = [1], o = [1, 2], a = [1, 2, 3, 4], m = [1, 2, 3, 4, 6];
|
|
2414
|
+
let g = [], V = [], T = [], l = [];
|
|
2415
|
+
const b = R(e.initialState), i = R(-1), c = R(-1), F = R(-1), u = R(-1);
|
|
2416
|
+
function f() {
|
|
2417
|
+
const h = "自定义", j = 12 / b.value.uniqueColClassInSM;
|
|
2418
|
+
n.includes(j) ? i.value = j : (g.push({
|
|
1903
2419
|
value: 0,
|
|
1904
|
-
name:
|
|
2420
|
+
name: h
|
|
1905
2421
|
}), i.value = 0);
|
|
1906
|
-
const
|
|
1907
|
-
o.includes(
|
|
2422
|
+
const O = 12 / b.value.uniqueColClassInMD;
|
|
2423
|
+
o.includes(O) ? c.value = O : (V.push({
|
|
1908
2424
|
value: 0,
|
|
1909
|
-
name:
|
|
1910
|
-
}),
|
|
1911
|
-
const
|
|
1912
|
-
|
|
2425
|
+
name: h
|
|
2426
|
+
}), c.value = 0);
|
|
2427
|
+
const N = 12 / b.value.uniqueColClassInLG;
|
|
2428
|
+
a.includes(N) ? F.value = N : (T.push({
|
|
1913
2429
|
value: 0,
|
|
1914
|
-
name:
|
|
1915
|
-
}),
|
|
1916
|
-
const B = 12 /
|
|
1917
|
-
m.includes(B) ?
|
|
2430
|
+
name: h
|
|
2431
|
+
}), F.value = 0);
|
|
2432
|
+
const B = 12 / b.value.uniqueColClassInEL;
|
|
2433
|
+
m.includes(B) ? u.value = B : (l.push({
|
|
1918
2434
|
value: 0,
|
|
1919
|
-
name:
|
|
1920
|
-
}),
|
|
2435
|
+
name: h
|
|
2436
|
+
}), u.value = 0), g = [...g], V = [...V], T = [...T], l = [...l];
|
|
1921
2437
|
}
|
|
1922
|
-
function
|
|
1923
|
-
n.forEach((
|
|
1924
|
-
|
|
1925
|
-
value:
|
|
1926
|
-
name:
|
|
2438
|
+
function w() {
|
|
2439
|
+
n.forEach((h) => {
|
|
2440
|
+
g.push({
|
|
2441
|
+
value: h,
|
|
2442
|
+
name: h + ""
|
|
1927
2443
|
});
|
|
1928
|
-
}), o.forEach((
|
|
1929
|
-
|
|
1930
|
-
value:
|
|
1931
|
-
name:
|
|
2444
|
+
}), o.forEach((h) => {
|
|
2445
|
+
V.push({
|
|
2446
|
+
value: h,
|
|
2447
|
+
name: h + ""
|
|
1932
2448
|
});
|
|
1933
|
-
}),
|
|
1934
|
-
|
|
1935
|
-
value:
|
|
1936
|
-
name:
|
|
2449
|
+
}), a.forEach((h) => {
|
|
2450
|
+
T.push({
|
|
2451
|
+
value: h,
|
|
2452
|
+
name: h + ""
|
|
1937
2453
|
});
|
|
1938
|
-
}), m.forEach((
|
|
1939
|
-
|
|
1940
|
-
value:
|
|
1941
|
-
name:
|
|
2454
|
+
}), m.forEach((h) => {
|
|
2455
|
+
l.push({
|
|
2456
|
+
value: h,
|
|
2457
|
+
name: h + ""
|
|
1942
2458
|
});
|
|
1943
2459
|
});
|
|
1944
2460
|
}
|
|
1945
|
-
function
|
|
1946
|
-
|
|
1947
|
-
|
|
2461
|
+
function k() {
|
|
2462
|
+
pt.question("应用统一布局,将重置区域内部所有控件的宽度样式,确定应用?", "", () => {
|
|
2463
|
+
b.value.uniqueColClassInSM = i.value === 0 ? null : 12 / i.value, b.value.uniqueColClassInMD = c.value === 0 ? null : 12 / c.value, b.value.uniqueColClassInLG = F.value === 0 ? null : 12 / F.value, b.value.uniqueColClassInEL = u.value === 0 ? null : 12 / u.value, t.emit("change", b.value);
|
|
1948
2464
|
}, () => {
|
|
1949
2465
|
});
|
|
1950
2466
|
}
|
|
1951
|
-
return
|
|
1952
|
-
|
|
1953
|
-
}), () =>
|
|
2467
|
+
return ne(() => {
|
|
2468
|
+
w(), f();
|
|
2469
|
+
}), () => D("div", null, [D("div", {
|
|
1954
2470
|
class: "f-form-layout farris-form farris-form-controls-inline"
|
|
1955
|
-
}, [
|
|
2471
|
+
}, [D("div", {
|
|
1956
2472
|
class: "form-group farris-form-group screenGroup"
|
|
1957
|
-
}, [
|
|
2473
|
+
}, [D("span", {
|
|
1958
2474
|
class: "screenName"
|
|
1959
|
-
}, [Q(" 小屏幕 ")]),
|
|
2475
|
+
}, [Q(" 小屏幕 ")]), D("div", {
|
|
1960
2476
|
class: "d-flex ml-2 screen-input"
|
|
1961
|
-
}, [
|
|
1962
|
-
data:
|
|
2477
|
+
}, [D(se, {
|
|
2478
|
+
data: g,
|
|
1963
2479
|
idField: "value",
|
|
1964
2480
|
valueField: "value",
|
|
1965
2481
|
editable: !1,
|
|
1966
2482
|
enableClear: !1,
|
|
1967
2483
|
modelValue: i.value,
|
|
1968
|
-
"onUpdate:modelValue": (
|
|
1969
|
-
}, null),
|
|
2484
|
+
"onUpdate:modelValue": (h) => i.value = h
|
|
2485
|
+
}, null), D("span", {
|
|
1970
2486
|
class: "ml-2 columnText"
|
|
1971
|
-
}, [Q("列")])])]),
|
|
2487
|
+
}, [Q("列")])])]), D("div", {
|
|
1972
2488
|
class: "form-group farris-form-group screenGroup"
|
|
1973
|
-
}, [
|
|
2489
|
+
}, [D("span", {
|
|
1974
2490
|
class: "screenName"
|
|
1975
|
-
}, [Q("中等屏幕")]),
|
|
2491
|
+
}, [Q("中等屏幕")]), D("div", {
|
|
1976
2492
|
class: "d-flex ml-2 screen-input"
|
|
1977
|
-
}, [
|
|
1978
|
-
data:
|
|
2493
|
+
}, [D(se, {
|
|
2494
|
+
data: V,
|
|
1979
2495
|
idField: "value",
|
|
1980
2496
|
valueField: "value",
|
|
1981
2497
|
editable: !1,
|
|
1982
2498
|
enableClear: !1,
|
|
1983
|
-
modelValue:
|
|
1984
|
-
"onUpdate:modelValue": (
|
|
1985
|
-
}, null),
|
|
2499
|
+
modelValue: c.value,
|
|
2500
|
+
"onUpdate:modelValue": (h) => c.value = h
|
|
2501
|
+
}, null), D("span", {
|
|
1986
2502
|
class: "ml-2 columnText"
|
|
1987
|
-
}, [Q("列")])])]),
|
|
2503
|
+
}, [Q("列")])])]), D("div", {
|
|
1988
2504
|
class: "form-group farris-form-group screenGroup"
|
|
1989
|
-
}, [
|
|
2505
|
+
}, [D("span", {
|
|
1990
2506
|
class: "screenName"
|
|
1991
|
-
}, [Q("大屏幕")]),
|
|
2507
|
+
}, [Q("大屏幕")]), D("div", {
|
|
1992
2508
|
class: "d-flex ml-2 screen-input"
|
|
1993
|
-
}, [
|
|
1994
|
-
data:
|
|
2509
|
+
}, [D(se, {
|
|
2510
|
+
data: T,
|
|
1995
2511
|
idField: "value",
|
|
1996
2512
|
valueField: "value",
|
|
1997
2513
|
editable: !1,
|
|
1998
2514
|
enableClear: !1,
|
|
1999
|
-
modelValue:
|
|
2000
|
-
"onUpdate:modelValue": (
|
|
2001
|
-
}, null),
|
|
2515
|
+
modelValue: F.value,
|
|
2516
|
+
"onUpdate:modelValue": (h) => F.value = h
|
|
2517
|
+
}, null), D("span", {
|
|
2002
2518
|
class: "ml-2 columnText"
|
|
2003
|
-
}, [Q("列")])])]),
|
|
2519
|
+
}, [Q("列")])])]), D("div", {
|
|
2004
2520
|
class: "form-group farris-form-group screenGroup"
|
|
2005
|
-
}, [
|
|
2521
|
+
}, [D("span", {
|
|
2006
2522
|
class: "screenName"
|
|
2007
|
-
}, [Q("极大屏幕")]),
|
|
2523
|
+
}, [Q("极大屏幕")]), D("div", {
|
|
2008
2524
|
class: "d-flex ml-2 screen-input"
|
|
2009
|
-
}, [
|
|
2010
|
-
data:
|
|
2525
|
+
}, [D(se, {
|
|
2526
|
+
data: l,
|
|
2011
2527
|
idField: "value",
|
|
2012
2528
|
valueField: "value",
|
|
2013
2529
|
editable: !1,
|
|
2014
2530
|
enableClear: !1,
|
|
2015
|
-
modelValue:
|
|
2016
|
-
"onUpdate:modelValue": (
|
|
2017
|
-
}, null),
|
|
2531
|
+
modelValue: u.value,
|
|
2532
|
+
"onUpdate:modelValue": (h) => u.value = h
|
|
2533
|
+
}, null), D("span", {
|
|
2018
2534
|
class: "ml-2 columnText"
|
|
2019
|
-
}, [Q("列")])])])]),
|
|
2535
|
+
}, [Q("列")])])])]), D("div", {
|
|
2020
2536
|
class: "applyBtn"
|
|
2021
|
-
}, [
|
|
2537
|
+
}, [D("button", {
|
|
2022
2538
|
class: "btn f-rt-btn btn-primary",
|
|
2023
2539
|
type: "button",
|
|
2024
|
-
onClick: () =>
|
|
2540
|
+
onClick: () => k()
|
|
2025
2541
|
}, [Q("应用")])])]);
|
|
2026
2542
|
}
|
|
2027
|
-
}),
|
|
2543
|
+
}), Zn = "https://json-schema.org/draft/2020-12/schema", Wn = "https://farris-design.gitee.io/form-group.schema.json", Jn = "form-group", _n = "A Farris Input Component", Xn = "object", Qn = {
|
|
2028
2544
|
id: {
|
|
2029
2545
|
description: "The unique identifier for a form group",
|
|
2030
2546
|
type: "string"
|
|
@@ -2032,7 +2548,7 @@ const Qt = "https://json-schema.org/draft/2020-12/schema", Yt = "https://farris-
|
|
|
2032
2548
|
type: {
|
|
2033
2549
|
description: "The type string of form group component",
|
|
2034
2550
|
type: "string",
|
|
2035
|
-
default: "
|
|
2551
|
+
default: "form-group"
|
|
2036
2552
|
},
|
|
2037
2553
|
appearance: {
|
|
2038
2554
|
description: "",
|
|
@@ -2047,72 +2563,27 @@ const Qt = "https://json-schema.org/draft/2020-12/schema", Yt = "https://farris-
|
|
|
2047
2563
|
},
|
|
2048
2564
|
default: {}
|
|
2049
2565
|
},
|
|
2050
|
-
|
|
2051
|
-
description: "",
|
|
2052
|
-
type: "array",
|
|
2053
|
-
default: []
|
|
2054
|
-
},
|
|
2055
|
-
visible: {
|
|
2056
|
-
description: "",
|
|
2057
|
-
type: "boolean",
|
|
2058
|
-
default: !0
|
|
2059
|
-
},
|
|
2060
|
-
labelAutoOverflow: {
|
|
2566
|
+
enableLinkLabel: {
|
|
2061
2567
|
description: "",
|
|
2062
2568
|
type: "boolean",
|
|
2063
2569
|
default: !1
|
|
2064
2570
|
},
|
|
2065
|
-
|
|
2066
|
-
description: "",
|
|
2067
|
-
type: "boolean",
|
|
2068
|
-
default: !0
|
|
2069
|
-
}
|
|
2070
|
-
}, mn = [
|
|
2071
|
-
"id",
|
|
2072
|
-
"type",
|
|
2073
|
-
"contents"
|
|
2074
|
-
], fn = {
|
|
2075
|
-
$schema: ln,
|
|
2076
|
-
$id: sn,
|
|
2077
|
-
title: cn,
|
|
2078
|
-
description: un,
|
|
2079
|
-
type: pn,
|
|
2080
|
-
properties: dn,
|
|
2081
|
-
required: mn
|
|
2082
|
-
}, yn = "https://json-schema.org/draft/2020-12/schema", gn = "https://farris-design.gitee.io/form-group.schema.json", vn = "form-group", bn = "A Farris Input Component", hn = "object", Cn = {
|
|
2083
|
-
id: {
|
|
2084
|
-
description: "The unique identifier for a form group",
|
|
2085
|
-
type: "string"
|
|
2086
|
-
},
|
|
2087
|
-
type: {
|
|
2088
|
-
description: "The type string of form group component",
|
|
2089
|
-
type: "string",
|
|
2090
|
-
default: "form-group"
|
|
2091
|
-
},
|
|
2092
|
-
appearance: {
|
|
2571
|
+
editor: {
|
|
2093
2572
|
description: "",
|
|
2094
2573
|
type: "object",
|
|
2095
|
-
|
|
2096
|
-
class: {
|
|
2097
|
-
type: "string"
|
|
2098
|
-
},
|
|
2099
|
-
style: {
|
|
2100
|
-
type: "string"
|
|
2101
|
-
}
|
|
2102
|
-
},
|
|
2103
|
-
default: {}
|
|
2574
|
+
default: null
|
|
2104
2575
|
},
|
|
2105
|
-
|
|
2576
|
+
label: {
|
|
2106
2577
|
description: "",
|
|
2107
|
-
type: "
|
|
2108
|
-
default:
|
|
2578
|
+
type: "string",
|
|
2579
|
+
default: ""
|
|
2109
2580
|
},
|
|
2110
|
-
|
|
2581
|
+
titleDataSource: {
|
|
2111
2582
|
description: "",
|
|
2112
2583
|
type: "object",
|
|
2113
2584
|
default: null
|
|
2114
2585
|
},
|
|
2115
|
-
|
|
2586
|
+
titleSourceType: {
|
|
2116
2587
|
description: "",
|
|
2117
2588
|
type: "string",
|
|
2118
2589
|
default: ""
|
|
@@ -2153,41 +2624,59 @@ const Qt = "https://json-schema.org/draft/2020-12/schema", Yt = "https://farris-
|
|
|
2153
2624
|
fill: {
|
|
2154
2625
|
type: "boolean",
|
|
2155
2626
|
default: !1
|
|
2627
|
+
},
|
|
2628
|
+
enableTips: {
|
|
2629
|
+
description: "",
|
|
2630
|
+
type: "boolean",
|
|
2631
|
+
default: !1
|
|
2632
|
+
},
|
|
2633
|
+
tipsContent: {
|
|
2634
|
+
description: "",
|
|
2635
|
+
type: "string",
|
|
2636
|
+
default: ""
|
|
2637
|
+
},
|
|
2638
|
+
linkLabel: {
|
|
2639
|
+
description: "",
|
|
2640
|
+
type: "string",
|
|
2641
|
+
default: !1
|
|
2642
|
+
},
|
|
2643
|
+
modelValue: {
|
|
2644
|
+
description: "",
|
|
2645
|
+
type: "string"
|
|
2156
2646
|
}
|
|
2157
|
-
},
|
|
2647
|
+
}, Yn = [
|
|
2158
2648
|
"id",
|
|
2159
2649
|
"type",
|
|
2160
2650
|
"editor"
|
|
2161
|
-
],
|
|
2162
|
-
$schema:
|
|
2163
|
-
$id:
|
|
2164
|
-
title:
|
|
2165
|
-
description:
|
|
2166
|
-
type:
|
|
2167
|
-
properties:
|
|
2168
|
-
required:
|
|
2169
|
-
},
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2651
|
+
], Le = {
|
|
2652
|
+
$schema: Zn,
|
|
2653
|
+
$id: Wn,
|
|
2654
|
+
title: Jn,
|
|
2655
|
+
description: _n,
|
|
2656
|
+
type: Xn,
|
|
2657
|
+
properties: Qn,
|
|
2658
|
+
required: Yn
|
|
2659
|
+
}, Ne = ae(
|
|
2660
|
+
we,
|
|
2661
|
+
Le,
|
|
2662
|
+
oe,
|
|
2173
2663
|
void 0
|
|
2174
|
-
),
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2664
|
+
), Hn = _e(), Kn = ae(
|
|
2665
|
+
qe,
|
|
2666
|
+
Le,
|
|
2667
|
+
oe,
|
|
2178
2668
|
void 0
|
|
2179
2669
|
);
|
|
2180
|
-
|
|
2181
|
-
e["form-group"] =
|
|
2670
|
+
pe.register = (e, t, n, o) => {
|
|
2671
|
+
e["form-group"] = Se, t["form-group"] = Ne, e["response-form"] = Ge, t["response-form"] = jt, e["form-input"] = ze, t["form-input"] = Kn, o["form-group"] = { editorResolver: Hn }, e["response-form-layout-setting"] = zn, t["response-form-layout-setting"] = Gn, e["dynamic-form"] = qt, t["dynamic-form"] = Lt;
|
|
2182
2672
|
};
|
|
2183
|
-
|
|
2184
|
-
e["form-group"] =
|
|
2673
|
+
pe.registerDesigner = (e, t, n) => {
|
|
2674
|
+
e["form-group"] = On, t["form-group"] = Ne, e["response-form"] = pe, t["response-form"] = Nt, e["dynamic-form"] = Ut, t["dynamic-form"] = At;
|
|
2185
2675
|
};
|
|
2186
2676
|
export {
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
ke as formPropsResolver
|
|
2677
|
+
pe as FResponseFormDesign,
|
|
2678
|
+
pe as default,
|
|
2679
|
+
Hn as editorResolver,
|
|
2680
|
+
Ne as formGroupPropsResolver,
|
|
2681
|
+
Kn as formInputPropsResolver
|
|
2193
2682
|
};
|