@toife/vue 2.1.7 → 2.2.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 (166) hide show
  1. package/dist/components/action/action.type.d.ts +17 -0
  2. package/dist/components/action/action.vue.d.ts +14 -0
  3. package/dist/components/action/factory.d.ts +3 -0
  4. package/dist/components/action/index.d.ts +2 -0
  5. package/dist/components/alert/alert.type.d.ts +16 -0
  6. package/dist/components/alert/alert.vue.d.ts +14 -0
  7. package/dist/components/alert/factory.d.ts +3 -0
  8. package/dist/components/alert/index.d.ts +2 -0
  9. package/dist/components/app/app.type.d.ts +1 -0
  10. package/dist/components/app/app.vue.d.ts +3 -0
  11. package/dist/components/app/index.d.ts +1 -0
  12. package/dist/components/avatar/avatar.type.d.ts +4 -0
  13. package/dist/components/{t-divider.vue.d.ts → avatar/avatar.vue.d.ts} +5 -6
  14. package/dist/components/avatar/index.d.ts +1 -0
  15. package/dist/components/back-button/back-button.type.d.ts +4 -0
  16. package/dist/components/back-button/back-button.vue.d.ts +3 -0
  17. package/dist/components/back-button/index.d.ts +1 -0
  18. package/dist/components/button/button.type.d.ts +10 -0
  19. package/dist/components/button/button.vue.d.ts +12 -0
  20. package/dist/components/button/index.d.ts +1 -0
  21. package/dist/components/cable/cable.type.d.ts +4 -0
  22. package/dist/components/cable/cable.vue.d.ts +6 -0
  23. package/dist/components/cable/index.d.ts +1 -0
  24. package/dist/components/card/card.type.d.ts +3 -0
  25. package/dist/components/card/card.vue.d.ts +5 -0
  26. package/dist/components/card/index.d.ts +1 -0
  27. package/dist/components/checkbox/checkbox.type.d.ts +12 -0
  28. package/dist/components/checkbox/checkbox.vue.d.ts +14 -0
  29. package/dist/components/checkbox/index.d.ts +1 -0
  30. package/dist/components/collapse/collapse.type.d.ts +6 -0
  31. package/dist/components/collapse/collapse.vue.d.ts +7 -0
  32. package/dist/components/collapse/index.d.ts +1 -0
  33. package/dist/components/content/content.type.d.ts +1 -0
  34. package/dist/components/content/content.vue.d.ts +3 -0
  35. package/dist/components/content/index.d.ts +1 -0
  36. package/dist/components/divider/divider.type.d.ts +3 -0
  37. package/dist/components/divider/divider.vue.d.ts +5 -0
  38. package/dist/components/divider/index.d.ts +1 -0
  39. package/dist/components/flex/flex.type.d.ts +4 -0
  40. package/dist/components/flex/flex.vue.d.ts +6 -0
  41. package/dist/components/flex/index.d.ts +1 -0
  42. package/dist/components/gesture-indicator/gesture-indicator.type.d.ts +3 -0
  43. package/dist/components/gesture-indicator/gesture-indicator.vue.d.ts +5 -0
  44. package/dist/components/gesture-indicator/index.d.ts +1 -0
  45. package/dist/components/grid/grid.type.d.ts +4 -0
  46. package/dist/components/grid/grid.vue.d.ts +6 -0
  47. package/dist/components/grid/index.d.ts +1 -0
  48. package/dist/components/icon-spinner/icon-spinner.type.d.ts +4 -0
  49. package/dist/components/icon-spinner/icon-spinner.vue.d.ts +6 -0
  50. package/dist/components/icon-spinner/index.d.ts +1 -0
  51. package/dist/components/image/image.type.d.ts +4 -0
  52. package/dist/components/image/image.vue.d.ts +3 -0
  53. package/dist/components/image/index.d.ts +1 -0
  54. package/dist/components/index.d.ts +36 -0
  55. package/dist/components/input/index.d.ts +1 -0
  56. package/dist/components/input/input.type.d.ts +15 -0
  57. package/dist/components/input/input.vue.d.ts +16 -0
  58. package/dist/components/keyboard-space/index.d.ts +2 -0
  59. package/dist/components/keyboard-space/keyboard-space.type.d.ts +1 -0
  60. package/dist/components/keyboard-space/keyboard-space.vue.d.ts +3 -0
  61. package/dist/components/loading/factory.d.ts +4 -0
  62. package/dist/components/loading/index.d.ts +2 -0
  63. package/dist/components/loading/loading.type.d.ts +6 -0
  64. package/dist/components/loading/loading.vue.d.ts +12 -0
  65. package/dist/components/present/factory.d.ts +1 -0
  66. package/dist/components/present/index.d.ts +2 -0
  67. package/dist/components/present/present.type.d.ts +13 -0
  68. package/dist/components/present/present.vue.d.ts +17 -0
  69. package/dist/components/refresher/index.d.ts +1 -0
  70. package/dist/components/refresher/refresher.type.d.ts +11 -0
  71. package/dist/components/refresher/refresher.vue.d.ts +17 -0
  72. package/dist/components/richtext/index.d.ts +1 -0
  73. package/dist/components/richtext/richtext.type.d.ts +1 -0
  74. package/dist/components/richtext/richtext.vue.d.ts +3 -0
  75. package/dist/components/ripple/index.d.ts +1 -0
  76. package/dist/components/ripple/ripple.type.d.ts +3 -0
  77. package/dist/components/{t-ripple.vue.d.ts → ripple/ripple.vue.d.ts} +3 -5
  78. package/dist/components/screen/index.d.ts +1 -0
  79. package/dist/components/screen/screen.type.d.ts +1 -0
  80. package/dist/components/screen/screen.vue.d.ts +3 -0
  81. package/dist/{controllers/screen.d.ts → components/screen-router/factory.d.ts} +1 -2
  82. package/dist/components/screen-router/index.d.ts +2 -0
  83. package/dist/components/screen-router/screen-router.type.d.ts +8 -0
  84. package/dist/components/screen-router/screen-router.vue.d.ts +9 -0
  85. package/dist/components/sheet/index.d.ts +1 -0
  86. package/dist/components/sheet/sheet.type.d.ts +18 -0
  87. package/dist/components/sheet/sheet.vue.d.ts +18 -0
  88. package/dist/components/skeleton/index.d.ts +1 -0
  89. package/dist/components/skeleton/skeleton.type.d.ts +6 -0
  90. package/dist/components/skeleton/skeleton.vue.d.ts +8 -0
  91. package/dist/components/switch/index.d.ts +1 -0
  92. package/dist/components/switch/switch.type.d.ts +7 -0
  93. package/dist/components/switch/switch.vue.d.ts +9 -0
  94. package/dist/components/tab/index.d.ts +1 -0
  95. package/dist/components/tab/tab.type.d.ts +4 -0
  96. package/dist/components/tab/tab.vue.d.ts +5 -0
  97. package/dist/components/tabs/index.d.ts +1 -0
  98. package/dist/components/tabs/tabs.type.d.ts +13 -0
  99. package/dist/components/tabs/tabs.vue.d.ts +15 -0
  100. package/dist/components/text/index.d.ts +1 -0
  101. package/dist/components/text/text.type.d.ts +4 -0
  102. package/dist/components/text/text.vue.d.ts +6 -0
  103. package/dist/components/textarea/index.d.ts +1 -0
  104. package/dist/components/textarea/textarea.type.d.ts +1 -0
  105. package/dist/components/textarea/textarea.vue.d.ts +3 -0
  106. package/dist/components/toast/factory.d.ts +3 -0
  107. package/dist/components/toast/index.d.ts +2 -0
  108. package/dist/components/toast/toast.type.d.ts +11 -0
  109. package/dist/components/toast/toast.vue.d.ts +16 -0
  110. package/dist/components/toggle-password/index.d.ts +1 -0
  111. package/dist/components/toggle-password/toggle-password.type.d.ts +6 -0
  112. package/dist/components/toggle-password/toggle-password.vue.d.ts +9 -0
  113. package/dist/components/toolbar/index.d.ts +1 -0
  114. package/dist/components/toolbar/toolbar.type.d.ts +5 -0
  115. package/dist/components/toolbar/toolbar.vue.d.ts +7 -0
  116. package/dist/factory.d.ts +4 -0
  117. package/dist/index.css +1 -1
  118. package/dist/index.d.ts +4 -5
  119. package/dist/index.es.js +1566 -1231
  120. package/dist/index.umd.js +1 -1
  121. package/dist/type.d.ts +3 -0
  122. package/dist/utils/events.d.ts +1 -0
  123. package/dist/utils/index.d.ts +1 -0
  124. package/package.json +1 -1
  125. package/dist/components/t-action.vue.d.ts +0 -29
  126. package/dist/components/t-alert.vue.d.ts +0 -35
  127. package/dist/components/t-app.vue.d.ts +0 -17
  128. package/dist/components/t-avatar.vue.d.ts +0 -24
  129. package/dist/components/t-back-button.vue.d.ts +0 -21
  130. package/dist/components/t-button.vue.d.ts +0 -36
  131. package/dist/components/t-cable.vue.d.ts +0 -24
  132. package/dist/components/t-card.vue.d.ts +0 -22
  133. package/dist/components/t-checkbox.vue.d.ts +0 -38
  134. package/dist/components/t-collapse.vue.d.ts +0 -32
  135. package/dist/components/t-content.vue.d.ts +0 -17
  136. package/dist/components/t-flex.vue.d.ts +0 -24
  137. package/dist/components/t-gesture-indicator.vue.d.ts +0 -7
  138. package/dist/components/t-grid.vue.d.ts +0 -24
  139. package/dist/components/t-icon-spinner.vue.d.ts +0 -23
  140. package/dist/components/t-image.vue.d.ts +0 -6
  141. package/dist/components/t-input.vue.d.ts +0 -47
  142. package/dist/components/t-keyboard-space.vue.d.ts +0 -2
  143. package/dist/components/t-loading.vue.d.ts +0 -29
  144. package/dist/components/t-present.vue.d.ts +0 -47
  145. package/dist/components/t-refresher.vue.d.ts +0 -43
  146. package/dist/components/t-rich-text.vue.d.ts +0 -2
  147. package/dist/components/t-screen-router.vue.d.ts +0 -15
  148. package/dist/components/t-screen.vue.d.ts +0 -17
  149. package/dist/components/t-sheet.vue.d.ts +0 -251
  150. package/dist/components/t-skeleton.vue.d.ts +0 -13
  151. package/dist/components/t-switch.vue.d.ts +0 -12
  152. package/dist/components/t-tab.vue.d.ts +0 -23
  153. package/dist/components/t-tabs.vue.d.ts +0 -43
  154. package/dist/components/t-text.vue.d.ts +0 -24
  155. package/dist/components/t-textarea.vue.d.ts +0 -2
  156. package/dist/components/t-toast.vue.d.ts +0 -38
  157. package/dist/components/t-toggle-password.vue.d.ts +0 -31
  158. package/dist/components/t-toolbar.vue.d.ts +0 -26
  159. package/dist/controllers/action.d.ts +0 -4
  160. package/dist/controllers/alert.d.ts +0 -4
  161. package/dist/controllers/index.d.ts +0 -8
  162. package/dist/controllers/loading.d.ts +0 -5
  163. package/dist/controllers/present.d.ts +0 -4
  164. package/dist/controllers/toast.d.ts +0 -4
  165. package/dist/utils/defaultEvent.d.ts +0 -2
  166. /package/dist/{controllers/keyboard.d.ts → components/keyboard-space/factory.d.ts} +0 -0
