@toife/vue 2.2.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (324) hide show
  1. package/README.md +171 -0
  2. package/package.json +41 -9
  3. package/src/components/action/action.composable.ts +32 -0
  4. package/src/components/action/action.html +25 -0
  5. package/src/components/action/action.scss +106 -0
  6. package/src/components/action/action.type.ts +35 -0
  7. package/src/components/action/action.vue +82 -0
  8. package/src/components/action/index.ts +9 -0
  9. package/src/components/app/app.constants.ts +1 -0
  10. package/src/components/app/app.html +24 -0
  11. package/src/components/app/app.scss +27 -0
  12. package/src/components/app/app.type.ts +21 -0
  13. package/src/components/app/app.vue +45 -0
  14. package/src/components/app/index.ts +3 -0
  15. package/src/components/avatar/avatar.html +3 -0
  16. package/src/components/avatar/avatar.scss +35 -0
  17. package/src/components/avatar/avatar.type.ts +6 -0
  18. package/src/components/avatar/avatar.vue +45 -0
  19. package/src/components/avatar/index.ts +2 -0
  20. package/src/components/button/button.html +6 -0
  21. package/src/components/button/button.scss +113 -0
  22. package/src/components/button/button.type.ts +14 -0
  23. package/src/components/button/button.vue +66 -0
  24. package/src/components/button/index.ts +2 -0
  25. package/src/components/cable/cable.constants.ts +1 -0
  26. package/src/components/cable/cable.html +3 -0
  27. package/src/components/cable/cable.scss +37 -0
  28. package/src/components/cable/cable.type.ts +11 -0
  29. package/src/components/cable/cable.vue +33 -0
  30. package/src/components/cable/index.ts +3 -0
  31. package/src/components/card/card/card.constants.ts +1 -0
  32. package/src/components/card/card/card.html +3 -0
  33. package/src/components/card/card/card.scss +34 -0
  34. package/src/components/card/card/card.type.ts +14 -0
  35. package/src/components/card/card/card.vue +62 -0
  36. package/src/components/card/card/index.ts +3 -0
  37. package/src/components/card/card-body/card-body.html +3 -0
  38. package/src/components/card/card-body/card-body.scss +23 -0
  39. package/src/components/card/card-body/card-body.vue +14 -0
  40. package/src/components/card/card-body/index.ts +1 -0
  41. package/src/components/card/card-footer/card-footer.html +3 -0
  42. package/src/components/card/card-footer/card-footer.scss +31 -0
  43. package/src/components/card/card-footer/card-footer.vue +28 -0
  44. package/src/components/card/card-footer/index.ts +1 -0
  45. package/src/components/card/card-header/card-header.html +3 -0
  46. package/src/components/card/card-header/card-header.scss +31 -0
  47. package/src/components/card/card-header/card-header.vue +28 -0
  48. package/src/components/card/card-header/index.ts +1 -0
  49. package/src/components/card/index.ts +4 -0
  50. package/src/components/checkbox/checkbox.html +13 -0
  51. package/src/components/checkbox/checkbox.scss +138 -0
  52. package/src/components/checkbox/checkbox.type.ts +17 -0
  53. package/src/components/checkbox/checkbox.vue +91 -0
  54. package/src/components/checkbox/index.ts +2 -0
  55. package/src/components/collapse/collapse.html +16 -0
  56. package/src/components/collapse/collapse.scss +59 -0
  57. package/src/components/collapse/collapse.type.ts +11 -0
  58. package/src/components/collapse/collapse.vue +131 -0
  59. package/src/components/collapse/index.ts +2 -0
  60. package/src/components/container/container.html +1 -0
  61. package/src/components/container/container.scss +10 -0
  62. package/src/components/container/container.vue +14 -0
  63. package/src/components/container/index.ts +1 -0
  64. package/src/components/decision-modal/decision-modal.composable.ts +32 -0
  65. package/src/components/decision-modal/decision-modal.html +29 -0
  66. package/src/components/decision-modal/decision-modal.scss +136 -0
  67. package/src/components/decision-modal/decision-modal.type.ts +35 -0
  68. package/src/components/decision-modal/decision-modal.vue +98 -0
  69. package/src/components/decision-modal/index.ts +9 -0
  70. package/src/components/divider/divider.html +1 -0
  71. package/src/components/divider/divider.scss +29 -0
  72. package/src/components/divider/divider.type.ts +6 -0
  73. package/src/components/divider/divider.vue +34 -0
  74. package/src/components/divider/index.ts +2 -0
  75. package/src/components/field/field.html +1 -0
  76. package/src/components/field/field.type.ts +43 -0
  77. package/src/components/field/field.vue +85 -0
  78. package/src/components/field/index.ts +2 -0
  79. package/src/components/field/outline/index.ts +1 -0
  80. package/src/components/field/outline/outline.html +32 -0
  81. package/src/components/field/outline/outline.scss +224 -0
  82. package/src/components/field/outline/outline.vue +243 -0
  83. package/src/components/form-group/form-group.html +3 -0
  84. package/src/components/form-group/form-group.scss +91 -0
  85. package/src/components/form-group/form-group.type.ts +5 -0
  86. package/src/components/form-group/form-group.vue +21 -0
  87. package/src/components/form-group/index.ts +2 -0
  88. package/src/components/gesture-indicator/gesture-indicator.html +1 -0
  89. package/src/components/gesture-indicator/gesture-indicator.scss +45 -0
  90. package/{dist/components/gesture-indicator/gesture-indicator.type.d.ts → src/components/gesture-indicator/gesture-indicator.type.ts} +2 -1
  91. package/src/components/gesture-indicator/gesture-indicator.vue +32 -0
  92. package/src/components/gesture-indicator/index.ts +1 -0
  93. package/src/components/image/image.html +1 -0
  94. package/src/components/image/image.scss +1 -0
  95. package/src/components/image/image.type.ts +5 -0
  96. package/src/components/image/image.vue +25 -0
  97. package/src/components/image/index.ts +2 -0
  98. package/src/components/index.ts +27 -0
  99. package/src/components/modal/index.ts +2 -0
  100. package/src/components/modal/modal.html +20 -0
  101. package/src/components/modal/modal.scss +78 -0
  102. package/src/components/modal/modal.type.ts +21 -0
  103. package/src/components/modal/modal.vue +186 -0
  104. package/src/components/page/index.ts +1 -0
  105. package/src/components/page/page.html +3 -0
  106. package/src/components/page/page.scss +17 -0
  107. package/src/components/page/page.vue +14 -0
  108. package/src/components/present/index.ts +3 -0
  109. package/src/components/present/present.composable.ts +21 -0
  110. package/src/components/present/present.html +9 -0
  111. package/src/components/present/present.scss +81 -0
  112. package/src/components/present/present.type.ts +26 -0
  113. package/src/components/present/present.vue +198 -0
  114. package/src/components/radio/index.ts +2 -0
  115. package/src/components/radio/radio/index.ts +2 -0
  116. package/src/components/radio/radio/radio.html +11 -0
  117. package/src/components/radio/radio/radio.scss +125 -0
  118. package/src/components/radio/radio/radio.type.ts +11 -0
  119. package/src/components/radio/radio/radio.vue +103 -0
  120. package/src/components/radio/radio-group/index.ts +7 -0
  121. package/src/components/radio/radio-group/radio-group.constants.ts +1 -0
  122. package/src/components/radio/radio-group/radio-group.html +3 -0
  123. package/src/components/radio/radio-group/radio-group.scss +16 -0
  124. package/src/components/radio/radio-group/radio-group.type.ts +28 -0
  125. package/src/components/radio/radio-group/radio-group.vue +62 -0
  126. package/src/components/refresher/index.ts +2 -0
  127. package/src/components/refresher/refresher.html +6 -0
  128. package/src/components/refresher/refresher.scss +36 -0
  129. package/src/components/refresher/refresher.type.ts +16 -0
  130. package/src/components/refresher/refresher.vue +137 -0
  131. package/src/components/route/index.ts +5 -0
  132. package/src/components/route/route-navigator/index.ts +2 -0
  133. package/src/components/route/route-navigator/route-navigator.html +19 -0
  134. package/src/components/route/route-navigator/route-navigator.scss +127 -0
  135. package/src/components/route/route-navigator/route-navigator.type.ts +12 -0
  136. package/src/components/route/route-navigator/route-navigator.vue +250 -0
  137. package/src/components/route/route-outlet/index.ts +1 -0
  138. package/src/components/route/route-outlet/route-outlet.html +1 -0
  139. package/src/components/route/route-outlet/route-outlet.vue +30 -0
  140. package/src/components/route/route-provider/index.ts +3 -0
  141. package/src/components/route/route-provider/route-provider.constant.ts +1 -0
  142. package/src/components/route/route-provider/route-provider.html +1 -0
  143. package/src/components/route/route-provider/route-provider.type.ts +10 -0
  144. package/src/components/route/route-provider/route-provider.vue +20 -0
  145. package/src/components/route/route-wrapper/index.ts +3 -0
  146. package/src/components/route/route-wrapper/route-wrapper.composable.ts +43 -0
  147. package/src/components/route/route-wrapper/route-wrapper.html +3 -0
  148. package/src/components/route/route-wrapper/route-wrapper.type.ts +3 -0
  149. package/src/components/route/route-wrapper/route-wrapper.vue +43 -0
  150. package/src/components/route/route.type.ts +7 -0
  151. package/src/components/route/route.util.ts +8 -0
  152. package/src/components/segmented-field/index.ts +7 -0
  153. package/src/components/segmented-field/segmented-field.html +17 -0
  154. package/src/components/segmented-field/segmented-field.scss +52 -0
  155. package/src/components/segmented-field/segmented-field.type.ts +29 -0
  156. package/src/components/segmented-field/segmented-field.vue +151 -0
  157. package/src/components/skeleton/index.ts +2 -0
  158. package/src/components/skeleton/skeleton.html +1 -0
  159. package/src/components/skeleton/skeleton.scss +45 -0
  160. package/src/components/skeleton/skeleton.type.ts +7 -0
  161. package/src/components/skeleton/skeleton.vue +38 -0
  162. package/src/components/switch/index.ts +2 -0
  163. package/src/components/switch/switch.html +15 -0
  164. package/src/components/switch/switch.scss +134 -0
  165. package/src/components/switch/switch.type.ts +13 -0
  166. package/src/components/switch/switch.vue +92 -0
  167. package/src/components/tabs/index.ts +2 -0
  168. package/src/components/tabs/tab/index.ts +2 -0
  169. package/src/components/tabs/tab/tab.html +5 -0
  170. package/src/components/tabs/tab/tab.type.ts +5 -0
  171. package/src/components/tabs/tab/tab.vue +38 -0
  172. package/src/components/tabs/tabs/index.ts +9 -0
  173. package/src/components/tabs/tabs/tabs.constants.ts +1 -0
  174. package/src/components/tabs/tabs/tabs.html +3 -0
  175. package/src/components/tabs/tabs/tabs.scss +272 -0
  176. package/src/components/tabs/tabs/tabs.type.ts +36 -0
  177. package/src/components/tabs/tabs/tabs.vue +159 -0
  178. package/src/components/toast/index.ts +4 -0
  179. package/src/components/toast/toast/index.ts +1 -0
  180. package/src/components/toast/toast/toast.html +9 -0
  181. package/src/components/toast/toast/toast.scss +61 -0
  182. package/src/components/toast/toast/toast.vue +34 -0
  183. package/src/components/toast/toast-content/index.ts +1 -0
  184. package/src/components/toast/toast-content/toast-content.html +1 -0
  185. package/src/components/toast/toast-content/toast-content.scss +41 -0
  186. package/src/components/toast/toast-content/toast-content.vue +59 -0
  187. package/src/components/toast/toast.composable.ts +22 -0
  188. package/src/components/toast/toast.type.ts +25 -0
  189. package/src/components/toolbar/index.ts +2 -0
  190. package/src/components/toolbar/toolbar.html +5 -0
  191. package/src/components/toolbar/toolbar.scss +79 -0
  192. package/src/components/toolbar/toolbar.type.ts +7 -0
  193. package/src/components/toolbar/toolbar.vue +47 -0
  194. package/src/env.d.ts +7 -0
  195. package/src/factory.ts +81 -0
  196. package/src/index.ts +4 -0
  197. package/{dist/type.d.ts → src/type.ts} +1 -1
  198. package/src/utils/element.ts +16 -0
  199. package/src/utils/events.ts +12 -0
  200. package/src/utils/index.ts +3 -0
  201. package/src/utils/style/index.ts +42 -0
  202. package/dist/components/action/action.type.d.ts +0 -17
  203. package/dist/components/action/action.vue.d.ts +0 -14
  204. package/dist/components/action/factory.d.ts +0 -3
  205. package/dist/components/action/index.d.ts +0 -2
  206. package/dist/components/alert/alert.type.d.ts +0 -16
  207. package/dist/components/alert/alert.vue.d.ts +0 -14
  208. package/dist/components/alert/factory.d.ts +0 -3
  209. package/dist/components/alert/index.d.ts +0 -2
  210. package/dist/components/app/app.type.d.ts +0 -1
  211. package/dist/components/app/app.vue.d.ts +0 -3
  212. package/dist/components/app/index.d.ts +0 -1
  213. package/dist/components/avatar/avatar.type.d.ts +0 -4
  214. package/dist/components/avatar/avatar.vue.d.ts +0 -6
  215. package/dist/components/avatar/index.d.ts +0 -1
  216. package/dist/components/back-button/back-button.type.d.ts +0 -4
  217. package/dist/components/back-button/back-button.vue.d.ts +0 -3
  218. package/dist/components/back-button/index.d.ts +0 -1
  219. package/dist/components/button/button.type.d.ts +0 -10
  220. package/dist/components/button/button.vue.d.ts +0 -12
  221. package/dist/components/button/index.d.ts +0 -1
  222. package/dist/components/cable/cable.type.d.ts +0 -4
  223. package/dist/components/cable/cable.vue.d.ts +0 -6
  224. package/dist/components/cable/index.d.ts +0 -1
  225. package/dist/components/card/card.type.d.ts +0 -3
  226. package/dist/components/card/card.vue.d.ts +0 -5
  227. package/dist/components/card/index.d.ts +0 -1
  228. package/dist/components/checkbox/checkbox.type.d.ts +0 -12
  229. package/dist/components/checkbox/checkbox.vue.d.ts +0 -14
  230. package/dist/components/checkbox/index.d.ts +0 -1
  231. package/dist/components/collapse/collapse.type.d.ts +0 -6
  232. package/dist/components/collapse/collapse.vue.d.ts +0 -7
  233. package/dist/components/collapse/index.d.ts +0 -1
  234. package/dist/components/content/content.type.d.ts +0 -1
  235. package/dist/components/content/content.vue.d.ts +0 -3
  236. package/dist/components/content/index.d.ts +0 -1
  237. package/dist/components/divider/divider.type.d.ts +0 -3
  238. package/dist/components/divider/divider.vue.d.ts +0 -5
  239. package/dist/components/divider/index.d.ts +0 -1
  240. package/dist/components/flex/flex.type.d.ts +0 -4
  241. package/dist/components/flex/flex.vue.d.ts +0 -6
  242. package/dist/components/flex/index.d.ts +0 -1
  243. package/dist/components/gesture-indicator/gesture-indicator.vue.d.ts +0 -5
  244. package/dist/components/gesture-indicator/index.d.ts +0 -1
  245. package/dist/components/grid/grid.type.d.ts +0 -4
  246. package/dist/components/grid/grid.vue.d.ts +0 -6
  247. package/dist/components/grid/index.d.ts +0 -1
  248. package/dist/components/icon-spinner/icon-spinner.type.d.ts +0 -4
  249. package/dist/components/icon-spinner/icon-spinner.vue.d.ts +0 -6
  250. package/dist/components/icon-spinner/index.d.ts +0 -1
  251. package/dist/components/image/image.type.d.ts +0 -4
  252. package/dist/components/image/image.vue.d.ts +0 -3
  253. package/dist/components/image/index.d.ts +0 -1
  254. package/dist/components/index.d.ts +0 -36
  255. package/dist/components/input/index.d.ts +0 -1
  256. package/dist/components/input/input.type.d.ts +0 -15
  257. package/dist/components/input/input.vue.d.ts +0 -16
  258. package/dist/components/keyboard-space/factory.d.ts +0 -3
  259. package/dist/components/keyboard-space/index.d.ts +0 -2
  260. package/dist/components/keyboard-space/keyboard-space.type.d.ts +0 -1
  261. package/dist/components/keyboard-space/keyboard-space.vue.d.ts +0 -3
  262. package/dist/components/loading/factory.d.ts +0 -4
  263. package/dist/components/loading/index.d.ts +0 -2
  264. package/dist/components/loading/loading.type.d.ts +0 -6
  265. package/dist/components/loading/loading.vue.d.ts +0 -12
  266. package/dist/components/present/factory.d.ts +0 -1
  267. package/dist/components/present/index.d.ts +0 -2
  268. package/dist/components/present/present.type.d.ts +0 -13
  269. package/dist/components/present/present.vue.d.ts +0 -17
  270. package/dist/components/refresher/index.d.ts +0 -1
  271. package/dist/components/refresher/refresher.type.d.ts +0 -11
  272. package/dist/components/refresher/refresher.vue.d.ts +0 -17
  273. package/dist/components/richtext/index.d.ts +0 -1
  274. package/dist/components/richtext/richtext.type.d.ts +0 -1
  275. package/dist/components/richtext/richtext.vue.d.ts +0 -3
  276. package/dist/components/ripple/index.d.ts +0 -1
  277. package/dist/components/ripple/ripple.type.d.ts +0 -3
  278. package/dist/components/ripple/ripple.vue.d.ts +0 -5
  279. package/dist/components/screen/index.d.ts +0 -1
  280. package/dist/components/screen/screen.type.d.ts +0 -1
  281. package/dist/components/screen/screen.vue.d.ts +0 -3
  282. package/dist/components/screen-router/factory.d.ts +0 -19
  283. package/dist/components/screen-router/index.d.ts +0 -2
  284. package/dist/components/screen-router/screen-router.type.d.ts +0 -8
  285. package/dist/components/screen-router/screen-router.vue.d.ts +0 -9
  286. package/dist/components/sheet/index.d.ts +0 -1
  287. package/dist/components/sheet/sheet.type.d.ts +0 -18
  288. package/dist/components/sheet/sheet.vue.d.ts +0 -18
  289. package/dist/components/skeleton/index.d.ts +0 -1
  290. package/dist/components/skeleton/skeleton.type.d.ts +0 -6
  291. package/dist/components/skeleton/skeleton.vue.d.ts +0 -8
  292. package/dist/components/switch/index.d.ts +0 -1
  293. package/dist/components/switch/switch.type.d.ts +0 -7
  294. package/dist/components/switch/switch.vue.d.ts +0 -9
  295. package/dist/components/tab/index.d.ts +0 -1
  296. package/dist/components/tab/tab.type.d.ts +0 -4
  297. package/dist/components/tab/tab.vue.d.ts +0 -5
  298. package/dist/components/tabs/index.d.ts +0 -1
  299. package/dist/components/tabs/tabs.type.d.ts +0 -13
  300. package/dist/components/tabs/tabs.vue.d.ts +0 -15
  301. package/dist/components/text/index.d.ts +0 -1
  302. package/dist/components/text/text.type.d.ts +0 -4
  303. package/dist/components/text/text.vue.d.ts +0 -6
  304. package/dist/components/textarea/index.d.ts +0 -1
  305. package/dist/components/textarea/textarea.type.d.ts +0 -1
  306. package/dist/components/textarea/textarea.vue.d.ts +0 -3
  307. package/dist/components/toast/factory.d.ts +0 -3
  308. package/dist/components/toast/index.d.ts +0 -2
  309. package/dist/components/toast/toast.type.d.ts +0 -11
  310. package/dist/components/toast/toast.vue.d.ts +0 -16
  311. package/dist/components/toggle-password/index.d.ts +0 -1
  312. package/dist/components/toggle-password/toggle-password.type.d.ts +0 -6
  313. package/dist/components/toggle-password/toggle-password.vue.d.ts +0 -9
  314. package/dist/components/toolbar/index.d.ts +0 -1
  315. package/dist/components/toolbar/toolbar.type.d.ts +0 -5
  316. package/dist/components/toolbar/toolbar.vue.d.ts +0 -7
  317. package/dist/factory.d.ts +0 -4
  318. package/dist/index.css +0 -1
  319. package/dist/index.d.ts +0 -4
  320. package/dist/index.es.js +0 -1836
  321. package/dist/index.umd.js +0 -1
  322. package/dist/utils/element.d.ts +0 -2
  323. package/dist/utils/events.d.ts +0 -1
  324. package/dist/utils/index.d.ts +0 -2
