@dynamicforms/vuetify-inputs 0.8.1 → 0.9.0
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/dist/dynamicforms-vuetify-inputs.css +1 -1
- package/dist/dynamicforms-vuetify-inputs.js +1060 -1020
- package/dist/dynamicforms-vuetify-inputs.js.map +1 -1
- package/dist/dynamicforms-vuetify-inputs.umd.cjs +1 -1
- package/dist/dynamicforms-vuetify-inputs.umd.cjs.map +1 -1
- package/dist/index.d.ts +42 -6
- package/package.json +9 -6
- package/readme.md +48 -13
package/dist/index.d.ts
CHANGED
|
@@ -182,12 +182,18 @@ export declare class Action extends Action_2<ActionBreakpointOptions> {
|
|
|
182
182
|
getBreakpointValue(breakpoint: Ref<BreakpointNames>): ComputedRef<ActionRenderOptions>;
|
|
183
183
|
/** @see ActionRenderOptions.name */
|
|
184
184
|
get name(): string | undefined;
|
|
185
|
-
/**
|
|
186
|
-
|
|
185
|
+
/**
|
|
186
|
+
* The label as this action renders it: the text where {@link ActionRenderOptions.showLabel} states it is shown,
|
|
187
|
+
* and `undefined` where it is not. `label` is the base class's, and answers the text whatever the flag says.
|
|
188
|
+
*/
|
|
189
|
+
get renderedLabel(): string | undefined;
|
|
187
190
|
/** @see ActionRenderOptions.showLabel */
|
|
188
191
|
get showLabel(): boolean | undefined;
|
|
189
|
-
/**
|
|
190
|
-
|
|
192
|
+
/**
|
|
193
|
+
* The icon as this action renders it: the name where {@link ActionRenderOptions.showIcon} states it is shown,
|
|
194
|
+
* and `undefined` where it is not. `icon` is the base class's, and answers the name whatever the flag says.
|
|
195
|
+
*/
|
|
196
|
+
get renderedIcon(): string | undefined;
|
|
191
197
|
/** @see ActionRenderOptions.showIcon */
|
|
192
198
|
get showIcon(): boolean | undefined;
|
|
193
199
|
/** @see ActionRenderOptions.renderAs */
|
|
@@ -220,6 +226,12 @@ export declare namespace ActionDisplayStyle {
|
|
|
220
226
|
}
|
|
221
227
|
|
|
222
228
|
export declare interface ActionRenderOptions extends ActionValue {
|
|
229
|
+
/** The text of the action, rendered when {@link showLabel} is set and the text is not empty. `ActionValue`
|
|
230
|
+
* types this `unknown`, leaving what a label is to the rendering library; here it is a string. */
|
|
231
|
+
label?: string;
|
|
232
|
+
/** The icon of the action, a name `vue-cached-icon` resolves, rendered when {@link showIcon} is set and the
|
|
233
|
+
* name is not empty. Typed here for the same reason `label` is. */
|
|
234
|
+
icon?: string;
|
|
223
235
|
/** Unique identifier for the action. Purely informational to `<df-actions>` itself - it is not used for
|
|
224
236
|
* rendering - but by convention should match the key under which the action is registered in a
|
|
225
237
|
* `FormActions` (`Record<string, Action>`) map passed to `@dynamicforms/vuetify-modal-form-kit`'s
|
|
@@ -267,7 +279,7 @@ export declare interface BaseProps<T = any> {
|
|
|
267
279
|
helpText?: string;
|
|
268
280
|
hint?: string;
|
|
269
281
|
enabled?: boolean;
|
|
270
|
-
visibility?: default_2.DisplayMode;
|
|
282
|
+
visibility?: default_2.DisplayMode | string;
|
|
271
283
|
cssClass?: string;
|
|
272
284
|
clearable?: boolean;
|
|
273
285
|
passthroughAttrs?: Record<string, any>;
|
|
@@ -714,7 +726,7 @@ export declare function useInputBase<T = any>(props: BaseProps<T>, emit: BaseEmi
|
|
|
714
726
|
}>;
|
|
715
727
|
label: ComputedRef<Label>;
|
|
716
728
|
touched: Ref<boolean, boolean>;
|
|
717
|
-
density: FieldDensity
|
|
729
|
+
density: ComputedRef<FieldDensity>;
|
|
718
730
|
densityClass: ComputedRef<string>;
|
|
719
731
|
vuetifyBindings: ComputedRef< {
|
|
720
732
|
name: string | undefined;
|
|
@@ -773,3 +785,27 @@ export declare interface VuetifyInputsSettings {
|
|
|
773
785
|
export declare const vuetifyInputsSettingsKey: unique symbol;
|
|
774
786
|
|
|
775
787
|
export { }
|
|
788
|
+
|
|
789
|
+
|
|
790
|
+
/**
|
|
791
|
+
* The presentation an element carries for the components in this library.
|
|
792
|
+
*
|
|
793
|
+
* Every one of these is also a prop, and the prop wins where both state something: a call site is more specific
|
|
794
|
+
* than the element it renders. What the element carries is what a form declared in code says about itself, so a
|
|
795
|
+
* field that names its own label needs no attribute at the tag that draws it.
|
|
796
|
+
*
|
|
797
|
+
* `Extras` is @dynamicforms/vue-forms' augmentation point for exactly this, so these properties are typed on every
|
|
798
|
+
* element in an application that installs this library, the fields written inline in a `Group` declaration
|
|
799
|
+
* included.
|
|
800
|
+
*/
|
|
801
|
+
declare module '@dynamicforms/vue-forms' {
|
|
802
|
+
interface Extras {
|
|
803
|
+
label?: string | Label | MdString;
|
|
804
|
+
placeholder?: string;
|
|
805
|
+
helpText?: string;
|
|
806
|
+
hint?: string;
|
|
807
|
+
cssClass?: string;
|
|
808
|
+
density?: FieldDensity;
|
|
809
|
+
variant?: FieldVariant;
|
|
810
|
+
}
|
|
811
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamicforms/vuetify-inputs",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.9.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Vuetify input components with guaranteed visual consistency across all form fields — unified density/variant system, globally configurable, with inline mode for table cells. Built for @dynamicforms/vue-forms.",
|
|
7
7
|
"author": "Jure Erznožnik",
|
|
@@ -42,6 +42,9 @@
|
|
|
42
42
|
"material-design"
|
|
43
43
|
],
|
|
44
44
|
"license": "MIT",
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=22"
|
|
47
|
+
},
|
|
45
48
|
"homepage": "https://docs.velis.si/dynamicforms/vuetify-inputs",
|
|
46
49
|
"repository": {
|
|
47
50
|
"type": "git",
|
|
@@ -52,15 +55,15 @@
|
|
|
52
55
|
},
|
|
53
56
|
"peerDependencies": {
|
|
54
57
|
"@ckeditor/ckeditor5-vue": "^7.0.0",
|
|
55
|
-
"@dynamicforms/vue-forms": "^0.
|
|
58
|
+
"@dynamicforms/vue-forms": "^0.17.0",
|
|
56
59
|
"@mdi/font": "^7.4.47",
|
|
57
60
|
"ckeditor5": "^43.0.0",
|
|
58
61
|
"date-fns": "^4.1.0",
|
|
59
62
|
"lodash-es": "^4.17.12",
|
|
60
|
-
"
|
|
63
|
+
"vitepress-plugin-crosslinks": "^1.0.0",
|
|
64
|
+
"vue": "^3.5.2",
|
|
61
65
|
"vue-cached-icon": "^3.0.3",
|
|
62
66
|
"vue-markdown-render": "^2.2.1",
|
|
63
|
-
"vitepress-plugin-crosslinks": "^1.0.0",
|
|
64
67
|
"vuetify": "^3.9"
|
|
65
68
|
},
|
|
66
69
|
"devDependencies": {
|
|
@@ -73,13 +76,13 @@
|
|
|
73
76
|
"@vue/tsconfig": "^0.7.0",
|
|
74
77
|
"eslint-config-velis": "^2.0.12",
|
|
75
78
|
"jsdom": "^26.0.0",
|
|
79
|
+
"markdown-it-attrs": "^4.3.1",
|
|
76
80
|
"rollup-plugin-visualizer": "^5.14.0",
|
|
77
81
|
"typescript": "^5",
|
|
78
82
|
"vite": "^7",
|
|
79
83
|
"vite-plugin-dts": "^4",
|
|
80
84
|
"vite-plugin-eslint": "^1.8.1",
|
|
81
85
|
"vitest": "^3",
|
|
82
|
-
"vue-tsc": "^2"
|
|
83
|
-
"markdown-it-attrs": "^4.3.1"
|
|
86
|
+
"vue-tsc": "^2"
|
|
84
87
|
}
|
|
85
88
|
}
|
package/readme.md
CHANGED
|
@@ -4,9 +4,15 @@ Vuetify input components with guaranteed visual consistency across all form fiel
|
|
|
4
4
|
|
|
5
5
|
## Introduction
|
|
6
6
|
|
|
7
|
-
`@dynamicforms/vuetify-inputs` provides input components for data entry
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
`@dynamicforms/vuetify-inputs` provides input components for data entry, built so that every one of them matches
|
|
8
|
+
every other.
|
|
9
|
+
|
|
10
|
+
Hand a component an element of [@dynamicforms/vue-forms](https://github.com/dynamicforms/vue-forms) and that element
|
|
11
|
+
owns the value, the validation, the enabled state and the visibility, and the component draws what it holds. That is
|
|
12
|
+
what the library was built for, and it is not what it requires: every component works just as well with a plain
|
|
13
|
+
`v-model`, or with no binding at all. The visual consistency, the density and variant system and the inline mode for
|
|
14
|
+
table cells are the same either way, so the components are worth reaching for whether or not you want a form model
|
|
15
|
+
behind them.
|
|
10
16
|
|
|
11
17
|
## Design Goals
|
|
12
18
|
|
|
@@ -27,16 +33,44 @@ To achieve this, the library introduces a **density/variant system** that applie
|
|
|
27
33
|
Global defaults can be set once at application startup via `VuetifyInputsSettings` and propagated down through Vue's
|
|
28
34
|
provide/inject, so the entire application can switch density or variant with a single change.
|
|
29
35
|
|
|
30
|
-
The [density example](
|
|
31
|
-
and variant combination to verify alignment and
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
- **
|
|
37
|
-
|
|
38
|
-
- **
|
|
39
|
-
|
|
36
|
+
The [density example](https://docs.velis.si/dynamicforms/vuetify-inputs/examples/density.html) in the documentation
|
|
37
|
+
demonstrates all components rendered side-by-side across every density and variant combination to verify alignment and
|
|
38
|
+
consistent appearance.
|
|
39
|
+
|
|
40
|
+
## What matters most
|
|
41
|
+
|
|
42
|
+
- **Every field matches every other**: one shared base, so a row mixing a text field, a select, a checkbox and a
|
|
43
|
+
date picker comes out aligned with no per-component tweaking
|
|
44
|
+
- **A density that fits a table cell**: `default`, `comfortable` and `compact` are Vuetify's; `inline` is this
|
|
45
|
+
library's own, and strips a field of its decoration until it fits inside a cell
|
|
46
|
+
- **Set the look once, override anywhere**: density and variant are read from the prop, then the field, then a
|
|
47
|
+
`provide` from any ancestor, then the plugin defaults — most specific first
|
|
48
|
+
- **The field carries its own presentation**: a `@dynamicforms/vue-forms` field holds the label, hint, placeholder,
|
|
49
|
+
css class, density and variant it is drawn with, so a form declared in code needs no presentation attributes on
|
|
50
|
+
the tags that draw it
|
|
51
|
+
|
|
52
|
+
## Everything else it does
|
|
53
|
+
|
|
54
|
+
- **Ten components**: `df-input`, `df-text-area`, `df-select`, `df-checkbox`, `df-color`, `df-date-time`, `df-file`,
|
|
55
|
+
`df-rtf-editor`, `df-actions` and `df-input-hint`
|
|
56
|
+
- **A control, a v-model, or neither**: a bound element owns the value, validity, touched, enabled and visibility;
|
|
57
|
+
`v-model` reports changes to the parent; neither keeps the value internally
|
|
58
|
+
- **Errors, hints and help text** in one row, rendered through vue-forms' `MessagesWidget`, so an error may be
|
|
59
|
+
plain text, markdown or a component of its own
|
|
60
|
+
- **Labels with icons and markdown**, through the `Label` class and `MdString`
|
|
61
|
+
- **Visibility through `DisplayMode`** — `FULL`, `HIDDEN`, `INVISIBLE`, `SUPPRESS` — and enablement that follows the
|
|
62
|
+
containing section
|
|
63
|
+
- **`passthroughAttrs`**: any prop of the underlying Vuetify component, without this library declaring it
|
|
64
|
+
- **Actions**: the `Action` class with render options, `defaultConfirm` / `defaultReject`, the ready-made
|
|
65
|
+
close/yes/no factories, and per-breakpoint render options from `xs` to `xl`
|
|
66
|
+
- **Selection**: static choices or an async `fetchChoices`, single or multiple, chips with icons, free values with
|
|
67
|
+
`allowTags`
|
|
68
|
+
- **Uploads**: a `FileComms` object with upload progress, delete and a periodic touch
|
|
69
|
+
- **Rich text**: a configured CKEditor 5 inside the same field frame as every other input
|
|
70
|
+
- **Localisable**: `translateStrings()` replaces the library's own strings, `setCkEditorLanguage()` sets the RTF
|
|
71
|
+
editor's interface language, and `DateTimeLocaleConfig` sets the date-fns locale dates are formatted and parsed
|
|
72
|
+
with
|
|
73
|
+
- **TypeScript**: every component's props are an exported interface, and the definitions ship with the build
|
|
40
74
|
|
|
41
75
|
## Installation
|
|
42
76
|
|
|
@@ -126,6 +160,7 @@ Detailed documentation is available at [https://docs.velis.si/dynamicforms/vueti
|
|
|
126
160
|
## Available Components
|
|
127
161
|
|
|
128
162
|
- **InputBase**: The base component for all input elements
|
|
163
|
+
- **DfLabel**: Renders a label - plain text, markdown or an icon - the way every input renders its own
|
|
129
164
|
- **df-actions**: An actions group.
|
|
130
165
|
- **df-checkbox**: A checkbox component.
|
|
131
166
|
- **df-color**: A color input.
|