UNPKG

devextreme-angular

Version:

Angular UI and visualization components based on DevExtreme widgets

1 lines 3.85 kB
{"version":3,"file":"devextreme-angular-server.mjs","sources":["../../../dist/server/render.ts","../../../dist/server/index.ts","../../../dist/server/devextreme-angular-server.ts"],"sourcesContent":["/*!\n * devextreme-angular\n * Version: 24.2.6\n * Build date: Mon Mar 17 2025\n *\n * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED\n *\n * This software may be modified and distributed under the terms\n * of the MIT license. See the LICENSE file in the root of the project for details.\n *\n * https://github.com/DevExpress/devextreme-angular\n */\n\nimport { NgModule, Inject, PLATFORM_ID } from '@angular/core';\r\nimport { isPlatformServer } from '@angular/common';\r\n\r\nimport infernoRenderer from 'devextreme/core/inferno_renderer';\r\nimport { renderToString } from 'inferno-server';\r\n\r\n@NgModule({\r\n exports: [],\r\n imports: [],\r\n providers: [],\r\n})\r\nexport class DxServerModule {\r\n constructor(@Inject(PLATFORM_ID) platformId: any) {\r\n if (isPlatformServer(platformId)) {\r\n infernoRenderer.inject({\r\n render: (\r\n component,\r\n props,\r\n container,\r\n ) => {\r\n const el = infernoRenderer.createElement(component, props);\r\n const document = container.ownerDocument;\r\n const temp = document.createElement(container.tagName);\r\n\r\n temp.innerHTML = renderToString(el);\r\n\r\n const mainElement = temp.childNodes[0];\r\n const childString = mainElement.innerHTML;\r\n\r\n for (let i = 0; i < mainElement.attributes.length; i++) {\r\n const attr = mainElement.attributes[i];\r\n\r\n if (!container.hasAttribute(attr.name)) {\r\n container.setAttribute(attr.name, attr.value);\r\n }\r\n }\r\n\r\n container.innerHTML = childString;\r\n },\r\n });\r\n }\r\n }\r\n}\r\n","/*!\n * devextreme-angular\n * Version: 24.2.6\n * Build date: Mon Mar 17 2025\n *\n * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED\n *\n * This software may be modified and distributed under the terms\n * of the MIT license. See the LICENSE file in the root of the project for details.\n *\n * https://github.com/DevExpress/devextreme-angular\n */\n\n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