@dynamicforms/vuetify-inputs 0.8.0 → 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/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
- /** @see ActionRenderOptions.label */
186
- get label(): string | undefined;
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
- /** @see ActionRenderOptions.icon */
190
- get icon(): string | undefined;
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>;
@@ -651,6 +663,13 @@ export declare abstract class ResponsiveRenderOptions<T extends Record<string, a
651
663
  protected readonly _value: BreakpointsJSON<T>;
652
664
  constructor(data?: BreakpointsJSON<T>);
653
665
  getOptionsForBreakpoint(breakpoint: BreakpointNames): T;
666
+ /**
667
+ * Normalizes one breakpoint's options. The merge reads `null` and `undefined` as "this breakpoint says
668
+ * nothing about that field", so a field the breakpoint does not state has to come back as `undefined` rather
669
+ * than as an empty value - an empty array or string returned here reads as a breakpoint deliberately emptying
670
+ * what it inherited. The value returned for `defaultIfEmpty` carries every field the class merges, since the
671
+ * field set is taken from it.
672
+ */
654
673
  protected abstract cleanBreakpoint(bp?: T, defaultIfEmpty?: boolean): T | null;
655
674
  }
656
675
 
@@ -707,7 +726,7 @@ export declare function useInputBase<T = any>(props: BaseProps<T>, emit: BaseEmi
707
726
  }>;
708
727
  label: ComputedRef<Label>;
709
728
  touched: Ref<boolean, boolean>;
710
- density: FieldDensity;
729
+ density: ComputedRef<FieldDensity>;
711
730
  densityClass: ComputedRef<string>;
712
731
  vuetifyBindings: ComputedRef< {
713
732
  name: string | undefined;
@@ -766,3 +785,27 @@ export declare interface VuetifyInputsSettings {
766
785
  export declare const vuetifyInputsSettingsKey: unique symbol;
767
786
 
768
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.8.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.6.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
- "vue": "^3.4",
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 that will be stored in form data. It is the
8
- visual implementation of logical concepts from
9
- [@dynamicforms/vue-forms](https://github.com/dynamicforms/vue-forms).
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](/docs/examples/density.md) in the documentation demonstrates all components rendered side-by-side across every density
31
- and variant combination to verify alignment and consistent appearance.
32
-
33
- ## Features
34
-
35
- - **DynamicForms Integration**: Seamlessly works with `@dynamicforms/vue-forms` for state management and validation
36
- - **Vuetify Based**: Built on top of Vuetify components for beautiful Material Design styling
37
- - **Reactive**: Full Vue reactivity support with both v-model and DynamicForms Field controls
38
- - **TypeScript Support**: Comprehensive type definitions for excellent developer experience
39
- - **Highly opinionated**: Opinionated to ensure uniform look throughout the application.
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.