@antscorp/antsomi-ui 1.3.5-beta.7 → 1.3.5-beta.71
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/background/skeleton-background.png +0 -0
- package/es/assets/images/components/PreviewModal/Banner/skeletonBackground.png +0 -0
- package/es/assets/images/components/PreviewModal/Information/buttonText.png +0 -0
- package/es/assets/images/components/PreviewModal/Information/clickButton.png +0 -0
- package/es/assets/images/components/PreviewModal/Information/description.png +0 -0
- package/es/assets/images/components/PreviewModal/Information/deviceRadio.png +0 -0
- package/es/assets/images/components/PreviewModal/Information/itemName.png +0 -0
- package/es/assets/images/components/PreviewModal/banner.png +0 -0
- package/es/assets/images/components/PreviewModal/information.png +0 -0
- package/es/assets/images/components/PreviewModal/similarTemplate.png +0 -0
- package/es/assets/images/components/PreviewModal/thumbnails.png +0 -0
- package/es/assets/images/components/TemplateListing/blankTemplate.png +0 -0
- package/es/assets/images/components/TemplateListing/categoryListing.png +0 -0
- package/es/assets/images/components/TemplateListing/empty.png +0 -0
- package/es/assets/images/components/TemplateListing/previewModal.png +0 -0
- package/es/assets/images/components/TemplateListing/templateItem.png +0 -0
- package/es/assets/images/components/TemplateListing/templates.png +0 -0
- package/es/assets/images/profile.png +0 -0
- package/es/assets/images/skeleton_bg.png +0 -0
- package/es/assets/images/tail.png +0 -0
- package/es/assets/svg/mobile-frame.svg +3 -0
- package/es/components/atoms/MobileFrame/MobileFrame.d.ts +2 -0
- package/es/components/atoms/MobileFrame/MobileFrame.js +1 -1
- package/es/components/atoms/MobileFrame/styled.d.ts +2 -1
- package/es/components/atoms/MobileFrame/styled.js +11 -6
- package/es/components/atoms/SlideBar/SlideBar.js +1 -1
- package/es/components/atoms/Spin/Spin.js +2 -2
- package/es/components/common/ConfigProvider/ConfigProvider.js +4 -3
- package/es/components/common/ConfigProvider/GlobalStyle.js +85 -16
- package/es/components/molecules/AddDynamicContent/AddDynamicContent.js +3 -2
- package/es/components/molecules/CalendarSelection/CalendarSelection.d.ts +3 -0
- package/es/components/molecules/CalendarSelection/CalendarSelection.js +45 -0
- package/es/components/molecules/CalendarSelection/actions.d.ts +55 -0
- package/es/components/molecules/CalendarSelection/actions.js +39 -0
- package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/AutoUpdateTo.d.ts +7 -0
- package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/AutoUpdateTo.js +24 -0
- package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/index.d.ts +1 -0
- package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/index.js +1 -0
- package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/styled.d.ts +1 -0
- package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/styled.js +10 -0
- package/es/components/molecules/CalendarSelection/components/CustomPicker/CustomPicker.d.ts +3 -0
- package/es/components/molecules/CalendarSelection/components/CustomPicker/CustomPicker.js +108 -0
- package/es/components/molecules/CalendarSelection/components/CustomPicker/index.d.ts +1 -0
- package/es/components/molecules/CalendarSelection/components/CustomPicker/index.js +1 -0
- package/es/components/molecules/CalendarSelection/components/CustomPicker/styled.d.ts +6 -0
- package/es/components/molecules/CalendarSelection/components/CustomPicker/styled.js +152 -0
- package/es/components/molecules/CalendarSelection/components/CustomPicker/types.d.ts +1 -0
- package/es/components/molecules/CalendarSelection/components/CustomPicker/types.js +1 -0
- package/es/components/molecules/CalendarSelection/components/Footer/Footer.d.ts +2 -0
- package/es/components/molecules/CalendarSelection/components/Footer/Footer.js +11 -0
- package/es/components/molecules/CalendarSelection/components/Footer/index.d.ts +1 -0
- package/es/components/molecules/CalendarSelection/components/Footer/index.js +1 -0
- package/es/components/molecules/CalendarSelection/components/Footer/styled.d.ts +1 -0
- package/es/components/molecules/CalendarSelection/components/Footer/styled.js +6 -0
- package/es/components/molecules/CalendarSelection/components/RangePicker/RangePicker.d.ts +5 -0
- package/es/components/molecules/CalendarSelection/components/RangePicker/RangePicker.js +4 -0
- package/es/components/molecules/CalendarSelection/components/RangePicker/index.d.ts +1 -0
- package/es/components/molecules/CalendarSelection/components/RangePicker/index.js +1 -0
- package/es/components/molecules/CalendarSelection/components/RangePicker/styled.d.ts +5 -0
- package/es/components/molecules/CalendarSelection/components/RangePicker/styled.js +13 -0
- package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/RangeSelectOptions.d.ts +3 -0
- package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/RangeSelectOptions.js +23 -0
- package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/NumOfDaysRanges/NumOfDaysRanges.d.ts +2 -0
- package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/NumOfDaysRanges/NumOfDaysRanges.js +41 -0
- package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/NumOfDaysRanges/index.d.ts +1 -0
- package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/NumOfDaysRanges/index.js +1 -0
- package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/Option.d.ts +11 -0
- package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/Option.js +40 -0
- package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/index.d.ts +1 -0
- package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/index.js +1 -0
- package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/styled.d.ts +1 -0
- package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/styled.js +29 -0
- package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/index.d.ts +2 -0
- package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/index.js +2 -0
- package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/index.d.ts +1 -0
- package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/index.js +1 -0
- package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/styled.d.ts +3 -0
- package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/styled.js +34 -0
- package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/types.d.ts +1 -0
- package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/types.js +1 -0
- package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/TimeRangeDisplay.d.ts +8 -0
- package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/TimeRangeDisplay.js +49 -0
- package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/index.d.ts +2 -0
- package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/index.js +2 -0
- package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/styled.d.ts +1 -0
- package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/styled.js +70 -0
- package/es/components/molecules/CalendarSelection/components/index.d.ts +5 -0
- package/es/components/molecules/CalendarSelection/components/index.js +5 -0
- package/es/components/molecules/CalendarSelection/constants.d.ts +97 -0
- package/es/components/molecules/CalendarSelection/constants.js +183 -0
- package/es/components/molecules/CalendarSelection/context.d.ts +4 -0
- package/es/components/molecules/CalendarSelection/context.js +6 -0
- package/es/components/molecules/CalendarSelection/hooks/index.d.ts +2 -0
- package/es/components/molecules/CalendarSelection/hooks/index.js +2 -0
- package/es/components/molecules/CalendarSelection/hooks/useStateContext.d.ts +4 -0
- package/es/components/molecules/CalendarSelection/hooks/useStateContext.js +13 -0
- package/es/components/molecules/CalendarSelection/hooks/useTriggerOut.d.ts +9 -0
- package/es/components/molecules/CalendarSelection/hooks/useTriggerOut.js +19 -0
- package/es/components/molecules/CalendarSelection/index.d.ts +25 -0
- package/es/components/molecules/CalendarSelection/index.js +6 -0
- package/es/components/molecules/CalendarSelection/reducer.d.ts +3 -0
- package/es/components/molecules/CalendarSelection/reducer.js +121 -0
- package/es/components/molecules/CalendarSelection/styled.d.ts +6 -0
- package/es/components/molecules/CalendarSelection/styled.js +13 -0
- package/es/components/molecules/CalendarSelection/types.d.ts +98 -0
- package/es/components/molecules/CalendarSelection/types.js +1 -0
- package/es/components/molecules/CalendarSelection/utils.d.ts +52 -0
- package/es/components/molecules/CalendarSelection/utils.js +304 -0
- package/es/components/molecules/ColorPicker/CustomPicker/index.js +3 -3
- package/es/components/molecules/ColorPicker/index.d.ts +1 -0
- package/es/components/molecules/ColorPicker/index.js +3 -2
- package/es/components/molecules/DatePicker/components/AdvancedPicker/AdvancedPicker.js +20 -16
- package/es/components/molecules/DatePicker/components/AdvancedPicker/styled.d.ts +3 -0
- package/es/components/molecules/DatePicker/components/AdvancedPicker/styled.js +23 -0
- package/es/components/molecules/DatePicker/components/AdvancedPicker/utils.d.ts +1 -1
- package/es/components/molecules/DatePicker/components/AdvancedPicker/utils.js +2 -2
- package/es/components/molecules/DatePicker/components/AdvancedRangePicker/AdvancedRangePicker.d.ts +1 -0
- package/es/components/molecules/DatePicker/components/AdvancedRangePicker/AdvancedRangePicker.js +3 -3
- package/es/components/molecules/DatePicker/components/DropdownLabel/DropdownLabel.js +2 -2
- package/es/components/molecules/ModalV2/styled.js +4 -0
- package/es/components/molecules/ResizeGrid/ResizeGrid.js +10 -2
- package/es/components/molecules/ResizeGrid/types.d.ts +1 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuBlock.d.ts +1 -0
- package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuBlock.js +2 -2
- package/es/components/molecules/RichMenu/RichMenuChatBar/RichMenuChatBar.d.ts +1 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/RichMenuChatBar.js +4 -3
- package/es/components/molecules/RichMenu/RichMenuChatBar/styled.d.ts +1 -0
- package/es/components/molecules/RichMenu/RichMenuChatBar/styled.js +1 -1
- package/es/components/molecules/RichMenu/RichMenuMobileView/RichMenuMobileView.d.ts +7 -0
- package/es/components/molecules/RichMenu/RichMenuMobileView/RichMenuMobileView.js +25 -6
- package/es/components/molecules/RichMenu/RichMenuMobileView/styled.d.ts +5 -0
- package/es/components/molecules/RichMenu/RichMenuMobileView/styled.js +31 -0
- package/es/components/molecules/ShareAccess/components/GeneralAccess/GeneralAccess.js +2 -2
- package/es/components/molecules/ShareAccess/components/GeneralAccess/styled.js +1 -0
- package/es/components/molecules/ShareAccess/components/LayoutContent/LayoutContent.js +2 -2
- package/es/components/molecules/ShareAccess/components/PeopleAccess/PeopleAccess.js +1 -1
- package/es/components/molecules/ShareAccess/index.d.ts +2 -3
- package/es/components/molecules/ShareAccess/index.js +2 -3
- package/es/components/molecules/ShareAccess/types.d.ts +2 -0
- package/es/components/molecules/ShareAccess/utils.d.ts +2 -1
- package/es/components/molecules/ShareAccess/utils.js +9 -0
- package/es/components/molecules/TemplateSaveAs/TemplateSaveAs.d.ts +79 -0
- package/es/components/molecules/TemplateSaveAs/TemplateSaveAs.js +184 -0
- package/es/components/molecules/TemplateSaveAs/TemplateSaveAsModal.d.ts +10 -0
- package/es/components/molecules/TemplateSaveAs/TemplateSaveAsModal.js +50 -0
- package/es/components/molecules/TemplateSaveAs/components/ImageSlider/ImageSlider.d.ts +20 -0
- package/es/components/molecules/TemplateSaveAs/components/ImageSlider/ImageSlider.js +57 -0
- package/es/components/molecules/TemplateSaveAs/components/ImageSlider/index.d.ts +1 -0
- package/es/components/molecules/TemplateSaveAs/components/ImageSlider/index.js +1 -0
- package/es/components/molecules/TemplateSaveAs/components/ImageSlider/styled.d.ts +9 -0
- package/es/components/molecules/TemplateSaveAs/components/ImageSlider/styled.js +182 -0
- package/es/components/molecules/TemplateSaveAs/components/index.d.ts +1 -0
- package/es/components/molecules/TemplateSaveAs/components/index.js +1 -0
- package/es/components/molecules/TemplateSaveAs/hooks/useTemplateSave.d.ts +65 -0
- package/es/components/molecules/TemplateSaveAs/hooks/useTemplateSave.js +121 -0
- package/es/components/molecules/TemplateSaveAs/index.d.ts +4 -0
- package/es/components/molecules/TemplateSaveAs/index.js +3 -0
- package/es/components/molecules/TemplateSaveAs/styled.d.ts +4 -0
- package/es/components/molecules/TemplateSaveAs/styled.js +73 -0
- package/es/components/molecules/ThumbnailCard/ThumbnailCard.js +29 -13
- package/es/components/molecules/ThumbnailCard/constants.d.ts +2 -2
- package/es/components/molecules/ThumbnailCard/constants.js +2 -2
- package/es/components/molecules/ThumbnailCard/styled.js +2 -1
- package/es/components/molecules/ThumbnailCard/types.d.ts +12 -6
- package/es/components/molecules/UploadImage/index.js +1 -1
- package/es/components/molecules/index.d.ts +3 -0
- package/es/components/molecules/index.js +2 -0
- package/es/components/organism/Help/Help.js +30 -1
- package/es/components/organism/Menu/Menu.d.ts +2 -0
- package/es/components/organism/Menu/Menu.js +2 -0
- package/es/components/organism/Menu/index.d.ts +1 -0
- package/es/components/organism/Menu/index.js +1 -0
- package/es/components/organism/PreviewTemplateModal/components/Banner/index.d.ts +3 -0
- package/es/components/organism/PreviewTemplateModal/components/Banner/index.js +13 -0
- package/es/components/organism/PreviewTemplateModal/components/Banner/styled.d.ts +4 -0
- package/es/components/organism/PreviewTemplateModal/components/Banner/styled.js +98 -0
- package/es/components/organism/PreviewTemplateModal/components/Information/index.d.ts +3 -0
- package/es/components/organism/PreviewTemplateModal/components/Information/index.js +29 -0
- package/es/components/organism/PreviewTemplateModal/components/Information/styled.d.ts +2 -0
- package/es/components/organism/PreviewTemplateModal/components/Information/styled.js +41 -0
- package/es/components/organism/PreviewTemplateModal/components/SimilarTemplate/index.d.ts +3 -0
- package/es/components/organism/PreviewTemplateModal/components/SimilarTemplate/index.js +32 -0
- package/es/components/organism/PreviewTemplateModal/components/SimilarTemplate/styled.d.ts +2 -0
- package/es/components/organism/PreviewTemplateModal/components/SimilarTemplate/styled.js +12 -0
- package/es/components/organism/PreviewTemplateModal/components/ThumbnailSlider/index.d.ts +6 -0
- package/es/components/organism/PreviewTemplateModal/components/ThumbnailSlider/index.js +77 -0
- package/es/components/organism/PreviewTemplateModal/components/ThumbnailSlider/styled.d.ts +3 -0
- package/es/components/organism/PreviewTemplateModal/components/ThumbnailSlider/styled.js +62 -0
- package/es/components/organism/PreviewTemplateModal/components/index.d.ts +4 -0
- package/es/components/organism/PreviewTemplateModal/components/index.js +4 -0
- package/es/components/organism/PreviewTemplateModal/constants/dataSample.d.ts +2 -0
- package/es/components/organism/PreviewTemplateModal/constants/dataSample.js +9 -0
- package/es/components/organism/PreviewTemplateModal/constants/defaultProps.d.ts +8 -0
- package/es/components/organism/PreviewTemplateModal/constants/defaultProps.js +12 -0
- package/es/components/organism/PreviewTemplateModal/constants/html.d.ts +1 -0
- package/es/components/organism/PreviewTemplateModal/constants/html.js +1 -0
- package/es/components/organism/PreviewTemplateModal/constants/index.d.ts +4 -0
- package/es/components/organism/PreviewTemplateModal/constants/index.js +4 -0
- package/es/components/organism/PreviewTemplateModal/constants/variables.d.ts +12 -0
- package/es/components/organism/PreviewTemplateModal/constants/variables.js +12 -0
- package/es/components/organism/PreviewTemplateModal/index.d.ts +3 -0
- package/es/components/organism/PreviewTemplateModal/index.js +34 -0
- package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/BannerPropsTable/index.d.ts +2 -0
- package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/BannerPropsTable/index.js +34 -0
- package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/DataTypeTable/index.d.ts +2 -0
- package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/DataTypeTable/index.js +62 -0
- package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/InformationPropsTable/index.d.ts +2 -0
- package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/InformationPropsTable/index.js +76 -0
- package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/SimilarTemplatePropsTable/index.d.ts +2 -0
- package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/SimilarTemplatePropsTable/index.js +40 -0
- package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/TThumbnailTable/index.d.ts +2 -0
- package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/TThumbnailTable/index.js +30 -0
- package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/ThumbnailPropsTable/index.d.ts +2 -0
- package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/ThumbnailPropsTable/index.js +46 -0
- package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/index.d.ts +6 -0
- package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/index.js +6 -0
- package/es/components/organism/PreviewTemplateModal/styled.d.ts +4 -0
- package/es/components/organism/PreviewTemplateModal/styled.js +26 -0
- package/es/components/organism/PreviewTemplateModal/types.d.ts +38 -0
- package/es/components/organism/PreviewTemplateModal/types.js +1 -0
- package/es/components/organism/index.d.ts +1 -0
- package/es/components/organism/index.js +1 -0
- package/es/components/template/TemplateListing/Loadable.d.ts +6 -0
- package/es/components/template/TemplateListing/Loadable.js +7 -0
- package/es/components/template/TemplateListing/components/BlankTemplate/index.js +3 -1
- package/es/components/template/TemplateListing/components/CategoryListing/index.js +19 -10
- package/es/components/template/TemplateListing/components/CategoryListing/styled.d.ts +2 -0
- package/es/components/template/TemplateListing/components/CategoryListing/styled.js +50 -8
- package/es/components/template/TemplateListing/components/Empty/index.d.ts +3 -0
- package/es/components/template/TemplateListing/components/Empty/index.js +18 -0
- package/es/components/template/TemplateListing/components/Empty/styled.d.ts +3 -0
- package/es/components/template/TemplateListing/components/Empty/styled.js +35 -0
- package/es/components/template/TemplateListing/components/index.d.ts +1 -0
- package/es/components/template/TemplateListing/components/index.js +1 -0
- package/es/components/template/TemplateListing/constants/defaultProps.d.ts +5 -3
- package/es/components/template/TemplateListing/constants/defaultProps.js +8 -7
- package/es/components/template/TemplateListing/hooks/index.d.ts +1 -0
- package/es/components/template/TemplateListing/hooks/index.js +1 -0
- package/es/components/template/TemplateListing/hooks/useTemplateListing.d.ts +62 -0
- package/es/components/template/TemplateListing/hooks/useTemplateListing.js +230 -0
- package/es/components/template/TemplateListing/index.js +75 -14
- package/es/components/template/TemplateListing/stories/dataTypes/components/BlankTemplatePropsTable/index.d.ts +2 -0
- package/es/components/template/TemplateListing/stories/dataTypes/components/BlankTemplatePropsTable/index.js +46 -0
- package/es/components/template/TemplateListing/stories/dataTypes/components/CategoryListingPropsTable/index.d.ts +2 -0
- package/es/components/template/TemplateListing/stories/dataTypes/components/CategoryListingPropsTable/index.js +57 -0
- package/es/components/template/TemplateListing/stories/dataTypes/components/DataTypeTables/index.d.ts +2 -0
- package/es/components/template/TemplateListing/stories/dataTypes/components/DataTypeTables/index.js +78 -0
- package/es/components/template/TemplateListing/stories/dataTypes/components/EmptyPropsTable/index.d.ts +2 -0
- package/es/components/template/TemplateListing/stories/dataTypes/components/EmptyPropsTable/index.js +30 -0
- package/es/components/template/TemplateListing/stories/dataTypes/components/TCategoryItemTable/index.d.ts +2 -0
- package/es/components/template/TemplateListing/stories/dataTypes/components/TCategoryItemTable/index.js +46 -0
- package/es/components/template/TemplateListing/stories/dataTypes/components/TTemplateItemTable/index.d.ts +2 -0
- package/es/components/template/TemplateListing/stories/dataTypes/components/TTemplateItemTable/index.js +38 -0
- package/es/components/template/TemplateListing/stories/dataTypes/components/TemplatesPropsTable/index.d.ts +2 -0
- package/es/components/template/TemplateListing/stories/dataTypes/components/TemplatesPropsTable/index.js +50 -0
- package/es/components/template/TemplateListing/stories/dataTypes/components/index.d.ts +7 -0
- package/es/components/template/TemplateListing/stories/dataTypes/components/index.js +7 -0
- package/es/components/template/TemplateListing/stories/demo/styled.d.ts +1 -0
- package/es/components/template/TemplateListing/stories/demo/styled.js +7 -0
- package/es/components/template/TemplateListing/styled/index.d.ts +1 -0
- package/es/components/template/TemplateListing/styled/index.js +24 -5
- package/es/components/template/TemplateListing/types/BlankTemplate.d.ts +1 -1
- package/es/components/template/TemplateListing/types/CategoryListing.d.ts +5 -2
- package/es/components/template/TemplateListing/types/Empty.d.ts +5 -0
- package/es/components/template/TemplateListing/types/Empty.js +1 -0
- package/es/components/template/TemplateListing/types/TemplateListing.d.ts +16 -6
- package/es/components/template/index.d.ts +2 -1
- package/es/components/template/index.js +5 -1
- package/es/constants/datetime.d.ts +8 -0
- package/es/constants/datetime.js +1594 -0
- package/es/constants/index.d.ts +5 -1
- package/es/constants/index.js +5 -1
- package/es/constants/queries.d.ts +4 -0
- package/es/constants/queries.js +5 -0
- package/es/constants/templateListing.d.ts +50 -0
- package/es/constants/templateListing.js +52 -0
- package/es/constants/theme.js +1 -1
- package/es/constants/variables.d.ts +19 -0
- package/es/constants/variables.js +19 -0
- package/es/hooks/index.d.ts +4 -0
- package/es/hooks/index.js +4 -0
- package/es/hooks/useEffectOnlyOnce.d.ts +2 -0
- package/es/hooks/useEffectOnlyOnce.js +12 -0
- package/es/hooks/useForceUpdate.d.ts +1 -0
- package/es/hooks/useForceUpdate.js +5 -0
- package/es/hooks/useIntersectionObserver.d.ts +57 -0
- package/es/hooks/useIntersectionObserver.js +97 -0
- package/es/hooks/useListingItemResize.d.ts +12 -0
- package/es/hooks/useListingItemResize.js +58 -0
- package/es/hooks/useScrollToEnd.d.ts +1 -0
- package/es/hooks/useScrollToEnd.js +30 -0
- package/es/index.d.ts +3 -0
- package/es/index.js +3 -0
- package/es/locales/en/translation.json +9 -1
- package/es/locales/i18n.d.ts +16 -0
- package/es/locales/translations.d.ts +8 -0
- package/es/locales/vi/translation.json +9 -1
- package/es/models/ObjectTemplate.d.ts +56 -0
- package/es/models/ObjectTemplate.js +82 -0
- package/es/models/TemplateCategory.d.ts +13 -0
- package/es/models/TemplateCategory.js +28 -0
- package/es/queries/CustomFunction/useCustomFunction.js +35 -35
- package/es/queries/TemplateListing/index.d.ts +52 -0
- package/es/queries/TemplateListing/index.js +105 -0
- package/es/queries/index.d.ts +1 -0
- package/es/queries/index.js +1 -0
- package/es/services/TemplateListing/index.d.ts +70 -0
- package/es/services/TemplateListing/index.js +161 -0
- package/es/test.js +65 -11
- package/es/types/index.d.ts +5 -0
- package/es/types/index.js +3 -0
- package/es/types/service.d.ts +22 -0
- package/es/types/service.js +1 -0
- package/es/types/share-access.d.ts +18 -0
- package/es/types/share-access.js +1 -0
- package/es/types/templateListing.d.ts +13 -0
- package/es/types/templateListing.js +1 -0
- package/es/types/variables.d.ts +3 -0
- package/es/utils/common.d.ts +4 -0
- package/es/utils/common.js +38 -0
- package/es/utils/commonComponent.d.ts +7 -0
- package/es/utils/commonComponent.js +28 -0
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.js +1 -0
- package/es/utils/templateListing.d.ts +2 -0
- package/es/utils/templateListing.js +12 -0
- package/package.json +6 -1
|
@@ -0,0 +1,108 @@
|
|
|
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
|
+
/* eslint-disable react/no-array-index-key */
|
|
13
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
14
|
+
import { TinyColor } from '@ctrl/tinycolor';
|
|
15
|
+
import { RangePicker } from '../RangePicker';
|
|
16
|
+
import { useCalendarSelectionContext } from '../../hooks';
|
|
17
|
+
import dayjs from 'dayjs';
|
|
18
|
+
import isBetween from 'dayjs/plugin/isBetween';
|
|
19
|
+
import { AutoUpdateTo } from '../AutoUpdateTo';
|
|
20
|
+
import { updateRangeValue } from '../../actions';
|
|
21
|
+
import { CalendarContainerStyled, StyledCellDate, StyledCustomPickerRoot } from './styled';
|
|
22
|
+
import { ConfigProvider } from 'antd';
|
|
23
|
+
import { interpolateHsl } from 'd3-interpolate';
|
|
24
|
+
import { isEmpty } from 'lodash';
|
|
25
|
+
dayjs.extend(isBetween);
|
|
26
|
+
const generateRangeInputLabel = (idx, label) => {
|
|
27
|
+
if (label)
|
|
28
|
+
return label;
|
|
29
|
+
if (idx === 0)
|
|
30
|
+
return 'custom';
|
|
31
|
+
return `custom compare${idx > 1 ? ` ${idx}}` : ''}`;
|
|
32
|
+
};
|
|
33
|
+
export const CustomPicker = props => {
|
|
34
|
+
const rest = __rest(props, []);
|
|
35
|
+
const popupContainer = useRef(null);
|
|
36
|
+
const { state, action } = useCalendarSelectionContext();
|
|
37
|
+
const { rangeValue } = state.value.current;
|
|
38
|
+
const [activeRangeIdx, setActiveRangeIdx] = useState(null);
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (rangeValue.length > 0) {
|
|
41
|
+
setActiveRangeIdx(0);
|
|
42
|
+
}
|
|
43
|
+
}, [rangeValue.length]);
|
|
44
|
+
const handleCalendarChange = (start, end) => {
|
|
45
|
+
if (!start || !end || activeRangeIdx === null)
|
|
46
|
+
return;
|
|
47
|
+
const replacedRange = rangeValue[activeRangeIdx];
|
|
48
|
+
const updatedRangeValue = [...rangeValue];
|
|
49
|
+
updatedRangeValue.splice(activeRangeIdx, 1, Object.assign(Object.assign({}, replacedRange), { start,
|
|
50
|
+
end }));
|
|
51
|
+
action.dispatch(updateRangeValue(updatedRangeValue, { isManual: true }));
|
|
52
|
+
};
|
|
53
|
+
const renderCellDate = useCallback((date, originNode) => {
|
|
54
|
+
const colors = rangeValue.reduce((acc, cur) => {
|
|
55
|
+
if (date.isBetween(cur.start, cur.end, 'd', '[]') && cur.color) {
|
|
56
|
+
acc.push(cur.color);
|
|
57
|
+
}
|
|
58
|
+
return acc;
|
|
59
|
+
}, []);
|
|
60
|
+
if (isEmpty(colors))
|
|
61
|
+
return originNode;
|
|
62
|
+
const cellBgColor = new TinyColor(colors.length > 1
|
|
63
|
+
? colors.reduce((acc, color) => interpolateHsl(acc, color)(0.5), colors[0])
|
|
64
|
+
: colors[0]);
|
|
65
|
+
return React.createElement(StyledCellDate, { rangeColor: cellBgColor }, originNode);
|
|
66
|
+
}, [rangeValue]);
|
|
67
|
+
return (React.createElement(StyledCustomPickerRoot, null,
|
|
68
|
+
React.createElement("div", { className: "range-inputs" }, rangeValue.map((range, rangeIdx) => (React.createElement(ConfigProvider, { key: rangeIdx, theme: {
|
|
69
|
+
components: {
|
|
70
|
+
DatePicker: Object.assign({ cellHeight: 20 }, (range.color && {
|
|
71
|
+
hoverBorderColor: range.color,
|
|
72
|
+
colorBorder: range.color,
|
|
73
|
+
colorPrimary: range.color,
|
|
74
|
+
colorPrimaryActive: range.color,
|
|
75
|
+
cellActiveWithRangeBg: new TinyColor(range.color).lighten(40).toHexString(),
|
|
76
|
+
})),
|
|
77
|
+
},
|
|
78
|
+
} },
|
|
79
|
+
React.createElement("div", { className: "range-input" },
|
|
80
|
+
React.createElement("div", { className: "range-input-label" }, generateRangeInputLabel(rangeIdx, range.label)),
|
|
81
|
+
React.createElement(RangePicker, Object.assign({}, rest, { open: true, value: [dayjs(range.start), dayjs(range.end)], onClick: () => setActiveRangeIdx(rangeIdx), getPopupContainer: () => popupContainer.current || document.body, panelRender: originalPanel => {
|
|
82
|
+
if (activeRangeIdx !== rangeIdx)
|
|
83
|
+
return null;
|
|
84
|
+
return originalPanel;
|
|
85
|
+
}, cellRender: (current, info) => {
|
|
86
|
+
if (typeof current === 'number' || info.type !== 'date') {
|
|
87
|
+
return info.originNode;
|
|
88
|
+
}
|
|
89
|
+
return renderCellDate(current, info.originNode);
|
|
90
|
+
}, onCalendarChange: value => {
|
|
91
|
+
var _a, _b;
|
|
92
|
+
let start = '';
|
|
93
|
+
let end = '';
|
|
94
|
+
const valueFirst = dayjs((_a = value === null || value === void 0 ? void 0 : value.at(0)) === null || _a === void 0 ? void 0 : _a.toDate());
|
|
95
|
+
const valueSecond = dayjs((_b = value === null || value === void 0 ? void 0 : value.at(1)) === null || _b === void 0 ? void 0 : _b.toDate());
|
|
96
|
+
if (valueFirst.isBefore(valueSecond)) {
|
|
97
|
+
start = valueFirst.toISOString();
|
|
98
|
+
end = valueSecond.toISOString();
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
start = valueSecond.toISOString();
|
|
102
|
+
end = valueFirst.toISOString();
|
|
103
|
+
}
|
|
104
|
+
handleCalendarChange(start, end);
|
|
105
|
+
} }))))))),
|
|
106
|
+
React.createElement(AutoUpdateTo, null),
|
|
107
|
+
React.createElement(CalendarContainerStyled, { className: "calendar-container", ref: popupContainer })));
|
|
108
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CustomPicker';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CustomPicker';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TinyColor } from '@ctrl/tinycolor';
|
|
2
|
+
export declare const StyledCellDate: import("styled-components").StyledComponent<"div", any, {
|
|
3
|
+
rangeColor: TinyColor;
|
|
4
|
+
}, never>;
|
|
5
|
+
export declare const StyledCustomPickerRoot: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
|
+
export declare const CalendarContainerStyled: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
export const StyledCellDate = styled.div `
|
|
3
|
+
--cellTextColor: ${p => (p.rangeColor.isLight() ? '#000' : '#fff')};
|
|
4
|
+
--cellBgColor: ${p => p.rangeColor.lighten(40).toHexString()};
|
|
5
|
+
--cellHoverBgColor: ${p => p.rangeColor.lighten(30).toHexString()};
|
|
6
|
+
--rangeColor: ${p => p.rangeColor.toHexString()};
|
|
7
|
+
|
|
8
|
+
position: relative;
|
|
9
|
+
|
|
10
|
+
&:before {
|
|
11
|
+
position: absolute;
|
|
12
|
+
top: 0;
|
|
13
|
+
left: 0;
|
|
14
|
+
height: 100%;
|
|
15
|
+
width: 100%;
|
|
16
|
+
content: '';
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
export const StyledCustomPickerRoot = styled.div `
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
gap: 8px;
|
|
23
|
+
padding: 8px 12px;
|
|
24
|
+
|
|
25
|
+
.range-inputs {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
gap: 8px;
|
|
29
|
+
|
|
30
|
+
.range-input {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
gap: 4px;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.custom-label,
|
|
38
|
+
.range-inputs .range-input-label {
|
|
39
|
+
font-weight: bold;
|
|
40
|
+
text-transform: uppercase;
|
|
41
|
+
color: #838383;
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
44
|
+
export const CalendarContainerStyled = styled.div `
|
|
45
|
+
/* Variables */
|
|
46
|
+
--cellHeight: 28px;
|
|
47
|
+
--cellWidth: 28px;
|
|
48
|
+
--colorToDay: rgb(211, 211, 211);
|
|
49
|
+
--colorSelected: rgb(0, 94, 184);
|
|
50
|
+
--colorInRange: rgb(216, 234, 252);
|
|
51
|
+
|
|
52
|
+
position: relative;
|
|
53
|
+
|
|
54
|
+
.antsomi-picker-dropdown {
|
|
55
|
+
position: relative;
|
|
56
|
+
top: 0 !important;
|
|
57
|
+
left: 0 !important;
|
|
58
|
+
box-shadow: none;
|
|
59
|
+
padding: 0;
|
|
60
|
+
|
|
61
|
+
.antsomi-picker-panel-container {
|
|
62
|
+
box-shadow: none;
|
|
63
|
+
}
|
|
64
|
+
.antsomi-picker-panels {
|
|
65
|
+
display: inline-flex;
|
|
66
|
+
flex-direction: column;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* Content */
|
|
70
|
+
.antsomi-picker-content {
|
|
71
|
+
/* Rectangle */
|
|
72
|
+
& td,
|
|
73
|
+
& th,
|
|
74
|
+
& .antsomi-picker-cell-inner,
|
|
75
|
+
& td::before {
|
|
76
|
+
/* width: var(--cellWidth);
|
|
77
|
+
height: var(--cellHeight); */
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* Date node */
|
|
81
|
+
.antsomi-picker-cell-inner {
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* Today node */
|
|
85
|
+
.antsomi-picker-cell-today {
|
|
86
|
+
.antsomi-picker-cell-inner {
|
|
87
|
+
&::before {
|
|
88
|
+
border-radius: 18px;
|
|
89
|
+
border: 0.0001rem solid var(--colorToDay);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* Selected node */
|
|
95
|
+
.antsomi-picker-cell-in-view {
|
|
96
|
+
&.antsomi-picker-cell-selected,
|
|
97
|
+
&.antsomi-picker-cell-range-start,
|
|
98
|
+
&.antsomi-picker-cell-range-end {
|
|
99
|
+
.antsomi-picker-cell-inner {
|
|
100
|
+
background: var(--colorSelected) !important;
|
|
101
|
+
border-radius: 18px !important;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* In Range */
|
|
107
|
+
.antsomi-picker-cell-in-range.antsomi-picker-cell-in-view {
|
|
108
|
+
&::before {
|
|
109
|
+
background: var(--colorInRange) !important;
|
|
110
|
+
}
|
|
111
|
+
.antsomi-picker-cell-inner {
|
|
112
|
+
/* background: var(--colorInRange) !important; */
|
|
113
|
+
&::after {
|
|
114
|
+
content: none !important;
|
|
115
|
+
background: var(--colorInRange) !important;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* In Range Start End */
|
|
121
|
+
.antsomi-picker-cell-in-view.antsomi-picker-cell-range-start:not(
|
|
122
|
+
.antsomi-picker-cell-range-start-single
|
|
123
|
+
) {
|
|
124
|
+
&::before {
|
|
125
|
+
background: var(--colorInRange) !important;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
.antsomi-picker-cell-in-view.antsomi-picker-cell-range-end:not(
|
|
129
|
+
.antsomi-picker-cell-range-end-single
|
|
130
|
+
) {
|
|
131
|
+
&::before {
|
|
132
|
+
background: var(--colorInRange) !important;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* Hover */
|
|
137
|
+
.antsomi-picker-cell-in-view {
|
|
138
|
+
&.antsomi-picker-cell-range-hover,
|
|
139
|
+
&.antsomi-picker-cell-range-hover-start,
|
|
140
|
+
&.antsomi-picker-cell-range-hover-end {
|
|
141
|
+
&:not(.antsomi-picker-cell-in-range)::after {
|
|
142
|
+
content: none !important;
|
|
143
|
+
border: none;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
.antsomi-picker-range-arrow {
|
|
149
|
+
display: none !important;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type CustomPickerProps = {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button } from '@antscorp/antsomi-ui/es/components/atoms/Button';
|
|
3
|
+
import { useCalendarSelectionContext } from '../../hooks';
|
|
4
|
+
import { apply, togglePopover } from '../../actions';
|
|
5
|
+
import { StyledFooterRoot } from './styled';
|
|
6
|
+
export const Footer = () => {
|
|
7
|
+
const { action } = useCalendarSelectionContext();
|
|
8
|
+
return (React.createElement(StyledFooterRoot, null,
|
|
9
|
+
React.createElement(Button, { onClick: () => action.dispatch(apply()), type: "primary" }, "Apply"),
|
|
10
|
+
React.createElement(Button, { onClick: () => action.dispatch(togglePopover()) }, "Cancel")));
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Footer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Footer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const StyledFooterRoot: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyledRangePicker } from './styled';
|
|
3
|
+
const DATE_FORMAT = 'DD/MM/YYYY';
|
|
4
|
+
export const RangePicker = props => (React.createElement(StyledRangePicker, Object.assign({}, props, { allowEmpty: [true, true], allowClear: false, autoFocus: false, size: "large", suffixIcon: false, format: DATE_FORMAT })));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './RangePicker';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './RangePicker';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const StyledRangePicker: import("styled-components").StyledComponent<import("antd/es/date-picker/generatePicker/interface").PickerComponentClass<import("antd/es/date-picker/generatePicker").RangePickerProps<import("dayjs").Dayjs> & {
|
|
2
|
+
dropdownClassName?: string | undefined;
|
|
3
|
+
popupClassName?: string | undefined;
|
|
4
|
+
rootClassName?: string | undefined;
|
|
5
|
+
}, unknown>, any, {}, never>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DatePicker } from '@antscorp/antsomi-ui/es/components/molecules';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
const { RangePicker } = DatePicker;
|
|
4
|
+
export const StyledRangePicker = styled(RangePicker) `
|
|
5
|
+
font-size: 12px;
|
|
6
|
+
padding-right: 8px;
|
|
7
|
+
|
|
8
|
+
.ant-picker-input {
|
|
9
|
+
input {
|
|
10
|
+
width: 80px;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RANGE_SELECTION_OPTIONS, RANGE_TIME, SELECTION_KEY } from '../../constants';
|
|
3
|
+
import { Divider } from '@antscorp/antsomi-ui/es/components/atoms';
|
|
4
|
+
import { List } from 'antd';
|
|
5
|
+
import { NumOfDaysRanges, Option } from './components';
|
|
6
|
+
import { RangeSelectOptionsRoot } from './styled';
|
|
7
|
+
const customOption = RANGE_SELECTION_OPTIONS[SELECTION_KEY.custom];
|
|
8
|
+
const baseOptions = RANGE_TIME.map(key => {
|
|
9
|
+
var _a;
|
|
10
|
+
const option = RANGE_SELECTION_OPTIONS[key];
|
|
11
|
+
return {
|
|
12
|
+
key,
|
|
13
|
+
type: key,
|
|
14
|
+
label: option.label.trim(),
|
|
15
|
+
options: ((_a = option.options) === null || _a === void 0 ? void 0 : _a.map(i => (Object.assign(Object.assign({}, i), { type: i.key })))) || [],
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
export const RangeSelectOptions = () => (React.createElement(RangeSelectOptionsRoot, null,
|
|
19
|
+
React.createElement(List, { dataSource: [customOption], renderItem: item => React.createElement(Option, { type: item.key, label: item.label }) }),
|
|
20
|
+
React.createElement(Divider, { style: { marginTop: 4, marginBottom: 4 } }),
|
|
21
|
+
React.createElement(List, { dataSource: baseOptions, renderItem: item => React.createElement(Option, { type: item.key, label: item.label, options: item.options }) }),
|
|
22
|
+
React.createElement(Divider, { style: { marginTop: 4, marginBottom: 4 } }),
|
|
23
|
+
React.createElement(NumOfDaysRanges, null)));
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DEFAULT_NUM_UP_TO, RANGE_SELECTION_OPTIONS, SELECTION_KEY } from '../../../../constants';
|
|
3
|
+
import { Option } from '../Option';
|
|
4
|
+
import { useCalendarSelectionContext } from '../../../../hooks';
|
|
5
|
+
import { updateRangeInfo } from '../../../../actions';
|
|
6
|
+
import { InputNumber } from '@antscorp/antsomi-ui/es/components/atoms';
|
|
7
|
+
import { List } from 'antd';
|
|
8
|
+
const numbericOptions = [
|
|
9
|
+
RANGE_SELECTION_OPTIONS[SELECTION_KEY.days_up_to_today],
|
|
10
|
+
RANGE_SELECTION_OPTIONS[SELECTION_KEY.days_up_to_yesterday],
|
|
11
|
+
].map(i => (Object.assign(Object.assign({}, i), { type: i.key })));
|
|
12
|
+
export const NumOfDaysRanges = () => {
|
|
13
|
+
const { state, action } = useCalendarSelectionContext();
|
|
14
|
+
const { rangeInfo } = state.value.current;
|
|
15
|
+
let upToDaysRangeInfo = null;
|
|
16
|
+
if (rangeInfo.type === SELECTION_KEY.days_up_to_yesterday ||
|
|
17
|
+
rangeInfo.type === SELECTION_KEY.days_up_to_today) {
|
|
18
|
+
upToDaysRangeInfo = rangeInfo;
|
|
19
|
+
}
|
|
20
|
+
const handleChangeNumOfDays = (value, rangeType) => {
|
|
21
|
+
if (!upToDaysRangeInfo || upToDaysRangeInfo.type !== rangeType)
|
|
22
|
+
return;
|
|
23
|
+
action.dispatch(updateRangeInfo({
|
|
24
|
+
numOfDays: value,
|
|
25
|
+
}));
|
|
26
|
+
};
|
|
27
|
+
const renderInput = (rangeType) => {
|
|
28
|
+
let value = DEFAULT_NUM_UP_TO;
|
|
29
|
+
if (rangeType === (upToDaysRangeInfo === null || upToDaysRangeInfo === void 0 ? void 0 : upToDaysRangeInfo.type)) {
|
|
30
|
+
value = upToDaysRangeInfo.numOfDays;
|
|
31
|
+
}
|
|
32
|
+
return (React.createElement(InputNumber, { onChange: value => {
|
|
33
|
+
if (typeof value === 'number') {
|
|
34
|
+
handleChangeNumOfDays(value, rangeType);
|
|
35
|
+
}
|
|
36
|
+
}, readOnly: rangeType !== (upToDaysRangeInfo === null || upToDaysRangeInfo === void 0 ? void 0 : upToDaysRangeInfo.type), size: "small", type: "number", style: { width: 60 }, min: 1, step: 1, precision: 0, value: value }));
|
|
37
|
+
};
|
|
38
|
+
return (React.createElement(List, { className: "ants-text-normal", dataSource: numbericOptions, renderItem: item => (React.createElement(Option, { type: item.key, label: React.createElement("div", { className: "ants-flex ants-gap-2 ants-items-center" },
|
|
39
|
+
renderInput(item.type),
|
|
40
|
+
item.label) })) }));
|
|
41
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NumOfDaysRanges';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NumOfDaysRanges';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React, { useRef } from 'react';
|
|
2
|
+
import Icon from '@antscorp/icons';
|
|
3
|
+
import { Popover } from '@antscorp/antsomi-ui/es/components/atoms';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import { useCalendarSelectionContext } from '../../../../hooks';
|
|
6
|
+
import { changeRangeType } from '../../../../actions';
|
|
7
|
+
import { rangeInfoToStringType } from '../../../../utils';
|
|
8
|
+
import { StyledMenu } from './styled';
|
|
9
|
+
import { List } from 'antd';
|
|
10
|
+
export const Option = props => {
|
|
11
|
+
const itemRef = useRef(null);
|
|
12
|
+
const { label = '', options = [], type } = props;
|
|
13
|
+
const { state, action } = useCalendarSelectionContext();
|
|
14
|
+
const { rangeInfo } = state.value.current;
|
|
15
|
+
const selectedRangeType = rangeInfoToStringType(rangeInfo);
|
|
16
|
+
const optionsTypes = options.map(o => o.type);
|
|
17
|
+
const hasSubOptionActive = optionsTypes.includes(selectedRangeType);
|
|
18
|
+
const isActive = selectedRangeType === type || hasSubOptionActive;
|
|
19
|
+
const withDropdown = options.length > 0;
|
|
20
|
+
const handleClickOption = (rangeType) => {
|
|
21
|
+
if (rangeType !== selectedRangeType) {
|
|
22
|
+
action.dispatch(changeRangeType(rangeType));
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const content = (React.createElement(List.Item, { ref: itemRef, className: classNames({ active: isActive }), onClick: () => {
|
|
26
|
+
if (!withDropdown) {
|
|
27
|
+
handleClickOption(type);
|
|
28
|
+
}
|
|
29
|
+
} },
|
|
30
|
+
React.createElement("div", { className: classNames({
|
|
31
|
+
'ants-font-bold': isActive,
|
|
32
|
+
}) }, label),
|
|
33
|
+
withDropdown && (React.createElement(Icon, { style: {
|
|
34
|
+
fontSize: 8,
|
|
35
|
+
}, type: "icon-ants-angle-right" }))));
|
|
36
|
+
if (withDropdown) {
|
|
37
|
+
return (React.createElement(Popover, { placement: "rightTop", overlayClassName: "arrow-hidden", overlayInnerStyle: { padding: 0 }, arrow: false, content: React.createElement(StyledMenu, { selectedKeys: [selectedRangeType], items: options.map(o => (Object.assign(Object.assign({}, o), { key: o.type, onClick: () => handleClickOption(o.type) }))) }), destroyTooltipOnHide: true }, content));
|
|
38
|
+
}
|
|
39
|
+
return content;
|
|
40
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Option';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Option';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const StyledMenu: any;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Menu } from 'antd';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
export const StyledMenu = styled(Menu) `
|
|
4
|
+
&.antsomi-menu-root {
|
|
5
|
+
.antsomi-menu-item {
|
|
6
|
+
position: relative;
|
|
7
|
+
color: black;
|
|
8
|
+
height: 32px;
|
|
9
|
+
line-height: 32px;
|
|
10
|
+
border-radius: 0;
|
|
11
|
+
width: 100%;
|
|
12
|
+
margin: 0;
|
|
13
|
+
|
|
14
|
+
&.antsomi-menu-item-selected {
|
|
15
|
+
font-weight: bold;
|
|
16
|
+
|
|
17
|
+
&:after {
|
|
18
|
+
content: '';
|
|
19
|
+
position: absolute;
|
|
20
|
+
left: 0;
|
|
21
|
+
top: 0;
|
|
22
|
+
width: 4px;
|
|
23
|
+
height: 100%;
|
|
24
|
+
background-color: #005fb8;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './RangeSelectOptions';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './RangeSelectOptions';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { List } from 'antd';
|
|
3
|
+
export const StyledList = styled(List) ``;
|
|
4
|
+
export const RangeSelectOptionsRoot = styled.div `
|
|
5
|
+
.antsomi-list-items {
|
|
6
|
+
font-size: inherit;
|
|
7
|
+
|
|
8
|
+
.antsomi-list-item {
|
|
9
|
+
border: none;
|
|
10
|
+
padding: 6px 12px;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
position: relative;
|
|
13
|
+
|
|
14
|
+
&.active {
|
|
15
|
+
background-color: #d8eafc;
|
|
16
|
+
font-weight: bold;
|
|
17
|
+
|
|
18
|
+
&:after {
|
|
19
|
+
position: absolute;
|
|
20
|
+
content: '';
|
|
21
|
+
width: 4px;
|
|
22
|
+
height: 100%;
|
|
23
|
+
left: 0;
|
|
24
|
+
top: 0;
|
|
25
|
+
background-color: #005fb8;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&:hover:not(.active) {
|
|
30
|
+
background-color: #f4f6f8;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ListRangeSelectionProps = {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|