@syncfusion/ej2-angular-base 25.2.7-18564 → 26.1.39
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.
- package/.eslintrc.json +261 -0
- package/dist/ej2-angular-base.umd.min.js +2 -2
- package/dist/ej2-angular-base.umd.min.js.map +1 -1
- package/dist/es6/ej2-angular-base.es2015.js +233 -213
- package/dist/es6/ej2-angular-base.es2015.js.map +1 -1
- package/dist/es6/ej2-angular-base.es5.js +157 -137
- package/dist/es6/ej2-angular-base.es5.js.map +1 -1
- package/dist/global/ej2-angular-base.min.js +2 -2
- package/dist/global/ej2-angular-base.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +10 -13
- package/schematics/generators/component-builder.d.ts +3 -0
- package/schematics/generators/component-builder.js +23 -22
- package/schematics/generators/index.js +1 -0
- package/schematics/index.d.ts +0 -4
- package/schematics/index.js +21 -9
- package/schematics/ng-add/index.d.ts +3 -0
- package/schematics/ng-add/index.js +14 -12
- package/schematics/ng-add/theme.d.ts +3 -0
- package/schematics/ng-add/theme.js +10 -8
- package/schematics/utils/ast.d.ts +3 -2
- package/schematics/utils/ast.js +8 -8
- package/schematics/utils/get-project.d.ts +4 -2
- package/schematics/utils/get-project.js +3 -2
- package/schematics/utils/helpers/helpers.js +19 -18
- package/schematics/utils/package.js +1 -0
- package/schematics/utils/project-style-file.d.ts +5 -3
- package/schematics/utils/project-style-file.js +4 -3
- package/src/complex-array-base.d.ts +1 -0
- package/src/complex-array-base.js +31 -28
- package/src/component-base.d.ts +1 -0
- package/src/component-base.js +38 -52
- package/src/form-base.d.ts +3 -3
- package/src/form-base.js +0 -4
- package/src/template.d.ts +8 -1
- package/src/template.js +23 -5
- package/src/util.d.ts +26 -3
- package/src/util.js +51 -28
- package/styles/fluent2.css +1033 -0
- package/styles/fluent2.scss +1 -0
- package/styles/material3-dark.css +1 -1
- package/styles/material3.css +1 -1
- package/tslint.json +111 -0
- package/CHANGELOG.md +0 -710
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.install = void 0;
|
|
3
4
|
const core_1 = require("@angular-devkit/core");
|
|
4
5
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
6
|
const tasks_1 = require("@angular-devkit/schematics/tasks");
|
|
@@ -10,7 +11,7 @@ const theme_1 = require("./theme");
|
|
|
10
11
|
const package_1 = require("./../utils/package");
|
|
11
12
|
function addEJ2ToPackageJson(libOptions) {
|
|
12
13
|
return (host) => {
|
|
13
|
-
package_1.addEJ2PackageToPackageJson(host, 'dependencies', libOptions.pkgName, libOptions.pkgVer);
|
|
14
|
+
(0, package_1.addEJ2PackageToPackageJson)(host, 'dependencies', libOptions.pkgName, libOptions.pkgVer);
|
|
14
15
|
return host;
|
|
15
16
|
};
|
|
16
17
|
}
|
|
@@ -28,12 +29,12 @@ function installNodePackages() {
|
|
|
28
29
|
*/
|
|
29
30
|
function install(options, libOptions) {
|
|
30
31
|
const theme = options.theme || 'material';
|
|
31
|
-
return schematics_1.chain([
|
|
32
|
-
options && options.skipPackageJson ? schematics_1.noop() : addEJ2ToPackageJson(libOptions),
|
|
33
|
-
theme_1.addEJ2ThemeToPackageJson(options, libOptions),
|
|
34
|
-
(options && !options.skipPackageJson) ? installNodePackages() : schematics_1.noop(),
|
|
32
|
+
return (0, schematics_1.chain)([
|
|
33
|
+
options && options.skipPackageJson ? (0, schematics_1.noop)() : addEJ2ToPackageJson(libOptions),
|
|
34
|
+
(0, theme_1.addEJ2ThemeToPackageJson)(options, libOptions),
|
|
35
|
+
(options && !options.skipPackageJson) ? installNodePackages() : (0, schematics_1.noop)(),
|
|
35
36
|
addEJ2PackageRootConfig(options, libOptions),
|
|
36
|
-
theme_1.addEJ2Theme(options, theme)
|
|
37
|
+
(0, theme_1.addEJ2Theme)(options, theme)
|
|
37
38
|
]);
|
|
38
39
|
}
|
|
39
40
|
exports.install = install;
|
|
@@ -44,7 +45,7 @@ function validateEJ2Modules(moduleName, libOptions) {
|
|
|
44
45
|
}
|
|
45
46
|
function addModuleImportToCustomModule(host, options, validModules, libOptions) {
|
|
46
47
|
if (host.exists(options.modulePath.toString())) {
|
|
47
|
-
ast_1.addModuleImportToModule(host, core_1.normalize(options.modulePath.toString()), validModules, libOptions.pkgName);
|
|
48
|
+
(0, ast_1.addModuleImportToModule)(host, (0, core_1.normalize)(options.modulePath.toString()), validModules, libOptions.pkgName);
|
|
48
49
|
}
|
|
49
50
|
else {
|
|
50
51
|
throw new schematics_1.SchematicsException(`Could not find the module file. The given path \'${options.modulePath}\' is invalid. ` +
|
|
@@ -57,8 +58,9 @@ function addModuleImportToCustomModule(host, options, validModules, libOptions)
|
|
|
57
58
|
*/
|
|
58
59
|
function addEJ2PackageRootConfig(options, libOptions) {
|
|
59
60
|
return (host) => {
|
|
60
|
-
const workspace = helpers_1.getWorkspace(host);
|
|
61
|
-
const project = get_project_1.getProjectFromWorkspace(workspace, options.project);
|
|
61
|
+
const workspace = (0, helpers_1.getWorkspace)(host);
|
|
62
|
+
const project = (0, get_project_1.getProjectFromWorkspace)(workspace, options.project);
|
|
63
|
+
const architect = project.architect;
|
|
62
64
|
let validModules;
|
|
63
65
|
let availableModules = libOptions.moduleName.replace(/Module/g, '').trim();
|
|
64
66
|
if (options.modules !== '') {
|
|
@@ -78,13 +80,13 @@ function addEJ2PackageRootConfig(options, libOptions) {
|
|
|
78
80
|
else {
|
|
79
81
|
validModules = libOptions.moduleName;
|
|
80
82
|
}
|
|
81
|
-
if (
|
|
83
|
+
if (architect.build.options.main) {
|
|
82
84
|
(options.modulePath !== undefined && options.modulePath !== "") ? addModuleImportToCustomModule(host, options, validModules, libOptions) :
|
|
83
|
-
ast_1.
|
|
85
|
+
(0, ast_1.addModuleImportToModule)(host, validModules, libOptions.pkgName, options.project);
|
|
84
86
|
}
|
|
85
87
|
else {
|
|
86
88
|
const modulePath = '/src/app/app.component.ts';
|
|
87
|
-
ast_1.addModuleImportToModule(host, modulePath, validModules, libOptions.pkgName);
|
|
89
|
+
(0, ast_1.addModuleImportToModule)(host, modulePath, validModules, libOptions.pkgName);
|
|
88
90
|
}
|
|
89
91
|
return host;
|
|
90
92
|
};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { Tree } from "@angular-devkit/schematics";
|
|
2
|
+
import { workspaces } from '@angular-devkit/core';
|
|
2
3
|
import { LibOptionsSchema, OptionsSchema } from "../ng-add/schema";
|
|
4
|
+
export type WorkspaceDefinition = workspaces.WorkspaceDefinition;
|
|
5
|
+
export type ProjectDefinition = workspaces.ProjectDefinition;
|
|
3
6
|
export declare function addEJ2ThemeToPackageJson(options: OptionsSchema, libOptions: LibOptionsSchema): (host: Tree) => Tree;
|
|
4
7
|
export declare function addEJ2Theme(options: OptionsSchema, theme: string): (host: Tree) => Tree;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addEJ2Theme = exports.addEJ2ThemeToPackageJson = void 0;
|
|
3
4
|
const change_1 = require("@schematics/angular/utility/change");
|
|
4
5
|
const helpers_1 = require("../utils/helpers/helpers");
|
|
5
6
|
const get_project_1 = require("../utils/get-project");
|
|
@@ -11,7 +12,7 @@ const project_style_file_1 = require("../utils/project-style-file");
|
|
|
11
12
|
function addEJ2ThemeToPackageJson(options, libOptions) {
|
|
12
13
|
const themeVer = libOptions.themeVer ? libOptions.themeVer : 'latest';
|
|
13
14
|
return (host) => {
|
|
14
|
-
package_1.addEJ2PackageToPackageJson(host, 'dependencies', `@syncfusion/ej2-${options.theme || 'material'}-theme`, themeVer);
|
|
15
|
+
(0, package_1.addEJ2PackageToPackageJson)(host, 'dependencies', `@syncfusion/ej2-${options.theme || 'material'}-theme`, themeVer);
|
|
15
16
|
return host;
|
|
16
17
|
};
|
|
17
18
|
}
|
|
@@ -23,14 +24,15 @@ function addEJ2Theme(options, theme) {
|
|
|
23
24
|
return (host) => {
|
|
24
25
|
let themePath = `@import \'..\/node_modules/@syncfusion/ej2-${theme}-theme/styles/${theme}.css\'`;
|
|
25
26
|
const strippedThemePath = `./node_modules/@syncfusion/ej2-${theme}-theme/styles/${theme}.css`;
|
|
26
|
-
const workspace = helpers_1.getWorkspace(host);
|
|
27
|
-
const project = get_project_1.getProjectFromWorkspace(workspace, options.project);
|
|
28
|
-
const
|
|
27
|
+
const workspace = (0, helpers_1.getWorkspace)(host);
|
|
28
|
+
const project = (0, get_project_1.getProjectFromWorkspace)(workspace, options.project);
|
|
29
|
+
const architect = project.architect;
|
|
30
|
+
const stylesPath = (0, project_style_file_1.getProjectStyleFile)(workspace);
|
|
29
31
|
const stylesBuffer = host.read(stylesPath);
|
|
30
32
|
themePath += stylesPath.includes("sass") ? `\n` : `;\n`;
|
|
31
33
|
// Because the build setup for the Angular CLI can be changed so dramatically, we can't know
|
|
32
34
|
// where to generate anything if the project is not using the default config for build and test.
|
|
33
|
-
project_style_file_1.assertDefaultBuildersConfigured(project);
|
|
35
|
+
(0, project_style_file_1.assertDefaultBuildersConfigured)(project);
|
|
34
36
|
options.skipPackageJson ? console.log('\x1b[33m%s\x1b[0m', `WARNING: You skipped the dependency installation. ` +
|
|
35
37
|
`You must manually install the \'@syncfusion/ej2-${theme}-theme\' package. ` +
|
|
36
38
|
`If you have already done this, you can ignore this message.`) :
|
|
@@ -47,9 +49,9 @@ function addEJ2Theme(options, theme) {
|
|
|
47
49
|
else {
|
|
48
50
|
console.log('\x1b[31m%s\x1b[0m', `Cannot import theme file. The file \'/src/styles.css\' is missing.`);
|
|
49
51
|
}
|
|
50
|
-
|
|
51
|
-
addStyleToTarget(
|
|
52
|
-
addStyleToTarget(
|
|
52
|
+
architect ? [
|
|
53
|
+
addStyleToTarget(architect['build'], host, strippedThemePath, workspace),
|
|
54
|
+
addStyleToTarget(architect['test'], host, strippedThemePath, workspace)
|
|
53
55
|
] :
|
|
54
56
|
console.log('\x1b[31m%s\x1b[0m', `The project does not have an architect configuration. `
|
|
55
57
|
+ `Cannot add entry theme file in \'angular.json\'.`);
|
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
import { Tree } from '@angular-devkit/schematics';
|
|
9
9
|
import * as ts from 'typescript';
|
|
10
10
|
import { Change } from '@schematics/angular/utility/change';
|
|
11
|
-
import {
|
|
11
|
+
import { workspaces } from '@angular-devkit/core';
|
|
12
|
+
export type WorkspaceDefinition = workspaces.WorkspaceDefinition;
|
|
13
|
+
export type ProjectDefinition = workspaces.ProjectDefinition;
|
|
12
14
|
/**
|
|
13
15
|
* Reads file given path and returns TypeScript source file.
|
|
14
16
|
*/
|
|
@@ -16,7 +18,6 @@ export declare function getSourceFile(host: Tree, path: string): ts.SourceFile;
|
|
|
16
18
|
/**
|
|
17
19
|
* Import and add module to root app module.
|
|
18
20
|
*/
|
|
19
|
-
export declare function addModuleImportToRootModule(host: Tree, moduleName: string, src: string, project: WorkspaceProject): void;
|
|
20
21
|
/**
|
|
21
22
|
* Import and add module to specific module path.
|
|
22
23
|
* @param host the tree we are updating
|
package/schematics/utils/ast.js
CHANGED
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.updateChanges = exports.addModuleImportToModule = exports.getSourceFile = void 0;
|
|
10
11
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
11
12
|
const ts = require("typescript");
|
|
12
13
|
const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
|
|
13
14
|
const change_1 = require("@schematics/angular/utility/change");
|
|
14
|
-
const ng_ast_utils_1 = require("@schematics/angular/utility/ng-ast-utils");
|
|
15
15
|
/**
|
|
16
16
|
* Reads file given path and returns TypeScript source file.
|
|
17
17
|
*/
|
|
@@ -27,11 +27,11 @@ exports.getSourceFile = getSourceFile;
|
|
|
27
27
|
/**
|
|
28
28
|
* Import and add module to root app module.
|
|
29
29
|
*/
|
|
30
|
-
function addModuleImportToRootModule(host, moduleName, src,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
// export function addModuleImportToRootModule(host: Tree, moduleName: string, src: string,
|
|
31
|
+
// project: WorkspaceDefinition) {
|
|
32
|
+
// const modulePath: string = getAppModulePath(host, project.architect.build.options.main);
|
|
33
|
+
// addModuleImportToModule(host, modulePath, moduleName, src);
|
|
34
|
+
// }
|
|
35
35
|
/**
|
|
36
36
|
* Import and add module to specific module path.
|
|
37
37
|
* @param host the tree we are updating
|
|
@@ -46,12 +46,12 @@ function addModuleImportToModule(host, modulePath, moduleName, src) {
|
|
|
46
46
|
throw new schematics_1.SchematicsException(`Module not found: ${modulePath}`);
|
|
47
47
|
}
|
|
48
48
|
moduleName.split(',').forEach((module) => {
|
|
49
|
-
if (!ast_utils_1.isImported(moduleSource, module.trim(), src) && module !== '') {
|
|
49
|
+
if (!(0, ast_utils_1.isImported)(moduleSource, module.trim(), src) && module !== '') {
|
|
50
50
|
modulesToBeAdded.push(module);
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
if (modulesToBeAdded.length) {
|
|
54
|
-
let changes = ast_utils_1.addImportToModule(moduleSource, modulePath, modulesToBeAdded.toString().trim(), src);
|
|
54
|
+
let changes = (0, ast_utils_1.addImportToModule)(moduleSource, modulePath, modulesToBeAdded.toString().trim(), src);
|
|
55
55
|
if (!changes[0] && modulePath.includes("component.ts")) {
|
|
56
56
|
changes = updateChanges(changes, modulePath, moduleSource, moduleName, src);
|
|
57
57
|
}
|
|
@@ -5,5 +5,7 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
9
|
-
export
|
|
8
|
+
import { workspaces } from '@angular-devkit/core';
|
|
9
|
+
export type WorkspaceDefinition = workspaces.WorkspaceDefinition;
|
|
10
|
+
export type ProjectDefinition = workspaces.ProjectDefinition;
|
|
11
|
+
export declare function getProjectFromWorkspace(workspace: WorkspaceDefinition, projectName?: string): ProjectDefinition;
|
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.getProjectFromWorkspace = void 0;
|
|
10
11
|
function getProjectFromWorkspace(workspace, projectName) {
|
|
11
|
-
let project = workspace.projects[projectName
|
|
12
|
-
if (
|
|
12
|
+
let project = workspace.projects[projectName];
|
|
13
|
+
if (projectName === undefined) {
|
|
13
14
|
project = workspace.projects[projectName || Object.keys(workspace.projects)[0]];
|
|
14
15
|
}
|
|
15
16
|
if (!project) {
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.validateHtmlSelector = exports.htmlSelectorRe = exports.validateName = exports.insertImport = exports.parseName = exports.getAppModulePath = exports.findBootstrapModulePath = exports.findBootstrapModuleCall = exports.isImported = exports.addBootstrapToModule = exports.addExportToModule = exports.addProviderToModule = exports.addImportToModule = exports.addDeclarationToModule = exports.addSymbolToNgModuleMetadata = exports.getFirstNgModuleName = exports.getDecoratorMetadata = exports.getContentOfKeyLiteral = exports.insertAfterLastOccurrence = exports.findNode = exports.getSourceNodes = exports.findNodes = exports.ReplaceChange = exports.RemoveChange = exports.InsertChange = exports.NoopChange = exports.getProjectFromWorkspace = exports.getWorkspace = exports.ANGULAR_CLI_WORKSPACE_PATH = exports.buildRelativePath = exports.findModule = exports.findModuleFromOptions = void 0;
|
|
10
11
|
const core_1 = require("@angular-devkit/core");
|
|
11
12
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
12
13
|
const ts = require("typescript");
|
|
@@ -25,19 +26,19 @@ function findModuleFromOptions(host, options) {
|
|
|
25
26
|
if (!options.module) {
|
|
26
27
|
const pathToCheck = (options.path || '')
|
|
27
28
|
+ (options.flat ? '' : '/' + core_1.strings.dasherize(options.name));
|
|
28
|
-
return core_1.normalize(findModule(host, pathToCheck, moduleExt, routingModuleExt));
|
|
29
|
+
return (0, core_1.normalize)(findModule(host, pathToCheck, moduleExt, routingModuleExt));
|
|
29
30
|
}
|
|
30
31
|
else {
|
|
31
|
-
const modulePath = core_1.normalize(`/${options.path}/${options.module}`);
|
|
32
|
-
const componentPath = core_1.normalize(`/${options.path}/${options.name}`);
|
|
33
|
-
const moduleBaseName = core_1.normalize(modulePath).split('/').pop();
|
|
32
|
+
const modulePath = (0, core_1.normalize)(`/${options.path}/${options.module}`);
|
|
33
|
+
const componentPath = (0, core_1.normalize)(`/${options.path}/${options.name}`);
|
|
34
|
+
const moduleBaseName = (0, core_1.normalize)(modulePath).split('/').pop();
|
|
34
35
|
const candidateSet = new Set([
|
|
35
|
-
core_1.normalize(options.path || '/'),
|
|
36
|
+
(0, core_1.normalize)(options.path || '/'),
|
|
36
37
|
]);
|
|
37
|
-
for (let dir = modulePath; dir != core_1.NormalizedRoot; dir = core_1.dirname(dir)) {
|
|
38
|
+
for (let dir = modulePath; dir != core_1.NormalizedRoot; dir = (0, core_1.dirname)(dir)) {
|
|
38
39
|
candidateSet.add(dir);
|
|
39
40
|
}
|
|
40
|
-
for (let dir = componentPath; dir != core_1.NormalizedRoot; dir = core_1.dirname(dir)) {
|
|
41
|
+
for (let dir = componentPath; dir != core_1.NormalizedRoot; dir = (0, core_1.dirname)(dir)) {
|
|
41
42
|
candidateSet.add(dir);
|
|
42
43
|
}
|
|
43
44
|
const candidatesDirs = [...candidateSet].sort((a, b) => b.length - a.length);
|
|
@@ -46,10 +47,10 @@ function findModuleFromOptions(host, options) {
|
|
|
46
47
|
'',
|
|
47
48
|
`${moduleBaseName}.ts`,
|
|
48
49
|
`${moduleBaseName}${moduleExt}`,
|
|
49
|
-
].map(x => core_1.join(c, x));
|
|
50
|
+
].map(x => (0, core_1.join)(c, x));
|
|
50
51
|
for (const sc of candidateFiles) {
|
|
51
52
|
if (host.exists(sc)) {
|
|
52
|
-
return core_1.normalize(sc);
|
|
53
|
+
return (0, core_1.normalize)(sc);
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
}
|
|
@@ -69,7 +70,7 @@ function findModule(host, generateDir, moduleExt = MODULE_EXT, routingModuleExt
|
|
|
69
70
|
const filteredMatches = allMatches.filter(p => !p.endsWith(routingModuleExt));
|
|
70
71
|
foundRoutingModule = foundRoutingModule || allMatches.length !== filteredMatches.length;
|
|
71
72
|
if (filteredMatches.length == 1) {
|
|
72
|
-
return core_1.join(dir.path, filteredMatches[0]);
|
|
73
|
+
return (0, core_1.join)(dir.path, filteredMatches[0]);
|
|
73
74
|
}
|
|
74
75
|
else if (filteredMatches.length > 1) {
|
|
75
76
|
throw new Error('More than one module matches. Use skip-import option to skip importing '
|
|
@@ -88,15 +89,15 @@ exports.findModule = findModule;
|
|
|
88
89
|
* Build a relative path from one file path to another file path.
|
|
89
90
|
*/
|
|
90
91
|
function buildRelativePath(from, to) {
|
|
91
|
-
from = core_1.normalize(from);
|
|
92
|
-
to = core_1.normalize(to);
|
|
92
|
+
from = (0, core_1.normalize)(from);
|
|
93
|
+
to = (0, core_1.normalize)(to);
|
|
93
94
|
// Convert to arrays.
|
|
94
95
|
const fromParts = from.split('/');
|
|
95
96
|
const toParts = to.split('/');
|
|
96
97
|
// Remove file names (preserving destination)
|
|
97
98
|
fromParts.pop();
|
|
98
99
|
const toFileName = toParts.pop();
|
|
99
|
-
const relativePath = core_1.relative(core_1.normalize(fromParts.join('/')), core_1.normalize(toParts.join('/')));
|
|
100
|
+
const relativePath = (0, core_1.relative)((0, core_1.normalize)(fromParts.join('/')), (0, core_1.normalize)(toParts.join('/')));
|
|
100
101
|
let pathPrefix = '';
|
|
101
102
|
// Set the path prefix for same dir or child dir, parent dir starts with `..`
|
|
102
103
|
if (!relativePath) {
|
|
@@ -707,17 +708,17 @@ function findBootstrapModulePath(host, mainPath) {
|
|
|
707
708
|
exports.findBootstrapModulePath = findBootstrapModulePath;
|
|
708
709
|
function getAppModulePath(host, mainPath) {
|
|
709
710
|
const moduleRelativePath = findBootstrapModulePath(host, mainPath);
|
|
710
|
-
const mainDir = path_1.dirname(mainPath);
|
|
711
|
-
const modulePath = core_1.normalize(`/${mainDir}/${moduleRelativePath}.ts`);
|
|
711
|
+
const mainDir = (0, path_1.dirname)(mainPath);
|
|
712
|
+
const modulePath = (0, core_1.normalize)(`/${mainDir}/${moduleRelativePath}.ts`);
|
|
712
713
|
return modulePath;
|
|
713
714
|
}
|
|
714
715
|
exports.getAppModulePath = getAppModulePath;
|
|
715
716
|
function parseName(path, name) {
|
|
716
|
-
const nameWithoutPath = core_1.basename(name);
|
|
717
|
-
const namePath = core_1.dirname((path + '/' + name));
|
|
717
|
+
const nameWithoutPath = (0, core_1.basename)(name);
|
|
718
|
+
const namePath = (0, core_1.dirname)((path + '/' + name));
|
|
718
719
|
return {
|
|
719
720
|
name: nameWithoutPath,
|
|
720
|
-
path: core_1.normalize('/' + namePath),
|
|
721
|
+
path: (0, core_1.normalize)('/' + namePath),
|
|
721
722
|
};
|
|
722
723
|
}
|
|
723
724
|
exports.parseName = parseName;
|
|
@@ -5,11 +5,13 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
8
|
+
import { workspaces } from '@angular-devkit/core';
|
|
9
|
+
export type WorkspaceDefinition = workspaces.WorkspaceDefinition;
|
|
10
|
+
export type ProjectDefinition = workspaces.ProjectDefinition;
|
|
9
11
|
/**
|
|
10
12
|
* Gets a style file with the given extension in a project and returns its path. If no
|
|
11
13
|
* extension is specified, any style file with a valid extension will be returned.
|
|
12
14
|
*/
|
|
13
|
-
export declare function getProjectStyleFile(project:
|
|
15
|
+
export declare function getProjectStyleFile(project: WorkspaceDefinition, extension?: string): string | null;
|
|
14
16
|
/** Throws if the project is not using the default Angular devkit builders. */
|
|
15
|
-
export declare function assertDefaultBuildersConfigured(project:
|
|
17
|
+
export declare function assertDefaultBuildersConfigured(project: any): void;
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.assertDefaultBuildersConfigured = exports.getProjectStyleFile = void 0;
|
|
10
11
|
const core_1 = require("@angular-devkit/core");
|
|
11
12
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
12
13
|
/** Regular expression that matches all possible Angular CLI default style files. */
|
|
@@ -18,7 +19,7 @@ const validStyleFileRegex = /\.(c|le|sa|sc)ss/;
|
|
|
18
19
|
* extension is specified, any style file with a valid extension will be returned.
|
|
19
20
|
*/
|
|
20
21
|
function getProjectStyleFile(project, extension) {
|
|
21
|
-
const buildTarget = project.
|
|
22
|
+
const buildTarget = project.projects['build'];
|
|
22
23
|
if (buildTarget.options && buildTarget.options.styles && buildTarget.options.styles.length) {
|
|
23
24
|
const styles = buildTarget.options.styles.map(s => typeof s === 'string' ? s : s.input);
|
|
24
25
|
// Look for the default style file that is generated for new projects by the Angular CLI. This
|
|
@@ -26,7 +27,7 @@ function getProjectStyleFile(project, extension) {
|
|
|
26
27
|
const defaultMainStylePath = styles
|
|
27
28
|
.find(file => extension ? file === `styles.${extension}` : defaultStyleFileRegex.test(file));
|
|
28
29
|
if (defaultMainStylePath) {
|
|
29
|
-
return core_1.normalize(defaultMainStylePath);
|
|
30
|
+
return (0, core_1.normalize)(defaultMainStylePath);
|
|
30
31
|
}
|
|
31
32
|
// If no default style file could be found, use the first style file that matches the given
|
|
32
33
|
// extension. If no extension specified explicitly, we look for any file with a valid style
|
|
@@ -34,7 +35,7 @@ function getProjectStyleFile(project, extension) {
|
|
|
34
35
|
const fallbackStylePath = styles
|
|
35
36
|
.find(file => extension ? file.endsWith(`.${extension}`) : validStyleFileRegex.test(file));
|
|
36
37
|
if (fallbackStylePath) {
|
|
37
|
-
return core_1.normalize(fallbackStylePath);
|
|
38
|
+
return (0, core_1.normalize)(fallbackStylePath);
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
return null;
|
|
@@ -20,14 +20,14 @@ var ComplexBase = /** @class */ (function () {
|
|
|
20
20
|
}
|
|
21
21
|
var templateProperties = Object.keys(this);
|
|
22
22
|
for (var i = 0; i < templateProperties.length; i++) {
|
|
23
|
-
var tempProp = getValue(templateProperties[i], this);
|
|
23
|
+
var tempProp = getValue(templateProperties[parseInt(i.toString(), 10)], this);
|
|
24
24
|
if (typeof tempProp === 'object' && tempProp && tempProp.elementRef) {
|
|
25
|
-
if (!getValue(templateProperties[i].indexOf('Ref') !== -1 ? templateProperties[i] : templateProperties[i] + 'Ref', this)) {
|
|
26
|
-
setValue(templateProperties[i].indexOf('Ref') !== -1 ? templateProperties[i] : templateProperties[i] + 'Ref', tempProp, this);
|
|
25
|
+
if (!getValue(templateProperties[parseInt(i.toString(), 10)].indexOf('Ref') !== -1 ? templateProperties[parseInt(i.toString(), 10)] : templateProperties[parseInt(i.toString(), 10)] + 'Ref', this)) {
|
|
26
|
+
setValue(templateProperties[parseInt(i.toString(), 10)].indexOf('Ref') !== -1 ? templateProperties[parseInt(i.toString(), 10)] : templateProperties[parseInt(i.toString(), 10)] + 'Ref', tempProp, this);
|
|
27
27
|
}
|
|
28
|
-
if (getValue(
|
|
29
|
-
setValue(
|
|
30
|
-
setValue(
|
|
28
|
+
if (getValue('viewContainerRef', this) && !getValue('_viewContainerRef', tempProp.elementRef.nativeElement) && !getValue('propName', tempProp.elementRef.nativeElement)) {
|
|
29
|
+
setValue('_viewContainerRef', getValue('viewContainerRef', this), tempProp.elementRef.nativeElement);
|
|
30
|
+
setValue('propName', templateProperties[parseInt(i.toString(), 10)].replace('Ref', ''), tempProp.elementRef.nativeElement);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -46,7 +46,7 @@ var ComplexBase = /** @class */ (function () {
|
|
|
46
46
|
/* istanbul ignore next */
|
|
47
47
|
if (this.directivePropList) {
|
|
48
48
|
for (var k = 0; k < this.directivePropList.length; k++) {
|
|
49
|
-
var dirPropName = this.directivePropList[k];
|
|
49
|
+
var dirPropName = this.directivePropList[parseInt(k.toString(), 10)];
|
|
50
50
|
if (propList.indexOf(dirPropName) !== -1 && (getValue(dirPropName, this) === false || getValue(dirPropName, this))) {
|
|
51
51
|
setValue(dirPropName, getValue(dirPropName, this), this.propCollection);
|
|
52
52
|
}
|
|
@@ -61,8 +61,8 @@ var ComplexBase = /** @class */ (function () {
|
|
|
61
61
|
ComplexBase.prototype.ngOnChanges = function (changes) {
|
|
62
62
|
for (var _i = 0, _a = Object.keys(changes); _i < _a.length; _i++) {
|
|
63
63
|
var propName = _a[_i];
|
|
64
|
-
var changedVal = changes[propName];
|
|
65
|
-
this.propCollection[propName] = changedVal.currentValue;
|
|
64
|
+
var changedVal = changes["".concat(propName)];
|
|
65
|
+
this.propCollection["".concat(propName)] = changedVal.currentValue;
|
|
66
66
|
}
|
|
67
67
|
this.isUpdated = false;
|
|
68
68
|
this.hasChanges = true;
|
|
@@ -85,13 +85,13 @@ var ComplexBase = /** @class */ (function () {
|
|
|
85
85
|
var tempProps = this.propCollection[this.property];
|
|
86
86
|
var props = Object.keys(tempProps[0]);
|
|
87
87
|
for (var d = 0; d < props.length; d++) {
|
|
88
|
-
if (!isNullOrUndefined(this.propCollection[props[d]])) {
|
|
89
|
-
var val = getValue(props[d], this);
|
|
90
|
-
var propVal = this.propCollection[this.property][0][props[d]];
|
|
91
|
-
if (!isNullOrUndefined(val) && this.propCollection[props[d]] !== val
|
|
88
|
+
if (!isNullOrUndefined(this.propCollection[props[parseInt(d.toString(), 10)]])) {
|
|
89
|
+
var val = getValue(props[parseInt(d.toString(), 10)], this);
|
|
90
|
+
var propVal = this.propCollection[this.property][0][props[parseInt(d.toString(), 10)]];
|
|
91
|
+
if (!isNullOrUndefined(val) && this.propCollection[props[parseInt(d.toString(), 10)]] !== val
|
|
92
92
|
&& propVal !== val) {
|
|
93
|
-
setValue(props[d], val, this.propCollection[this.property][0]);
|
|
94
|
-
setValue(props[d], val, this.propCollection);
|
|
93
|
+
setValue(props[parseInt(d.toString(), 10)], val, this.propCollection[this.property][0]);
|
|
94
|
+
setValue(props[parseInt(d.toString(), 10)], val, this.propCollection);
|
|
95
95
|
this.hasChanges = true;
|
|
96
96
|
this.isUpdated = false;
|
|
97
97
|
}
|
|
@@ -169,24 +169,26 @@ var ArrayBase = /** @class */ (function () {
|
|
|
169
169
|
var result = false;
|
|
170
170
|
var index = 0;
|
|
171
171
|
var isSourceChanged = false;
|
|
172
|
-
// tslint:disable-next-line
|
|
173
172
|
var childrenDataSource = this.children.map(function (child) {
|
|
174
173
|
return child;
|
|
175
174
|
});
|
|
176
175
|
/* istanbul ignore next */
|
|
177
176
|
if (this.list.length === this.children.length) {
|
|
178
177
|
for (var i = 0; i < this.list.length; i++) {
|
|
179
|
-
if (this.list[i].propCollection.dataSource) {
|
|
180
|
-
if (this.list[i
|
|
181
|
-
this.list[i].propCollection.dataSource
|
|
182
|
-
|
|
178
|
+
if (this.list[parseInt(i.toString(), 10)].propCollection.dataSource) {
|
|
179
|
+
if (this.list[parseInt(i.toString(), 10)].dataSource &&
|
|
180
|
+
this.list[parseInt(i.toString(), 10)].propCollection.dataSource
|
|
181
|
+
!== this.list[parseInt(i.toString(), 10)].dataSource) {
|
|
182
|
+
this.list[parseInt(i.toString(), 10)].propCollection.dataSource = this.list[parseInt(i.toString(), 10)].dataSource;
|
|
183
|
+
this.list[parseInt(i.toString(), 10)].hasChanges = true;
|
|
183
184
|
}
|
|
184
|
-
if (this.list[i].property !==
|
|
185
|
-
isSourceChanged = (JSON.stringify(this.list[i].propCollection.dataSource) !==
|
|
186
|
-
JSON.stringify(childrenDataSource[i].propCollection.dataSource));
|
|
185
|
+
if (this.list[parseInt(i.toString(), 10)].property !== 'series') {
|
|
186
|
+
isSourceChanged = (JSON.stringify(this.list[parseInt(i.toString(), 10)].propCollection.dataSource) !==
|
|
187
|
+
JSON.stringify(childrenDataSource[parseInt(i.toString(), 10)].propCollection.dataSource));
|
|
187
188
|
}
|
|
188
189
|
}
|
|
189
|
-
isSourceChanged = this.list[i
|
|
190
|
+
isSourceChanged = this.list[parseInt(i.toString(), 10)].hasChanges
|
|
191
|
+
!== childrenDataSource[parseInt(i.toString(), 10)].hasChanges;
|
|
190
192
|
}
|
|
191
193
|
}
|
|
192
194
|
this.hasNewChildren = (this.list.length !== this.children.length || isSourceChanged) ? true : null;
|
|
@@ -210,17 +212,18 @@ var ArrayBase = /** @class */ (function () {
|
|
|
210
212
|
for (var _i = 0, _a = this.list; _i < _a.length; _i++) {
|
|
211
213
|
var item = _a[_i];
|
|
212
214
|
item.clearTemplate(templateNames && templateNames.map(function (val) {
|
|
213
|
-
|
|
215
|
+
var regExp = RegExp;
|
|
216
|
+
return new regExp(_this.propertyName).test(val) ? val.replace(_this.propertyName + '.', '') : val;
|
|
214
217
|
}));
|
|
215
218
|
}
|
|
216
219
|
};
|
|
217
220
|
ArrayBase.prototype.ngAfterContentChecked = function () {
|
|
218
221
|
this.hasChanges = this.isChanged();
|
|
219
222
|
for (var i = 0; i < this.list.length; i++) {
|
|
220
|
-
if (getValue('childColumns', this.list[i]) && getValue('property', this.list[i]) === 'columns') {
|
|
221
|
-
setValue('columns', getValue('childColumns', this.list[i]).getProperties(), this.list[i].propCollection);
|
|
223
|
+
if (getValue('childColumns', this.list[parseInt(i.toString(), 10)]) && getValue('property', this.list[parseInt(i.toString(), 10)]) === 'columns') {
|
|
224
|
+
setValue('columns', getValue('childColumns', this.list[parseInt(i.toString(), 10)]).getProperties(), this.list[parseInt(i.toString(), 10)].propCollection);
|
|
222
225
|
}
|
|
223
|
-
this.list[i].isUpdated = true;
|
|
226
|
+
this.list[parseInt(i.toString(), 10)].isUpdated = true;
|
|
224
227
|
}
|
|
225
228
|
};
|
|
226
229
|
ArrayBase.prototype.ngAfterViewInit = function () {
|
package/src/component-base.d.ts
CHANGED