element-less 0.0.63 → 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.
Files changed (31) hide show
  1. package/custom/dynamic/common/globalData.d.ts +22 -0
  2. package/custom/dynamic/common/index.d.ts +1 -0
  3. package/custom/dynamic/designer/index.d.ts +14 -0
  4. package/custom/dynamic/designer/src/designer.d.ts +2 -0
  5. package/custom/dynamic/designer/src/designer.vue.d.ts +6 -0
  6. package/custom/dynamic/designerView/index.d.ts +4 -4
  7. package/custom/dynamic/designerView/src/designerView.vue.d.ts +1 -1
  8. package/element-less.cjs +1 -1
  9. package/element-less.iife.js +1 -1
  10. package/element-less.js +1 -1
  11. package/element-less.umd.cjs +1 -1
  12. package/elementui/table/index.d.ts +2 -2
  13. package/index-CsOCAv7a.cjs +1 -0
  14. package/{index-CF4gJkpG.js → index-Di5T-zru.js} +172 -137
  15. package/{inner-CjyDBQKH.cjs → inner-C35RCXsr.cjs} +1 -1
  16. package/{inner-B9Zn0_B2.js → inner-nnaazUsy.js} +1 -1
  17. package/{innerItem-DFSxgDlT.js → innerItem-D1oz0Pwd.js} +1 -1
  18. package/{innerItem-D8EdNpZ7.cjs → innerItem-LVsDJub0.cjs} +1 -1
  19. package/{mode-csharp-Cvwo0pKG.cjs → mode-csharp-DqowUjK_.cjs} +1 -1
  20. package/{mode-csharp-UBVoLKPG.js → mode-csharp-TD-end5_.js} +1 -1
  21. package/{mode-css-DgUCp6_8.js → mode-css-CnFBC9Mu.js} +1 -1
  22. package/{mode-css-CUzFJKfE.cjs → mode-css-DxAogqVp.cjs} +1 -1
  23. package/{mode-javascript-Ce6--MVa.js → mode-javascript-1AtGW_3r.js} +1 -1
  24. package/{mode-javascript-Y2qZGiys.cjs → mode-javascript-KoZ4u3j0.cjs} +1 -1
  25. package/{mode-json-BSefBGag.cjs → mode-json-BlZksyed.cjs} +1 -1
  26. package/{mode-json-Cb8ZjoeD.js → mode-json-Dkoq09Q_.js} +1 -1
  27. package/{mode-mysql-BWP5_hHW.cjs → mode-mysql-Ce48wOMA.cjs} +1 -1
  28. package/{mode-mysql-s3eaatna.js → mode-mysql-Dl5f54zl.js} +1 -1
  29. package/package.json +1 -1
  30. package/style.css +1 -1
  31. package/index-D0MvJOyS.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$1(value) {
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$1(target) && isPlainObject$1(source)) {
14879
+ if (isPlainObject$2(target) && isPlainObject$2(source)) {
14880
14880
  Object.keys(source).forEach((key) => {
14881
- if (isPlainObject$1(source[key]) && isPlainObject$1(target[key])) {
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
- if (!template || typeof template !== "object" || Array.isArray(template)) return [];
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-36912a0c"]]);
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 = template ? buildGdOptions(template).map((o) => ({
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) return { fieldCode: gdNotEmptyM[1], fieldName: gdNotEmptyM[1], dataTypeName: "String", operator: "notEmpty", value: "", logicOp: "AND", nodeSource: "globalData" };
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) return { fieldCode: gdEmptyM[1], fieldName: gdEmptyM[1], dataTypeName: "String", operator: "empty", value: "", logicOp: "AND", nodeSource: "globalData" };
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
- return { fieldCode: gdCompM[1], fieldName: gdCompM[1], dataTypeName: "String", operator: gdCompM[2], value: val, logicOp: "AND", nodeSource: "globalData" };
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(restoreCombined);
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
  }
@@ -33387,7 +33436,7 @@ const _sfc_main$2o = /* @__PURE__ */ defineComponent({
33387
33436
  var _a, _b;
33388
33437
  const parentFieldsList = getParentFields ? getParentFields() : [];
33389
33438
  const template = getGlobalDataTemplate ? getGlobalDataTemplate() : null;
33390
- const gdOpts = template ? buildGdOptions(template) : [];
33439
+ const gdOpts = parseGlobalDataFields(template);
33391
33440
  const rootContainers = /* @__PURE__ */ new Map();
33392
33441
  const rootFlat = [];
33393
33442
  for (const f of allFormFields.value) {
@@ -33745,7 +33794,7 @@ const _sfc_main$2o = /* @__PURE__ */ defineComponent({
33745
33794
  };
33746
33795
  }
33747
33796
  });
33748
- const ConditionBuilderVue = /* @__PURE__ */ _export_sfc$1(_sfc_main$2o, [["__scopeId", "data-v-5d6e49d3"]]);
33797
+ const ConditionBuilderVue = /* @__PURE__ */ _export_sfc$1(_sfc_main$2o, [["__scopeId", "data-v-0b3e6aff"]]);
33749
33798
  const _hoisted_1$1o = { class: "expr-input-wrapper" };
33750
33799
  const _hoisted_2$x = {
33751
33800
  key: 0,
@@ -33872,31 +33921,6 @@ const _sfc_main$2n = /* @__PURE__ */ defineComponent({
33872
33921
  }
33873
33922
  return `currNode['${s}'].value`;
33874
33923
  };
33875
- function inferGdType(v) {
33876
- if (Array.isArray(v)) return "Array";
33877
- if (v === true || v === false) return "Bool";
33878
- if (typeof v === "number") return "Number";
33879
- if (v !== null && typeof v === "object") return "Object";
33880
- return "String";
33881
- }
33882
- function buildGdOptions(obj2, prefix = "", group = "全局数据") {
33883
- if (!obj2 || typeof obj2 !== "object" || Array.isArray(obj2)) return [];
33884
- return Object.entries(obj2).flatMap(([key, value]) => {
33885
- const path = prefix ? `${prefix}.${key}` : key;
33886
- const dataTypeName = inferGdType(value);
33887
- if (dataTypeName === "Object" && value && !Array.isArray(value)) {
33888
- return [{
33889
- value: `globalData:${path}`,
33890
- label: key,
33891
- dataTypeName: "Object",
33892
- group,
33893
- type: "container",
33894
- children: buildGdOptions(value, path, path)
33895
- }];
33896
- }
33897
- return [{ value: `globalData:${path}`, label: key, dataTypeName, group }];
33898
- });
33899
- }
33900
33924
  function flattenLeaves(opts, depth = 0) {
33901
33925
  return opts.flatMap((opt) => {
33902
33926
  if (opt.type === "container" && opt.children) {
@@ -33942,7 +33966,7 @@ const _sfc_main$2n = /* @__PURE__ */ defineComponent({
33942
33966
  children: meta.children
33943
33967
  }));
33944
33968
  const template = getGlobalDataTemplate ? getGlobalDataTemplate() : null;
33945
- const gdOpts = template ? buildGdOptions(template) : [];
33969
+ const gdOpts = parseGlobalDataFields(template);
33946
33970
  const currOpts = [];
33947
33971
  for (const f of siblingFields.value) {
33948
33972
  if (f.dataTypeName === "Object") {
@@ -34201,7 +34225,7 @@ const _sfc_main$2n = /* @__PURE__ */ defineComponent({
34201
34225
  };
34202
34226
  }
34203
34227
  });
34204
- const ExpressionInputVue = /* @__PURE__ */ _export_sfc$1(_sfc_main$2n, [["__scopeId", "data-v-657f4962"]]);
34228
+ const ExpressionInputVue = /* @__PURE__ */ _export_sfc$1(_sfc_main$2n, [["__scopeId", "data-v-4cf2ed46"]]);
34205
34229
  Number.prototype.toFixedNumber = function toFixedNumber(digits = 2) {
34206
34230
  return parseFloat(this.toFixed(digits));
34207
34231
  };
@@ -73222,7 +73246,7 @@ const _sfc_main$1l = /* @__PURE__ */ defineComponent({
73222
73246
  emits: /* @__PURE__ */ mergeModels(["removeItem"], ["update:children"]),
73223
73247
  setup(__props, { emit: __emit }) {
73224
73248
  const DynamicDesignerInnerItem = defineAsyncComponent(() => {
73225
- return import("./innerItem-DFSxgDlT.js");
73249
+ return import("./innerItem-D1oz0Pwd.js");
73226
73250
  });
73227
73251
  const { getValue: getValue2 } = useProps();
73228
73252
  const tagID = getValue2("tagID");
@@ -73663,6 +73687,22 @@ const designerProps = buildProps({
73663
73687
  */
73664
73688
  modelProps: {
73665
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: () => []
73666
73706
  }
73667
73707
  });
73668
73708
  const _hoisted_1$12 = { class: "els-dynamic-config-tool" };
@@ -74005,7 +74045,8 @@ const _sfc_main$1k = /* @__PURE__ */ defineComponent({
74005
74045
  openCreateComponent,
74006
74046
  getConverToJsonResult,
74007
74047
  getAllFormFields: () => allFormFields.value,
74008
- getGlobalDataTemplate: () => null,
74048
+ getGlobalDataKeys: () => props2.globalData ? getGlobalDataFieldKeys(props2.globalData) : props2.globalDataFields || [],
74049
+ getGlobalDataTemplate: () => props2.globalData || null,
74009
74050
  getSiblingFields: () => {
74010
74051
  if (!currSelectItemKey.value) return allFormFields.value;
74011
74052
  const ctx = findItemContextDesigner(currSelectItemKey.value);
@@ -74078,7 +74119,7 @@ const _sfc_main$1k = /* @__PURE__ */ defineComponent({
74078
74119
  };
74079
74120
  }
74080
74121
  });
74081
- const Designer = /* @__PURE__ */ _export_sfc$1(_sfc_main$1k, [["__scopeId", "data-v-e20fc7da"]]);
74122
+ const Designer = /* @__PURE__ */ _export_sfc$1(_sfc_main$1k, [["__scopeId", "data-v-7bf90ef8"]]);
74082
74123
  const ElsDynamicDesigner = withInstall$1(Designer);
74083
74124
  const renderProps = buildProps({
74084
74125
  ...formItemProps$1,
@@ -74177,10 +74218,10 @@ const _sfc_main$1j = /* @__PURE__ */ defineComponent({
74177
74218
  emits: ["update:modelValue"],
74178
74219
  setup(__props, { expose: __expose, emit: __emit }) {
74179
74220
  const DynamicRenderInner = defineAsyncComponent(() => {
74180
- return import("./inner-B9Zn0_B2.js").then((n) => n.i);
74221
+ return import("./inner-nnaazUsy.js").then((n) => n.i);
74181
74222
  });
74182
74223
  const DynamicRenderForm = defineAsyncComponent(() => {
74183
- return import("./inner-B9Zn0_B2.js").then((n) => n.f);
74224
+ return import("./inner-nnaazUsy.js").then((n) => n.f);
74184
74225
  });
74185
74226
  const props2 = __props;
74186
74227
  const { getValue: getValue2, setValue, formNodeProps } = useProps(props2);
@@ -74410,10 +74451,10 @@ const _sfc_main$1i = /* @__PURE__ */ defineComponent({
74410
74451
  emits: ["update:modelValue"],
74411
74452
  setup(__props, { expose: __expose, emit: __emit }) {
74412
74453
  const DynamicRenderInnerAsync = defineAsyncComponent(() => {
74413
- return import("./inner-B9Zn0_B2.js").then((n) => n.i);
74454
+ return import("./inner-nnaazUsy.js").then((n) => n.i);
74414
74455
  });
74415
74456
  const DynamicRenderFormAsync = defineAsyncComponent(() => {
74416
- return import("./inner-B9Zn0_B2.js").then((n) => n.f);
74457
+ return import("./inner-nnaazUsy.js").then((n) => n.f);
74417
74458
  });
74418
74459
  const props2 = __props;
74419
74460
  const { getValue: getValue2, setValue, formNodeProps } = useProps(props2);
@@ -75805,7 +75846,8 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
75805
75846
  var _a;
75806
75847
  return (_a = currSelectItem.value) == null ? void 0 : _a.keyCode;
75807
75848
  }, (keyCode) => {
75808
- if (nameEqualsCode && keyCode !== void 0) {
75849
+ var _a;
75850
+ if (nameEqualsCode && keyCode !== void 0 && ((_a = currSelectItem.value) == null ? void 0 : _a.componentGroup) === "Form") {
75809
75851
  currSelectItem.value.keyName = keyCode;
75810
75852
  }
75811
75853
  });
@@ -75853,7 +75895,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
75853
75895
  ]),
75854
75896
  _: 1
75855
75897
  }),
75856
- currSelectItem.value.componentGroup === "Form" && !unref(nameEqualsCode) ? (openBlock(), createBlock(_component_els_input, {
75898
+ currSelectItem.value.componentGroup !== "Form" || !unref(nameEqualsCode) ? (openBlock(), createBlock(_component_els_input, {
75857
75899
  key: 0,
75858
75900
  label: "名称",
75859
75901
  prop: "keyName"
@@ -75956,7 +75998,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
75956
75998
  };
75957
75999
  }
75958
76000
  });
75959
- const DynamicDesignerViewBaseSetting = /* @__PURE__ */ _export_sfc$1(_sfc_main$C, [["__scopeId", "data-v-b92b2bc9"]]);
76001
+ const DynamicDesignerViewBaseSetting = /* @__PURE__ */ _export_sfc$1(_sfc_main$C, [["__scopeId", "data-v-c1e16bec"]]);
75960
76002
  function useDesigner(props2, nodeItem) {
75961
76003
  return useRender(props2, nodeItem, void 0, void 0, true);
75962
76004
  }
@@ -77121,8 +77163,8 @@ const designerViewProps = buildProps({
77121
77163
  */
77122
77164
  nameEqualsCode: Boolean,
77123
77165
  /**
77124
- * @description 全局数据模板对象,自动推导可选字段及类型(支持嵌套结构)
77125
- * 例:{ userId: '', user: { name: '', age: 0 }, roles: [] }
77166
+ * @description 全局数据字段描述对象,左侧为展示名,右侧为真实字段名/字段配置(支持嵌套对象)
77167
+ * 例:{ "用户名": "userName", "年龄": { name: "age", type: "number" }, "部门": { "dept": { "部门名称": "name" } } }
77126
77168
  */
77127
77169
  globalData: {
77128
77170
  type: Object,
@@ -77651,13 +77693,6 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
77651
77693
  return null;
77652
77694
  }
77653
77695
  });
77654
- function flattenObjectKeys(obj2, prefix = "") {
77655
- if (!obj2 || typeof obj2 !== "object" || Array.isArray(obj2)) return prefix ? [prefix] : [];
77656
- return Object.entries(obj2).flatMap(([k, v]) => {
77657
- const path = prefix ? `${prefix}.${k}` : k;
77658
- return typeof v === "object" && v !== null && !Array.isArray(v) ? [path, ...flattenObjectKeys(v, path)] : [path];
77659
- });
77660
- }
77661
77696
  const allFormFields = computed(() => {
77662
77697
  const result = [];
77663
77698
  function collect(items, containerPath = [], containerKeyNames = []) {
@@ -77914,7 +77949,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
77914
77949
  },
77915
77950
  recordComponent,
77916
77951
  getAllFormFields: () => allFormFields.value,
77917
- getGlobalDataKeys: () => props2.globalData ? flattenObjectKeys(props2.globalData) : props2.globalDataFields || [],
77952
+ getGlobalDataKeys: () => props2.globalData ? getGlobalDataFieldKeys(props2.globalData) : props2.globalDataFields || [],
77918
77953
  getGlobalDataTemplate: () => props2.globalData || null,
77919
77954
  getSiblingFields: () => {
77920
77955
  if (!currSelectItem.value) return allFormFields.value;
@@ -78803,7 +78838,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
78803
78838
  };
78804
78839
  }
78805
78840
  });
78806
- const DesignerView = /* @__PURE__ */ _export_sfc$1(_sfc_main$u, [["__scopeId", "data-v-a9af3092"]]);
78841
+ const DesignerView = /* @__PURE__ */ _export_sfc$1(_sfc_main$u, [["__scopeId", "data-v-71fa671f"]]);
78807
78842
  const ElsDesignerView = withInstall$1(DesignerView);
78808
78843
  (function(Prism2) {
78809
78844
  var string = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
@@ -79542,31 +79577,31 @@ let AceEditor$1 = class AceEditor extends TBaseFormItem {
79542
79577
  __publicField(this, "editor", ref());
79543
79578
  onMounted(() => {
79544
79579
  if (props2.language === "json") {
79545
- const currModule = import("./mode-json-Cb8ZjoeD.js").then((n) => n.m);
79580
+ const currModule = import("./mode-json-Dkoq09Q_.js").then((n) => n.m);
79546
79581
  currModule.then((res) => {
79547
79582
  ace.config.setModuleUrl("ace/mode/json", res);
79548
79583
  this.init();
79549
79584
  });
79550
79585
  } else if (props2.language === "javascript") {
79551
- const currModule = import("./mode-javascript-Ce6--MVa.js").then((n) => n.m);
79586
+ const currModule = import("./mode-javascript-1AtGW_3r.js").then((n) => n.m);
79552
79587
  currModule.then((res) => {
79553
79588
  ace.config.setModuleUrl("ace/mode/javascript", res);
79554
79589
  this.init();
79555
79590
  });
79556
79591
  } else if (props2.language === "csharp") {
79557
- const currModule = import("./mode-csharp-UBVoLKPG.js").then((n) => n.m);
79592
+ const currModule = import("./mode-csharp-TD-end5_.js").then((n) => n.m);
79558
79593
  currModule.then((res) => {
79559
79594
  ace.config.setModuleUrl("ace/mode/csharp", res);
79560
79595
  this.init();
79561
79596
  });
79562
79597
  } else if (props2.language === "mysql") {
79563
- const currModule = import("./mode-mysql-s3eaatna.js").then((n) => n.m);
79598
+ const currModule = import("./mode-mysql-Dl5f54zl.js").then((n) => n.m);
79564
79599
  currModule.then((res) => {
79565
79600
  ace.config.setModuleUrl("ace/mode/mysql", res);
79566
79601
  this.init();
79567
79602
  });
79568
79603
  } else if (props2.language === "css") {
79569
- const currModule = import("./mode-css-DgUCp6_8.js").then((n) => n.m);
79604
+ const currModule = import("./mode-css-CnFBC9Mu.js").then((n) => n.m);
79570
79605
  currModule.then((res) => {
79571
79606
  ace.config.setModuleUrl("ace/mode/css", res);
79572
79607
  this.init();
@@ -80077,7 +80112,7 @@ let WangEditor$1 = class WangEditor extends TBaseFormItem {
80077
80112
  Object.assign(this.editorConfig.value, this._props.config);
80078
80113
  }
80079
80114
  if (this._props.toolbarKeys) {
80080
- this.toolbarConfig["toolbarKeys"] = this._props.toolbarKeys.split(",");
80115
+ this.toolbarConfig.value["toolbarKeys"] = this._props.toolbarKeys.split(",");
80081
80116
  }
80082
80117
  return createVNode(Fragment$1, null, [createVNode("div", {
80083
80118
  "class": "els-wangEditor"