@giro-ds/react 1.0.1 → 1.0.3
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/components/Table/TableHeader.d.ts +1 -0
- package/dist/index.cjs +21 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +21 -9
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.esm.js
CHANGED
|
@@ -771,14 +771,17 @@ const TextField = ({ name = 'textfield', className = '', value = '', label = '',
|
|
|
771
771
|
}
|
|
772
772
|
}, [disabled, onChange]);
|
|
773
773
|
const onBlur = useCallback(() => {
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
774
|
+
// Se já existe um errorMessage externo, não validar internamente
|
|
775
|
+
if (!errorMessage) {
|
|
776
|
+
const error = validateInput({
|
|
777
|
+
value: inputValue,
|
|
778
|
+
type,
|
|
779
|
+
maxLength,
|
|
780
|
+
errorMessage,
|
|
781
|
+
required,
|
|
782
|
+
}) || '';
|
|
783
|
+
setInputError(error);
|
|
784
|
+
}
|
|
782
785
|
setFocus(false);
|
|
783
786
|
}, [inputValue, type, maxLength, errorMessage, required]);
|
|
784
787
|
useEffect(() => {
|
|
@@ -786,6 +789,15 @@ const TextField = ({ name = 'textfield', className = '', value = '', label = '',
|
|
|
786
789
|
setValue(value);
|
|
787
790
|
}
|
|
788
791
|
}, [value]);
|
|
792
|
+
// Sincroniza errorMessage externo com estado interno
|
|
793
|
+
useEffect(() => {
|
|
794
|
+
if (errorMessage) {
|
|
795
|
+
setInputError(errorMessage);
|
|
796
|
+
}
|
|
797
|
+
else if (!errorMessage && inputError && !required) {
|
|
798
|
+
setInputError('');
|
|
799
|
+
}
|
|
800
|
+
}, [errorMessage]);
|
|
789
801
|
const TextFieldClass = clsx(styles$j['zds-textfield__container'], {
|
|
790
802
|
[styles$j['zds-textfield__error']]: inputError,
|
|
791
803
|
[styles$j['zds-textfield__disabled']]: disabled,
|
|
@@ -6809,7 +6821,7 @@ const TableHeader = ({ searchValue = '', onSearchChange, onSearch, searchPlaceho
|
|
|
6809
6821
|
onClose: () => filterItem.onToggle?.(false),
|
|
6810
6822
|
};
|
|
6811
6823
|
if (isCalendarFilter(filterItem)) {
|
|
6812
|
-
return (jsx(Filter, { ...commonProps, type: "calendar", selectedDate: filterItem.selectedDate, onDateSelect: filterItem.onDateSelect, minDate: filterItem.minDate, maxDate: filterItem.maxDate, placeholder: filterItem.placeholder }));
|
|
6824
|
+
return (jsx(Filter, { ...commonProps, type: "calendar", selectedDate: filterItem.selectedDate, onDateSelect: filterItem.onDateSelect, onClearDate: filterItem.onClear, minDate: filterItem.minDate, maxDate: filterItem.maxDate, placeholder: filterItem.placeholder }));
|
|
6813
6825
|
}
|
|
6814
6826
|
if (isCheckboxFilter(filterItem)) {
|
|
6815
6827
|
return (jsx(Filter, { ...commonProps, type: filterItem.type, items: filterItem.items, selectedIds: filterItem.selectedIds, onApplyFilter: filterItem.onSelectionChange, placeholder: filterItem.placeholder, enableSearch: filterItem.enableSearch }));
|