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/esm/index.js
CHANGED
|
@@ -61541,7 +61541,7 @@ function ExitIcon(props) {
|
|
|
61541
61541
|
}
|
|
61542
61542
|
|
|
61543
61543
|
function InfoIcon(props) {
|
|
61544
|
-
return (
|
|
61544
|
+
return (jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("g", { "clip-path": "url(#clip0_11224_1706)", children: 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" }) }), jsx("defs", { children: jsx("clipPath", { id: "clip0_11224_1706", children: jsx("rect", { width: "16", height: "16", fill: "white" }) }) })] }));
|
|
61545
61545
|
}
|
|
61546
61546
|
|
|
61547
61547
|
function CheckIcon(props) {
|
|
@@ -64927,13 +64927,27 @@ FISInputLabel.displayName = "FISInputLabel";
|
|
|
64927
64927
|
|
|
64928
64928
|
const FISInputText = forwardRef((props, ref) => {
|
|
64929
64929
|
const { className, typeSuffix, textLabel = "", iconLabel, required, iconPrefix, sizeInput, showCount, message, negative, positive, maxLength = 500, disabled, onChange, onEnter, onKeyDown, onClickIconLabel, onClickSuffix, ...rest } = props;
|
|
64930
|
-
const [internalValue, setInternalValue] = React__default.useState("");
|
|
64930
|
+
const [internalValue, setInternalValue] = React__default.useState(rest.value || rest.defaultValue || "");
|
|
64931
|
+
// Sync internal value with controlled value prop
|
|
64932
|
+
React__default.useEffect(() => {
|
|
64933
|
+
if (rest.value !== undefined) {
|
|
64934
|
+
setInternalValue(rest.value);
|
|
64935
|
+
}
|
|
64936
|
+
}, [rest.value]);
|
|
64937
|
+
// Get current value for display (controlled vs uncontrolled)
|
|
64938
|
+
const getCurrentValue = () => {
|
|
64939
|
+
return rest.value !== undefined ? rest.value : internalValue;
|
|
64940
|
+
};
|
|
64931
64941
|
const handleChange = React__default.useCallback((event) => {
|
|
64932
|
-
|
|
64942
|
+
const newValue = event.target.value;
|
|
64943
|
+
// Only update internal state if not controlled
|
|
64944
|
+
if (rest.value === undefined) {
|
|
64945
|
+
setInternalValue(newValue);
|
|
64946
|
+
}
|
|
64933
64947
|
if (onChange) {
|
|
64934
64948
|
onChange(event);
|
|
64935
64949
|
}
|
|
64936
|
-
}, [onChange]);
|
|
64950
|
+
}, [onChange, rest.value]);
|
|
64937
64951
|
const handleKeyPress = React__default.useCallback((event) => {
|
|
64938
64952
|
if (!event)
|
|
64939
64953
|
return;
|
|
@@ -64948,8 +64962,8 @@ const FISInputText = forwardRef((props, ref) => {
|
|
|
64948
64962
|
negative: negative,
|
|
64949
64963
|
positive: positive,
|
|
64950
64964
|
}), children: message ? message : "" }), showCount && maxLength > 0 && (jsxs(SpanCountSC, { className: classNames({
|
|
64951
|
-
negative:
|
|
64952
|
-
}), children: [
|
|
64965
|
+
negative: getCurrentValue()?.length > maxLength,
|
|
64966
|
+
}), children: [getCurrentValue()?.length, "/", maxLength] }))] }))] }));
|
|
64953
64967
|
});
|
|
64954
64968
|
FISInputText.displayName = "FISInputText";
|
|
64955
64969
|
|
|
@@ -71216,10 +71230,12 @@ const DivInputWrapperSC$1 = styled.div `
|
|
|
71216
71230
|
width: 100%;
|
|
71217
71231
|
`;
|
|
71218
71232
|
const HiddenDatePickerSC = styled(DatePicker) `
|
|
71233
|
+
top: 0;
|
|
71234
|
+
background-color: red;
|
|
71219
71235
|
position: absolute;
|
|
71236
|
+
height: 100%;
|
|
71220
71237
|
opacity: 0;
|
|
71221
71238
|
z-index: -1;
|
|
71222
|
-
height: 0;
|
|
71223
71239
|
`;
|
|
71224
71240
|
|
|
71225
71241
|
/**
|
|
@@ -73909,7 +73925,7 @@ const FISPagination = ({ pageSize = LIMIT_DEFAULT, current = 1, total = 0, minim
|
|
|
73909
73925
|
current * pageSize > total ? total : current * pageSize,
|
|
73910
73926
|
];
|
|
73911
73927
|
}, [current, pageSize, total]);
|
|
73912
|
-
const defaultShowTotal = (jsxs(Fragment, { children: ["Hi\u1EC3n th\u1ECB ", rangeRecords[0], "-", rangeRecords[1], recordCounted ? (`trong ${total} bản ghi`) : (jsx(FISIconButton, { size: "xs", icon: jsx(InfoIcon, {}), variant: "tertiary-invisible", onClick: onIconPageRecordClick }))] }));
|
|
73928
|
+
const defaultShowTotal = (jsxs(Fragment, { children: ["Hi\u1EC3n th\u1ECB ", rangeRecords[0], "-", rangeRecords[1], recordCounted ? (` trong ${total} bản ghi`) : (jsx(FISIconButton, { size: "xs", icon: jsx(InfoIcon, {}), variant: "tertiary-invisible", onClick: onIconPageRecordClick }))] }));
|
|
73913
73929
|
// Merge the default props with the provided props
|
|
73914
73930
|
const mergedProps = {
|
|
73915
73931
|
size: "small",
|