@rufous/ui 0.2.75 → 0.2.76

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/main.cjs CHANGED
@@ -4014,7 +4014,9 @@ var getOperatorsForType = (type) => {
4014
4014
  ];
4015
4015
  return [
4016
4016
  { value: "contains", label: "contains" },
4017
+ { value: "does not contain", label: "does not contain" },
4017
4018
  { value: "equals", label: "equals" },
4019
+ { value: "is not equal to", label: "is not equal to" },
4018
4020
  { value: "starts with", label: "starts with" },
4019
4021
  { value: "ends with", label: "ends with" },
4020
4022
  { value: "is empty", label: "is empty" },
@@ -4234,8 +4236,12 @@ function DataGrid({
4234
4236
  switch (f.operator) {
4235
4237
  case "contains":
4236
4238
  return itemVal.includes(val);
4239
+ case "does not contain":
4240
+ return !itemVal.includes(val);
4237
4241
  case "equals":
4238
4242
  return itemVal === val;
4243
+ case "is not equal to":
4244
+ return itemVal !== val;
4239
4245
  case "starts with":
4240
4246
  return itemVal.startsWith(val);
4241
4247
  case "ends with":
@@ -4281,10 +4287,14 @@ function DataGrid({
4281
4287
  return sortedData.slice(start, start + pageSize);
4282
4288
  }, [sortedData, currentPage, pageSize]);
4283
4289
  const handleExport = () => {
4284
- const visibleCols = resolvedColumns.filter((c) => !c.hidden);
4285
- const headers = visibleCols.map((c) => c.headerName).join(",");
4290
+ const exportableCols = resolvedColumns.filter((c) => !c.hidden && c.isExportable !== false);
4291
+ const headers = exportableCols.map((c) => c.headerName).join(",");
4286
4292
  const rows = sortedData.map(
4287
- (item) => visibleCols.map((c) => `"${String(item[c.field]).replace(/"/g, '""')}"`).join(",")
4293
+ (item) => exportableCols.map((c) => {
4294
+ const raw = item[c.field];
4295
+ const val = raw === null || raw === void 0 ? "" : String(raw).replace(/"/g, '""');
4296
+ return `"${val}"`;
4297
+ }).join(",")
4288
4298
  );
4289
4299
  const csv = [headers, ...rows].join("\n");
4290
4300
  const blob = new Blob([csv], { type: "text/csv;charset=utf-8;" });
package/dist/main.d.cts CHANGED
@@ -800,6 +800,7 @@ interface Column<T> {
800
800
  cellClassName?: string;
801
801
  hideable?: boolean;
802
802
  disableColumnMenu?: boolean;
803
+ isExportable?: boolean;
803
804
  }
804
805
  interface Action<T> {
805
806
  label: string;
package/dist/main.d.ts CHANGED
@@ -800,6 +800,7 @@ interface Column<T> {
800
800
  cellClassName?: string;
801
801
  hideable?: boolean;
802
802
  disableColumnMenu?: boolean;
803
+ isExportable?: boolean;
803
804
  }
804
805
  interface Action<T> {
805
806
  label: string;
package/dist/main.js CHANGED
@@ -3879,7 +3879,9 @@ var getOperatorsForType = (type) => {
3879
3879
  ];
3880
3880
  return [
3881
3881
  { value: "contains", label: "contains" },
3882
+ { value: "does not contain", label: "does not contain" },
3882
3883
  { value: "equals", label: "equals" },
3884
+ { value: "is not equal to", label: "is not equal to" },
3883
3885
  { value: "starts with", label: "starts with" },
3884
3886
  { value: "ends with", label: "ends with" },
3885
3887
  { value: "is empty", label: "is empty" },
@@ -4099,8 +4101,12 @@ function DataGrid({
4099
4101
  switch (f.operator) {
4100
4102
  case "contains":
4101
4103
  return itemVal.includes(val);
4104
+ case "does not contain":
4105
+ return !itemVal.includes(val);
4102
4106
  case "equals":
4103
4107
  return itemVal === val;
4108
+ case "is not equal to":
4109
+ return itemVal !== val;
4104
4110
  case "starts with":
4105
4111
  return itemVal.startsWith(val);
4106
4112
  case "ends with":
@@ -4146,10 +4152,14 @@ function DataGrid({
4146
4152
  return sortedData.slice(start, start + pageSize);
4147
4153
  }, [sortedData, currentPage, pageSize]);
4148
4154
  const handleExport = () => {
4149
- const visibleCols = resolvedColumns.filter((c) => !c.hidden);
4150
- const headers = visibleCols.map((c) => c.headerName).join(",");
4155
+ const exportableCols = resolvedColumns.filter((c) => !c.hidden && c.isExportable !== false);
4156
+ const headers = exportableCols.map((c) => c.headerName).join(",");
4151
4157
  const rows = sortedData.map(
4152
- (item) => visibleCols.map((c) => `"${String(item[c.field]).replace(/"/g, '""')}"`).join(",")
4158
+ (item) => exportableCols.map((c) => {
4159
+ const raw = item[c.field];
4160
+ const val = raw === null || raw === void 0 ? "" : String(raw).replace(/"/g, '""');
4161
+ return `"${val}"`;
4162
+ }).join(",")
4153
4163
  );
4154
4164
  const csv = [headers, ...rows].join("\n");
4155
4165
  const blob = new Blob([csv], { type: "text/csv;charset=utf-8;" });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rufous/ui",
3
3
  "private": false,
4
- "version": "0.2.75",
4
+ "version": "0.2.76",
5
5
  "type": "module",
6
6
  "description": "Experimental: A lightweight React UI component library (Beta)",
7
7
  "style": "./dist/main.css",