@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,111 +1,691 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import
|
|
48
|
-
import
|
|
49
|
-
import
|
|
50
|
-
import
|
|
51
|
-
import
|
|
52
|
-
import
|
|
53
|
-
import
|
|
54
|
-
import
|
|
55
|
-
import
|
|
56
|
-
import
|
|
57
|
-
import
|
|
58
|
-
import
|
|
59
|
-
import
|
|
60
|
-
import
|
|
61
|
-
import
|
|
62
|
-
import
|
|
63
|
-
import
|
|
64
|
-
import
|
|
65
|
-
import
|
|
66
|
-
import
|
|
67
|
-
import
|
|
68
|
-
import
|
|
69
|
-
import
|
|
70
|
-
import
|
|
71
|
-
import
|
|
72
|
-
import
|
|
73
|
-
import
|
|
74
|
-
import
|
|
75
|
-
import
|
|
76
|
-
import
|
|
77
|
-
import
|
|
78
|
-
import
|
|
79
|
-
import
|
|
80
|
-
import
|
|
81
|
-
import
|
|
82
|
-
import
|
|
83
|
-
import
|
|
84
|
-
|
|
1
|
+
var Pe = Object.defineProperty;
|
|
2
|
+
var Be = (t, e, r) => e in t ? Pe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var re = (t, e, r) => Be(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { defineComponent as te, ref as U, computed as J, onMounted as ke, watch as z, withDirectives as he, createVNode as q, resolveDirective as Fe, reactive as ce, createTextVNode as Ee, mergeProps as be } from "vue";
|
|
5
|
+
import { resolveAppearance as Ue, createPropsResolver as le, schemaResolverMap as Le, propertyEffectMap as Oe, propertyConfigSchemaMap as Ne, schemaMap as ve } from "../dynamic-resolver/index.esm.js";
|
|
6
|
+
import { FormSchemaEntityField$Type as ue, FormSchemaEntityFieldTypeName as pe, getCustomClass as Ve, useThirdComponent as De, isMobilePhone as Re, useGuid as me } from "../common/index.esm.js";
|
|
7
|
+
import { cloneDeep as Ae, mergeWith as je, merge as $e } from "lodash-es";
|
|
8
|
+
import { LocaleService as Ie } from "../locale/index.esm.js";
|
|
9
|
+
import { loadRegister as qe, useComponentManager as xe, useBindingData as Ge, useEntityState as We, useDynamicViewUtils as Ke, componentMap as ae, resolverMap as _e } from "../dynamic-view/index.esm.js";
|
|
10
|
+
import Xe from "../accordion/index.esm.js";
|
|
11
|
+
import Je from "../avatar/index.esm.js";
|
|
12
|
+
import Qe from "../../designer/button-edit/index.esm.js";
|
|
13
|
+
import ze from "../button-group/index.esm.js";
|
|
14
|
+
import Ye from "../calendar/index.esm.js";
|
|
15
|
+
import Ze from "../../designer/capsule/index.esm.js";
|
|
16
|
+
import de from "../../designer/checkbox/index.esm.js";
|
|
17
|
+
import fe from "../../designer/checkbox-group/index.esm.js";
|
|
18
|
+
import Se from "../combo-list/index.esm.js";
|
|
19
|
+
import He from "../combo-tree/index.esm.js";
|
|
20
|
+
import et from "../component/index.esm.js";
|
|
21
|
+
import tt from "../color-picker/index.esm.js";
|
|
22
|
+
import ot from "../content-container/index.esm.js";
|
|
23
|
+
import nt from "../../designer/date-picker/index.esm.js";
|
|
24
|
+
import rt from "../../designer/data-grid/index.esm.js";
|
|
25
|
+
import st from "../dropdown/index.esm.js";
|
|
26
|
+
import it from "../../designer/dynamic-form/index.esm.js";
|
|
27
|
+
import at from "../events-editor/index.esm.js";
|
|
28
|
+
import lt from "../filter-bar/index.esm.js";
|
|
29
|
+
import ct from "../field-selector/index.esm.js";
|
|
30
|
+
import ut from "../binding-selector/index.esm.js";
|
|
31
|
+
import pt from "../image-cropper/index.esm.js";
|
|
32
|
+
import mt from "../../designer/input-group/index.esm.js";
|
|
33
|
+
import dt from "../layout/index.esm.js";
|
|
34
|
+
import ft from "../list-nav/index.esm.js";
|
|
35
|
+
import yt from "../../designer/list-view/index.esm.js";
|
|
36
|
+
import gt from "../lookup/index.esm.js";
|
|
37
|
+
import Ct from "../mapping-editor/index.esm.js";
|
|
38
|
+
import ht from "../nav/index.esm.js";
|
|
39
|
+
import Ft from "../number-range/index.esm.js";
|
|
40
|
+
import bt from "../../designer/number-spinner/index.esm.js";
|
|
41
|
+
import vt from "../order/index.esm.js";
|
|
42
|
+
import Vt from "../page-header/index.esm.js";
|
|
43
|
+
import It from "../page-footer/index.esm.js";
|
|
44
|
+
import Tt from "../pagination/index.esm.js";
|
|
45
|
+
import Mt from "../progress/index.esm.js";
|
|
46
|
+
import wt from "../query-solution/index.esm.js";
|
|
47
|
+
import Pt from "../../designer/radio-group/index.esm.js";
|
|
48
|
+
import Bt from "../../designer/rate/index.esm.js";
|
|
49
|
+
import kt from "../../designer/response-toolbar/index.esm.js";
|
|
50
|
+
import Et from "../response-layout/index.esm.js";
|
|
51
|
+
import Ut, { useResponseLayoutEditorSetting as Lt } from "../../designer/response-layout-editor/index.esm.js";
|
|
52
|
+
import Ot from "../search-box/index.esm.js";
|
|
53
|
+
import Nt from "../../designer/section/index.esm.js";
|
|
54
|
+
import Dt from "../smoke-detector/index.esm.js";
|
|
55
|
+
import Rt from "../splitter/index.esm.js";
|
|
56
|
+
import At from "../step/index.esm.js";
|
|
57
|
+
import jt from "../../designer/switch/index.esm.js";
|
|
58
|
+
import $t from "../../designer/tabs/index.esm.js";
|
|
59
|
+
import qt from "../../designer/tags/index.esm.js";
|
|
60
|
+
import xt from "../text/index.esm.js";
|
|
61
|
+
import Gt from "../../designer/time-picker/index.esm.js";
|
|
62
|
+
import Wt from "../transfer/index.esm.js";
|
|
63
|
+
import Kt from "../tree-view/index.esm.js";
|
|
64
|
+
import _t from "../uploader/index.esm.js";
|
|
65
|
+
import Xt from "../verify-detail/index.esm.js";
|
|
66
|
+
import Jt from "../video/index.esm.js";
|
|
67
|
+
import Qt from "../../designer/textarea/index.esm.js";
|
|
68
|
+
import zt from "../schema-selector/index.esm.js";
|
|
69
|
+
import Yt from "../../designer/tree-grid/index.esm.js";
|
|
70
|
+
import Zt from "../event-parameter/index.esm.js";
|
|
71
|
+
import St from "../filter-condition-editor/index.esm.js";
|
|
72
|
+
import Ht from "../fieldset/index.esm.js";
|
|
73
|
+
import eo from "../sort-condition-editor/index.esm.js";
|
|
74
|
+
import to from "../menu-lookup/index.esm.js";
|
|
75
|
+
import oo from "../../designer/drawer/index.esm.js";
|
|
76
|
+
import no from "../json-editor/index.esm.js";
|
|
77
|
+
import ro from "../property-editor/index.esm.js";
|
|
78
|
+
import so from "../expression-editor/index.esm.js";
|
|
79
|
+
import io from "../code-editor/index.esm.js";
|
|
80
|
+
import ao from "../html-template/index.esm.js";
|
|
81
|
+
import lo from "../collection-property-editor/index.esm.js";
|
|
82
|
+
import co from "../../designer/modal/index.esm.js";
|
|
83
|
+
import uo from "../external-container/index.esm.js";
|
|
84
|
+
import po from "../language-textbox/index.esm.js";
|
|
85
|
+
import mo from "../image/index.esm.js";
|
|
86
|
+
import fo from "../comment/index.esm.js";
|
|
87
|
+
import { DgControl as ee, refreshCanvas as yo, UseTemplateDragAndDropRules as go, useDragulaCommonRule as Co } from "../designer-canvas/index.esm.js";
|
|
88
|
+
import { BaseControlProperty as ho, FormBindingType as S } from "../property-panel/index.esm.js";
|
|
89
|
+
const Fo = "root-viewmodel";
|
|
90
|
+
class bo {
|
|
91
|
+
constructor(e, r) {
|
|
92
|
+
re(this, "formSchemaUtils");
|
|
93
|
+
re(this, "controlCreatorUtils");
|
|
94
|
+
re(this, "designViewModelUtils");
|
|
95
|
+
this.resolver = e, this.designerHostService = r, this.formSchemaUtils = this.designerHostService.formSchemaUtils, this.controlCreatorUtils = this.designerHostService.controlCreatorUtils, this.designViewModelUtils = this.designerHostService.designViewModelUtils;
|
|
96
|
+
}
|
|
97
|
+
createComponent(e) {
|
|
98
|
+
const r = this.createComponentRefNode(e), f = this.createComponentNode(e), i = this.createViewModeNode(e), F = this.formSchemaUtils.getFormSchema();
|
|
99
|
+
return F.module.viewmodels.push(i), F.module.components.push(f), this.designViewModelUtils.assembleDesignViewModel(), r;
|
|
100
|
+
}
|
|
101
|
+
createComponentRefNode(e) {
|
|
102
|
+
const r = this.resolver.getSchemaByType("component-ref");
|
|
103
|
+
return Object.assign(r, {
|
|
104
|
+
id: `${e.componentId}-component-ref`,
|
|
105
|
+
component: `${e.componentId}-component`
|
|
106
|
+
}), r;
|
|
107
|
+
}
|
|
108
|
+
createComponentNode(e) {
|
|
109
|
+
const r = this.resolver.getSchemaByType("component"), f = this.createFormComponentContents(e);
|
|
110
|
+
return Object.assign(r, {
|
|
111
|
+
id: `${e.componentId}-component`,
|
|
112
|
+
viewModel: `${e.componentId}-component-viewmodel`,
|
|
113
|
+
componentType: e.componentType,
|
|
114
|
+
appearance: {
|
|
115
|
+
class: this.getFormComponentClass(e)
|
|
116
|
+
},
|
|
117
|
+
formColumns: e.formColumns,
|
|
118
|
+
contents: f
|
|
119
|
+
}), r;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* 获取卡片组件层级的class样式
|
|
123
|
+
*/
|
|
124
|
+
getFormComponentClass(e) {
|
|
125
|
+
var f, i;
|
|
126
|
+
const { templateId: r } = this.formSchemaUtils.getFormSchema().module;
|
|
127
|
+
if (r === "double-list-in-tab-template" && ((i = (f = e.parentComponentInstance) == null ? void 0 : f.schema) == null ? void 0 : i.type) === "tab-page") {
|
|
128
|
+
const F = e.parentComponentInstance.parent && e.parentComponentInstance.parent.schema;
|
|
129
|
+
if ((F == null ? void 0 : F.type) === "tabs" && (F == null ? void 0 : F.fill) === !0)
|
|
130
|
+
return "f-struct-wrapper f-utils-fill-flex-column";
|
|
131
|
+
}
|
|
132
|
+
return "f-struct-wrapper";
|
|
133
|
+
}
|
|
134
|
+
createFormComponentContents(e) {
|
|
135
|
+
var T, V;
|
|
136
|
+
const r = this.resolver.getSchemaByType("section");
|
|
137
|
+
Object.assign(r, {
|
|
138
|
+
id: e.componentId + "-form-section",
|
|
139
|
+
appearance: {
|
|
140
|
+
class: "f-section-form f-section-in-mainsubcard"
|
|
141
|
+
},
|
|
142
|
+
mainTitle: e.componentName
|
|
143
|
+
});
|
|
144
|
+
const f = this.resolver.getSchemaByType("response-form"), i = [];
|
|
145
|
+
Object.assign(f, {
|
|
146
|
+
id: e.componentId + "-form",
|
|
147
|
+
appearance: {
|
|
148
|
+
class: "f-form-layout farris-form farris-form-controls-inline"
|
|
149
|
+
},
|
|
150
|
+
contents: i,
|
|
151
|
+
controlsInline: !0
|
|
152
|
+
}), r.contents = [f];
|
|
153
|
+
const { selectedFields: F } = e;
|
|
154
|
+
F == null || F.forEach((C) => {
|
|
155
|
+
if (C.$type === ue.SimpleField) {
|
|
156
|
+
const w = Ae(C), b = this.resolveControlClassByFormColumns(e), I = this.controlCreatorUtils.setFormFieldProperty(w, "", b);
|
|
157
|
+
I && i.push(I);
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
const { templateId: v } = this.formSchemaUtils.getFormSchema().module;
|
|
161
|
+
if (v === "double-list-in-tab-template" && ((V = (T = e.parentComponentInstance) == null ? void 0 : T.schema) == null ? void 0 : V.type) === "tab-page") {
|
|
162
|
+
const C = e.parentComponentInstance.parent && e.parentComponentInstance.parent.schema;
|
|
163
|
+
(C == null ? void 0 : C.type) === "tabs" && (C == null ? void 0 : C.fill) === !0 && (r.appearance.class = "f-section-grid f-section-in-main px-0 pt-0", r.fill = !0);
|
|
164
|
+
}
|
|
165
|
+
return [r];
|
|
166
|
+
}
|
|
167
|
+
resolveControlClassByFormColumns(e) {
|
|
168
|
+
let r = "";
|
|
169
|
+
switch (e.formColumns) {
|
|
170
|
+
case 1: {
|
|
171
|
+
r = "col-12 col-md-12 col-xl-12 col-el-12";
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
case 2: {
|
|
175
|
+
r = "col-12 col-md-6 col-xl-6 col-el-6";
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
case 3: {
|
|
179
|
+
r = "col-12 col-md-6 col-xl-4 col-el-4";
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
case 4: {
|
|
183
|
+
r = "col-12 col-md-6 col-xl-3 col-el-2";
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return r;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* 添加viewModel节点
|
|
191
|
+
*/
|
|
192
|
+
createViewModeNode(e) {
|
|
193
|
+
return {
|
|
194
|
+
id: `${e.componentId}-component-viewmodel`,
|
|
195
|
+
code: `${e.componentId}-component-viewmodel`,
|
|
196
|
+
name: e.componentName,
|
|
197
|
+
bindTo: e.bindTo,
|
|
198
|
+
parent: Fo,
|
|
199
|
+
fields: this.assembleViewModelFields(e),
|
|
200
|
+
commands: [],
|
|
201
|
+
states: [],
|
|
202
|
+
enableValidation: !0
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* 组装viewModel fields 节点
|
|
207
|
+
*/
|
|
208
|
+
assembleViewModelFields(e) {
|
|
209
|
+
const r = [], { selectedFields: f } = e;
|
|
210
|
+
return f == null || f.forEach((i) => {
|
|
211
|
+
if (i.$type === ue.SimpleField) {
|
|
212
|
+
let F = "blur";
|
|
213
|
+
const v = i.type.name;
|
|
214
|
+
(v === pe.Enum || v === pe.Boolean) && (F = "change"), r.push({
|
|
215
|
+
type: "Form",
|
|
216
|
+
id: i.id,
|
|
217
|
+
fieldName: i.bindingField,
|
|
218
|
+
groupId: null,
|
|
219
|
+
groupName: null,
|
|
220
|
+
updateOn: F,
|
|
221
|
+
fieldSchema: {}
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
}), r;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
function Te(t, e, r, f) {
|
|
228
|
+
var F, v, T, V, C, w;
|
|
229
|
+
const i = r.parentComponentInstance;
|
|
230
|
+
if (i && f) {
|
|
231
|
+
const b = (F = i.schema) == null ? void 0 : F.type, R = {
|
|
232
|
+
componentId: `form-${Math.random().toString(36).slice(2, 6)}`,
|
|
233
|
+
componentName: ((v = r.bindingSourceContext) == null ? void 0 : v.entityTitle) || ((V = (T = r.bindingSourceContext) == null ? void 0 : T.bindingEntity) == null ? void 0 : V.name) || "标题",
|
|
234
|
+
componentType: "form",
|
|
235
|
+
formColumns: b === "splitter-pane" ? 1 : 4,
|
|
236
|
+
parentContainerId: i.schema.id,
|
|
237
|
+
parentComponentInstance: i,
|
|
238
|
+
bindTo: ((C = r.bindingSourceContext) == null ? void 0 : C.bindTo) || "/",
|
|
239
|
+
selectedFields: (w = r.bindingSourceContext) == null ? void 0 : w.bindingEntityFields
|
|
240
|
+
};
|
|
241
|
+
return new bo(t, f).createComponent(R);
|
|
242
|
+
} else
|
|
243
|
+
return e;
|
|
244
|
+
}
|
|
245
|
+
const vo = "https://json-schema.org/draft/2020-12/schema", Vo = "https://farris-design.gitee.io/response-form.schema.json", Io = "response-form", To = "A Farris Data Collection Component", Mo = "object", wo = {
|
|
246
|
+
id: {
|
|
247
|
+
description: "The unique identifier for a form group",
|
|
248
|
+
type: "string"
|
|
249
|
+
},
|
|
250
|
+
type: {
|
|
251
|
+
description: "The type string of form group component",
|
|
252
|
+
type: "string",
|
|
253
|
+
default: "response-form"
|
|
254
|
+
},
|
|
255
|
+
appearance: {
|
|
256
|
+
description: "",
|
|
257
|
+
type: "object",
|
|
258
|
+
properties: {
|
|
259
|
+
class: {
|
|
260
|
+
type: "string"
|
|
261
|
+
},
|
|
262
|
+
style: {
|
|
263
|
+
type: "string"
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
default: {}
|
|
267
|
+
},
|
|
268
|
+
contents: {
|
|
269
|
+
description: "",
|
|
270
|
+
type: "array",
|
|
271
|
+
default: []
|
|
272
|
+
},
|
|
273
|
+
visible: {
|
|
274
|
+
description: "",
|
|
275
|
+
type: "boolean",
|
|
276
|
+
default: !0
|
|
277
|
+
},
|
|
278
|
+
labelAutoOverflow: {
|
|
279
|
+
description: "",
|
|
280
|
+
type: "boolean",
|
|
281
|
+
default: !1
|
|
282
|
+
},
|
|
283
|
+
adaptForLanguage: {
|
|
284
|
+
description: "",
|
|
285
|
+
type: "boolean",
|
|
286
|
+
default: !0
|
|
287
|
+
},
|
|
288
|
+
layout: {
|
|
289
|
+
description: "",
|
|
290
|
+
type: "string",
|
|
291
|
+
default: "col-12 col-md-6 col-xl-3 col-el-2"
|
|
292
|
+
},
|
|
293
|
+
fields: {
|
|
294
|
+
description: "",
|
|
295
|
+
type: "array"
|
|
296
|
+
},
|
|
297
|
+
formData: {
|
|
298
|
+
description: "",
|
|
299
|
+
type: "object"
|
|
300
|
+
},
|
|
301
|
+
formType: {
|
|
302
|
+
description: "",
|
|
303
|
+
type: "string",
|
|
304
|
+
default: "static"
|
|
305
|
+
}
|
|
306
|
+
}, Po = [
|
|
307
|
+
"id",
|
|
308
|
+
"type",
|
|
309
|
+
"contents"
|
|
310
|
+
], Bo = {
|
|
311
|
+
$schema: vo,
|
|
312
|
+
$id: Vo,
|
|
313
|
+
title: Io,
|
|
314
|
+
description: To,
|
|
315
|
+
type: Mo,
|
|
316
|
+
properties: wo,
|
|
317
|
+
required: Po
|
|
318
|
+
}, Me = /* @__PURE__ */ new Map([
|
|
319
|
+
["appearance", Ue]
|
|
320
|
+
]), ko = "https://json-schema.org/draft/2020-12/schema", Eo = "https://farris-design.gitee.io/dynamic-form.schema.json", Uo = "dynamic-form", Lo = "A Farris Data Collection Component", Oo = "object", No = {
|
|
321
|
+
id: {
|
|
322
|
+
description: "The unique identifier for a form group",
|
|
323
|
+
type: "string"
|
|
324
|
+
},
|
|
325
|
+
type: {
|
|
326
|
+
description: "The type string of form group component",
|
|
327
|
+
type: "string",
|
|
328
|
+
default: "dynamic-form"
|
|
329
|
+
},
|
|
330
|
+
appearance: {
|
|
331
|
+
description: "",
|
|
332
|
+
type: "object",
|
|
333
|
+
properties: {
|
|
334
|
+
class: {
|
|
335
|
+
type: "string"
|
|
336
|
+
},
|
|
337
|
+
style: {
|
|
338
|
+
type: "string"
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
default: {}
|
|
342
|
+
},
|
|
343
|
+
contents: {
|
|
344
|
+
description: "",
|
|
345
|
+
type: "array",
|
|
346
|
+
default: []
|
|
347
|
+
},
|
|
348
|
+
visible: {
|
|
349
|
+
description: "",
|
|
350
|
+
type: "boolean",
|
|
351
|
+
default: !0
|
|
352
|
+
},
|
|
353
|
+
labelAutoOverflow: {
|
|
354
|
+
description: "",
|
|
355
|
+
type: "boolean",
|
|
356
|
+
default: !1
|
|
357
|
+
},
|
|
358
|
+
adaptForLanguage: {
|
|
359
|
+
description: "",
|
|
360
|
+
type: "boolean",
|
|
361
|
+
default: !0
|
|
362
|
+
},
|
|
363
|
+
formType: {
|
|
364
|
+
description: "",
|
|
365
|
+
type: "string",
|
|
366
|
+
default: "dynamic"
|
|
367
|
+
},
|
|
368
|
+
layout: {
|
|
369
|
+
description: "",
|
|
370
|
+
type: "string",
|
|
371
|
+
default: "col-12 col-md-6 col-xl-3 col-el-2"
|
|
372
|
+
},
|
|
373
|
+
fields: {
|
|
374
|
+
description: "",
|
|
375
|
+
type: "array"
|
|
376
|
+
},
|
|
377
|
+
formData: {
|
|
378
|
+
description: "",
|
|
379
|
+
type: "object"
|
|
380
|
+
}
|
|
381
|
+
}, Do = [
|
|
382
|
+
"id",
|
|
383
|
+
"type",
|
|
384
|
+
"contents"
|
|
385
|
+
], Ro = {
|
|
386
|
+
$schema: ko,
|
|
387
|
+
$id: Eo,
|
|
388
|
+
title: Uo,
|
|
389
|
+
description: Lo,
|
|
390
|
+
type: Oo,
|
|
391
|
+
properties: No,
|
|
392
|
+
required: Do
|
|
393
|
+
}, ie = {
|
|
85
394
|
customClass: { type: String, default: "" },
|
|
86
395
|
customStyle: { type: String, defaut: "" },
|
|
87
396
|
/** 控制是否可见 */
|
|
88
397
|
visible: { type: Boolean, default: !0 },
|
|
89
398
|
/** 内部控件布局是否响应国际化 */
|
|
90
|
-
adaptForLanguage: { type: Boolean, default: !0 }
|
|
91
|
-
|
|
399
|
+
adaptForLanguage: { type: Boolean, default: !0 },
|
|
400
|
+
/** 绑定动态字段 */
|
|
401
|
+
fields: { type: Array, default: [] },
|
|
402
|
+
/** 绑定动态字段的值*/
|
|
403
|
+
formData: { type: Object, default: null },
|
|
404
|
+
/** 为动态字段指定样式*/
|
|
405
|
+
layout: { type: String, default: "col-12 col-md-6 col-xl-3 col-el-2" }
|
|
406
|
+
}, Ao = Object.assign({}, ie, {
|
|
407
|
+
// 是否渲染form层级
|
|
408
|
+
canRenderForm: { type: Boolean, default: !0 },
|
|
409
|
+
callback: { type: Function }
|
|
410
|
+
}), Pr = le(ie, Bo, Me, Te), Br = le(ie, Ro, Me, Te), se = /* @__PURE__ */ te({
|
|
411
|
+
name: "FDynamicForm",
|
|
412
|
+
props: Ao,
|
|
413
|
+
emits: ["update:modelValue", "event"],
|
|
414
|
+
setup(t, e) {
|
|
415
|
+
const r = U(t.fields), f = /* @__PURE__ */ new Map(), i = U(t.callback);
|
|
416
|
+
qe();
|
|
417
|
+
const F = xe(), v = U(t.formData || {}), T = Ge(v, e);
|
|
418
|
+
We(r.value).setup();
|
|
419
|
+
const C = /* @__PURE__ */ new Map(), w = U(t.canRenderForm), {
|
|
420
|
+
mergeArray: b,
|
|
421
|
+
resolveCallbacks: I,
|
|
422
|
+
resolveEvents: R
|
|
423
|
+
} = Ke(), G = J(() => {
|
|
424
|
+
const o = Ie.getLocale(), a = t.fields && t.fields.length > 0, m = {
|
|
425
|
+
"f-form-layout": a,
|
|
426
|
+
"farris-form": a
|
|
427
|
+
};
|
|
428
|
+
return t.adaptForLanguage && o && (m["farris-form-controls-inline"] = o !== "en"), Ve(m, t.customClass);
|
|
429
|
+
});
|
|
430
|
+
function K() {
|
|
431
|
+
function o(a, m) {
|
|
432
|
+
const {
|
|
433
|
+
id: g
|
|
434
|
+
} = a || {}, {
|
|
435
|
+
field: h
|
|
436
|
+
} = a.binding || {};
|
|
437
|
+
return {
|
|
438
|
+
modelValue: m.getValue(g),
|
|
439
|
+
"onUpdate:modelValue": (y) => {
|
|
440
|
+
m.setValue(g, h || g, y);
|
|
441
|
+
}
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
return {
|
|
445
|
+
resolve: o
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
function _(o) {
|
|
449
|
+
const a = K();
|
|
450
|
+
return T.getValue(o.id) === void 0 && Object.hasOwnProperty.call(o, "modelValue") && T.setValue(o.id, void 0, o.modelValue), a.resolve(o, T);
|
|
451
|
+
}
|
|
452
|
+
function X(o) {
|
|
453
|
+
const a = {};
|
|
454
|
+
return o && Object.entries(o).forEach(([m, g]) => {
|
|
455
|
+
a[m] = () => Array.isArray(g) ? g.map((h) => A(h)) : A(g);
|
|
456
|
+
}), a;
|
|
457
|
+
}
|
|
458
|
+
function B(o) {
|
|
459
|
+
return o.type ? o.type : o.fields ? "fieldset" : "form-group";
|
|
460
|
+
}
|
|
461
|
+
function P(o) {
|
|
462
|
+
const a = B(o);
|
|
463
|
+
let m = o.customClass;
|
|
464
|
+
m || (m = a === "form-group" ? t.layout : "col-12 px-0");
|
|
465
|
+
const {
|
|
466
|
+
fields: g,
|
|
467
|
+
customClass: h,
|
|
468
|
+
...y
|
|
469
|
+
} = o, M = {
|
|
470
|
+
...R(o, e, a)
|
|
471
|
+
}, E = {
|
|
472
|
+
...I(o, i, a)
|
|
473
|
+
};
|
|
474
|
+
return {
|
|
475
|
+
props: {
|
|
476
|
+
...{
|
|
477
|
+
...y,
|
|
478
|
+
customClass: m,
|
|
479
|
+
..._(o)
|
|
480
|
+
},
|
|
481
|
+
key: o.id,
|
|
482
|
+
ref: (O) => {
|
|
483
|
+
if (O && o.id && !F.has(o.id)) {
|
|
484
|
+
F.register(o.id, O);
|
|
485
|
+
const N = {
|
|
486
|
+
token: o.id,
|
|
487
|
+
name: "component:ready",
|
|
488
|
+
type: B(o),
|
|
489
|
+
payloads: [U(O)],
|
|
490
|
+
schema: o
|
|
491
|
+
};
|
|
492
|
+
e.emit("event", N);
|
|
493
|
+
}
|
|
494
|
+
},
|
|
495
|
+
onVnodeUnmounted: (O) => {
|
|
496
|
+
if (o.id && F.has(o.id)) {
|
|
497
|
+
F.remove(o.id);
|
|
498
|
+
const N = {
|
|
499
|
+
token: o.id,
|
|
500
|
+
name: "component:unmounted",
|
|
501
|
+
type: B(o),
|
|
502
|
+
payloads: [O],
|
|
503
|
+
schema: o
|
|
504
|
+
};
|
|
505
|
+
e.emit("event", N);
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
},
|
|
509
|
+
eventProps: M,
|
|
510
|
+
callbackProps: E
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
function k(o, a) {
|
|
514
|
+
return Array.isArray(o) ? o.map((m) => a(m)) : a(o);
|
|
515
|
+
}
|
|
516
|
+
function A(o, a) {
|
|
517
|
+
var E;
|
|
518
|
+
const m = B(o), g = ae[m];
|
|
519
|
+
if (o.id && f.set(o.id, o), !g)
|
|
520
|
+
return null;
|
|
521
|
+
const h = () => o.fields ? o.fields.map((x) => A(x)) : null, y = (x, $, O) => {
|
|
522
|
+
let N;
|
|
523
|
+
return O && O.length > 0 ? N = q(x, {
|
|
524
|
+
...$
|
|
525
|
+
}, O) : N = q(x, {
|
|
526
|
+
...$
|
|
527
|
+
}, null), N;
|
|
528
|
+
}, M = ((E = C.get(o.id)) == null ? void 0 : E.props) || {};
|
|
529
|
+
return o.fields && o.fields.length > 0 ? y(g, M, [h()]) : o.slots ? y(g, M, [...Object.values(X(o.slots))]) : y(g, M);
|
|
530
|
+
}
|
|
531
|
+
function j(o) {
|
|
532
|
+
const a = B(o);
|
|
533
|
+
if (!ae[a])
|
|
534
|
+
return;
|
|
535
|
+
const {
|
|
536
|
+
props: g,
|
|
537
|
+
eventProps: h,
|
|
538
|
+
callbackProps: y
|
|
539
|
+
} = P(o), M = _e[a], E = M ? M.editorResolver : null, {
|
|
540
|
+
componentEventProps: x,
|
|
541
|
+
editorEventProps: $
|
|
542
|
+
} = h, {
|
|
543
|
+
componentCallbackProps: O,
|
|
544
|
+
editorCallbackProps: N
|
|
545
|
+
} = y;
|
|
546
|
+
if (x && Object.keys(x).length > 0 && Object.assign(g, x), O && Object.keys(O).length > 0 && Object.assign(g, O), E && $ && Object.keys($).length > 0) {
|
|
547
|
+
const D = E.resolve(o);
|
|
548
|
+
Object.assign(D, $);
|
|
549
|
+
}
|
|
550
|
+
if (E && N && Object.keys(N).length > 0) {
|
|
551
|
+
const D = E.resolve(o);
|
|
552
|
+
Object.assign(D, N);
|
|
553
|
+
}
|
|
554
|
+
if (g && Object.keys(g).length > 0) {
|
|
555
|
+
const D = C.get(o.id);
|
|
556
|
+
D ? $e(D == null ? void 0 : D.props, g) : C.set(o.id, ce({
|
|
557
|
+
props: g
|
|
558
|
+
}));
|
|
559
|
+
}
|
|
560
|
+
!o.fields || !Array.isArray(o.fields) || o.fields.forEach((D) => j(D));
|
|
561
|
+
}
|
|
562
|
+
function Y(o) {
|
|
563
|
+
const a = B(o);
|
|
564
|
+
ae[a] && (Q(o), !(!o.fields || !Array.isArray(o.fields)) && o.fields.forEach((g) => Y(g)));
|
|
565
|
+
}
|
|
566
|
+
function Q(o) {
|
|
567
|
+
const a = _(o);
|
|
568
|
+
if (a && Object.keys(a).length > 0) {
|
|
569
|
+
const m = C.get(o.id);
|
|
570
|
+
if (!m)
|
|
571
|
+
C.set(o.id, ce({
|
|
572
|
+
props: a
|
|
573
|
+
}));
|
|
574
|
+
else {
|
|
575
|
+
const g = {
|
|
576
|
+
...m == null ? void 0 : m.props
|
|
577
|
+
};
|
|
578
|
+
Object.keys(a).forEach((h) => {
|
|
579
|
+
g[h] = a[h];
|
|
580
|
+
}), Object.assign(m == null ? void 0 : m.props, g);
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
ke(() => {
|
|
585
|
+
}), z(() => t.formData, (o) => {
|
|
586
|
+
v.value = o;
|
|
587
|
+
}), z(() => v.value, (o) => {
|
|
588
|
+
k(r.value, Y);
|
|
589
|
+
}, {
|
|
590
|
+
deep: !0
|
|
591
|
+
});
|
|
592
|
+
function Z(o) {
|
|
593
|
+
o && k(r.value, j);
|
|
594
|
+
}
|
|
595
|
+
z(() => t.fields, (o) => {
|
|
596
|
+
f.clear(), F.clear(), v.value = t.formData || {}, C.clear(), r.value = o, Z(o);
|
|
597
|
+
}), Z(t.fields);
|
|
598
|
+
function oe(o) {
|
|
599
|
+
o.$forceUpdate && o.$forceUpdate();
|
|
600
|
+
}
|
|
601
|
+
function ne(o) {
|
|
602
|
+
return T.getValue(o);
|
|
603
|
+
}
|
|
604
|
+
function H() {
|
|
605
|
+
return v.value;
|
|
606
|
+
}
|
|
607
|
+
function L(o, a) {
|
|
608
|
+
T.setValue(o, void 0, a);
|
|
609
|
+
const m = f.get(o);
|
|
610
|
+
m && Q(m);
|
|
611
|
+
}
|
|
612
|
+
function W(o) {
|
|
613
|
+
var a;
|
|
614
|
+
return (a = C.get(o)) == null ? void 0 : a.props;
|
|
615
|
+
}
|
|
616
|
+
function n(o, a) {
|
|
617
|
+
const m = C.get(o);
|
|
618
|
+
je(m == null ? void 0 : m.props, a, b);
|
|
619
|
+
}
|
|
620
|
+
e.expose({
|
|
621
|
+
componentManager: F,
|
|
622
|
+
rerender: oe,
|
|
623
|
+
getProps: W,
|
|
624
|
+
setProps: n,
|
|
625
|
+
getControlValue: ne,
|
|
626
|
+
setControlValue: L,
|
|
627
|
+
getValues: H
|
|
628
|
+
});
|
|
629
|
+
function s() {
|
|
630
|
+
return w.value && he(q("div", {
|
|
631
|
+
class: G.value,
|
|
632
|
+
style: t.customStyle
|
|
633
|
+
}, [e.slots.default && e.slots.default(), r.value && r.value.length > 0 && k(r.value, A)]), [[Fe("area-response")]]);
|
|
634
|
+
}
|
|
635
|
+
function d() {
|
|
636
|
+
return !w.value && r.value && r.value.length > 0 && k(r.value, A);
|
|
637
|
+
}
|
|
638
|
+
return () => t.visible ? s() || d() : null;
|
|
639
|
+
}
|
|
640
|
+
}), ye = /* @__PURE__ */ te({
|
|
92
641
|
name: "FResponseForm",
|
|
93
|
-
props:
|
|
642
|
+
props: ie,
|
|
94
643
|
emits: [],
|
|
95
|
-
setup(t,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
644
|
+
setup(t, e) {
|
|
645
|
+
var b;
|
|
646
|
+
const r = U(), f = U(), i = J(() => {
|
|
647
|
+
const I = Ie.getLocale(), R = t.fields && t.fields.length > 0, G = {
|
|
648
|
+
"drag-container": !0,
|
|
649
|
+
"f-form-layout": R,
|
|
650
|
+
"farris-form": R
|
|
99
651
|
};
|
|
100
|
-
return
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
652
|
+
return t.adaptForLanguage && I && (G["farris-form-controls-inline"] = I !== "en"), Ve(G, t.customClass);
|
|
653
|
+
}), F = (b = f.value) == null ? void 0 : b.componentManager;
|
|
654
|
+
function v(I) {
|
|
655
|
+
f.value.render(I);
|
|
656
|
+
}
|
|
657
|
+
function T(I) {
|
|
658
|
+
return f.value.getControlValue(I);
|
|
659
|
+
}
|
|
660
|
+
function V(I, R) {
|
|
661
|
+
f.value.setControlValue(I, R);
|
|
662
|
+
}
|
|
663
|
+
function C(I) {
|
|
664
|
+
return f.value.getProps(I);
|
|
665
|
+
}
|
|
666
|
+
function w(I, R) {
|
|
667
|
+
f.value.setProps(I, R);
|
|
668
|
+
}
|
|
669
|
+
return e.expose({
|
|
670
|
+
componentManager: F,
|
|
671
|
+
rerender: v,
|
|
672
|
+
getProps: C,
|
|
673
|
+
setProps: w,
|
|
674
|
+
getControlValue: T,
|
|
675
|
+
setControlValue: V
|
|
676
|
+
}), () => t.visible && he(q("div", {
|
|
677
|
+
ref: r,
|
|
678
|
+
class: i.value,
|
|
105
679
|
style: t.customStyle
|
|
106
|
-
}, [
|
|
680
|
+
}, [e.slots.default && e.slots.default(), t.fields && t.fields.length > 0 && q(se, {
|
|
681
|
+
ref: f,
|
|
682
|
+
fields: t.fields,
|
|
683
|
+
canRenderForm: !1,
|
|
684
|
+
formData: t.formData,
|
|
685
|
+
layout: t.layout
|
|
686
|
+
}, null)]), [[Fe("area-response")]]);
|
|
107
687
|
}
|
|
108
|
-
}),
|
|
688
|
+
}), jo = {
|
|
109
689
|
id: { type: String, default: "" },
|
|
110
690
|
customClass: { type: String, default: "" },
|
|
111
691
|
customStyle: { type: String, default: "" },
|
|
@@ -113,7 +693,7 @@ const Qt = {
|
|
|
113
693
|
editor: { type: Object, default: {} },
|
|
114
694
|
label: { type: String, default: "" },
|
|
115
695
|
/** value is uncertain because type is uncertain, default value should not be set */
|
|
116
|
-
modelValue: { type: [String, Boolean, Array, Number] },
|
|
696
|
+
modelValue: { type: [String, Boolean, Array, Number], default: null },
|
|
117
697
|
// readonly: { type: Boolean, default: false },
|
|
118
698
|
visible: { type: Boolean, default: !0 },
|
|
119
699
|
required: { type: Boolean, default: !1 },
|
|
@@ -126,7 +706,7 @@ const Qt = {
|
|
|
126
706
|
componentId: { type: String, default: "" },
|
|
127
707
|
errors: { type: Object, default: null },
|
|
128
708
|
fill: { type: Boolean, default: !1 }
|
|
129
|
-
},
|
|
709
|
+
}, $o = {
|
|
130
710
|
id: { type: String },
|
|
131
711
|
required: { type: Boolean, default: !1 },
|
|
132
712
|
text: { type: String, default: "" },
|
|
@@ -137,69 +717,69 @@ const Qt = {
|
|
|
137
717
|
* 实际支持 'visible'可见 | 'reserve-space' 占位不显示
|
|
138
718
|
*/
|
|
139
719
|
showType: { type: String, default: "visible" }
|
|
140
|
-
},
|
|
720
|
+
}, qo = /* @__PURE__ */ te({
|
|
141
721
|
name: "FDynamicFormLabel",
|
|
142
|
-
props:
|
|
722
|
+
props: $o,
|
|
143
723
|
emits: [],
|
|
144
|
-
setup(t,
|
|
145
|
-
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}),
|
|
150
|
-
|
|
151
|
-
}),
|
|
152
|
-
|
|
724
|
+
setup(t, e) {
|
|
725
|
+
U(t.title || t.text);
|
|
726
|
+
const r = U(t.required), f = U(t.text), i = U(t.valid), F = U(t.inValidTip);
|
|
727
|
+
z(() => t.text, () => {
|
|
728
|
+
f.value = t.text;
|
|
729
|
+
}), z(() => t.required, (w, b) => {
|
|
730
|
+
w !== b && (r.value = w);
|
|
731
|
+
}), z([() => t.valid, () => t.inValidTip], ([w, b]) => {
|
|
732
|
+
i.value = w, F.value = b;
|
|
153
733
|
});
|
|
154
|
-
const
|
|
734
|
+
const v = J(() => i.value ? f.value : F.value), T = J(() => i.value ? "" : "color:red"), V = J(() => ({
|
|
155
735
|
"col-form-label": !0,
|
|
156
736
|
// 指定必填,当显示模式是隐藏或者没有指定标签名时,宽度不限定
|
|
157
|
-
"f-width-auto":
|
|
158
|
-
})), C =
|
|
159
|
-
return () => C.value &&
|
|
160
|
-
class:
|
|
161
|
-
title:
|
|
162
|
-
style:
|
|
163
|
-
}, [!
|
|
737
|
+
"f-width-auto": r.value && (t.showType === "none" || !f.value)
|
|
738
|
+
})), C = J(() => t.showType === "force-none" ? !1 : t.showType === "reserve-space" || r.value || !!f.value && t.showType !== "none");
|
|
739
|
+
return () => C.value && q("label", {
|
|
740
|
+
class: V.value,
|
|
741
|
+
title: v.value,
|
|
742
|
+
style: T.value
|
|
743
|
+
}, [!i.value && q("span", {
|
|
164
744
|
class: "f-icon f-icon-warning mr-1",
|
|
165
745
|
style: "color: red; min-width: 16px;",
|
|
166
|
-
title:
|
|
167
|
-
}, null),
|
|
746
|
+
title: F.value
|
|
747
|
+
}, null), q("span", {
|
|
168
748
|
class: "farris-label-text"
|
|
169
|
-
}, [
|
|
749
|
+
}, [r.value && q("span", {
|
|
170
750
|
class: "farris-label-info text-danger"
|
|
171
|
-
}, [
|
|
751
|
+
}, [Ee("*")]), t.showType === "visible" && f.value])]);
|
|
172
752
|
}
|
|
173
|
-
}), { globalStorageKey:
|
|
174
|
-
async function
|
|
753
|
+
}), { globalStorageKey: xo } = De(), l = {}, c = {}, u = {}, p = {};
|
|
754
|
+
async function Go() {
|
|
175
755
|
{
|
|
176
756
|
const t = {
|
|
177
|
-
schemaMap:
|
|
178
|
-
propertyConfigSchemaMap:
|
|
179
|
-
propertyEffectMap:
|
|
180
|
-
schemaResolverMap:
|
|
757
|
+
schemaMap: ve,
|
|
758
|
+
propertyConfigSchemaMap: Ne,
|
|
759
|
+
propertyEffectMap: Oe,
|
|
760
|
+
schemaResolverMap: Le
|
|
181
761
|
};
|
|
182
|
-
|
|
183
|
-
const
|
|
184
|
-
if (
|
|
185
|
-
for (const
|
|
186
|
-
|
|
762
|
+
Je.register(l, c, u, p), Xe.register(l, c, u, p), Qe.register(l, c, u, p), ze.register(l, c, u, p), Ye.register(l, c, u, p, t), Ze.register(l, c, u, p), de.register(l, c, u, p, t), fe.register(l, c, u, p, t), de.register(l, c, u, p, t), fe.register(l, c, u, p, t), Se.register(l, c, u, p, t), He.register(l, c, u, p), et.register(l, c, u, p), ot.register(l, c, u, p, t), tt.register(l, c, u, p), nt.register(l, c, u, p, t), rt.register(l, c, u, p, t), st.register(l, c, u, p), it.register(l, c, u, p, t), at.register(l, c, u, p), so.register(l, c, u, p), lt.register(l, c, u, p), ct.register(l, c, u, p), St.register(l, c, u, p), pt.register(l, c, u, p), mt.register(l, c, u, p, t), dt.register(l, c, u, p, t), yt.register(l, c, u, p, t), ft.register(l, c, u, p), gt.register(l, c, u, p, t), Ct.register(l, c, u, p), ht.register(l, c, u, p), Ft.register(l, c, u, p), bt.register(l, c, u, p, t), vt.register(l, c, u, p), Vt.register(l, c, u, p, t), It.register(l, c, u, p), Tt.register(l, c, u, p), Mt.register(l, c, u, p), wt.register(l, c, u, p, t), Pt.register(l, c, u, p, t), Bt.register(l, c, u, p), Et.register(l, c, u, p, t), Ut.register(l, c, u, p), kt.register(l, c, u, p), zt.register(l, c, u), Ot.register(l, c, u, p), Nt.register(l, c, u, p, t), Dt.register(l, c, u, p), Rt.register(l, c, u, p), At.register(l, c, u, p), jt.register(l, c, u, p, t), eo.register(l, c, u, p), $t.register(l, c, u, p, t), qt.register(l, c, u, p), xt.register(l, c, u, p), Gt.register(l, c, u, p, t), Wt.register(l, c, u, p), Kt.register(l, c, u, p), Xt.register(l, c, u, p), _t.register(l, c, u, p), Jt.register(l, c, u, p), Qt.register(l, c, u, p, t), Yt.register(l, c, u, p), ut.register(l, c, u, p), Zt.register(l, c, u, p), Ht.register(l, c, u, p, t), to.register(l, c, u, p), oo.register(l, c, u, p), no.register(l, c, u, p), ro.register(l, c, u, p), io.register(l, c, u, p), ao.register(l, c, u, p, t), lo.register(l, c, u, p), co.register(l, c, u, p), uo.register(l, c, u, p), po.register(l, c, u, p, t), mo.register(l, c, u, p, t), fo.register(l, c, u, p);
|
|
763
|
+
const e = window[xo];
|
|
764
|
+
if (e)
|
|
765
|
+
for (const r in e)
|
|
766
|
+
e[r].createPropsResolver = le, e[r].register(l, c, u);
|
|
187
767
|
}
|
|
188
768
|
}
|
|
189
|
-
function
|
|
190
|
-
|
|
191
|
-
function t(
|
|
192
|
-
const
|
|
193
|
-
if (!
|
|
194
|
-
throw new Error(`Could not find the editor of type '${
|
|
195
|
-
return
|
|
769
|
+
function we() {
|
|
770
|
+
Go();
|
|
771
|
+
function t(v) {
|
|
772
|
+
const T = l[v];
|
|
773
|
+
if (!T)
|
|
774
|
+
throw new Error(`Could not find the editor of type '${v}'`);
|
|
775
|
+
return T;
|
|
196
776
|
}
|
|
197
|
-
function
|
|
198
|
-
const
|
|
199
|
-
return
|
|
777
|
+
function e(v, T) {
|
|
778
|
+
const V = c[v];
|
|
779
|
+
return V ? V(T) : {};
|
|
200
780
|
}
|
|
201
|
-
function
|
|
202
|
-
switch (
|
|
781
|
+
function r(v) {
|
|
782
|
+
switch (v) {
|
|
203
783
|
case "check-box":
|
|
204
784
|
return "onChangeValue";
|
|
205
785
|
case "switch":
|
|
@@ -273,31 +853,31 @@ function me() {
|
|
|
273
853
|
return "onUpdate:modelValue";
|
|
274
854
|
}
|
|
275
855
|
}
|
|
276
|
-
function
|
|
277
|
-
switch (
|
|
856
|
+
function f(v) {
|
|
857
|
+
switch (v) {
|
|
278
858
|
case "combo-list":
|
|
279
859
|
case "input-group":
|
|
280
860
|
case "textarea":
|
|
281
861
|
return "onClear";
|
|
282
862
|
}
|
|
283
863
|
}
|
|
284
|
-
function
|
|
285
|
-
switch (
|
|
864
|
+
function i(v) {
|
|
865
|
+
switch (v) {
|
|
286
866
|
case "input-group":
|
|
287
867
|
case "textarea":
|
|
288
868
|
return "onMousedownEvent";
|
|
289
869
|
}
|
|
290
870
|
}
|
|
291
|
-
function
|
|
292
|
-
switch (
|
|
871
|
+
function F(v) {
|
|
872
|
+
switch (v) {
|
|
293
873
|
case "input-group":
|
|
294
874
|
case "textarea":
|
|
295
875
|
return "onMouseupEvent";
|
|
296
876
|
}
|
|
297
877
|
}
|
|
298
|
-
return { resolveEditorProps:
|
|
878
|
+
return { resolveEditorProps: e, resolveEditorType: t, getChangeFunctionName: r, getClearFunctionName: f, getMousedownFunctionName: i, getMouseupFunctionName: F };
|
|
299
879
|
}
|
|
300
|
-
const
|
|
880
|
+
const Wo = {
|
|
301
881
|
/**
|
|
302
882
|
* 显示的错误信息
|
|
303
883
|
*/
|
|
@@ -305,122 +885,122 @@ const eo = {
|
|
|
305
885
|
type: Object,
|
|
306
886
|
default: null
|
|
307
887
|
}
|
|
308
|
-
},
|
|
888
|
+
}, Ko = /* @__PURE__ */ te({
|
|
309
889
|
name: "FValidationMessage",
|
|
310
|
-
props:
|
|
890
|
+
props: Wo,
|
|
311
891
|
emits: [],
|
|
312
|
-
setup(t,
|
|
313
|
-
const
|
|
314
|
-
|
|
315
|
-
|
|
892
|
+
setup(t, e) {
|
|
893
|
+
const r = U(t.errors);
|
|
894
|
+
z(() => t.errors, (F) => {
|
|
895
|
+
r.value = F;
|
|
316
896
|
});
|
|
317
|
-
const
|
|
318
|
-
if (
|
|
319
|
-
const
|
|
320
|
-
var
|
|
321
|
-
return (
|
|
897
|
+
const f = U(!0), i = J(() => {
|
|
898
|
+
if (r.value) {
|
|
899
|
+
const F = Object.keys(r.value).map((v) => {
|
|
900
|
+
var T;
|
|
901
|
+
return (T = r.value[v]) == null ? void 0 : T.name;
|
|
322
902
|
});
|
|
323
|
-
return
|
|
903
|
+
return F.length ? F.join(" ") : "";
|
|
324
904
|
}
|
|
325
905
|
return "";
|
|
326
906
|
});
|
|
327
|
-
return () =>
|
|
907
|
+
return () => i.value && q("div", {
|
|
328
908
|
class: "farris-feedback f-state-invalid",
|
|
329
|
-
onClick: () =>
|
|
330
|
-
}, [!
|
|
909
|
+
onClick: () => f.value = !f.value
|
|
910
|
+
}, [!f.value && q("span", {
|
|
331
911
|
class: "f-icon f-icon-message_warning f-feedback-icon"
|
|
332
|
-
}, null),
|
|
912
|
+
}, null), f.value && q("span", {
|
|
333
913
|
class: "f-feedback-message"
|
|
334
|
-
}, [
|
|
914
|
+
}, [i.value])]);
|
|
335
915
|
}
|
|
336
|
-
}),
|
|
916
|
+
}), ge = /* @__PURE__ */ te({
|
|
337
917
|
name: "FDynamicFormGroup",
|
|
338
|
-
props:
|
|
918
|
+
props: jo,
|
|
339
919
|
emits: ["change", "update:modelValue"],
|
|
340
|
-
setup(t,
|
|
341
|
-
var
|
|
342
|
-
const
|
|
343
|
-
|
|
344
|
-
const
|
|
345
|
-
resolveEditorProps:
|
|
346
|
-
resolveEditorType:
|
|
347
|
-
getChangeFunctionName:
|
|
348
|
-
getClearFunctionName:
|
|
349
|
-
} =
|
|
350
|
-
const
|
|
920
|
+
setup(t, e) {
|
|
921
|
+
var H;
|
|
922
|
+
const r = U(t.id), f = U(t.customClass), i = U(t.editor), F = U(t.label), v = U(t.modelValue), T = U(t.readonly), V = U(((H = t.editor) == null ? void 0 : H.required) || t.required), C = U(t.showLabel), w = U(t.visible);
|
|
923
|
+
U(t.type);
|
|
924
|
+
const b = U(), I = U(t.errors), R = Re(), G = U(t.editor.type || "input-group"), K = J(() => C.value ? t.showLabelType : "none"), {
|
|
925
|
+
resolveEditorProps: _,
|
|
926
|
+
resolveEditorType: X,
|
|
927
|
+
getChangeFunctionName: B,
|
|
928
|
+
getClearFunctionName: P
|
|
929
|
+
} = we(), k = J(() => {
|
|
930
|
+
const L = {
|
|
351
931
|
"form-group": !0,
|
|
352
932
|
"farris-form-group": !0,
|
|
353
933
|
"common-group": !0,
|
|
354
|
-
"q-state-readonly":
|
|
355
|
-
"form-group--in-mobile":
|
|
934
|
+
"q-state-readonly": T.value,
|
|
935
|
+
"form-group--in-mobile": R
|
|
356
936
|
};
|
|
357
|
-
return
|
|
358
|
-
}),
|
|
937
|
+
return L["form-group--has-" + G.value] = !0, L;
|
|
938
|
+
}), A = J(() => {
|
|
359
939
|
if (t.fill)
|
|
360
940
|
return {
|
|
361
941
|
maxWidth: "none"
|
|
362
942
|
};
|
|
363
943
|
});
|
|
364
|
-
function
|
|
365
|
-
|
|
366
|
-
newValue:
|
|
367
|
-
newModelValue:
|
|
368
|
-
parameters:
|
|
944
|
+
function j(L, W, n) {
|
|
945
|
+
v.value = W !== void 0 ? W : L, e.emit("update:modelValue", v.value), e.emit("change", v.value, {
|
|
946
|
+
newValue: L,
|
|
947
|
+
newModelValue: W,
|
|
948
|
+
parameters: n
|
|
369
949
|
});
|
|
370
950
|
}
|
|
371
|
-
function
|
|
372
|
-
|
|
951
|
+
function Y() {
|
|
952
|
+
e.emit("update:modelValue", "");
|
|
373
953
|
}
|
|
374
|
-
function
|
|
375
|
-
return (...
|
|
376
|
-
|
|
954
|
+
function Q(L) {
|
|
955
|
+
return (...W) => {
|
|
956
|
+
Y(), typeof L == "function" && L(...W);
|
|
377
957
|
};
|
|
378
958
|
}
|
|
379
|
-
function
|
|
380
|
-
return (
|
|
381
|
-
|
|
959
|
+
function Z(L) {
|
|
960
|
+
return (W, n, s) => {
|
|
961
|
+
j(W, n, s), typeof L == "function" && L(W, n, s);
|
|
382
962
|
};
|
|
383
963
|
}
|
|
384
|
-
const oe =
|
|
385
|
-
const
|
|
386
|
-
return
|
|
387
|
-
ref:
|
|
388
|
-
},
|
|
389
|
-
modelValue:
|
|
390
|
-
"onUpdate:modelValue": (
|
|
391
|
-
}),
|
|
964
|
+
const oe = J(() => {
|
|
965
|
+
const L = i.value.type || "input-group", W = X(L), n = _(L, i.value), s = B(L), d = P(i.value.type);
|
|
966
|
+
return d && (n[d] = Q(n[d])), s && (n[s] = Z(n[s])), (n.id == null || n.id === "") && (n.id = r.value), L === "number-range" && i.value.onBeginValueChange && typeof i.value.onBeginValueChange == "function" ? (i.value.onBeginValueChange && typeof i.value.onBeginValueChange == "function" && (n.onBeginValueChange = i.value.onBeginValueChange), i.value.onEndValueChange && typeof i.value.onEndValueChange == "function" && (n.onEndValueChange = i.value.onEndValueChange)) : L === "lookup" && i.value["onUpdate:idValue"] && typeof i.value["onUpdate:idValue"] == "function" ? (n["onUpdate:idValue"] = i.value["onUpdate:idValue"], n.id = r.value) : L === "collection-property-editor" && i.value.onSelectionChange && typeof i.value.onSelectionChange == "function" ? n.onSelectionChange = i.value.onSelectionChange : L === "property-editor" && (n.onBeforeOpenVariables = i.value.onBeforeOpenVariables), () => q(W, be({
|
|
967
|
+
ref: b
|
|
968
|
+
}, n, {
|
|
969
|
+
modelValue: v.value,
|
|
970
|
+
"onUpdate:modelValue": (o) => v.value = o
|
|
971
|
+
}), e.slots);
|
|
392
972
|
});
|
|
393
973
|
function ne() {
|
|
394
|
-
return
|
|
395
|
-
id: `${
|
|
396
|
-
errors:
|
|
974
|
+
return q(Ko, {
|
|
975
|
+
id: `${r.value}-validation-message`,
|
|
976
|
+
errors: I.value
|
|
397
977
|
}, null);
|
|
398
978
|
}
|
|
399
|
-
return
|
|
400
|
-
var
|
|
401
|
-
|
|
402
|
-
}),
|
|
403
|
-
editorRef:
|
|
404
|
-
}), () =>
|
|
405
|
-
id: `${
|
|
406
|
-
class:
|
|
979
|
+
return z([() => t.id, () => t.customClass, () => t.editor, () => t.label, () => t.modelValue, () => t.readonly, () => t.required, () => t.showLabel, () => t.visible, () => t.errors], ([L, W, n, s, d, o, a, m, g, h]) => {
|
|
980
|
+
var y;
|
|
981
|
+
r.value = L, f.value = W, i.value = n, F.value = s, v.value = d, T.value = o, V.value = ((y = i.value) == null ? void 0 : y.required) || a, C.value = m, w.value = g, I.value = h;
|
|
982
|
+
}), e.expose({
|
|
983
|
+
editorRef: b
|
|
984
|
+
}), () => w.value && q("div", {
|
|
985
|
+
id: `${r.value}-form-group`,
|
|
986
|
+
class: f.value,
|
|
407
987
|
style: t.customStyle
|
|
408
|
-
}, [
|
|
988
|
+
}, [q("div", {
|
|
409
989
|
class: "farris-group-wrap",
|
|
410
|
-
style:
|
|
411
|
-
}, [
|
|
412
|
-
class:
|
|
413
|
-
}, [
|
|
414
|
-
id: `${
|
|
415
|
-
showType:
|
|
416
|
-
required:
|
|
417
|
-
text:
|
|
418
|
-
title:
|
|
419
|
-
}, null),
|
|
990
|
+
style: A.value
|
|
991
|
+
}, [q("div", {
|
|
992
|
+
class: k.value
|
|
993
|
+
}, [q(qo, {
|
|
994
|
+
id: `${r.value}-lable`,
|
|
995
|
+
showType: K.value,
|
|
996
|
+
required: V.value,
|
|
997
|
+
text: F.value,
|
|
998
|
+
title: F.value
|
|
999
|
+
}, null), q("div", {
|
|
420
1000
|
class: "farris-input-wrap"
|
|
421
1001
|
}, [oe.value(), ne()])])])]);
|
|
422
1002
|
}
|
|
423
|
-
}),
|
|
1003
|
+
}), _o = {
|
|
424
1004
|
id: { type: String, default: "" },
|
|
425
1005
|
/** 筛选组件配置器,具体配置项可查看各组件文档 */
|
|
426
1006
|
editor: { type: Object, default: {} },
|
|
@@ -434,458 +1014,530 @@ const eo = {
|
|
|
434
1014
|
* 作为内嵌编辑器被创建后默认选中文本
|
|
435
1015
|
*/
|
|
436
1016
|
selectOnCreated: { type: Boolean, default: !1 }
|
|
437
|
-
},
|
|
1017
|
+
}, Ce = /* @__PURE__ */ te({
|
|
438
1018
|
name: "FDynamicFormInput",
|
|
439
|
-
props:
|
|
1019
|
+
props: _o,
|
|
440
1020
|
emits: ["change", "update:modelValue", "mousedown", "mouseup"],
|
|
441
|
-
setup(t,
|
|
442
|
-
const
|
|
443
|
-
resolveEditorProps:
|
|
444
|
-
resolveEditorType:
|
|
445
|
-
getChangeFunctionName:
|
|
446
|
-
getMousedownFunctionName:
|
|
1021
|
+
setup(t, e) {
|
|
1022
|
+
const r = U(t.id), f = U(t.editor), i = U(t.modelValue), {
|
|
1023
|
+
resolveEditorProps: F,
|
|
1024
|
+
resolveEditorType: v,
|
|
1025
|
+
getChangeFunctionName: T,
|
|
1026
|
+
getMousedownFunctionName: V,
|
|
447
1027
|
getMouseupFunctionName: C,
|
|
448
|
-
getClearFunctionName:
|
|
449
|
-
} =
|
|
450
|
-
function
|
|
451
|
-
|
|
452
|
-
newValue:
|
|
453
|
-
newModelValue:
|
|
454
|
-
parameters:
|
|
1028
|
+
getClearFunctionName: w
|
|
1029
|
+
} = we();
|
|
1030
|
+
function b(B, P, k) {
|
|
1031
|
+
i.value = P !== void 0 ? P : B, e.emit("update:modelValue", i.value), e.emit("change", i.value, {
|
|
1032
|
+
newValue: B,
|
|
1033
|
+
newModelValue: P,
|
|
1034
|
+
parameters: k
|
|
455
1035
|
});
|
|
456
1036
|
}
|
|
457
|
-
function
|
|
458
|
-
|
|
1037
|
+
function I(B) {
|
|
1038
|
+
e.emit("mousedown", B);
|
|
459
1039
|
}
|
|
460
|
-
function
|
|
461
|
-
|
|
1040
|
+
function R(B) {
|
|
1041
|
+
e.emit("mouseup", B);
|
|
462
1042
|
}
|
|
463
|
-
function
|
|
464
|
-
|
|
1043
|
+
function G() {
|
|
1044
|
+
e.emit("update:modelValue", "");
|
|
465
1045
|
}
|
|
466
|
-
function
|
|
467
|
-
return (...
|
|
468
|
-
|
|
1046
|
+
function K(B) {
|
|
1047
|
+
return (...P) => {
|
|
1048
|
+
G(), typeof B == "function" && B(...P);
|
|
469
1049
|
};
|
|
470
1050
|
}
|
|
471
|
-
function
|
|
472
|
-
return (
|
|
473
|
-
|
|
1051
|
+
function _(B) {
|
|
1052
|
+
return (P, k, A) => {
|
|
1053
|
+
b(P, k, A), typeof B == "function" && B(P, k, A);
|
|
474
1054
|
};
|
|
475
1055
|
}
|
|
476
|
-
const
|
|
477
|
-
const
|
|
478
|
-
|
|
479
|
-
const
|
|
480
|
-
|
|
481
|
-
const
|
|
482
|
-
|
|
483
|
-
const
|
|
484
|
-
return
|
|
485
|
-
modelValue:
|
|
486
|
-
"onUpdate:modelValue": (
|
|
1056
|
+
const X = J(() => {
|
|
1057
|
+
const B = v(f.value.type), P = F(f.value.type, f.value);
|
|
1058
|
+
P.focusOnCreated = t.focusOnCreated, P.selectOnCreated = t.selectOnCreated;
|
|
1059
|
+
const k = T(f.value.type), A = w(f.value.type);
|
|
1060
|
+
A && (P[A] = K(P[A])), k && (P[k] = _(P[k]));
|
|
1061
|
+
const j = V(f.value.type);
|
|
1062
|
+
P[j] = I;
|
|
1063
|
+
const Y = C(f.value.type);
|
|
1064
|
+
return P[Y] = R, P.id = r.value, () => q(B, be(P, {
|
|
1065
|
+
modelValue: i.value,
|
|
1066
|
+
"onUpdate:modelValue": (Q) => i.value = Q
|
|
487
1067
|
}), null);
|
|
488
1068
|
});
|
|
489
|
-
return
|
|
490
|
-
|
|
491
|
-
}), () =>
|
|
1069
|
+
return z([() => t.id, () => t.editor, () => t.modelValue], ([B, P, k]) => {
|
|
1070
|
+
r.value = B, f.value = P, i.value = k;
|
|
1071
|
+
}), () => X.value();
|
|
492
1072
|
}
|
|
493
1073
|
});
|
|
494
|
-
function
|
|
495
|
-
function
|
|
1074
|
+
function Xo(t, e) {
|
|
1075
|
+
function r(V, C = null) {
|
|
496
1076
|
if (C)
|
|
497
1077
|
return C;
|
|
498
|
-
const
|
|
499
|
-
return t.selectNode(
|
|
1078
|
+
const w = t.getComponentById(e);
|
|
1079
|
+
return t.selectNode(w, (b) => b.id === V);
|
|
500
1080
|
}
|
|
501
|
-
function
|
|
502
|
-
const C = t.getComponentById(
|
|
1081
|
+
function f(V) {
|
|
1082
|
+
const C = t.getComponentById(V);
|
|
503
1083
|
return !(!C || !C.componentType || !C.componentType.startsWith("form"));
|
|
504
1084
|
}
|
|
505
|
-
function
|
|
506
|
-
const C = new Set(
|
|
1085
|
+
function i(V) {
|
|
1086
|
+
const C = new Set(V);
|
|
507
1087
|
return Array.from(C).length === 1;
|
|
508
1088
|
}
|
|
509
|
-
function V
|
|
510
|
-
const C =
|
|
511
|
-
|
|
512
|
-
const
|
|
1089
|
+
function F(V) {
|
|
1090
|
+
const C = r(V.id), w = Lt(t), b = [];
|
|
1091
|
+
w.getResonseFormLayoutConfig(C, b, 1);
|
|
1092
|
+
const I = b.map((k) => k.columnInSM), R = b.map((k) => k.columnInMD), G = b.map((k) => k.columnInLG), K = b.map((k) => k.columnInEL), _ = i(I) ? I[0] : 0, X = i(R) ? R[0] : 0, B = i(G) ? G[0] : 0, P = i(K) ? K[0] : 0;
|
|
513
1093
|
return {
|
|
514
|
-
uniqueColClassInSM:
|
|
515
|
-
uniqueColClassInMD:
|
|
516
|
-
uniqueColClassInLG:
|
|
517
|
-
uniqueColClassInEL:
|
|
1094
|
+
uniqueColClassInSM: _,
|
|
1095
|
+
uniqueColClassInMD: X,
|
|
1096
|
+
uniqueColClassInLG: B,
|
|
1097
|
+
uniqueColClassInEL: P
|
|
518
1098
|
};
|
|
519
1099
|
}
|
|
520
|
-
function
|
|
521
|
-
let
|
|
522
|
-
if (
|
|
523
|
-
const
|
|
524
|
-
|
|
1100
|
+
function v(V, C) {
|
|
1101
|
+
let w, b, I, R, G = [];
|
|
1102
|
+
if (V) {
|
|
1103
|
+
const k = V.split(" "), A = k.filter((j) => j.startsWith("col-"));
|
|
1104
|
+
w = A.find((j) => /^col-([1-9]|10|11|12)$/.test(j)), b = A.find((j) => /^col-md-([1-9]|10|11|12)$/.test(j)), I = A.find((j) => /^col-xl-([1-9]|10|11|12)$/.test(j)), R = A.find((j) => /^col-el-([1-9]|10|11|12)$/.test(j)), G = k.filter((j) => !j.startsWith("col-"));
|
|
525
1105
|
}
|
|
526
|
-
const
|
|
527
|
-
return [
|
|
1106
|
+
const K = C.uniqueColClassInSM ? "col-" + C.uniqueColClassInSM : w, _ = C.uniqueColClassInMD ? "col-md-" + C.uniqueColClassInMD : b, X = C.uniqueColClassInLG ? "col-xl-" + C.uniqueColClassInLG : I, B = C.uniqueColClassInEL ? "col-el-" + C.uniqueColClassInEL : R;
|
|
1107
|
+
return [K, _, X, B].concat(G).join(" ");
|
|
528
1108
|
}
|
|
529
|
-
function
|
|
530
|
-
|
|
531
|
-
if (
|
|
532
|
-
|
|
1109
|
+
function T(V, C, w) {
|
|
1110
|
+
V = r(w, V), V.contents.forEach((b) => {
|
|
1111
|
+
if (b.type === ee["dynamic-form"].type)
|
|
1112
|
+
return;
|
|
1113
|
+
if (b.type === ee.fieldset.type) {
|
|
1114
|
+
T(b, C, b.id);
|
|
533
1115
|
return;
|
|
534
1116
|
}
|
|
535
|
-
|
|
536
|
-
const
|
|
537
|
-
|
|
1117
|
+
b.appearance || (b.appearance = {});
|
|
1118
|
+
const I = b.appearance.class;
|
|
1119
|
+
b.appearance.class = v(I, C);
|
|
538
1120
|
});
|
|
539
1121
|
}
|
|
540
|
-
return { checkIsInFormComponent:
|
|
1122
|
+
return { checkIsInFormComponent: f, assembleUnifiedLayoutContext: F, changeFormControlsByUnifiedLayoutConfig: T, changeControlClassInByColumn: v };
|
|
541
1123
|
}
|
|
542
|
-
class
|
|
543
|
-
constructor(
|
|
544
|
-
super(
|
|
545
|
-
}
|
|
546
|
-
getPropertyConfig(
|
|
547
|
-
const
|
|
548
|
-
this.propertyConfig.categories.basic = this.getBasicPropConfig(
|
|
549
|
-
const { checkIsInFormComponent:
|
|
550
|
-
|
|
1124
|
+
class Jo extends ho {
|
|
1125
|
+
constructor(e, r) {
|
|
1126
|
+
super(e, r);
|
|
1127
|
+
}
|
|
1128
|
+
getPropertyConfig(e, r) {
|
|
1129
|
+
const f = this;
|
|
1130
|
+
this.propertyConfig.categories.basic = this.getBasicPropConfig(e);
|
|
1131
|
+
const { checkIsInFormComponent: i, assembleUnifiedLayoutContext: F, changeFormControlsByUnifiedLayoutConfig: v, changeControlClassInByColumn: T } = Xo(this.formSchemaUtils, this.componentId), V = this.getAppearanceConfig(e), C = i(this.componentId);
|
|
1132
|
+
V.properties.adaptForLanguage = {
|
|
551
1133
|
title: "控件布局响应国际化",
|
|
552
1134
|
description: "启用国际化后:简体中文、繁体中文环境下控件标签与输入框在一行展示,其他语言环境下控件标签与输入框上下排列。",
|
|
553
|
-
visible:
|
|
1135
|
+
visible: e.formType === "dynamic" || C,
|
|
554
1136
|
type: "boolean"
|
|
555
|
-
},
|
|
1137
|
+
}, V.properties.labelAutoOverflow = {
|
|
556
1138
|
title: "控件标签换行",
|
|
557
1139
|
description: "控件标签字数超长时,换行显示。控件标签与输入框在一行展示时,此属性有效。",
|
|
558
|
-
visible:
|
|
1140
|
+
visible: e.formType === "dynamic" || C,
|
|
559
1141
|
type: "boolean"
|
|
560
|
-
},
|
|
1142
|
+
}, V.properties.formType = {
|
|
1143
|
+
title: "控件来源",
|
|
1144
|
+
description: "",
|
|
1145
|
+
type: "enum",
|
|
1146
|
+
editor: {
|
|
1147
|
+
readonly: e.type === "dynamic-form",
|
|
1148
|
+
type: "combo-list",
|
|
1149
|
+
textField: "name",
|
|
1150
|
+
valueField: "value",
|
|
1151
|
+
data: [
|
|
1152
|
+
{
|
|
1153
|
+
value: "static",
|
|
1154
|
+
name: "静态"
|
|
1155
|
+
},
|
|
1156
|
+
{
|
|
1157
|
+
value: "dynamic",
|
|
1158
|
+
name: "动态"
|
|
1159
|
+
},
|
|
1160
|
+
{
|
|
1161
|
+
value: "mixed",
|
|
1162
|
+
name: "混合"
|
|
1163
|
+
}
|
|
1164
|
+
]
|
|
1165
|
+
},
|
|
1166
|
+
refreshPanelAfterChanged: !0
|
|
1167
|
+
}, V.properties.unifiedLayout = {
|
|
561
1168
|
title: "统一布局配置",
|
|
562
1169
|
description: "统一配置卡片区域内所有控件的宽度,只支持标准模式",
|
|
563
|
-
visible:
|
|
1170
|
+
visible: e.formType === "dynamic" || C,
|
|
564
1171
|
refreshPanelAfterChanged: !0,
|
|
565
1172
|
editor: {
|
|
566
1173
|
type: "response-form-layout-setting",
|
|
567
|
-
initialState:
|
|
1174
|
+
initialState: F(e)
|
|
568
1175
|
}
|
|
569
|
-
},
|
|
570
|
-
if (
|
|
571
|
-
switch (
|
|
1176
|
+
}, V.setPropertyRelates = function(b, I) {
|
|
1177
|
+
if (b)
|
|
1178
|
+
switch (b && b.propertyID) {
|
|
572
1179
|
case "unifiedLayout": {
|
|
573
|
-
|
|
1180
|
+
e.formType === "dynamic" ? e.layout = T("", b.propertyValue) : (v(null, b.propertyValue, e.id), f.updateElementByParentContainer(e.id, r));
|
|
574
1181
|
break;
|
|
575
1182
|
}
|
|
576
1183
|
case "labelAutoOverflow": {
|
|
577
|
-
|
|
1184
|
+
f.setLabelAutoOverflow(e, b.propertyValue), yo();
|
|
578
1185
|
break;
|
|
579
1186
|
}
|
|
580
1187
|
}
|
|
581
|
-
}, this.propertyConfig.categories.appearance =
|
|
1188
|
+
}, this.propertyConfig.categories.appearance = V;
|
|
1189
|
+
let w = {};
|
|
1190
|
+
if (e.formType && ["dynamic", "mixed"].indexOf(e.formType) > -1) {
|
|
1191
|
+
const b = this.getPropertyEditorParams(e, ["Variable", "Custom"], "fields", {}, { newVariablePrefix: "", newVariableType: "Array" }), I = this.getPropertyEditorParams(e, ["Variable", "Custom"], "formData", {}, { newVariablePrefix: "", newVariableType: "Object" });
|
|
1192
|
+
w = {
|
|
1193
|
+
fields: {
|
|
1194
|
+
title: "动态控件列表",
|
|
1195
|
+
type: "string",
|
|
1196
|
+
description: "动态控件列表",
|
|
1197
|
+
editor: b
|
|
1198
|
+
},
|
|
1199
|
+
formData: {
|
|
1200
|
+
title: "动态控件列表初始值",
|
|
1201
|
+
type: "string",
|
|
1202
|
+
description: "动态控件列表初始值",
|
|
1203
|
+
editor: I
|
|
1204
|
+
}
|
|
1205
|
+
};
|
|
1206
|
+
}
|
|
1207
|
+
return this.propertyConfig.categories.behavior = this.getBehaviorConfig(e, "", w, (b, I) => {
|
|
1208
|
+
switch (b.propertyID) {
|
|
1209
|
+
case "fields":
|
|
1210
|
+
case "formData":
|
|
1211
|
+
f.afterMutilEditorChanged(e, b);
|
|
1212
|
+
break;
|
|
1213
|
+
}
|
|
1214
|
+
}), this.propertyConfig;
|
|
582
1215
|
}
|
|
583
|
-
setLabelAutoOverflow(
|
|
584
|
-
if (!
|
|
585
|
-
const
|
|
586
|
-
|
|
1216
|
+
setLabelAutoOverflow(e, r, f) {
|
|
1217
|
+
if (!f) {
|
|
1218
|
+
const i = this.formSchemaUtils.getComponentById(this.componentId);
|
|
1219
|
+
f = this.formSchemaUtils.selectNode(i, (F) => F.id === e.id);
|
|
587
1220
|
}
|
|
588
|
-
|
|
589
|
-
if (
|
|
590
|
-
this.setLabelAutoOverflow(null,
|
|
1221
|
+
f && f.contents && f.contents.length && f.contents.forEach((i) => {
|
|
1222
|
+
if (i.type === ee.fieldset.type) {
|
|
1223
|
+
this.setLabelAutoOverflow(null, r, i);
|
|
591
1224
|
return;
|
|
592
1225
|
}
|
|
593
|
-
|
|
1226
|
+
i.appearance || (i.appearance = {
|
|
594
1227
|
class: ""
|
|
595
|
-
}),
|
|
1228
|
+
}), i.appearance.class || (i.appearance.class = ""), r ? i.appearance.class.includes("farris-group-multi-label") || (i.appearance.class = i.appearance.class + " farris-group-multi-label") : i.appearance.class = i.appearance.class.replace("farris-group-multi-label", "").trim();
|
|
596
1229
|
});
|
|
597
1230
|
}
|
|
598
1231
|
}
|
|
599
|
-
function
|
|
600
|
-
const
|
|
601
|
-
function
|
|
602
|
-
const { sourceElement:
|
|
603
|
-
if (!
|
|
1232
|
+
function kr(t, e) {
|
|
1233
|
+
const r = t.schema, f = new go(), { canMove: i, canAccept: F, canDelete: v } = f.getTemplateRule(t, e);
|
|
1234
|
+
function T(n, s) {
|
|
1235
|
+
const { sourceElement: d } = n, { componentInstance: o } = d, a = e == null ? void 0 : e.formSchemaUtils;
|
|
1236
|
+
if (!a)
|
|
604
1237
|
return !0;
|
|
605
|
-
const
|
|
606
|
-
return
|
|
1238
|
+
const m = a.getComponentById(o.value.belongedComponentId), g = a.getViewModelById(m.viewModel), h = a.getComponentById(t.componentInstance.value.belongedComponentId), y = a.getViewModelById(h.viewModel);
|
|
1239
|
+
return s ? g != null && g.id && (y != null && y.id) && g.id !== y.id ? g.bindTo === y.bindTo : !0 : (g == null ? void 0 : g.id) === (y == null ? void 0 : y.id);
|
|
607
1240
|
}
|
|
608
|
-
function
|
|
609
|
-
const { bindingTargetId:
|
|
610
|
-
if (!
|
|
1241
|
+
function V(n) {
|
|
1242
|
+
const { bindingTargetId: s } = n;
|
|
1243
|
+
if (!e)
|
|
611
1244
|
return;
|
|
612
|
-
const { formSchemaUtils:
|
|
613
|
-
return !!(
|
|
1245
|
+
const { formSchemaUtils: d, schemaService: o } = e, a = d.getComponentById(t.componentInstance.value.belongedComponentId), m = o.getFieldByIDAndVMID(s, a.viewModel);
|
|
1246
|
+
return !!(m != null && m.schemaField);
|
|
614
1247
|
}
|
|
615
|
-
function C(
|
|
616
|
-
const
|
|
617
|
-
if (
|
|
618
|
-
if (
|
|
1248
|
+
function C(n) {
|
|
1249
|
+
const s = f.getComponentContext(t);
|
|
1250
|
+
if (s && s.componentClassList && s.componentClassList.includes("f-form-layout") && s.componentClassList.includes("farris-form")) {
|
|
1251
|
+
if (n.sourceType === "control" && (n.componentCategory === "input" || n.componentType && ["fieldset", "dynamic-form"].indexOf(n.componentType) > -1))
|
|
619
1252
|
return !0;
|
|
620
|
-
if (
|
|
621
|
-
if (
|
|
622
|
-
return
|
|
623
|
-
if (
|
|
624
|
-
return
|
|
1253
|
+
if (n.sourceType === "move") {
|
|
1254
|
+
if (n.componentType === "form-group")
|
|
1255
|
+
return T(n, !0);
|
|
1256
|
+
if (n.componentType === "fieldset")
|
|
1257
|
+
return T(n, !1);
|
|
1258
|
+
if (n.componentType === "dynamic-form")
|
|
1259
|
+
return !0;
|
|
625
1260
|
}
|
|
626
|
-
return
|
|
1261
|
+
return n.sourceType === "field" && n.componentCategory === "input" ? V(n) : !1;
|
|
627
1262
|
}
|
|
628
1263
|
return !0;
|
|
629
1264
|
}
|
|
630
|
-
function
|
|
631
|
-
return !(!
|
|
1265
|
+
function w(n) {
|
|
1266
|
+
return !(!Co().basalDragulaRuleForContainer(n, e) || !F || !C(n));
|
|
632
1267
|
}
|
|
633
|
-
function
|
|
634
|
-
var
|
|
635
|
-
const
|
|
636
|
-
if (
|
|
1268
|
+
function b(n) {
|
|
1269
|
+
var y;
|
|
1270
|
+
const s = n.componentInstance, d = s.value.schema, o = e == null ? void 0 : e.formSchemaUtils, a = e == null ? void 0 : e.designViewModelUtils, m = o.getViewModelIdByComponentId(s.value.belongedComponentId), g = a.getDgViewModel(m), h = s.value.parent;
|
|
1271
|
+
if (h && ee.fieldset && ((y = h.schema) == null ? void 0 : y.type) === ee.fieldset.type && g) {
|
|
637
1272
|
const M = { groupId: null, groupName: null };
|
|
638
|
-
switch (
|
|
639
|
-
case
|
|
640
|
-
|
|
1273
|
+
switch (d.binding.type) {
|
|
1274
|
+
case S.Form: {
|
|
1275
|
+
g.changeField(d.binding.field, M);
|
|
641
1276
|
break;
|
|
642
1277
|
}
|
|
643
|
-
case
|
|
644
|
-
|
|
1278
|
+
case S.Variable: {
|
|
1279
|
+
o.modifyViewModelFieldById(m, d.binding.field, M, !0);
|
|
645
1280
|
break;
|
|
646
1281
|
}
|
|
647
1282
|
}
|
|
648
1283
|
}
|
|
649
1284
|
}
|
|
650
|
-
function
|
|
651
|
-
const
|
|
652
|
-
|
|
653
|
-
const
|
|
654
|
-
|
|
1285
|
+
function I(n, s, d) {
|
|
1286
|
+
const o = s.fields.find((y) => y.id === n), a = e == null ? void 0 : e.designViewModelUtils, m = a.getDgViewModel(s.id), g = m.fields.find((y) => y.id === n);
|
|
1287
|
+
m.removeField([n]);
|
|
1288
|
+
const h = a.getDgViewModel(d);
|
|
1289
|
+
h.addField(g), o.fieldSchema && h.changeField(g.id, o.fieldSchema);
|
|
655
1290
|
}
|
|
656
|
-
function
|
|
657
|
-
const
|
|
658
|
-
if (
|
|
659
|
-
|
|
1291
|
+
function R(n, s, d, o = []) {
|
|
1292
|
+
const a = s.id, m = n.binding.field, g = s.fields.findIndex((y) => y.id === m);
|
|
1293
|
+
if (g > -1 && (d.fields.push(s.fields[g]), s.fields.splice(g, 1)), a === "root-viewmodel" && d.id !== "root-viewmodel") {
|
|
1294
|
+
n.binding.path && !n.binding.path.includes("root-component.") && (n.binding.path = "root-component." + n.binding.path);
|
|
660
1295
|
return;
|
|
661
1296
|
}
|
|
662
|
-
if (
|
|
663
|
-
|
|
1297
|
+
if (d.id === "root-viewmodel" && a !== "root-viewmodel" && n.binding.path && n.binding.path.includes("root-component.")) {
|
|
1298
|
+
n.binding.path = n.binding.path.replace("root-component.", "");
|
|
664
1299
|
return;
|
|
665
1300
|
}
|
|
666
|
-
const
|
|
667
|
-
|
|
1301
|
+
const h = s.states.find((y) => y.id === m);
|
|
1302
|
+
h && (d.states = d.states ? d.states : [], d.states.findIndex((y) => y.id === h.id) < 0 && (d.states.push(h), o.push(h.id)));
|
|
668
1303
|
}
|
|
669
|
-
function
|
|
670
|
-
var
|
|
671
|
-
if (!
|
|
1304
|
+
function G(n, s, d, o = []) {
|
|
1305
|
+
var g;
|
|
1306
|
+
if (!n)
|
|
672
1307
|
return;
|
|
673
|
-
const
|
|
674
|
-
Object.keys(
|
|
675
|
-
if (
|
|
1308
|
+
const a = s.id === "root-viewmodel" && d.id !== "root-viewmodel", m = d.id === "root-viewmodel" && s.id !== "root-viewmodel";
|
|
1309
|
+
Object.keys(n).forEach((h) => {
|
|
1310
|
+
if (h === "binding")
|
|
676
1311
|
return;
|
|
677
|
-
const
|
|
678
|
-
if (
|
|
679
|
-
if (
|
|
680
|
-
|
|
1312
|
+
const y = n[h];
|
|
1313
|
+
if (y && typeof y == "object" && y.type === S.Variable && y.field) {
|
|
1314
|
+
if (a) {
|
|
1315
|
+
y.path && !y.path.includes("root-component.") && (y.path = "root-component." + y.path);
|
|
681
1316
|
return;
|
|
682
1317
|
}
|
|
683
|
-
if (
|
|
684
|
-
|
|
1318
|
+
if (m && y.path && y.path.includes("root-component.")) {
|
|
1319
|
+
y.path = y.path.replace("root-component.", "");
|
|
685
1320
|
return;
|
|
686
1321
|
}
|
|
687
|
-
const M =
|
|
1322
|
+
const M = s.states.find((E) => E.id === y.field);
|
|
688
1323
|
if (M) {
|
|
689
|
-
|
|
690
|
-
const E =
|
|
1324
|
+
o.push(M.id), d.states = d.states ? d.states : [];
|
|
1325
|
+
const E = d.states.find((x) => x.code === M.code);
|
|
691
1326
|
if (E)
|
|
692
|
-
|
|
1327
|
+
y.field = E.id;
|
|
693
1328
|
else {
|
|
694
|
-
const
|
|
695
|
-
|
|
1329
|
+
const x = Object.assign({}, { newId: me().guid() }, M);
|
|
1330
|
+
d.states.push(x), y.field = x.newId;
|
|
696
1331
|
}
|
|
697
1332
|
}
|
|
698
1333
|
}
|
|
699
|
-
}), (
|
|
700
|
-
|
|
1334
|
+
}), (g = d.states) != null && g.length && d.states.map((h) => {
|
|
1335
|
+
h.newId && (h.id = h.newId, delete h.newId);
|
|
701
1336
|
});
|
|
702
1337
|
}
|
|
703
|
-
function
|
|
704
|
-
if (
|
|
705
|
-
for (const
|
|
706
|
-
|
|
1338
|
+
function K(n, s, d) {
|
|
1339
|
+
if (n && (s(n, d), n.contents))
|
|
1340
|
+
for (const o of n.contents)
|
|
1341
|
+
K(o, s, d);
|
|
707
1342
|
}
|
|
708
|
-
function
|
|
709
|
-
if (!
|
|
1343
|
+
function _(n = [], s) {
|
|
1344
|
+
if (!n.length)
|
|
710
1345
|
return;
|
|
711
|
-
const
|
|
712
|
-
|
|
713
|
-
const E =
|
|
714
|
-
E && typeof E == "object" && E.type ===
|
|
715
|
-
}),
|
|
1346
|
+
const d = e == null ? void 0 : e.formSchemaUtils, o = d.getComponentByViewModelId(s), a = [], m = (h, y) => {
|
|
1347
|
+
h && (Object.keys(h).forEach((M) => {
|
|
1348
|
+
const E = h[M];
|
|
1349
|
+
E && typeof E == "object" && E.type === S.Variable && n.includes(E.field) && !y.includes(E.field) && y.push(E.field);
|
|
1350
|
+
}), h.editor && m(h.editor, y));
|
|
716
1351
|
};
|
|
717
|
-
|
|
718
|
-
const
|
|
719
|
-
|
|
720
|
-
|
|
1352
|
+
K(o, m, a);
|
|
1353
|
+
const g = d.getViewModelById(s);
|
|
1354
|
+
n.forEach((h) => {
|
|
1355
|
+
a.includes(h) || (g.states = g.states.filter((y) => y.id !== h));
|
|
721
1356
|
});
|
|
722
1357
|
}
|
|
723
|
-
function
|
|
724
|
-
const
|
|
725
|
-
id:
|
|
726
|
-
code:
|
|
727
|
-
name:
|
|
728
|
-
}),
|
|
729
|
-
return
|
|
730
|
-
host:
|
|
731
|
-
handler:
|
|
732
|
-
}),
|
|
733
|
-
}
|
|
734
|
-
function
|
|
735
|
-
var M, E,
|
|
736
|
-
const
|
|
737
|
-
if (!
|
|
1358
|
+
function X(n) {
|
|
1359
|
+
const s = me().guid(), d = Object.assign({}, n, {
|
|
1360
|
+
id: s,
|
|
1361
|
+
code: n.code + s.slice(0, 4),
|
|
1362
|
+
name: n.name + s.slice(0, 4)
|
|
1363
|
+
}), m = (e == null ? void 0 : e.formSchemaUtils).getCommands().find((g) => g.id === n.cmpId);
|
|
1364
|
+
return m && m.refedHandlers.push({
|
|
1365
|
+
host: s,
|
|
1366
|
+
handler: n.handlerName
|
|
1367
|
+
}), d;
|
|
1368
|
+
}
|
|
1369
|
+
function B(n, s, d) {
|
|
1370
|
+
var M, E, x;
|
|
1371
|
+
const o = {}, a = n.type === "form-group" && n.editor ? n.editor.type : n.type, m = (M = ve[a]) == null ? void 0 : M.events;
|
|
1372
|
+
if (!m)
|
|
738
1373
|
return;
|
|
739
|
-
Object.keys(
|
|
740
|
-
const
|
|
741
|
-
if (
|
|
742
|
-
const
|
|
743
|
-
if (
|
|
744
|
-
let
|
|
745
|
-
|
|
1374
|
+
Object.keys(n).forEach(($) => {
|
|
1375
|
+
const O = Object.keys(m).find((N) => N === $);
|
|
1376
|
+
if (O && n[O]) {
|
|
1377
|
+
const N = s.commands.find((D) => D.code === n[O]);
|
|
1378
|
+
if (N) {
|
|
1379
|
+
let D = o[N.code];
|
|
1380
|
+
D || (D = X(N), o[N.code] = D, d.commands.push(D)), n[O] = D.code;
|
|
746
1381
|
}
|
|
747
1382
|
}
|
|
748
1383
|
});
|
|
749
|
-
const
|
|
750
|
-
if (((E =
|
|
751
|
-
const
|
|
752
|
-
|
|
753
|
-
if (
|
|
754
|
-
const
|
|
755
|
-
if (!
|
|
1384
|
+
const h = (e == null ? void 0 : e.designViewModelUtils).getDgViewModel(d.id), y = ["valueChanging", "valueChanged"];
|
|
1385
|
+
if (((E = n.binding) == null ? void 0 : E.type) === S.Form) {
|
|
1386
|
+
const $ = (x = d.fields) == null ? void 0 : x.find((O) => O.id === n.binding.field);
|
|
1387
|
+
$ && y.forEach((O) => {
|
|
1388
|
+
if ($[O]) {
|
|
1389
|
+
const N = s.commands.find((D) => D.code === $[O]);
|
|
1390
|
+
if (!N)
|
|
756
1391
|
return;
|
|
757
|
-
if (
|
|
758
|
-
|
|
1392
|
+
if (o[N.code])
|
|
1393
|
+
h.changeField($.id, { [O]: o[N.code].code });
|
|
759
1394
|
else {
|
|
760
|
-
const
|
|
761
|
-
|
|
1395
|
+
const D = X(N);
|
|
1396
|
+
o[N.code] = D, d.commands.push(D), h.changeField($.id, { [O]: D.code });
|
|
762
1397
|
}
|
|
763
1398
|
}
|
|
764
1399
|
});
|
|
765
1400
|
}
|
|
766
1401
|
}
|
|
767
|
-
function
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
1402
|
+
function P(n) {
|
|
1403
|
+
var y, M;
|
|
1404
|
+
const s = e == null ? void 0 : e.formSchemaUtils, d = n.componentInstance, o = d.value.schema, a = s.getViewModelIdByComponentId(d.value.belongedComponentId), m = s.getViewModelById(a), g = s.getComponentById(t.componentInstance.value.belongedComponentId), h = s.getViewModelById(g.viewModel);
|
|
1405
|
+
if (a !== h.id) {
|
|
1406
|
+
const E = (y = o.binding) == null ? void 0 : y.type, x = (M = o.binding) == null ? void 0 : M.field, $ = [];
|
|
1407
|
+
switch (E) {
|
|
1408
|
+
case S.Form: {
|
|
1409
|
+
I(x, m, h.id);
|
|
774
1410
|
break;
|
|
775
1411
|
}
|
|
776
|
-
case
|
|
777
|
-
|
|
1412
|
+
case S.Variable: {
|
|
1413
|
+
R(o, m, h, $);
|
|
778
1414
|
break;
|
|
779
1415
|
}
|
|
780
1416
|
}
|
|
781
|
-
|
|
1417
|
+
G(o, m, h, $), G(o.editor, m, h, $), B(o, m, h), a !== "root-viewmodel" && _($, a);
|
|
782
1418
|
}
|
|
783
1419
|
}
|
|
784
|
-
function
|
|
785
|
-
|
|
1420
|
+
function k(n) {
|
|
1421
|
+
var o;
|
|
1422
|
+
if (!n || !n.componentInstance)
|
|
786
1423
|
return;
|
|
787
|
-
const
|
|
788
|
-
|
|
1424
|
+
const d = n.componentInstance.value.schema;
|
|
1425
|
+
if (d.type === "dynamic-form") {
|
|
1426
|
+
const a = ((o = d == null ? void 0 : d.appearance) == null ? void 0 : o.class) || "";
|
|
1427
|
+
a.indexOf("col-12") < 0 && (d.appearance = {
|
|
1428
|
+
...d.appearance,
|
|
1429
|
+
class: a + " col-12 px-0"
|
|
1430
|
+
}), P(n);
|
|
1431
|
+
return;
|
|
1432
|
+
}
|
|
1433
|
+
!d.binding || !d.binding.field || (b(n), P(n));
|
|
789
1434
|
}
|
|
790
|
-
function
|
|
791
|
-
return
|
|
1435
|
+
function A() {
|
|
1436
|
+
return r.componentType ? "display:inherit;flex-direction:inherit;margin-bottom:10px" : "";
|
|
792
1437
|
}
|
|
793
|
-
function
|
|
794
|
-
let
|
|
795
|
-
switch (
|
|
1438
|
+
function j(n) {
|
|
1439
|
+
let s = "";
|
|
1440
|
+
switch (n) {
|
|
796
1441
|
case 1: {
|
|
797
|
-
|
|
1442
|
+
s = "col-12 col-md-12 col-xl-12 col-el-12";
|
|
798
1443
|
break;
|
|
799
1444
|
}
|
|
800
1445
|
case 2: {
|
|
801
|
-
|
|
1446
|
+
s = "col-12 col-md-6 col-xl-6 col-el-6";
|
|
802
1447
|
break;
|
|
803
1448
|
}
|
|
804
1449
|
case 3: {
|
|
805
|
-
|
|
1450
|
+
s = "col-12 col-md-6 col-xl-4 col-el-4";
|
|
806
1451
|
break;
|
|
807
1452
|
}
|
|
808
1453
|
case 4: {
|
|
809
|
-
|
|
1454
|
+
s = "col-12 col-md-6 col-xl-3 col-el-2";
|
|
810
1455
|
break;
|
|
811
1456
|
}
|
|
812
1457
|
}
|
|
813
|
-
return
|
|
1458
|
+
return s;
|
|
814
1459
|
}
|
|
815
|
-
function
|
|
816
|
-
let
|
|
1460
|
+
function Y(n, s) {
|
|
1461
|
+
let d = !1;
|
|
817
1462
|
if (t.schema && Object.prototype.hasOwnProperty.call(t.schema, "labelAutoOverflow"))
|
|
818
|
-
|
|
1463
|
+
d = t.schema.labelAutoOverflow;
|
|
819
1464
|
else {
|
|
820
|
-
const
|
|
821
|
-
|
|
1465
|
+
const o = e == null ? void 0 : e.formSchemaUtils, a = o == null ? void 0 : o.selectNode(s, (m) => m.type === ee["response-form"].type);
|
|
1466
|
+
a && (d = a.labelAutoOverflow);
|
|
822
1467
|
}
|
|
823
|
-
return
|
|
1468
|
+
return d && (n += " farris-group-multi-label"), n;
|
|
824
1469
|
}
|
|
825
|
-
function
|
|
826
|
-
const
|
|
827
|
-
if (
|
|
828
|
-
const { formColumns:
|
|
829
|
-
let
|
|
830
|
-
|
|
1470
|
+
function Q(n) {
|
|
1471
|
+
const s = t.componentInstance.value.getBelongedComponentInstance(t.componentInstance);
|
|
1472
|
+
if (s && s.schema && s.schema.componentType) {
|
|
1473
|
+
const { formColumns: d } = s.schema;
|
|
1474
|
+
let o = j(d);
|
|
1475
|
+
o = e == null ? void 0 : e.formSchemaUtils.getControlClassByFormUnifiedLayout(o, s.schema.id, t.schema), o = Y(o, s.schema), n.appearance || (n.appearance = {}), n.appearance.class = o;
|
|
831
1476
|
}
|
|
832
1477
|
}
|
|
833
|
-
function
|
|
834
|
-
const { bindingSourceContext:
|
|
835
|
-
if (
|
|
836
|
-
const
|
|
837
|
-
M.removeField([
|
|
1478
|
+
function Z(n, s, d, o) {
|
|
1479
|
+
const { bindingSourceContext: a, parentComponentInstance: m } = n;
|
|
1480
|
+
if (a != null && a.entityFieldNode && m) {
|
|
1481
|
+
const g = e == null ? void 0 : e.designViewModelUtils, y = (e == null ? void 0 : e.formSchemaUtils).getViewModelIdByComponentId(m.belongedComponentId), M = g.getDgViewModel(y);
|
|
1482
|
+
M.removeField([a.entityFieldNode.id]), M.addField(a.designViewModelField), s && M.changeField(a.entityFieldNode.id, { editor: { $type: s }, groupId: d, groupName: o });
|
|
838
1483
|
}
|
|
839
1484
|
}
|
|
840
|
-
function oe(
|
|
841
|
-
var g, h
|
|
842
|
-
const
|
|
843
|
-
if ((
|
|
844
|
-
const { label:
|
|
1485
|
+
function oe(n, s) {
|
|
1486
|
+
var m, g, h;
|
|
1487
|
+
const d = r;
|
|
1488
|
+
if ((d.appearance && d.appearance.class || "").split(" ").includes("f-form-layout") && n.componentCategory === "input") {
|
|
1489
|
+
const { label: y } = n;
|
|
845
1490
|
let M;
|
|
846
|
-
const E =
|
|
847
|
-
return (
|
|
1491
|
+
const E = e == null ? void 0 : e.controlCreatorUtils;
|
|
1492
|
+
return (m = n.bindingSourceContext) != null && m.entityFieldNode ? M = E.setFormFieldProperty((g = n.bindingSourceContext) == null ? void 0 : g.entityFieldNode, s == null ? void 0 : s.type) : (M = E.createFormGroupWithoutField(s == null ? void 0 : s.type), M.label = y), Q(M), Z(n, (h = M.editor) == null ? void 0 : h.type), M;
|
|
848
1493
|
}
|
|
849
|
-
return n
|
|
1494
|
+
return n.componentType === "dynamic-form" && (s.appearance = {
|
|
1495
|
+
class: "col-12",
|
|
1496
|
+
...s.appearance
|
|
1497
|
+
}), s;
|
|
850
1498
|
}
|
|
851
1499
|
function ne() {
|
|
852
|
-
return
|
|
1500
|
+
return i;
|
|
853
1501
|
}
|
|
854
|
-
function
|
|
855
|
-
return
|
|
1502
|
+
function H() {
|
|
1503
|
+
return v;
|
|
856
1504
|
}
|
|
857
|
-
function
|
|
1505
|
+
function L() {
|
|
858
1506
|
return !1;
|
|
859
1507
|
}
|
|
860
|
-
function
|
|
861
|
-
return new
|
|
1508
|
+
function W(n) {
|
|
1509
|
+
return new Jo(n, e).getPropertyConfig(r, t.componentInstance.value);
|
|
862
1510
|
}
|
|
863
1511
|
return {
|
|
864
|
-
canAccepts:
|
|
865
|
-
checkCanDeleteComponent:
|
|
1512
|
+
canAccepts: w,
|
|
1513
|
+
checkCanDeleteComponent: H,
|
|
866
1514
|
checkCanMoveComponent: ne,
|
|
867
|
-
getStyles:
|
|
868
|
-
getPropsConfig:
|
|
869
|
-
hideNestedPaddingInDesginerView:
|
|
870
|
-
onAcceptMovedChildElement:
|
|
1515
|
+
getStyles: A,
|
|
1516
|
+
getPropsConfig: W,
|
|
1517
|
+
hideNestedPaddingInDesginerView: L,
|
|
1518
|
+
onAcceptMovedChildElement: k,
|
|
871
1519
|
onResolveNewComponentSchema: oe,
|
|
872
|
-
moveInputBetweenComponent:
|
|
873
|
-
resolveFormGroupAppearance:
|
|
874
|
-
syncFieldToViewModel:
|
|
1520
|
+
moveInputBetweenComponent: P,
|
|
1521
|
+
resolveFormGroupAppearance: Q,
|
|
1522
|
+
syncFieldToViewModel: Z
|
|
875
1523
|
};
|
|
876
1524
|
}
|
|
877
|
-
|
|
878
|
-
t.component(
|
|
1525
|
+
se.install = (t) => {
|
|
1526
|
+
t.component(ye.name, ye).component(Ce.name, Ce).component(se.name, se).component(ge.name, ge);
|
|
879
1527
|
};
|
|
880
1528
|
export {
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
1529
|
+
se as FDynamicForm,
|
|
1530
|
+
ge as FDynamicFormGroup,
|
|
1531
|
+
Ce as FDynamicFormInput,
|
|
1532
|
+
qo as FDynamicFormLabel,
|
|
1533
|
+
ye as FResponseForm,
|
|
1534
|
+
se as default,
|
|
1535
|
+
jo as dynamicFormGroupProps,
|
|
1536
|
+
_o as dynamicFormInputProps,
|
|
1537
|
+
Ao as dynamicFormProps,
|
|
1538
|
+
Br as dynamicFormPropsResolver,
|
|
1539
|
+
Pr as formPropsResolver,
|
|
1540
|
+
ie as responseFormProps,
|
|
1541
|
+
kr as useDesignerRules,
|
|
1542
|
+
we as useTypeResolver
|
|
891
1543
|
};
|