awing-library 2.1.21-beta → 2.1.21
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/lib/ACM-AXN/Campaign/Container.js +1 -1
- package/lib/ACM-AXN/Campaign/CreateOrEdit/Recoils.js +1 -1
- package/lib/ACM-AXN/Campaign/CreateOrEdit/TabInfomation.js +3 -9
- package/lib/ACM-AXN/Campaign/CreateOrEdit/TabSubCampaign/AdList.js +4 -4
- package/lib/ACM-AXN/Campaign/CreateOrEdit/TabSubCampaign/AddOrEditRule/RuleForm/RetargetMacAddress/component.js +2 -1
- package/lib/ACM-AXN/Campaign/CreateOrEdit/index.js +6 -0
- package/lib/ACM-AXN/Campaign/Types.d.ts +8 -0
- package/lib/ACM-AXN/Campaign/Utils.js +1 -1
- package/lib/ACM-AXN/Campaign/index.js +2 -1
- package/lib/ACM-AXN/CampaignSchedule/Components/ControlPanel/Filter.d.ts +2 -2
- package/lib/ACM-AXN/CampaignSchedule/Components/ControlPanel/Filter.js +44 -42
- package/lib/ACM-AXN/CampaignSchedule/Components/ControlPanel/GroupPanel.d.ts +1 -1
- package/lib/ACM-AXN/CampaignSchedule/Components/ControlPanel/GroupPanel.js +38 -30
- package/lib/ACM-AXN/CampaignSchedule/Components/ControlPanel/index.d.ts +2 -2
- package/lib/ACM-AXN/CampaignSchedule/Components/ControlPanel/index.js +2 -2
- package/lib/ACM-AXN/CampaignSchedule/Components/EnhancedPagination/index.d.ts +1 -1
- package/lib/ACM-AXN/CampaignSchedule/Components/EnhancedPagination/index.js +4 -2
- package/lib/ACM-AXN/CampaignSchedule/Components/RowAdvance/component.js +69 -5
- package/lib/ACM-AXN/CampaignSchedule/Components/RowAdvance/container.d.ts +1 -1
- package/lib/ACM-AXN/CampaignSchedule/Components/RowAdvance/container.js +85 -36
- package/lib/ACM-AXN/CampaignSchedule/Components/TableHeaderDragable.d.ts +1 -1
- package/lib/ACM-AXN/CampaignSchedule/Components/TableHeaderDragable.js +38 -29
- package/lib/ACM-AXN/CampaignSchedule/DataConfigAXN.d.ts +4 -0
- package/lib/ACM-AXN/CampaignSchedule/DataConfigAXN.js +58 -0
- package/lib/ACM-AXN/CampaignSchedule/Enum.d.ts +14 -2
- package/lib/ACM-AXN/CampaignSchedule/Enum.js +12 -0
- package/lib/ACM-AXN/CampaignSchedule/component.d.ts +2 -2
- package/lib/ACM-AXN/CampaignSchedule/component.js +44 -15
- package/lib/ACM-AXN/CampaignSchedule/container.d.ts +1 -1
- package/lib/ACM-AXN/CampaignSchedule/container.js +100 -99
- package/lib/ACM-AXN/CampaignSchedule/interface.d.ts +19 -3
- package/lib/ACM-AXN/Directory/DomainDirectory/DomainDirectory.test.js +1 -0
- package/lib/ACM-AXN/Directory/DomainDirectory/FolderDetail.test.js +1 -0
- package/lib/ACM-AXN/Directory/MenuDirectory/MenuDirectory.test.js +1 -0
- package/lib/ACM-AXN/Directory/MenuDirectory/index.js +7 -21
- package/lib/ACM-AXN/Directory/SystemDirectory/SystemDirectory.test.js +1 -0
- package/lib/ACM-AXN/Directory/SystemDirectory/index.js +6 -5
- package/lib/ACM-AXN/Directory/components/CreateOrEditFolder.test.js +1 -0
- package/lib/ACM-AXN/Directory/components/Permission/AddAuthen.test.js +2 -0
- package/lib/ACM-AXN/Directory/components/Permission/CreateOrEditPermission.test.js +2 -0
- package/lib/ACM-AXN/Directory/components/Permission/Management.js +7 -5
- package/lib/ACM-AXN/Directory/components/Permission/ManagementPermission.test.js +3 -0
- package/lib/ACM-AXN/Directory/components/Permission/MenuPermissions/MenuPermissionManagement.js +9 -7
- package/lib/ACM-AXN/Directory/components/Permission/MenuPermissions/MenuPermissionManagement.test.js +2 -0
- package/lib/ACM-AXN/Directory/function.d.ts +1 -0
- package/lib/ACM-AXN/Directory/function.js +15 -1
- package/lib/ACM-AXN/DomainPreview/PreviewButton.js +57 -34
- package/lib/ACM-AXN/GroupUser/Container.js +1 -1
- package/lib/ACM-AXN/GroupUser/CreateOrEdit.js +25 -10
- package/lib/ACM-AXN/GroupUser/User/UserComponent.d.ts +2 -1
- package/lib/ACM-AXN/GroupUser/User/UserComponent.js +10 -4
- package/lib/ACM-AXN/Notifications/Constant.d.ts +146 -0
- package/lib/ACM-AXN/Notifications/Constant.js +136 -0
- package/lib/ACM-AXN/Notifications/Context.d.ts +8 -0
- package/lib/ACM-AXN/Notifications/Context.js +10 -0
- package/lib/ACM-AXN/Notifications/Hooks.d.ts +7 -0
- package/lib/ACM-AXN/Notifications/Hooks.js +17 -0
- package/lib/ACM-AXN/Notifications/NotificationDetail/HeaderInfo/ButtonTabs.d.ts +3 -3
- package/lib/ACM-AXN/Notifications/NotificationDetail/HeaderInfo/ButtonTabs.js +31 -30
- package/lib/ACM-AXN/Notifications/NotificationDetail/HeaderInfo/MenuNotification.d.ts +1 -1
- package/lib/ACM-AXN/Notifications/NotificationDetail/HeaderInfo/MenuNotification.js +30 -39
- package/lib/ACM-AXN/Notifications/NotificationDetail/HeaderInfo/index.d.ts +3 -5
- package/lib/ACM-AXN/Notifications/NotificationDetail/HeaderInfo/index.js +18 -17
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationEmpty.d.ts +1 -1
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationEmpty.js +15 -15
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationEmpty.test.d.ts +0 -6
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationEmpty.test.js +29 -28
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/Message.d.ts +11 -0
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/Message.js +291 -0
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/NotificationAvatar.d.ts +1 -1
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/NotificationAvatar.js +3 -3
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/NotificationAvatar.test.d.ts +0 -6
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/NotificationAvatar.test.js +38 -48
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/NotificationContent.d.ts +2 -2
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/NotificationContent.js +38 -35
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/NotificationContent.test.d.ts +0 -6
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/NotificationContent.test.js +65 -73
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/index.d.ts +4 -11
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/index.js +48 -36
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/index.test.d.ts +0 -6
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/index.test.js +56 -50
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationLoading.js +30 -30
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/index.d.ts +3 -15
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/index.js +35 -4
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/index.test.d.ts +0 -6
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/index.test.js +88 -83
- package/lib/ACM-AXN/Notifications/NotificationDetail/index.d.ts +5 -2
- package/lib/ACM-AXN/Notifications/NotificationDetail/index.js +115 -101
- package/lib/ACM-AXN/Notifications/{NotificationPopover.d.ts → NotificationPopover/Container.d.ts} +2 -2
- package/lib/ACM-AXN/Notifications/NotificationPopover/Container.js +149 -0
- package/lib/ACM-AXN/Notifications/{NotificationPopover.test.d.ts → NotificationPopover/Container.test.d.ts} +1 -1
- package/lib/ACM-AXN/Notifications/{NotificationPopover.test.js → NotificationPopover/Container.test.js} +5 -5
- package/lib/ACM-AXN/Notifications/NotificationPopover/index.d.ts +8 -0
- package/lib/ACM-AXN/Notifications/NotificationPopover/index.js +13 -0
- package/lib/ACM-AXN/Notifications/NotificationScreen.d.ts +1 -1
- package/lib/ACM-AXN/Notifications/NotificationScreen.js +4 -4
- package/lib/ACM-AXN/Notifications/Types.d.ts +84 -0
- package/lib/ACM-AXN/Notifications/Types.js +13 -0
- package/lib/ACM-AXN/Notifications/index.d.ts +2 -2
- package/lib/ACM-AXN/Notifications/index.js +5 -5
- package/lib/ACM-AXN/Page/Container.js +5 -4
- package/lib/ACM-AXN/Page/CreateOrEdit/Components/useListPageView.js +9 -4
- package/lib/ACM-AXN/Page/CreateOrEdit/DrawerAction.js +6 -1
- package/lib/ACM-AXN/Page/CreateOrEdit/Recoil.d.ts +2 -1
- package/lib/ACM-AXN/Page/CreateOrEdit/Recoil.js +14 -1
- package/lib/ACM-AXN/Page/CreateOrEdit/TabFile/FileUtils.d.ts +3 -1
- package/lib/ACM-AXN/Page/CreateOrEdit/TabFile/FileUtils.js +1 -6
- package/lib/ACM-AXN/Page/CreateOrEdit/TabFile/index.d.ts +7 -0
- package/lib/ACM-AXN/Page/CreateOrEdit/TabFile/index.js +13 -15
- package/lib/ACM-AXN/Page/CreateOrEdit/Tabview/ViewContent.js +24 -2
- package/lib/ACM-AXN/Page/CreateOrEdit/Tabview/ViewInfo.d.ts +3 -2
- package/lib/ACM-AXN/Page/CreateOrEdit/Tabview/ViewInfo.js +1 -0
- package/lib/ACM-AXN/Page/CreateOrEdit/Tabview/index.js +2 -1
- package/lib/ACM-AXN/Page/CreateOrEdit/Tabview/index.test.js +2 -1
- package/lib/ACM-AXN/Page/CreateOrEdit/Utils.d.ts +4 -4
- package/lib/ACM-AXN/Page/CreateOrEdit/Utils.js +19 -8
- package/lib/ACM-AXN/Page/Types.d.ts +11 -37
- package/lib/ACM-AXN/Page/enums.d.ts +6 -0
- package/lib/ACM-AXN/Page/enums.js +8 -1
- package/lib/ACM-AXN/Page/index.js +2 -1
- package/lib/ACM-AXN/PlaceFilter/DataTable/container.js +1 -2
- package/lib/ACM-AXN/PlaceFilter/Input/container.js +12 -2
- package/lib/ACM-AXN/PlaceFilter/common.d.ts +1 -0
- package/lib/ACM-AXN/PlaceFilter/common.js +27 -1
- package/lib/ACM-AXN/PlaceGroup/Container.js +1 -1
- package/lib/ACM-AXN/PlaceGroup/ContentCreateOrEdit.d.ts +0 -7
- package/lib/ACM-AXN/PlaceGroup/ContentCreateOrEdit.js +0 -135
- package/lib/ACM-AXN/PlaceGroup/ContentCreateOrEdit.test.js +2 -2
- package/lib/ACM-AXN/PlaceGroup/Context.d.ts +1 -1
- package/lib/ACM-AXN/PlaceGroup/CreateOrEdit.js +103 -3
- package/lib/ACM-AXN/Statistics/ControlPanel.js +27 -39
- package/lib/ACM-AXN/Statistics/interface.d.ts +2 -2
- package/lib/ACM-AXN/StatisticsAudienceDemographic/container.d.ts +1 -1
- package/lib/ACM-AXN/StatisticsAudienceDemographic/container.js +2 -3
- package/lib/ACM-AXN/StatisticsAudienceDemographic/interfaces.d.ts +1 -0
- package/lib/ACM-AXN/StatisticsByProvince/container.d.ts +1 -1
- package/lib/ACM-AXN/StatisticsByProvince/container.js +2 -2
- package/lib/ACM-AXN/TaskScheduler/Components/TriggerInput.js +4 -2
- package/lib/ACM-AXN/TaskScheduler/Constant.d.ts +0 -107
- package/lib/ACM-AXN/TaskScheduler/Constant.js +1 -105
- package/lib/ACM-AXN/TaskScheduler/Container.js +1 -1
- package/lib/ACM-AXN/TaskScheduler/CreateOrEdit.js +6 -8
- package/lib/ACM-AXN/TaskScheduler/Utils.js +6 -1
- package/lib/ACM-AXN/Template/Constants.d.ts +0 -0
- package/lib/ACM-AXN/Template/Constants.js +1 -0
- package/lib/ACM-AXN/Template/Container.d.ts +2 -0
- package/lib/ACM-AXN/Template/Container.js +74 -0
- package/lib/ACM-AXN/Template/Container.test.d.ts +1 -0
- package/lib/ACM-AXN/Template/Container.test.js +259 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/CreateOrEdit.test.d.ts +1 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/CreateOrEdit.test.js +370 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Infomation.d.ts +9 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Infomation.js +78 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Infomation.test.d.ts +1 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Infomation.test.js +150 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Recoils.d.ts +6 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Recoils.js +79 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Script.d.ts +3 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Script.js +58 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Script.test.d.ts +1 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Script.test.js +162 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Template/Events.d.ts +5 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Template/Events.js +41 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Template/Parameter.d.ts +20 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Template/Parameter.js +283 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Template/Parameter.test.d.ts +1 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Template/Parameter.test.js +220 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Template/Utils.d.ts +25 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Template/Utils.js +138 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Template/index.d.ts +3 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/Template/index.js +46 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/index.d.ts +3 -0
- package/lib/ACM-AXN/Template/CreateOrEdit/index.js +215 -0
- package/lib/ACM-AXN/Template/Hooks.d.ts +5 -0
- package/lib/ACM-AXN/Template/Hooks.js +13 -0
- package/lib/ACM-AXN/Template/Import.d.ts +2 -0
- package/lib/ACM-AXN/Template/Import.js +123 -0
- package/lib/ACM-AXN/Template/Import.test.d.ts +1 -0
- package/lib/ACM-AXN/Template/Import.test.js +188 -0
- package/lib/ACM-AXN/Template/Types.d.ts +84 -0
- package/lib/ACM-AXN/Template/Types.js +2 -0
- package/lib/ACM-AXN/Template/UploadButton.d.ts +2 -0
- package/lib/ACM-AXN/Template/UploadButton.js +14 -0
- package/lib/ACM-AXN/Template/index.d.ts +5 -0
- package/lib/ACM-AXN/Template/index.js +44 -0
- package/lib/ACM-AXN/TransactionLog/Container.js +7 -5
- package/lib/ACM-AXN/TransactionLog/Detail.js +3 -1
- package/lib/ACM-AXN/TransactionLog/Types.d.ts +1 -107
- package/lib/ACM-AXN/TransactionLog/Types.js +1 -109
- package/lib/ACM-AXN/TransactionLog/Utils.d.ts +0 -103
- package/lib/ACM-AXN/TransactionLog/Utils.js +1 -104
- package/lib/ACM-AXN/User/Container.js +1 -1
- package/lib/ACM-AXN/ViewTemplate/TemplateField/Fields/BasicField/index.js +1 -1
- package/lib/ACM-AXN/ViewTemplate/TemplateField/Fields/ObjectField.d.ts +2 -0
- package/lib/ACM-AXN/ViewTemplate/TemplateField/Fields/ObjectField.js +19 -3
- package/lib/ACM-AXN/ViewTemplate/container.js +2 -1
- package/lib/ACM-AXN/ViewTemplate/index.d.ts +2 -1
- package/lib/ACM-AXN/ViewTemplate/interface.d.ts +6 -1
- package/lib/AWING/AdvancedSearch/component.js +1 -1
- package/lib/AWING/AdvancedSearch/interface.d.ts +1 -0
- package/lib/AWING/BasicDataForm/index.js +3 -1
- package/lib/AWING/BasicDataForm/interface.d.ts +2 -2
- package/lib/AWING/ButtonDateRangePicker/ButtonDateRangePicker.js +2 -2
- package/lib/AWING/ButtonDateRangePicker/interface.d.ts +1 -0
- package/lib/AWING/ButtonSelect/index.js +2 -2
- package/lib/AWING/Chart/BarLineComponent.d.ts +8 -5
- package/lib/AWING/Chart/BarLineComponent.js +34 -28
- package/lib/AWING/Chart/PieComponent.d.ts +8 -7
- package/lib/AWING/Chart/PieComponent.js +1 -2
- package/lib/AWING/Chart/Styles.d.ts +6 -2
- package/lib/AWING/Chart/Styles.js +6 -2
- package/lib/AWING/Chart/index.d.ts +3 -0
- package/lib/AWING/Chart/index.js +10 -0
- package/lib/AWING/DataForm/DataInput.js +19 -10
- package/lib/AWING/DataForm/interface.d.ts +8 -4
- package/lib/AWING/DataGrid/index.js +17 -5
- package/lib/AWING/DataGrid/interface.d.ts +1 -1
- package/lib/AWING/DateRangePicker/component.js +101 -132
- package/lib/AWING/DateRangePicker/configDate.d.ts +8 -0
- package/lib/AWING/DateRangePicker/configDate.js +71 -0
- package/lib/AWING/DateRangePicker/interface.d.ts +1 -0
- package/lib/AWING/Directory/CreateDirectory.d.ts +3 -0
- package/lib/AWING/Directory/CreateDirectory.js +27 -10
- package/lib/AWING/HOC/Wrapper.d.ts +6 -0
- package/lib/AWING/HOC/Wrapper.js +10 -0
- package/lib/AWING/LogicExpression/script.js +0 -1
- package/lib/AWING/PageManagement/PageManagement.js +1 -1
- package/lib/AWING/index.d.ts +1 -0
- package/lib/AWING/index.js +1 -0
- package/lib/AWING/ultis/validation.d.ts +1 -1
- package/lib/AWING/ultis/validation.js +4 -2
- package/lib/Commons/Components/ClassicBaseDrawer.d.ts +1 -0
- package/lib/Commons/Components/ClassicBaseDrawer.js +7 -3
- package/lib/Commons/Components/ClassicDrawer.js +1 -1
- package/lib/Context/index.js +1 -0
- package/lib/Context/interface.d.ts +1 -0
- package/lib/Utils/Helpers.d.ts +1 -0
- package/lib/Utils/Helpers.js +17 -9
- package/lib/translate/en/translation.json +102 -3
- package/lib/translate/vi/translation.json +102 -3
- package/package.json +3 -1
- package/lib/ACM-AXN/Notifications/NotificationDetail/Common.d.ts +0 -39
- package/lib/ACM-AXN/Notifications/NotificationDetail/Common.js +0 -304
- package/lib/ACM-AXN/Notifications/NotificationPopover.js +0 -69
- package/lib/ACM-AXN/Page/CreateOrEdit/TabFile/index.test.d.ts +0 -1
- package/lib/ACM-AXN/Page/CreateOrEdit/TabFile/index.test.js +0 -326
- package/lib/ACM-AXN/Page/ViewDomain/index.d.ts +0 -9
- package/lib/ACM-AXN/Page/ViewDomain/index.js +0 -148
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { BaseTextFieldProps } from '@mui/material/TextField';
|
|
3
|
-
import { DataObject, MenuOption } from '../../AWING';
|
|
3
|
+
import { DataObject, IMultipleHierarchicalChoiceProps, MenuOption } from '../../AWING';
|
|
4
4
|
import { IMainObj, IListFunctions } from '../../AWING/LogicExpression/interface';
|
|
5
5
|
import { GeoFencingValue, IConfig } from '../../ACM-AXN/GeoFencing/interface';
|
|
6
6
|
import { Moment } from 'moment';
|
|
@@ -44,6 +44,7 @@ export type AutocompleteFieldDefinition<T extends DataObject> = BaseFieldDefinit
|
|
|
44
44
|
type: 'autocomplete';
|
|
45
45
|
options: Array<MenuOption>;
|
|
46
46
|
loading?: boolean;
|
|
47
|
+
disableClearable?: boolean;
|
|
47
48
|
};
|
|
48
49
|
export interface CheckBoxFieldDefinition<T extends DataObject> extends BaseFieldDefinition<T> {
|
|
49
50
|
type: 'checkbox';
|
|
@@ -86,14 +87,14 @@ export interface TextFieldDefinition<T extends DataObject> extends BaseFieldDefi
|
|
|
86
87
|
/**
|
|
87
88
|
* Định dạng regex cho hàm textValid
|
|
88
89
|
*/
|
|
89
|
-
pattern?: RegExp;
|
|
90
|
+
pattern?: RegExp | false;
|
|
90
91
|
/**
|
|
91
92
|
*
|
|
92
93
|
* @param value
|
|
93
94
|
* @param length - Độ dài byte, only type text và text-area
|
|
94
95
|
* @param pattern - Định dạng regex, only type text và text-area
|
|
95
96
|
*/
|
|
96
|
-
onValidate?(value?: string, length?: number, pattern?: RegExp): boolean;
|
|
97
|
+
onValidate?(value?: string, length?: number, pattern?: RegExp | false): boolean;
|
|
97
98
|
defaultValue?: string;
|
|
98
99
|
autoFormula?: string;
|
|
99
100
|
}
|
|
@@ -122,5 +123,8 @@ export type SelectFieldDefinition<T extends DataObject> = BaseFieldDefinition<T>
|
|
|
122
123
|
row?: Partial<T>;
|
|
123
124
|
onDisabledSelectItem?: (value: any, row?: Partial<T>) => boolean;
|
|
124
125
|
};
|
|
125
|
-
export type
|
|
126
|
+
export type MultipleHierarchicalDefinition<T extends DataObject> = BaseFieldDefinition<T> & Omit<IMultipleHierarchicalChoiceProps, 'defaultValue' | 'onChange'> & {
|
|
127
|
+
type: 'multiple-hierarchical';
|
|
128
|
+
};
|
|
129
|
+
export type FieldDefinition<T extends DataObject> = AsyncAutocompleteFieldDefinition<T> | AutocompleteFieldDefinition<T> | LogicExpressionDefinition<T> | CheckBoxFieldDefinition<T> | DateTimeFieldDefinition<T> | DateRangeFieldDefinition<T> | NumberFieldDefinition<T> | RadioFieldDefinition<T> | SelectFieldDefinition<T> | TextFieldDefinition<T> | GeoFencingDefinition<T> | MultipleHierarchicalDefinition<T>;
|
|
126
130
|
export {};
|
|
@@ -30,13 +30,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
30
30
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
31
|
exports.DataGrid = void 0;
|
|
32
32
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
33
|
+
var react_1 = __importDefault(require("react"));
|
|
33
34
|
var styles_1 = require("@mui/material/styles");
|
|
34
35
|
var material_1 = require("@mui/material");
|
|
35
36
|
var Pagination_1 = __importDefault(require("../Pagination"));
|
|
36
37
|
var NoData_1 = __importDefault(require("../NoData"));
|
|
37
38
|
var constants_1 = require("../constants");
|
|
38
|
-
var
|
|
39
|
+
var Helpers_1 = require("../../Utils/Helpers");
|
|
39
40
|
var get_1 = __importDefault(require("../Form/Utils/get"));
|
|
41
|
+
var i18n_1 = __importDefault(require("../../i18n"));
|
|
40
42
|
var StyledTableRow = (0, styles_1.styled)(material_1.TableRow)({
|
|
41
43
|
'& .MuiTableCell-root:last-child .MuiButtonBase-root': {
|
|
42
44
|
visibility: 'hidden',
|
|
@@ -72,6 +74,11 @@ var SpanSortIndex = (0, styles_1.styled)('span')({
|
|
|
72
74
|
});
|
|
73
75
|
var DataGrid = function (props) {
|
|
74
76
|
var columns = props.columns, rows = props.rows, _a = props.hideHeader, hideHeader = _a === void 0 ? false : _a, spanningRows = props.spanningRows, _b = props.spanningRowsPosition, spanningRowsPosition = _b === void 0 ? 'bottom' : _b, getRowId = props.getRowId, onRowClick = props.onRowClick, rowActions = props.rowActions, sortModel = props.sortModel, onSortModelChange = props.onSortModelChange, selected = props.selected, onSelectedChange = props.onSelectedChange, selectionActions = props.selectionActions, _c = props.pageIndex, pageIndex = _c === void 0 ? constants_1.PAGE_INDEX_DEFAULT : _c, _d = props.pageSize, pageSize = _d === void 0 ? constants_1.PAGE_SIZE_DEFAULT : _d, _e = props.totalOfRows, totalOfRows = _e === void 0 ? rows.length : _e, _f = props.rowsPerPageOptions, rowsPerPageOptions = _f === void 0 ? [10, 20, 30] : _f, onPageIndexChange = props.onPageIndexChange, onPageSizeChange = props.onPageSizeChange;
|
|
77
|
+
react_1.default.useEffect(function () {
|
|
78
|
+
var language = localStorage.getItem('i18nextLng');
|
|
79
|
+
i18n_1.default.changeLanguage(language || 'vi');
|
|
80
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
81
|
+
}, [localStorage.getItem('i18nextLng')]);
|
|
75
82
|
var createSortHandler = function (fieldName) { return function (event) {
|
|
76
83
|
var _a, _b, _c;
|
|
77
84
|
if (onSortModelChange) {
|
|
@@ -168,7 +175,7 @@ var DataGrid = function (props) {
|
|
|
168
175
|
}
|
|
169
176
|
};
|
|
170
177
|
var calcOrder = function (index) { return pageIndex * pageSize + 1 + index; };
|
|
171
|
-
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.TableContainer, { component: material_1.Paper, children: [(0, jsx_runtime_1.jsxs)(material_1.Table, { "aria-label": "simple table", style: { tableLayout: 'fixed' }, children: [!hideHeader && ((0, jsx_runtime_1.jsx)(material_1.TableHead, { children: (0, jsx_runtime_1.jsxs)(material_1.TableRow, { children: [selected && onSelectedChange && ((0, jsx_runtime_1.jsx)(material_1.TableCell, { padding: "checkbox", children: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { color: "primary", indeterminate: selected.length > 0 &&
|
|
178
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.TableContainer, { component: material_1.Paper, children: [(0, jsx_runtime_1.jsxs)(material_1.Table, { "aria-label": "simple table", style: { tableLayout: 'fixed' }, children: [!hideHeader && ((0, jsx_runtime_1.jsx)(material_1.TableHead, { children: (0, jsx_runtime_1.jsxs)(material_1.TableRow, { children: [selected && onSelectedChange && ((0, jsx_runtime_1.jsx)(material_1.TableCell, { padding: "checkbox", children: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { color: "primary", indeterminate: selected.length > 0 &&
|
|
172
179
|
selected.length < rows.length, checked: selected.length > 0 &&
|
|
173
180
|
selected.length === rows.length, onChange: function () { return handleSelectAll(); }, inputProps: {
|
|
174
181
|
'aria-label': 'select all desserts',
|
|
@@ -232,7 +239,7 @@ var DataGrid = function (props) {
|
|
|
232
239
|
var displayValue = col.valueGetter
|
|
233
240
|
? col.valueGetter(row, idx, calcOrder(idx))
|
|
234
241
|
: col.type === 'number'
|
|
235
|
-
? (0,
|
|
242
|
+
? (0, Helpers_1.formatNumber)(row[col.field])
|
|
236
243
|
: (0, get_1.default)(row, col.field);
|
|
237
244
|
var dynamicStyle = col.dynamicTableCellProps
|
|
238
245
|
? col.dynamicTableCellProps(row)
|
|
@@ -256,7 +263,12 @@ var DataGrid = function (props) {
|
|
|
256
263
|
: 1,
|
|
257
264
|
}, sx: __assign(__assign({}, actionDef.sx), { borderRadius: '15%' }), children: typeof actionDef.icon ===
|
|
258
265
|
'function'
|
|
259
|
-
? actionDef.icon({
|
|
266
|
+
? actionDef.icon({
|
|
267
|
+
id: id,
|
|
268
|
+
row: row,
|
|
269
|
+
idx: idx,
|
|
270
|
+
order: calcOrder(idx),
|
|
271
|
+
})
|
|
260
272
|
: actionDef.icon }) }, "".concat(id, "-").concat(actIdx)));
|
|
261
273
|
}) }))] }), id));
|
|
262
274
|
}), spanningRowsPosition == 'bottom' && spanningRows] })] }), !rows.length && (0, jsx_runtime_1.jsx)(NoData_1.default, {})] }), onPageIndexChange && onPageSizeChange && ((0, jsx_runtime_1.jsx)(Pagination_1.default, { rowsPerPageOptions: rowsPerPageOptions, colSpan: 3, count: totalOfRows, rowsPerPage: pageSize, page: pageIndex, SelectProps: {
|
|
@@ -264,7 +276,7 @@ var DataGrid = function (props) {
|
|
|
264
276
|
native: true,
|
|
265
277
|
}, onPageChange: function (e, page) { return onPageIndexChange(page); }, onRowsPerPageChange: function (e) {
|
|
266
278
|
return onPageSizeChange(parseInt(e.target.value, 10));
|
|
267
|
-
} }))] });
|
|
279
|
+
} }))] }));
|
|
268
280
|
};
|
|
269
281
|
exports.DataGrid = DataGrid;
|
|
270
282
|
exports.default = exports.DataGrid;
|
|
@@ -49,62 +49,63 @@ var material_1 = require("@mui/material");
|
|
|
49
49
|
var icons_material_1 = require("@mui/icons-material");
|
|
50
50
|
var react_input_mask_1 = __importDefault(require("react-input-mask"));
|
|
51
51
|
var styles_1 = require("@mui/styles");
|
|
52
|
-
var
|
|
53
|
-
require(
|
|
54
|
-
|
|
52
|
+
var configDate_1 = __importDefault(require("./configDate"));
|
|
53
|
+
var moment = require('moment');
|
|
54
|
+
require('moment/locale/vi');
|
|
55
|
+
var omit = require('lodash/omit');
|
|
55
56
|
var useStyles = (0, styles_1.makeStyles)({
|
|
56
57
|
CustomDateRangePicker_panel: {
|
|
57
58
|
// width: 250px;
|
|
58
|
-
display:
|
|
59
|
-
boxSizing:
|
|
60
|
-
flexDirection:
|
|
61
|
-
padding:
|
|
62
|
-
marginTop:
|
|
59
|
+
display: 'flex',
|
|
60
|
+
boxSizing: 'border-box',
|
|
61
|
+
flexDirection: 'column',
|
|
62
|
+
padding: '0 8px 11px 22px',
|
|
63
|
+
marginTop: '18px',
|
|
63
64
|
},
|
|
64
65
|
CustomDateRangePicker_button: {
|
|
65
|
-
border:
|
|
66
|
-
cursor:
|
|
67
|
-
userSelect:
|
|
68
|
-
backgroundColor:
|
|
69
|
-
color:
|
|
70
|
-
borderWidth:
|
|
71
|
-
borderStyle:
|
|
72
|
-
borderColor:
|
|
73
|
-
borderImage:
|
|
74
|
-
borderRadius:
|
|
75
|
-
padding:
|
|
76
|
-
marginBottom:
|
|
77
|
-
|
|
78
|
-
outline:
|
|
79
|
-
borderColor:
|
|
66
|
+
border: '1px solid',
|
|
67
|
+
cursor: 'pointer',
|
|
68
|
+
userSelect: 'none',
|
|
69
|
+
backgroundColor: 'rgb(255, 255, 255)',
|
|
70
|
+
color: 'rgb(117, 117, 117)',
|
|
71
|
+
borderWidth: '1px',
|
|
72
|
+
borderStyle: 'solid',
|
|
73
|
+
borderColor: 'rgb(228, 231, 231)',
|
|
74
|
+
borderImage: 'initial',
|
|
75
|
+
borderRadius: '3px',
|
|
76
|
+
padding: '6px',
|
|
77
|
+
marginBottom: '13px',
|
|
78
|
+
'&:active': {
|
|
79
|
+
outline: 'none',
|
|
80
|
+
borderColor: '#ed1d25',
|
|
80
81
|
},
|
|
81
|
-
|
|
82
|
-
outline:
|
|
82
|
+
'&:focus': {
|
|
83
|
+
outline: '0',
|
|
83
84
|
},
|
|
84
85
|
},
|
|
85
86
|
CustomDateRangePicker_button__selected: {
|
|
86
|
-
color:
|
|
87
|
-
background:
|
|
87
|
+
color: 'rgb(255, 255, 255)',
|
|
88
|
+
background: '#ed1d25',
|
|
88
89
|
},
|
|
89
90
|
CustomPickerSelected: {
|
|
90
|
-
|
|
91
|
-
background:
|
|
92
|
-
border:
|
|
93
|
-
color:
|
|
91
|
+
'& .CalendarDay__selected_span': {
|
|
92
|
+
background: 'rgb(240, 74, 80) !important',
|
|
93
|
+
border: '1px double rgb(240, 74, 80) !important',
|
|
94
|
+
color: 'rgb(255, 255, 255) !important',
|
|
94
95
|
},
|
|
95
|
-
|
|
96
|
-
background:
|
|
97
|
-
border:
|
|
98
|
-
color:
|
|
96
|
+
'& .CalendarDay__selected': {
|
|
97
|
+
background: 'rgb(237, 29, 37) !important',
|
|
98
|
+
border: '1px double rgb(237, 29, 37) !important',
|
|
99
|
+
color: 'rgb(255, 255, 255)!important',
|
|
99
100
|
},
|
|
100
|
-
|
|
101
|
-
background:
|
|
102
|
-
color:
|
|
101
|
+
'& .CalendarDay__selected:hover': {
|
|
102
|
+
background: 'rgb(237, 29, 37) !important',
|
|
103
|
+
color: '#ffffff',
|
|
103
104
|
},
|
|
104
|
-
|
|
105
|
-
background:
|
|
106
|
-
border:
|
|
107
|
-
color:
|
|
105
|
+
'& .CalendarDay__hovered_span:hover,.CalendarDay__hovered_span': {
|
|
106
|
+
background: 'rgb(240, 74, 80) !important',
|
|
107
|
+
border: '1px double rgb(240, 74, 80) !important',
|
|
108
|
+
color: '#ffffff',
|
|
108
109
|
},
|
|
109
110
|
},
|
|
110
111
|
});
|
|
@@ -135,7 +136,7 @@ var defaultProps = {
|
|
|
135
136
|
isOutsideRange: function (day) { return false; },
|
|
136
137
|
isDayHighlighted: function () { return false; },
|
|
137
138
|
// internationalization
|
|
138
|
-
monthFormat:
|
|
139
|
+
monthFormat: 'MMMM YYYY',
|
|
139
140
|
label: null,
|
|
140
141
|
isShowCalendarInfo: false,
|
|
141
142
|
handleValid: function () { },
|
|
@@ -143,7 +144,7 @@ var defaultProps = {
|
|
|
143
144
|
};
|
|
144
145
|
var DateRangePickerWrapper = function (props) {
|
|
145
146
|
var classes = useStyles();
|
|
146
|
-
var value = props.value, error = props.error, helperText = props.helperText, _a = props.autoFocus, autoFocus = _a === void 0 ? false : _a, _b = props.autoFocusEndDate, autoFocusEndDate = _b === void 0 ? false : _b, _c = props.initialStartDate, initialStartDate = _c === void 0 ? null : _c, _d = props.initialEndDate, initialEndDate = _d === void 0 ? null : _d, _e = props.callback, callback = _e === void 0 ? function () { } : _e, _f = props.label, label = _f === void 0 ? null : _f, _g = props.isShowCalendarInfo, isShowCalendarInfo = _g === void 0 ? false : _g, variant = props.variant, openDirection = props.openDirection, _h = props.isDayBlocked, isDayBlocked = _h === void 0 ? function (day) { return false; } : _h, _j = props.handleValid, handleValid = _j === void 0 ? function () { } : _j, _k = props.handleDateRangePopover, handleDateRangePopover = _k === void 0 ? function () { } : _k, disableHelperText = props.disableHelperText;
|
|
147
|
+
var value = props.value, error = props.error, helperText = props.helperText, _a = props.autoFocus, autoFocus = _a === void 0 ? false : _a, _b = props.autoFocusEndDate, autoFocusEndDate = _b === void 0 ? false : _b, _c = props.initialStartDate, initialStartDate = _c === void 0 ? null : _c, _d = props.initialEndDate, initialEndDate = _d === void 0 ? null : _d, _e = props.callback, callback = _e === void 0 ? function () { } : _e, _f = props.label, label = _f === void 0 ? null : _f, _g = props.isShowCalendarInfo, isShowCalendarInfo = _g === void 0 ? false : _g, variant = props.variant, openDirection = props.openDirection, _h = props.isDayBlocked, isDayBlocked = _h === void 0 ? function (day) { return false; } : _h, _j = props.handleValid, handleValid = _j === void 0 ? function () { } : _j, _k = props.handleDateRangePopover, handleDateRangePopover = _k === void 0 ? function () { } : _k, disableHelperText = props.disableHelperText, _l = props.isFutureDate, isFutureDate = _l === void 0 ? false : _l;
|
|
147
148
|
var initialFocusedInput = null;
|
|
148
149
|
if (autoFocus) {
|
|
149
150
|
initialFocusedInput = constants_1.START_DATE;
|
|
@@ -151,20 +152,20 @@ var DateRangePickerWrapper = function (props) {
|
|
|
151
152
|
else if (autoFocusEndDate) {
|
|
152
153
|
initialFocusedInput = constants_1.END_DATE;
|
|
153
154
|
}
|
|
154
|
-
var
|
|
155
|
-
var
|
|
156
|
-
var
|
|
157
|
-
var
|
|
158
|
-
var
|
|
159
|
-
var
|
|
160
|
-
var momentLanguage = (0, react_1.useMemo)(function () { var _a, _b; return ((_b = (_a = i18n === null || i18n === void 0 ? void 0 : i18n.language) === null || _a === void 0 ? void 0 : _a.split(
|
|
155
|
+
var _m = (0, react_1.useState)(initialFocusedInput), focusedInput = _m[0], setFocusedInput = _m[1];
|
|
156
|
+
var _o = (0, react_1.useState)(initialStartDate), startDate = _o[0], setStartDate = _o[1];
|
|
157
|
+
var _p = (0, react_1.useState)(initialEndDate), endDate = _p[0], setEndDate = _p[1];
|
|
158
|
+
var _q = (0, react_1.useState)(true), isValid = _q[0], setIsValid = _q[1];
|
|
159
|
+
var _r = (0, react_1.useState)("".concat(moment(value ? value === null || value === void 0 ? void 0 : value.startDate : startDate).format('DD/MM/YYYY'), " - ").concat(moment(value ? value === null || value === void 0 ? void 0 : value.endDate : endDate).format('DD/MM/YYYY'))), inputValue = _r[0], setInputValue = _r[1];
|
|
160
|
+
var _s = (0, react_i18next_1.useTranslation)(), i18n = _s.i18n, t = _s.t;
|
|
161
|
+
var momentLanguage = (0, react_1.useMemo)(function () { var _a, _b; return ((_b = (_a = i18n === null || i18n === void 0 ? void 0 : i18n.language) === null || _a === void 0 ? void 0 : _a.split('-')) === null || _b === void 0 ? void 0 : _b[0]) || 'en'; }, [i18n.language]);
|
|
161
162
|
(0, react_1.useEffect)(function () {
|
|
162
163
|
if (value !== undefined) {
|
|
163
|
-
var inputUpdate = "".concat(moment(value ? value === null || value === void 0 ? void 0 : value.startDate : startDate).format(
|
|
164
|
+
var inputUpdate = "".concat(moment(value ? value === null || value === void 0 ? void 0 : value.startDate : startDate).format('DD/MM/YYYY'), " - ").concat(moment(value ? value === null || value === void 0 ? void 0 : value.endDate : endDate).format('DD/MM/YYYY'));
|
|
164
165
|
if (inputUpdate != inputValue) {
|
|
165
166
|
setInputValue(inputUpdate);
|
|
166
|
-
var momentStartDate = moment(value ? value === null || value === void 0 ? void 0 : value.startDate : startDate,
|
|
167
|
-
var momentEndDate = moment(value ? value === null || value === void 0 ? void 0 : value.endDate : endDate,
|
|
167
|
+
var momentStartDate = moment(value ? value === null || value === void 0 ? void 0 : value.startDate : startDate, 'DD/MM/YYYY', true);
|
|
168
|
+
var momentEndDate = moment(value ? value === null || value === void 0 ? void 0 : value.endDate : endDate, 'DD/MM/YYYY', true);
|
|
168
169
|
if (momentStartDate.isValid() &&
|
|
169
170
|
momentEndDate.isValid() &&
|
|
170
171
|
momentEndDate.diff(momentStartDate) >= 0) {
|
|
@@ -176,7 +177,7 @@ var DateRangePickerWrapper = function (props) {
|
|
|
176
177
|
}
|
|
177
178
|
}, [value]);
|
|
178
179
|
(0, react_1.useEffect)(function () {
|
|
179
|
-
if (momentLanguage !==
|
|
180
|
+
if (momentLanguage !== 'en') {
|
|
180
181
|
try {
|
|
181
182
|
Promise.resolve("".concat("moment/locale/".concat(momentLanguage))).then(function (s) { return __importStar(require(s)); }).then(function () {
|
|
182
183
|
moment.locale(momentLanguage);
|
|
@@ -186,7 +187,7 @@ var DateRangePickerWrapper = function (props) {
|
|
|
186
187
|
});
|
|
187
188
|
}
|
|
188
189
|
catch (error) {
|
|
189
|
-
moment.locale(
|
|
190
|
+
moment.locale('en');
|
|
190
191
|
}
|
|
191
192
|
}
|
|
192
193
|
else {
|
|
@@ -216,8 +217,8 @@ var DateRangePickerWrapper = function (props) {
|
|
|
216
217
|
startDate: startDate,
|
|
217
218
|
endDate: endDate,
|
|
218
219
|
});
|
|
219
|
-
var momentStartDate = moment(startDate,
|
|
220
|
-
var momentEndDate = moment(endDate,
|
|
220
|
+
var momentStartDate = moment(startDate, 'DD/MM/YYYY', true);
|
|
221
|
+
var momentEndDate = moment(endDate, 'DD/MM/YYYY', true);
|
|
221
222
|
if (momentStartDate.isValid() &&
|
|
222
223
|
momentEndDate.isValid() &&
|
|
223
224
|
momentEndDate.diff(momentStartDate) >= 0) {
|
|
@@ -225,7 +226,7 @@ var DateRangePickerWrapper = function (props) {
|
|
|
225
226
|
}
|
|
226
227
|
else
|
|
227
228
|
setIsValid(false);
|
|
228
|
-
setInputValue("".concat(moment(startDate).format(
|
|
229
|
+
setInputValue("".concat(moment(startDate).format('DD/MM/YYYY'), " - ").concat(moment(endDate).format('DD/MM/YYYY')));
|
|
229
230
|
};
|
|
230
231
|
var onFocusChange = function (focusedInput) {
|
|
231
232
|
setFocusedInput(!focusedInput ? constants_1.START_DATE : focusedInput);
|
|
@@ -237,18 +238,18 @@ var DateRangePickerWrapper = function (props) {
|
|
|
237
238
|
var handleChangeInput = function (e) {
|
|
238
239
|
var fieldValue = e.target.value;
|
|
239
240
|
setInputValue(fieldValue);
|
|
240
|
-
var fieldValueArr = (fieldValue === null || fieldValue === void 0 ? void 0 : fieldValue.split(
|
|
241
|
-
var year1900 = moment(
|
|
242
|
-
var momentStartDate = moment(fieldValueArr[0],
|
|
241
|
+
var fieldValueArr = (fieldValue === null || fieldValue === void 0 ? void 0 : fieldValue.split(' - ')) || [];
|
|
242
|
+
var year1900 = moment('1900-01-01');
|
|
243
|
+
var momentStartDate = moment(fieldValueArr[0], 'DD/MM/YYYY');
|
|
243
244
|
if (momentStartDate.isValid() && momentStartDate.diff(year1900) >= 0) {
|
|
244
245
|
setStartDate(momentStartDate);
|
|
245
246
|
}
|
|
246
|
-
var momentEndDate = moment(fieldValueArr[1],
|
|
247
|
+
var momentEndDate = moment(fieldValueArr[1], 'DD/MM/YYYY');
|
|
247
248
|
if (momentEndDate.isValid() && momentEndDate.diff(year1900) >= 0) {
|
|
248
249
|
setEndDate(momentEndDate);
|
|
249
250
|
}
|
|
250
|
-
if (moment(fieldValueArr[0],
|
|
251
|
-
moment(fieldValueArr[1],
|
|
251
|
+
if (moment(fieldValueArr[0], 'DD/MM/YYYY', true).isValid() &&
|
|
252
|
+
moment(fieldValueArr[1], 'DD/MM/YYYY', true).isValid() &&
|
|
252
253
|
momentEndDate.diff(momentStartDate) >= 0) {
|
|
253
254
|
momentStartDate.set({
|
|
254
255
|
hour: 0,
|
|
@@ -269,46 +270,14 @@ var DateRangePickerWrapper = function (props) {
|
|
|
269
270
|
setIsValid(false);
|
|
270
271
|
};
|
|
271
272
|
var nextProps = __assign({}, props);
|
|
272
|
-
var
|
|
273
|
-
var presets = [
|
|
274
|
-
{
|
|
275
|
-
text: t("DatePicker.ToDay"),
|
|
276
|
-
start: today,
|
|
277
|
-
end: today,
|
|
278
|
-
},
|
|
279
|
-
{
|
|
280
|
-
text: t("DatePicker.Yesterday"),
|
|
281
|
-
start: moment().subtract(1, "days"),
|
|
282
|
-
end: moment().subtract(1, "days"),
|
|
283
|
-
},
|
|
284
|
-
{
|
|
285
|
-
text: t("DatePicker.LastSevenDay"),
|
|
286
|
-
start: moment().subtract(6, "days"),
|
|
287
|
-
end: today,
|
|
288
|
-
},
|
|
289
|
-
{
|
|
290
|
-
text: t("DatePicker.LastThirtyDay"),
|
|
291
|
-
start: moment().subtract(29, "days"),
|
|
292
|
-
end: today,
|
|
293
|
-
},
|
|
294
|
-
{
|
|
295
|
-
text: t("DatePicker.ThisMonth"),
|
|
296
|
-
start: moment().startOf("month"),
|
|
297
|
-
end: moment().endOf("month"),
|
|
298
|
-
},
|
|
299
|
-
{
|
|
300
|
-
text: t("DatePicker.LastMonth"),
|
|
301
|
-
start: moment().subtract(1, "month").startOf("month"),
|
|
302
|
-
end: moment().subtract(1, "month").endOf("month"),
|
|
303
|
-
},
|
|
304
|
-
];
|
|
273
|
+
var presets = (0, configDate_1.default)(t, isFutureDate);
|
|
305
274
|
var renderDatePresets = function () {
|
|
306
275
|
return ((0, jsx_runtime_1.jsx)("div", { className: classes.CustomDateRangePicker_panel, children: presets.map(function (_a) {
|
|
307
276
|
var text = _a.text, start = _a.start, end = _a.end;
|
|
308
277
|
var isSelected = (0, react_dates_1.isSameDay)(start, value ? value === null || value === void 0 ? void 0 : value.startDate : startDate) && (0, react_dates_1.isSameDay)(end, value ? value === null || value === void 0 ? void 0 : value.endDate : endDate);
|
|
309
278
|
return ((0, jsx_runtime_1.jsx)("button", { className: "".concat(classes.CustomDateRangePicker_button, " ").concat(isSelected
|
|
310
279
|
? classes.CustomDateRangePicker_button__selected
|
|
311
|
-
:
|
|
280
|
+
: ''), type: "button", onClick: function () {
|
|
312
281
|
return controlButtonClick({
|
|
313
282
|
startDate: start,
|
|
314
283
|
endDate: end,
|
|
@@ -317,36 +286,36 @@ var DateRangePickerWrapper = function (props) {
|
|
|
317
286
|
}) }));
|
|
318
287
|
};
|
|
319
288
|
nextProps = omit(nextProps, [
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
289
|
+
'helperText',
|
|
290
|
+
'disableHelperText',
|
|
291
|
+
'value',
|
|
292
|
+
'autoFocus',
|
|
293
|
+
'autoFocusEndDate',
|
|
294
|
+
'initialStartDate',
|
|
295
|
+
'initialEndDate',
|
|
296
|
+
'presets',
|
|
297
|
+
'callback',
|
|
298
|
+
'label',
|
|
299
|
+
'error',
|
|
300
|
+
'isShowCalendarInfo',
|
|
301
|
+
'isValid',
|
|
302
|
+
'variant',
|
|
303
|
+
'textFieldProps',
|
|
304
|
+
'startDatePlaceholderText',
|
|
305
|
+
'endDatePlaceholderText',
|
|
306
|
+
'openDirection',
|
|
307
|
+
'startDateId',
|
|
308
|
+
'endDateId',
|
|
309
|
+
'anchorDirection',
|
|
310
|
+
'verticalSpacing',
|
|
311
|
+
'className',
|
|
312
|
+
'isDayBlocked',
|
|
313
|
+
'handleValid',
|
|
314
|
+
'handleDateRangePopover',
|
|
346
315
|
]);
|
|
347
|
-
var
|
|
316
|
+
var _t = react_1.default.useState(null), anchorElPopover = _t[0], setAnchorElPopover = _t[1];
|
|
348
317
|
var openPopper = Boolean(anchorElPopover);
|
|
349
|
-
var id = openPopper ?
|
|
318
|
+
var id = openPopper ? 'datePicker-popper' : undefined;
|
|
350
319
|
var popperRef = react_1.default.useRef();
|
|
351
320
|
var inputRef = react_1.default.useRef();
|
|
352
321
|
var handleClickInput = function (event) {
|
|
@@ -367,11 +336,11 @@ var DateRangePickerWrapper = function (props) {
|
|
|
367
336
|
var _a;
|
|
368
337
|
return ((0, jsx_runtime_1.jsx)(material_1.TextField, __assign({ "aria-describedby": id, variant: variant, label: label, error: !isValid || error, helperText: !disableHelperText
|
|
369
338
|
? error
|
|
370
|
-
? helperText || t(
|
|
339
|
+
? helperText || t('Common.InvalidData')
|
|
371
340
|
: !isValid
|
|
372
|
-
? t(
|
|
373
|
-
:
|
|
374
|
-
:
|
|
341
|
+
? t('DatePicker.InvalidDateRange')
|
|
342
|
+
: ''
|
|
343
|
+
: '' }, omit(props.textFieldProps, ['readOnly']), { inputProps: {
|
|
375
344
|
readOnly: (_a = props.textFieldProps) === null || _a === void 0 ? void 0 : _a.readOnly,
|
|
376
345
|
}, disabled: props.disabled, onClick: function (e) {
|
|
377
346
|
var _a;
|
|
@@ -380,7 +349,7 @@ var DateRangePickerWrapper = function (props) {
|
|
|
380
349
|
}, inputRef: inputRef, InputProps: {
|
|
381
350
|
endAdornment: ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, { position: "end", children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { children: (0, jsx_runtime_1.jsx)(icons_material_1.CalendarTodaySharp, {}) }) })),
|
|
382
351
|
} })));
|
|
383
|
-
} }), (0, jsx_runtime_1.jsx)(material_1.Popper, { id: id, open: openPopper, anchorEl: anchorElPopover, onClose: handleClosePopover, style: { zIndex: 30000 }, placement: openDirection ===
|
|
352
|
+
} }), (0, jsx_runtime_1.jsx)(material_1.Popper, { id: id, open: openPopper, anchorEl: anchorElPopover, onClose: handleClosePopover, style: { zIndex: 30000 }, placement: openDirection === 'up' ? 'top-start' : 'bottom-start', popperRef: popperRef, children: (0, jsx_runtime_1.jsx)(material_1.ClickAwayListener, { onClickAway: handleClosePopover, children: (0, jsx_runtime_1.jsx)(material_1.Paper, { elevation: 8, className: classes.CustomPickerSelected, children: (0, jsx_runtime_1.jsx)(react_dates_1.DayPickerRangeController, __assign({}, nextProps, { calendarInfoPosition: "before", renderCalendarInfo: isShowCalendarInfo ? renderDatePresets : null, onDatesChange: onDatesChange, onFocusChange: onFocusChange, focusedInput: focusedInput, startDate: value ? value === null || value === void 0 ? void 0 : value.startDate : startDate, endDate: value ? value === null || value === void 0 ? void 0 : value.endDate : endDate, hideKeyboardShortcutsPanel: true, numberOfMonths: 2, daySize: 32, transitionDuration: 0, isDayBlocked: function (day) {
|
|
384
353
|
if (value ? value === null || value === void 0 ? void 0 : value.startDate : startDate) {
|
|
385
354
|
if (isDayBlocked(value ? value === null || value === void 0 ? void 0 : value.startDate : startDate))
|
|
386
355
|
setIsValid(false);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TFunction } from 'i18next';
|
|
2
|
+
import moment from 'moment';
|
|
3
|
+
declare const configInitialDate: (t: TFunction<'translation', undefined>, isFutureDate: boolean) => {
|
|
4
|
+
text: string;
|
|
5
|
+
start: moment.Moment;
|
|
6
|
+
end: moment.Moment;
|
|
7
|
+
}[];
|
|
8
|
+
export default configInitialDate;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var moment_1 = __importDefault(require("moment"));
|
|
7
|
+
var configInitialDate = function (t, isFutureDate) {
|
|
8
|
+
var today = (0, moment_1.default)();
|
|
9
|
+
var initDatePast = [
|
|
10
|
+
{
|
|
11
|
+
text: t('DatePicker.ToDay'),
|
|
12
|
+
start: today,
|
|
13
|
+
end: today,
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
text: t('DatePicker.Yesterday'),
|
|
17
|
+
start: (0, moment_1.default)().subtract(1, 'days'),
|
|
18
|
+
end: (0, moment_1.default)().subtract(1, 'days'),
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
text: t('DatePicker.LastSevenDay'),
|
|
22
|
+
start: (0, moment_1.default)().subtract(6, 'days'),
|
|
23
|
+
end: today,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
text: t('DatePicker.LastThirtyDay'),
|
|
27
|
+
start: (0, moment_1.default)().subtract(29, 'days'),
|
|
28
|
+
end: today,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
text: t('DatePicker.ThisMonth'),
|
|
32
|
+
start: (0, moment_1.default)().startOf('month'),
|
|
33
|
+
end: (0, moment_1.default)().endOf('month'),
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
text: t('DatePicker.LastMonth'),
|
|
37
|
+
start: (0, moment_1.default)().subtract(1, 'month').startOf('month'),
|
|
38
|
+
end: (0, moment_1.default)().subtract(1, 'month').endOf('month'),
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
var initDateFuture = [
|
|
42
|
+
{
|
|
43
|
+
text: t('DatePicker.ToDay'),
|
|
44
|
+
start: today,
|
|
45
|
+
end: today,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
text: t('DatePicker.Tomorrow'),
|
|
49
|
+
start: (0, moment_1.default)(),
|
|
50
|
+
end: (0, moment_1.default)().add(1, 'days'),
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
text: t('DatePicker.NextSevenDay'),
|
|
54
|
+
start: today,
|
|
55
|
+
end: (0, moment_1.default)().add(6, 'days'),
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
text: t('DatePicker.NextThirtyDay'),
|
|
59
|
+
start: today,
|
|
60
|
+
end: (0, moment_1.default)().add(29, 'days'),
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
text: t('DatePicker.NextMonth'),
|
|
64
|
+
start: (0, moment_1.default)().add(1, 'month').startOf('month'),
|
|
65
|
+
end: (0, moment_1.default)().add(1, 'month').endOf('month'),
|
|
66
|
+
},
|
|
67
|
+
];
|
|
68
|
+
var initDate = isFutureDate ? initDateFuture : initDatePast;
|
|
69
|
+
return initDate;
|
|
70
|
+
};
|
|
71
|
+
exports.default = configInitialDate;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Directory } from '../../ACM-AXN/Campaign/Types';
|
|
3
|
+
import { DirectoryRoot } from '../../ACM-AXN/Campaign/Enum';
|
|
3
4
|
interface CreateDirectoryProps {
|
|
4
5
|
service: {
|
|
5
6
|
directoriesPost: (body: Directory) => Promise<void>;
|
|
7
|
+
directoriesGetByObjectTypeCode: (type: DirectoryRoot) => Promise<Directory[]>;
|
|
6
8
|
};
|
|
7
9
|
parentDirectory: string;
|
|
10
|
+
directoryRoot: DirectoryRoot;
|
|
8
11
|
}
|
|
9
12
|
declare const CreateDirectory: React.FC<CreateDirectoryProps>;
|
|
10
13
|
export default CreateDirectory;
|