@fox-js/navigation 4.0.2 → 4.0.3

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.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Transition as et, computed as X, createBlock as b, createElementBlock as nt, createElementVNode as it, createVNode as ot, defineComponent as M, normalizeClass as at, normalizeStyle as H, onBeforeUnmount as rt, onMounted as st, openBlock as D, reactive as ct, renderSlot as lt, resolveComponent as C, resolveDynamicComponent as ut, unref as j, watch as dt, withCtx as W } from "vue";
1
+ import { Transition as et, computed as X, createBlock as b, createElementBlock as nt, createElementVNode as it, createVNode as ot, defineComponent as M, normalizeClass as at, normalizeStyle as H, onBeforeUnmount as rt, onMounted as st, openBlock as L, reactive as ct, renderSlot as lt, resolveComponent as C, resolveDynamicComponent as ut, unref as j, watch as dt, withCtx as W } from "vue";
2
2
  import { FoxLeaveEnd as G, OperationType as $ } from "@fox-js/fox";
3
3
  var ft = /* @__PURE__ */ M({
4
4
  __name: "index",
@@ -6,27 +6,36 @@ var ft = /* @__PURE__ */ M({
6
6
  routerViewName: {},
7
7
  transition: {
8
8
  type: [Function, Boolean],
9
- default: !0
10
- }
9
+ default: !1
10
+ },
11
+ transitionDuration: {},
12
+ transitionTimeout: { default: 600 }
11
13
  },
12
14
  setup(t) {
13
15
  return (e, i) => {
14
16
  const n = C("fox-router-view");
15
- return D(), b(n, {
16
- transition: !1,
17
+ return L(), b(n, {
18
+ transition: t.transition,
19
+ "transition-duration": t.transitionDuration,
20
+ "transition-timeout": t.transitionTimeout,
17
21
  multi: !1,
18
22
  name: t.routerViewName
19
23
  }, {
20
24
  default: W(({ Component: l }) => [ot(et, { name: "fox-default-navigator__trans" }, {
21
- default: W(() => [(D(), b(ut(l)))]),
25
+ default: W(() => [(L(), b(ut(l)))]),
22
26
  _: 2
23
27
  }, 1024)]),
24
28
  _: 1
25
- }, 8, ["name"]);
29
+ }, 8, [
30
+ "transition",
31
+ "transition-duration",
32
+ "transition-timeout",
33
+ "name"
34
+ ]);
26
35
  };
27
36
  }
28
37
  }), vt = ft, B = 10;
