next-element-vue 0.3.4 → 0.3.5

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/dist/index.umd.js CHANGED
@@ -2,8 +2,8 @@
2
2
  /**
3
3
  * 作  者:huangteng
4
4
  * 邮  箱:htengweb@163.com
5
- * 当前版本:0.3.4 v
6
- * 发布日期:2024-08-10
5
+ * 当前版本:0.3.5 v
6
+ * 发布日期:2024-09-03
7
7
  * 地  址:https://www.npmjs.com/package/next-element-vue
8
8
  */
9
9
 
@@ -3367,7 +3367,7 @@
3367
3367
  }
3368
3368
  if ("select" === col.type) {
3369
3369
  const placeholder = t("next.form.select") + (col.searchPlaceholder || col.searchLabel || col.label);
3370
- return vue.createVNode(elementPlus.ElSelect, {
3370
+ return !formParams[col.prop] && col.multiple && (formParams[col.prop] = []), vue.createVNode(elementPlus.ElSelect, {
3371
3371
  modelValue: formParams[col.prop],
3372
3372
  "onUpdate:modelValue": $event => formParams[col.prop] = $event,
3373
3373
  clearable: !0,
@@ -6860,8 +6860,17 @@
6860
6860
  this.destroyedObservers = callback;
6861
6861
  }
6862
6862
  canvasMouseClick(e) {
6863
- e.stopPropagation(), this.isDrawing = !0, this.mouseOffset.x = e.offsetX, this.mouseOffset.y = e.offsetY,
6864
- this.vertexes.push([ e.offsetX, e.offsetY ]), this.vertexes = vertexesUnique(this.vertexes);
6863
+ e.stopPropagation(), this.isDrawing = !0, this.mouseOffset.x = e.offsetX, this.mouseOffset.y = e.offsetY;
6864
+ const [x, y] = [ e.offsetX, e.offsetY ];
6865
+ let is_add = !0;
6866
+ for (let i = 0; i < this.vertexes.length; i++) {
6867
+ const p = this.vertexes[i];
6868
+ if (Math.sqrt((x - p[0]) ** 2 + (y - p[1]) ** 2) < 8) {
6869
+ is_add = !1;
6870
+ break;
6871
+ }
6872
+ }
6873
+ is_add && this.vertexes.push([ x, y ]), this.vertexes = vertexesUnique(this.vertexes);
6865
6874
  }
6866
6875
  canvasMousemove(e) {
6867
6876
  e.stopPropagation(), this.isDrawing && (this.mouseOffset.x = e.offsetX, this.mouseOffset.y = e.offsetY,
@@ -6889,11 +6898,12 @@
6889
6898
  pointCentreIndex;
6890
6899
  vertexRadius;
6891
6900
  edgeCentreRadius;
6901
+ pointRecover;
6892
6902
  observers=[];
6893
6903
  constructor(canvas, ctx) {
6894
6904
  this.canvas = canvas, this.ctx = ctx, this.vertexes = [], this.isEditing = !1, this.canClickEvent = !0,
6895
6905
  this.isMoveEditing = !1, this.pointVertexIndex = -1, this.pointCentreIndex = -1,
6896
- this.vertexRadius = 8, this.edgeCentreRadius = 5;
6906
+ this.vertexRadius = 8, this.edgeCentreRadius = 5, this.pointRecover = [];
6897
6907
  }
6898
6908
  drawPolygonPath(vertexes, mouseX, mouseY) {
6899
6909
  const ctx = this.ctx;
@@ -6974,7 +6984,9 @@
6974
6984
  }
6975
6985
  canvasMousedown(e) {
6976
6986
  e.stopPropagation(), e.preventDefault(), this.canClickEvent = !0;
6977
- const {offsetX: x, offsetY: y} = e, vertex_i = this.pointInVertexes(x, y);
6987
+ const {offsetX: x, offsetY: y} = e;
6988
+ this.pointRecover = [ x, y ];
6989
+ const vertex_i = this.pointInVertexes(x, y);
6978
6990
  isValueExist(vertex_i) && (this.isMoveEditing = !0, this.pointVertexIndex = vertex_i,
6979
6991
  this.vertexes.splice(this.pointVertexIndex, 1, [ x, y ]));
6980
6992
  const i = this.pointInEdgeCentre(x, y);
@@ -6985,11 +6997,19 @@
6985
6997
  }
6986
6998
  canvasMouseup(e) {
6987
6999
  e.stopPropagation(), e.preventDefault();
6988
- const {offsetX: x, offsetY: y} = e;
7000
+ let {offsetX: x, offsetY: y} = e;
7001
+ this.vertexes = vertexesUnique(this.vertexes);
7002
+ for (let i = 0; i < this.vertexes.length; i++) {
7003
+ const p = this.vertexes[i], radius = Math.sqrt((x - p[0]) ** 2 + (y - p[1]) ** 2);
7004
+ if (radius < 8 && radius > 0 && this.pointRecover.length) {
7005
+ x = this.pointRecover[0], y = this.pointRecover[1], this.pointRecover = [];
7006
+ break;
7007
+ }
7008
+ }
6989
7009
  this.pointVertexIndex > -1 && this.vertexes.splice(this.pointVertexIndex, 1, [ x, y ]),
6990
7010
  this.pointCentreIndex > -1 && this.vertexes.splice(this.pointCentreIndex, 1, [ x, y ]),
6991
7011
  this.isMoveEditing = !1, this.pointVertexIndex = -1, this.pointCentreIndex = -1,
6992
- this.notifyObservers();
7012
+ this.drawPolygon(this.vertexes), this.notifyObservers();
6993
7013
  }
6994
7014
  canvasMouseClick(e) {
6995
7015
  e.stopPropagation();
@@ -7556,7 +7576,7 @@
7556
7576
  })(app);
7557
7577
  };
7558
7578
  var index = {
7559
- version: "0.3.4",
7579
+ version: "0.3.5",
7560
7580
  install: install
7561
7581
  };
7562
7582
  exports.NextContainer = NextContainer, exports.NextCrudTable = NextCrudTable, exports.NextCrudTableVirtualized = NextCrudTableVirtualized,
@@ -7603,7 +7623,7 @@
7603
7623
  }), exports.useGetDerivedNamespace = useGetDerivedNamespace, exports.useLanguage = (locale, lang) => {
7604
7624
  const localeRef = vue.isRef(locale) ? locale : vue.ref(locale), nextLang = localeLang[lang] || localeLang["zh-cn"];
7605
7625
  localeRef.value.name = lang, localeRef.value.next = nextLang.next;
7606
- }, exports.useLocale = useLocale, exports.useNamespace = useNamespace, exports.version = "0.3.4",
7626
+ }, exports.useLocale = useLocale, exports.useNamespace = useNamespace, exports.version = "0.3.5",
7607
7627
  Object.defineProperty(exports, "__esModule", {
7608
7628
  value: !0
7609
7629
  });