@appcorp/shadcn 1.1.44 → 1.1.45
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.
|
@@ -23,7 +23,7 @@ export interface RowAction {
|
|
|
23
23
|
id?: string;
|
|
24
24
|
key?: string;
|
|
25
25
|
label: string;
|
|
26
|
-
enabled?: boolean;
|
|
26
|
+
enabled?: boolean | ((row?: TableRow) => boolean);
|
|
27
27
|
order?: number;
|
|
28
28
|
variant?: "default" | "destructive";
|
|
29
29
|
/** Preferred handler for row and header actions. Receives the full `row` when invoked from a row. */
|
|
@@ -33,7 +33,7 @@ export interface HeaderAction {
|
|
|
33
33
|
id?: string;
|
|
34
34
|
key?: string;
|
|
35
35
|
label: string;
|
|
36
|
-
enabled?: boolean;
|
|
36
|
+
enabled?: boolean | ((row?: TableRow) => boolean);
|
|
37
37
|
order?: number;
|
|
38
38
|
variant?: "default" | "outline" | "secondary";
|
|
39
39
|
/** Preferred handler — will receive a `row` when invoked from row actions. */
|
|
@@ -180,7 +180,10 @@ var EnhancedTable = function (_a) {
|
|
|
180
180
|
react_1.default.createElement(dropdown_menu_1.DropdownMenuTrigger, { asChild: true },
|
|
181
181
|
react_1.default.createElement(lucide_react_1.MoreHorizontal, { className: "h-4 w-4" })),
|
|
182
182
|
react_1.default.createElement(dropdown_menu_1.DropdownMenuContent, { align: "end" }, rowActions
|
|
183
|
-
.filter(function (
|
|
183
|
+
.filter(function (_a) {
|
|
184
|
+
var enabled = _a.enabled;
|
|
185
|
+
return typeof enabled === "function" ? enabled(row) : enabled;
|
|
186
|
+
})
|
|
184
187
|
.sort(function (a, b) { return (a.order || 0) - (b.order || 0); })
|
|
185
188
|
.map(function (action, index) { return (react_1.default.createElement(dropdown_menu_1.DropdownMenuItem, { key: action.id || action.key || index, "data-testid": _testIdRowActionPrefix
|
|
186
189
|
? "".concat(_testIdRowActionPrefix, "-").concat(rowIndex, "-").concat(index)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appcorp/shadcn",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.45",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build:next": "next build",
|
|
6
6
|
"build:storybook": "mv ../.pnp.cjs ../.pnp.cjs.bak 2>/dev/null || true && storybook build -c .storybook -o .out && mv ../.pnp.cjs.bak ../.pnp.cjs 2>/dev/null || true",
|