@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,24 @@
|
|
|
1
|
+
import img$1 from '../../icons/empty-icon/large-item@2x.png.js';
|
|
2
|
+
import img$2 from '../../icons/empty-icon/large-workspace@2x.png.js';
|
|
3
|
+
import img from '../../icons/empty-icon/small-default@2x.png.js';
|
|
4
|
+
import { smallDefaultClass, largeItemClass, largeWorkspaceClass } from './style.js';
|
|
5
|
+
|
|
6
|
+
const config = {
|
|
7
|
+
smallDefault: {
|
|
8
|
+
text: 'views.common.searchSelect.emptyData.noData',
|
|
9
|
+
url: img,
|
|
10
|
+
className: smallDefaultClass,
|
|
11
|
+
},
|
|
12
|
+
largeItem: {
|
|
13
|
+
text: 'views.tableComponents.TableEmpty.noDataTip',
|
|
14
|
+
url: img$1,
|
|
15
|
+
className: largeItemClass,
|
|
16
|
+
},
|
|
17
|
+
largeWorkspace: {
|
|
18
|
+
text: 'pages.workspaces.default.emptyDataDefaultProps.operationInfo',
|
|
19
|
+
url: img$2,
|
|
20
|
+
className: largeWorkspaceClass,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export { config };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx, jsxs } from '@emotion/react/jsx-runtime';
|
|
2
|
+
import { ClassNames } from '@emotion/react';
|
|
3
|
+
import useI18n from '../../lib/hooks/useI18n.js';
|
|
4
|
+
import { config } from './config.js';
|
|
5
|
+
import { emptyIconWrapper, smallTextClass, smallMarginClass, largeMarginClass, noMarginClass, autoMarginClass, textClass } from './style.js';
|
|
6
|
+
import { EmptyType } from './types.js';
|
|
7
|
+
|
|
8
|
+
const EmptyIcon = ({ type = EmptyType.SMALL_DEFAULT, text, extra, className, style, center, smallText, smallMargin, largeMargin, noMargin, autoMargin, }) => {
|
|
9
|
+
const { t } = useI18n();
|
|
10
|
+
const { text: defaultText, url, className: defaultClass } = config[type] || {};
|
|
11
|
+
return (jsx(ClassNames, { children: ({ cx, css }) => (jsxs("div", { className: cx(css(emptyIconWrapper), {
|
|
12
|
+
center,
|
|
13
|
+
[smallTextClass]: smallText,
|
|
14
|
+
[smallMarginClass]: smallMargin,
|
|
15
|
+
[largeMarginClass]: largeMargin,
|
|
16
|
+
[noMarginClass]: noMargin,
|
|
17
|
+
[autoMarginClass]: autoMargin,
|
|
18
|
+
}, className), style: style, children: [jsx("img", { className: cx(defaultClass), src: url, alt: "" }), jsx("p", { className: cx(textClass), children: text || t(defaultText) }), extra] })) }));
|
|
19
|
+
};
|
|
20
|
+
EmptyIcon.defaultProps = {
|
|
21
|
+
type: EmptyType.SMALL_DEFAULT,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export { EmptyType, EmptyIcon as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const centerClass: string;
|
|
2
|
+
export declare const smallTextClass: string;
|
|
3
|
+
export declare const smallMarginClass: string;
|
|
4
|
+
export declare const textClass: string;
|
|
5
|
+
export declare const largeMarginClass: string;
|
|
6
|
+
export declare const noMarginClass: string;
|
|
7
|
+
export declare const autoMarginClass: string;
|
|
8
|
+
export declare const smallDefaultClass: string;
|
|
9
|
+
export declare const largeWorkspaceClass: string;
|
|
10
|
+
export declare const largeItemClass: string;
|
|
11
|
+
export declare const emptyIconWrapper: string;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { randomClassName } from '../../style/common.js';
|
|
2
|
+
|
|
3
|
+
const centerClass = randomClassName('center');
|
|
4
|
+
const smallTextClass = randomClassName('small-text');
|
|
5
|
+
const smallMarginClass = randomClassName('small-margin');
|
|
6
|
+
const textClass = randomClassName('text');
|
|
7
|
+
const largeMarginClass = randomClassName('large-margin');
|
|
8
|
+
const noMarginClass = randomClassName('no-margin');
|
|
9
|
+
const autoMarginClass = randomClassName('auto-margin');
|
|
10
|
+
const smallDefaultClass = randomClassName('small-default');
|
|
11
|
+
const largeWorkspaceClass = randomClassName('large-workspace');
|
|
12
|
+
const largeItemClass = randomClassName('large-item');
|
|
13
|
+
const emptyIconWrapper = `
|
|
14
|
+
margin-top: 12px;
|
|
15
|
+
text-align: center;
|
|
16
|
+
|
|
17
|
+
&.${centerClass} {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
user-select: none;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&.${smallTextClass} {
|
|
26
|
+
.${textClass} {
|
|
27
|
+
font-size: 12px;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&.${smallMarginClass} {
|
|
32
|
+
margin-top: 16px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&.${largeMarginClass} {
|
|
36
|
+
margin-top: 48px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&.${noMarginClass} {
|
|
40
|
+
margin: 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&.${autoMarginClass} {
|
|
44
|
+
margin: auto;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.${smallDefaultClass} {
|
|
48
|
+
width: 90px;
|
|
49
|
+
height: 90px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.${largeWorkspaceClass},
|
|
53
|
+
.${largeItemClass} {
|
|
54
|
+
width: 180px;
|
|
55
|
+
height: 180px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.${textClass} {
|
|
59
|
+
padding: 0;
|
|
60
|
+
margin: 12px 0;
|
|
61
|
+
font-size: 14px;
|
|
62
|
+
line-height: 22px;
|
|
63
|
+
color: #848c9f;
|
|
64
|
+
}
|
|
65
|
+
`;
|
|
66
|
+
|
|
67
|
+
export { autoMarginClass, centerClass, emptyIconWrapper, largeItemClass, largeMarginClass, largeWorkspaceClass, noMarginClass, smallDefaultClass, smallMarginClass, smallTextClass, textClass };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
export interface PropType {
|
|
3
|
+
type?: EmptyType;
|
|
4
|
+
text?: string;
|
|
5
|
+
extra?: ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: CSSProperties;
|
|
8
|
+
center?: boolean;
|
|
9
|
+
smallText?: boolean;
|
|
10
|
+
smallMargin?: boolean;
|
|
11
|
+
largeMargin?: boolean;
|
|
12
|
+
noMargin?: boolean;
|
|
13
|
+
autoMargin?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare enum EmptyType {
|
|
16
|
+
SMALL_DEFAULT = "smallDefault",
|
|
17
|
+
LARGE_ITEM = "largeItem",
|
|
18
|
+
LARGE_WS = "largeWorkspace"
|
|
19
|
+
}
|
|
20
|
+
export interface ConfigType {
|
|
21
|
+
smallDefault: ConfigItem;
|
|
22
|
+
largeItem: ConfigItem;
|
|
23
|
+
largeWorkspace: ConfigItem;
|
|
24
|
+
}
|
|
25
|
+
export interface ConfigItem {
|
|
26
|
+
text: string;
|
|
27
|
+
url: string;
|
|
28
|
+
className: string;
|
|
29
|
+
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { FIELD_TYPE_KEY_MAPPINGS } from '../../../lib/global';
|
|
2
|
-
|
|
1
|
+
import { FIELD_TYPE_KEY_MAPPINGS } from '../../../lib/global.js';
|
|
2
|
+
|
|
3
|
+
const SUPPORT_USER_KEYS = [
|
|
3
4
|
FIELD_TYPE_KEY_MAPPINGS.User,
|
|
4
5
|
FIELD_TYPE_KEY_MAPPINGS.Assignee,
|
|
5
6
|
FIELD_TYPE_KEY_MAPPINGS.Reporter,
|
|
6
7
|
];
|
|
8
|
+
|
|
9
|
+
export { SUPPORT_USER_KEYS };
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { userOptionAdapter } from '../../../lib/users';
|
|
2
|
-
|
|
1
|
+
import { userOptionAdapter } from '../../../lib/users.js';
|
|
2
|
+
|
|
3
|
+
const formatUserOption = (actorData) => {
|
|
3
4
|
const isUserData = !!(actorData === null || actorData === void 0 ? void 0 : actorData.username) && (actorData === null || actorData === void 0 ? void 0 : actorData.enabled);
|
|
4
5
|
if (isUserData)
|
|
5
6
|
return userOptionAdapter(actorData);
|
|
6
7
|
return actorData;
|
|
7
8
|
};
|
|
9
|
+
|
|
10
|
+
export { formatUserOption };
|
|
@@ -1,8 +1,9 @@
|
|
|
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';
|
|
5
|
-
import { formatUserOption } from './BaseField';
|
|
3
|
+
import EmptyField from '../../common/EmptyField.js';
|
|
4
|
+
import SimpleOverflowToolTip from '../../common/overflow-tooltip/SimpleOverflowToolTip.js';
|
|
5
|
+
import { formatUserOption } from './BaseField.js';
|
|
6
|
+
|
|
6
7
|
const ActorReadView = memo(props => {
|
|
7
8
|
const { value } = props;
|
|
8
9
|
const showValue = useMemo(() => {
|
|
@@ -24,6 +25,7 @@ const ActorReadView = memo(props => {
|
|
|
24
25
|
}
|
|
25
26
|
return '';
|
|
26
27
|
}, [value]);
|
|
27
|
-
return (
|
|
28
|
+
return (jsx(Fragment, { children: showValue ? (jsx(SimpleOverflowToolTip, { title: showValue, children: showValue })) : (jsx(EmptyField, { readonly: true })) }));
|
|
28
29
|
});
|
|
29
|
-
|
|
30
|
+
|
|
31
|
+
export { ActorReadView 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, Fragment } 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 AncestorReadView = props => {
|
|
6
7
|
const { value, readonly } = props;
|
|
7
8
|
const displayValue = formatDisplayValue(value);
|
|
8
|
-
return (
|
|
9
|
+
return (jsx(Fragment, { children: displayValue ? (jsx(BaseOverflowTooltip, { title: displayValue, children: displayValue })) : (jsx(EmptyField, { readonly: readonly })) }));
|
|
9
10
|
};
|
|
10
11
|
AncestorReadView.displayName = 'AncestorReadView';
|
|
11
|
-
|
|
12
|
+
|
|
13
|
+
export { AncestorReadView as default };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import debug from 'debug';
|
|
2
|
+
|
|
2
3
|
const logger = debug('fields:ancestor:utils');
|
|
3
|
-
|
|
4
|
+
const formatDisplayValue = (value) => {
|
|
4
5
|
logger('formatDisplayValue', value);
|
|
5
6
|
if (!value)
|
|
6
7
|
return undefined;
|
|
@@ -12,14 +13,5 @@ export const formatDisplayValue = (value) => {
|
|
|
12
13
|
}
|
|
13
14
|
return value;
|
|
14
15
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const { objectId, ancestors } = itemValue || {};
|
|
18
|
-
const ancestorValue = (ancestors || []).concat(objectId).filter(Boolean).join('-');
|
|
19
|
-
return ancestorValue;
|
|
20
|
-
};
|
|
21
|
-
export const formatAncestorSubmitValues = (submitValues) => {
|
|
22
|
-
logger('formatAncestorSubmitValues', submitValues);
|
|
23
|
-
const ancestorsValue = ((submitValues === null || submitValues === void 0 ? void 0 : submitValues.ancestor) || '').split('-').filter(Boolean);
|
|
24
|
-
return ancestorsValue;
|
|
25
|
-
};
|
|
16
|
+
|
|
17
|
+
export { formatDisplayValue };
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import {
|
|
1
|
+
import { jsx, jsxs } from '@emotion/react/jsx-runtime';
|
|
2
|
+
import { memo, Fragment } from 'react';
|
|
3
3
|
import { ClassNames } from '@emotion/react';
|
|
4
|
-
import { getArrayValue } from '../../../lib/array';
|
|
5
|
-
import { isUserDeleted, isUserDisabled
|
|
6
|
-
import EmptyField from '../../common/EmptyField';
|
|
7
|
-
import {
|
|
8
|
-
import { userDeletedStyle, userDisabledStyle } from '../user/style';
|
|
4
|
+
import { getArrayValue } from '../../../lib/array.js';
|
|
5
|
+
import { userDataFormat, isUserDeleted, isUserDisabled } from '../../../lib/useUser.js';
|
|
6
|
+
import EmptyField from '../../common/EmptyField.js';
|
|
7
|
+
import { tooltipOverflowStyle, getTooltipMaxlineStyle } from '../../common/overflow-tooltip/style/index.js';
|
|
8
|
+
import { userDeletedStyle, userDisabledStyle } from '../user/style/index.js';
|
|
9
|
+
|
|
9
10
|
const AssigneeReadView = memo(({ value, readonly }) => {
|
|
10
11
|
const users = getArrayValue(value).map(userDataFormat);
|
|
11
12
|
if (!(users === null || users === void 0 ? void 0 : users.length))
|
|
12
|
-
return
|
|
13
|
+
return jsx(EmptyField, { readonly: readonly, isUser: true });
|
|
13
14
|
const title = users.map(user => user === null || user === void 0 ? void 0 : user.label).join(',');
|
|
14
|
-
return (
|
|
15
|
-
const el = (
|
|
15
|
+
return (jsx(ClassNames, { children: ({ cx, css }) => (jsx("span", { className: cx(css(tooltipOverflowStyle), css(getTooltipMaxlineStyle(1))), title: title, children: users.reduce((prev, user, index) => {
|
|
16
|
+
const el = (jsxs(Fragment, { children: [index ? ',' : '', jsx("span", { className: cx({ [css(userDeletedStyle)]: isUserDeleted(user) }, { [css(userDisabledStyle)]: isUserDisabled(user) }), children: user === null || user === void 0 ? void 0 : user.label })] }, index));
|
|
16
17
|
return prev.concat(el);
|
|
17
18
|
}, []) })) }));
|
|
18
19
|
});
|
|
19
20
|
AssigneeReadView.displayName = 'AssigneeReadView';
|
|
20
|
-
|
|
21
|
+
|
|
22
|
+
export { AssigneeReadView as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const getFieldWidthStyle = (labelWidth, labelAlign, hiddenLabel, apply) => {
|
|
2
|
+
if (hiddenLabel) {
|
|
3
|
+
labelWidth = 0;
|
|
4
|
+
}
|
|
5
|
+
if (apply !== 'cell' && labelAlign !== 'top') {
|
|
6
|
+
return { width: `calc(100% - ${labelWidth}px)` };
|
|
7
|
+
}
|
|
8
|
+
return { width: '100%' };
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { getFieldWidthStyle };
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
import { ClassNames } from '@emotion/react';
|
|
4
|
-
import useI18n from '../../../lib/hooks/useI18n';
|
|
5
|
-
import EmptyField from '../../common/EmptyField';
|
|
6
|
-
import {
|
|
7
|
-
import { useToWorkspacePage } from './hooks';
|
|
8
|
-
import { pointerStyle } from './style';
|
|
4
|
+
import useI18n from '../../../lib/hooks/useI18n.js';
|
|
5
|
+
import EmptyField from '../../common/EmptyField.js';
|
|
6
|
+
import { tooltipOverflowStyle, getTooltipMaxlineStyle } from '../../common/overflow-tooltip/style/index.js';
|
|
7
|
+
import { useToWorkspacePage } from './hooks.js';
|
|
8
|
+
import { pointerStyle } from './style/index.js';
|
|
9
|
+
|
|
9
10
|
const BindWorkspaceReadView = memo(props => {
|
|
10
11
|
const { value } = props;
|
|
11
12
|
const { t } = useI18n();
|
|
12
13
|
const { toWorkspacePage } = useToWorkspacePage();
|
|
13
|
-
return (
|
|
14
|
-
return value ? (
|
|
14
|
+
return (jsx(ClassNames, { children: ({ cx, css }) => {
|
|
15
|
+
return value ? (jsx("span", { className: cx(css(tooltipOverflowStyle), css(getTooltipMaxlineStyle(1)), css(pointerStyle)), title: t('pages.fields.default.toWorkspacePage'), onClick: () => toWorkspacePage(value.key), children: value.name })) : (jsx(EmptyField, { readonly: true }));
|
|
15
16
|
} }));
|
|
16
17
|
});
|
|
17
18
|
BindWorkspaceReadView.displayName = 'BindWorkspaceReadView';
|
|
18
|
-
|
|
19
|
+
|
|
20
|
+
export { BindWorkspaceReadView as default };
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import useTeamConfig from '../../../lib/hooks/useTeamConfig';
|
|
2
|
-
import useTenant from '../../../lib/hooks/useTenant';
|
|
3
|
-
import isInOne from '../../../lib/isInOne';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
1
|
+
import useTeamConfig from '../../../lib/hooks/useTeamConfig.js';
|
|
2
|
+
import useTenant from '../../../lib/hooks/useTenant.js';
|
|
3
|
+
import isInOne from '../../../lib/isInOne.js';
|
|
4
|
+
|
|
5
|
+
const useToWorkspacePage = () => {
|
|
6
|
+
const { publicRuntimeConfig, isMicroApp } = useTeamConfig();
|
|
7
|
+
const inOne = isInOne(publicRuntimeConfig.gateway, isMicroApp);
|
|
7
8
|
const tenant = useTenant();
|
|
8
9
|
return {
|
|
9
10
|
toWorkspacePage: (workspaceKey) => {
|
|
10
11
|
const url = inOne
|
|
11
12
|
? `/${tenant}/${workspaceKey}`
|
|
12
|
-
: `${
|
|
13
|
+
: `${publicRuntimeConfig.basePath}/${tenant}/workspaces/${workspaceKey}?from=item`;
|
|
13
14
|
window.open(`${url}?from=item`, '_blank');
|
|
14
15
|
},
|
|
15
16
|
};
|
|
16
17
|
};
|
|
18
|
+
|
|
19
|
+
export { useToWorkspacePage };
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
|
-
import EmptyField from '../../common/EmptyField';
|
|
4
|
-
import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip';
|
|
5
|
-
import { getShowValue } from './utils';
|
|
3
|
+
import EmptyField from '../../common/EmptyField.js';
|
|
4
|
+
import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip.js';
|
|
5
|
+
import { getShowValue } from './utils.js';
|
|
6
|
+
|
|
6
7
|
const Cascade = props => {
|
|
7
8
|
const { value } = props;
|
|
8
9
|
const showValue = useMemo(() => {
|
|
9
10
|
return getShowValue(value);
|
|
10
11
|
}, [value]);
|
|
11
|
-
return showValue ?
|
|
12
|
+
return showValue ? jsx(BaseOverflowTooltip, { title: showValue, children: showValue }) : jsx(EmptyField, { readonly: true });
|
|
12
13
|
};
|
|
13
14
|
Cascade.displayName = 'CascadeReadView';
|
|
14
|
-
|
|
15
|
+
|
|
16
|
+
export { Cascade as default };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export const getShowValue = (values) => {
|
|
1
|
+
const LABEL_JOIN_STR = ' / ';
|
|
2
|
+
const getShowValue = (values) => {
|
|
4
3
|
if (!Array.isArray(values) || !values.length)
|
|
5
4
|
return '';
|
|
6
5
|
const showValue = values
|
|
@@ -19,3 +18,5 @@ export const getShowValue = (values) => {
|
|
|
19
18
|
.join(',');
|
|
20
19
|
return showValue;
|
|
21
20
|
};
|
|
21
|
+
|
|
22
|
+
export { LABEL_JOIN_STR, getShowValue };
|
|
@@ -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 CheckboxReadView = memo(props => {
|
|
6
7
|
const { value, options, readonly } = props;
|
|
7
8
|
const showValue = useMemo(() => {
|
|
@@ -15,7 +16,8 @@ const CheckboxReadView = memo(props => {
|
|
|
15
16
|
.join(',');
|
|
16
17
|
return result;
|
|
17
18
|
}, [options, value]);
|
|
18
|
-
return (
|
|
19
|
+
return (jsx(Fragment, { children: showValue ? (jsx(SimpleOverflowToolTip, { title: showValue, children: showValue })) : (jsx(EmptyField, { readonly: readonly })) }));
|
|
19
20
|
});
|
|
20
21
|
CheckboxReadView.displayName = 'CheckboxReadView';
|
|
21
|
-
|
|
22
|
+
|
|
23
|
+
export { CheckboxReadView as default };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import { memo, useMemo } from 'react';
|
|
3
|
-
import useDateTimeFormatType from '../../../lib/hooks/useDateTimeFormatType';
|
|
4
|
-
import EmptyField from '../../common/EmptyField';
|
|
5
|
-
import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip';
|
|
6
|
-
import { dateFormat } from '../../common/utils';
|
|
3
|
+
import useDateTimeFormatType from '../../../lib/hooks/useDateTimeFormatType.js';
|
|
4
|
+
import EmptyField from '../../common/EmptyField.js';
|
|
5
|
+
import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip.js';
|
|
6
|
+
import { dateFormat } from '../../common/utils.js';
|
|
7
|
+
|
|
7
8
|
const CreatedAtReadView = memo(({ value }) => {
|
|
8
9
|
const dateFormatType = useDateTimeFormatType();
|
|
9
10
|
const showValue = useMemo(() => {
|
|
@@ -13,9 +14,10 @@ const CreatedAtReadView = memo(({ value }) => {
|
|
|
13
14
|
return '';
|
|
14
15
|
}, [value, dateFormatType]);
|
|
15
16
|
if (!showValue) {
|
|
16
|
-
return
|
|
17
|
+
return jsx(EmptyField, { readonly: true });
|
|
17
18
|
}
|
|
18
|
-
return
|
|
19
|
+
return jsx(BaseOverflowTooltip, { title: showValue, children: showValue });
|
|
19
20
|
});
|
|
20
21
|
CreatedAtReadView.displayName = 'CreatedAtReadView';
|
|
21
|
-
|
|
22
|
+
|
|
23
|
+
export { CreatedAtReadView as default };
|
|
@@ -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 CreatedByReadView = memo(({ value }) => {
|
|
10
11
|
const showValue = useMemo(() => {
|
|
11
12
|
if (value) {
|
|
@@ -14,9 +15,10 @@ const CreatedByReadView = memo(({ value }) => {
|
|
|
14
15
|
return '';
|
|
15
16
|
}, [value]);
|
|
16
17
|
if (!showValue) {
|
|
17
|
-
return
|
|
18
|
+
return jsx(EmptyField, { readonly: true });
|
|
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
|
CreatedByReadView.displayName = 'CreatedByReadView';
|
|
22
|
-
|
|
23
|
+
|
|
24
|
+
export { CreatedByReadView as default };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { jsxs
|
|
2
|
-
import {
|
|
1
|
+
import { jsxs, jsx } from '@emotion/react/jsx-runtime';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { useRecoilValue } from 'recoil';
|
|
5
|
-
import {
|
|
6
|
-
import EmptyField from '../../common/EmptyField';
|
|
7
|
-
import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip';
|
|
8
|
-
import { fieldValueOverlayStyle } from '../../common/style/global';
|
|
9
|
-
import { dataQuoteInit } from './utils';
|
|
5
|
+
import { dataQuoteState, currentDeleteState } from '../../../lib/store/dataQuoteStore.js';
|
|
6
|
+
import EmptyField from '../../common/EmptyField.js';
|
|
7
|
+
import BaseOverflowTooltip from '../../common/overflow-tooltip/BaseOverflowTooltip.js';
|
|
8
|
+
import { fieldValueOverlayStyle } from '../../common/style/global.js';
|
|
9
|
+
import { dataQuoteInit } from './utils.js';
|
|
10
|
+
|
|
10
11
|
const DataQuoteReadView = ({ value, userData }) => {
|
|
11
12
|
const [dataList, setDataList] = useState(null);
|
|
12
13
|
const dataQuoteList = useRecoilValue(dataQuoteState);
|
|
@@ -16,9 +17,10 @@ const DataQuoteReadView = ({ value, userData }) => {
|
|
|
16
17
|
setDataList(dataQuoteInit(dataQuoteList, value, userData === null || userData === void 0 ? void 0 : userData.display));
|
|
17
18
|
}
|
|
18
19
|
}, [dataQuoteList, userData === null || userData === void 0 ? void 0 : userData.display, value, currentDeleteItem]);
|
|
19
|
-
const cellDisplay = (dataList === null || dataList === void 0 ? void 0 : dataList.length) ? (dataList.map((item, index) => (
|
|
20
|
+
const cellDisplay = (dataList === null || dataList === void 0 ? void 0 : dataList.length) ? (dataList.map((item, index) => (jsxs("span", { children: [item.label, " ", index === dataList.length - 1 ? '' : '、'] }, item.value)))) : (jsx(EmptyField, { readonly: true }));
|
|
20
21
|
const showValue = (dataList === null || dataList === void 0 ? void 0 : dataList.length) ? dataList.map(item => item.label).join('、') : '';
|
|
21
|
-
return (
|
|
22
|
+
return (jsx("div", { css: css(fieldValueOverlayStyle), children: jsx(BaseOverflowTooltip, { title: showValue, maxline: 1, children: cellDisplay }) }));
|
|
22
23
|
};
|
|
23
24
|
DataQuoteReadView.displayName = 'DataQuoteReadView';
|
|
24
|
-
|
|
25
|
+
|
|
26
|
+
export { DataQuoteReadView as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
const DATA_QUOTE_OPTION_FORMAT_REG = /{(\S+?)}/g;
|
|
2
|
+
const dataQuoteOptionFormat = (data, display) => {
|
|
3
3
|
var _a, _b, _c;
|
|
4
4
|
if (!data)
|
|
5
5
|
return undefined;
|
|
@@ -23,8 +23,10 @@ export const dataQuoteOptionFormat = (data, display) => {
|
|
|
23
23
|
values: data.values,
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
const dataQuoteInit = (dates, value, display) => {
|
|
27
27
|
const existedDataList = dates === null || dates === void 0 ? void 0 : dates.filter(data => value === null || value === void 0 ? void 0 : value.includes(data.objectId));
|
|
28
28
|
const dataInit = existedDataList === null || existedDataList === void 0 ? void 0 : existedDataList.map(existedData => dataQuoteOptionFormat(existedData, display));
|
|
29
29
|
return dataInit;
|
|
30
30
|
};
|
|
31
|
+
|
|
32
|
+
export { DATA_QUOTE_OPTION_FORMAT_REG, dataQuoteInit, dataQuoteOptionFormat };
|