@zhangqingcq/vgce 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. package/README.md +35 -20
  2. package/dist/style.css +1 -1
  3. package/dist/vgce.js +147 -51
  4. package/dist/vgce.umd.cjs +2 -2
  5. package/package.json +1 -1
  6. package/src/assets/svgs/text-box.svg +1 -0
  7. package/src/config/files/text-box.vue +72 -0
  8. package/src/config/index.ts +5 -3
  9. package/src/config/svg/animation/index.ts +3 -2
  10. package/src/config/svg/animation/thermometer.ts +2 -1
  11. package/src/config/svg/custom/clock-a.ts +2 -1
  12. package/src/config/svg/custom/index.ts +6 -5
  13. package/src/config/svg/custom/light.ts +2 -1
  14. package/src/config/svg/custom/svg-text.ts +2 -1
  15. package/src/config/svg/custom/switch-r.ts +2 -1
  16. package/src/config/svg/index.ts +6 -10
  17. package/src/config/svg/stateful/alert-light.ts +2 -1
  18. package/src/config/svg/stateful/index.ts +3 -2
  19. package/src/config/svg/stateless/bot-2.ts +2 -1
  20. package/src/config/svg/stateless/bot-9.ts +2 -1
  21. package/src/config/svg/stateless/hamburger.ts +2 -1
  22. package/src/config/svg/stateless/hotpot.ts +2 -1
  23. package/src/config/svg/stateless/index.ts +6 -5
  24. package/src/config/vue/component/button.ts +2 -1
  25. package/src/config/vue/component/common-table.ts +2 -1
  26. package/src/config/vue/component/index.ts +9 -7
  27. package/src/config/vue/component/now-time.ts +2 -1
  28. package/src/config/vue/component/progress.ts +2 -1
  29. package/src/config/vue/component/tag.ts +2 -1
  30. package/src/config/vue/component/text-box.ts +66 -0
  31. package/src/config/vue/echarts/index.ts +3 -2
  32. package/src/config/vue/echarts/pie-charts.ts +2 -1
  33. package/src/config/vue/index.ts +4 -3
package/dist/vgce.js CHANGED
@@ -212,7 +212,7 @@ if (typeof window < "u") {
212
212
  }
213
213
  const main = "", index$2 = "";
214
214
  var ELineBindAnchors = /* @__PURE__ */ ((r) => (r.TopCenter = "TopCenter", r.Left = "Left", r.Right = "Right", r.BottomCenter = "BottomCenter", r))(ELineBindAnchors || {}), EConfigAnimationsType = /* @__PURE__ */ ((r) => (r.None = "None", r.Electricity = "Electricity", r.WaterDrop = "WaterDrop", r.Track = "Track", r))(EConfigAnimationsType || {}), EConfigItemPropsType = /* @__PURE__ */ ((r) => (r.Input = "Input", r.Textarea = "Textarea", r.Color = "Color", r.InputNumber = "InputNumber", r.Switch = "Switch", r.JsonEdit = "JsonEdit", r.Select = "Select", r))(EConfigItemPropsType || {}), EDoneJsonType = /* @__PURE__ */ ((r) => (r.File = "File", r.StraightLine = "StraightLine", r.ConnectionLine = "ConnectionLine", r.CustomSvg = "CustomSvg", r.Vue = "Vue", r))(EDoneJsonType || {}), EEventType = /* @__PURE__ */ ((r) => (r.Click = "Click", r.Change = "Change", r.Null = "", r))(EEventType || {}), EEventAction = /* @__PURE__ */ ((r) => (r.ChangeAttr = "ChangeAttr", r.JavaScript = "JavaScript", r.Null = "", r))(EEventAction || {}), EConditionType = /* @__PURE__ */ ((r) => (r.None = "None", r.Relation = "Relation", r))(EConditionType || {}), EGlobalStoreIntention = /* @__PURE__ */ ((r) => (r.None = "None", r.Create = "Create", r.Move = "Move", r.GroupMove = "GroupMove", r.MoveCanvas = "MoveCanvas", r.Select = "Select", r.Zoom = "Zoom", r.Rotate = "Rotate", r.Connection = "Connection", r.SetConnectionLineNode = "SetConnectionLineNode", r.ContextMenu = "ContextMenu", r.SelectArea = "SelectArea", r))(EGlobalStoreIntention || {}), EMouseInfoState = /* @__PURE__ */ ((r) => (r.Down = "Down", r.Up = "Up", r))(EMouseInfoState || {}), EScaleInfoType = /* @__PURE__ */ ((r) => (r.None = "", r.TopLeft = "TopLeft", r.TopCenter = "TopCenter", r.TopRight = "TopRight", r.Left = "Left", r.Right = "Right", r.BottomLeft = "BottomLeft", r.BottomCenter = "BottomCenter", r.BottomRight = "BottomRight", r))(EScaleInfoType || {});
