jqwidgets-ng 17.1.1 → 18.1.0
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/ReleaseNotes.txt +125 -5
- package/jqwidgets/globalization/globalize.culture.cs-CZ.js +87 -87
- package/jqwidgets/globalization/globalize.culture.de-DE.js +83 -83
- package/jqwidgets/globalization/globalize.culture.en-CA.js +51 -51
- package/jqwidgets/globalization/globalize.culture.en-US.js +35 -35
- package/jqwidgets/globalization/globalize.culture.fr-FR.js +81 -81
- package/jqwidgets/globalization/globalize.culture.he-IL.js +99 -99
- package/jqwidgets/globalization/globalize.culture.hr-HR.js +83 -83
- package/jqwidgets/globalization/globalize.culture.hu-HU.js +82 -82
- package/jqwidgets/globalization/globalize.culture.it-IT.js +81 -81
- package/jqwidgets/globalization/globalize.culture.ja-JP.js +102 -102
- package/jqwidgets/globalization/globalize.culture.lt.js +85 -85
- package/jqwidgets/globalization/globalize.culture.ru-RU.js +84 -84
- package/jqwidgets/globalization/globalize.culture.sa-IN.js +73 -73
- package/jqwidgets/globalization/globalize.js +1591 -1591
- package/jqwidgets/jqxgantt.api.js +381 -381
- package/jqwidgets/jqxsplitlayout.js +6 -2445
- package/jqwidgets/styles/font/jqx-icons.svg +268 -268
- package/jqwidgets/styles/gantt/font/jqx-icons.svg +332 -332
- package/jqwidgets/styles/gantt/jqx.gantt.css +18667 -18667
- package/jqwidgets/styles/jqx.base.css +34 -34
- package/jqwidgets/styles/jqx.fluent.css +3563 -3563
- package/jqwidgets/styles/jqx.fluent_old.css +1262 -1262
- package/jqwidgets/styles/theme.css +293 -293
- package/package.json +3 -3
- package/schematics/cdk/schematics/collection.json +2 -1
- package/schematics/cdk/schematics/index.d.ts +2 -1
- package/schematics/cdk/schematics/index.js +4 -4
- package/schematics/cdk/schematics/index.mjs +4 -4
- package/schematics/cdk/schematics/migration.json +4 -39
- package/schematics/cdk/schematics/ng-add/index.js +1 -1
- package/schematics/cdk/schematics/ng-add/index.mjs +1 -1
- package/schematics/cdk/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.spec.ts.template +6 -10
- package/schematics/cdk/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +7 -5
- package/schematics/cdk/schematics/ng-generate/drag-drop/index.js +9 -15
- package/schematics/cdk/schematics/ng-generate/drag-drop/index.mjs +9 -15
- package/schematics/cdk/schematics/ng-generate/drag-drop/schema.json +7 -0
- package/schematics/cdk/schematics/ng-update/data/attribute-selectors.js +2 -13
- package/schematics/cdk/schematics/ng-update/data/attribute-selectors.mjs +2 -13
- package/schematics/cdk/schematics/ng-update/data/class-names.js +2 -32
- package/schematics/cdk/schematics/ng-update/data/class-names.mjs +2 -32
- package/schematics/cdk/schematics/ng-update/data/constructor-checks.d.ts +1 -1
- package/schematics/cdk/schematics/ng-update/data/constructor-checks.js +2 -59
- package/schematics/cdk/schematics/ng-update/data/constructor-checks.mjs +2 -59
- package/schematics/cdk/schematics/ng-update/data/css-selectors.js +2 -5
- package/schematics/cdk/schematics/ng-update/data/css-selectors.mjs +2 -5
- package/schematics/cdk/schematics/ng-update/data/element-selectors.js +2 -5
- package/schematics/cdk/schematics/ng-update/data/element-selectors.mjs +2 -5
- package/schematics/cdk/schematics/ng-update/data/input-names.js +2 -95
- package/schematics/cdk/schematics/ng-update/data/input-names.mjs +2 -95
- package/schematics/cdk/schematics/ng-update/data/method-call-checks.js +2 -47
- package/schematics/cdk/schematics/ng-update/data/method-call-checks.mjs +2 -47
- package/schematics/cdk/schematics/ng-update/data/output-names.js +2 -19
- package/schematics/cdk/schematics/ng-update/data/output-names.mjs +2 -19
- package/schematics/cdk/schematics/ng-update/data/property-names.js +2 -127
- package/schematics/cdk/schematics/ng-update/data/property-names.mjs +2 -127
- package/schematics/cdk/schematics/ng-update/devkit-file-system.js +10 -6
- package/schematics/cdk/schematics/ng-update/devkit-file-system.mjs +10 -6
- package/schematics/cdk/schematics/ng-update/devkit-migration-rule.d.ts +2 -2
- package/schematics/cdk/schematics/ng-update/devkit-migration-rule.js +6 -14
- package/schematics/cdk/schematics/ng-update/devkit-migration-rule.mjs +6 -14
- package/schematics/cdk/schematics/ng-update/devkit-migration.d.ts +5 -5
- package/schematics/cdk/schematics/ng-update/devkit-migration.js +1 -1
- package/schematics/cdk/schematics/ng-update/devkit-migration.mjs +1 -1
- package/schematics/cdk/schematics/ng-update/find-stylesheets.js +2 -2
- package/schematics/cdk/schematics/ng-update/find-stylesheets.mjs +2 -2
- package/schematics/cdk/schematics/ng-update/html-parsing/elements.d.ts +1 -2
- package/schematics/cdk/schematics/ng-update/html-parsing/elements.js +2 -3
- package/schematics/cdk/schematics/ng-update/html-parsing/elements.mjs +2 -3
- package/schematics/cdk/schematics/ng-update/index.d.ts +2 -16
- package/schematics/cdk/schematics/ng-update/index.js +7 -43
- package/schematics/cdk/schematics/ng-update/index.mjs +7 -43
- package/schematics/cdk/schematics/ng-update/migrations/attribute-selectors.js +5 -8
- package/schematics/cdk/schematics/ng-update/migrations/attribute-selectors.mjs +5 -8
- package/schematics/cdk/schematics/ng-update/migrations/class-inheritance.js +8 -11
- package/schematics/cdk/schematics/ng-update/migrations/class-inheritance.mjs +8 -11
- package/schematics/cdk/schematics/ng-update/migrations/class-names.js +12 -15
- package/schematics/cdk/schematics/ng-update/migrations/class-names.mjs +12 -15
- package/schematics/cdk/schematics/ng-update/migrations/constructor-signature.js +7 -10
- package/schematics/cdk/schematics/ng-update/migrations/constructor-signature.mjs +7 -10
- package/schematics/cdk/schematics/ng-update/migrations/css-selectors.js +5 -8
- package/schematics/cdk/schematics/ng-update/migrations/css-selectors.mjs +5 -8
- package/schematics/cdk/schematics/ng-update/migrations/element-selectors.js +5 -8
- package/schematics/cdk/schematics/ng-update/migrations/element-selectors.mjs +5 -8
- package/schematics/cdk/schematics/ng-update/migrations/input-names.js +5 -8
- package/schematics/cdk/schematics/ng-update/migrations/input-names.mjs +5 -8
- package/schematics/cdk/schematics/ng-update/migrations/method-call-arguments.js +5 -8
- package/schematics/cdk/schematics/ng-update/migrations/method-call-arguments.mjs +5 -8
- package/schematics/cdk/schematics/ng-update/migrations/misc-template.js +4 -20
- package/schematics/cdk/schematics/ng-update/migrations/misc-template.mjs +4 -20
- package/schematics/cdk/schematics/ng-update/migrations/output-names.js +5 -8
- package/schematics/cdk/schematics/ng-update/migrations/output-names.mjs +5 -8
- package/schematics/cdk/schematics/ng-update/migrations/property-names.js +5 -8
- package/schematics/cdk/schematics/ng-update/migrations/property-names.mjs +5 -8
- package/schematics/cdk/schematics/ng-update/migrations/symbol-removal.js +6 -10
- package/schematics/cdk/schematics/ng-update/migrations/symbol-removal.mjs +6 -10
- package/schematics/cdk/schematics/ng-update/public-api.d.ts +2 -0
- package/schematics/cdk/schematics/ng-update/public-api.js +3 -1
- package/schematics/cdk/schematics/ng-update/public-api.mjs +3 -1
- package/schematics/cdk/schematics/ng-update/upgrade-data.js +4 -1
- package/schematics/cdk/schematics/ng-update/upgrade-data.mjs +4 -1
- package/schematics/cdk/schematics/tsconfig.json +1 -0
- package/schematics/cdk/schematics/update-tool/component-resource-collector.d.ts +1 -0
- package/schematics/cdk/schematics/update-tool/component-resource-collector.js +34 -15
- package/schematics/cdk/schematics/update-tool/component-resource-collector.mjs +34 -15
- package/schematics/cdk/schematics/update-tool/file-system.d.ts +3 -3
- package/schematics/cdk/schematics/update-tool/file-system.js +1 -1
- package/schematics/cdk/schematics/update-tool/file-system.mjs +1 -1
- package/schematics/cdk/schematics/update-tool/index.d.ts +6 -2
- package/schematics/cdk/schematics/update-tool/index.js +27 -11
- package/schematics/cdk/schematics/update-tool/index.mjs +27 -11
- package/schematics/cdk/schematics/update-tool/migration.d.ts +13 -7
- package/schematics/cdk/schematics/update-tool/migration.js +14 -4
- package/schematics/cdk/schematics/update-tool/migration.mjs +14 -4
- package/schematics/cdk/schematics/update-tool/public-api.d.ts +1 -0
- package/schematics/cdk/schematics/update-tool/public-api.js +2 -1
- package/schematics/cdk/schematics/update-tool/public-api.mjs +2 -1
- package/schematics/cdk/schematics/update-tool/target-version.d.ts +1 -8
- package/schematics/cdk/schematics/update-tool/target-version.js +3 -10
- package/schematics/cdk/schematics/update-tool/target-version.mjs +3 -10
- package/schematics/cdk/schematics/update-tool/utils/decorators.d.ts +1 -1
- package/schematics/cdk/schematics/update-tool/utils/diagnostics.d.ts +11 -0
- package/schematics/cdk/schematics/update-tool/utils/diagnostics.js +19 -0
- package/schematics/cdk/schematics/update-tool/utils/diagnostics.mjs +19 -0
- package/schematics/cdk/schematics/update-tool/utils/parse-tsconfig.d.ts +8 -0
- package/schematics/cdk/schematics/update-tool/utils/parse-tsconfig.js +30 -4
- package/schematics/cdk/schematics/update-tool/utils/parse-tsconfig.mjs +30 -4
- package/schematics/cdk/schematics/update-tool/utils/property-name.d.ts +1 -1
- package/schematics/cdk/schematics/update-tool/utils/virtual-host.d.ts +2 -0
- package/schematics/cdk/schematics/update-tool/utils/virtual-host.js +13 -3
- package/schematics/cdk/schematics/update-tool/utils/virtual-host.mjs +13 -3
- package/schematics/cdk/schematics/update-tool/version-changes.d.ts +3 -3
- package/schematics/cdk/schematics/utils/ast.d.ts +2 -2
- package/schematics/cdk/schematics/utils/ast.js +15 -25
- package/schematics/cdk/schematics/utils/ast.mjs +15 -25
- package/schematics/cdk/schematics/utils/build-component.js +22 -27
- package/schematics/cdk/schematics/utils/build-component.mjs +22 -27
- package/schematics/cdk/schematics/utils/get-project.d.ts +2 -2
- package/schematics/cdk/schematics/utils/get-project.js +7 -2
- package/schematics/cdk/schematics/utils/get-project.mjs +7 -2
- package/schematics/cdk/schematics/utils/html-manipulation.d.ts +1 -1
- package/schematics/cdk/schematics/utils/html-manipulation.js +2 -2
- package/schematics/cdk/schematics/utils/html-manipulation.mjs +2 -2
- package/schematics/cdk/schematics/utils/index.d.ts +1 -0
- package/schematics/cdk/schematics/utils/index.js +2 -1
- package/schematics/cdk/schematics/utils/index.mjs +2 -1
- package/schematics/cdk/schematics/utils/parse5-element.d.ts +3 -1
- package/schematics/cdk/schematics/utils/parse5-element.js +1 -1
- package/schematics/cdk/schematics/utils/parse5-element.mjs +1 -1
- package/schematics/cdk/schematics/utils/project-index-file.d.ts +2 -3
- package/schematics/cdk/schematics/utils/project-index-file.js +4 -4
- package/schematics/cdk/schematics/utils/project-index-file.mjs +4 -4
- package/schematics/cdk/schematics/utils/project-main-file.d.ts +2 -3
- package/schematics/cdk/schematics/utils/project-main-file.js +6 -3
- package/schematics/cdk/schematics/utils/project-main-file.mjs +6 -3
- package/schematics/cdk/schematics/utils/project-style-file.d.ts +2 -2
- package/schematics/cdk/schematics/utils/project-style-file.js +4 -3
- package/schematics/cdk/schematics/utils/project-style-file.mjs +4 -3
- package/schematics/cdk/schematics/utils/project-targets.d.ts +6 -10
- package/schematics/cdk/schematics/utils/project-targets.js +18 -13
- package/schematics/cdk/schematics/utils/project-targets.mjs +18 -13
- package/schematics/cdk/schematics/utils/project-tsconfig-paths.d.ts +3 -3
- package/schematics/cdk/schematics/utils/project-tsconfig-paths.js +14 -29
- package/schematics/cdk/schematics/utils/project-tsconfig-paths.mjs +14 -29
- package/schematics/cdk/schematics/utils/schematic-options.d.ts +5 -2
- package/schematics/cdk/schematics/utils/schematic-options.js +25 -5
- package/schematics/cdk/schematics/utils/schematic-options.mjs +25 -5
- package/schematics/fonts/material-fonts.js +8 -19
- package/schematics/fonts/material-fonts.mjs +35 -0
- package/schematics/ng-add/schema.json +1 -0
- package/schematics/theming/create-custom-theme.d.ts +9 -2
- package/schematics/theming/create-custom-theme.js +51 -11
- package/schematics/theming/create-custom-theme.mjs +51 -0
- package/schematics/theming/theming.d.ts +13 -6
- package/schematics/theming/theming.js +167 -179
- package/schematics/theming/theming.mjs +152 -0
- package/schematics/theming/theming2.js +179 -0
- package/schematics/cdk/schematics/ng-update/migrations/tilde-import-v13/tilde-import-migration.d.ts +0 -14
- package/schematics/cdk/schematics/ng-update/migrations/tilde-import-v13/tilde-import-migration.js +0 -39
- package/schematics/cdk/schematics/ng-update/migrations/tilde-import-v13/tilde-import-migration.mjs +0 -39
- package/schematics/cdk/schematics/utils/vendored-ast-utils/index.d.ts +0 -70
- package/schematics/cdk/schematics/utils/vendored-ast-utils/index.js +0 -480
- package/schematics/cdk/schematics/utils/vendored-ast-utils/index.mjs +0 -480
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.io/license
|
|
8
|
+
*/
|
|
9
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
10
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
11
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
12
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
13
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
14
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
15
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.addTypographyClass = exports.addThemeToAppStyles = void 0;
|
|
20
|
+
const core_1 = require("@angular-devkit/core");
|
|
21
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
22
|
+
const schematics_2 = require("jqwidgets-ng/schematics/cdk/schematics");
|
|
23
|
+
const change_1 = require("@schematics/angular/utility/change");
|
|
24
|
+
const workspace_1 = require("@schematics/angular/utility/workspace");
|
|
25
|
+
const path_1 = require("path");
|
|
26
|
+
const create_custom_theme_1 = require("./create-custom-theme");
|
|
27
|
+
/** Path segment that can be found in paths that refer to a prebuilt theme. */
|
|
28
|
+
let prebuiltThemePathSegment = 'jqwidgets-ng/jqwidgets/styles';
|
|
29
|
+
/** Default file name of the custom theme that can be generated. */
|
|
30
|
+
const defaultCustomThemeFilename = 'custom-theme.scss';
|
|
31
|
+
/** Add pre-built styles to the main project style file. */
|
|
32
|
+
function addThemeToAppStyles(options) {
|
|
33
|
+
return (host, context) => {
|
|
34
|
+
const themeName = options.theme || 'base';
|
|
35
|
+
|
|
36
|
+
return themeName === 'custom' ?
|
|
37
|
+
insertCustomTheme(options.project, host, context.logger) :
|
|
38
|
+
insertPrebuiltTheme(options.project, 'jqx.' + themeName, context.logger);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
exports.addThemeToAppStyles = addThemeToAppStyles;
|
|
42
|
+
/** Adds the global typography class to the body element. */
|
|
43
|
+
function addTypographyClass(options) {
|
|
44
|
+
return (host) => __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
const workspace = yield workspace_1.getWorkspace(host);
|
|
46
|
+
const project = schematics_2.getProjectFromWorkspace(workspace, options.project);
|
|
47
|
+
const projectIndexFiles = schematics_2.getProjectIndexFiles(project);
|
|
48
|
+
if (!projectIndexFiles.length) {
|
|
49
|
+
throw new schematics_1.SchematicsException('No project index HTML file could be found.');
|
|
50
|
+
}
|
|
51
|
+
if (options.typography) {
|
|
52
|
+
projectIndexFiles.forEach(path => schematics_2.addBodyClass(host, path, 'mat-typography'));
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
exports.addTypographyClass = addTypographyClass;
|
|
57
|
+
/**
|
|
58
|
+
* Insert a custom theme to project style file. If no valid style file could be found, a new
|
|
59
|
+
* Scss file for the custom theme will be created.
|
|
60
|
+
*/
|
|
61
|
+
function insertCustomTheme(projectName, host, logger) {
|
|
62
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
const workspace = yield workspace_1.getWorkspace(host);
|
|
64
|
+
const project = schematics_2.getProjectFromWorkspace(workspace, projectName);
|
|
65
|
+
const stylesPath = schematics_2.getProjectStyleFile(project, 'scss');
|
|
66
|
+
const themeContent = create_custom_theme_1.createCustomTheme(projectName);
|
|
67
|
+
if (!stylesPath) {
|
|
68
|
+
if (!project.sourceRoot) {
|
|
69
|
+
throw new schematics_1.SchematicsException(`Could not find source root for project: "${projectName}". ` +
|
|
70
|
+
`Please make sure that the "sourceRoot" property is set in the workspace config.`);
|
|
71
|
+
}
|
|
72
|
+
// Normalize the path through the devkit utilities because we want to avoid having
|
|
73
|
+
// unnecessary path segments and windows backslash delimiters.
|
|
74
|
+
const customThemePath = core_1.normalize(path_1.join(project.sourceRoot, defaultCustomThemeFilename));
|
|
75
|
+
if (host.exists(customThemePath)) {
|
|
76
|
+
logger.warn(`Cannot create a custom Angular Material theme because
|
|
77
|
+
${customThemePath} already exists. Skipping custom theme generation.`);
|
|
78
|
+
return schematics_1.noop();
|
|
79
|
+
}
|
|
80
|
+
host.create(customThemePath, themeContent);
|
|
81
|
+
return addThemeStyleToTarget(projectName, 'build', customThemePath, logger);
|
|
82
|
+
}
|
|
83
|
+
const insertion = new change_1.InsertChange(stylesPath, 0, themeContent);
|
|
84
|
+
const recorder = host.beginUpdate(stylesPath);
|
|
85
|
+
recorder.insertLeft(insertion.pos, insertion.toAdd);
|
|
86
|
+
host.commitUpdate(recorder);
|
|
87
|
+
return schematics_1.noop();
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
/** Insert a pre-built theme into the angular.json file. */
|
|
91
|
+
function insertPrebuiltTheme(project, theme, logger) {
|
|
92
|
+
// Path needs to be always relative to the `package.json` or workspace root.
|
|
93
|
+
const baseThemePath = `./node_modules/jqwidgets-ng/jqwidgets/styles/jqx.base.css`;
|
|
94
|
+
const themePath = `./node_modules/jqwidgets-ng/jqwidgets/styles/${theme}.css`;
|
|
95
|
+
|
|
96
|
+
if (theme === 'jqx.base') {
|
|
97
|
+
return schematics_1.chain([
|
|
98
|
+
addThemeStyleToTarget(project, 'build', themePath, logger),
|
|
99
|
+
addThemeStyleToTarget(project, 'test', themePath, logger)
|
|
100
|
+
]);
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
prebuiltThemePathSegment += "/" + theme;
|
|
104
|
+
|
|
105
|
+
return schematics_1.chain([
|
|
106
|
+
addThemeStyleToTarget(project, 'build', baseThemePath, logger),
|
|
107
|
+
addThemeStyleToTarget(project, 'test', baseThemePath, logger),
|
|
108
|
+
addThemeStyleToTarget(project, 'build', themePath, logger),
|
|
109
|
+
addThemeStyleToTarget(project, 'test', themePath, logger)
|
|
110
|
+
]);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
/** Adds a theming style entry to the given project target options. */
|
|
114
|
+
function addThemeStyleToTarget(projectName, targetName, assetPath, logger) {
|
|
115
|
+
return workspace_1.updateWorkspace(workspace => {
|
|
116
|
+
const project = schematics_2.getProjectFromWorkspace(workspace, projectName);
|
|
117
|
+
// Do not update the builder options in case the target does not use the default CLI builder.
|
|
118
|
+
if (!validateDefaultTargetBuilder(project, targetName, logger)) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const targetOptions = schematics_2.getProjectTargetOptions(project, targetName);
|
|
122
|
+
const styles = targetOptions.styles;
|
|
123
|
+
if (!styles) {
|
|
124
|
+
targetOptions.styles = [assetPath];
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
const existingStyles = styles.map(s => typeof s === 'string' ? s : s.input);
|
|
128
|
+
for (let [index, stylePath] of existingStyles.entries()) {
|
|
129
|
+
// If the given asset is already specified in the styles, we don't need to do anything.
|
|
130
|
+
if (stylePath === assetPath) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
// In case a prebuilt theme is already set up, we can safely replace the theme with the new
|
|
134
|
+
// theme file. If a custom theme is set up, we are not able to safely replace the custom
|
|
135
|
+
// theme because these files can contain custom styles, while prebuilt themes are
|
|
136
|
+
// always packaged and considered replaceable.
|
|
137
|
+
if (stylePath.includes(defaultCustomThemeFilename)) {
|
|
138
|
+
logger.error(`Could not add the selected theme to the CLI project ` +
|
|
139
|
+
`configuration because there is already a custom theme file referenced.`);
|
|
140
|
+
logger.info(`Please manually add the following style file to your configuration:`);
|
|
141
|
+
logger.info(` ${assetPath}`);
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
else if (stylePath.includes(prebuiltThemePathSegment)) {
|
|
145
|
+
styles.splice(index, 1);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
styles.push(assetPath);
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Validates that the specified project target is configured with the default builders which are
|
|
154
|
+
* provided by the Angular CLI. If the configured builder does not match the default builder,
|
|
155
|
+
* this function can either throw or just show a warning.
|
|
156
|
+
*/
|
|
157
|
+
function validateDefaultTargetBuilder(project, targetName, logger) {
|
|
158
|
+
const defaultBuilder = schematics_2.defaultTargetBuilders[targetName];
|
|
159
|
+
const targetConfig = project.targets && project.targets.get(targetName);
|
|
160
|
+
const isDefaultBuilder = targetConfig && targetConfig['builder'] === defaultBuilder;
|
|
161
|
+
// Because the build setup for the Angular CLI can be customized by developers, we can't know
|
|
162
|
+
// where to put the theme file in the workspace configuration if custom builders are being
|
|
163
|
+
// used. In case the builder has been changed for the "build" target, we throw an error and
|
|
164
|
+
// exit because setting up a theme is a primary goal of `ng-add`. Otherwise if just the "test"
|
|
165
|
+
// builder has been changed, we warn because a theme is not mandatory for running tests
|
|
166
|
+
// with Material. See: https://github.com/angular/components/issues/14176
|
|
167
|
+
if (!isDefaultBuilder && targetName === 'build') {
|
|
168
|
+
throw new schematics_1.SchematicsException(`Your project is not using the default builders for ` +
|
|
169
|
+
`"${targetName}". The Angular Material schematics cannot add a theme to the workspace ` +
|
|
170
|
+
`configuration if the builder has been changed.`);
|
|
171
|
+
}
|
|
172
|
+
else if (!isDefaultBuilder) {
|
|
173
|
+
// for non-build targets we gracefully report the error without actually aborting the
|
|
174
|
+
// setup schematic. This is because a theme is not mandatory for running tests.
|
|
175
|
+
logger.warn(`Your project is not using the default builders for "${targetName}". This ` +
|
|
176
|
+
`means that we cannot add the configured theme to the "${targetName}" target.`);
|
|
177
|
+
}
|
|
178
|
+
return isDefaultBuilder;
|
|
179
|
+
}
|
package/schematics/cdk/schematics/ng-update/migrations/tilde-import-v13/tilde-import-migration.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import { ResolvedResource } from '../../../update-tool/component-resource-collector';
|
|
9
|
-
import { DevkitMigration } from '../../devkit-migration';
|
|
10
|
-
/** Migration that removes tilde symbols from imports. */
|
|
11
|
-
export declare class TildeImportMigration extends DevkitMigration<null> {
|
|
12
|
-
enabled: boolean;
|
|
13
|
-
visitStylesheet(stylesheet: ResolvedResource): void;
|
|
14
|
-
}
|
package/schematics/cdk/schematics/ng-update/migrations/tilde-import-v13/tilde-import-migration.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5
|
-
*
|
|
6
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
-
* found in the LICENSE file at https://angular.io/license
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.TildeImportMigration = void 0;
|
|
11
|
-
const core_1 = require("@angular-devkit/core");
|
|
12
|
-
const target_version_1 = require("../../../update-tool/target-version");
|
|
13
|
-
const devkit_migration_1 = require("../../devkit-migration");
|
|
14
|
-
/** Migration that removes tilde symbols from imports. */
|
|
15
|
-
class TildeImportMigration extends devkit_migration_1.DevkitMigration {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
this.enabled = this.targetVersion === target_version_1.TargetVersion.V13;
|
|
19
|
-
}
|
|
20
|
-
visitStylesheet(stylesheet) {
|
|
21
|
-
const extension = (0, core_1.extname)(stylesheet.filePath);
|
|
22
|
-
if (extension === '.scss' || extension === '.css') {
|
|
23
|
-
const content = stylesheet.content;
|
|
24
|
-
const migratedContent = content.replace(/@(?:import|use) +['"](~@angular\/.*)['"].*;?/g, (match, importPath) => {
|
|
25
|
-
const index = match.indexOf(importPath);
|
|
26
|
-
const newImportPath = importPath.replace(/^~|\.scss$/g, '');
|
|
27
|
-
return match.slice(0, index) + newImportPath + match.slice(index + importPath.length);
|
|
28
|
-
});
|
|
29
|
-
if (migratedContent && migratedContent !== content) {
|
|
30
|
-
this.fileSystem
|
|
31
|
-
.edit(stylesheet.filePath)
|
|
32
|
-
.remove(0, stylesheet.content.length)
|
|
33
|
-
.insertLeft(0, migratedContent);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
exports.TildeImportMigration = TildeImportMigration;
|
|
39
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGlsZGUtaW1wb3J0LW1pZ3JhdGlvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3NyYy9jZGsvc2NoZW1hdGljcy9uZy11cGRhdGUvbWlncmF0aW9ucy90aWxkZS1pbXBvcnQtdjEzL3RpbGRlLWltcG9ydC1taWdyYXRpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7R0FNRzs7O0FBRUgsK0NBQTZDO0FBRTdDLHdFQUFrRTtBQUNsRSw2REFBdUQ7QUFFdkQseURBQXlEO0FBQ3pELE1BQWEsb0JBQXFCLFNBQVEsa0NBQXFCO0lB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Vuc2lvbiA9IGV4dG5hbWUoc3R5bGVzaGVldC5maWxlUGF0aCk7XG5cbiAgICBpZiAoZXh0ZW5zaW9uID09PSAnLnNjc3MnIHx8IGV4dGVuc2lvbiA9PT0gJy5jc3MnKSB7XG4gICAgICBjb25zdCBjb250ZW50ID0gc3R5bGVzaGVldC5jb250ZW50O1xuICAgICAgY29uc3QgbWlncmF0ZWRDb250ZW50ID0gY29udGVudC5yZXBsYWNlKFxuICAgICAgICAvQCg/OmltcG9ydHx1c2UpICtbJ1wiXSh+QGFuZ3VsYXJcXC8uKilbJ1wiXS4qOz8vZyxcbiAgICAgICAgKG1hdGNoLCBpbXBvcnRQYXRoKSA9PiB7XG4gICAgICAgICAgY29uc3QgaW5kZXggPSBtYXRjaC5pbmRleE9mKGltcG9ydFBhdGgpO1xuICAgICAgICAgIGNvbnN0IG5ld0ltcG9ydFBhdGggPSBpbXBvcnRQYXRoLnJlcGxhY2UoL15+fFxcLnNjc3MkL2csICcnKTtcbiAgICAgICAgICByZXR1cm4gbWF0Y2guc2xpY2UoMCwgaW5kZXgpICsgbmV3SW1wb3J0UGF0aCArIG1hdGNoLnNsaWNlKGluZGV4ICsgaW1wb3J0UGF0aC5sZW5ndGgpO1xuICAgICAgICB9LFxuICAgICAgKTtcblxuICAgICAgaWYgKG1pZ3JhdGVkQ29udGVudCAmJiBtaWdyYXRlZENvbnRlbnQgIT09IGNvbnRlbnQpIHtcbiAgICAgICAgdGhpcy5maWxlU3lzdGVtXG4gICAgICAgICAgLmVkaXQoc3R5bGVzaGVldC5maWxlUGF0aClcbiAgICAgICAgICAucmVtb3ZlKDAsIHN0eWxlc2hlZXQuY29udGVudC5sZW5ndGgpXG4gICAgICAgICAgLmluc2VydExlZnQoMCwgbWlncmF0ZWRDb250ZW50KTtcbiAgICAgIH1cbiAgICB9XG4gIH1cbn1cbiJdfQ==
|
package/schematics/cdk/schematics/ng-update/migrations/tilde-import-v13/tilde-import-migration.mjs
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5
|
-
*
|
|
6
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
-
* found in the LICENSE file at https://angular.io/license
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.TildeImportMigration = void 0;
|
|
11
|
-
const core_1 = require("@angular-devkit/core");
|
|
12
|
-
const target_version_1 = require("../../../update-tool/target-version");
|
|
13
|
-
const devkit_migration_1 = require("../../devkit-migration");
|
|
14
|
-
/** Migration that removes tilde symbols from imports. */
|
|
15
|
-
class TildeImportMigration extends devkit_migration_1.DevkitMigration {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
this.enabled = this.targetVersion === target_version_1.TargetVersion.V13;
|
|
19
|
-
}
|
|
20
|
-
visitStylesheet(stylesheet) {
|
|
21
|
-
const extension = (0, core_1.extname)(stylesheet.filePath);
|
|
22
|
-
if (extension === '.scss' || extension === '.css') {
|
|
23
|
-
const content = stylesheet.content;
|
|
24
|
-
const migratedContent = content.replace(/@(?:import|use) +['"](~@angular\/.*)['"].*;?/g, (match, importPath) => {
|
|
25
|
-
const index = match.indexOf(importPath);
|
|
26
|
-
const newImportPath = importPath.replace(/^~|\.scss$/g, '');
|
|
27
|
-
return match.slice(0, index) + newImportPath + match.slice(index + importPath.length);
|
|
28
|
-
});
|
|
29
|
-
if (migratedContent && migratedContent !== content) {
|
|
30
|
-
this.fileSystem
|
|
31
|
-
.edit(stylesheet.filePath)
|
|
32
|
-
.remove(0, stylesheet.content.length)
|
|
33
|
-
.insertLeft(0, migratedContent);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
exports.TildeImportMigration = TildeImportMigration;
|
|
39
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozL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gICB9LFxuICAgICAgKTtcblxuICAgICAgaWYgKG1pZ3JhdGVkQ29udGVudCAmJiBtaWdyYXRlZENvbnRlbnQgIT09IGNvbnRlbnQpIHtcbiAgICAgICAgdGhpcy5maWxlU3lzdGVtXG4gICAgICAgICAgLmVkaXQoc3R5bGVzaGVldC5maWxlUGF0aClcbiAgICAgICAgICAucmVtb3ZlKDAsIHN0eWxlc2hlZXQuY29udGVudC5sZW5ndGgpXG4gICAgICAgICAgLmluc2VydExlZnQoMCwgbWlncmF0ZWRDb250ZW50KTtcbiAgICAgIH1cbiAgICB9XG4gIH1cbn1cbiJdfQ==
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import { Tree } from '@angular-devkit/schematics';
|
|
9
|
-
import { Change } from '@schematics/angular/utility/change';
|
|
10
|
-
import * as ts from 'typescript';
|
|
11
|
-
/**
|
|
12
|
-
* Add Import `import { symbolName } from fileName` if the import doesn't exit
|
|
13
|
-
* already. Assumes fileToEdit can be resolved and accessed.
|
|
14
|
-
* @param fileToEdit (file we want to add import to)
|
|
15
|
-
* @param symbolName (item to import)
|
|
16
|
-
* @param fileName (path to the file)
|
|
17
|
-
* @param isDefault (if true, import follows style for importing default exports)
|
|
18
|
-
* @return Change
|
|
19
|
-
*/
|
|
20
|
-
export declare function insertImport(source: ts.SourceFile, fileToEdit: string, symbolName: string, fileName: string, isDefault?: boolean): Change;
|
|
21
|
-
/**
|
|
22
|
-
* Find all nodes from the AST in the subtree of node of SyntaxKind kind.
|
|
23
|
-
* @param node
|
|
24
|
-
* @param kind
|
|
25
|
-
* @param max The maximum number of items to return.
|
|
26
|
-
* @param recursive Continue looking for nodes of kind recursive until end
|
|
27
|
-
* the last child even when node of kind has been found.
|
|
28
|
-
* @return all nodes of kind, or [] if none is found
|
|
29
|
-
*/
|
|
30
|
-
export declare function findNodes(node: ts.Node, kind: ts.SyntaxKind, max?: number, recursive?: boolean): ts.Node[];
|
|
31
|
-
/**
|
|
32
|
-
* Get all the nodes from a source.
|
|
33
|
-
* @param sourceFile The source file object.
|
|
34
|
-
* @returns {Observable<ts.Node>} An observable of all the nodes in the source.
|
|
35
|
-
*/
|
|
36
|
-
export declare function getSourceNodes(sourceFile: ts.SourceFile): ts.Node[];
|
|
37
|
-
export declare function findNode(node: ts.Node, kind: ts.SyntaxKind, text: string): ts.Node | null;
|
|
38
|
-
/**
|
|
39
|
-
* Insert `toInsert` after the last occurence of `ts.SyntaxKind[nodes[i].kind]`
|
|
40
|
-
* or after the last of occurence of `syntaxKind` if the last occurence is a sub child
|
|
41
|
-
* of ts.SyntaxKind[nodes[i].kind] and save the changes in file.
|
|
42
|
-
*
|
|
43
|
-
* @param nodes insert after the last occurence of nodes
|
|
44
|
-
* @param toInsert string to insert
|
|
45
|
-
* @param file file to insert changes into
|
|
46
|
-
* @param fallbackPos position to insert if toInsert happens to be the first occurence
|
|
47
|
-
* @param syntaxKind the ts.SyntaxKind of the subchildren to insert after
|
|
48
|
-
* @return Change instance
|
|
49
|
-
* @throw Error if toInsert is first occurence but fall back is not set
|
|
50
|
-
*/
|
|
51
|
-
export declare function insertAfterLastOccurrence(nodes: ts.Node[], toInsert: string, file: string, fallbackPos: number, syntaxKind?: ts.SyntaxKind): Change;
|
|
52
|
-
export declare function getDecoratorMetadata(source: ts.SourceFile, identifier: string, module: string): ts.Node[];
|
|
53
|
-
export declare function getMetadataField(node: ts.ObjectLiteralExpression, metadataField: string): ts.ObjectLiteralElement[];
|
|
54
|
-
export declare function addSymbolToNgModuleMetadata(source: ts.SourceFile, ngModulePath: string, metadataField: string, symbolName: string, importPath?: string | null): Change[];
|
|
55
|
-
/**
|
|
56
|
-
* Custom function to insert a declaration (component, pipe, directive)
|
|
57
|
-
* into NgModule declarations. It also imports the component.
|
|
58
|
-
*/
|
|
59
|
-
export declare function addDeclarationToModule(source: ts.SourceFile, modulePath: string, classifiedName: string, importPath: string): Change[];
|
|
60
|
-
/**
|
|
61
|
-
* Custom function to insert an NgModule into NgModule imports. It also imports the module.
|
|
62
|
-
*/
|
|
63
|
-
export declare function addImportToModule(source: ts.SourceFile, modulePath: string, classifiedName: string, importPath: string): Change[];
|
|
64
|
-
/**
|
|
65
|
-
* Custom function to insert an export into NgModule. It also imports it.
|
|
66
|
-
*/
|
|
67
|
-
export declare function addExportToModule(source: ts.SourceFile, modulePath: string, classifiedName: string, importPath: string): Change[];
|
|
68
|
-
export declare function findBootstrapModuleCall(host: Tree, mainPath: string): ts.CallExpression | null;
|
|
69
|
-
export declare function findBootstrapModulePath(host: Tree, mainPath: string): string;
|
|
70
|
-
export declare function getAppModulePath(host: Tree, mainPath: string): string;
|