@faasjs/ant-design 0.0.5-beta.2 → 0.0.5-beta.4

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
@@ -5,7 +5,7 @@ import { ConfigProviderProps as ConfigProviderProps$1 } from 'antd/es/config-pro
5
5
  import { StyleProviderProps } from '@ant-design/cssinjs/lib/StyleContext';
6
6
  import { MessageInstance } from 'antd/es/message/interface';
7
7
  import { NotificationInstance } from 'antd/es/notification/interface';
8
- import { ModalProps as ModalProps$1, DrawerProps as DrawerProps$1, FormItemProps as FormItemProps$1, InputProps, InputNumberProps, SwitchProps, SelectProps, DatePickerProps, TimePickerProps, FormInstance, DescriptionsProps, TableColumnProps, TablePaginationConfig, TableProps as TableProps$1, FormProps as FormProps$1, ButtonProps, TabsProps as TabsProps$1 } from 'antd';
8
+ import { ModalProps as ModalProps$1, DrawerProps as DrawerProps$1, FormItemProps as FormItemProps$1, InputProps, InputNumberProps, SwitchProps, SelectProps, DatePickerProps, FormInstance, DescriptionsProps, TableColumnProps, TablePaginationConfig, TableProps as TableProps$1, FormProps as FormProps$1, ButtonProps, TabsProps as TabsProps$1 } from 'antd';
9
9
  export { Drawer, Modal } from 'antd';
10
10
  import { BrowserRouterProps, RouteProps } from 'react-router-dom';
11
11
  import * as react from 'react';
@@ -181,7 +181,7 @@ type ExtendTypes = {
181
181
  };
182
182
  type ExtendFormItemProps = BaseItemProps & FormItemProps$1;
