@taiga-ui/cdk 4.0.0-rc.3 → 4.0.0-rc.5
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/constants/version.d.ts +1 -1
- package/constants/version.js +1 -1
- package/esm2022/constants/version.mjs +2 -2
- package/esm2022/utils/focus/focused-in.mjs +7 -0
- package/esm2022/utils/focus/index.mjs +2 -1
- package/fesm2022/taiga-ui-cdk-constants.mjs +1 -1
- package/fesm2022/taiga-ui-cdk-constants.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils-focus.mjs +8 -2
- package/fesm2022/taiga-ui-cdk-utils-focus.mjs.map +1 -1
- package/package.json +357 -67
- package/schematics/ng-update/interfaces/replacement-identifier.d.ts +2 -1
- package/schematics/ng-update/steps/replace-identifier.js +12 -2
- package/schematics/ng-update/v4/index.js +5 -1
- package/schematics/ng-update/v4/migrate-icons/rename-icons.js +8 -0
- package/schematics/ng-update/v4/steps/constants/identifiers-to-replace.js +81 -28
- package/schematics/ng-update/v4/steps/constants/index.d.ts +1 -0
- package/schematics/ng-update/v4/steps/constants/index.js +1 -0
- package/schematics/ng-update/v4/steps/constants/modules-to-replace.d.ts +7 -6
- package/schematics/ng-update/v4/steps/constants/modules-to-replace.js +1 -0
- package/schematics/ng-update/v4/steps/constants/services.d.ts +2 -0
- package/schematics/ng-update/v4/steps/constants/services.js +15 -0
- package/schematics/ng-update/v4/steps/migrate-root.d.ts +3 -0
- package/schematics/ng-update/v4/steps/migrate-root.js +56 -0
- package/schematics/ng-update/v4/steps/templates/migrate-labeled.js +4 -4
- package/schematics/ng-update/v4/steps/update-packages.js +8 -4
- package/schematics/ng-update/v4/steps/utils/replace-modules-with-providers.d.ts +1 -11
- package/schematics/ng-update/v4/steps/utils/replace-modules-with-providers.js +8 -4
- package/utils/focus/focused-in.d.ts +2 -0
- package/utils/focus/index.d.ts +1 -0
package/constants/version.d.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export declare const TUI_VERSION = "4.0.0-rc.
|
1
|
+
export declare const TUI_VERSION = "4.0.0-rc.5";
|
package/constants/version.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export const TUI_VERSION = '4.0.0-rc.
|
2
|
-
//# sourceMappingURL=data:application/json;base64,
|
1
|
+
export const TUI_VERSION = '4.0.0-rc.5';
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL2Nkay9jb25zdGFudHMvdmVyc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLENBQUMsTUFBTSxXQUFXLEdBQUcsWUFBWSxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGNvbnN0IFRVSV9WRVJTSU9OID0gJzQuMC4wLXJjLjUnO1xuIl19
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { toSignal } from '@angular/core/rxjs-interop';
|
2
|
+
import { TUI_FALSE_HANDLER, TUI_TRUE_HANDLER } from '@taiga-ui/cdk/constants';
|
3
|
+
import { fromEvent, map, merge } from 'rxjs';
|
4
|
+
export function tuiFocusedIn(node) {
|
5
|
+
return toSignal(merge(fromEvent(node, 'focusin').pipe(map(TUI_TRUE_HANDLER)), fromEvent(node, 'focusout').pipe(map(TUI_FALSE_HANDLER))), { initialValue: false });
|
6
|
+
}
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9jdXNlZC1pbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2Nkay91dGlscy9mb2N1cy9mb2N1c2VkLWluLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBQyxRQU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4nKS5waXBlKG1hcChUVUlfVFJVRV9IQU5ETEVSKSksXG4gICAgICAgICAgICBmcm9tRXZlbnQobm9kZSwgJ2ZvY3Vzb3V0JykucGlwZShtYXAoVFVJX0ZBTFNFX0hBTkRMRVIpKSxcbiAgICAgICAgKSxcbiAgICAgICAge2luaXRpYWxWYWx1ZTogZmFsc2V9LFxuICAgICk7XG59XG4iXX0=
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export * from './blur-native-focused';
|
2
|
+
export * from './focused-in';
|
2
3
|
export * from './get-closest-focusable';
|
3
4
|
export * from './get-native-focused';
|
4
5
|
export * from './is-native-focused';
|
@@ -6,4 +7,4 @@ export * from './is-native-focused-in';
|
|
6
7
|
export * from './is-native-keyboard-focusable';
|
7
8
|
export * from './is-native-mouse-focusable';
|
8
9
|
export * from './move-focus';
|
9
|
-
//# sourceMappingURL=data:application/json;base64,
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jZGsvdXRpbHMvZm9jdXMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyx1QkFBdUIsQ0FBQztBQUN0QyxjQUFjLGNBQWMsQ0FBQztBQUM3QixjQUFjLHlCQUF5QixDQUFDO0FBQ3hDLGNBQWMsc0JBQXNCLENBQUM7QUFDckMsY0FBYyxxQkFBcUIsQ0FBQztBQUNwQyxjQUFjLHdCQUF3QixDQUFDO0FBQ3ZDLGNBQWMsZ0NBQWdDLENBQUM7QUFDL0MsY0FBYyw2QkFBNkIsQ0FBQztBQUM1QyxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vYmx1ci1uYXRpdmUtZm9jdXNlZCc7XG5leHBvcnQgKiBmcm9tICcuL2ZvY3VzZWQtaW4nO1xuZXhwb3J0ICogZnJvbSAnLi9nZXQtY2xvc2VzdC1mb2N1c2FibGUnO1xuZXhwb3J0ICogZnJvbSAnLi9nZXQtbmF0aXZlLWZvY3VzZWQnO1xuZXhwb3J0ICogZnJvbSAnLi9pcy1uYXRpdmUtZm9jdXNlZCc7XG5leHBvcnQgKiBmcm9tICcuL2lzLW5hdGl2ZS1mb2N1c2VkLWluJztcbmV4cG9ydCAqIGZyb20gJy4vaXMtbmF0aXZlLWtleWJvYXJkLWZvY3VzYWJsZSc7XG5leHBvcnQgKiBmcm9tICcuL2lzLW5hdGl2ZS1tb3VzZS1mb2N1c2FibGUnO1xuZXhwb3J0ICogZnJvbSAnLi9tb3ZlLWZvY3VzJztcbiJdfQ==
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"taiga-ui-cdk-constants.mjs","sources":["../../../projects/cdk/constants/empty.ts","../../../projects/cdk/constants/handlers.ts","../../../projects/cdk/constants/matchers.ts","../../../projects/cdk/constants/regexp.ts","../../../projects/cdk/constants/svg-node-filter.ts","../../../projects/cdk/constants/unicode-chars.ts","../../../projects/cdk/constants/used-icons.ts","../../../projects/cdk/constants/version.ts","../../../projects/cdk/constants/taiga-ui-cdk-constants.ts"],"sourcesContent":["import {QueryList} from '@angular/core';\n\nconst rect = {\n bottom: 0,\n height: 0,\n left: 0,\n right: 0,\n top: 0,\n width: 0,\n x: 0,\n y: 0,\n} as const;\n\n/**\n * For type safety when using @ContentChildren and @ViewChildren\n *\n * NOTE: Be careful subscribing to 'changes'\n */\nexport const EMPTY_QUERY = new QueryList<any>();\nexport const EMPTY_ARRAY: [] = [];\nexport const EMPTY_FUNCTION: (...args: any[]) => void = () => {};\nexport const EMPTY_CLIENT_RECT: DOMRect = {\n ...rect,\n toJSON: () => rect,\n};\n","/**\n * Handler that always returns `false`.\n */\n// eslint-disable-next-line no-restricted-syntax\nexport const TUI_FALSE_HANDLER = (): false => false;\n\n/**\n * Handler that always returns `true`.\n */\n// eslint-disable-next-line no-restricted-syntax\nexport const TUI_TRUE_HANDLER = (): true => true;\n","import type {TuiHandler, TuiIdentityMatcher} from '@taiga-ui/cdk/types';\n\nfunction bothEmpty(item1: unknown, item2: unknown): boolean {\n return Array.isArray(item1) && Array.isArray(item2) && !item1.length && !item2.length;\n}\n\n/**\n * Default handler for matching stringified version of an item and a search query\n * @param item arbitrary element to match with a string\n * @param search search query\n * @param stringify handler to turn item into a string\n */\nexport const TUI_DEFAULT_MATCHER = <T>(\n item: T,\n search: string,\n stringify: TuiHandler<T, string> = String,\n): boolean => stringify(item).toLowerCase().includes(search.toLowerCase());\n\n/**\n * Default handler for strict matching stringified version of an item and a search query\n * @param item arbitrary element to match with a string\n * @param search search query\n * @param stringify handler to turn item into a string\n */\nexport const TUI_STRICT_MATCHER = <T>(\n item: T,\n search: string,\n stringify: TuiHandler<T, string> = String,\n): boolean => stringify(item).toLowerCase() === search.toLowerCase();\n\n/**\n * Default handler to match equality of two elements\n * ATTENTION: considers two empty arrays equal\n *\n * @param item1 first element\n * @param item2 second element\n */\nexport const TUI_DEFAULT_IDENTITY_MATCHER: TuiIdentityMatcher<unknown> = (item1, item2) =>\n item1 === item2 || bothEmpty(item1, item2);\n","export const TUI_DIGIT_REGEXP = /\\d/;\nexport const TUI_NON_DIGIT_REGEXP = /\\D/;\nexport const TUI_NON_DIGITS_REGEXP = /\\D+/g;\n","export const svgNodeFilter: Exclude<NodeFilter, (node: Node) => number> = {\n acceptNode(node: Node): number {\n return 'ownerSVGElement' in node\n ? NodeFilter.FILTER_REJECT\n : NodeFilter.FILTER_ACCEPT;\n },\n};\n","/**\n * {@link https://unicode-table.com/en/00A0/ Non-breaking space}.\n */\nexport const CHAR_NO_BREAK_SPACE = '\\u00A0';\n\n/**\n * {@link https://unicode-table.com/en/2013/ EN dash}\n * is used to indicate a range of numbers or a span of time.\n * @example 2006–2022\n * ___\n * Don't confuse with {@link CHAR_EM_DASH} or {@link CHAR_HYPHEN}!\n */\nexport const CHAR_EN_DASH = '\\u2013';\n\n/**\n * {@link https://unicode-table.com/en/2014/ EM dash}\n * is used to mark a break in a sentence.\n * @example Taiga UI — powerful set of open source components for Angular\n * ___\n * Don't confuse with {@link CHAR_EN_DASH} or {@link CHAR_HYPHEN}!\n */\nexport const CHAR_EM_DASH = '\\u2014';\n\n/**\n * {@link https://unicode-table.com/en/00AB/ Left-Pointing Double Angle Quotation Mark}\n */\nexport const CHAR_LAQUO = '\\u00AB';\n\n/**\n * {@link https://unicode-table.com/en/00BB/ Right-Pointing Double Angle Quotation Mark}\n */\nexport const CHAR_RAQUO = '\\u00BB';\n\n/**\n * {@link https://unicode-table.com/en/002D/ Hyphen (minus sign)}\n * is used to combine words.\n * @example well-behaved\n * ___\n * Don't confuse with {@link CHAR_EN_DASH} or {@link CHAR_EM_DASH}!\n */\nexport const CHAR_HYPHEN = '\\u002D';\n\n/**\n * {@link https://unicode-table.com/en/2212/ Minus}\n * is used as math operator symbol or before negative digits.\n * ---\n * Can be used as `−`. Don't confuse with {@link CHAR_HYPHEN}\n */\nexport const CHAR_MINUS = '\\u2212';\n\n/**\n * {@link https://unicode-table.com/en/002B/ Plus}\n */\nexport const CHAR_PLUS = '\\u002B';\n\n/**\n * {@link https://unicode-table.com/en/2022/ Bullet}.\n */\nexport const CHAR_BULLET = '\\u2022';\n\n/**\n * {@link https://unicode-table.com/en/2026/ Suspension points}.\n */\nexport const CHAR_ELLIPSIS = '\\u2026';\n\n/**\n * {@link https://unicode-table.com/en/00A4/ Suspension points}.\n */\nexport const CHAR_CURRENCY_SIGN = '\\u00A4';\n\n/**\n * {@link https://unicode-table.com/en/200b/ Suspension points}.\n */\nexport const CHAR_ZERO_WIDTH_SPACE = '\\u200B';\n","/**\n * @description:\n * AUTOGENERATED\n *\n * Array of icons used in taiga-ui components\n */\nexport const TUI_USED_ICONS = [\n '@tui.mir',\n '@tui.visa',\n '@tui.electron',\n '@tui.mastercard',\n '@tui.maestro',\n '@tui.amex',\n '@tui.diners-club',\n '@tui.discover',\n '@tui.humo',\n '@tui.jcb',\n '@tui.ru-pay',\n '@tui.union-pay',\n '@tui.uzcard',\n '@tui.verve',\n '@tui.search',\n '@tui.sun',\n '@tui.moon',\n '@tui.code',\n '@tui.menu',\n '@tui.copy',\n '@tui.check',\n '@tui.link',\n '@tui.eye-off',\n '@tui.eye',\n '@tui.grip-vertical',\n '@tui.chevron-up',\n '@tui.chevron-down',\n '@tui.chevrons-up-down',\n '@tui.info',\n '@tui.circle-check',\n '@tui.circle-x',\n '@tui.circle-alert',\n '@tui.circle-help',\n '@tui.x',\n '@tui.chevron-right',\n '@tui.chevron-left',\n '@tui.calendar',\n '@tui.minus',\n '@tui.file',\n '@tui.trash',\n '@tui.star',\n '@tui.rotate-ccw-square',\n '@tui.arrow-left',\n '@tui.arrow-right',\n '@tui.plus',\n '@tui.minimize',\n '@tui.clock',\n] as const;\n","export const TUI_VERSION = '4.0.0-rc.
|
1
|
+
{"version":3,"file":"taiga-ui-cdk-constants.mjs","sources":["../../../projects/cdk/constants/empty.ts","../../../projects/cdk/constants/handlers.ts","../../../projects/cdk/constants/matchers.ts","../../../projects/cdk/constants/regexp.ts","../../../projects/cdk/constants/svg-node-filter.ts","../../../projects/cdk/constants/unicode-chars.ts","../../../projects/cdk/constants/used-icons.ts","../../../projects/cdk/constants/version.ts","../../../projects/cdk/constants/taiga-ui-cdk-constants.ts"],"sourcesContent":["import {QueryList} from '@angular/core';\n\nconst rect = {\n bottom: 0,\n height: 0,\n left: 0,\n right: 0,\n top: 0,\n width: 0,\n x: 0,\n y: 0,\n} as const;\n\n/**\n * For type safety when using @ContentChildren and @ViewChildren\n *\n * NOTE: Be careful subscribing to 'changes'\n */\nexport const EMPTY_QUERY = new QueryList<any>();\nexport const EMPTY_ARRAY: [] = [];\nexport const EMPTY_FUNCTION: (...args: any[]) => void = () => {};\nexport const EMPTY_CLIENT_RECT: DOMRect = {\n ...rect,\n toJSON: () => rect,\n};\n","/**\n * Handler that always returns `false`.\n */\n// eslint-disable-next-line no-restricted-syntax\nexport const TUI_FALSE_HANDLER = (): false => false;\n\n/**\n * Handler that always returns `true`.\n */\n// eslint-disable-next-line no-restricted-syntax\nexport const TUI_TRUE_HANDLER = (): true => true;\n","import type {TuiHandler, TuiIdentityMatcher} from '@taiga-ui/cdk/types';\n\nfunction bothEmpty(item1: unknown, item2: unknown): boolean {\n return Array.isArray(item1) && Array.isArray(item2) && !item1.length && !item2.length;\n}\n\n/**\n * Default handler for matching stringified version of an item and a search query\n * @param item arbitrary element to match with a string\n * @param search search query\n * @param stringify handler to turn item into a string\n */\nexport const TUI_DEFAULT_MATCHER = <T>(\n item: T,\n search: string,\n stringify: TuiHandler<T, string> = String,\n): boolean => stringify(item).toLowerCase().includes(search.toLowerCase());\n\n/**\n * Default handler for strict matching stringified version of an item and a search query\n * @param item arbitrary element to match with a string\n * @param search search query\n * @param stringify handler to turn item into a string\n */\nexport const TUI_STRICT_MATCHER = <T>(\n item: T,\n search: string,\n stringify: TuiHandler<T, string> = String,\n): boolean => stringify(item).toLowerCase() === search.toLowerCase();\n\n/**\n * Default handler to match equality of two elements\n * ATTENTION: considers two empty arrays equal\n *\n * @param item1 first element\n * @param item2 second element\n */\nexport const TUI_DEFAULT_IDENTITY_MATCHER: TuiIdentityMatcher<unknown> = (item1, item2) =>\n item1 === item2 || bothEmpty(item1, item2);\n","export const TUI_DIGIT_REGEXP = /\\d/;\nexport const TUI_NON_DIGIT_REGEXP = /\\D/;\nexport const TUI_NON_DIGITS_REGEXP = /\\D+/g;\n","export const svgNodeFilter: Exclude<NodeFilter, (node: Node) => number> = {\n acceptNode(node: Node): number {\n return 'ownerSVGElement' in node\n ? NodeFilter.FILTER_REJECT\n : NodeFilter.FILTER_ACCEPT;\n },\n};\n","/**\n * {@link https://unicode-table.com/en/00A0/ Non-breaking space}.\n */\nexport const CHAR_NO_BREAK_SPACE = '\\u00A0';\n\n/**\n * {@link https://unicode-table.com/en/2013/ EN dash}\n * is used to indicate a range of numbers or a span of time.\n * @example 2006–2022\n * ___\n * Don't confuse with {@link CHAR_EM_DASH} or {@link CHAR_HYPHEN}!\n */\nexport const CHAR_EN_DASH = '\\u2013';\n\n/**\n * {@link https://unicode-table.com/en/2014/ EM dash}\n * is used to mark a break in a sentence.\n * @example Taiga UI — powerful set of open source components for Angular\n * ___\n * Don't confuse with {@link CHAR_EN_DASH} or {@link CHAR_HYPHEN}!\n */\nexport const CHAR_EM_DASH = '\\u2014';\n\n/**\n * {@link https://unicode-table.com/en/00AB/ Left-Pointing Double Angle Quotation Mark}\n */\nexport const CHAR_LAQUO = '\\u00AB';\n\n/**\n * {@link https://unicode-table.com/en/00BB/ Right-Pointing Double Angle Quotation Mark}\n */\nexport const CHAR_RAQUO = '\\u00BB';\n\n/**\n * {@link https://unicode-table.com/en/002D/ Hyphen (minus sign)}\n * is used to combine words.\n * @example well-behaved\n * ___\n * Don't confuse with {@link CHAR_EN_DASH} or {@link CHAR_EM_DASH}!\n */\nexport const CHAR_HYPHEN = '\\u002D';\n\n/**\n * {@link https://unicode-table.com/en/2212/ Minus}\n * is used as math operator symbol or before negative digits.\n * ---\n * Can be used as `−`. Don't confuse with {@link CHAR_HYPHEN}\n */\nexport const CHAR_MINUS = '\\u2212';\n\n/**\n * {@link https://unicode-table.com/en/002B/ Plus}\n */\nexport const CHAR_PLUS = '\\u002B';\n\n/**\n * {@link https://unicode-table.com/en/2022/ Bullet}.\n */\nexport const CHAR_BULLET = '\\u2022';\n\n/**\n * {@link https://unicode-table.com/en/2026/ Suspension points}.\n */\nexport const CHAR_ELLIPSIS = '\\u2026';\n\n/**\n * {@link https://unicode-table.com/en/00A4/ Suspension points}.\n */\nexport const CHAR_CURRENCY_SIGN = '\\u00A4';\n\n/**\n * {@link https://unicode-table.com/en/200b/ Suspension points}.\n */\nexport const CHAR_ZERO_WIDTH_SPACE = '\\u200B';\n","/**\n * @description:\n * AUTOGENERATED\n *\n * Array of icons used in taiga-ui components\n */\nexport const TUI_USED_ICONS = [\n '@tui.mir',\n '@tui.visa',\n '@tui.electron',\n '@tui.mastercard',\n '@tui.maestro',\n '@tui.amex',\n '@tui.diners-club',\n '@tui.discover',\n '@tui.humo',\n '@tui.jcb',\n '@tui.ru-pay',\n '@tui.union-pay',\n '@tui.uzcard',\n '@tui.verve',\n '@tui.search',\n '@tui.sun',\n '@tui.moon',\n '@tui.code',\n '@tui.menu',\n '@tui.copy',\n '@tui.check',\n '@tui.link',\n '@tui.eye-off',\n '@tui.eye',\n '@tui.grip-vertical',\n '@tui.chevron-up',\n '@tui.chevron-down',\n '@tui.chevrons-up-down',\n '@tui.info',\n '@tui.circle-check',\n '@tui.circle-x',\n '@tui.circle-alert',\n '@tui.circle-help',\n '@tui.x',\n '@tui.chevron-right',\n '@tui.chevron-left',\n '@tui.calendar',\n '@tui.minus',\n '@tui.file',\n '@tui.trash',\n '@tui.star',\n '@tui.rotate-ccw-square',\n '@tui.arrow-left',\n '@tui.arrow-right',\n '@tui.plus',\n '@tui.minimize',\n '@tui.clock',\n] as const;\n","export const TUI_VERSION = '4.0.0-rc.5';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAEA,MAAM,IAAI,GAAG;AACT,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,IAAI,EAAE,CAAC;AACP,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,GAAG,EAAE,CAAC;AACN,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,CAAC,EAAE,CAAC;AACJ,IAAA,CAAC,EAAE,CAAC;CACE,CAAC;AAEX;;;;AAIG;AACU,MAAA,WAAW,GAAG,IAAI,SAAS,GAAQ;AACzC,MAAM,WAAW,GAAO,GAAG;MACrB,cAAc,GAA6B,MAAK,IAAI;AACpD,MAAA,iBAAiB,GAAY;AACtC,IAAA,GAAG,IAAI;AACP,IAAA,MAAM,EAAE,MAAM,IAAI;;;ACvBtB;;AAEG;AACH;MACa,iBAAiB,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AM,UAAU,GAAG,SAAS;AAEnC;;;;;;AAMG;AACI,MAAM,WAAW,GAAG,SAAS;AAEpC;;;;;AAKG;AACI,MAAM,UAAU,GAAG,SAAS;AAEnC;;AAEG;AACI,MAAM,SAAS,GAAG,SAAS;AAElC;;AAEG;AACI,MAAM,WAAW,GAAG,SAAS;AAEpC;;AAEG;AACI,MAAM,aAAa,GAAG,SAAS;AAEtC;;AAEG;AACI,MAAM,kBAAkB,GAAG,SAAS;AAE3C;;AAEG;AACI,MAAM,qBAAqB,GAAG;;ACzErC;;;;;AAKG;AACU,MAAA,cAAc,GAAG;IAC1B,UAAU;IACV,WAAW;IACX,eAAe;IACf,iBAAiB;IACjB,cAAc;IACd,WAAW;IACX,kBAAkB;IAClB,eAAe;IACf,WAAW;IACX,UAAU;IACV,aAAa;IACb,gBAAgB;IAChB,aAAa;IACb,YAAY;IACZ,aAAa;IACb,UAAU;IACV,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,YAAY;IACZ,WAAW;IACX,cAAc;IACd,UAAU;IACV,oBAAoB;IACpB,iBAAiB;IACjB,mBAAmB;IACnB,uBAAuB;IACvB,WAAW;IACX,mBAAmB;IACnB,eAAe;IACf,mBAAmB;IACnB,kBAAkB;IAClB,QAAQ;IACR,oBAAoB;IACpB,mBAAmB;IACnB,eAAe;IACf,YAAY;IACZ,WAAW;IACX,YAAY;IACZ,WAAW;IACX,wBAAwB;IACxB,iBAAiB;IACjB,kBAAkB;IAClB,WAAW;IACX,eAAe;IACf,YAAY;;;ACrDT,MAAM,WAAW,GAAG;;ACA3B;;AAEG;;;;"}
|
@@ -1,5 +1,7 @@
|
|
1
1
|
import { tuiIsHTMLElement } from '@taiga-ui/cdk/utils/dom';
|
2
|
-
import {
|
2
|
+
import { toSignal } from '@angular/core/rxjs-interop';
|
3
|
+
import { TUI_TRUE_HANDLER, TUI_FALSE_HANDLER, svgNodeFilter } from '@taiga-ui/cdk/constants';
|
4
|
+
import { merge, fromEvent, map } from 'rxjs';
|
3
5
|
|
4
6
|
/**
|
5
7
|
* Returns current active element, including shadow dom
|
@@ -27,6 +29,10 @@ function tuiBlurNativeFocused(doc) {
|
|
27
29
|
}
|
28
30
|
}
|
29
31
|
|
32
|
+
function tuiFocusedIn(node) {
|
33
|
+
return toSignal(merge(fromEvent(node, 'focusin').pipe(map(TUI_TRUE_HANDLER)), fromEvent(node, 'focusout').pipe(map(TUI_FALSE_HANDLER))), { initialValue: false });
|
34
|
+
}
|
35
|
+
|
30
36
|
/**
|
31
37
|
* Checks for signs that element can be focused with keyboard. tabIndex above 0 is ignored to
|
32
38
|
* only target natural focus order. Not checking the possibility of an element to
|
@@ -134,5 +140,5 @@ function tuiMoveFocus(currentIndex, elements, step) {
|
|
134
140
|
* Generated bundle index. Do not edit.
|
135
141
|
*/
|
136
142
|
|
137
|
-
export { tuiBlurNativeFocused, tuiGetClosestFocusable, tuiGetNativeFocused, tuiIsNativeFocused, tuiIsNativeFocusedIn, tuiIsNativeKeyboardFocusable, tuiIsNativeMouseFocusable, tuiMoveFocus };
|
143
|
+
export { tuiBlurNativeFocused, tuiFocusedIn, tuiGetClosestFocusable, tuiGetNativeFocused, tuiIsNativeFocused, tuiIsNativeFocusedIn, tuiIsNativeKeyboardFocusable, tuiIsNativeMouseFocusable, tuiMoveFocus };
|
138
144
|
//# sourceMappingURL=taiga-ui-cdk-utils-focus.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"taiga-ui-cdk-utils-focus.mjs","sources":["../../../projects/cdk/utils/focus/get-native-focused.ts","../../../projects/cdk/utils/focus/blur-native-focused.ts","../../../projects/cdk/utils/focus/is-native-keyboard-focusable.ts","../../../projects/cdk/utils/focus/is-native-mouse-focusable.ts","../../../projects/cdk/utils/focus/get-closest-focusable.ts","../../../projects/cdk/utils/focus/is-native-focused.ts","../../../projects/cdk/utils/focus/is-native-focused-in.ts","../../../projects/cdk/utils/focus/move-focus.ts","../../../projects/cdk/utils/focus/taiga-ui-cdk-utils-focus.ts"],"sourcesContent":["/**\n * Returns current active element, including shadow dom\n *\n * @return element or null\n */\nexport function tuiGetNativeFocused({activeElement}: Document): Element | null {\n if (!activeElement?.shadowRoot) {\n return activeElement;\n }\n\n let element = activeElement.shadowRoot.activeElement;\n\n while (element?.shadowRoot) {\n element = element.shadowRoot.activeElement;\n }\n\n return element;\n}\n","import {tuiIsHTMLElement} from '@taiga-ui/cdk/utils/dom';\n\nimport {tuiGetNativeFocused} from './get-native-focused';\n\n/**\n * Finds and blurs current active element, including shadow DOM\n */\nexport function tuiBlurNativeFocused(doc: Document): void {\n const activeElement = tuiGetNativeFocused(doc);\n\n if (tuiIsHTMLElement(activeElement)) {\n activeElement.blur();\n }\n}\n","import {tuiIsHTMLElement} from '@taiga-ui/cdk/utils/dom';\n\n/**\n * Checks for signs that element can be focused with keyboard. tabIndex above 0 is ignored to\n * only target natural focus order. Not checking the possibility of an element to\n * be focused, for example element can have display: none applied to it or any other\n * circumstances could prevent actual focus.\n */\nexport function tuiIsNativeKeyboardFocusable(element: Element): boolean {\n if (element.hasAttribute('disabled') || element.getAttribute('tabIndex') === '-1') {\n return false;\n }\n\n if (\n (tuiIsHTMLElement(element) && element.isContentEditable) ||\n element.getAttribute('tabIndex') === '0'\n ) {\n return true;\n }\n\n switch (element.tagName) {\n case 'BUTTON':\n case 'SELECT':\n case 'TEXTAREA':\n return true;\n case 'VIDEO':\n case 'AUDIO':\n return element.hasAttribute('controls');\n case 'INPUT':\n return element.getAttribute('type') !== 'hidden';\n case 'A':\n case 'LINK':\n return element.hasAttribute('href');\n default:\n return false;\n }\n}\n","import {tuiIsNativeKeyboardFocusable} from './is-native-keyboard-focusable';\n\nexport function tuiIsNativeMouseFocusable(element: Element): boolean {\n return (\n !element.hasAttribute('disabled') &&\n (element.getAttribute('tabIndex') === '-1' ||\n tuiIsNativeKeyboardFocusable(element))\n );\n}\n","import {svgNodeFilter} from '@taiga-ui/cdk/constants';\nimport {tuiIsHTMLElement} from '@taiga-ui/cdk/utils/dom';\n\nimport {tuiIsNativeKeyboardFocusable} from './is-native-keyboard-focusable';\nimport {tuiIsNativeMouseFocusable} from './is-native-mouse-focusable';\n\nexport interface TuiGetClosestFocusableOptions {\n /**\n * @description:\n * current HTML element\n */\n initial: Element;\n\n /**\n * @description:\n * determine if only keyboard focus is of interest\n */\n keyboard?: boolean;\n\n /**\n * @description:\n * should it look backwards instead (find item that will be focused with Shift + Tab)\n */\n previous?: boolean;\n\n /**\n * @description:\n * top Node limiting the search area\n */\n root: Node;\n}\n\n/**\n * @description:\n * Finds the closest element that can be focused with a keyboard or mouse in theory\n */\nexport function tuiGetClosestFocusable({\n initial,\n root,\n previous = false,\n keyboard = true,\n}: TuiGetClosestFocusableOptions): HTMLElement | null {\n if (!root.ownerDocument) {\n return null;\n }\n\n const check = keyboard ? tuiIsNativeKeyboardFocusable : tuiIsNativeMouseFocusable;\n const treeWalker = root.ownerDocument.createTreeWalker(\n root,\n NodeFilter.SHOW_ELEMENT,\n svgNodeFilter,\n );\n\n treeWalker.currentNode = initial;\n\n while (previous ? treeWalker.previousNode() : treeWalker.nextNode()) {\n if (tuiIsHTMLElement(treeWalker.currentNode)) {\n initial = treeWalker.currentNode;\n }\n\n if (tuiIsHTMLElement(initial) && check(initial)) {\n return initial;\n }\n }\n\n return null;\n}\n","import {tuiGetNativeFocused} from './get-native-focused';\n\n/**\n * Checks if element is focused.\n *\n * Could return true even after blur since element remains focused if you switch away from a browser tab.\n *\n * @param node or null (as a common return value of DOM nodes walking)\n * @return true if focused\n */\nexport function tuiIsNativeFocused(node?: Node | null): boolean {\n return (\n !!node?.ownerDocument &&\n tuiGetNativeFocused(node.ownerDocument) === node &&\n node.ownerDocument.hasFocus()\n );\n}\n","import {tuiGetNativeFocused} from './get-native-focused';\n\n/**\n * Checks if focused element is within given element.\n *\n * @param node\n * @return true if focused node is contained within element\n */\nexport function tuiIsNativeFocusedIn(node?: Node | null): boolean {\n const focused = node?.ownerDocument && tuiGetNativeFocused(node.ownerDocument);\n\n return !!focused && node.contains(focused) && !!node.ownerDocument?.hasFocus();\n}\n","import {tuiIsNativeFocused} from './is-native-focused';\n\n/**\n * Utility method for moving focus in a list of elements\n *\n * @param currentIndex currently focused index\n * @param elements array of focusable elements\n * @param step a step to move focus by, typically -1 or 1\n */\nexport function tuiMoveFocus(\n currentIndex: number,\n elements: readonly HTMLElement[],\n step: number,\n): void {\n currentIndex += step;\n\n while (currentIndex >= 0 && currentIndex < elements.length) {\n elements[currentIndex].focus();\n\n if (tuiIsNativeFocused(elements[currentIndex])) {\n return;\n }\n\n currentIndex += step;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAAA;;;;AAIG;AACa,SAAA,mBAAmB,CAAC,EAAC,aAAa,EAAW,EAAA;AACzD,IAAA,IAAI,CAAC,aAAa,EAAE,UAAU,EAAE;AAC5B,QAAA,OAAO,aAAa,CAAC;AACxB,KAAA;AAED,IAAA,IAAI,OAAO,GAAG,aAAa,CAAC,UAAU,CAAC,aAAa,CAAC;IAErD,OAAO,OAAO,EAAE,UAAU,EAAE;AACxB,QAAA,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC;AAC9C,KAAA;AAED,IAAA,OAAO,OAAO,CAAC;AACnB;;ACbA;;AAEG;AACG,SAAU,oBAAoB,CAAC,GAAa,EAAA;AAC9C,IAAA,MAAM,aAAa,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;AAE/C,IAAA,IAAI,gBAAgB,CAAC,aAAa,CAAC,EAAE;QACjC,aAAa,CAAC,IAAI,EAAE,CAAC;AACxB,KAAA;AACL;;ACXA;;;;;AAKG;AACG,SAAU,4BAA4B,CAAC,OAAgB,EAAA;AACzD,IAAA,IAAI,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,KAAK,IAAI,EAAE;AAC/E,QAAA,OAAO,KAAK,CAAC;AACh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ACxD,QAAA,QAAQ,CAAC,YAAY,CAAC,CAAC,KAAK,EAAE,CAAC;AAE/B,QAAA,IAAI,kBAAkB,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE;YAC5C,OAAO;AACV,SAAA;QAED,YAAY,IAAI,IAAI,CAAC;AACxB,KAAA;AACL;;ACzBA;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"taiga-ui-cdk-utils-focus.mjs","sources":["../../../projects/cdk/utils/focus/get-native-focused.ts","../../../projects/cdk/utils/focus/blur-native-focused.ts","../../../projects/cdk/utils/focus/focused-in.ts","../../../projects/cdk/utils/focus/is-native-keyboard-focusable.ts","../../../projects/cdk/utils/focus/is-native-mouse-focusable.ts","../../../projects/cdk/utils/focus/get-closest-focusable.ts","../../../projects/cdk/utils/focus/is-native-focused.ts","../../../projects/cdk/utils/focus/is-native-focused-in.ts","../../../projects/cdk/utils/focus/move-focus.ts","../../../projects/cdk/utils/focus/taiga-ui-cdk-utils-focus.ts"],"sourcesContent":["/**\n * Returns current active element, including shadow dom\n *\n * @return element or null\n */\nexport function tuiGetNativeFocused({activeElement}: Document): Element | null {\n if (!activeElement?.shadowRoot) {\n return activeElement;\n }\n\n let element = activeElement.shadowRoot.activeElement;\n\n while (element?.shadowRoot) {\n element = element.shadowRoot.activeElement;\n }\n\n return element;\n}\n","import {tuiIsHTMLElement} from '@taiga-ui/cdk/utils/dom';\n\nimport {tuiGetNativeFocused} from './get-native-focused';\n\n/**\n * Finds and blurs current active element, including shadow DOM\n */\nexport function tuiBlurNativeFocused(doc: Document): void {\n const activeElement = tuiGetNativeFocused(doc);\n\n if (tuiIsHTMLElement(activeElement)) {\n activeElement.blur();\n }\n}\n","import type {Signal} from '@angular/core';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {TUI_FALSE_HANDLER, TUI_TRUE_HANDLER} from '@taiga-ui/cdk/constants';\nimport {fromEvent, map, merge} from 'rxjs';\n\nexport function tuiFocusedIn(node: Node): Signal<boolean> {\n return toSignal(\n merge(\n fromEvent(node, 'focusin').pipe(map(TUI_TRUE_HANDLER)),\n fromEvent(node, 'focusout').pipe(map(TUI_FALSE_HANDLER)),\n ),\n {initialValue: false},\n );\n}\n","import {tuiIsHTMLElement} from '@taiga-ui/cdk/utils/dom';\n\n/**\n * Checks for signs that element can be focused with keyboard. tabIndex above 0 is ignored to\n * only target natural focus order. Not checking the possibility of an element to\n * be focused, for example element can have display: none applied to it or any other\n * circumstances could prevent actual focus.\n */\nexport function tuiIsNativeKeyboardFocusable(element: Element): boolean {\n if (element.hasAttribute('disabled') || element.getAttribute('tabIndex') === '-1') {\n return false;\n }\n\n if (\n (tuiIsHTMLElement(element) && element.isContentEditable) ||\n element.getAttribute('tabIndex') === '0'\n ) {\n return true;\n }\n\n switch (element.tagName) {\n case 'BUTTON':\n case 'SELECT':\n case 'TEXTAREA':\n return true;\n case 'VIDEO':\n case 'AUDIO':\n return element.hasAttribute('controls');\n case 'INPUT':\n return element.getAttribute('type') !== 'hidden';\n case 'A':\n case 'LINK':\n return element.hasAttribute('href');\n default:\n return false;\n }\n}\n","import {tuiIsNativeKeyboardFocusable} from './is-native-keyboard-focusable';\n\nexport function tuiIsNativeMouseFocusable(element: Element): boolean {\n return (\n !element.hasAttribute('disabled') &&\n (element.getAttribute('tabIndex') === '-1' ||\n tuiIsNativeKeyboardFocusable(element))\n );\n}\n","import {svgNodeFilter} from '@taiga-ui/cdk/constants';\nimport {tuiIsHTMLElement} from '@taiga-ui/cdk/utils/dom';\n\nimport {tuiIsNativeKeyboardFocusable} from './is-native-keyboard-focusable';\nimport {tuiIsNativeMouseFocusable} from './is-native-mouse-focusable';\n\nexport interface TuiGetClosestFocusableOptions {\n /**\n * @description:\n * current HTML element\n */\n initial: Element;\n\n /**\n * @description:\n * determine if only keyboard focus is of interest\n */\n keyboard?: boolean;\n\n /**\n * @description:\n * should it look backwards instead (find item that will be focused with Shift + Tab)\n */\n previous?: boolean;\n\n /**\n * @description:\n * top Node limiting the search area\n */\n root: Node;\n}\n\n/**\n * @description:\n * Finds the closest element that can be focused with a keyboard or mouse in theory\n */\nexport function tuiGetClosestFocusable({\n initial,\n root,\n previous = false,\n keyboard = true,\n}: TuiGetClosestFocusableOptions): HTMLElement | null {\n if (!root.ownerDocument) {\n return null;\n }\n\n const check = keyboard ? tuiIsNativeKeyboardFocusable : tuiIsNativeMouseFocusable;\n const treeWalker = root.ownerDocument.createTreeWalker(\n root,\n NodeFilter.SHOW_ELEMENT,\n svgNodeFilter,\n );\n\n treeWalker.currentNode = initial;\n\n while (previous ? treeWalker.previousNode() : treeWalker.nextNode()) {\n if (tuiIsHTMLElement(treeWalker.currentNode)) {\n initial = treeWalker.currentNode;\n }\n\n if (tuiIsHTMLElement(initial) && check(initial)) {\n return initial;\n }\n }\n\n return null;\n}\n","import {tuiGetNativeFocused} from './get-native-focused';\n\n/**\n * Checks if element is focused.\n *\n * Could return true even after blur since element remains focused if you switch away from a browser tab.\n *\n * @param node or null (as a common return value of DOM nodes walking)\n * @return true if focused\n */\nexport function tuiIsNativeFocused(node?: Node | null): boolean {\n return (\n !!node?.ownerDocument &&\n tuiGetNativeFocused(node.ownerDocument) === node &&\n node.ownerDocument.hasFocus()\n );\n}\n","import {tuiGetNativeFocused} from './get-native-focused';\n\n/**\n * Checks if focused element is within given element.\n *\n * @param node\n * @return true if focused node is contained within element\n */\nexport function tuiIsNativeFocusedIn(node?: Node | null): boolean {\n const focused = node?.ownerDocument && tuiGetNativeFocused(node.ownerDocument);\n\n return !!focused && node.contains(focused) && !!node.ownerDocument?.hasFocus();\n}\n","import {tuiIsNativeFocused} from './is-native-focused';\n\n/**\n * Utility method for moving focus in a list of elements\n *\n * @param currentIndex currently focused index\n * @param elements array of focusable elements\n * @param step a step to move focus by, typically -1 or 1\n */\nexport function tuiMoveFocus(\n currentIndex: number,\n elements: readonly HTMLElement[],\n step: number,\n): void {\n currentIndex += step;\n\n while (currentIndex >= 0 && currentIndex < elements.length) {\n elements[currentIndex].focus();\n\n if (tuiIsNativeFocused(elements[currentIndex])) {\n return;\n }\n\n currentIndex += step;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAA;;;;AAIG;AACa,SAAA,mBAAmB,CAAC,EAAC,aAAa,EAAW,EAAA;AACzD,IAAA,IAAI,CAAC,aAAa,EAAE,UAAU,EAAE;AAC5B,QAAA,OAAO,aAAa,CAAC;AACxB,KAAA;AAED,IAAA,IAAI,OAAO,GAAG,aAAa,CAAC,UAAU,CAAC,aAAa,CAAC;IAErD,OAAO,OAAO,EAAE,UAAU,EAAE;AACxB,QAAA,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC;AAC9C,KAAA;AAED,IAAA,OAAO,OAAO,CAAC;AACnB;;ACbA;;AAEG;AACG,SAAU,oBAAoB,CAAC,GAAa,EAAA;AAC9C,IAAA,MAAM,aAAa,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;AAE/C,IAAA,IAAI,gBAAgB,CAAC,aAAa,CAAC,EAAE;QACjC,aAAa,CAAC,IAAI,EAAE,CAAC;AACxB,KAAA;AACL;;ACRM,SAAU,YAAY,CAAC,IAAU,EAAA;AACnC,IAAA,OAAO,QAAQ,CACX,KAAK,CACD,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,EACtD,SAAS,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAC3D,EACD,EAAC,YAAY,EAAE,KAAK,EAAC,CACxB,CAAC;AACN;;ACXA;;;;;AAKG;AACG,SAAU,4BAA4B,CAAC,OAAgB,EAAA;AACzD,IAAA,IAAI,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,KAAK,IAAI,EAAE;AAC/E,QAAA,OAAO,KAAK,CAAC;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E;AACxD,QAAA,QAAQ,CAAC,YAAY,CAAC,CAAC,KAAK,EAAE,CAAC;AAE/B,QAAA,IAAI,kBAAkB,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE;YAC5C,OAAO;AACV,SAAA;QAED,YAAY,IAAI,IAAI,CAAC;AACxB,KAAA;AACL;;ACzBA;;AAEG;;;;"}
|
package/package.json
CHANGED
@@ -1,69 +1,359 @@
|
|
1
1
|
{
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
"
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
2
|
+
"name": "@taiga-ui/cdk",
|
3
|
+
"version": "4.0.0-rc.5",
|
4
|
+
"description": "Base library for creating Angular components and applications using Taiga UI principles regarding of actual visual appearance",
|
5
|
+
"keywords": [
|
6
|
+
"angular",
|
7
|
+
"cdk",
|
8
|
+
"component",
|
9
|
+
"development",
|
10
|
+
"kit",
|
11
|
+
"service",
|
12
|
+
"directive"
|
13
|
+
],
|
14
|
+
"homepage": "https://github.com/taiga-family/taiga-ui",
|
15
|
+
"repository": "https://github.com/taiga-family/taiga-ui",
|
16
|
+
"license": "Apache-2.0",
|
17
|
+
"dependencies": {
|
18
|
+
"tslib": "2.6.3"
|
19
|
+
},
|
20
|
+
"peerDependencies": {
|
21
|
+
"@angular/animations": ">=16.0.0",
|
22
|
+
"@angular/cdk": ">=16.0.0",
|
23
|
+
"@angular/common": ">=16.0.0",
|
24
|
+
"@angular/core": ">=16.0.0",
|
25
|
+
"@angular/forms": ">=16.0.0",
|
26
|
+
"@ng-web-apis/common": "^4.1.2",
|
27
|
+
"@ng-web-apis/mutation-observer": "^4.1.2",
|
28
|
+
"@ng-web-apis/resize-observer": "^4.1.2",
|
29
|
+
"@taiga-ui/event-plugins": "^4.0.1",
|
30
|
+
"@taiga-ui/polymorpheus": "^4.6.4",
|
31
|
+
"rxjs": ">=7.0.0"
|
32
|
+
},
|
33
|
+
"optionalDependencies": {
|
34
|
+
"@angular-devkit/core": ">=16.0.0",
|
35
|
+
"@angular-devkit/schematics": ">=16.0.0",
|
36
|
+
"@schematics/angular": ">=16.0.0",
|
37
|
+
"ng-morph": "^4.5.2",
|
38
|
+
"parse5": "^7.1.2"
|
39
|
+
},
|
40
|
+
"ng-update": {
|
41
|
+
"migrations": "./schematics/migration.json",
|
42
|
+
"packageGroup": [
|
43
|
+
"@taiga-ui/i18n",
|
44
|
+
"@taiga-ui/cdk",
|
45
|
+
"@taiga-ui/core",
|
46
|
+
"@taiga-ui/kit",
|
47
|
+
"@taiga-ui/styles",
|
48
|
+
"@taiga-ui/testing",
|
49
|
+
"@taiga-ui/addon-doc",
|
50
|
+
"@taiga-ui/addon-charts",
|
51
|
+
"@taiga-ui/addon-commerce",
|
52
|
+
"@taiga-ui/icons",
|
53
|
+
"@taiga-ui/addon-table",
|
54
|
+
"@taiga-ui/addon-mobile",
|
55
|
+
"@taiga-ui/layout",
|
56
|
+
"@taiga-ui/experimental",
|
57
|
+
"@taiga-ui/proprietary",
|
58
|
+
"@taiga-ui/legacy",
|
59
|
+
"ng-morph"
|
60
|
+
]
|
61
|
+
},
|
62
|
+
"schematics": "./schematics/collection.json",
|
63
|
+
"module": "fesm2022/taiga-ui-cdk.mjs",
|
64
|
+
"typings": "index.d.ts",
|
65
|
+
"exports": {
|
66
|
+
"./package.json": {
|
67
|
+
"default": "./package.json"
|
68
|
+
},
|
69
|
+
".": {
|
70
|
+
"types": "./index.d.ts",
|
71
|
+
"esm2022": "./esm2022/taiga-ui-cdk.mjs",
|
72
|
+
"esm": "./esm2022/taiga-ui-cdk.mjs",
|
73
|
+
"default": "./fesm2022/taiga-ui-cdk.mjs"
|
74
|
+
},
|
75
|
+
"./classes": {
|
76
|
+
"types": "./classes/index.d.ts",
|
77
|
+
"esm2022": "./esm2022/classes/taiga-ui-cdk-classes.mjs",
|
78
|
+
"esm": "./esm2022/classes/taiga-ui-cdk-classes.mjs",
|
79
|
+
"default": "./fesm2022/taiga-ui-cdk-classes.mjs"
|
80
|
+
},
|
81
|
+
"./constants": {
|
82
|
+
"types": "./constants/index.d.ts",
|
83
|
+
"esm2022": "./esm2022/constants/taiga-ui-cdk-constants.mjs",
|
84
|
+
"esm": "./esm2022/constants/taiga-ui-cdk-constants.mjs",
|
85
|
+
"default": "./fesm2022/taiga-ui-cdk-constants.mjs"
|
86
|
+
},
|
87
|
+
"./date-time": {
|
88
|
+
"types": "./date-time/index.d.ts",
|
89
|
+
"esm2022": "./esm2022/date-time/taiga-ui-cdk-date-time.mjs",
|
90
|
+
"esm": "./esm2022/date-time/taiga-ui-cdk-date-time.mjs",
|
91
|
+
"default": "./fesm2022/taiga-ui-cdk-date-time.mjs"
|
92
|
+
},
|
93
|
+
"./directives": {
|
94
|
+
"types": "./directives/index.d.ts",
|
95
|
+
"esm2022": "./esm2022/directives/taiga-ui-cdk-directives.mjs",
|
96
|
+
"esm": "./esm2022/directives/taiga-ui-cdk-directives.mjs",
|
97
|
+
"default": "./fesm2022/taiga-ui-cdk-directives.mjs"
|
98
|
+
},
|
99
|
+
"./observables": {
|
100
|
+
"types": "./observables/index.d.ts",
|
101
|
+
"esm2022": "./esm2022/observables/taiga-ui-cdk-observables.mjs",
|
102
|
+
"esm": "./esm2022/observables/taiga-ui-cdk-observables.mjs",
|
103
|
+
"default": "./fesm2022/taiga-ui-cdk-observables.mjs"
|
104
|
+
},
|
105
|
+
"./pipes": {
|
106
|
+
"types": "./pipes/index.d.ts",
|
107
|
+
"esm2022": "./esm2022/pipes/taiga-ui-cdk-pipes.mjs",
|
108
|
+
"esm": "./esm2022/pipes/taiga-ui-cdk-pipes.mjs",
|
109
|
+
"default": "./fesm2022/taiga-ui-cdk-pipes.mjs"
|
110
|
+
},
|
111
|
+
"./services": {
|
112
|
+
"types": "./services/index.d.ts",
|
113
|
+
"esm2022": "./esm2022/services/taiga-ui-cdk-services.mjs",
|
114
|
+
"esm": "./esm2022/services/taiga-ui-cdk-services.mjs",
|
115
|
+
"default": "./fesm2022/taiga-ui-cdk-services.mjs"
|
116
|
+
},
|
117
|
+
"./tokens": {
|
118
|
+
"types": "./tokens/index.d.ts",
|
119
|
+
"esm2022": "./esm2022/tokens/taiga-ui-cdk-tokens.mjs",
|
120
|
+
"esm": "./esm2022/tokens/taiga-ui-cdk-tokens.mjs",
|
121
|
+
"default": "./fesm2022/taiga-ui-cdk-tokens.mjs"
|
122
|
+
},
|
123
|
+
"./types": {
|
124
|
+
"types": "./types/index.d.ts",
|
125
|
+
"esm2022": "./esm2022/types/taiga-ui-cdk-types.mjs",
|
126
|
+
"esm": "./esm2022/types/taiga-ui-cdk-types.mjs",
|
127
|
+
"default": "./fesm2022/taiga-ui-cdk-types.mjs"
|
128
|
+
},
|
129
|
+
"./utils": {
|
130
|
+
"types": "./utils/index.d.ts",
|
131
|
+
"esm2022": "./esm2022/utils/taiga-ui-cdk-utils.mjs",
|
132
|
+
"esm": "./esm2022/utils/taiga-ui-cdk-utils.mjs",
|
133
|
+
"default": "./fesm2022/taiga-ui-cdk-utils.mjs"
|
134
|
+
},
|
135
|
+
"./directives/active-zone": {
|
136
|
+
"types": "./directives/active-zone/index.d.ts",
|
137
|
+
"esm2022": "./esm2022/directives/active-zone/taiga-ui-cdk-directives-active-zone.mjs",
|
138
|
+
"esm": "./esm2022/directives/active-zone/taiga-ui-cdk-directives-active-zone.mjs",
|
139
|
+
"default": "./fesm2022/taiga-ui-cdk-directives-active-zone.mjs"
|
140
|
+
},
|
141
|
+
"./directives/auto-focus": {
|
142
|
+
"types": "./directives/auto-focus/index.d.ts",
|
143
|
+
"esm2022": "./esm2022/directives/auto-focus/taiga-ui-cdk-directives-auto-focus.mjs",
|
144
|
+
"esm": "./esm2022/directives/auto-focus/taiga-ui-cdk-directives-auto-focus.mjs",
|
145
|
+
"default": "./fesm2022/taiga-ui-cdk-directives-auto-focus.mjs"
|
146
|
+
},
|
147
|
+
"./directives/click-outside": {
|
148
|
+
"types": "./directives/click-outside/index.d.ts",
|
149
|
+
"esm2022": "./esm2022/directives/click-outside/taiga-ui-cdk-directives-click-outside.mjs",
|
150
|
+
"esm": "./esm2022/directives/click-outside/taiga-ui-cdk-directives-click-outside.mjs",
|
151
|
+
"default": "./fesm2022/taiga-ui-cdk-directives-click-outside.mjs"
|
152
|
+
},
|
153
|
+
"./directives/control": {
|
154
|
+
"types": "./directives/control/index.d.ts",
|
155
|
+
"esm2022": "./esm2022/directives/control/taiga-ui-cdk-directives-control.mjs",
|
156
|
+
"esm": "./esm2022/directives/control/taiga-ui-cdk-directives-control.mjs",
|
157
|
+
"default": "./fesm2022/taiga-ui-cdk-directives-control.mjs"
|
158
|
+
},
|
159
|
+
"./directives/copy-processor": {
|
160
|
+
"types": "./directives/copy-processor/index.d.ts",
|
161
|
+
"esm2022": "./esm2022/directives/copy-processor/taiga-ui-cdk-directives-copy-processor.mjs",
|
162
|
+
"esm": "./esm2022/directives/copy-processor/taiga-ui-cdk-directives-copy-processor.mjs",
|
163
|
+
"default": "./fesm2022/taiga-ui-cdk-directives-copy-processor.mjs"
|
164
|
+
},
|
165
|
+
"./directives/droppable": {
|
166
|
+
"types": "./directives/droppable/index.d.ts",
|
167
|
+
"esm2022": "./esm2022/directives/droppable/taiga-ui-cdk-directives-droppable.mjs",
|
168
|
+
"esm": "./esm2022/directives/droppable/taiga-ui-cdk-directives-droppable.mjs",
|
169
|
+
"default": "./fesm2022/taiga-ui-cdk-directives-droppable.mjs"
|
170
|
+
},
|
171
|
+
"./directives/element": {
|
172
|
+
"types": "./directives/element/index.d.ts",
|
173
|
+
"esm2022": "./esm2022/directives/element/taiga-ui-cdk-directives-element.mjs",
|
174
|
+
"esm": "./esm2022/directives/element/taiga-ui-cdk-directives-element.mjs",
|
175
|
+
"default": "./fesm2022/taiga-ui-cdk-directives-element.mjs"
|
176
|
+
},
|
177
|
+
"./directives/focus-trap": {
|
178
|
+
"types": "./directives/focus-trap/index.d.ts",
|
179
|
+
"esm2022": "./esm2022/directives/focus-trap/taiga-ui-cdk-directives-focus-trap.mjs",
|
180
|
+
"esm": "./esm2022/directives/focus-trap/taiga-ui-cdk-directives-focus-trap.mjs",
|
181
|
+
"default": "./fesm2022/taiga-ui-cdk-directives-focus-trap.mjs"
|
182
|
+
},
|
183
|
+
"./directives/for": {
|
184
|
+
"types": "./directives/for/index.d.ts",
|
185
|
+
"esm2022": "./esm2022/directives/for/taiga-ui-cdk-directives-for.mjs",
|
186
|
+
"esm": "./esm2022/directives/for/taiga-ui-cdk-directives-for.mjs",
|
187
|
+
"default": "./fesm2022/taiga-ui-cdk-directives-for.mjs"
|
188
|
+
},
|
189
|
+
"./directives/high-dpi": {
|
190
|
+
"types": "./directives/high-dpi/index.d.ts",
|
191
|
+
"esm2022": "./esm2022/directives/high-dpi/taiga-ui-cdk-directives-high-dpi.mjs",
|
192
|
+
"esm": "./esm2022/directives/high-dpi/taiga-ui-cdk-directives-high-dpi.mjs",
|
193
|
+
"default": "./fesm2022/taiga-ui-cdk-directives-high-dpi.mjs"
|
194
|
+
},
|
195
|
+
"./directives/hovered": {
|
196
|
+
"types": "./directives/hovered/index.d.ts",
|
197
|
+
"esm2022": "./esm2022/directives/hovered/taiga-ui-cdk-directives-hovered.mjs",
|
198
|
+
"esm": "./esm2022/directives/hovered/taiga-ui-cdk-directives-hovered.mjs",
|
199
|
+
"default": "./fesm2022/taiga-ui-cdk-directives-hovered.mjs"
|
200
|
+
},
|
201
|
+
"./directives/item": {
|
202
|
+
"types": "./directives/item/index.d.ts",
|
203
|
+
"esm2022": "./esm2022/directives/item/taiga-ui-cdk-directives-item.mjs",
|
204
|
+
"esm": "./esm2022/directives/item/taiga-ui-cdk-directives-item.mjs",
|
205
|
+
"default": "./fesm2022/taiga-ui-cdk-directives-item.mjs"
|
206
|
+
},
|
207
|
+
"./directives/let": {
|
208
|
+
"types": "./directives/let/index.d.ts",
|
209
|
+
"esm2022": "./esm2022/directives/let/taiga-ui-cdk-directives-let.mjs",
|
210
|
+
"esm": "./esm2022/directives/let/taiga-ui-cdk-directives-let.mjs",
|
211
|
+
"default": "./fesm2022/taiga-ui-cdk-directives-let.mjs"
|
212
|
+
},
|
213
|
+
"./directives/media": {
|
214
|
+
"types": "./directives/media/index.d.ts",
|
215
|
+
"esm2022": "./esm2022/directives/media/taiga-ui-cdk-directives-media.mjs",
|
216
|
+
"esm": "./esm2022/directives/media/taiga-ui-cdk-directives-media.mjs",
|
217
|
+
"default": "./fesm2022/taiga-ui-cdk-directives-media.mjs"
|
218
|
+
},
|
219
|
+
"./directives/native-validator": {
|
220
|
+
"types": "./directives/native-validator/index.d.ts",
|
221
|
+
"esm2022": "./esm2022/directives/native-validator/taiga-ui-cdk-directives-native-validator.mjs",
|
222
|
+
"esm": "./esm2022/directives/native-validator/taiga-ui-cdk-directives-native-validator.mjs",
|
223
|
+
"default": "./fesm2022/taiga-ui-cdk-directives-native-validator.mjs"
|
224
|
+
},
|
225
|
+
"./directives/obscured": {
|
226
|
+
"types": "./directives/obscured/index.d.ts",
|
227
|
+
"esm2022": "./esm2022/directives/obscured/taiga-ui-cdk-directives-obscured.mjs",
|
228
|
+
"esm": "./esm2022/directives/obscured/taiga-ui-cdk-directives-obscured.mjs",
|
229
|
+
"default": "./fesm2022/taiga-ui-cdk-directives-obscured.mjs"
|
230
|
+
},
|
231
|
+
"./directives/pan": {
|
232
|
+
"types": "./directives/pan/index.d.ts",
|
233
|
+
"esm2022": "./esm2022/directives/pan/taiga-ui-cdk-directives-pan.mjs",
|
234
|
+
"esm": "./esm2022/directives/pan/taiga-ui-cdk-directives-pan.mjs",
|
235
|
+
"default": "./fesm2022/taiga-ui-cdk-directives-pan.mjs"
|
236
|
+
},
|
237
|
+
"./directives/platform": {
|
238
|
+
"types": "./directives/platform/index.d.ts",
|
239
|
+
"esm2022": "./esm2022/directives/platform/taiga-ui-cdk-directives-platform.mjs",
|
240
|
+
"esm": "./esm2022/directives/platform/taiga-ui-cdk-directives-platform.mjs",
|
241
|
+
"default": "./fesm2022/taiga-ui-cdk-directives-platform.mjs"
|
242
|
+
},
|
243
|
+
"./directives/popover": {
|
244
|
+
"types": "./directives/popover/index.d.ts",
|
245
|
+
"esm2022": "./esm2022/directives/popover/taiga-ui-cdk-directives-popover.mjs",
|
246
|
+
"esm": "./esm2022/directives/popover/taiga-ui-cdk-directives-popover.mjs",
|
247
|
+
"default": "./fesm2022/taiga-ui-cdk-directives-popover.mjs"
|
248
|
+
},
|
249
|
+
"./directives/repeat-times": {
|
250
|
+
"types": "./directives/repeat-times/index.d.ts",
|
251
|
+
"esm2022": "./esm2022/directives/repeat-times/taiga-ui-cdk-directives-repeat-times.mjs",
|
252
|
+
"esm": "./esm2022/directives/repeat-times/taiga-ui-cdk-directives-repeat-times.mjs",
|
253
|
+
"default": "./fesm2022/taiga-ui-cdk-directives-repeat-times.mjs"
|
254
|
+
},
|
255
|
+
"./directives/resizer": {
|
256
|
+
"types": "./directives/resizer/index.d.ts",
|
257
|
+
"esm2022": "./esm2022/directives/resizer/taiga-ui-cdk-directives-resizer.mjs",
|
258
|
+
"esm": "./esm2022/directives/resizer/taiga-ui-cdk-directives-resizer.mjs",
|
259
|
+
"default": "./fesm2022/taiga-ui-cdk-directives-resizer.mjs"
|
260
|
+
},
|
261
|
+
"./directives/swipe": {
|
262
|
+
"types": "./directives/swipe/index.d.ts",
|
263
|
+
"esm2022": "./esm2022/directives/swipe/taiga-ui-cdk-directives-swipe.mjs",
|
264
|
+
"esm": "./esm2022/directives/swipe/taiga-ui-cdk-directives-swipe.mjs",
|
265
|
+
"default": "./fesm2022/taiga-ui-cdk-directives-swipe.mjs"
|
266
|
+
},
|
267
|
+
"./directives/validator": {
|
268
|
+
"types": "./directives/validator/index.d.ts",
|
269
|
+
"esm2022": "./esm2022/directives/validator/taiga-ui-cdk-directives-validator.mjs",
|
270
|
+
"esm": "./esm2022/directives/validator/taiga-ui-cdk-directives-validator.mjs",
|
271
|
+
"default": "./fesm2022/taiga-ui-cdk-directives-validator.mjs"
|
272
|
+
},
|
273
|
+
"./directives/value-changes": {
|
274
|
+
"types": "./directives/value-changes/index.d.ts",
|
275
|
+
"esm2022": "./esm2022/directives/value-changes/taiga-ui-cdk-directives-value-changes.mjs",
|
276
|
+
"esm": "./esm2022/directives/value-changes/taiga-ui-cdk-directives-value-changes.mjs",
|
277
|
+
"default": "./fesm2022/taiga-ui-cdk-directives-value-changes.mjs"
|
278
|
+
},
|
279
|
+
"./directives/zoom": {
|
280
|
+
"types": "./directives/zoom/index.d.ts",
|
281
|
+
"esm2022": "./esm2022/directives/zoom/taiga-ui-cdk-directives-zoom.mjs",
|
282
|
+
"esm": "./esm2022/directives/zoom/taiga-ui-cdk-directives-zoom.mjs",
|
283
|
+
"default": "./fesm2022/taiga-ui-cdk-directives-zoom.mjs"
|
284
|
+
},
|
285
|
+
"./pipes/filter": {
|
286
|
+
"types": "./pipes/filter/index.d.ts",
|
287
|
+
"esm2022": "./esm2022/pipes/filter/taiga-ui-cdk-pipes-filter.mjs",
|
288
|
+
"esm": "./esm2022/pipes/filter/taiga-ui-cdk-pipes-filter.mjs",
|
289
|
+
"default": "./fesm2022/taiga-ui-cdk-pipes-filter.mjs"
|
290
|
+
},
|
291
|
+
"./pipes/is-present": {
|
292
|
+
"types": "./pipes/is-present/index.d.ts",
|
293
|
+
"esm2022": "./esm2022/pipes/is-present/taiga-ui-cdk-pipes-is-present.mjs",
|
294
|
+
"esm": "./esm2022/pipes/is-present/taiga-ui-cdk-pipes-is-present.mjs",
|
295
|
+
"default": "./fesm2022/taiga-ui-cdk-pipes-is-present.mjs"
|
296
|
+
},
|
297
|
+
"./pipes/keys": {
|
298
|
+
"types": "./pipes/keys/index.d.ts",
|
299
|
+
"esm2022": "./esm2022/pipes/keys/taiga-ui-cdk-pipes-keys.mjs",
|
300
|
+
"esm": "./esm2022/pipes/keys/taiga-ui-cdk-pipes-keys.mjs",
|
301
|
+
"default": "./fesm2022/taiga-ui-cdk-pipes-keys.mjs"
|
302
|
+
},
|
303
|
+
"./pipes/mapper": {
|
304
|
+
"types": "./pipes/mapper/index.d.ts",
|
305
|
+
"esm2022": "./esm2022/pipes/mapper/taiga-ui-cdk-pipes-mapper.mjs",
|
306
|
+
"esm": "./esm2022/pipes/mapper/taiga-ui-cdk-pipes-mapper.mjs",
|
307
|
+
"default": "./fesm2022/taiga-ui-cdk-pipes-mapper.mjs"
|
308
|
+
},
|
309
|
+
"./pipes/replace": {
|
310
|
+
"types": "./pipes/replace/index.d.ts",
|
311
|
+
"esm2022": "./esm2022/pipes/replace/taiga-ui-cdk-pipes-replace.mjs",
|
312
|
+
"esm": "./esm2022/pipes/replace/taiga-ui-cdk-pipes-replace.mjs",
|
313
|
+
"default": "./fesm2022/taiga-ui-cdk-pipes-replace.mjs"
|
314
|
+
},
|
315
|
+
"./pipes/to-array": {
|
316
|
+
"types": "./pipes/to-array/index.d.ts",
|
317
|
+
"esm2022": "./esm2022/pipes/to-array/taiga-ui-cdk-pipes-to-array.mjs",
|
318
|
+
"esm": "./esm2022/pipes/to-array/taiga-ui-cdk-pipes-to-array.mjs",
|
319
|
+
"default": "./fesm2022/taiga-ui-cdk-pipes-to-array.mjs"
|
320
|
+
},
|
321
|
+
"./utils/browser": {
|
322
|
+
"types": "./utils/browser/index.d.ts",
|
323
|
+
"esm2022": "./esm2022/utils/browser/taiga-ui-cdk-utils-browser.mjs",
|
324
|
+
"esm": "./esm2022/utils/browser/taiga-ui-cdk-utils-browser.mjs",
|
325
|
+
"default": "./fesm2022/taiga-ui-cdk-utils-browser.mjs"
|
326
|
+
},
|
327
|
+
"./utils/color": {
|
328
|
+
"types": "./utils/color/index.d.ts",
|
329
|
+
"esm2022": "./esm2022/utils/color/taiga-ui-cdk-utils-color.mjs",
|
330
|
+
"esm": "./esm2022/utils/color/taiga-ui-cdk-utils-color.mjs",
|
331
|
+
"default": "./fesm2022/taiga-ui-cdk-utils-color.mjs"
|
332
|
+
},
|
333
|
+
"./utils/dom": {
|
334
|
+
"types": "./utils/dom/index.d.ts",
|
335
|
+
"esm2022": "./esm2022/utils/dom/taiga-ui-cdk-utils-dom.mjs",
|
336
|
+
"esm": "./esm2022/utils/dom/taiga-ui-cdk-utils-dom.mjs",
|
337
|
+
"default": "./fesm2022/taiga-ui-cdk-utils-dom.mjs"
|
338
|
+
},
|
339
|
+
"./utils/focus": {
|
340
|
+
"types": "./utils/focus/index.d.ts",
|
341
|
+
"esm2022": "./esm2022/utils/focus/taiga-ui-cdk-utils-focus.mjs",
|
342
|
+
"esm": "./esm2022/utils/focus/taiga-ui-cdk-utils-focus.mjs",
|
343
|
+
"default": "./fesm2022/taiga-ui-cdk-utils-focus.mjs"
|
344
|
+
},
|
345
|
+
"./utils/math": {
|
346
|
+
"types": "./utils/math/index.d.ts",
|
347
|
+
"esm2022": "./esm2022/utils/math/taiga-ui-cdk-utils-math.mjs",
|
348
|
+
"esm": "./esm2022/utils/math/taiga-ui-cdk-utils-math.mjs",
|
349
|
+
"default": "./fesm2022/taiga-ui-cdk-utils-math.mjs"
|
350
|
+
},
|
351
|
+
"./utils/miscellaneous": {
|
352
|
+
"types": "./utils/miscellaneous/index.d.ts",
|
353
|
+
"esm2022": "./esm2022/utils/miscellaneous/taiga-ui-cdk-utils-miscellaneous.mjs",
|
354
|
+
"esm": "./esm2022/utils/miscellaneous/taiga-ui-cdk-utils-miscellaneous.mjs",
|
355
|
+
"default": "./fesm2022/taiga-ui-cdk-utils-miscellaneous.mjs"
|
356
|
+
}
|
357
|
+
},
|
358
|
+
"sideEffects": false
|
69
359
|
}
|
@@ -14,9 +14,10 @@ export interface ReplacementIdentifierMulti extends Pick<ReplacementIdentifier,
|
|
14
14
|
readonly moduleSpecifier: string;
|
15
15
|
readonly name: string;
|
16
16
|
readonly namedImport?: string;
|
17
|
+
readonly spreadInModule?: boolean;
|
17
18
|
}> | {
|
18
19
|
readonly moduleSpecifier: string;
|
19
20
|
readonly name: string;
|
20
|
-
readonly
|
21
|
+
readonly spreadInModule?: boolean;
|
21
22
|
};
|
22
23
|
}
|
@@ -17,6 +17,7 @@ exports.replaceIdentifiers = replaceIdentifiers;
|
|
17
17
|
function replaceIdentifier({ from, to }) {
|
18
18
|
const references = (0, get_named_import_references_1.getNamedImportReferences)(from.name, from.moduleSpecifier);
|
19
19
|
references.forEach((ref) => {
|
20
|
+
var _a;
|
20
21
|
if (ref.wasForgotten()) {
|
21
22
|
return;
|
22
23
|
}
|
@@ -26,7 +27,10 @@ function replaceIdentifier({ from, to }) {
|
|
26
27
|
addImports(to, parent.getSourceFile().getFilePath());
|
27
28
|
}
|
28
29
|
else {
|
29
|
-
|
30
|
+
const decorator = ref.getParentWhile((node) => node.getKindName() !== 'Decorator');
|
31
|
+
const inModule = ((_a = decorator === null || decorator === void 0 ? void 0 : decorator.getFirstChildIfKind(ng_morph_1.ts.SyntaxKind.Identifier)) === null || _a === void 0 ? void 0 : _a.getText()) ===
|
32
|
+
'NgModule';
|
33
|
+
ref.replaceWithText(getReplacementText(to, !!inModule));
|
30
34
|
}
|
31
35
|
});
|
32
36
|
}
|
@@ -36,5 +40,11 @@ function addImports(identifier, filePath) {
|
|
36
40
|
? identifier.forEach(({ name, namedImport, moduleSpecifier }) => {
|
37
41
|
(0, add_unique_import_1.addUniqueImport)(filePath, namedImport || name, moduleSpecifier);
|
38
42
|
})
|
39
|
-
: (0, add_unique_import_1.addUniqueImport)(filePath, identifier.
|
43
|
+
: (0, add_unique_import_1.addUniqueImport)(filePath, identifier.name, identifier.moduleSpecifier);
|
44
|
+
}
|
45
|
+
function getReplacementText(to, inModule) {
|
46
|
+
const res = Array.isArray(to) ? to : [to];
|
47
|
+
return res
|
48
|
+
.map(({ name, spreadInModule }) => spreadInModule && inModule ? `...${name}` : name)
|
49
|
+
.join(', ');
|
40
50
|
}
|
@@ -9,16 +9,21 @@ const versions_1 = require("../../ng-add/constants/versions");
|
|
9
9
|
const colored_log_1 = require("../../utils/colored-log");
|
10
10
|
const get_execution_time_1 = require("../../utils/get-execution-time");
|
11
11
|
const steps_1 = require("../steps");
|
12
|
+
const replace_services_1 = require("../steps/replace-services");
|
12
13
|
const get_file_system_1 = require("../utils/get-file-system");
|
13
14
|
const enums_1 = require("../v4/steps/constants/enums");
|
14
15
|
const steps_2 = require("./steps");
|
15
16
|
const constants_1 = require("./steps/constants");
|
16
17
|
const modules_to_replace_1 = require("./steps/constants/modules-to-replace");
|
17
18
|
const types_1 = require("./steps/constants/types");
|
19
|
+
const migrate_root_1 = require("./steps/migrate-root");
|
18
20
|
const replace_modules_with_providers_1 = require("./steps/utils/replace-modules-with-providers");
|
19
21
|
function main(options) {
|
20
22
|
return (tree, context) => {
|
21
23
|
const fileSystem = (0, get_file_system_1.getFileSystem)(tree);
|
24
|
+
(0, steps_1.replaceEnums)(options, enums_1.ENUMS_TO_REPLACE);
|
25
|
+
(0, migrate_root_1.migrateRoot)(fileSystem, options);
|
26
|
+
(0, replace_services_1.replaceServices)(options, constants_1.SERVICES_TO_REPLACE);
|
22
27
|
(0, steps_1.replaceIdentifiers)(options, constants_1.IDENTIFIERS_TO_REPLACE);
|
23
28
|
(0, steps_1.removeModules)(options, constants_1.MODULES_TO_REMOVE);
|
24
29
|
(0, replace_modules_with_providers_1.replaceModulesWithProviders)(options, modules_to_replace_1.MODULES_TO_REPLACE_WITH_PROVIDERS);
|
@@ -29,7 +34,6 @@ function main(options) {
|
|
29
34
|
(0, steps_2.migrateDestroyService)(options);
|
30
35
|
(0, steps_2.migrateOptionProviders)(options);
|
31
36
|
(0, steps_2.migrateAllCountryIsoCodes)(options);
|
32
|
-
(0, steps_1.replaceEnums)(options, enums_1.ENUMS_TO_REPLACE);
|
33
37
|
(0, steps_2.migrateTemplates)(fileSystem, options);
|
34
38
|
(0, steps_1.showWarnings)(context, constants_1.MIGRATION_WARNINGS);
|
35
39
|
fileSystem.commitEdits();
|
@@ -17,6 +17,14 @@ const CHANGED_ICONS = [
|
|
17
17
|
{ from: 'tuiIconDragLarge', to: ' @tui.grip-vertical' },
|
18
18
|
{ from: 'tuiIconGrid', to: '@tui.layout-grid' },
|
19
19
|
{ from: 'tuiIconGridLarge', to: '@tui.layout-grid' },
|
20
|
+
{ from: 'tuiIconTool', to: '@tui.wrench' },
|
21
|
+
{ from: 'tuiIconUnlock', to: '@tui.lock-open' },
|
22
|
+
{ from: 'tuiIconMessageCircle', to: '@tui.message-circle' },
|
23
|
+
{ from: 'tuiIconSliders', to: '@tui.sliders-vertical' },
|
24
|
+
{ from: 'tuiIconPlusSquare', to: '@tui.square-plus' },
|
25
|
+
{ from: 'tuiIconAlertTriangle', to: '@tui.triangle-alert' },
|
26
|
+
{ from: 'tuiIconUploadCloud', to: '@tui.cloud-upload' },
|
27
|
+
{ from: 'tuiIconDownloadCloud', to: '@tui.cloud-download' },
|
20
28
|
];
|
21
29
|
function renameIcons(pattern = constants_1.ALL_FILES) {
|
22
30
|
const sourceFiles = (0, ng_morph_1.getSourceFiles)(pattern);
|
@@ -254,10 +254,6 @@ exports.IDENTIFIERS_TO_REPLACE = [
|
|
254
254
|
from: { name: 'TuiUnmaskHandlerModule', moduleSpecifier: '@taiga-ui/kit' },
|
255
255
|
to: { name: 'TuiUnmaskHandler', moduleSpecifier: '@taiga-ui/kit' },
|
256
256
|
},
|
257
|
-
{
|
258
|
-
from: { name: 'TuiDialogFormService', moduleSpecifier: '@taiga-ui/kit' },
|
259
|
-
to: { name: 'TuiConfirmService', moduleSpecifier: '@taiga-ui/kit' },
|
260
|
-
},
|
261
257
|
{
|
262
258
|
from: { name: 'TuiSortCountriesPipeModule', moduleSpecifier: '@taiga-ui/kit' },
|
263
259
|
to: { name: 'TuiSortCountriesPipe', moduleSpecifier: '@taiga-ui/kit' },
|
@@ -359,6 +355,10 @@ exports.IDENTIFIERS_TO_REPLACE = [
|
|
359
355
|
from: { name: 'TuiCheckboxModule', moduleSpecifier: '@taiga-ui/experimental' },
|
360
356
|
to: { name: 'TuiCheckbox', moduleSpecifier: '@taiga-ui/kit' },
|
361
357
|
},
|
358
|
+
{
|
359
|
+
from: { name: 'TuiCheckboxModule', moduleSpecifier: '@taiga-ui/kit' },
|
360
|
+
to: { name: 'TuiCheckbox', moduleSpecifier: '@taiga-ui/kit' },
|
361
|
+
},
|
362
362
|
{
|
363
363
|
from: { name: 'TuiSwipeActionsModule', moduleSpecifier: '@taiga-ui/experimental' },
|
364
364
|
to: [
|
@@ -372,7 +372,7 @@ exports.IDENTIFIERS_TO_REPLACE = [
|
|
372
372
|
},
|
373
373
|
{
|
374
374
|
from: { name: 'TuiAvatarModule', moduleSpecifier: '@taiga-ui/experimental' },
|
375
|
-
to: { name: '
|
375
|
+
to: { name: 'TuiAvatar', moduleSpecifier: '@taiga-ui/kit' },
|
376
376
|
},
|
377
377
|
{
|
378
378
|
from: { name: 'TuiToggleModule', moduleSpecifier: '@taiga-ui/experimental' },
|
@@ -456,13 +456,17 @@ exports.IDENTIFIERS_TO_REPLACE = [
|
|
456
456
|
to: { name: 'TUI_SCROLL_REF', moduleSpecifier: '@taiga-ui/core' },
|
457
457
|
},
|
458
458
|
{
|
459
|
-
from: { name: 'TUI_SANITIZER', moduleSpecifier: '@taiga-ui/
|
459
|
+
from: { name: 'TUI_SANITIZER', moduleSpecifier: '@taiga-ui/core' },
|
460
460
|
to: { name: 'TUI_SANITIZER', moduleSpecifier: '@taiga-ui/legacy' },
|
461
461
|
},
|
462
462
|
{
|
463
463
|
from: { name: 'TuiScrollbarModule', moduleSpecifier: '@taiga-ui/core' },
|
464
464
|
to: { name: 'TuiScrollbar', moduleSpecifier: '@taiga-ui/core' },
|
465
465
|
},
|
466
|
+
{
|
467
|
+
from: { name: 'TuiScrollbarComponent', moduleSpecifier: '@taiga-ui/core' },
|
468
|
+
to: { name: 'TuiScrollbar', moduleSpecifier: '@taiga-ui/core' },
|
469
|
+
},
|
466
470
|
{
|
467
471
|
from: { name: 'TuiGroupModule', moduleSpecifier: '@taiga-ui/core' },
|
468
472
|
to: { name: 'TuiGroup', moduleSpecifier: '@taiga-ui/core' },
|
@@ -657,10 +661,6 @@ exports.IDENTIFIERS_TO_REPLACE = [
|
|
657
661
|
from: { name: 'TuiSvgModule', moduleSpecifier: '@taiga-ui/core' },
|
658
662
|
to: { name: 'TuiSvgComponent', moduleSpecifier: '@taiga-ui/legacy' },
|
659
663
|
},
|
660
|
-
{
|
661
|
-
from: { name: 'TuiRootModule', moduleSpecifier: '@taiga-ui/core' },
|
662
|
-
to: { name: 'TuiRoot', moduleSpecifier: '@taiga-ui/core' },
|
663
|
-
},
|
664
664
|
{
|
665
665
|
from: { name: 'TuiCellModule', moduleSpecifier: '@taiga-ui/experimental' },
|
666
666
|
to: { name: 'TuiCell', moduleSpecifier: '@taiga-ui/layout' },
|
@@ -737,13 +737,6 @@ exports.IDENTIFIERS_TO_REPLACE = [
|
|
737
737
|
moduleSpecifier: '@taiga-ui/core',
|
738
738
|
},
|
739
739
|
},
|
740
|
-
{
|
741
|
-
from: { name: 'TuiAlertModule', moduleSpecifier: '@taiga-ui/core' },
|
742
|
-
to: {
|
743
|
-
name: 'TuiAlert',
|
744
|
-
moduleSpecifier: '@taiga-ui/core',
|
745
|
-
},
|
746
|
-
},
|
747
740
|
{
|
748
741
|
from: { name: 'TuiButtonModule', moduleSpecifier: '@taiga-ui/experimental' },
|
749
742
|
to: {
|
@@ -875,16 +868,6 @@ exports.IDENTIFIERS_TO_REPLACE = [
|
|
875
868
|
moduleSpecifier: '@taiga-ui/proprietary',
|
876
869
|
},
|
877
870
|
},
|
878
|
-
{
|
879
|
-
from: {
|
880
|
-
name: 'TuiProprietaryRoot2023Module',
|
881
|
-
moduleSpecifier: '@taiga-ui/proprietary-core',
|
882
|
-
},
|
883
|
-
to: {
|
884
|
-
name: 'TuiProprietaryRoot2023Component',
|
885
|
-
moduleSpecifier: '@taiga-ui/proprietary',
|
886
|
-
},
|
887
|
-
},
|
888
871
|
{
|
889
872
|
from: {
|
890
873
|
name: 'TuiSignalModule',
|
@@ -1104,7 +1087,7 @@ exports.IDENTIFIERS_TO_REPLACE = [
|
|
1104
1087
|
},
|
1105
1088
|
to: {
|
1106
1089
|
name: 'TuiArrowComponent',
|
1107
|
-
moduleSpecifier: '@taiga-ui/
|
1090
|
+
moduleSpecifier: '@taiga-ui/legacy',
|
1108
1091
|
},
|
1109
1092
|
},
|
1110
1093
|
{
|
@@ -1167,6 +1150,16 @@ exports.IDENTIFIERS_TO_REPLACE = [
|
|
1167
1150
|
moduleSpecifier: '@taiga-ui/addon-doc',
|
1168
1151
|
},
|
1169
1152
|
},
|
1153
|
+
{
|
1154
|
+
from: {
|
1155
|
+
name: 'TuiPromptData',
|
1156
|
+
moduleSpecifier: '@taiga-ui/kit',
|
1157
|
+
},
|
1158
|
+
to: {
|
1159
|
+
name: 'TuiConfirmData',
|
1160
|
+
moduleSpecifier: '@taiga-ui/kit',
|
1161
|
+
},
|
1162
|
+
},
|
1170
1163
|
{
|
1171
1164
|
from: {
|
1172
1165
|
name: 'TuiAppBarModule',
|
@@ -1222,11 +1215,51 @@ exports.IDENTIFIERS_TO_REPLACE = [
|
|
1222
1215
|
name: 'TuiTabBarModule',
|
1223
1216
|
moduleSpecifier: '@taiga-ui/addon-mobile',
|
1224
1217
|
},
|
1218
|
+
to: {
|
1219
|
+
name: 'TuiTabBar',
|
1220
|
+
moduleSpecifier: '@taiga-ui/addon-mobile',
|
1221
|
+
},
|
1222
|
+
},
|
1223
|
+
{
|
1224
|
+
from: {
|
1225
|
+
name: 'TuiSidebarModule',
|
1226
|
+
moduleSpecifier: '@taiga-ui/addon-mobile',
|
1227
|
+
},
|
1225
1228
|
to: {
|
1226
1229
|
name: 'TuiSidebar',
|
1227
1230
|
moduleSpecifier: '@taiga-ui/addon-mobile',
|
1228
1231
|
},
|
1229
1232
|
},
|
1233
|
+
{
|
1234
|
+
from: {
|
1235
|
+
name: 'TuiProgressModule',
|
1236
|
+
moduleSpecifier: '@taiga-ui/kit',
|
1237
|
+
},
|
1238
|
+
to: {
|
1239
|
+
name: 'TuiProgress',
|
1240
|
+
moduleSpecifier: '@taiga-ui/kit',
|
1241
|
+
},
|
1242
|
+
},
|
1243
|
+
{
|
1244
|
+
from: {
|
1245
|
+
name: 'TuiRadioListModule',
|
1246
|
+
moduleSpecifier: '@taiga-ui/kit',
|
1247
|
+
},
|
1248
|
+
to: {
|
1249
|
+
name: 'TuiRadioList',
|
1250
|
+
moduleSpecifier: '@taiga-ui/kit',
|
1251
|
+
},
|
1252
|
+
},
|
1253
|
+
{
|
1254
|
+
from: {
|
1255
|
+
name: 'TuiInputFilesModule',
|
1256
|
+
moduleSpecifier: '@taiga-ui/kit',
|
1257
|
+
},
|
1258
|
+
to: {
|
1259
|
+
name: 'TuiInputFiles',
|
1260
|
+
moduleSpecifier: '@taiga-ui/kit',
|
1261
|
+
},
|
1262
|
+
},
|
1230
1263
|
{
|
1231
1264
|
from: {
|
1232
1265
|
name: 'TuiScrollIntoViewLinkModule',
|
@@ -1257,6 +1290,26 @@ exports.IDENTIFIERS_TO_REPLACE = [
|
|
1257
1290
|
moduleSpecifier: '@taiga-ui/kit',
|
1258
1291
|
},
|
1259
1292
|
},
|
1293
|
+
{
|
1294
|
+
from: {
|
1295
|
+
name: 'TuiPreviewDialogService',
|
1296
|
+
moduleSpecifier: '@taiga-ui/addon-preview',
|
1297
|
+
},
|
1298
|
+
to: {
|
1299
|
+
name: 'TuiPreviewDialogService',
|
1300
|
+
moduleSpecifier: '@taiga-ui/kit',
|
1301
|
+
},
|
1302
|
+
},
|
1303
|
+
{
|
1304
|
+
from: {
|
1305
|
+
name: 'PolymorpheusModule',
|
1306
|
+
moduleSpecifier: '@tinkoff/ng-polymorpheus',
|
1307
|
+
},
|
1308
|
+
to: [
|
1309
|
+
{ name: 'PolymorpheusTemplate', moduleSpecifier: '@taiga-ui/polymorpheus' },
|
1310
|
+
{ name: 'PolymorpheusOutlet', moduleSpecifier: '@taiga-ui/polymorpheus' },
|
1311
|
+
],
|
1312
|
+
},
|
1260
1313
|
{
|
1261
1314
|
from: {
|
1262
1315
|
name: 'tuiDefaultSort',
|
@@ -9,4 +9,5 @@ tslib_1.__exportStar(require("./identifiers-to-replace"), exports);
|
|
9
9
|
tslib_1.__exportStar(require("./inputs-to-remove"), exports);
|
10
10
|
tslib_1.__exportStar(require("./migration-warnings"), exports);
|
11
11
|
tslib_1.__exportStar(require("./modules-to-remove"), exports);
|
12
|
+
tslib_1.__exportStar(require("./services"), exports);
|
12
13
|
tslib_1.__exportStar(require("./tags-to-replace"), exports);
|
@@ -1,12 +1,13 @@
|
|
1
|
-
interface
|
1
|
+
export interface ProviderToReplace {
|
2
|
+
name: string;
|
3
|
+
providerSpecifier: string;
|
4
|
+
isFunction?: boolean;
|
5
|
+
}
|
6
|
+
export interface ModuleToReplace {
|
2
7
|
from: {
|
3
8
|
name: string;
|
4
9
|
moduleSpecifier: string;
|
5
10
|
};
|
6
|
-
to:
|
7
|
-
name: string;
|
8
|
-
providerSpecifier: string;
|
9
|
-
};
|
11
|
+
to: ProviderToReplace | ProviderToReplace[];
|
10
12
|
}
|
11
13
|
export declare const MODULES_TO_REPLACE_WITH_PROVIDERS: ModuleToReplace[];
|
12
|
-
export {};
|
@@ -0,0 +1,15 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.SERVICES_TO_REPLACE = void 0;
|
4
|
+
exports.SERVICES_TO_REPLACE = [
|
5
|
+
{
|
6
|
+
from: { name: 'TuiDialogFormService', moduleSpecifier: '@taiga-ui/kit' },
|
7
|
+
to: { name: 'TuiConfirmService', moduleSpecifier: '@taiga-ui/kit' },
|
8
|
+
replaceMethods: [
|
9
|
+
{
|
10
|
+
from: 'withPrompt',
|
11
|
+
to: 'withConfirm',
|
12
|
+
},
|
13
|
+
],
|
14
|
+
},
|
15
|
+
];
|
@@ -0,0 +1,56 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.migrateRoot = void 0;
|
4
|
+
const ng_morph_1 = require("ng-morph");
|
5
|
+
const add_unique_import_1 = require("../../../utils/add-unique-import");
|
6
|
+
const colored_log_1 = require("../../../utils/colored-log");
|
7
|
+
const get_named_import_references_1 = require("../../../utils/get-named-import-references");
|
8
|
+
const import_manipulations_1 = require("../../../utils/import-manipulations");
|
9
|
+
function migrateRoot(fileSystem, options) {
|
10
|
+
!options['skip-logs'] &&
|
11
|
+
(0, colored_log_1.infoLog)(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} updating TuiRoot`);
|
12
|
+
const refs = [
|
13
|
+
...(0, get_named_import_references_1.getNamedImportReferences)('TuiRootModule', '@taiga-ui/core'),
|
14
|
+
...(0, get_named_import_references_1.getNamedImportReferences)('TuiProprietaryRootModule', '@taiga-ui/proprietary-core'),
|
15
|
+
...(0, get_named_import_references_1.getNamedImportReferences)('TuiProprietaryRoot2023Module', '@taiga-ui/proprietary-core'),
|
16
|
+
];
|
17
|
+
for (const ref of refs) {
|
18
|
+
if (ref.wasForgotten()) {
|
19
|
+
return;
|
20
|
+
}
|
21
|
+
const parent = ref.getParent();
|
22
|
+
if (ng_morph_1.Node.isImportSpecifier(parent)) {
|
23
|
+
(0, import_manipulations_1.removeImport)(parent);
|
24
|
+
(0, add_unique_import_1.addUniqueImport)(parent.getSourceFile().getFilePath(), 'TuiRoot', '@taiga-ui/core');
|
25
|
+
}
|
26
|
+
else {
|
27
|
+
replaceRootIdentifier(ref, fileSystem);
|
28
|
+
}
|
29
|
+
}
|
30
|
+
}
|
31
|
+
exports.migrateRoot = migrateRoot;
|
32
|
+
function replaceRootIdentifier(ref, fileSystem) {
|
33
|
+
const callExpression = ref.getParentWhile(ng_morph_1.Node.isCallExpression);
|
34
|
+
if (callExpression &&
|
35
|
+
callExpression.getExpression().getText() === 'importProvidersFrom') {
|
36
|
+
ref.replaceWithText('');
|
37
|
+
addProviders(callExpression, fileSystem);
|
38
|
+
}
|
39
|
+
else {
|
40
|
+
ref.replaceWithText('TuiRoot');
|
41
|
+
}
|
42
|
+
}
|
43
|
+
function addProviders(callExpression, fileSystem) {
|
44
|
+
const array = callExpression.getParentWhile(ng_morph_1.Node.isArrayLiteralExpression);
|
45
|
+
if (!array) {
|
46
|
+
return;
|
47
|
+
}
|
48
|
+
array.addElement('NG_EVENT_PLUGINS');
|
49
|
+
(0, add_unique_import_1.addUniqueImport)(array.getSourceFile().getFilePath(), 'NG_EVENT_PLUGINS', '@taiga-ui/event-plugins');
|
50
|
+
(0, ng_morph_1.getActiveProject)();
|
51
|
+
const proprietary = (0, ng_morph_1.getPackageJsonDependency)(fileSystem.tree, '@taiga-ui/proprietary-core');
|
52
|
+
if (proprietary) {
|
53
|
+
array.addElement('TBANK_PROVIDERS');
|
54
|
+
(0, add_unique_import_1.addUniqueImport)(array.getSourceFile().getFilePath(), 'TBANK_PROVIDERS', '@taiga-ui/proprietary');
|
55
|
+
}
|
56
|
+
}
|
@@ -28,14 +28,14 @@ function migrateLabeled({ resource, recorder, fileSystem, }) {
|
|
28
28
|
'tui-radio-labeled',
|
29
29
|
]);
|
30
30
|
elements.forEach(({ sourceCodeLocation, tagName }) => {
|
31
|
-
var _a, _b, _c, _d
|
31
|
+
var _a, _b, _c, _d;
|
32
32
|
if (!sourceCodeLocation) {
|
33
33
|
return;
|
34
34
|
}
|
35
35
|
(0, add_import_to_closest_module_1.addImportToClosestModule)(resource.componentPath, tagName === 'tui-checkbox-labeled' ? 'TuiCheckbox' : 'TuiRadio', '@taiga-ui/kit');
|
36
|
-
recorder.insertRight(templateOffset + ((
|
37
|
-
recorder.insertRight(templateOffset + ((
|
38
|
-
recorder.remove(templateOffset + ((
|
36
|
+
recorder.insertRight(templateOffset + (((_a = sourceCodeLocation.startTag) === null || _a === void 0 ? void 0 : _a.startOffset) || 1) - 1, '<label tuiLabel>');
|
37
|
+
recorder.insertRight(templateOffset + (((_b = sourceCodeLocation.endTag) === null || _b === void 0 ? void 0 : _b.startOffset) || 1) - 1, '\n</label>');
|
38
|
+
recorder.remove(templateOffset + ((_d = (_c = sourceCodeLocation.endTag) === null || _c === void 0 ? void 0 : _c.startOffset) !== null && _d !== void 0 ? _d : 0), tagName === 'tui-checkbox-labeled'
|
39
39
|
? '<tui-checkbox-labeled/>'.length
|
40
40
|
: '<tui-radio-labeled/>'.length);
|
41
41
|
});
|
@@ -1,10 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.updatePackages = void 0;
|
4
|
-
const tslib_1 = require("tslib");
|
5
4
|
const ng_morph_1 = require("ng-morph");
|
6
5
|
const version_1 = require("../../../../constants/version");
|
7
|
-
const package_json_1 = tslib_1.__importDefault(require("../../../../package.json"));
|
8
6
|
const steps_1 = require("../../steps");
|
9
7
|
function updatePackages({ tree }, _) {
|
10
8
|
const packagesToRemove = ['@taiga-ui/addon-tablebars', '@taiga-ui/addon-preview'];
|
@@ -17,15 +15,21 @@ function updatePackages({ tree }, _) {
|
|
17
15
|
});
|
18
16
|
(0, steps_1.replacePackageName)('@tinkoff/ng-polymorpheus', {
|
19
17
|
name: '@taiga-ui/polymorpheus',
|
20
|
-
version:
|
18
|
+
version: '^4.6.4',
|
21
19
|
}, tree);
|
22
20
|
(0, steps_1.replacePackageName)('@tinkoff/ng-event-plugins', {
|
23
21
|
name: '@taiga-ui/event-plugins',
|
24
|
-
version:
|
22
|
+
version: '^4.0.1',
|
25
23
|
}, tree);
|
26
24
|
(0, steps_1.replacePackageName)('@tinkoff/tui-editor', {
|
27
25
|
name: '@taiga-ui/editor',
|
28
26
|
version: '^2.0.0',
|
29
27
|
}, tree);
|
28
|
+
if (!(0, ng_morph_1.getPackageJsonDependency)(tree, '@taiga-ui/event-plugins')) {
|
29
|
+
(0, ng_morph_1.addPackageJsonDependency)(tree, {
|
30
|
+
name: '@taiga-ui/event-plugins',
|
31
|
+
version: '^4.0.1',
|
32
|
+
});
|
33
|
+
}
|
30
34
|
}
|
31
35
|
exports.updatePackages = updatePackages;
|
@@ -1,13 +1,3 @@
|
|
1
1
|
import type { TuiSchema } from '../../../../ng-add/schema';
|
2
|
-
|
3
|
-
from: {
|
4
|
-
name: string;
|
5
|
-
moduleSpecifier: string;
|
6
|
-
};
|
7
|
-
to: {
|
8
|
-
name: string;
|
9
|
-
providerSpecifier: string;
|
10
|
-
};
|
11
|
-
}
|
2
|
+
import type { ModuleToReplace } from '../constants/modules-to-replace';
|
12
3
|
export declare const replaceModulesWithProviders: (options: TuiSchema, list: ModuleToReplace[]) => void;
|
13
|
-
export {};
|
@@ -16,6 +16,7 @@ const replaceModulesWithProviders = (options, list) => {
|
|
16
16
|
exports.replaceModulesWithProviders = replaceModulesWithProviders;
|
17
17
|
function replaceModule({ from, to }) {
|
18
18
|
const references = (0, get_named_import_references_1.getNamedImportReferences)(from.name, from.moduleSpecifier);
|
19
|
+
const toReplace = Array.isArray(to) ? to : [to];
|
19
20
|
references.forEach((ref) => {
|
20
21
|
if (ref.wasForgotten()) {
|
21
22
|
return;
|
@@ -23,11 +24,14 @@ function replaceModule({ from, to }) {
|
|
23
24
|
const parent = ref.getParent();
|
24
25
|
if (ng_morph_1.Node.isImportSpecifier(parent)) {
|
25
26
|
(0, import_manipulations_1.removeImport)(parent);
|
26
|
-
addImport(
|
27
|
+
toReplace.forEach((provider) => addImport(provider, parent.getSourceFile().getFilePath()));
|
27
28
|
}
|
28
29
|
else if (ng_morph_1.Node.isArrayLiteralExpression(parent)) {
|
29
|
-
parent
|
30
|
-
|
30
|
+
const index = parent
|
31
|
+
.getElements()
|
32
|
+
.findIndex((el) => el.getText() === from.name);
|
33
|
+
parent.removeElement(index);
|
34
|
+
toReplace.forEach((provider) => addProvider(provider, parent.getSourceFile().getFilePath()));
|
31
35
|
}
|
32
36
|
});
|
33
37
|
}
|
@@ -35,7 +39,7 @@ function addImport(identifier, filePath) {
|
|
35
39
|
(0, add_unique_import_1.addUniqueImport)(filePath, identifier.name, identifier.providerSpecifier);
|
36
40
|
}
|
37
41
|
function addProvider(identifier, filePath) {
|
38
|
-
const provider = `${identifier.name}()`;
|
42
|
+
const provider = `${identifier.name}${identifier.isFunction ? '()' : ''}`;
|
39
43
|
const componentClass = (0, ng_morph_1.getNgComponents)(filePath)[0];
|
40
44
|
if (componentClass) {
|
41
45
|
(0, ng_morph_1.addProviderToComponent)(componentClass, provider);
|