@finema/core 3.22.0 → 3.24.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/README.md +22 -2
- package/dist/module.d.mts +2 -0
- package/dist/module.json +2 -2
- package/dist/module.mjs +18 -15
- package/dist/runtime/components/App.vue +1 -1
- package/dist/runtime/components/DevToolsWindow/index.vue +24 -26
- package/dist/runtime/components/Dialog/index.d.vue.ts +1 -4
- package/dist/runtime/components/Dialog/index.vue +17 -17
- package/dist/runtime/components/Dialog/index.vue.d.ts +1 -4
- package/dist/runtime/components/Empty.d.vue.ts +1 -2
- package/dist/runtime/components/Empty.vue +19 -11
- package/dist/runtime/components/Empty.vue.d.ts +1 -2
- package/dist/runtime/components/FlexDeck/index.vue +21 -23
- package/dist/runtime/components/Form/FieldWrapper.vue +1 -1
- package/dist/runtime/components/Form/Fields.d.vue.ts +1 -1
- package/dist/runtime/components/Form/Fields.vue +26 -20
- package/dist/runtime/components/Form/Fields.vue.d.ts +1 -1
- package/dist/runtime/components/Form/InputCheckbox/index.vue +3 -6
- package/dist/runtime/components/Form/InputCheckboxGroup/index.vue +3 -6
- package/dist/runtime/components/Form/InputComponent/index.vue +2 -1
- package/dist/runtime/components/Form/InputCurrency/index.vue +11 -11
- package/dist/runtime/components/Form/InputDateTime/date_time_field.types.d.ts +3 -1
- package/dist/runtime/components/Form/InputDateTime/index.vue +12 -17
- package/dist/runtime/components/Form/InputDateTimeRange/date_range_time_field.types.d.ts +1 -1
- package/dist/runtime/components/Form/InputDateTimeRange/index.vue +28 -20
- package/dist/runtime/components/Form/InputMonth/index.vue +14 -12
- package/dist/runtime/components/Form/InputMonth/types.d.ts +1 -1
- package/dist/runtime/components/Form/InputNumber/index.vue +3 -6
- package/dist/runtime/components/Form/InputRadio/index.vue +3 -6
- package/dist/runtime/components/Form/InputRating/index.vue +3 -6
- package/dist/runtime/components/Form/InputSearch/index.vue +6 -7
- package/dist/runtime/components/Form/InputSelect/index.vue +6 -15
- package/dist/runtime/components/Form/InputSelectMultiple/index.vue +7 -18
- package/dist/runtime/components/Form/InputTags/index.vue +3 -6
- package/dist/runtime/components/Form/InputText/index.vue +41 -51
- package/dist/runtime/components/Form/InputTextarea/index.vue +3 -6
- package/dist/runtime/components/Form/InputTime/index.vue +32 -27
- package/dist/runtime/components/Form/InputTime/types.d.ts +1 -1
- package/dist/runtime/components/Form/InputToggle/index.vue +3 -5
- package/dist/runtime/components/Form/InputUploadDropzone/index.d.vue.ts +1 -4
- package/dist/runtime/components/Form/InputUploadDropzone/index.vue +25 -23
- package/dist/runtime/components/Form/InputUploadDropzone/index.vue.d.ts +1 -4
- package/dist/runtime/components/Form/InputUploadDropzone/types.d.ts +2 -2
- package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.d.vue.ts +0 -5
- package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.vue +22 -23
- package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.vue.d.ts +0 -5
- package/dist/runtime/components/Form/InputUploadDropzoneAuto/types.d.ts +3 -3
- package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/index.d.vue.ts +0 -5
- package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/index.vue +26 -24
- package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/index.vue.d.ts +0 -5
- package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/types.d.ts +3 -3
- package/dist/runtime/components/Form/InputUploadImageAuto/index.d.vue.ts +1 -6
- package/dist/runtime/components/Form/InputUploadImageAuto/index.vue +22 -23
- package/dist/runtime/components/Form/InputUploadImageAuto/index.vue.d.ts +1 -6
- package/dist/runtime/components/Form/InputUploadImageAuto/types.d.ts +3 -3
- package/dist/runtime/components/Form/InputWYSIWYG/EditorImagePasteExtension.js +7 -6
- package/dist/runtime/components/Form/InputWYSIWYG/EditorImageUploadExtension.js +13 -12
- package/dist/runtime/components/Form/InputWYSIWYG/EditorImageUploadNode.vue +3 -1
- package/dist/runtime/components/Form/InputWYSIWYG/EditorLinkPopover.vue +20 -22
- package/dist/runtime/components/Form/InputWYSIWYG/index.vue +140 -118
- package/dist/runtime/components/Form/fileState/EmptyState.vue +1 -1
- package/dist/runtime/components/Form/fileState/FailedState.vue +4 -2
- package/dist/runtime/components/Form/fileState/MultipleFilesState.d.vue.ts +4 -4
- package/dist/runtime/components/Form/fileState/MultipleFilesState.vue +5 -5
- package/dist/runtime/components/Form/fileState/MultipleFilesState.vue.d.ts +4 -4
- package/dist/runtime/components/Form/fileState/SuccessState.d.vue.ts +2 -2
- package/dist/runtime/components/Form/fileState/SuccessState.vue +8 -13
- package/dist/runtime/components/Form/fileState/SuccessState.vue.d.ts +2 -2
- package/dist/runtime/components/Form/fileState/useFilePicker.d.ts +34 -0
- package/dist/runtime/components/Form/fileState/useFilePicker.js +48 -0
- package/dist/runtime/components/Form/fileState/useFileState.d.ts +7 -9
- package/dist/runtime/components/Form/fileState/useFileState.js +32 -120
- package/dist/runtime/components/Form/fileState/useUploadImageState.d.ts +7 -8
- package/dist/runtime/components/Form/fileState/useUploadImageState.js +27 -301
- package/dist/runtime/components/Form/fileState/useUploadState.d.ts +11 -7
- package/dist/runtime/components/Form/fileState/useUploadState.js +52 -136
- package/dist/runtime/components/Form/fileState/useUploadStateMultiple.d.ts +12 -18
- package/dist/runtime/components/Form/fileState/useUploadStateMultiple.js +88 -226
- package/dist/runtime/components/Form/types.d.ts +2 -0
- package/dist/runtime/components/Image.vue +4 -10
- package/dist/runtime/components/Loader.d.vue.ts +2 -1
- package/dist/runtime/components/Loader.vue +10 -7
- package/dist/runtime/components/Loader.vue.d.ts +2 -1
- package/dist/runtime/components/Log/LogItem.vue +1 -3
- package/dist/runtime/components/Log/index.vue +1 -3
- package/dist/runtime/components/Table/Base.d.vue.ts +15 -1
- package/dist/runtime/components/Table/Base.vue +9 -29
- package/dist/runtime/components/Table/Base.vue.d.ts +15 -1
- package/dist/runtime/components/Table/ColumnText.d.vue.ts +2 -3
- package/dist/runtime/components/Table/ColumnText.vue +1 -1
- package/dist/runtime/components/Table/ColumnText.vue.d.ts +2 -3
- package/dist/runtime/components/Table/Pagination.vue +19 -22
- package/dist/runtime/components/Table/index.d.vue.ts +1 -1
- package/dist/runtime/components/Table/index.vue +5 -7
- package/dist/runtime/components/Table/index.vue.d.ts +1 -1
- package/dist/runtime/composables/loaderList.d.ts +2 -1
- package/dist/runtime/composables/loaderList.js +3 -4
- package/dist/runtime/composables/loaderObject.d.ts +2 -1
- package/dist/runtime/composables/loaderObject.js +2 -1
- package/dist/runtime/composables/loaderPage.js +223 -350
- package/dist/runtime/composables/useConfig.js +4 -3
- package/dist/runtime/composables/useDialog.js +3 -1
- package/dist/runtime/composables/useForm.d.ts +2 -2
- package/dist/runtime/composables/useForm.js +2 -4
- package/dist/runtime/composables/useMessages.d.ts +10 -0
- package/dist/runtime/composables/useMessages.js +10 -0
- package/dist/runtime/composables/useTable.js +2 -14
- package/dist/runtime/helpers/apiBaseHelper.js +6 -24
- package/dist/runtime/helpers/apiListHelper.js +2 -5
- package/dist/runtime/helpers/apiObjectHelper.js +2 -5
- package/dist/runtime/helpers/apiPageHelper.d.ts +0 -1
- package/dist/runtime/helpers/apiPageHelper.js +19 -38
- package/dist/runtime/helpers/componentHelper.js +2 -6
- package/dist/runtime/helpers/uploadCore.d.ts +54 -0
- package/dist/runtime/helpers/uploadCore.js +81 -0
- package/dist/runtime/i18n/valibot.d.ts +5 -68
- package/dist/runtime/i18n/valibot.js +33 -29
- package/dist/runtime/locale/en.d.ts +2 -0
- package/dist/runtime/locale/en.js +42 -0
- package/dist/runtime/locale/index.d.ts +7 -0
- package/dist/runtime/locale/index.js +5 -0
- package/dist/runtime/locale/th.d.ts +43 -0
- package/dist/runtime/locale/th.js +42 -0
- package/dist/runtime/server/tsconfig.json +1 -1
- package/dist/runtime/styles/main.css +1 -1
- package/dist/runtime/utils/ParamHelper.js +1 -1
- package/dist/runtime/utils/StringHelper.js +1 -4
- package/dist/runtime/utils/TimeHelper.js +2 -2
- package/dist/runtime/utils/lodash.js +2 -2
- package/package.json +57 -36
|
@@ -4,7 +4,7 @@ import { computed, toRef } from "#imports";
|
|
|
4
4
|
export const useFieldHOC = (newFormProps, opts) => {
|
|
5
5
|
const field = useField(
|
|
6
6
|
toRef(newFormProps, "name"),
|
|
7
|
-
toTypedSchema(newFormProps.rules),
|
|
7
|
+
newFormProps.rules ? toTypedSchema(newFormProps.rules) : void 0,
|
|
8
8
|
{
|
|
9
9
|
form: newFormProps.form,
|
|
10
10
|
...opts
|
|
@@ -21,9 +21,7 @@ export const useFieldHOC = (newFormProps, opts) => {
|
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
23
|
export const createFormFields = (fields) => computed(fields);
|
|
24
|
-
export const moveToError = ({
|
|
25
|
-
errors
|
|
26
|
-
}) => {
|
|
24
|
+
export const moveToError = ({ errors }) => {
|
|
27
25
|
const firstErrorFieldName = Object.keys(errors)[0];
|
|
28
26
|
const el = document.querySelector(`[name="${firstErrorFieldName}"]`);
|
|
29
27
|
if (el) {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ComputedRef } from 'vue';
|
|
2
|
+
import { formatMessage, type ICoreMessages } from '../locale/index.js';
|
|
3
|
+
export interface IUseCoreMessages {
|
|
4
|
+
messages: ComputedRef<ICoreMessages>;
|
|
5
|
+
format: typeof formatMessage;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Text the kit renders by itself, in `core.locale`, with `core.messages` overrides from app.config applied.
|
|
9
|
+
*/
|
|
10
|
+
export declare const useCoreMessages: () => IUseCoreMessages;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { computed } from "vue";
|
|
2
|
+
import { formatMessage, resolveMessages } from "../locale/index.js";
|
|
3
|
+
import { useCoreConfig } from "./useConfig.js";
|
|
4
|
+
export const useCoreMessages = () => {
|
|
5
|
+
const config = useCoreConfig();
|
|
6
|
+
return {
|
|
7
|
+
messages: computed(() => resolveMessages(config.locale, config.messages)),
|
|
8
|
+
format: formatMessage
|
|
9
|
+
};
|
|
10
|
+
};
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { get } from "@vueuse/core";
|
|
2
2
|
import { computed, ObjectHelper } from "#imports";
|
|
3
3
|
export const useTable = (options) => computed(() => {
|
|
4
|
-
const {
|
|
5
|
-
repo,
|
|
6
|
-
columns,
|
|
7
|
-
transformItems,
|
|
8
|
-
options: nestedOptions,
|
|
9
|
-
...inlineOptions
|
|
10
|
-
} = options;
|
|
4
|
+
const { repo, columns, transformItems, options: nestedOptions, ...inlineOptions } = options;
|
|
11
5
|
return createTableOptions(
|
|
12
6
|
repo,
|
|
13
7
|
columns(),
|
|
@@ -19,13 +13,7 @@ export const useTable = (options) => computed(() => {
|
|
|
19
13
|
);
|
|
20
14
|
});
|
|
21
15
|
export const useTableSimple = (options) => computed(() => {
|
|
22
|
-
const {
|
|
23
|
-
items,
|
|
24
|
-
status,
|
|
25
|
-
columns,
|
|
26
|
-
options: nestedOptions,
|
|
27
|
-
...inlineOptions
|
|
28
|
-
} = options;
|
|
16
|
+
const { items, status, columns, options: nestedOptions, ...inlineOptions } = options;
|
|
29
17
|
return {
|
|
30
18
|
items: items(),
|
|
31
19
|
columns: columns(),
|
|
@@ -52,11 +52,7 @@ export const createErrorOptions = (error, request) => ({
|
|
|
52
52
|
request
|
|
53
53
|
});
|
|
54
54
|
export const toSerializableLoaderOptions = (opts) => {
|
|
55
|
-
const {
|
|
56
|
-
request,
|
|
57
|
-
signal: _signal,
|
|
58
|
-
...rest
|
|
59
|
-
} = opts;
|
|
55
|
+
const { request, signal: _signal, ...rest } = opts;
|
|
60
56
|
const serializableOptions = JSON.parse(JSON.stringify(rest));
|
|
61
57
|
if (request) {
|
|
62
58
|
serializableOptions.request = toSerializableRequestOptions(request);
|
|
@@ -89,12 +85,7 @@ const wait = (ms, signal) => new Promise((resolve, reject) => {
|
|
|
89
85
|
});
|
|
90
86
|
});
|
|
91
87
|
export const handleApiRequest = async (requestContext, mockData, callbacks) => {
|
|
92
|
-
const {
|
|
93
|
-
url,
|
|
94
|
-
method,
|
|
95
|
-
data,
|
|
96
|
-
options
|
|
97
|
-
} = requestContext;
|
|
88
|
+
const { url, method, data, options } = requestContext;
|
|
98
89
|
try {
|
|
99
90
|
if (mockData) {
|
|
100
91
|
await wait(300, options.signal);
|
|
@@ -111,19 +102,10 @@ export const handleApiRequest = async (requestContext, mockData, callbacks) => {
|
|
|
111
102
|
}
|
|
112
103
|
};
|
|
113
104
|
export const updateLoaderState = {
|
|
114
|
-
setLoading: (status) => ObjectHelper.toLoadingStatus(
|
|
115
|
-
|
|
116
|
-
),
|
|
117
|
-
|
|
118
|
-
status
|
|
119
|
-
),
|
|
120
|
-
setError: (status, error) => ObjectHelper.toErrorStatus(
|
|
121
|
-
status,
|
|
122
|
-
error
|
|
123
|
-
),
|
|
124
|
-
setComplete: (status) => ObjectHelper.toCompleteStatus(
|
|
125
|
-
status
|
|
126
|
-
),
|
|
105
|
+
setLoading: (status) => ObjectHelper.toLoadingStatus(status),
|
|
106
|
+
setSuccess: (status) => ObjectHelper.toSuccessStatus(status),
|
|
107
|
+
setError: (status, error) => ObjectHelper.toErrorStatus(status, error),
|
|
108
|
+
setComplete: (status) => ObjectHelper.toCompleteStatus(status),
|
|
127
109
|
setOptions: (options, updates) => ({
|
|
128
110
|
...options,
|
|
129
111
|
...updates,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { bindParamsToUrl } from "./apiBaseHelper.js";
|
|
2
1
|
import {
|
|
2
|
+
bindParamsToUrl,
|
|
3
3
|
checkExpiration,
|
|
4
4
|
createErrorOptions,
|
|
5
5
|
createSuccessOptions,
|
|
@@ -14,10 +14,7 @@ export const apiListHelper = async (state, onUpdateStatus, onUpdateOptions, onUp
|
|
|
14
14
|
}
|
|
15
15
|
onUpdateStatus(updateLoaderState.setLoading(state().status));
|
|
16
16
|
onUpdateOptions({});
|
|
17
|
-
const {
|
|
18
|
-
requestOptions,
|
|
19
|
-
stateRequestOptions
|
|
20
|
-
} = prepareLoaderRequestOptions(
|
|
17
|
+
const { requestOptions, stateRequestOptions } = prepareLoaderRequestOptions(
|
|
21
18
|
{},
|
|
22
19
|
opts.getRequestOptions?.(opts),
|
|
23
20
|
opts.params,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { bindParamsToUrl } from "./apiBaseHelper.js";
|
|
2
1
|
import {
|
|
2
|
+
bindParamsToUrl,
|
|
3
3
|
checkExpiration,
|
|
4
4
|
createErrorOptions,
|
|
5
5
|
createSuccessOptions,
|
|
@@ -14,10 +14,7 @@ export const apiObjectHelper = async (state, onUpdateStatus, onUpdateOptions, on
|
|
|
14
14
|
}
|
|
15
15
|
onUpdateStatus(updateLoaderState.setLoading(state().status));
|
|
16
16
|
onUpdateOptions({});
|
|
17
|
-
const {
|
|
18
|
-
requestOptions,
|
|
19
|
-
stateRequestOptions
|
|
20
|
-
} = prepareLoaderRequestOptions(
|
|
17
|
+
const { requestOptions, stateRequestOptions } = prepareLoaderRequestOptions(
|
|
21
18
|
{},
|
|
22
19
|
opts.getRequestOptions?.(payload, opts),
|
|
23
20
|
opts.params,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useCoreConfig } from "../composables/useConfig.js";
|
|
2
2
|
import { _get } from "../utils/lodash.js";
|
|
3
|
-
import { bindParamsToUrl } from "./apiBaseHelper.js";
|
|
4
3
|
import {
|
|
4
|
+
bindParamsToUrl,
|
|
5
5
|
checkExpiration,
|
|
6
6
|
createErrorOptions,
|
|
7
7
|
createSuccessOptions,
|
|
@@ -14,10 +14,7 @@ import { _findIndex, _shuffle } from "#imports";
|
|
|
14
14
|
export const apiAddHelper = async (state, onUpdateStatus, onUpdateOptions, onUpdateData, onUpdateItems, data, opts) => {
|
|
15
15
|
onUpdateStatus(updateLoaderState.setLoading(state().status));
|
|
16
16
|
onUpdateOptions({});
|
|
17
|
-
const {
|
|
18
|
-
requestOptions,
|
|
19
|
-
stateRequestOptions
|
|
20
|
-
} = prepareLoaderRequestOptions(
|
|
17
|
+
const { requestOptions, stateRequestOptions } = prepareLoaderRequestOptions(
|
|
21
18
|
opts.getBaseRequestOptions?.() || {},
|
|
22
19
|
opts.add?.getRequestOptions?.(data, opts),
|
|
23
20
|
opts.params,
|
|
@@ -53,16 +50,16 @@ export const apiDeleteHelper = async (state, onUpdateStatus, onUpdateOptions, _o
|
|
|
53
50
|
const getPrimaryKey = (item) => _get(item, primaryKey, "");
|
|
54
51
|
onUpdateStatus(updateLoaderState.setLoading(state().status));
|
|
55
52
|
onUpdateOptions({});
|
|
56
|
-
const {
|
|
57
|
-
requestOptions,
|
|
58
|
-
stateRequestOptions
|
|
59
|
-
} = prepareLoaderRequestOptions(
|
|
53
|
+
const { requestOptions, stateRequestOptions } = prepareLoaderRequestOptions(
|
|
60
54
|
opts.getBaseRequestOptions?.() || {},
|
|
61
55
|
opts.delete?.getRequestOptions?.(id, opts),
|
|
62
56
|
opts.params,
|
|
63
57
|
opts.signal
|
|
64
58
|
);
|
|
65
|
-
const url = bindParamsToUrl(
|
|
59
|
+
const url = bindParamsToUrl(
|
|
60
|
+
opts.delete?.getURL ? opts.delete.getURL(id, opts) : `${opts.baseURL}/${id}`,
|
|
61
|
+
opts.pathBind
|
|
62
|
+
);
|
|
66
63
|
await handleApiRequest(
|
|
67
64
|
{
|
|
68
65
|
url,
|
|
@@ -74,9 +71,7 @@ export const apiDeleteHelper = async (state, onUpdateStatus, onUpdateOptions, _o
|
|
|
74
71
|
{
|
|
75
72
|
onSuccess: (_, status) => {
|
|
76
73
|
if (state().items) {
|
|
77
|
-
onUpdateItems(
|
|
78
|
-
state().items.filter((item) => getPrimaryKey(item) !== id)
|
|
79
|
-
);
|
|
74
|
+
onUpdateItems(state().items.filter((item) => getPrimaryKey(item) !== id));
|
|
80
75
|
}
|
|
81
76
|
onUpdateStatus(updateLoaderState.setSuccess(state().status));
|
|
82
77
|
onUpdateOptions(createSuccessOptions(status, stateRequestOptions));
|
|
@@ -109,12 +104,7 @@ export const apiFetchHelper = async (state, onUpdateStatus, onUpdateOptions, onU
|
|
|
109
104
|
_status: void 0
|
|
110
105
|
});
|
|
111
106
|
const getOptions = (data) => {
|
|
112
|
-
const {
|
|
113
|
-
page: page2,
|
|
114
|
-
total,
|
|
115
|
-
limit: limit2,
|
|
116
|
-
...more
|
|
117
|
-
} = data;
|
|
107
|
+
const { page: page2, total, limit: limit2, ...more } = data;
|
|
118
108
|
return {
|
|
119
109
|
...toSerializableLoaderOptions(state().options),
|
|
120
110
|
...more,
|
|
@@ -127,14 +117,11 @@ export const apiFetchHelper = async (state, onUpdateStatus, onUpdateOptions, onU
|
|
|
127
117
|
};
|
|
128
118
|
};
|
|
129
119
|
const baseRequestOptions = {
|
|
130
|
-
...opts.getBaseRequestOptions?.()
|
|
131
|
-
...opts.fetch?.getRequestOptions?.(page, query, opts)
|
|
120
|
+
...opts.getBaseRequestOptions?.(),
|
|
121
|
+
...opts.fetch?.getRequestOptions?.(page, query, opts)
|
|
132
122
|
};
|
|
133
123
|
const limit = Number(state().options.limit || baseRequestOptions.params?.limit || config.limit_per_page);
|
|
134
|
-
const {
|
|
135
|
-
requestOptions,
|
|
136
|
-
stateRequestOptions
|
|
137
|
-
} = prepareLoaderRequestOptions(
|
|
124
|
+
const { requestOptions, stateRequestOptions } = prepareLoaderRequestOptions(
|
|
138
125
|
baseRequestOptions,
|
|
139
126
|
{
|
|
140
127
|
params: {
|
|
@@ -160,10 +147,7 @@ export const apiFetchHelper = async (state, onUpdateStatus, onUpdateOptions, onU
|
|
|
160
147
|
} : null,
|
|
161
148
|
{
|
|
162
149
|
onSuccess: (response, status) => {
|
|
163
|
-
const {
|
|
164
|
-
items,
|
|
165
|
-
...moreOptions
|
|
166
|
-
} = response;
|
|
150
|
+
const { items, ...moreOptions } = response;
|
|
167
151
|
onUpdateItems(items);
|
|
168
152
|
onUpdateOptions({
|
|
169
153
|
...getOptions(moreOptions),
|
|
@@ -191,10 +175,7 @@ export const apiFindHelper = async (state, onUpdateStatus, onUpdateOptions, onUp
|
|
|
191
175
|
}
|
|
192
176
|
onUpdateStatus(updateLoaderState.setLoading(state().status));
|
|
193
177
|
onUpdateOptions({});
|
|
194
|
-
const {
|
|
195
|
-
requestOptions,
|
|
196
|
-
stateRequestOptions
|
|
197
|
-
} = prepareLoaderRequestOptions(
|
|
178
|
+
const { requestOptions, stateRequestOptions } = prepareLoaderRequestOptions(
|
|
198
179
|
opts.getBaseRequestOptions?.() || {},
|
|
199
180
|
opts.find?.getRequestOptions?.(id, opts),
|
|
200
181
|
opts.params,
|
|
@@ -231,16 +212,16 @@ export const updateHelper = async (state, onUpdateStatus, onUpdateOptions, onUpd
|
|
|
231
212
|
}
|
|
232
213
|
onUpdateStatus(updateLoaderState.setLoading(state().status));
|
|
233
214
|
onUpdateOptions({});
|
|
234
|
-
const {
|
|
235
|
-
requestOptions,
|
|
236
|
-
stateRequestOptions
|
|
237
|
-
} = prepareLoaderRequestOptions(
|
|
215
|
+
const { requestOptions, stateRequestOptions } = prepareLoaderRequestOptions(
|
|
238
216
|
opts.getBaseRequestOptions?.() || {},
|
|
239
217
|
opts.update?.getRequestOptions?.(id, data, opts),
|
|
240
218
|
opts.params,
|
|
241
219
|
opts.signal
|
|
242
220
|
);
|
|
243
|
-
const url = bindParamsToUrl(
|
|
221
|
+
const url = bindParamsToUrl(
|
|
222
|
+
opts.update?.getURL ? opts.update.getURL(id, data, opts) : `${opts.baseURL}/${id}`,
|
|
223
|
+
opts.pathBind
|
|
224
|
+
);
|
|
244
225
|
await handleApiRequest(
|
|
245
226
|
{
|
|
246
227
|
url,
|
|
@@ -53,16 +53,12 @@ export const isPDFFromPath = (path = "") => {
|
|
|
53
53
|
};
|
|
54
54
|
export const useFileAllocate = (selectedFile, props) => {
|
|
55
55
|
const selectedFileSizeKb = computed(() => ((selectedFile.value?.size || 0) / 1e3).toFixed(2));
|
|
56
|
-
const selectedFileSizeMb = computed(
|
|
57
|
-
() => ((selectedFile.value?.size || 0) / 1e3 / 1e3).toFixed(2)
|
|
58
|
-
);
|
|
56
|
+
const selectedFileSizeMb = computed(() => ((selectedFile.value?.size || 0) / 1e3 / 1e3).toFixed(2));
|
|
59
57
|
const isSelectedFileUseMb = computed(() => (selectedFile.value?.size || 0) / 1e3 > 1024);
|
|
60
58
|
const acceptFileSizeKb = computed(() => props.maxSize || 0);
|
|
61
59
|
const acceptFileSizeMb = computed(() => ((acceptFileSizeKb.value || 0) / 1024).toFixed(2));
|
|
62
60
|
const isAcceptFileUseMb = computed(() => acceptFileSizeKb.value && acceptFileSizeKb.value > 1024);
|
|
63
|
-
const acceptFile = computed(
|
|
64
|
-
() => typeof props.accept === "string" ? props.accept : props.accept?.join(",")
|
|
65
|
-
);
|
|
61
|
+
const acceptFile = computed(() => typeof props.accept === "string" ? props.accept : props.accept?.join(","));
|
|
66
62
|
return {
|
|
67
63
|
selectedFileSizeKb,
|
|
68
64
|
selectedFileSizeMb,
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { IFileValue } from '../components/Form/types.js';
|
|
2
|
+
import { type ICoreMessages } from '../locale/index.js';
|
|
3
|
+
export declare enum UploadState {
|
|
4
|
+
EMPTY = "empty",
|
|
5
|
+
UPLOADING = "uploading",
|
|
6
|
+
SUCCESS = "success",
|
|
7
|
+
ERROR = "error"
|
|
8
|
+
}
|
|
9
|
+
export interface IFileRules {
|
|
10
|
+
accept?: string | string[];
|
|
11
|
+
/** In KB */
|
|
12
|
+
maxSize?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface IDimensionRules {
|
|
15
|
+
width?: number;
|
|
16
|
+
height?: number;
|
|
17
|
+
minWidth?: number;
|
|
18
|
+
minHeight?: number;
|
|
19
|
+
maxWidth?: number;
|
|
20
|
+
maxHeight?: number;
|
|
21
|
+
aspectRatio?: number;
|
|
22
|
+
aspectRatioTolerance?: number;
|
|
23
|
+
}
|
|
24
|
+
export interface IFileResponseKeys {
|
|
25
|
+
responseURL?: string;
|
|
26
|
+
responsePath?: string;
|
|
27
|
+
responseName?: string;
|
|
28
|
+
responseSize?: string;
|
|
29
|
+
responseID?: string;
|
|
30
|
+
}
|
|
31
|
+
type UploadMessages = ICoreMessages['upload'];
|
|
32
|
+
export declare const parseAccept: (accept: IFileRules["accept"]) => string[];
|
|
33
|
+
/**
|
|
34
|
+
* Accepts extensions (".jpg", "jpg"), wildcards ("image/*") and exact MIME types ("application/pdf")
|
|
35
|
+
*/
|
|
36
|
+
export declare const isAcceptedFileType: (file: Pick<File, "name" | "type">, acceptedTypes: string[]) => boolean;
|
|
37
|
+
export declare const formatMaxSize: (maxSizeKb: number) => string;
|
|
38
|
+
/**
|
|
39
|
+
* @returns the error message, or undefined when the file passes
|
|
40
|
+
*/
|
|
41
|
+
export declare const validateFile: (file: Pick<File, "name" | "type" | "size">, rules: IFileRules, messages: UploadMessages) => string | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* @returns the error message, or undefined when the image passes
|
|
44
|
+
*/
|
|
45
|
+
export declare const validateDimensions: (image: {
|
|
46
|
+
width: number;
|
|
47
|
+
height: number;
|
|
48
|
+
}, rules: IDimensionRules | undefined, messages: UploadMessages) => string | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Map the upload API response to the value stored in the form, falling back to the local file's name and size
|
|
51
|
+
*/
|
|
52
|
+
export declare const toFileValue: (response: unknown, keys: IFileResponseKeys, file?: Pick<File, "name" | "size">) => IFileValue;
|
|
53
|
+
export declare const toUploadFormData: (bodyKey: string, file: File) => FormData;
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { formatMessage } from "../locale/index.js";
|
|
2
|
+
import { _get } from "../utils/lodash.js";
|
|
3
|
+
export var UploadState = /* @__PURE__ */ ((UploadState2) => {
|
|
4
|
+
UploadState2["EMPTY"] = "empty";
|
|
5
|
+
UploadState2["UPLOADING"] = "uploading";
|
|
6
|
+
UploadState2["SUCCESS"] = "success";
|
|
7
|
+
UploadState2["ERROR"] = "error";
|
|
8
|
+
return UploadState2;
|
|
9
|
+
})(UploadState || {});
|
|
10
|
+
export const parseAccept = (accept) => (Array.isArray(accept) ? accept : (accept || "").split(",")).map((type) => type.trim()).filter(Boolean);
|
|
11
|
+
export const isAcceptedFileType = (file, acceptedTypes) => {
|
|
12
|
+
if (!acceptedTypes.length) return true;
|
|
13
|
+
const fileExtension = file.name.toLowerCase().split(".").pop();
|
|
14
|
+
return acceptedTypes.some((acceptedType) => {
|
|
15
|
+
if (acceptedType.startsWith(".")) {
|
|
16
|
+
return fileExtension === acceptedType.slice(1).toLowerCase();
|
|
17
|
+
}
|
|
18
|
+
if (!acceptedType.includes("/") && !acceptedType.includes("*")) {
|
|
19
|
+
return fileExtension === acceptedType.toLowerCase();
|
|
20
|
+
}
|
|
21
|
+
if (acceptedType.endsWith("/*")) {
|
|
22
|
+
return file.type.startsWith(acceptedType.slice(0, -1));
|
|
23
|
+
}
|
|
24
|
+
return file.type === acceptedType;
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
export const formatMaxSize = (maxSizeKb) => maxSizeKb > 1024 ? `${(maxSizeKb / 1024).toFixed(2)} MB` : `${maxSizeKb} KB`;
|
|
28
|
+
export const validateFile = (file, rules, messages) => {
|
|
29
|
+
const acceptedTypes = parseAccept(rules.accept);
|
|
30
|
+
if (!isAcceptedFileType(file, acceptedTypes)) {
|
|
31
|
+
return formatMessage(messages.invalidType, {
|
|
32
|
+
types: acceptedTypes.join(", ")
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
if (rules.maxSize && file.size > rules.maxSize * 1024) {
|
|
36
|
+
return formatMessage(messages.maxSize, {
|
|
37
|
+
size: formatMaxSize(rules.maxSize)
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
export const validateDimensions = (image, rules, messages) => {
|
|
42
|
+
if (!rules) return;
|
|
43
|
+
const { width, height } = image;
|
|
44
|
+
const checks = [
|
|
45
|
+
[rules.width !== void 0 && width !== rules.width, messages.imageWidth, rules.width, width],
|
|
46
|
+
[rules.height !== void 0 && height !== rules.height, messages.imageHeight, rules.height, height],
|
|
47
|
+
[rules.minWidth !== void 0 && width < rules.minWidth, messages.imageMinWidth, rules.minWidth, width],
|
|
48
|
+
[rules.minHeight !== void 0 && height < rules.minHeight, messages.imageMinHeight, rules.minHeight, height],
|
|
49
|
+
[rules.maxWidth !== void 0 && width > rules.maxWidth, messages.imageMaxWidth, rules.maxWidth, width],
|
|
50
|
+
[rules.maxHeight !== void 0 && height > rules.maxHeight, messages.imageMaxHeight, rules.maxHeight, height]
|
|
51
|
+
];
|
|
52
|
+
for (const [failed, template, expected, actual] of checks) {
|
|
53
|
+
if (failed) {
|
|
54
|
+
return formatMessage(template, {
|
|
55
|
+
expected,
|
|
56
|
+
actual
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (rules.aspectRatio !== void 0) {
|
|
61
|
+
const actualRatio = width / height;
|
|
62
|
+
if (Math.abs(actualRatio - rules.aspectRatio) > (rules.aspectRatioTolerance ?? 0.01)) {
|
|
63
|
+
return formatMessage(messages.imageAspectRatio, {
|
|
64
|
+
expected: rules.aspectRatio.toFixed(2),
|
|
65
|
+
actual: actualRatio.toFixed(2)
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
export const toFileValue = (response, keys, file) => ({
|
|
71
|
+
url: _get(response, keys.responseURL),
|
|
72
|
+
path: _get(response, keys.responsePath),
|
|
73
|
+
name: _get(response, keys.responseName) || file?.name,
|
|
74
|
+
size: Number(_get(response, keys.responseSize) || file?.size),
|
|
75
|
+
id: _get(response, keys.responseID)
|
|
76
|
+
});
|
|
77
|
+
export const toUploadFormData = (bodyKey, file) => {
|
|
78
|
+
const formData = new FormData();
|
|
79
|
+
formData.append(bodyKey, file);
|
|
80
|
+
return formData;
|
|
81
|
+
};
|
|
@@ -1,69 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
check: () => string;
|
|
6
|
-
credit_card: () => string;
|
|
7
|
-
cuid: () => string;
|
|
8
|
-
cuid2: () => string;
|
|
9
|
-
decimal: () => string;
|
|
10
|
-
digits: () => string;
|
|
11
|
-
email: () => string;
|
|
12
|
-
emoji: () => string;
|
|
13
|
-
empty: () => string;
|
|
14
|
-
ends_with: (issue: any) => string;
|
|
15
|
-
every_item: () => string;
|
|
16
|
-
excludes: (issue: any) => string;
|
|
17
|
-
finite: () => string;
|
|
18
|
-
graphemes: (issue: any) => string;
|
|
19
|
-
hash: () => string;
|
|
20
|
-
hex_color: () => string;
|
|
21
|
-
hexadecimal: () => string;
|
|
22
|
-
imei: () => string;
|
|
23
|
-
includes: (issue: any) => string;
|
|
24
|
-
integer: () => string;
|
|
25
|
-
ip: () => string;
|
|
26
|
-
ipv4: () => string;
|
|
27
|
-
ipv6: () => string;
|
|
28
|
-
iso_date: () => string;
|
|
29
|
-
iso_date_time: () => string;
|
|
30
|
-
length: (issue: any) => string;
|
|
31
|
-
mac: () => string;
|
|
32
|
-
mac_48: () => string;
|
|
33
|
-
mac_64: () => string;
|
|
34
|
-
max_bytes: (issue: any) => string;
|
|
35
|
-
max_graphemes: (issue: any) => string;
|
|
36
|
-
max_length: (issue: any) => string;
|
|
37
|
-
max_size: (issue: any) => string;
|
|
38
|
-
max_value: (issue: any) => string;
|
|
39
|
-
max_words: (issue: any) => string;
|
|
40
|
-
mime_type: (issue: any) => string;
|
|
41
|
-
min_bytes: (issue: any) => string;
|
|
42
|
-
min_graphemes: (issue: any) => string;
|
|
43
|
-
min_length: (issue: any) => string;
|
|
44
|
-
min_size: (issue: any) => string;
|
|
45
|
-
min_value: (issue: any) => string;
|
|
46
|
-
min_words: (issue: any) => string;
|
|
47
|
-
multiple_of: (issue: any) => string;
|
|
48
|
-
nanoid: () => string;
|
|
49
|
-
non_empty: () => string;
|
|
50
|
-
not_bytes: (issue: any) => string;
|
|
51
|
-
not_graphemes: (issue: any) => string;
|
|
52
|
-
not_length: (issue: any) => string;
|
|
53
|
-
not_size: (issue: any) => string;
|
|
54
|
-
not_value: (issue: any) => string;
|
|
55
|
-
not_words: (issue: any) => string;
|
|
56
|
-
octal: () => string;
|
|
57
|
-
partial_check: () => string;
|
|
58
|
-
regex: () => string;
|
|
59
|
-
safe_integer: () => string;
|
|
60
|
-
size: (issue: any) => string;
|
|
61
|
-
some_item: () => string;
|
|
62
|
-
starts_with: (issue: any) => string;
|
|
63
|
-
ulid: () => string;
|
|
64
|
-
url: () => string;
|
|
65
|
-
uuid: () => string;
|
|
66
|
-
value: () => string;
|
|
67
|
-
words: (issue: any) => string;
|
|
68
|
-
default: () => string;
|
|
1
|
+
import type { BaseIssue } from 'valibot';
|
|
2
|
+
type IssueMessage = (issue: BaseIssue<unknown>) => string;
|
|
3
|
+
export declare const valibotLanguageTH: Record<string, IssueMessage> & {
|
|
4
|
+
default: IssueMessage;
|
|
69
5
|
};
|
|
6
|
+
export {};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
const requirementOf = (issue) => {
|
|
2
|
+
const requirement = issue.requirement;
|
|
3
|
+
return requirement instanceof Date ? requirement.toISOString() : String(requirement);
|
|
4
|
+
};
|
|
1
5
|
export const valibotLanguageTH = {
|
|
2
6
|
base64: () => "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25 base64 \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
3
7
|
bic: () => "\u0E23\u0E2B\u0E31\u0E2A bic \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
4
|
-
bytes: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35\u0E02\u0E19\u0E32\u0E14 ${issue
|
|
8
|
+
bytes: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35\u0E02\u0E19\u0E32\u0E14 ${requirementOf(issue)} \u0E44\u0E1A\u0E15\u0E4C \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${issue.received}`,
|
|
5
9
|
check: () => "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E01\u0E23\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
6
10
|
credit_card: () => "\u0E2B\u0E21\u0E32\u0E22\u0E40\u0E25\u0E02\u0E1A\u0E31\u0E15\u0E23\u0E40\u0E04\u0E23\u0E14\u0E34\u0E15\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
7
11
|
cuid: () => "cuid \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
@@ -11,62 +15,62 @@ export const valibotLanguageTH = {
|
|
|
11
15
|
email: () => "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E01\u0E23\u0E2D\u0E01\u0E2D\u0E35\u0E40\u0E21\u0E25\u0E17\u0E35\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
12
16
|
emoji: () => "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E01\u0E23\u0E2D\u0E01\u0E2D\u0E35\u0E42\u0E21\u0E08\u0E34\u0E17\u0E35\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
13
17
|
empty: () => "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E2D\u0E22\u0E48\u0E32\u0E1B\u0E25\u0E48\u0E2D\u0E22\u0E27\u0E48\u0E32\u0E07",
|
|
14
|
-
ends_with: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${issue
|
|
18
|
+
ends_with: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${requirementOf(issue)}"`,
|
|
15
19
|
every_item: () => "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E1A\u0E32\u0E07\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
16
|
-
excludes: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E1B\u0E23\u0E30\u0E01\u0E2D\u0E1A\u0E14\u0E49\u0E27\u0E22 "${issue
|
|
20
|
+
excludes: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E1B\u0E23\u0E30\u0E01\u0E2D\u0E1A\u0E14\u0E49\u0E27\u0E22 "${requirementOf(issue)}"`,
|
|
17
21
|
finite: () => "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E01\u0E23\u0E2D\u0E01\u0E04\u0E48\u0E32\u0E17\u0E35\u0E48\u0E08\u0E33\u0E01\u0E31\u0E14",
|
|
18
|
-
graphemes: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 ${issue
|
|
22
|
+
graphemes: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 ${requirementOf(issue)} \u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23`,
|
|
19
23
|
hash: () => "\u0E04\u0E48\u0E32 hash \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
20
24
|
hex_color: () => "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E01\u0E23\u0E2D\u0E01\u0E2A\u0E35\u0E43\u0E19\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A hex",
|
|
21
25
|
hexadecimal: () => "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E01\u0E23\u0E2D\u0E01\u0E40\u0E25\u0E02\u0E10\u0E32\u0E19\u0E2A\u0E34\u0E1A\u0E2B\u0E01",
|
|
22
26
|
imei: () => "imei \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
23
|
-
includes: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E1B\u0E23\u0E30\u0E01\u0E2D\u0E1A\u0E14\u0E49\u0E27\u0E22 "${issue
|
|
27
|
+
includes: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E1B\u0E23\u0E30\u0E01\u0E2D\u0E1A\u0E14\u0E49\u0E27\u0E22 "${requirementOf(issue)}"`,
|
|
24
28
|
integer: () => "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E01\u0E23\u0E2D\u0E01\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E08\u0E33\u0E19\u0E27\u0E19\u0E40\u0E15\u0E47\u0E21",
|
|
25
29
|
ip: () => "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 ip \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
26
30
|
ipv4: () => "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 ipv4 \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
27
31
|
ipv6: () => "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 ipv6 \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
28
32
|
iso_date: () => "\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E43\u0E19\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A iso \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
29
33
|
iso_date_time: () => "\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E25\u0E30\u0E40\u0E27\u0E25\u0E32\u0E43\u0E19\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A iso \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
30
|
-
length: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35\u0E04\u0E27\u0E32\u0E21\u0E22\u0E32\u0E27 ${issue
|
|
34
|
+
length: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35\u0E04\u0E27\u0E32\u0E21\u0E22\u0E32\u0E27 ${requirementOf(issue)} \u0E15\u0E31\u0E27`,
|
|
31
35
|
mac: () => "\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 mac \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
32
36
|
mac_48: () => "mac 48-bit \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
33
37
|
mac_64: () => "mac 64-bit \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
34
|
-
max_bytes: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 ${issue
|
|
35
|
-
max_graphemes: (issue) => `\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 ${issue
|
|
36
|
-
max_length: (issue) => `\u0E04\u0E27\u0E32\u0E21\u0E22\u0E32\u0E27\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 ${issue
|
|
37
|
-
max_size: (issue) => `\u0E02\u0E19\u0E32\u0E14\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 ${issue
|
|
38
|
-
max_value: (issue) => `\u0E04\u0E48\u0E32\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 ${issue
|
|
39
|
-
max_words: (issue) => `\u0E08\u0E33\u0E19\u0E27\u0E19\u0E04\u0E33\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 ${issue
|
|
40
|
-
mime_type: (
|
|
41
|
-
min_bytes: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22 ${issue
|
|
42
|
-
min_graphemes: (issue) => `\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22 ${issue
|
|
43
|
-
min_length: (issue) => `\u0E04\u0E27\u0E32\u0E21\u0E22\u0E32\u0E27\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22 ${issue
|
|
44
|
-
min_size: (issue) => `\u0E02\u0E19\u0E32\u0E14\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32 ${issue
|
|
38
|
+
max_bytes: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 ${requirementOf(issue)} \u0E44\u0E1A\u0E15\u0E4C`,
|
|
39
|
+
max_graphemes: (issue) => `\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 ${requirementOf(issue)} \u0E15\u0E31\u0E27`,
|
|
40
|
+
max_length: (issue) => `\u0E04\u0E27\u0E32\u0E21\u0E22\u0E32\u0E27\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 ${requirementOf(issue)} \u0E15\u0E31\u0E27`,
|
|
41
|
+
max_size: (issue) => `\u0E02\u0E19\u0E32\u0E14\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 ${requirementOf(issue)}`,
|
|
42
|
+
max_value: (issue) => `\u0E04\u0E48\u0E32\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 ${requirementOf(issue)}`,
|
|
43
|
+
max_words: (issue) => `\u0E08\u0E33\u0E19\u0E27\u0E19\u0E04\u0E33\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 ${requirementOf(issue)} \u0E04\u0E33`,
|
|
44
|
+
mime_type: () => "mime type \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
45
|
+
min_bytes: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22 ${requirementOf(issue)} \u0E44\u0E1A\u0E15\u0E4C`,
|
|
46
|
+
min_graphemes: (issue) => `\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22 ${requirementOf(issue)} \u0E15\u0E31\u0E27`,
|
|
47
|
+
min_length: (issue) => `\u0E04\u0E27\u0E32\u0E21\u0E22\u0E32\u0E27\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22 ${requirementOf(issue)} \u0E15\u0E31\u0E27`,
|
|
48
|
+
min_size: (issue) => `\u0E02\u0E19\u0E32\u0E14\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32 ${requirementOf(issue)}`,
|
|
45
49
|
min_value: (issue) => {
|
|
46
|
-
return `\u0E04\u0E48\u0E32\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22 ${issue
|
|
50
|
+
return `\u0E04\u0E48\u0E32\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22 ${requirementOf(issue)}`;
|
|
47
51
|
},
|
|
48
|
-
min_words: (issue) => `\u0E08\u0E33\u0E19\u0E27\u0E19\u0E04\u0E33\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22 ${issue
|
|
49
|
-
multiple_of: (issue) => `\u0E04\u0E48\u0E32\u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E40\u0E17\u0E48\u0E32\u0E02\u0E2D\u0E07 ${issue
|
|
52
|
+
min_words: (issue) => `\u0E08\u0E33\u0E19\u0E27\u0E19\u0E04\u0E33\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22 ${requirementOf(issue)} \u0E04\u0E33`,
|
|
53
|
+
multiple_of: (issue) => `\u0E04\u0E48\u0E32\u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E40\u0E17\u0E48\u0E32\u0E02\u0E2D\u0E07 ${requirementOf(issue)}`,
|
|
50
54
|
nanoid: () => "nano id \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
51
55
|
non_empty: () => "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E01\u0E23\u0E2D\u0E01\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",
|
|
52
|
-
not_bytes: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48 ${issue
|
|
53
|
-
not_graphemes: (issue) => `\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A ${issue
|
|
54
|
-
not_length: (issue) => `\u0E04\u0E27\u0E32\u0E21\u0E22\u0E32\u0E27\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A ${issue
|
|
55
|
-
not_size: (issue) => `\u0E02\u0E19\u0E32\u0E14\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A ${issue
|
|
56
|
-
not_value: (issue) => `\u0E04\u0E48\u0E32\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A ${issue
|
|
57
|
-
not_words: (issue) => `\u0E08\u0E33\u0E19\u0E27\u0E19\u0E04\u0E33\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A ${issue
|
|
56
|
+
not_bytes: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48 ${requirementOf(issue)} \u0E44\u0E1A\u0E15\u0E4C`,
|
|
57
|
+
not_graphemes: (issue) => `\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A ${requirementOf(issue)}`,
|
|
58
|
+
not_length: (issue) => `\u0E04\u0E27\u0E32\u0E21\u0E22\u0E32\u0E27\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A ${requirementOf(issue)}`,
|
|
59
|
+
not_size: (issue) => `\u0E02\u0E19\u0E32\u0E14\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A ${requirementOf(issue)}`,
|
|
60
|
+
not_value: (issue) => `\u0E04\u0E48\u0E32\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A ${requirementOf(issue)}`,
|
|
61
|
+
not_words: (issue) => `\u0E08\u0E33\u0E19\u0E27\u0E19\u0E04\u0E33\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A ${requirementOf(issue)} \u0E04\u0E33`,
|
|
58
62
|
octal: () => "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E01\u0E23\u0E2D\u0E01\u0E40\u0E25\u0E02\u0E10\u0E32\u0E19\u0E41\u0E1B\u0E14",
|
|
59
63
|
partial_check: () => "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E1A\u0E32\u0E07\u0E2A\u0E48\u0E27\u0E19\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
60
64
|
regex: () => "\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
61
65
|
safe_integer: () => "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E01\u0E23\u0E2D\u0E01\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E08\u0E33\u0E19\u0E27\u0E19\u0E40\u0E15\u0E47\u0E21\u0E17\u0E35\u0E48\u0E1B\u0E25\u0E2D\u0E14\u0E20\u0E31\u0E22",
|
|
62
|
-
size: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35\u0E02\u0E19\u0E32\u0E14 ${issue
|
|
66
|
+
size: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35\u0E02\u0E19\u0E32\u0E14 ${requirementOf(issue)}`,
|
|
63
67
|
some_item: () => "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E1A\u0E32\u0E07\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
64
|
-
starts_with: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${issue
|
|
68
|
+
starts_with: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${requirementOf(issue)}"`,
|
|
65
69
|
ulid: () => "ulid \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
66
70
|
url: () => "url \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
67
71
|
uuid: () => "uuid \u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
68
72
|
value: () => "\u0E04\u0E48\u0E32\u0E17\u0E35\u0E48\u0E01\u0E23\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
69
|
-
words: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35\u0E04\u0E33 ${issue
|
|
73
|
+
words: (issue) => `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35\u0E04\u0E33 ${requirementOf(issue)} \u0E04\u0E33`,
|
|
70
74
|
default: () => "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E01\u0E23\u0E2D\u0E01\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25"
|
|
71
75
|
// Fallback message
|
|
72
76
|
};
|