theme.keycloak.v2.account.resources.PageNav.js.map Maven / Gradle / Ivy
{"version":3,"file":"PageNav.js","names":["React","withRouter","Nav","NavList","makeNavItems","flattenContent","PageNavigation","Component","constructor","props","findActiveItem","currentPath","location","pathname","items","content","firstItem","item","itemPath","path","render","activeItem","createElement","PageNav"],"sources":["../src/app/PageNav.tsx"],"sourcesContent":["/*\n * Copyright 2019 Red Hat, Inc. and/or its affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as React from 'react';\nimport {withRouter, RouteComponentProps} from 'react-router-dom';\nimport {Nav, NavList} from '@patternfly/react-core';\n\nimport {makeNavItems, flattenContent, ContentItem, PageDef} from './ContentPages';\n\ndeclare const content: ContentItem[];\n\nexport interface PageNavProps extends RouteComponentProps {}\n\nexport interface PageNavState {}\n\nclass PageNavigation extends React.Component {\n\n public constructor(props: PageNavProps) {\n super(props);\n }\n\n private findActiveItem(): PageDef {\n const currentPath: string = this.props.location.pathname;\n const items: PageDef[] = flattenContent(content);\n const firstItem = items[0];\n for (let item of items) {\n const itemPath: string = '/' + item.path;\n if (itemPath === currentPath) {\n return item;\n }\n };\n\n return firstItem;\n }\n\n public render(): React.ReactNode {\n const activeItem: PageDef = this.findActiveItem();\n return (\n \n );\n }\n}\n\nexport const PageNav = withRouter(PageNavigation);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,KAAKA,KAAK;AACjB,SAAQC,UAAU;AAClB,SAAQC,GAAG,EAAEC,OAAO;AAEpB,SAAQC,YAAY,EAAEC,cAAc;AAQpC,MAAMC,cAAc,SAASN,KAAK,CAACO,SAAS,CAA6B;EAE9DC,WAAWA,CAACC,KAAmB,EAAE;IACpC,KAAK,CAACA,KAAK,CAAC;EAChB;EAEQC,cAAcA,CAAA,EAAY;IAC9B,MAAMC,WAAmB,GAAG,IAAI,CAACF,KAAK,CAACG,QAAQ,CAACC,QAAQ;IACxD,MAAMC,KAAgB,GAAGT,cAAc,CAACU,OAAO,CAAC;IAChD,MAAMC,SAAS,GAAGF,KAAK,CAAC,CAAC,CAAC;IAC1B,KAAK,IAAIG,IAAI,IAAIH,KAAK,EAAE;MACpB,MAAMI,QAAgB,GAAG,GAAG,GAAGD,IAAI,CAACE,IAAI;MACxC,IAAID,QAAQ,KAAKP,WAAW,EAAE;QAC1B,OAAOM,IAAI;MACf;IACJ;IAAC;IAED,OAAOD,SAAS;EACpB;EAEOI,MAAMA,CAAA,EAAoB;IAC7B,MAAMC,UAAmB,GAAG,IAAI,CAACX,cAAc,CAAC,CAAC;IACjD,oBACIV,KAAA,CAAAsB,aAAA,CAACpB,GAAG,qBACAF,KAAA,CAAAsB,aAAA,CAACnB,OAAO,QACHC,YAAY,CAACiB,UAAU,CACnB,CACR,CAAC;EAEd;AACJ;AAEA,OAAO,MAAME,OAAO,GAAGtB,UAAU,CAACK,cAAc,CAAC"}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy