@giteeteam/apps-team-components 1.0.0 → 1.0.2-alpha.1
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/README.md +1 -1
- package/dist/components/common/EmptyField.js +1 -1
- package/dist/components/common/overflow-tooltip/BaseOverflowTooltip.js +10 -9
- package/dist/components/common/overflow-tooltip/SimpleOverflowToolTip.js +10 -9
- package/dist/components/common/overflow-tooltip/style/index.d.ts +2 -2
- package/dist/components/common/overflow-tooltip/style/index.js +3 -4
- package/dist/components/common/style/global.d.ts +1 -1
- package/dist/components/common/style/global.js +1 -2
- package/dist/components/common/user-field/UserAvatar.js +5 -3
- package/dist/components/common/user-field/style/index.d.ts +3 -3
- package/dist/components/common/user-field/style/index.js +3 -4
- package/dist/components/fields/actors/ReadView.js +1 -1
- package/dist/components/fields/assignee/ReadView.js +6 -6
- package/dist/components/fields/bind-workspace/ReadView.js +5 -3
- package/dist/components/fields/bind-workspace/style/index.d.ts +1 -1
- package/dist/components/fields/bind-workspace/style/index.js +1 -2
- package/dist/components/fields/checkbox/ReadView.js +1 -1
- package/dist/components/fields/created-at/ReadView.js +1 -1
- package/dist/components/fields/created-by/ReadView.d.ts +1 -1
- package/dist/components/fields/created-by/ReadView.js +3 -6
- package/dist/components/fields/data-quote/ReadView.js +3 -2
- package/dist/components/fields/date/ReadView.js +1 -1
- package/dist/components/fields/dropdown/ReadView.js +1 -1
- package/dist/components/fields/file/ReadView.js +1 -1
- package/dist/components/fields/formula/ReadView.js +1 -1
- package/dist/components/fields/hyper-link/ReadView.js +4 -3
- package/dist/components/fields/hyper-link/style/index.d.ts +3 -3
- package/dist/components/fields/hyper-link/style/index.js +3 -4
- package/dist/components/fields/item-group/ReadView.js +1 -1
- package/dist/components/fields/item-type/ReadView.js +1 -1
- package/dist/components/fields/key/ReadView.js +1 -1
- package/dist/components/fields/long-text/ReadView.js +3 -2
- package/dist/components/fields/long-text/style/index.d.ts +1 -1
- package/dist/components/fields/long-text/style/index.js +1 -2
- package/dist/components/fields/number/ReadView.js +1 -1
- package/dist/components/fields/priority/ReadView.js +3 -2
- package/dist/components/fields/priority/style/index.d.ts +3 -3
- package/dist/components/fields/priority/style/index.js +3 -4
- package/dist/components/fields/radio/ReadView.js +1 -1
- package/dist/components/fields/reporter/ReadView.d.ts +1 -1
- package/dist/components/fields/reporter/ReadView.js +3 -6
- package/dist/components/fields/script/ReadView.js +1 -1
- package/dist/components/fields/sprint/ReadView.js +1 -1
- package/dist/components/fields/status/Cell.js +3 -4
- package/dist/components/fields/status/ReadView.js +3 -2
- package/dist/components/fields/status/Transition.js +16 -14
- package/dist/components/fields/status/TransitionButton.js +11 -9
- package/dist/components/fields/status/TransitionPanel.js +8 -8
- package/dist/components/fields/status/View.js +8 -11
- package/dist/components/fields/status/style/index.d.ts +19 -19
- package/dist/components/fields/status/style/index.js +36 -39
- package/dist/components/fields/story-point/ReadView.js +1 -1
- package/dist/components/fields/tag/ReadView.js +3 -2
- package/dist/components/fields/tag/style/index.d.ts +1 -1
- package/dist/components/fields/tag/style/index.js +1 -2
- package/dist/components/fields/team/ReadView.js +3 -2
- package/dist/components/fields/team/style/index.d.ts +2 -2
- package/dist/components/fields/team/style/index.js +1 -2
- package/dist/components/fields/text/ReadView.js +1 -1
- package/dist/components/fields/tree/ReadView.js +1 -1
- package/dist/components/fields/updated-at/ReadView.js +1 -1
- package/dist/components/fields/updated-by/ReadView.d.ts +1 -1
- package/dist/components/fields/updated-by/ReadView.js +3 -6
- package/dist/components/fields/user/ReadView.js +3 -3
- package/dist/components/fields/user/style/index.d.ts +3 -3
- package/dist/components/fields/user/style/index.js +3 -4
- package/dist/components/fields/user-group/ReadView.js +8 -6
- package/dist/components/fields/version/ReadView.js +1 -1
- package/dist/components/fields/workspace/ReadView.js +1 -1
- package/dist/components/table-components/EditTableCell.js +1 -1
- package/dist/components/table-components/index.js +9 -9
- package/dist/components/table-components/style/index.d.ts +1 -1
- package/dist/components/table-components/style/index.js +6 -9
- package/dist/icons/index.js +1 -1
- package/dist/lib/contexts/antdConfig.js +1 -1
- package/dist/lib/contexts/currentUser.js +1 -1
- package/dist/lib/contexts/currentWorkspace.js +1 -1
- package/dist/lib/contexts/datetimeFormat.js +1 -1
- package/dist/lib/contexts/index.js +1 -1
- package/dist/lib/contexts/itemConfig.js +1 -1
- package/dist/lib/contexts/teamConfig.js +1 -1
- package/dist/lib/contexts/tenant.js +1 -1
- package/dist/lib/contexts/workflowConfig.js +1 -1
- package/dist/lib/date.d.ts +0 -2
- package/dist/lib/date.js +0 -12
- package/package.json +3 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback,
|
|
3
|
-
import {
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useCallback, useRef, useState } from 'react';
|
|
3
|
+
import { css, Global } from '@emotion/react';
|
|
4
4
|
import { isEmpty } from 'lodash-es';
|
|
5
5
|
import EmptyField from '../common/EmptyField';
|
|
6
6
|
import EditTableCell from './EditTableCell';
|
|
7
|
-
import {
|
|
7
|
+
import { fieldCellGlobalStyle } from './style';
|
|
8
8
|
const reduceObjArr = ({ arr, keys }) => {
|
|
9
9
|
return arr.reduce((accumulatorStr, nextObj) => {
|
|
10
10
|
const nextValue = keys.length > 1 ? `${nextObj[keys[0]]}(${nextObj[keys[1]]})` : nextObj[keys[0]];
|
|
@@ -37,10 +37,10 @@ const transferItem = item => {
|
|
|
37
37
|
};
|
|
38
38
|
const EMPTY_ARRAY = [];
|
|
39
39
|
const defaultValue = {};
|
|
40
|
-
|
|
40
|
+
const BaseTableCell = ({ className, cellData, column, rowData, readComponents = defaultValue, editComponents = defaultValue, handleChange, }) => {
|
|
41
41
|
var _a, _b, _c;
|
|
42
42
|
const [cellEntered, setCellEntered] = useState(false);
|
|
43
|
-
const cls =
|
|
43
|
+
const cls = `field-cell-layout field-layout ${className}`;
|
|
44
44
|
const timeoutCurrent = useRef();
|
|
45
45
|
const ReadComponent = readComponents[column.cellType] || readComponents[column.componentType];
|
|
46
46
|
const EditComponent = readComponents[column.cellType] || readComponents[column.componentType];
|
|
@@ -52,9 +52,6 @@ export const TableCell = ({ className, cellData, column, rowData, readComponents
|
|
|
52
52
|
}, 50);
|
|
53
53
|
}
|
|
54
54
|
}, [editComponents]);
|
|
55
|
-
useEffect(() => {
|
|
56
|
-
injectFieldCellGlobalStyle();
|
|
57
|
-
}, []);
|
|
58
55
|
if (cellEntered && EditComponent) {
|
|
59
56
|
const { property, data, objectId } = column;
|
|
60
57
|
return (_jsx("div", { className: cls, children: _jsx(EditTableCell, { Component: EditComponent, workspaceId: (_a = rowData.workspace) === null || _a === void 0 ? void 0 : _a.objectId, itemTypeId: (_b = rowData.itemType) === null || _b === void 0 ? void 0 : _b.objectId, property: property, data: data, id: rowData.objectId, readonly: rowData.readonly, objectId: objectId, text: cellData, handleChange: handleChange }) }));
|
|
@@ -65,3 +62,6 @@ export const TableCell = ({ className, cellData, column, rowData, readComponents
|
|
|
65
62
|
const text = transferItem(cellData !== null && cellData !== void 0 ? cellData : rowData[column.dataIndex]);
|
|
66
63
|
return _jsx("div", { className: cls, children: text });
|
|
67
64
|
};
|
|
65
|
+
export const TableCell = props => {
|
|
66
|
+
return (_jsxs(_Fragment, { children: [_jsx(Global, { styles: css(fieldCellGlobalStyle) }), _jsx(BaseTableCell, { ...props })] }));
|
|
67
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const fieldCellGlobalStyle = "\n.field-cell-layout {\n align-items: center;\n width: 100%;\n}\n";
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
`;
|
|
9
|
-
};
|
|
1
|
+
export const fieldCellGlobalStyle = `
|
|
2
|
+
.field-cell-layout {
|
|
3
|
+
align-items: center;
|
|
4
|
+
width: 100%;
|
|
5
|
+
}
|
|
6
|
+
`;
|
package/dist/icons/index.js
CHANGED
package/dist/lib/date.d.ts
CHANGED
|
@@ -9,9 +9,7 @@ export declare const getStartOfWeekUnix: (date: DateValue) => number;
|
|
|
9
9
|
export declare const getEndOfWeekUnix: (date: DateValue) => number;
|
|
10
10
|
export declare const getStartOfMonthUnix: (date: DateValue) => number;
|
|
11
11
|
export declare const getEndOfMonthUnix: (date: DateValue) => number;
|
|
12
|
-
export declare const getStartOfYearUnix: (date: DateValue) => number;
|
|
13
12
|
export declare const getFormat: (date: DateValue, format: string) => string;
|
|
14
|
-
export declare const chineseDateTimeFormat: Intl.DateTimeFormat;
|
|
15
13
|
export declare enum DateTypeEnum {
|
|
16
14
|
dateTime = "second",
|
|
17
15
|
date = "date",
|
package/dist/lib/date.js
CHANGED
|
@@ -42,21 +42,9 @@ export const getStartOfMonthUnix = (date) => {
|
|
|
42
42
|
export const getEndOfMonthUnix = (date) => {
|
|
43
43
|
return dayjs(date).endOf('month').valueOf();
|
|
44
44
|
};
|
|
45
|
-
export const getStartOfYearUnix = (date) => {
|
|
46
|
-
return dayjs(date).startOf('year').valueOf();
|
|
47
|
-
};
|
|
48
45
|
export const getFormat = (date, format) => {
|
|
49
46
|
return dayjs(date).format(format);
|
|
50
47
|
};
|
|
51
|
-
export const chineseDateTimeFormat = new Intl.DateTimeFormat('zh-CN', {
|
|
52
|
-
hour12: false,
|
|
53
|
-
year: 'numeric',
|
|
54
|
-
month: 'numeric',
|
|
55
|
-
day: 'numeric',
|
|
56
|
-
hour: 'numeric',
|
|
57
|
-
minute: 'numeric',
|
|
58
|
-
second: 'numeric',
|
|
59
|
-
});
|
|
60
48
|
export var DateTypeEnum;
|
|
61
49
|
(function (DateTypeEnum) {
|
|
62
50
|
DateTypeEnum["dateTime"] = "second";
|
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.2-alpha.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -47,7 +47,8 @@
|
|
|
47
47
|
"swr": "^1.1.0"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@emotion/
|
|
50
|
+
"@emotion/cache": "^11.11.0",
|
|
51
|
+
"@emotion/react": "^11.11.1",
|
|
51
52
|
"debug": "^4.3.4",
|
|
52
53
|
"lodash-es": "^4.17.21"
|
|
53
54
|
}
|