vlite3 1.1.2 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/README.md +5 -0
  2. package/components/AttachmentsList/AttachmentsList.vue.d.ts +1 -1
  3. package/components/AttachmentsList/AttachmentsList.vue.js +237 -163
  4. package/components/Avatar.vue.js +1 -1
  5. package/components/AvatarUploader/AvatarUploader.vue.js +40 -37
  6. package/components/Button.vue.js +30 -28
  7. package/components/Carousel/Carousel.vue.d.ts +2 -2
  8. package/components/CategoryManager/CategoryManager.vue.d.ts +10 -2
  9. package/components/CategoryManager/CategoryManager.vue.js +138 -119
  10. package/components/CategoryManager/CategoryNode.vue.d.ts +2 -0
  11. package/components/CategoryManager/CategoryNode.vue.js +93 -88
  12. package/components/Chart/BarChart.vue.d.ts +48 -0
  13. package/components/Chart/CircleChart.vue.d.ts +47 -0
  14. package/components/Chart/LineChart.vue.d.ts +55 -0
  15. package/components/Chart/PieChart.vue.d.ts +49 -0
  16. package/components/Chart/index.d.ts +5 -0
  17. package/components/Chart/types.d.ts +135 -0
  18. package/components/Chart/utils.d.ts +40 -0
  19. package/components/Chat/ChatBubble.vue.js +22 -22
  20. package/components/CheckBox.vue.js +29 -28
  21. package/components/ColorPicker/ColorIro.vue3.js +2 -2
  22. package/components/ColorPicker/ColorPicker.vue.js +2 -2
  23. package/components/Comment/CommentEditor.vue.d.ts +41 -0
  24. package/components/Comment/CommentEditor.vue.js +221 -0
  25. package/components/Comment/CommentEditor.vue2.js +4 -0
  26. package/components/Comment/CommentItem.vue.d.ts +70 -0
  27. package/components/Comment/CommentItem.vue.js +7 -0
  28. package/components/Comment/CommentItem.vue2.js +322 -0
  29. package/components/Comment/CommentThread.vue.d.ts +64 -0
  30. package/components/Comment/CommentThread.vue.js +185 -0
  31. package/components/Comment/CommentThread.vue2.js +4 -0
  32. package/components/Comment/index.d.ts +4 -0
  33. package/components/Comment/types.d.ts +34 -0
  34. package/components/ConfirmationModal.vue.js +30 -28
  35. package/components/CopyButton.vue.d.ts +50 -0
  36. package/components/CopyButton.vue.js +69 -0
  37. package/components/CopyButton.vue2.js +4 -0
  38. package/components/DataTable/DataTable.vue.d.ts +2 -4
  39. package/components/DataTable/DataTable.vue.js +184 -235
  40. package/components/DataTable/DataTableHeader.vue.d.ts +2 -0
  41. package/components/DataTable/DataTableHeader.vue.js +24 -23
  42. package/components/DataTable/DataTableRow.vue.d.ts +2 -0
  43. package/components/DataTable/DataTableRow.vue.js +32 -31
  44. package/components/DataTable/types.d.ts +2 -9
  45. package/components/DatePicker.vue.js +41 -35
  46. package/components/DateRangePicker.vue.js +18 -17
  47. package/components/Dropdown/Dropdown.vue.d.ts +5 -0
  48. package/components/Dropdown/Dropdown.vue.js +141 -137
  49. package/components/Dropdown/DropdownBooleanItem.vue.js +16 -15
  50. package/components/Dropdown/DropdownItem.vue.js +21 -20
  51. package/components/Dropdown/DropdownMenu.vue.js +1 -1
  52. package/components/Dropdown/DropdownMenu.vue2.js +13 -12
  53. package/components/Dropdown/DropdownTrigger.vue.d.ts +4 -0
  54. package/components/Dropdown/DropdownTrigger.vue.js +12 -7
  55. package/components/Dropdown/composables/useDropdownHydration.d.ts +2 -0
  56. package/components/Dropdown/composables/useDropdownSelection.d.ts +1 -0
  57. package/components/Dropdown/composables/useDropdownSelection.js +46 -31
  58. package/components/Empty/Empty.vue.js +7 -5
  59. package/components/Empty/index.d.ts +1 -1
  60. package/components/Empty/variants/Variant12.vue.d.ts +22 -0
  61. package/components/Empty/variants/Variant12.vue.js +35 -0
  62. package/components/Empty/variants/Variant12.vue2.js +4 -0
  63. package/components/FilePicker/FilePicker.vue.js +93 -90
  64. package/components/Footer/Footer.vue.d.ts +3 -0
  65. package/components/Footer/Variant1.vue.d.ts +20 -0
  66. package/components/Footer/Variant2.vue.d.ts +20 -0
  67. package/components/Footer/Variant3.vue.d.ts +12 -0
  68. package/components/Footer/index.d.ts +2 -0
  69. package/components/Footer/types.d.ts +73 -0
  70. package/components/Form/CustomFields.vue.d.ts +2 -0
  71. package/components/Form/CustomFields.vue.js +1 -1
  72. package/components/Form/CustomFields.vue2.js +125 -122
  73. package/components/Form/Form.vue.js +2 -2
  74. package/components/Form/Form.vue2.js +68 -64
  75. package/components/Form/FormField.vue.js +205 -149
  76. package/components/Form/FormFields.vue.js +2 -2
  77. package/components/Form/FormFields.vue2.js +28 -27
  78. package/components/Form/types.d.ts +2 -2
  79. package/components/Form/utils/form.utils.d.ts +3 -3
  80. package/components/Form/utils/form.utils.js +37 -37
  81. package/components/Input.vue.js +64 -62
  82. package/components/Invoice/Invoice.vue.js +9 -7
  83. package/components/Invoice/InvoiceTotals.vue.d.ts +14 -0
  84. package/components/Invoice/InvoiceTotals.vue.js +86 -0
  85. package/components/Invoice/InvoiceTotals.vue2.js +4 -0
  86. package/components/Invoice/InvoiceVariant1.vue.d.ts +3 -1
  87. package/components/Invoice/InvoiceVariant1.vue.js +194 -207
  88. package/components/Invoice/InvoiceVariant2.vue.d.ts +3 -1
  89. package/components/Invoice/InvoiceVariant2.vue.js +109 -118
  90. package/components/Invoice/InvoiceVariant3.vue.d.ts +3 -1
  91. package/components/Invoice/InvoiceVariant3.vue.js +157 -167
  92. package/components/Invoice/InvoiceVariant4.vue.d.ts +3 -1
  93. package/components/Invoice/InvoiceVariant4.vue.js +192 -202
  94. package/components/Invoice/index.d.ts +1 -0
  95. package/components/Invoice/types.d.ts +22 -0
  96. package/components/Masonry/Masonry.vue.d.ts +1 -1
  97. package/components/Modal.vue.js +1 -1
  98. package/components/Modal.vue2.js +60 -54
  99. package/components/MultiSelect/MultiSelect.vue.d.ts +2 -0
  100. package/components/MultiSelect/MultiSelect.vue.js +92 -90
  101. package/components/MultiSelect/composables/useMultiSelectHydration.d.ts +2 -0
  102. package/components/NumberInput.vue.js +2 -2
  103. package/components/NumberInput.vue2.js +127 -121
  104. package/components/PricingPlan/PricingPlan.vue.d.ts +1 -1
  105. package/components/RichTextEditor/RichTextLinkPopover.vue.d.ts +26 -0
  106. package/components/RichTextEditor/RichTextReader.vue.d.ts +7 -0
  107. package/components/RichTextEditor/RichTextToolbar.vue.d.ts +24 -0
  108. package/components/RichTextEditor/composables/useRichTextImageUpload.d.ts +14 -0
  109. package/components/RichTextEditor/composables/useRichTextLinks.d.ts +32 -0
  110. package/components/RichTextEditor/index.d.ts +2 -0
  111. package/components/Screen/Screen.vue.js +45 -46
  112. package/components/Screen/ScreenFilter.vue.js +1 -1
  113. package/components/SidePanel.vue.js +2 -2
  114. package/components/SidePanel.vue2.js +58 -52
  115. package/components/SidebarMenu/SidebarMenu.vue.d.ts +1 -1
  116. package/components/SidebarMenu/SidebarMenu.vue.js +192 -91
  117. package/components/SidebarMenu/SidebarMenu.vue3.js +5 -0
  118. package/components/SidebarMenu/SidebarMenuItem.vue.js +170 -157
  119. package/components/SidebarMenu/types.d.ts +12 -3
  120. package/components/{DataTable/DataTableToolbar.vue.d.ts → Splitter/Splitter.vue.d.ts} +18 -15
  121. package/components/Splitter/Splitter.vue.js +64 -0
  122. package/components/Splitter/Splitter.vue2.js +4 -0
  123. package/components/Splitter/index.d.ts +1 -0
  124. package/components/Stats/StatItem.vue.js +96 -91
  125. package/components/Stats/types.d.ts +1 -0
  126. package/components/StatusChip/status-map.js +34 -2
  127. package/components/Switch.vue.d.ts +6 -1
  128. package/components/Switch.vue.js +61 -24
  129. package/components/TagInput/TagInput.vue.d.ts +187 -0
  130. package/components/TagInput/TagInput.vue.js +113 -0
  131. package/components/TagInput/TagInput.vue2.js +4 -0
  132. package/components/TagInput/index.d.ts +1 -0
  133. package/components/Textarea.vue.js +19 -18
  134. package/components/ThumbnailSelector/ThumbnailSelector.vue.js +2 -2
  135. package/components/ThumbnailSelector/ThumbnailSelector.vue2.js +19 -16
  136. package/components/index.d.ts +4 -0
  137. package/core/config.d.ts +54 -0
  138. package/index.d.ts +4 -0
  139. package/index.js +300 -285
  140. package/package.json +1 -1
  141. package/style.css +657 -6
  142. package/types/button.d.ts +1 -1
  143. package/types/config.type.d.ts +2 -0
  144. package/types/styles.d.ts +1 -0
  145. package/utils/functions.js +9 -9
  146. package/components/DataTable/DataTableToolbar.vue.js +0 -60
  147. package/components/DataTable/DataTableToolbar.vue2.js +0 -4
  148. package/components/SidebarMenu/SidebarMenu.vue2.js +0 -4
  149. /package/components/ColorPicker/{ColorIro.vue2.js → ColorIro.vue.js} +0 -0
