@taiga-ui/cdk 3.54.0-canary.79fb39d → 3.54.0-canary.e1ba43c
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-constants.umd.js +63 -63
- 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-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-directives-platform.umd.js +4 -1
- package/bundles/taiga-ui-cdk-directives-platform.umd.js.map +1 -1
- package/constants/used-icons.d.ts +1 -1
- package/esm2015/constants/used-icons.js +64 -64
- package/esm2015/directives/auto-focus/autofocus.options.js +1 -2
- package/esm2015/directives/auto-focus/handlers/ios.handler.js +3 -4
- package/esm2015/directives/focus-trap/focus-trap.directive.js +2 -5
- package/esm2015/directives/media/media.directive.js +2 -3
- package/esm2015/directives/platform/platform.directive.js +6 -3
- package/fesm2015/taiga-ui-cdk-constants.js +63 -63
- 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-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-directives-platform.js +5 -2
- package/fesm2015/taiga-ui-cdk-directives-platform.js.map +1 -1
- package/package.json +2 -2
- package/schematics/ng-add/steps/add-taiga-modules.js +4 -4
- package/schematics/ng-update/utils/templates/template-comments.d.ts +1 -2
- 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/utils/replace-substrings.js +2 -2
- package/schematics/utils/angular-json-manipulations.js +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"taiga-ui-cdk-constants.js","sources":["../../../projects/cdk/constants/always-false-handler.ts","../../../projects/cdk/constants/always-true-handler.ts","../../../projects/cdk/constants/browser.ts","../../../projects/cdk/constants/empty.ts","../../../projects/cdk/constants/stringify.ts","../../../projects/cdk/constants/matcher.ts","../../../projects/cdk/constants/parent-animation.ts","../../../projects/cdk/constants/polling-time.ts","../../../projects/cdk/constants/svg-node-filter.ts","../../../projects/cdk/constants/unicode-chars.ts","../../../projects/cdk/constants/used-icons.ts","../../../projects/cdk/constants/version.ts","../../../projects/cdk/constants/taiga-ui-cdk-constants.ts"],"sourcesContent":["/**\n * Handler that always returns `false`.\n */\n// eslint-disable-next-line no-restricted-syntax\nexport const ALWAYS_FALSE_HANDLER = (): false => false;\n","/**\n * Handler that always returns `true`.\n */\n// eslint-disable-next-line no-restricted-syntax\nexport const ALWAYS_TRUE_HANDLER = (): true => true;\n","/**\n * @deprecated\n * TODO: drop support of legacy Edge (EdgeHTML) in v4.x\n */\nexport const CHROMIUM_EDGE_START_VERSION = 79;\n","import {QueryList} from '@angular/core';\n\n/**\n * For type safety when using @ContentChildren and @ViewChildren\n *\n * NOTE: Be careful subscribing to 'changes'\n */\nexport const EMPTY_QUERY = new QueryList<any>();\nexport const EMPTY_ARRAY: [] = [];\nexport const EMPTY_FUNCTION: (...args: any[]) => void = () => {};\n\nconst rect = {\n bottom: 0,\n height: 0,\n left: 0,\n right: 0,\n top: 0,\n width: 0,\n x: 0,\n y: 0,\n} as const;\n\nexport const EMPTY_CLIENT_RECT: DOMRect = {\n ...rect,\n toJSON() {\n return rect;\n },\n};\n","import {TuiStringHandler} from '@taiga-ui/cdk/types';\n\n/**\n * Default method to turn arbitrary object into string\n */\nexport const TUI_DEFAULT_STRINGIFY: TuiStringHandler<unknown> = item => String(item);\n","import {TuiHandler, TuiIdentityMatcher} from '@taiga-ui/cdk/types';\n\nimport {TUI_DEFAULT_STRINGIFY} from './stringify';\n\n/**\n * Default handler for matching stringified version of an item and a search query\n * @param item arbitrary element to match with a string\n * @param search search query\n * @param stringify handler to turn item into a string\n */\nexport const TUI_DEFAULT_MATCHER = <T>(\n item: T,\n search: string,\n stringify: TuiHandler<T, string> = TUI_DEFAULT_STRINGIFY,\n): boolean => stringify(item).toLowerCase().includes(search.toLowerCase());\n\n/**\n * Default handler for strict matching stringified version of an item and a search query\n * @param item arbitrary element to match with a string\n * @param search search query\n * @param stringify handler to turn item into a string\n */\nexport const TUI_STRICT_MATCHER = <T>(\n item: T,\n search: string,\n stringify: TuiHandler<T, string> = TUI_DEFAULT_STRINGIFY,\n): boolean => stringify(item).toLowerCase() === search.toLowerCase();\n\n/**\n * Default handler to match equality of two elements\n * ATTENTION: considers two empty arrays equal\n *\n * @param item1 first element\n * @param item2 second element\n */\nexport const TUI_DEFAULT_IDENTITY_MATCHER: TuiIdentityMatcher<unknown> = (item1, item2) =>\n item1 === item2 || bothEmpty(item1, item2);\n\nfunction bothEmpty(item1: unknown, item2: unknown): boolean {\n return Array.isArray(item1) && Array.isArray(item2) && !item1.length && !item2.length;\n}\n","import {animateChild, query, transition, trigger} from '@angular/animations';\n\n/**\n * Add to enable child :leave animation (fixes https://github.com/angular/angular/issues/15753)\n */\nexport const TUI_PARENT_ANIMATION = trigger(`tuiParentAnimation`, [\n transition(`:leave`, [query(`:scope > *`, [animateChild()], {optional: true})]),\n]);\n\n/**\n * Add on parent to stop initial :enter animation for children\n */\nexport const TUI_PARENT_STOP = trigger(`tuiParentStop`, [transition(`:enter`, [])]);\n","export const POLLING_TIME = 1000 / 15;\n","// Filtering SVGElements for TreeWalker\n// Filter must be a function in IE, other modern browsers are compliant to this format\nexport const svgNodeFilter: NodeFilter = ((node: Node) =>\n `ownerSVGElement` in node\n ? NodeFilter.FILTER_REJECT\n : NodeFilter.FILTER_ACCEPT) as any;\n","/**\n * {@link https://unicode-table.com/en/00A0/ Non-breaking space}.\n */\nexport const CHAR_NO_BREAK_SPACE = `\\u00A0`;\n\n/**\n * {@link https://unicode-table.com/en/2013/ EN dash}\n * is used to indicate a range of numbers or a span of time.\n * @example 2006–2022\n * ___\n * Don't confuse with {@link CHAR_EM_DASH} or {@link CHAR_HYPHEN}!\n */\nexport const CHAR_EN_DASH = `\\u2013`;\n\n/**\n * {@link https://unicode-table.com/en/2014/ EM dash}\n * is used to mark a break in a sentence.\n * @example Taiga UI — powerful set of open source components for Angular\n * ___\n * Don't confuse with {@link CHAR_EN_DASH} or {@link CHAR_HYPHEN}!\n */\nexport const CHAR_EM_DASH = `\\u2014`;\n\n/**\n * {@link https://unicode-table.com/en/00AB/ Left-Pointing Double Angle Quotation Mark}\n */\nexport const CHAR_LAQUO = `\\u00AB`;\n\n/**\n * {@link https://unicode-table.com/en/00BB/ Right-Pointing Double Angle Quotation Mark}\n */\nexport const CHAR_RAQUO = `\\u00BB`;\n\n/**\n * {@link https://unicode-table.com/en/002D/ Hyphen (minus sign)}\n * is used to combine words.\n * @example well-behaved\n * ___\n * Don't confuse with {@link CHAR_EN_DASH} or {@link CHAR_EM_DASH}!\n */\nexport const CHAR_HYPHEN = `\\u002D`;\n\n/**\n * {@link https://unicode-table.com/en/2212/ Minus}\n * is used as math operator symbol or before negative digits.\n * ---\n * Can be used as `−`. Don't confuse with {@link CHAR_HYPHEN}\n */\nexport const CHAR_MINUS = `\\u2212`;\n\n/**\n * {@link https://unicode-table.com/en/002B/ Plus}\n */\nexport const CHAR_PLUS = `\\u002B`;\n\n/**\n * {@link https://unicode-table.com/en/2022/ Bullet}.\n */\nexport const CHAR_BULLET = `\\u2022`;\n\n/**\n * {@link https://unicode-table.com/en/2026/ Suspension points}.\n */\nexport const CHAR_ELLIPSIS = `\\u2026`;\n\n/**\n * {@link https://unicode-table.com/en/00A4/ Suspension points}.\n */\nexport const CHAR_CURRENCY_SIGN = `\\u00A4`;\n\n/**\n * {@link https://unicode-table.com/en/200b/ Suspension points}.\n */\nexport const CHAR_ZERO_WIDTH_SPACE = `\\u200B`;\n","/**\n * @description:\n * AUTOGENERATED\n *\n * Array of icons used in taiga-ui components\n */\nexport const TUI_USED_ICONS = [\n `tuiIconMirMono`,\n `tuiIconVisaMono`,\n `tuiIconElectronMono`,\n `tuiIconMastercard`,\n `tuiIconMaestro`,\n `tuiIconAmex`,\n `tuiIconDinersClub`,\n `tuiIconDiscover`,\n `tuiIconHumo`,\n `tuiIconJCB`,\n `tuiIconRuPay`,\n `tuiIconUnionPay`,\n `tuiIconUzcard`,\n `tuiIconVerve`,\n `tuiIconLink`,\n `tuiIconSearch`,\n `tuiIconSun`,\n `tuiIconMoon`,\n `tuiIconCode`,\n `tuiIconMenuLarge`,\n `tuiIconRotate`,\n `tuiIconArrowLeft`,\n `tuiIconArrowRight`,\n `tuiIconPlus`,\n `tuiIconMinus`,\n `tuiIconMinimize`,\n `tuiIconEye`,\n `tuiIconEyeOff`,\n `tuiIconDrag`,\n `tuiIconSortAscending`,\n `tuiIconSortDescending`,\n `tuiIconSortOff`,\n `tuiIconCheck`,\n `tuiIconCheckLarge`,\n `tuiIconMinusLarge`,\n `tuiIconChevronUp`,\n `tuiIconHelpCircle`,\n `tuiIconClose`,\n `tuiIconAlertCircle`,\n `tuiIconChevronRight`,\n `tuiIconInfo`,\n `tuiIconCheckCircle`,\n `tuiIconXCircle`,\n `tuiIconChevronLeft`,\n `tuiIconStarLarge`,\n `tuiIconChevronDown`,\n `tuiIconChevronDownLarge`,\n `tuiIconFileLarge`,\n `tuiIconTrashLarge`,\n `tuiIconAlertCircleLarge`,\n `tuiIconCheckCircleLarge`,\n `tuiIconCopy`,\n `tuiIconCopyLarge`,\n `tuiIconEyeOffLarge`,\n `tuiIconEyeLarge`,\n `tuiIconClock`,\n `tuiIconClockLarge`,\n `tuiIconToggleOff`,\n `tuiIconToggleOffLarge`,\n `tuiIconToggleOn`,\n `tuiIconToggleOnLarge`,\n `tuiIconCalendar`,\n `tuiIconCalendarLarge`,\n] as const;\n","export const TUI_VERSION = `3.54.0`;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAAA;;AAEG;AACH;MACa,oBAAoB,GAAG,MAAa;;ACJjD;;AAEG;AACH;MACa,mBAAmB,GAAG,MAAY;;ACJ/C;;;AAGG;AACI,MAAM,2BAA2B,GAAG;;ACF3C;;;;AAIG;AACU,MAAA,WAAW,GAAG,IAAI,SAAS,GAAQ;AACzC,MAAM,WAAW,GAAO,GAAG;MACrB,cAAc,GAA6B,MAAK,IAAI;AAEjE,MAAM,IAAI,GAAG;AACT,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,IAAI,EAAE,CAAC;AACP,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,GAAG,EAAE,CAAC;AACN,IAAA,KAAK,EAAE,CAAC;AACR,IAAA,CAAC,EAAE,CAAC;AACJ,IAAA,CAAC,EAAE,CAAC;CACE,CAAC;AAEE,MAAA,iBAAiB,GACvB,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,IAAI,KACP,MAAM,GAAA;AACF,QAAA,OAAO,IAAI,CAAC;AAChB,KAAC;;ACxBL;;AAEG;AACI,MAAM,qBAAqB,GAA8B,IAAI,IAAI,MAAM,CAAC,IAA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B,eAAA,CAAA;IACjB,CAAY,UAAA,CAAA;IACZ,CAAe,aAAA,CAAA;IACf,CAAa,WAAA,CAAA;IACb,CAAsB,oBAAA,CAAA;IACtB,CAAuB,qBAAA,CAAA;IACvB,CAAgB,cAAA,CAAA;IAChB,CAAc,YAAA,CAAA;IACd,CAAmB,iBAAA,CAAA;IACnB,CAAmB,iBAAA,CAAA;IACnB,CAAkB,gBAAA,CAAA;IAClB,CAAmB,iBAAA,CAAA;IACnB,CAAc,YAAA,CAAA;IACd,CAAoB,kBAAA,CAAA;IACpB,CAAqB,mBAAA,CAAA;IACrB,CAAa,WAAA,CAAA;IACb,CAAoB,kBAAA,CAAA;IACpB,CAAgB,cAAA,CAAA;IAChB,CAAoB,kBAAA,CAAA;IACpB,CAAkB,gBAAA,CAAA;IAClB,CAAoB,kBAAA,CAAA;IACpB,CAAyB,uBAAA,CAAA;IACzB,CAAkB,gBAAA,CAAA;IAClB,CAAmB,iBAAA,CAAA;IACnB,CAAyB,uBAAA,CAAA;IACzB,CAAyB,uBAAA,CAAA;IACzB,CAAa,WAAA,CAAA;IACb,CAAkB,gBAAA,CAAA;IAClB,CAAoB,kBAAA,CAAA;IACpB,CAAiB,eAAA,CAAA;IACjB,CAAc,YAAA,CAAA;IACd,CAAmB,iBAAA,CAAA;IACnB,CAAkB,gBAAA,CAAA;IAClB,CAAuB,qBAAA,CAAA;IACvB,CAAiB,eAAA,CAAA;IACjB,CAAsB,oBAAA,CAAA;IACtB,CAAiB,eAAA,CAAA;IACjB,CAAsB,oBAAA,CAAA;;;ACrEnB,MAAM,WAAW,GAAG;;ACA3B;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"taiga-ui-cdk-constants.js","sources":["../../../projects/cdk/constants/always-false-handler.ts","../../../projects/cdk/constants/always-true-handler.ts","../../../projects/cdk/constants/browser.ts","../../../projects/cdk/constants/empty.ts","../../../projects/cdk/constants/stringify.ts","../../../projects/cdk/constants/matcher.ts","../../../projects/cdk/constants/parent-animation.ts","../../../projects/cdk/constants/polling-time.ts","../../../projects/cdk/constants/svg-node-filter.ts","../../../projects/cdk/constants/unicode-chars.ts","../../../projects/cdk/constants/used-icons.ts","../../../projects/cdk/constants/version.ts","../../../projects/cdk/constants/taiga-ui-cdk-constants.ts"],"sourcesContent":["/**\n * Handler that always returns `false`.\n */\n// eslint-disable-next-line no-restricted-syntax\nexport const ALWAYS_FALSE_HANDLER = (): false => false;\n","/**\n * Handler that always returns `true`.\n */\n// eslint-disable-next-line no-restricted-syntax\nexport const ALWAYS_TRUE_HANDLER = (): true => true;\n","/**\n * @deprecated\n * TODO: drop support of legacy Edge (EdgeHTML) in v4.x\n */\nexport const CHROMIUM_EDGE_START_VERSION = 79;\n","import {QueryList} from '@angular/core';\n\n/**\n * For type safety when using @ContentChildren and @ViewChildren\n *\n * NOTE: Be careful subscribing to 'changes'\n */\nexport const EMPTY_QUERY = new QueryList<any>();\nexport const EMPTY_ARRAY: [] = [];\nexport const EMPTY_FUNCTION: (...args: any[]) => void = () => {};\n\nconst rect = {\n bottom: 0,\n height: 0,\n left: 0,\n right: 0,\n top: 0,\n width: 0,\n x: 0,\n y: 0,\n} as const;\n\nexport const EMPTY_CLIENT_RECT: DOMRect = {\n ...rect,\n toJSON() {\n return rect;\n },\n};\n","import {TuiStringHandler} from '@taiga-ui/cdk/types';\n\n/**\n * Default method to turn arbitrary object into string\n */\nexport const TUI_DEFAULT_STRINGIFY: TuiStringHandler<unknown> = item => String(item);\n","import {TuiHandler, TuiIdentityMatcher} from '@taiga-ui/cdk/types';\n\nimport {TUI_DEFAULT_STRINGIFY} from './stringify';\n\n/**\n * Default handler for matching stringified version of an item and a search query\n * @param item arbitrary element to match with a string\n * @param search search query\n * @param stringify handler to turn item into a string\n */\nexport const TUI_DEFAULT_MATCHER = <T>(\n item: T,\n search: string,\n stringify: TuiHandler<T, string> = TUI_DEFAULT_STRINGIFY,\n): boolean => stringify(item).toLowerCase().includes(search.toLowerCase());\n\n/**\n * Default handler for strict matching stringified version of an item and a search query\n * @param item arbitrary element to match with a string\n * @param search search query\n * @param stringify handler to turn item into a string\n */\nexport const TUI_STRICT_MATCHER = <T>(\n item: T,\n search: string,\n stringify: TuiHandler<T, string> = TUI_DEFAULT_STRINGIFY,\n): boolean => stringify(item).toLowerCase() === search.toLowerCase();\n\n/**\n * Default handler to match equality of two elements\n * ATTENTION: considers two empty arrays equal\n *\n * @param item1 first element\n * @param item2 second element\n */\nexport const TUI_DEFAULT_IDENTITY_MATCHER: TuiIdentityMatcher<unknown> = (item1, item2) =>\n item1 === item2 || bothEmpty(item1, item2);\n\nfunction bothEmpty(item1: unknown, item2: unknown): boolean {\n return Array.isArray(item1) && Array.isArray(item2) && !item1.length && !item2.length;\n}\n","import {animateChild, query, transition, trigger} from '@angular/animations';\n\n/**\n * Add to enable child :leave animation (fixes https://github.com/angular/angular/issues/15753)\n */\nexport const TUI_PARENT_ANIMATION = trigger(`tuiParentAnimation`, [\n transition(`:leave`, [query(`:scope > *`, [animateChild()], {optional: true})]),\n]);\n\n/**\n * Add on parent to stop initial :enter animation for children\n */\nexport const TUI_PARENT_STOP = trigger(`tuiParentStop`, [transition(`:enter`, [])]);\n","export const POLLING_TIME = 1000 / 15;\n","// Filtering SVGElements for TreeWalker\n// Filter must be a function in IE, other modern browsers are compliant to this format\nexport const svgNodeFilter: NodeFilter = ((node: Node) =>\n `ownerSVGElement` in node\n ? NodeFilter.FILTER_REJECT\n : NodeFilter.FILTER_ACCEPT) as any;\n","/**\n * {@link https://unicode-table.com/en/00A0/ Non-breaking space}.\n */\nexport const CHAR_NO_BREAK_SPACE = `\\u00A0`;\n\n/**\n * {@link https://unicode-table.com/en/2013/ EN dash}\n * is used to indicate a range of numbers or a span of time.\n * @example 2006–2022\n * ___\n * Don't confuse with {@link CHAR_EM_DASH} or {@link CHAR_HYPHEN}!\n */\nexport const CHAR_EN_DASH = `\\u2013`;\n\n/**\n * {@link https://unicode-table.com/en/2014/ EM dash}\n * is used to mark a break in a sentence.\n * @example Taiga UI — powerful set of open source components for Angular\n * ___\n * Don't confuse with {@link CHAR_EN_DASH} or {@link CHAR_HYPHEN}!\n */\nexport const CHAR_EM_DASH = `\\u2014`;\n\n/**\n * {@link https://unicode-table.com/en/00AB/ Left-Pointing Double Angle Quotation Mark}\n */\nexport const CHAR_LAQUO = `\\u00AB`;\n\n/**\n * {@link https://unicode-table.com/en/00BB/ Right-Pointing Double Angle Quotation Mark}\n */\nexport const CHAR_RAQUO = `\\u00BB`;\n\n/**\n * {@link https://unicode-table.com/en/002D/ Hyphen (minus sign)}\n * is used to combine words.\n * @example well-behaved\n * ___\n * Don't confuse with {@link CHAR_EN_DASH} or {@link CHAR_EM_DASH}!\n */\nexport const CHAR_HYPHEN = `\\u002D`;\n\n/**\n * {@link https://unicode-table.com/en/2212/ Minus}\n * is used as math operator symbol or before negative digits.\n * ---\n * Can be used as `−`. Don't confuse with {@link CHAR_HYPHEN}\n */\nexport const CHAR_MINUS = `\\u2212`;\n\n/**\n * {@link https://unicode-table.com/en/002B/ Plus}\n */\nexport const CHAR_PLUS = `\\u002B`;\n\n/**\n * {@link https://unicode-table.com/en/2022/ Bullet}.\n */\nexport const CHAR_BULLET = `\\u2022`;\n\n/**\n * {@link https://unicode-table.com/en/2026/ Suspension points}.\n */\nexport const CHAR_ELLIPSIS = `\\u2026`;\n\n/**\n * {@link https://unicode-table.com/en/00A4/ Suspension points}.\n */\nexport const CHAR_CURRENCY_SIGN = `\\u00A4`;\n\n/**\n * {@link https://unicode-table.com/en/200b/ Suspension points}.\n */\nexport const CHAR_ZERO_WIDTH_SPACE = `\\u200B`;\n","/**\n * @description:\n * AUTOGENERATED\n *\n * Array of icons used in taiga-ui components\n */\nexport const TUI_USED_ICONS = [\n 'tuiIconMirMono',\n 'tuiIconVisaMono',\n 'tuiIconElectronMono',\n 'tuiIconMastercard',\n 'tuiIconMaestro',\n 'tuiIconAmex',\n 'tuiIconDinersClub',\n 'tuiIconDiscover',\n 'tuiIconHumo',\n 'tuiIconJCB',\n 'tuiIconRuPay',\n 'tuiIconUnionPay',\n 'tuiIconUzcard',\n 'tuiIconVerve',\n 'tuiIconCopyLarge',\n 'tuiIconCheckLarge',\n 'tuiIconLink',\n 'tuiIconSearch',\n 'tuiIconSun',\n 'tuiIconMoon',\n 'tuiIconCode',\n 'tuiIconMenuLarge',\n 'tuiIconRotate',\n 'tuiIconArrowLeft',\n 'tuiIconArrowRight',\n 'tuiIconPlus',\n 'tuiIconMinus',\n 'tuiIconMinimize',\n 'tuiIconEye',\n 'tuiIconEyeOff',\n 'tuiIconDrag',\n 'tuiIconSortAscending',\n 'tuiIconSortDescending',\n 'tuiIconSortOff',\n 'tuiIconCheck',\n 'tuiIconMinusLarge',\n 'tuiIconChevronUp',\n 'tuiIconHelpCircle',\n 'tuiIconClose',\n 'tuiIconAlertCircle',\n 'tuiIconChevronRight',\n 'tuiIconInfo',\n 'tuiIconCheckCircle',\n 'tuiIconXCircle',\n 'tuiIconChevronLeft',\n 'tuiIconStarLarge',\n 'tuiIconChevronDown',\n 'tuiIconChevronDownLarge',\n 'tuiIconFileLarge',\n 'tuiIconTrashLarge',\n 'tuiIconAlertCircleLarge',\n 'tuiIconCheckCircleLarge',\n 'tuiIconCopy',\n 'tuiIconEyeOffLarge',\n 'tuiIconEyeLarge',\n 'tuiIconClock',\n 'tuiIconClockLarge',\n 'tuiIconToggleOff',\n 'tuiIconToggleOffLarge',\n 'tuiIconToggleOn',\n 'tuiIconToggleOnLarge',\n 'tuiIconCalendar',\n 'tuiIconCalendarLarge',\n] as const;\n","export const TUI_VERSION = `3.54.0`;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAAA;;AAEG;AACH;MACa,oBAAoB,GAAG,MAAa;;ACJjD;;AAEG;AACH;MACa,mBAAmB,GAAG,MAAY;;ACJ/C;;;AAGG;AACI,MAAM,2BAA2B,GAAG;;ACF3C;;;;AAIG;AACU,MAAA,WAAW,GAAG,IAAI,SAAS,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B,gBAAgB;IAChB,aAAa;IACb,mBAAmB;IACnB,iBAAiB;IACjB,aAAa;IACb,YAAY;IACZ,cAAc;IACd,iBAAiB;IACjB,eAAe;IACf,cAAc;IACd,kBAAkB;IAClB,mBAAmB;IACnB,aAAa;IACb,eAAe;IACf,YAAY;IACZ,aAAa;IACb,aAAa;IACb,kBAAkB;IAClB,eAAe;IACf,kBAAkB;IAClB,mBAAmB;IACnB,aAAa;IACb,cAAc;IACd,iBAAiB;IACjB,YAAY;IACZ,eAAe;IACf,aAAa;IACb,sBAAsB;IACtB,uBAAuB;IACvB,gBAAgB;IAChB,cAAc;IACd,mBAAmB;IACnB,kBAAkB;IAClB,mBAAmB;IACnB,cAAc;IACd,oBAAoB;IACpB,qBAAqB;IACrB,aAAa;IACb,oBAAoB;IACpB,gBAAgB;IAChB,oBAAoB;IACpB,kBAAkB;IAClB,oBAAoB;IACpB,yBAAyB;IACzB,kBAAkB;IAClB,mBAAmB;IACnB,yBAAyB;IACzB,yBAAyB;IACzB,aAAa;IACb,oBAAoB;IACpB,iBAAiB;IACjB,cAAc;IACd,mBAAmB;IACnB,kBAAkB;IAClB,uBAAuB;IACvB,iBAAiB;IACjB,sBAAsB;IACtB,iBAAiB;IACjB,sBAAsB;;;ACrEnB,MAAM,WAAW,GAAG;;ACA3B;;AAEG;;;;"}
|
@@ -184,11 +184,10 @@ class TuiIosAutofocusHandler extends AbstractTuiAutofocusHandler {
|
|
184
184
|
* so that when focusing the dialogs don't shake
|
185
185
|
*/
|
186
186
|
patchCssStyles() {
|
187
|
-
|
188
|
-
for (const element of [doc.documentElement, doc.body]) {
|
187
|
+
[this.win.document.documentElement, this.win.document.body].forEach(element => {
|
189
188
|
element.style.setProperty(`overflow`, `auto`);
|
190
189
|
element.style.setProperty(`height`, `100%`);
|
191
|
-
}
|
190
|
+
});
|
192
191
|
}
|
193
192
|
/**
|
194
193
|
* @note:
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"taiga-ui-cdk-directives-auto-focus.js","sources":["../../../projects/cdk/directives/auto-focus/handlers/abstract.handler.ts","../../../projects/cdk/directives/auto-focus/handlers/default.handler.ts","../../../projects/cdk/directives/auto-focus/handlers/ios.handler.ts","../../../projects/cdk/directives/auto-focus/autofocus.options.ts","../../../projects/cdk/directives/auto-focus/autofocus.directive.ts","../../../projects/cdk/directives/auto-focus/autofocus.module.ts","../../../projects/cdk/directives/auto-focus/handlers/sync.handler.ts","../../../projects/cdk/directives/auto-focus/taiga-ui-cdk-directives-auto-focus.ts"],"sourcesContent":["import {Directive, ElementRef} from '@angular/core';\nimport {\n TuiFocusableElementAccessor,\n TuiNativeFocusableElement,\n} from '@taiga-ui/cdk/interfaces';\n\nimport type {TuiAutofocusHandler} from '../autofocus.options';\n\n@Directive()\nexport abstract class AbstractTuiAutofocusHandler implements TuiAutofocusHandler {\n protected constructor(\n protected readonly focusable: TuiFocusableElementAccessor | null,\n protected readonly el: ElementRef<HTMLElement>,\n ) {}\n\n protected get element(): TuiNativeFocusableElement {\n return this.focusable?.nativeFocusableElement || this.el.nativeElement;\n }\n\n protected get isTextFieldElement(): boolean {\n return this.element.matches(`input, textarea, [contenteditable]`);\n }\n\n abstract setFocus(): void;\n}\n","import {Directive, ElementRef, Inject, Optional, Self} from '@angular/core';\nimport {ANIMATION_FRAME} from '@ng-web-apis/common';\nimport {POLLING_TIME} from '@taiga-ui/cdk/constants';\nimport {TuiFocusableElementAccessor} from '@taiga-ui/cdk/interfaces';\nimport {TUI_FOCUSABLE_ITEM_ACCESSOR} from '@taiga-ui/cdk/tokens';\nimport {Observable, race, timer} from 'rxjs';\nimport {map, skipWhile, take, throttleTime} from 'rxjs/operators';\n\nimport {AbstractTuiAutofocusHandler} from './abstract.handler';\n\nconst TIMEOUT = 1000;\nconst NG_ANIMATION_SELECTOR = `.ng-animating`;\n\n@Directive()\nexport class TuiDefaultAutofocusHandler extends AbstractTuiAutofocusHandler {\n constructor(\n @Optional()\n @Self()\n @Inject(TUI_FOCUSABLE_ITEM_ACCESSOR)\n focusable: TuiFocusableElementAccessor | null,\n @Inject(ElementRef) el: ElementRef<HTMLElement>,\n @Inject(ANIMATION_FRAME) private readonly animationFrame$: Observable<number>,\n ) {\n super(focusable, el);\n }\n\n setFocus(): void {\n if (this.isTextFieldElement) {\n race(\n timer(TIMEOUT),\n this.animationFrame$.pipe(\n throttleTime(POLLING_TIME),\n map(() => this.element.closest(NG_ANIMATION_SELECTOR)),\n skipWhile(Boolean),\n take(1),\n ),\n ).subscribe(() => this.element.focus({preventScroll: true}));\n } else {\n this.element.focus({preventScroll: true});\n }\n }\n}\n","import {\n Directive,\n ElementRef,\n Inject,\n NgZone,\n Optional,\n Renderer2,\n Self,\n} from '@angular/core';\nimport {WINDOW} from '@ng-web-apis/common';\nimport {TuiFocusableElementAccessor} from '@taiga-ui/cdk/interfaces';\nimport {TUI_FOCUSABLE_ITEM_ACCESSOR} from '@taiga-ui/cdk/tokens';\nimport {tuiIsPresent, tuiPx} from '@taiga-ui/cdk/utils';\n\nimport {AbstractTuiAutofocusHandler} from './abstract.handler';\n\nconst TEXTFIELD_ATTRS = [\n `type`,\n `inputMode`,\n `autocomplete`,\n `accept`,\n `min`,\n `max`,\n `step`,\n `pattern`,\n `size`,\n `maxlength`,\n] as const;\n\n@Directive()\nexport class TuiIosAutofocusHandler extends AbstractTuiAutofocusHandler {\n constructor(\n @Optional()\n @Self()\n @Inject(TUI_FOCUSABLE_ITEM_ACCESSOR)\n focusable: TuiFocusableElementAccessor | null,\n @Inject(ElementRef) el: ElementRef<HTMLElement>,\n @Inject(Renderer2) private readonly renderer: Renderer2,\n @Inject(NgZone) private readonly zone: NgZone,\n @Inject(WINDOW) private readonly win: Window,\n ) {\n super(focusable, el);\n this.patchCssStyles();\n }\n\n setFocus(): void {\n if (this.isTextFieldElement) {\n this.zone.runOutsideAngular(() => this.iosWebkitAutofocus());\n } else {\n this.element.focus({preventScroll: true});\n }\n }\n\n private iosWebkitAutofocus(): void {\n const fakeInput: HTMLInputElement = this.makeFakeInput();\n const duration = this.getDurationTimeBeforeFocus();\n let fakeFocusTimeoutId = 0;\n let elementFocusTimeoutId = 0;\n\n const blurHandler = (): void => fakeInput.focus({preventScroll: true});\n const focusHandler = (): void => {\n clearTimeout(fakeFocusTimeoutId);\n\n fakeFocusTimeoutId = this.win.setTimeout(() => {\n clearTimeout(elementFocusTimeoutId);\n\n fakeInput.removeEventListener(`blur`, blurHandler);\n fakeInput.removeEventListener(`focus`, focusHandler);\n\n elementFocusTimeoutId = this.win.setTimeout(() => {\n this.element.focus({preventScroll: false});\n fakeInput.remove();\n }, duration);\n });\n };\n\n fakeInput.addEventListener(`blur`, blurHandler, {once: true});\n fakeInput.addEventListener(`focus`, focusHandler);\n\n if (this.insideDialog()) {\n this.win.document.body.appendChild(fakeInput);\n } else {\n this.element.parentElement?.appendChild(fakeInput);\n }\n\n fakeInput.focus({preventScroll: true});\n }\n\n /**\n * @note:\n * emulate textfield position in layout with cursor\n * before focus to real textfield element\n *\n * required note:\n * [fakeInput.readOnly = true] ~\n * don't use {readOnly: true} value, it's doesn't work for emulate autofill\n *\n * [fakeInput.style.opacity = 0] ~\n * don't use {opacity: 0}, sometimes it's doesn't work for emulate real input\n *\n * [fakeInput.style.fontSize = 16px] ~\n * disable possible auto zoom\n *\n * [fakeInput.style.top/left] ~\n * emulate position cursor before focus to real textfield element\n */\n private makeFakeInput(): HTMLInputElement {\n const fakeInput: HTMLInputElement = this.renderer.createElement(`input`);\n const rect: DOMRect = this.element.getBoundingClientRect();\n\n this.patchFakeInputFromFocusableElement(fakeInput);\n\n fakeInput.style.height = tuiPx(rect.height);\n fakeInput.style.width = tuiPx(rect.width / 2);\n fakeInput.style.position = `fixed`;\n fakeInput.style.zIndex = `-99999999`;\n fakeInput.style.caretColor = `transparent`;\n fakeInput.style.border = `none`;\n fakeInput.style.outline = `none`;\n fakeInput.style.color = `transparent`;\n fakeInput.style.background = `transparent`;\n fakeInput.style.cursor = `none`;\n fakeInput.style.fontSize = tuiPx(16);\n fakeInput.style.top = tuiPx(rect.top);\n fakeInput.style.left = tuiPx(rect.left);\n\n return fakeInput;\n }\n\n private getDurationTimeBeforeFocus(): number {\n return (\n parseFloat(\n this.win\n .getComputedStyle(this.element)\n .getPropertyValue(`--tui-duration`),\n ) || 0\n );\n }\n\n /**\n * @note:\n * unfortunately, in older versions of iOS\n * there is a bug that the fake input cursor\n * will move along with the dialog animation\n * and then that dialog will be shaking\n */\n private insideDialog(): boolean {\n return !!this.element.closest(`tui-dialog`);\n }\n\n /**\n * @note:\n * This is necessary so that the viewport isn't recalculated\n * and then the dialogs don't shake.\n *\n * Also, we need to fixed height viewport,\n * so that when focusing the dialogs don't shake\n */\n private patchCssStyles(): void {\n const doc = this.win.document;\n\n for (const element of [doc.documentElement, doc.body]) {\n element.style.setProperty(`overflow`, `auto`);\n element.style.setProperty(`height`, `100%`);\n }\n }\n\n /**\n * @note:\n * inherit basic attributes values from real input\n * for help iOS detect what do you want see on keyboard,\n * for example [inputMode=numeric, autocomplete=cc-number]\n */\n private patchFakeInputFromFocusableElement(fakeInput: HTMLInputElement): void {\n TEXTFIELD_ATTRS.forEach(attr => {\n const value = this.element.getAttribute(attr);\n\n if (tuiIsPresent(value)) {\n fakeInput.setAttribute(attr, value);\n }\n });\n }\n}\n","import {\n ElementRef,\n InjectionToken,\n NgZone,\n Optional,\n Provider,\n Renderer2,\n Self,\n} from '@angular/core';\nimport {ANIMATION_FRAME, WINDOW} from '@ng-web-apis/common';\nimport {TuiFocusableElementAccessor} from '@taiga-ui/cdk/interfaces';\nimport {TuiDestroyService} from '@taiga-ui/cdk/services';\nimport {TUI_FOCUSABLE_ITEM_ACCESSOR, TUI_IS_IOS} from '@taiga-ui/cdk/tokens';\nimport {tuiCreateToken, tuiProvideOptions} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {Observable} from 'rxjs';\n\nimport {TuiDefaultAutofocusHandler} from './handlers/default.handler';\n// eslint-disable-next-line import/no-cycle\nimport {TuiIosAutofocusHandler} from './handlers/ios.handler';\n\nexport interface TuiAutofocusHandler {\n setFocus(): void;\n}\n\nexport interface TuiAutofocusOptions {\n readonly delay: number;\n}\n\nexport const TUI_AUTOFOCUS_DEFAULT_OPTIONS: TuiAutofocusOptions = {\n delay: NaN, // NaN = no delay/sync\n};\n\nexport const TUI_AUTOFOCUS_OPTIONS = tuiCreateToken(TUI_AUTOFOCUS_DEFAULT_OPTIONS);\n\nexport function tuiAutoFocusOptionsProvider(\n options: Partial<TuiAutofocusOptions>,\n): Provider {\n return tuiProvideOptions(\n TUI_AUTOFOCUS_OPTIONS,\n options,\n TUI_AUTOFOCUS_DEFAULT_OPTIONS,\n );\n}\n\nexport const TUI_AUTOFOCUS_HANDLER = new InjectionToken<TuiAutofocusHandler>(\n `[TUI_AUTOFOCUS_HANDLER]`,\n);\n\nexport const TUI_AUTOFOCUS_PROVIDERS = [\n {\n provide: TUI_AUTOFOCUS_HANDLER,\n useFactory: (\n focusable: TuiFocusableElementAccessor | null,\n el: ElementRef<HTMLElement>,\n animationFrame$: Observable<number>,\n renderer: Renderer2,\n zone: NgZone,\n win: Window,\n isIos: boolean,\n ) =>\n isIos\n ? new TuiIosAutofocusHandler(focusable, el, renderer, zone, win)\n : new TuiDefaultAutofocusHandler(focusable, el, animationFrame$),\n deps: [\n [new Optional(), new Self(), TUI_FOCUSABLE_ITEM_ACCESSOR],\n ElementRef,\n ANIMATION_FRAME,\n Renderer2,\n NgZone,\n WINDOW,\n TUI_IS_IOS,\n ],\n },\n TuiDestroyService,\n];\n","import {AfterViewInit, Directive, Inject, Input, Self} from '@angular/core';\nimport {tuiCoerceBooleanProperty} from '@taiga-ui/cdk/coercion';\nimport {TuiDestroyService} from '@taiga-ui/cdk/services';\nimport {timer} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\nimport {\n TUI_AUTOFOCUS_HANDLER,\n TUI_AUTOFOCUS_OPTIONS,\n TUI_AUTOFOCUS_PROVIDERS,\n TuiAutofocusHandler,\n TuiAutofocusOptions,\n} from './autofocus.options';\n\n@Directive({\n selector: '[tuiAutoFocus]',\n providers: TUI_AUTOFOCUS_PROVIDERS,\n})\nexport class TuiAutoFocusDirective implements AfterViewInit {\n @Input('tuiAutoFocus')\n autoFocus: boolean | '' = true;\n\n constructor(\n @Inject(TUI_AUTOFOCUS_HANDLER)\n private readonly handler: TuiAutofocusHandler,\n @Inject(TUI_AUTOFOCUS_OPTIONS)\n private readonly options: TuiAutofocusOptions,\n @Self()\n @Inject(TuiDestroyService)\n private readonly destroy$: TuiDestroyService,\n ) {}\n\n ngAfterViewInit(): void {\n if (tuiCoerceBooleanProperty(this.autoFocus)) {\n this.focus();\n }\n }\n\n focus(): void {\n if (Number.isNaN(this.options.delay)) {\n void Promise.resolve().then(() => this.handler.setFocus());\n } else {\n timer(this.options.delay)\n .pipe(takeUntil(this.destroy$))\n .subscribe(() => this.handler.setFocus());\n }\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiAutoFocusDirective} from './autofocus.directive';\n\n@NgModule({\n declarations: [TuiAutoFocusDirective],\n exports: [TuiAutoFocusDirective],\n})\nexport class TuiAutoFocusModule {}\n","import {Directive, ElementRef, Inject, Optional, Self} from '@angular/core';\nimport {TuiFocusableElementAccessor} from '@taiga-ui/cdk/interfaces';\nimport {TUI_FOCUSABLE_ITEM_ACCESSOR} from '@taiga-ui/cdk/tokens';\n\nimport {AbstractTuiAutofocusHandler} from './abstract.handler';\n\n@Directive()\nexport class TuiSynchronousAutofocusHandler extends AbstractTuiAutofocusHandler {\n constructor(\n @Optional()\n @Self()\n @Inject(TUI_FOCUSABLE_ITEM_ACCESSOR)\n focusable: TuiFocusableElementAccessor | null,\n @Inject(ElementRef) el: ElementRef<HTMLElement>,\n ) {\n super(focusable, el);\n }\n\n setFocus(): void {\n this.element.focus({preventScroll: true});\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;MASsB,2BAA2B,CA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,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;gHANb,8BAA8B,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;4FAA9B,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAD1C,SAAS;;0BAGD,QAAQ;;0BACR,IAAI;;0BACJ,MAAM;2BAAC,2BAA2B,CAAA;;0BAElC,MAAM;2BAAC,UAAU,CAAA;;;ACb1B;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"taiga-ui-cdk-directives-auto-focus.js","sources":["../../../projects/cdk/directives/auto-focus/handlers/abstract.handler.ts","../../../projects/cdk/directives/auto-focus/handlers/default.handler.ts","../../../projects/cdk/directives/auto-focus/handlers/ios.handler.ts","../../../projects/cdk/directives/auto-focus/autofocus.options.ts","../../../projects/cdk/directives/auto-focus/autofocus.directive.ts","../../../projects/cdk/directives/auto-focus/autofocus.module.ts","../../../projects/cdk/directives/auto-focus/handlers/sync.handler.ts","../../../projects/cdk/directives/auto-focus/taiga-ui-cdk-directives-auto-focus.ts"],"sourcesContent":["import {Directive, ElementRef} from '@angular/core';\nimport {\n TuiFocusableElementAccessor,\n TuiNativeFocusableElement,\n} from '@taiga-ui/cdk/interfaces';\n\nimport type {TuiAutofocusHandler} from '../autofocus.options';\n\n@Directive()\nexport abstract class AbstractTuiAutofocusHandler implements TuiAutofocusHandler {\n protected constructor(\n protected readonly focusable: TuiFocusableElementAccessor | null,\n protected readonly el: ElementRef<HTMLElement>,\n ) {}\n\n protected get element(): TuiNativeFocusableElement {\n return this.focusable?.nativeFocusableElement || this.el.nativeElement;\n }\n\n protected get isTextFieldElement(): boolean {\n return this.element.matches(`input, textarea, [contenteditable]`);\n }\n\n abstract setFocus(): void;\n}\n","import {Directive, ElementRef, Inject, Optional, Self} from '@angular/core';\nimport {ANIMATION_FRAME} from '@ng-web-apis/common';\nimport {POLLING_TIME} from '@taiga-ui/cdk/constants';\nimport {TuiFocusableElementAccessor} from '@taiga-ui/cdk/interfaces';\nimport {TUI_FOCUSABLE_ITEM_ACCESSOR} from '@taiga-ui/cdk/tokens';\nimport {Observable, race, timer} from 'rxjs';\nimport {map, skipWhile, take, throttleTime} from 'rxjs/operators';\n\nimport {AbstractTuiAutofocusHandler} from './abstract.handler';\n\nconst TIMEOUT = 1000;\nconst NG_ANIMATION_SELECTOR = `.ng-animating`;\n\n@Directive()\nexport class TuiDefaultAutofocusHandler extends AbstractTuiAutofocusHandler {\n constructor(\n @Optional()\n @Self()\n @Inject(TUI_FOCUSABLE_ITEM_ACCESSOR)\n focusable: TuiFocusableElementAccessor | null,\n @Inject(ElementRef) el: ElementRef<HTMLElement>,\n @Inject(ANIMATION_FRAME) private readonly animationFrame$: Observable<number>,\n ) {\n super(focusable, el);\n }\n\n setFocus(): void {\n if (this.isTextFieldElement) {\n race(\n timer(TIMEOUT),\n this.animationFrame$.pipe(\n throttleTime(POLLING_TIME),\n map(() => this.element.closest(NG_ANIMATION_SELECTOR)),\n skipWhile(Boolean),\n take(1),\n ),\n ).subscribe(() => this.element.focus({preventScroll: true}));\n } else {\n this.element.focus({preventScroll: true});\n }\n }\n}\n","import {\n Directive,\n ElementRef,\n Inject,\n NgZone,\n Optional,\n Renderer2,\n Self,\n} from '@angular/core';\nimport {WINDOW} from '@ng-web-apis/common';\nimport {TuiFocusableElementAccessor} from '@taiga-ui/cdk/interfaces';\nimport {TUI_FOCUSABLE_ITEM_ACCESSOR} from '@taiga-ui/cdk/tokens';\nimport {tuiIsPresent, tuiPx} from '@taiga-ui/cdk/utils';\n\nimport {AbstractTuiAutofocusHandler} from './abstract.handler';\n\nconst TEXTFIELD_ATTRS = [\n `type`,\n `inputMode`,\n `autocomplete`,\n `accept`,\n `min`,\n `max`,\n `step`,\n `pattern`,\n `size`,\n `maxlength`,\n] as const;\n\n@Directive()\nexport class TuiIosAutofocusHandler extends AbstractTuiAutofocusHandler {\n constructor(\n @Optional()\n @Self()\n @Inject(TUI_FOCUSABLE_ITEM_ACCESSOR)\n focusable: TuiFocusableElementAccessor | null,\n @Inject(ElementRef) el: ElementRef<HTMLElement>,\n @Inject(Renderer2) private readonly renderer: Renderer2,\n @Inject(NgZone) private readonly zone: NgZone,\n @Inject(WINDOW) private readonly win: Window,\n ) {\n super(focusable, el);\n this.patchCssStyles();\n }\n\n setFocus(): void {\n if (this.isTextFieldElement) {\n this.zone.runOutsideAngular(() => this.iosWebkitAutofocus());\n } else {\n this.element.focus({preventScroll: true});\n }\n }\n\n private iosWebkitAutofocus(): void {\n const fakeInput: HTMLInputElement = this.makeFakeInput();\n const duration = this.getDurationTimeBeforeFocus();\n let fakeFocusTimeoutId = 0;\n let elementFocusTimeoutId = 0;\n\n const blurHandler = (): void => fakeInput.focus({preventScroll: true});\n const focusHandler = (): void => {\n clearTimeout(fakeFocusTimeoutId);\n\n fakeFocusTimeoutId = this.win.setTimeout(() => {\n clearTimeout(elementFocusTimeoutId);\n\n fakeInput.removeEventListener(`blur`, blurHandler);\n fakeInput.removeEventListener(`focus`, focusHandler);\n\n elementFocusTimeoutId = this.win.setTimeout(() => {\n this.element.focus({preventScroll: false});\n fakeInput.remove();\n }, duration);\n });\n };\n\n fakeInput.addEventListener(`blur`, blurHandler, {once: true});\n fakeInput.addEventListener(`focus`, focusHandler);\n\n if (this.insideDialog()) {\n this.win.document.body.appendChild(fakeInput);\n } else {\n this.element.parentElement?.appendChild(fakeInput);\n }\n\n fakeInput.focus({preventScroll: true});\n }\n\n /**\n * @note:\n * emulate textfield position in layout with cursor\n * before focus to real textfield element\n *\n * required note:\n * [fakeInput.readOnly = true] ~\n * don't use {readOnly: true} value, it's doesn't work for emulate autofill\n *\n * [fakeInput.style.opacity = 0] ~\n * don't use {opacity: 0}, sometimes it's doesn't work for emulate real input\n *\n * [fakeInput.style.fontSize = 16px] ~\n * disable possible auto zoom\n *\n * [fakeInput.style.top/left] ~\n * emulate position cursor before focus to real textfield element\n */\n private makeFakeInput(): HTMLInputElement {\n const fakeInput: HTMLInputElement = this.renderer.createElement(`input`);\n const rect: DOMRect = this.element.getBoundingClientRect();\n\n this.patchFakeInputFromFocusableElement(fakeInput);\n\n fakeInput.style.height = tuiPx(rect.height);\n fakeInput.style.width = tuiPx(rect.width / 2);\n fakeInput.style.position = `fixed`;\n fakeInput.style.zIndex = `-99999999`;\n fakeInput.style.caretColor = `transparent`;\n fakeInput.style.border = `none`;\n fakeInput.style.outline = `none`;\n fakeInput.style.color = `transparent`;\n fakeInput.style.background = `transparent`;\n fakeInput.style.cursor = `none`;\n fakeInput.style.fontSize = tuiPx(16);\n fakeInput.style.top = tuiPx(rect.top);\n fakeInput.style.left = tuiPx(rect.left);\n\n return fakeInput;\n }\n\n private getDurationTimeBeforeFocus(): number {\n return (\n parseFloat(\n this.win\n .getComputedStyle(this.element)\n .getPropertyValue(`--tui-duration`),\n ) || 0\n );\n }\n\n /**\n * @note:\n * unfortunately, in older versions of iOS\n * there is a bug that the fake input cursor\n * will move along with the dialog animation\n * and then that dialog will be shaking\n */\n private insideDialog(): boolean {\n return !!this.element.closest(`tui-dialog`);\n }\n\n /**\n * @note:\n * This is necessary so that the viewport isn't recalculated\n * and then the dialogs don't shake.\n *\n * Also, we need to fixed height viewport,\n * so that when focusing the dialogs don't shake\n */\n private patchCssStyles(): void {\n [this.win.document.documentElement, this.win.document.body].forEach(element => {\n element.style.setProperty(`overflow`, `auto`);\n element.style.setProperty(`height`, `100%`);\n });\n }\n\n /**\n * @note:\n * inherit basic attributes values from real input\n * for help iOS detect what do you want see on keyboard,\n * for example [inputMode=numeric, autocomplete=cc-number]\n */\n private patchFakeInputFromFocusableElement(fakeInput: HTMLInputElement): void {\n TEXTFIELD_ATTRS.forEach(attr => {\n const value = this.element.getAttribute(attr);\n\n if (tuiIsPresent(value)) {\n fakeInput.setAttribute(attr, value);\n }\n });\n }\n}\n","import {\n ElementRef,\n InjectionToken,\n NgZone,\n Optional,\n Provider,\n Renderer2,\n Self,\n} from '@angular/core';\nimport {ANIMATION_FRAME, WINDOW} from '@ng-web-apis/common';\nimport {TuiFocusableElementAccessor} from '@taiga-ui/cdk/interfaces';\nimport {TuiDestroyService} from '@taiga-ui/cdk/services';\nimport {TUI_FOCUSABLE_ITEM_ACCESSOR, TUI_IS_IOS} from '@taiga-ui/cdk/tokens';\nimport {tuiCreateToken, tuiProvideOptions} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {Observable} from 'rxjs';\n\nimport {TuiDefaultAutofocusHandler} from './handlers/default.handler';\nimport {TuiIosAutofocusHandler} from './handlers/ios.handler';\n\nexport interface TuiAutofocusHandler {\n setFocus(): void;\n}\n\nexport interface TuiAutofocusOptions {\n readonly delay: number;\n}\n\nexport const TUI_AUTOFOCUS_DEFAULT_OPTIONS: TuiAutofocusOptions = {\n delay: NaN, // NaN = no delay/sync\n};\n\nexport const TUI_AUTOFOCUS_OPTIONS = tuiCreateToken(TUI_AUTOFOCUS_DEFAULT_OPTIONS);\n\nexport function tuiAutoFocusOptionsProvider(\n options: Partial<TuiAutofocusOptions>,\n): Provider {\n return tuiProvideOptions(\n TUI_AUTOFOCUS_OPTIONS,\n options,\n TUI_AUTOFOCUS_DEFAULT_OPTIONS,\n );\n}\n\nexport const TUI_AUTOFOCUS_HANDLER = new InjectionToken<TuiAutofocusHandler>(\n `[TUI_AUTOFOCUS_HANDLER]`,\n);\n\nexport const TUI_AUTOFOCUS_PROVIDERS = [\n {\n provide: TUI_AUTOFOCUS_HANDLER,\n useFactory: (\n focusable: TuiFocusableElementAccessor | null,\n el: ElementRef<HTMLElement>,\n animationFrame$: Observable<number>,\n renderer: Renderer2,\n zone: NgZone,\n win: Window,\n isIos: boolean,\n ) =>\n isIos\n ? new TuiIosAutofocusHandler(focusable, el, renderer, zone, win)\n : new TuiDefaultAutofocusHandler(focusable, el, animationFrame$),\n deps: [\n [new Optional(), new Self(), TUI_FOCUSABLE_ITEM_ACCESSOR],\n ElementRef,\n ANIMATION_FRAME,\n Renderer2,\n NgZone,\n WINDOW,\n TUI_IS_IOS,\n ],\n },\n TuiDestroyService,\n];\n","import {AfterViewInit, Directive, Inject, Input, Self} from '@angular/core';\nimport {tuiCoerceBooleanProperty} from '@taiga-ui/cdk/coercion';\nimport {TuiDestroyService} from '@taiga-ui/cdk/services';\nimport {timer} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\nimport {\n TUI_AUTOFOCUS_HANDLER,\n TUI_AUTOFOCUS_OPTIONS,\n TUI_AUTOFOCUS_PROVIDERS,\n TuiAutofocusHandler,\n TuiAutofocusOptions,\n} from './autofocus.options';\n\n@Directive({\n selector: '[tuiAutoFocus]',\n providers: TUI_AUTOFOCUS_PROVIDERS,\n})\nexport class TuiAutoFocusDirective implements AfterViewInit {\n @Input('tuiAutoFocus')\n autoFocus: boolean | '' = true;\n\n constructor(\n @Inject(TUI_AUTOFOCUS_HANDLER)\n private readonly handler: TuiAutofocusHandler,\n @Inject(TUI_AUTOFOCUS_OPTIONS)\n private readonly options: TuiAutofocusOptions,\n @Self()\n @Inject(TuiDestroyService)\n private readonly destroy$: TuiDestroyService,\n ) {}\n\n ngAfterViewInit(): void {\n if (tuiCoerceBooleanProperty(this.autoFocus)) {\n this.focus();\n }\n }\n\n focus(): void {\n if (Number.isNaN(this.options.delay)) {\n void Promise.resolve().then(() => this.handler.setFocus());\n } else {\n timer(this.options.delay)\n .pipe(takeUntil(this.destroy$))\n .subscribe(() => this.handler.setFocus());\n }\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiAutoFocusDirective} from './autofocus.directive';\n\n@NgModule({\n declarations: [TuiAutoFocusDirective],\n exports: [TuiAutoFocusDirective],\n})\nexport class TuiAutoFocusModule {}\n","import {Directive, ElementRef, Inject, Optional, Self} from '@angular/core';\nimport {TuiFocusableElementAccessor} from '@taiga-ui/cdk/interfaces';\nimport {TUI_FOCUSABLE_ITEM_ACCESSOR} from '@taiga-ui/cdk/tokens';\n\nimport {AbstractTuiAutofocusHandler} from './abstract.handler';\n\n@Directive()\nexport class TuiSynchronousAutofocusHandler extends AbstractTuiAutofocusHandler {\n constructor(\n @Optional()\n @Self()\n @Inject(TUI_FOCUSABLE_ITEM_ACCESSOR)\n focusable: TuiFocusableElementAccessor | null,\n @Inject(ElementRef) el: ElementRef<HTMLElement>,\n ) {\n super(focusable, el);\n }\n\n setFocus(): void {\n this.element.focus({preventScroll: true});\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;MASsB,2BAA2B,CAAA;IAC7C,WACuB,CAAA,SAA6C,EAC7C,EAA2B,EAAA;QAD3B,IAAS,CAAA,SAAA,GAAT,SAAS,CAAoC;QAC7C,IAAE,CAAA,EAAA,GAAF,EAAE,CAAyB;KAC9C;AAEJ,IAAA,IAAc,OAAO,GAAA;;AACjB,QAAA,OAAO,CAAA,CAAA,EAAA,GAAA,IAAI,CAAC,SAAS,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAE,sBAAsB,KAAI,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC;KAC1E;AAED,IAAA,IAAc,kBAAkB,GAAA;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA,kCAAA,CAAoC,CAAC,CAAC;KACrE;;yHAZiB,2BAA2B,EAAA,IAAA,EAAA,SAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;6GAA3B,2BAA2B,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;4FAA3B,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBADhD,SAAS;;;ACEV,MAAM,OAAO,GAAG,IAAI,CAAC;AACrB,MAAM,qBAAqB,GAAG,CAAA,aAAA,CAAe,CAAC;AAGxC,MAAO,0BAA2B,SAAQ,2BAA2B,CAAA;AACvE,IAAA,WAAA,CAII,SAA6C,EACzB,EAA2B,EACL,eAAmC,EAAA;AAE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AAC,CAAC;KACxB;IAED,QAAQ,GAAA;QACJ,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAC,aAAa,EAAE,IAAI,EAAC,CAAC,CAAC;KAC7C;;4HAbQ,8BAA8B,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAI3B,2BAA2B,EAAA,QAAA,EAAA,IAAA,EAAA,IAAA,EAAA,IAAA,EAAA,EAAA,EAAA,KAAA,EAE3B,UAAU,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;gHANb,8BAA8B,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;4FAA9B,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAD1C,SAAS;;0BAGD,QAAQ;;0BACR,IAAI;;0BACJ,MAAM;2BAAC,2BAA2B,CAAA;;0BAElC,MAAM;2BAAC,UAAU,CAAA;;;ACb1B;;AAEG;;;;"}
|
@@ -15,10 +15,7 @@ class TuiFocusTrapDirective {
|
|
15
15
|
* but it might cause ExpressionChanged error due to potential HostBinding.
|
16
16
|
* Microtask keeps it in the same frame but allows change detection to run
|
17
17
|
*/
|
18
|
-
|
19
|
-
Promise.resolve().then(() => {
|
20
|
-
this.el.nativeElement.focus();
|
21
|
-
});
|
18
|
+
void Promise.resolve().then(() => this.el.nativeElement.focus());
|
22
19
|
}
|
23
20
|
onBlur() {
|
24
21
|
this.renderer.removeAttribute(this.el.nativeElement, 'tabIndex');
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"taiga-ui-cdk-directives-focus-trap.js","sources":["../../../projects/cdk/directives/focus-trap/focus-trap.directive.ts","../../../projects/cdk/directives/focus-trap/focus-trap.module.ts","../../../projects/cdk/directives/focus-trap/taiga-ui-cdk-directives-focus-trap.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {\n Directive,\n ElementRef,\n HostListener,\n Inject,\n OnDestroy,\n Renderer2,\n} from '@angular/core';\nimport {tuiContainsOrAfter, tuiIsHTMLElement} from '@taiga-ui/cdk/utils/dom';\nimport {\n tuiBlurNativeFocused,\n tuiGetClosestFocusable,\n tuiGetNativeFocused,\n} from '@taiga-ui/cdk/utils/focus';\n\n@Directive({\n selector: '[tuiFocusTrap]',\n host: {\n tabIndex: '0',\n },\n})\nexport class TuiFocusTrapDirective implements OnDestroy {\n private readonly activeElement = tuiGetNativeFocused(this.doc);\n\n constructor(\n @Inject(DOCUMENT) private readonly doc: Document,\n @Inject(ElementRef)\n private readonly el: ElementRef<HTMLElement>,\n @Inject(Renderer2) private readonly renderer: Renderer2,\n ) {\n /**\n * This would cause currently focused element to lose focus,\n * but it might cause ExpressionChanged error due to potential HostBinding.\n * Microtask keeps it in the same frame but allows change detection to run\n */\n
|
1
|
+
{"version":3,"file":"taiga-ui-cdk-directives-focus-trap.js","sources":["../../../projects/cdk/directives/focus-trap/focus-trap.directive.ts","../../../projects/cdk/directives/focus-trap/focus-trap.module.ts","../../../projects/cdk/directives/focus-trap/taiga-ui-cdk-directives-focus-trap.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {\n Directive,\n ElementRef,\n HostListener,\n Inject,\n OnDestroy,\n Renderer2,\n} from '@angular/core';\nimport {tuiContainsOrAfter, tuiIsHTMLElement} from '@taiga-ui/cdk/utils/dom';\nimport {\n tuiBlurNativeFocused,\n tuiGetClosestFocusable,\n tuiGetNativeFocused,\n} from '@taiga-ui/cdk/utils/focus';\n\n@Directive({\n selector: '[tuiFocusTrap]',\n host: {\n tabIndex: '0',\n },\n})\nexport class TuiFocusTrapDirective implements OnDestroy {\n private readonly activeElement = tuiGetNativeFocused(this.doc);\n\n constructor(\n @Inject(DOCUMENT) private readonly doc: Document,\n @Inject(ElementRef)\n private readonly el: ElementRef<HTMLElement>,\n @Inject(Renderer2) private readonly renderer: Renderer2,\n ) {\n /**\n * This would cause currently focused element to lose focus,\n * but it might cause ExpressionChanged error due to potential HostBinding.\n * Microtask keeps it in the same frame but allows change detection to run\n */\n void Promise.resolve().then(() => this.el.nativeElement.focus());\n }\n\n @HostListener('blur')\n onBlur(): void {\n this.renderer.removeAttribute(this.el.nativeElement, 'tabIndex');\n }\n\n @HostListener('window:focusin.silent', ['$event.target'])\n onFocusIn(node: Node): void {\n const {nativeElement} = this.el;\n\n if (tuiContainsOrAfter(nativeElement, node)) {\n return;\n }\n\n const focusable = tuiGetClosestFocusable({\n initial: nativeElement,\n root: nativeElement,\n });\n\n if (focusable) {\n focusable.focus();\n }\n }\n\n ngOnDestroy(): void {\n tuiBlurNativeFocused(this.doc);\n\n /**\n * HostListeners are triggered even after ngOnDestroy\n * {@link https://github.com/angular/angular/issues/38100}\n * so we need to delay it but stay in the same sync cycle,\n * therefore using Promise instead of setTimeout\n */\n // eslint-disable-next-line\n Promise.resolve().then(() => {\n if (tuiIsHTMLElement(this.activeElement)) {\n this.activeElement.focus();\n }\n });\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiFocusTrapDirective} from './focus-trap.directive';\n\n@NgModule({\n declarations: [TuiFocusTrapDirective],\n exports: [TuiFocusTrapDirective],\n})\nexport class TuiFocusTrapModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAsBa,qBAAqB,CAAA;AAG9B,IAAA,WAAA,CACuC,GAAa,EAE/B,EAA2B,EACR,QAAmB,EAAA;QAHpB,IAAG,CAAA,GAAA,GAAH,GAAG,CAAU;QAE/B,IAAE,CAAA,EAAA,GAAF,EAAE,CAAyB;QACR,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAW;AAN1C,QAAA,IAAA,CAAA,aAAa,GAAG,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAQ3D;;;;AAIG;AACH,QAAA,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,C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27
|
}
|
28
28
|
else {
|
29
|
-
|
30
|
-
this.el.nativeElement.play();
|
29
|
+
void this.el.nativeElement.play();
|
31
30
|
this.updatePlaybackRate(this.playbackRate);
|
32
31
|
}
|
33
32
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"taiga-ui-cdk-directives-media.js","sources":["../../../projects/cdk/directives/media/media.directive.ts","../../../projects/cdk/directives/media/media.module.ts","../../../projects/cdk/directives/media/taiga-ui-cdk-directives-media.ts"],"sourcesContent":["import {\n Directive,\n ElementRef,\n EventEmitter,\n HostBinding,\n HostListener,\n Inject,\n Input,\n Output,\n} from '@angular/core';\n\n@Directive({\n selector: 'video[tuiMedia], audio[tuiMedia]',\n exportAs: 'tuiMedia',\n})\nexport class TuiMediaDirective {\n private playbackRate = 1;\n\n @Input()\n @HostBinding('volume')\n volume = 1;\n\n @Input('playbackRate')\n set playbackRateSetter(playbackRate: number) {\n this.updatePlaybackRate(playbackRate);\n }\n\n @Output()\n readonly currentTimeChange = new EventEmitter<number>();\n\n @Output()\n readonly pausedChange = new EventEmitter<boolean>();\n\n @Output()\n readonly volumeChange = new EventEmitter<number>();\n\n constructor(\n @Inject(ElementRef)\n private readonly el: ElementRef<HTMLMediaElement>,\n ) {}\n\n @Input()\n set currentTime(currentTime: number) {\n if (Math.abs(currentTime - this.currentTime) > 0.05) {\n this.el.nativeElement.currentTime = currentTime;\n }\n }\n\n get currentTime(): number {\n return this.el.nativeElement.currentTime;\n }\n\n @Input()\n set paused(paused: boolean) {\n if (paused) {\n this.el.nativeElement.pause();\n } else {\n
|
1
|
+
{"version":3,"file":"taiga-ui-cdk-directives-media.js","sources":["../../../projects/cdk/directives/media/media.directive.ts","../../../projects/cdk/directives/media/media.module.ts","../../../projects/cdk/directives/media/taiga-ui-cdk-directives-media.ts"],"sourcesContent":["import {\n Directive,\n ElementRef,\n EventEmitter,\n HostBinding,\n HostListener,\n Inject,\n Input,\n Output,\n} from '@angular/core';\n\n@Directive({\n selector: 'video[tuiMedia], audio[tuiMedia]',\n exportAs: 'tuiMedia',\n})\nexport class TuiMediaDirective {\n private playbackRate = 1;\n\n @Input()\n @HostBinding('volume')\n volume = 1;\n\n @Input('playbackRate')\n set playbackRateSetter(playbackRate: number) {\n this.updatePlaybackRate(playbackRate);\n }\n\n @Output()\n readonly currentTimeChange = new EventEmitter<number>();\n\n @Output()\n readonly pausedChange = new EventEmitter<boolean>();\n\n @Output()\n readonly volumeChange = new EventEmitter<number>();\n\n constructor(\n @Inject(ElementRef)\n private readonly el: ElementRef<HTMLMediaElement>,\n ) {}\n\n @Input()\n set currentTime(currentTime: number) {\n if (Math.abs(currentTime - this.currentTime) > 0.05) {\n this.el.nativeElement.currentTime = currentTime;\n }\n }\n\n get currentTime(): number {\n return this.el.nativeElement.currentTime;\n }\n\n @Input()\n set paused(paused: boolean) {\n if (paused) {\n this.el.nativeElement.pause();\n } else {\n void this.el.nativeElement.play();\n this.updatePlaybackRate(this.playbackRate);\n }\n }\n\n get paused(): boolean {\n return this.el.nativeElement.paused;\n }\n\n // @bad TODO: Make sure no other events can affect this like network issues etc.\n @HostListener('ended', ['true'])\n @HostListener('pause', ['true'])\n @HostListener('play', ['false'])\n onPausedChange(paused: boolean): void {\n this.pausedChange.emit(paused);\n this.updatePlaybackRate(this.playbackRate);\n }\n\n @HostListener('volumechange')\n onVolumeChange(): void {\n this.volume = this.el.nativeElement.volume;\n this.volumeChange.emit(this.volume);\n }\n\n @HostListener('timeupdate')\n @HostListener('seeking')\n @HostListener('seeked')\n onCurrentTimeChange(): void {\n this.currentTimeChange.emit(this.currentTime);\n }\n\n @HostListener('durationchange')\n changeDetectionTrigger(): void {\n // @bad TODO: consider if other events need to trigger CD\n }\n\n private updatePlaybackRate(playbackRate: number): void {\n this.playbackRate = playbackRate;\n this.el.nativeElement.playbackRate = this.playbackRate;\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiMediaDirective} from './media.directive';\n\n@NgModule({\n declarations: [TuiMediaDirective],\n exports: [TuiMediaDirective],\n})\nexport class TuiMediaModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAea,iBAAiB,CAAA;AAqB1B,IAAA,WAAA,CAEqB,EAAgC,EAAA;QAAhC,IAAE,CAAA,EAAA,GAAF,EAAE,CAA8B;QAtB7C,IAAY,CAAA,YAAA,GAAG,CAAC,CAAC;QAIzB,IAAM,CAAA,MAAA,GAAG,CAAC,CAAC;AAQF,QAAA,IAAA,CAAA,iBAAiB,GAAG,IAAI,YAAY,EAAU,CAAC;AAG/C,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,YAAY,EAAW,CAAC;AAG3C,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,YAAY,EAAU,CAAC;KAK/C;IAjBJ,IACI,kBAAkB,CAAC,YAAoB,EAAA;AACvC,QAAA,IAAI,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;KACzC;IAgBD,IACI,WAAW,CAAC,WAAmB,EAAA;AAC/B,QAAA,IAAI,IAAI,CAAC,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,IAAI,EAAE;YACjD,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,WAAW,GAAG,WAAW,CAAC;AACnD,SAAA;KACJ;AAED,IAAA,IAAI,WAAW,GAAA;AACX,QAAA,OAAO,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,WAAW,CAAC;KAC5C;IAED,IACI,MAAM,CAAC,MAAe,EAAA;AACtB,QAAA,IAAI,MAAM,EAAE;AACR,YAAA,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;AACjC,SAAA;AAAM,aAAA;YACH,KAAK,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;AAClC,YAAA,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AAC9C,SAAA;KACJ;AAED,IAAA,IAAI,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BAAmB,EAAA,CAAA;sBAHlB,YAAY;uBAAC,YAAY,CAAA;;sBACzB,YAAY;uBAAC,SAAS,CAAA;;sBACtB,YAAY;uBAAC,QAAQ,CAAA;gBAMtB,sBAAsB,EAAA,CAAA;sBADrB,YAAY;uBAAC,gBAAgB,CAAA;;;MChFrB,cAAc,CAAA;;4GAAd,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;6GAAd,cAAc,EAAA,YAAA,EAAA,CAHR,iBAAiB,CAAA,EAAA,OAAA,EAAA,CACtB,iBAAiB,CAAA,EAAA,CAAA,CAAA;6GAElB,cAAc,EAAA,CAAA,CAAA;4FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAJ1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,YAAY,EAAE,CAAC,iBAAiB,CAAC;oBACjC,OAAO,EAAE,CAAC,iBAAiB,CAAC;AAC/B,iBAAA,CAAA;;;ACPD;;AAEG;;;;"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
|
-
import { Directive, Input, NgModule } from '@angular/core';
|
2
|
+
import { Directive, Input, HostBinding, NgModule } from '@angular/core';
|
3
3
|
import { TUI_PLATFORM, tuiPlatformFactory } from '@taiga-ui/cdk/tokens';
|
4
4
|
|
5
5
|
class TuiPlatformDirective {
|
@@ -8,7 +8,7 @@ class TuiPlatformDirective {
|
|
8
8
|
}
|
9
9
|
}
|
10
10
|
TuiPlatformDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiPlatformDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
11
|
-
TuiPlatformDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiPlatformDirective, selector: "[tuiPlatform]", inputs: { tuiPlatform: "tuiPlatform" }, providers: [
|
11
|
+
TuiPlatformDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiPlatformDirective, selector: "[tuiPlatform]", inputs: { tuiPlatform: "tuiPlatform" }, host: { properties: { "attr.data-platform": "this.tuiPlatform" } }, providers: [
|
12
12
|
{
|
13
13
|
provide: TUI_PLATFORM,
|
14
14
|
deps: [TuiPlatformDirective],
|
@@ -29,6 +29,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
29
29
|
}]
|
30
30
|
}], propDecorators: { tuiPlatform: [{
|
31
31
|
type: Input
|
32
|
+
}, {
|
33
|
+
type: HostBinding,
|
34
|
+
args: ['attr.data-platform']
|
32
35
|
}] } });
|
33
36
|
|
34
37
|
class TuiPlatformModule {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"taiga-ui-cdk-directives-platform.js","sources":["../../../projects/cdk/directives/platform/platform.directive.ts","../../../projects/cdk/directives/platform/platform.module.ts","../../../projects/cdk/directives/platform/taiga-ui-cdk-directives-platform.ts"],"sourcesContent":["import {Directive, Input} from '@angular/core';\nimport {TUI_PLATFORM, tuiPlatformFactory} from '@taiga-ui/cdk/tokens';\nimport {TuiPlatform} from '@taiga-ui/cdk/types';\n\n@Directive({\n selector: '[tuiPlatform]',\n providers: [\n {\n provide: TUI_PLATFORM,\n deps: [TuiPlatformDirective],\n useFactory: ({tuiPlatform}: TuiPlatformDirective) =>\n tuiPlatform || tuiPlatformFactory(),\n },\n ],\n})\nexport class TuiPlatformDirective {\n @Input()\n tuiPlatform: TuiPlatform | '' = '';\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiPlatformDirective} from './platform.directive';\n\n@NgModule({\n declarations: [TuiPlatformDirective],\n exports: [TuiPlatformDirective],\n})\nexport class TuiPlatformModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAea,oBAAoB,CAAA;AAXjC,IAAA,WAAA,GAAA;
|
1
|
+
{"version":3,"file":"taiga-ui-cdk-directives-platform.js","sources":["../../../projects/cdk/directives/platform/platform.directive.ts","../../../projects/cdk/directives/platform/platform.module.ts","../../../projects/cdk/directives/platform/taiga-ui-cdk-directives-platform.ts"],"sourcesContent":["import {Directive, HostBinding, Input} from '@angular/core';\nimport {TUI_PLATFORM, tuiPlatformFactory} from '@taiga-ui/cdk/tokens';\nimport {TuiPlatform} from '@taiga-ui/cdk/types';\n\n@Directive({\n selector: '[tuiPlatform]',\n providers: [\n {\n provide: TUI_PLATFORM,\n deps: [TuiPlatformDirective],\n useFactory: ({tuiPlatform}: TuiPlatformDirective) =>\n tuiPlatform || tuiPlatformFactory(),\n },\n ],\n})\nexport class TuiPlatformDirective {\n @Input()\n @HostBinding('attr.data-platform')\n tuiPlatform: TuiPlatform | '' = '';\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiPlatformDirective} from './platform.directive';\n\n@NgModule({\n declarations: [TuiPlatformDirective],\n exports: [TuiPlatformDirective],\n})\nexport class TuiPlatformModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAea,oBAAoB,CAAA;AAXjC,IAAA,WAAA,GAAA;QAcI,IAAW,CAAA,WAAA,GAAqB,EAAE,CAAC;AACtC,KAAA;;kHAJY,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAApB,oBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,oBAAoB,EATlB,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,EAAA,WAAA,EAAA,aAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,oBAAA,EAAA,kBAAA,EAAA,EAAA,EAAA,SAAA,EAAA;AAC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3.54.0-canary.
|
3
|
+
"version": "3.54.0-canary.e1ba43c",
|
4
4
|
"description": "Base library for creating Angular components and applications using Taiga UI principles regarding of actual visual appearance",
|
5
5
|
"keywords": [
|
6
6
|
"angular",
|
@@ -30,7 +30,7 @@
|
|
30
30
|
"rxjs": ">=6.0.0"
|
31
31
|
},
|
32
32
|
"optionalDependencies": {
|
33
|
-
"ng-morph": "4.0.
|
33
|
+
"ng-morph": "4.0.3",
|
34
34
|
"parse5": "6.0.1"
|
35
35
|
},
|
36
36
|
"ng-update": {
|
@@ -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
|
}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { UpdateRecorder } from '@angular-devkit/schematics';
|
2
2
|
import { DevkitFileSystem } from 'ng-morph';
|
3
|
-
import { TemplateResource } from '../../interfaces';
|
4
|
-
import { HtmlComment } from '../../interfaces';
|
3
|
+
import { HtmlComment, TemplateResource } from '../../interfaces';
|
5
4
|
export declare function addHTMLCommentTags({ resource, recorder, fileSystem, data, }: {
|
6
5
|
fileSystem: DevkitFileSystem;
|
7
6
|
recorder: UpdateRecorder;
|
@@ -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);
|
@@ -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);
|