@shoplflow/base 0.28.1 → 0.28.2

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/dist/index.d.cts CHANGED
@@ -1190,6 +1190,10 @@ interface PaginationOptionProps extends LeftAndRightNodeProps {
1190
1190
  * @example: [1] [2] [3] [4] [5]
1191
1191
  */
1192
1192
  pageCount?: number;
1193
+ /**
1194
+ * 내부 로직을 사용하지 않고, 외부에서 totalCount를 받을 수 있습니다
1195
+ */
1196
+ totalCount?: number;
1193
1197
  previousPage: () => void;
1194
1198
  nextPage: () => void;
1195
1199
  gotoPage: (updater: ((pageIndex: number) => number) | number) => void;
@@ -1208,7 +1212,7 @@ interface PaginationSizeSelectorProps {
1208
1212
  }
1209
1213
 
1210
1214
  declare const Pagination: {
1211
- ({ currentPage, pageCount, itemsTotalCount, pageSize, previousPage, nextPage, gotoPage, leftSource, rightSource, ...rest }: PaginationProps): react_jsx_runtime.JSX.Element;
1215
+ ({ currentPage, pageCount, itemsTotalCount, pageSize, previousPage, nextPage, gotoPage, leftSource, rightSource, totalCount, ...rest }: PaginationProps): react_jsx_runtime.JSX.Element;
1212
1216
  SizeSelector: ({ data, pageSize, setPageSize }: PaginationSizeSelectorProps) => react_jsx_runtime.JSX.Element;
1213
1217
  };
1214
1218
 
package/dist/index.d.ts CHANGED
@@ -1190,6 +1190,10 @@ interface PaginationOptionProps extends LeftAndRightNodeProps {
1190
1190
  * @example: [1] [2] [3] [4] [5]
1191
1191
  */
1192
1192
  pageCount?: number;
1193
+ /**
1194
+ * 내부 로직을 사용하지 않고, 외부에서 totalCount를 받을 수 있습니다
1195
+ */
1196
+ totalCount?: number;
1193
1197
  previousPage: () => void;
1194
1198
  nextPage: () => void;
1195
1199
  gotoPage: (updater: ((pageIndex: number) => number) | number) => void;
@@ -1208,7 +1212,7 @@ interface PaginationSizeSelectorProps {
1208
1212
  }
1209
1213
 
1210
1214
  declare const Pagination: {
1211
- ({ currentPage, pageCount, itemsTotalCount, pageSize, previousPage, nextPage, gotoPage, leftSource, rightSource, ...rest }: PaginationProps): react_jsx_runtime.JSX.Element;
1215
+ ({ currentPage, pageCount, itemsTotalCount, pageSize, previousPage, nextPage, gotoPage, leftSource, rightSource, totalCount, ...rest }: PaginationProps): react_jsx_runtime.JSX.Element;
1212
1216
  SizeSelector: ({ data, pageSize, setPageSize }: PaginationSizeSelectorProps) => react_jsx_runtime.JSX.Element;
1213
1217
  };
1214
1218
 
package/dist/index.js CHANGED
@@ -3896,7 +3896,8 @@ var Pagination = (_a) => {
3896
3896
  nextPage,
3897
3897
  gotoPage,
3898
3898
  leftSource,
3899
- rightSource
3899
+ rightSource,
3900
+ totalCount
3900
3901
  } = _b, rest = __objRest(_b, [
3901
3902
  "currentPage",
3902
3903
  "pageCount",
@@ -3906,9 +3907,10 @@ var Pagination = (_a) => {
3906
3907
  "nextPage",
3907
3908
  "gotoPage",
3908
3909
  "leftSource",
3909
- "rightSource"
3910
+ "rightSource",
3911
+ "totalCount"
3910
3912
  ]);
3911
- const pageTotalCount = Math.ceil(itemsTotalCount / Number(pageSize));
3913
+ const pageTotalCount = totalCount != null ? totalCount : Math.ceil(itemsTotalCount / Number(pageSize));
3912
3914
  const showLeftEllipsis = currentPage > pageCount - 1;
3913
3915
  const showRightEllipsis = currentPage < pageTotalCount && Math.ceil((currentPage + 1) / pageCount) < Math.ceil(pageTotalCount / pageCount);
3914
3916
  const canPreviousPage = currentPage > 0;