@@ -0,0 +1,64 @@
1
+ import { CommentNode, CommentAuthor, CommentSubmitPayload } from './types';
2
+ export interface CommentThreadProps {
3
+ comments: CommentNode[];
4
+ /** Object of currently logged-in user — controls edit/delete visibility and shows avatar in input */
5
+ currentUser?: CommentAuthor | null;
6
+ threaded?: boolean;
7
+ allowDelete?: boolean;
8
+ allowEdit?: boolean;
9
+ allowReply?: boolean;
10
+ /** Admin override — show delete on all comments */
11
+ allowDeleteAll?: boolean;
12
+ /** Admin override — show edit on all comments */
13
+ allowEditAll?: boolean;
14
+ confirmDelete?: boolean;
15
+ /** Where to display the root input. Set to 'hidden' to disable. */
16
+ inputPosition?: 'top' | 'bottom' | 'hidden';
17
+ folderId?: string;
18
+ maxFileSize?: number;
19
+ allowFileUpload?: boolean;
20
+ class?: string;
21
+ emptyText?: string;
22
+ placeholder?: string;
23
+ replyPlaceholder?: string;
24
+ editPlaceholder?: string;
25
+ replyText?: string;
26
+ editedText?: string;
27
+ editingText?: string;
28
+ cancelText?: string;
29
+ cancelEditText?: string;
30
+ hasMore?: boolean;
31
+ loadingMore?: boolean;
32
+ loadMoreText?: string;
33
+ }
34
+ declare const _default: import('vue').DefineComponent<CommentThreadProps, {
35
+ clearActiveReply: () => void;
36
+ clearActiveEdit: () => void;
37
+ activeReplyId: import('vue').Ref<string | number, string | number>;
38
+ activeEditId: import('vue').Ref<string | number, string | number>;
39
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
40
+ delete: (id: string | number) => any;
41
+ add: (payload: CommentSubmitPayload) => any;
42
+ "load-more": () => any;
43
+ edit: (updatedComment: CommentNode) => any;
44
+ "load-more-replies": (commentId: string | number) => any;
45
+ }, string, import('vue').PublicProps, Readonly<CommentThreadProps> & Readonly<{
46
+ onDelete?: (id: string | number) => any;
47
+ onAdd?: (payload: CommentSubmitPayload) => any;
48
+ "onLoad-more"?: () => any;
49
+ onEdit?: (updatedComment: CommentNode) => any;
50
+ "onLoad-more-replies"?: (commentId: string | number) => any;
51
+ }>, {
52
+ class: string;
53
+ confirmDelete: boolean;
54
+ allowDeleteAll: boolean;
55
+ allowEditAll: boolean;
56
+ allowFileUpload: boolean;
57
+ currentUser: CommentAuthor | null;
58
+ threaded: boolean;
59
+ allowDelete: boolean;
60
+ allowEdit: boolean;
61
+ allowReply: boolean;
62
+ inputPosition: "top" | "bottom" | "hidden";
63
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
64
+ export default _default;
@@ -0,0 +1,185 @@
1
+ import { defineComponent as p, ref as v, computed as h, openBlock as a, createElementBlock as n, normalizeClass as C, createVNode as u, createCommentVNode as f, createElementVNode as F, toDisplayString as w, TransitionGroup as D, withCtx as T, Fragment as U, renderList as P, createBlock as A, createTextVNode as N } from "vue";
2
+ import { $t as g } from "../../utils/i18n.js";
3
+ import V from "./CommentItem.vue.js";
4
+ import E from "./CommentEditor.vue.js";
5
+ import $ from "../Button.vue.js";
6
+ const L = {
7
+ key: 0,
8
+ class: "mb-8"
9
+ }, j = {
10
+ key: 1,
11
+ class: "flex flex-col items-center justify-center p-8 text-center bg-muted/20 border border-border rounded-xl border-dashed"
12
+ }, O = { class: "text-sm text-muted-foreground" }, G = {
13
+ key: 2,
14
+ class: "flex flex-col w-full relative"
15
+ }, q = {
16
+ key: 0,
17
+ class: "mt-2 mb-4 w-full flex justify-center"
18
+ }, H = {
19
+ key: 3,
20
+ class: "mt-4"
21
+ }, Y = /* @__PURE__ */ p({
22
+ __name: "CommentThread",
23
+ props: {
24
+ comments: {},
25
+ currentUser: { default: null },
26
+ threaded: { type: Boolean, default: !0 },
27
+ allowDelete: { type: Boolean, default: !0 },
28
+ allowEdit: { type: Boolean, default: !0 },
29
+ allowReply: { type: Boolean, default: !0 },
30
+ allowDeleteAll: { type: Boolean, default: !1 },
31
+ allowEditAll: { type: Boolean, default: !1 },
32
+ confirmDelete: { type: Boolean, default: !0 },
33
+ inputPosition: { default: "top" },
34
+ folderId: {},
35
+ maxFileSize: {},
36
+ allowFileUpload: { type: Boolean, default: !0 },
37
+ class: { default: "" },
38
+ emptyText: {},
39
+ placeholder: {},
40
+ replyPlaceholder: {},
41
+ editPlaceholder: {},
42
+ replyText: {},
43
+ editedText: {},
44
+ editingText: {},
45
+ cancelText: {},
46
+ cancelEditText: {},
47
+ hasMore: { type: Boolean },
48
+ loadingMore: { type: Boolean },
49
+ loadMoreText: {}
50
+ },
51
+ emits: ["add", "edit", "delete", "load-more", "load-more-replies"],
52
+ setup(e, { expose: b, emit: B }) {
53
+ const c = e, r = B, o = v(null), d = v(null), S = h(() => {
54
+ if (c.emptyText) return c.emptyText;
55
+ const t = g("vlite.comment.empty");
56
+ return t !== "vlite.comment.empty" ? t : "No comments yet. Start the conversation!";
57
+ }), z = h(() => {
58
+ if (c.loadMoreText) return c.loadMoreText;
59
+ const t = g("vlite.comment.loadMore");
60
+ return t !== "vlite.comment.loadMore" ? t : "View more comments";
61
+ }), R = (t) => {
62
+ if (o.value === t.commentId) {
63
+ o.value = null;
64
+ return;
65
+ }
66
+ o.value = t.commentId, d.value = null;
67
+ }, I = (t) => {
68
+ if (d.value === t.commentId) {
69
+ d.value = null;
70
+ return;
71
+ }
72
+ d.value = t.commentId, o.value = null;
73
+ }, m = () => {
74
+ o.value = null;
75
+ }, s = () => {
76
+ d.value = null;
77
+ }, y = (t, l) => {
78
+ r("add", { text: t, attachments: l });
79
+ }, M = (t, l, i) => {
80
+ r("add", { text: t, attachments: l, parentId: i }), m();
81
+ }, k = (t, l, i) => {
82
+ r("edit", { ...i, text: t, isEdited: !0 }), s();
83
+ };
84
+ return b({
85
+ clearActiveReply: m,
86
+ clearActiveEdit: s,
87
+ activeReplyId: o,
88
+ activeEditId: d
89
+ }), (t, l) => (a(), n("div", {
90
+ class: C(["vl-comment-thread flex flex-col w-full", c.class])
91
+ }, [
92
+ e.inputPosition === "top" ? (a(), n("div", L, [
93
+ u(E, {
94
+ variant: "root",
95
+ "current-user": e.currentUser,
96
+ "folder-id": e.folderId,
97
+ "max-file-size": e.maxFileSize,
98
+ "allow-file-upload": e.allowFileUpload,
99
+ placeholder: e.placeholder,
100
+ "editing-text": e.editingText,
101
+ "cancel-edit-text": e.cancelEditText,
102
+ "cancel-text": e.cancelText,
103
+ onSubmit: y
104
+ }, null, 8, ["current-user", "folder-id", "max-file-size", "allow-file-upload", "placeholder", "editing-text", "cancel-edit-text", "cancel-text"])
105
+ ])) : f("", !0),
106
+ e.comments.length === 0 ? (a(), n("div", j, [
107
+ F("p", O, w(S.value), 1)
108
+ ])) : (a(), n("div", G, [
109
+ u(D, {
110
+ "enter-active-class": "transition-all duration-300 ease-out",
111
+ "enter-from-class": "opacity-0 translate-y-2",
112
+ "enter-to-class": "opacity-100 translate-y-0",
113
+ "leave-active-class": "transition-none"
114
+ }, {
115
+ default: T(() => [
116
+ (a(!0), n(U, null, P(e.comments, (i) => (a(), A(V, {
117
+ key: i.id,
118
+ comment: i,
119
+ "current-user": e.currentUser,
120
+ threaded: e.threaded,
121
+ "allow-delete": e.allowDelete,
122
+ "allow-edit": e.allowEdit,
123
+ "allow-reply": e.allowReply,
124
+ "allow-delete-all": e.allowDeleteAll,
125
+ "allow-edit-all": e.allowEditAll,
126
+ "confirm-delete": e.confirmDelete,
127
+ "active-reply-id": o.value,
128
+ "active-edit-id": d.value,
129
+ "folder-id": e.folderId,
130
+ "max-file-size": e.maxFileSize,
131
+ "allow-file-upload": e.allowFileUpload,
132
+ "reply-placeholder": e.replyPlaceholder,
133
+ "edit-placeholder": e.editPlaceholder,
134
+ "reply-text": e.replyText,
135
+ "edited-text": e.editedText,
136
+ "editing-text": e.editingText,
137
+ "cancel-text": e.cancelText,
138
+ "cancel-edit-text": e.cancelEditText,
139
+ onReply: R,
140
+ onEdit: I,
141
+ onDelete: l[0] || (l[0] = (x) => r("delete", x)),
142
+ onSubmitReply: M,
143
+ onSubmitEdit: k,
144
+ onCancelReply: m,
145
+ onCancelEdit: s,
146
+ onLoadMoreReplies: l[1] || (l[1] = (x) => r("load-more-replies", x))
147
+ }, null, 8, ["comment", "current-user", "threaded", "allow-delete", "allow-edit", "allow-reply", "allow-delete-all", "allow-edit-all", "confirm-delete", "active-reply-id", "active-edit-id", "folder-id", "max-file-size", "allow-file-upload", "reply-placeholder", "edit-placeholder", "reply-text", "edited-text", "editing-text", "cancel-text", "cancel-edit-text"]))), 128))
148
+ ]),
149
+ _: 1
150
+ }),
151
+ e.hasMore ? (a(), n("div", q, [
152
+ u($, {
153
+ variant: "ghost",
154
+ size: "sm",
155
+ loading: e.loadingMore,
156
+ onClick: l[2] || (l[2] = (i) => r("load-more")),
157
+ class: "text-sm text-foreground/80 hover:text-foreground font-medium px-3"
158
+ }, {
159
+ default: T(() => [
160
+ N(w(z.value), 1)
161
+ ]),
162
+ _: 1
163
+ }, 8, ["loading"])
164
+ ])) : f("", !0)
165
+ ])),
166
+ e.inputPosition === "bottom" ? (a(), n("div", H, [
167
+ u(E, {
168
+ variant: "root",
169
+ "current-user": e.currentUser,
170
+ "folder-id": e.folderId,
171
+ "max-file-size": e.maxFileSize,
172
+ "allow-file-upload": e.allowFileUpload,
173
+ placeholder: e.placeholder,
174
+ "editing-text": e.editingText,
175
+ "cancel-edit-text": e.cancelEditText,
176
+ "cancel-text": e.cancelText,
177
+ onSubmit: y
178
+ }, null, 8, ["current-user", "folder-id", "max-file-size", "allow-file-upload", "placeholder", "editing-text", "cancel-edit-text", "cancel-text"])
179
+ ])) : f("", !0)
180
+ ], 2));
181
+ }
182
+ });
183
+ export {
184
+ Y as default
185
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./CommentThread.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,4 @@
1
+ export * from './types';
2
+ export { default as CommentItem } from './CommentItem.vue';
3
+ export { default as CommentThread } from './CommentThread.vue';
4
+ export { default as CommentEditor } from './CommentEditor.vue';
@@ -0,0 +1,34 @@
1
+ import { AttachmentItem } from '../AttachmentsList';
2
+ export interface CommentAuthor {
3
+ id: string | number;
4
+ name: string;
5
+ avatar?: string;
6
+ role?: string;
7
+ }
8
+ export interface CommentNode {
9
+ id: string | number;
10
+ text: string;
11
+ author: CommentAuthor;
12
+ timestamp?: string | number | Date;
13
+ isEdited?: boolean;
14
+ editedAt?: string | number | Date;
15
+ attachments?: AttachmentItem[];
16
+ replies?: CommentNode[];
17
+ /** Any custom metadata such as 'status' or logic blocks */
18
+ meta?: Record<string, any>;
19
+ /** Pagination: flag indicating there are more replies to load natively */
20
+ hasMoreReplies?: boolean;
21
+ /** Pagination: flag used by parents to set a loading spinner on the expando */
22
+ loadingMoreReplies?: boolean;
23
+ /** Pagination: absolute count of replies if needed for UI text e.g. "View 4 more replies" */
24
+ replyCount?: number;
25
+ }
26
+ export interface CommentActionPayload {
27
+ commentId: string | number;
28
+ comment: CommentNode;
29
+ }
30
+ export interface CommentSubmitPayload {
31
+ text: string;
32
+ attachments?: AttachmentItem[];
33
+ parentId?: string | number;
34
+ }
@@ -1,8 +1,8 @@
1
- import { defineComponent as I, computed as l, openBlock as y, createBlock as h, createSlots as w, withCtx as c, createElementVNode as r, toDisplayString as f, createVNode as m, renderSlot as x } from "vue";
1
+ import { defineComponent as I, computed as a, openBlock as w, createBlock as y, mergeProps as h, createSlots as $, withCtx as d, createElementVNode as r, toDisplayString as f, createVNode as p, renderSlot as u } from "vue";
2
2
  import b from "./Modal.vue.js";
3
- import p from "./Button.vue.js";
3
+ import x from "./Button.vue.js";
4
4
  import { $t as n } from "../utils/i18n.js";
5
- const k = { class: "pb-2 px-[2px]" }, $ = { class: "mb-1.5 font-semibold text-lg" }, B = { class: "text-sm text-muted-foreground" }, S = { class: "flex w-full items-center justify-end space-x-2 px-[2px]" }, _ = /* @__PURE__ */ I({
5
+ const k = { class: "pb-2 px-[2px]" }, B = { class: "mb-1.5 font-semibold text-lg" }, S = { class: "text-sm text-muted-foreground" }, z = { class: "flex w-full items-center justify-end space-x-2 px-[2px]" }, E = /* @__PURE__ */ I({
6
6
  __name: "ConfirmationModal",
7
7
  props: {
8
8
  show: { type: Boolean, default: !1 },
@@ -18,69 +18,71 @@ const k = { class: "pb-2 px-[2px]" }, $ = { class: "mb-1.5 font-semibold text-lg
18
18
  variant: { default: "danger" }
19
19
  },
20
20
  emits: ["cancel", "confirm"],
21
- setup(o, { emit: u }) {
22
- const t = o, d = u, a = () => {
23
- d("cancel");
24
- }, v = l(() => t.titleI18n ? n(t.titleI18n) : t.title), g = l(
21
+ setup(o, { emit: v }) {
22
+ const t = o, m = v, l = () => {
23
+ m("cancel");
24
+ }, s = a(() => t.titleI18n ? n(t.titleI18n) : t.title), g = a(
25
25
  () => t.descriptionI18n ? n(t.descriptionI18n) : t.description
26
- ), T = l(() => {
26
+ ), T = a(() => {
27
27
  if (t.confirmTextI18n) return n(t.confirmTextI18n);
28
28
  if (t.confirmText) return t.confirmText;
29
29
  const e = n("vlite.confirmation.confirm");
30
30
  return e !== "vlite.confirmation.confirm" ? e : "Confirm";
31
- }), C = l(() => {
31
+ }), C = a(() => {
32
32
  if (t.cancelTextI18n) return n(t.cancelTextI18n);
33
33
  if (t.cancelText) return t.cancelText;
34
34
  const e = n("vlite.confirmation.cancel");
35
35
  return e !== "vlite.confirmation.cancel" ? e : "Cancel";
36
36
  });
37
- return (e, i) => (y(), h(b, {
38
- show: o.show,
37
+ return (e, i) => (w(), y(b, h({ show: o.show }, e.$attrs, {
38
+ "data-testid": e.$attrs["data-testid"] || (s.value ? `confirm-modal-${s.value.toString().toLowerCase().replace(/[^a-z0-9]+/g, "-")}` : "confirm-modal"),
39
39
  footerClass: "border-t-0! pt-0! pb-3.5!",
40
40
  "max-width": "max-w-[400px]",
41
- onClose: a,
42
- "onUpdate:show": i[1] || (i[1] = (s) => !s && a())
43
- }, w({
44
- footer: c(({ close: s }) => [
45
- r("div", S, [
46
- m(p, {
41
+ onClose: l,
42
+ "onUpdate:show": i[1] || (i[1] = (c) => !c && l())
43
+ }), $({
44
+ footer: d(({ close: c }) => [
45
+ r("div", z, [
46
+ p(x, {
47
47
  variant: "secondary",
48
48
  text: C.value,
49
49
  disabled: o.loading,
50
50
  size: "sm2",
51
+ "data-testid": "confirm-modal-cancel",
51
52
  onClick: () => {
52
- s?.(), a?.();
53
+ c?.(), l?.();
53
54
  }
54
55
  }, null, 8, ["text", "disabled", "onClick"]),
55
- m(p, {
56
+ p(x, {
56
57
  size: "sm2",
57
58
  variant: o.variant,
58
59
  text: T.value,
59
60
  loading: o.loading,
60
- onClick: i[0] || (i[0] = (z) => d("confirm"))
61
+ "data-testid": "confirm-modal-confirm",
62
+ onClick: i[0] || (i[0] = (D) => m("confirm"))
61
63
  }, null, 8, ["variant", "text", "loading"])
62
64
  ])
63
65
  ]),
64
- default: c(() => [
66
+ default: d(() => [
65
67
  r("div", k, [
66
- r("h3", $, f(v.value), 1),
67
- r("p", B, f(g.value), 1)
68
+ r("h3", B, f(s.value), 1),
69
+ r("p", S, f(g.value), 1)
68
70
  ])
69
71
  ]),
70
72
  _: 2
71
73
  }, [
72
74
  e.$slots?.trigger ? {
73
75
  name: "trigger",
74
- fn: c(() => [
75
- x(e.$slots, "trigger", {}, () => [
76
- x(e.$slots, "default")
76
+ fn: d(() => [
77
+ u(e.$slots, "trigger", {}, () => [
78
+ u(e.$slots, "default")
77
79
  ])
78
80
  ]),
79
81
  key: "0"
80
82
  } : void 0
81
- ]), 1032, ["show"]));
83
+ ]), 1040, ["show", "data-testid"]));
82
84
  }
83
85
  });
84
86
  export {
85
- _ as default
87
+ E as default
86
88
  };
@@ -0,0 +1,50 @@
1
+ import { ButtonVariant, ButtonSize, ButtonRounded } from '../types';
2
+ export interface CopyButtonProps {
3
+ /** The content to be copied to the clipboard */
4
+ textToCopy: string;
5
+ variant?: ButtonVariant;
6
+ size?: ButtonSize;
7
+ rounded?: ButtonRounded;
8
+ class?: any;
9
+ disabled?: boolean;
10
+ defaultIcon?: string;
11
+ copiedIcon?: string;
12
+ defaultText?: string;
13
+ copiedText?: string;
14
+ defaultTextI18n?: string;
15
+ copiedTextI18n?: string;
16
+ asIcon?: boolean;
17
+ }
18
+ declare function __VLS_template(): {
19
+ attrs: Partial<{}>;
20
+ slots: {
21
+ default?(_: {
22
+ copied: boolean;
23
+ }): any;
24
+ };
25
+ refs: {};
26
+ rootEl: HTMLButtonElement;
27
+ };
28
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
29
+ declare const __VLS_component: import('vue').DefineComponent<CopyButtonProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
30
+ copy: (text: string) => any;
31
+ error: (err: Error) => any;
32
+ }, string, import('vue').PublicProps, Readonly<CopyButtonProps> & Readonly<{
33
+ onCopy?: (text: string) => any;
34
+ onError?: (err: Error) => any;
35
+ }>, {
36
+ variant: ButtonVariant;
37
+ size: ButtonSize;
38
+ asIcon: boolean;
39
+ defaultIcon: string;
40
+ copiedIcon: string;
41
+ defaultTextI18n: string;
42
+ copiedTextI18n: string;
43
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLButtonElement>;
44
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
45
+ export default _default;
46
+ type __VLS_WithTemplateSlots<T, S> = T & {
47
+ new (): {
48
+ $slots: S;
49
+ };
50
+ };
@@ -0,0 +1,69 @@
1
+ import { defineComponent as f, ref as p, computed as l, openBlock as m, createBlock as x, normalizeClass as T, withCtx as y, renderSlot as v, createCommentVNode as I } from "vue";
2
+ import C from "./Button.vue.js";
3
+ import { $t as r } from "../utils/i18n.js";
4
+ const z = /* @__PURE__ */ f({
5
+ __name: "CopyButton",
6
+ props: {
7
+ textToCopy: {},
8
+ variant: { default: "outline" },
9
+ size: { default: "md" },
10
+ rounded: {},
11
+ class: {},
12
+ disabled: { type: Boolean },
13
+ defaultIcon: { default: "lucide:copy" },
14
+ copiedIcon: { default: "lucide:check" },
15
+ defaultText: {},
16
+ copiedText: {},
17
+ defaultTextI18n: { default: "vlite.copyButton.copy" },
18
+ copiedTextI18n: { default: "vlite.copyButton.copied" },
19
+ asIcon: { type: Boolean, default: !1 }
20
+ },
21
+ emits: ["copy", "error"],
22
+ setup(o, { emit: d }) {
23
+ const e = o, c = d, a = p(!1);
24
+ let n = null;
25
+ const u = l(() => a.value ? e.copiedIcon : e.defaultIcon), i = l(() => {
26
+ if (!e.asIcon)
27
+ if (a.value) {
28
+ if (e.copiedText) return e.copiedText;
29
+ const t = r(e.copiedTextI18n);
30
+ return t !== e.copiedTextI18n ? t : "Copied";
31
+ } else {
32
+ if (e.defaultText) return e.defaultText;
33
+ const t = r(e.defaultTextI18n);
34
+ return t !== e.defaultTextI18n ? t : "Copy";
35
+ }
36
+ }), s = async () => {
37
+ if (!e.disabled)
38
+ try {
39
+ await navigator.clipboard.writeText(e.textToCopy), a.value = !0, c("copy", e.textToCopy), n && clearTimeout(n), n = setTimeout(() => {
40
+ a.value = !1;
41
+ }, 500);
42
+ } catch (t) {
43
+ c("error", t instanceof Error ? t : new Error("Copy failed"));
44
+ }
45
+ };
46
+ return (t, B) => (m(), x(C, {
47
+ variant: o.variant,
48
+ size: o.size,
49
+ rounded: o.rounded,
50
+ class: T(e.class),
51
+ disabled: o.disabled,
52
+ icon: u.value,
53
+ text: i.value,
54
+ "as-icon": o.asIcon,
55
+ onClick: s
56
+ }, {
57
+ default: y(() => [
58
+ !o.asIcon && !i.value ? v(t.$slots, "default", {
59
+ key: 0,
60
+ copied: a.value
61
+ }) : I("", !0)
62
+ ]),
63
+ _: 3
64
+ }, 8, ["variant", "size", "rounded", "class", "disabled", "icon", "text", "as-icon"]));
65
+ }
66
+ });
67
+ export {
68
+ z as default
69
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./CopyButton.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -7,8 +7,6 @@ declare function __VLS_template(): {
7
7
  index: number;
8
8
  field: string;
9
9
  }) => any>> & {
10
- 'toolbar-left'?(_: {}): any;
11
- 'toolbar-right'?(_: {}): any;
12
10
  empty?(_: {}): any;
13
11
  'empty-action'?(_: {}): any;
14
12
  };
@@ -31,13 +29,12 @@ declare const __VLS_component: import('vue').DefineComponent<DataTableProps, {},
31
29
  onRowClick?: (payload: RowClickPayload) => any;
32
30
  "onUpdate:selectedRows"?: (value: any[]) => any;
33
31
  }>, {
34
- search: string;
35
32
  variant: "default" | "raised";
33
+ size: "xs" | "sm" | "md" | "lg";
36
34
  loading: boolean;
37
35
  striped: boolean;
38
36
  compact: boolean;
39
37
  rows: any[];
40
- showSearch: boolean;
41
38
  headers: TableHeader[];
42
39
  emptyIcon: string;
43
40
  paginationProps: import('./types').DataTablePaginationProps;
@@ -48,6 +45,7 @@ declare const __VLS_component: import('vue').DefineComponent<DataTableProps, {},
48
45
  hoverable: boolean;
49
46
  bordered: boolean;
50
47
  sortable: boolean;
48
+ headerVariant: "default" | "minimal";
51
49
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
52
50
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
53
51
  export default _default;