kui-complex 0.0.61 → 0.0.62
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/ButtonSelect/cjs/index.js +12 -14
- package/ButtonSelect/cjs/index.js.map +1 -1
- package/ButtonSelect/index.d.ts +12 -12
- package/ButtonSelect/index.js +12 -14
- package/ButtonSelect/index.js.map +1 -1
- package/CalendarHeaderWithSelect/cjs/index.js +12 -14
- package/CalendarHeaderWithSelect/cjs/index.js.map +1 -1
- package/CalendarHeaderWithSelect/index.d.ts +3 -3
- package/CalendarHeaderWithSelect/index.js +12 -14
- package/CalendarHeaderWithSelect/index.js.map +1 -1
- package/InputDropdown/cjs/index.js +2 -7
- package/InputDropdown/cjs/index.js.map +1 -1
- package/InputDropdown/index.js +2 -7
- package/InputDropdown/index.js.map +1 -1
- package/InputSelect/cjs/index.js +12 -14
- package/InputSelect/cjs/index.js.map +1 -1
- package/InputSelect/index.d.ts +12 -12
- package/InputSelect/index.js +12 -14
- package/InputSelect/index.js.map +1 -1
- package/InputSelectDropdown/cjs/index.js +2 -7
- package/InputSelectDropdown/cjs/index.js.map +1 -1
- package/InputSelectDropdown/index.d.ts +3 -3
- package/InputSelectDropdown/index.js +2 -7
- package/InputSelectDropdown/index.js.map +1 -1
- package/InputWithDatePicker/cjs/index.js +12 -14
- package/InputWithDatePicker/cjs/index.js.map +1 -1
- package/InputWithDatePicker/index.js +12 -14
- package/InputWithDatePicker/index.js.map +1 -1
- package/SelectMonth/cjs/index.js +12 -14
- package/SelectMonth/cjs/index.js.map +1 -1
- package/SelectMonth/index.d.ts +12 -12
- package/SelectMonth/index.js +12 -14
- package/SelectMonth/index.js.map +1 -1
- package/SelectYear/cjs/index.js +12 -14
- package/SelectYear/cjs/index.js.map +1 -1
- package/SelectYear/index.d.ts +12 -12
- package/SelectYear/index.js +12 -14
- package/SelectYear/index.js.map +1 -1
- package/TestForm/cjs/index.js +12 -14
- package/TestForm/cjs/index.js.map +1 -1
- package/TestForm/index.js +12 -14
- package/TestForm/index.js.map +1 -1
- package/cjs/index.js +12 -14
- package/cjs/index.js.map +1 -1
- package/index.d.ts +12 -12
- package/index.js +12 -14
- package/index.js.map +1 -1
- package/package.json +1 -1
package/TestForm/index.js
CHANGED
|
@@ -100,14 +100,11 @@ var InputDropdown = forwardRef(function (props, ref) {
|
|
|
100
100
|
};
|
|
101
101
|
});
|
|
102
102
|
useEffect(function () {
|
|
103
|
-
var _a
|
|
103
|
+
var _a;
|
|
104
104
|
if (buttonRef === null || buttonRef === void 0 ? void 0 : buttonRef.current) {
|
|
105
|
-
var inputMessage = (_a = buttonRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(".KUI-InputMessage");
|
|
106
105
|
if (isOpen) {
|
|
107
106
|
buttonRef.current.style.zIndex = "4";
|
|
108
|
-
|
|
109
|
-
inputMessage.style.opacity = "0";
|
|
110
|
-
var scrollContainer = (_b = dropdownRef.current) === null || _b === void 0 ? void 0 : _b.children[0].children[0];
|
|
107
|
+
var scrollContainer = (_a = dropdownRef.current) === null || _a === void 0 ? void 0 : _a.children[0].children[0];
|
|
111
108
|
if (scrollContainer) {
|
|
112
109
|
var hasScroll = scrollContainer.scrollHeight > scrollContainer.clientHeight;
|
|
113
110
|
setIsScrollable(hasScroll);
|
|
@@ -115,8 +112,6 @@ var InputDropdown = forwardRef(function (props, ref) {
|
|
|
115
112
|
}
|
|
116
113
|
else {
|
|
117
114
|
buttonRef.current.style.zIndex = "1";
|
|
118
|
-
if (inputMessage)
|
|
119
|
-
inputMessage.style.opacity = "1";
|
|
120
115
|
}
|
|
121
116
|
}
|
|
122
117
|
}, [isOpen]);
|
|
@@ -205,7 +200,7 @@ var getFormError = function (name, form) {
|
|
|
205
200
|
var InputSelect = forwardRef(function (props, ref) {
|
|
206
201
|
var _a, _b;
|
|
207
202
|
var options = props.options, name = props.name, handleChange = props.handleChange, form = props.form, iconProps = props.iconProps, defaultValue = props.value, other = __rest(props, ["options", "name", "handleChange", "form", "iconProps", "value"]);
|
|
208
|
-
var _c = useState(false),
|
|
203
|
+
var _c = useState(false), isDropdownOpen = _c[0], setIsDropdownOpen = _c[1];
|
|
209
204
|
var _d = useState(defaultValue || getFormValue(name, form)), value = _d[0], setValue = _d[1];
|
|
210
205
|
var error = getFormError(name, form);
|
|
211
206
|
var inputRef = useRef(null);
|
|
@@ -216,10 +211,10 @@ var InputSelect = forwardRef(function (props, ref) {
|
|
|
216
211
|
if ((_b = (_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.parentElement) {
|
|
217
212
|
(_d = (_c = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _c === void 0 ? void 0 : _c.parentElement) === null || _d === void 0 ? void 0 : _d.parentElement.focus();
|
|
218
213
|
}
|
|
219
|
-
|
|
214
|
+
setIsDropdownOpen(function (prev) { return !prev; });
|
|
220
215
|
};
|
|
221
216
|
var handleCloseDropdown = function () {
|
|
222
|
-
|
|
217
|
+
setIsDropdownOpen(false);
|
|
223
218
|
};
|
|
224
219
|
var handleSelect = function (option) {
|
|
225
220
|
setValue(option.value);
|
|
@@ -244,15 +239,18 @@ var InputSelect = forwardRef(function (props, ref) {
|
|
|
244
239
|
inputRef.current = e;
|
|
245
240
|
register === null || register === void 0 ? void 0 : register.ref(e);
|
|
246
241
|
};
|
|
247
|
-
return (jsxs$1(Wrapper$4, { children: [jsx$1("input", { name: name, autoComplete: "off", hidden: true }), jsx$1(StyledInput, __assign({ onClick: handleOpenDropdown, readOnly: true, value: selectedLabel, message: error }, other, { endIcon: !props.disabled && (jsx$1(HalfArrowIcon, __assign({ width: 12, height: 13, css: [
|
|
242
|
+
return (jsxs$1(Wrapper$4, { children: [jsx$1("input", { name: name, autoComplete: "off", hidden: true }), jsx$1(StyledInput, __assign({ onClick: handleOpenDropdown, readOnly: true, value: selectedLabel, message: error, isDropdownOpen: isDropdownOpen }, other, { endIcon: !props.disabled && (jsx$1(HalfArrowIcon, __assign({ width: 12, height: 13, css: [
|
|
248
243
|
{ transition: "all linear .2s" },
|
|
249
|
-
|
|
244
|
+
isDropdownOpen && { transform: "rotate(180deg)" },
|
|
250
245
|
] }, iconProps))) }, register, { ref: forwardedRef })), options && options.length > 0 && !props.disabled && (jsx$1(InputSelectDropdown, { options: options, inputRef: {
|
|
251
246
|
current: (_b = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _b === void 0 ? void 0 : _b.parentElement,
|
|
252
|
-
}, isOpenDropdown:
|
|
247
|
+
}, isOpenDropdown: isDropdownOpen, handleCloseDropdown: handleCloseDropdown, handleSelect: handleSelect, selectedValue: value }))] }));
|
|
253
248
|
});
|
|
254
249
|
var Wrapper$4 = styled.div(templateObject_1$b || (templateObject_1$b = __makeTemplateObject(["\n position: relative;\n text-align: left;\n width: fit-content;\n"], ["\n position: relative;\n text-align: left;\n width: fit-content;\n"])));
|
|
255
|
-
var StyledInput = styled(InputWithAdornments)(templateObject_2$5 || (templateObject_2$5 = __makeTemplateObject(["\n cursor: pointer;\n input,\n label {\n cursor: pointer !important;\n }\n"], ["\n cursor: pointer;\n input,\n label {\n cursor: pointer !important;\n }\n"])))
|
|
250
|
+
var StyledInput = styled(InputWithAdornments)(templateObject_2$5 || (templateObject_2$5 = __makeTemplateObject(["\n cursor: pointer;\n input,\n label {\n cursor: pointer !important;\n }\n .KUI-InputMessage {\n opacity: ", ";\n }\n"], ["\n cursor: pointer;\n input,\n label {\n cursor: pointer !important;\n }\n .KUI-InputMessage {\n opacity: ", ";\n }\n"])), function (_a) {
|
|
251
|
+
var isDropdownOpen = _a.isDropdownOpen;
|
|
252
|
+
return (isDropdownOpen ? 0 : 1);
|
|
253
|
+
});
|
|
256
254
|
var templateObject_1$b, templateObject_2$5;
|
|
257
255
|
|
|
258
256
|
var InputForDatepicker = forwardRef(function (props, ref) {
|