@giteeteam/apps-team-components 1.2.2 → 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/README.md +21 -28
- package/dist/components/common/EmptyField.d.ts +0 -1
- package/dist/components/common/EmptyField.js +7 -5
- package/dist/components/common/PriceTag.js +26 -23
- package/dist/components/common/expand-component/index.d.ts +22 -0
- package/dist/components/common/expand-component/index.js +67 -0
- package/dist/components/common/expand-component/style.d.ts +2 -0
- package/dist/components/common/expand-component/style.js +10 -0
- package/dist/components/common/item-icon/ItemIcon.d.ts +7 -0
- package/dist/components/common/item-icon/ItemIcon.js +8 -0
- 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.d.ts +19 -0
- package/dist/components/common/overflow-tooltip/OverflowTooltip.js +57 -0
- package/dist/components/common/overflow-tooltip/SimpleOverflowToolTip.js +8 -5
- package/dist/components/common/overflow-tooltip/style/index.js +16 -14
- package/dist/components/common/style/global.js +4 -2
- package/dist/components/common/style/mixin.d.ts +2 -0
- package/dist/components/common/style/mixin.js +20 -0
- package/dist/components/common/user-field/UserAvatar.js +8 -6
- package/dist/components/common/user-field/style/index.js +23 -21
- package/dist/components/common/utils.d.ts +6 -0
- package/dist/components/common/utils.js +63 -5
- package/dist/components/default-empty-icon/config.d.ts +2 -0
- package/dist/components/default-empty-icon/config.js +24 -0
- package/dist/components/default-empty-icon/index.d.ts +5 -0
- package/dist/components/default-empty-icon/index.js +24 -0
- package/dist/components/default-empty-icon/style.d.ts +11 -0
- package/dist/components/default-empty-icon/style.js +67 -0
- package/dist/components/default-empty-icon/types.d.ts +29 -0
- package/dist/components/default-empty-icon/types.js +8 -0
- 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/types.d.ts +1 -0
- package/dist/components/fields/base-component/utils.d.ts +2 -0
- package/dist/components/fields/base-component/utils.js +11 -0
- 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 +10 -7
- package/dist/components/fields/bind-workspace/style/index.js +5 -3
- 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.d.ts +24 -2
- package/dist/components/fields/dropdown/BaseField.js +565 -2
- package/dist/components/fields/dropdown/Cell.d.ts +3 -0
- package/dist/components/fields/dropdown/Cell.js +8 -0
- 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 +9 -0
- package/dist/components/fields/dropdown/data.js +29 -0
- package/dist/components/fields/dropdown/hook.d.ts +102 -0
- package/dist/components/fields/dropdown/hook.js +155 -0
- package/dist/components/fields/dropdown/style.d.ts +16 -0
- package/dist/components/fields/dropdown/style.js +93 -0
- 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.d.ts +11 -0
- package/dist/components/fields/hooks/useViewClass.js +20 -0
- 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 +18 -15
- 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.d.ts +9 -0
- package/dist/components/fields/item-type/ItemTypeIcon.js +31 -0
- 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.d.ts +1 -0
- package/dist/components/fields/item-type/style/index.js +8 -0
- 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 +7 -5
- 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 +54 -51
- 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 +302 -325
- 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 +7 -5
- package/dist/components/fields/team/ReadView.js +10 -8
- package/dist/components/fields/team/style/index.js +5 -3
- 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 +12 -9
- package/dist/components/fields/user-group/BaseField.d.ts +0 -1
- package/dist/components/fields/user-group/ReadView.js +12 -14
- 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.d.ts +4 -0
- package/dist/components/filters/filter-search/utils.js +28 -0
- package/dist/components/item/hooks.js +5 -2
- package/dist/components/table-components/EditTableCell.d.ts +1 -0
- package/dist/components/table-components/EditTableCell.js +8 -4
- package/dist/components/table-components/index.js +14 -11
- package/dist/components/table-components/style/index.js +7 -5
- package/dist/components/table-components/utils.js +50 -45
- package/dist/icons/SyncIconFont.d.ts +6 -0
- package/dist/icons/SyncIconFont.js +17 -0
- package/dist/icons/createFromIconFontClass.d.ts +4 -0
- package/dist/icons/createFromIconFontClass.js +35 -0
- package/dist/icons/empty-icon/data-empty.png +0 -0
- package/dist/icons/empty-icon/forbidden.png +0 -0
- package/dist/icons/empty-icon/index.d.ts +8 -0
- package/dist/icons/empty-icon/large-item@2x.png +0 -0
- package/dist/icons/empty-icon/large-item@2x.png.js +3 -0
- package/dist/icons/empty-icon/large-workspace@2x.png +0 -0
- package/dist/icons/empty-icon/large-workspace@2x.png.js +3 -0
- package/dist/icons/empty-icon/load-error.png +0 -0
- package/dist/icons/empty-icon/not-found.png +0 -0
- package/dist/icons/empty-icon/small-default@2x.png +0 -0
- package/dist/icons/empty-icon/small-default@2x.png.js +3 -0
- package/dist/icons/empty-icon/workspace-empty.svg +127 -0
- package/dist/icons/index.d.ts +58 -1
- package/dist/icons/index.js +315 -19
- package/dist/icons/style/index.d.ts +2 -0
- package/dist/icons/style/index.js +25 -0
- 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.d.ts +1 -0
- package/dist/index.js +47 -46
- package/dist/lib/app/utils.d.ts +2 -0
- package/dist/lib/app/utils.js +18 -0
- package/dist/lib/array.js +5 -44
- package/dist/lib/config.d.ts +14 -0
- package/dist/lib/config.js +47 -0
- package/dist/lib/constants/code.d.ts +4 -0
- package/dist/lib/constants/code.js +6 -0
- package/dist/lib/constants/field.d.ts +1 -0
- package/dist/lib/constants/field.js +5 -0
- 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.d.ts +3 -0
- package/dist/lib/contexts/teamConfig.js +25 -7
- 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/index.d.ts +2 -0
- package/dist/lib/error/log.d.ts +10 -0
- package/dist/lib/error/log.js +28 -0
- package/dist/lib/error/utils.d.ts +14 -0
- package/dist/lib/error/utils.js +38 -0
- package/dist/lib/error/withServerError.d.ts +1 -0
- package/dist/lib/error/withServerError.js +3 -0
- package/dist/lib/fetch.d.ts +45 -0
- package/dist/lib/fetch.js +270 -0
- package/dist/lib/global.d.ts +18 -0
- package/dist/lib/global.js +28 -8
- 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.d.ts +1 -0
- package/dist/lib/i18n.js +6 -2
- package/dist/lib/icons/utils.d.ts +23 -0
- package/dist/lib/icons/utils.js +60 -0
- package/dist/lib/isInOne.js +2 -1
- package/dist/lib/number.js +3 -1
- package/dist/lib/path.d.ts +5 -0
- package/dist/lib/path.js +50 -0
- package/dist/lib/regExp.js +3 -1
- package/dist/lib/router.d.ts +23 -0
- package/dist/lib/router.js +23 -0
- package/dist/lib/storage.d.ts +10 -0
- package/dist/lib/storage.js +27 -0
- 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.d.ts +17 -0
- package/dist/lib/swr/throttleWithCache.js +110 -0
- package/dist/lib/throttleFetch.d.ts +2 -0
- package/dist/lib/throttleFetch.js +68 -0
- package/dist/lib/useConfig.d.ts +8 -0
- package/dist/lib/useConfig.js +31 -0
- 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.d.ts +45 -0
- package/dist/locales/index.js +50 -3
- package/dist/public/icons/BulbIcon.svg +1 -0
- package/dist/public/icons/Cloud.svg +1 -0
- package/dist/public/icons/ConsultIcon.svg +1 -0
- package/dist/public/icons/Demo.svg +1 -0
- package/dist/public/icons/ErrorTemplate.svg +1 -0
- package/dist/public/icons/Fail.svg +1 -0
- package/dist/public/icons/Flag.svg +1 -0
- package/dist/public/icons/GiteeIcon.svg +1 -0
- package/dist/public/icons/IntelligenceGradient.svg +1 -0
- package/dist/public/icons/Issue_Approval.svg +1 -0
- package/dist/public/icons/Issue_Bug.svg +1 -0
- package/dist/public/icons/Issue_Demand.svg +1 -0
- package/dist/public/icons/Issue_Doc.svg +1 -0
- package/dist/public/icons/Issue_Idea.svg +1 -0
- package/dist/public/icons/Issue_List.svg +1 -0
- package/dist/public/icons/Issue_Plan.svg +1 -0
- package/dist/public/icons/Issue_Product.svg +1 -0
- package/dist/public/icons/Issue_Risk.svg +1 -0
- package/dist/public/icons/Issue_Story.svg +1 -0
- package/dist/public/icons/Issue_Subtask.svg +1 -0
- package/dist/public/icons/Issue_Task.svg +1 -0
- package/dist/public/icons/Issue_Test.svg +1 -0
- package/dist/public/icons/Issue_TestExcution.svg +1 -0
- package/dist/public/icons/Issue_TestPlan.svg +1 -0
- package/dist/public/icons/Issue_Time.svg +1 -0
- package/dist/public/icons/Issue_develop.svg +1 -0
- package/dist/public/icons/KanbanCover.svg +7 -0
- package/dist/public/icons/ListCover.svg +118 -0
- package/dist/public/icons/ManHour.svg +1 -0
- package/dist/public/icons/MobileIcon.svg +1 -0
- package/dist/public/icons/NoItemType.svg +10 -0
- package/dist/public/icons/ProductIcon.svg +1 -0
- package/dist/public/icons/RedFlagIcon.svg +1 -0
- package/dist/public/icons/Safe.svg +1 -0
- package/dist/public/icons/StarIcon.svg +61 -0
- package/dist/public/icons/StructureCover.svg +1 -0
- package/dist/public/icons/Success.svg +1 -0
- package/dist/public/icons/TeamIcon.svg +1 -0
- package/dist/public/icons/WebIcon.svg +1 -0
- package/dist/public/icons/iconfont.svg +467 -0
- package/dist/public/icons/iconfont.ttf +0 -0
- package/dist/public/icons/iconfont.woff +0 -0
- package/dist/public/icons/iconfont.woff2 +0 -0
- package/dist/public/icons/iconfont_multiple_color.js +1 -0
- package/dist/public/icons/iconfont_single_color.css +912 -0
- package/dist/public/icons/iconfont_single_color.js +1 -0
- package/dist/public/icons/loginBg.svg +1 -0
- package/dist/public/mockServiceWorker.js +284 -0
- package/dist/style/common.d.ts +1 -0
- package/dist/style/common.js +19 -23
- package/dist/style/global.d.ts +1 -0
- package/dist/style/global.js +10 -0
- package/package.json +111 -69
- 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/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
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
2
|
+
import { useState, useMemo } from 'react';
|
|
3
|
+
import { ClassNames } from '@emotion/react';
|
|
4
|
+
import { Tooltip } from 'antd';
|
|
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, }) => {
|
|
13
|
+
const { t } = useI18n();
|
|
14
|
+
const [title, setTitle] = useState(name);
|
|
15
|
+
const [isURL, _icon] = usePolyFillIcon(icon);
|
|
16
|
+
const patchIconUrl = usePatchIconUrl();
|
|
17
|
+
const NoItemTypeIcon = useMemo(() => patchIconUrl(NoItemTypeIconUrl), [patchIconUrl]);
|
|
18
|
+
return (jsx(Tooltip, { title: title, children: jsx(ClassNames, { children: ({ cx, css }) => {
|
|
19
|
+
var _a;
|
|
20
|
+
return isURL ? (jsx("img", { src: (_a = patchIconUrl(icon)) !== null && _a !== void 0 ? _a : NoItemTypeIcon, onError: e => {
|
|
21
|
+
const target = e.target;
|
|
22
|
+
icon
|
|
23
|
+
? setTitle(t('pages.fields.default.getImageError'))
|
|
24
|
+
: setTitle(t('pages.fields.default.noItemType'));
|
|
25
|
+
target.onerror = null;
|
|
26
|
+
target.src = NoItemTypeIcon;
|
|
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) }));
|
|
28
|
+
} }) }));
|
|
29
|
+
};
|
|
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 };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const nameItemTypeImg = "\n width: 16px;\n height: 16px;\n margin-right: 8px;\n font-size: 16px;\n";
|
|
@@ -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
|
|
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,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
padding-top: 5px;
|
|
3
|
-
padding-bottom: 5px;
|
|
4
|
-
word-break: break-all;
|
|
5
|
-
white-space: pre-wrap;
|
|
1
|
+
const whiteSpacePreStyle = `
|
|
2
|
+
padding-top: 5px;
|
|
3
|
+
padding-bottom: 5px;
|
|
4
|
+
word-break: break-all;
|
|
5
|
+
white-space: pre-wrap;
|
|
6
6
|
`;
|
|
7
|
+
|
|
8
|
+
export { whiteSpacePreStyle };
|
|
@@ -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,58 +1,61 @@
|
|
|
1
|
-
import { fieldLabelColor } from '../../../../style/common';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { fieldLabelColor } from '../../../../style/common.js';
|
|
2
|
+
|
|
3
|
+
const cellBoxStyle = (antPrefix) => `
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
line-height: unset;
|
|
7
|
+
|
|
8
|
+
.${antPrefix}-dropdown-menu-title-content {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
max-width: 150px;
|
|
12
|
+
|
|
13
|
+
.anticon {
|
|
14
|
+
flex-shrink: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
& > span {
|
|
18
|
+
white-space: pre-line;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
20
21
|
`;
|
|
21
|
-
|
|
22
|
-
max-width: 120px;
|
|
23
|
-
height: 24px;
|
|
24
|
-
padding: 0 8px;
|
|
25
|
-
font-size: 12px;
|
|
26
|
-
font-weight: 600;
|
|
27
|
-
line-height: 24px;
|
|
28
|
-
color: #213053;
|
|
29
|
-
text-align: center;
|
|
30
|
-
background-color: #f5f6f8;
|
|
31
|
-
border-radius: 4px;
|
|
22
|
+
const headerCellStyle = `
|
|
23
|
+
max-width: 120px;
|
|
24
|
+
height: 24px;
|
|
25
|
+
padding: 0 8px;
|
|
26
|
+
font-size: 12px;
|
|
27
|
+
font-weight: 600;
|
|
28
|
+
line-height: 24px;
|
|
29
|
+
color: #213053;
|
|
30
|
+
text-align: center;
|
|
31
|
+
background-color: #f5f6f8;
|
|
32
|
+
border-radius: 4px;
|
|
32
33
|
`;
|
|
33
|
-
|
|
34
|
-
display: flex;
|
|
35
|
-
align-items: center;
|
|
36
|
-
width: 100%;
|
|
37
|
-
height: 100%;
|
|
34
|
+
const emptyTextStyle = `
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
width: 100%;
|
|
38
|
+
height: 100%;
|
|
38
39
|
`;
|
|
39
|
-
|
|
40
|
-
margin-right: 5px;
|
|
41
|
-
font-size: 12px;
|
|
40
|
+
const colorIconStyle = `
|
|
41
|
+
margin-right: 5px;
|
|
42
|
+
font-size: 12px;
|
|
42
43
|
`;
|
|
43
|
-
|
|
44
|
-
color: ${fieldLabelColor};
|
|
44
|
+
const emptyStyle = `
|
|
45
|
+
color: ${fieldLabelColor};
|
|
45
46
|
`;
|
|
46
|
-
|
|
47
|
-
margin-right: 5px;
|
|
48
|
-
font-size: 12px!important;
|
|
49
|
-
width: 12px!important;
|
|
50
|
-
margin-left: 0!important;
|
|
47
|
+
const emptyIconStyle = `
|
|
48
|
+
margin-right: 5px;
|
|
49
|
+
font-size: 12px!important;
|
|
50
|
+
width: 12px!important;
|
|
51
|
+
margin-left: 0!important;
|
|
51
52
|
`;
|
|
52
|
-
|
|
53
|
-
margin-left: 2px;
|
|
54
|
-
|
|
55
|
-
svg {
|
|
56
|
-
vertical-align: inherit;
|
|
57
|
-
}
|
|
53
|
+
const downIconStyle = `
|
|
54
|
+
margin-left: 2px;
|
|
55
|
+
|
|
56
|
+
svg {
|
|
57
|
+
vertical-align: inherit;
|
|
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 };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx, jsxs } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import { memo, useMemo } from 'react';
|
|
3
3
|
import { ClassNames } from '@emotion/react';
|
|
4
|
-
import { generateUserDisplayName, isUserDeleted, isUserDisabled } from '../../../lib/useUser';
|
|
5
|
-
import EmptyField from '../../common/EmptyField';
|
|
6
|
-
import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip';
|
|
7
|
-
import UserAvatar from '../../common/user-field/UserAvatar';
|
|
8
|
-
import { userDeletedStyle, userDisabledStyle
|
|
4
|
+
import { generateUserDisplayName, isUserDeleted, isUserDisabled } from '../../../lib/useUser.js';
|
|
5
|
+
import EmptyField from '../../common/EmptyField.js';
|
|
6
|
+
import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip.js';
|
|
7
|
+
import UserAvatar from '../../common/user-field/UserAvatar.js';
|
|
8
|
+
import { usernameStyle, userDeletedStyle, userDisabledStyle } from '../user/style/index.js';
|
|
9
|
+
|
|
9
10
|
const ReporterReadView = memo(({ value, readonly }) => {
|
|
10
11
|
const showValue = useMemo(() => {
|
|
11
12
|
if (value) {
|
|
@@ -14,9 +15,10 @@ const ReporterReadView = memo(({ value, readonly }) => {
|
|
|
14
15
|
return '';
|
|
15
16
|
}, [value]);
|
|
16
17
|
if (!showValue) {
|
|
17
|
-
return
|
|
18
|
+
return jsx(EmptyField, { readonly: readonly });
|
|
18
19
|
}
|
|
19
|
-
return (
|
|
20
|
+
return (jsx(ClassNames, { children: ({ cx, css }) => (jsxs(BaseOverflowTooltip, { title: showValue, maxline: 1, children: [jsx(UserAvatar, { user: value }), jsx("span", { className: cx(css(usernameStyle), isUserDeleted(value) ? css(userDeletedStyle) : '', isUserDisabled(value) ? css(userDisabledStyle) : ''), children: showValue })] })) }));
|
|
20
21
|
});
|
|
21
22
|
ReporterReadView.displayName = 'ReporterReadView';
|
|
22
|
-
|
|
23
|
+
|
|
24
|
+
export { ReporterReadView as default };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { template } from 'lodash-es';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
const translateScript = (script, item) => {
|
|
3
4
|
const result = {};
|
|
4
5
|
try {
|
|
5
6
|
const data = new Function(template(script)({ item }));
|
|
@@ -10,3 +11,5 @@ export const translateScript = (script, item) => {
|
|
|
10
11
|
}
|
|
11
12
|
return result;
|
|
12
13
|
};
|
|
14
|
+
|
|
15
|
+
export { translateScript };
|
|
@@ -1,21 +1,23 @@
|
|
|
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 { translateScript } from './BaseField';
|
|
3
|
+
import EmptyField from '../../common/EmptyField.js';
|
|
4
|
+
import { translateScript } from './BaseField.js';
|
|
5
|
+
|
|
5
6
|
const ScriptReadView = memo(({ script, itemValues: item }) => {
|
|
6
7
|
const showValue = useMemo(() => {
|
|
7
8
|
if (script && item) {
|
|
8
9
|
const { data, error } = translateScript(script, item);
|
|
9
10
|
if (!error)
|
|
10
|
-
return
|
|
11
|
-
return
|
|
11
|
+
return jsx("div", { dangerouslySetInnerHTML: { __html: data } });
|
|
12
|
+
return jsx("div", { children: error });
|
|
12
13
|
}
|
|
13
14
|
return '';
|
|
14
15
|
}, [script, item]);
|
|
15
16
|
if (!showValue) {
|
|
16
|
-
return
|
|
17
|
+
return jsx(EmptyField, {});
|
|
17
18
|
}
|
|
18
|
-
return
|
|
19
|
+
return jsx(Fragment, { children: showValue });
|
|
19
20
|
});
|
|
20
21
|
ScriptReadView.displayName = 'ScriptReadView';
|
|
21
|
-
|
|
22
|
+
|
|
23
|
+
export { ScriptReadView as default };
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx, Fragment } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
|
-
import EmptyField from '../../common/EmptyField';
|
|
3
|
+
import EmptyField from '../../common/EmptyField.js';
|
|
4
|
+
|
|
4
5
|
const SprintReadView = ({ value, readonly }) => {
|
|
5
6
|
const showValue = useMemo(() => { var _a; return (_a = value === null || value === void 0 ? void 0 : value.map(sprint => sprint.name)) === null || _a === void 0 ? void 0 : _a.join(','); }, [value]);
|
|
6
7
|
if (!showValue) {
|
|
7
|
-
return
|
|
8
|
+
return jsx(EmptyField, { readonly: readonly });
|
|
8
9
|
}
|
|
9
|
-
return
|
|
10
|
+
return jsx(Fragment, { children: showValue });
|
|
10
11
|
};
|
|
11
12
|
SprintReadView.displayName = 'SprintReadView';
|
|
12
|
-
|
|
13
|
+
|
|
14
|
+
export { SprintReadView as default };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import React, {
|
|
3
|
-
import
|
|
4
|
-
import Transition from './Transition';
|
|
1
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
2
|
+
import React, { useState, useEffect, useCallback } from 'react';
|
|
3
|
+
import StatusReadView from './ReadView.js';
|
|
4
|
+
import Transition from './Transition.js';
|
|
5
|
+
|
|
5
6
|
const StatusCell = React.memo(props => {
|
|
6
7
|
const { overlayClsName = '', itemId, readonly, value, workspaceId, itemTypeId, onChange } = props;
|
|
7
8
|
const [showData, setShowData] = useState(value);
|
|
@@ -12,7 +13,8 @@ const StatusCell = React.memo(props => {
|
|
|
12
13
|
setShowData({ objectId, name, type });
|
|
13
14
|
onChange === null || onChange === void 0 ? void 0 : onChange({ objectId, name, type });
|
|
14
15
|
}, [onChange]);
|
|
15
|
-
return (
|
|
16
|
+
return (jsx("div", { className: `${overlayClsName} field-cell-layout field-layout ${!readonly ? 'pointer' : ''}`, children: readonly ? (jsx(StatusReadView, { value: showData, readonly: true })) : (jsx(Transition, { itemId: itemId, ...showData, ...(props.flowHandler || {}), apply: "cell", workspace: workspaceId, itemType: itemTypeId, onTransitionSuccess: handleChange })) }));
|
|
16
17
|
});
|
|
17
18
|
StatusCell.displayName = 'StatusCell';
|
|
18
|
-
|
|
19
|
+
|
|
20
|
+
export { StatusCell as default };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
-
import { WorkFlowStatusColor } from '../../../lib/global';
|
|
5
|
-
import EmptyField from '../../common/EmptyField';
|
|
6
|
-
import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip';
|
|
7
|
-
import { readViewWrapper } from './style';
|
|
4
|
+
import { WorkFlowStatusColor } from '../../../lib/global.js';
|
|
5
|
+
import EmptyField from '../../common/EmptyField.js';
|
|
6
|
+
import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip.js';
|
|
7
|
+
import { readViewWrapper } from './style/index.js';
|
|
8
|
+
|
|
8
9
|
const StatusReadView = React.memo(({ value: showData, readonly }) => {
|
|
9
10
|
const showValue = useMemo(() => showData === null || showData === void 0 ? void 0 : showData.name, [showData]);
|
|
10
11
|
const style = useMemo(() => {
|
|
@@ -15,9 +16,10 @@ const StatusReadView = React.memo(({ value: showData, readonly }) => {
|
|
|
15
16
|
};
|
|
16
17
|
}, [showData === null || showData === void 0 ? void 0 : showData.type]);
|
|
17
18
|
if (!showValue) {
|
|
18
|
-
return
|
|
19
|
+
return jsx(EmptyField, { readonly: readonly });
|
|
19
20
|
}
|
|
20
|
-
return (
|
|
21
|
+
return (jsx(BaseOverflowTooltip, { style: style, title: showValue, css: css(readViewWrapper), maxline: 1, children: showValue }));
|
|
21
22
|
});
|
|
22
23
|
StatusReadView.displayName = 'StatusReadView';
|
|
23
|
-
|
|
24
|
+
|
|
25
|
+
export { StatusReadView as default };
|