vlite3 1.5.15 → 1.5.17

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 (31) hide show
  1. package/components/CategoryManager/CategoryManager2.vue.js +2 -2
  2. package/components/Clock/Clock.vue.d.ts +1 -1
  3. package/components/CommandPalette/CommandPaletteContent2.vue.js +1 -1
  4. package/components/CommandPalette/{CommandPaletteItem2.vue.js → CommandPaletteItem.vue.js} +1 -1
  5. package/components/EditableTitle/EditableTitle.vue.d.ts +213 -0
  6. package/components/EditableTitle/EditableTitle.vue.js +7 -0
  7. package/components/EditableTitle/EditableTitle2.vue.js +372 -0
  8. package/components/EditableTitle/index.d.ts +2 -0
  9. package/components/Input.vue.d.ts +11 -15
  10. package/components/Input.vue.js +160 -125
  11. package/components/NavbarCommandPalette.vue.js +1 -1
  12. package/components/RichTextEditor/RichTextEditor.vue.js +4 -4
  13. package/components/RichTextEditor/RichTextLinkPopover3.vue.js +2 -2
  14. package/components/RichTextEditor/RichTextToolbar3.vue.js +2 -2
  15. package/components/Screen/ScreenFilter.vue.js +2 -2
  16. package/components/TagInput/TagInput.vue.d.ts +15 -12
  17. package/components/Textarea.vue.d.ts +9 -2
  18. package/components/Textarea.vue.js +40 -25
  19. package/components/index.d.ts +1 -0
  20. package/docs/component-index.md +4 -2
  21. package/docs/components/editable-title.md +174 -0
  22. package/docs/components/input.md +11 -0
  23. package/docs-manifest.json +7 -4
  24. package/index.d.ts +1 -0
  25. package/index.js +131 -129
  26. package/package.json +1 -1
  27. package/style.css +1 -1
  28. package/types/editable-title.type.d.ts +61 -0
  29. package/types/index.d.ts +1 -0
  30. /package/components/RichTextEditor/{RichTextLinkPopover2.vue.js → RichTextLinkPopover.vue.js} +0 -0
  31. /package/components/RichTextEditor/{RichTextToolbar2.vue.js → RichTextToolbar.vue.js} +0 -0
@@ -25,8 +25,8 @@ import qe from "../IconPicker.vue.js";
25
25
  /* empty css */
26
26
  /* empty css */
27
27
  /* empty css */
28
- /* empty css */
29
- /* empty css */
28
+ /* empty css */
29
+ /* empty css */
30
30
  import "../../core/config.js";
31
31
  /* empty css */
32
32
  /* empty css */
@@ -21,8 +21,8 @@ type __VLS_Props = {
21
21
  wrapperClass?: string;
22
22
  };
23
23
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
24
- wrapperClass: string;
25
24
  timeFormat: string;
25
+ wrapperClass: string;
26
26
  dateFormat: string;
27
27
  showTime: boolean;
28
28
  showDate: boolean;
@@ -4,7 +4,7 @@ import _ from "../Icon.vue.js";
4
4
  import { $t as E } from "../../utils/i18n.js";
5
5
  import { useCommandPaletteItems as Y } from "./useCommandPaletteItems.js";
6
6
  import { useCommandPaletteNav as Z } from "./useCommandPaletteNav.js";
