@farris/ui-vue 1.6.0-beta.7 → 1.6.0-beta.8
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/data-view/index.esm.js +544 -538
- package/components/data-view/index.umd.cjs +1 -1
- package/components/list-view/index.css +1 -0
- package/components/list-view/index.esm.js +11593 -0
- package/components/list-view/index.umd.cjs +20 -0
- package/components/list-view/package.json +8 -0
- package/components/list-view/style.js +2 -0
- package/components/response-layout/index.css +1 -0
- package/components/response-layout/index.esm.js +11551 -0
- package/components/response-layout/index.umd.cjs +1 -0
- package/components/response-layout/package.json +8 -0
- package/designer/button-edit/index.css +1 -0
- package/designer/button-edit/index.esm.js +11122 -0
- package/designer/button-edit/index.umd.cjs +1 -0
- package/designer/checkbox/index.esm.js +250 -0
- package/designer/checkbox/index.umd.cjs +1 -0
- package/designer/checkbox-group/index.esm.js +377 -0
- package/designer/checkbox-group/index.umd.cjs +1 -0
- package/designer/data-grid/index.css +1 -0
- package/designer/data-grid/index.esm.js +17851 -0
- package/designer/data-grid/index.umd.cjs +23 -0
- package/designer/drawer/index.css +1 -0
- package/designer/drawer/index.esm.js +2228 -0
- package/designer/drawer/index.umd.cjs +6 -0
- package/designer/farris-designer.all.esm.js +26343 -0
- package/designer/farris-designer.all.umd.cjs +32 -0
- package/designer/index.css +1 -0
- package/designer/input-group/index.esm.js +1035 -0
- package/designer/input-group/index.umd.cjs +1 -0
- package/designer/radio-group/index.css +1 -0
- package/designer/radio-group/index.esm.js +12472 -0
- package/designer/radio-group/index.umd.cjs +1 -0
- package/farris.all.esm.js +2254 -2248
- package/farris.all.umd.cjs +13 -13
- package/package.json +1 -1
- package/types/chs.d.ts +0 -494
|
@@ -0,0 +1,1035 @@
|
|
|
1
|
+
import { useTextBoxDesign as ne, useClear as oe, withInstall as re } from "../../components/common/index.esm.js";
|
|
2
|
+
import { createPropsResolver as ie } from "../../components/dynamic-resolver/index.esm.js";
|
|
3
|
+
import ae, { inputGroupProps as se } from "../../components/input-group/index.esm.js";
|
|
4
|
+
import { ref as E, computed as M, watch as le, createVNode as N, defineComponent as ue, inject as G, onMounted as ce } from "vue";
|
|
5
|
+
import { useDesignerComponent as de } from "../../components/designer-canvas/index.esm.js";
|
|
6
|
+
import { InputBaseProperty as pe } from "../../components/property-panel/index.esm.js";
|
|
7
|
+
import { cloneDeep as H, isPlainObject as L } from "lodash-es";
|
|
8
|
+
const fe = {
|
|
9
|
+
id: { Type: String, default: "" },
|
|
10
|
+
/** 是否自动完成 */
|
|
11
|
+
autocomplete: { Type: String, default: "off" },
|
|
12
|
+
/** 自定义CLASS */
|
|
13
|
+
customClass: { Type: String, default: "" },
|
|
14
|
+
/** 禁用 */
|
|
15
|
+
disabled: { Type: Boolean, default: !1 },
|
|
16
|
+
/** 允许编辑 */
|
|
17
|
+
editable: { Type: Boolean, default: !0 },
|
|
18
|
+
/** 启用清除按钮 */
|
|
19
|
+
enableClear: { Type: Boolean, default: !0 },
|
|
20
|
+
/** 启用提示文本 */
|
|
21
|
+
enableTitle: { Type: Boolean, default: !0 },
|
|
22
|
+
/** 启用密码 */
|
|
23
|
+
enableViewPassword: { Type: Boolean, default: !0 },
|
|
24
|
+
/** 始终显示占位符文本 */
|
|
25
|
+
forcePlaceholder: { Type: Boolean, default: !1 },
|
|
26
|
+
/** 扩展按钮 */
|
|
27
|
+
groupText: { Type: String, default: "" },
|
|
28
|
+
/** 密码模式 */
|
|
29
|
+
type: { Type: String, default: "text" },
|
|
30
|
+
/** 最大值 */
|
|
31
|
+
max: { type: [Number, String] },
|
|
32
|
+
/** 最小值 */
|
|
33
|
+
min: { type: [Number, String] },
|
|
34
|
+
/** 最大长度 */
|
|
35
|
+
maxLength: { Type: Number || void 0, default: void 0 },
|
|
36
|
+
/** 最小长度 */
|
|
37
|
+
minLength: { Type: Number || void 0, default: void 0 },
|
|
38
|
+
/** 组件值 */
|
|
39
|
+
modelValue: { Type: String || Boolean, default: "" },
|
|
40
|
+
/** 隐藏边线 */
|
|
41
|
+
showBorder: { Type: Boolean, default: !0 },
|
|
42
|
+
/** 步长 */
|
|
43
|
+
step: { Type: Number, default: 1 },
|
|
44
|
+
/** 启用提示信息 */
|
|
45
|
+
placeholder: { Type: String, default: "" },
|
|
46
|
+
precision: { Type: Number, default: 0 },
|
|
47
|
+
/** 只读 */
|
|
48
|
+
readonly: { Type: Boolean, default: !1 },
|
|
49
|
+
/** 当组件禁用或只读时显示后边的按钮 */
|
|
50
|
+
showButtonWhenDisabled: { Type: Boolean, default: !1 },
|
|
51
|
+
/** tab索引 */
|
|
52
|
+
tabIndex: { Type: Number, default: 0 },
|
|
53
|
+
/** 文本在输入框中的对齐方式 */
|
|
54
|
+
textAlign: { Type: String, default: "left" },
|
|
55
|
+
/** 是否启用前置扩展信息;在输入框前面 显示 ① 图标鼠标滑过后显示 */
|
|
56
|
+
useExtendInfo: { Type: Boolean, default: !1 },
|
|
57
|
+
/** 前置扩展信息 */
|
|
58
|
+
extendInfo: { Type: String, default: "" },
|
|
59
|
+
/** 输入值 */
|
|
60
|
+
value: { Type: String, default: "" },
|
|
61
|
+
/** 是否撑开高度 */
|
|
62
|
+
autoHeight: { type: Boolean, default: !1 },
|
|
63
|
+
/** 自动聚焦 */
|
|
64
|
+
autofocus: { type: Boolean, default: !1 },
|
|
65
|
+
/** 文本区域可见的行数 */
|
|
66
|
+
rows: { type: Number, default: 2 },
|
|
67
|
+
/** 展示输入文本数量 */
|
|
68
|
+
showCount: { type: Boolean, default: !1 },
|
|
69
|
+
showZero: { type: Boolean, default: !1 },
|
|
70
|
+
/**
|
|
71
|
+
* 作为内嵌编辑器被创建后默认获得焦点
|
|
72
|
+
*/
|
|
73
|
+
focusOnCreated: { type: Boolean, default: !1 },
|
|
74
|
+
/**
|
|
75
|
+
* 作为内嵌编辑器被创建后默认选中文本
|
|
76
|
+
*/
|
|
77
|
+
selectOnCreated: { type: Boolean, default: !1 },
|
|
78
|
+
/**
|
|
79
|
+
* modelValue 更新时机, 默认 blur; 可选值:blur | input
|
|
80
|
+
* - blur: 离开焦点时更新
|
|
81
|
+
* - change: 输入时更新
|
|
82
|
+
*/
|
|
83
|
+
updateOn: { type: String, default: "blur" },
|
|
84
|
+
formatValidation: { type: Object, default: {} },
|
|
85
|
+
/**
|
|
86
|
+
* 是否启用快捷键
|
|
87
|
+
*/
|
|
88
|
+
keyboard: { type: Boolean, default: !0 }
|
|
89
|
+
};
|
|
90
|
+
function me(e, t) {
|
|
91
|
+
const n = E(e.groupText), a = M(() => e.showButtonWhenDisabled && (e.readonly || e.disabled)), m = M(() => e.type === "password" || e.enableClear || !!e.groupText || a.value);
|
|
92
|
+
return { appendedButtonClass: M(() => ({
|
|
93
|
+
"input-group-append": !0,
|
|
94
|
+
"append-force-show": a.value
|
|
95
|
+
})), appendedContent: n, shouldShowAppendedButton: m };
|
|
96
|
+
}
|
|
97
|
+
function ge(e, t, n, a) {
|
|
98
|
+
const { appendedContent: m } = a, y = E(e.enableViewPassword), C = M(() => e.type === "password"), B = '<span class="f-icon f-icon-eye" style="color: rgb(56, 143, 255);"></span>', h = '<span class="f-icon f-icon-eye"></span>', c = E(!1);
|
|
99
|
+
le(() => [e.readonly, e.disabled], ([s, d]) => {
|
|
100
|
+
C.value && (n.value = s || d ? "password" : n.value, m.value = s || d ? h : m.value);
|
|
101
|
+
});
|
|
102
|
+
function f() {
|
|
103
|
+
return c.value = !c.value, n.value = c.value ? "text" : "password", m.value = c.value ? B : h, !1;
|
|
104
|
+
}
|
|
105
|
+
function i() {
|
|
106
|
+
n.value = C.value ? "password" : "text", m.value = C.value ? y.value ? h : "" : m.value;
|
|
107
|
+
}
|
|
108
|
+
return i(), { isPassword: C, onClickAppendedButton: f };
|
|
109
|
+
}
|
|
110
|
+
function ve(e, t, n, a, m) {
|
|
111
|
+
const {
|
|
112
|
+
appendedButtonClass: y,
|
|
113
|
+
appendedContent: C
|
|
114
|
+
} = n, B = M(() => e.showButtonWhenDisabled && (!e.editable || !e.readonly) && !e.disabled), h = M(() => C.value && !t.slots.groupTextTemplate), c = M(() => !!t.slots.groupTextTemplate), {
|
|
115
|
+
clearButtonClass: f,
|
|
116
|
+
clearButtonStyle: i,
|
|
117
|
+
onClearValue: s,
|
|
118
|
+
shouldShowClearButton: d
|
|
119
|
+
} = a;
|
|
120
|
+
function o() {
|
|
121
|
+
return N("span", {
|
|
122
|
+
id: "clearIcon",
|
|
123
|
+
class: f.value,
|
|
124
|
+
style: i.value,
|
|
125
|
+
onClick: (v) => s(v)
|
|
126
|
+
}, [N("i", {
|
|
127
|
+
class: "f-icon modal_close"
|
|
128
|
+
}, null)]);
|
|
129
|
+
}
|
|
130
|
+
function r(v) {
|
|
131
|
+
t.emit("iconMouseEnter", v);
|
|
132
|
+
}
|
|
133
|
+
function l(v) {
|
|
134
|
+
t.emit("iconMouseLeave", v);
|
|
135
|
+
}
|
|
136
|
+
function p(v) {
|
|
137
|
+
B.value && t.emit("clickHandle", {
|
|
138
|
+
originalEvent: v
|
|
139
|
+
}), v.stopPropagation();
|
|
140
|
+
}
|
|
141
|
+
const g = e.type === "password" ? m.onClickAppendedButton : p;
|
|
142
|
+
function T() {
|
|
143
|
+
return N("span", {
|
|
144
|
+
class: "input-group-text",
|
|
145
|
+
onMouseenter: (v) => r(v),
|
|
146
|
+
onMouseleave: (v) => l(v),
|
|
147
|
+
innerHTML: C.value,
|
|
148
|
+
onClick: (v) => g(v)
|
|
149
|
+
}, null);
|
|
150
|
+
}
|
|
151
|
+
function S() {
|
|
152
|
+
return t.slots.groupTextTemplate && t.slots.groupTextTemplate();
|
|
153
|
+
}
|
|
154
|
+
function P() {
|
|
155
|
+
return h.value ? T : c.value ? S : "";
|
|
156
|
+
}
|
|
157
|
+
const b = P();
|
|
158
|
+
return () => N("div", {
|
|
159
|
+
class: y.value
|
|
160
|
+
}, [d.value && o(), b && b()]);
|
|
161
|
+
}
|
|
162
|
+
const q = [
|
|
163
|
+
{ key: "none", value: "无" },
|
|
164
|
+
{ key: "cellNumber", value: "手机号" },
|
|
165
|
+
{ key: "tel", value: "座机号/传真号" },
|
|
166
|
+
{ key: "telOrCell", value: "手机号/座机号/传真号" },
|
|
167
|
+
{ key: "postCode", value: "邮编" },
|
|
168
|
+
{ key: "email", value: "电子邮箱" },
|
|
169
|
+
{ key: "idCode", value: "身份证号" },
|
|
170
|
+
{ key: "carCode", value: "车牌号" },
|
|
171
|
+
{ key: "subjectCode", value: "10位数字会计科目代码" },
|
|
172
|
+
{ key: "custom", value: "自定义" }
|
|
173
|
+
];
|
|
174
|
+
function ye(e) {
|
|
175
|
+
switch (e) {
|
|
176
|
+
case "none":
|
|
177
|
+
return "";
|
|
178
|
+
case "cellNumber":
|
|
179
|
+
return "^1[0-9]{10}$";
|
|
180
|
+
case "tel":
|
|
181
|
+
return "^(0[0-9]{2,3}\\-)?([2-9][0-9]{6,7})+(\\-[0-9]{1,4})?$";
|
|
182
|
+
case "telOrCell":
|
|
183
|
+
return "^(0[0-9]{2,3}\\-)?([2-9][0-9]{6,7})+(\\-[0-9]{1,4})?$|^1[0-9]{10}$";
|
|
184
|
+
case "postCode":
|
|
185
|
+
return "^[1-9]\\d{5}(?!\\d)$";
|
|
186
|
+
case "workCode":
|
|
187
|
+
return "^\\d{8}$";
|
|
188
|
+
case "email":
|
|
189
|
+
return "^[A-Za-z\\d]+([-_.][A-Za-z\\d]+)*@([A-Za-z\\d]+[-.])+[A-Za-z]{2,5}$";
|
|
190
|
+
case "idCode":
|
|
191
|
+
return "^[1-9]\\d{5}[1-9]\\d{3}((0[1-9])|(1[0-2]))(0[1-9]|([1|2][0-9])|3[0-1])((\\d{4})|\\d{3}X)$";
|
|
192
|
+
case "carCode":
|
|
193
|
+
return "^([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][·\\s]?[A-HJ-NP-Z0-9]{4,5}[挂学警港澳]?|粤[Z港澳][·\\s]?[港澳][0-9A-HJ-NP-Z]{4}|[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼][A-Z][·\\s]?([DF][0-9A-HJ-NP-Z][0-9]{4}|[0-9]{5}[DF])[挂港澳]?|[使领][0-9]{3}[·\\s]?[0-9]{3}|临[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼][A-Z][·\\s]?[0-9A-Z]{4,5}|[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼][A-Z]?[·\\s]?警[0-9A-Z]{4}|[军海空][A-Z][·\\s]?[0-9]{4,5}|WJ(?:[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼]|\\d{2})[·\\s]?[0-9A-Z]{4,5})$";
|
|
194
|
+
case "carCodeNew":
|
|
195
|
+
return "^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF])|([DF][A-HJ-NP-Z0-9][0-9]{4}))$";
|
|
196
|
+
case "subjectCode":
|
|
197
|
+
return "^\\d{10}$";
|
|
198
|
+
}
|
|
199
|
+
return "";
|
|
200
|
+
}
|
|
201
|
+
function be(e) {
|
|
202
|
+
var t;
|
|
203
|
+
return "请输入正确的" + ((t = q.find((n) => n.key === e)) == null ? void 0 : t.value);
|
|
204
|
+
}
|
|
205
|
+
const Ce = {
|
|
206
|
+
convertTo: (e, t, n, a) => {
|
|
207
|
+
e.editor.formatValidation || (e.editor.formatValidation = { type: "none" }), e.editor.formatValidation.type = n, e.editor.formatValidation.expression = ye(n), e.editor.formatValidation.message = be(n);
|
|
208
|
+
},
|
|
209
|
+
convertFrom: (e, t, n) => e.editor.formatValidation ? t === "type" ? e.editor.formatValidation[t] || "none" : e.editor.formatValidation[t] : "none"
|
|
210
|
+
}, z = {
|
|
211
|
+
convertTo: (e, t, n, a) => {
|
|
212
|
+
e.editor.formatValidation || (e.editor.formatValidation = { type: "none" }), e.editor.formatValidation[t] = n;
|
|
213
|
+
},
|
|
214
|
+
convertFrom: (e, t, n) => e.editor.formatValidation ? e.editor.formatValidation[t] : e.editor[t]
|
|
215
|
+
};
|
|
216
|
+
class Te extends pe {
|
|
217
|
+
constructor(t, n) {
|
|
218
|
+
super(t, n);
|
|
219
|
+
}
|
|
220
|
+
getPropertyConfig(t, n) {
|
|
221
|
+
return super.getPropertyConfig(t, n), this.propertyConfig.categories.formatValidation = this.getFormatValidation(t), this.propertyConfig;
|
|
222
|
+
}
|
|
223
|
+
getEditorProperties(t) {
|
|
224
|
+
var a, m;
|
|
225
|
+
let n;
|
|
226
|
+
if (((a = t == null ? void 0 : t.binding) == null ? void 0 : a.type) === "Form") {
|
|
227
|
+
const y = this.schemaService.getFieldByIDAndVMID(t.binding.field, this.viewModelId);
|
|
228
|
+
(m = y == null ? void 0 : y.schemaField) != null && m.type && (n = y.schemaField.type.length);
|
|
229
|
+
}
|
|
230
|
+
return this.getComponentConfig(t, {}, {
|
|
231
|
+
maxLength: {
|
|
232
|
+
description: "文本字数最大长度",
|
|
233
|
+
title: "最大长度",
|
|
234
|
+
type: "number",
|
|
235
|
+
editor: {
|
|
236
|
+
nullable: !0,
|
|
237
|
+
min: 0,
|
|
238
|
+
useThousands: !1,
|
|
239
|
+
max: n
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
enableViewPassword: {
|
|
243
|
+
description: "",
|
|
244
|
+
title: "启用密码",
|
|
245
|
+
visible: !1,
|
|
246
|
+
type: "boolean"
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
getFormatValidation(t) {
|
|
251
|
+
var a, m, y;
|
|
252
|
+
const n = {
|
|
253
|
+
title: "输入格式校验",
|
|
254
|
+
description: "输入格式校验",
|
|
255
|
+
properties: {
|
|
256
|
+
type: {
|
|
257
|
+
title: "输入类型",
|
|
258
|
+
type: "enum",
|
|
259
|
+
description: "输入类型",
|
|
260
|
+
defaultValue: "",
|
|
261
|
+
editor: {
|
|
262
|
+
type: "combo-list",
|
|
263
|
+
textField: "value",
|
|
264
|
+
valueField: "key",
|
|
265
|
+
idField: "key",
|
|
266
|
+
editable: !1,
|
|
267
|
+
data: q
|
|
268
|
+
},
|
|
269
|
+
refreshPanelAfterChanged: !0,
|
|
270
|
+
$converter: Ce,
|
|
271
|
+
parentPropertyID: "formatValidation"
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
};
|
|
275
|
+
return (a = t.editor.formatValidation) != null && a.type && ((m = t.editor.formatValidation) == null ? void 0 : m.type) !== "none" && (n.properties.message = {
|
|
276
|
+
title: "输入错误提示",
|
|
277
|
+
type: "string",
|
|
278
|
+
description: "输入错误提示",
|
|
279
|
+
$converter: z,
|
|
280
|
+
parentPropertyID: "formatValidation"
|
|
281
|
+
}), ((y = t.editor.formatValidation) == null ? void 0 : y.type) === "custom" && (n.properties.expression = {
|
|
282
|
+
title: "匹配正则",
|
|
283
|
+
type: "string",
|
|
284
|
+
description: "匹配正则",
|
|
285
|
+
$converter: z,
|
|
286
|
+
parentPropertyID: "formatValidation"
|
|
287
|
+
}), n;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
function he(e, t) {
|
|
291
|
+
const n = e.schema;
|
|
292
|
+
function a(m, y) {
|
|
293
|
+
return new Te(m, t).getPropertyConfig(n, y);
|
|
294
|
+
}
|
|
295
|
+
return { getPropsConfig: a };
|
|
296
|
+
}
|
|
297
|
+
const D = /* @__PURE__ */ ue({
|
|
298
|
+
name: "FInputGroupDesign",
|
|
299
|
+
props: fe,
|
|
300
|
+
emits: ["updateExtendInfo", "clear", "valueChange", "clickHandle", "blurHandle", "focusHandle", "enterHandle", "iconMouseEnter", "iconMouseLeave", "keyupHandle", "keydownHandle", "inputClick"],
|
|
301
|
+
setup(e, t) {
|
|
302
|
+
const n = E(e.modelValue), a = E(e.modelValue), m = ne(e, t, n, a), {
|
|
303
|
+
inputGroupClass: y,
|
|
304
|
+
inputType: C,
|
|
305
|
+
inputGroupStyle: B
|
|
306
|
+
} = m, h = me(e), {
|
|
307
|
+
shouldShowAppendedButton: c
|
|
308
|
+
} = h, f = oe(e, t, m), {
|
|
309
|
+
onMouseEnter: i,
|
|
310
|
+
onMouseLeave: s
|
|
311
|
+
} = f, d = ge(e, t, C, h), o = E(), r = G("designer-host-service"), l = G("design-item-context"), p = he(l, r), g = de(o, l, p);
|
|
312
|
+
ce(() => {
|
|
313
|
+
o.value.componentInstance = g;
|
|
314
|
+
}), t.expose(g.value);
|
|
315
|
+
const T = ve(e, t, h, f, d), S = E();
|
|
316
|
+
return () => N("div", {
|
|
317
|
+
id: "inputGroup",
|
|
318
|
+
ref: o,
|
|
319
|
+
class: y.value,
|
|
320
|
+
style: B.value,
|
|
321
|
+
onMouseenter: i,
|
|
322
|
+
onMouseleave: s
|
|
323
|
+
}, [N("input", {
|
|
324
|
+
ref: S,
|
|
325
|
+
class: "form-control",
|
|
326
|
+
readonly: !0,
|
|
327
|
+
placeholder: e.placeholder
|
|
328
|
+
}, null), c.value && T()]);
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
function W(e, t) {
|
|
332
|
+
let n;
|
|
333
|
+
function a(i) {
|
|
334
|
+
const { properties: s, title: d, ignore: o } = i, r = o && Array.isArray(o), l = Object.keys(s).reduce((p, g) => ((!r || !o.find((T) => T === g)) && (p[g] = s[g].type === "object" && s[g].properties ? a(s[g]) : H(s[g].default)), p), {});
|
|
335
|
+
if (d && (!r || !o.find((p) => p === "id"))) {
|
|
336
|
+
const p = d.toLowerCase().replace(/-/g, "_");
|
|
337
|
+
l.id = `${p}_${Math.random().toString().slice(2, 6)}`;
|
|
338
|
+
}
|
|
339
|
+
return l;
|
|
340
|
+
}
|
|
341
|
+
function m(i) {
|
|
342
|
+
const { properties: s, title: d, required: o } = i;
|
|
343
|
+
if (o && Array.isArray(o)) {
|
|
344
|
+
const r = o.reduce((l, p) => (l[p] = s[p].type === "object" && s[p].properties ? a(s[p]) : H(s[p].default), l), {});
|
|
345
|
+
if (d && o.find((l) => l === "id")) {
|
|
346
|
+
const l = d.toLowerCase().replace(/-/g, "_");
|
|
347
|
+
r.id = `${l}_${Math.random().toString().slice(2, 6)}`;
|
|
348
|
+
}
|
|
349
|
+
return r;
|
|
350
|
+
}
|
|
351
|
+
return {
|
|
352
|
+
type: d
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
function y(i, s = {}, d) {
|
|
356
|
+
const o = e[i];
|
|
357
|
+
if (o) {
|
|
358
|
+
let r = m(o);
|
|
359
|
+
const l = t[i];
|
|
360
|
+
return r = l ? l({ getSchemaByType: y }, r, s, d) : r, n != null && n.appendIdentifyForNewControl && n.appendIdentifyForNewControl(r), r;
|
|
361
|
+
}
|
|
362
|
+
return null;
|
|
363
|
+
}
|
|
364
|
+
function C(i, s) {
|
|
365
|
+
const d = a(s);
|
|
366
|
+
return Object.keys(d).reduce((o, r) => (Object.prototype.hasOwnProperty.call(i, r) && (o[r] && L(o[r]) && L(i[r] || !i[r]) ? Object.assign(o[r], i[r] || {}) : o[r] = i[r]), o), d), d;
|
|
367
|
+
}
|
|
368
|
+
function B(i, s) {
|
|
369
|
+
return Object.keys(i).filter((o) => i[o] != null).reduce((o, r) => {
|
|
370
|
+
if (s.has(r)) {
|
|
371
|
+
const l = s.get(r);
|
|
372
|
+
if (typeof l == "string")
|
|
373
|
+
o[l] = i[r];
|
|
374
|
+
else {
|
|
375
|
+
const p = l(r, i[r], i);
|
|
376
|
+
Object.assign(o, p);
|
|
377
|
+
}
|
|
378
|
+
} else
|
|
379
|
+
o[r] = i[r];
|
|
380
|
+
return o;
|
|
381
|
+
}, {});
|
|
382
|
+
}
|
|
383
|
+
function h(i, s, d = /* @__PURE__ */ new Map()) {
|
|
384
|
+
const o = C(i, s);
|
|
385
|
+
return B(o, d);
|
|
386
|
+
}
|
|
387
|
+
function c(i) {
|
|
388
|
+
var d;
|
|
389
|
+
const s = i.type;
|
|
390
|
+
if (s) {
|
|
391
|
+
const o = e[s];
|
|
392
|
+
if (!o)
|
|
393
|
+
return i;
|
|
394
|
+
const r = C(i, o), l = ((d = i.editor) == null ? void 0 : d.type) || "";
|
|
395
|
+
if (l) {
|
|
396
|
+
const p = e[l], g = C(i.editor, p);
|
|
397
|
+
r.editor = g;
|
|
398
|
+
}
|
|
399
|
+
return r;
|
|
400
|
+
}
|
|
401
|
+
return i;
|
|
402
|
+
}
|
|
403
|
+
function f(i) {
|
|
404
|
+
n = i;
|
|
405
|
+
}
|
|
406
|
+
return { getSchemaByType: y, resolveSchemaWithDefaultValue: c, resolveSchemaToProps: h, mappingSchemaToProps: B, setDesignerContext: f };
|
|
407
|
+
}
|
|
408
|
+
const Se = {}, Pe = {}, { getSchemaByType: vt, resolveSchemaWithDefaultValue: we, resolveSchemaToProps: yt, mappingSchemaToProps: bt, setDesignerContext: Ct } = W(Se, Pe);
|
|
409
|
+
function Be(e = {}) {
|
|
410
|
+
function t(c, f, i, s) {
|
|
411
|
+
if (typeof i == "number")
|
|
412
|
+
return s[c].length === i;
|
|
413
|
+
if (typeof i == "object") {
|
|
414
|
+
const d = Object.keys(i)[0], o = i[d];
|
|
415
|
+
if (d === "not")
|
|
416
|
+
return Number(s[c].length) !== Number(o);
|
|
417
|
+
if (d === "moreThan")
|
|
418
|
+
return Number(s[c].length) >= Number(o);
|
|
419
|
+
if (d === "lessThan")
|
|
420
|
+
return Number(s[c].length) <= Number(o);
|
|
421
|
+
}
|
|
422
|
+
return !1;
|
|
423
|
+
}
|
|
424
|
+
function n(c, f, i, s) {
|
|
425
|
+
return s[c] && s[c].propertyValue && String(s[c].propertyValue.value) === String(i);
|
|
426
|
+
}
|
|
427
|
+
const a = /* @__PURE__ */ new Map([
|
|
428
|
+
["length", t],
|
|
429
|
+
["getProperty", n]
|
|
430
|
+
]);
|
|
431
|
+
Object.keys(e).reduce((c, f) => (c.set(f, e[f]), c), a);
|
|
432
|
+
function m(c, f) {
|
|
433
|
+
const i = c;
|
|
434
|
+
return typeof f == "number" ? [{ target: i, operator: "length", param: null, value: Number(f) }] : typeof f == "boolean" ? [{ target: i, operator: "getProperty", param: c, value: !!f }] : typeof f == "object" ? Object.keys(f).map((s) => {
|
|
435
|
+
if (s === "length")
|
|
436
|
+
return { target: i, operator: "length", param: null, value: f[s] };
|
|
437
|
+
const d = s, o = f[s];
|
|
438
|
+
return { target: i, operator: "getProperty", param: d, value: o };
|
|
439
|
+
}) : [];
|
|
440
|
+
}
|
|
441
|
+
function y(c) {
|
|
442
|
+
return Object.keys(c).reduce((i, s) => {
|
|
443
|
+
const d = m(s, c[s]);
|
|
444
|
+
return i.push(...d), i;
|
|
445
|
+
}, []);
|
|
446
|
+
}
|
|
447
|
+
function C(c, f) {
|
|
448
|
+
if (a.has(c.operator)) {
|
|
449
|
+
const i = a.get(c.operator);
|
|
450
|
+
return i && i(c.target, c.param, c.value, f) || !1;
|
|
451
|
+
}
|
|
452
|
+
return !1;
|
|
453
|
+
}
|
|
454
|
+
function B(c, f) {
|
|
455
|
+
return y(c).reduce((d, o) => d && C(o, f), !0);
|
|
456
|
+
}
|
|
457
|
+
function h(c, f) {
|
|
458
|
+
const i = Object.keys(c), s = i.includes("allOf"), d = i.includes("anyOf"), o = s || d, p = (o ? c[o ? s ? "allOf" : "anyOf" : "allOf"] : [c]).map((T) => B(T, f));
|
|
459
|
+
return s ? !p.includes(!1) : p.includes(!0);
|
|
460
|
+
}
|
|
461
|
+
return { parseValueSchema: h };
|
|
462
|
+
}
|
|
463
|
+
const xe = {
|
|
464
|
+
convertTo: (e, t, n, a) => {
|
|
465
|
+
e.appearance || (e.appearance = {}), e.appearance[t] = n;
|
|
466
|
+
},
|
|
467
|
+
convertFrom: (e, t, n) => e.appearance ? e.appearance[t] : e[t]
|
|
468
|
+
}, Fe = {
|
|
469
|
+
convertFrom: (e, t, n) => e.buttons && e.buttons.length ? `共 ${e.buttons.length} 项` : "无"
|
|
470
|
+
}, ke = {
|
|
471
|
+
convertTo: (e, t, n, a) => {
|
|
472
|
+
e.editor && (e.editor[t] = n);
|
|
473
|
+
},
|
|
474
|
+
convertFrom: (e, t, n) => e.editor && Object.prototype.hasOwnProperty.call(e.editor, t) ? e.editor[t] : e[t]
|
|
475
|
+
}, Ae = {
|
|
476
|
+
button: { type: "button", name: "按钮" },
|
|
477
|
+
"response-toolbar": { type: "response-toolbar", name: "工具栏" },
|
|
478
|
+
"response-toolbar-item": { type: "response-toolbar-item", name: "按钮" },
|
|
479
|
+
"content-container": { type: "content-container", name: "容器" },
|
|
480
|
+
"input-group": { type: "input-group", name: "文本" },
|
|
481
|
+
textarea: { type: "textarea", name: "多行文本" },
|
|
482
|
+
lookup: { type: "lookup", name: "帮助" },
|
|
483
|
+
"number-spinner": { type: "number-spinner", name: "数值" },
|
|
484
|
+
"date-picker": { type: "date-picker", name: "日期" },
|
|
485
|
+
switch: { type: "switch", name: "开关" },
|
|
486
|
+
"radio-group": { type: "radio-group", name: "单选组" },
|
|
487
|
+
"check-box": { type: "check-box", name: "复选框" },
|
|
488
|
+
"check-group": { type: "check-group", name: "复选框组" },
|
|
489
|
+
"combo-list": { type: "combo-list", name: "下拉列表" },
|
|
490
|
+
"response-form": { type: "response-form", name: "卡片面板" },
|
|
491
|
+
"response-layout": { type: "response-layout", name: "布局容器", icon: "response-layout-3" },
|
|
492
|
+
"response-layout-item": { type: "response-layout-item", name: "布局", icon: "response-layout-1" },
|
|
493
|
+
"tree-grid": { type: "tree-grid", name: "树表格" },
|
|
494
|
+
"tree-grid-column": { type: "tree-grid-column", name: "树表格列" },
|
|
495
|
+
"data-grid": { type: "data-grid", name: "表格" },
|
|
496
|
+
"data-grid-column": { type: "data-grid-column", name: "表格列" },
|
|
497
|
+
module: { type: "Module", name: "模块" },
|
|
498
|
+
component: { type: "component", name: "组件" },
|
|
499
|
+
tabs: { type: "tabs", name: "标签页" },
|
|
500
|
+
"tab-page": { type: "tab-page", name: "标签页项", dependentParentControl: "Tab" },
|
|
501
|
+
"tab-toolbar-item": { type: "tab-toolbar-item", name: "标签页工具栏按钮" },
|
|
502
|
+
"html-template": { type: "html-template", name: "模板容器" },
|
|
503
|
+
"time-picker": { type: "time-picker", name: "时间选择" },
|
|
504
|
+
section: { type: "section", name: "分组面板" },
|
|
505
|
+
"section-toolbar": { type: "section-toolbar", name: "分组面板工具栏" },
|
|
506
|
+
"section-toolbar-item": { type: "section-toolbar-item", name: "分组面板按钮" },
|
|
507
|
+
splitter: { type: "splitter", name: "分栏面板" },
|
|
508
|
+
"splitter-pane": { type: "splitter-pane", name: "分栏面板项", dependentParentControl: "Splitter" },
|
|
509
|
+
"component-ref": { type: "component-ref", name: "组件引用节点" },
|
|
510
|
+
uploader: { type: "uploader", name: "附件上传" },
|
|
511
|
+
"page-header": { type: "page-header", name: "页头" },
|
|
512
|
+
"page-footer": { type: "page-footer", name: "页脚" },
|
|
513
|
+
"tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏" },
|
|
514
|
+
fieldset: { type: "fieldset", name: "分组" },
|
|
515
|
+
"query-solution": { type: "query-solution", name: "筛选方案" },
|
|
516
|
+
drawer: { type: "drawer", name: "抽屉" },
|
|
517
|
+
"external-container": { type: "external-container", name: "外部容器", icon: "content-container" },
|
|
518
|
+
"list-nav": { type: "list-nav", name: "列表导航" },
|
|
519
|
+
"filter-bar": { type: "filter-bar", name: "筛选条" },
|
|
520
|
+
"language-textbox": { type: "language-textbox", name: "多语输入框" }
|
|
521
|
+
}, Ee = {
|
|
522
|
+
convertFrom: (e, t, n) => {
|
|
523
|
+
var m;
|
|
524
|
+
const a = e.editor && e.editor[t] ? e.editor[t] : e[t];
|
|
525
|
+
return ((m = Ae[a]) == null ? void 0 : m.name) || a;
|
|
526
|
+
}
|
|
527
|
+
}, Me = {
|
|
528
|
+
convertTo: (e, t, n, a) => {
|
|
529
|
+
e[t] = e[t];
|
|
530
|
+
},
|
|
531
|
+
convertFrom: (e, t, n) => e.editor ? n.getRealEditorType(e.editor.type) : ""
|
|
532
|
+
}, Oe = {
|
|
533
|
+
convertTo: (e, t, n, a) => {
|
|
534
|
+
e.type === "data-grid-column" && (e.formatter ? e.formatter[t] = n : e.formatter = {
|
|
535
|
+
[t]: n
|
|
536
|
+
});
|
|
537
|
+
},
|
|
538
|
+
convertFrom: (e, t, n) => {
|
|
539
|
+
if (e.formatter) {
|
|
540
|
+
if (t === "trueText")
|
|
541
|
+
return e.formatter.trueText;
|
|
542
|
+
if (t === "falseText")
|
|
543
|
+
return e.formatter.falseText;
|
|
544
|
+
if (t === "prefix")
|
|
545
|
+
return e.formatter.prefix;
|
|
546
|
+
if (t === "suffix")
|
|
547
|
+
return e.formatter.suffix;
|
|
548
|
+
if (t === "precision")
|
|
549
|
+
return e.formatter.precision;
|
|
550
|
+
if (t === "decimal")
|
|
551
|
+
return e.formatter.decimal;
|
|
552
|
+
if (t === "thousand")
|
|
553
|
+
return e.formatter.thousand;
|
|
554
|
+
if (t === "dateFormat")
|
|
555
|
+
return e.formatter.dateFormat;
|
|
556
|
+
if (t === "customFormat")
|
|
557
|
+
return e.formatter.customFormat;
|
|
558
|
+
}
|
|
559
|
+
return e.formatter.type ? n.getRealEditorType(e.formatter.type) : e.formatter.data ? n.getRealEditorType(e.formatter.data) : "";
|
|
560
|
+
}
|
|
561
|
+
}, $e = {
|
|
562
|
+
convertTo: (e, t, n, a) => {
|
|
563
|
+
e.command ? e.command[t] = n : e.command = {
|
|
564
|
+
[t]: n
|
|
565
|
+
}, t === "enable" && n && (e.command.commands || (e.command.commands = [
|
|
566
|
+
{
|
|
567
|
+
text: "编辑",
|
|
568
|
+
type: "primary",
|
|
569
|
+
command: "edit"
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
text: "删除",
|
|
573
|
+
type: "danger",
|
|
574
|
+
command: "remove"
|
|
575
|
+
}
|
|
576
|
+
]));
|
|
577
|
+
},
|
|
578
|
+
convertFrom: (e, t, n) => e.command && t === "enable" ? e.command.enable : ""
|
|
579
|
+
}, Ne = {
|
|
580
|
+
convertTo: (e, t, n, a) => {
|
|
581
|
+
e.column ? e.column[t] = n : e.column = {
|
|
582
|
+
[t]: n
|
|
583
|
+
}, t === "fitColumns" && n && (e.column.fitMode || (e.column.fitMode = "average"));
|
|
584
|
+
},
|
|
585
|
+
convertFrom: (e, t, n) => {
|
|
586
|
+
if (e.column) {
|
|
587
|
+
if (t === "fitColumns")
|
|
588
|
+
return e.column.fitColumns;
|
|
589
|
+
if (t === "fitMode")
|
|
590
|
+
return e.column.fitMode;
|
|
591
|
+
}
|
|
592
|
+
return "";
|
|
593
|
+
}
|
|
594
|
+
}, Ve = {
|
|
595
|
+
convertTo: (e, t, n, a) => {
|
|
596
|
+
e.summary ? e.summary[t] = n : e.summary = {
|
|
597
|
+
[t]: n
|
|
598
|
+
}, t === "enable" && n && (e.summary ? e.summary.groupFields || (e.summary.groupFields = []) : e.summary = {
|
|
599
|
+
enable: n,
|
|
600
|
+
groupFields: []
|
|
601
|
+
});
|
|
602
|
+
},
|
|
603
|
+
convertFrom: (e, t, n) => e.summary && t === "enable" ? e.summary.enable : e.type === "data-grid-column" ? e.enableSummary === void 0 ? !1 : e.enableSummary : ""
|
|
604
|
+
}, je = {
|
|
605
|
+
convertFrom: (e, t) => e.binding ? e.binding.path : "",
|
|
606
|
+
convertTo: (e, t, n) => {
|
|
607
|
+
if (n && n.length > 0) {
|
|
608
|
+
const a = n[0];
|
|
609
|
+
e.binding || (e.binding = {}), e.binding.type = "Form", e.binding.path = a.bindingField, e.binding.field = a.id, e.binding.fullPath = a.path, e.path = a.bindingPath;
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
}, De = {
|
|
613
|
+
convertTo: (e, t, n, a) => {
|
|
614
|
+
e.pagination || (e.pagination = {}), e.pagination[t] = n;
|
|
615
|
+
},
|
|
616
|
+
convertFrom: (e, t, n) => e.pagination ? e.pagination[t] : e[t]
|
|
617
|
+
}, Ie = {
|
|
618
|
+
convertTo: (e, t, n, a) => {
|
|
619
|
+
e.rowNumber || (e.rowNumber = {}), e.rowNumber[t] = n;
|
|
620
|
+
},
|
|
621
|
+
convertFrom: (e, t, n) => e.rowNumber ? e.rowNumber[t] : e[t]
|
|
622
|
+
}, Re = {
|
|
623
|
+
convertTo: (e, t, n, a) => {
|
|
624
|
+
e.selection || (e.selection = {}), e.selection[t] = n;
|
|
625
|
+
},
|
|
626
|
+
convertFrom: (e, t, n) => e.selection ? e.selection[t] : e[t]
|
|
627
|
+
}, Ze = {
|
|
628
|
+
convertFrom: (e, t, n) => e[t] && e[t].length ? `共 ${e[t].length} 项` : ""
|
|
629
|
+
}, Ge = {
|
|
630
|
+
convertFrom: (e, t) => e[t] || "",
|
|
631
|
+
convertTo: (e, t, n) => {
|
|
632
|
+
e[t] = n;
|
|
633
|
+
}
|
|
634
|
+
}, He = {
|
|
635
|
+
convertTo: (e, t, n, a) => {
|
|
636
|
+
e.size || (e.size = {}), e.size[t] = n;
|
|
637
|
+
},
|
|
638
|
+
convertFrom: (e, t, n) => e.size ? e.size[t] : e[t]
|
|
639
|
+
}, Le = {
|
|
640
|
+
convertFrom: (e, t, n) => {
|
|
641
|
+
var a, m;
|
|
642
|
+
return (a = e.formatter) != null && a.data && t === "formatterEnumData" && !e.formatterEnumData ? (m = e.formatter) == null ? void 0 : m.data : e.formatterEnumData;
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
function _(e, t, n) {
|
|
646
|
+
const a = /* @__PURE__ */ new Map([
|
|
647
|
+
["/converter/appearance.converter", xe],
|
|
648
|
+
["/converter/buttons.converter", Fe],
|
|
649
|
+
["/converter/property-editor.converter", ke],
|
|
650
|
+
["/converter/items-count.converter", Ze],
|
|
651
|
+
["/converter/type.converter", Ee],
|
|
652
|
+
["/converter/change-editor.converter", Me],
|
|
653
|
+
["/converter/change-formatter.converter", Oe],
|
|
654
|
+
["/converter/column-command.converter", $e],
|
|
655
|
+
["/converter/column-option.converter", Ne],
|
|
656
|
+
["/converter/summary.converter", Ve],
|
|
657
|
+
["/converter/form-group-label.converter", Ge],
|
|
658
|
+
["/converter/field-selector.converter", je],
|
|
659
|
+
["/converter/pagination.converter", De],
|
|
660
|
+
["/converter/row-number.converter", Ie],
|
|
661
|
+
["/converter/grid-selection.converter", Re],
|
|
662
|
+
["/converter/size.converter", He],
|
|
663
|
+
["/converter/change-formatter-enum.converter", Le]
|
|
664
|
+
]), m = /* @__PURE__ */ new Map([
|
|
665
|
+
["string", { type: "input-group", enableClear: !1 }],
|
|
666
|
+
["boolean", {
|
|
667
|
+
type: "combo-list",
|
|
668
|
+
textField: "name",
|
|
669
|
+
valueField: "value",
|
|
670
|
+
idField: "value",
|
|
671
|
+
enableClear: !1,
|
|
672
|
+
editable: !1,
|
|
673
|
+
data: [
|
|
674
|
+
{
|
|
675
|
+
value: !0,
|
|
676
|
+
name: "是"
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
value: !1,
|
|
680
|
+
name: "否"
|
|
681
|
+
}
|
|
682
|
+
]
|
|
683
|
+
}],
|
|
684
|
+
["enum", { type: "combo-list", maxHeight: 128, enableClear: !1, editable: !1 }],
|
|
685
|
+
["array", { type: "button-edit" }],
|
|
686
|
+
["number", { type: "number-spinner", placeholder: "" }],
|
|
687
|
+
["events-editor", { type: "events-editor", hide: !0 }]
|
|
688
|
+
]), y = Be();
|
|
689
|
+
function C(o, r) {
|
|
690
|
+
return () => y.parseValueSchema(o, r);
|
|
691
|
+
}
|
|
692
|
+
function B(o, r, l) {
|
|
693
|
+
return o.includes("visible") && r.visible !== void 0 ? typeof r.visible == "boolean" ? () => !!r.visible : r.visible === void 0 ? !0 : C(r.visible, l) : () => !0;
|
|
694
|
+
}
|
|
695
|
+
function h(o, r, l) {
|
|
696
|
+
return o.includes("readonly") && r.readonly !== void 0 ? typeof r.readonly == "boolean" ? () => !!r.readonly : C(r.readonly, l) : () => !1;
|
|
697
|
+
}
|
|
698
|
+
function c(o, r) {
|
|
699
|
+
const l = o.$converter || r;
|
|
700
|
+
return typeof l == "string" && l && a.has(l) ? a.get(l) || null : l || null;
|
|
701
|
+
}
|
|
702
|
+
function f(o, r, l, p, g, T = "", S = "") {
|
|
703
|
+
return Object.keys(o).map((b) => {
|
|
704
|
+
const v = E(1), x = b, u = o[b], w = Object.keys(u), V = u.title, O = u.type, $ = m.get(O) || { type: "input-group", enableClear: !1 }, A = u.editor ? Object.assign({}, $, u.editor) : Object.assign({}, $), I = B(w, u, r), j = h(w, u, r);
|
|
705
|
+
A.readonly = A.readonly === void 0 ? j() : A.readonly;
|
|
706
|
+
const R = u.type === "cascade" ? f(u.properties, r, l, p, g, T, S) : [], U = !0;
|
|
707
|
+
let F = c(u, S);
|
|
708
|
+
const X = M({
|
|
709
|
+
get() {
|
|
710
|
+
if (v.value) {
|
|
711
|
+
if (["class", "style"].find((te) => te === x) && !F && (F = a.get("/converter/appearance.converter") || null), F && F.convertFrom)
|
|
712
|
+
return F.convertFrom(l, b, g, T);
|
|
713
|
+
const k = l[b];
|
|
714
|
+
return Object.prototype.hasOwnProperty.call(u, "defaultValue") && (k === void 0 || typeof k == "string" && k === "") ? u.type === "boolean" ? u.defaultValue : u.defaultValue || "" : k;
|
|
715
|
+
}
|
|
716
|
+
return null;
|
|
717
|
+
},
|
|
718
|
+
set(k) {
|
|
719
|
+
v.value += 1, F && F.convertTo ? (F.convertTo(p, b, k, g, T), F.convertTo(l, b, k, g, T)) : (p[b] = k, l[b] = k);
|
|
720
|
+
}
|
|
721
|
+
}), { refreshPanelAfterChanged: Q, description: Y, isExpand: K, parentPropertyID: ee } = u, Z = { propertyID: x, propertyName: V, propertyType: O, propertyValue: X, editor: A, visible: I, readonly: j, cascadeConfig: R, hideCascadeTitle: U, refreshPanelAfterChanged: Q, description: Y, isExpand: K, parentPropertyID: ee };
|
|
722
|
+
return r[x] = Z, Z;
|
|
723
|
+
});
|
|
724
|
+
}
|
|
725
|
+
function i(o, r, l = {}) {
|
|
726
|
+
const p = {}, g = e[o];
|
|
727
|
+
return g && g.categories ? Object.keys(g.categories).map((S) => {
|
|
728
|
+
const P = g.categories[S], b = P == null ? void 0 : P.title, v = f(P.properties || {}, p, {}, l, r);
|
|
729
|
+
return { categoryId: S, categoryName: b, properties: v };
|
|
730
|
+
}) : [];
|
|
731
|
+
}
|
|
732
|
+
function s(o, r, l, p, g = "") {
|
|
733
|
+
const T = r.$ref.schema, S = r.$ref.converter, P = l[T], b = P.type, v = n(P), x = {}, u = e[b];
|
|
734
|
+
if (u && u.categories) {
|
|
735
|
+
const w = u.categories[o], V = w == null ? void 0 : w.title;
|
|
736
|
+
S && Object.keys(w.properties).forEach((A) => {
|
|
737
|
+
w.properties[A].$converter = S;
|
|
738
|
+
});
|
|
739
|
+
const O = (w == null ? void 0 : w.properties) || {}, $ = f(O, x, v, P, p, g);
|
|
740
|
+
return { categoryId: o, categoryName: V, properties: $ };
|
|
741
|
+
}
|
|
742
|
+
return { categoryId: o, categoryName: "", properties: [] };
|
|
743
|
+
}
|
|
744
|
+
function d(o, r, l, p, g) {
|
|
745
|
+
const T = o.type, S = n(o), P = {};
|
|
746
|
+
let b = g || e[T];
|
|
747
|
+
if (b && Object.keys(b).length === 0 && l && l.getPropConfig && (b = l.getPropConfig(p)), b && b.categories) {
|
|
748
|
+
const v = [];
|
|
749
|
+
return Object.keys(b.categories).map((x) => {
|
|
750
|
+
const u = b.categories[x];
|
|
751
|
+
if (u.$ref) {
|
|
752
|
+
v.push(s(x, u, o, r, p));
|
|
753
|
+
return;
|
|
754
|
+
}
|
|
755
|
+
const w = u == null ? void 0 : u.title, V = u == null ? void 0 : u.tabId, O = u == null ? void 0 : u.tabName, $ = u == null ? void 0 : u.hide, A = u == null ? void 0 : u.hideTitle, I = f(u.properties || {}, P, S, o, r, p, u.$converter), { setPropertyRelates: j } = u, R = u == null ? void 0 : u.parentPropertyID;
|
|
756
|
+
v.push({ categoryId: x, categoryName: w, tabId: V, tabName: O, hide: $, properties: I, hideTitle: A, setPropertyRelates: j, parentPropertyID: R });
|
|
757
|
+
}), v;
|
|
758
|
+
}
|
|
759
|
+
return [];
|
|
760
|
+
}
|
|
761
|
+
return {
|
|
762
|
+
getPropertyConfigBySchema: d,
|
|
763
|
+
getPropertyConfigByType: i,
|
|
764
|
+
propertyConverterMap: a
|
|
765
|
+
};
|
|
766
|
+
}
|
|
767
|
+
const ze = {}, qe = {};
|
|
768
|
+
_(ze, qe, we);
|
|
769
|
+
const We = {}, _e = {}, { getSchemaByType: Tt, resolveSchemaWithDefaultValue: Je, resolveSchemaToProps: ht, mappingSchemaToProps: St, setDesignerContext: Pt } = W(We, _e), Ue = {}, Xe = {};
|
|
770
|
+
_(Ue, Xe, Je);
|
|
771
|
+
function Qe(e, t) {
|
|
772
|
+
return { customClass: t.class, customStyle: t.style };
|
|
773
|
+
}
|
|
774
|
+
const Ye = /* @__PURE__ */ new Map([
|
|
775
|
+
["appearance", Qe]
|
|
776
|
+
]);
|
|
777
|
+
function Ke(e, t, n) {
|
|
778
|
+
return t;
|
|
779
|
+
}
|
|
780
|
+
const et = "https://json-schema.org/draft/2020-12/schema", tt = "https://farris-design.gitee.io/input-group.schema.json", nt = "input-group", ot = "A Farris Input Component", rt = "object", it = {
|
|
781
|
+
id: {
|
|
782
|
+
description: "The unique identifier for a Input Group",
|
|
783
|
+
type: "string"
|
|
784
|
+
},
|
|
785
|
+
type: {
|
|
786
|
+
description: "The type string of Input Group component",
|
|
787
|
+
type: "string",
|
|
788
|
+
default: "input-group"
|
|
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
|
+
binding: {
|
|
804
|
+
description: "",
|
|
805
|
+
type: "object",
|
|
806
|
+
default: {}
|
|
807
|
+
},
|
|
808
|
+
formatValidation: {
|
|
809
|
+
description: "",
|
|
810
|
+
type: "object",
|
|
811
|
+
default: {}
|
|
812
|
+
},
|
|
813
|
+
editable: {
|
|
814
|
+
description: "",
|
|
815
|
+
type: "boolean",
|
|
816
|
+
default: !0
|
|
817
|
+
},
|
|
818
|
+
enableLinkLabel: {
|
|
819
|
+
description: "",
|
|
820
|
+
type: "boolean",
|
|
821
|
+
default: !1
|
|
822
|
+
},
|
|
823
|
+
label: {
|
|
824
|
+
description: "",
|
|
825
|
+
type: "string",
|
|
826
|
+
default: ""
|
|
827
|
+
},
|
|
828
|
+
labelWidth: {
|
|
829
|
+
description: "",
|
|
830
|
+
type: "number"
|
|
831
|
+
},
|
|
832
|
+
placeholder: {
|
|
833
|
+
description: "",
|
|
834
|
+
type: "string",
|
|
835
|
+
default: ""
|
|
836
|
+
},
|
|
837
|
+
readonly: {
|
|
838
|
+
description: "",
|
|
839
|
+
type: "boolean",
|
|
840
|
+
default: !1
|
|
841
|
+
},
|
|
842
|
+
disabled: {
|
|
843
|
+
description: "",
|
|
844
|
+
type: "boolean",
|
|
845
|
+
default: !1
|
|
846
|
+
},
|
|
847
|
+
required: {
|
|
848
|
+
description: "",
|
|
849
|
+
type: "boolean",
|
|
850
|
+
default: !1
|
|
851
|
+
},
|
|
852
|
+
tabIndex: {
|
|
853
|
+
description: "",
|
|
854
|
+
type: "number",
|
|
855
|
+
default: -1
|
|
856
|
+
},
|
|
857
|
+
maxLength: {
|
|
858
|
+
description: "",
|
|
859
|
+
type: "number",
|
|
860
|
+
default: ""
|
|
861
|
+
},
|
|
862
|
+
textAlign: {
|
|
863
|
+
description: "",
|
|
864
|
+
type: "enum",
|
|
865
|
+
enum: [
|
|
866
|
+
"left",
|
|
867
|
+
"middle",
|
|
868
|
+
"right"
|
|
869
|
+
],
|
|
870
|
+
default: "left"
|
|
871
|
+
},
|
|
872
|
+
visible: {
|
|
873
|
+
description: "",
|
|
874
|
+
type: "boolean",
|
|
875
|
+
default: !0
|
|
876
|
+
},
|
|
877
|
+
onBlur: {
|
|
878
|
+
description: "",
|
|
879
|
+
type: "string",
|
|
880
|
+
default: ""
|
|
881
|
+
},
|
|
882
|
+
onClickLinkLabel: {
|
|
883
|
+
description: "",
|
|
884
|
+
type: "sting",
|
|
885
|
+
default: ""
|
|
886
|
+
},
|
|
887
|
+
addonDisabled: {
|
|
888
|
+
description: "",
|
|
889
|
+
type: "boolean",
|
|
890
|
+
default: !1
|
|
891
|
+
},
|
|
892
|
+
addonContent: {
|
|
893
|
+
description: "",
|
|
894
|
+
type: "string",
|
|
895
|
+
default: ""
|
|
896
|
+
},
|
|
897
|
+
autoHeight: {
|
|
898
|
+
description: "",
|
|
899
|
+
type: "boolean",
|
|
900
|
+
default: !1
|
|
901
|
+
},
|
|
902
|
+
enableAddon: {
|
|
903
|
+
description: "",
|
|
904
|
+
type: "boolean",
|
|
905
|
+
default: !1
|
|
906
|
+
},
|
|
907
|
+
addonType: {
|
|
908
|
+
description: "",
|
|
909
|
+
type: "string",
|
|
910
|
+
enum: [
|
|
911
|
+
"button",
|
|
912
|
+
"static"
|
|
913
|
+
],
|
|
914
|
+
default: "button"
|
|
915
|
+
},
|
|
916
|
+
enableClear: {
|
|
917
|
+
description: "",
|
|
918
|
+
type: "boolean",
|
|
919
|
+
default: !0
|
|
920
|
+
},
|
|
921
|
+
enableViewPassword: {
|
|
922
|
+
description: "",
|
|
923
|
+
type: "boolean",
|
|
924
|
+
default: !1
|
|
925
|
+
},
|
|
926
|
+
inputType: {
|
|
927
|
+
description: "",
|
|
928
|
+
type: "string",
|
|
929
|
+
enum: [
|
|
930
|
+
"input",
|
|
931
|
+
"password",
|
|
932
|
+
"text"
|
|
933
|
+
],
|
|
934
|
+
default: "input"
|
|
935
|
+
},
|
|
936
|
+
maxHeight: {
|
|
937
|
+
description: "",
|
|
938
|
+
type: "number",
|
|
939
|
+
default: 500
|
|
940
|
+
},
|
|
941
|
+
popUp: {
|
|
942
|
+
description: "",
|
|
943
|
+
type: "object",
|
|
944
|
+
properties: {
|
|
945
|
+
footerButtons: {
|
|
946
|
+
type: "array",
|
|
947
|
+
default: []
|
|
948
|
+
},
|
|
949
|
+
height: {
|
|
950
|
+
type: "number",
|
|
951
|
+
default: 600
|
|
952
|
+
},
|
|
953
|
+
dataMapping: {
|
|
954
|
+
type: "object"
|
|
955
|
+
},
|
|
956
|
+
contents: {
|
|
957
|
+
type: "array",
|
|
958
|
+
default: []
|
|
959
|
+
},
|
|
960
|
+
showMaxButton: {
|
|
961
|
+
type: "boolean",
|
|
962
|
+
default: !0
|
|
963
|
+
},
|
|
964
|
+
showCloseButton: {
|
|
965
|
+
type: "boolean",
|
|
966
|
+
default: !0
|
|
967
|
+
},
|
|
968
|
+
showFooter: {
|
|
969
|
+
type: "boolean",
|
|
970
|
+
default: !0
|
|
971
|
+
},
|
|
972
|
+
title: {
|
|
973
|
+
type: "string",
|
|
974
|
+
default: ""
|
|
975
|
+
},
|
|
976
|
+
width: {
|
|
977
|
+
type: "number",
|
|
978
|
+
default: 800
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
},
|
|
982
|
+
groupText: {
|
|
983
|
+
description: "",
|
|
984
|
+
type: "string",
|
|
985
|
+
default: ""
|
|
986
|
+
},
|
|
987
|
+
onClickHandle: {
|
|
988
|
+
description: "",
|
|
989
|
+
type: "string",
|
|
990
|
+
default: ""
|
|
991
|
+
},
|
|
992
|
+
showButtonWhenDisabled: {
|
|
993
|
+
description: "",
|
|
994
|
+
type: "boolean",
|
|
995
|
+
default: !1
|
|
996
|
+
},
|
|
997
|
+
onClear: {
|
|
998
|
+
description: "",
|
|
999
|
+
type: "string",
|
|
1000
|
+
default: ""
|
|
1001
|
+
},
|
|
1002
|
+
updateOn: {
|
|
1003
|
+
description: "",
|
|
1004
|
+
type: "string",
|
|
1005
|
+
default: "blur"
|
|
1006
|
+
}
|
|
1007
|
+
}, at = [
|
|
1008
|
+
"type"
|
|
1009
|
+
], st = [
|
|
1010
|
+
"id",
|
|
1011
|
+
"appearance",
|
|
1012
|
+
"binding",
|
|
1013
|
+
"visible"
|
|
1014
|
+
], lt = {
|
|
1015
|
+
$schema: et,
|
|
1016
|
+
$id: tt,
|
|
1017
|
+
title: nt,
|
|
1018
|
+
description: ot,
|
|
1019
|
+
type: rt,
|
|
1020
|
+
properties: it,
|
|
1021
|
+
required: at,
|
|
1022
|
+
ignore: st
|
|
1023
|
+
}, J = ie(se, lt, Ye, Ke);
|
|
1024
|
+
D.register = (e, t, n, a) => {
|
|
1025
|
+
e["input-group"] = ae, t["input-group"] = J;
|
|
1026
|
+
};
|
|
1027
|
+
D.registerDesigner = (e, t, n) => {
|
|
1028
|
+
e["input-group"] = D, t["input-group"] = J;
|
|
1029
|
+
};
|
|
1030
|
+
const wt = re(D);
|
|
1031
|
+
export {
|
|
1032
|
+
D as FInputGroupDesgin,
|
|
1033
|
+
wt as default,
|
|
1034
|
+
J as propsResolver
|
|
1035
|
+
};
|