@faasjs/ant-design 2.1.0 → 2.2.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 +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +20 -23
- package/dist/index.mjs +20 -23
- package/package.json +3 -3
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
|
|
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';
|
|
@@ -541,7 +541,7 @@ declare namespace Form {
|
|
|
541
541
|
var whyDidYouRender: boolean;
|
|
542
542
|
var useForm: typeof antd_es_form_Form.useForm;
|
|
543
543
|
var useFormInstance: typeof antd_es_form_hooks_useFormInstance.default;
|
|
544
|
-
var useWatch: typeof
|
|
544
|
+
var useWatch: typeof rc_field_form.useWatch;
|
|
545
545
|
var Item: typeof FormItem;
|
|
546
546
|
var List: react.FC<antd_es_form.FormListProps>;
|
|
547
547
|
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
|
|
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';
|
|
@@ -541,7 +541,7 @@ declare namespace Form {
|
|
|
541
541
|
var whyDidYouRender: boolean;
|
|
542
542
|
var useForm: typeof antd_es_form_Form.useForm;
|
|
543
543
|
var useFormInstance: typeof antd_es_form_hooks_useFormInstance.default;
|
|
544
|
-
var useWatch: typeof
|
|
544
|
+
var useWatch: typeof rc_field_form.useWatch;
|
|
545
545
|
var Item: typeof FormItem;
|
|
546
546
|
var List: react.FC<antd_es_form.FormListProps>;
|
|
547
547
|
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
|
|
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
|
|
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
|
|
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
|
|
70
|
+
setDrawerProps
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
73
|
function ErrorChildren(props) {
|
|
@@ -172,21 +172,21 @@ var AppContext = react.createSplitedContext({
|
|
|
172
172
|
});
|
|
173
173
|
function RoutesApp(props) {
|
|
174
174
|
const location = reactRouterDom.useLocation();
|
|
175
|
-
const { drawerProps, setDrawerProps
|
|
175
|
+
const { drawerProps, setDrawerProps, modalProps, setModalProps } = useApp();
|
|
176
176
|
react$1.useEffect(() => {
|
|
177
177
|
console.debug("location", location);
|
|
178
178
|
if (drawerProps.open)
|
|
179
|
-
|
|
179
|
+
setDrawerProps({ open: false });
|
|
180
180
|
if (modalProps.open)
|
|
181
|
-
|
|
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
|
|
189
|
-
const { drawer, drawerProps, setDrawerProps
|
|
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
|
|
205
|
+
setDrawerProps,
|
|
206
206
|
modalProps,
|
|
207
|
-
setModalProps
|
|
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
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
66
|
+
setDrawerProps
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
69
|
function ErrorChildren(props) {
|
|
@@ -168,21 +168,21 @@ var AppContext = createSplitedContext({
|
|
|
168
168
|
});
|
|
169
169
|
function RoutesApp(props) {
|
|
170
170
|
const location = useLocation();
|
|
171
|
-
const { drawerProps, setDrawerProps
|
|
171
|
+
const { drawerProps, setDrawerProps, modalProps, setModalProps } = useApp();
|
|
172
172
|
useEffect(() => {
|
|
173
173
|
console.debug("location", location);
|
|
174
174
|
if (drawerProps.open)
|
|
175
|
-
|
|
175
|
+
setDrawerProps({ open: false });
|
|
176
176
|
if (modalProps.open)
|
|
177
|
-
|
|
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
|
|
185
|
-
const { drawer, drawerProps, setDrawerProps
|
|
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
|
|
201
|
+
setDrawerProps,
|
|
202
202
|
modalProps,
|
|
203
|
-
setModalProps
|
|
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
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
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.
|
|
3
|
+
"version": "2.2.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.
|
|
29
|
+
"@faasjs/react": "2.2.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.
|
|
41
|
+
"@faasjs/react": "2.2.0",
|
|
42
42
|
"antd": "*",
|
|
43
43
|
"react": "*",
|
|
44
44
|
"react-dom": "*",
|