@m3ui-vue/m3ui-vue 1.7.0 → 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 +578 -3
- package/dist/{MColorPickerModal-BKM1CHxr.js → MColorPickerModal-H8nuX0Wu.js} +3 -4
- package/dist/{MColorPickerModal-BKM1CHxr.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-BU5KDRCB.js → MListItem-DiOAxaN7.js} +102 -102
- package/dist/{MListItem-BU5KDRCB.js.map → MListItem-DiOAxaN7.js.map} +1 -1
- package/dist/{MLoadingIndicator-RykOo5tf.js → MLoadingIndicator-CuTZYFFj.js} +2 -2
- package/dist/{MLoadingIndicator-RykOo5tf.js.map → MLoadingIndicator-CuTZYFFj.js.map} +1 -1
- package/dist/{MSeekBar-B_Y3MpVz.js → MSeekBar-BCDQTx2t.js} +2 -2
- package/dist/{MSeekBar-B_Y3MpVz.js.map → MSeekBar-BCDQTx2t.js.map} +1 -1
- package/dist/{MSegmentedButton-CiOOY1-N.js → MSegmentedButton-BXzRsg1S.js} +2 -2
- package/dist/{MSegmentedButton-CiOOY1-N.js.map → MSegmentedButton-BXzRsg1S.js.map} +1 -1
- package/dist/MSignaturePad-BTqGaPXA.js +313 -0
- package/dist/MSignaturePad-BTqGaPXA.js.map +1 -0
- package/dist/{MSlider-BCeVIxcq.js → MSlider-D_O8J9YH.js} +3 -3
- package/dist/{MSlider-BCeVIxcq.js.map → MSlider-D_O8J9YH.js.map} +1 -1
- package/dist/{MSpinner-Cs03qoqE.js → MSpinner-UCdtSOHP.js} +2 -2
- package/dist/{MSpinner-Cs03qoqE.js.map → MSpinner-UCdtSOHP.js.map} +1 -1
- package/dist/{MTextField-NaFbMkjv.js → MTextField-CYk9yFvi.js} +3 -3
- package/dist/{MTextField-NaFbMkjv.js.map → MTextField-CYk9yFvi.js.map} +1 -1
- package/dist/{_useFieldValidation-Bz34IAQY.js → _useFieldValidation-B0B44M_t.js} +2 -2
- package/dist/{_useFieldValidation-Bz34IAQY.js.map → _useFieldValidation-B0B44M_t.js.map} +1 -1
- package/dist/api.json +1 -1
- package/dist/code-editor.js +2 -2
- package/dist/components/MFormBuilder.vue.d.ts +22 -0
- package/dist/components/MFormRenderer.vue.d.ts +151 -0
- package/dist/components/MMapRoute.vue.d.ts +13 -5
- package/dist/components/MPdfSigner.vue.d.ts +499 -0
- package/dist/components/MPdfViewer.vue.d.ts +12 -0
- package/dist/components/MPosKeypad.vue.d.ts +1 -1
- package/dist/components/MSpreadsheet.vue.d.ts +137 -0
- package/dist/components/MStack.vue.d.ts +1 -1
- package/dist/composables/pdfSign.d.ts +52 -0
- package/dist/composables/spreadsheetFormula.d.ts +55 -0
- package/dist/composables/useLocale.d.ts +154 -0
- package/dist/draw.js +2 -2
- package/dist/flow.js +1 -1
- package/dist/gantt.js +2 -2
- package/dist/index.d.ts +7 -0
- package/dist/locales/index.js +539 -0
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +16988 -15064
- package/dist/m3ui.js.map +1 -1
- package/dist/map.js +601 -585
- 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 +12 -13
- package/dist/rich-text-editor.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/{useLocale-Dh1xZZ8i.js → useLocale-DL96OFgr.js} +78 -1
- package/dist/useLocale-DL96OFgr.js.map +1 -0
- package/package.json +5 -1
- package/src/__tests__/MFormRenderer.test.ts +157 -0
- package/src/__tests__/MMapRoute.test.ts +34 -0
- package/src/__tests__/MPdfSigner.test.ts +175 -0
- package/src/__tests__/MSpreadsheet.test.ts +223 -0
- package/src/__tests__/spreadsheetFormula.test.ts +77 -0
- package/src/__tests__/ssr.test.ts +3 -0
- package/src/components/MFormBuilder.vue +417 -0
- package/src/components/MFormRenderer.vue +324 -0
- package/src/components/MMapRoute.vue +64 -11
- package/src/components/MPdfSigner.vue +433 -0
- package/src/components/MPdfViewer.vue +12 -0
- package/src/components/MSpreadsheet.vue +992 -0
- package/src/composables/pdfSign.ts +141 -0
- package/src/composables/spreadsheetFormula.ts +459 -0
- package/src/composables/useLocale.ts +231 -0
- package/src/index.ts +7 -0
- package/src/locales/de.ts +77 -0
- package/src/locales/es.ts +77 -0
- package/src/locales/fr.ts +77 -0
- package/src/locales/ja.ts +77 -0
- package/src/locales/ko.ts +77 -0
- package/src/locales/pt.ts +77 -0
- package/src/locales/zh.ts +77 -0
- package/src/pdf.ts +3 -0
- package/dist/MButton-CN3wYwIG.js +0 -171
- package/dist/MButton-CN3wYwIG.js.map +0 -1
- package/dist/MDialog-1LAk9WAO.js +0 -167
- package/dist/MDialog-1LAk9WAO.js.map +0 -1
- package/dist/MProgressBar-BWly1UKN.js +0 -179
- package/dist/MProgressBar-BWly1UKN.js.map +0 -1
- package/dist/useLocale-Dh1xZZ8i.js.map +0 -1
package/dist/code-editor.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as e, r as t, t as n } from "./_useFieldValidation-
|
|
1
|
+
import { n as e, r as t, t as n } from "./_useFieldValidation-B0B44M_t.js";
|
|
2
2
|
import { t as r } from "./MIcon-DpajuUTJ.js";
|
|
3
3
|
import { t as i } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
|
|
4
|
-
import { i as a } from "./useLocale-
|
|
4
|
+
import { i as a } from "./useLocale-DL96OFgr.js";
|
|
5
5
|
import { Fragment as o, computed as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, inject as m, mergeProps as h, normalizeClass as g, normalizeStyle as _, onBeforeUnmount as v, onMounted as y, openBlock as b, provide as x, ref as S, renderSlot as C, toDisplayString as w, unref as T, watch as E, withCtx as D } from "vue";
|
|
6
6
|
// src/components/MCodeEditor.vue?vue&type=script&setup=true&lang.ts
|
|
7
7
|
var O = ["aria-invalid", "aria-describedby"], k = { class: "flex items-center justify-between border-b border-outline-variant bg-surface-container px-4 py-2" }, A = { class: "text-label-medium text-on-surface-variant" }, j = { class: "flex items-center gap-2" }, M = ["title"], N = {
|
|
@@ -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;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import type { ValidateOn } from '../composables/validation';
|
|
2
|
+
import type { ValidationRule } from '../composables/validation';
|
|
3
|
+
/** The kinds of field a form schema can hold. `heading` and `divider` only lay the form out */
|
|
4
|
+
export type FormFieldType = 'text' | 'email' | 'password' | 'tel' | 'url' | 'textarea' | 'number' | 'select' | 'autocomplete' | 'radio' | 'checkbox' | 'switch' | 'date' | 'time' | 'slider' | 'rating' | 'phone' | 'heading' | 'divider';
|
|
5
|
+
/** A choice of a select, autocomplete or radio group */
|
|
6
|
+
export interface FormFieldOption {
|
|
7
|
+
label: string;
|
|
8
|
+
value: string | number | boolean;
|
|
9
|
+
}
|
|
10
|
+
/** Shows a field only while another field's value matches */
|
|
11
|
+
export interface FormFieldCondition {
|
|
12
|
+
/** The other field's name */
|
|
13
|
+
field: string;
|
|
14
|
+
/** Its value is this */
|
|
15
|
+
equals?: unknown;
|
|
16
|
+
/** Its value isn't this */
|
|
17
|
+
notEquals?: unknown;
|
|
18
|
+
/** Its value is one of these */
|
|
19
|
+
in?: unknown[];
|
|
20
|
+
/** It has a value (true) or is empty (false) */
|
|
21
|
+
filled?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/** One field of a form schema: plain JSON, so it can be stored, sent and built with MFormBuilder */
|
|
24
|
+
export interface FormFieldSchema {
|
|
25
|
+
type: FormFieldType;
|
|
26
|
+
/** The value's key (required for every type but heading and divider) */
|
|
27
|
+
name?: string;
|
|
28
|
+
label?: string;
|
|
29
|
+
placeholder?: string;
|
|
30
|
+
/** Help under the field */
|
|
31
|
+
hint?: string;
|
|
32
|
+
/** A heading's text under its title */
|
|
33
|
+
description?: string;
|
|
34
|
+
required?: boolean;
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
/** Its value before the user changes it */
|
|
37
|
+
default?: unknown;
|
|
38
|
+
/** select, autocomplete, radio: the choices (a plain string is its own label and value) */
|
|
39
|
+
options?: (FormFieldOption | string)[];
|
|
40
|
+
/** number, slider: limits. date: earliest/latest as `YYYY-MM-DD` strings */
|
|
41
|
+
min?: number | string;
|
|
42
|
+
max?: number | string;
|
|
43
|
+
step?: number;
|
|
44
|
+
/** text-like fields: length limits */
|
|
45
|
+
minLength?: number;
|
|
46
|
+
maxLength?: number;
|
|
47
|
+
/** text-like fields: a regular expression the value must match (as a string, without slashes) */
|
|
48
|
+
pattern?: string;
|
|
49
|
+
/** The message when `pattern` doesn't match */
|
|
50
|
+
patternMessage?: string;
|
|
51
|
+
/** textarea: visible lines */
|
|
52
|
+
rows?: number;
|
|
53
|
+
/** How much of the row it takes on a wide form (stacked on a narrow one). Default `full` */
|
|
54
|
+
width?: 'full' | 'half' | 'third' | 'two-thirds';
|
|
55
|
+
/** A Material Symbol at the start of text-like fields */
|
|
56
|
+
icon?: string;
|
|
57
|
+
/** Show it only when this (or all of these) holds */
|
|
58
|
+
visibleWhen?: FormFieldCondition | FormFieldCondition[];
|
|
59
|
+
/** More rules, in code (not JSON): validators, zod/valibot schemas, functions */
|
|
60
|
+
rules?: ValidationRule[];
|
|
61
|
+
}
|
|
62
|
+
/** A whole form: its fields in order, and its buttons' text */
|
|
63
|
+
export interface FormSchema {
|
|
64
|
+
title?: string;
|
|
65
|
+
description?: string;
|
|
66
|
+
fields: FormFieldSchema[];
|
|
67
|
+
/** The submit button's text */
|
|
68
|
+
submitLabel?: string;
|
|
69
|
+
/** Show a reset button with this text */
|
|
70
|
+
resetLabel?: string;
|
|
71
|
+
}
|
|
72
|
+
/** Whether a field takes a value (headings and dividers don't) */
|
|
73
|
+
export declare const isValueField: (f: FormFieldSchema) => boolean;
|
|
74
|
+
/** A field's options as `{ label, value }` */
|
|
75
|
+
export declare const normalizeOptions: (options: FormFieldSchema["options"]) => FormFieldOption[];
|
|
76
|
+
/** What a field holds before anything is typed */
|
|
77
|
+
export declare function emptyValue(f: FormFieldSchema): unknown;
|
|
78
|
+
/** Whether a field shows, given the form's values */
|
|
79
|
+
export declare function fieldVisible(f: FormFieldSchema, values: Record<string, unknown>): boolean;
|
|
80
|
+
declare const _default: typeof __VLS_export;
|
|
81
|
+
export default _default;
|
|
82
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
83
|
+
/** The form to render */
|
|
84
|
+
schema: FormSchema;
|
|
85
|
+
/** The values by field name (v-model). Missing ones start from each field's `default` */
|
|
86
|
+
modelValue?: Record<string, unknown>;
|
|
87
|
+
/** When fields check their rules (MForm's) */
|
|
88
|
+
validateOn?: ValidateOn;
|
|
89
|
+
/** Wait this long (ms) after typing stops before re-checking */
|
|
90
|
+
validateDebounce?: number;
|
|
91
|
+
/** Errors from outside (a server's), by field name */
|
|
92
|
+
errors?: Record<string, string | string[] | null | undefined>;
|
|
93
|
+
/** Disables every field and the buttons */
|
|
94
|
+
disabled?: boolean;
|
|
95
|
+
/** Show the submit (and reset) buttons */
|
|
96
|
+
actions?: boolean;
|
|
97
|
+
/** The submit button shows a spinner and can't be pressed */
|
|
98
|
+
loading?: boolean;
|
|
99
|
+
}, {
|
|
100
|
+
/** Checks every field on show (or the named ones) and shows their messages; resolves to whether they pass */
|
|
101
|
+
validate: (names?: string[] | undefined, options?: {
|
|
102
|
+
focus?: boolean;
|
|
103
|
+
} | undefined) => Promise<boolean>;
|
|
104
|
+
/** Clears the messages */
|
|
105
|
+
resetValidation: (names?: string[]) => void | undefined;
|
|
106
|
+
/** The values, defaults included */
|
|
107
|
+
values: import("vue").ComputedRef<Record<string, unknown>>;
|
|
108
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
109
|
+
submit: (values: Record<string, unknown>) => any;
|
|
110
|
+
"update:modelValue": (values: Record<string, unknown>) => any;
|
|
111
|
+
invalid: (errors: Record<string, string>) => any;
|
|
112
|
+
}, string, import("vue").PublicProps, Readonly<{
|
|
113
|
+
/** The form to render */
|
|
114
|
+
schema: FormSchema;
|
|
115
|
+
/** The values by field name (v-model). Missing ones start from each field's `default` */
|
|
116
|
+
modelValue?: Record<string, unknown>;
|
|
117
|
+
/** When fields check their rules (MForm's) */
|
|
118
|
+
validateOn?: ValidateOn;
|
|
119
|
+
/** Wait this long (ms) after typing stops before re-checking */
|
|
120
|
+
validateDebounce?: number;
|
|
121
|
+
/** Errors from outside (a server's), by field name */
|
|
122
|
+
errors?: Record<string, string | string[] | null | undefined>;
|
|
123
|
+
/** Disables every field and the buttons */
|
|
124
|
+
disabled?: boolean;
|
|
125
|
+
/** Show the submit (and reset) buttons */
|
|
126
|
+
actions?: boolean;
|
|
127
|
+
/** The submit button shows a spinner and can't be pressed */
|
|
128
|
+
loading?: boolean;
|
|
129
|
+
}> & Readonly<{
|
|
130
|
+
onSubmit?: ((values: Record<string, unknown>) => any) | undefined;
|
|
131
|
+
"onUpdate:modelValue"?: ((values: Record<string, unknown>) => any) | undefined;
|
|
132
|
+
onInvalid?: ((errors: Record<string, string>) => any) | undefined;
|
|
133
|
+
}>, {
|
|
134
|
+
modelValue: Record<string, unknown>;
|
|
135
|
+
actions: boolean;
|
|
136
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
137
|
+
[x: `field-${string}`]: ((props: {
|
|
138
|
+
field: FormFieldSchema;
|
|
139
|
+
value: unknown;
|
|
140
|
+
update: (v: unknown) => void;
|
|
141
|
+
}) => any) | undefined;
|
|
142
|
+
} & {
|
|
143
|
+
actions?: (props: {
|
|
144
|
+
reset: () => Promise<void> | undefined;
|
|
145
|
+
}) => any;
|
|
146
|
+
}>;
|
|
147
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
148
|
+
new (): {
|
|
149
|
+
$slots: S;
|
|
150
|
+
};
|
|
151
|
+
};
|
|
@@ -34,8 +34,12 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
34
34
|
rotateVehicle?: boolean;
|
|
35
35
|
/** Show the vehicle (when there's a `progress` or `vehicle`) */
|
|
36
36
|
showVehicle?: boolean;
|
|
37
|
-
/**
|
|
38
|
-
|
|
37
|
+
/**
|
|
38
|
+
* How long the vehicle takes to move to a new position, in ms (0 jumps). `auto` (default) takes as long as the
|
|
39
|
+
* time between the last two positions, so a vehicle fed every few seconds keeps moving at an even pace instead of
|
|
40
|
+
* stopping between fixes (or slowing down when one arrives early). Reduced motion jumps
|
|
41
|
+
*/
|
|
42
|
+
duration?: number | "auto";
|
|
39
43
|
/** Fit the map to the whole route when it's shown and when the route changes */
|
|
40
44
|
fit?: boolean;
|
|
41
45
|
/** Keep the vehicle in the middle of the map as it moves */
|
|
@@ -98,8 +102,12 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
98
102
|
rotateVehicle?: boolean;
|
|
99
103
|
/** Show the vehicle (when there's a `progress` or `vehicle`) */
|
|
100
104
|
showVehicle?: boolean;
|
|
101
|
-
/**
|
|
102
|
-
|
|
105
|
+
/**
|
|
106
|
+
* How long the vehicle takes to move to a new position, in ms (0 jumps). `auto` (default) takes as long as the
|
|
107
|
+
* time between the last two positions, so a vehicle fed every few seconds keeps moving at an even pace instead of
|
|
108
|
+
* stopping between fixes (or slowing down when one arrives early). Reduced motion jumps
|
|
109
|
+
*/
|
|
110
|
+
duration?: number | "auto";
|
|
103
111
|
/** Fit the map to the whole route when it's shown and when the route changes */
|
|
104
112
|
fit?: boolean;
|
|
105
113
|
/** Keep the vehicle in the middle of the map as it moves */
|
|
@@ -134,7 +142,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
134
142
|
onArrive?: (() => any) | undefined;
|
|
135
143
|
}>, {
|
|
136
144
|
width: number;
|
|
137
|
-
duration: number;
|
|
145
|
+
duration: number | "auto";
|
|
138
146
|
snap: "forward" | "nearest";
|
|
139
147
|
flow: boolean;
|
|
140
148
|
fit: boolean;
|