vlite3 1.5.14 → 1.5.16
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/components/CategoryManager/CategoryManager2.vue.js +2 -2
- package/components/Clock/Clock.vue.d.ts +1 -1
- package/components/CommandPalette/CommandPaletteContent2.vue.js +1 -1
- package/components/CommandPalette/{CommandPaletteItem.vue.js → CommandPaletteItem2.vue.js} +1 -1
- package/components/EditableTitle/EditableTitle.vue.d.ts +200 -0
- package/components/EditableTitle/EditableTitle.vue.js +7 -0
- package/components/EditableTitle/EditableTitle2.vue.js +225 -0
- package/components/EditableTitle/index.d.ts +2 -0
- package/components/Input.vue.d.ts +11 -15
- package/components/Input.vue.js +160 -125
- package/components/NavbarCommandPalette.vue.js +1 -1
- package/components/RichTextEditor/RichTextEditor.vue.js +4 -4
- package/components/RichTextEditor/RichTextLinkPopover3.vue.js +2 -2
- package/components/RichTextEditor/RichTextToolbar3.vue.js +2 -2
- package/components/Screen/ScreenFilter.vue.js +2 -2
- package/components/TagInput/TagInput.vue.d.ts +15 -12
- package/components/Textarea.vue.d.ts +9 -2
- package/components/Textarea.vue.js +40 -25
- package/components/index.d.ts +1 -0
- package/docs/component-index.md +25 -26
- package/docs/components/editable-title.md +125 -0
- package/docs/components/input.md +11 -0
- package/docs-manifest.json +7 -4
- package/index.d.ts +1 -0
- package/index.js +131 -129
- package/package.json +1 -1
- package/style.css +1 -1
- package/types/editable-title.type.d.ts +43 -0
- package/types/index.d.ts +1 -0
- /package/components/RichTextEditor/{RichTextLinkPopover2.vue.js → RichTextLinkPopover.vue.js} +0 -0
- /package/components/RichTextEditor/{RichTextToolbar2.vue.js → RichTextToolbar.vue.js} +0 -0
|
@@ -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 "./
|
|
7
|
+
import ee from "./CommandPaletteItem2.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",
|
|
@@ -0,0 +1,200 @@
|
|
|
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
|
+
blur: (event: FocusEvent) => any;
|
|
11
|
+
focus: (event: FocusEvent) => any;
|
|
12
|
+
cancel: () => any;
|
|
13
|
+
change: (value: string) => any;
|
|
14
|
+
"update:modelValue": (value: string) => any;
|
|
15
|
+
"edit-start": () => any;
|
|
16
|
+
save: (value: string) => any;
|
|
17
|
+
}, string, import('vue').PublicProps, Readonly<EditableTitleProps> & Readonly<{
|
|
18
|
+
onBlur?: (event: FocusEvent) => any;
|
|
19
|
+
onFocus?: (event: FocusEvent) => any;
|
|
20
|
+
onCancel?: () => any;
|
|
21
|
+
onChange?: (value: string) => any;
|
|
22
|
+
"onUpdate:modelValue"?: (value: string) => any;
|
|
23
|
+
"onEdit-start"?: () => any;
|
|
24
|
+
onSave?: (value: string) => any;
|
|
25
|
+
}>, {
|
|
26
|
+
icon: string;
|
|
27
|
+
class: any;
|
|
28
|
+
variant: EditableTitleVariant;
|
|
29
|
+
size: EditableTitleSize;
|
|
30
|
+
readonly: boolean;
|
|
31
|
+
placeholder: string;
|
|
32
|
+
disabled: boolean;
|
|
33
|
+
modelValue: string;
|
|
34
|
+
editable: boolean;
|
|
35
|
+
showIcon: boolean;
|
|
36
|
+
editIcon: string;
|
|
37
|
+
saveOnBlur: boolean;
|
|
38
|
+
editLabel: string;
|
|
39
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
40
|
+
inputHostRef: {
|
|
41
|
+
$: import('vue').ComponentInternalInstance;
|
|
42
|
+
$data: {};
|
|
43
|
+
$props: Partial<{
|
|
44
|
+
type: import('../../types').InputType;
|
|
45
|
+
class: string;
|
|
46
|
+
variant: import('../../types').InputVariant;
|
|
47
|
+
size: import('../../types').InputSize;
|
|
48
|
+
rounded: import('../../types').InputRounded;
|
|
49
|
+
loading: boolean;
|
|
50
|
+
readonly: boolean;
|
|
51
|
+
disabled: boolean;
|
|
52
|
+
modelValue: string | number;
|
|
53
|
+
rows: number;
|
|
54
|
+
showClearButton: boolean;
|
|
55
|
+
autofocus: boolean;
|
|
56
|
+
inputClass: string;
|
|
57
|
+
lazy: boolean;
|
|
58
|
+
labelPosition: import('../../types').LabelPosition;
|
|
59
|
+
addonLeftClass: string;
|
|
60
|
+
addonRightClass: string;
|
|
61
|
+
}> & Omit<{
|
|
62
|
+
readonly modelValue?: string | number;
|
|
63
|
+
readonly type?: import('../../types').InputType;
|
|
64
|
+
readonly label?: string;
|
|
65
|
+
readonly labelI18n?: string;
|
|
66
|
+
readonly placeholder?: string;
|
|
67
|
+
readonly placeholderI18n?: string;
|
|
68
|
+
readonly disabled?: boolean;
|
|
69
|
+
readonly readonly?: boolean;
|
|
70
|
+
readonly loading?: boolean;
|
|
71
|
+
readonly error?: string;
|
|
72
|
+
readonly icon?: string;
|
|
73
|
+
readonly iconClass?: string;
|
|
74
|
+
readonly iconRight?: string;
|
|
75
|
+
readonly iconRightClass?: string;
|
|
76
|
+
readonly showClearButton?: boolean;
|
|
77
|
+
readonly autofocus?: boolean;
|
|
78
|
+
readonly class?: string;
|
|
79
|
+
readonly inputClass?: string;
|
|
80
|
+
readonly rows?: number;
|
|
81
|
+
readonly lazy?: boolean;
|
|
82
|
+
readonly variant?: import('../../types').InputVariant;
|
|
83
|
+
readonly size?: import('../../types').InputSize;
|
|
84
|
+
readonly rounded?: import('../../types').InputRounded;
|
|
85
|
+
readonly labelPosition?: import('../../types').LabelPosition;
|
|
86
|
+
readonly addonLeft?: string | Record<string, any>;
|
|
87
|
+
readonly addonRight?: string | Record<string, any>;
|
|
88
|
+
readonly addonLeftClass?: string;
|
|
89
|
+
readonly addonRightClass?: string;
|
|
90
|
+
readonly min?: number;
|
|
91
|
+
readonly max?: number;
|
|
92
|
+
readonly onBlur?: (event: FocusEvent) => any;
|
|
93
|
+
readonly onFocus?: (event: FocusEvent) => any;
|
|
94
|
+
readonly onChange?: (value: string | number) => any;
|
|
95
|
+
readonly "onUpdate:modelValue"?: (value: string | number) => any;
|
|
96
|
+
readonly "onClick:icon"?: (event: MouseEvent) => any;
|
|
97
|
+
readonly "onClick:icon-right"?: (event: MouseEvent) => any;
|
|
98
|
+
} & 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">;
|
|
99
|
+
$attrs: import('vue').Attrs;
|
|
100
|
+
$refs: any;
|
|
101
|
+
$slots: Readonly<{
|
|
102
|
+
[name: string]: import('vue').Slot<any>;
|
|
103
|
+
}>;
|
|
104
|
+
$root: import('vue').ComponentPublicInstance | null;
|
|
105
|
+
$parent: import('vue').ComponentPublicInstance | null;
|
|
106
|
+
$host: Element | null;
|
|
107
|
+
$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);
|
|
108
|
+
$el: any;
|
|
109
|
+
$options: import('vue').ComponentOptionsBase<Readonly<import('../../types').InputProps> & Readonly<{
|
|
110
|
+
onBlur?: (event: FocusEvent) => any;
|
|
111
|
+
onFocus?: (event: FocusEvent) => any;
|
|
112
|
+
onChange?: (value: string | number) => any;
|
|
113
|
+
"onUpdate:modelValue"?: (value: string | number) => any;
|
|
114
|
+
"onClick:icon"?: (event: MouseEvent) => any;
|
|
115
|
+
"onClick:icon-right"?: (event: MouseEvent) => any;
|
|
116
|
+
}>, {
|
|
117
|
+
focus: (options?: FocusOptions) => void;
|
|
118
|
+
select: () => void;
|
|
119
|
+
blur: () => void;
|
|
120
|
+
el: HTMLInputElement | HTMLTextAreaElement;
|
|
121
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
122
|
+
blur: (event: FocusEvent) => any;
|
|
123
|
+
focus: (event: FocusEvent) => any;
|
|
124
|
+
change: (value: string | number) => any;
|
|
125
|
+
"update:modelValue": (value: string | number) => any;
|
|
126
|
+
"click:icon": (event: MouseEvent) => any;
|
|
127
|
+
"click:icon-right": (event: MouseEvent) => any;
|
|
128
|
+
}, string, {
|
|
129
|
+
type: import('../../types').InputType;
|
|
130
|
+
class: string;
|
|
131
|
+
variant: import('../../types').InputVariant;
|
|
132
|
+
size: import('../../types').InputSize;
|
|
133
|
+
rounded: import('../../types').InputRounded;
|
|
134
|
+
loading: boolean;
|
|
135
|
+
readonly: boolean;
|
|
136
|
+
disabled: boolean;
|
|
137
|
+
modelValue: string | number;
|
|
138
|
+
rows: number;
|
|
139
|
+
showClearButton: boolean;
|
|
140
|
+
autofocus: boolean;
|
|
141
|
+
inputClass: string;
|
|
142
|
+
lazy: boolean;
|
|
143
|
+
labelPosition: import('../../types').LabelPosition;
|
|
144
|
+
addonLeftClass: string;
|
|
145
|
+
addonRightClass: string;
|
|
146
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
147
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
148
|
+
created?: (() => void) | (() => void)[];
|
|
149
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
150
|
+
mounted?: (() => void) | (() => void)[];
|
|
151
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
152
|
+
updated?: (() => void) | (() => void)[];
|
|
153
|
+
activated?: (() => void) | (() => void)[];
|
|
154
|
+
deactivated?: (() => void) | (() => void)[];
|
|
155
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
156
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
157
|
+
destroyed?: (() => void) | (() => void)[];
|
|
158
|
+
unmounted?: (() => void) | (() => void)[];
|
|
159
|
+
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
160
|
+
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
161
|
+
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
162
|
+
};
|
|
163
|
+
$forceUpdate: () => void;
|
|
164
|
+
$nextTick: typeof nextTick;
|
|
165
|
+
$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;
|
|
166
|
+
} & Readonly<{
|
|
167
|
+
type: import('../../types').InputType;
|
|
168
|
+
class: string;
|
|
169
|
+
variant: import('../../types').InputVariant;
|
|
170
|
+
size: import('../../types').InputSize;
|
|
171
|
+
rounded: import('../../types').InputRounded;
|
|
172
|
+
loading: boolean;
|
|
173
|
+
readonly: boolean;
|
|
174
|
+
disabled: boolean;
|
|
175
|
+
modelValue: string | number;
|
|
176
|
+
rows: number;
|
|
177
|
+
showClearButton: boolean;
|
|
178
|
+
autofocus: boolean;
|
|
179
|
+
inputClass: string;
|
|
180
|
+
lazy: boolean;
|
|
181
|
+
labelPosition: import('../../types').LabelPosition;
|
|
182
|
+
addonLeftClass: string;
|
|
183
|
+
addonRightClass: string;
|
|
184
|
+
}> & Omit<Readonly<import('../../types').InputProps> & Readonly<{
|
|
185
|
+
onBlur?: (event: FocusEvent) => any;
|
|
186
|
+
onFocus?: (event: FocusEvent) => any;
|
|
187
|
+
onChange?: (value: string | number) => any;
|
|
188
|
+
"onUpdate:modelValue"?: (value: string | number) => any;
|
|
189
|
+
"onClick:icon"?: (event: MouseEvent) => any;
|
|
190
|
+
"onClick:icon-right"?: (event: MouseEvent) => any;
|
|
191
|
+
}>, "select" | "el" | "blur" | "focus" | ("type" | "class" | "variant" | "size" | "rounded" | "loading" | "readonly" | "disabled" | "modelValue" | "rows" | "showClearButton" | "autofocus" | "inputClass" | "lazy" | "labelPosition" | "addonLeftClass" | "addonRightClass")> & {
|
|
192
|
+
focus: (options?: FocusOptions) => void;
|
|
193
|
+
select: () => void;
|
|
194
|
+
blur: () => void;
|
|
195
|
+
el: HTMLInputElement | HTMLTextAreaElement;
|
|
196
|
+
} & {} & import('vue').ComponentCustomProperties & {} & {
|
|
197
|
+
$slots: any;
|
|
198
|
+
};
|
|
199
|
+
}, HTMLDivElement>;
|
|
200
|
+
export default _default;
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { defineComponent as M, ref as g, computed as i, watch as C, onBeforeUnmount as P, openBlock as c, createElementBlock as h, normalizeStyle as G, normalizeClass as y, createVNode as E, createCommentVNode as k, createElementVNode as _, toDisplayString as J, createBlock as I, nextTick as p } from "vue";
|
|
2
|
+
import Q from "../Icon.vue.js";
|
|
3
|
+
import W from "../Button.vue.js";
|
|
4
|
+
import X from "../Input.vue.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
const Y = ["data-editing", "data-variant", "data-size"], Z = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "vl-editable-title__icon flex shrink-0 items-center justify-center text-foreground",
|
|
9
|
+
"aria-hidden": "true"
|
|
10
|
+
}, ee = ["aria-hidden"], te = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "vl-editable-title__input col-start-1 row-start-1 min-w-0 self-center"
|
|
13
|
+
}, le = {
|
|
14
|
+
key: 1,
|
|
15
|
+
class: "vl-editable-title__action flex shrink-0 items-center justify-center"
|
|
16
|
+
}, re = /* @__PURE__ */ M({
|
|
17
|
+
__name: "EditableTitle",
|
|
18
|
+
props: {
|
|
19
|
+
modelValue: { default: "" },
|
|
20
|
+
icon: { default: "lucide:file-text" },
|
|
21
|
+
showIcon: { type: Boolean, default: !0 },
|
|
22
|
+
editable: { type: Boolean, default: !0 },
|
|
23
|
+
disabled: { type: Boolean, default: !1 },
|
|
24
|
+
readonly: { type: Boolean, default: !1 },
|
|
25
|
+
variant: { default: "background" },
|
|
26
|
+
size: { default: "md" },
|
|
27
|
+
maxWidth: {},
|
|
28
|
+
placeholder: { default: "" },
|
|
29
|
+
editIcon: { default: "lucide:square-pen" },
|
|
30
|
+
saveOnBlur: { type: Boolean, default: !0 },
|
|
31
|
+
editLabel: { default: "Edit title" },
|
|
32
|
+
class: { default: "" }
|
|
33
|
+
},
|
|
34
|
+
emits: ["update:modelValue", "edit-start", "change", "save", "cancel", "focus", "blur"],
|
|
35
|
+
setup(a, { expose: S, emit: j }) {
|
|
36
|
+
const e = a, r = j, l = g(!1), o = g(e.modelValue ?? ""), w = g(null);
|
|
37
|
+
let u = !1, f = null;
|
|
38
|
+
const m = i(() => e.editable && !e.disabled && !e.readonly), D = i(() => m.value || l.value), $ = i(() => e.maxWidth === void 0 || e.maxWidth === null || e.maxWidth === "" ? void 0 : { maxWidth: typeof e.maxWidth == "number" ? `${e.maxWidth}px` : e.maxWidth }), v = i(() => ({
|
|
39
|
+
sm: {
|
|
40
|
+
root: "gap-2 px-2.5 py-1.5 rounded-xl",
|
|
41
|
+
icon: "h-3.5 w-3.5",
|
|
42
|
+
title: "text-sm font-medium leading-5 tracking-normal",
|
|
43
|
+
button: "xs"
|
|
44
|
+
},
|
|
45
|
+
md: {
|
|
46
|
+
root: "gap-2.5 px-3.5 py-2.5 rounded-2xl",
|
|
47
|
+
icon: "h-4 w-4",
|
|
48
|
+
title: "text-base font-medium leading-6 tracking-normal",
|
|
49
|
+
button: "xs"
|
|
50
|
+
},
|
|
51
|
+
lg: {
|
|
52
|
+
root: "gap-3 px-4 py-3 rounded-2xl",
|
|
53
|
+
icon: "h-5 w-5",
|
|
54
|
+
title: "text-lg font-medium leading-7 tracking-normal",
|
|
55
|
+
button: "sm"
|
|
56
|
+
}
|
|
57
|
+
})[e.size]), F = i(() => ({
|
|
58
|
+
background: "bg-muted text-foreground transition-colors hover:bg-muted/80 focus-within:bg-muted/80",
|
|
59
|
+
transparent: "bg-transparent text-foreground"
|
|
60
|
+
})[e.variant]), N = i(
|
|
61
|
+
() => [
|
|
62
|
+
"vl-editable-title group/editable-title relative flex w-full min-w-0 items-center",
|
|
63
|
+
v.value.root,
|
|
64
|
+
F.value,
|
|
65
|
+
e.disabled ? "opacity-50 cursor-not-allowed" : "",
|
|
66
|
+
l.value ? "vl-editable-title--editing" : "",
|
|
67
|
+
e.class
|
|
68
|
+
].filter(Boolean).join(" ")
|
|
69
|
+
), z = i(
|
|
70
|
+
() => `${v.value.title} text-foreground text-start`
|
|
71
|
+
), q = i(
|
|
72
|
+
() => [
|
|
73
|
+
z.value,
|
|
74
|
+
"h-auto! min-h-0! max-h-none! py-0! px-0! border-none! bg-transparent! shadow-none!",
|
|
75
|
+
"ring-0! focus-visible:ring-0! focus-visible:border-transparent!",
|
|
76
|
+
"rounded-none!"
|
|
77
|
+
].join(" ")
|
|
78
|
+
), V = i(() => e.modelValue ?? ""), A = i(() => l.value ? o.value || e.placeholder || " " : V.value || e.placeholder || " "), H = i(() => l.value ? !o.value && !!e.placeholder : !V.value && !!e.placeholder);
|
|
79
|
+
function d() {
|
|
80
|
+
f != null && (clearTimeout(f), f = null);
|
|
81
|
+
}
|
|
82
|
+
function B(t = !0) {
|
|
83
|
+
const s = () => {
|
|
84
|
+
const n = w.value;
|
|
85
|
+
return n ? (n.focus(), t && n.select(), !0) : !1;
|
|
86
|
+
};
|
|
87
|
+
p(() => {
|
|
88
|
+
s() || requestAnimationFrame(() => {
|
|
89
|
+
p(() => {
|
|
90
|
+
s();
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
function x() {
|
|
96
|
+
!m.value || l.value || u || (d(), u = !0, o.value = e.modelValue ?? "", l.value = !0, r("edit-start"), B(!0), p(() => {
|
|
97
|
+
u = !1;
|
|
98
|
+
}));
|
|
99
|
+
}
|
|
100
|
+
function b() {
|
|
101
|
+
if (!l.value || u) return;
|
|
102
|
+
d(), u = !0;
|
|
103
|
+
const t = o.value.trim(), s = (e.modelValue ?? "").trim(), n = t.length > 0 ? t : s;
|
|
104
|
+
o.value = n, n !== (e.modelValue ?? "") && r("update:modelValue", n), r("change", n), r("save", n), l.value = !1, p(() => {
|
|
105
|
+
u = !1;
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
function T() {
|
|
109
|
+
!l.value || u || (d(), u = !0, o.value = e.modelValue ?? "", l.value = !1, r("cancel"), p(() => {
|
|
110
|
+
u = !1;
|
|
111
|
+
}));
|
|
112
|
+
}
|
|
113
|
+
function K() {
|
|
114
|
+
if (l.value) {
|
|
115
|
+
B(!1);
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
m.value && x();
|
|
119
|
+
}
|
|
120
|
+
function L(t) {
|
|
121
|
+
t.preventDefault(), t.stopPropagation(), x();
|
|
122
|
+
}
|
|
123
|
+
function O(t) {
|
|
124
|
+
r("focus", t);
|
|
125
|
+
}
|
|
126
|
+
function R(t) {
|
|
127
|
+
r("blur", t), e.saveOnBlur && (d(), f = setTimeout(() => {
|
|
128
|
+
f = null, l.value && b();
|
|
129
|
+
}, 0));
|
|
130
|
+
}
|
|
131
|
+
function U(t) {
|
|
132
|
+
l.value && (t.key === "Enter" ? (t.preventDefault(), b()) : t.key === "Escape" && (t.preventDefault(), T()));
|
|
133
|
+
}
|
|
134
|
+
return C(
|
|
135
|
+
() => e.modelValue,
|
|
136
|
+
(t) => {
|
|
137
|
+
l.value || (o.value = t ?? "");
|
|
138
|
+
}
|
|
139
|
+
), C(m, (t) => {
|
|
140
|
+
!t && l.value && (d(), o.value = e.modelValue ?? "", l.value = !1, r("cancel"));
|
|
141
|
+
}), P(() => {
|
|
142
|
+
d();
|
|
143
|
+
}), S({
|
|
144
|
+
startEdit: x,
|
|
145
|
+
save: b,
|
|
146
|
+
commit: b,
|
|
147
|
+
cancel: T,
|
|
148
|
+
focus: K
|
|
149
|
+
}), (t, s) => (c(), h("div", {
|
|
150
|
+
class: y(N.value),
|
|
151
|
+
style: G($.value),
|
|
152
|
+
"data-editing": l.value ? "true" : void 0,
|
|
153
|
+
"data-variant": a.variant,
|
|
154
|
+
"data-size": a.size
|
|
155
|
+
}, [
|
|
156
|
+
a.showIcon && a.icon ? (c(), h("div", Z, [
|
|
157
|
+
E(Q, {
|
|
158
|
+
icon: a.icon,
|
|
159
|
+
class: y(v.value.icon)
|
|
160
|
+
}, null, 8, ["icon", "class"])
|
|
161
|
+
])) : k("", !0),
|
|
162
|
+
_("div", {
|
|
163
|
+
class: "vl-editable-title__text grid min-w-0 flex-1 contain-inline-size",
|
|
164
|
+
onKeydown: U
|
|
165
|
+
}, [
|
|
166
|
+
_("span", {
|
|
167
|
+
class: y(["vl-editable-title__label col-start-1 row-start-1 block min-w-0 truncate", [
|
|
168
|
+
z.value,
|
|
169
|
+
H.value ? "text-muted-foreground" : "",
|
|
170
|
+
l.value ? "invisible" : ""
|
|
171
|
+
]]),
|
|
172
|
+
"aria-hidden": l.value ? "true" : void 0
|
|
173
|
+
}, J(A.value), 11, ee),
|
|
174
|
+
l.value ? (c(), h("div", te, [
|
|
175
|
+
E(X, {
|
|
176
|
+
ref_key: "inputHostRef",
|
|
177
|
+
ref: w,
|
|
178
|
+
modelValue: o.value,
|
|
179
|
+
"onUpdate:modelValue": s[0] || (s[0] = (n) => o.value = n),
|
|
180
|
+
type: "text",
|
|
181
|
+
variant: "transparent",
|
|
182
|
+
size: a.size,
|
|
183
|
+
placeholder: a.placeholder,
|
|
184
|
+
disabled: a.disabled,
|
|
185
|
+
"show-clear-button": !1,
|
|
186
|
+
class: "!space-y-0 min-w-0 w-full",
|
|
187
|
+
"input-class": q.value,
|
|
188
|
+
onFocus: O,
|
|
189
|
+
onBlur: R
|
|
190
|
+
}, null, 8, ["modelValue", "size", "placeholder", "disabled", "input-class"])
|
|
191
|
+
])) : k("", !0)
|
|
192
|
+
], 32),
|
|
193
|
+
D.value ? (c(), h("div", le, [
|
|
194
|
+
!l.value && m.value ? (c(), I(W, {
|
|
195
|
+
key: 0,
|
|
196
|
+
type: "button",
|
|
197
|
+
"as-icon": "",
|
|
198
|
+
variant: "ghost",
|
|
199
|
+
size: v.value.button,
|
|
200
|
+
rounded: "md",
|
|
201
|
+
icon: a.editIcon,
|
|
202
|
+
"aria-label": a.editLabel,
|
|
203
|
+
disabled: a.disabled,
|
|
204
|
+
class: "vl-editable-title__edit-btn text-foreground",
|
|
205
|
+
onClick: L
|
|
206
|
+
}, null, 8, ["size", "icon", "aria-label", "disabled"])) : (c(), I(W, {
|
|
207
|
+
key: 1,
|
|
208
|
+
type: "button",
|
|
209
|
+
"as-icon": "",
|
|
210
|
+
variant: "ghost",
|
|
211
|
+
size: v.value.button,
|
|
212
|
+
rounded: "md",
|
|
213
|
+
icon: a.editIcon,
|
|
214
|
+
tabindex: "-1",
|
|
215
|
+
"aria-hidden": "true",
|
|
216
|
+
disabled: "",
|
|
217
|
+
class: "vl-editable-title__edit-spacer invisible pointer-events-none"
|
|
218
|
+
}, null, 8, ["size", "icon"]))
|
|
219
|
+
])) : k("", !0)
|
|
220
|
+
], 14, Y));
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
export {
|
|
224
|
+
re as default
|
|
225
|
+
};
|
|
@@ -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, {
|
|
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 & {
|