@ballistix.digital/react-components 0.4.8 → 0.4.10

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.ts CHANGED
@@ -277,6 +277,7 @@ type TTableListProps<TData> = {
277
277
  visibility: VisibilityState;
278
278
  order: ColumnOrderState;
279
279
  }) => void;
280
+ onPaginate?: (current: number) => void;
280
281
  };
281
282
  declare const TableList: FC<TTableListProps<TData>>;
282
283
 
package/dist/index.esm.js CHANGED
@@ -16865,10 +16865,10 @@ var PanelPaginationNavigation = function (props) {
16865
16865
  component = (jsxs(Fragment$1, { children: [jsx("button", __assign({ className: styles.button.default, onClick: function () { return handleChangeCurrent(min); } }, { children: min })), jsx("span", __assign({ className: styles.divider }, { children: "..." })), jsx("button", __assign({ className: toClassName(styles.button.default, current === max - 2 && styles.button.active), onClick: function () { return handleChangeCurrent(max - 2); } }, { children: max - 2 })), jsx("button", __assign({ className: toClassName(styles.button.default, current === max - 1 && styles.button.active), onClick: function () { return handleChangeCurrent(max - 1); } }, { children: max - 1 })), jsx("button", __assign({ className: toClassName(styles.button.default, current === max && styles.button.active), onClick: function () { return handleChangeCurrent(max); } }, { children: max }))] }));
16866
16866
  break;
16867
16867
  case 'simple':
16868
- component = (jsxs(Fragment$1, { children: [max <= min && (jsx("button", __assign({ className: toClassName(styles.button.default, current === min && styles.button.active), onClick: function () { return handleChangeCurrent(min); } }, { children: min }))), max <= min + 1 && (jsx("button", __assign({ className: toClassName(styles.button.default, current === min + 1 && styles.button.active), onClick: function () { return handleChangeCurrent(min + 1); } }, { children: min + 1 }))), max <= min + 2 && (jsx("button", __assign({ className: toClassName(styles.button.default, current === min + 2 && styles.button.active), onClick: function () { return handleChangeCurrent(min + 2); } }, { children: min + 2 })))] }));
16868
+ component = (jsxs(Fragment$1, { children: [jsx("button", __assign({ className: toClassName(styles.button.default, current === min && styles.button.active), onClick: function () { return handleChangeCurrent(min); } }, { children: min })), max >= min + 1 && (jsx("button", __assign({ className: toClassName(styles.button.default, current === min + 1 && styles.button.active), onClick: function () { return handleChangeCurrent(min + 1); } }, { children: min + 1 }))), max >= min + 2 && (jsx("button", __assign({ className: toClassName(styles.button.default, current === min + 2 && styles.button.active), onClick: function () { return handleChangeCurrent(min + 2); } }, { children: min + 2 })))] }));
16869
16869
  break;
16870
16870
  }
