Skip to content

Commit

Permalink
4.x (#6186)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirpotekhin authored Dec 13, 2023
1 parent 205be6a commit 203f21d
Show file tree
Hide file tree
Showing 263 changed files with 25,330 additions and 25,664 deletions.
49,258 changes: 24,406 additions & 24,852 deletions package-lock.json

Large diffs are not rendered by default.

44 changes: 24 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,30 +99,33 @@
]
},
"dependencies": {
"@angular/animations": "12.2.17",
"@angular/cdk": "12.2.13",
"@angular/common": "12.2.17",
"@angular/compiler": "12.2.17",
"@angular/core": "12.2.17",
"@angular/forms": "12.2.17",
"@angular/localize": "12.2.17",
"@angular/platform-browser": "12.2.17",
"@angular/platform-browser-dynamic": "12.2.17",
"@angular/platform-server": "12.2.17",
"@angular/router": "12.2.17",
"@angular/animations": "15.2.10",
"@angular/cdk": "15.2.9",
"@angular/common": "15.2.10",
"@angular/compiler": "15.2.10",
"@angular/core": "15.2.10",
"@angular/forms": "15.2.10",
"@angular/localize": "15.2.10",
"@angular/platform-browser": "15.2.10",
"@angular/platform-browser-dynamic": "15.2.10",
"@angular/platform-server": "15.2.10",
"@angular/router": "15.2.10",
"core-js": "2.6.12",
"parse5": "6.0.1",
"rxjs": "6.6.7",
"zone.js": "0.11.8"
"zone.js": "0.12.0"
},
"devDependencies": {
"@angular-builders/custom-webpack": "12.1.3",
"@angular-devkit/build-angular": "12.2.18",
"@angular-devkit/core": "12.2.18",
"@angular/cli": "12.2.18",
"@angular/compiler-cli": "12.2.17",
"@angular/language-service": "12.2.17",
"@angular-builders/custom-webpack": "15.0.0",
"@angular-devkit/build-angular": "15.2.10",
"@angular-devkit/core": "15.2.10",
"@angular/cli": "15.2.10",
"@angular/compiler-cli": "15.2.10",
"@angular/language-service": "15.2.10",
"@commitlint/cli": "18.4.3",
"@cypress/webpack-batteries-included-preprocessor": "^3.0.2",
"@cypress/webpack-preprocessor": "^6.0.0",
"@nx/angular": "17.2.3",
"@nx/jest": "17.2.3",
"@nx/node": "17.2.3",
"@nx/workspace": "17.2.3",
Expand Down Expand Up @@ -153,7 +156,7 @@
"husky": "8.0.3",
"kill-port": "2.0.1",
"lint-staged": "15.2.0",
"ng-packagr": "12.2.7",
"ng-packagr": "15.2.2",
"nx": "17.2.3",
"prettier": "3.1.1",
"rollup": "4.8.0",
Expand All @@ -162,7 +165,7 @@
"ts-loader": "9.5.1",
"ts-mockito": "2.6.1",
"ts-node": "10.9.2",
"typescript": "4.3.5",
"typescript": "4.9.5",
"wait-on": "7.2.0",
"webpack": "5.89.0"
},
Expand All @@ -176,6 +179,7 @@
"Roman Sedov <[email protected]>"
],
"overrides": {
"highlight.js": "11.5.1",
"webpack": "$webpack",
"babel-loader": "$babel-loader"
},
Expand Down
6 changes: 3 additions & 3 deletions projects/addon-doc/components/demo/demo.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
TemplateRef,
ViewChild,
} from '@angular/core';
import {AbstractControl, FormGroup} from '@angular/forms';
import {AbstractControl, UntypedFormGroup} from '@angular/forms';
import {Params, UrlSerializer, UrlTree} from '@angular/router';
import {TuiDemoParams} from '@taiga-ui/addon-doc/interfaces';
import {TUI_DOC_DEMO_TEXTS, TUI_DOC_URL_STATE_HANDLER} from '@taiga-ui/addon-doc/tokens';
Expand Down Expand Up @@ -68,7 +68,7 @@ export class TuiDocDemoComponent implements OnInit {
@ContentChild(TemplateRef)
readonly template: TemplateRef<Record<string, unknown>> | null = null;

testForm?: FormGroup;
testForm?: UntypedFormGroup;

readonly updateOnVariants = ['change', 'blur', 'submit'] as const;

Expand Down Expand Up @@ -174,7 +174,7 @@ export class TuiDocDemoComponent implements OnInit {
const {control, updateOn} = this;

if (control) {
this.testForm = new FormGroup({testValue: control}, {updateOn});
this.testForm = new UntypedFormGroup({testValue: control}, {updateOn});
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {ChangeDetectionStrategy, Component, Inject} from '@angular/core';
import {FormControl} from '@angular/forms';
import {UntypedFormControl} from '@angular/forms';
import {tuiCapitalizeFirstLetter, TuiFlagPipe} from '@taiga-ui/core';
import {TuiCountryIsoCode, TuiLanguageName, TuiLanguageSwitcher} from '@taiga-ui/i18n';

Expand All @@ -14,7 +14,9 @@ import {TuiCountryIsoCode, TuiLanguageName, TuiLanguageSwitcher} from '@taiga-ui
],
})
export class TuiLanguageSwitcherComponent {
readonly language = new FormControl(tuiCapitalizeFirstLetter(this.switcher.language));
readonly language = new UntypedFormControl(
tuiCapitalizeFirstLetter(this.switcher.language),
);

readonly flags = new Map<TuiLanguageName, TuiCountryIsoCode>([
['chinese', TuiCountryIsoCode.CN],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
Optional,
Self,
} from '@angular/core';
import {FormControl} from '@angular/forms';
import {UntypedFormControl} from '@angular/forms';
import {Title} from '@angular/platform-browser';
import {ActivatedRoute, Router, Scroll} from '@angular/router';
import {TuiDocPage} from '@taiga-ui/addon-doc/interfaces';
Expand Down Expand Up @@ -54,7 +54,7 @@ export class TuiDocNavigationComponent {
openPagesGroupsArr: boolean[] = [];
active = '';

readonly search = new FormControl('');
readonly search = new UntypedFormControl('');

readonly filtered$ = tuiControlValue<string>(this.search).pipe(
filter(search => search.trim().length > 2),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,21 +149,22 @@ describe(`ng-add [Standalone]`, () => {
"defaultProject": "demo",
"projects": {
"demo": {
"root": "",
"architect": {
"build": {
"options": {
"main": "test/main.ts",
"styles": [
"node_modules/@taiga-ui/core/styles/taiga-ui-theme.less",
"node_modules/@taiga-ui/core/styles/taiga-ui-fonts.less"
],
"assets": [
{
"glob": "**/*",
"input": "node_modules/@taiga-ui/icons/src",
"output": "assets/taiga-ui/icons"
}
]
"styles": [
"node_modules/@taiga-ui/core/styles/taiga-ui-theme.less",
"node_modules/@taiga-ui/core/styles/taiga-ui-fonts.less"
],
"assets": [
{
"glob": "**/*",
"input": "node_modules/@taiga-ui/icons/src",
"output": "assets/taiga-ui/icons"
}
],
}
}
}
Expand All @@ -190,6 +191,7 @@ describe(`ng-add [Standalone]`, () => {
"defaultProject": "demo",
"projects": {
"demo": {
"root": "",
"architect": {
"build": {
"options": {
Expand Down Expand Up @@ -232,6 +234,7 @@ describe(`ng-add [Standalone]`, () => {
"defaultProject": "demo",
"projects": {
"demo": {
"root": "",
"architect": {
"build": {
"options": {
Expand Down
25 changes: 14 additions & 11 deletions projects/cdk/schematics/ng-add/tests/schematic-ng-add.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,21 +149,22 @@ describe(`ng-add`, () => {
"defaultProject": "demo",
"projects": {
"demo": {
"root": "",
"architect": {
"build": {
"options": {
"main": "test/main.ts",
"styles": [
"node_modules/@taiga-ui/core/styles/taiga-ui-theme.less",
"node_modules/@taiga-ui/core/styles/taiga-ui-fonts.less"
],
"assets": [
{
"glob": "**/*",
"input": "node_modules/@taiga-ui/icons/src",
"output": "assets/taiga-ui/icons"
}
]
"styles": [
"node_modules/@taiga-ui/core/styles/taiga-ui-theme.less",
"node_modules/@taiga-ui/core/styles/taiga-ui-fonts.less"
],
"assets": [
{
"glob": "**/*",
"input": "node_modules/@taiga-ui/icons/src",
"output": "assets/taiga-ui/icons"
}
],
}
}
}
Expand All @@ -190,6 +191,7 @@ describe(`ng-add`, () => {
"defaultProject": "demo",
"projects": {
"demo": {
"root": "",
"architect": {
"build": {
"options": {
Expand Down Expand Up @@ -232,6 +234,7 @@ describe(`ng-add`, () => {
"defaultProject": "demo",
"projects": {
"demo": {
"root": "",
"architect": {
"build": {
"options": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ describe(`ng-update angular.json`, () => {

expect(tree.readContent(`angular.json`)).toEqual(
makeAngularJsonWithAssets(`
{
"glob": "**/*",
"input": "node_modules/@taiga-ui/proprietary-icons/src",
"output": "assets/taiga-ui/icons"
},
{
"glob": "**/*",
"input": "node_modules/@taiga-ui/proprietary-tds-icons/src",
"output": "assets/taiga-ui/icons"
}`),
{
"glob": "**/*",
"input": "node_modules/@taiga-ui/proprietary-icons/src",
"output": "assets/taiga-ui/icons"
},
{
"glob": "**/*",
"input": "node_modules/@taiga-ui/proprietary-tds-icons/src",
"output": "assets/taiga-ui/icons"
}`),
);
});

Expand Down Expand Up @@ -163,6 +163,7 @@ function makeAngularJsonWithAssets(assets: string): string {
"defaultProject": "demo",
"projects": {
"demo": {
"root": "",
"architect": {
"build": {
"options": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,7 @@ describe(`ng-update`, () => {
"defaultProject": "demo",
"projects": {
"demo": {
"root": "",
"architect": {
"build": {
"options": {
Expand Down
2 changes: 2 additions & 0 deletions projects/cdk/schematics/utils/create-angular-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export function createAngularJson(
"defaultProject": "demo",
"projects": {
"demo": {
"root": "",
"architect": {
"build": {
"options": {
Expand Down Expand Up @@ -42,6 +43,7 @@ export function createAngularJsonWithAssets(): void {
"defaultProject": "demo",
"projects": {
"demo": {
"root": "",
"architect": {
"build": {
"options": {
Expand Down
12 changes: 9 additions & 3 deletions projects/cdk/tokens/window-size.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {tuiTypedFromEvent} from '@taiga-ui/cdk/observables';
import {Observable} from 'rxjs';
import {map, shareReplay, startWith} from 'rxjs/operators';

export const TUI_WINDOW_SIZE = new InjectionToken<Observable<ClientRect>>(
export const TUI_WINDOW_SIZE = new InjectionToken<Observable<DOMRect>>(
`[TUI_WINDOW_SIZE]`,
{
factory: () => {
Expand All @@ -15,14 +15,20 @@ export const TUI_WINDOW_SIZE = new InjectionToken<Observable<ClientRect>>(
map(() => {
const width = Math.max(w.innerWidth, w.visualViewport?.width || 0);
const height = Math.max(w.innerHeight, w.visualViewport?.height || 0);

return {
const rect = {
width,
height,
top: 0,
left: 0,
right: width,
bottom: height,
x: 0,
y: 0,
};

return {
...rect,
toJSON: () => JSON.stringify(rect),
};
}),
shareReplay({bufferSize: 1, refCount: true}),
Expand Down
2 changes: 1 addition & 1 deletion projects/core/abstract/rect-accessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {ExistingProvider, FactoryProvider, SkipSelf, Type} from '@angular/core';
// eslint-disable-next-line @typescript-eslint/naming-convention
export abstract class TuiRectAccessor {
abstract readonly type: string;
abstract getClientRect(): ClientRect;
abstract getClientRect(): DOMRect;
}

export function tuiRectAccessorFor(
Expand Down
9 changes: 8 additions & 1 deletion projects/core/tokens/viewport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,20 @@ export const TUI_VIEWPORT = tuiCreateTokenFromFactory<TuiRectAccessor>(() => {
return {
type: `viewport`,
getClientRect() {
return {
const rect = {
top: 0,
left: 0,
right: win.innerWidth,
bottom: win.innerHeight,
width: win.innerWidth,
height: win.innerHeight,
x: 0,
y: 0,
};

return {
...rect,
toJSON: () => JSON.stringify(rect),
};
},
};
Expand Down
28 changes: 28 additions & 0 deletions projects/demo-cypress/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,34 @@ export const TUI_CYPRESS_CONFIG: Cypress.ConfigOptions = {
newSnapshotMarkEnabled: config.baseUrl === `http://localhost:3333/`,
});

const webpackPreprocessor = require(
`@cypress/webpack-batteries-included-preprocessor`,
);
const webpackOptions = webpackPreprocessor.defaultOptions.webpackOptions;

webpackOptions.module.rules.unshift({
test: /[/\\]@angular[/\\].+\.m?js$/,
resolve: {
fullySpecified: false,
},
use: {
loader: `babel-loader`,
options: {
plugins: [`@angular/compiler-cli/linker/babel`],
compact: false,
cacheDirectory: true,
},
},
});

on(
`file:preprocessor`,
webpackPreprocessor({
webpackOptions,
typescript: require.resolve(`typescript`),
}),
);

on(`before:browser:launch`, (browser, launchOptions) => {
if (browser.name === `chrome`) {
launchOptions.args.push(
Expand Down
Loading

0 comments on commit 203f21d

Please sign in to comment.