@finema/core 2.13.0 → 2.14.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/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "2.13.0",
3
+ "version": "2.14.0",
4
4
  "configKey": "core",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.1",
package/dist/module.mjs CHANGED
@@ -3,7 +3,7 @@ import defu from 'defu';
3
3
  import * as theme from '../dist/runtime/theme/index.js';
4
4
 
5
5
  const name = "@finema/core";
6
- const version = "2.13.0";
6
+ const version = "2.14.0";
7
7
 
8
8
  const nuxtAppOptions = {
9
9
  head: {
@@ -57,7 +57,7 @@ import LoadingState from "./LoadingState.vue";
57
57
  import SuccessState from "./SuccessState.vue";
58
58
  import FailedState from "./FailedState.vue";
59
59
  import { useUploadState } from "./useUploadState";
60
- import { computed, useTemplateRef } from "#imports";
60
+ import { computed, useTemplateRef, useWatchChange } from "#imports";
61
61
  import FieldWrapper from "#core/components/Form/FieldWrapper.vue";
62
62
  import { useFieldHOC } from "#core/composables/useForm";
63
63
  import { uploadFileDropzoneTheme } from "#core/theme/uploadFileDropzone";
@@ -114,6 +114,13 @@ const uploadState = useUploadState(
114
114
  wrapperProps,
115
115
  dropzoneRef
116
116
  );
117
+ useWatchChange(() => value.value, (newValue) => {
118
+ if (typeof newValue === "object" && newValue !== null) {
119
+ onChange(newValue);
120
+ } else {
121
+ onChange(void 0);
122
+ }
123
+ });
117
124
  const theme = computed(
118
125
  () => useUiConfig(uploadFileDropzoneTheme, "uploadFileDropzone")({
119
126
  dragover: uploadState.dropzone.isOverDropZone.value && uploadState.isEmpty.value,
@@ -54,14 +54,16 @@ export const useUploadState = (props, emits, onChange, setErrors, value, accepte
54
54
  return false;
55
55
  }
56
56
  }
57
- const maxSizeBytes = (fileAllocate.acceptFileSizeKb.value || 0) * 1024;
58
- if (file.size > maxSizeBytes) {
59
- if (fileAllocate.isAcceptFileUseMb.value) {
60
- setErrors(`\u0E02\u0E19\u0E32\u0E14\u0E44\u0E1F\u0E25\u0E4C\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 ${fileAllocate.acceptFileSizeMb.value} MB`);
61
- } else {
62
- setErrors(`\u0E02\u0E19\u0E32\u0E14\u0E44\u0E1F\u0E25\u0E4C\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 ${fileAllocate.acceptFileSizeKb.value} KB`);
57
+ if (props.maxSize) {
58
+ const maxSizeBytes = (fileAllocate.acceptFileSizeKb.value || 0) * 1024;
59
+ if (file.size > maxSizeBytes) {
60
+ if (fileAllocate.isAcceptFileUseMb.value) {
61
+ setErrors(`\u0E02\u0E19\u0E32\u0E14\u0E44\u0E1F\u0E25\u0E4C\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 ${fileAllocate.acceptFileSizeMb.value} MB`);
62
+ } else {
63
+ setErrors(`\u0E02\u0E19\u0E32\u0E14\u0E44\u0E1F\u0E25\u0E4C\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 ${fileAllocate.acceptFileSizeKb.value} KB`);
64
+ }
65
+ return false;
63
66
  }
64
- return false;
65
67
  }
66
68
  setErrors("");
67
69
  return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "2.13.0",
3
+ "version": "2.14.0",
4
4
  "repository": "https://gitlab.finema.co/finema/ui-kit",
5
5
  "license": "MIT",
6
6
  "author": "Finema Dev Core Team",