@sikka/hawa 0.1.89 → 0.1.90
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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/elements/DropdownMenu.tsx +12 -2
- package/src/elements/HawaTable.tsx +4 -1
package/dist/index.d.mts
CHANGED
|
@@ -196,6 +196,7 @@ interface DropdownMenuProps {
|
|
|
196
196
|
align?: ExtendedDropdownMenuContentProps["align"];
|
|
197
197
|
alignOffset?: ExtendedDropdownMenuContentProps["alignOffset"];
|
|
198
198
|
width?: "default" | "sm" | "lg" | "parent";
|
|
199
|
+
selectCallback?: any;
|
|
199
200
|
}
|
|
200
201
|
declare const DropdownMenu: React$1.FC<DropdownMenuProps>;
|
|
201
202
|
|
|
@@ -230,7 +231,6 @@ type TableTypes = {
|
|
|
230
231
|
filter?: string;
|
|
231
232
|
};
|
|
232
233
|
bordersWidth?: string;
|
|
233
|
-
onActionClicked?: any;
|
|
234
234
|
headerTools?: boolean;
|
|
235
235
|
borders?: "all" | "cols" | "rows" | "outer" | "inner";
|
|
236
236
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -196,6 +196,7 @@ interface DropdownMenuProps {
|
|
|
196
196
|
align?: ExtendedDropdownMenuContentProps["align"];
|
|
197
197
|
alignOffset?: ExtendedDropdownMenuContentProps["alignOffset"];
|
|
198
198
|
width?: "default" | "sm" | "lg" | "parent";
|
|
199
|
+
selectCallback?: any;
|
|
199
200
|
}
|
|
200
201
|
declare const DropdownMenu: React$1.FC<DropdownMenuProps>;
|
|
201
202
|
|
|
@@ -230,7 +231,6 @@ type TableTypes = {
|
|
|
230
231
|
filter?: string;
|
|
231
232
|
};
|
|
232
233
|
bordersWidth?: string;
|
|
233
|
-
onActionClicked?: any;
|
|
234
234
|
headerTools?: boolean;
|
|
235
235
|
borders?: "all" | "cols" | "rows" | "outer" | "inner";
|
|
236
236
|
};
|
package/dist/index.js
CHANGED
|
@@ -1258,7 +1258,7 @@ var DropdownMenuShortcut = function(_param) {
|
|
|
1258
1258
|
};
|
|
1259
1259
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
1260
1260
|
var DropdownMenu = function(param) {
|
|
1261
|
-
var trigger = param.trigger, items = param.items, direction = param.direction, onItemSelect = param.onItemSelect, sideOffset = param.sideOffset, side = param.side, className = param.className, triggerClassname = param.triggerClassname, align = param.align, alignOffset = param.alignOffset, _param_width = param.width, width = _param_width === void 0 ? "default" : _param_width;
|
|
1261
|
+
var trigger = param.trigger, items = param.items, direction = param.direction, onItemSelect = param.onItemSelect, sideOffset = param.sideOffset, side = param.side, className = param.className, triggerClassname = param.triggerClassname, align = param.align, alignOffset = param.alignOffset, selectCallback = param.selectCallback, _param_width = param.width, width = _param_width === void 0 ? "default" : _param_width;
|
|
1262
1262
|
var widthStyles2 = {
|
|
1263
1263
|
default: "min-w-[8rem]",
|
|
1264
1264
|
sm: "w-fit",
|
|
@@ -1285,7 +1285,8 @@ var DropdownMenu = function(param) {
|
|
|
1285
1285
|
disabled: subitem.disabled,
|
|
1286
1286
|
className: "flex flex-row gap-2",
|
|
1287
1287
|
onSelect: function() {
|
|
1288
|
-
|
|
1288
|
+
subitem.action();
|
|
1289
|
+
selectCallback(subitem.value);
|
|
1289
1290
|
},
|
|
1290
1291
|
key: subIndex
|
|
1291
1292
|
}, subitem.icon && subitem.icon, subitem.label);
|
|
@@ -1297,7 +1298,12 @@ var DropdownMenu = function(param) {
|
|
|
1297
1298
|
if (item.presist) {
|
|
1298
1299
|
e.preventDefault();
|
|
1299
1300
|
}
|
|
1300
|
-
item.action
|
|
1301
|
+
if (item.action) {
|
|
1302
|
+
item.action();
|
|
1303
|
+
selectCallback(item.value);
|
|
1304
|
+
} else {
|
|
1305
|
+
selectCallback(item.value);
|
|
1306
|
+
}
|
|
1301
1307
|
},
|
|
1302
1308
|
end: item.end
|
|
1303
1309
|
}, item.icon && item.icon, item.label);
|
|
@@ -1526,6 +1532,9 @@ var HawaTable = function(_param) {
|
|
|
1526
1532
|
direction: direction,
|
|
1527
1533
|
side: "right",
|
|
1528
1534
|
items: props.actions,
|
|
1535
|
+
selectCallback: function(e) {
|
|
1536
|
+
return props.handleActionClick(e, singleRow);
|
|
1537
|
+
},
|
|
1529
1538
|
trigger: /* @__PURE__ */ React6.default.createElement("div", {
|
|
1530
1539
|
className: "flex w-fit cursor-pointer items-center justify-center rounded p-2 hover:bg-gray-200 dark:hover:bg-gray-600"
|
|
1531
1540
|
}, /* @__PURE__ */ React6.default.createElement("svg", {
|