@justbe-packages/react-components 1.0.0

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/README.md ADDED
File without changes
@@ -0,0 +1 @@
1
+ "use strict";var e=require("react"),t=require("react-router-dom");exports.MenuComponent=({menus:a})=>{const n=t.useNavigate(),m=t.useLocation(),r=e=>e.path&&m.pathname.startsWith(e.path)?"_menu-item-selected":"";return e.createElement("div",{className:"_pt-2 _pb-4 _pl-4 _pr-4"},null==a?void 0:a.map((t,a)=>{var m;return e.createElement("div",{key:a,className:"_mb-3"},e.createElement("div",{className:"_mb-3"},e.createElement("span",{className:"_font-13"},t.name)),null===(m=t.items)||void 0===m?void 0:m.map((t,a)=>e.createElement("div",{key:t.path||a,className:`_menu-item _row _ycenter _cursor-pointer ${r(t)}`,onClick:()=>{t.onClick?t.onClick():t.path&&n(t.path)}},e.createElement("div",{className:"_p-1"},t.icon&&e.createElement(e.Fragment,null,e.createElement("i",{className:`${t.icon} text-teal _font-15`}),"  "),e.createElement("span",{className:"_font-13 _font-weight-900"},t.name)))))}))};
@@ -0,0 +1 @@
1
+ export * from "./menu";
@@ -0,0 +1 @@
1
+ export * from "./menu.component";
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import "./menu.component.css";
3
+ interface IMenuItem {
4
+ name: string;
5
+ path?: string;
6
+ icon?: string;
7
+ onClick?: () => void;
8
+ }
9
+ interface IMenuSection {
10
+ name: string;
11
+ items: IMenuItem[];
12
+ }
13
+ interface IMenuComponentProps {
14
+ menus: IMenuSection[];
15
+ }
16
+ export declare const MenuComponent: React.FC<IMenuComponentProps>;
17
+ export {};
@@ -0,0 +1 @@
1
+ import e from"react";import{useNavigate as t,useLocation as a}from"react-router-dom";const m=({menus:m})=>{const n=t(),r=a(),c=e=>e.path&&r.pathname.startsWith(e.path)?"_menu-item-selected":"";return e.createElement("div",{className:"_pt-2 _pb-4 _pl-4 _pr-4"},null==m?void 0:m.map((t,a)=>{var m;return e.createElement("div",{key:a,className:"_mb-3"},e.createElement("div",{className:"_mb-3"},e.createElement("span",{className:"_font-13"},t.name)),null===(m=t.items)||void 0===m?void 0:m.map((t,a)=>e.createElement("div",{key:t.path||a,className:`_menu-item _row _ycenter _cursor-pointer ${c(t)}`,onClick:()=>{t.onClick?t.onClick():t.path&&n(t.path)}},e.createElement("div",{className:"_p-1"},t.icon&&e.createElement(e.Fragment,null,e.createElement("i",{className:`${t.icon} text-teal _font-15`}),"  "),e.createElement("span",{className:"_font-13 _font-weight-900"},t.name)))))}))};export{m as MenuComponent};
@@ -0,0 +1 @@
1
+ export * from "./menu";
@@ -0,0 +1 @@
1
+ export * from "./menu.component";
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import "./menu.component.css";
3
+ interface IMenuItem {
4
+ name: string;
5
+ path?: string;
6
+ icon?: string;
7
+ onClick?: () => void;
8
+ }
9
+ interface IMenuSection {
10
+ name: string;
11
+ items: IMenuItem[];
12
+ }
13
+ interface IMenuComponentProps {
14
+ menus: IMenuSection[];
15
+ }
16
+ export declare const MenuComponent: React.FC<IMenuComponentProps>;
17
+ export {};