@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.
Files changed (264) hide show
  1. package/README.md +21 -21
  2. package/dist/components/common/EmptyField.d.ts +0 -1
  3. package/dist/components/common/EmptyField.js +7 -5
  4. package/dist/components/common/PriceTag.js +26 -23
  5. package/dist/components/common/expand-component/index.d.ts +0 -1
  6. package/dist/components/common/expand-component/index.js +12 -10
  7. package/dist/components/common/expand-component/style.js +8 -6
  8. package/dist/components/common/item-icon/ItemIcon.d.ts +0 -1
  9. package/dist/components/common/item-icon/ItemIcon.js +6 -4
  10. package/dist/components/common/overflow-tooltip/BaseOverflowTooltip.d.ts +0 -1
  11. package/dist/components/common/overflow-tooltip/BaseOverflowTooltip.js +9 -6
  12. package/dist/components/common/overflow-tooltip/OverflowTooltip.js +9 -6
  13. package/dist/components/common/overflow-tooltip/SimpleOverflowToolTip.js +8 -5
  14. package/dist/components/common/overflow-tooltip/style/index.js +16 -14
  15. package/dist/components/common/style/global.js +4 -2
  16. package/dist/components/common/style/mixin.js +18 -15
  17. package/dist/components/common/user-field/UserAvatar.js +8 -6
  18. package/dist/components/common/user-field/style/index.js +23 -21
  19. package/dist/components/common/utils.js +13 -9
  20. package/dist/components/default-empty-icon/config.js +11 -6
  21. package/dist/components/default-empty-icon/index.js +10 -9
  22. package/dist/components/default-empty-icon/style.js +65 -62
  23. package/dist/components/default-empty-icon/types.js +3 -1
  24. package/dist/components/field-behavior/fields/type.js +5 -2
  25. package/dist/components/fields/actors/BaseField.js +5 -2
  26. package/dist/components/fields/actors/ReadView.d.ts +0 -1
  27. package/dist/components/fields/actors/ReadView.js +8 -6
  28. package/dist/components/fields/ancestor/ReadView.js +8 -6
  29. package/dist/components/fields/ancestor/utils.js +4 -12
  30. package/dist/components/fields/assignee/ReadView.d.ts +0 -1
  31. package/dist/components/fields/assignee/ReadView.js +13 -11
  32. package/dist/components/fields/base-component/utils.js +3 -1
  33. package/dist/components/fields/bind-workspace/ReadView.d.ts +0 -1
  34. package/dist/components/fields/bind-workspace/ReadView.js +11 -9
  35. package/dist/components/fields/bind-workspace/hooks.js +7 -4
  36. package/dist/components/fields/bind-workspace/style/index.js +5 -3
  37. package/dist/components/fields/cascade/ReadView.js +8 -6
  38. package/dist/components/fields/cascade/utils.js +4 -3
  39. package/dist/components/fields/checkbox/ReadView.d.ts +0 -1
  40. package/dist/components/fields/checkbox/ReadView.js +7 -5
  41. package/dist/components/fields/created-at/ReadView.js +10 -8
  42. package/dist/components/fields/created-by/ReadView.d.ts +0 -1
  43. package/dist/components/fields/created-by/ReadView.js +11 -9
  44. package/dist/components/fields/data-quote/ReadView.js +12 -10
  45. package/dist/components/fields/data-quote/utils.js +5 -3
  46. package/dist/components/fields/date/ReadView.d.ts +0 -1
  47. package/dist/components/fields/date/ReadView.js +8 -6
  48. package/dist/components/fields/dropdown/BaseField.js +53 -40
  49. package/dist/components/fields/dropdown/Cell.d.ts +0 -1
  50. package/dist/components/fields/dropdown/Cell.js +6 -4
  51. package/dist/components/fields/dropdown/ReadView.d.ts +0 -1
  52. package/dist/components/fields/dropdown/ReadView.js +10 -8
  53. package/dist/components/fields/dropdown/data.d.ts +1 -1
  54. package/dist/components/fields/dropdown/data.js +6 -3
  55. package/dist/components/fields/dropdown/hook.d.ts +0 -1
  56. package/dist/components/fields/dropdown/hook.js +11 -8
  57. package/dist/components/fields/dropdown/style.js +88 -85
  58. package/dist/components/fields/file/ReadView.d.ts +0 -1
  59. package/dist/components/fields/file/ReadView.js +7 -5
  60. package/dist/components/fields/formula/ReadView.d.ts +0 -1
  61. package/dist/components/fields/formula/ReadView.js +7 -5
  62. package/dist/components/fields/hooks/useViewClass.js +4 -2
  63. package/dist/components/fields/hyper-link/ReadView.d.ts +0 -1
  64. package/dist/components/fields/hyper-link/ReadView.js +8 -6
  65. package/dist/components/fields/hyper-link/style/index.js +18 -15
  66. package/dist/components/fields/item-group/ReadView.d.ts +0 -1
  67. package/dist/components/fields/item-group/ReadView.js +6 -4
  68. package/dist/components/fields/item-type/ItemTypeIcon.js +15 -17
  69. package/dist/components/fields/item-type/ReadView.d.ts +0 -1
  70. package/dist/components/fields/item-type/ReadView.js +7 -5
  71. package/dist/components/fields/item-type/style/index.js +7 -5
  72. package/dist/components/fields/key/ReadView.d.ts +0 -1
  73. package/dist/components/fields/key/ReadView.js +7 -5
  74. package/dist/components/fields/long-text/ReadView.d.ts +0 -1
  75. package/dist/components/fields/long-text/ReadView.js +8 -6
  76. package/dist/components/fields/long-text/style/index.js +7 -5
  77. package/dist/components/fields/number/BaseField.js +5 -2
  78. package/dist/components/fields/number/ReadView.d.ts +0 -1
  79. package/dist/components/fields/number/ReadView.js +8 -6
  80. package/dist/components/fields/priority/ReadView.js +12 -10
  81. package/dist/components/fields/priority/style/index.js +53 -50
  82. package/dist/components/fields/radio/ReadView.d.ts +0 -1
  83. package/dist/components/fields/radio/ReadView.js +8 -6
  84. package/dist/components/fields/repo-files/ReadView.js +8 -6
  85. package/dist/components/fields/repo-files/utils.js +5 -3
  86. package/dist/components/fields/reporter/ReadView.d.ts +0 -1
  87. package/dist/components/fields/reporter/ReadView.js +11 -9
  88. package/dist/components/fields/script/BaseField.js +4 -1
  89. package/dist/components/fields/script/ReadView.d.ts +0 -1
  90. package/dist/components/fields/script/ReadView.js +10 -8
  91. package/dist/components/fields/sprint/ReadView.js +7 -5
  92. package/dist/components/fields/status/Cell.js +8 -6
  93. package/dist/components/fields/status/Field.d.ts +0 -1
  94. package/dist/components/fields/status/ReadView.js +10 -8
  95. package/dist/components/fields/status/SelectFlowHandler.js +15 -12
  96. package/dist/components/fields/status/SelectTransition.js +13 -10
  97. package/dist/components/fields/status/Transition.js +18 -15
  98. package/dist/components/fields/status/TransitionButton.js +17 -14
  99. package/dist/components/fields/status/TransitionPanel.js +14 -11
  100. package/dist/components/fields/status/View.js +11 -8
  101. package/dist/components/fields/status/style/index.js +300 -323
  102. package/dist/components/fields/story-point/ReadView.d.ts +0 -1
  103. package/dist/components/fields/story-point/ReadView.js +6 -4
  104. package/dist/components/fields/tag/ReadView.js +10 -8
  105. package/dist/components/fields/tag/style/index.js +7 -5
  106. package/dist/components/fields/team/ReadView.js +10 -8
  107. package/dist/components/fields/team/style/index.js +5 -3
  108. package/dist/components/fields/text/BaseField.d.ts +0 -1
  109. package/dist/components/fields/text/ReadView.js +8 -6
  110. package/dist/components/fields/tree/ReadView.js +10 -8
  111. package/dist/components/fields/tree/utils.js +5 -3
  112. package/dist/components/fields/updated-at/ReadView.js +10 -8
  113. package/dist/components/fields/updated-by/ReadView.d.ts +0 -1
  114. package/dist/components/fields/updated-by/ReadView.js +11 -9
  115. package/dist/components/fields/user/ReadView.d.ts +0 -1
  116. package/dist/components/fields/user/ReadView.js +11 -9
  117. package/dist/components/fields/user/style/index.js +12 -9
  118. package/dist/components/fields/user-group/BaseField.d.ts +0 -1
  119. package/dist/components/fields/user-group/ReadView.js +11 -13
  120. package/dist/components/fields/version/ReadView.js +8 -6
  121. package/dist/components/fields/workspace/ReadView.d.ts +0 -1
  122. package/dist/components/fields/workspace/ReadView.js +10 -8
  123. package/dist/components/filters/filter-search/utils.js +6 -6
  124. package/dist/components/item/hooks.js +5 -2
  125. package/dist/components/table-components/EditTableCell.d.ts +1 -0
  126. package/dist/components/table-components/EditTableCell.js +38 -16
  127. package/dist/components/table-components/index.js +14 -11
  128. package/dist/components/table-components/style/index.js +7 -5
  129. package/dist/components/table-components/utils.js +49 -46
  130. package/dist/icons/SyncIconFont.js +7 -5
  131. package/dist/icons/createFromIconFontClass.js +3 -1
  132. package/dist/icons/empty-icon/index.d.ts +8 -1
  133. package/dist/icons/empty-icon/large-item@2x.png.js +3 -0
  134. package/dist/icons/empty-icon/large-workspace@2x.png.js +3 -0
  135. package/dist/icons/empty-icon/small-default@2x.png.js +3 -0
  136. package/dist/icons/empty-icon/workspace-empty.svg +126 -126
  137. package/dist/icons/index.d.ts +1 -1
  138. package/dist/icons/index.js +37 -35
  139. package/dist/icons/style/index.js +23 -21
  140. package/dist/icons/svg/ArrowBack.svg.js +3 -0
  141. package/dist/icons/svg/Done.svg.js +3 -0
  142. package/dist/icons/svg/DottedCircle.svg.js +3 -0
  143. package/dist/icons/svg/HollowCircle.svg.js +3 -0
  144. package/dist/icons/svg/Search.svg.js +3 -0
  145. package/dist/icons/svg/Workflow.svg.js +3 -0
  146. package/dist/index.js +47 -47
  147. package/dist/lib/app/utils.d.ts +0 -1
  148. package/dist/lib/app/utils.js +4 -2
  149. package/dist/lib/array.js +5 -44
  150. package/dist/lib/config.js +8 -6
  151. package/dist/lib/constants/code.js +3 -1
  152. package/dist/lib/constants/field.js +5 -2
  153. package/dist/lib/contexts/antdConfig.js +10 -7
  154. package/dist/lib/contexts/currentUser.js +7 -4
  155. package/dist/lib/contexts/currentWorkspace.js +7 -4
  156. package/dist/lib/contexts/datetimeFormat.js +7 -4
  157. package/dist/lib/contexts/index.js +16 -13
  158. package/dist/lib/contexts/itemConfig.js +7 -4
  159. package/dist/lib/contexts/teamConfig.js +8 -5
  160. package/dist/lib/contexts/tenant.js +7 -4
  161. package/dist/lib/contexts/workflowConfig.js +7 -4
  162. package/dist/lib/dataType.js +4 -5
  163. package/dist/lib/date.js +11 -52
  164. package/dist/lib/dayjs.js +2 -1
  165. package/dist/lib/error/log.js +7 -4
  166. package/dist/lib/error/utils.d.ts +1 -1
  167. package/dist/lib/error/utils.js +8 -20
  168. package/dist/lib/error/withServerError.js +3 -1
  169. package/dist/lib/fetch.js +23 -54
  170. package/dist/lib/global.js +16 -14
  171. package/dist/lib/hooks/useAntdConfig.js +4 -2
  172. package/dist/lib/hooks/useCurrentUser.js +4 -2
  173. package/dist/lib/hooks/useCurrentWorkspace.js +4 -2
  174. package/dist/lib/hooks/useDataQuoteStore.js +8 -5
  175. package/dist/lib/hooks/useDateTimeFormatType.js +4 -2
  176. package/dist/lib/hooks/useI18n.d.ts +1 -1
  177. package/dist/lib/hooks/useI18n.js +4 -2
  178. package/dist/lib/hooks/useItemConfig.js +4 -2
  179. package/dist/lib/hooks/useTeamConfig.js +4 -2
  180. package/dist/lib/hooks/useTenant.js +4 -2
  181. package/dist/lib/hooks/useWorkflowConfig.js +4 -2
  182. package/dist/lib/i18n.js +6 -3
  183. package/dist/lib/icons/utils.js +10 -9
  184. package/dist/lib/isInOne.js +2 -1
  185. package/dist/lib/number.js +3 -1
  186. package/dist/lib/path.d.ts +2 -2
  187. package/dist/lib/path.js +9 -6
  188. package/dist/lib/regExp.js +3 -1
  189. package/dist/lib/router.js +4 -1
  190. package/dist/lib/storage.js +4 -39
  191. package/dist/lib/store/dataQuoteStore.js +5 -2
  192. package/dist/lib/swr/constants.js +4 -2
  193. package/dist/lib/swr/hooks.js +6 -3
  194. package/dist/lib/swr/throttleWithCache.js +7 -5
  195. package/dist/lib/throttleFetch.js +4 -2
  196. package/dist/lib/useConfig.js +9 -6
  197. package/dist/lib/useUser.js +9 -6
  198. package/dist/lib/users.js +5 -2
  199. package/dist/lib/workflow.js +21 -20
  200. package/dist/locales/index.js +5 -3
  201. package/dist/public/icons/BulbIcon.svg +1 -1
  202. package/dist/public/icons/Cloud.svg +1 -1
  203. package/dist/public/icons/ConsultIcon.svg +1 -1
  204. package/dist/public/icons/Demo.svg +1 -1
  205. package/dist/public/icons/ErrorTemplate.svg +1 -1
  206. package/dist/public/icons/Fail.svg +1 -1
  207. package/dist/public/icons/Flag.svg +1 -1
  208. package/dist/public/icons/GiteeIcon.svg +1 -1
  209. package/dist/public/icons/IntelligenceGradient.svg +1 -1
  210. package/dist/public/icons/Issue_Approval.svg +1 -1
  211. package/dist/public/icons/Issue_Bug.svg +1 -1
  212. package/dist/public/icons/Issue_Demand.svg +1 -1
  213. package/dist/public/icons/Issue_Doc.svg +1 -1
  214. package/dist/public/icons/Issue_Idea.svg +1 -1
  215. package/dist/public/icons/Issue_List.svg +1 -1
  216. package/dist/public/icons/Issue_Plan.svg +1 -1
  217. package/dist/public/icons/Issue_Product.svg +1 -1
  218. package/dist/public/icons/Issue_Risk.svg +1 -1
  219. package/dist/public/icons/Issue_Story.svg +1 -1
  220. package/dist/public/icons/Issue_Subtask.svg +1 -1
  221. package/dist/public/icons/Issue_Task.svg +1 -1
  222. package/dist/public/icons/Issue_Test.svg +1 -1
  223. package/dist/public/icons/Issue_TestExcution.svg +1 -1
  224. package/dist/public/icons/Issue_TestPlan.svg +1 -1
  225. package/dist/public/icons/Issue_Time.svg +1 -1
  226. package/dist/public/icons/Issue_develop.svg +1 -1
  227. package/dist/public/icons/KanbanCover.svg +7 -7
  228. package/dist/public/icons/ListCover.svg +117 -117
  229. package/dist/public/icons/ManHour.svg +1 -1
  230. package/dist/public/icons/MobileIcon.svg +1 -1
  231. package/dist/public/icons/NoItemType.svg +10 -10
  232. package/dist/public/icons/ProductIcon.svg +1 -1
  233. package/dist/public/icons/RedFlagIcon.svg +1 -1
  234. package/dist/public/icons/Safe.svg +1 -1
  235. package/dist/public/icons/StarIcon.svg +60 -60
  236. package/dist/public/icons/StructureCover.svg +1 -1
  237. package/dist/public/icons/Success.svg +1 -1
  238. package/dist/public/icons/TeamIcon.svg +1 -1
  239. package/dist/public/icons/WebIcon.svg +1 -1
  240. package/dist/public/icons/iconfont.svg +467 -467
  241. package/dist/public/icons/iconfont_single_color.css +912 -912
  242. package/dist/public/mockServiceWorker.js +284 -284
  243. package/dist/style/common.js +11 -24
  244. package/dist/style/global.js +9 -7
  245. package/package.json +111 -105
  246. package/dist/components/fields/base-component/types.js +0 -1
  247. package/dist/components/fields/hooks/useParamsAdapter.js +0 -1
  248. package/dist/components/fields/radio/BaseField.js +0 -1
  249. package/dist/components/fields/status/Field.js +0 -1
  250. package/dist/components/fields/tag/BaseField.js +0 -1
  251. package/dist/components/fields/text/BaseField.js +0 -1
  252. package/dist/components/fields/tree/BaseField.js +0 -1
  253. package/dist/components/fields/tree/types.js +0 -1
  254. package/dist/components/fields/types.js +0 -1
  255. package/dist/components/fields/user-group/ActionCell.js +0 -1
  256. package/dist/components/fields/user-group/BaseField.js +0 -1
  257. package/dist/icons/empty-icon/index.js +0 -8
  258. package/dist/icons/svg/ArrowBack.svg +0 -1
  259. package/dist/icons/svg/Done.svg +0 -1
  260. package/dist/icons/svg/DottedCircle.svg +0 -7
  261. package/dist/icons/svg/HollowCircle.svg +0 -6
  262. package/dist/icons/svg/Search.svg +0 -1
  263. package/dist/icons/svg/Workflow.svg +0 -12
  264. package/dist/lib/error/index.js +0 -2
