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
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { resolveI18nText as
|
|
3
|
-
import { useRtl as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as b, ref as v, computed as d, openBlock as x, createElementBlock as h, normalizeClass as g } from "vue";
|
|
2
|
+
import { resolveI18nText as w } from "../utils/i18n.js";
|
|
3
|
+
import { useRtl as k } from "../composables/useRtl.js";
|
|
4
|
+
const y = ["value", "rows", "disabled", "placeholder", "dir", "data-testid"], V = /* @__PURE__ */ b({
|
|
5
5
|
__name: "Textarea",
|
|
6
6
|
props: {
|
|
7
7
|
modelValue: { default: "" },
|
|
@@ -13,30 +13,45 @@ const g = ["value", "rows", "disabled", "placeholder", "dir", "data-testid"], y
|
|
|
13
13
|
dir: {}
|
|
14
14
|
},
|
|
15
15
|
emits: ["update:modelValue", "focus", "blur"],
|
|
16
|
-
setup(
|
|
17
|
-
const a =
|
|
16
|
+
setup(a, { expose: u, emit: n }) {
|
|
17
|
+
const o = a, r = n, l = v(null), i = k(), c = d(() => o.dir ?? (i.value ? "rtl" : "ltr")), f = d(() => [
|
|
18
18
|
"flex min-h-[80px] w-full rounded-md border border-input px-3 py-2 text-sm placeholder:text-muted-foreground/50 focus-visible:outline-none focus-visible:border-black disabled:cursor-not-allowed disabled:opacity-50 bg-background text-foreground",
|
|
19
|
-
|
|
20
|
-
].join(" ")),
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
() =>
|
|
19
|
+
o.class
|
|
20
|
+
].join(" ")), m = (e) => {
|
|
21
|
+
const t = e.target;
|
|
22
|
+
r("update:modelValue", t.value);
|
|
23
|
+
}, p = d(
|
|
24
|
+
() => w(o.placeholderI18n, o.placeholder)
|
|
25
25
|
);
|
|
26
|
-
return (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
return u({
|
|
27
|
+
focus: (e) => {
|
|
28
|
+
l.value?.focus(e);
|
|
29
|
+
},
|
|
30
|
+
select: () => {
|
|
31
|
+
l.value?.select();
|
|
32
|
+
},
|
|
33
|
+
blur: () => {
|
|
34
|
+
l.value?.blur();
|
|
35
|
+
},
|
|
36
|
+
get el() {
|
|
37
|
+
return l.value;
|
|
38
|
+
}
|
|
39
|
+
}), (e, t) => (x(), h("textarea", {
|
|
40
|
+
ref_key: "textareaRef",
|
|
41
|
+
ref: l,
|
|
42
|
+
value: a.modelValue,
|
|
43
|
+
rows: a.rows,
|
|
44
|
+
disabled: a.disabled,
|
|
45
|
+
placeholder: p.value,
|
|
46
|
+
class: g(f.value),
|
|
47
|
+
dir: c.value,
|
|
48
|
+
onInput: m,
|
|
49
|
+
onFocus: t[0] || (t[0] = (s) => r("focus", s)),
|
|
50
|
+
onBlur: t[1] || (t[1] = (s) => r("blur", s)),
|
|
51
|
+
"data-testid": e.$attrs["data-testid"] || (e.$attrs.name ? `textarea-${e.$attrs.name}` : "textarea")
|
|
52
|
+
}, null, 42, y));
|
|
38
53
|
}
|
|
39
54
|
});
|
|
40
55
|
export {
|
|
41
|
-
|
|
56
|
+
V as default
|
|
42
57
|
};
|
package/components/index.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export { default as DatePicker } from './DatePicker.vue';
|
|
|
27
27
|
export { default as DateRangePicker } from './DateRangePicker.vue';
|
|
28
28
|
export { Dropdown } from './Dropdown';
|
|
29
29
|
export { Empty } from './Empty';
|
|
30
|
+
export { EditableTitle } from './EditableTitle';
|
|
30
31
|
export { FilePicker } from './FilePicker';
|
|
31
32
|
export { FileTree } from './FileTree';
|
|
32
33
|
export { FadeOverlay } from './FadeOverlay';
|
package/docs/component-index.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# vlite3 — Complete Component & Docs Index
|
|
2
2
|
|
|
3
|
-
Single entry point for AI agents and developers. Find any vlite3
|
|
3
|
+
Single entry point for AI agents and developers. Find any vlite3 UI doc from this file — do not hunt folder by folder.
|
|
4
4
|
|
|
5
5
|
**Import pattern:**
|
|
6
6
|
|
|
@@ -20,8 +20,9 @@ import { Button, Input, Form } from 'vlite3'
|
|
|
20
20
|
| Area | Path |
|
|
21
21
|
| :--- | :--- |
|
|
22
22
|
| Components | [`components/`](./components/) |
|
|
23
|
-
|
|
|
24
|
-
|
|
|
23
|
+
| Guides | [`guides/`](./guides/) |
|
|
24
|
+
| Utilities | [`utilities/`](./utilities/) |
|
|
25
|
+
| Composables | [`composables/`](./composables/) |
|
|
25
26
|
|
|
26
27
|
---
|
|
27
28
|
|
|
@@ -32,7 +33,7 @@ import { Button, Input, Form } from 'vlite3'
|
|
|
32
33
|
| Accordion | Core | Show/hide long content sections without leaving the page | [Accordion.md](./components/accordion.md) |
|
|
33
34
|
| Alert | Core | Inline success/warning/error/info banners on a page or form | [Alert.md](./components/alert.md) |
|
|
34
35
|
| AppShell | Advanced | Full app chrome: sidebar + header + content + mobile drawer | [AppShell.md](./components/app-shell.md) |
|
|
35
|
-
| AsyncSelect | Core | Searchable dropdown that loads large lists from the API | [AsyncSelect.md](./components/async-select.md)
|
|
36
|
+
| AsyncSelect | Core | Searchable dropdown that loads large lists from the API | [AsyncSelect.md](./components/async-select.md) |
|
|
36
37
|
| AttachmentsList | Core | Show uploaded files with download + inline preview | [AttachmentsList.md](./components/attachments-list.md) |
|
|
37
38
|
| Avatar | Core | Show a user’s photo or initials | [Avatar.md](./components/avatar.md) |
|
|
38
39
|
| AvatarGroup | Core | Stack many people (team, assignees) with “+N” overflow | [AvatarGroup.md](./components/avatar-group.md) |
|
|
@@ -62,11 +63,12 @@ import { Button, Input, Form } from 'vlite3'
|
|
|
62
63
|
| CustomFields | Core | Edit dynamic key/value or repeater field rows | [CustomFields.md](./components/custom-fields.md) |
|
|
63
64
|
| CustomFieldsDisplay | Advanced | Read-only view of custom field values | [CustomFieldsDisplay.md](./components/custom-fields-display.md) |
|
|
64
65
|
| DataList | Core | Card/list rendering of many items with slots | [DataList.md](./components/data-list.md) |
|
|
65
|
-
| DataTable | Core |
|
|
66
|
+
| DataTable | Core | Data tables: sort, filter, select, tree, pages | [DataTable.md](./components/data-table.md) |
|
|
66
67
|
| DatePicker | Core | Pick a date (or week) in forms/filters | [DatePicker.md](./components/date-picker.md) |
|
|
67
68
|
| DateRangePicker | Advanced | Pick a start–end date range (reports, filters) | [DateRangePicker.md](./components/date-range-picker.md) |
|
|
68
69
|
| DateTime | Core | Format and display dates/times consistently | [DateTime.md](./components/date-time.md) |
|
|
69
70
|
| Dropdown | Core | Single-select menus, nested actions, remote search | [Dropdown.md](./components/dropdown.md) |
|
|
71
|
+
| EditableTitle | Core | Inline-renamable title row with icon + edit action | [EditableTitle.md](./components/editable-title.md) |
|
|
70
72
|
| Empty | Core | Friendly “no data yet” placeholders | [Empty.md](./components/empty.md) |
|
|
71
73
|
| ExportData | Advanced | Download table data as Excel / CSV / JSON | [ExportData.md](./components/export-data.md) |
|
|
72
74
|
| FilePicker | Core | Upload one or many files from the device | [FilePicker.md](./components/file-picker.md) |
|
|
@@ -111,7 +113,6 @@ import { Button, Input, Form } from 'vlite3'
|
|
|
111
113
|
| Spinner | Core | Small loading indicator | [Spinner.md](./components/spinner.md) |
|
|
112
114
|
| Splitter | Core | Resizable two-pane layouts (IDE-style) | [Splitter.md](./components/splitter.md) |
|
|
113
115
|
| Stats | Core | KPI / metric cards on dashboards | [Stats.md](./components/stats.md) |
|
|
114
|
-
| StatusActionMenu | ERP | Change status / approve / reject with optional form | [0-StatusActionMenu.md](./0-StatusActionMenu.md) |
|
|
115
116
|
| StatusChip | Core | Map status strings → colored chips automatically | [StatusChip.md](./components/status-chip.md) |
|
|
116
117
|
| Switch | Core | On/off settings toggles | [Switch.md](./components/switch.md) |
|
|
117
118
|
| Tabes | Core | Switch views/modes with tabs | [Tabes.md](./components/tabs.md) |
|
|
@@ -134,7 +135,7 @@ import { Button, Input, Form } from 'vlite3'
|
|
|
134
135
|
| :--- | :--- | :--- | :--- |
|
|
135
136
|
| **Button** | Clickable action control with variants, icons, loading | Submitting forms, opening modals, navigation CTAs | [Button.md](./components/button.md) |
|
|
136
137
|
| **ButtonGroup** | Visually groups related buttons as one unit | Export / print / more actions that belong together | [ButtonGroup.md](./components/button-group.md) |
|
|
137
|
-
| **Breadcrumb** | Shows the path from home → current page |
|
|
138
|
+
| **Breadcrumb** | Shows the path from home → current page | Nested pages and multi-level navigation | [Breadcrumb.md](./components/breadcrumb.md) |
|
|
138
139
|
| **Clipboard** | Copies text and shows brief success feedback | Copying invoice #, tracking ID, API keys, share links | [Clipboard.md](./components/clipboard.md) |
|
|
139
140
|
| **SidebarMenu** | Recursive left/top navigation tree | App modules, nested menus, badges for counts | [SidebarMenu.md](./components/sidebar-menu.md) |
|
|
140
141
|
| **SidePanel** | Slide-over panel from the edge of the screen | Filters, quick edit, details without leaving the list | [SidePanel.md](./components/side-panel.md) |
|
|
@@ -146,6 +147,7 @@ import { Button, Input, Form } from 'vlite3'
|
|
|
146
147
|
| Component | Purpose | Use when… | Doc |
|
|
147
148
|
| :--- | :--- | :--- | :--- |
|
|
148
149
|
| **Input** | Single-line text entry | Names, emails, codes, search boxes | [Input.md](./components/input.md) |
|
|
150
|
+
| **EditableTitle** | Inline-renamable title with leading icon + hover edit | Document/page/section titles that users rename in place | [EditableTitle.md](./components/editable-title.md) |
|
|
149
151
|
| **Textarea** | Multi-line text entry | Notes, descriptions, rejection reasons | [Textarea.md](./components/textarea.md) |
|
|
150
152
|
| **NumberInput** | Numeric entry with constraints | Qty, rates, percentages, sequenced numbers | [NumberInput.md](./components/number-input.md) |
|
|
151
153
|
| **CheckBox** | Boolean or multi-check options | Agree terms, select rows, feature flags | [CheckBox.md](./components/checkbox.md) |
|
|
@@ -214,7 +216,7 @@ import { Button, Input, Form } from 'vlite3'
|
|
|
214
216
|
|
|
215
217
|
| Component | Purpose | Use when… | Doc |
|
|
216
218
|
| :--- | :--- | :--- | :--- |
|
|
217
|
-
| **Screen** | Standard
|
|
219
|
+
| **Screen** | Standard list/CRUD page shell | List pages with search, filters, add actions, and empty states | [Screen.md](./components/screen.md) |
|
|
218
220
|
| **Splitter** | User-resizable side-by-side panels | Master-detail, code+preview, map+list | [Splitter.md](./components/splitter.md) |
|
|
219
221
|
| **Chat** | Flat messaging UI with attachments & edit/delete | Support chat, internal messaging, AI assistants | [Chat.md](./components/chat.md) |
|
|
220
222
|
| **CommentThread** | Nested reply trees (not flat chat) | Tickets, PRs, document review discussions | [CommentThread.md](./components/comment-thread.md) |
|
|
@@ -228,7 +230,7 @@ import { Button, Input, Form } from 'vlite3'
|
|
|
228
230
|
| **AppShell** | Orchestrates whole-app layout (sidebar, header, content, mobile drawer) | Building the authenticated app frame once | [AppShell.md](./components/app-shell.md) |
|
|
229
231
|
| **Navbar** | Horizontal top navigation only | Landing pages, simple dashboards (prefer AppShell for full apps) | [Navbar.md](./components/navbar.md) |
|
|
230
232
|
| **Footer** | Data-driven site footer | Marketing sites, public portals, help centers | [Footer.md](./components/footer.md) |
|
|
231
|
-
| **CommandPalette** | Keyboard-first search to jump to pages/actions | Power-user navigation across a large
|
|
233
|
+
| **CommandPalette** | Keyboard-first search to jump to pages/actions | Power-user navigation across a large application | [CommandPalette.md](./components/command-palette.md) |
|
|
232
234
|
| **Calendar** | Event calendar with month/week/day + drag-drop | Appointments, leave, production schedules | [Calendar.md](./components/calendar.md) |
|
|
233
235
|
| **Cart** | Cart with line items, quantities, totals (e‑com + POS variants) | Checkout, POS selling, quote builders | [Cart.md](./components/cart.md) |
|
|
234
236
|
| **CategoryManager** | Admin UI to CRUD nested categories | Product categories, chart of accounts folders, menus | [CategoryManager.md](./components/category-manager.md) |
|
|
@@ -264,21 +266,18 @@ import { Button, Input, Form } from 'vlite3'
|
|
|
264
266
|
|
|
265
267
|
---
|
|
266
268
|
|
|
267
|
-
## 4.
|
|
269
|
+
## 4. Guides, utilities & composables
|
|
268
270
|
|
|
269
271
|
| Doc | Purpose | Use when… | Link |
|
|
270
272
|
| :--- | :--- | :--- | :--- |
|
|
271
|
-
| **
|
|
272
|
-
| **
|
|
273
|
-
| **
|
|
274
|
-
| **
|
|
275
|
-
| **
|
|
276
|
-
| **
|
|
277
|
-
| **
|
|
278
|
-
| **
|
|
279
|
-
| **Search util** | Fast typed `search` / `lazySearch` utilities | Client-side search indexes | [8-search-util.md](./utilities/search.md) |
|
|
280
|
-
| **Draggable** | Vue draggable patterns | Sortable lists, Kanban-like reorder | [9-draggable.md](./guides/draggable.md) |
|
|
281
|
-
| **Design** | Design-system tokens | Visual consistency / token reference | [Design.md](./Design.md) |
|
|
273
|
+
| **Theming** | Design tokens, Tailwind v4, dark mode | Changing brand colors / theme behavior | [theming.md](./guides/theming.md) |
|
|
274
|
+
| **Utility / Composables** | Shared composables (`useKeyStroke`, etc.) | Keyboard shortcuts and reusable logic | [utilities.md](./utilities/utilities.md) |
|
|
275
|
+
| **useTheme** | Theme state and helpers | Reading or toggling light/dark theme | [use-theme.md](./composables/use-theme.md) |
|
|
276
|
+
| **Performance** | Vue 3 performance guidance for vlite3 apps | Writing or reviewing Vue code | [performance.md](./guides/performance.md) |
|
|
277
|
+
| **i18n** | Register a translation handler for vlite3 | Multi-language apps | [internationalization.md](./guides/internationalization.md) |
|
|
278
|
+
| **Search util** | Fast typed `search` / `lazySearch` utilities | Client-side search indexes | [search.md](./utilities/search.md) |
|
|
279
|
+
| **Draggable** | Vue draggable patterns | Sortable lists, Kanban-like reorder | [draggable.md](./guides/draggable.md) |
|
|
280
|
+
| **Setup** | Install and configure vlite3 | Starting a new project with vlite3 | [setup.md](./getting-started/setup.md) |
|
|
282
281
|
|
|
283
282
|
---
|
|
284
283
|
|
|
@@ -289,12 +288,12 @@ import { Button, Input, Form } from 'vlite3'
|
|
|
289
288
|
| Full authenticated app chrome | [AppShell](./components/app-shell.md) | [Navbar](./components/navbar.md), [SidebarMenu](./components/sidebar-menu.md), [SidePanel](./components/side-panel.md) |
|
|
290
289
|
| Standard list / CRUD page | [Screen](./components/screen.md) | [DataTable](./components/data-table.md), [Empty](./components/empty.md) |
|
|
291
290
|
| Create/edit record form | [Forms](./components/forms.md) | [CustomFields](./components/custom-fields.md), [Testing-Forms](./guides/testing-forms.md) |
|
|
292
|
-
| Large API-backed dropdown | [AsyncSelect](./components/async-select.md) | [
|
|
291
|
+
| Large API-backed dropdown | [AsyncSelect](./components/async-select.md) | [Dropdown](./components/dropdown.md), [MultiSelect](./components/multi-select.md) |
|
|
293
292
|
| Edit categories vs browse them | [CategoryManager](./components/category-manager.md) | [CategoryMenu](./components/category-menu.md) |
|
|
294
293
|
| Edit custom fields vs show them | [CustomFields](./components/custom-fields.md) | [CustomFieldsDisplay](./components/custom-fields-display.md) |
|
|
295
294
|
| Bulk import vs export | [ImportData](./components/import-data.md) | [ExportData](./components/export-data.md) |
|
|
296
295
|
| Flat chat vs nested discussion | [Chat](./components/chat.md) | [CommentThread](./components/comment-thread.md) |
|
|
297
|
-
| Show status
|
|
296
|
+
| Show status labels | [StatusChip](./components/status-chip.md) | [Chip](./components/chip.md), [Badge](./components/badge.md) |
|
|
298
297
|
| Overlay testing | [Testing-Overlays](./guides/testing-overlays.md) | [Modal](./components/modal.md), [ConfirmationModal](./components/confirmation-modal.md) |
|
|
299
298
|
|
|
300
299
|
---
|
|
@@ -303,11 +302,11 @@ import { Button, Input, Form } from 'vlite3'
|
|
|
303
302
|
|
|
304
303
|
| Section | Docs |
|
|
305
304
|
| :--- | ---: |
|
|
306
|
-
| Core components |
|
|
305
|
+
| Core components | 67 |
|
|
307
306
|
| Advanced components | 27 |
|
|
308
307
|
| Guides | 2 |
|
|
309
|
-
|
|
|
310
|
-
| **Total linked from this index** | **
|
|
308
|
+
| Guides, utilities & composables | 8 |
|
|
309
|
+
| **Total linked from this index** | **104** |
|
|
311
310
|
|
|
312
311
|
# Usage for agents
|
|
313
312
|
open the file to discover component.
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# EditableTitle
|
|
2
|
+
|
|
3
|
+
**Import:** `import { EditableTitle } from 'vlite3'`
|
|
4
|
+
|
|
5
|
+
Inline-renamable title row with a leading icon, flexible truncated title, and a trailing edit action. Display text and the editing field share the same typography so entering/leaving edit mode does not jump, resize, or shift layout.
|
|
6
|
+
|
|
7
|
+
The component owns edit UI state internally. Consumers bind the title value only and handle persistence on `save` / `change`.
|
|
8
|
+
|
|
9
|
+
### Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| :--- | :--- | :--- | :--- |
|
|
13
|
+
| `modelValue` | `string` | `''` | Current title (`v-model`) |
|
|
14
|
+
| `icon` | `string` | `lucide:file-text` | Leading icon (Iconify ID or image URL) |
|
|
15
|
+
| `showIcon` | `boolean` | `true` | Render the leading icon |
|
|
16
|
+
| `editable` | `boolean` | `true` | Allow entering edit mode |
|
|
17
|
+
| `disabled` | `boolean` | `false` | Disable interaction + muted styling |
|
|
18
|
+
| `readonly` | `boolean` | `false` | Prevent editing without muted chrome |
|
|
19
|
+
| `variant` | `'background' \| 'transparent'` | `background` | Surface treatment |
|
|
20
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `md` | Typography and spacing scale |
|
|
21
|
+
| `maxWidth` | `string \| number` | — | Max width of the root (px number or CSS length) |
|
|
22
|
+
| `placeholder` | `string` | `''` | Shown when the title/draft is empty |
|
|
23
|
+
| `editIcon` | `string` | `lucide:square-pen` | Trailing edit action icon |
|
|
24
|
+
| `saveOnBlur` | `boolean` | `true` | Commit the draft when the input blurs |
|
|
25
|
+
| `editLabel` | `string` | `Edit title` | Accessible label for the edit button |
|
|
26
|
+
| `class` | `any` | `''` | Extra classes on the root |
|
|
27
|
+
|
|
28
|
+
### Events
|
|
29
|
+
|
|
30
|
+
| Event | Payload | Description |
|
|
31
|
+
| :--- | :--- | :--- |
|
|
32
|
+
| `update:modelValue` | `string` | Emitted when a commit changes the title |
|
|
33
|
+
| `edit-start` | — | Fired when edit mode begins |
|
|
34
|
+
| `change` | `string` | Fired on commit with the committed title |
|
|
35
|
+
| `save` | `string` | Alias of `change` on commit |
|
|
36
|
+
| `cancel` | — | Fired when editing is cancelled (Escape / programmatic) |
|
|
37
|
+
| `focus` | `FocusEvent` | Input focus while editing |
|
|
38
|
+
| `blur` | `FocusEvent` | Input blur while editing |
|
|
39
|
+
|
|
40
|
+
### Public methods
|
|
41
|
+
|
|
42
|
+
Exposed via template ref when programmatic control is needed:
|
|
43
|
+
|
|
44
|
+
| Method | Description |
|
|
45
|
+
| :--- | :--- |
|
|
46
|
+
| `startEdit()` | Enter edit mode (no-op when disabled / readonly / not editable) |
|
|
47
|
+
| `save()` / `commit()` | Commit the draft |
|
|
48
|
+
| `cancel()` | Discard the draft and leave edit mode |
|
|
49
|
+
| `focus()` | Focus the input, or start editing when allowed; **no-op** when editing is not allowed |
|
|
50
|
+
|
|
51
|
+
### Editing behaviour
|
|
52
|
+
|
|
53
|
+
- Click **Edit** (or call `startEdit()` / `focus()`) to enter edit mode; the title is selected for quick replacement via `Input`’s public `focus()` / `select()` contract.
|
|
54
|
+
- Edit mode is **internal UI state**. Parents do not bind or synchronize an `editing` flag.
|
|
55
|
+
- While editing, the Edit affordance is **fully hidden** (layout space still reserved). There is never a visible Edit control that ignores clicks.
|
|
56
|
+
- **Enter** commits.
|
|
57
|
+
- **Escape** cancels and restores the previous title.
|
|
58
|
+
- Blur follows `saveOnBlur` (default `true`). Blur commit is deferred past the click sequence so clicking Edit on another `EditableTitle` still works.
|
|
59
|
+
- Whitespace-only drafts do **not** wipe a valid title — the previous value is kept.
|
|
60
|
+
- Empty titles are only accepted when the previous value was already empty.
|
|
61
|
+
- Disabled / readonly / `editable=false` never enter editing. If those flags flip on while editing, the session is cancelled.
|
|
62
|
+
|
|
63
|
+
### Layout
|
|
64
|
+
|
|
65
|
+
```text
|
|
66
|
+
fixed icon | flexible constrained title | fixed action
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Long titles truncate with ellipsis in display mode. In edit mode the input keeps the same middle width and scrolls internally — it never expands the component. The edit action slot is always reserved when editing is allowed, so hover reveal does not shift the title.
|
|
70
|
+
|
|
71
|
+
### Variants
|
|
72
|
+
|
|
73
|
+
| Value | Description |
|
|
74
|
+
| :--- | :--- |
|
|
75
|
+
| `background` | Soft filled surface with generous rounded corners (closest to the design reference) |
|
|
76
|
+
| `transparent` | No container background — for page / section headers |
|
|
77
|
+
|
|
78
|
+
### Usage
|
|
79
|
+
|
|
80
|
+
```vue
|
|
81
|
+
<script setup lang="ts">
|
|
82
|
+
import { ref } from 'vue'
|
|
83
|
+
import { EditableTitle } from 'vlite3'
|
|
84
|
+
|
|
85
|
+
const title = ref('Personal Notes')
|
|
86
|
+
|
|
87
|
+
function onSave(value: string) {
|
|
88
|
+
// Persist elsewhere — EditableTitle does not call APIs.
|
|
89
|
+
console.log('saved', value)
|
|
90
|
+
}
|
|
91
|
+
</script>
|
|
92
|
+
|
|
93
|
+
<template>
|
|
94
|
+
<EditableTitle
|
|
95
|
+
v-model="title"
|
|
96
|
+
icon="lucide:file-text"
|
|
97
|
+
variant="background"
|
|
98
|
+
@save="onSave" />
|
|
99
|
+
</template>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
#### Programmatic control
|
|
103
|
+
|
|
104
|
+
```vue
|
|
105
|
+
<script setup lang="ts">
|
|
106
|
+
import { ref } from 'vue'
|
|
107
|
+
import { EditableTitle } from 'vlite3'
|
|
108
|
+
import type { EditableTitleExpose } from 'vlite3'
|
|
109
|
+
|
|
110
|
+
const title = ref('Personal Notes')
|
|
111
|
+
const titleRef = ref<EditableTitleExpose | null>(null)
|
|
112
|
+
</script>
|
|
113
|
+
|
|
114
|
+
<template>
|
|
115
|
+
<EditableTitle ref="titleRef" v-model="title" />
|
|
116
|
+
<button type="button" @click="titleRef?.startEdit()">Rename</button>
|
|
117
|
+
</template>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Accessibility
|
|
121
|
+
|
|
122
|
+
- Edit control is a real button with an accessible name (`editLabel`, default “Edit title”).
|
|
123
|
+
- Revealed on container hover **and** keyboard `:focus-within`.
|
|
124
|
+
- On touch / coarse pointers (no hover), the edit action stays visible.
|
|
125
|
+
- Edit clicks use `stopPropagation` so parent click handlers are not triggered accidentally.
|
package/docs/components/input.md
CHANGED
|
@@ -41,6 +41,17 @@
|
|
|
41
41
|
- `@click:icon`: Click on left icon
|
|
42
42
|
- `@click:icon-right`: Click on right icon
|
|
43
43
|
|
|
44
|
+
### Public methods
|
|
45
|
+
|
|
46
|
+
Exposed via template ref:
|
|
47
|
+
|
|
48
|
+
| Method | Description |
|
|
49
|
+
| :--- | :--- |
|
|
50
|
+
| `focus(options?)` | Focus the native input / textarea |
|
|
51
|
+
| `select()` | Select the native input contents |
|
|
52
|
+
| `blur()` | Blur the native field |
|
|
53
|
+
| `el` | The underlying native field element when mounted |
|
|
54
|
+
|
|
44
55
|
### Usage
|
|
45
56
|
|
|
46
57
|
```vue
|
package/docs-manifest.json
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
"managedBy": "vlite3",
|
|
3
3
|
"manifestVersion": 1,
|
|
4
4
|
"packageName": "vlite3",
|
|
5
|
-
"packageVersion": "1.5.
|
|
6
|
-
"generatedAt": "2026-08-
|
|
5
|
+
"packageVersion": "1.5.16",
|
|
6
|
+
"generatedAt": "2026-08-08T14:21:07.216Z",
|
|
7
7
|
"files": {
|
|
8
8
|
"component-index.md": {
|
|
9
|
-
"sha256": "
|
|
9
|
+
"sha256": "3a4913a7d256abac1dda455c1920c9b6279adcf12d5071205da7a60d7d8ea012"
|
|
10
10
|
},
|
|
11
11
|
"components/accordion.md": {
|
|
12
12
|
"sha256": "c14c34f921eca707c57fdc38858f191ee06ac48840379c93e4fb162faac37ed4"
|
|
@@ -122,6 +122,9 @@
|
|
|
122
122
|
"components/dropdown.md": {
|
|
123
123
|
"sha256": "ee3d943e7770d8ee15753ff126cda28636070a745b8ed1c765169e033f6e4a20"
|
|
124
124
|
},
|
|
125
|
+
"components/editable-title.md": {
|
|
126
|
+
"sha256": "d5ba7c291de6f4aa07e697553cb17975dbf523b66a4a4a6918b7e3cc7ceb8040"
|
|
127
|
+
},
|
|
125
128
|
"components/empty.md": {
|
|
126
129
|
"sha256": "18d668a55623a684013e9bcf5eadb8bdfd804fa62c1c3ca2dfbf44c60ab4efae"
|
|
127
130
|
},
|
|
@@ -171,7 +174,7 @@
|
|
|
171
174
|
"sha256": "75e5a77268e8e700b6c987ac1f0943c31c4615ae6d17a6a1fe20a8ac295b198c"
|
|
172
175
|
},
|
|
173
176
|
"components/input.md": {
|
|
174
|
-
"sha256": "
|
|
177
|
+
"sha256": "225e83e4acf8edf6cabce6eae6e665ce6a22a6d5a6883c0e3211a4bf03abcf83"
|
|
175
178
|
},
|
|
176
179
|
"components/invoice.md": {
|
|
177
180
|
"sha256": "934af5683cc7a7cfc29d11bdf98866937d4949cf54fea290c00796bf76fe48dd"
|
package/index.d.ts
CHANGED
|
@@ -75,6 +75,7 @@ export { default as Logo } from './components/Logo.vue';
|
|
|
75
75
|
export { default as Alert } from './components/Alert.vue';
|
|
76
76
|
export { default as Badge } from './components/Badge.vue';
|
|
77
77
|
export { default as Input } from './components/Input.vue';
|
|
78
|
+
export { EditableTitle } from './components/EditableTitle';
|
|
78
79
|
export { default as Label } from './components/Label.vue';
|
|
79
80
|
export { default as Modal } from './components/Modal.vue';
|
|
80
81
|
export { default as Avatar } from './components/Avatar.vue';
|