@faasjs/ant-design 0.0.4-beta.14 → 0.0.4-beta.15

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
@@ -1,4 +1,4 @@
1
- import { FaasDataInjection as FaasDataInjection$1, FaasDataWrapperProps as FaasDataWrapperProps$1, ErrorBoundaryProps } from '@faasjs/react';
1
+ import { ErrorBoundaryProps, FaasDataInjection as FaasDataInjection$1, FaasDataWrapperProps as FaasDataWrapperProps$1 } from '@faasjs/react';
2
2
  export { ErrorBoundaryProps, faas, useFaas } from '@faasjs/react';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { ConfigProviderProps as ConfigProviderProps$1 } from 'antd/es/config-provider';
@@ -73,11 +73,14 @@ declare function useDrawer(init?: DrawerProps): {
73
73
  setDrawerProps(changes: Partial<DrawerProps>): void;
74
74
  };
75
75
 
76
+ declare function ErrorBoundary(props: ErrorBoundaryProps): react_jsx_runtime.JSX.Element;
77
+
76
78
  interface AppProps {
77
79
  children: React.ReactNode;
78
80
  styleProviderProps?: StyleProviderProps;
79
81
  configProviderProps?: ConfigProviderProps$1;
80
82
  browserRouterProps?: BrowserRouterProps;
83
+ errorBoundaryProps?: Omit<ErrorBoundaryProps, 'children'>;
81
84
  }
82
85
  interface useAppProps {
83
86
  message: MessageInstance;
@@ -377,8 +380,6 @@ interface UnionFaasItemProps<Value = any, Values = any> extends FormItemProps, D
377
380
  object?: UnionFaasItemProps<Value, Values>[];
378
381
  }
379
382
 
380
- declare function ErrorBoundary(props: ErrorBoundaryProps): react_jsx_runtime.JSX.Element;
381
-
382
383
  type FormSubmitProps = {
383
384
  /** Default: Submit */
384
385
  text?: string;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { FaasDataInjection as FaasDataInjection$1, FaasDataWrapperProps as FaasDataWrapperProps$1, ErrorBoundaryProps } from '@faasjs/react';
1
+ import { ErrorBoundaryProps, FaasDataInjection as FaasDataInjection$1, FaasDataWrapperProps as FaasDataWrapperProps$1 } from '@faasjs/react';
2
2
  export { ErrorBoundaryProps, faas, useFaas } from '@faasjs/react';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { ConfigProviderProps as ConfigProviderProps$1 } from 'antd/es/config-provider';
@@ -73,11 +73,14 @@ declare function useDrawer(init?: DrawerProps): {
73
73
  setDrawerProps(changes: Partial<DrawerProps>): void;
74
74
  };
75
75
 
76
+ declare function ErrorBoundary(props: ErrorBoundaryProps): react_jsx_runtime.JSX.Element;
77
+
76
78
  interface AppProps {
77
79
  children: React.ReactNode;
78
80
  styleProviderProps?: StyleProviderProps;
79
81
  configProviderProps?: ConfigProviderProps$1;
80
82
  browserRouterProps?: BrowserRouterProps;
83
+ errorBoundaryProps?: Omit<ErrorBoundaryProps, 'children'>;
81
84
  }
82
85
  interface useAppProps {
83
86
  message: MessageInstance;
@@ -377,8 +380,6 @@ interface UnionFaasItemProps<Value = any, Values = any> extends FormItemProps, D
377
380
  object?: UnionFaasItemProps<Value, Values>[];
378
381
  }
379
382
 
380
- declare function ErrorBoundary(props: ErrorBoundaryProps): react_jsx_runtime.JSX.Element;
381
-
382
383
  type FormSubmitProps = {
383
384
  /** Default: Submit */
384
385
  text?: string;
package/dist/index.js CHANGED
@@ -55,6 +55,28 @@ function useDrawer(init) {
55
55
  }
56
56
  };
57
57
  }
