@taiga-ui/cdk 2.47.0 → 2.49.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/abstract/controller.d.ts +6 -0
- package/abstract/taiga-ui-cdk-abstract.metadata.json +1 -1
- package/bundles/taiga-ui-cdk-abstract.umd.js +12 -0
- package/bundles/taiga-ui-cdk-abstract.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-abstract.umd.min.js +1 -1
- package/bundles/taiga-ui-cdk-abstract.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-classes.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-classes.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-components-alert-host.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-components-alert-host.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-constants.umd.js +29 -2
- package/bundles/taiga-ui-cdk-constants.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-constants.umd.min.js +1 -1
- package/bundles/taiga-ui-cdk-constants.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js +96 -35
- package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-auto-focus.umd.min.js +1 -1
- package/bundles/taiga-ui-cdk-directives-auto-focus.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-for-async.umd.js +5 -4
- package/bundles/taiga-ui-cdk-directives-for-async.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-for-async.umd.min.js +1 -1
- package/bundles/taiga-ui-cdk-directives-for-async.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-let.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-let.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-enums.umd.js +12 -0
- package/bundles/taiga-ui-cdk-enums.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-enums.umd.min.js +1 -1
- package/bundles/taiga-ui-cdk-enums.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-observables.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-observables.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-tokens.umd.js +18 -0
- package/bundles/taiga-ui-cdk-tokens.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-tokens.umd.min.js +1 -1
- package/bundles/taiga-ui-cdk-tokens.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-browser.umd.js +2 -2
- package/bundles/taiga-ui-cdk-utils-browser.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-browser.umd.min.js +1 -1
- package/bundles/taiga-ui-cdk-utils-browser.umd.min.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-focus.umd.js +1 -1
- package/bundles/taiga-ui-cdk-utils-focus.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-focus.umd.min.js +1 -1
- package/bundles/taiga-ui-cdk-utils-focus.umd.min.js.map +1 -1
- package/classes/validation-error.d.ts +1 -1
- package/components/alert-host/alert-host.component.d.ts +1 -1
- package/constants/stringify.d.ts +1 -1
- package/constants/taiga-ui-cdk-constants.metadata.json +1 -1
- package/constants/unicode-chars.d.ts +25 -1
- package/directives/auto-focus/autofocus.options.d.ts +1 -1
- package/directives/auto-focus/handlers/ios.handler.d.ts +26 -1
- package/directives/auto-focus/taiga-ui-cdk-directives-auto-focus.metadata.json +1 -1
- package/directives/let/let.directive.d.ts +1 -1
- package/enums/autocomplete.d.ts +10 -0
- package/enums/taiga-ui-cdk-enums.metadata.json +1 -1
- package/esm2015/abstract/controller.js +7 -1
- package/esm2015/classes/validation-error.js +1 -1
- package/esm2015/components/alert-host/alert-host.component.js +1 -1
- package/esm2015/constants/stringify.js +1 -1
- package/esm2015/constants/unicode-chars.js +27 -3
- package/esm2015/directives/auto-focus/autofocus.options.js +7 -6
- package/esm2015/directives/auto-focus/handlers/ios.handler.js +80 -29
- package/esm2015/directives/for-async/for-async.directive.js +5 -5
- package/esm2015/directives/let/let.directive.js +1 -1
- package/esm2015/enums/autocomplete.js +12 -1
- package/esm2015/observables/is-alive.js +1 -1
- package/esm2015/tokens/index.js +4 -1
- package/esm2015/tokens/is-chromium.js +6 -0
- package/esm2015/tokens/is-firefox.js +9 -0
- package/esm2015/tokens/is-webkit.js +6 -0
- package/esm2015/utils/browser/is-edge-older-than.js +2 -2
- package/esm2015/utils/browser/is-safari.js +2 -2
- package/esm2015/utils/focus/get-native-focused.js +2 -2
- package/esm5/abstract/controller.js +14 -1
- package/esm5/classes/validation-error.js +1 -1
- package/esm5/components/alert-host/alert-host.component.js +1 -1
- package/esm5/constants/stringify.js +1 -1
- package/esm5/constants/unicode-chars.js +27 -3
- package/esm5/directives/auto-focus/autofocus.options.js +7 -6
- package/esm5/directives/auto-focus/handlers/ios.handler.js +92 -30
- package/esm5/directives/for-async/for-async.directive.js +7 -6
- package/esm5/directives/let/let.directive.js +1 -1
- package/esm5/enums/autocomplete.js +12 -1
- package/esm5/observables/is-alive.js +1 -1
- package/esm5/tokens/index.js +4 -1
- package/esm5/tokens/is-chromium.js +6 -0
- package/esm5/tokens/is-firefox.js +9 -0
- package/esm5/tokens/is-webkit.js +6 -0
- package/esm5/utils/browser/is-edge-older-than.js +2 -2
- package/esm5/utils/browser/is-safari.js +2 -2
- package/esm5/utils/focus/get-native-focused.js +2 -2
- package/fesm2015/taiga-ui-cdk-abstract.js +7 -1
- package/fesm2015/taiga-ui-cdk-abstract.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-classes.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-components-alert-host.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-constants.js +27 -3
- package/fesm2015/taiga-ui-cdk-constants.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-directives-auto-focus.js +84 -33
- package/fesm2015/taiga-ui-cdk-directives-auto-focus.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-directives-for-async.js +4 -4
- package/fesm2015/taiga-ui-cdk-directives-for-async.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-directives-let.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-enums.js +11 -0
- package/fesm2015/taiga-ui-cdk-enums.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-observables.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-tokens.js +16 -1
- package/fesm2015/taiga-ui-cdk-tokens.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-browser.js +2 -2
- package/fesm2015/taiga-ui-cdk-utils-browser.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-focus.js +1 -1
- package/fesm2015/taiga-ui-cdk-utils-focus.js.map +1 -1
- package/fesm5/taiga-ui-cdk-abstract.js +12 -1
- package/fesm5/taiga-ui-cdk-abstract.js.map +1 -1
- package/fesm5/taiga-ui-cdk-classes.js.map +1 -1
- package/fesm5/taiga-ui-cdk-components-alert-host.js.map +1 -1
- package/fesm5/taiga-ui-cdk-constants.js +27 -3
- package/fesm5/taiga-ui-cdk-constants.js.map +1 -1
- package/fesm5/taiga-ui-cdk-directives-auto-focus.js +96 -34
- package/fesm5/taiga-ui-cdk-directives-auto-focus.js.map +1 -1
- package/fesm5/taiga-ui-cdk-directives-for-async.js +6 -5
- package/fesm5/taiga-ui-cdk-directives-for-async.js.map +1 -1
- package/fesm5/taiga-ui-cdk-directives-let.js.map +1 -1
- package/fesm5/taiga-ui-cdk-enums.js +11 -0
- package/fesm5/taiga-ui-cdk-enums.js.map +1 -1
- package/fesm5/taiga-ui-cdk-observables.js.map +1 -1
- package/fesm5/taiga-ui-cdk-tokens.js +16 -1
- package/fesm5/taiga-ui-cdk-tokens.js.map +1 -1
- package/fesm5/taiga-ui-cdk-utils-browser.js +2 -2
- package/fesm5/taiga-ui-cdk-utils-browser.js.map +1 -1
- package/fesm5/taiga-ui-cdk-utils-focus.js +1 -1
- package/fesm5/taiga-ui-cdk-utils-focus.js.map +1 -1
- package/observables/is-alive.d.ts +1 -1
- package/package.json +1 -1
- package/schematics/ng-update/constants/consts.js +49 -0
- package/schematics/ng-update/constants/enums.js +22 -0
- package/schematics/ng-update/constants/modules.d.ts +6 -0
- package/schematics/ng-update/constants/modules.js +5 -0
- package/schematics/ng-update/constants/services.d.ts +8 -0
- package/schematics/ng-update/constants/services.js +43 -0
- package/schematics/ng-update/constants/templates.d.ts +27 -0
- package/schematics/ng-update/constants/templates.js +74 -0
- package/schematics/ng-update/constants/tui-interactive-selectors.d.ts +1 -0
- package/schematics/ng-update/constants/tui-interactive-selectors.js +54 -0
- package/schematics/ng-update/constants/types.d.ts +1 -0
- package/schematics/ng-update/constants/types.js +34 -0
- package/schematics/ng-update/constants/warnings.js +72 -0
- package/schematics/ng-update/index.js +8 -0
- package/schematics/ng-update/interfaces/template-resourse.d.ts +8 -0
- package/schematics/ng-update/interfaces/template-resourse.js +2 -0
- package/schematics/ng-update/steps/migrate-sliders/index.d.ts +2 -0
- package/schematics/ng-update/steps/migrate-sliders/index.js +7 -0
- package/schematics/ng-update/steps/migrate-sliders/migrate-input-slider.d.ts +2 -0
- package/schematics/ng-update/steps/migrate-sliders/migrate-input-slider.js +24 -0
- package/schematics/ng-update/steps/migrate-templates.d.ts +2 -0
- package/schematics/ng-update/steps/migrate-templates.js +67 -0
- package/schematics/ng-update/steps/remove-module.d.ts +2 -0
- package/schematics/ng-update/steps/remove-module.js +24 -0
- package/schematics/ng-update/steps/rename-types.js +26 -17
- package/schematics/ng-update/steps/replace-const.js +4 -4
- package/schematics/ng-update/steps/replace-enums.js +2 -2
- package/schematics/ng-update/steps/replace-services.d.ts +1 -0
- package/schematics/ng-update/steps/replace-services.js +51 -0
- package/schematics/ng-update/steps/show-warnings.js +26 -9
- package/schematics/utils/add-unique-import.js +1 -1
- package/schematics/utils/angular/ng-component.d.ts +3 -0
- package/schematics/utils/angular/ng-component.js +7 -0
- package/schematics/utils/angular/ng-module.d.ts +7 -0
- package/schematics/utils/angular/ng-module.js +21 -0
- package/schematics/utils/{remove-import.d.ts → import-manipulations.d.ts} +1 -0
- package/schematics/utils/import-manipulations.js +19 -0
- package/schematics/utils/templates/elements.d.ts +19 -0
- package/schematics/utils/templates/elements.js +76 -0
- package/schematics/utils/templates/get-component-templates.d.ts +4 -0
- package/schematics/utils/templates/get-component-templates.js +36 -0
- package/schematics/utils/templates/ng-component-input-manipulations.d.ts +45 -0
- package/schematics/utils/templates/ng-component-input-manipulations.js +83 -0
- package/schematics/utils/templates/template-resource.d.ts +5 -0
- package/schematics/utils/templates/template-resource.js +21 -0
- package/tokens/index.d.ts +3 -0
- package/tokens/is-chromium.d.ts +2 -0
- package/tokens/is-firefox.d.ts +2 -0
- package/tokens/is-webkit.d.ts +2 -0
- package/tokens/taiga-ui-cdk-tokens.metadata.json +1 -1
- package/schematics/utils/remove-import.js +0 -11
|
@@ -2,8 +2,8 @@ function isEdge(userAgent) {
|
|
|
2
2
|
return userAgent.toLowerCase().includes('edge');
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
+
var EDGE = 'edge/';
|
|
5
6
|
function isEdgeOlderThan(version, userAgent) {
|
|
6
|
-
var EDGE = 'edge/';
|
|
7
7
|
var currentVersion = parseInt(userAgent.slice(userAgent.toLowerCase().indexOf(EDGE) + EDGE.length), 10);
|
|
8
8
|
return currentVersion < version;
|
|
9
9
|
}
|
|
@@ -18,7 +18,7 @@ function isIE(userAgent) {
|
|
|
18
18
|
|
|
19
19
|
function isSafari(element) {
|
|
20
20
|
var documentRef = element.ownerDocument;
|
|
21
|
-
var windowRef = documentRef
|
|
21
|
+
var windowRef = documentRef === null || documentRef === void 0 ? void 0 : documentRef.defaultView;
|
|
22
22
|
return !!windowRef && 'safari' in windowRef;
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-cdk-utils-browser.js","sources":["ng://@taiga-ui/cdk/utils/browser/is-edge.ts","ng://@taiga-ui/cdk/utils/browser/is-edge-older-than.ts","ng://@taiga-ui/cdk/utils/browser/is-firefox.ts","ng://@taiga-ui/cdk/utils/browser/is-ie.ts","ng://@taiga-ui/cdk/utils/browser/is-safari.ts","ng://@taiga-ui/cdk/utils/browser/taiga-ui-cdk-utils-browser.ts"],"sourcesContent":["export function isEdge(userAgent: string): boolean {\n return userAgent.toLowerCase().includes('edge');\n}\n","
|
|
1
|
+
{"version":3,"file":"taiga-ui-cdk-utils-browser.js","sources":["ng://@taiga-ui/cdk/utils/browser/is-edge.ts","ng://@taiga-ui/cdk/utils/browser/is-edge-older-than.ts","ng://@taiga-ui/cdk/utils/browser/is-firefox.ts","ng://@taiga-ui/cdk/utils/browser/is-ie.ts","ng://@taiga-ui/cdk/utils/browser/is-safari.ts","ng://@taiga-ui/cdk/utils/browser/taiga-ui-cdk-utils-browser.ts"],"sourcesContent":["export function isEdge(userAgent: string): boolean {\n return userAgent.toLowerCase().includes('edge');\n}\n","const EDGE = 'edge/';\n\nexport function isEdgeOlderThan(version: number, userAgent: string): boolean {\n const currentVersion = parseInt(\n userAgent.slice(userAgent.toLowerCase().indexOf(EDGE) + EDGE.length),\n 10,\n );\n\n return currentVersion < version;\n}\n","export function isFirefox(userAgent: string): boolean {\n return userAgent.toLowerCase().includes('firefox');\n}\n","export function isIE(userAgent: string): boolean {\n return userAgent.toLowerCase().includes('trident');\n}\n","export function isSafari(element: Element): boolean {\n const documentRef = element.ownerDocument;\n const windowRef = documentRef?.defaultView;\n\n return !!windowRef && 'safari' in windowRef;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"SAAgB,MAAM,CAAC,SAAiB;IACpC,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AACpD;;ACFA,IAAM,IAAI,GAAG,OAAO,CAAC;SAEL,eAAe,CAAC,OAAe,EAAE,SAAiB;IAC9D,IAAM,cAAc,GAAG,QAAQ,CAC3B,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,EACpE,EAAE,CACL,CAAC;IAEF,OAAO,cAAc,GAAG,OAAO,CAAC;AACpC;;SCTgB,SAAS,CAAC,SAAiB;IACvC,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AACvD;;SCFgB,IAAI,CAAC,SAAiB;IAClC,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AACvD;;SCFgB,QAAQ,CAAC,OAAgB;IACrC,IAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;IAC1C,IAAM,SAAS,GAAG,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,WAAW,CAAC;IAE3C,OAAO,CAAC,CAAC,SAAS,IAAI,QAAQ,IAAI,SAAS,CAAC;AAChD;;ACLA;;;;;;"}
|
|
@@ -10,7 +10,7 @@ function getNativeFocused(documentRef) {
|
|
|
10
10
|
return documentRef.activeElement;
|
|
11
11
|
}
|
|
12
12
|
var element = documentRef.activeElement.shadowRoot.activeElement;
|
|
13
|
-
while (element
|
|
13
|
+
while (element === null || element === void 0 ? void 0 : element.shadowRoot) {
|
|
14
14
|
element = element.shadowRoot.activeElement;
|
|
15
15
|
}
|
|
16
16
|
return element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-cdk-utils-focus.js","sources":["ng://@taiga-ui/cdk/utils/focus/get-native-focused.ts","ng://@taiga-ui/cdk/utils/focus/set-native-focused.ts","ng://@taiga-ui/cdk/utils/focus/blur-native-focused.ts","ng://@taiga-ui/cdk/utils/focus/is-native-keyboard-focusable.ts","ng://@taiga-ui/cdk/utils/focus/is-native-mouse-focusable.ts","ng://@taiga-ui/cdk/utils/focus/get-closest-keyboard-focusable.ts","ng://@taiga-ui/cdk/utils/focus/is-native-focused.ts","ng://@taiga-ui/cdk/utils/focus/is-native-focused-in.ts","ng://@taiga-ui/cdk/utils/focus/move-focus.ts","ng://@taiga-ui/cdk/utils/focus/set-native-mouse-focused.ts","ng://@taiga-ui/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 getNativeFocused(documentRef: Document): Element | null {\n if (!documentRef.activeElement || !documentRef.activeElement.shadowRoot) {\n return documentRef.activeElement;\n }\n\n let element = documentRef.activeElement.shadowRoot.activeElement;\n\n while (element && element.shadowRoot) {\n element = element.shadowRoot.activeElement;\n }\n\n return element;\n}\n","/**\n * @deprecated: use native element.focus()\n * TODO: remove in v3.0\n * Focuses or blurs and element\n *\n * @param element native element\n * @param focused boolean focused state\n * @param preventScroll optional flag to prevent native scroll to the element\n */\nexport function setNativeFocused(\n element: HTMLOrSVGElement,\n focused: boolean = true,\n preventScroll: boolean = false,\n): void {\n if (focused) {\n element.focus({preventScroll});\n } else {\n element.blur();\n }\n}\n","import {getNativeFocused} from './get-native-focused';\nimport {setNativeFocused} from './set-native-focused';\n\n/**\n * Finds and blurs current active element, including shadow DOM\n */\nexport function blurNativeFocused(documentRef: Document): void {\n const activeElement = getNativeFocused(documentRef);\n\n // TODO: iframe warning\n if (activeElement instanceof HTMLElement) {\n setNativeFocused(activeElement, false);\n }\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 isNativeKeyboardFocusable(element: Element): boolean {\n if (element.hasAttribute('disabled') || element.getAttribute('tabIndex') === '-1') {\n return false;\n }\n\n // TODO: iframe warning\n if (\n (element instanceof HTMLElement && 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 {isNativeKeyboardFocusable} from './is-native-keyboard-focusable';\n\nexport function isNativeMouseFocusable(element: Element): boolean {\n return (\n !element.hasAttribute('disabled') &&\n (element.getAttribute('tabIndex') === '-1' || isNativeKeyboardFocusable(element))\n );\n}\n","import {svgNodeFilter} from '@taiga-ui/cdk/constants';\n\nimport {isNativeKeyboardFocusable} from './is-native-keyboard-focusable';\nimport {isNativeMouseFocusable} from './is-native-mouse-focusable';\n\n/**\n * Finds the closest element that can be focused with a keyboard or mouse in theory\n *\n * @param initial current HTML element\n * @param prev should it look backwards instead (find item that will be focused with Shift + Tab)\n * @param root top Node limiting the search area\n * @param keyboard determine if only keyboard focus is of interest\n *\n */\nexport function getClosestFocusable(\n initial: HTMLElement,\n prev: boolean = false,\n root: Node,\n keyboard: boolean = true,\n): HTMLElement | null {\n if (!root.ownerDocument) {\n return null;\n }\n\n const check = keyboard ? isNativeKeyboardFocusable : isNativeMouseFocusable;\n\n // Deprecated but ony this overload works in IE\n // Filter must be a function in IE, other modern browsers are compliant to this format\n const treeWalker = root.ownerDocument.createTreeWalker(\n root,\n NodeFilter.SHOW_ELEMENT,\n svgNodeFilter,\n false,\n );\n\n treeWalker.currentNode = initial;\n\n while (prev ? treeWalker.previousNode() : treeWalker.nextNode()) {\n // TODO: iframe warning\n if (treeWalker.currentNode instanceof HTMLElement) {\n initial = treeWalker.currentNode;\n }\n\n if (check(initial)) {\n return initial;\n }\n }\n\n return null;\n}\n\n/** @deprecated use getClosestFocusable */\nexport const getClosestKeyboardFocusable = getClosestFocusable;\n","import {getNativeFocused} 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 isNativeFocused(node: Node | null): boolean {\n return (\n !!node && !!node.ownerDocument && getNativeFocused(node.ownerDocument) === node\n );\n}\n","import {getNativeFocused} 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 isNativeFocusedIn(node: Node): boolean {\n // !node.contains - check for IE11\n if (!node.ownerDocument || !node.contains) {\n return false;\n }\n\n const nativeFocused = getNativeFocused(node.ownerDocument);\n\n return nativeFocused !== null && node.contains(nativeFocused);\n}\n","import {isNativeFocused} from './is-native-focused';\nimport {setNativeFocused} from './set-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 moveFocus(\n currentIndex: number,\n elements: readonly HTMLElement[],\n step: number,\n): void {\n currentIndex += step;\n\n while (currentIndex >= 0 && currentIndex < elements.length) {\n setNativeFocused(elements[currentIndex]);\n\n if (isNativeFocused(elements[currentIndex])) {\n return;\n }\n\n currentIndex += step;\n }\n}\n","import {setNativeFocused} from './set-native-focused';\n\n/**\n * Focuses or blurs element with mouse action imitation (to spoof {@link TuiFocusVisibleService})\n *\n * @param element\n * @param focused desired focused state\n * @param preventScroll optionally prevent native browser scroll after focus\n */\nexport function setNativeMouseFocused(\n element: HTMLOrSVGElement & Element,\n focused: boolean = true,\n preventScroll: boolean = false,\n): void {\n if (!element.ownerDocument) {\n return;\n }\n\n if (typeof Event === 'function') {\n element.dispatchEvent(new Event('mousedown', {bubbles: true, cancelable: true}));\n } else {\n const event = element.ownerDocument.createEvent('Event');\n\n event.initEvent('mousedown', true, true);\n element.dispatchEvent(event);\n }\n\n setNativeFocused(element, focused, preventScroll);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAAA;;;;;SAKgB,gBAAgB,CAAC,WAAqB;IAClD,IAAI,CAAC,WAAW,CAAC,aAAa,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,UAAU,E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WAAW,CAAC,OAAO,CAAC,CAAC;QAEzD,OAAK,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QACzC,OAAO,CAAC,aAAa,CAAC,OAAK,CAAC,CAAC;KAChC;IAED,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC;AACtD;;AC5BA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-cdk-utils-focus.js","sources":["ng://@taiga-ui/cdk/utils/focus/get-native-focused.ts","ng://@taiga-ui/cdk/utils/focus/set-native-focused.ts","ng://@taiga-ui/cdk/utils/focus/blur-native-focused.ts","ng://@taiga-ui/cdk/utils/focus/is-native-keyboard-focusable.ts","ng://@taiga-ui/cdk/utils/focus/is-native-mouse-focusable.ts","ng://@taiga-ui/cdk/utils/focus/get-closest-keyboard-focusable.ts","ng://@taiga-ui/cdk/utils/focus/is-native-focused.ts","ng://@taiga-ui/cdk/utils/focus/is-native-focused-in.ts","ng://@taiga-ui/cdk/utils/focus/move-focus.ts","ng://@taiga-ui/cdk/utils/focus/set-native-mouse-focused.ts","ng://@taiga-ui/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 getNativeFocused(documentRef: Document): Element | null {\n if (!documentRef.activeElement || !documentRef.activeElement.shadowRoot) {\n return documentRef.activeElement;\n }\n\n let element = documentRef.activeElement.shadowRoot.activeElement;\n\n while (element?.shadowRoot) {\n element = element.shadowRoot.activeElement;\n }\n\n return element;\n}\n","/**\n * @deprecated: use native element.focus()\n * TODO: remove in v3.0\n * Focuses or blurs and element\n *\n * @param element native element\n * @param focused boolean focused state\n * @param preventScroll optional flag to prevent native scroll to the element\n */\nexport function setNativeFocused(\n element: HTMLOrSVGElement,\n focused: boolean = true,\n preventScroll: boolean = false,\n): void {\n if (focused) {\n element.focus({preventScroll});\n } else {\n element.blur();\n }\n}\n","import {getNativeFocused} from './get-native-focused';\nimport {setNativeFocused} from './set-native-focused';\n\n/**\n * Finds and blurs current active element, including shadow DOM\n */\nexport function blurNativeFocused(documentRef: Document): void {\n const activeElement = getNativeFocused(documentRef);\n\n // TODO: iframe warning\n if (activeElement instanceof HTMLElement) {\n setNativeFocused(activeElement, false);\n }\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 isNativeKeyboardFocusable(element: Element): boolean {\n if (element.hasAttribute('disabled') || element.getAttribute('tabIndex') === '-1') {\n return false;\n }\n\n // TODO: iframe warning\n if (\n (element instanceof HTMLElement && 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 {isNativeKeyboardFocusable} from './is-native-keyboard-focusable';\n\nexport function isNativeMouseFocusable(element: Element): boolean {\n return (\n !element.hasAttribute('disabled') &&\n (element.getAttribute('tabIndex') === '-1' || isNativeKeyboardFocusable(element))\n );\n}\n","import {svgNodeFilter} from '@taiga-ui/cdk/constants';\n\nimport {isNativeKeyboardFocusable} from './is-native-keyboard-focusable';\nimport {isNativeMouseFocusable} from './is-native-mouse-focusable';\n\n/**\n * Finds the closest element that can be focused with a keyboard or mouse in theory\n *\n * @param initial current HTML element\n * @param prev should it look backwards instead (find item that will be focused with Shift + Tab)\n * @param root top Node limiting the search area\n * @param keyboard determine if only keyboard focus is of interest\n *\n */\nexport function getClosestFocusable(\n initial: HTMLElement,\n prev: boolean = false,\n root: Node,\n keyboard: boolean = true,\n): HTMLElement | null {\n if (!root.ownerDocument) {\n return null;\n }\n\n const check = keyboard ? isNativeKeyboardFocusable : isNativeMouseFocusable;\n\n // Deprecated but ony this overload works in IE\n // Filter must be a function in IE, other modern browsers are compliant to this format\n const treeWalker = root.ownerDocument.createTreeWalker(\n root,\n NodeFilter.SHOW_ELEMENT,\n svgNodeFilter,\n false,\n );\n\n treeWalker.currentNode = initial;\n\n while (prev ? treeWalker.previousNode() : treeWalker.nextNode()) {\n // TODO: iframe warning\n if (treeWalker.currentNode instanceof HTMLElement) {\n initial = treeWalker.currentNode;\n }\n\n if (check(initial)) {\n return initial;\n }\n }\n\n return null;\n}\n\n/** @deprecated use getClosestFocusable */\nexport const getClosestKeyboardFocusable = getClosestFocusable;\n","import {getNativeFocused} 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 isNativeFocused(node: Node | null): boolean {\n return (\n !!node && !!node.ownerDocument && getNativeFocused(node.ownerDocument) === node\n );\n}\n","import {getNativeFocused} 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 isNativeFocusedIn(node: Node): boolean {\n // !node.contains - check for IE11\n if (!node.ownerDocument || !node.contains) {\n return false;\n }\n\n const nativeFocused = getNativeFocused(node.ownerDocument);\n\n return nativeFocused !== null && node.contains(nativeFocused);\n}\n","import {isNativeFocused} from './is-native-focused';\nimport {setNativeFocused} from './set-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 moveFocus(\n currentIndex: number,\n elements: readonly HTMLElement[],\n step: number,\n): void {\n currentIndex += step;\n\n while (currentIndex >= 0 && currentIndex < elements.length) {\n setNativeFocused(elements[currentIndex]);\n\n if (isNativeFocused(elements[currentIndex])) {\n return;\n }\n\n currentIndex += step;\n }\n}\n","import {setNativeFocused} from './set-native-focused';\n\n/**\n * Focuses or blurs element with mouse action imitation (to spoof {@link TuiFocusVisibleService})\n *\n * @param element\n * @param focused desired focused state\n * @param preventScroll optionally prevent native browser scroll after focus\n */\nexport function setNativeMouseFocused(\n element: HTMLOrSVGElement & Element,\n focused: boolean = true,\n preventScroll: boolean = false,\n): void {\n if (!element.ownerDocument) {\n return;\n }\n\n if (typeof Event === 'function') {\n element.dispatchEvent(new Event('mousedown', {bubbles: true, cancelable: true}));\n } else {\n const event = element.ownerDocument.createEvent('Event');\n\n event.initEvent('mousedown', true, true);\n element.dispatchEvent(event);\n }\n\n setNativeFocused(element, focused, preventScroll);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAAA;;;;;SAKgB,gBAAgB,CAAC,WAAqB;IAClD,IAAI,CAAC,WAAW,CAAC,aAAa,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,UAAU,EAAE;QACrE,OAAO,WAAW,CAAC,aAAa,CAAC;KACpC;IAED,IAAI,OAAO,GAAG,WAAW,CAAC,aAAa,CAAC,UAAU,CAAC,aAAa,CAAC;IAEjE,OAAO,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,EAAE;QACxB,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC;KAC9C;IAED,OAAO,OAAO,CAAC;AACnB;;ACjBA;;;;;;;;;SASgB,gBAAgB,CAC5B,OAAyB,EACzB,OAAuB,EACvB,aAA8B;IAD9B,wBAAA,EAAA,cAAuB;IACvB,8BAAA,EAAA,qBAA8B;IAE9B,IAAI,OAAO,EAAE;QACT,OAAO,CAAC,KAAK,CAAC,EAAC,aAAa,eAAA,EAAC,CAAC,CAAC;KAClC;SAAM;QACH,OAAO,CAAC,IAAI,EAAE,CAAC;KAClB;AACL;;AChBA;;;SAGgB,iBAAiB,CAAC,WAAqB;IACnD,IAAM,aAAa,GAAG,gBAAgB,CAAC,WAAW,CAAC,CAAC;;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AAE;QACxD,gBAAgB,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC;QAEzC,IAAI,eAAe,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE;YACzC,OAAO;SACV;QAED,YAAY,IAAI,IAAI,CAAC;KACxB;AACL;;ACxBA;;;;;;;SAOgB,qBAAqB,CACjC,OAAmC,EACnC,OAAuB,EACvB,aAA8B;IAD9B,wBAAA,EAAA,cAAuB;IACvB,8BAAA,EAAA,qBAA8B;IAE9B,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE;QACxB,OAAO;KACV;IAED,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE;QAC7B,OAAO,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,WAAW,EAAE,EAAC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAC,CAAC,CAAC,CAAC;KACpF;SAAM;QACH,IAAM,OAAK,GAAG,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAEzD,OAAK,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QACzC,OAAO,CAAC,aAAa,CAAC,OAAK,CAAC,CAAC;KAChC;IAED,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC;AACtD;;AC5BA;;;;;;"}
|
|
@@ -2,4 +2,4 @@ import { OperatorFunction } from 'rxjs';
|
|
|
2
2
|
/**
|
|
3
3
|
* Operator to set lifespan after which current value is considered obsolete
|
|
4
4
|
*/
|
|
5
|
-
export declare function tuiIsAlive(lifespan?: number): OperatorFunction<
|
|
5
|
+
export declare function tuiIsAlive(lifespan?: number): OperatorFunction<unknown, boolean>;
|
package/package.json
CHANGED
|
@@ -42,4 +42,53 @@ exports.CONSTS_TO_REPLACE = [
|
|
|
42
42
|
moduleSpecifier: '@taiga-ui/cdk',
|
|
43
43
|
},
|
|
44
44
|
},
|
|
45
|
+
{
|
|
46
|
+
from: {
|
|
47
|
+
name: 'TuiNotificationsModule',
|
|
48
|
+
moduleSpecifier: '@taiga-ui/core',
|
|
49
|
+
},
|
|
50
|
+
to: {
|
|
51
|
+
name: 'TuiAlertModule',
|
|
52
|
+
moduleSpecifier: '@taiga-ui/core',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
from: { name: 'identity', moduleSpecifier: '@taiga-ui/cdk' },
|
|
57
|
+
to: { name: 'identity', moduleSpecifier: 'rxjs' },
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
from: { name: 'TUI_SANITIZER', moduleSpecifier: '@taiga-ui/cdk' },
|
|
61
|
+
to: { name: 'TUI_SANITIZER', moduleSpecifier: '@taiga-ui/core' },
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
from: {
|
|
65
|
+
name: 'TuiCountryIsoCode',
|
|
66
|
+
moduleSpecifier: '@taiga-ui/kit',
|
|
67
|
+
},
|
|
68
|
+
to: {
|
|
69
|
+
name: 'TuiCountryIsoCode',
|
|
70
|
+
moduleSpecifier: '@taiga-ui/i18n',
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
from: {
|
|
75
|
+
name: 'TableComands',
|
|
76
|
+
moduleSpecifier: '@taiga-ui/addon-editor',
|
|
77
|
+
},
|
|
78
|
+
to: {
|
|
79
|
+
name: 'TuiTableCommands',
|
|
80
|
+
moduleSpecifier: '@taiga-ui/addon-editor',
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
from: {
|
|
85
|
+
name: 'TuiController',
|
|
86
|
+
moduleSpecifier: '@taiga-ui/cdk',
|
|
87
|
+
},
|
|
88
|
+
to: {
|
|
89
|
+
name: 'AbstractTuiController',
|
|
90
|
+
moduleSpecifier: '@taiga-ui/cdk',
|
|
91
|
+
namedImport: 'AbstractTuiController',
|
|
92
|
+
},
|
|
93
|
+
},
|
|
45
94
|
];
|
|
@@ -56,6 +56,19 @@ exports.ENUMS_TO_REPLACE = [
|
|
|
56
56
|
None: 'none',
|
|
57
57
|
},
|
|
58
58
|
},
|
|
59
|
+
{
|
|
60
|
+
name: 'TuiInputMode',
|
|
61
|
+
replaceValues: {
|
|
62
|
+
None: 'none',
|
|
63
|
+
Text: 'text',
|
|
64
|
+
Decimal: 'decimal',
|
|
65
|
+
Numeric: 'numeric',
|
|
66
|
+
Tel: 'tel',
|
|
67
|
+
Email: 'email',
|
|
68
|
+
Url: 'url',
|
|
69
|
+
Search: 'search',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
59
72
|
{
|
|
60
73
|
name: 'TuiStepState',
|
|
61
74
|
replaceValues: {
|
|
@@ -171,4 +184,13 @@ exports.ENUMS_TO_REPLACE = [
|
|
|
171
184
|
},
|
|
172
185
|
keepAsType: false,
|
|
173
186
|
},
|
|
187
|
+
{
|
|
188
|
+
name: 'TuiTouchMode',
|
|
189
|
+
replaceValues: {
|
|
190
|
+
Transform: 'transform',
|
|
191
|
+
Opacity: 'opacity',
|
|
192
|
+
Background: 'background',
|
|
193
|
+
},
|
|
194
|
+
keepAsType: true,
|
|
195
|
+
},
|
|
174
196
|
];
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SERVICES_TO_REPLACE = [
|
|
4
|
+
{
|
|
5
|
+
from: {
|
|
6
|
+
name: 'TuiPortalService',
|
|
7
|
+
},
|
|
8
|
+
to: {
|
|
9
|
+
name: 'TuiDropdownPortalService',
|
|
10
|
+
moduleSpecifier: '@taiga-ui/cdk',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
from: {
|
|
15
|
+
name: 'TuiNotificationsService',
|
|
16
|
+
},
|
|
17
|
+
to: {
|
|
18
|
+
name: 'TuiAlertService',
|
|
19
|
+
moduleSpecifier: '@taiga-ui/cdk',
|
|
20
|
+
},
|
|
21
|
+
replaceMethods: [
|
|
22
|
+
{
|
|
23
|
+
from: 'show',
|
|
24
|
+
to: 'open',
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
from: {
|
|
30
|
+
name: 'TuiCodeEditor',
|
|
31
|
+
},
|
|
32
|
+
to: {
|
|
33
|
+
name: 'TuiCodeEditor',
|
|
34
|
+
moduleSpecifier: '@taiga-ui/addon-doc',
|
|
35
|
+
},
|
|
36
|
+
replaceMethods: [
|
|
37
|
+
{
|
|
38
|
+
from: 'open',
|
|
39
|
+
to: 'edit',
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface ReplacementAttributes {
|
|
2
|
+
readonly from: {
|
|
3
|
+
readonly attrName: string;
|
|
4
|
+
readonly withTagNames?: string[];
|
|
5
|
+
readonly withAttrsNames?: string[];
|
|
6
|
+
};
|
|
7
|
+
readonly to: {
|
|
8
|
+
readonly attrName: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export interface ReplacementTags {
|
|
12
|
+
readonly from: string;
|
|
13
|
+
readonly to: string;
|
|
14
|
+
readonly addAttributes: string[];
|
|
15
|
+
}
|
|
16
|
+
export interface AttributeToDirective {
|
|
17
|
+
readonly componentSelector: string | string[];
|
|
18
|
+
readonly inputProperty: string;
|
|
19
|
+
readonly directive: string;
|
|
20
|
+
readonly directiveModule: {
|
|
21
|
+
readonly name: string;
|
|
22
|
+
readonly moduleSpecifier: string;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export declare const ATTRS_TO_REPLACE: ReplacementAttributes[];
|
|
26
|
+
export declare const TAGS_TO_REPLACE: ReplacementTags[];
|
|
27
|
+
export declare const ATTR_TO_DIRECTIVE: AttributeToDirective[];
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tui_interactive_selectors_1 = require("./tui-interactive-selectors");
|
|
4
|
+
exports.ATTRS_TO_REPLACE = [
|
|
5
|
+
{
|
|
6
|
+
from: { attrName: 'tuiResizableColumn', withAttrsNames: ['tuiResizableColumn'] },
|
|
7
|
+
to: { attrName: 'tuiTh [resizable]="true"' },
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
from: { attrName: 'new', withTagNames: ['tui-editor'] },
|
|
11
|
+
to: { attrName: '' },
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
from: {
|
|
15
|
+
attrName: '[hovered]',
|
|
16
|
+
withTagNames: ['tui-wrapper'],
|
|
17
|
+
withAttrsNames: ['tuiWrapper'],
|
|
18
|
+
},
|
|
19
|
+
to: {
|
|
20
|
+
attrName: '[hover]',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
from: {
|
|
25
|
+
attrName: '[pressed]',
|
|
26
|
+
withTagNames: ['tui-wrapper'],
|
|
27
|
+
withAttrsNames: ['tuiWrapper'],
|
|
28
|
+
},
|
|
29
|
+
to: {
|
|
30
|
+
attrName: '[active]',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
exports.TAGS_TO_REPLACE = [
|
|
35
|
+
{
|
|
36
|
+
from: 'tui-group',
|
|
37
|
+
to: 'div',
|
|
38
|
+
addAttributes: ['tuiGroup'],
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
from: 'tui-wrapper',
|
|
42
|
+
to: 'div',
|
|
43
|
+
addAttributes: ['tuiWrapper'],
|
|
44
|
+
},
|
|
45
|
+
];
|
|
46
|
+
exports.ATTR_TO_DIRECTIVE = [
|
|
47
|
+
{
|
|
48
|
+
componentSelector: 'tui-primitive-textfield',
|
|
49
|
+
inputProperty: '(autofilledChange)',
|
|
50
|
+
directive: '(tuiAutofilledChange)',
|
|
51
|
+
directiveModule: {
|
|
52
|
+
name: 'TuiAutofilledModule',
|
|
53
|
+
moduleSpecifier: '@taiga-ui/cdk',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
componentSelector: tui_interactive_selectors_1.TUI_INTERACTIVE_SELECTORS,
|
|
58
|
+
inputProperty: '(pressedChange)',
|
|
59
|
+
directive: '(tuiPressedChange)',
|
|
60
|
+
directiveModule: {
|
|
61
|
+
name: 'TuiPressedModule',
|
|
62
|
+
moduleSpecifier: '@taiga-ui/cdk',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
componentSelector: tui_interactive_selectors_1.TUI_INTERACTIVE_SELECTORS,
|
|
67
|
+
inputProperty: '(hoveredChange)',
|
|
68
|
+
directive: '(tuiHoveredChange)',
|
|
69
|
+
directiveModule: {
|
|
70
|
+
name: 'TuiHoveredModule',
|
|
71
|
+
moduleSpecifier: '@taiga-ui/cdk',
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TUI_INTERACTIVE_SELECTORS: string[];
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TUI_INTERACTIVE_SELECTORS = [
|
|
4
|
+
'tui-primitive-textfield',
|
|
5
|
+
'tui-primitive-spin-button',
|
|
6
|
+
'tui-action',
|
|
7
|
+
'tui-input-range',
|
|
8
|
+
'tui-pagination',
|
|
9
|
+
'tui-accordion-item',
|
|
10
|
+
'tui-button',
|
|
11
|
+
'tuiButton',
|
|
12
|
+
'tuiIconButton',
|
|
13
|
+
'tui-toggle',
|
|
14
|
+
'tuiSlider',
|
|
15
|
+
'tui-slider',
|
|
16
|
+
'tui-rating',
|
|
17
|
+
'tui-input-card',
|
|
18
|
+
'tui-input-cvc',
|
|
19
|
+
'tui-input-expire',
|
|
20
|
+
'tui-editor',
|
|
21
|
+
'tui-input-color',
|
|
22
|
+
'tui-input-copy',
|
|
23
|
+
'tui-input-count',
|
|
24
|
+
'tui-input-date-time',
|
|
25
|
+
'tui-input-inline',
|
|
26
|
+
'tui-input-password',
|
|
27
|
+
'tui-input-phone-international',
|
|
28
|
+
'tui-input-phone',
|
|
29
|
+
'tui-input-range',
|
|
30
|
+
'tui-input-slider',
|
|
31
|
+
'tui-input',
|
|
32
|
+
'tui-range',
|
|
33
|
+
'tui-text-area',
|
|
34
|
+
'tui-radio-block',
|
|
35
|
+
'tui-radio-labeled',
|
|
36
|
+
'tui-radio-list',
|
|
37
|
+
'tui-radio',
|
|
38
|
+
'tui-select',
|
|
39
|
+
'tui-input-card-grouped',
|
|
40
|
+
'tui-checkbox-block',
|
|
41
|
+
'tui-checkbox-labeled',
|
|
42
|
+
'tui-combo-box',
|
|
43
|
+
'tui-input-date-range',
|
|
44
|
+
'tui-input-file',
|
|
45
|
+
'tui-input-files',
|
|
46
|
+
'tui-input-month-range',
|
|
47
|
+
'tui-input-month',
|
|
48
|
+
'tui-input-number',
|
|
49
|
+
'tui-input-time',
|
|
50
|
+
'tui-input-time',
|
|
51
|
+
'tui-multiselect',
|
|
52
|
+
'tui-filter',
|
|
53
|
+
'tui-input-tag',
|
|
54
|
+
];
|
|
@@ -42,4 +42,38 @@ exports.TYPES_TO_RENAME = [
|
|
|
42
42
|
{
|
|
43
43
|
from: 'TuiBreadCrumbsItem',
|
|
44
44
|
},
|
|
45
|
+
{
|
|
46
|
+
from: 'CheckboxOptions',
|
|
47
|
+
to: 'TuiCheckboxOptions',
|
|
48
|
+
moduleSpecifier: ['@taiga-ui/core'],
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
from: 'NotificationTokenOptions',
|
|
52
|
+
to: 'TuiNotificationDefaultOptions',
|
|
53
|
+
moduleSpecifier: ['@taiga-ui/core'],
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
from: 'TuiNotificationAutoClose',
|
|
57
|
+
to: 'TuiAlertAutoClose',
|
|
58
|
+
moduleSpecifier: ['@taiga-ui/core'],
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
from: 'TuiNotificationOptions',
|
|
62
|
+
to: 'TuiAlertOptions<any>',
|
|
63
|
+
moduleSpecifier: ['@taiga-ui/core'],
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
from: 'TuiNotificationOptionsWithData',
|
|
67
|
+
to: 'TuiAlertOptions',
|
|
68
|
+
moduleSpecifier: ['@taiga-ui/core'],
|
|
69
|
+
preserveGenerics: true,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
from: 'Country',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
from: 'NumberFormatSettings',
|
|
76
|
+
to: 'TuiNumberFormatSettings',
|
|
77
|
+
moduleSpecifier: ['@taiga-ui/core'],
|
|
78
|
+
},
|
|
45
79
|
];
|
|
@@ -5,4 +5,76 @@ exports.MIGRATION_WARNINGS = [
|
|
|
5
5
|
name: 'TUI_MOBILE_AWARE',
|
|
6
6
|
message: 'TUI_MOBILE_AWARE has been deleted in 3.0, please use TuiMobileTabsDirective from @taiga-ui/addon-mobile',
|
|
7
7
|
},
|
|
8
|
+
{
|
|
9
|
+
name: 'TUI_DATE_FILLER',
|
|
10
|
+
message: 'TUI_DATE_FILLER has been deleted in 3.0, please use TUI_DATE_FORMAT + TUI_DATE_SEPARATOR from @taiga-ui/cdk. Read more: https://taiga-ui.dev/components/input-date',
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
name: 'TUI_DATE_RANGE_FILLER',
|
|
14
|
+
message: 'TUI_DATE_RANGE_FILLER has been deleted in 3.0, please use TUI_DATE_FORMAT + TUI_DATE_SEPARATOR from @taiga-ui/cdk. Read more: https://taiga-ui.dev/components/input-date-range',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'TUI_SHEET_OFFSET',
|
|
18
|
+
message: 'TUI_SHEET_OFFSET has been deleted in 3.0, please use option argument for each Sheet. Read more: https://taiga-ui.dev/components/sheet',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'COUNTRIES',
|
|
22
|
+
moduleSpecifier: '@taiga-ui/kit',
|
|
23
|
+
message: 'Use DI-token TUI_COUNTRIES_MASKS to get phone mask by country iso code. Use DI-token TUI_COUNTRIES to get localized country name by its iso code',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'COUNTRIES_MASKS',
|
|
27
|
+
moduleSpecifier: '@taiga-ui/kit',
|
|
28
|
+
message: 'Use DI-token TUI_COUNTRIES_MASKS to get phone mask by country iso code',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'TuiTableModeModule',
|
|
32
|
+
moduleSpecifier: '@taiga-ui/core',
|
|
33
|
+
message: 'TuiTableModeModule has been deleted in 3.0, please use @taiga-ui/addon-table',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'TuiColorModule',
|
|
37
|
+
moduleSpecifier: '@taiga-ui/core',
|
|
38
|
+
message: 'TuiColorModule has been deleted in 3.0, please use CSS custom properties',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'TuiPluralizePipeModule',
|
|
42
|
+
moduleSpecifier: '@taiga-ui/core',
|
|
43
|
+
message: 'TuiPluralizePipeModule has been deleted in 3.0, please use use Angular built-in pipe https://angular.io/api/common/I18nPluralPipe ',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'TUI_DEFAULT_COLOR_HANDLER',
|
|
47
|
+
moduleSpecifier: '@taiga-ui/addon-charts',
|
|
48
|
+
message: 'TUI_DEFAULT_COLOR_HANDLER has been deleted in 3.0, please use CSS variables',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'TuiColorHandler',
|
|
52
|
+
moduleSpecifier: '@taiga-ui/addon-charts',
|
|
53
|
+
message: 'TuiColorHandler has been deleted in 3.0, please use CSS custom properties',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'DEFAULT_COLORS',
|
|
57
|
+
moduleSpecifier: '@taiga-ui/addon-charts',
|
|
58
|
+
message: 'DEFAULT_COLORS has been deleted in 3.0, please use CSS variables',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'AbstractTuiInteractive',
|
|
62
|
+
moduleSpecifier: '@taiga-ui/core',
|
|
63
|
+
message: 'pressedChange and hoveredChange outputs have been removed from AbstractTuiInteractive, please use tuiPressedChange and tuiHoveredChange directives instead',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: 'AbstractTuiControl',
|
|
67
|
+
moduleSpecifier: '@taiga-ui/core',
|
|
68
|
+
message: 'pressedChange and hoveredChange outputs have been removed from AbstractTuiInteractive, please use tuiPressedChange and tuiHoveredChange directives instead',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: 'AbstractTuiMultipleControl',
|
|
72
|
+
moduleSpecifier: '@taiga-ui/core',
|
|
73
|
+
message: 'pressedChange and hoveredChange outputs have been removed from AbstractTuiInteractive, please use tuiPressedChange and tuiHoveredChange directives instead',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: 'AbstractTuiNullableControl',
|
|
77
|
+
moduleSpecifier: '@taiga-ui/core',
|
|
78
|
+
message: 'pressedChange and hoveredChange outputs have been removed from AbstractTuiInteractive, please use tuiPressedChange and tuiHoveredChange directives instead',
|
|
79
|
+
},
|
|
8
80
|
];
|
|
@@ -8,6 +8,10 @@ const rename_types_1 = require("./steps/rename-types");
|
|
|
8
8
|
const replace_const_1 = require("./steps/replace-const");
|
|
9
9
|
const replace_deep_import_1 = require("./steps/replace-deep-import");
|
|
10
10
|
const show_warnings_1 = require("./steps/show-warnings");
|
|
11
|
+
const replace_services_1 = require("./steps/replace-services");
|
|
12
|
+
const migrate_templates_1 = require("./steps/migrate-templates");
|
|
13
|
+
const migrate_sliders_1 = require("./steps/migrate-sliders");
|
|
14
|
+
const remove_module_1 = require("./steps/remove-module");
|
|
11
15
|
function updateToV3(_) {
|
|
12
16
|
return (tree, context) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
13
17
|
context.logger.info(`taiga packages will be updated to ${versions_1.TAIGA_VERSION}`);
|
|
@@ -16,7 +20,11 @@ function updateToV3(_) {
|
|
|
16
20
|
replace_enums_1.replaceEnums();
|
|
17
21
|
rename_types_1.renameTypes();
|
|
18
22
|
replace_const_1.replaceConsts();
|
|
23
|
+
replace_services_1.replaceServices();
|
|
19
24
|
show_warnings_1.showWarnings(context);
|
|
25
|
+
migrate_templates_1.migrateTemplates(tree);
|
|
26
|
+
migrate_sliders_1.migrateSliders(tree);
|
|
27
|
+
remove_module_1.removeModules();
|
|
20
28
|
ng_morph_1.saveActiveProject();
|
|
21
29
|
});
|
|
22
30
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const migrate_input_slider_1 = require("./migrate-input-slider");
|
|
4
|
+
function migrateSliders(tree) {
|
|
5
|
+
migrate_input_slider_1.migrateInputSlider(tree);
|
|
6
|
+
}
|
|
7
|
+
exports.migrateSliders = migrateSliders;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const get_component_templates_1 = require("../../../utils/templates/get-component-templates");
|
|
4
|
+
const devkit_file_system_1 = require("ng-morph/project/classes/devkit-file-system");
|
|
5
|
+
const ng_component_input_manipulations_1 = require("../../../utils/templates/ng-component-input-manipulations");
|
|
6
|
+
function migrateInputSlider(tree) {
|
|
7
|
+
const fileSystem = new devkit_file_system_1.DevkitFileSystem(tree);
|
|
8
|
+
const templateResources = get_component_templates_1.getComponentTemplates('**/**');
|
|
9
|
+
for (const templateResource of templateResources) {
|
|
10
|
+
ng_component_input_manipulations_1.replaceInputPropertyByDirective({
|
|
11
|
+
templateResource,
|
|
12
|
+
fileSystem,
|
|
13
|
+
componentSelector: 'tui-input-slider',
|
|
14
|
+
inputProperty: 'secondary',
|
|
15
|
+
directive: 'tuiTextfieldCustomContent',
|
|
16
|
+
directiveModule: {
|
|
17
|
+
name: 'TuiTextfieldControllerModule',
|
|
18
|
+
moduleSpecifier: '@taiga-ui/core',
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
fileSystem.commitEdits();
|
|
23
|
+
}
|
|
24
|
+
exports.migrateInputSlider = migrateInputSlider;
|