@taiga-ui/cdk 3.22.0 → 3.23.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 (33) hide show
  1. package/abstract/control.d.ts +4 -0
  2. package/bundles/taiga-ui-cdk-abstract.umd.js +7 -1
  3. package/bundles/taiga-ui-cdk-abstract.umd.js.map +1 -1
  4. package/bundles/taiga-ui-cdk-constants.umd.js +1 -1
  5. package/bundles/taiga-ui-cdk-constants.umd.js.map +1 -1
  6. package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js.map +1 -1
  7. package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js +22 -9
  8. package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js.map +1 -1
  9. package/bundles/taiga-ui-cdk-utils-svg.umd.js +16 -321
  10. package/bundles/taiga-ui-cdk-utils-svg.umd.js.map +1 -1
  11. package/constants/version.d.ts +1 -1
  12. package/constants/version.js +1 -1
  13. package/directives/auto-focus/handlers/abstract.handler.d.ts +1 -1
  14. package/esm2015/abstract/control.js +7 -1
  15. package/esm2015/abstract/multiple-control.js +2 -2
  16. package/esm2015/constants/version.js +2 -2
  17. package/esm2015/directives/auto-focus/handlers/abstract.handler.js +1 -1
  18. package/esm2015/utils/miscellaneous/default-sort.js +14 -0
  19. package/esm2015/utils/miscellaneous/index.js +2 -1
  20. package/esm2015/utils/svg/svg-linear-gradient-processor.js +17 -4
  21. package/fesm2015/taiga-ui-cdk-abstract.js +7 -1
  22. package/fesm2015/taiga-ui-cdk-abstract.js.map +1 -1
  23. package/fesm2015/taiga-ui-cdk-constants.js +1 -1
  24. package/fesm2015/taiga-ui-cdk-constants.js.map +1 -1
  25. package/fesm2015/taiga-ui-cdk-directives-auto-focus.js.map +1 -1
  26. package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js +19 -6
  27. package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js.map +1 -1
  28. package/fesm2015/taiga-ui-cdk-utils-svg.js +16 -3
  29. package/fesm2015/taiga-ui-cdk-utils-svg.js.map +1 -1
  30. package/package.json +1 -1
  31. package/schematics/ng-update/v3/steps/migrate-polymorpheus.js +9 -4
  32. package/utils/miscellaneous/default-sort.d.ts +1 -0
  33. package/utils/miscellaneous/index.d.ts +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taiga-ui/cdk",
3
- "version": "3.22.0",
3
+ "version": "3.23.0",
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",
@@ -19,6 +19,7 @@ function migratePolymorpheus({ resource, fileSystem, recorder, }) {
19
19
  }
20
20
  if (defaultTemplateEl) {
21
21
  insertPolymorpheusWithDefault({
22
+ template,
22
23
  defaultTemplateEl,
23
24
  recorder,
24
25
  templateOffset,
@@ -60,13 +61,17 @@ function removeOldInputs(recorder, template, templateOffset) {
60
61
  recorder.remove(start + templateOffset, end - start);
61
62
  });
62
63
  }
63
- function insertPolymorpheusWithDefault({ defaultTemplateEl, recorder, templateOffset, contentVal, contextVal, }) {
64
- var _a;
64
+ function insertPolymorpheusWithDefault({ template, defaultTemplateEl, recorder, templateOffset, contentVal, contextVal, }) {
65
+ var _a, _b;
65
66
  const templateVar = defaultTemplateEl.attrs.find(attr => attr.name.startsWith(`let-`));
66
- const varName = templateVar === null || templateVar === void 0 ? void 0 : templateVar.name.replace(`let-`, ``);
67
+ let templateVarName = templateVar === null || templateVar === void 0 ? void 0 : templateVar.name;
68
+ if (templateVarName === null || templateVarName === void 0 ? void 0 : templateVarName.startsWith(`let-`)) {
69
+ templateVarName = (_a = template.match(new RegExp(templateVarName, `i`))) === null || _a === void 0 ? void 0 : _a[0];
70
+ }
71
+ const varName = templateVarName === null || templateVarName === void 0 ? void 0 : templateVarName.replace(`let-`, ``);
67
72
  const attr = `*polymorpheusOutlet="${contentVal} as ${varName}${contextVal ? `; context: ${contextVal}` : ``}"`;
68
73
  replace_tag_1.replaceTag(recorder, defaultTemplateEl.sourceCodeLocation, `ng-template`, `ng-container`, templateOffset, [attr]);
69
- if (((_a = defaultTemplateEl.sourceCodeLocation) === null || _a === void 0 ? void 0 : _a.attrs) && (templateVar === null || templateVar === void 0 ? void 0 : templateVar.name)) {
74
+ if (((_b = defaultTemplateEl.sourceCodeLocation) === null || _b === void 0 ? void 0 : _b.attrs) && (templateVar === null || templateVar === void 0 ? void 0 : templateVar.name)) {
70
75
  recorder.remove(defaultTemplateEl.sourceCodeLocation.attrs[templateVar.name].startOffset +
71
76
  templateOffset, templateVar.name.length);
72
77
  }
@@ -0,0 +1 @@
1
+ export declare function tuiDefaultSort<T>(x: T, y: T): number;
@@ -1,6 +1,7 @@
1
1
  export * from './array-remove';
2
2
  export * from './array-shallow-equals';
3
3
  export * from './array-toggle';
4
+ export * from './default-sort';
4
5
  export * from './distance-between-touches';
5
6
  export * from './ease-in-out-quad';
6
7
  export * from './flat-length';