package/dist/lib/fetch.js CHANGED
@@ -1,44 +1,36 @@
1
- import { useCallback, useContext, useEffect, useMemo } from 'react';
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 'lib/global';
7
- import throttleWithCache, { THROTTLE_TYPE } from 'lib/swr/throttleWithCache';
8
- import { ParseErrorCode } from './constants/code';
9
- import { TeamConfigContext } from './contexts/teamConfig';
10
- import { IGNORE_URL } from './error/withServerError';
11
- import { getErrorMessage, log as ErrorLog } from './error';
12
- import { i18n } from './i18n';
13
- import isInOne from './isInOne';
14
- import { useGetSourcePath } from './path';
15
- import { getCurLocationInfo } from './router';
16
- import { removeParseItems } from './storage';
17
- import { useAppProps } from './useConfig';
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
- const isDev = process.env.NODE_ENV === 'development';
21
+ process.env.NODE_ENV === 'development';
20
22
  const DEFAULT_TIMEOUT = 15 * 1000;
21
- export const useGetConfigTimeout = () => {
23
+ const useGetConfigTimeout = () => {
22
24
  const { publicRuntimeConfig = {} } = useContext(TeamConfigContext);
23
25
  const { globalFetchTimeout } = publicRuntimeConfig;
24
26
  return toNumber(globalFetchTimeout) || DEFAULT_TIMEOUT;
25
27
  };
26
- export const baseApi = '/parse/api';
27
- export const useGetLoginBasePath = () => {
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
- export const useGetGateway = (extraPath = '') => {
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
- export function useGetRequestConfig({ sessionToken, tenant, Cookie }) {
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
- export default useFetch;
269
+
270
+ export { baseApi, useFetch as default, useAxiosConfig, useGetConfigTimeout, useGetGateway, useGetServerGateway };
@@ -1,4 +1,4 @@
1
- export const FIELD_TYPE_KEY_MAPPINGS = {
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
- export const DATE_TYPE = {
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
- export const DATE_FORMAT = {
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
- export const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm';
76
- export const DATE_TIME_FORMAT_SEC = 'YYYY-MM-DD HH:mm:ss';
77
- export var WorkflowStatusType;
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
- export const WorkFlowStatusColor = {
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
- export const CustomFieldComponentTypes = {
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
- export const BASE_FIELD_WIDTH = 104;
102
- export const CURRENT_WORKSPACE = 'currentWorkspace()';
103
- export const FIELD_CONTAINERS_PAGE = {
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
- export const SCREEN_TYPE = {
112
+ const SCREEN_TYPE = {
113
113
  View: 'view',
114
114
  Create: 'create',
115
115
  Edit: 'edit',
116
116
  };
117
- export const CANCEL_FETCH_STRING = 'cancel_fetch_string';
118
- export const REDIRECT_URL_KEY = 'team_redirect_url';
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 '../../lib/contexts/antdConfig';
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
- export default useAntdConfig;
8
+
9
+ export { useAntdConfig as default };
@@ -1,7 +1,9 @@
1
1
  import { useContext } from 'react';
2
- import { CurrentUserContext } from '../../lib/contexts/currentUser';
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
- export default useCurrentUser;
8
+
9
+ export { useCurrentUser as default };
@@ -1,7 +1,9 @@
1
1
  import { useContext } from 'react';
2
- import { CurrentWorkspaceContext } from '../../lib/contexts/currentWorkspace';
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
- export default useCurrentWorkspace;
8
+
9
+ export { useCurrentWorkspace as default };
@@ -1,10 +1,11 @@
1
- import { useEffect, useMemo } from 'react';
2
- import { clone, isEmpty } from 'lodash-es';
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 { currentDeleteState, dataQuoteState } from '../store/dataQuoteStore';
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
- export const useDataQuoteStore = (dataSources, getOptionsByValues) => {
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 '../../lib/contexts/datetimeFormat';
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
- export default useDateTimeFormatType;
8
+
9
+ export { useDateTimeFormatType as default };
@@ -1,3 +1,3 @@
1
1
  import { i18n } from '../i18n';
2
- declare const useI18n: () => Pick<typeof i18n, 't'>;
2
+ declare const useI18n: () => Pick<typeof i18n, "t">;
3
3
  export default useI18n;
@@ -1,7 +1,9 @@
1
- import { i18n } from '../i18n';
1
+ import { i18n } from '../i18n.js';
2
+
2
3
  const useI18n = () => {
3
4
  return {
4
5
  t: i18n.t,
5
6
  };
6
7
  };
7
- export default useI18n;
8
+
9
+ export { useI18n as default };
@@ -1,7 +1,9 @@
1
1
  import { useContext } from 'react';
2
- import { ItemConfigContext } from '../../lib/contexts/itemConfig';
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
- export default useItemConfig;
8
+
9
+ export { useItemConfig as default };
@@ -1,7 +1,9 @@
1
1
  import { useContext } from 'react';
2
- import { TeamConfigContext } from '../../lib/contexts/teamConfig';
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
- export default useTeamConfig;
8
+
9
+ export { useTeamConfig as default };
@@ -1,7 +1,9 @@
1
1
  import { useContext } from 'react';
2
- import { TenantContext } from '../../lib/contexts/tenant';
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
- export default useTenant;
8
+
9
+ export { useTenant as default };
@@ -1,7 +1,9 @@
1
1
  import { useContext } from 'react';
2
- import { WorkflowConfigContext } from '../../lib/contexts/workflowConfig';
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
- export default useWorkflowConfig;
8
+
9
+ export { useWorkflowConfig as default };
package/dist/lib/i18n.js CHANGED
@@ -1,4 +1,5 @@
1
- import { en, ru, zh } from '../locales';
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
- export const i18n = {
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
- export const nsSeparator = '@';
36
+ const nsSeparator = '@';
37
+
38
+ export { i18n, nsSeparator };
@@ -1,6 +1,7 @@
1
1
  import { useMemo } from 'react';
2
- import { useGetBasePath } from 'lib/path';
3
- export const polyfillItemTypeIconMap = {
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
- export const takeIconFromUrl = (url) => {
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
- export const useIsIconFont = (url) => {
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
- export const isServerUrl = (url) => {
31
+ const isServerUrl = (url) => {
31
32
  return url.startsWith('http') || url.startsWith('/parse/files');
32
33
  };
33
- export const usePolyFillIcon = (url, defaultIconFontType) => {
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 SUFFIX = 'B';
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 };
@@ -11,4 +11,5 @@ const isInOne = (gateway, isMicroApp) => {
11
11
  return gateway.startsWith('/api');
12
12
  }
13
13
  };
14
- export default isInOne;
14
+
15
+ export { isInOne as default };
@@ -1,3 +1,5 @@
1
- export const numberPrecisionInit = (value, precision) => {
1
+ const numberPrecisionInit = (value, precision) => {
2
2
  return Math.round(value * Math.pow(10, precision)) / Math.pow(10, precision);
3
3
  };
4
+
5
+ export { numberPrecisionInit };
@@ -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
- export const iconBasePath = '/icons';
5
- export const startsWithIconPath = startsWith(iconBasePath);
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
- export const useGetBasePath = () => {
28
+ const useGetBasePath = () => {
28
29
  const { publicRuntimeConfig } = useContext(TeamConfigContext);
29
30
  return (publicRuntimeConfig === null || publicRuntimeConfig === void 0 ? void 0 : publicRuntimeConfig.basePath) || '';
30
31
  };
31
- export const useGetSourcePath = () => {
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
- export const usePatchIconUrl = () => {
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 };
@@ -1 +1,3 @@
1
- export const REG_EN_NUMBER = /^[A-Za-z0-9]+$/;
1
+ const REG_EN_NUMBER = /^[A-Za-z0-9]+$/;
2
+
3
+ export { REG_EN_NUMBER };
@@ -1,5 +1,6 @@
1
1
  import queryString from 'query-string';
2
- export const getCurLocationInfo = () => {
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 };
@@ -1,4 +1,4 @@
1
- export const getLocalStorageItem = (key, defaults = '') => {
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
- export const removeParseItems = () => {
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
- export default {
37
- getItem: getLocalStorageItem,
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
- export const dataQuoteState = atom({
2
+
3
+ const dataQuoteState = atom({
3
4
  key: 'dataQuoteState',
4
5
  default: [],
5
6
  });
6
- export const currentDeleteState = atom({
7
+ const currentDeleteState = atom({
7
8
  key: 'currentDeleteState',
8
9
  default: '',
9
10
  });
11
+
12
+ export { currentDeleteState, dataQuoteState };
@@ -1,4 +1,4 @@
1
- export var API_KEY;
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
- export var FetchCustomFieldTypeBySchemeType;
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 };
@@ -1,7 +1,8 @@
1
1
  import useSWR from 'swr';
2
- import useItemConfig from '../hooks/useItemConfig';
3
- import { API_KEY } from './constants';
4
- export const useFetchItemById = ({ id, disable = false, detail, }) => {
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 'lib/storage';
3
- export const DISABLE_THROTTLE_API_FETCH = 'DISABLE_THROTTLE_API_FETCH';
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
- export var THROTTLE_TYPE;
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
- export const createKeyByParams = ({ type, params }) => {
104
+ const createKeyByParams = ({ type, params }) => {
104
105
  if (!params)
105
106
  return `${+new Date()}`;
106
107
  return `${type}_${JSON.stringify(params)}`;
107
108
  };
108
- export default throttleWithCache;
109
+
110
+ export { DISABLE_THROTTLE_API_FETCH, THROTTLE_TYPE, createKeyByParams, throttleWithCache as default };