element-less 0.0.65 → 0.0.66

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.
@@ -1243,6 +1243,10 @@ export declare const ElsTable: {
1243
1243
  }) => any>> & Partial<Record<any, (_: {
1244
1244
  row: any;
1245
1245
  $index: any;
1246
+ }) => any>> & Partial<Record<string, (_: {
1247
+ row: any;
1248
+ column: any;
1249
+ $index: any;
1246
1250
  }) => any>> & {
1247
1251
  checklabel?(_: {
1248
1252
  checkItem: any;
@@ -28,6 +28,10 @@ declare function __VLS_template(): {
28
28
  }) => any>> & Partial<Record<any, (_: {
29
29
  row: any;
30
30
  $index: any;
31
+ }) => any>> & Partial<Record<string, (_: {
32
+ row: any;
33
+ column: any;
34
+ $index: any;
31
35
  }) => any>> & {
32
36
  checklabel?(_: {
33
37
  checkItem: any;
@@ -40204,7 +40204,7 @@ const _sfc_main$1_ = /* @__PURE__ */ defineComponent({
40204
40204
  });
40205
40205
  watch(tableData, (val) => {
40206
40206
  updateBottomScroll();
40207
- emits2("update:modelValue", val);
40207
+ emits2("update:modelValue", val.map(({ edit: _e, saveDataLoading: _s, ...rest }) => rest));
40208
40208
  }, { immediate: true });
40209
40209
  watch(() => props2.pageSize, (val) => {
40210
40210
  currPageSize.value = val;
@@ -41882,6 +41882,21 @@ const _sfc_main$1_ = /* @__PURE__ */ defineComponent({
41882
41882
  ref_for: true
41883
41883
  }, { row, $index }), void 0, true)
41884
41884
  ]),
41885
+ edit: withCtx((slotProps) => [
41886
+ _ctx.$slots["edit-" + (column.id || column.prop)] ? renderSlot(_ctx.$slots, "edit-" + (column.id || column.prop), mergeProps({
41887
+ key: 0,
41888
+ ref_for: true
41889
+ }, slotProps), void 0, true) : (openBlock(), createBlock(resolveDynamicComponent((column.editComponent || {}).name || "els-input"), mergeProps({
41890
+ key: 1,
41891
+ required: column.required,
41892
+ requiredMessage: column.requiredMessage,
41893
+ prop: column.prop,
41894
+ modelValue: slotProps.row[column.prop],
41895
+ "onUpdate:modelValue": ($event) => slotProps.row[column.prop] = $event
41896
+ }, { ref_for: true }, (column.editComponent || {}).props || {}, {
41897
+ aIndex: slotProps.$index
41898
+ }), null, 16, ["required", "requiredMessage", "prop", "modelValue", "onUpdate:modelValue", "aIndex"]))
41899
+ ]),
41885
41900
  _: 2
41886
41901
  }, 1040);
41887
41902
  }), 128)) : renderSlot(_ctx.$slots, "default", { key: 1 }, void 0, true),
@@ -42056,7 +42071,7 @@ const _sfc_main$1_ = /* @__PURE__ */ defineComponent({
42056
42071
  };
42057
42072
  }
42058
42073
  });
42059
- const Table$1 = /* @__PURE__ */ _export_sfc$1(_sfc_main$1_, [["__scopeId", "data-v-9b87b19a"]]);
42074
+ const Table$1 = /* @__PURE__ */ _export_sfc$1(_sfc_main$1_, [["__scopeId", "data-v-3219fa3f"]]);
42060
42075
  const ElsTable = withInstall$1(Table$1);