58
+ function ErrorChildren(props) {
59
+ return /* @__PURE__ */ jsxRuntime.jsx(
60
+ antd.Alert,
61
+ {
62
+ type: "error",
63
+ message: props.errorMessage,
64
+ description: /* @__PURE__ */ jsxRuntime.jsx(
65
+ "pre",
66
+ {
67
+ style: {
68
+ fontSize: "0.9em",
69
+ overflowX: "auto"
70
+ },
71
+ children: props.errorDescription
72
+ }
73
+ )
74
+ }
75
+ );
76
+ }
77
+ function ErrorBoundary(props) {
78
+ return /* @__PURE__ */ jsxRuntime.jsx(react.ErrorBoundary, { errorChildren: /* @__PURE__ */ jsxRuntime.jsx(ErrorChildren, {}), ...props });
79
+ }
58
80
  var AppContext = react$1.createContext({
59
81
  message: {},
60
82
  notification: {},
@@ -92,13 +114,13 @@ function App(props) {
92
114
  hashPriority: "high",
93
115
  transformers: [cssinjs.legacyLogicalPropertiesTransformer]
94
116
  }),
95
- children: /* @__PURE__ */ jsxRuntime.jsx(antd.ConfigProvider, { ...props.configProviderProps, children: /* @__PURE__ */ jsxRuntime.jsx(AppContext.Provider, { value: memoizedContextValue, children: /* @__PURE__ */ jsxRuntime.jsxs(reactRouterDom.BrowserRouter, { ...props.browserRouterProps, children: [
117
+ children: /* @__PURE__ */ jsxRuntime.jsx(antd.ConfigProvider, { ...props.configProviderProps, children: /* @__PURE__ */ jsxRuntime.jsx(AppContext.Provider, { value: memoizedContextValue, children: /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { ...props.errorBoundaryProps, children: /* @__PURE__ */ jsxRuntime.jsxs(reactRouterDom.BrowserRouter, { ...props.browserRouterProps, children: [
96
118
  messageContextHolder,
97
119
  notificationContextHolder,
98
120
  modal,
99
121
  drawer,
100
122
  /* @__PURE__ */ jsxRuntime.jsx(RoutesApp, { children: props.children })
101
- ] }) }) })
123
+ ] }) }) }) })
102
124
  }
103
125
  );
104
126
  }
@@ -396,28 +418,6 @@ function Description(props) {
396
418
  }
397
419
  );
398
420
  }
