@tmagic/editor 1.2.14 → 1.2.15

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.
@@ -1839,7 +1839,7 @@
1839
1839
  };
1840
1840
  }
1841
1841
  async createId(type) {
1842
- return `${type}_${this.guid()}`;
1842
+ return `${type}_${utils.guid()}`;
1843
1843
  }
1844
1844
  /**
1845
1845
  * 将组件与组件的子元素配置中的id都设置成一个新的ID
@@ -1882,18 +1882,6 @@
1882
1882
  this.removeAllListeners();
1883
1883
  this.removeAllPlugins();
1884
1884
  }
1885
- /**
1886
- * 生成指定位数的GUID,无【-】格式
1887
- * @param digit 位数,默认值8
1888
- * @returns
1889
- */
1890
- guid(digit = 8) {
1891
- return "x".repeat(digit).replace(/[xy]/g, (c) => {
1892
- const r = Math.random() * 16 | 0;
1893
- const v = c === "x" ? r : r & 3 | 8;
1894
- return v.toString(16);
1895
- });
1896
- }
1897
1885
  }
1898
1886
  const propsService = new Props();
1899
1887
 
@@ -3437,9 +3425,18 @@
3437
3425
  size: "small",
3438
3426
  placeholder: "输入关键字进行过滤",
3439
3427
  clearable: "",
3440
- "prefix-icon": vue.unref(iconsVue.Search),
3441
3428
  onInput: filterTextChangeHandler
3442
- }, null, 8, ["modelValue", "prefix-icon"]);
3429
+ }, {
3430
+ prefix: vue.withCtx(() => [
3431
+ vue.createVNode(vue.unref(design.TMagicIcon), null, {
3432
+ default: vue.withCtx(() => [
3433
+ vue.createVNode(vue.unref(iconsVue.Search))
3434
+ ]),
3435
+ _: 1
3436
+ })
3437
+ ]),
3438
+ _: 1
3439
+ }, 8, ["modelValue"]);
3443
3440
  };
3444
3441
  }
3445
3442
  });
@@ -3454,11 +3451,7 @@
3454
3451
 
3455
3452
  const _sfc_main$j = {};
3456
3453
 
