@antscorp/antsomi-ui 1.3.3-beta.6 → 1.3.3-beta.60
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/es/assets/images/iphone-top-bar.png +0 -0
- package/es/assets/images/iphone.png +0 -0
- package/es/assets/images/stars_slider.png +0 -0
- package/es/components/atoms/Button/index.d.ts +1 -8
- package/es/components/atoms/Empty/Empty.d.ts +6 -5
- package/es/components/atoms/Empty/Empty.js +7 -1
- package/es/components/atoms/Flex/Flex.d.ts +2 -0
- package/es/components/atoms/Flex/Flex.js +1 -0
- package/es/components/atoms/Flex/index.d.ts +1 -0
- package/es/components/atoms/Flex/index.js +1 -0
- package/es/components/atoms/Input/Input.d.ts +14 -3
- package/es/components/atoms/Input/Input.js +7 -3
- package/es/components/atoms/InputDynamic/EditCaretPositioning.d.ts +2 -0
- package/es/components/atoms/InputDynamic/EditCaretPositioning.js +89 -0
- package/es/components/atoms/InputDynamic/InputDynamic.d.ts +30 -0
- package/es/components/atoms/InputDynamic/InputDynamic.js +320 -0
- package/es/components/atoms/InputDynamic/PopupShortLink.d.ts +16 -0
- package/es/components/atoms/InputDynamic/PopupShortLink.js +85 -0
- package/es/components/atoms/InputDynamic/index.d.ts +2 -0
- package/es/components/atoms/InputDynamic/index.js +1 -0
- package/es/components/atoms/InputDynamic/styled.d.ts +12 -0
- package/es/components/atoms/InputDynamic/styled.js +281 -0
- package/es/components/atoms/InputDynamic/utils.d.ts +22 -0
- package/es/components/atoms/InputDynamic/utils.js +751 -0
- package/es/components/atoms/MobileFrame/MobileFrame.d.ts +4 -0
- package/es/components/atoms/MobileFrame/MobileFrame.js +22 -0
- package/es/components/atoms/MobileFrame/constants.d.ts +4 -0
- package/es/components/atoms/MobileFrame/constants.js +4 -0
- package/es/components/atoms/MobileFrame/index.d.ts +2 -0
- package/es/components/atoms/MobileFrame/index.js +1 -0
- package/es/components/atoms/MobileFrame/styled.d.ts +3 -0
- package/es/components/atoms/MobileFrame/styled.js +33 -0
- package/es/components/atoms/Pagination/index.d.ts +1 -0
- package/es/components/atoms/Popover/Popover.d.ts +1 -1
- package/es/components/atoms/Popover/styled.d.ts +1 -1
- package/es/components/atoms/PreviewTabs/PreviewTabs.d.ts +7 -0
- package/es/components/atoms/PreviewTabs/PreviewTabs.js +67 -0
- package/es/components/atoms/PreviewTabs/index.d.ts +2 -0
- package/es/components/atoms/PreviewTabs/index.js +1 -0
- package/es/components/atoms/PreviewTabs/styled.d.ts +6 -0
- package/es/components/atoms/PreviewTabs/styled.js +79 -0
- package/es/components/atoms/Progress/Progress.d.ts +1 -1
- package/es/components/atoms/Radio/index.d.ts +3 -3
- package/es/components/atoms/RateV2/RateV2.d.ts +18 -0
- package/es/components/atoms/RateV2/RateV2.js +73 -0
- package/es/components/atoms/RateV2/index.d.ts +1 -0
- package/es/components/atoms/RateV2/index.js +1 -0
- package/es/components/atoms/RequiredLabel/index.d.ts +1 -0
- package/es/components/atoms/RequiredLabel/index.js +4 -3
- package/es/components/atoms/Slider/index.d.ts +2 -1
- package/es/components/atoms/Slider/index.js +7 -14
- package/es/components/atoms/SliderV2/index.d.ts +6 -0
- package/es/components/atoms/SliderV2/index.js +21 -0
- package/es/components/atoms/Space/Space.d.ts +1 -1
- package/es/components/atoms/Spin/Spin.d.ts +2 -1
- package/es/components/atoms/Statistic/Statistic.d.ts +1 -4
- package/es/components/atoms/index.d.ts +8 -0
- package/es/components/atoms/index.js +6 -0
- package/es/components/common/ConfigProvider/ConfigProvider.js +6 -0
- package/es/components/common/ConfigProvider/GlobalStyle.js +271 -27
- package/es/components/icons/ArrowGrowIcon.d.ts +2 -1
- package/es/components/icons/AudioRecordIcon.d.ts +2 -1
- package/es/components/icons/BugIcon.d.ts +2 -1
- package/es/components/icons/CameraIcon.d.ts +2 -1
- package/es/components/icons/CaptureIcon.d.ts +2 -1
- package/es/components/icons/CheckSlimIcon.d.ts +2 -1
- package/es/components/icons/CloseIcon.d.ts +2 -1
- package/es/components/icons/CommentIcon.d.ts +2 -1
- package/es/components/icons/EventIcon.d.ts +2 -1
- package/es/components/icons/FreeDrawIcon.d.ts +2 -1
- package/es/components/icons/GPTIcon.d.ts +2 -1
- package/es/components/icons/GPTIconV2.d.ts +2 -1
- package/es/components/icons/GPTIconV3.d.ts +2 -1
- package/es/components/icons/HighlightIcon.d.ts +2 -1
- package/es/components/icons/IdeaIcon.d.ts +2 -1
- package/es/components/icons/InvisibleIcon.d.ts +2 -1
- package/es/components/icons/MuteIcon.d.ts +2 -1
- package/es/components/icons/OpenUrlIcon.d.ts +2 -1
- package/es/components/icons/PauseIcon.d.ts +2 -1
- package/es/components/icons/PlaneIcon.d.ts +2 -1
- package/es/components/icons/RequestIcon.d.ts +2 -1
- package/es/components/icons/StopRecordIcon.d.ts +2 -1
- package/es/components/icons/UserIcon.d.ts +2 -1
- package/es/components/icons/VerticalDotsIcon.d.ts +2 -1
- package/es/components/icons/WarningIcon.d.ts +2 -1
- package/es/components/molecules/CaptureScreen/CaptureScreen.d.ts +2 -1
- package/es/components/molecules/CaptureScreen/components/CommentBox/CommentBox.d.ts +2 -1
- package/es/components/molecules/CaptureScreen/components/Cursor/Cursor.d.ts +2 -1
- package/es/components/molecules/Collapse/Collapse.d.ts +3 -3
- package/es/components/molecules/Collapse/Collapse.js +9 -0
- package/es/components/molecules/ColorSetting/styled.d.ts +1 -8
- package/es/components/molecules/DatePicker/components/AdvancedPicker/AdvancedPicker.d.ts +2 -2
- package/es/components/molecules/DatePicker/components/AdvancedPicker/AdvancedPicker.js +258 -111
- package/es/components/molecules/DatePicker/components/AdvancedPicker/constants.d.ts +66 -25
- package/es/components/molecules/DatePicker/components/AdvancedPicker/constants.js +109 -0
- package/es/components/molecules/DatePicker/components/AdvancedPicker/styled.js +48 -4
- package/es/components/molecules/DatePicker/components/AdvancedPicker/types.d.ts +22 -0
- package/es/components/molecules/DatePicker/components/AdvancedPicker/utils.d.ts +20 -0
- package/es/components/molecules/DatePicker/components/AdvancedPicker/utils.js +90 -1
- package/es/components/molecules/Drawer/Drawer.d.ts +5 -1
- package/es/components/molecules/Drawer/Drawer.js +3 -1
- package/es/components/molecules/Drawer/index.d.ts +1 -0
- package/es/components/molecules/Form/Form.d.ts +1 -0
- package/es/components/molecules/Form/Form.js +1 -0
- package/es/components/molecules/Form/index.d.ts +1 -0
- package/es/components/molecules/Form/index.js +1 -0
- package/es/components/molecules/IconSelection/styled.d.ts +1 -8
- package/es/components/molecules/Modal/Modal.d.ts +2 -2
- package/es/components/molecules/Modal/index.d.ts +1 -0
- package/es/components/molecules/Modal/styled.d.ts +1 -1
- package/es/components/molecules/ModalV2/ModalV2.d.ts +5 -0
- package/es/components/molecules/ModalV2/ModalV2.js +26 -0
- package/es/components/molecules/ModalV2/index.d.ts +2 -0
- package/es/components/molecules/ModalV2/index.js +1 -0
- package/es/components/molecules/ModalV2/styled.d.ts +7 -0
- package/es/components/molecules/ModalV2/styled.js +22 -0
- package/es/components/molecules/Popconfirm/Popconfirm.d.ts +1 -1
- package/es/components/molecules/PreviewModal/PreviewModal.d.ts +7 -0
- package/es/components/molecules/PreviewModal/PreviewModal.js +30 -0
- package/es/components/molecules/PreviewModal/index.d.ts +2 -0
- package/es/components/molecules/PreviewModal/index.js +1 -0
- package/es/components/molecules/PreviewModal/styled.d.ts +4 -0
- package/es/components/molecules/PreviewModal/styled.js +39 -0
- package/es/components/molecules/ResizeGrid/ResizeGrid.d.ts +3 -0
- package/es/components/molecules/ResizeGrid/ResizeGrid.js +728 -0
- package/es/components/molecules/ResizeGrid/components/Cell/Cell.d.ts +3 -0
- package/es/components/molecules/ResizeGrid/components/Cell/Cell.js +87 -0
- package/es/components/molecules/ResizeGrid/components/Cell/index.d.ts +1 -0
- package/es/components/molecules/ResizeGrid/components/Cell/index.js +1 -0
- package/es/components/molecules/ResizeGrid/components/Cell/styled.d.ts +3 -0
- package/es/components/molecules/ResizeGrid/components/Cell/styled.js +80 -0
- package/es/components/molecules/ResizeGrid/constant.d.ts +35 -0
- package/es/components/molecules/ResizeGrid/constant.js +111 -0
- package/es/components/molecules/ResizeGrid/index.d.ts +2 -0
- package/es/components/molecules/ResizeGrid/index.js +1 -0
- package/es/components/molecules/ResizeGrid/styled.d.ts +10 -0
- package/es/components/molecules/ResizeGrid/styled.js +56 -0
- package/es/components/molecules/ResizeGrid/types.d.ts +147 -0
- package/es/components/molecules/ResizeGrid/types.js +1 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuBlock.d.ts +11 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuBlock.js +53 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/index.d.ts +16 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/index.js +105 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/styled.d.ts +20 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/styled.js +135 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/constants.d.ts +2 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/constants.js +765 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/index.d.ts +3 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/index.js +2 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/styled.d.ts +9 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/styled.js +17 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/RichMenuChatBar.d.ts +10 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/RichMenuChatBar.js +32 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/index.d.ts +6 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/index.js +15 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/styled.d.ts +4 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/styled.js +47 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/index.d.ts +2 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/index.js +1 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/styled.d.ts +9 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/styled.js +37 -0
- package/es/components/molecules/RichMenu/RichMenuMobileView/RichMenuMobileView.d.ts +10 -0
- package/es/components/molecules/RichMenu/RichMenuMobileView/RichMenuMobileView.js +37 -0
- package/es/components/molecules/RichMenu/RichMenuMobileView/index.d.ts +1 -0
- package/es/components/molecules/RichMenu/RichMenuMobileView/index.js +1 -0
- package/es/components/molecules/RichMenu/RichMenuMobileView/styled.d.ts +6 -0
- package/es/components/molecules/RichMenu/RichMenuMobileView/styled.js +20 -0
- package/es/components/molecules/RichMenu/index.d.ts +3 -0
- package/es/components/molecules/RichMenu/index.js +3 -0
- package/es/components/molecules/Select/Select.d.ts +5 -1
- package/es/components/molecules/Select/Select.js +23 -2
- package/es/components/molecules/Select/Test.d.ts +2 -1
- package/es/components/molecules/ShareAccess/ShareAccess.d.ts +3 -0
- package/es/components/molecules/ShareAccess/ShareAccess.js +23 -0
- package/es/components/molecules/ShareAccess/actions.d.ts +16 -0
- package/es/components/molecules/ShareAccess/actions.js +12 -0
- package/es/components/molecules/ShareAccess/components/GeneralAccess/GeneralAccess.d.ts +2 -0
- package/es/components/molecules/ShareAccess/components/GeneralAccess/GeneralAccess.js +70 -0
- package/es/components/molecules/ShareAccess/components/GeneralAccess/index.d.ts +1 -0
- package/es/components/molecules/ShareAccess/components/GeneralAccess/index.js +1 -0
- package/es/components/molecules/ShareAccess/components/GeneralAccess/styled.d.ts +1 -0
- package/es/components/molecules/ShareAccess/components/GeneralAccess/styled.js +57 -0
- package/es/components/molecules/ShareAccess/components/LayoutContent/LayoutContent.d.ts +3 -0
- package/es/components/molecules/ShareAccess/components/LayoutContent/LayoutContent.js +14 -0
- package/es/components/molecules/ShareAccess/components/LayoutContent/index.d.ts +1 -0
- package/es/components/molecules/ShareAccess/components/LayoutContent/index.js +1 -0
- package/es/components/molecules/ShareAccess/components/LayoutContent/styled.d.ts +1 -0
- package/es/components/molecules/ShareAccess/components/LayoutContent/styled.js +7 -0
- package/es/components/molecules/ShareAccess/components/ModalTransferOwnerShip/ModalTransferOwnerShip.d.ts +2 -0
- package/es/components/molecules/ShareAccess/components/ModalTransferOwnerShip/ModalTransferOwnerShip.js +43 -0
- package/es/components/molecules/ShareAccess/components/ModalTransferOwnerShip/index.d.ts +0 -0
- package/es/components/molecules/ShareAccess/components/ModalTransferOwnerShip/index.js +1 -0
- package/es/components/molecules/ShareAccess/components/ModalTransferOwnerShip/styled.d.ts +7 -0
- package/es/components/molecules/ShareAccess/components/ModalTransferOwnerShip/styled.js +18 -0
- package/es/components/molecules/ShareAccess/components/PeopleAccess/PeopleAccess.d.ts +5 -0
- package/es/components/molecules/ShareAccess/components/PeopleAccess/PeopleAccess.js +92 -0
- package/es/components/molecules/ShareAccess/components/PeopleAccess/index.d.ts +1 -0
- package/es/components/molecules/ShareAccess/components/PeopleAccess/index.js +1 -0
- package/es/components/molecules/ShareAccess/components/PeopleAccess/styled.d.ts +1 -0
- package/es/components/molecules/ShareAccess/components/PeopleAccess/styled.js +46 -0
- package/es/components/molecules/ShareAccess/components/SearchUser/SearchUser.d.ts +5 -0
- package/es/components/molecules/ShareAccess/components/SearchUser/SearchUser.js +73 -0
- package/es/components/molecules/ShareAccess/components/SearchUser/index.d.ts +1 -0
- package/es/components/molecules/ShareAccess/components/SearchUser/index.js +1 -0
- package/es/components/molecules/ShareAccess/components/SearchUser/styled.d.ts +2 -0
- package/es/components/molecules/ShareAccess/components/SearchUser/styled.js +29 -0
- package/es/components/molecules/ShareAccess/components/index.d.ts +1 -0
- package/es/components/molecules/ShareAccess/components/index.js +1 -0
- package/es/components/molecules/ShareAccess/constants.d.ts +61 -0
- package/es/components/molecules/ShareAccess/constants.js +79 -0
- package/es/components/molecules/ShareAccess/context.d.ts +4 -0
- package/es/components/molecules/ShareAccess/context.js +3 -0
- package/es/components/molecules/ShareAccess/hooks/index.d.ts +1 -0
- package/es/components/molecules/ShareAccess/hooks/index.js +1 -0
- package/es/components/molecules/ShareAccess/hooks/useShareAccess.d.ts +15 -0
- package/es/components/molecules/ShareAccess/hooks/useShareAccess.js +15 -0
- package/es/components/molecules/ShareAccess/index.d.ts +1 -0
- package/es/components/molecules/ShareAccess/index.js +1 -0
- package/es/components/molecules/ShareAccess/reducer.d.ts +2 -0
- package/es/components/molecules/ShareAccess/reducer.js +19 -0
- package/es/components/molecules/ShareAccess/types.d.ts +46 -0
- package/es/components/molecules/ShareAccess/types.js +1 -0
- package/es/components/molecules/ShareAccess/utils.d.ts +14 -0
- package/es/components/molecules/ShareAccess/utils.js +22 -0
- package/es/components/molecules/TreeSelect/TreeSelect.d.ts +2 -1
- package/es/components/molecules/UploadImage/MediaIcon.d.ts +2 -1
- package/es/components/molecules/index.d.ts +10 -2
- package/es/components/molecules/index.js +8 -2
- package/es/components/organism/Help/styled.d.ts +4 -10
- package/es/components/organism/Table/ExplorePivotTable/styled.d.ts +1 -0
- package/es/constants/index.d.ts +1 -0
- package/es/constants/index.js +1 -0
- package/es/constants/richMenu.d.ts +19 -0
- package/es/constants/richMenu.js +19 -0
- package/es/constants/storybook.d.ts +7 -1
- package/es/constants/storybook.js +12 -0
- package/es/constants/theme.js +30 -3
- package/es/hooks/useDebounceCallback.d.ts +1 -0
- package/es/hooks/useDebounceCallback.js +5 -0
- package/es/hooks/useDebounceV2.d.ts +1 -0
- package/es/hooks/useDebounceV2.js +11 -0
- package/es/hooks/useDeepCompareEffect.d.ts +1 -0
- package/es/hooks/useDeepCompareEffect.js +21 -0
- package/es/hooks/usePrevious.d.ts +2 -0
- package/es/hooks/usePrevious.js +9 -0
- package/es/locales/en/translation.json +3 -1
- package/es/locales/i18n.d.ts +3 -0
- package/es/locales/translations.d.ts +2 -0
- package/es/locales/vi/translation.json +2 -1
- package/es/test.d.ts +2 -1
- package/es/test.js +164 -66
- package/es/types/index.d.ts +12 -0
- package/es/types/index.js +2 -1
- package/es/types/richMenu.d.ts +214 -0
- package/es/types/richMenu.js +1 -0
- package/es/types/variables.d.ts +2 -0
- package/es/types/variables.js +1 -0
- package/es/utils/common.d.ts +3 -0
- package/es/utils/common.js +20 -0
- package/es/utils/handleError.d.ts +32 -2
- package/es/utils/handleError.js +42 -4
- package/package.json +12 -9
|
@@ -72,3 +72,112 @@ export const ADVANCED_PICKER_TYPE = {
|
|
|
72
72
|
label: 'datePicker.endDate',
|
|
73
73
|
},
|
|
74
74
|
};
|
|
75
|
+
export const MONTH_LABEL_SHORT = [
|
|
76
|
+
'Jan',
|
|
77
|
+
'Feb',
|
|
78
|
+
'Mar',
|
|
79
|
+
'Apr',
|
|
80
|
+
'May',
|
|
81
|
+
'Jun',
|
|
82
|
+
'Jul',
|
|
83
|
+
'Aug',
|
|
84
|
+
'Sep',
|
|
85
|
+
'Oct',
|
|
86
|
+
'Nov',
|
|
87
|
+
'Dec',
|
|
88
|
+
];
|
|
89
|
+
export const MONTH_LABEL_FULL = [
|
|
90
|
+
'January',
|
|
91
|
+
'February',
|
|
92
|
+
'March',
|
|
93
|
+
'April',
|
|
94
|
+
'May',
|
|
95
|
+
'June',
|
|
96
|
+
'July',
|
|
97
|
+
'August',
|
|
98
|
+
'September',
|
|
99
|
+
'October',
|
|
100
|
+
'November',
|
|
101
|
+
'December',
|
|
102
|
+
];
|
|
103
|
+
export const DAY_LABEL_SHORT = ['Sun', 'Mon', 'Tue', 'Wed', 'Thur', 'Fri', 'Sat'];
|
|
104
|
+
export const WEEK_ARR = Array.from({ length: 53 }, (_, i) => i + 1);
|
|
105
|
+
export const MONTH_DAY_31 = Array.from({ length: 31 }, (_, i) => i + 1);
|
|
106
|
+
export const MONTH_DAY_30 = Array.from({ length: 30 }, (_, i) => i + 1);
|
|
107
|
+
export const MONTH_DAY_FEB = Array.from({ length: 29 }, (_, i) => i + 1);
|
|
108
|
+
export const MONTH_31 = [0, 2, 4, 6, 7, 9, 11];
|
|
109
|
+
export const MONTH_30 = [3, 5, 8, 10];
|
|
110
|
+
export const DAY_OF_MONTH = [
|
|
111
|
+
MONTH_DAY_31,
|
|
112
|
+
MONTH_DAY_FEB,
|
|
113
|
+
MONTH_DAY_31,
|
|
114
|
+
MONTH_DAY_30,
|
|
115
|
+
MONTH_DAY_31,
|
|
116
|
+
MONTH_DAY_30,
|
|
117
|
+
MONTH_DAY_31,
|
|
118
|
+
MONTH_DAY_31,
|
|
119
|
+
MONTH_DAY_30,
|
|
120
|
+
MONTH_DAY_31,
|
|
121
|
+
MONTH_DAY_30,
|
|
122
|
+
MONTH_DAY_31,
|
|
123
|
+
];
|
|
124
|
+
/** The year with full 366 days of year, use for select day/day of month with include edge case (February 29th) */
|
|
125
|
+
export const ANCHOR_LEAP_YEAR = 2024;
|
|
126
|
+
export const QUARTER_PLACEHOLDER = '%q%';
|
|
127
|
+
export const WEEK_PLACEHOLDER = '%t%';
|
|
128
|
+
export const HIDE_TIME_LABEL_ARR = [
|
|
129
|
+
'YEAR',
|
|
130
|
+
'YEAR_MONTH',
|
|
131
|
+
'YEAR_MONTH_DAY',
|
|
132
|
+
'QUARTER',
|
|
133
|
+
'MONTH',
|
|
134
|
+
'WEEK',
|
|
135
|
+
'HOUR',
|
|
136
|
+
'MINUTE',
|
|
137
|
+
'MONTH_DAY',
|
|
138
|
+
'DAY_OF_WEEK',
|
|
139
|
+
'DAY',
|
|
140
|
+
];
|
|
141
|
+
// export const CALCULATION_DATES = [
|
|
142
|
+
// { value: 'seconds', label: 'datePicker.seconds' },
|
|
143
|
+
// { value: 'minutes', label: 'datePicker.minutes' },
|
|
144
|
+
// { value: 'hours', label: 'datePicker.hours' },
|
|
145
|
+
// { value: 'days', label: 'datePicker.days' },
|
|
146
|
+
// { value: 'weeks', label: 'datePicker.weeks' },
|
|
147
|
+
// { value: 'months', label: 'datePicker.months' },
|
|
148
|
+
// { value: 'quarters', label: 'datePicker.quarters' },
|
|
149
|
+
// { value: 'years', label: 'datePicker.years' },
|
|
150
|
+
// ];
|
|
151
|
+
// Granularity according to value type (semantic)
|
|
152
|
+
export const GRANULARITY_MAPPING = {
|
|
153
|
+
YEAR: ['years'],
|
|
154
|
+
YEAR_QUARTER: ['years', 'quarters'],
|
|
155
|
+
YEAR_MONTH: ['years', 'quarters', 'months'],
|
|
156
|
+
YEAR_WEEK: ['years', 'quarters', 'months', 'weeks'],
|
|
157
|
+
YEAR_MONTH_DAY: ['years', 'quarters', 'months', 'weeks', 'days'],
|
|
158
|
+
YEAR_MONTH_DAY_HOUR: ['years', 'quarters', 'months', 'weeks', 'days', 'hours'],
|
|
159
|
+
YEAR_MONTH_DAY_MINUTE: ['years', 'quarters', 'months', 'weeks', 'days', 'hours', 'minutes'],
|
|
160
|
+
YEAR_MONTH_DAY_SECOND: [
|
|
161
|
+
'years',
|
|
162
|
+
'quarters',
|
|
163
|
+
'months',
|
|
164
|
+
'weeks',
|
|
165
|
+
'days',
|
|
166
|
+
'hours',
|
|
167
|
+
'minutes',
|
|
168
|
+
'seconds',
|
|
169
|
+
],
|
|
170
|
+
QUARTER: ['years', 'quarters'],
|
|
171
|
+
MONTH: ['years', 'quarters', 'months'],
|
|
172
|
+
WEEK: ['years', 'quarters', 'months', 'weeks'],
|
|
173
|
+
MONTH_DAY: ['years', 'quarters', 'months', 'weeks', 'days'],
|
|
174
|
+
DAY_OF_WEEK: ['years', 'quarters', 'months', 'weeks', 'days'],
|
|
175
|
+
/** Day of Month */
|
|
176
|
+
DAY: ['years', 'quarters', 'months', 'weeks', 'days'],
|
|
177
|
+
HOUR: ['years', 'quarters', 'months', 'weeks', 'days', 'hours'],
|
|
178
|
+
MINUTE: ['years', 'quarters', 'months', 'weeks', 'days', 'hours', 'minutes'],
|
|
179
|
+
INPUT_NUMBER: ['years', 'months', 'weeks', 'days'],
|
|
180
|
+
INPUT_TEXT: ['years', 'months', 'weeks', 'days'],
|
|
181
|
+
INPUT_TEXT_NO_FIELD: ['years', 'months', 'weeks', 'days'],
|
|
182
|
+
MATCHES_ANY: ['years', 'months', 'weeks', 'days'],
|
|
183
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _a, _b, _c;
|
|
1
|
+
var _a, _b, _c, _d, _e;
|
|
2
2
|
// Libraries
|
|
3
3
|
import { THEME } from '../../../../../constants';
|
|
4
4
|
import styled from 'styled-components';
|
|
@@ -8,6 +8,50 @@ export const DropdownContent = styled.div `
|
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-direction: column;
|
|
10
10
|
gap: 10px;
|
|
11
|
+
|
|
12
|
+
.custom-picker-content {
|
|
13
|
+
display: grid;
|
|
14
|
+
grid-template-columns: repeat(3, 1fr);
|
|
15
|
+
row-gap: 12px;
|
|
16
|
+
height: 120px;
|
|
17
|
+
overflow-y: auto;
|
|
18
|
+
|
|
19
|
+
&.day-of-month-container {
|
|
20
|
+
grid-template-columns: repeat(7, 1fr);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
& > .custom-picker-item {
|
|
24
|
+
padding: 2px 8px;
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
display: flex;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
align-items: center;
|
|
29
|
+
|
|
30
|
+
&.custom-picker-item-selected {
|
|
31
|
+
background-color: ${(_a = THEME.token) === null || _a === void 0 ? void 0 : _a.colorPrimary};
|
|
32
|
+
color: #fff;
|
|
33
|
+
&:hover {
|
|
34
|
+
background-color: ${(_b = THEME.token) === null || _b === void 0 ? void 0 : _b.colorPrimary};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&:hover {
|
|
39
|
+
background-color: rgba(34, 34, 34, 0.04);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.month-controller {
|
|
45
|
+
display: flex;
|
|
46
|
+
justify-content: space-around;
|
|
47
|
+
user-select: none;
|
|
48
|
+
i {
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
&:hover {
|
|
51
|
+
color: #000;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
11
55
|
`;
|
|
12
56
|
export const DropdownHeader = styled.div `
|
|
13
57
|
padding: 10px 10px 0px 10px;
|
|
@@ -17,7 +61,7 @@ export const DropdownHeader = styled.div `
|
|
|
17
61
|
text-align: center;
|
|
18
62
|
|
|
19
63
|
> .__title {
|
|
20
|
-
color: ${(
|
|
64
|
+
color: ${(_c = THEME.token) === null || _c === void 0 ? void 0 : _c.bw6};
|
|
21
65
|
}
|
|
22
66
|
`;
|
|
23
67
|
export const DropdownFooter = styled.div `
|
|
@@ -34,8 +78,8 @@ export const DatePickerHeader = styled.div `
|
|
|
34
78
|
line-height: 1.6 !important;
|
|
35
79
|
`;
|
|
36
80
|
export const DatePickerCustomInput = styled.input `
|
|
37
|
-
font-family: ${(
|
|
38
|
-
color: ${(
|
|
81
|
+
font-family: ${(_d = THEME.token) === null || _d === void 0 ? void 0 : _d.fontFamily};
|
|
82
|
+
color: ${(_e = THEME.token) === null || _e === void 0 ? void 0 : _e.bw10} !important;
|
|
39
83
|
`;
|
|
40
84
|
export const DatePickerFooter = styled.div `
|
|
41
85
|
position: absolute;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { VALUE_TYPES } from './constants';
|
|
1
2
|
export type TOption = {
|
|
2
3
|
dateType: TDateType;
|
|
3
4
|
calculationType: TCalculationType;
|
|
@@ -12,3 +13,24 @@ export type TCalculationType = 'minus' | 'plus' | '';
|
|
|
12
13
|
export type TCalculationDate = 'seconds' | 'minutes' | 'hours' | 'days' | 'weeks' | 'months' | 'quarters' | 'years' | '';
|
|
13
14
|
export type TOperatorKey = 'after' | 'between' | 'before';
|
|
14
15
|
export type TAdvancedType = 'startDate' | 'endDate';
|
|
16
|
+
/**
|
|
17
|
+
* @description Mapping ValueTypes to Semantic
|
|
18
|
+
* @example ```valueType -> semantic```
|
|
19
|
+
* @type YEAR -> 'YYYY'
|
|
20
|
+
* @type YEAR_QUARTER -> 'QQ YYYY'
|
|
21
|
+
* @type YEAR_MONTH -> 'MM YYYY'
|
|
22
|
+
* @type YEAR_WEEK -> 'WW YYYY'
|
|
23
|
+
* @type YEAR_MONTH_DAY -> 'MM DD YYYY'
|
|
24
|
+
* @type YEAR_MONTH_DAY_HOUR -> 'MM DD YYYY HH'
|
|
25
|
+
* @type YEAR_MONTH_DAY_MINUTE -> 'MM DD YYYY HH MM'
|
|
26
|
+
* @type YEAR_MONTH_DAY_SECOND -> 'MM DD YYYY HH MM SS'
|
|
27
|
+
* @type QUARTER -> 'QQ'
|
|
28
|
+
* @type MONTH -> 'MM'
|
|
29
|
+
* @type WEEK -> 'WW'
|
|
30
|
+
* @type MONTH_DAY -> 'MM DD'
|
|
31
|
+
* @type DAY_OF_WEEK -> 'D'
|
|
32
|
+
* @type DAY -> 'DD'
|
|
33
|
+
* @type HOUR -> 'HH'
|
|
34
|
+
* @type MINUTE -> 'MM'
|
|
35
|
+
*/
|
|
36
|
+
export type ValueTypes = (typeof VALUE_TYPES)[keyof typeof VALUE_TYPES];
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import type { Dayjs } from 'dayjs';
|
|
2
|
+
import type { CellRenderInfo } from 'rc-picker/es/interface';
|
|
3
|
+
import { ValueTypes } from './types';
|
|
1
4
|
/**
|
|
2
5
|
* Calculates a new date based on the given parameters.
|
|
3
6
|
* @param {string} [dateTypeKey='today'] - Key to determine the type of date to be used as the starting point.
|
|
@@ -13,3 +16,20 @@
|
|
|
13
16
|
* @returns {string} The new date in the specified format.
|
|
14
17
|
*/
|
|
15
18
|
export declare const calculationDateAdvanced: (dateTypeKey?: string, calculationTypeKey?: string, calculationDateKey?: any, value?: number, dateFormat?: string) => any;
|
|
19
|
+
/**
|
|
20
|
+
* Get text of calendar cell base on valueType (semantic/date format)
|
|
21
|
+
* @link https://ant.design/components/date-picker#components-date-picker-demo-cell-render
|
|
22
|
+
* @param {number | Dayjs} current params of cellRender function
|
|
23
|
+
* @param {CellRenderInfo<Dayjs>} info params of cellRender function
|
|
24
|
+
* @param {ValueTypes} valueType type of value (get from component props)
|
|
25
|
+
* @returns {number | string} label of cell according to valueType
|
|
26
|
+
*/
|
|
27
|
+
export declare const getCellRender: (current: number | Dayjs, valueType: ValueTypes, info: CellRenderInfo<Dayjs>) => number | string;
|
|
28
|
+
/**
|
|
29
|
+
* @param {ValueTypes} valueType type of value (get from component props)
|
|
30
|
+
* @returns {'date' | 'week' | 'month' | 'quarter' | 'year'} picker ant-design props to render type of calendar
|
|
31
|
+
*/
|
|
32
|
+
export declare const getPickerRender: (valueType: ValueTypes) => 'date' | 'week' | 'month' | 'quarter' | 'year';
|
|
33
|
+
export declare const getTimePickerRender: (valueType: ValueTypes) => "HH" | "HHmm" | "HHmmss" | "mm" | undefined;
|
|
34
|
+
export declare function getLabelQuarterRange(day: string, format: string, locale: string, showYear?: boolean): string;
|
|
35
|
+
export declare function getLabelQuarterRange(quarter: number, year?: number): string;
|
|
@@ -4,7 +4,7 @@ import dayjs from 'dayjs';
|
|
|
4
4
|
import isoWeek from 'dayjs/plugin/isoWeek';
|
|
5
5
|
import quarterOfYear from 'dayjs/plugin/quarterOfYear';
|
|
6
6
|
// Constants
|
|
7
|
-
import { DEFAULT_DATE_FORMAT } from './constants';
|
|
7
|
+
import { DEFAULT_DATE_FORMAT, MONTH_LABEL_SHORT } from './constants';
|
|
8
8
|
dayjs.extend(isoWeek);
|
|
9
9
|
dayjs.extend(quarterOfYear);
|
|
10
10
|
/**
|
|
@@ -82,3 +82,92 @@ export const calculationDateAdvanced = (dateTypeKey = 'today', calculationTypeKe
|
|
|
82
82
|
}
|
|
83
83
|
return newDate.format(dateFormat);
|
|
84
84
|
};
|
|
85
|
+
/**
|
|
86
|
+
* Get text of calendar cell base on valueType (semantic/date format)
|
|
87
|
+
* @link https://ant.design/components/date-picker#components-date-picker-demo-cell-render
|
|
88
|
+
* @param {number | Dayjs} current params of cellRender function
|
|
89
|
+
* @param {CellRenderInfo<Dayjs>} info params of cellRender function
|
|
90
|
+
* @param {ValueTypes} valueType type of value (get from component props)
|
|
91
|
+
* @returns {number | string} label of cell according to valueType
|
|
92
|
+
*/
|
|
93
|
+
export const getCellRender = (current, valueType, info) => {
|
|
94
|
+
if (typeof current === 'number')
|
|
95
|
+
return current;
|
|
96
|
+
if (info.type === 'decade')
|
|
97
|
+
return `${current.year()}-${current.year() + 10}`;
|
|
98
|
+
if (info.type === 'year')
|
|
99
|
+
return current.year();
|
|
100
|
+
if (info.type === 'month')
|
|
101
|
+
return MONTH_LABEL_SHORT[current.month()];
|
|
102
|
+
switch (valueType) {
|
|
103
|
+
case 'DAY':
|
|
104
|
+
return current.date();
|
|
105
|
+
case 'QUARTER':
|
|
106
|
+
case 'YEAR_QUARTER':
|
|
107
|
+
return `Quarter ${current.quarter()}`;
|
|
108
|
+
case 'MONTH':
|
|
109
|
+
case 'YEAR_MONTH':
|
|
110
|
+
return MONTH_LABEL_SHORT[current.month()];
|
|
111
|
+
case 'WEEK':
|
|
112
|
+
return current.isoWeek();
|
|
113
|
+
default:
|
|
114
|
+
return current.date();
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* @param {ValueTypes} valueType type of value (get from component props)
|
|
119
|
+
* @returns {'date' | 'week' | 'month' | 'quarter' | 'year'} picker ant-design props to render type of calendar
|
|
120
|
+
*/
|
|
121
|
+
export const getPickerRender = (valueType) => {
|
|
122
|
+
switch (valueType) {
|
|
123
|
+
case 'DAY':
|
|
124
|
+
return 'date';
|
|
125
|
+
case 'YEAR':
|
|
126
|
+
return 'year';
|
|
127
|
+
case 'QUARTER':
|
|
128
|
+
case 'YEAR_QUARTER':
|
|
129
|
+
return 'quarter';
|
|
130
|
+
case 'MONTH':
|
|
131
|
+
case 'YEAR_MONTH':
|
|
132
|
+
return 'month';
|
|
133
|
+
case 'WEEK':
|
|
134
|
+
case 'YEAR_WEEK':
|
|
135
|
+
return 'week';
|
|
136
|
+
default:
|
|
137
|
+
return 'date';
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
export const getTimePickerRender = (valueType) => {
|
|
141
|
+
switch (valueType) {
|
|
142
|
+
case 'HOUR':
|
|
143
|
+
case 'YEAR_MONTH_DAY_HOUR':
|
|
144
|
+
return 'HH';
|
|
145
|
+
case 'YEAR_MONTH_DAY_MINUTE':
|
|
146
|
+
return 'HHmm';
|
|
147
|
+
case 'YEAR_MONTH_DAY_SECOND':
|
|
148
|
+
return 'HHmmss';
|
|
149
|
+
case 'MINUTE':
|
|
150
|
+
return 'mm';
|
|
151
|
+
default:
|
|
152
|
+
return undefined;
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
export function getLabelQuarterRange(quarterOrDay, yearOrFormat, locale, showYear = true) {
|
|
156
|
+
const dayObj = typeof quarterOrDay === 'number'
|
|
157
|
+
? null
|
|
158
|
+
: dayjs(quarterOrDay || new Date(), yearOrFormat).locale(locale || 'en');
|
|
159
|
+
const currQuarter = dayObj ? dayObj.quarter() : quarterOrDay;
|
|
160
|
+
const currYear = dayObj
|
|
161
|
+
? showYear
|
|
162
|
+
? dayObj.year()
|
|
163
|
+
: null
|
|
164
|
+
: typeof yearOrFormat === 'number'
|
|
165
|
+
? yearOrFormat
|
|
166
|
+
: null;
|
|
167
|
+
const startMonthQuarter = [undefined, 'January', 'April', 'July', 'October'];
|
|
168
|
+
const endMonthQuarter = [undefined, 'March', 'June', 'September', 'December'];
|
|
169
|
+
const endDayQuarter = [undefined, 31, 30, 30, 31];
|
|
170
|
+
return currYear
|
|
171
|
+
? `${startMonthQuarter[currQuarter]} 01, ${currYear} - ${endMonthQuarter[currQuarter]} ${endDayQuarter[currQuarter]}, ${currYear}`
|
|
172
|
+
: `${startMonthQuarter[currQuarter]} 01 - ${endMonthQuarter[currQuarter]} ${endDayQuarter[currQuarter]}`;
|
|
173
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Form } from 'antd';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Form } from 'antd';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Form } from './Form';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Form } from './Form';
|
|
@@ -2,14 +2,7 @@
|
|
|
2
2
|
export declare const IconSelectionWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
3
|
export declare const WrapperListRender: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
4
|
export declare const WrapperListItemRender: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
|
-
export declare const CustomButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<
|
|
6
|
-
href: string;
|
|
7
|
-
target?: string | undefined;
|
|
8
|
-
onClick?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
9
|
-
} & import("antd/es/button/button").BaseButtonProps & Omit<import("react").AnchorHTMLAttributes<HTMLAnchorElement | HTMLButtonElement>, "type" | "onClick"> & {
|
|
10
|
-
htmlType?: "button" | "reset" | "submit" | undefined;
|
|
11
|
-
onClick?: import("react").MouseEventHandler<HTMLButtonElement> | undefined;
|
|
12
|
-
} & Omit<import("react").ButtonHTMLAttributes<HTMLButtonElement>, "type" | "onClick">> & import("react").RefAttributes<HTMLElement>> & {
|
|
5
|
+
export declare const CustomButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd").ButtonProps & import("react").RefAttributes<HTMLElement>> & {
|
|
13
6
|
Group: import("react").FC<import("antd/es/button").ButtonGroupProps>;
|
|
14
7
|
}, any, {}, never>;
|
|
15
8
|
export declare const Overlay: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -14,10 +14,10 @@ export declare const Modal: string & import("styled-components").StyledComponent
|
|
|
14
14
|
useModal: typeof import("antd/es/modal/useModal").default;
|
|
15
15
|
destroyAll: () => void;
|
|
16
16
|
config: typeof import("antd/es/modal/confirm").modalGlobalConfig;
|
|
17
|
-
_InternalPanelDoNotUseOrYouWillBeFired:
|
|
17
|
+
_InternalPanelDoNotUseOrYouWillBeFired: (props: any) => React.JSX.Element;
|
|
18
18
|
}, any, import("./styled").CustomModalProps, never> & import("hoist-non-react-statics").NonReactStatics<React.FC<AntdModalProps> & import("antd/es/modal/confirm").ModalStaticFunctions & {
|
|
19
19
|
useModal: typeof import("antd/es/modal/useModal").default;
|
|
20
20
|
destroyAll: () => void;
|
|
21
21
|
config: typeof import("antd/es/modal/confirm").modalGlobalConfig;
|
|
22
|
-
_InternalPanelDoNotUseOrYouWillBeFired:
|
|
22
|
+
_InternalPanelDoNotUseOrYouWillBeFired: (props: any) => React.JSX.Element;
|
|
23
23
|
}, {}> & React.FC<ModalProps>;
|
|
@@ -10,6 +10,6 @@ export declare const StyledModal: import("styled-components").StyledComponent<im
|
|
|
10
10
|
useModal: typeof import("antd/es/modal/useModal").default;
|
|
11
11
|
destroyAll: () => void;
|
|
12
12
|
config: typeof import("antd/es/modal/confirm").modalGlobalConfig;
|
|
13
|
-
_InternalPanelDoNotUseOrYouWillBeFired:
|
|
13
|
+
_InternalPanelDoNotUseOrYouWillBeFired: (props: any) => import("react").JSX.Element;
|
|
14
14
|
}, any, CustomModalProps, never>;
|
|
15
15
|
export declare const WrapperSpin: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
// Libraries
|
|
13
|
+
import React from 'react';
|
|
14
|
+
import { StyledModal } from './styled';
|
|
15
|
+
// Components
|
|
16
|
+
import { Button, Flex } from '../../atoms';
|
|
17
|
+
export const ModalV2 = props => {
|
|
18
|
+
const { okButtonProps, cancelButtonProps, okText, cancelText, onCancel, onOk } = props;
|
|
19
|
+
const restOfProps = __rest(props, []);
|
|
20
|
+
return (React.createElement(StyledModal, Object.assign({ footer: React.createElement(Flex, { gap: 10, align: "center" },
|
|
21
|
+
React.createElement(Button, Object.assign({ type: "primary", onClick: onOk }, okButtonProps), okText || 'OK'),
|
|
22
|
+
React.createElement(Button, Object.assign({ onClick: onCancel }, cancelButtonProps), cancelText || 'Cancel')) }, restOfProps)));
|
|
23
|
+
};
|
|
24
|
+
ModalV2.defaultProps = {
|
|
25
|
+
// footer,
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ModalV2';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledModal: import("styled-components").StyledComponent<import("react").FC<import("antd").ModalProps> & import("antd/es/modal/confirm").ModalStaticFunctions & {
|
|
3
|
+
useModal: typeof import("antd/es/modal/useModal").default;
|
|
4
|
+
destroyAll: () => void;
|
|
5
|
+
config: typeof import("antd/es/modal/confirm").modalGlobalConfig;
|
|
6
|
+
_InternalPanelDoNotUseOrYouWillBeFired: (props: any) => import("react").JSX.Element;
|
|
7
|
+
}, any, {}, never>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
import { Modal } from 'antd';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
export const StyledModal = styled(Modal) `
|
|
5
|
+
.antsomi-modal-content {
|
|
6
|
+
.antsomi-modal-close {
|
|
7
|
+
position: absolute;
|
|
8
|
+
top: 10px !important;
|
|
9
|
+
right: 10px !important;
|
|
10
|
+
width: 24px !important;
|
|
11
|
+
height: 24px !important;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.antsomi-modal-body {
|
|
15
|
+
padding: 15px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.antsomi-modal-header {
|
|
19
|
+
padding: 15px 15px 0px 15px;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const Popconfirm: import("react").ForwardRefExoticComponent<import("antd").PopconfirmProps & import("react").RefAttributes<unknown>> & {
|
|
3
|
-
_InternalPanelDoNotUseOrYouWillBeFired:
|
|
3
|
+
_InternalPanelDoNotUseOrYouWillBeFired: import("react").FC<import("antd/es/popconfirm/PurePanel").PurePanelProps>;
|
|
4
4
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
// Libraries
|
|
13
|
+
import React from 'react';
|
|
14
|
+
import i18nInstance from '@antscorp/antsomi-ui/es/locales/i18n';
|
|
15
|
+
import { Button, Icon } from '../../atoms';
|
|
16
|
+
// Styled
|
|
17
|
+
import { ModalBody, ModalHeader, StyledModal } from './styled';
|
|
18
|
+
// Utils
|
|
19
|
+
import { translations } from '@antscorp/antsomi-ui/es/locales/translations';
|
|
20
|
+
export const PreviewModal = props => {
|
|
21
|
+
const { onCancel } = props;
|
|
22
|
+
const { children, modalHeaderClassName, modalBodyClassName } = props, restProps = __rest(props, ["children", "modalHeaderClassName", "modalBodyClassName"]);
|
|
23
|
+
const { t } = i18nInstance;
|
|
24
|
+
return (React.createElement(StyledModal, Object.assign({}, restProps, { centered: true, closeIcon: null, footer: null, width: "100vw" }),
|
|
25
|
+
React.createElement(ModalHeader, { className: modalHeaderClassName },
|
|
26
|
+
React.createElement(Button, { className: "close-btn", onClick: onCancel },
|
|
27
|
+
React.createElement(Icon, { type: "icon-ants-remove-slim", size: 12 }),
|
|
28
|
+
t(translations.close))),
|
|
29
|
+
React.createElement(ModalBody, { className: modalBodyClassName }, children)));
|
|
30
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PreviewModal } from './PreviewModal';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledModal: import("styled-components").StyledComponent<import("react").FC<import("../ModalV2").ModalV2Props>, any, {}, never>;
|
|
3
|
+
export declare const ModalHeader: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/flex/interface").FlexProps<import("antd/es/_util/type").AnyObject> & import("react").RefAttributes<HTMLElement>>, any, {}, never>;
|
|
4
|
+
export declare const ModalBody: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
// Components
|
|
4
|
+
import { ModalV2 } from '../ModalV2';
|
|
5
|
+
import { Flex } from '@antscorp/antsomi-ui/es/components/atoms';
|
|
6
|
+
const HEADER_HEIGHT = '50px';
|
|
7
|
+
export const StyledModal = styled(ModalV2) `
|
|
8
|
+
max-width: 100vw !important;
|
|
9
|
+
|
|
10
|
+
.antsomi-modal-content {
|
|
11
|
+
border-radius: 0px;
|
|
12
|
+
height: 100vh;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.antsomi-modal-body {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
height: 100%;
|
|
19
|
+
padding: 0px !important;
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
export const ModalHeader = styled(Flex) `
|
|
23
|
+
height: ${HEADER_HEIGHT};
|
|
24
|
+
border-bottom: 1px solid #c2cee0;
|
|
25
|
+
box-shadow: 0px 2px 3px rgba(15, 19, 23, 0.1);
|
|
26
|
+
flex-shrink: 0;
|
|
27
|
+
|
|
28
|
+
.close-btn {
|
|
29
|
+
position: absolute;
|
|
30
|
+
right: 15px;
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
ModalHeader.defaultProps = {
|
|
34
|
+
align: 'center',
|
|
35
|
+
justify: 'center',
|
|
36
|
+
};
|
|
37
|
+
export const ModalBody = styled.div.attrs({}) `
|
|
38
|
+
overflow: auto;
|
|
39
|
+
`;
|