@dynamicforms/vuetify-inputs 0.9.1 → 0.9.2

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
@@ -1,8 +1,11 @@
1
1
  import { Action as Action_2 } from '@dynamicforms/vue-forms';
2
2
  import { ActionValue } from '@dynamicforms/vue-forms';
3
+ import { AllowedComponentProps } from 'vue';
3
4
  import { App } from 'vue';
4
5
  import { ClassTypes } from '@dynamicforms/vue-forms';
5
6
  import { ClassValue } from '../../node_modules/vuetify/lib/composables/component';
7
+ import { ComponentCustomProps } from 'vue';
8
+ import { ComponentOptionsBase } from 'vue';
6
9
  import { ComponentOptionsMixin } from 'vue';
7
10
  import { ComponentProvideOptions } from 'vue';
8
11
  import { ComputedRef } from 'vue';
@@ -50,6 +53,7 @@ import { VImg } from 'vuetify/components/VImg';
50
53
  import { VInput } from 'vuetify/components/VInput';
51
54
  import { VListItem } from 'vuetify/components/VList';
52
55
  import { VMenu } from 'vuetify/components/VMenu';
56
+ import { VNodeProps } from 'vue';
53
57
  import { VNumberInput } from 'vuetify/components/VNumberInput';
54
58
  import { VProgressLinear } from 'vuetify/components/VProgressLinear';
55
59
  import { VRow } from 'vuetify/components/VGrid';
@@ -80,25 +84,17 @@ fetchChoices: SelectFetchChoices;
80
84
  dfSelectRef: unknown;
81
85
  }, any>;
82
86
 
83
- declare const __VLS_component_2: DefineComponent<__VLS_Props_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
87
+ declare const __VLS_component_2: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
84
88
  blur: () => any;
85
89
  "update:modelValue": (value: any) => any;
86
90
  "click:clear": () => any;
87
- }, string, PublicProps, Readonly<__VLS_Props_2> & Readonly<{
91
+ }, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
88
92
  onBlur?: (() => any) | undefined;
89
93
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
90
94
  "onClick:clear"?: (() => any) | undefined;
91
95
  }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
92
96
 
