@touchvue/plugin 1.0.0-beta.2 → 1.0.0-beta.4

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.
package/index.mjs CHANGED
@@ -5,7 +5,6 @@ var __publicField = (obj, key, value) => {
5
5
  return value;
6
6
  };
7
7
  import { defineComponent, ref, computed, resolveComponent, resolveDirective, withDirectives, openBlock, createElementBlock, normalizeClass, normalizeStyle, createBlock, createCommentVNode, createElementVNode, renderSlot, getCurrentInstance, nextTick, render, createVNode, inject, watch, unref, withKeys, vShow, toDisplayString, Fragment, renderList, vModelSelect, createTextVNode, withCtx, withModifiers, onMounted, useSlots, onBeforeUnmount, provide, vModelText, vModelDynamic, isVNode, useAttrs, resolveDynamicComponent, mergeProps, h, isRef, reactive, createSlots, normalizeProps, guardReactiveProps, onDeactivated, onActivated, Transition, onUnmounted, useCssVars, markRaw, toRaw } from "vue";
8
- import tinymce from "tinymce";
9
8
  const withInstall = (main, extra) => {
10
9
  main.install = (app) => {
11
10
  for (const comp of [main, ...Object.values(extra != null ? extra : {})]) {
@@ -9437,9 +9436,10 @@ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
9437
9436
  title: { default: "" },
9438
9437
  color: { default: "" },
9439
9438
  mode: { default: "default" },
9439
+ link: { type: Boolean, default: false },
9440
9440
  position: { default: "left" }
9441
9441
  },
9442
- emits: ["back"],
9442
+ emits: ["back", "click"],
9443
9443
  setup(__props, { emit: __emit }) {
9444
9444
  const instance = getCurrentInstance();
9445
9445
  const elRef = ref(null);
@@ -9464,6 +9464,9 @@ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
9464
9464
  if (props.mode) {
9465
9465
  arr.push(`mode-${props.mode}`);
9466
9466
  }
9467
+ if (props.link) {
9468
+ arr.push(`is-link`);
9469
+ }
9467
9470
  if (props.position) {
9468
9471
  arr.push(`position-${props.position}`);
9469
9472
  }
@@ -9477,7 +9480,8 @@ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
9477
9480
  return openBlock(), createElementBlock("div", {
9478
9481
  ref_key: "elRef",
9479
9482
  ref: elRef,
9480
- class: normalizeClass(["to-header", setClass.value])
9483
+ class: normalizeClass(["to-header", setClass.value]),
9484
+ onClick: ($event) => emit("click")
9481
9485
  }, [
9482
9486
  unref(slots).left || Boolean(hasBack.value) && props.position === "center" ? (openBlock(), createElementBlock("div", {
9483
9487
  key: 0,
@@ -9600,7 +9604,7 @@ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
9600
9604
  }, [
9601
9605
  renderSlot(_ctx.$slots, "right")
9602
9606
  ])) : createCommentVNode("", true)
9603
- ], 2);
9607
+ ], 10, ["onClick"]);
9604
9608
  };
9605
9609
  }
9606
9610
  });
@@ -9795,7 +9799,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
9795
9799
  default: false
9796
9800
  }
9797
9801
  },
