@sikka/hawa 0.14.4-next → 0.14.6-next

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.mts CHANGED
@@ -515,13 +515,15 @@ declare const SortButton: React__default.FC<SortButtonProps>;
515
515
  type DataTableProps<DataProps = {}> = {
516
516
  direction?: DirectionType;
517
517
  columns: ColumnDef<DataProps>[];
518
+ enableSearch?: boolean;
519
+ enableHideColumns?: boolean;
520
+ enableGoTo?: boolean;
518
521
  data: DataProps[];
519
522
  itemsPerPage?: any[];
520
523
  showCount?: boolean;
521
524
  paginationPosition?: "top" | "bottom";
522
525
  condensed?: boolean;
523
526
  isLoading?: boolean;
524
- enableGoTo?: boolean;
525
527
  defaultSort?: string;
526
528
  translateFn?: any;
527
529
  texts?: {
@@ -541,7 +543,7 @@ declare module "@tanstack/table-core" {
541
543
  sortable: any;
542
544
  }
543
545
  }
544
- declare const DataTable: <DataProps extends {}>({ columns, data, paginationPosition, translateFn, ...props }: DataTableProps<DataProps>) => React$1.JSX.Element;
546
+ declare const DataTable: <DataProps extends {}>({ columns, data, paginationPosition, translateFn, enableHideColumns, enableSearch, enableGoTo, ...props }: DataTableProps<DataProps>) => React$1.JSX.Element;
545
547
 
546
548
  type DataProps = {};
547
549
  type SimpleTableProps = {
package/dist/index.d.ts CHANGED
@@ -515,13 +515,15 @@ declare const SortButton: React__default.FC<SortButtonProps>;
515
515
  type DataTableProps<DataProps = {}> = {
516
516
  direction?: DirectionType;
517
517
  columns: ColumnDef<DataProps>[];
518
+ enableSearch?: boolean;
519
+ enableHideColumns?: boolean;
520
+ enableGoTo?: boolean;
518
521
  data: DataProps[];
519
522
  itemsPerPage?: any[];
520
523
  showCount?: boolean;
521
524
  paginationPosition?: "top" | "bottom";
522
525
  condensed?: boolean;
523
526
  isLoading?: boolean;
524
- enableGoTo?: boolean;
525
527
  defaultSort?: string;
526
528
  translateFn?: any;
527
529
  texts?: {
@@ -541,7 +543,7 @@ declare module "@tanstack/table-core" {
541
543
  sortable: any;
542
544
  }
543
545
  }
544
- declare const DataTable: <DataProps extends {}>({ columns, data, paginationPosition, translateFn, ...props }: DataTableProps<DataProps>) => React$1.JSX.Element;
546
+ declare const DataTable: <DataProps extends {}>({ columns, data, paginationPosition, translateFn, enableHideColumns, enableSearch, enableGoTo, ...props }: DataTableProps<DataProps>) => React$1.JSX.Element;
545
547
 
546
548
  type DataProps = {};
547
549
  type SimpleTableProps = {
package/dist/index.js CHANGED
@@ -5337,11 +5337,14 @@ var Input = function(_param) {
5337
5337
  };
5338
5338
  // components/elements/DataTable.tsx
5339
5339
  var DataTable = function(_param) {
5340
- var columns = _param.columns, data = _param.data, _param_paginationPosition = _param.paginationPosition, paginationPosition = _param_paginationPosition === void 0 ? "bottom" : _param_paginationPosition, translateFn = _param.translateFn, props = _object_without_properties(_param, [
5340
+ var columns = _param.columns, data = _param.data, _param_paginationPosition = _param.paginationPosition, paginationPosition = _param_paginationPosition === void 0 ? "bottom" : _param_paginationPosition, translateFn = _param.translateFn, enableHideColumns = _param.enableHideColumns, enableSearch = _param.enableSearch, enableGoTo = _param.enableGoTo, props = _object_without_properties(_param, [
5341
5341
  "columns",
5342
5342
  "data",
5343
5343
  "paginationPosition",
5344
- "translateFn"
5344
+ "translateFn",
5345
+ "enableHideColumns",
5346
+ "enableSearch",
5347
+ "enableGoTo"
5345
5348
  ]);
5346
5349
  var _props_texts, _props_itemsPerPage, _props_texts1, _props_texts2, _table_getRowModel_rows, _props_texts3, _props_texts4, _props_texts5, _props_texts6, _props_texts7, _props_texts8;
5347
5350
  var _React40_useState = _sliced_to_array(React40.useState([
@@ -5387,9 +5390,9 @@ var DataTable = function(_param) {
5387
5390
  });
5388
5391
  return /* @__PURE__ */ React40.createElement("div", {
5389
5392
  className: "hawa-flex hawa-w-full hawa-flex-col hawa-gap-4"
5390
- }, /* @__PURE__ */ React40.createElement("div", {
5393
+ }, (enableSearch || enableHideColumns) && /* @__PURE__ */ React40.createElement("div", {
5391
5394
  className: "hawa-flex hawa-items-center hawa-flex-row hawa-gap-4"
5392
- }, /* @__PURE__ */ React40.createElement(Input, {
5395
+ }, enableSearch && /* @__PURE__ */ React40.createElement(Input, {
5393
5396
  forceHideHelperText: true,
5394
5397
  placeholder: (_props_texts1 = props.texts) === null || _props_texts1 === void 0 ? void 0 : _props_texts1.searchPlaceholder,
5395
5398
  value: globalFilter !== null && globalFilter !== void 0 ? globalFilter : "",
@@ -5398,7 +5401,7 @@ var DataTable = function(_param) {
5398
5401
  },
5399
5402
  margin: "none",
5400
5403
  className: "hawa-w-full md:hawa-max-w-sm"
5401
- }), /* @__PURE__ */ React40.createElement(DropdownMenuRoot, null, /* @__PURE__ */ React40.createElement(DropdownMenuTrigger, {
5404
+ }), enableHideColumns && /* @__PURE__ */ React40.createElement(DropdownMenuRoot, null, /* @__PURE__ */ React40.createElement(DropdownMenuTrigger, {
5402
5405
  asChild: true
5403
5406
  }, /* @__PURE__ */ React40.createElement(Button, {
5404
5407
  variant: "outline",
@@ -5465,7 +5468,7 @@ var DataTable = function(_param) {
5465
5468
  dir: props.direction
5466
5469
  }, /* @__PURE__ */ React40.createElement("span", null, (_props_texts4 = props.texts) === null || _props_texts4 === void 0 ? void 0 : _props_texts4.total), " ", /* @__PURE__ */ React40.createElement("span", null, table.getFilteredRowModel().rows.length.toLocaleString())), table.getPageCount() !== 0 && /* @__PURE__ */ React40.createElement("div", {
5467
5470
  className: "hawa-flex hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 "
5468
- }, props.enableGoTo && /* @__PURE__ */ React40.createElement("div", {
5471
+ }, enableGoTo && /* @__PURE__ */ React40.createElement("div", {
5469
5472
  className: "hawa-flex hawa-flex-row hawa-justify-center hawa-items-center hawa-gap-2"
5470
5473
  }, /* @__PURE__ */ React40.createElement("span", {
5471
5474
  className: "hawa-text-sm"
package/dist/index.mjs CHANGED
@@ -5030,6 +5030,9 @@ var DataTable = ({
5030
5030
  data,
5031
5031
  paginationPosition = "bottom",
5032
5032
  translateFn,
5033
+ enableHideColumns,
5034
+ enableSearch,
5035
+ enableGoTo,
5033
5036
  ...props
5034
5037
  }) => {
5035
5038
  const [sorting, setSorting] = React40.useState([
@@ -5070,7 +5073,7 @@ var DataTable = ({
5070
5073
  label: `${item} / ${pageText}`,
5071
5074
  value: item
5072
5075
  }));
5073
- return /* @__PURE__ */ React40.createElement("div", { className: "hawa-flex hawa-w-full hawa-flex-col hawa-gap-4" }, /* @__PURE__ */ React40.createElement("div", { className: "hawa-flex hawa-items-center hawa-flex-row hawa-gap-4" }, /* @__PURE__ */ React40.createElement(
5076
+ return /* @__PURE__ */ React40.createElement("div", { className: "hawa-flex hawa-w-full hawa-flex-col hawa-gap-4" }, (enableSearch || enableHideColumns) && /* @__PURE__ */ React40.createElement("div", { className: "hawa-flex hawa-items-center hawa-flex-row hawa-gap-4" }, enableSearch && /* @__PURE__ */ React40.createElement(
5074
5077
  Input,
5075
5078
  {
5076
5079
  forceHideHelperText: true,
@@ -5080,7 +5083,7 @@ var DataTable = ({
5080
5083
  margin: "none",
5081
5084
  className: "hawa-w-full md:hawa-max-w-sm"
5082
5085
  }
5083
- ), /* @__PURE__ */ React40.createElement(DropdownMenuRoot, null, /* @__PURE__ */ React40.createElement(DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React40.createElement(
5086
+ ), enableHideColumns && /* @__PURE__ */ React40.createElement(DropdownMenuRoot, null, /* @__PURE__ */ React40.createElement(DropdownMenuTrigger, { asChild: true }, /* @__PURE__ */ React40.createElement(
5084
5087
  Button,
5085
5088
  {
5086
5089
  variant: "outline",
@@ -5166,7 +5169,7 @@ var DataTable = ({
5166
5169
  /* @__PURE__ */ React40.createElement("span", null, props.texts?.total),
5167
5170
  " ",
5168
5171
  /* @__PURE__ */ React40.createElement("span", null, table.getFilteredRowModel().rows.length.toLocaleString())
5169
- ), table.getPageCount() !== 0 && /* @__PURE__ */ React40.createElement("div", { className: "hawa-flex hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 " }, props.enableGoTo && /* @__PURE__ */ React40.createElement("div", { className: "hawa-flex hawa-flex-row hawa-justify-center hawa-items-center hawa-gap-2" }, /* @__PURE__ */ React40.createElement("span", { className: "hawa-text-sm" }, props.texts?.goTo), /* @__PURE__ */ React40.createElement(
5172
+ ), table.getPageCount() !== 0 && /* @__PURE__ */ React40.createElement("div", { className: "hawa-flex hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 " }, enableGoTo && /* @__PURE__ */ React40.createElement("div", { className: "hawa-flex hawa-flex-row hawa-justify-center hawa-items-center hawa-gap-2" }, /* @__PURE__ */ React40.createElement("span", { className: "hawa-text-sm" }, props.texts?.goTo), /* @__PURE__ */ React40.createElement(
5170
5173
  "input",
5171
5174
  {
5172
5175
  max: table.getPageCount(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sikka/hawa",
3
- "version": "0.14.4-next",
3
+ "version": "0.14.6-next",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "exports": {