@swisspost/design-system-styles 5.0.0 → 5.1.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 (109) hide show
  1. package/basics.css +1 -1
  2. package/components/button.scss +0 -5
  3. package/components/utilities.scss +0 -1
  4. package/index.css +2 -2
  5. package/intranet.css +2 -2
  6. package/package.json +13 -12
  7. package/schematics/migrations/{forms → _example-dom-migration}/index.d.ts +0 -0
  8. package/schematics/migrations/_example-dom-migration/index.js +127 -0
  9. package/schematics/migrations/_example-dom-migration/index.js.map +1 -0
  10. package/schematics/migrations/{post-topic-teaser → bootstrap/badge}/index.d.ts +0 -0
  11. package/schematics/migrations/bootstrap/badge/index.js +85 -0
  12. package/schematics/migrations/bootstrap/badge/index.js.map +1 -0
  13. package/schematics/migrations/{rtl → bootstrap/blockquote}/index.d.ts +0 -1
  14. package/schematics/migrations/bootstrap/blockquote/index.js +40 -0
  15. package/schematics/migrations/bootstrap/blockquote/index.js.map +1 -0
  16. package/schematics/migrations/bootstrap/button/index.d.ts +2 -0
  17. package/schematics/migrations/bootstrap/button/index.js +56 -0
  18. package/schematics/migrations/bootstrap/button/index.js.map +1 -0
  19. package/schematics/migrations/{badges → bootstrap/button-close}/index.d.ts +0 -1
  20. package/schematics/migrations/bootstrap/button-close/index.js +35 -0
  21. package/schematics/migrations/bootstrap/button-close/index.js.map +1 -0
  22. package/schematics/migrations/bootstrap/form-checkbox/index.d.ts +2 -0
  23. package/schematics/migrations/bootstrap/form-checkbox/index.js +48 -0
  24. package/schematics/migrations/bootstrap/form-checkbox/index.js.map +1 -0
  25. package/schematics/migrations/bootstrap/form-control/index.d.ts +2 -0
  26. package/schematics/migrations/bootstrap/form-control/index.js +28 -0
  27. package/schematics/migrations/bootstrap/form-control/index.js.map +1 -0
  28. package/schematics/migrations/bootstrap/form-radio/index.d.ts +2 -0
  29. package/schematics/migrations/bootstrap/form-radio/index.js +48 -0
  30. package/schematics/migrations/bootstrap/form-radio/index.js.map +1 -0
  31. package/schematics/migrations/bootstrap/form-select/index.d.ts +2 -0
  32. package/schematics/migrations/bootstrap/form-select/index.js +54 -0
  33. package/schematics/migrations/bootstrap/form-select/index.js.map +1 -0
  34. package/schematics/migrations/bootstrap/form-switch/index.d.ts +2 -0
  35. package/schematics/migrations/bootstrap/form-switch/index.js +45 -0
  36. package/schematics/migrations/bootstrap/form-switch/index.js.map +1 -0
  37. package/schematics/migrations/bootstrap/forms/index.d.ts +2 -0
  38. package/schematics/migrations/bootstrap/forms/index.js +49 -0
  39. package/schematics/migrations/bootstrap/forms/index.js.map +1 -0
  40. package/schematics/migrations/bootstrap/textarea/index.d.ts +2 -0
  41. package/schematics/migrations/bootstrap/textarea/index.js +38 -0
  42. package/schematics/migrations/bootstrap/textarea/index.js.map +1 -0
  43. package/schematics/migrations/general/classes/bg-opacity.d.ts +2 -0
  44. package/schematics/migrations/general/classes/bg-opacity.js +34 -0
  45. package/schematics/migrations/general/classes/bg-opacity.js.map +1 -0
  46. package/schematics/migrations/general/classes/rtl.d.ts +2 -0
  47. package/schematics/migrations/general/classes/rtl.js +74 -0
  48. package/schematics/migrations/general/classes/rtl.js.map +1 -0
  49. package/schematics/migrations/general/classes/secondary.d.ts +2 -0
  50. package/schematics/migrations/general/classes/secondary.js +16 -0
  51. package/schematics/migrations/general/classes/secondary.js.map +1 -0
  52. package/schematics/migrations/general/classes/sr-only.d.ts +2 -0
  53. package/schematics/migrations/general/classes/sr-only.js +28 -0
  54. package/schematics/migrations/general/classes/sr-only.js.map +1 -0
  55. package/schematics/migrations/general/classes/text-auto.d.ts +2 -0
  56. package/schematics/migrations/general/classes/text-auto.js +16 -0
  57. package/schematics/migrations/general/classes/text-auto.js.map +1 -0
  58. package/schematics/migrations/ngbootstrap/buttons/index.d.ts +2 -0
  59. package/schematics/migrations/ngbootstrap/buttons/index.js +41 -0
  60. package/schematics/migrations/ngbootstrap/buttons/index.js.map +1 -0
  61. package/schematics/migrations/post/custom-select/index.d.ts +2 -0
  62. package/schematics/migrations/post/custom-select/index.js +63 -0
  63. package/schematics/migrations/post/custom-select/index.js.map +1 -0
  64. package/schematics/migrations/post/subnavigation/index.d.ts +2 -0
  65. package/schematics/migrations/post/subnavigation/index.js +16 -0
  66. package/schematics/migrations/post/subnavigation/index.js.map +1 -0
  67. package/schematics/migrations/post/topic-teaser/index.d.ts +2 -0
  68. package/schematics/migrations/post/topic-teaser/index.js +42 -0
  69. package/schematics/migrations/post/topic-teaser/index.js.map +1 -0
  70. package/schematics/migrations.json +72 -27
  71. package/schematics/utils/{css/constants.d.ts → constants.d.ts} +0 -0
  72. package/schematics/utils/{css/constants.js → constants.js} +1 -1
  73. package/schematics/utils/constants.js.map +1 -0
  74. package/schematics/utils/dom/migration-rule.d.ts +3 -0
  75. package/schematics/utils/dom/migration-rule.js +118 -0
  76. package/schematics/utils/dom/migration-rule.js.map +1 -0
  77. package/schematics/utils/dom/migration.d.ts +7 -0
  78. package/schematics/utils/dom/migration.js +11 -0
  79. package/schematics/utils/dom/migration.js.map +1 -0
  80. package/schematics/utils/dom/update.d.ts +5 -0
  81. package/schematics/utils/dom/update.js +3 -0
  82. package/schematics/utils/dom/update.js.map +1 -0
  83. package/schematics/migrations/backgrounds/index.d.ts +0 -3
  84. package/schematics/migrations/backgrounds/index.js +0 -19
  85. package/schematics/migrations/backgrounds/index.js.map +0 -1
  86. package/schematics/migrations/badges/index.js +0 -35
  87. package/schematics/migrations/badges/index.js.map +0 -1
  88. package/schematics/migrations/buttons/index.d.ts +0 -3
  89. package/schematics/migrations/buttons/index.js +0 -28
  90. package/schematics/migrations/buttons/index.js.map +0 -1
  91. package/schematics/migrations/close-button/index.d.ts +0 -3
  92. package/schematics/migrations/close-button/index.js +0 -27
  93. package/schematics/migrations/close-button/index.js.map +0 -1
  94. package/schematics/migrations/forms/index.js +0 -84
  95. package/schematics/migrations/forms/index.js.map +0 -1
  96. package/schematics/migrations/ng-buttons/index.d.ts +0 -3
  97. package/schematics/migrations/ng-buttons/index.js +0 -21
  98. package/schematics/migrations/ng-buttons/index.js.map +0 -1
  99. package/schematics/migrations/post-subnavigation/index.d.ts +0 -3
  100. package/schematics/migrations/post-subnavigation/index.js +0 -18
  101. package/schematics/migrations/post-subnavigation/index.js.map +0 -1
  102. package/schematics/migrations/post-topic-teaser/index.js +0 -35
  103. package/schematics/migrations/post-topic-teaser/index.js.map +0 -1
  104. package/schematics/migrations/rtl/index.js +0 -38
  105. package/schematics/migrations/rtl/index.js.map +0 -1
  106. package/schematics/migrations/secondary-classes/index.d.ts +0 -3
  107. package/schematics/migrations/secondary-classes/index.js +0 -19
  108. package/schematics/migrations/secondary-classes/index.js.map +0 -1
  109. package/schematics/utils/css/constants.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../schematics/migrations/post/topic-teaser/index.ts"],"names":[],"mappings":";;AACA,4DAAwD;AAIxD;IACE,OAAO,IAAI,mBAAY,CACrB,IAAI,oCAAoC,EACxC,IAAI,6BAA6B,EACjC,IAAI,+BAA+B,EACnC,IAAI,gCAAgC,CACrC,CAAC,IAAI,CAAC;AACT,CAAC;AAPD,4BAOC;AAED,MAAM,oCAAoC;IAA1C;QACE,aAAQ,GAAG,qBAAqB,CAAC;IAOnC,CAAC;IALC,MAAM,CAAE,SAA2B;QACjC,SAAS;aACN,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC;aACrB,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC5B,CAAC;CACF;AAED,MAAM,6BAA6B;IAAnC;QACE,aAAQ,GAAG,+BAA+B,CAAC;IAK7C,CAAC;IAHC,MAAM,CAAE,SAA2B;QACjC,SAAS,CAAC,WAAW,CAAC,0BAA0B,CAAC,CAAC;IACpD,CAAC;CACF;AAED,MAAM,+BAA+B;IAArC;QACE,aAAQ,GAAG,uBAAuB,CAAC;IAKrC,CAAC;IAHC,MAAM,CAAE,SAA2B;QACjC,SAAS,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;IAC3C,CAAC;CACF;AAED,MAAM,gCAAgC;IAAtC;QACE,aAAQ,GAAG,4BAA4B,CAAC;IAK1C,CAAC;IAHC,MAAM,CAAE,SAA2B;QACjC,SAAS,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;IAC9C,CAAC;CACF"}
