@faasjs/ant-design 6.1.0 → 6.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.cjs CHANGED
@@ -214,7 +214,7 @@ function App(props) {
214
214
  children: /* @__PURE__ */ jsxRuntime.jsx(ConfigProvider, { ...props.faasConfigProviderProps, children: /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { ...props.errorBoundaryProps, children: /* @__PURE__ */ jsxRuntime.jsxs(
215
215
  react.OptionalWrapper,
216
216
  {
217
- condition: props.browserRouterProps !== false,
217
+ condition: typeof document !== "undefined" && props.browserRouterProps !== false,
218
218
  Wrapper: reactRouterDom.BrowserRouter,
219
219
  wrapperProps: props.browserRouterProps,
220
220
  children: [
@@ -1473,7 +1473,7 @@ function FaasDataTable({
1473
1473
  }
1474
1474
  return newColumns;
1475
1475
  });
1476
- }, [columns, data]);
1476
+ }, [data, props.dataSource]);
1477
1477
  if (!data)
1478
1478
  return /* @__PURE__ */ jsxRuntime.jsx(
1479
1479
  antd.Table,
@@ -1550,7 +1550,7 @@ function Title(props) {
1550
1550
  react$1.useEffect(() => {
1551
1551
  const title = Array.isArray(props.title) ? props.title : [props.title];
1552
1552
  document.title = title.concat(props.suffix || theme.Title.suffix).filter((t) => !!t).join(props.separator || theme.Title.separator);
1553
- }, [props]);
1553
+ }, [props, theme.Title]);
1554
1554
  if (props.h1) {
1555
1555
  if (typeof props.h1 === "boolean")
1556
1556
  return /* @__PURE__ */ jsxRuntime.jsx("h1", { children: Array.isArray(props.title) ? props.title[0] : props.title });
package/dist/index.d.ts CHANGED
@@ -156,7 +156,9 @@ interface AppProps {
156
156
  /**
157
157
  * `false` to disable BrowserRouter.
158
158
  *
159
- * @see https://reactrouter.com/en/router-components/browser-router
159
+ * Auto disable when not in browser.
160
+ *
161
+ * @see https://api.reactrouter.com/v7/interfaces/react_router.BrowserRouterProps.html
160
162
  */
161
163
  browserRouterProps?: BrowserRouterProps | false;
162
164
  /** @see https://faasjs.com/doc/ant-design/#errorboundary */
@@ -179,7 +181,7 @@ interface useAppProps {
179
181
  * - Integrated Ant Design's [Message](https://ant.design/components/message/) and [Notification](https://ant.design/components/notification/).
180
182
  * - Based on FaasJS's [ConfigProvider](https://faasjs.com/doc/ant-design/#configprovider).
181
183
  * - Integrated FaasJS's [Modal](https://faasjs.com/doc/ant-design/#usemodal), [Drawer](https://faasjs.com/doc/ant-design/#usedrawer) and [ErrorBoundary](https://faasjs.com/doc/ant-design/#errorboundary).
182
- * - Integrated React Router's [BrowserRouter](https://reactrouter.com/en/router-components/browser-router).
184
+ * - Integrated React Router's [BrowserRouter](https://api.reactrouter.com/v7/interfaces/react_router.BrowserRouterProps.html).
183
185
  *
184
186
  * @example
185
187
  * ```tsx
@@ -190,7 +192,7 @@ interface useAppProps {
190
192
  * <App
191
193
  * styleProviderProps={{}} // https://ant.design/docs/react/compatible-style#styleprovider
192
194
  * configProviderProps={{}} // https://ant.design/components/config-provider/#API
193
- * browserRouterProps={{}} // https://reactrouter.com/en/router-components/browser-router
195
+ * browserRouterProps={{}} // https://api.reactrouter.com/v7/interfaces/react_router.BrowserRouterProps.html
194
196
  * errorBoundaryProps={{}} // https://faasjs.com/doc/ant-design/#errorboundary
195
197
  * faasConfigProviderProps={{}} // https://faasjs.com/doc/ant-design/#configprovider
196
198
  * >
package/dist/index.mjs CHANGED
@@ -210,7 +210,7 @@ function App(props) {
210
210
  children: /* @__PURE__ */ jsx(ConfigProvider, { ...props.faasConfigProviderProps, children: /* @__PURE__ */ jsx(ErrorBoundary, { ...props.errorBoundaryProps, children: /* @__PURE__ */ jsxs(
211
211
  OptionalWrapper,
212
212
  {
213
- condition: props.browserRouterProps !== false,
213
+ condition: typeof document !== "undefined" && props.browserRouterProps !== false,
214
214
  Wrapper: BrowserRouter,
215
215
  wrapperProps: props.browserRouterProps,
216
216
  children: [
@@ -1469,7 +1469,7 @@ function FaasDataTable({
1469
1469
  }
1470
1470
  return newColumns;
1471
1471
  });
1472
- }, [columns, data]);
1472
+ }, [data, props.dataSource]);
1473
1473
  if (!data)
1474
1474
  return /* @__PURE__ */ jsx(
1475
1475
  Table$1,
@@ -1546,7 +1546,7 @@ function Title(props) {
1546
1546
  useEffect(() => {
1547
1547
  const title = Array.isArray(props.title) ? props.title : [props.title];
1548
1548
  document.title = title.concat(props.suffix || theme.Title.suffix).filter((t) => !!t).join(props.separator || theme.Title.separator);
1549
- }, [props]);
1549
+ }, [props, theme.Title]);
1550
1550
  if (props.h1) {
1551
1551
  if (typeof props.h1 === "boolean")
1552
1552
  return /* @__PURE__ */ jsx("h1", { children: Array.isArray(props.title) ? props.title[0] : props.title });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/ant-design",
3
- "version": "6.1.0",
3
+ "version": "6.3.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -30,7 +30,7 @@
30
30
  "dist"
31
31
  ],
32
32
  "peerDependencies": {
33
- "@faasjs/react": "6.1.0",
33
+ "@faasjs/react": "6.3.0",
34
34
  "antd": "*",
35
35
  "@ant-design/icons": "*",
36
36
  "lodash-es": "*",
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/lodash-es": "*",
43
- "@faasjs/react": "6.1.0",
43
+ "@faasjs/react": "6.3.0",
44
44
  "antd": "*",
45
45
  "@ant-design/icons": "*",
46
46
  "lodash-es": "*",