@m3ui-vue/m3ui-vue 1.6.2 → 1.8.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/API.md +1224 -28
- package/dist/{MColorPickerModal-NtkihoK6.js → MColorPickerModal-H8nuX0Wu.js} +3 -4
- package/dist/{MColorPickerModal-NtkihoK6.js.map → MColorPickerModal-H8nuX0Wu.js.map} +1 -1
- package/dist/MDialog-B42Mhn8W.js +331 -0
- package/dist/MDialog-B42Mhn8W.js.map +1 -0
- package/dist/{MListItem-D2cNUyzP.js → MListItem-DiOAxaN7.js} +431 -325
- package/dist/MListItem-DiOAxaN7.js.map +1 -0
- package/dist/{MLoadingIndicator-DWUj0BAB.js → MLoadingIndicator-CuTZYFFj.js} +2 -2
- package/dist/{MLoadingIndicator-DWUj0BAB.js.map → MLoadingIndicator-CuTZYFFj.js.map} +1 -1
- package/dist/{MSeekBar-C4cn9RIF.js → MSeekBar-BCDQTx2t.js} +2 -2
- package/dist/{MSeekBar-C4cn9RIF.js.map → MSeekBar-BCDQTx2t.js.map} +1 -1
- package/dist/MSegmentedButton-BXzRsg1S.js +105 -0
- package/dist/MSegmentedButton-BXzRsg1S.js.map +1 -0
- package/dist/MSignaturePad-BTqGaPXA.js +313 -0
- package/dist/MSignaturePad-BTqGaPXA.js.map +1 -0
- package/dist/MSlider-D_O8J9YH.js +739 -0
- package/dist/MSlider-D_O8J9YH.js.map +1 -0
- package/dist/{MSpinner-DZkXZJpc.js → MSpinner-UCdtSOHP.js} +2 -2
- package/dist/{MSpinner-DZkXZJpc.js.map → MSpinner-UCdtSOHP.js.map} +1 -1
- package/dist/{MTextField-CNH-byir.js → MTextField-CYk9yFvi.js} +162 -115
- package/dist/MTextField-CYk9yFvi.js.map +1 -0
- package/dist/_useFieldValidation-B0B44M_t.js +191 -0
- package/dist/_useFieldValidation-B0B44M_t.js.map +1 -0
- package/dist/api.json +1 -1
- package/dist/code-editor.js +184 -103
- package/dist/code-editor.js.map +1 -1
- package/dist/components/MAddressField.vue.d.ts +18 -3
- package/dist/components/MAppBarWithSearch.vue.d.ts +1 -1
- package/dist/components/MAudioRecorder.vue.d.ts +2 -2
- package/dist/components/MAutocomplete.vue.d.ts +22 -3
- package/dist/components/MCheckbox.vue.d.ts +23 -1
- package/dist/components/MCodeEditor.vue.d.ts +23 -1
- package/dist/components/MColorPicker.vue.d.ts +24 -3
- package/dist/components/MConfirmDialog.vue.d.ts +2 -2
- package/dist/components/MCountrySelect.vue.d.ts +13 -2
- package/dist/components/MCreditCardInput.vue.d.ts +33 -0
- package/dist/components/MCronField.vue.d.ts +23 -1
- package/dist/components/MDataTable.vue.d.ts +1 -1
- package/dist/components/MDatePicker.vue.d.ts +24 -3
- package/dist/components/MDateRangePicker.vue.d.ts +24 -3
- package/dist/components/MFileUpload.vue.d.ts +23 -2
- package/dist/components/MForm.vue.d.ts +61 -0
- package/dist/components/MFormBuilder.vue.d.ts +22 -0
- package/dist/components/MFormRenderer.vue.d.ts +151 -0
- package/dist/components/MJsonEditor.vue.d.ts +23 -1
- package/dist/components/MMapRoute.vue.d.ts +176 -0
- package/dist/components/MMaskField.vue.d.ts +20 -2
- package/dist/components/MMentionField.vue.d.ts +13 -2
- package/dist/components/MMultiAutocomplete.vue.d.ts +22 -3
- package/dist/components/MMultiSelect.vue.d.ts +22 -3
- package/dist/components/MNavigationRail.vue.d.ts +1 -1
- package/dist/components/MNotificationCenter.vue.d.ts +2 -2
- package/dist/components/MNumberField.vue.d.ts +20 -2
- package/dist/components/MPdfSigner.vue.d.ts +499 -0
- package/dist/components/MPdfViewer.vue.d.ts +12 -0
- package/dist/components/MPhoneInput.vue.d.ts +19 -4
- package/dist/components/MPinInput.vue.d.ts +24 -3
- package/dist/components/MPosKeypad.vue.d.ts +3 -3
- package/dist/components/MRadioGroup.vue.d.ts +23 -1
- package/dist/components/MRating.vue.d.ts +23 -1
- package/dist/components/MRichTextEditor.vue.d.ts +23 -1
- package/dist/components/MSearchBar.vue.d.ts +1 -1
- package/dist/components/MSegmentedButton.vue.d.ts +23 -2
- package/dist/components/MSelect.vue.d.ts +22 -3
- package/dist/components/MSignaturePad.vue.d.ts +19 -0
- package/dist/components/MSlider.vue.d.ts +23 -1
- package/dist/components/MSpreadsheet.vue.d.ts +137 -0
- package/dist/components/MStack.vue.d.ts +1 -1
- package/dist/components/MSwitch.vue.d.ts +23 -1
- package/dist/components/MTable.vue.d.ts +1 -1
- package/dist/components/MTagInput.vue.d.ts +20 -2
- package/dist/components/MText.vue.d.ts +1 -1
- package/dist/components/MTextField.vue.d.ts +26 -3
- package/dist/components/MTimePicker.vue.d.ts +24 -3
- package/dist/components/MTimezoneSelect.vue.d.ts +13 -2
- package/dist/components/MTour.vue.d.ts +2 -2
- package/dist/components/MTrackingTimeline.vue.d.ts +75 -0
- package/dist/components/MWindow.vue.d.ts +2 -2
- package/dist/composables/_routeGeometry.d.ts +26 -0
- package/dist/composables/_useFieldValidation.d.ts +91 -0
- package/dist/composables/mapRouting.d.ts +35 -0
- package/dist/composables/pdfSign.d.ts +52 -0
- package/dist/composables/spreadsheetFormula.d.ts +55 -0
- package/dist/composables/useLocale.d.ts +177 -0
- package/dist/composables/validation.d.ts +82 -0
- package/dist/draw.js +2 -2
- package/dist/flow.js +1 -1
- package/dist/gantt.js +2 -2
- package/dist/index.d.ts +12 -0
- package/dist/locales/index.js +693 -7
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +15507 -12417
- package/dist/m3ui.js.map +1 -1
- package/dist/map.d.ts +4 -0
- package/dist/map.js +1207 -745
- package/dist/map.js.map +1 -1
- package/dist/media.js +4 -4
- package/dist/pdf.d.ts +3 -0
- package/dist/pdf.js +1228 -687
- package/dist/pdf.js.map +1 -1
- package/dist/rich-text-editor.js +188 -146
- package/dist/rich-text-editor.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/{useLocale-DaVSTdm0.js → useLocale-DL96OFgr.js} +99 -1
- package/dist/useLocale-DL96OFgr.js.map +1 -0
- package/package.json +5 -1
- package/src/__tests__/MForm.test.ts +325 -0
- package/src/__tests__/MFormRenderer.test.ts +157 -0
- package/src/__tests__/MMapRoute.test.ts +418 -0
- package/src/__tests__/MPdfSigner.test.ts +175 -0
- package/src/__tests__/MPhoneInput.test.ts +5 -2
- package/src/__tests__/MRichTextEditor.test.ts +2 -1
- package/src/__tests__/MSpreadsheet.test.ts +223 -0
- package/src/__tests__/MTrackingTimeline.test.ts +66 -0
- package/src/__tests__/_fakeMaplibre.ts +4 -1
- package/src/__tests__/_osrmRoutes.ts +10 -0
- package/src/__tests__/attrsFallthrough.test.ts +11 -0
- package/src/__tests__/fieldsValidation.test.ts +229 -0
- package/src/__tests__/spreadsheetFormula.test.ts +77 -0
- package/src/__tests__/ssr.test.ts +4 -0
- package/src/__tests__/validation.test.ts +77 -0
- package/src/components/MAddressField.vue +45 -8
- package/src/components/MAutocomplete.vue +69 -23
- package/src/components/MCheckbox.vue +80 -17
- package/src/components/MCodeEditor.vue +59 -2
- package/src/components/MColorPicker.vue +65 -16
- package/src/components/MCountrySelect.vue +17 -3
- package/src/components/MCreditCardInput.vue +76 -7
- package/src/components/MCronField.vue +60 -10
- package/src/components/MDatePicker.vue +65 -16
- package/src/components/MDateRangePicker.vue +66 -16
- package/src/components/MFileUpload.vue +71 -8
- package/src/components/MForm.vue +208 -0
- package/src/components/MFormBuilder.vue +417 -0
- package/src/components/MFormRenderer.vue +324 -0
- package/src/components/MJsonEditor.vue +57 -3
- package/src/components/MMapRoute.vue +523 -0
- package/src/components/MMaskField.vue +55 -13
- package/src/components/MMentionField.vue +17 -2
- package/src/components/MMultiAutocomplete.vue +70 -23
- package/src/components/MMultiSelect.vue +70 -23
- package/src/components/MNumberField.vue +58 -16
- package/src/components/MPdfSigner.vue +433 -0
- package/src/components/MPdfViewer.vue +12 -0
- package/src/components/MPhoneInput.vue +60 -18
- package/src/components/MPinInput.vue +58 -10
- package/src/components/MRadioGroup.vue +65 -4
- package/src/components/MRating.vue +62 -6
- package/src/components/MRichTextEditor.vue +64 -4
- package/src/components/MSegmentedButton.vue +59 -2
- package/src/components/MSelect.vue +72 -26
- package/src/components/MSignaturePad.vue +71 -6
- package/src/components/MSlider.vue +61 -10
- package/src/components/MSpreadsheet.vue +992 -0
- package/src/components/MSwitch.vue +63 -8
- package/src/components/MTagInput.vue +67 -25
- package/src/components/MTextField.vue +68 -14
- package/src/components/MTimePicker.vue +65 -16
- package/src/components/MTimezoneSelect.vue +17 -3
- package/src/components/MTrackingTimeline.vue +257 -0
- package/src/composables/_routeGeometry.ts +140 -0
- package/src/composables/_useFieldValidation.ts +287 -0
- package/src/composables/mapRouting.ts +55 -0
- package/src/composables/pdfSign.ts +141 -0
- package/src/composables/spreadsheetFormula.ts +459 -0
- package/src/composables/useLocale.ts +277 -0
- package/src/composables/validation.ts +178 -0
- package/src/index.ts +12 -0
- package/src/locales/de.ts +98 -0
- package/src/locales/es.ts +105 -7
- package/src/locales/fr.ts +98 -0
- package/src/locales/ja.ts +98 -0
- package/src/locales/ko.ts +98 -0
- package/src/locales/pt.ts +98 -0
- package/src/locales/zh.ts +98 -0
- package/src/map.ts +4 -0
- package/src/pdf.ts +3 -0
- package/dist/MButton-OQ4wIERQ.js +0 -171
- package/dist/MButton-OQ4wIERQ.js.map +0 -1
- package/dist/MDialog-DYMnaBlt.js +0 -167
- package/dist/MDialog-DYMnaBlt.js.map +0 -1
- package/dist/MListItem-D2cNUyzP.js.map +0 -1
- package/dist/MProgressBar-BWly1UKN.js +0 -179
- package/dist/MProgressBar-BWly1UKN.js.map +0 -1
- package/dist/MSegmentedButton-BEB4gXLA.js +0 -64
- package/dist/MSegmentedButton-BEB4gXLA.js.map +0 -1
- package/dist/MSlider-BIkA6DiE.js +0 -690
- package/dist/MSlider-BIkA6DiE.js.map +0 -1
- package/dist/MTextField-CNH-byir.js.map +0 -1
- package/dist/useLocale-DaVSTdm0.js.map +0 -1
|
@@ -35,12 +35,12 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
35
35
|
discard: typeof discard;
|
|
36
36
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
37
37
|
error: (error: MicError) => any;
|
|
38
|
-
"update:modelValue": (recording: AudioRecording | null) => any;
|
|
39
38
|
record: (recording: AudioRecording) => any;
|
|
39
|
+
"update:modelValue": (recording: AudioRecording | null) => any;
|
|
40
40
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
41
41
|
onError?: ((error: MicError) => any) | undefined;
|
|
42
|
-
"onUpdate:modelValue"?: ((recording: AudioRecording | null) => any) | undefined;
|
|
43
42
|
onRecord?: ((recording: AudioRecording) => any) | undefined;
|
|
43
|
+
"onUpdate:modelValue"?: ((recording: AudioRecording | null) => any) | undefined;
|
|
44
44
|
}>, {
|
|
45
45
|
modelValue: AudioRecording | null;
|
|
46
46
|
instant: boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ValidateOn, ValidationRule } from '../composables/validation';
|
|
1
2
|
import type { SelectOption } from './MSelect.vue';
|
|
2
3
|
type __VLS_Props = {
|
|
3
4
|
/** Selected value (v-model) */
|
|
@@ -14,10 +15,21 @@ type __VLS_Props = {
|
|
|
14
15
|
mode?: 'docked' | 'modal';
|
|
15
16
|
/** Disables the field */
|
|
16
17
|
disabled?: boolean;
|
|
17
|
-
/** Error state */
|
|
18
|
-
error?: boolean;
|
|
18
|
+
/** Error state. A string is also the message (`:error="errors.x"`) */
|
|
19
|
+
error?: boolean | string;
|
|
19
20
|
/** Error message shown when error is true */
|
|
20
21
|
errorLabel?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Validation rules: functions `(value, ctx) => true | 'message'` (may be async; see the built-in `required`,
|
|
24
|
+
* `email`, `minLength`…) or a Standard Schema (zod, valibot…). Checked in order; the first failure is shown
|
|
25
|
+
*/
|
|
26
|
+
rules?: ValidationRule | ValidationRule[];
|
|
27
|
+
/** When the rules are checked and shown: on leaving the field (default; live after that), while typing, or only on submit (`MForm`) */
|
|
28
|
+
validateOn?: ValidateOn;
|
|
29
|
+
/** Wait this long (ms) after the value stops changing before re-checking (one request for an async rule, not one per key). Defaults to its `MForm`'s */
|
|
30
|
+
validateDebounce?: number;
|
|
31
|
+
/** The key of this field in its `MForm`'s values, errors and schema */
|
|
32
|
+
name?: string;
|
|
21
33
|
/** Helper text below field */
|
|
22
34
|
hint?: string;
|
|
23
35
|
/** Marks as required — adds a red asterisk after the label */
|
|
@@ -35,10 +47,17 @@ type __VLS_Props = {
|
|
|
35
47
|
/** Delay (ms) before filtering and firing @debounced. Selection is always instant */
|
|
36
48
|
debounce?: number;
|
|
37
49
|
};
|
|
38
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
50
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
51
|
+
/** Checks its rules and shows the result; resolves to whether they pass */
|
|
52
|
+
validate: () => Promise<boolean>;
|
|
53
|
+
/** Hides its validation error (until the next check) */
|
|
54
|
+
resetValidation: () => void;
|
|
55
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
56
|
+
blur: () => any;
|
|
39
57
|
"update:modelValue": (args_0: unknown) => any;
|
|
40
58
|
debounced: (args_0: string) => any;
|
|
41
59
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
60
|
+
onBlur?: (() => any) | undefined;
|
|
42
61
|
"onUpdate:modelValue"?: ((args_0: unknown) => any) | undefined;
|
|
43
62
|
onDebounced?: ((args_0: string) => any) | undefined;
|
|
44
63
|
}>, {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ValidateOn, ValidationRule } from "../composables/validation";
|
|
1
2
|
type __VLS_Props = {
|
|
2
3
|
/** Checked state (v-model) */
|
|
3
4
|
modelValue: boolean;
|
|
@@ -11,6 +12,20 @@ type __VLS_Props = {
|
|
|
11
12
|
color?: "primary" | "secondary" | "tertiary" | "error";
|
|
12
13
|
/** Accessible name for the input when there's no visible label (e.g. a list row's checkbox). */
|
|
13
14
|
ariaLabel?: string;
|
|
15
|
+
/** Error state. A string is also the message */
|
|
16
|
+
error?: boolean | string;
|
|
17
|
+
/** Error message shown when `error` is true */
|
|
18
|
+
errorLabel?: string;
|
|
19
|
+
/** Must be ticked, inside an `MForm` or with `rules` */
|
|
20
|
+
required?: boolean;
|
|
21
|
+
/** Validation rules (functions or a Standard Schema); see `MForm` */
|
|
22
|
+
rules?: ValidationRule | ValidationRule[];
|
|
23
|
+
/** When the rules are checked and shown: on leaving it (default), on change, or only on submit */
|
|
24
|
+
validateOn?: ValidateOn;
|
|
25
|
+
/** Wait this long (ms) after the value stops changing before re-checking (one request for an async rule, not one per key). Defaults to its `MForm`'s */
|
|
26
|
+
validateDebounce?: number;
|
|
27
|
+
/** The key of this field in its `MForm` */
|
|
28
|
+
name?: string;
|
|
14
29
|
};
|
|
15
30
|
declare const __VLS_template: () => {
|
|
16
31
|
__VLS_Slots: {
|
|
@@ -18,9 +33,16 @@ declare const __VLS_template: () => {
|
|
|
18
33
|
};
|
|
19
34
|
};
|
|
20
35
|
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
21
|
-
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
36
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
37
|
+
/** Checks its rules and shows the result; resolves to whether they pass */
|
|
38
|
+
validate: () => Promise<boolean>;
|
|
39
|
+
/** Hides its validation error (until the next check) */
|
|
40
|
+
resetValidation: () => void;
|
|
41
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
42
|
+
blur: (args_0: FocusEvent) => any;
|
|
22
43
|
"update:modelValue": (args_0: boolean) => any;
|
|
23
44
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
45
|
+
onBlur?: ((args_0: FocusEvent) => any) | undefined;
|
|
24
46
|
"onUpdate:modelValue"?: ((args_0: boolean) => any) | undefined;
|
|
25
47
|
}>, {
|
|
26
48
|
color: "primary" | "secondary" | "tertiary" | "error";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ValidateOn, ValidationRule } from '../composables/validation';
|
|
1
2
|
type Language = 'javascript' | 'typescript' | 'json' | 'html' | 'css' | 'python' | 'vue' | 'c' | 'cpp' | 'rust' | 'asm' | 'plain';
|
|
2
3
|
type __VLS_Props = {
|
|
3
4
|
/** Editor content (v-model) */
|
|
@@ -16,6 +17,20 @@ type __VLS_Props = {
|
|
|
16
17
|
maxHeight?: string;
|
|
17
18
|
/** Placeholder text shown via CodeMirror when the editor is empty */
|
|
18
19
|
placeholder?: string;
|
|
20
|
+
/** Error state. A string is also the message */
|
|
21
|
+
error?: boolean | string;
|
|
22
|
+
/** Error message shown when `error` is true */
|
|
23
|
+
errorLabel?: string;
|
|
24
|
+
/** Inside an `MForm` or with `rules`, the code can't be blank */
|
|
25
|
+
required?: boolean;
|
|
26
|
+
/** Validation rules (functions or a Standard Schema); see `MForm` */
|
|
27
|
+
rules?: ValidationRule | ValidationRule[];
|
|
28
|
+
/** When the rules are checked and shown: on leaving it (default), on change, or only on submit */
|
|
29
|
+
validateOn?: ValidateOn;
|
|
30
|
+
/** Wait this long (ms) after the value stops changing before re-checking (one request for an async rule, not one per key). Defaults to its `MForm`'s */
|
|
31
|
+
validateDebounce?: number;
|
|
32
|
+
/** The key of this field in its `MForm` */
|
|
33
|
+
name?: string;
|
|
19
34
|
/** Word wrap */
|
|
20
35
|
wrap?: boolean;
|
|
21
36
|
};
|
|
@@ -25,9 +40,16 @@ declare const __VLS_template: () => {
|
|
|
25
40
|
};
|
|
26
41
|
};
|
|
27
42
|
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
28
|
-
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
43
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
44
|
+
/** Checks its rules and shows the result; resolves to whether they pass */
|
|
45
|
+
validate: () => Promise<boolean>;
|
|
46
|
+
/** Hides its validation error (until the next check) */
|
|
47
|
+
resetValidation: () => void;
|
|
48
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
49
|
+
blur: () => any;
|
|
29
50
|
"update:modelValue": (args_0: string) => any;
|
|
30
51
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
52
|
+
onBlur?: (() => any) | undefined;
|
|
31
53
|
"onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
|
|
32
54
|
}>, {
|
|
33
55
|
language: Language;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ValidateOn, ValidationRule } from '../composables/validation';
|
|
1
2
|
type __VLS_Props = {
|
|
2
3
|
/** Selected color in hex format (v-model). `#rrggbb`, or `#rrggbbaa` when `alpha` is on and the color isn't opaque. */
|
|
3
4
|
modelValue: string;
|
|
@@ -15,18 +16,38 @@ type __VLS_Props = {
|
|
|
15
16
|
eyedropper?: boolean;
|
|
16
17
|
/** Disables the picker */
|
|
17
18
|
disabled?: boolean;
|
|
18
|
-
/** Error state */
|
|
19
|
-
error?: boolean;
|
|
19
|
+
/** Error state. A string is also the message (`:error="errors.x"`) */
|
|
20
|
+
error?: boolean | string;
|
|
20
21
|
/** Error message shown when error is true */
|
|
21
22
|
errorLabel?: string;
|
|
23
|
+
/** Marks as required — adds a red asterisk after the label; inside an `MForm` or with `rules`, also validates it */
|
|
24
|
+
required?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Validation rules: functions `(value, ctx) => true | 'message'` (may be async; see the built-in `required`,
|
|
27
|
+
* `email`, `minLength`…) or a Standard Schema (zod, valibot…). Checked in order; the first failure is shown
|
|
28
|
+
*/
|
|
29
|
+
rules?: ValidationRule | ValidationRule[];
|
|
30
|
+
/** When the rules are checked and shown: on leaving the field (default; live after that), while typing, or only on submit (`MForm`) */
|
|
31
|
+
validateOn?: ValidateOn;
|
|
32
|
+
/** Wait this long (ms) after the value stops changing before re-checking (one request for an async rule, not one per key). Defaults to its `MForm`'s */
|
|
33
|
+
validateDebounce?: number;
|
|
34
|
+
/** The key of this field in its `MForm`'s values, errors and schema */
|
|
35
|
+
name?: string;
|
|
22
36
|
/** Hint text below the field */
|
|
23
37
|
hint?: string;
|
|
24
38
|
/** Overrides the auto-detected background color used to cut the floating label out of the border */
|
|
25
39
|
fieldBg?: string;
|
|
26
40
|
};
|
|
27
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
41
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
42
|
+
/** Checks its rules and shows the result; resolves to whether they pass */
|
|
43
|
+
validate: () => Promise<boolean>;
|
|
44
|
+
/** Hides its validation error (until the next check) */
|
|
45
|
+
resetValidation: () => void;
|
|
46
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
47
|
+
blur: () => any;
|
|
28
48
|
"update:modelValue": (args_0: string) => any;
|
|
29
49
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
50
|
+
onBlur?: (() => any) | undefined;
|
|
30
51
|
"onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
|
|
31
52
|
}>, {
|
|
32
53
|
presets: string[];
|
|
@@ -17,11 +17,11 @@ type __VLS_Props = {
|
|
|
17
17
|
closable?: boolean;
|
|
18
18
|
};
|
|
19
19
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
|
-
"update:modelValue": (args_0: boolean) => any;
|
|
21
20
|
confirm: () => any;
|
|
21
|
+
"update:modelValue": (args_0: boolean) => any;
|
|
22
22
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
23
|
-
"onUpdate:modelValue"?: ((args_0: boolean) => any) | undefined;
|
|
24
23
|
onConfirm?: (() => any) | undefined;
|
|
24
|
+
"onUpdate:modelValue"?: ((args_0: boolean) => any) | undefined;
|
|
25
25
|
}>, {
|
|
26
26
|
loading: boolean;
|
|
27
27
|
danger: boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ValidateOn, ValidationRule } from '../composables/validation';
|
|
1
2
|
type __VLS_Props = {
|
|
2
3
|
/** The country's ISO alpha-2 code (v-model), or null */
|
|
3
4
|
modelValue?: string | null;
|
|
@@ -17,18 +18,28 @@ type __VLS_Props = {
|
|
|
17
18
|
clearable?: boolean;
|
|
18
19
|
/** Helper text below the field */
|
|
19
20
|
hint?: string;
|
|
20
|
-
/** Error state */
|
|
21
|
-
error?: boolean;
|
|
21
|
+
/** Error state. A string is also the message */
|
|
22
|
+
error?: boolean | string;
|
|
22
23
|
/** Error message shown when `error` is true */
|
|
23
24
|
errorLabel?: string;
|
|
25
|
+
/** Validation rules (functions or a Standard Schema); see `MForm` */
|
|
26
|
+
rules?: ValidationRule | ValidationRule[];
|
|
27
|
+
/** When the rules are checked and shown: on leaving the field (default), while typing, or only on submit */
|
|
28
|
+
validateOn?: ValidateOn;
|
|
29
|
+
/** Wait this long (ms) after the value stops changing before re-checking (one request for an async rule, not one per key). Defaults to its `MForm`'s */
|
|
30
|
+
validateDebounce?: number;
|
|
31
|
+
/** The key of this field in its `MForm` */
|
|
32
|
+
name?: string;
|
|
24
33
|
/** Marks it as required */
|
|
25
34
|
required?: boolean;
|
|
26
35
|
/** Disables the field */
|
|
27
36
|
disabled?: boolean;
|
|
28
37
|
};
|
|
29
38
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
39
|
+
blur: () => any;
|
|
30
40
|
"update:modelValue": (code: string | null) => any;
|
|
31
41
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
42
|
+
onBlur?: (() => any) | undefined;
|
|
32
43
|
"onUpdate:modelValue"?: ((code: string | null) => any) | undefined;
|
|
33
44
|
}>, {
|
|
34
45
|
mode: "docked" | "modal";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ValidateOn, ValidationRule } from '../composables/validation';
|
|
1
2
|
import { type CardBrand } from '../composables/cardBrand';
|
|
2
3
|
/** Value of `MCreditCardInput` (v-model). `number` holds digits only; `expiry` is `MM/YY`. */
|
|
3
4
|
export interface CreditCardValue {
|
|
@@ -24,6 +25,20 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
24
25
|
errors?: Partial<Record<CreditCardField, string>>;
|
|
25
26
|
/** Disables every field */
|
|
26
27
|
disabled?: boolean;
|
|
28
|
+
/** Error state for the whole card (e.g. a decline). A string is also the message */
|
|
29
|
+
error?: boolean | string;
|
|
30
|
+
/** Error message shown when `error` is true */
|
|
31
|
+
errorLabel?: string;
|
|
32
|
+
/** Inside an `MForm` or with `rules`, an empty card fails (an empty optional card passes; a half-typed one never does) */
|
|
33
|
+
required?: boolean;
|
|
34
|
+
/** More validation rules on the whole value (functions or a Standard Schema); see `MForm` */
|
|
35
|
+
rules?: ValidationRule | ValidationRule[];
|
|
36
|
+
/** When the rules are checked and shown: on leaving the card fields (default), while typing, or only on submit */
|
|
37
|
+
validateOn?: ValidateOn;
|
|
38
|
+
/** Wait this long (ms) after the value stops changing before re-checking (one request for an async rule, not one per key). Defaults to its `MForm`'s */
|
|
39
|
+
validateDebounce?: number;
|
|
40
|
+
/** The key of the card value in its `MForm` */
|
|
41
|
+
name?: string;
|
|
27
42
|
}, {
|
|
28
43
|
/** Detected card network */
|
|
29
44
|
brand: import("vue").ComputedRef<CardBrand>;
|
|
@@ -31,9 +46,12 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
31
46
|
valid: import("vue").ComputedRef<boolean>;
|
|
32
47
|
/** Shows the errors of every field (as if each had been visited) and returns whether all are valid */
|
|
33
48
|
validate: () => boolean;
|
|
49
|
+
/** Hides every error until the fields are left again */
|
|
50
|
+
resetValidation: () => void;
|
|
34
51
|
/** Focuses a field (the number by default) */
|
|
35
52
|
focus: (field?: CreditCardField) => void | undefined;
|
|
36
53
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
54
|
+
blur: () => any;
|
|
37
55
|
"update:modelValue": (args_0: CreditCardValue) => any;
|
|
38
56
|
complete: (args_0: CreditCardValue) => any;
|
|
39
57
|
brand: (args_0: CardBrand) => any;
|
|
@@ -52,7 +70,22 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
52
70
|
errors?: Partial<Record<CreditCardField, string>>;
|
|
53
71
|
/** Disables every field */
|
|
54
72
|
disabled?: boolean;
|
|
73
|
+
/** Error state for the whole card (e.g. a decline). A string is also the message */
|
|
74
|
+
error?: boolean | string;
|
|
75
|
+
/** Error message shown when `error` is true */
|
|
76
|
+
errorLabel?: string;
|
|
77
|
+
/** Inside an `MForm` or with `rules`, an empty card fails (an empty optional card passes; a half-typed one never does) */
|
|
78
|
+
required?: boolean;
|
|
79
|
+
/** More validation rules on the whole value (functions or a Standard Schema); see `MForm` */
|
|
80
|
+
rules?: ValidationRule | ValidationRule[];
|
|
81
|
+
/** When the rules are checked and shown: on leaving the card fields (default), while typing, or only on submit */
|
|
82
|
+
validateOn?: ValidateOn;
|
|
83
|
+
/** Wait this long (ms) after the value stops changing before re-checking (one request for an async rule, not one per key). Defaults to its `MForm`'s */
|
|
84
|
+
validateDebounce?: number;
|
|
85
|
+
/** The key of the card value in its `MForm` */
|
|
86
|
+
name?: string;
|
|
55
87
|
}> & Readonly<{
|
|
88
|
+
onBlur?: (() => any) | undefined;
|
|
56
89
|
"onUpdate:modelValue"?: ((args_0: CreditCardValue) => any) | undefined;
|
|
57
90
|
onComplete?: ((args_0: CreditCardValue) => any) | undefined;
|
|
58
91
|
onBrand?: ((args_0: CardBrand) => any) | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ValidateOn, ValidationRule } from '../composables/validation';
|
|
1
2
|
type __VLS_Props = {
|
|
2
3
|
/** The expression (v-model): `minute hour day-of-month month day-of-week`, or a macro (`@daily`) */
|
|
3
4
|
modelValue: string;
|
|
@@ -11,10 +12,31 @@ type __VLS_Props = {
|
|
|
11
12
|
variant?: 'filled' | 'outlined';
|
|
12
13
|
/** Disables it */
|
|
13
14
|
disabled?: boolean;
|
|
15
|
+
/** Error state. A string is also the message */
|
|
16
|
+
error?: boolean | string;
|
|
17
|
+
/** Error message shown when `error` is true */
|
|
18
|
+
errorLabel?: string;
|
|
19
|
+
/** Marks it as required; inside an `MForm` or with `rules`, an expression must be set */
|
|
20
|
+
required?: boolean;
|
|
21
|
+
/** Validation rules (functions or a Standard Schema); see `MForm` */
|
|
22
|
+
rules?: ValidationRule | ValidationRule[];
|
|
23
|
+
/** When the rules are checked and shown: on leaving it (default), on change, or only on submit */
|
|
24
|
+
validateOn?: ValidateOn;
|
|
25
|
+
/** Wait this long (ms) after the value stops changing before re-checking (one request for an async rule, not one per key). Defaults to its `MForm`'s */
|
|
26
|
+
validateDebounce?: number;
|
|
27
|
+
/** The key of this field in its `MForm` */
|
|
28
|
+
name?: string;
|
|
14
29
|
};
|
|
15
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
30
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
31
|
+
/** Checks its rules and shows the result; resolves to whether they pass */
|
|
32
|
+
validate: () => Promise<boolean>;
|
|
33
|
+
/** Hides its validation error (until the next check) */
|
|
34
|
+
resetValidation: () => void;
|
|
35
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
36
|
+
blur: () => any;
|
|
16
37
|
"update:modelValue": (expression: string) => any;
|
|
17
38
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
39
|
+
onBlur?: (() => any) | undefined;
|
|
18
40
|
"onUpdate:modelValue"?: ((expression: string) => any) | undefined;
|
|
19
41
|
}>, {
|
|
20
42
|
variant: "filled" | "outlined";
|
|
@@ -118,8 +118,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
118
118
|
onRowClick?: ((args_0: Record<string, any>) => any) | undefined;
|
|
119
119
|
onFetch?: ((args_0: DataTableFetchParams) => any) | undefined;
|
|
120
120
|
}>, {
|
|
121
|
-
modelValue: Record<string, any>[];
|
|
122
121
|
loading: boolean;
|
|
122
|
+
modelValue: Record<string, any>[];
|
|
123
123
|
page: number;
|
|
124
124
|
selectable: boolean;
|
|
125
125
|
dense: boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ValidateOn, ValidationRule } from '../composables/validation';
|
|
1
2
|
type __VLS_Props = {
|
|
2
3
|
/** Selected date (YYYY-MM-DD, v-model) */
|
|
3
4
|
modelValue: string | null;
|
|
@@ -16,10 +17,23 @@ type __VLS_Props = {
|
|
|
16
17
|
yearRange?: [number, number];
|
|
17
18
|
/** Disables the picker */
|
|
18
19
|
disabled?: boolean;
|
|
19
|
-
/** Error state */
|
|
20
|
-
error?: boolean;
|
|
20
|
+
/** Error state. A string is also the message (`:error="errors.x"`) */
|
|
21
|
+
error?: boolean | string;
|
|
21
22
|
/** Error message shown when error is true */
|
|
22
23
|
errorLabel?: string;
|
|
24
|
+
/** Marks as required — adds a red asterisk after the label; inside an `MForm` or with `rules`, also validates it */
|
|
25
|
+
required?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Validation rules: functions `(value, ctx) => true | 'message'` (may be async; see the built-in `required`,
|
|
28
|
+
* `email`, `minLength`…) or a Standard Schema (zod, valibot…). Checked in order; the first failure is shown
|
|
29
|
+
*/
|
|
30
|
+
rules?: ValidationRule | ValidationRule[];
|
|
31
|
+
/** When the rules are checked and shown: on leaving the field (default; live after that), while typing, or only on submit (`MForm`) */
|
|
32
|
+
validateOn?: ValidateOn;
|
|
33
|
+
/** Wait this long (ms) after the value stops changing before re-checking (one request for an async rule, not one per key). Defaults to its `MForm`'s */
|
|
34
|
+
validateDebounce?: number;
|
|
35
|
+
/** The key of this field in its `MForm`'s values, errors and schema */
|
|
36
|
+
name?: string;
|
|
23
37
|
/** Hint text below the field */
|
|
24
38
|
hint?: string;
|
|
25
39
|
/**
|
|
@@ -34,9 +48,16 @@ type __VLS_Props = {
|
|
|
34
48
|
/** Aria label for the next-month button — defaults to the current locale's string */
|
|
35
49
|
nextMonthLabel?: string;
|
|
36
50
|
};
|
|
37
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
51
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
52
|
+
/** Checks its rules and shows the result; resolves to whether they pass */
|
|
53
|
+
validate: () => Promise<boolean>;
|
|
54
|
+
/** Hides its validation error (until the next check) */
|
|
55
|
+
resetValidation: () => void;
|
|
56
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
57
|
+
blur: () => any;
|
|
38
58
|
"update:modelValue": (args_0: string | null) => any;
|
|
39
59
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
60
|
+
onBlur?: (() => any) | undefined;
|
|
40
61
|
"onUpdate:modelValue"?: ((args_0: string | null) => any) | undefined;
|
|
41
62
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
42
63
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ValidateOn, ValidationRule } from '../composables/validation';
|
|
1
2
|
export interface DateRange {
|
|
2
3
|
start: string | null;
|
|
3
4
|
end: string | null;
|
|
@@ -20,10 +21,23 @@ type __VLS_Props = {
|
|
|
20
21
|
yearRange?: [number, number];
|
|
21
22
|
/** Disables the picker */
|
|
22
23
|
disabled?: boolean;
|
|
23
|
-
/** Error state */
|
|
24
|
-
error?: boolean;
|
|
24
|
+
/** Error state. A string is also the message (`:error="errors.x"`) */
|
|
25
|
+
error?: boolean | string;
|
|
25
26
|
/** Error message shown when error is true */
|
|
26
27
|
errorLabel?: string;
|
|
28
|
+
/** Marks as required — adds a red asterisk after the label; inside an `MForm` or with `rules`, also validates it */
|
|
29
|
+
required?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Validation rules: functions `(value, ctx) => true | 'message'` (may be async; see the built-in `required`,
|
|
32
|
+
* `email`, `minLength`…) or a Standard Schema (zod, valibot…). Checked in order; the first failure is shown
|
|
33
|
+
*/
|
|
34
|
+
rules?: ValidationRule | ValidationRule[];
|
|
35
|
+
/** When the rules are checked and shown: on leaving the field (default; live after that), while typing, or only on submit (`MForm`) */
|
|
36
|
+
validateOn?: ValidateOn;
|
|
37
|
+
/** Wait this long (ms) after the value stops changing before re-checking (one request for an async rule, not one per key). Defaults to its `MForm`'s */
|
|
38
|
+
validateDebounce?: number;
|
|
39
|
+
/** The key of this field in its `MForm`'s values, errors and schema */
|
|
40
|
+
name?: string;
|
|
27
41
|
/** Hint text below the field */
|
|
28
42
|
hint?: string;
|
|
29
43
|
/**
|
|
@@ -42,9 +56,16 @@ type __VLS_Props = {
|
|
|
42
56
|
/** Header text shown while picking the end date — defaults to the current locale's string */
|
|
43
57
|
pickEndText?: string;
|
|
44
58
|
};
|
|
45
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
59
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
60
|
+
/** Checks its rules and shows the result; resolves to whether they pass */
|
|
61
|
+
validate: () => Promise<boolean>;
|
|
62
|
+
/** Hides its validation error (until the next check) */
|
|
63
|
+
resetValidation: () => void;
|
|
64
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
65
|
+
blur: () => any;
|
|
46
66
|
"update:modelValue": (args_0: DateRange) => any;
|
|
47
67
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
68
|
+
onBlur?: (() => any) | undefined;
|
|
48
69
|
"onUpdate:modelValue"?: ((args_0: DateRange) => any) | undefined;
|
|
49
70
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
50
71
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ValidateOn, ValidationRule } from '../composables/validation';
|
|
1
2
|
export interface UploadFile {
|
|
2
3
|
file: File;
|
|
3
4
|
id: string;
|
|
@@ -24,6 +25,20 @@ type __VLS_Props = {
|
|
|
24
25
|
removeLabel?: string;
|
|
25
26
|
/** Optional v-model. Bind it to own the list: clear it, or update each entry's status/progress. Unbound, the component keeps the list itself. */
|
|
26
27
|
modelValue?: UploadFile[];
|
|
28
|
+
/** Error state. A string is also the message */
|
|
29
|
+
error?: boolean | string;
|
|
30
|
+
/** Error message shown when `error` is true */
|
|
31
|
+
errorLabel?: string;
|
|
32
|
+
/** Inside an `MForm` or with `rules`, at least one file must be chosen */
|
|
33
|
+
required?: boolean;
|
|
34
|
+
/** Validation rules on the file list (functions or a Standard Schema); `minLength`/`maxLength` count files. See `MForm` */
|
|
35
|
+
rules?: ValidationRule | ValidationRule[];
|
|
36
|
+
/** When the rules are checked and shown: on leaving it (default), on change, or only on submit */
|
|
37
|
+
validateOn?: ValidateOn;
|
|
38
|
+
/** Wait this long (ms) after the value stops changing before re-checking (one request for an async rule, not one per key). Defaults to its `MForm`'s */
|
|
39
|
+
validateDebounce?: number;
|
|
40
|
+
/** The key of this field in its `MForm` */
|
|
41
|
+
name?: string;
|
|
27
42
|
};
|
|
28
43
|
type __VLS_Slots = {
|
|
29
44
|
dropzone?: () => unknown;
|
|
@@ -37,14 +52,20 @@ declare function clear(): void;
|
|
|
37
52
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
38
53
|
clear: typeof clear;
|
|
39
54
|
files: import("vue").ComputedRef<UploadFile[]>;
|
|
55
|
+
/** Checks its rules and shows the result; resolves to whether they pass */
|
|
56
|
+
validate: () => Promise<boolean>;
|
|
57
|
+
/** Hides its validation error (until the next check) */
|
|
58
|
+
resetValidation: () => void;
|
|
40
59
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
41
60
|
select: (args_0: UploadFile[]) => any;
|
|
42
|
-
"update:modelValue": (args_0: UploadFile[]) => any;
|
|
43
61
|
remove: (args_0: UploadFile) => any;
|
|
62
|
+
blur: () => any;
|
|
63
|
+
"update:modelValue": (args_0: UploadFile[]) => any;
|
|
44
64
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
45
65
|
onSelect?: ((args_0: UploadFile[]) => any) | undefined;
|
|
46
|
-
"onUpdate:modelValue"?: ((args_0: UploadFile[]) => any) | undefined;
|
|
47
66
|
onRemove?: ((args_0: UploadFile) => any) | undefined;
|
|
67
|
+
onBlur?: (() => any) | undefined;
|
|
68
|
+
"onUpdate:modelValue"?: ((args_0: UploadFile[]) => any) | undefined;
|
|
48
69
|
}>, {
|
|
49
70
|
disabled: boolean;
|
|
50
71
|
multiple: boolean;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type StandardSchemaV1, type ValidateOn } from '../composables/validation';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** Errors from outside, by field name (a string or the first of an array): a server's response, vee-validate's `errors`. Shown over the fields' own rules */
|
|
4
|
+
errors?: Record<string, string | string[] | null | undefined>;
|
|
5
|
+
/** A schema for the whole form (zod, valibot, arktype… any Standard Schema), run against the values by name */
|
|
6
|
+
schema?: StandardSchemaV1;
|
|
7
|
+
/** When the fields check and show their rules, unless a field sets its own: on leaving it (default), while typing, or only on submit */
|
|
8
|
+
validateOn?: ValidateOn;
|
|
9
|
+
/** Default for every field: wait this long (ms) after a value stops changing before re-checking it, so an async rule makes one request, not one per key */
|
|
10
|
+
validateDebounce?: number;
|
|
11
|
+
/** Keep an `errors` message after its field changes. By default it hides as soon as the user edits that field, until a new `errors` object comes */
|
|
12
|
+
keepErrors?: boolean;
|
|
13
|
+
/** Disables every control inside (through a native `<fieldset disabled>`) and skips their validation */
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Validates every field, or only the ones named (a step of a wizard), showing their errors; resolves to whether
|
|
18
|
+
* they all pass. `focus` moves the focus to the first one in error, as a submit does.
|
|
19
|
+
*/
|
|
20
|
+
declare function validate(names?: string[], options?: {
|
|
21
|
+
focus?: boolean;
|
|
22
|
+
}): Promise<boolean>;
|
|
23
|
+
/** Puts every field back to the value it had when it mounted and clears their errors */
|
|
24
|
+
declare function reset(): Promise<void>;
|
|
25
|
+
/** Hides every error (or the named fields' ones) without touching the values */
|
|
26
|
+
declare function resetValidation(names?: string[]): void;
|
|
27
|
+
declare const __VLS_template: () => {
|
|
28
|
+
__VLS_Slots: {
|
|
29
|
+
default?: (props: {}) => any;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
33
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
34
|
+
validate: typeof validate;
|
|
35
|
+
reset: typeof reset;
|
|
36
|
+
resetValidation: typeof resetValidation;
|
|
37
|
+
/** Whether every field's rules pass right now (checked silently, shown or not) */
|
|
38
|
+
valid: import("vue").ComputedRef<boolean>;
|
|
39
|
+
/** Whether async rules are still running */
|
|
40
|
+
pending: import("vue").ComputedRef<boolean>;
|
|
41
|
+
/** The messages on display, by field name */
|
|
42
|
+
errors: import("vue").ComputedRef<Record<string, string>>;
|
|
43
|
+
/** The values by name (dotted names nested) */
|
|
44
|
+
values: import("vue").ComputedRef<Record<string, any>>;
|
|
45
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
46
|
+
reset: () => any;
|
|
47
|
+
submit: (values: any, event: SubmitEvent) => any;
|
|
48
|
+
invalid: (errors: Record<string, string>) => any;
|
|
49
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
50
|
+
onReset?: (() => any) | undefined;
|
|
51
|
+
onSubmit?: ((values: any, event: SubmitEvent) => any) | undefined;
|
|
52
|
+
onInvalid?: ((errors: Record<string, string>) => any) | undefined;
|
|
53
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
54
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
55
|
+
declare const _default: typeof __VLS_export;
|
|
56
|
+
export default _default;
|
|
57
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
58
|
+
new (): {
|
|
59
|
+
$slots: S;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type FormFieldType, type FormSchema } from './MFormRenderer.vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** The form being built (v-model) */
|
|
4
|
+
modelValue?: FormSchema;
|
|
5
|
+
/** The field types in the palette, in order. All by default */
|
|
6
|
+
types?: FormFieldType[];
|
|
7
|
+
};
|
|
8
|
+
declare function add(type: FormFieldType): void;
|
|
9
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
10
|
+
/** Adds a field of this type (after the selected one) */
|
|
11
|
+
add: typeof add;
|
|
12
|
+
/** Selects a field by its index in the schema */
|
|
13
|
+
select: (index: number) => void;
|
|
14
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
|
+
"update:modelValue": (schema: FormSchema) => any;
|
|
16
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
17
|
+
"onUpdate:modelValue"?: ((schema: FormSchema) => any) | undefined;
|
|
18
|
+
}>, {
|
|
19
|
+
modelValue: FormSchema;
|
|
20
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
declare const _default: typeof __VLS_export;
|
|
22
|
+
export default _default;
|