@shoplflow/templates 0.1.16 → 0.1.18

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.cjs CHANGED
@@ -463,9 +463,15 @@ var SmallIconButton = styled2__default.default(base.IconButton)`
463
463
  height: 12px !important;
464
464
  }
465
465
  `;
466
- var TableToolbar = ({ children, filterAccessor }) => {
466
+ var TableToolbar = ({
467
+ children,
468
+ filterAccessor,
469
+ height = "56px",
470
+ padding = "12px 20px",
471
+ totalCount
472
+ }) => {
467
473
  const { table, filterValue, setFilterValue } = useTable();
468
- const totalCount = table.getPrePaginationRowModel().rows.length;
474
+ const _totalCount = totalCount || table.getPrePaginationRowModel().rows.length;
469
475
  const onSearch = (value) => {
470
476
  var _a;
471
477
  if (!filterAccessor) {
@@ -474,8 +480,8 @@ var TableToolbar = ({ children, filterAccessor }) => {
474
480
  setFilterValue(value);
475
481
  (_a = table.getColumn(filterAccessor)) == null ? void 0 : _a.setFilterValue(value);
476
482
  };
477
- return /* @__PURE__ */ jsxRuntime.jsx(base.StackContainer.Horizontal, { width: "100%", height: "64px", align: "center", padding: "12px 24px", justify: "space-between", children: children({
478
- totalCount,
483
+ return /* @__PURE__ */ jsxRuntime.jsx(base.StackContainer.Horizontal, { width: "100%", height, align: "center", padding, justify: "space-between", children: children({
484
+ totalCount: _totalCount,
479
485
  filterAccessor: filterAccessor != null ? filterAccessor : "",
480
486
  onSearch,
481
487
  filterValue
package/dist/index.d.cts CHANGED
@@ -110,12 +110,18 @@ declare type TableMainProps = {
110
110
  };
111
111
  declare type TableToolbarProps = {
112
112
  filterAccessor?: string;
113
+ height?: string;
114
+ padding?: string;
113
115
  children: (props: {
114
116
  totalCount: number;
115
117
  filterAccessor: string;
116
118
  onSearch: (value: string) => void;
117
119
  filterValue: string;
118
120
  }) => ReactNode;
121
+ /**
122
+ * 테이블 전체 데이터 갯수
123
+ */
124
+ totalCount?: number;
119
125
  };
120
126
  declare type TableHeadCellProps = {
121
127
  header: Header<any, unknown>;
@@ -230,7 +236,7 @@ declare const TablePagination: ({ total, defaultPageSize, children, pageSizeList
230
236
  * @param {string} props.children.filterValue - 현재 필터 값
231
237
  * @returns {JSX.Element} 렌더링된 툴바 컴포넌트
232
238
  */
233
- declare const TableToolbar: ({ children, filterAccessor }: TableToolbarProps) => react_jsx_runtime.JSX.Element;
239
+ declare const TableToolbar: ({ children, filterAccessor, height, padding, totalCount, }: TableToolbarProps) => react_jsx_runtime.JSX.Element;
234
240
 
235
241
  /**
236
242
  * 테이블의 메인 렌더링을 처리하는 컴포넌트
package/dist/index.d.ts CHANGED
@@ -110,12 +110,18 @@ declare type TableMainProps = {
110
110
  };
111
111
  declare type TableToolbarProps = {
112
112
  filterAccessor?: string;
113
+ height?: string;
114
+ padding?: string;
113
115
  children: (props: {
114
116
  totalCount: number;
115
117
  filterAccessor: string;
116
118
  onSearch: (value: string) => void;
117
119
  filterValue: string;
118
120
  }) => ReactNode;
121
+ /**
122
+ * 테이블 전체 데이터 갯수
123
+ */
124
+ totalCount?: number;
119
125
  };
120
126
  declare type TableHeadCellProps = {
121
127
  header: Header<any, unknown>;
@@ -230,7 +236,7 @@ declare const TablePagination: ({ total, defaultPageSize, children, pageSizeList
230
236
  * @param {string} props.children.filterValue - 현재 필터 값
231
237
  * @returns {JSX.Element} 렌더링된 툴바 컴포넌트
232
238
  */
233
- declare const TableToolbar: ({ children, filterAccessor }: TableToolbarProps) => react_jsx_runtime.JSX.Element;
239
+ declare const TableToolbar: ({ children, filterAccessor, height, padding, totalCount, }: TableToolbarProps) => react_jsx_runtime.JSX.Element;
234
240
 
235
241
  /**
236
242
  * 테이블의 메인 렌더링을 처리하는 컴포넌트
package/dist/index.js CHANGED
@@ -457,9 +457,15 @@ var SmallIconButton = styled2(IconButton)`
457
457
  height: 12px !important;
458
458
  }
459
459
  `;
460
- var TableToolbar = ({ children, filterAccessor }) => {
460
+ var TableToolbar = ({
461
+ children,
462
+ filterAccessor,
463
+ height = "56px",
464
+ padding = "12px 20px",
465
+ totalCount
466
+ }) => {
461
467
  const { table, filterValue, setFilterValue } = useTable();
462
- const totalCount = table.getPrePaginationRowModel().rows.length;
468
+ const _totalCount = totalCount || table.getPrePaginationRowModel().rows.length;
463
469
  const onSearch = (value) => {
464
470
  var _a;
465
471
  if (!filterAccessor) {
@@ -468,8 +474,8 @@ var TableToolbar = ({ children, filterAccessor }) => {
468
474
  setFilterValue(value);
469
475
  (_a = table.getColumn(filterAccessor)) == null ? void 0 : _a.setFilterValue(value);
470
476
  };
471
- return /* @__PURE__ */ jsx(StackContainer.Horizontal, { width: "100%", height: "64px", align: "center", padding: "12px 24px", justify: "space-between", children: children({
472
- totalCount,
477
+ return /* @__PURE__ */ jsx(StackContainer.Horizontal, { width: "100%", height, align: "center", padding, justify: "space-between", children: children({
478
+ totalCount: _totalCount,
473
479
  filterAccessor: filterAccessor != null ? filterAccessor : "",
474
480
  onSearch,
475
481
  filterValue
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shoplflow/templates",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.js",
@@ -91,10 +91,10 @@
91
91
  "react-datepicker": "^7.3.0",
92
92
  "react-dom": "^18.2.0",
93
93
  "simplebar-react": "^3.2.6",
94
- "@shoplflow/base": "^0.41.9",
95
- "@shoplflow/hada-assets": "^0.1.6",
94
+ "@shoplflow/base": "^0.41.11",
95
+ "@shoplflow/hada-assets": "^0.1.7",
96
96
  "@shoplflow/shopl-assets": "^0.12.20",
97
- "@shoplflow/utils": "^0.6.5"
97
+ "@shoplflow/utils": "^0.7.0"
98
98
  },
99
99
  "scripts": {
100
100
  "type-check": "tsc --noEmit",