@varlet/ui 2.20.6 → 2.20.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.
@@ -259,7 +259,7 @@ import './tooltip/style/index.mjs'
259
259
  import './uploader/style/index.mjs'
260
260
  import './watermark/style/index.mjs'
261
261
 
262
- const version = '2.20.6'
262
+ const version = '2.20.7'
263
263
 
264
264
  function install(app) {
265
265
  ActionSheet.install && app.use(ActionSheet)
package/es/index.mjs CHANGED
@@ -172,7 +172,7 @@ export * from './tooltip/index.mjs'
172
172
  export * from './uploader/index.mjs'
173
173
  export * from './watermark/index.mjs'
174
174
 
175
- const version = '2.20.6'
175
+ const version = '2.20.7'
176
176
 
177
177
  function install(app) {
178
178
  ActionSheet.install && app.use(ActionSheet)
@@ -234,7 +234,16 @@ const __sfc__ = defineComponent({
234
234
  let prevIndexes = [];
235
235
  buildScrollColumns();
236
236
  watch(() => props2.columns, buildScrollColumns, { deep: true });
237
- watch(() => modelValue.value, updateScrollColumnsIndex);
237
+ watch(
238
+ () => modelValue.value,
239
+ () => {
240
+ if (props2.cascade && props2.modelValue.length) {
241
+ buildScrollColumns();
242
+ } else {
243
+ updateScrollColumnsIndex();
244
+ }
245
+ }
246
+ );
238
247
  function getOptionKey(key) {
239
248
  const keyMap = {
240
249
  text: props2.textKey,
@@ -291,6 +300,10 @@ const __sfc__ = defineComponent({
291
300
  scrolling: false
292
301
  };
293
302
  scrollColumns2.push(scrollColumn);
303
+ if (props2.modelValue.length) {
304
+ const index = children.findIndex((option) => modelValue.value[scrollColumns2.length - 1] === getValue(option));
305
+ scrollColumn.index = index === -1 ? 0 : index;
306
+ }
294
307
  scrollTo(scrollColumn);
295
308
  createChildren(scrollColumns2, (_a = scrollColumn.column[scrollColumn.index][getOptionKey("children")]) != null ? _a : []);
296
309
  }
@@ -302,7 +315,9 @@ const __sfc__ = defineComponent({
302
315
  }
303
316
  function buildScrollColumns() {
304
317
  scrollColumns.value = props2.cascade ? normalizeCascadeMode(props2.columns) : normalizeNormalMode(props2.columns);
305
- updateScrollColumnsIndex();
318
+ if (!props2.cascade) {
319
+ updateScrollColumnsIndex();
320
+ }
306
321
  }
307
322
  function updateScrollColumnsIndex() {
308
323
  scrollColumns.value.forEach((scrollColumn, idx) => {
@@ -414,7 +429,7 @@ const __sfc__ = defineComponent({
414
429
  if (isSamePicked()) {
415
430
  return;
416
431
  }
417
- if (cascade) {
432
+ if (cascade && !props2.modelValue.length) {
418
433
  rebuildChildren(scrollColumn);
419
434
  }
420
435
  const hasScrolling = scrollColumns.value.some((scrollColumn2) => scrollColumn2.scrolling);
@@ -1,8 +1,8 @@
1
1
  import '../../styles/common.css'
2
+ import '../SnackbarSfc.css'
2
3
  import '../../styles/elevation.css'
3
4
  import '../../loading/loading.css'
4
5
  import '../../button/button.css'
5
6
  import '../../icon/icon.css'
6
7
  import '../snackbar.css'
7
8
  import '../coreSfc.css'
8
- import '../SnackbarSfc.css'
package/es/varlet.esm.js CHANGED
@@ -6083,8 +6083,8 @@ const Lf = ee({
6083
6083
  } = e;
6084
6084
  if (u != null && u.value || s != null && s.value || Z || pe || H || !oe || c.value)
6085
6085
  return;
6086
- const B = new ut(z(te)).minus(new ut(z(Q))).toString(), Y = $(B), me = z(Y);
6087
- w(q, me), W ? w(se, me, j) : (G(Y), S("onDecrement"));
6086
+ const B = new ut(z(te)).minus(new ut(z(Q))).toString(), Y = $(B), he = z(Y);
6087
+ w(q, he), W ? w(se, he, j) : (G(Y), S("onDecrement"));
6088
6088
  }
6089
6089
  function O() {
6090
6090
  const {
@@ -6100,8 +6100,8 @@ const Lf = ee({
6100
6100
  } = e;
6101
6101
  if (u != null && u.value || s != null && s.value || Z || pe || H || !oe || d.value)
6102
6102
  return;
6103
- const B = new ut(z(te)).plus(new ut(z(Q))).toString(), Y = $(B), me = z(Y);
6104
- w(q, me), W ? w(se, me, j) : (G(Y), S("onIncrement"));
6103
+ const B = new ut(z(te)).plus(new ut(z(Q))).toString(), Y = $(B), he = z(Y);
6104
+ w(q, he), W ? w(se, he, j) : (G(Y), S("onIncrement"));
6105
6105
  }
6106
6106
  function M() {
6107
6107
  const { press: Z, lazyChange: pe } = e;
@@ -7732,7 +7732,7 @@ const Qf = ee({
7732
7732
  const { clientX: be, clientY: ke } = fe.touches[0], Ne = be - oe, Ve = ke - W;
7733
7733
  te = B(Math.abs(Ne), Math.abs(Ve)), Q = Ne > 0 ? "prev" : "next";
7734
7734
  }
7735
- function me() {
7735
+ function he() {
7736
7736
  return W1(this, null, function* () {
7737
7737
  if (G.value || te !== "x")
7738
7738
  return;
@@ -7751,20 +7751,20 @@ const Qf = ee({
7751
7751
  const ke = be === "year" ? b : be === "month" ? h : y, Ne = be === "year" ? "YYYY" : be === "month" ? "YYYY-MM" : "YYYY-MM-DD", Ve = ke.value.map((cn) => le(cn).format(Ne)), en = Ve.findIndex((cn) => cn === fe);
7752
7752
  en === -1 ? Ve.push(fe) : Ve.splice(en, 1), w(e["onUpdate:modelValue"], Ve), w(e.onChange, Ve);
7753
7753
  }
7754
- function he(fe, be) {
7754
+ function me(fe, be) {
7755
7755
  return !u.value || !s.value ? !1 : pe.value ? fe === "year" ? be < z(u.value) : fe === "month" ? be < s.value : H.value ? be < z(d.value) : s.value > c.value : u.value > f.value;
7756
7756
  }
7757
7757
  function $e(fe) {
7758
7758
  const { readonly: be, range: ke, multiple: Ne, onChange: Ve, "onUpdate:modelValue": en } = e;
7759
7759
  if (fe < 0 || be)
7760
7760
  return;
7761
- m.value = he("day", fe);
7761
+ m.value = me("day", fe);
7762
7762
  const cn = `${f.value}-${c.value}-${fe}`, hn = le(cn).format("YYYY-MM-DD");
7763
7763
  ke ? Oe(hn, "day") : Ne ? x(hn, "day") : (w(en, hn), w(Ve, hn));
7764
7764
  }
7765
7765
  function de(fe) {
7766
7766
  const { type: be, readonly: ke, range: Ne, multiple: Ve, onChange: en, onPreview: cn, "onUpdate:modelValue": hn } = e;
7767
- if (m.value = he("month", fe), be === "month" && !ke) {
7767
+ if (m.value = me("month", fe), be === "month" && !ke) {
7768
7768
  const Tt = `${f.value}-${fe}`;
7769
7769
  Ne ? Oe(Tt, "month") : Ve ? x(Tt, "month") : (w(hn, Tt), w(en, Tt));
7770
7770
  } else
@@ -7778,7 +7778,7 @@ const Qf = ee({
7778
7778
  }
7779
7779
  function Pe(fe) {
7780
7780
  const { type: be, readonly: ke, range: Ne, multiple: Ve, onChange: en, onPreview: cn, "onUpdate:modelValue": hn } = e;
7781
- m.value = he("year", fe), be === "year" && !ke ? Ne ? Oe(`${fe}`, "year") : Ve ? x(`${fe}`, "year") : (w(hn, `${fe}`), w(en, `${fe}`)) : (f.value = `${fe}`, w(
7781
+ m.value = me("year", fe), be === "year" && !ke ? Ne ? Oe(`${fe}`, "year") : Ve ? x(`${fe}`, "year") : (w(hn, `${fe}`), w(en, `${fe}`)) : (f.value = `${fe}`, w(
7782
7782
  cn,
7783
7783
  z(f.value),
7784
7784
  z(c.value),
@@ -7855,7 +7855,7 @@ const Qf = ee({
7855
7855
  clickEl: q,
7856
7856
  handleTouchstart: se,
7857
7857
  handleTouchmove: Y,
7858
- handleTouchend: me,
7858
+ handleTouchend: he,
7859
7859
  getChooseDay: $e,
7860
7860
  getChooseMonth: de,
7861
7861
  getChooseYear: Pe,
@@ -8409,7 +8409,7 @@ const ov = ee({
8409
8409
  function M() {
8410
8410
  if (e.attraction == null)
8411
8411
  return;
8412
- const { halfWidth: G, halfHeight: j, top: Z, bottom: pe, left: H, right: oe } = I(), { minX: W, minY: Q, maxX: te, maxY: q } = O(), se = H + G - y.left, B = oe + G - y.right, Y = Z + j - y.top, me = pe + j - y.bottom, Oe = se <= B, x = Y <= me;
8412
+ const { halfWidth: G, halfHeight: j, top: Z, bottom: pe, left: H, right: oe } = I(), { minX: W, minY: Q, maxX: te, maxY: q } = O(), se = H + G - y.left, B = oe + G - y.right, Y = Z + j - y.top, he = pe + j - y.bottom, Oe = se <= B, x = Y <= he;
8413
8413
  e.attraction.includes("x") && (o.value = Oe ? W : te), e.attraction.includes("y") && (r.value = x ? Q : q);
8414
8414
  }
8415
8415
  function E() {
@@ -8833,8 +8833,8 @@ function tw(e) {
8833
8833
  }
8834
8834
  if (M)
8835
8835
  for (var W = b ? 3 : 1, Q = function(B) {
8836
- var Y = $.find(function(me) {
8837
- var Oe = O.get(me);
8836
+ var Y = $.find(function(he) {
8837
+ var Oe = O.get(he);
8838
8838
  if (Oe)
8839
8839
  return Oe.slice(0, B).every(function(x) {
8840
8840
  return x;
@@ -10903,7 +10903,7 @@ const Pv = ee({
10903
10903
  function Y(de) {
10904
10904
  e.navigation === "hover" && (s.value = de);
10905
10905
  }
10906
- function me(de) {
10906
+ function he(de) {
10907
10907
  return e.navigation !== "hover" ? "" : xu(`--navigation${e.vertical ? "-vertical" : ""}-${de}-animation`);
10908
10908
  }
10909
10909
  function Oe() {
@@ -10926,7 +10926,7 @@ const Pv = ee({
10926
10926
  Ee !== c.value - 1 && (a.value = l.value * -t.value);
10927
10927
  });
10928
10928
  }
10929
- function he(de) {
10929
+ function me(de) {
10930
10930
  return Rt(this, null, function* () {
10931
10931
  if (c.value <= 1)
10932
10932
  return;
@@ -10943,7 +10943,7 @@ const Pv = ee({
10943
10943
  if (c.value <= 1 || de === l.value)
10944
10944
  return;
10945
10945
  de = de < 0 ? 0 : de, de = de >= c.value ? c.value : de;
10946
- const Me = de > l.value ? x : he, Ee = Math.abs(de - l.value);
10946
+ const Me = de > l.value ? x : me, Ee = Math.abs(de - l.value);
10947
10947
  Array.from({ length: Ee }).forEach((dn, Vn) => {
10948
10948
  Me({ event: Vn === Ee - 1 ? Pe == null ? void 0 : Pe.event : !1 });
10949
10949
  });
@@ -10962,12 +10962,12 @@ const Pv = ee({
10962
10962
  handleTouchmove: se,
10963
10963
  handleTouchend: B,
10964
10964
  next: x,
10965
- prev: he,
10965
+ prev: me,
10966
10966
  to: $e,
10967
10967
  resize: Oe,
10968
10968
  toNumber: z,
10969
10969
  handleHovering: Y,
10970
- getNavigationAnimation: me
10970
+ getNavigationAnimation: he
10971
10971
  };
10972
10972
  }
10973
10973
  });
@@ -11189,7 +11189,7 @@ const Ev = ee({
11189
11189
  const { images: q, current: se, initialIndex: B } = e;
11190
11190
  if (B != null)
11191
11191
  return z(B);
11192
- const Y = q.findIndex((me) => me === se);
11192
+ const Y = q.findIndex((he) => he === se);
11193
11193
  return Math.max(Y, 0);
11194
11194
  }), p = N(() => {
11195
11195
  const { imagePreventDefault: q, show: se } = e;
@@ -11246,27 +11246,27 @@ const Ev = ee({
11246
11246
  m(q), P.prev = B;
11247
11247
  }
11248
11248
  function _(q) {
11249
- const { offsetWidth: se, offsetHeight: B } = q, { naturalWidth: Y, naturalHeight: me } = q.querySelector(`.${od("image")}`);
11249
+ const { offsetWidth: se, offsetHeight: B } = q, { naturalWidth: Y, naturalHeight: he } = q.querySelector(`.${od("image")}`);
11250
11250
  return {
11251
11251
  width: se,
11252
11252
  height: B,
11253
- imageRadio: me / Y,
11253
+ imageRadio: he / Y,
11254
11254
  rootRadio: B / se,
11255
11255
  zoom: z(e.zoom)
11256
11256
  };
11257
11257
  }
11258
11258
  function G(q) {
11259
- const { zoom: se, imageRadio: B, rootRadio: Y, width: me, height: Oe } = _(q);
11259
+ const { zoom: se, imageRadio: B, rootRadio: Y, width: he, height: Oe } = _(q);
11260
11260
  if (!B)
11261
11261
  return 0;
11262
- const x = B > Y ? Oe / B : me;
11263
- return Math.max(0, (se * x - me) / 2) / se;
11262
+ const x = B > Y ? Oe / B : he;
11263
+ return Math.max(0, (se * x - he) / 2) / se;
11264
11264
  }
11265
11265
  function j(q) {
11266
- const { zoom: se, imageRadio: B, rootRadio: Y, width: me, height: Oe } = _(q);
11266
+ const { zoom: se, imageRadio: B, rootRadio: Y, width: he, height: Oe } = _(q);
11267
11267
  if (!B)
11268
11268
  return 0;
11269
- const x = B > Y ? Oe : me * B;
11269
+ const x = B > Y ? Oe : he * B;
11270
11270
  return Math.max(0, (se * x - Oe) / 2) / se;
11271
11271
  }
11272
11272
  function Z(q) {
@@ -13731,7 +13731,12 @@ const cm = ee({
13731
13731
  setup(e) {
13732
13732
  const n = Qn(e, "modelValue"), t = C([]), o = N(() => qe(e.optionHeight)), r = N(() => qe(e.optionCount)), a = N(() => r.value * o.value / 2 - o.value / 2), i = N(() => r.value * o.value), { prevY: l, moveY: s, dragging: u, startTouch: d, moveTouch: c, endTouch: f } = lo();
13733
13733
  let m = [];
13734
- P(), ce(() => e.columns, P, { deep: !0 }), ce(() => n.value, I);
13734
+ P(), ce(() => e.columns, P, { deep: !0 }), ce(
13735
+ () => n.value,
13736
+ () => {
13737
+ e.cascade && e.modelValue.length ? P() : I();
13738
+ }
13739
+ );
13735
13740
  function b(B) {
13736
13741
  return {
13737
13742
  text: e.textKey,
@@ -13748,7 +13753,7 @@ const cm = ee({
13748
13753
  }
13749
13754
  function p(B) {
13750
13755
  return B.map((Y) => {
13751
- const me = {
13756
+ const he = {
13752
13757
  id: $d++,
13753
13758
  prevY: 0,
13754
13759
  momentumPrevY: 0,
@@ -13761,7 +13766,7 @@ const cm = ee({
13761
13766
  scrollEl: null,
13762
13767
  scrolling: !1
13763
13768
  };
13764
- return _(me), me;
13769
+ return _(he), he;
13765
13770
  });
13766
13771
  }
13767
13772
  function S(B) {
@@ -13769,7 +13774,7 @@ const cm = ee({
13769
13774
  return T(Y, B), Y;
13770
13775
  }
13771
13776
  function T(B, Y) {
13772
- var me;
13777
+ var he;
13773
13778
  if (Y.length) {
13774
13779
  const Oe = {
13775
13780
  id: $d++,
@@ -13784,7 +13789,11 @@ const cm = ee({
13784
13789
  scrollEl: null,
13785
13790
  scrolling: !1
13786
13791
  };
13787
- B.push(Oe), _(Oe), T(B, (me = Oe.column[Oe.index][b("children")]) != null ? me : []);
13792
+ if (B.push(Oe), e.modelValue.length) {
13793
+ const x = Y.findIndex((me) => n.value[B.length - 1] === h(me));
13794
+ Oe.index = x === -1 ? 0 : x;
13795
+ }
13796
+ _(Oe), T(B, (he = Oe.column[Oe.index][b("children")]) != null ? he : []);
13788
13797
  }
13789
13798
  }
13790
13799
  function $(B) {
@@ -13792,11 +13801,11 @@ const cm = ee({
13792
13801
  t.value.splice(t.value.indexOf(B) + 1), T(t.value, (Y = B.column[B.index][b("children")]) != null ? Y : []);
13793
13802
  }
13794
13803
  function P() {
13795
- t.value = e.cascade ? S(e.columns) : p(e.columns), I();
13804
+ t.value = e.cascade ? S(e.columns) : p(e.columns), e.cascade || I();
13796
13805
  }
13797
13806
  function I() {
13798
- t.value.forEach((Y, me) => {
13799
- const Oe = Y.column.findIndex((x) => n.value[me] === h(x));
13807
+ t.value.forEach((Y, he) => {
13808
+ const Oe = Y.column.findIndex((x) => n.value[he] === h(x));
13800
13809
  Y.index = Oe === -1 ? 0 : Oe, _(Y);
13801
13810
  });
13802
13811
  const { indexes: B } = U();
@@ -13809,32 +13818,32 @@ const cm = ee({
13809
13818
  w(e["onUpdate:show"], B);
13810
13819
  }
13811
13820
  function E(B) {
13812
- const Y = a.value - B.column.length * o.value, me = o.value + a.value;
13813
- B.translate = vt(B.translate, Y, me);
13821
+ const Y = a.value - B.column.length * o.value, he = o.value + a.value;
13822
+ B.translate = vt(B.translate, Y, he);
13814
13823
  }
13815
13824
  function V(B, Y) {
13816
- const me = Math.round((a.value - Y) / o.value);
13817
- return Kh(me, B.column);
13825
+ const he = Math.round((a.value - Y) / o.value);
13826
+ return Kh(he, B.column);
13818
13827
  }
13819
13828
  function R(B) {
13820
13829
  return B.translate = a.value - B.index * o.value, B.translate;
13821
13830
  }
13822
13831
  function U() {
13823
- const B = [], Y = [], me = [];
13832
+ const B = [], Y = [], he = [];
13824
13833
  return t.value.forEach(({ column: Oe, index: x }) => {
13825
- const he = Oe[x];
13826
- B.push(h(he)), Y.push(x), me.push(he);
13834
+ const me = Oe[x];
13835
+ B.push(h(me)), Y.push(x), he.push(me);
13827
13836
  }), {
13828
13837
  values: B,
13829
13838
  indexes: Y,
13830
- options: me
13839
+ options: he
13831
13840
  };
13832
13841
  }
13833
13842
  function _(B, Y = 0) {
13834
13843
  R(B), B.duration = Y;
13835
13844
  }
13836
- function G(B, Y, me) {
13837
- B.translate += Math.abs(Y / me) / 3e-3 * (Y < 0 ? -1 : 1);
13845
+ function G(B, Y, he) {
13846
+ B.translate += Math.abs(Y / he) / 3e-3 * (Y < 0 ? -1 : 1);
13838
13847
  }
13839
13848
  function j(B, Y) {
13840
13849
  u.value || (B.index = Y, _(B, yd));
@@ -13846,31 +13855,31 @@ const cm = ee({
13846
13855
  if (!Y.touching)
13847
13856
  return;
13848
13857
  c(B), Y.scrolling = !1, Y.duration = 0, Y.prevY = l.value, Y.translate += s.value, E(Y);
13849
- const me = performance.now();
13850
- me - Y.momentumTime > bd && (Y.momentumTime = me, Y.momentumPrevY = Y.translate);
13858
+ const he = performance.now();
13859
+ he - Y.momentumTime > bd && (Y.momentumTime = he, Y.momentumPrevY = Y.translate);
13851
13860
  }
13852
13861
  function H(B) {
13853
13862
  f(), B.touching = !1, B.prevY = 0;
13854
- const Y = B.translate - B.momentumPrevY, me = performance.now() - B.momentumTime, Oe = Math.abs(Y) >= gk && me <= bd, x = B.translate;
13855
- Oe && G(B, Y, me), B.index = V(B, B.translate), _(B, Oe ? bk : yd), B.scrolling = B.translate !== x, B.scrolling || Q(B);
13863
+ const Y = B.translate - B.momentumPrevY, he = performance.now() - B.momentumTime, Oe = Math.abs(Y) >= gk && he <= bd, x = B.translate;
13864
+ Oe && G(B, Y, he), B.index = V(B, B.translate), _(B, Oe ? bk : yd), B.scrolling = B.translate !== x, B.scrolling || Q(B);
13856
13865
  }
13857
13866
  function oe(B) {
13858
13867
  B.scrolling = !1, Q(B);
13859
13868
  }
13860
13869
  function W() {
13861
13870
  const { indexes: B } = U();
13862
- return B.every((Y, me) => Y === m[me]);
13871
+ return B.every((Y, he) => Y === m[he]);
13863
13872
  }
13864
13873
  function Q(B) {
13865
- const { cascade: Y, onChange: me } = e;
13874
+ const { cascade: Y, onChange: he } = e;
13866
13875
  if (W())
13867
13876
  return;
13868
- Y && $(B);
13877
+ Y && !e.modelValue.length && $(B);
13869
13878
  const Oe = t.value.some((Pe) => Pe.scrolling), x = t.value.some((Pe) => Pe.touching);
13870
13879
  if (Oe || x)
13871
13880
  return;
13872
- const { values: he, indexes: $e, options: de } = U();
13873
- y($e), w(me, he, $e, de), n.value = he;
13881
+ const { values: me, indexes: $e, options: de } = U();
13882
+ y($e), w(he, me, $e, de), n.value = me;
13874
13883
  }
13875
13884
  function te() {
13876
13885
  if (e.cascade) {
@@ -13883,13 +13892,13 @@ const cm = ee({
13883
13892
  }
13884
13893
  function q() {
13885
13894
  te();
13886
- const { values: B, indexes: Y, options: me } = U();
13887
- y(Y), w(e.onConfirm, B, Y, me);
13895
+ const { values: B, indexes: Y, options: he } = U();
13896
+ y(Y), w(e.onConfirm, B, Y, he);
13888
13897
  }
13889
13898
  function se() {
13890
13899
  te();
13891
- const { values: B, indexes: Y, options: me } = U();
13892
- y(Y), w(e.onCancel, B, Y, me);
13900
+ const { values: B, indexes: Y, options: he } = U();
13901
+ y(Y), w(e.onCancel, B, Y, he);
13893
13902
  }
13894
13903
  return {
13895
13904
  pack: Ze,
@@ -15598,13 +15607,13 @@ const Vm = ee({
15598
15607
  const { disabled: te, readonly: q, modelValue: se, onClose: B } = e;
15599
15608
  if (u != null && u.disabled.value || u != null && u.readonly.value || te || q)
15600
15609
  return;
15601
- const Y = c.find(({ label: Oe }) => Oe.value === Q), me = se.filter(
15610
+ const Y = c.find(({ label: Oe }) => Oe.value === Q), he = se.filter(
15602
15611
  (Oe) => {
15603
15612
  var x;
15604
15613
  return Oe !== ((x = Y.value.value) != null ? x : Y.label.value);
15605
15614
  }
15606
15615
  );
15607
- w(e["onUpdate:modelValue"], me), w(B, me), V("onClose");
15616
+ w(e["onUpdate:modelValue"], he), w(B, he), V("onClose");
15608
15617
  }
15609
15618
  function pe() {
15610
15619
  l.value = qe(e.offsetY), n.value = !0, t.value = !0;
@@ -16058,9 +16067,9 @@ const Rm = ee({
16058
16067
  props: Lm,
16059
16068
  setup(e) {
16060
16069
  const n = C(0), t = C(null), o = C(!1), r = N(() => z(e.max) - z(e.min)), a = N(() => n.value / r.value * z(e.step)), i = N(() => e.disabled || (d == null ? void 0 : d.disabled.value)), l = N(() => e.readonly || (d == null ? void 0 : d.readonly.value)), s = N(() => e.direction === "vertical"), { bindForm: u, form: d } = Mn(), { errorMessage: c, validateWithTrigger: f, validate: m, resetValidation: b } = Bn(), { hovering: h, handleHovering: y } = Yn(), { hovering: p, handleHovering: S } = Yn(), T = N(() => {
16061
- const { modelValue: x, range: he } = e;
16070
+ const { modelValue: x, range: me } = e;
16062
16071
  let $e = [];
16063
- return he && Fe(x) ? $e = [
16072
+ return me && Fe(x) ? $e = [
16064
16073
  {
16065
16074
  value: G(x[0]),
16066
16075
  enumValue: Ke.First,
@@ -16085,7 +16094,7 @@ const Rm = ee({
16085
16094
  }
16086
16095
  ]), $e;
16087
16096
  }), $ = N(() => {
16088
- const { activeColor: x, range: he, modelValue: $e } = e, de = he && Fe($e) ? G(Math.min($e[0], $e[1])) : 0, Pe = he && Fe($e) ? G(Math.max($e[0], $e[1])) - de : G($e);
16097
+ const { activeColor: x, range: me, modelValue: $e } = e, de = me && Fe($e) ? G(Math.min($e[0], $e[1])) : 0, Pe = me && Fe($e) ? G(Math.max($e[0], $e[1])) - de : G($e);
16089
16098
  return s.value ? {
16090
16099
  left: "0px",
16091
16100
  height: `${Pe}%`,
@@ -16106,9 +16115,9 @@ const Rm = ee({
16106
16115
  reset: Oe,
16107
16116
  validate: M,
16108
16117
  resetValidation: b
16109
- }), ce([() => e.modelValue, () => e.step], ([x, he]) => {
16110
- !B() || !Y() || o.value || me(x, z(he));
16111
- }), ce(n, () => me()), on(() => {
16118
+ }), ce([() => e.modelValue, () => e.step], ([x, me]) => {
16119
+ !B() || !Y() || o.value || he(x, z(me));
16120
+ }), ce(n, () => he()), on(() => {
16112
16121
  !B() || !Y() || (n.value = t.value[s.value ? "offsetHeight" : "offsetWidth"]);
16113
16122
  }), Er(() => {
16114
16123
  W();
@@ -16128,8 +16137,8 @@ const Rm = ee({
16128
16137
  return We(() => f(["onChange"], "onChange", e.rules, e.modelValue));
16129
16138
  }
16130
16139
  function R(x) {
16131
- const he = x.currentTarget;
16132
- return he ? s.value ? n.value - (x.clientY - xe(he).top) : x.clientX - Bp(he) : 0;
16140
+ const me = x.currentTarget;
16141
+ return me ? s.value ? n.value - (x.clientY - xe(me).top) : x.clientX - Bp(me) : 0;
16133
16142
  }
16134
16143
  function U(x) {
16135
16144
  return {
@@ -16141,22 +16150,22 @@ const Rm = ee({
16141
16150
  return e.labelVisible === "always" ? !0 : e.labelVisible === "never" ? !1 : P[x].active;
16142
16151
  }
16143
16152
  function G(x) {
16144
- const { min: he, max: $e } = e;
16145
- return x < z(he) ? 0 : x > z($e) ? 100 : (x - z(he)) / r.value * 100;
16153
+ const { min: me, max: $e } = e;
16154
+ return x < z(me) ? 0 : x > z($e) ? 100 : (x - z(me)) / r.value * 100;
16146
16155
  }
16147
16156
  function j(x) {
16148
16157
  if (!bn(x))
16149
16158
  return 0;
16150
- let he = x;
16151
- return he < Number(e.min) && (he = Number(e.min)), he > Number(e.max) && (he = Number(e.max)), parseInt(`${he}`, 10) === he ? he : z(he.toPrecision(5));
16159
+ let me = x;
16160
+ return me < Number(e.min) && (me = Number(e.min)), me > Number(e.max) && (me = Number(e.max)), parseInt(`${me}`, 10) === me ? me : z(me.toPrecision(5));
16152
16161
  }
16153
- function Z(x, he) {
16154
- i.value || he.handleHovering(x);
16162
+ function Z(x, me) {
16163
+ i.value || me.handleHovering(x);
16155
16164
  }
16156
- function pe(x, he) {
16165
+ function pe(x, me) {
16157
16166
  let $e = [];
16158
- const { step: de, range: Pe, modelValue: Me, onChange: Ee, min: dn } = e, Vn = z(de), At = Math.round(x / a.value), zt = At * Vn + z(dn), Xo = P[he].percentValue * Vn + z(dn);
16159
- if (P[he].percentValue = At, Pe && Fe(Me) && ($e = he === Ke.First ? [zt, Me[1]] : [Me[0], zt]), Xo !== zt) {
16167
+ const { step: de, range: Pe, modelValue: Me, onChange: Ee, min: dn } = e, Vn = z(de), At = Math.round(x / a.value), zt = At * Vn + z(dn), Xo = P[me].percentValue * Vn + z(dn);
16168
+ if (P[me].percentValue = At, Pe && Fe(Me) && ($e = me === Ke.First ? [zt, Me[1]] : [Me[0], zt]), Xo !== zt) {
16160
16169
  const fe = Pe ? $e.map((be) => j(be)) : j(zt);
16161
16170
  w(Ee, fe), w(e["onUpdate:modelValue"], fe), V();
16162
16171
  }
@@ -16164,7 +16173,7 @@ const Rm = ee({
16164
16173
  function H(x) {
16165
16174
  if (!e.range)
16166
16175
  return Ke.First;
16167
- const he = P[Ke.First].percentValue * a.value, $e = P[Ke.Second].percentValue * a.value, de = Math.abs(x - he), Pe = Math.abs(x - $e);
16176
+ const me = P[Ke.First].percentValue * a.value, $e = P[Ke.Second].percentValue * a.value, de = Math.abs(x - me), Pe = Math.abs(x - $e);
16168
16177
  return de <= Pe ? Ke.First : Ke.Second;
16169
16178
  }
16170
16179
  function oe() {
@@ -16173,48 +16182,48 @@ const Rm = ee({
16173
16182
  function W() {
16174
16183
  document.removeEventListener("touchmove", te), document.removeEventListener("touchend", q), document.removeEventListener("touchcancel", q);
16175
16184
  }
16176
- function Q(x, he) {
16177
- if (n.value || (n.value = t.value.offsetWidth), i.value || (P[he].active = !0), I = he, oe(), i.value || l.value)
16185
+ function Q(x, me) {
16186
+ if (n.value || (n.value = t.value.offsetWidth), i.value || (P[me].active = !0), I = me, oe(), i.value || l.value)
16178
16187
  return;
16179
16188
  w(e.onStart), o.value = !0;
16180
16189
  const { clientX: $e, clientY: de } = x.touches[0];
16181
- P[he].startPosition = s.value ? de : $e;
16190
+ P[me].startPosition = s.value ? de : $e;
16182
16191
  }
16183
16192
  function te(x) {
16184
16193
  if (Un(x), i.value || l.value || !o.value)
16185
16194
  return;
16186
- const { startPosition: he, currentOffset: $e } = P[I], { clientX: de, clientY: Pe } = x.touches[0];
16187
- let Me = (s.value ? he - Pe : de - he) + $e;
16195
+ const { startPosition: me, currentOffset: $e } = P[I], { clientX: de, clientY: Pe } = x.touches[0];
16196
+ let Me = (s.value ? me - Pe : de - me) + $e;
16188
16197
  Me <= 0 ? Me = 0 : Me >= n.value && (Me = n.value), pe(Me, I);
16189
16198
  }
16190
16199
  function q() {
16191
16200
  W();
16192
- const { range: x, modelValue: he, onEnd: $e, step: de, min: Pe } = e;
16201
+ const { range: x, modelValue: me, onEnd: $e, step: de, min: Pe } = e;
16193
16202
  if (i.value || (P[I].active = !1), i.value || l.value)
16194
16203
  return;
16195
16204
  let Me = [];
16196
16205
  P[I].currentOffset = P[I].percentValue * a.value;
16197
16206
  const Ee = P[I].percentValue * z(de) + z(Pe);
16198
- x && Fe(he) && (Me = I === Ke.First ? [Ee, he[1]] : [he[0], Ee]), w($e, x ? Me : Ee), o.value = !1;
16207
+ x && Fe(me) && (Me = I === Ke.First ? [Ee, me[1]] : [me[0], Ee]), w($e, x ? Me : Ee), o.value = !1;
16199
16208
  }
16200
16209
  function se(x) {
16201
16210
  if (i.value || l.value || x.target.closest(`.${Td("thumb")}`))
16202
16211
  return;
16203
- const he = R(x), $e = H(he);
16204
- I = $e, pe(he, $e), q();
16212
+ const me = R(x), $e = H(me);
16213
+ I = $e, pe(me, $e), q();
16205
16214
  }
16206
16215
  function B() {
16207
16216
  const x = z(e.step);
16208
16217
  return isNaN(x) ? (zs("Slider", 'type of prop "step" should be Number'), !1) : x < 0 ? (zs("Slider", '"step" should be > 0'), !1) : !0;
16209
16218
  }
16210
16219
  function Y() {
16211
- const { range: x, modelValue: he } = e;
16212
- return x && !Fe(he) ? (console.error('[Varlet] Slider: "modelValue" should be an Array'), !1) : !x && Fe(he) ? (console.error('[Varlet] Slider: "modelValue" should be a Number'), !1) : x && Fe(he) && he.length < 2 ? (console.error('[Varlet] Slider: "modelValue" should have two value'), !1) : !0;
16220
+ const { range: x, modelValue: me } = e;
16221
+ return x && !Fe(me) ? (console.error('[Varlet] Slider: "modelValue" should be an Array'), !1) : !x && Fe(me) ? (console.error('[Varlet] Slider: "modelValue" should be a Number'), !1) : x && Fe(me) && me.length < 2 ? (console.error('[Varlet] Slider: "modelValue" should have two value'), !1) : !0;
16213
16222
  }
16214
- function me(x = e.modelValue, he = z(e.step)) {
16223
+ function he(x = e.modelValue, me = z(e.step)) {
16215
16224
  const $e = (de) => {
16216
16225
  const { min: Pe, max: Me } = e;
16217
- return de < z(Pe) ? 0 : de > z(Me) ? r.value / he : (de - z(Pe)) / he;
16226
+ return de < z(Pe) ? 0 : de > z(Me) ? r.value / me : (de - z(Pe)) / me;
16218
16227
  };
16219
16228
  e.range && Fe(x) ? (P[Ke.First].percentValue = $e(x[0]), P[Ke.First].currentOffset = P[Ke.First].percentValue * a.value, P[Ke.Second].percentValue = $e(x[1]), P[Ke.Second].currentOffset = P[Ke.Second].percentValue * a.value) : bn(x) && (P[Ke.First].currentOffset = $e(x) * a.value);
16220
16229
  }
@@ -18410,8 +18419,8 @@ const ph = ee({
18410
18419
  () => e.modelValue,
18411
18420
  (W) => {
18412
18421
  if (W) {
18413
- const { hour: Q, minute: te, second: q } = gn(W), se = le().hour(Q).format("hh"), B = le().hour(Q).format("HH"), Y = le().minute(te).format("mm"), me = le().second(q).format("ss");
18414
- m.value = (se === "12" ? 0 : z(se)) * 30, c.value = z(Y) * 6, f.value = z(me) * 6, y.value = V(W), e.format !== "24hr" && (h.value = Dt(`${Q}`, 2, "0") === B && fn.includes(B) ? "pm" : "am"), r.value = e.format === "24hr" && fn.includes(B);
18422
+ const { hour: Q, minute: te, second: q } = gn(W), se = le().hour(Q).format("hh"), B = le().hour(Q).format("HH"), Y = le().minute(te).format("mm"), he = le().second(q).format("ss");
18423
+ m.value = (se === "12" ? 0 : z(se)) * 30, c.value = z(Y) * 6, f.value = z(he) * 6, y.value = V(W), e.format !== "24hr" && (h.value = Dt(`${Q}`, 2, "0") === B && fn.includes(B) ? "pm" : "am"), r.value = e.format === "24hr" && fn.includes(B);
18415
18424
  }
18416
18425
  },
18417
18426
  { immediate: !0 }
@@ -18470,8 +18479,8 @@ const ph = ee({
18470
18479
  const se = Math.round(te / 30) * 30 + 90, B = R(se), Y = r.value ? Tn[B] : fn[B];
18471
18480
  if (q.includes(Y) || (r.value = e.format === "24hr" ? E(W, Q) : !1), r.value !== i.value)
18472
18481
  return;
18473
- const me = r.value || h.value === "pm" ? fn[B] : Tn[B];
18474
- u.value = q.includes(me), !u.value && (m.value = se, l.value = !0);
18482
+ const he = r.value || h.value === "pm" ? fn[B] : Tn[B];
18483
+ u.value = q.includes(he), !u.value && (m.value = se, l.value = !0);
18475
18484
  }
18476
18485
  function G(W) {
18477
18486
  const { disableHour: Q } = o.value, te = Math.round(W / 6) * 6 + 90, se = {
@@ -18503,8 +18512,8 @@ const ph = ee({
18503
18512
  function Z() {
18504
18513
  const { left: W, top: Q, width: te, height: q } = xe(n.value);
18505
18514
  if (p.x = W + te / 2, p.y = Q + q / 2, b.value === "hour" && e.format === "24hr") {
18506
- const { rangeXMin: se, rangeXMax: B, rangeYMin: Y, rangeYMax: me } = U();
18507
- S.x = [se, B], S.y = [Y, me];
18515
+ const { rangeXMin: se, rangeXMax: B, rangeYMin: Y, rangeYMax: he } = U();
18516
+ S.x = [se, B], S.y = [Y, he];
18508
18517
  }
18509
18518
  }
18510
18519
  function pe(W) {
@@ -18906,7 +18915,7 @@ const bh = ee({
18906
18915
  const { maxsize: oe, maxlength: W, modelValue: Q, onOversize: te, onAfterRead: q, onBeforeFilter: se, readonly: B, disabled: Y } = e;
18907
18916
  if (a != null && a.disabled.value || a != null && a.readonly.value || Y || B)
18908
18917
  return;
18909
- const me = (Ee) => Ee.filter((dn) => dn.file.size > z(oe) ? (w(te, Ye(dn)), !1) : !0), Oe = (Ee) => {
18918
+ const he = (Ee) => Ee.filter((dn) => dn.file.size > z(oe) ? (w(te, Ye(dn)), !1) : !0), Oe = (Ee) => {
18910
18919
  const dn = Math.min(Ee.length, z(W) - Q.length);
18911
18920
  return Ee.slice(0, dn);
18912
18921
  }, x = (Ee) => ir(this, null, function* () {
@@ -18918,7 +18927,7 @@ const bh = ee({
18918
18927
  return Ee;
18919
18928
  });
18920
18929
  let $e = T(H).map(S);
18921
- $e = yield x($e), $e = oe != null ? me($e) : $e, $e = W != null ? Oe($e) : $e;
18930
+ $e = yield x($e), $e = oe != null ? he($e) : $e, $e = W != null ? Oe($e) : $e;
18922
18931
  const de = yield Promise.all(P($e)), Me = (yield Promise.all(I(de))).filter(({ valid: Ee }) => Ee).map(({ varFile: Ee }) => Ee);
18923
18932
  w(e["onUpdate:modelValue"], [...Q, ...Me]), H.target.value = "", Me.forEach((Ee) => w(q, Ye(Ee)));
18924
18933
  });
@@ -19257,7 +19266,7 @@ ie(li);
19257
19266
  ue(li, yh);
19258
19267
  const O6 = li;
19259
19268
  var Wl = li;
19260
- const XE = "2.20.6";
19269
+ const XE = "2.20.7";
19261
19270
  function GE(e) {
19262
19271
  Si.install && e.use(Si), ki.install && e.use(ki), Ti.install && e.use(Ti), Ei.install && e.use(Ei), Ii.install && e.use(Ii), gr.install && e.use(gr), Di.install && e.use(Di), Bi.install && e.use(Bi), Mi.install && e.use(Mi), Ni.install && e.use(Ni), mn.install && e.use(mn), Vi.install && e.use(Vi), Ai.install && e.use(Ai), br.install && e.use(br), Oo.install && e.use(Oo), zi.install && e.use(zi), yr.install && e.use(yr), Li.install && e.use(Li), Ri.install && e.use(Ri), Ui.install && e.use(Ui), kn.install && e.use(kn), ji.install && e.use(ji), Zi.install && e.use(Zi), Qi.install && e.use(Qi), _i.install && e.use(_i), xi.install && e.use(xi), Pr.install && e.use(Pr), tl.install && e.use(tl), ol.install && e.use(ol), Do.install && e.use(Do), rl.install && e.use(rl), al.install && e.use(al), $n.install && e.use($n), On.install && e.use(On), Dn.install && e.use(Dn), He.install && e.use(He), il.install && e.use(il), No.install && e.use(No), ll.install && e.use(ll), sl.install && e.use(sl), Tr.install && e.use(Tr), Po.install && e.use(Po), ul.install && e.use(ul), dl.install && e.use(dl), Kt.install && e.use(Kt), cl.install && e.use(cl), Ci.install && e.use(Ci), eo.install && e.use(eo), fl.install && e.use(fl), vl.install && e.use(vl), ml.install && e.use(ml), hl.install && e.use(hl), pl.install && e.use(pl), gl.install && e.use(gl), bl.install && e.use(bl), ht.install && e.use(ht), yl.install && e.use(yl), $l.install && e.use($l), wl.install && e.use(wl), Cl.install && e.use(Cl), Sl.install && e.use(Sl), kl.install && e.use(kl), Je.install && e.use(Je), Pl.install && e.use(Pl), Ol.install && e.use(Ol), Tl.install && e.use(Tl), El.install && e.use(El), Dl.install && e.use(Dl), Bl.install && e.use(Bl), Ml.install && e.use(Ml), Nl.install && e.use(Nl), Qt.install && e.use(Qt), Vl.install && e.use(Vl), Bo.install && e.use(Bo), Mo.install && e.use(Mo), Al.install && e.use(Al), zl.install && e.use(zl), Ll.install && e.use(Ll), Rl.install && e.use(Rl), Ul.install && e.use(Ul), Hl.install && e.use(Hl), Fl.install && e.use(Fl), Yl.install && e.use(Yl), Or.install && e.use(Or), jl.install && e.use(jl), Wl.install && e.use(Wl);
19263
19272
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "framework": "vue",
4
- "version": "2.20.6",
4
+ "version": "2.20.7",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {