@antscorp/antsomi-ui 1.3.5-beta.110 → 1.3.5-beta.112
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/components/molecules/ShareAccess/components/LayoutContent/LayoutContent.js +2 -2
- package/es/components/molecules/ShareAccess/components/PeopleAccess/PeopleAccess.js +13 -3
- package/es/components/molecules/ShareAccess/components/SearchUser/SearchUser.d.ts +1 -1
- package/es/components/molecules/ShareAccess/components/SearchUser/SearchUser.js +3 -2
- package/es/components/molecules/ShareAccess/types.d.ts +1 -0
- package/es/components/molecules/TemplateSaveAs/TemplateSaveAs.d.ts +1 -0
- package/es/components/molecules/TemplateSaveAs/TemplateSaveAs.js +16 -53
- package/es/components/molecules/TemplateSaveAs/components/Category/Category.d.ts +18 -0
- package/es/components/molecules/TemplateSaveAs/components/Category/Category.js +24 -0
- package/es/components/molecules/TemplateSaveAs/components/Category/index.d.ts +2 -0
- package/es/components/molecules/TemplateSaveAs/components/Category/index.js +1 -0
- package/es/components/molecules/TemplateSaveAs/components/index.d.ts +2 -0
- package/es/components/molecules/TemplateSaveAs/components/index.js +1 -0
- package/es/components/organism/PreviewTemplateModal/components/Banner/index.js +17 -3
- package/es/components/organism/PreviewTemplateModal/components/Banner/styled.js +5 -3
- package/es/components/organism/PreviewTemplateModal/components/Information/index.js +11 -10
- package/es/components/organism/PreviewTemplateModal/components/Information/styled.js +8 -5
- package/es/components/organism/PreviewTemplateModal/components/SimilarTemplate/index.js +3 -3
- package/es/components/organism/PreviewTemplateModal/components/SimilarTemplate/styled.d.ts +3 -0
- package/es/components/organism/PreviewTemplateModal/components/SimilarTemplate/styled.js +5 -0
- package/es/components/organism/PreviewTemplateModal/components/ThumbnailSlider/index.js +9 -7
- package/es/components/organism/PreviewTemplateModal/components/ThumbnailSlider/styled.js +10 -0
- package/es/components/template/TemplateListing/components/CategoryListing/index.js +23 -8
- package/es/components/template/TemplateListing/constants/defaultProps.d.ts +1 -0
- package/es/components/template/TemplateListing/constants/defaultProps.js +1 -0
- package/es/components/template/TemplateListing/index.js +1 -1
- package/es/components/template/TemplateListing/stories/dataTypes/components/BlankTemplatePropsTable/index.js +5 -9
- package/es/components/template/TemplateListing/stories/dataTypes/components/CategoryListingPropsTable/index.js +20 -11
- package/es/components/template/TemplateListing/stories/dataTypes/components/EmptyPropsTable/index.js +3 -5
- package/es/components/template/TemplateListing/stories/dataTypes/components/TCategoryItemTable/index.js +5 -9
- package/es/components/template/TemplateListing/stories/dataTypes/components/TTemplateItemTable/index.js +4 -7
- package/es/components/template/TemplateListing/stories/dataTypes/components/TemplatesPropsTable/index.js +5 -8
- package/es/components/template/TemplateListing/types/CategoryListing.d.ts +1 -0
- package/package.json +1 -1
|
@@ -6,13 +6,13 @@ import { PeopleAccess } from '../PeopleAccess';
|
|
|
6
6
|
import { SearchUser } from '../SearchUser';
|
|
7
7
|
import { StyledLayoutContentRoot } from './styled';
|
|
8
8
|
export const LayoutContent = (props) => {
|
|
9
|
-
const { getUserInfo, generalAccessSettings, excludeUserAccess, allowAddUser = true } = props;
|
|
9
|
+
const { getUserInfo, generalAccessSettings, excludeUserAccess, placeholder, allowAddUser = true, } = props;
|
|
10
10
|
const { state } = useShareAccess();
|
|
11
11
|
const { allowEdit, allowView } = state;
|
|
12
12
|
if (!allowEdit && !allowView)
|
|
13
13
|
return null;
|
|
14
14
|
return (React.createElement(StyledLayoutContentRoot, null,
|
|
15
|
-
allowAddUser && React.createElement(SearchUser, { getUserInfo: getUserInfo }),
|
|
15
|
+
allowAddUser && React.createElement(SearchUser, { getUserInfo: getUserInfo, placeholder: placeholder }),
|
|
16
16
|
React.createElement(PeopleAccess, { excludeUserAccess: excludeUserAccess }),
|
|
17
17
|
React.createElement(GeneralAccess, { generalAccessSettings: generalAccessSettings }),
|
|
18
18
|
React.createElement(ModalTransferOwnership, null)));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Icon from '@antscorp/icons';
|
|
2
2
|
import produce from 'immer';
|
|
3
3
|
import { Avatar, Dropdown, List } from 'antd';
|
|
4
|
-
import { remove } from 'lodash';
|
|
5
|
-
import React from 'react';
|
|
4
|
+
import { remove, cloneDeep } from 'lodash';
|
|
5
|
+
import React, { useMemo } from 'react';
|
|
6
6
|
import { ACCESS_PROPERTIES_BY_ROLE, PEOPLE_ACTION_KEYS, ROLE_ACCESS_LABEL, ROLE_MAPPING, } from '../../constants';
|
|
7
7
|
import { useShareAccess } from '../../hooks';
|
|
8
8
|
import { getActionsByUser } from '../../utils';
|
|
@@ -17,6 +17,16 @@ export const PeopleAccess = (props) => {
|
|
|
17
17
|
const { excludeUserAccess } = props;
|
|
18
18
|
const { state, dispatch } = useShareAccess();
|
|
19
19
|
const { accessInfo, accessUserId, accessUserPermission } = state;
|
|
20
|
+
const dataSourceSorted = useMemo(() => {
|
|
21
|
+
if (!Array.isArray(accessInfo === null || accessInfo === void 0 ? void 0 : accessInfo.listAccess))
|
|
22
|
+
return [];
|
|
23
|
+
const listAccess = cloneDeep((accessInfo === null || accessInfo === void 0 ? void 0 : accessInfo.listAccess) || []);
|
|
24
|
+
return listAccess.sort((a, b) => {
|
|
25
|
+
if (+a.role === +b.role)
|
|
26
|
+
return 0;
|
|
27
|
+
return +a.role === 1 ? -1 : 1;
|
|
28
|
+
});
|
|
29
|
+
}, [accessInfo === null || accessInfo === void 0 ? void 0 : accessInfo.listAccess]);
|
|
20
30
|
const handleClickAction = (actKey, updatedUserId) => {
|
|
21
31
|
if (!accessInfo || !dispatch)
|
|
22
32
|
return;
|
|
@@ -72,7 +82,7 @@ export const PeopleAccess = (props) => {
|
|
|
72
82
|
return null;
|
|
73
83
|
return (React.createElement(StyledPeopleAccessRoot, null,
|
|
74
84
|
React.createElement("div", { className: "title" }, "People with access"),
|
|
75
|
-
React.createElement(List, { dataSource:
|
|
85
|
+
React.createElement(List, { dataSource: dataSourceSorted, renderItem: access => {
|
|
76
86
|
const actions = getActionsByUser({
|
|
77
87
|
userId: accessUserId,
|
|
78
88
|
updatedUserId: access.userId,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ShareAccessProps } from '../../types';
|
|
3
|
-
type SearchUserProps = Pick<ShareAccessProps, 'getUserInfo'>;
|
|
3
|
+
type SearchUserProps = Pick<ShareAccessProps, 'getUserInfo' | 'placeholder'>;
|
|
4
4
|
export declare const SearchUser: (props: SearchUserProps) => React.JSX.Element | null;
|
|
5
5
|
export {};
|
|
@@ -17,7 +17,7 @@ import produce from 'immer';
|
|
|
17
17
|
import { ACCESS_PROPERTIES_BY_ROLE, ROLE_MAPPING } from '../../constants';
|
|
18
18
|
import { updateObjAccessInfo } from '../../actions';
|
|
19
19
|
export const SearchUser = (props) => {
|
|
20
|
-
const { getUserInfo } = props;
|
|
20
|
+
const { getUserInfo, placeholder } = props;
|
|
21
21
|
const { state, dispatch } = useShareAccess();
|
|
22
22
|
const { accessInfo, allowEdit } = state;
|
|
23
23
|
const [users, setUsers] = useState([]);
|
|
@@ -58,11 +58,12 @@ export const SearchUser = (props) => {
|
|
|
58
58
|
draft.listAccess.push(newUser);
|
|
59
59
|
});
|
|
60
60
|
dispatch(updateObjAccessInfo(updated));
|
|
61
|
+
setUsers([]);
|
|
61
62
|
};
|
|
62
63
|
if (!allowEdit)
|
|
63
64
|
return null;
|
|
64
65
|
return (React.createElement(StyledSearchUserRoot, null,
|
|
65
|
-
React.createElement(Select, { showSearch: true, placeholder:
|
|
66
|
+
React.createElement(Select, { showSearch: true, placeholder: placeholder || 'Add people and groups', value: [], searchValue: searchTerm, defaultActiveFirstOption: false, suffixIcon: null, filterOption: false, onSearch: v => setSearchTerm(v), notFoundContent: null, loading: isFetching, options: (users || []).map(user => ({
|
|
66
67
|
value: user.user_id,
|
|
67
68
|
label: (React.createElement(StyledSelectItem, { onClick: () => handleAddUser(user) },
|
|
68
69
|
React.createElement(Avatar, { src: user.avatar }),
|
|
@@ -40,6 +40,7 @@ export type ShareAccessProps = {
|
|
|
40
40
|
};
|
|
41
41
|
accessInfo?: ObjectAccessInfo;
|
|
42
42
|
allowAddUser?: boolean;
|
|
43
|
+
placeholder?: string;
|
|
43
44
|
excludeUserAccess?: ExcludeUserAccess;
|
|
44
45
|
getUserInfo?(search: string, signal: AbortSignal): Promise<UserInfo[]> | UserInfo[];
|
|
45
46
|
generalAccessSettings?: GeneralAccessSettings;
|
|
@@ -56,6 +56,7 @@ export interface TemplateSaveAsProps {
|
|
|
56
56
|
label?: string;
|
|
57
57
|
isLoading?: boolean;
|
|
58
58
|
defaultNewTemplateName?: string;
|
|
59
|
+
selectPlaceholder?: string;
|
|
59
60
|
onSearch?: (searchValue: string) => void;
|
|
60
61
|
onNamePopupScroll?: SelectProps['onPopupScroll'];
|
|
61
62
|
onScrollToBottom?: () => void;
|
|
@@ -11,21 +11,21 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
// Libraries
|
|
13
13
|
import React, { useEffect, useState } from 'react';
|
|
14
|
-
import {
|
|
14
|
+
import { Form } from 'antd';
|
|
15
15
|
import dayjs from 'dayjs';
|
|
16
16
|
// Components
|
|
17
|
-
import {
|
|
17
|
+
import { Flex, Input, Typography, Select, ShareAccess, RadioGroup, Radio, Space, Spin, } from '@antscorp/antsomi-ui/es/components';
|
|
18
18
|
// Hooks
|
|
19
19
|
import { useDebounce } from '@antscorp/antsomi-ui/es/hooks/useDebounceV2';
|
|
20
20
|
// Styles
|
|
21
21
|
import { TemplateSaveAsStyled } from './styled';
|
|
22
|
-
import { ImageSlider } from './components';
|
|
22
|
+
import { Category, ImageSlider } from './components';
|
|
23
23
|
const { Text } = Typography;
|
|
24
24
|
export const TemplateSaveAs = props => {
|
|
25
25
|
const { className, shareAccess, saveOptions, imageReview, isLoadingCategories, categories, omitCategories, templateNames: templateNameList, templateNamesOptions, descriptionOptions, form, value, onChange, onEvent, } = props;
|
|
26
26
|
const { show: isShowShareAccess } = shareAccess, shareAccessProps = __rest(shareAccess, ["show"]);
|
|
27
27
|
const { label: imageReviewLabel } = imageReview, restImageReviewProps = __rest(imageReview, ["label"]);
|
|
28
|
-
const { isLoading, label: templateLabel, defaultNewTemplateName = `Untitled Media Template#${dayjs().format('YYYY-MM-DD HH:mm:ss')}`, onSearch, onNamePopupScroll, onScrollToBottom, } = templateNamesOptions || {};
|
|
28
|
+
const { isLoading, label: templateLabel, defaultNewTemplateName = `Untitled Media Template#${dayjs().format('YYYY-MM-DD HH:mm:ss')}`, selectPlaceholder, onSearch, onNamePopupScroll, onScrollToBottom, } = templateNamesOptions || {};
|
|
29
29
|
const { label: descriptionLabel, placeholder: descriptionPlaceholder } = descriptionOptions || {};
|
|
30
30
|
const { saveNewText = 'Save as a new media Template', saveExistText = 'Save as an existing media Template', saveNewValue = 'save-new', saveExistValue = 'save-exist', } = saveOptions || {};
|
|
31
31
|
const { saveOption = saveNewValue, templateName = saveOption === saveNewValue || !saveOption
|
|
@@ -54,24 +54,18 @@ export const TemplateSaveAs = props => {
|
|
|
54
54
|
onChange(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, value), (!(value === null || value === void 0 ? void 0 : value.saveOption) && { saveOption: saveNewValue })), (!(value === null || value === void 0 ? void 0 : value.templateName) && { templateName: { id: undefined, label: templateNameNew } })), (!(value === null || value === void 0 ? void 0 : value.defaultThumbnail) && { defaultThumbnail })), newValue), (_b = (_a = form === null || form === void 0 ? void 0 : form.getFieldsError()) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.errors);
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
|
-
const handleAddCategory = ({ parentKey,
|
|
58
|
-
const currCategory = categoriesValue === null || categoriesValue === void 0 ? void 0 : categoriesValue[parentKey];
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
handleChangeValue({ categories: newCategory });
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
const newCategory = Object.assign(Object.assign({}, categoriesValue), { [parentKey]: [+item] });
|
|
65
|
-
handleChangeValue({ categories: newCategory });
|
|
66
|
-
}
|
|
57
|
+
const handleAddCategory = ({ parentKey, childKey }) => {
|
|
58
|
+
const currCategory = (categoriesValue === null || categoriesValue === void 0 ? void 0 : categoriesValue[parentKey]) || [];
|
|
59
|
+
const newCategory = Object.assign(Object.assign({}, categoriesValue), { [parentKey]: [...currCategory, +childKey] });
|
|
60
|
+
handleChangeValue({ categories: newCategory });
|
|
67
61
|
};
|
|
68
|
-
const handleRemoveCategory = ({
|
|
69
|
-
const currCategory = categoriesValue === null || categoriesValue === void 0 ? void 0 : categoriesValue[
|
|
62
|
+
const handleRemoveCategory = ({ parentKey, childKey }) => {
|
|
63
|
+
const currCategory = categoriesValue === null || categoriesValue === void 0 ? void 0 : categoriesValue[parentKey];
|
|
70
64
|
if (!currCategory)
|
|
71
65
|
return;
|
|
72
|
-
const newChildren = currCategory.filter(child => child !==
|
|
66
|
+
const newChildren = currCategory.filter(child => child !== childKey);
|
|
73
67
|
handleChangeValue({
|
|
74
|
-
categories: Object.assign(Object.assign({}, categoriesValue), { [
|
|
68
|
+
categories: Object.assign(Object.assign({}, categoriesValue), { [parentKey]: newChildren }),
|
|
75
69
|
});
|
|
76
70
|
};
|
|
77
71
|
return (React.createElement(Form, { form: form, initialValues: {
|
|
@@ -95,13 +89,12 @@ export const TemplateSaveAs = props => {
|
|
|
95
89
|
React.createElement(Flex, { className: "field-container" },
|
|
96
90
|
React.createElement(Text, { className: "field-title field-title--middle" },
|
|
97
91
|
templateLabel || 'Template name',
|
|
98
|
-
" ",
|
|
99
|
-
React.createElement("span", null, " *")),
|
|
92
|
+
React.createElement("span", null, "\u2009*")),
|
|
100
93
|
saveOption === saveNewValue ? (React.createElement(Form.Item, { name: "template-name", validateTrigger: "onChange", noStyle: true, rules: [{ required: true }] },
|
|
101
94
|
React.createElement(Input, { className: "field-input", value: templateNameNew, debounce: 100, onAfterChange: value => {
|
|
102
95
|
handleChangeValue({ templateName: { id: undefined, label: value } });
|
|
103
96
|
setTemplateNameNew(value);
|
|
104
|
-
}, "aria-valuetext": templateNameNew, required: true }))) : (React.createElement(Select, { className: "field-input", showSearch: true, searchValue: searchValue, onSearch: setSearchValue, onPopupScroll: e => {
|
|
97
|
+
}, "aria-valuetext": templateNameNew, required: true }))) : (React.createElement(Select, { className: "field-input", placeholder: selectPlaceholder, showSearch: true, searchValue: searchValue, onSearch: setSearchValue, onPopupScroll: e => {
|
|
105
98
|
if (onNamePopupScroll)
|
|
106
99
|
onNamePopupScroll(e);
|
|
107
100
|
if (onScrollToBottom) {
|
|
@@ -160,41 +153,11 @@ export const TemplateSaveAs = props => {
|
|
|
160
153
|
React.createElement(Spin, { size: "small" })))) : null,
|
|
161
154
|
!isLoadingCategories && categories
|
|
162
155
|
? categories.map(parentCategory => {
|
|
163
|
-
var _a;
|
|
164
156
|
const selectedChildren = categoriesValue[parentCategory.key];
|
|
165
|
-
const remainChildren = parentCategory.children.filter(item => !(selectedChildren === null || selectedChildren === void 0 ? void 0 : selectedChildren.includes(item.key)));
|
|
166
157
|
// NOTE: filter to remove device and template categories
|
|
167
|
-
if (
|
|
168
|
-
omitCategories.includes(parentCategory.key.toString()))
|
|
158
|
+
if (omitCategories === null || omitCategories === void 0 ? void 0 : omitCategories.includes(parentCategory.key.toString()))
|
|
169
159
|
return null;
|
|
170
|
-
return (React.createElement(
|
|
171
|
-
React.createElement(Text, { className: "field-title" }, parentCategory.label),
|
|
172
|
-
React.createElement(Flex, { wrap: "wrap", gap: 10, className: "category-container" },
|
|
173
|
-
/* selectedCategory */
|
|
174
|
-
selectedChildren === null || selectedChildren === void 0 ? void 0 :
|
|
175
|
-
selectedChildren.map(selectedKey => {
|
|
176
|
-
var _a;
|
|
177
|
-
const selectedLabel = (_a = parentCategory.children.find(item => item.key === selectedKey)) === null || _a === void 0 ? void 0 : _a.label;
|
|
178
|
-
return (React.createElement(Flex, { key: selectedKey, className: "selected-category", justify: "space-between", align: "center" },
|
|
179
|
-
React.createElement(Tooltip, { title: selectedLabel, zIndex: 3001 },
|
|
180
|
-
React.createElement(Text, { ellipsis: true, style: { textOverflow: 'ellipsis' } }, selectedLabel)),
|
|
181
|
-
' ',
|
|
182
|
-
React.createElement("span", { className: "remove-btn", onClick: () => handleRemoveCategory({
|
|
183
|
-
parent: parentCategory.key,
|
|
184
|
-
item: selectedKey,
|
|
185
|
-
}) }, "\u00D7")));
|
|
186
|
-
}),
|
|
187
|
-
React.createElement(Dropdown, { menu: {
|
|
188
|
-
items: remainChildren,
|
|
189
|
-
onClick: ({ key }) => {
|
|
190
|
-
handleAddCategory({
|
|
191
|
-
parentKey: parentCategory.key,
|
|
192
|
-
item: key,
|
|
193
|
-
});
|
|
194
|
-
},
|
|
195
|
-
}, getPopupContainer: triggerNode => triggerNode.parentElement, trigger: ['click'] }, typeof parentCategory.label === 'string' ? (React.createElement(Button, null,
|
|
196
|
-
"+ Add ", (_a = parentCategory.label) === null || _a === void 0 ? void 0 :
|
|
197
|
-
_a.toLowerCase())) : (parentCategory.label)))));
|
|
160
|
+
return (React.createElement(Category, { key: parentCategory.key, categoryKey: parentCategory.key, categoryChildren: parentCategory.children, label: parentCategory.label, selected: selectedChildren, onAddCategory: handleAddCategory, onRemoveCategory: handleRemoveCategory }));
|
|
198
161
|
})
|
|
199
162
|
: null),
|
|
200
163
|
isShowShareAccess ? (React.createElement("div", { className: "share-access-container" },
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type EditCategory = ({ parentKey, childKey, }: {
|
|
3
|
+
parentKey: string | number;
|
|
4
|
+
childKey: string | number;
|
|
5
|
+
}) => void;
|
|
6
|
+
interface CategoryProps {
|
|
7
|
+
categoryKey: string | number;
|
|
8
|
+
categoryChildren: Array<{
|
|
9
|
+
key: string | number;
|
|
10
|
+
label: string | React.ReactNode;
|
|
11
|
+
}>;
|
|
12
|
+
label: string | React.ReactNode;
|
|
13
|
+
selected: (string | number)[];
|
|
14
|
+
onRemoveCategory: EditCategory;
|
|
15
|
+
onAddCategory: EditCategory;
|
|
16
|
+
}
|
|
17
|
+
export declare const Category: React.FC<CategoryProps>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Tooltip, Button, Flex, Typography, Dropdown } from '@antscorp/antsomi-ui/es/components';
|
|
3
|
+
const { Text } = Typography;
|
|
4
|
+
export const Category = props => {
|
|
5
|
+
const { categoryKey, categoryChildren, label, selected, onRemoveCategory, onAddCategory } = props;
|
|
6
|
+
const remainChildren = categoryChildren.filter(item => !(selected === null || selected === void 0 ? void 0 : selected.includes(item.key)));
|
|
7
|
+
return (React.createElement(Flex, { className: "field-container" },
|
|
8
|
+
React.createElement(Text, { className: "field-title" }, label),
|
|
9
|
+
React.createElement(Flex, { wrap: "wrap", gap: 10, className: "category-container" }, selected === null || selected === void 0 ? void 0 :
|
|
10
|
+
selected.map(selectedKey => {
|
|
11
|
+
var _a;
|
|
12
|
+
const selectedLabel = (_a = categoryChildren.find(item => item.key === selectedKey)) === null || _a === void 0 ? void 0 : _a.label;
|
|
13
|
+
return (React.createElement(Flex, { key: selectedKey, className: "selected-category", justify: "space-between", align: "center" },
|
|
14
|
+
React.createElement(Tooltip, { title: selectedLabel, zIndex: 3001 },
|
|
15
|
+
React.createElement(Text, { ellipsis: true, style: { textOverflow: 'ellipsis' } }, selectedLabel)),
|
|
16
|
+
React.createElement("span", { className: "remove-btn", onClick: () => onRemoveCategory({ parentKey: categoryKey, childKey: selectedKey }) }, "\u00D7")));
|
|
17
|
+
}),
|
|
18
|
+
React.createElement(Dropdown, { menu: {
|
|
19
|
+
items: remainChildren,
|
|
20
|
+
onClick: ({ key }) => onAddCategory({ parentKey: categoryKey, childKey: key }),
|
|
21
|
+
}, getPopupContainer: triggerNode => triggerNode.parentElement, trigger: ['click'] }, typeof label === 'string' ? React.createElement(Button, null,
|
|
22
|
+
"+ Add ", label === null || label === void 0 ? void 0 :
|
|
23
|
+
label.toLowerCase()) : label))));
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Category } from './Category';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Libraries
|
|
2
|
-
import React, { memo, useMemo } from 'react';
|
|
2
|
+
import React, { memo, useEffect, useMemo, useState } from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
3
4
|
// Styled
|
|
4
5
|
import { BannerWrapper } from './styled';
|
|
5
6
|
// Components
|
|
@@ -9,9 +10,22 @@ import { DEVICE_TYPE } from '../../constants';
|
|
|
9
10
|
export const Banner = memo(props => {
|
|
10
11
|
const { deviceType, showSkeleton = false, children } = props;
|
|
11
12
|
const isMobile = useMemo(() => deviceType === DEVICE_TYPE.MOBILE.value, [deviceType]);
|
|
13
|
+
// States
|
|
14
|
+
const [shouldAnimate, setShouldAnimate] = useState(false);
|
|
15
|
+
// Side effects
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
setShouldAnimate(true);
|
|
18
|
+
const timerId = setTimeout(() => {
|
|
19
|
+
setShouldAnimate(false);
|
|
20
|
+
}, 1000);
|
|
21
|
+
return () => clearTimeout(timerId);
|
|
22
|
+
}, [children]);
|
|
12
23
|
return (React.createElement(BannerWrapper, null,
|
|
13
|
-
React.createElement("div", { className: `${isMobile ? 'mobile-wrapper' : 'desktop-wrapper'}` },
|
|
14
|
-
React.createElement("div", { className:
|
|
24
|
+
React.createElement("div", { className: `${isMobile ? 'mobile-wrapper animate__animated animate__zoomIn' : 'desktop-wrapper'}` },
|
|
25
|
+
React.createElement("div", { className: classNames({
|
|
26
|
+
'content-wrapper': true,
|
|
27
|
+
'animate__animated animate__fadeIn': shouldAnimate,
|
|
28
|
+
}) }, isMobile ? React.createElement(MobileFrameV2, null, children || null) : children || null),
|
|
15
29
|
showSkeleton && (React.createElement(React.Fragment, null,
|
|
16
30
|
React.createElement("div", { className: "skeleton" }),
|
|
17
31
|
React.createElement("div", { className: "backdrop" }))))));
|
|
@@ -17,6 +17,7 @@ export const BannerWrapper = styled.div `
|
|
|
17
17
|
width: 380px;
|
|
18
18
|
height: 800px;
|
|
19
19
|
border-radius: 80px;
|
|
20
|
+
animation-duration: 0.2s !important;
|
|
20
21
|
|
|
21
22
|
.content-wrapper {
|
|
22
23
|
width: fit-content;
|
|
@@ -34,7 +35,7 @@ export const BannerWrapper = styled.div `
|
|
|
34
35
|
height: 100%;
|
|
35
36
|
width: 100%;
|
|
36
37
|
border-radius: ${THUMBNAIL_CARD_RADIUS}px;
|
|
37
|
-
|
|
38
|
+
transition: width 0.2s ease, height 0.2s ease;
|
|
38
39
|
.content-wrapper {
|
|
39
40
|
width: 100%;
|
|
40
41
|
height: 100%;
|
|
@@ -43,9 +44,10 @@ export const BannerWrapper = styled.div `
|
|
|
43
44
|
|
|
44
45
|
.content-wrapper {
|
|
45
46
|
position: absolute;
|
|
46
|
-
top: 0;
|
|
47
|
-
left: 0;
|
|
48
47
|
z-index: 12;
|
|
48
|
+
top: 50%;
|
|
49
|
+
left: 50%;
|
|
50
|
+
transform: translate(-50%, -50%);
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
.skeleton {
|
|
@@ -8,22 +8,23 @@ import { Button, Radio, Typography, Flex } from '../../../../atoms';
|
|
|
8
8
|
// Constants
|
|
9
9
|
import { DEVICE_TYPE } from '../../constants';
|
|
10
10
|
export const Information = memo(props => {
|
|
11
|
-
const { deviceType, itemName = 'Template name', buttonText = 'Use template', description
|
|
11
|
+
const { deviceType, itemName = 'Template name', buttonText = 'Use template', description, categoryListing, showDeviceRadios = true, onButtonClick, onDeviceTypeChange, } = props;
|
|
12
12
|
return (React.createElement(InformationWrapper, { gap: 20, vertical: true },
|
|
13
13
|
React.createElement("div", { style: { flexShrink: 0 }, className: "title" }, itemName),
|
|
14
14
|
React.createElement(Flex, { gap: 20, vertical: true, className: "content-information" },
|
|
15
|
-
React.createElement("div", null, description), categoryListing === null || categoryListing === void 0 ? void 0 :
|
|
15
|
+
description && React.createElement("div", null, description), categoryListing === null || categoryListing === void 0 ? void 0 :
|
|
16
16
|
categoryListing.map(({ key, label, children }) => (React.createElement("div", { key: key },
|
|
17
17
|
React.createElement("div", null,
|
|
18
18
|
label,
|
|
19
19
|
":"),
|
|
20
20
|
React.createElement("div", { style: { fontWeight: 'bold' } }, children === null || children === void 0 ? void 0 : children.map(({ label }) => label).join(', ')))))),
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
React.createElement(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
React.createElement(
|
|
21
|
+
React.createElement(Flex, { gap: 20, style: { flexShrink: 0 }, vertical: true },
|
|
22
|
+
showDeviceRadios && (React.createElement(Radio.Group, { options: Object.values(DEVICE_TYPE).map(({ value, label, icon }) => ({
|
|
23
|
+
label: (React.createElement(Flex, { gap: 5, align: "center" },
|
|
24
|
+
React.createElement(Icon, { type: icon }),
|
|
25
|
+
label)),
|
|
26
|
+
value,
|
|
27
|
+
})), onChange: e => onDeviceTypeChange(e.target.value), value: deviceType, optionType: "button", style: { flexShrink: 0 } })),
|
|
28
|
+
React.createElement(Button, { type: "primary", style: { width: '100%', flexShrink: 0 }, onClick: onButtonClick },
|
|
29
|
+
React.createElement(Typography.Text, { ellipsis: { tooltip: buttonText }, style: { maxWidth: '100%', color: 'inherit' } }, buttonText)))));
|
|
29
30
|
});
|
|
@@ -6,7 +6,8 @@ export const InformationWrapper = styled(Flex) `
|
|
|
6
6
|
width: 350px;
|
|
7
7
|
flex-shrink: 0;
|
|
8
8
|
font-size: 12px;
|
|
9
|
-
|
|
9
|
+
height: 100%;
|
|
10
|
+
max-height: 100%;
|
|
10
11
|
|
|
11
12
|
.title {
|
|
12
13
|
font-size: 16px;
|
|
@@ -33,10 +34,12 @@ export const InformationWrapper = styled(Flex) `
|
|
|
33
34
|
font-size: 24px;
|
|
34
35
|
}
|
|
35
36
|
}
|
|
37
|
+
}
|
|
36
38
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
.content-information {
|
|
40
|
+
flex: 1 1 0%;
|
|
41
|
+
height: fit-content;
|
|
42
|
+
overflow-y: auto;
|
|
43
|
+
max-height: 682px;
|
|
41
44
|
}
|
|
42
45
|
`;
|
|
@@ -17,7 +17,7 @@ import { ThumbnailCard } from '../../../../molecules';
|
|
|
17
17
|
import { Empty } from '../../../../template/TemplateListing/components/Empty';
|
|
18
18
|
import { Flex } from '../../../../atoms';
|
|
19
19
|
// Styled
|
|
20
|
-
import { SimilarTemplateWrapper } from './styled';
|
|
20
|
+
import { SimilarTemplateWrapper, TemplateListWrapper } from './styled';
|
|
21
21
|
// Constants
|
|
22
22
|
import { SIMILAR_CARD_HEIGHT_DEFAULT, SIMILAR_CARD_WIDTH_DEFAULT } from '../../constants';
|
|
23
23
|
const MAX_QUANTITY_TEMPLATES = 4;
|
|
@@ -27,6 +27,6 @@ export const SimilarTemplate = memo(props => {
|
|
|
27
27
|
const _b = similarCardProps || {}, { width = SIMILAR_CARD_WIDTH_DEFAULT, height = SIMILAR_CARD_HEIGHT_DEFAULT } = _b, restOfSimilarCardProps = __rest(_b, ["width", "height"]);
|
|
28
28
|
return show ? (React.createElement(SimilarTemplateWrapper, { gap: 15, vertical: true },
|
|
29
29
|
React.createElement("div", { className: "title" }, "Similar templates"),
|
|
30
|
-
React.createElement(Flex, {
|
|
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;
|
|
30
|
+
isEmpty(similarTemplates) ? (React.createElement(Flex, { justify: "center" },
|
|
31
|
+
React.createElement(Empty, null))) : (React.createElement(TemplateListWrapper, { templateQuantity: MAX_QUANTITY_TEMPLATES }, (_a = similarTemplates.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;
|
|
32
32
|
});
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const SimilarTemplateWrapper: 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
|
+
export declare const TemplateListWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
4
|
+
templateQuantity: number;
|
|
5
|
+
}, never>;
|
|
@@ -10,3 +10,8 @@ export const SimilarTemplateWrapper = styled(Flex) `
|
|
|
10
10
|
font-size: 16px;
|
|
11
11
|
}
|
|
12
12
|
`;
|
|
13
|
+
export const TemplateListWrapper = styled.div `
|
|
14
|
+
display: grid;
|
|
15
|
+
grid-template-columns: ${({ templateQuantity }) => `repeat(${templateQuantity}, minmax(0, 1fr))`};
|
|
16
|
+
gap: 30px;
|
|
17
|
+
`;
|
|
@@ -50,7 +50,7 @@ export const ThumbnailSlider = memo(props => {
|
|
|
50
50
|
return (React.createElement(Flex, { gap: GAP_X },
|
|
51
51
|
!!index && (React.createElement(Flex, { align: "center" },
|
|
52
52
|
React.createElement(Icon, { type: "icon-ants-expand-more", style: { fontSize: ICON_SIZE, transform: 'rotate(270deg)' } }))),
|
|
53
|
-
React.createElement(ThumbnailCard, Object.assign({ key: id, id: id, width: width, height: height, thumbnail: url, style: { flexShrink: 0 }, actionAvailable: false, onClickWrapper: () => onClickThumbnail === null || onClickThumbnail === void 0 ? void 0 : onClickThumbnail(thumbnail) }, restOfThumbnailProps))));
|
|
53
|
+
React.createElement(ThumbnailCard, Object.assign({ key: id, id: id, width: width, height: height, thumbnail: url, style: { flexShrink: 0 }, className: "thumbnail-animation", actionAvailable: false, onClickWrapper: () => onClickThumbnail === null || onClickThumbnail === void 0 ? void 0 : onClickThumbnail(thumbnail) }, restOfThumbnailProps))));
|
|
54
54
|
};
|
|
55
55
|
return thumbnails && !isEmpty(thumbnails) ? (React.createElement(ThumbnailSliderWrapper, null, isShowSwiper ? (React.createElement(React.Fragment, null,
|
|
56
56
|
React.createElement(Swiper, { slidesPerView: Math.floor(WRAPPER_WIDTH / thumbnailWrapperWidth), spaceBetween: GAP_X, modules: [Navigation, A11y, Thumbs], navigation: {
|
|
@@ -59,12 +59,14 @@ export const ThumbnailSlider = memo(props => {
|
|
|
59
59
|
}, onBeforeInit: swiper => {
|
|
60
60
|
setTimeout(() => {
|
|
61
61
|
// Override prevEl & nextEl now that refs are defined
|
|
62
|
-
swiper.params.navigation.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
if (swiper.params.navigation && typeof swiper.params.navigation !== 'boolean') {
|
|
63
|
+
swiper.params.navigation.prevEl = navigationPrevRef.current;
|
|
64
|
+
swiper.params.navigation.nextEl = navigationNextRef.current;
|
|
65
|
+
// Re-init navigation
|
|
66
|
+
swiper.navigation.destroy();
|
|
67
|
+
swiper.navigation.init();
|
|
68
|
+
swiper.navigation.update();
|
|
69
|
+
}
|
|
68
70
|
});
|
|
69
71
|
}, onSlideChange: ({ isBeginning, isEnd }) => {
|
|
70
72
|
setSlideBeginning(isBeginning);
|
|
@@ -11,11 +11,21 @@ export const ThumbnailSliderWrapper = styled.div `
|
|
|
11
11
|
|
|
12
12
|
.swiper {
|
|
13
13
|
max-width: 1030px;
|
|
14
|
+
|
|
14
15
|
.swiper-slide {
|
|
15
16
|
width: fit-content !important;
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
19
|
|
|
20
|
+
.thumbnail-animation {
|
|
21
|
+
box-shadow: none;
|
|
22
|
+
transition: box-shadow 0.1s ease-in-out;
|
|
23
|
+
|
|
24
|
+
&:hover {
|
|
25
|
+
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1), 0 0 32px rgba(0, 0, 0, 0.04);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
19
29
|
.custom-button-prev,
|
|
20
30
|
.custom-button-next {
|
|
21
31
|
z-index: 10;
|
|
@@ -10,10 +10,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
// Libraries
|
|
13
|
-
import React, { memo, useCallback, useMemo } from 'react';
|
|
13
|
+
import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
14
14
|
import { isEmpty, isNumber } from 'lodash';
|
|
15
15
|
import Icon from '@antscorp/icons';
|
|
16
16
|
import { THEME } from '@antscorp/antsomi-ui/es/constants';
|
|
17
|
+
import isEqual from 'react-fast-compare';
|
|
17
18
|
// Styled
|
|
18
19
|
import { CustomLabelStyled, CustomRootLabel, MenuWrapper, TextWrapper } from './styled';
|
|
19
20
|
// Components
|
|
@@ -23,11 +24,19 @@ import { Empty } from '../Empty';
|
|
|
23
24
|
// Utils
|
|
24
25
|
import { handleError } from '@antscorp/antsomi-ui/es/utils';
|
|
25
26
|
// Constants
|
|
26
|
-
import { CATEGORY_LISTING_WITH } from '../../constants';
|
|
27
|
+
import { CATEGORY_DEBOUNCE, CATEGORY_LISTING_WITH } from '../../constants';
|
|
27
28
|
const PATH = 'src/components/template/TemplateListing/components/CategoryListing/index.tsx';
|
|
28
29
|
export const CategoryListing = memo(props => {
|
|
29
30
|
var _a;
|
|
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
|
+
const { width = CATEGORY_LISTING_WITH, items = [], loading = false, show = true, checkedCategories = {}, emptyProps, debounceChangeMenu = CATEGORY_DEBOUNCE, onMenuChange } = props, restOfProps = __rest(props, ["width", "items", "loading", "show", "checkedCategories", "emptyProps", "debounceChangeMenu", "onMenuChange"]);
|
|
32
|
+
// States
|
|
33
|
+
const [checkedState, setCheckedState] = useState({});
|
|
34
|
+
// Side Effects
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
setCheckedState(prev => (isEqual(prev, checkedCategories) ? prev : checkedCategories));
|
|
37
|
+
}, [checkedCategories]);
|
|
38
|
+
// Ref
|
|
39
|
+
const timeoutAfterChange = useRef(null);
|
|
31
40
|
// Handlers
|
|
32
41
|
const handleClickMenu = e => {
|
|
33
42
|
var _a;
|
|
@@ -35,9 +44,15 @@ export const CategoryListing = memo(props => {
|
|
|
35
44
|
const { key, keyPath } = e;
|
|
36
45
|
const parentId = keyPath === null || keyPath === void 0 ? void 0 : keyPath[1];
|
|
37
46
|
if (parentId) {
|
|
38
|
-
const newCheckedCategories = ((_a =
|
|
39
|
-
? Object.assign(Object.assign({},
|
|
40
|
-
|
|
47
|
+
const newCheckedCategories = ((_a = checkedState === null || checkedState === void 0 ? void 0 : checkedState[parentId]) === null || _a === void 0 ? void 0 : _a.includes(key))
|
|
48
|
+
? Object.assign(Object.assign({}, checkedState), { [parentId]: checkedState[parentId].filter(item => item !== key) }) : Object.assign(Object.assign({}, checkedState), { [parentId]: [...((checkedState === null || checkedState === void 0 ? void 0 : checkedState[parentId]) || []), key] });
|
|
49
|
+
if (timeoutAfterChange) {
|
|
50
|
+
setCheckedState(newCheckedCategories);
|
|
51
|
+
clearTimeout(timeoutAfterChange.current);
|
|
52
|
+
}
|
|
53
|
+
timeoutAfterChange.current = setTimeout(() => {
|
|
54
|
+
onMenuChange === null || onMenuChange === void 0 ? void 0 : onMenuChange(newCheckedCategories);
|
|
55
|
+
}, debounceChangeMenu);
|
|
41
56
|
}
|
|
42
57
|
}
|
|
43
58
|
catch (error) {
|
|
@@ -53,7 +68,7 @@ export const CategoryListing = memo(props => {
|
|
|
53
68
|
var _a;
|
|
54
69
|
try {
|
|
55
70
|
const { key, parentId, label, total } = args;
|
|
56
|
-
const isChecked = !!(!!parentId && ((_a =
|
|
71
|
+
const isChecked = !!(!!parentId && ((_a = checkedState === null || checkedState === void 0 ? void 0 : checkedState[parentId]) === null || _a === void 0 ? void 0 : _a.includes(key)));
|
|
57
72
|
return (React.createElement(CustomLabelStyled, { onClick: e => e.preventDefault() },
|
|
58
73
|
React.createElement("div", { className: "label" },
|
|
59
74
|
React.createElement(Checkbox, { checked: isChecked },
|
|
@@ -68,7 +83,7 @@ export const CategoryListing = memo(props => {
|
|
|
68
83
|
});
|
|
69
84
|
return null;
|
|
70
85
|
}
|
|
71
|
-
}, [
|
|
86
|
+
}, [checkedState]);
|
|
72
87
|
const getItem = useCallback((item, isRoot) => {
|
|
73
88
|
try {
|
|
74
89
|
const { key, label, children } = item;
|
|
@@ -4,6 +4,7 @@ import { EmptyProps } from '../types/Empty';
|
|
|
4
4
|
export declare const CATEGORY_LISTING_WITH = 220;
|
|
5
5
|
export declare const THUMBNAIL_URL = "https://st-media-template.antsomi.com/base64-img/37563.png";
|
|
6
6
|
export declare const LISTING_GAP_DEFAULT = 30;
|
|
7
|
+
export declare const CATEGORY_DEBOUNCE = 400;
|
|
7
8
|
export declare const TEMPLATE_ITEM_DEFAULT: Omit<ThumbnailCardProps, 'id'>;
|
|
8
9
|
export declare const BLANK_TEMPLATE_DEFAULT: BlankTemplateProps;
|
|
9
10
|
export declare const CATEGORY_LISTING_DEFAULT: Omit<CategoryListingProps, 'items'>;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export const CATEGORY_LISTING_WITH = 220;
|
|
3
3
|
export const THUMBNAIL_URL = 'https://st-media-template.antsomi.com/base64-img/37563.png';
|
|
4
4
|
export const LISTING_GAP_DEFAULT = 30;
|
|
5
|
+
export const CATEGORY_DEBOUNCE = 400;
|
|
5
6
|
/* Default props */
|
|
6
7
|
export const TEMPLATE_ITEM_DEFAULT = {
|
|
7
8
|
removable: true,
|
|
@@ -63,7 +63,7 @@ export const TemplateListing = memo(props => {
|
|
|
63
63
|
setOpenPreviewModal(false);
|
|
64
64
|
};
|
|
65
65
|
return (React.createElement(TemplateListingWrapper, null,
|
|
66
|
-
React.createElement(CategoryListing, Object.assign({}, categoryListingProps)),
|
|
66
|
+
React.createElement(CategoryListing, Object.assign({}, categoryListingProps, { emptyProps: emptyProps })),
|
|
67
67
|
React.createElement(Spin, { spinning: loading, wrapperClassName: "template-listing__loading template-listing__loading--full" },
|
|
68
68
|
React.createElement("div", { className: "template-listing" },
|
|
69
69
|
React.createElement("div", { ref: containerRef, style: {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
// Components
|
|
4
4
|
import { Table } from '../../../../../../organism';
|
|
5
|
-
import { Typography
|
|
5
|
+
import { Typography } from '../../../../../../atoms';
|
|
6
6
|
// Constants
|
|
7
7
|
import { TABLE_API_COLUMNS } from '@antscorp/antsomi-ui/es/constants';
|
|
8
8
|
// Utils
|
|
@@ -12,32 +12,28 @@ export const BlankTemplatePropsTable = () => {
|
|
|
12
12
|
{
|
|
13
13
|
key: '1',
|
|
14
14
|
property: 'show',
|
|
15
|
-
description:
|
|
16
|
-
React.createElement(Typography.Text, null, "Handler show or hide Blank Template"))),
|
|
15
|
+
description: React.createElement(Typography.Text, null, "Handler show or hide Blank Template"),
|
|
17
16
|
type: React.createElement(CustomTag, { type: "normal" }, "boolean"),
|
|
18
17
|
default: React.createElement(CustomTag, { type: "default" }, "false"),
|
|
19
18
|
},
|
|
20
19
|
{
|
|
21
20
|
key: '2',
|
|
22
21
|
property: 'description',
|
|
23
|
-
description: (React.createElement(
|
|
24
|
-
React.createElement(Typography.Text, null, "The text that is displayed below the Add Button"))),
|
|
22
|
+
description: (React.createElement(Typography.Text, null, "The text that is displayed below the Add Button")),
|
|
25
23
|
type: React.createElement(CustomTag, { type: "normal" }, "string"),
|
|
26
24
|
default: React.createElement(CustomTag, { type: "default" }, "Blank Template"),
|
|
27
25
|
},
|
|
28
26
|
{
|
|
29
27
|
key: '3',
|
|
30
28
|
property: 'onClick',
|
|
31
|
-
description:
|
|
32
|
-
React.createElement(Typography.Text, null, "Callback onClick on Blank Template"))),
|
|
29
|
+
description: React.createElement(Typography.Text, null, "Callback onClick on Blank Template"),
|
|
33
30
|
type: React.createElement(CustomTag, { type: "normal" }, 'React.MouseEventHandler<HTMLElement>'),
|
|
34
31
|
default: React.createElement(CustomTag, { type: "default" }, " - "),
|
|
35
32
|
},
|
|
36
33
|
{
|
|
37
34
|
key: '4',
|
|
38
35
|
property: 'blankTemplateRender',
|
|
39
|
-
description:
|
|
40
|
-
React.createElement(Typography.Text, null, "Render Blank Template node for customizing"))),
|
|
36
|
+
description: React.createElement(Typography.Text, null, "Render Blank Template node for customizing"),
|
|
41
37
|
type: React.createElement(CustomTag, { type: "normal" }, '(node: ReactNode) => ReactNode'),
|
|
42
38
|
default: React.createElement(CustomTag, { type: "default" }, " - "),
|
|
43
39
|
},
|
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import LinkTo from '@storybook/addon-links/react';
|
|
4
4
|
// Components
|
|
5
5
|
import { Table } from '../../../../../../organism';
|
|
6
|
-
import { Typography
|
|
6
|
+
import { Typography } from '../../../../../../atoms';
|
|
7
7
|
// Constants
|
|
8
8
|
import { TABLE_API_COLUMNS } from '@antscorp/antsomi-ui/es/constants';
|
|
9
9
|
import { CATEGORY_LISTING_WITH } from '../../../../constants';
|
|
@@ -14,8 +14,7 @@ export const CategoryListingPropsTable = () => {
|
|
|
14
14
|
{
|
|
15
15
|
key: '1',
|
|
16
16
|
property: 'items',
|
|
17
|
-
description:
|
|
18
|
-
React.createElement(Typography.Text, null, "List of category items"))),
|
|
17
|
+
description: React.createElement(Typography.Text, null, "List of category items"),
|
|
19
18
|
type: (React.createElement(LinkTo, { story: "t-category-item" },
|
|
20
19
|
React.createElement(CustomTag, { type: "link" }, "TCategoryItem [ ]"))),
|
|
21
20
|
default: React.createElement(CustomTag, { type: "default" }, "[ ]"),
|
|
@@ -23,35 +22,45 @@ export const CategoryListingPropsTable = () => {
|
|
|
23
22
|
{
|
|
24
23
|
key: '2',
|
|
25
24
|
property: 'width',
|
|
26
|
-
description:
|
|
27
|
-
React.createElement(Typography.Text, null, "Width of category"))),
|
|
25
|
+
description: React.createElement(Typography.Text, null, "Width of category"),
|
|
28
26
|
type: React.createElement(CustomTag, { type: "normal" }, "number"),
|
|
29
27
|
default: React.createElement(CustomTag, { type: "default" }, CATEGORY_LISTING_WITH),
|
|
30
28
|
},
|
|
31
29
|
{
|
|
32
30
|
key: '3',
|
|
33
31
|
property: 'loading',
|
|
34
|
-
description:
|
|
35
|
-
React.createElement(Typography.Text, null, "Show loading category listing"))),
|
|
32
|
+
description: React.createElement(Typography.Text, null, "Show loading category listing"),
|
|
36
33
|
type: React.createElement(CustomTag, { type: "normal" }, "boolean"),
|
|
37
34
|
default: React.createElement(CustomTag, { type: "default" }, "false"),
|
|
38
35
|
},
|
|
39
36
|
{
|
|
40
37
|
key: '4',
|
|
41
38
|
property: 'show',
|
|
42
|
-
description:
|
|
43
|
-
React.createElement(Typography.Text, null, "Handler show or hide category"))),
|
|
39
|
+
description: React.createElement(Typography.Text, null, "Handler show or hide category"),
|
|
44
40
|
type: React.createElement(CustomTag, { type: "normal" }, "boolean"),
|
|
45
41
|
default: React.createElement(CustomTag, { type: "default" }, "true"),
|
|
46
42
|
},
|
|
47
43
|
{
|
|
48
44
|
key: '5',
|
|
49
45
|
property: 'checkedCategories',
|
|
50
|
-
description:
|
|
51
|
-
React.createElement(Typography.Text, null, "Record of checked categories"))),
|
|
46
|
+
description: React.createElement(Typography.Text, null, "Record of checked categories"),
|
|
52
47
|
type: React.createElement(CustomTag, { type: "link" }, "TCheckedCategories"),
|
|
53
48
|
default: React.createElement(CustomTag, { type: "default" }, '{ }'),
|
|
54
49
|
},
|
|
50
|
+
{
|
|
51
|
+
key: '6',
|
|
52
|
+
property: 'debounceChangeMenu',
|
|
53
|
+
description: React.createElement(Typography.Text, null, "Handle debounce onchange menu function"),
|
|
54
|
+
type: React.createElement(CustomTag, { type: "normal" }, "number"),
|
|
55
|
+
default: React.createElement(CustomTag, { type: "default" }, "500"),
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
key: '7',
|
|
59
|
+
property: 'onMenuChange',
|
|
60
|
+
description: React.createElement(Typography.Text, null, "Onchange menu function"),
|
|
61
|
+
type: React.createElement(CustomTag, { type: "normal" }, `(value: TCheckedCategories) => void`),
|
|
62
|
+
default: React.createElement(CustomTag, { type: "default" }, " - "),
|
|
63
|
+
},
|
|
55
64
|
];
|
|
56
65
|
return React.createElement(Table, { dataSource: dataSource, columns: TABLE_API_COLUMNS, pagination: false });
|
|
57
66
|
};
|
package/es/components/template/TemplateListing/stories/dataTypes/components/EmptyPropsTable/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
// Components
|
|
4
4
|
import { Table } from '../../../../../../organism';
|
|
5
|
-
import { Typography
|
|
5
|
+
import { Typography } from '../../../../../../atoms';
|
|
6
6
|
// Constants
|
|
7
7
|
import { TABLE_API_COLUMNS } from '@antscorp/antsomi-ui/es/constants';
|
|
8
8
|
// Utils
|
|
@@ -12,16 +12,14 @@ export const EmptyPropsTable = () => {
|
|
|
12
12
|
{
|
|
13
13
|
key: '1',
|
|
14
14
|
property: 'icon',
|
|
15
|
-
description:
|
|
16
|
-
React.createElement(Typography.Text, null, "Customize Empty icon"))),
|
|
15
|
+
description: React.createElement(Typography.Text, null, "Customize Empty icon"),
|
|
17
16
|
type: React.createElement(CustomTag, { type: "normal" }, "ReactNode"),
|
|
18
17
|
default: React.createElement(CustomTag, { type: "default" }, " - "),
|
|
19
18
|
},
|
|
20
19
|
{
|
|
21
20
|
key: '2',
|
|
22
21
|
property: 'description',
|
|
23
|
-
description:
|
|
24
|
-
React.createElement(Typography.Text, null, "The text that is displayed below the Icon"))),
|
|
22
|
+
description: React.createElement(Typography.Text, null, "The text that is displayed below the Icon"),
|
|
25
23
|
type: React.createElement(CustomTag, { type: "normal" }, "string"),
|
|
26
24
|
default: React.createElement(CustomTag, { type: "default" }, "No data"),
|
|
27
25
|
},
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
// Components
|
|
4
4
|
import { Table } from '../../../../../../organism';
|
|
5
|
-
import { Typography
|
|
5
|
+
import { Typography } from '../../../../../../atoms';
|
|
6
6
|
// Constants
|
|
7
7
|
import { TABLE_API_COLUMNS } from '@antscorp/antsomi-ui/es/constants';
|
|
8
8
|
// Utils
|
|
@@ -12,32 +12,28 @@ export const TCategoryItemTable = () => {
|
|
|
12
12
|
{
|
|
13
13
|
key: '1',
|
|
14
14
|
property: 'TCategoryItemId',
|
|
15
|
-
description:
|
|
16
|
-
React.createElement(Typography.Text, null, "Identification of Category Item"))),
|
|
15
|
+
description: React.createElement(Typography.Text, null, "Identification of Category Item"),
|
|
17
16
|
type: React.createElement(CustomTag, { type: "link" }, "TCategoryItemId"),
|
|
18
17
|
default: React.createElement(CustomTag, { type: "default" }, " - "),
|
|
19
18
|
},
|
|
20
19
|
{
|
|
21
20
|
key: '2',
|
|
22
21
|
property: 'label',
|
|
23
|
-
description:
|
|
24
|
-
React.createElement(Typography.Text, null, "Label of Category Item"))),
|
|
22
|
+
description: React.createElement(Typography.Text, null, "Label of Category Item"),
|
|
25
23
|
type: React.createElement(CustomTag, { type: "normal" }, "string"),
|
|
26
24
|
default: React.createElement(CustomTag, { type: "default" }, " - "),
|
|
27
25
|
},
|
|
28
26
|
{
|
|
29
27
|
key: '3',
|
|
30
28
|
property: 'total',
|
|
31
|
-
description:
|
|
32
|
-
React.createElement(Typography.Text, null, "Total child categories of it"))),
|
|
29
|
+
description: React.createElement(Typography.Text, null, "Total child categories of it"),
|
|
33
30
|
type: React.createElement(CustomTag, { type: "normal" }, "number"),
|
|
34
31
|
default: React.createElement(CustomTag, { type: "default" }, " - "),
|
|
35
32
|
},
|
|
36
33
|
{
|
|
37
34
|
key: '4',
|
|
38
35
|
property: 'children',
|
|
39
|
-
description:
|
|
40
|
-
React.createElement(Typography.Text, null, "Its children categories"))),
|
|
36
|
+
description: React.createElement(Typography.Text, null, "Its children categories"),
|
|
41
37
|
type: React.createElement(CustomTag, { type: "link" }, "TCategoryItem [ ]"),
|
|
42
38
|
default: React.createElement(CustomTag, { type: "default" }, " [ ] "),
|
|
43
39
|
},
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
// Components
|
|
4
4
|
import { Table } from '../../../../../../organism';
|
|
5
|
-
import { Typography
|
|
5
|
+
import { Typography } from '../../../../../../atoms';
|
|
6
6
|
// Constants
|
|
7
7
|
import { TABLE_API_COLUMNS } from '@antscorp/antsomi-ui/es/constants';
|
|
8
8
|
// Utils
|
|
@@ -12,24 +12,21 @@ export const TTemplateItemTable = () => {
|
|
|
12
12
|
{
|
|
13
13
|
key: '1',
|
|
14
14
|
property: 'id',
|
|
15
|
-
description:
|
|
16
|
-
React.createElement(Typography.Text, null, "Identification of Template Item"))),
|
|
15
|
+
description: React.createElement(Typography.Text, null, "Identification of Template Item"),
|
|
17
16
|
type: React.createElement(CustomTag, { type: "link" }, "TThumbnailCardId"),
|
|
18
17
|
default: React.createElement(CustomTag, { type: "default" }, " - "),
|
|
19
18
|
},
|
|
20
19
|
{
|
|
21
20
|
key: '2',
|
|
22
21
|
property: 'name',
|
|
23
|
-
description:
|
|
24
|
-
React.createElement(Typography.Text, null, "Name of Template Item"))),
|
|
22
|
+
description: React.createElement(Typography.Text, null, "Name of Template Item"),
|
|
25
23
|
type: React.createElement(CustomTag, { type: "normal" }, "string"),
|
|
26
24
|
default: React.createElement(CustomTag, { type: "default" }, " - "),
|
|
27
25
|
},
|
|
28
26
|
{
|
|
29
27
|
key: '3',
|
|
30
28
|
property: 'thumbnail',
|
|
31
|
-
description:
|
|
32
|
-
React.createElement(Typography.Text, null, "Thumbnail image of Template Item"))),
|
|
29
|
+
description: React.createElement(Typography.Text, null, "Thumbnail image of Template Item"),
|
|
33
30
|
type: React.createElement(CustomTag, { type: "normal" }, "string"),
|
|
34
31
|
default: React.createElement(CustomTag, { type: "default" }, " - "),
|
|
35
32
|
},
|
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import LinkTo from '@storybook/addon-links/react';
|
|
4
4
|
// Components
|
|
5
5
|
import { Table } from '../../../../../../organism';
|
|
6
|
-
import { Tag, Typography
|
|
6
|
+
import { Tag, Typography } from '../../../../../../atoms';
|
|
7
7
|
// Constants
|
|
8
8
|
import { TABLE_API_COLUMNS } from '@antscorp/antsomi-ui/es/constants';
|
|
9
9
|
import { LISTING_GAP_DEFAULT } from '../../../../constants';
|
|
@@ -14,8 +14,7 @@ export const TemplatesPropsTable = () => {
|
|
|
14
14
|
{
|
|
15
15
|
key: '1',
|
|
16
16
|
property: 'items',
|
|
17
|
-
description:
|
|
18
|
-
React.createElement(Typography.Text, null, "List of templates"))),
|
|
17
|
+
description: React.createElement(Typography.Text, null, "List of templates"),
|
|
19
18
|
type: (React.createElement(LinkTo, { story: "t-template-item" },
|
|
20
19
|
React.createElement(CustomTag, { type: "link" }, "( TTemplateItem & T) [ ]"))),
|
|
21
20
|
default: React.createElement(Tag, { bordered: false }, "[ ]"),
|
|
@@ -23,15 +22,14 @@ export const TemplatesPropsTable = () => {
|
|
|
23
22
|
{
|
|
24
23
|
key: '2',
|
|
25
24
|
property: 'loading',
|
|
26
|
-
description:
|
|
27
|
-
React.createElement(Typography.Text, null, "Show loading template listing"))),
|
|
25
|
+
description: React.createElement(Typography.Text, null, "Show loading template listing"),
|
|
28
26
|
type: React.createElement(CustomTag, { type: "normal" }, "boolean"),
|
|
29
27
|
default: React.createElement(CustomTag, { type: "default" }, "false"),
|
|
30
28
|
},
|
|
31
29
|
{
|
|
32
30
|
key: '3',
|
|
33
31
|
property: 'gap',
|
|
34
|
-
description: (React.createElement(
|
|
32
|
+
description: (React.createElement(React.Fragment, null,
|
|
35
33
|
React.createElement(Typography.Text, null, "Spacing between template items"),
|
|
36
34
|
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
35
|
type: React.createElement(CustomTag, { type: "normal" }, "number"),
|
|
@@ -40,8 +38,7 @@ export const TemplatesPropsTable = () => {
|
|
|
40
38
|
{
|
|
41
39
|
key: '4',
|
|
42
40
|
property: 'onLoadMoreTemplates',
|
|
43
|
-
description: (React.createElement(
|
|
44
|
-
React.createElement(Typography.Text, null, "Handles loading additional data based on lazy loading mechanism"))),
|
|
41
|
+
description: (React.createElement(Typography.Text, null, "Handles loading additional data based on lazy loading mechanism")),
|
|
45
42
|
type: React.createElement(CustomTag, { type: "normal" }, '( ) => void'),
|
|
46
43
|
default: React.createElement(CustomTag, { type: "default" }, '( ) => { }'),
|
|
47
44
|
},
|