kui-complex 0.0.23 → 0.0.24

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/index.es.js CHANGED
@@ -203,15 +203,14 @@ var getFormError = function (name, form) {
203
203
 
204
204
  var InputSelect = forwardRef(function (props, ref) {
205
205
  var _a, _b, _c;
206
- var options = props.options, name = props.name, handleChange = props.handleChange, form = props.form, iconProps = props.iconProps, other = __rest(props, ["options", "name", "handleChange", "form", "iconProps"]);
206
+ 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"]);
207
207
  var _d = useState(false), isOpenDropdown = _d[0], setIsOpenDropDown = _d[1];
208
- var _e = useState(getFormValue(name, form)), value = _e[0], setValue = _e[1];
208
+ var _e = useState(defaultValue || getFormValue(name, form)), value = _e[0], setValue = _e[1];
209
209
  var error = getFormError(name, form);
210
210
  var inputRef = useRef(null);
211
- var selectedLabel = (_a = options === null || options === void 0 ? void 0 : options.find(function (option) {
212
- return String(option.value) === String(other.value || value);
213
- })) === null || _a === void 0 ? void 0 : _a.label;
211
+ var selectedLabel = (_a = options === null || options === void 0 ? void 0 : options.find(function (option) { return String(option.value) === String(value); })) === null || _a === void 0 ? void 0 : _a.label;
214
212
  var register = form === null || form === void 0 ? void 0 : form.register(name);
213
+ console.log(value, selectedLabel, register, other);
215
214
  var handleOpenDropdown = function () {
216
215
  var _a, _b, _c, _d;
217
216
  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) {
@@ -250,11 +249,11 @@ var InputSelect = forwardRef(function (props, ref) {
250
249
  isOpenDropdown && { transform: "rotate(180deg)" },
251
250
  ] }, iconProps)) })) }, register, { ref: forwardedRef })), options && options.length > 0 && !props.disabled && (jsx$1(InputSelectDropdown, { options: options, inputRef: {
252
251
  current: (_c = (_b = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _b === void 0 ? void 0 : _b.parentElement) === null || _c === void 0 ? void 0 : _c.parentElement,
253
- }, isOpenDropdown: isOpenDropdown, handleCloseDropdown: handleCloseDropdown, handleSelect: handleSelect, selectedValue: other.value || value }))] }));
252
+ }, isOpenDropdown: isOpenDropdown, handleCloseDropdown: handleCloseDropdown, handleSelect: handleSelect, selectedValue: value }))] }));
254
253
  });
255
254
  var Wrapper$6 = styled.div(templateObject_1$n || (templateObject_1$n = __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"])));
256
255
  var StyledInput = styled(InputWithAdornments)(templateObject_2$a || (templateObject_2$a = __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"])));
257
- var StyledIconWrapper = styled.div(templateObject_3$4 || (templateObject_3$4 = __makeTemplateObject(["\n padding-right: 8px;\n"], ["\n padding-right: 8px;\n"])));
256
+ var StyledIconWrapper = styled.div(templateObject_3$4 || (templateObject_3$4 = __makeTemplateObject(["\n padding-right: 8px;\n padding-bottom: 4px;\n"], ["\n padding-right: 8px;\n padding-bottom: 4px;\n"])));
258
257
  var templateObject_1$n, templateObject_2$a, templateObject_3$4;
259
258
 
260
259
  var SelectYear = function (_a) {
@@ -930,7 +929,7 @@ var ButtonSelect = forwardRef(function (props, ref) {
930
929
  var options = props.options, otherProps = __rest(props, ["options"]);
931
930
  return (jsx(StyledInputSelect, __assign({ value: options === null || options === void 0 ? void 0 : options[0].value, options: options, iconProps: { width: 9, height: 5 } }, otherProps, { ref: ref })));
932
931
  });
933
- var StyledInputSelect = styled(InputSelect)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &.KUI-Input_container {\n height: 32px;\n width: fit-content;\n input {\n height: 32px;\n border-radius: 66px;\n padding: 0 12px;\n color: ", ";\n transform: none;\n font-size: 12px;\n line-height: 14px;\n margin: 0 !important;\n width: auto !important;\n }\n }\n & + div {\n top: 40px;\n }\n"], ["\n &.KUI-Input_container {\n height: 32px;\n width: fit-content;\n input {\n height: 32px;\n border-radius: 66px;\n padding: 0 12px;\n color: ", ";\n transform: none;\n font-size: 12px;\n line-height: 14px;\n margin: 0 !important;\n width: auto !important;\n }\n }\n & + div {\n top: 40px;\n }\n"])), theme.palette.grey.fiftyP);
932
+ var StyledInputSelect = styled(InputSelect)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &.KUI-Input_container {\n height: 40px;\n width: fit-content;\n input {\n height: 40px;\n border-radius: 66px;\n padding: 0 12px;\n transform: none;\n font-size: 12px;\n line-height: 14px;\n margin: 0 !important;\n width: auto !important;\n }\n }\n & + div {\n top: 40px;\n }\n"], ["\n &.KUI-Input_container {\n height: 40px;\n width: fit-content;\n input {\n height: 40px;\n border-radius: 66px;\n padding: 0 12px;\n transform: none;\n font-size: 12px;\n line-height: 14px;\n margin: 0 !important;\n width: auto !important;\n }\n }\n & + div {\n top: 40px;\n }\n"])));
934
933
  var templateObject_1;
935
934
 
936
935
  export { Avatar, ButtonSelect, ButtonTab, ButtonsPanel, CalendarHeaderWithSelect, CalendarStandardContainer, CalendarStandardHeader, DesktopInputWithMonthPicker, DesktopMenuPanel, InputDropdown, InputForDatepicker, InputPassword, InputPhoneWithForm, InputSelect, InputSelectDropdown, InputTextAreaMobile, InputWithController, InputWithDatePicker, InputWithMask, InputWithMonthPicker, MenuItem, MenuPanel, MobileInputWithMonthPicker, MobileMenuPanel, MonthPickerContainer, MonthPickerHeader, PassportStrengthBar, SelectMonth, SelectYear, Switch, Table, TableCell, TableHeadCell, TableRow, Tooltip, UndefinedAvatar };