16871
- return (jsxs("div", __assign({ className: styles.container }, { children: [jsxs("div", __assign({ className: "flex flex-1 justify-between sm:hidden" }, { children: [jsx("button", __assign({ className: toClassName(styles.mobile.button, current === min && styles.button.disabled), disabled: current === min, onClick: function () { return handleChangeCurrent(current - 1); } }, { children: "Previous" })), jsx("button", __assign({ className: toClassName(styles.mobile.button, current === max && styles.button.disabled), disabled: current === max, onClick: function () { return handleChangeCurrent(current + 1); } }, { children: "Next" }))] })), jsxs("div", __assign({ className: styles.desktop.container }, { children: [jsx("div", { children: jsx("div", __assign({ className: "text-sm text-gray-700" }, { children: children({ min: min, max: max, current: current }) })) }), jsx("div", { children: jsxs("nav", __assign({ className: styles.desktop.navigation, "aria-label": "Pagination" }, { children: [jsxs("button", __assign({ className: toClassName(styles.desktop.leftButton, current === min && styles.button.disabled), disabled: current === min, onClick: function () { return handleChangeCurrent(current - 1); } }, { children: [jsx("span", __assign({ className: styles.label }, { children: "Previous" })), jsx(ChevronLeftIcon, { className: styles.icon, "aria-hidden": "true" })] })), component, jsxs("button", __assign({ className: toClassName(styles.desktop.rightButton, current === max && styles.button.disabled), disabled: current === max, onClick: function () { return handleChangeCurrent(current + 1); } }, { children: [jsx("span", __assign({ className: styles.label }, { children: "Next" })), jsx(ChevronRightIcon, { className: styles.icon, "aria-hidden": "true" })] }))] })) })] }))] })));
16871
+ return (jsxs("div", __assign({ className: styles.container }, { children: [jsxs("div", __assign({ className: "flex flex-1 justify-between sm:hidden" }, { children: [jsx("button", __assign({ className: toClassName(styles.mobile.button, current === min && styles.button.disabled), disabled: current === min, onClick: function () { return handleChangeCurrent(current - 1); } }, { children: "Previous" })), jsx("button", __assign({ className: toClassName(styles.mobile.button, current === max && styles.button.disabled), disabled: current === max, onClick: function () { return handleChangeCurrent(current + 1); } }, { children: "Next" }))] })), jsxs("div", __assign({ className: styles.desktop.container }, { children: [jsx("div", { children: jsx("div", __assign({ className: "text-sm text-gray-700" }, { children: children({ min: min, max: max, current: current }) })) }), jsx("div", { children: jsxs("nav", __assign({ className: styles.desktop.navigation, "aria-label": "Pagination" }, { children: [jsxs("button", __assign({ className: toClassName(styles.desktop.leftButton, current === min && styles.button.disabled), disabled: current === min, onClick: function () { return handleChangeCurrent(current - 1); } }, { children: [jsx("span", __assign({ className: styles.label }, { children: "Previous" })), jsx(ChevronLeftIcon, { className: styles.icon, "aria-hidden": "true" })] })), component, jsxs("button", __assign({ className: toClassName(styles.desktop.rightButton, current === max && styles.button.disabled), disabled: current === max || pageType === 'simple', onClick: function () { return handleChangeCurrent(current + 1); } }, { children: [jsx("span", __assign({ className: styles.label }, { children: "Next" })), jsx(ChevronRightIcon, { className: styles.icon, "aria-hidden": "true" })] }))] })) })] }))] })));
16872
16872
  };
16873
16873
 
16874
16874
  var base$7 = {
@@ -16897,7 +16897,7 @@ var styles$8 = {
16897
16897
  };
16898
16898
 
16899
16899
  var TableList = function (props) {
16900
- var id = props.id, columns = props.columns, data = props.data, page = props.page, children = props.children, defaultOrder = props.defaultOrder, _a = props.type, type = _a === void 0 ? 'normal' : _a, _b = props.isStriped, isStriped = _b === void 0 ? false : _b, _c = props.hasStickyHeader, hasStickyHeader = _c === void 0 ? false : _c, _d = props.hasVerticalSeparators, hasVerticalSeparators = _d === void 0 ? false : _d, _e = props.areControlsVisible, areControlsVisible = _e === void 0 ? true : _e, stylesOverrides = props.styles, onChange = props.onChange;
16900
+ var id = props.id, columns = props.columns, data = props.data, page = props.page, children = props.children, defaultOrder = props.defaultOrder, _a = props.type, type = _a === void 0 ? 'normal' : _a, _b = props.isStriped, isStriped = _b === void 0 ? false : _b, _c = props.hasStickyHeader, hasStickyHeader = _c === void 0 ? false : _c, _d = props.hasVerticalSeparators, hasVerticalSeparators = _d === void 0 ? false : _d, _e = props.areControlsVisible, areControlsVisible = _e === void 0 ? true : _e, stylesOverrides = props.styles, onChange = props.onChange, onPaginate = props.onPaginate;
16901
16901
  var write = useExcel().write;
16902
16902
  var handleGenerateStyle = function () {
16903
16903
  var result = deepCopyObject(styles$7.base);
@@ -17050,7 +17050,7 @@ var TableList = function (props) {
17050
17050
  'border-b border-gray-200') }, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }), cell.id));
17051
17051
  }) }), row.id)); }) }))] })) })) })) })) })), jsx(PanelPaginationNavigation, __assign({ max: page.total, styles: (stylesOverrides === null || stylesOverrides === void 0 ? void 0 : stylesOverrides.components.panelPaginationNavigation)
17052
17052
  ? stylesOverrides === null || stylesOverrides === void 0 ? void 0 : stylesOverrides.components.panelPaginationNavigation
17053
- : { container: 'mt-4' } }, { children: children }))] })) }));
17053
+ : { container: 'mt-4' }, onChange: onPaginate }, { children: children }))] })) }));
17054
17054
  };
17055
17055
 
