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.
Files changed (84) hide show
  1. package/README.md +5 -0
  2. package/components/CategoryManager/CategoryManager.vue.js +1 -1
  3. package/components/Chart/BarChart.vue.d.ts +48 -0
  4. package/components/Chart/CircleChart.vue.d.ts +47 -0
  5. package/components/Chart/LineChart.vue.d.ts +55 -0
  6. package/components/Chart/PieChart.vue.d.ts +49 -0
  7. package/components/Chart/index.d.ts +5 -0
  8. package/components/Chart/types.d.ts +135 -0
  9. package/components/Chart/utils.d.ts +40 -0
  10. package/components/ColorPicker/ColorIro.vue3.js +2 -2
  11. package/components/ColorPicker/ColorPicker.vue.js +2 -2
  12. package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
  13. package/components/CommandPalette/{CommandPaletteItem.vue2.js → CommandPaletteItem.vue.js} +1 -1
  14. package/components/Comment/CommentEditor.vue.d.ts +41 -0
  15. package/components/Comment/CommentEditor.vue.js +221 -0
  16. package/components/Comment/CommentEditor.vue2.js +4 -0
  17. package/components/Comment/CommentItem.vue.d.ts +70 -0
  18. package/components/Comment/CommentItem.vue.js +7 -0
  19. package/components/Comment/CommentItem.vue2.js +322 -0
  20. package/components/Comment/CommentThread.vue.d.ts +64 -0
  21. package/components/Comment/CommentThread.vue.js +185 -0
  22. package/components/Comment/CommentThread.vue2.js +4 -0
  23. package/components/Comment/index.d.ts +4 -0
  24. package/components/Comment/types.d.ts +34 -0
  25. package/components/DataTable/DataTable.vue.d.ts +2 -4
  26. package/components/DataTable/DataTable.vue.js +175 -226
  27. package/components/DataTable/DataTableHeader.vue.d.ts +2 -0
  28. package/components/DataTable/DataTableHeader.vue.js +24 -23
  29. package/components/DataTable/DataTableRow.vue.d.ts +2 -0
  30. package/components/DataTable/DataTableRow.vue.js +32 -31
  31. package/components/DataTable/types.d.ts +2 -9
  32. package/components/Dropdown/Dropdown.vue.d.ts +2 -0
  33. package/components/Dropdown/Dropdown.vue.js +60 -58
  34. package/components/Dropdown/DropdownTrigger.vue.d.ts +2 -0
  35. package/components/Dropdown/DropdownTrigger.vue.js +7 -6
  36. package/components/Empty/Empty.vue.js +7 -5
  37. package/components/Empty/index.d.ts +1 -1
  38. package/components/Empty/variants/Variant12.vue.d.ts +22 -0
  39. package/components/Empty/variants/Variant12.vue.js +35 -0
  40. package/components/Empty/variants/Variant12.vue2.js +4 -0
  41. package/components/Footer/Footer.vue.d.ts +3 -0
  42. package/components/Footer/Variant1.vue.d.ts +20 -0
  43. package/components/Footer/Variant2.vue.d.ts +20 -0
  44. package/components/Footer/Variant3.vue.d.ts +12 -0
  45. package/components/Footer/index.d.ts +2 -0
  46. package/components/Footer/types.d.ts +73 -0
  47. package/components/Form/CustomFields.vue.d.ts +2 -0
  48. package/components/Form/CustomFields.vue.js +2 -2
  49. package/components/Form/CustomFields.vue2.js +125 -122
  50. package/components/Form/FormField.vue.js +1 -1
  51. package/components/MultiSelect/MultiSelect.vue.d.ts +2 -0
  52. package/components/MultiSelect/MultiSelect.vue.js +95 -94
  53. package/components/NavbarCommandPalette.vue.js +1 -1
  54. package/components/NumberInput.vue.js +1 -1
  55. package/components/NumberInput.vue2.js +39 -38
  56. package/components/RichTextEditor/RichTextLinkPopover.vue.d.ts +26 -0
  57. package/components/RichTextEditor/RichTextReader.vue.d.ts +7 -0
  58. package/components/RichTextEditor/RichTextToolbar.vue.d.ts +24 -0
  59. package/components/RichTextEditor/composables/useRichTextImageUpload.d.ts +14 -0
  60. package/components/RichTextEditor/composables/useRichTextLinks.d.ts +32 -0
  61. package/components/RichTextEditor/index.d.ts +2 -0
  62. package/components/Screen/Screen.vue.js +45 -46
  63. package/components/Screen/ScreenFilter.vue.js +1 -1
  64. package/components/SidebarMenu/SidebarMenu.vue.d.ts +1 -1
  65. package/components/SidebarMenu/SidebarMenu.vue.js +192 -91
  66. package/components/SidebarMenu/SidebarMenu.vue3.js +5 -0
  67. package/components/SidebarMenu/SidebarMenuItem.vue.js +170 -157
  68. package/components/SidebarMenu/types.d.ts +12 -3
  69. package/components/{DataTable/DataTableToolbar.vue.d.ts → Splitter/Splitter.vue.d.ts} +18 -15
  70. package/components/Splitter/Splitter.vue.js +64 -0
  71. package/components/Splitter/Splitter.vue2.js +4 -0
  72. package/components/Splitter/index.d.ts +1 -0
  73. package/components/StatusChip/status-map.js +34 -2
  74. package/components/index.d.ts +4 -0
  75. package/core/config.d.ts +18 -0
  76. package/index.d.ts +2 -0
  77. package/index.js +316 -307
  78. package/package.json +1 -1
  79. package/style.css +42 -6
  80. package/types/config.type.d.ts +2 -0
  81. package/components/DataTable/DataTableToolbar.vue.js +0 -60
  82. package/components/DataTable/DataTableToolbar.vue2.js +0 -4
  83. package/components/SidebarMenu/SidebarMenu.vue2.js +0 -4
  84. /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 s, watch as M, openBlock as r, createBlock as m, unref as h, withCtx as p, createCommentVNode as f, createElementVNode as g, withKeys as I, withModifiers as y, normalizeClass as c, createElementBlock as v, toDisplayString as S, Fragment as T, renderList as R, createVNode as L, createTextVNode as U } from "vue";