215
- const svg_alert_light = {
215
+ const t$p = {
216
216
  name: "alert-light",
217
217
  title: "警示灯",
218
218
  type: EDoneJsonType.File,
@@ -241,11 +241,11 @@ const svg_alert_light = {
241
241
  repeat: "infinite"
242
242
  },
243
243
  events: []
244
- }, stateful_group = {
244
+ }, t$o = {
245
245
  groupType: "stateful",
246
246
  title: "状态SVG",
247
- list: [svg_alert_light]
248
- }, svg_bot_2 = {
247
+ list: [t$p]
248
+ }, t$n = {
249
249
  name: "bot-2",
250
250
  title: "2号机",
251
251
  type: EDoneJsonType.File,
@@ -274,7 +274,7 @@ const svg_alert_light = {
274
274
  repeat: "infinite"
275
275
  },
276
276
  events: []
277
- }, svg_bot_9 = {
277
+ }, t$m = {
278
278
  name: "bot-9",
279
279
  title: "9号机",
280
280
  type: EDoneJsonType.File,
@@ -292,7 +292,7 @@ const svg_alert_light = {
292
292
  repeat: "infinite"
293
293
  },
294
294
  events: []
295
- }, svg_hotpot = {
295
+ }, t$l = {
296
296
  name: "hotpot",
297
297
  title: "火锅",
298
298
  type: EDoneJsonType.File,
@@ -310,7 +310,7 @@ const svg_alert_light = {
310
310
  repeat: "infinite"
311
311
  },
312
312
  events: []
313
- }, svg_hamburger = {
313
+ }, t$k = {
314
314
  name: "hamburger",
315
315
  title: "汉堡",
316
316
  type: EDoneJsonType.File,
@@ -328,11 +328,11 @@ const svg_alert_light = {
328
328
  repeat: "infinite"
329
329
  },
330
330
  events: []
331
- }, stateless_group = {
331
+ }, t$j = {
332
332
  groupType: "stateless",
333
333
  title: "静态SVG",
334
- list: [svg_hamburger, svg_hotpot, svg_bot_2, svg_bot_9]
335
- }, thermometer = {
334
+ list: [t$k, t$l, t$n, t$m]
335
+ }, t$i = {
336
336
  name: "thermometer",
337
337
  title: "温度计",
338
338
  type: EDoneJsonType.File,
@@ -350,11 +350,11 @@ const svg_alert_light = {
350
350
  repeat: "infinite"
351
351
  },
352
352
  events: []
353
- }, animation_group = {
353
+ }, t$h = {
354
354
  groupType: "have_animation",
355
355
  title: "动画SVG",
356
- list: [thermometer]
357
- }, svg_text = {
356
+ list: [t$i]
357
+ }, t$g = {
358
358
  name: "svg-text",
359
359
  title: "文字",
360
360
  tag: "svg-text",
@@ -433,7 +433,7 @@ const svg_alert_light = {
433
433
  repeat: "infinite"
434
434
  },
435
435
  events: []
436
- }, switch_r = {
436
+ }, t$f = {
437
437
  name: "switch-r",
438
438
  title: "开关",
439
439
  tag: "switch-r",
@@ -458,7 +458,7 @@ const svg_alert_light = {
458
458
  repeat: "infinite"
459
459
  },
460
460
  events: []
461
- }, light_a = {
461
+ }, t$e = {
462
462
  name: "light",
463
463
  tag: "light-a",
464
464
  title: "灯",
@@ -493,7 +493,7 @@ const svg_alert_light = {
493
493
  repeat: "infinite"
494
494
  },
495
495
  events: []
496
- }, clock_a = {
496
+ }, t$d = {
497
497
  name: "clock-a",
498
498
  title: "时钟",
499
499
  tag: "clock-a",
@@ -553,16 +553,11 @@ const svg_alert_light = {
553
553
  repeat: "infinite"
554
554
  },
555
555
  events: []
556
- }, custom_svg_group = {
556
+ }, t$c = {
557
557
  groupType: "custom_svg_group",
558
558
  title: "SVG组件",
559
- list: [svg_text, switch_r, light_a, clock_a]
560
- }, svg_config = Object.seal([
561
- stateless_group,
562
- stateful_group,
563
- animation_group,
564
- custom_svg_group
565
- ]), el_button = {
559
+ list: [t$g, t$f, t$e, t$d]
560
+ }, t$b = Object.seal([t$j, t$o, t$h, t$c]), t$a = {
566
561
  name: "el-button",
567
562
  tag: "el-button",
568
563
  title: "按钮",
@@ -615,7 +610,7 @@ const svg_alert_light = {
615
610
  repeat: "infinite"
616
611
  },
617
612
  events: []
618
- }, common_table = {
613
+ }, t$9 = {
619
614
  name: "common-table",
620
615
  title: "通用表格",
621
616
  tag: "common-table",
@@ -740,7 +735,7 @@ const svg_alert_light = {
740
735
  repeat: "infinite"
741
736
  },
742
737
  events: []
743
- }, now_time = {
738
+ }, t$8 = {
744
739
  name: "now-time",
745
740
  title: "当前时间",
746
741
  tag: "now-time",
@@ -799,7 +794,7 @@ const svg_alert_light = {
799
794
  repeat: "infinite"
800
795
  },
801
796
  events: []
802
- }, el_tag = {
797
+ }, t$7 = {
803
798
  name: "el-tag",
804
799
  tag: "el-tag",
805
800
  title: "标签",
@@ -841,7 +836,7 @@ const svg_alert_light = {
841
836
  repeat: "infinite"
842
837
  },
843
838
  events: []
844
- }, progress_a = {
839
+ }, t$6 = {
845
840
  name: "progress-a",
846
841
  tag: "progress-a",
847
842
  title: "进度条",
@@ -866,11 +861,71 @@ const svg_alert_light = {
866
861
  repeat: "infinite"
867
862
  },
868
863
  events: []
869
- }, components = {
864
+ }, t$5 = {
865
+ name: "text-box",
866
+ title: "文字背景框",
867
+ tag: "text-box",
868
+ type: EDoneJsonType.Vue,
869
+ config: {
870
+ can_zoom: !1,
871
+ have_anchor: !1,
872
+ actual_rect: !0
873
+ },
874
+ display: !0,
875
+ props: {
876
+ width: {
877
+ title: "宽度",
878
+ type: EConfigItemPropsType.InputNumber,
879
+ val: 250
880
+ },
881
+ height: {
882
+ title: "高度",
883
+ type: EConfigItemPropsType.InputNumber,
884
+ val: 150
885
+ },
886
+ bgColor: {
887
+ title: "背景颜色",
888
+ type: EConfigItemPropsType.Color,
889
+ val: "#000000"
890
+ },
891
+ bgOpacity: {
892
+ title: "背景透明度(%)",
893
+ type: EConfigItemPropsType.InputNumber,
894
+ val: 1
895
+ },
896
+ borderColor: {
897
+ title: "边框颜色",
898
+ type: EConfigItemPropsType.Color,
899
+ val: "#cccccc"
900
+ },
901
+ borderWidth: {
902
+ title: "边框宽度",
903
+ type: EConfigItemPropsType.InputNumber,
904
+ val: 1
905
+ },
906
+ borderRadius: {
907
+ title: "边框圆角",
908
+ type: EConfigItemPropsType.InputNumber,
909
+ val: 5
910
+ },
911
+ borderOpacity: {
912
+ title: "边框透明度(%)",
913
+ type: EConfigItemPropsType.InputNumber,
914
+ val: 100
915
+ }
916
+ },
917
+ common_animations: {
918
+ val: "",
919
+ delay: "delay-0s",
920
+ speed: "slow",
921
+ repeat: "infinite"
922
+ },
923
+ events: []
924
+ }, t$4 = {
870
925
  groupType: "custom-vue",
871
926
  title: "VUE组件",
872
- list: [el_button, progress_a, common_table, now_time, el_tag]
873
- }, pie_charts = {
927
+ list: [t$a, t$6, t$9, t$8, t$7, t$5]
928
+ }, t$3 = {
874
929
  name: "pie-charts",
875
930
  tag: "pie-charts",
876
931
  title: "饼图",
@@ -926,11 +981,11 @@ const svg_alert_light = {
926
981
  repeat: "infinite"
927
982
  },
928
983
  events: []
929
- }, echarts_group = {
984
+ }, t$2 = {
930
985
  groupType: "echarts",
931
986
  title: "图表",
932
- list: [pie_charts]
933
- }, vue_config = Object.seal([components, echarts_group]), _sfc_main$L = /* @__PURE__ */ defineComponent({
987
+ list: [t$3]
988
+ }, t$1 = Object.seal([t$4, t$2]), _sfc_main$M = /* @__PURE__ */ defineComponent({
934
989
  __name: "progress",
935
990
  props: {
936
991
  percentage: { default: 10 }
@@ -1016,7 +1071,7 @@ const svg_alert_light = {
1016
1071
  _hoisted_9$7,
1017
1072
  _hoisted_10$6,
1018
1073
  _hoisted_11$5
1019
- ], _hoisted_13$4 = ["xlink:href"], _sfc_main$K = /* @__PURE__ */ defineComponent({
1074
+ ], _hoisted_13$4 = ["xlink:href"], _sfc_main$L = /* @__PURE__ */ defineComponent({
1020
1075
  __name: "switch-r",
1021
1076
  props: {
1022
1077
  id: {
@@ -1054,7 +1109,7 @@ const svg_alert_light = {
1054
1109
  }, null, 8, _hoisted_13$4)
1055
1110
  ], 8, _hoisted_1$m));
1056
1111
  }
1057
- }), _sfc_main$J = /* @__PURE__ */ defineComponent({
1112
+ }), _sfc_main$K = /* @__PURE__ */ defineComponent({
1058
1113
  __name: "svg-text",
1059
1114
  props: {
1060
1115
  text: {},
@@ -1076,7 +1131,7 @@ const svg_alert_light = {
1076
1131
  style: normalizeStyle$1({ "font-weight": i.bold ? "bold" : "normal" })
1077
1132
  }, toDisplayString(i.text), 5));
1078
1133
  }
1079
- }), _sfc_main$I = /* @__PURE__ */ defineComponent({
1134
+ }), _sfc_main$J = /* @__PURE__ */ defineComponent({
1080
1135
  __name: "common-table",
1081
1136
  props: {
1082
1137
  colConfig: { default: () => [] },
@@ -1104,7 +1159,7 @@ const svg_alert_light = {
1104
1159
  _: 1
1105
1160
  }, 16));
1106
1161
  }
1107
- }), _hoisted_1$l = { class: "flex mt-5px" }, _sfc_main$H = /* @__PURE__ */ defineComponent({
1162
+ }), _hoisted_1$l = { class: "flex mt-5px" }, _sfc_main$I = /* @__PURE__ */ defineComponent({
1108
1163
  __name: "now-time",
1109
1164
  props: {
1110
1165
  width: {},
@@ -1157,7 +1212,7 @@ const svg_alert_light = {
1157
1212
  for (const [o, a] of n)
1158
1213
  i[o] = a;
1159
1214
  return i;
1160
- }, NowTime = /* @__PURE__ */ _export_sfc$1(_sfc_main$H, [["__scopeId", "data-v-82ca3b84"]]);
1215
+ }, NowTime = /* @__PURE__ */ _export_sfc$1(_sfc_main$I, [["__scopeId", "data-v-82ca3b84"]]);
1161
1216
  /*! *****************************************************************************
1162
1217
  Copyright (c) Microsoft Corporation.
1163
1218
 
@@ -19065,7 +19120,7 @@ function install$1(r) {
19065
19120
  function install(r) {
19066
19121
  use(install$2), use(install$1);
19067
19122
  }
19068
- const _sfc_main$G = /* @__PURE__ */ defineComponent({
19123
+ const _sfc_main$H = /* @__PURE__ */ defineComponent({
19069
19124
  __name: "pie-charts",
19070
19125
  props: {
19071
19126
  title: {
@@ -19122,7 +19177,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
19122
19177
  autoresize: ""
19123
19178
  }, null, 8, ["option"]));
19124
19179
  }
19125
- }), pieCharts_vue_vue_type_style_index_0_scoped_fec2cbf2_lang = "", PieCharts = /* @__PURE__ */ _export_sfc$1(_sfc_main$G, [["__scopeId", "data-v-fec2cbf2"]]), _hoisted_1$k = ["id"], _hoisted_2$h = ["id"], _hoisted_3$e = ["fill"], _hoisted_4$a = ["fill"], _hoisted_5$8 = ["fill"], _hoisted_6$6 = /* @__PURE__ */ createElementVNode("path", {
19180
+ }), pieCharts_vue_vue_type_style_index_0_scoped_fec2cbf2_lang = "", PieCharts = /* @__PURE__ */ _export_sfc$1(_sfc_main$H, [["__scopeId", "data-v-fec2cbf2"]]), _hoisted_1$k = ["id"], _hoisted_2$h = ["id"], _hoisted_3$e = ["fill"], _hoisted_4$a = ["fill"], _hoisted_5$8 = ["fill"], _hoisted_6$6 = /* @__PURE__ */ createElementVNode("path", {
19126
19181
  d: "M375.466667 709.214815l-25.6 137.481481c0 2.844444 1.896296 5.688889 7.585185 10.42963l65.422222 54.992593c5.688889 4.740741 15.17037 8.533333 23.703704 10.429629l36.029629-193.422222-107.14074-19.911111z",
19127
19182
  fill: "#2D4375"
19128
19183
  }, null, -1), _hoisted_7$6 = /* @__PURE__ */ createElementVNode("path", {
@@ -19137,7 +19192,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
19137
19192
  }, null, -1), _hoisted_13$3 = /* @__PURE__ */ createElementVNode("path", {
19138
19193
  d: "M570.785185 848.592593l-107.140741-19.911112-4.74074 27.496297 107.14074 19.911111c7.585185 1.896296 15.17037-3.792593 16.118519-11.377778 1.896296-7.585185-2.844444-15.17037-11.377778-16.118518z",
19139
19194
  fill: "#CEEFF6"
19140
- }, null, -1), _hoisted_14$3 = ["xlink:href", "width", "height"], _sfc_main$F = /* @__PURE__ */ defineComponent({
19195
+ }, null, -1), _hoisted_14$3 = ["xlink:href", "width", "height"], _sfc_main$G = /* @__PURE__ */ defineComponent({
19141
19196
  __name: "light-a",
19142
19197
  props: {
19143
19198
  id: { default: "" },
@@ -19201,7 +19256,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
19201
19256
  }, null, 8, _hoisted_14$3)
19202
19257
  ], 8, _hoisted_1$k));
