fis-component 0.0.83 → 0.0.85
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/cjs/index.js +24 -8
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +24 -8
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -61561,7 +61561,7 @@ function ExitIcon(props) {
|
|
|
61561
61561
|
}
|
|
61562
61562
|
|
|
61563
61563
|
function InfoIcon(props) {
|
|
61564
|
-
return (jsxRuntime.
|
|
61564
|
+
return (jsxRuntime.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntime.jsx("g", { "clip-path": "url(#clip0_11224_1706)", children: jsxRuntime.jsx("path", { d: "M7.99992 10.6666V7.99992M7.99992 5.33325H8.00659M14.6666 7.99992C14.6666 11.6818 11.6818 14.6666 7.99992 14.6666C4.31802 14.6666 1.33325 11.6818 1.33325 7.99992C1.33325 4.31802 4.31802 1.33325 7.99992 1.33325C11.6818 1.33325 14.6666 4.31802 14.6666 7.99992Z", stroke: "#505A5F", "stroke-linecap": "round", "stroke-linejoin": "round" }) }), jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", { id: "clip0_11224_1706", children: jsxRuntime.jsx("rect", { width: "16", height: "16", fill: "white" }) }) })] }));
|
|
61565
61565
|
}
|
|
61566
61566
|
|
|
61567
61567
|
function CheckIcon(props) {
|
|
@@ -64947,13 +64947,27 @@ FISInputLabel.displayName = "FISInputLabel";
|
|
|
64947
64947
|
|
|
64948
64948
|
const FISInputText = React.forwardRef((props, ref) => {
|
|
64949
64949
|
const { className, typeSuffix, textLabel = "", iconLabel, required, iconPrefix, sizeInput, showCount, message, negative, positive, maxLength = 500, disabled, onChange, onEnter, onKeyDown, onClickIconLabel, onClickSuffix, ...rest } = props;
|
|
64950
|
-
const [internalValue, setInternalValue] = React.useState("");
|
|
64950
|
+
const [internalValue, setInternalValue] = React.useState(rest.value || rest.defaultValue || "");
|
|
64951
|
+
// Sync internal value with controlled value prop
|
|
64952
|
+
React.useEffect(() => {
|
|
64953
|
+
if (rest.value !== undefined) {
|
|
64954
|
+
setInternalValue(rest.value);
|
|
64955
|
+
}
|
|
64956
|
+
}, [rest.value]);
|
|
64957
|
+
// Get current value for display (controlled vs uncontrolled)
|
|
64958
|
+
const getCurrentValue = () => {
|
|
64959
|
+
return rest.value !== undefined ? rest.value : internalValue;
|
|
64960
|
+
};
|
|
64951
64961
|
const handleChange = React.useCallback((event) => {
|
|
64952
|
-
|
|
64962
|
+
const newValue = event.target.value;
|
|
64963
|
+
// Only update internal state if not controlled
|
|
64964
|
+
if (rest.value === undefined) {
|
|
64965
|
+
setInternalValue(newValue);
|
|
64966
|
+
}
|
|
64953
64967
|
if (onChange) {
|
|
64954
64968
|
onChange(event);
|
|
64955
64969
|
}
|
|
64956
|
-
}, [onChange]);
|
|
64970
|
+
}, [onChange, rest.value]);
|
|
64957
64971
|
const handleKeyPress = React.useCallback((event) => {
|
|
64958
64972
|
if (!event)
|
|
64959
64973
|
return;
|
|
@@ -64968,8 +64982,8 @@ const FISInputText = React.forwardRef((props, ref) => {
|
|
|
64968
64982
|
negative: negative,
|
|
64969
64983
|
positive: positive,
|
|
64970
64984
|
}), children: message ? message : "" }), showCount && maxLength > 0 && (jsxRuntime.jsxs(SpanCountSC, { className: classNames({
|
|
64971
|
-
negative:
|
|
64972
|
-
}), children: [
|
|
64985
|
+
negative: getCurrentValue()?.length > maxLength,
|
|
64986
|
+
}), children: [getCurrentValue()?.length, "/", maxLength] }))] }))] }));
|
|
64973
64987
|
});
|
|
64974
64988
|
FISInputText.displayName = "FISInputText";
|
|
64975
64989
|
|
|
@@ -71236,10 +71250,12 @@ const DivInputWrapperSC$1 = styled.div `
|
|
|
71236
71250
|
width: 100%;
|
|
71237
71251
|
`;
|
|
71238
71252
|
const HiddenDatePickerSC = styled(DatePicker) `
|
|
71253
|
+
top: 0;
|
|
71254
|
+
background-color: red;
|
|
71239
71255
|
position: absolute;
|
|
71256
|
+
height: 100%;
|
|
71240
71257
|
opacity: 0;
|
|
71241
71258
|
z-index: -1;
|
|
71242
|
-
height: 0;
|
|
71243
71259
|
`;
|
|
71244
71260
|
|
|
71245
71261
|
/**
|
|
@@ -73929,7 +73945,7 @@ const FISPagination = ({ pageSize = LIMIT_DEFAULT, current = 1, total = 0, minim
|
|
|
73929
73945
|
current * pageSize > total ? total : current * pageSize,
|
|
73930
73946
|
];
|
|
73931
73947
|
}, [current, pageSize, total]);
|
|
73932
|
-
const defaultShowTotal = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: ["Hi\u1EC3n th\u1ECB ", rangeRecords[0], "-", rangeRecords[1], recordCounted ? (`trong ${total} bản ghi`) : (jsxRuntime.jsx(FISIconButton, { size: "xs", icon: jsxRuntime.jsx(InfoIcon, {}), variant: "tertiary-invisible", onClick: onIconPageRecordClick }))] }));
|
|
73948
|
+
const defaultShowTotal = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: ["Hi\u1EC3n th\u1ECB ", rangeRecords[0], "-", rangeRecords[1], recordCounted ? (` trong ${total} bản ghi`) : (jsxRuntime.jsx(FISIconButton, { size: "xs", icon: jsxRuntime.jsx(InfoIcon, {}), variant: "tertiary-invisible", onClick: onIconPageRecordClick }))] }));
|
|
73933
73949
|
// Merge the default props with the provided props
|
|
73934
73950
|
const mergedProps = {
|
|
73935
73951
|
size: "small",
|