@faasjs/ant-design 3.7.1 → 4.1.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/README.md CHANGED
@@ -34,6 +34,7 @@ type FaasItemProps = {
34
34
 
35
35
  - [App](functions/App.md)
36
36
  - [Blank](functions/Blank.md)
37
+ - [ConfigContext](functions/ConfigContext.md)
37
38
  - [ConfigProvider](functions/ConfigProvider.md)
38
39
  - [Description](functions/Description.md)
39
40
  - [Drawer](functions/Drawer.md)
@@ -107,7 +108,3 @@ type FaasItemProps = {
107
108
  - [UnionFaasItemInjection](type-aliases/UnionFaasItemInjection.md)
108
109
  - [UnionFaasItemRender](type-aliases/UnionFaasItemRender.md)
109
110
  - [UnionScene](type-aliases/UnionScene.md)
110
-
111
- ## Variables
112
-
113
- - [ConfigContext](variables/ConfigContext.md)
package/dist/index.d.mts CHANGED
@@ -7,7 +7,7 @@ import { MessageInstance } from 'antd/es/message/interface';
7
7
  import { NotificationInstance } from 'antd/es/notification/interface';
8
8
  import { BrowserRouterProps, RouteProps } from 'react-router-dom';
9
9
  import * as react from 'react';
10
- import { CSSProperties, Dispatch, SetStateAction, ReactNode, ReactElement, LazyExoticComponent, ComponentType } from 'react';
10
+ import { CSSProperties, JSX, Dispatch, SetStateAction, ReactNode, ReactElement, LazyExoticComponent, ComponentType } from 'react';
11
11
  export { lazy } from 'react';
12
12
  import * as antd_es_modal_PurePanel from 'antd/es/modal/PurePanel';
13
13
  import * as antd_es_modal_useModal from 'antd/es/modal/useModal';
@@ -346,8 +346,9 @@ interface DescriptionItemContentProps<T = any> {
346
346
  * />
347
347
  * ```
348
348
  */
349
- declare function Description<T extends Record<string, any> = any>(props: DescriptionProps<T>): react_jsx_runtime.JSX.Element;
349
+ declare function Description<T extends Record<string, any> = any>({ faasData, dataSource, renderTitle, extendTypes, ...props }: DescriptionProps<T>): react_jsx_runtime.JSX.Element;
350
350
  declare namespace Description {
351
+ var displayName: string;
351
352
  var whyDidYouRender: boolean;
352
353
  }
353
354
 
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ import { MessageInstance } from 'antd/es/message/interface';
7
7
  import { NotificationInstance } from 'antd/es/notification/interface';
8
8
  import { BrowserRouterProps, RouteProps } from 'react-router-dom';
9
9
  import * as react from 'react';
10
- import { CSSProperties, Dispatch, SetStateAction, ReactNode, ReactElement, LazyExoticComponent, ComponentType } from 'react';
10
+ import { CSSProperties, JSX, Dispatch, SetStateAction, ReactNode, ReactElement, LazyExoticComponent, ComponentType } from 'react';
11
11
  export { lazy } from 'react';
12
12
  import * as antd_es_modal_PurePanel from 'antd/es/modal/PurePanel';
13
13
  import * as antd_es_modal_useModal from 'antd/es/modal/useModal';
@@ -346,8 +346,9 @@ interface DescriptionItemContentProps<T = any> {
346
346
  * />
347
347
  * ```
348
348
  */
349
- declare function Description<T extends Record<string, any> = any>(props: DescriptionProps<T>): react_jsx_runtime.JSX.Element;
349
+ declare function Description<T extends Record<string, any> = any>({ faasData, dataSource, renderTitle, extendTypes, ...props }: DescriptionProps<T>): react_jsx_runtime.JSX.Element;
350
350
  declare namespace Description {
351
+ var displayName: string;
351
352
  var whyDidYouRender: boolean;
352
353
  }
353
354
 
package/dist/index.js CHANGED
@@ -442,22 +442,37 @@ function DescriptionItemContent(props) {
442
442
  return computedProps.value || null;
443
443
  }
444
444
  }
445
+ DescriptionItemContent.displayName = "DescriptionItemContent";
445
446
  DescriptionItemContent.whyDidYouRender = true;
446
- function Description(props) {
447
- if (props.faasData && !props.dataSource)
447
+ function Description({
448
+ faasData,
449
+ dataSource,
450
+ renderTitle,
451
+ extendTypes,
452
+ ...props
453
+ }) {
454
+ if (faasData && !dataSource)
448
455
  return /* @__PURE__ */ jsxRuntime.jsx(
449
456
  FaasDataWrapper,
450
457
  {
451
- render: ({ data }) => /* @__PURE__ */ jsxRuntime.jsx(Description, { ...props, dataSource: data }),
452
- ...props.faasData
458
+ render: ({ data }) => /* @__PURE__ */ jsxRuntime.jsx(
459
+ Description,
460
+ {
461
+ ...props,
462
+ dataSource: data,
463
+ renderTitle,
464
+ extendTypes
465
+ }
466
+ ),
467
+ ...faasData
453
468
  }
454
469
  );
455
470
  return /* @__PURE__ */ jsxRuntime.jsx(
456
471
  antd.Descriptions,
457
472
  {
458
473
  ...props,
459
- title: typeof props.renderTitle === "function" ? props.renderTitle(props.dataSource) : props.title,
460
- items: props.items.filter((item) => item && (!item.if || item.if(props.dataSource))).map((item) => ({
474
+ title: typeof renderTitle === "function" ? renderTitle(dataSource) : props.title,
475
+ items: props.items.filter((item) => item && (!item.if || item.if(dataSource))).map((item) => ({
461
476
  ...item,
462
477
  key: item.id,
463
478
  label: item.title || upperFirst(item.id),
@@ -465,15 +480,16 @@ function Description(props) {
465
480
  DescriptionItemContent,
466
481
  {
467
482
  item,
468
- value: props.dataSource ? props.dataSource[item.id] : null,
469
- values: props.dataSource,
470
- extendTypes: props.extendTypes
483
+ value: dataSource ? dataSource[item.id] : null,
484
+ values: dataSource,
485
+ extendTypes
471
486
  }
472
487
  )
473
488
  }))
474
489
  }
475
490
  );
476
491
  }
492
+ Description.displayName = "Description";
477
493
  Description.whyDidYouRender = true;
478
494
  function isOptionsProps(item) {
479
495
  return item && Array.isArray(item.options);
package/dist/index.mjs CHANGED
@@ -438,22 +438,37 @@ function DescriptionItemContent(props) {
438
438
  return computedProps.value || null;
439
439
  }
440
440
  }
441
+ DescriptionItemContent.displayName = "DescriptionItemContent";
441
442
  DescriptionItemContent.whyDidYouRender = true;
442
- function Description(props) {
443
- if (props.faasData && !props.dataSource)
443
+ function Description({
444
+ faasData,
445
+ dataSource,
446
+ renderTitle,
447
+ extendTypes,
448
+ ...props
449
+ }) {
450
+ if (faasData && !dataSource)
444
451
  return /* @__PURE__ */ jsx(
445
452
  FaasDataWrapper,
446
453
  {
447
- render: ({ data }) => /* @__PURE__ */ jsx(Description, { ...props, dataSource: data }),
448
- ...props.faasData
454
+ render: ({ data }) => /* @__PURE__ */ jsx(
455
+ Description,
456
+ {
457
+ ...props,
458
+ dataSource: data,
459
+ renderTitle,
460
+ extendTypes
461
+ }
462
+ ),
463
+ ...faasData
449
464
  }
450
465
  );
451
466
  return /* @__PURE__ */ jsx(
452
467
  Descriptions,
453
468
  {
454
469
  ...props,
455
- title: typeof props.renderTitle === "function" ? props.renderTitle(props.dataSource) : props.title,
456
- items: props.items.filter((item) => item && (!item.if || item.if(props.dataSource))).map((item) => ({
470
+ title: typeof renderTitle === "function" ? renderTitle(dataSource) : props.title,
471
+ items: props.items.filter((item) => item && (!item.if || item.if(dataSource))).map((item) => ({
457
472
  ...item,
458
473
  key: item.id,
459
474
  label: item.title || upperFirst(item.id),
@@ -461,15 +476,16 @@ function Description(props) {
461
476
  DescriptionItemContent,
462
477
  {
463
478
  item,
464
- value: props.dataSource ? props.dataSource[item.id] : null,
465
- values: props.dataSource,
466
- extendTypes: props.extendTypes
479
+ value: dataSource ? dataSource[item.id] : null,
480
+ values: dataSource,
481
+ extendTypes
467
482
  }
468
483
  )
469
484
  }))
470
485
  }
471
486
  );
472
487
  }
488
+ Description.displayName = "Description";
473
489
  Description.whyDidYouRender = true;
474
490
  function isOptionsProps(item) {
475
491
  return item && Array.isArray(item.options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/ant-design",
3
- "version": "3.7.1",
3
+ "version": "4.1.0",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -34,7 +34,7 @@
34
34
  "dist"
35
35
  ],
36
36
  "peerDependencies": {
37
- "@faasjs/react": "3.7.1",
37
+ "@faasjs/react": "4.1.0",
38
38
  "antd": "*",
39
39
  "@ant-design/icons": "*",
40
40
  "lodash-es": "*",
@@ -44,7 +44,7 @@
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/lodash-es": "*",
47
- "@faasjs/react": "3.7.1",
47
+ "@faasjs/react": "4.1.0",
48
48
  "antd": "*",
49
49
  "@ant-design/icons": "*",
50
50
  "lodash-es": "*",