@energycap/components 0.39.9-ECAP-23221-bc-file-upload-dialog.20240229-1206 → 0.39.9-schematics.20240307-1411
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/esm2020/lib/controls/combobox/combobox.component.mjs +1 -1
- package/esm2020/lib/controls/form-control/form-control.component.mjs +2 -2
- package/esm2020/lib/controls/select/select.component.mjs +2 -2
- package/esm2020/lib/display/confirm/confirm.component.mjs +3 -5
- package/esm2020/lib/shared/page/page-view/page-view.component.mjs +3 -7
- package/fesm2015/energycap-components.mjs +8 -14
- package/fesm2015/energycap-components.mjs.map +1 -1
- package/fesm2020/energycap-components.mjs +8 -14
- package/fesm2020/energycap-components.mjs.map +1 -1
- package/lib/display/confirm/confirm.component.d.ts +0 -2
- package/lib/shared/page/page-view/page-view.component.d.ts +1 -3
- package/package.json +2 -1
- package/schematics/collection.json +9 -0
- package/schematics/ng-generate/rxjs-7-upgrade/index.d.ts +2 -0
- package/schematics/ng-generate/rxjs-7-upgrade/index.js +136 -0
- package/schematics/ng-generate/rxjs-7-upgrade/index.js.map +1 -0
@@ -51,8 +51,6 @@ export declare class ConfirmDialogContext {
|
|
51
51
|
saveButtonType?: ButtonType;
|
52
52
|
/** Optional cancel button label */
|
53
53
|
cancelLabel?: string;
|
54
|
-
/** Optional flag for hiding the cancel (secondary) button */
|
55
|
-
hideCancel?: boolean;
|
56
54
|
/** When true, adds the submit tag to the save button so hitting enter triggers the save */
|
57
55
|
saveOnEnter?: boolean;
|
58
56
|
/** Optional alternate save button label */
|
@@ -50,8 +50,6 @@ export declare class PageViewComponent {
|
|
50
50
|
*/
|
51
51
|
secondaryActionLabel?: string;
|
52
52
|
hideSecondaryAction: boolean;
|
53
|
-
/** Flag for hiding the tiny close button in the top-right corner of dialog while in pending state only */
|
54
|
-
hideCloseOnPending: boolean;
|
55
53
|
/**
|
56
54
|
* Label for the primary button in the header. Default is 'Save'
|
57
55
|
*/
|
@@ -94,5 +92,5 @@ export declare class PageViewComponent {
|
|
94
92
|
secondaryAction(event: any): void;
|
95
93
|
closeDialog(): void;
|
96
94
|
static ɵfac: i0.ɵɵFactoryDeclaration<PageViewComponent, never>;
|
97
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<PageViewComponent, "ec-page-view", never, { "isDialog": "isDialog"; "readonly": "readonly"; "status": "status"; "showHeader": "showHeader"; "errors": "errors"; "breadcrumbs": "breadcrumbs"; "title": "title"; "titleIcon": "titleIcon"; "subTitle": "subTitle"; "subTitleUrl": "subTitleUrl"; "moreActionsLabel": "moreActionsLabel"; "moreActions": "moreActions"; "secondaryActionLabel": "secondaryActionLabel"; "hideSecondaryAction": "hideSecondaryAction"; "
|
95
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PageViewComponent, "ec-page-view", never, { "isDialog": "isDialog"; "readonly": "readonly"; "status": "status"; "showHeader": "showHeader"; "errors": "errors"; "breadcrumbs": "breadcrumbs"; "title": "title"; "titleIcon": "titleIcon"; "subTitle": "subTitle"; "subTitleUrl": "subTitleUrl"; "moreActionsLabel": "moreActionsLabel"; "moreActions": "moreActions"; "secondaryActionLabel": "secondaryActionLabel"; "hideSecondaryAction": "hideSecondaryAction"; "primaryActionLabel": "primaryActionLabel"; "hidePrimaryAction": "hidePrimaryAction"; "customTitleTemplate": "customTitleTemplate"; "customActionsTemplate": "customActionsTemplate"; "customHeaderTemplate": "customHeaderTemplate"; "footerTemplate": "footerTemplate"; "customErrorBannerTemplate": "customErrorBannerTemplate"; "stickyFooter": "stickyFooter"; "fitContent": "fitContent"; "bgContent": "bgContent"; }, { "onPrimaryAction": "onPrimaryAction"; "onSecondaryAction": "onSecondaryAction"; }, never, ["*"], false, never>;
|
98
96
|
}
|
package/package.json
CHANGED
@@ -0,0 +1,136 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.rxjs7Upgrade = void 0;
|
13
|
+
const core_1 = require("@angular-devkit/core");
|
14
|
+
const workspace_1 = require("@schematics/angular/utility/workspace");
|
15
|
+
const ts = require("typescript");
|
16
|
+
const path_1 = require("path");
|
17
|
+
// import { insertImport, findNodes } from '@schematics/angular/utility/ast-utils';
|
18
|
+
function rxjs7Upgrade() {
|
19
|
+
return (tree) => __awaiter(this, void 0, void 0, function* () {
|
20
|
+
const workspaceHost = createWorkspaceHost(tree);
|
21
|
+
const { workspace } = yield core_1.workspaces.readWorkspace('/', workspaceHost);
|
22
|
+
// Get all tsconfig paths from the workspace, including test tsconfigs
|
23
|
+
const tsConfigPaths = getTsConfigPaths(workspace, tree);
|
24
|
+
// The base path in the file system for the workspace. This is needed for the typescript compiler to resolve files correctly.
|
25
|
+
const basePath = process.cwd().replace(/\\/g, '/');
|
26
|
+
tsConfigPaths.forEach(tsConfigPath => {
|
27
|
+
const program = createTsProgram(tree, tsConfigPath, basePath);
|
28
|
+
const printer = ts.createPrinter();
|
29
|
+
const checker = program.getTypeChecker();
|
30
|
+
// const migratedFiles = new Map<string, string>();
|
31
|
+
const transformer = getTransformer(checker);
|
32
|
+
for (const sourceFile of program.getSourceFiles()) {
|
33
|
+
// Skip declaration files and external library files
|
34
|
+
if (sourceFile.isDeclarationFile || program.isSourceFileFromExternalLibrary(sourceFile)) {
|
35
|
+
continue;
|
36
|
+
}
|
37
|
+
const result = ts.transform(sourceFile, [transformer]);
|
38
|
+
const transformedSourceFile = result.transformed[0];
|
39
|
+
const transformedContent = printer.printFile(transformedSourceFile);
|
40
|
+
console.log(transformedContent === sourceFile.getFullText() ? 'No changes' : 'Changes detected');
|
41
|
+
}
|
42
|
+
});
|
43
|
+
});
|
44
|
+
}
|
45
|
+
exports.rxjs7Upgrade = rxjs7Upgrade;
|
46
|
+
function createWorkspaceHost(tree) {
|
47
|
+
return {
|
48
|
+
readFile(path) {
|
49
|
+
return __awaiter(this, void 0, void 0, function* () {
|
50
|
+
const data = tree.read(path);
|
51
|
+
if (!data) {
|
52
|
+
throw new Error(`File not found: ${path}`);
|
53
|
+
}
|
54
|
+
return core_1.virtualFs.fileBufferToString(data);
|
55
|
+
});
|
56
|
+
},
|
57
|
+
writeFile(path, data) {
|
58
|
+
return __awaiter(this, void 0, void 0, function* () {
|
59
|
+
return tree.overwrite(path, data);
|
60
|
+
});
|
61
|
+
},
|
62
|
+
isDirectory(path) {
|
63
|
+
return __awaiter(this, void 0, void 0, function* () {
|
64
|
+
return !tree.exists(path) && tree.getDir(path).subfiles.length > 0;
|
65
|
+
});
|
66
|
+
},
|
67
|
+
isFile(path) {
|
68
|
+
return __awaiter(this, void 0, void 0, function* () {
|
69
|
+
return tree.exists(path);
|
70
|
+
});
|
71
|
+
}
|
72
|
+
};
|
73
|
+
}
|
74
|
+
function getTsConfigPaths(workspace, tree) {
|
75
|
+
const buildPaths = new Set();
|
76
|
+
const testPaths = new Set();
|
77
|
+
for (const [name, target] of (0, workspace_1.allWorkspaceTargets)(workspace)) {
|
78
|
+
if (name !== 'build' && name !== 'test') {
|
79
|
+
continue;
|
80
|
+
}
|
81
|
+
for (const [, options] of (0, workspace_1.allTargetOptions)(target)) {
|
82
|
+
if (options.tsConfig && typeof options.tsConfig === 'string' && tree.exists(options.tsConfig)) {
|
83
|
+
const normalizedPath = (0, core_1.normalize)(options.tsConfig);
|
84
|
+
name === 'build' ? buildPaths.add(normalizedPath) : testPaths.add(normalizedPath);
|
85
|
+
}
|
86
|
+
}
|
87
|
+
}
|
88
|
+
return [...buildPaths];
|
89
|
+
}
|
90
|
+
function createTsProgram(tree, tsConfigPath, basePath) {
|
91
|
+
tsConfigPath = (0, path_1.resolve)(basePath, tsConfigPath);
|
92
|
+
const parsed = parseTsConfig(tsConfigPath, (0, path_1.dirname)(tsConfigPath));
|
93
|
+
const options = Object.assign(Object.assign({}, parsed.options), { skipLibCheck: true, skipDefaultLibCheck: true });
|
94
|
+
const host = createTsCompilerHost(tree, options, basePath);
|
95
|
+
return ts.createProgram(parsed.fileNames, options, host);
|
96
|
+
}
|
97
|
+
function parseTsConfig(tsConfigPath, basePath) {
|
98
|
+
const { config } = ts.readConfigFile(tsConfigPath, ts.sys.readFile);
|
99
|
+
const parseHost = {
|
100
|
+
useCaseSensitiveFileNames: ts.sys.useCaseSensitiveFileNames,
|
101
|
+
fileExists: ts.sys.fileExists,
|
102
|
+
readFile: ts.sys.readFile,
|
103
|
+
readDirectory: ts.sys.readDirectory
|
104
|
+
};
|
105
|
+
return ts.parseJsonConfigFileContent(config, parseHost, basePath, {});
|
106
|
+
}
|
107
|
+
function createTsCompilerHost(tree, options, basePath) {
|
108
|
+
const host = ts.createCompilerHost(options);
|
109
|
+
// Read files from the virtual tree to prevent conflicting changes between project migrations
|
110
|
+
host.readFile = (fileName) => {
|
111
|
+
var _a;
|
112
|
+
const relativePath = (0, path_1.relative)(basePath, fileName);
|
113
|
+
const result = (_a = tree.read(relativePath)) === null || _a === void 0 ? void 0 : _a.toString();
|
114
|
+
// Remove BOM header to prevent TSC parsing errors
|
115
|
+
return result === null || result === void 0 ? void 0 : result.replace(/^\uFEFF/, '');
|
116
|
+
};
|
117
|
+
return host;
|
118
|
+
}
|
119
|
+
function getTransformer(checker) {
|
120
|
+
return (context) => {
|
121
|
+
const visit = (node) => {
|
122
|
+
// Check if this is a call expression where the expression is a property access expression with the name 'toPromise'
|
123
|
+
if (ts.isCallExpression(node) && ts.isPropertyAccessExpression(node.expression) && node.expression.name.text === 'toPromise') {
|
124
|
+
// Get the type of the object on which 'toPromise' is being called
|
125
|
+
const symbol = checker.getTypeAtLocation(node.expression.expression).symbol;
|
126
|
+
if (symbol && ['Observable', 'Subject', 'BehaviorSubject', 'ReplaySubject', 'AsyncSubject'].includes(symbol.name)) {
|
127
|
+
// Replace the node with a call expression where the expression is an identifier with the name 'lastValueFrom'
|
128
|
+
return ts.factory.createCallExpression(ts.factory.createIdentifier('lastValueFrom'), undefined, [node.expression.expression]);
|
129
|
+
}
|
130
|
+
}
|
131
|
+
return ts.visitEachChild(node, visit, context);
|
132
|
+
};
|
133
|
+
return (sourceFile) => ts.visitNode(sourceFile, visit);
|
134
|
+
};
|
135
|
+
}
|
136
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../projects/components/schematics/ng-generate/rxjs-7-upgrade/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,+CAAwE;AACxE,qEAA8F;AAC9F,iCAAiC;AACjC,+BAAkD;AAClD,mFAAmF;AAEnF,SAAgB,YAAY;IAC1B,OAAO,CAAO,IAAU,EAAE,EAAE;QAC1B,MAAM,aAAa,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAChD,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,iBAAU,CAAC,aAAa,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;QAEzE,sEAAsE;QACtE,MAAM,aAAa,GAAG,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QACxD,6HAA6H;QAC7H,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAEnD,aAAa,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;YACnC,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC;YAC9D,MAAM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