From c0e404eafbb8cbda2d42d57ed3a2f1f3b78a2b0b Mon Sep 17 00:00:00 2001 From: Pari Work Temp Date: Tue, 14 Jan 2025 13:20:48 -0500 Subject: [PATCH] remove rn--uuid as it is causing us issues --- dist/index.js | 7 ++----- dist/index.mjs | 7 ++----- package.json | 3 +-- pnpm-lock.yaml | 9 --------- src/forms.ts | 5 ++--- 5 files changed, 7 insertions(+), 24 deletions(-) diff --git a/dist/index.js b/dist/index.js index 758e5a9..c34e60e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -57,9 +57,6 @@ __export(index_exports, { }); module.exports = __toCommonJS(index_exports); -// src/forms.ts -var import_react_native_uuid = __toESM(require("react-native-uuid")); - // src/utils.ts function notNullOrUndefined(value) { return value !== null && typeof value !== "undefined"; @@ -130,12 +127,12 @@ var FormField = class _FormField { label = "" } = {}) { this.value = Array.isArray(value) ? [...value] : value !== null && typeof value == "object" ? { ...value } : value === void 0 ? "" : value; - this.name = name ? name : import_react_native_uuid.default.v4(); + this.name = name ? name : String(Date.now()); this.errors = errors; this.validators = validators; this.placeholder = placeholder; this.type = type; - this.id = id ? id : name ? name : "field-" + import_react_native_uuid.default.v4(); + this.id = id ? id : name ? name : "field-" + String(Date.now()); this._isTouched = isTouched; this.label = label; } diff --git a/dist/index.mjs b/dist/index.mjs index 8258155..c80a9c2 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -1,6 +1,3 @@ -// src/forms.ts -import uuid from "react-native-uuid"; - // src/utils.ts function notNullOrUndefined(value) { return value !== null && typeof value !== "undefined"; @@ -71,12 +68,12 @@ var FormField = class _FormField { label = "" } = {}) { this.value = Array.isArray(value) ? [...value] : value !== null && typeof value == "object" ? { ...value } : value === void 0 ? "" : value; - this.name = name ? name : uuid.v4(); + this.name = name ? name : String(Date.now()); this.errors = errors; this.validators = validators; this.placeholder = placeholder; this.type = type; - this.id = id ? id : name ? name : "field-" + uuid.v4(); + this.id = id ? id : name ? name : "field-" + String(Date.now()); this._isTouched = isTouched; this.label = label; } diff --git a/package.json b/package.json index 71d72d8..2f0b6de 100644 --- a/package.json +++ b/package.json @@ -34,8 +34,7 @@ "email-validator": "^2.0.4", "install": "^0.13.0", "libphonenumber-js": "^1.11.11", - "luxon": "^2.4.0", - "react-native-uuid": "^2.0.1" + "luxon": "^2.4.0" }, "devDependencies": { "@types/luxon": "^3.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b0e61a2..0825f61 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -26,9 +26,6 @@ importers: luxon: specifier: ^2.4.0 version: 2.5.2 - react-native-uuid: - specifier: ^2.0.1 - version: 2.0.1 devDependencies: '@babel/cli': specifier: ^7.8.4 @@ -2383,10 +2380,6 @@ packages: react-is@18.2.0: resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} - react-native-uuid@2.0.1: - resolution: {integrity: sha512-cptnoIbL53GTCrWlb/+jrDC6tvb7ypIyzbXNJcpR3Vab0mkeaaVd5qnB3f0whXYzS+SMoSQLcUUB0gEWqkPC0g==} - engines: {node: '>=10.0.0', npm: '>=6.0.0'} - read-yaml-file@1.1.0: resolution: {integrity: sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA==} engines: {node: '>=6'} @@ -5295,8 +5288,6 @@ snapshots: react-is@18.2.0: {} - react-native-uuid@2.0.1: {} - read-yaml-file@1.1.0: dependencies: graceful-fs: 4.2.10 diff --git a/src/forms.ts b/src/forms.ts index c01ab29..367da66 100644 --- a/src/forms.ts +++ b/src/forms.ts @@ -17,7 +17,6 @@ import { TFormInstanceFields, } from './interfaces' -import uuid from 'react-native-uuid' import { isFormArray, isFormField } from './utils' function setFormFieldValueFromKwargs( @@ -79,12 +78,12 @@ export class FormField implements IFormFi ? '' : value ) as T - this.name = (name ? name : (uuid.v4() as string)) as TName + this.name = (name ? name : (String(Date.now()))) as TName this.errors = errors this.validators = validators this.placeholder = placeholder this.type = type - this.id = id ? id : name ? name : 'field' + '-' + uuid.v4() + this.id = id ? id : name ? name : 'field' + '-' + String(Date.now()) this._isTouched = isTouched this.label = label }