@antscorp/antsomi-ui 1.3.5-beta.635 → 1.3.5-beta.637
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/atoms/Tag/Tag.d.ts +2 -1
- package/es/components/atoms/Tag/Tag.js +17 -4
- package/es/components/icons/CloseIcon.js +3 -4
- package/es/components/molecules/Select/styled.d.ts +1 -1
- package/es/components/organism/LeftMenu/components/common/ChildMenu/index.js +4 -1
- package/es/components/organism/LeftMenu/utils/index.js +7 -2
- package/es/providers/ConfigProvider/GlobalStyle.js +3 -1
- package/package.json +1 -1
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { TagType } from 'antd/lib';
|
|
2
|
+
export declare const Tag: TagType;
|
|
@@ -1,3 +1,14 @@
|
|
|
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
|
+
};
|
|
1
12
|
// Libraries
|
|
2
13
|
import React from 'react';
|
|
3
14
|
import { Tag as AntdTag } from 'antd';
|
|
@@ -6,7 +17,6 @@ import styled from 'styled-components';
|
|
|
6
17
|
import { CloseIcon } from '../../icons';
|
|
7
18
|
// Constants
|
|
8
19
|
import { globalToken } from '@antscorp/antsomi-ui/es/constants';
|
|
9
|
-
export const Tag = AntdTag;
|
|
10
20
|
const CloseBtn = styled.div `
|
|
11
21
|
display: flex;
|
|
12
22
|
align-items: center;
|
|
@@ -16,7 +26,10 @@ const CloseBtn = styled.div `
|
|
|
16
26
|
background-color: #fff;
|
|
17
27
|
border-radius: 100%;
|
|
18
28
|
`;
|
|
19
|
-
|
|
20
|
-
closeIcon
|
|
21
|
-
React.createElement(CloseIcon, { size: 14, color: globalToken === null || globalToken === void 0 ? void 0 : globalToken.colorPrimary }))),
|
|
29
|
+
const OriginTag = props => {
|
|
30
|
+
const { closable = false, closeIcon = (React.createElement(CloseBtn, null,
|
|
31
|
+
React.createElement(CloseIcon, { size: 14, color: globalToken === null || globalToken === void 0 ? void 0 : globalToken.colorPrimary }))) } = props, restOfProps = __rest(props, ["closable", "closeIcon"]);
|
|
32
|
+
return React.createElement(AntdTag, Object.assign({}, restOfProps, { closable: closable, closeIcon: closable ? closeIcon : null }));
|
|
22
33
|
};
|
|
34
|
+
export const Tag = OriginTag;
|
|
35
|
+
Tag.CheckableTag = AntdTag.CheckableTag;
|
|
@@ -2,8 +2,7 @@ import React, { forwardRef } from 'react';
|
|
|
2
2
|
import { useIcon } from './hooks/useIcon';
|
|
3
3
|
export const CloseIcon = forwardRef((props, ref) => {
|
|
4
4
|
const { width, height } = useIcon(props);
|
|
5
|
-
return (React.createElement("svg", Object.assign({
|
|
6
|
-
React.createElement("
|
|
7
|
-
React.createElement("
|
|
8
|
-
React.createElement("path", { d: "M 18.984375,6.421875 13.40625,12 l 5.578125,5.578125 -1.40625,1.40625 L 12,13.40625 6.421875,18.984375 5.015625,17.578125 10.59375,12 5.015625,6.421875 6.421875,5.015625 12,10.59375 17.578125,5.015625 Z", id: "path826" }))));
|
|
5
|
+
return (React.createElement("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor" }, props, { ref: ref, width: width, height: height }),
|
|
6
|
+
React.createElement("path", { d: "M0 0h24v24H0V0z", fill: "none" }),
|
|
7
|
+
React.createElement("path", { d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z" })));
|
|
9
8
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const StyledTag: import("styled-components").StyledComponent<import("antd").TagType, any, {}, never>;
|
|
1
|
+
export declare const StyledTag: import("styled-components").StyledComponent<import("antd/lib").TagType, any, {}, never>;
|
|
2
2
|
export declare const TagCloseBtn: import("styled-components").StyledComponent<"div", any, {
|
|
3
3
|
borderColor?: string | undefined;
|
|
4
4
|
}, never>;
|
|
@@ -184,7 +184,10 @@ export const ChildMenu = memo(props => {
|
|
|
184
184
|
},
|
|
185
185
|
style: styles.dropdownMenu,
|
|
186
186
|
}, trigger: ['click'] },
|
|
187
|
-
React.createElement(Icon, { className: "child-menu-item-icon", type: "icon-ants-three-dot-vertical", style: styles.dotIcon
|
|
187
|
+
React.createElement(Icon, { className: "child-menu-item-icon", type: "icon-ants-three-dot-vertical", style: styles.dotIcon, onClick: e => {
|
|
188
|
+
e.stopPropagation();
|
|
189
|
+
e.preventDefault();
|
|
190
|
+
} })))),
|
|
188
191
|
!(children === null || children === void 0 ? void 0 : children.length) && type === 'recommendation' && !!menu_item_path && (React.createElement("div", { className: "icon-link", onClick: () => {
|
|
189
192
|
navigatePath(menu_item_domain, menu_item_path, true);
|
|
190
193
|
} },
|
|
@@ -26,6 +26,7 @@ import { USER_PERMISSIONS } from '@antscorp/antsomi-ui/es/constants';
|
|
|
26
26
|
import { handleError } from '@antscorp/antsomi-ui/es/utils';
|
|
27
27
|
// Styled
|
|
28
28
|
import { IconWrapper } from '../styled';
|
|
29
|
+
import { PUBLIC_ROLE } from '../../../molecules/ShareAccess/constants';
|
|
29
30
|
const PATH = 'src/components/organism/LeftMenu/utils/index.ts';
|
|
30
31
|
/**
|
|
31
32
|
* Converts a feature menu item to a menu item suitable for rendering in the UI.
|
|
@@ -229,8 +230,12 @@ export const getMappingAppChildren = (args) => {
|
|
|
229
230
|
default: {
|
|
230
231
|
if (isEmpty(shareAccess))
|
|
231
232
|
return true;
|
|
232
|
-
const
|
|
233
|
-
|
|
233
|
+
const { is_public, public_role } = shareAccess || {};
|
|
234
|
+
// Check view public before list access
|
|
235
|
+
if (!!is_public && public_role === PUBLIC_ROLE.ONLY_EDITOR) {
|
|
236
|
+
return true;
|
|
237
|
+
}
|
|
238
|
+
return Boolean(Number(((_c = (_b = shareAccess === null || shareAccess === void 0 ? void 0 : shareAccess.list_access) === null || _b === void 0 ? void 0 : _b.find(item => item.user_id === (auth === null || auth === void 0 ? void 0 : auth.userId))) === null || _c === void 0 ? void 0 : _c.allow_edit) || '0'));
|
|
234
239
|
}
|
|
235
240
|
}
|
|
236
241
|
})();
|
|
@@ -9,7 +9,7 @@ import { fas } from '@fortawesome/free-solid-svg-icons';
|
|
|
9
9
|
import { far } from '@fortawesome/free-regular-svg-icons';
|
|
10
10
|
import { fab } from '@fortawesome/free-brands-svg-icons';
|
|
11
11
|
library.add(fas, far, fab);
|
|
12
|
-
const {
|
|
12
|
+
const { accent7, gray5, scrollBarSize, bw3, bw4, bw5 } = THEME.token || {};
|
|
13
13
|
export const GlobalStyle = () => {
|
|
14
14
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41;
|
|
15
15
|
return (React.createElement(Global, { styles: css `
|
|
@@ -1083,6 +1083,8 @@ export const GlobalStyle = () => {
|
|
|
1083
1083
|
display: flex !important;
|
|
1084
1084
|
line-height: 1;
|
|
1085
1085
|
min-height: 24px;
|
|
1086
|
+
overflow: hidden;
|
|
1087
|
+
text-overflow: ellipsis;
|
|
1086
1088
|
|
|
1087
1089
|
.antsomi-tag-close-icon {
|
|
1088
1090
|
position: absolute;
|