@faasjs/ant-design 2.1.0 → 2.3.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.
package/dist/index.d.mts CHANGED
@@ -18,7 +18,7 @@ import { RuleObject } from 'rc-field-form/lib/interface';
18
18
  import { FilterValue, SorterResult, TableCurrentDataSource } from 'antd/es/table/interface';
19
19
  import * as antd_es_form_context from 'antd/es/form/context';
20
20
  import * as antd_es_form from 'antd/es/form';
21
- import * as rc_field_form_es_useWatch from 'rc-field-form/es/useWatch';
21
+ import * as rc_field_form from 'rc-field-form';
22
22
  import * as antd_es_form_hooks_useFormInstance from 'antd/es/form/hooks/useFormInstance';
23
23
  import * as antd_es_form_Form from 'antd/es/form/Form';
24
24
  import { Tab } from 'rc-tabs/es/interface';
@@ -192,10 +192,7 @@ interface useAppProps {
192
192
  */
193
193
  declare function App(props: AppProps): react_jsx_runtime.JSX.Element;
194
194
  declare namespace App {
195
- var useApp: {
196
- (): Readonly<useAppProps>;
197
- whyDidYouRender: boolean;
198
- };
195
+ var useApp: () => Readonly<useAppProps>;
199
196
  var whyDidYouRender: boolean;
200
197
  }
201
198
  /**
@@ -207,10 +204,7 @@ declare namespace App {
207
204
  * const { message, notification, setModalProps, setDrawerProps } = useApp()
208
205
  * ```
209
206
  */
210
- declare const useApp: {
211
- (): Readonly<useAppProps>;
212
- whyDidYouRender: boolean;
213
- };
207
+ declare const useApp: () => Readonly<useAppProps>;
214
208
 
215
209
  interface BlankProps {
216
210
  value?: any;
@@ -541,7 +535,7 @@ declare namespace Form {
541
535
  var whyDidYouRender: boolean;
542
536
  var useForm: typeof antd_es_form_Form.useForm;
543
537
  var useFormInstance: typeof antd_es_form_hooks_useFormInstance.default;
544
- var useWatch: typeof rc_field_form_es_useWatch.default;
538
+ var useWatch: typeof rc_field_form.useWatch;
545
539
  var Item: typeof FormItem;
546
540
  var List: react.FC<antd_es_form.FormListProps>;
547
541
  var ErrorList: react.FC<antd_es_form.ErrorListProps>;
package/dist/index.d.ts CHANGED
@@ -18,7 +18,7 @@ import { RuleObject } from 'rc-field-form/lib/interface';
18
18
  import { FilterValue, SorterResult, TableCurrentDataSource } from 'antd/es/table/interface';
19
19
  import * as antd_es_form_context from 'antd/es/form/context';
20
20
  import * as antd_es_form from 'antd/es/form';
21
- import * as rc_field_form_es_useWatch from 'rc-field-form/es/useWatch';
21
+ import * as rc_field_form from 'rc-field-form';
22
22
  import * as antd_es_form_hooks_useFormInstance from 'antd/es/form/hooks/useFormInstance';
23
23
  import * as antd_es_form_Form from 'antd/es/form/Form';
24
24
  import { Tab } from 'rc-tabs/es/interface';
@@ -192,10 +192,7 @@ interface useAppProps {
192
192
  */
193
193
  declare function App(props: AppProps): react_jsx_runtime.JSX.Element;
194
194
  declare namespace App {
195
- var useApp: {
196
- (): Readonly<useAppProps>;
197
- whyDidYouRender: boolean;
198
- };
195
+ var useApp: () => Readonly<useAppProps>;
199
196
  var whyDidYouRender: boolean;
200
197
  }
201
198
  /**
@@ -207,10 +204,7 @@ declare namespace App {
207
204
  * const { message, notification, setModalProps, setDrawerProps } = useApp()
208
205
  * ```
209
206
  */
210
- declare const useApp: {
211
- (): Readonly<useAppProps>;
212
- whyDidYouRender: boolean;
213
- };
207
+ declare const useApp: () => Readonly<useAppProps>;
214
208
 
215
209
  interface BlankProps {
216
210
  value?: any;
@@ -541,7 +535,7 @@ declare namespace Form {
541
535
  var whyDidYouRender: boolean;
542
536
  var useForm: typeof antd_es_form_Form.useForm;
543
537
  var useFormInstance: typeof antd_es_form_hooks_useFormInstance.default;
544
- var useWatch: typeof rc_field_form_es_useWatch.default;
538
+ var useWatch: typeof rc_field_form.useWatch;
545
539
  var Item: typeof FormItem;
546
540
  var List: react.FC<antd_es_form.FormListProps>;
547
541
  var ErrorList: react.FC<antd_es_form.ErrorListProps>;
package/dist/index.js CHANGED
@@ -19,7 +19,7 @@ var Modal = antd.Modal;
19
19
  Modal.whyDidYouRender = true;
20
20
  function useModal(init) {
21
21
  const [props, setProps] = react$1.useState({ open: false, ...init });
22
- const setModalProps2 = react$1.useCallback(
22
+ const setModalProps = react$1.useCallback(
23
23
  (changes) => {
24
24
  const changed = typeof changes === "function" ? changes(props) : changes;
25
25
  setProps((prev) => ({ ...prev, ...changed }));
@@ -38,7 +38,7 @@ function useModal(init) {
38
38
  }
39
39
  ),
40
40
  modalProps: props,
41
- setModalProps: setModalProps2
41
+ setModalProps
42
42
  };
43
43
  }
44
44
  var Drawer = antd.Drawer;
@@ -48,7 +48,7 @@ function useDrawer(init) {
48
48
  open: false,
49
49
  ...init
50
50
  });
51
- const setDrawerProps2 = react$1.useCallback(
51
+ const setDrawerProps = react$1.useCallback(
52
52
  (changes) => {
53
53
  const changed = typeof changes === "function" ? changes(props) : changes;
54
54
  setProps((prev) => ({ ...prev, ...changed }));
@@ -67,7 +67,7 @@ function useDrawer(init) {
67
67
  }
68
68
  ),
69
69
  drawerProps: props,
70
- setDrawerProps: setDrawerProps2
70
+ setDrawerProps
71
71
  };
72
72
  }
73
73
  function ErrorChildren(props) {
@@ -163,30 +163,30 @@ function useConfigContext() {
163
163
  return react$1.useContext(ConfigContext);
164
164
  }
165
165
  var AppContext = react.createSplitedContext({
166
- message: {},
167
- notification: {},
166
+ message: null,
167
+ notification: null,
168
168
  modalProps: {},
169
- setModalProps: () => void 0,
169
+ setModalProps: null,
170
170
  drawerProps: {},
171
- setDrawerProps: () => void 0
171
+ setDrawerProps: null
172
172
  });
173
173
  function RoutesApp(props) {
174
174
  const location = reactRouterDom.useLocation();
175
- const { drawerProps, setDrawerProps: setDrawerProps2, modalProps, setModalProps: setModalProps2 } = useApp();
175
+ const { drawerProps, setDrawerProps, modalProps, setModalProps } = useApp();
176
176
  react$1.useEffect(() => {
177
177
  console.debug("location", location);
178
178
  if (drawerProps.open)
179
- setDrawerProps2({ open: false });
179
+ setDrawerProps({ open: false });
180
180
  if (modalProps.open)
181
- setModalProps2({ open: false });
181
+ setModalProps({ open: false });
182
182
  }, [location]);
183
183
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: props.children });
184
184
  }
185
185
  function App(props) {
186
186
  const [messageApi, messageContextHolder] = antd.message.useMessage();
187
187
  const [notificationApi, notificationContextHolder] = antd.notification.useNotification();
188
- const { modal, modalProps, setModalProps: setModalProps2 } = useModal();
189
- const { drawer, drawerProps, setDrawerProps: setDrawerProps2 } = useDrawer();
188
+ const { modal, modalProps, setModalProps } = useModal();
189
+ const { drawer, drawerProps, setDrawerProps } = useDrawer();
190
190
  const styleProviderProps = react$1.useMemo(
191
191
  () => ({
192
192
  ...props.styleProviderProps,
@@ -202,9 +202,9 @@ function App(props) {
202
202
  message: messageApi,
203
203
  notification: notificationApi,
204
204
  drawerProps,
205
- setDrawerProps: setDrawerProps2,
205
+ setDrawerProps,
206
206
  modalProps,
207
- setModalProps: setModalProps2
207
+ setModalProps
208
208
  },
209
209
  children: /* @__PURE__ */ jsxRuntime.jsx(ConfigProvider, { ...props.faasConfigProviderProps, children: /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { ...props.errorBoundaryProps, children: /* @__PURE__ */ jsxRuntime.jsxs(reactRouterDom.BrowserRouter, { ...props.browserRouterProps, children: [
210
210
  messageContextHolder,
@@ -928,18 +928,15 @@ function Link(props) {
928
928
  }
929
929
  );
930
930
  if (props.children)
931
- return (
932
- // biome-ignore lint/a11y/useValidAnchor: <explanation>
933
- /* @__PURE__ */ jsxRuntime.jsx(
934
- "a",
935
- {
936
- href: props.href,
937
- target: props.target || ((_c = theme.Link) == null ? void 0 : _c.target),
938
- style: computedStyle,
939
- onClick: props.onClick,
940
- children: props.children
941
- }
942
- )
931
+ return /* @__PURE__ */ jsxRuntime.jsx(
932
+ "a",
933
+ {
934
+ href: props.href,
935
+ target: props.target || ((_c = theme.Link) == null ? void 0 : _c.target),
936
+ style: computedStyle,
937
+ onClick: props.onClick,
938
+ children: props.children
939
+ }
943
940
  );
944
941
  return /* @__PURE__ */ jsxRuntime.jsx(
945
942
  antd.Typography.Link,
package/dist/index.mjs CHANGED
@@ -15,7 +15,7 @@ var Modal = Modal$1;
15
15
  Modal.whyDidYouRender = true;
16
16
  function useModal(init) {
17
17
  const [props, setProps] = useState({ open: false, ...init });
18
- const setModalProps2 = useCallback(
18
+ const setModalProps = useCallback(
19
19
  (changes) => {
20
20
  const changed = typeof changes === "function" ? changes(props) : changes;
21
21
  setProps((prev) => ({ ...prev, ...changed }));
@@ -34,7 +34,7 @@ function useModal(init) {
34
34
  }
35
35
  ),
36
36
  modalProps: props,
37
- setModalProps: setModalProps2
37
+ setModalProps
38
38
  };
39
39
  }
40
40
  var Drawer = Drawer$1;
@@ -44,7 +44,7 @@ function useDrawer(init) {
44
44
  open: false,
45
45
  ...init
46
46
  });
47
- const setDrawerProps2 = useCallback(
47
+ const setDrawerProps = useCallback(
48
48
  (changes) => {
49
49
  const changed = typeof changes === "function" ? changes(props) : changes;
50
50
  setProps((prev) => ({ ...prev, ...changed }));
@@ -63,7 +63,7 @@ function useDrawer(init) {
63
63
  }
64
64
  ),
65
65
  drawerProps: props,
66
- setDrawerProps: setDrawerProps2
66
+ setDrawerProps
67
67
  };
68
68
  }
69
69
  function ErrorChildren(props) {
@@ -159,30 +159,30 @@ function useConfigContext() {
159
159
  return useContext(ConfigContext);
160
160
  }
161
161
  var AppContext = createSplitedContext({
162
- message: {},
163
- notification: {},
162
+ message: null,
163
+ notification: null,
164
164
  modalProps: {},
165
- setModalProps: () => void 0,
165
+ setModalProps: null,
166
166
  drawerProps: {},
167
- setDrawerProps: () => void 0
167
+ setDrawerProps: null
168
168
  });
169
169
  function RoutesApp(props) {
170
170
  const location = useLocation();
171
- const { drawerProps, setDrawerProps: setDrawerProps2, modalProps, setModalProps: setModalProps2 } = useApp();
171
+ const { drawerProps, setDrawerProps, modalProps, setModalProps } = useApp();
172
172
  useEffect(() => {
173
173
  console.debug("location", location);
174
174
  if (drawerProps.open)
175
- setDrawerProps2({ open: false });
175
+ setDrawerProps({ open: false });
176
176
  if (modalProps.open)
177
- setModalProps2({ open: false });
177
+ setModalProps({ open: false });
178
178
  }, [location]);
179
179
  return /* @__PURE__ */ jsx(Fragment, { children: props.children });
180
180
  }
181
181
  function App(props) {
182
182
  const [messageApi, messageContextHolder] = message.useMessage();
183
183
  const [notificationApi, notificationContextHolder] = notification.useNotification();
184
- const { modal, modalProps, setModalProps: setModalProps2 } = useModal();
185
- const { drawer, drawerProps, setDrawerProps: setDrawerProps2 } = useDrawer();
184
+ const { modal, modalProps, setModalProps } = useModal();
185
+ const { drawer, drawerProps, setDrawerProps } = useDrawer();
186
186
  const styleProviderProps = useMemo(
187
187
  () => ({
188
188
  ...props.styleProviderProps,
@@ -198,9 +198,9 @@ function App(props) {
198
198
  message: messageApi,
199
199
  notification: notificationApi,
200
200
  drawerProps,
201
- setDrawerProps: setDrawerProps2,
201
+ setDrawerProps,
202
202
  modalProps,
203
- setModalProps: setModalProps2
203
+ setModalProps
204
204
  },
205
205
  children: /* @__PURE__ */ jsx(ConfigProvider, { ...props.faasConfigProviderProps, children: /* @__PURE__ */ jsx(ErrorBoundary, { ...props.errorBoundaryProps, children: /* @__PURE__ */ jsxs(BrowserRouter, { ...props.browserRouterProps, children: [
206
206
  messageContextHolder,
@@ -924,18 +924,15 @@ function Link(props) {
924
924
  }
925
925
  );
926
926
  if (props.children)
927
- return (
928
- // biome-ignore lint/a11y/useValidAnchor: <explanation>
929
- /* @__PURE__ */ jsx(
930
- "a",
931
- {
932
- href: props.href,
933
- target: props.target || ((_c = theme.Link) == null ? void 0 : _c.target),
934
- style: computedStyle,
935
- onClick: props.onClick,
936
- children: props.children
937
- }
938
- )
927
+ return /* @__PURE__ */ jsx(
928
+ "a",
929
+ {
930
+ href: props.href,
931
+ target: props.target || ((_c = theme.Link) == null ? void 0 : _c.target),
932
+ style: computedStyle,
933
+ onClick: props.onClick,
934
+ children: props.children
935
+ }
939
936
  );
940
937
  return /* @__PURE__ */ jsx(
941
938
  Typography.Link,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/ant-design",
3
- "version": "2.1.0",
3
+ "version": "2.3.0",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -26,7 +26,7 @@
26
26
  "lodash-es": "*"
27
27
  },
28
28
  "peerDependencies": {
29
- "@faasjs/react": "2.1.0",
29
+ "@faasjs/react": "2.3.0",
30
30
  "antd": "*",
31
31
  "react": "*",
32
32
  "react-dom": "*",
@@ -38,7 +38,7 @@
38
38
  "@testing-library/react": "*",
39
39
  "@testing-library/user-event": "*",
40
40
  "@welldone-software/why-did-you-render": "*",
41
- "@faasjs/react": "2.1.0",
41
+ "@faasjs/react": "2.3.0",
42
42
  "antd": "*",
43
43
  "react": "*",
44
44
  "react-dom": "*",