@giteeteam/apps-team-components 1.0.25 → 1.0.26
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.
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { HTMLAttributes } from 'react';
|
|
2
|
+
export interface IPriceTagProps {
|
|
3
|
+
text: React.ReactNode;
|
|
4
|
+
className?: HTMLAttributes<HTMLSpanElement>['className'];
|
|
5
|
+
edition: 'ee' | 'ce' | 'demo';
|
|
6
|
+
expired?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const containerStyle = "\n display: inline-flex;\n justify-content: center;\n align-items: center;\n";
|
|
9
|
+
export declare const textStyle = "\n flex: 1;\n width: 0;\n";
|
|
10
|
+
export declare const tagStyle = "\n height: 18px;\n padding: 0 4px;\n margin-left: 8px;\n font-size: 12px;\n font-weight: 500;\n line-height: 18px;\n color: #fff;\n background: linear-gradient(230deg, #66dbff 0%, #3683ff 100%);\n border-radius: 5px 0;\n";
|
|
11
|
+
export declare const PriceTag: React.FC<IPriceTagProps>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { ClassNames } from '@emotion/react';
|
|
4
|
+
import { i18n } from '../../lib/i18n';
|
|
5
|
+
import SimpleOverflowToolTip from './overflow-tooltip/SimpleOverflowToolTip';
|
|
6
|
+
export const containerStyle = `
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
align-items: center;
|
|
10
|
+
`;
|
|
11
|
+
export const textStyle = `
|
|
12
|
+
flex: 1;
|
|
13
|
+
width: 0;
|
|
14
|
+
`;
|
|
15
|
+
export const tagStyle = `
|
|
16
|
+
height: 18px;
|
|
17
|
+
padding: 0 4px;
|
|
18
|
+
margin-left: 8px;
|
|
19
|
+
font-size: 12px;
|
|
20
|
+
font-weight: 500;
|
|
21
|
+
line-height: 18px;
|
|
22
|
+
color: #fff;
|
|
23
|
+
background: linear-gradient(230deg, #66dbff 0%, #3683ff 100%);
|
|
24
|
+
border-radius: 5px 0;
|
|
25
|
+
`;
|
|
26
|
+
export const PriceTag = ({ text, className, edition, expired }) => {
|
|
27
|
+
const isTagVisible = useMemo(() => {
|
|
28
|
+
if (edition === 'ee') {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
if (edition === 'demo') {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
return expired;
|
|
35
|
+
}, [edition, expired]);
|
|
36
|
+
return isTagVisible ? (_jsx(ClassNames, { children: ({ cx, css }) => (_jsxs("span", { className: cx(css(containerStyle), className), children: [_jsx(SimpleOverflowToolTip, { title: typeof text === 'string' ? text : null, children: _jsx("span", { className: css(textStyle), children: text }) }), _jsx("span", { className: css(tagStyle), children: i18n.t('components.priceTag.pro') })] })) })) : (text);
|
|
37
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { default as EmptyField } from './components/common/EmptyField';
|
|
2
2
|
export { default as BaseOverflowTooltip } from './components/common/overflow-tooltip/BaseOverflowTooltip';
|
|
3
3
|
export { default as SimpleOverflowToolTip } from './components/common/overflow-tooltip/SimpleOverflowToolTip';
|
|
4
|
+
export { PriceTag } from './components/common/PriceTag';
|
|
4
5
|
export { default as UserAvatar } from './components/common/user-field/UserAvatar';
|
|
5
6
|
export { default as ActorsReadView } from './components/fields/actors/ReadView';
|
|
6
7
|
export { default as AncestorReadView } from './components/fields/ancestor/ReadView';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { default as EmptyField } from './components/common/EmptyField';
|
|
2
2
|
export { default as BaseOverflowTooltip } from './components/common/overflow-tooltip/BaseOverflowTooltip';
|
|
3
3
|
export { default as SimpleOverflowToolTip } from './components/common/overflow-tooltip/SimpleOverflowToolTip';
|
|
4
|
+
export { PriceTag } from './components/common/PriceTag';
|
|
4
5
|
export { default as UserAvatar } from './components/common/user-field/UserAvatar';
|
|
5
6
|
export { default as ActorsReadView } from './components/fields/actors/ReadView';
|
|
6
7
|
export { default as AncestorReadView } from './components/fields/ancestor/ReadView';
|
package/dist/locales/index.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ export declare const en: {
|
|
|
43
43
|
'libs.default.flowTextTip.0': string;
|
|
44
44
|
'libs.default.flowTextTip.1': string;
|
|
45
45
|
'pages.fields.view.noPriority': string;
|
|
46
|
+
'components.priceTag.pro': string;
|
|
46
47
|
};
|
|
47
48
|
export declare const zh: {
|
|
48
49
|
'pages.users.default.delete': string;
|
|
@@ -89,6 +90,7 @@ export declare const zh: {
|
|
|
89
90
|
'libs.default.flowTextTip.0': string;
|
|
90
91
|
'libs.default.flowTextTip.1': string;
|
|
91
92
|
'pages.fields.view.noPriority': string;
|
|
93
|
+
'components.priceTag.pro': string;
|
|
92
94
|
};
|
|
93
95
|
export declare const ru: {
|
|
94
96
|
'pages.users.default.delete': string;
|
|
@@ -135,4 +137,5 @@ export declare const ru: {
|
|
|
135
137
|
'libs.default.flowTextTip.0': string;
|
|
136
138
|
'libs.default.flowTextTip.1': string;
|
|
137
139
|
'pages.fields.view.noPriority': string;
|
|
140
|
+
'components.priceTag.pro': string;
|
|
138
141
|
};
|
package/dist/locales/index.js
CHANGED
|
@@ -43,6 +43,7 @@ export const en = {
|
|
|
43
43
|
'libs.default.flowTextTip.0': 'The issue field [{{field}}] should be [{{condition}}] specified field [{{target}}]',
|
|
44
44
|
'libs.default.flowTextTip.1': 'The issue field [{{field}}] should be [{{condition}}]',
|
|
45
45
|
'pages.fields.view.noPriority': 'No priority',
|
|
46
|
+
'components.priceTag.pro': 'Pro',
|
|
46
47
|
};
|
|
47
48
|
export const zh = {
|
|
48
49
|
'pages.users.default.delete': '(已删除)',
|
|
@@ -89,6 +90,7 @@ export const zh = {
|
|
|
89
90
|
'libs.default.flowTextTip.0': '当前事项字段[{{field}}]应该[{{condition}}]指定条件值[{{target}}]',
|
|
90
91
|
'libs.default.flowTextTip.1': '当前事项字段[{{field}}]应该[{{condition}}]',
|
|
91
92
|
'pages.fields.view.noPriority': '无优先级',
|
|
93
|
+
'components.priceTag.pro': '高级',
|
|
92
94
|
};
|
|
93
95
|
export const ru = {
|
|
94
96
|
'pages.users.default.delete': '(удалено)',
|
|
@@ -135,4 +137,5 @@ export const ru = {
|
|
|
135
137
|
'libs.default.flowTextTip.0': `Поле задачи "{{field}}" должно при условии "{{condition}}" указывать значение условия "{{target}}"`,
|
|
136
138
|
'libs.default.flowTextTip.1': `Поле задачи "{{field}}" должно при условии "{{condition}}"`,
|
|
137
139
|
'pages.fields.view.noPriority': 'Нет приоритета',
|
|
140
|
+
'components.priceTag.pro': 'Pro',
|
|
138
141
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@giteeteam/apps-team-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.26",
|
|
4
4
|
"description": "Gitee team components",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -66,4 +66,4 @@
|
|
|
66
66
|
"debug": "^4.3.4",
|
|
67
67
|
"lodash-es": "^4.17.21"
|
|
68
68
|
}
|
|
69
|
-
}
|
|
69
|
+
}
|