@@ -2,55 +2,100 @@
2
2
  "$schema": "../node_modules/@angular-devkit/schematics/collection-schema.json",
3
3
 
4
4
  "schematics": {
5
- "migration-backgrounds": {
5
+ "migration-general-classes-bg-opacity": {
6
6
  "version": "5.0.0",
7
- "description": "As of Design System v5 backgrounds make extensive use of CSS variables, therefore the .text-auto and .bg-[color]-opacity-80 classes are deprecated.",
8
- "factory": "./migrations/backgrounds/index"
7
+ "description": "Migrates general bg-opacity classes.",
8
+ "factory": "./migrations/general/classes/bg-opacity"
9
9
  },
10
- "migration-badges": {
10
+ "migration-general-classes-secondary": {
11
11
  "version": "5.0.0",
12
- "description": "https://getbootstrap.com/docs/5.0/migration/#badges",
13
- "factory": "./migrations/badges/index"
12
+ "description": "Migrates general bg-secondary, border-secondary and text-secondary classes.",
13
+ "factory": "./migrations/general/classes/secondary"
14
14
  },
15
- "migration-buttons": {
15
+ "migration-general-text-auto": {
16
16
  "version": "5.0.0",
17
- "description": "https://getbootstrap.com/docs/5.0/migration/#buttons",
18
- "factory": "./migrations/buttons/index"
17
+ "description": "Migrates general text-auto classes.",
18
+ "factory": "./migrations/general/classes/text-auto"
19
19
  },
20
- "migration-close-button": {
20
+ "migration-general-rtl": {
21
21
  "version": "5.0.0",
22
- "description": "https://getbootstrap.com/docs/5.0/migration/#close-button",
23
- "factory": "./migrations/close-button/index"
22
+ "description": "Migrates general rtl helper classes (https://getbootstrap.com/docs/5.0/migration/#rtl).",
23
+ "factory": "./migrations/general/classes/rtl"
24
24
  },
25
- "migration-form-controls": {
25
+ "migration-general-sr-only": {
26
26
  "version": "5.0.0",
27
- "description": "Applies automatic migrations on form elements (https://getbootstrap.com/docs/5.0/migration/#forms).",
28
- "factory": "./migrations/forms/index"
27
+ "description": "Migrates general sr-only helper classes (https://getbootstrap.com/docs/5.0/migration/#helpers).",
28
+ "factory": "./migrations/general/classes/sr-only"
29
29
  },
30
- "migration-rtl": {
30
+ "migration-bootstrap-badge": {
31
31
  "version": "5.0.0",
32
- "description": "https://getbootstrap.com/docs/5.0/migration/#rtl",
33
- "factory": "./migrations/rtl/index"
32
+ "description": "Migrates bootstrap badge component.",
33
+ "factory": "./migrations/bootstrap/badge"
34
34
  },
35
- "migration-secondary-classes": {
35
+ "migration-bootstrap-blockquote": {
36
36
  "version": "5.0.0",
37
- "description": "Removes secondary classes \"bg-secondary\", \"border-secondary\" and \"text-secondary\"",
38
- "factory": "./migrations/secondary-classes/index"
37
+ "description": "Migrates bootstrap blockquote component.",
38
+ "factory": "./migrations/bootstrap/blockquote"
39
+ },
40
+ "migration-bootstrap-button": {
41
+ "version": "5.0.0",
42
+ "description": "Migrates bootstrap button component.",
43
+ "factory": "./migrations/bootstrap/button"
44
+ },
45
+ "migration-bootstrap-button-close": {
46
+ "version": "5.0.0",
47
+ "description": "Migrates bootstrap close-button component.",
48
+ "factory": "./migrations/bootstrap/button-close"
49
+ },
50
+ "migration-bootstrap-form-control": {
51
+ "version": "5.0.0",
52
+ "description": "Migrates bootstrap form-control component.",
53
+ "factory": "./migrations/bootstrap/form-control"
54
+ },
55
+ "migration-bootstrap-form-select": {
56
+ "version": "5.0.0",
57
+ "description": "Migrates bootstrap form-select component.",
58
+ "factory": "./migrations/bootstrap/form-select"
59
+ },
60
+ "migration-bootstrap-textarea": {
61
+ "version": "5.0.0",
62
+ "description": "Migrates bootstrap textarea component.",
63
+ "factory": "./migrations/bootstrap/textarea"
64
+ },
65
+ "migration-bootstrap-form-checkbox": {
66
+ "version": "5.0.0",
67
+ "description": "Migrates bootstrap form-checkbox component.",
68
+ "factory": "./migrations/bootstrap/form-checkbox"
69
+ },
70
+ "migration-bootstrap-form-radio": {
71
+ "version": "5.0.0",
72
+ "description": "Migrates bootstrap form-radio component.",
73
+ "factory": "./migrations/bootstrap/form-radio"
74
+ },
75
+ "migration-bootstrap-form-switch": {
76
+ "version": "5.0.0",
77
+ "description": "Migrates bootstrap form-switch component.",
78
+ "factory": "./migrations/bootstrap/form-switch"
39
79
  },
40
80
  "migration-ng-buttons": {
41
81
  "version": "5.0.0",
42
- "description": "Replaces ng-button classes.",
43
- "factory": "./migrations/ng-buttons/index"
82
+ "description": "Migrates ng-bootstrap button component.",
83
+ "factory": "./migrations/ngbootstrap/buttons"
84
+ },
85
+ "migration-post-custom-select": {
86
+ "version": "5.0.0",
87
+ "description": "Migrates post custom-select component.",
88
+ "factory": "./migrations/post/custom-select"
44
89
  },
45
90
  "migration-post-subnavigation": {
46
91
  "version": "5.0.0",
47
- "description": "Applies the automatic migrations to the post-subnavigation component.",
48
- "factory": "./migrations/post-subnavigation/index"
92
+ "description": "Migrates post subnavigation component.",
93
+ "factory": "./migrations/post/subnavigation"
49
94
  },
50
95
  "migration-post-topic-teaser": {
51
96
  "version": "5.0.0",
52
- "description": "Applies automatic migrations on topic-teaser elements.",
53
- "factory": "./migrations/post-topic-teaser/index"
97
+ "description": "Migrates post topic-teaser component.",
98
+ "factory": "./migrations/post/topic-teaser"
54
99
  }
55
100
  }
56
101
  }
@@ -5,5 +5,5 @@ exports.breakpoints = ['xs', 'sm', 'rg', 'md', 'lg', 'xl', 'xxl'];
5
5
  const bootstrapSizes = ['0', '1', '2', '3', '4', '5', 'auto'];
6
6
  const postSizes = ['hair', 'line', 'micro', 'mini', 'small-regular', 'regular', 'small-large', 'large', 'big', 'bigger-big', 'small-huge', 'huge', 'small-giant', 'giant', 'bigger-giant'];
7
7
  exports.sizes = [...bootstrapSizes, ...postSizes];
8
- exports.themeColors = ['primary', 'secondary', 'success', 'info', 'warning', 'danger', 'active', 'white', 'light', 'dark', 'nightblue', 'nightblue-bright', 'petrol', 'petrol-bright', 'coral', 'coral-bright', 'olive', 'olive-bright', 'purple', 'purple-bright', 'aubergine', 'aubergine-bright',];
8
+ exports.themeColors = ['primary', 'secondary', 'success', 'info', 'warning', 'danger', 'active', 'white', 'light', 'dark', 'nightblue', 'nightblue-bright', 'petrol', 'petrol-bright', 'coral', 'coral-bright', 'olive', 'olive-bright', 'purple', 'purple-bright', 'aubergine', 'aubergine-bright'];
9
9
  //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../schematics/utils/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;AAEvE,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;AAC9D,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;AAE9K,QAAA,KAAK,GAAG,CAAC,GAAG,cAAc,EAAE,GAAG,SAAS,CAAC,CAAC;AAE1C,QAAA,WAAW,GAAG,CAAC,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,kBAAkB,EAAE,QAAQ,EAAE,eAAe,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,eAAe,EAAE,WAAW,EAAE,kBAAkB,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ import DomMigration from './migration';
3
+ export default function DomMigrationRule(migration: DomMigration): Rule;
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const path_1 = require("path");
13
+ const core_1 = require("@angular-devkit/core");
14
+ const schematics_1 = require("@angular-devkit/schematics");
15
+ const project_tsconfig_paths_1 = require("@angular/core/schematics/utils/project_tsconfig_paths");
16
+ const compiler_host_1 = require("@angular/core/schematics/utils/typescript/compiler_host");
17
+ const ng_component_template_1 = require("@angular/core/schematics/utils/ng_component_template");
18
+ const cheerio = require("cheerio/lib/slim");
19
+ const prettier = require("prettier");
20
+ const htmlParser = require("prettier/parser-html");
21
+ // cheerio/lib/slim export uses htmlparser2 to parse the html
22
+ // this is why we can use htmlparser2 options here (instead of parse5 options)
23
+ const CHEERIO_OPTIONS = {
24
+ decodeEntities: false,
25
+ lowerCaseTags: false,
26
+ lowerCaseAttributeNames: false,
27
+ recognizeSelfClosing: true,
28
+ withStartIndices: true,
29
+ withEndIndices: true
30
+ };
31
+ const PRETTIER_OPTIONS = {
32
+ parser: 'html',
33
+ plugins: [htmlParser],
34
+ printWidth: 10000,
35
+ tabWidth: 2,
36
+ useTabs: false,
37
+ semi: true,
38
+ singleQuote: false,
39
+ quoteProps: 'consistent',
40
+ jsxSingleQuote: false,
41
+ trailingComma: 'es5',
42
+ bracketSpacing: true,
43
+ bracketSameLine: false,
44
+ arrowParens: "always",
45
+ htmlWhitespaceSensitivity: 'css',
46
+ endOfLine: 'lf',
47
+ embeddedLanguageFormatting: 'off',
48
+ singleAttributePerLine: true
49
+ };
50
+ function DomMigrationRule(migration) {
51
+ return (tree, _context) => __awaiter(this, void 0, void 0, function* () {
52
+ var _a, _b, _c, _d;
53
+ const { buildPaths, testPaths } = yield (0, project_tsconfig_paths_1.getProjectTsConfigPaths)(tree);
54
+ const basePath = process.cwd();
55
+ if (!buildPaths.length && !testPaths.length) {
56
+ throw new schematics_1.SchematicsException('Could not find any tsconfig file. Cannot check templates for empty routerLinks.');
57
+ }
58
+ for (const tsconfigPath of [...buildPaths, ...testPaths]) {
59
+ const { program } = (0, compiler_host_1.createMigrationProgram)(tree, tsconfigPath, basePath);
60
+ const sourceFiles = program.getSourceFiles().filter((sourceFile) => (0, compiler_host_1.canMigrateFile)(basePath, sourceFile, program));
61
+ const templateVisitor = new ng_component_template_1.NgComponentTemplateVisitor(program.getTypeChecker(), basePath, tree);
62
+ sourceFiles.forEach((sourceFile) => templateVisitor.visitNode(sourceFile));
63
+ for (const template of templateVisitor.resolvedTemplates) {
64
+ const treeFilePath = (0, path_1.relative)((0, core_1.normalize)(basePath), (0, core_1.normalize)(template.filePath));
65
+ let sourceCode = (_b = (_a = tree.read(treeFilePath)) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '';
66
+ if (!sourceCode)
67
+ continue;
68
+ for (const [updateKey, { update, selector }] of Object.entries(migration.updates)) {
69
+ // get update class context
70
+ const context = migration.updates[Number(updateKey)];
71
+ // create cheerio dom tree
72
+ const $ = cheerio.load(sourceCode, CHEERIO_OPTIONS, false);
73
+ // get "cheerioElement[]" to mutate in "update" method and add cheerio-identifier to each of em
74
+ const $inputElements = $(selector).each((i, element) => { $(element).data('cheerio-id', i); });
75
+ // continue to next migration.update if no elements were found
76
+ if ($inputElements.length <= 0)
77
+ continue;
78
+ // map elements to sourceElements for later comparison
79
+ const sourceElements = Array.from($inputElements)
80
+ .map((element, index) => {
81
+ var _a;
82
+ return ({
83
+ id: index,
84
+ element: $(element).toString(),
85
+ start: (_a = element.startIndex) !== null && _a !== void 0 ? _a : null,
86
+ end: element.endIndex ? element.endIndex + 1 : null
87
+ });
88
+ });
89
+ // send "cheerioElement[]" and cheerio instance to the "update" method
90
+ // after this "cheerioElement[]" in "$elements" are updated
91
+ update.bind(context)($inputElements, $);
92
+ // get updated elements from dom tree
93
+ const $outputElements = $('*').filter((_i, element) => $(element).data('cheerio-id') !== undefined);
94
+ // start tree file recorder to update tree file later
95
+ const treeUpdateRecorder = tree.beginUpdate(treeFilePath);
96
+ sourceElements
97
+ .forEach(source => {
98
+ // get corresponding outputelement by cheerio-id
99
+ const distElement = $outputElements.filter((_i, element) => $(element).data('cheerio-id') === source.id).first().toString();
100
+ // continue to next "element", if eighter "element" has not been updated or "element" has no indices
101
+ if (source.element === distElement || source.start === null || source.end === null)
102
+ return;
103
+ // remove old "element" out of tree file
104
+ treeUpdateRecorder.remove(source.start, source.end - source.start);
105
+ // write new "element" into the tree file
106
+ treeUpdateRecorder.insertLeft(source.start, prettier.format(distElement, PRETTIER_OPTIONS).replace(/(\n|\r\n)$/, ''));
107
+ });
108
+ // commit changes in tree file to tree
109
+ tree.commitUpdate(treeUpdateRecorder);
110
+ // update "sourceCode" for chained "DomUpdates" in same migration schematic
111
+ sourceCode = (_d = (_c = tree.read(treeFilePath)) === null || _c === void 0 ? void 0 : _c.toString()) !== null && _d !== void 0 ? _d : '';
112
+ }
113
+ }
114
+ }
115
+ });
116
+ }
117
+ exports.default = DomMigrationRule;
118
+ //# sourceMappingURL=migration-rule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration-rule.js","sourceRoot":"","sources":["../../../../schematics/utils/dom/migration-rule.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+BAAgC;AAChC,+CAAiD;AACjD,2DAA+F;AAC/F,kGAAgG;AAChG,2FAAiH;AACjH,gGAAkG;AAGlG,4CAA4C;A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C,YAAY,CAAC,KAAK,MAAM,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,CAAC;wBAE5H,oGAAoG;wBACpG,IAAI,MAAM,CAAC,OAAO,KAAK,WAAW,IAAI,MAAM,CAAC,KAAK,KAAK,IAAI,IAAI,MAAM,CAAC,GAAG,KAAK,IAAI;4BAAE,OAAO;wBAE3F,wCAAwC;wBACxC,kBAAkB,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;wBACnE,yCAAyC;wBACzC,kBAAkB,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,CAAC;oBACxH,CAAC,CAAC,CAAC;oBAEL,sCAAsC;oBACtC,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;oBACtC,2EAA2E;oBAC3E,UAAU,GAAG,MAAA,MAAA,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,0CAAE,QAAQ,EAAE,mCAAI,EAAE,CAAC;iBACxD;aACF;SACF;IACH,CAAC,CAAA,CAAC;AACJ,CAAC;AA5ED,mCA4EC"}
@@ -0,0 +1,7 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ import DomUpdate from './update';
3
+ export default class DomMigration {
4
+ updates: DomUpdate[];
5
+ rule: Rule;
6
+ constructor(...updates: DomUpdate[]);
7
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const migration_rule_1 = require("./migration-rule");
4
+ class DomMigration {
5
+ constructor(...updates) {
6
+ this.updates = updates;
7
+ this.rule = (0, migration_rule_1.default)(this);
8
+ }
9
+ }
10
+ exports.default = DomMigration;
11
+ //# sourceMappingURL=migration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration.js","sourceRoot":"","sources":["../../../../schematics/utils/dom/migration.ts"],"names":[],"mappings":";;AAEA,qDAAgD;AAEhD,MAAqB,YAAY;IAI/B,YAAY,GAAG,OAAoB;QACjC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAA,wBAAgB,EAAC,IAAI,CAAC,CAAC;IACrC,CAAC;CACF;AARD,+BAQC"}
@@ -0,0 +1,5 @@
1
+ import { Cheerio, CheerioAPI } from 'cheerio';
2
+ export default interface IDomUpdate {
3
+ selector: string;
4
+ update: ($elements: Cheerio<any>, $: CheerioAPI) => void;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../schematics/utils/dom/update.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- /** Entry point for the backgrounds' migration. */
3
- export default function (): Rule;
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const css_classes_update_1 = require("../../utils/css/css-classes-update");
4
- const css_migration_1 = require("../../utils/css/css-migration");
5
- /** Entry point for the backgrounds' migration. */
6
- function default_1() {
7
- return new css_migration_1.CssMigration(new TextAutoClassesUpdate).rule;
8
- }
9
- exports.default = default_1;
10
- // The .text-auto class no longer exists
11
- class TextAutoClassesUpdate extends css_classes_update_1.CssClassesUpdate {
12
- constructor() {
13
- super(...arguments);
14
- this.searchValue = 'text-auto';
15
- this.replaceValue = '';
16
- }
17
- }
18
- // TODO: Replace .bg-[themeColor]-opacity-80 by style="--post-bg-opacity: 0.8"
19
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../schematics/migrations/backgrounds/index.ts"],"names":[],"mappings":";;AACA,2EAAoE;AACpE,iEAA2D;AAE3D,kDAAkD;AAClD;IACI,OAAO,IAAI,4BAAY,CAAC,IAAI,qBAAqB,CAAC,CAAC,IAAI,CAAC;AAC5D,CAAC;AAFD,4BAEC;AAED,wCAAwC;AACxC,MAAM,qBAAsB,SAAQ,qCAAgB;IAApD;;QACI,gBAAW,GAAG,WAAW,CAAC;QAC1B,iBAAY,GAAG,EAAE,CAAC;IACtB,CAAC;CAAA;AAED,8EAA8E"}
@@ -1,35 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const css_classes_update_1 = require("../../utils/css/css-classes-update");
4
- const constants_1 = require("../../utils/css/constants");
5
- const css_migration_1 = require("../../utils/css/css-migration");
6
- const regex_1 = require("../../utils/regex");
7
- /** Entry point for the badges migration. */
8
- function default_1() {
9
- return new css_migration_1.CssMigration(new BadgeColorClassUpdate, new BadgePillClassUpdate, new GreyCarraraBadgeClassUpdate).rule;
10
- }
11
- exports.default = default_1;
12
- // The .badge-* classes no longer exists
13
- class BadgeColorClassUpdate extends css_classes_update_1.CssClassesUpdate {
14
- constructor() {
15
- super(...arguments);
16
- this.badgeStyleUpdates = new Map([['badge', 'bg'], ['badge-outline', 'border']]);
17
- this.searchValue = (0, regex_1.oneOf)(this.badgeStyleUpdates.keys()) + '-' + (0, regex_1.oneOf)(constants_1.themeColors);
18
- this.replaceValue = (badgeStyle, color) => this.badgeStyleUpdates.get(badgeStyle) + '-' + color;
19
- }
20
- }
21
- class BadgePillClassUpdate extends css_classes_update_1.CssClassesUpdate {
22
- constructor() {
23
- super(...arguments);
24
- this.searchValue = 'badge-pill';
25
- this.replaceValue = 'rounded-pill';
26
- }
27
- }
28
- class GreyCarraraBadgeClassUpdate extends css_classes_update_1.CssClassesUpdate {
29
- constructor() {
30
- super(...arguments);
31
- this.searchValue = 'badge' + (0, regex_1.optional)('(-outline)') + '-gray-carrara' + (0, regex_1.optional)('(-thick)');
32
- this.replaceValue = (outline, thick) => (outline ? 'border-light' : 'bg-light') + (thick ? ' border-2' : '');
33
- }
34
- }
35
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../schematics/migrations/badges/index.ts"],"names":[],"mappings":";;AACA,2EAAoE;AACpE,yDAAsD;AACtD,iEAA2D;AAC3D,6CAAkD;AAElD,4CAA4C;AAC5C;IACI,OAAO,IAAI,4BAAY,CAAC,IAAI,qBAAqB,EAAE,IAAI,oBAAoB,EAAE,IAAI,2BAA2B,CAAC,CAAC,IAAI,CAAC;AACvH,CAAC;AAFD,4BAEC;AAED,wCAAwC;AACxC,MAAM,qBAAsB,SAAQ,qCAAgB;IAApD;;QACI,sBAAiB,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;QAE5E,gBAAW,GAAG,IAAA,aAAK,EAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,CAAC,GAAG,GAAG,GAAG,IAAA,aAAK,EAAC,uBAAW,CAAC,CAAC;QAC9E,iBAAY,GAAG,CAAC,UAAkB,EAAE,KAAa,EAAE,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,GAAG,GAAG,KAAK,CAAC;IAC/G,CAAC;CAAA;AAED,MAAM,oBAAqB,SAAQ,qCAAgB;IAAnD;;QACI,gBAAW,GAAG,YAAY,CAAC;QAC3B,iBAAY,GAAG,cAAc,CAAC;IAClC,CAAC;CAAA;AAED,MAAM,2BAA4B,SAAQ,qCAAgB;IAA1D;;QACI,gBAAW,GAAG,OAAO,GAAG,IAAA,gBAAQ,EAAC,YAAY,CAAC,GAAG,eAAe,GAAG,IAAA,gBAAQ,EAAC,UAAU,CAAC,CAAC;QACxF,iBAAY,GAAG,CAAC,OAAe,EAAE,KAAa,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAC5H,CAAC;CAAA"}
@@ -1,3 +0,0 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- /** Entry point for the buttons' migration. */
3
- export default function (): Rule;
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const constants_1 = require("../../utils/css/constants");
4
- const css_classes_update_1 = require("../../utils/css/css-classes-update");
5
- const css_migration_1 = require("../../utils/css/css-migration");
6
- const regex_1 = require("../../utils/regex");
7
- /** Entry point for the buttons' migration. */
8
- function default_1() {
9
- return new css_migration_1.CssMigration(new OutlinedButtonClassesUpdate, new InvertedButtonClassesUpdate).rule;
10
- }
11
- exports.default = default_1;
12
- // The outlined colored buttons no longer exist
13
- class OutlinedButtonClassesUpdate extends css_classes_update_1.CssClassesUpdate {
14
- constructor() {
15
- super(...arguments);
16
- this.searchValue = 'btn-outline-' + (0, regex_1.oneOf)(constants_1.themeColors);
17
- this.replaceValue = (color) => 'btn-' + color;
18
- }
19
- }
20
- // The .btn-inverted class no longer exists
21
- class InvertedButtonClassesUpdate extends css_classes_update_1.CssClassesUpdate {
22
- constructor() {
23
- super(...arguments);
24
- this.searchValue = 'btn-inverted';
25
- this.replaceValue = '';
26
- }
27
- }
28
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../schematics/migrations/buttons/index.ts"],"names":[],"mappings":";;AACA,yDAAsD;AACtD,2EAAoE;AACpE,iEAA2D;AAC3D,6CAAwC;AAExC,8CAA8C;AAC9C;IACI,OAAO,IAAI,4BAAY,CAAC,IAAI,2BAA2B,EAAE,IAAI,2BAA2B,CAAC,CAAC,IAAI,CAAC;AACnG,CAAC;AAFD,4BAEC;AAED,+CAA+C;AAC/C,MAAM,2BAA4B,SAAQ,qCAAgB;IAA1D;;QACI,gBAAW,GAAG,cAAc,GAAG,IAAA,aAAK,EAAC,uBAAW,CAAC,CAAC;QAClD,iBAAY,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,MAAM,GAAG,KAAK,CAAC;IACrD,CAAC;CAAA;AAED,2CAA2C;AAC3C,MAAM,2BAA4B,SAAQ,qCAAgB;IAA1D;;QACI,gBAAW,GAAG,cAAc,CAAC;QAC7B,iBAAY,GAAG,EAAE,CAAC;IACtB,CAAC;CAAA"}
@@ -1,3 +0,0 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- /** Entry point for the close button migration. */
3
- export default function (): Rule;
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const css_classes_update_1 = require("../../utils/css/css-classes-update");
4
- const css_migration_1 = require("../../utils/css/css-migration");
5
- const regex_1 = require("../../utils/regex");
6
- /** Entry point for the close button migration. */
7
- function default_1() {
8
- return new css_migration_1.CssMigration(new CloseButtonClassesUpdate, new CloseButtonClassesRemove).rule;
9
- }
10
- exports.default = default_1;
11
- class CloseButtonClassesUpdate extends css_classes_update_1.CssClassesUpdate {
12
- constructor() {
13
- super(...arguments);
14
- this.classSelector = 'close';
15
- this.searchValue = 'close';
16
- this.replaceValue = 'btn-close';
17
- }
18
- }
19
- class CloseButtonClassesRemove extends css_classes_update_1.CssClassesUpdate {
20
- constructor() {
21
- super(...arguments);
22
- this.classSelector = (0, regex_1.oneOf)(['close', 'btn-close']);
23
- this.searchValue = (0, regex_1.oneOf)(['btn', 'btn-icon']);
24
- this.replaceValue = '';
25
- }
26
- }
27
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../schematics/migrations/close-button/index.ts"],"names":[],"mappings":";;AACA,2EAAoE;AACpE,iEAA2D;AAC3D,6CAA0C;AAE1C,kDAAkD;AAClD;IACI,OAAO,IAAI,4BAAY,CAAC,IAAI,wBAAwB,EAAE,IAAI,wBAAwB,CAAC,CAAC,IAAI,CAAC;AAC7F,CAAC;AAFD,4BAEC;AAED,MAAM,wBAAyB,SAAQ,qCAAgB;IAAvD;;QACa,kBAAa,GAAG,OAAO,CAAC;QACjC,gBAAW,GAAG,OAAO,CAAC;QACtB,iBAAY,GAAG,WAAW,CAAC;IAC/B,CAAC;CAAA;AAED,MAAM,wBAAyB,SAAQ,qCAAgB;IAAvD;;QACa,kBAAa,GAAG,IAAA,aAAK,EAAC,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC;QACvD,gBAAW,GAAG,IAAA,aAAK,EAAC,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC;QACzC,iBAAY,GAAG,EAAE,CAAC;IACtB,CAAC;CAAA"}
@@ -1,84 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const css_classes_update_1 = require("../../utils/css/css-classes-update");
4
- const css_migration_1 = require("../../utils/css/css-migration");
5
- const regex_1 = require("../../utils/regex");
6
- function default_1() {
7
- return new css_migration_1.CssMigration(new FormGroupClassesUpdate, new FormTextClassesUpdate, new FormSelectClassesUpdate, new FormSelectMenuClassesUpdate, new FormCheckClassesUpdate, new FormCheckChildrenClassesUpdate, new FormSwitchClassesUpdate, new FormSwitchInputClassesUpdate, new FormSwitchTogglerClassesUpdate).rule;
8
- }
9
- exports.default = default_1;
10
- class FormGroupClassesUpdate extends css_classes_update_1.CssClassesUpdate {
11
- constructor() {
12
- super(...arguments);
13
- this.searchValue = 'form-group';
14
- this.replaceValue = 'mb-regular';
15
- }
16
- }
17
- class FormTextClassesUpdate extends css_classes_update_1.CssClassesUpdate {
18
- constructor() {
19
- super(...arguments);
20
- this.classSelector = 'form-text';
21
- this.searchValue = (0, regex_1.oneOf)(['small', 'text-muted']);
22
- this.replaceValue = '';
23
- }
24
- }
25
- // Applied on select, multiselect and custom-select elements
26
- class FormSelectClassesUpdate extends css_classes_update_1.CssClassesUpdate {
27
- constructor() {
28
- super(...arguments);
29
- this.classSelector = 'custom-select';
30
- this.searchValue = `form-control${(0, regex_1.optional)(`-${(0, regex_1.oneOf)(['sm', 'rg', 'md', 'lg'])}`)}`;
31
- this.replaceValue = (size) => `form-select${size ? `-${size}` : ''}`;
32
- }
33
- }
34
- class FormSelectMenuClassesUpdate extends css_classes_update_1.CssClassesUpdate {
35
- constructor() {
36
- super(...arguments);
37
- this.classSelector = 'custom-select-menu';
38
- this.searchValue = 'custom-select-menu';
39
- this.replaceValue = 'w-100 mw-100';
40
- }
41
- }
42
- class FormCheckClassesUpdate extends css_classes_update_1.CssClassesUpdate {
43
- constructor() {
44
- super(...arguments);
45
- this.classSelector = (0, regex_1.oneOf)(['custom-checkbox', 'custom-radio']);
46
- this.searchValue = (0, regex_1.oneOf)(['custom-control', 'custom-checkbox', 'custom-radio']);
47
- this.replaceValue = 'form-check';
48
- }
49
- }
50
- class FormCheckChildrenClassesUpdate extends css_classes_update_1.CssClassesUpdate {
51
- constructor() {
52
- super(...arguments);
53
- this.classSelector = (0, regex_1.oneOf)(['custom-control-input', 'custom-control-label', 'custom-control-inline']);
54
- this.searchValue = `custom-control-${(0, regex_1.oneOf)(['input', 'label', 'inline'])}`;
55
- this.replaceValue = (child) => `form-check-${child}`;
56
- }
57
- }
58
- class FormSwitchClassesUpdate extends css_classes_update_1.CssClassesUpdate {
59
- constructor() {
60
- super(...arguments);
61
- this.tagSelector = 'div';
62
- this.classSelector = 'switch';
63
- this.searchValue = 'switch';
64
- this.replaceValue = 'form-check form-switch';
65
- }
66
- }
67
- class FormSwitchInputClassesUpdate extends css_classes_update_1.CssClassesUpdate {
68
- constructor() {
69
- super(...arguments);
70
- this.tagSelector = 'input';
71
- this.classSelector = 'switch';
72
- this.searchValue = 'switch';
73
- this.replaceValue = 'form-check-input';
74
- }
75
- }
76
- class FormSwitchTogglerClassesUpdate extends css_classes_update_1.CssClassesUpdate {
77
- constructor() {
78
- super(...arguments);
79
- this.classSelector = 'switch-toggler';
80
- this.searchValue = 'switch-toggler';
81
- this.replaceValue = '';
82
- }
83
- }
84
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../schematics/migrations/forms/index.ts"],"names":[],"mappings":";;AACA,2EAAsE;AACtE,iEAA6D;AAC7D,6CAAoD;AAEpD;IACI,OAAO,IAAI,4BAAY,CACnB,IAAI,sBAAsB,EAC1B,IAAI,qBAAqB,EACzB,IAAI,uBAAuB,EAC3B,IAAI,2BAA2B,EAC/B,IAAI,sBAAsB,EAC1B,IAAI,8BAA8B,EAClC,IAAI,uBAAuB,EAC3B,IAAI,4BAA4B,EAChC,IAAI,8BAA8B,CACrC,CAAC,IAAI,CAAC;AACX,CAAC;AAZD,4BAYC;AAED,MAAM,sBAAuB,SAAQ,qCAAgB;IAArD;;QACI,gBAAW,GAAG,YAAY,CAAC;QAC3B,iBAAY,GAAG,YAAY,CAAC;IAChC,CAAC;CAAA;AAED,MAAM,qBAAsB,SAAQ,qCAAgB;IAApD;;QACa,kBAAa,GAAG,WAAW,CAAC;QACrC,gBAAW,GAAG,IAAA,aAAK,EAAC,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC;QAC7C,iBAAY,GAAG,EAAE,CAAC;IACtB,CAAC;CAAA;AAED,4DAA4D;AAC5D,MAAM,uBAAwB,SAAQ,qCAAgB;IAAtD;;QACa,kBAAa,GAAG,eAAe,CAAC;QACzC,gBAAW,GAAG,eAAe,IAAA,gBAAQ,EAAC,IAAI,IAAA,aAAK,EAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;QAC/E,iBAAY,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,cAAc,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAC5E,CAAC;CAAA;AAED,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BAAW,GAAG,gBAAgB,CAAC;QAC/B,iBAAY,GAAG,EAAE,CAAC;IACtB,CAAC;CAAA"}
@@ -1,3 +0,0 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- /** Entry point for the ng-buttons migration. */
3
- export default function (): Rule;
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const css_classes_update_1 = require("../../utils/css/css-classes-update");
4
- const css_migration_1 = require("../../utils/css/css-migration");
5
- /** Entry point for the ng-buttons migration. */
6
- function default_1() {
7
- return new css_migration_1.CssMigration(new NgButtonClassUpdate).rule;
8
- }
9
- exports.default = default_1;
10
- // The label classes have changed
11
- class NgButtonClassUpdate extends css_classes_update_1.CssClassesUpdate {
12
- constructor() {
13
- super(...arguments);
14
- this.tagSelector = 'label';
15
- this.classSelector = 'btn-primary';
16
- this.attributeSelector = 'ngbButtonLabel';
17
- this.searchValue = 'btn-primary';
18
- this.replaceValue = 'btn-secondary';
19
- }
20
- }
21
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../schematics/migrations/ng-buttons/index.ts"],"names":[],"mappings":";;AACA,2EAAsE;AACtE,iEAA6D;AAE7D,gDAAgD;AAChD;IACI,OAAO,IAAI,4BAAY,CAAC,IAAI,mBAAmB,CAAC,CAAC,IAAI,CAAC;AAC1D,CAAC;AAFD,4BAEC;AAED,iCAAiC;AACjC,MAAM,mBAAoB,SAAQ,qCAAgB;IAAlD;;QACa,gBAAW,GAAG,OAAO,CAAC;QACtB,kBAAa,GAAG,aAAa,CAAC;QAC9B,sBAAiB,GAAG,gBAAgB,CAAC;QAC9C,gBAAW,GAAG,aAAa,CAAC;QAC5B,iBAAY,GAAG,eAAe,CAAC;IACnC,CAAC;CAAA"}
@@ -1,3 +0,0 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- /** Entry point for the post-subnavigation migration. */
3
- export default function (): Rule;
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const css_classes_update_1 = require("../../utils/css/css-classes-update");
4
- const css_migration_1 = require("../../utils/css/css-migration");
5
- /** Entry point for the post-subnavigation migration. */
6
- function default_1() {
7
- return new css_migration_1.CssMigration(new SecondaryClassesUpdate).rule;
8
- }
9
- exports.default = default_1;
10
- // The .subnavigation-inverted class no longer exists
11
- class SecondaryClassesUpdate extends css_classes_update_1.CssClassesUpdate {
12
- constructor() {
13
- super(...arguments);
14
- this.searchValue = 'subnavigation-inverted';
15
- this.replaceValue = '';
16
- }
17
- }
18
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../schematics/migrations/post-subnavigation/index.ts"],"names":[],"mappings":";;AACA,2EAAsE;AACtE,iEAA6D;AAE7D,wDAAwD;AACxD;IACI,OAAO,IAAI,4BAAY,CAAC,IAAI,sBAAsB,CAAC,CAAC,IAAI,CAAC;AAC7D,CAAC;AAFD,4BAEC;AAED,qDAAqD;AACrD,MAAM,sBAAuB,SAAQ,qCAAgB;IAArD;;QAEI,gBAAW,GAAG,wBAAwB,CAAC;QACvC,iBAAY,GAAG,EAAE,CAAC;IACtB,CAAC;CAAA"}