@giteeteam/apps-team-components 1.3.0-alpha.1 → 1.3.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -21
- package/dist/components/common/EmptyField.d.ts +0 -1
- package/dist/components/common/EmptyField.js +7 -5
- package/dist/components/common/PriceTag.js +26 -23
- package/dist/components/common/expand-component/index.d.ts +0 -1
- package/dist/components/common/expand-component/index.js +12 -10
- package/dist/components/common/expand-component/style.js +8 -6
- package/dist/components/common/item-icon/ItemIcon.d.ts +0 -1
- package/dist/components/common/item-icon/ItemIcon.js +6 -4
- package/dist/components/common/overflow-tooltip/BaseOverflowTooltip.d.ts +0 -1
- package/dist/components/common/overflow-tooltip/BaseOverflowTooltip.js +9 -6
- package/dist/components/common/overflow-tooltip/OverflowTooltip.js +9 -6
- package/dist/components/common/overflow-tooltip/SimpleOverflowToolTip.js +8 -5
- package/dist/components/common/overflow-tooltip/style/index.js +16 -14
- package/dist/components/common/style/global.js +4 -2
- package/dist/components/common/style/mixin.js +18 -15
- package/dist/components/common/user-field/UserAvatar.js +8 -6
- package/dist/components/common/user-field/style/index.js +23 -21
- package/dist/components/common/utils.js +13 -9
- package/dist/components/default-empty-icon/config.js +11 -6
- package/dist/components/default-empty-icon/index.js +10 -9
- package/dist/components/default-empty-icon/style.js +65 -62
- package/dist/components/default-empty-icon/types.js +3 -1
- package/dist/components/field-behavior/fields/type.js +5 -2
- package/dist/components/fields/actors/BaseField.js +5 -2
- package/dist/components/fields/actors/ReadView.d.ts +0 -1
- package/dist/components/fields/actors/ReadView.js +8 -6
- package/dist/components/fields/ancestor/ReadView.js +8 -6
- package/dist/components/fields/ancestor/utils.js +4 -12
- package/dist/components/fields/assignee/ReadView.d.ts +0 -1
- package/dist/components/fields/assignee/ReadView.js +13 -11
- package/dist/components/fields/base-component/utils.js +3 -1
- package/dist/components/fields/bind-workspace/ReadView.d.ts +0 -1
- package/dist/components/fields/bind-workspace/ReadView.js +11 -9
- package/dist/components/fields/bind-workspace/hooks.js +7 -4
- package/dist/components/fields/bind-workspace/style/index.js +5 -3
- package/dist/components/fields/cascade/ReadView.js +8 -6
- package/dist/components/fields/cascade/utils.js +4 -3
- package/dist/components/fields/checkbox/ReadView.d.ts +0 -1
- package/dist/components/fields/checkbox/ReadView.js +7 -5
- package/dist/components/fields/created-at/ReadView.js +10 -8
- package/dist/components/fields/created-by/ReadView.d.ts +0 -1
- package/dist/components/fields/created-by/ReadView.js +11 -9
- package/dist/components/fields/data-quote/ReadView.js +12 -10
- package/dist/components/fields/data-quote/utils.js +5 -3
- package/dist/components/fields/date/ReadView.d.ts +0 -1
- package/dist/components/fields/date/ReadView.js +8 -6
- package/dist/components/fields/dropdown/BaseField.js +53 -40
- package/dist/components/fields/dropdown/Cell.d.ts +0 -1
- package/dist/components/fields/dropdown/Cell.js +6 -4
- package/dist/components/fields/dropdown/ReadView.d.ts +0 -1
- package/dist/components/fields/dropdown/ReadView.js +10 -8
- package/dist/components/fields/dropdown/data.d.ts +1 -1
- package/dist/components/fields/dropdown/data.js +6 -3
- package/dist/components/fields/dropdown/hook.d.ts +0 -1
- package/dist/components/fields/dropdown/hook.js +11 -8
- package/dist/components/fields/dropdown/style.js +88 -85
- package/dist/components/fields/file/ReadView.d.ts +0 -1
- package/dist/components/fields/file/ReadView.js +7 -5
- package/dist/components/fields/formula/ReadView.d.ts +0 -1
- package/dist/components/fields/formula/ReadView.js +7 -5
- package/dist/components/fields/hooks/useViewClass.js +4 -2
- package/dist/components/fields/hyper-link/ReadView.d.ts +0 -1
- package/dist/components/fields/hyper-link/ReadView.js +8 -6
- package/dist/components/fields/hyper-link/style/index.js +18 -15
- package/dist/components/fields/item-group/ReadView.d.ts +0 -1
- package/dist/components/fields/item-group/ReadView.js +6 -4
- package/dist/components/fields/item-type/ItemTypeIcon.js +15 -17
- package/dist/components/fields/item-type/ReadView.d.ts +0 -1
- package/dist/components/fields/item-type/ReadView.js +7 -5
- package/dist/components/fields/item-type/style/index.js +7 -5
- package/dist/components/fields/key/ReadView.d.ts +0 -1
- package/dist/components/fields/key/ReadView.js +7 -5
- package/dist/components/fields/long-text/ReadView.d.ts +0 -1
- package/dist/components/fields/long-text/ReadView.js +8 -6
- package/dist/components/fields/long-text/style/index.js +7 -5
- package/dist/components/fields/number/BaseField.js +5 -2
- package/dist/components/fields/number/ReadView.d.ts +0 -1
- package/dist/components/fields/number/ReadView.js +8 -6
- package/dist/components/fields/priority/ReadView.js +12 -10
- package/dist/components/fields/priority/style/index.js +53 -50
- package/dist/components/fields/radio/ReadView.d.ts +0 -1
- package/dist/components/fields/radio/ReadView.js +8 -6
- package/dist/components/fields/repo-files/ReadView.js +8 -6
- package/dist/components/fields/repo-files/utils.js +5 -3
- package/dist/components/fields/reporter/ReadView.d.ts +0 -1
- package/dist/components/fields/reporter/ReadView.js +11 -9
- package/dist/components/fields/script/BaseField.js +4 -1
- package/dist/components/fields/script/ReadView.d.ts +0 -1
- package/dist/components/fields/script/ReadView.js +10 -8
- package/dist/components/fields/sprint/ReadView.js +7 -5
- package/dist/components/fields/status/Cell.js +8 -6
- package/dist/components/fields/status/Field.d.ts +0 -1
- package/dist/components/fields/status/ReadView.js +10 -8
- package/dist/components/fields/status/SelectFlowHandler.js +15 -12
- package/dist/components/fields/status/SelectTransition.js +13 -10
- package/dist/components/fields/status/Transition.js +18 -15
- package/dist/components/fields/status/TransitionButton.js +17 -14
- package/dist/components/fields/status/TransitionPanel.js +14 -11
- package/dist/components/fields/status/View.js +11 -8
- package/dist/components/fields/status/style/index.js +300 -323
- package/dist/components/fields/story-point/ReadView.d.ts +0 -1
- package/dist/components/fields/story-point/ReadView.js +6 -4
- package/dist/components/fields/tag/ReadView.js +10 -8
- package/dist/components/fields/tag/style/index.js +7 -5
- package/dist/components/fields/team/ReadView.js +10 -8
- package/dist/components/fields/team/style/index.js +5 -3
- package/dist/components/fields/text/BaseField.d.ts +0 -1
- package/dist/components/fields/text/ReadView.js +8 -6
- package/dist/components/fields/tree/ReadView.js +10 -8
- package/dist/components/fields/tree/utils.js +5 -3
- package/dist/components/fields/updated-at/ReadView.js +10 -8
- package/dist/components/fields/updated-by/ReadView.d.ts +0 -1
- package/dist/components/fields/updated-by/ReadView.js +11 -9
- package/dist/components/fields/user/ReadView.d.ts +0 -1
- package/dist/components/fields/user/ReadView.js +11 -9
- package/dist/components/fields/user/style/index.js +12 -9
- package/dist/components/fields/user-group/BaseField.d.ts +0 -1
- package/dist/components/fields/user-group/ReadView.js +11 -13
- package/dist/components/fields/version/ReadView.js +8 -6
- package/dist/components/fields/workspace/ReadView.d.ts +0 -1
- package/dist/components/fields/workspace/ReadView.js +10 -8
- package/dist/components/filters/filter-search/utils.js +6 -6
- package/dist/components/item/hooks.js +5 -2
- package/dist/components/table-components/EditTableCell.d.ts +1 -0
- package/dist/components/table-components/EditTableCell.js +38 -16
- package/dist/components/table-components/index.js +14 -11
- package/dist/components/table-components/style/index.js +7 -5
- package/dist/components/table-components/utils.js +49 -46
- package/dist/icons/SyncIconFont.js +7 -5
- package/dist/icons/createFromIconFontClass.js +3 -1
- package/dist/icons/empty-icon/index.d.ts +8 -1
- package/dist/icons/empty-icon/large-item@2x.png.js +3 -0
- package/dist/icons/empty-icon/large-workspace@2x.png.js +3 -0
- package/dist/icons/empty-icon/small-default@2x.png.js +3 -0
- package/dist/icons/empty-icon/workspace-empty.svg +126 -126
- package/dist/icons/index.d.ts +1 -1
- package/dist/icons/index.js +37 -35
- package/dist/icons/style/index.js +23 -21
- package/dist/icons/svg/ArrowBack.svg.js +3 -0
- package/dist/icons/svg/Done.svg.js +3 -0
- package/dist/icons/svg/DottedCircle.svg.js +3 -0
- package/dist/icons/svg/HollowCircle.svg.js +3 -0
- package/dist/icons/svg/Search.svg.js +3 -0
- package/dist/icons/svg/Workflow.svg.js +3 -0
- package/dist/index.js +47 -47
- package/dist/lib/app/utils.d.ts +0 -1
- package/dist/lib/app/utils.js +4 -2
- package/dist/lib/array.js +5 -44
- package/dist/lib/config.js +8 -6
- package/dist/lib/constants/code.js +3 -1
- package/dist/lib/constants/field.js +5 -2
- package/dist/lib/contexts/antdConfig.js +10 -7
- package/dist/lib/contexts/currentUser.js +7 -4
- package/dist/lib/contexts/currentWorkspace.js +7 -4
- package/dist/lib/contexts/datetimeFormat.js +7 -4
- package/dist/lib/contexts/index.js +16 -13
- package/dist/lib/contexts/itemConfig.js +7 -4
- package/dist/lib/contexts/teamConfig.js +8 -5
- package/dist/lib/contexts/tenant.js +7 -4
- package/dist/lib/contexts/workflowConfig.js +7 -4
- package/dist/lib/dataType.js +4 -5
- package/dist/lib/date.js +11 -52
- package/dist/lib/dayjs.js +2 -1
- package/dist/lib/error/log.js +7 -4
- package/dist/lib/error/utils.d.ts +1 -1
- package/dist/lib/error/utils.js +8 -20
- package/dist/lib/error/withServerError.js +3 -1
- package/dist/lib/fetch.js +23 -54
- package/dist/lib/global.js +16 -14
- package/dist/lib/hooks/useAntdConfig.js +4 -2
- package/dist/lib/hooks/useCurrentUser.js +4 -2
- package/dist/lib/hooks/useCurrentWorkspace.js +4 -2
- package/dist/lib/hooks/useDataQuoteStore.js +8 -5
- package/dist/lib/hooks/useDateTimeFormatType.js +4 -2
- package/dist/lib/hooks/useI18n.d.ts +1 -1
- package/dist/lib/hooks/useI18n.js +4 -2
- package/dist/lib/hooks/useItemConfig.js +4 -2
- package/dist/lib/hooks/useTeamConfig.js +4 -2
- package/dist/lib/hooks/useTenant.js +4 -2
- package/dist/lib/hooks/useWorkflowConfig.js +4 -2
- package/dist/lib/i18n.js +6 -3
- package/dist/lib/icons/utils.js +10 -9
- package/dist/lib/isInOne.js +2 -1
- package/dist/lib/number.js +3 -1
- package/dist/lib/path.d.ts +2 -2
- package/dist/lib/path.js +9 -6
- package/dist/lib/regExp.js +3 -1
- package/dist/lib/router.js +4 -1
- package/dist/lib/storage.js +4 -39
- package/dist/lib/store/dataQuoteStore.js +5 -2
- package/dist/lib/swr/constants.js +4 -2
- package/dist/lib/swr/hooks.js +6 -3
- package/dist/lib/swr/throttleWithCache.js +7 -5
- package/dist/lib/throttleFetch.js +4 -2
- package/dist/lib/useConfig.js +9 -6
- package/dist/lib/useUser.js +9 -6
- package/dist/lib/users.js +5 -2
- package/dist/lib/workflow.js +21 -20
- package/dist/locales/index.js +5 -3
- package/dist/public/icons/BulbIcon.svg +1 -1
- package/dist/public/icons/Cloud.svg +1 -1
- package/dist/public/icons/ConsultIcon.svg +1 -1
- package/dist/public/icons/Demo.svg +1 -1
- package/dist/public/icons/ErrorTemplate.svg +1 -1
- package/dist/public/icons/Fail.svg +1 -1
- package/dist/public/icons/Flag.svg +1 -1
- package/dist/public/icons/GiteeIcon.svg +1 -1
- package/dist/public/icons/IntelligenceGradient.svg +1 -1
- package/dist/public/icons/Issue_Approval.svg +1 -1
- package/dist/public/icons/Issue_Bug.svg +1 -1
- package/dist/public/icons/Issue_Demand.svg +1 -1
- package/dist/public/icons/Issue_Doc.svg +1 -1
- package/dist/public/icons/Issue_Idea.svg +1 -1
- package/dist/public/icons/Issue_List.svg +1 -1
- package/dist/public/icons/Issue_Plan.svg +1 -1
- package/dist/public/icons/Issue_Product.svg +1 -1
- package/dist/public/icons/Issue_Risk.svg +1 -1
- package/dist/public/icons/Issue_Story.svg +1 -1
- package/dist/public/icons/Issue_Subtask.svg +1 -1
- package/dist/public/icons/Issue_Task.svg +1 -1
- package/dist/public/icons/Issue_Test.svg +1 -1
- package/dist/public/icons/Issue_TestExcution.svg +1 -1
- package/dist/public/icons/Issue_TestPlan.svg +1 -1
- package/dist/public/icons/Issue_Time.svg +1 -1
- package/dist/public/icons/Issue_develop.svg +1 -1
- package/dist/public/icons/KanbanCover.svg +7 -7
- package/dist/public/icons/ListCover.svg +117 -117
- package/dist/public/icons/ManHour.svg +1 -1
- package/dist/public/icons/MobileIcon.svg +1 -1
- package/dist/public/icons/NoItemType.svg +10 -10
- package/dist/public/icons/ProductIcon.svg +1 -1
- package/dist/public/icons/RedFlagIcon.svg +1 -1
- package/dist/public/icons/Safe.svg +1 -1
- package/dist/public/icons/StarIcon.svg +60 -60
- package/dist/public/icons/StructureCover.svg +1 -1
- package/dist/public/icons/Success.svg +1 -1
- package/dist/public/icons/TeamIcon.svg +1 -1
- package/dist/public/icons/WebIcon.svg +1 -1
- package/dist/public/icons/iconfont.svg +467 -467
- package/dist/public/icons/iconfont_single_color.css +912 -912
- package/dist/public/mockServiceWorker.js +284 -284
- package/dist/style/common.js +11 -24
- package/dist/style/global.js +9 -7
- package/package.json +111 -105
- package/dist/components/fields/base-component/types.js +0 -1
- package/dist/components/fields/hooks/useParamsAdapter.js +0 -1
- package/dist/components/fields/radio/BaseField.js +0 -1
- package/dist/components/fields/status/Field.js +0 -1
- package/dist/components/fields/tag/BaseField.js +0 -1
- package/dist/components/fields/text/BaseField.js +0 -1
- package/dist/components/fields/tree/BaseField.js +0 -1
- package/dist/components/fields/tree/types.js +0 -1
- package/dist/components/fields/types.js +0 -1
- package/dist/components/fields/user-group/ActionCell.js +0 -1
- package/dist/components/fields/user-group/BaseField.js +0 -1
- package/dist/icons/empty-icon/index.js +0 -8
- package/dist/icons/svg/ArrowBack.svg +0 -1
- package/dist/icons/svg/Done.svg +0 -1
- package/dist/icons/svg/DottedCircle.svg +0 -7
- package/dist/icons/svg/HollowCircle.svg +0 -6
- package/dist/icons/svg/Search.svg +0 -1
- package/dist/icons/svg/Workflow.svg +0 -12
- package/dist/lib/error/index.js +0 -2
package/dist/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
|
|
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';
|
package/dist/lib/app/utils.d.ts
CHANGED
|
@@ -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;
|
package/dist/lib/app/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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 {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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 };
|
package/dist/lib/config.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
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,2 +1,5 @@
|
|
|
1
|
-
import { FIELD_TYPE_KEY_MAPPINGS } from '
|
|
2
|
-
|
|
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 {
|
|
1
|
+
import { jsxs, jsx } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import { createContext } from 'react';
|
|
3
|
-
import {
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
return (
|
|
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: [
|
|
13
|
+
}, children: [jsx(Global, { styles: css(fieldCellGlobalStyle) }), children] }));
|
|
13
14
|
};
|
|
15
|
+
|
|
16
|
+
export { AntdConfigContext, AntdConfigProvider };
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import { createContext } from 'react';
|
|
3
|
+
|
|
3
4
|
const defaultContext = {};
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return (
|
|
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
|
|
1
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import { createContext } from 'react';
|
|
3
|
+
|
|
3
4
|
const defaultContext = {};
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return (
|
|
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
|
|
1
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import { createContext } from 'react';
|
|
3
|
+
|
|
3
4
|
const defaultContext = {};
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return (
|
|
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
|
|
2
|
-
import {
|
|
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
|
-
|
|
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 (
|
|
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
|
|
1
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import { createContext } from 'react';
|
|
3
|
+
|
|
3
4
|
const defaultContext = {};
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return (
|
|
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
|
|
1
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import { createContext, useMemo } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { getQiankunConfig, getPublicRuntimeConfig, getUserConfig } from '../config.js';
|
|
4
|
+
|
|
4
5
|
const defaultContext = {};
|
|
5
|
-
|
|
6
|
-
|
|
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 (
|
|
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
|
|
1
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import { createContext } from 'react';
|
|
3
|
+
|
|
3
4
|
const defaultContext = {};
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return (
|
|
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
|
|
1
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import { createContext } from 'react';
|
|
3
|
+
|
|
3
4
|
const defaultContext = {};
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return (
|
|
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 };
|
package/dist/lib/dataType.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { isNil } from 'lodash-es';
|
|
2
|
-
|
|
3
|
-
|
|
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
|
|
2
|
-
import
|
|
3
|
-
import { DATE_FORMAT, DATE_TYPE
|
|
4
|
-
import { i18n } from './i18n';
|
|
5
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
57
|
-
|
|
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
package/dist/lib/error/log.js
CHANGED
|
@@ -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 {
|
|
4
|
+
import { isChinese } from '../../components/common/utils.js';
|
|
5
|
+
import { nsSeparator, i18n } from '../i18n.js';
|
|
6
|
+
|
|
6
7
|
const logger = debug('lib:error');
|
|
7
|
-
|
|
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
|
-
|
|
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:
|
|
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;
|
package/dist/lib/error/utils.js
CHANGED
|
@@ -1,25 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
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
|
-
|
|
42
|
-
|
|
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 };
|