3457
- const _hoisted_1$b = {
3458
- width: "16px",
3459
- height: "16px",
3460
- xmlns: "http://www.w3.org/2000/svg"
3461
- };
3454
+ const _hoisted_1$b = { xmlns: "http://www.w3.org/2000/svg" };
3462
3455
  const _hoisted_2$6 = /*#__PURE__*/vue.createElementVNode("g", {
3463
3456
  fill: "#7C878E",
3464
3457
  "fill-rule": "evenodd"
@@ -3481,20 +3474,18 @@
3481
3474
  const _sfc_main$i = {};
3482
3475
 
3483
3476
  const _hoisted_1$a = {
3484
- width: "32px",
3485
- height: "32px",
3486
3477
  viewBox: "0 0 32 32",
3487
3478
  version: "1.1",
3488
3479
  xmlns: "http://www.w3.org/2000/svg",
3489
3480
  "xmlns:xlink": "http://www.w3.org/1999/xlink"
3490
3481
  };
3491
- const _hoisted_2$5 = /*#__PURE__*/vue.createStaticVNode("<title>gsd-icon-line-Universal-code</title><desc>Created with Sketch.</desc><defs><rect id=\"path-1\" x=\"0\" y=\"0\" width=\"32\" height=\"32\"></rect></defs><g id=\"组件规范\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\"><g id=\"03图标\" transform=\"translate(-561.000000, -2356.000000)\"><g id=\"icon/line/Universal/code\" transform=\"translate(561.000000, 2356.000000)\"><g id=\"路径\"><mask id=\"mask-2\" fill=\"white\"><use xlink:href=\"#path-1\"></use></mask><use id=\"蒙版\" fill=\"#D8D8D8\" opacity=\"0\" xlink:href=\"#path-1\"></use><path d=\"M21.9284587,7.9482233 L29.8079004,15.827665 C29.9055315,15.9252961 29.9055315,16.0835874 29.8079004,16.1812184 L21.9284587,24.0606602 C21.8308276,24.1582912 21.6725364,24.1582912 21.5749053,24.0606602 L20.3374684,22.8232233 C20.2419143,22.7276698 20.2398813,22.5740096 20.331369,22.4759832 L20.3374687,22.4696702 L26.8027181,16.0044417 L20.3374687,9.53921328 C20.2398372,9.44158265 20.2398369,9.2832914 20.3374679,9.18566017 L21.5749053,7.9482233 C21.6725364,7.85059223 21.8308276,7.85059223 21.9284587,7.9482233 Z M10.3999684,7.9482233 L11.6374053,9.18566017 C11.7329594,9.28121371 11.7349925,9.43487387 11.6435048,9.53290029 L11.637405,9.53921328 L5.17215562,16.0044417 L11.637405,22.4696702 C11.7329593,22.5652236 11.7349926,22.7188837 11.643505,22.8169103 L11.6374053,22.8232233 L10.3999684,24.0606602 C10.3023374,24.1582912 10.1440461,24.1582912 10.046415,24.0606602 L2.1669733,16.1812184 C2.06934223,16.0835874 2.06934223,15.9252961 2.1669733,15.827665 L10.046415,7.9482233 C10.1440461,7.85059223 10.3023374,7.85059223 10.3999684,7.9482233 Z M17.2612532,9.29310422 L18.9262468,9.83189578 C19.0576112,9.87440526 19.1296423,10.0153579 19.0871328,10.1467222 L15.0848232,22.514807 C15.0423138,22.6461714 14.9013612,22.7182025 14.7699968,22.675693 L13.1050032,22.1369014 C12.9736388,22.0943919 12.9016077,21.9534393 12.9441172,21.822075 L16.9464268,9.45399022 C16.9889362,9.32262585 17.1298888,9.25059474 17.2612532,9.29310422 Z\" id=\"形状\" fill=\"#1D1F24\" mask=\"url(#mask-2)\"></path></g></g><g id=\"icon切图\" transform=\"translate(226.000000, 1782.000000)\"></g></g></g>", 4);
3492
- const _hoisted_6 = [
3482
+ const _hoisted_2$5 = /*#__PURE__*/vue.createStaticVNode("<defs><rect id=\"path-1\" x=\"0\" y=\"0\" width=\"32\" height=\"32\"></rect></defs><g id=\"组件规范\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\"><g id=\"03图标\" transform=\"translate(-561.000000, -2356.000000)\"><g id=\"icon/line/Universal/code\" transform=\"translate(561.000000, 2356.000000)\"><g id=\"路径\"><mask id=\"mask-2\" fill=\"white\"><use xlink:href=\"#path-1\"></use></mask><use id=\"蒙版\" fill=\"#D8D8D8\" opacity=\"0\" xlink:href=\"#path-1\"></use><path d=\"M21.9284587,7.9482233 L29.8079004,15.827665 C29.9055315,15.9252961 29.9055315,16.0835874 29.8079004,16.1812184 L21.9284587,24.0606602 C21.8308276,24.1582912 21.6725364,24.1582912 21.5749053,24.0606602 L20.3374684,22.8232233 C20.2419143,22.7276698 20.2398813,22.5740096 20.331369,22.4759832 L20.3374687,22.4696702 L26.8027181,16.0044417 L20.3374687,9.53921328 C20.2398372,9.44158265 20.2398369,9.2832914 20.3374679,9.18566017 L21.5749053,7.9482233 C21.6725364,7.85059223 21.8308276,7.85059223 21.9284587,7.9482233 Z M10.3999684,7.9482233 L11.6374053,9.18566017 C11.7329594,9.28121371 11.7349925,9.43487387 11.6435048,9.53290029 L11.637405,9.53921328 L5.17215562,16.0044417 L11.637405,22.4696702 C11.7329593,22.5652236 11.7349926,22.7188837 11.643505,22.8169103 L11.6374053,22.8232233 L10.3999684,24.0606602 C10.3023374,24.1582912 10.1440461,24.1582912 10.046415,24.0606602 L2.1669733,16.1812184 C2.06934223,16.0835874 2.06934223,15.9252961 2.1669733,15.827665 L10.046415,7.9482233 C10.1440461,7.85059223 10.3023374,7.85059223 10.3999684,7.9482233 Z M17.2612532,9.29310422 L18.9262468,9.83189578 C19.0576112,9.87440526 19.1296423,10.0153579 19.0871328,10.1467222 L15.0848232,22.514807 C15.0423138,22.6461714 14.9013612,22.7182025 14.7699968,22.675693 L13.1050032,22.1369014 C12.9736388,22.0943919 12.9016077,21.9534393 12.9441172,21.822075 L16.9464268,9.45399022 C16.9889362,9.32262585 17.1298888,9.25059474 17.2612532,9.29310422 Z\" id=\"形状\" fill=\"#1D1F24\" mask=\"url(#mask-2)\"></path></g></g><g id=\"icon切图\" transform=\"translate(226.000000, 1782.000000)\"></g></g></g>", 2);
3483
+ const _hoisted_4$3 = [
3493
3484
  _hoisted_2$5
3494
3485
  ];
3495
3486
 
3496
3487
  function _sfc_render$1(_ctx, _cache) {
3497
- return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$a, _hoisted_6))
3488
+ return (vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$a, _hoisted_4$3))
3498
3489
  }
