@giteeteam/apps-team-components 1.2.2 → 1.3.0-alpha.1

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 (182) hide show
  1. package/README.md +21 -28
  2. package/dist/components/common/PriceTag.js +18 -18
  3. package/dist/components/common/expand-component/index.d.ts +23 -0
  4. package/dist/components/common/expand-component/index.js +65 -0
  5. package/dist/components/common/expand-component/style.d.ts +2 -0
  6. package/dist/components/common/expand-component/style.js +8 -0
  7. package/dist/components/common/item-icon/ItemIcon.d.ts +8 -0
  8. package/dist/components/common/item-icon/ItemIcon.js +6 -0
  9. package/dist/components/common/overflow-tooltip/OverflowTooltip.d.ts +19 -0
  10. package/dist/components/common/overflow-tooltip/OverflowTooltip.js +54 -0
  11. package/dist/components/common/overflow-tooltip/style/index.js +13 -13
  12. package/dist/components/common/style/global.js +2 -2
  13. package/dist/components/common/style/mixin.d.ts +2 -0
  14. package/dist/components/common/style/mixin.js +17 -0
  15. package/dist/components/common/user-field/style/index.js +21 -21
  16. package/dist/components/common/utils.d.ts +6 -0
  17. package/dist/components/common/utils.js +54 -0
  18. package/dist/components/default-empty-icon/config.d.ts +2 -0
  19. package/dist/components/default-empty-icon/config.js +19 -0
  20. package/dist/components/default-empty-icon/index.d.ts +5 -0
  21. package/dist/components/default-empty-icon/index.js +23 -0
  22. package/dist/components/default-empty-icon/style.d.ts +11 -0
  23. package/dist/components/default-empty-icon/style.js +64 -0
  24. package/dist/components/default-empty-icon/types.d.ts +29 -0
  25. package/dist/components/default-empty-icon/types.js +6 -0
  26. package/dist/components/field-behavior/fields/type.js +1 -1
  27. package/dist/components/fields/base-component/types.d.ts +1 -0
  28. package/dist/components/fields/base-component/utils.d.ts +2 -0
  29. package/dist/components/fields/base-component/utils.js +9 -0
  30. package/dist/components/fields/bind-workspace/hooks.js +3 -3
  31. package/dist/components/fields/bind-workspace/style/index.js +3 -3
  32. package/dist/components/fields/dropdown/BaseField.d.ts +24 -2
  33. package/dist/components/fields/dropdown/BaseField.js +562 -1
  34. package/dist/components/fields/dropdown/Cell.d.ts +4 -0
  35. package/dist/components/fields/dropdown/Cell.js +6 -0
  36. package/dist/components/fields/dropdown/ReadView.js +1 -1
  37. package/dist/components/fields/dropdown/data.d.ts +9 -0
  38. package/dist/components/fields/dropdown/data.js +26 -0
  39. package/dist/components/fields/dropdown/hook.d.ts +103 -0
  40. package/dist/components/fields/dropdown/hook.js +152 -0
  41. package/dist/components/fields/dropdown/style.d.ts +16 -0
  42. package/dist/components/fields/dropdown/style.js +90 -0
  43. package/dist/components/fields/hooks/useViewClass.d.ts +11 -0
  44. package/dist/components/fields/hooks/useViewClass.js +18 -0
  45. package/dist/components/fields/hyper-link/style/index.js +14 -14
  46. package/dist/components/fields/item-type/ItemTypeIcon.d.ts +9 -0
  47. package/dist/components/fields/item-type/ItemTypeIcon.js +33 -0
  48. package/dist/components/fields/item-type/style/index.d.ts +1 -0
  49. package/dist/components/fields/item-type/style/index.js +6 -0
  50. package/dist/components/fields/key/ReadView.js +2 -2
  51. package/dist/components/fields/long-text/style/index.js +5 -5
  52. package/dist/components/fields/priority/ReadView.js +1 -1
  53. package/dist/components/fields/priority/style/index.js +50 -50
  54. package/dist/components/fields/status/style/index.js +323 -323
  55. package/dist/components/fields/tag/style/index.js +5 -5
  56. package/dist/components/fields/team/style/index.js +2 -2
  57. package/dist/components/fields/user/style/index.js +8 -8
  58. package/dist/components/fields/user-group/ReadView.js +1 -1
  59. package/dist/components/filters/filter-search/utils.d.ts +4 -0
  60. package/dist/components/filters/filter-search/utils.js +28 -0
  61. package/dist/components/table-components/EditTableCell.d.ts +1 -0
  62. package/dist/components/table-components/EditTableCell.js +2 -1
  63. package/dist/components/table-components/index.js +4 -4
  64. package/dist/components/table-components/style/index.js +5 -5
  65. package/dist/components/table-components/utils.js +2 -0
  66. package/dist/icons/SyncIconFont.d.ts +6 -0
  67. package/dist/icons/SyncIconFont.js +15 -0
  68. package/dist/icons/createFromIconFontClass.d.ts +4 -0
  69. package/dist/icons/createFromIconFontClass.js +33 -0
  70. package/dist/icons/empty-icon/data-empty.png +0 -0
  71. package/dist/icons/empty-icon/forbidden.png +0 -0
  72. package/dist/icons/empty-icon/index.d.ts +1 -0
  73. package/dist/icons/empty-icon/index.js +8 -0
  74. package/dist/icons/empty-icon/large-item@2x.png +0 -0
  75. package/dist/icons/empty-icon/large-workspace@2x.png +0 -0
  76. package/dist/icons/empty-icon/load-error.png +0 -0
  77. package/dist/icons/empty-icon/not-found.png +0 -0
  78. package/dist/icons/empty-icon/small-default@2x.png +0 -0
  79. package/dist/icons/empty-icon/workspace-empty.svg +127 -0
  80. package/dist/icons/index.d.ts +58 -1
  81. package/dist/icons/index.js +294 -0
  82. package/dist/icons/style/index.d.ts +2 -0
  83. package/dist/icons/style/index.js +23 -0
  84. package/dist/icons/svg/DottedCircle.svg +7 -7
  85. package/dist/icons/svg/HollowCircle.svg +6 -6
  86. package/dist/icons/svg/Workflow.svg +12 -12
  87. package/dist/index.d.ts +1 -0
  88. package/dist/index.js +1 -0
  89. package/dist/lib/app/utils.d.ts +3 -0
  90. package/dist/lib/app/utils.js +16 -0
  91. package/dist/lib/config.d.ts +14 -0
  92. package/dist/lib/config.js +45 -0
  93. package/dist/lib/constants/code.d.ts +4 -0
  94. package/dist/lib/constants/code.js +4 -0
  95. package/dist/lib/constants/field.d.ts +1 -0
  96. package/dist/lib/constants/field.js +2 -0
  97. package/dist/lib/contexts/index.js +2 -2
  98. package/dist/lib/contexts/teamConfig.d.ts +3 -0
  99. package/dist/lib/contexts/teamConfig.js +19 -4
  100. package/dist/lib/error/index.d.ts +2 -0
  101. package/dist/lib/error/index.js +2 -0
  102. package/dist/lib/error/log.d.ts +10 -0
  103. package/dist/lib/error/log.js +25 -0
  104. package/dist/lib/error/utils.d.ts +14 -0
  105. package/dist/lib/error/utils.js +50 -0
  106. package/dist/lib/error/withServerError.d.ts +1 -0
  107. package/dist/lib/error/withServerError.js +1 -0
  108. package/dist/lib/fetch.d.ts +45 -0
  109. package/dist/lib/fetch.js +301 -0
  110. package/dist/lib/global.d.ts +18 -0
  111. package/dist/lib/global.js +18 -0
  112. package/dist/lib/i18n.d.ts +1 -0
  113. package/dist/lib/i18n.js +1 -0
  114. package/dist/lib/icons/utils.d.ts +23 -0
  115. package/dist/lib/icons/utils.js +59 -0
  116. package/dist/lib/path.d.ts +5 -0
  117. package/dist/lib/path.js +47 -0
  118. package/dist/lib/router.d.ts +23 -0
  119. package/dist/lib/router.js +20 -0
  120. package/dist/lib/storage.d.ts +10 -0
  121. package/dist/lib/storage.js +62 -0
  122. package/dist/lib/swr/throttleWithCache.d.ts +17 -0
  123. package/dist/lib/swr/throttleWithCache.js +108 -0
  124. package/dist/lib/throttleFetch.d.ts +2 -0
  125. package/dist/lib/throttleFetch.js +66 -0
  126. package/dist/lib/useConfig.d.ts +8 -0
  127. package/dist/lib/useConfig.js +28 -0
  128. package/dist/locales/index.d.ts +45 -0
  129. package/dist/locales/index.js +45 -0
  130. package/dist/public/icons/BulbIcon.svg +1 -0
  131. package/dist/public/icons/Cloud.svg +1 -0
  132. package/dist/public/icons/ConsultIcon.svg +1 -0
  133. package/dist/public/icons/Demo.svg +1 -0
  134. package/dist/public/icons/ErrorTemplate.svg +1 -0
  135. package/dist/public/icons/Fail.svg +1 -0
  136. package/dist/public/icons/Flag.svg +1 -0
  137. package/dist/public/icons/GiteeIcon.svg +1 -0
  138. package/dist/public/icons/IntelligenceGradient.svg +1 -0
  139. package/dist/public/icons/Issue_Approval.svg +1 -0
  140. package/dist/public/icons/Issue_Bug.svg +1 -0
  141. package/dist/public/icons/Issue_Demand.svg +1 -0
  142. package/dist/public/icons/Issue_Doc.svg +1 -0
  143. package/dist/public/icons/Issue_Idea.svg +1 -0
  144. package/dist/public/icons/Issue_List.svg +1 -0
  145. package/dist/public/icons/Issue_Plan.svg +1 -0
  146. package/dist/public/icons/Issue_Product.svg +1 -0
  147. package/dist/public/icons/Issue_Risk.svg +1 -0
  148. package/dist/public/icons/Issue_Story.svg +1 -0
  149. package/dist/public/icons/Issue_Subtask.svg +1 -0
  150. package/dist/public/icons/Issue_Task.svg +1 -0
  151. package/dist/public/icons/Issue_Test.svg +1 -0
  152. package/dist/public/icons/Issue_TestExcution.svg +1 -0
  153. package/dist/public/icons/Issue_TestPlan.svg +1 -0
  154. package/dist/public/icons/Issue_Time.svg +1 -0
  155. package/dist/public/icons/Issue_develop.svg +1 -0
  156. package/dist/public/icons/KanbanCover.svg +7 -0
  157. package/dist/public/icons/ListCover.svg +118 -0
  158. package/dist/public/icons/ManHour.svg +1 -0
  159. package/dist/public/icons/MobileIcon.svg +1 -0
  160. package/dist/public/icons/NoItemType.svg +10 -0
  161. package/dist/public/icons/ProductIcon.svg +1 -0
  162. package/dist/public/icons/RedFlagIcon.svg +1 -0
  163. package/dist/public/icons/Safe.svg +1 -0
  164. package/dist/public/icons/StarIcon.svg +61 -0
  165. package/dist/public/icons/StructureCover.svg +1 -0
  166. package/dist/public/icons/Success.svg +1 -0
  167. package/dist/public/icons/TeamIcon.svg +1 -0
  168. package/dist/public/icons/WebIcon.svg +1 -0
  169. package/dist/public/icons/iconfont.svg +467 -0
  170. package/dist/public/icons/iconfont.ttf +0 -0
  171. package/dist/public/icons/iconfont.woff +0 -0
  172. package/dist/public/icons/iconfont.woff2 +0 -0
  173. package/dist/public/icons/iconfont_multiple_color.js +1 -0
  174. package/dist/public/icons/iconfont_single_color.css +912 -0
  175. package/dist/public/icons/iconfont_single_color.js +1 -0
  176. package/dist/public/icons/loginBg.svg +1 -0
  177. package/dist/public/mockServiceWorker.js +284 -0
  178. package/dist/style/common.d.ts +1 -0
  179. package/dist/style/common.js +9 -0
  180. package/dist/style/global.d.ts +1 -0
  181. package/dist/style/global.js +8 -0
  182. package/package.json +105 -69
