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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as P, ref as k, computed as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as P, ref as k, computed as d, watch as M, openBlock as r, createBlock as f, unref as h, withCtx as g, createCommentVNode as m, createElementVNode as y, withKeys as I, withModifiers as p, normalizeClass as c, createElementBlock as v, toDisplayString as $, Fragment as T, renderList as R, createVNode as L, createTextVNode as U } from "vue";
|
|
2
|
+
import S from "../Icon.vue.js";
|
|
3
3
|
import q from "../Dropdown/Dropdown.vue.js";
|
|
4
4
|
import G from "../Dropdown/DropdownMenu.vue.js";
|
|
5
5
|
import { $t as C } from "../../utils/i18n.js";
|
|
@@ -19,6 +19,7 @@ const Q = ["tabindex", "data-testid"], W = {
|
|
|
19
19
|
placeholder: {},
|
|
20
20
|
placeholderI18n: {},
|
|
21
21
|
disabled: { type: Boolean, default: !1 },
|
|
22
|
+
readonly: { type: Boolean, default: !1 },
|
|
22
23
|
searchable: { type: Boolean, default: !0 },
|
|
23
24
|
variant: { default: "outline" },
|
|
24
25
|
size: { default: "md" },
|
|
@@ -34,107 +35,107 @@ const Q = ["tabindex", "data-testid"], W = {
|
|
|
34
35
|
rounded: { default: "md" }
|
|
35
36
|
},
|
|
36
37
|
emits: ["update:modelValue", "change", "load-more", "search"],
|
|
37
|
-
setup(
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
40
|
-
if (
|
|
41
|
-
const
|
|
42
|
-
return
|
|
43
|
-
}), x =
|
|
38
|
+
setup(t, { emit: j }) {
|
|
39
|
+
const e = t, i = j, o = k(!1), D = d(() => {
|
|
40
|
+
if (e.placeholderI18n) return C(e.placeholderI18n);
|
|
41
|
+
if (e.placeholder) return e.placeholder;
|
|
42
|
+
const a = C("vlite.multiSelect.placeholder");
|
|
43
|
+
return a !== "vlite.multiSelect.placeholder" ? a : "Select items...";
|
|
44
|
+
}), x = d(() => e.options ? e.options.map((a) => typeof a == "string" || typeof a == "number" ? { label: String(a), value: String(a) } : a) : []), B = k(!1), w = k(!1);
|
|
44
45
|
M(
|
|
45
46
|
x,
|
|
46
|
-
(
|
|
47
|
-
!B.value &&
|
|
48
|
-
w.value = !0,
|
|
47
|
+
(a) => {
|
|
48
|
+
!B.value && a.length > 0 && (B.value = !0, setTimeout(() => {
|
|
49
|
+
w.value = !0, s.hydrateSelected(e.modelValue || []);
|
|
49
50
|
}, 10));
|
|
50
51
|
},
|
|
51
52
|
{ immediate: !0 }
|
|
52
53
|
);
|
|
53
|
-
const V =
|
|
54
|
-
const
|
|
55
|
-
return
|
|
56
|
-
|
|
57
|
-
}),
|
|
58
|
-
}),
|
|
59
|
-
fetchSelected:
|
|
60
|
-
getValues: () =>
|
|
54
|
+
const V = d(() => {
|
|
55
|
+
const a = [...x.value], n = new Set(a.map((l) => l.value ?? l.label));
|
|
56
|
+
return s.selectedBuffer.value.forEach((l, u) => {
|
|
57
|
+
n.has(u) || (a.unshift(l), n.add(u));
|
|
58
|
+
}), a;
|
|
59
|
+
}), s = J({
|
|
60
|
+
fetchSelected: e.fetchSelected,
|
|
61
|
+
getValues: () => e.modelValue || [],
|
|
61
62
|
getOptions: () => V.value,
|
|
62
63
|
isInitialLoadDone: () => w.value
|
|
63
64
|
});
|
|
64
65
|
M(
|
|
65
|
-
() =>
|
|
66
|
-
(
|
|
67
|
-
w.value &&
|
|
66
|
+
() => e.modelValue,
|
|
67
|
+
(a) => {
|
|
68
|
+
w.value && s.hydrateSelected(a || []);
|
|
68
69
|
},
|
|
69
70
|
{ deep: !0 }
|
|
70
71
|
);
|
|
71
|
-
const b =
|
|
72
|
-
const
|
|
73
|
-
return
|
|
74
|
-
})), E =
|
|
75
|
-
if (
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
const
|
|
79
|
-
u === -1 ?
|
|
80
|
-
}, K = (
|
|
81
|
-
if (
|
|
82
|
-
const
|
|
83
|
-
i("update:modelValue",
|
|
72
|
+
const b = d(() => V.value.filter((a) => {
|
|
73
|
+
const n = a.value ?? a.label;
|
|
74
|
+
return e.modelValue.includes(n);
|
|
75
|
+
})), E = d(() => b.value.slice(0, e.maxVisible)), O = d(() => b.value.length - e.maxVisible), H = (a) => {
|
|
76
|
+
if (e.disabled || e.readonly) return;
|
|
77
|
+
const n = a.value ?? a.label;
|
|
78
|
+
s.selectedBuffer.value.has(n) || s.selectedBuffer.value.set(n, a);
|
|
79
|
+
const l = [...e.modelValue], u = l.indexOf(n);
|
|
80
|
+
u === -1 ? l.push(n) : l.splice(u, 1), i("update:modelValue", l), i("change", l);
|
|
81
|
+
}, K = (a) => {
|
|
82
|
+
if (e.disabled || e.readonly) return;
|
|
83
|
+
const n = e.modelValue.filter((l) => l !== a);
|
|
84
|
+
i("update:modelValue", n), i("change", n);
|
|
84
85
|
}, A = () => {
|
|
85
|
-
|
|
86
|
-
}, F =
|
|
87
|
-
const
|
|
86
|
+
e.disabled || e.readonly || (i("update:modelValue", []), i("change", []));
|
|
87
|
+
}, F = d(() => {
|
|
88
|
+
const a = e.rounded === "none" ? "rounded-none" : `rounded-${e.rounded}`, n = e.variant === "transparent" ? "px-2 py-0" : "px-3 py-1.5", l = e.variant === "transparent" ? "h-full min-h-[40px]" : "min-h-[40px]";
|
|
88
89
|
return [
|
|
89
|
-
`flex items-center justify-between w-full ${
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
o.value &&
|
|
90
|
+
`flex items-center justify-between w-full ${n} ${l} ${a} border text-sm transition-colors outline-none`,
|
|
91
|
+
e.disabled ? "opacity-50 cursor-not-allowed bg-muted" : e.readonly ? `cursor-default ${e.variant === "transparent" || e.variant === "floating" ? "bg-transparent text-foreground" : "bg-background"}` : `cursor-pointer ${e.variant === "floating" || e.variant === "transparent" ? "bg-transparent text-foreground" : "bg-background hover:bg-gray-50/70"}`,
|
|
92
|
+
e.variant === "outline" || e.variant === "floating" ? "border-input focus-visible:ring-1 focus-visible:ring-primary" : e.variant === "transparent" ? "border-transparent" : "border-transparent bg-muted",
|
|
93
|
+
o.value && e.variant !== "transparent" ? "border-primary/20 ring-1 ring-primary/20" : ""
|
|
93
94
|
].join(" ");
|
|
94
|
-
}), z =
|
|
95
|
-
return (
|
|
95
|
+
}), z = d(() => e.size === "sm" ? "xs" : "sm");
|
|
96
|
+
return (a, n) => (r(), f(h(q), {
|
|
96
97
|
isOpen: o.value,
|
|
97
|
-
"onUpdate:isOpen":
|
|
98
|
+
"onUpdate:isOpen": n[5] || (n[5] = (l) => o.value = l),
|
|
98
99
|
"close-on-select": !1,
|
|
99
100
|
selectable: !0,
|
|
100
|
-
disabled:
|
|
101
|
+
disabled: t.disabled || t.readonly
|
|
101
102
|
}, {
|
|
102
|
-
trigger:
|
|
103
|
-
|
|
103
|
+
trigger: g(() => [
|
|
104
|
+
y("div", {
|
|
104
105
|
class: c(F.value),
|
|
105
|
-
tabindex:
|
|
106
|
+
tabindex: t.disabled || t.readonly ? -1 : 0,
|
|
106
107
|
onKeydown: [
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
n[0] || (n[0] = I(p((l) => !(t.disabled || t.readonly) && (o.value = !o.value), ["prevent"]), ["enter"])),
|
|
109
|
+
n[1] || (n[1] = I(p((l) => !(t.disabled || t.readonly) && (o.value = !o.value), ["prevent"]), ["space"]))
|
|
109
110
|
],
|
|
110
|
-
"data-testid":
|
|
111
|
+
"data-testid": a.$attrs["data-testid"] || (a.$attrs.name ? `multiselect-${a.$attrs.name}` : "multiselect")
|
|
111
112
|
}, [
|
|
112
|
-
|
|
113
|
-
class: c(["flex gap-1.5 items-center flex-1 min-w-0", [
|
|
113
|
+
y("div", {
|
|
114
|
+
class: c(["flex gap-1.5 items-center flex-1 min-w-0", [t.wrap ? "flex-wrap py-0.5" : "flex-nowrap overflow-hidden py-1"]])
|
|
114
115
|
}, [
|
|
115
|
-
b.value.length === 0 ? (r(), v("span", W,
|
|
116
|
-
(r(!0), v(T, null, R(E.value, (
|
|
117
|
-
key:
|
|
118
|
-
variant:
|
|
116
|
+
b.value.length === 0 ? (r(), v("span", W, $(D.value), 1)) : (r(), v(T, { key: 1 }, [
|
|
117
|
+
(r(!0), v(T, null, R(E.value, (l) => (r(), f(N, {
|
|
118
|
+
key: l.value,
|
|
119
|
+
variant: t.variant === "transparent" ? "outline" : "secondary",
|
|
119
120
|
size: z.value,
|
|
120
|
-
rounded:
|
|
121
|
+
rounded: t.rounded === "none" ? "sm" : "full",
|
|
121
122
|
class: c(["gap-1 pr-1 truncate min-w-0 shrink", [
|
|
122
|
-
|
|
123
|
-
|
|
123
|
+
t.wrap ? "max-w-[150px]" : "",
|
|
124
|
+
t.variant === "transparent" ? "border-transparent bg-muted/50 text-foreground font-medium shadow-none" : ""
|
|
124
125
|
]])
|
|
125
126
|
}, {
|
|
126
|
-
default:
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
default: g(() => [
|
|
128
|
+
y("span", X, $(l.labelI18n ? h(C)(l.labelI18n) : l.label), 1),
|
|
129
|
+
t.disabled || t.readonly ? m("", !0) : (r(), v("button", {
|
|
129
130
|
key: 0,
|
|
130
131
|
type: "button",
|
|
131
|
-
onClick:
|
|
132
|
+
onClick: p((u) => K(l.value), ["stop"]),
|
|
132
133
|
class: c([
|
|
133
134
|
"rounded transition-colors shrink-0 flex items-center justify-center p-px",
|
|
134
|
-
|
|
135
|
+
t.variant === "transparent" ? "text-muted-foreground hover:bg-black/10 hover:text-foreground" : "hover:bg-destructive/10 hover:text-destructive p-0.5 rounded-full"
|
|
135
136
|
])
|
|
136
137
|
}, [
|
|
137
|
-
L(
|
|
138
|
+
L(S, {
|
|
138
139
|
icon: "lucide:x",
|
|
139
140
|
class: "w-3 h-3"
|
|
140
141
|
})
|
|
@@ -142,55 +143,55 @@ const Q = ["tabindex", "data-testid"], W = {
|
|
|
142
143
|
]),
|
|
143
144
|
_: 2
|
|
144
145
|
}, 1032, ["variant", "size", "rounded", "class"]))), 128)),
|
|
145
|
-
O.value > 0 ? (r(),
|
|
146
|
+
O.value > 0 ? (r(), f(N, {
|
|
146
147
|
key: 0,
|
|
147
|
-
variant:
|
|
148
|
+
variant: t.variant === "transparent" ? "outline" : "secondary",
|
|
148
149
|
size: z.value,
|
|
149
|
-
rounded:
|
|
150
|
+
rounded: t.rounded === "none" ? "sm" : "full",
|
|
150
151
|
class: c([
|
|
151
152
|
"shrink-0",
|
|
152
|
-
|
|
153
|
+
t.variant === "transparent" ? "border-transparent bg-muted/50 text-muted-foreground font-medium shadow-none" : ""
|
|
153
154
|
])
|
|
154
155
|
}, {
|
|
155
|
-
default:
|
|
156
|
-
U(" +" +
|
|
156
|
+
default: g(() => [
|
|
157
|
+
U(" +" + $(O.value), 1)
|
|
157
158
|
]),
|
|
158
159
|
_: 1
|
|
159
|
-
}, 8, ["variant", "size", "rounded", "class"])) :
|
|
160
|
+
}, 8, ["variant", "size", "rounded", "class"])) : m("", !0)
|
|
160
161
|
], 64))
|
|
161
162
|
], 2),
|
|
162
|
-
|
|
163
|
-
b.value.length > 0 && !
|
|
163
|
+
t.showControls && !(t.disabled || t.readonly) ? (r(), v("div", Z, [
|
|
164
|
+
b.value.length > 0 && !(t.disabled || t.readonly) ? (r(), f(S, {
|
|
164
165
|
key: 0,
|
|
165
166
|
icon: "lucide:x",
|
|
166
167
|
class: "w-4 h-4 hover:text-foreground transition-colors",
|
|
167
|
-
onClick:
|
|
168
|
-
})) :
|
|
169
|
-
|
|
170
|
-
L(
|
|
168
|
+
onClick: p(A, ["stop"])
|
|
169
|
+
})) : m("", !0),
|
|
170
|
+
n[6] || (n[6] = y("div", { class: "w-px h-4 bg-border mx-0.5" }, null, -1)),
|
|
171
|
+
L(S, {
|
|
171
172
|
icon: "lucide:chevron-down",
|
|
172
173
|
class: c(["w-4 h-4 transition-transform duration-200", { "rotate-180": o.value }])
|
|
173
174
|
}, null, 8, ["class"])
|
|
174
|
-
])) :
|
|
175
|
+
])) : m("", !0)
|
|
175
176
|
], 42, Q)
|
|
176
177
|
]),
|
|
177
|
-
default:
|
|
178
|
-
|
|
178
|
+
default: g(() => [
|
|
179
|
+
t.disabled || t.readonly ? m("", !0) : (r(), f(h(G), {
|
|
179
180
|
key: 0,
|
|
180
181
|
options: x.value,
|
|
181
182
|
cachedOptions: V.value,
|
|
182
|
-
selected:
|
|
183
|
+
selected: t.modelValue,
|
|
183
184
|
class: "min-w-[300px]",
|
|
184
|
-
loading:
|
|
185
|
-
hasMore:
|
|
186
|
-
searchable:
|
|
187
|
-
remote:
|
|
188
|
-
debounceTime:
|
|
189
|
-
layout:
|
|
185
|
+
loading: t.loading || h(s).isHydrating.value,
|
|
186
|
+
hasMore: t.hasMore,
|
|
187
|
+
searchable: t.searchable,
|
|
188
|
+
remote: t.remote,
|
|
189
|
+
debounceTime: t.debounceTime,
|
|
190
|
+
layout: t.layout,
|
|
190
191
|
onSelect: H,
|
|
191
|
-
onClose:
|
|
192
|
-
onLoadMore:
|
|
193
|
-
onSearch:
|
|
192
|
+
onClose: n[2] || (n[2] = (l) => o.value = !1),
|
|
193
|
+
onLoadMore: n[3] || (n[3] = (l) => a.$emit("load-more")),
|
|
194
|
+
onSearch: n[4] || (n[4] = (l) => a.$emit("search", l))
|
|
194
195
|
}, null, 8, ["options", "cachedOptions", "selected", "loading", "hasMore", "searchable", "remote", "debounceTime", "layout"]))
|
|
195
196
|
]),
|
|
196
197
|
_: 1
|
|
@@ -3,7 +3,7 @@ import L from "./Icon.vue.js";
|
|
|
3
3
|
import v from "./Modal.vue.js";
|
|
4
4
|
import N from "./CommandPalette/CommandPaletteContent.vue.js";
|
|
5
5
|
import { $t as U } from "../utils/i18n.js";
|
|
6
|
-
/* empty css
|
|
6
|
+
/* empty css */
|
|
7
7
|
const V = { class: "block truncate -text-fs-1.5" }, S = { class: "ml-auto inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[10px] font-mono font-medium border border-border/80 bg-background text-muted-foreground ml-1" }, A = /* @__PURE__ */ x({
|
|
8
8
|
__name: "NavbarCommandPalette",
|
|
9
9
|
props: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./NumberInput.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-cce64dd9"]]);
|
|
5
5
|
export {
|
|
6
6
|
c as default
|
|
7
7
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as E, ref as k, watch as
|
|
1
|
+
import { defineComponent as E, ref as k, watch as p, computed as u, onBeforeUnmount as q, openBlock as f, createElementBlock as y, normalizeClass as i, withModifiers as r, createVNode as g, createCommentVNode as P, createElementVNode as h, withKeys as z } from "vue";
|
|
2
2
|
import w from "./Icon.vue.js";
|
|
3
|
-
const
|
|
3
|
+
const L = ["disabled", "data-testid"], M = ["value", "placeholder", "disabled", "readonly", "onKeydown", "data-testid"], U = ["disabled", "data-testid"], W = {
|
|
4
4
|
key: 2,
|
|
5
5
|
class: "flex flex-col justify-center h-full py-[3px] pr-[3px]"
|
|
6
|
-
},
|
|
6
|
+
}, A = { class: "flex flex-col h-full w-6 scale-80" }, D = ["disabled", "data-testid"], G = ["disabled", "data-testid"], O = /* @__PURE__ */ E({
|
|
7
7
|
__name: "NumberInput",
|
|
8
8
|
props: {
|
|
9
9
|
modelValue: { default: void 0 },
|
|
@@ -23,7 +23,7 @@ const M = ["disabled", "data-testid"], U = ["value", "min", "max", "step", "plac
|
|
|
23
23
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
24
24
|
setup(e, { emit: V }) {
|
|
25
25
|
const n = e, m = V, a = k(n.modelValue ?? "");
|
|
26
|
-
|
|
26
|
+
p(
|
|
27
27
|
() => n.modelValue,
|
|
28
28
|
(d) => {
|
|
29
29
|
d !== void 0 && (a.value = d);
|
|
@@ -38,7 +38,7 @@ const M = ["disabled", "data-testid"], U = ["value", "min", "max", "step", "plac
|
|
|
38
38
|
xl: { h: "h-12", text: "text-lg", px: "px-5", icon: "w-6 h-6" }
|
|
39
39
|
};
|
|
40
40
|
return d[n.size] || d.md;
|
|
41
|
-
}),
|
|
41
|
+
}), I = u(() => ({
|
|
42
42
|
none: "rounded-none",
|
|
43
43
|
sm: "rounded-sm",
|
|
44
44
|
md: "rounded-md",
|
|
@@ -46,7 +46,7 @@ const M = ["disabled", "data-testid"], U = ["value", "min", "max", "step", "plac
|
|
|
46
46
|
xl: "rounded-xl",
|
|
47
47
|
"2xl": "rounded-2xl",
|
|
48
48
|
full: "rounded-full"
|
|
49
|
-
})[n.rounded] || "rounded-md"),
|
|
49
|
+
})[n.rounded] || "rounded-md"), j = u(() => ({
|
|
50
50
|
none: "rounded-l-none",
|
|
51
51
|
sm: "rounded-l-sm",
|
|
52
52
|
md: "rounded-l-md",
|
|
@@ -69,7 +69,7 @@ const M = ["disabled", "data-testid"], U = ["value", "min", "max", "step", "plac
|
|
|
69
69
|
n.mode === "outline" ? "border border-input bg-background" : "",
|
|
70
70
|
n.mode === "ghost" ? "bg-transparent" : "",
|
|
71
71
|
c.value.h,
|
|
72
|
-
|
|
72
|
+
I.value
|
|
73
73
|
]), K = u(() => [
|
|
74
74
|
"flex-1 w-full bg-transparent focus:outline-none appearance-none",
|
|
75
75
|
n.variant === "split" ? "text-center" : "text-left pl-3 pr-2",
|
|
@@ -105,7 +105,7 @@ const M = ["disabled", "data-testid"], U = ["value", "min", "max", "step", "plac
|
|
|
105
105
|
}
|
|
106
106
|
const d = Number(a.value) || 0;
|
|
107
107
|
s(d - n.step);
|
|
108
|
-
},
|
|
108
|
+
}, v = (d, t) => {
|
|
109
109
|
t.button !== 0 && t.pointerType === "mouse" || (l(), d === "inc" ? $() : N(), b = setTimeout(() => {
|
|
110
110
|
x = setInterval(() => {
|
|
111
111
|
d === "inc" ? $() : N();
|
|
@@ -123,22 +123,22 @@ const M = ["disabled", "data-testid"], U = ["value", "min", "max", "step", "plac
|
|
|
123
123
|
const t = parseFloat(String(a.value));
|
|
124
124
|
isNaN(t) ? s(n.min || 0) : s(t);
|
|
125
125
|
};
|
|
126
|
-
return
|
|
126
|
+
return q(() => {
|
|
127
127
|
l();
|
|
128
|
-
}), (d, t) => (
|
|
128
|
+
}), (d, t) => (f(), y("div", {
|
|
129
129
|
class: i([F.value, "overflow-hidden"])
|
|
130
130
|
}, [
|
|
131
|
-
e.variant === "split" && !e.disabled && !e.readonly ? (
|
|
131
|
+
e.variant === "split" && !e.disabled && !e.readonly ? (f(), y("button", {
|
|
132
132
|
key: 0,
|
|
133
133
|
tabindex: "-1",
|
|
134
134
|
type: "button",
|
|
135
135
|
class: i([
|
|
136
136
|
C.value,
|
|
137
137
|
e.mode === "outline" ? "border-r border-input" : "",
|
|
138
|
-
e.variant === "split" && e.mode !== "solid" ?
|
|
138
|
+
e.variant === "split" && e.mode !== "solid" ? j.value : ""
|
|
139
139
|
]),
|
|
140
140
|
disabled: e.disabled || e.min !== void 0 && Number(a.value) <= e.min,
|
|
141
|
-
onPointerdown: t[0] || (t[0] = (o) =>
|
|
141
|
+
onPointerdown: t[0] || (t[0] = (o) => v("dec", o)),
|
|
142
142
|
onPointerup: l,
|
|
143
143
|
onPointerleave: l,
|
|
144
144
|
onPointercancel: l,
|
|
@@ -146,19 +146,16 @@ const M = ["disabled", "data-testid"], U = ["value", "min", "max", "step", "plac
|
|
|
146
146
|
}, ["prevent"])),
|
|
147
147
|
"data-testid": d.$attrs["data-testid"] ? `${d.$attrs["data-testid"]}-dec` : e.name ? `number-${e.name}-dec` : e.id ? `number-${e.id}-dec` : "number-input-dec"
|
|
148
148
|
}, [
|
|
149
|
-
|
|
149
|
+
g(w, {
|
|
150
150
|
icon: "lucide:minus",
|
|
151
151
|
class: i(c.value.icon)
|
|
152
152
|
}, null, 8, ["class"])
|
|
153
|
-
], 42,
|
|
154
|
-
|
|
153
|
+
], 42, L)) : P("", !0),
|
|
154
|
+
h("input", {
|
|
155
155
|
ref_key: "inputRef",
|
|
156
156
|
ref: B,
|
|
157
157
|
type: "number",
|
|
158
158
|
value: a.value,
|
|
159
|
-
min: e.min,
|
|
160
|
-
max: e.max,
|
|
161
|
-
step: e.step,
|
|
162
159
|
placeholder: e.placeholder,
|
|
163
160
|
disabled: e.disabled,
|
|
164
161
|
readonly: e.readonly,
|
|
@@ -170,9 +167,13 @@ const M = ["disabled", "data-testid"], U = ["value", "min", "max", "step", "plac
|
|
|
170
167
|
z(r($, ["prevent"]), ["up"]),
|
|
171
168
|
z(r(N, ["prevent"]), ["down"])
|
|
172
169
|
],
|
|
170
|
+
onWheel: t[3] || (t[3] = r(() => {
|
|
171
|
+
}, ["prevent"])),
|
|
172
|
+
onInvalid: t[4] || (t[4] = r(() => {
|
|
173
|
+
}, ["prevent"])),
|
|
173
174
|
"data-testid": d.$attrs["data-testid"] || (e.name ? `number-${e.name}` : e.id ? `number-${e.id}` : "number-input")
|
|
174
|
-
}, null, 42,
|
|
175
|
-
e.variant === "split" && !e.disabled && !e.readonly ? (
|
|
175
|
+
}, null, 42, M),
|
|
176
|
+
e.variant === "split" && !e.disabled && !e.readonly ? (f(), y("button", {
|
|
176
177
|
key: 1,
|
|
177
178
|
tabindex: "-1",
|
|
178
179
|
type: "button",
|
|
@@ -182,62 +183,62 @@ const M = ["disabled", "data-testid"], U = ["value", "min", "max", "step", "plac
|
|
|
182
183
|
e.variant === "split" && e.mode !== "solid" ? S.value : ""
|
|
183
184
|
]),
|
|
184
185
|
disabled: e.disabled || e.max !== void 0 && Number(a.value) >= e.max,
|
|
185
|
-
onPointerdown: t[
|
|
186
|
+
onPointerdown: t[5] || (t[5] = (o) => v("inc", o)),
|
|
186
187
|
onPointerup: l,
|
|
187
188
|
onPointerleave: l,
|
|
188
189
|
onPointercancel: l,
|
|
189
|
-
onContextmenu: t[
|
|
190
|
+
onContextmenu: t[6] || (t[6] = r(() => {
|
|
190
191
|
}, ["prevent"])),
|
|
191
192
|
"data-testid": d.$attrs["data-testid"] ? `${d.$attrs["data-testid"]}-inc` : e.name ? `number-${e.name}-inc` : e.id ? `number-${e.id}-inc` : "number-input-inc"
|
|
192
193
|
}, [
|
|
193
|
-
|
|
194
|
+
g(w, {
|
|
194
195
|
icon: "lucide:plus",
|
|
195
196
|
class: i(c.value.icon)
|
|
196
197
|
}, null, 8, ["class"])
|
|
197
|
-
], 42,
|
|
198
|
-
e.variant === "stacked" && !e.disabled && !e.readonly ? (
|
|
199
|
-
|
|
200
|
-
|
|
198
|
+
], 42, U)) : P("", !0),
|
|
199
|
+
e.variant === "stacked" && !e.disabled && !e.readonly ? (f(), y("div", W, [
|
|
200
|
+
h("div", A, [
|
|
201
|
+
h("button", {
|
|
201
202
|
tabindex: "-1",
|
|
202
203
|
type: "button",
|
|
203
204
|
class: "flex-1 flex items-center justify-center bg-gray-100 hover:bg-gray-200 text-muted-foreground hover:text-foreground rounded-t-[3px] border-b border-gray-300 transition-colors disabled:cursor-not-allowed",
|
|
204
205
|
disabled: e.disabled || e.max !== void 0 && Number(a.value) >= e.max,
|
|
205
|
-
onPointerdown: t[
|
|
206
|
+
onPointerdown: t[7] || (t[7] = (o) => v("inc", o)),
|
|
206
207
|
onPointerup: l,
|
|
207
208
|
onPointerleave: l,
|
|
208
209
|
onPointercancel: l,
|
|
209
|
-
onContextmenu: t[
|
|
210
|
+
onContextmenu: t[8] || (t[8] = r(() => {
|
|
210
211
|
}, ["prevent"])),
|
|
211
212
|
"data-testid": d.$attrs["data-testid"] ? `${d.$attrs["data-testid"]}-inc` : e.name ? `number-${e.name}-inc` : e.id ? `number-${e.id}-inc` : "number-input-inc"
|
|
212
213
|
}, [
|
|
213
|
-
|
|
214
|
+
g(w, {
|
|
214
215
|
class: i(["text-gray-700/85!", e.size === "xs" || e.size === "sm" ? "w-3 h-3" : "w-3.5 h-3.5"]),
|
|
215
216
|
icon: "mynaui:chevron-up-solid"
|
|
216
217
|
}, null, 8, ["class"])
|
|
217
|
-
], 40,
|
|
218
|
-
|
|
218
|
+
], 40, D),
|
|
219
|
+
h("button", {
|
|
219
220
|
tabindex: "-1",
|
|
220
221
|
type: "button",
|
|
221
222
|
class: "flex-1 flex items-center justify-center bg-gray-100 hover:bg-gray-200 text-muted-foreground hover:text-foreground rounded-b-[3px] transition-colors disabled:cursor-not-allowed",
|
|
222
223
|
disabled: e.disabled || e.min !== void 0 && Number(a.value) <= e.min,
|
|
223
|
-
onPointerdown: t[
|
|
224
|
+
onPointerdown: t[9] || (t[9] = (o) => v("dec", o)),
|
|
224
225
|
onPointerup: l,
|
|
225
226
|
onPointerleave: l,
|
|
226
227
|
onPointercancel: l,
|
|
227
|
-
onContextmenu: t[
|
|
228
|
+
onContextmenu: t[10] || (t[10] = r(() => {
|
|
228
229
|
}, ["prevent"])),
|
|
229
230
|
"data-testid": d.$attrs["data-testid"] ? `${d.$attrs["data-testid"]}-dec` : e.name ? `number-${e.name}-dec` : e.id ? `number-${e.id}-dec` : "number-input-dec"
|
|
230
231
|
}, [
|
|
231
|
-
|
|
232
|
+
g(w, {
|
|
232
233
|
class: i(["text-gray-700/85!", e.size === "xs" || e.size === "sm" ? "w-3 h-3" : "w-3.5 h-3.5"]),
|
|
233
234
|
icon: "mynaui:chevron-down-solid"
|
|
234
235
|
}, null, 8, ["class"])
|
|
235
|
-
], 40,
|
|
236
|
+
], 40, G)
|
|
236
237
|
])
|
|
237
238
|
])) : P("", !0)
|
|
238
239
|
], 2));
|
|
239
240
|
}
|
|
240
241
|
});
|
|
241
242
|
export {
|
|
242
|
-
|
|
243
|
+
O as default
|
|
243
244
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
visible: boolean;
|
|
3
|
+
isEditing: boolean;
|
|
4
|
+
url: string;
|
|
5
|
+
popoverStyle?: Record<string, string | number>;
|
|
6
|
+
}
|
|
7
|
+
declare function focusInput(): void;
|
|
8
|
+
declare const _default: import('vue').DefineComponent<Props, {
|
|
9
|
+
focusInput: typeof focusInput;
|
|
10
|
+
el: import('vue').Ref<HTMLInputElement, HTMLInputElement>;
|
|
11
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
12
|
+
apply: () => any;
|
|
13
|
+
close: () => any;
|
|
14
|
+
"update:url": (val: string) => any;
|
|
15
|
+
unlink: () => any;
|
|
16
|
+
openTab: () => any;
|
|
17
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
18
|
+
onApply?: () => any;
|
|
19
|
+
onClose?: () => any;
|
|
20
|
+
"onUpdate:url"?: (val: string) => any;
|
|
21
|
+
onUnlink?: () => any;
|
|
22
|
+
onOpenTab?: () => any;
|
|
23
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
24
|
+
linkInputRef: HTMLInputElement;
|
|
25
|
+
}, any>;
|
|
26
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
content?: string;
|
|
3
|
+
}
|
|
4
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
5
|
+
content: string;
|
|
6
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
toolbarState: Record<string, boolean>;
|
|
3
|
+
activeBlock: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
readonly?: boolean;
|
|
6
|
+
isUploadingImage: boolean;
|
|
7
|
+
label?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
10
|
+
command: (cmd: string, val?: string) => any;
|
|
11
|
+
setBlock: (tag: string) => any;
|
|
12
|
+
insertCode: () => any;
|
|
13
|
+
triggerImageUpload: () => any;
|
|
14
|
+
openLinkPopover: () => any;
|
|
15
|
+
clearFormat: () => any;
|
|
16
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
17
|
+
onCommand?: (cmd: string, val?: string) => any;
|
|
18
|
+
onSetBlock?: (tag: string) => any;
|
|
19
|
+
onInsertCode?: () => any;
|
|
20
|
+
onTriggerImageUpload?: () => any;
|
|
21
|
+
onOpenLinkPopover?: () => any;
|
|
22
|
+
onClearFormat?: () => any;
|
|
23
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare function useRichTextImageUpload(editorRef: {
|
|
2
|
+
value: HTMLDivElement | null;
|
|
3
|
+
}, callbacks: {
|
|
4
|
+
saveSelection: () => void;
|
|
5
|
+
restoreSelection: () => void;
|
|
6
|
+
onInput: () => void;
|
|
7
|
+
}): {
|
|
8
|
+
imageInputRef: import('vue').Ref<HTMLInputElement, HTMLInputElement>;
|
|
9
|
+
isUploadingImage: import('vue').ComputedRef<boolean>;
|
|
10
|
+
triggerImageUpload: (disabledOrReadonly: boolean) => void;
|
|
11
|
+
onImageFileChange: (e: Event) => Promise<void>;
|
|
12
|
+
onPaste: (e: ClipboardEvent) => Promise<void>;
|
|
13
|
+
onDrop: (e: DragEvent) => Promise<void>;
|
|
14
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Ref, ComponentPublicInstance } from 'vue';
|
|
2
|
+
export interface EditorContext {
|
|
3
|
+
editorRef: Ref<HTMLDivElement | null>;
|
|
4
|
+
rootRef: Ref<HTMLDivElement | null>;
|
|
5
|
+
linkPopoverElRef: Ref<HTMLElement | ComponentPublicInstance | null>;
|
|
6
|
+
callbacks: {
|
|
7
|
+
restoreSelection: () => void;
|
|
8
|
+
onInput: () => void;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export declare function useRichTextLinks(ctx: EditorContext): {
|
|
12
|
+
linkPopover: import('vue').ShallowRef<{
|
|
13
|
+
visible: boolean;
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
url: string;
|
|
17
|
+
isEditing: boolean;
|
|
18
|
+
}, {
|
|
19
|
+
visible: boolean;
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
url: string;
|
|
23
|
+
isEditing: boolean;
|
|
24
|
+
}>;
|
|
25
|
+
checkLinkAtCursor: () => void;
|
|
26
|
+
openLinkPopover: () => void;
|
|
27
|
+
applyLink: (urlVal?: string) => void;
|
|
28
|
+
unlinkCurrent: () => void;
|
|
29
|
+
openLinkInTab: (urlVal?: string) => void;
|
|
30
|
+
closeLinkPopover: () => void;
|
|
31
|
+
updateUrl: (url: string) => void;
|
|
32
|
+
};
|