@taiga-ui/cdk 4.7.0 → 4.8.1-canary.0ecc12f
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/classes/control.d.ts +2 -3
- package/constants/used-icons.d.ts +1 -1
- package/constants/version.d.ts +1 -1
- package/constants/version.js +1 -1
- package/directives/auto-focus/autofocus.options.d.ts +8 -9
- package/directives/auto-focus/handlers/abstract.handler.d.ts +3 -2
- package/directives/auto-focus/handlers/default.handler.d.ts +2 -1
- package/directives/auto-focus/handlers/ios.handler.d.ts +2 -10
- package/esm2022/classes/control.mjs +3 -4
- package/esm2022/constants/used-icons.mjs +4 -1
- package/esm2022/constants/version.mjs +2 -2
- package/esm2022/directives/auto-focus/autofocus.options.mjs +21 -15
- package/esm2022/directives/auto-focus/handlers/abstract.handler.mjs +5 -4
- package/esm2022/directives/auto-focus/handlers/default.handler.mjs +4 -4
- package/esm2022/directives/auto-focus/handlers/ios.handler.mjs +4 -19
- package/esm2022/directives/pan/pan.service.mjs +10 -12
- package/esm2022/directives/swipe/swipe.service.mjs +23 -25
- package/esm2022/directives/zoom/zoom.service.mjs +27 -29
- package/esm2022/tokens/window-size.mjs +23 -24
- package/esm2022/types/index.mjs +2 -1
- package/esm2022/types/loose-union.mjs +2 -0
- package/esm2022/utils/browser/is-safari.mjs +2 -1
- package/esm2022/utils/di/create-options.mjs +1 -1
- package/esm2022/utils/miscellaneous/create-token.mjs +2 -2
- package/fesm2022/taiga-ui-cdk-classes.mjs +2 -3
- package/fesm2022/taiga-ui-cdk-classes.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-constants.mjs +4 -1
- package/fesm2022/taiga-ui-cdk-constants.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-auto-focus.mjs +31 -40
- package/fesm2022/taiga-ui-cdk-directives-auto-focus.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-pan.mjs +9 -11
- package/fesm2022/taiga-ui-cdk-directives-pan.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-swipe.mjs +22 -24
- package/fesm2022/taiga-ui-cdk-directives-swipe.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-zoom.mjs +26 -28
- package/fesm2022/taiga-ui-cdk-directives-zoom.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-tokens.mjs +21 -23
- package/fesm2022/taiga-ui-cdk-tokens.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils-browser.mjs +1 -0
- package/fesm2022/taiga-ui-cdk-utils-browser.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils-di.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils-miscellaneous.mjs +1 -1
- package/fesm2022/taiga-ui-cdk-utils-miscellaneous.mjs.map +1 -1
- package/package.json +362 -362
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-update/v4/steps/constants/attrs-to-replace.js +9 -0
- package/schematics/ng-update/v4/steps/migrate-editor.d.ts +1 -1
- package/schematics/ng-update/v4/steps/migrate-editor.js +6 -5
- package/schematics/ng-update/v4/steps/update-packages.d.ts +3 -3
- package/schematics/ng-update/v4/steps/update-packages.js +3 -3
- package/tokens/window-size.d.ts +1 -2
- package/types/index.d.ts +1 -0
- package/types/loose-union.d.ts +36 -0
- package/utils/di/create-options.d.ts +2 -3
- package/utils/miscellaneous/create-token.d.ts +2 -2
@@ -29,7 +29,7 @@ function addAngularCdkDep(tree) {
|
|
29
29
|
if (!angularCore) {
|
30
30
|
return;
|
31
31
|
}
|
32
|
-
const majorVersionArr =
|
32
|
+
const majorVersionArr = /\d+/.exec(angularCore);
|
33
33
|
if (majorVersionArr) {
|
34
34
|
(0, ng_morph_1.addPackageJsonDependency)(tree, {
|
35
35
|
name: '@angular/cdk',
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/// <reference lib="es2021" />
|
2
2
|
import { type DevkitFileSystem } from 'ng-morph';
|
3
3
|
import type { TuiSchema } from '../../../ng-add/schema';
|
4
|
-
export declare const TUI_EDITOR_VERSION = "^4.
|
4
|
+
export declare const TUI_EDITOR_VERSION = "^4.10.0";
|
5
5
|
export declare function migrateEditor(fileSystem: DevkitFileSystem, options: TuiSchema): void;
|
@@ -8,7 +8,7 @@ const file_globs_1 = require("../../../constants/file-globs");
|
|
8
8
|
const colored_log_1 = require("../../../utils/colored-log");
|
9
9
|
const replace_identifier_1 = require("../../steps/replace-identifier");
|
10
10
|
const replace_package_name_1 = require("../../steps/replace-package-name");
|
11
|
-
exports.TUI_EDITOR_VERSION = '^4.
|
11
|
+
exports.TUI_EDITOR_VERSION = '^4.10.0';
|
12
12
|
function migrateEditor(fileSystem, options) {
|
13
13
|
const moduleSpecifier = ['@tinkoff/tui-editor', '@taiga-ui/addon-editor'];
|
14
14
|
const hasEditor = moduleSpecifier.every((pkg) => !(0, ng_morph_1.getPackageJsonDependency)(fileSystem.tree, pkg));
|
@@ -50,13 +50,14 @@ function migrateEditor(fileSystem, options) {
|
|
50
50
|
{
|
51
51
|
from: [
|
52
52
|
{ name: 'defaultEditorTools', moduleSpecifier },
|
53
|
-
{
|
54
|
-
name: 'TUI_EDITOR_DEFAULT_TOOLS',
|
55
|
-
moduleSpecifier: '@tinkoff/tui-editor',
|
56
|
-
},
|
53
|
+
{ name: 'TUI_EDITOR_DEFAULT_TOOLS', moduleSpecifier },
|
57
54
|
],
|
58
55
|
to: { name: 'TUI_EDITOR_DEFAULT_TOOLS', moduleSpecifier: '@taiga-ui/editor' },
|
59
56
|
},
|
57
|
+
{
|
58
|
+
from: { name: 'TUI_EDITOR_DEFAULT_EDITOR_TOOLS', moduleSpecifier },
|
59
|
+
to: { name: 'TUI_EDITOR_DEFAULT_TOOLS', moduleSpecifier: '@taiga-ui/editor' },
|
60
|
+
},
|
60
61
|
{
|
61
62
|
from: { name: 'TuiColorPickerModule', moduleSpecifier },
|
62
63
|
to: { name: 'TuiColorPickerModule', moduleSpecifier: '@taiga-ui/legacy' },
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/// <reference lib="es2021" />
|
2
2
|
import type { DevkitFileSystem } from 'ng-morph';
|
3
|
-
export declare const TUI_POLYMORPHEUS_VERSION = "^4.
|
4
|
-
export declare const TUI_DOMPURIFY_VERSION = "^4.
|
5
|
-
export declare const TUI_EVENT_PLUGINS_VERSION = "^4.
|
3
|
+
export declare const TUI_POLYMORPHEUS_VERSION = "^4.7.3";
|
4
|
+
export declare const TUI_DOMPURIFY_VERSION = "^4.7.3";
|
5
|
+
export declare const TUI_EVENT_PLUGINS_VERSION = "^4.2.3";
|
6
6
|
export declare function updatePackages({ tree }: DevkitFileSystem): void;
|
@@ -6,9 +6,9 @@ const version_1 = require("../../../../constants/version");
|
|
6
6
|
const constants_1 = require("../../../constants");
|
7
7
|
const colored_log_1 = require("../../../utils/colored-log");
|
8
8
|
const steps_1 = require("../../steps");
|
9
|
-
exports.TUI_POLYMORPHEUS_VERSION = '^4.
|
10
|
-
exports.TUI_DOMPURIFY_VERSION = '^4.
|
11
|
-
exports.TUI_EVENT_PLUGINS_VERSION = '^4.
|
9
|
+
exports.TUI_POLYMORPHEUS_VERSION = '^4.7.3';
|
10
|
+
exports.TUI_DOMPURIFY_VERSION = '^4.7.3';
|
11
|
+
exports.TUI_EVENT_PLUGINS_VERSION = '^4.2.3';
|
12
12
|
function updatePackages({ tree }) {
|
13
13
|
const packagesToRemove = ['@taiga-ui/addon-tablebars', '@taiga-ui/addon-preview'];
|
14
14
|
packagesToRemove.forEach((pkg) => {
|
package/tokens/window-size.d.ts
CHANGED
package/types/index.d.ts
CHANGED
@@ -0,0 +1,36 @@
|
|
1
|
+
/**
|
2
|
+
* @example
|
3
|
+
* type Color = 'primary' | 'secondary' | string;
|
4
|
+
*
|
5
|
+
* Your brand has some known colors, like `primary` and `secondary`.
|
6
|
+
* But you also want to make sure that users can specify any color they want.
|
7
|
+
*
|
8
|
+
* @Input() color: Color = '';
|
9
|
+
*
|
10
|
+
* <my-icon color="red" />
|
11
|
+
*
|
12
|
+
* But there's an issue. We aren't getting `color`
|
13
|
+
* suggestions when we use the `MyIcon` component.
|
14
|
+
* If we try to autocomplete the `color` prop, we get no suggestions.
|
15
|
+
* Ideally, we want `primary` and `secondary` to be part of that list.
|
16
|
+
* How do we manage that?
|
17
|
+
*
|
18
|
+
* This works because of a quirk of the TypeScript compiler.
|
19
|
+
* When you create a union between a string literal type and `string`,
|
20
|
+
* TypeScript will eagerly widen the type to `string`.
|
21
|
+
*
|
22
|
+
* But if we change type to
|
23
|
+
* type Color = 'primary' | 'secondary' | (string & {});
|
24
|
+
*
|
25
|
+
* TypeScript has already forgotten that `"primary"` and `"secondary"`
|
26
|
+
* were ever part of the type. But by intersecting `string` with
|
27
|
+
* an empty object, we trick TypeScript into retaining the string
|
28
|
+
* literal types for a bit longer.
|
29
|
+
*
|
30
|
+
* This might feel pretty fragile to you. This doesn't seem like
|
31
|
+
* intended behavior from TypeScript. Well, the team actually
|
32
|
+
* know about this trick. They test against it. And someday, they may make
|
33
|
+
* it so that a plain `string` type will just work.
|
34
|
+
* But until then, keep this in mind.
|
35
|
+
*/
|
36
|
+
export type TuiLooseUnion<U> = U | (U extends string ? Record<never, never> & string : U extends number ? Record<never, never> & number : U extends symbol ? Record<never, never> & symbol : U extends bigint ? Record<never, never> & bigint : never);
|
@@ -1,3 +1,2 @@
|
|
1
|
-
import type {
|
2
|
-
|
3
|
-
export declare function tuiCreateOptions<T>(defaults: T): [token: InjectionToken<T>, provider: TuiHandler<Partial<T>, Provider>];
|
1
|
+
import type { FactoryProvider, InjectionToken } from '@angular/core';
|
2
|
+
export declare function tuiCreateOptions<T>(defaults: T): [token: InjectionToken<T>, provider: (item: Partial<T>) => FactoryProvider];
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { InjectionToken } from '@angular/core';
|
2
|
-
export declare function tuiCreateToken<T>(defaults
|
3
|
-
export declare function tuiCreateTokenFromFactory<T>(factory
|
2
|
+
export declare function tuiCreateToken<T>(defaults?: T): InjectionToken<T>;
|
3
|
+
export declare function tuiCreateTokenFromFactory<T>(factory?: () => T): InjectionToken<T>;
|