3499
3490
  const CodeIcon = /*#__PURE__*/_export_sfc(_sfc_main$i, [['render',_sfc_render$1]]);
3500
3491
 
@@ -3924,7 +3915,7 @@
3924
3915
  }
3925
3916
  });
3926
3917
 
3927
- const _hoisted_1$6 = { class: "code-header-wrapper" };
3918
+ const _hoisted_1$6 = { class: "search-wrapper" };
3928
3919
  const _hoisted_2$2 = /* @__PURE__ */ vue.createTextVNode("新增");
3929
3920
  const _hoisted_3 = ["id"];
3930
3921
  const _hoisted_4 = { class: "list-item" };
@@ -4020,7 +4011,7 @@
4020
4011
  }
4021
4012
  };
4022
4013
  return (_ctx, _cache) => {
4023
- return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicScrollbar), { class: "m-editor-code-block-list" }, {
4014
+ return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicScrollbar), { class: "m-editor-code-block-list m-editor-dep-list-panel" }, {
4024
4015
  default: vue.withCtx(() => [
4025
4016
  vue.renderSlot(_ctx.$slots, "code-block-panel-header", {}, () => [
4026
4017
  vue.createElementVNode("div", _hoisted_1$6, [
@@ -4067,8 +4058,8 @@
4067
4058
  class: "compIcon"
4068
4059
  })) : vue.createCommentVNode("", true),
4069
4060
  vue.createElementVNode("span", {
4070
- class: vue.normalizeClass(["code-name", { code: data.type === "code", hook: data.type === "key" }])
4071
- }, vue.toDisplayString(data.name) + "" + vue.toDisplayString(data.id) + "", 3),
4061
+ class: vue.normalizeClass(["name", { code: data.type === "code", hook: data.type === "key" }])
4062
+ }, vue.toDisplayString(data.name) + " (" + vue.toDisplayString(data.id) + ")", 3),
4072
4063
  data.type === "code" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [
4073
4064
  vue.createVNode(vue.unref(design.TMagicTooltip), {
4074
4065
  effect: "dark",
@@ -4757,7 +4748,8 @@
4757
4748
  },
4758
4749
  setup(__props, { expose }) {
4759
4750
  const props = __props;
4760
- const uiComponent = design.getConfig("components").tabPane;
4751
+ const tabPaneComponent = design.getConfig("components").tabPane;
4752
+ const tabsComponent = design.getConfig("components").tabs;
4761
4753
  const activeTabName = vue.ref(props.data?.status);
4762
4754
  const getItemConfig = (data) => {
4763
4755
  const map = {
@@ -4802,20 +4794,17 @@
4802
4794
  activeTabName
4803
4795
  });
4804
4796
  return (_ctx, _cache) => {
4805
- return __props.data.type === "tabs" && __props.data.items.length ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTabs), {
4797
+ return __props.data.type === "tabs" && __props.data.items.length ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(tabsComponent).component), vue.mergeProps({
4806
4798
  key: 0,
4807
- class: "m-editor-sidebar",
4808
4799
  modelValue: activeTabName.value,
4809
4800
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => activeTabName.value = $event),
4810
- type: "card",
4811
- "tab-position": "left"
4812
- }, {
4801
+ class: "m-editor-sidebar tmagic-design-tabs"
4802
+ }, vue.unref(tabsComponent).props({ type: "card", tabPosition: "left" })), {
4813
4803
  default: vue.withCtx(() => [
4814
4804
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(sideBarItems), (config, index) => {
4815
- return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(uiComponent).component), {
4816
- key: config.$key || index,
4817
- name: config.text
4818
- }, {
4805
+ return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(tabPaneComponent).component), vue.mergeProps(vue.unref(tabPaneComponent).props({ name: config.text }), {
4806
+ key: config.$key || index
4807
+ }), {
4819
4808
  label: vue.withCtx(() => [
4820
4809
  (vue.openBlock(), vue.createElementBlock("div", {
4821
4810
  key: config.text
@@ -4895,11 +4884,11 @@
4895
4884
  ]), 1040)) : vue.createCommentVNode("", true)
4896
4885
  ]),
4897
4886
  _: 2
4898
- }, 1032, ["name"]);
4887
+ }, 1040);
4899
4888
  }), 128))
4900
4889
  ]),
4901
4890
  _: 3
4902
- }, 8, ["modelValue"])) : vue.createCommentVNode("", true);
4891
+ }, 16, ["modelValue"])) : vue.createCommentVNode("", true);
4903
4892
  };
4904
4893
  }
4905
4894
  });