183
183
  interface FormItemProps<T = any> extends FaasItemProps, Omit<FormItemProps$1<T>, 'id' | 'children' | 'render'> {
184
- input?: InputProps | InputNumberProps | SwitchProps | SelectProps<T> | DatePickerProps | TimePickerProps;
184
+ input?: InputProps | InputNumberProps | SwitchProps | SelectProps<T> | DatePickerProps;
185
185
  maxCount?: number;
186
186
  object?: FormItemProps[];
187
187
  disabled?: boolean;
package/dist/index.d.ts CHANGED
@@ -5,7 +5,7 @@ import { ConfigProviderProps as ConfigProviderProps$1 } from 'antd/es/config-pro
5
5
  import { StyleProviderProps } from '@ant-design/cssinjs/lib/StyleContext';
6
6
  import { MessageInstance } from 'antd/es/message/interface';
7
7
  import { NotificationInstance } from 'antd/es/notification/interface';
8
- import { ModalProps as ModalProps$1, DrawerProps as DrawerProps$1, FormItemProps as FormItemProps$1, InputProps, InputNumberProps, SwitchProps, SelectProps, DatePickerProps, TimePickerProps, FormInstance, DescriptionsProps, TableColumnProps, TablePaginationConfig, TableProps as TableProps$1, FormProps as FormProps$1, ButtonProps, TabsProps as TabsProps$1 } from 'antd';
8
+ import { ModalProps as ModalProps$1, DrawerProps as DrawerProps$1, FormItemProps as FormItemProps$1, InputProps, InputNumberProps, SwitchProps, SelectProps, DatePickerProps, FormInstance, DescriptionsProps, TableColumnProps, TablePaginationConfig, TableProps as TableProps$1, FormProps as FormProps$1, ButtonProps, TabsProps as TabsProps$1 } from 'antd';
9
9
  export { Drawer, Modal } from 'antd';
10
10
  import { BrowserRouterProps, RouteProps } from 'react-router-dom';
11
11
  import * as react from 'react';
@@ -181,7 +181,7 @@ type ExtendTypes = {
181
181
  };
182
182
  type ExtendFormItemProps = BaseItemProps & FormItemProps$1;
183
183
  interface FormItemProps<T = any> extends FaasItemProps, Omit<FormItemProps$1<T>, 'id' | 'children' | 'render'> {
184
- input?: InputProps | InputNumberProps | SwitchProps | SelectProps<T> | DatePickerProps | TimePickerProps;
184
+ input?: InputProps | InputNumberProps | SwitchProps | SelectProps<T> | DatePickerProps;
185
185
  maxCount?: number;
186
186
  object?: FormItemProps[];
187
187
  disabled?: boolean;
package/dist/index.js CHANGED
@@ -646,7 +646,12 @@ function FormItem(props) {
646
646
  case "date":
647
647
  return /* @__PURE__ */ jsxRuntime.jsx(antd.Form.Item, { ...computedProps, children: /* @__PURE__ */ jsxRuntime.jsx(antd.DatePicker, { ...computedProps.input }) });
648
648
  case "time":
649
- return /* @__PURE__ */ jsxRuntime.jsx(antd.Form.Item, { ...computedProps, children: /* @__PURE__ */ jsxRuntime.jsx(antd.TimePicker, { ...computedProps.input }) });
649
+ return /* @__PURE__ */ jsxRuntime.jsx(antd.Form.Item, { ...computedProps, children: /* @__PURE__ */ jsxRuntime.jsx(
650
+ antd.DatePicker,
651
+ {
652
+ ...{ ...computedProps.input, showTime: true }
653
+ }
654
+ ) });
650
655
  case "object":
651
656
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
652
657
  computedProps.label && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ant-form-item-label", children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -1041,8 +1046,9 @@ function Table(props) {
1041
1046
  return item;
1042
1047
  };
1043
1048
  react$1.useEffect(() => {
1044
- var _a, _b;
1045
- for (const item of props.items) {
1049
+ var _a, _b, _c;
1050
+ const items = lodashEs.cloneDeep(props.items);
1051
+ for (const item of items) {
1046
1052
  if (!item.key)
1047
1053
  item.key = item.id;
1048
1054
  if (!item.dataIndex)
@@ -1355,6 +1361,7 @@ function Table(props) {
1355
1361
  }
1356
1362
  break;
1357
1363
  case "time":
1364
+ item.width = (_c = item.width) != null ? _c : 200;
1358
1365
  if (!item.render)
1359
1366
  item.render = (value) => processValue(item, value);
1360
1367
  if (typeof item.sorter === "undefined")
@@ -1428,8 +1435,8 @@ function Table(props) {
1428
1435
  break;
1429
1436
  }
1430
1437
  }
1431
- setColumns(props.items);
1432
- }, [JSON.stringify(props.items)]);
1438
+ setColumns(items);
1439
+ }, [props.items]);
1433
1440
  react$1.useEffect(() => {
1434
1441
  if (!props.dataSource || !columns)
1435
1442
  return;
@@ -1595,23 +1602,23 @@ function Title(props) {
1595
1602
  return null;
1596
1603
  }
1597
1604
 
1598
- Object.defineProperty(exports, 'faas', {
1605
+ Object.defineProperty(exports, "faas", {
1599
1606
  enumerable: true,
1600
1607
  get: function () { return react.faas; }
1601
1608
  });
1602
- Object.defineProperty(exports, 'useFaas', {
1609
+ Object.defineProperty(exports, "useFaas", {
1603
1610
  enumerable: true,
1604
1611
  get: function () { return react.useFaas; }
1605
1612
  });
1606
- Object.defineProperty(exports, 'Drawer', {
1613
+ Object.defineProperty(exports, "Drawer", {
1607
1614
  enumerable: true,
1608
1615
  get: function () { return antd.Drawer; }
1609
1616
  });
1610
- Object.defineProperty(exports, 'Modal', {
1617
+ Object.defineProperty(exports, "Modal", {
1611
1618
  enumerable: true,
1612
1619
  get: function () { return antd.Modal; }
1613
1620
  });
1614
- Object.defineProperty(exports, 'lazy', {
1621
+ Object.defineProperty(exports, "lazy", {
1615
1622
  enumerable: true,
1616
1623
  get: function () { return react$1.lazy; }
1617
1624
  });
package/dist/index.mjs CHANGED
@@ -1,13 +1,13 @@
1
1
  import { ErrorBoundary as ErrorBoundary$1, FaasReactClient, 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 as ConfigProvider$1, 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';
3
+ import { Form as Form$1, Modal, Drawer, message, notification, ConfigProvider as ConfigProvider$1, Typography, Spin, Descriptions, Input, Button, Row, Col, 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, useEffect, useContext, useMemo, cloneElement, useCallback, isValidElement, Suspense } from 'react';
7
7
  export { lazy } from 'react';
8
8
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
9
9
  import { BrowserRouter, useNavigate, Link as Link$1, Routes as Routes$1, Route, useLocation } from 'react-router-dom';
10
- import { defaultsDeep, isNil, upperFirst, isFunction, uniqBy } from 'lodash-es';
10
+ import { defaultsDeep, isNil, upperFirst, isFunction, cloneDeep, uniqBy } from 'lodash-es';
11
11
  import dayjs2 from 'dayjs';
12
12
  import { PlusOutlined, MinusCircleOutlined, CheckOutlined, CloseOutlined } from '@ant-design/icons';
13
13
 
@@ -643,7 +643,12 @@ function FormItem(props) {
643
643
  case "date":
644
644
  return /* @__PURE__ */ jsx(Form$1.Item, { ...computedProps, children: /* @__PURE__ */ jsx(DatePicker, { ...computedProps.input }) });
645
645
  case "time":
646
- return /* @__PURE__ */ jsx(Form$1.Item, { ...computedProps, children: /* @__PURE__ */ jsx(TimePicker, { ...computedProps.input }) });
646
+ return /* @__PURE__ */ jsx(Form$1.Item, { ...computedProps, children: /* @__PURE__ */ jsx(
647
+ DatePicker,
648
+ {
649
+ ...{ ...computedProps.input, showTime: true }
650
+ }
651
+ ) });
647
652
  case "object":
648
653
  return /* @__PURE__ */ jsxs(Fragment, { children: [
649
654
  computedProps.label && /* @__PURE__ */ jsx("div", { className: "ant-form-item-label", children: /* @__PURE__ */ jsx(
@@ -1038,8 +1043,9 @@ function Table(props) {
1038
1043
  return item;
1039
1044
  };
1040
1045
  useEffect(() => {
1041
- var _a, _b;
1042
- for (const item of props.items) {
1046
+ var _a, _b, _c;
1047
+ const items = cloneDeep(props.items);
1048
+ for (const item of items) {
1043
1049
  if (!item.key)
1044
1050
  item.key = item.id;
1045
1051
  if (!item.dataIndex)
@@ -1352,6 +1358,7 @@ function Table(props) {
1352
1358
  }
1353
1359
  break;
1354
1360
  case "time":
1361
+ item.width = (_c = item.width) != null ? _c : 200;
1355
1362
  if (!item.render)
1356
1363
  item.render = (value) => processValue(item, value);
1357
1364
  if (typeof item.sorter === "undefined")
@@ -1425,8 +1432,8 @@ function Table(props) {
1425
1432
  break;
1426
1433
  }
1427
1434
  }
1428
- setColumns(props.items);
1429
- }, [JSON.stringify(props.items)]);
1435
+ setColumns(items);
1436
+ }, [props.items]);
1430
1437
  useEffect(() => {
1431
1438
  if (!props.dataSource || !columns)
1432
1439
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/ant-design",
3
- "version": "0.0.5-beta.2",
3
+ "version": "0.0.5-beta.4",
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.5-beta.2",
29
+ "@faasjs/react": "0.0.5-beta.4",
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.5-beta.2",
40
+ "@faasjs/react": "0.0.5-beta.4",
41
41
  "antd": "*",
42
42
  "react": "*",
43
43
  "react-dom": "*",