@levo-so/react 0.1.36 → 0.1.40
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/{Sonner-t6JVKA0a.js → Sonner-5IAqCkBs.js} +12 -9
- package/dist/Tooltip-DcdGb876.js +383 -0
- package/dist/audience/components/block.d.ts.map +1 -1
- package/dist/audience/components/component.d.ts +2 -2
- package/dist/audience/components/component.d.ts.map +1 -1
- package/dist/audience/components/page.d.ts.map +1 -1
- package/dist/audience/hooks/useBounce.d.ts +4 -0
- package/dist/audience/hooks/useBounce.d.ts.map +1 -0
- package/dist/audience/hooks/useCurrentTab.d.ts.map +1 -1
- package/dist/audience/hooks/useDownloadSpeed.d.ts.map +1 -1
- package/dist/audience/hooks/useIdentifyAudience.d.ts +7 -0
- package/dist/audience/hooks/useIdentifyAudience.d.ts.map +1 -0
- package/dist/audience/hooks/useOpenTabs.d.ts.map +1 -1
- package/dist/audience/hooks/usePerformanceMetrics.d.ts.map +1 -1
- package/dist/audience/index.js +1 -1
- package/dist/audience/utils/autocapture.d.ts.map +1 -1
- package/dist/components/Sonner.d.ts.map +1 -1
- package/dist/components/Spinner.d.ts.map +1 -1
- package/dist/components/button/buttonVariants.d.ts +1 -1
- package/dist/components/button/buttonVariants.d.ts.map +1 -1
- package/dist/components/index.js +20 -21
- package/dist/index.css +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +121 -83
- package/dist/isEmptyObject-B9yh0nbg.js +19 -0
- package/dist/{jsx-runtime-B6kdoens.js → jsx-runtime-D0AQ1Mn7.js} +216 -217
- package/dist/membership/index.d.ts +1 -1
- package/dist/membership/index.d.ts.map +1 -1
- package/dist/membership/index.js +1 -1
- package/dist/page-DweUjn1K.js +627 -0
- package/dist/providers/index.js +1 -1
- package/dist/utils/byteToSize.d.ts.map +1 -1
- package/dist/utils/cn.d.ts.map +1 -1
- package/dist/utils/errorHandler.d.ts.map +1 -1
- package/dist/utils/index.js +10 -12
- package/dist/utils/isDateObject.d.ts.map +1 -1
- package/dist/utils/isEmptyObject.d.ts.map +1 -1
- package/dist/utils/isNullOrUndefined.d.ts.map +1 -1
- package/dist/utils/isObject.d.ts.map +1 -1
- package/package.json +7 -12
- package/dist/Checbox-sq-atGlJ.js +0 -28
- package/dist/CheckboxWidget-3qTjxIlp.js +0 -124
- package/dist/CollectionFormBuilder-CUzpwIva.js +0 -1195
- package/dist/CurrencyWidget-DgH4uCpg.js +0 -60
- package/dist/DateTimeWidget-C2hLHKU6.js +0 -80
- package/dist/DefaultFormVariant-Cm9i2BBn.js +0 -81
- package/dist/DropdownWidget-B6mRXcTa.js +0 -115
- package/dist/EmailWidget-CBFnvo9z.js +0 -41
- package/dist/FormCaptcha-btA0HfMx.js +0 -187
- package/dist/GeocoderWidget-DZGXm9Ji.js +0 -68
- package/dist/Input-Vv7mKQFt.js +0 -54
- package/dist/MultiGeocoderWidget-D7ogTcWu.js +0 -49
- package/dist/MultiTextWidget-DYxi8PHm.js +0 -33
- package/dist/PhoneWidget-BxaGCfLs.js +0 -48
- package/dist/RadioWidget-Bkq1Oudi.js +0 -109
- package/dist/RichTextWidget-Caqhw4GK.js +0 -310
- package/dist/Spinner-BcBoT-J5.js +0 -410
- package/dist/StepsFormVariant-D-m93LMv.js +0 -140
- package/dist/SwitchWidget-BpAzgVui.js +0 -53
- package/dist/TextWidget-CHkFlxmT.js +0 -33
- package/dist/TextareaWidget-B0htlijX.js +0 -30
- package/dist/ToggleCheckboxWidget-DLrS6ax4.js +0 -44
- package/dist/Tooltip-DoWyn3Ho.js +0 -37
- package/dist/URLWidget-CnWKNlOF.js +0 -14
- package/dist/UploadWidget-DSvWOBuR.js +0 -656
- package/dist/byteToSize-BFKZSBu1.js +0 -8
- package/dist/cn-C9QoOYNG.js +0 -6
- package/dist/collection/components/Altcha.d.ts +0 -10
- package/dist/collection/components/Altcha.d.ts.map +0 -1
- package/dist/collection/components/CollectionFormBuilder.d.ts +0 -12
- package/dist/collection/components/CollectionFormBuilder.d.ts.map +0 -1
- package/dist/collection/components/FieldRenderer.d.ts +0 -9
- package/dist/collection/components/FieldRenderer.d.ts.map +0 -1
- package/dist/collection/components/FormCaptcha.d.ts +0 -3
- package/dist/collection/components/FormCaptcha.d.ts.map +0 -1
- package/dist/collection/components/core/AsyncSelectPaginate/AsyncSelectPaginate.d.ts +0 -5
- package/dist/collection/components/core/AsyncSelectPaginate/AsyncSelectPaginate.d.ts.map +0 -1
- package/dist/collection/components/core/Checkbox/Checbox.d.ts +0 -5
- package/dist/collection/components/core/Checkbox/Checbox.d.ts.map +0 -1
- package/dist/collection/components/core/Input/Input.d.ts +0 -11
- package/dist/collection/components/core/Input/Input.d.ts.map +0 -1
- package/dist/collection/components/core/Switch/Switch.d.ts +0 -5
- package/dist/collection/components/core/Switch/Switch.d.ts.map +0 -1
- package/dist/collection/components/renderer/RenderArrayWidget.d.ts +0 -5
- package/dist/collection/components/renderer/RenderArrayWidget.d.ts.map +0 -1
- package/dist/collection/components/renderer/RenderCommonField.d.ts +0 -5
- package/dist/collection/components/renderer/RenderCommonField.d.ts.map +0 -1
- package/dist/collection/components/renderer/RenderRecordWidget.d.ts +0 -4
- package/dist/collection/components/renderer/RenderRecordWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/ErrorMessage.d.ts +0 -6
- package/dist/collection/components/widgets/ErrorMessage.d.ts.map +0 -1
- package/dist/collection/components/widgets/FieldWrapper.d.ts +0 -14
- package/dist/collection/components/widgets/FieldWrapper.d.ts.map +0 -1
- package/dist/collection/components/widgets/FormHelperText.d.ts +0 -6
- package/dist/collection/components/widgets/FormHelperText.d.ts.map +0 -1
- package/dist/collection/components/widgets/FormLabel.d.ts +0 -8
- package/dist/collection/components/widgets/FormLabel.d.ts.map +0 -1
- package/dist/collection/components/widgets/checkboxWidget/CheckboxWidget.d.ts +0 -8
- package/dist/collection/components/widgets/checkboxWidget/CheckboxWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/collectionWidget/CollectionWidgetM2M.d.ts +0 -7
- package/dist/collection/components/widgets/collectionWidget/CollectionWidgetM2M.d.ts.map +0 -1
- package/dist/collection/components/widgets/collectionWidget/CollectionWidgetM2O.d.ts +0 -7
- package/dist/collection/components/widgets/collectionWidget/CollectionWidgetM2O.d.ts.map +0 -1
- package/dist/collection/components/widgets/collectionWidget/SelectedCollectionItems.d.ts +0 -8
- package/dist/collection/components/widgets/collectionWidget/SelectedCollectionItems.d.ts.map +0 -1
- package/dist/collection/components/widgets/currencyWidget/CurrencyWidget.d.ts +0 -9
- package/dist/collection/components/widgets/currencyWidget/CurrencyWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/dateTimeWidget/DateTimeWidget.d.ts +0 -8
- package/dist/collection/components/widgets/dateTimeWidget/DateTimeWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/dropdownWidget/DropdownWidget.d.ts +0 -9
- package/dist/collection/components/widgets/dropdownWidget/DropdownWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/emailWidget/EmailWidget.d.ts +0 -8
- package/dist/collection/components/widgets/emailWidget/EmailWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/geocoderWidget/GeocoderWidget.d.ts +0 -8
- package/dist/collection/components/widgets/geocoderWidget/GeocoderWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/multiGeocoderWidget/MultiGeocoderWidget.d.ts +0 -8
- package/dist/collection/components/widgets/multiGeocoderWidget/MultiGeocoderWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/multiTextWidget/MultiTextWidget.d.ts +0 -7
- package/dist/collection/components/widgets/multiTextWidget/MultiTextWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/phoneWidget/PhoneWidget.d.ts +0 -8
- package/dist/collection/components/widgets/phoneWidget/PhoneWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/radioWidget/RadioWidget.d.ts +0 -11
- package/dist/collection/components/widgets/radioWidget/RadioWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/richTextWidget/RichTextWidget.d.ts +0 -12
- package/dist/collection/components/widgets/richTextWidget/RichTextWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/switchWidget/SwitchWidget.d.ts +0 -8
- package/dist/collection/components/widgets/switchWidget/SwitchWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/textWidget/TextWidget.d.ts +0 -9
- package/dist/collection/components/widgets/textWidget/TextWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/textareaWidget/TextareaWidget.d.ts +0 -8
- package/dist/collection/components/widgets/textareaWidget/TextareaWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/toggleCheckboxWidget/ToggleCheckboxWidget.d.ts +0 -8
- package/dist/collection/components/widgets/toggleCheckboxWidget/ToggleCheckboxWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/uploadWidget/CommonPreview.d.ts +0 -11
- package/dist/collection/components/widgets/uploadWidget/CommonPreview.d.ts.map +0 -1
- package/dist/collection/components/widgets/uploadWidget/ExternalURL.d.ts +0 -11
- package/dist/collection/components/widgets/uploadWidget/ExternalURL.d.ts.map +0 -1
- package/dist/collection/components/widgets/uploadWidget/FileUploadDropBox.d.ts +0 -10
- package/dist/collection/components/widgets/uploadWidget/FileUploadDropBox.d.ts.map +0 -1
- package/dist/collection/components/widgets/uploadWidget/FileUploadModal.d.ts +0 -13
- package/dist/collection/components/widgets/uploadWidget/FileUploadModal.d.ts.map +0 -1
- package/dist/collection/components/widgets/uploadWidget/ImportFromAssets.d.ts +0 -11
- package/dist/collection/components/widgets/uploadWidget/ImportFromAssets.d.ts.map +0 -1
- package/dist/collection/components/widgets/uploadWidget/UploadWidget.d.ts +0 -19
- package/dist/collection/components/widgets/uploadWidget/UploadWidget.d.ts.map +0 -1
- package/dist/collection/components/widgets/urlWidget/URLWidget.d.ts +0 -5
- package/dist/collection/components/widgets/urlWidget/URLWidget.d.ts.map +0 -1
- package/dist/collection/index.d.ts +0 -5
- package/dist/collection/index.d.ts.map +0 -1
- package/dist/collection/index.js +0 -20
- package/dist/collection/lib/FormBuilder.d.ts +0 -8
- package/dist/collection/lib/FormBuilder.d.ts.map +0 -1
- package/dist/collection/lib/SaveDraftValues.d.ts +0 -7
- package/dist/collection/lib/SaveDraftValues.d.ts.map +0 -1
- package/dist/collection/lib/hooks/useLevoForm.d.ts +0 -18
- package/dist/collection/lib/hooks/useLevoForm.d.ts.map +0 -1
- package/dist/collection/lib/provider/LevoFormProvider.d.ts +0 -9
- package/dist/collection/lib/provider/LevoFormProvider.d.ts.map +0 -1
- package/dist/collection/lib/variants/DefaultFormVariant.d.ts +0 -3
- package/dist/collection/lib/variants/DefaultFormVariant.d.ts.map +0 -1
- package/dist/collection/lib/variants/StepsFormVariant.d.ts +0 -4
- package/dist/collection/lib/variants/StepsFormVariant.d.ts.map +0 -1
- package/dist/collection/types/context.d.ts +0 -34
- package/dist/collection/types/context.d.ts.map +0 -1
- package/dist/collection/types/errors.d.ts +0 -7
- package/dist/collection/types/errors.d.ts.map +0 -1
- package/dist/collection/types/formVariant.d.ts +0 -18
- package/dist/collection/types/formVariant.d.ts.map +0 -1
- package/dist/collection/types/forms.d.ts +0 -31
- package/dist/collection/types/forms.d.ts.map +0 -1
- package/dist/collection/types/index.d.ts +0 -4
- package/dist/collection/types/index.d.ts.map +0 -1
- package/dist/collection/types/renderer.d.ts +0 -6
- package/dist/collection/types/renderer.d.ts.map +0 -1
- package/dist/collection/utils/formHelpers.d.ts +0 -48
- package/dist/collection/utils/formHelpers.d.ts.map +0 -1
- package/dist/collection/utils/getFieldValidations.d.ts +0 -6
- package/dist/collection/utils/getFieldValidations.d.ts.map +0 -1
- package/dist/collection/utils/index.d.ts +0 -6
- package/dist/collection/utils/index.d.ts.map +0 -1
- package/dist/collection/utils/schema.d.ts +0 -3
- package/dist/collection/utils/schema.d.ts.map +0 -1
- package/dist/collection/utils/setFormErrors.d.ts +0 -4
- package/dist/collection/utils/setFormErrors.d.ts.map +0 -1
- package/dist/collection/utils/storage.d.ts +0 -11
- package/dist/collection/utils/storage.d.ts.map +0 -1
- package/dist/errorHandler-_34Yv8wA.js +0 -9
- package/dist/isEmptyObject-C5s4GzLE.js +0 -8
- package/dist/libs.css +0 -1
- package/dist/libs.d.ts +0 -1
- package/dist/page-C1-z2EsC.js +0 -574
package/dist/utils/index.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { b as
|
|
2
|
-
import {
|
|
3
|
-
import { c as i } from "../cn-C9QoOYNG.js";
|
|
4
|
-
import { i as c, a as p, b as f, d as m, c as O } from "../isEmptyObject-C5s4GzLE.js";
|
|
1
|
+
import { b as a, e as r, i as t, a as i, c, f as b, d as o } from "../isEmptyObject-B9yh0nbg.js";
|
|
2
|
+
import { c as d } from "../Sonner-5IAqCkBs.js";
|
|
5
3
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
a as byteToSize,
|
|
5
|
+
d as cn,
|
|
6
|
+
r as errorHandler,
|
|
7
|
+
t as isDateObject,
|
|
8
|
+
i as isEmptyObject,
|
|
9
|
+
c as isNullOrUndefined,
|
|
10
|
+
b as isObject,
|
|
11
|
+
o as isObjectType
|
|
14
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isDateObject.d.ts","sourceRoot":"","sources":["../../src/utils/isDateObject.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"isDateObject.d.ts","sourceRoot":"","sources":["../../src/utils/isDateObject.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,IAChC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isEmptyObject.d.ts","sourceRoot":"","sources":["../../src/utils/isEmptyObject.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,WAAW,GAAG;KAAG,CAAC,IAAI,MAAM,GAAG,MAAM,GAAG,KAAK;CAAE,CAAC;AAE5D,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"isEmptyObject.d.ts","sourceRoot":"","sources":["../../src/utils/isEmptyObject.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,WAAW,GAAG;KAAG,CAAC,IAAI,MAAM,GAAG,MAAM,GAAG,KAAK;CAAE,CAAC;AAE5D,eAAO,MAAM,aAAa,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,WACT,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isNullOrUndefined.d.ts","sourceRoot":"","sources":["../../src/utils/isNullOrUndefined.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"isNullOrUndefined.d.ts","sourceRoot":"","sources":["../../src/utils/isNullOrUndefined.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,IAAI,GAAG,SACpD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isObject.d.ts","sourceRoot":"","sources":["../../src/utils/isObject.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"isObject.d.ts","sourceRoot":"","sources":["../../src/utils/isObject.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,MAC5B,CAAC;AAE5B,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,MAAM,EAAE,OAAO,OAAO,KAAG,KAAK,IAAI,CAI/C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@levo-so/react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.40",
|
|
4
4
|
"author": "Levo Engineering <devs@theinternetfolks.com>",
|
|
5
5
|
"description": "Levo suite for React based applications",
|
|
6
6
|
"type": "module",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"react": ">=18",
|
|
18
18
|
"react-dom": ">=18",
|
|
19
|
-
"@levo-so/core": "0.1.
|
|
19
|
+
"@levo-so/core": "0.1.37"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@radix-ui/react-checkbox": "1.1.1",
|
|
@@ -74,11 +74,11 @@
|
|
|
74
74
|
"@types/google-libphonenumber": "7.4.30",
|
|
75
75
|
"@types/google.maps": "3.58.0",
|
|
76
76
|
"@types/lodash-es": "4.17.12",
|
|
77
|
-
"@types/react": "18.3.
|
|
78
|
-
"@types/react-dom": "18.3.
|
|
77
|
+
"@types/react": "18.3.18",
|
|
78
|
+
"@types/react-dom": "18.3.5",
|
|
79
79
|
"@types/validator": "13.12.0",
|
|
80
80
|
"@types/validatorjs": "3.15.5",
|
|
81
|
-
"@vitejs/plugin-react": "4.3.
|
|
81
|
+
"@vitejs/plugin-react": "4.3.4",
|
|
82
82
|
"autoprefixer": "10.4.16",
|
|
83
83
|
"clsx": "2.1.1",
|
|
84
84
|
"postcss": "8.4.41",
|
|
@@ -87,8 +87,8 @@
|
|
|
87
87
|
"tailwind-merge": "2.4.0",
|
|
88
88
|
"tailwindcss": "3.4.1",
|
|
89
89
|
"tailwindcss-animate": "1.0.7",
|
|
90
|
-
"typescript": "5.
|
|
91
|
-
"vite": "
|
|
90
|
+
"typescript": "5.8.2",
|
|
91
|
+
"vite": "6.0.5",
|
|
92
92
|
"vite-plugin-dts": "4.1.0",
|
|
93
93
|
"@levo/eslint-config": "0.0.0",
|
|
94
94
|
"@levo/tw-config": "0.0.0",
|
|
@@ -99,7 +99,6 @@
|
|
|
99
99
|
"types": "./dist/index.d.ts",
|
|
100
100
|
"exports": {
|
|
101
101
|
"./index.css": "./dist/index.css",
|
|
102
|
-
"./libs.css": "./dist/libs.css",
|
|
103
102
|
".": {
|
|
104
103
|
"types": "./dist/index.d.ts",
|
|
105
104
|
"default": "./dist/index.js"
|
|
@@ -116,10 +115,6 @@
|
|
|
116
115
|
"types": "./dist/membership/index.d.ts",
|
|
117
116
|
"default": "./dist/membership/index.js"
|
|
118
117
|
},
|
|
119
|
-
"./collection": {
|
|
120
|
-
"types": "./dist/collection/index.d.ts",
|
|
121
|
-
"default": "./dist/collection/index.js"
|
|
122
|
-
},
|
|
123
118
|
"./utils": {
|
|
124
119
|
"types": "./dist/utils/index.d.ts",
|
|
125
120
|
"default": "./dist/utils/index.js"
|
package/dist/Checbox-sq-atGlJ.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { j as e } from "./jsx-runtime-B6kdoens.js";
|
|
3
|
-
import * as r from "@radix-ui/react-checkbox";
|
|
4
|
-
import { Check as a } from "lucide-react";
|
|
5
|
-
import * as c from "react";
|
|
6
|
-
import { c as o } from "./cn-C9QoOYNG.js";
|
|
7
|
-
const n = c.forwardRef(({ className: s, ...i }, t) => /* @__PURE__ */ e.jsx(
|
|
8
|
-
r.Root,
|
|
9
|
-
{
|
|
10
|
-
ref: t,
|
|
11
|
-
className: o(
|
|
12
|
-
"peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
|
|
13
|
-
s
|
|
14
|
-
),
|
|
15
|
-
...i,
|
|
16
|
-
children: /* @__PURE__ */ e.jsx(
|
|
17
|
-
r.Indicator,
|
|
18
|
-
{
|
|
19
|
-
className: o("flex items-center justify-center text-current"),
|
|
20
|
-
children: /* @__PURE__ */ e.jsx(a, { className: "h-4 w-4" })
|
|
21
|
-
}
|
|
22
|
-
)
|
|
23
|
-
}
|
|
24
|
-
));
|
|
25
|
-
n.displayName = r.Root.displayName;
|
|
26
|
-
export {
|
|
27
|
-
n as C
|
|
28
|
-
};
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { j as a } from "./jsx-runtime-B6kdoens.js";
|
|
3
|
-
import { useState as w, useEffect as B } from "react";
|
|
4
|
-
import { useController as E } from "react-hook-form";
|
|
5
|
-
import { c as C } from "./cn-C9QoOYNG.js";
|
|
6
|
-
import { z as O, A as I, B as x } from "./CollectionFormBuilder-CUzpwIva.js";
|
|
7
|
-
import { C as g } from "./Checbox-sq-atGlJ.js";
|
|
8
|
-
import { I as S } from "./Input-Vv7mKQFt.js";
|
|
9
|
-
const L = ({ field: i }) => {
|
|
10
|
-
const [o, p] = w(""), [j, m] = w(!1), {
|
|
11
|
-
key: k = "",
|
|
12
|
-
label: b = "",
|
|
13
|
-
helper_text: F = "",
|
|
14
|
-
readonly: y = !1,
|
|
15
|
-
values: n = [],
|
|
16
|
-
options: f = {}
|
|
17
|
-
} = i, {
|
|
18
|
-
field: { name: t, onBlur: d, onChange: l, value: s, ref: N, disabled: u },
|
|
19
|
-
fieldState: { error: h }
|
|
20
|
-
} = E({
|
|
21
|
-
name: k,
|
|
22
|
-
rules: O(i)
|
|
23
|
-
}), A = (r) => {
|
|
24
|
-
let e = Array.isArray(s || null) ? [...s] : [];
|
|
25
|
-
e.includes(r) ? e = e == null ? void 0 : e.filter((c) => c !== r) : e.push(r), l(e);
|
|
26
|
-
}, $ = !!(f != null && f.custom_input);
|
|
27
|
-
return B(() => {
|
|
28
|
-
if ($) {
|
|
29
|
-
let r = !1;
|
|
30
|
-
(s ?? []).forEach((e) => {
|
|
31
|
-
n.includes(e) || (r = !0, p(e));
|
|
32
|
-
}), m(!!r);
|
|
33
|
-
}
|
|
34
|
-
}, [s, n]), /* @__PURE__ */ a.jsxs(
|
|
35
|
-
I,
|
|
36
|
-
{
|
|
37
|
-
error: h == null ? void 0 : h.message,
|
|
38
|
-
helperText: F,
|
|
39
|
-
readOnly: y,
|
|
40
|
-
ref: N,
|
|
41
|
-
children: [
|
|
42
|
-
b && /* @__PURE__ */ a.jsx(x, { htmlFor: t, isRequired: i == null ? void 0 : i.required, children: b }),
|
|
43
|
-
/* @__PURE__ */ a.jsx(
|
|
44
|
-
"div",
|
|
45
|
-
{
|
|
46
|
-
className: C(
|
|
47
|
-
"flex w-full flex-col flex-wrap gap-4 pt-1",
|
|
48
|
-
y && "pointer-events-none cursor-not-allowed"
|
|
49
|
-
),
|
|
50
|
-
children: n == null ? void 0 : n.map((r, e) => /* @__PURE__ */ a.jsxs(
|
|
51
|
-
"div",
|
|
52
|
-
{
|
|
53
|
-
className: "flex w-full flex-nowrap items-start gap-2",
|
|
54
|
-
children: [
|
|
55
|
-
/* @__PURE__ */ a.jsx(
|
|
56
|
-
g,
|
|
57
|
-
{
|
|
58
|
-
id: `${r}-${e}`,
|
|
59
|
-
name: t,
|
|
60
|
-
checked: s == null ? void 0 : s.includes(r),
|
|
61
|
-
onCheckedChange: () => A(r),
|
|
62
|
-
onBlur: () => {
|
|
63
|
-
d();
|
|
64
|
-
},
|
|
65
|
-
disabled: u
|
|
66
|
-
}
|
|
67
|
-
),
|
|
68
|
-
/* @__PURE__ */ a.jsx(x, { htmlFor: `${r}-${e}`, className: "!mb-0", children: r })
|
|
69
|
-
]
|
|
70
|
-
},
|
|
71
|
-
`${r}-${e}`
|
|
72
|
-
))
|
|
73
|
-
}
|
|
74
|
-
),
|
|
75
|
-
$ && /* @__PURE__ */ a.jsxs("div", { className: "my-4 flex w-full flex-wrap items-center gap-2", children: [
|
|
76
|
-
/* @__PURE__ */ a.jsxs("div", { className: "flex shrink-0 flex-nowrap gap-2", children: [
|
|
77
|
-
/* @__PURE__ */ a.jsx(
|
|
78
|
-
g,
|
|
79
|
-
{
|
|
80
|
-
name: `${t}-other`,
|
|
81
|
-
id: `${t}-other`,
|
|
82
|
-
disabled: u,
|
|
83
|
-
checked: j,
|
|
84
|
-
onCheckedChange: (r) => {
|
|
85
|
-
var e;
|
|
86
|
-
m(!!r), r ? Array.isArray(s) ? l == null || l([...s, o]) : l == null || l([o]) : l == null || l(
|
|
87
|
-
(e = s ?? []) == null ? void 0 : e.filter((c) => c !== o)
|
|
88
|
-
);
|
|
89
|
-
},
|
|
90
|
-
onBlur: () => {
|
|
91
|
-
d && d();
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
),
|
|
95
|
-
/* @__PURE__ */ a.jsxs(x, { htmlFor: `${t}-other`, className: "!mb-0", children: [
|
|
96
|
-
"Other:",
|
|
97
|
-
" "
|
|
98
|
-
] })
|
|
99
|
-
] }),
|
|
100
|
-
/* @__PURE__ */ a.jsx(
|
|
101
|
-
S,
|
|
102
|
-
{
|
|
103
|
-
name: `other-checkbox-${t}`,
|
|
104
|
-
containerStyles: "max-w-[300px] ml-3",
|
|
105
|
-
value: o,
|
|
106
|
-
onChange: (r) => {
|
|
107
|
-
let e = 0;
|
|
108
|
-
l == null || l(
|
|
109
|
-
s == null ? void 0 : s.map((c) => c === o && !e ? (e = 1, r.target.value) : c)
|
|
110
|
-
), p(r.target.value);
|
|
111
|
-
},
|
|
112
|
-
disabled: !j || u,
|
|
113
|
-
placeholder: "Please specify"
|
|
114
|
-
}
|
|
115
|
-
)
|
|
116
|
-
] })
|
|
117
|
-
]
|
|
118
|
-
}
|
|
119
|
-
);
|
|
120
|
-
};
|
|
121
|
-
export {
|
|
122
|
-
L as CheckboxWidget,
|
|
123
|
-
L as default
|
|
124
|
-
};
|