17056
17056
  var base$6 = {
package/dist/index.js CHANGED
@@ -16875,10 +16875,10 @@ var PanelPaginationNavigation = function (props) {
16875
16875
  component = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("button", __assign({ className: styles.button.default, onClick: function () { return handleChangeCurrent(min); } }, { children: min })), jsxRuntime.jsx("span", __assign({ className: styles.divider }, { children: "..." })), jsxRuntime.jsx("button", __assign({ className: toClassName(styles.button.default, current === max - 2 && styles.button.active), onClick: function () { return handleChangeCurrent(max - 2); } }, { children: max - 2 })), jsxRuntime.jsx("button", __assign({ className: toClassName(styles.button.default, current === max - 1 && styles.button.active), onClick: function () { return handleChangeCurrent(max - 1); } }, { children: max - 1 })), jsxRuntime.jsx("button", __assign({ className: toClassName(styles.button.default, current === max && styles.button.active), onClick: function () { return handleChangeCurrent(max); } }, { children: max }))] }));
16876
16876
  break;
16877
16877
  case 'simple':
16878
- component = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [max <= min && (jsxRuntime.jsx("button", __assign({ className: toClassName(styles.button.default, current === min && styles.button.active), onClick: function () { return handleChangeCurrent(min); } }, { children: min }))), max <= min + 1 && (jsxRuntime.jsx("button", __assign({ className: toClassName(styles.button.default, current === min + 1 && styles.button.active), onClick: function () { return handleChangeCurrent(min + 1); } }, { children: min + 1 }))), max <= min + 2 && (jsxRuntime.jsx("button", __assign({ className: toClassName(styles.button.default, current === min + 2 && styles.button.active), onClick: function () { return handleChangeCurrent(min + 2); } }, { children: min + 2 })))] }));
16878
+ component = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("button", __assign({ className: toClassName(styles.button.default, current === min && styles.button.active), onClick: function () { return handleChangeCurrent(min); } }, { children: min })), max >= min + 1 && (jsxRuntime.jsx("button", __assign({ className: toClassName(styles.button.default, current === min + 1 && styles.button.active), onClick: function () { return handleChangeCurrent(min + 1); } }, { children: min + 1 }))), max >= min + 2 && (jsxRuntime.jsx("button", __assign({ className: toClassName(styles.button.default, current === min + 2 && styles.button.active), onClick: function () { return handleChangeCurrent(min + 2); } }, { children: min + 2 })))] }));
16879
16879
  break;
16880
16880
  }
