kui-complex 0.0.23 → 0.0.25

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,14 +203,12 @@ 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);
215
213
  var handleOpenDropdown = function () {
216
214
  var _a, _b, _c, _d;
@@ -250,11 +248,11 @@ var InputSelect = forwardRef(function (props, ref) {
250
248
  isOpenDropdown && { transform: "rotate(180deg)" },
251
249
  ] }, iconProps)) })) }, register, { ref: forwardedRef })), options && options.length > 0 && !props.disabled && (jsx$1(InputSelectDropdown, { options: options, inputRef: {
252
250
  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 }))] }));
251
+ }, isOpenDropdown: isOpenDropdown, handleCloseDropdown: handleCloseDropdown, handleSelect: handleSelect, selectedValue: value }))] }));
254
252
  });
255
253
  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
254
  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"])));
255
+ 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
256
  var templateObject_1$n, templateObject_2$a, templateObject_3$4;
259
257
 
260
258
  var SelectYear = function (_a) {
@@ -930,7 +928,7 @@ var ButtonSelect = forwardRef(function (props, ref) {
930
928
  var options = props.options, otherProps = __rest(props, ["options"]);
931
929
  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
930
  });
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);
931
+ 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: 48px;\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: 48px;\n }\n"])));
934
932
  var templateObject_1;
935
933
 
936
934
  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 };