@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/index.js CHANGED
@@ -1,47 +1,47 @@
1
- export { default as EmptyField } from './components/common/EmptyField';
2
- export { default as BaseOverflowTooltip } from './components/common/overflow-tooltip/BaseOverflowTooltip';
3
- export { default as SimpleOverflowToolTip } from './components/common/overflow-tooltip/SimpleOverflowToolTip';
4
- export { PriceTag } from './components/common/PriceTag';
5
- export { default as UserAvatar } from './components/common/user-field/UserAvatar';
6
- export { default as ActorsReadView } from './components/fields/actors/ReadView';
7
- export { default as AncestorReadView } from './components/fields/ancestor/ReadView';
8
- export { default as AssigneeReadView } from './components/fields/assignee/ReadView';
9
- export { default as BindWorkspaceReadView } from './components/fields/bind-workspace/ReadView';
10
- export { default as CheckboxReadView } from './components/fields/checkbox/ReadView';
11
- export { default as CreatedAtReadView } from './components/fields/created-at/ReadView';
12
- export { default as CreatedByReadView } from './components/fields/created-by/ReadView';
13
- export { default as DataQuoteReadView } from './components/fields/data-quote/ReadView';
14
- export { default as DateReadView } from './components/fields/date/ReadView';
15
- export { default as DropdownCell } from './components/fields/dropdown/Cell';
16
- export { default as DropdownReadView } from './components/fields/dropdown/ReadView';
17
- export { default as FileReadView } from './components/fields/file/ReadView';
18
- export { default as FormulaReadView } from './components/fields/formula/ReadView';
19
- export { default as HyperLinkReadView } from './components/fields/hyper-link/ReadView';
20
- export { default as ItemGroupReadView } from './components/fields/item-group/ReadView';
21
- export { default as ItemTypeReadView } from './components/fields/item-type/ReadView';
22
- export { default as KeyReadView } from './components/fields/key/ReadView';
23
- export { default as LongTextReadView } from './components/fields/long-text/ReadView';
24
- export { default as NumberReadView } from './components/fields/number/ReadView';
25
- export { default as PriorityReadView } from './components/fields/priority/ReadView';
26
- export { default as RadioReadView } from './components/fields/radio/ReadView';
27
- export { default as RepoFileReadView } from './components/fields/repo-files/ReadView';
28
- export { default as ReporterReadView } from './components/fields/reporter/ReadView';
29
- export { default as ScriptReadView } from './components/fields/script/ReadView';
30
- export { default as SprintReadView } from './components/fields/sprint/ReadView';
31
- export { default as StatusCell } from './components/fields/status/Cell';
32
- export { default as StatusReadView } from './components/fields/status/ReadView';
33
- export { default as StoryPointReadView } from './components/fields/story-point/ReadView';
34
- export { default as TagReadView } from './components/fields/tag/ReadView';
35
- export { default as TeamReadView } from './components/fields/team/ReadView';
36
- export { default as TextReadView } from './components/fields/text/ReadView';
37
- export { default as TreeReadView } from './components/fields/tree/ReadView';
38
- export { default as UpdatedAtReadView } from './components/fields/updated-at/ReadView';
39
- export { default as UpdatedByReadView } from './components/fields/updated-by/ReadView';
40
- export { default as UserReadView } from './components/fields/user/ReadView';
41
- export { default as UserGroupReadView } from './components/fields/user-group/ReadView';
42
- export { default as VersionReadView } from './components/fields/version/ReadView';
43
- export { default as WorkspaceReadView } from './components/fields/workspace/ReadView';
44
- export { TableCell } from './components/table-components';
45
- export { getAllReadComponents, getStandardEditComponents, getStandardReadComponents, } from './components/table-components/utils';
46
- export { LibraryProvider } from './lib/contexts';
47
- export { useDataQuoteStore } from './lib/hooks/useDataQuoteStore';
1
+ export { default as EmptyField } from './components/common/EmptyField.js';
2
+ export { default as BaseOverflowTooltip } from './components/common/overflow-tooltip/BaseOverflowTooltip.js';
3
+ export { default as SimpleOverflowToolTip } from './components/common/overflow-tooltip/SimpleOverflowToolTip.js';
4
+ export { PriceTag } from './components/common/PriceTag.js';
5
+ export { default as UserAvatar } from './components/common/user-field/UserAvatar.js';
6
+ export { default as ActorsReadView } from './components/fields/actors/ReadView.js';
7
+ export { default as AncestorReadView } from './components/fields/ancestor/ReadView.js';
8
+ export { default as AssigneeReadView } from './components/fields/assignee/ReadView.js';
9
+ export { default as BindWorkspaceReadView } from './components/fields/bind-workspace/ReadView.js';
10
+ export { default as CheckboxReadView } from './components/fields/checkbox/ReadView.js';
11
+ export { default as CreatedAtReadView } from './components/fields/created-at/ReadView.js';
12
+ export { default as CreatedByReadView } from './components/fields/created-by/ReadView.js';
13
+ export { default as DataQuoteReadView } from './components/fields/data-quote/ReadView.js';
14
+ export { default as DateReadView } from './components/fields/date/ReadView.js';
15
+ export { default as DropdownCell } from './components/fields/dropdown/Cell.js';
16
+ export { default as DropdownReadView } from './components/fields/dropdown/ReadView.js';
17
+ export { default as FileReadView } from './components/fields/file/ReadView.js';
18
+ export { default as FormulaReadView } from './components/fields/formula/ReadView.js';
19
+ export { default as HyperLinkReadView } from './components/fields/hyper-link/ReadView.js';
20
+ export { default as ItemGroupReadView } from './components/fields/item-group/ReadView.js';
21
+ export { default as ItemTypeReadView } from './components/fields/item-type/ReadView.js';
22
+ export { default as KeyReadView } from './components/fields/key/ReadView.js';
23
+ export { default as LongTextReadView } from './components/fields/long-text/ReadView.js';
24
+ export { default as NumberReadView } from './components/fields/number/ReadView.js';
25
+ export { default as PriorityReadView } from './components/fields/priority/ReadView.js';
26
+ export { default as RadioReadView } from './components/fields/radio/ReadView.js';
27
+ export { default as RepoFileReadView } from './components/fields/repo-files/ReadView.js';
28
+ export { default as ReporterReadView } from './components/fields/reporter/ReadView.js';
29
+ export { default as ScriptReadView } from './components/fields/script/ReadView.js';
30
+ export { default as SprintReadView } from './components/fields/sprint/ReadView.js';
31
+ export { default as StatusCell } from './components/fields/status/Cell.js';
32
+ export { default as StatusReadView } from './components/fields/status/ReadView.js';
33
+ export { default as StoryPointReadView } from './components/fields/story-point/ReadView.js';
34
+ export { default as TagReadView } from './components/fields/tag/ReadView.js';
35
+ export { default as TeamReadView } from './components/fields/team/ReadView.js';
36
+ export { default as TextReadView } from './components/fields/text/ReadView.js';
37
+ export { default as TreeReadView } from './components/fields/tree/ReadView.js';
38
+ export { default as UpdatedAtReadView } from './components/fields/updated-at/ReadView.js';
39
+ export { default as UpdatedByReadView } from './components/fields/updated-by/ReadView.js';
40
+ export { default as UserReadView } from './components/fields/user/ReadView.js';
41
+ export { default as UserGroupReadView } from './components/fields/user-group/ReadView.js';
42
+ export { default as VersionReadView } from './components/fields/version/ReadView.js';
43
+ export { default as WorkspaceReadView } from './components/fields/workspace/ReadView.js';
44
+ export { TableCell } from './components/table-components/index.js';
45
+ export { getAllReadComponents, getStandardEditComponents, getStandardReadComponents } from './components/table-components/utils.js';
46
+ export { LibraryProvider } from './lib/contexts/index.js';
47
+ export { useDataQuoteStore } from './lib/hooks/useDataQuoteStore.js';
@@ -1,3 +1,2 @@
1
- /// <reference types="node" />
2
1
  export declare const requestIdleCallback: (((callback: IdleRequestCallback, options?: IdleRequestOptions) => number) & typeof globalThis.requestIdleCallback) | ((cb: any) => NodeJS.Timeout);
