@giteeteam/apps-team-components 1.0.17 → 1.0.19
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/common/utils.js +1 -1
- 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/package.json +2 -2
|
@@ -7,7 +7,7 @@ export const getNameBadge = (name) => {
|
|
|
7
7
|
const str = name.trim();
|
|
8
8
|
return String.fromCodePoint(str.codePointAt(0));
|
|
9
9
|
};
|
|
10
|
-
const randomBackgroundColor = ['#5EA1FF', '#4BCC87', '#FFD15E'
|
|
10
|
+
const randomBackgroundColor = ['#5EA1FF', '#4BCC87', '#FFD15E'];
|
|
11
11
|
export const getBackgroundColor = (s) => {
|
|
12
12
|
const code = (s === null || s === void 0 ? void 0 : s.charCodeAt(0)) || 0;
|
|
13
13
|
const random = Math.floor(code % randomBackgroundColor.length);
|
|
@@ -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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@giteeteam/apps-team-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.19",
|
|
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
|
+
}
|