@antscorp/antsomi-ui 1.3.5-beta.672 → 1.3.5-beta.673
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.
|
@@ -10,7 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
// Libraries
|
|
13
|
-
import React, { memo
|
|
13
|
+
import React, { memo } from 'react';
|
|
14
14
|
import { isEmpty } from 'lodash';
|
|
15
15
|
// Components
|
|
16
16
|
import { ThumbnailCard } from '../../../../molecules';
|
|
@@ -24,11 +24,11 @@ export const SimilarTemplate = memo(props => {
|
|
|
24
24
|
const { show = true, similarTemplates = [], similarCardProps } = props;
|
|
25
25
|
const _b = similarCardProps || {}, { width = SIMILAR_CARD_WIDTH_DEFAULT, height = SIMILAR_CARD_HEIGHT_DEFAULT } = _b, restOfSimilarCardProps = __rest(_b, ["width", "height"]);
|
|
26
26
|
// Memo
|
|
27
|
-
const thumbnailCacheValue = useMemo(() => new Date().getTime(), []);
|
|
27
|
+
// const thumbnailCacheValue = useMemo(() => new Date().getTime(), []);
|
|
28
28
|
return show && !isEmpty(similarTemplates) ? (React.createElement(SimilarTemplateWrapper, { gap: 15, vertical: true },
|
|
29
29
|
React.createElement("div", { className: "title" }, "Similar templates"),
|
|
30
30
|
React.createElement(TemplateListWrapper, { templateQuantity: MAX_QUANTITY_TEMPLATES }, (_a = similarTemplates.slice(0, MAX_QUANTITY_TEMPLATES)) === null || _a === void 0 ? void 0 : _a.map((item, idx) => {
|
|
31
31
|
const { id, name, thumbnail } = item || {};
|
|
32
|
-
return (React.createElement(ThumbnailCard, Object.assign({ key: id, id: id || idx, name: name, width: width, height: height, thumbnail: thumbnail, actionAvailable: false, className: "thumbnail-card"
|
|
32
|
+
return (React.createElement(ThumbnailCard, Object.assign({ key: id, id: id || idx, name: name, width: width, height: height, thumbnail: thumbnail, actionAvailable: false, className: "thumbnail-card" }, restOfSimilarCardProps)));
|
|
33
33
|
})))) : null;
|
|
34
34
|
});
|
|
@@ -44,7 +44,7 @@ export const ThumbnailSlider = memo(props => {
|
|
|
44
44
|
const calculate = ((thumbnails === null || thumbnails === void 0 ? void 0 : thumbnails.length) || 0) * thumbnailWrapperWidth;
|
|
45
45
|
return calculate > WRAPPER_WIDTH;
|
|
46
46
|
}, [thumbnails === null || thumbnails === void 0 ? void 0 : thumbnails.length, thumbnailWrapperWidth]);
|
|
47
|
-
const thumbnailCacheValue = useMemo(() => new Date().getTime(), []);
|
|
47
|
+
// const thumbnailCacheValue = useMemo(() => new Date().getTime(), []);
|
|
48
48
|
// Renders
|
|
49
49
|
const renderThumbnail = (args) => {
|
|
50
50
|
const { thumbnail, index } = args;
|
|
@@ -52,7 +52,9 @@ export const ThumbnailSlider = memo(props => {
|
|
|
52
52
|
return (React.createElement(Flex, { gap: GAP_X },
|
|
53
53
|
!!index && (React.createElement(Flex, { align: "center" },
|
|
54
54
|
React.createElement(Icon, { type: "icon-ants-expand-more", style: { fontSize: ICON_SIZE, transform: 'rotate(270deg)' } }))),
|
|
55
|
-
React.createElement(ThumbnailCard, Object.assign({ key: id, id: id, width: width, height: height, thumbnail: url,
|
|
55
|
+
React.createElement(ThumbnailCard, Object.assign({ key: id, id: id, width: width, height: height, thumbnail: url,
|
|
56
|
+
// thumbnailCacheValue={thumbnailCacheValue}
|
|
57
|
+
style: { flexShrink: 0 }, className: "thumbnail-animation", actionAvailable: false, onClickWrapper: () => onClickThumbnail === null || onClickThumbnail === void 0 ? void 0 : onClickThumbnail(thumbnail) }, restOfThumbnailProps))));
|
|
56
58
|
};
|
|
57
59
|
return thumbnails && !isEmpty(thumbnails) ? (React.createElement(ThumbnailSliderWrapper, null, isShowSwiper ? (React.createElement(React.Fragment, null,
|
|
58
60
|
React.createElement(Swiper, { slidesPerView: Math.floor(WRAPPER_WIDTH / thumbnailWrapperWidth), spaceBetween: GAP_X, modules: [Navigation, A11y, Thumbs], navigation: {
|
|
@@ -11,7 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
/* eslint-disable react/function-component-definition */
|
|
13
13
|
// Libraries
|
|
14
|
-
import React, { memo,
|
|
14
|
+
import React, { memo, useState } from 'react';
|
|
15
15
|
// Components
|
|
16
16
|
import { CategoryListing, BlankTemplate } from './components';
|
|
17
17
|
import { Scrollbars, Spin } from '@antscorp/antsomi-ui/es/components/atoms';
|
|
@@ -35,7 +35,7 @@ export const TemplateListing = memo(props => {
|
|
|
35
35
|
const { onClick: onClickPreview } = previewBtnProps || {};
|
|
36
36
|
const isHasData = items.length > 0;
|
|
37
37
|
// Memo
|
|
38
|
-
const thumbnailCacheValue = useMemo(() => new Date().getTime(), []);
|
|
38
|
+
// const thumbnailCacheValue = useMemo(() => new Date().getTime(), []);
|
|
39
39
|
// Hooks
|
|
40
40
|
const { ref: containerRef, itemPerRow, ratio, gap: listingGap, } = useListingItemResize({
|
|
41
41
|
gap,
|
|
@@ -76,7 +76,9 @@ export const TemplateListing = memo(props => {
|
|
|
76
76
|
const loading = typeof (item === null || item === void 0 ? void 0 : item.name) === 'undefined';
|
|
77
77
|
return (React.createElement("div", { key: id },
|
|
78
78
|
index === items.length - 2 && React.createElement(LoadMoreBlock, { ref: loadMoreRef }),
|
|
79
|
-
React.createElement(ThumbnailCard, Object.assign({ id: id || 0, name: name || 'Untitled', loading: loading, width: width * ratio, height: height * ratio, thumbnail: thumbnail, className: `${templateItemProps.className}`,
|
|
79
|
+
React.createElement(ThumbnailCard, Object.assign({ id: id || 0, name: name || 'Untitled', loading: loading, width: width * ratio, height: height * ratio, thumbnail: thumbnail, className: `${templateItemProps.className}`,
|
|
80
|
+
// thumbnailCacheValue={thumbnailCacheValue}
|
|
81
|
+
previewBtnProps: Object.assign(Object.assign({}, previewBtnProps), { onClick: handleClickThumbnailPreview }) }, restOfTemplateItemProps))));
|
|
80
82
|
}))),
|
|
81
83
|
!loading && !blankTemplateProps.show && !isHasData && (React.createElement(EmptyData, { icon: emptyProps === null || emptyProps === void 0 ? void 0 : emptyProps.icon, title: emptyProps === null || emptyProps === void 0 ? void 0 : emptyProps.description })))));
|
|
82
84
|
return (React.createElement(TemplateListingWrapper, null,
|