42061
42076
  const treeProps = buildProps({
42062
42077
  ...formItemProps$1,
@@ -66197,6 +66212,22 @@ const property_table = [
66197
66212
  {
66198
66213
  "label": "image",
66199
66214
  "value": "image"
66215
+ },
66216
+ {
66217
+ "label": "enum",
66218
+ "value": "enum"
66219
+ },
66220
+ {
66221
+ "label": "operate",
66222
+ "value": "operate"
66223
+ },
66224
+ {
66225
+ "label": "select",
66226
+ "value": "select"
66227
+ },
66228
+ {
66229
+ "label": "expand",
66230
+ "value": "expand"
66200
66231
  }
66201
66232
  ]
66202
66233
  }
@@ -73307,7 +73338,7 @@ const _sfc_main$1m = /* @__PURE__ */ defineComponent({
73307
73338
  emits: /* @__PURE__ */ mergeModels(["removeItem"], ["update:children"]),
73308
73339
  setup(__props, { emit: __emit }) {
73309
73340
  const DynamicDesignerInnerItem = defineAsyncComponent(() => {
73310
- return import("./innerItem-B8FxZ1Fo.js");
73341
+ return import("./innerItem-DoH8pmVi.js");
73311
73342
  });
73312
73343
  const { getValue: getValue2 } = useProps();
73313
73344
  const tagID = getValue2("tagID");
@@ -74279,10 +74310,10 @@ const _sfc_main$1k = /* @__PURE__ */ defineComponent({
74279
74310
  emits: ["update:modelValue"],
74280
74311
  setup(__props, { expose: __expose, emit: __emit }) {
74281
74312
  const DynamicRenderInner = defineAsyncComponent(() => {
74282
- return import("./inner-C0sncydy.js").then((n) => n.i);
74313
+ return import("./inner-Bw70NrB9.js").then((n) => n.i);
74283
74314
  });
74284
74315
  const DynamicRenderForm = defineAsyncComponent(() => {
74285
- return import("./inner-C0sncydy.js").then((n) => n.f);
74316
+ return import("./inner-Bw70NrB9.js").then((n) => n.f);
74286
74317
  });
74287
74318
  const props2 = __props;
74288
74319
  const { getValue: getValue2, setValue, formNodeProps } = useProps(props2);
@@ -74512,10 +74543,10 @@ const _sfc_main$1j = /* @__PURE__ */ defineComponent({
74512
74543
  emits: ["update:modelValue"],
74513
74544
  setup(__props, { expose: __expose, emit: __emit }) {
74514
74545
  const DynamicRenderInnerAsync = defineAsyncComponent(() => {
74515
- return import("./inner-C0sncydy.js").then((n) => n.i);
74546
+ return import("./inner-Bw70NrB9.js").then((n) => n.i);
74516
74547
  });
74517
74548
  const DynamicRenderFormAsync = defineAsyncComponent(() => {
74518
- return import("./inner-C0sncydy.js").then((n) => n.f);
74549
+ return import("./inner-Bw70NrB9.js").then((n) => n.f);
74519
74550
  });
74520
74551
  const props2 = __props;
74521
74552
  const { getValue: getValue2, setValue, formNodeProps } = useProps(props2);
@@ -74724,6 +74755,10 @@ const _sfc_main$1j = /* @__PURE__ */ defineComponent({
74724
74755
  }
74725
74756
  });
74726
74757
  const DynamicRenderAsync = /* @__PURE__ */ _export_sfc$1(_sfc_main$1j, [["__scopeId", "data-v-a96b65cd"]]);
74758
+ const renderAsync = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
74759
+ __proto__: null,
74760
+ default: DynamicRenderAsync
74761
+ }, Symbol.toStringTag, { value: "Module" }));
74727
74762
  const ElsRender = withInstall$1(DynamicRender);
74728
74763
  const ElsRenderAsync = withInstall$1(DynamicRenderAsync);
74729
74764
  const _sfc_main$1i = {};
@@ -75956,20 +75991,22 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
75956
75991
  ]),
75957
75992
  _: 1
75958
75993
  }),
75959
- currSelectItem.value.componentGroup === "Form" ? (openBlock(), createBlock(_component_els_input, {
75960
- key: 0,
75961
- label: "名称",
75962
- prop: "keyName"
75963
- })) : createCommentVNode("", true),
75964
75994
  currSelectItem.value.formItem ? (openBlock(), createBlock(_component_els_input, {
75965
- key: 1,
75995
+ key: 0,
75966
75996
  label: "字段名",
75967
75997
  prop: "keyCode",
75998
+ tip: "数据的字段名称",
75968
75999
  trim: "",
75969
76000
  onInput: handleChangeKeyCode,
75970
76001
  validMethod: unref(validationCode),
75971
76002
  required: currSelectItem.value.componentGroup !== "Container" && currSelectItem.value.componentGroup !== "Show"
75972
76003
  }, null, 8, ["validMethod", "required"])) : createCommentVNode("", true),
76004
+ currSelectItem.value.componentGroup === "Form" ? (openBlock(), createBlock(_component_els_input, {
76005
+ key: 1,
76006
+ label: "名称",
76007
+ prop: "keyName",
76008
+ tip: "显示在页面上的名称"
76009
+ })) : createCommentVNode("", true),
75973
76010
  currSelectItem.value.dataTypeName != "Array" && currSelectItem.value.componentGroup === "Form" && dataTypeData.value.length > 1 ? (openBlock(), createBlock(_component_els_select, {
75974
76011
  key: 2,
75975
76012
  label: "数据类型",
@@ -76059,7 +76096,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
76059
76096
  };
76060
76097
  }
76061
76098
  });
76062
- const DynamicDesignerViewBaseSetting = /* @__PURE__ */ _export_sfc$1(_sfc_main$D, [["__scopeId", "data-v-26bb2740"]]);
76099
+ const DynamicDesignerViewBaseSetting = /* @__PURE__ */ _export_sfc$1(_sfc_main$D, [["__scopeId", "data-v-1e06d172"]]);
76063
76100
  const _hoisted_1$m = { class: "se-root" };
76064
76101
  const _hoisted_2$f = { class: "se-margin-zone" };
76065
76102
  const _hoisted_3$e = { class: "se-row" };
@@ -77125,6 +77162,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
77125
77162
  },
