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.
- 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/{CommandPaletteItem2.vue.js → CommandPaletteItem.vue.js} +1 -1
- package/components/EditableTitle/EditableTitle.vue.d.ts +213 -0
- package/components/EditableTitle/EditableTitle.vue.js +7 -0
- package/components/EditableTitle/EditableTitle2.vue.js +372 -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 +4 -2
- package/docs/components/editable-title.md +174 -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 +61 -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
|
@@ -68,6 +68,7 @@ import { Button, Input, Form } from 'vlite3'
|
|
|
68
68
|
| DateRangePicker | Advanced | Pick a start–end date range (reports, filters) | [DateRangePicker.md](./components/date-range-picker.md) |
|
|
69
69
|
| DateTime | Core | Format and display dates/times consistently | [DateTime.md](./components/date-time.md) |
|
|
70
70
|
| Dropdown | Core | Single-select menus, nested actions, remote search | [Dropdown.md](./components/dropdown.md) |
|
|
71
|
+
| EditableTitle | Core | Create/rename title row with IconPicker + edit/delete actions | [EditableTitle.md](./components/editable-title.md) |
|
|
71
72
|
| Empty | Core | Friendly “no data yet” placeholders | [Empty.md](./components/empty.md) |
|
|
72
73
|
| ExportData | Advanced | Download table data as Excel / CSV / JSON | [ExportData.md](./components/export-data.md) |
|
|
73
74
|
| FilePicker | Core | Upload one or many files from the device | [FilePicker.md](./components/file-picker.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** | Create/rename title row with optional IconPicker + delete | List items, project rows, section titles | [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) |
|
|
@@ -300,11 +302,11 @@ import { Button, Input, Form } from 'vlite3'
|
|
|
300
302
|
|
|
301
303
|
| Section | Docs |
|
|
302
304
|
| :--- | ---: |
|
|
303
|
-
| Core components |
|
|
305
|
+
| Core components | 67 |
|
|
304
306
|
| Advanced components | 27 |
|
|
305
307
|
| Guides | 2 |
|
|
306
308
|
| Guides, utilities & composables | 8 |
|
|
307
|
-
| **Total linked from this index** | **
|
|
309
|
+
| **Total linked from this index** | **104** |
|
|
308
310
|
|
|
309
311
|
# Usage for agents
|
|
310
312
|
open the file to discover component.
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# EditableTitle
|
|
2
|
+
|
|
3
|
+
**Import:** `import { EditableTitle } from 'vlite3'`
|
|
4
|
+
|
|
5
|
+
Inline create / rename title row with optional leading `IconPicker`, edit action, and delete 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 temporary UI state (editing / create focus). Consumers bind the title value (and optionally the icon) and handle persistence on `create`, `save`, `update:icon`, and `delete`.
|
|
8
|
+
|
|
9
|
+
**List performance:** `IconPicker` is mounted lazily (on hover/focus/first activate) so long project lists do not pay the iconify picker cost per idle row. Prefer `v-memo` on parent `v-for` rows that render `EditableTitle`.
|
|
10
|
+
|
|
11
|
+
### Props
|
|
12
|
+
|
|
13
|
+
| Prop | Type | Default | Description |
|
|
14
|
+
| :--- | :--- | :--- | :--- |
|
|
15
|
+
| `modelValue` | `string` | `''` | Current title (`v-model`) |
|
|
16
|
+
| `icon` | `string` | `lucide:file-text` | Leading icon (`v-model:icon`) |
|
|
17
|
+
| `showIcon` | `boolean` | `true` | Render the leading icon |
|
|
18
|
+
| `canChangeIcon` | `boolean` | `true` | Allow changing the icon via `IconPicker` (independent of whether `icon` is already set; empty values use a fallback glyph) |
|
|
19
|
+
| `iconPickerPosition` | `string` | `bottom-start` | `IconPicker` dropdown placement |
|
|
20
|
+
| `editable` | `boolean` | `true` | Allow title rename (independent of icon/delete) |
|
|
21
|
+
| `create` | `boolean` | `false` | Creation mode — mounts already editing; confirms via `create` |
|
|
22
|
+
| `canDelete` | `boolean` | `false` | Show trailing delete action |
|
|
23
|
+
| `deleteIcon` | `string` | `lucide:trash-2` | Delete action icon |
|
|
24
|
+
| `deleteLabel` | `string` | `Delete` | Accessible label for delete |
|
|
25
|
+
| `disabled` | `boolean` | `false` | Disable all interactions + muted styling |
|
|
26
|
+
| `readonly` | `boolean` | `false` | Block title/icon/delete without muted chrome |
|
|
27
|
+
| `variant` | `'background' \| 'transparent'` | `background` | Surface treatment |
|
|
28
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `md` | Typography and spacing scale |
|
|
29
|
+
| `maxWidth` | `string \| number` | — | Max width of the root |
|
|
30
|
+
| `placeholder` | `string` | `''` | Shown when the title/draft is empty |
|
|
31
|
+
| `editIcon` | `string` | `lucide:square-pen` | Trailing edit action icon |
|
|
32
|
+
| `saveOnBlur` | `boolean` | `true` | Commit (rename or create) when the input blurs |
|
|
33
|
+
| `editLabel` | `string` | `Edit title` | Accessible label for the edit button |
|
|
34
|
+
| `class` | `any` | `''` | Extra classes on the root |
|
|
35
|
+
|
|
36
|
+
### Events
|
|
37
|
+
|
|
38
|
+
| Event | Payload | Description |
|
|
39
|
+
| :--- | :--- | :--- |
|
|
40
|
+
| `update:modelValue` | `string` | Title changed on rename/create commit |
|
|
41
|
+
| `update:icon` | `string` | Icon selected via `IconPicker` |
|
|
42
|
+
| `edit-start` | — | Rename edit mode began |
|
|
43
|
+
| `change` | `string` | Rename commit |
|
|
44
|
+
| `save` | `string` | Rename commit (alias of `change`) |
|
|
45
|
+
| `create` | `string` | Creation confirmed with a non-empty title |
|
|
46
|
+
| `cancel` | — | Escape / empty create blur / programmatic cancel |
|
|
47
|
+
| `delete` | — | Delete action clicked (consumer confirms/persists) |
|
|
48
|
+
| `focus` | `FocusEvent` | Input focus while editing |
|
|
49
|
+
| `blur` | `FocusEvent` | Input blur while editing |
|
|
50
|
+
|
|
51
|
+
### Public methods
|
|
52
|
+
|
|
53
|
+
Exposed via template ref:
|
|
54
|
+
|
|
55
|
+
| Method | Description |
|
|
56
|
+
| :--- | :--- |
|
|
57
|
+
| `startEdit()` | Enter rename mode |
|
|
58
|
+
| `save()` / `commit()` | Commit the draft (`create` or `save`) |
|
|
59
|
+
| `cancel()` | Discard the draft / cancel creation |
|
|
60
|
+
| `focus()` | Focus the input, or start editing when allowed |
|
|
61
|
+
|
|
62
|
+
### Permissions
|
|
63
|
+
|
|
64
|
+
Keep these independent:
|
|
65
|
+
|
|
66
|
+
| Flag | Controls |
|
|
67
|
+
| :--- | :--- |
|
|
68
|
+
| `editable` | Title rename |
|
|
69
|
+
| `canChangeIcon` | Icon picker |
|
|
70
|
+
| `canDelete` | Delete action |
|
|
71
|
+
| `disabled` / `readonly` | Block interactions globally |
|
|
72
|
+
|
|
73
|
+
### Creation mode
|
|
74
|
+
|
|
75
|
+
```vue
|
|
76
|
+
<script setup lang="ts">
|
|
77
|
+
import { ref } from 'vue'
|
|
78
|
+
import { EditableTitle } from 'vlite3'
|
|
79
|
+
|
|
80
|
+
const isCreating = ref(false)
|
|
81
|
+
const newName = ref('')
|
|
82
|
+
const newIcon = ref('lucide:box')
|
|
83
|
+
|
|
84
|
+
function startCreate() {
|
|
85
|
+
if (isCreating.value) return // one blank editor at a time
|
|
86
|
+
newName.value = ''
|
|
87
|
+
isCreating.value = true
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function onCreate(name: string) {
|
|
91
|
+
// Persist new item — icon is already on newIcon via v-model:icon
|
|
92
|
+
console.log(name, newIcon.value)
|
|
93
|
+
isCreating.value = false
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function onCancelCreate() {
|
|
97
|
+
isCreating.value = false
|
|
98
|
+
}
|
|
99
|
+
</script>
|
|
100
|
+
|
|
101
|
+
<template>
|
|
102
|
+
<button type="button" @click="startCreate">+</button>
|
|
103
|
+
|
|
104
|
+
<EditableTitle
|
|
105
|
+
v-if="isCreating"
|
|
106
|
+
create
|
|
107
|
+
v-model="newName"
|
|
108
|
+
v-model:icon="newIcon"
|
|
109
|
+
placeholder="Enter name..."
|
|
110
|
+
@create="onCreate"
|
|
111
|
+
@cancel="onCancelCreate" />
|
|
112
|
+
</template>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Behaviour:
|
|
116
|
+
|
|
117
|
+
- Mounts already editing and focused.
|
|
118
|
+
- **Enter** emits `create` when the trimmed title is non-empty.
|
|
119
|
+
- **Escape** emits `cancel` (parent removes the temporary row).
|
|
120
|
+
- Empty blur (with `saveOnBlur`) cancels creation; non-empty blur creates.
|
|
121
|
+
- Empty Enter does **not** create — the field stays open.
|
|
122
|
+
- Opening `IconPicker` does not accidentally commit/cancel via blur.
|
|
123
|
+
|
|
124
|
+
### Rename + icon + delete
|
|
125
|
+
|
|
126
|
+
```vue
|
|
127
|
+
<EditableTitle
|
|
128
|
+
v-model="project.name"
|
|
129
|
+
v-model:icon="project.icon"
|
|
130
|
+
variant="transparent"
|
|
131
|
+
size="sm"
|
|
132
|
+
:can-delete="projects.length > 1"
|
|
133
|
+
@save="(name) => renameProject(project.id, name)"
|
|
134
|
+
@update:icon="(icon) => updateIcon(project.id, icon)"
|
|
135
|
+
@delete="requestDelete(project.id)" />
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
`EditableTitle` emits `delete` only — keep confirmation modals and API calls in the consumer.
|
|
139
|
+
|
|
140
|
+
### Editing behaviour (rename)
|
|
141
|
+
|
|
142
|
+
- Click **Edit** (or `startEdit()` / `focus()`) to rename; existing title is selected.
|
|
143
|
+
- While renaming, Edit is hidden (layout reserved); Delete stays available when `canDelete`.
|
|
144
|
+
- **Enter** / blur (`saveOnBlur`) commits via `save` / `change`.
|
|
145
|
+
- **Escape** restores the previous title and emits `cancel`.
|
|
146
|
+
- Whitespace-only drafts do not wipe a valid title.
|
|
147
|
+
|
|
148
|
+
### Layout
|
|
149
|
+
|
|
150
|
+
```text
|
|
151
|
+
[Icon / IconPicker] [Flexible Title] [Edit] [Delete]
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Creation mode:
|
|
155
|
+
|
|
156
|
+
```text
|
|
157
|
+
[Icon / IconPicker] [Focused New Title Input]
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Long titles truncate; action slots are reserved so hover reveal never shifts the title. Icon picker / edit / delete clicks use `stopPropagation` so parent row navigation is not triggered.
|
|
161
|
+
|
|
162
|
+
### Variants
|
|
163
|
+
|
|
164
|
+
| Value | Description |
|
|
165
|
+
| :--- | :--- |
|
|
166
|
+
| `background` | Soft filled surface with generous rounded corners |
|
|
167
|
+
| `transparent` | No container background — for list rows / headers |
|
|
168
|
+
|
|
169
|
+
### Accessibility
|
|
170
|
+
|
|
171
|
+
- Edit and Delete are real buttons with accessible names.
|
|
172
|
+
- Revealed on container hover **and** keyboard `:focus-within`.
|
|
173
|
+
- On touch / coarse pointers, actions stay visible.
|
|
174
|
+
- Icon picker trigger is a labeled button and does not start title editing.
|
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.17",
|
|
6
|
+
"generatedAt": "2026-08-09T00:13:48.772Z",
|
|
7
7
|
"files": {
|
|
8
8
|
"component-index.md": {
|
|
9
|
-
"sha256": "
|
|
9
|
+
"sha256": "1ca4fa9be2da9fae2b9b538a566920c7df9becd67227d4ff20a144dbfbc7b8d4"
|
|
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": "c05dc37be6a59abe8806341575d948be1b73056f3ebc541ebfe8e032a66fd779"
|
|
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';
|