@giteeteam/apps-team-components 1.0.16 → 1.0.18
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/dist/components/fields/ancestor/ReadView.js +2 -2
- package/dist/components/fields/ancestor/utils.js +3 -1
- package/dist/components/fields/status/style/index.d.ts +2 -2
- package/dist/components/fields/status/style/index.js +2 -0
- package/dist/components/table-components/index.js +2 -4
- package/dist/lib/contexts/antdConfig.js +5 -3
- package/dist/locales/index.d.ts +21 -3
- package/dist/locales/index.js +21 -3
- package/package.json +2 -2
|
@@ -3,9 +3,9 @@ import EmptyField from '../../common/EmptyField';
|
|
|
3
3
|
import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip';
|
|
4
4
|
import { formatDisplayValue } from './utils';
|
|
5
5
|
const AncestorReadView = props => {
|
|
6
|
-
const { value } = props;
|
|
6
|
+
const { value, readonly } = props;
|
|
7
7
|
const displayValue = formatDisplayValue(value);
|
|
8
|
-
return (_jsx(_Fragment, { children:
|
|
8
|
+
return (_jsx(_Fragment, { children: displayValue ? (_jsx(BaseOverflowTooltip, { title: displayValue, children: displayValue })) : (_jsx(EmptyField, { readonly: readonly })) }));
|
|
9
9
|
};
|
|
10
10
|
AncestorReadView.displayName = 'AncestorReadView';
|
|
11
11
|
export default AncestorReadView;
|
|
@@ -2,8 +2,10 @@ import debug from 'debug';
|
|
|
2
2
|
const logger = debug('fields:ancestor:utils');
|
|
3
3
|
export const formatDisplayValue = (value) => {
|
|
4
4
|
logger('formatDisplayValue', value);
|
|
5
|
+
if (!value)
|
|
6
|
+
return undefined;
|
|
5
7
|
if (Array.isArray(value)) {
|
|
6
|
-
return value[value.length - 1];
|
|
8
|
+
return formatDisplayValue(value[value.length - 1]);
|
|
7
9
|
}
|
|
8
10
|
if (typeof value === 'object') {
|
|
9
11
|
return value.name;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export declare const readViewWrapper = "\n display: -webkit-box;\n align-items: center;\n justify-content: center;\n min-width: 62px;\n height: 22px;\n padding: 0 8px;\n font-size: 12px;\n font-weight: 600;\n line-height: 22px;\n text-align: center;\n border-radius: 4px;\n";
|
|
2
2
|
export declare const workflowContentStyle = "\n max-width: 200px;\n text-align: left;\n";
|
|
3
3
|
export declare const statePopoverStyle: (antPrefix: string) => string;
|
|
4
|
-
export declare const flowNextStyle = "\n max-height: 260px;\n padding-top: 10px;\n overflow: auto;\n";
|
|
4
|
+
export declare const flowNextStyle = "\n max-height: 260px;\n padding-top: 10px;\n overflow: auto;\n margin: -12px;\n";
|
|
5
5
|
export declare const flowStateStyle = "\n min-width: 62px;\n height: 24px;\n padding: 0 18px 0 8px;\n font-size: 12px;\n font-weight: 600;\n line-height: 24px;\n color: #fff;\n text-align: center;\n background: #cdcdcd;\n border-radius: 4px;\n box-shadow: none !important;\n\n span {\n text-decoration: none !important;\n }\n";
|
|
6
6
|
export declare const flowStateInWorkflowStyle = "\n :not(.add-weights) {\n min-width: 62px;\n height: 22px;\n padding: 0 8px;\n font-size: 12px;\n font-weight: 600;\n line-height: 22px;\n color: #fff;\n text-align: center;\n background: #cdcdcd;\n border-radius: 4px;\n\n display: flex;\n align-items: center;\n justify-content: center;\n }\n";
|
|
7
7
|
export declare const flowStateButtonStyle = "\n &:not(.add-weights) > span {\n display: -webkit-box;\n }\n";
|
|
8
8
|
export declare const stateBtnStyle = "\n height: 22px;\n line-height: 22px;\n";
|
|
9
9
|
export declare const noStateStyle = "\n color: #909aaa;\n background: #F1F2F4;\n";
|
|
10
10
|
export declare const caretDownStyle = "\n padding-left: 2px;\n margin-left: 0;\n line-height: 10px;\n";
|
|
11
|
-
export declare const statusViewGlobalStyle = "\n.field-layout.status-view {\n position: relative;\n padding: 10px;\n margin-top: 10px;\n font-size: 12px;\n cursor: pointer;\n border-top: 1px solid #ddd;\n}\n\n.field-layout.status-view .status-view-watch {\n width: 12px;\n height: 12px;\n margin-right: 5px;\n font-size: 12px;\n vertical-align: middle;\n}\n";
|
|
11
|
+
export declare const statusViewGlobalStyle = "\n.field-layout.status-view {\n position: relative;\n padding: 10px;\n margin: -12px;\n margin-top: 10px;\n font-size: 12px;\n cursor: pointer;\n border-top: 1px solid #ddd;\n}\n\n.field-layout.status-view .status-view-watch {\n width: 12px;\n height: 12px;\n margin-right: 5px;\n font-size: 12px;\n vertical-align: middle;\n}\n";
|
|
12
12
|
export declare const tipLineStyle = "\n margin-bottom: 0;\n";
|
|
13
13
|
export declare const tooltipStyle = "\n width: 80px;\n";
|
|
14
14
|
export declare const iconStyle = "\n padding: 0 6px;\n color: #848C9F;\n";
|
|
@@ -33,6 +33,7 @@ export const flowNextStyle = `
|
|
|
33
33
|
max-height: 260px;
|
|
34
34
|
padding-top: 10px;
|
|
35
35
|
overflow: auto;
|
|
36
|
+
margin: -12px;
|
|
36
37
|
`;
|
|
37
38
|
export const flowStateStyle = `
|
|
38
39
|
min-width: ${statusCellMinWidth};
|
|
@@ -91,6 +92,7 @@ export const statusViewGlobalStyle = `
|
|
|
91
92
|
.field-layout.status-view {
|
|
92
93
|
position: relative;
|
|
93
94
|
padding: 10px;
|
|
95
|
+
margin: -12px;
|
|
94
96
|
margin-top: 10px;
|
|
95
97
|
font-size: 12px;
|
|
96
98
|
cursor: pointer;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { useCallback, useRef, useState } from 'react';
|
|
3
|
-
import { css, Global } from '@emotion/react';
|
|
4
3
|
import { isEmpty } from 'lodash-es';
|
|
5
4
|
import EmptyField from '../common/EmptyField';
|
|
6
5
|
import EditTableCell from './EditTableCell';
|
|
7
|
-
import { fieldCellGlobalStyle } from './style';
|
|
8
6
|
const reduceObjArr = ({ arr, keys }) => {
|
|
9
7
|
return arr.reduce((accumulatorStr, nextObj) => {
|
|
10
8
|
const nextValue = keys.length > 1 ? `${nextObj[keys[0]]}(${nextObj[keys[1]]})` : nextObj[keys[0]];
|
|
@@ -63,5 +61,5 @@ const BaseTableCell = ({ className, cellData, column, rowData, readComponents =
|
|
|
63
61
|
return _jsx("div", { className: cls, children: text });
|
|
64
62
|
};
|
|
65
63
|
export const TableCell = props => {
|
|
66
|
-
return (
|
|
64
|
+
return (_jsx(_Fragment, { children: _jsx(BaseTableCell, { ...props }) }));
|
|
67
65
|
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { createContext } from 'react';
|
|
3
|
+
import { css, Global } from '@emotion/react';
|
|
4
|
+
import { fieldCellGlobalStyle } from '../../components/table-components/style';
|
|
3
5
|
const defaultContext = {};
|
|
4
6
|
const defaultAntPrefix = 'ant';
|
|
5
7
|
export const AntdConfigContext = createContext(defaultContext);
|
|
6
8
|
export const AntdConfigProvider = ({ getPopupContainer, antPrefix = defaultAntPrefix, children, }) => {
|
|
7
|
-
return (
|
|
9
|
+
return (_jsxs(AntdConfigContext.Provider, { value: {
|
|
8
10
|
getPopupContainer,
|
|
9
11
|
antPrefix,
|
|
10
|
-
}, children: children }));
|
|
12
|
+
}, children: [_jsx(Global, { styles: css(fieldCellGlobalStyle) }), children] }));
|
|
11
13
|
};
|
package/dist/locales/index.d.ts
CHANGED
|
@@ -3,7 +3,13 @@ export declare const en: {
|
|
|
3
3
|
'pages.users.default.forbidden': string;
|
|
4
4
|
'views.common.emptyField.user': string;
|
|
5
5
|
'views.common.emptyField.null': string;
|
|
6
|
-
'
|
|
6
|
+
'date.format.week': string;
|
|
7
|
+
'date.invalidate': string;
|
|
8
|
+
'date.dateTime': string;
|
|
9
|
+
'date.date': string;
|
|
10
|
+
'date.week': string;
|
|
11
|
+
'date.month': string;
|
|
12
|
+
'date.year': string;
|
|
7
13
|
'pages.fields.default.toWorkspacePage': string;
|
|
8
14
|
'pages.fields.view.noWorkflowOrAuth': string;
|
|
9
15
|
'pages.fields.view.viewWorkflow': string;
|
|
@@ -43,7 +49,13 @@ export declare const zh: {
|
|
|
43
49
|
'pages.users.default.forbidden': string;
|
|
44
50
|
'views.common.emptyField.user': string;
|
|
45
51
|
'views.common.emptyField.null': string;
|
|
46
|
-
'
|
|
52
|
+
'date.format.week': string;
|
|
53
|
+
'date.invalidate': string;
|
|
54
|
+
'date.dateTime': string;
|
|
55
|
+
'date.date': string;
|
|
56
|
+
'date.week': string;
|
|
57
|
+
'date.month': string;
|
|
58
|
+
'date.year': string;
|
|
47
59
|
'pages.fields.default.toWorkspacePage': string;
|
|
48
60
|
'pages.fields.view.noWorkflowOrAuth': string;
|
|
49
61
|
'pages.fields.view.viewWorkflow': string;
|
|
@@ -83,7 +95,13 @@ export declare const ru: {
|
|
|
83
95
|
'pages.users.default.forbidden': string;
|
|
84
96
|
'views.common.emptyField.user': string;
|
|
85
97
|
'views.common.emptyField.null': string;
|
|
86
|
-
'
|
|
98
|
+
'date.format.week': string;
|
|
99
|
+
'date.invalidate': string;
|
|
100
|
+
'date.dateTime': string;
|
|
101
|
+
'date.date': string;
|
|
102
|
+
'date.week': string;
|
|
103
|
+
'date.month': string;
|
|
104
|
+
'date.year': string;
|
|
87
105
|
'pages.fields.default.toWorkspacePage': string;
|
|
88
106
|
'pages.fields.view.noWorkflowOrAuth': string;
|
|
89
107
|
'pages.fields.view.viewWorkflow': string;
|
package/dist/locales/index.js
CHANGED
|
@@ -3,7 +3,13 @@ export const en = {
|
|
|
3
3
|
'pages.users.default.forbidden': '(Disabled)',
|
|
4
4
|
'views.common.emptyField.user': 'Unassigned',
|
|
5
5
|
'views.common.emptyField.null': 'Null',
|
|
6
|
-
'
|
|
6
|
+
'date.format.week': 'YYYY WW',
|
|
7
|
+
'date.invalidate': 'Invalid date',
|
|
8
|
+
'date.dateTime': 'Date Time',
|
|
9
|
+
'date.date': 'Date',
|
|
10
|
+
'date.week': 'Week',
|
|
11
|
+
'date.month': 'Month',
|
|
12
|
+
'date.year': 'Year',
|
|
7
13
|
'pages.fields.default.toWorkspacePage': 'Click to enter the workspace',
|
|
8
14
|
'pages.fields.view.noWorkflowOrAuth': `Current state doesn't allow workflow or has no permission`,
|
|
9
15
|
'pages.fields.view.viewWorkflow': 'View workflow diagram',
|
|
@@ -43,7 +49,13 @@ export const zh = {
|
|
|
43
49
|
'pages.users.default.forbidden': '(已禁用)',
|
|
44
50
|
'views.common.emptyField.user': '未指定',
|
|
45
51
|
'views.common.emptyField.null': '无',
|
|
46
|
-
'
|
|
52
|
+
'date.format.week': 'YYYY 第wo',
|
|
53
|
+
'date.invalidate': '日期不合法',
|
|
54
|
+
'date.dateTime': '日期时间',
|
|
55
|
+
'date.date': '日期',
|
|
56
|
+
'date.week': '周',
|
|
57
|
+
'date.month': '月',
|
|
58
|
+
'date.year': '年',
|
|
47
59
|
'pages.fields.default.toWorkspacePage': '点击进入空间',
|
|
48
60
|
'pages.fields.view.noWorkflowOrAuth': '当前状态无法继续流转或者没有权限',
|
|
49
61
|
'pages.fields.view.viewWorkflow': '查看工作流图',
|
|
@@ -83,7 +95,13 @@ export const ru = {
|
|
|
83
95
|
'pages.users.default.forbidden': '(неактивный)',
|
|
84
96
|
'views.common.emptyField.user': 'Не указан',
|
|
85
97
|
'views.common.emptyField.null': 'Нет',
|
|
86
|
-
'
|
|
98
|
+
'date.format.week': 'ГГГГ. неделя',
|
|
99
|
+
'date.invalidate': 'Недействительная дата',
|
|
100
|
+
'date.dateTime': 'Дата и время',
|
|
101
|
+
'date.date': 'Дата',
|
|
102
|
+
'date.week': 'Неделя',
|
|
103
|
+
'date.month': 'Месяц',
|
|
104
|
+
'date.year': 'Год',
|
|
87
105
|
'pages.fields.default.toWorkspacePage': 'Нажмите, чтобы войти в рабочее пространство',
|
|
88
106
|
'pages.fields.view.noWorkflowOrAuth': `Текущее состояние не допускает рабочий процесс или не имеет разрешения`,
|
|
89
107
|
'pages.fields.view.viewWorkflow': 'Посмотреть схему рабочего процесса',
|
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.18",
|
|
4
4
|
"description": "Gitee team components",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -65,4 +65,4 @@
|
|
|
65
65
|
"debug": "^4.3.4",
|
|
66
66
|
"lodash-es": "^4.17.21"
|
|
67
67
|
}
|
|
68
|
-
}
|
|
68
|
+
}
|