theme.keycloak.v2.account.resources.Main.js.map Maven / Gradle / Ivy
{"version":3,"file":"Main.js","names":["React","ReactDOM","HashRouter","App","flattenContent","initGroupAndItemIds","isExpansion","isModulePageDef","KeycloakService","KeycloakContext","AccountServiceClient","AccountServiceContext","Main","Component","constructor","props","componentDidMount","isReactLoading","toggleReact","render","keycloakService","keycloak","createElement","Provider","value","e","removeHidden","items","visible","item","hidden","eval","push","content","length","pop","loadModule","modulePage","Promise","resolve","reject","console","log","resourceUrl","modulePath","then","module","catch","error","warn","label","message","moduleLoaders","forEach","all","domContainer","document","querySelector"],"sources":["../src/app/Main.tsx"],"sourcesContent":["/*\n * Copyright 2018 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 * as ReactDOM from 'react-dom';\n\nimport {HashRouter} from 'react-router-dom';\n\nimport {App} from './App';\nimport {ContentItem, ModulePageDef, flattenContent, initGroupAndItemIds, isExpansion, isModulePageDef} from './ContentPages';\n\nimport { KeycloakClient, KeycloakService } from './keycloak-service/keycloak.service';\nimport { KeycloakContext } from './keycloak-service/KeycloakContext';\nimport { AccountServiceClient } from './account-service/account.service';\nimport { AccountServiceContext } from './account-service/AccountServiceContext';\n\ndeclare const keycloak: KeycloakClient;\n\ndeclare let isReactLoading: boolean;\ndeclare function toggleReact(): void;\ndeclare const features: { [key: string]: boolean; };\n\nexport interface MainProps {}\nexport class Main extends React.Component {\n\n public constructor(props: MainProps) {\n super(props);\n }\n\n public componentDidMount(): void {\n isReactLoading = false;\n toggleReact();\n }\n\n public render(): React.ReactNode {\n const keycloakService = new KeycloakService(keycloak);\n return (\n \n \n \n \n \n \n \n );\n }\n};\n\ndeclare const resourceUrl: string;\ndeclare let content: ContentItem[];\nconst e = React.createElement;\n\nfunction removeHidden(items: ContentItem[]): ContentItem[] {\n const visible: ContentItem[] = [];\n\n for (let item of items) {\n if (item.hidden && eval(item.hidden)) continue;\n\n if (isExpansion(item)) {\n visible.push(item);\n item.content = removeHidden(item.content);\n if (item.content.length === 0) {\n visible.pop(); // remove empty expansion\n }\n } else {\n visible.push(item);\n }\n }\n\n return visible;\n}\n\ncontent = removeHidden(content);\ninitGroupAndItemIds();\n\nfunction loadModule(modulePage: ModulePageDef): Promise {\n return new Promise ((resolve, reject) => {\n console.log('loading: ' + resourceUrl + modulePage.modulePath);\n import(resourceUrl + modulePage.modulePath).then( (module: React.Component) => {\n modulePage.module = module;\n resolve(modulePage);\n }).catch((error: Error) => {\n console.warn('Unable to load ' + modulePage.label + ' because ' + error.message);\n reject(modulePage);\n });\n });\n};\n\nconst moduleLoaders: Promise[] = [];\nflattenContent(content).forEach((item: ContentItem) => {\n if (isModulePageDef(item)) {\n moduleLoaders.push(loadModule(item));\n }\n});\n\n// load content modules and start\nPromise.all(moduleLoaders).then(() => {\n const domContainer = document.querySelector('#main_react_container');\n ReactDOM.render(e(Main), domContainer);\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,KAAKA,KAAK;AACjB,OAAO,KAAKC,QAAQ;AAEpB,SAAQC,UAAU;AAElB,SAAQC,GAAG;AACX,SAAoCC,cAAc,EAAEC,mBAAmB,EAAEC,WAAW,EAAEC,eAAe;AAErG,SAAyBC,eAAe;AACxC,SAASC,eAAe;AACxB,SAASC,oBAAoB;AAC7B,SAASC,qBAAqB;AAS9B,OAAO,MAAMC,IAAI,SAASZ,KAAK,CAACa,SAAS,CAAY;EAE1CC,WAAWA,CAACC,KAAgB,EAAE;IACjC,KAAK,CAACA,KAAK,C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