@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,184 @@
|
|
|
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, { useEffect, useState } from 'react';
|
|
14
|
+
import { Dropdown, Form } from 'antd';
|
|
15
|
+
import dayjs from 'dayjs';
|
|
16
|
+
// Components
|
|
17
|
+
import { Tooltip, Button, Flex, Input, Typography, Select, ShareAccess, RadioGroup, Radio, Space, Spin, } from '@antscorp/antsomi-ui/es/components';
|
|
18
|
+
// Hooks
|
|
19
|
+
import { useDebounce } from '@antscorp/antsomi-ui/es/hooks/useDebounceV2';
|
|
20
|
+
// Styles
|
|
21
|
+
import { TemplateSaveAsStyled } from './styled';
|
|
22
|
+
import { ImageSlider } from './components';
|
|
23
|
+
const { Text } = Typography;
|
|
24
|
+
export const TemplateSaveAs = props => {
|
|
25
|
+
const { className, shareAccess, saveOptions, imageReview, categories, omitCategories, templateNames: templateNameList, templateNamesOptions, descriptionOptions, form, value, onChange, onEvent,
|
|
26
|
+
// onNamePopupScroll,
|
|
27
|
+
} = props;
|
|
28
|
+
const { show: isShowShareAccess } = shareAccess, shareAccessProps = __rest(shareAccess, ["show"]);
|
|
29
|
+
const { thumbnails, isLoading: isLoadingThumbnail, skeleton, previewNavigation, slidesPerView, hideThumbnailsList, hideDefaultButton, imageHeight, imageWidth, label: imageReviewLabel, } = imageReview;
|
|
30
|
+
const { isLoading, label: templateLabel, defaultNewTemplateName, onSearch, onNamePopupScroll, } = templateNamesOptions || {};
|
|
31
|
+
const { label: descriptionLabel, placeholder: descriptionPlaceholder } = descriptionOptions || {};
|
|
32
|
+
const { saveNewText = 'Save as a new media Template', saveExistText = 'Save as an existing media Template', saveNewValue = 'save-new', saveExistValue = 'save-exist', } = saveOptions || {};
|
|
33
|
+
const { saveOption = saveNewValue, templateName, description: defaultTemplateDesc, defaultThumbnail = 0, categories: categoriesValue = {}, accessInfo, } = value || {};
|
|
34
|
+
const [searchValue, setSearchValue] = useState('');
|
|
35
|
+
const searchValueDebounce = useDebounce(searchValue, 1000);
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
if (searchValueDebounce && onSearch)
|
|
38
|
+
onSearch(searchValueDebounce);
|
|
39
|
+
}, [searchValueDebounce, onSearch]);
|
|
40
|
+
const [templateNameNew, setTemplateNameNew] = useState(defaultNewTemplateName || `Untitled Media Template#${dayjs().format('YYYY-MM-DD HH:mm:ss')}`);
|
|
41
|
+
const [templateNameExist, setTemplateNameExist] = useState((templateName === null || templateName === void 0 ? void 0 : templateName.id) ? templateName : templateNameList === null || templateNameList === void 0 ? void 0 : templateNameList[0]);
|
|
42
|
+
// NOTE: HOTFIX templateNameExist not update when value outside changed
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
if (templateName === null || templateName === void 0 ? void 0 : templateName.id) {
|
|
45
|
+
setTemplateNameExist(templateName);
|
|
46
|
+
}
|
|
47
|
+
}, [templateName]);
|
|
48
|
+
const handleChangeValue = (newValue) => {
|
|
49
|
+
var _a, _b;
|
|
50
|
+
if (onEvent) {
|
|
51
|
+
onEvent(newValue);
|
|
52
|
+
}
|
|
53
|
+
if (onChange) {
|
|
54
|
+
onChange(Object.assign(Object.assign(Object.assign({}, value), newValue), {
|
|
55
|
+
// TODO: return saveOption and templateName generate default value if not pass as value props
|
|
56
|
+
defaultThumbnail: newValue.defaultThumbnail || defaultThumbnail,
|
|
57
|
+
// NOTE: if have no saveOption set saveOption value follow this priority => newValue >> value
|
|
58
|
+
saveOption: !(value === null || value === void 0 ? void 0 : value.saveOption) && !newValue.saveOption
|
|
59
|
+
? saveOption
|
|
60
|
+
: newValue.saveOption || (value === null || value === void 0 ? void 0 : value.saveOption) }), (_b = (_a = form === null || form === void 0 ? void 0 : form.getFieldsError()) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.errors);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
const handleAddCategory = ({ parentKey, item, }) => {
|
|
64
|
+
const currCategory = categoriesValue === null || categoriesValue === void 0 ? void 0 : categoriesValue[parentKey];
|
|
65
|
+
if (currCategory) {
|
|
66
|
+
const newCategory = Object.assign(Object.assign({}, categoriesValue), { [parentKey]: [...currCategory, +item] });
|
|
67
|
+
handleChangeValue({ categories: newCategory });
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
const newCategory = Object.assign(Object.assign({}, categoriesValue), { [parentKey]: [+item] });
|
|
71
|
+
handleChangeValue({ categories: newCategory });
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
const handleRemoveCategory = ({ parent, item, }) => {
|
|
75
|
+
const currCategory = categoriesValue === null || categoriesValue === void 0 ? void 0 : categoriesValue[parent];
|
|
76
|
+
if (!currCategory)
|
|
77
|
+
return;
|
|
78
|
+
const newChildren = currCategory.filter(child => child !== item);
|
|
79
|
+
handleChangeValue({
|
|
80
|
+
categories: Object.assign(Object.assign({}, categoriesValue), { [parent]: newChildren }),
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
return (React.createElement(Form, { form: form, initialValues: {
|
|
84
|
+
'template-name': defaultNewTemplateName ||
|
|
85
|
+
`Untitled Media Template#${dayjs().format('YYYY-MM-DD HH:mm:ss')}`,
|
|
86
|
+
} },
|
|
87
|
+
React.createElement(TemplateSaveAsStyled, { className: className || '', vertical: true },
|
|
88
|
+
React.createElement(Flex, { className: "save-options-container" },
|
|
89
|
+
React.createElement(RadioGroup, { value: saveOption, onChange: e => {
|
|
90
|
+
handleChangeValue({
|
|
91
|
+
saveOption: e.target.value,
|
|
92
|
+
templateName: e.target.value === saveNewValue
|
|
93
|
+
? { id: undefined, label: templateNameNew }
|
|
94
|
+
: templateNameExist,
|
|
95
|
+
});
|
|
96
|
+
} },
|
|
97
|
+
React.createElement(Radio, { value: saveNewValue }, saveNewText),
|
|
98
|
+
React.createElement(Radio, { value: saveExistValue }, saveExistText))),
|
|
99
|
+
React.createElement(Flex, null,
|
|
100
|
+
React.createElement(Flex, { vertical: true, gap: 20, className: "template-container" },
|
|
101
|
+
React.createElement(Flex, { className: "field-container" },
|
|
102
|
+
React.createElement(Text, { className: "field-title field-title--middle" },
|
|
103
|
+
templateLabel || 'Template name',
|
|
104
|
+
" ",
|
|
105
|
+
React.createElement("span", null, " *")),
|
|
106
|
+
saveOption === saveNewValue ? (React.createElement(Form.Item, { name: "template-name", validateTrigger: "onChange", noStyle: true, rules: [{ required: true }] },
|
|
107
|
+
React.createElement(Input, { className: "field-input", value: templateNameNew, debounce: 100, onAfterChange: value => {
|
|
108
|
+
handleChangeValue({ templateName: { id: undefined, label: value } });
|
|
109
|
+
setTemplateNameNew(value);
|
|
110
|
+
}, "aria-valuetext": templateNameNew, required: true }))) : (React.createElement(Select, { className: "field-input", showSearch: true, searchValue: searchValue, onSearch: setSearchValue, onPopupScroll: onNamePopupScroll, filterOption: false, dropdownRender: menu => (React.createElement(React.Fragment, null,
|
|
111
|
+
isLoading && templateNameList.length === 0 ? null : menu,
|
|
112
|
+
isLoading ? (React.createElement(Space, { style: {
|
|
113
|
+
padding: '4px 0',
|
|
114
|
+
width: '100%',
|
|
115
|
+
justifyContent: 'center',
|
|
116
|
+
alignItems: 'center',
|
|
117
|
+
} },
|
|
118
|
+
React.createElement(Spin, { size: "small" }))) : null)), value: templateNameExist === null || templateNameExist === void 0 ? void 0 : templateNameExist.id, options:
|
|
119
|
+
// If template exist is not in templateNames list => add to begin of options array
|
|
120
|
+
(templateNameList === null || templateNameList === void 0 ? void 0 : templateNameList.length) > 0
|
|
121
|
+
? [
|
|
122
|
+
...(templateNameList.find(item => item.id === (templateNameExist === null || templateNameExist === void 0 ? void 0 : templateNameExist.id))
|
|
123
|
+
? []
|
|
124
|
+
: [{ value: templateNameExist === null || templateNameExist === void 0 ? void 0 : templateNameExist.id, label: templateNameExist === null || templateNameExist === void 0 ? void 0 : templateNameExist.label }]),
|
|
125
|
+
...templateNameList.map(item => ({ value: item.id, label: item.label })),
|
|
126
|
+
]
|
|
127
|
+
: [], onChange: value => {
|
|
128
|
+
var _a, _b;
|
|
129
|
+
handleChangeValue({
|
|
130
|
+
templateName: {
|
|
131
|
+
id: value,
|
|
132
|
+
label: ((_a = templateNameList.find(item => item.id === value)) === null || _a === void 0 ? void 0 : _a.label) || '',
|
|
133
|
+
},
|
|
134
|
+
});
|
|
135
|
+
setTemplateNameExist({
|
|
136
|
+
id: value,
|
|
137
|
+
label: ((_b = templateNameList.find(item => item.id === value)) === null || _b === void 0 ? void 0 : _b.label) || '',
|
|
138
|
+
});
|
|
139
|
+
} }))),
|
|
140
|
+
React.createElement(Flex, { className: "field-container" },
|
|
141
|
+
React.createElement(Text, { className: "field-title field-title--middle" }, descriptionLabel || 'Description'),
|
|
142
|
+
React.createElement(Input, { placeholder: descriptionPlaceholder || 'Describe your media template', className: "field-input", value: defaultTemplateDesc, debounce: 100, onAfterChange: value => handleChangeValue({ description: value }) })),
|
|
143
|
+
React.createElement(Flex, { className: "field-container" },
|
|
144
|
+
React.createElement(Text, { className: "field-title" },
|
|
145
|
+
imageReviewLabel || 'Thumbnail template',
|
|
146
|
+
" ",
|
|
147
|
+
React.createElement("span", null, "*")),
|
|
148
|
+
React.createElement(ImageSlider, { thumbnails: thumbnails, isLoading: isLoadingThumbnail, skeleton: skeleton, previewNavigation: previewNavigation, slidesPerView: slidesPerView, defaultThumbnail: defaultThumbnail, onSelectDefault: value => handleChangeValue({ defaultThumbnail: value }), hideThumbnailsList: hideThumbnailsList, hideDefaultButton: hideDefaultButton, imageHeight: imageHeight, imageWidth: imageWidth })), categories === null || categories === void 0 ? void 0 :
|
|
149
|
+
categories.map(parentCategory => {
|
|
150
|
+
var _a, _b;
|
|
151
|
+
const selectedChildren = categoriesValue[parentCategory.key];
|
|
152
|
+
const remainChildren = parentCategory.children.filter(item => !(selectedChildren === null || selectedChildren === void 0 ? void 0 : selectedChildren.includes(item.key)));
|
|
153
|
+
// NOTE: filter to remove device and template categories
|
|
154
|
+
if ((omitCategories === null || omitCategories === void 0 ? void 0 : omitCategories.length) && omitCategories.includes(parentCategory.key.toString()))
|
|
155
|
+
return null;
|
|
156
|
+
return (React.createElement(Flex, { key: parentCategory.key, className: "field-container" },
|
|
157
|
+
React.createElement(Text, { className: "field-title" }, parentCategory.label),
|
|
158
|
+
React.createElement(Flex, { wrap: "wrap", gap: 10, className: "category-container" },
|
|
159
|
+
/* selectedCategory */
|
|
160
|
+
(_a = parentCategory.children
|
|
161
|
+
.filter(item => selectedChildren === null || selectedChildren === void 0 ? void 0 : selectedChildren.includes(item.key))) === null || _a === void 0 ? void 0 :
|
|
162
|
+
_a.map(selectedItem => (React.createElement(Flex, { key: selectedItem.key, className: "selected-category", justify: "space-between", align: "center" },
|
|
163
|
+
React.createElement(Tooltip, { title: selectedItem.label },
|
|
164
|
+
React.createElement(Text, { ellipsis: true, style: { textOverflow: 'ellipsis' } }, selectedItem.label)),
|
|
165
|
+
' ',
|
|
166
|
+
React.createElement("span", { className: "remove-btn", onClick: () => handleRemoveCategory({
|
|
167
|
+
parent: parentCategory.key,
|
|
168
|
+
item: selectedItem.key,
|
|
169
|
+
}) }, "\u00D7")))),
|
|
170
|
+
React.createElement(Dropdown, { menu: {
|
|
171
|
+
items: remainChildren,
|
|
172
|
+
onClick: ({ key }) => {
|
|
173
|
+
handleAddCategory({
|
|
174
|
+
parentKey: parentCategory.key,
|
|
175
|
+
item: key,
|
|
176
|
+
});
|
|
177
|
+
},
|
|
178
|
+
}, getPopupContainer: triggerNode => triggerNode.parentElement, trigger: ['click'] }, typeof parentCategory.label === 'string' ? (React.createElement(Button, null,
|
|
179
|
+
"+ Add ", (_b = parentCategory.label) === null || _b === void 0 ? void 0 :
|
|
180
|
+
_b.toLowerCase())) : (parentCategory.label)))));
|
|
181
|
+
})),
|
|
182
|
+
isShowShareAccess ? (React.createElement("div", { className: "share-access-container" },
|
|
183
|
+
React.createElement(ShareAccess, Object.assign({ accessInfo: accessInfo, onChange: value => handleChangeValue({ accessInfo: value }) }, shareAccessProps)))) : null))));
|
|
184
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ModalV2Props } from '../ModalV2';
|
|
3
|
+
import { TemplateSaveAsProps, TemplateValueOptions } from './TemplateSaveAs';
|
|
4
|
+
interface TemplateSaveAsModalProps extends ModalV2Props {
|
|
5
|
+
templateProps: TemplateSaveAsProps;
|
|
6
|
+
defaultValue?: TemplateValueOptions;
|
|
7
|
+
onOk?: (e: React.MouseEvent<HTMLButtonElement>, value?: TemplateValueOptions) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const TemplateSaveAsModal: React.FC<TemplateSaveAsModalProps>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
import React, { useEffect, useState } from 'react';
|
|
13
|
+
import { ModalV2 } from '../ModalV2';
|
|
14
|
+
import { TemplateSaveAs } from './TemplateSaveAs';
|
|
15
|
+
// NOTE: helper link (read more about controlled and uncontrolled component)
|
|
16
|
+
// Inspiration form input component https://react.dev/reference/react-dom/components/input
|
|
17
|
+
export const TemplateSaveAsModal = props => {
|
|
18
|
+
const { open, onCancel, okText, onOk, title, templateProps, defaultValue } = props, restProps = __rest(props, ["open", "onCancel", "okText", "onOk", "title", "templateProps", "defaultValue"]);
|
|
19
|
+
const { onChange, value: templateValue } = templateProps, restTemplateProps = __rest(templateProps, ["onChange", "value"]);
|
|
20
|
+
const [internalValue, setInternalValue] = useState(defaultValue || templateValue);
|
|
21
|
+
const [errors, setErrors] = useState();
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (defaultValue)
|
|
24
|
+
setInternalValue(defaultValue);
|
|
25
|
+
}, [defaultValue]);
|
|
26
|
+
const handleOnChange = (value, errors) => {
|
|
27
|
+
setErrors(errors);
|
|
28
|
+
if (onChange) {
|
|
29
|
+
onChange(value);
|
|
30
|
+
}
|
|
31
|
+
// NOTE: If there are no templateValue and templateOnChange => uncontrolled component => return templateValue
|
|
32
|
+
if (defaultValue && !templateValue && !onChange) {
|
|
33
|
+
setInternalValue(value);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const handleOk = (event) => {
|
|
37
|
+
if (onOk && (!errors || errors.length === 0)) {
|
|
38
|
+
// NOTE: If there are templateValue and onChange => controlled component => return templateValue
|
|
39
|
+
onOk(event, templateValue && onChange ? templateValue : internalValue);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const handleCancel = (event) => {
|
|
43
|
+
if (onCancel) {
|
|
44
|
+
setInternalValue(defaultValue);
|
|
45
|
+
onCancel(event);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
return (React.createElement(ModalV2, Object.assign({ open: open, onCancel: handleCancel, onOk: handleOk, okText: okText || 'Save', width: 1177, title: title || 'Save as my template' }, restProps),
|
|
49
|
+
React.createElement(TemplateSaveAs, Object.assign({ onChange: onChange ? (newValue, errors) => handleOnChange(newValue, errors) : undefined, value: templateValue || internalValue }, restTemplateProps))));
|
|
50
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ImageSliderProps {
|
|
3
|
+
thumbnails: (string | undefined)[];
|
|
4
|
+
isLoading?: boolean;
|
|
5
|
+
className?: string;
|
|
6
|
+
skeleton?: boolean;
|
|
7
|
+
previewNavigation?: boolean;
|
|
8
|
+
slidesPerView?: number;
|
|
9
|
+
hideThumbnailsList?: boolean;
|
|
10
|
+
hideDefaultButton?: boolean;
|
|
11
|
+
imageWidth?: number;
|
|
12
|
+
imageHeight?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Default thumbnail - order of default thumbnail in thumbnails array
|
|
15
|
+
*/
|
|
16
|
+
defaultThumbnail?: number;
|
|
17
|
+
onSelectDefault?: (imgIndex: number) => void;
|
|
18
|
+
}
|
|
19
|
+
export declare const ImageSlider: React.FC<ImageSliderProps>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
import React, { useState, useRef } from 'react';
|
|
3
|
+
import { Image } from 'antd';
|
|
4
|
+
import Icon from '@antscorp/icons';
|
|
5
|
+
// Components
|
|
6
|
+
import { Button, Flex, Spin } from '@antscorp/antsomi-ui/es/components';
|
|
7
|
+
// Styles
|
|
8
|
+
import { ImageSliderStyled } from './styled';
|
|
9
|
+
import clsx from 'clsx';
|
|
10
|
+
export const ImageSlider = props => {
|
|
11
|
+
var _a, _b;
|
|
12
|
+
const { thumbnails, isLoading, className, skeleton, previewNavigation, slidesPerView = 3, hideThumbnailsList, hideDefaultButton, imageWidth = 330, imageHeight = 230, defaultThumbnail, onSelectDefault, } = props;
|
|
13
|
+
const sliderContainerRef = useRef(null);
|
|
14
|
+
const thumbnailSelectedRef = useRef(null);
|
|
15
|
+
const [selectedThumbnail, setSelectedThumbnail] = useState(0);
|
|
16
|
+
const [defaultThumbnailInternal, setDefaultThumbnailInternal] = useState(defaultThumbnail || 0);
|
|
17
|
+
(_a = thumbnailSelectedRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo({
|
|
18
|
+
left: selectedThumbnail * imageWidth,
|
|
19
|
+
behavior: 'smooth',
|
|
20
|
+
});
|
|
21
|
+
(_b = sliderContainerRef.current) === null || _b === void 0 ? void 0 : _b.scrollTo({
|
|
22
|
+
left: selectedThumbnail * (imageWidth / slidesPerView),
|
|
23
|
+
behavior: 'smooth',
|
|
24
|
+
});
|
|
25
|
+
const handleNextThumbnail = () => {
|
|
26
|
+
setSelectedThumbnail(prev => (prev === thumbnails.length - 1 ? 0 : prev + 1));
|
|
27
|
+
};
|
|
28
|
+
const handlePrevThumbnail = () => {
|
|
29
|
+
setSelectedThumbnail(prev => (prev === 0 ? thumbnails.length - 1 : prev - 1));
|
|
30
|
+
};
|
|
31
|
+
return (React.createElement(ImageSliderStyled, { className: className || '', "$skeleton": skeleton, "$slidesPerView": slidesPerView, "$imageWidth": imageWidth, "$imageHeight": imageHeight, vertical: true, gap: 10 },
|
|
32
|
+
React.createElement(Flex, { className: "thumbnail-preview-container", ref: thumbnailSelectedRef }, isLoading ? (React.createElement(Spin, { spinning: true })) : (thumbnails.map((url, index) => (React.createElement("div", { key: `image-big_${url}_${index * 2}`, className: clsx('image-container--big', {
|
|
33
|
+
'image-container--default': defaultThumbnailInternal === index,
|
|
34
|
+
}) },
|
|
35
|
+
url ? (React.createElement(Image, { preview: false, width: "80%", height: "96%", src: thumbnails[index] })) : null,
|
|
36
|
+
hideDefaultButton || hideThumbnailsList || thumbnails.length <= 1 ? null : (React.createElement(Button, { className: "set-default-button", onClick: () => {
|
|
37
|
+
setDefaultThumbnailInternal(selectedThumbnail);
|
|
38
|
+
if (onSelectDefault) {
|
|
39
|
+
onSelectDefault(selectedThumbnail);
|
|
40
|
+
}
|
|
41
|
+
} },
|
|
42
|
+
defaultThumbnailInternal === index ? (React.createElement(Icon, { type: "icon-ants-check", style: { fontSize: '12px' } })) : null,
|
|
43
|
+
defaultThumbnailInternal === index ? 'Default thumbnail' : 'Set as default'))))))),
|
|
44
|
+
hideThumbnailsList || thumbnails.length <= 1 ? null : (React.createElement(Flex, { gap: 10, className: "thumbnail-slider-container", ref: sliderContainerRef }, isLoading ? (React.createElement(Spin, { spinning: true })) : (thumbnails.map((url, index) => (React.createElement("div", { key: `${url}_${index * 2}`, className: clsx('image-container--small', {
|
|
45
|
+
'image-container--selected': index === selectedThumbnail,
|
|
46
|
+
}), onClick: () => setSelectedThumbnail(index) }, url ? (React.createElement(Image, { key: url, preview: false, width: "80%", height: "96%", src: url })) : null)))))),
|
|
47
|
+
previewNavigation && !isLoading ? (React.createElement(React.Fragment, null,
|
|
48
|
+
React.createElement("div", { className: "change-preview-button change-preview-button--left", onClick: handlePrevThumbnail },
|
|
49
|
+
React.createElement(Icon, { type: "icon-ants-angle-left" })),
|
|
50
|
+
React.createElement("div", { className: "change-preview-button change-preview-button--right", onClick: handleNextThumbnail },
|
|
51
|
+
React.createElement(Icon, { type: "icon-ants-angle-right" })))) : null,
|
|
52
|
+
hideThumbnailsList || isLoading || thumbnails.length <= 1 ? null : (React.createElement(React.Fragment, null,
|
|
53
|
+
React.createElement("div", { className: "slider-button slider-button--left", onClick: handlePrevThumbnail },
|
|
54
|
+
React.createElement(Icon, { type: "icon-ants-angle-left" })),
|
|
55
|
+
React.createElement("div", { className: "slider-button slider-button--right", onClick: handleNextThumbnail },
|
|
56
|
+
React.createElement(Icon, { type: "icon-ants-angle-right" }))))));
|
|
57
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ImageSlider } from './ImageSlider';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ImageSlider } from './ImageSlider';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface ImageSliderStyledProps {
|
|
3
|
+
$skeleton?: boolean;
|
|
4
|
+
$slidesPerView?: number;
|
|
5
|
+
$imageWidth?: number;
|
|
6
|
+
$imageHeight?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const ImageSliderStyled: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/flex/interface").FlexProps<import("antd/es/_util/type").AnyObject> & import("react").RefAttributes<HTMLElement>>, any, ImageSliderStyledProps, never>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
import { Flex } from '@antscorp/antsomi-ui/es/components';
|
|
4
|
+
// Assets
|
|
5
|
+
import SkeletonBg from '@antscorp/antsomi-ui/es/assets/images/skeleton_bg.png';
|
|
6
|
+
const backgroundImage = css `
|
|
7
|
+
${props => props.$skeleton
|
|
8
|
+
? css `
|
|
9
|
+
background: url(${SkeletonBg}) no-repeat center center, #e5e5e5;
|
|
10
|
+
background-size: contain;
|
|
11
|
+
`
|
|
12
|
+
: css `
|
|
13
|
+
background: #e5e5e5;
|
|
14
|
+
`}
|
|
15
|
+
`;
|
|
16
|
+
const setWidthHeight = ({ w, h }) => `
|
|
17
|
+
width: ${w};
|
|
18
|
+
height: ${h};
|
|
19
|
+
`;
|
|
20
|
+
const centerBlock = css `
|
|
21
|
+
display: flex;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
align-items: center;
|
|
24
|
+
`;
|
|
25
|
+
export const ImageSliderStyled = styled(Flex) `
|
|
26
|
+
/* NOTE: Style for prev and next button in thumbnail slider */
|
|
27
|
+
position: relative;
|
|
28
|
+
|
|
29
|
+
.change-preview-button {
|
|
30
|
+
${centerBlock}
|
|
31
|
+
position: absolute;
|
|
32
|
+
top: 115px;
|
|
33
|
+
transform: translateY(-50%);
|
|
34
|
+
font-size: 24px;
|
|
35
|
+
color: #fafafa;
|
|
36
|
+
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
z-index: 1;
|
|
39
|
+
|
|
40
|
+
&--left {
|
|
41
|
+
left: 6px;
|
|
42
|
+
}
|
|
43
|
+
&--right {
|
|
44
|
+
right: 6px;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.slider-button {
|
|
49
|
+
${centerBlock}
|
|
50
|
+
position: absolute;
|
|
51
|
+
bottom: 36px;
|
|
52
|
+
transform: translateY(50%);
|
|
53
|
+
|
|
54
|
+
font-size: 12px;
|
|
55
|
+
|
|
56
|
+
${setWidthHeight({ w: '24px', h: '24px' })}
|
|
57
|
+
border-radius: 999px;
|
|
58
|
+
background-color: #fff;
|
|
59
|
+
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
z-index: 1;
|
|
62
|
+
|
|
63
|
+
&--left {
|
|
64
|
+
left: 2px;
|
|
65
|
+
}
|
|
66
|
+
&--right {
|
|
67
|
+
right: 2px;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.thumbnail-preview-container:has(.antsomi-spin),
|
|
72
|
+
.thumbnail-slider-container:has(.antsomi-spin) {
|
|
73
|
+
box-shadow: rgba(159, 180, 180, 0.2) 0px 2px 8px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.thumbnail-preview-container .antsomi-spin,
|
|
77
|
+
.thumbnail-slider-container .antsomi-spin {
|
|
78
|
+
width: 100%;
|
|
79
|
+
${centerBlock}
|
|
80
|
+
background-color: #fcfcfc;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.thumbnail-preview-container {
|
|
84
|
+
width: ${({ $imageWidth }) => `${$imageWidth}px`};
|
|
85
|
+
overflow-x: scroll;
|
|
86
|
+
scrollbar-width: none;
|
|
87
|
+
|
|
88
|
+
/* NOTE: set border-radius for parent of thumbnail list make better UI when scroll horizontal */
|
|
89
|
+
border-radius: 5px;
|
|
90
|
+
|
|
91
|
+
& > div {
|
|
92
|
+
overflow: hidden;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.antsomi-spin {
|
|
96
|
+
height: ${({ $imageHeight }) => `${$imageHeight}px`};
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.thumbnail-slider-container {
|
|
101
|
+
position: relative;
|
|
102
|
+
width: ${({ $imageWidth }) => `${$imageWidth}px`};
|
|
103
|
+
overflow-x: scroll;
|
|
104
|
+
scrollbar-width: none;
|
|
105
|
+
|
|
106
|
+
.antsomi-spin {
|
|
107
|
+
height: 72px;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&:has(> .thumbnail-preview-container + .thumbnail-slider-container) {
|
|
112
|
+
.image-container--big::before {
|
|
113
|
+
content: '';
|
|
114
|
+
position: absolute;
|
|
115
|
+
top: 0;
|
|
116
|
+
left: 0;
|
|
117
|
+
width: 100%;
|
|
118
|
+
height: 100%;
|
|
119
|
+
background-color: transparent;
|
|
120
|
+
z-index: 1;
|
|
121
|
+
transition: background-color 150ms ease-in-out;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.image-container--big:hover::before {
|
|
125
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.image-container {
|
|
130
|
+
&--big,
|
|
131
|
+
&--small {
|
|
132
|
+
${centerBlock}
|
|
133
|
+
${backgroundImage}
|
|
134
|
+
img {
|
|
135
|
+
object-fit: contain;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
div:has(> img) {
|
|
139
|
+
display: flex;
|
|
140
|
+
align-items: center;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
&--big {
|
|
145
|
+
width: 100%;
|
|
146
|
+
height: ${({ $imageHeight }) => `${$imageHeight}px`};
|
|
147
|
+
flex-shrink: 0;
|
|
148
|
+
|
|
149
|
+
position: relative;
|
|
150
|
+
overflow: hidden;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
&--small {
|
|
154
|
+
width: ${props => `calc(100% / ${props.$slidesPerView || 3} - 10px)`};
|
|
155
|
+
height: 72px;
|
|
156
|
+
flex-shrink: 0;
|
|
157
|
+
|
|
158
|
+
border: 2px solid #e5e5e5;
|
|
159
|
+
border-radius: 2px;
|
|
160
|
+
user-select: none;
|
|
161
|
+
cursor: pointer;
|
|
162
|
+
}
|
|
163
|
+
&--selected {
|
|
164
|
+
border: 2px solid var(--primary-color);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.set-default-button {
|
|
169
|
+
position: absolute;
|
|
170
|
+
top: 50%;
|
|
171
|
+
left: 50%;
|
|
172
|
+
transform: translate(-50%, -50%);
|
|
173
|
+
z-index: 2;
|
|
174
|
+
opacity: 0;
|
|
175
|
+
transition: opacity 150ms ease-in-out;
|
|
176
|
+
}
|
|
177
|
+
.image-container--big:hover {
|
|
178
|
+
.set-default-button {
|
|
179
|
+
opacity: 1;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ImageSlider } from './ImageSlider';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ImageSlider } from './ImageSlider';
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PayloadInfo } from '@antscorp/antsomi-ui/es/types';
|
|
3
|
+
import { TGetTemplateCategoryList, TGetObjectTEmplateList } from '@antscorp/antsomi-ui/es/queries/TemplateListing';
|
|
4
|
+
import { TTemplateListingConfig } from '@antscorp/antsomi-ui/es/types/templateListing';
|
|
5
|
+
import { TemplateCategory } from '@antscorp/antsomi-ui/es/models/TemplateCategory';
|
|
6
|
+
import { TemplateValueOptions, categoriesProps } from '../TemplateSaveAs';
|
|
7
|
+
interface TemplateListingOptions {
|
|
8
|
+
service: PayloadInfo;
|
|
9
|
+
config: TTemplateListingConfig;
|
|
10
|
+
queriesOptions?: {
|
|
11
|
+
categoryList?: TGetTemplateCategoryList['options'];
|
|
12
|
+
templateList?: TGetObjectTEmplateList['options'];
|
|
13
|
+
};
|
|
14
|
+
defaultValue?: Partial<TemplateValueOptions>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Custom React Hook for managing state and data fetching logic related to a template listing.
|
|
18
|
+
*
|
|
19
|
+
* @param {Object} options - The options object for configuring the hook.
|
|
20
|
+
* @param {PayloadInfo} options.service - Payload information for making API requests.
|
|
21
|
+
* @param {TTemplateListingConfig} options.config - Configuration options for the template listing.
|
|
22
|
+
*
|
|
23
|
+
* @property {TCategoryItem[]} categoryItems - An array of category items for rendering the template listing's category structure.
|
|
24
|
+
* @property {Array<{ id: string | number; label: string; thumbnail?: string }>} templateItems - An array of template items representing the templates available for the specified configuration.
|
|
25
|
+
* @property {boolean} isLoading - A boolean indicating whether data is currently being loaded.
|
|
26
|
+
*
|
|
27
|
+
* @property {Function} onLoadMore - A function to load more template data when scrolling in the template listing.
|
|
28
|
+
*/
|
|
29
|
+
export declare const useTemplateSave: (options: TemplateListingOptions) => {
|
|
30
|
+
categoryItems: {
|
|
31
|
+
label: string | React.ReactNode;
|
|
32
|
+
key: string | number;
|
|
33
|
+
children: Array<{
|
|
34
|
+
key: string | number;
|
|
35
|
+
label: string | React.ReactNode;
|
|
36
|
+
}>;
|
|
37
|
+
}[];
|
|
38
|
+
templateItems: {
|
|
39
|
+
id: string | number;
|
|
40
|
+
label: string;
|
|
41
|
+
thumbnail?: string | undefined;
|
|
42
|
+
}[];
|
|
43
|
+
value: Partial<TemplateValueOptions>;
|
|
44
|
+
setValue: import("react").Dispatch<import("react").SetStateAction<Partial<TemplateValueOptions>>>;
|
|
45
|
+
reset: () => void;
|
|
46
|
+
formattedCategoriesValue: {
|
|
47
|
+
camelCase: Record<string, any>;
|
|
48
|
+
snakeCase: Record<string, any>;
|
|
49
|
+
};
|
|
50
|
+
handleFormatCategories: (categories: categoriesProps | undefined) => {
|
|
51
|
+
camelCase: Record<string, any>;
|
|
52
|
+
snakeCase: Record<string, any>;
|
|
53
|
+
};
|
|
54
|
+
isLoadingCategoryList: boolean;
|
|
55
|
+
isLoadingTemplateList: boolean;
|
|
56
|
+
searchName: string;
|
|
57
|
+
onSearchName: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
58
|
+
form: import("antd").FormInstance<any>;
|
|
59
|
+
errors: any[] | undefined;
|
|
60
|
+
refetchCategoryList: <TPageData>(options?: (import("@tanstack/query-core").RefetchOptions & import("@tanstack/query-core").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("@tanstack/query-core").QueryObserverResult<TemplateCategory[], any>>;
|
|
61
|
+
refetchTemplateList: <TPageData_1>(options?: (import("@tanstack/query-core").RefetchOptions & import("@tanstack/query-core").RefetchQueryFilters<TPageData_1>) | undefined) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("@antscorp/antsomi-ui/es/types").ResponseListing<import("../../../../models/ObjectTemplate").ObjectTemplate>>, any>>;
|
|
62
|
+
onLoadMore: () => void;
|
|
63
|
+
onChange: (newValue: Partial<TemplateValueOptions>) => void;
|
|
64
|
+
};
|
|
65
|
+
export {};
|