@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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ValidateOn, ValidationRule } from '../composables/validation';
|
|
1
2
|
interface Option {
|
|
2
3
|
label: string;
|
|
3
4
|
value: unknown;
|
|
@@ -16,10 +17,31 @@ type __VLS_Props = {
|
|
|
16
17
|
disabled?: boolean;
|
|
17
18
|
/** Radio color */
|
|
18
19
|
color?: 'primary' | 'secondary' | 'tertiary' | 'error';
|
|
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
|
+
/** Marks it as required (asterisk); inside an `MForm` or with `rules`, an option must be picked */
|
|
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
|
};
|
|
20
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
35
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
36
|
+
/** Checks its rules and shows the result; resolves to whether they pass */
|
|
37
|
+
validate: () => Promise<boolean>;
|
|
38
|
+
/** Hides its validation error (until the next check) */
|
|
39
|
+
resetValidation: () => void;
|
|
40
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
41
|
+
blur: () => any;
|
|
21
42
|
"update:modelValue": (args_0: unknown) => any;
|
|
22
43
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
44
|
+
onBlur?: (() => any) | undefined;
|
|
23
45
|
"onUpdate:modelValue"?: ((args_0: unknown) => any) | undefined;
|
|
24
46
|
}>, {
|
|
25
47
|
color: "primary" | "secondary" | "tertiary" | "error";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ValidateOn, ValidationRule } from '../composables/validation';
|
|
1
2
|
type __VLS_Props = {
|
|
2
3
|
/** Current rating (v-model) */
|
|
3
4
|
modelValue: number;
|
|
@@ -18,10 +19,31 @@ type __VLS_Props = {
|
|
|
18
19
|
* without this prop
|
|
19
20
|
*/
|
|
20
21
|
halfIncrements?: boolean;
|
|
22
|
+
/** Error state. A string is also the message */
|
|
23
|
+
error?: boolean | string;
|
|
24
|
+
/** Error message shown when `error` is true */
|
|
25
|
+
errorLabel?: string;
|
|
26
|
+
/** Inside an `MForm` or with `rules`, 0 (not rated) fails */
|
|
27
|
+
required?: boolean;
|
|
28
|
+
/** Validation rules (functions or a Standard Schema); see `MForm` */
|
|
29
|
+
rules?: ValidationRule | ValidationRule[];
|
|
30
|
+
/** When the rules are checked and shown: on leaving it (default), on change, or only on submit */
|
|
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` */
|
|
35
|
+
name?: string;
|
|
21
36
|
};
|
|
22
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
37
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
38
|
+
/** Checks its rules and shows the result; resolves to whether they pass */
|
|
39
|
+
validate: () => Promise<boolean>;
|
|
40
|
+
/** Hides its validation error (until the next check) */
|
|
41
|
+
resetValidation: () => void;
|
|
42
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
43
|
+
blur: () => any;
|
|
23
44
|
"update:modelValue": (args_0: number) => any;
|
|
24
45
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
46
|
+
onBlur?: (() => any) | undefined;
|
|
25
47
|
"onUpdate:modelValue"?: ((args_0: number) => any) | undefined;
|
|
26
48
|
}>, {
|
|
27
49
|
color: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ValidateOn, ValidationRule } from '../composables/validation';
|
|
1
2
|
export interface RichTextEditorLabels {
|
|
2
3
|
bold?: string;
|
|
3
4
|
italic?: string;
|
|
@@ -32,6 +33,20 @@ type __VLS_Props = {
|
|
|
32
33
|
placeholder?: string;
|
|
33
34
|
/** Disables editing */
|
|
34
35
|
disabled?: boolean;
|
|
36
|
+
/** Error state. A string is also the message */
|
|
37
|
+
error?: boolean | string;
|
|
38
|
+
/** Error message shown when `error` is true */
|
|
39
|
+
errorLabel?: string;
|
|
40
|
+
/** Inside an `MForm` or with `rules`, the document must have some text (or an image) */
|
|
41
|
+
required?: boolean;
|
|
42
|
+
/** Validation rules (functions or a Standard Schema); see `MForm` */
|
|
43
|
+
rules?: ValidationRule | ValidationRule[];
|
|
44
|
+
/** When the rules are checked and shown: on leaving it (default), on change, or only on submit */
|
|
45
|
+
validateOn?: ValidateOn;
|
|
46
|
+
/** 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 */
|
|
47
|
+
validateDebounce?: number;
|
|
48
|
+
/** The key of this field in its `MForm` */
|
|
49
|
+
name?: string;
|
|
35
50
|
/** Minimum height of the text area (not used with `fill`) */
|
|
36
51
|
minHeight?: string;
|
|
37
52
|
/**
|
|
@@ -45,9 +60,16 @@ type __VLS_Props = {
|
|
|
45
60
|
*/
|
|
46
61
|
labels?: RichTextEditorLabels;
|
|
47
62
|
};
|
|
48
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
63
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
64
|
+
/** Checks its rules and shows the result; resolves to whether they pass */
|
|
65
|
+
validate: () => Promise<boolean>;
|
|
66
|
+
/** Hides its validation error (until the next check) */
|
|
67
|
+
resetValidation: () => void;
|
|
68
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
69
|
+
blur: () => any;
|
|
49
70
|
"update:modelValue": (args_0: string) => any;
|
|
50
71
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
72
|
+
onBlur?: (() => any) | undefined;
|
|
51
73
|
"onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
|
|
52
74
|
}>, {
|
|
53
75
|
fill: boolean;
|
|
@@ -48,8 +48,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
48
48
|
"onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
|
|
49
49
|
"onUpdate:expanded"?: ((args_0: boolean) => any) | undefined;
|
|
50
50
|
}>, {
|
|
51
|
-
modelValue: string;
|
|
52
51
|
loading: boolean;
|
|
52
|
+
modelValue: string;
|
|
53
53
|
variant: "fullscreen" | "docked" | "fullscreen-contained";
|
|
54
54
|
disabled: boolean;
|
|
55
55
|
leadingIcon: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ValidateOn, ValidationRule } from '../composables/validation';
|
|
1
2
|
export interface SegmentedOption<V extends string | number = string | number> {
|
|
2
3
|
value: V;
|
|
3
4
|
label: string;
|
|
@@ -18,15 +19,35 @@ declare const __VLS_export: <V extends string | number, M extends V | V[] = V>(_
|
|
|
18
19
|
density?: "default" | "comfortable" | "compact";
|
|
19
20
|
/** Selected segment color */
|
|
20
21
|
color?: "primary" | "secondary" | "tertiary";
|
|
22
|
+
/** Error state. A string is also the message */
|
|
23
|
+
error?: boolean | string;
|
|
24
|
+
/** Error message shown when `error` is true */
|
|
25
|
+
errorLabel?: string;
|
|
26
|
+
/** Inside an `MForm` or with `rules`, a segment must be selected */
|
|
27
|
+
required?: boolean;
|
|
28
|
+
/** Validation rules (functions or a Standard Schema); see `MForm` */
|
|
29
|
+
rules?: ValidationRule | ValidationRule[];
|
|
30
|
+
/** When the rules are checked and shown: on leaving it (default), on change, or only on submit */
|
|
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` */
|
|
35
|
+
name?: string;
|
|
21
36
|
} & {
|
|
37
|
+
onBlur?: (() => any) | undefined;
|
|
22
38
|
"onUpdate:modelValue"?: ((args_0: M) => any) | undefined;
|
|
23
39
|
}> & (typeof globalThis extends {
|
|
24
40
|
__VLS_PROPS_FALLBACK: infer P;
|
|
25
41
|
} ? P : {});
|
|
26
|
-
expose: (exposed: {
|
|
42
|
+
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
43
|
+
/** Checks its rules and shows the result; resolves to whether they pass */
|
|
44
|
+
validate: () => Promise<boolean>;
|
|
45
|
+
/** Hides its validation error (until the next check) */
|
|
46
|
+
resetValidation: () => void;
|
|
47
|
+
}>) => void;
|
|
27
48
|
attrs: any;
|
|
28
49
|
slots: {};
|
|
29
|
-
emit: (evt: "update:modelValue", args_0: M) => void;
|
|
50
|
+
emit: ((evt: "blur") => void) & ((evt: "update:modelValue", args_0: M) => void);
|
|
30
51
|
}>) => import("vue").VNode & {
|
|
31
52
|
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
32
53
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ValidateOn, ValidationRule } from '../composables/validation';
|
|
1
2
|
export interface SelectOption {
|
|
2
3
|
label: string;
|
|
3
4
|
value: unknown;
|
|
@@ -18,10 +19,21 @@ type __VLS_Props = {
|
|
|
18
19
|
mode?: 'docked' | 'modal';
|
|
19
20
|
/** Disables the select */
|
|
20
21
|
disabled?: boolean;
|
|
21
|
-
/** Error state */
|
|
22
|
-
error?: boolean;
|
|
22
|
+
/** Error state. A string is also the message (`:error="errors.x"`) */
|
|
23
|
+
error?: boolean | string;
|
|
23
24
|
/** Error message shown when error is true */
|
|
24
25
|
errorLabel?: string;
|
|
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;
|
|
25
37
|
/** Hint text below the field */
|
|
26
38
|
hint?: string;
|
|
27
39
|
/** Marks as required — adds a red asterisk after the label */
|
|
@@ -37,9 +49,16 @@ type __VLS_Props = {
|
|
|
37
49
|
/** Text shown when options is empty — defaults to the current locale's string */
|
|
38
50
|
noResultsText?: string;
|
|
39
51
|
};
|
|
40
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
52
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
53
|
+
/** Checks its rules and shows the result; resolves to whether they pass */
|
|
54
|
+
validate: () => Promise<boolean>;
|
|
55
|
+
/** Hides its validation error (until the next check) */
|
|
56
|
+
resetValidation: () => void;
|
|
57
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
58
|
+
blur: () => any;
|
|
41
59
|
"update:modelValue": (args_0: unknown) => any;
|
|
42
60
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
61
|
+
onBlur?: (() => any) | undefined;
|
|
43
62
|
"onUpdate:modelValue"?: ((args_0: unknown) => any) | undefined;
|
|
44
63
|
}>, {
|
|
45
64
|
required: boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ValidateOn, ValidationRule } from '../composables/validation';
|
|
1
2
|
type __VLS_Props = {
|
|
2
3
|
/** Canvas width in px */
|
|
3
4
|
width?: number;
|
|
@@ -13,6 +14,20 @@ type __VLS_Props = {
|
|
|
13
14
|
variant?: 'filled' | 'outlined';
|
|
14
15
|
/** Disables drawing */
|
|
15
16
|
disabled?: boolean;
|
|
17
|
+
/** Error state. A string is also the message */
|
|
18
|
+
error?: boolean | string;
|
|
19
|
+
/** Error message shown when `error` is true */
|
|
20
|
+
errorLabel?: string;
|
|
21
|
+
/** Inside an `MForm` or with `rules`, a signature must be drawn */
|
|
22
|
+
required?: boolean;
|
|
23
|
+
/** Validation rules (functions or a Standard Schema); see `MForm` */
|
|
24
|
+
rules?: ValidationRule | ValidationRule[];
|
|
25
|
+
/** When the rules are checked and shown: after each stroke (default), or only on submit */
|
|
26
|
+
validateOn?: ValidateOn;
|
|
27
|
+
/** 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 */
|
|
28
|
+
validateDebounce?: number;
|
|
29
|
+
/** The key of this field in its `MForm` */
|
|
30
|
+
name?: string;
|
|
16
31
|
};
|
|
17
32
|
declare function clear(): void;
|
|
18
33
|
declare function undo(): void;
|
|
@@ -23,6 +38,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
23
38
|
undo: typeof undo;
|
|
24
39
|
isEmpty: typeof isEmpty;
|
|
25
40
|
toDataURL: typeof toDataURL;
|
|
41
|
+
/** Checks its rules and shows the result; resolves to whether they pass */
|
|
42
|
+
validate: () => Promise<boolean>;
|
|
43
|
+
/** Hides its validation error (until the next check) */
|
|
44
|
+
resetValidation: () => void;
|
|
26
45
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
27
46
|
change: (args_0: string) => any;
|
|
28
47
|
end: (args_0: string) => any;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ValidateOn, ValidationRule } from '../composables/validation';
|
|
1
2
|
type __VLS_Props = {
|
|
2
3
|
/** Current value — a tuple when variant is range */
|
|
3
4
|
modelValue: number | [number, number];
|
|
@@ -11,6 +12,20 @@ type __VLS_Props = {
|
|
|
11
12
|
disabled?: boolean;
|
|
12
13
|
/** Label text */
|
|
13
14
|
label?: 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
|
+
/** Marks it as required (asterisk); a slider always has a value, so use `rules` (e.g. `min(1)`) for limits */
|
|
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
|
/** Show current value beside label */
|
|
15
30
|
showValue?: boolean;
|
|
16
31
|
/** Show value tooltip while dragging */
|
|
@@ -34,9 +49,16 @@ type __VLS_Props = {
|
|
|
34
49
|
/** Custom color (hex, rgb(), a CSS var, etc.) for the thumb (bar or icon). Defaults to `color`'s M3 token. */
|
|
35
50
|
thumbColor?: string;
|
|
36
51
|
};
|
|
37
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
52
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
53
|
+
/** Checks its rules and shows the result; resolves to whether they pass */
|
|
54
|
+
validate: () => Promise<boolean>;
|
|
55
|
+
/** Hides its validation error (until the next check) */
|
|
56
|
+
resetValidation: () => void;
|
|
57
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
58
|
+
blur: () => any;
|
|
38
59
|
"update:modelValue": (args_0: number | [number, number]) => any;
|
|
39
60
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
61
|
+
onBlur?: (() => any) | undefined;
|
|
40
62
|
"onUpdate:modelValue"?: ((args_0: number | [number, number]) => any) | undefined;
|
|
41
63
|
}>, {
|
|
42
64
|
color: "primary" | "secondary" | "tertiary" | "error";
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { type SpreadsheetFunction, type SpreadsheetValue } from '../composables/spreadsheetFormula';
|
|
2
|
+
import type { SpreadsheetCell } from '../composables/spreadsheetFormula';
|
|
3
|
+
/** A cell's position, 0-based */
|
|
4
|
+
export interface SpreadsheetPosition {
|
|
5
|
+
row: number;
|
|
6
|
+
col: number;
|
|
7
|
+
}
|
|
8
|
+
/** A block of cells, corners included */
|
|
9
|
+
export interface SpreadsheetRange {
|
|
10
|
+
start: SpreadsheetPosition;
|
|
11
|
+
end: SpreadsheetPosition;
|
|
12
|
+
}
|
|
13
|
+
/** One cell written by an edit, a paste, a fill or a clear */
|
|
14
|
+
export interface SpreadsheetChange {
|
|
15
|
+
row: number;
|
|
16
|
+
col: number;
|
|
17
|
+
value: SpreadsheetCell;
|
|
18
|
+
oldValue: SpreadsheetCell;
|
|
19
|
+
}
|
|
20
|
+
declare const _default: typeof __VLS_export;
|
|
21
|
+
export default _default;
|
|
22
|
+
declare const __VLS_export: import("vue").DefineComponent<{
|
|
23
|
+
/** The cells, row by row, as typed: numbers, text, booleans, `null` for empty, formulas as `'=…'` strings */
|
|
24
|
+
modelValue?: SpreadsheetCell[][];
|
|
25
|
+
/** Rows the grid shows at least (more when the data has more) */
|
|
26
|
+
rows?: number;
|
|
27
|
+
/** Columns the grid shows at least (more when the data has more) */
|
|
28
|
+
cols?: number;
|
|
29
|
+
/** Each column's width in px (`v-model:columnWidths`, updated when the user resizes one) */
|
|
30
|
+
columnWidths?: number[];
|
|
31
|
+
/** Width of columns without one in `columnWidths`, in px */
|
|
32
|
+
defaultColumnWidth?: number;
|
|
33
|
+
/** Row height in px */
|
|
34
|
+
rowHeight?: number;
|
|
35
|
+
/** Rows kept at the top while scrolling */
|
|
36
|
+
frozenRows?: number;
|
|
37
|
+
/** Columns kept at the left while scrolling */
|
|
38
|
+
frozenColumns?: number;
|
|
39
|
+
/** Cells can be selected and copied, not changed */
|
|
40
|
+
readonly?: boolean;
|
|
41
|
+
/** Show the column letters and row numbers */
|
|
42
|
+
headers?: boolean;
|
|
43
|
+
/** Column header text instead of A, B, C… (missing ones keep the letter) */
|
|
44
|
+
columnLabels?: string[];
|
|
45
|
+
/** Show the formula bar (the selected cell's name and its contents, editable) */
|
|
46
|
+
formulaBar?: boolean;
|
|
47
|
+
/** Work formulas out. Off: `=…` is shown as typed */
|
|
48
|
+
formulas?: boolean;
|
|
49
|
+
/** More functions for formulas, by upper-case name: `{ TAX: ([amount]) => amount * 0.21 }` */
|
|
50
|
+
functions?: Record<string, SpreadsheetFunction>;
|
|
51
|
+
/** How a cell shows its value (currencies, dates…). Gets the worked-out value and where it is */
|
|
52
|
+
format?: (value: SpreadsheetValue, cell: {
|
|
53
|
+
row: number;
|
|
54
|
+
col: number;
|
|
55
|
+
raw: SpreadsheetCell;
|
|
56
|
+
}) => string;
|
|
57
|
+
/** Extra rows rendered above and below the ones in view */
|
|
58
|
+
overscan?: number;
|
|
59
|
+
/** The grid's accessible name */
|
|
60
|
+
label?: string;
|
|
61
|
+
}, {
|
|
62
|
+
/** Focuses the grid (keyboard, paste) */
|
|
63
|
+
focus: () => void | undefined;
|
|
64
|
+
/** Selects a cell, or a range from `start` to `end`, and scrolls it into view */
|
|
65
|
+
select: (start: SpreadsheetPosition, end?: SpreadsheetPosition) => void;
|
|
66
|
+
/** The selection now */
|
|
67
|
+
selection: import("vue").ComputedRef<SpreadsheetRange>;
|
|
68
|
+
/** A cell's value, its formula worked out */
|
|
69
|
+
value: (r: number, c: number) => SpreadsheetValue;
|
|
70
|
+
/** Undoes the last change made in the grid */
|
|
71
|
+
undo: () => void;
|
|
72
|
+
/** Redoes what undo undid */
|
|
73
|
+
redo: () => void;
|
|
74
|
+
/** Clears the selected cells */
|
|
75
|
+
clear: () => void;
|
|
76
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
77
|
+
"update:modelValue": (cells: SpreadsheetCell[][]) => any;
|
|
78
|
+
change: (changes: SpreadsheetChange[]) => any;
|
|
79
|
+
"update:columnWidths": (widths: number[]) => any;
|
|
80
|
+
"selection-change": (range: SpreadsheetRange) => any;
|
|
81
|
+
}, string, import("vue").PublicProps, Readonly<{
|
|
82
|
+
/** The cells, row by row, as typed: numbers, text, booleans, `null` for empty, formulas as `'=…'` strings */
|
|
83
|
+
modelValue?: SpreadsheetCell[][];
|
|
84
|
+
/** Rows the grid shows at least (more when the data has more) */
|
|
85
|
+
rows?: number;
|
|
86
|
+
/** Columns the grid shows at least (more when the data has more) */
|
|
87
|
+
cols?: number;
|
|
88
|
+
/** Each column's width in px (`v-model:columnWidths`, updated when the user resizes one) */
|
|
89
|
+
columnWidths?: number[];
|
|
90
|
+
/** Width of columns without one in `columnWidths`, in px */
|
|
91
|
+
defaultColumnWidth?: number;
|
|
92
|
+
/** Row height in px */
|
|
93
|
+
rowHeight?: number;
|
|
94
|
+
/** Rows kept at the top while scrolling */
|
|
95
|
+
frozenRows?: number;
|
|
96
|
+
/** Columns kept at the left while scrolling */
|
|
97
|
+
frozenColumns?: number;
|
|
98
|
+
/** Cells can be selected and copied, not changed */
|
|
99
|
+
readonly?: boolean;
|
|
100
|
+
/** Show the column letters and row numbers */
|
|
101
|
+
headers?: boolean;
|
|
102
|
+
/** Column header text instead of A, B, C… (missing ones keep the letter) */
|
|
103
|
+
columnLabels?: string[];
|
|
104
|
+
/** Show the formula bar (the selected cell's name and its contents, editable) */
|
|
105
|
+
formulaBar?: boolean;
|
|
106
|
+
/** Work formulas out. Off: `=…` is shown as typed */
|
|
107
|
+
formulas?: boolean;
|
|
108
|
+
/** More functions for formulas, by upper-case name: `{ TAX: ([amount]) => amount * 0.21 }` */
|
|
109
|
+
functions?: Record<string, SpreadsheetFunction>;
|
|
110
|
+
/** How a cell shows its value (currencies, dates…). Gets the worked-out value and where it is */
|
|
111
|
+
format?: (value: SpreadsheetValue, cell: {
|
|
112
|
+
row: number;
|
|
113
|
+
col: number;
|
|
114
|
+
raw: SpreadsheetCell;
|
|
115
|
+
}) => string;
|
|
116
|
+
/** Extra rows rendered above and below the ones in view */
|
|
117
|
+
overscan?: number;
|
|
118
|
+
/** The grid's accessible name */
|
|
119
|
+
label?: string;
|
|
120
|
+
}> & Readonly<{
|
|
121
|
+
"onUpdate:modelValue"?: ((cells: SpreadsheetCell[][]) => any) | undefined;
|
|
122
|
+
onChange?: ((changes: SpreadsheetChange[]) => any) | undefined;
|
|
123
|
+
"onUpdate:columnWidths"?: ((widths: number[]) => any) | undefined;
|
|
124
|
+
"onSelection-change"?: ((range: SpreadsheetRange) => any) | undefined;
|
|
125
|
+
}>, {
|
|
126
|
+
modelValue: SpreadsheetCell[][];
|
|
127
|
+
rowHeight: number;
|
|
128
|
+
rows: number;
|
|
129
|
+
headers: boolean;
|
|
130
|
+
cols: number;
|
|
131
|
+
defaultColumnWidth: number;
|
|
132
|
+
frozenRows: number;
|
|
133
|
+
frozenColumns: number;
|
|
134
|
+
formulaBar: boolean;
|
|
135
|
+
formulas: boolean;
|
|
136
|
+
overscan: number;
|
|
137
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -26,8 +26,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
26
26
|
align: "center" | "start" | "end" | "stretch" | "baseline";
|
|
27
27
|
direction: "row" | "column";
|
|
28
28
|
inline: boolean;
|
|
29
|
-
justify: "between" | "center" | "start" | "end" | "around" | "evenly";
|
|
30
29
|
divider: boolean;
|
|
30
|
+
justify: "between" | "center" | "start" | "end" | "around" | "evenly";
|
|
31
31
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
32
32
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
33
33
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ValidateOn, ValidationRule } from '../composables/validation';
|
|
1
2
|
type __VLS_Props = {
|
|
2
3
|
/** Toggle state (v-model) */
|
|
3
4
|
modelValue: boolean;
|
|
@@ -9,10 +10,31 @@ type __VLS_Props = {
|
|
|
9
10
|
color?: 'primary' | 'secondary' | 'tertiary' | 'error';
|
|
10
11
|
/** Shows a check icon in the thumb while on. Set to `false` for M3's plain switch without an icon. */
|
|
11
12
|
icon?: boolean;
|
|
13
|
+
/** Error state. A string is also the message */
|
|
14
|
+
error?: boolean | string;
|
|
15
|
+
/** Error message shown when `error` is true */
|
|
16
|
+
errorLabel?: string;
|
|
17
|
+
/** Must be on, inside an `MForm` or with `rules` */
|
|
18
|
+
required?: boolean;
|
|
19
|
+
/** Validation rules (functions or a Standard Schema); see `MForm` */
|
|
20
|
+
rules?: ValidationRule | ValidationRule[];
|
|
21
|
+
/** When the rules are checked and shown: on leaving it (default), on change, or only on submit */
|
|
22
|
+
validateOn?: ValidateOn;
|
|
23
|
+
/** 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 */
|
|
24
|
+
validateDebounce?: number;
|
|
25
|
+
/** The key of this field in its `MForm` */
|
|
26
|
+
name?: string;
|
|
12
27
|
};
|
|
13
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
28
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
29
|
+
/** Checks its rules and shows the result; resolves to whether they pass */
|
|
30
|
+
validate: () => Promise<boolean>;
|
|
31
|
+
/** Hides its validation error (until the next check) */
|
|
32
|
+
resetValidation: () => void;
|
|
33
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
34
|
+
blur: (args_0: FocusEvent) => any;
|
|
14
35
|
"update:modelValue": (args_0: boolean) => any;
|
|
15
36
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
37
|
+
onBlur?: ((args_0: FocusEvent) => any) | undefined;
|
|
16
38
|
"onUpdate:modelValue"?: ((args_0: boolean) => any) | undefined;
|
|
17
39
|
}>, {
|
|
18
40
|
color: "primary" | "secondary" | "tertiary" | "error";
|
|
@@ -76,8 +76,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
76
76
|
onRowClick?: ((args_0: Record<string, any>) => any) | undefined;
|
|
77
77
|
onFetch?: ((args_0: TableFetchParams) => any) | undefined;
|
|
78
78
|
}>, {
|
|
79
|
-
modelValue: Record<string, any>[];
|
|
80
79
|
loading: boolean;
|
|
80
|
+
modelValue: Record<string, any>[];
|
|
81
81
|
page: number;
|
|
82
82
|
selectable: boolean;
|
|
83
83
|
perPage: number;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ValidateOn, ValidationRule } from '../composables/validation';
|
|
1
2
|
type __VLS_Props = {
|
|
2
3
|
/** Array of tags (v-model) */
|
|
3
4
|
modelValue: string[];
|
|
@@ -9,10 +10,21 @@ type __VLS_Props = {
|
|
|
9
10
|
variant?: 'filled' | 'outlined';
|
|
10
11
|
/** Disables the field */
|
|
11
12
|
disabled?: boolean;
|
|
12
|
-
/** Error state */
|
|
13
|
-
error?: boolean;
|
|
13
|
+
/** Error state. A string is also the message (`:error="errors.x"`) */
|
|
14
|
+
error?: boolean | string;
|
|
14
15
|
/** Error message shown when error is true */
|
|
15
16
|
errorLabel?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Validation rules: functions `(value, ctx) => true | 'message'` (may be async; see the built-in `required`,
|
|
19
|
+
* `email`, `minLength`…) or a Standard Schema (zod, valibot…). Checked in order; the first failure is shown
|
|
20
|
+
*/
|
|
21
|
+
rules?: ValidationRule | ValidationRule[];
|
|
22
|
+
/** When the rules are checked and shown: on leaving the field (default; live after that), while typing, or only on submit (`MForm`) */
|
|
23
|
+
validateOn?: ValidateOn;
|
|
24
|
+
/** 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 */
|
|
25
|
+
validateDebounce?: number;
|
|
26
|
+
/** The key of this field in its `MForm`'s values, errors and schema */
|
|
27
|
+
name?: string;
|
|
16
28
|
/** Helper text below field */
|
|
17
29
|
hint?: string;
|
|
18
30
|
/** Marks as required — adds a red asterisk after the label */
|
|
@@ -33,6 +45,10 @@ type __VLS_Props = {
|
|
|
33
45
|
debounce?: number;
|
|
34
46
|
};
|
|
35
47
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
48
|
+
/** Checks its rules and shows the result; resolves to whether they pass */
|
|
49
|
+
validate: () => Promise<boolean>;
|
|
50
|
+
/** Hides its validation error (until the next check) */
|
|
51
|
+
resetValidation: () => void;
|
|
36
52
|
/** The `<input>` (or `<textarea>`) element */
|
|
37
53
|
inputEl: import("vue").Ref<HTMLInputElement | null, HTMLInputElement | null>;
|
|
38
54
|
/** Focuses the field */
|
|
@@ -44,9 +60,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
44
60
|
/** Selects part of its text (e.g. a file name without its extension) */
|
|
45
61
|
setSelectionRange: (start: number, end: number, direction?: "forward" | "backward" | "none") => void | undefined;
|
|
46
62
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
63
|
+
blur: () => any;
|
|
47
64
|
"update:modelValue": (args_0: string[]) => any;
|
|
48
65
|
debounced: (args_0: string[]) => any;
|
|
49
66
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
67
|
+
onBlur?: (() => any) | undefined;
|
|
50
68
|
"onUpdate:modelValue"?: ((args_0: string[]) => any) | undefined;
|
|
51
69
|
onDebounced?: ((args_0: string[]) => any) | undefined;
|
|
52
70
|
}>, {
|
|
@@ -27,7 +27,7 @@ type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
|
27
27
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
28
28
|
color: "on-surface" | "on-surface-variant" | "primary" | "secondary" | "tertiary" | "error" | "inherit";
|
|
29
29
|
variant: TextVariant;
|
|
30
|
-
align: "
|
|
30
|
+
align: "center" | "left" | "right";
|
|
31
31
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
32
32
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
33
33
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ValidateOn, ValidationRule } from '../composables/validation';
|
|
1
2
|
type __VLS_Props = {
|
|
2
3
|
/** Bound value (v-model) */
|
|
3
4
|
modelValue: string | number;
|
|
@@ -7,15 +8,29 @@ type __VLS_Props = {
|
|
|
7
8
|
type?: string;
|
|
8
9
|
/** Visual style */
|
|
9
10
|
variant?: "filled" | "outlined";
|
|
10
|
-
/**
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Puts the field in error state (red border and label). A string is also the message, so a validation
|
|
13
|
+
* library's error plugs straight in: `:error="errors.email"`
|
|
14
|
+
*/
|
|
15
|
+
error?: boolean | string;
|
|
12
16
|
/** Error message shown below the field (only visible when error is true) */
|
|
13
17
|
errorLabel?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Validation rules: functions `(value, ctx) => true | 'message'` (may be async; see the built-in `required`,
|
|
20
|
+
* `email`, `minLength`…) or a Standard Schema (zod, valibot…). Checked in order; the first failure is shown
|
|
21
|
+
*/
|
|
22
|
+
rules?: ValidationRule | ValidationRule[];
|
|
23
|
+
/** When the rules are checked and shown: on leaving the field (default; live after that), while typing, or only on submit (`MForm`) */
|
|
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
|
+
/** Native `name`; also the key of this field in its `MForm`'s values, errors and schema */
|
|
28
|
+
name?: string;
|
|
14
29
|
/** Hint text shown below the field */
|
|
15
30
|
hint?: string;
|
|
16
31
|
/** Disables the field */
|
|
17
32
|
disabled?: boolean;
|
|
18
|
-
/** Marks as required — adds a red asterisk after the label */
|
|
33
|
+
/** Marks as required — adds a red asterisk after the label; inside an `MForm` or with `rules`, also validates it */
|
|
19
34
|
required?: boolean;
|
|
20
35
|
/** Renders a textarea instead of an input */
|
|
21
36
|
multiline?: boolean;
|
|
@@ -53,13 +68,21 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
|
53
68
|
blur: () => void | undefined;
|
|
54
69
|
/** Selects all its text */
|
|
55
70
|
select: () => void | undefined;
|
|
71
|
+
/** Checks its rules and shows the result; resolves to whether they pass */
|
|
72
|
+
validate: () => Promise<boolean>;
|
|
73
|
+
/** Hides its validation error (until the next check) */
|
|
74
|
+
resetValidation: () => void;
|
|
56
75
|
/** Selects part of its text (e.g. a file name without its extension) */
|
|
57
76
|
setSelectionRange: (start: number, end: number, direction?: "forward" | "backward" | "none") => void | undefined;
|
|
58
77
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
78
|
+
blur: (args_0: FocusEvent) => any;
|
|
59
79
|
"update:modelValue": (args_0: string) => any;
|
|
80
|
+
focus: (args_0: FocusEvent) => any;
|
|
60
81
|
debounced: (args_0: string) => any;
|
|
61
82
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
83
|
+
onBlur?: ((args_0: FocusEvent) => any) | undefined;
|
|
62
84
|
"onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
|
|
85
|
+
onFocus?: ((args_0: FocusEvent) => any) | undefined;
|
|
63
86
|
onDebounced?: ((args_0: string) => any) | undefined;
|
|
64
87
|
}>, {
|
|
65
88
|
type: string;
|