@dynamicforms/vuetify-inputs 0.12.1 → 0.13.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
@@ -2,8 +2,6 @@ import { Action as Action_2 } from '@dynamicforms/vue-forms';
2
2
  import { ActionValue } from '@dynamicforms/vue-forms';
3
3
  import { AllowedComponentProps } from 'vue';
4
4
  import { App } from 'vue';
5
- import { ClassTypes } from '@dynamicforms/vue-forms';
6
- import { ClassValue } from '../../node_modules/vuetify/lib/composables/component';
7
5
  import { ComponentCustomProps } from 'vue';
8
6
  import { ComponentOptionsBase } from 'vue';
9
7
  import { ComponentOptionsMixin } from 'vue';
@@ -12,10 +10,9 @@ import { ComputedRef } from 'vue';
12
10
  import { CreateComponentPublicInstanceWithMixins } from 'vue';
13
11
  import { Day } from 'date-fns';
14
12
  import { default as default_2 } from '@dynamicforms/vue-forms';
15
- import { DefaultInputSlot } from 'vuetify/lib/components/VField/VField';
16
13
  import { DefineComponent } from 'vue';
17
- import { Editor } from '../node_modules/@tiptap/vue-3/dist';
18
14
  import { Era } from 'date-fns';
15
+ import { ErrorDescription } from '@dynamicforms/vue-forms';
19
16
  import { FieldBase } from '@dynamicforms/vue-forms';
20
17
  import { FirstWeekContainsDate } from 'date-fns';
21
18
  import { FormatDistanceFn } from 'date-fns';
@@ -32,16 +29,19 @@ import { LocalizeFn } from 'date-fns';
32
29
  import { MatchFn } from 'date-fns';
33
30
  import { MaybeRef } from 'vue';
34
31
  import { MaybeRefOrGetter } from 'vue';
35
- import { MdString } from '@dynamicforms/vue-forms';
36
32
  import { Month } from 'date-fns';
37
33
  import { PublicProps } from 'vue';
38
34
  import { Quarter } from 'date-fns';
39
35
  import { Ref } from 'vue';
40
- import { TranslateStringsCallback } from '@dynamicforms/translatable';
36
+ import { TranslateFunction } from '@dynamicforms/translatable';
41
37
  import { useDisplay } from 'vuetify';
42
38
  import { ValidationError } from '@dynamicforms/vue-forms';
43
39
  import { VAutocomplete } from 'vuetify/components/VAutocomplete';
44
40
  import { VBtn } from 'vuetify/components/VBtn';
41
+ import { VBtnGroup } from 'vuetify/components/VBtnGroup';
42
+ import { VBtnToggle } from 'vuetify/components/VBtnToggle';
43
+ import { VCard } from 'vuetify/components/VCard';
44
+ import { VCardActions } from 'vuetify/components/VCard';
45
45
  import { VCheckbox } from 'vuetify/components/VCheckbox';
46
46
  import { VChip } from 'vuetify/components/VChip';
47
47
  import { VCol } from 'vuetify/components/VGrid';
@@ -49,12 +49,15 @@ import { VColorPicker } from 'vuetify/components/VColorPicker';
49
49
  import { VCombobox } from 'vuetify/components/VCombobox';
50
50
  import { VConfirmEdit } from 'vuetify/components/VConfirmEdit';
51
51
  import { VDatePicker } from 'vuetify/components/VDatePicker';
52
+ import { VDivider } from 'vuetify/components/VDivider';
52
53
  import { VField } from 'vuetify/components/VField';
53
54
  import { VFileInput } from 'vuetify/components/VFileInput';
54
55
  import { VIcon } from 'vuetify/components/VIcon';
55
56
  import { VImg } from 'vuetify/components/VImg';
56
57
  import { VInput } from 'vuetify/components/VInput';
58
+ import { VList } from 'vuetify/components/VList';
57
59
  import { VListItem } from 'vuetify/components/VList';
60
+ import { VListItemTitle } from 'vuetify/components/VList';
58
61
  import { VMenu } from 'vuetify/components/VMenu';
59
62
  import { VNodeProps } from 'vue';
60
63
  import { VNumberInput } from 'vuetify/components/VNumberInput';
@@ -88,13 +91,13 @@ dfSelectRef: unknown;
88
91
  }, any>;
89
92
 
90
93
  declare const __VLS_component_2: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
91
- blur: () => any;
92
94
  "update:modelValue": (value: any) => any;
93
95
  "click:clear": () => any;
96
+ blur: () => any;
94
97
  }, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
95
- onBlur?: (() => any) | undefined;
96
98
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
97
99
  "onClick:clear"?: (() => any) | undefined;
100
+ onBlur?: (() => any) | undefined;
98
101
  }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
99
102
 