399
- function ErrorChildren(props) {
400
- return /* @__PURE__ */ jsxRuntime.jsx(
401
- antd.Alert,
402
- {
403
- type: "error",
404
- message: props.errorMessage,
405
- description: /* @__PURE__ */ jsxRuntime.jsx(
406
- "pre",
407
- {
408
- style: {
409
- fontSize: "0.9em",
410
- overflowX: "auto"
411
- },
412
- children: props.errorDescription
413
- }
414
- )
415
- }
416
- );
417
- }
418
- function ErrorBoundary(props) {
419
- return /* @__PURE__ */ jsxRuntime.jsx(react.ErrorBoundary, { errorChildren: /* @__PURE__ */ jsxRuntime.jsx(ErrorChildren, {}), ...props });
420
- }
421
421
  function processProps(propsCopy, config) {
422
422
  if (!propsCopy.title)
423
423
  propsCopy.title = lodashEs.upperFirst(propsCopy.id);
@@ -1450,7 +1450,7 @@ function Table(props) {
1450
1450
  antd.Table,
1451
1451
  {
1452
1452
  ...props,
1453
- rowKey: props.rowKey || columns[0].id || "id",
1453
+ rowKey: props.rowKey || "id",
1454
1454
  columns,
1455
1455
  dataSource: props.dataSource
1456
1456
  }
@@ -1507,7 +1507,7 @@ function FaasDataTable({
1507
1507
  {
1508
1508
  ...props,
1509
1509
  loading: props.loading,
1510
- rowKey: props.rowKey || currentColumns[0].id || "id",
1510
+ rowKey: props.rowKey || "id",
1511
1511
  columns: currentColumns,
1512
1512
  dataSource: []
1513
1513
  }
@@ -1518,7 +1518,7 @@ function FaasDataTable({
1518
1518
  {
1519
1519
  ...props,
1520
1520
  loading: props.loading,
1521
- rowKey: props.rowKey || currentColumns[0].id || "id",
1521
+ rowKey: props.rowKey || "id",
1522
1522
  columns: currentColumns,
1523
1523
  dataSource: data
1524
1524
  }
@@ -1528,7 +1528,7 @@ function FaasDataTable({
1528
1528
  {
1529
1529
  ...props,
1530
1530
  loading: props.loading,
1531
- rowKey: props.rowKey || currentColumns[0].id || "id",
1531
+ rowKey: props.rowKey || "id",
1532
1532
  columns: currentColumns,
1533
1533
  dataSource: data.rows,
1534
1534
  pagination: {
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { FaasDataWrapper as FaasDataWrapper$1, ErrorBoundary as ErrorBoundary$1, faas } from '@faasjs/react';
1
+ import { ErrorBoundary as ErrorBoundary$1, FaasDataWrapper as FaasDataWrapper$1, faas } from '@faasjs/react';
2
2
  export { faas, useFaas } from '@faasjs/react';
3
- import { Form as Form$1, Modal, Drawer, message, notification, ConfigProvider, Typography, Spin, Descriptions, Input, Button, Row, Col, TimePicker, DatePicker, Switch, Select, InputNumber, Radio, Result, Skeleton, Table as Table$1, Tabs as Tabs$1, Space, Alert } from 'antd';
3
+ import { Form as Form$1, Modal, Drawer, message, notification, ConfigProvider, Typography, Spin, Descriptions, Input, Button, Row, Col, TimePicker, DatePicker, Switch, Select, InputNumber, Radio, Result, Skeleton, Table as Table$1, Tabs as Tabs$1, Alert, Space } from 'antd';
4
4
  export { Drawer, Modal } from 'antd';
5
5
  import { StyleProvider, legacyLogicalPropertiesTransformer } from '@ant-design/cssinjs';
6
6
  import { createContext, useState, useMemo, useContext, useEffect, cloneElement, useCallback, isValidElement, Suspense } from 'react';
@@ -52,6 +52,28 @@ function useDrawer(init) {
52
52
  }
53
53
  };
54
54
  }
55
+ function ErrorChildren(props) {
56
+ return /* @__PURE__ */ jsx(
57
+ Alert,
58
+ {
59
+ type: "error",
60
+ message: props.errorMessage,
61
+ description: /* @__PURE__ */ jsx(
62
+ "pre",
63
+ {
64
+ style: {
65
+ fontSize: "0.9em",
66
+ overflowX: "auto"
67
+ },
68
+ children: props.errorDescription
69
+ }
70
+ )
71
+ }
72
+ );
73
+ }
74
+ function ErrorBoundary(props) {
75
+ return /* @__PURE__ */ jsx(ErrorBoundary$1, { errorChildren: /* @__PURE__ */ jsx(ErrorChildren, {}), ...props });
76
+ }
55
77
  var AppContext = createContext({
56
78
  message: {},
57
79
  notification: {},
@@ -89,13 +111,13 @@ function App(props) {
89
111
  hashPriority: "high",
90
112
  transformers: [legacyLogicalPropertiesTransformer]
91
113
  }),
92
- children: /* @__PURE__ */ jsx(ConfigProvider, { ...props.configProviderProps, children: /* @__PURE__ */ jsx(AppContext.Provider, { value: memoizedContextValue, children: /* @__PURE__ */ jsxs(BrowserRouter, { ...props.browserRouterProps, children: [
114
+ children: /* @__PURE__ */ jsx(ConfigProvider, { ...props.configProviderProps, children: /* @__PURE__ */ jsx(AppContext.Provider, { value: memoizedContextValue, children: /* @__PURE__ */ jsx(ErrorBoundary, { ...props.errorBoundaryProps, children: /* @__PURE__ */ jsxs(BrowserRouter, { ...props.browserRouterProps, children: [
93
115
  messageContextHolder,
94
116
  notificationContextHolder,
95
117
  modal,
96
118
  drawer,
97
119
  /* @__PURE__ */ jsx(RoutesApp, { children: props.children })
98
- ] }) }) })
120
+ ] }) }) }) })
99
121
  }
100
122
  );
101
123
  }
@@ -393,28 +415,6 @@ function Description(props) {
393
415
  }
394
416
  );
395
417
  }
396
- function ErrorChildren(props) {
397
- return /* @__PURE__ */ jsx(
398
- Alert,
399
- {
400
- type: "error",
401
- message: props.errorMessage,
402
- description: /* @__PURE__ */ jsx(
403
- "pre",
404
- {
405
- style: {
406
- fontSize: "0.9em",
407
- overflowX: "auto"
408
- },
409
- children: props.errorDescription
410
- }
411
- )
412
- }
413
- );
414
- }
415
- function ErrorBoundary(props) {
416
- return /* @__PURE__ */ jsx(ErrorBoundary$1, { errorChildren: /* @__PURE__ */ jsx(ErrorChildren, {}), ...props });
417
- }
418
418
  function processProps(propsCopy, config) {
419
419
  if (!propsCopy.title)
420
420
  propsCopy.title = upperFirst(propsCopy.id);
@@ -1447,7 +1447,7 @@ function Table(props) {
1447
1447
  Table$1,
1448
1448
  {
1449
1449
  ...props,
1450
- rowKey: props.rowKey || columns[0].id || "id",
1450
+ rowKey: props.rowKey || "id",
1451
1451
  columns,
1452
1452
  dataSource: props.dataSource
1453
1453
  }
@@ -1504,7 +1504,7 @@ function FaasDataTable({
1504
1504
  {
1505
1505
  ...props,
1506
1506
  loading: props.loading,
1507
- rowKey: props.rowKey || currentColumns[0].id || "id",
1507
+ rowKey: props.rowKey || "id",
1508
1508
  columns: currentColumns,
1509
1509
  dataSource: []
1510
1510
  }
@@ -1515,7 +1515,7 @@ function FaasDataTable({
1515
1515
  {
1516
1516
  ...props,
1517
1517
  loading: props.loading,
1518
- rowKey: props.rowKey || currentColumns[0].id || "id",
1518
+ rowKey: props.rowKey || "id",
1519
1519
  columns: currentColumns,
1520
1520
  dataSource: data
1521
1521
  }
@@ -1525,7 +1525,7 @@ function FaasDataTable({
1525
1525
  {
1526
1526
  ...props,
1527
1527
  loading: props.loading,
1528
- rowKey: props.rowKey || currentColumns[0].id || "id",
1528
+ rowKey: props.rowKey || "id",
1529
1529
  columns: currentColumns,
1530
1530
  dataSource: data.rows,
1531
1531
  pagination: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/ant-design",
3
- "version": "0.0.4-beta.14",
3
+ "version": "0.0.4-beta.15",
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": "0.0.4-beta.14",
29
+ "@faasjs/react": "0.0.4-beta.15",
30
30
  "antd": "*",
31
31
  "react": "*",
32
32
  "react-dom": "*",
@@ -37,7 +37,7 @@
37
37
  "@testing-library/jest-dom": "*",
38
38
  "@testing-library/react": "*",
39
39
  "@testing-library/user-event": "*",
40
- "@faasjs/react": "0.0.4-beta.14",
40
+ "@faasjs/react": "0.0.4-beta.15",
41
41
  "antd": "*",
42
42
  "react": "*",
43
43
  "react-dom": "*",