kui-complex 0.0.98 → 0.0.100
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 +16 -59
- package/ButtonSelect/cjs/index.js.map +1 -1
- package/ButtonSelect/index.js +1 -26
- package/ButtonSelect/index.js.map +1 -1
- package/ButtonsPanel/cjs/index.js +2 -22
- package/ButtonsPanel/cjs/index.js.map +1 -1
- package/ButtonsPanel/index.js +1 -21
- package/ButtonsPanel/index.js.map +1 -1
- package/CalendarHeaderWithSelect/cjs/index.js +18 -61
- package/CalendarHeaderWithSelect/cjs/index.js.map +1 -1
- package/CalendarHeaderWithSelect/index.js +1 -26
- package/CalendarHeaderWithSelect/index.js.map +1 -1
- package/FileItem/cjs/index.js +2 -22
- package/FileItem/cjs/index.js.map +1 -1
- package/FileItem/index.js +1 -21
- package/FileItem/index.js.map +1 -1
- package/InputFile/cjs/index.js +2 -22
- package/InputFile/cjs/index.js.map +1 -1
- package/InputFile/index.js +1 -21
- package/InputFile/index.js.map +1 -1
- package/InputMultiSelect/cjs/index.js +14 -57
- package/InputMultiSelect/cjs/index.js.map +1 -1
- package/InputMultiSelect/index.js +1 -26
- package/InputMultiSelect/index.js.map +1 -1
- package/InputPassword/cjs/index.js +4 -7
- package/InputPassword/cjs/index.js.map +1 -1
- package/InputPassword/index.js +1 -4
- package/InputPassword/index.js.map +1 -1
- package/InputPhoneWithForm/cjs/index.js +4 -48
- package/InputPhoneWithForm/cjs/index.js.map +1 -1
- package/InputPhoneWithForm/index.js +1 -26
- package/InputPhoneWithForm/index.js.map +1 -1
- package/InputSelect/cjs/index.js +15 -58
- package/InputSelect/cjs/index.js.map +1 -1
- package/InputSelect/index.js +1 -26
- package/InputSelect/index.js.map +1 -1
- package/InputSelectBase/cjs/index.js +12 -55
- package/InputSelectBase/cjs/index.js.map +1 -1
- package/InputSelectBase/index.js +1 -26
- package/InputSelectBase/index.js.map +1 -1
- package/InputSelectWithController/cjs/index.js +16 -59
- package/InputSelectWithController/cjs/index.js.map +1 -1
- package/InputSelectWithController/index.js +1 -26
- package/InputSelectWithController/index.js.map +1 -1
- package/InputWithAutocomplete/cjs/index.js +13 -68
- package/InputWithAutocomplete/cjs/index.js.map +1 -1
- package/InputWithAutocomplete/index.js +1 -38
- package/InputWithAutocomplete/index.js.map +1 -1
- package/InputWithDatePicker/cjs/index.js +28 -85
- package/InputWithDatePicker/cjs/index.js.map +1 -1
- package/InputWithDatePicker/index.js +1 -40
- package/InputWithDatePicker/index.js.map +1 -1
- package/InputWithMonthPicker/cjs/index.js +3 -16
- package/InputWithMonthPicker/cjs/index.js.map +1 -1
- package/InputWithMonthPicker/index.js +1 -14
- package/InputWithMonthPicker/index.js.map +1 -1
- package/Link/cjs/index.js +2 -22
- package/Link/cjs/index.js.map +1 -1
- package/Link/index.js +1 -21
- package/Link/index.js.map +1 -1
- package/MenuPanel/cjs/index.js +2 -17
- package/MenuPanel/cjs/index.js.map +1 -1
- package/MenuPanel/cjs/package.json +0 -1
- package/MenuPanel/index.js +2 -16
- package/MenuPanel/index.js.map +1 -1
- package/MenuPanel/package.json +0 -1
- package/MobileInputWithMonthPicker/cjs/index.js +3 -16
- package/MobileInputWithMonthPicker/cjs/index.js.map +1 -1
- package/MobileInputWithMonthPicker/index.js +1 -14
- package/MobileInputWithMonthPicker/index.js.map +1 -1
- package/SelectMonth/cjs/index.js +16 -59
- package/SelectMonth/cjs/index.js.map +1 -1
- package/SelectMonth/index.js +1 -26
- package/SelectMonth/index.js.map +1 -1
- package/SelectYear/cjs/index.js +16 -59
- package/SelectYear/cjs/index.js.map +1 -1
- package/SelectYear/index.js +1 -26
- package/SelectYear/index.js.map +1 -1
- package/TestForm/cjs/index.js +50 -92
- package/TestForm/cjs/index.js.map +1 -1
- package/TestForm/index.js +1 -43
- package/TestForm/index.js.map +1 -1
- package/cjs/index.js +17 -116
- package/cjs/index.js.map +1 -1
- package/index.d.ts +6 -19
- package/index.js +2 -88
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -460,6 +460,11 @@ declare type KUIComplexSettings = {
|
|
|
460
460
|
};
|
|
461
461
|
declare const setSettings: (newSettings: KUIComplexSettings) => void;
|
|
462
462
|
|
|
463
|
+
declare const getFormValue: <T extends object>(name?: string | undefined, form?: UseFormReturn<T, any, undefined> | null | undefined) => react_hook_form.FieldValues | undefined;
|
|
464
|
+
declare const getFormError: <T extends object>(name?: string | undefined, form?: UseFormReturn<T, any, undefined> | null | undefined) => string | undefined;
|
|
465
|
+
|
|
466
|
+
declare const shortMonths: string[];
|
|
467
|
+
|
|
463
468
|
declare type VisibilitySettings = {
|
|
464
469
|
tenant: boolean;
|
|
465
470
|
landlord: boolean;
|
|
@@ -471,22 +476,4 @@ declare const getVisibilitySettings: (visibility?: DocumentVisibilityVariants |
|
|
|
471
476
|
landlord: boolean;
|
|
472
477
|
};
|
|
473
478
|
|
|
474
|
-
|
|
475
|
-
declare const getFormError: <T extends object>(name?: string | undefined, form?: UseFormReturn<T, any, undefined> | null | undefined) => string | undefined;
|
|
476
|
-
|
|
477
|
-
declare const phoneRegExp: RegExp;
|
|
478
|
-
declare const isValidWithMaskExp: RegExp;
|
|
479
|
-
declare const dateRegExp: RegExp;
|
|
480
|
-
declare const monthYearRegExp: RegExp;
|
|
481
|
-
declare const emailRegExp: RegExp;
|
|
482
|
-
declare const carNumberRegExp: RegExp;
|
|
483
|
-
declare const innRegExp: RegExp;
|
|
484
|
-
declare const corrAccountRegExp: RegExp;
|
|
485
|
-
declare const accountRegExp: RegExp;
|
|
486
|
-
declare const bicRegExp: RegExp;
|
|
487
|
-
declare const swiftRegExp: RegExp;
|
|
488
|
-
declare const simplePasswordRegExp: RegExp;
|
|
489
|
-
declare const mediumPasswordRegExp: RegExp;
|
|
490
|
-
declare const strongPasswordRegExp: RegExp;
|
|
491
|
-
|
|
492
|
-
export { AutocompleteOption, Avatar, ButtonSelect, ButtonTab, ButtonsPanel, CalendarHeaderWithSelect, CalendarStandardContainer, CalendarStandardHeader, CheckboxGroupWithTitle, CheckboxWithController, DependentInput, DesktopInputWithMonthPicker, DesktopMenuPanel, DocumentVisibilityVariants, InputDropdown, InputFile, InputForDatepicker, InputMultiSelect, InputPassword, InputPhoneWithForm, InputSelect, InputSelectDropdown, InputSelectWithController, InputTextAreaMobile, InputWithAddressAutocomplete, InputWithAutocomplete, InputWithController, InputWithDatePicker, InputWithMask, InputWithMonthPicker, Loading, MapWrapper, MenuItem, MenuPanel, MobileInputWithMonthPicker, MobileMenuPanel, MonthPickerContainer, MonthPickerHeader, PassportStrengthBar, RadioButtons, RadioButtonsWithController, RadioGroupWithLabel, SelectMonth, SelectYear, Switch, Table, TableCell, TableHeadCell, TableRow, Tooltip, UndefinedAvatar, VisibilitySettings, accountRegExp, bicRegExp, carNumberRegExp, corrAccountRegExp, dateRegExp, emailRegExp, getFormError, getFormValue, getVisibility, getVisibilitySettings, innRegExp, isValidWithMaskExp, mediumPasswordRegExp, monthYearRegExp, phoneRegExp, setSettings, simplePasswordRegExp, strongPasswordRegExp, swiftRegExp, useAddressAutocomplete };
|
|
479
|
+
export { AutocompleteOption, Avatar, ButtonSelect, ButtonTab, ButtonsPanel, CalendarHeaderWithSelect, CalendarStandardContainer, CalendarStandardHeader, CheckboxGroupWithTitle, CheckboxWithController, DependentInput, DesktopInputWithMonthPicker, DesktopMenuPanel, DocumentVisibilityVariants, InputDropdown, InputFile, InputForDatepicker, InputMultiSelect, InputPassword, InputPhoneWithForm, InputSelect, InputSelectDropdown, InputSelectWithController, InputTextAreaMobile, InputWithAddressAutocomplete, InputWithAutocomplete, InputWithController, InputWithDatePicker, InputWithMask, InputWithMonthPicker, Loading, MapWrapper, MenuItem, MenuPanel, MobileInputWithMonthPicker, MobileMenuPanel, MonthPickerContainer, MonthPickerHeader, PassportStrengthBar, RadioButtons, RadioButtonsWithController, RadioGroupWithLabel, SelectMonth, SelectYear, Switch, Table, TableCell, TableHeadCell, TableRow, Tooltip, UndefinedAvatar, VisibilitySettings, getFormError, getFormValue, getVisibility, getVisibilitySettings, setSettings, shortMonths, useAddressAutocomplete };
|
package/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import * as React from 'react';
|
|
|
7
7
|
import { forwardRef, useEffect, useState, useRef } from 'react';
|
|
8
8
|
import { jsx, jsxs as jsxs$1, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
9
9
|
import { Caption, theme, Button, Grid, Container, InputWithAdornments, Heading, InputWithMask as InputWithMask$1, IconButton, LinearProgress, Divider, Modal, Switch as Switch$1, InputWithCountryDropdown, Checkbox, Radio, InputMessage, CircularProgress, Box } from 'kui-basic';
|
|
10
|
+
import { updateQueryParams, useForkRef, strongPasswordRegExp, mediumPasswordRegExp, simplePasswordRegExp, useToggle, isValidWithMaskExp, useWindowWidth } from 'kui-utils';
|
|
10
11
|
import classNames from 'classnames';
|
|
11
12
|
import { DateTime } from 'luxon';
|
|
12
13
|
import { HalfArrowIcon, PrevArrowIcon, NextArrowIcon, CalendarIcon, ArrowBackIcon, ArrowNextIcon, ClosedEyeIcon, OpenEyeIcon, CheckIcon, PlusIcon, FileIcon, EditIcon, TrashIcon } from 'kui-icon';
|
|
@@ -158,27 +159,6 @@ var StyledButton$1 = styled(Button)(templateObject_1$F || (templateObject_1$F =
|
|
|
158
159
|
var inactiveStyles = css(templateObject_2$p || (templateObject_2$p = __makeTemplateObject(["\n p {\n color: ", ";\n }\n"], ["\n p {\n color: ", ";\n }\n"])), theme.palette.grey.seventy);
|
|
159
160
|
var templateObject_1$F, templateObject_2$p;
|
|
160
161
|
|
|
161
|
-
var updateQueryParams = function (newLink) {
|
|
162
|
-
var searchQuery = new URLSearchParams(window.location.search);
|
|
163
|
-
var hrefLinkParams = newLink.split(/\?|&/);
|
|
164
|
-
var hrefParams = Object.fromEntries(new URLSearchParams(hrefLinkParams.slice(1).join("&")).entries());
|
|
165
|
-
var searchParams = Object.fromEntries(searchQuery.entries());
|
|
166
|
-
var route = hrefLinkParams[0];
|
|
167
|
-
Object.keys(searchParams).forEach(function (key, index) {
|
|
168
|
-
if (key in hrefParams) {
|
|
169
|
-
searchParams[key] = hrefParams[key];
|
|
170
|
-
delete hrefParams[key];
|
|
171
|
-
}
|
|
172
|
-
if (key !== "id") {
|
|
173
|
-
route += "".concat(index === 0 ? "?" : "&").concat(key, "=").concat(searchParams[key]);
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
Object.keys(hrefParams).forEach(function (key) {
|
|
177
|
-
route += "&".concat(key, "=").concat(hrefParams[key]);
|
|
178
|
-
});
|
|
179
|
-
window.history.pushState({ route: route }, "", route);
|
|
180
|
-
};
|
|
181
|
-
|
|
182
162
|
var ButtonsPanel = forwardRef(function (_a, ref) {
|
|
183
163
|
var tabs = _a.tabs, tabPanels = _a.tabPanels, paths = _a.paths, activeTab = _a.activeTab, isSticky = _a.isSticky, onChange = _a.onChange, startComponent = _a.startComponent, endComponent = _a.endComponent, otherProps = __rest(_a, ["tabs", "tabPanels", "paths", "activeTab", "isSticky", "onChange", "startComponent", "endComponent"]);
|
|
184
164
|
var _b = React.useState(Number(activeTab)), value = _b[0], setValue = _b[1];
|
|
@@ -281,31 +261,6 @@ var OptionWrapper = styled.div(templateObject_1$C || (templateObject_1$C = __mak
|
|
|
281
261
|
var StyledDropdown$1 = styled(InputDropdown)(templateObject_2$m || (templateObject_2$m = __makeTemplateObject(["\n .KUI-InputDropdown_scroll {\n max-height: 142px;\n padding: 0 4px;\n }\n"], ["\n .KUI-InputDropdown_scroll {\n max-height: 142px;\n padding: 0 4px;\n }\n"])));
|
|
282
262
|
var templateObject_1$C, templateObject_2$m;
|
|
283
263
|
|
|
284
|
-
function setRef(ref, value) {
|
|
285
|
-
if (typeof ref === "function") {
|
|
286
|
-
ref(value);
|
|
287
|
-
}
|
|
288
|
-
else if (ref) {
|
|
289
|
-
ref.current = value;
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
function useForkRef() {
|
|
293
|
-
var refs = [];
|
|
294
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
295
|
-
refs[_i] = arguments[_i];
|
|
296
|
-
}
|
|
297
|
-
return React.useMemo(function () {
|
|
298
|
-
if (refs.every(function (ref) { return ref == null; })) {
|
|
299
|
-
return null;
|
|
300
|
-
}
|
|
301
|
-
return function (instance) {
|
|
302
|
-
refs.forEach(function (ref) {
|
|
303
|
-
setRef(ref, instance);
|
|
304
|
-
});
|
|
305
|
-
};
|
|
306
|
-
}, refs);
|
|
307
|
-
}
|
|
308
|
-
|
|
309
264
|
var InputSelectBase = forwardRef(function (_a, ref) {
|
|
310
265
|
var _b;
|
|
311
266
|
var options = _a.options, name = _a.name, disabled = _a.disabled, handleChange = _a.handleChange, iconProps = _a.iconProps, renderOption = _a.renderOption, selectedLabel = _a.selectedLabel, selectedValue = _a.selectedValue, error = _a.error, inputProps = __rest(_a, ["options", "name", "disabled", "handleChange", "iconProps", "renderOption", "selectedLabel", "selectedValue", "error"]);
|
|
@@ -627,21 +582,6 @@ var getFormError = function (name, form) {
|
|
|
627
582
|
return fieldError === null || fieldError === void 0 ? void 0 : fieldError.message;
|
|
628
583
|
};
|
|
629
584
|
|
|
630
|
-
var phoneRegExp = /^((\\+[1-9]{1,4}[ \\-]*)|(\\([0-9]{2,3}\\)[ \\-]*)|([0-9]{2,4})[ \\-]*)*?[0-9]{3,4}?[ \\-]*[0-9]{3,4}?$/;
|
|
631
|
-
var isValidWithMaskExp = /^[^_]+$/;
|
|
632
|
-
var dateRegExp = /(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d/;
|
|
633
|
-
var monthYearRegExp = /(0[1-9]|1[012])[- /.](19|20)\d\d/;
|
|
634
|
-
var emailRegExp = /^[-\w.]+@([A-z0-9][-A-z0-9]+\.)+[A-z]{2,4}$/;
|
|
635
|
-
var carNumberRegExp = /^([А-Яа-я]{1}[0-9]{3}[А-Яа-я]{2}\s{0,1}[0-9]{2,3})?$/;
|
|
636
|
-
var innRegExp = /^(([0-9]{12})|([0-9]{10}))?$/;
|
|
637
|
-
var corrAccountRegExp = /^(301[0-9]{17})?$/;
|
|
638
|
-
var accountRegExp = /^408([0-9]{17})?$/;
|
|
639
|
-
var bicRegExp = /^([0-9]{9})?$/;
|
|
640
|
-
var swiftRegExp = /^([A-Za-z]{6}\w{2}\d{0,3})?$/;
|
|
641
|
-
var simplePasswordRegExp = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*]).{10,}$/;
|
|
642
|
-
var mediumPasswordRegExp = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*]).{12,}$/;
|
|
643
|
-
var strongPasswordRegExp = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*]).{14,}$/;
|
|
644
|
-
|
|
645
585
|
var InputPassword = forwardRef(function (props, ref) {
|
|
646
586
|
var _a = useState(false), showPassword = _a[0], setShowPassword = _a[1];
|
|
647
587
|
var _b = useState(null), strength = _b[0], setStrength = _b[1];
|
|
@@ -687,18 +627,6 @@ var InputWrapper$1 = styled.div(templateObject_1$o || (templateObject_1$o = __ma
|
|
|
687
627
|
var TextAreaWrapper = styled.div(templateObject_2$g || (templateObject_2$g = __makeTemplateObject(["\n @media (min-width: 901px) {\n display: none;\n }\n"], ["\n @media (min-width: 901px) {\n display: none;\n }\n"])));
|
|
688
628
|
var templateObject_1$o, templateObject_2$g;
|
|
689
629
|
|
|
690
|
-
var useToggle = function (isModalOpen) {
|
|
691
|
-
if (isModalOpen === void 0) { isModalOpen = false; }
|
|
692
|
-
var _a = useState(isModalOpen), isOpen = _a[0], setIsOpen = _a[1];
|
|
693
|
-
var handleClose = function () {
|
|
694
|
-
setIsOpen(false);
|
|
695
|
-
};
|
|
696
|
-
var handleOpen = function () {
|
|
697
|
-
setIsOpen(true);
|
|
698
|
-
};
|
|
699
|
-
return [isOpen, handleOpen, handleClose];
|
|
700
|
-
};
|
|
701
|
-
|
|
702
630
|
var ModalFooter = forwardRef(function (_a, ref) {
|
|
703
631
|
var label = _a.label, button = _a.button, otherProps = __rest(_a, ["label", "button"]);
|
|
704
632
|
return (jsxs$1(StyledFooter, __assign({ ref: ref }, { children: [jsx(Divider, {}), jsx(ButtonWrapper$1, { children: button || (jsx(ButtonStyled, __assign({ fullWidth: true, size: "s", endIcon: jsx(CheckIcon, {}) }, otherProps, { children: label }))) })] })));
|
|
@@ -877,20 +805,6 @@ var Wrapper = styled.div(templateObject_1$k || (templateObject_1$k = __makeTempl
|
|
|
877
805
|
var SlideWrapper = styled.div(templateObject_2$c || (templateObject_2$c = __makeTemplateObject(["\n width: max-content !important;\n &:first-of-type {\n padding-left: 16px;\n }\n"], ["\n width: max-content !important;\n &:first-of-type {\n padding-left: 16px;\n }\n"])));
|
|
878
806
|
var templateObject_1$k, templateObject_2$c;
|
|
879
807
|
|
|
880
|
-
var useWindowWidth = function (time) {
|
|
881
|
-
if (time === void 0) { time = 10; }
|
|
882
|
-
var _a = useState(0), width = _a[0], setWidth = _a[1];
|
|
883
|
-
useEffect(function () {
|
|
884
|
-
setWidth(window.innerWidth);
|
|
885
|
-
var handleResize = _.debounce(function () {
|
|
886
|
-
setWidth(window.innerWidth);
|
|
887
|
-
}, time);
|
|
888
|
-
window.addEventListener("resize", handleResize);
|
|
889
|
-
return function () { return window.removeEventListener("resize", handleResize); };
|
|
890
|
-
}, []);
|
|
891
|
-
return width;
|
|
892
|
-
};
|
|
893
|
-
|
|
894
808
|
var MenuPanel = forwardRef(function (_a, ref) {
|
|
895
809
|
var tabs = _a.tabs, tabPanels = _a.tabPanels, paths = _a.paths, activeTab = _a.activeTab, variant = _a.variant;
|
|
896
810
|
var width = useWindowWidth();
|
|
@@ -1885,5 +1799,5 @@ var getVisibilitySettings = function (visibility) {
|
|
|
1885
1799
|
}
|
|
1886
1800
|
};
|
|
1887
1801
|
|
|
1888
|
-
export { AutocompleteOption, Avatar, ButtonSelect, ButtonTab, ButtonsPanel, CalendarHeaderWithSelect, CalendarStandardContainer, CalendarStandardHeader, CheckboxGroupWithTitle, CheckboxWithController, DependentInput, DesktopInputWithMonthPicker, DesktopMenuPanel, InputDropdown, InputFile, InputForDatepicker, InputMultiSelect, InputPassword, InputPhoneWithForm, InputSelect, InputSelectDropdown, InputSelectWithController, InputTextAreaMobile, InputWithAddressAutocomplete, InputWithAutocomplete, InputWithController, InputWithDatePicker, InputWithMask, InputWithMonthPicker, Loading, MapWrapper, MenuItem, MenuPanel, MobileInputWithMonthPicker, MobileMenuPanel, MonthPickerContainer, MonthPickerHeader, PassportStrengthBar, RadioButtons, RadioButtonsWithController, RadioGroupWithLabel, SelectMonth, SelectYear, Switch, Table, TableCell, TableHeadCell, TableRow, Tooltip, UndefinedAvatar,
|
|
1802
|
+
export { AutocompleteOption, Avatar, ButtonSelect, ButtonTab, ButtonsPanel, CalendarHeaderWithSelect, CalendarStandardContainer, CalendarStandardHeader, CheckboxGroupWithTitle, CheckboxWithController, DependentInput, DesktopInputWithMonthPicker, DesktopMenuPanel, InputDropdown, InputFile, InputForDatepicker, InputMultiSelect, InputPassword, InputPhoneWithForm, InputSelect, InputSelectDropdown, InputSelectWithController, InputTextAreaMobile, InputWithAddressAutocomplete, InputWithAutocomplete, InputWithController, InputWithDatePicker, InputWithMask, InputWithMonthPicker, Loading, MapWrapper, MenuItem, MenuPanel, MobileInputWithMonthPicker, MobileMenuPanel, MonthPickerContainer, MonthPickerHeader, PassportStrengthBar, RadioButtons, RadioButtonsWithController, RadioGroupWithLabel, SelectMonth, SelectYear, Switch, Table, TableCell, TableHeadCell, TableRow, Tooltip, UndefinedAvatar, getFormError, getFormValue, getVisibility, getVisibilitySettings, setSettings, shortMonths, useAddressAutocomplete };
|
|
1889
1803
|
//# sourceMappingURL=index.js.map
|