element-less 0.0.62 → 0.0.64
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/custom/dynamic/common/globalData.d.ts +22 -0
- package/custom/dynamic/common/index.d.ts +1 -0
- package/custom/dynamic/designer/index.d.ts +14 -0
- package/custom/dynamic/designer/src/designer.d.ts +2 -0
- package/custom/dynamic/designer/src/designer.vue.d.ts +6 -0
- package/custom/dynamic/designerView/index.d.ts +4 -4
- package/custom/dynamic/designerView/src/designerView.vue.d.ts +1 -1
- package/element-less.cjs +1 -1
- package/element-less.iife.js +1 -1
- package/element-less.js +1 -1
- package/element-less.umd.cjs +1 -1
- package/elementui/table/index.d.ts +2 -2
- package/index-CsOCAv7a.cjs +1 -0
- package/{index-7c_sNy4-.js → index-Di5T-zru.js} +198 -137
- package/{inner-C31N0q7a.cjs → inner-C35RCXsr.cjs} +1 -1
- package/{inner-DmSBxfiK.js → inner-nnaazUsy.js} +1 -1
- package/{innerItem-D_eodwMh.js → innerItem-D1oz0Pwd.js} +1 -1
- package/{innerItem-bEGX2tCW.cjs → innerItem-LVsDJub0.cjs} +1 -1
- package/{mode-csharp-CnDEE-pK.cjs → mode-csharp-DqowUjK_.cjs} +1 -1
- package/{mode-csharp-DXxph2IU.js → mode-csharp-TD-end5_.js} +1 -1
- package/{mode-css-DNuBwejm.js → mode-css-CnFBC9Mu.js} +1 -1
- package/{mode-css-j7HHImub.cjs → mode-css-DxAogqVp.cjs} +1 -1
- package/{mode-javascript-CgNYP0ZB.js → mode-javascript-1AtGW_3r.js} +1 -1
- package/{mode-javascript-DxX91KUa.cjs → mode-javascript-KoZ4u3j0.cjs} +1 -1
- package/{mode-json-32M0ddEq.cjs → mode-json-BlZksyed.cjs} +1 -1
- package/{mode-json-CmVf14v7.js → mode-json-Dkoq09Q_.js} +1 -1
- package/{mode-mysql-o4sFpIoi.cjs → mode-mysql-Ce48wOMA.cjs} +1 -1
- package/{mode-mysql-CQl5Sngg.js → mode-mysql-Dl5f54zl.js} +1 -1
- package/package.json +1 -1
- package/style.css +1 -1
- package/index-C-T0hYe_.cjs +0 -1
|
@@ -14868,7 +14868,7 @@ function inputRulesPlugin(props2) {
|
|
|
14868
14868
|
function getType(value) {
|
|
14869
14869
|
return Object.prototype.toString.call(value).slice(8, -1);
|
|
14870
14870
|
}
|
|
14871
|
-
function isPlainObject$
|
|
14871
|
+
function isPlainObject$2(value) {
|
|
14872
14872
|
if (getType(value) !== "Object") {
|
|
14873
14873
|
return false;
|
|
14874
14874
|
}
|
|
@@ -14876,9 +14876,9 @@ function isPlainObject$1(value) {
|
|
|
14876
14876
|
}
|
|
14877
14877
|
function mergeDeep(target, source) {
|
|
14878
14878
|
const output = { ...target };
|
|
14879
|
-
if (isPlainObject$
|
|
14879
|
+
if (isPlainObject$2(target) && isPlainObject$2(source)) {
|
|
14880
14880
|
Object.keys(source).forEach((key) => {
|
|
14881
|
-
if (isPlainObject$
|
|
14881
|
+
if (isPlainObject$2(source[key]) && isPlainObject$2(target[key])) {
|
|
14882
14882
|
output[key] = mergeDeep(target[key], source[key]);
|
|
14883
14883
|
} else {
|
|
14884
14884
|
output[key] = source[key];
|
|
@@ -26451,7 +26451,7 @@ var funcProto = Function.prototype, objectProto = Object.prototype;
|
|
|
26451
26451
|
var funcToString = funcProto.toString;
|
|
26452
26452
|
var hasOwnProperty$1 = objectProto.hasOwnProperty;
|
|
26453
26453
|
var objectCtorString = funcToString.call(Object);
|
|
26454
|
-
function isPlainObject(value) {
|
|
26454
|
+
function isPlainObject$1(value) {
|
|
26455
26455
|
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
|
|
26456
26456
|
return false;
|
|
26457
26457
|
}
|
|
@@ -26705,7 +26705,7 @@ const withPropsDefaultsSetter = (target) => {
|
|
|
26705
26705
|
for (const [key, value] of Object.entries(defaults2)) {
|
|
26706
26706
|
const prop = props2[key];
|
|
26707
26707
|
if (!hasOwn(props2, key)) continue;
|
|
26708
|
-
if (isPlainObject(prop)) {
|
|
26708
|
+
if (isPlainObject$1(prop)) {
|
|
26709
26709
|
props2[key] = {
|
|
26710
26710
|
...prop,
|
|
26711
26711
|
default: value
|
|
@@ -32488,6 +32488,109 @@ function useTree(props2 = {}, dataTree, defaultEmits, componentName) {
|
|
|
32488
32488
|
onNodeCollapse
|
|
32489
32489
|
};
|
|
32490
32490
|
}
|
|
32491
|
+
function isPlainObject(value) {
|
|
32492
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
32493
|
+
}
|
|
32494
|
+
function normalizeGlobalDataType(type) {
|
|
32495
|
+
const currType = String(type || "string").toLowerCase();
|
|
32496
|
+
if (currType === "number") return "Number";
|
|
32497
|
+
if (currType === "bool" || currType === "boolean") return "Bool";
|
|
32498
|
+
if (currType === "array") return "Array";
|
|
32499
|
+
if (currType === "object") return "Object";
|
|
32500
|
+
return "String";
|
|
32501
|
+
}
|
|
32502
|
+
function createFieldOption(label, fieldCode, dataTypeName, group) {
|
|
32503
|
+
if (!fieldCode) return null;
|
|
32504
|
+
return {
|
|
32505
|
+
type: "field",
|
|
32506
|
+
value: `globalData:${fieldCode}`,
|
|
32507
|
+
label,
|
|
32508
|
+
keyCode: fieldCode,
|
|
32509
|
+
keyName: label,
|
|
32510
|
+
sub: fieldCode,
|
|
32511
|
+
dataTypeName,
|
|
32512
|
+
nodeSource: "globalData",
|
|
32513
|
+
fieldCode,
|
|
32514
|
+
group,
|
|
32515
|
+
componentType: "",
|
|
32516
|
+
componentOptions: null
|
|
32517
|
+
};
|
|
32518
|
+
}
|
|
32519
|
+
function createContainerOption(label, fieldCode, group, children) {
|
|
32520
|
+
if (!fieldCode) return null;
|
|
32521
|
+
return {
|
|
32522
|
+
type: "container",
|
|
32523
|
+
value: `globalData:${fieldCode}`,
|
|
32524
|
+
label,
|
|
32525
|
+
keyCode: fieldCode,
|
|
32526
|
+
keyName: label,
|
|
32527
|
+
sub: fieldCode,
|
|
32528
|
+
dataTypeName: "Object",
|
|
32529
|
+
nodeSource: "globalData",
|
|
32530
|
+
fieldCode,
|
|
32531
|
+
group,
|
|
32532
|
+
children,
|
|
32533
|
+
componentType: "",
|
|
32534
|
+
componentOptions: null
|
|
32535
|
+
};
|
|
32536
|
+
}
|
|
32537
|
+
function withPrefix(prefix, key) {
|
|
32538
|
+
return prefix ? `${prefix}.${key}` : key;
|
|
32539
|
+
}
|
|
32540
|
+
function parseGlobalDataFields(schema2, prefix = "", group = "全局数据") {
|
|
32541
|
+
if (!isPlainObject(schema2)) return [];
|
|
32542
|
+
return Object.entries(schema2).flatMap(([label, value]) => {
|
|
32543
|
+
if (typeof value === "string") {
|
|
32544
|
+
const fieldCode = withPrefix(prefix, value);
|
|
32545
|
+
const field = createFieldOption(label, fieldCode, "String", group);
|
|
32546
|
+
return field ? [field] : [];
|
|
32547
|
+
}
|
|
32548
|
+
if (!isPlainObject(value)) return [];
|
|
32549
|
+
if (typeof value.name === "string") {
|
|
32550
|
+
const fieldCode = withPrefix(prefix, value.name);
|
|
32551
|
+
const field = createFieldOption(label, fieldCode, normalizeGlobalDataType(value.type), group);
|
|
32552
|
+
return field ? [field] : [];
|
|
32553
|
+
}
|
|
32554
|
+
return Object.entries(value).flatMap(([objectKey, childrenSchema]) => {
|
|
32555
|
+
const fieldCode = withPrefix(prefix, objectKey);
|
|
32556
|
+
const children = parseGlobalDataFields(childrenSchema, fieldCode, fieldCode);
|
|
32557
|
+
const container = createContainerOption(label, fieldCode, group, children);
|
|
32558
|
+
return container ? [container] : [];
|
|
32559
|
+
});
|
|
32560
|
+
});
|
|
32561
|
+
}
|
|
32562
|
+
function flattenGlobalDataFields(options2, includeContainers = false) {
|
|
32563
|
+
return options2.flatMap((option) => {
|
|
32564
|
+
const children = option.children ? flattenGlobalDataFields(option.children, includeContainers) : [];
|
|
32565
|
+
if (option.type === "container") {
|
|
32566
|
+
return includeContainers ? [option, ...children] : children;
|
|
32567
|
+
}
|
|
32568
|
+
return [option, ...children];
|
|
32569
|
+
});
|
|
32570
|
+
}
|
|
32571
|
+
function getGlobalDataFieldKeys(schema2) {
|
|
32572
|
+
return flattenGlobalDataFields(parseGlobalDataFields(schema2), true).map((item) => item.fieldCode);
|
|
32573
|
+
}
|
|
32574
|
+
function filterGlobalDataFields(options2, query) {
|
|
32575
|
+
const q = query.trim().toLowerCase();
|
|
32576
|
+
if (!q) return options2;
|
|
32577
|
+
return options2.reduce((result, option) => {
|
|
32578
|
+
const match = [option.label, option.keyName, option.keyCode, option.sub, option.fieldCode].some((text) => String(text || "").toLowerCase().includes(q));
|
|
32579
|
+
if (option.type === "container") {
|
|
32580
|
+
const children = option.children || [];
|
|
32581
|
+
const filteredChildren = filterGlobalDataFields(children, query);
|
|
32582
|
+
if (match || filteredChildren.length) {
|
|
32583
|
+
result.push({
|
|
32584
|
+
...option,
|
|
32585
|
+
children: match ? children : filteredChildren
|
|
32586
|
+
});
|
|
32587
|
+
}
|
|
32588
|
+
return result;
|
|
32589
|
+
}
|
|
32590
|
+
if (match) result.push(option);
|
|
32591
|
+
return result;
|
|
32592
|
+
}, []);
|
|
32593
|
+
}
|
|
32491
32594
|
const _hoisted_1$1q = { class: "fp-panel" };
|
|
32492
32595
|
const _hoisted_2$z = { class: "fp-search" };
|
|
32493
32596
|
const _hoisted_3$q = ["onClick"];
|
|
@@ -32635,45 +32738,9 @@ const _sfc_main$2p = /* @__PURE__ */ defineComponent({
|
|
|
32635
32738
|
componentOptions: f.componentOptions || null
|
|
32636
32739
|
}));
|
|
32637
32740
|
});
|
|
32638
|
-
function inferType(v) {
|
|
32639
|
-
if (Array.isArray(v)) return "Array";
|
|
32640
|
-
if (v === true || v === false) return "Bool";
|
|
32641
|
-
if (typeof v === "number") return "Number";
|
|
32642
|
-
if (v !== null && typeof v === "object") return "Object";
|
|
32643
|
-
return "String";
|
|
32644
|
-
}
|
|
32645
|
-
function buildGdTree(obj2, prefix, q) {
|
|
32646
|
-
if (!obj2 || typeof obj2 !== "object" || Array.isArray(obj2)) return [];
|
|
32647
|
-
return Object.entries(obj2).reduce((acc, [key, value]) => {
|
|
32648
|
-
const path = prefix ? `${prefix}.${key}` : key;
|
|
32649
|
-
const dataTypeName = inferType(value);
|
|
32650
|
-
const labelMatch = !q || key.toLowerCase().includes(q);
|
|
32651
|
-
const pathMatch = !q || path.toLowerCase().includes(q);
|
|
32652
|
-
if (dataTypeName === "Object" && value && !Array.isArray(value)) {
|
|
32653
|
-
const children = buildGdTree(value, path, q);
|
|
32654
|
-
if (children.length || labelMatch || pathMatch) {
|
|
32655
|
-
acc.push({ type: "container", keyCode: path, keyName: key, children });
|
|
32656
|
-
}
|
|
32657
|
-
} else {
|
|
32658
|
-
if (labelMatch || pathMatch) {
|
|
32659
|
-
acc.push({
|
|
32660
|
-
type: "field",
|
|
32661
|
-
value: `globalData:${path}`,
|
|
32662
|
-
label: key,
|
|
32663
|
-
sub: path,
|
|
32664
|
-
dataTypeName,
|
|
32665
|
-
nodeSource: "globalData",
|
|
32666
|
-
fieldCode: path
|
|
32667
|
-
});
|
|
32668
|
-
}
|
|
32669
|
-
}
|
|
32670
|
-
return acc;
|
|
32671
|
-
}, []);
|
|
32672
|
-
}
|
|
32673
32741
|
const globalDataItems = computed(() => {
|
|
32674
32742
|
const template = getGlobalDataTemplate ? getGlobalDataTemplate() : null;
|
|
32675
|
-
|
|
32676
|
-
return buildGdTree(template, "", search.value.toLowerCase());
|
|
32743
|
+
return filterGlobalDataFields(parseGlobalDataFields(template), search.value);
|
|
32677
32744
|
});
|
|
32678
32745
|
const rootItems = computed(() => {
|
|
32679
32746
|
var _a, _b;
|
|
@@ -32981,7 +33048,7 @@ const _sfc_main$2p = /* @__PURE__ */ defineComponent({
|
|
|
32981
33048
|
};
|
|
32982
33049
|
}
|
|
32983
33050
|
});
|
|
32984
|
-
const FieldPicker = /* @__PURE__ */ _export_sfc$1(_sfc_main$2p, [["__scopeId", "data-v-
|
|
33051
|
+
const FieldPicker = /* @__PURE__ */ _export_sfc$1(_sfc_main$2p, [["__scopeId", "data-v-1ddf1c52"]]);
|
|
32985
33052
|
const _hoisted_1$1p = { class: "condition-builder-trigger" };
|
|
32986
33053
|
const _hoisted_2$y = { class: "cb-dialog-body" };
|
|
32987
33054
|
const _hoisted_3$p = { class: "cb-header" };
|
|
@@ -33051,43 +33118,10 @@ const _sfc_main$2o = /* @__PURE__ */ defineComponent({
|
|
|
33051
33118
|
function getOperators(cond) {
|
|
33052
33119
|
return OPERATORS[cond.dataTypeName] || DEFAULT_OPS;
|
|
33053
33120
|
}
|
|
33054
|
-
function inferGdType(v) {
|
|
33055
|
-
if (Array.isArray(v)) return "Array";
|
|
33056
|
-
if (v === true || v === false) return "Bool";
|
|
33057
|
-
if (typeof v === "number") return "Number";
|
|
33058
|
-
if (v !== null && typeof v === "object") return "Object";
|
|
33059
|
-
return "String";
|
|
33060
|
-
}
|
|
33061
|
-
function buildGdOptions(obj2, prefix = "", group = "全局数据") {
|
|
33062
|
-
if (!obj2 || typeof obj2 !== "object" || Array.isArray(obj2)) return [];
|
|
33063
|
-
return Object.entries(obj2).flatMap(([key, value]) => {
|
|
33064
|
-
const path = prefix ? `${prefix}.${key}` : key;
|
|
33065
|
-
const dataTypeName = inferGdType(value);
|
|
33066
|
-
if (dataTypeName === "Object" && value && !Array.isArray(value)) {
|
|
33067
|
-
return [{
|
|
33068
|
-
value: `globalData:${path}`,
|
|
33069
|
-
label: key,
|
|
33070
|
-
dataTypeName: "Object",
|
|
33071
|
-
group,
|
|
33072
|
-
type: "container",
|
|
33073
|
-
children: buildGdOptions(value, path, path)
|
|
33074
|
-
}];
|
|
33075
|
-
}
|
|
33076
|
-
return [{ value: `globalData:${path}`, label: key, dataTypeName, group }];
|
|
33077
|
-
});
|
|
33078
|
-
}
|
|
33079
33121
|
const allFieldOptions = computed(() => {
|
|
33080
33122
|
const parentFieldsList = getParentFields ? getParentFields() : [];
|
|
33081
33123
|
const template = getGlobalDataTemplate ? getGlobalDataTemplate() : null;
|
|
33082
|
-
const gdOpts =
|
|
33083
|
-
value: o.value,
|
|
33084
|
-
label: o.label,
|
|
33085
|
-
dataTypeName: o.dataTypeName,
|
|
33086
|
-
nodeSource: "globalData",
|
|
33087
|
-
fieldCode: o.value.replace("globalData:", ""),
|
|
33088
|
-
componentType: "",
|
|
33089
|
-
componentOptions: null
|
|
33090
|
-
})) : [];
|
|
33124
|
+
const gdOpts = flattenGlobalDataFields(parseGlobalDataFields(template), true);
|
|
33091
33125
|
return [
|
|
33092
33126
|
...siblingFields.value.map((f) => ({
|
|
33093
33127
|
value: `curr:${f.keyCode}`,
|
|
@@ -33123,6 +33157,9 @@ const _sfc_main$2o = /* @__PURE__ */ defineComponent({
|
|
|
33123
33157
|
...gdOpts
|
|
33124
33158
|
];
|
|
33125
33159
|
});
|
|
33160
|
+
function findGlobalDataOption(fieldCode) {
|
|
33161
|
+
return allFieldOptions.value.find((opt) => opt.nodeSource === "globalData" && opt.fieldCode === fieldCode);
|
|
33162
|
+
}
|
|
33126
33163
|
function getFieldRef(cond) {
|
|
33127
33164
|
if (cond.nodeSource === "globalData") {
|
|
33128
33165
|
return cond.fieldCode ? `globalData.${cond.fieldCode}` : "globalData";
|
|
@@ -33203,9 +33240,15 @@ const _sfc_main$2o = /* @__PURE__ */ defineComponent({
|
|
|
33203
33240
|
return { fieldCode: compM[2], fieldName: (f == null ? void 0 : f.keyName) || compM[2], dataTypeName: (f == null ? void 0 : f.dataTypeName) || "String", operator: compM[3], value: val, logicOp: "AND", nodeSource };
|
|
33204
33241
|
}
|
|
33205
33242
|
const gdNotEmptyM = s.match(/^!!globalData\.(.+)$/);
|
|
33206
|
-
if (gdNotEmptyM)
|
|
33243
|
+
if (gdNotEmptyM) {
|
|
33244
|
+
const f = findGlobalDataOption(gdNotEmptyM[1]);
|
|
33245
|
+
return { fieldCode: gdNotEmptyM[1], fieldName: (f == null ? void 0 : f.label) || gdNotEmptyM[1], dataTypeName: (f == null ? void 0 : f.dataTypeName) || "String", operator: "notEmpty", value: "", logicOp: "AND", nodeSource: "globalData" };
|
|
33246
|
+
}
|
|
33207
33247
|
const gdEmptyM = s.match(/^!globalData\.(.+)$/);
|
|
33208
|
-
if (gdEmptyM)
|
|
33248
|
+
if (gdEmptyM) {
|
|
33249
|
+
const f = findGlobalDataOption(gdEmptyM[1]);
|
|
33250
|
+
return { fieldCode: gdEmptyM[1], fieldName: (f == null ? void 0 : f.label) || gdEmptyM[1], dataTypeName: (f == null ? void 0 : f.dataTypeName) || "String", operator: "empty", value: "", logicOp: "AND", nodeSource: "globalData" };
|
|
33251
|
+
}
|
|
33209
33252
|
const gdCompM = s.match(/^globalData\.(\S+)\s*(==|!=|>=|<=|>|<)\s*(.+)$/);
|
|
33210
33253
|
if (gdCompM) {
|
|
33211
33254
|
let val = gdCompM[3].trim();
|
|
@@ -33213,7 +33256,8 @@ const _sfc_main$2o = /* @__PURE__ */ defineComponent({
|
|
|
33213
33256
|
else if (val === "true") val = true;
|
|
33214
33257
|
else if (val === "false") val = false;
|
|
33215
33258
|
else if (!isNaN(Number(val))) val = Number(val);
|
|
33216
|
-
|
|
33259
|
+
const f = findGlobalDataOption(gdCompM[1]);
|
|
33260
|
+
return { fieldCode: gdCompM[1], fieldName: (f == null ? void 0 : f.label) || gdCompM[1], dataTypeName: (f == null ? void 0 : f.dataTypeName) || "String", operator: gdCompM[2], value: val, logicOp: "AND", nodeSource: "globalData" };
|
|
33217
33261
|
}
|
|
33218
33262
|
return null;
|
|
33219
33263
|
}
|
|
@@ -33266,7 +33310,10 @@ const _sfc_main$2o = /* @__PURE__ */ defineComponent({
|
|
|
33266
33310
|
function switchToVisual() {
|
|
33267
33311
|
const { conditions: parsed, success } = parseExpression(localValue.value);
|
|
33268
33312
|
if (success) {
|
|
33269
|
-
parsed.forEach(
|
|
33313
|
+
parsed.forEach((c) => {
|
|
33314
|
+
restoreCombined(c);
|
|
33315
|
+
restoreComponentType(c);
|
|
33316
|
+
});
|
|
33270
33317
|
localConditions.value = parsed;
|
|
33271
33318
|
parseError.value = false;
|
|
33272
33319
|
mode.value = "visual";
|
|
@@ -33324,6 +33371,8 @@ const _sfc_main$2o = /* @__PURE__ */ defineComponent({
|
|
|
33324
33371
|
function restoreComponentType(cond) {
|
|
33325
33372
|
const field = allFieldOptions.value.find((opt) => opt.fieldCode === cond.fieldCode && opt.nodeSource === cond.nodeSource);
|
|
33326
33373
|
if (field) {
|
|
33374
|
+
cond.fieldName = field.label || cond.fieldName;
|
|
33375
|
+
cond.dataTypeName = field.dataTypeName || cond.dataTypeName;
|
|
33327
33376
|
cond.componentType = field.componentType || "";
|
|
33328
33377
|
cond.componentOptions = field.componentOptions || null;
|
|
33329
33378
|
}
|
|
@@ -33353,8 +33402,21 @@ const _sfc_main$2o = /* @__PURE__ */ defineComponent({
|
|
|
33353
33402
|
}
|
|
33354
33403
|
return `currNode['${s}']?.value`;
|
|
33355
33404
|
};
|
|
33405
|
+
function findOptionLabelByValue(options2, value) {
|
|
33406
|
+
var _a;
|
|
33407
|
+
for (const opt of options2) {
|
|
33408
|
+
if (opt.value === value) return opt.label ?? null;
|
|
33409
|
+
if ((_a = opt.children) == null ? void 0 : _a.length) {
|
|
33410
|
+
const childLabel = findOptionLabelByValue(opt.children, value);
|
|
33411
|
+
if (childLabel) return childLabel;
|
|
33412
|
+
}
|
|
33413
|
+
}
|
|
33414
|
+
return null;
|
|
33415
|
+
}
|
|
33356
33416
|
const mentionDisplayLabel = (id) => {
|
|
33357
33417
|
if (!id) return id;
|
|
33418
|
+
const optionLabel = findOptionLabelByValue(fieldOptions.value, id);
|
|
33419
|
+
if (optionLabel) return optionLabel;
|
|
33358
33420
|
if (id === "__rootNode__") return "rootNode";
|
|
33359
33421
|
if (id.startsWith("globalData:")) return `globalData.${id.slice(11)}`;
|
|
33360
33422
|
if (id.startsWith("root:")) return `root.${id.slice(5)}`;
|
|
@@ -33374,7 +33436,7 @@ const _sfc_main$2o = /* @__PURE__ */ defineComponent({
|
|
|
33374
33436
|
var _a, _b;
|
|
33375
33437
|
const parentFieldsList = getParentFields ? getParentFields() : [];
|
|
33376
33438
|
const template = getGlobalDataTemplate ? getGlobalDataTemplate() : null;
|
|
33377
|
-
const gdOpts =
|
|
33439
|
+
const gdOpts = parseGlobalDataFields(template);
|
|
33378
33440
|
const rootContainers = /* @__PURE__ */ new Map();
|
|
33379
33441
|
const rootFlat = [];
|
|
33380
33442
|
for (const f of allFormFields.value) {
|
|
@@ -33732,7 +33794,7 @@ const _sfc_main$2o = /* @__PURE__ */ defineComponent({
|
|
|
33732
33794
|
};
|
|
33733
33795
|
}
|
|
33734
33796
|
});
|
|
33735
|
-
const ConditionBuilderVue = /* @__PURE__ */ _export_sfc$1(_sfc_main$2o, [["__scopeId", "data-v-
|
|
33797
|
+
const ConditionBuilderVue = /* @__PURE__ */ _export_sfc$1(_sfc_main$2o, [["__scopeId", "data-v-0b3e6aff"]]);
|
|
33736
33798
|
const _hoisted_1$1o = { class: "expr-input-wrapper" };
|
|
33737
33799
|
const _hoisted_2$x = {
|
|
33738
33800
|
key: 0,
|
|
@@ -33859,31 +33921,6 @@ const _sfc_main$2n = /* @__PURE__ */ defineComponent({
|
|
|
33859
33921
|
}
|
|
33860
33922
|
return `currNode['${s}'].value`;
|
|
33861
33923
|
};
|
|
33862
|
-
function inferGdType(v) {
|
|
33863
|
-
if (Array.isArray(v)) return "Array";
|
|
33864
|
-
if (v === true || v === false) return "Bool";
|
|
33865
|
-
if (typeof v === "number") return "Number";
|
|
33866
|
-
if (v !== null && typeof v === "object") return "Object";
|
|
33867
|
-
return "String";
|
|
33868
|
-
}
|
|
33869
|
-
function buildGdOptions(obj2, prefix = "", group = "全局数据") {
|
|
33870
|
-
if (!obj2 || typeof obj2 !== "object" || Array.isArray(obj2)) return [];
|
|
33871
|
-
return Object.entries(obj2).flatMap(([key, value]) => {
|
|
33872
|
-
const path = prefix ? `${prefix}.${key}` : key;
|
|
33873
|
-
const dataTypeName = inferGdType(value);
|
|
33874
|
-
if (dataTypeName === "Object" && value && !Array.isArray(value)) {
|
|
33875
|
-
return [{
|
|
33876
|
-
value: `globalData:${path}`,
|
|
33877
|
-
label: key,
|
|
33878
|
-
dataTypeName: "Object",
|
|
33879
|
-
group,
|
|
33880
|
-
type: "container",
|
|
33881
|
-
children: buildGdOptions(value, path, path)
|
|
33882
|
-
}];
|
|
33883
|
-
}
|
|
33884
|
-
return [{ value: `globalData:${path}`, label: key, dataTypeName, group }];
|
|
33885
|
-
});
|
|
33886
|
-
}
|
|
33887
33924
|
function flattenLeaves(opts, depth = 0) {
|
|
33888
33925
|
return opts.flatMap((opt) => {
|
|
33889
33926
|
if (opt.type === "container" && opt.children) {
|
|
@@ -33929,7 +33966,7 @@ const _sfc_main$2n = /* @__PURE__ */ defineComponent({
|
|
|
33929
33966
|
children: meta.children
|
|
33930
33967
|
}));
|
|
33931
33968
|
const template = getGlobalDataTemplate ? getGlobalDataTemplate() : null;
|
|
33932
|
-
const gdOpts =
|
|
33969
|
+
const gdOpts = parseGlobalDataFields(template);
|
|
33933
33970
|
const currOpts = [];
|
|
33934
33971
|
for (const f of siblingFields.value) {
|
|
33935
33972
|
if (f.dataTypeName === "Object") {
|
|
@@ -33958,8 +33995,21 @@ const _sfc_main$2n = /* @__PURE__ */ defineComponent({
|
|
|
33958
33995
|
...flattenLeaves(rootContainerOpts)
|
|
33959
33996
|
];
|
|
33960
33997
|
});
|
|
33998
|
+
function findOptionLabelByValue(options2, value) {
|
|
33999
|
+
var _a;
|
|
34000
|
+
for (const opt of options2) {
|
|
34001
|
+
if (opt.value === value) return opt.label ?? null;
|
|
34002
|
+
if ((_a = opt.children) == null ? void 0 : _a.length) {
|
|
34003
|
+
const childLabel = findOptionLabelByValue(opt.children, value);
|
|
34004
|
+
if (childLabel) return childLabel;
|
|
34005
|
+
}
|
|
34006
|
+
}
|
|
34007
|
+
return null;
|
|
34008
|
+
}
|
|
33961
34009
|
const mentionDisplayLabel = (id) => {
|
|
33962
34010
|
if (!id) return id;
|
|
34011
|
+
const optionLabel = findOptionLabelByValue(fieldOptions.value, id);
|
|
34012
|
+
if (optionLabel) return optionLabel;
|
|
33963
34013
|
if (id === "__rootNode__") return "rootNode";
|
|
33964
34014
|
if (id.startsWith("globalData:")) return `globalData.${id.slice(11)}`;
|
|
33965
34015
|
if (id.startsWith("root:")) return `root.${id.slice(5)}`;
|
|
@@ -34175,7 +34225,7 @@ const _sfc_main$2n = /* @__PURE__ */ defineComponent({
|
|
|
34175
34225
|
};
|
|
34176
34226
|
}
|
|
34177
34227
|
});
|
|
34178
|
-
const ExpressionInputVue = /* @__PURE__ */ _export_sfc$1(_sfc_main$2n, [["__scopeId", "data-v-
|
|
34228
|
+
const ExpressionInputVue = /* @__PURE__ */ _export_sfc$1(_sfc_main$2n, [["__scopeId", "data-v-4cf2ed46"]]);
|
|
34179
34229
|
Number.prototype.toFixedNumber = function toFixedNumber(digits = 2) {
|
|
34180
34230
|
return parseFloat(this.toFixed(digits));
|
|
34181
34231
|
};
|
|
@@ -73196,7 +73246,7 @@ const _sfc_main$1l = /* @__PURE__ */ defineComponent({
|
|
|
73196
73246
|
emits: /* @__PURE__ */ mergeModels(["removeItem"], ["update:children"]),
|
|
73197
73247
|
setup(__props, { emit: __emit }) {
|
|
73198
73248
|
const DynamicDesignerInnerItem = defineAsyncComponent(() => {
|
|
73199
|
-
return import("./innerItem-
|
|
73249
|
+
return import("./innerItem-D1oz0Pwd.js");
|
|
73200
73250
|
});
|
|
73201
73251
|
const { getValue: getValue2 } = useProps();
|
|
73202
73252
|
const tagID = getValue2("tagID");
|
|
@@ -73637,6 +73687,22 @@ const designerProps = buildProps({
|
|
|
73637
73687
|
*/
|
|
73638
73688
|
modelProps: {
|
|
73639
73689
|
type: Object
|
|
73690
|
+
},
|
|
73691
|
+
/**
|
|
73692
|
+
* @description 全局数据字段描述对象,左侧为展示名,右侧为真实字段名/字段配置(支持嵌套对象)
|
|
73693
|
+
* 例:{ "用户名": "userName", "年龄": { name: "age", type: "number" }, "部门": { "dept": { "部门名称": "name" } } }
|
|
73694
|
+
*/
|
|
73695
|
+
globalData: {
|
|
73696
|
+
type: Object,
|
|
73697
|
+
default: null
|
|
73698
|
+
},
|
|
73699
|
+
/**
|
|
73700
|
+
* @deprecated 已被 globalData 替代,保留向后兼容
|
|
73701
|
+
* @description 全局数据字段名列表(平铺,不支持嵌套)
|
|
73702
|
+
*/
|
|
73703
|
+
globalDataFields: {
|
|
73704
|
+
type: Array,
|
|
73705
|
+
default: () => []
|
|
73640
73706
|
}
|
|
73641
73707
|
});
|
|
73642
73708
|
const _hoisted_1$12 = { class: "els-dynamic-config-tool" };
|
|
@@ -73979,7 +74045,8 @@ const _sfc_main$1k = /* @__PURE__ */ defineComponent({
|
|
|
73979
74045
|
openCreateComponent,
|
|
73980
74046
|
getConverToJsonResult,
|
|
73981
74047
|
getAllFormFields: () => allFormFields.value,
|
|
73982
|
-
|
|
74048
|
+
getGlobalDataKeys: () => props2.globalData ? getGlobalDataFieldKeys(props2.globalData) : props2.globalDataFields || [],
|
|
74049
|
+
getGlobalDataTemplate: () => props2.globalData || null,
|
|
73983
74050
|
getSiblingFields: () => {
|
|
73984
74051
|
if (!currSelectItemKey.value) return allFormFields.value;
|
|
73985
74052
|
const ctx = findItemContextDesigner(currSelectItemKey.value);
|
|
@@ -74052,7 +74119,7 @@ const _sfc_main$1k = /* @__PURE__ */ defineComponent({
|
|
|
74052
74119
|
};
|
|
74053
74120
|
}
|
|
74054
74121
|
});
|
|
74055
|
-
const Designer = /* @__PURE__ */ _export_sfc$1(_sfc_main$1k, [["__scopeId", "data-v-
|
|
74122
|
+
const Designer = /* @__PURE__ */ _export_sfc$1(_sfc_main$1k, [["__scopeId", "data-v-7bf90ef8"]]);
|
|
74056
74123
|
const ElsDynamicDesigner = withInstall$1(Designer);
|
|
74057
74124
|
const renderProps = buildProps({
|
|
74058
74125
|
...formItemProps$1,
|
|
@@ -74151,10 +74218,10 @@ const _sfc_main$1j = /* @__PURE__ */ defineComponent({
|
|
|
74151
74218
|
emits: ["update:modelValue"],
|
|
74152
74219
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
74153
74220
|
const DynamicRenderInner = defineAsyncComponent(() => {
|
|
74154
|
-
return import("./inner-
|
|
74221
|
+
return import("./inner-nnaazUsy.js").then((n) => n.i);
|
|
74155
74222
|
});
|
|
74156
74223
|
const DynamicRenderForm = defineAsyncComponent(() => {
|
|
74157
|
-
return import("./inner-
|
|
74224
|
+
return import("./inner-nnaazUsy.js").then((n) => n.f);
|
|
74158
74225
|
});
|
|
74159
74226
|
const props2 = __props;
|
|
74160
74227
|
const { getValue: getValue2, setValue, formNodeProps } = useProps(props2);
|
|
@@ -74384,10 +74451,10 @@ const _sfc_main$1i = /* @__PURE__ */ defineComponent({
|
|
|
74384
74451
|
emits: ["update:modelValue"],
|
|
74385
74452
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
74386
74453
|
const DynamicRenderInnerAsync = defineAsyncComponent(() => {
|
|
74387
|
-
return import("./inner-
|
|
74454
|
+
return import("./inner-nnaazUsy.js").then((n) => n.i);
|
|
74388
74455
|
});
|
|
74389
74456
|
const DynamicRenderFormAsync = defineAsyncComponent(() => {
|
|
74390
|
-
return import("./inner-
|
|
74457
|
+
return import("./inner-nnaazUsy.js").then((n) => n.f);
|
|
74391
74458
|
});
|
|
74392
74459
|
const props2 = __props;
|
|
74393
74460
|
const { getValue: getValue2, setValue, formNodeProps } = useProps(props2);
|
|
@@ -75779,7 +75846,8 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
75779
75846
|
var _a;
|
|
75780
75847
|
return (_a = currSelectItem.value) == null ? void 0 : _a.keyCode;
|
|
75781
75848
|
}, (keyCode) => {
|
|
75782
|
-
|
|
75849
|
+
var _a;
|
|
75850
|
+
if (nameEqualsCode && keyCode !== void 0 && ((_a = currSelectItem.value) == null ? void 0 : _a.componentGroup) === "Form") {
|
|
75783
75851
|
currSelectItem.value.keyName = keyCode;
|
|
75784
75852
|
}
|
|
75785
75853
|
});
|
|
@@ -75827,7 +75895,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
75827
75895
|
]),
|
|
75828
75896
|
_: 1
|
|
75829
75897
|
}),
|
|
75830
|
-
currSelectItem.value.componentGroup
|
|
75898
|
+
currSelectItem.value.componentGroup !== "Form" || !unref(nameEqualsCode) ? (openBlock(), createBlock(_component_els_input, {
|
|
75831
75899
|
key: 0,
|
|
75832
75900
|
label: "名称",
|
|
75833
75901
|
prop: "keyName"
|
|
@@ -75930,7 +75998,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
75930
75998
|
};
|
|
75931
75999
|
}
|
|
75932
76000
|
});
|
|
75933
|
-
const DynamicDesignerViewBaseSetting = /* @__PURE__ */ _export_sfc$1(_sfc_main$C, [["__scopeId", "data-v-
|
|
76001
|
+
const DynamicDesignerViewBaseSetting = /* @__PURE__ */ _export_sfc$1(_sfc_main$C, [["__scopeId", "data-v-c1e16bec"]]);
|
|
75934
76002
|
function useDesigner(props2, nodeItem) {
|
|
75935
76003
|
return useRender(props2, nodeItem, void 0, void 0, true);
|
|
75936
76004
|
}
|
|
@@ -77095,8 +77163,8 @@ const designerViewProps = buildProps({
|
|
|
77095
77163
|
*/
|
|
77096
77164
|
nameEqualsCode: Boolean,
|
|
77097
77165
|
/**
|
|
77098
|
-
* @description
|
|
77099
|
-
* 例:{
|
|
77166
|
+
* @description 全局数据字段描述对象,左侧为展示名,右侧为真实字段名/字段配置(支持嵌套对象)
|
|
77167
|
+
* 例:{ "用户名": "userName", "年龄": { name: "age", type: "number" }, "部门": { "dept": { "部门名称": "name" } } }
|
|
77100
77168
|
*/
|
|
77101
77169
|
globalData: {
|
|
77102
77170
|
type: Object,
|
|
@@ -77625,13 +77693,6 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
77625
77693
|
return null;
|
|
77626
77694
|
}
|
|
77627
77695
|
});
|
|
77628
|
-
function flattenObjectKeys(obj2, prefix = "") {
|
|
77629
|
-
if (!obj2 || typeof obj2 !== "object" || Array.isArray(obj2)) return prefix ? [prefix] : [];
|
|
77630
|
-
return Object.entries(obj2).flatMap(([k, v]) => {
|
|
77631
|
-
const path = prefix ? `${prefix}.${k}` : k;
|
|
77632
|
-
return typeof v === "object" && v !== null && !Array.isArray(v) ? [path, ...flattenObjectKeys(v, path)] : [path];
|
|
77633
|
-
});
|
|
77634
|
-
}
|
|
77635
77696
|
const allFormFields = computed(() => {
|
|
77636
77697
|
const result = [];
|
|
77637
77698
|
function collect(items, containerPath = [], containerKeyNames = []) {
|
|
@@ -77888,7 +77949,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
77888
77949
|
},
|
|
77889
77950
|
recordComponent,
|
|
77890
77951
|
getAllFormFields: () => allFormFields.value,
|
|
77891
|
-
getGlobalDataKeys: () => props2.globalData ?
|
|
77952
|
+
getGlobalDataKeys: () => props2.globalData ? getGlobalDataFieldKeys(props2.globalData) : props2.globalDataFields || [],
|
|
77892
77953
|
getGlobalDataTemplate: () => props2.globalData || null,
|
|
77893
77954
|
getSiblingFields: () => {
|
|
77894
77955
|
if (!currSelectItem.value) return allFormFields.value;
|
|
@@ -78777,7 +78838,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
78777
78838
|
};
|
|
78778
78839
|
}
|
|
78779
78840
|
});
|
|
78780
|
-
const DesignerView = /* @__PURE__ */ _export_sfc$1(_sfc_main$u, [["__scopeId", "data-v-
|
|
78841
|
+
const DesignerView = /* @__PURE__ */ _export_sfc$1(_sfc_main$u, [["__scopeId", "data-v-71fa671f"]]);
|
|
78781
78842
|
const ElsDesignerView = withInstall$1(DesignerView);
|
|
78782
78843
|
(function(Prism2) {
|
|
78783
78844
|
var string = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
|
|
@@ -79516,31 +79577,31 @@ let AceEditor$1 = class AceEditor extends TBaseFormItem {
|
|
|
79516
79577
|
__publicField(this, "editor", ref());
|
|
79517
79578
|
onMounted(() => {
|
|
79518
79579
|
if (props2.language === "json") {
|
|
79519
|
-
const currModule = import("./mode-json-
|
|
79580
|
+
const currModule = import("./mode-json-Dkoq09Q_.js").then((n) => n.m);
|
|
79520
79581
|
currModule.then((res) => {
|
|
79521
79582
|
ace.config.setModuleUrl("ace/mode/json", res);
|
|
79522
79583
|
this.init();
|
|
79523
79584
|
});
|
|
79524
79585
|
} else if (props2.language === "javascript") {
|
|
79525
|
-
const currModule = import("./mode-javascript-
|
|
79586
|
+
const currModule = import("./mode-javascript-1AtGW_3r.js").then((n) => n.m);
|
|
79526
79587
|
currModule.then((res) => {
|
|
79527
79588
|
ace.config.setModuleUrl("ace/mode/javascript", res);
|
|
79528
79589
|
this.init();
|
|
79529
79590
|
});
|
|
79530
79591
|
} else if (props2.language === "csharp") {
|
|
79531
|
-
const currModule = import("./mode-csharp-
|
|
79592
|
+
const currModule = import("./mode-csharp-TD-end5_.js").then((n) => n.m);
|
|
79532
79593
|
currModule.then((res) => {
|
|
79533
79594
|
ace.config.setModuleUrl("ace/mode/csharp", res);
|
|
79534
79595
|
this.init();
|
|
79535
79596
|
});
|
|
79536
79597
|
} else if (props2.language === "mysql") {
|
|
79537
|
-
const currModule = import("./mode-mysql-
|
|
79598
|
+
const currModule = import("./mode-mysql-Dl5f54zl.js").then((n) => n.m);
|
|
79538
79599
|
currModule.then((res) => {
|
|
79539
79600
|
ace.config.setModuleUrl("ace/mode/mysql", res);
|
|
79540
79601
|
this.init();
|
|
79541
79602
|
});
|
|
79542
79603
|
} else if (props2.language === "css") {
|
|
79543
|
-
const currModule = import("./mode-css-
|
|
79604
|
+
const currModule = import("./mode-css-CnFBC9Mu.js").then((n) => n.m);
|
|
79544
79605
|
currModule.then((res) => {
|
|
79545
79606
|
ace.config.setModuleUrl("ace/mode/css", res);
|
|
79546
79607
|
this.init();
|
|
@@ -80051,7 +80112,7 @@ let WangEditor$1 = class WangEditor extends TBaseFormItem {
|
|
|
80051
80112
|
Object.assign(this.editorConfig.value, this._props.config);
|
|
80052
80113
|
}
|
|
80053
80114
|
if (this._props.toolbarKeys) {
|
|
80054
|
-
this.toolbarConfig["toolbarKeys"] = this._props.toolbarKeys.split(",");
|
|
80115
|
+
this.toolbarConfig.value["toolbarKeys"] = this._props.toolbarKeys.split(",");
|
|
80055
80116
|
}
|
|
80056
80117
|
return createVNode(Fragment$1, null, [createVNode("div", {
|
|
80057
80118
|
"class": "els-wangEditor"
|