@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 +13 -3
- package/dist/main.d.cts +1 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +13 -3
- package/package.json +1 -1
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
|
|
4285
|
-
const headers =
|
|
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) =>
|
|
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
package/dist/main.d.ts
CHANGED
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
|
|
4150
|
-
const headers =
|
|
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) =>
|
|
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;" });
|