@taiga-ui/cdk 3.29.2 → 3.30.0-dev.main-2773afa

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 (58) hide show
  1. package/bundles/taiga-ui-cdk-components-alert-host.umd.js +32 -8
  2. package/bundles/taiga-ui-cdk-components-alert-host.umd.js.map +1 -1
  3. package/bundles/taiga-ui-cdk-components-dialog-host.umd.js +33 -11
  4. package/bundles/taiga-ui-cdk-components-dialog-host.umd.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-observables.umd.js +10 -0
  8. package/bundles/taiga-ui-cdk-observables.umd.js.map +1 -1
  9. package/bundles/taiga-ui-cdk-services.umd.js +3 -1
  10. package/bundles/taiga-ui-cdk-services.umd.js.map +1 -1
  11. package/bundles/taiga-ui-cdk-tokens.umd.js +1 -1
  12. package/bundles/taiga-ui-cdk-tokens.umd.js.map +1 -1
  13. package/components/alert-host/alert-host.component.d.ts +9 -5
  14. package/components/dialog-host/dialog-host.component.d.ts +8 -5
  15. package/constants/version.d.ts +1 -1
  16. package/constants/version.js +1 -1
  17. package/esm2015/components/alert-host/alert-host.component.js +32 -6
  18. package/esm2015/components/dialog-host/dialog-host.component.js +31 -9
  19. package/esm2015/constants/version.js +2 -2
  20. package/esm2015/observables/index.js +2 -1
  21. package/esm2015/observables/scroll-from.js +10 -0
  22. package/esm2015/services/parents-scroll.service.js +4 -2
  23. package/esm2015/tokens/removed-element.js +2 -2
  24. package/fesm2015/taiga-ui-cdk-components-alert-host.js +31 -5
  25. package/fesm2015/taiga-ui-cdk-components-alert-host.js.map +1 -1
  26. package/fesm2015/taiga-ui-cdk-components-dialog-host.js +30 -8
  27. package/fesm2015/taiga-ui-cdk-components-dialog-host.js.map +1 -1
  28. package/fesm2015/taiga-ui-cdk-constants.js +1 -1
  29. package/fesm2015/taiga-ui-cdk-constants.js.map +1 -1
  30. package/fesm2015/taiga-ui-cdk-observables.js +10 -1
  31. package/fesm2015/taiga-ui-cdk-observables.js.map +1 -1
  32. package/fesm2015/taiga-ui-cdk-services.js +3 -1
  33. package/fesm2015/taiga-ui-cdk-services.js.map +1 -1
  34. package/fesm2015/taiga-ui-cdk-tokens.js +1 -1
  35. package/fesm2015/taiga-ui-cdk-tokens.js.map +1 -1
  36. package/observables/index.d.ts +1 -0
  37. package/observables/scroll-from.d.ts +5 -0
  38. package/package.json +2 -2
  39. package/schematics/migration.json +5 -0
  40. package/schematics/ng-add/schema.json +1 -1
  41. package/schematics/ng-update/utils/templates/replace-attr-values.d.ts +10 -0
  42. package/schematics/ng-update/utils/templates/replace-attr-values.js +30 -0
  43. package/schematics/ng-update/v3/constants/templates.d.ts +1 -1
  44. package/schematics/ng-update/v3/constants/templates.js +3 -3
  45. package/schematics/ng-update/v3/interfaces/replaceable-attribute-value.d.ts +1 -1
  46. package/schematics/ng-update/v3/steps/migrate-templates.js +6 -20
  47. package/schematics/ng-update/v3-30/constants/constants.d.ts +2 -0
  48. package/schematics/ng-update/v3-30/constants/constants.js +8 -0
  49. package/schematics/ng-update/v3-30/constants/icons.d.ts +4 -0
  50. package/schematics/ng-update/v3-30/constants/icons.js +993 -0
  51. package/schematics/ng-update/v3-30/index.d.ts +3 -0
  52. package/schematics/ng-update/v3-30/index.js +33 -0
  53. package/schematics/ng-update/v3-30/steps/replace-text.d.ts +4 -0
  54. package/schematics/ng-update/v3-30/steps/replace-text.js +19 -0
  55. package/schematics/utils/templates/elements.d.ts +1 -1
  56. package/schematics/utils/templates/elements.js +2 -2
  57. /package/schematics/ng-update/{v3/interfaces → interfaces}/replaceable-attribute.d.ts +0 -0
  58. /package/schematics/ng-update/{v3/interfaces → interfaces}/replaceable-attribute.js +0 -0