19203
19258
  }
19204
- }), _hoisted_1$j = ["id"], _hoisted_2$g = ["id"], _hoisted_3$d = ["fill"], _hoisted_4$9 = ["fill"], _hoisted_5$7 = ["fill"], _hoisted_6$5 = ["from", "to"], _hoisted_7$5 = ["fill"], _hoisted_8$5 = ["from", "to"], _hoisted_9$5 = ["fill"], _hoisted_10$4 = ["fill"], _hoisted_11$3 = ["fill"], _hoisted_12$3 = ["from", "to"], _hoisted_13$2 = ["fill"], _hoisted_14$2 = ["xlink:href"], _sfc_main$E = /* @__PURE__ */ defineComponent({
19259
+ }), _hoisted_1$j = ["id"], _hoisted_2$g = ["id"], _hoisted_3$d = ["fill"], _hoisted_4$9 = ["fill"], _hoisted_5$7 = ["fill"], _hoisted_6$5 = ["from", "to"], _hoisted_7$5 = ["fill"], _hoisted_8$5 = ["from", "to"], _hoisted_9$5 = ["fill"], _hoisted_10$4 = ["fill"], _hoisted_11$3 = ["fill"], _hoisted_12$3 = ["from", "to"], _hoisted_13$2 = ["fill"], _hoisted_14$2 = ["xlink:href"], _sfc_main$F = /* @__PURE__ */ defineComponent({
19205
19260
  __name: "clock-a",
19206
19261
  props: {
19207
19262
  id: { default: "" },
@@ -19293,18 +19348,59 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
19293
19348
  }, null, 8, _hoisted_14$2)
19294
19349
  ], 8, _hoisted_1$j));
