analytica-frontend-lib 1.1.78 → 1.1.80
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/DropdownMenu/index.d.mts +2 -2
- package/dist/DropdownMenu/index.d.ts +2 -2
- package/dist/DropdownMenu/index.js +27 -4
- package/dist/DropdownMenu/index.js.map +1 -1
- package/dist/DropdownMenu/index.mjs +27 -4
- package/dist/DropdownMenu/index.mjs.map +1 -1
- package/dist/NotificationCard/index.js +27 -4
- package/dist/NotificationCard/index.js.map +1 -1
- package/dist/NotificationCard/index.mjs +27 -4
- package/dist/NotificationCard/index.mjs.map +1 -1
- package/dist/Search/index.js +27 -4
- package/dist/Search/index.js.map +1 -1
- package/dist/Search/index.mjs +27 -4
- package/dist/Search/index.mjs.map +1 -1
- package/dist/index.js +29 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +29 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -622,9 +622,23 @@ var injectStore = (children, store) => {
|
|
|
622
622
|
return Children.map(children, (child) => {
|
|
623
623
|
if (isValidElement(child)) {
|
|
624
624
|
const typedChild = child;
|
|
625
|
-
const
|
|
626
|
-
|
|
627
|
-
|
|
625
|
+
const displayName = typedChild.type.displayName;
|
|
626
|
+
const allowed = [
|
|
627
|
+
"DropdownMenuTrigger",
|
|
628
|
+
"DropdownContent",
|
|
629
|
+
"DropdownMenuContent",
|
|
630
|
+
"DropdownMenuSeparator",
|
|
631
|
+
"DropdownMenuItem",
|
|
632
|
+
"MenuLabel",
|
|
633
|
+
"ProfileMenuTrigger",
|
|
634
|
+
"ProfileMenuHeader",
|
|
635
|
+
"ProfileMenuFooter",
|
|
636
|
+
"ProfileToggleTheme"
|
|
637
|
+
];
|
|
638
|
+
let newProps = {};
|
|
639
|
+
if (allowed.includes(displayName)) {
|
|
640
|
+
newProps.store = store;
|
|
641
|
+
}
|
|
628
642
|
if (typedChild.props.children) {
|
|
629
643
|
newProps.children = injectStore(typedChild.props.children, store);
|
|
630
644
|
}
|
|
@@ -710,13 +724,22 @@ var DropdownMenuTrigger = ({
|
|
|
710
724
|
const open = useStore(store, (s) => s.open);
|
|
711
725
|
const toggleOpen = () => store.setState({ open: !open });
|
|
712
726
|
return /* @__PURE__ */ jsx6(
|
|
713
|
-
"
|
|
727
|
+
"div",
|
|
714
728
|
{
|
|
715
729
|
onClick: (e) => {
|
|
716
730
|
e.stopPropagation();
|
|
717
731
|
toggleOpen();
|
|
718
732
|
if (onClick) onClick(e);
|
|
719
733
|
},
|
|
734
|
+
role: "button",
|
|
735
|
+
onKeyDown: (e) => {
|
|
736
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
737
|
+
e.preventDefault();
|
|
738
|
+
toggleOpen();
|
|
739
|
+
if (onClick) onClick(e);
|
|
740
|
+
}
|
|
741
|
+
},
|
|
742
|
+
tabIndex: 0,
|
|
720
743
|
"aria-expanded": open,
|
|
721
744
|
className: cn(className),
|
|
722
745
|
...props,
|