9798
- emits: ["update:modelValue", "click", "clear", "input", "keyup", "change", "keydown", "cut", "paste", "keypress", "focus", "blur"],
9802
+ emits: ["update:modelValue", "click", "clear", "input", "keyup", "change", "keydown", "cut", "paste", "keypress", "focus", "blur", "enter", "ctrlenter"],
9799
9803
  setup(__props, { expose: __expose, emit: __emit }) {
9800
9804
  const props = __props;
9801
9805
  const emit = __emit;
@@ -10039,6 +10043,12 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
10039
10043
  function inputInput() {
10040
10044
  emit("input", data.value);
10041
10045
  }
10046
+ function inputEnter() {
10047
+ emit("enter", data.value);
10048
+ }
10049
+ function inputCtrlEnter() {
10050
+ emit("ctrlenter", data.value);
10051
+ }
10042
10052
  function clear() {
10043
10053
  data.value = "";
10044
10054
  clearVisible.value = false;
@@ -10124,7 +10134,12 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
10124
10134
  readonly: __props.readonly,
10125
10135
  tabindex: props.tabindex,
10126
10136
  onKeyup: inputKeyup,
10127
- onKeydown: inputKeydown,
10137
+ onKeydown: [
10138
+ withModifiers(inputKeydown, ["exact"]),
10139
+ withKeys(withModifiers(inputEnter, ["exact"]), ["enter"]),
10140
+ withKeys(withModifiers(inputCtrlEnter, ["ctrl", "exact"]), ["enter"]),
10141
+ withKeys(withModifiers(inputCtrlEnter, ["meta", "exact"]), ["enter"])
10142
+ ],
10128
10143
  onCut: inputCut,
10129
10144
  onFocus: inputFocus,
10130
10145
  onBlur: inputBlur,
@@ -10132,7 +10147,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
10132
10147
  onKeypress: inputKeyPress,
10133
10148
  onChange: inputChange,
10134
10149
  onInput: inputInput
10135
- }, null, 40, ["onUpdate:modelValue", "autocomplete", "maxlength", "placeholder", "disabled", "readonly", "tabindex"])), [
10150
+ }, null, 40, ["onUpdate:modelValue", "autocomplete", "maxlength", "placeholder", "disabled", "readonly", "tabindex", "onKeydown"])), [
10136
10151
  [vModelText, data.value]
10137
10152
  ]) : props.type === "html" ? (openBlock(), createElementBlock("span", {
10138
10153
  key: 5,
@@ -10162,7 +10177,12 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
10162
10177
  disabled: props.disabled,
10163
10178
  readonly: __props.readonly,
10164
10179
  onKeyup: inputKeyup,
10165
- onKeydown: inputKeydown,
10180
+ onKeydown: [
10181
+ withModifiers(inputKeydown, ["exact"]),
10182
+ withKeys(withModifiers(inputEnter, ["exact"]), ["enter"]),
10183
+ withKeys(withModifiers(inputCtrlEnter, ["ctrl", "exact"]), ["enter"]),
10184
+ withKeys(withModifiers(inputCtrlEnter, ["meta", "exact"]), ["enter"])
10185
+ ],
10166
10186
  onCut: inputCut,
10167
10187
  onFocus: inputFocus,
10168
10188
  onBlur: inputBlur,
@@ -10170,7 +10190,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
10170
10190
  onKeypress: inputKeyPress,
10171
10191
  onChange: inputChange,
10172
10192
  onInput: inputInput
10173
- }, null, 40, ["onUpdate:modelValue", "autocomplete", "tabindex", "maxlength", "placeholder", "type", "disabled", "readonly"]), [
10193
+ }, null, 40, ["onUpdate:modelValue", "autocomplete", "tabindex", "maxlength", "placeholder", "type", "disabled", "readonly", "onKeydown"]), [
10174
10194
  [vModelDynamic, data.value]
10175
10195
  ])
10176
10196
  ])),
@@ -10337,7 +10357,7 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent({
10337
10357
  };
10338
10358
  }
10339
10359
  });
10340
- const ToDivider = withInstall(_sfc_main$W);
10360
+ withInstall(_sfc_main$W);
10341
10361
  /*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */
10342
10362
  const {
10343
10363
  entries,
@@ -13790,6 +13810,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
13790
13810
  ref: inputBox,
13791
13811
  "model-value": unref(datedisplay),
13792
13812
  class: "to-date-picker",
13813
+ readonly: !props.inputable,
13793
13814
  required: __props.required,
13794
13815
  desc: __props.desc,
13795
13816
  color: __props.color,
@@ -13893,7 +13914,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
13893
13914
  }, 8, ["lazy", "slide", "position", "width", "align"])
13894
13915
  ]),
13895
13916
  _: 1