@@ -1,11 +1,283 @@
1
1
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
+ import React from 'react';
2
3
  import AntdIcon from '@ant-design/icons';
4
+ import { ClassNames } from '@emotion/react';
5
+ import useAntdConfig from 'lib/hooks/useAntdConfig';
3
6
  import ArrowBack from './svg/ArrowBack.svg';
4
7
  import Done from './svg/Done.svg';
5
8
  import DottedCircle from './svg/DottedCircle.svg';
6
9
  import HollowCircle from './svg/HollowCircle.svg';
7
10
  import Search from './svg/Search.svg';
8
11
  import Workflow from './svg/Workflow.svg';
12
+ import { proximaSingleColor, rotateStyle } from './style';
13
+ import IconFont from './SyncIconFont';
14
+ export { IconFont };
15
+ export const ROTATE_ICONS = {
16
+ CollapseRight: {
17
+ originKey: 'CollapseLeft',
18
+ rotateClass: rotateStyle(180),
19
+ },
20
+ UpArrow: {
21
+ originKey: 'DownArrow',
22
+ rotateClass: rotateStyle(180),
23
+ },
24
+ RightArrowHollow: {
25
+ originKey: 'DownArrow',
26
+ rotateClass: rotateStyle(-90),
27
+ },
28
+ LeftArrow: {
29
+ originKey: 'DownArrow',
30
+ rotateClass: rotateStyle(90),
31
+ },
32
+ SelectDown: {
33
+ originKey: 'Right',
34
+ rotateClass: rotateStyle(90),
35
+ },
36
+ ToggleLeft: {
37
+ originKey: 'ToggleRight',
38
+ rotateClass: rotateStyle(180),
39
+ },
40
+ UpSort: {
41
+ originKey: 'ArrowBack',
42
+ rotateClass: rotateStyle(90),
43
+ },
44
+ DownSort: {
45
+ originKey: 'ArrowBack',
46
+ rotateClass: rotateStyle(-90),
47
+ },
48
+ BackArrowReverse: {
49
+ originKey: 'BackArrow',
50
+ rotateClass: rotateStyle(180),
51
+ },
52
+ };
53
+ export const SIMPLE_COLOR_KEYS = [
54
+ 'Add',
55
+ 'AllItemBoard',
56
+ 'Back',
57
+ 'Board',
58
+ 'Calculator',
59
+ 'Change',
60
+ 'CheckOutlined',
61
+ 'Close',
62
+ 'Control',
63
+ 'DottedCircle',
64
+ 'DownArrow',
65
+ 'CustomDragHandler',
66
+ 'Error',
67
+ 'Expand',
68
+ 'Shrink',
69
+ 'ExpandIcon',
70
+ 'Filter',
71
+ 'Folder',
72
+ 'FontFamily',
73
+ 'Gantt',
74
+ 'detail',
75
+ 'Hierarchy',
76
+ 'HollowCircle',
77
+ 'Kanban',
78
+ 'Link',
79
+ 'List',
80
+ 'Lock',
81
+ 'More',
82
+ 'Refresh',
83
+ 'Undo',
84
+ 'delete',
85
+ 'Return',
86
+ 'Right',
87
+ 'RightArrow',
88
+ 'Save',
89
+ 'AppMarket',
90
+ 'Automation',
91
+ 'ItemType',
92
+ 'Myapps',
93
+ 'WorkspaceTemplate',
94
+ 'Sort',
95
+ 'SortAsc',
96
+ 'SortDesc',
97
+ 'SprintBurnDownChart',
98
+ 'Statistic',
99
+ 'Structure',
100
+ 'done',
101
+ 'UnwatchIcon',
102
+ 'User2',
103
+ 'ViewManageIcon',
104
+ 'NoItemType',
105
+ 'WatchIcon',
106
+ 'Field',
107
+ 'FieldBehavior',
108
+ 'Interface',
109
+ 'InterfaceScheme',
110
+ 'ItemRelation',
111
+ 'ItemTypeInterface',
112
+ 'ItemTypeLevel',
113
+ 'Priority',
114
+ 'Role',
115
+ 'Status',
116
+ 'User',
117
+ 'WeekdaysSetting',
118
+ 'Workflow',
119
+ 'WorkflowScheme',
120
+ 'ToggleRight',
121
+ 'Plugins',
122
+ 'ExportOut',
123
+ 'Sync',
124
+ 'Time',
125
+ 'Undo',
126
+ 'Edit',
127
+ 'TimeSort',
128
+ 'WorkflowArrow',
129
+ 'Approval-Agree',
130
+ 'Approval-Disagree',
131
+ 'Approval-Filled',
132
+ 'Editor_Link',
133
+ 'Editor_UnorderedList',
134
+ 'Settings',
135
+ 'Copy',
136
+ 'Eye',
137
+ 'EyeClose',
138
+ 'ArrowBack',
139
+ 'Search',
140
+ 'Download',
141
+ 'LogOut',
142
+ 'Minus',
143
+ 'ArrowLeft',
144
+ 'Question',
145
+ 'BackToTop',
146
+ 'Info',
147
+ 'EventProtectScheme',
148
+ 'Team',
149
+ 'ListView',
150
+ 'GridView',
151
+ 'History',
152
+ 'Import',
153
+ 'Upload',
154
+ 'Iterate',
155
+ 'Star',
156
+ 'Start',
157
+ 'StarFilled',
158
+ 'SignIn',
159
+ 'NumberTwo',
160
+ 'Success',
161
+ 'AddUser',
162
+ 'WorkspaceAuth',
163
+ 'Editor_AlignCenter',
164
+ 'Editor_AlignLeft',
165
+ 'Editor_AlignRight',
166
+ 'Editor_ArrowDown',
167
+ 'Editor_Bold',
168
+ 'Editor_Code',
169
+ 'Editor_FontSize',
170
+ 'Editor_Header1',
171
+ 'Editor_Header2',
172
+ 'Editor_Header3',
173
+ 'Editor_Header4',
174
+ 'Editor_Header5',
175
+ 'Editor_Header6',
176
+ 'Editor_Highlight',
177
+ 'Editor_Image',
178
+ 'Editor_Italic',
179
+ 'Editor_LineHeight',
180
+ 'Editor_Link',
181
+ 'Editor_OrderedList',
182
+ 'Editor_Strikethrough',
183
+ 'Editor_Table',
184
+ 'Editor_Underline',
185
+ 'UserRole',
186
+ 'DoubleLeft',
187
+ 'DoubleRight',
188
+ 'Anchor',
189
+ 'Collapse',
190
+ 'Develop',
191
+ 'DoubleColumn',
192
+ 'Formula',
193
+ 'Iteration',
194
+ 'LongText',
195
+ 'Radio',
196
+ 'Number',
197
+ 'SingleColumn',
198
+ 'StoryPoint',
199
+ 'Tabs',
200
+ 'Tag',
201
+ 'Test',
202
+ 'Text',
203
+ 'Version',
204
+ 'TripleColumn',
205
+ 'Calendar',
206
+ 'Snapshot',
207
+ 'Batch',
208
+ 'CircleDown',
209
+ 'File',
210
+ 'Earth',
211
+ 'Developer',
212
+ 'Tester',
213
+ 'Lightning',
214
+ 'HelpText',
215
+ 'Help',
216
+ 'MailServe',
217
+ 'Loading',
218
+ 'Comment',
219
+ 'MailServe',
220
+ 'RemoveOut',
221
+ 'Comparison',
222
+ 'Skip',
223
+ 'Mr',
224
+ 'Release',
225
+ 'Forbidden',
226
+ 'ZoomIn',
227
+ 'Objective',
228
+ 'ZoomOut',
229
+ 'ExpandChildren',
230
+ 'Products',
231
+ 'Chart',
232
+ 'Pagewidth',
233
+ ];
234
+ export const MULTI_COLOR_KEYS = [
235
+ 'AddBlue',
236
+ 'AddCircle',
237
+ 'Alert_Warning',
238
+ 'Alert_Success',
239
+ 'Alert_Error',
240
+ 'Assist_Waring',
241
+ 'CollapseLeft',
242
+ 'EmptyData',
243
+ 'FolderExtend',
244
+ 'LinkItem',
245
+ 'Panel_Settings',
246
+ 'Panel_SettingsB',
247
+ 'Panel_DemandB',
248
+ 'Unfold',
249
+ 'WatchersBlankIcon',
250
+ 'BackArrow',
251
+ 'Excel',
252
+ 'Attach_Word',
253
+ 'Attach_Picture',
254
+ 'Attach_PDF',
255
+ 'Attach_PPT',
256
+ 'Attach_Excel',
257
+ 'Attach_Audio',
258
+ 'Attach_Media',
259
+ 'Attach_Others',
260
+ 'Attach_Compressed',
261
+ 'File',
262
+ 'Assist_Error',
263
+ 'Alert_Info',
264
+ 'Minus-gray',
265
+ 'Add-gray',
266
+ 'Anchor',
267
+ 'ToggleLeft',
268
+ 'Panel2',
269
+ 'ScrollToTop',
270
+ 'CollapseDown',
271
+ 'Issue_Time',
272
+ 'Issue_Story',
273
+ 'RealTime',
274
+ 'Offline',
275
+ 'Assist_Success',
276
+ 'Panel_Baseline',
277
+ 'Panel_BaselineB',
278
+ 'ClearAll',
279
+ 'AttachmentProducts',
280
+ ];
9
281
  export const HollowCircleIcon = props => {
10
282
  return _jsx(AntdIcon, { ...props, component: HollowCircle });
11
283
  };
