@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/tooltip/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { _ as T } from "../OneTooltip.vue_vue_type_script_setup_true_lang-c492c128.js";
|
|
2
|
+
import "vue";
|
|
1
3
|
const d = /* @__PURE__ */ new WeakMap();
|
|
2
|
-
let c = !1,
|
|
4
|
+
let c = !1, n = null, f = null;
|
|
3
5
|
function g() {
|
|
4
6
|
if (c || typeof document > "u")
|
|
5
7
|
return;
|
|
@@ -52,53 +54,54 @@ function g() {
|
|
|
52
54
|
}
|
|
53
55
|
`, document.head.appendChild(t), c = !0;
|
|
54
56
|
}
|
|
55
|
-
function
|
|
56
|
-
return
|
|
57
|
+
function x() {
|
|
58
|
+
return n && document.body.contains(n) || (n = document.createElement("div"), n.className = "one-tooltip-floating", document.body.appendChild(n)), n;
|
|
57
59
|
}
|
|
58
|
-
function u(t, e,
|
|
60
|
+
function u(t, e, i, s) {
|
|
59
61
|
const o = t.getBoundingClientRect(), p = e.getBoundingClientRect();
|
|
60
|
-
let
|
|
61
|
-
|
|
62
|
+
let a = 0, r = 0, l = "";
|
|
63
|
+
i.startsWith("right") ? (a = o.right + s, r = o.top + o.height / 2, l = "translateY(-50%)") : i.startsWith("left") ? (a = o.left - s - p.width, r = o.top + o.height / 2, l = "translateY(-50%)") : i.startsWith("bottom") ? (a = o.left + o.width / 2, r = o.bottom + s, l = "translateX(-50%)") : (a = o.left + o.width / 2, r = o.top - s - p.height, l = "translateX(-50%)"), e.style.left = `${a}px`, e.style.top = `${r}px`, e.style.transform = l;
|
|
62
64
|
}
|
|
63
|
-
function
|
|
64
|
-
|
|
65
|
+
function v() {
|
|
66
|
+
n && (n.style.visibility = "hidden", n.style.opacity = "0", f = null);
|
|
65
67
|
}
|
|
66
|
-
function
|
|
68
|
+
function h(t) {
|
|
67
69
|
const e = d.get(t);
|
|
68
|
-
e && (t.removeEventListener("mouseenter", e.onEnter), t.removeEventListener("mouseleave", e.onLeave), window.removeEventListener("scroll", e.onScroll, !0), window.removeEventListener("resize", e.onScroll), d.delete(t), f === t &&
|
|
70
|
+
e && (t.removeEventListener("mouseenter", e.onEnter), t.removeEventListener("mouseleave", e.onLeave), window.removeEventListener("scroll", e.onScroll, !0), window.removeEventListener("resize", e.onScroll), d.delete(t), f === t && v());
|
|
69
71
|
}
|
|
70
|
-
function
|
|
71
|
-
g(),
|
|
72
|
-
let
|
|
73
|
-
typeof e.value == "string" ?
|
|
72
|
+
function m(t, e) {
|
|
73
|
+
g(), h(t);
|
|
74
|
+
let i = "", s = 8;
|
|
75
|
+
typeof e.value == "string" ? i = e.value : e.value && typeof e.value == "object" && (i = e.value.text || "", typeof e.value.offset == "number" && (s = e.value.offset));
|
|
74
76
|
const o = e.arg || "top";
|
|
75
|
-
if (!
|
|
77
|
+
if (!i)
|
|
76
78
|
return;
|
|
77
79
|
const p = () => {
|
|
78
|
-
const l =
|
|
79
|
-
l.textContent =
|
|
80
|
+
const l = x();
|
|
81
|
+
l.textContent = i, l.dataset.position = o, l.style.visibility = "visible", l.style.opacity = "1", f = t, u(t, l, o, s);
|
|
82
|
+
}, a = () => {
|
|
83
|
+
f === t && v();
|
|
80
84
|
}, r = () => {
|
|
81
|
-
f === t &&
|
|
82
|
-
}, s = () => {
|
|
83
|
-
f === t && i && u(t, i, o, a);
|
|
85
|
+
f === t && n && u(t, n, o, s);
|
|
84
86
|
};
|
|
85
|
-
t.addEventListener("mouseenter", p), t.addEventListener("mouseleave",
|
|
87
|
+
t.addEventListener("mouseenter", p), t.addEventListener("mouseleave", a), window.addEventListener("scroll", r, !0), window.addEventListener("resize", r), d.set(t, { onEnter: p, onLeave: a, onScroll: r });
|
|
86
88
|
}
|
|
87
|
-
const
|
|
89
|
+
const y = (t) => {
|
|
88
90
|
t.directive("onetooltip", {
|
|
89
|
-
mounted(e,
|
|
90
|
-
|
|
91
|
+
mounted(e, i) {
|
|
92
|
+
m(e, i);
|
|
91
93
|
},
|
|
92
|
-
updated(e,
|
|
93
|
-
|
|
94
|
+
updated(e, i) {
|
|
95
|
+
m(e, i);
|
|
94
96
|
},
|
|
95
97
|
beforeUnmount(e) {
|
|
96
|
-
|
|
98
|
+
h(e);
|
|
97
99
|
}
|
|
98
100
|
});
|
|
99
|
-
},
|
|
100
|
-
|
|
101
|
+
}, w = (t) => {
|
|
102
|
+
y(t);
|
|
101
103
|
};
|
|
102
104
|
export {
|
|
103
|
-
|
|
105
|
+
T as OneTooltip,
|
|
106
|
+
w as default
|
|
104
107
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const s=require("vue"),e=s.ref(null);function o(){return{confirm:(t={})=>new Promise(n=>{var u;(u=e.value)==null||u.resolve(!1),e.value={options:t,resolve:n}})}}function c(){const r=t=>{var n;(n=e.value)==null||n.resolve(t),e.value=null};return{current:e,accept:()=>r(!0),cancel:()=>r(!1)}}exports.useConfirm=o;exports.useConfirmState=c;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ref as u } from "vue";
|
|
2
|
+
const e = u(null);
|
|
3
|
+
function s() {
|
|
4
|
+
return { confirm: (t = {}) => new Promise((n) => {
|
|
5
|
+
var o;
|
|
6
|
+
(o = e.value) == null || o.resolve(!1), e.value = { options: t, resolve: n };
|
|
7
|
+
}) };
|
|
8
|
+
}
|
|
9
|
+
function a() {
|
|
10
|
+
const r = (t) => {
|
|
11
|
+
var n;
|
|
12
|
+
(n = e.value) == null || n.resolve(t), e.value = null;
|
|
13
|
+
};
|
|
14
|
+
return {
|
|
15
|
+
current: e,
|
|
16
|
+
accept: () => r(!0),
|
|
17
|
+
cancel: () => r(!1)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
a,
|
|
22
|
+
s as u
|
|
23
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { shallowRef as L, ref as t, computed as f, reactive as M, watch as T } from "vue";
|
|
2
|
+
const l = L({});
|
|
3
|
+
function N(n, h, a = {}) {
|
|
4
|
+
const r = t(!1), c = t(!1), m = t(null), b = f(() => {
|
|
5
|
+
var u;
|
|
6
|
+
const e = ((u = l.value[n]) == null ? void 0 : u.items) ?? [];
|
|
7
|
+
return a.mapItem ? e.map(a.mapItem) : e;
|
|
8
|
+
}), o = f(() => {
|
|
9
|
+
var e;
|
|
10
|
+
return ((e = l.value[n]) == null ? void 0 : e.next_cursor) ?? null;
|
|
11
|
+
}), g = f(() => o.value != null), s = t(""), i = t(null), v = M({}), x = (e) => a.mapResponse ? a.mapResponse(e) : e, d = () => {
|
|
12
|
+
r.value = !0, m.value = null, h({ search: s.value, period: i.value, filter: v }).then((e) => {
|
|
13
|
+
l.value = { ...l.value, [n]: x(e) };
|
|
14
|
+
}).catch((e) => {
|
|
15
|
+
m.value = e;
|
|
16
|
+
}).finally(() => {
|
|
17
|
+
r.value = !1;
|
|
18
|
+
});
|
|
19
|
+
}, p = () => {
|
|
20
|
+
o.value == null || r.value || c.value || (c.value = !0, h({
|
|
21
|
+
cursor: o.value,
|
|
22
|
+
search: s.value,
|
|
23
|
+
period: i.value,
|
|
24
|
+
filter: v
|
|
25
|
+
}).then((e) => {
|
|
26
|
+
const u = x(e), w = l.value[n] ?? { items: [], next_cursor: null };
|
|
27
|
+
l.value = {
|
|
28
|
+
...l.value,
|
|
29
|
+
[n]: {
|
|
30
|
+
items: [...w.items, ...u.items],
|
|
31
|
+
next_cursor: u.next_cursor
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}).catch((e) => {
|
|
35
|
+
var u;
|
|
36
|
+
(u = a.onError) == null || u.call(a, e);
|
|
37
|
+
}).finally(() => {
|
|
38
|
+
c.value = !1;
|
|
39
|
+
}));
|
|
40
|
+
};
|
|
41
|
+
a.lazy !== !0 && d();
|
|
42
|
+
const _ = a.debounceMs ?? 333;
|
|
43
|
+
let R;
|
|
44
|
+
return T([s, i, v], () => {
|
|
45
|
+
clearTimeout(R), R = setTimeout(d, _);
|
|
46
|
+
}), {
|
|
47
|
+
isLoading: r,
|
|
48
|
+
isLoadingNext: c,
|
|
49
|
+
items: b,
|
|
50
|
+
error: m,
|
|
51
|
+
nextCursor: o,
|
|
52
|
+
hasNext: g,
|
|
53
|
+
searchQuery: s,
|
|
54
|
+
period: i,
|
|
55
|
+
filter: v,
|
|
56
|
+
load: d,
|
|
57
|
+
next: p
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export {
|
|
61
|
+
N as u
|
|
62
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const u=require("vue"),l=u.shallowRef({});function w(r,d,a={}){const n=u.ref(!1),s=u.ref(!1),m=u.ref(null),g=u.computed(()=>{var t;const e=((t=l.value[r])==null?void 0:t.items)??[];return a.mapItem?e.map(a.mapItem):e}),c=u.computed(()=>{var e;return((e=l.value[r])==null?void 0:e.next_cursor)??null}),p=u.computed(()=>c.value!=null),o=u.ref(""),i=u.ref(null),v=u.reactive({}),h=e=>a.mapResponse?a.mapResponse(e):e,f=()=>{n.value=!0,m.value=null,d({search:o.value,period:i.value,filter:v}).then(e=>{l.value={...l.value,[r]:h(e)}}).catch(e=>{m.value=e}).finally(()=>{n.value=!1})},L=()=>{c.value==null||n.value||s.value||(s.value=!0,d({cursor:c.value,search:o.value,period:i.value,filter:v}).then(e=>{const t=h(e),b=l.value[r]??{items:[],next_cursor:null};l.value={...l.value,[r]:{items:[...b.items,...t.items],next_cursor:t.next_cursor}}}).catch(e=>{var t;(t=a.onError)==null||t.call(a,e)}).finally(()=>{s.value=!1}))};a.lazy!==!0&&f();const R=a.debounceMs??333;let x;const _=()=>{clearTimeout(x),x=setTimeout(f,R)};return u.watch([o,i,v],_),{isLoading:n,isLoadingNext:s,items:g,error:m,nextCursor:c,hasNext:p,searchQuery:o,period:i,filter:v,load:f,next:L}}exports.useCursorList=w;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { watch as i, onMounted as f, onBeforeUnmount as s, unref as a, ref as E, watchEffect as h } from "vue";
|
|
2
|
+
const c = (t) => {
|
|
3
|
+
if (Array.isArray(t))
|
|
4
|
+
return t.map(a);
|
|
5
|
+
const r = a(t);
|
|
6
|
+
return Array.isArray(r) ? r : [r];
|
|
7
|
+
}, d = (t, r) => {
|
|
8
|
+
let n;
|
|
9
|
+
const u = (e) => {
|
|
10
|
+
e.forEach((l) => {
|
|
11
|
+
const o = a(l);
|
|
12
|
+
if (o) {
|
|
13
|
+
if (!(o instanceof Element))
|
|
14
|
+
throw console.error("Vuestic: Trying to observe non-HTMLElement", {
|
|
15
|
+
target: o,
|
|
16
|
+
array: t
|
|
17
|
+
}), new Error("Vuestic: Unable to observe non-HTMLElement");
|
|
18
|
+
o && (n == null || n.observe(o));
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
return i(t, (e) => {
|
|
23
|
+
n == null || n.disconnect(), u(c(e));
|
|
24
|
+
}), f(() => {
|
|
25
|
+
n = new ResizeObserver(r), u(c(t));
|
|
26
|
+
}), s(() => n == null ? void 0 : n.disconnect()), n;
|
|
27
|
+
}, y = (t) => {
|
|
28
|
+
const r = E(null);
|
|
29
|
+
return d([t], () => {
|
|
30
|
+
var n;
|
|
31
|
+
r.value = ((n = t.value) == null ? void 0 : n.clientWidth) ?? null;
|
|
32
|
+
}), h(() => {
|
|
33
|
+
var n;
|
|
34
|
+
r.value = ((n = t.value) == null ? void 0 : n.clientWidth) ?? null;
|
|
35
|
+
}), r;
|
|
36
|
+
};
|
|
37
|
+
export {
|
|
38
|
+
d as a,
|
|
39
|
+
y as u
|
|
40
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=require("vue"),a=e=>{if(Array.isArray(e))return e.map(r.unref);const t=r.unref(e);return Array.isArray(t)?t:[t]},l=(e,t)=>{let n;const c=u=>{u.forEach(i=>{const o=r.unref(i);if(o){if(!(o instanceof Element))throw console.error("Vuestic: Trying to observe non-HTMLElement",{target:o,array:e}),new Error("Vuestic: Unable to observe non-HTMLElement");o&&(n==null||n.observe(o))}})};return r.watch(e,u=>{n==null||n.disconnect(),c(a(u))}),r.onMounted(()=>{n=new ResizeObserver(t),c(a(e))}),r.onBeforeUnmount(()=>n==null?void 0:n.disconnect()),n},s=e=>{const t=r.ref(null);return l([e],()=>{var n;t.value=((n=e.value)==null?void 0:n.clientWidth)??null}),r.watchEffect(()=>{var n;t.value=((n=e.value)==null?void 0:n.clientWidth)??null}),t};exports.useElementWidth=s;exports.useResizeObserver=l;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ref as o } from "vue";
|
|
2
|
+
function d(f, n = {}) {
|
|
3
|
+
const u = o(!1), r = o(0), a = o(null), t = (i) => (u.value = !0, r.value = 0, a.value = null, f(i, (e) => {
|
|
4
|
+
r.value = e;
|
|
5
|
+
}).then((e) => {
|
|
6
|
+
var l;
|
|
7
|
+
return (l = n.onUploaded) == null || l.call(n, e), e;
|
|
8
|
+
}).catch((e) => {
|
|
9
|
+
var l;
|
|
10
|
+
a.value = e, (l = n.onError) == null || l.call(n, e);
|
|
11
|
+
}).finally(() => {
|
|
12
|
+
u.value = !1, r.value = 100;
|
|
13
|
+
}));
|
|
14
|
+
return { isUploading: u, progress: r, error: a, upload: t, onFileChange: (i) => {
|
|
15
|
+
const e = i.target;
|
|
16
|
+
if (!e.files || e.files.length === 0)
|
|
17
|
+
return;
|
|
18
|
+
const l = e.files[0];
|
|
19
|
+
e.value = "", t(l);
|
|
20
|
+
} };
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
d as u
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const o=require("vue");function f(c,n={}){const r=o.ref(!1),u=o.ref(0),a=o.ref(null),t=i=>(r.value=!0,u.value=0,a.value=null,c(i,e=>{u.value=e}).then(e=>{var l;return(l=n.onUploaded)==null||l.call(n,e),e}).catch(e=>{var l;a.value=e,(l=n.onError)==null||l.call(n,e)}).finally(()=>{r.value=!1,u.value=100}));return{isUploading:r,progress:u,error:a,upload:t,onFileChange:i=>{const e=i.target;if(!e.files||e.files.length===0)return;const l=e.files[0];e.value="",t(l)}}}exports.useFileUpload=f;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const u=require("./useMediaQuery-1d87df02.cjs");function s(e=768){return u.useMediaQuery(`(max-width: ${e-1}px)`)}exports.useIsMobile=s;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("vue"),r={sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function s(u){const a=n.ref(!1);let e=null,t=null;const i=()=>{e&&t&&e.removeEventListener("change",t),e=null,t=null},l=o=>{i(),!(typeof window>"u"||typeof window.matchMedia!="function")&&(e=window.matchMedia(o),a.value=e.matches,t=c=>{a.value=c.matches},e.addEventListener("change",t))};return n.onMounted(()=>{l(n.toValue(u)),n.watch(()=>n.toValue(u),o=>{l(o)})}),n.onBeforeUnmount(()=>{i()}),a}function d(u){return s(`(min-width: ${r[u]}px)`)}exports.breakpointValues=r;exports.useBreakpoint=d;exports.useMediaQuery=s;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ref as s, onMounted as c, toValue as l, watch as d, onBeforeUnmount as m } from "vue";
|
|
2
|
+
const f = {
|
|
3
|
+
sm: 640,
|
|
4
|
+
md: 768,
|
|
5
|
+
lg: 1024,
|
|
6
|
+
xl: 1280,
|
|
7
|
+
"2xl": 1536
|
|
8
|
+
};
|
|
9
|
+
function h(t) {
|
|
10
|
+
const a = s(!1);
|
|
11
|
+
let e = null, n = null;
|
|
12
|
+
const u = () => {
|
|
13
|
+
e && n && e.removeEventListener("change", n), e = null, n = null;
|
|
14
|
+
}, i = (o) => {
|
|
15
|
+
u(), !(typeof window > "u" || typeof window.matchMedia != "function") && (e = window.matchMedia(o), a.value = e.matches, n = (r) => {
|
|
16
|
+
a.value = r.matches;
|
|
17
|
+
}, e.addEventListener("change", n));
|
|
18
|
+
};
|
|
19
|
+
return c(() => {
|
|
20
|
+
i(l(t)), d(
|
|
21
|
+
() => l(t),
|
|
22
|
+
(o) => {
|
|
23
|
+
i(o);
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
}), m(() => {
|
|
27
|
+
u();
|
|
28
|
+
}), a;
|
|
29
|
+
}
|
|
30
|
+
function w(t) {
|
|
31
|
+
return h(`(min-width: ${f[t]}px)`);
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
w as a,
|
|
35
|
+
f as b,
|
|
36
|
+
h as u
|
|
37
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ref as s, onMounted as r, onBeforeUnmount as d } from "vue";
|
|
2
|
+
function f(a = !1) {
|
|
3
|
+
const o = s(a), t = s(void 0);
|
|
4
|
+
let e = null;
|
|
5
|
+
const l = () => {
|
|
6
|
+
e && (clearTimeout(e), e = null), o.value = !1, t.value = void 0;
|
|
7
|
+
}, i = (n) => {
|
|
8
|
+
t.value = n, o.value = !0;
|
|
9
|
+
}, c = (n) => {
|
|
10
|
+
e && clearTimeout(e), e = setTimeout(l, n * 1e3);
|
|
11
|
+
}, u = (n) => {
|
|
12
|
+
n.key === "Escape" && o.value && l();
|
|
13
|
+
};
|
|
14
|
+
return r(() => {
|
|
15
|
+
document.addEventListener("keydown", u);
|
|
16
|
+
}), d(() => {
|
|
17
|
+
document.removeEventListener("keydown", u), e && clearTimeout(e);
|
|
18
|
+
}), {
|
|
19
|
+
isOpened: o,
|
|
20
|
+
isOpen: o,
|
|
21
|
+
// alias for backward compatibility
|
|
22
|
+
data: t,
|
|
23
|
+
open: i,
|
|
24
|
+
close: l,
|
|
25
|
+
closeWithDelay: c
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
f as u
|
|
30
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("vue");function r(i=!1){const o=t.ref(i),u=t.ref(void 0);let e=null;const l=()=>{e&&(clearTimeout(e),e=null),o.value=!1,u.value=void 0},a=n=>{u.value=n,o.value=!0},c=n=>{e&&clearTimeout(e),e=setTimeout(l,n*1e3)},s=n=>{n.key==="Escape"&&o.value&&l()};return t.onMounted(()=>{document.addEventListener("keydown",s)}),t.onBeforeUnmount(()=>{document.removeEventListener("keydown",s),e&&clearTimeout(e)}),{isOpened:o,isOpen:o,data:u,open:a,close:l,closeWithDelay:c}}exports.useModal=r;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),S=require("../ChevronRightIcon-2992cf0d.cjs"),p=require("../button/index.cjs"),h=require("../OneAvatar.vue_vue_type_script_setup_true_lang-2d9f44f1.cjs"),N=require("../OneModal-0e92c039.cjs"),B=require("../useModal-aa6f4a57.cjs"),C=require("../OneDropdownAuto.vue_vue_type_script_setup_true_lang-bf923b04.cjs"),$=require("../dateTime/index.cjs"),V=require("../i18n/index.cjs"),O=require("../skeleton/index.cjs"),q=require("../ChevronDownIcon-6889ac87.cjs"),M=require("../OneFormInput.vue_vue_type_script_setup_true_lang-f6f7cd96.cjs"),D=require("../clipboard-494e1513.cjs");require("../SpinnerIcon-01be39fe.cjs");require("../_plugin-vue_export-helper-f246444f.cjs");require("../useIsMobile-7b1f08cf.cjs");require("../useMediaQuery-1d87df02.cjs");require("../dropdown-5cb64ab7.cjs");require("@floating-ui/dom");require("@floating-ui/vue");require("dayjs");require("dayjs/plugin/relativeTime");require("dayjs/plugin/utc");require("dayjs/plugin/timezone");require("../XMarkIcon-f94baa4c.cjs");function L(t,v){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:"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"})])}function I(t,v){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:"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"})])}function E(t,v){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:"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"})])}const j={class:"border-b border-gray-100 last:border-b-0 hover:bg-gray-50 transition-colors"},z={class:"flex gap-3 items-center px-4 py-3"},U={class:"flex-grow flex-shrink min-w-0"},T={class:"flex items-center flex-wrap gap-y-0.5"},F={class:"font-semibold"},R={key:0,class:"text-blue-700 bg-blue-100 border border-blue-200 rounded-md px-2 mx-2 text-sm"},A={key:1,class:"text-red-700 bg-red-100 border border-red-200 rounded-md px-2 mx-2 text-sm"},H={class:"text-sm text-gray-500 hidden sm:block truncate"},P={class:"flex items-center gap-2"},G={key:0,class:"text-sm font-medium text-gray-400 hidden lg:block"},J={key:2,class:"p-1 ml-3 w-8"},K={class:"py-2"},Q={class:"flex gap-3 items-center px-5 pb-3 mb-2 border-b"},W={class:"flex-grow min-w-0"},X={class:"font-medium truncate"},Y={class:"text-sm text-gray-500 truncate"},Z={key:0,class:"text-xs text-gray-400 mt-1 flex gap-1 items-center"},ee={class:"px-3"},te={class:"text-sm font-medium"},ne=["onClick"],oe={class:"flex-shrink-0 w-8 h-8 rounded-full bg-blue-50 flex items-center justify-center"},le={class:"text-sm font-medium"},re={key:0,class:"text-xs text-gray-400"},se={class:"sm:w-72"},ae=["onClick"],ie=["data-test","onClick"],ce={key:0,class:"text-xs text-gray-600"},de={class:"flex-shrink-0 w-8 h-8 rounded-full bg-red-50 flex items-center justify-center"},ue={class:"text-sm font-medium text-red-600"},me={class:"flex gap-3 items-center px-4 py-3"},ve={class:"flex-grow flex-shrink min-w-0"},ge={class:"flex gap-3"},pe={key:0,class:"text-sm font-medium"},fe={class:"text-sm text-gray-500"},ke={class:"text-sm text-gray-600 mb-6 px-4 pt-3"},ye={class:"flex justify-end gap-3 px-4 pb-3"},w=e.defineComponent({__name:"OneUserListItem",props:{user:{type:Object,required:!0},currentUserId:{type:[String,Number],default:void 0},roleOptions:{type:Array,default:()=>[]},canManage:{type:Boolean,default:!0},t:{type:Function,default:void 0}},emits:["toggle-access","change-role","remove"],setup(t,{emit:v}){const c=t,u=v,f=V.useOnebI18n(),n=e.computed(()=>c.t??f),a=B.useModal(),s=B.useModal(),m=e.computed(()=>c.currentUserId!=null&&String(c.currentUserId)===String(c.user.id)),o=e.computed(()=>(c.user.roles??[]).map(l=>l.name).join(", ")),g=l=>(c.user.roles??[]).some(i=>String(i.alias??i.id)===String(l.alias??l.id)),_=()=>u("toggle-access",c.user),k=(l,i)=>{u("change-role",c.user,l),i==null||i()},x=()=>{a.close(),s.open()},b=()=>{u("remove",c.user),s.close()};return(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",j,[e.createElementVNode("div",z,[e.createVNode(e.unref(h._sfc_main),{src:t.user.photo_url,text:t.user.name,rounded:!0,size:"40"},null,8,["src","text"]),e.createElementVNode("div",U,[e.createElementVNode("div",T,[e.createElementVNode("span",F,e.toDisplayString(t.user.name),1),m.value?(e.openBlock(),e.createElementBlock("span",R,e.toDisplayString(n.value("ui.user_list.me")),1)):e.createCommentVNode("",!0),t.user.disabled?(e.openBlock(),e.createElementBlock("span",A,e.toDisplayString(n.value("ui.user_list.access_disabled")),1)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"badges",{user:t.user})]),e.createElementVNode("div",H,e.toDisplayString(t.user.email),1)]),e.createElementVNode("div",P,[o.value?(e.openBlock(),e.createElementBlock("div",G,e.toDisplayString(o.value),1)):e.createCommentVNode("",!0),t.canManage&&!m.value?(e.openBlock(),e.createBlock(e.unref(p.OneButton),{key:1,icon:e.unref(S.render),variant:"touch",class:"ml-3","data-test":"user-actions",onClick:i[0]||(i[0]=d=>e.unref(a).open())},null,8,["icon"])):(e.openBlock(),e.createElementBlock("div",J))])])]),e.createVNode(e.unref(N.OneModal),{useModal:e.unref(a),title:n.value("ui.user_list.user_settings")},{default:e.withCtx(()=>[e.createElementVNode("div",K,[e.createElementVNode("div",Q,[e.createVNode(e.unref(h._sfc_main),{src:t.user.photo_url,text:t.user.name,rounded:!0,size:"40"},null,8,["src","text"]),e.createElementVNode("div",W,[e.createElementVNode("div",X,e.toDisplayString(t.user.name),1),e.createElementVNode("div",Y,e.toDisplayString(t.user.email),1),t.user.added_at?(e.openBlock(),e.createElementBlock("div",Z,[e.createElementVNode("span",null,e.toDisplayString(n.value("ui.user_list.added_on"))+":",1),e.createVNode(e.unref($.OneDateTime),{value:t.user.added_at},null,8,["value"])])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",ee,[e.createElementVNode("div",{class:"flex items-center gap-3 px-3 py-2.5 rounded-lg cursor-pointer hover:bg-gray-50 transition-colors","data-test":"toggle-access",onClick:_},[e.createElementVNode("div",{class:e.normalizeClass(["flex-shrink-0 w-8 h-8 rounded-full flex items-center justify-center",t.user.disabled?"bg-red-50":"bg-green-50"])},[e.createVNode(e.unref(I),{class:e.normalizeClass(["w-4 h-4",t.user.disabled?"text-red-600":"text-green-600"])},null,8,["class"])],2),e.createElementVNode("div",te,e.toDisplayString(t.user.disabled?n.value("ui.user_list.activate"):n.value("ui.user_list.deactivate")),1)]),t.roleOptions.length>0?(e.openBlock(),e.createBlock(e.unref(C._sfc_main),{key:0,class:"block w-full"},{button:e.withCtx(({onToggle:d})=>[e.createElementVNode("div",{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","data-test":"change-role",onClick:r=>d()},[e.createElementVNode("div",oe,[e.createVNode(e.unref(L),{class:"w-4 h-4 text-blue-600"})]),e.createElementVNode("div",null,[e.createElementVNode("div",le,e.toDisplayString(n.value("ui.user_list.change_role")),1),o.value?(e.openBlock(),e.createElementBlock("div",re,e.toDisplayString(o.value),1)):e.createCommentVNode("",!0)])],8,ne)]),menu:e.withCtx(({onToggle:d})=>[e.createElementVNode("div",se,[e.createElementVNode("div",{class:e.normalizeClass(["!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":""]),"data-test":"role-empty",onClick:r=>k(null,d)},e.toDisplayString(n.value("ui.user_list.regular_user")),11,ae),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.roleOptions,r=>(e.openBlock(),e.createElementBlock("div",{key:r.id,class:e.normalizeClass(["!break-words !whitespace-normal !text-left overflow-hidden px-3 py-1.5 cursor-pointer hover:bg-gray-50 select-none",g(r)?"bg-blue-50":""]),"data-test":`role-${r.id}`,onClick:y=>k(r,d)},[e.createElementVNode("div",null,e.toDisplayString(r.name),1),r.info?(e.openBlock(),e.createElementBlock("div",ce,e.toDisplayString(r.info),1)):e.createCommentVNode("",!0)],10,ie))),128))])]),_:1})):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"actions",{user:t.user,close:e.unref(a).close}),e.createElementVNode("div",{class:"flex items-center gap-3 px-3 py-2.5 rounded-lg cursor-pointer hover:bg-red-50 transition-colors","data-test":"remove",onClick:x},[e.createElementVNode("div",de,[e.createVNode(e.unref(E),{class:"w-4 h-4 text-red-600"})]),e.createElementVNode("div",ue,e.toDisplayString(n.value("ui.user_list.delete")),1)])])])]),_:3},8,["useModal","title"]),e.createVNode(e.unref(N.OneModal),{useModal:e.unref(s),title:n.value("ui.user_list.confirm_deletion")},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createElementVNode("div",me,[e.createVNode(e.unref(h._sfc_main),{src:t.user.photo_url,text:t.user.name,rounded:!0,size:"40"},null,8,["src","text"]),e.createElementVNode("div",ve,[e.createElementVNode("div",null,e.toDisplayString(t.user.name),1),e.createElementVNode("div",ge,[o.value?(e.openBlock(),e.createElementBlock("div",pe,e.toDisplayString(o.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",fe,e.toDisplayString(t.user.email),1)])])]),e.createElementVNode("p",ke,e.toDisplayString(n.value("ui.user_list.delete_confirm")),1),e.createElementVNode("div",ye,[e.createVNode(e.unref(p.OneButton),{variant:"secondary",label:n.value("ui.confirm.Cancel"),onClick:i[1]||(i[1]=d=>e.unref(s).close())},null,8,["label"]),e.createVNode(e.unref(p.OneButton),{icon:e.unref(E),variant:"danger",label:n.value("ui.user_list.delete"),"data-test":"confirm-remove",onClick:b},null,8,["icon","label"])])])]),_:1},8,["useModal","title"])],64))}}),he={class:"bg-white rounded-lg border border-gray-100"},_e={key:0,class:"p-4 space-y-3"},xe={class:"p-6 text-center text-sm text-gray-500"},be=e.defineComponent({__name:"OneUserList",props:{users:{type:Array,required:!0},loading:{type:Boolean,default:!1},currentUserId:{type:[String,Number],default:void 0},roleOptions:{type:Array,default:()=>[]},canManage:{type:Boolean,default:!0},t:{type:Function,default:void 0}},emits:["toggle-access","change-role","remove"],setup(t,{emit:v}){const c=t,u=v,f=V.useOnebI18n(),n=e.computed(()=>c.t??f);return(a,s)=>(e.openBlock(),e.createElementBlock("div",he,[t.loading?(e.openBlock(),e.createElementBlock("div",_e,[e.createVNode(e.unref(O.OneSkeleton),{count:3,height:"h-12"})])):t.users.length===0?e.renderSlot(a.$slots,"empty",{key:1},()=>[e.createElementVNode("div",xe,e.toDisplayString(n.value("ui.user_list.empty")),1)]):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(t.users,m=>(e.openBlock(),e.createBlock(w,{key:m.id,user:m,"current-user-id":t.currentUserId,"role-options":t.roleOptions,"can-manage":t.canManage,t:c.t,onToggleAccess:s[0]||(s[0]=o=>u("toggle-access",o)),onChangeRole:s[1]||(s[1]=(o,g)=>u("change-role",o,g)),onRemove:s[2]||(s[2]=o=>u("remove",o))},e.createSlots({_:2},[a.$slots.badges?{name:"badges",fn:e.withCtx(o=>[e.renderSlot(a.$slots,"badges",e.mergeProps({ref_for:!0},o))]),key:"0"}:void 0,a.$slots.actions?{name:"actions",fn:e.withCtx(o=>[e.renderSlot(a.$slots,"actions",e.mergeProps({ref_for:!0},o))]),key:"1"}:void 0]),1032,["user","current-user-id","role-options","can-manage","t"]))),128))]))}}),Ne={class:"py-2 px-4 space-y-4","data-test":"invite-modal"},Ve={key:0,class:"flex items-center gap-3"},Be={class:"font-medium"},Ee={key:1},Ce={class:"text-sm pb-2"},we={class:"sm:w-72"},Se=["onClick"],$e=["data-test","onClick"],Oe={key:0,class:"text-xs text-gray-600"},qe={key:2,class:"text-xs font-light text-gray-500"},Me={key:3,class:"space-y-3"},De={class:"text-sm font-medium pb-1"},Le={key:0,class:"py-2 text-green-800 bg-green-100 rounded-md px-6 w-full text-center","data-test":"invite-copied"},Ie={key:4,class:"pb-2"},je=e.defineComponent({__name:"OneUserInviteModal",props:{useModal:{type:Object,required:!0},roleOptions:{type:Array,default:()=>[]},createLink:{type:Function,required:!0},appName:{type:String,default:void 0},appLogo:{type:String,default:void 0},closeOnCopy:{type:Boolean,default:!0},t:{type:Function,default:void 0}},emits:["created","copied"],setup(t,{emit:v}){const c=t,u=v,f=V.useOnebI18n(),n=e.computed(()=>c.t??f),a=e.ref(null),s=e.ref(""),m=e.ref(!1),o=e.ref(!1),g=()=>{s.value="",m.value=!1,o.value=!1},_=e.computed(()=>{var i,d;const l=c.useModal;return!!(((i=l.isOpen)==null?void 0:i.value)??((d=l.isOpened)==null?void 0:d.value))});e.watch(_,l=>{l||(a.value=null,g())});const k=(l,i)=>{a.value=l,g(),i==null||i()},x=async()=>{o.value=!0;try{s.value=await c.createLink(a.value),u("created",s.value,a.value)}finally{o.value=!1}},b=async()=>{await D.copyToClipboard(s.value)&&(m.value=!0,u("copied",s.value),c.closeOnCopy&&c.useModal.close())};return(l,i)=>(e.openBlock(),e.createBlock(e.unref(N.OneModal),{useModal:t.useModal,title:n.value("ui.user_list.invite_user")},{default:e.withCtx(()=>[e.createElementVNode("div",Ne,[t.appName?(e.openBlock(),e.createElementBlock("div",Ve,[e.createVNode(e.unref(h._sfc_main),{src:t.appLogo,text:t.appName,size:40,class:"flex-shrink-0"},null,8,["src","text"]),e.createElementVNode("p",Be,e.toDisplayString(t.appName),1)])):e.createCommentVNode("",!0),t.roleOptions.length>0?(e.openBlock(),e.createElementBlock("div",Ee,[e.createElementVNode("p",Ce,e.toDisplayString(n.value("ui.user_list.invite_select_role")),1),e.createVNode(e.unref(C._sfc_main),{class:"block w-full"},{button:e.withCtx(({onToggle:d})=>{var r;return[e.createVNode(e.unref(p.OneButton),{"icon-after":e.unref(q.render),label:((r=a.value)==null?void 0:r.name)??n.value("ui.user_list.regular_user"),variant:"secondary","data-test":"invite-role",onClick:y=>d()},null,8,["icon-after","label","onClick"])]}),menu:e.withCtx(({onToggle:d})=>[e.createElementVNode("div",we,[e.createElementVNode("div",{class:e.normalizeClass(["!break-words !whitespace-normal !text-left overflow-hidden px-3 py-1.5 cursor-pointer hover:bg-gray-50 select-none",a.value===null?"bg-blue-50":""]),"data-test":"invite-role-empty",onClick:r=>k(null,d)},e.toDisplayString(n.value("ui.user_list.regular_user")),11,Se),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.roleOptions,r=>{var y;return e.openBlock(),e.createElementBlock("div",{key:r.id,class:e.normalizeClass(["!break-words !whitespace-normal !text-left overflow-hidden px-3 py-1.5 cursor-pointer hover:bg-gray-50 select-none",((y=a.value)==null?void 0:y.id)===r.id?"bg-blue-50":""]),"data-test":`invite-role-${r.id}`,onClick:ze=>k(r,d)},[e.createElementVNode("div",null,e.toDisplayString(r.name),1),r.info?(e.openBlock(),e.createElementBlock("div",Oe,e.toDisplayString(r.info),1)):e.createCommentVNode("",!0)],10,$e)}),128))])]),_:1})])):e.createCommentVNode("",!0),l.$slots.hint?(e.openBlock(),e.createElementBlock("div",qe,[e.renderSlot(l.$slots,"hint")])):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("div",Me,[e.createElementVNode("div",null,[e.createElementVNode("p",De,e.toDisplayString(n.value("ui.user_list.invite_link")),1),e.createVNode(e.unref(M._sfc_main),{"model-value":s.value,readonly:"","data-test":"invite-link"},null,8,["model-value"])]),m.value?(e.openBlock(),e.createElementBlock("div",Le,e.toDisplayString(n.value("ui.user_list.invite_link_copied")),1)):(e.openBlock(),e.createBlock(e.unref(p.OneButton),{key:1,class:"w-full",variant:"primary",label:n.value("ui.user_list.invite_copy_link"),"data-test":"invite-copy",onClick:b},null,8,["label"])),e.renderSlot(l.$slots,"share",{link:s.value,role:a.value})])):(e.openBlock(),e.createElementBlock("div",Ie,[e.createVNode(e.unref(p.OneButton),{class:"w-full",variant:"primary",label:n.value("ui.user_list.invite_create_link"),"is-loading":o.value,"data-test":"invite-create",onClick:x},null,8,["label","is-loading"])]))])]),_:3},8,["useModal","title"]))}});exports.OneUserInviteModal=je;exports.OneUserList=be;exports.OneUserListItem=w;
|