@antscorp/antsomi-ui 1.3.5-beta.201 → 1.3.5-beta.203

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.
@@ -123,7 +123,7 @@ export const TemplateSaveAs = props => {
123
123
  form.setFieldValue('categories', newCategory);
124
124
  handleChangeValue({ categories: newCategory });
125
125
  };
126
- return (React.createElement(Form, { form: form, initialValues: initFormValue, colon: false, labelAlign: "left" },
126
+ return (React.createElement(Form, { form: form, initialValues: initFormValue, colon: false, labelAlign: "left", style: { height: '100%' } },
127
127
  React.createElement(TemplateSaveAsStyled, { className: className || '', vertical: true },
128
128
  React.createElement(Flex, { className: "save-options-container" },
129
129
  React.createElement(Form.Item, { name: "saveOption", noStyle: true },
@@ -6,6 +6,7 @@ import { Flex } from '@antscorp/antsomi-ui/es/components';
6
6
  import { globalToken, THEME } from '@antscorp/antsomi-ui/es/constants';
7
7
  export const TemplateSaveAsStyled = styled(Flex) `
8
8
  /* max-width: 1177px; */
9
+ height: 100%;
9
10
 
10
11
  .save-options-container {
11
12
  padding: 15px 0;
@@ -13,6 +14,10 @@ export const TemplateSaveAsStyled = styled(Flex) `
13
14
  border-bottom: 1px dashed #e5e5e5;
14
15
  }
15
16
 
17
+ div:has(> .template-container) {
18
+ height: 100%;
19
+ }
20
+
16
21
  .template-container {
17
22
  flex: 1 1 60%;
18
23
  max-height: 60vh;
@@ -32,7 +37,7 @@ export const TemplateSaveAsStyled = styled(Flex) `
32
37
  flex: 1 1 40%;
33
38
  padding-left: 20px;
34
39
  margin-left: 5px;
35
- max-height: 60vh;
40
+ /* max-height: 60vh; */
36
41
  overflow-y: auto;
37
42
  border-left: 1px solid #e5e5e5;
38
43
 
@@ -163,7 +163,6 @@ export const useTemplateListing = (options) => {
163
163
  return recursiveCategory(categoryList || []);
164
164
  }, [categoryList]);
165
165
  const templateItems = useMemo(() => mockTemplateItems.map((_, index) => (flatTemplateItems === null || flatTemplateItems === void 0 ? void 0 : flatTemplateItems[index]) || { id: random(10) }) || [], [flatTemplateItems, mockTemplateItems]);
166
- console.log({ templateItems });
167
166
  const similarTemplates = useMemo(() => {
168
167
  const maxSimilarTemplateLength = 4;
169
168
  return (getShuffleArray(templateItems.filter(item => (item === null || item === void 0 ? void 0 : item.id) !== selectedTemplateId)).slice(0, maxSimilarTemplateLength) || []);
@@ -69,23 +69,24 @@ export const TemplateListing = memo(props => {
69
69
  React.createElement(CategoryListing, Object.assign({}, categoryListingProps, { emptyProps: emptyProps })),
70
70
  React.createElement(TemplateWrapper, { className: wrapperClassName, style: wrapperStyle },
71
71
  header,
72
- React.createElement(Spin, { spinning: loading, wrapperClassName: "template-listing__loading template-listing__loading--full" },
72
+ React.createElement(Spin, { spinning: loading || !itemPerRow, wrapperClassName: "template-listing__loading template-listing__loading--full" },
73
73
  React.createElement("div", { className: "template-listing" },
74
74
  React.createElement("div", { ref: containerRef, style: {
75
75
  display: 'grid',
76
76
  gap: listingGap,
77
77
  gridTemplateColumns: `repeat(${itemPerRow}, minmax(0, 1fr))`,
78
78
  } },
79
- React.createElement(BlankTemplate, Object.assign({ width: width * ratio, height: height * ratio }, blankTemplateProps)), items === null || items === void 0 ? void 0 :
80
- items.map((item, index) => {
81
- const { id, name, thumbnail } = item || {};
82
- const loading = typeof (item === null || item === void 0 ? void 0 : item.name) === 'undefined';
83
- return (React.createElement("div", { key: id },
84
- index === items.length - 2 && React.createElement(LoadMoreBlock, { ref: loadMoreRef }),
85
- React.createElement(ThumbnailCard, Object.assign({ id: id || 0, name: name || 'Untitled', loading: loading, width: width * ratio, height: height * ratio, thumbnail: thumbnail, className: `${templateItemProps.className}`, previewBtnProps: {
86
- onClick: handleClickThumbnailPreview,
87
- } }, restOfTemplateItemProps))));
88
- })),
79
+ React.createElement(BlankTemplate, Object.assign({ width: width * ratio, height: height * ratio }, blankTemplateProps)),
80
+ !!itemPerRow &&
81
+ (items === null || items === void 0 ? void 0 : items.map((item, index) => {
82
+ const { id, name, thumbnail } = item || {};
83
+ const loading = typeof (item === null || item === void 0 ? void 0 : item.name) === 'undefined';
84
+ return (React.createElement("div", { key: id },
85
+ index === items.length - 2 && React.createElement(LoadMoreBlock, { ref: loadMoreRef }),
86
+ React.createElement(ThumbnailCard, Object.assign({ id: id || 0, name: name || 'Untitled', loading: loading, width: width * ratio, height: height * ratio, thumbnail: thumbnail, className: `${templateItemProps.className}`, previewBtnProps: {
87
+ onClick: handleClickThumbnailPreview,
88
+ } }, restOfTemplateItemProps))));
89
+ }))),
89
90
  !loading && !blankTemplateProps.show && !isHasData && React.createElement(Empty, Object.assign({}, emptyProps)))),
90
91
  footer),
91
92
  React.createElement(PreviewTemplateModal, Object.assign({ open: openPreviewModal, onOk: handleOkPreviewModal, onCancel: handleCancelPreviewModal }, restOfPreviewModalProps)))));
@@ -52,7 +52,7 @@ export const useListingItemResize = (props) => {
52
52
  }
53
53
  timeoutAfterChange.current = setTimeout(() => {
54
54
  forceUpdate();
55
- }, 500);
55
+ }, 200);
56
56
  });
57
57
  return { ref, itemPerRow, ratio, gap };
58
58
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.201",
3
+ "version": "1.3.5-beta.203",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",