@sikka/hawa 0.16.6-next → 0.16.9-next
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 +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +15 -2
- package/dist/index.mjs +15 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -972,7 +972,8 @@ type SubItem = {
|
|
|
972
972
|
value: string;
|
|
973
973
|
label: string;
|
|
974
974
|
icon?: any;
|
|
975
|
-
|
|
975
|
+
onMouseDown: (e: React$1.MouseEvent) => void;
|
|
976
|
+
onClick?: (e: React$1.MouseEvent) => void;
|
|
976
977
|
};
|
|
977
978
|
interface SidebarGroupProps {
|
|
978
979
|
title?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -972,7 +972,8 @@ type SubItem = {
|
|
|
972
972
|
value: string;
|
|
973
973
|
label: string;
|
|
974
974
|
icon?: any;
|
|
975
|
-
|
|
975
|
+
onMouseDown: (e: React$1.MouseEvent) => void;
|
|
976
|
+
onClick?: (e: React$1.MouseEvent) => void;
|
|
976
977
|
};
|
|
977
978
|
interface SidebarGroupProps {
|
|
978
979
|
title?: string;
|
package/dist/index.js
CHANGED
|
@@ -1479,6 +1479,14 @@ var DropdownMenu = function(param) {
|
|
|
1479
1479
|
dir: direction
|
|
1480
1480
|
}, item.icon && item.icon, item.label && item.label), /* @__PURE__ */ React8.createElement(DropdownMenuPortal, null, /* @__PURE__ */ React8.createElement(DropdownMenuSubContent, null, item.subitems.map(function(subitem, subIndex) {
|
|
1481
1481
|
return /* @__PURE__ */ React8.createElement(DropdownMenuItem, {
|
|
1482
|
+
onMouseDown: function(event) {
|
|
1483
|
+
if (event.button === 1 || event.button === 0 && event.ctrlKey) {
|
|
1484
|
+
event.preventDefault();
|
|
1485
|
+
if (item.onMiddleClick) {
|
|
1486
|
+
item.onMiddleClick(item.value);
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
},
|
|
1482
1490
|
key: subIndex,
|
|
1483
1491
|
className: cn(sizeStyles[size], !item.icon && !item.label ? "hawa-px-0 hawa-py-0 focus:hawa-bg-transparent" : "focus:hawa-bg-accent"),
|
|
1484
1492
|
disabled: subitem.disabled,
|
|
@@ -1493,7 +1501,7 @@ var DropdownMenu = function(param) {
|
|
|
1493
1501
|
key: index,
|
|
1494
1502
|
disabled: item.disabled,
|
|
1495
1503
|
onMouseDown: function(event) {
|
|
1496
|
-
if (event.button === 1) {
|
|
1504
|
+
if (event.button === 1 || event.button === 0 && event.ctrlKey) {
|
|
1497
1505
|
event.preventDefault();
|
|
1498
1506
|
if (item.onMiddleClick) {
|
|
1499
1507
|
item.onMiddleClick(item.value);
|
|
@@ -7201,10 +7209,15 @@ var SidebarItem = function(_param) {
|
|
|
7201
7209
|
}, item.subitems.map(function(subitem, idx) {
|
|
7202
7210
|
return /* @__PURE__ */ React62.createElement("li", {
|
|
7203
7211
|
key: idx,
|
|
7212
|
+
onMouseDown: function(e) {
|
|
7213
|
+
if (subitem.onMouseDown) {
|
|
7214
|
+
subitem.onMouseDown(e);
|
|
7215
|
+
}
|
|
7216
|
+
},
|
|
7204
7217
|
onClick: function(e) {
|
|
7205
7218
|
e.stopPropagation();
|
|
7206
7219
|
if (subitem.onClick) {
|
|
7207
|
-
subitem.onClick();
|
|
7220
|
+
subitem.onClick(e);
|
|
7208
7221
|
}
|
|
7209
7222
|
if (onSubItemClick) {
|
|
7210
7223
|
onSubItemClick([
|
package/dist/index.mjs
CHANGED
|
@@ -674,6 +674,14 @@ var DropdownMenu = ({
|
|
|
674
674
|
), /* @__PURE__ */ React8.createElement(DropdownMenuPortal, null, /* @__PURE__ */ React8.createElement(DropdownMenuSubContent, null, item.subitems.map((subitem, subIndex) => /* @__PURE__ */ React8.createElement(
|
|
675
675
|
DropdownMenuItem,
|
|
676
676
|
{
|
|
677
|
+
onMouseDown: (event) => {
|
|
678
|
+
if (event.button === 1 || event.button === 0 && event.ctrlKey) {
|
|
679
|
+
event.preventDefault();
|
|
680
|
+
if (item.onMiddleClick) {
|
|
681
|
+
item.onMiddleClick(item.value);
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
},
|
|
677
685
|
key: subIndex,
|
|
678
686
|
className: cn(
|
|
679
687
|
sizeStyles[size],
|
|
@@ -695,7 +703,7 @@ var DropdownMenu = ({
|
|
|
695
703
|
key: index,
|
|
696
704
|
disabled: item.disabled,
|
|
697
705
|
onMouseDown: (event) => {
|
|
698
|
-
if (event.button === 1) {
|
|
706
|
+
if (event.button === 1 || event.button === 0 && event.ctrlKey) {
|
|
699
707
|
event.preventDefault();
|
|
700
708
|
if (item.onMiddleClick) {
|
|
701
709
|
item.onMiddleClick(item.value);
|
|
@@ -7035,10 +7043,15 @@ var SidebarItem = ({
|
|
|
7035
7043
|
"li",
|
|
7036
7044
|
{
|
|
7037
7045
|
key: idx,
|
|
7046
|
+
onMouseDown: (e) => {
|
|
7047
|
+
if (subitem.onMouseDown) {
|
|
7048
|
+
subitem.onMouseDown(e);
|
|
7049
|
+
}
|
|
7050
|
+
},
|
|
7038
7051
|
onClick: (e) => {
|
|
7039
7052
|
e.stopPropagation();
|
|
7040
7053
|
if (subitem.onClick) {
|
|
7041
|
-
subitem.onClick();
|
|
7054
|
+
subitem.onClick(e);
|
|
7042
7055
|
}
|
|
7043
7056
|
if (onSubItemClick) {
|
|
7044
7057
|
onSubItemClick([item.value, subitem.value]);
|