@giteeteam/apps-team-components 1.3.0-alpha.1 → 1.3.0-alpha.2
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/EmptyField.d.ts +0 -1
- package/dist/components/common/EmptyField.js +7 -5
- package/dist/components/common/PriceTag.js +11 -8
- package/dist/components/common/expand-component/index.d.ts +0 -1
- package/dist/components/common/expand-component/index.js +12 -10
- package/dist/components/common/expand-component/style.js +4 -2
- package/dist/components/common/item-icon/ItemIcon.d.ts +0 -1
- package/dist/components/common/item-icon/ItemIcon.js +6 -4
- package/dist/components/common/overflow-tooltip/BaseOverflowTooltip.d.ts +0 -1
- package/dist/components/common/overflow-tooltip/BaseOverflowTooltip.js +9 -6
- package/dist/components/common/overflow-tooltip/OverflowTooltip.js +9 -6
- package/dist/components/common/overflow-tooltip/SimpleOverflowToolTip.js +8 -5
- package/dist/components/common/overflow-tooltip/style/index.js +5 -3
- package/dist/components/common/style/global.js +3 -1
- package/dist/components/common/style/mixin.js +6 -3
- package/dist/components/common/user-field/UserAvatar.js +8 -6
- package/dist/components/common/user-field/style/index.js +5 -3
- package/dist/components/common/utils.js +13 -9
- package/dist/components/default-empty-icon/config.js +11 -6
- package/dist/components/default-empty-icon/index.js +10 -9
- package/dist/components/default-empty-icon/style.js +15 -12
- package/dist/components/default-empty-icon/types.js +3 -1
- package/dist/components/field-behavior/fields/type.js +5 -2
- package/dist/components/fields/actors/BaseField.js +5 -2
- package/dist/components/fields/actors/ReadView.d.ts +0 -1
- package/dist/components/fields/actors/ReadView.js +8 -6
- package/dist/components/fields/ancestor/ReadView.js +8 -6
- package/dist/components/fields/ancestor/utils.js +4 -12
- package/dist/components/fields/assignee/ReadView.d.ts +0 -1
- package/dist/components/fields/assignee/ReadView.js +13 -11
- package/dist/components/fields/base-component/utils.js +3 -1
- package/dist/components/fields/bind-workspace/ReadView.d.ts +0 -1
- package/dist/components/fields/bind-workspace/ReadView.js +11 -9
- package/dist/components/fields/bind-workspace/hooks.js +7 -4
- package/dist/components/fields/bind-workspace/style/index.js +3 -1
- package/dist/components/fields/cascade/ReadView.js +8 -6
- package/dist/components/fields/cascade/utils.js +4 -3
- package/dist/components/fields/checkbox/ReadView.d.ts +0 -1
- package/dist/components/fields/checkbox/ReadView.js +7 -5
- package/dist/components/fields/created-at/ReadView.js +10 -8
- package/dist/components/fields/created-by/ReadView.d.ts +0 -1
- package/dist/components/fields/created-by/ReadView.js +11 -9
- package/dist/components/fields/data-quote/ReadView.js +12 -10
- package/dist/components/fields/data-quote/utils.js +5 -3
- package/dist/components/fields/date/ReadView.d.ts +0 -1
- package/dist/components/fields/date/ReadView.js +8 -6
- package/dist/components/fields/dropdown/BaseField.js +42 -40
- package/dist/components/fields/dropdown/Cell.d.ts +0 -1
- package/dist/components/fields/dropdown/Cell.js +6 -4
- package/dist/components/fields/dropdown/ReadView.d.ts +0 -1
- package/dist/components/fields/dropdown/ReadView.js +10 -8
- package/dist/components/fields/dropdown/data.d.ts +1 -1
- package/dist/components/fields/dropdown/data.js +6 -3
- package/dist/components/fields/dropdown/hook.d.ts +0 -1
- package/dist/components/fields/dropdown/hook.js +11 -8
- package/dist/components/fields/dropdown/style.js +21 -18
- package/dist/components/fields/file/ReadView.d.ts +0 -1
- package/dist/components/fields/file/ReadView.js +7 -5
- package/dist/components/fields/formula/ReadView.d.ts +0 -1
- package/dist/components/fields/formula/ReadView.js +7 -5
- package/dist/components/fields/hooks/useViewClass.js +4 -2
- package/dist/components/fields/hyper-link/ReadView.d.ts +0 -1
- package/dist/components/fields/hyper-link/ReadView.js +8 -6
- package/dist/components/fields/hyper-link/style/index.js +7 -4
- package/dist/components/fields/item-group/ReadView.d.ts +0 -1
- package/dist/components/fields/item-group/ReadView.js +6 -4
- package/dist/components/fields/item-type/ItemTypeIcon.js +15 -17
- package/dist/components/fields/item-type/ReadView.d.ts +0 -1
- package/dist/components/fields/item-type/ReadView.js +7 -5
- package/dist/components/fields/item-type/style/index.js +3 -1
- package/dist/components/fields/key/ReadView.d.ts +0 -1
- package/dist/components/fields/key/ReadView.js +7 -5
- package/dist/components/fields/long-text/ReadView.d.ts +0 -1
- package/dist/components/fields/long-text/ReadView.js +8 -6
- package/dist/components/fields/long-text/style/index.js +3 -1
- package/dist/components/fields/number/BaseField.js +5 -2
- package/dist/components/fields/number/ReadView.d.ts +0 -1
- package/dist/components/fields/number/ReadView.js +8 -6
- package/dist/components/fields/priority/ReadView.js +12 -10
- package/dist/components/fields/priority/style/index.js +11 -8
- package/dist/components/fields/radio/ReadView.d.ts +0 -1
- package/dist/components/fields/radio/ReadView.js +8 -6
- package/dist/components/fields/repo-files/ReadView.js +8 -6
- package/dist/components/fields/repo-files/utils.js +5 -3
- package/dist/components/fields/reporter/ReadView.d.ts +0 -1
- package/dist/components/fields/reporter/ReadView.js +11 -9
- package/dist/components/fields/script/BaseField.js +4 -1
- package/dist/components/fields/script/ReadView.d.ts +0 -1
- package/dist/components/fields/script/ReadView.js +10 -8
- package/dist/components/fields/sprint/ReadView.js +7 -5
- package/dist/components/fields/status/Cell.js +8 -6
- package/dist/components/fields/status/Field.d.ts +0 -1
- package/dist/components/fields/status/ReadView.js +10 -8
- package/dist/components/fields/status/SelectFlowHandler.js +15 -12
- package/dist/components/fields/status/SelectTransition.js +13 -10
- package/dist/components/fields/status/Transition.js +18 -15
- package/dist/components/fields/status/TransitionButton.js +17 -14
- package/dist/components/fields/status/TransitionPanel.js +14 -11
- package/dist/components/fields/status/View.js +11 -8
- package/dist/components/fields/status/style/index.js +36 -59
- package/dist/components/fields/story-point/ReadView.d.ts +0 -1
- package/dist/components/fields/story-point/ReadView.js +6 -4
- package/dist/components/fields/tag/ReadView.js +10 -8
- package/dist/components/fields/tag/style/index.js +3 -1
- package/dist/components/fields/team/ReadView.js +10 -8
- package/dist/components/fields/team/style/index.js +4 -2
- package/dist/components/fields/text/BaseField.d.ts +0 -1
- package/dist/components/fields/text/ReadView.js +8 -6
- package/dist/components/fields/tree/ReadView.js +10 -8
- package/dist/components/fields/tree/utils.js +5 -3
- package/dist/components/fields/updated-at/ReadView.js +10 -8
- package/dist/components/fields/updated-by/ReadView.d.ts +0 -1
- package/dist/components/fields/updated-by/ReadView.js +11 -9
- package/dist/components/fields/user/ReadView.d.ts +0 -1
- package/dist/components/fields/user/ReadView.js +11 -9
- package/dist/components/fields/user/style/index.js +7 -4
- package/dist/components/fields/user-group/BaseField.d.ts +0 -1
- package/dist/components/fields/user-group/ReadView.js +11 -13
- package/dist/components/fields/version/ReadView.js +8 -6
- package/dist/components/fields/workspace/ReadView.d.ts +0 -1
- package/dist/components/fields/workspace/ReadView.js +10 -8
- package/dist/components/filters/filter-search/utils.js +6 -6
- package/dist/components/item/hooks.js +5 -2
- package/dist/components/table-components/EditTableCell.js +6 -3
- package/dist/components/table-components/index.js +14 -11
- package/dist/components/table-components/style/index.js +3 -1
- package/dist/components/table-components/utils.js +49 -46
- package/dist/icons/SyncIconFont.js +7 -5
- package/dist/icons/createFromIconFontClass.js +3 -1
- package/dist/icons/empty-icon/index.d.ts +8 -1
- package/dist/icons/empty-icon/large-item@2x.png.js +3 -0
- package/dist/icons/empty-icon/large-workspace@2x.png.js +3 -0
- package/dist/icons/empty-icon/small-default@2x.png.js +3 -0
- package/dist/icons/index.d.ts +1 -1
- package/dist/icons/index.js +37 -35
- package/dist/icons/style/index.js +4 -2
- package/dist/icons/svg/ArrowBack.svg.js +3 -0
- package/dist/icons/svg/Done.svg.js +3 -0
- package/dist/icons/svg/DottedCircle.svg.js +3 -0
- package/dist/icons/svg/HollowCircle.svg.js +3 -0
- package/dist/icons/svg/Search.svg.js +3 -0
- package/dist/icons/svg/Workflow.svg.js +3 -0
- package/dist/index.js +47 -47
- package/dist/lib/app/utils.d.ts +0 -1
- package/dist/lib/app/utils.js +4 -2
- package/dist/lib/array.js +5 -44
- package/dist/lib/config.js +8 -6
- package/dist/lib/constants/code.js +3 -1
- package/dist/lib/constants/field.js +5 -2
- package/dist/lib/contexts/antdConfig.js +10 -7
- package/dist/lib/contexts/currentUser.js +7 -4
- package/dist/lib/contexts/currentWorkspace.js +7 -4
- package/dist/lib/contexts/datetimeFormat.js +7 -4
- package/dist/lib/contexts/index.js +16 -13
- package/dist/lib/contexts/itemConfig.js +7 -4
- package/dist/lib/contexts/teamConfig.js +8 -5
- package/dist/lib/contexts/tenant.js +7 -4
- package/dist/lib/contexts/workflowConfig.js +7 -4
- package/dist/lib/dataType.js +4 -5
- package/dist/lib/date.js +11 -52
- package/dist/lib/dayjs.js +2 -1
- package/dist/lib/error/log.js +7 -4
- package/dist/lib/error/utils.d.ts +1 -1
- package/dist/lib/error/utils.js +8 -20
- package/dist/lib/error/withServerError.js +3 -1
- package/dist/lib/fetch.js +23 -54
- package/dist/lib/global.js +16 -14
- package/dist/lib/hooks/useAntdConfig.js +4 -2
- package/dist/lib/hooks/useCurrentUser.js +4 -2
- package/dist/lib/hooks/useCurrentWorkspace.js +4 -2
- package/dist/lib/hooks/useDataQuoteStore.js +8 -5
- package/dist/lib/hooks/useDateTimeFormatType.js +4 -2
- package/dist/lib/hooks/useI18n.d.ts +1 -1
- package/dist/lib/hooks/useI18n.js +4 -2
- package/dist/lib/hooks/useItemConfig.js +4 -2
- package/dist/lib/hooks/useTeamConfig.js +4 -2
- package/dist/lib/hooks/useTenant.js +4 -2
- package/dist/lib/hooks/useWorkflowConfig.js +4 -2
- package/dist/lib/i18n.js +6 -3
- package/dist/lib/icons/utils.js +10 -9
- package/dist/lib/isInOne.js +2 -1
- package/dist/lib/number.js +3 -1
- package/dist/lib/path.d.ts +2 -2
- package/dist/lib/path.js +9 -6
- package/dist/lib/regExp.js +3 -1
- package/dist/lib/router.js +4 -1
- package/dist/lib/storage.js +4 -39
- package/dist/lib/store/dataQuoteStore.js +5 -2
- package/dist/lib/swr/constants.js +4 -2
- package/dist/lib/swr/hooks.js +6 -3
- package/dist/lib/swr/throttleWithCache.js +7 -5
- package/dist/lib/throttleFetch.js +4 -2
- package/dist/lib/useConfig.js +9 -6
- package/dist/lib/useUser.js +9 -6
- package/dist/lib/users.js +5 -2
- package/dist/lib/workflow.js +21 -20
- package/dist/locales/index.js +5 -3
- package/dist/style/common.js +11 -24
- package/dist/style/global.js +3 -1
- package/package.json +8 -2
- package/dist/components/fields/base-component/types.js +0 -1
- package/dist/components/fields/hooks/useParamsAdapter.js +0 -1
- package/dist/components/fields/radio/BaseField.js +0 -1
- package/dist/components/fields/status/Field.js +0 -1
- package/dist/components/fields/tag/BaseField.js +0 -1
- package/dist/components/fields/text/BaseField.js +0 -1
- package/dist/components/fields/tree/BaseField.js +0 -1
- package/dist/components/fields/tree/types.js +0 -1
- package/dist/components/fields/types.js +0 -1
- package/dist/components/fields/user-group/ActionCell.js +0 -1
- package/dist/components/fields/user-group/BaseField.js +0 -1
- package/dist/icons/empty-icon/index.js +0 -8
- package/dist/icons/svg/ArrowBack.svg +0 -1
- package/dist/icons/svg/Done.svg +0 -1
- package/dist/icons/svg/DottedCircle.svg +0 -7
- package/dist/icons/svg/HollowCircle.svg +0 -6
- package/dist/icons/svg/Search.svg +0 -1
- package/dist/icons/svg/Workflow.svg +0 -12
- package/dist/lib/error/index.js +0 -2
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { getArrayValue } from 'lib/array';
|
|
4
|
-
import { REMOTE_DATA_QUOTE_FIELD_TYPE } from 'lib/constants/field';
|
|
5
|
-
import { FIELD_TYPE_KEY_MAPPINGS } from 'lib/global';
|
|
6
|
-
import { useFetchDropdown } from './data';
|
|
1
|
+
import { useState, useMemo, useRef, useCallback } from 'react';
|
|
2
|
+
import { uniqWith, debounce } from 'lodash-es';
|
|
3
|
+
import { getArrayValue } from '../../../lib/array.js';
|
|
4
|
+
import { REMOTE_DATA_QUOTE_FIELD_TYPE } from '../../../lib/constants/field.js';
|
|
5
|
+
import { FIELD_TYPE_KEY_MAPPINGS } from '../../../lib/global.js';
|
|
6
|
+
import { useFetchDropdown } from './data.js';
|
|
7
|
+
|
|
7
8
|
const useGenerateFetchFunction = ({ workspaceId, page, fieldId, propsValue, needFetchDataSource, defaultFetchValues, defaultFetchOptions, }) => {
|
|
8
9
|
const fetchDropdownData = useFetchDropdown();
|
|
9
10
|
const fetchOptions = useMemo(() => {
|
|
@@ -38,8 +39,8 @@ const useGenerateFetchFunction = ({ workspaceId, page, fieldId, propsValue, need
|
|
|
38
39
|
fetchValues,
|
|
39
40
|
};
|
|
40
41
|
};
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
const EMPTY_OPTIONS = [];
|
|
43
|
+
const useCommonProps = (props) => {
|
|
43
44
|
var _a;
|
|
44
45
|
const { value: propsValue, options: _propsOptions = EMPTY_OPTIONS, fetchValues: _fetchValues, fetchOptions: _fetchOptions, debounceTimeout = 600, objectId, userData, workspace, page, fetchChange, onlyWorkspace, setOnlyWorkspace, fieldTypeKey, detailKey, isCascaded, cascadeCustomData, workspaceId, dataSource, } = props;
|
|
45
46
|
const [loading, setLoading] = useState(true);
|
|
@@ -150,3 +151,5 @@ export const useCommonProps = (props) => {
|
|
|
150
151
|
value,
|
|
151
152
|
};
|
|
152
153
|
};
|
|
154
|
+
|
|
155
|
+
export { EMPTY_OPTIONS, useCommonProps };
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { randomClassName } from 'style/common';
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { randomClassName } from '../../../style/common.js';
|
|
2
|
+
import { hoverStyle, hoverIconStyle } from '../../common/style/mixin.js';
|
|
3
|
+
|
|
4
|
+
const dropdownSelectDisabled = `
|
|
4
5
|
text-decoration: line-through;
|
|
5
6
|
`;
|
|
6
|
-
|
|
7
|
+
const onlyWorkspaceStyle = `
|
|
7
8
|
padding: 5px 12px;
|
|
8
9
|
`;
|
|
9
|
-
|
|
10
|
+
const onlyWorkspaceDividerStyle = `
|
|
10
11
|
&:not(.add-weights) {
|
|
11
12
|
margin: 4px 0;
|
|
12
13
|
}
|
|
13
14
|
`;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
const hiddenHoverClass = randomClassName('hidden-hover');
|
|
16
|
+
const displayWrapClass = randomClassName('display-wrap');
|
|
17
|
+
const valueOptionClass = randomClassName('value-option');
|
|
18
|
+
const valueOptionContentClass = randomClassName('value-option-content');
|
|
19
|
+
const valueOptionIconClass = randomClassName('value-option-icon');
|
|
20
|
+
const valueOptionLabelClass = randomClassName('value-option-label');
|
|
21
|
+
const workspaceClass = randomClassName('workspace');
|
|
22
|
+
const hoverIconClass = randomClassName('hover-icon');
|
|
23
|
+
const optionDisplayWrapClass = randomClassName('option-display-wrap');
|
|
24
|
+
const dropdownStyle = (antPrefix) => `
|
|
24
25
|
width: 100%;
|
|
25
26
|
|
|
26
27
|
&:not(.${hiddenHoverClass}) &:not(.${displayWrapClass}) :hover {
|
|
@@ -77,9 +78,9 @@ export const dropdownStyle = (antPrefix) => `
|
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
80
|
`;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
const dropdownSelectOptionClass = randomClassName('dropdown-select-option');
|
|
82
|
+
const disabledClass = randomClassName('disabled');
|
|
83
|
+
const dropdownSelectStyle = (antPrefix) => `
|
|
83
84
|
.${dropdownSelectOptionClass}.${disabledClass} {
|
|
84
85
|
text-decoration: line-through;
|
|
85
86
|
}
|
|
@@ -88,3 +89,5 @@ export const dropdownSelectStyle = (antPrefix) => `
|
|
|
88
89
|
text-decoration: line-through;
|
|
89
90
|
}
|
|
90
91
|
`;
|
|
92
|
+
|
|
93
|
+
export { disabledClass, displayWrapClass, dropdownSelectDisabled, dropdownSelectOptionClass, dropdownSelectStyle, dropdownStyle, hiddenHoverClass, hoverIconClass, onlyWorkspaceDividerStyle, onlyWorkspaceStyle, optionDisplayWrapClass, valueOptionClass, valueOptionContentClass, valueOptionIconClass, valueOptionLabelClass, workspaceClass };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx, Fragment } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import { memo } from 'react';
|
|
3
|
-
import EmptyField from '../../common/EmptyField';
|
|
4
|
-
import SimpleOverflowToolTip from '../../common/overflow-tooltip/SimpleOverflowToolTip';
|
|
3
|
+
import EmptyField from '../../common/EmptyField.js';
|
|
4
|
+
import SimpleOverflowToolTip from '../../common/overflow-tooltip/SimpleOverflowToolTip.js';
|
|
5
|
+
|
|
5
6
|
const FileReadView = memo(({ value }) => {
|
|
6
7
|
const showValue = (value === null || value === void 0 ? void 0 : value.length)
|
|
7
8
|
? value
|
|
@@ -9,6 +10,7 @@ const FileReadView = memo(({ value }) => {
|
|
|
9
10
|
.filter(Boolean)
|
|
10
11
|
.join(',')
|
|
11
12
|
: '';
|
|
12
|
-
return (
|
|
13
|
+
return (jsx(Fragment, { children: showValue ? (jsx(SimpleOverflowToolTip, { title: showValue, children: showValue })) : (jsx(EmptyField, { readonly: true })) }));
|
|
13
14
|
});
|
|
14
|
-
|
|
15
|
+
|
|
16
|
+
export { FileReadView as default };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx, Fragment } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import { memo, useMemo } from 'react';
|
|
3
|
-
import EmptyField from '../../common/EmptyField';
|
|
4
|
-
import SimpleOverflowToolTip from '../../common/overflow-tooltip/SimpleOverflowToolTip';
|
|
3
|
+
import EmptyField from '../../common/EmptyField.js';
|
|
4
|
+
import SimpleOverflowToolTip from '../../common/overflow-tooltip/SimpleOverflowToolTip.js';
|
|
5
|
+
|
|
5
6
|
const FormulaReadView = memo(({ value, addonBefore = '', addonAfter = '' }) => {
|
|
6
7
|
const showValue = useMemo(() => {
|
|
7
8
|
return (value === null || value === void 0 ? void 0 : value.toString()) || '';
|
|
@@ -9,6 +10,7 @@ const FormulaReadView = memo(({ value, addonBefore = '', addonAfter = '' }) => {
|
|
|
9
10
|
const valueWithPrefix = useMemo(() => {
|
|
10
11
|
return `${addonBefore}${showValue || ''}${addonAfter}`;
|
|
11
12
|
}, [addonBefore, showValue, addonAfter]);
|
|
12
|
-
return (
|
|
13
|
+
return (jsx(Fragment, { children: valueWithPrefix ? (jsx(SimpleOverflowToolTip, { title: valueWithPrefix, children: valueWithPrefix })) : (jsx(EmptyField, { readonly: true })) }));
|
|
13
14
|
});
|
|
14
|
-
|
|
15
|
+
|
|
16
|
+
export { FormulaReadView as default };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
|
-
import { SCREEN_TYPE } from 'lib/global';
|
|
2
|
+
import { SCREEN_TYPE } from '../../../lib/global.js';
|
|
3
|
+
|
|
3
4
|
const useViewClass = ({ screenMode, editing, readonly }) => {
|
|
4
5
|
const isView = useMemo(() => {
|
|
5
6
|
return screenMode === SCREEN_TYPE.View;
|
|
@@ -15,4 +16,5 @@ const useViewClass = ({ screenMode, editing, readonly }) => {
|
|
|
15
16
|
isView,
|
|
16
17
|
};
|
|
17
18
|
};
|
|
18
|
-
|
|
19
|
+
|
|
20
|
+
export { useViewClass as default };
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx, jsxs } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import { memo, useMemo } from 'react';
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { Popover } from 'antd';
|
|
5
|
-
import EmptyField from '../../common/EmptyField';
|
|
6
|
-
import {
|
|
5
|
+
import EmptyField from '../../common/EmptyField.js';
|
|
6
|
+
import { hyperLinkTipItem, hyperLinkListStyle, hyperLinkItemStyle } from './style/index.js';
|
|
7
|
+
|
|
7
8
|
const HyperLinkCell = memo(props => {
|
|
8
9
|
const { value } = props;
|
|
9
10
|
const list = useMemo(() => {
|
|
10
11
|
return value === null || value === void 0 ? void 0 : value.filter(item => item === null || item === void 0 ? void 0 : item.value);
|
|
11
12
|
}, [value]);
|
|
12
13
|
const content = useMemo(() => {
|
|
13
|
-
return list === null || list === void 0 ? void 0 : list.map(item => (
|
|
14
|
+
return list === null || list === void 0 ? void 0 : list.map(item => (jsx("a", { href: item.value, target: "_blank", rel: "noreferrer", css: css(hyperLinkTipItem), children: item.label }, item.id)));
|
|
14
15
|
}, [list]);
|
|
15
|
-
return (list === null || list === void 0 ? void 0 : list.length) > 0 ? (
|
|
16
|
+
return (list === null || list === void 0 ? void 0 : list.length) > 0 ? (jsx(Popover, { content: content, destroyTooltipOnHide: true, children: jsx("div", { css: css(hyperLinkListStyle), children: list.map((item, index) => (jsxs("a", { href: item.value, target: "_blank", rel: "noreferrer", css: css(hyperLinkItemStyle), children: [item.label, index + 1 !== list.length && jsx("span", { children: ",\u00A0" })] }, item.id))) }) })) : (jsx(EmptyField, { readonly: true }));
|
|
16
17
|
});
|
|
17
|
-
|
|
18
|
+
|
|
19
|
+
export { HyperLinkCell as default };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { blue6 } from '../../../../style/common';
|
|
2
|
-
|
|
1
|
+
import { blue6 } from '../../../../style/common.js';
|
|
2
|
+
|
|
3
|
+
const hyperLinkListStyle = `
|
|
3
4
|
display: flex;
|
|
4
5
|
width: 100%;
|
|
5
6
|
`;
|
|
6
|
-
|
|
7
|
+
const hyperLinkItemStyle = `
|
|
7
8
|
${hyperLinkListStyle} & {
|
|
8
9
|
overflow: hidden;
|
|
9
10
|
color: @blue-6;
|
|
@@ -12,7 +13,9 @@ export const hyperLinkItemStyle = `
|
|
|
12
13
|
-webkit-line-clamp: 1;
|
|
13
14
|
}
|
|
14
15
|
`;
|
|
15
|
-
|
|
16
|
+
const hyperLinkTipItem = `
|
|
16
17
|
display: block;
|
|
17
18
|
color: ${blue6};
|
|
18
19
|
`;
|
|
20
|
+
|
|
21
|
+
export { hyperLinkItemStyle, hyperLinkListStyle, hyperLinkTipItem };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import EmptyField from '../../common/EmptyField';
|
|
1
|
+
import { jsx, Fragment } from '@emotion/react/jsx-runtime';
|
|
2
|
+
import EmptyField from '../../common/EmptyField.js';
|
|
3
|
+
|
|
3
4
|
const ItemGroupReadView = ({ value }) => {
|
|
4
|
-
return
|
|
5
|
+
return jsx(Fragment, { children: (value === null || value === void 0 ? void 0 : value.name) || jsx(EmptyField, { readonly: true }) });
|
|
5
6
|
};
|
|
6
|
-
|
|
7
|
+
|
|
8
|
+
export { ItemGroupReadView as default };
|
|
@@ -1,33 +1,31 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import {
|
|
1
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
2
|
+
import { useState, useMemo } from 'react';
|
|
3
3
|
import { ClassNames } from '@emotion/react';
|
|
4
4
|
import { Tooltip } from 'antd';
|
|
5
|
-
import { CustomIconFont } from 'icons/index';
|
|
6
|
-
import useI18n from 'lib/hooks/useI18n';
|
|
7
|
-
import {
|
|
8
|
-
import { usePatchIconUrl } from 'lib/path';
|
|
9
|
-
import { nameItemTypeImg } from './style';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return patchIconUrl(NoItemTypeIconUrl);
|
|
14
|
-
};
|
|
15
|
-
export const ItemTypeIcon = ({ icon, name, className, }) => {
|
|
5
|
+
import { CustomIconFont } from '../../../icons/index.js';
|
|
6
|
+
import useI18n from '../../../lib/hooks/useI18n.js';
|
|
7
|
+
import { usePolyFillIcon, isBase64Img } from '../../../lib/icons/utils.js';
|
|
8
|
+
import { usePatchIconUrl } from '../../../lib/path.js';
|
|
9
|
+
import { nameItemTypeImg } from './style/index.js';
|
|
10
|
+
|
|
11
|
+
const NoItemTypeIconUrl = '/icons/NoItemType.svg';
|
|
12
|
+
const ItemTypeIcon = ({ icon, name, className, }) => {
|
|
16
13
|
const { t } = useI18n();
|
|
17
14
|
const [title, setTitle] = useState(name);
|
|
18
15
|
const [isURL, _icon] = usePolyFillIcon(icon);
|
|
19
16
|
const patchIconUrl = usePatchIconUrl();
|
|
20
17
|
const NoItemTypeIcon = useMemo(() => patchIconUrl(NoItemTypeIconUrl), [patchIconUrl]);
|
|
21
|
-
return (
|
|
18
|
+
return (jsx(Tooltip, { title: title, children: jsx(ClassNames, { children: ({ cx, css }) => {
|
|
22
19
|
var _a;
|
|
23
|
-
return isURL ? (
|
|
20
|
+
return isURL ? (jsx("img", { src: (_a = patchIconUrl(icon)) !== null && _a !== void 0 ? _a : NoItemTypeIcon, onError: e => {
|
|
24
21
|
const target = e.target;
|
|
25
22
|
icon
|
|
26
23
|
? setTitle(t('pages.fields.default.getImageError'))
|
|
27
24
|
: setTitle(t('pages.fields.default.noItemType'));
|
|
28
25
|
target.onerror = null;
|
|
29
26
|
target.src = NoItemTypeIcon;
|
|
30
|
-
}, className: cx(css(nameItemTypeImg), className) })) : isBase64Img(icon) ? (
|
|
27
|
+
}, className: cx(css(nameItemTypeImg), className) })) : isBase64Img(icon) ? (jsx("img", { src: icon, className: cx(css(nameItemTypeImg), className) })) : (jsx(CustomIconFont, { type: _icon, className: cx(css(nameItemTypeImg), className) }));
|
|
31
28
|
} }) }));
|
|
32
29
|
};
|
|
33
|
-
|
|
30
|
+
|
|
31
|
+
export { ItemTypeIcon, NoItemTypeIconUrl, ItemTypeIcon as default };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx, Fragment } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import { memo } from 'react';
|
|
3
|
-
import EmptyField from '../../common/EmptyField';
|
|
4
|
-
import SimpleOverflowToolTip from '../../common/overflow-tooltip/SimpleOverflowToolTip';
|
|
3
|
+
import EmptyField from '../../common/EmptyField.js';
|
|
4
|
+
import SimpleOverflowToolTip from '../../common/overflow-tooltip/SimpleOverflowToolTip.js';
|
|
5
|
+
|
|
5
6
|
const ItemTypeReadView = memo(({ value }) => {
|
|
6
|
-
return (
|
|
7
|
+
return (jsx(Fragment, { children: (value === null || value === void 0 ? void 0 : value.name) ? (jsx(SimpleOverflowToolTip, { title: value.name, children: value.name })) : (jsx(EmptyField, { readonly: true })) }));
|
|
7
8
|
});
|
|
8
9
|
ItemTypeReadView.displayName = 'ItemTypeReadView';
|
|
9
|
-
|
|
10
|
+
|
|
11
|
+
export { ItemTypeReadView as default };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import { memo } from 'react';
|
|
3
|
-
import EmptyField from '../../common/EmptyField';
|
|
4
|
-
import SimpleOverflowToolTip from '../../common/overflow-tooltip/SimpleOverflowToolTip';
|
|
3
|
+
import EmptyField from '../../common/EmptyField.js';
|
|
4
|
+
import SimpleOverflowToolTip from '../../common/overflow-tooltip/SimpleOverflowToolTip.js';
|
|
5
|
+
|
|
5
6
|
const KeyReadView = memo(({ value }) => {
|
|
6
|
-
return value ?
|
|
7
|
+
return value ? jsx(SimpleOverflowToolTip, { title: value, children: value }) : jsx(EmptyField, { readonly: true });
|
|
7
8
|
});
|
|
8
9
|
KeyReadView.displayName = 'KeyReadView';
|
|
9
|
-
|
|
10
|
+
|
|
11
|
+
export { KeyReadView as default };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx, Fragment } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
-
import EmptyField from '../../common/EmptyField';
|
|
5
|
-
import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip';
|
|
6
|
-
import { whiteSpacePreStyle } from './style';
|
|
4
|
+
import EmptyField from '../../common/EmptyField.js';
|
|
5
|
+
import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip.js';
|
|
6
|
+
import { whiteSpacePreStyle } from './style/index.js';
|
|
7
|
+
|
|
7
8
|
const LongTextReadView = memo(({ value, readonly }) => {
|
|
8
|
-
return (
|
|
9
|
+
return (jsx(Fragment, { children: value ? (jsx(BaseOverflowTooltip, { maxline: 1, children: jsx("span", { css: css(whiteSpacePreStyle), dangerouslySetInnerHTML: { __html: value } }) })) : (jsx(EmptyField, { readonly: readonly })) }));
|
|
9
10
|
});
|
|
10
11
|
LongTextReadView.displayName = 'LongTextReadView';
|
|
11
|
-
|
|
12
|
+
|
|
13
|
+
export { LongTextReadView as default };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { numberPrecisionInit } from '../../../lib/number';
|
|
2
|
-
|
|
1
|
+
import { numberPrecisionInit } from '../../../lib/number.js';
|
|
2
|
+
|
|
3
|
+
const numberFixed = (type, val, precision) => {
|
|
3
4
|
return type === 'int' ? numberPrecisionInit(val, 0) : numberPrecisionInit(val, precision).toFixed(precision);
|
|
4
5
|
};
|
|
6
|
+
|
|
7
|
+
export { numberFixed };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { jsxs, Fragment, jsx } from '@emotion/react/jsx-runtime';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
3
|
import { isNil } from 'lodash-es';
|
|
4
|
-
import EmptyField from '../../common/EmptyField';
|
|
5
|
-
import { numberFixed } from './BaseField';
|
|
4
|
+
import EmptyField from '../../common/EmptyField.js';
|
|
5
|
+
import { numberFixed } from './BaseField.js';
|
|
6
|
+
|
|
6
7
|
const NumberReadView = props => {
|
|
7
8
|
const { value: propsValue, readonly, type, precision, addonBefore, addonAfter } = props;
|
|
8
9
|
const [showValue, setShowValue] = useState(null);
|
|
@@ -15,7 +16,8 @@ const NumberReadView = props => {
|
|
|
15
16
|
setShowValue(undefined);
|
|
16
17
|
}
|
|
17
18
|
}, [propsValue, precision, type]);
|
|
18
|
-
return !isNil(showValue) ? (
|
|
19
|
+
return !isNil(showValue) ? (jsxs(Fragment, { children: [addonBefore, showValue, addonAfter] })) : (jsx(EmptyField, { readonly: readonly }));
|
|
19
20
|
};
|
|
20
21
|
NumberReadView.displayName = 'NumberReadView';
|
|
21
|
-
|
|
22
|
+
|
|
23
|
+
export { NumberReadView as default };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { memo,
|
|
1
|
+
import { jsx, Fragment, jsxs } from '@emotion/react/jsx-runtime';
|
|
2
|
+
import { memo, useMemo, useCallback } from 'react';
|
|
3
3
|
import { CaretDownOutlined } from '@ant-design/icons';
|
|
4
4
|
import { css } from '@emotion/react';
|
|
5
|
-
import {
|
|
6
|
-
import useAntdConfig from '../../../lib/hooks/useAntdConfig';
|
|
7
|
-
import useI18n from '../../../lib/hooks/useI18n';
|
|
8
|
-
import EmptyField from '../../common/EmptyField';
|
|
9
|
-
import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip';
|
|
10
|
-
import { cellBoxStyle, colorIconStyle, downIconStyle,
|
|
5
|
+
import { HollowCircleIcon, DottedCircleIcon } from '../../../icons/index.js';
|
|
6
|
+
import useAntdConfig from '../../../lib/hooks/useAntdConfig.js';
|
|
7
|
+
import useI18n from '../../../lib/hooks/useI18n.js';
|
|
8
|
+
import EmptyField from '../../common/EmptyField.js';
|
|
9
|
+
import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip.js';
|
|
10
|
+
import { cellBoxStyle, headerCellStyle, colorIconStyle, downIconStyle, emptyTextStyle, emptyStyle, emptyIconStyle } from './style/index.js';
|
|
11
|
+
|
|
11
12
|
const PriorityReadView = memo(({ value, options, readonly, apply }) => {
|
|
12
13
|
const { t } = useI18n();
|
|
13
14
|
const { antPrefix } = useAntdConfig();
|
|
@@ -18,7 +19,8 @@ const PriorityReadView = memo(({ value, options, readonly, apply }) => {
|
|
|
18
19
|
});
|
|
19
20
|
}, []);
|
|
20
21
|
const showData = useMemo(() => { var _a; return (_a = filterData(options, value)) === null || _a === void 0 ? void 0 : _a[0]; }, [filterData, options, value]);
|
|
21
|
-
return (
|
|
22
|
+
return (jsx(Fragment, { children: showData ? (jsxs("div", { css: css(cellBoxStyle(antPrefix), isFromHeader && headerCellStyle), children: [jsx(HollowCircleIcon, { css: css(colorIconStyle), style: { color: showData.color } }), jsx(BaseOverflowTooltip, { title: showData.name, children: showData.name }), isFromHeader && jsx(CaretDownOutlined, { css: css(downIconStyle) })] })) : !isFromHeader ? (jsx("div", { css: css(emptyTextStyle), children: jsx(EmptyField, { readonly: readonly }) })) : (jsxs("div", { css: css(emptyStyle), children: [jsx(DottedCircleIcon, { css: css(emptyIconStyle) }), t('pages.fields.view.noPriority')] })) }));
|
|
22
23
|
});
|
|
23
24
|
PriorityReadView.displayName = 'PriorityReadView';
|
|
24
|
-
|
|
25
|
+
|
|
26
|
+
export { PriorityReadView as default };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { fieldLabelColor } from '../../../../style/common';
|
|
2
|
-
|
|
1
|
+
import { fieldLabelColor } from '../../../../style/common.js';
|
|
2
|
+
|
|
3
|
+
const cellBoxStyle = (antPrefix) => `
|
|
3
4
|
display: flex;
|
|
4
5
|
align-items: center;
|
|
5
6
|
line-height: unset;
|
|
@@ -18,7 +19,7 @@ export const cellBoxStyle = (antPrefix) => `
|
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
`;
|
|
21
|
-
|
|
22
|
+
const headerCellStyle = `
|
|
22
23
|
max-width: 120px;
|
|
23
24
|
height: 24px;
|
|
24
25
|
padding: 0 8px;
|
|
@@ -30,29 +31,31 @@ export const headerCellStyle = `
|
|
|
30
31
|
background-color: #f5f6f8;
|
|
31
32
|
border-radius: 4px;
|
|
32
33
|
`;
|
|
33
|
-
|
|
34
|
+
const emptyTextStyle = `
|
|
34
35
|
display: flex;
|
|
35
36
|
align-items: center;
|
|
36
37
|
width: 100%;
|
|
37
38
|
height: 100%;
|
|
38
39
|
`;
|
|
39
|
-
|
|
40
|
+
const colorIconStyle = `
|
|
40
41
|
margin-right: 5px;
|
|
41
42
|
font-size: 12px;
|
|
42
43
|
`;
|
|
43
|
-
|
|
44
|
+
const emptyStyle = `
|
|
44
45
|
color: ${fieldLabelColor};
|
|
45
46
|
`;
|
|
46
|
-
|
|
47
|
+
const emptyIconStyle = `
|
|
47
48
|
margin-right: 5px;
|
|
48
49
|
font-size: 12px!important;
|
|
49
50
|
width: 12px!important;
|
|
50
51
|
margin-left: 0!important;
|
|
51
52
|
`;
|
|
52
|
-
|
|
53
|
+
const downIconStyle = `
|
|
53
54
|
margin-left: 2px;
|
|
54
55
|
|
|
55
56
|
svg {
|
|
56
57
|
vertical-align: inherit;
|
|
57
58
|
}
|
|
58
59
|
`;
|
|
60
|
+
|
|
61
|
+
export { cellBoxStyle, colorIconStyle, downIconStyle, emptyIconStyle, emptyStyle, emptyTextStyle, headerCellStyle };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import { memo, useMemo } from 'react';
|
|
3
|
-
import EmptyField from '../../common/EmptyField';
|
|
4
|
-
import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip';
|
|
3
|
+
import EmptyField from '../../common/EmptyField.js';
|
|
4
|
+
import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip.js';
|
|
5
|
+
|
|
5
6
|
const RadioReadView = memo(({ options, value }) => {
|
|
6
7
|
const showValue = useMemo(() => {
|
|
7
8
|
var _a;
|
|
@@ -11,9 +12,10 @@ const RadioReadView = memo(({ options, value }) => {
|
|
|
11
12
|
return (_a = valueFilter[0]) === null || _a === void 0 ? void 0 : _a.label;
|
|
12
13
|
}, [value, options]);
|
|
13
14
|
if (!showValue) {
|
|
14
|
-
return
|
|
15
|
+
return jsx(EmptyField, { readonly: true });
|
|
15
16
|
}
|
|
16
|
-
return
|
|
17
|
+
return jsx(BaseOverflowTooltip, { title: showValue, children: showValue });
|
|
17
18
|
});
|
|
18
19
|
RadioReadView.displayName = 'RadioReadView';
|
|
19
|
-
|
|
20
|
+
|
|
21
|
+
export { RadioReadView as default };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import EmptyField from '../../common/EmptyField';
|
|
3
|
-
import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip';
|
|
4
|
-
import { formatDisplayValue } from './utils';
|
|
1
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
2
|
+
import EmptyField from '../../common/EmptyField.js';
|
|
3
|
+
import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip.js';
|
|
4
|
+
import { formatDisplayValue } from './utils.js';
|
|
5
|
+
|
|
5
6
|
const RepoFileReadView = props => {
|
|
6
7
|
const { value, readonly } = props;
|
|
7
8
|
const displayValue = formatDisplayValue(value);
|
|
8
|
-
return (
|
|
9
|
+
return (jsx("div", { className: "field-cell-layout", children: displayValue ? (jsx(BaseOverflowTooltip, { title: displayValue, children: displayValue })) : (jsx(EmptyField, { readonly: readonly })) }));
|
|
9
10
|
};
|
|
10
11
|
RepoFileReadView.displayName = 'RepoFileReadView';
|
|
11
|
-
|
|
12
|
+
|
|
13
|
+
export { RepoFileReadView as default };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
const getFullName = (value) => {
|
|
2
2
|
const fullPath = getFullPath(value);
|
|
3
3
|
if (!fullPath)
|
|
4
4
|
return value === null || value === void 0 ? void 0 : value.name;
|
|
5
5
|
return `${fullPath}/${value === null || value === void 0 ? void 0 : value.name}`;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
const formatDisplayValue = (value) => {
|
|
8
8
|
const values = (Array.isArray(value) ? value : [value]).map(item => getFullName(item)).filter(Boolean);
|
|
9
9
|
return values.join('、');
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
const getFullPath = (value) => {
|
|
12
12
|
const { repo, path } = value || {};
|
|
13
13
|
let fullPath = repo;
|
|
14
14
|
if (path) {
|
|
@@ -16,3 +16,5 @@ export const getFullPath = (value) => {
|
|
|
16
16
|
}
|
|
17
17
|
return fullPath;
|
|
18
18
|
};
|
|
19
|
+
|
|
20
|
+
export { formatDisplayValue, getFullName, getFullPath };
|