@sikka/hawa 0.30.15-next → 0.30.17-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.
@@ -704,7 +704,7 @@ var Radio = (0, import_react3.forwardRef)(
704
704
  {
705
705
  htmlFor: opt.value.toString(),
706
706
  className: cn(
707
- "hawa-inline-flex hawa-h-full hawa-w-full hawa-transition-all hawa-items-center hawa-justify-between hawa-rounded-lg hawa-border hawa-border-gray-200 hawa-bg-background hawa-p-5 hawa-text-gray-500 peer-checked:hawa-border-primary peer-checked:hawa-text-primary dark:hawa-border-gray-700 dark:hawa-bg-foreground/5 dark:hawa-text-gray-400 dark:peer-checked:hawa-text-primary",
707
+ "hawa-inline-flex hawa-h-full hawa-w-full hawa-transition-all hawa-items-center hawa-justify-between hawa-rounded-lg hawa-border hawa-border-foreground/10 hawa-bg-background hawa-p-5 hawa-text-gray-500 peer-checked:hawa-border-primary peer-checked:hawa-text-primary dark:hawa-border-foreground/10 dark:hawa-bg-foreground/5 dark:hawa-text-gray-400 dark:peer-checked:hawa-text-primary",
708
708
  opt.disabled ? "hawa-opacity-50" : "hawa-cursor-pointer hover:hawa-bg-foreground/10 hover:hawa-text-gray-600 dark:hover:hawa-bg-foreground/20 dark:hover:hawa-text-gray-300"
709
709
  )
710
710
  },
@@ -7,7 +7,7 @@ import {
7
7
  } from "../../chunk-ER7YWU7Z.mjs";
8
8
  import {
9
9
  Radio
10
- } from "../../chunk-QT6SASWW.mjs";
10
+ } from "../../chunk-YR2YA3DQ.mjs";
11
11
  import {
12
12
  BadEmoji,
13
13
  GoodEmoji,
@@ -4852,7 +4852,7 @@ var Radio = (0, import_react22.forwardRef)(
4852
4852
  {
4853
4853
  htmlFor: opt.value.toString(),
4854
4854
  className: cn(
4855
- "hawa-inline-flex hawa-h-full hawa-w-full hawa-transition-all hawa-items-center hawa-justify-between hawa-rounded-lg hawa-border hawa-border-gray-200 hawa-bg-background hawa-p-5 hawa-text-gray-500 peer-checked:hawa-border-primary peer-checked:hawa-text-primary dark:hawa-border-gray-700 dark:hawa-bg-foreground/5 dark:hawa-text-gray-400 dark:peer-checked:hawa-text-primary",
4855
+ "hawa-inline-flex hawa-h-full hawa-w-full hawa-transition-all hawa-items-center hawa-justify-between hawa-rounded-lg hawa-border hawa-border-foreground/10 hawa-bg-background hawa-p-5 hawa-text-gray-500 peer-checked:hawa-border-primary peer-checked:hawa-text-primary dark:hawa-border-foreground/10 dark:hawa-bg-foreground/5 dark:hawa-text-gray-400 dark:peer-checked:hawa-text-primary",
4856
4856
  opt.disabled ? "hawa-opacity-50" : "hawa-cursor-pointer hover:hawa-bg-foreground/10 hover:hawa-text-gray-600 dark:hover:hawa-bg-foreground/20 dark:hover:hawa-text-gray-300"
4857
4857
  )
4858
4858
  },
@@ -26,7 +26,7 @@ import {
26
26
  UncheckMark,
27
27
  VeryBadEmoji,
28
28
  VeryGoodEmoji
29
- } from "../chunk-VVRT5XAJ.mjs";
29
+ } from "../chunk-CXBN42TF.mjs";
30
30
  import {
31
31
  Button,
32
32
  Card,
@@ -1150,7 +1150,7 @@ var Radio = (0, import_react11.forwardRef)(
1150
1150
  {
1151
1151
  htmlFor: opt.value.toString(),
1152
1152
  className: cn(
1153
- "hawa-inline-flex hawa-h-full hawa-w-full hawa-transition-all hawa-items-center hawa-justify-between hawa-rounded-lg hawa-border hawa-border-gray-200 hawa-bg-background hawa-p-5 hawa-text-gray-500 peer-checked:hawa-border-primary peer-checked:hawa-text-primary dark:hawa-border-gray-700 dark:hawa-bg-foreground/5 dark:hawa-text-gray-400 dark:peer-checked:hawa-text-primary",
1153
+ "hawa-inline-flex hawa-h-full hawa-w-full hawa-transition-all hawa-items-center hawa-justify-between hawa-rounded-lg hawa-border hawa-border-foreground/10 hawa-bg-background hawa-p-5 hawa-text-gray-500 peer-checked:hawa-border-primary peer-checked:hawa-text-primary dark:hawa-border-foreground/10 dark:hawa-bg-foreground/5 dark:hawa-text-gray-400 dark:peer-checked:hawa-text-primary",
1154
1154
  opt.disabled ? "hawa-opacity-50" : "hawa-cursor-pointer hover:hawa-bg-foreground/10 hover:hawa-text-gray-600 dark:hover:hawa-bg-foreground/20 dark:hover:hawa-text-gray-300"
1155
1155
  )
1156
1156
  },
@@ -6,7 +6,7 @@ import {
6
6
  import "../../chunk-47APBDKK.mjs";
7
7
  import {
8
8
  Radio
9
- } from "../../chunk-QT6SASWW.mjs";
9
+ } from "../../chunk-YR2YA3DQ.mjs";
10
10
  import {
11
11
  CheckMark,
12
12
  UncheckMark
@@ -2638,7 +2638,7 @@ var Radio = forwardRef4(
2638
2638
  {
2639
2639
  htmlFor: opt.value.toString(),
2640
2640
  className: cn(
2641
- "hawa-inline-flex hawa-h-full hawa-w-full hawa-transition-all hawa-items-center hawa-justify-between hawa-rounded-lg hawa-border hawa-border-gray-200 hawa-bg-background hawa-p-5 hawa-text-gray-500 peer-checked:hawa-border-primary peer-checked:hawa-text-primary dark:hawa-border-gray-700 dark:hawa-bg-foreground/5 dark:hawa-text-gray-400 dark:peer-checked:hawa-text-primary",
2641
+ "hawa-inline-flex hawa-h-full hawa-w-full hawa-transition-all hawa-items-center hawa-justify-between hawa-rounded-lg hawa-border hawa-border-foreground/10 hawa-bg-background hawa-p-5 hawa-text-gray-500 peer-checked:hawa-border-primary peer-checked:hawa-text-primary dark:hawa-border-foreground/10 dark:hawa-bg-foreground/5 dark:hawa-text-gray-400 dark:peer-checked:hawa-text-primary",
2642
2642
  opt.disabled ? "hawa-opacity-50" : "hawa-cursor-pointer hover:hawa-bg-foreground/10 hover:hawa-text-gray-600 dark:hover:hawa-bg-foreground/20 dark:hover:hawa-text-gray-300"
2643
2643
  )
2644
2644
  },
@@ -158,7 +158,7 @@ var Radio = forwardRef(
158
158
  {
159
159
  htmlFor: opt.value.toString(),
160
160
  className: cn(
161
- "hawa-inline-flex hawa-h-full hawa-w-full hawa-transition-all hawa-items-center hawa-justify-between hawa-rounded-lg hawa-border hawa-border-gray-200 hawa-bg-background hawa-p-5 hawa-text-gray-500 peer-checked:hawa-border-primary peer-checked:hawa-text-primary dark:hawa-border-gray-700 dark:hawa-bg-foreground/5 dark:hawa-text-gray-400 dark:peer-checked:hawa-text-primary",
161
+ "hawa-inline-flex hawa-h-full hawa-w-full hawa-transition-all hawa-items-center hawa-justify-between hawa-rounded-lg hawa-border hawa-border-foreground/10 hawa-bg-background hawa-p-5 hawa-text-gray-500 peer-checked:hawa-border-primary peer-checked:hawa-text-primary dark:hawa-border-foreground/10 dark:hawa-bg-foreground/5 dark:hawa-text-gray-400 dark:peer-checked:hawa-text-primary",
162
162
  opt.disabled ? "hawa-opacity-50" : "hawa-cursor-pointer hover:hawa-bg-foreground/10 hover:hawa-text-gray-600 dark:hover:hawa-bg-foreground/20 dark:hover:hawa-text-gray-300"
163
163
  )
164
164
  },
@@ -1111,15 +1111,9 @@ var DataTable = ({
1111
1111
  const [expanded, setExpanded] = React9.useState({});
1112
1112
  const [columnVisibility, setColumnVisibility] = React9.useState({});
1113
1113
  const [rowSelection, setRowSelection] = React9.useState({});
1114
- const visibleColumns = columns.filter(
1115
- (column) => {
1116
- var _a2;
1117
- return ((_a2 = column.meta) == null ? void 0 : _a2.hidden) !== true;
1118
- }
1119
- );
1120
1114
  const table = (0, import_react_table.useReactTable)({
1121
1115
  data,
1122
- columns: visibleColumns,
1116
+ columns,
1123
1117
  onExpandedChange: setExpanded,
1124
1118
  getExpandedRowModel: (0, import_react_table.getExpandedRowModel)(),
1125
1119
  onGlobalFilterChange: setGlobalFilter,
@@ -1139,15 +1133,22 @@ var DataTable = ({
1139
1133
  rowSelection,
1140
1134
  expanded
1141
1135
  }
1142
- // defaultColumn: {
1143
- // maxSize: 200
1144
- // }
1145
1136
  });
1146
1137
  const pageText = ((_a = props.texts) == null ? void 0 : _a.page) || "page";
1147
1138
  const itemsPerPageOptions = (_b = props.itemsPerPage) == null ? void 0 : _b.map((item) => ({
1148
1139
  label: `${item} / ${pageText}`,
1149
1140
  value: item
1150
1141
  }));
1142
+ React9.useEffect(() => {
1143
+ setColumnVisibility((prev) => {
1144
+ let newColumnVisibility = {};
1145
+ columns.forEach((column) => {
1146
+ var _a2;
1147
+ newColumnVisibility[column.accessorKey] = !((_a2 = column.meta) == null ? void 0 : _a2.hidden);
1148
+ });
1149
+ return newColumnVisibility;
1150
+ });
1151
+ }, [columns]);
1151
1152
  return /* @__PURE__ */ React9.createElement("div", { className: "hawa-flex hawa-w-full hawa-flex-col hawa-gap-4" }, (enableSearch || enableHideColumns) && /* @__PURE__ */ React9.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-4" }, enableSearch && /* @__PURE__ */ React9.createElement(
1152
1153
  Input,
1153
1154
  {