nuxt-outfit 1.6.0 → 1.6.2

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,5 +1,5 @@
1
1
  {
2
2
  "name": "@nuxt/outfit",
3
3
  "configKey": "outfit",
4
- "version": "1.6.0"
4
+ "version": "1.6.2"
5
5
  }
@@ -0,0 +1,4 @@
1
+ export declare const useFile: () => {
2
+ createArrayBufferFromBase64: (base64: any) => ArrayBufferLike;
3
+ createFileFromBase64: (base64: any, name: any, type: any) => File;
4
+ };
@@ -0,0 +1,18 @@
1
+ export const useFile = () => {
2
+ const createArrayBufferFromBase64 = (base64) => {
3
+ const binaryString = atob(base64);
4
+ const len = binaryString.length;
5
+ const bytes = new Uint8Array(len);
6
+ for (let i = 0; i < len; i++) {
7
+ bytes[i] = binaryString.charCodeAt(i);
8
+ }
9
+ return bytes.buffer;
10
+ };
11
+ const createFileFromBase64 = (base64, name, type) => {
12
+ return new File([new Blob([createArrayBufferFromBase64(base64)])], name);
13
+ };
14
+ return {
15
+ createArrayBufferFromBase64,
16
+ createFileFromBase64
17
+ };
18
+ };
@@ -6,7 +6,7 @@ export declare const useForm: (opts?: {}) => {
6
6
  isPending: import("vue").Ref<boolean>;
7
7
  handleSubmit: (event: null | undefined, params: any) => Promise<void>;
8
8
  clearError: (field: any) => void;
9
- reset: () => void;
9
+ reset: (values?: null) => void;
10
10
  onSuccess: (callback: any) => void;
11
11
  onFail: (callback: any) => void;
12
12
  schema: any;
@@ -24,8 +24,8 @@ export const useForm = (opts = {}) => {
24
24
  const processed = () => {
25
25
  isPending.value = false;
26
26
  };
27
- const reset = () => {
28
- Object.assign(fields, opts?.initialValues);
27
+ const reset = (values = null) => {
28
+ Object.assign(fields, values ?? opts?.initialValues);
29
29
  };
30
30
  const repeatArray = (property) => {
31
31
  if (Array.isArray(fields[property])) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-outfit",
3
- "version": "1.6.0",
3
+ "version": "1.6.2",
4
4
  "description": "Outfit - Connection Laravel and Nuxt",
5
5
  "repository": {
6
6
  "type": "git",