13896
- }, 8, ["id", "model-value", "required", "desc", "color", "prefix", "suffix", "mode", "prop-error-type", "prop-error-tip", "fillet", "fillet-position", "placeholder", "disabled", "sp-chars", "link", "clearable", "width", "comparable", "onClear", "onInput"]);
13917
+ }, 8, ["id", "model-value", "readonly", "required", "desc", "color", "prefix", "suffix", "mode", "prop-error-type", "prop-error-tip", "fillet", "fillet-position", "placeholder", "disabled", "sp-chars", "link", "clearable", "width", "comparable", "onClear", "onInput"]);
13897
13918
  };
13898
13919
  }
13899
13920
  });
@@ -14310,6 +14331,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
14310
14331
  title: { default: "" },
14311
14332
  height: { default: "" },
14312
14333
  changePic: { type: Boolean, default: false },
14334
+ align: { default: "" },
14313
14335
  beforeChange: { type: Function, default: null },
14314
14336
  beforeRemove: { type: Function, default: null }
14315
14337
  },
@@ -14328,8 +14350,12 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
14328
14350
  const slot = useSlots();
14329
14351
  watch(
14330
14352
  () => props.modelValue,
14331
- (val) => {
14332
- selectValue.value = val;
14353
+ (val, old) => {
14354
+ if (val || val === 0) {
14355
+ selectValue.value = val;
14356
+ } else {
14357
+ emit("update:modelValue", old);
14358
+ }
14333
14359
  },
14334
14360
  { immediate: true }
14335
14361
  );
@@ -14346,12 +14372,18 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
14346
14372
  initData();
14347
14373
  });
14348
14374
  function initData() {
14349
- if (props.data) {
14375
+ if (props.data && props.data.length) {
14350
14376
  if (typeof props.data === "string") {
14351
14377
  _data.value = props.data.split(",").map((item) => ({ label: item, value: item }));
14352
14378
  } else if (Array.isArray(props.data) && props.data.length) {
14353
14379
  _data.value = props.data;
14354
14380
  }
14381
+ if (!selectValue.value && selectValue.value !== 0) {
14382
+ const hasNoOnItems = !_data.value.some((item) => item.on);
14383
+ if (hasNoOnItems) {
14384
+ selectValue.value = _data.value[0].value;
14385
+ }
14386
+ }
14355
14387
  }
14356
14388
  if (props.over === "control") {
14357
14389
  nextTick(() => {
@@ -14361,16 +14393,8 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
14361
14393
  }
14362
14394
  const setTabStyle = computed(() => {
14363
14395
  let obj = {};
14364
- if (props.itemWidth) {
14365
- if (!isNaN(Number(props.itemWidth))) {
14366
- obj.width = props.itemWidth + "em";
14367
- } else {
14368
- if (props.itemWidth === "avg") {
14369
- obj.width = 100 / _data.value.length + "%";
14370
- } else {
14371
- obj.width = props.itemWidth;
14372
- }
14373
- }
14396
+ if (props.itemWidth && !isNaN(Number(props.itemWidth)) && props.itemWidth !== "avg") {
14397
+ obj.width = props.itemWidth + "em";
14374
14398
  }
14375
14399
  return obj;
14376
14400
  });
@@ -14396,6 +14420,12 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
14396
14420
  if (props.itemDir) {
14397
14421
  arr.push(`item-dir-${props.itemDir}`);
14398
14422
  }
14423
+ if (props.itemWidth === "avg") {
14424
+ arr.push(`item-width-avg`);
14425
+ }
14426
+ if (props.align) {
14427
+ arr.push(`align-${props.align}`);
14428
+ }
14399
14429
  return arr;
14400
14430
  });
14401
14431
  const setUlClass = computed(() => {
@@ -15961,9 +15991,10 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
15961
15991
  });
15962
15992
  return (_ctx, _cache) => {
15963
15993
  const _component_to_icon = resolveComponent("to-icon");
15994
+ const _directive_size = resolveDirective("size");
15964
15995
  return withDirectives((openBlock(), createBlock(resolveDynamicComponent(__props.link ? "a" : "span"), {
15965
- ref: "el",
15966
- href: __props.href ? __props.href : "javscript:void(0)",
15996
+ ref: "$el2",
15997
+ href: __props.href ? __props.href : __props.link ? "javscript:void(0)" : "",
15967
15998
  class: normalizeClass(["to-text", setClass.value]),
15968
15999
  style: normalizeStyle(setStyle.value)
15969
16000
  }, {
@@ -15971,7 +16002,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
15971
16002
  renderSlot(_ctx.$slots, "icon", {}, () => [
15972
16003
  props.icon ? (openBlock(), createBlock(_component_to_icon, {
15973
16004
  key: 0,
15974
- mode: "text-icon",
16005
+ class: "to-text-icon",
15975
16006
  value: props.icon
15976
16007
  }, null, 8, ["value"])) : createCommentVNode("", true)
15977
16008
  ]),
@@ -15984,7 +16015,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
15984
16015
  ]),
15985
16016
  _: 3
15986
16017
  }, 8, ["href", "class", "style"])), [
15987
- [unref(vSizeDirective), __props.size]
16018
+ [_directive_size, __props.size]
15988
16019
  ]);
15989
16020
  };
15990
16021
  }
