@antscorp/antsomi-ui 1.3.5-beta.150 → 1.3.5-beta.151
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/common/ConfigProvider/GlobalStyle.js +13 -0
- package/es/components/molecules/TemplateSaveAs/components/Category/Category.js +14 -4
- package/es/components/organism/PreviewTemplateModal/components/SimilarTemplate/index.js +3 -6
- package/es/components/template/TemplateListing/styled/index.js +0 -1
- package/package.json +1 -1
|
@@ -108,6 +108,19 @@ export const GlobalStyle = () => {
|
|
|
108
108
|
background-color: ${(_l = THEME.token) === null || _l === void 0 ? void 0 : _l.bw2} !important;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
+
// NOTE: Just hot fix for easy looking
|
|
112
|
+
.antsomi-btn-primary.antsomi-btn-compact-item.antsomi-btn-compact-first-item {
|
|
113
|
+
padding-right: 4px !important;
|
|
114
|
+
}
|
|
115
|
+
.antsomi-btn-compact-item.antsomi-btn-primary.antsomi-btn-compact-last-item {
|
|
116
|
+
width: fit-content;
|
|
117
|
+
padding: 0px !important;
|
|
118
|
+
padding-right: 4px !important;
|
|
119
|
+
&::before {
|
|
120
|
+
width: 0px !important;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
111
124
|
/* Input */
|
|
112
125
|
.antsomi-input,
|
|
113
126
|
.antsomi-input-affix-wrapper {
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
2
3
|
import { Tooltip, Button, Flex, Typography, Dropdown } from '@antscorp/antsomi-ui/es/components';
|
|
3
4
|
import Icon from '@antscorp/icons';
|
|
4
5
|
const { Text } = Typography;
|
|
6
|
+
/* Styled Components */
|
|
7
|
+
const DropdownMenuContent = styled.div `
|
|
8
|
+
> ul {
|
|
9
|
+
max-height: 400px;
|
|
10
|
+
overflow: auto;
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
5
13
|
export const Category = props => {
|
|
6
14
|
const { categoryKey, categoryChildren, label, selected, onRemoveCategory, onAddCategory } = props;
|
|
7
15
|
const remainChildren = categoryChildren.filter(item => !(selected === null || selected === void 0 ? void 0 : selected.includes(item.key)));
|
|
@@ -21,10 +29,12 @@ export const Category = props => {
|
|
|
21
29
|
label.toLowerCase())) : (label)) : (React.createElement(Dropdown, { menu: {
|
|
22
30
|
items: remainChildren,
|
|
23
31
|
onClick: ({ key }) => onAddCategory({ parentKey: categoryKey, childKey: key }),
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
32
|
+
},
|
|
33
|
+
// overlayStyle={{
|
|
34
|
+
// maxHeight: 400,
|
|
35
|
+
// overflow: 'auto',
|
|
36
|
+
// }}
|
|
37
|
+
getPopupContainer: triggerNode => triggerNode.parentElement, trigger: ['click'], dropdownRender: node => React.createElement(DropdownMenuContent, null, node) }, typeof label === 'string' ? (React.createElement(Button, { disabled: true },
|
|
28
38
|
"+ Add ", label === null || label === void 0 ? void 0 :
|
|
29
39
|
label.toLowerCase())) : (label))))));
|
|
30
40
|
};
|
|
@@ -14,8 +14,6 @@ import React, { memo } from 'react';
|
|
|
14
14
|
import { isEmpty } from 'lodash';
|
|
15
15
|
// Components
|
|
16
16
|
import { ThumbnailCard } from '../../../../molecules';
|
|
17
|
-
import { Empty } from '../../../../template/TemplateListing/components/Empty';
|
|
18
|
-
import { Flex } from '../../../../atoms';
|
|
19
17
|
// Styled
|
|
20
18
|
import { SimilarTemplateWrapper, TemplateListWrapper } from './styled';
|
|
21
19
|
// Constants
|
|
@@ -25,11 +23,10 @@ export const SimilarTemplate = memo(props => {
|
|
|
25
23
|
var _a;
|
|
26
24
|
const { show = true, similarTemplates = [], similarCardProps } = props;
|
|
27
25
|
const _b = similarCardProps || {}, { width = SIMILAR_CARD_WIDTH_DEFAULT, height = SIMILAR_CARD_HEIGHT_DEFAULT } = _b, restOfSimilarCardProps = __rest(_b, ["width", "height"]);
|
|
28
|
-
return show ? (React.createElement(SimilarTemplateWrapper, { gap: 15, vertical: true },
|
|
26
|
+
return show && !isEmpty(similarTemplates) ? (React.createElement(SimilarTemplateWrapper, { gap: 15, vertical: true },
|
|
29
27
|
React.createElement("div", { className: "title" }, "Similar templates"),
|
|
30
|
-
|
|
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((item, idx) => {
|
|
28
|
+
React.createElement(TemplateListWrapper, { templateQuantity: MAX_QUANTITY_TEMPLATES }, (_a = similarTemplates.slice(0, MAX_QUANTITY_TEMPLATES)) === null || _a === void 0 ? void 0 : _a.map((item, idx) => {
|
|
32
29
|
const { id, name, thumbnail } = item || {};
|
|
33
30
|
return (React.createElement(ThumbnailCard, Object.assign({ key: id, id: id || idx, name: name, width: width, height: height, thumbnail: thumbnail, actionAvailable: false }, restOfSimilarCardProps)));
|
|
34
|
-
}))))
|
|
31
|
+
})))) : null;
|
|
35
32
|
});
|