@m3ui-vue/m3ui-vue 1.6.1 → 1.7.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 +649 -28
- package/dist/{MButton-OQ4wIERQ.js → MButton-CN3wYwIG.js} +2 -2
- package/dist/{MButton-OQ4wIERQ.js.map → MButton-CN3wYwIG.js.map} +1 -1
- package/dist/MColorPickerModal-BKM1CHxr.js +577 -0
- package/dist/MColorPickerModal-BKM1CHxr.js.map +1 -0
- package/dist/{MDialog-DYMnaBlt.js → MDialog-1LAk9WAO.js} +2 -2
- package/dist/{MDialog-DYMnaBlt.js.map → MDialog-1LAk9WAO.js.map} +1 -1
- package/dist/{MListItem-D2cNUyzP.js → MListItem-BU5KDRCB.js} +376 -270
- package/dist/MListItem-BU5KDRCB.js.map +1 -0
- package/dist/{MLoadingIndicator-DWUj0BAB.js → MLoadingIndicator-RykOo5tf.js} +2 -2
- package/dist/{MLoadingIndicator-DWUj0BAB.js.map → MLoadingIndicator-RykOo5tf.js.map} +1 -1
- package/dist/{MSeekBar-C4cn9RIF.js → MSeekBar-B_Y3MpVz.js} +2 -2
- package/dist/{MSeekBar-C4cn9RIF.js.map → MSeekBar-B_Y3MpVz.js.map} +1 -1
- package/dist/MSegmentedButton-CiOOY1-N.js +105 -0
- package/dist/MSegmentedButton-CiOOY1-N.js.map +1 -0
- package/dist/MSlider-BCeVIxcq.js +739 -0
- package/dist/MSlider-BCeVIxcq.js.map +1 -0
- package/dist/{MSpinner-DZkXZJpc.js → MSpinner-Cs03qoqE.js} +2 -2
- package/dist/{MSpinner-DZkXZJpc.js.map → MSpinner-Cs03qoqE.js.map} +1 -1
- package/dist/{MTextField-CNH-byir.js → MTextField-NaFbMkjv.js} +162 -115
- package/dist/MTextField-NaFbMkjv.js.map +1 -0
- package/dist/MTooltip-CK39Zon4.js +183 -0
- package/dist/MTooltip-CK39Zon4.js.map +1 -0
- package/dist/_useFieldValidation-Bz34IAQY.js +191 -0
- package/dist/_useFieldValidation-Bz34IAQY.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/MJsonEditor.vue.d.ts +23 -1
- package/dist/components/MMapRoute.vue.d.ts +168 -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/MPhoneInput.vue.d.ts +19 -4
- package/dist/components/MPinInput.vue.d.ts +24 -3
- package/dist/components/MPosKeypad.vue.d.ts +2 -2
- 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/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/useLocale.d.ts +23 -0
- package/dist/composables/validation.d.ts +82 -0
- package/dist/draw.js +27 -26
- package/dist/draw.js.map +1 -1
- package/dist/flow.js +1 -1
- package/dist/gantt.js +2 -2
- package/dist/index.d.ts +5 -0
- package/dist/locales/index.js +154 -7
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +7350 -6183
- package/dist/m3ui.js.map +1 -1
- package/dist/map.d.ts +4 -0
- package/dist/map.js +1319 -867
- package/dist/map.js.map +1 -1
- package/dist/media.js +4 -4
- package/dist/pdf.js +4 -4
- package/dist/rich-text-editor.js +189 -146
- package/dist/rich-text-editor.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/{useLocale-DaVSTdm0.js → useLocale-Dh1xZZ8i.js} +22 -1
- package/dist/useLocale-Dh1xZZ8i.js.map +1 -0
- package/package.json +1 -1
- package/src/__tests__/MForm.test.ts +325 -0
- package/src/__tests__/MMapRoute.test.ts +384 -0
- package/src/__tests__/MPhoneInput.test.ts +5 -2
- package/src/__tests__/MRichTextEditor.test.ts +2 -1
- 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__/ssr.test.ts +1 -0
- package/src/__tests__/validation.test.ts +77 -0
- package/src/components/MAddressField.vue +45 -8
- package/src/components/MAudioRecorder.vue +9 -9
- 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/MJsonEditor.vue +57 -3
- package/src/components/MMapBaseLayers.vue +29 -28
- package/src/components/MMapMeasure.vue +1 -1
- package/src/components/MMapRoute.vue +470 -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/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/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/useLocale.ts +46 -0
- package/src/composables/validation.ts +178 -0
- package/src/index.ts +5 -0
- package/src/locales/de.ts +21 -0
- package/src/locales/es.ts +28 -7
- package/src/locales/fr.ts +21 -0
- package/src/locales/ja.ts +21 -0
- package/src/locales/ko.ts +21 -0
- package/src/locales/pt.ts +21 -0
- package/src/locales/zh.ts +21 -0
- package/src/map.ts +4 -0
- package/dist/MListItem-D2cNUyzP.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/MTooltip-Dd5g2zhh.js +0 -754
- package/dist/MTooltip-Dd5g2zhh.js.map +0 -1
- package/dist/useLocale-DaVSTdm0.js.map +0 -1
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import type { MapRouteProvider, MapRouteResult } from '../composables/mapRouting';
|
|
2
|
+
import type { LngLat } from '../composables/_mapGeometry';
|
|
3
|
+
/** A stop on an `MMapRoute`: a pickup, a drop-off, a waypoint. */
|
|
4
|
+
export interface MapRouteStop {
|
|
5
|
+
/** Where it is, `[lng, lat]` */
|
|
6
|
+
lngLat: LngLat;
|
|
7
|
+
/** Its name (the marker's accessible name and tooltip) */
|
|
8
|
+
label?: string;
|
|
9
|
+
/** A Material Symbol inside its marker. Defaults to a number for the stops in between, a flag for the last one */
|
|
10
|
+
icon?: string;
|
|
11
|
+
/** Mark it reached (or not) yourself, instead of by where the vehicle is along the route */
|
|
12
|
+
done?: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
16
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
17
|
+
/** The stops, in order: the start, any in between, the destination */
|
|
18
|
+
stops: MapRouteStop[];
|
|
19
|
+
/**
|
|
20
|
+
* The road to follow, `[lng, lat][]`: a routing service's geometry (OSRM, GraphHopper, Mapbox…), with the streets'
|
|
21
|
+
* real shape. Without it, `provider` fetches one, or the stops are joined by straight lines
|
|
22
|
+
*/
|
|
23
|
+
path?: LngLat[];
|
|
24
|
+
/** How far the vehicle is, 0–1 of the route's length. Ignored when `vehicle` is set */
|
|
25
|
+
progress?: number;
|
|
26
|
+
/** The vehicle's live position, `[lng, lat]`: it's placed on the nearest point of the route */
|
|
27
|
+
vehicle?: LngLat | null;
|
|
28
|
+
/** A Material Symbol for the vehicle. The default arrow turns with the road; other icons (`two_wheeler`, `local_shipping`) face the way it goes */
|
|
29
|
+
vehicleIcon?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Turn the vehicle with the road (following the map's own rotation too): on for the default arrow, off for other
|
|
32
|
+
* icons (they're mirrored when heading west instead). Set it for `#vehicle` content drawn pointing up (north)
|
|
33
|
+
*/
|
|
34
|
+
rotateVehicle?: boolean;
|
|
35
|
+
/** Show the vehicle (when there's a `progress` or `vehicle`) */
|
|
36
|
+
showVehicle?: boolean;
|
|
37
|
+
/** How long the vehicle takes to move to a new position, in ms (0 jumps). Reduced motion jumps */
|
|
38
|
+
duration?: number;
|
|
39
|
+
/** Fit the map to the whole route when it's shown and when the route changes */
|
|
40
|
+
fit?: boolean;
|
|
41
|
+
/** Keep the vehicle in the middle of the map as it moves */
|
|
42
|
+
follow?: boolean;
|
|
43
|
+
/** Room around the route when fitting it, in px */
|
|
44
|
+
padding?: number;
|
|
45
|
+
/** The route's color: one MapLibre reads (hex, rgb()…), not `var()`. Defaults to the theme's primary, following palette and dark mode */
|
|
46
|
+
color?: string;
|
|
47
|
+
/** The dots of the route ahead flow toward the destination (off with reduced motion) */
|
|
48
|
+
flow?: boolean;
|
|
49
|
+
/** Line width in px */
|
|
50
|
+
width?: number;
|
|
51
|
+
/** Insert the route's lines below this layer id (e.g. under the style's labels) */
|
|
52
|
+
before?: string;
|
|
53
|
+
/** The source's id (and the prefix of its layers' ids). Generated when left out */
|
|
54
|
+
id?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Fetches the road between the stops when there's no `path` (again when they change): `osrmRouteProvider()`, or
|
|
57
|
+
* your own function. Straight lines meanwhile, and if it fails (`error` event)
|
|
58
|
+
*/
|
|
59
|
+
provider?: MapRouteProvider;
|
|
60
|
+
/**
|
|
61
|
+
* How a `vehicle` position lands on the route: `forward` (default) only moves ahead from where it was, so a route
|
|
62
|
+
* that passes the same place twice (out and back, a loop, close parallel streets) doesn't jump to the other pass;
|
|
63
|
+
* `nearest` takes the closest point of the whole route every time
|
|
64
|
+
*/
|
|
65
|
+
snap?: "forward" | "nearest";
|
|
66
|
+
}, {
|
|
67
|
+
/** Fits the map to the whole route */
|
|
68
|
+
fit: () => void;
|
|
69
|
+
/** The route's length, in meters */
|
|
70
|
+
length: import("vue").ComputedRef<number>;
|
|
71
|
+
/** How far the vehicle is now, in meters */
|
|
72
|
+
travelled: import("vue").Ref<number, number>;
|
|
73
|
+
/** The source's id */
|
|
74
|
+
sourceId: string;
|
|
75
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
76
|
+
error: (error: unknown) => any;
|
|
77
|
+
route: (route: MapRouteResult) => any;
|
|
78
|
+
"stop-click": (stop: MapRouteStop, index: number) => any;
|
|
79
|
+
arrive: () => any;
|
|
80
|
+
}, string, import("vue").PublicProps, Readonly<{
|
|
81
|
+
/** The stops, in order: the start, any in between, the destination */
|
|
82
|
+
stops: MapRouteStop[];
|
|
83
|
+
/**
|
|
84
|
+
* The road to follow, `[lng, lat][]`: a routing service's geometry (OSRM, GraphHopper, Mapbox…), with the streets'
|
|
85
|
+
* real shape. Without it, `provider` fetches one, or the stops are joined by straight lines
|
|
86
|
+
*/
|
|
87
|
+
path?: LngLat[];
|
|
88
|
+
/** How far the vehicle is, 0–1 of the route's length. Ignored when `vehicle` is set */
|
|
89
|
+
progress?: number;
|
|
90
|
+
/** The vehicle's live position, `[lng, lat]`: it's placed on the nearest point of the route */
|
|
91
|
+
vehicle?: LngLat | null;
|
|
92
|
+
/** A Material Symbol for the vehicle. The default arrow turns with the road; other icons (`two_wheeler`, `local_shipping`) face the way it goes */
|
|
93
|
+
vehicleIcon?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Turn the vehicle with the road (following the map's own rotation too): on for the default arrow, off for other
|
|
96
|
+
* icons (they're mirrored when heading west instead). Set it for `#vehicle` content drawn pointing up (north)
|
|
97
|
+
*/
|
|
98
|
+
rotateVehicle?: boolean;
|
|
99
|
+
/** Show the vehicle (when there's a `progress` or `vehicle`) */
|
|
100
|
+
showVehicle?: boolean;
|
|
101
|
+
/** How long the vehicle takes to move to a new position, in ms (0 jumps). Reduced motion jumps */
|
|
102
|
+
duration?: number;
|
|
103
|
+
/** Fit the map to the whole route when it's shown and when the route changes */
|
|
104
|
+
fit?: boolean;
|
|
105
|
+
/** Keep the vehicle in the middle of the map as it moves */
|
|
106
|
+
follow?: boolean;
|
|
107
|
+
/** Room around the route when fitting it, in px */
|
|
108
|
+
padding?: number;
|
|
109
|
+
/** The route's color: one MapLibre reads (hex, rgb()…), not `var()`. Defaults to the theme's primary, following palette and dark mode */
|
|
110
|
+
color?: string;
|
|
111
|
+
/** The dots of the route ahead flow toward the destination (off with reduced motion) */
|
|
112
|
+
flow?: boolean;
|
|
113
|
+
/** Line width in px */
|
|
114
|
+
width?: number;
|
|
115
|
+
/** Insert the route's lines below this layer id (e.g. under the style's labels) */
|
|
116
|
+
before?: string;
|
|
117
|
+
/** The source's id (and the prefix of its layers' ids). Generated when left out */
|
|
118
|
+
id?: string;
|
|
119
|
+
/**
|
|
120
|
+
* Fetches the road between the stops when there's no `path` (again when they change): `osrmRouteProvider()`, or
|
|
121
|
+
* your own function. Straight lines meanwhile, and if it fails (`error` event)
|
|
122
|
+
*/
|
|
123
|
+
provider?: MapRouteProvider;
|
|
124
|
+
/**
|
|
125
|
+
* How a `vehicle` position lands on the route: `forward` (default) only moves ahead from where it was, so a route
|
|
126
|
+
* that passes the same place twice (out and back, a loop, close parallel streets) doesn't jump to the other pass;
|
|
127
|
+
* `nearest` takes the closest point of the whole route every time
|
|
128
|
+
*/
|
|
129
|
+
snap?: "forward" | "nearest";
|
|
130
|
+
}> & Readonly<{
|
|
131
|
+
onError?: ((error: unknown) => any) | undefined;
|
|
132
|
+
onRoute?: ((route: MapRouteResult) => any) | undefined;
|
|
133
|
+
"onStop-click"?: ((stop: MapRouteStop, index: number) => any) | undefined;
|
|
134
|
+
onArrive?: (() => any) | undefined;
|
|
135
|
+
}>, {
|
|
136
|
+
width: number;
|
|
137
|
+
duration: number;
|
|
138
|
+
snap: "forward" | "nearest";
|
|
139
|
+
flow: boolean;
|
|
140
|
+
fit: boolean;
|
|
141
|
+
padding: number;
|
|
142
|
+
vehicleIcon: string;
|
|
143
|
+
rotateVehicle: boolean;
|
|
144
|
+
showVehicle: boolean;
|
|
145
|
+
follow: boolean;
|
|
146
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
147
|
+
stop?: (props: {
|
|
148
|
+
stop: MapRouteStop;
|
|
149
|
+
index: number;
|
|
150
|
+
done: boolean;
|
|
151
|
+
}) => any;
|
|
152
|
+
} & {
|
|
153
|
+
'stop-popup'?: (props: {
|
|
154
|
+
stop: MapRouteStop;
|
|
155
|
+
index: number;
|
|
156
|
+
done: boolean;
|
|
157
|
+
}) => any;
|
|
158
|
+
} & {
|
|
159
|
+
vehicle?: (props: {
|
|
160
|
+
bearing: number;
|
|
161
|
+
west: boolean;
|
|
162
|
+
}) => any;
|
|
163
|
+
}>;
|
|
164
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
165
|
+
new (): {
|
|
166
|
+
$slots: S;
|
|
167
|
+
};
|
|
168
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ValidateOn, ValidationRule } from '../composables/validation';
|
|
1
2
|
export type MaskPreset = 'credit-card' | 'phone' | 'date' | 'time' | 'cpf' | 'cnpj' | 'zip';
|
|
2
3
|
type __VLS_Props = {
|
|
3
4
|
/** Masked value (v-model) */
|
|
@@ -8,10 +9,21 @@ type __VLS_Props = {
|
|
|
8
9
|
mask: string | MaskPreset;
|
|
9
10
|
/** Visual style */
|
|
10
11
|
variant?: 'filled' | 'outlined';
|
|
11
|
-
/** Error state */
|
|
12
|
-
error?: boolean;
|
|
12
|
+
/** Error state. A string is also the message (`:error="errors.x"`) */
|
|
13
|
+
error?: boolean | string;
|
|
13
14
|
/** Error message shown when error is true */
|
|
14
15
|
errorLabel?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Validation rules: functions `(value, ctx) => true | 'message'` (may be async; see the built-in `required`,
|
|
18
|
+
* `email`, `minLength`…) or a Standard Schema (zod, valibot…). Checked in order; the first failure is shown
|
|
19
|
+
*/
|
|
20
|
+
rules?: ValidationRule | ValidationRule[];
|
|
21
|
+
/** When the rules are checked and shown: on leaving the field (default; live after that), while typing, or only on submit (`MForm`) */
|
|
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`'s values, errors and schema */
|
|
26
|
+
name?: string;
|
|
15
27
|
/** Hint text */
|
|
16
28
|
hint?: string;
|
|
17
29
|
/** Disables the field */
|
|
@@ -30,6 +42,10 @@ type __VLS_Props = {
|
|
|
30
42
|
debounce?: number;
|
|
31
43
|
};
|
|
32
44
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
45
|
+
/** Checks its rules and shows the result; resolves to whether they pass */
|
|
46
|
+
validate: () => Promise<boolean>;
|
|
47
|
+
/** Hides its validation error (until the next check) */
|
|
48
|
+
resetValidation: () => void;
|
|
33
49
|
/** The `<input>` (or `<textarea>`) element */
|
|
34
50
|
inputEl: import("vue").Ref<HTMLInputElement | null, HTMLInputElement | null>;
|
|
35
51
|
/** Focuses the field */
|
|
@@ -41,9 +57,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
41
57
|
/** Selects part of its text (e.g. a file name without its extension) */
|
|
42
58
|
setSelectionRange: (start: number, end: number, direction?: "forward" | "backward" | "none") => void | undefined;
|
|
43
59
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
60
|
+
blur: () => any;
|
|
44
61
|
"update:modelValue": (args_0: string) => any;
|
|
45
62
|
debounced: (args_0: string) => any;
|
|
46
63
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
64
|
+
onBlur?: (() => any) | undefined;
|
|
47
65
|
"onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
|
|
48
66
|
onDebounced?: ((args_0: string) => any) | undefined;
|
|
49
67
|
}>, {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ValidateOn, ValidationRule } from '../composables/validation';
|
|
1
2
|
/** Something that can be mentioned. */
|
|
2
3
|
export interface MentionItem {
|
|
3
4
|
id: string | number;
|
|
@@ -52,10 +53,18 @@ type __VLS_Props = {
|
|
|
52
53
|
leadingIcon?: string;
|
|
53
54
|
/** Helper text below the field */
|
|
54
55
|
hint?: string;
|
|
55
|
-
/** Error state */
|
|
56
|
-
error?: boolean;
|
|
56
|
+
/** Error state. A string is also the message */
|
|
57
|
+
error?: boolean | string;
|
|
57
58
|
/** Error message shown when `error` is true */
|
|
58
59
|
errorLabel?: string;
|
|
60
|
+
/** Validation rules (functions or a Standard Schema); see `MForm` */
|
|
61
|
+
rules?: ValidationRule | ValidationRule[];
|
|
62
|
+
/** When the rules are checked and shown: on leaving the field (default), while typing, or only on submit */
|
|
63
|
+
validateOn?: ValidateOn;
|
|
64
|
+
/** 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 */
|
|
65
|
+
validateDebounce?: number;
|
|
66
|
+
/** The key of this field in its `MForm` */
|
|
67
|
+
name?: string;
|
|
59
68
|
/** Marks it as required */
|
|
60
69
|
required?: boolean;
|
|
61
70
|
/** Disables the field */
|
|
@@ -77,10 +86,12 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
|
77
86
|
/** Inserts text at the caret (a trigger, to open the list from a button: `insert('@')`) */
|
|
78
87
|
insert(text: string): void;
|
|
79
88
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
89
|
+
blur: () => any;
|
|
80
90
|
"update:modelValue": (text: string) => any;
|
|
81
91
|
"update:mentions": (mentions: MentionRef[]) => any;
|
|
82
92
|
mention: (item: MentionItem, trigger: string) => any;
|
|
83
93
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
94
|
+
onBlur?: (() => any) | undefined;
|
|
84
95
|
"onUpdate:modelValue"?: ((text: string) => any) | undefined;
|
|
85
96
|
"onUpdate:mentions"?: ((mentions: MentionRef[]) => any) | undefined;
|
|
86
97
|
onMention?: ((item: MentionItem, trigger: string) => any) | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ValidateOn, ValidationRule } from '../composables/validation';
|
|
1
2
|
import type { MultiSelectOption } from './MMultiSelect.vue';
|
|
2
3
|
type __VLS_Props = {
|
|
3
4
|
/** Selected values (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 */
|
|
@@ -39,10 +51,17 @@ type __VLS_Props = {
|
|
|
39
51
|
/** Delay (ms) before filtering and firing @debounced. Selection is always instant */
|
|
40
52
|
debounce?: number;
|
|
41
53
|
};
|
|
42
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
54
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
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;
|
|
59
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
60
|
+
blur: () => any;
|
|
43
61
|
"update:modelValue": (args_0: unknown[]) => any;
|
|
44
62
|
debounced: (args_0: string) => any;
|
|
45
63
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
64
|
+
onBlur?: (() => any) | undefined;
|
|
46
65
|
"onUpdate:modelValue"?: ((args_0: unknown[]) => any) | undefined;
|
|
47
66
|
onDebounced?: ((args_0: string) => any) | undefined;
|
|
48
67
|
}>, {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ValidateOn, ValidationRule } from '../composables/validation';
|
|
1
2
|
export interface MultiSelectOption {
|
|
2
3
|
label: string;
|
|
3
4
|
value: unknown;
|
|
@@ -18,10 +19,21 @@ type __VLS_Props = {
|
|
|
18
19
|
mode?: 'docked' | 'modal';
|
|
19
20
|
/** Disables the field */
|
|
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 */
|
|
@@ -51,9 +63,16 @@ declare const __VLS_template: () => {
|
|
|
51
63
|
};
|
|
52
64
|
};
|
|
53
65
|
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
54
|
-
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
66
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
67
|
+
/** Checks its rules and shows the result; resolves to whether they pass */
|
|
68
|
+
validate: () => Promise<boolean>;
|
|
69
|
+
/** Hides its validation error (until the next check) */
|
|
70
|
+
resetValidation: () => void;
|
|
71
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
72
|
+
blur: () => any;
|
|
55
73
|
"update:modelValue": (args_0: unknown[]) => any;
|
|
56
74
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
75
|
+
onBlur?: (() => any) | undefined;
|
|
57
76
|
"onUpdate:modelValue"?: ((args_0: unknown[]) => any) | undefined;
|
|
58
77
|
}>, {
|
|
59
78
|
required: boolean;
|
|
@@ -49,7 +49,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
49
49
|
}>, {
|
|
50
50
|
expanded: boolean;
|
|
51
51
|
modal: boolean;
|
|
52
|
-
alignment: "
|
|
52
|
+
alignment: "center" | "top" | "bottom";
|
|
53
53
|
hideOnCollapse: boolean;
|
|
54
54
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
55
55
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -36,12 +36,12 @@ declare const __VLS_template: () => {
|
|
|
36
36
|
};
|
|
37
37
|
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
38
38
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
39
|
-
"update:modelValue": (items: InboxNotification[]) => any;
|
|
40
39
|
open: (item: InboxNotification) => any;
|
|
40
|
+
"update:modelValue": (items: InboxNotification[]) => any;
|
|
41
41
|
dismiss: (item: InboxNotification) => any;
|
|
42
42
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
43
|
-
"onUpdate:modelValue"?: ((items: InboxNotification[]) => any) | undefined;
|
|
44
43
|
onOpen?: ((item: InboxNotification) => any) | undefined;
|
|
44
|
+
"onUpdate:modelValue"?: ((items: InboxNotification[]) => any) | undefined;
|
|
45
45
|
onDismiss?: ((item: InboxNotification) => any) | undefined;
|
|
46
46
|
}>, {
|
|
47
47
|
filter: boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ValidateOn, ValidationRule } from '../composables/validation';
|
|
1
2
|
type __VLS_Props = {
|
|
2
3
|
/** Bound numeric value (v-model) */
|
|
3
4
|
modelValue: number | null;
|
|
@@ -11,10 +12,21 @@ type __VLS_Props = {
|
|
|
11
12
|
max?: number;
|
|
12
13
|
/** Increment/decrement step */
|
|
13
14
|
step?: number;
|
|
14
|
-
/** Error state */
|
|
15
|
-
error?: boolean;
|
|
15
|
+
/** Error state. A string is also the message (`:error="errors.x"`) */
|
|
16
|
+
error?: boolean | string;
|
|
16
17
|
/** Error message shown when error is true */
|
|
17
18
|
errorLabel?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Validation rules: functions `(value, ctx) => true | 'message'` (may be async; see the built-in `required`,
|
|
21
|
+
* `email`, `minLength`…) or a Standard Schema (zod, valibot…). Checked in order; the first failure is shown
|
|
22
|
+
*/
|
|
23
|
+
rules?: ValidationRule | ValidationRule[];
|
|
24
|
+
/** When the rules are checked and shown: on leaving the field (default; live after that), while typing, or only on submit (`MForm`) */
|
|
25
|
+
validateOn?: ValidateOn;
|
|
26
|
+
/** 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 */
|
|
27
|
+
validateDebounce?: number;
|
|
28
|
+
/** The key of this field in its `MForm`'s values, errors and schema */
|
|
29
|
+
name?: string;
|
|
18
30
|
/** Hint text */
|
|
19
31
|
hint?: string;
|
|
20
32
|
/** Disables the field */
|
|
@@ -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 */
|
|
@@ -42,9 +58,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
42
58
|
/** Selects all its text */
|
|
43
59
|
select: () => void | undefined;
|
|
44
60
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
61
|
+
blur: () => any;
|
|
45
62
|
"update:modelValue": (args_0: number | null) => any;
|
|
46
63
|
debounced: (args_0: number | null) => any;
|
|
47
64
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
65
|
+
onBlur?: (() => any) | undefined;
|
|
48
66
|
"onUpdate:modelValue"?: ((args_0: number | null) => any) | undefined;
|
|
49
67
|
onDebounced?: ((args_0: number | null) => any) | undefined;
|
|
50
68
|
}>, {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ValidateOn, ValidationRule } from '../composables/validation';
|
|
1
2
|
type __VLS_Props = {
|
|
2
3
|
/** The number in E.164 (`+541123456789`), or null (v-model) */
|
|
3
4
|
modelValue?: string | null;
|
|
@@ -13,17 +14,25 @@ type __VLS_Props = {
|
|
|
13
14
|
preferred?: string[];
|
|
14
15
|
/** Visual style */
|
|
15
16
|
variant?: 'filled' | 'outlined';
|
|
16
|
-
/** Puts the field in error state */
|
|
17
|
-
error?: boolean;
|
|
17
|
+
/** Puts the field in error state. A string is also the message */
|
|
18
|
+
error?: boolean | string;
|
|
18
19
|
/** Error message below the field (when `error`, or when `validate` finds the number incomplete) */
|
|
19
20
|
errorLabel?: string;
|
|
21
|
+
/** More validation rules (functions or a Standard Schema), run on the E.164 value; see `MForm` */
|
|
22
|
+
rules?: ValidationRule | ValidationRule[];
|
|
23
|
+
/** When the rules are checked and shown: on leaving the field (default), while typing, 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;
|
|
20
29
|
/** Hint text below the field */
|
|
21
30
|
hint?: string;
|
|
22
31
|
/** Disables the field */
|
|
23
32
|
disabled?: boolean;
|
|
24
33
|
/** Marks as required — adds a red asterisk after the label */
|
|
25
34
|
required?: boolean;
|
|
26
|
-
/** After leaving the field, show an error when the number doesn't fit its country's length */
|
|
35
|
+
/** After leaving the field, show an error when the number doesn't fit its country's length (and block an `MForm`'s submit) */
|
|
27
36
|
validate?: boolean;
|
|
28
37
|
/** Placeholder; defaults to an example in the country's format */
|
|
29
38
|
placeholder?: string;
|
|
@@ -48,21 +57,27 @@ declare const __VLS_template: () => {
|
|
|
48
57
|
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
49
58
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
50
59
|
focus: (options?: FocusOptions) => void | undefined;
|
|
60
|
+
/** Checks its rules (and the number's length) 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;
|
|
51
64
|
/** Whether the number fits its country's length */
|
|
52
65
|
valid: import("vue").ComputedRef<boolean>;
|
|
53
66
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
67
|
+
blur: () => any;
|
|
54
68
|
"update:modelValue": (args_0: string | null) => any;
|
|
55
69
|
"update:country": (args_0: string) => any;
|
|
56
70
|
"update:valid": (args_0: boolean) => any;
|
|
57
71
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
72
|
+
onBlur?: (() => any) | undefined;
|
|
58
73
|
"onUpdate:modelValue"?: ((args_0: string | null) => any) | undefined;
|
|
59
74
|
"onUpdate:country"?: ((args_0: string) => any) | undefined;
|
|
60
75
|
"onUpdate:valid"?: ((args_0: boolean) => any) | undefined;
|
|
61
76
|
}>, {
|
|
62
77
|
modelValue: string | null;
|
|
78
|
+
validate: boolean;
|
|
63
79
|
variant: "filled" | "outlined";
|
|
64
80
|
flags: boolean;
|
|
65
|
-
validate: boolean;
|
|
66
81
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
67
82
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
68
83
|
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 code (v-model), e.g. "1234" */
|
|
3
4
|
modelValue: string;
|
|
@@ -13,10 +14,23 @@ type __VLS_Props = {
|
|
|
13
14
|
masked?: boolean;
|
|
14
15
|
/** Visual style */
|
|
15
16
|
variant?: 'filled' | 'outlined';
|
|
16
|
-
/** Error state */
|
|
17
|
-
error?: boolean;
|
|
17
|
+
/** Error state. A string is also the message (`:error="errors.x"`) */
|
|
18
|
+
error?: boolean | string;
|
|
18
19
|
/** Error message shown when error is true */
|
|
19
20
|
errorLabel?: string;
|
|
21
|
+
/** Marks as required — adds a red asterisk after the label; inside an `MForm` or with `rules`, also validates it */
|
|
22
|
+
required?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Validation rules: functions `(value, ctx) => true | 'message'` (may be async; see the built-in `required`,
|
|
25
|
+
* `email`, `minLength`…) or a Standard Schema (zod, valibot…). Checked in order; the first failure is shown
|
|
26
|
+
*/
|
|
27
|
+
rules?: ValidationRule | ValidationRule[];
|
|
28
|
+
/** When the rules are checked and shown: on leaving the field (default; live after that), while typing, or only on submit (`MForm`) */
|
|
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`'s values, errors and schema */
|
|
33
|
+
name?: string;
|
|
20
34
|
/** Hint text below the boxes */
|
|
21
35
|
hint?: string;
|
|
22
36
|
/** Disables every box */
|
|
@@ -26,10 +40,17 @@ type __VLS_Props = {
|
|
|
26
40
|
/** aria-label for the group of boxes */
|
|
27
41
|
label?: string;
|
|
28
42
|
};
|
|
29
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
43
|
+
declare const __VLS_export: 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;
|
|
30
50
|
"update:modelValue": (args_0: string) => any;
|
|
31
51
|
complete: (args_0: string) => any;
|
|
32
52
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
53
|
+
onBlur?: (() => any) | undefined;
|
|
33
54
|
"onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
|
|
34
55
|
onComplete?: ((args_0: string) => any) | undefined;
|
|
35
56
|
}>, {
|
|
@@ -58,12 +58,12 @@ declare const __VLS_template: () => {
|
|
|
58
58
|
};
|
|
59
59
|
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
60
60
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
61
|
-
"update:modelValue": (args_0: string) => any;
|
|
62
61
|
submit: (args_0: string) => any;
|
|
62
|
+
"update:modelValue": (args_0: string) => any;
|
|
63
63
|
key: (args_0: string) => any;
|
|
64
64
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
65
|
-
"onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
|
|
66
65
|
onSubmit?: ((args_0: string) => any) | undefined;
|
|
66
|
+
"onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
|
|
67
67
|
onKey?: ((args_0: string) => any) | undefined;
|
|
68
68
|
}>, {
|
|
69
69
|
mode: "integer" | "amount" | "pin";
|
|
@@ -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;
|