100
103
  declare type __VLS_Props = BaseProps & {
@@ -118,44 +121,16 @@ declare function __VLS_template(): {
118
121
 
119
122
  declare function __VLS_template_2(): {
120
123
  attrs: Partial<{}>;
121
- slots: {
122
- default?(_: {
123
- props: Record<string, unknown> & {
124
- class?: ClassValue;
125
- };
126
- isActive: Ref<boolean>;
127
- isFocused: Ref<boolean>;
128
- iconColor: ComputedRef<string | undefined>;
129
- controlRef: Ref<HTMLElement | undefined>;
130
- focus: () => void;
131
- blur: () => void;
132
- }): any;
133
- loader?(_: {
134
- color: string | undefined;
135
- isActive: boolean;
136
- }): any;
137
- 'prepend-inner'?(_: {
138
- isActive: Ref<boolean>;
139
- isFocused: Ref<boolean>;
140
- iconColor: ComputedRef<string | undefined>;
141
- controlRef: Ref<HTMLElement | undefined>;
142
- focus: () => void;
143
- blur: () => void;
144
- }): any;
145
- prepend?(_: {
146
- id: ComputedRef<string>;
147
- messagesId: ComputedRef<string | undefined>;
148
- isDirty: ComputedRef<boolean>;
149
- isDisabled: ComputedRef<boolean>;
150
- isReadonly: ComputedRef<boolean>;
151
- isPristine: Ref<boolean>;
152
- isValid: ComputedRef<boolean | null>;
153
- isValidating: Ref<boolean>;
154
- hasDetails: Ref<boolean>;
155
- reset: () => void;
156
- resetValidation: () => void;
157
- validate: () => void;
158
- }): any;
124
+ slots: Readonly<{
125
+ default?(props: InputBaseSlotProps): any;
126
+ 'prepend-inner'?(props: Omit<InputBaseSlotProps, "props">): any;
127
+ loader?(props: Record<string, unknown>): any;
128
+ prepend?(props: Record<string, unknown>): any;
129
+ }> & {
130
+ default?(props: InputBaseSlotProps): any;
131
+ 'prepend-inner'?(props: Omit<InputBaseSlotProps, "props">): any;
132
+ loader?(props: Record<string, unknown>): any;
133
+ prepend?(props: Record<string, unknown>): any;
159
134
  };
160
135
  refs: {};
161
136
  rootEl: any;
@@ -179,7 +154,10 @@ declare type __VLS_WithTemplateSlots_2<T, S> = T & {
179
154
 
180
155
  export declare class Action extends Action_2<ActionBreakpointOptions> {
181
156
  /** @see getRenderOptionsForBreakpoint, which answers the same for the value of any `Action` */
182
- getBreakpointValue(breakpoint: Ref<BreakpointNames>): ComputedRef<ActionRenderOptions>;
157
+ getBreakpointValue(breakpoint: Ref<BreakpointNames>): ComputedRef<ResolvedActionRenderOptions>;
158
+ /** The label read: where the value holds a ref or a function, the string it gives now. */
159
+ get label(): string | undefined;
160
+ set label(newValue: ActionBreakpointOptions['label']);
183
161
  /** @see ActionRenderOptions.name */
184
162
  get name(): string | undefined;
185
163
  /**
@@ -198,10 +176,6 @@ export declare class Action extends Action_2<ActionBreakpointOptions> {
198
176
  get showIcon(): boolean | undefined;
199
177
  /** @see ActionRenderOptions.renderAs */
200
178
  get renderAs(): ActionDisplayStyle | undefined;
201
- /** @see ActionRenderOptions.defaultConfirm */
202
- get defaultConfirm(): boolean | undefined;
203
- /** @see ActionRenderOptions.defaultReject */
204
- get defaultReject(): boolean | undefined;
205
179
  /** @see ActionRenderOptions.passthroughAttrs */
206
180
  get passthroughAttrs(): Record<string, any> | undefined;
207
181
  static closeAction(data?: Partial<IFieldConstructorParams<ActionBreakpointOptions>>): Action;
@@ -228,8 +202,10 @@ export declare const actionDisplayStyles: readonly ActionDisplayStyle[];
228
202
 
229
203
  export declare interface ActionRenderOptions extends ActionValue {
230
204
  /** 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;
205
+ * types this `unknown`, leaving what a label is to the rendering library; here it is a string, a ref to one or a
206
+ * function returning one. A ref or a function is read while the action renders, so a label that follows the
207
+ * locale is `() => t('Save')`. */
208
+ label?: MaybeRefOrGetter<string>;
233
209
  /** The icon of the action, a name `vue-cached-icon` resolves, rendered when {@link showIcon} is set and the
234
210
  * name is not empty. Typed here for the same reason `label` is. */
235
211
  icon?: string;
@@ -273,8 +249,8 @@ export declare interface BaseEmits<T = any> {
273
249
  export declare interface BaseProps<T = any> {
274
250
  control?: default_2.FieldBase<T>;
275
251
  modelValue?: T;
276
- label?: string | Label | MdString;
277
- errors?: string[];
252
+ label?: RenderContentNonCallable | Label;
253
+ errors?: ErrorInput[];
278
254
  placeholder?: string;
279
255
  helpText?: string;
280
256
  hint?: string;
@@ -296,6 +272,10 @@ export declare type BreakpointNames = (typeof responsiveBreakpoints)[number];
296
272
  */
297
273
  export declare type BreakpointsJSON<T extends Record<string, any>, B extends Record<string, any> = T> = T & Partial<Record<BreakpointNames, B>>;
298
274
 
275
+ export declare type ClassType = string | string[] | Record<string, boolean>;
276
+
277
+ export declare type ClassTypes = ClassType | ClassType[];
278
+
299
279
  export declare const DateTimeLocaleConfig: {
300
280
  dateTimeLocale: Ref<{
301
281
  code: string;
@@ -373,6 +353,72 @@ export declare const defaultBaseProps: {
373
353
  /** What an action renders as where nothing states otherwise. */
374
354
  export declare const defaultDisplayStyle: ActionDisplayStyle;
375
355
 
356
+ declare const defaults: {
357
+ Yes: string;
358
+ No: string;
359
+ Close: string;
360
+ Cancel: string;
361
+ Ok: string;
362
+ Paragraph: string;
363
+ Heading1: string;
364
+ Heading2: string;
365
+ Heading3: string;
366
+ Heading4: string;
367
+ Heading5: string;
368
+ Heading6: string;
369
+ Downloadable: string;
370
+ ArticleCategory: string;
371
+ Title: string;
372
+ Subtitle: string;
373
+ InfoBox: string;
374
+ SideQuote: string;
375
+ Marker: string;
376
+ Spoiler: string;
377
+ CodeDark: string;
378
+ CodeBright: string;
379
+ Undo: string;
380
+ Redo: string;
381
+ SelectAll: string;
382
+ Bold: string;
383
+ Italic: string;
384
+ HorizontalLine: string;
385
+ Blockquote: string;
386
+ BulletedList: string;
387
+ NumberedList: string;
388
+ Outdent: string;
389
+ Indent: string;
390
+ AlignLeft: string;
391
+ AlignCenter: string;
392
+ AlignRight: string;
393
+ AlignJustify: string;
394
+ Link: string;
395
+ LinkUrl: string;
396
+ LinkApply: string;
397
+ LinkRemove: string;
398
+ Image: string;
399
+ ImageUrl: string;
400
+ ImageUpload: string;
401
+ ImageInsert: string;
402
+ ImageDropHint: string;
403
+ ImageReplace: string;
404
+ ImageDownload: string;
405
+ FileDownload: string;
406
+ Table: string;
407
+ TableInsert: string;
408
+ TableAddRowAbove: string;
409
+ TableAddRowBelow: string;
410
+ TableDeleteRow: string;
411
+ TableAddColumnBefore: string;
412
+ TableAddColumnAfter: string;
413
+ TableDeleteColumn: string;
414
+ TableToggleHeaderRow: string;
415
+ TableDeleteTable: string;
416
+ Style: string;
417
+ MediaEmbed: string;
418
+ MediaEmbedUrl: string;
419
+ MediaEmbedInsert: string;
420
+ };
421
+
376
422
  export declare const DfActions: DefineComponent<DfActionsProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<DfActionsProps> & Readonly<{}>, {
377
423
  buttonSize: VuetifyButtonSize;
378
424
  buttonDensity: VuetifyDensity;
@@ -510,6 +556,7 @@ export declare namespace DfInputComponentProps {
510
556
  DfFileProps,
511
557
  DfImageProps,
512
558
  DfInputProps,
559
+ MessagesWidgetProps,
513
560
  DfInputHintProps,
514
561
  DfLabelProps,
515
562
  DfRtfEditorProps,
@@ -539,8 +586,7 @@ export declare namespace DfInputComponents {
539
586
  * Every component this library draws with, keyed by the tag a layout names it by.
540
587
  *
541
588
  * A rendering layer that resolves a component by name out of a map - `@dynamicforms/vuetify-modal-form-kit`'s
542
- * `<component-render>` is one - is handed this instead of keeping a list of its own, which would have to be
543
- * extended whenever this package gains a component and would silently render nothing until it was.
589
+ * `<component-render>` is one - takes it from here, so a component this package adds is in the map.
544
590
  *
545
591
  * The keys are the kebab-case of the export names, so a tag names the same component whether it is looked up
546
592
  * here or left to Vue's own resolver after `DynamicFormsInputs` has registered the components globally.
@@ -624,8 +670,8 @@ export declare const dfInputComponentsByTag: {
624
670
  max: number;
625
671
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
626
672
  readonly 'df-input-hint': DefineComponent<DfInputHintProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<DfInputHintProps> & Readonly<{}>, {
627
- errors: string | ValidationError[];
628
- message: string | ValidationError[];
673
+ errors: string | readonly (RenderableValue | ErrorInput)[];
674
+ message: RenderContentRef | readonly RenderableValue[];
629
675
  errorClasses: ClassTypes;
630
676
  messageClasses: ClassTypes;
631
677
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
@@ -640,69 +686,7 @@ export declare const dfInputComponentsByTag: {
640
686
  minHeight: string;
641
687
  enabled: boolean;
642
688
  clearable: boolean;
643
- }, {}, {}, {}, string, ComponentProvideOptions, false, {
644
- $editor: CreateComponentPublicInstanceWithMixins<Readonly<{
645
- modelValue?: string;
646
- minHeight?: string;
647
- disabled?: boolean;
648
- toolbarButtonSize?: VuetifyButtonSize;
649
- fontFamily?: string;
650
- }> & Readonly<{
651
- "onUpdate:modelValue"?: ((value: string) => any) | undefined;
652
- }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
653
- "update:modelValue": (value: string) => any;
654
- }, PublicProps, {
655
- minHeight: string;
656
- disabled: boolean;
657
- modelValue: string;
658
- toolbarButtonSize: VuetifyButtonSize;
659
- fontFamily: string;
660
- }, false, {}, {}, GlobalComponents, GlobalDirectives, string, {
661
- toolbarRef: CreateComponentPublicInstanceWithMixins<Readonly<{
662
- editor?: Editor;
663
- buttonSize?: VuetifyButtonSize;
664
- }> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
665
- buttonSize: VuetifyButtonSize;
666
- editor: Editor;
667
- }, false, {}, {}, GlobalComponents, GlobalDirectives, string, {
668
- imageInput: HTMLInputElement;
669
- }, HTMLDivElement, ComponentProvideOptions, {
670
- P: {};
671
- B: {};
672
- D: {};
673
- C: {};
674
- M: {};
675
- Defaults: {};
676
- }, Readonly<{
677
- editor?: Editor;
678
- buttonSize?: VuetifyButtonSize;
679
- }> & Readonly<{}>, {}, {}, {}, {}, {
680
- buttonSize: VuetifyButtonSize;
681
- editor: Editor;
682
- }> | null;
683
- }, HTMLDivElement, ComponentProvideOptions, {
684
- P: {};
685
- B: {};
686
- D: {};
687
- C: {};
688
- M: {};
689
- Defaults: {};
690
- }, Readonly<{
691
- modelValue?: string;
692
- minHeight?: string;
693
- disabled?: boolean;
694
- toolbarButtonSize?: VuetifyButtonSize;
695
- fontFamily?: string;
696
- }> & Readonly<{
697
- "onUpdate:modelValue"?: ((value: string) => any) | undefined;
698
- }>, {}, {}, {}, {}, {
699
- minHeight: string;
700
- disabled: boolean;
701
- modelValue: string;
702
- toolbarButtonSize: VuetifyButtonSize;
703
- fontFamily: string;
704
- }> | null;
705
- }, any>;
689
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
706
690
  readonly 'df-select': {
707
691
  new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly<DfSelectProps> & Readonly<{
708
692
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
@@ -788,17 +772,18 @@ export declare const dfInputComponentsByTag: {
788
772
  export declare type DfInputComponentTag = keyof typeof dfInputComponentsByTag;
789
773
 
790
774
  export declare const DfInputHint: DefineComponent<DfInputHintProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<DfInputHintProps> & Readonly<{}>, {
791
- errors: string | ValidationError[];
792
- message: string | ValidationError[];
775
+ errors: string | readonly (RenderableValue | ErrorInput)[];
776
+ message: RenderContentRef | readonly RenderableValue[];
793
777
  errorClasses: ClassTypes;
794
778
  messageClasses: ClassTypes;
795
779
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
796
780
 
797
781
  declare interface DfInputHintProps {
798
- /** The errors to render. Rendered in place of {@link message} whenever there is one. */
799
- errors?: string | ValidationError[];
800
- /** The message to render, shown while there is no error. */
801
- message?: string | ValidationError[];
782
+ /** The errors to render, in place of {@link message} whenever there is one. A string is text in the user's
783
+ * language; an error description may lack any member. */
784
+ errors?: string | readonly (RenderableValue | ErrorInput)[];
785
+ /** The message to render, shown while there is no error: content in any of its forms, or the items to render. */
786
+ message?: RenderContentRef | readonly RenderableValue[];
802
787
  /** Classes for the rendered errors. Defaults to `text-error`. */
803
788
  errorClasses?: ClassTypes;
804
789
  /** Classes for the rendered message. Defaults to no class. */
@@ -816,11 +801,13 @@ declare interface DfInputProps extends BaseProps {
816
801
  export declare const DfLabel: DefineComponent<DfLabelProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<DfLabelProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
817
802
 
818
803
  declare interface DfLabelProps {
819
- /** The slot data Vuetify hands a `#label` slot. Where it is given, its `label` is what is rendered. */
820
- data?: DefaultInputSlot & {
821
- label?: string | MdString;
804
+ /** The slot data Vuetify hands a `#label` slot. Its `label`, the label's text, is rendered where {@link label} has
805
+ * no content. */
806
+ data?: {
807
+ label?: string;
808
+ props?: Record<string, unknown>;
822
809
  };
823
- /** The label to render where no {@link data} is given: its text, and the icon it carries. */
810
+ /** The label to render: its content in any of the four forms, and the icon it carries. */
824
811
  label: Label;
825
812
  /** Whether the label wraps over several lines. It is rendered on one line by default. */
826
813
  allowWrap?: boolean;
@@ -836,69 +823,7 @@ export declare const DfRtfEditor: DefineComponent<DfRtfEditorProps, {}, {}, {},
836
823
  minHeight: string;
837
824
  enabled: boolean;
838
825
  clearable: boolean;
839
- }, {}, {}, {}, string, ComponentProvideOptions, false, {
840
- $editor: CreateComponentPublicInstanceWithMixins<Readonly<{
841
- modelValue?: string;
842
- minHeight?: string;
843
- disabled?: boolean;
844
- toolbarButtonSize?: VuetifyButtonSize;
845
- fontFamily?: string;
846
- }> & Readonly<{
847
- "onUpdate:modelValue"?: ((value: string) => any) | undefined;
848
- }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
849
- "update:modelValue": (value: string) => any;
850
- }, PublicProps, {
851
- minHeight: string;
852
- disabled: boolean;
853
- modelValue: string;
854
- toolbarButtonSize: VuetifyButtonSize;
855
- fontFamily: string;
856
- }, false, {}, {}, GlobalComponents, GlobalDirectives, string, {
857
- toolbarRef: CreateComponentPublicInstanceWithMixins<Readonly<{
858
- editor?: Editor;
859
- buttonSize?: VuetifyButtonSize;
860
- }> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
861
- buttonSize: VuetifyButtonSize;
862
- editor: Editor;
863
- }, false, {}, {}, GlobalComponents, GlobalDirectives, string, {
864
- imageInput: HTMLInputElement;
865
- }, HTMLDivElement, ComponentProvideOptions, {
866
- P: {};
867
- B: {};
868
- D: {};
869
- C: {};
870
- M: {};
871
- Defaults: {};
872
- }, Readonly<{
873
- editor?: Editor;
874
- buttonSize?: VuetifyButtonSize;
875
- }> & Readonly<{}>, {}, {}, {}, {}, {
876
- buttonSize: VuetifyButtonSize;
877
- editor: Editor;
878
- }> | null;
879
- }, HTMLDivElement, ComponentProvideOptions, {
880
- P: {};
881
- B: {};
882
- D: {};
883
- C: {};
884
- M: {};
885
- Defaults: {};
886
- }, Readonly<{
887
- modelValue?: string;
888
- minHeight?: string;
889
- disabled?: boolean;
890
- toolbarButtonSize?: VuetifyButtonSize;
891
- fontFamily?: string;
892
- }> & Readonly<{
893
- "onUpdate:modelValue"?: ((value: string) => any) | undefined;
894
- }>, {}, {}, {}, {}, {
895
- minHeight: string;
896
- disabled: boolean;
897
- modelValue: string;
898
- toolbarButtonSize: VuetifyButtonSize;
899
- fontFamily: string;
900
- }> | null;
901
- }, any>;
826
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
902
827
 
903
828
  declare interface DfRtfEditorProps extends BaseProps {
904
829
  minHeight?: string;
@@ -949,6 +874,27 @@ export declare interface DynamicFormsInputsOptions extends VuetifyInputsSettings
949
874
  registerVuetifyComponents: boolean;
950
875
  }
951
876
 
877
+ /**
878
+ * An error as a component accepts it for rendering: content in one of the four forms (a string, an `MdString`, an
879
+ * `HtmlString` or a `SimpleComponentDef`), which renders as it is, or an error description of which any member may
880
+ * be missing.
881
+ */
882
+ export declare type ErrorInput = RenderContentNonCallable | Partial<ErrorDescription>;
883
+
884
+ /**
885
+ * Converts an error to the content it renders as: plain text, an `MdString` for markdown, an `HtmlString` for HTML
886
+ * or a `SimpleComponentDef` for a component. `undefined` renders the error's `detail`. It is called for an error with
887
+ * a code. It runs while the errors are rendered, so the reactive state it reads, such as the locale, is tracked.
888
+ */
889
+ export declare type ErrorText = (error: ErrorDescription) => RenderContentNonCallable | undefined;
890
+
891
+ /**
892
+ * What a component renders for `error`. Content renders as it is. An error without a code renders as its
893
+ * `detail`: it is text in the user's language. An error with a code renders as the `errorText` setting's answer, and
894
+ * as its `detail` where the setting is not given or answers `undefined`.
895
+ */
896
+ export declare function errorText(error: ErrorInput, settings: VuetifyInputsSettings): RenderContentNonCallable;
897
+
952
898
  export declare type FieldDensity = 'default' | 'comfortable' | 'compact' | 'inline';
953
899
 
954
900
  export declare type FieldVariant = 'outlined' | 'plain' | 'underlined' | 'filled' | 'solo' | 'solo-inverted' | 'solo-filled';
@@ -1021,20 +967,123 @@ export declare function getBreakpointName(dp: ReturnType<typeof useDisplay>): Br
1021
967
  * `label` and `icon` come back only where the matching flag says they are shown, and the flags come back false
1022
968
  * where there is no text or name to show, so a caller renders each member on its own flag and never on emptiness.
1023
969
  */
1024
- export declare function getRenderOptionsForBreakpoint(value: ActionValue, breakpoint: BreakpointNames): ActionRenderOptions;
970
+ export declare function getRenderOptionsForBreakpoint(value: ActionValue, breakpoint: BreakpointNames): ResolvedActionRenderOptions;
971
+
972
+ /**
973
+ * A string rendered as HTML: it is set as the `innerHTML` of a `div`. It is not sanitized, so a string holding text
974
+ * from a user or a server is escaped or sanitized before it is wrapped.
975
+ */
976
+ export declare class HtmlString extends String {
977
+ }
1025
978
 
1026
979
  export declare const InputBase: __VLS_WithTemplateSlots_2<typeof __VLS_component_2, __VLS_TemplateResult_2["slots"]>;
1027
980
 
981
+ /** What `InputBase`'s `default` slot receives: Vuetify's `v-field` slot props. `prepend-inner` receives them without
982
+ * `props`. */
983
+ export declare interface InputBaseSlotProps {
984
+ /** Attributes for the control: its `id`, `class` and ARIA attributes. */
985
+ props: Record<string, unknown>;
986
+ isActive: Ref<boolean>;
987
+ isFocused: Ref<boolean>;
988
+ iconColor: ComputedRef<string | undefined>;
989
+ controlRef: Ref<HTMLElement | undefined>;
990
+ /** Sets the field's focused state. */
991
+ focus: () => void;
992
+ /** Clears the field's focused state. */
993
+ blur: () => void;
994
+ }
995
+
1028
996
  /** Answers whether `value` is one of the display styles. */
1029
997
  export declare function isActionDisplayStyle(value: unknown): value is ActionDisplayStyle;
1030
998
 
999
+ /** True where `content` is a function answering the content. */
1000
+ export declare function isCallableFunction(content?: RenderContentRef): content is RenderContentCallable;
1001
+
1002
+ /** True where `value` is content in one of the four forms: a string, an `MdString`, an `HtmlString` or a component. */
1003
+ export declare function isRenderContent(value: unknown): value is RenderContentNonCallable;
1004
+
1005
+ /** True where `content` names a component to render it with. */
1006
+ export declare function isSimpleComponentDef(content?: RenderContentRef): content is SimpleComponentDef;
1007
+
1008
+ declare type Key = keyof typeof defaults;
1009
+
1010
+ /** A field's label: its content, and an icon shown before it. */
1031
1011
  export declare class Label {
1032
- text: string;
1012
+ text: RenderContentNonCallable;
1033
1013
  icon?: string | undefined;
1034
1014
  iconComponent: string;
1035
- constructor(text: string, icon?: string | undefined, iconComponent?: string);
1015
+ constructor(text: RenderContentNonCallable, icon?: string | undefined, iconComponent?: string);
1016
+ }
1017
+
1018
+ /** A string rendered as markdown by `vue-markdown-render`, with its `options` and `plugins`. */
1019
+ export declare class MdString extends String {
1020
+ plugins?: any[];
1021
+ options?: any;
1022
+ constructor(value: string, options?: any, plugins?: any[]);
1023
+ }
1024
+
1025
+ export declare const MessagesWidget: DefineComponent<MessagesWidgetProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<MessagesWidgetProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
1026
+
1027
+ declare interface MessagesWidgetProps {
1028
+ /** A plain text, or the items to render, each in its own element: a `RenderableValue` as its content, an error
1029
+ * as `errorText()` gives it. */
1030
+ message: string | readonly (RenderableValue | ErrorInput)[];
1031
+ /** Classes for every rendered item, beside the item's own `extraClasses`. */
1032
+ classes?: ClassTypes;
1036
1033
  }
1037
1034
 
1035
+ /**
1036
+ * Content with the CSS classes it is rendered with, described as what renders it: `componentName`, its
1037
+ * `componentBindings`, its `componentChildren`, its `componentBody` and its `extraClasses`. `componentName` is
1038
+ * `'template'` for plain text, `'vue-markdown'` for markdown, `'html'` for an `HtmlString` and the component's name
1039
+ * for a `SimpleComponentDef`; `componentBody` is the text of plain text and the HTML of an `HtmlString`.
1040
+ *
1041
+ * `MessagesWidget` renders it, and so does any component that reads those five members. A reference or a function as
1042
+ * the content is read on every render, so what it answers reaches the screen without the value being built again.
1043
+ */
1044
+ export declare class RenderableValue {
1045
+ private readonly content;
1046
+ classes: ClassTypes;
1047
+ private readonly kindRef;
1048
+ constructor(content?: RenderContentRef, classes?: ClassTypes);
1049
+ /** The content as it reads now: a reference unwrapped and a function called. */
1050
+ get resolvedText(): RenderContentNonCallable;
1051
+ /** Which of the four forms the content takes now. */
1052
+ get kind(): RenderContentKind;
1053
+ get componentName(): string;
1054
+ get componentBindings(): Record<string, any>;
1055
+ /** The children of a component; empty for the other forms. */
1056
+ get componentChildren(): readonly RenderContentNonCallable[];
1057
+ get componentBody(): string;
1058
+ get extraClasses(): ClassTypes;
1059
+ }
1060
+
1061
+ /** Content in one of four forms - plain text, markdown, HTML or a component - or a function answering one. */
1062
+ export declare type RenderContent = RenderContentNonCallable | RenderContentCallable;
1063
+
1064
+ export declare type RenderContentCallable = () => RenderContentNonCallable;
1065
+
1066
+ /** Which of the four forms content takes. */
1067
+ export declare type RenderContentKind = 'string' | 'md' | 'html' | 'component';
1068
+
1069
+ export declare type RenderContentNonCallable = string | MdString | HtmlString | SimpleComponentDef;
1070
+
1071
+ /** `RenderContent`, or a reference to it. */
1072
+ export declare type RenderContentRef = RenderContent | Ref<RenderContent>;
1073
+
1074
+ /**
1075
+ * The text of `content` where only text is taken, such as an `aria-label`: a string and an `MdString` as written, an
1076
+ * `HtmlString` without its tags, its blocks separated by a space, whitespace collapsed and trimmed, and with `&amp;`,
1077
+ * `&lt;`, `&gt;`, `&quot;`, `&#39;` and `&nbsp;` read, and a component as the text of its children joined, whitespace
1078
+ * collapsed and trimmed. An `&nbsp;` reads as a space that is neither collapsed nor trimmed.
1079
+ */
1080
+ export declare function renderContentText(content: RenderContentNonCallable): string;
1081
+
1082
+ /** `ActionRenderOptions` with the label read: a string. */
1083
+ export declare type ResolvedActionRenderOptions = Omit<ActionRenderOptions, 'label'> & {
1084
+ label?: string;
1085
+ };
1086
+
1038
1087
  export declare class ResponsiveActionRenderOptions extends ResponsiveRenderOptions<ActionRenderOptions> {
1039
1088
  protected cleanBreakpoint(bp?: ActionRenderOptions, defaultIfEmpty?: boolean): ActionRenderOptions | null;
1040
1089
  }
@@ -1063,12 +1112,10 @@ export declare interface SelectChoice {
1063
1112
  export declare type SelectFetchChoices<T1 = any, T2 = any> = (queryValue?: T1, idValue?: T2) => Promise<SelectChoice[]>;
1064
1113
 
1065
1114
  /**
1066
- * The errors of `errors` a component shows now. `errors` and `valid` state the verdict, which a submit needs at
1067
- * once; what the user is shown waits for the user, because a form covered in errors before anything was typed tells
1068
- * the user nothing they can act on.
1115
+ * The errors of `errors` a component shows now.
1069
1116
  *
1070
- * By default an error is shown where `control` is sent at all - its `effectiveAccess` is not `'disabled'` - and
1071
- * either its `origin` is `'server'`, since the server answered something the user did, or the element is `touched`.
1117
+ * By default an error is shown where `control` is sent - its `effectiveAccess` is not `'disabled'` - and either its
1118
+ * `origin` is `'server'` or the element is `touched`.
1072
1119
  * Without a control, `touched` is the component's own. The `shownErrors` setting replaces the rule with a condition
1073
1120
  * of the application's own, asked for each error with the default answer.
1074
1121
  */
@@ -1083,137 +1130,42 @@ export declare function setFileGoneError(control: default_2.FieldBase | undefine
1083
1130
 
1084
1131
  declare type ShowAsGroup = 'no' | 'grouped' | 'grouped-no-borders';
1085
1132
 
1086
- export declare const translatableStrings: {
1087
- Yes: string;
1088
- No: string;
1089
- Close: string;
1090
- Paragraph: string;
1091
- Heading1: string;
1092
- Heading2: string;
1093
- Heading3: string;
1094
- Heading4: string;
1095
- Heading5: string;
1096
- Heading6: string;
1097
- Downloadable: string;
1098
- ArticleCategory: string;
1099
- Title: string;
1100
- Subtitle: string;
1101
- InfoBox: string;
1102
- SideQuote: string;
1103
- Marker: string;
1104
- Spoiler: string;
1105
- CodeDark: string;
1106
- CodeBright: string;
1107
- Undo: string;
1108
- Redo: string;
1109
- SelectAll: string;
1110
- Bold: string;
1111
- Italic: string;
1112
- HorizontalLine: string;
1113
- Blockquote: string;
1114
- BulletedList: string;
1115
- NumberedList: string;
1116
- Outdent: string;
1117
- Indent: string;
1118
- AlignLeft: string;
1119
- AlignCenter: string;
1120
- AlignRight: string;
1121
- AlignJustify: string;
1122
- Link: string;
1123
- LinkUrl: string;
1124
- LinkApply: string;
1125
- LinkRemove: string;
1126
- Image: string;
1127
- ImageUrl: string;
1128
- ImageUpload: string;
1129
- ImageInsert: string;
1130
- ImageDropHint: string;
1131
- ImageReplace: string;
1132
- ImageDownload: string;
1133
- FileDownload: string;
1134
- Table: string;
1135
- TableInsert: string;
1136
- TableAddRowAbove: string;
1137
- TableAddRowBelow: string;
1138
- TableDeleteRow: string;
1139
- TableAddColumnBefore: string;
1140
- TableAddColumnAfter: string;
1141
- TableDeleteColumn: string;
1142
- TableToggleHeaderRow: string;
1143
- TableDeleteTable: string;
1144
- Style: string;
1145
- MediaEmbed: string;
1146
- MediaEmbedUrl: string;
1147
- MediaEmbedInsert: string;
1148
- InvalidHexColor: string;
1149
- };
1133
+ /**
1134
+ * A component to render content with: an HTML element or a registered component by its name, with its props and its
1135
+ * children. It has no HTML content of its own; HTML is an `HtmlString`.
1136
+ */
1137
+ export declare interface SimpleComponentDef {
1138
+ componentName: string;
1139
+ /** The props of the component. A listener is a prop named `on` and the event, e.g. `onClick`. `innerHTML` is not
1140
+ * one: the component drops it. */
1141
+ componentProps?: Record<string, unknown> & {
1142
+ innerHTML?: never;
1143
+ };
1144
+ /** The children of an HTML element, or the default slot of a component. A string renders as text. */
1145
+ children?: RenderContentNonCallable | readonly RenderContentNonCallable[];
1146
+ }
1150
1147
 
1151
- export declare const translateStrings: (cb: TranslateStringsCallback< {
1152
- Yes: string;
1153
- No: string;
1154
- Close: string;
1155
- Paragraph: string;
1156
- Heading1: string;
1157
- Heading2: string;
1158
- Heading3: string;
1159
- Heading4: string;
1160
- Heading5: string;
1161
- Heading6: string;
1162
- Downloadable: string;
1163
- ArticleCategory: string;
1164
- Title: string;
1165
- Subtitle: string;
1166
- InfoBox: string;
1167
- SideQuote: string;
1168
- Marker: string;
1169
- Spoiler: string;
1170
- CodeDark: string;
1171
- CodeBright: string;
1172
- Undo: string;
1173
- Redo: string;
1174
- SelectAll: string;
1175
- Bold: string;
1176
- Italic: string;
1177
- HorizontalLine: string;
1178
- Blockquote: string;
1179
- BulletedList: string;
1180
- NumberedList: string;
1181
- Outdent: string;
1182
- Indent: string;
1183
- AlignLeft: string;
1184
- AlignCenter: string;
1185
- AlignRight: string;
1186
- AlignJustify: string;
1187
- Link: string;
1188
- LinkUrl: string;
1189
- LinkApply: string;
1190
- LinkRemove: string;
1191
- Image: string;
1192
- ImageUrl: string;
1193
- ImageUpload: string;
1194
- ImageInsert: string;
1195
- ImageDropHint: string;
1196
- ImageReplace: string;
1197
- ImageDownload: string;
1198
- FileDownload: string;
1199
- Table: string;
1200
- TableInsert: string;
1201
- TableAddRowAbove: string;
1202
- TableAddRowBelow: string;
1203
- TableDeleteRow: string;
1204
- TableAddColumnBefore: string;
1205
- TableAddColumnAfter: string;
1206
- TableDeleteColumn: string;
1207
- TableToggleHeaderRow: string;
1208
- TableDeleteTable: string;
1209
- Style: string;
1210
- MediaEmbed: string;
1211
- MediaEmbedUrl: string;
1212
- MediaEmbedInsert: string;
1213
- InvalidHexColor: string;
1214
- }>) => void;
1215
-
1216
- export declare function useBreakpoint(): ComputedRef<"xs" | "sm" | "md" | "lg" | "xl">;
1148
+ /**
1149
+ * `error` with every missing member set: `code` to `''`, `params` to `{}`, `detail` to `''` and `origin` to
1150
+ * `'application'`. Content becomes an error without a code, its text (`renderContentText`) as the `detail`.
1151
+ */
1152
+ export declare function toErrorDescription(error: ErrorInput): ErrorDescription;
1153
+
1154
+ /**
1155
+ * The current translation of one of the library's strings. Called while a component sets up or renders, it
1156
+ * translates with the `translate` setting the component reads, as it reads every other setting, where one is given,
1157
+ * and with the function `translateStrings` set otherwise. Under server-side rendering each request's app states its
1158
+ * own `translate`. An event handler or a timer reads no setting; it uses `useTranslate()`.
1159
+ */
1160
+ export declare function translate(key: Key, params?: Record<string, unknown>): string;
1161
+
1162
+ /**
1163
+ * Sets the translation function of the library's strings for the whole process; see `@dynamicforms/translatable`.
1164
+ * An app installed with the `translate` setting translates with that one instead.
1165
+ */
1166
+ export declare const translateStrings: (t: TranslateFunction, namespace?: string) => void;
1167
+
1168
+ export declare function useBreakpoint(): ComputedRef<"md" | "xs" | "sm" | "lg" | "xl">;
1217
1169
 
1218
1170
  /**
1219
1171
  * Runs the `comms.touch` keep-alive interval for `<df-file>`/`<df-image>` while `value` holds a file
@@ -1226,37 +1178,42 @@ export declare function useFileTouchKeepAlive(value: Ref<string | null>, comms:
1226
1178
  clearTouchInterval: () => void;
1227
1179
  };
1228
1180
 
1229
- export declare function useInputBase<T = any>(props: BaseProps<T>, emit: BaseEmits<T>): {
1181
+ /**
1182
+ * The state and Vuetify bindings an input shares with every other input. `componentErrors` are the errors the
1183
+ * component finds in the value itself, reported where no `control` is bound; a bound control reports through its
1184
+ * own validators.
1185
+ */
1186
+ export declare function useInputBase<T = any>(props: BaseProps<T>, emit: BaseEmits<T>, componentErrors?: () => ValidationError[]): {
1230
1187
  value: WritableComputedRef<T, T>;
1231
1188
  valid: ComputedRef<boolean>;
1232
1189
  enabled: ComputedRef<boolean>;
1233
1190
  errors: ComputedRef<default_2.ValidationError[]>;
1234
- shownErrors: ComputedRef<default_2.ValidationError[]>;
1191
+ shownErrors: ComputedRef<ErrorInput[]>;
1235
1192
  visibility: ComputedRef<default_2.Visibility>;
1236
1193
  isRendered: ComputedRef<boolean>;
1237
- visibilityClass: ComputedRef< {
1238
- 'd-none': boolean;
1239
- invisible: boolean;
1194
+ visibilityClass: ComputedRef<{
1195
+ 'd-none': boolean;
1196
+ invisible: boolean;
1240
1197
  }>;
1241
1198
  label: ComputedRef<Label>;
1242
1199
  touched: Ref<boolean, boolean>;
1243
1200
  density: ComputedRef<FieldDensity>;
1244
1201
  densityClass: ComputedRef<string>;
1245
- vuetifyBindings: ComputedRef< {
1246
- name: string | undefined;
1247
- class: string;
1248
- density: VuetifyDensity;
1249
- variant: FieldVariant;
1250
- label: string;
1251
- errorMessages: string | undefined;
1252
- readonly: boolean;
1253
- disabled: boolean;
1254
- placeholder: string;
1255
- 'persistent-placeholder': boolean;
1256
- hint: string;
1257
- persistentHint: boolean;
1258
- hideDetails: boolean | "auto" | undefined;
1259
- helpText: string;
1202
+ vuetifyBindings: ComputedRef<{
1203
+ name: string | undefined;
1204
+ class: string;
1205
+ density: VuetifyDensity;
1206
+ variant: FieldVariant;
1207
+ label: string;
1208
+ errorMessages: string | undefined;
1209
+ readonly: boolean;
1210
+ disabled: boolean;
1211
+ placeholder: string;
1212
+ 'persistent-placeholder': boolean;
1213
+ hint: string;
1214
+ persistentHint: boolean;
1215
+ hideDetails: boolean | "auto" | undefined;
1216
+ helpText: string;
1260
1217
  }>;
1261
1218
  };
1262
1219
 
@@ -1267,6 +1224,12 @@ export declare function useInputBase<T = any>(props: BaseProps<T>, emit: BaseEmi
1267
1224
  */
1268
1225
  export declare function useShownErrors(element: MaybeRefOrGetter<FieldBase | undefined>): ComputedRef<ValidationError[]>;
1269
1226
 
1227
+ /**
1228
+ * `translate` bound to the settings the calling component reads, for use outside its setup and render: in an event
1229
+ * handler or a timer. Called in a component's setup.
1230
+ */
1231
+ export declare function useTranslate(): (key: Key, params?: Record<string, unknown>) => string;
1232
+
1270
1233
  /** Vuetify's own `size` prop (`v-btn`, `v-icon`, ...) also accepts an arbitrary CSS length or number, so this
1271
1234
  * keeps that but still offers the named sizes for autocomplete: `(string & {})` is a plain `string` to the type
1272
1235
  * checker (any string is still assignable) but not to a union with string literals, which is what makes an IDE
@@ -1277,12 +1240,17 @@ export declare namespace VuetifyComponents {
1277
1240
  export {
1278
1241
  VAutocomplete,
1279
1242
  VBtn,
1243
+ VBtnGroup,
1244
+ VBtnToggle,
1245
+ VCard,
1246
+ VCardActions,
1280
1247
  VCheckbox,
1281
1248
  VChip,
1282
1249
  VCombobox,
1283
1250
  VColorPicker,
1284
1251
  VConfirmEdit,
1285
1252
  VDatePicker,
1253
+ VDivider,
1286
1254
  VField,
1287
1255
  VFileInput,
1288
1256
  VRow,
@@ -1290,7 +1258,9 @@ export declare namespace VuetifyComponents {
1290
1258
  VIcon,
1291
1259
  VImg,
1292
1260
  VInput,
1261
+ VList,
1293
1262
  VListItem,
1263
+ VListItemTitle,
1294
1264
  VMenu,
1295
1265
  VNumberInput,
1296
1266
  VProgressLinear,
@@ -1317,6 +1287,24 @@ export declare interface VuetifyInputsSettings {
1317
1287
  * is synchronous and changes nothing.
1318
1288
  */
1319
1289
  shownErrors?: (error: ValidationError, control: FieldBase | undefined, shownByDefault: boolean) => boolean;
1290
+ /**
1291
+ * The content an error renders as; see `ErrorText`. Without it, an error renders as its `detail`.
1292
+ */
1293
+ errorText?: ErrorText;
1294
+ /**
1295
+ * The translation function of the library's strings, shaped like vue-i18n's `t`. Where it is given, `translate()`
1296
+ * called while a component that reads these settings sets up or renders uses it in place of the one
1297
+ * `translateStrings` set for the process. Under server-side rendering, an app per request gives each request its
1298
+ * own.
1299
+ */
1300
+ translate?: TranslateFunction;
1301
+ /** The namespace `translate` looks the library's keys up under: `${translateNamespace}.${key}`. */
1302
+ translateNamespace?: string;
1303
+ /**
1304
+ * The date-fns locale `<df-date-time>` formats and parses with in this app, in place of
1305
+ * `DateTimeLocaleConfig.dateTimeLocale`. A component's `locale` prop takes precedence.
1306
+ */
1307
+ dateTimeLocale?: MaybeRef<Locale>;
1320
1308
  }
1321
1309
 
1322
1310
  export declare const vuetifyInputsSettingsKey: unique symbol;
@@ -1337,7 +1325,7 @@ export { }
1337
1325
  */
1338
1326
  declare module '@dynamicforms/vue-forms' {
1339
1327
  interface Extras {
1340
- label?: string | Label | MdString;
1328
+ label?: RenderContentNonCallable | Label;
1341
1329
  placeholder?: string;
1342
1330
  helpText?: string;
1343
1331
  hint?: string;