@taiga-ui/cdk 2.49.0 → 2.50.0

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.
Files changed (92) hide show
  1. package/bundles/taiga-ui-cdk-classes.umd.js.map +1 -1
  2. package/bundles/taiga-ui-cdk-classes.umd.min.js.map +1 -1
  3. package/bundles/taiga-ui-cdk-components-alert-host.umd.js.map +1 -1
  4. package/bundles/taiga-ui-cdk-components-alert-host.umd.min.js.map +1 -1
  5. package/bundles/taiga-ui-cdk-constants.umd.js +1 -1
  6. package/bundles/taiga-ui-cdk-constants.umd.js.map +1 -1
  7. package/bundles/taiga-ui-cdk-constants.umd.min.js.map +1 -1
  8. package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js +3 -2
  9. package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js.map +1 -1
  10. package/bundles/taiga-ui-cdk-directives-auto-focus.umd.min.js +1 -1
  11. package/bundles/taiga-ui-cdk-directives-auto-focus.umd.min.js.map +1 -1
  12. package/bundles/taiga-ui-cdk-directives-let.umd.js.map +1 -1
  13. package/bundles/taiga-ui-cdk-directives-let.umd.min.js.map +1 -1
  14. package/bundles/taiga-ui-cdk-observables.umd.js.map +1 -1
  15. package/bundles/taiga-ui-cdk-observables.umd.min.js.map +1 -1
  16. package/bundles/taiga-ui-cdk-tokens.umd.js.map +1 -1
  17. package/bundles/taiga-ui-cdk-tokens.umd.min.js.map +1 -1
  18. package/classes/validation-error.d.ts +1 -1
  19. package/components/alert-host/alert-host.component.d.ts +1 -1
  20. package/constants/stringify.d.ts +1 -1
  21. package/constants/taiga-ui-cdk-constants.metadata.json +1 -1
  22. package/directives/auto-focus/autofocus.options.d.ts +1 -1
  23. package/directives/auto-focus/taiga-ui-cdk-directives-auto-focus.metadata.json +1 -1
  24. package/directives/let/let.directive.d.ts +1 -1
  25. package/esm2015/classes/validation-error.js +1 -1
  26. package/esm2015/components/alert-host/alert-host.component.js +1 -1
  27. package/esm2015/constants/stringify.js +1 -1
  28. package/esm2015/constants/unicode-chars.js +2 -2
  29. package/esm2015/directives/auto-focus/autofocus.options.js +5 -4
  30. package/esm2015/directives/let/let.directive.js +1 -1
  31. package/esm2015/observables/is-alive.js +1 -1
  32. package/esm2015/tokens/is-cypress.js +1 -1
  33. package/esm5/classes/validation-error.js +1 -1
  34. package/esm5/components/alert-host/alert-host.component.js +1 -1
  35. package/esm5/constants/stringify.js +1 -1
  36. package/esm5/constants/unicode-chars.js +2 -2
  37. package/esm5/directives/auto-focus/autofocus.options.js +5 -4
  38. package/esm5/directives/let/let.directive.js +1 -1
  39. package/esm5/observables/is-alive.js +1 -1
  40. package/esm5/tokens/is-cypress.js +1 -1
  41. package/fesm2015/taiga-ui-cdk-classes.js.map +1 -1
  42. package/fesm2015/taiga-ui-cdk-components-alert-host.js.map +1 -1
  43. package/fesm2015/taiga-ui-cdk-constants.js +1 -1
  44. package/fesm2015/taiga-ui-cdk-constants.js.map +1 -1
  45. package/fesm2015/taiga-ui-cdk-directives-auto-focus.js +4 -3
  46. package/fesm2015/taiga-ui-cdk-directives-auto-focus.js.map +1 -1
  47. package/fesm2015/taiga-ui-cdk-directives-let.js.map +1 -1
  48. package/fesm2015/taiga-ui-cdk-observables.js.map +1 -1
  49. package/fesm2015/taiga-ui-cdk-tokens.js.map +1 -1
  50. package/fesm5/taiga-ui-cdk-classes.js.map +1 -1
  51. package/fesm5/taiga-ui-cdk-components-alert-host.js.map +1 -1
  52. package/fesm5/taiga-ui-cdk-constants.js +1 -1
  53. package/fesm5/taiga-ui-cdk-constants.js.map +1 -1
  54. package/fesm5/taiga-ui-cdk-directives-auto-focus.js +4 -3
  55. package/fesm5/taiga-ui-cdk-directives-auto-focus.js.map +1 -1
  56. package/fesm5/taiga-ui-cdk-directives-let.js.map +1 -1
  57. package/fesm5/taiga-ui-cdk-observables.js.map +1 -1
  58. package/fesm5/taiga-ui-cdk-tokens.js.map +1 -1
  59. package/observables/is-alive.d.ts +1 -1
  60. package/package.json +1 -2
  61. package/schematics/ng-add/steps/add-taiga-icons.d.ts +1 -2
  62. package/schematics/ng-add/steps/add-taiga-icons.js +9 -15
  63. package/schematics/ng-add/steps/add-taiga-styles.d.ts +1 -2
  64. package/schematics/ng-add/steps/add-taiga-styles.js +12 -16
  65. package/schematics/ng-update/constants/consts.js +22 -0
  66. package/schematics/ng-update/constants/functions.d.ts +0 -0
  67. package/schematics/ng-update/constants/functions.js +1 -0
  68. package/schematics/ng-update/constants/modules.d.ts +6 -0
  69. package/schematics/ng-update/constants/modules.js +5 -0
  70. package/schematics/ng-update/constants/templates.d.ts +10 -0
  71. package/schematics/ng-update/constants/templates.js +66 -1
  72. package/schematics/ng-update/constants/tui-interactive-selectors.d.ts +1 -0
  73. package/schematics/ng-update/constants/tui-interactive-selectors.js +54 -0
  74. package/schematics/ng-update/constants/types.js +45 -0
  75. package/schematics/ng-update/constants/warnings.js +45 -0
  76. package/schematics/ng-update/index.js +6 -0
  77. package/schematics/ng-update/steps/migrate-sliders/migrate-input-slider.js +58 -13
  78. package/schematics/ng-update/steps/migrate-templates.js +43 -18
  79. package/schematics/ng-update/steps/miscellaneous.d.ts +1 -0
  80. package/schematics/ng-update/steps/miscellaneous.js +65 -0
  81. package/schematics/ng-update/steps/remove-module.d.ts +2 -0
  82. package/schematics/ng-update/steps/remove-module.js +24 -0
  83. package/schematics/ng-update/steps/replace-const.js +2 -2
  84. package/schematics/ng-update/steps/replace-functions.d.ts +1 -0
  85. package/schematics/ng-update/steps/replace-functions.js +61 -0
  86. package/schematics/utils/add-unique-import.js +1 -1
  87. package/schematics/utils/get-project.js +2 -1
  88. package/schematics/utils/templates/elements.d.ts +19 -0
  89. package/schematics/utils/templates/elements.js +58 -0
  90. package/schematics/utils/templates/ng-component-input-manipulations.d.ts +34 -3
  91. package/schematics/utils/templates/ng-component-input-manipulations.js +76 -12
  92. package/tokens/taiga-ui-cdk-tokens.metadata.json +1 -1
