tcce-design-system-test 0.3.32 → 0.3.34
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.
|
@@ -1165,6 +1165,7 @@ export declare const Nav: IStyledComponentBase<"web", FastOmit<DetailedHTMLProps
|
|
|
1165
1165
|
* @property iconColor - Optional color for the icon.
|
|
1166
1166
|
* @property href - Optional internal navigation path (renders as Link component for SPA routing).
|
|
1167
1167
|
* @property path - Optional external navigation URL (renders as Button and redirects to external app with encrypted token).
|
|
1168
|
+
* @property target - Optional target attribute for navigation. Defaults to '_blank' for external links (path).
|
|
1168
1169
|
* @property permissions - List of permissions required to access this navigation item.
|
|
1169
1170
|
* @property children - Optional array of child navigation items for nested navigation structures.
|
|
1170
1171
|
*/
|
|
@@ -1176,6 +1177,7 @@ export declare interface NavigationItem {
|
|
|
1176
1177
|
iconColor?: string;
|
|
1177
1178
|
href?: string;
|
|
1178
1179
|
path?: string;
|
|
1180
|
+
target?: '_blank' | '_self' | '_parent' | '_top';
|
|
1179
1181
|
permissions: Permission[];
|
|
1180
1182
|
children?: NavigationItem[];
|
|
1181
1183
|
}
|
|
@@ -10555,12 +10555,13 @@ const yu = yt(void 0), l1 = ({ children: e }) => {
|
|
|
10555
10555
|
}, b = () => {
|
|
10556
10556
|
a && c(!1), e.href && o?.(e.href);
|
|
10557
10557
|
}, y = async () => {
|
|
10558
|
-
if (a && c(!1),
|
|
10559
|
-
|
|
10560
|
-
|
|
10561
|
-
|
|
10562
|
-
|
|
10563
|
-
|
|
10558
|
+
if (a && c(!1), !e.path) return;
|
|
10559
|
+
const v = e.target || "_blank";
|
|
10560
|
+
try {
|
|
10561
|
+
typeof window < "u" && (v === "_blank" ? window.open(e.path, "_blank", "noopener,noreferrer") : window.location.href = e.path), l && l(!1);
|
|
10562
|
+
} catch (k) {
|
|
10563
|
+
console.error("Error al navegar a microservicio:", k);
|
|
10564
|
+
}
|
|
10564
10565
|
}, C = () => /* @__PURE__ */ V(Dt, { children: [
|
|
10565
10566
|
/* @__PURE__ */ V(f1, { children: [
|
|
10566
10567
|
n > 0 && !a && /* @__PURE__ */ g(g1, {}),
|
|
@@ -1470,7 +1470,7 @@ See https://styled-components.com/docs/faqs#why-am-i-getting-a-warning-about-sev
|
|
|
1470
1470
|
transform: rotate(${({$open:e})=>e?"90deg":"0deg"});
|
|
1471
1471
|
pointer-events: none;
|
|
1472
1472
|
transition: transform 0.3s ease-out;
|
|
1473
|
-
`,xu=({item:e,userRoles:t,level:n=0,activePath:r,onNavigate:o})=>{const[i,s]=p.useState(!1),{isCollapsed:a,setIsMobileOpen:l,setIsCollapsed:c}=Si(),d=p.useMemo(()=>(e.children||[]).filter(w=>Ci(t,w.permissions)),[e.children,t]);if(!p.useMemo(()=>Ci(t,e.permissions),[t,e.permissions]))return null;const h=d.length>0,f=e.href||e.path||"",m=!!(f&&r&&r.startsWith(f)),y=()=>{a&&c(!1),s(w=>!w)},x=()=>{a&&c(!1),e.href&&o?.(e.href)},v=async()=>{if(a&&c(!1)
|
|
1473
|
+
`,xu=({item:e,userRoles:t,level:n=0,activePath:r,onNavigate:o})=>{const[i,s]=p.useState(!1),{isCollapsed:a,setIsMobileOpen:l,setIsCollapsed:c}=Si(),d=p.useMemo(()=>(e.children||[]).filter(w=>Ci(t,w.permissions)),[e.children,t]);if(!p.useMemo(()=>Ci(t,e.permissions),[t,e.permissions]))return null;const h=d.length>0,f=e.href||e.path||"",m=!!(f&&r&&r.startsWith(f)),y=()=>{a&&c(!1),s(w=>!w)},x=()=>{a&&c(!1),e.href&&o?.(e.href)},v=async()=>{if(a&&c(!1),!e.path)return;const w=e.target||"_blank";try{typeof window<"u"&&(w==="_blank"?window.open(e.path,"_blank","noopener,noreferrer"):window.location.href=e.path),l&&l(!1)}catch(M){console.error("Error al navegar a microservicio:",M)}},T=()=>g.jsxs(g.Fragment,{children:[g.jsxs(T1,{children:[n>0&&!a&&g.jsx(E1,{}),e.icon&&g.jsx(Y,{component:e.icon,size:n===0?"md":"sm",color:"var(--color-main-blue-primary)"}),!a&&g.jsx(k1,{$level:n,size:n===0?16:n===1?14:12,color:"var(--color-dark-700, #374151)",children:e.label})]}),!a&&h&&g.jsx(M1,{$disabled:a,$open:i,children:g.jsx(Y,{component:Iy,size:"sm",color:"var(--color-main-blue-primary)"})})]});return g.jsxs($1,{$level:n,children:[e.href&&!e.path&&!h?g.jsx(S1,{type:"button",onClick:x,$level:n,$collapsed:a,$active:m,title:a?e.label:"",children:T()}):g.jsx(C1,{type:"button",onClick:h?y:e.path?v:x,$level:n,$collapsed:a,$active:m,$expanded:i&&h,title:a?e.label:"",children:T()}),g.jsx(gn,{initial:!1,children:!a&&i&&h&&g.jsx(P1,{$level:n+1,...hu,children:d.map(w=>g.jsx(xu,{item:w,userRoles:t,level:n+1,onNavigate:o,activePath:r},w.id))})})]})},Su=P(Ke.div)`
|
|
1474
1474
|
position: fixed;
|
|
1475
1475
|
inset: 0;
|
|
1476
1476
|
background: rgba(0, 0, 0, 0.5);
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.3.
|
|
6
|
+
"version": "0.3.34",
|
|
7
7
|
"description": "This package provides reusable UI components to ensure consistency across all CRM frontend applications",
|
|
8
8
|
"author": "BizAppsTotal <bizapps@tcce.biz>",
|
|
9
9
|
"type": "module",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"react": "^19.1.1",
|
|
39
39
|
"react-dom": "^19.1.1",
|
|
40
40
|
"sonner": "^2.0.7",
|
|
41
|
-
"styled-components": "
|
|
41
|
+
"styled-components": ">=6.1.19",
|
|
42
42
|
"tailwindcss": "^4.1.13",
|
|
43
43
|
"yup": "^1.7.1"
|
|
44
44
|
},
|