ab-ui-library 1.57.1 → 1.58.0

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.
@@ -1,11 +1,12 @@
1
1
  import { _ as _extends } from '../../extends-2419b4fb.js';
2
2
  import { _ as _asyncToGenerator, r as regenerator } from '../../index-afc5608a.js';
3
3
  import React from 'react';
4
- import { useForm } from 'react-hook-form';
4
+ import { appendErrors, useForm } from 'react-hook-form';
5
5
  import classNames from 'classnames';
6
6
  import { FormContext } from '../../context/types.js';
7
7
  import { Button } from '../Button/Button.js';
8
8
  import * as yup from 'yup';
9
+ import { validateFieldsNatively, toNestError } from '@hookform/resolvers';
9
10
  import '../../utils/helpers.js';
10
11
  import 'dayjs';
11
12
  import '../../defineProperty-9000dd50.js';
@@ -34,6 +35,8 @@ import '../../helperComponents/IconDynamicComponent/constants.js';
34
35
  import 'react-syntax-highlighter';
35
36
  import '../Button/consts.js';
36
37
 
38
+ var o=function(o,n,a){return void 0===n&&(n={}),void 0===a&&(a={}),function(s,i,c){try{return Promise.resolve(function(t,r){try{var u=(n.context&&"development"===process.env.NODE_ENV&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(o["sync"===a.mode?"validateSync":"validate"](s,Object.assign({abortEarly:!1},n,{context:i}))).then(function(t){return c.shouldUseNativeValidation&&validateFieldsNatively({},c),{values:a.rawValues?s:t,errors:{}}}));}catch(e){return r(e)}return u&&u.then?u.then(void 0,r):u}(0,function(e){if(!e.inner)throw e;return {values:{},errors:toNestError((o=e,n=!c.shouldUseNativeValidation&&"all"===c.criteriaMode,(o.inner||[]).reduce(function(e,t){if(e[t.path]||(e[t.path]={message:t.message,type:t.type}),n){var o=e[t.path].types,a=o&&o[t.type];e[t.path]=appendErrors(t.path,n,e,t.type,a?[].concat(a,t.message):t.message);}return e},{})),c)};var o,n;}))}catch(e){return Promise.reject(e)}}};
39
+
37
40
  var FormContainer = function FormContainer(props) {
38
41
  var children = props.children,
39
42
  _props$className = props.className,
@@ -53,7 +56,8 @@ var FormContainer = function FormContainer(props) {
53
56
  mode: mode,
54
57
  defaultValues: initialValues,
55
58
  shouldFocusError: shouldFocusError,
56
- shouldUnregister: shouldUnregister
59
+ shouldUnregister: shouldUnregister,
60
+ resolver: o(validationScheme)
57
61
  }),
58
62
  handleSubmit = _useForm.handleSubmit,
59
63
  register = _useForm.register,
@@ -34,3 +34,4 @@ import '../../helperComponents/IconDynamicComponent/constants.js';
34
34
  import 'react-syntax-highlighter';
35
35
  import '../Button/consts.js';
36
36
  import 'yup';
37
+ import '@hookform/resolvers';
package/index.js CHANGED
@@ -565,6 +565,7 @@ import './components/Select/SharedComponents/ButtonSelectWrapper/ButtonSelectWra
565
565
  import './components/Select/SharedComponents/ButtonSelectWrapper/Button/Button.js';
566
566
  import './components/DatePicker/types.js';
567
567
  import 'yup';
568
+ import '@hookform/resolvers';
568
569
  import '@hookform/error-message';
569
570
  import './components/FramedIcon/consts.js';
570
571
  import './hooks/useHideBodyScroll.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ab-ui-library",
3
- "version": "1.57.1",
3
+ "version": "1.58.0",
4
4
  "description": "UI library for AM",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",
@@ -19,6 +19,7 @@
19
19
  "@dnd-kit/core": "^6.3.1",
20
20
  "@dnd-kit/sortable": "^10.0.0",
21
21
  "@hookform/error-message": "^2.0.1",
22
+ "@hookform/resolvers": "^2.9.11",
22
23
  "@tanstack/react-table": "^8.21.2",
23
24
  "classnames": "^2.3.2",
24
25
  "dayjs": "^1.11.10",