@10yun/cv-pc-ui 0.4.5 → 0.4.7

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/lib/cv-ui.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! cvPcUI v0.4.5 */
1
+ /*! cvPcUI v0.4.7 */
2
2
  import { ClickOutside as e, ElAutocomplete as t, ElAvatar as n, ElBadge as r, ElButton as i, ElButton as a, ElCascader as o, ElCheckbox as s, ElCheckboxButton as c, ElCheckboxGroup as l, ElDatePicker as u, ElDialog as d, ElDrawer as f, ElForm as p, ElFormItem as m, ElIcon as ee, ElImage as te, ElInput as ne, ElInput as h, ElInputNumber as re, ElMessage as ie, ElMessage as g, ElMessageBox as ae, ElMessageBox as oe, ElOption as se, ElPagination as ce, ElPopover as le, ElScrollbar as ue, ElSelect as de, ElSwitch as fe, ElTable as pe, ElTableColumn as _, ElTag as me, ElTimePicker as he } from "element-plus";
3
3
  import { Fragment as v, Transition as ge, TransitionGroup as _e, computed as ve, createBlock as y, createCommentVNode as b, createElementBlock as x, createElementVNode as S, createSlots as ye, createTextVNode as C, createVNode as w, defineComponent as be, getCurrentInstance as xe, getCurrentScope as Se, guardReactiveProps as T, h as Ce, inject as we, markRaw as Te, mergeProps as E, nextTick as Ee, normalizeClass as D, normalizeProps as O, normalizeStyle as k, onBeforeUnmount as De, onMounted as Oe, onScopeDispose as ke, onUnmounted as Ae, openBlock as A, provide as je, reactive as Me, ref as j, render as Ne, renderList as M, renderSlot as N, resolveComponent as P, resolveDirective as Pe, resolveDynamicComponent as Fe, shallowReadonly as Ie, shallowRef as Le, toDisplayString as F, toHandlers as Re, toRaw as ze, toRefs as Be, toValue as Ve, unref as I, useCssVars as He, useSlots as Ue, vModelText as We, vShow as L, watch as Ge, withCtx as R, withDirectives as z, withKeys as Ke, withModifiers as qe } from "vue";
4
4
  import { basicSetup as Je } from "codemirror";
@@ -1777,6 +1777,7 @@ function qr(e) {
1777
1777
  "jpeg",
1778
1778
  "gif",
1779
1779
  "webp",
1780
+ "bmp",
1780
1781
  "svg"
1781
1782
  ], n = e.lastIndexOf("."), r = e.substring(n + 1);
1782
1783
  return t.indexOf(r.toLowerCase()) != -1;
@@ -3804,6 +3805,9 @@ var fa = {
3804
3805
  };
3805
3806
  },
3806
3807
  computed: {
3808
+ isMultiValue() {
3809
+ return !!this.multiple || parseInt(this.allowFileNum) > 1;
3810
+ },
3807
3811
  fileTypeStr() {
3808
3812
  return this.allowFileType.join(",");
3809
3813
  },
@@ -3816,7 +3820,7 @@ var fa = {
3816
3820
  fileSize: this.allowFileSize || "",
3817
3821
  fileUnit: this.fileUnit,
3818
3822
  multiple: this?.multiple || !1,
3819
- limit: this.allowFileNum ? parseInt(this.allowFileNum) : 5
3823
+ limit: this.allowFileNum ? parseInt(this.allowFileNum) : 1
3820
3824
  };
3821
3825
  },
3822
3826
  mergeAttrs() {
@@ -4442,7 +4446,10 @@ var Fa = {
4442
4446
  "png",
4443
4447
  "jpg",
4444
4448
  "jpeg",
4445
- "gif"
4449
+ "gif",
4450
+ "webp",
4451
+ "bmp",
4452
+ "svg"
4446
4453
  ]
4447
4454
  },
4448
4455
  showSize: {
@@ -4553,11 +4560,11 @@ var Fa = {
4553
4560
  }
4554
4561
  },