@@ -22052,10 +22083,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
22052
22083
  },
22053
22084
  __name: "collapse-item",
22054
22085
  props: {
22055
- padding: { default: 1 },
22056
- paddingPosition: { default: "ltrb" },
22057
22086
  value: { default: "" },
22058
- name: { default: "" },
22059
22087
  title: { default: "" },
22060
22088
  disabled: { type: Boolean, default: false }
22061
22089
  },
@@ -22065,11 +22093,11 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
22065
22093
  const emit = __emit;
22066
22094
  const isActive = ref(false);
22067
22095
  const Store = inject("Store");
22068
- Store.addChild(props.name);
22096
+ Store.addChild(props.value);
22069
22097
  watch(
22070
22098
  () => Store.activeValue.value,
22071
22099
  (value) => {
22072
- if (value.includes(props.name)) {
22100
+ if (value.includes(props.value)) {
22073
22101
  isActive.value = true;
22074
22102
  } else {
22075
22103
  isActive.value = false;
@@ -22083,80 +22111,55 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
22083
22111
  let h2 = containerRef.value.clientHeight / em + "em";
22084
22112
  return h2;
22085
22113
  });
22086
- const hasUnit = (val) => /[a-z%]+$/i.test(val);
22087
- const setStyle = computed(() => {
22088
- const obj = {};
22089
- if (String(props.padding).trim()) {
22090
- const padded = String(props.padding).trim().split(/\s+/).map((val) => {
22091
- return hasUnit(val) ? val : `${val}em`;
22092
- }).join(" ");
22093
- obj.padding = padded;
22094
- }
22095
- if (!props.paddingPosition.includes("t")) {
22096
- obj.paddingTop = 0;
22097
- }
22098
- if (!props.paddingPosition.includes("r")) {
22099
- obj.paddingRight = 0;
22100
- }
22101
- if (!props.paddingPosition.includes("b")) {
22102
- obj.paddingBottom = 0;
22103
- }
22104
- if (!props.paddingPosition.includes("l")) {
22105
- obj.paddingLeft = 0;
22106
- }
22107
- return obj;
22108
- });
22109
22114
  function itemClick() {
22110
22115
  if (!props.disabled) {
22111
- Store.setActiveValues(props.name);
22116
+ Store.setActiveValues(props.value);
22112
22117
  nextTick(() => {
22113
22118
  emit("change", isActive.value);
22114
22119
  });
22115
22120
  }
22116
22121
  }
22117
- function titleClick(e) {
22118
- if (!props.disabled) {
22119
- emit("title-click", e);
22120
- }
22121
- }
22122
22122
  return (_ctx, _cache) => {
22123
+ const _component_to_icon = resolveComponent("to-icon");
22124
+ const _component_to_header = resolveComponent("to-header");
22123
22125
  return openBlock(), createElementBlock("div", {
22124
- class: normalizeClass(["to-collapse-item", __props.disabled ? "is-disabled" : ""])
22126
+ class: normalizeClass(["to-collapse-item", __props.disabled ? "is-dis" : "", isActive.value ? "is-on" : ""])
22125
22127
  }, [
22126
- createElementVNode("div", {
22127
- class: normalizeClass(["to-collapse-item-header", isActive.value ? "is-active" : ""]),
22128
- style: normalizeStyle(setStyle.value),
22129
- onClick: itemClick
22130
- }, [
22131
- createElementVNode("span", {
22132
- class: "title",
22133
- onClick: titleClick
22134
- }, [
22135
- renderSlot(_ctx.$slots, "title", {}, () => [
22136
- createElementVNode("span", null, toDisplayString(__props.title), 1)
22137
- ])
22138
- ]),
22139
- renderSlot(_ctx.$slots, "icon", {}, () => [
22140
- createElementVNode("span", { class: "icon" }, [
22141
- createVNode(unref(ToIcon), { value: "next" })
22142
- ])
22143
- ])
22144
- ], 6),
22128
+ renderSlot(_ctx.$slots, "header", {
22129
+ item: { isOn: isActive.value, title: __props.title, isDisabled: __props.disabled }
22130
+ }, () => [
22131
+ createVNode(_component_to_header, {
22132
+ link: "",
22133
+ class: normalizeClass(["to-collapse-item-header"]),
22134
+ onClick: itemClick
22135
+ }, {
22136
+ title: withCtx(() => [
22137
+ renderSlot(_ctx.$slots, "title", {}, () => [
22138
+ createTextVNode(toDisplayString(__props.title), 1)
22139
+ ])
22140
+ ]),
22141
+ default: withCtx(() => [
22142
+ renderSlot(_ctx.$slots, "fn"),
22143
+ createVNode(_component_to_icon, {
22144
+ value: "next",
22145
+ class: "to-collapse-item-arrow"
22146
+ })
22147
+ ]),
22148
+ _: 3
22149
+ })
22150
+ ]),
22145
22151
  createElementVNode("div", {
22146
22152
  class: "to-collapse-item-content",
22147
- style: normalizeStyle({
22148
- height: isActive.value ? calcHeight.value : "0px"
22149
- })
22153
+ style: normalizeStyle({ height: isActive.value ? calcHeight.value : "0px" })
22150
22154
  }, [
22151
22155
  createElementVNode("div", {
22152
22156
  ref_key: "containerRef",
22153
22157
  ref: containerRef,
22154
- class: "content-container"
22158
+ class: "to-collapse-item-wrapper"
22155
22159
  }, [
22156
22160
  renderSlot(_ctx.$slots, "default")
22157
22161
  ], 512)
22158
- ], 4),
22159
- createVNode(unref(ToDivider))
22162
+ ], 4)
22160
22163
  ], 2);
22161
22164
  };
