@taiga-ui/cdk 3.25.0 → 3.26.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/bundles/taiga-ui-cdk-constants.umd.js +1 -1
- package/bundles/taiga-ui-cdk-constants.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-services.umd.js +28 -28
- package/bundles/taiga-ui-cdk-services.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-tokens.umd.js +5 -0
- package/bundles/taiga-ui-cdk-tokens.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js +12 -0
- package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js.map +1 -1
- package/constants/version.d.ts +1 -1
- package/constants/version.js +1 -1
- package/esm2015/constants/version.js +2 -2
- package/esm2015/interfaces/month-like.js +1 -1
- package/esm2015/services/static-request.service.js +27 -28
- package/esm2015/tokens/index.js +2 -1
- package/esm2015/tokens/is-stackblitz.js +6 -0
- package/esm2015/utils/miscellaneous/index.js +2 -1
- package/esm2015/utils/miscellaneous/is-valid-url.js +11 -0
- package/fesm2015/taiga-ui-cdk-constants.js +1 -1
- package/fesm2015/taiga-ui-cdk-constants.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-services.js +24 -27
- package/fesm2015/taiga-ui-cdk-services.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-tokens.js +5 -1
- package/fesm2015/taiga-ui-cdk-tokens.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js +12 -1
- package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js.map +1 -1
- package/interfaces/month-like.d.ts +1 -1
- package/package.json +4 -3
- package/schematics/constants/file-globs.js +1 -0
- package/schematics/ng-add/constants/modules.d.ts +5 -1
- package/schematics/ng-add/constants/modules.js +9 -11
- package/schematics/ng-add/schema.json +4 -0
- package/schematics/ng-add/steps/add-taiga-modules.js +85 -15
- package/schematics/ng-add/steps/wrap-with-tui-root.js +21 -8
- package/schematics/ng-update/steps/replace-const.d.ts +1 -1
- package/schematics/ng-update/steps/replace-const.js +2 -2
- package/schematics/ng-update/v3/constants/{consts.d.ts → constants.d.ts} +1 -1
- package/schematics/ng-update/v3/constants/{consts.js → constants.js} +2 -2
- package/schematics/ng-update/v3/constants/enums.js +4 -0
- package/schematics/ng-update/v3/index.js +2 -2
- package/schematics/ng-update/v3/steps/migrate-polymorpheus.d.ts +1 -1
- package/schematics/ng-update/v3/steps/migrate-textfield-controller.d.ts +1 -1
- package/schematics/ng-update/v3/steps/miscellaneous.js +4 -0
- package/schematics/utils/add-import-to-component.d.ts +4 -0
- package/schematics/utils/add-import-to-component.js +12 -0
- package/schematics/utils/get-component-from-identifier.d.ts +2 -0
- package/schematics/utils/get-component-from-identifier.js +16 -0
- package/schematics/utils/get-named-import-references.d.ts +1 -1
- package/schematics/utils/get-named-import-references.js +2 -2
- package/schematics/utils/get-standalone-bootstrap-function.d.ts +2 -0
- package/schematics/utils/get-standalone-bootstrap-function.js +13 -0
- package/schematics/utils/push-to-array-property.d.ts +5 -0
- package/schematics/utils/push-to-array-property.js +26 -0
- package/schematics/utils/templates/get-component-templates.d.ts +1 -1
- package/schematics/utils/templates/ng-component-input-manipulations.d.ts +1 -1
- package/schematics/utils/templates/template-resource.d.ts +1 -1
- package/services/static-request.service.d.ts +3 -0
- package/tokens/index.d.ts +1 -0
- package/tokens/is-stackblitz.d.ts +2 -0
- package/utils/miscellaneous/index.d.ts +1 -0
- package/utils/miscellaneous/is-valid-url.d.ts +1 -0
- /package/schematics/ng-update/interfaces/{template-resourse.d.ts → template-resource.d.ts} +0 -0
- /package/schematics/ng-update/interfaces/{template-resourse.js → template-resource.js} +0 -0
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.addImportToComponent = void 0;
|
4
|
+
const push_to_array_property_1 = require("ng-morph/ng/helpers/push-to-array-property");
|
5
|
+
// TODO: delete after adding to ng-morph
|
6
|
+
function addImportToComponent(classDeclaration, moduleName, { unique = true } = {}) {
|
7
|
+
push_to_array_property_1.pushToArrayProperty(classDeclaration, `Component`, `imports`, moduleName, {
|
8
|
+
unique,
|
9
|
+
forceToArray: true,
|
10
|
+
});
|
11
|
+
}
|
12
|
+
exports.addImportToComponent = addImportToComponent;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.getComponentFromIdentifier = void 0;
|
4
|
+
const ng_morph_1 = require("ng-morph");
|
5
|
+
const ng_component_1 = require("./angular/ng-component");
|
6
|
+
function getComponentFromIdentifier(identifier) {
|
7
|
+
var _a;
|
8
|
+
const rootImportDeclaration = ng_morph_1.getImports(identifier.getSourceFile().getFilePath(), {
|
9
|
+
namedImports: [identifier.getText()],
|
10
|
+
})[0];
|
11
|
+
const rootComponentPath = ((_a = rootImportDeclaration.getModuleSpecifierSourceFile()) === null || _a === void 0 ? void 0 : _a.getFilePath()) || ``;
|
12
|
+
return ng_component_1.getNgComponents(rootComponentPath, {
|
13
|
+
name: identifier.getText(),
|
14
|
+
})[0];
|
15
|
+
}
|
16
|
+
exports.getComponentFromIdentifier = getComponentFromIdentifier;
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { Node } from 'ng-morph';
|
2
|
-
export declare function getNamedImportReferences(namedImport: string, moduleSpecifier?: string[] | string): Node[];
|
2
|
+
export declare function getNamedImportReferences(namedImport: string, moduleSpecifier?: string[] | string, files?: import("ng-morph").Pattern): Node[];
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getNamedImportReferences = void 0;
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
5
|
const constants_1 = require("../constants");
|
6
|
-
function getNamedImportReferences(namedImport, moduleSpecifier =
|
7
|
-
const importDeclarations = ng_morph_1.getImports(
|
6
|
+
function getNamedImportReferences(namedImport, moduleSpecifier = `**/**`, files = constants_1.ALL_TS_FILES) {
|
7
|
+
const importDeclarations = ng_morph_1.getImports(files, {
|
8
8
|
namedImports: [namedImport],
|
9
9
|
moduleSpecifier,
|
10
10
|
});
|
@@ -0,0 +1,13 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.getStandaloneBootstrapFunction = void 0;
|
4
|
+
const ng_morph_1 = require("ng-morph");
|
5
|
+
const get_named_import_references_1 = require("./get-named-import-references");
|
6
|
+
function getStandaloneBootstrapFunction(path) {
|
7
|
+
const standaloneBootstrapIdentifier = get_named_import_references_1.getNamedImportReferences(`bootstrapApplication`, `@angular/platform-browser`, path)
|
8
|
+
.map(ref => ref.getParent())
|
9
|
+
.filter(node => ng_morph_1.Node.isCallExpression(node))[0];
|
10
|
+
const standaloneBootstrapFunction = standaloneBootstrapIdentifier;
|
11
|
+
return standaloneBootstrapFunction || null;
|
12
|
+
}
|
13
|
+
exports.getStandaloneBootstrapFunction = getStandaloneBootstrapFunction;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { ObjectLiteralExpression } from 'ng-morph';
|
2
|
+
export declare function pushToObjectArrayProperty(objectExpression: ObjectLiteralExpression, propertyName: string, initializer: string, { unique, forceToArray, }?: {
|
3
|
+
unique?: boolean;
|
4
|
+
forceToArray?: boolean;
|
5
|
+
}): void;
|
@@ -0,0 +1,26 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.pushToObjectArrayProperty = void 0;
|
4
|
+
const ng_morph_1 = require("ng-morph");
|
5
|
+
function pushToObjectArrayProperty(objectExpression, propertyName, initializer, { unique = false, forceToArray = false, } = {}) {
|
6
|
+
var _a, _b;
|
7
|
+
const property = (_a = objectExpression.getProperty(propertyName)) !== null && _a !== void 0 ? _a : objectExpression.addProperty(`${propertyName}: []`);
|
8
|
+
if (!ng_morph_1.Node.isPropertyAssignment(property)) {
|
9
|
+
return;
|
10
|
+
}
|
11
|
+
if (forceToArray && !ng_morph_1.Node.isArrayLiteralExpression(property.getInitializer())) {
|
12
|
+
property.setInitializer(`[${(_b = property === null || property === void 0 ? void 0 : property.getInitializer()) === null || _b === void 0 ? void 0 : _b.getText()}]`);
|
13
|
+
}
|
14
|
+
const importsInitializer = property.getInitializer();
|
15
|
+
if (!ng_morph_1.Node.isArrayLiteralExpression(importsInitializer)) {
|
16
|
+
return;
|
17
|
+
}
|
18
|
+
if (unique &&
|
19
|
+
importsInitializer
|
20
|
+
.getElements()
|
21
|
+
.some(element => element.getText() === initializer)) {
|
22
|
+
return;
|
23
|
+
}
|
24
|
+
importsInitializer.addElement(initializer);
|
25
|
+
}
|
26
|
+
exports.pushToObjectArrayProperty = pushToObjectArrayProperty;
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { ClassDeclaration, Pattern, Query, StructureType } from 'ng-morph';
|
2
|
-
import { TemplateResource } from '../../ng-update/interfaces/template-
|
2
|
+
import { TemplateResource } from '../../ng-update/interfaces/template-resource';
|
3
3
|
export declare function getComponentTemplates(pattern: Pattern, query?: Query<Omit<StructureType<ClassDeclaration>, 'kind'>>): TemplateResource[];
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { DevkitFileSystem } from 'ng-morph/project/classes/devkit-file-system';
|
2
2
|
import { Element } from 'parse5';
|
3
|
-
import { TemplateResource } from '../../ng-update/interfaces/template-
|
3
|
+
import { TemplateResource } from '../../ng-update/interfaces/template-resource';
|
4
4
|
/**
|
5
5
|
* Replace component input property by new value
|
6
6
|
* ___
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { DevkitFileSystem } from 'ng-morph';
|
2
|
-
import { TemplateResource } from '../../ng-update/interfaces/template-
|
2
|
+
import { TemplateResource } from '../../ng-update/interfaces/template-resource';
|
3
3
|
export declare function getTemplateFromTemplateResource(templateRes: TemplateResource, fileSystem: DevkitFileSystem): string;
|
4
4
|
export declare function getPathFromTemplateResource(templateRes: TemplateResource): string;
|
5
5
|
export declare function getTemplateOffset(templateRes: TemplateResource): number;
|
@@ -1,7 +1,10 @@
|
|
1
1
|
import { Observable } from 'rxjs';
|
2
2
|
import * as i0 from "@angular/core";
|
3
3
|
export declare class TuiStaticRequestService {
|
4
|
+
private readonly win;
|
5
|
+
private readonly platformId;
|
4
6
|
private readonly cache;
|
7
|
+
constructor(win: Window, platformId: Record<string, unknown>);
|
5
8
|
request(url: string): Observable<string>;
|
6
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiStaticRequestService, never>;
|
7
10
|
static ɵprov: i0.ɵɵInjectableDeclaration<TuiStaticRequestService>;
|
package/tokens/index.d.ts
CHANGED
@@ -13,6 +13,7 @@ export * from './is-number';
|
|
13
13
|
export * from './is-object';
|
14
14
|
export * from './is-present';
|
15
15
|
export * from './is-string';
|
16
|
+
export * from './is-valid-url';
|
16
17
|
export * from './mark-control-as-touched-and-validate';
|
17
18
|
export * from './nullable-same';
|
18
19
|
export * from './object-from-entries';
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function tuiIsValidUrl(url: string): boolean;
|
File without changes
|
File without changes
|