@toife/vue 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/components/t-action.vue.d.ts +13 -0
  2. package/dist/components/t-alert.vue.d.ts +34 -0
  3. package/dist/components/t-app.vue.d.ts +17 -0
  4. package/dist/components/t-avatar.vue.d.ts +24 -0
  5. package/dist/components/t-back-button.vue.d.ts +20 -0
  6. package/dist/components/t-button.vue.d.ts +36 -0
  7. package/dist/components/t-cable.vue.d.ts +24 -0
  8. package/dist/components/t-card.vue.d.ts +22 -0
  9. package/dist/components/t-collapse.vue.d.ts +32 -0
  10. package/dist/components/t-content.vue.d.ts +17 -0
  11. package/dist/components/t-divider.vue.d.ts +7 -0
  12. package/dist/components/t-grid-item.vue.d.ts +2 -0
  13. package/dist/components/t-grid.vue.d.ts +2 -0
  14. package/dist/components/t-input.vue.d.ts +41 -0
  15. package/dist/components/t-loading-icon.vue.d.ts +23 -0
  16. package/dist/components/t-loading.vue.d.ts +33 -0
  17. package/dist/components/t-present.vue.d.ts +42 -0
  18. package/dist/components/t-pull-signal.vue.d.ts +7 -0
  19. package/dist/components/t-refresher.vue.d.ts +8 -0
  20. package/dist/components/t-rich-text.vue.d.ts +2 -0
  21. package/dist/components/t-screen.vue.d.ts +17 -0
  22. package/dist/components/t-sheet.vue.d.ts +219 -0
  23. package/dist/components/t-swipe-screen.vue.d.ts +6 -0
  24. package/dist/components/t-text.vue.d.ts +24 -0
  25. package/dist/components/t-textarea.vue.d.ts +2 -0
  26. package/dist/components/t-toogle-password.vue.d.ts +31 -0
  27. package/dist/components/t-toolbar.vue.d.ts +24 -0
  28. package/dist/controllers/action.d.ts +4 -0
  29. package/dist/controllers/alert.d.ts +4 -0
  30. package/dist/controllers/index.d.ts +6 -0
  31. package/dist/controllers/loading.d.ts +5 -0
  32. package/dist/controllers/present.d.ts +4 -0
  33. package/dist/controllers/screen.d.ts +9 -0
  34. package/dist/index.d.ts +3 -0
  35. package/dist/index.es.js +785 -0
  36. package/dist/index.umd.js +1 -0
  37. package/dist/utils/defaultEvent.d.ts +2 -0
  38. package/dist/utils/element.d.ts +2 -0
  39. package/dist/utils/index.d.ts +1 -0
  40. package/dist/vue.css +1 -0
  41. package/package.json +38 -0