77126
77163
  emits: ["update:nodeItem"],
77127
77164
  setup(__props) {
77165
+ const DynamicRenderAsync2 = defineAsyncComponent(() => Promise.resolve().then(() => renderAsync));
77128
77166
  const nodeItem = useModel$1(__props, "nodeItem");
77129
77167
  const props2 = __props;
77130
77168
  const { componentProps, renderContent } = useDesigner(props2, nodeItem);
@@ -77144,16 +77182,30 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
77144
77182
  return copyProps;
77145
77183
  });
77146
77184
  return (_ctx, _cache) => {
77185
+ var _a;
77147
77186
  const _component_els_tip = resolveComponent("els-tip");
77148
- return componentName.value ? (openBlock(), createBlock(resolveDynamicComponent(componentName.value), normalizeProps(mergeProps({ key: 0 }, currProps.value)), {
77187
+ return componentName.value ? (openBlock(), createBlock(resolveDynamicComponent(componentName.value), normalizeProps(mergeProps({ key: 0 }, currProps.value)), createSlots({
77149
77188
  default: withCtx(() => [
77150
77189
  innerContent.value ? (openBlock(), createElementBlock("span", {
77151
77190
  key: 0,
77152
77191
  innerHTML: unref(renderContent)(innerContent.value)
77153
77192
  }, null, 8, _hoisted_1$j)) : createCommentVNode("", true)
77154
77193
  ]),
77155
- _: 1
77156
- }, 16)) : (openBlock(), createBlock(_component_els_tip, {
77194
+ _: 2
77195
+ }, [
77196
+ renderList((_a = nodeItem.value.slots) == null ? void 0 : _a.filter((ele) => ele.children.length), (slot) => {
77197
+ return {
77198
+ name: slot.name,
77199
+ fn: withCtx((slotProps) => [
77200
+ createVNode(unref(DynamicRenderAsync2), {
77201
+ config: slot.children,
77202
+ modelValue: (slotProps == null ? void 0 : slotProps.row) !== void 0 ? slotProps.row : {},
77203
+ globalData: Object.assign({}, slotProps)
77204
+ }, null, 8, ["config", "modelValue", "globalData"])
77205
+ ])
77206
+ };
77207
+ })
77208
+ ]), 1040)) : (openBlock(), createBlock(_component_els_tip, {
77157
77209
  key: 1,
77158
77210
  type: "danger"
77159
77211
  }, {
@@ -77198,6 +77250,16 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
77198
77250
  setValue({
77199
77251
  setSlotVisible
77200
77252
  });
77253
+ watch(
77254
+ () => {
77255
+ var _a;
77256
+ return (_a = nodeItem.value.slots) == null ? void 0 : _a.some((s) => s.name.startsWith("edit-"));
77257
+ },
77258
+ (hasEditSlots) => {
77259
+ if (hasEditSlots) slotVisible.value = true;
77260
+ },
77261
+ { immediate: true }
77262
+ );
77201
77263
  return (_ctx, _cache) => {
77202
77264
  var _a, _b, _c, _d;
77203
77265
  const _component_els_form_node = resolveComponent("els-form-node");
@@ -77283,7 +77345,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
77283
77345
  default: withCtx(() => [
77284
77346
  (openBlock(true), createElementBlock(Fragment$1, null, renderList(nodeItem.value.slots, (slot) => {
77285
77347
  return openBlock(), createBlock(_component_els_option, {
77286
- label: `插槽[${slot.name}]`
77348
+ label: slot.label || `插槽[${slot.name}]`
77287
77349
  }, {
77288
77350
  default: withCtx(() => [
77289
77351
  createElementVNode("div", _hoisted_2$d, [
@@ -77309,7 +77371,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
77309
77371
  };
77310
77372
  }
77311
77373
  });
77312
- const DynamicDesignerViewInner = /* @__PURE__ */ _export_sfc$1(_sfc_main$x, [["__scopeId", "data-v-f4511d4b"]]);
77374
+ const DynamicDesignerViewInner = /* @__PURE__ */ _export_sfc$1(_sfc_main$x, [["__scopeId", "data-v-39ddb864"]]);
77313
77375
  const _sfc_main$w = /* @__PURE__ */ defineComponent({
77314
77376
  __name: "form",
77315
77377
  props: /* @__PURE__ */ mergeModels({
@@ -78194,6 +78256,38 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
78194
78256
  return null;
78195
78257
  }
78196
78258
  });
78259
+ function syncColumnEditSlots(node, columns) {
78260
+ if (!node.slots) node.slots = [];
78261
+ const editCols = (Array.isArray(columns) ? columns : []).filter((c) => c.isEdit);
78262
+ editCols.forEach((col) => {
78263
+ if (!col.id) col.id = col.prop || utils.shortid();
78264
+ });
78265
+ node.slots = node.slots.filter(
78266
+ (s) => !s.name.startsWith("edit-") || editCols.some((c) => "edit-" + c.id === s.name)
78267
+ );
78268
+ editCols.forEach((col) => {
78269
+ const name2 = "edit-" + col.id;
78270
+ const existing = node.slots.find((s) => s.name === name2);
78271
+ if (!existing) {
78272
+ node.slots.push({ name: name2, label: (col.label || col.prop || name2) + " 编辑", children: [] });
78273
+ } else {
78274
+ existing.label = (col.label || col.prop || name2) + " 编辑";
78275
+ }
78276
+ });
78277
+ }
78278
+ watch(
78279
+ () => {
78280
+ var _a2, _b2, _c;
78281
+ return (_c = (_b2 = (_a2 = currSelectItem.value) == null ? void 0 : _a2.config) == null ? void 0 : _b2.baseConfig) == null ? void 0 : _c.columns;
78282
+ },
78283
+ (columns) => {
78284
+ var _a2;
78285
+ if (!currSelectItem.value) return;
78286
+ if (!Array.isArray(columns) && !((_a2 = currSelectItem.value.slots) == null ? void 0 : _a2.some((s) => s.name.startsWith("edit-")))) return;
78287
+ syncColumnEditSlots(currSelectItem.value, Array.isArray(columns) ? columns : []);
78288
+ },
78289
+ { deep: true, immediate: true }
78290
+ );
78197
78291
  const allFormFields = computed(() => {
78198
78292
  const result = [];
78199
78293
  function collect(items, containerPath = [], containerKeyNames = []) {
@@ -79345,7 +79439,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
79345
79439
  };
79346
79440
  }
79347
79441
  });
79348
- const DesignerView = /* @__PURE__ */ _export_sfc$1(_sfc_main$u, [["__scopeId", "data-v-9713d6b4"]]);
79442
+ const DesignerView = /* @__PURE__ */ _export_sfc$1(_sfc_main$u, [["__scopeId", "data-v-0ac944a4"]]);
79349
79443
  const ElsDesignerView = withInstall$1(DesignerView);
79350
79444
  (function(Prism2) {
79351
79445
  var string = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
@@ -80084,31 +80178,31 @@ let AceEditor$1 = class AceEditor extends TBaseFormItem {
80084
80178
  __publicField(this, "editor", ref());
80085
80179
  onMounted(() => {
80086
80180
  if (props2.language === "json") {
80087
- const currModule = import("./mode-json-CU5fqs_U.js").then((n) => n.m);
80181
+ const currModule = import("./mode-json-B_NJTBHQ.js").then((n) => n.m);
80088
80182
  currModule.then((res) => {
80089
80183
  ace.config.setModuleUrl("ace/mode/json", res);
80090
80184
  this.init();
80091
80185
  });
80092
80186
  } else if (props2.language === "javascript") {
80093
- const currModule = import("./mode-javascript-CtvBeQM5.js").then((n) => n.m);
80187
+ const currModule = import("./mode-javascript-CSfydrrh.js").then((n) => n.m);
80094
80188
  currModule.then((res) => {
80095
80189
  ace.config.setModuleUrl("ace/mode/javascript", res);
80096
80190
  this.init();
80097
80191
  });
80098
80192
  } else if (props2.language === "csharp") {
80099
- const currModule = import("./mode-csharp-D18rCWw2.js").then((n) => n.m);
80193
+ const currModule = import("./mode-csharp-DXVk2zCh.js").then((n) => n.m);
80100
80194
  currModule.then((res) => {
80101
80195
  ace.config.setModuleUrl("ace/mode/csharp", res);
80102
80196
  this.init();
80103
80197
  });
80104
80198
  } else if (props2.language === "mysql") {
80105
- const currModule = import("./mode-mysql-BucGANuW.js").then((n) => n.m);
80199
+ const currModule = import("./mode-mysql-CMcGiMki.js").then((n) => n.m);
80106
80200
  currModule.then((res) => {
80107
80201
  ace.config.setModuleUrl("ace/mode/mysql", res);
80108
80202
  this.init();
80109
80203
  });
80110
80204
  } else if (props2.language === "css") {
80111
- const currModule = import("./mode-css-ClMCyVMY.js").then((n) => n.m);
80205
+ const currModule = import("./mode-css-CinEu5kF.js").then((n) => n.m);
80112
80206
  currModule.then((res) => {
80113
80207
  ace.config.setModuleUrl("ace/mode/css", res);
80114
80208
  this.init();