@giteeteam/apps-team-components 1.3.0-alpha.1 → 1.3.0-alpha.3
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 -21
- 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 +0 -1
- package/dist/components/common/expand-component/index.js +12 -10
- package/dist/components/common/expand-component/style.js +8 -6
- 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 +16 -14
- package/dist/components/common/style/global.js +4 -2
- package/dist/components/common/style/mixin.js +18 -15
- 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.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 +65 -62
- 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 +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.js +53 -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 +88 -85
- 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 +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.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 +7 -5
- 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 +53 -50
- 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 +300 -323
- 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 +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.d.ts +1 -0
- package/dist/components/table-components/EditTableCell.js +38 -16
- 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 +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/empty-icon/workspace-empty.svg +126 -126
- package/dist/icons/index.d.ts +1 -1
- package/dist/icons/index.js +37 -35
- package/dist/icons/style/index.js +23 -21
- 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/public/icons/BulbIcon.svg +1 -1
- package/dist/public/icons/Cloud.svg +1 -1
- package/dist/public/icons/ConsultIcon.svg +1 -1
- package/dist/public/icons/Demo.svg +1 -1
- package/dist/public/icons/ErrorTemplate.svg +1 -1
- package/dist/public/icons/Fail.svg +1 -1
- package/dist/public/icons/Flag.svg +1 -1
- package/dist/public/icons/GiteeIcon.svg +1 -1
- package/dist/public/icons/IntelligenceGradient.svg +1 -1
- package/dist/public/icons/Issue_Approval.svg +1 -1
- package/dist/public/icons/Issue_Bug.svg +1 -1
- package/dist/public/icons/Issue_Demand.svg +1 -1
- package/dist/public/icons/Issue_Doc.svg +1 -1
- package/dist/public/icons/Issue_Idea.svg +1 -1
- package/dist/public/icons/Issue_List.svg +1 -1
- package/dist/public/icons/Issue_Plan.svg +1 -1
- package/dist/public/icons/Issue_Product.svg +1 -1
- package/dist/public/icons/Issue_Risk.svg +1 -1
- package/dist/public/icons/Issue_Story.svg +1 -1
- package/dist/public/icons/Issue_Subtask.svg +1 -1
- package/dist/public/icons/Issue_Task.svg +1 -1
- package/dist/public/icons/Issue_Test.svg +1 -1
- package/dist/public/icons/Issue_TestExcution.svg +1 -1
- package/dist/public/icons/Issue_TestPlan.svg +1 -1
- package/dist/public/icons/Issue_Time.svg +1 -1
- package/dist/public/icons/Issue_develop.svg +1 -1
- package/dist/public/icons/KanbanCover.svg +7 -7
- package/dist/public/icons/ListCover.svg +117 -117
- package/dist/public/icons/ManHour.svg +1 -1
- package/dist/public/icons/MobileIcon.svg +1 -1
- package/dist/public/icons/NoItemType.svg +10 -10
- package/dist/public/icons/ProductIcon.svg +1 -1
- package/dist/public/icons/RedFlagIcon.svg +1 -1
- package/dist/public/icons/Safe.svg +1 -1
- package/dist/public/icons/StarIcon.svg +60 -60
- package/dist/public/icons/StructureCover.svg +1 -1
- package/dist/public/icons/Success.svg +1 -1
- package/dist/public/icons/TeamIcon.svg +1 -1
- package/dist/public/icons/WebIcon.svg +1 -1
- package/dist/public/icons/iconfont.svg +467 -467
- package/dist/public/icons/iconfont_single_color.css +912 -912
- package/dist/public/mockServiceWorker.js +284 -284
- package/dist/style/common.js +11 -24
- package/dist/style/global.js +9 -7
- package/package.json +111 -105
- 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
package/dist/lib/fetch.js
CHANGED
|
@@ -1,44 +1,36 @@
|
|
|
1
|
-
import { useCallback, useContext, useEffect
|
|
1
|
+
import { useMemo, useCallback, useContext, useEffect } from 'react';
|
|
2
2
|
import axios, { HttpStatusCode } from 'axios';
|
|
3
3
|
import cjson from 'compressed-json';
|
|
4
4
|
import debug from 'debug';
|
|
5
5
|
import { toNumber } from 'lodash-es';
|
|
6
|
-
import { CANCEL_FETCH_STRING, REDIRECT_URL_KEY } from '
|
|
7
|
-
import throttleWithCache, { THROTTLE_TYPE } from '
|
|
8
|
-
import { ParseErrorCode } from './constants/code';
|
|
9
|
-
import { TeamConfigContext } from './contexts/teamConfig';
|
|
10
|
-
import { IGNORE_URL } from './error/withServerError';
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
6
|
+
import { CANCEL_FETCH_STRING, REDIRECT_URL_KEY } from './global.js';
|
|
7
|
+
import throttleWithCache, { THROTTLE_TYPE } from './swr/throttleWithCache.js';
|
|
8
|
+
import { ParseErrorCode } from './constants/code.js';
|
|
9
|
+
import { TeamConfigContext } from './contexts/teamConfig.js';
|
|
10
|
+
import { IGNORE_URL } from './error/withServerError.js';
|
|
11
|
+
import ErrorLog from './error/log.js';
|
|
12
|
+
import { getErrorMessage } from './error/utils.js';
|
|
13
|
+
import { i18n } from './i18n.js';
|
|
14
|
+
import isInOne from './isInOne.js';
|
|
15
|
+
import { useGetSourcePath } from './path.js';
|
|
16
|
+
import { getCurLocationInfo } from './router.js';
|
|
17
|
+
import { removeParseItems } from './storage.js';
|
|
18
|
+
import { useAppProps } from './useConfig.js';
|
|
19
|
+
|
|
18
20
|
const Blob = window.Blob;
|
|
19
|
-
|
|
21
|
+
process.env.NODE_ENV === 'development';
|
|
20
22
|
const DEFAULT_TIMEOUT = 15 * 1000;
|
|
21
|
-
|
|
23
|
+
const useGetConfigTimeout = () => {
|
|
22
24
|
const { publicRuntimeConfig = {} } = useContext(TeamConfigContext);
|
|
23
25
|
const { globalFetchTimeout } = publicRuntimeConfig;
|
|
24
26
|
return toNumber(globalFetchTimeout) || DEFAULT_TIMEOUT;
|
|
25
27
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const { publicRuntimeConfig = {} } = useContext(TeamConfigContext);
|
|
29
|
-
const basePath = useMemo(() => {
|
|
30
|
-
const { basePath = '' } = publicRuntimeConfig;
|
|
31
|
-
if (isDev)
|
|
32
|
-
return basePath;
|
|
33
|
-
return '';
|
|
34
|
-
}, [publicRuntimeConfig]);
|
|
35
|
-
return basePath;
|
|
36
|
-
};
|
|
37
|
-
export const useGetServerGateway = () => {
|
|
28
|
+
const baseApi = '/parse/api';
|
|
29
|
+
const useGetServerGateway = () => {
|
|
38
30
|
const { publicRuntimeConfig } = useContext(TeamConfigContext);
|
|
39
31
|
return (publicRuntimeConfig === null || publicRuntimeConfig === void 0 ? void 0 : publicRuntimeConfig.gateway) || '';
|
|
40
32
|
};
|
|
41
|
-
|
|
33
|
+
const useGetGateway = (extraPath = '') => {
|
|
42
34
|
const gateway = useGetServerGateway();
|
|
43
35
|
const result = useMemo(() => {
|
|
44
36
|
const inOne = isInOne(gateway);
|
|
@@ -50,23 +42,7 @@ export const useGetGateway = (extraPath = '') => {
|
|
|
50
42
|
}, [extraPath, gateway]);
|
|
51
43
|
return result;
|
|
52
44
|
};
|
|
53
|
-
|
|
54
|
-
const gateway = useGetServerGateway();
|
|
55
|
-
const baseURL = useMemo(() => {
|
|
56
|
-
return `${gateway}${baseApi}`;
|
|
57
|
-
}, [gateway]);
|
|
58
|
-
return {
|
|
59
|
-
baseURL,
|
|
60
|
-
headers: {
|
|
61
|
-
'X-Parse-Session-Token': sessionToken,
|
|
62
|
-
'X-Parse-Application-Id': tenant,
|
|
63
|
-
...(Cookie && {
|
|
64
|
-
Cookie,
|
|
65
|
-
}),
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
export const useAxiosConfig = () => {
|
|
45
|
+
const useAxiosConfig = () => {
|
|
70
46
|
const gateway = useGetGateway();
|
|
71
47
|
const baseURL = useMemo(() => {
|
|
72
48
|
return `${gateway}${baseApi}`;
|
|
@@ -80,14 +56,6 @@ export const useAxiosConfig = () => {
|
|
|
80
56
|
const errorLog = msg => {
|
|
81
57
|
return ErrorLog.show(msg);
|
|
82
58
|
};
|
|
83
|
-
export const LOCALE_KEY = 'lang';
|
|
84
|
-
export const useGetHeaderLang = () => {
|
|
85
|
-
const { locale } = useAppProps();
|
|
86
|
-
return locale;
|
|
87
|
-
};
|
|
88
|
-
export const getGlobalEnv = () => {
|
|
89
|
-
return window.env || {};
|
|
90
|
-
};
|
|
91
59
|
const checkLog = debug('lib:fetch:checkSessionToken');
|
|
92
60
|
const NO_SESSION_KEY = 'sessionToken is required';
|
|
93
61
|
const CHECK_WHITE_LIST = [
|
|
@@ -298,4 +266,5 @@ const useFetch = () => {
|
|
|
298
266
|
useAddResponseInterceptors(fetch);
|
|
299
267
|
return fetch;
|
|
300
268
|
};
|
|
301
|
-
|
|
269
|
+
|
|
270
|
+
export { baseApi, useFetch as default, useAxiosConfig, useGetConfigTimeout, useGetGateway, useGetServerGateway };
|
package/dist/lib/global.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
const FIELD_TYPE_KEY_MAPPINGS = {
|
|
2
2
|
Text: 'Text',
|
|
3
3
|
User: 'User',
|
|
4
4
|
LongText: 'LongText',
|
|
@@ -58,34 +58,34 @@ export const FIELD_TYPE_KEY_MAPPINGS = {
|
|
|
58
58
|
Cascade: 'Cascade',
|
|
59
59
|
RepoFiles: 'RepoFiles',
|
|
60
60
|
};
|
|
61
|
-
|
|
61
|
+
const DATE_TYPE = {
|
|
62
62
|
DATETIME: 'dateTime',
|
|
63
63
|
DATE: 'date',
|
|
64
64
|
WEEK: 'week',
|
|
65
65
|
MONTH: 'month',
|
|
66
66
|
YEAR: 'year',
|
|
67
67
|
};
|
|
68
|
-
|
|
68
|
+
const DATE_FORMAT = {
|
|
69
69
|
DATETIME: 'YYYY-MM-DD HH:mm:ss',
|
|
70
70
|
DATE: 'YYYY-MM-DD',
|
|
71
71
|
WEEK: 'YYYY 第W周',
|
|
72
72
|
MONTH: 'YYYY-MM',
|
|
73
73
|
YEAR: 'YYYY',
|
|
74
74
|
};
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm';
|
|
76
|
+
const DATE_TIME_FORMAT_SEC = 'YYYY-MM-DD HH:mm:ss';
|
|
77
|
+
var WorkflowStatusType;
|
|
78
78
|
(function (WorkflowStatusType) {
|
|
79
79
|
WorkflowStatusType["Start"] = "Start";
|
|
80
80
|
WorkflowStatusType["InProgress"] = "InProgress";
|
|
81
81
|
WorkflowStatusType["Finished"] = "Finished";
|
|
82
82
|
})(WorkflowStatusType || (WorkflowStatusType = {}));
|
|
83
|
-
|
|
83
|
+
const WorkFlowStatusColor = {
|
|
84
84
|
[WorkflowStatusType.Start]: { color: '#0C62FF', bgColor: '#E6F3FF' },
|
|
85
85
|
[WorkflowStatusType.InProgress]: { color: '#FFAA0C', bgColor: '#FEF5D0' },
|
|
86
86
|
[WorkflowStatusType.Finished]: { color: '#09B866', bgColor: '#DFF7E8' },
|
|
87
87
|
};
|
|
88
|
-
|
|
88
|
+
const CustomFieldComponentTypes = {
|
|
89
89
|
Date: 'Date',
|
|
90
90
|
Dropdown: 'Dropdown',
|
|
91
91
|
User: 'User',
|
|
@@ -98,9 +98,9 @@ export const CustomFieldComponentTypes = {
|
|
|
98
98
|
Radio: 'Radio',
|
|
99
99
|
Checkbox: 'Checkbox',
|
|
100
100
|
};
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
const BASE_FIELD_WIDTH = 104;
|
|
102
|
+
const CURRENT_WORKSPACE = 'currentWorkspace()';
|
|
103
|
+
const FIELD_CONTAINERS_PAGE = {
|
|
104
104
|
DETAIL: 'detail',
|
|
105
105
|
MODAL: 'modal',
|
|
106
106
|
DRAWER: 'drawer',
|
|
@@ -109,10 +109,12 @@ export const FIELD_CONTAINERS_PAGE = {
|
|
|
109
109
|
AUTOMATION_FIELD: 'automation_field',
|
|
110
110
|
VIEW_MODAL: 'view_modal',
|
|
111
111
|
};
|
|
112
|
-
|
|
112
|
+
const SCREEN_TYPE = {
|
|
113
113
|
View: 'view',
|
|
114
114
|
Create: 'create',
|
|
115
115
|
Edit: 'edit',
|
|
116
116
|
};
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
const CANCEL_FETCH_STRING = 'cancel_fetch_string';
|
|
118
|
+
const REDIRECT_URL_KEY = 'team_redirect_url';
|
|
119
|
+
|
|
120
|
+
export { BASE_FIELD_WIDTH, CANCEL_FETCH_STRING, CURRENT_WORKSPACE, CustomFieldComponentTypes, DATE_FORMAT, DATE_TIME_FORMAT, DATE_TIME_FORMAT_SEC, DATE_TYPE, FIELD_CONTAINERS_PAGE, FIELD_TYPE_KEY_MAPPINGS, REDIRECT_URL_KEY, SCREEN_TYPE, WorkFlowStatusColor, WorkflowStatusType };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
|
-
import { AntdConfigContext } from '
|
|
2
|
+
import { AntdConfigContext } from '../contexts/antdConfig.js';
|
|
3
|
+
|
|
3
4
|
const useAntdConfig = () => {
|
|
4
5
|
const antdConfig = useContext(AntdConfigContext);
|
|
5
6
|
return antdConfig;
|
|
6
7
|
};
|
|
7
|
-
|
|
8
|
+
|
|
9
|
+
export { useAntdConfig as default };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
|
-
import { CurrentUserContext } from '
|
|
2
|
+
import { CurrentUserContext } from '../contexts/currentUser.js';
|
|
3
|
+
|
|
3
4
|
const useCurrentUser = () => {
|
|
4
5
|
const { currentUser } = useContext(CurrentUserContext);
|
|
5
6
|
return currentUser;
|
|
6
7
|
};
|
|
7
|
-
|
|
8
|
+
|
|
9
|
+
export { useCurrentUser as default };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
|
-
import { CurrentWorkspaceContext } from '
|
|
2
|
+
import { CurrentWorkspaceContext } from '../contexts/currentWorkspace.js';
|
|
3
|
+
|
|
3
4
|
const useCurrentWorkspace = () => {
|
|
4
5
|
const currentWorkspace = useContext(CurrentWorkspaceContext);
|
|
5
6
|
return currentWorkspace;
|
|
6
7
|
};
|
|
7
|
-
|
|
8
|
+
|
|
9
|
+
export { useCurrentWorkspace as default };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { useMemo, useEffect } from 'react';
|
|
2
|
+
import { isEmpty, clone } from 'lodash-es';
|
|
3
3
|
import { useRecoilState } from 'recoil';
|
|
4
|
-
import { REG_EN_NUMBER } from '../regExp';
|
|
5
|
-
import {
|
|
4
|
+
import { REG_EN_NUMBER } from '../regExp.js';
|
|
5
|
+
import { dataQuoteState, currentDeleteState } from '../store/dataQuoteStore.js';
|
|
6
|
+
|
|
6
7
|
const OBJECT_ID_LENGTH = 10;
|
|
7
|
-
|
|
8
|
+
const useDataQuoteStore = (dataSources, getOptionsByValues) => {
|
|
8
9
|
const [dataQuoteList, setDataQuoteList] = useRecoilState(dataQuoteState);
|
|
9
10
|
const [currentDeleteItem, setCurrentDeleteItem] = useRecoilState(currentDeleteState);
|
|
10
11
|
const dataSourcesDep = useMemo(() => {
|
|
@@ -64,3 +65,5 @@ export const useDataQuoteStore = (dataSources, getOptionsByValues) => {
|
|
|
64
65
|
setCurrentDeleteItem('');
|
|
65
66
|
}, [currentDeleteItem, setDataQuoteList, dataQuoteList, dataSourcesDep, setCurrentDeleteItem]);
|
|
66
67
|
};
|
|
68
|
+
|
|
69
|
+
export { useDataQuoteStore };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { useContext, useMemo } from 'react';
|
|
2
|
-
import { DatetimeFormatContext } from '
|
|
2
|
+
import { DatetimeFormatContext } from '../contexts/datetimeFormat.js';
|
|
3
|
+
|
|
3
4
|
const useDateTimeFormatType = () => {
|
|
4
5
|
const { datetimeFormat } = useContext(DatetimeFormatContext);
|
|
5
6
|
return useMemo(() => datetimeFormat, [datetimeFormat]);
|
|
6
7
|
};
|
|
7
|
-
|
|
8
|
+
|
|
9
|
+
export { useDateTimeFormatType as default };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
|
-
import { ItemConfigContext } from '
|
|
2
|
+
import { ItemConfigContext } from '../contexts/itemConfig.js';
|
|
3
|
+
|
|
3
4
|
const useItemConfig = () => {
|
|
4
5
|
const { item } = useContext(ItemConfigContext);
|
|
5
6
|
return item;
|
|
6
7
|
};
|
|
7
|
-
|
|
8
|
+
|
|
9
|
+
export { useItemConfig as default };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
|
-
import { TeamConfigContext } from '
|
|
2
|
+
import { TeamConfigContext } from '../contexts/teamConfig.js';
|
|
3
|
+
|
|
3
4
|
const useTeamConfig = () => {
|
|
4
5
|
const teamConfig = useContext(TeamConfigContext);
|
|
5
6
|
return teamConfig;
|
|
6
7
|
};
|
|
7
|
-
|
|
8
|
+
|
|
9
|
+
export { useTeamConfig as default };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
|
-
import { TenantContext } from '
|
|
2
|
+
import { TenantContext } from '../contexts/tenant.js';
|
|
3
|
+
|
|
3
4
|
const useTenant = () => {
|
|
4
5
|
const { tenant } = useContext(TenantContext);
|
|
5
6
|
return tenant;
|
|
6
7
|
};
|
|
7
|
-
|
|
8
|
+
|
|
9
|
+
export { useTenant as default };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
|
-
import { WorkflowConfigContext } from '
|
|
2
|
+
import { WorkflowConfigContext } from '../contexts/workflowConfig.js';
|
|
3
|
+
|
|
3
4
|
const useWorkflowConfig = () => {
|
|
4
5
|
const { workflow } = useContext(WorkflowConfigContext);
|
|
5
6
|
return workflow;
|
|
6
7
|
};
|
|
7
|
-
|
|
8
|
+
|
|
9
|
+
export { useWorkflowConfig as default };
|
package/dist/lib/i18n.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { zh, ru, en } from '../locales/index.js';
|
|
2
|
+
|
|
2
3
|
let locale = 'zh';
|
|
3
4
|
const getTranslate = () => {
|
|
4
5
|
switch (locale) {
|
|
@@ -15,7 +16,7 @@ const getTranslate = () => {
|
|
|
15
16
|
return zh;
|
|
16
17
|
}
|
|
17
18
|
};
|
|
18
|
-
|
|
19
|
+
const i18n = {
|
|
19
20
|
t: (key, opts) => {
|
|
20
21
|
var _a;
|
|
21
22
|
const translate = getTranslate();
|
|
@@ -32,4 +33,6 @@ export const i18n = {
|
|
|
32
33
|
locale = _locale;
|
|
33
34
|
},
|
|
34
35
|
};
|
|
35
|
-
|
|
36
|
+
const nsSeparator = '@';
|
|
37
|
+
|
|
38
|
+
export { i18n, nsSeparator };
|
package/dist/lib/icons/utils.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
|
-
import { useGetBasePath } from '
|
|
3
|
-
|
|
2
|
+
import { useGetBasePath } from '../path.js';
|
|
3
|
+
|
|
4
|
+
const polyfillItemTypeIconMap = {
|
|
4
5
|
BookMark: 'Issue_Story',
|
|
5
6
|
Book: 'Issue_Demand',
|
|
6
7
|
Flask: 'Issue_Test',
|
|
@@ -17,20 +18,20 @@ export const polyfillItemTypeIconMap = {
|
|
|
17
18
|
Risk: 'Issue_Risk',
|
|
18
19
|
ManHour: 'Issue_Time',
|
|
19
20
|
};
|
|
20
|
-
|
|
21
|
+
const takeIconFromUrl = (url) => {
|
|
21
22
|
const arr = url.split('/');
|
|
22
23
|
const last = arr[arr.length - 1];
|
|
23
24
|
const [icon] = last.split('.');
|
|
24
25
|
return icon;
|
|
25
26
|
};
|
|
26
|
-
|
|
27
|
+
const useIsIconFont = (url) => {
|
|
27
28
|
const basePath = useGetBasePath();
|
|
28
29
|
return !(url.startsWith('/icons') || url.endsWith('.svg') || url.startsWith(basePath) || url.startsWith('/project'));
|
|
29
30
|
};
|
|
30
|
-
|
|
31
|
+
const isServerUrl = (url) => {
|
|
31
32
|
return url.startsWith('http') || url.startsWith('/parse/files');
|
|
32
33
|
};
|
|
33
|
-
|
|
34
|
+
const usePolyFillIcon = (url, defaultIconFontType) => {
|
|
34
35
|
const isIconFont = useIsIconFont(url);
|
|
35
36
|
const data = useMemo(() => {
|
|
36
37
|
if (!url) {
|
|
@@ -52,8 +53,8 @@ export const usePolyFillIcon = (url, defaultIconFontType) => {
|
|
|
52
53
|
}, [defaultIconFontType, isIconFont, url]);
|
|
53
54
|
return data;
|
|
54
55
|
};
|
|
55
|
-
const
|
|
56
|
-
export const joinIconColorSuffix = (icon, colored) => (colored ? `${icon}${SUFFIX}` : icon);
|
|
57
|
-
export const isBase64Img = (str) => {
|
|
56
|
+
const isBase64Img = (str) => {
|
|
58
57
|
return /^data:image\/(png|jpeg|jpg|gif|svg\+xml);base64,/.test(str);
|
|
59
58
|
};
|
|
59
|
+
|
|
60
|
+
export { isBase64Img, isServerUrl, polyfillItemTypeIconMap, takeIconFromUrl, useIsIconFont, usePolyFillIcon };
|
package/dist/lib/isInOne.js
CHANGED
package/dist/lib/number.js
CHANGED
package/dist/lib/path.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const iconBasePath = "/icons";
|
|
2
2
|
export declare const startsWithIconPath: any;
|
|
3
3
|
export declare const useGetBasePath: () => string;
|
|
4
|
-
export declare const useGetSourcePath: () => (path: string) => string;
|
|
5
|
-
export declare const usePatchIconUrl: () => (path: string) => string;
|
|
4
|
+
export declare const useGetSourcePath: () => ((path: string) => string);
|
|
5
|
+
export declare const usePatchIconUrl: () => ((path: string) => string);
|
package/dist/lib/path.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { useCallback, useContext } from 'react';
|
|
2
2
|
import { startsWith } from 'lodash-es';
|
|
3
|
-
import { TeamConfigContext } from './contexts/teamConfig';
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { TeamConfigContext } from './contexts/teamConfig.js';
|
|
4
|
+
|
|
5
|
+
const iconBasePath = '/icons';
|
|
6
|
+
const startsWithIconPath = startsWith(iconBasePath);
|
|
6
7
|
const removeExtraSlash = (paths) => {
|
|
7
8
|
if (!paths)
|
|
8
9
|
return '';
|
|
@@ -24,18 +25,18 @@ const mergePath = (path1, path2) => {
|
|
|
24
25
|
}
|
|
25
26
|
return result;
|
|
26
27
|
};
|
|
27
|
-
|
|
28
|
+
const useGetBasePath = () => {
|
|
28
29
|
const { publicRuntimeConfig } = useContext(TeamConfigContext);
|
|
29
30
|
return (publicRuntimeConfig === null || publicRuntimeConfig === void 0 ? void 0 : publicRuntimeConfig.basePath) || '';
|
|
30
31
|
};
|
|
31
|
-
|
|
32
|
+
const useGetSourcePath = () => {
|
|
32
33
|
const basePath = useGetBasePath();
|
|
33
34
|
const getSourcePath = useCallback((path) => {
|
|
34
35
|
return mergePath(basePath, path);
|
|
35
36
|
}, [basePath]);
|
|
36
37
|
return getSourcePath;
|
|
37
38
|
};
|
|
38
|
-
|
|
39
|
+
const usePatchIconUrl = () => {
|
|
39
40
|
const getSourcePath = useGetSourcePath();
|
|
40
41
|
const patchIconUrl = useCallback((iconUrl) => {
|
|
41
42
|
if (startsWithIconPath(iconUrl)) {
|
|
@@ -45,3 +46,5 @@ export const usePatchIconUrl = () => {
|
|
|
45
46
|
}, [getSourcePath]);
|
|
46
47
|
return patchIconUrl;
|
|
47
48
|
};
|
|
49
|
+
|
|
50
|
+
export { iconBasePath, startsWithIconPath, useGetBasePath, useGetSourcePath, usePatchIconUrl };
|
package/dist/lib/regExp.js
CHANGED
package/dist/lib/router.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import queryString from 'query-string';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
const getCurLocationInfo = () => {
|
|
3
4
|
const { pathname, search } = window.location;
|
|
4
5
|
const basePath = window.__PROXIMA_BASE_NAME__ || '';
|
|
5
6
|
const pathWithoutBasePath = basePath !== '/' && pathname.startsWith(basePath) ? pathname.slice(basePath.length) : pathname;
|
|
@@ -18,3 +19,5 @@ export const getCurLocationInfo = () => {
|
|
|
18
19
|
};
|
|
19
20
|
return router;
|
|
20
21
|
};
|
|
22
|
+
|
|
23
|
+
export { getCurLocationInfo };
|
package/dist/lib/storage.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
const getLocalStorageItem = (key, defaults = '') => {
|
|
2
2
|
let item;
|
|
3
3
|
try {
|
|
4
4
|
item = localStorage.getItem(key);
|
|
@@ -8,20 +8,10 @@ export const getLocalStorageItem = (key, defaults = '') => {
|
|
|
8
8
|
return item !== null && item !== void 0 ? item : defaults;
|
|
9
9
|
}
|
|
10
10
|
};
|
|
11
|
-
export const setLocalStorageItem = (key, value) => {
|
|
12
|
-
try {
|
|
13
|
-
localStorage.setItem(key, JSON.stringify(value));
|
|
14
|
-
return true;
|
|
15
|
-
}
|
|
16
|
-
catch (e) {
|
|
17
|
-
console.error(e);
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
11
|
const getStorageKeys = () => {
|
|
22
12
|
return Object.keys(localStorage);
|
|
23
13
|
};
|
|
24
|
-
|
|
14
|
+
const removeParseItems = () => {
|
|
25
15
|
try {
|
|
26
16
|
const keys = getStorageKeys();
|
|
27
17
|
const parseKeys = keys.filter(fieldKey => fieldKey.startsWith('Parse/') && fieldKey.endsWith('/currentUser'));
|
|
@@ -33,30 +23,5 @@ export const removeParseItems = () => {
|
|
|
33
23
|
console.error('removeParseItems', error);
|
|
34
24
|
}
|
|
35
25
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
setItem: setLocalStorageItem,
|
|
39
|
-
removeParseItems,
|
|
40
|
-
};
|
|
41
|
-
const setLocalStorageState = (key, data) => {
|
|
42
|
-
localStorage.setItem(key, JSON.stringify({ time: new Date().getDate(), data }));
|
|
43
|
-
};
|
|
44
|
-
export const getLocalStorageState = async (key, fn) => {
|
|
45
|
-
try {
|
|
46
|
-
const target = localStorage.getItem(key);
|
|
47
|
-
if (target) {
|
|
48
|
-
const targetFormat = JSON.parse(target);
|
|
49
|
-
if ((targetFormat === null || targetFormat === void 0 ? void 0 : targetFormat.time) === new Date().getDate()) {
|
|
50
|
-
if (typeof targetFormat.data !== 'string') {
|
|
51
|
-
return targetFormat.data;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
catch (e) {
|
|
57
|
-
console.error(e);
|
|
58
|
-
}
|
|
59
|
-
const data = await fn();
|
|
60
|
-
setLocalStorageState(key, data);
|
|
61
|
-
return data;
|
|
62
|
-
};
|
|
26
|
+
|
|
27
|
+
export { getLocalStorageItem, removeParseItems };
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { atom } from 'recoil';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
const dataQuoteState = atom({
|
|
3
4
|
key: 'dataQuoteState',
|
|
4
5
|
default: [],
|
|
5
6
|
});
|
|
6
|
-
|
|
7
|
+
const currentDeleteState = atom({
|
|
7
8
|
key: 'currentDeleteState',
|
|
8
9
|
default: '',
|
|
9
10
|
});
|
|
11
|
+
|
|
12
|
+
export { currentDeleteState, dataQuoteState };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var API_KEY;
|
|
2
2
|
(function (API_KEY) {
|
|
3
3
|
API_KEY["GET_SEARCH_ITEM_GROUP"] = "GET_SEARCH_ITEM_GROUP";
|
|
4
4
|
API_KEY["GET_SEARCH_ITEM_TYPE"] = "GET_SEARCH_ITEM_TYPE";
|
|
@@ -24,9 +24,11 @@ export var API_KEY;
|
|
|
24
24
|
API_KEY["GET_TABLE_DEMO_CUSTOM_FIELDS"] = "GET_TABLE_DEMO_CUSTOM_FIELDS";
|
|
25
25
|
API_KEY["GET_SETTINGS_FIELDS_LIST"] = "GET_SETTINGS_FIELDS_LIST";
|
|
26
26
|
})(API_KEY || (API_KEY = {}));
|
|
27
|
-
|
|
27
|
+
var FetchCustomFieldTypeBySchemeType;
|
|
28
28
|
(function (FetchCustomFieldTypeBySchemeType) {
|
|
29
29
|
FetchCustomFieldTypeBySchemeType["table"] = "tableView";
|
|
30
30
|
FetchCustomFieldTypeBySchemeType["criteriaList"] = "criteriaList";
|
|
31
31
|
FetchCustomFieldTypeBySchemeType["default"] = "default";
|
|
32
32
|
})(FetchCustomFieldTypeBySchemeType || (FetchCustomFieldTypeBySchemeType = {}));
|
|
33
|
+
|
|
34
|
+
export { API_KEY, FetchCustomFieldTypeBySchemeType };
|
package/dist/lib/swr/hooks.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import useSWR from 'swr';
|
|
2
|
-
import useItemConfig from '../hooks/useItemConfig';
|
|
3
|
-
import { API_KEY } from './constants';
|
|
4
|
-
|
|
2
|
+
import useItemConfig from '../hooks/useItemConfig.js';
|
|
3
|
+
import { API_KEY } from './constants.js';
|
|
4
|
+
|
|
5
|
+
const useFetchItemById = ({ id, disable = false, detail, }) => {
|
|
5
6
|
const { fetchItemById } = useItemConfig();
|
|
6
7
|
const res = useSWR(!disable && id && [API_KEY.GET_ITEM_BY_ID, id], async () => {
|
|
7
8
|
let result;
|
|
@@ -12,3 +13,5 @@ export const useFetchItemById = ({ id, disable = false, detail, }) => {
|
|
|
12
13
|
});
|
|
13
14
|
return res;
|
|
14
15
|
};
|
|
16
|
+
|
|
17
|
+
export { useFetchItemById };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import debug from 'debug';
|
|
2
|
-
import { getLocalStorageItem } from '
|
|
3
|
-
|
|
2
|
+
import { getLocalStorageItem } from '../storage.js';
|
|
3
|
+
|
|
4
|
+
const DISABLE_THROTTLE_API_FETCH = 'DISABLE_THROTTLE_API_FETCH';
|
|
4
5
|
const log = debug('repeat-api');
|
|
5
6
|
const disableThrottle = !!getLocalStorageItem(DISABLE_THROTTLE_API_FETCH) || false;
|
|
6
7
|
let cacheKeys = [];
|
|
@@ -94,15 +95,16 @@ const throttleWithCache = ({ type, params, fn, method, }) => {
|
|
|
94
95
|
}
|
|
95
96
|
});
|
|
96
97
|
};
|
|
97
|
-
|
|
98
|
+
var THROTTLE_TYPE;
|
|
98
99
|
(function (THROTTLE_TYPE) {
|
|
99
100
|
THROTTLE_TYPE["PLUGIN_RESOURCE_FETCH"] = "PLUGIN_RESOURCE_FETCH";
|
|
100
101
|
THROTTLE_TYPE["QUERY_FETCH"] = "QUERY_FETCH";
|
|
101
102
|
THROTTLE_TYPE["CUSTOM_FETCH"] = "CUSTOM_FETCH";
|
|
102
103
|
})(THROTTLE_TYPE || (THROTTLE_TYPE = {}));
|
|
103
|
-
|
|
104
|
+
const createKeyByParams = ({ type, params }) => {
|
|
104
105
|
if (!params)
|
|
105
106
|
return `${+new Date()}`;
|
|
106
107
|
return `${type}_${JSON.stringify(params)}`;
|
|
107
108
|
};
|
|
108
|
-
|
|
109
|
+
|
|
110
|
+
export { DISABLE_THROTTLE_API_FETCH, THROTTLE_TYPE, createKeyByParams, throttleWithCache as default };
|