@taiga-ui/cdk 3.11.0 → 3.12.1
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/abstract/dialog.service.d.ts +1 -1
- package/bundles/taiga-ui-cdk-abstract.umd.js +1 -1
- package/bundles/taiga-ui-cdk-abstract.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-coercion.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-components-alert-host.umd.js +1 -1
- package/bundles/taiga-ui-cdk-components-alert-host.umd.js.map +1 -1
- 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-date-time.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-checked.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-droppable.umd.js +3 -1
- package/bundles/taiga-ui-cdk-directives-droppable.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-element.umd.js +18 -332
- package/bundles/taiga-ui-cdk-directives-element.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-for-async.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-overscroll.umd.js +3 -1
- package/bundles/taiga-ui-cdk-directives-overscroll.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-prevent-default.umd.js +3 -1
- package/bundles/taiga-ui-cdk-directives-prevent-default.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-observables.umd.js +16 -16
- package/bundles/taiga-ui-cdk-observables.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-services.umd.js +9 -3
- package/bundles/taiga-ui-cdk-services.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-dom.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-focus.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-math.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-svg.umd.js +5 -2
- package/bundles/taiga-ui-cdk-utils-svg.umd.js.map +1 -1
- package/coercion/coerce-boolean-property.d.ts +1 -1
- package/constants/version.d.ts +1 -1
- package/constants/version.js +1 -1
- package/date-time/time.d.ts +1 -1
- package/date-time/year.d.ts +1 -1
- package/directives/auto-focus/autofocus.directive.d.ts +1 -1
- package/directives/checked/checked.directive.d.ts +1 -1
- package/directives/droppable/droppable.directive.d.ts +1 -1
- package/directives/element/element.directive.d.ts +2 -1
- package/directives/for-async/for-async.directive.d.ts +1 -1
- package/directives/overscroll/overscroll.directive.d.ts +1 -1
- package/directives/prevent-default/prevent-default.directive.d.ts +1 -1
- package/esm2015/abstract/dialog.directive.js +3 -3
- package/esm2015/abstract/dialog.service.js +1 -1
- package/esm2015/coercion/coerce-boolean-property.js +1 -1
- package/esm2015/components/alert-host/alert-host.component.js +2 -2
- package/esm2015/constants/version.js +2 -2
- package/esm2015/date-time/time.js +1 -1
- package/esm2015/date-time/year.js +1 -1
- package/esm2015/directives/auto-focus/autofocus.directive.js +1 -1
- package/esm2015/directives/checked/checked.directive.js +1 -1
- package/esm2015/directives/droppable/droppable.directive.js +5 -3
- package/esm2015/directives/element/element.directive.js +18 -4
- package/esm2015/directives/for-async/for-async.directive.js +1 -1
- package/esm2015/directives/overscroll/overscroll.directive.js +5 -3
- package/esm2015/directives/prevent-default/prevent-default.directive.js +5 -3
- package/esm2015/interfaces/alert-context.js +1 -1
- package/esm2015/interfaces/swipe.js +1 -1
- package/esm2015/interfaces/zoom.js +1 -1
- package/esm2015/observables/control-value.js +15 -0
- package/esm2015/observables/index.js +2 -2
- package/esm2015/observables/must-be-present.js +1 -1
- package/esm2015/services/focus-visible.service.js +5 -3
- package/esm2015/services/obscured.service.js +4 -2
- package/esm2015/services/resize.service.js +5 -3
- package/esm2015/types/autocomplete.js +1 -1
- package/esm2015/types/dialog.js +1 -1
- package/esm2015/types/event-with.js +1 -1
- package/esm2015/types/input-mode.js +1 -1
- package/esm2015/types/input-type.js +1 -1
- package/esm2015/types/overscroll-mode.js +1 -1
- package/esm2015/types/time-mode.js +1 -1
- package/esm2015/utils/dom/element-checks.js +1 -1
- package/esm2015/utils/focus/set-native-mouse-focused.js +1 -1
- package/esm2015/utils/math/to-int.js +1 -1
- package/esm2015/utils/svg/svg-linear-gradient-processor.js +6 -3
- package/fesm2015/taiga-ui-cdk-abstract.js +2 -2
- package/fesm2015/taiga-ui-cdk-abstract.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-coercion.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-components-alert-host.js +1 -1
- package/fesm2015/taiga-ui-cdk-components-alert-host.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-constants.js +1 -1
- package/fesm2015/taiga-ui-cdk-constants.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-date-time.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-directives-auto-focus.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-directives-checked.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-directives-droppable.js +4 -2
- package/fesm2015/taiga-ui-cdk-directives-droppable.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-directives-element.js +17 -3
- package/fesm2015/taiga-ui-cdk-directives-element.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-directives-for-async.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-directives-overscroll.js +4 -2
- package/fesm2015/taiga-ui-cdk-directives-overscroll.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-directives-prevent-default.js +4 -2
- package/fesm2015/taiga-ui-cdk-directives-prevent-default.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-observables.js +15 -15
- package/fesm2015/taiga-ui-cdk-observables.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-services.js +10 -4
- package/fesm2015/taiga-ui-cdk-services.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-dom.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-focus.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-math.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-svg.js +5 -2
- package/fesm2015/taiga-ui-cdk-utils-svg.js.map +1 -1
- package/interfaces/alert-context.d.ts +1 -1
- package/interfaces/swipe.d.ts +1 -1
- package/interfaces/zoom.d.ts +1 -1
- package/observables/{replay-control-value-changes.d.ts → control-value.d.ts} +0 -0
- package/observables/index.d.ts +1 -1
- package/observables/must-be-present.d.ts +1 -1
- package/package.json +5 -5
- package/schematics/constants/file-globs.js +2 -2
- package/schematics/constants/taiga-styles.js +4 -4
- package/schematics/ng-add/constants/modules.d.ts +4 -4
- package/schematics/ng-add/constants/modules.js +12 -12
- package/schematics/ng-add/constants/packages.js +1 -1
- package/schematics/ng-add/constants/versions.js +3 -3
- package/schematics/ng-add/index.d.ts +2 -2
- package/schematics/ng-add/index.js +11 -12
- package/schematics/ng-add/schema.d.ts +9 -2
- package/schematics/ng-add/schema.json +1 -1
- package/schematics/ng-add/setup-project.d.ts +2 -2
- package/schematics/ng-add/steps/add-taiga-icons.d.ts +3 -3
- package/schematics/ng-add/steps/add-taiga-icons.js +8 -9
- package/schematics/ng-add/steps/add-taiga-modules.d.ts +2 -2
- package/schematics/ng-add/steps/add-taiga-modules.js +7 -7
- package/schematics/ng-add/steps/add-taiga-styles.d.ts +2 -2
- package/schematics/ng-add/steps/add-taiga-styles.js +3 -4
- package/schematics/ng-add/steps/wrap-with-tui-root.d.ts +2 -2
- package/schematics/ng-add/steps/wrap-with-tui-root.js +14 -14
- package/schematics/ng-update/constants/consts.d.ts +1 -1
- package/schematics/ng-update/constants/consts.js +177 -177
- package/schematics/ng-update/constants/deprecated-functions.js +410 -405
- package/schematics/ng-update/constants/enums.js +123 -123
- package/schematics/ng-update/constants/modules.js +4 -4
- package/schematics/ng-update/constants/services.d.ts +2 -2
- package/schematics/ng-update/constants/services.js +16 -16
- package/schematics/ng-update/constants/templates.d.ts +1 -1
- package/schematics/ng-update/constants/templates.js +276 -276
- package/schematics/ng-update/constants/tui-interactive-selectors.js +50 -50
- package/schematics/ng-update/constants/types.d.ts +1 -1
- package/schematics/ng-update/constants/types.js +87 -87
- package/schematics/ng-update/constants/warnings.js +62 -62
- package/schematics/ng-update/index.d.ts +3 -3
- package/schematics/ng-update/index.js +44 -40
- package/schematics/ng-update/interfaces/asset.d.ts +6 -0
- package/schematics/ng-update/interfaces/asset.js +2 -0
- package/schematics/ng-update/steps/migrate-date-time.d.ts +2 -1
- package/schematics/ng-update/steps/migrate-date-time.js +55 -49
- package/schematics/ng-update/steps/migrate-polymorpheus.d.ts +1 -1
- package/schematics/ng-update/steps/migrate-polymorpheus.js +14 -14
- package/schematics/ng-update/steps/migrate-progress.d.ts +2 -1
- package/schematics/ng-update/steps/migrate-progress.js +16 -12
- package/schematics/ng-update/steps/migrate-sliders/index.d.ts +2 -1
- package/schematics/ng-update/steps/migrate-sliders/index.js +13 -9
- package/schematics/ng-update/steps/migrate-sliders/migrate-input-range.d.ts +2 -1
- package/schematics/ng-update/steps/migrate-sliders/migrate-input-range.js +35 -33
- package/schematics/ng-update/steps/migrate-sliders/migrate-input-slider.d.ts +2 -1
- package/schematics/ng-update/steps/migrate-sliders/migrate-input-slider.js +34 -33
- package/schematics/ng-update/steps/migrate-taiga-proprietary-icons.d.ts +2 -2
- package/schematics/ng-update/steps/migrate-taiga-proprietary-icons.js +29 -27
- package/schematics/ng-update/steps/migrate-templates.d.ts +2 -1
- package/schematics/ng-update/steps/migrate-templates.js +36 -32
- package/schematics/ng-update/steps/migrate-textfield-controller.d.ts +1 -1
- package/schematics/ng-update/steps/migrate-textfield-controller.js +34 -34
- package/schematics/ng-update/steps/miscellaneous.d.ts +2 -1
- package/schematics/ng-update/steps/miscellaneous.js +21 -19
- package/schematics/ng-update/steps/remove-module.d.ts +2 -1
- package/schematics/ng-update/steps/remove-module.js +6 -4
- package/schematics/ng-update/steps/rename-types.d.ts +2 -1
- package/schematics/ng-update/steps/rename-types.js +10 -8
- package/schematics/ng-update/steps/replace-const.d.ts +2 -1
- package/schematics/ng-update/steps/replace-const.js +8 -6
- package/schematics/ng-update/steps/replace-deep-import.d.ts +2 -1
- package/schematics/ng-update/steps/replace-deep-import.js +10 -5
- package/schematics/ng-update/steps/replace-enums.d.ts +2 -1
- package/schematics/ng-update/steps/replace-enums.js +8 -6
- package/schematics/ng-update/steps/replace-functions.d.ts +2 -1
- package/schematics/ng-update/steps/replace-functions.js +17 -15
- package/schematics/ng-update/steps/replace-services.d.ts +2 -1
- package/schematics/ng-update/steps/replace-services.js +13 -11
- package/schematics/ng-update/steps/replace-styles.js +7 -5
- package/schematics/ng-update/steps/show-warnings.js +2 -2
- package/schematics/ng-update/v3-5/steps/migrate-expand-templates.d.ts +2 -1
- package/schematics/ng-update/v3-5/steps/migrate-expand-templates.js +12 -10
- package/schematics/utils/add-import-to-closest-module.js +2 -2
- package/schematics/utils/add-unique-import.js +1 -1
- package/schematics/utils/angular/ng-component.js +1 -1
- package/schematics/utils/angular/ng-module.js +1 -1
- package/schematics/utils/angular-json-manipulations.d.ts +3 -3
- package/schematics/utils/angular-json-manipulations.js +52 -37
- package/schematics/utils/colored-log.js +5 -5
- package/schematics/utils/create-angular-json.d.ts +1 -0
- package/schematics/utils/create-angular-json.js +28 -2
- 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-project-target-options.d.ts +1 -1
- package/schematics/utils/get-project-target-options.js +1 -1
- package/schematics/utils/get-projects.d.ts +3 -0
- package/schematics/utils/get-projects.js +15 -0
- package/schematics/utils/progress.js +2 -2
- package/schematics/utils/replace-tag.d.ts +1 -1
- package/schematics/utils/replace-tag.js +4 -4
- package/schematics/utils/templates/elements.js +4 -4
- package/schematics/utils/templates/get-component-templates.js +6 -6
- package/schematics/utils/templates/ng-component-input-manipulations.d.ts +4 -4
- package/schematics/utils/templates/ng-component-input-manipulations.js +7 -7
- package/schematics/utils/templates/template-resource.d.ts +1 -1
- package/schematics/utils/templates/template-resource.js +3 -3
- package/services/focus-visible.service.d.ts +1 -1
- package/services/obscured.service.d.ts +2 -2
- package/services/resize.service.d.ts +1 -1
- package/types/autocomplete.d.ts +1 -1
- package/types/dialog.d.ts +2 -2
- package/types/event-with.d.ts +2 -2
- package/types/input-mode.d.ts +1 -1
- package/types/input-type.d.ts +1 -1
- package/types/overscroll-mode.d.ts +1 -1
- package/types/time-mode.d.ts +1 -1
- package/utils/dom/element-checks.d.ts +1 -1
- package/utils/focus/set-native-mouse-focused.d.ts +1 -1
- package/utils/math/to-int.d.ts +1 -1
- package/utils/svg/svg-linear-gradient-processor.d.ts +2 -1
- package/esm2015/observables/replay-control-value-changes.js +0 -15
- package/schematics/ng-update/constants/functions.d.ts +0 -0
- package/schematics/ng-update/constants/functions.js +0 -1
- package/schematics/utils/get-project.d.ts +0 -3
- package/schematics/utils/get-project.js +0 -13
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ngAdd = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const tasks_1 = require("@angular-devkit/schematics/tasks");
|
|
6
5
|
const ng_morph_1 = require("ng-morph");
|
|
7
6
|
const packages_1 = require("./constants/packages");
|
|
8
7
|
const versions_1 = require("./constants/versions");
|
|
9
8
|
function ngAdd(options) {
|
|
10
|
-
return (tree, context) =>
|
|
9
|
+
return (tree, context) => {
|
|
11
10
|
context.logger.info(`The main packages will be installed - ${packages_1.MAIN_PACKAGES}`);
|
|
12
11
|
addDependencies(tree, options);
|
|
13
12
|
context.addTask(new tasks_1.NodePackageInstallTask(), [
|
|
14
|
-
context.addTask(new tasks_1.RunSchematicTask(
|
|
13
|
+
context.addTask(new tasks_1.RunSchematicTask(`ng-add-setup-project`, options)),
|
|
15
14
|
]);
|
|
16
|
-
}
|
|
15
|
+
};
|
|
17
16
|
}
|
|
18
17
|
exports.ngAdd = ngAdd;
|
|
19
18
|
function addDependencies(tree, options) {
|
|
@@ -33,33 +32,33 @@ function addDependencies(tree, options) {
|
|
|
33
32
|
}
|
|
34
33
|
if (options.addSanitizer) {
|
|
35
34
|
ng_morph_1.addPackageJsonDependency(tree, {
|
|
36
|
-
name:
|
|
35
|
+
name: `@tinkoff/ng-dompurify`,
|
|
37
36
|
version: versions_1.NG_DOMPURIFY_VERSION,
|
|
38
37
|
});
|
|
39
38
|
ng_morph_1.addPackageJsonDependency(tree, {
|
|
40
|
-
name:
|
|
39
|
+
name: `dompurify`,
|
|
41
40
|
version: versions_1.DOMPURIFY_VERSION,
|
|
42
41
|
});
|
|
43
42
|
ng_morph_1.addPackageJsonDependency(tree, {
|
|
44
|
-
name:
|
|
43
|
+
name: `@types/dompurify`,
|
|
45
44
|
version: versions_1.DOMPURIFY_TYPES_VERSION,
|
|
46
45
|
type: ng_morph_1.NodeDependencyType.Dev,
|
|
47
46
|
});
|
|
48
47
|
}
|
|
49
|
-
if (packages.includes(
|
|
48
|
+
if (packages.includes(`addon-table`) || packages.includes(`addon-mobile`)) {
|
|
50
49
|
addAngularCdkDep(tree);
|
|
51
50
|
}
|
|
52
51
|
}
|
|
53
52
|
function addAngularCdkDep(tree) {
|
|
54
53
|
var _a;
|
|
55
|
-
const angularCore = (_a = ng_morph_1.getPackageJsonDependency(tree,
|
|
54
|
+
const angularCore = (_a = ng_morph_1.getPackageJsonDependency(tree, `@angular/core`)) === null || _a === void 0 ? void 0 : _a.version;
|
|
56
55
|
if (!angularCore) {
|
|
57
56
|
return;
|
|
58
57
|
}
|
|
59
58
|
const majorVersionArr = angularCore.match(/[0-9]+/);
|
|
60
59
|
if (majorVersionArr) {
|
|
61
60
|
ng_morph_1.addPackageJsonDependency(tree, {
|
|
62
|
-
name:
|
|
61
|
+
name: `@angular/cdk`,
|
|
63
62
|
version: `^${majorVersionArr[0]}.0.0`,
|
|
64
63
|
});
|
|
65
64
|
}
|
|
@@ -67,8 +66,8 @@ function addAngularCdkDep(tree) {
|
|
|
67
66
|
function removeTaigaSchematicsPackage(tree) {
|
|
68
67
|
var _a;
|
|
69
68
|
try {
|
|
70
|
-
if (
|
|
71
|
-
ng_morph_1.removePackageJsonDependency(tree,
|
|
69
|
+
if ((_a = ng_morph_1.getPackageJsonDependency(tree, `taiga-ui`)) === null || _a === void 0 ? void 0 : _a.version) {
|
|
70
|
+
ng_morph_1.removePackageJsonDependency(tree, `taiga-ui`);
|
|
72
71
|
}
|
|
73
72
|
}
|
|
74
73
|
catch (_b) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface TuiSchema {
|
|
2
2
|
readonly project: string;
|
|
3
|
-
readonly addons:
|
|
3
|
+
readonly addons: readonly string[];
|
|
4
4
|
readonly addGlobalStyles: boolean;
|
|
5
5
|
readonly addAlertModule: boolean;
|
|
6
6
|
readonly addDialogsModule: boolean;
|
|
@@ -12,4 +12,11 @@ export interface Schema {
|
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
14
|
'skip-deep-imports'?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* @example
|
|
17
|
+
* ```console
|
|
18
|
+
* schematics ./dist/cdk:updateToV3 --skip-logs
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
'skip-logs'?: boolean;
|
|
15
22
|
}
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
"value": "addon-preview",
|
|
88
|
-
"label": "addon
|
|
88
|
+
"label": "addon-preview Custom fullscreen dialog to preview various content such as documents, images etc."
|
|
89
89
|
}
|
|
90
90
|
]
|
|
91
91
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
-
import {
|
|
3
|
-
export default function ngAddSetupProject(options:
|
|
2
|
+
import { TuiSchema } from './schema';
|
|
3
|
+
export default function ngAddSetupProject(options: TuiSchema): Rule;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
-
import {
|
|
3
|
-
export declare function addTaigaIcons(options:
|
|
4
|
-
export declare function addTaigaAssetsToAngularJson(options:
|
|
2
|
+
import { TuiSchema } from '../schema';
|
|
3
|
+
export declare function addTaigaIcons(options: TuiSchema): Rule;
|
|
4
|
+
export declare function addTaigaAssetsToAngularJson(options: TuiSchema): Rule;
|
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addTaigaAssetsToAngularJson = exports.addTaigaIcons = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const workspace_1 = require("@schematics/angular/utility/workspace");
|
|
6
|
-
const get_project_1 = require("../../utils/get-project");
|
|
7
5
|
const get_project_target_options_1 = require("../../utils/get-project-target-options");
|
|
6
|
+
const get_projects_1 = require("../../utils/get-projects");
|
|
8
7
|
const ICON_ASSETS = {
|
|
9
|
-
glob:
|
|
10
|
-
input:
|
|
11
|
-
output:
|
|
8
|
+
glob: `**/*`,
|
|
9
|
+
input: `node_modules/@taiga-ui/icons/src`,
|
|
10
|
+
output: `assets/taiga-ui/icons`,
|
|
12
11
|
};
|
|
13
12
|
function addTaigaIcons(options) {
|
|
14
|
-
return (_) =>
|
|
13
|
+
return (_) => {
|
|
15
14
|
return addTaigaAssetsToAngularJson(options);
|
|
16
|
-
}
|
|
15
|
+
};
|
|
17
16
|
}
|
|
18
17
|
exports.addTaigaIcons = addTaigaIcons;
|
|
19
18
|
function addTaigaAssetsToAngularJson(options) {
|
|
20
19
|
return workspace_1.updateWorkspace(workspace => {
|
|
21
|
-
const project =
|
|
20
|
+
const project = get_projects_1.getProjects(options, workspace)[0];
|
|
22
21
|
if (project) {
|
|
23
|
-
const targetOptions = get_project_target_options_1.getProjectTargetOptions(project,
|
|
22
|
+
const targetOptions = get_project_target_options_1.getProjectTargetOptions(project, `build`);
|
|
24
23
|
const assets = targetOptions.assets;
|
|
25
24
|
targetOptions.assets = assets ? [...assets, ICON_ASSETS] : [ICON_ASSETS];
|
|
26
25
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
-
import {
|
|
3
|
-
export declare function addTaigaModules(options:
|
|
2
|
+
import { TuiSchema } from '../schema';
|
|
3
|
+
export declare function addTaigaModules(options: TuiSchema): Rule;
|
|
@@ -4,20 +4,20 @@ exports.addTaigaModules = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const workspace_1 = require("@schematics/angular/utility/workspace");
|
|
6
6
|
const ng_morph_1 = require("ng-morph");
|
|
7
|
-
const
|
|
7
|
+
const add_unique_import_1 = require("../../utils/add-unique-import");
|
|
8
8
|
const get_project_target_options_1 = require("../../utils/get-project-target-options");
|
|
9
|
+
const get_projects_1 = require("../../utils/get-projects");
|
|
9
10
|
const modules_1 = require("../constants/modules");
|
|
10
|
-
const add_unique_import_1 = require("../../utils/add-unique-import");
|
|
11
11
|
function addTaigaModules(options) {
|
|
12
12
|
return (tree, context) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
13
13
|
const workspace = yield workspace_1.getWorkspace(tree);
|
|
14
|
-
const project =
|
|
14
|
+
const project = get_projects_1.getProjects(options, workspace)[0];
|
|
15
15
|
if (!project) {
|
|
16
|
-
context.logger.warn(
|
|
16
|
+
context.logger.warn(`[WARNING]: Target project not found in current workspace`);
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
-
const buildOptions = get_project_target_options_1.getProjectTargetOptions(project,
|
|
20
|
-
ng_morph_1.setActiveProject(ng_morph_1.createProject(tree,
|
|
19
|
+
const buildOptions = get_project_target_options_1.getProjectTargetOptions(project, `build`);
|
|
20
|
+
ng_morph_1.setActiveProject(ng_morph_1.createProject(tree, `/`, [`**/*.ts`, `**/*.json`]));
|
|
21
21
|
const mainModule = ng_morph_1.getMainModule(buildOptions.main);
|
|
22
22
|
addTuiModules(mainModule, options, context);
|
|
23
23
|
addTuiProviders(mainModule, options);
|
|
@@ -42,7 +42,7 @@ function addTuiProviders(mainModule, options) {
|
|
|
42
42
|
if (!options.addSanitizer) {
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
|
-
ng_morph_1.addProviderToNgModule(mainModule,
|
|
45
|
+
ng_morph_1.addProviderToNgModule(mainModule, `{provide: TUI_SANITIZER, useClass: NgDompurifySanitizer}`, { unique: true });
|
|
46
46
|
modules_1.SANITIZER_MODULES.forEach(module => {
|
|
47
47
|
add_unique_import_1.addUniqueImport(mainModule.getSourceFile().getFilePath(), module.name, module.packageName);
|
|
48
48
|
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
-
import {
|
|
3
|
-
export declare function addTaigaStyles(options:
|
|
2
|
+
import { TuiSchema } from '../schema';
|
|
3
|
+
export declare function addTaigaStyles(options: TuiSchema): Rule;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addTaigaStyles = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const angular_json_manipulations_1 = require("../../utils/angular-json-manipulations");
|
|
6
4
|
const taiga_styles_1 = require("../../constants/taiga-styles");
|
|
5
|
+
const angular_json_manipulations_1 = require("../../utils/angular-json-manipulations");
|
|
7
6
|
function addTaigaStyles(options) {
|
|
8
|
-
return (_, context) =>
|
|
7
|
+
return (_, context) => {
|
|
9
8
|
const taigaLocalStyles = [taiga_styles_1.TAIGA_THEME_STYLE, taiga_styles_1.TAIGA_THEME_FONTS];
|
|
10
9
|
const taigaStyles = options.addGlobalStyles
|
|
11
10
|
? [...taigaLocalStyles, taiga_styles_1.TAIGA_GLOBAL_NEW_STYLE]
|
|
12
11
|
: taigaLocalStyles;
|
|
13
12
|
return angular_json_manipulations_1.addStylesToAngularJson(options, context, taigaStyles);
|
|
14
|
-
}
|
|
13
|
+
};
|
|
15
14
|
}
|
|
16
15
|
exports.addTaigaStyles = addTaigaStyles;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
-
import {
|
|
3
|
-
export declare function wrapWithTuiRootComponent(options:
|
|
2
|
+
import { TuiSchema } from '../schema';
|
|
3
|
+
export declare function wrapWithTuiRootComponent(options: TuiSchema): Rule;
|
|
@@ -4,21 +4,21 @@ exports.wrapWithTuiRootComponent = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const workspace_1 = require("@schematics/angular/utility/workspace");
|
|
6
6
|
const ng_morph_1 = require("ng-morph");
|
|
7
|
-
const get_project_1 = require("../../utils/get-project");
|
|
8
7
|
const get_project_target_options_1 = require("../../utils/get-project-target-options");
|
|
8
|
+
const get_projects_1 = require("../../utils/get-projects");
|
|
9
9
|
function wrapWithTuiRootComponent(options) {
|
|
10
10
|
return (tree, context) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
11
11
|
const workspace = yield workspace_1.getWorkspace(tree);
|
|
12
|
-
const project =
|
|
12
|
+
const project = get_projects_1.getProjects(options, workspace)[0];
|
|
13
13
|
if (!project) {
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
|
-
const buildOptions = get_project_target_options_1.getProjectTargetOptions(project,
|
|
16
|
+
const buildOptions = get_project_target_options_1.getProjectTargetOptions(project, `build`);
|
|
17
17
|
const appTemplatePath = getAppTemplatePath(tree, buildOptions.main);
|
|
18
18
|
if (!appTemplatePath) {
|
|
19
|
-
context.logger.error(
|
|
20
|
-
context.logger.info(
|
|
21
|
-
context.logger.info(
|
|
19
|
+
context.logger.error(`Could not find the default main template file for this project.`);
|
|
20
|
+
context.logger.info(`Consider manually wrapping content of your app with tui-root`);
|
|
21
|
+
context.logger.info(`More information at https://taiga-ui.dev/getting-started`);
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
24
|
addTuiRootComponent(appTemplatePath, context, tree);
|
|
@@ -29,12 +29,12 @@ function addTuiRootComponent(filePath, context, tree) {
|
|
|
29
29
|
const buffer = tree.read(filePath);
|
|
30
30
|
if (!buffer) {
|
|
31
31
|
context.logger.error(`Could not read the default template file within the project ${filePath}`);
|
|
32
|
-
context.logger.info(
|
|
32
|
+
context.logger.info(`Consider manually wrapping content of your app with tui-root`);
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
35
|
const htmlContent = buffer.toString();
|
|
36
|
-
const openTag =
|
|
37
|
-
const closeTag =
|
|
36
|
+
const openTag = `<tui-root>\n`;
|
|
37
|
+
const closeTag = `\n</tui-root>`;
|
|
38
38
|
if (htmlContent.includes(openTag)) {
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
@@ -45,19 +45,19 @@ function addTuiRootComponent(filePath, context, tree) {
|
|
|
45
45
|
context.logger.info(`Content of the app was wrapped with tui-root component in ${filePath}`);
|
|
46
46
|
}
|
|
47
47
|
function getAppTemplatePath(tree, mainPath) {
|
|
48
|
-
ng_morph_1.setActiveProject(ng_morph_1.createProject(tree,
|
|
48
|
+
ng_morph_1.setActiveProject(ng_morph_1.createProject(tree, `/`, [`**/*.ts`, `**/*.json`]));
|
|
49
49
|
const mainModule = ng_morph_1.getMainModule(mainPath);
|
|
50
|
-
const mainInitializer = getInitializer(mainModule,
|
|
50
|
+
const mainInitializer = getInitializer(mainModule, `NgModule`, `declarations`);
|
|
51
51
|
if (!ng_morph_1.Node.isArrayLiteralExpression(mainInitializer)) {
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
54
|
const appIdentifier = mainInitializer.getElements()[0];
|
|
55
55
|
const appComponent = appIdentifier.getDefinitionNodes()[0];
|
|
56
|
-
const templateInitializer = getInitializer(appComponent,
|
|
57
|
-
const appComponentPath = appComponent.getSourceFile().getFilePath().split(
|
|
56
|
+
const templateInitializer = getInitializer(appComponent, `Component`, `templateUrl`);
|
|
57
|
+
const appComponentPath = appComponent.getSourceFile().getFilePath().split(`/`);
|
|
58
58
|
const templateUrlPath = `${appComponentPath
|
|
59
59
|
.splice(0, appComponentPath.length - 1)
|
|
60
|
-
.join(
|
|
60
|
+
.join(`/`)}/${templateInitializer === null || templateInitializer === void 0 ? void 0 : templateInitializer.getText().replace(/['"]/g, ``)}`;
|
|
61
61
|
ng_morph_1.saveActiveProject();
|
|
62
62
|
return templateUrlPath;
|
|
63
63
|
}
|