vlite3 1.1.4 → 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.
- package/README.md +5 -0
- package/components/CategoryManager/CategoryManager.vue.js +1 -1
- package/components/Chart/BarChart.vue.d.ts +48 -0
- package/components/Chart/CircleChart.vue.d.ts +47 -0
- package/components/Chart/LineChart.vue.d.ts +55 -0
- package/components/Chart/PieChart.vue.d.ts +49 -0
- package/components/Chart/index.d.ts +5 -0
- package/components/Chart/types.d.ts +135 -0
- package/components/Chart/utils.d.ts +40 -0
- package/components/ColorPicker/ColorIro.vue3.js +2 -2
- package/components/ColorPicker/ColorPicker.vue.js +2 -2
- package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
- package/components/CommandPalette/{CommandPaletteItem.vue2.js → CommandPaletteItem.vue.js} +1 -1
- package/components/Comment/CommentEditor.vue.d.ts +41 -0
- package/components/Comment/CommentEditor.vue.js +221 -0
- package/components/Comment/CommentEditor.vue2.js +4 -0
- package/components/Comment/CommentItem.vue.d.ts +70 -0
- package/components/Comment/CommentItem.vue.js +7 -0
- package/components/Comment/CommentItem.vue2.js +322 -0
- package/components/Comment/CommentThread.vue.d.ts +64 -0
- package/components/Comment/CommentThread.vue.js +185 -0
- package/components/Comment/CommentThread.vue2.js +4 -0
- package/components/Comment/index.d.ts +4 -0
- package/components/Comment/types.d.ts +34 -0
- package/components/DataTable/DataTable.vue.d.ts +2 -4
- package/components/DataTable/DataTable.vue.js +175 -226
- package/components/DataTable/DataTableHeader.vue.d.ts +2 -0
- package/components/DataTable/DataTableHeader.vue.js +24 -23
- package/components/DataTable/DataTableRow.vue.d.ts +2 -0
- package/components/DataTable/DataTableRow.vue.js +32 -31
- package/components/DataTable/types.d.ts +2 -9
- package/components/Dropdown/Dropdown.vue.d.ts +2 -0
- package/components/Dropdown/Dropdown.vue.js +60 -58
- package/components/Dropdown/DropdownTrigger.vue.d.ts +2 -0
- package/components/Dropdown/DropdownTrigger.vue.js +7 -6
- package/components/Empty/Empty.vue.js +7 -5
- package/components/Empty/index.d.ts +1 -1
- package/components/Empty/variants/Variant12.vue.d.ts +22 -0
- package/components/Empty/variants/Variant12.vue.js +35 -0
- package/components/Empty/variants/Variant12.vue2.js +4 -0
- package/components/Footer/Footer.vue.d.ts +3 -0
- package/components/Footer/Variant1.vue.d.ts +20 -0
- package/components/Footer/Variant2.vue.d.ts +20 -0
- package/components/Footer/Variant3.vue.d.ts +12 -0
- package/components/Footer/index.d.ts +2 -0
- package/components/Footer/types.d.ts +73 -0
- package/components/Form/CustomFields.vue.d.ts +2 -0
- package/components/Form/CustomFields.vue.js +2 -2
- package/components/Form/CustomFields.vue2.js +125 -122
- package/components/Form/FormField.vue.js +1 -1
- package/components/MultiSelect/MultiSelect.vue.d.ts +2 -0
- package/components/MultiSelect/MultiSelect.vue.js +95 -94
- package/components/NavbarCommandPalette.vue.js +1 -1
- package/components/NumberInput.vue.js +1 -1
- package/components/NumberInput.vue2.js +39 -38
- package/components/RichTextEditor/RichTextLinkPopover.vue.d.ts +26 -0
- package/components/RichTextEditor/RichTextReader.vue.d.ts +7 -0
- package/components/RichTextEditor/RichTextToolbar.vue.d.ts +24 -0
- package/components/RichTextEditor/composables/useRichTextImageUpload.d.ts +14 -0
- package/components/RichTextEditor/composables/useRichTextLinks.d.ts +32 -0
- package/components/RichTextEditor/index.d.ts +2 -0
- package/components/Screen/Screen.vue.js +45 -46
- package/components/Screen/ScreenFilter.vue.js +1 -1
- package/components/SidebarMenu/SidebarMenu.vue.d.ts +1 -1
- package/components/SidebarMenu/SidebarMenu.vue.js +192 -91
- package/components/SidebarMenu/SidebarMenu.vue3.js +5 -0
- package/components/SidebarMenu/SidebarMenuItem.vue.js +170 -157
- package/components/SidebarMenu/types.d.ts +12 -3
- package/components/{DataTable/DataTableToolbar.vue.d.ts → Splitter/Splitter.vue.d.ts} +18 -15
- package/components/Splitter/Splitter.vue.js +64 -0
- package/components/Splitter/Splitter.vue2.js +4 -0
- package/components/Splitter/index.d.ts +1 -0
- package/components/StatusChip/status-map.js +34 -2
- package/components/index.d.ts +4 -0
- package/core/config.d.ts +18 -0
- package/index.d.ts +2 -0
- package/index.js +316 -307
- package/package.json +1 -1
- package/style.css +42 -6
- package/types/config.type.d.ts +2 -0
- package/components/DataTable/DataTableToolbar.vue.js +0 -60
- package/components/DataTable/DataTableToolbar.vue2.js +0 -4
- package/components/SidebarMenu/SidebarMenu.vue2.js +0 -4
- /package/components/ColorPicker/{ColorIro.vue2.js → ColorIro.vue.js} +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FooterData, FooterLabels } from './types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
data: FooterData;
|
|
4
|
+
labels?: FooterLabels;
|
|
5
|
+
containerClass?: string | any[] | Record<string, boolean>;
|
|
6
|
+
};
|
|
7
|
+
type __VLS_PublicProps = {
|
|
8
|
+
'newsletterEmail'?: string;
|
|
9
|
+
} & __VLS_Props;
|
|
10
|
+
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
11
|
+
"update:newsletterEmail": (value: string) => any;
|
|
12
|
+
} & {
|
|
13
|
+
subscribe: (email: string) => any;
|
|
14
|
+
"link-click": (url: string, event: MouseEvent) => any;
|
|
15
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
16
|
+
onSubscribe?: (email: string) => any;
|
|
17
|
+
"onLink-click"?: (url: string, event: MouseEvent) => any;
|
|
18
|
+
"onUpdate:newsletterEmail"?: (value: string) => any;
|
|
19
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FooterData, FooterLabels } from './types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
data: FooterData;
|
|
4
|
+
labels?: FooterLabels;
|
|
5
|
+
containerClass?: string | any[] | Record<string, boolean>;
|
|
6
|
+
};
|
|
7
|
+
type __VLS_PublicProps = {
|
|
8
|
+
'newsletterEmail'?: string;
|
|
9
|
+
} & __VLS_Props;
|
|
10
|
+
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
11
|
+
"update:newsletterEmail": (value: string) => any;
|
|
12
|
+
} & {
|
|
13
|
+
subscribe: (email: string) => any;
|
|
14
|
+
"link-click": (url: string, event: MouseEvent) => any;
|
|
15
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
16
|
+
onSubscribe?: (email: string) => any;
|
|
17
|
+
"onLink-click"?: (url: string, event: MouseEvent) => any;
|
|
18
|
+
"onUpdate:newsletterEmail"?: (value: string) => any;
|
|
19
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FooterData, FooterLabels } from './types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
data: FooterData;
|
|
4
|
+
labels?: FooterLabels;
|
|
5
|
+
containerClass?: string | any[] | Record<string, boolean>;
|
|
6
|
+
};
|
|
7
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
8
|
+
"link-click": (url: string, event: MouseEvent) => any;
|
|
9
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
|
+
"onLink-click"?: (url: string, event: MouseEvent) => any;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export type FooterVariant = 'Variant1' | 'Variant2' | 'Variant3';
|
|
2
|
+
export interface FooterSocialLink {
|
|
3
|
+
/** Iconify icon name (e.g., 'lucide:instagram') or image URL */
|
|
4
|
+
icon: string;
|
|
5
|
+
/** Full URL for the social link */
|
|
6
|
+
url: string;
|
|
7
|
+
/** Accessible label for screen readers (e.g., 'Instagram') */
|
|
8
|
+
label?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface FooterLink {
|
|
11
|
+
/** Display text for the link */
|
|
12
|
+
label: string;
|
|
13
|
+
/** Full URL (href) */
|
|
14
|
+
url: string;
|
|
15
|
+
/** If true, link opens in a new tab with rel="noopener noreferrer" */
|
|
16
|
+
external?: boolean;
|
|
17
|
+
/** Optional leading icon (Iconify name or image URL) */
|
|
18
|
+
icon?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface FooterLinkGroup {
|
|
21
|
+
/** Column heading (e.g., 'Product', 'Company', 'Resources') */
|
|
22
|
+
title: string;
|
|
23
|
+
/** Array of links in this group */
|
|
24
|
+
links: FooterLink[];
|
|
25
|
+
}
|
|
26
|
+
export interface FooterNewsletterConfig {
|
|
27
|
+
/** Title text (e.g., "Stay updated") */
|
|
28
|
+
title?: string;
|
|
29
|
+
/** Description text (e.g., "Subscribe to our newsletter for the latest updates.") */
|
|
30
|
+
description?: string;
|
|
31
|
+
/** Input placeholder text */
|
|
32
|
+
placeholder?: string;
|
|
33
|
+
/** Submit button text */
|
|
34
|
+
buttonText?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface FooterData {
|
|
37
|
+
/** Company / brand name displayed in the footer */
|
|
38
|
+
brandName?: string;
|
|
39
|
+
/** URL to brand logo image, or an Iconify icon name */
|
|
40
|
+
brandLogo?: string;
|
|
41
|
+
/** Brand tagline or short description */
|
|
42
|
+
brandDescription?: string;
|
|
43
|
+
/** Column-based link groups (e.g., Product, Company, Resources) */
|
|
44
|
+
linkGroups?: FooterLinkGroup[];
|
|
45
|
+
/** Social media icon links (rendered as icon buttons) */
|
|
46
|
+
socialLinks?: FooterSocialLink[];
|
|
47
|
+
/** Copyright text (e.g., '© 2024 Acme Inc. All rights reserved.') */
|
|
48
|
+
copyright?: string;
|
|
49
|
+
/** Legal links displayed in the bottom bar (e.g., Terms, Privacy Policy) */
|
|
50
|
+
legalLinks?: FooterLink[];
|
|
51
|
+
/** Newsletter subscription section configuration */
|
|
52
|
+
newsletter?: FooterNewsletterConfig;
|
|
53
|
+
/** Small badge text near brand (e.g., version number, status) */
|
|
54
|
+
badge?: string;
|
|
55
|
+
}
|
|
56
|
+
export interface FooterLabels {
|
|
57
|
+
/** Replaces the default "Follow us" heading above social icons */
|
|
58
|
+
followUs?: string;
|
|
59
|
+
/** Replaces the default "Subscribe" button text */
|
|
60
|
+
subscribe?: string;
|
|
61
|
+
/** Replaces the default "Newsletter" heading */
|
|
62
|
+
newsletter?: string;
|
|
63
|
+
}
|
|
64
|
+
export interface FooterProps {
|
|
65
|
+
/** The complete footer data object (required) */
|
|
66
|
+
data: FooterData;
|
|
67
|
+
/** Visual style variant */
|
|
68
|
+
variant?: FooterVariant;
|
|
69
|
+
/** Custom text label overrides for static UI strings */
|
|
70
|
+
labels?: FooterLabels;
|
|
71
|
+
/** Custom CSS class for the root container */
|
|
72
|
+
containerClass?: string | any[] | Record<string, boolean>;
|
|
73
|
+
}
|
|
@@ -9,6 +9,7 @@ interface Props {
|
|
|
9
9
|
size?: InputSize;
|
|
10
10
|
rounded?: InputRounded;
|
|
11
11
|
disabled?: boolean;
|
|
12
|
+
readonly?: boolean;
|
|
12
13
|
draggable?: boolean;
|
|
13
14
|
minRows?: number;
|
|
14
15
|
maxRows?: number;
|
|
@@ -33,6 +34,7 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
33
34
|
variant: InputVariant;
|
|
34
35
|
size: InputSize;
|
|
35
36
|
rounded: InputRounded;
|
|
37
|
+
readonly: boolean;
|
|
36
38
|
disabled: boolean;
|
|
37
39
|
isUpdate: boolean;
|
|
38
40
|
modelValue: Record<string, any>[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./CustomFields.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-6aede99c"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
r as default
|
|
7
7
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { VueDraggable as
|
|
1
|
+
import { defineComponent as _, computed as f, shallowRef as I, watch as ee, openBlock as n, createElementBlock as d, createElementVNode as w, createBlock as R, withCtx as N, createTextVNode as te, toDisplayString as v, createCommentVNode as i, Fragment as k, renderList as V, normalizeClass as C, createVNode as $, unref as ae, isMemoSame as le } from "vue";
|
|
2
|
+
import { VueDraggable as re } from "vue-draggable-plus";
|
|
3
3
|
import se from "./FormField.vue.js";
|
|
4
|
-
import
|
|
4
|
+
import E from "../Button.vue.js";
|
|
5
5
|
import oe from "../Label.vue.js";
|
|
6
6
|
import ne from "../Icon.vue.js";
|
|
7
|
-
import { $t as
|
|
8
|
-
import { setNestedValue as
|
|
7
|
+
import { $t as p } from "../../utils/i18n.js";
|
|
8
|
+
import { setNestedValue as T, resolveFieldType as de, evaluateConditional as F } from "./utils/form.utils.js";
|
|
9
9
|
const ue = { class: "custom-fields-wrapper" }, ie = { class: "flex justify-between items-center mb-2" }, ce = { class: "custom-fields-table border border-border rounded overflow-hidden bg-background" }, me = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "flex border-b border-border bg-muted/50 text-gray-800 text-xs font-semibold uppercase tracking-wider"
|
|
@@ -18,16 +18,16 @@ const ue = { class: "custom-fields-wrapper" }, ie = { class: "flex justify-betwe
|
|
|
18
18
|
}, ve = {
|
|
19
19
|
key: 2,
|
|
20
20
|
class: "w-10 flex-none p-3"
|
|
21
|
-
},
|
|
21
|
+
}, ye = {
|
|
22
22
|
key: 1,
|
|
23
23
|
class: "w-10 flex-none flex items-center justify-center text-xs text-muted-foreground border-r border-border bg-muted/20"
|
|
24
|
-
},
|
|
24
|
+
}, ge = {
|
|
25
25
|
key: 2,
|
|
26
26
|
class: "w-10 flex-none flex items-center justify-center border-l border-border bg-muted/20"
|
|
27
|
-
},
|
|
27
|
+
}, he = {
|
|
28
28
|
key: 1,
|
|
29
29
|
class: "flex flex-col items-center justify-center py-6 text-center bg-muted/5"
|
|
30
|
-
},
|
|
30
|
+
}, we = { class: "text-sm font-medium text-foreground" }, pe = { class: "text-xs text-muted-foreground mt-1" }, Be = /* @__PURE__ */ _({
|
|
31
31
|
__name: "CustomFields",
|
|
32
32
|
props: {
|
|
33
33
|
name: {},
|
|
@@ -38,6 +38,7 @@ const ue = { class: "custom-fields-wrapper" }, ie = { class: "flex justify-betwe
|
|
|
38
38
|
size: { default: "md" },
|
|
39
39
|
rounded: { default: "md" },
|
|
40
40
|
disabled: { type: Boolean, default: !1 },
|
|
41
|
+
readonly: { type: Boolean, default: !1 },
|
|
41
42
|
draggable: { type: Boolean, default: !1 },
|
|
42
43
|
minRows: { default: 0 },
|
|
43
44
|
maxRows: {},
|
|
@@ -51,195 +52,197 @@ const ue = { class: "custom-fields-wrapper" }, ie = { class: "flex justify-betwe
|
|
|
51
52
|
isUpdate: { type: Boolean, default: !1 }
|
|
52
53
|
},
|
|
53
54
|
emits: ["update:modelValue", "change"],
|
|
54
|
-
setup(
|
|
55
|
-
const
|
|
56
|
-
const e =
|
|
55
|
+
setup(r, { emit: z }) {
|
|
56
|
+
const t = r, U = z, B = f(() => t.labelI18n ? p(t.labelI18n) : t.label), A = f(() => {
|
|
57
|
+
const e = p("vlite.customFields.emptyTitle");
|
|
57
58
|
return e !== "vlite.customFields.emptyTitle" ? e : "No items added";
|
|
58
|
-
}),
|
|
59
|
-
const e =
|
|
59
|
+
}), S = f(() => {
|
|
60
|
+
const e = p("vlite.customFields.emptyDescription");
|
|
60
61
|
return e !== "vlite.customFields.emptyDescription" ? e : "Add a new item to get started";
|
|
61
|
-
}),
|
|
62
|
+
}), s = I([]), j = () => `row_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
62
63
|
ee(
|
|
63
|
-
() =>
|
|
64
|
+
() => t.modelValue,
|
|
64
65
|
(e) => {
|
|
65
|
-
Array.isArray(e) ?
|
|
66
|
-
const
|
|
66
|
+
Array.isArray(e) ? s.value = e.map((a, o) => {
|
|
67
|
+
const l = s.value[o];
|
|
67
68
|
return {
|
|
68
|
-
...
|
|
69
|
-
_id:
|
|
69
|
+
...a,
|
|
70
|
+
_id: l?._id || j()
|
|
70
71
|
};
|
|
71
|
-
}) :
|
|
72
|
+
}) : s.value = [];
|
|
72
73
|
},
|
|
73
74
|
{ immediate: !0, deep: !0 }
|
|
74
75
|
);
|
|
75
|
-
const
|
|
76
|
+
const H = () => {
|
|
76
77
|
const e = {};
|
|
77
|
-
for (const
|
|
78
|
-
const o = typeof
|
|
79
|
-
|
|
78
|
+
for (const a of t.schema) {
|
|
79
|
+
const o = typeof a.value == "function" ? a.value() : a.value;
|
|
80
|
+
let l = null;
|
|
81
|
+
(a.props?.multiple || a.type === "multiSelect" || a.type === "tags") && (l = []), e[a.name] = o ?? l;
|
|
80
82
|
}
|
|
81
|
-
return { ...e, _id:
|
|
82
|
-
},
|
|
83
|
-
if (
|
|
84
|
-
const e = [...
|
|
85
|
-
|
|
86
|
-
},
|
|
87
|
-
if (
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
},
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
...
|
|
94
|
-
[
|
|
83
|
+
return { ...e, _id: j() };
|
|
84
|
+
}, L = () => {
|
|
85
|
+
if (t.disabled || t.readonly || t.maxRows && s.value.length >= t.maxRows) return;
|
|
86
|
+
const e = [...s.value, H()];
|
|
87
|
+
s.value = e, y(e);
|
|
88
|
+
}, M = (e) => {
|
|
89
|
+
if (t.disabled || t.readonly || s.value.length <= t.minRows) return;
|
|
90
|
+
const a = [...s.value];
|
|
91
|
+
a.splice(e, 1), s.value = a, y(a);
|
|
92
|
+
}, G = async (e, a, o) => {
|
|
93
|
+
const l = [...s.value];
|
|
94
|
+
l[e] = {
|
|
95
|
+
...l[e],
|
|
96
|
+
[a]: o.value
|
|
95
97
|
};
|
|
96
|
-
const
|
|
97
|
-
if (
|
|
98
|
+
const h = t.schema.find((c) => c.name === a);
|
|
99
|
+
if (h && h.updateValues)
|
|
98
100
|
try {
|
|
99
|
-
const
|
|
100
|
-
let m = { ...
|
|
101
|
-
|
|
102
|
-
const b = await
|
|
101
|
+
const c = l[e];
|
|
102
|
+
let m = { ...t.values || {} };
|
|
103
|
+
t.name && (m = T(m, t.name, l));
|
|
104
|
+
const b = await h.updateValues({
|
|
103
105
|
value: o.value,
|
|
104
|
-
values:
|
|
106
|
+
values: c,
|
|
105
107
|
// strictly local row scope
|
|
106
108
|
globalValues: m,
|
|
107
109
|
// strictly global root scope
|
|
108
110
|
data: o.data,
|
|
109
|
-
isUpdate:
|
|
111
|
+
isUpdate: t.isUpdate
|
|
110
112
|
});
|
|
111
|
-
b && typeof b == "object" && (
|
|
112
|
-
} catch (
|
|
113
|
-
console.error(`[CustomFields] Error in updateValues for ${
|
|
113
|
+
b && typeof b == "object" && (l[e] = { ...l[e], ...b });
|
|
114
|
+
} catch (c) {
|
|
115
|
+
console.error(`[CustomFields] Error in updateValues for ${a}:`, c);
|
|
114
116
|
}
|
|
115
|
-
|
|
116
|
-
},
|
|
117
|
-
|
|
118
|
-
},
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
},
|
|
122
|
-
let
|
|
123
|
-
return
|
|
124
|
-
values:
|
|
125
|
-
globalValues:
|
|
126
|
-
isUpdate:
|
|
117
|
+
s.value = l, y(l);
|
|
118
|
+
}, O = (e) => {
|
|
119
|
+
s.value = e, y(e);
|
|
120
|
+
}, y = (e) => {
|
|
121
|
+
const a = e.map(({ _id: o, ...l }) => l);
|
|
122
|
+
U("update:modelValue", a), U("change", a);
|
|
123
|
+
}, W = (e, a) => s.value[e]?.[a], q = f(() => !(t.disabled || t.readonly || t.maxRows && s.value.length >= t.maxRows)), x = f(() => t.disabled || t.readonly ? !1 : s.value.length > t.minRows), D = f(() => t.headers && t.headers.length > 0 ? t.headers : t.schema.map((e) => e.labelI18n ? p(e.labelI18n) : e.label || e.name)), g = (e) => {
|
|
124
|
+
let a = { ...t.values || {} };
|
|
125
|
+
return t.name && (a = T(a, t.name, s.value)), {
|
|
126
|
+
values: s.value[e] || {},
|
|
127
|
+
globalValues: a,
|
|
128
|
+
isUpdate: t.isUpdate
|
|
127
129
|
};
|
|
128
|
-
},
|
|
129
|
-
if (!
|
|
130
|
-
const
|
|
131
|
-
return Object.keys(
|
|
130
|
+
}, J = (e, a) => de(e, g(a)), K = (e, a) => t.disabled ? !0 : F(a.disabled, g(e)), P = (e, a) => t.readonly ? !0 : F(a.readonly, g(e)), Q = (e, a) => a.when ? F(a.when, g(e)) : !0, X = (e) => {
|
|
131
|
+
if (!t.errors || !t.name) return "";
|
|
132
|
+
const a = `${t.name}.${e}.`;
|
|
133
|
+
return Object.keys(t.errors).filter((o) => o.startsWith(a)).map((o) => t.errors[o]).join(",");
|
|
132
134
|
};
|
|
133
|
-
return (e,
|
|
134
|
-
|
|
135
|
-
|
|
135
|
+
return (e, a) => (n(), d("div", ue, [
|
|
136
|
+
w("div", ie, [
|
|
137
|
+
B.value ? (n(), R(oe, {
|
|
136
138
|
key: 0,
|
|
137
139
|
class: "text-sm font-medium text-foreground"
|
|
138
140
|
}, {
|
|
139
|
-
default:
|
|
140
|
-
te(v(
|
|
141
|
+
default: N(() => [
|
|
142
|
+
te(v(B.value), 1)
|
|
141
143
|
]),
|
|
142
144
|
_: 1
|
|
143
|
-
})) :
|
|
144
|
-
|
|
145
|
+
})) : i("", !0),
|
|
146
|
+
r.readonly ? i("", !0) : (n(), R(E, {
|
|
147
|
+
key: 1,
|
|
145
148
|
type: "button",
|
|
146
149
|
variant: "outline",
|
|
147
150
|
size: "xs",
|
|
148
151
|
rounded: "full",
|
|
149
152
|
icon: "lucide:plus",
|
|
150
|
-
disabled: !
|
|
151
|
-
onClick:
|
|
152
|
-
}, null, 8, ["disabled"])
|
|
153
|
+
disabled: !q.value,
|
|
154
|
+
onClick: L
|
|
155
|
+
}, null, 8, ["disabled"]))
|
|
153
156
|
]),
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
(n(!0), d(k, null, V(
|
|
159
|
-
key:
|
|
160
|
-
class: C(["flex-1 p-3 min-w-0 truncate", { "border-l border-border":
|
|
157
|
+
w("div", ce, [
|
|
158
|
+
D.value.length > 0 ? (n(), d("div", me, [
|
|
159
|
+
r.draggable && !r.disabled && !r.readonly ? (n(), d("div", be)) : i("", !0),
|
|
160
|
+
r.showRowNumbers ? (n(), d("div", fe, " # ")) : i("", !0),
|
|
161
|
+
(n(!0), d(k, null, V(D.value, (o, l) => (n(), d("div", {
|
|
162
|
+
key: l,
|
|
163
|
+
class: C(["flex-1 p-3 min-w-0 truncate", { "border-l border-border": l > 0 }])
|
|
161
164
|
}, v(o), 3))), 128)),
|
|
162
|
-
|
|
163
|
-
])) :
|
|
164
|
-
|
|
165
|
-
"model-value":
|
|
166
|
-
"onUpdate:modelValue":
|
|
167
|
-
disabled: !
|
|
165
|
+
x.value ? (n(), d("div", ve)) : i("", !0)
|
|
166
|
+
])) : i("", !0),
|
|
167
|
+
$(ae(re), {
|
|
168
|
+
"model-value": s.value,
|
|
169
|
+
"onUpdate:modelValue": O,
|
|
170
|
+
disabled: !r.draggable || r.disabled || r.readonly,
|
|
168
171
|
animation: 150,
|
|
169
172
|
handle: ".drag-handle",
|
|
170
173
|
"ghost-class": "opacity-50",
|
|
171
174
|
class: "divide-y divide-border"
|
|
172
175
|
}, {
|
|
173
|
-
default:
|
|
174
|
-
(n(!0), d(k, null, V(
|
|
175
|
-
const m = [o,
|
|
176
|
-
if (
|
|
176
|
+
default: N(() => [
|
|
177
|
+
(n(!0), d(k, null, V(s.value, (o, l, h, c) => {
|
|
178
|
+
const m = [o, r.disabled, r.readonly, r.isUpdate, r.showRowNumbers, x.value, r.draggable, l, X(l)];
|
|
179
|
+
if (c && c.key === o._id && le(c, m)) return c;
|
|
177
180
|
const b = (n(), d("div", {
|
|
178
181
|
key: o._id,
|
|
179
182
|
class: "flex group bg-white transition-colors"
|
|
180
183
|
}, [
|
|
181
|
-
|
|
184
|
+
r.draggable && !r.disabled && !r.readonly ? (n(), d("div", {
|
|
182
185
|
key: 0,
|
|
183
|
-
class: C(["w-10 flex-none flex items-center justify-center border-r border-border bg-muted/5 drag-handle transition-colors",
|
|
186
|
+
class: C(["w-10 flex-none flex items-center justify-center border-r border-border bg-muted/5 drag-handle transition-colors", r.disabled ? "cursor-not-allowed opacity-50" : "cursor-grab active:cursor-grabbing hover:bg-muted/10 text-muted-foreground hover:text-foreground"])
|
|
184
187
|
}, [
|
|
185
|
-
|
|
188
|
+
$(ne, {
|
|
186
189
|
icon: "lucide:grip-vertical",
|
|
187
190
|
class: "w-4 h-4"
|
|
188
191
|
})
|
|
189
|
-
], 2)) :
|
|
190
|
-
|
|
191
|
-
(n(!0), d(k, null, V(
|
|
192
|
+
], 2)) : i("", !0),
|
|
193
|
+
r.showRowNumbers ? (n(), d("div", ye, v(l + 1), 1)) : i("", !0),
|
|
194
|
+
(n(!0), d(k, null, V(r.schema, (u, Y) => (n(), d("div", {
|
|
192
195
|
key: u.name,
|
|
193
|
-
class: C(["flex-1 min-w-0 relative", { "border-l border-border":
|
|
196
|
+
class: C(["flex-1 min-w-0 relative", { "border-l border-border": Y > 0 }])
|
|
194
197
|
}, [
|
|
195
|
-
|
|
198
|
+
Q(l, u) ? (n(), R(se, {
|
|
196
199
|
key: 0,
|
|
197
200
|
field: {
|
|
198
201
|
...u,
|
|
199
202
|
props: {
|
|
200
|
-
...
|
|
203
|
+
...J(u, l) === "multiSelect" ? { showControls: !1, wrap: !1 } : {},
|
|
201
204
|
...u.props || {}
|
|
202
205
|
},
|
|
203
206
|
label: void 0
|
|
204
207
|
},
|
|
205
|
-
value:
|
|
206
|
-
values:
|
|
207
|
-
errors:
|
|
208
|
-
error:
|
|
208
|
+
value: W(l, u.name),
|
|
209
|
+
values: s.value[l] || {},
|
|
210
|
+
errors: r.errors,
|
|
211
|
+
error: r.name && r.errors ? r.errors[`${r.name}.${l}.${u.name}`] : "",
|
|
209
212
|
variant: "transparent",
|
|
210
213
|
size: "sm",
|
|
211
214
|
rounded: "none",
|
|
212
|
-
disabled:
|
|
213
|
-
readonly:
|
|
214
|
-
isUpdate:
|
|
215
|
+
disabled: K(l, u),
|
|
216
|
+
readonly: P(l, u),
|
|
217
|
+
isUpdate: r.isUpdate,
|
|
215
218
|
class: "w-full h-full min-h-[40px]",
|
|
216
|
-
onChange: (
|
|
217
|
-
}, null, 8, ["field", "value", "values", "errors", "error", "disabled", "readonly", "isUpdate", "onChange"])) :
|
|
219
|
+
onChange: (Z) => G(l, u.name, Z)
|
|
220
|
+
}, null, 8, ["field", "value", "values", "errors", "error", "disabled", "readonly", "isUpdate", "onChange"])) : i("", !0)
|
|
218
221
|
], 2))), 128)),
|
|
219
|
-
|
|
220
|
-
|
|
222
|
+
x.value ? (n(), d("div", ge, [
|
|
223
|
+
$(E, {
|
|
221
224
|
type: "button",
|
|
222
225
|
variant: "ghost",
|
|
223
226
|
size: "xs",
|
|
224
227
|
icon: "lucide:trash-2",
|
|
225
|
-
disabled:
|
|
226
|
-
onClick: (u) =>
|
|
228
|
+
disabled: r.disabled || r.readonly,
|
|
229
|
+
onClick: (u) => M(l)
|
|
227
230
|
}, null, 8, ["disabled", "onClick"])
|
|
228
|
-
])) :
|
|
231
|
+
])) : i("", !0)
|
|
229
232
|
]));
|
|
230
233
|
return b.memo = m, b;
|
|
231
|
-
},
|
|
234
|
+
}, a, 0), 128))
|
|
232
235
|
]),
|
|
233
236
|
_: 1
|
|
234
237
|
}, 8, ["model-value", "disabled"]),
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
])) :
|
|
238
|
+
s.value.length === 0 ? (n(), d("div", he, [
|
|
239
|
+
w("p", we, v(A.value), 1),
|
|
240
|
+
w("p", pe, v(S.value), 1)
|
|
241
|
+
])) : i("", !0)
|
|
239
242
|
])
|
|
240
243
|
]));
|
|
241
244
|
}
|
|
242
245
|
});
|
|
243
246
|
export {
|
|
244
|
-
|
|
247
|
+
Be as default
|
|
245
248
|
};
|
|
@@ -5,6 +5,7 @@ interface Props {
|
|
|
5
5
|
placeholder?: string;
|
|
6
6
|
placeholderI18n?: string;
|
|
7
7
|
disabled?: boolean;
|
|
8
|
+
readonly?: boolean;
|
|
8
9
|
searchable?: boolean;
|
|
9
10
|
variant?: 'default' | 'outline' | 'solid' | 'floating' | string;
|
|
10
11
|
size?: 'sm' | 'md' | 'lg';
|
|
@@ -34,6 +35,7 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
34
35
|
size: "sm" | "md" | "lg";
|
|
35
36
|
rounded: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | string;
|
|
36
37
|
loading: boolean;
|
|
38
|
+
readonly: boolean;
|
|
37
39
|
disabled: boolean;
|
|
38
40
|
modelValue: any[];
|
|
39
41
|
options: (IDropdownOption | string | number)[];
|