package/dist/index.es.js CHANGED
@@ -1,19 +1,28 @@
1
- import { createElementBlock as f, openBlock as i, renderSlot as _, defineComponent as h, ref as m, computed as x, reactive as ie, watch as W, onMounted as L, Fragment as q, withDirectives as j, createCommentVNode as E, normalizeStyle as T, vShow as G, normalizeClass as B, createElementVNode as $, createVNode as ue, createBlock as C, withCtx as N, toDisplayString as A, renderList as K, createTextVNode as M, createApp as J, h as Q, provide as de, unref as O, onUnmounted as se, resolveDynamicComponent as ke, markRaw as $e, inject as pe, useAttrs as xe, nextTick as le } from "vue";
2
- import { gesture as re } from "@toife/gesture";
3
- import { useRouter as fe, useRoute as Te } from "vue-router";
4
- const g = (t, o) => {
5
- const e = t.__vccOpts || t;
6
- for (const [s, r] of o)
7
- e[s] = r;
8
- return e;
9
- }, we = {}, Se = { class: "t-app" };
10
- function Be(t, o) {
11
- return i(), f("div", Se, [
12
- _(t.$slots, "default")
1
+ import { defineComponent as k, createElementBlock as y, openBlock as i, normalizeClass as p, renderSlot as $, ref as u, computed as b, reactive as ie, watch as z, onMounted as A, Fragment as q, withDirectives as G, createCommentVNode as C, normalizeStyle as w, vShow as U, createElementVNode as S, createVNode as ye, createBlock as j, withCtx as D, renderList as J, createTextVNode as F, toDisplayString as V, createApp as re, h as oe, onUnmounted as M, markRaw as pe, resolveDynamicComponent as Ie, useAttrs as fe, provide as Q, inject as Z, nextTick as ce } from "vue";
2
+ import { useRouter as Y, useRoute as me } from "vue-router";
3
+ import { gesture as L } from "@toife/gesture";
4
+ const Oe = /* @__PURE__ */ k({
5
+ __name: "app",
6
+ setup(r, { expose: o }) {
7
+ o();
8
+ const t = {};
9
+ return Object.defineProperty(t, "__isScriptSetup", { enumerable: !1, value: !0 }), t;
10
+ }
11
+ }), Be = {
12
+ class: /* @__PURE__ */ p({ "toife-app": !0 })
13
+ };
14
+ function Ce(r, o, t, e, s, n) {
15
+ return i(), y("div", Be, [
16
+ $(r.$slots, "default")
13
17
  ]);
14
18
  }
15
- const ze = /* @__PURE__ */ g(we, [["render", Be]]), Ie = /* @__PURE__ */ h({
16
- __name: "t-present",
19
+ const x = (r, o) => {
20
+ const t = r.__vccOpts || r;
21
+ for (const [e, s] of o)
22
+ t[e] = s;
23
+ return t;
24
+ }, ze = /* @__PURE__ */ x(Oe, [["render", Ce]]), _e = u(1e3), ve = () => (_e.value += 2, _e.value), Ee = /* @__PURE__ */ k({
25
+ __name: "present",
17
26
  props: {
18
27
  keepalive: { type: Boolean, default: !0 },
19
28
  visible: { type: Boolean, default: !1 },
@@ -25,113 +34,116 @@ const ze = /* @__PURE__ */ g(we, [["render", Be]]), Ie = /* @__PURE__ */ h({
25
34
  duration: { default: 200 }
26
35
  },
27
36
  emits: ["dismiss"],
28
- setup(t, { expose: o, emit: e }) {
29
- const s = m(0), r = m(!1), l = m(), u = m(), n = t, p = e, v = x(() => r.value || n.keepalive), d = m(!1), a = ie({
30
- "--t-present-backdrop-opacity": "0.4",
31
- "--t-present-transition": "0.2s",
32
- "--t-present-content-transform": "0px",
33
- "--t-present-content-opacity": "1"
34
- }), c = x(() => n.duration / 1e3 + "s"), y = (k) => {
35
- n.backdrop ? k?.backdropOpacity && (a["--t-present-backdrop-opacity"] = k.backdropOpacity) : a["--t-present-backdrop-opacity"] = "0", k.transition && (a["--t-present-transition"] = k.transition), k.contentTransform && (a["--t-present-content-transform"] = k.contentTransform), k.contentOpacity && (a["--t-present-content-opacity"] = k.contentOpacity);
36
- }, w = () => {
37
- if (n.bounce !== void 0 && !d.value) {
38
- d.value = !0;
39
- let k = n.bounce;
40
- (n.placement == "bottom" || n.placement == "right") && (k = `calc(${n.bounce} * -1)`), y({
41
- contentTransform: k,
42
- transition: c.value,
37
+ setup(r, { expose: o, emit: t }) {
38
+ const e = u(0), s = u(!1), n = u(), l = u(), a = r, c = t, d = b(() => s.value || a.keepalive), _ = u(!1), g = ie({
39
+ "--toife-present-backdrop-opacity": "0.4",
40
+ "--toife-present-transition": "0.2s",
41
+ "--toife-present-content-transform": "0px",
42
+ "--toife-present-content-opacity": "1"
43
+ }), v = b(() => a.duration / 1e3 + "s"), m = (T) => {
44
+ a.backdrop ? T?.backdropOpacity && (g["--toife-present-backdrop-opacity"] = T.backdropOpacity) : g["--toife-present-backdrop-opacity"] = "0", T.transition && (g["--toife-present-transition"] = T.transition), T.contentTransform && (g["--toife-present-content-transform"] = T.contentTransform), T.contentOpacity && (g["--toife-present-content-opacity"] = T.contentOpacity);
45
+ }, h = () => {
46
+ if (a.bounce !== void 0 && !_.value) {
47
+ _.value = !0;
48
+ let T = a.bounce;
49
+ (a.placement == "bottom" || a.placement == "right") && (T = `calc(${a.bounce} * -1)`), m({
50
+ contentTransform: T,
51
+ transition: v.value,
43
52
  backdropOpacity: "0.4",
44
53
  contentOpacity: "1"
45
54
  }), setTimeout(() => {
46
- y({
55
+ m({
47
56
  contentTransform: "0px"
48
57
  });
49
- }, n.duration);
58
+ }, a.duration);
50
59
  } else
51
- y({
60
+ m({
52
61
  contentTransform: "0px",
53
- transition: c.value,
62
+ transition: v.value,
54
63
  backdropOpacity: "0.4",
55
64
  contentOpacity: "1"
56
65
  });
57
- }, b = () => {
58
- let k = "0px", U = "1";
59
- n.placement == "bottom" || n.placement == "right" ? k = "100%" : n.placement == "top" || n.placement == "left" ? k = "-100%" : n.placement == "center" && (k = "0px", U = "0"), y({
60
- contentTransform: k,
61
- transition: c.value,
62
- contentOpacity: U,
66
+ }, f = () => {
67
+ let T = "0px", W = "1";
68
+ a.placement == "bottom" || a.placement == "right" ? T = "100%" : a.placement == "top" || a.placement == "left" ? T = "-100%" : a.placement == "center" && (T = "0px", W = "0"), m({
69
+ contentTransform: T,
70
+ transition: v.value,
71
+ contentOpacity: W,
63
72
  backdropOpacity: "0"
64
73
  });
65
74
  };
66
- W(() => n.visible, () => {
67
- n.visible ? (d.value = !1, r.value = !0, s.value = Me.getNewIndex(), setTimeout(() => {
68
- w();
69
- }, 50)) : (b(), setTimeout(() => {
70
- r.value = !1;
75
+ z(() => a.visible, () => {
76
+ a.visible ? (_.value = !1, s.value = !0, e.value = ve(), setTimeout(() => {
77
+ h();
78
+ }, 50)) : (f(), setTimeout(() => {
79
+ s.value = !1;
71
80
  }, 200));
72
81
  }), o({
73
- render: y,
74
- open: w,
75
- close: b
82
+ render: m,
83
+ open: h,
84
+ close: f
76
85
  });
77
- const P = (k) => {
78
- k.preventDefault(), p("dismiss", "backdrop");
86
+ const I = (T) => {
87
+ T.preventDefault(), c("dismiss", "backdrop");
79
88
  };
80
- return L(() => {
81
- n.visible ? w() : b();
82
- }), (k, U) => (i(), f(q, null, [
83
- v.value ? j((i(), f("div", {
84
- key: 0,
85
- class: "t-present-backdrop",
86
- onPointerup: P,
87
- ref_key: "backdrop",
88
- ref: l,
89
- style: T([a, { zIndex: s.value - 1 }, n.style])
90
- }, null, 36)), [
91
- [G, r.value]
92
- ]) : E("", !0),
93
- v.value ? j((i(), f("div", {
94
- key: 1,
95
- class: B(["t-present", [{ [k.placement]: !0 }, n.class]]),
96
- ref_key: "present",
97
- ref: u,
98
- style: T([a, { zIndex: s.value }, n.style])
99
- }, [
100
- _(k.$slots, "default", {}, void 0, !0)
101
- ], 6)), [
102
- [G, r.value]
103
- ]) : E("", !0)
104
- ], 64));
89
+ A(() => {
90
+ a.visible ? h() : f();
91
+ });
92
+ const P = { zIndex: e, isShow: s, backdrop: n, present: l, props: a, emit: c, isRender: d, isBounced: _, styles: g, time: v, render: m, open: h, close: f, onClickBackdrop: I, computed: b, onMounted: A, reactive: ie, ref: u, watch: z, get getNewPresentIndex() {
93
+ return ve;
94
+ } };
95
+ return Object.defineProperty(P, "__isScriptSetup", { enumerable: !1, value: !0 }), P;
105
96
  }
106
- }), F = /* @__PURE__ */ g(Ie, [["__scopeId", "data-v-b910ec38"]]), Ee = /* @__PURE__ */ h({
107
- __name: "t-icon-spinner",
97
+ });
98
+ function je(r, o, t, e, s, n) {
99
+ return i(), y(q, null, [
100
+ e.isRender ? G((i(), y("div", {
101
+ key: 0,
102
+ class: p({ "toife-present-backdrop": !0 }),
103
+ onPointerup: e.onClickBackdrop,
104
+ ref: "backdrop",
105
+ style: w([e.styles, { zIndex: e.zIndex - 1 }, e.props.style])
106
+ }, null, 36)), [
107
+ [U, e.isShow]
108
+ ]) : C("", !0),
109
+ e.isRender ? G((i(), y("div", {
110
+ key: 1,
111
+ ref: "present",
112
+ class: p([{ "toife-present": !0, [t.placement]: !0 }, e.props.class]),
113
+ style: w([e.styles, { zIndex: e.zIndex }, e.props.style])
114
+ }, [
115
+ $(r.$slots, "default", {}, void 0, !0)
116
+ ], 6)), [
117
+ [U, e.isShow]
118
+ ]) : C("", !0)
119
+ ], 64);
120
+ }
121
+ const K = /* @__PURE__ */ x(Ee, [["render", je], ["__scopeId", "data-v-dbddbda8"]]), Re = /* @__PURE__ */ k({
122
+ __name: "icon-spinner",
108
123
  props: {
109
- size: {
110
- type: String,
111
- default: "24px"
112
- },
113
- color: {
114
- type: String,
115
- default: "var(--t-color-text)"
116
- }
124
+ size: { default: "24px" },
125
+ color: { default: "var(--toife-color-text)" }
117
126
  },
118
- setup(t) {
119
- return (o, e) => (i(), f("span", {
120
- class: "t-icon-spinner",
121
- style: T({
122
- width: t.size,
123
- height: t.size,
124
- borderTopColor: t.color
125
- }),
126
- role: "status",
127
- "aria-label": "Loading..."
128
- }, null, 4));
127
+ setup(r, { expose: o }) {
128
+ o();
129
+ const t = {};
130
+ return Object.defineProperty(t, "__isScriptSetup", { enumerable: !1, value: !0 }), t;
129
131
  }
130
- }), ne = /* @__PURE__ */ g(Ee, [["__scopeId", "data-v-6192deb4"]]), Pe = { class: "t-button-content" }, Ve = {
131
- key: 0,
132
- class: "loader"
133
- }, Ce = /* @__PURE__ */ h({
134
- __name: "t-button",
132
+ });
133
+ function Ve(r, o, t, e, s, n) {
134
+ return i(), y("span", {
135
+ class: p({ "toife-icon-spinner": !0 }),
136
+ style: w({
137
+ width: t.size,
138
+ height: t.size,
139
+ borderTopColor: t.color
140
+ }),
141
+ role: "status",
142
+ "aria-label": "Loading..."
143
+ }, null, 4);
144
+ }
145
+ const ue = /* @__PURE__ */ x(Re, [["render", Ve], ["__scopeId", "data-v-bddf6a6e"]]), Ae = /* @__PURE__ */ k({
146
+ __name: "button",
135
147
  props: {
136
148
  color: { default: null },
137
149
  size: { default: "standard" },
@@ -142,1139 +154,1353 @@ const ze = /* @__PURE__ */ g(we, [["render", Be]]), Ie = /* @__PURE__ */ h({
142
154
  variant: { default: "default" },
143
155
  activeBackground: { type: Boolean, default: !1 }
144
156
  },
145
- setup(t) {
146
- const o = t, e = x(() => {
147
- let s;
148
- return o.variant == "default" && (o.color ? ["warning", "info", "danger", "primary", "secondary", "success"].includes(o.color) ? s = {
157
+ setup(r, { expose: o }) {
158
+ o();
159
+ const t = r, e = b(() => {
160
+ let n;
161
+ return t.variant == "default" && (t.color ? ["warning", "info", "danger", "primary", "secondary", "success"].includes(t.color) ? n = {
149
162
  "--border": "none",
150
- "--color": "var(--t-color-status-" + o.color + "-text)",
151
- "--background": "var(--t-color-status-" + o.color + ")"
152
- } : s = {
163
+ "--color": "var(--toife-color-status-" + t.color + "-text)",
164
+ "--background": "var(--toife-color-status-" + t.color + ")"
165
+ } : n = {
153
166
  "--border": "none",
154
- "--color": "var(--t-color-text)",
155
- "--background": o.color
156
- } : s = {
167
+ "--color": "var(--toife-color-text)",
168
+ "--background": t.color
169
+ } : n = {
157
170
  "--border": "none",
158
- "--color": "var(--t-color-text)",
159
- "--background": "var(--t-color-surface)"
160
- }), o.variant == "text" && (o.color ? ["warning", "info", "danger", "primary", "secondary", "success"].includes(o.color) ? s = {
171
+ "--color": "var(--toife-color-text)",
172
+ "--background": "var(--toife-color-surface)"
173
+ }), t.variant == "text" && (t.color ? ["warning", "info", "danger", "primary", "secondary", "success"].includes(t.color) ? n = {
161
174
  "--border": "none",
162
- "--color": "var(--t-color-status-" + o.color + ")",
175
+ "--color": "var(--toife-color-status-" + t.color + ")",
163
176
  "--background": "transparent"
164
- } : s = {
177
+ } : n = {
165
178
  "--border": "none",
166
- "--color": o.color,
179
+ "--color": t.color,
167
180
  "--background": "transparent"
168
- } : s = {
181
+ } : n = {
169
182
  "--border": "none",
170
- "--color": "var(--t-color-text)",
183
+ "--color": "var(--toife-color-text)",
171
184
  "--background": "transparent"
172
- }), o.variant == "outline" && (o.color ? ["warning", "info", "danger", "primary", "secondary", "success"].includes(o.color) ? s = {
173
- "--border": "0.55px solid var(--t-color-status-" + o.color + ")",
174
- "--color": "var(--t-color-status-" + o.color + ")",
185
+ }), t.variant == "outline" && (t.color ? ["warning", "info", "danger", "primary", "secondary", "success"].includes(t.color) ? n = {
186
+ "--border": "0.55px solid var(--toife-color-status-" + t.color + ")",
187
+ "--color": "var(--toife-color-status-" + t.color + ")",
175
188
  "--background": "transparent"
176
- } : s = {
177
- "--border": "0.55px solid " + o.color,
178
- "--color": o.color,
189
+ } : n = {
190
+ "--border": "0.55px solid " + t.color,
191
+ "--color": t.color,
179
192
  "--background": "transparent"
180
- } : s = {
181
- "--border": "0.55px solid var(--t-color-text)",
182
- "--color": "var(--t-color-text)",
193
+ } : n = {
194
+ "--border": "0.55px solid var(--toife-color-text)",
195
+ "--color": "var(--toife-color-text)",
183
196
  "--background": "transparent"
184
- }), s;
185
- });
186
- return (s, r) => (i(), f("button", {
187
- class: B(["t-button", { "active-background": o.activeBackground, rounded: o.rounded, block: o.block, ["size-" + o.size]: !0 }]),
188
- style: T(e.value)
189
- }, [
190
- j($("span", Pe, [
191
- _(s.$slots, "default", {}, void 0, !0)
192
- ], 512), [
193
- [G, !o.loading]
194
- ]),
195
- o.loading ? (i(), f("span", Ve, [
196
- ue(ne, {
197
- color: "var(--color)",
198
- type: o.loadingType
199
- }, null, 8, ["type"])
200
- ])) : E("", !0)
201
- ], 6));
197
+ }), n;
198
+ }), s = { props: t, styles: e, computed: b, get IconSpinner() {
199
+ return ue;
200
+ } };
201
+ return Object.defineProperty(s, "__isScriptSetup", { enumerable: !1, value: !0 }), s;
202
202
  }
203
- }), Z = /* @__PURE__ */ g(Ce, [["__scopeId", "data-v-f1db05a6"]]), Re = {
203
+ }), De = {
204
+ class: /* @__PURE__ */ p({ "toife-button-content": !0 })
205
+ }, Ne = {
204
206
  key: 0,
205
- class: "t-alert-header"
206
- }, Ae = { class: "t-alert-content" }, Oe = { class: "t-alert-footer" }, Ne = /* @__PURE__ */ h({
207
- __name: "t-alert",
207
+ class: "loader"
208
+ };
209
+ function Xe(r, o, t, e, s, n) {
210
+ return i(), y("button", {
211
+ style: w(e.styles),
212
+ class: p({ "toife-button": !0, "active-background": e.props.activeBackground, rounded: e.props.rounded, block: e.props.block, ["size-" + e.props.size]: !0 })
213
+ }, [
214
+ G(S("span", De, [
215
+ $(r.$slots, "default", {}, void 0, !0)
216
+ ], 512), [
217
+ [U, !e.props.loading]
218
+ ]),
219
+ e.props.loading ? (i(), y("span", Ne, [
220
+ ye(e.IconSpinner, {
221
+ color: "var(--color)",
222
+ type: e.props.loadingType
223
+ }, null, 8, ["type"])
224
+ ])) : C("", !0)
225
+ ], 6);
226
+ }
227
+ const ne = /* @__PURE__ */ x(Ae, [["render", Xe], ["__scopeId", "data-v-3ab201fc"]]), We = /* @__PURE__ */ k({
228
+ __name: "action",
208
229
  props: {
209
- title: {},
210
- message: {},
211
- actions: {},
212
- dismiss: {}
230
+ actions: { default: () => [] },
231
+ visible: { type: Boolean, default: !1 },
232
+ dismiss: { default: () => [] }
213
233
  },
214
234
  emits: ["dismiss"],
215
- setup(t, { expose: o, emit: e }) {
216
- const s = t, r = e, l = m(!1), u = m(), n = m(!1), p = () => {
217
- l.value = !0;
218
- }, v = (a) => {
219
- l.value = !1, a.handler && a.handler(), r("dismiss", "choose", a?.data);
220
- }, d = (a) => {
221
- s.dismiss && s.dismiss.includes(a) ? (l.value = !1, r("dismiss", a)) : a == "backdrop" && (n.value = !0, setTimeout(() => {
222
- n.value = !1;
235
+ setup(r, { expose: o, emit: t }) {
236
+ const e = r, s = t, n = u(!1), l = u(), a = u(!1), c = () => {
237
+ n.value = !0;
238
+ }, d = () => {
239
+ n.value = !1;
240
+ }, _ = (m) => {
241
+ d(), m.handler && m.handler(), s("dismiss", "choose", m?.data);
242
+ }, g = (m) => {
243
+ e.dismiss && e.dismiss.includes(m) ? (d(), s("dismiss", m)) : m === "backdrop" && (a.value = !0, setTimeout(() => {
244
+ a.value = !1;
223
245
  }, 300));
224
246
  };
225
- return o({
226
- open: p
227
- }), (a, c) => (i(), C(F, {
228
- placement: "center",
229
- backdrop: !0,
230
- keepalive: !1,
231
- visible: l.value,
232
- onDismiss: d
233
- }, {
234
- default: N(() => [
235
- $("div", {
236
- class: B(["t-alert", { pop: n.value }]),
237
- ref_key: "container",
238
- ref: u
239
- }, [
240
- _(a.$slots, "header", {}, () => [
241
- s.title ? (i(), f("div", Re, A(s.title), 1)) : E("", !0)
242
- ], !0),
243
- _(a.$slots, "content", {}, () => [
244
- $("div", Ae, A(s.message), 1)
245
- ], !0),
246
- _(a.$slots, "footer", {}, () => [
247
- $("div", Oe, [
248
- (i(!0), f(q, null, K(s.actions, (y) => (i(), C(Z, {
249
- color: y.color,
250
- variant: y.variant,
251
- onPointerup: (w) => v(y)
252
- }, {
253
- default: N(() => [
254
- M(A(y.text), 1)
255
- ]),
256
- _: 2
257
- }, 1032, ["color", "variant", "onPointerup"]))), 256))
258
- ])
259
- ], !0)
260
- ], 2)
261
- ]),
262
- _: 3
263
- }, 8, ["visible"]));
247
+ z(() => e.visible, (m) => {
248
+ m ? c() : d();
249
+ }, { immediate: !0 }), o({
250
+ open: c,
251
+ close: d
252
+ });
253
+ const v = { props: e, emit: s, _visible: n, container: l, pop: a, open: c, close: d, choose: _, onDismiss: g, ref: u, watch: z, get Present() {
254
+ return K;
255
+ }, get CustomButton() {
256
+ return ne;
257
+ } };
258
+ return Object.defineProperty(v, "__isScriptSetup", { enumerable: !1, value: !0 }), v;
264
259
  }
265
- }), me = /* @__PURE__ */ g(Ne, [["__scopeId", "data-v-9786ec4e"]]), _o = (t = {}) => ({
260
+ });
261
+ function qe(r, o, t, e, s, n) {
262
+ return i(), j(e.Present, {
263
+ placement: "bottom",
264
+ backdrop: !0,
265
+ keepalive: !1,
266
+ visible: e._visible,
267
+ onDismiss: e.onDismiss
268
+ }, {
269
+ default: D(() => [
270
+ S("div", {
271
+ class: p({ pop: e.pop, "toife-action": !0 }),
272
+ ref: "container"
273
+ }, [
274
+ (i(!0), y(q, null, J(e.props.actions, (l, a) => (i(), y("div", { key: a }, [
275
+ (i(!0), y(q, null, J(l, (c, d) => (i(), j(e.CustomButton, {
276
+ key: c.key ?? `${a}-${d}`,
277
+ color: c.color,
278
+ size: c.size,
279
+ variant: c.variant,
280
+ onPointerup: (_) => e.choose(c),
281
+ block: ""
282
+ }, {
283
+ default: D(() => [
284
+ F(V(c.text), 1)
285
+ ]),
286
+ _: 2
287
+ }, 1032, ["color", "size", "variant", "onPointerup"]))), 128))
288
+ ]))), 128))
289
+ ], 2)
290
+ ]),
291
+ _: 1
292
+ }, 8, ["visible"]);
293
+ }
294
+ const be = /* @__PURE__ */ x(We, [["render", qe], ["__scopeId", "data-v-9d4bf238"]]), to = (r = {}, o) => ({
266
295
  open() {
267
- return new Promise((o) => {
268
- let e = document.body.querySelector(".t-app");
296
+ return new Promise((t) => {
297
+ let e = document.body.querySelector(".toife-app");
269
298
  if (!e) return;
270
- const s = document.createElement("div"), r = m();
299
+ const s = document.createElement("div"), n = u();
271
300
  e.appendChild(s);
272
- const l = J({
301
+ const l = re({
273
302
  render() {
274
- return Q(me, {
275
- ...t,
276
- ref: r,
277
- onDismiss: (u, n) => {
303
+ return oe(o || be, {
304
+ ...r,
305
+ ref: n,
306
+ onDismiss: (a, c) => {
278
307
  setTimeout(() => {
279
308
  l.unmount(), s.remove();
280
- }, 300), o({ type: u, data: n });
309
+ }, 300), t({ type: a, data: c });
281
310
  }
282
311
  });
283
312
  }
284
313
  });
285
314
  l.mount(s), setTimeout(() => {
286
- r.value?.open?.();
315
+ n.value?.open?.();
287
316
  }, 50);
288
317
  });
289
318
  }
290
- }), Xe = /* @__PURE__ */ h({
291
- __name: "t-action",
319
+ }), Me = /* @__PURE__ */ k({
320
+ __name: "alert",
292
321
  props: {
322
+ title: { default: "" },
323
+ message: { default: "" },
293
324
  actions: { default: () => [] },
294
- visible: { type: Boolean, default: !1 },
295
325
  dismiss: { default: () => [] }
296
326
  },
297
327
  emits: ["dismiss"],
298
- setup(t, { expose: o, emit: e }) {
299
- const s = t, r = e, l = m(!1), u = m(), n = m(!1), p = () => {
300
- l.value = !0;
301
- }, v = () => {
302
- l.value = !1;
303
- }, d = (c) => {
304
- v(), c.handler && c.handler(), r("dismiss", "choose", c?.data);
305
- }, a = (c) => {
306
- s.dismiss && s.dismiss.includes(c) ? (v(), r("dismiss", c)) : c === "backdrop" && (n.value = !0, setTimeout(() => {
307
- n.value = !1;
328
+ setup(r, { expose: o, emit: t }) {
329
+ const e = r, s = t, n = u(!1), l = u(), a = u(!1), c = () => {
330
+ n.value = !0;
331
+ }, d = (v) => {
332
+ n.value = !1, v.handler && v.handler(), s("dismiss", "choose", v?.data);
333
+ }, _ = (v) => {
334
+ e.dismiss && e.dismiss.includes(v) ? (n.value = !1, s("dismiss", v)) : v == "backdrop" && (a.value = !0, setTimeout(() => {
335
+ a.value = !1;
308
336
  }, 300));
309
337
  };
310
- return W(() => s.visible, (c) => {
311
- c ? p() : v();
312
- }, { immediate: !0 }), o({
313
- open: p,
314
- close: v
315
- }), (c, y) => (i(), C(F, {
316
- placement: "bottom",
317
- backdrop: !0,
318
- keepalive: !1,
319
- visible: l.value,
320
- onDismiss: a
321
- }, {
322
- default: N(() => [
323
- $("div", {
324
- class: B(["t-action", { pop: n.value }]),
325
- ref_key: "container",
326
- ref: u
327
- }, [
328
- (i(!0), f(q, null, K(s.actions, (w, b) => (i(), f("div", { key: b }, [
329
- (i(!0), f(q, null, K(w, (P, k) => (i(), C(Z, {
330
- key: P.key ?? `${b}-${k}`,
331
- color: P.color,
332
- size: P.size,
333
- variant: P.variant,
334
- onPointerup: (U) => d(P),
335
- block: ""
338
+ o({
339
+ open: c
340
+ });
341
+ const g = { props: e, emit: s, visible: n, container: l, pop: a, open: c, choose: d, onDismiss: _, ref: u, get Present() {
342
+ return K;
343
+ }, get CustomButton() {
344
+ return ne;
345
+ } };
346
+ return Object.defineProperty(g, "__isScriptSetup", { enumerable: !1, value: !0 }), g;
347
+ }
348
+ }), Le = {
349
+ key: 0,
350
+ class: /* @__PURE__ */ p({ "toife-alert-header": !0 })
351
+ }, Fe = {
352
+ class: /* @__PURE__ */ p({ "toife-alert-content": !0 })
353
+ }, He = {
354
+ class: /* @__PURE__ */ p({ "toife-alert-footer": !0 })
355
+ };
356
+ function Ke(r, o, t, e, s, n) {
357
+ return i(), j(e.Present, {
358
+ placement: "center",
359
+ backdrop: !0,
360
+ keepalive: !1,
361
+ visible: e.visible,
362
+ onDismiss: e.onDismiss
363
+ }, {
364
+ default: D(() => [
365
+ S("div", {
366
+ class: p({ pop: e.pop, "toife-alert": !0 }),
367
+ ref: "container"
368
+ }, [
369
+ $(r.$slots, "header", {}, () => [
370
+ e.props.title ? (i(), y("div", Le, V(e.props.title), 1)) : C("", !0)
371
+ ], !0),
372
+ $(r.$slots, "content", {}, () => [
373
+ S("div", Fe, V(e.props.message), 1)
374
+ ], !0),
375
+ $(r.$slots, "footer", {}, () => [
376
+ S("div", He, [
377
+ (i(!0), y(q, null, J(e.props.actions, (l) => (i(), j(e.CustomButton, {
378
+ color: l.color,
379
+ variant: l.variant,
380
+ onPointerup: (a) => e.choose(l)
336
381
  }, {
337
- default: N(() => [
338
- M(A(P.text), 1)
382
+ default: D(() => [
383
+ F(V(l.text), 1)
339
384
  ]),
340
385
  _: 2
341
- }, 1032, ["color", "size", "variant", "onPointerup"]))), 128))
342
- ]))), 128))
343
- ], 2)
344
- ]),
345
- _: 1
346
- }, 8, ["visible"]));
347
- }
348
- }), De = /* @__PURE__ */ g(Xe, [["__scopeId", "data-v-b089000d"]]), go = (t = {}) => ({
386
+ }, 1032, ["color", "variant", "onPointerup"]))), 256))
387
+ ])
388
+ ], !0)
389
+ ], 2)
390
+ ]),
391
+ _: 3
392
+ }, 8, ["visible"]);
393
+ }
394
+ const ge = /* @__PURE__ */ x(Me, [["render", Ke], ["__scopeId", "data-v-64e5ebe5"]]), ro = (r = {}, o) => ({
349
395
  open() {
350
- return new Promise((o) => {
351
- let e = document.body.querySelector(".t-app");
396
+ return new Promise((t) => {
397
+ let e = document.body.querySelector(".toife-app");
352
398
  if (!e) return;
353
- const s = document.createElement("div"), r = m();
399
+ const s = document.createElement("div"), n = u();
354
400
  e.appendChild(s);
355
- const l = J({
401
+ const l = re({
356
402
  render() {
357
- return Q(De, {
358
- ...t,
359
- ref: r,
360
- onDismiss: (u, n) => {
403
+ return oe(o || ge, {
404
+ ...r,
405
+ ref: n,
406
+ onDismiss: (a, c) => {
361
407
  setTimeout(() => {
362
408
  l.unmount(), s.remove();
363
- }, 300), o({ type: u, data: n });
409
+ }, 300), t({ type: a, data: c });
364
410
  }
365
411
  });
366
412
  }
367
413
  });
368
414
  l.mount(s), setTimeout(() => {
369
- r.value?.open?.();
415
+ n.value?.open?.();
370
416
  }, 50);
371
417
  });
372
418
  }
373
- }), We = { class: "t-loading" }, qe = /* @__PURE__ */ h({
374
- __name: "t-loading",
419
+ }), Ge = /* @__PURE__ */ k({
420
+ __name: "avatar",
375
421
  props: {
376
- type: { default: "spinner" }
422
+ square: { type: Boolean, default: !1 },
423
+ size: { default: "standard" }
377
424
  },
378
- emits: ["dismiss"],
379
- setup(t, { expose: o, emit: e }) {
380
- const s = m(!1);
381
- return o({
382
- open: () => {
383
- s.value = !0;
384
- },
385
- close: () => {
386
- s.value = !1;
387
- }
388
- }), (u, n) => (i(), C(F, {
389
- placement: "center",
390
- backdrop: !0,
391
- keepalive: !1,
392
- visible: s.value
393
- }, {
394
- default: N(() => [
395
- $("div", We, [
396
- _(u.$slots, "default", {}, () => [
397
- u.type === "spinner" ? (i(), C(ne, { key: 0 })) : E("", !0)
398
- ], !0)
399
- ])
400
- ]),
401
- _: 3
402
- }, 8, ["visible"]));
425
+ setup(r, { expose: o }) {
426
+ o();
427
+ const t = r, e = b(() => t.size == "small" ? "24px" : t.size == "standard" ? "40px" : t.size == "large" ? "60px" : t.size), s = { props: t, width: e, computed: b };
428
+ return Object.defineProperty(s, "__isScriptSetup", { enumerable: !1, value: !0 }), s;
403
429
  }
404
- }), ve = /* @__PURE__ */ g(qe, [["__scopeId", "data-v-598c3462"]]), bo = (t = {}) => {
405
- const o = m(), e = document.body.querySelector(".t-app");
406
- let s = null, r = null;
407
- return {
408
- open() {
409
- return new Promise((l) => {
410
- e && (r = document.createElement("div"), e.appendChild(r), s = J({
411
- render() {
412
- return Q(ve, {
413
- ...t,
414
- ref: o
415
- });
416
- }
417
- }), s.mount(r), setTimeout(() => {
418
- o.value?.open?.(), l(!0);
419
- }, 50));
420
- });
421
- },
422
- close() {
423
- return new Promise((l) => {
424
- o.value?.close?.(), setTimeout(() => {
425
- s?.unmount?.(), r?.remove?.(), l(!0);
426
- }, 300);
427
- });
428
- }
429
- };
430
- }, ce = m(1e3), Me = {
431
- getNewIndex() {
432
- return ce.value += 2, ce.value;
430
+ });
431
+ function Ue(r, o, t, e, s, n) {
432
+ return i(), y("div", {
433
+ class: p({ square: t.square, "toife-avatar": !0 }),
434
+ style: w({ "--size": e.width })
435
+ }, [
436
+ $(r.$slots, "default", {}, void 0, !0)
437
+ ], 6);
438
+ }
439
+ const Je = /* @__PURE__ */ x(Ge, [["render", Ue], ["__scopeId", "data-v-32c57a0d"]]), Qe = /* @__PURE__ */ k({
440
+ __name: "screen",
441
+ setup(r, { expose: o }) {
442
+ o();
443
+ const t = {};
444
+ return Object.defineProperty(t, "__isScriptSetup", { enumerable: !1, value: !0 }), t;
433
445
  }
434
- }, X = ie([]), Y = m(!0), I = m(!1), R = m(-1), z = x(() => X[R.value]), H = x(() => X[R.value + 1] || void 0), V = x(() => X[X.length - 2]), ye = x(() => !I.value && Y.value && V.value), D = (t = !0) => {
435
- let e = z.value.target.closest(".t-app").offsetWidth;
436
- return t ? e + "px" : e;
437
- }, ee = {
446
+ }), Ze = {
447
+ class: /* @__PURE__ */ p({ "toife-screen": !0 })
448
+ };
449
+ function Ye(r, o, t, e, s, n) {
450
+ return i(), y("div", Ze, [
451
+ $(r.$slots, "default", {}, void 0, !0)
452
+ ]);
453
+ }
454
+ const he = /* @__PURE__ */ x(Qe, [["render", Ye], ["__scopeId", "data-v-59be2187"]]), N = ie([]), se = u(!0), B = u(!1), R = u(-1), O = b(() => N[R.value]), H = b(() => N[R.value + 1] || void 0), E = b(() => N[N.length - 2]), ke = b(() => !B.value && se.value && E.value), X = (r = !0) => {
455
+ let t = O.value.target.closest(".toife-app").offsetWidth;
456
+ return r ? t + "px" : t;
457
+ }, ae = {
438
458
  reset() {
439
- I.value = !0;
440
- const t = D(), o = z.value.target, e = V.value.target;
441
- o.style.transition = "transform 0.35s ease", o.style.transform = "translateX(0px)", e.style.transition = "transform 0.35s ease", e.style.transform = `translateX(calc(${t} / 100 * 30 * -1)) scale(0.5) perspective(${t}) rotateY(30deg)`, document.documentElement.style.setProperty("--t-screen-backdrop-duration", "0.35s"), document.documentElement.style.setProperty("--t-swipe-backdrop-opacity", "0.5"), setTimeout(() => {
442
- I.value = !1;
459
+ B.value = !0;
460
+ const r = X(), o = O.value.target, t = E.value.target;
461
+ o.style.transition = "transform 0.25s ease", o.style.transform = "translateX(0px)", t.style.transition = "transform 0.25s ease", t.style.transform = `translateX(calc(${r} / 100 * 30 * -1)) scale(0.5) perspective(${r}) rotateY(30deg)`, document.documentElement.style.setProperty("--toife-screen-backdrop-duration", "0.25s"), document.documentElement.style.setProperty("--toife-swipe-backdrop-opacity", "0.5"), setTimeout(() => {
462
+ B.value = !1;
443
463
  }, 400);
444
464
  },
445
- move(t) {
446
- if (!ye.value) return;
447
- const o = D(!1), e = o + "px", s = t / o * 100, r = z.value.target, l = V.value.target;
448
- t > 15 && t <= o && (r.style.transition = "transform 0s ease", r.style.transform = `translateX(${t}px)`, l.style.transition = "transform 0s ease", document.documentElement.style.setProperty("--t-screen-backdrop-duration", "0s"), l.style.transform = `translateX(calc((${e} / 100 * 30 * -1) + ((${e} / 100 * 30) / 100 * ${s}))) scale(${0.5 + 0.5 / 100 * s}) perspective(${e}) rotateY(${30 - 30 / 100 * s}deg)`, document.documentElement.style.setProperty("--t-swipe-backdrop-opacity", `${0.5 - 0.5 / 100 * s}`));
465
+ move(r) {
466
+ if (!ke.value) return;
467
+ const o = X(!1), t = o + "px", e = r / o * 100, s = O.value.target, n = E.value.target;
468
+ r > 15 && r <= o && (s.style.transition = "transform 0s ease", s.style.transform = `translateX(${r}px)`, n.style.transition = "transform 0s ease", document.documentElement.style.setProperty("--toife-screen-backdrop-duration", "0s"), n.style.transform = `translateX(calc((${t} / 100 * 30 * -1) + ((${t} / 100 * 30) / 100 * ${e}))) scale(${0.5 + 0.5 / 100 * e}) perspective(${t}) rotateY(${30 - 30 / 100 * e}deg)`, document.documentElement.style.setProperty("--toife-swipe-backdrop-opacity", `${0.5 - 0.5 / 100 * e}`));
449
469
  },
450
- back(t) {
451
- if (!V.value) return;
452
- const o = D();
453
- z.value.target.style.transition = "transform 0.35s ease", z.value.target.style.transform = `translateX(${o}) scale(1)`, V.value.target.style.transition = "transform 0.35s ease", V.value.target.style.transform = `translateX(0px) scale(1) perspective(${o}) rotateY(0deg)`, document.documentElement.style.setProperty("--t-screen-backdrop-duration", "0.35s"), document.documentElement.style.setProperty("--t-swipe-backdrop-opacity", "0"), I.value = !0, setTimeout(() => {
454
- ae(), I.value = !1, R.value -= 1, t && t();
470
+ back(r) {
471
+ if (!E.value) return;
472
+ const o = X();
473
+ O.value.target.style.transition = "transform 0.25s ease", O.value.target.style.transform = `translateX(${o}) scale(1)`, E.value.target.style.transition = "transform 0.25s ease", E.value.target.style.transform = `translateX(0px) scale(1) perspective(${o}) rotateY(0deg)`, document.documentElement.style.setProperty("--toife-screen-backdrop-duration", "0.25s"), document.documentElement.style.setProperty("--toife-swipe-backdrop-opacity", "0"), B.value = !0, setTimeout(() => {
474
+ de(), B.value = !1, R.value -= 1, r && r();
455
475
  }, 400);
456
476
  },
457
- next(t) {
477
+ next(r) {
458
478
  if (!H.value) return;
459
479
  if (R.value == -1) {
460
- R.value += 1, t && t();
480
+ R.value += 1, r && r();
461
481
  return;
462
482
  }
463
- I.value = !0;
464
- const o = H.value.target, e = D();
465
- o.style.transform = `translateX(${e})`, o.transitionOrigin = "center", document.documentElement.style.setProperty("--t-screen-backdrop-duration", "0s"), document.documentElement.style.setProperty("--t-swipe-backdrop-opacity", "0"), setTimeout(() => {
466
- o.style.transition = "transform 0.35s ease", o.style.transform = "translateX(0px)", document.documentElement.style.setProperty("--t-screen-backdrop-duration", "0.35s"), document.documentElement.style.setProperty("--t-swipe-backdrop-opacity", "0.5"), z.value && (z.value.target.style.transitionOrigin = "left center", z.value.target.style.transition = "transform 0.35s ease", z.value.target.style.transform = `translateX(calc(${e} / 100 * 30 * -1)) scale(0.5) perspective(${e}) rotateY(30deg)`), setTimeout(() => {
467
- I.value = !1, R.value += 1, t && t();
483
+ B.value = !0;
484
+ const o = H.value.target, t = X();
485
+ o.style.transform = `translateX(${t})`, o.transitionOrigin = "center", document.documentElement.style.setProperty("--toife-screen-backdrop-duration", "0s"), document.documentElement.style.setProperty("--toife-swipe-backdrop-opacity", "0"), setTimeout(() => {
486
+ o.style.transition = "transform 0.25s ease", o.style.transform = "translateX(0px)", document.documentElement.style.setProperty("--toife-screen-backdrop-duration", "0.25s"), document.documentElement.style.setProperty("--toife-swipe-backdrop-opacity", "0.5"), O.value && (O.value.target.style.transitionOrigin = "left center", O.value.target.style.transition = "transform 0.25s ease", O.value.target.style.transform = `translateX(calc(${t} / 100 * 30 * -1)) scale(0.5) perspective(${t}) rotateY(30deg)`), setTimeout(() => {
487
+ B.value = !1, R.value += 1, r && r();
468
488
  }, 400);
469
489
  }, 100);
470
490
  }
471
- }, te = {
491
+ }, le = {
472
492
  reset() {
473
- I.value = !0;
474
- const t = D(), o = z.value.target, e = V.value.target;
475
- o.style.transition = "transform 0.35s ease", o.style.transform = "translateX(0px)", e.style.transition = "transform 0.35s ease", e.style.transform = `translateX(calc(${t} / 100 * 30 * -1))`, document.documentElement.style.setProperty("--t-screen-backdrop-duration", "0.35s"), document.documentElement.style.setProperty("--t-swipe-backdrop-opacity", "0.5"), setTimeout(() => {
476
- I.value = !1;
493
+ B.value = !0;
494
+ const r = X(), o = O.value.target, t = E.value.target;
495
+ o.style.transition = "transform 0.25s ease", o.style.transform = "translateX(0px)", t.style.transition = "transform 0.25s ease", t.style.transform = `translateX(calc(${r} / 100 * 30 * -1))`, document.documentElement.style.setProperty("--toife-screen-backdrop-duration", "0.25s"), document.documentElement.style.setProperty("--toife-swipe-backdrop-opacity", "0.5"), setTimeout(() => {
496
+ B.value = !1;
477
497
  }, 400);
478
498
  },
479
- move(t) {
480
- const o = D(!1), e = o + "px", s = t / o * 100, r = z.value.target, l = V.value.target;
481
- t > 15 && t <= o && (r.style.transition = "transform 0s ease", r.style.transform = `translateX(${t}px)`, l.style.transition = "transform 0s ease", document.documentElement.style.setProperty("--t-screen-backdrop-duration", "0s"), l.style.transform = `translateX(calc((${e} / 100 * 30 * -1) + ((${e} / 100 * 30) / 100 * ${s})))`, document.documentElement.style.setProperty("--t-swipe-backdrop-opacity", `${0.5 - 0.5 / 100 * s}`));
499
+ move(r) {
500
+ const o = X(!1), t = o + "px", e = r / o * 100, s = O.value.target, n = E.value.target;
501
+ r > 15 && r <= o && (s.style.transition = "transform 0s ease", s.style.transform = `translateX(${r}px)`, n.style.transition = "transform 0s ease", document.documentElement.style.setProperty("--toife-screen-backdrop-duration", "0s"), n.style.transform = `translateX(calc((${t} / 100 * 30 * -1) + ((${t} / 100 * 30) / 100 * ${e})))`, document.documentElement.style.setProperty("--toife-swipe-backdrop-opacity", `${0.5 - 0.5 / 100 * e}`));
482
502
  },
483
- back(t) {
484
- if (!V.value) return;
485
- const o = D();
486
- z.value.target.style.transition = "transform 0.35s ease", z.value.target.style.transform = `translateX(${o}) scale(1)`, V.value.target.style.transition = "transform 0.35s ease", V.value.target.style.transform = "translateX(0px)", document.documentElement.style.setProperty("--t-screen-backdrop-duration", "0.35s"), document.documentElement.style.setProperty("--t-swipe-backdrop-opacity", "0"), I.value = !0, setTimeout(() => {
487
- ae(), I.value = !1, R.value -= 1, t && t();
503
+ back(r) {
504
+ if (!E.value) return;
505
+ const o = X();
506
+ O.value.target.style.transition = "transform 0.25s ease", O.value.target.style.transform = `translateX(${o}) scale(1)`, E.value.target.style.transition = "transform 0.25s ease", E.value.target.style.transform = "translateX(0px)", document.documentElement.style.setProperty("--toife-screen-backdrop-duration", "0.25s"), document.documentElement.style.setProperty("--toife-swipe-backdrop-opacity", "0"), B.value = !0, setTimeout(() => {
507
+ de(), B.value = !1, R.value -= 1, r && r();
488
508
  }, 400);
489
509
  },
490
- next(t) {
510
+ next(r) {
491
511
  if (!H.value) return;
492
512
  if (R.value == -1) {
493
- R.value += 1, t && t();
513
+ R.value += 1, r && r();
494
514
  return;
495
515
  }
496
- I.value = !0;
497
- const o = H.value.target, e = D();
498
- o.style.transform = `translateX(${e})`, o.transitionOrigin = "center", document.documentElement.style.setProperty("--t-screen-backdrop-duration", "0s"), document.documentElement.style.setProperty("--t-swipe-backdrop-opacity", "0"), setTimeout(() => {
499
- o.style.transition = "transform 0.35s ease", o.style.transform = "translateX(0px)", document.documentElement.style.setProperty("--t-screen-backdrop-duration", "0.35s"), document.documentElement.style.setProperty("--t-swipe-backdrop-opacity", "0.5"), z.value && (z.value.target.style.transitionOrigin = "left center", z.value.target.style.transition = "transform 0.35s ease", z.value.target.style.transform = `translateX(calc(${e} / 100 * 30 * -1))`), setTimeout(() => {
500
- I.value = !1, R.value += 1, t && t();
516
+ B.value = !0;
517
+ const o = H.value.target, t = X();
518
+ o.style.transform = `translateX(${t})`, o.transitionOrigin = "center", document.documentElement.style.setProperty("--toife-screen-backdrop-duration", "0s"), document.documentElement.style.setProperty("--toife-swipe-backdrop-opacity", "0"), setTimeout(() => {
519
+ o.style.transition = "transform 0.25s ease", o.style.transform = "translateX(0px)", document.documentElement.style.setProperty("--toife-screen-backdrop-duration", "0.25s"), document.documentElement.style.setProperty("--toife-swipe-backdrop-opacity", "0.5"), O.value && (O.value.target.style.transitionOrigin = "left center", O.value.target.style.transition = "transform 0.25s ease", O.value.target.style.transform = `translateX(calc(${t} / 100 * 30 * -1))`), setTimeout(() => {
520
+ B.value = !1, R.value += 1, r && r();
501
521
  }, 400);
502
522
  }, 100);
503
523
  }
504
- }, He = (t) => {
505
- X.push(t);
506
- }, Le = (t, o) => {
507
- X[t].target = o;
508
- }, ae = (t) => {
509
- t || X.pop();
510
- }, Fe = () => {
511
- X.splice(0, X.length);
512
- }, Ue = () => {
513
- Y.value = !1;
514
- }, je = () => {
515
- Y.value = !0;
516
- }, Ge = (t, o) => {
517
- t == "scale" && ee.next(o), t == "transform" && te.next(o);
518
- }, Ke = (t, o) => {
519
- t == "scale" && ee.back(o), t == "transform" && te.back(o);
520
- }, Je = (t, o) => {
521
- t == "scale" && ee.move(o), t == "transform" && te.move(o);
522
- }, Qe = (t) => {
523
- t == "scale" && ee.reset(), t == "transform" && te.reset();
524
- }, S = {
525
- isBusy: I,
526
- isSwipeable: ye,
527
- reset: Qe,
528
- next: Ge,
529
- back: Ke,
530
- move: Je,
531
- screens: X,
532
- addScreen: He,
533
- addScreenEl: Le,
534
- removeScreen: ae,
535
- removeAllScreen: Fe,
536
- lockSwipe: Ue,
537
- unlockSwipe: je,
538
- swipeable: Y,
539
- currentScreen: z,
540
- lastScreen: V,
524
+ }, et = (r) => {
525
+ N.push(r);
526
+ }, tt = (r, o) => {
527
+ N[r].target = o;
528
+ }, de = (r) => {
529
+ r || N.pop();
530
+ }, rt = () => {
531
+ N.splice(0, N.length);
532
+ }, ot = () => {
533
+ se.value = !1;
534
+ }, nt = () => {
535
+ se.value = !0;
536
+ }, st = (r, o) => {
537
+ r == "scale" && ae.next(o), r == "transform" && le.next(o);
538
+ }, at = (r, o) => {
539
+ r == "scale" && ae.back(o), r == "transform" && le.back(o);
540
+ }, lt = (r, o) => {
541
+ r == "scale" && ae.move(o), r == "transform" && le.move(o);
542
+ }, ct = (r) => {
543
+ r == "scale" && ae.reset(), r == "transform" && le.reset();
544
+ }, ee = () => ({
545
+ isBusy: B,
546
+ isSwipeable: ke,
547
+ reset: ct,
548
+ next: st,
549
+ back: at,
550
+ move: lt,
551
+ screens: N,
552
+ addScreen: et,
553
+ addScreenEl: tt,
554
+ removeScreen: de,
555
+ removeAllScreen: rt,
556
+ lockSwipe: ot,
557
+ unlockSwipe: nt,
558
+ swipeable: se,
559
+ currentScreen: O,
560
+ lastScreen: E,
541
561
  nextScreen: H
542
- }, Ze = { class: "t-toast-content" }, Ye = /* @__PURE__ */ h({
543
- __name: "t-toast",
544
- props: {
545
- message: {},
546
- space: { default: "0px" },
547
- placement: { default: "bottom" },
548
- color: { default: null },
549
- variant: { default: "default" },
550
- visible: { type: Boolean, default: !1 }
551
- },
552
- emits: ["dismiss"],
553
- setup(t, { expose: o, emit: e }) {
554
- const s = t, r = e, l = m(!1), u = m(!1), n = m(!1), p = () => {
555
- u.value = !0, n.value = !1, setTimeout(() => {
556
- l.value = !0;
557
- }, 10);
558
- }, v = () => {
559
- n.value = !0, setTimeout(() => {
560
- u.value = !1, l.value = !1, r("dismiss");
561
- }, 300);
562
- };
563
- W(() => s.visible, (a) => {
564
- a ? p() : v();
565
- });
566
- const d = x(() => {
567
- let a;
568
- return s.variant == "default" && (s.color ? ["warning", "info", "danger", "primary", "secondary", "success"].includes(s.color) ? a = {
569
- "--border": "none",
570
- "--color": "var(--t-color-status-" + s.color + "-text)",
571
- "--background": "rgba(var(--t-color-status-" + s.color + "-rgb), 1)"
572
- } : a = {
573
- "--border": "none",
574
- "--color": "var(--t-color-text)",
575
- "--background": s.color
576
- } : a = {
577
- "--border": "none",
578
- "--color": "var(--t-color-text)",
579
- "--background": "rgba(var(--t-color-surface-rgb), 1)"
580
- }), s.variant == "text" && (s.color ? ["warning", "info", "danger", "primary", "secondary", "success"].includes(s.color) ? a = {
581
- "--border": "none",
582
- "--color": "var(--t-color-status-" + s.color + ")",
583
- "--background": "transparent"
584
- } : a = {
585
- "--border": "none",
586
- "--color": s.color,
587
- "--background": "transparent"
588
- } : a = {
589
- "--border": "none",
590
- "--color": "var(--t-color-text)",
591
- "--background": "transparent"
592
- }), s.variant == "outline" && (s.color ? ["warning", "info", "danger", "primary", "secondary", "success"].includes(s.color) ? a = {
593
- "--border": "0.55px solid var(--t-color-status-" + s.color + ")",
594
- "--color": "var(--t-color-status-" + s.color + ")",
595
- "--background": "transparent"
596
- } : a = {
597
- "--border": "0.55px solid " + s.color,
598
- "--color": s.color,
599
- "--background": "transparent"
600
- } : a = {
601
- "--border": "0.55px solid var(--t-color-text)",
602
- "--color": "var(--t-color-text)",
603
- "--background": "transparent"
604
- }), a;
605
- });
606
- return o({
607
- open: p,
608
- close: v
609
- }), (a, c) => u.value ? (i(), f("div", {
610
- key: 0,
611
- class: B(["t-toast", { [s.placement]: !0, open: l.value, closing: n.value }]),
612
- style: T({ "--space": s.space, ...d.value })
613
- }, [
614
- _(a.$slots, "content", {}, () => [
615
- $("div", Ze, A(s.message), 1)
616
- ], !0)
617
- ], 6)) : E("", !0);
618
- }
619
- }), _e = /* @__PURE__ */ g(Ye, [["__scopeId", "data-v-bac1506b"]]), ho = (t = {}) => ({
620
- open() {
621
- let o = document.body.querySelector(".t-app");
622
- if (!o) return;
623
- const e = document.createElement("div"), s = m();
624
- o.appendChild(e);
625
- const r = J({
626
- render() {
627
- return Q(_e, {
628
- ...t,
629
- ref: s,
630
- onDismiss: () => {
631
- setTimeout(() => {
632
- r.unmount(), e.remove();
633
- }, 300);
634
- }
635
- });
636
- }
637
- });
638
- r.mount(e), setTimeout(() => {
639
- s.value?.open?.(), setTimeout(() => {
640
- s.value?.close?.();
641
- }, t.duration + 10);
642
- }, 50);
643
- }
644
- }), et = m(0);
645
- function ge() {
646
- return {
647
- height: et
648
- };
649
- }
650
- const tt = /* @__PURE__ */ h({
651
- __name: "t-cable",
652
- props: {
653
- keyboard: { type: Boolean, default: !1 },
654
- placement: { default: "bottom" }
655
- },
656
- setup(t) {
657
- const o = t, { height: e } = ge();
658
- return de("cableState", {
659
- placement: o.placement
660
- }), (s, r) => (i(), f("div", {
661
- class: B(["t-cable", { keyboard: o.keyboard && O(e) > 0, [o.placement]: !0 }]),
662
- style: T({ "--t-keyboard-height": O(e) + "px", "--t-keyboard-transition": O(e) > 0 ? "0.3s" : "0.1s" })
663
- }, [
664
- _(s.$slots, "default", {}, void 0, !0)
665
- ], 6));
666
- }
667
- }), ot = /* @__PURE__ */ g(tt, [["__scopeId", "data-v-27e0d794"]]), st = /* @__PURE__ */ h({
668
- __name: "t-card",
669
- props: {
670
- color: { default: null }
671
- },
672
- setup(t) {
673
- const o = t, e = x(() => {
674
- let s;
675
- return o.color ? ["warning", "info", "danger", "primary", "secondary", "success"].includes(o.color) ? s = {
676
- "--background": "var(--t-color-status-" + o.color + ")"
677
- } : s = {
678
- "--background": o.color
679
- } : s = {
680
- "--background": "var(--t-color-surface)"
681
- }, s;
682
- });
683
- return (s, r) => (i(), f("div", {
684
- class: "t-card",
685
- style: T(e.value)
686
- }, [
687
- _(s.$slots, "default")
688
- ], 4));
689
- }
690
- }), rt = {}, nt = { class: "t-content" };
691
- function at(t, o) {
692
- return i(), f("div", nt, [
693
- _(t.$slots, "default", {}, void 0, !0)
694
- ]);
695
- }
696
- const lt = /* @__PURE__ */ g(rt, [["render", at], ["__scopeId", "data-v-ce0031a0"]]), ct = /* @__PURE__ */ h({
697
- __name: "t-refresher",
698
- props: {
699
- threshold: { default: 120 },
700
- safe: { type: Boolean, default: !1 },
701
- variant: { default: "max" }
702
- },
703
- emits: ["refresh", "move", "cancel", "start"],
704
- setup(t, { emit: o }) {
705
- const e = o, s = t, r = m(0), l = m(!1), u = m();
706
- let n, p = !1;
707
- const v = () => {
708
- l.value = !1, r.value = 0, p = !1;
709
- }, d = () => {
710
- p = !0, l.value = !0, r.value = s.threshold, e("refresh", v);
711
- }, a = () => {
712
- r.value = 0, l.value = !1, p = !1, e("cancel");
713
- };
714
- return W(() => u.value, () => {
715
- n && n.destroy();
716
- let c = u.value.closest(".t-content");
717
- c && (n = re(c, {
718
- options: {
719
- minMove: 20
720
- },
721
- beforeEvent() {
722
- return !(c.scrollTop > 0);
723
- },
724
- down() {
725
- l.value || p || e("start");
726
- },
727
- move({ deltaY: y, initialDirection: w }) {
728
- if (l.value || p || w != "down") return;
729
- if (s.variant == "max" && y >= s.threshold) {
730
- d();
731
- return;
732
- }
733
- const b = y < 0 ? 0 : y;
734
- r.value = b, e("move", b);
735
- },
736
- up({ deltaY: y, initialDirection: w }) {
737
- l.value || p || w != "down" || (s.variant == "up" && y >= s.threshold ? d() : a());
738
- },
739
- cancel() {
740
- l.value || p || a();
741
- }
742
- }, {
743
- passive: !1
744
- }));
745
- }), se(() => {
746
- n && n.destroy();
747
- }), (c, y) => j((i(), f("div", {
748
- class: B(["t-refresher", { safe: c.safe }]),
749
- ref_key: "container",
750
- ref: u
751
- }, [
752
- _(c.$slots, "default", {
753
- offset: r.value,
754
- refreshing: l.value
755
- }, void 0, !0)
756
- ], 2)), [
757
- [G, r.value > 0]
758
- ]);
759
- }
760
- }), it = /* @__PURE__ */ g(ct, [["__scopeId", "data-v-c77146a5"]]), ut = {}, dt = { class: "t-screen" };
761
- function pt(t, o) {
762
- return i(), f("div", dt, [
763
- _(t.$slots, "default", {}, void 0, !0)
764
- ]);
765
- }
766
- const be = /* @__PURE__ */ g(ut, [["render", pt], ["__scopeId", "data-v-c2a3436c"]]), ft = /* @__PURE__ */ h({
767
- __name: "t-screen-router",
562
+ }), it = /* @__PURE__ */ k({
563
+ __name: "screen-router",
768
564
  props: {
769
565
  variant: { default: "scale" },
770
566
  router: {},
771
567
  route: {}
772
568
  },
773
569
  emits: ["change"],
774
- setup(t, { emit: o }) {
570
+ setup(r, { expose: o, emit: t }) {
571
+ o();
775
572
  let e = {};
776
- const s = o, r = t;
573
+ const s = t, n = r;
777
574
  let l;
778
- const u = r.router || fe(), n = r.route || Te(), p = u.getRoutes(), v = m();
779
- for (let c of p)
780
- e[c.name] = c.component || c.components;
781
- const d = (c) => {
782
- c && S.addScreen({
783
- name: c,
575
+ const a = n.router || Y(), c = n.route || me(), d = a.getRoutes(), _ = ee(), g = u();
576
+ for (let f of d)
577
+ e[f.name] = f.component || f.components;
578
+ const v = (f) => {
579
+ f && _.addScreen({
580
+ name: f,
784
581
  target: null,
785
- component: $e(e[c] || null)
582
+ component: pe(e[f] || null)
786
583
  });
787
- }, a = (c, y) => {
788
- !y || S.screens[c].target || (S.addScreenEl(c, y.$el), S.nextScreen && S.next(r.variant, () => {
584
+ }, m = (f, I) => {
585
+ !I || _.screens[f].target || (_.addScreenEl(f, I.$el), _.nextScreen && _.next(n.variant, () => {
789
586
  s("change");
790
587
  }));
791
588
  };
792
- return W(() => n.name, (c, y) => {
793
- c != S.currentScreen.value?.name && (S.lastScreen.value?.name == c ? S.back(r.variant, () => {
589
+ z(() => c.name, (f, I) => {
590
+ f != _.currentScreen.value?.name && (_.lastScreen.value?.name == f ? _.back(n.variant, () => {
794
591
  s("change");
795
- }) : d(n.name));
796
- }), L(() => {
797
- d(n.name), l = re(document.body, {
798
- beforeEvent(c) {
799
- return !!S.isSwipeable.value;
592
+ }) : v(c.name));
593
+ }), A(() => {
594
+ v(c.name), l = L(document.body, {
595
+ beforeEvent(f) {
596
+ return !!_.isSwipeable.value;
800
597
  },
801
- fast({ initialDirection: c }) {
802
- S.lastScreen.value && c == "right" && u.back();
598
+ fast({ initialDirection: f }) {
599
+ _.lastScreen.value && f == "right" && a.back();
803
600
  },
804
- move({ deltaX: c, initialDirection: y }) {
805
- y == "right" && S.move(r.variant, c);
601
+ move({ deltaX: f, initialDirection: I }) {
602
+ I == "right" && _.move(n.variant, f);
806
603
  },
807
- up({ deltaX: c, initialDirection: y }) {
808
- if (y != "right") {
809
- S.reset(r.variant);
604
+ up({ deltaX: f, initialDirection: I }) {
605
+ if (I != "right") {
606
+ _.reset(n.variant);
810
607
  return;
811
608
  }
812
- const w = v.value.offsetParent.offsetWidth;
813
- c / w * 100 >= 50 ? u.back() : S.reset(r.variant);
609
+ const P = g.value.offsetParent.offsetWidth;
610
+ f / P * 100 >= 50 ? a.back() : _.reset(n.variant);
814
611
  },
815
612
  cancel() {
816
- S.reset(r.variant);
613
+ _.reset(n.variant);
817
614
  }
818
615
  });
819
- }), se(() => {
820
- l && l.destroy(), S.removeAllScreen();
821
- }), (c, y) => (i(), f(q, null, [
822
- (i(!0), f(q, null, K(O(S).screens, (w, b) => (i(), C(be, {
823
- ref_for: !0,
824
- ref: (P) => a(b, P),
825
- style: T({ zIndex: b + (b == O(S).screens.length - 1 ? 2 : 1) }),
826
- key: b
827
- }, {
828
- default: N(() => [
829
- (i(), C(ke(w.component.default)))
830
- ]),
831
- _: 2
832
- }, 1032, ["style"]))), 128)),
833
- $("div", {
834
- class: "t-screen-router-backdrop",
835
- ref_key: "backdrop",
836
- ref: v,
837
- style: T({ zIndex: O(S).screens.length })
838
- }, null, 4)
839
- ], 64));
840
- }
841
- }), mt = /* @__PURE__ */ g(ft, [["__scopeId", "data-v-2d6fbfe1"]]), vt = /* @__PURE__ */ h({
842
- __name: "t-toolbar",
843
- props: {
844
- placement: { default: null },
845
- safe: { type: Boolean, default: !0 },
846
- size: { default: "50px" }
847
- },
848
- setup(t) {
849
- const o = t, e = pe("cableState"), s = x(() => o?.placement || e?.placement);
850
- return (r, l) => (i(), f("div", {
851
- class: B(["t-toolbar", { [s.value]: !0, safe: o.safe }]),
852
- style: T({ "--t-size-toolbar": o.size })
853
- }, [
854
- $("div", null, [
855
- _(r.$slots, "default", {}, void 0, !0)
856
- ])
857
- ], 6));
616
+ }), M(() => {
617
+ l && l.destroy(), _.removeAllScreen();
618
+ });
619
+ const h = { get routeComponents() {
620
+ return e;
621
+ }, set routeComponents(f) {
622
+ e = f;
623
+ }, emit: s, props: n, get ges() {
624
+ return l;
625
+ }, set ges(f) {
626
+ l = f;
627
+ }, _router: a, _route: c, routes: d, screenRouter: _, backdrop: g, addScreen: v, addScreenRef: m, markRaw: pe, onMounted: A, onUnmounted: M, ref: u, watch: z, get useRoute() {
628
+ return me;
629
+ }, get useRouter() {
630
+ return Y;
631
+ }, get gesture() {
632
+ return L;
633
+ }, get Screen() {
634
+ return he;
635
+ }, get useScreenRouter() {
636
+ return ee;
637
+ } };
638
+ return Object.defineProperty(h, "__isScriptSetup", { enumerable: !1, value: !0 }), h;
858
639
  }
859
- }), yt = /* @__PURE__ */ g(vt, [["__scopeId", "data-v-1ee9866d"]]), _t = /* @__PURE__ */ h({
860
- __name: "t-back-button",
640
+ });
641
+ function ut(r, o, t, e, s, n) {
642
+ return i(), y(q, null, [
643
+ (i(!0), y(q, null, J(e.screenRouter.screens, (l, a) => (i(), j(e.Screen, {
644
+ ref_for: !0,
645
+ ref: (c) => e.addScreenRef(a, c),
646
+ style: w({ zIndex: a + (a == e.screenRouter.screens.length - 1 ? 2 : 1) }),
647
+ key: a
648
+ }, {
649
+ default: D(() => [
650
+ (i(), j(Ie(l.component.default)))
651
+ ]),
652
+ _: 2
653
+ }, 1032, ["style"]))), 128)),
654
+ S("div", {
655
+ class: p({ "toife-screen-router-backdrop": !0 }),
656
+ ref: "backdrop",
657
+ style: w({ zIndex: e.screenRouter.screens.length })
658
+ }, null, 4)
659
+ ], 64);
660
+ }
661
+ const dt = /* @__PURE__ */ x(it, [["render", ut], ["__scopeId", "data-v-c7ff05f0"]]), pt = /* @__PURE__ */ k({
662
+ __name: "back-button",
861
663
  props: {
862
664
  to: {},
863
665
  router: {}
864
666
  },
865
- setup(t) {
866
- const o = t, e = xe(), s = o.router || fe(), r = (l) => {
667
+ setup(r, { expose: o }) {
668
+ o();
669
+ const t = r, e = fe(), s = t.router || Y(), n = ee(), a = { props: t, attrs: e, router: s, screenRouter: n, onClick: (c) => {
867
670
  if (e.onBack) {
868
- e.onBack(l);
671
+ e.onBack(c);
869
672
  return;
870
673
  }
871
- S.lastScreen.value ? s?.back?.() : o.to && s?.push?.(o.to);
872
- };
873
- return (l, u) => l.to || O(S).lastScreen ? (i(), f("button", {
874
- key: 0,
875
- class: "t-back-button",
876
- onPointerup: r
877
- }, [
878
- _(l.$slots, "default", {}, () => [
879
- u[0] || (u[0] = $("i", { class: "ri-arrow-left-s-line" }, null, -1))
880
- ], !0)
881
- ], 32)) : E("", !0);
674
+ n.lastScreen.value ? s?.back?.() : t.to && s?.push?.(t.to);
675
+ }, useAttrs: fe, get useRouter() {
676
+ return Y;
677
+ }, get useScreenRouter() {
678
+ return ee;
679
+ } };
680
+ return Object.defineProperty(a, "__isScriptSetup", { enumerable: !1, value: !0 }), a;
882
681
  }
883
- }), gt = /* @__PURE__ */ g(_t, [["__scopeId", "data-v-eb92b1fe"]]), bt = /* @__PURE__ */ h({
884
- __name: "t-text",
885
- props: {
886
- color: { default: "var(--t-color-text)" },
887
- size: { default: "standard" }
888
- },
889
- setup(t) {
890
- const o = t, e = x(() => {
891
- let s, r = o.color;
892
- return o.size == "standard" ? s = "var(--t-fs-10)" : o.size == "small" ? s = "var(--t-fs-08)" : o.size == "large" ? s = "var(--t-fs-12)" : s = o.size, ["warning", "info", "danger", "primary", "secondary", "success"].includes(o.color) && (r = `var(--t-color-status-${o.color})`), {
893
- "--color": r,
894
- "--font-size": s
895
- };
896
- });
897
- return (s, r) => (i(), f("span", {
898
- class: "t-text",
899
- style: T(e.value)
900
- }, [
901
- _(s.$slots, "default", {}, void 0, !0)
902
- ], 4));
682
+ });
683
+ function ft(r, o, t, e, s, n) {
684
+ return t.to || e.screenRouter.lastScreen ? (i(), y("button", {
685
+ key: 0,
686
+ class: p({ "toife-back-button": !0 }),
687
+ onPointerup: e.onClick
688
+ }, [
689
+ $(r.$slots, "default", {}, () => [
690
+ o[0] || (o[0] = S("i", { class: "ri-arrow-left-s-line" }, null, -1))
691
+ ], !0)
692
+ ], 32)) : C("", !0);
693
+ }
694
+ const mt = /* @__PURE__ */ x(pt, [["render", ft], ["__scopeId", "data-v-acb94acb"]]), _t = u(0);
695
+ function te() {
696
+ return {
697
+ height: _t
698
+ };
699
+ }
700
+ const vt = /* @__PURE__ */ k({
701
+ __name: "keyboard-space",
702
+ setup(r, { expose: o }) {
703
+ o();
704
+ const { height: t } = te(), e = { height: t, get useKeyboard() {
705
+ return te;
706
+ } };
707
+ return Object.defineProperty(e, "__isScriptSetup", { enumerable: !1, value: !0 }), e;
903
708
  }
904
- }), oe = /* @__PURE__ */ g(bt, [["__scopeId", "data-v-f0f94f05"]]), ht = /* @__PURE__ */ h({
905
- __name: "t-gesture-indicator",
709
+ });
710
+ function yt(r, o, t, e, s, n) {
711
+ return i(), y("div", {
712
+ class: p({ "toife-keyboard-space": !0 }),
713
+ style: w({ "--height": e.height + "px" })
714
+ }, null, 4);
715
+ }
716
+ const bt = /* @__PURE__ */ x(vt, [["render", yt], ["__scopeId", "data-v-ae883ffe"]]), gt = /* @__PURE__ */ k({
717
+ __name: "cable",
906
718
  props: {
719
+ keyboard: { type: Boolean, default: !1 },
907
720
  placement: { default: "bottom" }
908
721
  },
909
- setup(t) {
910
- return (o, e) => (i(), f("div", {
911
- class: B(["t-gesture-indicator", { [o.placement]: !0 }])
912
- }, null, 2));
722
+ setup(r, { expose: o }) {
723
+ o();
724
+ const t = r, { height: e } = te();
725
+ Q("cableState", {
726
+ placement: t.placement
727
+ });
728
+ const s = { props: t, height: e, provide: Q, get useKeyboard() {
729
+ return te;
730
+ } };
731
+ return Object.defineProperty(s, "__isScriptSetup", { enumerable: !1, value: !0 }), s;
913
732
  }
914
- }), he = /* @__PURE__ */ g(ht, [["__scopeId", "data-v-ed8f7308"]]), kt = /* @__PURE__ */ h({
915
- __name: "t-sheet",
733
+ });
734
+ function ht(r, o, t, e, s, n) {
735
+ return i(), y("div", {
736
+ class: p({ "toife-cable": !0, keyboard: e.props.keyboard && e.height > 0, [e.props.placement]: !0 }),
737
+ style: w({ "--toife-keyboard-height": e.height + "px", "--toife-keyboard-transition": e.height > 0 ? "0.3s" : "0.1s" })
738
+ }, [
739
+ $(r.$slots, "default", {}, void 0, !0)
740
+ ], 6);
741
+ }
742
+ const kt = /* @__PURE__ */ x(gt, [["render", ht], ["__scopeId", "data-v-2c9cb2cf"]]), xt = /* @__PURE__ */ k({
743
+ __name: "card",
916
744
  props: {
917
- background: { default: "var(--t-color-surface)" },
918
- class: {},
919
- visible: { type: Boolean, default: !1 },
920
- gesture: { type: Boolean, default: !0 },
921
- fullscreen: { type: Boolean, default: !1 },
922
- placement: { default: "bottom" },
923
- keepalive: { type: Boolean, default: !0 },
924
- backdrop: { type: Boolean, default: !0 },
925
- rounded: { type: Boolean, default: !1 },
926
- indicator: { type: Boolean, default: !0 },
927
- duration: { default: 200 },
928
- bounce: {},
929
- style: {}
745
+ color: { default: null }
930
746
  },
931
- emits: ["dismiss"],
932
- setup(t, { emit: o }) {
933
- const e = t, s = o, r = m(), l = m(), u = m(!1);
934
- let n = null;
935
- const p = x(() => {
936
- if (e.placement == "bottom") return "down";
937
- if (e.placement == "top") return "up";
938
- if (e.placement == "left") return "left";
939
- if (e.placement == "right") return "right";
940
- }), v = (a) => {
941
- s("dismiss", a);
942
- }, d = () => {
943
- u.value = !0, setTimeout(() => {
944
- u.value = !1;
945
- }, 300);
946
- };
947
- return W(() => r.value, (a) => {
948
- a && (n = re(r.value, {
949
- isMoving: !1,
950
- options: {
951
- minDist: 30
952
- },
953
- beforeEvent(c) {
954
- return !(u.value || !e.gesture || e.placement == "center");
955
- },
956
- down() {
957
- this.isMoving = !1;
958
- },
959
- fast({ initialDirection: c }) {
960
- d(), c == p.value ? s("dismiss", "gesture") : l.value.open();
961
- },
962
- move({ deltaY: c, deltaX: y, initialDirection: w }) {
963
- if (w != p.value) return;
964
- let b = 0;
965
- e.placement == "bottom" || e.placement == "top" ? b = c : b = y, e.placement == "bottom" && (b = c > 0 ? c : 0), e.placement == "top" && (b = c < 0 ? c : 0), e.placement == "left" && (b = y < 0 ? y : 0), e.placement == "right" && (b = y > 0 ? y : 0), (e.placement == "bottom" && (b >= 10 || this.isMoving) || e.placement == "top" && (b <= -10 || this.isMoving) || e.placement == "left" && (b <= -10 || this.isMoving) || e.placement == "right" && (b >= 10 || this.isMoving)) && (this.isMoving = !0, l.value.render({
966
- contentTransform: b + "px",
967
- transition: "0s"
968
- }));
969
- },
970
- up({ deltaY: c, deltaX: y, initialDirection: w }) {
971
- if (this.isMoving = !1, d(), w != p.value) {
972
- l.value.open();
973
- return;
974
- }
975
- let b, P, k;
976
- e.placement == "bottom" || e.placement == "top" ? (b = r.value.offsetHeight, k = c) : (b = r.value.offsetWidth, k = y), P = k / b * 100, P > 50 ? s("dismiss", "gesture") : l.value.open();
977
- },
978
- cancel() {
979
- this.isMoving = !1, d(), l.value.open();
980
- }
981
- }));
982
- }), se(() => {
983
- n && n.destroy();
984
- }), (a, c) => (i(), C(F, {
985
- ref_key: "present",
986
- ref: l,
987
- duration: e.duration,
988
- bounce: e.bounce,
989
- class: B(e.class),
990
- placement: e.placement,
991
- backdrop: a.backdrop,
992
- visible: e.visible,
993
- keepalive: e.keepalive,
994
- onDismiss: v,
995
- style: T(e.style)
996
- }, {
997
- default: N(() => [
998
- e.gesture && e.indicator && e.placement != "center" ? (i(), C(he, {
999
- key: 0,
1000
- placement: e.placement
1001
- }, null, 8, ["placement"])) : E("", !0),
1002
- $("div", {
1003
- class: B(["t-sheet", { fullscreen: e.fullscreen, [e.placement]: !0, rounded: a.rounded }]),
1004
- style: T({ "--background": e.background }),
1005
- ref_key: "sheet",
1006
- ref: r
1007
- }, [
1008
- _(a.$slots, "default", {}, void 0, !0)
1009
- ], 6)
1010
- ]),
1011
- _: 3
1012
- }, 8, ["duration", "bounce", "class", "placement", "backdrop", "visible", "keepalive", "style"]));
747
+ setup(r, { expose: o }) {
748
+ o();
749
+ const t = r, e = b(() => {
750
+ let n;
751
+ return t.color ? ["warning", "info", "danger", "primary", "secondary", "success"].includes(t.color) ? n = {
752
+ "--background": "var(--toife-color-status-" + t.color + ")"
753
+ } : n = {
754
+ "--background": t.color
755
+ } : n = {
756
+ "--background": "var(--toife-color-surface)"
757
+ }, n;
758
+ }), s = { props: t, styles: e, computed: b };
759
+ return Object.defineProperty(s, "__isScriptSetup", { enumerable: !1, value: !0 }), s;
1013
760
  }
1014
- }), $t = /* @__PURE__ */ g(kt, [["__scopeId", "data-v-dcfbb6a3"]]), xt = { class: "t-input-label" }, Tt = { class: "t-input-content" }, wt = ["placeholder", "value", "type", "readonly"], St = /* @__PURE__ */ h({
1015
- __name: "t-input",
761
+ });
762
+ function $t(r, o, t, e, s, n) {
763
+ return i(), y("div", {
764
+ class: p({ "toife-card": !0 }),
765
+ style: w(e.styles)
766
+ }, [
767
+ $(r.$slots, "default")
768
+ ], 4);
769
+ }
770
+ const St = /* @__PURE__ */ x(xt, [["render", $t]]), wt = /* @__PURE__ */ k({
771
+ __name: "checkbox",
1016
772
  props: {
1017
- size: { default: "standard" },
1018
- rounded: { type: Boolean, default: !1 },
1019
773
  label: { default: "" },
1020
- placeholder: { default: "" },
1021
- type: { default: "text" },
1022
- help: {},
1023
- error: {},
1024
- modelValue: { default: "" },
1025
- variant: { default: "default" },
1026
- readonly: { type: Boolean, default: !1 }
774
+ modelValue: { default: !1 },
775
+ variant: {},
776
+ type: { default: "check" },
777
+ multiple: { type: Boolean, default: !1 },
778
+ value: { default: void 0 },
779
+ color: { default: "primary" }
1027
780
  },
1028
781
  emits: ["update:modelValue"],
1029
- setup(t, { emit: o }) {
1030
- const e = t, s = o, r = m(!1), l = m(null), u = x(
1031
- () => !(e.modelValue === "" || e.modelValue == null)
1032
- ), n = (d) => {
1033
- s("update:modelValue", d.target.value);
1034
- }, p = async (d) => {
1035
- r.value = !0;
1036
- }, v = () => {
1037
- r.value = !1;
782
+ setup(r, { expose: o, emit: t }) {
783
+ o();
784
+ const e = r, s = t, n = b(() => {
785
+ let d = {
786
+ "--background": e.color,
787
+ "--color": "#ffffff"
788
+ };
789
+ return ["warning", "info", "danger", "primary", "secondary", "success"].includes(e.color) && (d = {
790
+ "--background": `var(--toife-color-status-${e.color})`,
791
+ "--color": `var(--toife-color-status-${e.color}-text)`
792
+ }), d;
793
+ }), l = b(() => e.multiple ? e.modelValue.includes(e.value) : e.value === void 0 ? e.modelValue : e.modelValue == e.value), c = { props: e, emit: s, styles: n, isActive: l, onToggle: (d) => {
794
+ if (d.preventDefault(), d.stopPropagation(), e.multiple) {
795
+ let _ = e.modelValue;
796
+ e.modelValue.includes(e.value) ? _.splice(_.indexOf(e.value), 1) : _.push(e.value), s("update:modelValue", _);
797
+ } else e.value === void 0 ? s("update:modelValue", !e.modelValue) : s("update:modelValue", e.value);
798
+ }, computed: b };
799
+ return Object.defineProperty(c, "__isScriptSetup", { enumerable: !1, value: !0 }), c;
800
+ }
801
+ }), Pt = { key: 0 }, Tt = {
802
+ key: 0,
803
+ class: /* @__PURE__ */ p({ "toife-checkbox-label": !0 })
804
+ };
805
+ function It(r, o, t, e, s, n) {
806
+ return i(), y("div", {
807
+ class: p({ "toife-checkbox": !0, active: e.isActive }),
808
+ style: w(e.styles),
809
+ onPointerup: e.onToggle
810
+ }, [
811
+ S("div", {
812
+ class: p({ [`toife-checkbox-${t.type}`]: !0 })
813
+ }, [
814
+ t.type == "radio" ? (i(), y("div", Pt)) : C("", !0),
815
+ t.type == "check" ? $(r.$slots, "icon", { key: 1 }, () => [
816
+ o[0] || (o[0] = S("i", { class: "ri-check-line" }, null, -1))
817
+ ], !0) : C("", !0)
818
+ ], 2),
819
+ $(r.$slots, "label", {}, () => [
820
+ t.label ? (i(), y("span", Tt, V(e.props.label), 1)) : C("", !0)
821
+ ], !0)
822
+ ], 38);
823
+ }
824
+ const Ot = /* @__PURE__ */ x(wt, [["render", It], ["__scopeId", "data-v-6f47434a"]]), Bt = /* @__PURE__ */ k({
825
+ __name: "collapse",
826
+ props: {
827
+ title: {}
828
+ },
829
+ emits: ["change"],
830
+ setup(r, { expose: o, emit: t }) {
831
+ o();
832
+ const e = r, s = t, n = u(!1), l = u(""), a = u(), c = () => {
833
+ n.value = !n.value, l.value = `calc(${a.value.offsetHeight}px + 2rem)`, s("change", n.value);
1038
834
  };
1039
- return (d, a) => (i(), f("div", {
1040
- class: B(["t-input", {
1041
- rounded: d.rounded,
1042
- ["size-" + d.size]: !0,
1043
- ["variant-" + d.variant]: !0,
1044
- focus: r.value,
1045
- "has-value": u.value,
1046
- readonly: d.readonly
1047
- }])
835
+ s("change", n.value);
836
+ const d = { props: e, emit: s, isOpen: n, height: l, content: a, onToggle: c, ref: u };
837
+ return Object.defineProperty(d, "__isScriptSetup", { enumerable: !1, value: !0 }), d;
838
+ }
839
+ }), Ct = {
840
+ class: /* @__PURE__ */ p({ "toife-collapse-title": !0 })
841
+ }, zt = {
842
+ key: 0,
843
+ class: "icon"
844
+ }, Et = {
845
+ key: 1,
846
+ class: "icon"
847
+ }, jt = {
848
+ class: /* @__PURE__ */ p({ "toife-collapse-content": !0 })
849
+ }, Rt = { ref: "content" };
850
+ function Vt(r, o, t, e, s, n) {
851
+ return i(), y("div", {
852
+ class: p({ "toife-collapse": !0, open: e.isOpen }),
853
+ style: w({ "--height": e.height })
854
+ }, [
855
+ S("div", {
856
+ class: p({ "toife-collapse-header": !0 }),
857
+ onPointerup: e.onToggle
1048
858
  }, [
1049
- $("label", null, [
1050
- $("span", xt, A(d.label), 1),
1051
- $("div", Tt, [
1052
- _(d.$slots, "start", {}, void 0, !0),
1053
- $("input", {
1054
- ref_key: "editable",
1055
- ref: l,
1056
- class: "t-input-editable",
1057
- placeholder: d.placeholder,
1058
- value: d.modelValue,
1059
- type: d.type,
1060
- onInput: n,
1061
- onFocus: p,
1062
- onBlur: v,
1063
- readonly: d.readonly
1064
- }, null, 40, wt),
1065
- _(d.$slots, "end", {}, void 0, !0)
859
+ $(r.$slots, "icon"),
860
+ S("div", Ct, [
861
+ $(r.$slots, "title", {}, () => [
862
+ F(V(e.props.title), 1)
1066
863
  ])
1067
864
  ]),
1068
- d.error ? (i(), C(oe, {
1069
- key: 0,
1070
- color: "danger"
1071
- }, {
1072
- default: N(() => [
1073
- M(A(d.error), 1)
1074
- ]),
1075
- _: 1
1076
- })) : d.help ? (i(), C(oe, {
1077
- key: 1,
1078
- color: "secondary"
1079
- }, {
1080
- default: N(() => [
1081
- M(A(d.help), 1)
1082
- ]),
1083
- _: 1
1084
- })) : E("", !0)
1085
- ], 2));
865
+ $(r.$slots, "toggle", {}, () => [
866
+ e.isOpen ? (i(), y("div", zt, [...o[0] || (o[0] = [
867
+ S("i", { class: "ri-arrow-up-s-line" }, null, -1)
868
+ ])])) : (i(), y("div", Et, [...o[1] || (o[1] = [
869
+ S("i", { class: "ri-arrow-down-s-line" }, null, -1)
870
+ ])]))
871
+ ])
872
+ ], 32),
873
+ S("div", jt, [
874
+ S("div", Rt, [
875
+ $(r.$slots, "content", {}, () => [
876
+ $(r.$slots, "default")
877
+ ])
878
+ ], 512)
879
+ ])
880
+ ], 6);
881
+ }
882
+ const At = /* @__PURE__ */ x(Bt, [["render", Vt]]), Dt = /* @__PURE__ */ k({
883
+ __name: "content",
884
+ setup(r, { expose: o }) {
885
+ o();
886
+ const t = {};
887
+ return Object.defineProperty(t, "__isScriptSetup", { enumerable: !1, value: !0 }), t;
888
+ }
889
+ }), Nt = {
890
+ class: /* @__PURE__ */ p({ "toife-content": !0 })
891
+ };
892
+ function Xt(r, o, t, e, s, n) {
893
+ return i(), y("div", Nt, [
894
+ $(r.$slots, "default", {}, void 0, !0)
895
+ ]);
896
+ }
897
+ const Wt = /* @__PURE__ */ x(Dt, [["render", Xt], ["__scopeId", "data-v-90d3a187"]]), qt = /* @__PURE__ */ k({
898
+ __name: "divider",
899
+ props: {
900
+ direction: { default: "horizontal" }
901
+ },
902
+ setup(r, { expose: o }) {
903
+ o();
904
+ const e = { props: r };
905
+ return Object.defineProperty(e, "__isScriptSetup", { enumerable: !1, value: !0 }), e;
1086
906
  }
1087
- }), Bt = /* @__PURE__ */ g(St, [["__scopeId", "data-v-11ddaa71"]]), zt = {};
1088
- function It(t, o) {
1089
- return i(), f("textarea");
907
+ });
908
+ function Mt(r, o, t, e, s, n) {
909
+ return i(), y("div", {
910
+ class: p({ "toife-divider": !0, [e.props.direction]: !0 })
911
+ }, null, 2);
912
+ }
913
+ const Lt = /* @__PURE__ */ x(qt, [["render", Mt], ["__scopeId", "data-v-1fcdf04e"]]), Ft = /* @__PURE__ */ k({
914
+ __name: "flex",
915
+ props: {
916
+ gap: { default: 0 },
917
+ direction: { default: "row" }
918
+ },
919
+ setup(r, { expose: o }) {
920
+ o();
921
+ const t = r, e = b(() => isNaN(t.gap) ? t.gap : `var(--toife-size-${t.gap})`), s = { props: t, _gap: e, computed: b };
922
+ return Object.defineProperty(s, "__isScriptSetup", { enumerable: !1, value: !0 }), s;
923
+ }
924
+ });
925
+ function Ht(r, o, t, e, s, n) {
926
+ return i(), y("div", {
927
+ class: p({ "toife-flex": !0 }),
928
+ style: w({ "--gap": e._gap, "--direction": e.props.direction })
929
+ }, [
930
+ $(r.$slots, "default", {}, void 0, !0)
931
+ ], 4);
1090
932
  }
1091
- const Et = /* @__PURE__ */ g(zt, [["render", It]]), Pt = {};
1092
- function Vt(t, o) {
1093
- return i(), f("div");
933
+ const Kt = /* @__PURE__ */ x(Ft, [["render", Ht], ["__scopeId", "data-v-d6021f57"]]), Gt = /* @__PURE__ */ k({
934
+ __name: "gesture-indicator",
935
+ props: {
936
+ placement: { default: "bottom" }
937
+ },
938
+ setup(r, { expose: o }) {
939
+ o();
940
+ const e = { props: r };
941
+ return Object.defineProperty(e, "__isScriptSetup", { enumerable: !1, value: !0 }), e;
942
+ }
943
+ });
944
+ function Ut(r, o, t, e, s, n) {
945
+ return i(), y("div", {
946
+ class: p({ "toife-gesture-indicator": !0, [t.placement]: !0 })
947
+ }, null, 2);
1094
948
  }
1095
- const Ct = /* @__PURE__ */ g(Pt, [["render", Vt]]), Rt = /* @__PURE__ */ h({
1096
- __name: "t-grid",
949
+ const xe = /* @__PURE__ */ x(Gt, [["render", Ut], ["__scopeId", "data-v-65133446"]]), Jt = /* @__PURE__ */ k({
950
+ __name: "grid",
1097
951
  props: {
1098
952
  gap: { default: 0 },
1099
953
  template: { default: "repeat(1, 1fr) / repeat(1, 1fr)" }
1100
954
  },
1101
- setup(t) {
1102
- const o = t, e = x(() => isNaN(o.gap) ? o.gap : `var(--t-size-${o.gap})`);
1103
- return (s, r) => (i(), f("div", {
1104
- class: "t-grid",
1105
- style: T({ "--gap": e.value, "--template": o.template })
1106
- }, [
1107
- _(s.$slots, "default", {}, void 0, !0)
1108
- ], 4));
955
+ setup(r, { expose: o }) {
956
+ o();
957
+ const t = r, e = b(() => isNaN(t.gap) ? t.gap : `var(--toife-size-${t.gap})`), s = { props: t, _gap: e, computed: b };
958
+ return Object.defineProperty(s, "__isScriptSetup", { enumerable: !1, value: !0 }), s;
1109
959
  }
1110
- }), At = /* @__PURE__ */ g(Rt, [["__scopeId", "data-v-eeba6473"]]), Ot = /* @__PURE__ */ h({
1111
- __name: "t-divider",
960
+ });
961
+ function Qt(r, o, t, e, s, n) {
962
+ return i(), y("div", {
963
+ class: p({ "toife-grid": !0 }),
964
+ style: w({ "--gap": e._gap, "--template": e.props.template })
965
+ }, [
966
+ $(r.$slots, "default", {}, void 0, !0)
967
+ ], 4);
968
+ }
969
+ const Zt = /* @__PURE__ */ x(Jt, [["render", Qt], ["__scopeId", "data-v-797f9e41"]]), Yt = /* @__PURE__ */ k({
970
+ __name: "image",
1112
971
  props: {
1113
- direction: { default: "horizontal" }
972
+ defaultSrc: {},
973
+ src: {}
1114
974
  },
1115
- setup(t) {
1116
- const o = t;
1117
- return (e, s) => (i(), f("div", {
1118
- class: B(["t-divider", { [o.direction]: !0 }])
1119
- }, null, 2));
975
+ setup(r, { expose: o }) {
976
+ o();
977
+ const t = u(""), e = () => {
978
+ r.defaultSrc && (t.value = r.defaultSrc);
979
+ };
980
+ A(() => {
981
+ t.value = r.src;
982
+ });
983
+ const s = { _src: t, handleError: e, onMounted: A, ref: u };
984
+ return Object.defineProperty(s, "__isScriptSetup", { enumerable: !1, value: !0 }), s;
1120
985
  }
1121
- }), Nt = /* @__PURE__ */ g(Ot, [["__scopeId", "data-v-47ee8991"]]), Xt = /* @__PURE__ */ h({
1122
- __name: "t-toggle-password",
986
+ }), er = ["src"];
987
+ function tr(r, o, t, e, s, n) {
988
+ return i(), y("img", {
989
+ onError: e.handleError,
990
+ src: e._src
991
+ }, null, 40, er);
992
+ }
993
+ const rr = /* @__PURE__ */ x(Yt, [["render", tr], ["__scopeId", "data-v-0eed0f1f"]]), or = /* @__PURE__ */ k({
994
+ __name: "text",
1123
995
  props: {
1124
- color: { default: "warning" }
996
+ color: { default: "var(--toife-color-text)" },
997
+ size: { default: "standard" }
1125
998
  },
1126
- emits: ["change"],
1127
- setup(t, { emit: o }) {
1128
- const e = t, s = o, r = m(!1), l = m(), u = x(() => {
1129
- let v = e.color;
1130
- return ["warning", "info", "danger", "primary", "secondary", "success"].includes(e.color) && (v = `var(--t-color-status-${e.color})`), {
1131
- "--color": v
999
+ setup(r, { expose: o }) {
1000
+ o();
1001
+ const t = r, e = b(() => {
1002
+ let n, l = t.color;
1003
+ return t.size == "standard" ? n = "var(--toife-fs-10)" : t.size == "small" ? n = "var(--toife-fs-08)" : t.size == "large" ? n = "var(--toife-fs-12)" : n = t.size, ["warning", "info", "danger", "primary", "secondary", "success"].includes(t.color) && (l = `var(--toife-color-status-${t.color})`), {
1004
+ "--color": l,
1005
+ "--font-size": n
1132
1006
  };
1133
- }), n = () => l.value?.parentElement?.querySelector?.("input");
1134
- L(() => {
1135
- let v = n();
1136
- v && (r.value = v.type != "password", s("change", r.value));
1007
+ }), s = { props: t, styles: e, computed: b };
1008
+ return Object.defineProperty(s, "__isScriptSetup", { enumerable: !1, value: !0 }), s;
1009
+ }
1010
+ });
1011
+ function nr(r, o, t, e, s, n) {
1012
+ return i(), y("span", {
1013
+ class: p({ "toife-text": !0 }),
1014
+ style: w(e.styles)
1015
+ }, [
1016
+ $(r.$slots, "default", {}, void 0, !0)
1017
+ ], 4);
1018
+ }
1019
+ const $e = /* @__PURE__ */ x(or, [["render", nr], ["__scopeId", "data-v-116b375f"]]), sr = /* @__PURE__ */ k({
1020
+ __name: "input",
1021
+ props: {
1022
+ size: { default: "standard" },
1023
+ rounded: { type: Boolean, default: !1 },
1024
+ label: { default: "" },
1025
+ placeholder: { default: "" },
1026
+ type: { default: "text" },
1027
+ help: {},
1028
+ error: {},
1029
+ modelValue: { default: "" },
1030
+ variant: { default: "default" },
1031
+ readonly: { type: Boolean, default: !1 }
1032
+ },
1033
+ emits: ["update:modelValue"],
1034
+ setup(r, { expose: o, emit: t }) {
1035
+ o();
1036
+ const e = r, s = t, n = u(!1), l = u(null), a = b(
1037
+ () => !(e.modelValue === "" || e.modelValue == null)
1038
+ ), g = { props: e, emit: s, isFocus: n, editable: l, hasValue: a, onInput: (v) => {
1039
+ s("update:modelValue", v.target.value);
1040
+ }, focus: async (v) => {
1041
+ n.value = !0;
1042
+ }, blur: () => {
1043
+ n.value = !1;
1044
+ }, ref: u, computed: b, get Text() {
1045
+ return $e;
1046
+ } };
1047
+ return Object.defineProperty(g, "__isScriptSetup", { enumerable: !1, value: !0 }), g;
1048
+ }
1049
+ }), ar = {
1050
+ class: /* @__PURE__ */ p({ "toife-input-label": !0 })
1051
+ }, lr = {
1052
+ class: /* @__PURE__ */ p({ "toife-input-content": !0 })
1053
+ }, cr = ["placeholder", "value", "type", "readonly"];
1054
+ function ir(r, o, t, e, s, n) {
1055
+ return i(), y("div", {
1056
+ class: p({
1057
+ "toife-input": !0,
1058
+ rounded: t.rounded,
1059
+ ["size-" + t.size]: !0,
1060
+ ["variant-" + t.variant]: !0,
1061
+ focus: e.isFocus,
1062
+ "has-value": e.hasValue,
1063
+ readonly: t.readonly
1064
+ })
1065
+ }, [
1066
+ S("label", null, [
1067
+ S("span", ar, V(t.label), 1),
1068
+ S("div", lr, [
1069
+ $(r.$slots, "start", {}, void 0, !0),
1070
+ S("input", {
1071
+ ref: "editable",
1072
+ class: p({ "toife-input-editable": !0 }),
1073
+ placeholder: t.placeholder,
1074
+ value: t.modelValue,
1075
+ type: t.type,
1076
+ onInput: e.onInput,
1077
+ onFocus: e.focus,
1078
+ onBlur: e.blur,
1079
+ readonly: t.readonly
1080
+ }, null, 40, cr),
1081
+ $(r.$slots, "end", {}, void 0, !0)
1082
+ ])
1083
+ ]),
1084
+ t.error ? (i(), j(e.Text, {
1085
+ key: 0,
1086
+ color: "danger"
1087
+ }, {
1088
+ default: D(() => [
1089
+ F(V(t.error), 1)
1090
+ ]),
1091
+ _: 1
1092
+ })) : t.help ? (i(), j(e.Text, {
1093
+ key: 1,
1094
+ color: "secondary"
1095
+ }, {
1096
+ default: D(() => [
1097
+ F(V(t.help), 1)
1098
+ ]),
1099
+ _: 1
1100
+ })) : C("", !0)
1101
+ ], 2);
1102
+ }
1103
+ const ur = /* @__PURE__ */ x(sr, [["render", ir], ["__scopeId", "data-v-f7768bea"]]), dr = /* @__PURE__ */ k({
1104
+ __name: "loading",
1105
+ props: {
1106
+ type: { default: "spinner" }
1107
+ },
1108
+ emits: ["dismiss"],
1109
+ setup(r, { expose: o, emit: t }) {
1110
+ const e = r, s = u(!1), n = t;
1111
+ let l;
1112
+ const a = () => {
1113
+ s.value = !0;
1114
+ }, c = () => {
1115
+ s.value = !1;
1116
+ };
1117
+ o({
1118
+ open: a,
1119
+ close: c
1137
1120
  });
1138
- const p = () => {
1139
- let v = n();
1140
- v && (r.value = !r.value, r.value ? v.type = "text" : v.type = "password", s("change", r.value));
1121
+ const d = { props: e, visible: s, emit: n, get ges() {
1122
+ return l;
1123
+ }, set ges(_) {
1124
+ l = _;
1125
+ }, open: a, close: c, get Present() {
1126
+ return K;
1127
+ }, get IconSpinner() {
1128
+ return ue;
1129
+ }, ref: u };
1130
+ return Object.defineProperty(d, "__isScriptSetup", { enumerable: !1, value: !0 }), d;
1131
+ }
1132
+ }), pr = {
1133
+ class: /* @__PURE__ */ p({ "toife-loading": !0 })
1134
+ };
1135
+ function fr(r, o, t, e, s, n) {
1136
+ return i(), j(e.Present, {
1137
+ placement: "center",
1138
+ backdrop: !0,
1139
+ keepalive: !1,
1140
+ visible: e.visible
1141
+ }, {
1142
+ default: D(() => [
1143
+ S("div", pr, [
1144
+ $(r.$slots, "default", {}, () => [
1145
+ t.type === "spinner" ? (i(), j(e.IconSpinner, { key: 0 })) : C("", !0)
1146
+ ], !0)
1147
+ ])
1148
+ ]),
1149
+ _: 3
1150
+ }, 8, ["visible"]);
1151
+ }
1152
+ const Se = /* @__PURE__ */ x(dr, [["render", fr], ["__scopeId", "data-v-188d5e1b"]]), oo = (r = {}, o) => {
1153
+ const t = u(), e = document.body.querySelector(".toife-app");
1154
+ let s = null, n = null;
1155
+ return {
1156
+ open() {
1157
+ return new Promise((l) => {
1158
+ e && (n = document.createElement("div"), e.appendChild(n), s = re({
1159
+ render() {
1160
+ return oe(o || Se, {
1161
+ ...r,
1162
+ ref: t
1163
+ });
1164
+ }
1165
+ }), s.mount(n), setTimeout(() => {
1166
+ t.value?.open?.(), l(!0);
1167
+ }, 50));
1168
+ });
1169
+ },
1170
+ close() {
1171
+ return new Promise((l) => {
1172
+ t.value?.close?.(), setTimeout(() => {
1173
+ s?.unmount?.(), n?.remove?.(), l(!0);
1174
+ }, 300);
1175
+ });
1176
+ }
1177
+ };
1178
+ }, mr = /* @__PURE__ */ k({
1179
+ __name: "refresher",
1180
+ props: {
1181
+ threshold: { default: 120 },
1182
+ safe: { type: Boolean, default: !1 },
1183
+ variant: { default: "max" }
1184
+ },
1185
+ emits: ["refresh", "move", "cancel", "start"],
1186
+ setup(r, { expose: o, emit: t }) {
1187
+ o();
1188
+ const e = t, s = r, n = u(0), l = u(!1), a = u();
1189
+ let c, d = !1;
1190
+ const _ = () => {
1191
+ l.value = !1, n.value = 0, d = !1;
1192
+ }, g = () => {
1193
+ d = !0, l.value = !0, n.value = s.threshold, e("refresh", _);
1194
+ }, v = () => {
1195
+ n.value = 0, l.value = !1, d = !1, e("cancel");
1141
1196
  };
1142
- return (v, d) => (i(), f("button", {
1143
- ref_key: "toggle",
1144
- ref: l,
1145
- class: "t-toggle-password",
1146
- style: T(u.value),
1147
- onPointerup: p
1148
- }, [
1149
- r.value ? _(v.$slots, "on", { key: 0 }, () => [
1150
- d[0] || (d[0] = $("i", { class: "ri-eye-line" }, null, -1))
1151
- ], !0) : E("", !0),
1152
- r.value ? E("", !0) : _(v.$slots, "off", { key: 1 }, () => [
1153
- d[1] || (d[1] = $("i", { class: "ri-eye-off-line" }, null, -1))
1154
- ], !0)
1155
- ], 36));
1197
+ z(() => a.value, () => {
1198
+ c && c.destroy();
1199
+ let h = a.value.closest(".toife-content");
1200
+ h && (c = L(h, {
1201
+ options: {
1202
+ minMove: 20
1203
+ },
1204
+ beforeEvent() {
1205
+ return !(h.scrollTop > 0);
1206
+ },
1207
+ down() {
1208
+ l.value || d || e("start");
1209
+ },
1210
+ move({ deltaY: f, initialDirection: I }) {
1211
+ if (l.value || d || I != "down") return;
1212
+ if (s.variant == "max" && f >= s.threshold) {
1213
+ g();
1214
+ return;
1215
+ }
1216
+ const P = f < 0 ? 0 : f;
1217
+ n.value = P, e("move", P);
1218
+ },
1219
+ up({ deltaY: f, initialDirection: I }) {
1220
+ l.value || d || I != "down" || (s.variant == "up" && f >= s.threshold ? g() : v());
1221
+ },
1222
+ cancel() {
1223
+ l.value || d || v();
1224
+ }
1225
+ }, {
1226
+ passive: !1
1227
+ }));
1228
+ }), M(() => {
1229
+ c && c.destroy();
1230
+ });
1231
+ const m = { emit: e, props: s, offset: n, refreshing: l, container: a, get cleanup() {
1232
+ return c;
1233
+ }, set cleanup(h) {
1234
+ c = h;
1235
+ }, get locked() {
1236
+ return d;
1237
+ }, set locked(h) {
1238
+ d = h;
1239
+ }, close: _, start: g, cancel: v, ref: u, onUnmounted: M, watch: z, get gesture() {
1240
+ return L;
1241
+ } };
1242
+ return Object.defineProperty(m, "__isScriptSetup", { enumerable: !1, value: !0 }), m;
1243
+ }
1244
+ });
1245
+ function _r(r, o, t, e, s, n) {
1246
+ return G((i(), y("div", {
1247
+ class: p({ "toife-refresher": !0, safe: t.safe }),
1248
+ ref: "container"
1249
+ }, [
1250
+ $(r.$slots, "default", {
1251
+ offset: e.offset,
1252
+ refreshing: e.refreshing
1253
+ }, void 0, !0)
1254
+ ], 2)), [
1255
+ [U, e.offset > 0]
1256
+ ]);
1257
+ }
1258
+ const vr = /* @__PURE__ */ x(mr, [["render", _r], ["__scopeId", "data-v-69af4f52"]]), yr = /* @__PURE__ */ k({
1259
+ __name: "richtext",
1260
+ setup(r, { expose: o }) {
1261
+ o();
1262
+ const t = {};
1263
+ return Object.defineProperty(t, "__isScriptSetup", { enumerable: !1, value: !0 }), t;
1156
1264
  }
1157
- }), Dt = /* @__PURE__ */ g(Xt, [["__scopeId", "data-v-e5aa6028"]]), Wt = /* @__PURE__ */ h({
1158
- __name: "t-avatar",
1265
+ });
1266
+ function br(r, o, t, e, s, n) {
1267
+ return i(), y("div");
1268
+ }
1269
+ const gr = /* @__PURE__ */ x(yr, [["render", br], ["__scopeId", "data-v-90f4e19d"]]), hr = /* @__PURE__ */ k({
1270
+ __name: "ripple",
1159
1271
  props: {
1160
- square: { type: Boolean, default: !1 },
1161
- size: { default: "standard" }
1272
+ color: { default: "primary" }
1162
1273
  },
1163
- setup(t) {
1164
- const o = t, e = x(() => o.size == "small" ? "24px" : o.size == "standard" ? "40px" : o.size == "large" ? "60px" : o.size);
1165
- return (s, r) => (i(), f("div", {
1166
- class: B(["t-avatar", { square: s.square }]),
1167
- style: T({ "--size": e.value })
1168
- }, [
1169
- _(s.$slots, "default", {}, void 0, !0)
1170
- ], 6));
1274
+ setup(r, { expose: o }) {
1275
+ o();
1276
+ const t = r, e = b(() => {
1277
+ let n = {};
1278
+ return t.color ? ["warning", "info", "danger", "primary", "secondary", "success"].includes(t.color) ? n = {
1279
+ "--color": "var(--toife-color-status-" + t.color + ")"
1280
+ } : n = {
1281
+ "--color": t.color
1282
+ } : n = {
1283
+ "--color": "var(--toife-color-surface)"
1284
+ }, n;
1285
+ }), s = { props: t, styles: e, computed: b };
1286
+ return Object.defineProperty(s, "__isScriptSetup", { enumerable: !1, value: !0 }), s;
1171
1287
  }
1172
- }), qt = /* @__PURE__ */ g(Wt, [["__scopeId", "data-v-1d223827"]]), Mt = { class: "t-collapse-title" }, Ht = {
1173
- key: 0,
1174
- class: "icon"
1175
- }, Lt = {
1176
- key: 1,
1177
- class: "icon"
1178
- }, Ft = { class: "t-collapse-content" }, Ut = /* @__PURE__ */ h({
1179
- __name: "t-collapse",
1288
+ });
1289
+ function kr(r, o, t, e, s, n) {
1290
+ return i(), y("div", {
1291
+ class: p({ "toife-ripple": !0 }),
1292
+ style: w(e.styles)
1293
+ }, null, 4);
1294
+ }
1295
+ const xr = /* @__PURE__ */ x(hr, [["render", kr], ["__scopeId", "data-v-2f24c046"]]), $r = /* @__PURE__ */ k({
1296
+ __name: "sheet",
1180
1297
  props: {
1181
- title: {}
1298
+ background: { default: "var(--toife-color-surface)" },
1299
+ class: {},
1300
+ visible: { type: Boolean, default: !1 },
1301
+ gesture: { type: Boolean, default: !0 },
1302
+ fullscreen: { type: Boolean, default: !1 },
1303
+ placement: { default: "bottom" },
1304
+ keepalive: { type: Boolean, default: !0 },
1305
+ backdrop: { type: Boolean, default: !0 },
1306
+ rounded: { type: Boolean, default: !1 },
1307
+ indicator: { type: Boolean, default: !0 },
1308
+ duration: { default: 200 },
1309
+ bounce: {},
1310
+ style: {}
1182
1311
  },
1183
- emits: ["change"],
1184
- setup(t, { emit: o }) {
1185
- const e = t, s = o, r = m(!1), l = m(""), u = m(), n = () => {
1186
- r.value = !r.value, l.value = `calc(${u.value.offsetHeight}px + 2rem)`, s("change", r.value);
1312
+ emits: ["dismiss"],
1313
+ setup(r, { expose: o, emit: t }) {
1314
+ o();
1315
+ const e = r, s = t, n = u(), l = u(), a = u(!1);
1316
+ let c = null;
1317
+ const d = b(() => {
1318
+ if (e.placement == "bottom") return "down";
1319
+ if (e.placement == "top") return "up";
1320
+ if (e.placement == "left") return "left";
1321
+ if (e.placement == "right") return "right";
1322
+ }), _ = (m) => {
1323
+ s("dismiss", m);
1324
+ }, g = () => {
1325
+ a.value = !0, setTimeout(() => {
1326
+ a.value = !1;
1327
+ }, 300);
1187
1328
  };
1188
- return s("change", r.value), (p, v) => (i(), f("div", {
1189
- class: B(["t-collapse", { open: r.value }]),
1190
- style: T({ "--height": l.value })
1191
- }, [
1192
- $("div", {
1193
- class: "t-collapse-header",
1194
- onPointerup: n
1329
+ z(() => n.value, (m) => {
1330
+ m && (c = L(n.value, {
1331
+ isMoving: !1,
1332
+ options: {
1333
+ minDist: 30
1334
+ },
1335
+ beforeEvent(h) {
1336
+ return !(a.value || !e.gesture || e.placement == "center");
1337
+ },
1338
+ down() {
1339
+ this.isMoving = !1;
1340
+ },
1341
+ fast({ initialDirection: h }) {
1342
+ g(), h == d.value ? s("dismiss", "gesture") : l.value.open();
1343
+ },
1344
+ move({ deltaY: h, deltaX: f, initialDirection: I }) {
1345
+ if (I != d.value) return;
1346
+ let P = 0;
1347
+ e.placement == "bottom" || e.placement == "top" ? P = h : P = f, e.placement == "bottom" && (P = h > 0 ? h : 0), e.placement == "top" && (P = h < 0 ? h : 0), e.placement == "left" && (P = f < 0 ? f : 0), e.placement == "right" && (P = f > 0 ? f : 0), (e.placement == "bottom" && (P >= 10 || this.isMoving) || e.placement == "top" && (P <= -10 || this.isMoving) || e.placement == "left" && (P <= -10 || this.isMoving) || e.placement == "right" && (P >= 10 || this.isMoving)) && (this.isMoving = !0, l.value.render({
1348
+ contentTransform: P + "px",
1349
+ transition: "0s"
1350
+ }));
1351
+ },
1352
+ up({ deltaY: h, deltaX: f, initialDirection: I }) {
1353
+ if (this.isMoving = !1, g(), I != d.value) {
1354
+ l.value.open();
1355
+ return;
1356
+ }
1357
+ let P, T, W;
1358
+ e.placement == "bottom" || e.placement == "top" ? (P = n.value.offsetHeight, W = h) : (P = n.value.offsetWidth, W = f), T = W / P * 100, T > 50 ? s("dismiss", "gesture") : l.value.open();
1359
+ },
1360
+ cancel() {
1361
+ this.isMoving = !1, g(), l.value.open();
1362
+ }
1363
+ }));
1364
+ }), M(() => {
1365
+ c && c.destroy();
1366
+ });
1367
+ const v = { props: e, emit: s, sheet: n, present: l, isBusy: a, get ges() {
1368
+ return c;
1369
+ }, set ges(m) {
1370
+ c = m;
1371
+ }, gestureDir: d, close: _, busy: g, computed: b, onUnmounted: M, ref: u, watch: z, get toifeGesture() {
1372
+ return L;
1373
+ }, get Present() {
1374
+ return K;
1375
+ }, get GestureIndicator() {
1376
+ return xe;
1377
+ } };
1378
+ return Object.defineProperty(v, "__isScriptSetup", { enumerable: !1, value: !0 }), v;
1379
+ }
1380
+ });
1381
+ function Sr(r, o, t, e, s, n) {
1382
+ return i(), j(e.Present, {
1383
+ ref: "present",
1384
+ duration: t.duration,
1385
+ bounce: t.bounce,
1386
+ class: p(t.class),
1387
+ placement: t.placement,
1388
+ backdrop: t.backdrop,
1389
+ visible: t.visible,
1390
+ keepalive: t.keepalive,
1391
+ onDismiss: e.close,
1392
+ style: w(t.style)
1393
+ }, {
1394
+ default: D(() => [
1395
+ t.gesture && t.indicator && t.placement != "center" ? (i(), j(e.GestureIndicator, {
1396
+ key: 0,
1397
+ placement: t.placement
1398
+ }, null, 8, ["placement"])) : C("", !0),
1399
+ S("div", {
1400
+ ref: "sheet",
1401
+ class: p({ "toife-sheet": !0, fullscreen: t.fullscreen, [t.placement]: !0, rounded: t.rounded }),
1402
+ style: w({ "--background": t.background })
1195
1403
  }, [
1196
- _(p.$slots, "icon"),
1197
- $("div", Mt, [
1198
- _(p.$slots, "title", {}, () => [
1199
- M(A(e.title), 1)
1200
- ])
1201
- ]),
1202
- _(p.$slots, "toggle", {}, () => [
1203
- r.value ? (i(), f("div", Ht, [...v[0] || (v[0] = [
1204
- $("i", { class: "ri-arrow-up-s-line" }, null, -1)
1205
- ])])) : (i(), f("div", Lt, [...v[1] || (v[1] = [
1206
- $("i", { class: "ri-arrow-down-s-line" }, null, -1)
1207
- ])]))
1208
- ])
1209
- ], 32),
1210
- $("div", Ft, [
1211
- $("div", {
1212
- ref_key: "content",
1213
- ref: u
1214
- }, [
1215
- _(p.$slots, "content", {}, () => [
1216
- _(p.$slots, "default")
1217
- ])
1218
- ], 512)
1219
- ])
1220
- ], 6));
1404
+ $(r.$slots, "default", {}, void 0, !0)
1405
+ ], 6)
1406
+ ]),
1407
+ _: 3
1408
+ }, 8, ["duration", "bounce", "class", "placement", "backdrop", "visible", "keepalive", "style"]);
1409
+ }
1410
+ const wr = /* @__PURE__ */ x($r, [["render", Sr], ["__scopeId", "data-v-0d1848cc"]]), Pr = /* @__PURE__ */ k({
1411
+ __name: "skeleton",
1412
+ props: {
1413
+ width: { default: "100%" },
1414
+ height: { default: "1rem" },
1415
+ radius: { default: "8px" },
1416
+ color: { default: null }
1417
+ },
1418
+ setup(r, { expose: o }) {
1419
+ o();
1420
+ const t = r, e = b(() => ({
1421
+ "--width": t.width,
1422
+ "--height": t.height,
1423
+ "--radius": t.radius
1424
+ })), s = { props: t, styles: e, computed: b };
1425
+ return Object.defineProperty(s, "__isScriptSetup", { enumerable: !1, value: !0 }), s;
1221
1426
  }
1222
- }), jt = /* @__PURE__ */ h({
1223
- __name: "t-switch",
1427
+ });
1428
+ function Tr(r, o, t, e, s, n) {
1429
+ return i(), y("div", {
1430
+ class: p({ "toife-skeleton": !0 }),
1431
+ style: w(e.styles)
1432
+ }, null, 4);
1433
+ }
1434
+ const Ir = /* @__PURE__ */ x(Pr, [["render", Tr], ["__scopeId", "data-v-08e291f4"]]), Or = /* @__PURE__ */ k({
1435
+ __name: "switch",
1224
1436
  props: {
1225
1437
  modelValue: { type: Boolean },
1226
1438
  color: { default: "primary" }
1227
1439
  },
1228
1440
  emits: ["update:modelValue"],
1229
- setup(t, { emit: o }) {
1230
- const e = t, s = o, r = () => {
1441
+ setup(r, { expose: o, emit: t }) {
1442
+ o();
1443
+ const e = r, s = t, n = () => {
1231
1444
  s("update:modelValue", !e.modelValue);
1232
- }, l = x(() => {
1233
- let u = {
1445
+ }, l = b(() => {
1446
+ let c = {
1234
1447
  "--background": e.color,
1235
1448
  "--color": "#ffffff"
1236
1449
  };
1237
- return ["warning", "info", "danger", "primary", "secondary", "success"].includes(e.color) && (u = {
1238
- "--background": `var(--t-color-status-${e.color})`,
1239
- "--color": `var(--t-color-status-${e.color}-text)`
1240
- }), u;
1241
- });
1242
- return (u, n) => (i(), f("div", {
1243
- class: B(["t-switch", { on: e.modelValue }]),
1244
- style: T(l.value),
1245
- onPointerup: r
1246
- }, [...n[0] || (n[0] = [
1247
- $("div", { class: "t-switch-icon" }, null, -1)
1248
- ])], 38));
1450
+ return ["warning", "info", "danger", "primary", "secondary", "success"].includes(e.color) && (c = {
1451
+ "--background": `var(--toife-color-status-${e.color})`,
1452
+ "--color": `var(--toife-color-status-${e.color}-text)`
1453
+ }), c;
1454
+ }), a = { props: e, emit: s, onSwitch: n, styles: l, computed: b };
1455
+ return Object.defineProperty(a, "__isScriptSetup", { enumerable: !1, value: !0 }), a;
1249
1456
  }
1250
- }), Gt = /* @__PURE__ */ g(jt, [["__scopeId", "data-v-ac24f5cf"]]), Kt = /* @__PURE__ */ h({
1251
- __name: "t-tab",
1457
+ });
1458
+ function Br(r, o, t, e, s, n) {
1459
+ return i(), y("div", {
1460
+ class: p({ "toife-switch": !0, on: e.props.modelValue }),
1461
+ style: w(e.styles),
1462
+ onPointerup: e.onSwitch
1463
+ }, [...o[0] || (o[0] = [
1464
+ S("div", {
1465
+ class: p({ "toife-switch-icon": !0 })
1466
+ }, null, -1)
1467
+ ])], 38);
1468
+ }
1469
+ const Cr = /* @__PURE__ */ x(Or, [["render", Br], ["__scopeId", "data-v-b571ee39"]]), zr = /* @__PURE__ */ k({
1470
+ __name: "tab",
1252
1471
  props: {
1253
1472
  value: {},
1254
1473
  disabled: { type: Boolean, default: !1 }
1255
1474
  },
1256
- setup(t) {
1257
- const o = t, e = pe("tabsState"), s = x(() => e.activeValue.value === o.value), r = () => {
1258
- o.disabled || e.setValue(o.value);
1259
- };
1260
- return (l, u) => (i(), f("li", {
1261
- class: B(["t-tab", { active: s.value }])
1262
- }, [
1263
- ue(Z, {
1264
- variant: "text",
1265
- onPointerup: r,
1266
- size: O(e).size,
1267
- color: s.value ? O(e).color.text : void 0
1268
- }, {
1269
- default: N(() => [
1270
- _(l.$slots, "default", {}, void 0, !0)
1271
- ]),
1272
- _: 3
1273
- }, 8, ["size", "color"])
1274
- ], 2));
1475
+ setup(r, { expose: o }) {
1476
+ o();
1477
+ const t = r, e = Z("tabsState"), s = b(() => e.activeValue.value === t.value), l = { props: t, tabs: e, isActive: s, handleClick: () => {
1478
+ t.disabled || e.setValue(t.value);
1479
+ }, inject: Z, computed: b, get CustomButton() {
1480
+ return ne;
1481
+ } };
1482
+ return Object.defineProperty(l, "__isScriptSetup", { enumerable: !1, value: !0 }), l;
1275
1483
  }
1276
- }), Jt = /* @__PURE__ */ g(Kt, [["__scopeId", "data-v-d25a3a3e"]]), Qt = /* @__PURE__ */ h({
1277
- __name: "t-tabs",
1484
+ });
1485
+ function Er(r, o, t, e, s, n) {
1486
+ return i(), y("li", {
1487
+ class: p({ "toife-tab": !0, active: e.isActive })
1488
+ }, [
1489
+ ye(e.CustomButton, {
1490
+ variant: "text",
1491
+ onPointerup: e.handleClick,
1492
+ size: e.tabs.size,
1493
+ color: e.isActive ? e.tabs.color.text : void 0
1494
+ }, {
1495
+ default: D(() => [
1496
+ $(r.$slots, "default", {}, void 0, !0)
1497
+ ]),
1498
+ _: 3
1499
+ }, 8, ["size", "color"])
1500
+ ], 2);
1501
+ }
1502
+ const jr = /* @__PURE__ */ x(zr, [["render", Er], ["__scopeId", "data-v-4dd31330"]]), Rr = /* @__PURE__ */ k({
1503
+ __name: "tabs",
1278
1504
  props: {
1279
1505
  placement: { default: "top-start" },
1280
1506
  variant: { default: "border-under" },
@@ -1286,216 +1512,325 @@ const Ct = /* @__PURE__ */ g(Pt, [["render", Vt]]), Rt = /* @__PURE__ */ h({
1286
1512
  radius: { default: 4 }
1287
1513
  },
1288
1514
  emits: ["update:modelValue"],
1289
- setup(t, { emit: o }) {
1290
- const e = t, s = o, r = m("0px"), l = m(0), u = m(0), n = m(), p = x(() => {
1291
- let a = "", c = "";
1292
- return e.variant == "text" && (a = "transparent", ["warning", "info", "danger", "primary", "secondary", "success"].includes(e.color) ? c = `var(--t-color-status-${e.color})` : c = e.color), e.variant == "border-under" && (c = "currentColor", ["warning", "info", "danger", "primary", "secondary", "success"].includes(e.color) ? a = `var(--t-color-status-${e.color})` : a = e.color), e.variant == "tag" && (["warning", "info", "danger", "primary", "secondary", "success"].includes(e.color) ? (a = `var(--t-color-status-${e.color})`, c = `var(--t-color-status-${e.color}-text)`) : (a = e.color, c = "currentColor")), { background: a, text: c };
1293
- }), v = x(() => e.variant == "border-under" ? {
1294
- "--transform": r.value,
1515
+ setup(r, { expose: o, emit: t }) {
1516
+ o();
1517
+ const e = r, s = t, n = u("0px"), l = u(0), a = u(0), c = u(), d = b(() => {
1518
+ let m = "", h = "";
1519
+ return e.variant == "text" && (m = "transparent", ["warning", "info", "danger", "primary", "secondary", "success"].includes(e.color) ? h = `var(--toife-color-status-${e.color})` : h = e.color), e.variant == "border-under" && (h = "currentColor", ["warning", "info", "danger", "primary", "secondary", "success"].includes(e.color) ? m = `var(--toife-color-status-${e.color})` : m = e.color), e.variant == "tag" && (["warning", "info", "danger", "primary", "secondary", "success"].includes(e.color) ? (m = `var(--toife-color-status-${e.color})`, h = `var(--toife-color-status-${e.color}-text)`) : (m = e.color, h = "currentColor")), { background: m, text: h };
1520
+ }), _ = b(() => e.variant == "border-under" ? {
1521
+ "--transform": n.value,
1295
1522
  "--border": e.border + "px"
1296
1523
  } : e.variant == "tag" ? {
1297
1524
  "--top": e.margin[0] + "px",
1298
- "--height": u.value - e.margin[0] * 2 + "px",
1525
+ "--height": a.value - e.margin[0] * 2 + "px",
1299
1526
  "--left": e.margin[1] + "px",
1300
1527
  "--width": l.value - e.margin[1] * 2 + "px",
1301
- "--transform": r.value,
1528
+ "--transform": n.value,
1302
1529
  "--radius": e.radius + "px"
1303
- } : {}), d = () => {
1530
+ } : {}), g = () => {
1304
1531
  if (e.variant == "border-under") {
1305
- let a = n.value.querySelector(".active");
1306
- if (a) {
1532
+ let m = c.value.querySelector(".active");
1533
+ if (m) {
1307
1534
  if (e.placement.startsWith("top-") || e.placement.startsWith("bottom-")) {
1308
- let c = a.getBoundingClientRect().left - n.value.getBoundingClientRect().left + n.value.scrollLeft, y = a.offsetWidth / 2;
1309
- r.value = c + y - e.border / 2 + "px";
1535
+ let h = m.getBoundingClientRect().left - c.value.getBoundingClientRect().left + c.value.scrollLeft, f = m.offsetWidth / 2;
1536
+ n.value = h + f - e.border / 2 + "px";
1310
1537
  } else if (e.placement.startsWith("left-") || e.placement.startsWith("right-")) {
1311
- let c = a.getBoundingClientRect().top - n.value.getBoundingClientRect().top + n.value.scrollTop, y = a.offsetHeight / 2;
1312
- r.value = c + y - e.border / 2 + "px";
1538
+ let h = m.getBoundingClientRect().top - c.value.getBoundingClientRect().top + c.value.scrollTop, f = m.offsetHeight / 2;
1539
+ n.value = h + f - e.border / 2 + "px";
1313
1540
  }
1314
1541
  }
1315
1542
  }
1316
1543
  if (e.variant == "tag") {
1317
- let a = n.value.querySelector(".active");
1318
- if (a) {
1319
- let c = a.offsetWidth, y = a.offsetHeight;
1544
+ let m = c.value.querySelector(".active");
1545
+ if (m) {
1546
+ let h = m.offsetWidth, f = m.offsetHeight;
1320
1547
  if (e.placement.startsWith("top-") || e.placement.startsWith("bottom-")) {
1321
- let w = a.getBoundingClientRect().left - n.value.getBoundingClientRect().left + n.value.scrollLeft;
1322
- r.value = w + "px";
1548
+ let I = m.getBoundingClientRect().left - c.value.getBoundingClientRect().left + c.value.scrollLeft;
1549
+ n.value = I + "px";
1323
1550
  } else if (e.placement.startsWith("left-") || e.placement.startsWith("right-")) {
1324
- let w = a.getBoundingClientRect().top - n.value.getBoundingClientRect().top + n.value.scrollTop;
1325
- r.value = w + "px";
1551
+ let I = m.getBoundingClientRect().top - c.value.getBoundingClientRect().top + c.value.scrollTop;
1552
+ n.value = I + "px";
1326
1553
  }
1327
- l.value = c, u.value = y;
1554
+ l.value = h, a.value = f;
1328
1555
  }
1329
1556
  }
1330
1557
  };
1331
- return de("tabsState", {
1332
- activeValue: x(() => e.modelValue),
1333
- color: p.value,
1558
+ Q("tabsState", {
1559
+ activeValue: b(() => e.modelValue),
1560
+ color: d.value,
1334
1561
  size: e.size,
1335
1562
  variant: e.variant,
1336
- setValue: (a) => {
1337
- s("update:modelValue", a);
1563
+ setValue: (m) => {
1564
+ s("update:modelValue", m);
1338
1565
  }
1339
- }), W(() => e.modelValue, async () => {
1340
- await le(), d();
1341
- }), L(async () => {
1342
- await le(), d();
1343
- }), (a, c) => (i(), f("ul", {
1344
- ref_key: "container",
1345
- ref: n,
1346
- class: B(["t-tabs", { [a.placement]: !0, [`variant-${a.variant}`]: !0 }]),
1347
- style: T([{ "--background": p.value.background, "--color": p.value.text }, v.value])
1348
- }, [
1349
- _(a.$slots, "default", {}, void 0, !0)
1350
- ], 6));
1351
- }
1352
- }), Zt = /* @__PURE__ */ g(Qt, [["__scopeId", "data-v-b512ed8e"]]), Yt = { key: 0 }, eo = {
1353
- key: 0,
1354
- class: "t-checkbox-label"
1355
- }, to = /* @__PURE__ */ h({
1356
- __name: "t-checkbox",
1357
- props: {
1358
- label: { default: "" },
1359
- modelValue: { default: !1 },
1360
- variant: {},
1361
- type: { default: "check" },
1362
- multiple: { type: Boolean, default: !1 },
1363
- value: { default: void 0 },
1364
- color: { default: "primary" }
1365
- },
1366
- emits: ["update:modelValue"],
1367
- setup(t, { emit: o }) {
1368
- const e = t, s = o, r = x(() => {
1369
- let n = {
1370
- "--background": e.color,
1371
- "--color": "#ffffff"
1372
- };
1373
- return ["warning", "info", "danger", "primary", "secondary", "success"].includes(e.color) && (n = {
1374
- "--background": `var(--t-color-status-${e.color})`,
1375
- "--color": `var(--t-color-status-${e.color}-text)`
1376
- }), n;
1377
- }), l = x(() => e.multiple ? e.modelValue.includes(e.value) : e.value === void 0 ? e.modelValue : e.modelValue == e.value), u = (n) => {
1378
- if (n.preventDefault(), n.stopPropagation(), e.multiple) {
1379
- let p = e.modelValue;
1380
- e.modelValue.includes(e.value) ? p.splice(p.indexOf(e.value), 1) : p.push(e.value), s("update:modelValue", p);
1381
- } else e.value === void 0 ? s("update:modelValue", !e.modelValue) : s("update:modelValue", e.value);
1382
- };
1383
- return (n, p) => (i(), f("div", {
1384
- class: B(["t-checkbox", { active: l.value }]),
1385
- style: T(r.value),
1386
- onPointerup: u
1387
- }, [
1388
- $("div", {
1389
- class: B(`t-checkbox-${n.type}`)
1390
- }, [
1391
- n.type == "radio" ? (i(), f("div", Yt)) : E("", !0),
1392
- n.type == "check" ? _(n.$slots, "icon", { key: 1 }, () => [
1393
- p[0] || (p[0] = $("i", { class: "ri-check-line" }, null, -1))
1394
- ], !0) : E("", !0)
1395
- ], 2),
1396
- _(n.$slots, "label", {}, () => [
1397
- n.label ? (i(), f("span", eo, A(e.label), 1)) : E("", !0)
1398
- ], !0)
1399
- ], 38));
1566
+ }), z(() => e.modelValue, async () => {
1567
+ await ce(), g();
1568
+ }), A(async () => {
1569
+ await ce(), g();
1570
+ });
1571
+ const v = { props: e, emit: s, transform: n, width: l, height: a, container: c, __color: d, styles: _, calcTransform: g, nextTick: ce, onMounted: A, provide: Q, ref: u, watch: z, computed: b };
1572
+ return Object.defineProperty(v, "__isScriptSetup", { enumerable: !1, value: !0 }), v;
1400
1573
  }
1401
- }), oo = /* @__PURE__ */ g(to, [["__scopeId", "data-v-b1f8b112"]]), so = /* @__PURE__ */ h({
1402
- __name: "t-keyboard-space",
1403
- setup(t) {
1404
- const { height: o } = ge();
1405
- return (e, s) => (i(), f("div", {
1406
- class: "t-keyboard-space",
1407
- style: T({ "--height": O(o) + "px" })
1408
- }, null, 4));
1574
+ });
1575
+ function Vr(r, o, t, e, s, n) {
1576
+ return i(), y("ul", {
1577
+ ref: "container",
1578
+ class: p({ "toife-tabs": !0, [t.placement]: !0, [`variant-${t.variant}`]: !0 }),
1579
+ style: w([{ "--background": e.__color.background, "--color": e.__color.text }, e.styles])
1580
+ }, [
1581
+ $(r.$slots, "default", {}, void 0, !0)
1582
+ ], 6);
1583
+ }
1584
+ const Ar = /* @__PURE__ */ x(Rr, [["render", Vr], ["__scopeId", "data-v-c7fff5a0"]]), Dr = /* @__PURE__ */ k({
1585
+ __name: "textarea",
1586
+ setup(r, { expose: o }) {
1587
+ o();
1588
+ const t = {};
1589
+ return Object.defineProperty(t, "__isScriptSetup", { enumerable: !1, value: !0 }), t;
1409
1590
  }
1410
- }), ro = /* @__PURE__ */ g(so, [["__scopeId", "data-v-4b06018d"]]), no = /* @__PURE__ */ h({
1411
- __name: "t-skeleton",
1591
+ }), Nr = {
1592
+ class: /* @__PURE__ */ p({ "toife-textarea": !0 })
1593
+ };
1594
+ function Xr(r, o, t, e, s, n) {
1595
+ return i(), y("div", Nr, [...o[0] || (o[0] = [
1596
+ S("textarea", null, null, -1)
1597
+ ])]);
1598
+ }
1599
+ const Wr = /* @__PURE__ */ x(Dr, [["render", Xr], ["__scopeId", "data-v-9e74bf55"]]), qr = /* @__PURE__ */ k({
1600
+ __name: "toast",
1412
1601
  props: {
1413
- width: { default: "100%" },
1414
- height: { default: "1rem" },
1415
- radius: { default: "8px" },
1416
- color: { default: null }
1602
+ message: {},
1603
+ space: { default: "0px" },
1604
+ placement: { default: "bottom" },
1605
+ color: { default: null },
1606
+ variant: { default: "default" },
1607
+ visible: { type: Boolean, default: !1 }
1417
1608
  },
1418
- setup(t) {
1419
- const o = t, e = x(() => ({
1420
- "--width": o.width,
1421
- "--height": o.height,
1422
- "--radius": o.radius
1423
- }));
1424
- return (s, r) => (i(), f("div", {
1425
- class: "t-skeleton",
1426
- style: T(e.value)
1427
- }, null, 4));
1609
+ emits: ["dismiss"],
1610
+ setup(r, { expose: o, emit: t }) {
1611
+ const e = r, s = t, n = u(!1), l = u(!1), a = u(!1), c = () => {
1612
+ l.value = !0, a.value = !1, setTimeout(() => {
1613
+ n.value = !0;
1614
+ }, 10);
1615
+ }, d = () => {
1616
+ a.value = !0, setTimeout(() => {
1617
+ l.value = !1, n.value = !1, s("dismiss");
1618
+ }, 300);
1619
+ };
1620
+ z(() => e.visible, (v) => {
1621
+ v ? c() : d();
1622
+ });
1623
+ const _ = b(() => {
1624
+ let v;
1625
+ return e.variant == "default" && (e.color ? ["warning", "info", "danger", "primary", "secondary", "success"].includes(e.color) ? v = {
1626
+ "--border": "none",
1627
+ "--color": "var(--toife-color-status-" + e.color + "-text)",
1628
+ "--background": "rgba(var(--toife-color-status-" + e.color + "-rgb), 1)"
1629
+ } : v = {
1630
+ "--border": "none",
1631
+ "--color": "var(--toife-color-text)",
1632
+ "--background": e.color
1633
+ } : v = {
1634
+ "--border": "none",
1635
+ "--color": "var(--toife-color-text)",
1636
+ "--background": "rgba(var(--toife-color-surface-rgb), 1)"
1637
+ }), e.variant == "text" && (e.color ? ["warning", "info", "danger", "primary", "secondary", "success"].includes(e.color) ? v = {
1638
+ "--border": "none",
1639
+ "--color": "var(--toife-color-status-" + e.color + ")",
1640
+ "--background": "transparent"
1641
+ } : v = {
1642
+ "--border": "none",
1643
+ "--color": e.color,
1644
+ "--background": "transparent"
1645
+ } : v = {
1646
+ "--border": "none",
1647
+ "--color": "var(--toife-color-text)",
1648
+ "--background": "transparent"
1649
+ }), e.variant == "outline" && (e.color ? ["warning", "info", "danger", "primary", "secondary", "success"].includes(e.color) ? v = {
1650
+ "--border": "0.55px solid var(--toife-color-status-" + e.color + ")",
1651
+ "--color": "var(--toife-color-status-" + e.color + ")",
1652
+ "--background": "transparent"
1653
+ } : v = {
1654
+ "--border": "0.55px solid " + e.color,
1655
+ "--color": e.color,
1656
+ "--background": "transparent"
1657
+ } : v = {
1658
+ "--border": "0.55px solid var(--toife-color-text)",
1659
+ "--color": "var(--toife-color-text)",
1660
+ "--background": "transparent"
1661
+ }), v;
1662
+ });
1663
+ o({
1664
+ open: c,
1665
+ close: d
1666
+ });
1667
+ const g = { props: e, emit: s, _visible: n, isRender: l, isClosing: a, open: c, close: d, styles: _, computed: b, ref: u, watch: z };
1668
+ return Object.defineProperty(g, "__isScriptSetup", { enumerable: !1, value: !0 }), g;
1428
1669
  }
1429
- }), ao = /* @__PURE__ */ g(no, [["__scopeId", "data-v-877bbdb5"]]), lo = /* @__PURE__ */ h({
1430
- __name: "t-ripple",
1431
- props: {
1432
- color: { default: "primary" }
1433
- },
1434
- setup(t) {
1435
- const o = t, e = x(() => {
1436
- let s = {};
1437
- return o.color ? ["warning", "info", "danger", "primary", "secondary", "success"].includes(o.color) ? s = {
1438
- "--color": "var(--t-color-status-" + o.color + ")"
1439
- } : s = {
1440
- "--color": o.color
1441
- } : s = {
1442
- "--color": "var(--t-color-surface)"
1443
- }, s;
1670
+ }), Mr = {
1671
+ class: /* @__PURE__ */ p({ "toife-toast-content": !0 })
1672
+ };
1673
+ function Lr(r, o, t, e, s, n) {
1674
+ return e.isRender ? (i(), y("div", {
1675
+ key: 0,
1676
+ class: p({ "toife-toast": !0, [e.props.placement]: !0, open: e._visible, closing: e.isClosing }),
1677
+ style: w({ "--space": e.props.space, ...e.styles })
1678
+ }, [
1679
+ $(r.$slots, "content", {}, () => [
1680
+ S("div", Mr, V(e.props.message), 1)
1681
+ ], !0)
1682
+ ], 6)) : C("", !0);
1683
+ }
1684
+ const we = /* @__PURE__ */ x(qr, [["render", Lr], ["__scopeId", "data-v-931010bd"]]), no = (r = {}, o) => ({
1685
+ open() {
1686
+ let t = document.body.querySelector(".toife-app");
1687
+ if (!t) return;
1688
+ const e = document.createElement("div"), s = u();
1689
+ t.appendChild(e);
1690
+ const n = re({
1691
+ render() {
1692
+ return oe(o || we, {
1693
+ ...r,
1694
+ ref: s,
1695
+ onDismiss: () => {
1696
+ setTimeout(() => {
1697
+ n.unmount(), e.remove();
1698
+ }, 300);
1699
+ }
1700
+ });
1701
+ }
1444
1702
  });
1445
- return (s, r) => (i(), f("div", {
1446
- class: "t-ripple",
1447
- style: T(e.value)
1448
- }, null, 4));
1703
+ n.mount(e), setTimeout(() => {
1704
+ s.value?.open?.(), setTimeout(() => {
1705
+ s.value?.close?.();
1706
+ }, (r.duration || 2e3) + 10);
1707
+ }, 50);
1449
1708
  }
1450
- }), co = /* @__PURE__ */ g(lo, [["__scopeId", "data-v-42cb3d71"]]), io = /* @__PURE__ */ h({
1451
- __name: "t-flex",
1709
+ }), Fr = /* @__PURE__ */ k({
1710
+ __name: "toggle-password",
1452
1711
  props: {
1453
- gap: { default: 0 },
1454
- direction: { default: "row" }
1712
+ color: { default: "warning" }
1455
1713
  },
1456
- setup(t) {
1457
- const o = t, e = x(() => isNaN(o.gap) ? o.gap : `var(--t-size-${o.gap})`);
1458
- return (s, r) => (i(), f("div", {
1459
- class: "t-flex",
1460
- style: T({ "--gap": e.value, "--direction": o.direction })
1461
- }, [
1462
- _(s.$slots, "default", {}, void 0, !0)
1463
- ], 4));
1714
+ emits: ["change"],
1715
+ setup(r, { expose: o, emit: t }) {
1716
+ o();
1717
+ const e = r, s = t, n = u(!1), l = u(), a = b(() => {
1718
+ let g = e.color;
1719
+ return ["warning", "info", "danger", "primary", "secondary", "success"].includes(e.color) && (g = `var(--toife-color-status-${e.color})`), {
1720
+ "--color": g
1721
+ };
1722
+ }), c = () => l.value?.parentElement?.querySelector?.("input");
1723
+ A(() => {
1724
+ let g = c();
1725
+ g && (n.value = g.type != "password", s("change", n.value));
1726
+ });
1727
+ const _ = { props: e, emit: s, isShow: n, toggle: l, style: a, el: c, onClick: () => {
1728
+ let g = c();
1729
+ g && (n.value = !n.value, n.value ? g.type = "text" : g.type = "password", s("change", n.value));
1730
+ }, computed: b, onMounted: A, ref: u };
1731
+ return Object.defineProperty(_, "__isScriptSetup", { enumerable: !1, value: !0 }), _;
1464
1732
  }
1465
- }), uo = /* @__PURE__ */ g(io, [["__scopeId", "data-v-e83facf5"]]), po = ["src"], fo = /* @__PURE__ */ h({
1466
- __name: "t-image",
1733
+ });
1734
+ function Hr(r, o, t, e, s, n) {
1735
+ return i(), y("button", {
1736
+ ref: "toggle",
1737
+ class: p({ "toife-toggle-password": !0 }),
1738
+ style: w(e.style),
1739
+ onPointerup: e.onClick
1740
+ }, [
1741
+ e.isShow ? $(r.$slots, "on", { key: 0 }, () => [
1742
+ o[0] || (o[0] = S("i", { class: "ri-eye-line" }, null, -1))
1743
+ ], !0) : C("", !0),
1744
+ e.isShow ? C("", !0) : $(r.$slots, "off", { key: 1 }, () => [
1745
+ o[1] || (o[1] = S("i", { class: "ri-eye-off-line" }, null, -1))
1746
+ ], !0)
1747
+ ], 36);
1748
+ }
1749
+ const Kr = /* @__PURE__ */ x(Fr, [["render", Hr], ["__scopeId", "data-v-97f88bfa"]]), Gr = /* @__PURE__ */ k({
1750
+ __name: "toolbar",
1467
1751
  props: {
1468
- defaultSrc: {},
1469
- src: {}
1752
+ placement: { default: null },
1753
+ safe: { type: Boolean, default: !0 },
1754
+ size: { default: "50px" }
1470
1755
  },
1471
- setup(t) {
1472
- const o = m(""), e = () => {
1473
- t.defaultSrc && (o.value = t.defaultSrc);
1474
- };
1475
- return L(() => {
1476
- o.value = t.src;
1477
- }), (s, r) => (i(), f("img", {
1478
- onError: e,
1479
- src: o.value
1480
- }, null, 40, po));
1481
- }
1482
- }), ko = (t) => t && (t.tagName == "INPUT" || t.tagName == "TEXTAREA" || t.isContentEditable), $o = () => {
1483
- const t = document.activeElement;
1484
- t && (t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.isContentEditable) && t.blur();
1485
- }, xo = () => ({
1486
- install: (t) => {
1487
- t.component("t-app", ze), t.component("t-screen", be), t.component("t-screen-router", mt), t.component("t-cable", ot), t.component("t-toolbar", yt), t.component("t-content", lt), t.component("t-card", st), t.component("t-refresher", it), t.component("t-button", Z), t.component("t-back-button", gt), t.component("t-present", F), t.component("t-text", oe), t.component("t-sheet", $t), t.component("t-gesture-indicator", he), t.component("t-input", Bt), t.component("t-textarea", Et), t.component("t-rich-text", Ct), t.component("t-grid", At), t.component("t-divider", Nt), t.component("t-toggle-password", Dt), t.component("t-icon-spinner", ne), t.component("t-alert", me), t.component("t-avatar", qt), t.component("t-collapse", Ut), t.component("t-toast", _e), t.component("t-switch", Gt), t.component("t-tab", Jt), t.component("t-tabs", Zt), t.component("t-checkbox", oo), t.component("t-keyboard-space", ro), t.component("t-skeleton", ao), t.component("t-ripple", co), t.component("t-loading", ve), t.component("t-flex", uo), t.component("t-image", fo);
1756
+ setup(r, { expose: o }) {
1757
+ o();
1758
+ const t = r, e = Z("cableState"), s = b(() => t?.placement || e?.placement), n = { props: t, cable: e, placement: s, computed: b, inject: Z };
1759
+ return Object.defineProperty(n, "__isScriptSetup", { enumerable: !1, value: !0 }), n;
1488
1760
  }
1489
1761
  });
1762
+ function Ur(r, o, t, e, s, n) {
1763
+ return i(), y("div", {
1764
+ class: p({ "toife-toolbar": !0, [e.placement]: !0, safe: e.props.safe }),
1765
+ style: w({ "--toife-size-toolbar": e.props.size })
1766
+ }, [
1767
+ S("div", null, [
1768
+ $(r.$slots, "default", {}, void 0, !0)
1769
+ ])
1770
+ ], 6);
1771
+ }
1772
+ const Jr = /* @__PURE__ */ x(Gr, [["render", Ur], ["__scopeId", "data-v-24f79d25"]]), so = (r) => ({
1773
+ install: (o) => {
1774
+ const t = r?.prefix || "t-";
1775
+ o.component(t + "app", ze), o.component(t + "action", be), o.component(t + "screen", he), o.component(t + "screen-router", dt), o.component(t + "cable", kt), o.component(t + "toolbar", Jr), o.component(t + "content", Wt), o.component(t + "card", St), o.component(t + "refresher", vr), o.component(t + "button", ne), o.component(t + "back-button", mt), o.component(t + "present", K), o.component(t + "text", $e), o.component(t + "sheet", wr), o.component(t + "gesture-indicator", xe), o.component(t + "input", ur), o.component(t + "textarea", Wr), o.component(t + "richtext", gr), o.component(t + "grid", Zt), o.component(t + "divider", Lt), o.component(t + "toggle-password", Kr), o.component(t + "icon-spinner", ue), o.component(t + "alert", ge), o.component(t + "avatar", Je), o.component(t + "collapse", At), o.component(t + "toast", we), o.component(t + "switch", Cr), o.component(t + "tab", jr), o.component(t + "tabs", Ar), o.component(t + "checkbox", Ot), o.component(t + "keyboard-space", bt), o.component(t + "skeleton", Ir), o.component(t + "ripple", xr), o.component(t + "loading", Se), o.component(t + "flex", Kt), o.component(t + "image", rr);
1776
+ }
1777
+ }), Pe = (r) => r && (r.tagName == "INPUT" || r.tagName == "TEXTAREA" || r.isContentEditable), Te = () => {
1778
+ const r = document.activeElement;
1779
+ r && (r.tagName === "INPUT" || r.tagName === "TEXTAREA" || r.isContentEditable) && r.blur();
1780
+ }, Qr = () => {
1781
+ document.addEventListener("contextmenu", (r) => r.preventDefault()), document.addEventListener("pointerup", (r) => {
1782
+ !Pe(r.target) && Te();
1783
+ }), "virtualKeyboard" in navigator && (navigator.virtualKeyboard.overlaysContent = !0);
1784
+ }, ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1785
+ __proto__: null,
1786
+ blurCurrentActive: Te,
1787
+ isFormElement: Pe,
1788
+ preventDefault: Qr
1789
+ }, Symbol.toStringTag, { value: "Module" }));
1490
1790
  export {
1491
- $o as blurCurrentActive,
1492
- go as createAction,
1493
- _o as createAlert,
1494
- bo as createLoading,
1495
- ho as createToast,
1496
- xo as createToife,
1497
- ko as isFormElement,
1498
- Me as presentController,
1499
- S as screenController,
1500
- ge as useKeyboard
1791
+ be as Action,
1792
+ ge as Alert,
1793
+ ze as App,
1794
+ Je as Avatar,
1795
+ mt as BackButton,
1796
+ ne as Button,
1797
+ kt as Cable,
1798
+ St as Card,
1799
+ Ot as Checkbox,
1800
+ At as Collapse,
1801
+ Wt as Content,
1802
+ Lt as Divider,
1803
+ Kt as Flex,
1804
+ xe as GestureIndicator,
1805
+ Zt as Grid,
1806
+ ue as IconSpinner,
1807
+ rr as Image,
1808
+ ur as Input,
1809
+ bt as KeyboardSpace,
1810
+ Se as Loading,
1811
+ K as Present,
1812
+ vr as Refresher,
1813
+ gr as Richtext,
1814
+ xr as Ripple,
1815
+ he as Screen,
1816
+ dt as ScreenRouter,
1817
+ wr as Sheet,
1818
+ Ir as Skeleton,
1819
+ Cr as Switch,
1820
+ jr as Tab,
1821
+ Ar as Tabs,
1822
+ $e as Text,
1823
+ Wr as Textarea,
1824
+ we as Toast,
1825
+ Kr as TogglePassword,
1826
+ Jr as Toolbar,
1827
+ to as createAction,
1828
+ ro as createAlert,
1829
+ oo as createLoading,
1830
+ no as createToast,
1831
+ so as createToife,
1832
+ ve as getNewPresentIndex,
1833
+ te as useKeyboard,
1834
+ ee as useScreenRouter,
1835
+ ao as utils
1501
1836
  };