29
- function gt(t, e) {
38
+ function mt(t, e) {
30
39
  return t > e && t > B ? "horizontal" : e > t && e > B ? "vertical" : "";
31
40
  }
32
41
  function F() {
@@ -46,20 +55,20 @@ function F() {
46
55
  t.deltaX = 0, t.deltaY = 0, t.offsetX = 0, t.offsetY = 0, t.direction = "", t.startTime = 0;
47
56
  };
48
57
  return {
49
- move: ((g) => {
50
- if (g.touches) {
51
- const w = g.touches[0];
52
- t.deltaX = w.clientX - t.startX, t.deltaY = w.clientY - t.startY, t.moveX = w.clientX, t.moveY = w.clientY;
58
+ move: ((m) => {
59
+ if (m.touches) {
60
+ const T = m.touches[0];
61
+ t.deltaX = T.clientX - t.startX, t.deltaY = T.clientY - t.startY, t.moveX = T.clientX, t.moveY = T.clientY;
53
62
  } else
54
- t.deltaX = g.clientX - t.startX, t.deltaY = g.clientY - t.startY, t.moveX = g.clientX, t.moveY = g.clientY;
55
- t.offsetX = Math.abs(t.deltaX), t.offsetY = Math.abs(t.deltaY), t.duration = Date.now() - t.startTime, t.direction || (t.direction = gt(t.offsetX, t.offsetY));
63
+ t.deltaX = m.clientX - t.startX, t.deltaY = m.clientY - t.startY, t.moveX = m.clientX, t.moveY = m.clientY;
64
+ t.offsetX = Math.abs(t.deltaX), t.offsetY = Math.abs(t.deltaY), t.duration = Date.now() - t.startTime, t.direction || (t.direction = mt(t.offsetX, t.offsetY));
56
65
  }),
57
- start: ((g) => {
58
- if (n(), g.touches) {
59
- const w = g.touches[0];
60
- t.startX = w.clientX, t.startY = w.clientY;
66
+ start: ((m) => {
67
+ if (n(), m.touches) {
68
+ const T = m.touches[0];
69
+ t.startX = T.clientX, t.startY = T.clientY;
61
70
  } else
62
- t.startX = g.clientX, t.startY = g.clientY;
71
+ t.startX = m.clientX, t.startY = m.clientY;
63
72
  t.startTime = Date.now();
64
73
  }),
65
74
  reset: n,
@@ -68,12 +77,12 @@ function F() {
68
77
  state: t
69
78
  };
70
79
  }
71
- function mt(t) {
80
+ function gt(t) {
72
81
  return t === window;
73
82
  }
74
83
  var J = (t) => {
75
84
  const e = j(t);
76
- if (mt(e)) {
85
+ if (gt(e)) {
77
86
  const i = e.innerWidth, n = e.innerHeight;
78
87
  return {
79
88
  top: 0,
@@ -99,34 +108,34 @@ var J = (t) => {
99
108
  detail: void 0
100
109
  };
101
110
  const n = document.createEvent("Events");
102
- let l = !0, m = !0;
103
- for (let g in e) g === "bubbles" ? l = !!e[g] : g === "cancelable" ? m = !!e[g] : n[g] = e[g];
104
- n.initEvent(t, l, m), (i ?? document).dispatchEvent(n);
105
- }, ht = 15, pt = 300, wt = 200;
106
- function xt(t) {
111
+ let l = !0, g = !0;
112
+ for (let m in e) m === "bubbles" ? l = !!e[m] : m === "cancelable" ? g = !!e[m] : n[m] = e[m];
113
+ n.initEvent(t, l, g), (i ?? document).dispatchEvent(n);
114
+ }, ht = 15, pt = 300, Tt = 200;
115
+ function wt(t) {
107
116
  t.stopPropagation();
108
117
  }
109
- function Tt(t, e, i = 1) {
118
+ function xt(t, e, i = 1) {
110
119
  return t = Math.abs(t / e) / 3e-3 * (t < 0 ? -1 : 1), t * i;
111
120
  }
112
- function S(t, e = 0, i, n = wt) {
121
+ function S(t, e = 0, i, n = Tt) {
113
122
  i === "end" ? t.style.transition = `transform ${n}ms linear` : t.style.transition = "transform 0ms linear", t.style.transform = `translate3d(${e}px, 0, 0)`;
114
123
  }
115
124
  function U(t) {
116
125
  t.style.transition = "", t.style.transform = "";
117
126
  }
118
- var _t = /^matrix\((.+)\)$/;
127
+ var yt = /^matrix\((.+)\)$/;
119
128
  function V(t) {
120
129
  let e = 0;
121
130
  const i = t, { transform: n } = window.getComputedStyle(i);
122
131
  if (n) {
123
- const l = _t.exec(n);
132
+ const l = yt.exec(n);
124
133
  l && (e = +l[1].split(/,\s*/)[4]);
125
134
  }
126
135
  return e;
127
136
  }
128
137
  var N = /* @__PURE__ */ new WeakMap();
129
- function yt(t, e, i, n, l, m, g = 600, w = 60, y = null) {
138
+ function _t(t, e, i, n, l, g, m = 600, T = 60, _ = null) {
130
139
  const a = {
131
140
  active: !0,
132
141
  startDistance: 0,
@@ -135,47 +144,47 @@ function yt(t, e, i, n, l, m, g = 600, w = 60, y = null) {
135
144
  moving: !1,
136
145
  dragging: !1,
137
146
  transitionEndTrigger: null
138
- }, p = t.previousSibling, h = F(), r = (o, f, v, E) => {
147
+ }, p = t.previousSibling, h = F(), r = (o, f, v, D) => {
139
148
  let u = f + a.startDistance;
140
149
  if (v === "end") {
141
- const _ = J(o);
142
- let x = _.width * e;
143
- u < x ? u = 0 : u = _.width, a.transitionEndTrigger = () => {
144
- a.moving = !1, m && o.classList.remove(m), setTimeout(() => {
150
+ const y = J(o);
151
+ let w = y.width * e;
152
+ u < w ? u = 0 : u = y.width, a.transitionEndTrigger = () => {
153
+ a.moving = !1, g && o.classList.remove(g), setTimeout(() => {
145
154
  p && U(p), u == 0 ? U(o) : K(G, {}, o), a.moving = !1;
146
- }, w);
147
- }, p && S(p, 0, "", 0), u > 0 && typeof n == "function" && n(l), S(o, u, "end", E);
155
+ }, T);
156
+ }, p && S(p, 0, "", 0), u > 0 && typeof n == "function" && n(l), S(o, u, "end", D);
148
157
  } else
149
158
  u < 0 && (u = 0), S(o, u, "", 0);
150
159
  }, d = () => {
151
160
  a.transitionEndTrigger && (a.transitionEndTrigger(), a.transitionEndTrigger = null);
152
161
  }, c = (o) => {
153
- if (h.start(o), a.draging = y ? y(t, h.state.startX, h.state.startY) : !0, !a.draging) {
162
+ if (h.start(o), a.draging = _ ? _(t, h.state.startX, h.state.startY) : !0, !a.draging) {
154
163
  h.reset();
155
164
  return;
156
165
  }
157
- a.scrollDistance = 0, a.moving && (a.scrollDistance = V(t)), m && t.classList.add(m), a.transitionEndTrigger = null, a.moving = !0;
158
- }, T = (o) => {
159
- a.draging && (a.moving = !0, h.move(o), !h.isVertical() && (V(t) === 0 && h.state.deltaX < 0 || (xt(o), r(t, h.state.deltaX, "", 0))));
166
+ a.scrollDistance = 0, a.moving && (a.scrollDistance = V(t)), g && t.classList.add(g), a.transitionEndTrigger = null, a.moving = !0;
167
+ }, x = (o) => {
168
+ a.draging && (a.moving = !0, h.move(o), !h.isVertical() && (V(t) === 0 && h.state.deltaX < 0 || (wt(o), r(t, h.state.deltaX, "", 0))));
160
169
  }, s = () => {
161
170
  if (!a.draging || (a.draging = !1, h.isVertical()) || V(t) === 0 && h.state.deltaX < 0) return;
162
171
  const o = h.state.deltaX;
163
172
  if (o === 0) {
164
- m && t.classList.remove(m), a.moving = !1;
173
+ g && t.classList.remove(g), a.moving = !1;
165
174
  return;
166
175
  }
167
176
  const f = h.state.duration;
168
177
  if (f < pt && Math.abs(o) > ht) {
169
- const v = Tt(o, f, i);
170
- r(t, v, "end", g);
171
- } else r(t, o, "end", g);
178
+ const v = xt(o, f, i);
179
+ r(t, v, "end", m);
180
+ } else r(t, o, "end", m);
172
181
  };
173
- t.addEventListener("transitionend", d), t.addEventListener("transitioncancel", d), t.addEventListener("touchstart", c), t.addEventListener("touchmove", T), t.addEventListener("touchend", s), t.addEventListener("touchcancel", s), N.set(t, {
182
+ t.addEventListener("transitionend", d), t.addEventListener("transitioncancel", d), t.addEventListener("touchstart", c), t.addEventListener("touchmove", x), t.addEventListener("touchend", s), t.addEventListener("touchcancel", s), N.set(t, {
174
183
  state: a,
175
184
  transitionend: d,
176
185
  transitioncancel: d,
177
186
  touchstart: c,
178
- touchmove: T,
187
+ touchmove: x,
179
188
  touchend: s,
180
189
  touchcancel: s
181
190
  });
@@ -184,7 +193,7 @@ function $t(t) {
184
193
  const e = N.get(t);
185
194
  e && (N.delete(t), t.removeEventListener("transitionend", e.transitionend), t.removeEventListener("transitioncancel", e.transitioncancel), t.removeEventListener("touchstart", e.touchstart), t.removeEventListener("touchmove", e.touchmove), t.removeEventListener("touchend", e.touchend), t.removeEventListener("touchcancel", e.touchcancel));
186
195
  }
187
- var Et = /* @__PURE__ */ M({
196
+ var Dt = /* @__PURE__ */ M({
188
197
  __name: "index",
189
198
  props: {
190
199
  dragRemove: {
@@ -207,6 +216,7 @@ var Et = /* @__PURE__ */ M({
207
216
  default: !0
208
217
  },
209
218
  transitionDuration: {},
219
+ transitionTimeout: { default: 600 },
210
220
  viewClass: {
211
221
  type: [Function, String],
212
222
  default: "fox-root-navigator__item"
@@ -218,10 +228,10 @@ var Et = /* @__PURE__ */ M({
218
228
  function l(r) {
219
229
  return (r && r.params && r.params.animationType) ?? "slide";
220
230
  }
221
- function m(r) {
231
+ function g(r) {
222
232
  return (r && r.params && r.params.dragRemove) ?? e.dragRemove;
223
233
  }
224
- const g = (r, d, c, T) => {
234
+ const m = (r, d, c, x) => {
225
235
  if (c?.opsType === $.Append || d) {
226
236
  const s = l(c), o = d ? "show" : "enter";
227
237
  if (o === "show" && (s === "pop" || n !== "leave" || (i ? l(i) : "") === "pop"))
@@ -230,7 +240,7 @@ var Et = /* @__PURE__ */ M({
230
240
  const f = `fox-root-navigator--${s}-${o}-from`, v = `fox-root-navigator--${s}-${o}-active`;
231
241
  r.classList.add(f), r.classList.add(v);
232
242
  }
233
- }, w = (r, d, c, T) => {
243
+ }, T = (r, d, c, x) => {
234
244
  if (c?.opsType === $.Append || d) {
235
245
  const s = l(c), o = d ? "show" : "enter";
236
246
  if (o === "show" && (s === "pop" || n !== "leave" || (i ? l(i) : "") === "pop"))
@@ -238,7 +248,7 @@ var Et = /* @__PURE__ */ M({
238
248
  const f = `fox-root-navigator--${s}-${o}-from`, v = `fox-root-navigator--${s}-${o}-to`;
239
249
  r.classList.remove(f), r.classList.add(v);
240
250
  }
241
- }, y = (r, d, c, T) => {
251
+ }, _ = (r, d, c, x) => {
242
252
  if (c?.opsType === $.Append || d) {
243
253
  const s = l(c), o = d ? "show" : "enter";
244
254
  if (o === "enter" && (i = null, n = null), s !== "pop") {
@@ -246,14 +256,14 @@ var Et = /* @__PURE__ */ M({
246
256
  r.classList.remove(f), r.classList.remove(v);
247
257
  }
248
258
  }
249
- if (m(c) === !0 && !d && c?.opsType === $.Append) {
259
+ if (g(c) === !0 && !d && c?.opsType === $.Append) {
250
260
  let s = null;
251
261
  e.draggableArea && (s = function(o, f, v) {
252
- const E = f - o.offsetLeft, u = v - o.offsetTop;
253
- return !(e.draggableArea?.left && E < e.draggableArea?.left || e.draggableArea?.right && E > e.draggableArea?.right || e.draggableArea?.top && u < e.draggableArea?.top || e.draggableArea?.bottom && u > e.draggableArea?.bottom);
254
- }), yt(r, e.removeMoveRatio, e.momentumReduceRatio, e.removeViewPage, c, "fox-root-navigator__item--moving", e.swipeDuration, e.resetDelay, s);
262
+ const D = f - o.offsetLeft, u = v - o.offsetTop;
263
+ return !(e.draggableArea?.left && D < e.draggableArea?.left || e.draggableArea?.right && D > e.draggableArea?.right || e.draggableArea?.top && u < e.draggableArea?.top || e.draggableArea?.bottom && u > e.draggableArea?.bottom);
264
+ }), _t(r, e.removeMoveRatio, e.momentumReduceRatio, e.removeViewPage, c, "fox-root-navigator__item--moving", e.swipeDuration, e.resetDelay, s);
255
265
  }
256
- }, a = (r, d, c, T) => {
266
+ }, a = (r, d, c, x) => {
257
267
  if (c?.opsType === $.Append || d) {
258
268
  const s = l(c), o = d ? "hide" : "leave";
259
269
  if (o === "hide" && (s === "pop" || n !== "enter" || (i ? l(i) : "") === "pop"))
@@ -262,7 +272,7 @@ var Et = /* @__PURE__ */ M({
262
272
  const f = `fox-root-navigator--${s}-${o}-from`, v = `fox-root-navigator--${s}-${o}-active`;
263
273
  r.classList.add(f), r.classList.add(v);
264
274
  }
265
- }, p = (r, d, c, T) => {
275
+ }, p = (r, d, c, x) => {
266
276
  if (c?.opsType === $.Append || d) {
267
277
  const s = l(c), o = d ? "hide" : "leave";
268
278
  if (o === "hide" && (s === "pop" || n !== "enter" || (i ? l(i) : "") === "pop"))
@@ -270,7 +280,7 @@ var Et = /* @__PURE__ */ M({
270
280
  const f = `fox-root-navigator--${s}-${o}-from`, v = `fox-root-navigator--${s}-${o}-to`;
271
281
  r.classList.remove(f), r.classList.add(v);
272
282
  }
273
- }, h = (r, d, c, T) => {
283
+ }, h = (r, d, c, x) => {
274
284
  if (c?.opsType === $.Append || d) {
275
285
  const s = l(c), o = d ? "hide" : "leave";
276
286
  if (o === "leave" && (i = null, n = null), s !== "pop") {
@@ -278,16 +288,16 @@ var Et = /* @__PURE__ */ M({
278
288
  r.classList.remove(f), r.classList.remove(v);
279
289
  }
280
290
  }
281
- m(c) && !d && $t(r);
291
+ g(c) && !d && $t(r);
282
292
  };
283
293
  return (r, d) => {
284
294
  const c = C("fox-router-view");
285
- return D(), b(c, {
295
+ return L(), b(c, {
286
296
  class: "fox-root-navigator",
287
297
  "view-class": t.viewClass,
288
- "before-enter": g,
289
- enter: w,
290
- "after-enter": y,
298
+ "before-enter": m,
299
+ enter: T,
300
+ "after-enter": _,
291
301
  "before-leave": a,
292
302
  leave: p,
293
303
  "after-leave": h,
@@ -295,41 +305,52 @@ var Et = /* @__PURE__ */ M({
295
305
  name: t.routerViewName,
296
306
  "view-tag": t.viewTag,
297
307
  transition: t.transition,
298
- "transition-duration": t.transitionDuration
308
+ "transition-duration": t.transitionDuration,
309
+ "transition-timeout": t.transitionTimeout
299
310
  }, null, 8, [
300
311
  "view-class",
301
312
  "name",
302
313
  "view-tag",
303
314
  "transition",
304
- "transition-duration"
315
+ "transition-duration",
316
+ "transition-timeout"
305
317
  ]);
306
318
  };
307
319
  }
308
- }), Lt = Et, Dt = /* @__PURE__ */ M({
320
+ }), Et = Dt, Lt = /* @__PURE__ */ M({
309
321
  __name: "index",
310
322
  props: {
311
323
  routerViewName: {},
312
324
  transition: {
313
325
  type: [Function, Boolean],
314
326
  default: !1
315
- }
327
+ },
328
+ transitionDuration: {},
329
+ transitionTimeout: { default: 600 }
316
330
  },
317
331
  setup(t) {
318
332
  return (e, i) => {
319
333
  const n = C("fox-router-view");
320
- return D(), b(n, {
334
+ return L(), b(n, {
321
335
  class: "fox-card-navigator",
322
336
  "view-class": "fox-card-navigator__item",
323
337
  "view-active-class": "fox-card-navigator__item-active",
324
338
  "view-inactive-class": "fox-card-navigator__item-inactive",
325
339
  "transition-name": "fox-card-navigator__trans",
326
340
  transition: t.transition,
341
+ "transition-duration": t.transitionDuration,
342
+ "transition-timeout": t.transitionTimeout,
327
343
  multi: !0,
328
344
  name: t.routerViewName
329
- }, null, 8, ["transition", "name"]);
345
+ }, null, 8, [
346
+ "transition",
347
+ "transition-duration",
348
+ "transition-timeout",
349
+ "name"
350
+ ]);
330
351
  };
331
352
  }
332
- }), bt = Dt, Mt = 15, At = 300, Rt = 200;
353
+ }), bt = Lt, Mt = 15, At = 300, Rt = 200;
333
354
  function Ct(t) {
334
355
  t.stopPropagation();
335
356
  }
@@ -353,7 +374,7 @@ function O(t) {
353
374
  return e;
354
375
  }
355
376
  var k = /* @__PURE__ */ new WeakMap();
356
- function It(t, e, i, n, l, m, g = 600, w = 60, y = null) {
377
+ function It(t, e, i, n, l, g, m = 600, T = 60, _ = null) {
357
378
  const a = {
358
379
  active: !0,
359
380
  startDistance: 0,
@@ -362,47 +383,47 @@ function It(t, e, i, n, l, m, g = 600, w = 60, y = null) {
362
383
  moving: !1,
363
384
  dragging: !1,
364
385
  transitionEndTrigger: null
365
- }, p = t.previousSibling, h = F(), r = (o, f, v, E) => {
386
+ }, p = t.previousSibling, h = F(), r = (o, f, v, D) => {
366
387
  let u = f + a.startDistance;
367
388
  if (v === "end") {
368
- const _ = J(o);
369
- let x = _.width * e;
370
- u < x ? u = 0 : u = _.width, a.transitionEndTrigger = () => {
371
- a.moving = !1, m && o.classList.remove(m), setTimeout(() => {
389
+ const y = J(o);
390
+ let w = y.width * e;
391
+ u < w ? u = 0 : u = y.width, a.transitionEndTrigger = () => {
392
+ a.moving = !1, g && o.classList.remove(g), setTimeout(() => {
372
393
  p && z(p), u == 0 ? z(o) : K(G, {}, o), a.moving = !1;
373
- }, w);
374
- }, p && Y(p, 0, "", 0), u > 0 && typeof n == "function" && n(l), Y(o, u, "end", E);
394
+ }, T);
395
+ }, p && Y(p, 0, "", 0), u > 0 && typeof n == "function" && n(l), Y(o, u, "end", D);
375
396
  } else
376
397
  u < 0 && (u = 0), Y(o, u, "", 0);
377
398
  }, d = () => {
378
399
  a.transitionEndTrigger && (a.transitionEndTrigger(), a.transitionEndTrigger = null);
379
400
  }, c = (o) => {
380
- if (h.start(o), a.draging = y ? y(t, h.state.startX, h.state.startY) : !0, !a.draging) {
401
+ if (h.start(o), a.draging = _ ? _(t, h.state.startX, h.state.startY) : !0, !a.draging) {
381
402
  h.reset();
382
403
  return;
383
404
  }
384
- a.scrollDistance = 0, a.moving && (a.scrollDistance = O(t)), m && t.classList.add(m), a.transitionEndTrigger = null, a.moving = !0;
385
- }, T = (o) => {
405
+ a.scrollDistance = 0, a.moving && (a.scrollDistance = O(t)), g && t.classList.add(g), a.transitionEndTrigger = null, a.moving = !0;
406
+ }, x = (o) => {
386
407
  a.draging && (a.moving = !0, h.move(o), !h.isVertical() && (O(t) === 0 && h.state.deltaX < 0 || (Ct(o), r(t, h.state.deltaX, "", 0))));
387
408
  }, s = () => {
388
409
  if (!a.draging || (a.draging = !1, h.isVertical()) || O(t) === 0 && h.state.deltaX < 0) return;
389
410
  const o = h.state.deltaX;
390
411
  if (o === 0) {
391
- m && t.classList.remove(m), a.moving = !1;
412
+ g && t.classList.remove(g), a.moving = !1;
392
413
  return;
393
414
  }
394
415
  const f = h.state.duration;
395
416
  if (f < At && Math.abs(o) > Mt) {
396
417
  const v = Xt(o, f, i);
397
- r(t, v, "end", g);
398
- } else r(t, o, "end", g);
418
+ r(t, v, "end", m);
419
+ } else r(t, o, "end", m);
399
420
  };
400
- t.addEventListener("transitionend", d), t.addEventListener("transitioncancel", d), t.addEventListener("touchstart", c), t.addEventListener("touchmove", T), t.addEventListener("touchend", s), t.addEventListener("touchcancel", s), k.set(t, {
421
+ t.addEventListener("transitionend", d), t.addEventListener("transitioncancel", d), t.addEventListener("touchstart", c), t.addEventListener("touchmove", x), t.addEventListener("touchend", s), t.addEventListener("touchcancel", s), k.set(t, {
401
422
  state: a,
402
423
  transitionend: d,
403
424
  transitioncancel: d,
404
425
  touchstart: c,
405
- touchmove: T,
426
+ touchmove: x,
406
427
  touchend: s,
407
428
  touchcancel: s
408
429
  });
@@ -434,6 +455,7 @@ var Vt = /* @__PURE__ */ M({
434
455
  default: !0
435
456
  },
436
457
  transitionDuration: {},
458
+ transitionTimeout: { default: 600 },
437
459
  viewClass: {
438
460
  type: [Function, String],
439
461
  default: "fox-stack-navigator__item"
@@ -445,10 +467,10 @@ var Vt = /* @__PURE__ */ M({
445
467
  function l(r) {
446
468
  return (r && r.params && r.params.animationType) ?? "slide";
447
469
  }
448
- function m(r) {
470
+ function g(r) {
449
471
  return (r && r.params && r.params.dragRemove) ?? e.dragRemove;
450
472
  }
451
- const g = (r, d, c, T) => {
473
+ const m = (r, d, c, x) => {
452
474
  if (c?.opsType === $.Append || d) {
453
475
  const s = l(c), o = d ? "show" : "enter";
454
476
  if (o === "show" && (s === "pop" || n !== "leave" || (i ? l(i) : "") === "pop"))
@@ -457,7 +479,7 @@ var Vt = /* @__PURE__ */ M({
457
479
  const f = `fox-stack-navigator--${s}-${o}-from`, v = `fox-stack-navigator--${s}-${o}-active`;
458
480
  r.classList.add(f), r.classList.add(v);
459
481
  }
460
- }, w = (r, d, c, T) => {
482
+ }, T = (r, d, c, x) => {
461
483
  if (c?.opsType === $.Append || d) {
462
484
  const s = l(c), o = d ? "show" : "enter";
463
485
  if (o === "show" && (s === "pop" || n !== "leave" || (i ? l(i) : "") === "pop"))
@@ -465,7 +487,7 @@ var Vt = /* @__PURE__ */ M({
465
487
  const f = `fox-stack-navigator--${s}-${o}-from`, v = `fox-stack-navigator--${s}-${o}-to`;
466
488
  r.classList.remove(f), r.classList.add(v);
467
489
  }
468
- }, y = (r, d, c, T) => {
490
+ }, _ = (r, d, c, x) => {
469
491
  if (c?.opsType === $.Append || d) {
470
492
  const s = l(c), o = d ? "show" : "enter";
471
493
  if (o === "enter" && (i = null, n = null), s !== "pop") {
@@ -473,14 +495,14 @@ var Vt = /* @__PURE__ */ M({
473
495
  r.classList.remove(f), r.classList.remove(v);
474
496
  }
475
497
  }
476
- if (m(c) === !0 && !d && c?.opsType === $.Append) {
498
+ if (g(c) === !0 && !d && c?.opsType === $.Append) {
477
499
  let s = null;
478
500
  e.draggableArea && (s = function(o, f, v) {
479
- const E = f - o.offsetLeft, u = v - o.offsetTop;
480
- return !(e.draggableArea?.left && E < e.draggableArea?.left || e.draggableArea?.right && E > e.draggableArea?.right || e.draggableArea?.top && u < e.draggableArea?.top || e.draggableArea?.bottom && u > e.draggableArea?.bottom);
501
+ const D = f - o.offsetLeft, u = v - o.offsetTop;
502
+ return !(e.draggableArea?.left && D < e.draggableArea?.left || e.draggableArea?.right && D > e.draggableArea?.right || e.draggableArea?.top && u < e.draggableArea?.top || e.draggableArea?.bottom && u > e.draggableArea?.bottom);
481
503
  }), It(r, e.removeMoveRatio, e.momentumReduceRatio, e.removeViewPage, c, "fox-stack-navigator__item--moving", e.swipeDuration, e.resetDelay, s);
482
504
  }
483
- }, a = (r, d, c, T) => {
505
+ }, a = (r, d, c, x) => {
484
506
  if (c?.opsType === $.Append || d) {
485
507
  const s = l(c), o = d ? "hide" : "leave";
486
508
  if (o === "hide" && (s === "pop" || n !== "enter" || (i ? l(i) : "") === "pop"))
@@ -489,7 +511,7 @@ var Vt = /* @__PURE__ */ M({
489
511
  const f = `fox-stack-navigator--${s}-${o}-from`, v = `fox-stack-navigator--${s}-${o}-active`;
490
512
  r.classList.add(f), r.classList.add(v);
491
513
  }
492
- }, p = (r, d, c, T) => {
514
+ }, p = (r, d, c, x) => {
493
515
  if (c?.opsType === $.Append || d) {
494
516
  const s = l(c), o = d ? "hide" : "leave";
495
517
  if (o === "hide" && (s === "pop" || n !== "enter" || (i ? l(i) : "") === "pop"))
@@ -497,7 +519,7 @@ var Vt = /* @__PURE__ */ M({
497
519
  const f = `fox-stack-navigator--${s}-${o}-from`, v = `fox-stack-navigator--${s}-${o}-to`;
498
520
  r.classList.remove(f), r.classList.add(v);
499
521
  }
500
- }, h = (r, d, c, T) => {
522
+ }, h = (r, d, c, x) => {
501
523
  if (c?.opsType === $.Append || d) {
502
524
  const s = l(c), o = d ? "hide" : "leave";
503
525
  if (o === "leave" && (i = null, n = null), s !== "pop") {
@@ -505,16 +527,16 @@ var Vt = /* @__PURE__ */ M({
505
527
  r.classList.remove(f), r.classList.remove(v);
506
528
  }
507
529
  }
508
- m(c) && !d && St(r);
530
+ g(c) && !d && St(r);
509
531
  };
510
532
  return (r, d) => {
511
533
  const c = C("fox-router-view");
512
- return D(), b(c, {
534
+ return L(), b(c, {
513
535
  class: "fox-stack-navigator",
514
536
  "view-class": t.viewClass,
515
- "before-enter": g,
516
- enter: w,
517
- "after-enter": y,
537
+ "before-enter": m,
538
+ enter: T,
539
+ "after-enter": _,
518
540
  "before-leave": a,
519
541
  leave: p,
520
542
  "after-leave": h,
@@ -522,13 +544,15 @@ var Vt = /* @__PURE__ */ M({
522
544
  name: t.routerViewName,
523
545
  "view-tag": t.viewTag,
524
546
  transition: t.transition,
525
- "transition-duration": t.transitionDuration
547
+ "transition-duration": t.transitionDuration,
548
+ "transition-timeout": t.transitionTimeout
526
549
  }, null, 8, [
527
550
  "view-class",
528
551
  "name",
529
552
  "view-tag",
530
553
  "transition",
531
- "transition-duration"
554
+ "transition-duration",
555
+ "transition-timeout"
532
556
  ]);
533
557
  };
534
558
  }
@@ -548,7 +572,7 @@ var Vt = /* @__PURE__ */ M({
548
572
  };
549
573
  return e.scrollDuration > 0 && (n["transition-duration"] = `${e.scrollDuration}ms`), n;
550
574
  });
551
- return (n, l) => (D(), nt("div", Ot, [it("div", {
575
+ return (n, l) => (L(), nt("div", Ot, [it("div", {
552
576
  class: "fox-swiper-navigator__inner",
553
577
  style: H(i.value)
554
578
  }, [lt(n.$slots, "default")], 4)]));
@@ -589,34 +613,34 @@ var jt = class {
589
613
  touchmove = null;
590
614
  touchend = null;
591
615
  touchcancel = null;
592
- constructor(t, e, i, n, l, m) {
593
- this.getStartDistance = t, this.openPage = e, this.isPageOpened = i, this.pageOpened = n, this.moveRatio = l, this.momentumReduceRatio = m;
616
+ constructor(t, e, i, n, l, g) {
617
+ this.getStartDistance = t, this.openPage = e, this.isPageOpened = i, this.pageOpened = n, this.moveRatio = l, this.momentumReduceRatio = g;
594
618
  }
595
619
  open() {
596
- const t = this.el, e = F(), i = (n, l, m, g) => {
597
- let w = l + this.startDistance;
598
- const y = this.columnWidth * this.moveRatio;
599
- if (m === "end") {
620
+ const t = this.el, e = F(), i = (n, l, g, m) => {
621
+ let T = l + this.startDistance;
622
+ const _ = this.columnWidth * this.moveRatio;
623
+ if (g === "end") {
600
624
  if (l == 0) {
601
625
  this.moving = !1;
602
626
  return;
603
627
  }
604
- Math.abs(l) > y ? l > 0 ? w = this.startDistance + this.columnWidth : w = this.startDistance - this.columnWidth : w = this.startDistance;
605
- let a = -w;
628
+ Math.abs(l) > _ ? l > 0 ? T = this.startDistance + this.columnWidth : T = this.startDistance - this.columnWidth : T = this.startDistance;
629
+ let a = -T;
606
630
  a < 0 ? a = 0 : a > this.width - this.columnWidth && (a = this.width - this.columnWidth);
607
631
  const p = Math.floor(a / this.columnWidth);
608
- this.isPageOpened(p) || this.openPage(p), w = -p * this.columnWidth, g && g > 0 && (this.transitionEndTrigger = () => {
632
+ this.isPageOpened(p) || this.openPage(p), T = -p * this.columnWidth, m && m > 0 && (this.transitionEndTrigger = () => {
609
633
  this.moving = !1, this.pageOpened(p);
610
- }), q(n, w, "end", g), this.scrollDistance = w;
634
+ }), q(n, T, "end", m), this.scrollDistance = T;
611
635
  } else {
612
- if (Math.abs(l) > y) {
636
+ if (Math.abs(l) > _) {
613
637
  let p = 0;
614
638
  if (l > 0 ? p = Math.abs(this.startDistance + this.columnWidth) : p = Math.abs(this.startDistance - this.columnWidth), p >= 0 && p < this.width) {
615
639
  const h = Math.floor(p / this.columnWidth);
616
640
  this.isPageOpened(h) || this.openPage(h);
617
641
  }
618
642
  }
619
- let a = -w;
643
+ let a = -T;
620
644
  a < this.min ? a = this.min : a > this.max && (a = this.max), q(n, -a, "", 0);
621
645
  }
622
646
  };
@@ -632,8 +656,8 @@ var jt = class {
632
656
  if (n == 0) return;
633
657
  const l = e.state.duration;
634
658
  if (l < Ut && Math.abs(n) > Bt) {
635
- const m = Ht(n, l, this.momentumReduceRatio);
636
- i(t, m, "end", this.swipeDuration);
659
+ const g = Ht(n, l, this.momentumReduceRatio);
660
+ i(t, g, "end", this.swipeDuration);
637
661
  } else i(t, n, "end", this.swipeDuration);
638
662
  }, t.addEventListener("transitionend", this.transitionend), t.addEventListener("touchstart", this.touchstart), t.addEventListener("touchmove", this.touchmove), t.addEventListener("touchend", this.touchend), t.addEventListener("touchcancel", this.touchend);
639
663
  }
@@ -642,14 +666,14 @@ var jt = class {
642
666
  this.transitionend && t.removeEventListener("transitionend", this.transitionend), this.touchstart && t.removeEventListener("touchstart", this.touchstart), this.touchmove && t.removeEventListener("touchmove", this.touchmove), this.touchend && t.removeEventListener("touchend", this.touchend), this.touchcancel && t.removeEventListener("touchcancel", this.touchcancel), this.el = null;
643
667
  }
644
668
  };
645
- function Gt(t, e, i, n, l, m) {
646
- return new jt(t, e, i, n, l, m);
669
+ function Gt(t, e, i, n, l, g) {
670
+ return new jt(t, e, i, n, l, g);
647
671
  }
648
672
  function Jt(t) {
649
- const e = j(t), i = window.getComputedStyle(e, null), n = parseFloat(i.getPropertyValue("padding-left")), l = parseFloat(i.getPropertyValue("padding-right")), m = parseFloat(i.getPropertyValue("padding-top")), g = parseFloat(i.getPropertyValue("padding-bottom"));
673
+ const e = j(t), i = window.getComputedStyle(e, null), n = parseFloat(i.getPropertyValue("padding-left")), l = parseFloat(i.getPropertyValue("padding-right")), g = parseFloat(i.getPropertyValue("padding-top")), m = parseFloat(i.getPropertyValue("padding-bottom"));
650
674
  return {
651
675
  width: e.clientWidth - n - l,
652
- height: e.clientHeight - m - g
676
+ height: e.clientHeight - g - m
653
677
  };
654
678
  }
655
679
  var Kt = /* @__PURE__ */ M({
@@ -672,6 +696,8 @@ var Kt = /* @__PURE__ */ M({
672
696
  type: [Function, Boolean],
673
697
  default: !0
674
698
  },
699
+ transitionDuration: {},
700
+ transitionTimeout: { default: 600 },
675
701
  swipeDuration: { default: 360 },
676
702
  scrollDuration: {},
677
703
  customClass: {},
@@ -685,32 +711,32 @@ var Kt = /* @__PURE__ */ M({
685
711
  openedIndexList: [],
686
712
  width: i.width,
687
713
  height: i.height
688
- }), l = e, m = () => n.scrollDistance, g = (u) => {
714
+ }), l = e, g = () => n.scrollDistance, m = (u) => {
689
715
  if (n.openedIndexList.indexOf(u) === -1) {
690
716
  n.openedIndexList.push(u);
691
- const _ = i.routes[u];
717
+ const y = i.routes[u];
692
718
  try {
693
- i.openViewPage(_, u);
694
- } catch (x) {
695
- console.error(x);
719
+ i.openViewPage(y, u);
720
+ } catch (w) {
721
+ console.error(w);
696
722
  }
697
723
  }
698
- }, w = (u) => n.openedIndexList.indexOf(u) !== -1, y = (u) => {
724
+ }, T = (u) => n.openedIndexList.indexOf(u) !== -1, _ = (u) => {
699
725
  n.index = u, n.width > 0 ? n.scrollDistance = -n.index * n.width : n.scrollDistance = 0;
700
- const _ = i.routes[u];
701
- l("update:activePath", _.path);
726
+ const y = i.routes[u];
727
+ l("update:activePath", y.path);
702
728
  };
703
729
  let a = null;
704
- i.draggable && (a = Gt(m, g, w, y, i.moveRatio, i.momentumReduceRatio));
730
+ i.draggable && (a = Gt(g, m, T, _, i.moveRatio, i.momentumReduceRatio));
705
731
  let p = null;
706
732
  st(() => {
707
- const u = s(), _ = () => {
708
- const x = Jt(u);
709
- h(i.activePath, i.routes, x.width, x.height, i.swipeDuration, i.direction);
733
+ const u = s(), y = () => {
734
+ const w = Jt(u);
735
+ h(i.activePath, i.routes, w.width, w.height, i.swipeDuration, i.direction);
710
736
  };
711
- if (window.ResizeObserver && (p = new window.ResizeObserver(_), p.observe(u)), _(), a) {
712
- const x = f();
713
- a.el = x, a.open();
737
+ if (window.ResizeObserver && (p = new window.ResizeObserver(y), p.observe(u)), y(), a) {
738
+ const w = f();
739
+ a.el = w, a.open();
714
740
  }
715
741
  }), rt(() => {
716
742
  p && (p.disconnect(), p = null), a && a.close();
@@ -721,18 +747,18 @@ var Kt = /* @__PURE__ */ M({
721
747
  () => i.height,
722
748
  () => i.swipeDuration,
723
749
  () => i.direction
724
- ], ([u, _, x, A, R, P]) => {
725
- const I = x <= 0 ? n.width : x, L = A <= 0 ? n.height : A;
726
- h(u, _, I, L, R, P);
750
+ ], ([u, y, w, A, R, P]) => {
751
+ const I = w <= 0 ? n.width : w, E = A <= 0 ? n.height : A;
752
+ h(u, y, I, E, R, P);
727
753
  });
728
- const h = (u, _, x, A, R, P = "horizontal") => {
754
+ const h = (u, y, w, A, R, P = "horizontal") => {
729
755
  const I = u;
730
- if (n.index = _.findIndex((L) => L.path === I), P === "horizontal") {
731
- const L = x;
732
- if (L > 0) {
733
- n.width = x;
734
- const Q = L * i.routes.length, Z = -L / 3, tt = L * (_.length - 1) + L / 3;
735
- a && (a.columnWidth = L, a.width = Q, a.min = Z, a.max = tt), n.index !== -1 && (n.openedIndexList.push(n.index), n.scrollDistance = -L * n.index);
756
+ if (n.index = y.findIndex((E) => E.path === I), P === "horizontal") {
757
+ const E = w;
758
+ if (E > 0) {
759
+ n.width = w;
760
+ const Q = E * i.routes.length, Z = -E / 3, tt = E * (y.length - 1) + E / 3;
761
+ a && (a.columnWidth = E, a.width = Q, a.min = Z, a.max = tt), n.index !== -1 && (n.openedIndexList.push(n.index), n.scrollDistance = -E * n.index);
736
762
  }
737
763
  }
738
764
  a && (a.swipeDuration = R);
@@ -740,40 +766,42 @@ var Kt = /* @__PURE__ */ M({
740
766
  const u = [r];
741
767
  return i.customClass && u.push(i.customClass), u;
742
768
  }), c = X(() => {
743
- const u = {}, _ = n.width > 0 ? n.width : i.width;
744
- _ > 0 && (u.width = `${_}px`);
745
- const x = n.height > 0 ? n.height : i.height;
746
- return x > 0 && (u.height = `${x}px`), i.customStyle && Object.assign(u, i.customStyle), u;
769
+ const u = {}, y = n.width > 0 ? n.width : i.width;
770
+ y > 0 && (u.width = `${y}px`);
771
+ const w = n.height > 0 ? n.height : i.height;
772
+ return w > 0 && (u.height = `${w}px`), i.customStyle && Object.assign(u, i.customStyle), u;
747
773
  });
748
- let T = null;
774
+ let x = null;
749
775
  function s() {
750
- return T || (T = document.querySelector(`.${r}`), T);
776
+ return x || (x = document.querySelector(`.${r}`), x);
751
777
  }
752
778
  let o = null;
753
779
  function f() {
754
780
  return o || (o = document.querySelector(`.${r}>.fox-swiper-navigator__inner`), o);
755
781
  }
756
- const v = X(() => n.width > 0 ? `${n.width * i.routes.length}px` : "100%"), E = (u, _) => {
757
- const x = i.routes.findIndex((A) => {
782
+ const v = X(() => n.width > 0 ? `${n.width * i.routes.length}px` : "100%"), D = (u, y) => {
783
+ const w = i.routes.findIndex((A) => {
758
784
  const R = u.path ?? u.name ?? "";
759
785
  return A.path == R;
760
786
  });
761
787
  return n.width <= 0 ? {} : { style: {
762
- left: `${x * n.width}px`,
788
+ left: `${w * n.width}px`,
763
789
  width: `${n.width}px`
764
790
  } };
765
791
  };
766
- return (u, _) => {
767
- const x = C("fox-router-view");
768
- return D(), b(x, {
792
+ return (u, y) => {
793
+ const w = C("fox-router-view");
794
+ return L(), b(w, {
769
795
  class: at(d.value),
770
796
  style: H(c.value),
771
797
  "view-class": "fox-swiper-navigator__item",
772
798
  tag: kt,
773
- "view-tag-props": E,
799
+ "view-tag-props": D,
774
800
  multi: !0,
775
801
  name: t.routerViewName,
776
802
  transition: t.transition,
803
+ "transition-duration": t.transitionDuration,
804
+ "transition-timeout": t.transitionTimeout,
777
805
  "scroll-distance": n.scrollDistance,
778
806
  "scroll-duration": t.scrollDuration,
779
807
  direction: t.direction,
@@ -783,6 +811,8 @@ var Kt = /* @__PURE__ */ M({
783
811
  "style",
784
812
  "name",
785
813
  "transition",
814
+ "transition-duration",
815
+ "transition-timeout",
786
816
  "scroll-distance",
787
817
  "scroll-duration",
788
818
  "direction",
@@ -791,13 +821,13 @@ var Kt = /* @__PURE__ */ M({
791
821
  };
792
822
  }
793
823
  }), Qt = Kt, ee = { install(t, e = "fox") {
794
- t.component(`${e}-default-navigator`, vt), t.component(`${e}-root-navigator`, Lt), t.component(`${e}-card-navigator`, bt), t.component(`${e}-stack-navigator`, Yt), t.component(`${e}-swiper-navigator`, Qt);
824
+ t.component(`${e}-default-navigator`, vt), t.component(`${e}-root-navigator`, Et), t.component(`${e}-card-navigator`, bt), t.component(`${e}-stack-navigator`, Yt), t.component(`${e}-swiper-navigator`, Qt);
795
825
  } };
796
826
  export {
797
827
  bt as FoxCardNavigator,
798
828
  vt as FoxDefaultNavigator,
799
829
  ee as FoxNavigation,
800
- Lt as FoxRootNavigator,
830
+ Et as FoxRootNavigator,
801
831
  Yt as FoxStackNavigator,
802
832
  Qt as FoxSwiperNavigator,
803
833
  ee as default