@antscorp/antsomi-ui 1.3.5-beta.4 → 1.3.5-beta.41
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/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 +3 -1
- package/es/components/atoms/Spin/Spin.js +2 -2
- package/es/components/common/ConfigProvider/ConfigProvider.d.ts +1 -1
- package/es/components/common/ConfigProvider/ConfigProvider.js +9 -4
- package/es/components/common/ConfigProvider/GlobalStyle.js +85 -16
- 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/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 +24 -16
- package/es/components/molecules/DatePicker/components/AdvancedPicker/styled.d.ts +5 -0
- package/es/components/molecules/DatePicker/components/AdvancedPicker/styled.js +31 -1
- package/es/components/molecules/DatePicker/components/AdvancedPicker/utils.d.ts +1 -1
- package/es/components/molecules/DatePicker/components/AdvancedRangePicker/AdvancedRangePicker.d.ts +3 -1
- package/es/components/molecules/DatePicker/components/AdvancedRangePicker/AdvancedRangePicker.js +5 -4
- 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 +3 -2
- 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/LayoutContent/LayoutContent.js +2 -2
- 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 +71 -0
- package/es/components/molecules/TemplateSaveAs/TemplateSaveAs.js +172 -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 +18 -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 +5 -0
- package/es/components/molecules/TemplateSaveAs/components/ImageSlider/styled.js +197 -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 +52 -0
- package/es/components/molecules/TemplateSaveAs/hooks/useTemplateSave.js +107 -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.d.ts +3 -0
- package/es/components/molecules/ThumbnailCard/ThumbnailCard.js +72 -0
- package/es/components/molecules/ThumbnailCard/constants.d.ts +3 -0
- package/es/components/molecules/ThumbnailCard/constants.js +3 -0
- package/es/components/molecules/ThumbnailCard/index.d.ts +2 -0
- package/es/components/molecules/ThumbnailCard/index.js +2 -0
- package/es/components/molecules/ThumbnailCard/styled.d.ts +1 -0
- package/es/components/{template/TemplateListing/components/TemplateItem → molecules/ThumbnailCard}/styled.js +14 -7
- package/es/components/molecules/ThumbnailCard/types.d.ts +23 -0
- package/es/components/molecules/ThumbnailCard/types.js +1 -0
- package/es/components/molecules/UploadImage/index.js +1 -1
- package/es/components/molecules/index.d.ts +5 -0
- package/es/components/molecules/index.js +3 -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 +3 -0
- package/es/components/organism/Menu/index.d.ts +1 -0
- package/es/components/organism/Menu/index.js +3 -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 +29 -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 +11 -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/styled.d.ts +4 -0
- package/es/components/organism/PreviewTemplateModal/styled.js +26 -0
- package/es/components/organism/PreviewTemplateModal/types.d.ts +39 -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 +9 -7
- package/es/components/template/TemplateListing/components/BlankTemplate/styled.js +2 -0
- 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 +44 -7
- package/es/components/template/TemplateListing/components/CategoryListing/types.d.ts +2 -1
- 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 -1
- package/es/components/template/TemplateListing/components/index.js +1 -1
- package/es/components/template/TemplateListing/constants/defaultProps.d.ts +8 -4
- package/es/components/template/TemplateListing/constants/defaultProps.js +9 -6
- 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 +226 -0
- package/es/components/template/TemplateListing/index.js +75 -13
- package/es/components/template/TemplateListing/styled/index.d.ts +2 -0
- package/es/components/template/TemplateListing/styled/index.js +29 -5
- package/es/components/template/TemplateListing/types/BlankTemplate.d.ts +3 -2
- 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 +20 -9
- package/es/components/template/TemplateListing/types/index.d.ts +0 -1
- package/es/components/template/TemplateListing/types/index.js +0 -1
- 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 +3 -0
- package/es/constants/queries.js +4 -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 +11 -3
- 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/TemplateListing/index.d.ts +47 -0
- package/es/queries/TemplateListing/index.js +98 -0
- package/es/queries/index.d.ts +1 -0
- package/es/queries/index.js +1 -0
- package/es/services/TemplateListing/index.d.ts +65 -0
- package/es/services/TemplateListing/index.js +149 -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 +17 -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 +34 -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
- package/es/components/template/TemplateListing/components/TemplateItem/index.d.ts +0 -3
- package/es/components/template/TemplateListing/components/TemplateItem/index.js +0 -53
- package/es/components/template/TemplateListing/components/TemplateItem/styled.d.ts +0 -1
- package/es/components/template/TemplateListing/types/TemplateItem.d.ts +0 -14
- /package/es/components/{template/TemplateListing/types/TemplateItem.js → molecules/CalendarSelection/components/CustomPicker/types.js} +0 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
11
|
+
var t = {};
|
|
12
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
13
|
+
t[p] = s[p];
|
|
14
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
15
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
16
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
17
|
+
t[p[i]] = s[p[i]];
|
|
18
|
+
}
|
|
19
|
+
return t;
|
|
20
|
+
};
|
|
21
|
+
// Libraries
|
|
22
|
+
import React, { memo } from 'react';
|
|
23
|
+
import Icon from '@antscorp/icons';
|
|
24
|
+
import { Modal } from 'antd';
|
|
25
|
+
// Styled
|
|
26
|
+
import { ThumbnailCardWrapper } from './styled';
|
|
27
|
+
// Components
|
|
28
|
+
import { Button, Flex, Typography } from '../../atoms';
|
|
29
|
+
// Constants
|
|
30
|
+
import { THUMBNAIL_CARD_DEFAULT_HEIGHT, THUMBNAIL_CARD_DEFAULT_WIDTH } from './constants';
|
|
31
|
+
export const ThumbnailCard = memo(props => {
|
|
32
|
+
const [modal, contextHolder] = Modal.useModal();
|
|
33
|
+
const { id, name, width = THUMBNAIL_CARD_DEFAULT_WIDTH, height = THUMBNAIL_CARD_DEFAULT_HEIGHT, thumbnail, removable = true, actionAvailable = true, removeModalProps, editBtnProps, previewBtnProps, onClickWrapper } = props, restOfProps = __rest(props, ["id", "name", "width", "height", "thumbnail", "removable", "actionAvailable", "removeModalProps", "editBtnProps", "previewBtnProps", "onClickWrapper"]);
|
|
34
|
+
const _a = removeModalProps || {}, { onOk } = _a, restOfRemoveTemplateModalProps = __rest(_a, ["onOk"]);
|
|
35
|
+
const _b = editBtnProps || {}, { text: editText = 'Edit thumbnail', onClick: onClickEdit } = _b, restOfEditBtnProps = __rest(_b, ["text", "onClick"]);
|
|
36
|
+
const _c = previewBtnProps || {}, { text: previewText = 'Preview', onClick: onClickPreview } = _c, restOfPreviewBtnProps = __rest(_c, ["text", "onClick"]);
|
|
37
|
+
// Handlers
|
|
38
|
+
const handleRemoveThumbnail = e => {
|
|
39
|
+
e.stopPropagation();
|
|
40
|
+
modal.confirm(Object.assign(Object.assign({ title: 'Remove Template', centered: true, icon: React.createElement(Icon, { type: "icon-ants-info", style: { fontSize: 16, lineHeight: '25px' } }), content: (React.createElement("div", null,
|
|
41
|
+
React.createElement("p", null, "Are you sure you want to remove the template?"),
|
|
42
|
+
React.createElement("p", null, "This action cant not be undone."))), okText: 'Remove', cancelText: 'Cancel', closable: true }, restOfRemoveTemplateModalProps), { onOk: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
43
|
+
if (onOk)
|
|
44
|
+
onOk(id);
|
|
45
|
+
}) }));
|
|
46
|
+
};
|
|
47
|
+
const handleWrapperClick = e => {
|
|
48
|
+
e.stopPropagation();
|
|
49
|
+
onClickWrapper === null || onClickWrapper === void 0 ? void 0 : onClickWrapper(id);
|
|
50
|
+
};
|
|
51
|
+
return (React.createElement(Flex, Object.assign({ gap: 10, vertical: true }, restOfProps, { style: Object.assign({ width }, restOfProps.style) }),
|
|
52
|
+
React.createElement(ThumbnailCardWrapper, { style: { height, cursor: actionAvailable ? 'default' : 'pointer' }, onClick: handleWrapperClick },
|
|
53
|
+
React.createElement("div", { className: "screen" }, thumbnail && React.createElement("img", { src: thumbnail, alt: "" })),
|
|
54
|
+
actionAvailable && (React.createElement(React.Fragment, null,
|
|
55
|
+
React.createElement(Flex, { className: "center-action", align: "center", gap: 10, vertical: true },
|
|
56
|
+
React.createElement(Button, Object.assign({ type: "primary", className: "animate__animated animate__fadeIn" }, restOfEditBtnProps, { onClick: e => {
|
|
57
|
+
e.stopPropagation();
|
|
58
|
+
onClickEdit === null || onClickEdit === void 0 ? void 0 : onClickEdit(id);
|
|
59
|
+
} }),
|
|
60
|
+
React.createElement(Typography.Text, { ellipsis: { tooltip: editText }, style: { maxWidth: '100%', color: 'inherit' } }, editText)),
|
|
61
|
+
React.createElement(Button, Object.assign({ className: "animate__animated animate__fadeIn", onClick: e => {
|
|
62
|
+
e.stopPropagation();
|
|
63
|
+
onClickPreview === null || onClickPreview === void 0 ? void 0 : onClickPreview(id);
|
|
64
|
+
} }, restOfPreviewBtnProps),
|
|
65
|
+
React.createElement(Typography.Text, { ellipsis: { tooltip: previewText }, style: { maxWidth: '100%', color: 'inherit' } }, previewText))),
|
|
66
|
+
removable && (React.createElement("div", { className: "top-right-corner-action animate__animated animate__fadeIn" },
|
|
67
|
+
React.createElement(Button, { type: "primary", icon: React.createElement(Icon, { type: "icon-ants-trash-outline", style: { fontSize: 24, color: '#FFFFFF' } }), onClick: handleRemoveThumbnail }))),
|
|
68
|
+
React.createElement("div", { className: "backdrop" }),
|
|
69
|
+
React.createElement("div", null, contextHolder)))),
|
|
70
|
+
!!name && (React.createElement(Typography.Text, { ellipsis: { tooltip: name }, style: { maxWidth: '100%' } }, name))));
|
|
71
|
+
});
|
|
72
|
+
ThumbnailCard.displayName = 'ThumbnailCard';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ThumbnailCardWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,17 +1,24 @@
|
|
|
1
|
+
// Libraries
|
|
1
2
|
import styled from 'styled-components';
|
|
2
|
-
//
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
export const
|
|
3
|
+
// Images
|
|
4
|
+
import skeletonBackground from '../../../assets/images/background/skeleton-background.png';
|
|
5
|
+
const THUMBNAIL_CARD_RADIUS = 5;
|
|
6
|
+
export const ThumbnailCardWrapper = styled.div `
|
|
6
7
|
background-color: #e5e5e5;
|
|
7
8
|
padding: 10px;
|
|
8
|
-
border-radius: ${
|
|
9
|
+
border-radius: ${THUMBNAIL_CARD_RADIUS}px;
|
|
9
10
|
position: relative;
|
|
10
11
|
box-sizing: border-box;
|
|
12
|
+
width: 100%;
|
|
11
13
|
|
|
12
14
|
:hover {
|
|
13
15
|
.center-action {
|
|
14
16
|
display: flex;
|
|
17
|
+
max-width: 90%;
|
|
18
|
+
|
|
19
|
+
button {
|
|
20
|
+
max-width: 100%;
|
|
21
|
+
}
|
|
15
22
|
}
|
|
16
23
|
|
|
17
24
|
.top-right-corner-action {
|
|
@@ -26,7 +33,7 @@ export const TemplateItemWrapper = styled.div `
|
|
|
26
33
|
.screen {
|
|
27
34
|
width: 100%;
|
|
28
35
|
height: 100%;
|
|
29
|
-
background
|
|
36
|
+
background: center / cover no-repeat url(${skeletonBackground});
|
|
30
37
|
|
|
31
38
|
img {
|
|
32
39
|
width: 100%;
|
|
@@ -68,7 +75,7 @@ export const TemplateItemWrapper = styled.div `
|
|
|
68
75
|
}
|
|
69
76
|
|
|
70
77
|
.backdrop {
|
|
71
|
-
border-radius: ${
|
|
78
|
+
border-radius: ${THUMBNAIL_CARD_RADIUS}px;
|
|
72
79
|
position: absolute;
|
|
73
80
|
width: 100%;
|
|
74
81
|
height: 100%;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ModalFuncProps, ButtonProps } from 'antd';
|
|
2
|
+
import { HTMLAttributes } from 'react';
|
|
3
|
+
export type TThumbnailCardId = string | number;
|
|
4
|
+
export type TRemoveModalProps = Omit<ModalFuncProps, 'onOk'> & {
|
|
5
|
+
onOk?: (id: TThumbnailCardId) => void;
|
|
6
|
+
};
|
|
7
|
+
export type TThumbnailButton = Omit<ButtonProps, 'onClick'> & {
|
|
8
|
+
text?: string;
|
|
9
|
+
onClick?: (id: TThumbnailCardId) => void;
|
|
10
|
+
};
|
|
11
|
+
export interface ThumbnailCardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'id'> {
|
|
12
|
+
id: TThumbnailCardId;
|
|
13
|
+
name?: string;
|
|
14
|
+
width?: number;
|
|
15
|
+
height?: number;
|
|
16
|
+
thumbnail?: string;
|
|
17
|
+
removable?: boolean;
|
|
18
|
+
editBtnProps?: TThumbnailButton;
|
|
19
|
+
previewBtnProps?: TThumbnailButton;
|
|
20
|
+
actionAvailable?: boolean;
|
|
21
|
+
removeModalProps?: TRemoveModalProps;
|
|
22
|
+
onClickWrapper?: (id: TThumbnailCardId) => void;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -312,7 +312,7 @@ export const UploadImage = props => {
|
|
|
312
312
|
React.createElement(Input, { label: mode === 'video' ? 'Video URL' : 'Image URL', required: required, placeholder: placeholder, value: selectedMedia.url ? selectedMedia.url : '', focused: focused, onAfterChange: value => handleSelectMedia({
|
|
313
313
|
url: value,
|
|
314
314
|
}) }))))),
|
|
315
|
-
React.createElement(Modal, { title: labelModalDelete, visible: isOpenConfirmDelete, onOk: () => handleRemoveUploadedMedia(deleteMediaRef.current, false), onCancel: () => setOpenConfirmDelete(prev => !prev), okText: "OK", cancelText: "Cancel" },
|
|
315
|
+
React.createElement(Modal, { title: labelModalDelete, visible: isOpenConfirmDelete, onOk: () => handleRemoveUploadedMedia(deleteMediaRef.current, false), onCancel: () => setOpenConfirmDelete(prev => !prev), okText: "OK", cancelText: "Cancel", destroyOnClose: true },
|
|
316
316
|
React.createElement("p", null,
|
|
317
317
|
"Are you sure you want to delete ", (_d = deleteMediaRef.current) === null || _d === void 0 ? void 0 :
|
|
318
318
|
_d.name,
|
|
@@ -30,16 +30,21 @@ export { FontFamilySelect } from './FontFamilySelect';
|
|
|
30
30
|
export { TextDecorationSelect } from './TextDecorationSelect';
|
|
31
31
|
export { TextTransformSelect } from './TextTransformSelect';
|
|
32
32
|
export { FontSetting, FontSettingEdit } from './FontSetting';
|
|
33
|
+
export { ThumbnailCard } from './ThumbnailCard';
|
|
33
34
|
export { Form } from './Form';
|
|
34
35
|
export { ResizeGrid } from './ResizeGrid';
|
|
35
36
|
export * from './RichMenu';
|
|
36
37
|
export { ModalV2 } from './ModalV2';
|
|
38
|
+
export { TemplateSaveAs, TemplateSaveAsModal, useTemplateSave } from './TemplateSaveAs';
|
|
37
39
|
export * from './PreviewModal';
|
|
38
40
|
export * from './Drawer';
|
|
39
41
|
export { EditorScript } from './EditorScript';
|
|
42
|
+
export { CalendarSelection, CalendarSelectionConstants } from './CalendarSelection';
|
|
40
43
|
export type { AdvancedPickerProps, TAdvancedPickerOption, TAdvancedRangePickerTimeRange, } from './DatePicker';
|
|
41
44
|
export type { ColorPickerProps } from './ColorPicker';
|
|
42
45
|
export type { AlignEditProps, AlignSettingProps } from './AlignSetting';
|
|
43
46
|
export type { TFontSettingProps, TFontSettingEditProps } from './FontSetting';
|
|
44
47
|
export type { IResizeGridProps, TCell, TGrid } from './ResizeGrid';
|
|
45
48
|
export type { ModalProps } from './ModalV2';
|
|
49
|
+
export type { ThumbnailCardProps } from './ThumbnailCard';
|
|
50
|
+
export type { TemplateValueOptions } from './TemplateSaveAs';
|
|
@@ -30,10 +30,13 @@ export { FontFamilySelect } from './FontFamilySelect';
|
|
|
30
30
|
export { TextDecorationSelect } from './TextDecorationSelect';
|
|
31
31
|
export { TextTransformSelect } from './TextTransformSelect';
|
|
32
32
|
export { FontSetting, FontSettingEdit } from './FontSetting';
|
|
33
|
+
export { ThumbnailCard } from './ThumbnailCard';
|
|
33
34
|
export { Form } from './Form';
|
|
34
35
|
export { ResizeGrid } from './ResizeGrid';
|
|
35
36
|
export * from './RichMenu';
|
|
36
37
|
export { ModalV2 } from './ModalV2';
|
|
38
|
+
export { TemplateSaveAs, TemplateSaveAsModal, useTemplateSave } from './TemplateSaveAs';
|
|
37
39
|
export * from './PreviewModal';
|
|
38
40
|
export * from './Drawer';
|
|
39
41
|
export { EditorScript } from './EditorScript';
|
|
42
|
+
export { CalendarSelection, CalendarSelectionConstants } from './CalendarSelection';
|
|
@@ -100,6 +100,7 @@ const Help = props => {
|
|
|
100
100
|
const [isLoadingListHelp, setIsLoadingHelp] = useState(true);
|
|
101
101
|
const recorderRef = useRef();
|
|
102
102
|
const streamTracks = useRef();
|
|
103
|
+
const allAppOptionsRef = useRef([]);
|
|
103
104
|
// const showModal = (captureKey: CaptureTypeProps) => {
|
|
104
105
|
// setOpen(true);
|
|
105
106
|
// setCaptureType(captureKey);
|
|
@@ -218,6 +219,7 @@ const Help = props => {
|
|
|
218
219
|
}));
|
|
219
220
|
setAppTargeting(temp[0]);
|
|
220
221
|
setAllAppOptions(temp);
|
|
222
|
+
allAppOptionsRef.current = temp;
|
|
221
223
|
}
|
|
222
224
|
}
|
|
223
225
|
}
|
|
@@ -281,7 +283,6 @@ const Help = props => {
|
|
|
281
283
|
setAutoExpandParent(false);
|
|
282
284
|
setExpandedKeys([]);
|
|
283
285
|
};
|
|
284
|
-
useEffect(() => () => handleResetData(), []);
|
|
285
286
|
useEffect(() => {
|
|
286
287
|
if (dataRecorded) {
|
|
287
288
|
const dataRecordedBlob = new Blob(dataRecorded, { type: 'video/mp4' });
|
|
@@ -531,6 +532,34 @@ const Help = props => {
|
|
|
531
532
|
}
|
|
532
533
|
}
|
|
533
534
|
};
|
|
535
|
+
useEffect(() => {
|
|
536
|
+
const handleEvent = e => {
|
|
537
|
+
const { type, helpType, helpInfo } = e.data;
|
|
538
|
+
if (!type || !helpType || !helpInfo) {
|
|
539
|
+
return;
|
|
540
|
+
}
|
|
541
|
+
switch (type) {
|
|
542
|
+
case 'open_antsomi_help':
|
|
543
|
+
if (REPORT_TYPES[helpType]) {
|
|
544
|
+
setIsShowPopup(true);
|
|
545
|
+
callback(REPORT_TYPES[helpType]);
|
|
546
|
+
setValueInput(prev => (Object.assign(Object.assign({}, prev), helpInfo)));
|
|
547
|
+
if (helpInfo.feature && Array.isArray(allAppOptions)) {
|
|
548
|
+
const targetApp = allAppOptionsRef.current.find(item => item.value === helpInfo.feature);
|
|
549
|
+
if (targetApp)
|
|
550
|
+
setAppTargeting(targetApp);
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
break;
|
|
554
|
+
default:
|
|
555
|
+
}
|
|
556
|
+
};
|
|
557
|
+
window.addEventListener('message', handleEvent);
|
|
558
|
+
return () => {
|
|
559
|
+
handleResetData();
|
|
560
|
+
window.removeEventListener('message', handleEvent);
|
|
561
|
+
};
|
|
562
|
+
}, []);
|
|
534
563
|
const handleCreateTicket = (params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
535
564
|
try {
|
|
536
565
|
setIsMainLoading(true);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Menu } from './Menu';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
import React, { memo } from 'react';
|
|
3
|
+
// Styled
|
|
4
|
+
import { BannerWrapper } from './styled';
|
|
5
|
+
export const Banner = memo(props => {
|
|
6
|
+
const { deviceType, showBackgroundSkeleton = false, children } = props;
|
|
7
|
+
return (React.createElement(BannerWrapper, { deviceType: deviceType, showBackgroundSkeleton: showBackgroundSkeleton },
|
|
8
|
+
React.createElement("div", { className: "device-type" },
|
|
9
|
+
React.createElement("div", { className: "device-type__background" }),
|
|
10
|
+
React.createElement("div", { className: "device-type__wrapper" },
|
|
11
|
+
React.createElement("div", { className: "content-wrapper" }, children || null),
|
|
12
|
+
React.createElement("div", { className: "backdrop" })))));
|
|
13
|
+
});
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
// Images
|
|
3
|
+
import skeletonBackground from '../../../../../assets/images/background/skeleton-background.png';
|
|
4
|
+
import MobileFrame from '../../../../../assets/svg/mobile-frame.svg';
|
|
5
|
+
// Constants
|
|
6
|
+
import { DEVICE_TYPE } from '../../constants';
|
|
7
|
+
const THUMBNAIL_CARD_RADIUS = 5;
|
|
8
|
+
const { MOBILE } = DEVICE_TYPE;
|
|
9
|
+
const MOBILE_BORDER_RADIUS = '19px 19px 19px 21px / 21px 21px 21px 21px';
|
|
10
|
+
export const BannerWrapper = styled.div `
|
|
11
|
+
width: 100%;
|
|
12
|
+
height: 762px;
|
|
13
|
+
max-height: 762px;
|
|
14
|
+
overflow-y: hidden;
|
|
15
|
+
display: flex;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
align-items: center;
|
|
18
|
+
background-color: #0000001a;
|
|
19
|
+
|
|
20
|
+
.device-type {
|
|
21
|
+
position: relative;
|
|
22
|
+
height: 750px;
|
|
23
|
+
border-radius: ${THUMBNAIL_CARD_RADIUS}px;
|
|
24
|
+
width: 100%;
|
|
25
|
+
|
|
26
|
+
.device-type__wrapper,
|
|
27
|
+
.device-type__background {
|
|
28
|
+
width: 100%;
|
|
29
|
+
height: 100%;
|
|
30
|
+
position: absolute;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
${p => {
|
|
34
|
+
switch (p.deviceType) {
|
|
35
|
+
case MOBILE.value:
|
|
36
|
+
return `
|
|
37
|
+
width: 416.004px;
|
|
38
|
+
height: 713px;
|
|
39
|
+
display: flex;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
align-items: center;
|
|
42
|
+
|
|
43
|
+
.device-type__background {
|
|
44
|
+
background: url(${MobileFrame}) no-repeat center center;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.device-type__wrapper {
|
|
48
|
+
width: 391px;
|
|
49
|
+
left: 11px;
|
|
50
|
+
height: 661px;
|
|
51
|
+
top: 11px;
|
|
52
|
+
z-index: 1;
|
|
53
|
+
border-radius: ${MOBILE_BORDER_RADIUS};
|
|
54
|
+
|
|
55
|
+
.content-wrapper {
|
|
56
|
+
border-radius: inherit;
|
|
57
|
+
|
|
58
|
+
& > * {
|
|
59
|
+
border-radius: inherit;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
`;
|
|
64
|
+
default:
|
|
65
|
+
return p.showBackgroundSkeleton
|
|
66
|
+
? `
|
|
67
|
+
.device-type__background {
|
|
68
|
+
background: center / cover no-repeat url(${skeletonBackground});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.device-type__wrapper {
|
|
72
|
+
.backdrop {
|
|
73
|
+
border-radius: ${THUMBNAIL_CARD_RADIUS}px;
|
|
74
|
+
position: absolute;
|
|
75
|
+
width: 100%;
|
|
76
|
+
height: 100%;
|
|
77
|
+
background-color: black;
|
|
78
|
+
opacity: 0.5;
|
|
79
|
+
z-index: 10;
|
|
80
|
+
top: 0;
|
|
81
|
+
left: 0;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
`
|
|
85
|
+
: '';
|
|
86
|
+
}
|
|
87
|
+
}}
|
|
88
|
+
|
|
89
|
+
.content-wrapper {
|
|
90
|
+
position: absolute;
|
|
91
|
+
top: 0;
|
|
92
|
+
left: 0;
|
|
93
|
+
z-index: 12;
|
|
94
|
+
width: 100%;
|
|
95
|
+
height: 100%;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
`;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
import React, { memo } from 'react';
|
|
3
|
+
import Icon from '@antscorp/icons';
|
|
4
|
+
// Styled
|
|
5
|
+
import { InformationWrapper } from './styled';
|
|
6
|
+
// Components
|
|
7
|
+
import { Button, Radio, Typography, Flex } from '../../../../atoms';
|
|
8
|
+
// Constants
|
|
9
|
+
import { DEVICE_TYPE } from '../../constants';
|
|
10
|
+
export const Information = memo(props => {
|
|
11
|
+
const { deviceType, itemName = 'Template name', buttonText = 'Use template', description = '', categoryListing, showDeviceRadios = true, onButtonClick, onDeviceTypeChange, } = props;
|
|
12
|
+
return (React.createElement(InformationWrapper, { gap: 20, vertical: true },
|
|
13
|
+
React.createElement("div", { style: { flexShrink: 0 }, className: "title" }, itemName),
|
|
14
|
+
React.createElement(Flex, { gap: 20, vertical: true, className: "content-information" },
|
|
15
|
+
React.createElement("div", null, description), categoryListing === null || categoryListing === void 0 ? void 0 :
|
|
16
|
+
categoryListing.map(({ key, label, children }) => (React.createElement("div", { key: key },
|
|
17
|
+
React.createElement("div", null,
|
|
18
|
+
label,
|
|
19
|
+
":"),
|
|
20
|
+
React.createElement("div", { style: { fontWeight: 'bold' } }, children === null || children === void 0 ? void 0 : children.map(({ label }) => label).join(', ')))))),
|
|
21
|
+
showDeviceRadios && (React.createElement(Radio.Group, { options: Object.values(DEVICE_TYPE).map(({ value, label, icon }) => ({
|
|
22
|
+
label: (React.createElement(Flex, { gap: 5, align: "center" },
|
|
23
|
+
React.createElement(Icon, { type: icon }),
|
|
24
|
+
label)),
|
|
25
|
+
value,
|
|
26
|
+
})), onChange: e => onDeviceTypeChange(e.target.value), value: deviceType, optionType: "button", style: { flexShrink: 0 } })),
|
|
27
|
+
React.createElement(Button, { type: "primary", style: { width: '100%', flexShrink: 0 }, onClick: onButtonClick },
|
|
28
|
+
React.createElement(Typography.Text, { ellipsis: { tooltip: buttonText }, style: { maxWidth: '100%', color: 'inherit' } }, buttonText))));
|
|
29
|
+
});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const InformationWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/flex/interface").FlexProps<import("antd/es/_util/type").AnyObject> & import("react").RefAttributes<HTMLElement>>, any, {}, never>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
// Components
|
|
4
|
+
import { Flex } from '../../../../atoms';
|
|
5
|
+
export const InformationWrapper = styled(Flex) `
|
|
6
|
+
width: 350px;
|
|
7
|
+
flex-shrink: 0;
|
|
8
|
+
font-size: 12px;
|
|
9
|
+
max-height: 762px;
|
|
10
|
+
|
|
11
|
+
.title {
|
|
12
|
+
font-size: 16px;
|
|
13
|
+
font-weight: 700;
|
|
14
|
+
max-width: 100%;
|
|
15
|
+
color: inherit;
|
|
16
|
+
padding-right: 20px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.antsomi-radio-group {
|
|
20
|
+
width: 100%;
|
|
21
|
+
display: flex;
|
|
22
|
+
|
|
23
|
+
.antsomi-radio-button-wrapper {
|
|
24
|
+
flex: 1 1 0%;
|
|
25
|
+
display: flex;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
align-items: center;
|
|
28
|
+
height: 30px;
|
|
29
|
+
|
|
30
|
+
i {
|
|
31
|
+
height: fit-content;
|
|
32
|
+
font-size: 24px;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.content-information {
|
|
37
|
+
flex: 1 1 0%;
|
|
38
|
+
overflow-y: auto;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
`;
|
|
@@ -0,0 +1,29 @@
|
|
|
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, { memo } from 'react';
|
|
14
|
+
// Components
|
|
15
|
+
import { ThumbnailCard } from '../../../../molecules';
|
|
16
|
+
import { Empty, Flex } from '../../../../atoms';
|
|
17
|
+
// Styled
|
|
18
|
+
import { SimilarTemplateWrapper } from './styled';
|
|
19
|
+
// Constants
|
|
20
|
+
import { SIMILAR_CARD_HEIGHT_DEFAULT, SIMILAR_CARD_WIDTH_DEFAULT } from '../../constants';
|
|
21
|
+
const MAX_QUANTITY_TEMPLATES = 4;
|
|
22
|
+
export const SimilarTemplate = memo(props => {
|
|
23
|
+
var _a;
|
|
24
|
+
const { show = true, similarTemplates = [], similarCardProps } = props;
|
|
25
|
+
const _b = similarCardProps || {}, { width = SIMILAR_CARD_WIDTH_DEFAULT, height = SIMILAR_CARD_HEIGHT_DEFAULT } = _b, restOfSimilarCardProps = __rest(_b, ["width", "height"]);
|
|
26
|
+
return show ? (React.createElement(SimilarTemplateWrapper, { gap: 15, vertical: true },
|
|
27
|
+
React.createElement("div", { className: "title" }, "Similar templates"),
|
|
28
|
+
React.createElement(Flex, { gap: 30 }, ((_a = similarTemplates === null || similarTemplates === void 0 ? void 0 : similarTemplates.slice(0, MAX_QUANTITY_TEMPLATES)) === null || _a === void 0 ? void 0 : _a.map(({ id, name, thumbnail }) => (React.createElement(ThumbnailCard, Object.assign({ key: id, id: id, name: name, width: width, height: height, thumbnail: thumbnail, actionAvailable: false }, restOfSimilarCardProps))))) || React.createElement(Empty, null)))) : null;
|
|
29
|
+
});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const SimilarTemplateWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/flex/interface").FlexProps<import("antd/es/_util/type").AnyObject> & import("react").RefAttributes<HTMLElement>>, any, {}, never>;
|
|
@@ -0,0 +1,77 @@
|
|
|
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, { memo, useMemo, useRef, useState } from 'react';
|
|
14
|
+
import Icon from '@antscorp/icons';
|
|
15
|
+
import { Swiper } from 'swiper/react';
|
|
16
|
+
import 'swiper/swiper-bundle.css';
|
|
17
|
+
import { Navigation, A11y, Thumbs } from 'swiper/modules';
|
|
18
|
+
import { isEmpty } from 'lodash';
|
|
19
|
+
// Styled
|
|
20
|
+
import { SwiperSlideWrapper, ThumbnailSliderWrapper } from './styled';
|
|
21
|
+
// Components
|
|
22
|
+
import { Button, Flex } from '../../../../atoms';
|
|
23
|
+
import { ThumbnailCard } from '../../../../molecules';
|
|
24
|
+
// Constants
|
|
25
|
+
import { THUMBNAIL_HEIGHT_DEFAULT, THUMBNAIL_WIDTH_DEFAULT } from '../../constants';
|
|
26
|
+
/** Max width of list thumbnail's wrapper, it is used to show swiper if the width is greater than 990 */
|
|
27
|
+
const WRAPPER_WIDTH = 990;
|
|
28
|
+
const GAP_X = 10;
|
|
29
|
+
const ICON_SIZE = 24;
|
|
30
|
+
export const ThumbnailSlider = memo(props => {
|
|
31
|
+
const { thumbnails, width = THUMBNAIL_WIDTH_DEFAULT, height = THUMBNAIL_HEIGHT_DEFAULT, onClickThumbnail } = props, restOfThumbnailProps = __rest(props, ["thumbnails", "width", "height", "onClickThumbnail"]);
|
|
32
|
+
// States
|
|
33
|
+
const [isSlideBeginning, setSlideBeginning] = useState(false);
|
|
34
|
+
const [isSlideEnd, setSlideEnd] = useState(false);
|
|
35
|
+
// Refs
|
|
36
|
+
const navigationPrevRef = useRef(null);
|
|
37
|
+
const navigationNextRef = useRef(null);
|
|
38
|
+
// Variables
|
|
39
|
+
/** The width of per thumbnail wrapper including thumbnail card's size, icon's size and gap */
|
|
40
|
+
const thumbnailWrapperWidth = useMemo(() => width + GAP_X * 2 + ICON_SIZE, [width]);
|
|
41
|
+
// Memo
|
|
42
|
+
const isShowSwiper = useMemo(() => {
|
|
43
|
+
const calculate = ((thumbnails === null || thumbnails === void 0 ? void 0 : thumbnails.length) || 0) * thumbnailWrapperWidth;
|
|
44
|
+
return calculate > WRAPPER_WIDTH;
|
|
45
|
+
}, [thumbnails === null || thumbnails === void 0 ? void 0 : thumbnails.length, thumbnailWrapperWidth]);
|
|
46
|
+
// Renders
|
|
47
|
+
const renderThumbnail = (args) => {
|
|
48
|
+
const { thumbnail, index } = args;
|
|
49
|
+
const { id, url } = thumbnail;
|
|
50
|
+
return (React.createElement(Flex, { gap: GAP_X },
|
|
51
|
+
!!index && (React.createElement(Flex, { align: "center" },
|
|
52
|
+
React.createElement(Icon, { type: "icon-ants-expand-more", style: { fontSize: ICON_SIZE, transform: 'rotate(270deg)' } }))),
|
|
53
|
+
React.createElement(ThumbnailCard, Object.assign({ key: id, id: id, width: width, height: height, thumbnail: url, style: { flexShrink: 0 }, actionAvailable: false, onClickWrapper: () => onClickThumbnail === null || onClickThumbnail === void 0 ? void 0 : onClickThumbnail(thumbnail) }, restOfThumbnailProps))));
|
|
54
|
+
};
|
|
55
|
+
return thumbnails && !isEmpty(thumbnails) ? (React.createElement(ThumbnailSliderWrapper, null, isShowSwiper ? (React.createElement(React.Fragment, null,
|
|
56
|
+
React.createElement(Swiper, { slidesPerView: Math.floor(WRAPPER_WIDTH / thumbnailWrapperWidth), spaceBetween: GAP_X, modules: [Navigation, A11y, Thumbs], navigation: {
|
|
57
|
+
prevEl: navigationPrevRef.current,
|
|
58
|
+
nextEl: navigationNextRef.current,
|
|
59
|
+
}, onBeforeInit: swiper => {
|
|
60
|
+
setTimeout(() => {
|
|
61
|
+
// Override prevEl & nextEl now that refs are defined
|
|
62
|
+
swiper.params.navigation.prevEl = navigationPrevRef.current;
|
|
63
|
+
swiper.params.navigation.nextEl = navigationNextRef.current;
|
|
64
|
+
// Re-init navigation
|
|
65
|
+
swiper.navigation.destroy();
|
|
66
|
+
swiper.navigation.init();
|
|
67
|
+
swiper.navigation.update();
|
|
68
|
+
});
|
|
69
|
+
}, onSlideChange: ({ isBeginning, isEnd }) => {
|
|
70
|
+
setSlideBeginning(isBeginning);
|
|
71
|
+
setSlideEnd(isEnd);
|
|
72
|
+
} }, thumbnails.map((thumbnail, index) => (React.createElement(SwiperSlideWrapper, { key: `slide-${thumbnail.id}` }, renderThumbnail({ thumbnail, index }))))),
|
|
73
|
+
React.createElement(Button, { ref: navigationPrevRef, className: "custom-button-prev", disabled: isSlideBeginning },
|
|
74
|
+
React.createElement(Icon, { type: "icon-ants-expand-more" })),
|
|
75
|
+
React.createElement(Button, { ref: navigationNextRef, className: "custom-button-next", disabled: isSlideEnd },
|
|
76
|
+
React.createElement(Icon, { type: "icon-ants-expand-more" })))) : (React.createElement(Flex, { gap: GAP_X, style: { width: 'fit-content' } }, thumbnails === null || thumbnails === void 0 ? void 0 : thumbnails.map((thumbnail, index) => (React.createElement(React.Fragment, { key: thumbnail.id }, renderThumbnail({ thumbnail, index })))))))) : null;
|
|
77
|
+
});
|