19295
19350
  }
19296
- }), vueComp = {
19297
- "svg-text": _sfc_main$J,
19351
+ }), _sfc_main$E = /* @__PURE__ */ defineComponent({
19352
+ __name: "text-box",
19353
+ props: {
19354
+ width: { default: 250 },
19355
+ height: { default: 150 },
19356
+ bgColor: { default: "#ffffff" },
19357
+ bgOpacity: { default: 50 },
19358
+ borderColor: { default: "#000000" },
19359
+ borderWidth: { default: 1 },
19360
+ borderRadius: { default: 5 },
19361
+ borderOpacity: { default: 100 }
19362
+ },
19363
+ setup(r) {
19364
+ const n = r, i = computed(() => ({
19365
+ width: (n.width > 0 ? n.width : 0) + "px",
19366
+ height: (n.height > 0 ? n.height : 0) + "px",
19367
+ borderRadius: (n.borderRadius > 0 ? n.borderRadius : 0) + "px"
19368
+ })), o = computed(() => ({
19369
+ border: `${n.borderWidth > 0 ? n.borderWidth : 0}px solid ${n.borderColor}`,
19370
+ borderRadius: (n.borderRadius > 0 ? n.borderRadius : 0) + "px",
19371
+ opacity: (n.borderOpacity > 0 ? n.borderOpacity < 100 ? n.borderOpacity : 100 : 0) / 100
19372
+ })), a = computed(() => ({
19373
+ backgroundColor: n.bgColor,
19374
+ opacity: (n.bgOpacity > 0 ? n.bgOpacity < 100 ? n.bgOpacity : 100 : 0) / 100,
19375
+ borderRadius: n.borderRadius + "px"
19376
+ }));
19377
+ return (u, c) => (openBlock(), createElementBlock("div", {
19378
+ class: "outM",
19379
+ style: normalizeStyle$1(i.value)
19380
+ }, [
19381
+ createElementVNode("div", {
19382
+ class: "wallI",
19383
+ style: normalizeStyle$1(a.value)
19384
+ }, null, 4),
19385
+ createElementVNode("div", {
19386
+ class: "borderB",
19387
+ style: normalizeStyle$1(o.value)
19388
+ }, null, 4)
19389
+ ], 4));
19390
+ }
19391
+ }), textBox_vue_vue_type_style_index_0_scoped_4ab181ea_lang = "", TextBox = /* @__PURE__ */ _export_sfc$1(_sfc_main$E, [["__scopeId", "data-v-4ab181ea"]]), vueComp = {
19392
+ "svg-text": _sfc_main$K,
19298
19393
  "el-button": ElButton,
19299
- "progress-a": _sfc_main$L,
19394
+ "progress-a": _sfc_main$M,
19300
19395
  "el-tag": ElTag$1,
19301
- "common-table": _sfc_main$I,
19396
+ "common-table": _sfc_main$J,
19302
19397
  "pie-charts": PieCharts,
19303
- "switch-r": _sfc_main$K,
19398
+ "switch-r": _sfc_main$L,
19304
19399
  "now-time": NowTime,
19305
- "light-a": _sfc_main$F,
19306
- "clock-a": _sfc_main$E
19307
- }, config = [...svg_config, ...vue_config], useGlobalStore = defineStore("global-store", {
19400
+ "light-a": _sfc_main$G,
19401
+ "clock-a": _sfc_main$F,
19402
+ "text-box": TextBox
19403
+ }, config = [...t$b, ...t$1], useGlobalStore = defineStore("global-store", {
19308
19404
  state: () => ({
19309
19405
  config_center: config,
19310
19406
  intention: EGlobalStoreIntention.None,