component-shared 1.0.0
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/Components/Charts/AreaChart.d.ts +19 -0
- package/Components/Charts/AreaChart.js +59 -0
- package/Components/Charts/AreaChart.js.map +1 -0
- package/Components/Charts/BarChart.d.ts +20 -0
- package/Components/Charts/BarChart.js +81 -0
- package/Components/Charts/BarChart.js.map +1 -0
- package/Components/Charts/DoughnutChart.d.ts +12 -0
- package/Components/Charts/DoughnutChart.js +81 -0
- package/Components/Charts/DoughnutChart.js.map +1 -0
- package/Components/Charts/HorizontalBarChart.d.ts +38 -0
- package/Components/Charts/HorizontalBarChart.js +83 -0
- package/Components/Charts/HorizontalBarChart.js.map +1 -0
- package/Components/Charts/LineChart.d.ts +21 -0
- package/Components/Charts/LineChart.js +133 -0
- package/Components/Charts/LineChart.js.map +1 -0
- package/Components/Charts/PieChart.d.ts +20 -0
- package/Components/Charts/PieChart.js +123 -0
- package/Components/Charts/PieChart.js.map +1 -0
- package/Components/Charts/index.d.ts +5 -0
- package/Components/Charts/index.js +6 -0
- package/Components/Charts/index.js.map +1 -0
- package/Components/Charts/type.d.ts +6 -0
- package/Components/Charts/type.js +2 -0
- package/Components/Charts/type.js.map +1 -0
- package/Components/CopyToClipboard/index.d.ts +23 -0
- package/Components/CopyToClipboard/index.js +54 -0
- package/Components/CopyToClipboard/index.js.map +1 -0
- package/Components/CopyToClipboard/indexv2.d.ts +30 -0
- package/Components/CopyToClipboard/indexv2.js +63 -0
- package/Components/CopyToClipboard/indexv2.js.map +1 -0
- package/Components/DropZone/components/DropzoneArea.d.ts +31 -0
- package/Components/DropZone/components/DropzoneArea.js +221 -0
- package/Components/DropZone/components/DropzoneArea.js.map +1 -0
- package/Components/DropZone/components/DropzoneAreaBase.d.ts +4 -0
- package/Components/DropZone/components/DropzoneAreaBase.js +555 -0
- package/Components/DropZone/components/DropzoneAreaBase.js.map +1 -0
- package/Components/DropZone/components/DropzoneDialog.d.ts +33 -0
- package/Components/DropZone/components/DropzoneDialog.js +222 -0
- package/Components/DropZone/components/DropzoneDialog.js.map +1 -0
- package/Components/DropZone/components/DropzoneDialogBase.d.ts +27 -0
- package/Components/DropZone/components/DropzoneDialogBase.js +152 -0
- package/Components/DropZone/components/DropzoneDialogBase.js.map +1 -0
- package/Components/DropZone/components/PreviewList.d.ts +3 -0
- package/Components/DropZone/components/PreviewList.js +132 -0
- package/Components/DropZone/components/PreviewList.js.map +1 -0
- package/Components/DropZone/components/SnackbarContentWrapper.d.ts +3 -0
- package/Components/DropZone/components/SnackbarContentWrapper.js +94 -0
- package/Components/DropZone/components/SnackbarContentWrapper.js.map +1 -0
- package/Components/DropZone/helpers.d.ts +5 -0
- package/Components/DropZone/helpers.js +64 -0
- package/Components/DropZone/helpers.js.map +1 -0
- package/Components/DropZone/index.d.ts +120 -0
- package/Components/EditAvatar/index.d.ts +26 -0
- package/Components/EditAvatar/index.js +137 -0
- package/Components/EditAvatar/index.js.map +1 -0
- package/Components/FlexInfiniteScroll/index.d.ts +26 -0
- package/Components/FlexInfiniteScroll/index.js +82 -0
- package/Components/FlexInfiniteScroll/index.js.map +1 -0
- package/Components/Helper/LazySpinner.d.ts +5 -0
- package/Components/Helper/LazySpinner.js +33 -0
- package/Components/Helper/LazySpinner.js.map +1 -0
- package/Components/Helper/RoleKey.d.ts +9 -0
- package/Components/Helper/RoleKey.js +15 -0
- package/Components/Helper/RoleKey.js.map +1 -0
- package/Components/Helper/index.d.ts +41 -0
- package/Components/Helper/index.js +247 -0
- package/Components/Helper/index.js.map +1 -0
- package/Components/HocLazyView/index.d.ts +51 -0
- package/Components/HocLazyView/index.js +123 -0
- package/Components/HocLazyView/index.js.map +1 -0
- package/Components/HtmlTooltip/index.d.ts +3 -0
- package/Components/HtmlTooltip/index.js +28 -0
- package/Components/HtmlTooltip/index.js.map +1 -0
- package/Components/Icons/index.d.ts +6 -0
- package/Components/Icons/index.js +52 -0
- package/Components/Icons/index.js.map +1 -0
- package/Components/LazySpinner.css +6 -0
- package/Components/MapLayout/index.d.ts +33 -0
- package/Components/MapLayout/index.js +80 -0
- package/Components/MapLayout/index.js.map +1 -0
- package/Components/MessageBox/index.d.ts +28 -0
- package/Components/MessageBox/index.js +93 -0
- package/Components/MessageBox/index.js.map +1 -0
- package/Components/Models/index.d.ts +641 -0
- package/Components/Models/index.js +87 -0
- package/Components/Models/index.js.map +1 -0
- package/Components/Redux/core/CRUDSlice.d.ts +20 -0
- package/Components/Redux/core/CRUDSlice.js +62 -0
- package/Components/Redux/core/CRUDSlice.js.map +1 -0
- package/Components/Redux/core/type.d.ts +11 -0
- package/Components/Redux/core/type.js +9 -0
- package/Components/Redux/core/type.js.map +1 -0
- package/Components/SkeletonLazyView/index.d.ts +9 -0
- package/Components/SkeletonLazyView/index.js +38 -0
- package/Components/SkeletonLazyView/index.js.map +1 -0
- package/Components/SkeletonService/index.d.ts +15 -0
- package/Components/SkeletonService/index.js +57 -0
- package/Components/SkeletonService/index.js.map +1 -0
- package/Components/SubComponent/index.d.ts +151 -0
- package/Components/SubComponent/index.js +883 -0
- package/Components/SubComponent/index.js.map +1 -0
- package/Components/SubComponent/v2/index.d.ts +20 -0
- package/Components/SubComponent/v2/index.js +58 -0
- package/Components/SubComponent/v2/index.js.map +1 -0
- package/Components/SubUserInputModels/ContactInfoForm/index.d.ts +11 -0
- package/Components/SubUserInputModels/ContactInfoForm/index.js +130 -0
- package/Components/SubUserInputModels/ContactInfoForm/index.js.map +1 -0
- package/Components/SubUserInputModels/index.d.ts +59 -0
- package/Components/SubUserInputModels/index.js +928 -0
- package/Components/SubUserInputModels/index.js.map +1 -0
- package/Components/SwitchComponent/index.d.ts +21 -0
- package/Components/SwitchComponent/index.js +71 -0
- package/Components/SwitchComponent/index.js.map +1 -0
- package/Components/TemplateModal/index.d.ts +29 -0
- package/Components/TemplateModal/index.js +94 -0
- package/Components/TemplateModal/index.js.map +1 -0
- package/Components/TemplateTable/FormTest/index.d.ts +4 -0
- package/Components/TemplateTable/FormTest/index.js +22 -0
- package/Components/TemplateTable/FormTest/index.js.map +1 -0
- package/Components/TemplateTable/InputFormBase/index.d.ts +23 -0
- package/Components/TemplateTable/InputFormBase/index.js +111 -0
- package/Components/TemplateTable/InputFormBase/index.js.map +1 -0
- package/Components/TemplateTable/InputFormModal/index.d.ts +22 -0
- package/Components/TemplateTable/InputFormModal/index.js +103 -0
- package/Components/TemplateTable/InputFormModal/index.js.map +1 -0
- package/Components/TemplateTable/ItemRowMenu/index.d.ts +13 -0
- package/Components/TemplateTable/ItemRowMenu/index.js +49 -0
- package/Components/TemplateTable/ItemRowMenu/index.js.map +1 -0
- package/Components/TemplateTable/PanelAction/index.d.ts +11 -0
- package/Components/TemplateTable/PanelAction/index.js +51 -0
- package/Components/TemplateTable/PanelAction/index.js.map +1 -0
- package/Components/TemplateTable/TableContext/index.d.ts +1 -0
- package/Components/TemplateTable/TableContext/index.js +2 -0
- package/Components/TemplateTable/TableContext/index.js.map +1 -0
- package/Components/TemplateTable/helper.d.ts +3 -0
- package/Components/TemplateTable/helper.js +20 -0
- package/Components/TemplateTable/helper.js.map +1 -0
- package/Components/TemplateTable/index.d.ts +49 -0
- package/Components/TemplateTable/index.js +208 -0
- package/Components/TemplateTable/index.js.map +1 -0
- package/Components/UploadLayout/ProgressItem.d.ts +27 -0
- package/Components/UploadLayout/ProgressItem.js +210 -0
- package/Components/UploadLayout/ProgressItem.js.map +1 -0
- package/Components/UploadLayout/UploadArea.d.ts +9 -0
- package/Components/UploadLayout/UploadArea.js +58 -0
- package/Components/UploadLayout/UploadArea.js.map +1 -0
- package/Components/UploadLayout/UploadMonitor.d.ts +42 -0
- package/Components/UploadLayout/UploadMonitor.js +259 -0
- package/Components/UploadLayout/UploadMonitor.js.map +1 -0
- package/Components/UploadLayout/UploadPannel.d.ts +4 -0
- package/Components/UploadLayout/UploadPannel.js +20 -0
- package/Components/UploadLayout/UploadPannel.js.map +1 -0
- package/Components/UploadLayout/UploadStatus.d.ts +21 -0
- package/Components/UploadLayout/UploadStatus.js +184 -0
- package/Components/UploadLayout/UploadStatus.js.map +1 -0
- package/Components/UploadLayout/index.d.ts +69 -0
- package/Components/UploadLayout/index.js +265 -0
- package/Components/UploadLayout/index.js.map +1 -0
- package/Components/UploadLayout/types.d.ts +10 -0
- package/Components/UploadLayout/types.js +2 -0
- package/Components/UploadLayout/types.js.map +1 -0
- package/Components/Views/Billing/BillingForm/index.d.ts +16 -0
- package/Components/Views/Billing/BillingForm/index.js +49 -0
- package/Components/Views/Billing/BillingForm/index.js.map +1 -0
- package/Components/Views/Billing/ItemBillingRowMenu/index.d.ts +23 -0
- package/Components/Views/Billing/ItemBillingRowMenu/index.js +153 -0
- package/Components/Views/Billing/ItemBillingRowMenu/index.js.map +1 -0
- package/Components/Views/Billing/MenuMore/index.d.ts +6 -0
- package/Components/Views/Billing/MenuMore/index.js +89 -0
- package/Components/Views/Billing/MenuMore/index.js.map +1 -0
- package/Components/Views/Billing/SubBillingFormComponent/index.d.ts +14 -0
- package/Components/Views/Billing/SubBillingFormComponent/index.js +306 -0
- package/Components/Views/Billing/SubBillingFormComponent/index.js.map +1 -0
- package/Components/Views/BillingDetail/BillingDetailForm/index.d.ts +16 -0
- package/Components/Views/BillingDetail/BillingDetailForm/index.js +49 -0
- package/Components/Views/BillingDetail/BillingDetailForm/index.js.map +1 -0
- package/Components/Views/BillingDetail/SubComponent/index.d.ts +10 -0
- package/Components/Views/BillingDetail/SubComponent/index.js +152 -0
- package/Components/Views/BillingDetail/SubComponent/index.js.map +1 -0
- package/Components/Views/DashBoard/Common/index.d.ts +18 -0
- package/Components/Views/DashBoard/Common/index.js +55 -0
- package/Components/Views/DashBoard/Common/index.js.map +1 -0
- package/Components/Views/DashBoard/DeliveryInfo/index.d.ts +17 -0
- package/Components/Views/DashBoard/DeliveryInfo/index.js +92 -0
- package/Components/Views/DashBoard/DeliveryInfo/index.js.map +1 -0
- package/Components/Views/DashBoard/OverViewInfo/index.d.ts +29 -0
- package/Components/Views/DashBoard/OverViewInfo/index.js +237 -0
- package/Components/Views/DashBoard/OverViewInfo/index.js.map +1 -0
- package/Components/Views/DashBoard/PanelIntro/index.d.ts +4 -0
- package/Components/Views/DashBoard/PanelIntro/index.js +76 -0
- package/Components/Views/DashBoard/PanelIntro/index.js.map +1 -0
- package/Components/Views/DashBoard/SummaryPanel/index.d.ts +20 -0
- package/Components/Views/DashBoard/SummaryPanel/index.js +229 -0
- package/Components/Views/DashBoard/SummaryPanel/index.js.map +1 -0
- package/Components/Views/DashBoard/TopChannel/index.d.ts +13 -0
- package/Components/Views/DashBoard/TopChannel/index.js +89 -0
- package/Components/Views/DashBoard/TopChannel/index.js.map +1 -0
- package/Components/Views/DashBoard/TopViewTable/index.d.ts +12 -0
- package/Components/Views/DashBoard/TopViewTable/index.js +79 -0
- package/Components/Views/DashBoard/TopViewTable/index.js.map +1 -0
- package/Components/Views/DashBoard/type.d.ts +9 -0
- package/Components/Views/DashBoard/type.js +2 -0
- package/Components/Views/DashBoard/type.js.map +1 -0
- package/Components/Views/Helper/index.d.ts +2 -0
- package/Components/Views/Helper/index.js +10 -0
- package/Components/Views/Helper/index.js.map +1 -0
- package/Components/YoutubeImage/index.d.ts +45 -0
- package/Components/YoutubeImage/index.js +52 -0
- package/Components/YoutubeImage/index.js.map +1 -0
- package/Components/excel-icon-disabled.svg +16 -0
- package/Components/excel-icon.svg +9 -0
- package/Components/index.css +0 -0
- package/Components/index.d.ts +120 -0
- package/ComponentsV2/GlobalModal/index.d.ts +37 -0
- package/ComponentsV2/GlobalModal/index.js +100 -0
- package/ComponentsV2/GlobalModal/index.js.map +1 -0
- package/ComponentsV2/HeightEqualWidth/index.d.ts +8 -0
- package/ComponentsV2/HeightEqualWidth/index.js +41 -0
- package/ComponentsV2/HeightEqualWidth/index.js.map +1 -0
- package/ComponentsV2/LazyView/index.d.ts +6 -0
- package/ComponentsV2/LazyView/index.js +30 -0
- package/ComponentsV2/LazyView/index.js.map +1 -0
- package/ComponentsV2/LoadingAnimation/LoadingSquare.d.ts +3 -0
- package/ComponentsV2/LoadingAnimation/LoadingSquare.js +203 -0
- package/ComponentsV2/LoadingAnimation/LoadingSquare.js.map +1 -0
- package/ComponentsV2/LoadingAnimation/index.d.ts +9 -0
- package/ComponentsV2/LoadingAnimation/index.js +25 -0
- package/ComponentsV2/LoadingAnimation/index.js.map +1 -0
- package/ComponentsV2/TableTemplate/CRUDPannel.d.ts +22 -0
- package/ComponentsV2/TableTemplate/CRUDPannel.js +199 -0
- package/ComponentsV2/TableTemplate/CRUDPannel.js.map +1 -0
- package/ComponentsV2/TableTemplate/CreateTableTemplate.d.ts +60 -0
- package/ComponentsV2/TableTemplate/CreateTableTemplate.js +330 -0
- package/ComponentsV2/TableTemplate/CreateTableTemplate.js.map +1 -0
- package/ComponentsV2/TableTemplate/CustomGridFilterPanel.d.ts +6 -0
- package/ComponentsV2/TableTemplate/CustomGridFilterPanel.js +71 -0
- package/ComponentsV2/TableTemplate/CustomGridFilterPanel.js.map +1 -0
- package/ComponentsV2/TableTemplate/CustomerGridToolbar.d.ts +2 -0
- package/ComponentsV2/TableTemplate/CustomerGridToolbar.js +45 -0
- package/ComponentsV2/TableTemplate/CustomerGridToolbar.js.map +1 -0
- package/ComponentsV2/TableTemplate/ItemRowMenu/index.d.ts +14 -0
- package/ComponentsV2/TableTemplate/ItemRowMenu/index.js +49 -0
- package/ComponentsV2/TableTemplate/ItemRowMenu/index.js.map +1 -0
- package/ComponentsV2/TableTemplate/MapOperators.d.ts +5 -0
- package/ComponentsV2/TableTemplate/MapOperators.js +49 -0
- package/ComponentsV2/TableTemplate/MapOperators.js.map +1 -0
- package/ComponentsV2/TableTemplate/NoRowsOverlay.d.ts +5 -0
- package/ComponentsV2/TableTemplate/NoRowsOverlay.js +39 -0
- package/ComponentsV2/TableTemplate/NoRowsOverlay.js.map +1 -0
- package/ComponentsV2/TableTemplate/TableConverter.d.ts +33 -0
- package/ComponentsV2/TableTemplate/TableConverter.js +112 -0
- package/ComponentsV2/TableTemplate/TableConverter.js.map +1 -0
- package/ComponentsV2/TableTemplate/TableFormatter.d.ts +10 -0
- package/ComponentsV2/TableTemplate/TableFormatter.js +122 -0
- package/ComponentsV2/TableTemplate/TableFormatter.js.map +1 -0
- package/ComponentsV2/TableTemplate/TableTemplateContext.d.ts +16 -0
- package/ComponentsV2/TableTemplate/TableTemplateContext.js +6 -0
- package/ComponentsV2/TableTemplate/TableTemplateContext.js.map +1 -0
- package/ComponentsV2/TableTemplate/index.d.ts +14 -0
- package/ComponentsV2/TableTemplate/index.js +9 -0
- package/ComponentsV2/TableTemplate/index.js.map +1 -0
- package/ComponentsV2/TableTemplate/type.d.ts +59 -0
- package/ComponentsV2/TableTemplate/type.js +14 -0
- package/ComponentsV2/TableTemplate/type.js.map +1 -0
- package/ComponentsV2/index.css +4 -0
- package/ComponentsV2/index.d.ts +4 -0
- package/ComponentsV2/index.js +6 -0
- package/ComponentsV2/index.js.map +1 -0
- package/Services/Getway/RequestHelper.d.ts +2 -0
- package/Services/Getway/RequestHelper.js +51 -0
- package/Services/Getway/RequestHelper.js.map +1 -0
- package/Services/Getway/index.d.ts +3 -0
- package/Services/Getway/index.js +14 -0
- package/Services/Getway/index.js.map +1 -0
- package/Services/ServiceBase.d.ts +32 -0
- package/Services/ServiceBase.js +523 -0
- package/Services/ServiceBase.js.map +1 -0
- package/_virtual/_rollupPluginBabelHelpers.js +393 -0
- package/_virtual/_rollupPluginBabelHelpers.js.map +1 -0
- package/index.css +2 -0
- package/index.css.map +1 -0
- package/package.json +118 -0
- package/types/clipboard-copy.d.ts +6 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/Components/Models/index.ts"],"sourcesContent":["import { Dictionary } from '@reduxjs/toolkit'\r\nimport { RoleKeyExternalSite, RoleKeyInternalSite } from '../Helper/RoleKey'\r\n\r\nexport type UserInputType = 'Create' | 'Edit' | 'Profile'\r\nexport interface IUserInputProfile {\r\n Type: UserInputType\r\n user?: IUser\r\n DirectWhenClose?: string\r\n}\r\nexport interface IUser {\r\n Id: string\r\n FirstName: string\r\n LastName: string\r\n UserName: string\r\n Email: string\r\n Avatar: string\r\n LockoutEnabled: boolean\r\n LockoutEnd: string | null\r\n DateCreated: string\r\n IsLock: boolean\r\n PhoneNumber: string\r\n SigningDate: string\r\n PersonAddress: string\r\n PersonIdentityCard: string\r\n DisplayName: string\r\n //business info\r\n CompanyName: string\r\n Position: string\r\n BusinessAddress: string\r\n //payment info\r\n BeneficiaryName: string\r\n AccountNumber: string\r\n BankName: string\r\n IdentityCard: string\r\n SwiftNumber: string\r\n BankAddress: string\r\n AutoPassword?: string\r\n Roles: string[]\r\n UserCreatorId: string\r\n DisplayCreator: string\r\n EmailCreator: string\r\n UserNameCreator: string\r\n //contact\r\n ContactInfoMap: { [key: string]: IContactInfo }\r\n Tags: string\r\n}\r\n\r\nexport interface IChangePassword {\r\n Id: string\r\n CurrentPassword: string\r\n NewPassword: string\r\n ConfirmPassword: string\r\n}\r\n\r\nexport interface IAccountPermission {\r\n Id: string\r\n Roles: (RoleKeyInternalSite | RoleKeyExternalSite) | (RoleKeyInternalSite | RoleKeyExternalSite)[]\r\n}\r\nexport interface EntityTimeBase {\r\n DateCreated: string\r\n DateUpdated: string\r\n}\r\nexport interface IUserCreator {\r\n UserCreatorId: string\r\n}\r\nexport interface IAccountBank {\r\n Id: string\r\n BeneficiaryName: string\r\n AccountNumber: string\r\n BankName: string\r\n IdentityCard: string\r\n SwiftNumber: string\r\n BankAddress: string\r\n UserId: string\r\n}\r\nexport interface IReportPayment {\r\n Name: string\r\n TransactionId: string\r\n ReportId: string\r\n Description: string\r\n Payout: number\r\n USDRate: number\r\n}\r\nexport interface ISelectModel {\r\n Id: string\r\n Name: string\r\n UserId: string\r\n}\r\nexport interface IVideoPrice {\r\n Id: string\r\n Summary: string\r\n Price: number\r\n UserId: string\r\n Actions?: string\r\n}\r\nexport interface IMediaChannel {\r\n Id: string\r\n Platform: string\r\n Name: string\r\n Summary: string\r\n Link: string\r\n UserId: string\r\n Actions?: string\r\n}\r\nexport interface IExtendMediaChannel extends IMediaChannel {\r\n Email: string\r\n Manage: string\r\n}\r\nexport interface IContactInfo {\r\n Id: string\r\n Platform: string\r\n Name: string\r\n Link: string\r\n UserId: string\r\n}\r\n\r\nexport interface IAsset {\r\n Kind: string\r\n Id: string\r\n Type: string\r\n Title: string\r\n CustomId: string\r\n MediaId?: string\r\n MediaName?: string\r\n TimeCreated: string\r\n LabelName: string\r\n}\r\nexport interface IAssetLabel {\r\n Name: string\r\n UserId: string\r\n Email: string\r\n AmountAssets: number\r\n}\r\n\r\nexport interface INamingFolder {\r\n FolderName: string\r\n FolderId: string\r\n UserIds: string[] | string\r\n Users: string\r\n FileAmount: number\r\n}\r\n\r\nexport interface INamingFolderExtend extends INamingFolder {\r\n Actions?: string\r\n}\r\n\r\nexport enum MediaNetworkStatus {\r\n Active = 'Active',\r\n Inactive = 'Inactive',\r\n}\r\nexport interface IMediaNetwork extends EntityTimeBase {\r\n Id: string\r\n Name: string\r\n Status: MediaNetworkStatus\r\n OwnerId: string\r\n AccountJson: string\r\n Description: string\r\n Types: EChannelType[]\r\n}\r\nexport interface IMediaNetworkInfo {\r\n Data: IMediaNetwork[]\r\n Types: EChannelType[]\r\n}\r\n\r\nexport enum JoinNetworkStatus {\r\n Pending = 'Pending',\r\n Inviting = 'Inviting',\r\n Joined = 'Joined',\r\n Rejected = 'Rejected',\r\n}\r\n\r\nexport interface IChannelNetwork extends EntityTimeBase {\r\n Id: string\r\n ChannelId: string\r\n Name: string\r\n UserId: string\r\n DisplayName: string\r\n Email: string\r\n UserEmail: string\r\n // Network: string;\r\n // Status: ChannelNetworkStatus;\r\n // NetworkId: string;\r\n // Percentage: number\r\n}\r\nexport enum WhitelistStatus {\r\n Pending = 'Pending',\r\n Accepted = 'Accepted',\r\n Rejected = 'Rejected',\r\n}\r\nexport interface IWhitelist extends EntityTimeBase {\r\n Id: string\r\n ChannelId: string\r\n ChannelName: string\r\n AcceptedDate: string\r\n Status: WhitelistStatus\r\n NetworkId: string\r\n UserId: string\r\n DisplayName: string\r\n}\r\nexport interface IItemSummary {\r\n Folder: number\r\n File: number\r\n Audio: number\r\n Image: number\r\n Video: number\r\n Asset: number\r\n AssetLabel: number\r\n ChannelContent: number\r\n}\r\n\r\nexport interface ITotalEarning {\r\n [key: string]: number\r\n}\r\nexport interface IBillingSummary {\r\n Title: string\r\n Total: number\r\n Details: number[]\r\n}\r\nexport interface IEarningCardDTO {\r\n Asset: number\r\n Channel: number\r\n AssetDate?: string\r\n ChannelDate?: string\r\n}\r\nexport interface ISummaryChart {\r\n ChartData: { [key: string]: IBillingSummary }\r\n EarningCards: { [key: string]: IEarningCardDTO }\r\n}\r\nexport interface IUserReport {\r\n UserId: string\r\n DisplayName: string\r\n Email: string\r\n Manager: string\r\n Monthly: string\r\n Video: number\r\n Audio: number\r\n Content: number\r\n Claimed: number\r\n Values: Dictionary<number>\r\n}\r\nexport interface IFile {\r\n Id: string\r\n Name: string\r\n Extension: string\r\n DriveFileId: string\r\n DisplayName: string\r\n FolderName: string\r\n DateCreated: string\r\n MetaFolderId: string\r\n Email: string\r\n IsRerender: boolean\r\n ReExtension: any\r\n ReContentId: any\r\n UserId: string\r\n}\r\nexport enum EnumChannelType {\r\n Content = 'Content',\r\n Claimed = 'Claimed',\r\n}\r\n\r\nexport type EChannelType = 'Content' | 'Claimed' | EnumChannelType\r\n\r\nexport interface IJoinNetwork extends EntityTimeBase {\r\n Id: string\r\n ChannelId: string\r\n ChannelNetworkId: string\r\n ChannelName: string\r\n UserId: string\r\n DisplayName: string\r\n Network: string\r\n Status: JoinNetworkStatus\r\n Type: EChannelType\r\n NetworkId: string\r\n Percentage: number\r\n Email: string\r\n ManagerId: string\r\n ManagerEmail: string\r\n ManagerName: string\r\n ContractId?: string\r\n ContractName?: string\r\n ContractOptionId?: string\r\n ContractOptionName?: string\r\n ContractOptionDescription?: string\r\n}\r\n\r\nexport enum ReportStatus {\r\n Unpaid = 'Unpaid',\r\n Paid = 'Paid',\r\n}\r\n\r\nexport enum ResourceType {\r\n AudioLabel = 'AudioLabel',\r\n AssetLabel = 'AssetLabel',\r\n ClaimedChannel = 'ClaimedChannel',\r\n ContentChannel = 'ContentChannel',\r\n TrackMusic = 'TrackMusic',\r\n}\r\nconst temp1 = { ...ResourceType }\r\nif ('AudioLabel' in temp1 || 'AssetLabel' in temp1) {\r\n delete (temp1 as any).AssetLabel\r\n delete (temp1 as any).AudioLabel\r\n}\r\nexport const ChannelResourceType = temp1\r\nconst temp2 = { ...ResourceType }\r\nif ('ClaimedChannel' in temp2 || 'ContentChannel' in temp2) {\r\n delete (temp2 as any).ClaimedChannel\r\n delete (temp2 as any).ContentChannel\r\n}\r\nexport const AssetResourceType = temp2\r\n\r\nexport interface IReport extends EntityTimeBase {\r\n Id: string\r\n Name: string\r\n Status: ReportStatus\r\n StartTime: string\r\n EndTime: string\r\n ResourceType: ResourceType\r\n Description: string\r\n Payout: number\r\n NoDetails: boolean\r\n ResourceId: string\r\n ResourceName: string\r\n TransactionId: string\r\n UserId: string\r\n DisplayName: string\r\n Email: string\r\n DatePaid: string\r\n ExchangeRate?: number\r\n}\r\nexport interface IChannelResourceInfo {\r\n Name: string\r\n ChannelId: string\r\n}\r\nexport interface IReportView extends EntityTimeBase {\r\n Id: string\r\n ResourceId: string\r\n ResourceInfo: string\r\n TotalMoney: number\r\n Payout: number\r\n Views: number\r\n ReportId: string\r\n CustomId?: string\r\n EChannelType: EChannelType\r\n Percentage: number\r\n}\r\nexport interface IChannelReportView extends IReportView {\r\n ChannelName?: string\r\n Percentage: number\r\n}\r\nexport interface IAssetReportView extends IReportView {\r\n Percentage: number\r\n Label?: string\r\n}\r\nexport enum EClaimRepository {\r\n Active = 'Active',\r\n InActive = 'InActive',\r\n}\r\nexport interface IClaimRepository extends EntityTimeBase {\r\n Id: string\r\n Name: string\r\n Description?: string\r\n RepositoryUri: string\r\n Status: EClaimRepository\r\n}\r\nexport interface IClaimRepositoryData {\r\n RepositoryIds: string\r\n UserIds: string\r\n}\r\nexport interface IClaimRepositoryRequest {\r\n RepositoryId: string\r\n UserId: string\r\n}\r\nexport type IClaimRepositoryAllocateRequest = IClaimRepositoryRequest[]\r\nexport interface IClaimRepositoryAllocateSearchRequest {\r\n RepositoryId: string\r\n UserId: string\r\n}\r\nexport interface IClaimRepositoryAllocate {\r\n RepositoryId: string\r\n UserId: string\r\n Email: string\r\n DisplayName: string\r\n RepositoryName: string\r\n}\r\nexport interface ISyncChannelGroupRequest {\r\n NetworkId: string\r\n UserId: string\r\n}\r\nexport interface ISyncChannelGroupModel extends ISyncChannelGroupRequest {\r\n AddChannelIds: ISyncChannelGroup[]\r\n DeleteChannelIds: ISyncChannelGroup[]\r\n}\r\nexport interface ISyncChannelGroup {\r\n Id: string\r\n ChannelId: string\r\n ChannelName: string\r\n Type: string\r\n}\r\nexport interface IAddChannelToGroup {\r\n DateCreated: string\r\n DateUpdated: string\r\n Id: string\r\n GroupId: string\r\n ChannelId: string\r\n Status: string\r\n ChannelGroup: IChannelGroup\r\n}\r\nexport interface IChannelGroup {\r\n Id: string\r\n Name: string\r\n Type: string\r\n UserId: string\r\n User: IUser\r\n NetworkId: string\r\n MediaNetwork: IMediaNetwork\r\n}\r\nexport interface IAudioLabel {\r\n Name: string // => id\r\n DateCreated: string\r\n DateUpdated: string\r\n Description: string\r\n ImageUrl: string\r\n UserId: string\r\n Email: string\r\n DisplayName: string\r\n}\r\nexport interface IMediaAsset {\r\n Id: string\r\n Name: string\r\n Description?: string\r\n Length: number\r\n Extension: string\r\n Bitrate: number\r\n SourceId: string\r\n OriginalName: string\r\n AuthorName?: any\r\n LabelName?: any\r\n DeliveryId: string\r\n DateCreated: string\r\n DateUpdated: string\r\n}\r\nexport interface IMediaAuthor {\r\n Name: string // => id\r\n DateCreated: string\r\n DateUpdated: string\r\n Description: string\r\n ImageUrl: string\r\n UserId?: string\r\n Email: string\r\n DisplayName: string\r\n}\r\nexport interface IMediaDeliveryStatus {\r\n Id: string\r\n Pending: number\r\n Release: number\r\n Reject: number\r\n Error: number\r\n}\r\nexport interface IMediaDelivery {\r\n Id: string\r\n Count: number\r\n Description?: string\r\n Name: string\r\n DriveFolderId: string\r\n UploadType: EUploadType\r\n DateCreated: string\r\n DateUpdated: string\r\n UserId: string\r\n Email: string\r\n DisplayName: string\r\n}\r\nexport interface ITagAudioMetaData {\r\n BitsPerSample: number\r\n SampleRate: number\r\n Duration: number\r\n Bitrate: number\r\n Length: number\r\n}\r\nexport interface ITagImageMetaData {\r\n PhotoWidth: number\r\n PhotoHeight: number\r\n Length: number\r\n}\r\nexport interface ITagLicenseMetaData {\r\n Length: number\r\n}\r\nexport interface IMediaValidate {\r\n MetaData?: File\r\n AlbumImages: File[]\r\n Audios: File[]\r\n Licenses: File[]\r\n type?: EUploadType\r\n}\r\nexport interface IMediaValidateRequest {\r\n MetaData?: File\r\n AlbumImages: {\r\n Tag: ITagImageMetaData\r\n File: File\r\n }[]\r\n Audios: {\r\n Tag: ITagAudioMetaData\r\n File: File\r\n }[]\r\n Licenses: {\r\n Tag: ITagLicenseMetaData\r\n File: File\r\n }[]\r\n type?: EUploadType\r\n}\r\n\r\nexport interface IAudioSessionCheck {\r\n Items: { Description?: any; UserId: string; Count: number; UploadType: EUploadType }[]\r\n Token: string\r\n}\r\nexport interface ILicenses {\r\n Name: string\r\n SourceId?: string\r\n}\r\nexport interface IInputValidate {\r\n Data: IAudioMeta[]\r\n Token: string\r\n}\r\nexport enum EStepType {\r\n Upload = 'Upload',\r\n AlbumDetail = 'AlbumDetail',\r\n Preview = 'Preview',\r\n Complete = 'Complete',\r\n}\r\nexport enum ExplicitContentType {\r\n NotExplicit = 'NotExplicit',\r\n Explicit = 'Explicit',\r\n CleanedVersion = 'CleanedVersion',\r\n}\r\nexport type EAlbumStatus = 'Pending' | 'Release' | 'Error' | 'Reject'\r\n\r\nexport enum EMatchPolicy {\r\n Monetizein = 'Monetizein in all countries',\r\n Block = 'Block in all countries',\r\n Trackin = 'Trackin in all countries',\r\n}\r\nexport type TMatchPolicy = EMatchPolicy.Monetizein | EMatchPolicy.Block | EMatchPolicy.Trackin\r\nexport interface IAlbumDetail {\r\n Id: string\r\n Title: string\r\n Language: string\r\n PrimaryArtist: string\r\n OtherArtists?: string\r\n LabelName: string\r\n Status: EAlbumStatus\r\n Note?: string\r\n ImageSourceId?: string\r\n}\r\n\r\nexport interface IAlbumDetailFull extends IAlbumDetail {\r\n ImageFileName: string\r\n AlbumVersion?: string\r\n PrimaryGenre: string\r\n SecondaryGenre: string\r\n CompositionCopyright: string\r\n SoundRecordingCopyright: string\r\n OriginallyReleased: string\r\n Explicit: string\r\n HasCompilationAlbum: boolean\r\n Composers: string\r\n HasLyricist: boolean\r\n Lyricists: string\r\n UPC?: string\r\n OwnershipTerritory?: string\r\n MatchPolicy?: TMatchPolicy\r\n MetaDataId?: string\r\n DeliveryId: string\r\n AuthorName?: string\r\n DateCreated: string\r\n DateUpdated: string\r\n}\r\n\r\ninterface IGroups {\r\n AlbumDetail: IAlbumDetailFull\r\n AudioMetas: IAudioMeta[]\r\n AlbumImageId?: string\r\n RootFolderId: string\r\n AudioFolderId: string\r\n LicenseFolderId: string\r\n}\r\nexport interface IAudioSessionGet {\r\n Token: string\r\n Type: EStepType\r\n TimStamp: string\r\n TempFolderId: string\r\n MediaDelivery: {\r\n Count: number\r\n Description?: string\r\n Name: string\r\n UploadType: EUploadType\r\n UserId: string\r\n }\r\n Groups: IGroups[]\r\n Licenses: ILicenses[]\r\n}\r\n\r\nexport interface IAudioMeta {\r\n AlbumId: string\r\n SourceId: string\r\n HasFile: boolean\r\n Composers?: string\r\n HasLyricist: boolean\r\n Lyricists?: string\r\n Language?: string\r\n Length: number\r\n Extension?: string\r\n Bitrate: number\r\n SampleRate: number\r\n BitsPerSample: number\r\n Duration: number\r\n TrackNumber: number\r\n FileName: string\r\n Title: string\r\n PrimaryArtist?: string\r\n OtherArtists?: string\r\n Genre?: string\r\n AlbumTitle: string\r\n AlbumImage?: string\r\n AlbumReleaseDate: string\r\n OwnershipTerritory?: string\r\n MatchPolicy?: string\r\n LabelName?: string\r\n}\r\n\r\nexport enum EExportType {\r\n ATYoutube = 'ATYoutube',\r\n SRYoutube = 'SRYoutube',\r\n}\r\nexport enum EUploadType {\r\n MetaData = 'MetaData',\r\n NoMetaData = 'NoMetaData',\r\n}\r\nexport interface IAudioExport {\r\n Type: string\r\n DeliveryId: string\r\n}\r\nexport interface IAudioInfo {\r\n Genre: string\r\n AlbumTitle: string\r\n AlbumImage: string\r\n AlbumReleaseDate: string\r\n OwnershipTerritory: string\r\n MatchPolicy: string\r\n LabelName: string\r\n TrackNumber: number\r\n FileName: string\r\n Title: string\r\n PrimaryArtist: string\r\n OtherArtists: string\r\n SourceId: string\r\n}\r\n"],"names":["MediaNetworkStatus","JoinNetworkStatus","WhitelistStatus","EnumChannelType","ReportStatus","ResourceType","temp1","_objectSpread","AssetLabel","AudioLabel","ChannelResourceType","temp2","ClaimedChannel","ContentChannel","AssetResourceType","EClaimRepository","EStepType","ExplicitContentType","EMatchPolicy","EExportType","EUploadType"],"mappings":";;IAkJYA;AAAZ,CAAA,UAAYA,kBAAkB,EAAA;AAC5BA,EAAAA,kBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjBA,EAAAA,kBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACvB,CAAC,EAHWA,kBAAkB,KAAlBA,kBAAkB,GAG7B,EAAA,CAAA,CAAA;IAeWC;AAAZ,CAAA,UAAYA,iBAAiB,EAAA;AAC3BA,EAAAA,iBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnBA,EAAAA,iBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrBA,EAAAA,iBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjBA,EAAAA,iBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACvB,CAAC,EALWA,iBAAi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AAA,CAAA,GAAA,wBAAgC;AAChCA,EAAAA,YAAA,CAAA,SAAA,CAAA,GAAA,0BAAoC;AACtC,CAAC,EAJWA,YAAY,KAAZA,YAAY,GAIvB,EAAA,CAAA,CAAA;IAyFWC;AAAZ,CAAA,UAAYA,WAAW,EAAA;AACrBA,EAAAA,WAAA,CAAA,WAAA,CAAA,GAAA,WAAuB;AACvBA,EAAAA,WAAA,CAAA,WAAA,CAAA,GAAA,WAAuB;AACzB,CAAC,EAHWA,WAAW,KAAXA,WAAW,GAGtB,EAAA,CAAA,CAAA;IACWC;AAAZ,CAAA,UAAYA,WAAW,EAAA;AACrBA,EAAAA,WAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrBA,EAAAA,WAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AAC3B,CAAC,EAHWA,WAAW,KAAXA,WAAW,GAGtB,EAAA,CAAA,CAAA;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { NoInfer } from "@react-spring/types";
|
|
2
|
+
import { ActionReducerMapBuilder, AsyncThunk, EntityAdapter, IdSelector, PayloadAction, Update } from "@reduxjs/toolkit";
|
|
3
|
+
import { ISliceBase } from "./type";
|
|
4
|
+
export declare const CreateCRUDSlice: <TModel, TSliceState extends ISliceBase<TModel> = ISliceBase<TModel>>(name: string, selectId?: IdSelector<TModel> | undefined, Initial?: (state: ISliceBase<TModel>) => TSliceState, extraReducers?: ((builder: ActionReducerMapBuilder<NoInfer<TSliceState>>, adapter: EntityAdapter<TModel>) => void) | undefined) => import("@reduxjs/toolkit").Slice<TSliceState, {
|
|
5
|
+
Update: (state: import("@reduxjs/toolkit").Draft<TSliceState>, action: {
|
|
6
|
+
payload: Update<TModel>;
|
|
7
|
+
type: string;
|
|
8
|
+
}) => void;
|
|
9
|
+
Add: (state: import("@reduxjs/toolkit").Draft<TSliceState>, action: {
|
|
10
|
+
payload: TModel;
|
|
11
|
+
type: string;
|
|
12
|
+
}) => void;
|
|
13
|
+
Remove: (state: import("@reduxjs/toolkit").Draft<TSliceState>, action: PayloadAction<string>) => void;
|
|
14
|
+
RemoveAll: (state: import("@reduxjs/toolkit").Draft<TSliceState>) => void;
|
|
15
|
+
UpsetMany: (state: import("@reduxjs/toolkit").Draft<TSliceState>, action: {
|
|
16
|
+
payload: TModel[];
|
|
17
|
+
type: string;
|
|
18
|
+
}) => void;
|
|
19
|
+
}, string>;
|
|
20
|
+
export declare const buildThunkDefault: <TModel>(builder: ActionReducerMapBuilder<ISliceBase<TModel>>, SliceAdapter: EntityAdapter<TModel>, fetchThunk: AsyncThunk<TModel[], any, any>) => void;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { createEntityAdapter, createSlice } from '@reduxjs/toolkit';
|
|
2
|
+
import { LazyStatus } from './type.js';
|
|
3
|
+
|
|
4
|
+
var CreateCRUDSlice = function CreateCRUDSlice(name, selectId) {
|
|
5
|
+
var Initial = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (s) {
|
|
6
|
+
return s;
|
|
7
|
+
};
|
|
8
|
+
var _extraReducers = arguments.length > 3 ? arguments[3] : undefined;
|
|
9
|
+
var SliceAdapter = createEntityAdapter({
|
|
10
|
+
selectId: selectId
|
|
11
|
+
});
|
|
12
|
+
// Define the initial state using that type
|
|
13
|
+
var initialState = Initial({
|
|
14
|
+
Status: LazyStatus.Loading,
|
|
15
|
+
data: SliceAdapter.getInitialState()
|
|
16
|
+
});
|
|
17
|
+
var ModelSlice = createSlice({
|
|
18
|
+
name: name,
|
|
19
|
+
// `createSlice` will infer the state type from the `initialState` argument
|
|
20
|
+
initialState: initialState,
|
|
21
|
+
reducers: {
|
|
22
|
+
Update: function Update(state, action) {
|
|
23
|
+
SliceAdapter.updateOne(state.data, action.payload);
|
|
24
|
+
},
|
|
25
|
+
Add: function Add(state, action) {
|
|
26
|
+
SliceAdapter.addOne(state.data, action.payload);
|
|
27
|
+
},
|
|
28
|
+
Remove: function Remove(state, action) {
|
|
29
|
+
SliceAdapter.removeOne(state.data, action.payload);
|
|
30
|
+
},
|
|
31
|
+
RemoveAll: function RemoveAll(state) {
|
|
32
|
+
SliceAdapter.removeAll(state.data);
|
|
33
|
+
},
|
|
34
|
+
UpsetMany: function UpsetMany(state, action) {
|
|
35
|
+
SliceAdapter.removeAll(state.data);
|
|
36
|
+
SliceAdapter.upsertMany(state.data, action.payload);
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
extraReducers: function extraReducers(builder) {
|
|
40
|
+
return _extraReducers && _extraReducers(builder, SliceAdapter);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
return ModelSlice;
|
|
44
|
+
};
|
|
45
|
+
var buildThunkDefault = function buildThunkDefault(builder, SliceAdapter, fetchThunk) {
|
|
46
|
+
builder.addCase(fetchThunk.fulfilled, function (state, action) {
|
|
47
|
+
if (state.RequestId !== action.meta.requestId) return;
|
|
48
|
+
state.Status = LazyStatus.Loaded;
|
|
49
|
+
SliceAdapter.removeAll(state.data);
|
|
50
|
+
SliceAdapter.upsertMany(state.data, action);
|
|
51
|
+
}).addCase(fetchThunk.rejected, function (state, action) {
|
|
52
|
+
if (state.RequestId === action.meta.requestId) {
|
|
53
|
+
state.Status = LazyStatus.Error;
|
|
54
|
+
}
|
|
55
|
+
}).addCase(fetchThunk.pending, function (state, action) {
|
|
56
|
+
state.Status = LazyStatus.Loading;
|
|
57
|
+
state.RequestId = action.meta.requestId;
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export { CreateCRUDSlice, buildThunkDefault };
|
|
62
|
+
//# sourceMappingURL=CRUDSlice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CRUDSlice.js","sources":["../../../../src/Components/Redux/core/CRUDSlice.ts"],"sourcesContent":["import { NoInfer } from \"@react-spring/types\";\r\nimport {\r\n ActionReducerMapBuilder,\r\n AsyncThunk,\r\n createEntityAdapter,\r\n createSlice,\r\n EntityAdapter,\r\n EntityState,\r\n IdSelector,\r\n PayloadAction,\r\n Update,\r\n} from \"@reduxjs/toolkit\";\r\nimport { ISliceBase, LazyStatus } from \"./type\";\r\nexport const CreateCRUDSlice = <\r\n TModel,\r\n TSliceState extends ISliceBase<TModel> = ISliceBase<TModel>\r\n>(\r\n name: string,\r\n selectId?: IdSelector<TModel>,\r\n Initial: (state: ISliceBase<TModel>) => TSliceState = (s) => s as TSliceState,\r\n extraReducers?: (\r\n builder: ActionReducerMapBuilder<NoInfer<TSliceState>>,\r\n adapter: EntityAdapter<TModel>\r\n ) => void\r\n) => {\r\n const SliceAdapter = createEntityAdapter<TModel>({\r\n selectId,\r\n });\r\n // Define the initial state using that type\r\n const initialState: TSliceState = Initial({\r\n Status: LazyStatus.Loading,\r\n data: SliceAdapter.getInitialState(),\r\n });\r\n\r\n const ModelSlice = createSlice({\r\n name,\r\n // `createSlice` will infer the state type from the `initialState` argument\r\n initialState,\r\n reducers: {\r\n Update: (state, action: PayloadAction<Update<TModel>>) => {\r\n SliceAdapter.updateOne(\r\n state.data as EntityState<TModel>,\r\n action.payload\r\n );\r\n },\r\n Add: (state, action: PayloadAction<TModel>) => {\r\n SliceAdapter.addOne(state.data as EntityState<TModel>, action.payload);\r\n },\r\n Remove: (state, action: PayloadAction<string>) => {\r\n SliceAdapter.removeOne(\r\n state.data as EntityState<TModel>,\r\n action.payload\r\n );\r\n },\r\n RemoveAll: (state) => {\r\n SliceAdapter.removeAll(state.data as EntityState<TModel>);\r\n },\r\n UpsetMany: (state, action: PayloadAction<TModel[]>) => {\r\n SliceAdapter.removeAll(state.data as EntityState<TModel>);\r\n SliceAdapter.upsertMany(\r\n state.data as EntityState<TModel>,\r\n action.payload\r\n );\r\n },\r\n },\r\n extraReducers: (builder) =>\r\n extraReducers && extraReducers(builder, SliceAdapter),\r\n });\r\n return ModelSlice;\r\n};\r\n\r\nexport const buildThunkDefault = <TModel>(\r\n builder: ActionReducerMapBuilder<NoInfer<ISliceBase<TModel>>>,\r\n SliceAdapter: EntityAdapter<TModel>,\r\n fetchThunk: AsyncThunk<TModel[], any, any>\r\n) => {\r\n builder\r\n .addCase(fetchThunk.fulfilled, (state, action) => {\r\n if(state.RequestId !== action.meta.requestId ) return\r\n state.Status = LazyStatus.Loaded;\r\n \r\n SliceAdapter.removeAll(state.data as EntityState<TModel>);\r\n SliceAdapter.upsertMany(state.data as EntityState<TModel>, action);\r\n })\r\n .addCase(fetchThunk.rejected, (state, action) => {\r\n if(state.RequestId === action.meta.requestId ){\r\n state.Status = LazyStatus.Error;\r\n }\r\n })\r\n .addCase(fetchThunk.pending, (state, action) => {\r\n state.Status = LazyStatus.Loading;\r\n state.RequestId = action.meta.requestId\r\n });\r\n};\r\n"],"names":["CreateCRUDSlice","name","selectId","Initial","s","extraReducers","arguments","length","undefined","SliceAdapter","createEntityAdapter","initialState","Status","LazyStatus","Loading","data","getInitialState","ModelSlice","createSlice","reducers","Update","state","action","updateOne","payload","Add","addOne","Remove","removeOne","RemoveAll","removeAll","UpsetMany","upsertMany","builder","buildThunkDefault","fetchThunk","addCase","fulfilled","RequestId","meta","requestId","Loaded","rejected","Error","pending"],"mappings":";;;AAaO,IAAMA,eAAe,GAAG,SAAlBA,eAAeA,CAI1BC,IAAY,EACZC,QAA6B,EAM3B;AAAA,EAAA,IALFC,8EAAsD,UAACC,CAAC,EAAA;AAAA,IAAA,OAAKA,CAAgB;AAAA,GAAA;EAAA,IAC7EC,cAGS,GAAAC,SAAA,CAAAC,MAAA,GAAAD,CAAAA,GAAAA,SAAA,MAAAE,SAAA;EAET,IAAMC,YAAY,GAAGC,mBAAmB,CAAS;AAC/CR,IAAAA,QAAQ,EAARA;AACD,GAAA,CAAC;AACF;EACA,IAAMS,YAAY,GAAgBR,OAAO,CAAC;IACxCS,MAAM,EAAEC,UAAU,CAACC,OAAO;AAC1BC,IAAAA,IAAI,EAAEN,YAAY,CAACO,eAAe;AACnC,GAAA,CAAC;EAEF,IAAMC,UAAU,GAAGC,WAAW,CAAC;AAC7BjB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EACFF,OAAO,CACJG,OAAO,CAACD,UAAU,CAACE,SAAS,EAAE,UAAChB,KAAK,EAAEC,MAAM,EAAI;IAC/C,IAAGD,KAAK,CAACiB,SAAS,KAAKhB,MAAM,CAACiB,IAAI,CAACC,SAAS,EAAG;AAC/CnB,IAAAA,KAAK,CAACT,MAAM,GAAGC,UAAU,CAAC4B,MAAM;AAEhChC,IAAAA,YAAY,CAACqB,SAAS,CAACT,KAAK,CAACN,IAA2B,CAAC;IACzDN,YAAY,CAACuB,UAAU,CAACX,KAAK,CAACN,IAA2B,EAAEO,MAAM,CAAC;AACpE,GAAC,CAAC,CACDc,OAAO,CAACD,UAAU,CAACO,QAAQ,EAAE,UAACrB,KAAK,EAAEC,MAAM,EAAI;IAC9C,IAAGD,KAAK,CAACiB,SAAS,KAAKhB,MAAM,CAACiB,IAAI,CAACC,SAAS,EAAE;AAC5CnB,MAAAA,KAAK,CAACT,MAAM,GAAGC,UAAU,CAAC8B,KAAK;AAChC;AACH,GAAC,CAAC,CACDP,OAAO,CAACD,UAAU,CAACS,OAAO,EAAE,UAACvB,KAAK,EAAEC,MAAM,EAAI;AAC7CD,IAAAA,KAAK,CAACT,MAAM,GAAGC,UAAU,CAACC,OAAO;AACjCO,IAAAA,KAAK,CAACiB,SAAS,GAAGhB,MAAM,CAACiB,IAAI,CAACC,SAAS;AACzC,GAAC,CAAC;AACN;;;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EntityState } from "@reduxjs/toolkit";
|
|
2
|
+
export declare enum LazyStatus {
|
|
3
|
+
Loading = "Loading",
|
|
4
|
+
Loaded = "Loaded",
|
|
5
|
+
Error = "Error"
|
|
6
|
+
}
|
|
7
|
+
export interface ISliceBase<TModel> {
|
|
8
|
+
Status: LazyStatus;
|
|
9
|
+
RequestId?: string;
|
|
10
|
+
data: EntityState<TModel>;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sources":["../../../../src/Components/Redux/core/type.ts"],"sourcesContent":["import { EntityState } from \"@reduxjs/toolkit\";\r\nexport enum LazyStatus {\r\n Loading = \"Loading\",\r\n Loaded = \"Loaded\",\r\n Error = \"Error\",\r\n}\r\nexport interface ISliceBase<TModel> {\r\n Status: LazyStatus;\r\n RequestId?: string;\r\n data: EntityState<TModel>;\r\n}"],"names":["LazyStatus"],"mappings":"IACYA;AAAZ,CAAA,UAAYA,UAAU,EAAA;AACpBA,EAAAA,UAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnBA,EAAAA,UAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjBA,EAAAA,UAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACjB,CAAC,EAJWA,UAAU,KAAVA,UAAU,GAIrB,EAAA,CAAA,CAAA;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BoxProps, SkeletonPropsVariantOverrides } from '@mui/material';
|
|
2
|
+
import { OverridableStringUnion } from '@mui/types';
|
|
3
|
+
import { FC } from 'react';
|
|
4
|
+
interface ItemWrapProps extends BoxProps {
|
|
5
|
+
IsLoading: boolean;
|
|
6
|
+
variant?: OverridableStringUnion<'text' | 'rectangular' | 'circular', SkeletonPropsVariantOverrides>;
|
|
7
|
+
}
|
|
8
|
+
export declare const SkeletonLazyWrap: FC<ItemWrapProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { Box, Skeleton } from '@mui/material';
|
|
4
|
+
import React__default from 'react';
|
|
5
|
+
|
|
6
|
+
var _excluded = ["IsLoading"];
|
|
7
|
+
var SkeletonLazyWrap = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
8
|
+
var _props$variant;
|
|
9
|
+
var IsLoading = props.IsLoading,
|
|
10
|
+
other = _objectWithoutProperties(props, _excluded);
|
|
11
|
+
return jsxs(Box, _objectSpread2(_objectSpread2({
|
|
12
|
+
ref: ref
|
|
13
|
+
}, other), {}, {
|
|
14
|
+
sx: IsLoading ? _objectSpread2({
|
|
15
|
+
position: 'relative'
|
|
16
|
+
}, props.sx || {}) : props.sx,
|
|
17
|
+
children: [props.children, IsLoading ? jsx(Box, {
|
|
18
|
+
sx: {
|
|
19
|
+
position: 'absolute',
|
|
20
|
+
width: '100%',
|
|
21
|
+
height: '100%',
|
|
22
|
+
display: 'flex',
|
|
23
|
+
background: 'white',
|
|
24
|
+
top: 0,
|
|
25
|
+
left: 0
|
|
26
|
+
},
|
|
27
|
+
children: jsx(Skeleton, {
|
|
28
|
+
variant: (_props$variant = props.variant) !== null && _props$variant !== void 0 ? _props$variant : "rectangular",
|
|
29
|
+
animation: "wave",
|
|
30
|
+
height: "100%",
|
|
31
|
+
width: "100%"
|
|
32
|
+
})
|
|
33
|
+
}) : '']
|
|
34
|
+
}));
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export { SkeletonLazyWrap };
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/Components/SkeletonLazyView/index.tsx"],"sourcesContent":["import { Box, BoxProps, Skeleton, SkeletonPropsVariantOverrides } from '@mui/material'\r\nimport { OverridableStringUnion } from '@mui/types'\r\nimport React, { FC, } from 'react'\r\n\r\ninterface ItemWrapProps extends BoxProps {\r\n IsLoading: boolean\r\n variant?: OverridableStringUnion<\r\n 'text' | 'rectangular' | 'circular',\r\n SkeletonPropsVariantOverrides\r\n >;\r\n}\r\n\r\n\r\nexport const SkeletonLazyWrap: FC<ItemWrapProps> = React.forwardRef((props, ref) => {\r\n const { IsLoading, ...other } = props\r\n return <Box ref={ref} {...other} sx={IsLoading ? {\r\n position: 'relative', ...(props.sx || {}),\r\n } : props.sx}>\r\n {props.children}\r\n {IsLoading ? <Box sx={{\r\n position: 'absolute',\r\n width: '100%',\r\n height: '100%',\r\n display: 'flex',\r\n background: 'white',\r\n top: 0,\r\n left: 0\r\n }} >\r\n <Skeleton variant={props.variant ?? \"rectangular\"} animation=\"wave\" height={\"100%\"} width={\"100%\"} />\r\n </Box> : ''}\r\n </Box>\r\n})"],"names":["SkeletonLazyWrap","React","forwardRef","props","ref","_props$variant","IsLoading","other","_objectWithoutProperties","_excluded","_jsxs","Box","_objectSpread","sx","position","children","_jsx","width","height","display","background","top","left","Skeleton","variant","animation"],"mappings":";;;;;;AAaO,IAAMA,gBAAgB,gBAAsBC,cAAK,CAACC,UAAU,CAAC,UAACC,KAAK,EAAEC,GAAG,EAAI;AAAA,EAAA,IAAAC,cAAA;AAC/E,EAAA,IAAQC,SAAS,GAAeH,KAAK,CAA7BG,SAAS;AAAKC,IAAAA,KAAK,GAAAC,wBAAA,CAAKL,KAAK,EAAAM,SAAA,CAAA;AACrC,EAAA,OAAOC,IAAC,CAAAC,GAAG,EAAAC,cAAA,CAAAA,cAAA,CAAA;AAACR,IAAAA,GAAG,EAAEA;AAAG,GAAA,EAAMG,KAAK,CAAA,EAAA,EAAA,EAAA;IAAEM,EAAE,EAAEP,SAAS,GAAAM,cAAA,CAAA;AAC1CE,MAAAA,QAAQ,EAAE;KAAgBX,EAAAA,KAAK,CAACU,EAAE,IAAI,EAAE,CAAA,GACxCV,KAAK,CAACU,EAAE;IAAAE,QAAA,EAAA,CACPZ,KAAK,CAACY,QAAQ,EACdT,SAAS,GAAGU,IAACL,GAAG,EAAA;AAACE,MAAAA,EAAE,EAAE;AAClBC,QAAAA,QAAQ,EAAE,UAAU;AACpBG,QAAAA,KAAK,EAAE,MAAM;AACbC,QAAAA,MAAM,EAAE,MAAM;AACdC,QAAAA,OAAO,EAAE,MAAM;AACfC,QAAAA,UAAU,EAAE,OAAO;AACnBC,QAAAA,GAAG,EAAE,CAAC;AACNC,QAAAA,IAAI,EAAE;OACT;AAAAP,MAAAA,QAAA,EACGC,GAAC,CAAAO,QAAQ,EAAC;QAAAC,OAAO,EAAA,CAAAnB,cAAA,GAAEF,KAAK,CAACqB,OAAO,MAAA,IAAA,IAAAnB,cAAA,KAAA,MAAA,GAAAA,cAAA,GAAI,aAAa;AAAEoB,QAAAA,SAAS,EAAC,MAAM;AAACP,QAAAA,MAAM,EAAE,MAAM;AAAED,QAAAA,KAAK,EAAE;OAAU;KAAA,CACnG,GAAG,EAAE;KACT;AACV,CAAC;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { ComponentType, FC } from 'react';
|
|
2
|
+
interface IOption<IData> {
|
|
3
|
+
action: (param?: any, abort?: AbortSignal) => Promise<IData | undefined>;
|
|
4
|
+
}
|
|
5
|
+
export interface IParamSkeleton {
|
|
6
|
+
param?: any;
|
|
7
|
+
extract?: any;
|
|
8
|
+
onResult?: (data?: any) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const SkeletonServiceCreate: <Tprop, IData>(option: IOption<IData>) => (WrappedComponent: React.ComponentType<Tprop>) => React.FunctionComponent<Omit<Tprop & IParamSkeleton, "data" | "IsLoading">>;
|
|
11
|
+
interface IRoleViewProps {
|
|
12
|
+
Role: string[];
|
|
13
|
+
}
|
|
14
|
+
export declare const RoleView: FC<IRoleViewProps>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { extends as _extends, objectDestructuringEmpty as _objectDestructuringEmpty, slicedToArray as _slicedToArray, objectSpread2 as _objectSpread2 } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import { useState, useRef, useEffect } from 'react';
|
|
4
|
+
import { AuthorizeRouteContext } from 'partner-oidc-auth-ui';
|
|
5
|
+
|
|
6
|
+
var SkeletonServiceCreate = function SkeletonServiceCreate(option) {
|
|
7
|
+
return function (WrappedComponent) {
|
|
8
|
+
var hocComponent = function hocComponent(_ref) {
|
|
9
|
+
var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
10
|
+
var _useState = useState(),
|
|
11
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
12
|
+
data = _useState2[0],
|
|
13
|
+
setData = _useState2[1];
|
|
14
|
+
var isMounted = useRef(false);
|
|
15
|
+
var tokenSource = useRef(new AbortController());
|
|
16
|
+
useEffect(function () {
|
|
17
|
+
var _props$param;
|
|
18
|
+
isMounted.current = true;
|
|
19
|
+
setData(undefined);
|
|
20
|
+
option.action(_objectSpread2({}, (_props$param = props.param) !== null && _props$param !== void 0 ? _props$param : {}), tokenSource.current.signal).then(function (data) {
|
|
21
|
+
if (isMounted.current) {
|
|
22
|
+
setData(data);
|
|
23
|
+
}
|
|
24
|
+
props.onResult && props.onResult(data);
|
|
25
|
+
});
|
|
26
|
+
return function () {
|
|
27
|
+
isMounted.current = false;
|
|
28
|
+
tokenSource.current.abort();
|
|
29
|
+
};
|
|
30
|
+
}, [props.extract]);
|
|
31
|
+
useEffect(function () {}, [props.param]);
|
|
32
|
+
return jsx(WrappedComponent, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
33
|
+
data: data,
|
|
34
|
+
IsLoading: !data
|
|
35
|
+
}));
|
|
36
|
+
};
|
|
37
|
+
return hocComponent;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
var RoleView = function RoleView(props) {
|
|
41
|
+
var mapRole = new Set(props.Role);
|
|
42
|
+
var IsShow = function IsShow(roles) {
|
|
43
|
+
return roles.some(function (x) {
|
|
44
|
+
return mapRole.has(x);
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
return jsx(AuthorizeRouteContext.Consumer, {
|
|
48
|
+
children: function children(_ref2) {
|
|
49
|
+
var _state$roles;
|
|
50
|
+
var state = _ref2.state;
|
|
51
|
+
return IsShow((_state$roles = state.roles) !== null && _state$roles !== void 0 ? _state$roles : []) ? props.children : jsx(Fragment, {});
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export { RoleView, SkeletonServiceCreate };
|
|
57
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/Components/SkeletonService/index.tsx"],"sourcesContent":["import React, { ComponentType, FC, useRef, useState, useEffect, FunctionComponent } from 'react'\r\nimport { AuthorizeRouteContext } from 'partner-oidc-auth-ui'\r\ninterface IOption<IData> {\r\n action: (param?: any, abort?: AbortSignal) => Promise<IData | undefined>\r\n}\r\ninterface IExtenData<IData> {\r\n data: IData\r\n}\r\nexport interface IParamSkeleton {\r\n param?: any\r\n extract?: any\r\n onResult?: (data?: any) => void\r\n}\r\nexport const SkeletonServiceCreate = function <Tprop, IData>(option: IOption<IData>) {\r\n return (WrappedComponent: ComponentType<Tprop>) => {\r\n const hocComponent: FC<Tprop & IExtenData<IData> & IParamSkeleton> = ({ ...props }) => {\r\n const [data, setData] = useState<IData | undefined>()\r\n const isMounted = useRef(false)\r\n const tokenSource = useRef<AbortController>(new AbortController())\r\n useEffect(() => {\r\n isMounted.current = true\r\n setData(undefined)\r\n option.action({ ...(props.param ?? {}) }, tokenSource.current.signal).then((data) => {\r\n if (isMounted.current) {\r\n setData(data)\r\n }\r\n props.onResult && props.onResult(data)\r\n })\r\n return () => {\r\n isMounted.current = false\r\n tokenSource.current.abort()\r\n }\r\n }, [props.extract])\r\n useEffect(() => {}, [props.param])\r\n return <WrappedComponent {...props} data={data} IsLoading={!data} />\r\n }\r\n return hocComponent as FunctionComponent<Omit<Tprop & IParamSkeleton, keyof { data: any; IsLoading: any }>>\r\n }\r\n}\r\ninterface IRoleViewProps {\r\n Role: string[]\r\n}\r\nexport const RoleView: FC<IRoleViewProps> = (props) => {\r\n const mapRole = new Set(props.Role)\r\n const IsShow = (roles: string[]) => roles.some((x) => mapRole.has(x))\r\n return (\r\n <AuthorizeRouteContext.Consumer>\r\n {({ state }) => {\r\n return IsShow(state.roles ?? []) ? props.children : <></>\r\n }}\r\n </AuthorizeRouteContext.Consumer>\r\n )\r\n}\r\n"],"names":["SkeletonServiceCreate","option","WrappedComponent","hocComponent","_ref","props","_extends","_objectDestructuringEmpty","_useState","useState","_useState2","_slicedToArray","data","setData","isMounted","useRef","tokenSource","AbortController","useEffect","_props$param","current","undefined","action","_objectSpread","param","signal","then","onResult","abort","extract","_jsx","IsLoading","RoleView","mapRole","Set","Role","IsShow","roles","some","x","has","AuthorizeRouteContext","Consumer","children","_ref2","_state$roles","state"],"mappings":";;;;;IAaaA,qBAAqB,GAAG,SAAxBA,qBAAqBA,CAA2BC,MAAsB,EAAA;EACjF,OAAO,UAACC,gBAAsC,EAAI;AAChD,IAAA,IAAMC,YAAY,GAAmD,SAA/DA,YAAYA,CAAAC,IAAA,EAAoE;MAAA,IAAXC,KAAK,GAAAC,QAAA,CAAA,EAAA,GAAAC,yBAAA,CAAAH,IAAA,GAAAA,IAAA,EAAA;AAC9E,MAAA,IAAAI,SAAA,GAAwBC,QAAQ,EAAqB;QAAAC,UAAA,GAAAC,cAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAA9CI,QAAAA,IAAI,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAEG,QAAAA,OAAO,GAAAH,UAAA,CAAA,CAAA,CAAA;AACpB,MAAA,IAAMI,SAAS,GAAGC,MAAM,CAAC,KAAK,CAAC;MAC/B,IAAMC,WAAW,GAAGD,MAAM,CAAkB,IAAIE,eAAe,EAAE,CAAC;AAClEC,MAAAA,SAAS,CAAC,YAAK;AAAA,QAAA,IAAAC,YAAA;QACbL,SAAS,CAACM,OAAO,GAAG,IAAI;QACxBP,OAAO,CAACQ,SAAS,CAAC;AAClBpB,QAAAA,MAAM,CAACqB,MAAM,CAAAC,cAAA,CAAAJ,EAAAA,EAAAA,CAAAA,YAAA,GAAOd,KAAK,CAACmB,KAAK,MAAAL,IAAAA,IAAAA,YAAA,KAAAA,MAAAA,GAAAA,YAAA,GAAI,EAAE,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,KAAK,GAAAF,KAAA,CAALE,KAAK;MACP,OAAOV,MAAM,CAAAS,CAAAA,YAAA,GAACC,KAAK,CAACT,KAAK,MAAA,IAAA,IAAAQ,YAAA,KAAA,MAAA,GAAAA,YAAA,GAAI,EAAE,CAAC,GAAGxC,KAAK,CAACsC,QAAQ,GAAGb,iBAAK;AAC3D;AAAC,GAAA,CAC8B;AAErC;;;;"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import React, { ComponentType, FC } from 'react';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material';
|
|
3
|
+
import * as SubLocal from 'partner-local-lib/SubComponents';
|
|
4
|
+
import { Variant } from '@mui/material/styles/createTypography';
|
|
5
|
+
import { PartialError } from 'partner-local-lib/helper';
|
|
6
|
+
export interface FormBase<TModel> {
|
|
7
|
+
MessageError?: PartialError<TModel>;
|
|
8
|
+
onBlur?: (keyName: string) => void;
|
|
9
|
+
Model?: TModel;
|
|
10
|
+
IsForm?: boolean;
|
|
11
|
+
IdForm?: string;
|
|
12
|
+
onSubmit?: React.FormEventHandler<HTMLFormElement>;
|
|
13
|
+
}
|
|
14
|
+
interface ErrorAllProps {
|
|
15
|
+
MessageError?: PartialError<any>;
|
|
16
|
+
}
|
|
17
|
+
export declare const ErrorAll: FC<ErrorAllProps>;
|
|
18
|
+
interface BoxInfoProps {
|
|
19
|
+
title: string;
|
|
20
|
+
mb?: boolean;
|
|
21
|
+
icon?: JSX.Element;
|
|
22
|
+
MessageError?: PartialError<any> | any;
|
|
23
|
+
TitleExtends?: JSX.Element;
|
|
24
|
+
sx?: SxProps<Theme>;
|
|
25
|
+
sxTitle?: SxProps<Theme>;
|
|
26
|
+
variant?: Variant;
|
|
27
|
+
IsBorder?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export declare const BoxInfo: FC<BoxInfoProps>;
|
|
30
|
+
export declare const BoxGroup: FC<BoxInfoProps>;
|
|
31
|
+
export declare const WrapFrom: FC<{
|
|
32
|
+
IsForm?: boolean;
|
|
33
|
+
Id?: string;
|
|
34
|
+
onSubmit?: React.FormEventHandler<HTMLFormElement>;
|
|
35
|
+
}>;
|
|
36
|
+
export interface Select2Props<TModel> extends SubLocal.ErrorProps {
|
|
37
|
+
fetchData: (value?: string, signal?: AbortSignal) => Promise<TModel[]>;
|
|
38
|
+
SelectValue: (model: TModel) => any;
|
|
39
|
+
GenerateLabel: (model: TModel) => any;
|
|
40
|
+
Onchange?: (data: TModel | null) => void;
|
|
41
|
+
onBlur?: () => void;
|
|
42
|
+
title?: string;
|
|
43
|
+
defaultValue: any;
|
|
44
|
+
onReady?: (option?: TModel) => void;
|
|
45
|
+
isOptionEqualToValue?: (option: TModel, value: TModel) => boolean;
|
|
46
|
+
searchInitial?: (model: TModel) => boolean;
|
|
47
|
+
selectedItem: TModel;
|
|
48
|
+
name?: string;
|
|
49
|
+
PopperStyle?: React.CSSProperties;
|
|
50
|
+
disabled?: boolean;
|
|
51
|
+
size?: 'small' | 'medium';
|
|
52
|
+
fullWidth?: boolean;
|
|
53
|
+
}
|
|
54
|
+
export type TypeSelect2<TModel> = React.ComponentType<Select2Props<TModel>>;
|
|
55
|
+
export declare const CreateSelect2: <TModel>() => React.FC<Select2Props<TModel>>;
|
|
56
|
+
export interface MultipleSelect<TModel> extends SubLocal.ErrorProps {
|
|
57
|
+
fetchData: (value?: string, CancelToken?: AbortSignal) => Promise<TModel[]>;
|
|
58
|
+
SelectValue: (model: TModel) => any;
|
|
59
|
+
GenerateLabel: (model: TModel) => any;
|
|
60
|
+
Onchange?: (data: TModel[]) => void;
|
|
61
|
+
onBlur?: () => void;
|
|
62
|
+
title?: string;
|
|
63
|
+
defaultValue: any[];
|
|
64
|
+
onReady?: (option?: TModel[]) => void;
|
|
65
|
+
isOptionEqualToValue?: (option: TModel, value: TModel) => boolean;
|
|
66
|
+
searchInitial?: (model: TModel) => boolean;
|
|
67
|
+
selectedItem: TModel[];
|
|
68
|
+
name?: string;
|
|
69
|
+
PopperStyle?: React.CSSProperties;
|
|
70
|
+
limitTags?: number;
|
|
71
|
+
}
|
|
72
|
+
export type TypeMultipleSelect<TModel> = React.ComponentType<MultipleSelect<TModel>>;
|
|
73
|
+
export declare const CreateMultipleSelect: <TModel>() => React.FC<MultipleSelect<TModel>>;
|
|
74
|
+
export interface MultipleTags extends SubLocal.ErrorProps {
|
|
75
|
+
Onchange?: (data: any[]) => void;
|
|
76
|
+
onBlur?: () => void;
|
|
77
|
+
title?: string;
|
|
78
|
+
defaultValue?: any[];
|
|
79
|
+
data?: string[];
|
|
80
|
+
name?: string;
|
|
81
|
+
PopperStyle?: React.CSSProperties;
|
|
82
|
+
}
|
|
83
|
+
export type TypeMultipleTags = React.ComponentType<MultipleTags>;
|
|
84
|
+
interface ChipProps {
|
|
85
|
+
data?: string[];
|
|
86
|
+
}
|
|
87
|
+
export declare const Chips: FC<ChipProps>;
|
|
88
|
+
export declare const CreateMultipleTags: () => React.FC<MultipleTags>;
|
|
89
|
+
interface DatePickersProps extends SubLocal.ErrorProps {
|
|
90
|
+
name?: string;
|
|
91
|
+
Title?: string;
|
|
92
|
+
inputFormat?: string;
|
|
93
|
+
defaultValue?: Date;
|
|
94
|
+
Onchange?: (data: Date | null) => void;
|
|
95
|
+
onBlur?: () => void;
|
|
96
|
+
disable?: boolean;
|
|
97
|
+
}
|
|
98
|
+
export declare const DatePickers: FC<DatePickersProps>;
|
|
99
|
+
interface LazyViewProps {
|
|
100
|
+
sx?: SxProps<Theme>;
|
|
101
|
+
IsLazy?: boolean;
|
|
102
|
+
showProgress?: boolean;
|
|
103
|
+
}
|
|
104
|
+
export declare const LazyView: FC<LazyViewProps>;
|
|
105
|
+
interface OverlayViewProps {
|
|
106
|
+
open?: boolean;
|
|
107
|
+
}
|
|
108
|
+
export declare const OverlayView: FC<OverlayViewProps>;
|
|
109
|
+
interface IInputSearchProps {
|
|
110
|
+
onSearch?: (text: string, signal: AbortController) => void;
|
|
111
|
+
placeholder?: string;
|
|
112
|
+
onStart?: () => void;
|
|
113
|
+
onEnd?: () => void;
|
|
114
|
+
PaperSx?: SxProps<Theme>;
|
|
115
|
+
}
|
|
116
|
+
export declare const InputSearch: FC<IInputSearchProps>;
|
|
117
|
+
interface PageRouteProps {
|
|
118
|
+
title?: string;
|
|
119
|
+
prefix?: string;
|
|
120
|
+
}
|
|
121
|
+
export declare const PageRoute: FC<PageRouteProps>;
|
|
122
|
+
interface OptionPage {
|
|
123
|
+
title?: string;
|
|
124
|
+
prefix?: string;
|
|
125
|
+
}
|
|
126
|
+
export declare const WrapPageRoute: (WrapComponent: ComponentType<any>, option?: OptionPage) => (props: any) => JSX.Element;
|
|
127
|
+
interface PageContentProps {
|
|
128
|
+
PanelAction: JSX.Element;
|
|
129
|
+
Title: string;
|
|
130
|
+
}
|
|
131
|
+
export declare const PageContent: FC<PageContentProps>;
|
|
132
|
+
export interface IOptionSelect {
|
|
133
|
+
name: string;
|
|
134
|
+
value: any;
|
|
135
|
+
}
|
|
136
|
+
interface SmallSelectProps {
|
|
137
|
+
id: string;
|
|
138
|
+
title: string;
|
|
139
|
+
data: IOptionSelect[] | (() => Promise<IOptionSelect[]>);
|
|
140
|
+
sx?: SxProps;
|
|
141
|
+
defaultValue?: any;
|
|
142
|
+
onChange?: (value: any) => void;
|
|
143
|
+
value?: any;
|
|
144
|
+
disabled?: boolean;
|
|
145
|
+
}
|
|
146
|
+
export declare const SmallSelect: FC<SmallSelectProps>;
|
|
147
|
+
interface ICenterBoxProps {
|
|
148
|
+
sx?: SxProps;
|
|
149
|
+
}
|
|
150
|
+
export declare const CenterBox: FC<ICenterBoxProps>;
|
|
151
|
+
export {};
|