@vitorfba/vue-treeselect 1.0.0 → 1.0.1

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.
@@ -74,11 +74,11 @@ var _t = yt, Nt = Object.prototype, Et = Nt.toString;
74
74
  function wt(e) {
75
75
  return Et.call(e);
76
76
  }
77
- var Ct = wt, ue = Me, Lt = _t, Mt = Ct, Tt = "[object Null]", Dt = "[object Undefined]", he = ue ? ue.toStringTag : void 0;
78
- function It(e) {
79
- return e == null ? e === void 0 ? Dt : Tt : he && he in Object(e) ? Lt(e) : Mt(e);
77
+ var Ct = wt, ue = Me, Lt = _t, Mt = Ct, Tt = "[object Null]", It = "[object Undefined]", he = ue ? ue.toStringTag : void 0;
78
+ function Dt(e) {
79
+ return e == null ? e === void 0 ? It : Tt : he && he in Object(e) ? Lt(e) : Mt(e);
80
80
  }
81
- var xt = It;
81
+ var xt = Dt;
82
82
  function Rt(e) {
83
83
  return e != null && typeof e == "object";
84
84
  }
@@ -102,26 +102,26 @@ function Qt(e) {
102
102
  var n = Pt.test(e);
103
103
  return n || jt.test(e) ? Ut(e.slice(2), n ? 2 : 8) : Ht.test(e) ? fe : +e;
104
104
  }
105
- var De = Qt, Kt = Ce, K = ct, pe = De, qt = "Expected a function", Yt = Math.max, Xt = Math.min;
105
+ var Ie = Qt, Kt = Ce, K = ct, pe = Ie, qt = "Expected a function", Yt = Math.max, Xt = Math.min;
106
106
  function Gt(e, t, n) {
107
107
  var s, i, o, a, c, d, f = 0, m = !1, p = !1, v = !0;
108
108
  if (typeof e != "function")
109
109
  throw new TypeError(qt);
110
110
  t = pe(t) || 0, Kt(n) && (m = !!n.leading, p = "maxWait" in n, o = p ? Yt(pe(n.maxWait) || 0, t) : o, v = "trailing" in n ? !!n.trailing : v);
111
111
  function N(u) {
112
- var O = s, I = i;
113
- return s = i = void 0, f = u, a = e.apply(I, O), a;
112
+ var O = s, D = i;
113
+ return s = i = void 0, f = u, a = e.apply(D, O), a;
114
114
  }
115
- function D(u) {
115
+ function I(u) {
116
116
  return f = u, c = setTimeout(L, t), m ? N(u) : a;
117
117
  }
118
118
  function k(u) {
119
- var O = u - d, I = u - f, le = t - O;
120
- return p ? Xt(le, o - I) : le;
119
+ var O = u - d, D = u - f, le = t - O;
120
+ return p ? Xt(le, o - D) : le;
121
121
  }
122
122
  function z(u) {
123
- var O = u - d, I = u - f;
124
- return d === void 0 || O >= t || O < 0 || p && I >= o;
123
+ var O = u - d, D = u - f;
124
+ return d === void 0 || O >= t || O < 0 || p && D >= o;
125
125
  }
126
126
  function L() {
127
127
  var u = K();
@@ -142,7 +142,7 @@ function Gt(e, t, n) {
142
142
  var u = K(), O = z(u);
143
143
  if (s = arguments, i = this, d = u, O) {
144
144
  if (c === void 0)
145
- return D(d);
145
+ return I(d);
146
146
  if (p)
147
147
  return clearTimeout(c), c = setTimeout(L, t), N(d);
148
148
  }
@@ -167,7 +167,7 @@ var en = function(e, t) {
167
167
  f(), e.removeChild(n);
168
168
  }
169
169
  };
170
- function Ie(e, t) {
170
+ function De(e, t) {
171
171
  const n = e.indexOf(t);
172
172
  n !== -1 && e.splice(n, 1);
173
173
  }
@@ -192,7 +192,7 @@ function rn(e, t) {
192
192
  lastWidth: null,
193
193
  lastHeight: null
194
194
  }, s = () => {
195
- Ie(P, n), P.length || sn();
195
+ De(P, n), P.length || sn();
196
196
  };
197
197
  return P.push(n), xe(n), nn(), s;
198
198
  }
@@ -229,7 +229,7 @@ function Re(e) {
229
229
  function Ae(e) {
230
230
  return !!e && (typeof e == "object" || typeof e == "function") && typeof e.then == "function";
231
231
  }
232
- var ln = De, ve = 1 / 0, cn = 17976931348623157e292;
232
+ var ln = Ie, ve = 1 / 0, cn = 17976931348623157e292;
233
233
  function un(e) {
234
234
  if (!e)
235
235
  return e === 0 ? e : 0;
@@ -289,12 +289,12 @@ function Tn(e) {
289
289
  var t = e == null ? 0 : e.length;
290
290
  return t ? e[t - 1] : void 0;
291
291
  }
292
- var Dn = Tn;
293
- const be = /* @__PURE__ */ C(Dn);
292
+ var In = Tn;
293
+ const be = /* @__PURE__ */ C(In);
294
294
  function _(e, t) {
295
295
  return e.indexOf(t) !== -1;
296
296
  }
297
- function In(e, t, n) {
297
+ function Dn(e, t, n) {
298
298
  for (let s = 0, i = e.length; s < i; s++)
299
299
  if (t.call(n, e[s], s, e)) return e[s];
300
300
  }
@@ -360,7 +360,7 @@ const zn = {
360
360
  instance: this
361
361
  };
362
362
  },
363
- emits: ["update:modelValue", "updated", "search-change", "close", "open", "select", "deselect"],
363
+ emits: ["update:modelValue", "updated", "search-change", "close", "open", "select", "deselect", "input"],
364
364
  props: {
365
365
  /**
366
366
  * Whether to allow resetting value even if there are disabled selected nodes.
@@ -1015,7 +1015,7 @@ const zn = {
1015
1015
  this.initialize();
1016
1016
  },
1017
1017
  internalValue(e, t) {
1018
- q(e, t) && (this.$emit("update:modelValue", this.getValue(), this.getInstanceId()), this.$emit("updated", this.getValue(), this.getInstanceId()));
1018
+ q(e, t) && (this.$emit("update:modelValue", this.getValue(), this.getInstanceId()), this.$emit("input", this.getValue(), this.getInstanceId()), this.$emit("updated", this.getValue(), this.getInstanceId()));
1019
1019
  },
1020
1020
  matchKeys() {
1021
1021
  this.initialize();
@@ -1114,7 +1114,7 @@ const zn = {
1114
1114
  if (this.valueFormat === "id")
1115
1115
  return t;
1116
1116
  const n = this.multiple ? Array.isArray(this.value) ? this.value : [] : this.value ? [this.value] : [];
1117
- return In(
1117
+ return Dn(
1118
1118
  n,
1119
1119
  (i) => i && this.enhancedNormalizer(i).id === e
1120
1120
  ) || t;
@@ -1369,13 +1369,13 @@ const zn = {
1369
1369
  normalize(e, t, n) {
1370
1370
  let s = t.map((i) => [this.enhancedNormalizer(i), i]).map(([i, o], a) => {
1371
1371
  this.checkDuplication(i), this.verifyNodeShape(i);
1372
- const { id: c, label: d, children: f, isDefaultExpanded: m } = i, p = e === E, v = p ? 0 : e.level + 1, N = Array.isArray(f) || f === null, D = !N, k = !!i.isDisabled || !this.flat && !p && e.isDisabled, z = !!i.isUnselectable, L = !!i.isNew, M = this.matchKeys.reduce((h, u) => ({
1372
+ const { id: c, label: d, children: f, isDefaultExpanded: m } = i, p = e === E, v = p ? 0 : e.level + 1, N = Array.isArray(f) || f === null, I = !N, k = !!i.isDisabled || !this.flat && !p && e.isDisabled, z = !!i.isUnselectable, L = !!i.isNew, M = this.matchKeys.reduce((h, u) => ({
1373
1373
  ...h,
1374
1374
  [u]: Vn(i[u]).toLocaleLowerCase()
1375
1375
  }), {}), U = p ? M.label : e.nestedSearchLabel + " " + M.label;
1376
1376
  this.forest.nodeMap[c] = S();
1377
1377
  const l = this.forest.nodeMap[c];
1378
- if (l.id = c, l.label = d, l.level = v, l.ancestors = p ? [] : [e].concat(e.ancestors), l.index = (p ? [] : e.index).concat(a), l.parentNode = e, l.lowerCased = M, l.nestedSearchLabel = U, l.isDisabled = k, l.isUnselectable = z, l.isNew = L, l.isMatched = !1, l.isHighlighted = !1, l.isBranch = N, l.isLeaf = D, l.isRootNode = p, l.raw = o, N) {
1378
+ if (l.id = c, l.label = d, l.level = v, l.ancestors = p ? [] : [e].concat(e.ancestors), l.index = (p ? [] : e.index).concat(a), l.parentNode = e, l.lowerCased = M, l.nestedSearchLabel = U, l.isDisabled = k, l.isUnselectable = z, l.isNew = L, l.isMatched = !1, l.isHighlighted = !1, l.isBranch = N, l.isLeaf = I, l.isRootNode = p, l.raw = o, N) {
1379
1379
  const h = Array.isArray(f);
1380
1380
  l.childrenStates = { ...J(), isLoaded: h }, l.isExpanded = typeof m == "boolean" ? m : v < this.defaultExpandLevel, l.hasMatchedDescendants = !1, l.hasDisabledDescendants = !1, l.isExpandedOnSearch = !1, l.showAllChildrenOnSearch = !1, l.count = {
1381
1381
  [T]: 0,
@@ -1389,7 +1389,7 @@ const zn = {
1389
1389
  () => 'Unloaded branch node detected. "loadOptions" prop is required to load its children.'
1390
1390
  ) : !h && l.isExpanded && this.loadChildrenOptions(l);
1391
1391
  }
1392
- if (l.ancestors.forEach((h) => h.count[R]++), D && l.ancestors.forEach((h) => h.count[B]++), p || (e.count[T] += 1, D && (e.count[A] += 1), k && (e.hasDisabledDescendants = !0)), n && n[c]) {
1392
+ if (l.ancestors.forEach((h) => h.count[R]++), I && l.ancestors.forEach((h) => h.count[B]++), p || (e.count[T] += 1, I && (e.count[A] += 1), k && (e.hasDisabledDescendants = !0)), n && n[c]) {
1393
1393
  const h = n[c];
1394
1394
  l.isMatched = h.isMatched, l.showAllChildrenOnSearch = h.showAllChildrenOnSearch, l.isHighlighted = h.isHighlighted, h.isBranch && l.isBranch && (l.isExpanded = h.isExpanded, l.isExpandedOnSearch = h.isExpandedOnSearch, h.childrenStates.isLoaded && !l.childrenStates.isLoaded ? l.isExpanded = !1 : l.childrenStates = { ...h.childrenStates });
1395
1395
  }
@@ -1543,7 +1543,7 @@ const zn = {
1543
1543
  this.forest.selectedNodeIds.push(e.id), this.forest.selectedNodeMap[e.id] = !0;
1544
1544
  },
1545
1545
  removeValue(e) {
1546
- Ie(this.forest.selectedNodeIds, e.id), delete this.forest.selectedNodeMap[e.id];
1546
+ De(this.forest.selectedNodeIds, e.id), delete this.forest.selectedNodeMap[e.id];
1547
1547
  },
1548
1548
  removeLastValue() {
1549
1549
  if (!this.hasValue) return;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@vitorfba/vue-treeselect",
3
3
  "author": "vitorfba",
4
4
  "license": "MIT",
5
- "version": "1.0.0",
5
+ "version": "1.0.1",
6
6
  "description": "Tree select hierarchical component for vue 3 (compat).",
7
7
  "type": "module",
8
8
  "exports": {