3
2
  export declare const cancelIdleCallback: ((handle: number) => void) & typeof globalThis.cancelIdleCallback;
@@ -1,4 +1,4 @@
1
- export const requestIdleCallback = (window === null || window === void 0 ? void 0 : window.requestIdleCallback) ||
1
+ const requestIdleCallback = (window === null || window === void 0 ? void 0 : window.requestIdleCallback) ||
2
2
  function (cb) {
3
3
  const start = Date.now();
4
4
  return setTimeout(function () {
@@ -10,7 +10,9 @@ export const requestIdleCallback = (window === null || window === void 0 ? void
10
10
  });
11
11
  }, 1);
12
12
  };
13
- export const cancelIdleCallback = (window === null || window === void 0 ? void 0 : window.cancelIdleCallback) ||
13
+ const cancelIdleCallback = (window === null || window === void 0 ? void 0 : window.cancelIdleCallback) ||
14
14
  function (id) {
15
15
  clearTimeout(id);
16
16
  };
17
+
18
+ export { cancelIdleCallback, requestIdleCallback };
package/dist/lib/array.js CHANGED
@@ -1,44 +1,5 @@
1
- import { difference, get, isArray } from 'lodash-es';
2
- export const arrayDiff = (origin, target) => {
3
- const remove = difference(origin, target);
4
- const insert = difference(target, origin);
5
- return { insert, remove };
6
- };
7
- export const serializationArrayByKey = (list, keyPath) => {
8
- if (!list) {
9
- return null;
10
- }
11
- return list.reduce((prev, current) => {
12
- const currentId = get(current, keyPath);
13
- return {
14
- ...prev,
15
- [currentId]: (prev[currentId] || []).concat([current]),
16
- };
17
- }, {});
18
- };
19
- export const createHash = () => {
20
- return performance.now();
21
- };
22
- export function parseArray(str) {
23
- if (!str) {
24
- return [];
25
- }
26
- if (Array.isArray(str)) {
27
- return str;
28
- }
29
- if (typeof str === 'string') {
30
- let result = [];
31
- try {
32
- result = str
33
- .split(',')
34
- .map(item => item.trim())
35
- .filter(item => !!item);
36
- }
37
- catch (error) {
38
- console.error('...parseArray error', str, error);
39
- }
40
- return result;
41
- }
42
- return [];
43
- }
44
- export const getArrayValue = (value) => { var _a; return (_a = (isArray(value) ? value : [value])) === null || _a === void 0 ? void 0 : _a.filter(Boolean); };
1
+ import { isArray } from 'lodash-es';
2
+
3
+ const getArrayValue = (value) => { var _a; return (_a = (isArray(value) ? value : [value])) === null || _a === void 0 ? void 0 : _a.filter(Boolean); };
4
+
5
+ export { getArrayValue };
@@ -1,20 +1,20 @@
1
- export const getPublicRuntimeConfig = () => {
1
+ const getPublicRuntimeConfig = () => {
2
2
  var _a;
3
3
  if (typeof window !== 'undefined') {
4
4
  return (_a = window.__PROXIMA_DATA__) === null || _a === void 0 ? void 0 : _a.publicRuntimeConfig;
5
5
  }
6
6
  return {};
7
7
  };
8
- export const getUserConfig = () => {
8
+ const getUserConfig = () => {
9
9
  var _a;
10
10
  if (typeof window !== 'undefined') {
11
11
  return (_a = window.__PROXIMA_DATA__) === null || _a === void 0 ? void 0 : _a.userConfig;
12
12
  }
13
13
  return {};
14
14
  };
15
- export const publicRuntimeConfig = getPublicRuntimeConfig() || {};
16
- export const userConfig = getUserConfig();
17
- export function getAcceptLanguageHeader(locale) {
15
+ getPublicRuntimeConfig() || {};
16
+ getUserConfig();
17
+ function getAcceptLanguageHeader(locale) {
18
18
  switch (locale) {
19
19
  case 'zh-CN':
20
20
  return 'zh-CN;q=0.9,zh;q=0.8,en;q=0.7';
@@ -31,7 +31,7 @@ export function getAcceptLanguageHeader(locale) {
31
31
  return 'en;q=0.9';
32
32
  }
33
33
  }
34
- export const getQiankunConfig = () => {
34
+ const getQiankunConfig = () => {
35
35
  var _a, _b, _c;
36
36
  const context = (_a = window === null || window === void 0 ? void 0 : window.QiankunProps) === null || _a === void 0 ? void 0 : _a.context;
37
37
  const env = context === null || context === void 0 ? void 0 : context.env;
@@ -43,3 +43,5 @@ export const getQiankunConfig = () => {
43
43
  locales: (_c = (_b = env === null || env === void 0 ? void 0 : env.LOCALES) !== null && _b !== void 0 ? _b : process.env.LOCALES) !== null && _c !== void 0 ? _c : 'zh',
44
44
  };
45
45
  };
46
+
47
+ export { getAcceptLanguageHeader, getPublicRuntimeConfig, getQiankunConfig, getUserConfig };
@@ -1,4 +1,6 @@
1
- export const ParseErrorCode = {
1
+ const ParseErrorCode = {
2
2
  INVALID_SESSION_TOKEN: 209,
3
3
  OBJECT_NOT_FOUND: 101,
4
4
  };
5
+
6
+ export { ParseErrorCode };
@@ -1,2 +1,5 @@
1
- import { FIELD_TYPE_KEY_MAPPINGS } from 'lib/global';
2
- export const REMOTE_DATA_QUOTE_FIELD_TYPE = [FIELD_TYPE_KEY_MAPPINGS.RemoteFieldRemoteDataQuote];
1
+ import { FIELD_TYPE_KEY_MAPPINGS } from '../global.js';
2
+
3
+ const REMOTE_DATA_QUOTE_FIELD_TYPE = [FIELD_TYPE_KEY_MAPPINGS.RemoteFieldRemoteDataQuote];
4
+
5
+ export { REMOTE_DATA_QUOTE_FIELD_TYPE };
@@ -1,13 +1,16 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
1
+ import { jsxs, jsx } from '@emotion/react/jsx-runtime';
2
2
  import { createContext } from 'react';
3
- import { css, Global } from '@emotion/react';
4
- import { fieldCellGlobalStyle } from '../../components/table-components/style';
3
+ import { Global, css } from '@emotion/react';
4
+ import { fieldCellGlobalStyle } from '../../components/table-components/style/index.js';
5
+
5
6
  const defaultContext = {};
6
7
  const defaultAntPrefix = 'ant';
7
- export const AntdConfigContext = createContext(defaultContext);
8
- export const AntdConfigProvider = ({ getPopupContainer, antPrefix = defaultAntPrefix, children, }) => {
9
- return (_jsxs(AntdConfigContext.Provider, { value: {
8
+ const AntdConfigContext = createContext(defaultContext);
9
+ const AntdConfigProvider = ({ getPopupContainer, antPrefix = defaultAntPrefix, children, }) => {
10
+ return (jsxs(AntdConfigContext.Provider, { value: {
10
11
  getPopupContainer,
11
12
  antPrefix,
12
- }, children: [_jsx(Global, { styles: css(fieldCellGlobalStyle) }), children] }));
13
+ }, children: [jsx(Global, { styles: css(fieldCellGlobalStyle) }), children] }));
13
14
  };
15
+
16
+ export { AntdConfigContext, AntdConfigProvider };
@@ -1,9 +1,12 @@
1
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
1
+ import { jsx } from '@emotion/react/jsx-runtime';
2
2
  import { createContext } from 'react';
3
+
3
4
  const defaultContext = {};
4
- export const CurrentUserContext = createContext(defaultContext);
5
- export const CurrentUserProvider = ({ currentUser, children }) => {
6
- return (_jsx(CurrentUserContext.Provider, { value: {
5
+ const CurrentUserContext = createContext(defaultContext);
6
+ const CurrentUserProvider = ({ currentUser, children }) => {
7
+ return (jsx(CurrentUserContext.Provider, { value: {
7
8
  currentUser,
8
9
  }, children: children }));
9
10
  };
11
+
12
+ export { CurrentUserContext, CurrentUserProvider };
@@ -1,9 +1,12 @@
1
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
1
+ import { jsx } from '@emotion/react/jsx-runtime';
2
2
  import { createContext } from 'react';
3
+
3
4
  const defaultContext = {};
4
- export const CurrentWorkspaceContext = createContext(defaultContext);
5
- export const CurrentWorkspaceProvider = ({ workspaceKey, children }) => {
6
- return (_jsx(CurrentWorkspaceContext.Provider, { value: {
5
+ const CurrentWorkspaceContext = createContext(defaultContext);
6
+ const CurrentWorkspaceProvider = ({ workspaceKey, children }) => {
7
+ return (jsx(CurrentWorkspaceContext.Provider, { value: {
7
8
  workspaceKey,
8
9
  }, children: children }));
9
10
  };
11
+
12
+ export { CurrentWorkspaceContext, CurrentWorkspaceProvider };
@@ -1,9 +1,12 @@
1
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
1
+ import { jsx } from '@emotion/react/jsx-runtime';
2
2
  import { createContext } from 'react';
3
+
3
4
  const defaultContext = {};
4
- export const DatetimeFormatContext = createContext(defaultContext);
5
- export const DatetimeFormatProvider = ({ datetimeFormat, children }) => {
6
- return (_jsx(DatetimeFormatContext.Provider, { value: {
5
+ const DatetimeFormatContext = createContext(defaultContext);
6
+ const DatetimeFormatProvider = ({ datetimeFormat, children }) => {
7
+ return (jsx(DatetimeFormatContext.Provider, { value: {
7
8
  datetimeFormat,
8
9
  }, children: children }));
9
10
  };
11
+
12
+ export { DatetimeFormatContext, DatetimeFormatProvider };
@@ -1,17 +1,18 @@
1
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
- import { useEffect, useMemo } from 'react';
1
+ import { jsx } from '@emotion/react/jsx-runtime';
2
+ import { useMemo, useEffect } from 'react';
3
3
  import createCache from '@emotion/cache';
4
4
  import { CacheProvider } from '@emotion/react';
5
- import { i18n } from '../i18n';
6
- import { AntdConfigProvider } from './antdConfig';
7
- import { CurrentUserProvider } from './currentUser';
8
- import { CurrentWorkspaceProvider } from './currentWorkspace';
9
- import { DatetimeFormatProvider } from './datetimeFormat';
10
- import { ItemConfigProvider } from './itemConfig';
11
- import { TeamConfigProvider } from './teamConfig';
12
- import { TenantProvider } from './tenant';
13
- import { WorkflowConfigProvider } from './workflowConfig';
14
- export const LibraryProvider = ({ getPopupContainer, locale, tenant, datetimeFormat, teamBasePath, teamGateway, isMicroApp, publicRuntimeConfig, userConfig, workspaceKey, workflow, item, currentUser, emotionCacheOptions, children, }) => {
5
+ import { i18n } from '../i18n.js';
6
+ import { AntdConfigProvider } from './antdConfig.js';
7
+ import { CurrentUserProvider } from './currentUser.js';
8
+ import { CurrentWorkspaceProvider } from './currentWorkspace.js';
9
+ import { DatetimeFormatProvider } from './datetimeFormat.js';
10
+ import { ItemConfigProvider } from './itemConfig.js';
11
+ import { TeamConfigProvider } from './teamConfig.js';
12
+ import { TenantProvider } from './tenant.js';
13
+ import { WorkflowConfigProvider } from './workflowConfig.js';
14
+
15
+ const LibraryProvider = ({ getPopupContainer, locale, tenant, datetimeFormat, teamBasePath, teamGateway, isMicroApp, publicRuntimeConfig, userConfig, workspaceKey, workflow, item, currentUser, emotionCacheOptions, children, }) => {
15
16
  const emotionCache = useMemo(() => {
16
17
  return createCache({
17
18
  key: 'apps',
@@ -21,5 +22,7 @@ export const LibraryProvider = ({ getPopupContainer, locale, tenant, datetimeFor
21
22
  useEffect(() => {
22
23
  i18n.setLocale(locale);
23
24
  }, [locale]);
24
- return (_jsx(CacheProvider, { value: emotionCache, children: _jsx(AntdConfigProvider, { getPopupContainer: getPopupContainer, children: _jsx(TeamConfigProvider, { teamBasePath: teamBasePath, teamGateway: teamGateway, isMicroApp: isMicroApp, publicRuntimeConfig: publicRuntimeConfig, userConfig: userConfig, children: _jsx(TenantProvider, { tenant: tenant, children: _jsx(CurrentWorkspaceProvider, { workspaceKey: workspaceKey, children: _jsx(DatetimeFormatProvider, { datetimeFormat: datetimeFormat, children: _jsx(CurrentUserProvider, { currentUser: currentUser, children: _jsx(WorkflowConfigProvider, { workflow: workflow, children: _jsx(ItemConfigProvider, { item: item, children: children }) }) }) }) }) }) }) }) }));
25
+ return (jsx(CacheProvider, { value: emotionCache, children: jsx(AntdConfigProvider, { getPopupContainer: getPopupContainer, children: jsx(TeamConfigProvider, { teamBasePath: teamBasePath, teamGateway: teamGateway, isMicroApp: isMicroApp, publicRuntimeConfig: publicRuntimeConfig, userConfig: userConfig, children: jsx(TenantProvider, { tenant: tenant, children: jsx(CurrentWorkspaceProvider, { workspaceKey: workspaceKey, children: jsx(DatetimeFormatProvider, { datetimeFormat: datetimeFormat, children: jsx(CurrentUserProvider, { currentUser: currentUser, children: jsx(WorkflowConfigProvider, { workflow: workflow, children: jsx(ItemConfigProvider, { item: item, children: children }) }) }) }) }) }) }) }) }));
25
26
  };
27
+
28
+ export { LibraryProvider };
@@ -1,9 +1,12 @@
1
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
1
+ import { jsx } from '@emotion/react/jsx-runtime';
2
2
  import { createContext } from 'react';
3
+
3
4
  const defaultContext = {};
4
- export const ItemConfigContext = createContext(defaultContext);
5
- export const ItemConfigProvider = ({ item, children }) => {
6
- return (_jsx(ItemConfigContext.Provider, { value: {
5
+ const ItemConfigContext = createContext(defaultContext);
6
+ const ItemConfigProvider = ({ item, children }) => {
7
+ return (jsx(ItemConfigContext.Provider, { value: {
7
8
  item,
8
9
  }, children: children }));
9
10
  };
11
+
12
+ export { ItemConfigContext, ItemConfigProvider };
@@ -1,9 +1,10 @@
1
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
1
+ import { jsx } from '@emotion/react/jsx-runtime';
2
2
  import { createContext, useMemo } from 'react';
3
- import { getPublicRuntimeConfig, getQiankunConfig, getUserConfig } from 'lib/config';
3
+ import { getQiankunConfig, getPublicRuntimeConfig, getUserConfig } from '../config.js';
4
+
4
5
  const defaultContext = {};
5
- export const TeamConfigContext = createContext(defaultContext);
6
- export const TeamConfigProvider = ({ teamGateway, teamBasePath, isMicroApp, children, publicRuntimeConfig, userConfig, }) => {
6
+ const TeamConfigContext = createContext(defaultContext);
7
+ const TeamConfigProvider = ({ teamGateway, teamBasePath, isMicroApp, children, publicRuntimeConfig, userConfig, }) => {
7
8
  const runtimeConfig = useMemo(() => {
8
9
  const config = { ...getQiankunConfig(), ...getPublicRuntimeConfig(), ...(publicRuntimeConfig || {}) };
9
10
  if (teamGateway) {
@@ -18,9 +19,11 @@ export const TeamConfigProvider = ({ teamGateway, teamBasePath, isMicroApp, chil
18
19
  const config = { ...getUserConfig(), ...(userConfig || {}) };
19
20
  return config;
20
21
  }, [userConfig]);
21
- return (_jsx(TeamConfigContext.Provider, { value: {
22
+ return (jsx(TeamConfigContext.Provider, { value: {
22
23
  isMicroApp,
23
24
  publicRuntimeConfig: runtimeConfig,
24
25
  userConfig: _userConfig,
25
26
  }, children: children }));
26
27
  };
28
+
29
+ export { TeamConfigContext, TeamConfigProvider };
@@ -1,9 +1,12 @@
1
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
1
+ import { jsx } from '@emotion/react/jsx-runtime';
2
2
  import { createContext } from 'react';
3
+
3
4
  const defaultContext = {};
4
- export const TenantContext = createContext(defaultContext);
5
- export const TenantProvider = ({ tenant, children }) => {
6
- return (_jsx(TenantContext.Provider, { value: {
5
+ const TenantContext = createContext(defaultContext);
6
+ const TenantProvider = ({ tenant, children }) => {
7
+ return (jsx(TenantContext.Provider, { value: {
7
8
  tenant,
8
9
  }, children: children }));
9
10
  };
11
+
12
+ export { TenantContext, TenantProvider };
@@ -1,9 +1,12 @@
1
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
1
+ import { jsx } from '@emotion/react/jsx-runtime';
2
2
  import { createContext } from 'react';
3
+
3
4
  const defaultContext = {};
4
- export const WorkflowConfigContext = createContext(defaultContext);
5
- export const WorkflowConfigProvider = ({ workflow, children }) => {
6
- return (_jsx(WorkflowConfigContext.Provider, { value: {
5
+ const WorkflowConfigContext = createContext(defaultContext);
6
+ const WorkflowConfigProvider = ({ workflow, children }) => {
7
+ return (jsx(WorkflowConfigContext.Provider, { value: {
7
8
  workflow,
8
9
  }, children: children }));
9
10
  };
11
+
12
+ export { WorkflowConfigContext, WorkflowConfigProvider };
@@ -1,9 +1,6 @@
1
1
  import { isNil } from 'lodash-es';
2
- export const toNumber = (num, defaultNum = 0) => {
3
- const number = Number(num);
4
- return isNaN(number) ? defaultNum : number;
5
- };
6
- export const toBoolean = (flag, defaultFlag = true) => {
2
+
3
+ const toBoolean = (flag, defaultFlag = true) => {
7
4
  if (isNil(flag))
8
5
  return defaultFlag;
9
6
  if (flag === 'true')
@@ -14,3 +11,5 @@ export const toBoolean = (flag, defaultFlag = true) => {
14
11
  return flag;
15
12
  return defaultFlag;
16
13
  };
14
+
15
+ export { toBoolean };
package/dist/lib/date.js CHANGED
@@ -1,8 +1,10 @@
1
- import { isNaN, isNumber } from 'lodash-es';
2
- import dayjs from './dayjs';
3
- import { DATE_FORMAT, DATE_TYPE, FIELD_TYPE_KEY_MAPPINGS } from './global';
4
- import { i18n } from './i18n';
5
- export const getDateType = (pickerType) => {
1
+ import 'lodash-es';
2
+ import './dayjs.js';
3
+ import { DATE_FORMAT, DATE_TYPE } from './global.js';
4
+ import { i18n } from './i18n.js';
5
+ import dayjs from 'dayjs';
6
+
7
+ const getDateType = (pickerType) => {
6
8
  switch (pickerType) {
7
9
  case DATE_TYPE.DATETIME:
8
10
  return DATE_FORMAT.DATETIME;
@@ -17,35 +19,10 @@ export const getDateType = (pickerType) => {
17
19
  return DATE_FORMAT.DATE;
18
20
  }
19
21
  };
20
- export const getDateTypeName = (dateType) => i18n.t(`date.${dateType}`);
21
- export const getStartOfDayUnix = (date) => {
22
- return dayjs(date).startOf('day').valueOf();
23
- };
24
- export const getStartOfDayToDate = (date) => {
25
- return dayjs(date).startOf('day').toDate();
26
- };
27
- export const getEndOfDayUnix = (date) => {
28
- return dayjs(date).endOf('day').valueOf();
29
- };
30
- export const getEndOfDayToDate = (date) => {
31
- return dayjs(date).endOf('day').toDate();
32
- };
33
- export const getStartOfWeekUnix = (date) => {
34
- return dayjs(date).startOf('week').valueOf();
35
- };
36
- export const getEndOfWeekUnix = (date) => {
37
- return dayjs(date).endOf('week').valueOf();
38
- };
39
- export const getStartOfMonthUnix = (date) => {
40
- return dayjs(date).startOf('month').valueOf();
41
- };
42
- export const getEndOfMonthUnix = (date) => {
43
- return dayjs(date).endOf('month').valueOf();
44
- };
45
- export const getFormat = (date, format) => {
22
+ const getFormat = (date, format) => {
46
23
  return dayjs(date).format(format);
47
24
  };
48
- export var DateTypeEnum;
25
+ var DateTypeEnum;
49
26
  (function (DateTypeEnum) {
50
27
  DateTypeEnum["dateTime"] = "second";
51
28
  DateTypeEnum["date"] = "date";
@@ -53,23 +30,5 @@ export var DateTypeEnum;
53
30
  DateTypeEnum["month"] = "month";
54
31
  DateTypeEnum["year"] = "year";
55
32
  })(DateTypeEnum || (DateTypeEnum = {}));
56
- export const isDate = (key) => {
57
- return [FIELD_TYPE_KEY_MAPPINGS.CreatedAt, FIELD_TYPE_KEY_MAPPINGS.UpdatedAt, FIELD_TYPE_KEY_MAPPINGS.Date].includes(key);
58
- };
59
- export const dateToMillisecond = (date, days) => {
60
- return getStartOfDayUnix(date.subtract(days, 'day'));
61
- };
62
- export const countDuration = (stoppedAt, startedAt) => {
63
- const duration = dayjs(stoppedAt).diff(startedAt, 'ms');
64
- return isNumber(duration) ? duration / 1000 : 0;
65
- };
66
- export const getMonthEndDate = (time, format = '-') => {
67
- var _a;
68
- const [year, month, date] = time.split(format);
69
- const endMonthDate = (_a = new Date(+year, +month, 0)) === null || _a === void 0 ? void 0 : _a.getDate();
70
- if (isNaN(endMonthDate)) {
71
- throw new TypeError(i18n.t('date.invalidate'));
72
- }
73
- const isEqualMonth = +date <= endMonthDate;
74
- return [endMonthDate, isEqualMonth];
75
- };
33
+
34
+ export { DateTypeEnum, getDateType, getFormat };
package/dist/lib/dayjs.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import dayjs from 'dayjs';
2
+ export { default } from 'dayjs';
2
3
  import relativeTime from 'dayjs/plugin/relativeTime';
4
+
3
5
  dayjs.extend(relativeTime);
4
- export default dayjs;
@@ -1,10 +1,11 @@
1
1
  import { message } from 'antd';
2
2
  import debug from 'debug';
3
3
  import { throttle } from 'lodash-es';
4
- import { isChinese } from 'components/common/utils';
5
- import { i18n, nsSeparator } from 'lib/i18n';
4
+ import { isChinese } from '../../components/common/utils.js';
5
+ import { nsSeparator, i18n } from '../i18n.js';
6
+
6
7
  const logger = debug('lib:error');
7
- export class ErrorLog {
8
+ class ErrorLog {
8
9
  constructor(options) {
9
10
  this.show = (msg) => {
10
11
  logger('errorMessage', msg);
@@ -22,4 +23,6 @@ export class ErrorLog {
22
23
  }, timeout, { trailing: false });
23
24
  }
24
25
  }
25
- export default new ErrorLog();
26
+ var ErrorLog$1 = new ErrorLog();
27
+
28
+ export { ErrorLog, ErrorLog$1 as default };
@@ -5,7 +5,7 @@ export type ErrorResponse = any;
5
5
  type GetErrorMessageHandler = (errorData: ErrorData, defaultMessage?: string) => string;
6
6
  export declare const getRedirectURI: (errorPageURL: string | URL, baseAPI?: string) => string;
7
7
  export declare const getRedirectURL: (redirectConfig: {
8
- enabled: 'true' | 'false' | undefined;
8
+ enabled: "true" | "false" | undefined;
9
9
  }, errorPageURL: string | URL) => string;
10
10
  export declare const getKeycloakErrorMsg: GetErrorMessageHandler;
11
11
  export declare const getParseErrorMsg: GetErrorMessageHandler;
@@ -1,25 +1,11 @@
1
- import { isEmpty } from 'lodash-es';
2
- export const LOGIN_PAGE_URL = '/login';
3
- export const REDIRECT_API = '/frame';
4
- export const getRedirectURI = (errorPageURL, baseAPI = LOGIN_PAGE_URL) => {
5
- const redirectApi = new URL(baseAPI, errorPageURL);
6
- redirectApi.searchParams.append('redirect_uri', errorPageURL);
7
- return encodeURIComponent(redirectApi.toString());
8
- };
9
- export const getRedirectURL = (redirectConfig, errorPageURL) => {
10
- if (isEmpty(redirectConfig))
11
- return LOGIN_PAGE_URL;
12
- if ((redirectConfig === null || redirectConfig === void 0 ? void 0 : redirectConfig.enabled) !== 'true')
13
- return LOGIN_PAGE_URL;
14
- const redirectUri = getRedirectURI(errorPageURL);
15
- return redirectUri;
16
- };
17
- export const getKeycloakErrorMsg = errorData => {
1
+ import 'lodash-es';
2
+
3
+ const getKeycloakErrorMsg = errorData => {
18
4
  if (!(errorData === null || errorData === void 0 ? void 0 : errorData.error_description) || !(errorData === null || errorData === void 0 ? void 0 : errorData.error))
19
5
  return null;
20
6
  return `${errorData.error}: ${errorData.error_description}`;
21
7
  };
22
- export const getParseErrorMsg = errorData => {
8
+ const getParseErrorMsg = errorData => {
23
9
  if (!(errorData === null || errorData === void 0 ? void 0 : errorData.code) || !(errorData === null || errorData === void 0 ? void 0 : errorData.error))
24
10
  return null;
25
11
  if ('string' === typeof errorData.error) {
@@ -38,8 +24,8 @@ export const getParseErrorMsg = errorData => {
38
24
  return null;
39
25
  }
40
26
  };
41
- export const getNormalErrorMsg = errorData => 'string' === typeof errorData ? errorData : null;
42
- export const getErrorMessage = (errorData, defaultMsg = '请求失败.') => {
27
+ const getNormalErrorMsg = errorData => 'string' === typeof errorData ? errorData : null;
28
+ const getErrorMessage = (errorData, defaultMsg = '请求失败.') => {
43
29
  const errorMessage = getNormalErrorMsg(errorData) ||
44
30
  (errorData === null || errorData === void 0 ? void 0 : errorData.message) ||
45
31
  (errorData === null || errorData === void 0 ? void 0 : errorData.error) ||
@@ -48,3 +34,5 @@ export const getErrorMessage = (errorData, defaultMsg = '请求失败.') => {
48
34
  defaultMsg;
49
35
  return errorMessage;
50
36
  };
37
+
38
+ export { getErrorMessage, getKeycloakErrorMsg, getNormalErrorMsg, getParseErrorMsg };
@@ -1 +1,3 @@
1
- export const IGNORE_URL = ['/', '/login', '/register', '/resetPassword', '/configuration-guide', '/reset-config'];
1
+ const IGNORE_URL = ['/', '/login', '/register', '/resetPassword', '/configuration-guide', '/reset-config'];
2
+
3
+ export { IGNORE_URL };