@wavemaker/angular-codegen 12.0.0-next.45057 → 12.0.0-next.45058
Sign up to get free protection for your applications and to get access to all the features.
- angular-codegen/angular-app/package-lock.json +4462 -3472
- angular-codegen/angular-app/package.json +5 -4
- angular-codegen/angular-app/src/framework/services/customwidget-config-provider.service.ts +13 -0
- angular-codegen/angular-app/src/framework/util/page-util.ts +3 -1
- angular-codegen/dependencies/expression-parser.cjs.js +40 -1
- angular-codegen/dependencies/pipe-provider.cjs.js +292 -36
- angular-codegen/dependencies/transpilation-mobile.cjs.js +137 -8
- angular-codegen/dependencies/transpilation-web.cjs.js +137 -8
- angular-codegen/package-lock.json +1 -1
- angular-codegen/package.json +2 -2
- angular-codegen/src/codegen.js +1 -1
- angular-codegen/src/gen-components.js +1 -1
- angular-codegen/src/gen-customwidget-config.js +1 -0
- angular-codegen/src/handlebar-helpers.js +1 -1
- angular-codegen/src/pages-util.js +1 -1
- angular-codegen/templates/app.module.ts.hbs +5 -1
- angular-codegen/templates/component.config.ts.hbs +1 -0
- angular-codegen/templates/customwidget/customwidget-config.ts.hbs +6 -0
- angular-codegen/templates/customwidget/customwidget.component.script.js.hbs +3 -0
- angular-codegen/templates/customwidget/customwidget.component.ts.hbs +44 -0
- angular-codegen/templates/page/page.module.ts.hbs +6 -0
@@ -0,0 +1,44 @@
|
|
1
|
+
import { Component, Injector, Optional, ViewEncapsulation } from '@angular/core';
|
2
|
+
|
3
|
+
import { UserDefinedExecutionContext } from '@wm/core';
|
4
|
+
|
5
|
+
import { initScript } from './{{name}}.component.script';
|
6
|
+
import { getVariables } from './{{name}}.component.variables';
|
7
|
+
import { AppRef, BaseCustomWidgetComponent } from '@wm/runtime/base';
|
8
|
+
import { initCustomWidgetConfig } from '../customwidget-config'
|
9
|
+
{{WMComponentsImportStmts requiredWMComponents}}
|
10
|
+
|
11
|
+
@Component({
|
12
|
+
standalone: true,
|
13
|
+
selector: 'app-custom-{{name}}',
|
14
|
+
templateUrl: './{{name}}.component.html',
|
15
|
+
styleUrls: ['./{{name}}.component.css'],
|
16
|
+
encapsulation: ViewEncapsulation.None,
|
17
|
+
imports: [ {{WMComponentModuleStmts requiredWMComponents}}],
|
18
|
+
providers: [
|
19
|
+
{
|
20
|
+
provide: UserDefinedExecutionContext,
|
21
|
+
useExisting: {{componentName}}
|
22
|
+
}
|
23
|
+
]
|
24
|
+
})
|
25
|
+
export class {{componentName}} extends BaseCustomWidgetComponent {
|
26
|
+
|
27
|
+
override customWidgetName = '{{name}}';
|
28
|
+
[key: string]: any;
|
29
|
+
{{#if enableSpa}}spa = true;{{/if}}
|
30
|
+
|
31
|
+
constructor() {
|
32
|
+
super();
|
33
|
+
super.init();
|
34
|
+
initCustomWidgetConfig();
|
35
|
+
}
|
36
|
+
|
37
|
+
getVariables() {
|
38
|
+
return getVariables();
|
39
|
+
}
|
40
|
+
|
41
|
+
evalUserScript(Widget, App, Utils) {
|
42
|
+
initScript(Widget, App, Utils);
|
43
|
+
}
|
44
|
+
}
|
@@ -4,6 +4,7 @@ import { Routes, RouterModule } from '@angular/router';
|
|
4
4
|
|
5
5
|
import { RuntimeBaseModule, CanDeactivateNgPageGuard } from '@wm/runtime/base';
|
6
6
|
{{WMComponentsImportStmts requiredWMComponents}}
|
7
|
+
{{WMCustomComponentsImportStmts requireCustomComponents}}
|
7
8
|
|
8
9
|
import { AppCodeGenModule } from '../../app-codegen.module';
|
9
10
|
|
@@ -25,6 +26,10 @@ const requiredComponentModules = [
|
|
25
26
|
{{WMComponentModuleStmts requiredWMComponents}}
|
26
27
|
];
|
27
28
|
|
29
|
+
const requiredCustomWidgetComponents= [
|
30
|
+
{{WMCustomComponentStmts requireCustomComponents}}
|
31
|
+
]
|
32
|
+
|
28
33
|
const requiredPartialModules: any[] = [
|
29
34
|
{{PartialModuleStmts requiredPartials}}
|
30
35
|
];
|
@@ -34,6 +39,7 @@ const requiredPartialModules: any[] = [
|
|
34
39
|
imports: [
|
35
40
|
...requiredComponentModules,
|
36
41
|
...requiredPartialModules,
|
42
|
+
...requiredCustomWidgetComponents,
|
37
43
|
RouterModule.forChild(routes),
|
38
44
|
NgCommonModule,
|
39
45
|
AppCodeGenModule,
|