vlite3 1.5.15 → 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 +3 -3
- package/components/Clock/Clock.vue.d.ts +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/Form/{AccordionView.vue.js → AccordionView2.vue.js} +1 -1
- package/components/Form/index2.vue.js +1 -1
- package/components/Input.vue.d.ts +11 -15
- package/components/Input.vue.js +160 -125
- 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 +3 -3
- 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 +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
|
@@ -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 | Inline-renamable title row with icon + edit action | [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** | 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) |
|
|
@@ -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,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';
|