@@ -2,42 +2,67 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const get_component_templates_1 = require("../../utils/templates/get-component-templates");
4
4
  const templates_1 = require("../constants/templates");
5
- const schematics_1 = require("@angular/cdk/schematics");
6
5
  const elements_1 = require("../../utils/templates/elements");
7
6
  const devkit_file_system_1 = require("ng-morph/project/classes/devkit-file-system");
7
+ const ng_component_input_manipulations_1 = require("../../utils/templates/ng-component-input-manipulations");
8
+ const template_resource_1 = require("../../utils/templates/template-resource");
9
+ const ng_morph_1 = require("ng-morph");
8
10
  const START_TAG_OFFSET = 1;
9
11
  const END_TAG_OFFSET = 2;
10
12
  function migrateTemplates(tree) {
11
- const templateResources = get_component_templates_1.getComponentTemplates('**/**');
12
13
  const fileSystem = new devkit_file_system_1.DevkitFileSystem(tree);
13
- templateResources.forEach((resource) => {
14
- if ('template' in resource) {
15
- const template = resource.template;
16
- const path = fileSystem.resolve(resource.componentPath);
14
+ const componentWithTemplatesPaths = get_component_templates_1.getComponentTemplates('**/**').map(({ componentPath }) => componentPath);
15
+ const actions = [replaceTags, replaceAttrs, replaceAttrsByDirective];
16
+ actions.forEach(action => {
17
+ componentWithTemplatesPaths.forEach(componentPath => {
18
+ // get updated version of template after the previous action
19
+ const [resource] = get_component_templates_1.getComponentTemplates(componentPath);
20
+ const path = fileSystem.resolve(template_resource_1.getPathFromTemplateResource(resource));
17
21
  const recorder = fileSystem.edit(path);
18
- processTemplateUrl(template, recorder, resource.offset);
19
- }
20
- else {
21
- const path = fileSystem.resolve(resource.templatePath);
22
- const template = fileSystem.read(path);
23
- const recorder = fileSystem.edit(path);
24
- processTemplateUrl(template, recorder);
25
- }
26
- fileSystem.commitEdits();
22
+ action({ resource, fileSystem, recorder });
23
+ });
24
+ save(fileSystem);
27
25
  });
28
26
  }
29
27
  exports.migrateTemplates = migrateTemplates;
30
- function processTemplateUrl(template, recorder, templateOffset = 0) {
28
+ /**
29
+ * We should update virtual file tree
30
+ * otherwise all following ng-morph commands will overwrite all previous template manipulations
31
+ * */
32
+ function save(fileSystem) {
33
+ fileSystem.commitEdits();
34
+ ng_morph_1.saveActiveProject();
35
+ ng_morph_1.setActiveProject(ng_morph_1.createProject(fileSystem.tree, '/', '**/**'));
36
+ }
37
+ function replaceAttrsByDirective({ resource, fileSystem, }) {
38
+ templates_1.ATTR_TO_DIRECTIVE.forEach(({ componentSelector, directiveModule, directive, inputProperty }) => {
39
+ ng_component_input_manipulations_1.replaceInputPropertyByDirective({
40
+ componentSelector,
41
+ directiveModule,
42
+ directive,
43
+ inputProperty,
44
+ fileSystem,
45
+ templateResource: resource,
46
+ });
47
+ });
48
+ }
49
+ function replaceAttrs({ resource, recorder, fileSystem, }) {
50
+ const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
51
+ const templateOffset = template_resource_1.getTemplateOffset(resource);
31
52
  templates_1.ATTRS_TO_REPLACE.forEach(({ from, to }) => {
32
53
  const offsets = [
33
- ...schematics_1.findAttributeOnElementWithTag(template, from.attrName, from.withTagNames || []),
34
- ...schematics_1.findAttributeOnElementWithAttrs(template, from.attrName, from.withAttrsNames || []),
54
+ ...elements_1.findAttributeOnElementWithTag(template, from.attrName, from.withTagNames || []),
55
+ ...elements_1.findAttributeOnElementWithAttrs(template, from.attrName, from.withAttrsNames || []),
35
56
  ];
36
57
  offsets.forEach(offset => {
37
58
  recorder.remove(offset + templateOffset, from.attrName.length + (to.attrName.length ? 0 : 1));
38
59
  recorder.insertRight(offset + templateOffset, to.attrName);
39
60
  });
40
61
  });
62
+ }
63
+ function replaceTags({ resource, recorder, fileSystem, }) {
64
+ const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
65
+ const templateOffset = template_resource_1.getTemplateOffset(resource);
41
66
  templates_1.TAGS_TO_REPLACE.forEach(({ from, to, addAttributes }) => {
42
67
  const elements = elements_1.findElementsByTagName(template, from);
43
68
  elements.forEach(({ sourceCodeLocation }) => {
@@ -0,0 +1 @@
1
+ export declare function miscellaneousMigrations(): void;
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const get_named_import_references_1 = require("../../utils/get-named-import-references");
4
+ const ng_morph_1 = require("ng-morph");
5
+ function miscellaneousMigrations() {
6
+ replaceEnumProperty({
7
+ enumName: 'TuiCurrency',
8
+ from: 'HongKong_dollar',
9
+ to: 'HongKongDollar',
10
+ });
11
+ replaceEnumProperty({
12
+ enumName: 'TuiCurrencyCode',
13
+ from: 'HongKong_dollar',
14
+ to: 'HongKongDollar',
15
+ });
16
+ addWarningToMethod('TuiDirectiveStylesService', 'addStyle', 'addStyle method has been removed. Use components approach');
17
+ }
18
+ exports.miscellaneousMigrations = miscellaneousMigrations;
19
+ function addWarningToMethod(className, method, message) {
20
+ const references = get_named_import_references_1.getNamedImportReferences(className);
21
+ references.forEach(ref => {
22
+ const parent = ref.getParent();
23
+ if (ng_morph_1.Node.isTypeReferenceNode(parent)) {
24
+ checkMethod(parent, method, message);
25
+ }
26
+ });
27
+ }
28
+ function replaceEnumProperty({ enumName, from, to, }) {
29
+ const references = get_named_import_references_1.getNamedImportReferences(enumName);
30
+ references.forEach(ref => {
31
+ const parent = ref.getParent();
32
+ if (!ng_morph_1.Node.isPropertyAccessExpression(parent)) {
33
+ return;
34
+ }
35
+ parent.getChildren().forEach(node => {
36
+ if (node.getText() === from) {
37
+ node.replaceWithText(to);
38
+ }
39
+ });
40
+ });
41
+ }
42
+ function checkMethod(node, method, message) {
43
+ const statement = node.getParent();
44
+ const identifier = statement.getChildrenOfKind(ng_morph_1.SyntaxKind.Identifier)[0];
45
+ identifier.findReferencesAsNodes().forEach(ref => {
46
+ let parent = ref.getParent();
47
+ if ((ng_morph_1.Node.isPropertyAccessExpression(parent) &&
48
+ parent.getText().startsWith('this.')) ||
49
+ ng_morph_1.Node.isCallExpression(parent)) {
50
+ parent = parent.getParentIfKind(ng_morph_1.SyntaxKind.PropertyAccessExpression);
51
+ }
52
+ if (ng_morph_1.Node.isPropertyAccessExpression(parent)) {
53
+ parent.getChildrenOfKind(ng_morph_1.SyntaxKind.Identifier).forEach(identifier => {
54
+ if (identifier.getText() === method) {
55
+ insertTodo(identifier, message);
56
+ }
57
+ });
58
+ }
59
+ });
60
+ }
61
+ function insertTodo(identifier, message) {
62
+ const startLinePos = identifier.getStartLinePos();
63
+ const sourceFile = identifier.getSourceFile();
64
+ sourceFile.insertText(startLinePos, `// TODO: ${message}\n`);
65
+ }
@@ -0,0 +1,2 @@
1
+ export declare function removeModules(): void;
2
+ export declare function removeModule(name: string, moduleSpecifier: string): void;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const ng_morph_1 = require("ng-morph");
4
+ const get_named_import_references_1 = require("../../utils/get-named-import-references");
5
+ const import_manipulations_1 = require("../../utils/import-manipulations");
6
+ const modules_1 = require("../constants/modules");
7
+ function removeModules() {
8
+ modules_1.REMOVED_MODULES.forEach(({ name, moduleSpecifier }) => removeModule(name, moduleSpecifier));
9
+ }
10
+ exports.removeModules = removeModules;
11
+ function removeModule(name, moduleSpecifier) {
12
+ const references = get_named_import_references_1.getNamedImportReferences(name, moduleSpecifier);
13
+ references.forEach(ref => {
14
+ const parent = ref.getParent();
15
+ if (ng_morph_1.Node.isImportSpecifier(parent)) {
16
+ import_manipulations_1.removeImport(parent);
17
+ }
18
+ else if (ng_morph_1.Node.isArrayLiteralExpression(parent)) {
19
+ const index = parent.getElements().findIndex(el => el.getText() === name);
20
+ parent.removeElement(index);
21
+ }
22
+ });
23
+ }
24
+ exports.removeModule = removeModule;
@@ -11,7 +11,7 @@ function replaceConsts() {
11
11
  exports.replaceConsts = replaceConsts;
12
12
  function replaceConst({ from, to }) {
13
13
  const references = get_named_import_references_1.getNamedImportReferences(from.name, from.moduleSpecifier);
14
- for (let ref of references) {
14
+ references.forEach(ref => {
15
15
  const parent = ref.getParent();
16
16
  if (ng_morph_1.Node.isImportSpecifier(parent)) {
17
17
  import_manipulations_1.removeImport(parent);
@@ -20,6 +20,6 @@ function replaceConst({ from, to }) {
20
20
  else {
21
21
  ref === null || ref === void 0 ? void 0 : ref.replaceWithText(to.name);
22
22
  }
23
- }
23
+ });
24
24
  }
25
25
  exports.replaceConst = replaceConst;
@@ -0,0 +1 @@
1
+ export declare function replaceFunctions(): void;
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const get_named_import_references_1 = require("../../utils/get-named-import-references");
4
+ const ng_morph_1 = require("ng-morph");
5
+ const import_manipulations_1 = require("../../utils/import-manipulations");
6
+ function replaceFunctions() {
7
+ replacePadStart(get_named_import_references_1.getNamedImportReferences('padStart', '@taiga-ui/cdk'));
8
+ replaceFallbackValue(get_named_import_references_1.getNamedImportReferences('fallbackValue', '@taiga-ui/cdk'));
9
+ replaceCustomEvent(get_named_import_references_1.getNamedImportReferences('tuiCustomEvent', '@taiga-ui/cdk'));
10
+ replaceClosestElement(get_named_import_references_1.getNamedImportReferences('getClosestElement', '@taiga-ui/cdk'));
11
+ }
12
+ exports.replaceFunctions = replaceFunctions;
13
+ function replacePadStart(references) {
14
+ references.forEach(ref => {
15
+ var _a;
16
+ const parent = ref.getParent();
17
+ if (ng_morph_1.Node.isImportSpecifier(parent)) {
18
+ import_manipulations_1.removeImport(parent);
19
+ }
20
+ else if (ng_morph_1.Node.isCallExpression(parent)) {
21
+ const [targetString, length, pad] = parent.getArguments();
22
+ parent.replaceWithText(`${targetString.getText()}.padStart(${length.getText()}, ${(_a = pad === null || pad === void 0 ? void 0 : pad.getText()) !== null && _a !== void 0 ? _a : '" "'})`);
23
+ }
24
+ });
25
+ }
26
+ function replaceClosestElement(references) {
27
+ references.forEach(ref => {
28
+ const parent = ref.getParent();
29
+ if (ng_morph_1.Node.isImportSpecifier(parent)) {
30
+ import_manipulations_1.removeImport(parent);
31
+ }
32
+ else if (ng_morph_1.Node.isCallExpression(parent)) {
33
+ const [firstArg, secondArg] = parent.getArguments();
34
+ parent.replaceWithText(`${firstArg.getText()}.closest(${secondArg.getText()})`);
35
+ }
36
+ });
37
+ }
38
+ function replaceCustomEvent(references) {
39
+ references.forEach(ref => {
40
+ const parent = ref.getParent();
41
+ if (ng_morph_1.Node.isImportSpecifier(parent)) {
42
+ import_manipulations_1.removeImport(parent);
43
+ }
44
+ else if (ng_morph_1.Node.isCallExpression(parent)) {
45
+ const [firstArg, secondArg] = parent.getArguments();
46
+ parent.replaceWithText(`new CustomEvent(${firstArg.getText()}, ${secondArg.getText()})`);
47
+ }
48
+ });
49
+ }
50
+ function replaceFallbackValue(references) {
51
+ references.forEach(ref => {
52
+ const parent = ref.getParent();
53
+ if (ng_morph_1.Node.isImportSpecifier(parent)) {
54
+ import_manipulations_1.removeImport(parent);
55
+ }
56
+ else if (ng_morph_1.Node.isCallExpression(parent)) {
57
+ const [firstArg, secondArg] = parent.getArguments();
58
+ parent.replaceWithText(`${firstArg.getText()} ?? ${secondArg.getText()}`);
59
+ }
60
+ });
61
+ }
@@ -16,7 +16,7 @@ function addUniqueImport(filePath, namedImport, moduleSpecifier) {
16
16
  const modules = existingDeclaration[0]
17
17
  .getNamedImports()
18
18
  .map(namedImport => namedImport.getText());
19
- ng_morph_1.editImports(existingDeclaration, () => ({
19
+ ng_morph_1.editImports(existingDeclaration[0], () => ({
20
20
  namedImports: [...modules, namedImport],
21
21
  }));
22
22
  return;
@@ -2,7 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const schematics_1 = require("@angular-devkit/schematics");
4
4
  function getProject(options, workspace) {
5
- const projectName = options.project || workspace.extensions.defaultProject.toString();
5
+ var _a;
6
+ const projectName = options.project || ((_a = workspace.extensions.defaultProject) === null || _a === void 0 ? void 0 : _a.toString()) || '';
6
7
  const project = workspace.projects.get(projectName);
7
8
  if (!project) {
8
9
  throw new schematics_1.SchematicsException(`Unable to find project '${projectName}' in the workspace`);
@@ -1,2 +1,21 @@
1
1
  import { Element } from 'parse5';
2
2
  export declare function findElementsByTagName(html: string, tagName: string): Element[];
3
+ /**
4
+ * Parses a HTML fragment and traverses all AST nodes in order find elements that
5
+ * include the specified attribute.
6
+ */
7
+ export declare function findElementsWithAttribute(html: string, attributeName: string): Element[];
8
+ /**
9
+ * Finds elements with explicit tag names that also contain the specified attribute. Returns the
10
+ * attribute start offset based on the specified HTML.
11
+ */
12
+ export declare function findAttributeOnElementWithTag(html: string, name: string, tagNames: string[], filterFn?: (element: Element) => boolean): number[];
13
+ /**
14
+ * Finds elements that contain the given attribute and contain at least one of the other
15
+ * specified attributes. Returns the primary attribute's start offset based on the specified HTML.
16
+ */
17
+ export declare function findAttributeOnElementWithAttrs(html: string, name: string, attrs: string[], filterFn?: (element: Element) => boolean): number[];
18
+ /** Shorthand function that checks if the specified element contains the given attribute. */
19
+ export declare function hasElementAttribute(element: Element, attributeName: string): boolean;
20
+ /** Gets the start offset of the given attribute from a Parse5 element. */
21
+ export declare function getStartOffsetOfAttribute(element: Element, attributeName: string): number;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const parse5_1 = require("parse5");
4
+ const ALWAYS_TRUE_HANDLER = () => true;
4
5
  function findElementsByTagName(html, tagName) {
5
6
  const document = parse5_1.parseFragment(html, { sourceCodeLocationInfo: true });
6
7
  const elements = [];
@@ -19,3 +20,60 @@ function findElementsByTagName(html, tagName) {
19
20
  return elements;
20
21
  }
21
22
  exports.findElementsByTagName = findElementsByTagName;
23
+ /**
24
+ * Parses a HTML fragment and traverses all AST nodes in order find elements that
25
+ * include the specified attribute.
26
+ */
27
+ function findElementsWithAttribute(html, attributeName) {
28
+ const document = parse5_1.parseFragment(html, { sourceCodeLocationInfo: true });
29
+ const elements = [];
30
+ const visitNodes = (nodes) => {
31
+ nodes.forEach(n => {
32
+ var _a;
33
+ const node = n;
34
+ if (node.childNodes) {
35
+ visitNodes(node.childNodes);
36
+ }
37
+ if ((_a = node.attrs) === null || _a === void 0 ? void 0 : _a.some(attr => attr.name === attributeName.toLowerCase())) {
38
+ elements.push(node);
39
+ }
40
+ });
41
+ };
42
+ visitNodes(document.childNodes);
43
+ return elements;
44
+ }
45
+ exports.findElementsWithAttribute = findElementsWithAttribute;
46
+ /**
47
+ * Finds elements with explicit tag names that also contain the specified attribute. Returns the
48
+ * attribute start offset based on the specified HTML.
49
+ */
50
+ function findAttributeOnElementWithTag(html, name, tagNames, filterFn = ALWAYS_TRUE_HANDLER) {
51
+ return findElementsWithAttribute(html, name)
52
+ .filter(element => tagNames.includes(element.tagName) && filterFn(element))
53
+ .map(element => getStartOffsetOfAttribute(element, name));
54
+ }
55
+ exports.findAttributeOnElementWithTag = findAttributeOnElementWithTag;
56
+ /**
57
+ * Finds elements that contain the given attribute and contain at least one of the other
58
+ * specified attributes. Returns the primary attribute's start offset based on the specified HTML.
59
+ */
60
+ function findAttributeOnElementWithAttrs(html, name, attrs, filterFn = ALWAYS_TRUE_HANDLER) {
61
+ return findElementsWithAttribute(html, name)
62
+ .filter(element => attrs.some(attr => hasElementAttribute(element, attr)) &&
63
+ filterFn(element))
64
+ .map(element => getStartOffsetOfAttribute(element, name));
65
+ }
66
+ exports.findAttributeOnElementWithAttrs = findAttributeOnElementWithAttrs;
67
+ /** Shorthand function that checks if the specified element contains the given attribute. */
68
+ function hasElementAttribute(element, attributeName) {
69
+ return (element.attrs &&
70
+ element.attrs.some(attr => attr.name === attributeName.toLowerCase()));
71
+ }
72
+ exports.hasElementAttribute = hasElementAttribute;
73
+ /** Gets the start offset of the given attribute from a Parse5 element. */
74
+ function getStartOffsetOfAttribute(element, attributeName) {
75
+ var _a, _b;
76
+ return ((((_a = element.sourceCodeLocation) === null || _a === void 0 ? void 0 : _a.attrs) && ((_b = element.sourceCodeLocation.attrs[attributeName.toLowerCase()]) === null || _b === void 0 ? void 0 : _b.startOffset)) ||
77
+ 0);
78
+ }
79
+ exports.getStartOffsetOfAttribute = getStartOffsetOfAttribute;
@@ -1,4 +1,5 @@
1
1
  import { DevkitFileSystem } from 'ng-morph/project/classes/devkit-file-system';
2
+ import { Element } from 'parse5';
2
3
  import { TemplateResource } from '../../ng-update/interfaces/template-resourse';
3
4
  /**
4
5
  * Replace component input property by new value
@@ -25,17 +26,35 @@ import { TemplateResource } from '../../ng-update/interfaces/template-resourse';
25
26
  * ___
26
27
  * @return true if something was changed
27
28
  */
28
- export declare function replaceInputProperty({ templateResource, fileSystem, componentSelector, from, to, }: {
29
+ export declare function replaceInputProperty({ templateResource, fileSystem, componentSelector, from, to, newValue, filterFn, }: {
29
30
  templateResource: TemplateResource;
30
31
  fileSystem: DevkitFileSystem;
31
- componentSelector: string;
32
+ componentSelector: string | string[];
32
33
  from: string;
33
34
  to: string;
35
+ newValue?: string;
36
+ filterFn?: (element: Element) => boolean;
34
37
  }): boolean;
38
+ /**
39
+ * @example
40
+ * // 10 symbols before property `size` and string `size="s"` has 8-symbols length
41
+ * const template = '<tui-card size="s"></tui-card>';
42
+ *
43
+ * getInputPropertyOffsets(template, 'size', ['tui-card']) // [[10, 18]]
44
+ */
45
+ export declare function getInputPropertyOffsets(html: string, attrName: string, tags: string[], filterFn?: (element: Element) => boolean): [number, number][];
46
+ /**
47
+ * @example
48
+ * // `<tui-card size="` has 16-symbols length
49
+ * const template = '<tui-card size="xl"></tui-card>';
50
+ *
51
+ * getInputPropertyValueOffsets(template, 'size', ['tui-card']) // [ [16, 18] ]
52
+ */
53
+ export declare function getInputPropertyValueOffsets(template: string, attrName: string, tags: string[]): [number, number][];
35
54
  export declare function replaceInputPropertyByDirective({ templateResource, fileSystem, componentSelector, inputProperty, directive, directiveModule, }: {
36
55
  templateResource: TemplateResource;
37
56
  fileSystem: DevkitFileSystem;
38
- componentSelector: string;
57
+ componentSelector: string | string[];
39
58
  inputProperty: string;
40
59
  directive: string;
41
60
  directiveModule?: {
@@ -43,3 +62,15 @@ export declare function replaceInputPropertyByDirective({ templateResource, file
43
62
  moduleSpecifier: string;
44
63
  };
45
64
  }): void;
65
+ /**
66
+ * After removing property from the tag (which uses multi lines inside template) it can leave redundant space.
67
+ * It is not critical because html is valid even with this extra space.
68
+ * TODO: Find a way to fix it
69
+ */
70
+ export declare function removeInputProperty({ templateResource, fileSystem, componentSelector, inputProperty, filterFn, }: {
71
+ templateResource: TemplateResource;
72
+ fileSystem: DevkitFileSystem;
73
+ componentSelector: string;
74
+ inputProperty: string;
75
+ filterFn?: (element: Element) => boolean;
76
+ }): void;
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const schematics_1 = require("@angular/cdk/schematics");
4
3
  const template_resource_1 = require("./template-resource");
5
4
  const ng_component_1 = require("../angular/ng-component");
6
5
  const ng_module_1 = require("../angular/ng-module");
7
6
  const ng_morph_1 = require("ng-morph");
8
7
  const add_unique_import_1 = require("../add-unique-import");
8
+ const elements_1 = require("./elements");
9
9
  /**
10
10
  * Replace component input property by new value
11
11
  * ___
@@ -31,31 +31,76 @@ const add_unique_import_1 = require("../add-unique-import");
31
31
  * ___
32
32
  * @return true if something was changed
33
33
  */
34
- function replaceInputProperty({ templateResource, fileSystem, componentSelector, from, to, }) {
34
+ function replaceInputProperty({ templateResource, fileSystem, componentSelector, from, to, newValue = '', filterFn, }) {
35
35
  const template = template_resource_1.getTemplateFromTemplateResource(templateResource, fileSystem);
36
36
  const path = fileSystem.resolve(template_resource_1.getPathFromTemplateResource(templateResource));
37
37
  const recorder = fileSystem.edit(path);
38
38
  const templateOffset = template_resource_1.getTemplateOffset(templateResource);
39
- const stringProperties = schematics_1.findAttributeOnElementWithTag(template, from, [
40
- componentSelector,
41
- ]);
42
- const propertyBindings = schematics_1.findAttributeOnElementWithTag(template, `[${from}]`, [
43
- componentSelector,
44
- ]);
39
+ const selector = Array.isArray(componentSelector)
40
+ ? componentSelector
41
+ : [componentSelector];
42
+ const stringProperties = [
43
+ ...elements_1.findAttributeOnElementWithTag(template, from, selector, filterFn),
44
+ ...elements_1.findAttributeOnElementWithAttrs(template, from, selector, filterFn),
45
+ ].map(offset => templateOffset + offset);
46
+ const propertyBindings = [
47
+ ...elements_1.findAttributeOnElementWithTag(template, `[${from}]`, selector, filterFn),
48
+ ...elements_1.findAttributeOnElementWithAttrs(template, `[${from}]`, selector, filterFn),
49
+ ].map(offset => templateOffset + offset);
50
+ const propertyValues = newValue
51
+ ? getInputPropertyValueOffsets(template, from, selector).map(([start, end]) => [
52
+ templateOffset + start,
53
+ templateOffset + end,
54
+ ])
55
+ : [];
45
56
  if (!stringProperties.length && !propertyBindings.length) {
46
57
  return false;
47
58
  }
48
59
  stringProperties.forEach(offset => {
49
- recorder.remove(offset + templateOffset, from.length);
50
- recorder.insertRight(offset + templateOffset, to);
60
+ recorder.remove(offset, from.length);
61
+ recorder.insertRight(offset, to);
51
62
  });
52
63
  propertyBindings.forEach(offset => {
53
- recorder.remove(offset + templateOffset, `[${from}]`.length);
54
- recorder.insertRight(offset + templateOffset, `[${to}]`);
64
+ recorder.remove(offset, `[${from}]`.length);
65
+ recorder.insertRight(offset, to.startsWith('[') ? to : `[${to}]`);
66
+ });
67
+ propertyValues.forEach(([startOffset, endOffset]) => {
68
+ recorder.remove(startOffset, endOffset - startOffset);
69
+ recorder.insertRight(startOffset, newValue);
55
70
  });
56
71
  return true;
57
72
  }
58
73
  exports.replaceInputProperty = replaceInputProperty;
74
+ /**
75
+ * @example
76
+ * // 10 symbols before property `size` and string `size="s"` has 8-symbols length
77
+ * const template = '<tui-card size="s"></tui-card>';
78
+ *
79
+ * getInputPropertyOffsets(template, 'size', ['tui-card']) // [[10, 18]]
80
+ */
81
+ function getInputPropertyOffsets(html, attrName, tags, filterFn = () => true) {
82
+ return elements_1.findElementsWithAttribute(html, attrName)
83
+ .filter(element => tags.includes(element.tagName) && filterFn(element))
84
+ .map((element) => {
85
+ var _a, _b;
86
+ const { startOffset = 0, endOffset = 0 } = ((_b = (_a = element.sourceCodeLocation) === null || _a === void 0 ? void 0 : _a.attrs) === null || _b === void 0 ? void 0 : _b[attrName.toLowerCase()]) || {};
87
+ return [startOffset, endOffset];
88
+ });
89
+ }
90
+ exports.getInputPropertyOffsets = getInputPropertyOffsets;
91
+ /**
92
+ * @example
93
+ * // `<tui-card size="` has 16-symbols length
94
+ * const template = '<tui-card size="xl"></tui-card>';
95
+ *
96
+ * getInputPropertyValueOffsets(template, 'size', ['tui-card']) // [ [16, 18] ]
97
+ */
98
+ function getInputPropertyValueOffsets(template, attrName, tags) {
99
+ const stringProperties = getInputPropertyOffsets(template, attrName, tags).map(([start, end]) => [start + attrName.length + '="'.length, end - 1]);
100
+ const propertyBindings = getInputPropertyOffsets(template, `[${attrName}]`, tags).map(([start, end]) => [start + `[${attrName}]`.length + '="'.length, end - 1]);
101
+ return [...stringProperties, ...propertyBindings];
102
+ }
103
+ exports.getInputPropertyValueOffsets = getInputPropertyValueOffsets;
59
104
  function replaceInputPropertyByDirective({ templateResource, fileSystem, componentSelector, inputProperty, directive, directiveModule, }) {
60
105
  const wasModified = replaceInputProperty({
61
106
  templateResource,
@@ -76,3 +121,22 @@ function replaceInputPropertyByDirective({ templateResource, fileSystem, compone
76
121
  }
77
122
  }
78
123
  exports.replaceInputPropertyByDirective = replaceInputPropertyByDirective;
124
+ /**
125
+ * After removing property from the tag (which uses multi lines inside template) it can leave redundant space.
126
+ * It is not critical because html is valid even with this extra space.
127
+ * TODO: Find a way to fix it
128
+ */
129
+ function removeInputProperty({ templateResource, fileSystem, componentSelector, inputProperty, filterFn, }) {
130
+ const template = template_resource_1.getTemplateFromTemplateResource(templateResource, fileSystem);
131
+ const templateOffset = template_resource_1.getTemplateOffset(templateResource);
132
+ const path = fileSystem.resolve(template_resource_1.getPathFromTemplateResource(templateResource));
133
+ const recorder = fileSystem.edit(path);
134
+ const propertyOffsets = [
135
+ ...getInputPropertyOffsets(template, inputProperty, [componentSelector], filterFn),
136
+ ...getInputPropertyOffsets(template, `[${inputProperty}]`, [componentSelector], filterFn),
137
+ ].map(([start, end]) => [templateOffset + start, templateOffset + end]);
138
+ propertyOffsets.forEach(([start, end]) => {
139
+ recorder.remove(start, end - start);
140
+ });
141
+ }
142
+ exports.removeInputProperty = removeInputProperty;
@@ -1 +1 @@
1
- {"__symbolic":"module","version":4,"metadata":{"TUI_ACTIVE_ELEMENT":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":22,"character":38},"arguments":["Active element on the document for ActiveZone",{"__symbolic":"error","message":"Lambda not supported","line":25,"character":17,"module":"./active-element"}]},"TUI_ALERTS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":4,"character":30},"arguments":["A stream of alerts",{"__symbolic":"error","message":"Lambda not supported","line":7,"character":13,"module":"./alerts"}]},"TUI_DEFAULT_RENDERER":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":3,"character":40},"arguments":["A Renderer2 for global services",{"__symbolic":"error","message":"Lambda not supported","line":7,"character":17,"module":"./default-renderer"}]},"TUI_DIALOGS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":4,"character":31},"arguments":["A stream of dialogs",{"__symbolic":"error","message":"Lambda not supported","line":7,"character":13,"module":"./dialogs"}]},"TUI_FOCUSABLE_ITEM_ACCESSOR":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":4,"character":8},"arguments":["A component that can be focused"]},"TUI_IS_ANDROID":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":5,"character":34},"arguments":["Mobile browser that is not iOS (technically includes Windows Phone, Blackberry etc.)",{"__symbolic":"error","message":"Lambda not supported","line":8,"character":17,"module":"./is-android"}]},"TUI_IS_APPLE":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":4,"character":32},"arguments":["Apple(safari/webkit) detection",{"__symbolic":"error","message":"Lambda not supported","line":6,"character":14,"module":"./is-apple"}]},"TUI_IS_CHROMIUM":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":3,"character":35},"arguments":["Chromium browser engine detection",{"__symbolic":"error","message":"Lambda not supported","line":6,"character":17,"module":"./is-chromium"}]},"WindowWithCypress":{"__symbolic":"interface"},"TUI_IS_CYPRESS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":10,"character":34},"arguments":["Detect if app is running under Cypress",{"__symbolic":"error","message":"Lambda not supported","line":13,"character":17,"module":"./is-cypress"}]},"TUI_IS_FIREFOX":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":3,"character":34},"arguments":["Firefox browser engine detection",{"__symbolic":"error","message":"Lambda not supported","line":6,"character":17,"module":"./is-firefox"}]},"TUI_IS_IOS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":4,"character":30},"arguments":["iOS browser detection",{"__symbolic":"error","message":"Lambda not supported","line":5,"character":13,"module":"./is-ios"}]},"TUI_IS_MOBILE":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":9,"character":33},"arguments":["Mobile browser detection",{"__symbolic":"error","message":"Lambda not supported","line":10,"character":13,"module":"./is-mobile"}]},"TUI_IS_WEBKIT":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":3,"character":33},"arguments":["Webkit browser engine detection",{"__symbolic":"error","message":"Lambda not supported","line":6,"character":17,"module":"./is-webkit"}]},"TUI_REMOVED_ELEMENT":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":5,"character":39},"arguments":["Element currently being removed by AnimationEngine",{"__symbolic":"error","message":"Lambda not supported","line":8,"character":17,"module":"./removed-element"}]},"TUI_SANITIZER":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":3,"character":33},"arguments":["A custom Sanitizer to sanitize source before inlining"]},"TUI_SWIPE_OPTIONS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":3,"character":37},"arguments":["Swipe options",{"__symbolic":"error","message":"Lambda not supported","line":4,"character":13,"module":"./swipe-options"}]},"TUI_TAKE_ONLY_TRUSTED_EVENTS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":9,"character":8},"arguments":["This token need for override behavior the `pressedObservable` function",{"__symbolic":"error","message":"Lambda not supported","line":12,"character":21,"module":"./take-only-trusted-events"}]},"TUI_TOUCH_SUPPORTED":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":3,"character":39},"arguments":["Touch support detection",{"__symbolic":"error","message":"Lambda not supported","line":4,"character":13,"module":"./touch-supported"}]},"TUI_WINDOW_HEIGHT":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":6,"character":37},"arguments":["Window height accounting for disappearing address bar",{"__symbolic":"error","message":"Lambda not supported","line":9,"character":17,"module":"./window-height"}]},"TUI_ZOOM_OPTIONS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":3,"character":36},"arguments":["Zoom options",{"__symbolic":"error","message":"Lambda not supported","line":4,"character":13,"module":"./zoom-options"}]}},"origins":{"TUI_ACTIVE_ELEMENT":"./active-element","TUI_ALERTS":"./alerts","TUI_DEFAULT_RENDERER":"./default-renderer","TUI_DIALOGS":"./dialogs","TUI_FOCUSABLE_ITEM_ACCESSOR":"./focusable-item-accessor","TUI_IS_ANDROID":"./is-android","TUI_IS_APPLE":"./is-apple","TUI_IS_CHROMIUM":"./is-chromium","WindowWithCypress":"./is-cypress","TUI_IS_CYPRESS":"./is-cypress","TUI_IS_FIREFOX":"./is-firefox","TUI_IS_IOS":"./is-ios","TUI_IS_MOBILE":"./is-mobile","TUI_IS_WEBKIT":"./is-webkit","TUI_REMOVED_ELEMENT":"./removed-element","TUI_SANITIZER":"./sanitizer","TUI_SWIPE_OPTIONS":"./swipe-options","TUI_TAKE_ONLY_TRUSTED_EVENTS":"./take-only-trusted-events","TUI_TOUCH_SUPPORTED":"./touch-supported","TUI_WINDOW_HEIGHT":"./window-height","TUI_ZOOM_OPTIONS":"./zoom-options"},"importAs":"@taiga-ui/cdk/tokens"}
1
+ {"__symbolic":"module","version":4,"metadata":{"TUI_ACTIVE_ELEMENT":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":22,"character":38},"arguments":["Active element on the document for ActiveZone",{"__symbolic":"error","message":"Lambda not supported","line":25,"character":17,"module":"./active-element"}]},"TUI_ALERTS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":4,"character":30},"arguments":["A stream of alerts",{"__symbolic":"error","message":"Lambda not supported","line":7,"character":13,"module":"./alerts"}]},"TUI_DEFAULT_RENDERER":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":3,"character":40},"arguments":["A Renderer2 for global services",{"__symbolic":"error","message":"Lambda not supported","line":7,"character":17,"module":"./default-renderer"}]},"TUI_DIALOGS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":4,"character":31},"arguments":["A stream of dialogs",{"__symbolic":"error","message":"Lambda not supported","line":7,"character":13,"module":"./dialogs"}]},"TUI_FOCUSABLE_ITEM_ACCESSOR":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":4,"character":8},"arguments":["A component that can be focused"]},"TUI_IS_ANDROID":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":5,"character":34},"arguments":["Mobile browser that is not iOS (technically includes Windows Phone, Blackberry etc.)",{"__symbolic":"error","message":"Lambda not supported","line":8,"character":17,"module":"./is-android"}]},"TUI_IS_APPLE":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":4,"character":32},"arguments":["Apple(safari/webkit) detection",{"__symbolic":"error","message":"Lambda not supported","line":6,"character":14,"module":"./is-apple"}]},"TUI_IS_CHROMIUM":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":3,"character":35},"arguments":["Chromium browser engine detection",{"__symbolic":"error","message":"Lambda not supported","line":6,"character":17,"module":"./is-chromium"}]},"WindowWithCypress":{"__symbolic":"interface"},"TUI_IS_CYPRESS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":11,"character":34},"arguments":["Detect if app is running under Cypress",{"__symbolic":"error","message":"Lambda not supported","line":14,"character":17,"module":"./is-cypress"}]},"TUI_IS_FIREFOX":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":3,"character":34},"arguments":["Firefox browser engine detection",{"__symbolic":"error","message":"Lambda not supported","line":6,"character":17,"module":"./is-firefox"}]},"TUI_IS_IOS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":4,"character":30},"arguments":["iOS browser detection",{"__symbolic":"error","message":"Lambda not supported","line":5,"character":13,"module":"./is-ios"}]},"TUI_IS_MOBILE":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":9,"character":33},"arguments":["Mobile browser detection",{"__symbolic":"error","message":"Lambda not supported","line":10,"character":13,"module":"./is-mobile"}]},"TUI_IS_WEBKIT":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":3,"character":33},"arguments":["Webkit browser engine detection",{"__symbolic":"error","message":"Lambda not supported","line":6,"character":17,"module":"./is-webkit"}]},"TUI_REMOVED_ELEMENT":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":5,"character":39},"arguments":["Element currently being removed by AnimationEngine",{"__symbolic":"error","message":"Lambda not supported","line":8,"character":17,"module":"./removed-element"}]},"TUI_SANITIZER":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":3,"character":33},"arguments":["A custom Sanitizer to sanitize source before inlining"]},"TUI_SWIPE_OPTIONS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":3,"character":37},"arguments":["Swipe options",{"__symbolic":"error","message":"Lambda not supported","line":4,"character":13,"module":"./swipe-options"}]},"TUI_TAKE_ONLY_TRUSTED_EVENTS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":9,"character":8},"arguments":["This token need for override behavior the `pressedObservable` function",{"__symbolic":"error","message":"Lambda not supported","line":12,"character":21,"module":"./take-only-trusted-events"}]},"TUI_TOUCH_SUPPORTED":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":3,"character":39},"arguments":["Touch support detection",{"__symbolic":"error","message":"Lambda not supported","line":4,"character":13,"module":"./touch-supported"}]},"TUI_WINDOW_HEIGHT":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":6,"character":37},"arguments":["Window height accounting for disappearing address bar",{"__symbolic":"error","message":"Lambda not supported","line":9,"character":17,"module":"./window-height"}]},"TUI_ZOOM_OPTIONS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":3,"character":36},"arguments":["Zoom options",{"__symbolic":"error","message":"Lambda not supported","line":4,"character":13,"module":"./zoom-options"}]}},"origins":{"TUI_ACTIVE_ELEMENT":"./active-element","TUI_ALERTS":"./alerts","TUI_DEFAULT_RENDERER":"./default-renderer","TUI_DIALOGS":"./dialogs","TUI_FOCUSABLE_ITEM_ACCESSOR":"./focusable-item-accessor","TUI_IS_ANDROID":"./is-android","TUI_IS_APPLE":"./is-apple","TUI_IS_CHROMIUM":"./is-chromium","WindowWithCypress":"./is-cypress","TUI_IS_CYPRESS":"./is-cypress","TUI_IS_FIREFOX":"./is-firefox","TUI_IS_IOS":"./is-ios","TUI_IS_MOBILE":"./is-mobile","TUI_IS_WEBKIT":"./is-webkit","TUI_REMOVED_ELEMENT":"./removed-element","TUI_SANITIZER":"./sanitizer","TUI_SWIPE_OPTIONS":"./swipe-options","TUI_TAKE_ONLY_TRUSTED_EVENTS":"./take-only-trusted-events","TUI_TOUCH_SUPPORTED":"./touch-supported","TUI_WINDOW_HEIGHT":"./window-height","TUI_ZOOM_OPTIONS":"./zoom-options"},"importAs":"@taiga-ui/cdk/tokens"}