@itcase/forms 1.1.39 → 1.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/itcase-forms.cjs.js +15 -4
- package/dist/itcase-forms.esm.js +15 -4
- package/package.json +1 -1
package/dist/itcase-forms.cjs.js
CHANGED
|
@@ -479,6 +479,7 @@ const FileInputDropzone = /*#__PURE__*/React__default.default.memo(function File
|
|
|
479
479
|
thumbColumn,
|
|
480
480
|
isPreviews,
|
|
481
481
|
onAddFiles,
|
|
482
|
+
onClickPreview,
|
|
482
483
|
onDeleteFile
|
|
483
484
|
} = props;
|
|
484
485
|
|
|
@@ -661,6 +662,9 @@ const FileInputDropzone = /*#__PURE__*/React__default.default.memo(function File
|
|
|
661
662
|
}, /*#__PURE__*/React__default.default.createElement("img", {
|
|
662
663
|
className: "form-dropzone__thumb-image-inner",
|
|
663
664
|
src: file.preview || file.image,
|
|
665
|
+
onClick: event => {
|
|
666
|
+
onClickPreview && onClickPreview(file, event);
|
|
667
|
+
},
|
|
664
668
|
onLoad: () => {
|
|
665
669
|
// Revoke data uri after image is loaded
|
|
666
670
|
URL.revokeObjectURL(file.preview);
|
|
@@ -820,6 +824,7 @@ const FileInput = /*#__PURE__*/React__default.default.memo(function FileInput(pr
|
|
|
820
824
|
isPreviews,
|
|
821
825
|
isRequired,
|
|
822
826
|
onAddFiles,
|
|
827
|
+
onClickPreview,
|
|
823
828
|
onDeleteFile
|
|
824
829
|
} = props;
|
|
825
830
|
const propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props);
|
|
@@ -954,6 +959,7 @@ const FileInput = /*#__PURE__*/React__default.default.memo(function FileInput(pr
|
|
|
954
959
|
thumbNameTextWrap: thumbNameTextWrap,
|
|
955
960
|
isPreviews: isPreviews,
|
|
956
961
|
onAddFiles: onAddFiles,
|
|
962
|
+
onClickPreview: onClickPreview,
|
|
957
963
|
onDeleteFile: onDeleteFile
|
|
958
964
|
}));
|
|
959
965
|
});
|
|
@@ -1379,8 +1385,8 @@ const FormFieldCode = /*#__PURE__*/React__default.default.memo(function FormFiel
|
|
|
1379
1385
|
const {
|
|
1380
1386
|
name,
|
|
1381
1387
|
initialValue,
|
|
1382
|
-
messageType,
|
|
1383
1388
|
label,
|
|
1389
|
+
messageType,
|
|
1384
1390
|
isDisabled,
|
|
1385
1391
|
classNameGroupItem,
|
|
1386
1392
|
fieldProps = {},
|
|
@@ -1433,9 +1439,9 @@ const FormFieldCode = /*#__PURE__*/React__default.default.memo(function FormFiel
|
|
|
1433
1439
|
isValidState: isValidState
|
|
1434
1440
|
}, fieldProps), /*#__PURE__*/React__default.default.createElement(Code.Code, Object.assign({
|
|
1435
1441
|
name: input.name,
|
|
1442
|
+
initialValue: input.value,
|
|
1436
1443
|
isDisabled: isDisabled,
|
|
1437
1444
|
autoComplete: "nope",
|
|
1438
|
-
value: input.value,
|
|
1439
1445
|
onBlur: input.onBlur,
|
|
1440
1446
|
onChange: input.onChange,
|
|
1441
1447
|
onFocus: input.onFocus
|
|
@@ -2237,9 +2243,9 @@ const FormFieldMaskedInput = /*#__PURE__*/React__default.default.memo(function F
|
|
|
2237
2243
|
|
|
2238
2244
|
const {
|
|
2239
2245
|
ref,
|
|
2246
|
+
setUnmaskedValue,
|
|
2240
2247
|
unmaskedValue,
|
|
2241
|
-
value
|
|
2242
|
-
setUnmaskedValue
|
|
2248
|
+
value
|
|
2243
2249
|
} = reactImask.useIMask(optionsMask, {
|
|
2244
2250
|
onAccept: (newValue, event, element) => {
|
|
2245
2251
|
if (element) {
|
|
@@ -2252,6 +2258,11 @@ const FormFieldMaskedInput = /*#__PURE__*/React__default.default.memo(function F
|
|
|
2252
2258
|
setUnmaskedValue(input.value.replace(unmasked, ''));
|
|
2253
2259
|
}
|
|
2254
2260
|
}, [input.value]);
|
|
2261
|
+
React.useEffect(() => {
|
|
2262
|
+
if (unmaskedValue !== input.value) {
|
|
2263
|
+
input.onChange(unmaskedValue);
|
|
2264
|
+
}
|
|
2265
|
+
}, [unmaskedValue]);
|
|
2255
2266
|
const {
|
|
2256
2267
|
errorKey,
|
|
2257
2268
|
errorMessage,
|
package/dist/itcase-forms.esm.js
CHANGED
|
@@ -468,6 +468,7 @@ const FileInputDropzone = /*#__PURE__*/React.memo(function FileInputDropzone(pro
|
|
|
468
468
|
thumbColumn,
|
|
469
469
|
isPreviews,
|
|
470
470
|
onAddFiles,
|
|
471
|
+
onClickPreview,
|
|
471
472
|
onDeleteFile
|
|
472
473
|
} = props;
|
|
473
474
|
|
|
@@ -650,6 +651,9 @@ const FileInputDropzone = /*#__PURE__*/React.memo(function FileInputDropzone(pro
|
|
|
650
651
|
}, /*#__PURE__*/React.createElement("img", {
|
|
651
652
|
className: "form-dropzone__thumb-image-inner",
|
|
652
653
|
src: file.preview || file.image,
|
|
654
|
+
onClick: event => {
|
|
655
|
+
onClickPreview && onClickPreview(file, event);
|
|
656
|
+
},
|
|
653
657
|
onLoad: () => {
|
|
654
658
|
// Revoke data uri after image is loaded
|
|
655
659
|
URL.revokeObjectURL(file.preview);
|
|
@@ -809,6 +813,7 @@ const FileInput = /*#__PURE__*/React.memo(function FileInput(props) {
|
|
|
809
813
|
isPreviews,
|
|
810
814
|
isRequired,
|
|
811
815
|
onAddFiles,
|
|
816
|
+
onClickPreview,
|
|
812
817
|
onDeleteFile
|
|
813
818
|
} = props;
|
|
814
819
|
const propsGenerator = useDevicePropsGenerator(props);
|
|
@@ -943,6 +948,7 @@ const FileInput = /*#__PURE__*/React.memo(function FileInput(props) {
|
|
|
943
948
|
thumbNameTextWrap: thumbNameTextWrap,
|
|
944
949
|
isPreviews: isPreviews,
|
|
945
950
|
onAddFiles: onAddFiles,
|
|
951
|
+
onClickPreview: onClickPreview,
|
|
946
952
|
onDeleteFile: onDeleteFile
|
|
947
953
|
}));
|
|
948
954
|
});
|
|
@@ -1368,8 +1374,8 @@ const FormFieldCode = /*#__PURE__*/React.memo(function FormFieldCode(props) {
|
|
|
1368
1374
|
const {
|
|
1369
1375
|
name,
|
|
1370
1376
|
initialValue,
|
|
1371
|
-
messageType,
|
|
1372
1377
|
label,
|
|
1378
|
+
messageType,
|
|
1373
1379
|
isDisabled,
|
|
1374
1380
|
classNameGroupItem,
|
|
1375
1381
|
fieldProps = {},
|
|
@@ -1422,9 +1428,9 @@ const FormFieldCode = /*#__PURE__*/React.memo(function FormFieldCode(props) {
|
|
|
1422
1428
|
isValidState: isValidState
|
|
1423
1429
|
}, fieldProps), /*#__PURE__*/React.createElement(Code, Object.assign({
|
|
1424
1430
|
name: input.name,
|
|
1431
|
+
initialValue: input.value,
|
|
1425
1432
|
isDisabled: isDisabled,
|
|
1426
1433
|
autoComplete: "nope",
|
|
1427
|
-
value: input.value,
|
|
1428
1434
|
onBlur: input.onBlur,
|
|
1429
1435
|
onChange: input.onChange,
|
|
1430
1436
|
onFocus: input.onFocus
|
|
@@ -2226,9 +2232,9 @@ const FormFieldMaskedInput = /*#__PURE__*/React.memo(function FormFieldMaskedInp
|
|
|
2226
2232
|
|
|
2227
2233
|
const {
|
|
2228
2234
|
ref,
|
|
2235
|
+
setUnmaskedValue,
|
|
2229
2236
|
unmaskedValue,
|
|
2230
|
-
value
|
|
2231
|
-
setUnmaskedValue
|
|
2237
|
+
value
|
|
2232
2238
|
} = useIMask(optionsMask, {
|
|
2233
2239
|
onAccept: (newValue, event, element) => {
|
|
2234
2240
|
if (element) {
|
|
@@ -2241,6 +2247,11 @@ const FormFieldMaskedInput = /*#__PURE__*/React.memo(function FormFieldMaskedInp
|
|
|
2241
2247
|
setUnmaskedValue(input.value.replace(unmasked, ''));
|
|
2242
2248
|
}
|
|
2243
2249
|
}, [input.value]);
|
|
2250
|
+
useEffect(() => {
|
|
2251
|
+
if (unmaskedValue !== input.value) {
|
|
2252
|
+
input.onChange(unmaskedValue);
|
|
2253
|
+
}
|
|
2254
|
+
}, [unmaskedValue]);
|
|
2244
2255
|
const {
|
|
2245
2256
|
errorKey,
|
|
2246
2257
|
errorMessage,
|