sprintify-ui 0.0.42 → 0.0.44
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/sprintify-ui.es.js +2309 -2299
- package/dist/types/src/components/BaseFieldI18n.vue.d.ts +5 -2
- package/dist/types/src/composables/field.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/BaseFieldI18n.vue +1 -1
- package/src/components/BaseMediaLibrary.vue +13 -3
- package/src/composables/field.ts +10 -0
|
@@ -2,7 +2,7 @@ import { Locales } from '@/types';
|
|
|
2
2
|
import { PropType } from 'vue';
|
|
3
3
|
declare const _default: import("vue").DefineComponent<{
|
|
4
4
|
modelValue: {
|
|
5
|
-
|
|
5
|
+
default: undefined;
|
|
6
6
|
type: PropType<{
|
|
7
7
|
[locale: string]: string | number | boolean;
|
|
8
8
|
} | null | undefined>;
|
|
@@ -41,7 +41,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
41
41
|
};
|
|
42
42
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
43
43
|
modelValue: {
|
|
44
|
-
|
|
44
|
+
default: undefined;
|
|
45
45
|
type: PropType<{
|
|
46
46
|
[locale: string]: string | number | boolean;
|
|
47
47
|
} | null | undefined>;
|
|
@@ -84,6 +84,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
84
84
|
required: boolean;
|
|
85
85
|
name: string;
|
|
86
86
|
label: string;
|
|
87
|
+
modelValue: {
|
|
88
|
+
[locale: string]: string | number | boolean;
|
|
89
|
+
} | null | undefined;
|
|
87
90
|
hasError: boolean;
|
|
88
91
|
component: "BaseInput" | "BaseTextarea";
|
|
89
92
|
defaultValue: string | number | boolean;
|
|
@@ -13,5 +13,7 @@ export declare function useField(config: Config): {
|
|
|
13
13
|
hasErrorInternal: import("vue").ComputedRef<boolean>;
|
|
14
14
|
errorMessageInternal: import("vue").ComputedRef<string | null | undefined>;
|
|
15
15
|
emitUpdate: (value: any) => void;
|
|
16
|
+
enableForm: () => void;
|
|
17
|
+
disableForm: () => void;
|
|
16
18
|
};
|
|
17
19
|
export {};
|
package/package.json
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
:accept="accept"
|
|
9
9
|
:accepted-extensions="acceptedExtensions"
|
|
10
10
|
:url="uploadUrl"
|
|
11
|
-
@upload:start="
|
|
12
|
-
@upload:end="
|
|
11
|
+
@upload:start="onUploadStart"
|
|
12
|
+
@upload:end="onUploadEnd"
|
|
13
13
|
@upload:fail="$emit('upload:fail', $event)"
|
|
14
14
|
@upload:success="onUploadSuccess"
|
|
15
15
|
>
|
|
@@ -162,7 +162,7 @@ const emit = defineEmits([
|
|
|
162
162
|
'upload:end',
|
|
163
163
|
]);
|
|
164
164
|
|
|
165
|
-
const { emitUpdate } = useField({
|
|
165
|
+
const { emitUpdate, enableForm, disableForm } = useField({
|
|
166
166
|
name: computed(() => props.name),
|
|
167
167
|
required: computed(() => false),
|
|
168
168
|
hasError: computed(() => props.hasError),
|
|
@@ -285,4 +285,14 @@ const maxFileSize = computed(() => {
|
|
|
285
285
|
i18n.t('sui.up_to_x', { x: fileSizeFormat(props.maxSize) })
|
|
286
286
|
);
|
|
287
287
|
});
|
|
288
|
+
|
|
289
|
+
function onUploadStart(event: any) {
|
|
290
|
+
emit('upload:start', event);
|
|
291
|
+
disableForm();
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
function onUploadEnd(event: any) {
|
|
295
|
+
emit('upload:end', event);
|
|
296
|
+
enableForm();
|
|
297
|
+
}
|
|
288
298
|
</script>
|
package/src/composables/field.ts
CHANGED
|
@@ -58,6 +58,14 @@ export function useField(config: Config) {
|
|
|
58
58
|
setLabelClass(labelClass);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
const disableForm = inject('form:disable', () => {
|
|
62
|
+
return;
|
|
63
|
+
}) as () => void;
|
|
64
|
+
|
|
65
|
+
const enableForm = inject('form:enable', () => {
|
|
66
|
+
return;
|
|
67
|
+
}) as () => void;
|
|
68
|
+
|
|
61
69
|
const requiredInternal = computed((): boolean => {
|
|
62
70
|
if (required.value) {
|
|
63
71
|
return required.value;
|
|
@@ -96,5 +104,7 @@ export function useField(config: Config) {
|
|
|
96
104
|
hasErrorInternal,
|
|
97
105
|
errorMessageInternal,
|
|
98
106
|
emitUpdate,
|
|
107
|
+
enableForm,
|
|
108
|
+
disableForm,
|
|
99
109
|
};
|
|
100
110
|
}
|