@pnkx-lib/ui 1.9.271 → 1.9.273

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.
@@ -163,40 +163,6 @@ const HookFormContext = React__default.createContext(null);
163
163
  * ```
164
164
  */
165
165
  const useFormContext = () => React__default.useContext(HookFormContext);
166
- /**
167
- * A provider component that propagates the `useForm` methods to all children components via [React Context](https://reactjs.org/docs/context.html) API. To be used with {@link useFormContext}.
168
- *
169
- * @remarks
170
- * [API](https://react-hook-form.com/docs/useformcontext) • [Demo](https://codesandbox.io/s/react-hook-form-v7-form-context-ytudi)
171
- *
172
- * @param props - all useForm methods
173
- *
174
- * @example
175
- * ```tsx
176
- * function App() {
177
- * const methods = useForm();
178
- * const onSubmit = data => console.log(data);
179
- *
180
- * return (
181
- * <FormProvider {...methods} >
182
- * <form onSubmit={methods.handleSubmit(onSubmit)}>
183
- * <NestedInput />
184
- * <input type="submit" />
185
- * </form>
186
- * </FormProvider>
187
- * );
188
- * }
189
- *
190
- * function NestedInput() {
191
- * const { register } = useFormContext(); // retrieve all hook methods
192
- * return <input {...register("test")} />;
193
- * }
194
- * ```
195
- */
196
- const FormProvider = (props) => {
197
- const { children, ...data } = props;
198
- return (React__default.createElement(HookFormContext.Provider, { value: data }, children));
199
- };
200
166
 
201
167
  var getProxyFormState = (formState, control, localProxyFormState, isRoot = true) => {
202
168
  const result = {
@@ -2297,4 +2263,4 @@ function useForm(props = {}) {
2297
2263
  return _formControl.current;
2298
2264
  }
2299
2265
 
2300
- export { Controller as C, FormProvider as F, useForm as u };
2266
+ export { Controller as C, useForm as u };
@@ -1,6 +1,6 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
- import { C as Controller } from '../chunks/index.esm-dryjkTpj.js';
3
+ import { C as Controller } from '../chunks/index.esm-o4O8pXMN.js';
4
4
 
5
5
  class PnkxField extends React.PureComponent {
6
6
  render() {
@@ -1,5 +1,5 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
2
- import { u as useForm, F as FormProvider } from '../chunks/index.esm-dryjkTpj.js';
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { u as useForm } from '../chunks/index.esm-o4O8pXMN.js';
3
3
  import { Button } from './Button.js';
4
4
  import { I as Icon, _ as _extends } from '../chunks/AntdIcon-ZIq9SabE.js';
5
5
  import * as React from 'react';
@@ -46,11 +46,10 @@ const SearchFiltersForm = ({
46
46
  hideDefaultSubmit,
47
47
  hideResetButton
48
48
  }) => {
49
- const method = useForm({
49
+ const { control, handleSubmit, reset, setValue } = useForm({
50
50
  defaultValues: initialValues
51
51
  });
52
- const { control, handleSubmit, reset, setValue } = method;
53
- return /* @__PURE__ */ jsx(FormProvider, { ...method, children: /* @__PURE__ */ jsxs("form", { className: classNameWrapperForm, onSubmit: handleSubmit(onSubmit), children: [
52
+ return /* @__PURE__ */ jsxs("form", { className: classNameWrapperForm, onSubmit: handleSubmit(onSubmit), children: [
54
53
  /* @__PURE__ */ jsx("div", { className: classNamesContainer, children: renderFilterFields && renderFilterFields({
55
54
  control,
56
55
  setValue,
@@ -82,7 +81,7 @@ const SearchFiltersForm = ({
82
81
  }
83
82
  )
84
83
  ] })
85
- ] }) });
84
+ ] });
86
85
  };
87
86
 
88
87
  export { SearchFiltersForm };
@@ -1,5 +1,5 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
- import { C as Controller } from '../chunks/index.esm-dryjkTpj.js';
2
+ import { C as Controller } from '../chunks/index.esm-o4O8pXMN.js';
3
3
  import { UploadComponent } from './UploadComponent.js';
4
4
 
5
5
  const UploadImage = ({
@@ -2,7 +2,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
3
  import { useState } from 'react';
4
4
  import { Spin, Upload, message } from 'antd';
5
- import { C as Controller } from '../chunks/index.esm-dryjkTpj.js';
5
+ import { C as Controller } from '../chunks/index.esm-o4O8pXMN.js';
6
6
  import { I as Icon, _ as _extends } from '../chunks/AntdIcon-ZIq9SabE.js';
7
7
 
8
8
  // This icon file is generated automatically.
package/es/ui/index.js CHANGED
@@ -6,7 +6,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
6
6
  import React__default, { useLayoutEffect, useEffect, useRef, useMemo, useCallback, useState, memo, useReducer, createContext, useContext } from 'react';
7
7
  import { Select, Input, Pagination, Table as Table$1 } from 'antd';
8
8
  import { Modal } from './Modal.js';
9
- import { u as useForm } from '../chunks/index.esm-dryjkTpj.js';
9
+ import { u as useForm } from '../chunks/index.esm-o4O8pXMN.js';
10
10
  import { PnkxField } from '../fields/PnkxField.js';
11
11
  import { Checkbox } from '../fields/Checkbox.js';
12
12
  import { unstable_batchedUpdates, createPortal } from 'react-dom';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pnkx-lib/ui",
3
3
  "private": false,
4
- "version": "1.9.271",
4
+ "version": "1.9.273",
5
5
  "type": "module",
6
6
  "main": "./es/index.js",
7
7
  "module": "./es/index.js",