@sikka/hawa 0.1.89 → 0.1.91

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.mjs CHANGED
@@ -1158,6 +1158,7 @@ var DropdownMenu = ({
1158
1158
  triggerClassname,
1159
1159
  align,
1160
1160
  alignOffset,
1161
+ selectCallback,
1161
1162
  width = "default"
1162
1163
  }) => {
1163
1164
  const widthStyles2 = {
@@ -1181,7 +1182,12 @@ var DropdownMenu = ({
1181
1182
  {
1182
1183
  disabled: subitem.disabled,
1183
1184
  className: "flex flex-row gap-2",
1184
- onSelect: () => subitem.action(),
1185
+ onSelect: () => {
1186
+ subitem.action();
1187
+ if (selectCallback) {
1188
+ selectCallback(subitem.value);
1189
+ }
1190
+ },
1185
1191
  key: subIndex
1186
1192
  },
1187
1193
  subitem.icon && subitem.icon,
@@ -1196,7 +1202,16 @@ var DropdownMenu = ({
1196
1202
  if (item.presist) {
1197
1203
  e.preventDefault();
1198
1204
  }
1199
- item.action();
1205
+ if (item.action) {
1206
+ item.action();
1207
+ if (selectCallback) {
1208
+ selectCallback(item.value);
1209
+ }
1210
+ } else {
1211
+ if (selectCallback) {
1212
+ selectCallback(item.value);
1213
+ }
1214
+ }
1200
1215
  },
1201
1216
  end: item.end
1202
1217
  },
@@ -1437,6 +1452,7 @@ var HawaTable = ({
1437
1452
  direction,
1438
1453
  side: "right",
1439
1454
  items: props.actions,
1455
+ selectCallback: (e) => props.handleActionClick(e, singleRow),
1440
1456
  trigger: /* @__PURE__ */ React20.createElement("div", { className: "flex w-fit cursor-pointer items-center justify-center rounded p-2 hover:bg-gray-200 dark:hover:bg-gray-600" }, /* @__PURE__ */ React20.createElement(
1441
1457
  "svg",
1442
1458
  {