@@ -0,0 +1,785 @@
1
+ import { createElementBlock as u, openBlock as a, renderSlot as m, defineComponent as w, normalizeStyle as I, normalizeClass as S, computed as x, withDirectives as X, createCommentVNode as z, createElementVNode as k, vShow as R, createVNode as ne, ref as $, watch as C, onUnmounted as V, reactive as j, Fragment as L, createBlock as B, withCtx as D, toDisplayString as P, renderList as M, createTextVNode as A, onMounted as J, unref as O, resolveDynamicComponent as se, markRaw as oe } from "vue";
2
+ import { gesture as N } from "@toife/gesture";
3
+ import { useRouter as K, useRoute as re } from "vue-router";
4
+ const q = (e) => e && (e.tagName == "INPUT" || e.tagName == "TEXTAREA" || e.isContentEditable), Y = () => {
5
+ const e = document.activeElement;
6
+ e && (e.tagName === "INPUT" || e.tagName === "TEXTAREA" || e.isContentEditable) && e.blur();
7
+ }, ae = () => {
8
+ document.addEventListener("contextmenu", (e) => e.preventDefault()), document.addEventListener("dblclick", (e) => e.preventDefault()), document.addEventListener("selectstart", (e) => e.preventDefault()), document.addEventListener("gesturestart", (e) => e.preventDefault()), document.addEventListener("pointerup", (e) => {
9
+ !q(e.target) && Y();
10
+ });
11
+ }, g = (e, n) => {
12
+ const s = e.__vccOpts || e;
13
+ for (const [o, r] of n)
14
+ s[o] = r;
15
+ return s;
16
+ }, le = {}, ce = { class: "t-app" };
17
+ function ie(e, n) {
18
+ return a(), u("div", ce, [
19
+ m(e.$slots, "default")
20
+ ]);
21
+ }
22
+ const ue = /* @__PURE__ */ g(le, [["render", ie]]), de = /* @__PURE__ */ w({
23
+ __name: "t-cable",
24
+ props: {
25
+ keyboard: { default: 0 },
26
+ placement: { default: "bottom" }
27
+ },
28
+ setup(e) {
29
+ const n = e;
30
+ return (s, o) => (a(), u("div", {
31
+ class: S(["t-cable", { keyboard: n.keyboard > 0, [n.placement]: !0 }]),
32
+ style: I({ "--t-keyboard-height": n.keyboard + "px", "--t-keyboard-transition": n.keyboard > 0 ? "0.3s" : "0.1s" })
33
+ }, [
34
+ m(s.$slots, "default", {}, void 0, !0)
35
+ ], 6));
36
+ }
37
+ }), pe = /* @__PURE__ */ g(de, [["__scopeId", "data-v-3a6a070c"]]), fe = /* @__PURE__ */ w({
38
+ __name: "t-loading-icon",
39
+ props: {
40
+ size: {
41
+ type: String,
42
+ default: "24px"
43
+ },
44
+ color: {
45
+ type: String,
46
+ default: "var(--t-color-default-10)"
47
+ }
48
+ },
49
+ setup(e) {
50
+ return (n, s) => (a(), u("span", {
51
+ class: "t-loading-icon",
52
+ style: I({
53
+ width: e.size,
54
+ height: e.size,
55
+ borderTopColor: e.color
56
+ }),
57
+ role: "status",
58
+ "aria-label": "Loading..."
59
+ }, null, 4));
60
+ }
61
+ }), Q = /* @__PURE__ */ g(fe, [["__scopeId", "data-v-82ecd6f5"]]), me = {
62
+ key: 0,
63
+ class: "loader"
64
+ }, ve = /* @__PURE__ */ w({
65
+ __name: "t-button",
66
+ props: {
67
+ color: { default: "" },
68
+ size: { default: "standard" },
69
+ rounded: { type: Boolean, default: !1 },
70
+ block: { type: Boolean, default: !1 },
71
+ loading: { type: Boolean, default: !1 },
72
+ loadingType: { default: "spinner" },
73
+ variant: { default: "default" },
74
+ activeBackground: { type: Boolean, default: !1 }
75
+ },
76
+ setup(e) {
77
+ const n = e, s = x(() => {
78
+ let o;
79
+ return n.color ? ["warning", "info", "danger", "primary", "secondary", "success"].includes(n.color) ? o = {
80
+ "--color": "var(--t-color-default-1)",
81
+ "--background-color": "var(--t-color-" + n.color + "-6)"
82
+ } : o = {
83
+ "--color": "var(--t-color-default-1)",
84
+ "--background-color": n.color
85
+ } : o = {
86
+ "--color": "var(--t-color-default-10)",
87
+ "--background-color": "transparent"
88
+ }, o;
89
+ });
90
+ return (o, r) => (a(), u("button", {
91
+ class: S(["t-button", { "active-background": n.activeBackground, rounded: n.rounded, block: n.block, ["size-" + n.size]: !0, ["variant-" + n.variant]: !0 }]),
92
+ style: I(s.value)
93
+ }, [
94
+ X(k("span", null, [
95
+ m(o.$slots, "default", {}, void 0, !0)
96
+ ], 512), [
97
+ [R, !n.loading]
98
+ ]),
99
+ n.loading ? (a(), u("span", me, [
100
+ ne(Q, {
101
+ color: "var(--color)",
102
+ type: n.loadingType
103
+ }, null, 8, ["type"])
104
+ ])) : z("", !0)
105
+ ], 6));
106
+ }
107
+ }), Z = /* @__PURE__ */ g(ve, [["__scopeId", "data-v-e6b432c9"]]), _e = /* @__PURE__ */ w({
108
+ __name: "t-card",
109
+ props: {
110
+ shadow: { type: Boolean, default: !0 }
111
+ },
112
+ setup(e) {
113
+ const n = e;
114
+ return (s, o) => (a(), u("div", {
115
+ class: S(["t-card", { shadow: n.shadow }])
116
+ }, [
117
+ m(s.$slots, "default")
118
+ ], 2));
119
+ }
120
+ }), ye = {}, he = { class: "t-content" };
121
+ function ge(e, n) {
122
+ return a(), u("div", he, [
123
+ m(e.$slots, "default", {}, void 0, !0)
124
+ ]);
125
+ }
126
+ const be = /* @__PURE__ */ g(ye, [["render", ge], ["__scopeId", "data-v-ea276571"]]), G = 80, ke = /* @__PURE__ */ w({
127
+ __name: "t-refresher",
128
+ emits: ["refresh"],
129
+ setup(e, { emit: n }) {
130
+ const s = n, o = $(0), r = $(!1), l = $();
131
+ let d, p = !1;
132
+ const b = () => {
133
+ r.value = !1, o.value = 0, d && d.cancel(), setTimeout(() => {
134
+ p = !1;
135
+ }, 2e3);
136
+ }, f = () => {
137
+ p = !0, r.value = !0, o.value = G, s("refresh", b);
138
+ };
139
+ return C(() => l.value, () => {
140
+ d && d.destroy();
141
+ let v = l.value.closest(".t-screen");
142
+ d = N(v, {
143
+ options: {
144
+ minDist: 60
145
+ },
146
+ move({ dy: _ }) {
147
+ r.value || p || _ < 0 || (_ >= 120 ? f() : o.value = _);
148
+ },
149
+ up({ dy: _ }) {
150
+ r.value || p || (_ > G ? f() : o.value = 0);
151
+ },
152
+ cancel() {
153
+ r.value = !1, o.value = 0;
154
+ }
155
+ });
156
+ }), V(() => {
157
+ d && d.destroy();
158
+ }), (v, _) => X((a(), u("div", {
159
+ class: "t-refresher",
160
+ ref_key: "container",
161
+ ref: l,
162
+ style: I({ height: `${o.value}px` })
163
+ }, [
164
+ k("img", {
165
+ class: S({ spiner: r.value }),
166
+ src: "https://static.toikit.com/toikit/home_2.png?v=3",
167
+ alt: "Loading...",
168
+ style: { width: "22px", height: "22px" }
169
+ }, null, 2)
170
+ ], 4)), [
171
+ [R, o.value > 0]
172
+ ]);
173
+ }
174
+ }), $e = /* @__PURE__ */ g(ke, [["__scopeId", "data-v-7f97bb1a"]]), we = {}, Te = { class: "t-screen" };
175
+ function Ie(e, n) {
176
+ return a(), u("div", Te, [
177
+ m(e.$slots, "default", {}, void 0, !0)
178
+ ]);
179
+ }
180
+ const ee = /* @__PURE__ */ g(we, [["render", Ie], ["__scopeId", "data-v-d749ca41"]]), Se = /* @__PURE__ */ w({
181
+ __name: "t-present",
182
+ props: {
183
+ keepalive: { type: Boolean, default: !0 },
184
+ visible: { type: Boolean, default: !1 },
185
+ backdrop: { type: Boolean, default: !0 },
186
+ placement: { default: "bottom" }
187
+ },
188
+ emits: ["dismiss"],
189
+ setup(e, { expose: n, emit: s }) {
190
+ const o = $(0), r = $(!1), l = $(), d = $(), p = e, b = s, f = x(() => r.value || p.keepalive), v = j({
191
+ "--t-present-backdrop-opacity": "0.4",
192
+ "--t-present-transition": "0.2s",
193
+ "--t-present-content-transform": "0px",
194
+ "--t-present-content-opacity": "1"
195
+ }), _ = (c) => {
196
+ p.backdrop ? c?.backdropOpacity && (v["--t-present-backdrop-opacity"] = c.backdropOpacity) : v["--t-present-backdrop-opacity"] = "0", c?.transition && (v["--t-present-transition"] = c.transition, v["--t-present-transition"] = c.transition), c?.contentTransform && (v["--t-present-content-transform"] = c.contentTransform), c?.contentOpacity && (v["--t-present-content-opacity"] = c.contentOpacity);
197
+ }, t = () => {
198
+ _({
199
+ contentTransform: "0px",
200
+ transition: "0.2s",
201
+ backdropOpacity: "0.4",
202
+ contentOpacity: "1"
203
+ });
204
+ }, i = () => {
205
+ let c = "0px", T = "1";
206
+ p.placement == "bottom" || p.placement == "right" ? c = "100%" : p.placement == "top" || p.placement == "left" ? c = "-100%" : p.placement == "center" && (c = "0px", T = "0"), _({
207
+ contentTransform: c,
208
+ transition: "0.2s",
209
+ contentOpacity: T,
210
+ backdropOpacity: "0"
211
+ });
212
+ };
213
+ C(() => p.visible, () => {
214
+ p.visible ? (r.value = !0, o.value = Ce.getNewIndex(), setTimeout(() => {
215
+ t();
216
+ }, 50)) : (i(), setTimeout(() => {
217
+ r.value = !1;
218
+ }, 200));
219
+ }), n({
220
+ render: _,
221
+ open: t,
222
+ close: i
223
+ });
224
+ let y;
225
+ return C(() => l.value, (c) => {
226
+ c && (y = N(l.value, {
227
+ beforeEvent(T) {
228
+ return T.stopPropagation(), q(T.target) || (T.preventDefault(), Y()), T.type == "pointerup";
229
+ },
230
+ up() {
231
+ b("dismiss", "backdrop");
232
+ }
233
+ }));
234
+ }), V(() => {
235
+ y && y.destroy();
236
+ }), i(), (c, T) => (a(), u(L, null, [
237
+ f.value ? X((a(), u("div", {
238
+ key: 0,
239
+ class: S(["t-present", { [c.placement]: !0 }]),
240
+ ref_key: "present",
241
+ ref: d,
242
+ style: I({ ...v, zIndex: o.value })
243
+ }, [
244
+ m(c.$slots, "default", {}, void 0, !0)
245
+ ], 6)), [
246
+ [R, r.value]
247
+ ]) : z("", !0),
248
+ f.value ? X((a(), u("div", {
249
+ key: 1,
250
+ class: "t-present-backdrop",
251
+ ref_key: "backdrop",
252
+ ref: l,
253
+ style: I({ ...v, zIndex: o.value - 1 })
254
+ }, null, 4)), [
255
+ [R, r.value]
256
+ ]) : z("", !0)
257
+ ], 64));
258
+ }
259
+ }), F = /* @__PURE__ */ g(Se, [["__scopeId", "data-v-e1a8315e"]]), ze = {
260
+ key: 0,
261
+ class: "t-alert-header"
262
+ }, Ee = { class: "t-alert-content" }, xe = { class: "t-alert-footer" }, Be = /* @__PURE__ */ w({
263
+ __name: "t-alert",
264
+ props: {
265
+ title: {},
266
+ message: {},
267
+ actions: {}
268
+ },
269
+ emits: ["close"],
270
+ setup(e, { expose: n, emit: s }) {
271
+ const o = e, r = $(!1), l = s, d = $();
272
+ let p;
273
+ const b = $(!1), f = () => {
274
+ r.value = !0;
275
+ }, v = (t) => {
276
+ r.value = !1, t.handler && t.handler(), l("close", t?.data);
277
+ }, _ = (t) => {
278
+ t == "backdrop" && (b.value = !0, setTimeout(() => {
279
+ b.value = !1;
280
+ }, 300));
281
+ };
282
+ return n({
283
+ open: f
284
+ }), C(() => d.value, (t) => {
285
+ t && (p = N(d.value, {
286
+ beforeEvent(i) {
287
+ return i.stopPropagation(), q(i.target) || (i.preventDefault(), Y()), !1;
288
+ }
289
+ }));
290
+ }), V(() => {
291
+ p && p.destroy();
292
+ }), (t, i) => (a(), B(F, {
293
+ placement: "center",
294
+ backdrop: !0,
295
+ keepalive: !1,
296
+ visible: r.value,
297
+ onDismiss: _
298
+ }, {
299
+ default: D(() => [
300
+ k("div", {
301
+ class: S(["t-alert", { pop: b.value }]),
302
+ ref_key: "container",
303
+ ref: d
304
+ }, [
305
+ m(t.$slots, "header", {}, () => [
306
+ o.title ? (a(), u("div", ze, P(o.title), 1)) : z("", !0)
307
+ ], !0),
308
+ m(t.$slots, "content", {}, () => [
309
+ k("div", Ee, P(o.message), 1)
310
+ ], !0),
311
+ m(t.$slots, "footer", {}, () => [
312
+ k("div", xe, [
313
+ (a(!0), u(L, null, M(o.actions, (y) => (a(), B(Z, {
314
+ color: y.color,
315
+ variant: y.variant,
316
+ onClick: (c) => v(y)
317
+ }, {
318
+ default: D(() => [
319
+ A(P(y.text), 1)
320
+ ]),
321
+ _: 2
322
+ }, 1032, ["color", "variant", "onClick"]))), 256))
323
+ ])
324
+ ], !0)
325
+ ], 2)
326
+ ]),
327
+ _: 3
328
+ }, 8, ["visible"]));
329
+ }
330
+ }), Pe = /* @__PURE__ */ g(Be, [["__scopeId", "data-v-3bd5f2f6"]]), H = $(1e3), Ce = {
331
+ getNewIndex() {
332
+ return H.value += 2, H.value;
333
+ }
334
+ }, E = j([]), De = (e) => {
335
+ E.push(e);
336
+ }, Ne = (e) => {
337
+ e || E.pop();
338
+ }, h = {
339
+ screens: E,
340
+ addScreen: De,
341
+ removeScreen: Ne,
342
+ hasPrevious: x(() => E.length > 1),
343
+ currentScreen: x(() => E[E.length - 1]),
344
+ lastScreen: x(() => {
345
+ if (!(E.length < 2))
346
+ return E[E.length - 2];
347
+ })
348
+ }, Oe = /* @__PURE__ */ w({
349
+ __name: "t-swipe-screen",
350
+ emits: ["change"],
351
+ setup(e, { emit: n }) {
352
+ let s = {};
353
+ const o = K(), r = re(), l = o.getRoutes(), d = $(!1), p = n;
354
+ for (let t of l)
355
+ s[t.name] = t.components;
356
+ const b = (t) => {
357
+ t && h.addScreen({
358
+ name: t,
359
+ target: null,
360
+ component: oe(s[t] || null)
361
+ });
362
+ }, f = (t, i) => {
363
+ !i || h.screens[t].target || (h.screens[t].target = i.$el, t > 0 && (d.value = !0, i.$el.style.transform = "translateX(100vw)", i.$el.transitionOrigin = "center", document.documentElement.style.setProperty("--t-swipe-backdrop-opacity", "0"), setTimeout(() => {
364
+ i.$el.style.transition = "transform 0.35s ease", i.$el.style.transform = "translateX(0px)", document.documentElement.style.setProperty("--t-screen-backdrop-duration", "0.35s"), document.documentElement.style.setProperty("--t-swipe-backdrop-opacity", "0.5"), h.screens.length > 1 && (h.lastScreen.value.target.style.transitionOrigin = "left center", h.lastScreen.value.target.style.transition = "transform 0.35s ease", h.lastScreen.value.target.style.transform = "translateX(-30vw) scale(0.5) perspective(100vw) rotateY(30deg)"), setTimeout(() => {
365
+ p("change"), d.value = !1;
366
+ }, 400);
367
+ }, 100)));
368
+ }, v = () => {
369
+ h.currentScreen.value.target.style.transition = "transform 0.35s ease", h.currentScreen.value.target.style.transform = "translateX(100vw) scale(1)", h.lastScreen.value.target.style.transition = "transform 0.35s ease", h.lastScreen.value.target.style.transform = "translateX(0px) scale(1) perspective(100vw) rotateY(0deg)", document.documentElement.style.setProperty("--t-screen-backdrop-duration", "0.35s"), document.documentElement.style.setProperty("--t-swipe-backdrop-opacity", "0"), d.value = !0, setTimeout(() => {
370
+ h.removeScreen(), p("change"), d.value = !1;
371
+ }, 400);
372
+ };
373
+ b(r.name), C(() => r.name, (t, i) => {
374
+ t != h.currentScreen.value.name && (h.lastScreen.value?.name == t ? v() : b(t));
375
+ });
376
+ const _ = () => {
377
+ d.value = !0;
378
+ const t = h.currentScreen.value.target, i = h.lastScreen.value.target;
379
+ t.style.transition = "transform 0.35s ease", t.style.transform = "translateX(0px)", i.style.transition = "transform 0.35s ease", i.style.transform = "translateX(-30vw) scale(0.5) perspective(100vw) rotateY(30deg)", document.documentElement.style.setProperty("--t-screen-backdrop-duration", "0.35s"), document.documentElement.style.setProperty("--t-swipe-backdrop-opacity", "0.5"), setTimeout(() => {
380
+ d.value = !1;
381
+ }, 400);
382
+ };
383
+ return J(() => {
384
+ N(document, {
385
+ pointerId: null,
386
+ beforeEvent(t) {
387
+ return d.value || h.screens.length < 2 ? !1 : (t.type == "pointerdown" && !this.pointerId && (this.pointerId = t.pointerId), this.pointerId == t.pointerId);
388
+ },
389
+ afterEvent(t) {
390
+ (t.type == "pointerup" || t.type == "pointercancel") && (this.pointerId = null);
391
+ },
392
+ fast({ d: t }) {
393
+ t == "right" && o.back();
394
+ },
395
+ move({ dx: t }) {
396
+ const i = window.innerWidth, y = t / i * 100, c = h.currentScreen.value.target, T = h.lastScreen?.value?.target;
397
+ if (t > 0 && t <= i) {
398
+ c.style.transition = "transform 0s ease", c.style.transform = `translateX(${t}px)`, T.style.transition = "transform 0s ease", document.documentElement.style.setProperty("--t-screen-backdrop-duration", "0s"), T.style.transform = `translateX(calc(-30vw + (30vw / 100 * ${y}))) scale(${0.5 + 0.5 / 100 * y}) perspective(100vw) rotateY(${30 - 30 / 100 * y}deg)`, document.documentElement.style.setProperty("--t-swipe-backdrop-opacity", `${0.5 - 0.5 / 100 * y}`);
399
+ return;
400
+ }
401
+ },
402
+ up({ dx: t }) {
403
+ const i = window.innerWidth;
404
+ t / i * 100 >= 50 ? o.back() : _();
405
+ },
406
+ cancel() {
407
+ _();
408
+ }
409
+ });
410
+ }), (t, i) => (a(), u(L, null, [
411
+ (a(!0), u(L, null, M(O(h).screens, (y, c) => (a(), B(ee, {
412
+ ref_for: !0,
413
+ ref: (T) => f(c, T),
414
+ style: I({ zIndex: c + (c == O(h).screens.length - 1 ? 2 : 1) }),
415
+ key: c
416
+ }, {
417
+ default: D(() => [
418
+ (a(), B(se(y.component.default)))
419
+ ]),
420
+ _: 2
421
+ }, 1032, ["style"]))), 128)),
422
+ k("div", {
423
+ class: "t-swipe-backdrop",
424
+ style: I({ zIndex: O(h).screens.length })
425
+ }, null, 4)
426
+ ], 64));
427
+ }
428
+ }), Xe = /* @__PURE__ */ g(Oe, [["__scopeId", "data-v-a1b1d45a"]]), Re = /* @__PURE__ */ w({
429
+ __name: "t-toolbar",
430
+ props: {
431
+ placement: { default: "bottom" },
432
+ size: { default: "50px" }
433
+ },
434
+ setup(e) {
435
+ const n = e;
436
+ return (s, o) => (a(), u("div", {
437
+ class: S(["t-toolbar", { [n.placement]: !0 }]),
438
+ style: I({ "--t-size-toolbar": n.size })
439
+ }, [
440
+ k("div", null, [
441
+ m(s.$slots, "default", {}, void 0, !0)
442
+ ])
443
+ ], 6));
444
+ }
445
+ }), Le = /* @__PURE__ */ g(Re, [["__scopeId", "data-v-c4ccb0ee"]]), Ae = /* @__PURE__ */ w({
446
+ __name: "t-back-button",
447
+ props: {
448
+ to: {}
449
+ },
450
+ setup(e) {
451
+ const n = K(), s = e, o = () => {
452
+ h.hasPrevious.value ? n.back() : s.to && n.push(s.to);
453
+ };
454
+ return (r, l) => r.to || O(h).hasPrevious ? (a(), u("button", {
455
+ key: 0,
456
+ class: "t-back-button",
457
+ onClick: o
458
+ }, [
459
+ m(r.$slots, "default", {}, () => [
460
+ l[0] || (l[0] = k("i", { class: "ri-arrow-left-s-line" }, null, -1))
461
+ ], !0)
462
+ ])) : z("", !0);
463
+ }
464
+ }), Ve = /* @__PURE__ */ g(Ae, [["__scopeId", "data-v-45c48e0f"]]), qe = /* @__PURE__ */ w({
465
+ __name: "t-text",
466
+ props: {
467
+ color: { default: "default" },
468
+ size: { default: "standard" }
469
+ },
470
+ setup(e) {
471
+ const n = e, s = x(() => {
472
+ let o, r = n.color;
473
+ return n.size == "standard" ? o = "var(--t-fs-10)" : n.size == "small" ? o = "var(--t-fs-08)" : n.size == "large" ? o = "var(--t-fs-12)" : o = n.size, ["warning", "info", "danger", "primary", "secondary", "success"].includes(n.color) && (r = `var(--t-color-${n.color}-8)`), {
474
+ "--color": r,
475
+ "--font-size": o
476
+ };
477
+ });
478
+ return (o, r) => (a(), u("span", {
479
+ class: "t-text",
480
+ style: I(s.value)
481
+ }, [
482
+ m(o.$slots, "default", {}, void 0, !0)
483
+ ], 4));
484
+ }
485
+ }), W = /* @__PURE__ */ g(qe, [["__scopeId", "data-v-12c8835a"]]), Ye = /* @__PURE__ */ w({
486
+ __name: "t-pull-signal",
487
+ props: {
488
+ placement: { default: "bottom" }
489
+ },
490
+ setup(e) {
491
+ return (n, s) => (a(), u("div", {
492
+ class: S(["t-pull-bar", { [n.placement]: !0 }])
493
+ }, null, 2));
494
+ }
495
+ }), te = /* @__PURE__ */ g(Ye, [["__scopeId", "data-v-b410cb84"]]), Ue = /* @__PURE__ */ w({
496
+ __name: "t-sheet",
497
+ props: {
498
+ background: { default: "var(--t-color-default-3)" },
499
+ visible: { type: Boolean, default: !1 },
500
+ gesture: { type: Boolean, default: !0 },
501
+ fullscreen: { type: Boolean, default: !1 },
502
+ placement: { default: "bottom" },
503
+ keepalive: { type: Boolean, default: !0 },
504
+ backdrop: { type: Boolean, default: !0 },
505
+ rounded: { type: Boolean, default: !0 },
506
+ closeButton: { type: Boolean, default: !0 }
507
+ },
508
+ emits: ["dismiss"],
509
+ setup(e, { emit: n }) {
510
+ const s = e, o = n, r = $(), l = $(), d = $(!1);
511
+ let p = null;
512
+ const b = x(() => {
513
+ if (s.placement == "bottom") return "down";
514
+ if (s.placement == "top") return "up";
515
+ if (s.placement == "left") return "left";
516
+ if (s.placement == "right") return "right";
517
+ }), f = (_) => {
518
+ o("dismiss", _);
519
+ }, v = () => {
520
+ d.value = !0, setTimeout(() => {
521
+ d.value = !1;
522
+ }, 300);
523
+ };
524
+ return C(() => r.value, (_) => {
525
+ _ && (p = N(r.value, {
526
+ options: {
527
+ minDist: 30
528
+ },
529
+ pointerId: null,
530
+ beforeEvent(t) {
531
+ let i = !1, y = !1;
532
+ return d.value || !s.gesture || s.placement == "center" ? i = !0 : this.pointerId ? (i = !0, y = this.pointerId == t.pointerId) : t.type == "pointerdown" && (this.pointerId = t.pointerId, i = !0, y = !0), i && (t.stopPropagation(), q(t.target) || (t.preventDefault(), Y())), y;
533
+ },
534
+ afterEvent(t) {
535
+ (t.type == "pointerup" || t.type == "pointercancel") && (this.pointerId = null);
536
+ },
537
+ fast({ d: t }) {
538
+ v(), t == b.value ? o("dismiss", "gesture") : l.value.open();
539
+ },
540
+ move({ dy: t, dx: i, d: y }) {
541
+ if (y != b.value) return;
542
+ let c = 0;
543
+ s.placement == "bottom" || s.placement == "top" ? c = t : c = i, l.value.render({
544
+ contentTransform: c + "px",
545
+ transition: "0s"
546
+ });
547
+ },
548
+ up({ dy: t, dx: i, d: y }) {
549
+ if (v(), y != b.value) {
550
+ l.value.open();
551
+ return;
552
+ }
553
+ let c, T, U;
554
+ s.placement == "bottom" || s.placement == "top" ? (c = r.value.offsetHeight, U = t) : (c = r.value.offsetWidth, U = i), T = U / c * 100, T > 50 ? o("dismiss", "gesture") : l.value.open();
555
+ },
556
+ cancel() {
557
+ v(), l.value.open();
558
+ }
559
+ }));
560
+ }), V(() => {
561
+ p && p.destroy();
562
+ }), (_, t) => (a(), B(F, {
563
+ ref_key: "present",
564
+ ref: l,
565
+ placement: s.placement,
566
+ backdrop: _.backdrop,
567
+ visible: s.visible,
568
+ keepalive: s.keepalive,
569
+ onDismiss: f
570
+ }, {
571
+ default: D(() => [
572
+ s.gesture && s.placement != "center" ? (a(), B(te, {
573
+ key: 0,
574
+ placement: s.placement
575
+ }, null, 8, ["placement"])) : z("", !0),
576
+ k("div", {
577
+ class: S(["t-sheet", { fullscreen: s.fullscreen, [s.placement]: !0, rounded: _.rounded }]),
578
+ style: I({ "--background": s.background }),
579
+ ref_key: "sheet",
580
+ ref: r
581
+ }, [
582
+ s.closeButton && s.placement == "center" ? (a(), u("button", {
583
+ key: 0,
584
+ class: "t-sheet-close",
585
+ onClick: t[0] || (t[0] = (i) => f("close-button"))
586
+ }, [
587
+ m(_.$slots, "close-icon", {}, () => [
588
+ t[1] || (t[1] = k("i", { class: "ri-close-large-line" }, null, -1))
589
+ ], !0)
590
+ ])) : z("", !0),
591
+ m(_.$slots, "default", {}, void 0, !0)
592
+ ], 6)
593
+ ]),
594
+ _: 3
595
+ }, 8, ["placement", "backdrop", "visible", "keepalive"]));
596
+ }
597
+ }), We = /* @__PURE__ */ g(Ue, [["__scopeId", "data-v-cc940bf9"]]), Fe = { class: "t-input-label" }, Ge = { class: "t-input-content" }, He = ["type", "placeholder", "value"], je = /* @__PURE__ */ w({
598
+ __name: "t-input",
599
+ props: {
600
+ size: { default: "standard" },
601
+ rounded: { type: Boolean, default: !1 },
602
+ label: { default: "" },
603
+ placeholder: { default: "" },
604
+ type: { default: "text" },
605
+ help: {},
606
+ error: {},
607
+ modelValue: { default: "" },
608
+ variant: { default: "normal" }
609
+ },
610
+ emits: ["update:modelValue"],
611
+ setup(e, { emit: n }) {
612
+ const s = e, o = n, r = (l) => {
613
+ o("update:modelValue", l.target.value);
614
+ };
615
+ return (l, d) => (a(), u("div", {
616
+ class: S(["t-input", { rounded: s.rounded, ["size-" + s.size]: !0 }])
617
+ }, [
618
+ k("label", null, [
619
+ k("span", Fe, P(l.label), 1),
620
+ k("div", Ge, [
621
+ m(l.$slots, "start", {}, void 0, !0),
622
+ k("input", {
623
+ type: l.type,
624
+ placeholder: l.placeholder,
625
+ value: l.modelValue,
626
+ onInput: r
627
+ }, null, 40, He),
628
+ m(l.$slots, "end", {}, void 0, !0)
629
+ ])
630
+ ]),
631
+ s.error ? (a(), B(W, {
632
+ key: 0,
633
+ color: "danger"
634
+ }, {
635
+ default: D(() => [
636
+ A(P(s.error), 1)
637
+ ]),
638
+ _: 1
639
+ })) : s.help ? (a(), B(W, {
640
+ key: 1,
641
+ color: "var(--t-color-default-7)"
642
+ }, {
643
+ default: D(() => [
644
+ A(P(s.help), 1)
645
+ ]),
646
+ _: 1
647
+ })) : z("", !0)
648
+ ], 2));
649
+ }
650
+ }), Me = /* @__PURE__ */ g(je, [["__scopeId", "data-v-a7db63ef"]]), Je = {};
651
+ function Ke(e, n) {
652
+ return a(), u("textarea");
653
+ }
654
+ const Qe = /* @__PURE__ */ g(Je, [["render", Ke]]), Ze = {};
655
+ function et(e, n) {
656
+ return a(), u("div");
657
+ }
658
+ const tt = /* @__PURE__ */ g(Ze, [["render", et]]), nt = {}, st = { class: "t-grid" };
659
+ function ot(e, n) {
660
+ return a(), u("div", st);
661
+ }
662
+ const rt = /* @__PURE__ */ g(nt, [["render", ot]]), at = {}, lt = { class: "t-grid-item" };
663
+ function ct(e, n) {
664
+ return a(), u("div", lt);
665
+ }
666
+ const it = /* @__PURE__ */ g(at, [["render", ct]]), ut = /* @__PURE__ */ w({
667
+ __name: "t-divider",
668
+ props: {
669
+ type: { default: "horizontal" }
670
+ },
671
+ setup(e) {
672
+ const n = e;
673
+ return (s, o) => (a(), u("div", {
674
+ class: S(["t-divider", { [n.type]: !0 }])
675
+ }, null, 2));
676
+ }
677
+ }), dt = /* @__PURE__ */ g(ut, [["__scopeId", "data-v-0d783bfa"]]), pt = /* @__PURE__ */ w({
678
+ __name: "t-toogle-password",
679
+ props: {
680
+ color: { default: "warning" }
681
+ },
682
+ emits: ["change"],
683
+ setup(e, { emit: n }) {
684
+ const s = e, o = n, r = $(!1), l = $(), d = x(() => {
685
+ let f = s.color;
686
+ return ["warning", "info", "danger", "primary", "secondary", "success"].includes(s.color) && (f = `var(--t-color-${s.color}-6)`), {
687
+ "--color": f
688
+ };
689
+ }), p = () => l.value?.parentElement?.querySelector?.("input");
690
+ J(() => {
691
+ let f = p();
692
+ f && (r.value = f.type != "password", o("change", r.value));
693
+ });
694
+ const b = () => {
695
+ let f = p();
696
+ f && (r.value = !r.value, r.value ? f.type = "text" : f.type = "password", o("change", r.value));
697
+ };
698
+ return (f, v) => (a(), u("button", {
699
+ ref_key: "toogle",
700
+ ref: l,
701
+ class: "t-toogle-password",
702
+ style: I(d.value),
703
+ onClick: b
704
+ }, [
705
+ r.value ? m(f.$slots, "on", { key: 0 }, () => [
706
+ v[0] || (v[0] = k("i", { class: "ri-eye-line" }, null, -1))
707
+ ], !0) : z("", !0),
708
+ r.value ? z("", !0) : m(f.$slots, "off", { key: 1 }, () => [
709
+ v[1] || (v[1] = k("i", { class: "ri-eye-off-line" }, null, -1))
710
+ ], !0)
711
+ ], 4));
712
+ }
713
+ }), ft = /* @__PURE__ */ g(pt, [["__scopeId", "data-v-2b04c3c9"]]), mt = /* @__PURE__ */ w({
714
+ __name: "t-avatar",
715
+ props: {
716
+ square: { type: Boolean, default: !1 },
717
+ size: { default: "standard" }
718
+ },
719
+ setup(e) {
720
+ const n = e, s = x(() => n.size == "small" ? "24px" : n.size == "standard" ? "40px" : n.size == "large" ? "60px" : n.size);
721
+ return (o, r) => (a(), u("div", {
722
+ class: S(["t-avatar", { square: o.square }]),
723
+ style: I({ "--size": s.value })
724
+ }, [
725
+ m(o.$slots, "default", {}, void 0, !0)
726
+ ], 6));
727
+ }
728
+ }), vt = /* @__PURE__ */ g(mt, [["__scopeId", "data-v-24384c2f"]]), _t = { class: "t-collapse-title" }, yt = {
729
+ key: 0,
730
+ class: "icon"
731
+ }, ht = {
732
+ key: 1,
733
+ class: "icon"
734
+ }, gt = { class: "t-collapse-content" }, bt = /* @__PURE__ */ w({
735
+ __name: "t-collapse",
736
+ props: {
737
+ title: {}
738
+ },
739
+ emits: ["change"],
740
+ setup(e, { emit: n }) {
741
+ const s = e, o = n, r = $(!1), l = $(""), d = $(), p = () => {
742
+ r.value = !r.value, l.value = `calc(${d.value.offsetHeight}px + 2rem)`, o("change", r.value);
743
+ };
744
+ return o("change", r.value), (b, f) => (a(), u("div", {
745
+ class: S(["t-collapse", { open: r.value }]),
746
+ style: I({ "--height": l.value })
747
+ }, [
748
+ k("div", {
749
+ class: "t-collapse-header",
750
+ onClick: p
751
+ }, [
752
+ m(b.$slots, "icon"),
753
+ k("div", _t, [
754
+ m(b.$slots, "title", {}, () => [
755
+ A(P(s.title), 1)
756
+ ])
757
+ ]),
758
+ m(b.$slots, "toogle", {}, () => [
759
+ r.value ? (a(), u("div", yt, [...f[0] || (f[0] = [
760
+ k("i", { class: "ri-arrow-up-s-line" }, null, -1)
761
+ ])])) : (a(), u("div", ht, [...f[1] || (f[1] = [
762
+ k("i", { class: "ri-arrow-down-s-line" }, null, -1)
763
+ ])]))
764
+ ])
765
+ ]),
766
+ k("div", gt, [
767
+ k("div", {
768
+ ref_key: "content",
769
+ ref: d
770
+ }, [
771
+ m(b.$slots, "content", {}, () => [
772
+ m(b.$slots, "default")
773
+ ])
774
+ ], 512)
775
+ ])
776
+ ], 6));
777
+ }
778
+ }), Tt = () => ({
779
+ install: (e) => {
780
+ ae(), e.component("t-app", ue), e.component("t-screen", ee), e.component("t-swipe-screen", Xe), e.component("t-cable", pe), e.component("t-toolbar", Le), e.component("t-content", be), e.component("t-card", _e), e.component("t-refresher", $e), e.component("t-button", Z), e.component("t-back-button", Ve), e.component("t-present", F), e.component("t-text", W), e.component("t-sheet", We), e.component("t-pull-signal", te), e.component("t-input", Me), e.component("t-textarea", Qe), e.component("t-rich-text", tt), e.component("t-grid", rt), e.component("t-grid-item", it), e.component("t-divider", dt), e.component("t-toogle-password", ft), e.component("t-loading-icon", Q), e.component("t-alert", Pe), e.component("t-avatar", vt), e.component("t-collapse", bt);
781
+ }
782
+ });
783
+ export {
784
+ Tt as createToife
785
+ };