@oneb/ui-vue 0.3.32 → 0.4.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.
- 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/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-6ec63535.cjs +1 -0
- package/dist/{OneHelpMenu-73817f8a.js → OneHelpMenu-d5182c78.js} +118 -213
- 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 +557 -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 +257 -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 +99 -15
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +18 -0
- package/dist/index.js +242 -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/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 +6 -1
- package/dist/layout/index.js +1057 -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 +102 -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
|
@@ -0,0 +1,559 @@
|
|
|
1
|
+
import { openBlock as s, createElementBlock as i, createElementVNode as e, defineComponent as z, computed as w, Fragment as U, createVNode as g, unref as n, toDisplayString as l, createCommentVNode as h, renderSlot as k, createBlock as L, withCtx as x, normalizeClass as $, renderList as A, createSlots as P, mergeProps as H, ref as j, watch as G } from "vue";
|
|
2
|
+
import { r as J } from "../ChevronRightIcon-b0585768.js";
|
|
3
|
+
import { OneButton as C } from "../button/index.js";
|
|
4
|
+
import { _ as B } from "../OneAvatar.vue_vue_type_script_setup_true_lang-08ab80dd.js";
|
|
5
|
+
import { O as T } from "../OneModal-02a9a173.js";
|
|
6
|
+
import { u as q } from "../useModal-6a5d870b.js";
|
|
7
|
+
import { _ as E } from "../OneDropdownAuto.vue_vue_type_script_setup_true_lang-2c508e8a.js";
|
|
8
|
+
import { OneDateTime as K } from "../dateTime/index.js";
|
|
9
|
+
import { useOnebI18n as F } from "../i18n/index.js";
|
|
10
|
+
import { OneSkeleton as Q } from "../skeleton/index.js";
|
|
11
|
+
import { r as W } from "../ChevronDownIcon-6805ce6c.js";
|
|
12
|
+
import { _ as X } from "../OneFormInput.vue_vue_type_script_setup_true_lang-b89117e7.js";
|
|
13
|
+
import { c as Y } from "../clipboard-733b79a1.js";
|
|
14
|
+
import "../SpinnerIcon-516264ba.js";
|
|
15
|
+
import "../_plugin-vue_export-helper-dad06003.js";
|
|
16
|
+
import "../useIsMobile-98fc0cf9.js";
|
|
17
|
+
import "../useMediaQuery-77a19b18.js";
|
|
18
|
+
import "../dropdown-c81fb945.js";
|
|
19
|
+
import "@floating-ui/dom";
|
|
20
|
+
import "@floating-ui/vue";
|
|
21
|
+
import "dayjs";
|
|
22
|
+
import "dayjs/plugin/relativeTime";
|
|
23
|
+
import "dayjs/plugin/utc";
|
|
24
|
+
import "dayjs/plugin/timezone";
|
|
25
|
+
import "../XMarkIcon-51ef0691.js";
|
|
26
|
+
function Z(t, _) {
|
|
27
|
+
return s(), i("svg", {
|
|
28
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
29
|
+
fill: "none",
|
|
30
|
+
viewBox: "0 0 24 24",
|
|
31
|
+
"stroke-width": "1.8",
|
|
32
|
+
stroke: "currentColor",
|
|
33
|
+
"aria-hidden": "true"
|
|
34
|
+
}, [
|
|
35
|
+
e("path", {
|
|
36
|
+
"stroke-linecap": "round",
|
|
37
|
+
"stroke-linejoin": "round",
|
|
38
|
+
d: "M15.75 5.25a3 3 0 013 3m3 0a6 6 0 01-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1121.75 8.25z"
|
|
39
|
+
})
|
|
40
|
+
]);
|
|
41
|
+
}
|
|
42
|
+
function D(t, _) {
|
|
43
|
+
return s(), i("svg", {
|
|
44
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
45
|
+
fill: "none",
|
|
46
|
+
viewBox: "0 0 24 24",
|
|
47
|
+
"stroke-width": "1.8",
|
|
48
|
+
stroke: "currentColor",
|
|
49
|
+
"aria-hidden": "true"
|
|
50
|
+
}, [
|
|
51
|
+
e("path", {
|
|
52
|
+
"stroke-linecap": "round",
|
|
53
|
+
"stroke-linejoin": "round",
|
|
54
|
+
d: "M16.5 10.5V6.75a4.5 4.5 0 10-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H6.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z"
|
|
55
|
+
})
|
|
56
|
+
]);
|
|
57
|
+
}
|
|
58
|
+
function V(t, _) {
|
|
59
|
+
return s(), i("svg", {
|
|
60
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
61
|
+
fill: "none",
|
|
62
|
+
viewBox: "0 0 24 24",
|
|
63
|
+
"stroke-width": "1.8",
|
|
64
|
+
stroke: "currentColor",
|
|
65
|
+
"aria-hidden": "true"
|
|
66
|
+
}, [
|
|
67
|
+
e("path", {
|
|
68
|
+
"stroke-linecap": "round",
|
|
69
|
+
"stroke-linejoin": "round",
|
|
70
|
+
d: "M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"
|
|
71
|
+
})
|
|
72
|
+
]);
|
|
73
|
+
}
|
|
74
|
+
const ee = { class: "border-b border-gray-100 last:border-b-0 hover:bg-gray-50 transition-colors" }, te = { class: "flex gap-3 items-center px-4 py-3" }, se = { class: "flex-grow flex-shrink min-w-0" }, ne = { class: "flex items-center flex-wrap gap-y-0.5" }, le = { class: "font-semibold" }, ie = {
|
|
75
|
+
key: 0,
|
|
76
|
+
class: "text-blue-700 bg-blue-100 border border-blue-200 rounded-md px-2 mx-2 text-sm"
|
|
77
|
+
}, oe = {
|
|
78
|
+
key: 1,
|
|
79
|
+
class: "text-red-700 bg-red-100 border border-red-200 rounded-md px-2 mx-2 text-sm"
|
|
80
|
+
}, ae = { class: "text-sm text-gray-500 hidden sm:block truncate" }, re = { class: "flex items-center gap-2" }, ue = {
|
|
81
|
+
key: 0,
|
|
82
|
+
class: "text-sm font-medium text-gray-400 hidden lg:block"
|
|
83
|
+
}, de = {
|
|
84
|
+
key: 2,
|
|
85
|
+
class: "p-1 ml-3 w-8"
|
|
86
|
+
}, ce = { class: "py-2" }, me = { class: "flex gap-3 items-center px-5 pb-3 mb-2 border-b" }, ve = { class: "flex-grow min-w-0" }, ge = { class: "font-medium truncate" }, fe = { class: "text-sm text-gray-500 truncate" }, he = {
|
|
87
|
+
key: 0,
|
|
88
|
+
class: "text-xs text-gray-400 mt-1 flex gap-1 items-center"
|
|
89
|
+
}, pe = { class: "px-3" }, ye = { class: "text-sm font-medium" }, xe = ["onClick"], _e = { class: "flex-shrink-0 w-8 h-8 rounded-full bg-blue-50 flex items-center justify-center" }, ke = { class: "text-sm font-medium" }, be = {
|
|
90
|
+
key: 0,
|
|
91
|
+
class: "text-xs text-gray-400"
|
|
92
|
+
}, $e = { class: "sm:w-72" }, we = ["onClick"], Ce = ["data-test", "onClick"], Oe = {
|
|
93
|
+
key: 0,
|
|
94
|
+
class: "text-xs text-gray-600"
|
|
95
|
+
}, Me = { class: "flex-shrink-0 w-8 h-8 rounded-full bg-red-50 flex items-center justify-center" }, Le = { class: "text-sm font-medium text-red-600" }, Se = { class: "flex gap-3 items-center px-4 py-3" }, je = { class: "flex-grow flex-shrink min-w-0" }, Be = { class: "flex gap-3" }, Ue = {
|
|
96
|
+
key: 0,
|
|
97
|
+
class: "text-sm font-medium"
|
|
98
|
+
}, Ie = { class: "text-sm text-gray-500" }, Ne = { class: "text-sm text-gray-600 mb-6 px-4 pt-3" }, Re = { class: "flex justify-end gap-3 px-4 pb-3" }, Te = /* @__PURE__ */ z({
|
|
99
|
+
__name: "OneUserListItem",
|
|
100
|
+
props: {
|
|
101
|
+
user: {
|
|
102
|
+
type: Object,
|
|
103
|
+
required: !0
|
|
104
|
+
},
|
|
105
|
+
currentUserId: {
|
|
106
|
+
type: [String, Number],
|
|
107
|
+
default: void 0
|
|
108
|
+
},
|
|
109
|
+
roleOptions: {
|
|
110
|
+
type: Array,
|
|
111
|
+
default: () => []
|
|
112
|
+
},
|
|
113
|
+
canManage: {
|
|
114
|
+
type: Boolean,
|
|
115
|
+
default: !0
|
|
116
|
+
},
|
|
117
|
+
t: {
|
|
118
|
+
type: Function,
|
|
119
|
+
default: void 0
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
emits: ["toggle-access", "change-role", "remove"],
|
|
123
|
+
setup(t, { emit: _ }) {
|
|
124
|
+
const v = t, p = _, O = F(), o = w(() => v.t ?? O), c = q(), d = q(), y = w(
|
|
125
|
+
() => v.currentUserId != null && String(v.currentUserId) === String(v.user.id)
|
|
126
|
+
), a = w(() => (v.user.roles ?? []).map((r) => r.name).join(", ")), b = (r) => (v.user.roles ?? []).some(
|
|
127
|
+
(m) => String(m.alias ?? m.id) === String(r.alias ?? r.id)
|
|
128
|
+
), I = () => p("toggle-access", v.user), M = (r, m) => {
|
|
129
|
+
p("change-role", v.user, r), m == null || m();
|
|
130
|
+
}, N = () => {
|
|
131
|
+
c.close(), d.open();
|
|
132
|
+
}, R = () => {
|
|
133
|
+
p("remove", v.user), d.close();
|
|
134
|
+
};
|
|
135
|
+
return (r, m) => (s(), i(U, null, [
|
|
136
|
+
e("div", ee, [
|
|
137
|
+
e("div", te, [
|
|
138
|
+
g(n(B), {
|
|
139
|
+
src: t.user.photo_url,
|
|
140
|
+
text: t.user.name,
|
|
141
|
+
rounded: !0,
|
|
142
|
+
size: "40"
|
|
143
|
+
}, null, 8, ["src", "text"]),
|
|
144
|
+
e("div", se, [
|
|
145
|
+
e("div", ne, [
|
|
146
|
+
e("span", le, l(t.user.name), 1),
|
|
147
|
+
y.value ? (s(), i("span", ie, l(o.value("ui.user_list.me")), 1)) : h("", !0),
|
|
148
|
+
t.user.disabled ? (s(), i("span", oe, l(o.value("ui.user_list.access_disabled")), 1)) : h("", !0),
|
|
149
|
+
k(r.$slots, "badges", { user: t.user })
|
|
150
|
+
]),
|
|
151
|
+
e("div", ae, l(t.user.email), 1)
|
|
152
|
+
]),
|
|
153
|
+
e("div", re, [
|
|
154
|
+
a.value ? (s(), i("div", ue, l(a.value), 1)) : h("", !0),
|
|
155
|
+
t.canManage && !y.value ? (s(), L(n(C), {
|
|
156
|
+
key: 1,
|
|
157
|
+
icon: n(J),
|
|
158
|
+
variant: "touch",
|
|
159
|
+
class: "ml-3",
|
|
160
|
+
"data-test": "user-actions",
|
|
161
|
+
onClick: m[0] || (m[0] = (f) => n(c).open())
|
|
162
|
+
}, null, 8, ["icon"])) : (s(), i("div", de))
|
|
163
|
+
])
|
|
164
|
+
])
|
|
165
|
+
]),
|
|
166
|
+
g(n(T), {
|
|
167
|
+
useModal: n(c),
|
|
168
|
+
title: o.value("ui.user_list.user_settings")
|
|
169
|
+
}, {
|
|
170
|
+
default: x(() => [
|
|
171
|
+
e("div", ce, [
|
|
172
|
+
e("div", me, [
|
|
173
|
+
g(n(B), {
|
|
174
|
+
src: t.user.photo_url,
|
|
175
|
+
text: t.user.name,
|
|
176
|
+
rounded: !0,
|
|
177
|
+
size: "40"
|
|
178
|
+
}, null, 8, ["src", "text"]),
|
|
179
|
+
e("div", ve, [
|
|
180
|
+
e("div", ge, l(t.user.name), 1),
|
|
181
|
+
e("div", fe, l(t.user.email), 1),
|
|
182
|
+
t.user.added_at ? (s(), i("div", he, [
|
|
183
|
+
e("span", null, l(o.value("ui.user_list.added_on")) + ":", 1),
|
|
184
|
+
g(n(K), {
|
|
185
|
+
value: t.user.added_at
|
|
186
|
+
}, null, 8, ["value"])
|
|
187
|
+
])) : h("", !0)
|
|
188
|
+
])
|
|
189
|
+
]),
|
|
190
|
+
e("div", pe, [
|
|
191
|
+
e("div", {
|
|
192
|
+
class: "flex items-center gap-3 px-3 py-2.5 rounded-lg cursor-pointer hover:bg-gray-50 transition-colors",
|
|
193
|
+
"data-test": "toggle-access",
|
|
194
|
+
onClick: I
|
|
195
|
+
}, [
|
|
196
|
+
e("div", {
|
|
197
|
+
class: $(["flex-shrink-0 w-8 h-8 rounded-full flex items-center justify-center", t.user.disabled ? "bg-red-50" : "bg-green-50"])
|
|
198
|
+
}, [
|
|
199
|
+
g(n(D), {
|
|
200
|
+
class: $(["w-4 h-4", t.user.disabled ? "text-red-600" : "text-green-600"])
|
|
201
|
+
}, null, 8, ["class"])
|
|
202
|
+
], 2),
|
|
203
|
+
e("div", ye, l(t.user.disabled ? o.value("ui.user_list.activate") : o.value("ui.user_list.deactivate")), 1)
|
|
204
|
+
]),
|
|
205
|
+
t.roleOptions.length > 0 ? (s(), L(n(E), {
|
|
206
|
+
key: 0,
|
|
207
|
+
class: "block w-full"
|
|
208
|
+
}, {
|
|
209
|
+
button: x(({ onToggle: f }) => [
|
|
210
|
+
e("div", {
|
|
211
|
+
class: "flex items-center gap-3 px-3 py-2.5 rounded-lg cursor-pointer hover:bg-gray-50 transition-colors w-full text-left",
|
|
212
|
+
"data-test": "change-role",
|
|
213
|
+
onClick: (u) => f()
|
|
214
|
+
}, [
|
|
215
|
+
e("div", _e, [
|
|
216
|
+
g(n(Z), { class: "w-4 h-4 text-blue-600" })
|
|
217
|
+
]),
|
|
218
|
+
e("div", null, [
|
|
219
|
+
e("div", ke, l(o.value("ui.user_list.change_role")), 1),
|
|
220
|
+
a.value ? (s(), i("div", be, l(a.value), 1)) : h("", !0)
|
|
221
|
+
])
|
|
222
|
+
], 8, xe)
|
|
223
|
+
]),
|
|
224
|
+
menu: x(({ onToggle: f }) => [
|
|
225
|
+
e("div", $e, [
|
|
226
|
+
e("div", {
|
|
227
|
+
class: $(["!break-words !whitespace-normal !text-left overflow-hidden px-3 py-1.5 cursor-pointer hover:bg-gray-50 select-none", (t.user.roles ?? []).length === 0 ? "bg-blue-50" : ""]),
|
|
228
|
+
"data-test": "role-empty",
|
|
229
|
+
onClick: (u) => M(null, f)
|
|
230
|
+
}, l(o.value("ui.user_list.regular_user")), 11, we),
|
|
231
|
+
(s(!0), i(U, null, A(t.roleOptions, (u) => (s(), i("div", {
|
|
232
|
+
key: u.id,
|
|
233
|
+
class: $(["!break-words !whitespace-normal !text-left overflow-hidden px-3 py-1.5 cursor-pointer hover:bg-gray-50 select-none", b(u) ? "bg-blue-50" : ""]),
|
|
234
|
+
"data-test": `role-${u.id}`,
|
|
235
|
+
onClick: (S) => M(u, f)
|
|
236
|
+
}, [
|
|
237
|
+
e("div", null, l(u.name), 1),
|
|
238
|
+
u.info ? (s(), i("div", Oe, l(u.info), 1)) : h("", !0)
|
|
239
|
+
], 10, Ce))), 128))
|
|
240
|
+
])
|
|
241
|
+
]),
|
|
242
|
+
_: 1
|
|
243
|
+
})) : h("", !0),
|
|
244
|
+
k(r.$slots, "actions", {
|
|
245
|
+
user: t.user,
|
|
246
|
+
close: n(c).close
|
|
247
|
+
}),
|
|
248
|
+
e("div", {
|
|
249
|
+
class: "flex items-center gap-3 px-3 py-2.5 rounded-lg cursor-pointer hover:bg-red-50 transition-colors",
|
|
250
|
+
"data-test": "remove",
|
|
251
|
+
onClick: N
|
|
252
|
+
}, [
|
|
253
|
+
e("div", Me, [
|
|
254
|
+
g(n(V), { class: "w-4 h-4 text-red-600" })
|
|
255
|
+
]),
|
|
256
|
+
e("div", Le, l(o.value("ui.user_list.delete")), 1)
|
|
257
|
+
])
|
|
258
|
+
])
|
|
259
|
+
])
|
|
260
|
+
]),
|
|
261
|
+
_: 3
|
|
262
|
+
}, 8, ["useModal", "title"]),
|
|
263
|
+
g(n(T), {
|
|
264
|
+
useModal: n(d),
|
|
265
|
+
title: o.value("ui.user_list.confirm_deletion")
|
|
266
|
+
}, {
|
|
267
|
+
default: x(() => [
|
|
268
|
+
e("div", null, [
|
|
269
|
+
e("div", Se, [
|
|
270
|
+
g(n(B), {
|
|
271
|
+
src: t.user.photo_url,
|
|
272
|
+
text: t.user.name,
|
|
273
|
+
rounded: !0,
|
|
274
|
+
size: "40"
|
|
275
|
+
}, null, 8, ["src", "text"]),
|
|
276
|
+
e("div", je, [
|
|
277
|
+
e("div", null, l(t.user.name), 1),
|
|
278
|
+
e("div", Be, [
|
|
279
|
+
a.value ? (s(), i("div", Ue, l(a.value), 1)) : h("", !0),
|
|
280
|
+
e("div", Ie, l(t.user.email), 1)
|
|
281
|
+
])
|
|
282
|
+
])
|
|
283
|
+
]),
|
|
284
|
+
e("p", Ne, l(o.value("ui.user_list.delete_confirm")), 1),
|
|
285
|
+
e("div", Re, [
|
|
286
|
+
g(n(C), {
|
|
287
|
+
variant: "secondary",
|
|
288
|
+
label: o.value("ui.confirm.Cancel"),
|
|
289
|
+
onClick: m[1] || (m[1] = (f) => n(d).close())
|
|
290
|
+
}, null, 8, ["label"]),
|
|
291
|
+
g(n(C), {
|
|
292
|
+
icon: n(V),
|
|
293
|
+
variant: "danger",
|
|
294
|
+
label: o.value("ui.user_list.delete"),
|
|
295
|
+
"data-test": "confirm-remove",
|
|
296
|
+
onClick: R
|
|
297
|
+
}, null, 8, ["icon", "label"])
|
|
298
|
+
])
|
|
299
|
+
])
|
|
300
|
+
]),
|
|
301
|
+
_: 1
|
|
302
|
+
}, 8, ["useModal", "title"])
|
|
303
|
+
], 64));
|
|
304
|
+
}
|
|
305
|
+
}), ze = { class: "bg-white rounded-lg border border-gray-100" }, Ae = {
|
|
306
|
+
key: 0,
|
|
307
|
+
class: "p-4 space-y-3"
|
|
308
|
+
}, Fe = { class: "p-6 text-center text-sm text-gray-500" }, Ot = /* @__PURE__ */ z({
|
|
309
|
+
__name: "OneUserList",
|
|
310
|
+
props: {
|
|
311
|
+
users: {
|
|
312
|
+
type: Array,
|
|
313
|
+
required: !0
|
|
314
|
+
},
|
|
315
|
+
loading: {
|
|
316
|
+
type: Boolean,
|
|
317
|
+
default: !1
|
|
318
|
+
},
|
|
319
|
+
currentUserId: {
|
|
320
|
+
type: [String, Number],
|
|
321
|
+
default: void 0
|
|
322
|
+
},
|
|
323
|
+
roleOptions: {
|
|
324
|
+
type: Array,
|
|
325
|
+
default: () => []
|
|
326
|
+
},
|
|
327
|
+
canManage: {
|
|
328
|
+
type: Boolean,
|
|
329
|
+
default: !0
|
|
330
|
+
},
|
|
331
|
+
t: {
|
|
332
|
+
type: Function,
|
|
333
|
+
default: void 0
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
emits: ["toggle-access", "change-role", "remove"],
|
|
337
|
+
setup(t, { emit: _ }) {
|
|
338
|
+
const v = t, p = _, O = F(), o = w(() => v.t ?? O);
|
|
339
|
+
return (c, d) => (s(), i("div", ze, [
|
|
340
|
+
t.loading ? (s(), i("div", Ae, [
|
|
341
|
+
g(n(Q), {
|
|
342
|
+
count: 3,
|
|
343
|
+
height: "h-12"
|
|
344
|
+
})
|
|
345
|
+
])) : t.users.length === 0 ? k(c.$slots, "empty", { key: 1 }, () => [
|
|
346
|
+
e("div", Fe, l(o.value("ui.user_list.empty")), 1)
|
|
347
|
+
]) : (s(!0), i(U, { key: 2 }, A(t.users, (y) => (s(), L(Te, {
|
|
348
|
+
key: y.id,
|
|
349
|
+
user: y,
|
|
350
|
+
"current-user-id": t.currentUserId,
|
|
351
|
+
"role-options": t.roleOptions,
|
|
352
|
+
"can-manage": t.canManage,
|
|
353
|
+
t: v.t,
|
|
354
|
+
onToggleAccess: d[0] || (d[0] = (a) => p("toggle-access", a)),
|
|
355
|
+
onChangeRole: d[1] || (d[1] = (a, b) => p("change-role", a, b)),
|
|
356
|
+
onRemove: d[2] || (d[2] = (a) => p("remove", a))
|
|
357
|
+
}, P({ _: 2 }, [
|
|
358
|
+
c.$slots.badges ? {
|
|
359
|
+
name: "badges",
|
|
360
|
+
fn: x((a) => [
|
|
361
|
+
k(c.$slots, "badges", H({ ref_for: !0 }, a))
|
|
362
|
+
]),
|
|
363
|
+
key: "0"
|
|
364
|
+
} : void 0,
|
|
365
|
+
c.$slots.actions ? {
|
|
366
|
+
name: "actions",
|
|
367
|
+
fn: x((a) => [
|
|
368
|
+
k(c.$slots, "actions", H({ ref_for: !0 }, a))
|
|
369
|
+
]),
|
|
370
|
+
key: "1"
|
|
371
|
+
} : void 0
|
|
372
|
+
]), 1032, ["user", "current-user-id", "role-options", "can-manage", "t"]))), 128))
|
|
373
|
+
]));
|
|
374
|
+
}
|
|
375
|
+
}), He = {
|
|
376
|
+
class: "py-2 px-4 space-y-4",
|
|
377
|
+
"data-test": "invite-modal"
|
|
378
|
+
}, qe = {
|
|
379
|
+
key: 0,
|
|
380
|
+
class: "flex items-center gap-3"
|
|
381
|
+
}, Ve = { class: "font-medium" }, Ee = { key: 1 }, Pe = { class: "text-sm pb-2" }, Ge = { class: "sm:w-72" }, Je = ["onClick"], Ke = ["data-test", "onClick"], Qe = {
|
|
382
|
+
key: 0,
|
|
383
|
+
class: "text-xs text-gray-600"
|
|
384
|
+
}, We = {
|
|
385
|
+
key: 2,
|
|
386
|
+
class: "text-xs font-light text-gray-500"
|
|
387
|
+
}, Xe = {
|
|
388
|
+
key: 3,
|
|
389
|
+
class: "space-y-3"
|
|
390
|
+
}, Ye = { class: "text-sm font-medium pb-1" }, Ze = {
|
|
391
|
+
key: 0,
|
|
392
|
+
class: "py-2 text-green-800 bg-green-100 rounded-md px-6 w-full text-center",
|
|
393
|
+
"data-test": "invite-copied"
|
|
394
|
+
}, De = {
|
|
395
|
+
key: 4,
|
|
396
|
+
class: "pb-2"
|
|
397
|
+
}, Mt = /* @__PURE__ */ z({
|
|
398
|
+
__name: "OneUserInviteModal",
|
|
399
|
+
props: {
|
|
400
|
+
/** Modal adapter from useModal(). */
|
|
401
|
+
useModal: {
|
|
402
|
+
type: Object,
|
|
403
|
+
required: !0
|
|
404
|
+
},
|
|
405
|
+
roleOptions: {
|
|
406
|
+
type: Array,
|
|
407
|
+
default: () => []
|
|
408
|
+
},
|
|
409
|
+
/**
|
|
410
|
+
* Backend hook: creates an invite link for the picked role (null = regular
|
|
411
|
+
* user). The rpc stays in the app — finance rpc.inviteUser, accounts
|
|
412
|
+
* useInviteCreate, etc.
|
|
413
|
+
*/
|
|
414
|
+
createLink: {
|
|
415
|
+
type: Function,
|
|
416
|
+
required: !0
|
|
417
|
+
},
|
|
418
|
+
/** Optional workspace/app identity shown above the form. */
|
|
419
|
+
appName: {
|
|
420
|
+
type: String,
|
|
421
|
+
default: void 0
|
|
422
|
+
},
|
|
423
|
+
appLogo: {
|
|
424
|
+
type: String,
|
|
425
|
+
default: void 0
|
|
426
|
+
},
|
|
427
|
+
/** Close the modal automatically after a successful copy (default true). */
|
|
428
|
+
closeOnCopy: {
|
|
429
|
+
type: Boolean,
|
|
430
|
+
default: !0
|
|
431
|
+
},
|
|
432
|
+
t: {
|
|
433
|
+
type: Function,
|
|
434
|
+
default: void 0
|
|
435
|
+
}
|
|
436
|
+
},
|
|
437
|
+
emits: ["created", "copied"],
|
|
438
|
+
setup(t, { emit: _ }) {
|
|
439
|
+
const v = t, p = _, O = F(), o = w(() => v.t ?? O), c = j(null), d = j(""), y = j(!1), a = j(!1), b = () => {
|
|
440
|
+
d.value = "", y.value = !1, a.value = !1;
|
|
441
|
+
}, I = w(() => {
|
|
442
|
+
var m, f;
|
|
443
|
+
const r = v.useModal;
|
|
444
|
+
return !!(((m = r.isOpen) == null ? void 0 : m.value) ?? ((f = r.isOpened) == null ? void 0 : f.value));
|
|
445
|
+
});
|
|
446
|
+
G(I, (r) => {
|
|
447
|
+
r || (c.value = null, b());
|
|
448
|
+
});
|
|
449
|
+
const M = (r, m) => {
|
|
450
|
+
c.value = r, b(), m == null || m();
|
|
451
|
+
}, N = async () => {
|
|
452
|
+
a.value = !0;
|
|
453
|
+
try {
|
|
454
|
+
d.value = await v.createLink(c.value), p("created", d.value, c.value);
|
|
455
|
+
} finally {
|
|
456
|
+
a.value = !1;
|
|
457
|
+
}
|
|
458
|
+
}, R = async () => {
|
|
459
|
+
await Y(d.value) && (y.value = !0, p("copied", d.value), v.closeOnCopy && v.useModal.close());
|
|
460
|
+
};
|
|
461
|
+
return (r, m) => (s(), L(n(T), {
|
|
462
|
+
useModal: t.useModal,
|
|
463
|
+
title: o.value("ui.user_list.invite_user")
|
|
464
|
+
}, {
|
|
465
|
+
default: x(() => [
|
|
466
|
+
e("div", He, [
|
|
467
|
+
t.appName ? (s(), i("div", qe, [
|
|
468
|
+
g(n(B), {
|
|
469
|
+
src: t.appLogo,
|
|
470
|
+
text: t.appName,
|
|
471
|
+
size: 40,
|
|
472
|
+
class: "flex-shrink-0"
|
|
473
|
+
}, null, 8, ["src", "text"]),
|
|
474
|
+
e("p", Ve, l(t.appName), 1)
|
|
475
|
+
])) : h("", !0),
|
|
476
|
+
t.roleOptions.length > 0 ? (s(), i("div", Ee, [
|
|
477
|
+
e("p", Pe, l(o.value("ui.user_list.invite_select_role")), 1),
|
|
478
|
+
g(n(E), { class: "block w-full" }, {
|
|
479
|
+
button: x(({ onToggle: f }) => {
|
|
480
|
+
var u;
|
|
481
|
+
return [
|
|
482
|
+
g(n(C), {
|
|
483
|
+
"icon-after": n(W),
|
|
484
|
+
label: ((u = c.value) == null ? void 0 : u.name) ?? o.value("ui.user_list.regular_user"),
|
|
485
|
+
variant: "secondary",
|
|
486
|
+
"data-test": "invite-role",
|
|
487
|
+
onClick: (S) => f()
|
|
488
|
+
}, null, 8, ["icon-after", "label", "onClick"])
|
|
489
|
+
];
|
|
490
|
+
}),
|
|
491
|
+
menu: x(({ onToggle: f }) => [
|
|
492
|
+
e("div", Ge, [
|
|
493
|
+
e("div", {
|
|
494
|
+
class: $(["!break-words !whitespace-normal !text-left overflow-hidden px-3 py-1.5 cursor-pointer hover:bg-gray-50 select-none", c.value === null ? "bg-blue-50" : ""]),
|
|
495
|
+
"data-test": "invite-role-empty",
|
|
496
|
+
onClick: (u) => M(null, f)
|
|
497
|
+
}, l(o.value("ui.user_list.regular_user")), 11, Je),
|
|
498
|
+
(s(!0), i(U, null, A(t.roleOptions, (u) => {
|
|
499
|
+
var S;
|
|
500
|
+
return s(), i("div", {
|
|
501
|
+
key: u.id,
|
|
502
|
+
class: $(["!break-words !whitespace-normal !text-left overflow-hidden px-3 py-1.5 cursor-pointer hover:bg-gray-50 select-none", ((S = c.value) == null ? void 0 : S.id) === u.id ? "bg-blue-50" : ""]),
|
|
503
|
+
"data-test": `invite-role-${u.id}`,
|
|
504
|
+
onClick: (et) => M(u, f)
|
|
505
|
+
}, [
|
|
506
|
+
e("div", null, l(u.name), 1),
|
|
507
|
+
u.info ? (s(), i("div", Qe, l(u.info), 1)) : h("", !0)
|
|
508
|
+
], 10, Ke);
|
|
509
|
+
}), 128))
|
|
510
|
+
])
|
|
511
|
+
]),
|
|
512
|
+
_: 1
|
|
513
|
+
})
|
|
514
|
+
])) : h("", !0),
|
|
515
|
+
r.$slots.hint ? (s(), i("div", We, [
|
|
516
|
+
k(r.$slots, "hint")
|
|
517
|
+
])) : h("", !0),
|
|
518
|
+
d.value ? (s(), i("div", Xe, [
|
|
519
|
+
e("div", null, [
|
|
520
|
+
e("p", Ye, l(o.value("ui.user_list.invite_link")), 1),
|
|
521
|
+
g(n(X), {
|
|
522
|
+
"model-value": d.value,
|
|
523
|
+
readonly: "",
|
|
524
|
+
"data-test": "invite-link"
|
|
525
|
+
}, null, 8, ["model-value"])
|
|
526
|
+
]),
|
|
527
|
+
y.value ? (s(), i("div", Ze, l(o.value("ui.user_list.invite_link_copied")), 1)) : (s(), L(n(C), {
|
|
528
|
+
key: 1,
|
|
529
|
+
class: "w-full",
|
|
530
|
+
variant: "primary",
|
|
531
|
+
label: o.value("ui.user_list.invite_copy_link"),
|
|
532
|
+
"data-test": "invite-copy",
|
|
533
|
+
onClick: R
|
|
534
|
+
}, null, 8, ["label"])),
|
|
535
|
+
k(r.$slots, "share", {
|
|
536
|
+
link: d.value,
|
|
537
|
+
role: c.value
|
|
538
|
+
})
|
|
539
|
+
])) : (s(), i("div", De, [
|
|
540
|
+
g(n(C), {
|
|
541
|
+
class: "w-full",
|
|
542
|
+
variant: "primary",
|
|
543
|
+
label: o.value("ui.user_list.invite_create_link"),
|
|
544
|
+
"is-loading": a.value,
|
|
545
|
+
"data-test": "invite-create",
|
|
546
|
+
onClick: N
|
|
547
|
+
}, null, 8, ["label", "is-loading"])
|
|
548
|
+
]))
|
|
549
|
+
])
|
|
550
|
+
]),
|
|
551
|
+
_: 3
|
|
552
|
+
}, 8, ["useModal", "title"]));
|
|
553
|
+
}
|
|
554
|
+
});
|
|
555
|
+
export {
|
|
556
|
+
Mt as OneUserInviteModal,
|
|
557
|
+
Ot as OneUserList,
|
|
558
|
+
Te as OneUserListItem
|
|
559
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copies text to the clipboard. Prefers the async Clipboard API and falls
|
|
3
|
+
* back to a hidden textarea + document.execCommand('copy') for http/older
|
|
4
|
+
* browsers. Resolves to true when the copy succeeded.
|
|
5
|
+
*/
|
|
6
|
+
export declare function copyToClipboard(text: string): Promise<boolean>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Regex-based thousands grouping (ported from finance/formatPrice.js and
|
|
3
|
+
* fin-bank/formatNumber.ts which shared the same algorithm).
|
|
4
|
+
* n: decimal places, x: group length, s: group separator, c: decimal separator
|
|
5
|
+
*/
|
|
6
|
+
export declare const formatNumber: (value: number, n?: number, x?: number, s?: string, c?: string) => string;
|
|
7
|
+
/** Alias kept for staff/invoice API compatibility */
|
|
8
|
+
export declare const formatAnyPrice: (value: number, n?: number, x?: number, s?: string, c?: string) => string;
|
|
9
|
+
export declare const formatPrice: (price: number, currency?: string, locale?: string) => string;
|
|
10
|
+
export declare const formatDate: (date: dayjs.ConfigType, format?: string) => string;
|
|
11
|
+
export declare const formatDateToInput: (date: dayjs.ConfigType) => string;
|
|
12
|
+
/** Seconds -> "1d 2h 3m 4s", zero units omitted (ported from voicecall/vizor) */
|
|
13
|
+
export declare function formatDuration(secondsInput: number): string;
|
|
14
|
+
/** Human-readable byte size (ported from fin-bank/formatBytes.ts) */
|
|
15
|
+
export declare const formatBytes: (bytes: number, decimals?: number) => string;
|
|
16
|
+
export declare const guessTimezone: () => string;
|
|
17
|
+
export declare const getTimezoneOffset: () => number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("../clipboard-494e1513.cjs"),c=require("dayjs"),M=require("dayjs/plugin/utc"),d=require("dayjs/plugin/timezone");c.extend(M);c.extend(d);const m=(e,t=2,r=3,o=" ",a=".")=>{const s=`\\d(?=(\\d{${r||3}})+${t>0?"\\D":"$"})`,i=e.toFixed(Math.max(0,~~t));return(a?i.replace(".",a):i).replace(new RegExp(s,"g"),`$&${o}`)},w=m,b=(e,t="UAH",r="uk-UA")=>e.toLocaleString(r,{style:"currency",currency:t}),f=(e,t="DD.MM.YYYY")=>c(e).format(t),y=e=>f(e,"YYYY-MM-DD");function T(e){let t=Math.floor(e);return[{label:"d",value:86400},{label:"h",value:3600},{label:"m",value:60},{label:"s",value:1}].map(({label:o,value:a})=>{const s=Math.floor(t/a);return t%=a,s>0?`${s}${o}`:""}).filter(Boolean).join(" ")||"0s"}const z=(e,t=1)=>{if(e===0)return"0 B";const r=1024,o=t||2,a=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],s=Math.floor(Math.log(e)/Math.log(r));return`${parseFloat((e/Math.pow(r,s)).toFixed(o))} ${a[s]}`},_=()=>c.tz.guess(),$=()=>new Date().getTimezoneOffset(),p=e=>e.replace(/[A-Z]/g,(t,r)=>r>0?" "+t.toLowerCase():t).toLowerCase().replace(/[-_\s]+([a-z0-9])/g,(t,r)=>r.toUpperCase()),A=e=>e.replace(/\s+/g,"_").replace(/-+/g,"_").replace(/[A-Z]/g,(t,r)=>(r>0?"_":"")+t.toLowerCase()).replace(/_+/g,"_"),B=e=>{const t=p(e);return t.charAt(0).toUpperCase()+t.slice(1)},D=e=>typeof e=="string"&&e!=="",S=(e,t=" ")=>t.repeat(Math.max(0,e)),v=e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase(),L=e=>e.charAt(0).toUpperCase()+e.slice(1),P=e=>e.charAt(0).toLowerCase()+e.slice(1),h=(e,t)=>typeof t=="string"?t.trim().toLowerCase().includes(`${e}`.trim().toLowerCase()):Array.isArray(t)?t.some(r=>h(e,r)):!1,Y=(e,t,r={showCounter:!0})=>{const o=[2,0,1,1,1,2],a=r.showCounter&&e>1?e:"",s=t[e%100>4&&e%100<20?2:o[Math.min(e%10,5)]];return`${a} ${s}`.trim()},k={а:"a",б:"b",в:"v",г:"h",ґ:"g",д:"d",е:"e",є:"ie",ж:"zh",з:"z",и:"y",і:"i",ї:"i",й:"i",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"kh",ц:"ts",ч:"ch",ш:"sh",щ:"shch",ь:"",ю:"iu",я:"ia",ы:"y",э:"e",ё:"e",ъ:""},x=e=>e.toLowerCase().split("").map(t=>k[t]??t).join("").replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"").replace(/^(\d)/,"_$1"),g=(e,t=0)=>{let r=3735928559^t,o=1103547991^t;for(let a=0,s;a<e.length;a++)s=e.charCodeAt(a),r=Math.imul(r^s,2654435761),o=Math.imul(o^s,1597334677);return r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(o^o>>>13,3266489909),o=Math.imul(o^o>>>16,2246822507),o^=Math.imul(r^r>>>13,3266489909),4294967296*(2097151&o)+(r>>>0)},O=e=>g(JSON.stringify(e)),U=(e,t={})=>{const r=t.url??"/version.json",o=t.intervalMs??3e5;let a=null,s=!1;const i=()=>{if(a&&clearTimeout(a),s)return;const l=window._app_hash||null,u=window._app_version||null;!l||!u||(fetch(`${r}?t=${Date.now()}`).then(n=>n.json()).then(n=>{n.version!==u?e("version",n.version??""):n.hash!==l&&e("build",n.hash??"")}).catch(n=>{console.error("checkVersion",n)}),a=setTimeout(i,o))};return a=setTimeout(i,o),{run:i,stop:()=>{s=!0,a&&clearTimeout(a)}}};exports.copyToClipboard=C.copyToClipboard;exports.capitalize=v;exports.containsString=h;exports.createVersionChecker=U;exports.cyrb53=g;exports.cyrb53FromObject=O;exports.formatAnyPrice=w;exports.formatBytes=z;exports.formatDate=f;exports.formatDateToInput=y;exports.formatDuration=T;exports.formatNumber=m;exports.formatPrice=b;exports.getTimezoneOffset=$;exports.guessTimezone=_;exports.isString=D;exports.lcfirst=P;exports.makeString=S;exports.pluralize=Y;exports.toCamelCase=p;exports.toPascalCase=B;exports.toSnakeCase=A;exports.transliterate=x;exports.ucfirst=L;
|