@fox-js/navigation 4.0.1-19 → 4.0.1-21

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