vlite3 1.0.4 → 1.0.6
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/components/AttachmentsList/AttachmentsList.vue.d.ts +19 -3
- package/components/AttachmentsList/AttachmentsList.vue.js +274 -111
- package/components/AttachmentsList/fileTypeIcon.d.ts +16 -0
- package/components/AttachmentsList/fileTypeIcon.js +127 -0
- package/components/AttachmentsList/index.d.ts +1 -0
- package/components/AttachmentsList/types.d.ts +74 -2
- package/components/Avatar.vue.js +2 -2
- package/components/Badge.vue.js +7 -7
- package/components/Button.vue.js +36 -43
- package/components/ButtonGroup.vue.js +2 -2
- package/components/ButtonGroup.vue2.js +8 -8
- package/components/CategoryManager/CategoryManager.vue.d.ts +36 -0
- package/components/CategoryManager/CategoryNode.vue.d.ts +15 -0
- package/components/CategoryManager/index.d.ts +2 -0
- package/components/CategoryManager/types.d.ts +43 -0
- package/components/Chat/ChatBubble.vue.js +70 -56
- package/components/Chat/ChatInterface.vue.js +182 -142
- package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
- package/components/CommandPalette/{CommandPaletteItem.vue2.js → CommandPaletteItem.vue.js} +1 -1
- package/components/Dropdown/DropdownMenu.vue.js +2 -2
- package/components/Dropdown/DropdownMenu.vue2.js +1 -0
- package/components/FilePicker/FilePicker.vue.js +117 -122
- package/components/Input.vue.js +28 -26
- package/components/Kanban/Kanban.vue.d.ts +7 -16
- package/components/Kanban/Kanban.vue.js +1 -1
- package/components/Kanban/Kanban.vue2.js +79 -47
- package/components/Kanban/KanbanBoard.vue.js +2 -2
- package/components/Kanban/KanbanBoard.vue2.js +21 -21
- package/components/Kanban/types.d.ts +3 -0
- package/components/List/List.vue.js +89 -85
- package/components/Navbar/Navbar.vue.d.ts +4 -0
- package/components/Navbar/Navbar.vue.js +196 -173
- package/components/Navbar/NavbarTabs.vue.js +72 -66
- package/components/NavbarCommandPalette.vue.js +11 -11
- package/components/NumberInput.vue.js +2 -2
- package/components/NumberInput.vue2.js +144 -104
- package/components/Screen/Screen.vue.d.ts +12 -29
- package/components/Screen/Screen.vue.js +228 -195
- package/components/Screen/components/ScreenViewToggle.vue.d.ts +6 -3
- package/components/Screen/components/ScreenViewToggle.vue.js +29 -34
- package/components/Screen/types.d.ts +59 -7
- package/components/Stats/Stats.vue.d.ts +1 -0
- package/components/Stats/Stats.vue.js +184 -156
- package/components/Stats/types.d.ts +1 -0
- package/components/Workbook/Sheet.vue.d.ts +1 -1
- package/directives/vRipple.js +28 -9
- package/index.js +87 -85
- package/package.json +1 -1
- package/style.css +1 -1
|
@@ -2,6 +2,8 @@ export interface AttachmentItem {
|
|
|
2
2
|
fileName?: string;
|
|
3
3
|
fileSize?: number;
|
|
4
4
|
fileUrl: string;
|
|
5
|
+
thumbnailUrl?: string;
|
|
6
|
+
fileType?: string;
|
|
5
7
|
[key: string]: any;
|
|
6
8
|
}
|
|
7
9
|
export interface AttachmentsListProps {
|
|
@@ -9,8 +11,78 @@ export interface AttachmentsListProps {
|
|
|
9
11
|
canView?: boolean;
|
|
10
12
|
canDownload?: boolean;
|
|
11
13
|
/**
|
|
12
|
-
*
|
|
14
|
+
* Layout presentation variant
|
|
15
|
+
* 'default' | 'list' - standard vertical list
|
|
13
16
|
* 'inline' - transparent overlay style for embedding inside chat bubbles
|
|
17
|
+
* 'card' - larger card format with prominent preview area
|
|
14
18
|
*/
|
|
15
|
-
variant?: 'default' | 'inline';
|
|
19
|
+
variant?: 'default' | 'list' | 'inline' | 'card';
|
|
20
|
+
/**
|
|
21
|
+
* Component sizing (primarily affects 'list', 'default', and 'inline' variants)
|
|
22
|
+
*/
|
|
23
|
+
size?: 'sm' | 'md' | 'lg';
|
|
24
|
+
/**
|
|
25
|
+
* When true, clicking the attachment item itself opens the preview modal.
|
|
26
|
+
* The eye icon action button is hidden in this mode.
|
|
27
|
+
* Default: false
|
|
28
|
+
*/
|
|
29
|
+
clickToPreview?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* When false, the download action button is hidden from list items.
|
|
32
|
+
* Download remains available inside the preview modal (controlled by canDownload).
|
|
33
|
+
* Default: true
|
|
34
|
+
*/
|
|
35
|
+
showDownloadInList?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Class applied to the root wrapper <div> of the component.
|
|
38
|
+
*/
|
|
39
|
+
rootClass?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Class applied to the card grid container (card variant only).
|
|
42
|
+
*/
|
|
43
|
+
gridClass?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Class applied to each card item wrapper (card variant only).
|
|
46
|
+
*/
|
|
47
|
+
cardClass?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Class applied to the card thumbnail/preview area (card variant only).
|
|
50
|
+
*/
|
|
51
|
+
cardThumbnailClass?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Class applied to the card footer info area (card variant only).
|
|
54
|
+
*/
|
|
55
|
+
cardInfoClass?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Class applied to the card overlay actions container (card variant only).
|
|
58
|
+
*/
|
|
59
|
+
cardActionsClass?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Class applied to the list container (default/list/inline variants).
|
|
62
|
+
*/
|
|
63
|
+
listClass?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Class applied to each list item row (default/list/inline variants).
|
|
66
|
+
*/
|
|
67
|
+
itemClass?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Class applied to the icon box within a list item.
|
|
70
|
+
*/
|
|
71
|
+
itemIconBoxClass?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Class applied to the file name text element.
|
|
74
|
+
*/
|
|
75
|
+
itemNameClass?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Class applied to the file size / subtext element.
|
|
78
|
+
*/
|
|
79
|
+
itemSizeClass?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Class applied to the actions container within a list item.
|
|
82
|
+
*/
|
|
83
|
+
itemActionsClass?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Class applied to the "empty state" placeholder div.
|
|
86
|
+
*/
|
|
87
|
+
emptyClass?: string;
|
|
16
88
|
}
|
package/components/Avatar.vue.js
CHANGED
|
@@ -29,11 +29,11 @@ const y = ["src", "alt"], z = { key: 0 }, A = /* @__PURE__ */ k({
|
|
|
29
29
|
return l.length === 1 ? l[0].slice(0, 2).toUpperCase() : (l[0][0] + l[l.length - 1][0]).toUpperCase();
|
|
30
30
|
}), x = {
|
|
31
31
|
xs: "h-6 w-6 text-[10px]",
|
|
32
|
-
sm: "h-
|
|
32
|
+
sm: "h-7.5 w-7.5 text-xs",
|
|
33
33
|
md: "h-10 w-10 text-sm",
|
|
34
34
|
lg: "h-14 w-14 text-base",
|
|
35
35
|
xl: "h-18 w-18 text-lg",
|
|
36
|
-
"2xl": "h-
|
|
36
|
+
"2xl": "h-22 w-22 text-xl"
|
|
37
37
|
}, h = {
|
|
38
38
|
none: "rounded-none",
|
|
39
39
|
sm: "rounded-sm",
|
package/components/Badge.vue.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as b, computed as
|
|
1
|
+
import { defineComponent as b, computed as d, openBlock as a, createElementBlock as u, normalizeClass as i, renderSlot as c } from "vue";
|
|
2
2
|
const p = /* @__PURE__ */ b({
|
|
3
3
|
__name: "Badge",
|
|
4
4
|
props: {
|
|
@@ -8,12 +8,12 @@ const p = /* @__PURE__ */ b({
|
|
|
8
8
|
class: { default: "" }
|
|
9
9
|
},
|
|
10
10
|
setup(o) {
|
|
11
|
-
const e = o, s =
|
|
11
|
+
const e = o, s = d(() => {
|
|
12
12
|
const r = {
|
|
13
|
-
xs: "px-1.5 h-4 text-[
|
|
14
|
-
sm: "px-2 h-
|
|
15
|
-
md: "px-2.5 h-
|
|
16
|
-
lg: "px-
|
|
13
|
+
xs: "px-1.5 h-4 text-[9.8px] font-medium leading-none",
|
|
14
|
+
sm: "px-2 h-5 text-xs font-medium",
|
|
15
|
+
md: "px-2.5 h-6 text-xs font-semibold",
|
|
16
|
+
lg: "px-2.5 h-7 text-sm font-semibold"
|
|
17
17
|
}, l = `inline-flex items-center ${e.rounded === "none" ? "rounded-none" : `rounded-${e.rounded}`} border ${r[e.size] || r.md} focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`, t = {
|
|
18
18
|
default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
|
19
19
|
outline: "text-foreground border-border",
|
|
@@ -33,7 +33,7 @@ const p = /* @__PURE__ */ b({
|
|
|
33
33
|
};
|
|
34
34
|
return [l, t[e.variant] || t.default, e.class].join(" ");
|
|
35
35
|
});
|
|
36
|
-
return (r, n) => (
|
|
36
|
+
return (r, n) => (a(), u("div", {
|
|
37
37
|
class: i(s.value)
|
|
38
38
|
}, [
|
|
39
39
|
c(r.$slots, "default")
|
package/components/Button.vue.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { vRipple as
|
|
4
|
-
import { $t as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as k, computed as a, useSlots as z, withDirectives as B, openBlock as o, createElementBlock as g, normalizeClass as r, createBlock as d, createCommentVNode as h, renderSlot as m, createTextVNode as b, toDisplayString as f, unref as I } from "vue";
|
|
2
|
+
import u from "./Icon.vue.js";
|
|
3
|
+
import { vRipple as R } from "../directives/vRipple.js";
|
|
4
|
+
import { $t as S } from "../utils/i18n.js";
|
|
5
|
+
const $ = ["type", "disabled"], T = /* @__PURE__ */ k({
|
|
6
6
|
__name: "Button",
|
|
7
7
|
props: {
|
|
8
8
|
variant: { default: "primary" },
|
|
@@ -22,10 +22,10 @@ const D = ["type", "disabled"], q = /* @__PURE__ */ B({
|
|
|
22
22
|
asIcon: { type: Boolean }
|
|
23
23
|
},
|
|
24
24
|
setup(e) {
|
|
25
|
-
const t = e,
|
|
26
|
-
() => t?.asIcon || t.icon && !
|
|
27
|
-
),
|
|
28
|
-
const n =
|
|
25
|
+
const t = e, l = a(() => t.textI18n ? S(t.textI18n) : t.text), x = z(), s = a(
|
|
26
|
+
() => t?.asIcon || t.icon && !l.value && !x.default
|
|
27
|
+
), v = a(() => {
|
|
28
|
+
const n = `inline-flex items-center justify-center whitespace-nowrap text-sm font-medium disabled:pointer-events-none disabled:opacity-50 active:scale-[0.98] cursor-pointer gap-2 ${s.value ? "icon-only shrink-0" : ""}`, i = {
|
|
29
29
|
primary: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
30
30
|
"primary-light": "bg-primary-light text-primary-fg-light hover:bg-primary/20",
|
|
31
31
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
@@ -46,28 +46,21 @@ const D = ["type", "disabled"], q = /* @__PURE__ */ B({
|
|
|
46
46
|
"outline-success": "border border-success text-success hover:bg-success/10",
|
|
47
47
|
ghost: "hover:bg-accent hover:text-accent-foreground text-foreground",
|
|
48
48
|
link: "text-primary underline-offset-4 hover:underline"
|
|
49
|
-
},
|
|
49
|
+
}, w = {
|
|
50
50
|
xs: "h-6.5 px-2",
|
|
51
51
|
sm: "h-7.5 px-3",
|
|
52
52
|
sm2: "h-8 px-3",
|
|
53
53
|
md: "h-9 px-4 py-2",
|
|
54
54
|
lg: "h-10 px-4",
|
|
55
55
|
xl: "h-12 px-10"
|
|
56
|
-
},
|
|
56
|
+
}, p = {
|
|
57
57
|
xs: "h-6.5 w-6.5 min-h-6.5 min-w-6.5",
|
|
58
58
|
sm: "h-7.5 w-7.5 min-h-7.5 min-w-7.5",
|
|
59
59
|
sm2: "h-8 w-8 min-h-8 min-w-8",
|
|
60
60
|
md: "h-9 w-9 min-h-9 min-w-9",
|
|
61
|
-
lg: "h-
|
|
62
|
-
xl: "h-
|
|
63
|
-
},
|
|
64
|
-
xs: "px-2",
|
|
65
|
-
sm: "px-3",
|
|
66
|
-
sm2: "px-3",
|
|
67
|
-
md: "px-4",
|
|
68
|
-
lg: "px-6",
|
|
69
|
-
xl: "px-10"
|
|
70
|
-
}, I = {
|
|
61
|
+
lg: "h-10 w-10 min-h-10 min-w-10",
|
|
62
|
+
xl: "h-12 w-12 min-h-12 min-w-12"
|
|
63
|
+
}, y = {
|
|
71
64
|
none: "rounded-none",
|
|
72
65
|
sm: "rounded-sm",
|
|
73
66
|
sm2: "rounded-sm",
|
|
@@ -77,15 +70,15 @@ const D = ["type", "disabled"], q = /* @__PURE__ */ B({
|
|
|
77
70
|
"2xl": "rounded-2xl",
|
|
78
71
|
full: "rounded-full"
|
|
79
72
|
};
|
|
80
|
-
let
|
|
81
|
-
return
|
|
73
|
+
let C = s.value ? p[t.size] : w[t.size];
|
|
74
|
+
return [
|
|
82
75
|
n,
|
|
83
76
|
i[t.variant],
|
|
84
|
-
|
|
85
|
-
|
|
77
|
+
y[t.rounded],
|
|
78
|
+
C,
|
|
86
79
|
t.class
|
|
87
80
|
].join(" ");
|
|
88
|
-
}), c =
|
|
81
|
+
}), c = a(() => {
|
|
89
82
|
const n = {
|
|
90
83
|
xs: "w-3 h-3",
|
|
91
84
|
sm: "w-4 h-4",
|
|
@@ -101,42 +94,42 @@ const D = ["type", "disabled"], q = /* @__PURE__ */ B({
|
|
|
101
94
|
lg: "w-4 h-4",
|
|
102
95
|
xl: "w-4 h-4"
|
|
103
96
|
};
|
|
104
|
-
return
|
|
97
|
+
return s.value ? i[t.size] : n[t.size];
|
|
105
98
|
});
|
|
106
|
-
return (n, i) =>
|
|
99
|
+
return (n, i) => B((o(), g("button", {
|
|
107
100
|
type: e.type,
|
|
108
|
-
class: r([
|
|
101
|
+
class: r([v.value, "cursor-pointer"]),
|
|
109
102
|
disabled: e.disabled || e.loading
|
|
110
103
|
}, [
|
|
111
|
-
e.loading ? (
|
|
104
|
+
e.loading ? (o(), d(u, {
|
|
112
105
|
key: 0,
|
|
113
106
|
icon: "lucide:loader-2",
|
|
114
107
|
class: r(["animate-spin pointer-events-none", c.value])
|
|
115
|
-
}, null, 8, ["class"])) : e.icon ? (
|
|
108
|
+
}, null, 8, ["class"])) : e.icon ? (o(), d(u, {
|
|
116
109
|
key: 1,
|
|
117
110
|
icon: e.icon,
|
|
118
|
-
class: r(["pointer-events-none", [e.iconClass, c.value,
|
|
119
|
-
}, null, 8, ["icon", "class"])) :
|
|
120
|
-
e.textClass ? (
|
|
111
|
+
class: r(["pointer-events-none", [e.iconClass, c.value, s.value ? "mx-auto" : ""]])
|
|
112
|
+
}, null, 8, ["icon", "class"])) : h("", !0),
|
|
113
|
+
e.textClass ? (o(), g("span", {
|
|
121
114
|
key: 2,
|
|
122
115
|
class: r(e.textClass)
|
|
123
116
|
}, [
|
|
124
|
-
|
|
125
|
-
b(f(
|
|
117
|
+
m(n.$slots, "default", {}, () => [
|
|
118
|
+
b(f(l.value), 1)
|
|
126
119
|
])
|
|
127
|
-
], 2)) :
|
|
128
|
-
b(f(
|
|
120
|
+
], 2)) : m(n.$slots, "default", { key: 3 }, () => [
|
|
121
|
+
b(f(l.value), 1)
|
|
129
122
|
]),
|
|
130
|
-
e.iconRight && !e.loading ? (
|
|
123
|
+
e.iconRight && !e.loading ? (o(), d(u, {
|
|
131
124
|
key: 4,
|
|
132
125
|
icon: e.iconRight,
|
|
133
126
|
class: r([[e.iconRightClass, c.value], "h-4 w-4 pointer-events-none"])
|
|
134
|
-
}, null, 8, ["icon", "class"])) :
|
|
135
|
-
], 10,
|
|
136
|
-
[
|
|
127
|
+
}, null, 8, ["icon", "class"])) : h("", !0)
|
|
128
|
+
], 10, $)), [
|
|
129
|
+
[I(R)]
|
|
137
130
|
]);
|
|
138
131
|
}
|
|
139
132
|
});
|
|
140
133
|
export {
|
|
141
|
-
|
|
134
|
+
T as default
|
|
142
135
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ButtonGroup.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-c990b8da"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as r, computed as l,
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as r, computed as l, openBlock as c, createElementBlock as n, normalizeClass as i, renderSlot as s } from "vue";
|
|
2
|
+
const p = /* @__PURE__ */ r({
|
|
3
3
|
__name: "ButtonGroup",
|
|
4
4
|
props: {
|
|
5
5
|
variant: {},
|
|
@@ -9,21 +9,21 @@ const f = /* @__PURE__ */ r({
|
|
|
9
9
|
class: { default: "" }
|
|
10
10
|
},
|
|
11
11
|
setup(e) {
|
|
12
|
-
const t = e,
|
|
13
|
-
return
|
|
12
|
+
const t = e, a = l(() => t.direction === "vertical");
|
|
13
|
+
return (o, u) => (c(), n("div", {
|
|
14
14
|
role: "group",
|
|
15
15
|
class: i([
|
|
16
16
|
"inline-flex button-group",
|
|
17
|
-
|
|
17
|
+
a.value ? "flex-col items-stretch" : "flex-row items-center",
|
|
18
18
|
t.class,
|
|
19
19
|
e.attached ? "attached-group" : "gap-2",
|
|
20
|
-
e.attached &&
|
|
20
|
+
e.attached && a.value ? "vertical-group" : ""
|
|
21
21
|
])
|
|
22
22
|
}, [
|
|
23
|
-
s(
|
|
23
|
+
s(o.$slots, "default", {}, void 0, !0)
|
|
24
24
|
], 2));
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
export {
|
|
28
|
-
|
|
28
|
+
p as default
|
|
29
29
|
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { CategoryItem, CategoryManagerProps } from './types';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: {
|
|
5
|
+
header?(_: {}): any;
|
|
6
|
+
};
|
|
7
|
+
refs: {};
|
|
8
|
+
rootEl: HTMLDivElement;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
11
|
+
declare const __VLS_component: import('vue').DefineComponent<CategoryManagerProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
12
|
+
onDelete: (item: CategoryItem) => any;
|
|
13
|
+
"update:modelValue": (val: CategoryItem[]) => any;
|
|
14
|
+
onAdd: (item: CategoryItem) => any;
|
|
15
|
+
onEdit: (item: CategoryItem) => any;
|
|
16
|
+
onReorder: (val: CategoryItem[]) => any;
|
|
17
|
+
}, string, import('vue').PublicProps, Readonly<CategoryManagerProps> & Readonly<{
|
|
18
|
+
onOnDelete?: (item: CategoryItem) => any;
|
|
19
|
+
"onUpdate:modelValue"?: (val: CategoryItem[]) => any;
|
|
20
|
+
onOnAdd?: (item: CategoryItem) => any;
|
|
21
|
+
onOnEdit?: (item: CategoryItem) => any;
|
|
22
|
+
onOnReorder?: (val: CategoryItem[]) => any;
|
|
23
|
+
}>, {
|
|
24
|
+
size: "sm" | "md" | "lg";
|
|
25
|
+
readonly: boolean;
|
|
26
|
+
modelValue: CategoryItem[];
|
|
27
|
+
emptyTitle: string;
|
|
28
|
+
emptyDescription: string;
|
|
29
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
30
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
31
|
+
export default _default;
|
|
32
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
33
|
+
new (): {
|
|
34
|
+
$slots: S;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CategoryItem } from './types';
|
|
2
|
+
interface Props {
|
|
3
|
+
modelValue: CategoryItem[];
|
|
4
|
+
level?: number;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
7
|
+
change: () => any;
|
|
8
|
+
"update:modelValue": (value: CategoryItem[]) => any;
|
|
9
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
10
|
+
onChange?: () => any;
|
|
11
|
+
"onUpdate:modelValue"?: (value: CategoryItem[]) => any;
|
|
12
|
+
}>, {
|
|
13
|
+
level: number;
|
|
14
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { IForm } from '../Form';
|
|
2
|
+
import { Ref, ComputedRef } from 'vue';
|
|
3
|
+
export interface CategoryItem {
|
|
4
|
+
id: string | number;
|
|
5
|
+
title: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
children?: CategoryItem[];
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}
|
|
11
|
+
export interface CategoryManagerProps {
|
|
12
|
+
/** The nested array of category items */
|
|
13
|
+
modelValue?: CategoryItem[];
|
|
14
|
+
/** Optional custom form schema for add/edit operations */
|
|
15
|
+
formSchema?: IForm[];
|
|
16
|
+
/** Disable drag-and-drop and mutation actions */
|
|
17
|
+
readonly?: boolean;
|
|
18
|
+
/** Title for the empty state */
|
|
19
|
+
emptyTitle?: string;
|
|
20
|
+
/** Description for the empty state */
|
|
21
|
+
emptyDescription?: string;
|
|
22
|
+
/** Size modifier for the category nodes */
|
|
23
|
+
size?: 'sm' | 'md' | 'lg';
|
|
24
|
+
}
|
|
25
|
+
export interface InlineState {
|
|
26
|
+
mode: 'add-root' | 'add-child' | null;
|
|
27
|
+
targetId: string | number | null;
|
|
28
|
+
title: string;
|
|
29
|
+
icon: string;
|
|
30
|
+
}
|
|
31
|
+
export interface CategoryManagerContext {
|
|
32
|
+
expandedIds: Ref<Set<string | number>>;
|
|
33
|
+
inlineState: Ref<InlineState>;
|
|
34
|
+
toggleExpand: (id: string | number) => void;
|
|
35
|
+
startInline: (mode: 'add-root' | 'add-child', parentId?: string | number | null) => void;
|
|
36
|
+
saveInline: () => void;
|
|
37
|
+
cancelInline: () => void;
|
|
38
|
+
saveItem: (item: CategoryItem) => void;
|
|
39
|
+
openModalForm: (mode: 'add' | 'edit' | 'add-child', item?: CategoryItem | null, parentId?: string | number | null) => void;
|
|
40
|
+
deleteItem: (item: CategoryItem) => void;
|
|
41
|
+
readonly: ComputedRef<boolean>;
|
|
42
|
+
size: ComputedRef<'sm' | 'md' | 'lg'>;
|
|
43
|
+
}
|
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as h, computed as b, ref as k, openBlock as t, createElementBlock as a, normalizeClass as l, createVNode as u, createCommentVNode as s, createElementVNode as r, toDisplayString as c, unref as S, createBlock as B, withModifiers as C } from "vue";
|
|
2
2
|
import D from "../Avatar.vue.js";
|
|
3
3
|
import f from "../Button.vue.js";
|
|
4
|
-
import
|
|
4
|
+
import E from "../AttachmentsList/AttachmentsList.vue.js";
|
|
5
5
|
const T = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "flex-shrink-0 flex flex-col justify-end pb-1"
|
|
8
|
-
},
|
|
9
|
-
key: 0,
|
|
10
|
-
class: "mb-1 text-xs text-muted-foreground ml-1"
|
|
11
|
-
}, E = {
|
|
8
|
+
}, z = {
|
|
12
9
|
key: 0,
|
|
13
|
-
class: "text-
|
|
14
|
-
},
|
|
10
|
+
class: "mb-0.5 text-[9px] font-medium tracking-wide uppercase opacity-80 truncate text-gray-900/80"
|
|
11
|
+
}, A = {
|
|
15
12
|
key: 1,
|
|
16
|
-
class: "
|
|
17
|
-
},
|
|
13
|
+
class: "text-sm whitespace-pre-wrap leading-relaxed break-words"
|
|
14
|
+
}, N = {
|
|
18
15
|
key: 1,
|
|
19
|
-
class: "
|
|
20
|
-
},
|
|
16
|
+
class: "relative flex items-center"
|
|
17
|
+
}, V = /* @__PURE__ */ h({
|
|
21
18
|
__name: "ChatBubble",
|
|
22
19
|
props: {
|
|
23
20
|
message: {},
|
|
@@ -31,60 +28,78 @@ const T = {
|
|
|
31
28
|
},
|
|
32
29
|
emits: ["delete", "edit"],
|
|
33
30
|
setup(e, { emit: g }) {
|
|
34
|
-
const
|
|
35
|
-
let
|
|
36
|
-
const
|
|
37
|
-
if (
|
|
38
|
-
m("delete",
|
|
31
|
+
const o = e, m = g, x = b(() => o.message.timestamp ? new Date(o.message.timestamp).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : ""), i = k(!1);
|
|
32
|
+
let n = null;
|
|
33
|
+
const w = () => {
|
|
34
|
+
if (o.confirmDelete === !1) {
|
|
35
|
+
m("delete", o.message.id);
|
|
39
36
|
return;
|
|
40
37
|
}
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
i.value ? (i.value = !1, n && (clearTimeout(n), n = null), m("delete", o.message.id)) : (i.value = !0, n = setTimeout(() => {
|
|
39
|
+
i.value = !1, n = null;
|
|
43
40
|
}, 3e3));
|
|
44
|
-
},
|
|
45
|
-
|
|
41
|
+
}, v = () => {
|
|
42
|
+
i.value = !1, n && (clearTimeout(n), n = null);
|
|
46
43
|
};
|
|
47
|
-
return (
|
|
48
|
-
class:
|
|
44
|
+
return (y, d) => (t(), a("div", {
|
|
45
|
+
class: l(["flex w-full min-w-0 gap-3 group", e.isSender ? "flex-row-reverse" : "flex-row"])
|
|
49
46
|
}, [
|
|
50
|
-
e.showAvatar ? (t(),
|
|
47
|
+
e.showAvatar ? (t(), a("div", T, [
|
|
51
48
|
u(D, {
|
|
52
49
|
src: e.message.avatar,
|
|
53
50
|
alt: e.message.senderName,
|
|
54
51
|
size: "sm"
|
|
55
52
|
}, null, 8, ["src", "alt"])
|
|
56
53
|
])) : s("", !0),
|
|
57
|
-
|
|
58
|
-
class:
|
|
54
|
+
r("div", {
|
|
55
|
+
class: l(["flex flex-col min-w-0 overflow-hidden max-w-[85%]", e.isSender ? "items-end" : "items-start"])
|
|
59
56
|
}, [
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
class: o(["relative flex items-center group/bubble", e.isSender ? "flex-row-reverse" : "flex-row"])
|
|
57
|
+
r("div", {
|
|
58
|
+
class: l(["relative flex items-center min-w-0 max-w-full group/bubble", e.isSender ? "flex-row-reverse" : "flex-row"])
|
|
63
59
|
}, [
|
|
64
|
-
|
|
65
|
-
class:
|
|
60
|
+
r("div", {
|
|
61
|
+
class: l(["px-3.5 py-2.5 rounded-2xl break-words relative min-w-[60px] max-w-full min-w-0 overflow-hidden", [
|
|
66
62
|
e.isSender ? "bg-primary text-primary-foreground rounded-br-sm" : "bg-muted text-foreground rounded-bl-sm"
|
|
67
63
|
]])
|
|
68
64
|
}, [
|
|
69
|
-
e.message.
|
|
70
|
-
e.message.
|
|
71
|
-
|
|
72
|
-
|
|
65
|
+
e.showUserInfo && e.message.senderName && !e.isSender ? (t(), a("div", z, c(e.message.senderName), 1)) : s("", !0),
|
|
66
|
+
e.message.text ? (t(), a("p", A, c(e.message.text), 1)) : s("", !0),
|
|
67
|
+
e.message.attachments && e.message.attachments.length > 0 ? (t(), a("div", {
|
|
68
|
+
key: 2,
|
|
69
|
+
class: l({ "mt-2": e.message.text || e.showUserInfo && !e.isSender })
|
|
73
70
|
}, [
|
|
74
|
-
u(
|
|
71
|
+
u(S(E), {
|
|
75
72
|
attachments: e.message.attachments,
|
|
76
73
|
variant: "inline",
|
|
74
|
+
size: "sm",
|
|
77
75
|
"can-view": !0,
|
|
78
|
-
"can-download": !0
|
|
76
|
+
"can-download": !0,
|
|
77
|
+
"click-to-preview": !0,
|
|
78
|
+
"show-download-in-list": !1
|
|
79
79
|
}, null, 8, ["attachments"])
|
|
80
80
|
], 2)) : s("", !0),
|
|
81
|
-
e.message.isEdited ? (t(),
|
|
82
|
-
key:
|
|
83
|
-
class:
|
|
84
|
-
},
|
|
81
|
+
e.showTimestamp && (e.message.timestamp || e.message.isEdited) ? (t(), a("div", {
|
|
82
|
+
key: 3,
|
|
83
|
+
class: l(["mt-1 flex items-center gap-1", e.isSender ? "justify-end" : "justify-start"])
|
|
84
|
+
}, [
|
|
85
|
+
e.message.isEdited ? (t(), a("span", {
|
|
86
|
+
key: 0,
|
|
87
|
+
class: l(["text-[10px] opacity-60", e.isSender ? "text-primary-foreground" : "text-muted-foreground"])
|
|
88
|
+
}, " edited ", 2)) : s("", !0),
|
|
89
|
+
e.message.isEdited && e.message.timestamp ? (t(), a("span", {
|
|
90
|
+
key: 1,
|
|
91
|
+
class: l(["text-[10px] opacity-40", e.isSender ? "text-primary-foreground" : "text-muted-foreground"])
|
|
92
|
+
}, " · ", 2)) : s("", !0),
|
|
93
|
+
e.message.timestamp ? (t(), a("span", {
|
|
94
|
+
key: 2,
|
|
95
|
+
class: l(["text-[10px] opacity-60 tabular-nums", e.isSender ? "text-primary-foreground" : "text-muted-foreground"])
|
|
96
|
+
}, c(x.value), 3)) : s("", !0)
|
|
97
|
+
], 2)) : s("", !0)
|
|
85
98
|
], 2),
|
|
86
|
-
|
|
87
|
-
|
|
99
|
+
r("div", {
|
|
100
|
+
class: l(["opacity-0 group-hover/bubble:opacity-100 focus-within:opacity-100 transition-opacity flex gap-0 pointer-events-none group-hover/bubble:pointer-events-auto focus-within:pointer-events-auto z-10", e.isSender ? "right-full pr-1" : "left-full pl-1"])
|
|
101
|
+
}, [
|
|
102
|
+
(e.isSender || e.allowEditAll) && e.message.text?.trim() ? (t(), B(f, {
|
|
88
103
|
key: 0,
|
|
89
104
|
variant: "ghost",
|
|
90
105
|
size: "xs",
|
|
@@ -94,23 +109,23 @@ const T = {
|
|
|
94
109
|
onClick: d[0] || (d[0] = (j) => m("edit", e.message)),
|
|
95
110
|
"aria-label": "Edit message"
|
|
96
111
|
})) : s("", !0),
|
|
97
|
-
e.isSender || e.allowDeleteAll ? (t(),
|
|
112
|
+
e.isSender || e.allowDeleteAll ? (t(), a("div", N, [
|
|
98
113
|
u(f, {
|
|
99
114
|
variant: "ghost",
|
|
100
115
|
size: "xs",
|
|
101
|
-
icon:
|
|
116
|
+
icon: i.value ? "lucide:check" : "lucide:trash-2",
|
|
102
117
|
rounded: "full",
|
|
103
118
|
class: "h-7 w-7 transition-colors",
|
|
104
|
-
onClick:
|
|
105
|
-
"aria-label":
|
|
119
|
+
onClick: w,
|
|
120
|
+
"aria-label": i.value ? "Confirm delete" : "Delete message"
|
|
106
121
|
}, null, 8, ["icon", "aria-label"]),
|
|
107
|
-
|
|
122
|
+
i.value ? (t(), a("button", {
|
|
108
123
|
key: 0,
|
|
109
124
|
class: "absolute -top-1.5 -right-1.5 w-3.5 h-3.5 rounded-full bg-muted border border-border flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors",
|
|
110
|
-
onClick:
|
|
125
|
+
onClick: C(v, ["stop"]),
|
|
111
126
|
"aria-label": "Cancel delete"
|
|
112
127
|
}, [...d[1] || (d[1] = [
|
|
113
|
-
|
|
128
|
+
r("svg", {
|
|
114
129
|
xmlns: "http://www.w3.org/2000/svg",
|
|
115
130
|
viewBox: "0 0 24 24",
|
|
116
131
|
fill: "none",
|
|
@@ -120,13 +135,13 @@ const T = {
|
|
|
120
135
|
"stroke-linejoin": "round",
|
|
121
136
|
class: "w-2 h-2"
|
|
122
137
|
}, [
|
|
123
|
-
|
|
138
|
+
r("line", {
|
|
124
139
|
x1: "18",
|
|
125
140
|
y1: "6",
|
|
126
141
|
x2: "6",
|
|
127
142
|
y2: "18"
|
|
128
143
|
}),
|
|
129
|
-
|
|
144
|
+
r("line", {
|
|
130
145
|
x1: "6",
|
|
131
146
|
y1: "6",
|
|
132
147
|
x2: "18",
|
|
@@ -135,13 +150,12 @@ const T = {
|
|
|
135
150
|
], -1)
|
|
136
151
|
])])) : s("", !0)
|
|
137
152
|
])) : s("", !0)
|
|
138
|
-
])
|
|
139
|
-
], 2)
|
|
140
|
-
e.showTimestamp && e.message.timestamp ? (t(), l("div", $, c(x.value), 1)) : s("", !0)
|
|
153
|
+
], 2)
|
|
154
|
+
], 2)
|
|
141
155
|
], 2)
|
|
142
156
|
], 2));
|
|
143
157
|
}
|
|
144
158
|
});
|
|
145
159
|
export {
|
|
146
|
-
|
|
160
|
+
V as default
|
|
147
161
|
};
|