@faasjs/ant-design 6.3.1 → 6.4.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
@@ -562,7 +562,7 @@ function FormItem(props) {
562
562
  }, [props]);
563
563
  if (!computedProps) return null;
564
564
  if (hidden)
565
- return /* @__PURE__ */ jsxRuntime.jsx(antd.Form.Item, { ...computedProps, noStyle: true, rules: [], children: /* @__PURE__ */ jsxRuntime.jsx(antd.Input, { hidden: true }) });
565
+ return /* @__PURE__ */ jsxRuntime.jsx(antd.Form.Item, { ...computedProps, noStyle: true, rules: [], children: /* @__PURE__ */ jsxRuntime.jsx(antd.Input, { type: "hidden", hidden: true }) });
566
566
  if (extendTypes?.[computedProps.type])
567
567
  return /* @__PURE__ */ jsxRuntime.jsx(antd.Form.Item, { ...computedProps, children: extendTypes[computedProps.type].children });
568
568
  if (computedProps.formChildren === null) return null;
@@ -793,7 +793,7 @@ function Form(props) {
793
793
  if (propsCopy.items?.length)
794
794
  for (const item of propsCopy.items) {
795
795
  if (isFormItemProps(item) && item.if)
796
- item.hidden = !item.if(propsCopy.initialValues || /* @__PURE__ */ Object.create(null));
796
+ item.hidden = !item.if(initialValues || /* @__PURE__ */ Object.create(null));
797
797
  }
798
798
  if (propsCopy.onFinish) {
799
799
  propsCopy.onFinish = async (values) => {
@@ -1501,15 +1501,15 @@ function FaasDataTable({
1501
1501
  rowKey: props.rowKey || "id",
1502
1502
  columns: currentColumns,
1503
1503
  dataSource: data.rows,
1504
- pagination: {
1505
- ...props.pagination,
1506
- ...data.pagination
1504
+ pagination: props.pagination === false ? false : {
1505
+ ...props.pagination || /* @__PURE__ */ Object.create(null),
1506
+ ...data.pagination || /* @__PURE__ */ Object.create(null)
1507
1507
  },
1508
1508
  onChange: (pagination, filters, sorter, extra) => {
1509
1509
  if (props.onChange) {
1510
1510
  const processed = props.onChange(pagination, filters, sorter, extra);
1511
1511
  reload({
1512
- ...params,
1512
+ ...params || /* @__PURE__ */ Object.create(null),
1513
1513
  pagination: processed.pagination,
1514
1514
  filters: processed.filters,
1515
1515
  sorter: processed.sorter,
@@ -1518,7 +1518,7 @@ function FaasDataTable({
1518
1518
  return;
1519
1519
  }
1520
1520
  reload({
1521
- ...params,
1521
+ ...params || /* @__PURE__ */ Object.create(null),
1522
1522
  pagination,
1523
1523
  filters,
1524
1524
  sorter
package/dist/index.d.ts CHANGED
@@ -13,7 +13,7 @@ import * as antd_es_modal_PurePanel from 'antd/es/modal/PurePanel';
13
13
  import * as antd_es_modal_useModal from 'antd/es/modal/useModal';
14
14
  import * as antd_es_modal_confirm from 'antd/es/modal/confirm';
15
15
  import { Dayjs } from 'dayjs';
16
- import { FaasAction } from '@faasjs/types';
16
+ import { FaasActionUnionType, FaasAction } from '@faasjs/types';
17
17
  import * as antd_es_form_FormItem from 'antd/es/form/FormItem';
18
18
  import { RuleObject } from 'rc-field-form/lib/interface';
19
19
  import { FilterValue, SorterResult, TableCurrentDataSource } from 'antd/es/table/interface';
@@ -294,7 +294,7 @@ declare namespace FaasDataWrapper {
294
294
  * const MyComponent = withFaasData(({ data }) => <div>{data.name}</div>, { action: 'test', params: { a: 1 } })
295
295
  * ```
296
296
  */
297
- declare function withFaasData<PathOrData extends FaasAction, TComponentProps extends Required<FaasDataInjection<PathOrData>> = Required<FaasDataInjection<PathOrData>>>(Component: React.FC<TComponentProps & Record<string, any>>, faasProps: FaasDataWrapperProps<PathOrData>): React.FC<Omit<TComponentProps, keyof FaasDataInjection<PathOrData>> & Record<string, any>>;
297
+ declare function withFaasData<PathOrData extends FaasActionUnionType, TComponentProps extends Required<FaasDataInjection<PathOrData>> = Required<FaasDataInjection<PathOrData>>>(Component: React.FC<TComponentProps & Record<string, any>>, faasProps: FaasDataWrapperProps<PathOrData>): React.FC<Omit<TComponentProps, keyof FaasDataInjection<PathOrData>>>;
298
298
 
299
299
  interface ExtendDescriptionTypeProps<T = any> {
300
300
  children?: UnionFaasItemElement<T>;
package/dist/index.mjs CHANGED
@@ -558,7 +558,7 @@ function FormItem(props) {
558
558
  }, [props]);
559
559
  if (!computedProps) return null;
560
560
  if (hidden)
561
- return /* @__PURE__ */ jsx(Form$1.Item, { ...computedProps, noStyle: true, rules: [], children: /* @__PURE__ */ jsx(Input, { hidden: true }) });
561
+ return /* @__PURE__ */ jsx(Form$1.Item, { ...computedProps, noStyle: true, rules: [], children: /* @__PURE__ */ jsx(Input, { type: "hidden", hidden: true }) });
562
562
  if (extendTypes?.[computedProps.type])
563
563
  return /* @__PURE__ */ jsx(Form$1.Item, { ...computedProps, children: extendTypes[computedProps.type].children });
564
564
  if (computedProps.formChildren === null) return null;
@@ -789,7 +789,7 @@ function Form(props) {
789
789
  if (propsCopy.items?.length)
790
790
  for (const item of propsCopy.items) {
791
791
  if (isFormItemProps(item) && item.if)
792
- item.hidden = !item.if(propsCopy.initialValues || /* @__PURE__ */ Object.create(null));
792
+ item.hidden = !item.if(initialValues || /* @__PURE__ */ Object.create(null));
793
793
  }
794
794
  if (propsCopy.onFinish) {
795
795
  propsCopy.onFinish = async (values) => {
@@ -1497,15 +1497,15 @@ function FaasDataTable({
1497
1497
  rowKey: props.rowKey || "id",
1498
1498
  columns: currentColumns,
1499
1499
  dataSource: data.rows,
1500
- pagination: {
1501
- ...props.pagination,
1502
- ...data.pagination
1500
+ pagination: props.pagination === false ? false : {
1501
+ ...props.pagination || /* @__PURE__ */ Object.create(null),
1502
+ ...data.pagination || /* @__PURE__ */ Object.create(null)
1503
1503
  },
1504
1504
  onChange: (pagination, filters, sorter, extra) => {
1505
1505
  if (props.onChange) {
1506
1506
  const processed = props.onChange(pagination, filters, sorter, extra);
1507
1507
  reload({
1508
- ...params,
1508
+ ...params || /* @__PURE__ */ Object.create(null),
1509
1509
  pagination: processed.pagination,
1510
1510
  filters: processed.filters,
1511
1511
  sorter: processed.sorter,
@@ -1514,7 +1514,7 @@ function FaasDataTable({
1514
1514
  return;
1515
1515
  }
1516
1516
  reload({
1517
- ...params,
1517
+ ...params || /* @__PURE__ */ Object.create(null),
1518
1518
  pagination,
1519
1519
  filters,
1520
1520
  sorter
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/ant-design",
3
- "version": "6.3.1",
3
+ "version": "6.4.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.3.1",
33
+ "@faasjs/react": "6.4.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.3.1",
43
+ "@faasjs/react": "6.4.0",
44
44
  "antd": "*",
45
45
  "@ant-design/icons": "*",
46
46
  "lodash-es": "*",