@@ -0,0 +1,3 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ import { TuiSchema } from '../../ng-add/schema';
3
+ export declare function updateToV3_30(options: TuiSchema): Rule;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateToV3_30 = void 0;
4
+ const ng_morph_1 = require("ng-morph");
5
+ const colored_log_1 = require("../../utils/colored-log");
6
+ const replace_const_1 = require("../steps/replace-const");
7
+ const get_file_system_1 = require("../utils/get-file-system");
8
+ const constants_1 = require("./constants/constants");
9
+ const icons_1 = require("./constants/icons");
10
+ const replace_text_1 = require("./steps/replace-text");
11
+ // eslint-disable-next-line @typescript-eslint/naming-convention
12
+ function updateToV3_30(options) {
13
+ return (tree, _) => {
14
+ if (!hasProprietaryIcons(tree)) {
15
+ !options[`skip-logs`] &&
16
+ colored_log_1.titleLog(`${colored_log_1.FINISH_SYMBOL} No migrations required\n`);
17
+ return;
18
+ }
19
+ const fileSystem = get_file_system_1.getFileSystem(tree);
20
+ replace_const_1.replaceConstants(options, constants_1.ICONS_TS);
21
+ !options[`skip-logs`] &&
22
+ colored_log_1.infoLog(`${colored_log_1.SMALL_TAB_SYMBOL}${colored_log_1.REPLACE_SYMBOL} replacing strings...`);
23
+ replace_text_1.replaceText(icons_1.ICONS);
24
+ fileSystem.commitEdits();
25
+ ng_morph_1.saveActiveProject();
26
+ !options[`skip-logs`] &&
27
+ colored_log_1.titleLog(`${colored_log_1.FINISH_SYMBOL} Icons successfully migrated \n`);
28
+ };
29
+ }
30
+ exports.updateToV3_30 = updateToV3_30;
31
+ function hasProprietaryIcons(tree) {
32
+ return !!ng_morph_1.getPackageJsonDependency(tree, `@taiga-ui/proprietary-icons`);
33
+ }
@@ -0,0 +1,4 @@
1
+ export declare function replaceText(replaceable: Array<{
2
+ from: string;
3
+ to: string;
4
+ }>): void;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.replaceText = void 0;
4
+ const ng_morph_1 = require("ng-morph");
5
+ const constants_1 = require("../../../constants");
6
+ function replaceText(replaceable) {
7
+ const sourceFiles = ng_morph_1.getSourceFiles(constants_1.ALL_FILES);
8
+ sourceFiles.forEach(file => {
9
+ let text = file.getFullText();
10
+ replaceable.forEach(({ from, to }) => {
11
+ const regexp = new RegExp(from, `g`);
12
+ if (text.match(regexp)) {
13
+ text = text.replace(regexp, to);
14
+ }
15
+ });
16
+ file.replaceWithText(text);
17
+ });
18
+ }
19
+ exports.replaceText = replaceText;
@@ -13,7 +13,7 @@ export declare function findElementsWithAttribute(html: string, attributeName: s
13
13
  * @param html
14
14
  * @param attributeName
15
15
  */
16
- export declare function findElementsWithAttributeOnTag(html: string, attributeName: string, tagNames?: string[]): Element[];
16
+ export declare function findElementsWithAttributeOnTag(html: string, attributeNames: string[], tagNames?: string[]): Element[];
17
17
  /**
18
18
  * Finds elements with explicit tag names that also contain the specified attribute. Returns the
19
19
  * attribute start offset based on the specified HTML.
@@ -49,10 +49,10 @@ exports.findElementsWithAttribute = findElementsWithAttribute;
49
49
  * @param html
50
50
  * @param attributeName
51
51
  */
52
- function findElementsWithAttributeOnTag(html, attributeName, tagNames = []) {
52
+ function findElementsWithAttributeOnTag(html, attributeNames, tagNames = []) {
53
53
  return findElementsInTemplateByFn(html, el => {
54
54
  var _a;
55
- return ((_a = el.attrs) === null || _a === void 0 ? void 0 : _a.some(attr => attr.name === attributeName.toLowerCase())) &&
55
+ return ((_a = el.attrs) === null || _a === void 0 ? void 0 : _a.some(attr => attributeNames.map(name => name.toLowerCase()).includes(attr.name))) &&
56
56
  (tagNames.includes(el.tagName) || !tagNames.length);
57
57
  });
58
58
  }