@fuf-stack/uniform 1.6.5 → 1.7.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/Checkboxes/index.cjs +13 -11
- package/dist/Checkboxes/index.cjs.map +1 -1
- package/dist/Checkboxes/index.d.cts +3 -2
- package/dist/Checkboxes/index.d.ts +3 -2
- package/dist/Checkboxes/index.js +12 -10
- package/dist/{Checkboxes-CR0Uu2g9.d.ts → Checkboxes-CDjOYw76.d.cts} +3 -0
- package/dist/{Checkboxes-CR0Uu2g9.d.cts → Checkboxes-wWzFP2sn.d.ts} +3 -0
- package/dist/FieldArray/index.cjs +13 -11
- package/dist/FieldArray/index.cjs.map +1 -1
- package/dist/FieldArray/index.js +12 -10
- package/dist/Form/index.cjs +13 -11
- package/dist/Form/index.cjs.map +1 -1
- package/dist/Form/index.d.cts +3 -3
- package/dist/Form/index.d.ts +3 -3
- package/dist/Form/index.js +12 -10
- package/dist/{Form-Cu0lWRDN.d.cts → Form-BZZJPLsi.d.cts} +1 -1
- package/dist/{Form-C_11i6PA.d.ts → Form-zsUjI2yq.d.ts} +1 -1
- package/dist/FormContext-9Firwt4k.d.cts +14 -0
- package/dist/FormContext-9Firwt4k.d.ts +14 -0
- package/dist/Input/index.cjs +13 -11
- package/dist/Input/index.cjs.map +1 -1
- package/dist/Input/index.d.cts +2 -2
- package/dist/Input/index.d.ts +2 -2
- package/dist/Input/index.js +12 -10
- package/dist/{Input-CCIEnvIp.d.ts → Input-BcdS2xBM.d.ts} +2 -2
- package/dist/{Input-D7HT_8jf.d.cts → Input-DMVTcinm.d.cts} +2 -2
- package/dist/RadioBoxes/index.cjs +13 -11
- package/dist/RadioBoxes/index.cjs.map +1 -1
- package/dist/RadioBoxes/index.js +12 -10
- package/dist/RadioTabs/index.cjs +13 -11
- package/dist/RadioTabs/index.cjs.map +1 -1
- package/dist/RadioTabs/index.js +12 -10
- package/dist/Radios/index.cjs +13 -11
- package/dist/Radios/index.cjs.map +1 -1
- package/dist/Radios/index.js +12 -10
- package/dist/Select/index.cjs +13 -11
- package/dist/Select/index.cjs.map +1 -1
- package/dist/Select/index.js +12 -10
- package/dist/SubmitButton/index.cjs +13 -11
- package/dist/SubmitButton/index.cjs.map +1 -1
- package/dist/SubmitButton/index.js +12 -10
- package/dist/Switch/index.cjs +13 -11
- package/dist/Switch/index.cjs.map +1 -1
- package/dist/Switch/index.js +12 -10
- package/dist/TextArea/index.cjs +13 -11
- package/dist/TextArea/index.cjs.map +1 -1
- package/dist/TextArea/index.js +12 -10
- package/dist/{chunk-7NZVPVK3.cjs → chunk-2E4Q6OHC.cjs} +5 -9
- package/dist/chunk-2E4Q6OHC.cjs.map +1 -0
- package/dist/{chunk-HANR2BDX.cjs → chunk-4CWB5XBW.cjs} +5 -5
- package/dist/{chunk-HANR2BDX.cjs.map → chunk-4CWB5XBW.cjs.map} +1 -1
- package/dist/chunk-4F45XA7Y.cjs +26 -0
- package/dist/chunk-4F45XA7Y.cjs.map +1 -0
- package/dist/{chunk-42NCLEX4.cjs → chunk-4L3JXJ62.cjs} +35 -104
- package/dist/chunk-4L3JXJ62.cjs.map +1 -0
- package/dist/{chunk-RI45RSNN.js → chunk-4TQ53WAY.js} +2 -2
- package/dist/{chunk-4WYC2RBE.cjs → chunk-56TQOKG7.cjs} +6 -3
- package/dist/chunk-56TQOKG7.cjs.map +1 -0
- package/dist/{chunk-4Z7LIJHZ.cjs → chunk-6F5EZ6QN.cjs} +3 -3
- package/dist/{chunk-4Z7LIJHZ.cjs.map → chunk-6F5EZ6QN.cjs.map} +1 -1
- package/dist/chunk-6LQ2O6SC.cjs +115 -0
- package/dist/chunk-6LQ2O6SC.cjs.map +1 -0
- package/dist/{chunk-JMFDNTVC.cjs → chunk-7KEUEGRC.cjs} +9 -2
- package/dist/chunk-7KEUEGRC.cjs.map +1 -0
- package/dist/{chunk-HBVHOUAR.js → chunk-BUJNCVUR.js} +3 -3
- package/dist/{chunk-7KLFK2IT.js → chunk-CNTOODUQ.js} +6 -3
- package/dist/chunk-CNTOODUQ.js.map +1 -0
- package/dist/{chunk-CMTSX5UA.cjs → chunk-EB3RNELT.cjs} +6 -4
- package/dist/chunk-EB3RNELT.cjs.map +1 -0
- package/dist/{chunk-D3JYMGTB.js → chunk-EGFB5WEK.js} +47 -37
- package/dist/chunk-EGFB5WEK.js.map +1 -0
- package/dist/{chunk-AAGOHXSZ.js → chunk-EUO4VWRX.js} +2 -2
- package/dist/{chunk-D3EZXJQH.cjs → chunk-EUTTXFWA.cjs} +3 -3
- package/dist/{chunk-D3EZXJQH.cjs.map → chunk-EUTTXFWA.cjs.map} +1 -1
- package/dist/{chunk-QAQ3UP7W.cjs → chunk-FFGFPXNE.cjs} +3 -3
- package/dist/{chunk-QAQ3UP7W.cjs.map → chunk-FFGFPXNE.cjs.map} +1 -1
- package/dist/{chunk-X37C4SVI.js → chunk-FND5Z5BW.js} +4 -7
- package/dist/{chunk-X37C4SVI.js.map → chunk-FND5Z5BW.js.map} +1 -1
- package/dist/{chunk-CK362NWK.js → chunk-GKP3ONKO.js} +9 -2
- package/dist/chunk-GKP3ONKO.js.map +1 -0
- package/dist/{chunk-VDTYZM6N.cjs → chunk-IFBKJ5UZ.cjs} +6 -9
- package/dist/chunk-IFBKJ5UZ.cjs.map +1 -0
- package/dist/{chunk-IK5IWKUC.js → chunk-K33E67GR.js} +6 -6
- package/dist/{chunk-R6IWQWZ6.js → chunk-KGN5JQGG.js} +5 -3
- package/dist/{chunk-R6IWQWZ6.js.map → chunk-KGN5JQGG.js.map} +1 -1
- package/dist/{chunk-M7TOCXYB.js → chunk-KQQAESO7.js} +3 -3
- package/dist/chunk-KWJMKX5J.cjs +1 -0
- package/dist/{chunk-LTKRK3OS.cjs.map → chunk-KWJMKX5J.cjs.map} +1 -1
- package/dist/{chunk-NZ54JBSR.js → chunk-LKR6D3RL.js} +36 -105
- package/dist/chunk-LKR6D3RL.js.map +1 -0
- package/dist/{chunk-65UJEB4P.js → chunk-N24A7PIL.js} +2 -2
- package/dist/{chunk-BZ5OMN4Y.cjs → chunk-NTOYCWCJ.cjs} +12 -26
- package/dist/chunk-NTOYCWCJ.cjs.map +1 -0
- package/dist/{chunk-4ATOAQOF.cjs → chunk-OJGPW4Z6.cjs} +3 -3
- package/dist/{chunk-4ATOAQOF.cjs.map → chunk-OJGPW4Z6.cjs.map} +1 -1
- package/dist/{chunk-SOQ6GCN3.cjs → chunk-OQUTHTOK.cjs} +48 -38
- package/dist/chunk-OQUTHTOK.cjs.map +1 -0
- package/dist/chunk-PY4GCAFN.js +26 -0
- package/dist/chunk-PY4GCAFN.js.map +1 -0
- package/dist/{chunk-V3NNJJHY.cjs → chunk-S3H432Z2.cjs} +3 -3
- package/dist/{chunk-V3NNJJHY.cjs.map → chunk-S3H432Z2.cjs.map} +1 -1
- package/dist/{chunk-TB5WXGWX.js → chunk-SWPFSD3Y.js} +9 -27
- package/dist/chunk-SWPFSD3Y.js.map +1 -0
- package/dist/{chunk-HX2JJ2ZK.cjs → chunk-TJY5FK4B.cjs} +8 -8
- package/dist/{chunk-HX2JJ2ZK.cjs.map → chunk-TJY5FK4B.cjs.map} +1 -1
- package/dist/chunk-U45RW4FC.js +115 -0
- package/dist/chunk-U45RW4FC.js.map +1 -0
- package/dist/{chunk-NM66XFQH.js → chunk-UEOED4GU.js} +2 -2
- package/dist/{chunk-3NNANHVC.cjs → chunk-UT6VUGFP.cjs} +6 -6
- package/dist/{chunk-3NNANHVC.cjs.map → chunk-UT6VUGFP.cjs.map} +1 -1
- package/dist/chunk-V3GDAELU.js +1 -0
- package/dist/{chunk-I5RBXUIV.js → chunk-VUW522KH.js} +2 -2
- package/dist/{chunk-4RIJJ5AV.js → chunk-WHV55VFM.js} +4 -8
- package/dist/chunk-WHV55VFM.js.map +1 -0
- package/dist/{chunk-NUGEM725.js → chunk-WWGKXYZB.js} +2 -2
- package/dist/{chunk-PC3VCEGM.cjs → chunk-ZEJ45LLM.cjs} +3 -3
- package/dist/{chunk-PC3VCEGM.cjs.map → chunk-ZEJ45LLM.cjs.map} +1 -1
- package/dist/{chunk-HEGORLRF.cjs → chunk-ZFZK6EM2.cjs} +10 -28
- package/dist/chunk-ZFZK6EM2.cjs.map +1 -0
- package/dist/{chunk-MODD3TFE.js → chunk-ZJDU5EPE.js} +12 -26
- package/dist/chunk-ZJDU5EPE.js.map +1 -0
- package/dist/hooks/index.cjs +17 -12
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.cts +2 -1
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/index.js +17 -12
- package/dist/hooks/useClientValidation/index.cjs +4 -3
- package/dist/hooks/useClientValidation/index.cjs.map +1 -1
- package/dist/hooks/useClientValidation/index.js +3 -2
- package/dist/hooks/useController/index.cjs +3 -2
- package/dist/hooks/useController/index.cjs.map +1 -1
- package/dist/hooks/useController/index.d.cts +1 -0
- package/dist/hooks/useController/index.d.ts +1 -0
- package/dist/hooks/useController/index.js +2 -1
- package/dist/hooks/useFormContext/index.cjs +3 -2
- package/dist/hooks/useFormContext/index.cjs.map +1 -1
- package/dist/hooks/useFormContext/index.d.cts +5 -1
- package/dist/hooks/useFormContext/index.d.ts +5 -1
- package/dist/hooks/useFormContext/index.js +2 -1
- package/dist/hooks/useInputValueDebounce/index.cjs +2 -3
- package/dist/hooks/useInputValueDebounce/index.cjs.map +1 -1
- package/dist/hooks/useInputValueDebounce/index.d.cts +17 -52
- package/dist/hooks/useInputValueDebounce/index.d.ts +17 -52
- package/dist/hooks/useInputValueDebounce/index.js +1 -2
- package/dist/hooks/useInputValueTransform/index.cjs +2 -2
- package/dist/hooks/useInputValueTransform/index.d.cts +31 -13
- package/dist/hooks/useInputValueTransform/index.d.ts +31 -13
- package/dist/hooks/useInputValueTransform/index.js +1 -1
- package/dist/hooks/useUniformField/index.cjs +7 -5
- package/dist/hooks/useUniformField/index.cjs.map +1 -1
- package/dist/hooks/useUniformField/index.d.cts +16 -5
- package/dist/hooks/useUniformField/index.d.ts +16 -5
- package/dist/hooks/useUniformField/index.js +6 -4
- package/dist/hooks/useUniformFieldArray/index.cjs +8 -6
- package/dist/hooks/useUniformFieldArray/index.cjs.map +1 -1
- package/dist/hooks/useUniformFieldArray/index.d.cts +2 -2
- package/dist/hooks/useUniformFieldArray/index.d.ts +2 -2
- package/dist/hooks/useUniformFieldArray/index.js +7 -5
- package/dist/hooks/useWatchUserChange/index.cjs +11 -0
- package/dist/hooks/useWatchUserChange/index.cjs.map +1 -0
- package/dist/hooks/useWatchUserChange/index.d.cts +73 -0
- package/dist/hooks/useWatchUserChange/index.d.ts +73 -0
- package/dist/hooks/useWatchUserChange/index.js +11 -0
- package/dist/hooks/useWatchUserChange/index.js.map +1 -0
- package/dist/index.cjs +26 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +29 -24
- package/package.json +7 -2
- package/dist/FormContext-LRho0tno.d.cts +0 -8
- package/dist/FormContext-LRho0tno.d.ts +0 -8
- package/dist/chunk-35V726MB.js +0 -1
- package/dist/chunk-42NCLEX4.cjs.map +0 -1
- package/dist/chunk-4RIJJ5AV.js.map +0 -1
- package/dist/chunk-4WYC2RBE.cjs.map +0 -1
- package/dist/chunk-7KLFK2IT.js.map +0 -1
- package/dist/chunk-7NZVPVK3.cjs.map +0 -1
- package/dist/chunk-BZ5OMN4Y.cjs.map +0 -1
- package/dist/chunk-CK362NWK.js.map +0 -1
- package/dist/chunk-CMTSX5UA.cjs.map +0 -1
- package/dist/chunk-D3JYMGTB.js.map +0 -1
- package/dist/chunk-HEGORLRF.cjs.map +0 -1
- package/dist/chunk-JMFDNTVC.cjs.map +0 -1
- package/dist/chunk-LTKRK3OS.cjs +0 -1
- package/dist/chunk-MODD3TFE.js.map +0 -1
- package/dist/chunk-NZ54JBSR.js.map +0 -1
- package/dist/chunk-SOQ6GCN3.cjs.map +0 -1
- package/dist/chunk-TB5WXGWX.js.map +0 -1
- package/dist/chunk-VDTYZM6N.cjs.map +0 -1
- /package/dist/{chunk-RI45RSNN.js.map → chunk-4TQ53WAY.js.map} +0 -0
- /package/dist/{chunk-HBVHOUAR.js.map → chunk-BUJNCVUR.js.map} +0 -0
- /package/dist/{chunk-AAGOHXSZ.js.map → chunk-EUO4VWRX.js.map} +0 -0
- /package/dist/{chunk-IK5IWKUC.js.map → chunk-K33E67GR.js.map} +0 -0
- /package/dist/{chunk-M7TOCXYB.js.map → chunk-KQQAESO7.js.map} +0 -0
- /package/dist/{chunk-65UJEB4P.js.map → chunk-N24A7PIL.js.map} +0 -0
- /package/dist/{chunk-NM66XFQH.js.map → chunk-UEOED4GU.js.map} +0 -0
- /package/dist/{chunk-35V726MB.js.map → chunk-V3GDAELU.js.map} +0 -0
- /package/dist/{chunk-I5RBXUIV.js.map → chunk-VUW522KH.js.map} +0 -0
- /package/dist/{chunk-NUGEM725.js.map → chunk-WWGKXYZB.js.map} +0 -0
package/dist/hooks/index.cjs
CHANGED
|
@@ -1,32 +1,36 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-KWJMKX5J.cjs');
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkNTOYCWCJcjs = require('../chunk-NTOYCWCJ.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkIFBKJ5UZcjs = require('../chunk-IFBKJ5UZ.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var _chunkSOQ6GCN3cjs = require('../chunk-SOQ6GCN3.cjs');
|
|
10
|
+
var _chunkOQUTHTOKcjs = require('../chunk-OQUTHTOK.cjs');
|
|
11
|
+
require('../chunk-OE5BOGGX.cjs');
|
|
14
12
|
require('../chunk-NHEZXA4H.cjs');
|
|
15
13
|
|
|
16
14
|
|
|
17
|
-
var
|
|
15
|
+
var _chunk7KEUEGRCcjs = require('../chunk-7KEUEGRC.cjs');
|
|
18
16
|
|
|
19
17
|
|
|
20
18
|
var _chunkPCTYJUY7cjs = require('../chunk-PCTYJUY7.cjs');
|
|
21
|
-
require('../chunk-OE5BOGGX.cjs');
|
|
22
19
|
|
|
23
20
|
|
|
21
|
+
var _chunk56TQOKG7cjs = require('../chunk-56TQOKG7.cjs');
|
|
22
|
+
|
|
24
23
|
|
|
25
|
-
var
|
|
24
|
+
var _chunk4F45XA7Ycjs = require('../chunk-4F45XA7Y.cjs');
|
|
26
25
|
|
|
27
26
|
|
|
28
27
|
|
|
29
|
-
var
|
|
28
|
+
var _chunkEUTTXFWAcjs = require('../chunk-EUTTXFWA.cjs');
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
var _chunk6LQ2O6SCcjs = require('../chunk-6LQ2O6SC.cjs');
|
|
33
|
+
require('../chunk-4L3JXJ62.cjs');
|
|
30
34
|
require('../chunk-Z353BLWI.cjs');
|
|
31
35
|
require('../chunk-555JRYCS.cjs');
|
|
32
36
|
|
|
@@ -40,5 +44,6 @@ require('../chunk-555JRYCS.cjs');
|
|
|
40
44
|
|
|
41
45
|
|
|
42
46
|
|
|
43
|
-
|
|
47
|
+
|
|
48
|
+
exports.checkFieldIsRequired = _chunk6LQ2O6SCcjs.checkFieldIsRequired; exports.clientValidationSchemaByName = _chunkEUTTXFWAcjs.clientValidationSchemaByName; exports.useClientValidation = _chunkEUTTXFWAcjs.useClientValidation; exports.useController = _chunk7KEUEGRCcjs.useController; exports.useFormContext = _chunk6LQ2O6SCcjs.useFormContext; exports.useInput = _chunkPCTYJUY7cjs.useInput; exports.useInputValueDebounce = _chunkNTOYCWCJcjs.useInputValueDebounce; exports.useInputValueTransform = _chunk56TQOKG7cjs.useInputValueTransform; exports.useUniformField = _chunkOQUTHTOKcjs.useUniformField; exports.useUniformFieldArray = _chunkIFBKJ5UZcjs.useUniformFieldArray; exports.useWatchUserChange = _chunk4F45XA7Ycjs.useWatchUserChange;
|
|
44
49
|
//# sourceMappingURL=index.cjs.map
|
package/dist/hooks/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/hooks/index.cjs"],"names":[],"mappings":"AAAA,0GAA8B;AAC9B;AACE;AACF,yDAA8B;AAC9B;AACE;AACF,yDAA8B;AAC9B;AACE;AACF,yDAA8B;AAC9B;AACE;AACF,yDAA8B;AAC9B,
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/hooks/index.cjs"],"names":[],"mappings":"AAAA,0GAA8B;AAC9B;AACE;AACF,yDAA8B;AAC9B;AACE;AACF,yDAA8B;AAC9B;AACE;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B;AACE;AACF,yDAA8B;AAC9B;AACE;AACF,yDAA8B;AAC9B;AACE;AACF,yDAA8B;AAC9B;AACE;AACF,yDAA8B;AAC9B;AACE;AACA;AACF,yDAA8B;AAC9B;AACE;AACA;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,guBAAC","file":"/home/runner/work/pixels/pixels/packages/uniform/dist/hooks/index.cjs"}
|
package/dist/hooks/index.d.cts
CHANGED
|
@@ -6,8 +6,9 @@ export { useInput } from '@heroui/input';
|
|
|
6
6
|
export { UseInputValueDebounceOptions, UseInputValueDebounceReturn, useInputValueDebounce } from './useInputValueDebounce/index.cjs';
|
|
7
7
|
export { InputValueTransform, UseInputValueTransformOptions, UseInputValueTransformReturn, useInputValueTransform } from './useInputValueTransform/index.cjs';
|
|
8
8
|
export { UseUniformFieldParams, UseUniformFieldReturn, useUniformField } from './useUniformField/index.cjs';
|
|
9
|
+
export { UseWatchUserChangeOptions, useWatchUserChange } from './useWatchUserChange/index.cjs';
|
|
9
10
|
import '@fuf-stack/veto/dist/types.d-CNPgNK-V';
|
|
10
11
|
import '@fuf-stack/veto';
|
|
11
12
|
import 'react-hook-form';
|
|
12
13
|
import 'react';
|
|
13
|
-
import '../FormContext-
|
|
14
|
+
import '../FormContext-9Firwt4k.cjs';
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -6,8 +6,9 @@ export { useInput } from '@heroui/input';
|
|
|
6
6
|
export { UseInputValueDebounceOptions, UseInputValueDebounceReturn, useInputValueDebounce } from './useInputValueDebounce/index.js';
|
|
7
7
|
export { InputValueTransform, UseInputValueTransformOptions, UseInputValueTransformReturn, useInputValueTransform } from './useInputValueTransform/index.js';
|
|
8
8
|
export { UseUniformFieldParams, UseUniformFieldReturn, useUniformField } from './useUniformField/index.js';
|
|
9
|
+
export { UseWatchUserChangeOptions, useWatchUserChange } from './useWatchUserChange/index.js';
|
|
9
10
|
import '@fuf-stack/veto/dist/types.d-CNPgNK-V';
|
|
10
11
|
import '@fuf-stack/veto';
|
|
11
12
|
import 'react-hook-form';
|
|
12
13
|
import 'react';
|
|
13
|
-
import '../FormContext-
|
|
14
|
+
import '../FormContext-9Firwt4k.js';
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,32 +1,36 @@
|
|
|
1
|
-
import "../chunk-
|
|
1
|
+
import "../chunk-V3GDAELU.js";
|
|
2
2
|
import {
|
|
3
3
|
useInputValueDebounce
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import {
|
|
6
|
-
useInputValueTransform
|
|
7
|
-
} from "../chunk-7KLFK2IT.js";
|
|
4
|
+
} from "../chunk-ZJDU5EPE.js";
|
|
8
5
|
import {
|
|
9
6
|
useUniformFieldArray
|
|
10
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-FND5Z5BW.js";
|
|
11
8
|
import {
|
|
12
9
|
useUniformField
|
|
13
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-EGFB5WEK.js";
|
|
11
|
+
import "../chunk-NTDKZW4E.js";
|
|
14
12
|
import "../chunk-ELYGQTXB.js";
|
|
15
13
|
import {
|
|
16
14
|
useController
|
|
17
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-GKP3ONKO.js";
|
|
18
16
|
import {
|
|
19
17
|
useInput
|
|
20
18
|
} from "../chunk-AHJJIANM.js";
|
|
21
|
-
import
|
|
19
|
+
import {
|
|
20
|
+
useInputValueTransform
|
|
21
|
+
} from "../chunk-CNTOODUQ.js";
|
|
22
|
+
import {
|
|
23
|
+
useWatchUserChange
|
|
24
|
+
} from "../chunk-PY4GCAFN.js";
|
|
22
25
|
import {
|
|
23
26
|
clientValidationSchemaByName,
|
|
24
27
|
useClientValidation
|
|
25
|
-
} from "../chunk-
|
|
28
|
+
} from "../chunk-4TQ53WAY.js";
|
|
26
29
|
import {
|
|
27
30
|
checkFieldIsRequired,
|
|
28
31
|
useFormContext
|
|
29
|
-
} from "../chunk-
|
|
32
|
+
} from "../chunk-U45RW4FC.js";
|
|
33
|
+
import "../chunk-LKR6D3RL.js";
|
|
30
34
|
import "../chunk-76KOVUDN.js";
|
|
31
35
|
import "../chunk-K2V4ULA2.js";
|
|
32
36
|
export {
|
|
@@ -39,6 +43,7 @@ export {
|
|
|
39
43
|
useInputValueDebounce,
|
|
40
44
|
useInputValueTransform,
|
|
41
45
|
useUniformField,
|
|
42
|
-
useUniformFieldArray
|
|
46
|
+
useUniformFieldArray,
|
|
47
|
+
useWatchUserChange
|
|
43
48
|
};
|
|
44
49
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../../chunk-
|
|
4
|
+
var _chunkEUTTXFWAcjs = require('../../chunk-EUTTXFWA.cjs');
|
|
5
|
+
require('../../chunk-6LQ2O6SC.cjs');
|
|
6
|
+
require('../../chunk-4L3JXJ62.cjs');
|
|
6
7
|
require('../../chunk-Z353BLWI.cjs');
|
|
7
8
|
require('../../chunk-555JRYCS.cjs');
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
|
|
11
|
-
exports.clientValidationSchemaByName =
|
|
12
|
+
exports.clientValidationSchemaByName = _chunkEUTTXFWAcjs.clientValidationSchemaByName; exports.useClientValidation = _chunkEUTTXFWAcjs.useClientValidation;
|
|
12
13
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/hooks/useClientValidation/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,4DAAiC;AACjC,oCAAiC;AACjC,oCAAiC;AACjC,oCAAiC;AACjC;AACE;AACA;AACF,2JAAC","file":"/home/runner/work/pixels/pixels/packages/uniform/dist/hooks/useClientValidation/index.cjs"}
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/hooks/useClientValidation/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,4DAAiC;AACjC,oCAAiC;AACjC,oCAAiC;AACjC,oCAAiC;AACjC,oCAAiC;AACjC;AACE;AACA;AACF,2JAAC","file":"/home/runner/work/pixels/pixels/packages/uniform/dist/hooks/useClientValidation/index.cjs"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
clientValidationSchemaByName,
|
|
3
3
|
useClientValidation
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
4
|
+
} from "../../chunk-4TQ53WAY.js";
|
|
5
|
+
import "../../chunk-U45RW4FC.js";
|
|
6
|
+
import "../../chunk-LKR6D3RL.js";
|
|
6
7
|
import "../../chunk-76KOVUDN.js";
|
|
7
8
|
import "../../chunk-K2V4ULA2.js";
|
|
8
9
|
export {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk7KEUEGRCcjs = require('../../chunk-7KEUEGRC.cjs');
|
|
4
|
+
require('../../chunk-4L3JXJ62.cjs');
|
|
4
5
|
require('../../chunk-Z353BLWI.cjs');
|
|
5
6
|
require('../../chunk-555JRYCS.cjs');
|
|
6
7
|
|
|
7
8
|
|
|
8
|
-
exports.useController =
|
|
9
|
+
exports.useController = _chunk7KEUEGRCcjs.useController;
|
|
9
10
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/hooks/useController/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACF,4DAAiC;AACjC,oCAAiC;AACjC,oCAAiC;AACjC;AACE;AACF,wDAAC","file":"/home/runner/work/pixels/pixels/packages/uniform/dist/hooks/useController/index.cjs"}
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/hooks/useController/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACF,4DAAiC;AACjC,oCAAiC;AACjC,oCAAiC;AACjC,oCAAiC;AACjC;AACE;AACF,wDAAC","file":"/home/runner/work/pixels/pixels/packages/uniform/dist/hooks/useController/index.cjs"}
|
|
@@ -17,6 +17,7 @@ interface UseControllerReturn<TFieldValues extends object = object> {
|
|
|
17
17
|
* 2. Null/undefined values in form state are displayed as empty strings in the UI
|
|
18
18
|
* 3. Handles both direct value changes and React synthetic events
|
|
19
19
|
* 4. Maintains the same API as react-hook-form's useController
|
|
20
|
+
* 5. Notifies UniformContext's userChange listeners on field changes (enables useWatchUserChange hook)
|
|
20
21
|
*
|
|
21
22
|
* This enables consistent handling of empty/null values while keeping a clean API
|
|
22
23
|
* for form inputs that expect string values.
|
|
@@ -17,6 +17,7 @@ interface UseControllerReturn<TFieldValues extends object = object> {
|
|
|
17
17
|
* 2. Null/undefined values in form state are displayed as empty strings in the UI
|
|
18
18
|
* 3. Handles both direct value changes and React synthetic events
|
|
19
19
|
* 4. Maintains the same API as react-hook-form's useController
|
|
20
|
+
* 5. Notifies UniformContext's userChange listeners on field changes (enables useWatchUserChange hook)
|
|
20
21
|
*
|
|
21
22
|
* This enables consistent handling of empty/null values while keeping a clean API
|
|
22
23
|
* for form inputs that expect string values.
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk6LQ2O6SCcjs = require('../../chunk-6LQ2O6SC.cjs');
|
|
5
|
+
require('../../chunk-4L3JXJ62.cjs');
|
|
5
6
|
require('../../chunk-Z353BLWI.cjs');
|
|
6
7
|
require('../../chunk-555JRYCS.cjs');
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
|
|
10
|
-
exports.checkFieldIsRequired =
|
|
11
|
+
exports.checkFieldIsRequired = _chunk6LQ2O6SCcjs.checkFieldIsRequired; exports.useFormContext = _chunk6LQ2O6SCcjs.useFormContext;
|
|
11
12
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/hooks/useFormContext/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,4DAAiC;AACjC,oCAAiC;AACjC,oCAAiC;AACjC;AACE;AACA;AACF,iIAAC","file":"/home/runner/work/pixels/pixels/packages/uniform/dist/hooks/useFormContext/index.cjs"}
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/hooks/useFormContext/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,4DAAiC;AACjC,oCAAiC;AACjC,oCAAiC;AACjC,oCAAiC;AACjC;AACE;AACA;AACF,iIAAC","file":"/home/runner/work/pixels/pixels/packages/uniform/dist/hooks/useFormContext/index.cjs"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _fuf_stack_veto from '@fuf-stack/veto';
|
|
2
2
|
import { VetoInstance, VetoFormattedError } from '@fuf-stack/veto';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import { D as DebugModeSettings } from '../../FormContext-
|
|
4
|
+
import { D as DebugModeSettings, U as UserChangeListener } from '../../FormContext-9Firwt4k.cjs';
|
|
5
5
|
import * as react_hook_form from 'react-hook-form';
|
|
6
6
|
import { FieldValues, Path, FieldError } from 'react-hook-form';
|
|
7
7
|
|
|
@@ -29,6 +29,10 @@ declare const useFormContext: <TFieldValues extends FieldValues = FieldValues, T
|
|
|
29
29
|
preventSubmit: (prevent: boolean) => void;
|
|
30
30
|
setDebugMode: (debugMode: "debug" | "debug-testids" | "off" | "disabled") => void;
|
|
31
31
|
triggerSubmit: (e?: React.BaseSyntheticEvent) => Promise<void> | void;
|
|
32
|
+
userChange: {
|
|
33
|
+
subscribe: (listener: UserChangeListener) => () => void;
|
|
34
|
+
notify: (fieldName: string, value: unknown) => void;
|
|
35
|
+
};
|
|
32
36
|
validation: {
|
|
33
37
|
baseInstance?: VetoInstance;
|
|
34
38
|
instance?: VetoInstance;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _fuf_stack_veto from '@fuf-stack/veto';
|
|
2
2
|
import { VetoInstance, VetoFormattedError } from '@fuf-stack/veto';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import { D as DebugModeSettings } from '../../FormContext-
|
|
4
|
+
import { D as DebugModeSettings, U as UserChangeListener } from '../../FormContext-9Firwt4k.js';
|
|
5
5
|
import * as react_hook_form from 'react-hook-form';
|
|
6
6
|
import { FieldValues, Path, FieldError } from 'react-hook-form';
|
|
7
7
|
|
|
@@ -29,6 +29,10 @@ declare const useFormContext: <TFieldValues extends FieldValues = FieldValues, T
|
|
|
29
29
|
preventSubmit: (prevent: boolean) => void;
|
|
30
30
|
setDebugMode: (debugMode: "debug" | "debug-testids" | "off" | "disabled") => void;
|
|
31
31
|
triggerSubmit: (e?: React.BaseSyntheticEvent) => Promise<void> | void;
|
|
32
|
+
userChange: {
|
|
33
|
+
subscribe: (listener: UserChangeListener) => () => void;
|
|
34
|
+
notify: (fieldName: string, value: unknown) => void;
|
|
35
|
+
};
|
|
32
36
|
validation: {
|
|
33
37
|
baseInstance?: VetoInstance;
|
|
34
38
|
instance?: VetoInstance;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../chunk-4WYC2RBE.cjs');
|
|
3
|
+
var _chunkNTOYCWCJcjs = require('../../chunk-NTOYCWCJ.cjs');
|
|
5
4
|
require('../../chunk-555JRYCS.cjs');
|
|
6
5
|
|
|
7
6
|
|
|
8
|
-
exports.useInputValueDebounce =
|
|
7
|
+
exports.useInputValueDebounce = _chunkNTOYCWCJcjs.useInputValueDebounce;
|
|
9
8
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/hooks/useInputValueDebounce/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACF,4DAAiC;AACjC,oCAAiC;AACjC
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/uniform/dist/hooks/useInputValueDebounce/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACF,4DAAiC;AACjC,oCAAiC;AACjC;AACE;AACF,wEAAC","file":"/home/runner/work/pixels/pixels/packages/uniform/dist/hooks/useInputValueDebounce/index.cjs"}
|
|
@@ -1,49 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
interface UseInputValueDebounceOptions {
|
|
1
|
+
interface UseInputValueDebounceOptions<TValue = unknown> {
|
|
4
2
|
/** Debounce delay in milliseconds (default: 300) */
|
|
5
3
|
debounceDelay?: number;
|
|
6
4
|
/** The onBlur function to call after flushing debounced value */
|
|
7
5
|
onBlur: () => void;
|
|
8
6
|
/** The onChange function to call with debounced value */
|
|
9
7
|
onChange: (...event: any[]) => void;
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
-
/** Input type to handle number conversion (optional) */
|
|
13
|
-
type?: 'text' | 'number' | 'password';
|
|
14
|
-
/** The initial form value */
|
|
15
|
-
value: string | number;
|
|
8
|
+
/** The field value */
|
|
9
|
+
value: TValue;
|
|
16
10
|
}
|
|
17
|
-
interface UseInputValueDebounceReturn {
|
|
11
|
+
interface UseInputValueDebounceReturn<TValue = unknown> {
|
|
18
12
|
/** Enhanced onChange function with debouncing */
|
|
19
13
|
onChange: (...event: any[]) => void;
|
|
20
14
|
/** Enhanced onBlur function that flushes current value immediately */
|
|
21
15
|
onBlur: () => void;
|
|
22
16
|
/** The field value that is displayed - updates immediately */
|
|
23
|
-
value:
|
|
17
|
+
value: TValue;
|
|
24
18
|
}
|
|
25
19
|
/**
|
|
26
|
-
* Custom hook for debouncing
|
|
20
|
+
* Custom hook for debouncing value changes with immediate blur support.
|
|
27
21
|
*
|
|
28
|
-
* Provides immediate visual feedback by updating the
|
|
29
|
-
* while debouncing the actual
|
|
22
|
+
* Provides immediate visual feedback by updating the value instantly,
|
|
23
|
+
* while debouncing the actual onChange calls. When focus is lost,
|
|
30
24
|
* any pending debounced changes are immediately flushed.
|
|
31
25
|
*
|
|
32
26
|
* **Key Features:**
|
|
33
|
-
* - **Debouncing**: Delays
|
|
34
|
-
* - **
|
|
35
|
-
* - **
|
|
36
|
-
* - **Immediate display updates**: UI stays responsive during debouncing
|
|
27
|
+
* - **Debouncing**: Delays onChange calls until user stops typing
|
|
28
|
+
* - **Generic type support**: Works with any data type (strings, numbers, arrays, objects)
|
|
29
|
+
* - **Immediate value updates**: UI stays responsive during debouncing
|
|
37
30
|
* - **Blur flushing**: Immediately applies pending changes on blur
|
|
38
31
|
*
|
|
32
|
+
* **Note:** Value transformations should be handled at the `useUniformField` level,
|
|
33
|
+
* not in this hook. This hook only handles debouncing timing.
|
|
34
|
+
*
|
|
39
35
|
* @param options Configuration for debounced value handling
|
|
40
36
|
* @param options.debounceDelay Delay in milliseconds (default: 300)
|
|
41
37
|
* @param options.onBlur Function to call after flushing debounced value
|
|
42
38
|
* @param options.onChange Function to call with debounced value
|
|
43
|
-
* @param options.
|
|
44
|
-
* @
|
|
45
|
-
* @param options.value The initial form value
|
|
46
|
-
* @returns Object containing enhanced onChange, onBlur, and immediate display value
|
|
39
|
+
* @param options.value The field value
|
|
40
|
+
* @returns Object containing enhanced onChange, onBlur, and immediate value
|
|
47
41
|
*
|
|
48
42
|
* @example
|
|
49
43
|
* Basic usage with debouncing:
|
|
@@ -55,36 +49,7 @@ interface UseInputValueDebounceReturn {
|
|
|
55
49
|
* value: field.value,
|
|
56
50
|
* });
|
|
57
51
|
* ```
|
|
58
|
-
*
|
|
59
|
-
* @example
|
|
60
|
-
* Number input with automatic conversion:
|
|
61
|
-
* ```tsx
|
|
62
|
-
* const { onChange, onBlur, value } = useInputValueDebounce({
|
|
63
|
-
* debounceDelay: 300,
|
|
64
|
-
* onBlur: field.onBlur,
|
|
65
|
-
* onChange: field.onChange,
|
|
66
|
-
* type: 'number',
|
|
67
|
-
* value: field.value, // Display: 123 (number), Form: 123 (number)
|
|
68
|
-
* });
|
|
69
|
-
* ```
|
|
70
|
-
*
|
|
71
|
-
* @example
|
|
72
|
-
* Currency formatting with transforms:
|
|
73
|
-
* ```tsx
|
|
74
|
-
* const currencyTransform = {
|
|
75
|
-
* displayValue: (val) => val ? `$${Number(val).toFixed(2)}` : '',
|
|
76
|
-
* formValue: (val) => Number(val.replace(/[$,]/g, '')) || 0
|
|
77
|
-
* };
|
|
78
|
-
*
|
|
79
|
-
* const { onChange, onBlur, value } = useInputValueDebounce({
|
|
80
|
-
* debounceDelay: 300,
|
|
81
|
-
* onBlur: field.onBlur,
|
|
82
|
-
* onChange: field.onChange,
|
|
83
|
-
* transform: currencyTransform,
|
|
84
|
-
* value: field.value, // Display: "$100.00", Form: 100
|
|
85
|
-
* });
|
|
86
|
-
* ```
|
|
87
52
|
*/
|
|
88
|
-
declare const useInputValueDebounce: ({ debounceDelay, onBlur, onChange,
|
|
53
|
+
declare const useInputValueDebounce: <TValue = unknown>({ debounceDelay, onBlur, onChange, value, }: UseInputValueDebounceOptions<TValue>) => UseInputValueDebounceReturn<TValue>;
|
|
89
54
|
|
|
90
55
|
export { type UseInputValueDebounceOptions, type UseInputValueDebounceReturn, useInputValueDebounce };
|
|
@@ -1,49 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
interface UseInputValueDebounceOptions {
|
|
1
|
+
interface UseInputValueDebounceOptions<TValue = unknown> {
|
|
4
2
|
/** Debounce delay in milliseconds (default: 300) */
|
|
5
3
|
debounceDelay?: number;
|
|
6
4
|
/** The onBlur function to call after flushing debounced value */
|
|
7
5
|
onBlur: () => void;
|
|
8
6
|
/** The onChange function to call with debounced value */
|
|
9
7
|
onChange: (...event: any[]) => void;
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
-
/** Input type to handle number conversion (optional) */
|
|
13
|
-
type?: 'text' | 'number' | 'password';
|
|
14
|
-
/** The initial form value */
|
|
15
|
-
value: string | number;
|
|
8
|
+
/** The field value */
|
|
9
|
+
value: TValue;
|
|
16
10
|
}
|
|
17
|
-
interface UseInputValueDebounceReturn {
|
|
11
|
+
interface UseInputValueDebounceReturn<TValue = unknown> {
|
|
18
12
|
/** Enhanced onChange function with debouncing */
|
|
19
13
|
onChange: (...event: any[]) => void;
|
|
20
14
|
/** Enhanced onBlur function that flushes current value immediately */
|
|
21
15
|
onBlur: () => void;
|
|
22
16
|
/** The field value that is displayed - updates immediately */
|
|
23
|
-
value:
|
|
17
|
+
value: TValue;
|
|
24
18
|
}
|
|
25
19
|
/**
|
|
26
|
-
* Custom hook for debouncing
|
|
20
|
+
* Custom hook for debouncing value changes with immediate blur support.
|
|
27
21
|
*
|
|
28
|
-
* Provides immediate visual feedback by updating the
|
|
29
|
-
* while debouncing the actual
|
|
22
|
+
* Provides immediate visual feedback by updating the value instantly,
|
|
23
|
+
* while debouncing the actual onChange calls. When focus is lost,
|
|
30
24
|
* any pending debounced changes are immediately flushed.
|
|
31
25
|
*
|
|
32
26
|
* **Key Features:**
|
|
33
|
-
* - **Debouncing**: Delays
|
|
34
|
-
* - **
|
|
35
|
-
* - **
|
|
36
|
-
* - **Immediate display updates**: UI stays responsive during debouncing
|
|
27
|
+
* - **Debouncing**: Delays onChange calls until user stops typing
|
|
28
|
+
* - **Generic type support**: Works with any data type (strings, numbers, arrays, objects)
|
|
29
|
+
* - **Immediate value updates**: UI stays responsive during debouncing
|
|
37
30
|
* - **Blur flushing**: Immediately applies pending changes on blur
|
|
38
31
|
*
|
|
32
|
+
* **Note:** Value transformations should be handled at the `useUniformField` level,
|
|
33
|
+
* not in this hook. This hook only handles debouncing timing.
|
|
34
|
+
*
|
|
39
35
|
* @param options Configuration for debounced value handling
|
|
40
36
|
* @param options.debounceDelay Delay in milliseconds (default: 300)
|
|
41
37
|
* @param options.onBlur Function to call after flushing debounced value
|
|
42
38
|
* @param options.onChange Function to call with debounced value
|
|
43
|
-
* @param options.
|
|
44
|
-
* @
|
|
45
|
-
* @param options.value The initial form value
|
|
46
|
-
* @returns Object containing enhanced onChange, onBlur, and immediate display value
|
|
39
|
+
* @param options.value The field value
|
|
40
|
+
* @returns Object containing enhanced onChange, onBlur, and immediate value
|
|
47
41
|
*
|
|
48
42
|
* @example
|
|
49
43
|
* Basic usage with debouncing:
|
|
@@ -55,36 +49,7 @@ interface UseInputValueDebounceReturn {
|
|
|
55
49
|
* value: field.value,
|
|
56
50
|
* });
|
|
57
51
|
* ```
|
|
58
|
-
*
|
|
59
|
-
* @example
|
|
60
|
-
* Number input with automatic conversion:
|
|
61
|
-
* ```tsx
|
|
62
|
-
* const { onChange, onBlur, value } = useInputValueDebounce({
|
|
63
|
-
* debounceDelay: 300,
|
|
64
|
-
* onBlur: field.onBlur,
|
|
65
|
-
* onChange: field.onChange,
|
|
66
|
-
* type: 'number',
|
|
67
|
-
* value: field.value, // Display: 123 (number), Form: 123 (number)
|
|
68
|
-
* });
|
|
69
|
-
* ```
|
|
70
|
-
*
|
|
71
|
-
* @example
|
|
72
|
-
* Currency formatting with transforms:
|
|
73
|
-
* ```tsx
|
|
74
|
-
* const currencyTransform = {
|
|
75
|
-
* displayValue: (val) => val ? `$${Number(val).toFixed(2)}` : '',
|
|
76
|
-
* formValue: (val) => Number(val.replace(/[$,]/g, '')) || 0
|
|
77
|
-
* };
|
|
78
|
-
*
|
|
79
|
-
* const { onChange, onBlur, value } = useInputValueDebounce({
|
|
80
|
-
* debounceDelay: 300,
|
|
81
|
-
* onBlur: field.onBlur,
|
|
82
|
-
* onChange: field.onChange,
|
|
83
|
-
* transform: currencyTransform,
|
|
84
|
-
* value: field.value, // Display: "$100.00", Form: 100
|
|
85
|
-
* });
|
|
86
|
-
* ```
|
|
87
52
|
*/
|
|
88
|
-
declare const useInputValueDebounce: ({ debounceDelay, onBlur, onChange,
|
|
53
|
+
declare const useInputValueDebounce: <TValue = unknown>({ debounceDelay, onBlur, onChange, value, }: UseInputValueDebounceOptions<TValue>) => UseInputValueDebounceReturn<TValue>;
|
|
89
54
|
|
|
90
55
|
export { type UseInputValueDebounceOptions, type UseInputValueDebounceReturn, useInputValueDebounce };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk56TQOKG7cjs = require('../../chunk-56TQOKG7.cjs');
|
|
4
4
|
require('../../chunk-555JRYCS.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
exports.useInputValueTransform =
|
|
7
|
+
exports.useInputValueTransform = _chunk56TQOKG7cjs.useInputValueTransform;
|
|
8
8
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
interface InputValueTransform {
|
|
2
|
-
/** Transforms the form value to display value (e.g., 1000 → "$1,000") */
|
|
3
|
-
toDisplayValue: (value:
|
|
4
|
-
/** Transforms the display value to form value (e.g., "$1,000" → 1000) */
|
|
5
|
-
toFormValue: (value:
|
|
1
|
+
interface InputValueTransform<TDisplay = unknown> {
|
|
2
|
+
/** Transforms the form value to display value (e.g., 1000 → "$1,000" or 'a' → ['a']) */
|
|
3
|
+
toDisplayValue: (value: unknown) => TDisplay;
|
|
4
|
+
/** Transforms the display value to form value (e.g., "$1,000" → 1000 or ['a'] → 'a') */
|
|
5
|
+
toFormValue: (value: TDisplay) => unknown;
|
|
6
6
|
}
|
|
7
|
-
interface UseInputValueTransformOptions {
|
|
7
|
+
interface UseInputValueTransformOptions<TDisplay = unknown> {
|
|
8
8
|
/** Input type for special number handling */
|
|
9
9
|
type?: 'text' | 'number' | 'password';
|
|
10
10
|
/** Value transformation functions */
|
|
11
|
-
transform?: InputValueTransform
|
|
11
|
+
transform?: InputValueTransform<TDisplay>;
|
|
12
12
|
}
|
|
13
|
-
interface UseInputValueTransformReturn {
|
|
13
|
+
interface UseInputValueTransformReturn<TDisplay = unknown> {
|
|
14
14
|
/** Converts any form value to display value */
|
|
15
|
-
toDisplayValue: (formValue:
|
|
15
|
+
toDisplayValue: (formValue: unknown) => TDisplay;
|
|
16
16
|
/** Converts any display value to form value */
|
|
17
|
-
toFormValue: (displayValue:
|
|
17
|
+
toFormValue: (displayValue: TDisplay) => unknown;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* Custom hook providing utility functions for value transformations between display and form values.
|
|
@@ -24,9 +24,11 @@ interface UseInputValueTransformReturn {
|
|
|
24
24
|
* - Number inputs with special handling
|
|
25
25
|
* - Date formatting (MM/DD/YYYY display vs ISO date stored)
|
|
26
26
|
* - Phone number formatting ((555) 123-4567 display vs 5551234567 stored)
|
|
27
|
+
* - Array/Object transformations (single value ↔ array, nested structures)
|
|
27
28
|
*
|
|
28
29
|
* **Key Features:**
|
|
29
30
|
* - Pure conversion functions (no state)
|
|
31
|
+
* - Generic support for any data type (strings, numbers, arrays, objects)
|
|
30
32
|
* - Special number input handling (empty string preservation)
|
|
31
33
|
* - Bidirectional value transformations
|
|
32
34
|
* - Memoized functions for performance
|
|
@@ -38,8 +40,8 @@ interface UseInputValueTransformReturn {
|
|
|
38
40
|
* ```tsx
|
|
39
41
|
* // Currency formatting
|
|
40
42
|
* const currencyTransform = {
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
+
* toDisplayValue: (val) => val ? `$${Number(val).toLocaleString()}` : '',
|
|
44
|
+
* toFormValue: (val) => parseFloat(val.replace(/[$,]/g, '')) || 0
|
|
43
45
|
* };
|
|
44
46
|
*
|
|
45
47
|
* const { toDisplayValue, toFormValue } = useInputValueTransform({
|
|
@@ -63,6 +65,22 @@ interface UseInputValueTransformReturn {
|
|
|
63
65
|
*
|
|
64
66
|
* @example
|
|
65
67
|
* ```tsx
|
|
68
|
+
* // Array to single value (for single checkbox)
|
|
69
|
+
* const singleValueTransform = {
|
|
70
|
+
* toDisplayValue: (val: string[]) => val?.[0] || '',
|
|
71
|
+
* toFormValue: (val: string) => val ? [val] : []
|
|
72
|
+
* };
|
|
73
|
+
*
|
|
74
|
+
* const { toDisplayValue, toFormValue } = useInputValueTransform({
|
|
75
|
+
* transform: singleValueTransform
|
|
76
|
+
* });
|
|
77
|
+
*
|
|
78
|
+
* const displayVal = toDisplayValue(['option1']); // "option1"
|
|
79
|
+
* const formVal = toFormValue("option2"); // ["option2"]
|
|
80
|
+
* ```
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```tsx
|
|
66
84
|
* // Integration with debouncing
|
|
67
85
|
* const MyInput = ({ field, transform }) => {
|
|
68
86
|
* const transform = useInputValueTransform({ transform });
|
|
@@ -79,6 +97,6 @@ interface UseInputValueTransformReturn {
|
|
|
79
97
|
* };
|
|
80
98
|
* ```
|
|
81
99
|
*/
|
|
82
|
-
declare const useInputValueTransform: ({ type, transform, }: UseInputValueTransformOptions) => UseInputValueTransformReturn
|
|
100
|
+
declare const useInputValueTransform: <TDisplay = unknown>({ type, transform, }: UseInputValueTransformOptions<TDisplay>) => UseInputValueTransformReturn<TDisplay>;
|
|
83
101
|
|
|
84
102
|
export { type InputValueTransform, type UseInputValueTransformOptions, type UseInputValueTransformReturn, useInputValueTransform };
|