16881
- return (jsxRuntime.jsxs("div", __assign({ className: styles.container }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex flex-1 justify-between sm:hidden" }, { children: [jsxRuntime.jsx("button", __assign({ className: toClassName(styles.mobile.button, current === min && styles.button.disabled), disabled: current === min, onClick: function () { return handleChangeCurrent(current - 1); } }, { children: "Previous" })), jsxRuntime.jsx("button", __assign({ className: toClassName(styles.mobile.button, current === max && styles.button.disabled), disabled: current === max, onClick: function () { return handleChangeCurrent(current + 1); } }, { children: "Next" }))] })), jsxRuntime.jsxs("div", __assign({ className: styles.desktop.container }, { children: [jsxRuntime.jsx("div", { children: jsxRuntime.jsx("div", __assign({ className: "text-sm text-gray-700" }, { children: children({ min: min, max: max, current: current }) })) }), jsxRuntime.jsx("div", { children: jsxRuntime.jsxs("nav", __assign({ className: styles.desktop.navigation, "aria-label": "Pagination" }, { children: [jsxRuntime.jsxs("button", __assign({ className: toClassName(styles.desktop.leftButton, current === min && styles.button.disabled), disabled: current === min, onClick: function () { return handleChangeCurrent(current - 1); } }, { children: [jsxRuntime.jsx("span", __assign({ className: styles.label }, { children: "Previous" })), jsxRuntime.jsx(solid.ChevronLeftIcon, { className: styles.icon, "aria-hidden": "true" })] })), component, jsxRuntime.jsxs("button", __assign({ className: toClassName(styles.desktop.rightButton, current === max && styles.button.disabled), disabled: current === max, onClick: function () { return handleChangeCurrent(current + 1); } }, { children: [jsxRuntime.jsx("span", __assign({ className: styles.label }, { children: "Next" })), jsxRuntime.jsx(solid.ChevronRightIcon, { className: styles.icon, "aria-hidden": "true" })] }))] })) })] }))] })));
16881
+ return (jsxRuntime.jsxs("div", __assign({ className: styles.container }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex flex-1 justify-between sm:hidden" }, { children: [jsxRuntime.jsx("button", __assign({ className: toClassName(styles.mobile.button, current === min && styles.button.disabled), disabled: current === min, onClick: function () { return handleChangeCurrent(current - 1); } }, { children: "Previous" })), jsxRuntime.jsx("button", __assign({ className: toClassName(styles.mobile.button, current === max && styles.button.disabled), disabled: current === max, onClick: function () { return handleChangeCurrent(current + 1); } }, { children: "Next" }))] })), jsxRuntime.jsxs("div", __assign({ className: styles.desktop.container }, { children: [jsxRuntime.jsx("div", { children: jsxRuntime.jsx("div", __assign({ className: "text-sm text-gray-700" }, { children: children({ min: min, max: max, current: current }) })) }), jsxRuntime.jsx("div", { children: jsxRuntime.jsxs("nav", __assign({ className: styles.desktop.navigation, "aria-label": "Pagination" }, { children: [jsxRuntime.jsxs("button", __assign({ className: toClassName(styles.desktop.leftButton, current === min && styles.button.disabled), disabled: current === min, onClick: function () { return handleChangeCurrent(current - 1); } }, { children: [jsxRuntime.jsx("span", __assign({ className: styles.label }, { children: "Previous" })), jsxRuntime.jsx(solid.ChevronLeftIcon, { className: styles.icon, "aria-hidden": "true" })] })), component, jsxRuntime.jsxs("button", __assign({ className: toClassName(styles.desktop.rightButton, current === max && styles.button.disabled), disabled: current === max || pageType === 'simple', onClick: function () { return handleChangeCurrent(current + 1); } }, { children: [jsxRuntime.jsx("span", __assign({ className: styles.label }, { children: "Next" })), jsxRuntime.jsx(solid.ChevronRightIcon, { className: styles.icon, "aria-hidden": "true" })] }))] })) })] }))] })));
16882
16882
  };
16883
16883
 
16884
16884
  var base$7 = {
@@ -16907,7 +16907,7 @@ var styles$8 = {
16907
16907
  };
16908
16908
 
16909
16909
  var TableList = function (props) {
16910
- var id = props.id, columns = props.columns, data = props.data, page = props.page, children = props.children, defaultOrder = props.defaultOrder, _a = props.type, type = _a === void 0 ? 'normal' : _a, _b = props.isStriped, isStriped = _b === void 0 ? false : _b, _c = props.hasStickyHeader, hasStickyHeader = _c === void 0 ? false : _c, _d = props.hasVerticalSeparators, hasVerticalSeparators = _d === void 0 ? false : _d, _e = props.areControlsVisible, areControlsVisible = _e === void 0 ? true : _e, stylesOverrides = props.styles, onChange = props.onChange;
16910
+ var id = props.id, columns = props.columns, data = props.data, page = props.page, children = props.children, defaultOrder = props.defaultOrder, _a = props.type, type = _a === void 0 ? 'normal' : _a, _b = props.isStriped, isStriped = _b === void 0 ? false : _b, _c = props.hasStickyHeader, hasStickyHeader = _c === void 0 ? false : _c, _d = props.hasVerticalSeparators, hasVerticalSeparators = _d === void 0 ? false : _d, _e = props.areControlsVisible, areControlsVisible = _e === void 0 ? true : _e, stylesOverrides = props.styles, onChange = props.onChange, onPaginate = props.onPaginate;
16911
16911
  var write = useExcel().write;
16912
16912
  var handleGenerateStyle = function () {
16913
16913
  var result = deepCopyObject(styles$7.base);
@@ -17060,7 +17060,7 @@ var TableList = function (props) {
17060
17060
  'border-b border-gray-200') }, { children: reactTable.flexRender(cell.column.columnDef.cell, cell.getContext()) }), cell.id));
17061
17061
  }) }), row.id)); }) }))] })) })) })) })) })), jsxRuntime.jsx(PanelPaginationNavigation, __assign({ max: page.total, styles: (stylesOverrides === null || stylesOverrides === void 0 ? void 0 : stylesOverrides.components.panelPaginationNavigation)
17062
17062
  ? stylesOverrides === null || stylesOverrides === void 0 ? void 0 : stylesOverrides.components.panelPaginationNavigation
17063
- : { container: 'mt-4' } }, { children: children }))] })) }));
17063
+ : { container: 'mt-4' }, onChange: onPaginate }, { children: children }))] })) }));
17064
17064
  };
17065
17065
 
17066
17066
  var base$6 = {
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "email": "info@ballistix.digital",
8
8
  "url": "https://ballistix.digital"
9
9
  },
10
- "version": "0.4.8",
10
+ "version": "0.4.10",
11
11
  "private": false,
12
12
  "main": "dist/index.js",
13
13
  "module": "dist/index.esm.js",