93
- declare type __VLS_Props = {
94
- data?: DefaultInputSlot & {
95
- label?: string | MdString;
96
- };
97
- label: Label;
98
- allowWrap?: boolean;
99
- };
100
-
101
- declare type __VLS_Props_2 = BaseProps & {
97
+ declare type __VLS_Props = BaseProps & {
102
98
  loading?: boolean;
103
99
  };
104
100
 
@@ -210,7 +206,14 @@ export declare class Action extends Action_2<ActionBreakpointOptions> {
210
206
  static noAction(data?: Partial<IFieldConstructorParams<ActionBreakpointOptions>>): Action;
211
207
  }
212
208
 
213
- export declare type ActionBreakpointOptions = BreakpointsJSON<ActionRenderOptions>;
209
+ export declare type ActionBreakpointOptions = BreakpointsJSON<ActionRenderOptions, ActionBreakpointRenderOptions>;
210
+
211
+ /**
212
+ * What one breakpoint of an action's value may state: the members that describe how the action is drawn.
213
+ * `name`, `defaultConfirm` and `defaultReject` are not among them - which key a modal resolves with, and which
214
+ * key fires the action, are properties of the action itself and do not depend on the width of the screen.
215
+ */
216
+ export declare type ActionBreakpointRenderOptions = Omit<ActionRenderOptions, 'name' | 'defaultConfirm' | 'defaultReject'>;
214
217
 
215
218
  /**
216
219
  * DisplayMode enum provides an enumeration for supported ways of rendering a particular object in the DOM
@@ -290,7 +293,12 @@ export declare interface BaseProps<T = any> {
290
293
 
291
294
  export declare type BreakpointNames = (typeof responsiveBreakpoints)[number];
292
295
 
293
- export declare type BreakpointsJSON<T extends Record<string, any>> = T & Partial<Record<BreakpointNames, T>>;
296
+ /**
297
+ * A set of options and the per-breakpoint sets that restate parts of it. `B` is what a breakpoint may state,
298
+ * and defaults to the whole of `T`; a subclass narrows it where a member belongs to the object as a whole rather
299
+ * than to one screen width.
300
+ */
301
+ export declare type BreakpointsJSON<T extends Record<string, any>, B extends Record<string, any> = T> = T & Partial<Record<BreakpointNames, B>>;
294
302
 
295
303
  export declare const ckEditorLanguage: {
296
304
  language: string;
@@ -478,6 +486,8 @@ export declare namespace DfInputComponentProps {
478
486
  DfDateTimeProps,
479
487
  DfFileProps,
480
488
  DfInputProps,
489
+ DfInputHintProps,
490
+ DfLabelProps,
481
491
  DfRtfEditorProps,
482
492
  DfSelectProps,
483
493
  DfTextAreaProps
@@ -493,19 +503,245 @@ export declare namespace DfInputComponents {
493
503
  DfFile,
494
504
  DfInput,
495
505
  DfInputHint,
506
+ DfLabel,
496
507
  DfRtfEditor,
497
508
  DfSelect,
498
509
  DfTextArea
499
510
  }
500
511
  }
501
512
 
502
- export declare const DfInputHint: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {
513
+ /**
514
+ * Every component this library draws with, keyed by the tag a layout names it by.
515
+ *
516
+ * A rendering layer that resolves a component by name out of a map - `@dynamicforms/vuetify-modal-form-kit`'s
517
+ * `<component-render>` is one - is handed this instead of keeping a list of its own, which would have to be
518
+ * extended whenever this package gains a component and would silently render nothing until it was.
519
+ *
520
+ * The keys are the kebab-case of the export names, so a tag names the same component whether it is looked up
521
+ * here or left to Vue's own resolver after `DynamicFormsInputs` has registered the components globally.
522
+ */
523
+ export declare const dfInputComponentsByTag: {
524
+ readonly 'df-actions': DefineComponent<DfActionsProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<DfActionsProps> & Readonly<{}>, {
525
+ buttonSize: string | number;
526
+ showAsGroup: "no" | "grouped" | "grouped-no-borders";
527
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
528
+ readonly 'df-checkbox': DefineComponent<DfCheckboxProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
529
+ "update:modelValue": (value: any) => any;
530
+ "click:clear": () => any;
531
+ }, string, PublicProps, Readonly<DfCheckboxProps> & Readonly<{
532
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
533
+ "onClick:clear"?: (() => any) | undefined;
534
+ }>, {
535
+ enabled: boolean;
536
+ clearable: boolean;
537
+ allowNull: boolean;
538
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
539
+ readonly 'df-color': DefineComponent<DfColorProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
540
+ "update:modelValue": (value: any) => any;
541
+ "click:clear": () => any;
542
+ }, string, PublicProps, Readonly<DfColorProps> & Readonly<{
543
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
544
+ "onClick:clear"?: (() => any) | undefined;
545
+ }>, {
546
+ enabled: boolean;
547
+ clearable: boolean;
548
+ allowNull: boolean;
549
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
550
+ readonly 'df-date-time': DefineComponent<DfDateTimeProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
551
+ "update:modelValue": (value: any) => any;
552
+ "click:clear": () => any;
553
+ }, string, PublicProps, Readonly<DfDateTimeProps> & Readonly<{
554
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
555
+ "onClick:clear"?: (() => any) | undefined;
556
+ }>, {
557
+ enabled: boolean;
558
+ clearable: boolean;
559
+ inputType: "datetime" | "date" | "time";
560
+ displayFormatDate: string;
561
+ displayFormatTime: string;
562
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
563
+ readonly 'df-file': DefineComponent<DfFileProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
564
+ "update:modelValue": (value: any) => any;
565
+ "click:clear": () => any;
566
+ }, string, PublicProps, Readonly<DfFileProps> & Readonly<{
567
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
568
+ "onClick:clear"?: (() => any) | undefined;
569
+ }>, {
570
+ enabled: boolean;
571
+ clearable: boolean;
572
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
573
+ readonly 'df-input': DefineComponent<DfInputProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
574
+ "update:modelValue": (value: any) => any;
575
+ "click:clear": () => any;
576
+ }, string, PublicProps, Readonly<DfInputProps> & Readonly<{
577
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
578
+ "onClick:clear"?: (() => any) | undefined;
579
+ }>, {
580
+ enabled: boolean;
581
+ clearable: boolean;
582
+ inputType: "text" | "password" | "email" | "url" | "number";
583
+ precision: number | null;
584
+ step: number;
585
+ min: number;
586
+ max: number;
587
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
588
+ readonly 'df-input-hint': DefineComponent<DfInputHintProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<DfInputHintProps> & Readonly<{}>, {
589
+ errors: string | ValidationError[];
590
+ message: string | ValidationError[];
591
+ errorClasses: ClassTypes;
592
+ messageClasses: ClassTypes;
593
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
594
+ readonly 'df-label': DefineComponent<DfLabelProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<DfLabelProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
595
+ readonly 'df-rtf-editor': DefineComponent<DfRtfEditorProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
596
+ "update:modelValue": (value: any) => any;
597
+ "click:clear": () => any;
598
+ }, string, PublicProps, Readonly<DfRtfEditorProps> & Readonly<{
599
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
600
+ "onClick:clear"?: (() => any) | undefined;
601
+ }>, {
602
+ minHeight: string;
603
+ enabled: boolean;
604
+ clearable: boolean;
605
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {
606
+ $editor: CreateComponentPublicInstanceWithMixins<Readonly<{
607
+ modelValue?: string;
608
+ minHeight?: string;
609
+ disabled?: boolean;
610
+ }> & Readonly<{
611
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
612
+ }>, {
613
+ onEditorReady: (editorReady: Editor) => void;
614
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
615
+ "update:modelValue": (value: string) => any;
616
+ }, PublicProps, {
617
+ minHeight: string;
618
+ modelValue: string;
619
+ disabled: boolean;
620
+ }, false, {}, {}, GlobalComponents, GlobalDirectives, string, {
621
+ editorElement: HTMLDivElement;
622
+ }, HTMLDivElement, ComponentProvideOptions, {
623
+ P: {};
624
+ B: {};
625
+ D: {};
626
+ C: {};
627
+ M: {};
628
+ Defaults: {};
629
+ }, Readonly<{
630
+ modelValue?: string;
631
+ minHeight?: string;
632
+ disabled?: boolean;
633
+ }> & Readonly<{
634
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
635
+ }>, {
636
+ onEditorReady: (editorReady: Editor) => void;
637
+ }, {}, {}, {}, {
638
+ minHeight: string;
639
+ modelValue: string;
640
+ disabled: boolean;
641
+ }> | null;
642
+ }, any>;
643
+ readonly 'df-select': {
644
+ new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly<DfSelectProps> & Readonly<{
645
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
646
+ "onClick:clear"?: (() => any) | undefined;
647
+ "onUpdate:modelValueDisplay"?: ((value: SelectChoice[]) => any) | undefined;
648
+ }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
649
+ "update:modelValue": (value: any) => any;
650
+ "click:clear": () => any;
651
+ "update:modelValueDisplay": (value: SelectChoice[]) => any;
652
+ }, PublicProps, {
653
+ enabled: boolean;
654
+ clearable: boolean;
655
+ allowNull: boolean;
656
+ choices: SelectChoice[];
657
+ multiple: boolean;
658
+ allowTags: boolean;
659
+ fetchChoices: SelectFetchChoices;
660
+ }, false, {}, {}, GlobalComponents, GlobalDirectives, string, {
661
+ dfSelectRef: unknown;
662
+ }, any, ComponentProvideOptions, {
663
+ P: {};
664
+ B: {};
665
+ D: {};
666
+ C: {};
667
+ M: {};
668
+ Defaults: {};
669
+ }, Readonly<DfSelectProps> & Readonly<{
670
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
671
+ "onClick:clear"?: (() => any) | undefined;
672
+ "onUpdate:modelValueDisplay"?: ((value: SelectChoice[]) => any) | undefined;
673
+ }>, {}, {}, {}, {}, {
674
+ enabled: boolean;
675
+ clearable: boolean;
676
+ allowNull: boolean;
677
+ choices: SelectChoice[];
678
+ multiple: boolean;
679
+ allowTags: boolean;
680
+ fetchChoices: SelectFetchChoices;
681
+ }>;
682
+ __isFragment?: never;
683
+ __isTeleport?: never;
684
+ __isSuspense?: never;
685
+ } & ComponentOptionsBase<Readonly<DfSelectProps> & Readonly<{
686
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
687
+ "onClick:clear"?: (() => any) | undefined;
688
+ "onUpdate:modelValueDisplay"?: ((value: SelectChoice[]) => any) | undefined;
689
+ }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
690
+ "update:modelValue": (value: any) => any;
691
+ "click:clear": () => any;
692
+ "update:modelValueDisplay": (value: SelectChoice[]) => any;
693
+ }, string, {
694
+ enabled: boolean;
695
+ clearable: boolean;
696
+ allowNull: boolean;
697
+ choices: SelectChoice[];
698
+ multiple: boolean;
699
+ allowTags: boolean;
700
+ fetchChoices: SelectFetchChoices;
701
+ }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
702
+ $slots: Readonly<{
703
+ 'append-inner'?: (props: any) => any;
704
+ 'prepend-inner'?: (props: any) => any;
705
+ }> & {
706
+ 'append-inner'?: (props: any) => any;
707
+ 'prepend-inner'?: (props: any) => any;
708
+ };
709
+ });
710
+ readonly 'df-text-area': DefineComponent<DfTextAreaProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
711
+ "update:modelValue": (value: any) => any;
712
+ "click:clear": () => any;
713
+ }, string, PublicProps, Readonly<DfTextAreaProps> & Readonly<{
714
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
715
+ "onClick:clear"?: (() => any) | undefined;
716
+ }>, {
717
+ enabled: boolean;
718
+ clearable: boolean;
719
+ rows: number;
720
+ maxRows: number;
721
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
722
+ };
723
+
724
+ /** The tags {@link dfInputComponentsByTag} answers for. */
725
+ export declare type DfInputComponentTag = keyof typeof dfInputComponentsByTag;
726
+
727
+ export declare const DfInputHint: DefineComponent<DfInputHintProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<DfInputHintProps> & Readonly<{}>, {
503
728
  errors: string | ValidationError[];
504
729
  message: string | ValidationError[];
505
730
  errorClasses: ClassTypes;
506
731
  messageClasses: ClassTypes;
507
732
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
508
733
 
734
+ declare interface DfInputHintProps {
735
+ /** The errors to render. Rendered in place of {@link message} whenever there is one. */
736
+ errors?: string | ValidationError[];
737
+ /** The message to render, shown while there is no error. */
738
+ message?: string | ValidationError[];
739
+ /** Classes for the rendered errors. Defaults to `text-error`. */
740
+ errorClasses?: ClassTypes;
741
+ /** Classes for the rendered message. Defaults to no class. */
742
+ messageClasses?: ClassTypes;
743
+ }
744
+
509
745
  declare interface DfInputProps extends BaseProps {
510
746
  inputType?: 'text' | 'password' | 'email' | 'url' | 'number';
511
747
  precision?: number | null;
@@ -514,7 +750,18 @@ declare interface DfInputProps extends BaseProps {
514
750
  max?: number;
515
751
  }
516
752
 
517
- export declare const DfLabel: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
753
+ export declare const DfLabel: DefineComponent<DfLabelProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<DfLabelProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
754
+
755
+ declare interface DfLabelProps {
756
+ /** The slot data Vuetify hands a `#label` slot. Where it is given, its `label` is what is rendered. */
757
+ data?: DefaultInputSlot & {
758
+ label?: string | MdString;
759
+ };
760
+ /** The label to render where no {@link data} is given: its text, and the icon it carries. */
761
+ label: Label;
762
+ /** Whether the label wraps over several lines. It is rendered on one line by default. */
763
+ allowWrap?: boolean;
764
+ }
518
765
 
519
766
  export declare const DfRtfEditor: DefineComponent<DfRtfEditorProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
520
767
  "update:modelValue": (value: any) => any;
@@ -660,13 +907,6 @@ export declare class Label {
660
907
  constructor(text: string, icon?: string | undefined, iconComponent?: string);
661
908
  }
662
909
 
663
- declare interface Props {
664
- errors?: string | ValidationError[];
665
- message?: string | ValidationError[];
666
- errorClasses?: ClassTypes;
667
- messageClasses?: ClassTypes;
668
- }
669
-
670
910
  export declare class ResponsiveActionRenderOptions extends ResponsiveRenderOptions<ActionRenderOptions> {
671
911
  protected cleanBreakpoint(bp?: ActionRenderOptions, defaultIfEmpty?: boolean): ActionRenderOptions | null;
672
912
  }
@@ -681,8 +921,7 @@ export declare abstract class ResponsiveRenderOptions<T extends Record<string, a
681
921
  * Normalizes one breakpoint's options. The merge reads `null` and `undefined` as "this breakpoint says
682
922
  * nothing about that field", so a field the breakpoint does not state has to come back as `undefined` rather
683
923
  * than as an empty value - an empty array or string returned here reads as a breakpoint deliberately emptying
684
- * what it inherited. The value returned for `defaultIfEmpty` carries every field the class merges, since the
685
- * field set is taken from it.
924
+ * what it inherited.
686
925
  */
687
926
  protected abstract cleanBreakpoint(bp?: T, defaultIfEmpty?: boolean): T | null;
688
927
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dynamicforms/vuetify-inputs",
3
3
  "private": false,
4
- "version": "0.9.1",
4
+ "version": "0.9.2",
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",