element-less 0.0.56 → 0.0.58

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 (28) hide show
  1. package/custom/dynamic/designerView/index.d.ts +7 -0
  2. package/custom/dynamic/designerView/src/designerView.d.ts +1 -0
  3. package/custom/dynamic/designerView/src/designerView.vue.d.ts +3 -0
  4. package/custom/mdEditor/index.d.ts +7 -0
  5. package/custom/mdEditor/src/mdEditor.vue.d.ts +3 -0
  6. package/element-less.cjs +1 -1
  7. package/element-less.iife.js +1 -1
  8. package/element-less.js +1 -1
  9. package/element-less.umd.cjs +1 -1
  10. package/{index-2Bv7b5DP.js → index-B9qiqB6F.js} +61 -36
  11. package/index-f9PH8X96.cjs +1 -0
  12. package/{inner-Co-EBslN.cjs → inner-CJk_cUek.cjs} +1 -1
  13. package/{inner-YAACwdSB.js → inner-DC3HuEGj.js} +1 -1
  14. package/{innerItem-DUKhrCqv.cjs → innerItem-BXsRQFt7.cjs} +1 -1
  15. package/{innerItem-CnFsIpmO.js → innerItem-CTrYIpuO.js} +1 -1
  16. package/{mode-csharp-C1pDB4Xs.js → mode-csharp-CwcOyXKy.js} +1 -1
  17. package/{mode-csharp-B4dXOitJ.cjs → mode-csharp-DmoS0vSk.cjs} +1 -1
  18. package/{mode-css-DHYwb__9.js → mode-css-CHl48gOd.js} +1 -1
  19. package/{mode-css-BIt_d2L7.cjs → mode-css-Cnlf5axu.cjs} +1 -1
  20. package/{mode-javascript-D8Gt8Zho.cjs → mode-javascript-CwxpNhdj.cjs} +1 -1
  21. package/{mode-javascript-BVS0PFpM.js → mode-javascript-Et04sCwF.js} +1 -1
  22. package/{mode-json-BoxRotGl.js → mode-json-5nW-N-W2.js} +1 -1
  23. package/{mode-json-DmFbbAPv.cjs → mode-json-BlmUNunx.cjs} +1 -1
  24. package/{mode-mysql-KyUsrQNc.js → mode-mysql-CLlaYr22.js} +1 -1
  25. package/{mode-mysql-C0U6L5uL.cjs → mode-mysql-bOOcXSdt.cjs} +1 -1
  26. package/package.json +1 -1
  27. package/style.css +1 -1
  28. package/index-RWIh1MgW.cjs +0 -1
@@ -6959,6 +6959,7 @@ class Input extends TBaseFormItem {
6959
6959
  currValue = currValue.trim();
6960
6960
  }
6961
6961
  this._returnModelValue(currValue);
6962
+ this._defaultEmits("input", currValue);
6962
6963
  }