7
- import ee from "./CommandPaletteItem2.vue.js";
7
+ import ee from "./CommandPaletteItem.vue.js";
8
8
  const te = { class: "command-palette-content flex flex-col w-full h-full max-h-[70vh]" }, oe = { class: "flex items-center gap-3 px-4 py-3 border-b border-border/80 shrink-0" }, se = ["placeholder"], ne = ["aria-label"], re = {
9
9
  key: 0,
10
10
  class: "flex flex-col items-center justify-center py-14 px-6 text-center select-none",
@@ -1,5 +1,5 @@
1
1
  import t from "./CommandPaletteItem3.vue.js";
2
- /* empty css */
2
+ /* empty css */
3
3
  import o from "../../_virtual/_plugin-vue_export-helper.js";
4
4
  const r = /* @__PURE__ */ o(t, [["__scopeId", "data-v-66b1ae06"]]);
5
5
  export {
@@ -0,0 +1,213 @@
1
+ import { nextTick } from 'vue';
2
+ import { EditableTitleProps, EditableTitleSize, EditableTitleVariant } from '../../types';
3
+ declare const _default: import('vue').DefineComponent<EditableTitleProps, {
4
+ startEdit: () => void;
5
+ save: () => void;
6
+ commit: () => void;
7
+ cancel: () => void;
8
+ focus: () => void;
9
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
10
+ delete: () => any;
11
+ blur: (event: FocusEvent) => any;
12
+ focus: (event: FocusEvent) => any;
13
+ cancel: () => any;
14
+ change: (value: string) => any;
15
+ "update:modelValue": (value: string) => any;
16
+ create: (value: string) => any;
17
+ "update:icon": (value: string) => any;
18
+ "edit-start": () => any;
19
+ save: (value: string) => any;
20
+ }, string, import('vue').PublicProps, Readonly<EditableTitleProps> & Readonly<{
21
+ onDelete?: () => any;
22
+ onBlur?: (event: FocusEvent) => any;
23
+ onFocus?: (event: FocusEvent) => any;
24
+ onCancel?: () => any;
25
+ onChange?: (value: string) => any;
26
+ "onUpdate:modelValue"?: (value: string) => any;
27
+ onCreate?: (value: string) => any;
28
+ "onUpdate:icon"?: (value: string) => any;
29
+ "onEdit-start"?: () => any;
30
+ onSave?: (value: string) => any;
31
+ }>, {
32
+ icon: string;
33
+ class: any;
34
+ variant: EditableTitleVariant;
35
+ size: EditableTitleSize;
36
+ readonly: boolean;
37
+ placeholder: string;
38
+ disabled: boolean;
39
+ modelValue: string;
40
+ editable: boolean;
41
+ create: boolean;
42
+ canDelete: boolean;
43
+ showIcon: boolean;
44
+ canChangeIcon: boolean;
45
+ iconPickerPosition: string;
46
+ deleteIcon: string;
47
+ deleteLabel: string;
48
+ editIcon: string;
49
+ saveOnBlur: boolean;
50
+ editLabel: string;
51
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
52
+ iconTriggerRef: HTMLButtonElement;
53
+ inputHostRef: {
54
+ $: import('vue').ComponentInternalInstance;
55
+ $data: {};
56
+ $props: Partial<{
57
+ type: import('../../types').InputType;
58
+ class: string;
59
+ variant: import('../../types').InputVariant;
60
+ size: import('../../types').InputSize;
61
+ rounded: import('../../types').InputRounded;
62
+ loading: boolean;
63
+ readonly: boolean;
64
+ disabled: boolean;
65
+ modelValue: string | number;
66
+ rows: number;
67
+ showClearButton: boolean;
68
+ autofocus: boolean;
69
+ inputClass: string;
70
+ lazy: boolean;
71
+ labelPosition: import('../../types').LabelPosition;
72
+ addonLeftClass: string;
73
+ addonRightClass: string;
74
+ }> & Omit<{
75
+ readonly modelValue?: string | number;
76
+ readonly type?: import('../../types').InputType;
77
+ readonly label?: string;
78
+ readonly labelI18n?: string;
79
+ readonly placeholder?: string;
80
+ readonly placeholderI18n?: string;
81
+ readonly disabled?: boolean;
82
+ readonly readonly?: boolean;
83
+ readonly loading?: boolean;
84
+ readonly error?: string;
85
+ readonly icon?: string;
86
+ readonly iconClass?: string;
87
+ readonly iconRight?: string;
88
+ readonly iconRightClass?: string;
89
+ readonly showClearButton?: boolean;
90
+ readonly autofocus?: boolean;
91
+ readonly class?: string;
92
+ readonly inputClass?: string;
93
+ readonly rows?: number;
94
+ readonly lazy?: boolean;
95
+ readonly variant?: import('../../types').InputVariant;
96
+ readonly size?: import('../../types').InputSize;
97
+ readonly rounded?: import('../../types').InputRounded;
98
+ readonly labelPosition?: import('../../types').LabelPosition;
99
+ readonly addonLeft?: string | Record<string, any>;
100
+ readonly addonRight?: string | Record<string, any>;
101
+ readonly addonLeftClass?: string;
102
+ readonly addonRightClass?: string;
103
+ readonly min?: number;
104
+ readonly max?: number;
105
+ readonly onBlur?: (event: FocusEvent) => any;
106
+ readonly onFocus?: (event: FocusEvent) => any;
107
+ readonly onChange?: (value: string | number) => any;
108
+ readonly "onUpdate:modelValue"?: (value: string | number) => any;
109
+ readonly "onClick:icon"?: (event: MouseEvent) => any;
110
+ readonly "onClick:icon-right"?: (event: MouseEvent) => any;
111
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, "type" | "class" | "variant" | "size" | "rounded" | "loading" | "readonly" | "disabled" | "modelValue" | "rows" | "showClearButton" | "autofocus" | "inputClass" | "lazy" | "labelPosition" | "addonLeftClass" | "addonRightClass">;
112
+ $attrs: import('vue').Attrs;
113
+ $refs: any;
114
+ $slots: Readonly<{
115
+ [name: string]: import('vue').Slot<any>;
116
+ }>;
117
+ $root: import('vue').ComponentPublicInstance | null;
118
+ $parent: import('vue').ComponentPublicInstance | null;
119
+ $host: Element | null;
120
+ $emit: ((event: "blur", event: FocusEvent) => void) & ((event: "focus", event: FocusEvent) => void) & ((event: "change", value: string | number) => void) & ((event: "update:modelValue", value: string | number) => void) & ((event: "click:icon", event: MouseEvent) => void) & ((event: "click:icon-right", event: MouseEvent) => void);
121
+ $el: any;
122
+ $options: import('vue').ComponentOptionsBase<Readonly<import('../../types').InputProps> & Readonly<{
123
+ onBlur?: (event: FocusEvent) => any;
124
+ onFocus?: (event: FocusEvent) => any;
125
+ onChange?: (value: string | number) => any;
126
+ "onUpdate:modelValue"?: (value: string | number) => any;
127
+ "onClick:icon"?: (event: MouseEvent) => any;
128
+ "onClick:icon-right"?: (event: MouseEvent) => any;
129
+ }>, {
130
+ focus: (options?: FocusOptions) => void;
131
+ select: () => void;
132
+ blur: () => void;
133
+ el: HTMLInputElement | HTMLTextAreaElement;
134
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
135
+ blur: (event: FocusEvent) => any;
136
+ focus: (event: FocusEvent) => any;
137
+ change: (value: string | number) => any;
138
+ "update:modelValue": (value: string | number) => any;
139
+ "click:icon": (event: MouseEvent) => any;
140
+ "click:icon-right": (event: MouseEvent) => any;
141
+ }, string, {
142
+ type: import('../../types').InputType;
143
+ class: string;
144
+ variant: import('../../types').InputVariant;
145
+ size: import('../../types').InputSize;
146
+ rounded: import('../../types').InputRounded;
147
+ loading: boolean;
148
+ readonly: boolean;
149
+ disabled: boolean;
150
+ modelValue: string | number;
151
+ rows: number;
152
+ showClearButton: boolean;
153
+ autofocus: boolean;
154
+ inputClass: string;
155
+ lazy: boolean;
156
+ labelPosition: import('../../types').LabelPosition;
157
+ addonLeftClass: string;
158
+ addonRightClass: string;
159
+ }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
160
+ beforeCreate?: (() => void) | (() => void)[];
161
+ created?: (() => void) | (() => void)[];
162
+ beforeMount?: (() => void) | (() => void)[];
163
+ mounted?: (() => void) | (() => void)[];
164
+ beforeUpdate?: (() => void) | (() => void)[];
165
+ updated?: (() => void) | (() => void)[];
166
+ activated?: (() => void) | (() => void)[];
167
+ deactivated?: (() => void) | (() => void)[];
168
+ beforeDestroy?: (() => void) | (() => void)[];
169
+ beforeUnmount?: (() => void) | (() => void)[];
170
+ destroyed?: (() => void) | (() => void)[];
171
+ unmounted?: (() => void) | (() => void)[];
172
+ renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
173
+ renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
174
+ errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
175
+ };
176
+ $forceUpdate: () => void;
177
+ $nextTick: typeof nextTick;
178
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
179
+ } & Readonly<{
180
+ type: import('../../types').InputType;
181
+ class: string;
182
+ variant: import('../../types').InputVariant;
183
+ size: import('../../types').InputSize;
184
+ rounded: import('../../types').InputRounded;
185
+ loading: boolean;
186
+ readonly: boolean;
187
+ disabled: boolean;
188
+ modelValue: string | number;
189
+ rows: number;
190
+ showClearButton: boolean;
191
+ autofocus: boolean;
192
+ inputClass: string;
193
+ lazy: boolean;
194
+ labelPosition: import('../../types').LabelPosition;
195
+ addonLeftClass: string;
196
+ addonRightClass: string;
197
+ }> & Omit<Readonly<import('../../types').InputProps> & Readonly<{
198
+ onBlur?: (event: FocusEvent) => any;
199
+ onFocus?: (event: FocusEvent) => any;
200
+ onChange?: (value: string | number) => any;
201
+ "onUpdate:modelValue"?: (value: string | number) => any;
202
+ "onClick:icon"?: (event: MouseEvent) => any;
203
+ "onClick:icon-right"?: (event: MouseEvent) => any;
204
+ }>, "select" | "el" | "blur" | "focus" | ("type" | "class" | "variant" | "size" | "rounded" | "loading" | "readonly" | "disabled" | "modelValue" | "rows" | "showClearButton" | "autofocus" | "inputClass" | "lazy" | "labelPosition" | "addonLeftClass" | "addonRightClass")> & {
205
+ focus: (options?: FocusOptions) => void;
206
+ select: () => void;
207
+ blur: () => void;
208
+ el: HTMLInputElement | HTMLTextAreaElement;
209
+ } & {} & import('vue').ComponentCustomProperties & {} & {
210
+ $slots: any;
211
+ };
212
+ }, HTMLDivElement>;
213
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import t from "./EditableTitle2.vue.js";
2
+ /* empty css */
3
+ import o from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const f = /* @__PURE__ */ o(t, [["__scopeId", "data-v-da02cbfe"]]);
5
+ export {
6
+ f as default
7
+ };
@@ -0,0 +1,372 @@
1
+ import { defineComponent as he, shallowRef as k, computed as i, watch as P, onMounted as ge, onBeforeUnmount as ye, openBlock as s, createElementBlock as f, normalizeStyle as xe, normalizeClass as m, withModifiers as K, createBlock as Y, withCtx as ke, createElementVNode as j, createVNode as w, createCommentVNode as C, toDisplayString as we, nextTick as v } from "vue";
2
+ import A from "../Icon.vue.js";
3
+ import Z from "../Button.vue.js";
4
+ import Ce from "../Input.vue.js";
5
+ /* empty css */
6
+ import Ie from "../IconPicker.vue.js";
7
+ const Be = ["data-editing", "data-create", "data-variant", "data-size"], Te = ["disabled"], Se = ["disabled"], Ve = {
8
+ key: 2,
9
+ class: "inline-flex items-center justify-center",
10
+ "aria-hidden": "true"
11
+ }, ze = ["aria-hidden"], Ee = {
12
+ key: 0,
13
+ class: "vl-editable-title__input col-start-1 row-start-1 min-w-0 self-center"
14
+ }, _e = {
15
+ key: 1,
16
+ class: "vl-editable-title__actions flex shrink-0 items-center gap-0.5"
17
+ }, De = {
18
+ key: 0,
19
+ class: "vl-editable-title__action flex items-center justify-center"
20
+ }, Pe = {
21
+ key: 1,
22
+ class: "vl-editable-title__action flex items-center justify-center"
23
+ }, G = "lucide:file-text", Me = /* @__PURE__ */ he({
24
+ __name: "EditableTitle",
25
+ props: {
26
+ modelValue: { default: "" },
27
+ icon: { default: G },
28
+ showIcon: { type: Boolean, default: !0 },
29
+ canChangeIcon: { type: Boolean, default: !0 },
30
+ iconPickerPosition: { default: "bottom-start" },
31
+ editable: { type: Boolean, default: !0 },
32
+ create: { type: Boolean, default: !1 },
33
+ canDelete: { type: Boolean, default: !1 },
34
+ deleteIcon: { default: "lucide:trash-2" },
35
+ deleteLabel: { default: "Delete" },
36
+ disabled: { type: Boolean, default: !1 },
37
+ readonly: { type: Boolean, default: !1 },
38
+ variant: { default: "background" },
39
+ size: { default: "md" },
40
+ maxWidth: {},
41
+ placeholder: { default: "" },
42
+ editIcon: { default: "lucide:square-pen" },
43
+ saveOnBlur: { type: Boolean, default: !0 },
44
+ editLabel: { default: "Edit title" },
45
+ class: { default: "" }
46
+ },
47
+ emits: ["update:modelValue", "update:icon", "edit-start", "change", "save", "create", "cancel", "delete", "focus", "blur"],
48
+ setup(n, { expose: J, emit: Q }) {
49
+ const X = {
50
+ sm: {
51
+ root: "gap-2 px-2.5 py-1.5 rounded-xl",
52
+ icon: "h-3.5 w-3.5",
53
+ iconHit: "h-6 w-6",
54
+ title: "text-sm font-medium leading-5 tracking-normal",
55
+ button: "xs",
56
+ spacer: "h-6.5 w-6.5 min-h-6.5 min-w-6.5"
57
+ },
58
+ md: {
59
+ root: "gap-2.5 px-3.5 py-2.5 rounded-2xl",
60
+ icon: "h-4 w-4",
61
+ iconHit: "h-7 w-7",
62
+ title: "text-base font-medium leading-6 tracking-normal",
63
+ button: "xs",
64
+ spacer: "h-6.5 w-6.5 min-h-6.5 min-w-6.5"
65
+ },
66
+ lg: {
67
+ root: "gap-3 px-4 py-3 rounded-2xl",
68
+ icon: "h-5 w-5",
69
+ iconHit: "h-8 w-8",
70
+ title: "text-lg font-medium leading-7 tracking-normal",
71
+ button: "sm",
72
+ spacer: "h-7.5 w-7.5 min-h-7.5 min-w-7.5"
73
+ }
74
+ }, ee = {
75
+ background: "bg-muted text-foreground transition-colors hover:bg-muted/80 focus-within:bg-muted/80",
76
+ transparent: "bg-transparent text-foreground"
77
+ }, e = n, o = Q, l = k(!1), r = k(e.modelValue ?? ""), L = k(null), g = k(!1), R = k(null);
78
+ let I = !1, u = !1, y = null, x = null;
79
+ const B = i(
80
+ () => e.editable && !e.disabled && !e.readonly && !e.create
81
+ ), b = i(
82
+ () => e.showIcon && e.canChangeIcon && !e.disabled && !e.readonly
83
+ ), W = i(
84
+ () => e.canDelete && !e.disabled && !e.readonly && !e.create
85
+ ), H = i(() => B.value || l.value && !e.create), M = i(() => W.value), te = i(() => H.value || M.value), T = i(() => e.icon || G), c = i(() => X[e.size]), le = i(() => e.maxWidth === void 0 || e.maxWidth === null || e.maxWidth === "" ? void 0 : { maxWidth: typeof e.maxWidth == "number" ? `${e.maxWidth}px` : e.maxWidth }), ae = i(
86
+ () => [
87
+ "vl-editable-title group/editable-title relative flex w-full min-w-0 items-center",
88
+ c.value.root,
89
+ ee[e.variant],
90
+ e.disabled ? "opacity-50 cursor-not-allowed" : "",
91
+ l.value ? "vl-editable-title--editing" : "",
92
+ e.create ? "vl-editable-title--create" : "",
93
+ e.class
94
+ ].filter(Boolean).join(" ")
95
+ ), F = i(
96
+ () => `${c.value.title} text-foreground text-start`
97
+ ), ne = i(
98
+ () => [
99
+ F.value,
100
+ "h-auto! min-h-0! max-h-none! py-0! px-0! border-none! bg-transparent! shadow-none!",
101
+ "ring-0! focus-visible:ring-0! focus-visible:border-transparent!",
102
+ "rounded-none!"
103
+ ].join(" ")
104
+ ), N = i(() => e.modelValue ?? ""), ie = i(() => l.value ? r.value || e.placeholder || " " : N.value || e.placeholder || " "), oe = i(() => l.value ? !r.value && !!e.placeholder : !N.value && !!e.placeholder);
105
+ function p() {
106
+ y != null && (clearTimeout(y), y = null);
107
+ }
108
+ function z() {
109
+ x != null && (clearTimeout(x), x = null);
110
+ }
111
+ function E() {
112
+ I = !0, p(), z();
113
+ }
114
+ function O() {
115
+ z(), x = setTimeout(() => {
116
+ x = null, I = !1;
117
+ }, 0);
118
+ }
119
+ function S() {
120
+ !b.value || g.value || (g.value = !0);
121
+ }
122
+ function _(t = !0) {
123
+ const a = () => {
124
+ const d = L.value;
125
+ return d ? (d.focus(), t && d.select(), !0) : !1;
126
+ };
127
+ v(() => {
128
+ a() || requestAnimationFrame(() => {
129
+ v(() => {
130
+ a();
131
+ });
132
+ });
133
+ });
134
+ }
135
+ function $(t) {
136
+ p(), u = !0, r.value = e.modelValue ?? "", l.value = !0, t.emitEditStart && o("edit-start"), _(t.select), v(() => {
137
+ u = !1;
138
+ });
139
+ }
140
+ function U() {
141
+ !e.create || e.disabled || e.readonly || l.value || u || $({ select: !1, emitEditStart: !1 });
142
+ }
143
+ function D() {
144
+ !B.value || l.value || u || $({ select: !0, emitEditStart: !0 });
145
+ }
146
+ function V(t = !1) {
147
+ if (!l.value || u) return;
148
+ p(), u = !0;
149
+ const a = r.value.trim();
150
+ if (e.create) {
151
+ if (!a) {
152
+ t && (l.value = !1, o("cancel")), v(() => {
153
+ u = !1;
154
+ });
155
+ return;
156
+ }
157
+ r.value = a, a !== (e.modelValue ?? "") && o("update:modelValue", a), o("create", a), l.value = !1, v(() => {
158
+ u = !1;
159
+ });
160
+ return;
161
+ }
162
+ const d = (e.modelValue ?? "").trim(), h = a.length > 0 ? a : d;
163
+ r.value = h, h !== (e.modelValue ?? "") && o("update:modelValue", h), o("change", h), o("save", h), l.value = !1, v(() => {
164
+ u = !1;
165
+ });
166
+ }
167
+ function q() {
168
+ !l.value || u || (p(), u = !0, r.value = e.modelValue ?? "", l.value = !1, o("cancel"), v(() => {
169
+ u = !1;
170
+ }));
171
+ }
172
+ function ue() {
173
+ if (l.value) {
174
+ _(!1);
175
+ return;
176
+ }
177
+ if (e.create) {
178
+ U();
179
+ return;
180
+ }
181
+ B.value && D();
182
+ }
183
+ function re(t) {
184
+ t.preventDefault(), t.stopPropagation(), D();
185
+ }
186
+ function se(t) {
187
+ t.preventDefault(), t.stopPropagation(), W.value && (E(), o("delete"), O());
188
+ }
189
+ function ce(t) {
190
+ o("update:icon", t);
191
+ }
192
+ function de() {
193
+ b.value && (E(), S());
194
+ }
195
+ function fe() {
196
+ b.value && (E(), S(), v(() => {
197
+ R.value?.click();
198
+ }));
199
+ }
200
+ function ve() {
201
+ v(() => {
202
+ l.value && _(!1), O();
203
+ });
204
+ }
205
+ function me(t) {
206
+ o("focus", t);
207
+ }
208
+ function be(t) {
209
+ o("blur", t), !(!e.saveOnBlur || I) && (p(), y = setTimeout(() => {
210
+ y = null, !(I || !l.value) && V(!0);
211
+ }, 0));
212
+ }
213
+ function pe(t) {
214
+ l.value && (t.key === "Enter" ? (t.preventDefault(), V(!1)) : t.key === "Escape" && (t.preventDefault(), q()));
215
+ }
216
+ return P(
217
+ () => e.modelValue,
218
+ (t) => {
219
+ l.value || (r.value = t ?? "");
220
+ }
221
+ ), P(
222
+ () => [e.disabled, e.readonly, e.editable],
223
+ ([t, a, d]) => {
224
+ !l.value || !(t || a || !e.create && !d) || (p(), r.value = e.modelValue ?? "", l.value = !1, o("cancel"));
225
+ }
226
+ ), P(b, (t) => {
227
+ t || (g.value = !1);
228
+ }), ge(() => {
229
+ e.create && (b.value && (g.value = !0), U());
230
+ }), ye(() => {
231
+ p(), z();
232
+ }), J({
233
+ startEdit: D,
234
+ save: () => V(!1),
235
+ commit: () => V(!1),
236
+ cancel: q,
237
+ focus: ue
238
+ }), (t, a) => (s(), f("div", {
239
+ class: m(ae.value),
240
+ style: xe(le.value),
241
+ "data-editing": l.value ? "true" : void 0,
242
+ "data-create": n.create ? "true" : void 0,
243
+ "data-variant": n.variant,
244
+ "data-size": n.size
245
+ }, [
246
+ n.showIcon ? (s(), f("div", {
247
+ key: 0,
248
+ class: "vl-editable-title__icon flex shrink-0 items-center justify-center text-foreground",
249
+ onPointerenter: S,
250
+ onFocusin: S,
251
+ onMousedown: de,
252
+ onClick: a[0] || (a[0] = K(() => {
253
+ }, ["stop"]))
254
+ }, [
255
+ b.value && g.value ? (s(), Y(Ie, {
256
+ key: 0,
257
+ value: T.value,
258
+ position: n.iconPickerPosition,
259
+ onOnSelect: ce,
260
+ onOnClose: ve
261
+ }, {
262
+ default: ke(() => [
263
+ j("button", {
264
+ ref_key: "iconTriggerRef",
265
+ ref: R,
266
+ type: "button",
267
+ class: m(["vl-editable-title__icon-trigger inline-flex items-center justify-center rounded-md text-foreground transition-colors hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/30", c.value.iconHit]),
268
+ "aria-label": "Change icon",
269
+ disabled: n.disabled
270
+ }, [
271
+ w(A, {
272
+ icon: T.value,
273
+ class: m(c.value.icon),
274
+ "aria-hidden": "true"
275
+ }, null, 8, ["icon", "class"])
276
+ ], 10, Te)
277
+ ]),
278
+ _: 1
279
+ }, 8, ["value", "position"])) : b.value ? (s(), f("button", {
280
+ key: 1,
281
+ type: "button",
282
+ class: m(["vl-editable-title__icon-trigger inline-flex items-center justify-center rounded-md text-foreground transition-colors hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/30", c.value.iconHit]),
283
+ "aria-label": "Change icon",
284
+ disabled: n.disabled,
285
+ onClick: fe
286
+ }, [
287
+ w(A, {
288
+ icon: T.value,
289
+ class: m(c.value.icon),
290
+ "aria-hidden": "true"
291
+ }, null, 8, ["icon", "class"])
292
+ ], 10, Se)) : (s(), f("span", Ve, [
293
+ w(A, {
294
+ icon: T.value,
295
+ class: m(c.value.icon)
296
+ }, null, 8, ["icon", "class"])
297
+ ]))
298
+ ], 32)) : C("", !0),
299
+ j("div", {
300
+ class: "vl-editable-title__text grid min-w-0 flex-1 contain-inline-size",
301
+ onKeydown: pe
302
+ }, [
303
+ j("span", {
304
+ class: m(["vl-editable-title__label col-start-1 row-start-1 block min-w-0 truncate", [
305
+ F.value,
306
+ oe.value ? "text-muted-foreground" : "",
307
+ l.value ? "invisible" : ""
308
+ ]]),
309
+ "aria-hidden": l.value ? "true" : void 0
310
+ }, we(ie.value), 11, ze),
311
+ l.value ? (s(), f("div", Ee, [
312
+ w(Ce, {
313
+ ref_key: "inputHostRef",
314
+ ref: L,
315
+ modelValue: r.value,
316
+ "onUpdate:modelValue": a[1] || (a[1] = (d) => r.value = d),
317
+ type: "text",
318
+ variant: "transparent",
319
+ size: n.size,
320
+ placeholder: n.placeholder,
321
+ disabled: n.disabled,
322
+ "show-clear-button": !1,
323
+ class: "!space-y-0 min-w-0 w-full",
324
+ "input-class": ne.value,
325
+ onFocus: me,
326
+ onBlur: be,
327
+ onClick: a[2] || (a[2] = K(() => {
328
+ }, ["stop"]))
329
+ }, null, 8, ["modelValue", "size", "placeholder", "disabled", "input-class"])
330
+ ])) : C("", !0)
331
+ ], 32),
332
+ te.value ? (s(), f("div", _e, [
333
+ H.value ? (s(), f("div", De, [
334
+ !l.value && B.value ? (s(), Y(Z, {
335
+ key: 0,
336
+ type: "button",
337
+ "as-icon": "",
338
+ variant: "ghost",
339
+ size: c.value.button,
340
+ rounded: "md",
341
+ icon: n.editIcon,
342
+ "aria-label": n.editLabel,
343
+ disabled: n.disabled,
344
+ class: "vl-editable-title__action-btn text-foreground",
345
+ onClick: re
346
+ }, null, 8, ["size", "icon", "aria-label", "disabled"])) : (s(), f("div", {
347
+ key: 1,
348
+ class: m(["invisible pointer-events-none shrink-0", c.value.spacer]),
349
+ "aria-hidden": "true"
350
+ }, null, 2))
351
+ ])) : C("", !0),
352
+ M.value ? (s(), f("div", Pe, [
353
+ w(Z, {
354
+ type: "button",
355
+ "as-icon": "",
356
+ variant: "ghost",
357
+ size: c.value.button,
358
+ rounded: "md",
359
+ icon: n.deleteIcon,
360
+ "aria-label": n.deleteLabel,
361
+ disabled: n.disabled,
362
+ class: "vl-editable-title__action-btn text-foreground",
363
+ onClick: se
364
+ }, null, 8, ["size", "icon", "aria-label", "disabled"])
365
+ ])) : C("", !0)
366
+ ])) : C("", !0)
367
+ ], 14, Be));
368
+ }
369
+ });
370
+ export {
371
+ Me as default
372
+ };
@@ -0,0 +1,2 @@
1
+ export { default as EditableTitle } from './EditableTitle.vue';
2
+ export type { EditableTitleExpose, EditableTitleProps, EditableTitleSize, EditableTitleVariant, } from '../../types';
@@ -1,17 +1,15 @@
1
1
  import { InputProps, InputRounded, InputSize, InputVariant } from '../types';
2
- declare function __VLS_template(): {
3
- attrs: Partial<{}>;
4
- slots: {
5
- 'addon-left'?(_: {}): any;
6
- 'addon-right'?(_: {}): any;
7
- };
8
- refs: {
9
- inputRef: HTMLInputElement;
10
- };
11
- rootEl: HTMLDivElement;
12
- };
2
+ declare function __VLS_template(): any;
13
3
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
14
- declare const __VLS_component: import('vue').DefineComponent<InputProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
4
+ declare const __VLS_component: import('vue').DefineComponent<InputProps, {
5
+ /** Focus the underlying native input or textarea. */
6
+ focus: (options?: FocusOptions) => void;
7
+ /** Select the contents of the underlying native input or textarea. */
8
+ select: () => void;
9
+ /** Blur the underlying native input or textarea. */
10
+ blur: () => void;
11
+ el: HTMLInputElement | HTMLTextAreaElement;
12
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
15
13
  blur: (event: FocusEvent) => any;
16
14
  focus: (event: FocusEvent) => any;
17
15
  change: (value: string | number) => any;
@@ -43,9 +41,7 @@ declare const __VLS_component: import('vue').DefineComponent<InputProps, {}, {},
43
41
  labelPosition: import('../types').LabelPosition;
44
42
  addonLeftClass: string;
45
43
  addonRightClass: string;
46
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
47
- inputRef: HTMLInputElement;
48
- }, HTMLDivElement>;
44
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, any, any>;
49
45
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
50
46
  export default _default;
51
47
  type __VLS_WithTemplateSlots<T, S> = T & {