4555
4562
  updateValue(e, t) {
4556
- if (this.multiple) {
4563
+ if (this.isMultiValue) {
4557
4564
  let t = Pa(this.localValue, e).join(",");
4558
4565
  this.$emit("update:modelValue", t);
4559
4566
  } else this.$emit("update:modelValue", e);
4560
- if (this.multiple) {
4567
+ if (this.isMultiValue) {
4561
4568
  let e = Pa(this.localList, t);
4562
4569
  this.$emit("update:initValue", e);
4563
4570
  } else this.$emit("update:initValue", t);
@@ -4566,11 +4573,11 @@ var Fa = {
4566
4573
  e.raw, e.type.includes("image") ? (this.previewTitle = e.name, this.previewUrl = e.url, this.previewShow = !0) : window.open(e.url);
4567
4574
  },
4568
4575
  doRemove(e) {
4569
- this.multiple ? (this.localValue = this.localValue.filter((t, n) => n !== e), this.localList = this.localList.filter((t, n) => n !== e)) : (this.localValue = "", this.localList = []), this.updateValue(null, null);
4576
+ this.isMultiValue ? (this.localValue = this.localValue.filter((t, n) => n !== e), this.localList = this.localList.filter((t, n) => n !== e)) : (this.localValue = "", this.localList = []), this.updateValue(null, null);
4570
4577
  },
4571
4578
  handleItemRemove(e, t) {
4572
4579
  if (this.beforeRemove && typeof this.beforeRemove == "function") {
4573
- let e = this.multiple ? this.localValue[t] : this.localValue, n = this.beforeRemove(e, this.localValue);
4580
+ let e = this.isMultiValue ? this.localValue[t] : this.localValue, n = this.beforeRemove(e, this.localValue);
4574
4581
  n && n.then ? n.then(() => {
4575
4582
  this.doRemove(t);
4576
4583
  }, () => {}) : n !== !1 && this.doRemove(t);
@@ -4914,17 +4921,11 @@ var to = {
4914
4921
  },
4915
4922
  allowFileType: {
4916
4923
  type: [Array],
4917
- default: [
4918
- "txt",
4919
- "png",
4920
- "jpg",
4921
- "xlsx",
4922
- "xls"
4923
- ]
4924
+ default: /* @__PURE__ */ "png.jpg.jpeg.gif.webp.bmp.svg.ai.psd.eps.mp4.mp3.txt.md.rtf.odt.pdf.doc.docx.xls.xlsx.csv.ppt.pptx.zip.rar.7z".split(".")
4924
4925
  },
4925
4926
  allowFileNum: {
4926
4927
  type: [Number],
4927
- default: 5
4928
+ default: 1
4928
4929
  },
4929
4930
  multiple: {
4930
4931
  type: [Boolean],
@@ -5004,7 +5005,7 @@ var to = {
5004
5005
  }
5005
5006
  },
5006
5007
  updateValue(e, t) {
5007
- if (this.multiple) {
5008
+ if (this.isMultiValue) {
5008
5009
  let n = Pa(this.localValue, e), r = Pa(this.localList, t);
5009
5010
  this.$emit("update:modelValue", n), this.$emit("update:initValue", r);
5010
5011
  } else this.$emit("update:modelValue", e || ""), this.$emit("update:initValue", t || "");
@@ -5019,7 +5020,7 @@ var to = {
5019
5020
  },
5020
5021
  _do_remove(e) {
5021
5022
  let t = this.localList[e];
5022
- if (this.$emit("remove", t, this.localList), this.multiple) {
5023
+ if (this.$emit("remove", t, this.localList), this.isMultiValue) {
5023
5024
  let t = this.localValue.filter((t, n) => n !== e), n = this.localList.filter((t, n) => n !== e).map((e) => e.url);
5024
5025
  this.$emit("update:modelValue", t), this.$emit("update:initValue", n);
5025
5026
  } else this.$emit("update:modelValue", ""), this.$emit("update:initValue", "");
@@ -5820,7 +5821,10 @@ var Ro = /*#__PURE__*/ H(bo, [["render", Lo], ["__scopeId", "data-v-ae9dfc45"]])
5820
5821
  "png",
5821
5822
  "jpg",
5822
5823
  "jpeg",
5823
- "gif"
5824
+ "gif",
5825
+ "webp",
5826
+ "bmp",
5827
+ "svg"
5824
5828
  ]
5825
5829
  },
5826
5830
  btnText: {
@@ -5884,26 +5888,7 @@ var Uo = /*#__PURE__*/ H(Bo, [["render", Ho]]), Wo = {
5884
5888
  },
5885
5889
  allowFileType: {
5886
5890
  type: [Array],
5887
- default: () => [
5888
- "txt",
5889
- "csv",
5890
- "pdf",
5891
- "doc",
5892
- "docx",
5893
- "xls",
5894
- "xlsx",
5895
- "ppt",
5896
- "pptx",
5897
- "zip",
5898
- "rar",
5899
- "7z",
5900
- "png",
5901
- "jpg",
5902
- "jpeg",
5903
- "gif",
5904
- "mp4",
5905
- "mp3"
5906
- ]
5891
+ default: () => /* @__PURE__ */ "png.jpg.jpeg.gif.webp.bmp.svg.ai.psd.eps.mp4.mp3.txt.md.rtf.odt.pdf.doc.docx.xls.xlsx.csv.ppt.pptx.zip.rar.7z".split(".")
5907
5892
  },
5908
5893
  btnText: {
5909
5894
  type: String,
@@ -13235,7 +13220,7 @@ function nm(e, t, n, r, i, a) {
13235
13220
  class: "tinymce-textarea"
13236
13221
  }, null, 8, tm)], 6);
13237
13222
  }
13238
- var rm = /*#__PURE__*/ H(em, [["render", nm], ["__scopeId", "data-v-16673ff9"]]), im = {
13223
+ var rm = /*#__PURE__*/ H(em, [["render", nm], ["__scopeId", "data-v-681627a2"]]), im = {
13239
13224
  name: "cvEditorMarkdown",
13240
13225
  mixins: [
13241
13226
  ap,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@10yun/cv-pc-ui",
3
- "version": "0.4.5",
3
+ "version": "0.4.7",
4
4
  "private": false,
5
5
  "description": "cvjs-pc-ui组件",
6
6
  "homepage": "http://cvjs.cn/cv-pc-ui",
@@ -108,7 +108,7 @@ export function checkIsUndefined(val) {
108
108
  * @returns
109
109
  */
110
110
  export function checkIsImage(filePath) {
111
- let type = ['png', 'jpg', 'jpeg', 'gif', 'webp', 'svg'];
111
+ let type = ['png', 'jpg', 'jpeg', 'gif', 'webp', 'bmp', 'svg'];
112
112
  // 获取最后一个.的位置
113
113
  let index = filePath.lastIndexOf('.');
114
114
  // 获取后缀