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.
Files changed (88) hide show
  1. package/ButtonSelect/cjs/index.js +16 -59
  2. package/ButtonSelect/cjs/index.js.map +1 -1
  3. package/ButtonSelect/index.js +1 -26
  4. package/ButtonSelect/index.js.map +1 -1
  5. package/ButtonsPanel/cjs/index.js +2 -22
  6. package/ButtonsPanel/cjs/index.js.map +1 -1
  7. package/ButtonsPanel/index.js +1 -21
  8. package/ButtonsPanel/index.js.map +1 -1
  9. package/CalendarHeaderWithSelect/cjs/index.js +18 -61
  10. package/CalendarHeaderWithSelect/cjs/index.js.map +1 -1
  11. package/CalendarHeaderWithSelect/index.js +1 -26
  12. package/CalendarHeaderWithSelect/index.js.map +1 -1
  13. package/FileItem/cjs/index.js +2 -22
  14. package/FileItem/cjs/index.js.map +1 -1
  15. package/FileItem/index.js +1 -21
  16. package/FileItem/index.js.map +1 -1
  17. package/InputFile/cjs/index.js +2 -22
  18. package/InputFile/cjs/index.js.map +1 -1
  19. package/InputFile/index.js +1 -21
  20. package/InputFile/index.js.map +1 -1
  21. package/InputMultiSelect/cjs/index.js +14 -57
  22. package/InputMultiSelect/cjs/index.js.map +1 -1
  23. package/InputMultiSelect/index.js +1 -26
  24. package/InputMultiSelect/index.js.map +1 -1
  25. package/InputPassword/cjs/index.js +4 -7
  26. package/InputPassword/cjs/index.js.map +1 -1
  27. package/InputPassword/index.js +1 -4
  28. package/InputPassword/index.js.map +1 -1
  29. package/InputPhoneWithForm/cjs/index.js +4 -48
  30. package/InputPhoneWithForm/cjs/index.js.map +1 -1
  31. package/InputPhoneWithForm/index.js +1 -26
  32. package/InputPhoneWithForm/index.js.map +1 -1
  33. package/InputSelect/cjs/index.js +15 -58
  34. package/InputSelect/cjs/index.js.map +1 -1
  35. package/InputSelect/index.js +1 -26
  36. package/InputSelect/index.js.map +1 -1
  37. package/InputSelectBase/cjs/index.js +12 -55
  38. package/InputSelectBase/cjs/index.js.map +1 -1
  39. package/InputSelectBase/index.js +1 -26
  40. package/InputSelectBase/index.js.map +1 -1
  41. package/InputSelectWithController/cjs/index.js +16 -59
  42. package/InputSelectWithController/cjs/index.js.map +1 -1
  43. package/InputSelectWithController/index.js +1 -26
  44. package/InputSelectWithController/index.js.map +1 -1
  45. package/InputWithAutocomplete/cjs/index.js +13 -68
  46. package/InputWithAutocomplete/cjs/index.js.map +1 -1
  47. package/InputWithAutocomplete/index.js +1 -38
  48. package/InputWithAutocomplete/index.js.map +1 -1
  49. package/InputWithDatePicker/cjs/index.js +28 -85
  50. package/InputWithDatePicker/cjs/index.js.map +1 -1
  51. package/InputWithDatePicker/index.js +1 -40
  52. package/InputWithDatePicker/index.js.map +1 -1
  53. package/InputWithMonthPicker/cjs/index.js +3 -16
  54. package/InputWithMonthPicker/cjs/index.js.map +1 -1
  55. package/InputWithMonthPicker/index.js +1 -14
  56. package/InputWithMonthPicker/index.js.map +1 -1
  57. package/Link/cjs/index.js +2 -22
  58. package/Link/cjs/index.js.map +1 -1
  59. package/Link/index.js +1 -21
  60. package/Link/index.js.map +1 -1
  61. package/MenuPanel/cjs/index.js +2 -17
  62. package/MenuPanel/cjs/index.js.map +1 -1
  63. package/MenuPanel/cjs/package.json +0 -1
  64. package/MenuPanel/index.js +2 -16
  65. package/MenuPanel/index.js.map +1 -1
  66. package/MenuPanel/package.json +0 -1
  67. package/MobileInputWithMonthPicker/cjs/index.js +3 -16
  68. package/MobileInputWithMonthPicker/cjs/index.js.map +1 -1
  69. package/MobileInputWithMonthPicker/index.js +1 -14
  70. package/MobileInputWithMonthPicker/index.js.map +1 -1
  71. package/SelectMonth/cjs/index.js +16 -59
  72. package/SelectMonth/cjs/index.js.map +1 -1
  73. package/SelectMonth/index.js +1 -26
  74. package/SelectMonth/index.js.map +1 -1
  75. package/SelectYear/cjs/index.js +16 -59
  76. package/SelectYear/cjs/index.js.map +1 -1
  77. package/SelectYear/index.js +1 -26
  78. package/SelectYear/index.js.map +1 -1
  79. package/TestForm/cjs/index.js +50 -92
  80. package/TestForm/cjs/index.js.map +1 -1
  81. package/TestForm/index.js +1 -43
  82. package/TestForm/index.js.map +1 -1
  83. package/cjs/index.js +17 -116
  84. package/cjs/index.js.map +1 -1
  85. package/index.d.ts +6 -19
  86. package/index.js +2 -88
  87. package/index.js.map +1 -1
  88. 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
  };