@oneb/ui-vue 0.3.32 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ChevronLeftIcon-7505e081.cjs +1 -0
- package/dist/ChevronLeftIcon-bb9adb5b.js +20 -0
- package/dist/ChevronRightIcon-2992cf0d.cjs +1 -0
- package/dist/ChevronRightIcon-b0585768.js +20 -0
- package/dist/ChevronUpIcon-64a673e1.cjs +1 -0
- package/dist/{ChevronRightIcon-4549a26b.js → ChevronUpIcon-c43f27a9.js} +2 -19
- package/dist/LogoOneb-b6ac382e.cjs +1 -0
- package/dist/LogoOneb-ddb388a4.js +16 -0
- package/dist/MagnifyingGlassIcon-adf871ba.cjs +1 -0
- package/dist/MagnifyingGlassIcon-ca213d3d.js +20 -0
- package/dist/OneDropdownAuto.vue_vue_type_script_setup_true_lang-2c508e8a.js +79 -0
- package/dist/OneDropdownAuto.vue_vue_type_script_setup_true_lang-bf923b04.cjs +1 -0
- package/dist/OneFormInput.vue_vue_type_script_setup_true_lang-b89117e7.js +521 -0
- package/dist/OneFormInput.vue_vue_type_script_setup_true_lang-f6f7cd96.cjs +1 -0
- package/dist/{OneHelpMenu-73817f8a.js → OneHelpMenu-2a2051d7.js} +120 -214
- package/dist/OneHelpMenu-78d9348a.cjs +1 -0
- package/dist/OneMarkdown.vue_vue_type_script_setup_true_lang-05266fc3.cjs +1 -0
- package/dist/OneMarkdown.vue_vue_type_script_setup_true_lang-bb2219c7.js +18 -0
- package/dist/OneModal-02a9a173.js +189 -0
- package/dist/OneModal-0e92c039.cjs +1 -0
- package/dist/OneTooltip.vue_vue_type_script_setup_true_lang-c492c128.js +25 -0
- package/dist/OneTooltip.vue_vue_type_script_setup_true_lang-e83a81ea.cjs +1 -0
- package/dist/SpinnerIcon-01be39fe.cjs +1 -0
- package/dist/{SpinnerIcon-74648c98.js → SpinnerIcon-516264ba.js} +5 -6
- package/dist/button/index.cjs +1 -1
- package/dist/button/index.d.ts +1 -1
- package/dist/button/index.js +3 -4
- package/dist/checkbox/checkbox.d.ts +5 -0
- package/dist/checkbox/index.cjs +1 -1
- package/dist/checkbox/index.js +40 -34
- package/dist/chips/OneChips.vue.d.ts +2 -0
- package/dist/chips/chips.d.ts +25 -0
- package/dist/chips/index.cjs +1 -0
- package/dist/chips/index.d.ts +3 -0
- package/dist/chips/index.js +62 -0
- package/dist/clipboard-494e1513.cjs +1 -0
- package/dist/clipboard-733b79a1.js +22 -0
- package/dist/common/OneDetailsList.vue.d.ts +2 -0
- package/dist/common/OneDetailsRow.vue.d.ts +2 -0
- package/dist/common/index.cjs +1 -1
- package/dist/common/index.d.ts +2 -0
- package/dist/common/index.js +68 -16
- package/dist/composables/index.cjs +1 -0
- package/dist/composables/index.d.ts +18 -0
- package/dist/composables/index.js +91 -0
- package/dist/composables/useAsyncMethod.d.ts +17 -0
- package/dist/composables/useAsyncSelect.d.ts +26 -0
- package/dist/composables/useConfirm.d.ts +27 -0
- package/dist/composables/useCursorList.d.ts +42 -0
- package/dist/composables/useDebouncedRef.d.ts +6 -0
- package/dist/composables/useFileUpload.d.ts +21 -0
- package/dist/composables/useFormSubmit.d.ts +23 -0
- package/dist/composables/useIsMobile.d.ts +8 -0
- package/dist/confirm/OneConfirmHost.vue.d.ts +2 -0
- package/dist/confirm/confirm.d.ts +10 -0
- package/dist/confirm/index.cjs +1 -0
- package/dist/confirm/index.d.ts +5 -0
- package/dist/confirm/index.js +59 -0
- package/dist/cursorList/OneCursorList.vue.d.ts +2 -0
- package/dist/cursorList/index.cjs +1 -0
- package/dist/cursorList/index.d.ts +3 -0
- package/dist/cursorList/index.js +78 -0
- package/dist/dataTable/index.cjs +1 -1
- package/dist/dataTable/index.js +256 -301
- package/dist/dateTime/OneDateTime.vue.d.ts +2 -0
- package/dist/dateTime/dateTime.d.ts +43 -0
- package/dist/dateTime/index.cjs +1 -0
- package/dist/dateTime/index.d.ts +3 -0
- package/dist/dateTime/index.js +66 -0
- package/dist/dropdown/index.cjs +1 -1
- package/dist/dropdown/index.js +302 -376
- package/dist/dropdown-5cb64ab7.cjs +1 -0
- package/dist/dropdown-c81fb945.js +101 -0
- package/dist/entityPicker/index.cjs +1 -1
- package/dist/entityPicker/index.js +57 -57
- package/dist/entityPicker/useEntityModal.d.ts +7 -3
- package/dist/errorsPage/OneCrashScreen.vue.d.ts +2 -0
- package/dist/errorsPage/OneErrorHero.vue.d.ts +2 -0
- package/dist/errorsPage/OneNotFoundPage.vue.d.ts +2 -0
- package/dist/errorsPage/OneServerErrorPage.vue.d.ts +2 -0
- package/dist/errorsPage/OneSnakeGame.vue.d.ts +2 -0
- package/dist/errorsPage/createAppErrorHandler.d.ts +24 -0
- package/dist/errorsPage/errorsType.d.ts +5 -0
- package/dist/errorsPage/index.cjs +1 -1
- package/dist/errorsPage/index.d.ts +8 -0
- package/dist/errorsPage/index.js +543 -28
- package/dist/errorsPage/useCrashState.d.ts +10 -0
- package/dist/fileUpload/OneDropzone.vue.d.ts +2 -0
- package/dist/fileUpload/OneFileUpload.vue.d.ts +2 -0
- package/dist/fileUpload/fileUpload.d.ts +17 -0
- package/dist/fileUpload/index.cjs +1 -0
- package/dist/fileUpload/index.d.ts +6 -0
- package/dist/fileUpload/index.js +228 -0
- package/dist/filterBuilder/OneFilterBuilder.vue.d.ts +2 -0
- package/dist/filterBuilder/OneFilterGroup.vue.d.ts +2 -0
- package/dist/filterBuilder/OneFilterRule.vue.d.ts +2 -0
- package/dist/filterBuilder/filterBuilder.d.ts +17 -0
- package/dist/filterBuilder/index.cjs +1 -0
- package/dist/filterBuilder/index.d.ts +5 -0
- package/dist/filterBuilder/index.js +268 -0
- package/dist/form/form.d.ts +1 -1
- package/dist/form/index.cjs +1 -1
- package/dist/form/index.js +66 -574
- package/dist/i18n/index.cjs +1 -1
- package/dist/i18n/index.js +101 -15
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +18 -0
- package/dist/index.js +244 -104
- package/dist/indicators/OneStatCard.vue.d.ts +2 -0
- package/dist/indicators/index.cjs +1 -1
- package/dist/indicators/index.d.ts +1 -0
- package/dist/indicators/index.js +66 -29
- package/dist/label/index.cjs +1 -1
- package/dist/label/index.js +5 -5
- package/dist/layout/LogoOneb.vue.d.ts +2 -0
- package/dist/layout/OneAuthLayout.vue.d.ts +2 -0
- package/dist/layout/OneBackButton.vue.d.ts +2 -0
- package/dist/layout/OneBreadcrumbs.vue.d.ts +2 -0
- package/dist/layout/OneEmptyLayout.vue.d.ts +6 -0
- package/dist/layout/OneGridLayout.vue.d.ts +2 -0
- package/dist/layout/index.cjs +1 -1
- package/dist/layout/index.d.ts +7 -1
- package/dist/layout/index.js +1059 -765
- package/dist/layout/layout.d.ts +11 -0
- package/dist/modal/OneModalHost.vue.d.ts +2 -0
- package/dist/modal/index.cjs +1 -1
- package/dist/modal/index.d.ts +3 -0
- package/dist/modal/index.js +84 -27
- package/dist/modal/modal.d.ts +9 -0
- package/dist/modal/useModalStack.d.ts +20 -0
- package/dist/notifications/OneNotificationItem.vue.d.ts +2 -0
- package/dist/notifications/OneNotificationsBell.vue.d.ts +2 -0
- package/dist/notifications/OneNotificationsPanel.vue.d.ts +2 -0
- package/dist/notifications/index.cjs +1 -0
- package/dist/notifications/index.d.ts +7 -0
- package/dist/notifications/index.js +477 -0
- package/dist/notifications/notifications.d.ts +53 -0
- package/dist/notifications/useNotifyfeed.d.ts +32 -0
- package/dist/periodPicker/index.cjs +1 -1
- package/dist/periodPicker/index.js +126 -139
- package/dist/popover/OnePopover.vue.d.ts +2 -0
- package/dist/popover/index.cjs +1 -0
- package/dist/popover/index.d.ts +3 -0
- package/dist/popover/index.js +104 -0
- package/dist/popover/popover.d.ts +31 -0
- package/dist/progress/OneProgress.vue.d.ts +2 -0
- package/dist/progress/index.cjs +1 -0
- package/dist/progress/index.d.ts +3 -0
- package/dist/progress/index.js +74 -0
- package/dist/progress/progress.d.ts +32 -0
- package/dist/searchInput/OneSearchInput.vue.d.ts +2 -0
- package/dist/searchInput/index.cjs +1 -0
- package/dist/searchInput/index.d.ts +3 -0
- package/dist/searchInput/index.js +103 -0
- package/dist/searchInput/searchInput.d.ts +39 -0
- package/dist/settings/OneSettingsLayout.vue.d.ts +2 -0
- package/dist/settings/OneSettingsRow.vue.d.ts +2 -0
- package/dist/settings/OneSettingsSection.vue.d.ts +2 -0
- package/dist/settings/index.cjs +1 -0
- package/dist/settings/index.d.ts +4 -0
- package/dist/settings/index.js +116 -0
- package/dist/spinner/OneSpinner.vue.d.ts +2 -0
- package/dist/spinner/index.cjs +1 -0
- package/dist/spinner/index.d.ts +3 -0
- package/dist/spinner/index.js +30 -0
- package/dist/spinner/spinner.d.ts +10 -0
- package/dist/stageBadge/index.cjs +1 -1
- package/dist/stageBadge/index.js +18 -16
- package/dist/stepper/OneStepper.vue.d.ts +2 -0
- package/dist/stepper/index.cjs +1 -0
- package/dist/stepper/index.d.ts +3 -0
- package/dist/stepper/index.js +53 -0
- package/dist/stepper/stepper.d.ts +24 -0
- package/dist/style.css +1 -1
- package/dist/switch/index.cjs +1 -1
- package/dist/switch/index.js +3 -4
- package/dist/tabs/OneTab.vue.d.ts +2 -0
- package/dist/tabs/OneTabs.vue.d.ts +2 -0
- package/dist/tabs/index.cjs +1 -0
- package/dist/tabs/index.d.ts +4 -0
- package/dist/tabs/index.js +64 -0
- package/dist/tabs/tabs.d.ts +7 -0
- package/dist/toast/OneMascotToast.vue.d.ts +2 -0
- package/dist/toast/RabbitIcon.vue.d.ts +2 -0
- package/dist/toast/index.cjs +1 -1
- package/dist/toast/index.d.ts +4 -0
- package/dist/toast/index.js +139 -74
- package/dist/toast/useMascotToast.d.ts +12 -0
- package/dist/tooltip/OneTooltip.vue.d.ts +2 -0
- package/dist/tooltip/index.cjs +2 -2
- package/dist/tooltip/index.d.ts +1 -0
- package/dist/tooltip/index.js +33 -30
- package/dist/useConfirm-6344b49d.cjs +1 -0
- package/dist/useConfirm-74e99a5c.js +23 -0
- package/dist/useCursorList-5c1b57aa.js +62 -0
- package/dist/useCursorList-e1cb41e7.cjs +1 -0
- package/dist/useElementWidth-b36a7ce9.js +40 -0
- package/dist/useElementWidth-b3e53f48.cjs +1 -0
- package/dist/useFileUpload-228dbc07.js +24 -0
- package/dist/useFileUpload-f47622bb.cjs +1 -0
- package/dist/useIsMobile-7b1f08cf.cjs +1 -0
- package/dist/useIsMobile-98fc0cf9.js +7 -0
- package/dist/useMediaQuery-1d87df02.cjs +1 -0
- package/dist/useMediaQuery-77a19b18.js +37 -0
- package/dist/useModal-6a5d870b.js +30 -0
- package/dist/useModal-aa6f4a57.cjs +1 -0
- package/dist/userList/OneUserInviteModal.vue.d.ts +2 -0
- package/dist/userList/OneUserList.vue.d.ts +2 -0
- package/dist/userList/OneUserListItem.vue.d.ts +2 -0
- package/dist/userList/index.cjs +1 -0
- package/dist/userList/index.d.ts +4 -0
- package/dist/userList/index.js +559 -0
- package/dist/utils/clipboard.d.ts +6 -0
- package/dist/utils/format.d.ts +17 -0
- package/dist/utils/index.cjs +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.js +125 -0
- package/dist/utils/string.d.ts +25 -0
- package/dist/utils/versionChecker.d.ts +26 -0
- package/package.json +215 -24
- package/dist/ChevronRightIcon-7a2f0c20.cjs +0 -1
- package/dist/OneHelpMenu-c6e88d8f.cjs +0 -1
- package/dist/OneMarkdown.vue_vue_type_style_index_0_lang-0ea8fbf8.cjs +0 -1
- package/dist/OneMarkdown.vue_vue_type_style_index_0_lang-4ed993c7.js +0 -1
- package/dist/SpinnerIcon-ccb6f3fc.cjs +0 -1
- package/dist/SpinnerIcon.vue_vue_type_style_index_0_lang-0ea8fbf8.cjs +0 -1
- package/dist/SpinnerIcon.vue_vue_type_style_index_0_lang-4ed993c7.js +0 -1
- package/dist/useModal-0c73777f.cjs +0 -1
- package/dist/useModal-7fe9444b.js +0 -194
package/dist/errorsPage/index.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { defineComponent as T, computed as b, resolveComponent as N, openBlock as n, createElementBlock as u, createElementVNode as t, toDisplayString as r, createCommentVNode as h, createTextVNode as C, createVNode as I, withCtx as q, useSlots as re, normalizeClass as G, renderSlot as z, createBlock as Q, ref as x, onMounted as ae, onUnmounted as ne, normalizeStyle as le, Fragment as ue, renderList as ie, createSlots as W, onBeforeUnmount as X, watch as ce, unref as de } from "vue";
|
|
2
|
+
import { useOnebI18n as L } from "../i18n/index.js";
|
|
3
|
+
import { _ as Y } from "../_plugin-vue_export-helper-dad06003.js";
|
|
4
|
+
import { useRouter as me } from "vue-router";
|
|
5
|
+
import { L as ve } from "../LogoOneb-ddb388a4.js";
|
|
6
|
+
import { c as fe } from "../clipboard-733b79a1.js";
|
|
7
|
+
const ge = {
|
|
4
8
|
statusMessage: {
|
|
5
9
|
type: String,
|
|
6
10
|
required: !1
|
|
@@ -16,48 +20,559 @@ const E = {
|
|
|
16
20
|
statusCode: {
|
|
17
21
|
type: String,
|
|
18
22
|
default: "403"
|
|
23
|
+
},
|
|
24
|
+
t: {
|
|
25
|
+
type: Function,
|
|
26
|
+
default: void 0
|
|
19
27
|
}
|
|
20
|
-
},
|
|
28
|
+
}, ye = T({
|
|
21
29
|
name: "ErrorPage",
|
|
22
|
-
props:
|
|
30
|
+
props: ge,
|
|
31
|
+
setup(e) {
|
|
32
|
+
const o = L();
|
|
33
|
+
return { t: b(() => e.t ?? o) };
|
|
34
|
+
}
|
|
23
35
|
});
|
|
24
|
-
const
|
|
36
|
+
const pe = { class: "error-container" }, xe = { class: "text-8xl text-secondary-content" }, he = { key: 0 }, _e = {
|
|
25
37
|
key: 1,
|
|
26
38
|
class: "pt-5"
|
|
27
|
-
},
|
|
28
|
-
function
|
|
29
|
-
const
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
}, be = { class: "request-info hidden" };
|
|
40
|
+
function ke(e, o, g, s, v, f) {
|
|
41
|
+
const i = N("router-link");
|
|
42
|
+
return n(), u("div", pe, [
|
|
43
|
+
t("h1", xe, r(e.statusCode), 1),
|
|
44
|
+
e.statusMessage ? (n(), u("p", he, r(e.statusMessage), 1)) : h("", !0),
|
|
45
|
+
o[3] || (o[3] = t("div", { class: "border-b border-secondary-stroke w-full pt-10" }, null, -1)),
|
|
46
|
+
e.statusText ? (n(), u("p", _e, r(e.statusText), 1)) : h("", !0),
|
|
47
|
+
t("div", be, [
|
|
48
|
+
t("p", null, [
|
|
49
|
+
o[0] || (o[0] = t("strong", null, "Request ID:", -1)),
|
|
50
|
+
C(" " + r(e.requestId), 1)
|
|
39
51
|
]),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
52
|
+
o[1] || (o[1] = t("button", { class: "copy-btn" }, "Скопіювати", -1)),
|
|
53
|
+
o[2] || (o[2] = t("p", null, [
|
|
54
|
+
C(" Передайте цю інформацію розробнику або напишіть в "),
|
|
55
|
+
t("a", {
|
|
44
56
|
href: "https://t.me/telegram_bot",
|
|
45
57
|
target: "_blank"
|
|
46
58
|
}, "Telegram-бот")
|
|
47
59
|
], -1))
|
|
48
60
|
]),
|
|
49
|
-
|
|
61
|
+
I(i, {
|
|
50
62
|
to: "/",
|
|
51
63
|
class: "home-link"
|
|
52
64
|
}, {
|
|
53
|
-
default:
|
|
54
|
-
|
|
55
|
-
])
|
|
65
|
+
default: q(() => [
|
|
66
|
+
C(r(e.t("ui.errors.go_home")), 1)
|
|
67
|
+
]),
|
|
56
68
|
_: 1
|
|
57
69
|
})
|
|
58
70
|
]);
|
|
59
71
|
}
|
|
60
|
-
const
|
|
72
|
+
const gt = /* @__PURE__ */ Y(ye, [["render", ke], ["__scopeId", "data-v-4ac01274"]]), we = { class: "flex items-center justify-center gap-2 sm:gap-4" }, Se = { class: "relative" }, $e = { class: "one-error-logo-bounce" }, Ce = ["src"], Ee = {
|
|
73
|
+
key: 0,
|
|
74
|
+
class: "absolute inset-0 animate-ping opacity-20",
|
|
75
|
+
"aria-hidden": "true"
|
|
76
|
+
}, Te = ["src"], J = "text-[100px] sm:text-[160px] font-bold text-slate-200 leading-none select-none", Oe = /* @__PURE__ */ T({
|
|
77
|
+
__name: "OneErrorHero",
|
|
78
|
+
props: {
|
|
79
|
+
left: {
|
|
80
|
+
type: String,
|
|
81
|
+
required: !0
|
|
82
|
+
},
|
|
83
|
+
right: {
|
|
84
|
+
type: String,
|
|
85
|
+
required: !0
|
|
86
|
+
},
|
|
87
|
+
logoSrc: {
|
|
88
|
+
type: String,
|
|
89
|
+
default: void 0
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
setup(e) {
|
|
93
|
+
const o = re(), g = b(() => !!o.default);
|
|
94
|
+
return (s, v) => (n(), u("div", we, [
|
|
95
|
+
t("span", {
|
|
96
|
+
class: G(J)
|
|
97
|
+
}, r(e.left), 1),
|
|
98
|
+
t("div", Se, [
|
|
99
|
+
t("div", $e, [
|
|
100
|
+
z(s.$slots, "default", {}, () => [
|
|
101
|
+
e.logoSrc ? (n(), u("img", {
|
|
102
|
+
key: 0,
|
|
103
|
+
src: e.logoSrc,
|
|
104
|
+
class: "w-24 h-24 sm:w-36 sm:h-36",
|
|
105
|
+
alt: "Logo"
|
|
106
|
+
}, null, 8, Ce)) : (n(), Q(ve, {
|
|
107
|
+
key: 1,
|
|
108
|
+
class: "w-24 h-24 sm:w-36 sm:h-36"
|
|
109
|
+
}))
|
|
110
|
+
], !0)
|
|
111
|
+
]),
|
|
112
|
+
e.logoSrc && !g.value ? (n(), u("div", Ee, [
|
|
113
|
+
t("img", {
|
|
114
|
+
src: e.logoSrc,
|
|
115
|
+
class: "w-24 h-24 sm:w-36 sm:h-36",
|
|
116
|
+
alt: ""
|
|
117
|
+
}, null, 8, Te)
|
|
118
|
+
])) : h("", !0)
|
|
119
|
+
]),
|
|
120
|
+
t("span", {
|
|
121
|
+
class: G(J)
|
|
122
|
+
}, r(e.right), 1)
|
|
123
|
+
]));
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
const Z = /* @__PURE__ */ Y(Oe, [["__scopeId", "data-v-957a8a83"]]), Ie = { class: "w-full" }, qe = { class: "flex items-center justify-between mb-4" }, ze = { class: "flex items-center gap-4" }, Le = { class: "text-sm text-slate-600" }, Fe = {
|
|
127
|
+
class: "text-emerald-700",
|
|
128
|
+
"data-test": "snake-score"
|
|
129
|
+
}, je = {
|
|
130
|
+
key: 0,
|
|
131
|
+
class: "text-sm text-rose-600 font-medium",
|
|
132
|
+
"data-test": "snake-status"
|
|
133
|
+
}, Re = {
|
|
134
|
+
key: 1,
|
|
135
|
+
class: "text-sm text-emerald-700",
|
|
136
|
+
"data-test": "snake-status"
|
|
137
|
+
}, Me = {
|
|
138
|
+
key: 2,
|
|
139
|
+
class: "text-sm text-slate-500",
|
|
140
|
+
"data-test": "snake-status"
|
|
141
|
+
}, Be = { class: "flex gap-2" }, Ge = { class: "bg-slate-50 border border-slate-200 rounded-2xl p-4 shadow-sm" }, Ne = ["data-snake"], De = {
|
|
142
|
+
key: 0,
|
|
143
|
+
class: "absolute inset-1 rounded-md border border-emerald-800/40"
|
|
144
|
+
}, He = {
|
|
145
|
+
key: 1,
|
|
146
|
+
class: "absolute inset-2 rounded-sm bg-rose-600"
|
|
147
|
+
}, Pe = { class: "text-xs text-slate-500 text-center mt-3" }, Ue = /* @__PURE__ */ T({
|
|
148
|
+
__name: "OneSnakeGame",
|
|
149
|
+
props: {
|
|
150
|
+
gridSize: {
|
|
151
|
+
type: Number,
|
|
152
|
+
default: 15
|
|
153
|
+
},
|
|
154
|
+
tickMs: {
|
|
155
|
+
type: Number,
|
|
156
|
+
default: 170
|
|
157
|
+
},
|
|
158
|
+
t: {
|
|
159
|
+
type: Function,
|
|
160
|
+
default: void 0
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
emits: ["score", "game-over"],
|
|
164
|
+
setup(e, { expose: o, emit: g }) {
|
|
165
|
+
const s = e, v = g, f = L(), i = b(() => s.t ?? f), m = x([]), y = x({ x: 1, y: 0 }), k = x({ x: 1, y: 0 }), p = x({ x: 0, y: 0 }), w = x(0), _ = x(!1), d = x(!1);
|
|
166
|
+
let E = null;
|
|
167
|
+
const te = b(
|
|
168
|
+
() => Array.from({ length: s.gridSize * s.gridSize }, (l, a) => ({
|
|
169
|
+
x: a % s.gridSize,
|
|
170
|
+
y: Math.floor(a / s.gridSize)
|
|
171
|
+
}))
|
|
172
|
+
), R = (l) => {
|
|
173
|
+
var a, c;
|
|
174
|
+
return ((a = m.value[0]) == null ? void 0 : a.x) === l.x && ((c = m.value[0]) == null ? void 0 : c.y) === l.y;
|
|
175
|
+
}, D = (l) => m.value.some((a, c) => c !== 0 && a.x === l.x && a.y === l.y), M = (l) => p.value.x === l.x && p.value.y === l.y, H = (l) => {
|
|
176
|
+
const a = [];
|
|
177
|
+
for (let S = 0; S < s.gridSize; S += 1)
|
|
178
|
+
for (let $ = 0; $ < s.gridSize; $ += 1)
|
|
179
|
+
l.some((K) => K.x === $ && K.y === S) || a.push({ x: $, y: S });
|
|
180
|
+
if (a.length === 0)
|
|
181
|
+
return { x: 0, y: 0 };
|
|
182
|
+
const c = Math.floor(Math.random() * a.length);
|
|
183
|
+
return a[c];
|
|
184
|
+
}, F = () => {
|
|
185
|
+
E != null && (clearInterval(E), E = null), _.value = !1;
|
|
186
|
+
}, P = () => {
|
|
187
|
+
F(), d.value = !0, v("game-over", w.value);
|
|
188
|
+
}, O = () => {
|
|
189
|
+
F(), m.value = [
|
|
190
|
+
{
|
|
191
|
+
x: Math.floor(s.gridSize / 2),
|
|
192
|
+
y: Math.floor(s.gridSize / 2)
|
|
193
|
+
}
|
|
194
|
+
], y.value = { x: 1, y: 0 }, k.value = { x: 1, y: 0 }, p.value = H(m.value), w.value = 0, d.value = !1;
|
|
195
|
+
}, se = (l) => {
|
|
196
|
+
y.value.x + l.x === 0 && y.value.y + l.y === 0 || (k.value = l);
|
|
197
|
+
}, oe = () => {
|
|
198
|
+
y.value = k.value;
|
|
199
|
+
const l = m.value[0], a = { x: l.x + y.value.x, y: l.y + y.value.y };
|
|
200
|
+
if (a.x < 0 || a.x >= s.gridSize || a.y < 0 || a.y >= s.gridSize) {
|
|
201
|
+
P();
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
if (m.value.some(($) => $.x === a.x && $.y === a.y)) {
|
|
205
|
+
P();
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
const S = [a, ...m.value];
|
|
209
|
+
a.x === p.value.x && a.y === p.value.y ? (w.value += 1, v("score", w.value), p.value = H(S)) : S.pop(), m.value = S;
|
|
210
|
+
}, U = () => {
|
|
211
|
+
E != null || d.value || (_.value = !0, E = setInterval(oe, s.tickMs));
|
|
212
|
+
}, A = () => {
|
|
213
|
+
if (d.value) {
|
|
214
|
+
O();
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
_.value ? F() : U();
|
|
218
|
+
}, V = (l) => {
|
|
219
|
+
const a = l.key.toLowerCase(), c = {
|
|
220
|
+
arrowup: { x: 0, y: -1 },
|
|
221
|
+
w: { x: 0, y: -1 },
|
|
222
|
+
arrowdown: { x: 0, y: 1 },
|
|
223
|
+
s: { x: 0, y: 1 },
|
|
224
|
+
arrowleft: { x: -1, y: 0 },
|
|
225
|
+
a: { x: -1, y: 0 },
|
|
226
|
+
arrowright: { x: 1, y: 0 },
|
|
227
|
+
d: { x: 1, y: 0 }
|
|
228
|
+
};
|
|
229
|
+
c[a] ? (se(c[a]), !_.value && !d.value && U()) : a === " " ? (l.preventDefault(), d.value || A()) : a === "enter" && d.value && O();
|
|
230
|
+
};
|
|
231
|
+
return ae(() => {
|
|
232
|
+
O(), window.addEventListener("keydown", V);
|
|
233
|
+
}), ne(() => {
|
|
234
|
+
F(), window.removeEventListener("keydown", V);
|
|
235
|
+
}), o({ score: w, isRunning: _, isGameOver: d, resetGame: O }), (l, a) => (n(), u("div", Ie, [
|
|
236
|
+
t("div", qe, [
|
|
237
|
+
t("div", ze, [
|
|
238
|
+
t("span", Le, [
|
|
239
|
+
C(r(i.value("ui.errors.snake_score")) + ": ", 1),
|
|
240
|
+
t("strong", Fe, r(w.value), 1)
|
|
241
|
+
]),
|
|
242
|
+
d.value ? (n(), u("span", je, r(i.value("ui.errors.snake_game_over")), 1)) : _.value ? (n(), u("span", Re, r(i.value("ui.errors.snake_running")), 1)) : (n(), u("span", Me, r(i.value("ui.errors.snake_paused")), 1))
|
|
243
|
+
]),
|
|
244
|
+
t("div", Be, [
|
|
245
|
+
t("button", {
|
|
246
|
+
type: "button",
|
|
247
|
+
class: "px-3 py-1.5 rounded-lg text-sm text-white bg-emerald-600 hover:bg-emerald-700 transition",
|
|
248
|
+
"data-test": "snake-toggle",
|
|
249
|
+
onClick: A
|
|
250
|
+
}, r(d.value ? i.value("ui.errors.snake_restart") : _.value ? i.value("ui.errors.snake_pause") : i.value("ui.errors.snake_start")), 1),
|
|
251
|
+
t("button", {
|
|
252
|
+
type: "button",
|
|
253
|
+
class: "px-3 py-1.5 rounded-lg text-sm border border-slate-300 text-slate-700 hover:bg-slate-50 transition",
|
|
254
|
+
"data-test": "snake-reset",
|
|
255
|
+
onClick: O
|
|
256
|
+
}, r(i.value("ui.errors.snake_reset")), 1)
|
|
257
|
+
])
|
|
258
|
+
]),
|
|
259
|
+
t("div", Ge, [
|
|
260
|
+
t("div", {
|
|
261
|
+
class: "w-full mx-auto",
|
|
262
|
+
style: le({ display: "grid", gridTemplateColumns: `repeat(${e.gridSize}, minmax(0, 1fr))` })
|
|
263
|
+
}, [
|
|
264
|
+
(n(!0), u(ue, null, ie(te.value, (c) => (n(), u("div", {
|
|
265
|
+
key: `${c.x}-${c.y}`,
|
|
266
|
+
class: G(["relative aspect-square border border-slate-200/60", [
|
|
267
|
+
R(c) ? "bg-emerald-600 shadow-inner" : D(c) ? "bg-emerald-300" : M(c) ? "bg-rose-400" : "bg-white"
|
|
268
|
+
]]),
|
|
269
|
+
"data-test": "snake-cell",
|
|
270
|
+
"data-snake": R(c) ? "head" : D(c) ? "body" : M(c) ? "food" : void 0
|
|
271
|
+
}, [
|
|
272
|
+
R(c) ? (n(), u("div", De)) : M(c) ? (n(), u("div", He)) : h("", !0)
|
|
273
|
+
], 10, Ne))), 128))
|
|
274
|
+
], 4)
|
|
275
|
+
]),
|
|
276
|
+
t("p", Pe, r(i.value("ui.errors.snake_instructions")), 1)
|
|
277
|
+
]));
|
|
278
|
+
}
|
|
279
|
+
}), Ae = { class: "min-h-screen flex flex-col items-center justify-center bg-gray-100 p-4" }, Ve = { class: "text-center mb-8" }, Ke = { class: "text-xl text-gray-600 mt-2" }, Je = { class: "flex gap-4 mt-4" }, yt = /* @__PURE__ */ T({
|
|
280
|
+
__name: "OneNotFoundPage",
|
|
281
|
+
props: {
|
|
282
|
+
/** App logo shown between the digits; the #logo slot takes priority. */
|
|
283
|
+
logoSrc: {
|
|
284
|
+
type: String,
|
|
285
|
+
default: void 0
|
|
286
|
+
},
|
|
287
|
+
homeTo: {
|
|
288
|
+
type: [String, Object],
|
|
289
|
+
default: "/"
|
|
290
|
+
},
|
|
291
|
+
withGame: {
|
|
292
|
+
type: Boolean,
|
|
293
|
+
default: !0
|
|
294
|
+
},
|
|
295
|
+
t: {
|
|
296
|
+
type: Function,
|
|
297
|
+
default: void 0
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
setup(e) {
|
|
301
|
+
const o = e, g = L(), s = b(() => o.t ?? g), v = me(), f = x(!1), i = () => {
|
|
302
|
+
v ? v.back() : typeof window < "u" && window.history.back();
|
|
303
|
+
};
|
|
304
|
+
return (m, y) => {
|
|
305
|
+
const k = N("RouterLink");
|
|
306
|
+
return n(), u("div", Ae, [
|
|
307
|
+
t("div", Ve, [
|
|
308
|
+
I(Z, {
|
|
309
|
+
left: "4",
|
|
310
|
+
right: "4",
|
|
311
|
+
"logo-src": e.logoSrc
|
|
312
|
+
}, W({ _: 2 }, [
|
|
313
|
+
m.$slots.logo ? {
|
|
314
|
+
name: "default",
|
|
315
|
+
fn: q(() => [
|
|
316
|
+
z(m.$slots, "logo")
|
|
317
|
+
]),
|
|
318
|
+
key: "0"
|
|
319
|
+
} : void 0
|
|
320
|
+
]), 1032, ["logo-src"]),
|
|
321
|
+
t("p", Ke, r(s.value("ui.errors.page_not_found")), 1)
|
|
322
|
+
]),
|
|
323
|
+
e.withGame && !f.value ? (n(), u("button", {
|
|
324
|
+
key: 0,
|
|
325
|
+
type: "button",
|
|
326
|
+
class: "px-6 py-2.5 rounded-xl text-white bg-emerald-600 hover:bg-emerald-700 transition font-medium shadow-lg",
|
|
327
|
+
"data-test": "nf-play",
|
|
328
|
+
onClick: y[0] || (y[0] = (p) => f.value = !0)
|
|
329
|
+
}, r(s.value("ui.errors.play_snake")), 1)) : h("", !0),
|
|
330
|
+
f.value ? (n(), Q(Ue, {
|
|
331
|
+
key: 1,
|
|
332
|
+
class: "max-w-2xl",
|
|
333
|
+
t: s.value
|
|
334
|
+
}, null, 8, ["t"])) : h("", !0),
|
|
335
|
+
t("div", Je, [
|
|
336
|
+
I(k, {
|
|
337
|
+
to: e.homeTo,
|
|
338
|
+
class: "text-blue-600 hover:text-blue-700 underline text-sm",
|
|
339
|
+
"data-test": "nf-home"
|
|
340
|
+
}, {
|
|
341
|
+
default: q(() => [
|
|
342
|
+
C(r(s.value("ui.errors.go_home")), 1)
|
|
343
|
+
]),
|
|
344
|
+
_: 1
|
|
345
|
+
}, 8, ["to"]),
|
|
346
|
+
t("button", {
|
|
347
|
+
type: "button",
|
|
348
|
+
class: "text-gray-600 hover:text-gray-700 underline text-sm",
|
|
349
|
+
"data-test": "nf-back",
|
|
350
|
+
onClick: i
|
|
351
|
+
}, r(s.value("ui.errors.go_back")), 1)
|
|
352
|
+
])
|
|
353
|
+
]);
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
}), Qe = { class: "min-h-screen flex flex-col items-center justify-center bg-gray-100 p-4" }, We = { class: "text-center mb-8" }, Xe = { class: "text-xl text-gray-600 mt-2" }, Ye = { class: "text-sm text-gray-500 mt-2 max-w-md mx-auto" }, Ze = {
|
|
357
|
+
key: 0,
|
|
358
|
+
class: "mb-6 text-sm text-gray-600 text-center",
|
|
359
|
+
"data-test": "se-request"
|
|
360
|
+
}, et = { class: "flex flex-col items-center gap-4" }, pt = /* @__PURE__ */ T({
|
|
361
|
+
__name: "OneServerErrorPage",
|
|
362
|
+
props: {
|
|
363
|
+
/** App logo shown between the digits; the #logo slot takes priority. */
|
|
364
|
+
logoSrc: {
|
|
365
|
+
type: String,
|
|
366
|
+
default: void 0
|
|
367
|
+
},
|
|
368
|
+
homeTo: {
|
|
369
|
+
type: [String, Object],
|
|
370
|
+
default: "/"
|
|
371
|
+
},
|
|
372
|
+
/** Backend request/trace id — shows the «Код запиту» block with a copy button. */
|
|
373
|
+
requestId: {
|
|
374
|
+
type: String,
|
|
375
|
+
default: void 0
|
|
376
|
+
},
|
|
377
|
+
t: {
|
|
378
|
+
type: Function,
|
|
379
|
+
default: void 0
|
|
380
|
+
}
|
|
381
|
+
},
|
|
382
|
+
setup(e) {
|
|
383
|
+
const o = e, g = L(), s = b(() => o.t ?? g), v = x(!1);
|
|
384
|
+
let f = null;
|
|
385
|
+
const i = async () => {
|
|
386
|
+
!o.requestId || !await fe(o.requestId) || (v.value = !0, f != null && clearTimeout(f), f = setTimeout(() => {
|
|
387
|
+
v.value = !1, f = null;
|
|
388
|
+
}, 2e3));
|
|
389
|
+
}, m = () => {
|
|
390
|
+
window.location.reload();
|
|
391
|
+
};
|
|
392
|
+
return X(() => {
|
|
393
|
+
f != null && clearTimeout(f);
|
|
394
|
+
}), (y, k) => {
|
|
395
|
+
const p = N("RouterLink");
|
|
396
|
+
return n(), u("div", Qe, [
|
|
397
|
+
t("div", We, [
|
|
398
|
+
I(Z, {
|
|
399
|
+
left: "5",
|
|
400
|
+
right: "0",
|
|
401
|
+
"logo-src": e.logoSrc
|
|
402
|
+
}, W({ _: 2 }, [
|
|
403
|
+
y.$slots.logo ? {
|
|
404
|
+
name: "default",
|
|
405
|
+
fn: q(() => [
|
|
406
|
+
z(y.$slots, "logo")
|
|
407
|
+
]),
|
|
408
|
+
key: "0"
|
|
409
|
+
} : void 0
|
|
410
|
+
]), 1032, ["logo-src"]),
|
|
411
|
+
t("p", Xe, r(s.value("ui.errors.server_error")), 1),
|
|
412
|
+
t("p", Ye, r(s.value("ui.errors.server_error_hint")), 1)
|
|
413
|
+
]),
|
|
414
|
+
e.requestId ? (n(), u("div", Ze, [
|
|
415
|
+
C(r(s.value("ui.errors.request_id")) + ": ", 1),
|
|
416
|
+
t("strong", null, r(e.requestId), 1),
|
|
417
|
+
t("button", {
|
|
418
|
+
type: "button",
|
|
419
|
+
class: "ml-2 text-blue-600 hover:text-blue-700 underline",
|
|
420
|
+
"data-test": "se-copy",
|
|
421
|
+
onClick: i
|
|
422
|
+
}, r(v.value ? s.value("ui.errors.copied") : s.value("ui.errors.copy")), 1)
|
|
423
|
+
])) : h("", !0),
|
|
424
|
+
t("div", et, [
|
|
425
|
+
t("button", {
|
|
426
|
+
type: "button",
|
|
427
|
+
class: "px-6 py-3 rounded-xl text-white bg-emerald-600 hover:bg-emerald-700 transition text-lg font-medium shadow-lg",
|
|
428
|
+
"data-test": "se-reload",
|
|
429
|
+
onClick: m
|
|
430
|
+
}, r(s.value("ui.errors.reload_page")), 1),
|
|
431
|
+
z(y.$slots, "support"),
|
|
432
|
+
I(p, {
|
|
433
|
+
to: e.homeTo,
|
|
434
|
+
class: "text-blue-600 hover:text-blue-700 underline text-sm",
|
|
435
|
+
"data-test": "se-home"
|
|
436
|
+
}, {
|
|
437
|
+
default: q(() => [
|
|
438
|
+
C(r(s.value("ui.errors.go_home")), 1)
|
|
439
|
+
]),
|
|
440
|
+
_: 1
|
|
441
|
+
}, 8, ["to"])
|
|
442
|
+
])
|
|
443
|
+
]);
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
}), j = x(!1), B = x(null);
|
|
447
|
+
function ee() {
|
|
448
|
+
return { show: j, error: B, trigger: (g) => {
|
|
449
|
+
j.value || (B.value = g, j.value = !0);
|
|
450
|
+
}, dismiss: () => {
|
|
451
|
+
j.value = !1, B.value = null;
|
|
452
|
+
} };
|
|
453
|
+
}
|
|
454
|
+
const tt = {
|
|
455
|
+
key: 0,
|
|
456
|
+
class: "fixed inset-0 z-[10000] flex items-center justify-center bg-[#f5f7fb] p-6",
|
|
457
|
+
role: "alert",
|
|
458
|
+
"aria-live": "assertive",
|
|
459
|
+
"data-test": "crash-screen"
|
|
460
|
+
}, st = { class: "flex w-full max-w-[480px] flex-col items-center text-center" }, ot = {
|
|
461
|
+
key: 0,
|
|
462
|
+
class: "mb-6"
|
|
463
|
+
}, rt = ["src"], at = { class: "mb-3 text-2xl font-semibold text-gray-900" }, nt = {
|
|
464
|
+
class: "mb-8 text-base text-gray-600",
|
|
465
|
+
"data-test": "crash-message"
|
|
466
|
+
}, lt = {
|
|
467
|
+
key: 2,
|
|
468
|
+
"data-test": "crash-details",
|
|
469
|
+
class: "mt-6 text-xs text-gray-400"
|
|
470
|
+
}, xt = /* @__PURE__ */ T({
|
|
471
|
+
__name: "OneCrashScreen",
|
|
472
|
+
props: {
|
|
473
|
+
/** App logo above the title; the #logo slot takes priority. */
|
|
474
|
+
logoSrc: {
|
|
475
|
+
type: String,
|
|
476
|
+
default: void 0
|
|
477
|
+
},
|
|
478
|
+
/** Account portal URL — the second button shows only when set. */
|
|
479
|
+
accountUrl: {
|
|
480
|
+
type: String,
|
|
481
|
+
default: void 0
|
|
482
|
+
},
|
|
483
|
+
autoReloadSeconds: {
|
|
484
|
+
type: Number,
|
|
485
|
+
default: 10
|
|
486
|
+
},
|
|
487
|
+
/**
|
|
488
|
+
* Disables auto-reload («Перезавантажте сторінку вручну») — e.g. when the
|
|
489
|
+
* app counted too many reload attempts (invoice MAX_AUTO_RELOAD_ATTEMPTS).
|
|
490
|
+
*/
|
|
491
|
+
persistent: {
|
|
492
|
+
type: Boolean,
|
|
493
|
+
default: !1
|
|
494
|
+
},
|
|
495
|
+
/** Shows `err.name: err.message` under the buttons (debug builds). */
|
|
496
|
+
showDetails: {
|
|
497
|
+
type: Boolean,
|
|
498
|
+
default: !1
|
|
499
|
+
},
|
|
500
|
+
t: {
|
|
501
|
+
type: Function,
|
|
502
|
+
default: void 0
|
|
503
|
+
}
|
|
504
|
+
},
|
|
505
|
+
setup(e) {
|
|
506
|
+
const o = e, g = L(), s = b(() => o.t ?? g), { show: v, error: f } = ee(), i = x(o.autoReloadSeconds);
|
|
507
|
+
let m = null;
|
|
508
|
+
const y = b(() => {
|
|
509
|
+
const d = f.value;
|
|
510
|
+
return d instanceof Error ? `${d.name}: ${d.message}` : String(d ?? "Unknown error");
|
|
511
|
+
}), k = b(() => o.persistent ? s.value("ui.crash.persistent") : i.value > 0 ? s.value("ui.crash.countdown", { n: i.value }) : s.value("ui.crash.reloading")), p = () => {
|
|
512
|
+
m != null && (clearInterval(m), m = null);
|
|
513
|
+
}, w = () => {
|
|
514
|
+
p(), window.location.reload();
|
|
515
|
+
}, _ = () => {
|
|
516
|
+
o.accountUrl && (p(), window.location.href = o.accountUrl);
|
|
517
|
+
};
|
|
518
|
+
return ce(
|
|
519
|
+
v,
|
|
520
|
+
(d) => {
|
|
521
|
+
p(), d && (i.value = o.autoReloadSeconds, !o.persistent && (m = setInterval(() => {
|
|
522
|
+
i.value -= 1, i.value <= 0 && (p(), window.location.reload());
|
|
523
|
+
}, 1e3)));
|
|
524
|
+
},
|
|
525
|
+
{ immediate: !0 }
|
|
526
|
+
), X(() => {
|
|
527
|
+
p();
|
|
528
|
+
}), (d, E) => de(v) ? (n(), u("div", tt, [
|
|
529
|
+
t("div", st, [
|
|
530
|
+
e.logoSrc || d.$slots.logo ? (n(), u("div", ot, [
|
|
531
|
+
z(d.$slots, "logo", {}, () => [
|
|
532
|
+
t("img", {
|
|
533
|
+
src: e.logoSrc,
|
|
534
|
+
alt: "",
|
|
535
|
+
class: "h-20 w-20"
|
|
536
|
+
}, null, 8, rt)
|
|
537
|
+
])
|
|
538
|
+
])) : h("", !0),
|
|
539
|
+
t("h1", at, r(s.value("ui.crash.title")), 1),
|
|
540
|
+
t("p", nt, r(k.value), 1),
|
|
541
|
+
t("button", {
|
|
542
|
+
type: "button",
|
|
543
|
+
class: "mb-3 w-full rounded-lg bg-gradient-to-r from-[#E1A508] to-[#E04040] px-6 py-3 text-base font-medium text-white transition hover:opacity-90",
|
|
544
|
+
"data-test": "crash-reload",
|
|
545
|
+
onClick: w
|
|
546
|
+
}, r(s.value("ui.crash.reload_now")), 1),
|
|
547
|
+
e.accountUrl ? (n(), u("button", {
|
|
548
|
+
key: 1,
|
|
549
|
+
type: "button",
|
|
550
|
+
class: "w-full rounded-lg border border-gray-300 bg-white px-6 py-3 text-base font-medium text-gray-700 transition hover:bg-gray-50",
|
|
551
|
+
"data-test": "crash-account",
|
|
552
|
+
onClick: _
|
|
553
|
+
}, r(s.value("ui.crash.open_account")), 1)) : h("", !0),
|
|
554
|
+
e.showDetails ? (n(), u("p", lt, r(y.value), 1)) : h("", !0)
|
|
555
|
+
])
|
|
556
|
+
])) : h("", !0);
|
|
557
|
+
}
|
|
558
|
+
});
|
|
559
|
+
function ht(e = {}) {
|
|
560
|
+
const o = e.criticalInfos ?? ["setup function", "render function"];
|
|
561
|
+
return (g, s, v) => {
|
|
562
|
+
var f;
|
|
563
|
+
try {
|
|
564
|
+
(f = e.onError) == null || f.call(e, g, v);
|
|
565
|
+
} catch {
|
|
566
|
+
}
|
|
567
|
+
console.error("[Vue Error]", g, v), o.includes(v) && (e.onCritical ?? ee().trigger)(g);
|
|
568
|
+
};
|
|
569
|
+
}
|
|
61
570
|
export {
|
|
62
|
-
|
|
571
|
+
xt as OneCrashScreen,
|
|
572
|
+
gt as OneErrorPage,
|
|
573
|
+
yt as OneNotFoundPage,
|
|
574
|
+
pt as OneServerErrorPage,
|
|
575
|
+
Ue as OneSnakeGame,
|
|
576
|
+
ht as createAppErrorHandler,
|
|
577
|
+
ee as useCrashState
|
|
63
578
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
export interface CrashState {
|
|
3
|
+
show: Ref<boolean>;
|
|
4
|
+
error: Ref<unknown>;
|
|
5
|
+
/** Shows the crash screen. Ignored while one is already shown (first error wins). */
|
|
6
|
+
trigger: (err: unknown) => void;
|
|
7
|
+
/** Hides the crash screen and clears the stored error. */
|
|
8
|
+
dismiss: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function useCrashState(): CrashState;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface FileUploadError {
|
|
2
|
+
code: 'size' | 'type';
|
|
3
|
+
file: File;
|
|
4
|
+
}
|
|
5
|
+
export interface FileValidationOptions {
|
|
6
|
+
accept?: string;
|
|
7
|
+
maxSizeMb?: number;
|
|
8
|
+
multiple?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Validates picked/dropped files against accept + maxSizeMb, shared by
|
|
12
|
+
* OneFileUpload and OneDropzone. Returns accepted files and typed errors.
|
|
13
|
+
*/
|
|
14
|
+
export declare const validateFiles: (files: File[], opts: FileValidationOptions) => {
|
|
15
|
+
accepted: File[];
|
|
16
|
+
errors: FileUploadError[];
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("../useFileUpload-f47622bb.cjs"),e=require("vue"),S=require("../spinner/index.cjs"),x=require("../i18n/index.cjs"),z=require("../button/index.cjs");require("../SpinnerIcon-01be39fe.cjs");require("../_plugin-vue_export-helper-f246444f.cjs");function D(t,o){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.8",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5"})])}const w=(t,o)=>o?o.split(",").map(l=>l.trim().toLowerCase()).some(l=>l?l.startsWith(".")?t.name.toLowerCase().endsWith(l):l.endsWith("/*")?t.type.toLowerCase().startsWith(l.slice(0,-1)):t.type.toLowerCase()===l:!1):!0,v=(t,o)=>{const l=[],r=[],u=o.multiple?t:t.slice(0,1);for(const n of u){if(!w(n,o.accept)){r.push({code:"type",file:n});continue}if(o.maxSizeMb!=null&&n.size>o.maxSizeMb*1024*1024){r.push({code:"size",file:n});continue}l.push(n)}return{accepted:l,errors:r}},C={key:2,class:"text-[#525B66] font-medium"},E={key:3,class:"text-[#525B66]"},N=["accept","multiple","disabled"],F=e.defineComponent({__name:"OneFileUpload",props:{label:{type:String,default:""},accept:{type:String,default:void 0},multiple:{type:Boolean,default:!1},maxSizeMb:{type:Number,default:void 0},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},t:{type:Function,default:void 0}},emits:["files","error"],setup(t,{emit:o}){const l=t,r=o,u=x.useOnebI18n(),n=e.computed(()=>l.t??u),s=c=>{const d=c.target,p=Array.from(d.files??[]);if(d.value="",p.length===0)return;const{accepted:f,errors:b}=v(p,{accept:l.accept,maxSizeMb:l.maxSizeMb,multiple:l.multiple});b.forEach(g=>r("error",g)),f.length>0&&r("files",f)};return(c,d)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["hover:text-blue-500 cursor-pointer text-sm w-full h-full flex items-center border hover:bg-gray-50 px-3 py-2 rounded-md gap-3",{"opacity-60 cursor-not-allowed pointer-events-none":t.disabled}])},[t.loading?(e.openBlock(),e.createBlock(e.unref(S.OneSpinner),{key:0,size:"sm"})):(e.openBlock(),e.createBlock(e.unref(D),{key:1,class:"w-4 h-4 text-[#525B66]"})),t.loading?(e.openBlock(),e.createElementBlock("span",E,e.toDisplayString(n.value("ui.file_upload.uploading"))+"...",1)):(e.openBlock(),e.createElementBlock("span",C,e.toDisplayString(t.label||n.value("ui.file_upload.select")),1)),e.createElementVNode("input",{class:"hidden",type:"file",accept:t.accept,multiple:t.multiple,disabled:t.disabled,onChange:s},null,40,N)],2))}}),M=["accept","multiple","disabled"],V={class:"text-base font-medium text-gray-900"},O={class:"text-xs text-gray-500"},q={key:0,class:"mt-4 text-sm text-gray-700"},L={class:"font-semibold"},j=e.defineComponent({__name:"OneDropzone",props:{accept:{type:String,default:void 0},multiple:{type:Boolean,default:!1},maxSizeMb:{type:Number,default:void 0},disabled:{type:Boolean,default:!1},hint:{type:String,default:""},help:{type:String,default:""},buttonLabel:{type:String,default:""},t:{type:Function,default:void 0}},emits:["files","error"],setup(t,{emit:o}){const l=t,r=o,u=x.useOnebI18n(),n=e.computed(()=>l.t??u),s=e.ref(!1),c=e.ref([]),d=e.ref(null),p=a=>{const i=Array.from(a??[]);if(i.length===0)return;const{accepted:m,errors:B}=v(i,{accept:l.accept,maxSizeMb:l.maxSizeMb,multiple:l.multiple});B.forEach(y=>r("error",y)),m.length>0&&(c.value=m.map(y=>y.name),r("files",m))},f=a=>{var i;a.preventDefault(),s.value=!1,!l.disabled&&p(((i=a.dataTransfer)==null?void 0:i.files)??null)},b=a=>{a.preventDefault(),!l.disabled&&(s.value=!0)},g=a=>{if(l.disabled)return;const i=a.target;p(i.files),i.value=""},h=()=>{var a;l.disabled||(a=d.value)==null||a.click()};return(a,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["border-2 border-dashed rounded-xl bg-white p-6 flex flex-col items-center justify-center text-center transition-colors",{"border-blue-500 bg-blue-50":s.value&&!t.disabled,"border-gray-300":!s.value||t.disabled,"opacity-60 cursor-not-allowed":t.disabled}]),"data-test":"dropzone",onDrop:f,onDragover:b,onDragleave:i[0]||(i[0]=m=>s.value=!1)},[e.createElementVNode("input",{ref_key:"inputRef",ref:d,type:"file",accept:t.accept,multiple:t.multiple,class:"hidden",disabled:t.disabled,onChange:g},null,40,M),e.renderSlot(a.$slots,"default",{isDragging:s.value,openPicker:h},()=>[e.createElementVNode("div",{class:"cursor-pointer flex flex-col items-center gap-2",onClick:h},[e.createElementVNode("span",V,e.toDisplayString(t.hint||n.value("ui.dropzone.hint")),1),e.createElementVNode("span",O,e.toDisplayString(t.help||n.value("ui.dropzone.help")),1)]),e.createVNode(e.unref(z.OneButton),{type:"button",variant:"primary",class:"mt-3",label:t.buttonLabel||n.value("ui.dropzone.choose"),disabled:t.disabled,onClick:h},null,8,["label","disabled"]),c.value.length?(e.openBlock(),e.createElementBlock("div",q,[e.createTextVNode(e.toDisplayString(n.value("ui.dropzone.selected"))+": ",1),e.createElementVNode("span",L,e.toDisplayString(c.value.join(", ")),1)])):e.createCommentVNode("",!0)])],34))}});exports.useFileUpload=k.useFileUpload;exports.OneDropzone=j;exports.OneFileUpload=F;exports.validateFiles=v;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as OneFileUpload } from './OneFileUpload.vue';
|
|
2
|
+
export { default as OneDropzone } from './OneDropzone.vue';
|
|
3
|
+
export { validateFiles } from './fileUpload';
|
|
4
|
+
export type { FileUploadError, FileValidationOptions } from './fileUpload';
|
|
5
|
+
export { useFileUpload } from '../composables/useFileUpload';
|
|
6
|
+
export type { UseFileUploadOptions, UseFileUploadReturn } from '../composables/useFileUpload';
|