duokit-ui 0.1.2 → 0.1.3

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
@@ -8807,6 +8807,21 @@ function Paragraph({
8807
8807
  }
8808
8808
  );
8809
8809
  }
8810
+ var DEFAULT_PAGE_SIZE = 10;
8811
+ var useCreateTable = (props) => {
8812
+ var _a, _b, _c, _d, _e, _f;
8813
+ return reactTable.useReactTable(__spreadProps(__spreadValues({}, props), {
8814
+ manualPagination: true,
8815
+ manualFiltering: true,
8816
+ enableSorting: (_a = props.enableSorting) != null ? _a : false,
8817
+ manualSorting: true,
8818
+ pageCount: Math.ceil(
8819
+ ((_b = props.totalItems) != null ? _b : 0) / ((_e = (_d = (_c = props.state) == null ? void 0 : _c.pagination) == null ? void 0 : _d.pageSize) != null ? _e : DEFAULT_PAGE_SIZE)
8820
+ ),
8821
+ getCoreRowModel: reactTable.getCoreRowModel(),
8822
+ rowCount: (_f = props.totalItems) != null ? _f : 0
8823
+ }));
8824
+ };
8810
8825
  var useToast = () => {
8811
8826
  return sonner.toast;
8812
8827
  };
@@ -9110,6 +9125,7 @@ exports.sidebarMenuButtonVariants = sidebarMenuButtonVariants;
9110
9125
  exports.tabsListVariants = tabsListVariants;
9111
9126
  exports.toggleVariants = toggleVariants;
9112
9127
  exports.useComboboxAnchor = useComboboxAnchor;
9128
+ exports.useCreateTable = useCreateTable;
9113
9129
  exports.useIsMobile = useIsMobile;
9114
9130
  exports.useSidebar = useSidebar;
9115
9131
  exports.useToast = useToast;