2
- import $ from "../Icon.vue.js";
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(l, { emit: j }) {
38
- const t = l, i = j, o = k(!1), D = s(() => {
39
- if (t.placeholderI18n) return C(t.placeholderI18n);
40
- if (t.placeholder) return t.placeholder;
41
- const e = C("vlite.multiSelect.placeholder");
42
- return e !== "vlite.multiSelect.placeholder" ? e : "Select items...";
43
- }), x = s(() => t.options ? t.options.map((e) => typeof e == "string" || typeof e == "number" ? { label: String(e), value: String(e) } : e) : []), B = k(!1), w = k(!1);
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
- (e) => {
47
- !B.value && e.length > 0 && (B.value = !0, setTimeout(() => {
48
- w.value = !0, d.hydrateSelected(t.modelValue || []);
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 = s(() => {
54
- const e = [...x.value], a = new Set(e.map((n) => n.value ?? n.label));
55
- return d.selectedBuffer.value.forEach((n, u) => {
56
- a.has(u) || (e.unshift(n), a.add(u));
57
- }), e;
58
- }), d = J({
59
- fetchSelected: t.fetchSelected,
60
- getValues: () => t.modelValue || [],
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
- () => t.modelValue,
66
- (e) => {
67
- w.value && d.hydrateSelected(e || []);
66
+ () => e.modelValue,
67
+ (a) => {
68
+ w.value && s.hydrateSelected(a || []);
68
69
  },
69
70
  { deep: !0 }
70
71
  );
71
- const b = s(() => V.value.filter((e) => {
72
- const a = e.value ?? e.label;
73
- return t.modelValue.includes(a);
74
- })), E = s(() => b.value.slice(0, t.maxVisible)), O = s(() => b.value.length - t.maxVisible), H = (e) => {
75
- if (t.disabled) return;
76
- const a = e.value ?? e.label;
77
- d.selectedBuffer.value.has(a) || d.selectedBuffer.value.set(a, e);
78
- const n = [...t.modelValue], u = n.indexOf(a);
79
- u === -1 ? n.push(a) : n.splice(u, 1), i("update:modelValue", n), i("change", n);
80
- }, K = (e) => {
81
- if (t.disabled) return;
82
- const a = t.modelValue.filter((n) => n !== e);
83
- i("update:modelValue", a), i("change", a);
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
- t.disabled || (i("update:modelValue", []), i("change", []));
86
- }, F = s(() => {
87
- const e = t.rounded === "none" ? "rounded-none" : `rounded-${t.rounded}`, a = t.variant === "transparent" ? "px-2 py-0" : "px-3 py-1.5", n = t.variant === "transparent" ? "h-full min-h-[40px]" : "min-h-[40px]";
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 ${a} ${n} ${e} border text-sm transition-colors cursor-pointer outline-none`,
90
- t.disabled ? "opacity-50 cursor-not-allowed bg-muted" : t.variant === "floating" || t.variant === "transparent" ? "bg-transparent text-foreground" : "bg-background hover:bg-gray-50/70",
91
- t.variant === "outline" || t.variant === "floating" ? "border-input focus-visible:ring-1 focus-visible:ring-primary" : t.variant === "transparent" ? "border-transparent" : "border-transparent bg-muted",
92
- o.value && t.variant !== "transparent" ? "border-primary/20 ring-1 ring-primary/20" : ""
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 = s(() => t.size === "sm" ? "xs" : "sm");
95
- return (e, a) => (r(), m(h(q), {
95
+ }), z = d(() => e.size === "sm" ? "xs" : "sm");
96
+ return (a, n) => (r(), f(h(q), {
96
97
  isOpen: o.value,
97
- "onUpdate:isOpen": a[5] || (a[5] = (n) => o.value = n),
98
+ "onUpdate:isOpen": n[5] || (n[5] = (l) => o.value = l),
98
99
  "close-on-select": !1,
99
100
  selectable: !0,
100
- disabled: l.disabled
101
+ disabled: t.disabled || t.readonly
101
102
  }, {
102
- trigger: p(() => [
103
- g("div", {
103
+ trigger: g(() => [
104
+ y("div", {
104
105
  class: c(F.value),
105
- tabindex: l.disabled ? -1 : 0,
106
+ tabindex: t.disabled || t.readonly ? -1 : 0,
106
107
  onKeydown: [
107
- a[0] || (a[0] = I(y((n) => !l.disabled && (o.value = !o.value), ["prevent"]), ["enter"])),
108
- a[1] || (a[1] = I(y((n) => !l.disabled && (o.value = !o.value), ["prevent"]), ["space"]))
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": e.$attrs["data-testid"] || (e.$attrs.name ? `multiselect-${e.$attrs.name}` : "multiselect")
111
+ "data-testid": a.$attrs["data-testid"] || (a.$attrs.name ? `multiselect-${a.$attrs.name}` : "multiselect")
111
112
  }, [
112
- g("div", {
113
- class: c(["flex gap-1.5 items-center flex-1 min-w-0", [l.wrap ? "flex-wrap py-0.5" : "flex-nowrap overflow-hidden py-1"]])
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, S(D.value), 1)) : (r(), v(T, { key: 1 }, [
116
- (r(!0), v(T, null, R(E.value, (n) => (r(), m(N, {
117
- key: n.value,
118
- variant: l.variant === "transparent" ? "outline" : "secondary",
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: l.rounded === "none" ? "sm" : "full",
121
+ rounded: t.rounded === "none" ? "sm" : "full",
121
122
  class: c(["gap-1 pr-1 truncate min-w-0 shrink", [
122
- l.wrap ? "max-w-[150px]" : "",
123
- l.variant === "transparent" ? "border-transparent bg-muted/50 text-foreground font-medium shadow-none" : ""
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: p(() => [
127
- g("span", X, S(n.labelI18n ? h(C)(n.labelI18n) : n.label), 1),
128
- l.disabled ? f("", !0) : (r(), v("button", {
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: y((u) => K(n.value), ["stop"]),
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
- l.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
+ 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(), m(N, {
146
+ O.value > 0 ? (r(), f(N, {
146
147
  key: 0,
147
- variant: l.variant === "transparent" ? "outline" : "secondary",
148
+ variant: t.variant === "transparent" ? "outline" : "secondary",
148
149
  size: z.value,
149
- rounded: l.rounded === "none" ? "sm" : "full",
150
+ rounded: t.rounded === "none" ? "sm" : "full",
150
151
  class: c([
151
152
  "shrink-0",
152
- l.variant === "transparent" ? "border-transparent bg-muted/50 text-muted-foreground font-medium shadow-none" : ""
153
+ t.variant === "transparent" ? "border-transparent bg-muted/50 text-muted-foreground font-medium shadow-none" : ""
153
154
  ])
154
155
  }, {
155
- default: p(() => [
156
- U(" +" + S(O.value), 1)
156
+ default: g(() => [
157
+ U(" +" + $(O.value), 1)
157
158
  ]),
158
159
  _: 1
159
- }, 8, ["variant", "size", "rounded", "class"])) : f("", !0)
160
+ }, 8, ["variant", "size", "rounded", "class"])) : m("", !0)
160
161
  ], 64))
161
162
  ], 2),
162
- l.showControls ? (r(), v("div", Z, [
163
- b.value.length > 0 && !l.disabled ? (r(), m($, {
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: y(A, ["stop"])
168
- })) : f("", !0),
169
- a[6] || (a[6] = g("div", { class: "w-px h-4 bg-border mx-0.5" }, null, -1)),
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
- ])) : f("", !0)
175
+ ])) : m("", !0)
175
176
  ], 42, Q)
176
177
  ]),
177
- default: p(() => [
178
- l.disabled ? f("", !0) : (r(), m(h(G), {
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: l.modelValue,
183
+ selected: t.modelValue,
183
184
  class: "min-w-[300px]",
184
- loading: l.loading || h(d).isHydrating.value,
185
- hasMore: l.hasMore,
186
- searchable: l.searchable,
187
- remote: l.remote,
188
- debounceTime: l.debounceTime,
189
- layout: l.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: a[2] || (a[2] = (n) => o.value = !1),
192
- onLoadMore: a[3] || (a[3] = (n) => e.$emit("load-more")),
193
- onSearch: a[4] || (a[4] = (n) => e.$emit("search", n))
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-dc6c26b4"]]);
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 q, computed as u, onBeforeUnmount as L, openBlock as v, createElementBlock as y, normalizeClass as i, withModifiers as r, createVNode as h, createCommentVNode as P, createElementVNode as g, withKeys as z } from "vue";
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 M = ["disabled", "data-testid"], U = ["value", "min", "max", "step", "placeholder", "disabled", "readonly", "onKeydown", "data-testid"], A = ["disabled", "data-testid"], D = {
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
- }, G = { class: "flex flex-col h-full w-6 scale-80" }, H = ["disabled", "data-testid"], J = ["disabled", "data-testid"], W = /* @__PURE__ */ E({
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
- q(
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
- }), j = u(() => ({
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"), I = u(() => ({
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
- j.value
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
- }, f = (d, t) => {
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 L(() => {
126
+ return q(() => {
127
127
  l();
128
- }), (d, t) => (v(), y("div", {
128
+ }), (d, t) => (f(), y("div", {
129
129
  class: i([F.value, "overflow-hidden"])
130
130
  }, [
131
- e.variant === "split" && !e.disabled && !e.readonly ? (v(), y("button", {
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" ? I.value : ""
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) => f("dec", 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
- h(w, {
149
+ g(w, {
150
150
  icon: "lucide:minus",
151
151
  class: i(c.value.icon)
152
152
  }, null, 8, ["class"])
153
- ], 42, M)) : P("", !0),
154
- g("input", {
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, U),
175
- e.variant === "split" && !e.disabled && !e.readonly ? (v(), y("button", {
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[3] || (t[3] = (o) => f("inc", o)),
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[4] || (t[4] = r(() => {
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
- h(w, {
194
+ g(w, {
194
195
  icon: "lucide:plus",
195
196
  class: i(c.value.icon)
196
197
  }, null, 8, ["class"])
197
- ], 42, A)) : P("", !0),
198
- e.variant === "stacked" && !e.disabled && !e.readonly ? (v(), y("div", D, [
199
- g("div", G, [
200
- g("button", {
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[5] || (t[5] = (o) => f("inc", o)),
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[6] || (t[6] = r(() => {
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
- h(w, {
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, H),
218
- g("button", {
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[7] || (t[7] = (o) => f("dec", o)),
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[8] || (t[8] = r(() => {
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
- h(w, {
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, J)
236
+ ], 40, G)
236
237
  ])
237
238
  ])) : P("", !0)
238
239
  ], 2));
239
240
  }
240
241
  });
241
242
  export {
242
- W as default
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
+ };
@@ -0,0 +1,2 @@
1
+ export { default as RichTextEditor } from './RichTextEditor.vue';
2
+ export { default as RichTextReader } from './RichTextReader.vue';