@antscorp/antsomi-ui 1.3.5-beta.63 → 1.3.5-beta.66
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/es/assets/images/components/PreviewModal/Banner/skeletonBackground.png +0 -0
- package/es/assets/images/components/PreviewModal/Information/buttonText.png +0 -0
- package/es/assets/images/components/PreviewModal/Information/clickButton.png +0 -0
- package/es/assets/images/components/PreviewModal/Information/description.png +0 -0
- package/es/assets/images/components/PreviewModal/Information/deviceRadio.png +0 -0
- package/es/assets/images/components/PreviewModal/Information/itemName.png +0 -0
- package/es/assets/images/components/PreviewModal/banner.png +0 -0
- package/es/assets/images/components/PreviewModal/information.png +0 -0
- package/es/assets/images/components/PreviewModal/similarTemplate.png +0 -0
- package/es/assets/images/components/PreviewModal/thumbnails.png +0 -0
- package/es/assets/images/components/TemplateListing/blankTemplate.png +0 -0
- package/es/assets/images/components/TemplateListing/categoryListing.png +0 -0
- package/es/assets/images/components/TemplateListing/empty.png +0 -0
- package/es/assets/images/components/TemplateListing/previewModal.png +0 -0
- package/es/assets/images/components/TemplateListing/templateItem.png +0 -0
- package/es/assets/images/components/TemplateListing/templates.png +0 -0
- package/es/components/common/ConfigProvider/ConfigProvider.js +2 -6
- package/es/components/organism/PreviewTemplateModal/components/SimilarTemplate/index.js +5 -2
- package/es/components/organism/PreviewTemplateModal/constants/defaultProps.js +1 -0
- package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/BannerPropsTable/index.d.ts +2 -0
- package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/BannerPropsTable/index.js +34 -0
- package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/DataTypeTable/index.d.ts +2 -0
- package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/DataTypeTable/index.js +62 -0
- package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/InformationPropsTable/index.d.ts +2 -0
- package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/InformationPropsTable/index.js +76 -0
- package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/SimilarTemplatePropsTable/index.d.ts +2 -0
- package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/SimilarTemplatePropsTable/index.js +40 -0
- package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/TThumbnailTable/index.d.ts +2 -0
- package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/TThumbnailTable/index.js +30 -0
- package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/ThumbnailPropsTable/index.d.ts +2 -0
- package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/ThumbnailPropsTable/index.js +46 -0
- package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/index.d.ts +6 -0
- package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/index.js +6 -0
- package/es/components/organism/PreviewTemplateModal/types.d.ts +0 -1
- package/es/components/template/TemplateListing/components/CategoryListing/index.js +2 -2
- package/es/components/template/TemplateListing/components/CategoryListing/styled.js +4 -4
- package/es/components/template/TemplateListing/stories/dataTypes/components/BlankTemplatePropsTable/index.d.ts +2 -0
- package/es/components/template/TemplateListing/stories/dataTypes/components/BlankTemplatePropsTable/index.js +46 -0
- package/es/components/template/TemplateListing/stories/dataTypes/components/CategoryListingPropsTable/index.d.ts +2 -0
- package/es/components/template/TemplateListing/stories/dataTypes/components/CategoryListingPropsTable/index.js +57 -0
- package/es/components/template/TemplateListing/stories/dataTypes/components/DataTypeTables/index.d.ts +2 -0
- package/es/components/template/TemplateListing/stories/dataTypes/components/DataTypeTables/index.js +78 -0
- package/es/components/template/TemplateListing/stories/dataTypes/components/EmptyPropsTable/index.d.ts +2 -0
- package/es/components/template/TemplateListing/stories/dataTypes/components/EmptyPropsTable/index.js +30 -0
- package/es/components/template/TemplateListing/stories/dataTypes/components/TCategoryItemTable/index.d.ts +2 -0
- package/es/components/template/TemplateListing/stories/dataTypes/components/TCategoryItemTable/index.js +46 -0
- package/es/components/template/TemplateListing/stories/dataTypes/components/TTemplateItemTable/index.d.ts +2 -0
- package/es/components/template/TemplateListing/stories/dataTypes/components/TTemplateItemTable/index.js +38 -0
- package/es/components/template/TemplateListing/stories/dataTypes/components/TemplatesPropsTable/index.d.ts +2 -0
- package/es/components/template/TemplateListing/stories/dataTypes/components/TemplatesPropsTable/index.js +50 -0
- package/es/components/template/TemplateListing/stories/dataTypes/components/index.d.ts +7 -0
- package/es/components/template/TemplateListing/stories/dataTypes/components/index.js +7 -0
- package/es/components/template/TemplateListing/stories/demo/styled.d.ts +1 -0
- package/es/components/template/TemplateListing/stories/demo/styled.js +7 -0
- package/es/components/template/TemplateListing/styled/index.d.ts +0 -1
- package/es/components/template/TemplateListing/styled/index.js +0 -5
- package/es/components/template/TemplateListing/types/BlankTemplate.d.ts +1 -1
- package/es/components/template/TemplateListing/types/CategoryListing.d.ts +2 -0
- package/es/components/template/TemplateListing/types/TemplateListing.d.ts +1 -1
- package/es/queries/TemplateListing/index.js +14 -11
- package/es/utils/commonComponent.d.ts +7 -0
- package/es/utils/commonComponent.js +28 -0
- package/package.json +2 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -28,8 +28,6 @@ import '@antscorp/antsomi-ui/es/assets/css/main.scss';
|
|
|
28
28
|
// import '@antscorp/antsomi-ui/es/locales/i18n';
|
|
29
29
|
import i18next from '@antscorp/antsomi-ui/es/locales/i18n';
|
|
30
30
|
import 'animate.css';
|
|
31
|
-
// Providers
|
|
32
|
-
import { QueryClientProviderAntsomiUI, QueryDevtoolsAntsomiUI, queryClientAntsomiUI, } from '@antscorp/antsomi-ui/es/queries';
|
|
33
31
|
// NOTE: HOT fix DatePicker Advanced
|
|
34
32
|
dayjs.extend(weekday);
|
|
35
33
|
dayjs.extend(localeData);
|
|
@@ -46,10 +44,8 @@ const ConfigProvider = props => {
|
|
|
46
44
|
}, [locale]);
|
|
47
45
|
return (React.createElement(AntdConfigProvider, Object.assign({}, restOfProps),
|
|
48
46
|
React.createElement(App, null,
|
|
49
|
-
React.createElement(
|
|
50
|
-
|
|
51
|
-
React.createElement(StyleProvider, { hashPriority: "high" }, children),
|
|
52
|
-
React.createElement(QueryDevtoolsAntsomiUI, null)))));
|
|
47
|
+
React.createElement(GlobalStyle, null),
|
|
48
|
+
React.createElement(StyleProvider, { hashPriority: "high" }, children))));
|
|
53
49
|
};
|
|
54
50
|
ConfigProvider.defaultProps = {
|
|
55
51
|
theme: THEME,
|
|
@@ -11,9 +11,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
// Libraries
|
|
13
13
|
import React, { memo } from 'react';
|
|
14
|
+
import { isEmpty } from 'lodash';
|
|
14
15
|
// Components
|
|
15
16
|
import { ThumbnailCard } from '../../../../molecules';
|
|
16
|
-
import { Empty
|
|
17
|
+
import { Empty } from '../../../../template/TemplateListing/components/Empty';
|
|
18
|
+
import { Flex } from '../../../../atoms';
|
|
17
19
|
// Styled
|
|
18
20
|
import { SimilarTemplateWrapper } from './styled';
|
|
19
21
|
// Constants
|
|
@@ -25,5 +27,6 @@ export const SimilarTemplate = memo(props => {
|
|
|
25
27
|
const _b = similarCardProps || {}, { width = SIMILAR_CARD_WIDTH_DEFAULT, height = SIMILAR_CARD_HEIGHT_DEFAULT } = _b, restOfSimilarCardProps = __rest(_b, ["width", "height"]);
|
|
26
28
|
return show ? (React.createElement(SimilarTemplateWrapper, { gap: 15, vertical: true },
|
|
27
29
|
React.createElement("div", { className: "title" }, "Similar templates"),
|
|
28
|
-
React.createElement(Flex, { gap: 30
|
|
30
|
+
React.createElement(Flex, { gap: 30, justify: "center" }, isEmpty(similarTemplates) ? (React.createElement(Empty, null)) : ((_a = similarTemplates
|
|
31
|
+
.slice(0, MAX_QUANTITY_TEMPLATES)) === null || _a === void 0 ? void 0 : _a.map(({ id, name, thumbnail }) => (React.createElement(ThumbnailCard, Object.assign({ key: id, id: id, name: name, width: width, height: height, thumbnail: thumbnail, actionAvailable: false }, restOfSimilarCardProps)))))))) : null;
|
|
29
32
|
});
|
|
@@ -5,6 +5,7 @@ export const SIMILAR_CARD_HEIGHT_DEFAULT = 230;
|
|
|
5
5
|
export const THUMBNAIL_URL = 'https://st-media-template.antsomi.com/base64-img/37563.png';
|
|
6
6
|
export const SIMILAR_TEMPLATE_DEFAULT = {
|
|
7
7
|
show: false,
|
|
8
|
+
similarTemplates: [],
|
|
8
9
|
};
|
|
9
10
|
export const THUMBNAIL_DEFAULT = {
|
|
10
11
|
thumbnails: [],
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Image } from 'antd';
|
|
4
|
+
// Components
|
|
5
|
+
import { Table } from '../../../../../..';
|
|
6
|
+
import { Typography, Flex } from '../../../../../../atoms';
|
|
7
|
+
// Images
|
|
8
|
+
import skeletonBackgroundImage from '../../../../../../../assets/images/components/PreviewModal/Banner/skeletonBackground.png';
|
|
9
|
+
// Constants
|
|
10
|
+
import { TABLE_API_COLUMNS } from '@antscorp/antsomi-ui/es/constants';
|
|
11
|
+
// Utils
|
|
12
|
+
import { CustomTag } from '@antscorp/antsomi-ui/es/utils/commonComponent';
|
|
13
|
+
export const BannerPropsTable = () => {
|
|
14
|
+
const dataSource = [
|
|
15
|
+
{
|
|
16
|
+
key: '1',
|
|
17
|
+
property: 'showBackgroundSkeleton',
|
|
18
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
19
|
+
React.createElement(Typography.Text, null, "Handler show or hide skeleton background"),
|
|
20
|
+
React.createElement(Image, { src: skeletonBackgroundImage, width: 200, height: "auto" }))),
|
|
21
|
+
type: React.createElement(CustomTag, { type: "normal" }, "boolean"),
|
|
22
|
+
default: React.createElement(CustomTag, { type: "default" }, "false"),
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
key: '2',
|
|
26
|
+
property: 'children',
|
|
27
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
28
|
+
React.createElement(Typography.Text, null, "Children of Banner Component"))),
|
|
29
|
+
type: React.createElement(CustomTag, { type: "normal" }, "ReactNode"),
|
|
30
|
+
default: React.createElement(CustomTag, { type: "default" }, " - "),
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
return React.createElement(Table, { dataSource: dataSource, columns: TABLE_API_COLUMNS, pagination: false });
|
|
34
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Table } from '@antscorp/antsomi-ui/es/index';
|
|
4
|
+
import LinkTo from '@storybook/addon-links/react';
|
|
5
|
+
import { Image } from 'antd';
|
|
6
|
+
// Images
|
|
7
|
+
import bannerImage from '../../../../../../../assets/images/components/PreviewModal/banner.png';
|
|
8
|
+
import informationImage from '../../../../../../../assets/images/components/PreviewModal/information.png';
|
|
9
|
+
import thumbnailsImage from '../../../../../../../assets/images/components/PreviewModal/thumbnails.png';
|
|
10
|
+
import similarTemplateImage from '../../../../../../../assets/images/components/PreviewModal/similarTemplate.png';
|
|
11
|
+
// Constants
|
|
12
|
+
import { CustomTag } from '@antscorp/antsomi-ui/es/utils/commonComponent';
|
|
13
|
+
export const DataTypeTable = () => {
|
|
14
|
+
const columns = [
|
|
15
|
+
{
|
|
16
|
+
title: 'Name',
|
|
17
|
+
dataIndex: 'name',
|
|
18
|
+
key: 'name',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
title: 'Type',
|
|
22
|
+
dataIndex: 'type',
|
|
23
|
+
key: 'type',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
title: 'Description',
|
|
27
|
+
dataIndex: 'description',
|
|
28
|
+
key: 'description',
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
const dataSource = [
|
|
32
|
+
{
|
|
33
|
+
key: 'bannerProps',
|
|
34
|
+
name: 'bannerProps',
|
|
35
|
+
type: (React.createElement(LinkTo, { story: "banner-props" },
|
|
36
|
+
React.createElement(CustomTag, { type: "link" }, "BannerProps"))),
|
|
37
|
+
description: React.createElement(Image, { src: bannerImage, width: 200, height: "auto" }),
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
key: 'informationProps',
|
|
41
|
+
name: 'informationProps',
|
|
42
|
+
type: (React.createElement(LinkTo, { story: "information-props" },
|
|
43
|
+
React.createElement(CustomTag, { type: "link" }, "InformationProps"))),
|
|
44
|
+
description: React.createElement(Image, { src: informationImage, width: 200, height: "auto" }),
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
key: 'ThumbnailProps',
|
|
48
|
+
name: 'ThumbnailProps',
|
|
49
|
+
type: (React.createElement(LinkTo, { story: "thumbnail-props" },
|
|
50
|
+
React.createElement(CustomTag, { type: "link" }, "ThumbnailProps"))),
|
|
51
|
+
description: React.createElement(Image, { src: thumbnailsImage, width: 200, height: "auto" }),
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
key: 'SimilarTemplateProps',
|
|
55
|
+
name: 'SimilarTemplateProps',
|
|
56
|
+
type: (React.createElement(LinkTo, { story: "similar-template-props" },
|
|
57
|
+
React.createElement(CustomTag, { type: "link" }, "SimilarTemplateProps"))),
|
|
58
|
+
description: React.createElement(Image, { src: similarTemplateImage, width: 200, height: "auto" }),
|
|
59
|
+
},
|
|
60
|
+
];
|
|
61
|
+
return React.createElement(Table, { dataSource: dataSource, columns: columns, pagination: false });
|
|
62
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Image } from 'antd';
|
|
4
|
+
// Components
|
|
5
|
+
import { Table } from '../../../../../..';
|
|
6
|
+
import { Typography, Flex } from '../../../../../../atoms';
|
|
7
|
+
// Images
|
|
8
|
+
import buttonTextImage from '../../../../../../../assets/images/components/PreviewModal/Information/buttonText.png';
|
|
9
|
+
import descriptionImage from '../../../../../../../assets/images/components/PreviewModal/Information/description.png';
|
|
10
|
+
import itemNameImage from '../../../../../../../assets/images/components/PreviewModal/Information/itemName.png';
|
|
11
|
+
import deviceRadioImage from '../../../../../../../assets/images/components/PreviewModal/Information/deviceRadio.png';
|
|
12
|
+
import clickButtonImage from '../../../../../../../assets/images/components/PreviewModal/Information/clickButton.png';
|
|
13
|
+
// Constants
|
|
14
|
+
import { TABLE_API_COLUMNS } from '@antscorp/antsomi-ui/es/constants';
|
|
15
|
+
// Utils
|
|
16
|
+
import { CustomTag } from '@antscorp/antsomi-ui/es/utils/commonComponent';
|
|
17
|
+
export const InformationPropsTable = () => {
|
|
18
|
+
const dataSource = [
|
|
19
|
+
{
|
|
20
|
+
key: '1',
|
|
21
|
+
property: 'itemName',
|
|
22
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
23
|
+
React.createElement(Typography.Text, null, "Name of template item"),
|
|
24
|
+
React.createElement(Image, { src: itemNameImage, width: 200, height: "auto" }))),
|
|
25
|
+
type: React.createElement(CustomTag, { type: "normal" }, "string"),
|
|
26
|
+
default: React.createElement(CustomTag, { type: "default" }, "Template name"),
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
key: '2',
|
|
30
|
+
property: 'categoryListing',
|
|
31
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
32
|
+
React.createElement(Typography.Text, null, "Children of Banner Component"))),
|
|
33
|
+
type: (React.createElement("a", { href: "../?path=/docs/templates-templatelisting-datatype--t-category-item", target: "_blank" },
|
|
34
|
+
React.createElement(CustomTag, { type: "link" }, "TCategoryItem [ ]"))),
|
|
35
|
+
default: React.createElement(CustomTag, { type: "default" }, " - "),
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
key: '3',
|
|
39
|
+
property: 'buttonText',
|
|
40
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
41
|
+
React.createElement(Typography.Text, null, "Text of Information Button"),
|
|
42
|
+
React.createElement(Image, { src: buttonTextImage, width: 200, height: "auto" }))),
|
|
43
|
+
type: React.createElement(CustomTag, { type: "normal" }, "string"),
|
|
44
|
+
default: React.createElement(CustomTag, { type: "default" }, " Use template "),
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
key: '4',
|
|
48
|
+
property: 'description',
|
|
49
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
50
|
+
React.createElement(Typography.Text, null, "description of Preview Modal Information "),
|
|
51
|
+
React.createElement(Image, { src: descriptionImage, width: 200, height: "auto" }))),
|
|
52
|
+
type: React.createElement(CustomTag, { type: "normal" }, "string"),
|
|
53
|
+
default: React.createElement(CustomTag, { type: "default" }, " - "),
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
key: '5',
|
|
57
|
+
property: 'showDeviceRadios',
|
|
58
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
59
|
+
React.createElement(Typography.Text, null, "Handle show or hide device radios "),
|
|
60
|
+
React.createElement(Image, { src: deviceRadioImage, width: 200, height: "auto" }))),
|
|
61
|
+
type: React.createElement(CustomTag, { type: "normal" }, "boolean"),
|
|
62
|
+
default: React.createElement(CustomTag, { type: "default" }, " true "),
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
key: '6',
|
|
66
|
+
property: 'onButtonClick',
|
|
67
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
68
|
+
React.createElement(Typography.Text, null, "Handle show or hide device radios "),
|
|
69
|
+
React.createElement(Image, { src: clickButtonImage, width: 200, height: "auto" }))),
|
|
70
|
+
type: React.createElement(CustomTag, { type: "normal" }, 'React.MouseEventHandler<HTMLElement>'),
|
|
71
|
+
default: React.createElement(CustomTag, { type: "default" }, " - "),
|
|
72
|
+
},
|
|
73
|
+
];
|
|
74
|
+
//
|
|
75
|
+
return React.createElement(Table, { dataSource: dataSource, columns: TABLE_API_COLUMNS, pagination: false });
|
|
76
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
import React from 'react';
|
|
3
|
+
// Components
|
|
4
|
+
import { Table } from '../../../../../..';
|
|
5
|
+
import { Typography, Flex } from '../../../../../../atoms';
|
|
6
|
+
// Constants
|
|
7
|
+
import { TABLE_API_COLUMNS } from '@antscorp/antsomi-ui/es/constants';
|
|
8
|
+
// Utils
|
|
9
|
+
import { CustomTag } from '@antscorp/antsomi-ui/es/utils/commonComponent';
|
|
10
|
+
export const SimilarTemplatePropsTable = () => {
|
|
11
|
+
const dataSource = [
|
|
12
|
+
{
|
|
13
|
+
key: '1',
|
|
14
|
+
property: 'show',
|
|
15
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
16
|
+
React.createElement(Typography.Text, null, "Handler show or hide similar template"))),
|
|
17
|
+
type: React.createElement(CustomTag, { type: "normal" }, "boolean"),
|
|
18
|
+
default: React.createElement(CustomTag, { type: "default" }, "true"),
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
key: '2',
|
|
22
|
+
property: 'similarTemplates',
|
|
23
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
24
|
+
React.createElement(Typography.Text, null, "List of similar templates"))),
|
|
25
|
+
type: (React.createElement("a", { href: "../?path=/docs/templates-templatelisting-datatype--t-template-item", target: "_blank" },
|
|
26
|
+
React.createElement(CustomTag, { type: "link" }, "TTemplateItem [ ]"))),
|
|
27
|
+
default: React.createElement(CustomTag, { type: "default" }, " [ ] "),
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
key: '3',
|
|
31
|
+
property: 'similarCardProps',
|
|
32
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
33
|
+
React.createElement(Typography.Text, null, "Custom similar card"))),
|
|
34
|
+
type: (React.createElement("a", { href: "../?path=/docs/molecules-thumbnailcard--default", target: "_blank" },
|
|
35
|
+
React.createElement(CustomTag, { type: "link" }, "similarCardProps"))),
|
|
36
|
+
default: React.createElement(CustomTag, { type: "default" }, " - "),
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
return React.createElement(Table, { dataSource: dataSource, columns: TABLE_API_COLUMNS, pagination: false });
|
|
40
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
import React from 'react';
|
|
3
|
+
// Components
|
|
4
|
+
import { Table } from '../../../../../..';
|
|
5
|
+
import { Typography, Flex } from '../../../../../../atoms';
|
|
6
|
+
// Constants
|
|
7
|
+
import { TABLE_API_COLUMNS } from '@antscorp/antsomi-ui/es/constants';
|
|
8
|
+
// Utils
|
|
9
|
+
import { CustomTag } from '@antscorp/antsomi-ui/es/utils/commonComponent';
|
|
10
|
+
export const TThumbnailTable = () => {
|
|
11
|
+
const dataSource = [
|
|
12
|
+
{
|
|
13
|
+
key: '1',
|
|
14
|
+
property: 'id',
|
|
15
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
16
|
+
React.createElement(Typography.Text, null, "Identification of thumbnail"))),
|
|
17
|
+
type: React.createElement(CustomTag, { type: "normal" }, "string | number"),
|
|
18
|
+
default: React.createElement(CustomTag, { type: "default" }, " - "),
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
key: '2',
|
|
22
|
+
property: 'url',
|
|
23
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
24
|
+
React.createElement(Typography.Text, null, "Thumbnail url"))),
|
|
25
|
+
type: React.createElement(CustomTag, { type: "normal" }, "string"),
|
|
26
|
+
default: React.createElement(CustomTag, { type: "default" }, " - "),
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
return React.createElement(Table, { dataSource: dataSource, columns: TABLE_API_COLUMNS, pagination: false });
|
|
30
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import LinkTo from '@storybook/addon-links/react';
|
|
4
|
+
// Components
|
|
5
|
+
import { Table } from '../../../../../..';
|
|
6
|
+
import { Typography, Flex } from '../../../../../../atoms';
|
|
7
|
+
// Constants
|
|
8
|
+
import { TABLE_API_COLUMNS } from '@antscorp/antsomi-ui/es/constants';
|
|
9
|
+
// Utils
|
|
10
|
+
import { CustomTag } from '@antscorp/antsomi-ui/es/utils/commonComponent';
|
|
11
|
+
export const ThumbnailPropsTable = () => {
|
|
12
|
+
const dataSource = [
|
|
13
|
+
{
|
|
14
|
+
key: '1',
|
|
15
|
+
property: 'thumbnails',
|
|
16
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
17
|
+
React.createElement(Typography.Text, null, "Show list thumbnails as a slider"))),
|
|
18
|
+
type: (React.createElement(LinkTo, { story: "t-thumbnail" },
|
|
19
|
+
React.createElement(CustomTag, { type: "link" }, "TThumbnail [ ]"))),
|
|
20
|
+
default: React.createElement(CustomTag, { type: "default" }, "[ ]"),
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
key: '2',
|
|
24
|
+
property: 'onClickThumbnail',
|
|
25
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
26
|
+
React.createElement(Typography.Text, null, "Handle click on thumbnail"))),
|
|
27
|
+
type: (React.createElement(CustomTag, { type: "normal" },
|
|
28
|
+
`(value: `,
|
|
29
|
+
React.createElement(LinkTo, { story: "t-thumbnail" },
|
|
30
|
+
React.createElement(CustomTag, { type: "link" }, "TThumbnail")),
|
|
31
|
+
') => void')),
|
|
32
|
+
default: React.createElement(CustomTag, { type: "default" }, " - "),
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
key: '3',
|
|
36
|
+
property: 'ThumbnailCardProps',
|
|
37
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
38
|
+
React.createElement(Typography.Text, null, "Custom thumbnail card"),
|
|
39
|
+
React.createElement(Typography.Text, null, "Omit id, name, thumbnail, onClickWrapper properties of thumbnail Card Props"))),
|
|
40
|
+
type: (React.createElement("a", { href: "../?path=/docs/molecules-thumbnailcard--default", target: "_blank" },
|
|
41
|
+
React.createElement(CustomTag, { type: "link" }, "ThumbnailCardProps"))),
|
|
42
|
+
default: React.createElement(CustomTag, { type: "default" }, " - "),
|
|
43
|
+
},
|
|
44
|
+
];
|
|
45
|
+
return React.createElement(Table, { dataSource: dataSource, columns: TABLE_API_COLUMNS, pagination: false });
|
|
46
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { DataTypeTable } from './DataTypeTable';
|
|
2
|
+
export { BannerPropsTable } from './BannerPropsTable';
|
|
3
|
+
export { InformationPropsTable } from './InformationPropsTable';
|
|
4
|
+
export { SimilarTemplatePropsTable } from './SimilarTemplatePropsTable';
|
|
5
|
+
export { ThumbnailPropsTable } from './ThumbnailPropsTable';
|
|
6
|
+
export { TThumbnailTable } from './TThumbnailTable';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { DataTypeTable } from './DataTypeTable';
|
|
2
|
+
export { BannerPropsTable } from './BannerPropsTable';
|
|
3
|
+
export { InformationPropsTable } from './InformationPropsTable';
|
|
4
|
+
export { SimilarTemplatePropsTable } from './SimilarTemplatePropsTable';
|
|
5
|
+
export { ThumbnailPropsTable } from './ThumbnailPropsTable';
|
|
6
|
+
export { TThumbnailTable } from './TThumbnailTable';
|
|
@@ -27,7 +27,7 @@ import { CATEGORY_LISTING_WITH } from '../../constants';
|
|
|
27
27
|
const PATH = 'src/components/template/TemplateListing/components/CategoryListing/index.tsx';
|
|
28
28
|
export const CategoryListing = memo(props => {
|
|
29
29
|
var _a;
|
|
30
|
-
const { width = CATEGORY_LISTING_WITH, items = [], loading = false, show = true, checkedCategories = {}, onMenuChange } = props, restOfProps = __rest(props, ["width", "items", "loading", "show", "checkedCategories", "onMenuChange"]);
|
|
30
|
+
const { width = CATEGORY_LISTING_WITH, items = [], loading = false, show = true, checkedCategories = {}, emptyProps, onMenuChange } = props, restOfProps = __rest(props, ["width", "items", "loading", "show", "checkedCategories", "emptyProps", "onMenuChange"]);
|
|
31
31
|
// Handlers
|
|
32
32
|
const handleClickMenu = e => {
|
|
33
33
|
var _a;
|
|
@@ -107,6 +107,6 @@ export const CategoryListing = memo(props => {
|
|
|
107
107
|
}, [getItem, items]);
|
|
108
108
|
return show ? (React.createElement(MenuWrapper, { "$width": width },
|
|
109
109
|
React.createElement(Spin, { spinning: loading, wrapperClassName: "template-listing__loading" }, isEmpty(menuItems) && !loading ? (React.createElement("div", { className: "empty-wrapper" },
|
|
110
|
-
React.createElement(Empty,
|
|
110
|
+
React.createElement(Empty, Object.assign({}, emptyProps)))) : (React.createElement(Menu, Object.assign({ items: menuItems, inlineIndent: 0, mode: "inline", defaultOpenKeys: items === null || items === void 0 ? void 0 : items.map(item => String(item.key)), expandIcon: React.createElement(Icon, { type: "icon-ants-expand-more", style: { fontSize: 20, color: (_a = THEME === null || THEME === void 0 ? void 0 : THEME.token) === null || _a === void 0 ? void 0 : _a.bw8 } }), onClick: handleClickMenu }, restOfProps)))))) : null;
|
|
111
111
|
});
|
|
112
112
|
CategoryListing.displayName = 'CategoryListing';
|
|
@@ -10,9 +10,8 @@ export const MenuWrapper = styled.div `
|
|
|
10
10
|
overflow-x: hidden;
|
|
11
11
|
border-right: 1px solid rgba(5, 5, 5, 0.06);
|
|
12
12
|
|
|
13
|
-
.antsomi-menu
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
.antsomi-menu,
|
|
14
|
+
.ant-menu {
|
|
16
15
|
[role='menuitem'] {
|
|
17
16
|
width: 100%;
|
|
18
17
|
border-radius: 0;
|
|
@@ -21,7 +20,8 @@ export const MenuWrapper = styled.div `
|
|
|
21
20
|
margin-left: 0 !important;
|
|
22
21
|
margin-right: 0 !important;
|
|
23
22
|
|
|
24
|
-
.antsomi-menu-title-content
|
|
23
|
+
.antsomi-menu-title-content,
|
|
24
|
+
.ant-menu-title-content {
|
|
25
25
|
height: 100%;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
import React from 'react';
|
|
3
|
+
// Components
|
|
4
|
+
import { Table } from '../../../../../../organism';
|
|
5
|
+
import { Typography, Flex } from '../../../../../../atoms';
|
|
6
|
+
// Constants
|
|
7
|
+
import { TABLE_API_COLUMNS } from '@antscorp/antsomi-ui/es/constants';
|
|
8
|
+
// Utils
|
|
9
|
+
import { CustomTag } from '@antscorp/antsomi-ui/es/utils/commonComponent';
|
|
10
|
+
export const BlankTemplatePropsTable = () => {
|
|
11
|
+
const dataSource = [
|
|
12
|
+
{
|
|
13
|
+
key: '1',
|
|
14
|
+
property: 'show',
|
|
15
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
16
|
+
React.createElement(Typography.Text, null, "Handler show or hide Blank Template"))),
|
|
17
|
+
type: React.createElement(CustomTag, { type: "normal" }, "boolean"),
|
|
18
|
+
default: React.createElement(CustomTag, { type: "default" }, "false"),
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
key: '2',
|
|
22
|
+
property: 'description',
|
|
23
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
24
|
+
React.createElement(Typography.Text, null, "The text that is displayed below the Add Button"))),
|
|
25
|
+
type: React.createElement(CustomTag, { type: "normal" }, "string"),
|
|
26
|
+
default: React.createElement(CustomTag, { type: "default" }, "Blank Template"),
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
key: '3',
|
|
30
|
+
property: 'onClick',
|
|
31
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
32
|
+
React.createElement(Typography.Text, null, "Callback onClick on Blank Template"))),
|
|
33
|
+
type: React.createElement(CustomTag, { type: "normal" }, 'React.MouseEventHandler<HTMLElement>'),
|
|
34
|
+
default: React.createElement(CustomTag, { type: "default" }, " - "),
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
key: '4',
|
|
38
|
+
property: 'blankTemplateRender',
|
|
39
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
40
|
+
React.createElement(Typography.Text, null, "Render Blank Template node for customizing"))),
|
|
41
|
+
type: React.createElement(CustomTag, { type: "normal" }, '(node: ReactNode) => ReactNode'),
|
|
42
|
+
default: React.createElement(CustomTag, { type: "default" }, " - "),
|
|
43
|
+
},
|
|
44
|
+
];
|
|
45
|
+
return React.createElement(Table, { dataSource: dataSource, columns: TABLE_API_COLUMNS, pagination: false });
|
|
46
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import LinkTo from '@storybook/addon-links/react';
|
|
4
|
+
// Components
|
|
5
|
+
import { Table } from '../../../../../../organism';
|
|
6
|
+
import { Typography, Flex } from '../../../../../../atoms';
|
|
7
|
+
// Constants
|
|
8
|
+
import { TABLE_API_COLUMNS } from '@antscorp/antsomi-ui/es/constants';
|
|
9
|
+
import { CATEGORY_LISTING_WITH } from '../../../../constants';
|
|
10
|
+
// Utils
|
|
11
|
+
import { CustomTag } from '@antscorp/antsomi-ui/es/utils/commonComponent';
|
|
12
|
+
export const CategoryListingPropsTable = () => {
|
|
13
|
+
const dataSource = [
|
|
14
|
+
{
|
|
15
|
+
key: '1',
|
|
16
|
+
property: 'items',
|
|
17
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
18
|
+
React.createElement(Typography.Text, null, "List of category items"))),
|
|
19
|
+
type: (React.createElement(LinkTo, { story: "t-category-item" },
|
|
20
|
+
React.createElement(CustomTag, { type: "link" }, "TCategoryItem [ ]"))),
|
|
21
|
+
default: React.createElement(CustomTag, { type: "default" }, "[ ]"),
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
key: '2',
|
|
25
|
+
property: 'width',
|
|
26
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
27
|
+
React.createElement(Typography.Text, null, "Width of category"))),
|
|
28
|
+
type: React.createElement(CustomTag, { type: "normal" }, "number"),
|
|
29
|
+
default: React.createElement(CustomTag, { type: "default" }, CATEGORY_LISTING_WITH),
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
key: '3',
|
|
33
|
+
property: 'loading',
|
|
34
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
35
|
+
React.createElement(Typography.Text, null, "Show loading category listing"))),
|
|
36
|
+
type: React.createElement(CustomTag, { type: "normal" }, "boolean"),
|
|
37
|
+
default: React.createElement(CustomTag, { type: "default" }, "false"),
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
key: '4',
|
|
41
|
+
property: 'show',
|
|
42
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
43
|
+
React.createElement(Typography.Text, null, "Handler show or hide category"))),
|
|
44
|
+
type: React.createElement(CustomTag, { type: "normal" }, "boolean"),
|
|
45
|
+
default: React.createElement(CustomTag, { type: "default" }, "true"),
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
key: '5',
|
|
49
|
+
property: 'checkedCategories',
|
|
50
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
51
|
+
React.createElement(Typography.Text, null, "Record of checked categories"))),
|
|
52
|
+
type: React.createElement(CustomTag, { type: "link" }, "TCheckedCategories"),
|
|
53
|
+
default: React.createElement(CustomTag, { type: "default" }, '{ }'),
|
|
54
|
+
},
|
|
55
|
+
];
|
|
56
|
+
return React.createElement(Table, { dataSource: dataSource, columns: TABLE_API_COLUMNS, pagination: false });
|
|
57
|
+
};
|
package/es/components/template/TemplateListing/stories/dataTypes/components/DataTypeTables/index.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Table } from '@antscorp/antsomi-ui/es/index';
|
|
4
|
+
import LinkTo from '@storybook/addon-links/react';
|
|
5
|
+
import { Image } from 'antd';
|
|
6
|
+
// Images
|
|
7
|
+
import templatesImage from '../../../../../../../assets/images/components/TemplateListing/templates.png';
|
|
8
|
+
import templateItemImage from '../../../../../../../assets/images/components/TemplateListing/templateItem.png';
|
|
9
|
+
import categoryListingImage from '../../../../../../../assets/images/components/TemplateListing/categoryListing.png';
|
|
10
|
+
import blankTemplateImage from '../../../../../../../assets/images/components/TemplateListing/blankTemplate.png';
|
|
11
|
+
import previewModalImage from '../../../../../../../assets/images/components/TemplateListing/previewModal.png';
|
|
12
|
+
import emptyImage from '../../../../../../../assets/images/components/TemplateListing/empty.png';
|
|
13
|
+
// Constants
|
|
14
|
+
import { CustomTag } from '@antscorp/antsomi-ui/es/utils/commonComponent';
|
|
15
|
+
export const DataTypeTable = () => {
|
|
16
|
+
const columns = [
|
|
17
|
+
{
|
|
18
|
+
title: 'Name',
|
|
19
|
+
dataIndex: 'name',
|
|
20
|
+
key: 'name',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
title: 'Type',
|
|
24
|
+
dataIndex: 'type',
|
|
25
|
+
key: 'type',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
title: 'Description',
|
|
29
|
+
dataIndex: 'description',
|
|
30
|
+
key: 'description',
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
const dataSource = [
|
|
34
|
+
{
|
|
35
|
+
key: 'templatesProps',
|
|
36
|
+
name: 'templatesProps',
|
|
37
|
+
type: (React.createElement(LinkTo, { story: "templates-props" },
|
|
38
|
+
React.createElement(CustomTag, { type: "link" }, "templatesProps"))),
|
|
39
|
+
description: React.createElement(Image, { src: templatesImage, width: 200, height: "auto" }),
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
key: 'templateItemProps',
|
|
43
|
+
name: 'templateItemProps',
|
|
44
|
+
type: (React.createElement("a", { href: "../?path=/docs/molecules-thumbnailcard--default", target: "_blank" },
|
|
45
|
+
React.createElement(CustomTag, { type: "link" }, "templateItemProps"))),
|
|
46
|
+
description: React.createElement(Image, { src: templateItemImage, width: 200, height: "auto" }),
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
key: 'categoryListingProps',
|
|
50
|
+
name: 'categoryListingProps',
|
|
51
|
+
type: (React.createElement(LinkTo, { story: "category-listing-props" },
|
|
52
|
+
React.createElement(CustomTag, { type: "link" }, "categoryListingProps"))),
|
|
53
|
+
description: React.createElement(Image, { src: categoryListingImage, width: 200, height: "auto" }),
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
key: 'blankTemplateProps',
|
|
57
|
+
name: 'blankTemplateProps',
|
|
58
|
+
type: (React.createElement(LinkTo, { story: "blank-template-props" },
|
|
59
|
+
React.createElement(CustomTag, { type: "link" }, "blankTemplateProps"))),
|
|
60
|
+
description: React.createElement(Image, { src: blankTemplateImage, width: 200, height: "auto" }),
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
key: 'previewModalProps',
|
|
64
|
+
name: 'previewModalProps',
|
|
65
|
+
type: (React.createElement("a", { href: "../?path=/docs/organisms-previewtemplatemodal--default", target: "_blank" },
|
|
66
|
+
React.createElement(CustomTag, { type: "link" }, "previewModalProps"))),
|
|
67
|
+
description: React.createElement(Image, { src: previewModalImage, width: 200, height: "auto" }),
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
key: 'emptyProps',
|
|
71
|
+
name: 'emptyProps',
|
|
72
|
+
type: (React.createElement(LinkTo, { story: "empty-props" },
|
|
73
|
+
React.createElement(CustomTag, { type: "link" }, "emptyProps"))),
|
|
74
|
+
description: React.createElement(Image, { src: emptyImage, width: 200, height: "auto" }),
|
|
75
|
+
},
|
|
76
|
+
];
|
|
77
|
+
return React.createElement(Table, { dataSource: dataSource, columns: columns, pagination: false });
|
|
78
|
+
};
|
package/es/components/template/TemplateListing/stories/dataTypes/components/EmptyPropsTable/index.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
import React from 'react';
|
|
3
|
+
// Components
|
|
4
|
+
import { Table } from '../../../../../../organism';
|
|
5
|
+
import { Typography, Flex } from '../../../../../../atoms';
|
|
6
|
+
// Constants
|
|
7
|
+
import { TABLE_API_COLUMNS } from '@antscorp/antsomi-ui/es/constants';
|
|
8
|
+
// Utils
|
|
9
|
+
import { CustomTag } from '@antscorp/antsomi-ui/es/utils/commonComponent';
|
|
10
|
+
export const EmptyPropsTable = () => {
|
|
11
|
+
const dataSource = [
|
|
12
|
+
{
|
|
13
|
+
key: '1',
|
|
14
|
+
property: 'icon',
|
|
15
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
16
|
+
React.createElement(Typography.Text, null, "Customize Empty icon"))),
|
|
17
|
+
type: React.createElement(CustomTag, { type: "normal" }, "ReactNode"),
|
|
18
|
+
default: React.createElement(CustomTag, { type: "default" }, " - "),
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
key: '2',
|
|
22
|
+
property: 'description',
|
|
23
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
24
|
+
React.createElement(Typography.Text, null, "The text that is displayed below the Icon"))),
|
|
25
|
+
type: React.createElement(CustomTag, { type: "normal" }, "string"),
|
|
26
|
+
default: React.createElement(CustomTag, { type: "default" }, "No data"),
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
return React.createElement(Table, { dataSource: dataSource, columns: TABLE_API_COLUMNS, pagination: false });
|
|
30
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
import React from 'react';
|
|
3
|
+
// Components
|
|
4
|
+
import { Table } from '../../../../../../organism';
|
|
5
|
+
import { Typography, Flex } from '../../../../../../atoms';
|
|
6
|
+
// Constants
|
|
7
|
+
import { TABLE_API_COLUMNS } from '@antscorp/antsomi-ui/es/constants';
|
|
8
|
+
// Utils
|
|
9
|
+
import { CustomTag } from '@antscorp/antsomi-ui/es/utils/commonComponent';
|
|
10
|
+
export const TCategoryItemTable = () => {
|
|
11
|
+
const dataSource = [
|
|
12
|
+
{
|
|
13
|
+
key: '1',
|
|
14
|
+
property: 'TCategoryItemId',
|
|
15
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
16
|
+
React.createElement(Typography.Text, null, "Identification of Category Item"))),
|
|
17
|
+
type: React.createElement(CustomTag, { type: "link" }, "TCategoryItemId"),
|
|
18
|
+
default: React.createElement(CustomTag, { type: "default" }, " - "),
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
key: '2',
|
|
22
|
+
property: 'label',
|
|
23
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
24
|
+
React.createElement(Typography.Text, null, "Label of Category Item"))),
|
|
25
|
+
type: React.createElement(CustomTag, { type: "normal" }, "string"),
|
|
26
|
+
default: React.createElement(CustomTag, { type: "default" }, " - "),
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
key: '3',
|
|
30
|
+
property: 'total',
|
|
31
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
32
|
+
React.createElement(Typography.Text, null, "Total child categories of it"))),
|
|
33
|
+
type: React.createElement(CustomTag, { type: "normal" }, "number"),
|
|
34
|
+
default: React.createElement(CustomTag, { type: "default" }, " - "),
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
key: '4',
|
|
38
|
+
property: 'children',
|
|
39
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
40
|
+
React.createElement(Typography.Text, null, "Its children categories"))),
|
|
41
|
+
type: React.createElement(CustomTag, { type: "link" }, "TCategoryItem [ ]"),
|
|
42
|
+
default: React.createElement(CustomTag, { type: "default" }, " [ ] "),
|
|
43
|
+
},
|
|
44
|
+
];
|
|
45
|
+
return React.createElement(Table, { dataSource: dataSource, columns: TABLE_API_COLUMNS, pagination: false });
|
|
46
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
import React from 'react';
|
|
3
|
+
// Components
|
|
4
|
+
import { Table } from '../../../../../../organism';
|
|
5
|
+
import { Typography, Flex } from '../../../../../../atoms';
|
|
6
|
+
// Constants
|
|
7
|
+
import { TABLE_API_COLUMNS } from '@antscorp/antsomi-ui/es/constants';
|
|
8
|
+
// Utils
|
|
9
|
+
import { CustomTag } from '@antscorp/antsomi-ui/es/utils/commonComponent';
|
|
10
|
+
export const TTemplateItemTable = () => {
|
|
11
|
+
const dataSource = [
|
|
12
|
+
{
|
|
13
|
+
key: '1',
|
|
14
|
+
property: 'id',
|
|
15
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
16
|
+
React.createElement(Typography.Text, null, "Identification of Template Item"))),
|
|
17
|
+
type: React.createElement(CustomTag, { type: "link" }, "TThumbnailCardId"),
|
|
18
|
+
default: React.createElement(CustomTag, { type: "default" }, " - "),
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
key: '2',
|
|
22
|
+
property: 'name',
|
|
23
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
24
|
+
React.createElement(Typography.Text, null, "Name of Template Item"))),
|
|
25
|
+
type: React.createElement(CustomTag, { type: "normal" }, "string"),
|
|
26
|
+
default: React.createElement(CustomTag, { type: "default" }, " - "),
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
key: '3',
|
|
30
|
+
property: 'thumbnail',
|
|
31
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
32
|
+
React.createElement(Typography.Text, null, "Thumbnail image of Template Item"))),
|
|
33
|
+
type: React.createElement(CustomTag, { type: "normal" }, "string"),
|
|
34
|
+
default: React.createElement(CustomTag, { type: "default" }, " - "),
|
|
35
|
+
},
|
|
36
|
+
];
|
|
37
|
+
return React.createElement(Table, { dataSource: dataSource, columns: TABLE_API_COLUMNS, pagination: false });
|
|
38
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import LinkTo from '@storybook/addon-links/react';
|
|
4
|
+
// Components
|
|
5
|
+
import { Table } from '../../../../../../organism';
|
|
6
|
+
import { Tag, Typography, Flex } from '../../../../../../atoms';
|
|
7
|
+
// Constants
|
|
8
|
+
import { TABLE_API_COLUMNS } from '@antscorp/antsomi-ui/es/constants';
|
|
9
|
+
import { LISTING_GAP_DEFAULT } from '../../../../constants';
|
|
10
|
+
// Utils
|
|
11
|
+
import { CustomTag } from '@antscorp/antsomi-ui/es/utils/commonComponent';
|
|
12
|
+
export const TemplatesPropsTable = () => {
|
|
13
|
+
const dataSource = [
|
|
14
|
+
{
|
|
15
|
+
key: '1',
|
|
16
|
+
property: 'items',
|
|
17
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
18
|
+
React.createElement(Typography.Text, null, "List of templates"))),
|
|
19
|
+
type: (React.createElement(LinkTo, { story: "t-template-item" },
|
|
20
|
+
React.createElement(CustomTag, { type: "link" }, "( TTemplateItem & T) [ ]"))),
|
|
21
|
+
default: React.createElement(Tag, { bordered: false }, "[ ]"),
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
key: '2',
|
|
25
|
+
property: 'loading',
|
|
26
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
27
|
+
React.createElement(Typography.Text, null, "Show loading template listing"))),
|
|
28
|
+
type: React.createElement(CustomTag, { type: "normal" }, "boolean"),
|
|
29
|
+
default: React.createElement(CustomTag, { type: "default" }, "false"),
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
key: '3',
|
|
33
|
+
property: 'gap',
|
|
34
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
35
|
+
React.createElement(Typography.Text, null, "Spacing between template items"),
|
|
36
|
+
React.createElement(Typography.Text, null, "When the screen size changes, the height and width of each template will change according to the screen, but the gap remains the same."))),
|
|
37
|
+
type: React.createElement(CustomTag, { type: "normal" }, "number"),
|
|
38
|
+
default: React.createElement(CustomTag, { type: "default" }, LISTING_GAP_DEFAULT),
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
key: '4',
|
|
42
|
+
property: 'onLoadMoreTemplates',
|
|
43
|
+
description: (React.createElement(Flex, { gap: 10, vertical: true },
|
|
44
|
+
React.createElement(Typography.Text, null, "Handles loading additional data based on lazy loading mechanism"))),
|
|
45
|
+
type: React.createElement(CustomTag, { type: "normal" }, '( ) => void'),
|
|
46
|
+
default: React.createElement(CustomTag, { type: "default" }, '( ) => { }'),
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
return React.createElement(Table, { dataSource: dataSource, columns: TABLE_API_COLUMNS, pagination: false });
|
|
50
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { DataTypeTable } from './DataTypeTables';
|
|
2
|
+
export { TemplatesPropsTable } from './TemplatesPropsTable';
|
|
3
|
+
export { CategoryListingPropsTable } from './CategoryListingPropsTable';
|
|
4
|
+
export { BlankTemplatePropsTable } from './BlankTemplatePropsTable';
|
|
5
|
+
export { EmptyPropsTable } from './EmptyPropsTable';
|
|
6
|
+
export { TTemplateItemTable } from './TTemplateItemTable';
|
|
7
|
+
export { TCategoryItemTable } from './TCategoryItemTable';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { DataTypeTable } from './DataTypeTables';
|
|
2
|
+
export { TemplatesPropsTable } from './TemplatesPropsTable';
|
|
3
|
+
export { CategoryListingPropsTable } from './CategoryListingPropsTable';
|
|
4
|
+
export { BlankTemplatePropsTable } from './BlankTemplatePropsTable';
|
|
5
|
+
export { EmptyPropsTable } from './EmptyPropsTable';
|
|
6
|
+
export { TTemplateItemTable } from './TTemplateItemTable';
|
|
7
|
+
export { TCategoryItemTable } from './TCategoryItemTable';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ImageWrapper: import("styled-components").StyledComponent<"img", any, {}, never>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const TemplateListingWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/flex/interface").FlexProps<import("antd/es/_util/type").AnyObject> & import("react").RefAttributes<HTMLElement>>, any, {}, never>;
|
|
3
3
|
export declare const LoadMoreBlock: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
-
export declare const ImageWrapper: import("styled-components").StyledComponent<"img", any, {}, never>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
export interface BlankTemplateProps {
|
|
3
|
+
show?: boolean;
|
|
3
4
|
width?: number;
|
|
4
5
|
height?: number;
|
|
5
|
-
show?: boolean;
|
|
6
6
|
description?: string;
|
|
7
7
|
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
8
8
|
blankTemplateRender?: (node: ReactNode) => ReactNode;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { MenuProps } from 'antd';
|
|
3
|
+
import { EmptyProps } from './Empty';
|
|
3
4
|
export type TCheckedCategories = Record<string | number, (string | number)[]>;
|
|
4
5
|
export type TCategoryItemId = string | number;
|
|
5
6
|
export interface CategoryListingProps extends MenuProps {
|
|
@@ -8,6 +9,7 @@ export interface CategoryListingProps extends MenuProps {
|
|
|
8
9
|
loading?: boolean;
|
|
9
10
|
show?: boolean;
|
|
10
11
|
checkedCategories?: TCheckedCategories;
|
|
12
|
+
emptyProps?: EmptyProps;
|
|
11
13
|
onMenuChange?: (value: TCheckedCategories) => void;
|
|
12
14
|
}
|
|
13
15
|
export type TMenuItem = Required<MenuProps>['items'][number];
|
|
@@ -7,7 +7,7 @@ import { EmptyProps } from './Empty';
|
|
|
7
7
|
export interface TemplateListingProps<T = {}> {
|
|
8
8
|
templatesProps?: TemplatesProps<T>;
|
|
9
9
|
templateItemProps?: Omit<ThumbnailCardProps, 'id' | 'thumbnail'>;
|
|
10
|
-
categoryListingProps?: CategoryListingProps
|
|
10
|
+
categoryListingProps?: Omit<CategoryListingProps, 'emptyProps'>;
|
|
11
11
|
blankTemplateProps?: Omit<BlankTemplateProps, 'width' | 'height'>;
|
|
12
12
|
emptyProps?: EmptyProps;
|
|
13
13
|
previewModalProps?: PreviewTemplateModalProps;
|
|
@@ -8,13 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
// Libraries
|
|
11
|
-
import { useInfiniteQuery, useMutation, useQuery, } from '@tanstack/react-query';
|
|
11
|
+
import { useInfiniteQuery, useMutation, useQuery, useQueryClient, } from '@tanstack/react-query';
|
|
12
12
|
import { omit } from 'lodash';
|
|
13
13
|
// Services
|
|
14
14
|
import { templateListingServices, } from '@antscorp/antsomi-ui/es/services/TemplateListing';
|
|
15
15
|
// Constants
|
|
16
16
|
import { QUERY_KEYS } from '../../constants/queries';
|
|
17
|
-
import { queryClientAntsomiUI } from '../configs';
|
|
18
17
|
const { category, objectTemplate } = templateListingServices;
|
|
19
18
|
export const useGetTemplateCategoryList = (params) => {
|
|
20
19
|
const { options, args } = params;
|
|
@@ -45,39 +44,43 @@ export const useValidateTemplateName = (params) => {
|
|
|
45
44
|
};
|
|
46
45
|
export const useBulkUpdateTemplate = (params) => {
|
|
47
46
|
const { options } = params;
|
|
47
|
+
const queryClient = useQueryClient();
|
|
48
48
|
return useMutation(Object.assign({ mutationFn: objectTemplate.bulkUpdate, onSettled() {
|
|
49
|
-
|
|
49
|
+
queryClient.invalidateQueries([QUERY_KEYS.GET_OBJECT_TEMPLATE_LIST], {
|
|
50
50
|
exact: false,
|
|
51
51
|
});
|
|
52
|
-
|
|
52
|
+
queryClient.invalidateQueries([QUERY_KEYS.GET_TEMPLATE_CATEGORY_LIST], {
|
|
53
53
|
exact: false,
|
|
54
54
|
});
|
|
55
55
|
} }, options));
|
|
56
56
|
};
|
|
57
57
|
export const useCreateTemplate = (params) => {
|
|
58
58
|
const { options } = params;
|
|
59
|
+
const queryClient = useQueryClient();
|
|
59
60
|
return useMutation(Object.assign({ mutationFn: objectTemplate.create, onSettled() {
|
|
60
|
-
|
|
61
|
+
queryClient.invalidateQueries([QUERY_KEYS.GET_OBJECT_TEMPLATE_LIST], {
|
|
61
62
|
exact: false,
|
|
62
63
|
});
|
|
63
|
-
|
|
64
|
+
queryClient.invalidateQueries([QUERY_KEYS.GET_TEMPLATE_CATEGORY_LIST], {
|
|
64
65
|
exact: false,
|
|
65
66
|
});
|
|
66
67
|
} }, options));
|
|
67
68
|
};
|
|
68
69
|
export const useUpdateTemplate = (params) => {
|
|
69
70
|
const { options } = params;
|
|
71
|
+
const queryClient = useQueryClient();
|
|
70
72
|
return useMutation(Object.assign({ mutationFn: objectTemplate.update, onSettled() {
|
|
71
|
-
|
|
73
|
+
queryClient.invalidateQueries([QUERY_KEYS.GET_OBJECT_TEMPLATE_LIST], {
|
|
72
74
|
exact: false,
|
|
73
75
|
});
|
|
74
|
-
|
|
76
|
+
queryClient.invalidateQueries([QUERY_KEYS.GET_TEMPLATE_CATEGORY_LIST], {
|
|
75
77
|
exact: false,
|
|
76
78
|
});
|
|
77
79
|
} }, options));
|
|
78
80
|
};
|
|
79
81
|
export const usePersistTemplate = (params) => {
|
|
80
82
|
const { options } = params;
|
|
83
|
+
const queryClient = useQueryClient();
|
|
81
84
|
return useMutation(Object.assign({ mutationFn: (args) => {
|
|
82
85
|
const { persistType, params } = args;
|
|
83
86
|
switch (persistType) {
|
|
@@ -88,14 +91,14 @@ export const usePersistTemplate = (params) => {
|
|
|
88
91
|
return objectTemplate.create(Object.assign(Object.assign({}, params), { data: omit(params.data, ['template_id']) }));
|
|
89
92
|
}
|
|
90
93
|
}, onSettled(data, error, variables) {
|
|
91
|
-
|
|
94
|
+
queryClient.invalidateQueries([
|
|
92
95
|
QUERY_KEYS.GET_OBJECT_TEMPLATE_DETAIL,
|
|
93
96
|
variables.params.data.template_id,
|
|
94
97
|
]);
|
|
95
|
-
|
|
98
|
+
queryClient.invalidateQueries([QUERY_KEYS.GET_OBJECT_TEMPLATE_LIST], {
|
|
96
99
|
exact: false,
|
|
97
100
|
});
|
|
98
|
-
|
|
101
|
+
queryClient.invalidateQueries([QUERY_KEYS.GET_TEMPLATE_CATEGORY_LIST], {
|
|
99
102
|
exact: false,
|
|
100
103
|
});
|
|
101
104
|
} }, options));
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
// Libraries
|
|
13
|
+
import React, { useMemo } from 'react';
|
|
14
|
+
import { Tag } from '@antscorp/antsomi-ui/es/index';
|
|
15
|
+
export const CustomTag = props => {
|
|
16
|
+
const { type, children } = props, restOfProps = __rest(props, ["type", "children"]);
|
|
17
|
+
const settings = useMemo(() => {
|
|
18
|
+
switch (type) {
|
|
19
|
+
case 'link':
|
|
20
|
+
return { color: 'processing', bordered: true };
|
|
21
|
+
case 'normal':
|
|
22
|
+
return { bordered: false };
|
|
23
|
+
default:
|
|
24
|
+
return { bordered: false };
|
|
25
|
+
}
|
|
26
|
+
}, [type]);
|
|
27
|
+
return (React.createElement(Tag, Object.assign({}, settings, restOfProps), children));
|
|
28
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antscorp/antsomi-ui",
|
|
3
|
-
"version": "1.3.5-beta.
|
|
3
|
+
"version": "1.3.5-beta.66",
|
|
4
4
|
"description": "An enterprise-class UI design language and React UI library.",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"dist/*",
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"not op_mini all"
|
|
60
60
|
],
|
|
61
61
|
"dependencies": {
|
|
62
|
+
"@antscorp/antsomi-ui": "file:.yalc/@antscorp/antsomi-ui",
|
|
62
63
|
"@antscorp/icons": "0.27.6",
|
|
63
64
|
"@antscorp/image-editor": "1.0.2",
|
|
64
65
|
"@emotion/react": "^11.11.1",
|