22162
22165
  }
@@ -22193,19 +22196,19 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
22193
22196
  deep: true
22194
22197
  }
22195
22198
  );
22196
- function addChild(name) {
22197
- allChildren.value.push(name);
22199
+ function addChild(value) {
22200
+ allChildren.value.push(value);
22198
22201
  }
22199
- function setActiveValues(name) {
22200
- if (activeValue.value.includes(name)) {
22201
- let idx = activeValue.value.findIndex((item) => item === name);
22202
+ function setActiveValues(value) {
22203
+ if (activeValue.value.includes(value)) {
22204
+ let idx = activeValue.value.findIndex((item) => item === value);
22202
22205
  idx !== -1 && activeValue.value.splice(idx, 1);
22203
22206
  } else {
22204
22207
  if (props.accordion) {
22205
22208
  activeValue.value = [];
22206
- activeValue.value.push(name);
22209
+ activeValue.value.push(value);
22207
22210
  } else {
22208
- activeValue.value.push(name);
22211
+ activeValue.value.push(value);
22209
22212
  }
22210
22213
  }
22211
22214
  }
@@ -24648,6 +24651,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
24648
24651
  props: editorProps,
24649
24652
  emits: editorEmits,
24650
24653
  setup(__props, { expose: __expose, emit: __emit }) {
24654
+ const tinymce = window.tinymce;
24651
24655
  const props = __props;
24652
24656
  const emit = __emit;
24653
24657
  const instance = getCurrentInstance();
@@ -24681,11 +24685,13 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
24681
24685
  const initTinymce = () => {
24682
24686
  if (!tinymce) {
24683
24687
  console.warn("TinyMCE is not loaded yet, waiting...");
24684
- setTimeout(initTinymce, 1e3);
24688
+ setTimeout(initTinymce, 100);
24685
24689
  return;
24686
24690
  }
24687
24691
  tinymce.init({
24688
24692
  selector: "#" + tinymceId.value,
24693
+ // 关键:把工具栏渲染到自定义容器,否则在部分 TinyMCE 版本下可能不显示
24694
+ fixed_toolbar_container: "#" + tinymceId.value + "_toolbar-container",
24689
24695
  language: languageTypeList[props.language],
24690
24696
  height: getHeightWithUnit(props.height),
24691
24697
  body_class: "panel-body ",
@@ -24695,8 +24701,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
24695
24701
  plugins,
24696
24702
  end_container_on_empty_block: true,
24697
24703
  powerpaste_word_import: "clean",
24698
- skin: false,
24699
- codesample_content_css: false,
24704
+ // TinyMCE v4 使用 skin: false 容易导致 UI 样式缺失而“看起来没渲染”,改为默认皮肤
24705
+ skin: void 0,
24706
+ codesample_content_css: void 0,
24700
24707
  code_dialog_height: 450,
24701
24708
  code_dialog_width: 1e3,
24702
24709
  advlist_bullet_styles: "square",
@@ -24886,7 +24893,10 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
24886
24893
  createElementVNode("div", {
24887
24894
  id: tinymceId.value + "_toolbar-container"
24888
24895
  }, null, 8, ["id"]),
24889
- createElementVNode("div", { id: tinymceId.value }, [
24896
+ createElementVNode("div", {
24897
+ id: tinymceId.value,
24898
+ style: { "min-height": "200px", "border": "1px solid var(--to-border-color, #dcdfe6)" }
24899
+ }, [
24890
24900
  createElementVNode("p")
24891
24901
  ], 8, ["id"])
24892
24902
  ]);
@@ -25651,6 +25661,14 @@ const echartsBarProps = {
25651
25661
  type: Array,
25652
25662
  default: () => []
25653
25663
  },
25664
+ chartsType: {
25665
+ type: String,
25666
+ default: "bar"
25667
+ },
25668
+ xAxisData: {
25669
+ type: Array,
25670
+ default: () => []
25671
+ },
25654
25672
  color: {
25655
25673
  type: [String, Array, Object],
25656
25674
  default: "#03a9f4"
@@ -25804,7 +25822,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
25804
25822
  const axisConfig = computed(() => {
25805
25823
  const categoryAxis = {
25806
25824
  type: "category",
25807
- data: props.data.map((item) => item.name),
25825
+ data: isMultiSeries.value ? props.xAxisData : props.data.map((item) => item.name),
25808
25826
  axisLabel: {
25809
25827
  interval: 0,
25810
25828
  rotate: props.rotate,
@@ -25928,12 +25946,14 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
25928
25946
  color: props.yAxisStyle.textColor
25929
25947
  };
25930
25948
  };
25949
+ const isMultiSeries = computed(() => {
25950
+ return props.data.length > 0 && isArray(props.data[0].value);
25951
+ });
25931
25952
  const seriesConfig = computed(() => {
25932
25953
  if (!echartsLib)
25933
25954
  return [];
25934
25955
  if (!props.is3d) {
25935
25956
  const series = [];
25936
- const isMultiSeries = props.data.length > 0 && isArray(props.data[0].value);
25937
25957
  const maxValue = Math.max(
25938
25958
  ...props.data.map((item) => {
25939
25959
  if (isArray(item.value)) {
@@ -25942,41 +25962,13 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
25942
25962
  return item.value;
25943
25963
  })
25944
25964
  );
25945
- if (isMultiSeries) {
25946
- const seriesCount = props.data[0].value.length;
25947
- for (let i = 0; i < seriesCount; i++) {
25965
+ if (isMultiSeries.value) {
25966
+ props.data.forEach((item, i) => {
25948
25967
  if (props.showShadow) {
25949
25968
  series.push({
25950
- name: props.data[0].seriesNames ? props.data[0].seriesNames[i] : `系列${i + 1}`,
25951
- type: "bar",
25952
- data: props.data.map(() => ({
25953
- value: maxValue,
25954
- itemStyle: {
25955
- color: new echartsLib.graphic.LinearGradient(
25956
- ...props.isHorizontal ? [
25957
- 0,
25958
- 0,
25959
- 1,
25960
- 0,
25961
- [
25962
- { offset: 0, color: "rgba(0, 0, 0, 0.4)" },
25963
- { offset: 0.5, color: "rgba(0, 0, 0, 0.25)" },
25964
- { offset: 1, color: "rgba(0, 0, 0, 0)" }
25965
- ]
25966
- ] : [
25967
- 0,
25968
- 0,
25969
- 0,
25970
- 1,
25971
- [
25972
- { offset: 0, color: "rgba(0, 0, 0, 0)" },
25973
- { offset: 0.5, color: "rgba(0, 0, 0, 0.25)" },
25974
- { offset: 1, color: "rgba(0, 0, 0, 0.4)" }
25975
- ]
25976
- ]
25977
- )
25978
- }
25979
- })),
25969
+ name: item.name,
25970
+ type: item.type ? item.type : props.chartsType,
25971
+ data: item.value,
25980
25972
  barWidth: Number(props.barSize) * currentEm.value,
25981
25973
  barGap: "-100%",
25982
25974
  z: 1,
@@ -25985,9 +25977,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
25985
25977
  });
25986
25978
  }
25987
25979
  series.push({
25988
- name: props.data[0].seriesNames ? props.data[0].seriesNames[i] : `系列${i + 1}`,
25989
- type: "bar",
25990
- data: props.data.map((item) => item.value[i]),
25980
+ name: item.name,
25981
+ type: item.type ? item.type : props.chartsType,
25982
+ data: item.value,
25991
25983
  barWidth: Number(props.barSize) * currentEm.value,
25992
25984
  itemStyle: {
25993
25985
  borderRadius: Number(props.borderRadius) * currentEm.value,
@@ -26005,11 +25997,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
26005
25997
  label: getSeriesLabelConfig(),
26006
25998
  z: 2
26007
25999
  });
26008
- }
26000
+ });
26009
26001
  } else {
26010
26002
  if (props.showShadow) {
26011
26003
  series.push({
26012
- type: "bar",
26004
+ type: props.chartsType,
26013
26005
  data: props.data.map(() => ({
26014
26006
  value: maxValue,
26015
26007
  itemStyle: {
@@ -26046,7 +26038,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
26046
26038
  });
26047
26039
  }
26048
26040
  series.push({
26049
- type: "bar",
26041
+ type: props.chartsType,
26050
26042
  data: props.data.map((item) => item.value),
26051
26043
  barWidth: Number(props.barSize) * currentEm.value,
26052
26044
  itemStyle: getItemStyle(),
@@ -26551,8 +26543,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
26551
26543
  };
26552
26544
  }
26553
26545
  });
26554
- const echartsBar_vue_vue_type_style_index_0_scoped_707c1175_lang = "";
26555
- const EchartsBar = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-707c1175"]]);
26546
+ const echartsBar_vue_vue_type_style_index_0_scoped_18b48726_lang = "";
26547
+ const EchartsBar = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-18b48726"]]);
26556
26548
  const ToEchartsBar = withInstall(EchartsBar);
26557
26549
  const DEFAULT_VIEW_CONTROL = {
26558
26550
  zoomSensitivity: 0,
@@ -26688,6 +26680,18 @@ const echartsMapProps = {
26688
26680
  speed: {
26689
26681
  type: [String, Number],
26690
26682
  default: 3e3
26683
+ },
26684
+ showOutline: {
26685
+ type: Boolean,
26686
+ default: false
26687
+ },
26688
+ outlineColor: {
26689
+ type: String,
26690
+ default: "#000"
26691
+ },
26692
+ outlineWidth: {
26693
+ type: [String, Number],
26694
+ default: 2
26691
26695
  }
26692
26696
  };
26693
26697
  const echartsMapEmits = {
@@ -29293,7 +29297,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
29293
29297
  };
29294
29298
  };
29295
29299
  const getOption = (geoName, mapData) => {
29296
- var _a2;
29300
+ const baseSeries = getBaseSeries(geoName, mapData);
29297
29301
  const shadowParts = parseShadow(props.shadow);
29298
29302
  const { min, max: max2 } = getMinMax(mapData);
29299
29303
  return {
@@ -29306,17 +29310,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
29306
29310
  }
29307
29311
  },
29308
29312
  geo: {
29309
- show: Boolean(props.shadow),
29313
+ show: true,
29310
29314
  map: geoName,
29311
29315
  roam: false,
29312
- top: shadowParts[0] ? Number(shadowParts[0]) * currentEm.value : currentEm.value,
29313
- bottom: 0,
29314
- silent: true,
29315
- label: { show: false },
29316
+ top: 0,
29317
+ bottom: props.shadow ? shadowParts[0] ? Number(shadowParts[0]) * currentEm.value : currentEm.value : 0,
29316
29318
  itemStyle: {
29317
- areaColor: (_a2 = shadowParts[1]) != null ? _a2 : "rgba(0,0,0,0.3)",
29318
- borderWidth: 0
29319
- }
29319
+ areaColor: "transparent",
29320
+ borderColor: props.showOutline ? props.outlineColor : "transparent",
29321
+ borderWidth: props.showOutline ? Number(props.outlineWidth) : 0,
29322
+ // 避免粗描边在尖锐拐角处产生 miter 尖刺
29323
+ borderJoin: "round",
29324
+ borderMiterLimit: 2
29325
+ },
29326
+ silent: true
29320
29327
  },
29321
29328
  visualMap: showVisualMap() ? {
29322
29329
  seriesIndex: [0],
@@ -29340,7 +29347,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
29340
29347
  color: props.colorRange.length ? props.colorRange : [props.colorStart, props.colorEnd]
29341
29348
  }
29342
29349
  } : { show: false },
29343
- series: [getBaseSeries(geoName, mapData), ...props.flag || []]
29350
+ series: [baseSeries, ...props.flag || []]
29344
29351
  };
29345
29352
  };
29346
29353
  const renderTooltip = (params) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@touchvue/plugin",
3
- "version": "1.0.0-beta.2",
3
+ "version": "1.0.0-beta.4",
4
4
  "description": "Vue3 Plugin Library",
5
5
  "private": false,
6
6
  "type": "module",
@@ -12,7 +12,9 @@
12
12
  "import": "./index.mjs",
13
13
  "require": "./index.cjs",
14
14
  "types": "./index.d.ts"
15
- }
15
+ },
16
+ "./style/*": "./style/style.css",
17
+ "./*": "./*"
16
18
  },
17
19
  "files": [
18
20
  "index.mjs",
@@ -30,5 +32,9 @@
30
32
  "vue": "^3.3.0"
31
33
  },
32
34
  "dependencies": {},
33
- "devDependencies": {}
35
+ "devDependencies": {},
36
+ "license": "ISC",
37
+ "publishConfig": {
38
+ "access": "public"
39
+ }
34
40
  }