package/dist/index.es.js DELETED
@@ -1,1836 +0,0 @@
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")
17
- ]);
18
- }
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",
26
- props: {
27
- keepalive: { type: Boolean, default: !0 },
28
- visible: { type: Boolean, default: !1 },
29
- backdrop: { type: Boolean, default: !0 },
30
- placement: { default: "bottom" },
31
- style: {},
32
- class: {},
33
- bounce: {},
34
- duration: { default: 200 }
35
- },
36
- emits: ["dismiss"],
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,
52
- backdropOpacity: "0.4",
53
- contentOpacity: "1"
54
- }), setTimeout(() => {
55
- m({
56
- contentTransform: "0px"
57
- });
58
- }, a.duration);
59
- } else
60
- m({
61
- contentTransform: "0px",
62
- transition: v.value,
63
- backdropOpacity: "0.4",
64
- contentOpacity: "1"
65
- });
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,
72
- backdropOpacity: "0"
73
- });
74
- };
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;
80
- }, 200));
81
- }), o({
82
- render: m,
83
- open: h,
84
- close: f
85
- });
86
- const I = (T) => {
87
- T.preventDefault(), c("dismiss", "backdrop");
88
- };
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;
96
- }
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",
123
- props: {
124
- size: { default: "24px" },
125
- color: { default: "var(--toife-color-text)" }
126
- },
127
- setup(r, { expose: o }) {
128
- o();
129
- const t = {};
130
- return Object.defineProperty(t, "__isScriptSetup", { enumerable: !1, value: !0 }), t;
131
- }
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",
147
- props: {
148
- color: { default: null },
149
- size: { default: "standard" },
150
- rounded: { type: Boolean, default: !1 },
151
- block: { type: Boolean, default: !1 },
152
- loading: { type: Boolean, default: !1 },
153
- loadingType: { default: "spinner" },
154
- variant: { default: "default" },
155
- activeBackground: { type: Boolean, default: !1 }
156
- },
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 = {
162
- "--border": "none",
163
- "--color": "var(--toife-color-status-" + t.color + "-text)",
164
- "--background": "var(--toife-color-status-" + t.color + ")"
165
- } : n = {
166
- "--border": "none",
167
- "--color": "var(--toife-color-text)",
168
- "--background": t.color
169
- } : n = {
170
- "--border": "none",
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 = {
174
- "--border": "none",
175
- "--color": "var(--toife-color-status-" + t.color + ")",
176
- "--background": "transparent"
177
- } : n = {
178
- "--border": "none",
179
- "--color": t.color,
180
- "--background": "transparent"
181
- } : n = {
182
- "--border": "none",
183
- "--color": "var(--toife-color-text)",
184
- "--background": "transparent"
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 + ")",
188
- "--background": "transparent"
189
- } : n = {
190
- "--border": "0.55px solid " + t.color,
191
- "--color": t.color,
192
- "--background": "transparent"
193
- } : n = {
194
- "--border": "0.55px solid var(--toife-color-text)",
195
- "--color": "var(--toife-color-text)",
196
- "--background": "transparent"
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
- }
203
- }), De = {
204
- class: /* @__PURE__ */ p({ "toife-button-content": !0 })
205
- }, Ne = {
206
- key: 0,
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",
229
- props: {
230
- actions: { default: () => [] },
231
- visible: { type: Boolean, default: !1 },
232
- dismiss: { default: () => [] }
233
- },
234
- emits: ["dismiss"],
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;
245
- }, 300));
246
- };
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;
259
- }
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) => ({
295
- open() {
296
- return new Promise((t) => {
297
- let e = document.body.querySelector(".toife-app");
298
- if (!e) return;
299
- const s = document.createElement("div"), n = u();
300
- e.appendChild(s);
301
- const l = re({
302
- render() {
303
- return oe(o || be, {
304
- ...r,
305
- ref: n,
306
- onDismiss: (a, c) => {
307
- setTimeout(() => {
308
- l.unmount(), s.remove();
309
- }, 300), t({ type: a, data: c });
310
- }
311
- });
312
- }
313
- });
314
- l.mount(s), setTimeout(() => {
315
- n.value?.open?.();
316
- }, 50);
317
- });
318
- }
319
- }), Me = /* @__PURE__ */ k({
320
- __name: "alert",
321
- props: {
322
- title: { default: "" },
323
- message: { default: "" },
324
- actions: { default: () => [] },
325
- dismiss: { default: () => [] }
326
- },
327
- emits: ["dismiss"],
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;
336
- }, 300));
337
- };
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)
381
- }, {
382
- default: D(() => [
383
- F(V(l.text), 1)
384
- ]),
385
- _: 2
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) => ({
395
- open() {
396
- return new Promise((t) => {
397
- let e = document.body.querySelector(".toife-app");
398
- if (!e) return;
399
- const s = document.createElement("div"), n = u();
400
- e.appendChild(s);
401
- const l = re({
402
- render() {
403
- return oe(o || ge, {
404
- ...r,
405
- ref: n,
406
- onDismiss: (a, c) => {
407
- setTimeout(() => {
408
- l.unmount(), s.remove();
409
- }, 300), t({ type: a, data: c });
410
- }
411
- });
412
- }
413
- });
414
- l.mount(s), setTimeout(() => {
415
- n.value?.open?.();
416
- }, 50);
417
- });
418
- }
419
- }), Ge = /* @__PURE__ */ k({
420
- __name: "avatar",
421
- props: {
422
- square: { type: Boolean, default: !1 },
423
- size: { default: "standard" }
424
- },
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;
429
- }
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;
445
- }
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 = {
458
- reset() {
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;
463
- }, 400);
464
- },
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}`));
469
- },
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();
475
- }, 400);
476
- },
477
- next(r) {
478
- if (!H.value) return;
479
- if (R.value == -1) {
480
- R.value += 1, r && r();
481
- return;
482
- }
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();
488
- }, 400);
489
- }, 100);
490
- }
491
- }, le = {
492
- reset() {
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;
497
- }, 400);
498
- },
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}`));
502
- },
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();
508
- }, 400);
509
- },
510
- next(r) {
511
- if (!H.value) return;
512
- if (R.value == -1) {
513
- R.value += 1, r && r();
514
- return;
515
- }
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();
521
- }, 400);
522
- }, 100);
523
- }
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,
561
- nextScreen: H
562
- }), it = /* @__PURE__ */ k({
563
- __name: "screen-router",
564
- props: {
565
- variant: { default: "scale" },
566
- router: {},
567
- route: {}
568
- },
569
- emits: ["change"],
570
- setup(r, { expose: o, emit: t }) {
571
- o();
572
- let e = {};
573
- const s = t, n = r;
574
- let l;
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,
581
- target: null,
582
- component: pe(e[f] || null)
583
- });
584
- }, m = (f, I) => {
585
- !I || _.screens[f].target || (_.addScreenEl(f, I.$el), _.nextScreen && _.next(n.variant, () => {
586
- s("change");
587
- }));
588
- };
589
- z(() => c.name, (f, I) => {
590
- f != _.currentScreen.value?.name && (_.lastScreen.value?.name == f ? _.back(n.variant, () => {
591
- s("change");
592
- }) : v(c.name));
593
- }), A(() => {
594
- v(c.name), l = L(document.body, {
595
- beforeEvent(f) {
596
- return !!_.isSwipeable.value;
597
- },
598
- fast({ initialDirection: f }) {
599
- _.lastScreen.value && f == "right" && a.back();
600
- },
601
- move({ deltaX: f, initialDirection: I }) {
602
- I == "right" && _.move(n.variant, f);
603
- },
604
- up({ deltaX: f, initialDirection: I }) {
605
- if (I != "right") {
606
- _.reset(n.variant);
607
- return;
608
- }
609
- const P = g.value.offsetParent.offsetWidth;
610
- f / P * 100 >= 50 ? a.back() : _.reset(n.variant);
611
- },
612
- cancel() {
613
- _.reset(n.variant);
614
- }
615
- });
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;
639
- }
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",
663
- props: {
664
- to: {},
665
- router: {}
666
- },
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) => {
670
- if (e.onBack) {
671
- e.onBack(c);
672
- return;
673
- }
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;
681
- }
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;
708
- }
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",
718
- props: {
719
- keyboard: { type: Boolean, default: !1 },
720
- placement: { default: "bottom" }
721
- },
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;
732
- }
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",
744
- props: {
745
- color: { default: null }
746
- },
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;
760
- }
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",
772
- props: {
773
- label: { default: "" },
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" }
780
- },
781
- emits: ["update:modelValue"],
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);
834
- };
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
858
- }, [
859
- $(r.$slots, "icon"),
860
- S("div", Ct, [
861
- $(r.$slots, "title", {}, () => [
862
- F(V(e.props.title), 1)
863
- ])
864
- ]),
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;
906
- }
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);
932
- }
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);
948
- }
949
- const xe = /* @__PURE__ */ x(Gt, [["render", Ut], ["__scopeId", "data-v-65133446"]]), Jt = /* @__PURE__ */ k({
950
- __name: "grid",
951
- props: {
952
- gap: { default: 0 },
953
- template: { default: "repeat(1, 1fr) / repeat(1, 1fr)" }
954
- },
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;
959
- }
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",
971
- props: {
972
- defaultSrc: {},
973
- src: {}
974
- },
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;
985
- }
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",
995
- props: {
996
- color: { default: "var(--toife-color-text)" },
997
- size: { default: "standard" }
998
- },
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
1006
- };
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
1120
- });
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");
1196
- };
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;
1264
- }
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",
1271
- props: {
1272
- color: { default: "primary" }
1273
- },
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;
1287
- }
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",
1297
- props: {
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: {}
1311
- },
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);
1328
- };
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 })
1403
- }, [
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;
1426
- }
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",
1436
- props: {
1437
- modelValue: { type: Boolean },
1438
- color: { default: "primary" }
1439
- },
1440
- emits: ["update:modelValue"],
1441
- setup(r, { expose: o, emit: t }) {
1442
- o();
1443
- const e = r, s = t, n = () => {
1444
- s("update:modelValue", !e.modelValue);
1445
- }, l = b(() => {
1446
- let c = {
1447
- "--background": e.color,
1448
- "--color": "#ffffff"
1449
- };
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;
1456
- }
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",
1471
- props: {
1472
- value: {},
1473
- disabled: { type: Boolean, default: !1 }
1474
- },
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;
1483
- }
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",
1504
- props: {
1505
- placement: { default: "top-start" },
1506
- variant: { default: "border-under" },
1507
- color: { default: "primary" },
1508
- modelValue: {},
1509
- border: { default: 30 },
1510
- size: { default: "standard" },
1511
- margin: { default: [0, 0] },
1512
- radius: { default: 4 }
1513
- },
1514
- emits: ["update:modelValue"],
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,
1522
- "--border": e.border + "px"
1523
- } : e.variant == "tag" ? {
1524
- "--top": e.margin[0] + "px",
1525
- "--height": a.value - e.margin[0] * 2 + "px",
1526
- "--left": e.margin[1] + "px",
1527
- "--width": l.value - e.margin[1] * 2 + "px",
1528
- "--transform": n.value,
1529
- "--radius": e.radius + "px"
1530
- } : {}), g = () => {
1531
- if (e.variant == "border-under") {
1532
- let m = c.value.querySelector(".active");
1533
- if (m) {
1534
- if (e.placement.startsWith("top-") || e.placement.startsWith("bottom-")) {
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";
1537
- } else if (e.placement.startsWith("left-") || e.placement.startsWith("right-")) {
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";
1540
- }
1541
- }
1542
- }
1543
- if (e.variant == "tag") {
1544
- let m = c.value.querySelector(".active");
1545
- if (m) {
1546
- let h = m.offsetWidth, f = m.offsetHeight;
1547
- if (e.placement.startsWith("top-") || e.placement.startsWith("bottom-")) {
1548
- let I = m.getBoundingClientRect().left - c.value.getBoundingClientRect().left + c.value.scrollLeft;
1549
- n.value = I + "px";
1550
- } else if (e.placement.startsWith("left-") || e.placement.startsWith("right-")) {
1551
- let I = m.getBoundingClientRect().top - c.value.getBoundingClientRect().top + c.value.scrollTop;
1552
- n.value = I + "px";
1553
- }
1554
- l.value = h, a.value = f;
1555
- }
1556
- }
1557
- };
1558
- Q("tabsState", {
1559
- activeValue: b(() => e.modelValue),
1560
- color: d.value,
1561
- size: e.size,
1562
- variant: e.variant,
1563
- setValue: (m) => {
1564
- s("update:modelValue", m);
1565
- }
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;
1573
- }
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;
1590
- }
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",
1601
- props: {
1602
- message: {},
1603
- space: { default: "0px" },
1604
- placement: { default: "bottom" },
1605
- color: { default: null },
1606
- variant: { default: "default" },
1607
- visible: { type: Boolean, default: !1 }
1608
- },
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;
1669
- }
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
- }
1702
- });
1703
- n.mount(e), setTimeout(() => {
1704
- s.value?.open?.(), setTimeout(() => {
1705
- s.value?.close?.();
1706
- }, (r.duration || 2e3) + 10);
1707
- }, 50);
1708
- }
1709
- }), Fr = /* @__PURE__ */ k({
1710
- __name: "toggle-password",
1711
- props: {
1712
- color: { default: "warning" }
1713
- },
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 }), _;
1732
- }
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",
1751
- props: {
1752
- placement: { default: null },
1753
- safe: { type: Boolean, default: !0 },
1754
- size: { default: "50px" }
1755
- },
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;
1760
- }
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" }));
1790
- export {
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
1836
- };