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/TestForm/index.js
CHANGED
|
@@ -2,12 +2,12 @@ import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
|
2
2
|
import { Controller, useController, useForm } from 'react-hook-form';
|
|
3
3
|
import * as yup from 'yup';
|
|
4
4
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
5
|
-
import * as React from 'react';
|
|
6
5
|
import { forwardRef, useState, useRef, useEffect } from 'react';
|
|
7
6
|
import { InputWithAdornments, Grid, theme, Caption, InputWithMask as InputWithMask$1, Divider, Button, Modal, IconButton, InputWithCountryDropdown, Switch as Switch$1, LinearProgress } from 'kui-basic';
|
|
8
7
|
import { jsxs as jsxs$1, jsx as jsx$1, Fragment } from '@emotion/react/jsx-runtime';
|
|
9
8
|
import styled from '@emotion/styled';
|
|
10
9
|
import { HalfArrowIcon, CalendarIcon, CheckIcon, ArrowBackIcon, ArrowNextIcon, ClosedEyeIcon, OpenEyeIcon } from 'kui-icon';
|
|
10
|
+
import { useForkRef, useToggle, isValidWithMaskExp, strongPasswordRegExp, mediumPasswordRegExp, simplePasswordRegExp } from 'kui-utils';
|
|
11
11
|
import DatePicker from 'react-datepicker';
|
|
12
12
|
import { DateTime } from 'luxon';
|
|
13
13
|
import _ from 'lodash';
|
|
@@ -159,31 +159,6 @@ var OptionWrapper = styled.div(templateObject_1$d || (templateObject_1$d = __mak
|
|
|
159
159
|
var StyledDropdown = styled(InputDropdown)(templateObject_2$6 || (templateObject_2$6 = __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"])));
|
|
160
160
|
var templateObject_1$d, templateObject_2$6;
|
|
161
161
|
|
|
162
|
-
function setRef(ref, value) {
|
|
163
|
-
if (typeof ref === "function") {
|
|
164
|
-
ref(value);
|
|
165
|
-
}
|
|
166
|
-
else if (ref) {
|
|
167
|
-
ref.current = value;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
function useForkRef() {
|
|
171
|
-
var refs = [];
|
|
172
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
173
|
-
refs[_i] = arguments[_i];
|
|
174
|
-
}
|
|
175
|
-
return React.useMemo(function () {
|
|
176
|
-
if (refs.every(function (ref) { return ref == null; })) {
|
|
177
|
-
return null;
|
|
178
|
-
}
|
|
179
|
-
return function (instance) {
|
|
180
|
-
refs.forEach(function (ref) {
|
|
181
|
-
setRef(ref, instance);
|
|
182
|
-
});
|
|
183
|
-
};
|
|
184
|
-
}, refs);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
162
|
var InputSelectBase = forwardRef(function (_a, ref) {
|
|
188
163
|
var _b;
|
|
189
164
|
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"]);
|
|
@@ -263,23 +238,6 @@ var InputForDatepicker = forwardRef(function (props, ref) {
|
|
|
263
238
|
var IconWrapper = styled.div(templateObject_1$a || (templateObject_1$a = __makeTemplateObject(["\n display: flex;\n align-items: center;\n cursor: pointer;\n z-index: 1;\n"], ["\n display: flex;\n align-items: center;\n cursor: pointer;\n z-index: 1;\n"])));
|
|
264
239
|
var templateObject_1$a;
|
|
265
240
|
|
|
266
|
-
var useToggle = function (isModalOpen) {
|
|
267
|
-
if (isModalOpen === void 0) { isModalOpen = false; }
|
|
268
|
-
var _a = useState(isModalOpen), isOpen = _a[0], setIsOpen = _a[1];
|
|
269
|
-
var handleClose = function () {
|
|
270
|
-
setIsOpen(false);
|
|
271
|
-
};
|
|
272
|
-
var handleOpen = function () {
|
|
273
|
-
setIsOpen(true);
|
|
274
|
-
};
|
|
275
|
-
return [isOpen, handleOpen, handleClose];
|
|
276
|
-
};
|
|
277
|
-
|
|
278
|
-
var isValidWithMaskExp = /^[^_]+$/;
|
|
279
|
-
var simplePasswordRegExp = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*]).{10,}$/;
|
|
280
|
-
var mediumPasswordRegExp = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*]).{12,}$/;
|
|
281
|
-
var strongPasswordRegExp = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*]).{14,}$/;
|
|
282
|
-
|
|
283
241
|
var checkDisabled$1 = function (year, min, max) {
|
|
284
242
|
return (min && year <= min) || (max && year >= max);
|
|
285
243
|
};
|