@taiga-ui/cdk 3.53.0 → 3.54.0-canary.1346052
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/bundles/taiga-ui-cdk-components-alert-host.umd.js +1 -1
- package/bundles/taiga-ui-cdk-components-alert-host.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-constants.umd.js +64 -64
- package/bundles/taiga-ui-cdk-constants.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js +4 -16
- package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-autofilled.umd.js +1 -1
- package/bundles/taiga-ui-cdk-directives-autofilled.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-focus-trap.umd.js +1 -4
- package/bundles/taiga-ui-cdk-directives-focus-trap.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-media.umd.js +1 -2
- package/bundles/taiga-ui-cdk-directives-media.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-pipes-filter.umd.js +1 -1
- package/bundles/taiga-ui-cdk-pipes-filter.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-pipes-keys.umd.js +1 -1
- package/bundles/taiga-ui-cdk-pipes-keys.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-pipes-mapper.umd.js +1 -1
- package/bundles/taiga-ui-cdk-pipes-mapper.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-pipes-replace.umd.js +1 -1
- package/bundles/taiga-ui-cdk-pipes-replace.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-focus.umd.js +6 -2
- package/bundles/taiga-ui-cdk-utils-focus.umd.js.map +1 -1
- package/constants/used-icons.d.ts +1 -1
- package/constants/version.d.ts +1 -1
- package/constants/version.js +1 -1
- package/esm2015/components/alert-host/alert-host.component.js +2 -2
- package/esm2015/constants/used-icons.js +64 -64
- package/esm2015/constants/version.js +2 -2
- package/esm2015/directives/auto-focus/autofocus.options.js +1 -2
- package/esm2015/directives/auto-focus/handlers/ios.handler.js +3 -4
- package/esm2015/directives/autofilled/autofilled.module.js +2 -2
- package/esm2015/directives/focus-trap/focus-trap.directive.js +2 -5
- package/esm2015/directives/media/media.directive.js +2 -3
- package/esm2015/pipes/filter/filter.module.js +2 -2
- package/esm2015/pipes/keys/keys.module.js +2 -2
- package/esm2015/pipes/mapper/mapper.module.js +2 -2
- package/esm2015/pipes/replace/replace.module.js +2 -2
- package/esm2015/utils/focus/is-native-focused-in.js +4 -2
- package/esm2015/utils/focus/is-native-focused.js +4 -2
- package/fesm2015/taiga-ui-cdk-components-alert-host.js +2 -2
- package/fesm2015/taiga-ui-cdk-components-alert-host.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-constants.js +64 -64
- package/fesm2015/taiga-ui-cdk-constants.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-directives-auto-focus.js +2 -3
- package/fesm2015/taiga-ui-cdk-directives-auto-focus.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-directives-autofilled.js +1 -1
- package/fesm2015/taiga-ui-cdk-directives-autofilled.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-directives-focus-trap.js +1 -4
- package/fesm2015/taiga-ui-cdk-directives-focus-trap.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-directives-media.js +1 -2
- package/fesm2015/taiga-ui-cdk-directives-media.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-pipes-filter.js +1 -1
- package/fesm2015/taiga-ui-cdk-pipes-filter.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-pipes-keys.js +1 -1
- package/fesm2015/taiga-ui-cdk-pipes-keys.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-pipes-mapper.js +1 -1
- package/fesm2015/taiga-ui-cdk-pipes-mapper.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-pipes-replace.js +1 -1
- package/fesm2015/taiga-ui-cdk-pipes-replace.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-focus.js +6 -2
- package/fesm2015/taiga-ui-cdk-utils-focus.js.map +1 -1
- package/package.json +68 -68
- package/schematics/ng-add/steps/add-taiga-modules.js +5 -5
- package/schematics/ng-update/steps/replace-identifier.js +1 -1
- package/schematics/ng-update/v3/steps/migrate-progress.js +6 -8
- package/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-range.js +6 -8
- package/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-slider.js +4 -5
- package/schematics/ng-update/v3-30/index.js +0 -1
- package/schematics/ng-update/v3-35/index.js +0 -1
- package/schematics/ng-update/v3-36/index.js +0 -1
- package/schematics/ng-update/v3-40/index.js +2 -4
- package/schematics/ng-update/v3-5/index.js +0 -1
- package/schematics/ng-update/v4/steps/constants/attrs-to-replace.js +7 -0
- package/schematics/ng-update/v4/steps/constants/html-comments.js +10 -0
- package/schematics/ng-update/v4/steps/constants/identifiers-to-replace.js +4 -0
- package/schematics/ng-update/v4/steps/constants/inputs-to-remove.js +1 -0
- package/schematics/ng-update/v4/steps/migrate-templates.js +1 -0
- package/schematics/ng-update/v4/steps/templates/index.d.ts +1 -0
- package/schematics/ng-update/v4/steps/templates/index.js +1 -0
- package/schematics/ng-update/v4/steps/templates/migrate-avatar.d.ts +8 -0
- package/schematics/ng-update/v4/steps/templates/migrate-avatar.js +75 -0
- package/schematics/ng-update/v4/steps/utils/replace-substrings.js +2 -2
- package/schematics/utils/angular-json-manipulations.js +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"taiga-ui-cdk-utils-focus.js","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/set-native-mouse-focused.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 !!node?.ownerDocument && tuiGetNativeFocused(node.ownerDocument) === node;\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): boolean {\n // !node.contains - check for IE11\n if (!node.ownerDocument || !node.contains) {\n return false;\n }\n\n const nativeFocused = tuiGetNativeFocused(node.ownerDocument);\n\n return nativeFocused !== null && node.contains(nativeFocused);\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 * 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 tuiSetNativeMouseFocused(\n element: Element & HTMLOrSVGElement,\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 if (focused) {\n element.focus({preventScroll});\n } else {\n element.blur();\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;IACzD,IAAI,EAAC,aAAa,KAAb,IAAA,IAAA,aAAa,uBAAb,aAAa,CAAE,UAAU,CAAA,EAAE;AAC5B,QAAA,OAAO,aAAa,CAAC;AACxB,KAAA;AAED,IAAA,IAAI,OAAO,GAAG,aAAa,CAAC,UAAU,CAAC,aAAa,CAAC;AAErD,IAAA,OAAO,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,WAAW,EAAE,EAAC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAC,CAAC,CAAC,CAAC;AACpF,KAAA;AAAM,SAAA;QACH,MAAM,KAAK,GAAG,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,CAAO,KAAA,CAAA,CAAC,CAAC;QAEzD,KAAK,CAAC,SAAS,CAAC,CAAA,SAAA,CAAW,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACzC,QAAA,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAChC,KAAA;AAED,IAAA,IAAI,OAAO,EAAE;AACT,QAAA,OAAO,CAAC,KAAK,CAAC,EAAC,aAAa,EAAC,CAAC,CAAC;AAClC,KAAA;AAAM,SAAA;QACH,OAAO,CAAC,IAAI,EAAE,CAAC;AAClB,KAAA;AACL;;AC9BA;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"taiga-ui-cdk-utils-focus.js","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/set-native-mouse-focused.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): boolean {\n // !node.contains - check for IE11\n if (!node.ownerDocument || !node.contains) {\n return false;\n }\n\n const nativeFocused = tuiGetNativeFocused(node.ownerDocument);\n\n return (\n nativeFocused !== null &&\n node.contains(nativeFocused) &&\n node.ownerDocument.hasFocus()\n );\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 * 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 tuiSetNativeMouseFocused(\n element: Element & HTMLOrSVGElement,\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 if (focused) {\n element.focus({preventScroll});\n } else {\n element.blur();\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;IACzD,IAAI,EAAC,aAAa,KAAb,IAAA,IAAA,aAAa,uBAAb,aAAa,CAAE,UAAU,CAAA,EAAE;AAC5B,QAAA,OAAO,aAAa,CAAC;AACxB,KAAA;AAED,IAAA,IAAI,OAAO,GAAG,aAAa,CAAC,UAAU,CAAC,aAAa,CAAC;AAErD,IAAA,OAAO,OAAO,KAAP,IAAA,IAAA,OAAO,uBAAP,OAAO,CAAE,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,C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,CAAC;QAEzD,KAAK,CAAC,SAAS,CAAC,CAAA,SAAA,CAAW,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACzC,QAAA,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAChC,KAAA;AAED,IAAA,IAAI,OAAO,EAAE;AACT,QAAA,OAAO,CAAC,KAAK,CAAC,EAAC,aAAa,EAAC,CAAC,CAAC;AAClC,KAAA;AAAM,SAAA;QACH,OAAO,CAAC,IAAI,EAAE,CAAC;AAClB,KAAA;AACL;;AC9BA;;AAEG;;;;"}
|
package/package.json
CHANGED
@@ -1,70 +1,70 @@
|
|
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
|
-
|
69
|
-
|
2
|
+
"name": "@taiga-ui/cdk",
|
3
|
+
"version": "3.54.0-canary.1346052",
|
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
|
+
"@ng-web-apis/common": "3.0.6",
|
19
|
+
"@ng-web-apis/mutation-observer": "3.0.6",
|
20
|
+
"@ng-web-apis/resize-observer": "3.0.6",
|
21
|
+
"@tinkoff/ng-event-plugins": "3.1.0",
|
22
|
+
"@tinkoff/ng-polymorpheus": "4.2.0",
|
23
|
+
"tslib": "2.6.2"
|
24
|
+
},
|
25
|
+
"peerDependencies": {
|
26
|
+
"@angular/animations": ">=12.0.0",
|
27
|
+
"@angular/common": ">=12.0.0",
|
28
|
+
"@angular/core": ">=12.0.0",
|
29
|
+
"@angular/forms": ">=12.0.0",
|
30
|
+
"rxjs": ">=6.0.0"
|
31
|
+
},
|
32
|
+
"optionalDependencies": {
|
33
|
+
"ng-morph": "4.0.0",
|
34
|
+
"parse5": "6.0.1"
|
35
|
+
},
|
36
|
+
"ng-update": {
|
37
|
+
"migrations": "./schematics/migration.json",
|
38
|
+
"packageGroup": [
|
39
|
+
"@taiga-ui/i18n",
|
40
|
+
"@taiga-ui/cdk",
|
41
|
+
"@taiga-ui/core",
|
42
|
+
"@taiga-ui/kit",
|
43
|
+
"@taiga-ui/styles",
|
44
|
+
"@taiga-ui/testing",
|
45
|
+
"@taiga-ui/addon-doc",
|
46
|
+
"@taiga-ui/addon-charts",
|
47
|
+
"@taiga-ui/addon-commerce",
|
48
|
+
"@taiga-ui/icons",
|
49
|
+
"@taiga-ui/addon-preview",
|
50
|
+
"@taiga-ui/addon-tablebars",
|
51
|
+
"@taiga-ui/addon-table",
|
52
|
+
"@taiga-ui/addon-mobile",
|
53
|
+
"@taiga-ui/layout",
|
54
|
+
"@taiga-ui/proprietary-banking",
|
55
|
+
"@taiga-ui/proprietary-core",
|
56
|
+
"@taiga-ui/proprietary-icons",
|
57
|
+
"@taiga-ui/proprietary-navigation",
|
58
|
+
"@taiga-ui/proprietary-tds-icons",
|
59
|
+
"@taiga-ui/proprietary-tds-palette"
|
60
|
+
]
|
61
|
+
},
|
62
|
+
"schematics": "./schematics/collection.json",
|
63
|
+
"main": "bundles/taiga-ui-cdk.umd.js",
|
64
|
+
"module": "fesm2015/taiga-ui-cdk.js",
|
65
|
+
"es2015": "fesm2015/taiga-ui-cdk.js",
|
66
|
+
"esm2015": "esm2015/taiga-ui-cdk.js",
|
67
|
+
"fesm2015": "fesm2015/taiga-ui-cdk.js",
|
68
|
+
"typings": "taiga-ui-cdk.d.ts",
|
69
|
+
"sideEffects": false
|
70
70
|
}
|
@@ -22,7 +22,7 @@ function addTaigaModules(options) {
|
|
22
22
|
return;
|
23
23
|
}
|
24
24
|
const buildOptions = get_project_target_options_1.getProjectTargetOptions(project, `build`);
|
25
|
-
const mainFilePath = buildOptions.main;
|
25
|
+
const mainFilePath = (buildOptions.main || buildOptions.browser);
|
26
26
|
if (!mainFilePath) {
|
27
27
|
context.logger.error(`[ERROR]: Could not find the project main file`);
|
28
28
|
return;
|
@@ -86,7 +86,7 @@ function addRootTuiProvidersToBootstrapFn(bootstrapOptions) {
|
|
86
86
|
.getElements()
|
87
87
|
.find(el => ng_morph_1.Node.isCallExpression(el) &&
|
88
88
|
el.getExpression().getText() === `importProvidersFrom`);
|
89
|
-
const
|
89
|
+
const provideAnimations = initializer
|
90
90
|
.getElements()
|
91
91
|
.find(el => ng_morph_1.Node.isCallExpression(el) &&
|
92
92
|
el.getExpression().getText() === `provideAnimations`);
|
@@ -101,12 +101,12 @@ function addRootTuiProvidersToBootstrapFn(bootstrapOptions) {
|
|
101
101
|
else {
|
102
102
|
push_to_array_property_1.pushToObjectArrayProperty(bootstrapOptions, `providers`, `importProvidersFrom(TuiRootModule)`);
|
103
103
|
}
|
104
|
-
if (!
|
104
|
+
if (!provideAnimations) {
|
105
105
|
modules.push({
|
106
|
-
name: `
|
106
|
+
name: `provideAnimations`,
|
107
107
|
packageName: `@angular/platform-browser/animations`,
|
108
108
|
});
|
109
|
-
push_to_array_property_1.pushToObjectArrayProperty(bootstrapOptions, `providers`, `
|
109
|
+
push_to_array_property_1.pushToObjectArrayProperty(bootstrapOptions, `providers`, `provideAnimations()`, {
|
110
110
|
index: 0,
|
111
111
|
});
|
112
112
|
}
|
@@ -9,7 +9,7 @@ const import_manipulations_1 = require("../../utils/import-manipulations");
|
|
9
9
|
function replaceIdentifiers(options, constants) {
|
10
10
|
!options[`skip-logs`] &&
|
11
11
|
colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} replacing identifiers...`);
|
12
|
-
constants.forEach(
|
12
|
+
constants.forEach(replaceIdentifier);
|
13
13
|
!options[`skip-logs`] &&
|
14
14
|
colored_log_1.successLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.SUCCESS_SYMBOL} identifiers replaced \n`);
|
15
15
|
}
|
@@ -15,10 +15,7 @@ const PROPERTY_FOR_DEPRECATED_PIPES = `[color]`;
|
|
15
15
|
function migrateProgress(fileSystem, options) {
|
16
16
|
!options[`skip-logs`] &&
|
17
17
|
colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} migrating progress bars...`);
|
18
|
-
|
19
|
-
for (const templateResource of templateResources) {
|
20
|
-
replaceProgressColorSegmentsPipe(templateResource, fileSystem);
|
21
|
-
}
|
18
|
+
get_component_templates_1.getComponentTemplates(constants_1.ALL_TS_FILES).forEach(templateResource => replaceProgressColorSegmentsPipe(templateResource, fileSystem));
|
22
19
|
fileSystem.commitEdits();
|
23
20
|
ng_morph_1.saveActiveProject();
|
24
21
|
ng_morph_1.setActiveProject(ng_morph_1.createProject(fileSystem.tree, project_root_1.projectRoot(), constants_1.ALL_FILES));
|
@@ -27,13 +24,14 @@ function migrateProgress(fileSystem, options) {
|
|
27
24
|
}
|
28
25
|
exports.migrateProgress = migrateProgress;
|
29
26
|
function replaceProgressColorSegmentsPipe(templateResource, fileSystem) {
|
30
|
-
var _a, _b;
|
31
27
|
const template = template_resource_1.getTemplateFromTemplateResource(templateResource, fileSystem);
|
32
28
|
const templateOffset = template_resource_1.getTemplateOffset(templateResource);
|
33
29
|
const path = fileSystem.resolve(template_resource_1.getPathFromTemplateResource(templateResource));
|
34
30
|
const recorder = fileSystem.edit(path);
|
35
|
-
|
36
|
-
|
31
|
+
elements_1.findElementsWithAttribute(template, PROPERTY_FOR_DEPRECATED_PIPES)
|
32
|
+
.filter(isProgressWithDeprecatedPipe)
|
33
|
+
.forEach(progressEl => {
|
34
|
+
var _a, _b;
|
37
35
|
const oldValue = ((_a = progressEl.attrs.find(attr => attr.name === PROPERTY_FOR_DEPRECATED_PIPES)) === null || _a === void 0 ? void 0 : _a.value) || ``;
|
38
36
|
const newValue = oldValue.replace(exports.DEPRECATED_PROGRESS_PIPES_REG, ``);
|
39
37
|
const attrLocations = (_b = progressEl.sourceCodeLocation) === null || _b === void 0 ? void 0 : _b.attrs;
|
@@ -42,7 +40,7 @@ function replaceProgressColorSegmentsPipe(templateResource, fileSystem) {
|
|
42
40
|
recorder.remove(templateOffset + startOffset, endOffset - startOffset);
|
43
41
|
recorder.insertRight(templateOffset + startOffset, `[tuiProgressColorSegments]="${newValue}"`);
|
44
42
|
}
|
45
|
-
}
|
43
|
+
});
|
46
44
|
}
|
47
45
|
function isProgressWithDeprecatedPipe(element) {
|
48
46
|
return (element.tagName === `progress` &&
|
@@ -13,25 +13,23 @@ const MIN_LABELS_MIGRATION_METHOD_NAME = `tuiMigrationInputRangeMinLabel`;
|
|
13
13
|
const MAX_LABELS_MIGRATION_METHOD_NAME = `tuiMigrationInputRangeMaxLabel`;
|
14
14
|
function migrateInputRange(fileSystem, options) {
|
15
15
|
const templateResources = get_component_templates_1.getComponentTemplates(constants_1.ALL_TS_FILES);
|
16
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
17
16
|
const COMPONENTS_WITH_MIN_LABELS = new Set();
|
18
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
19
17
|
const COMPONENTS_WITH_MAX_LABELS = new Set();
|
20
18
|
let progressLog = progress_1.setupProgressLogger({
|
21
19
|
total: templateResources.length,
|
22
20
|
prefix: `[replaceMinMaxLabel]`,
|
23
21
|
});
|
24
|
-
|
22
|
+
templateResources.forEach(templateResource => {
|
25
23
|
!options[`skip-logs`] && progressLog(templateResource.componentPath);
|
26
24
|
replaceMinLabel(templateResource, fileSystem, COMPONENTS_WITH_MIN_LABELS);
|
27
25
|
replaceMaxLabel(templateResource, fileSystem, COMPONENTS_WITH_MAX_LABELS);
|
28
|
-
}
|
26
|
+
});
|
29
27
|
save(fileSystem);
|
30
28
|
progressLog = progress_1.setupProgressLogger({
|
31
29
|
total: COMPONENTS_WITH_MIN_LABELS.size,
|
32
30
|
prefix: `[COMPONENTS_WITH_MIN_LABELS]`,
|
33
31
|
});
|
34
|
-
|
32
|
+
Array.from(COMPONENTS_WITH_MIN_LABELS).forEach(componentPath => {
|
35
33
|
!options[`skip-logs`] && progressLog(componentPath);
|
36
34
|
addMinMaxLabelMethod(componentPath, MIN_LABELS_MIGRATION_METHOD_NAME, [
|
37
35
|
`const currentValue = context.$implicit;`,
|
@@ -40,12 +38,12 @@ function migrateInputRange(fileSystem, options) {
|
|
40
38
|
`if (currentValue === minValue) return minLabelText;`,
|
41
39
|
`return String(currentValue);`,
|
42
40
|
]);
|
43
|
-
}
|
41
|
+
});
|
44
42
|
progressLog = progress_1.setupProgressLogger({
|
45
43
|
total: COMPONENTS_WITH_MAX_LABELS.size,
|
46
44
|
prefix: `[COMPONENTS_WITH_MAX_LABELS]`,
|
47
45
|
});
|
48
|
-
|
46
|
+
Array.from(COMPONENTS_WITH_MAX_LABELS).forEach(componentPath => {
|
49
47
|
!options[`skip-logs`] && progressLog(componentPath);
|
50
48
|
addMinMaxLabelMethod(componentPath, MAX_LABELS_MIGRATION_METHOD_NAME, [
|
51
49
|
`const currentValue = context.$implicit;`,
|
@@ -54,7 +52,7 @@ function migrateInputRange(fileSystem, options) {
|
|
54
52
|
`if (currentValue === maxValue) return maxLabelText;`,
|
55
53
|
`return String(currentValue);`,
|
56
54
|
]);
|
57
|
-
}
|
55
|
+
});
|
58
56
|
}
|
59
57
|
exports.migrateInputRange = migrateInputRange;
|
60
58
|
function replaceMinLabel(templateResource, fileSystem, modifiedComponentStorage) {
|
@@ -12,16 +12,15 @@ const get_component_templates_1 = require("../../../../utils/templates/get-compo
|
|
12
12
|
const ng_component_input_manipulations_1 = require("../../../../utils/templates/ng-component-input-manipulations");
|
13
13
|
function migrateInputSlider(fileSystem, options) {
|
14
14
|
const templateResources = get_component_templates_1.getComponentTemplates(constants_1.ALL_TS_FILES);
|
15
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
16
15
|
const COMPONENTS_WITH_MIN_MAX_LABELS = new Set();
|
17
16
|
let progressLog = progress_1.setupProgressLogger({
|
18
17
|
total: templateResources.length,
|
19
18
|
prefix: `[replaceMinMaxLabels]`,
|
20
19
|
});
|
21
|
-
|
20
|
+
templateResources.forEach(templateResource => {
|
22
21
|
!options[`skip-logs`] && progressLog(templateResource.componentPath);
|
23
22
|
replaceMinMaxLabels(templateResource, fileSystem, COMPONENTS_WITH_MIN_MAX_LABELS);
|
24
|
-
}
|
23
|
+
});
|
25
24
|
/**
|
26
25
|
* We should update virtual file tree
|
27
26
|
* otherwise all following ng-morph commands will overwrite all previous template manipulations
|
@@ -33,10 +32,10 @@ function migrateInputSlider(fileSystem, options) {
|
|
33
32
|
total: COMPONENTS_WITH_MIN_MAX_LABELS.size,
|
34
33
|
prefix: `[addMinMaxLabelMethod]`,
|
35
34
|
});
|
36
|
-
|
35
|
+
Array.from(COMPONENTS_WITH_MIN_MAX_LABELS).forEach(componentPath => {
|
37
36
|
!options[`skip-logs`] && progressLog(componentPath);
|
38
37
|
addMinMaxLabelMethod(componentPath);
|
39
|
-
}
|
38
|
+
});
|
40
39
|
}
|
41
40
|
exports.migrateInputSlider = migrateInputSlider;
|
42
41
|
const MIN_MAX_LABELS_MIGRATION_METHOD_NAME = `tuiMigrationMinMaxLabel`;
|
@@ -8,7 +8,6 @@ const get_file_system_1 = require("../utils/get-file-system");
|
|
8
8
|
const replace_text_1 = require("../utils/replace-text");
|
9
9
|
const constants_1 = require("./constants/constants");
|
10
10
|
const icons_1 = require("./constants/icons");
|
11
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
12
11
|
function updateToV3_30(options) {
|
13
12
|
return (tree, _) => {
|
14
13
|
if (!hasProprietaryIcons(tree)) {
|
@@ -8,7 +8,6 @@ const get_file_system_1 = require("../utils/get-file-system");
|
|
8
8
|
const replace_text_1 = require("../utils/replace-text");
|
9
9
|
const constants_1 = require("./constants/constants");
|
10
10
|
const icons_1 = require("./constants/icons");
|
11
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
12
11
|
function updateToV3_35(options) {
|
13
12
|
return (tree, _) => {
|
14
13
|
if (!hasProprietaryIcons(tree)) {
|
@@ -10,7 +10,6 @@ const replace_text_1 = require("../utils/replace-text");
|
|
10
10
|
const OLD_PACKAGE = `@taiga-ui/addon-editor`;
|
11
11
|
const NEW_PACKAGE = `@tinkoff/tui-editor`;
|
12
12
|
const NEW_PACKAGE_VERSION = `^1.0.1`;
|
13
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
14
13
|
function updateToV3_36(options) {
|
15
14
|
return (tree, context) => {
|
16
15
|
if (!ng_morph_1.getPackageJsonDependency(tree, OLD_PACKAGE)) {
|
@@ -11,7 +11,6 @@ const template_resource_1 = require("../../utils/templates/template-resource");
|
|
11
11
|
const get_file_system_1 = require("../utils/get-file-system");
|
12
12
|
const replace_text_1 = require("../utils/replace-text");
|
13
13
|
const replace_tag_1 = require("../utils/templates/replace-tag");
|
14
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
15
14
|
function updateToV3_40(options) {
|
16
15
|
return (tree, _) => {
|
17
16
|
const fileSystem = get_file_system_1.getFileSystem(tree);
|
@@ -24,8 +23,7 @@ exports.updateToV3_40 = updateToV3_40;
|
|
24
23
|
function replaceTextareaTag(options, fileSystem) {
|
25
24
|
!options[`skip-logs`] &&
|
26
25
|
colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} replacing <tui-text-area /> to <tui-textarea />`);
|
27
|
-
|
28
|
-
for (const resource of templateResources) {
|
26
|
+
get_component_templates_1.getComponentTemplates(constants_1.ALL_TS_FILES).forEach(resource => {
|
29
27
|
const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
|
30
28
|
const elements = elements_1.findElementsByTagName(template, `tui-text-area`);
|
31
29
|
const path = fileSystem.resolve(template_resource_1.getPathFromTemplateResource(resource));
|
@@ -35,7 +33,7 @@ function replaceTextareaTag(options, fileSystem) {
|
|
35
33
|
replace_tag_1.replaceTag(recorder, sourceCodeLocation, `tui-text-area`, `tui-textarea`);
|
36
34
|
}
|
37
35
|
});
|
38
|
-
}
|
36
|
+
});
|
39
37
|
fileSystem.commitEdits();
|
40
38
|
ng_morph_1.saveActiveProject();
|
41
39
|
ng_morph_1.setActiveProject(ng_morph_1.createProject(fileSystem.tree, project_root_1.projectRoot(), constants_1.ALL_FILES));
|
@@ -6,7 +6,6 @@ const versions_1 = require("../../ng-add/constants/versions");
|
|
6
6
|
const colored_log_1 = require("../../utils/colored-log");
|
7
7
|
const get_file_system_1 = require("../utils/get-file-system");
|
8
8
|
const migrate_expand_templates_1 = require("./steps/migrate-expand-templates");
|
9
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
10
9
|
function updateToV3_5(options) {
|
11
10
|
return (tree, _) => {
|
12
11
|
const fileSystem = get_file_system_1.getFileSystem(tree);
|
@@ -7,4 +7,14 @@ exports.HTML_COMMENTS = [
|
|
7
7
|
withAttrs: [`singleColor`, `showLoader`],
|
8
8
|
comment: `toggle [singleColor] and [showLoader] inputs have been removed due to design changes`,
|
9
9
|
},
|
10
|
+
{
|
11
|
+
tag: `tui-table-pagination`,
|
12
|
+
withAttrs: [`[(page)]`, `[(size)]`, `(pageChange)`, `(sizeChange)`],
|
13
|
+
comment: `(pageChange) and (sizeChange) outputs have been removed. Use (paginationChange) instead`,
|
14
|
+
},
|
15
|
+
{
|
16
|
+
tag: `tui-radio`,
|
17
|
+
withAttrs: [`identityMatcher`, `showLoader`],
|
18
|
+
comment: `radio [identityMatcher] and [pseudoDisabled] inputs have been removed. If you need a workaround, please start a discussion on GitHub to think together`,
|
19
|
+
},
|
10
20
|
];
|
@@ -25,6 +25,10 @@ exports.IDENTIFIERS_TO_REPLACE = [
|
|
25
25
|
from: { name: `TuiRadioModule`, moduleSpecifier: `@taiga-ui/experimental` },
|
26
26
|
to: { name: `TuiRadioModule`, moduleSpecifier: `@taiga-ui/kit` },
|
27
27
|
},
|
28
|
+
{
|
29
|
+
from: { name: `TuiAvatarModule`, moduleSpecifier: `@taiga-ui/experimental` },
|
30
|
+
to: { name: `TuiAvatarModule`, moduleSpecifier: `@taiga-ui/kit` },
|
31
|
+
},
|
28
32
|
{
|
29
33
|
from: { name: `TuiToggleModule`, moduleSpecifier: `@taiga-ui/experimental` },
|
30
34
|
to: { name: `TuiToggleModule`, moduleSpecifier: `@taiga-ui/kit` },
|
@@ -27,6 +27,7 @@ function migrateTemplates(fileSystem, options) {
|
|
27
27
|
templates_2.migrateCheckbox,
|
28
28
|
templates_2.migrateRadio,
|
29
29
|
templates_2.migrateToggle,
|
30
|
+
templates_2.migrateAvatar,
|
30
31
|
];
|
31
32
|
const progressLog = progress_1.setupProgressLogger({
|
32
33
|
total: componentWithTemplatesPaths.length,
|
@@ -1,5 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const tslib_1 = require("tslib");
|
4
|
+
tslib_1.__exportStar(require("./migrate-avatar"), exports);
|
4
5
|
tslib_1.__exportStar(require("./migrate-badge"), exports);
|
5
6
|
tslib_1.__exportStar(require("./toggles"), exports);
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { UpdateRecorder } from '@angular-devkit/schematics';
|
2
|
+
import { DevkitFileSystem } from 'ng-morph';
|
3
|
+
import { TemplateResource } from '../../../interfaces';
|
4
|
+
export declare function migrateAvatar({ resource, recorder, fileSystem, }: {
|
5
|
+
fileSystem: DevkitFileSystem;
|
6
|
+
recorder: UpdateRecorder;
|
7
|
+
resource: TemplateResource;
|
8
|
+
}): void;
|
@@ -0,0 +1,75 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.migrateAvatar = void 0;
|
4
|
+
const add_import_to_closest_module_1 = require("../../../../utils/add-import-to-closest-module");
|
5
|
+
const elements_1 = require("../../../../utils/templates/elements");
|
6
|
+
const template_resource_1 = require("../../../../utils/templates/template-resource");
|
7
|
+
function migrateAvatar({ resource, recorder, fileSystem, }) {
|
8
|
+
const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
|
9
|
+
const templateOffset = template_resource_1.getTemplateOffset(resource);
|
10
|
+
const elements = elements_1.findElementsByTagName(template, `tui-avatar`);
|
11
|
+
elements.forEach(({ attrs, sourceCodeLocation }) => {
|
12
|
+
const avatarUrlAttr = attrs.find(attr => attr.name === `[avatarurl]` || attr.name === `avatarurl`);
|
13
|
+
const fallbackAttr = attrs.find(attr => attr.name === `[fallback]` || attr.name === `fallback`);
|
14
|
+
const textAttr = attrs.find(attr => attr.name === `[text]` || attr.name === `text`);
|
15
|
+
const roundedAttr = attrs.find(attr => attr.name === `[rounded]` || attr.name === `rounded`);
|
16
|
+
if ((!avatarUrlAttr && !textAttr) || !sourceCodeLocation) {
|
17
|
+
return;
|
18
|
+
}
|
19
|
+
const urlAttrValue = (avatarUrlAttr === null || avatarUrlAttr === void 0 ? void 0 : avatarUrlAttr.value) &&
|
20
|
+
normalizeAttrValue(avatarUrlAttr.name, avatarUrlAttr.value);
|
21
|
+
const textAttrValue = (textAttr === null || textAttr === void 0 ? void 0 : textAttr.value) && normalizeAttrValue(textAttr.name, textAttr.value);
|
22
|
+
const fallbackAttrValue = (fallbackAttr === null || fallbackAttr === void 0 ? void 0 : fallbackAttr.value) &&
|
23
|
+
normalizeAttrValue(fallbackAttr.name, fallbackAttr.value);
|
24
|
+
const insertTo = sourceCodeLocation.startTag.startOffset + `<tui-avatar`.length;
|
25
|
+
if (!insertTo) {
|
26
|
+
return;
|
27
|
+
}
|
28
|
+
const mainSrc = urlAttrValue || (textAttrValue ? `${textAttrValue} | tuiInitials` : ``);
|
29
|
+
const fallbackValue = urlAttrValue
|
30
|
+
? getFallbackValue(textAttrValue, fallbackAttrValue)
|
31
|
+
: ``;
|
32
|
+
const fallbackSrc = urlAttrValue && fallbackValue
|
33
|
+
? `| tuiFallbackSrc : ${fallbackValue} | async`
|
34
|
+
: ``;
|
35
|
+
recorder.insertRight(insertTo + templateOffset, ` [src]="${mainSrc}${fallbackSrc ? ` ${fallbackSrc}` : ``}"${!roundedAttr ? ` [round]="false"` : ``}`);
|
36
|
+
const attrsToRemove = [avatarUrlAttr, textAttr, fallbackAttr].filter((attr) => attr !== undefined);
|
37
|
+
const fallbackModule = !!((avatarUrlAttr && textAttrValue) || fallbackAttr);
|
38
|
+
const initialsModule = !!textAttrValue;
|
39
|
+
const modules = [
|
40
|
+
...(fallbackModule
|
41
|
+
? [{ moduleName: `TuiFallbackModule`, moduleSpecifier: `@taiga-ui/cdk` }]
|
42
|
+
: []),
|
43
|
+
...(initialsModule
|
44
|
+
? [{ moduleName: `TuiInitialsModule`, moduleSpecifier: `@taiga-ui/cdk` }]
|
45
|
+
: []),
|
46
|
+
];
|
47
|
+
addModules(resource.componentPath, modules);
|
48
|
+
removeAttrs(attrsToRemove, sourceCodeLocation, recorder, templateOffset);
|
49
|
+
});
|
50
|
+
}
|
51
|
+
exports.migrateAvatar = migrateAvatar;
|
52
|
+
function addModules(componentPath, modules) {
|
53
|
+
modules.forEach(({ moduleName, moduleSpecifier }) => {
|
54
|
+
add_import_to_closest_module_1.addImportToClosestModule(componentPath, moduleName, moduleSpecifier);
|
55
|
+
});
|
56
|
+
}
|
57
|
+
function removeAttrs(attrs, sourceCodeLocation, recorder, templateOffset) {
|
58
|
+
attrs.forEach(attr => {
|
59
|
+
var _a;
|
60
|
+
const attrOffset = (_a = sourceCodeLocation.attrs) === null || _a === void 0 ? void 0 : _a[attr.name];
|
61
|
+
if (attrOffset) {
|
62
|
+
const { startOffset, endOffset } = attrOffset;
|
63
|
+
recorder.remove(templateOffset + startOffset - 1, endOffset - startOffset + 1);
|
64
|
+
}
|
65
|
+
});
|
66
|
+
}
|
67
|
+
function getFallbackValue(textValue, fallbackValue) {
|
68
|
+
if (textValue) {
|
69
|
+
return `(${textValue} | tuiInitials)`;
|
70
|
+
}
|
71
|
+
return textValue ? `(${textValue} | tuiInitials)` : fallbackValue || ``;
|
72
|
+
}
|
73
|
+
function normalizeAttrValue(attrName, attrValue) {
|
74
|
+
return attrName.startsWith(`[`) ? attrValue : `'${attrValue}'`;
|
75
|
+
}
|
@@ -9,11 +9,11 @@ function replaceSubstring(text, replacement) {
|
|
9
9
|
function replaceSubstrings(text, replacements) {
|
10
10
|
let transformed = text;
|
11
11
|
let acc = 0;
|
12
|
-
|
12
|
+
replacements.forEach(replacement => {
|
13
13
|
replacement.start += acc;
|
14
14
|
transformed = replaceSubstring(transformed, replacement);
|
15
15
|
acc += replacement.to.length - replacement.from.length;
|
16
|
-
}
|
16
|
+
});
|
17
17
|
return transformed;
|
18
18
|
}
|
19
19
|
exports.replaceSubstrings = replaceSubstrings;
|
@@ -32,7 +32,6 @@ function hasTaigaIcons(assets) {
|
|
32
32
|
}));
|
33
33
|
}
|
34
34
|
function addStylesToAngularJson(options, context, taigaStyles, filter, stylesToReplace, tree) {
|
35
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
36
35
|
const MANUAL_MIGRATION_TIPS = `Add styles ${taigaStyles.join(`,`)} to angular.json manually.`;
|
37
36
|
return workspace_1.updateWorkspace(workspace => {
|
38
37
|
const projects = get_projects_1.getProjects(options, workspace);
|