@dynamicforms/vuetify-inputs 0.8.1 → 0.9.1

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
@@ -179,15 +179,22 @@ declare type __VLS_WithTemplateSlots_2<T, S> = T & {
179
179
  };
180
180
 
181
181
  export declare class Action extends Action_2<ActionBreakpointOptions> {
182
+ /** @see getRenderOptionsForBreakpoint, which answers the same for the value of any `Action` */
182
183
  getBreakpointValue(breakpoint: Ref<BreakpointNames>): ComputedRef<ActionRenderOptions>;
183
184
  /** @see ActionRenderOptions.name */
184
185
  get name(): string | undefined;
185
- /** @see ActionRenderOptions.label */
186
- get label(): string | undefined;
186
+ /**
187
+ * The label as this action renders it: the text where {@link ActionRenderOptions.showLabel} states it is shown,
188
+ * and `undefined` where it is not. `label` is the base class's, and answers the text whatever the flag says.
189
+ */
190
+ get renderedLabel(): string | undefined;
187
191
  /** @see ActionRenderOptions.showLabel */
188
192
  get showLabel(): boolean | undefined;
189
- /** @see ActionRenderOptions.icon */
190
- get icon(): string | undefined;
193
+ /**
194
+ * The icon as this action renders it: the name where {@link ActionRenderOptions.showIcon} states it is shown,
195
+ * and `undefined` where it is not. `icon` is the base class's, and answers the name whatever the flag says.
196
+ */
197
+ get renderedIcon(): string | undefined;
191
198
  /** @see ActionRenderOptions.showIcon */
192
199
  get showIcon(): boolean | undefined;
193
200
  /** @see ActionRenderOptions.renderAs */
@@ -220,6 +227,12 @@ export declare namespace ActionDisplayStyle {
220
227
  }
221
228
 
222
229
  export declare interface ActionRenderOptions extends ActionValue {
230
+ /** The text of the action, rendered when {@link showLabel} is set and the text is not empty. `ActionValue`
231
+ * types this `unknown`, leaving what a label is to the rendering library; here it is a string. */
232
+ label?: string;
233
+ /** The icon of the action, a name `vue-cached-icon` resolves, rendered when {@link showIcon} is set and the
234
+ * name is not empty. Typed here for the same reason `label` is. */
235
+ icon?: string;
223
236
  /** Unique identifier for the action. Purely informational to `<df-actions>` itself - it is not used for
224
237
  * rendering - but by convention should match the key under which the action is registered in a
225
238
  * `FormActions` (`Record<string, Action>`) map passed to `@dynamicforms/vuetify-modal-form-kit`'s
@@ -267,7 +280,7 @@ export declare interface BaseProps<T = any> {
267
280
  helpText?: string;
268
281
  hint?: string;
269
282
  enabled?: boolean;
270
- visibility?: default_2.DisplayMode;
283
+ visibility?: default_2.DisplayMode | string;
271
284
  cssClass?: string;
272
285
  clearable?: boolean;
273
286
  passthroughAttrs?: Record<string, any>;
@@ -366,7 +379,9 @@ showAsGroup: "no" | "grouped" | "grouped-no-borders";
366
379
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
367
380
 
368
381
  declare interface DfActionsProps {
369
- actions: MaybeRef<Action[]>;
382
+ /** The actions to draw, this library's `Action` or a bare `@dynamicforms/vue-forms` one: what each button
383
+ * renders as is read off the action's value, and a value stating nothing renders as the defaults. */
384
+ actions: MaybeRef<Action_2[]>;
370
385
  buttonSize?: string | number;
371
386
  showAsGroup?: ShowAsGroup;
372
387
  }
@@ -625,6 +640,17 @@ export declare type FileProgressCallback = (loaded: number, total: number) => vo
625
640
 
626
641
  export declare function getBreakpointName(dp: ReturnType<typeof useDisplay>): BreakpointNames;
627
642
 
643
+ /**
644
+ * What one action renders as at `breakpoint`, read off the value of any `Action`. The members
645
+ * `ActionRenderOptions` adds over `ActionValue` are taken where the value carries them and defaulted where it does
646
+ * not, so an action holding nothing but a label - which is all a `@dynamicforms/vue-forms` `Action` declares -
647
+ * renders as a button showing that label.
648
+ *
649
+ * `label` and `icon` come back only where the matching flag says they are shown, and the flags come back false
650
+ * where there is no text or name to show, so a caller renders each member on its own flag and never on emptiness.
651
+ */
652
+ export declare function getRenderOptionsForBreakpoint(value: ActionValue, breakpoint: BreakpointNames): ActionRenderOptions;
653
+
628
654
  export declare const InputBase: __VLS_WithTemplateSlots_2<typeof __VLS_component_2, __VLS_TemplateResult_2["slots"]>;
629
655
 
630
656
  export declare class Label {
@@ -714,7 +740,7 @@ export declare function useInputBase<T = any>(props: BaseProps<T>, emit: BaseEmi
714
740
  }>;
715
741
  label: ComputedRef<Label>;
716
742
  touched: Ref<boolean, boolean>;
717
- density: FieldDensity;
743
+ density: ComputedRef<FieldDensity>;
718
744
  densityClass: ComputedRef<string>;
719
745
  vuetifyBindings: ComputedRef< {
720
746
  name: string | undefined;
@@ -773,3 +799,27 @@ export declare interface VuetifyInputsSettings {
773
799
  export declare const vuetifyInputsSettingsKey: unique symbol;
774
800
 
775
801
  export { }
802
+
803
+
804
+ /**
805
+ * The presentation an element carries for the components in this library.
806
+ *
807
+ * Every one of these is also a prop, and the prop wins where both state something: a call site is more specific
808
+ * than the element it renders. What the element carries is what a form declared in code says about itself, so a
809
+ * field that names its own label needs no attribute at the tag that draws it.
810
+ *
811
+ * `Extras` is @dynamicforms/vue-forms' augmentation point for exactly this, so these properties are typed on every
812
+ * element in an application that installs this library, the fields written inline in a `Group` declaration
813
+ * included.
814
+ */
815
+ declare module '@dynamicforms/vue-forms' {
816
+ interface Extras {
817
+ label?: string | Label | MdString;
818
+ placeholder?: string;
819
+ helpText?: string;
820
+ hint?: string;
821
+ cssClass?: string;
822
+ density?: FieldDensity;
823
+ variant?: FieldVariant;
824
+ }
825
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dynamicforms/vuetify-inputs",
3
3
  "private": false,
4
- "version": "0.8.1",
4
+ "version": "0.9.1",
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",
@@ -12,6 +12,7 @@
12
12
  "types": "./dist/index.d.ts",
13
13
  "exports": {
14
14
  ".": {
15
+ "types": "./dist/index.d.ts",
15
16
  "require": "./dist/dynamicforms-vuetify-inputs.umd.cjs",
16
17
  "import": "./dist/dynamicforms-vuetify-inputs.js"
17
18
  },
@@ -42,6 +43,9 @@
42
43
  "material-design"
43
44
  ],
44
45
  "license": "MIT",
46
+ "engines": {
47
+ "node": ">=22"
48
+ },
45
49
  "homepage": "https://docs.velis.si/dynamicforms/vuetify-inputs",
46
50
  "repository": {
47
51
  "type": "git",
@@ -52,15 +56,15 @@
52
56
  },
53
57
  "peerDependencies": {
54
58
  "@ckeditor/ckeditor5-vue": "^7.0.0",
55
- "@dynamicforms/vue-forms": "^0.6.0",
59
+ "@dynamicforms/vue-forms": "^0.17.0",
56
60
  "@mdi/font": "^7.4.47",
57
61
  "ckeditor5": "^43.0.0",
58
62
  "date-fns": "^4.1.0",
59
63
  "lodash-es": "^4.17.12",
60
- "vue": "^3.4",
64
+ "vitepress-plugin-crosslinks": "^1.0.0",
65
+ "vue": "^3.5.2",
61
66
  "vue-cached-icon": "^3.0.3",
62
67
  "vue-markdown-render": "^2.2.1",
63
- "vitepress-plugin-crosslinks": "^1.0.0",
64
68
  "vuetify": "^3.9"
65
69
  },
66
70
  "devDependencies": {
@@ -73,13 +77,13 @@
73
77
  "@vue/tsconfig": "^0.7.0",
74
78
  "eslint-config-velis": "^2.0.12",
75
79
  "jsdom": "^26.0.0",
80
+ "markdown-it-attrs": "^4.3.1",
76
81
  "rollup-plugin-visualizer": "^5.14.0",
77
82
  "typescript": "^5",
78
83
  "vite": "^7",
79
84
  "vite-plugin-dts": "^4",
80
85
  "vite-plugin-eslint": "^1.8.1",
81
86
  "vitest": "^3",
82
- "vue-tsc": "^2",
83
- "markdown-it-attrs": "^4.3.1"
87
+ "vue-tsc": "^2"
84
88
  }
85
89
  }
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.