6963
6964
  mobileRender() {
6964
6965
  const inputPlaceholder = this._props.placeholder || "请输入" + (this._props.label ?? "");
@@ -71312,7 +71313,7 @@ const _sfc_main$1l = /* @__PURE__ */ defineComponent({
71312
71313
  emits: /* @__PURE__ */ mergeModels(["removeItem"], ["update:children"]),
71313
71314
  setup(__props, { emit: __emit }) {
71314
71315
  const DynamicDesignerInnerItem = defineAsyncComponent(() => {
71315
- return import("./innerItem-CnFsIpmO.js");
71316
+ return import("./innerItem-CTrYIpuO.js");
71316
71317
  });
71317
71318
  const { getValue: getValue2 } = useProps();
71318
71319
  const tagID = getValue2("tagID");
@@ -72162,10 +72163,10 @@ const _sfc_main$1j = /* @__PURE__ */ defineComponent({
72162
72163
  emits: ["update:modelValue"],
72163
72164
  setup(__props, { expose: __expose, emit: __emit }) {
72164
72165
  const DynamicRenderInner = defineAsyncComponent(() => {
72165
- return import("./inner-YAACwdSB.js").then((n) => n.i);
72166
+ return import("./inner-DC3HuEGj.js").then((n) => n.i);
72166
72167
  });
72167
72168
  const DynamicRenderForm = defineAsyncComponent(() => {
72168
- return import("./inner-YAACwdSB.js").then((n) => n.f);
72169
+ return import("./inner-DC3HuEGj.js").then((n) => n.f);
72169
72170
  });
72170
72171
  const props2 = __props;
72171
72172
  const { getValue: getValue2, setValue, formNodeProps } = useProps(props2);
@@ -72395,10 +72396,10 @@ const _sfc_main$1i = /* @__PURE__ */ defineComponent({
72395
72396
  emits: ["update:modelValue"],
72396
72397
  setup(__props, { expose: __expose, emit: __emit }) {
72397
72398
  const DynamicRenderInnerAsync = defineAsyncComponent(() => {
72398
- return import("./inner-YAACwdSB.js").then((n) => n.i);
72399
+ return import("./inner-DC3HuEGj.js").then((n) => n.i);
72399
72400
  });
72400
72401
  const DynamicRenderFormAsync = defineAsyncComponent(() => {
72401
- return import("./inner-YAACwdSB.js").then((n) => n.f);
72402
+ return import("./inner-DC3HuEGj.js").then((n) => n.f);
72402
72403
  });
72403
72404
  const props2 = __props;
72404
72405
  const { getValue: getValue2, setValue, formNodeProps } = useProps(props2);
@@ -73770,6 +73771,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
73770
73771
  const getDataTypeData = getValue2("getDataTypeData");
73771
73772
  const validationCode = getValue2("validationCode");
73772
73773
  const camelCase = getValue2("camelCase", false);
73774
+ const nameEqualsCode = getValue2("nameEqualsCode", false);
73773
73775
  const currSelectItem = useModel$1(__props, "nodeItem");
73774
73776
  const dataTypeData = computed(() => {
73775
73777
  return getDataTypeData(currSelectItem.value.componentType);
@@ -73785,6 +73787,14 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
73785
73787
  currSelectItem.value.keyCode = keyCode.replace(keyCode[0], keyCode[0].toLowerCase());
73786
73788
  }
73787
73789
  }
73790
+ watch(() => {
73791
+ var _a;
73792
+ return (_a = currSelectItem.value) == null ? void 0 : _a.keyCode;
73793
+ }, (keyCode) => {
73794
+ if (nameEqualsCode && keyCode !== void 0) {
73795
+ currSelectItem.value.keyName = keyCode;
73796
+ }
73797
+ });
73788
73798
  watchEffect(() => {
73789
73799
  const dataType = currSelectItem.value.dataType === "Array" ? currSelectItem.value.arrayDataType : currSelectItem.value.dataType;
73790
73800
  const componentTypeName = currSelectItem.value.componentTypeName;
@@ -73829,7 +73839,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
73829
73839
  ]),
73830
73840
  _: 1
73831
73841
  }),
73832
- currSelectItem.value.componentGroup === "Form" ? (openBlock(), createBlock(_component_els_input, {
73842
+ currSelectItem.value.componentGroup === "Form" && !unref(nameEqualsCode) ? (openBlock(), createBlock(_component_els_input, {
73833
73843
  key: 0,
73834
73844
  label: "名称",
73835
73845
  prop: "keyName"
@@ -73932,7 +73942,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
73932
73942
  };
73933
73943
  }
73934
73944
  });
73935
- const DynamicDesignerViewBaseSetting = /* @__PURE__ */ _export_sfc$1(_sfc_main$C, [["__scopeId", "data-v-a083f6db"]]);
73945
+ const DynamicDesignerViewBaseSetting = /* @__PURE__ */ _export_sfc$1(_sfc_main$C, [["__scopeId", "data-v-b92b2bc9"]]);
73936
73946
  function useDesigner(props2, nodeItem) {
73937
73947
  return useRender(props2, nodeItem, void 0, void 0, true);
73938
73948
  }
@@ -75090,7 +75100,11 @@ const designerViewProps = buildProps({
75090
75100
  rightToolbar: {
75091
75101
  type: Array,
75092
75102
  default: ["base", "component", "array", "form", "advanced"]
75093
- }
75103
+ },
75104
+ /**
75105
+ * @description 名称自动等于字段名,启用后无需单独填写名称,简化配置
75106
+ */
75107
+ nameEqualsCode: Boolean
75094
75108
  });
75095
75109
  const useDesign = defineStore("dynamic-design", () => {
75096
75110
  const queue = ref([]);
@@ -75228,9 +75242,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
75228
75242
  const componentData = getValue2("componentData");
75229
75243
  const mainInner = ref();
75230
75244
  const designer = ref();
75231
- const asideHeight = ref();
75232
75245
  const mainHeight = ref();
75233
- const mainEmptyHeight = ref();
75234
75246
  const mainZoom = ref(1);
75235
75247
  const selectProperty = ref("0");
75236
75248
  const currDynamicDataType = ref([]);
@@ -75501,6 +75513,9 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
75501
75513
  } else {
75502
75514
  item.keyCode = "";
75503
75515
  }
75516
+ if (props2.nameEqualsCode) {
75517
+ item.keyName = item.keyCode;
75518
+ }
75504
75519
  return item;
75505
75520
  }
75506
75521
  function handleMove(e) {
@@ -75783,16 +75798,12 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
75783
75798
  handlePasteGetNode();
75784
75799
  }
75785
75800
  }
75786
- onMounted(() => {
75787
- var _a2, _b2;
75788
- asideHeight.value = ((_a2 = props2.height) == null ? void 0 : _a2.appendPx()) || "calc(100vh - 102px)";
75789
- mainHeight.value = ((_b2 = props2.height) == null ? void 0 : _b2.appendPx()) || "calc(100vh - 102px)";
75790
- if (props2.height && props2.height.indexOf("vh") > -1) {
75791
- mainEmptyHeight.value = parseInt(props2.height.replace("vh", "")) / 2 + "vh";
75792
- } else {
75793
- mainEmptyHeight.value = props2.height ? (props2.height.toInt() / 2).appendPx() : "158px";
75794
- }
75795
- });
75801
+ function updateHeights() {
75802
+ var _a2;
75803
+ mainHeight.value = ((_a2 = props2.height) == null ? void 0 : _a2.appendPx()) || "calc(100vh - 102px)";
75804
+ }
75805
+ onMounted(updateHeights);
75806
+ watch(() => props2.height, updateHeights);
75796
75807
  __expose({
75797
75808
  initData,
75798
75809
  importDesigner
@@ -75831,7 +75842,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
75831
75842
  createElementVNode("div", mergeProps({
75832
75843
  ref_key: "designer",
75833
75844
  ref: designer,
75834
- style: `--mainEmptyHeight:${mainEmptyHeight.value};--mainHeight:${mainHeight.value};--asideHeight:${asideHeight.value};--leftWidth:${_ctx.leftWidth.appendPx()};--rightWidth:${_ctx.rightWidth.appendPx()}`
75845
+ style: `--mainHeight:${mainHeight.value};--leftWidth:${_ctx.leftWidth.appendPx()};--rightWidth:${_ctx.rightWidth.appendPx()}`
75835
75846
  }, unref(attrs)), [
75836
75847
  createVNode(_component_ElsFormNode, normalizeProps(guardReactiveProps(unref(formNodeProps))), {
75837
75848
  default: withCtx(() => [
@@ -75851,7 +75862,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
75851
75862
  }, {
75852
75863
  default: withCtx(() => [
75853
75864
  createVNode(_component_ElScrollbar, {
75854
- style: { "height": "var(--asideHeight)" },
75865
+ style: { "height": "var(--mainHeight)" },
75855
75866
  ref: "scroll"
75856
75867
  }, {
75857
75868
  default: withCtx(() => [
@@ -75892,7 +75903,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
75892
75903
  createVNode(_component_el_tab_pane, { label: _ctx.filterComponentTitle }, {
75893
75904
  default: withCtx(() => [
75894
75905
  createVNode(_component_ElScrollbar, {
75895
- style: { "height": "var(--asideHeight)" },
75906
+ style: { "height": "var(--mainHeight)" },
75896
75907
  ref: "scroll"
75897
75908
  }, {
75898
75909
  default: withCtx(() => [
@@ -75938,7 +75949,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
75938
75949
  createVNode(_component_el_tab_pane, { label: "表单组件" }, {
75939
75950
  default: withCtx(() => [
75940
75951
  createVNode(_component_ElScrollbar, {
75941
- style: { "height": "var(--asideHeight)" },
75952
+ style: { "height": "var(--mainHeight)" },
75942
75953
  ref: "scroll"
75943
75954
  }, {
75944
75955
  default: withCtx(() => [
@@ -76051,7 +76062,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
76051
76062
  createVNode(_component_el_tab_pane, { label: "展示组件" }, {
76052
76063
  default: withCtx(() => [
76053
76064
  createVNode(_component_ElScrollbar, {
76054
- style: { "height": "var(--asideHeight)" },
76065
+ style: { "height": "var(--mainHeight)" },
76055
76066
  ref: "scroll"
76056
76067
  }, {
76057
76068
  default: withCtx(() => [
@@ -76383,7 +76394,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
76383
76394
  }, {
76384
76395
  default: withCtx(() => [
76385
76396
  createVNode(_component_ElScrollbar, {
76386
- style: { "height": "var(--asideHeight)" },
76397
+ style: { "height": "var(--mainHeight)" },
76387
76398
  ref: "scroll"
76388
76399
  }, {
76389
76400
  default: withCtx(() => [
@@ -76402,7 +76413,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
76402
76413
  default: withCtx(() => [
76403
76414
  selectProperty.value === "component" ? (openBlock(), createBlock(_component_ElScrollbar, {
76404
76415
  key: 0,
76405
- style: { "height": "var(--asideHeight)" },
76416
+ style: { "height": "var(--mainHeight)" },
76406
76417
  ref: "scroll"
76407
76418
  }, {
76408
76419
  default: withCtx(() => [
@@ -76429,7 +76440,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
76429
76440
  default: withCtx(() => [
76430
76441
  selectProperty.value === "array" && !_ctx.rightToolbar || _ctx.rightToolbar.includes("array") ? (openBlock(), createBlock(_component_ElScrollbar, {
76431
76442
  key: 0,
76432
- style: { "height": "var(--asideHeight)" },
76443
+ style: { "height": "var(--mainHeight)" },
76433
76444
  ref: "scroll"
76434
76445
  }, {
76435
76446
  default: withCtx(() => [
@@ -76454,7 +76465,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
76454
76465
  }, {
76455
76466
  default: withCtx(() => [
76456
76467
  createVNode(_component_ElScrollbar, {
76457
- style: { "height": "var(--asideHeight)" },
76468
+ style: { "height": "var(--mainHeight)" },
76458
76469
  ref: "scroll"
76459
76470
  }, {
76460
76471
  default: withCtx(() => [
@@ -76480,7 +76491,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
76480
76491
  default: withCtx(() => [
76481
76492
  selectProperty.value === "advanced" ? (openBlock(), createBlock(_component_ElScrollbar, {
76482
76493
  key: 0,
76483
- style: { "height": "var(--asideHeight)" },
76494
+ style: { "height": "var(--mainHeight)" },
76484
76495
  ref: "scroll"
76485
76496
  }, {
76486
76497
  default: withCtx(() => [
@@ -76650,7 +76661,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
76650
76661
  };
76651
76662
  }
76652
76663
  });
76653
- const DesignerView = /* @__PURE__ */ _export_sfc$1(_sfc_main$u, [["__scopeId", "data-v-94fa0db4"]]);
76664
+ const DesignerView = /* @__PURE__ */ _export_sfc$1(_sfc_main$u, [["__scopeId", "data-v-1d84974e"]]);
76654
76665
  const ElsDesignerView = withInstall(DesignerView);
76655
76666
  (function(Prism2) {
76656
76667
  var string = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
@@ -77389,31 +77400,31 @@ let AceEditor$1 = class AceEditor extends TBaseFormItem {
77389
77400
  __publicField(this, "editor", ref());
77390
77401
  onMounted(() => {
77391
77402
  if (props2.language === "json") {
77392
- const currModule = import("./mode-json-BoxRotGl.js").then((n) => n.m);
77403
+ const currModule = import("./mode-json-5nW-N-W2.js").then((n) => n.m);
77393
77404
  currModule.then((res) => {
77394
77405
  ace.config.setModuleUrl("ace/mode/json", res);
77395
77406
  this.init();
77396
77407
  });
77397
77408
  } else if (props2.language === "javascript") {
77398
- const currModule = import("./mode-javascript-BVS0PFpM.js").then((n) => n.m);
77409
+ const currModule = import("./mode-javascript-Et04sCwF.js").then((n) => n.m);
77399
77410
  currModule.then((res) => {
77400
77411
  ace.config.setModuleUrl("ace/mode/javascript", res);
77401
77412
  this.init();
77402
77413
  });
77403
77414
  } else if (props2.language === "csharp") {
77404
- const currModule = import("./mode-csharp-C1pDB4Xs.js").then((n) => n.m);
77415
+ const currModule = import("./mode-csharp-CwcOyXKy.js").then((n) => n.m);
77405
77416
  currModule.then((res) => {
77406
77417
  ace.config.setModuleUrl("ace/mode/csharp", res);
77407
77418
  this.init();
77408
77419
  });
77409
77420
  } else if (props2.language === "mysql") {
77410
- const currModule = import("./mode-mysql-KyUsrQNc.js").then((n) => n.m);
77421
+ const currModule = import("./mode-mysql-CLlaYr22.js").then((n) => n.m);
77411
77422
  currModule.then((res) => {
77412
77423
  ace.config.setModuleUrl("ace/mode/mysql", res);
77413
77424
  this.init();
77414
77425
  });
77415
77426
  } else if (props2.language === "css") {
77416
- const currModule = import("./mode-css-DHYwb__9.js").then((n) => n.m);
77427
+ const currModule = import("./mode-css-CHl48gOd.js").then((n) => n.m);
77417
77428
  currModule.then((res) => {
77418
77429
  ace.config.setModuleUrl("ace/mode/css", res);
77419
77430
  this.init();
@@ -77521,6 +77532,13 @@ const mdEditorProps = buildProps({
77521
77532
  type: String,
77522
77533
  default: "jpeg,gif,bmp,jpg,png,svga,svg,webp,bundle,tif,pag"
77523
77534
  },
77535
+ /**
77536
+ * @description 简单模式,只显示基础工具栏
77537
+ */
77538
+ simple: {
77539
+ type: Boolean,
77540
+ default: false
77541
+ },
77524
77542
  /**
77525
77543
  * @description 验证触发类型 默认change
77526
77544
  */
@@ -77570,9 +77588,16 @@ class MdEditor extends TBaseFormItem {
77570
77588
  }
77571
77589
  }
77572
77590
  pcRender() {
77591
+ const toCssSize = (val) => /^\d+$/.test(val) ? `${val}px` : val;
77592
+ const simpleToolbars = ["bold", "italic", "underline", "-", "title", "quote", "unorderedList", "orderedList", "-", "link", "image", "=", "preview"];
77573
77593
  return createVNode(Fragment$1, null, [createVNode("div", {
77574
77594
  "class": "els-jsoneditor"
77575
77595
  }, [createVNode(MdEditor$1, {
77596
+ "style": {
77597
+ height: toCssSize(this._props.height),
77598
+ width: toCssSize(this._props.width)
77599
+ },
77600
+ "toolbars": this._props.simple ? simpleToolbars : void 0,
77576
77601
  "modelValue": this._comValue.value,
77577
77602
  "onUpdate:modelValue": ($event) => this._comValue.value = $event,
77578
77603
  "onHtmlChanged": this.returnHtml,