@@ -24,3 +296,25 @@ export const SearchIcon = props => {
24
296
  export const DoneIcon = props => {
25
297
  return _jsx(AntdIcon, { ...props, style: { fontSize: 10, width: 10, marginLeft: 2 }, component: Done });
26
298
  };
299
+ export const CustomIconFont = React.memo(props => {
300
+ const { type, ...restProps } = props;
301
+ if (SIMPLE_COLOR_KEYS.includes(type)) {
302
+ return _jsx(SingleColorIcon, { ...props, type: type });
303
+ }
304
+ return _jsx(IconFont, { ...restProps, type: `icon-${type}` });
305
+ });
306
+ CustomIconFont.displayName = 'CustomIconFont';
307
+ export const SingleColorIcon = ({ type, ...props }) => {
308
+ const { antPrefix } = useAntdConfig();
309
+ return (_jsx(ClassNames, { children: ({ css, cx }) => (_jsx("i", { ...props, className: cx('icon', css(proximaSingleColor(antPrefix)), `proxima-single-color-${type}`, props.className) })) }));
310
+ };
311
+ export default AntdIcon;
312
+ export const Icons = [...MULTI_COLOR_KEYS, ...SIMPLE_COLOR_KEYS, ...Object.keys(ROTATE_ICONS)].reduce((res, key) => {
313
+ res[key] = ({ className, ...props }) => {
314
+ return (_jsx(ClassNames, { children: ({ cx, css }) => {
315
+ var _a;
316
+ return ROTATE_ICONS[key] ? (_jsx(CustomIconFont, { ...props, className: cx(css(ROTATE_ICONS[key].rotateClass), className, 'proximaicon', 'anticon'), type: ((_a = ROTATE_ICONS[key]) === null || _a === void 0 ? void 0 : _a.originKey) || key })) : (_jsx(CustomIconFont, { ...props, type: key, className: cx('proximaicon', 'anticon', className) }));
317
+ } }));
318
+ };
319
+ return res;
320
+ }, {});
@@ -0,0 +1,2 @@
1
+ export declare const proximaSingleColor: (antPrefix?: string) => string;
2
+ export declare const rotateStyle: (rotate: number) => string;
@@ -0,0 +1,23 @@
1
+ export const proximaSingleColor = (antPrefix = 'ant') => `
2
+ display: inline-block;
3
+ width: 1em;
4
+ height: 1em;
5
+ line-height: 1;
6
+ text-indent: 0;
7
+
8
+ &::before {
9
+ display: inline !important;
10
+ }
11
+ }
12
+
13
+ .${antPrefix}-dropdown-menu-title-content i.anticon {
14
+ margin-right: 4px;
15
+ }
16
+
17
+ .${antPrefix}-btn-icon-only > i.anticon {
18
+ display: inline-block;
19
+ }
20
+ `;
21
+ export const rotateStyle = (rotate) => `
22
+ transform: rotate(${rotate}deg);
23
+ `;
@@ -1,7 +1,7 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <svg t="1702526505381" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
3
- p-id="14633" xmlns:xlink="http://www.w3.org/1999/xlink">
4
- <path
5
- d="M681.919574 995.136018l-33.919979-96.63994a408.447745 408.447745 0 0 1-130.239919 23.039986l-6.911995 0.064h-4.159998l-1.279999 102.399936H511.99968c59.519963 0 116.735927-10.175994 169.919894-28.863982zM243.839848 821.632126l-67.071958 77.375952a511.74368 511.74368 0 0 0 153.151904 91.647943l36.479977-95.67994a409.343744 409.343744 0 0 1-122.559923-73.343955z m709.503556-49.919968l-88.191945-52.031968a412.159742 412.159742 0 0 1-92.927942 108.671932l65.15196 78.975951a514.559678 514.559678 0 0 0 115.967927-135.679915zM107.391933 576.00028l-101.183937 15.87199c9.471994 60.415962 29.439982 117.311927 58.111964 168.767895l89.471944-49.855969a406.079746 406.079746 0 0 1-46.399971-134.783916zM1023.99936 512.00032c0-29.439982-2.495998-58.239964-7.231995-86.207946l-100.927937 17.087989a412.991742 412.991742 0 0 1-0.896 143.359911l100.735937 18.303988c5.439997-30.015981 8.319995-60.927962 8.319995-92.543942zM74.175954 246.400486a508.799682 508.799682 0 0 0-64.63996 166.399896l100.543937 19.775988a406.399746 406.399746 0 0 1 51.583968-132.927917L74.239954 246.400486z m882.303448 11.327993a514.431678 514.431678 0 0 0-114.303928-137.087914l-66.111959 78.271951a412.031742 412.031742 0 0 1 91.583943 109.759931l88.831944-50.943968z m-607.99962-231.039856A510.975681 510.975681 0 0 0 191.99988 112.38457l63.99996 79.87195a408.575745 408.575745 0 0 1 125.247922-68.543957L348.543782 26.688623zM511.99968 0.00064v102.399936c48.63997 0 95.99994 8.447995 140.607912 24.767985l35.199978-96.19194A511.039681 511.039681 0 0 0 511.99968 0.00064z"
6
- p-id="14634"></path>
7
- </svg>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <svg t="1702526505381" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
3
+ p-id="14633" xmlns:xlink="http://www.w3.org/1999/xlink">
4
+ <path
5
+ d="M681.919574 995.136018l-33.919979-96.63994a408.447745 408.447745 0 0 1-130.239919 23.039986l-6.911995 0.064h-4.159998l-1.279999 102.399936H511.99968c59.519963 0 116.735927-10.175994 169.919894-28.863982zM243.839848 821.632126l-67.071958 77.375952a511.74368 511.74368 0 0 0 153.151904 91.647943l36.479977-95.67994a409.343744 409.343744 0 0 1-122.559923-73.343955z m709.503556-49.919968l-88.191945-52.031968a412.159742 412.159742 0 0 1-92.927942 108.671932l65.15196 78.975951a514.559678 514.559678 0 0 0 115.967927-135.679915zM107.391933 576.00028l-101.183937 15.87199c9.471994 60.415962 29.439982 117.311927 58.111964 168.767895l89.471944-49.855969a406.079746 406.079746 0 0 1-46.399971-134.783916zM1023.99936 512.00032c0-29.439982-2.495998-58.239964-7.231995-86.207946l-100.927937 17.087989a412.991742 412.991742 0 0 1-0.896 143.359911l100.735937 18.303988c5.439997-30.015981 8.319995-60.927962 8.319995-92.543942zM74.175954 246.400486a508.799682 508.799682 0 0 0-64.63996 166.399896l100.543937 19.775988a406.399746 406.399746 0 0 1 51.583968-132.927917L74.239954 246.400486z m882.303448 11.327993a514.431678 514.431678 0 0 0-114.303928-137.087914l-66.111959 78.271951a412.031742 412.031742 0 0 1 91.583943 109.759931l88.831944-50.943968z m-607.99962-231.039856A510.975681 510.975681 0 0 0 191.99988 112.38457l63.99996 79.87195a408.575745 408.575745 0 0 1 125.247922-68.543957L348.543782 26.688623zM511.99968 0.00064v102.399936c48.63997 0 95.99994 8.447995 140.607912 24.767985l35.199978-96.19194A511.039681 511.039681 0 0 0 511.99968 0.00064z"
6
+ p-id="14634"></path>
7
+ </svg>
@@ -1,6 +1,6 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!-- Generator: Adobe Illustrator 25.3.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
- <svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
- viewBox="0 0 10 10" style="enable-background:new 0 0 10 10;" xml:space="preserve">
5
- <path d="M5,0C2.2,0,0,2.2,0,5s2.2,5,5,5s5-2.2,5-5S7.8,0,5,0z M5,8C3.3,8,2,6.7,2,5s1.3-3,3-3s3,1.3,3,3S6.7,8,5,8z"/>
6
- </svg>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 25.3.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 10 10" style="enable-background:new 0 0 10 10;" xml:space="preserve">
5
+ <path d="M5,0C2.2,0,0,2.2,0,5s2.2,5,5,5s5-2.2,5-5S7.8,0,5,0z M5,8C3.3,8,2,6.7,2,5s1.3-3,3-3s3,1.3,3,3S6.7,8,5,8z"/>
6
+ </svg>
@@ -1,12 +1,12 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!-- Generator: Adobe Illustrator 25.3.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
- <svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
- viewBox="0 0 128 128" style="enable-background:new 0 0 128 128;" xml:space="preserve">
5
- <path d="M111.4,88.1c-7.5,0-14.46,4.82-16.61,11.79H38.03c-8.57,0-15.53-6.97-15.53-15.53
6
- c0-8.57,6.97-14.99,15.53-14.99h52.49c14.46,0,26.25-11.79,26.25-26.25s-11.79-26.25-26.25-26.25H33.75
7
- C31.61,9.91,25.18,5.09,17.14,5.09C8.04,5.09,0,13.12,0,22.23s8.04,17.14,17.14,17.14c7.5,0,14.46-4.82,16.61-11.79h56.23
8
- c8.57,0,15.53,6.97,15.53,15.53s-6.42,15.53-14.99,15.53h-52.5c-14.46,0-26.25,11.79-26.25,26.25s11.79,26.25,26.25,26.25h56.23
9
- c2.14,6.97,8.57,11.79,16.61,11.79c9.64,0,17.14-8.04,17.14-17.14S120.51,88.1,111.4,88.1z M17.15,29.18
10
- c-3.22,0-6.42-3.22-6.42-6.97s3.22-6.42,6.42-6.42s6.42,3.22,6.42,6.42S20.9,29.18,17.15,29.18z M111.4,112.21
11
- c-3.75,0-6.42-3.22-6.42-6.42c0-3.21,3.22-6.42,6.42-6.42c3.21,0,6.42,3.22,6.42,6.42C117.83,108.99,114.62,112.21,111.4,112.21z"/>
12
- </svg>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 25.3.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 128 128" style="enable-background:new 0 0 128 128;" xml:space="preserve">
5
+ <path d="M111.4,88.1c-7.5,0-14.46,4.82-16.61,11.79H38.03c-8.57,0-15.53-6.97-15.53-15.53
6
+ c0-8.57,6.97-14.99,15.53-14.99h52.49c14.46,0,26.25-11.79,26.25-26.25s-11.79-26.25-26.25-26.25H33.75
7
+ C31.61,9.91,25.18,5.09,17.14,5.09C8.04,5.09,0,13.12,0,22.23s8.04,17.14,17.14,17.14c7.5,0,14.46-4.82,16.61-11.79h56.23
8
+ c8.57,0,15.53,6.97,15.53,15.53s-6.42,15.53-14.99,15.53h-52.5c-14.46,0-26.25,11.79-26.25,26.25s11.79,26.25,26.25,26.25h56.23
9
+ c2.14,6.97,8.57,11.79,16.61,11.79c9.64,0,17.14-8.04,17.14-17.14S120.51,88.1,111.4,88.1z M17.15,29.18
10
+ c-3.22,0-6.42-3.22-6.42-6.97s3.22-6.42,6.42-6.42s6.42,3.22,6.42,6.42S20.9,29.18,17.15,29.18z M111.4,112.21
11
+ c-3.75,0-6.42-3.22-6.42-6.42c0-3.21,3.22-6.42,6.42-6.42c3.21,0,6.42,3.22,6.42,6.42C117.83,108.99,114.62,112.21,111.4,112.21z"/>
12
+ </svg>
package/dist/index.d.ts CHANGED
@@ -12,6 +12,7 @@ export { default as CreatedAtReadView } from './components/fields/created-at/Rea
12
12
  export { default as CreatedByReadView } from './components/fields/created-by/ReadView';
13
13
  export { default as DataQuoteReadView } from './components/fields/data-quote/ReadView';
14
14
  export { default as DateReadView } from './components/fields/date/ReadView';
15
+ export { default as DropdownCell } from './components/fields/dropdown/Cell';
15
16
  export { default as DropdownReadView } from './components/fields/dropdown/ReadView';
16
17
  export { default as FileReadView } from './components/fields/file/ReadView';
17
18
  export { default as FormulaReadView } from './components/fields/formula/ReadView';
package/dist/index.js CHANGED
@@ -12,6 +12,7 @@ export { default as CreatedAtReadView } from './components/fields/created-at/Rea
12
12
  export { default as CreatedByReadView } from './components/fields/created-by/ReadView';
13
13
  export { default as DataQuoteReadView } from './components/fields/data-quote/ReadView';
14
14
  export { default as DateReadView } from './components/fields/date/ReadView';
15
+ export { default as DropdownCell } from './components/fields/dropdown/Cell';
15
16
  export { default as DropdownReadView } from './components/fields/dropdown/ReadView';
16
17
  export { default as FileReadView } from './components/fields/file/ReadView';
17
18
  export { default as FormulaReadView } from './components/fields/formula/ReadView';
@@ -0,0 +1,3 @@
1
+ /// <reference types="node" />
2
+ export declare const requestIdleCallback: (((callback: IdleRequestCallback, options?: IdleRequestOptions) => number) & typeof globalThis.requestIdleCallback) | ((cb: any) => NodeJS.Timeout);
3
+ export declare const cancelIdleCallback: ((handle: number) => void) & typeof globalThis.cancelIdleCallback;
@@ -0,0 +1,16 @@
1
+ export const requestIdleCallback = (window === null || window === void 0 ? void 0 : window.requestIdleCallback) ||
2
+ function (cb) {
3
+ const start = Date.now();
4
+ return setTimeout(function () {
5
+ cb({
6
+ didTimeout: false,
7
+ timeRemaining: function () {
8
+ return Math.max(0, 50 - (Date.now() - start));
9
+ },
10
+ });
11
+ }, 1);
12
+ };
13
+ export const cancelIdleCallback = (window === null || window === void 0 ? void 0 : window.cancelIdleCallback) ||
14
+ function (id) {
15
+ clearTimeout(id);
16
+ };
@@ -0,0 +1,14 @@
1
+ import { IPublicRuntimeProps, IUserConfig } from '../global';
2
+ export declare const getPublicRuntimeConfig: () => Partial<IPublicRuntimeProps>;
3
+ export declare const getUserConfig: () => Partial<IUserConfig>;
4
+ export declare const publicRuntimeConfig: Partial<IPublicRuntimeProps>;
5
+ export declare const userConfig: Partial<IUserConfig>;
6
+ export type LocalLng = string;
7
+ export declare function getAcceptLanguageHeader(locale: LocalLng): string;
8
+ export declare const getQiankunConfig: () => {
9
+ gateway: string;
10
+ appId: string;
11
+ sessionToken: string;
12
+ basePath: string;
13
+ locales: string;
14
+ };
@@ -0,0 +1,45 @@
1
+ export const getPublicRuntimeConfig = () => {
2
+ var _a;
3
+ if (typeof window !== 'undefined') {
4
+ return (_a = window.__PROXIMA_DATA__) === null || _a === void 0 ? void 0 : _a.publicRuntimeConfig;
5
+ }
6
+ return {};
7
+ };
8
+ export const getUserConfig = () => {
9
+ var _a;
10
+ if (typeof window !== 'undefined') {
11
+ return (_a = window.__PROXIMA_DATA__) === null || _a === void 0 ? void 0 : _a.userConfig;
12
+ }
13
+ return {};
14
+ };
15
+ export const publicRuntimeConfig = getPublicRuntimeConfig() || {};
16
+ export const userConfig = getUserConfig();
17
+ export function getAcceptLanguageHeader(locale) {
18
+ switch (locale) {
19
+ case 'zh-CN':
20
+ return 'zh-CN;q=0.9,zh;q=0.8,en;q=0.7';
21
+ case 'zh':
22
+ return 'zh;q=0.8,en;q=0.7';
23
+ case 'ru-RU':
24
+ return 'ru-RU;q=0.9,ru;q=0.8,en;q=0.7';
25
+ case 'ru':
26
+ return 'ru;q=0.8,en;q=0.7';
27
+ case 'en-US':
28
+ return 'en-US,en;q=0.9';
29
+ case 'en':
30
+ default:
31
+ return 'en;q=0.9';
32
+ }
33
+ }
34
+ export const getQiankunConfig = () => {
35
+ var _a, _b, _c;
36
+ const context = (_a = window === null || window === void 0 ? void 0 : window.QiankunProps) === null || _a === void 0 ? void 0 : _a.context;
37
+ const env = context === null || context === void 0 ? void 0 : context.env;
38
+ return {
39
+ gateway: (env === null || env === void 0 ? void 0 : env.PROXIMA_GATEWAY) || '',
40
+ appId: env === null || env === void 0 ? void 0 : env.PROXIMA_APP_ID,
41
+ sessionToken: env === null || env === void 0 ? void 0 : env.sessionToken,
42
+ basePath: env === null || env === void 0 ? void 0 : env.PROXIMA_BASE_PATH,
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
+ };
45
+ };
@@ -0,0 +1,4 @@
1
+ export declare const ParseErrorCode: {
2
+ INVALID_SESSION_TOKEN: number;
3
+ OBJECT_NOT_FOUND: number;
4
+ };
@@ -0,0 +1,4 @@
1
+ export const ParseErrorCode = {
2
+ INVALID_SESSION_TOKEN: 209,
3
+ OBJECT_NOT_FOUND: 101,
4
+ };
@@ -0,0 +1 @@
1
+ export declare const REMOTE_DATA_QUOTE_FIELD_TYPE: string[];
@@ -0,0 +1,2 @@
1
+ import { FIELD_TYPE_KEY_MAPPINGS } from 'lib/global';
2
+ export const REMOTE_DATA_QUOTE_FIELD_TYPE = [FIELD_TYPE_KEY_MAPPINGS.RemoteFieldRemoteDataQuote];
@@ -11,7 +11,7 @@ import { ItemConfigProvider } from './itemConfig';
11
11
  import { TeamConfigProvider } from './teamConfig';
12
12
  import { TenantProvider } from './tenant';
13
13
  import { WorkflowConfigProvider } from './workflowConfig';
14
- export const LibraryProvider = ({ getPopupContainer, locale, tenant, datetimeFormat, teamBasePath, teamGateway, isMicroApp, workspaceKey, workflow, item, currentUser, emotionCacheOptions, children, }) => {
14
+ export const LibraryProvider = ({ getPopupContainer, locale, tenant, datetimeFormat, teamBasePath, teamGateway, isMicroApp, publicRuntimeConfig, userConfig, workspaceKey, workflow, item, currentUser, emotionCacheOptions, children, }) => {
15
15
  const emotionCache = useMemo(() => {
16
16
  return createCache({
17
17
  key: 'apps',
@@ -21,5 +21,5 @@ export const LibraryProvider = ({ getPopupContainer, locale, tenant, datetimeFor
21
21
  useEffect(() => {
22
22
  i18n.setLocale(locale);
23
23
  }, [locale]);
24
- return (_jsx(CacheProvider, { value: emotionCache, children: _jsx(AntdConfigProvider, { getPopupContainer: getPopupContainer, children: _jsx(TeamConfigProvider, { teamBasePath: teamBasePath, teamGateway: teamGateway, isMicroApp: isMicroApp, 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 }) }) }) }) }) }) }) }) }));
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
25
  };
