mhz-helpers 1.1.49 → 1.2.0

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.
Files changed (2) hide show
  1. package/dist/index.js +11 -11
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -4705,7 +4705,7 @@ function Ta() {
4705
4705
  e.value = [...e.value, ...s];
4706
4706
  }
4707
4707
  function r(s, i) {
4708
- s || (t.value = i);
4708
+ s || (t.value = i > 0 ? i : 1);
4709
4709
  }
4710
4710
  return { page: t, allData: e, addData: n, handleScroll: r };
4711
4711
  }
@@ -4714,7 +4714,7 @@ function Ca(t, e) {
4714
4714
  return { page: t.value };
4715
4715
  const { page: n, sort: r, filter: s } = t.value;
4716
4716
  return {
4717
- page: n || 1,
4717
+ page: n > 0 ? n : 1,
4718
4718
  dir: r.isAsc === !1 ? "desc" : "asc",
4719
4719
  sort: r.value,
4720
4720
  initiator: e,
@@ -4723,7 +4723,7 @@ function Ca(t, e) {
4723
4723
  }
4724
4724
  function Pa(t) {
4725
4725
  const e = wt(), n = Ot(), r = q({
4726
- page: Number(n.query.page || 1),
4726
+ page: n.query.page && +(n.query.page > 0) ? Number(n.query.page) : 1,
4727
4727
  sort: { value: n.query.sort?.toString(), isAsc: n.query.dir !== "desc" },
4728
4728
  filter: { ...t }
4729
4729
  });
@@ -4739,7 +4739,7 @@ function Pa(t) {
4739
4739
  };
4740
4740
  }
4741
4741
  function i(a) {
4742
- r.value.page = a;
4742
+ r.value.page = a > 0 ? a : 1;
4743
4743
  }
4744
4744
  function o(a) {
4745
4745
  r.value = {
@@ -5064,14 +5064,14 @@ function no(t) {
5064
5064
  e.push.apply(e, t[n] || []);
5065
5065
  }), e;
5066
5066
  }
5067
- var nn = /* @__PURE__ */ function(t) {
5067
+ var nn = /* @__PURE__ */ (function(t) {
5068
5068
  Gi(e, t);
5069
5069
  function e(n, r) {
5070
5070
  var s;
5071
5071
  return s = t.call(this, "Async Validation Error") || this, s.errors = n, s.fields = r, s;
5072
5072
  }
5073
5073
  return e;
5074
- }(/* @__PURE__ */ yt(Error));
5074
+ })(/* @__PURE__ */ yt(Error));
5075
5075
  function ro(t, e, n, r, s) {
5076
5076
  if (e.first) {
5077
5077
  var i = new Promise(function(g, b) {
@@ -5133,7 +5133,7 @@ var ir = function(e, n, r, s, i, o) {
5133
5133
  e.required && (!r.hasOwnProperty(e.field) || x(n, o || e.type)) && s.push(k(i.messages.required, e.fullField));
5134
5134
  }, oo = function(e, n, r, s, i) {
5135
5135
  (/^\s+$/.test(n) || n === "") && s.push(k(i.messages.whitespace, e.fullField));
5136
- }, Se, ao = function() {
5136
+ }, Se, ao = (function() {
5137
5137
  if (Se)
5138
5138
  return Se;
5139
5139
  var t = "[a-fA-F\\d:]", e = function(O) {
@@ -5159,7 +5159,7 @@ var ir = function(e, n, r, s, i, o) {
5159
5159
  };
5160
5160
  var l = "(?:(?:[a-z]+:)?//)", c = "(?:\\S+(?::\\S*)?@)?", f = u.v4().source, g = u.v6().source, b = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", y = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", d = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", p = "(?::\\d{2,5})?", m = '(?:[/?#][^\\s"]*)?', w = "(?:" + l + "|www\\.)" + c + "(?:localhost|" + f + "|" + g + "|" + b + y + d + ")" + p + m;
5161
5161
  return Se = new RegExp("(?:^" + w + "$)", "i"), Se;
5162
- }, on = {
5162
+ }), on = {
5163
5163
  // http://emailregex.com/
5164
5164
  email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,
5165
5165
  // url: new RegExp(
@@ -5427,7 +5427,7 @@ function gt() {
5427
5427
  }
5428
5428
  };
5429
5429
  }
5430
- var bt = gt(), ue = /* @__PURE__ */ function() {
5430
+ var bt = gt(), ue = /* @__PURE__ */ (function() {
5431
5431
  function t(n) {
5432
5432
  this.rules = null, this._messages = bt, this.define(n);
5433
5433
  }
@@ -5553,7 +5553,7 @@ var bt = gt(), ue = /* @__PURE__ */ function() {
5553
5553
  var s = Object.keys(r), i = s.indexOf("message");
5554
5554
  return i !== -1 && s.splice(i, 1), s.length === 1 && s[0] === "required" ? pe.required : pe[this.getType(r)] || void 0;
5555
5555
  }, t;
5556
- }();
5556
+ })();
5557
5557
  ue.register = function(e, n) {
5558
5558
  if (typeof n != "function")
5559
5559
  throw new Error("Cannot register a validator by type, validator is not a function");
@@ -5642,7 +5642,7 @@ function _a(t) {
5642
5642
  function Ua(t) {
5643
5643
  return {
5644
5644
  type: "email",
5645
- message: t === "en" ? "This is not correct email" : "Введите корретную почту"
5645
+ message: t === "en" ? "This is not correct email" : "Введите корректную почту"
5646
5646
  };
5647
5647
  }
5648
5648
  function Ia(t) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mhz-helpers",
3
3
  "description": "Mhz helpers and composables",
4
- "version": "1.1.49",
4
+ "version": "1.2.0",
5
5
  "author": "Alexandr Dergunov <dergunovs@mail.ru> (https://github.com/dergunovs)",
6
6
  "license": "MIT",
7
7
  "type": "module",
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "devDependencies": {
36
36
  "@eslint/js": "9.33.0",
37
- "@types/node": "24.2.1",
37
+ "@types/node": "24.3.0",
38
38
  "@vitejs/plugin-vue": "6.0.1",
39
39
  "@vitest/coverage-istanbul": "3.2.4",
40
40
  "eslint": "9.33.0",
@@ -67,7 +67,7 @@
67
67
  "vue-router": "4.5.1"
68
68
  },
69
69
  "engines": {
70
- "npm": ">=11.3.0",
71
- "node": ">=24.2.0"
70
+ "npm": ">=11.5.1",
71
+ "node": ">=24.6.0"
72
72
  }
73
73
  }