@@ -1,8 +1,11 @@
1
1
  import React from 'react';
2
+ import { IPublicRuntimeProps, IUserConfig } from '../../global';
2
3
  export interface ITeamConfigContext {
3
4
  teamGateway?: string;
4
5
  teamBasePath?: string;
5
6
  isMicroApp?: boolean;
7
+ publicRuntimeConfig?: Partial<IPublicRuntimeProps>;
8
+ userConfig?: Partial<IUserConfig>;
6
9
  }
7
10
  export declare const TeamConfigContext: React.Context<ITeamConfigContext>;
8
11
  export interface TeamConfigProviderProps extends React.PropsWithChildren, ITeamConfigContext {
@@ -1,11 +1,26 @@
1
1
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
- import { createContext } from 'react';
2
+ import { createContext, useMemo } from 'react';
3
+ import { getPublicRuntimeConfig, getQiankunConfig, getUserConfig } from 'lib/config';
3
4
  const defaultContext = {};
4
5
  export const TeamConfigContext = createContext(defaultContext);
5
- export const TeamConfigProvider = ({ teamGateway, teamBasePath, isMicroApp, children, }) => {
6
+ export const TeamConfigProvider = ({ teamGateway, teamBasePath, isMicroApp, children, publicRuntimeConfig, userConfig, }) => {
7
+ const runtimeConfig = useMemo(() => {
8
+ const config = { ...getQiankunConfig(), ...getPublicRuntimeConfig(), ...(publicRuntimeConfig || {}) };
9
+ if (teamGateway) {
10
+ config.gateway = teamGateway;
11
+ }
12
+ if (teamBasePath) {
13
+ config.basePath = teamBasePath;
14
+ }
15
+ return config;
16
+ }, [publicRuntimeConfig, teamBasePath, teamGateway]);
17
+ const _userConfig = useMemo(() => {
18
+ const config = { ...getUserConfig(), ...(userConfig || {}) };
19
+ return config;
20
+ }, [userConfig]);
6
21
  return (_jsx(TeamConfigContext.Provider, { value: {
7
- teamGateway,
8
- teamBasePath,
9
22
  isMicroApp,
23
+ publicRuntimeConfig: runtimeConfig,
24
+ userConfig: _userConfig,
10
25
  }, children: children }));
11
26
  };
@@ -0,0 +1,2 @@
1
+ export { ErrorLog, default as log } from './log';
2
+ export * from './utils';
@@ -0,0 +1,2 @@
1
+ export { ErrorLog, default as log } from './log';
2
+ export * from './utils';
@@ -0,0 +1,10 @@
1
+ type ErrorLogOptions = {
2
+ timeout?: number;
3
+ };
4
+ export declare class ErrorLog {
5
+ private showError;
6
+ constructor(options?: ErrorLogOptions);
7
+ show: (msg: string) => void;
8
+ }
9
+ declare const _default: ErrorLog;
10
+ export default _default;
@@ -0,0 +1,25 @@
1
+ import { message } from 'antd';
2
+ import debug from 'debug';
3
+ import { throttle } from 'lodash-es';
4
+ import { isChinese } from 'components/common/utils';
5
+ import { i18n, nsSeparator } from 'lib/i18n';
6
+ const logger = debug('lib:error');
7
+ export class ErrorLog {
8
+ constructor(options) {
9
+ this.show = (msg) => {
10
+ logger('errorMessage', msg);
11
+ this.showError(msg);
12
+ };
13
+ const { timeout = 1000 } = options || {};
14
+ this.showError = throttle(msg => {
15
+ if (isChinese(msg) || msg.includes(nsSeparator)) {
16
+ message.error(msg);
17
+ return;
18
+ }
19
+ const MsgSet = i18n.t(`libs.error.MsgSet.${msg}`);
20
+ const errorMessage = (MsgSet === null || MsgSet === void 0 ? void 0 : MsgSet.includes('libs.error.MsgSet.')) ? msg : MsgSet;
21
+ message.error(errorMessage);
22
+ }, timeout, { trailing: false });
23
+ }
24
+ }
25
+ export default new ErrorLog();
@@ -0,0 +1,14 @@
1
+ export declare const LOGIN_PAGE_URL = "/login";
2
+ export declare const REDIRECT_API = "/frame";
3
+ type ErrorData = any;
4
+ export type ErrorResponse = any;
5
+ type GetErrorMessageHandler = (errorData: ErrorData, defaultMessage?: string) => string;
6
+ export declare const getRedirectURI: (errorPageURL: string | URL, baseAPI?: string) => string;
7
+ export declare const getRedirectURL: (redirectConfig: {
8
+ enabled: 'true' | 'false' | undefined;
9
+ }, errorPageURL: string | URL) => string;
10
+ export declare const getKeycloakErrorMsg: GetErrorMessageHandler;
11
+ export declare const getParseErrorMsg: GetErrorMessageHandler;
12
+ export declare const getNormalErrorMsg: GetErrorMessageHandler;
13
+ export declare const getErrorMessage: GetErrorMessageHandler;
14
+ export {};