@swisspost/design-system-styles 5.4.1 → 6.0.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.
- package/basics.css +1 -1
- package/components/accordion.scss +1 -1
- package/components/alert.scss +2 -5
- package/components/badge.scss +1 -1
- package/components/breadcrumb.scss +1 -1
- package/components/button-group.scss +27 -51
- package/components/button.scss +1 -1
- package/components/card.scss +5 -5
- package/components/carousel.scss +1 -1
- package/components/close.scss +1 -1
- package/components/form-check.scss +1 -1
- package/components/form-range.scss +1 -1
- package/components/form-select.scss +1 -1
- package/components/grid.scss +1 -1
- package/components/intranet-header/_logo.scss +1 -1
- package/components/intranet-header/_nav-overflow.scss +1 -1
- package/components/intranet-header/_scaffolding.scss +1 -1
- package/components/intranet-header/_searchbox.scss +1 -1
- package/components/intranet-header/_sidebar.scss +1 -1
- package/components/intranet-header/_top-navigation.scss +1 -1
- package/components/list-group.scss +1 -1
- package/components/modal.scss +1 -1
- package/components/offcanvas.scss +1 -1
- package/components/popover.scss +1 -1
- package/components/product-card.scss +0 -1
- package/components/progress.scss +1 -1
- package/components/sizing.scss +1 -1
- package/components/spinner.scss +1 -1
- package/components/stepper.scss +12 -6
- package/components/subnavigation.scss +1 -1
- package/components/tabs.scss +1 -1
- package/components/toast.scss +1 -1
- package/components/topic-teaser.scss +1 -1
- package/components/type.scss +1 -1
- package/components/utilities.scss +5 -5
- package/core.scss +1 -1
- package/index.css +6 -32
- package/intranet.css +7 -33
- package/layouts/portal/_grid.scss +1 -1
- package/layouts/portal/_type.scss +1 -1
- package/mixins/_animation.scss +1 -1
- package/mixins/_size.scss +1 -1
- package/mixins/_type.scss +2 -2
- package/package.json +15 -15
- package/placeholders/_notifications.scss +1 -1
- package/placeholders/_text.scss +1 -1
- package/placeholders/badge.scss +1 -1
- package/schematics/migrations/_example-dom-migration/index.js +11 -7
- package/schematics/migrations/_example-dom-migration/index.js.map +1 -1
- package/schematics/migrations/bootstrap/badge/index.js +2 -2
- package/schematics/migrations/bootstrap/badge/index.js.map +1 -1
- package/schematics/migrations/bootstrap/blockquote/index.js +2 -2
- package/schematics/migrations/bootstrap/blockquote/index.js.map +1 -1
- package/schematics/migrations/bootstrap/button/index.js +2 -2
- package/schematics/migrations/bootstrap/button/index.js.map +1 -1
- package/schematics/migrations/bootstrap/button-close/index.js +2 -2
- package/schematics/migrations/bootstrap/button-close/index.js.map +1 -1
- package/schematics/migrations/bootstrap/form-checkbox/index.js +2 -2
- package/schematics/migrations/bootstrap/form-checkbox/index.js.map +1 -1
- package/schematics/migrations/bootstrap/form-control/index.js +2 -2
- package/schematics/migrations/bootstrap/form-control/index.js.map +1 -1
- package/schematics/migrations/bootstrap/form-radio/index.js +2 -2
- package/schematics/migrations/bootstrap/form-radio/index.js.map +1 -1
- package/schematics/migrations/bootstrap/form-select/index.js +2 -2
- package/schematics/migrations/bootstrap/form-select/index.js.map +1 -1
- package/schematics/migrations/bootstrap/form-switch/index.js +2 -2
- package/schematics/migrations/bootstrap/form-switch/index.js.map +1 -1
- package/schematics/migrations/bootstrap/forms/index.js +2 -2
- package/schematics/migrations/bootstrap/forms/index.js.map +1 -1
- package/schematics/migrations/bootstrap/textarea/index.js +2 -2
- package/schematics/migrations/bootstrap/textarea/index.js.map +1 -1
- package/schematics/migrations/general/classes/bg-opacity.js +2 -2
- package/schematics/migrations/general/classes/bg-opacity.js.map +1 -1
- package/schematics/migrations/general/classes/rtl.js +5 -3
- package/schematics/migrations/general/classes/rtl.js.map +1 -1
- package/schematics/migrations/general/classes/secondary.js +2 -2
- package/schematics/migrations/general/classes/secondary.js.map +1 -1
- package/schematics/migrations/general/classes/sr-only.js +2 -2
- package/schematics/migrations/general/classes/sr-only.js.map +1 -1
- package/schematics/migrations/general/classes/text-auto.js +2 -2
- package/schematics/migrations/general/classes/text-auto.js.map +1 -1
- package/schematics/migrations/ngbootstrap/buttons/index.js +60 -29
- package/schematics/migrations/ngbootstrap/buttons/index.js.map +1 -1
- package/schematics/migrations/post/custom-select/index.js +2 -2
- package/schematics/migrations/post/custom-select/index.js.map +1 -1
- package/schematics/migrations/post/stepper/index.d.ts +2 -0
- package/schematics/migrations/post/stepper/index.js +61 -0
- package/schematics/migrations/post/stepper/index.js.map +1 -0
- package/schematics/migrations/post/subnavigation/index.js +2 -2
- package/schematics/migrations/post/subnavigation/index.js.map +1 -1
- package/schematics/migrations/post/topic-teaser/index.js +2 -2
- package/schematics/migrations/post/topic-teaser/index.js.map +1 -1
- package/schematics/migrations.json +6 -2
- package/schematics/utils/constants.d.ts +2 -0
- package/schematics/utils/constants.js +67 -3
- package/schematics/utils/constants.js.map +1 -1
- package/schematics/utils/{dom/update.d.ts → dom-migration/dom-update.d.ts} +1 -1
- package/schematics/utils/{dom/update.js → dom-migration/dom-update.js} +1 -1
- package/schematics/utils/dom-migration/dom-update.js.map +1 -0
- package/schematics/utils/dom-migration/get-dom-migration-rule.d.ts +3 -0
- package/schematics/utils/{dom/migration-rule.js → dom-migration/get-dom-migration-rule.js} +27 -18
- package/schematics/utils/dom-migration/get-dom-migration-rule.js.map +1 -0
- package/schematics/utils/dom-migration/index.d.ts +2 -0
- package/schematics/utils/dom-migration/index.js +22 -0
- package/schematics/utils/dom-migration/index.js.map +1 -0
- package/themes/bootstrap/_accordion.scss +1 -1
- package/themes/bootstrap/_alert.scss +1 -1
- package/themes/bootstrap/_badge.scss +1 -1
- package/themes/bootstrap/_breadcrumbs.scss +1 -1
- package/themes/bootstrap/_button-group.scss +1 -1
- package/themes/bootstrap/_buttons.scss +1 -1
- package/themes/bootstrap/_card.scss +1 -1
- package/themes/bootstrap/_carousel.scss +1 -1
- package/themes/bootstrap/_close.scss +1 -1
- package/themes/bootstrap/_containers.scss +1 -1
- package/themes/bootstrap/{_overrides.scss → _core.scss} +7 -1
- package/themes/bootstrap/_dropdown.scss +1 -1
- package/themes/bootstrap/_grid.scss +1 -1
- package/themes/bootstrap/_images.scss +1 -1
- package/themes/bootstrap/_list-group.scss +1 -1
- package/themes/bootstrap/_modal.scss +1 -1
- package/themes/bootstrap/_nav.scss +1 -1
- package/themes/bootstrap/_navbar.scss +1 -1
- package/themes/bootstrap/_offcanvas.scss +1 -1
- package/themes/bootstrap/_overrides-color.scss +1 -1
- package/themes/bootstrap/_pagination.scss +1 -1
- package/themes/bootstrap/_popover.scss +1 -1
- package/themes/bootstrap/_progress.scss +1 -1
- package/themes/bootstrap/_reboot.scss +1 -1
- package/themes/bootstrap/_root.scss +1 -1
- package/themes/bootstrap/_spinners.scss +1 -1
- package/themes/bootstrap/_tables.scss +1 -1
- package/themes/bootstrap/_toasts.scss +1 -1
- package/themes/bootstrap/_tooltip.scss +1 -1
- package/themes/bootstrap/_transitions.scss +1 -1
- package/themes/bootstrap/_type.scss +1 -1
- package/themes/bootstrap/_utilities.scss +1 -1
- package/themes/bootstrap/forms/_floating-labels.scss +1 -1
- package/themes/bootstrap/forms/_form-check.scss +1 -1
- package/themes/bootstrap/forms/_form-control.scss +1 -1
- package/themes/bootstrap/forms/_form-range.scss +1 -1
- package/themes/bootstrap/forms/_form-select.scss +1 -1
- package/themes/bootstrap/forms/_form-text.scss +1 -1
- package/themes/bootstrap/forms/_input-group.scss +1 -1
- package/themes/bootstrap/forms/_labels.scss +1 -1
- package/themes/bootstrap/forms/_validation.scss +1 -1
- package/variables/_color.scss +2 -1
- package/variables/components/_alert.scss +1 -1
- package/variables/components/_button.scss +7 -5
- package/variables/components/_tables.scss +0 -1
- package/schematics/utils/css/css-classes-update.d.ts +0 -14
- package/schematics/utils/css/css-classes-update.js +0 -27
- package/schematics/utils/css/css-classes-update.js.map +0 -1
- package/schematics/utils/css/css-migration-rule.d.ts +0 -4
- package/schematics/utils/css/css-migration-rule.js +0 -112
- package/schematics/utils/css/css-migration-rule.js.map +0 -1
- package/schematics/utils/css/css-migration.d.ts +0 -13
- package/schematics/utils/css/css-migration.js +0 -36
- package/schematics/utils/css/css-migration.js.map +0 -1
- package/schematics/utils/css/html_css_classes_visitor.d.ts +0 -23
- package/schematics/utils/css/html_css_classes_visitor.js +0 -76
- package/schematics/utils/css/html_css_classes_visitor.js.map +0 -1
- package/schematics/utils/dom/migration-rule.d.ts +0 -3
- package/schematics/utils/dom/migration-rule.js.map +0 -1
- package/schematics/utils/dom/migration.d.ts +0 -7
- package/schematics/utils/dom/migration.js +0 -11
- package/schematics/utils/dom/migration.js.map +0 -1
- package/schematics/utils/dom/update.js.map +0 -1
- package/schematics/utils/regex.d.ts +0 -2
- package/schematics/utils/regex.js +0 -12
- package/schematics/utils/regex.js.map +0 -1
|
@@ -1,41 +1,72 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
3
|
+
const crypto_1 = require("crypto");
|
|
4
|
+
const constants_1 = require("../../../utils/constants");
|
|
5
|
+
const dom_migration_1 = require("../../../utils/dom-migration");
|
|
4
6
|
function default_1() {
|
|
5
|
-
return
|
|
7
|
+
return (0, dom_migration_1.getDomMigrationRule)(new NgbButtonGroupDeprecationUpdate);
|
|
6
8
|
}
|
|
7
9
|
exports.default = default_1;
|
|
8
|
-
class
|
|
10
|
+
class NgbButtonGroupDeprecationUpdate {
|
|
9
11
|
constructor() {
|
|
10
|
-
this.selector = '.btn-group
|
|
12
|
+
this.selector = '.btn-group';
|
|
11
13
|
}
|
|
12
|
-
update($
|
|
13
|
-
$
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
14
|
+
update($buttonGroups, $) {
|
|
15
|
+
$buttonGroups
|
|
16
|
+
.each((_i, buttonGroup) => {
|
|
17
|
+
var _a;
|
|
18
|
+
const $buttonGroup = $(buttonGroup);
|
|
19
|
+
const $labels = $buttonGroup
|
|
20
|
+
.children('label')
|
|
21
|
+
.filter((_i, label) => {
|
|
22
|
+
return typeof $(label).attr('ngbButtonLabel') !== 'undefined';
|
|
23
|
+
});
|
|
24
|
+
// exit if the button group does not contain labels with a ngb directive
|
|
25
|
+
if (!$labels.length) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
// if the button group is a radio group, remove the ngb radio directive
|
|
29
|
+
let attributesToTransfer;
|
|
30
|
+
if (typeof $buttonGroup.attr('ngbRadioGroup') !== 'undefined') {
|
|
31
|
+
$buttonGroup.removeAttr('ngbRadioGroup');
|
|
32
|
+
// save the form control properties from the radio group
|
|
33
|
+
attributesToTransfer = constants_1.formControlProperties
|
|
34
|
+
.map(prop => ({ key: prop, value: $buttonGroup.attr(prop) }))
|
|
35
|
+
.filter((attr) => typeof attr.value !== 'undefined');
|
|
36
|
+
// save the form control references from the radio group
|
|
37
|
+
Object.entries((_a = $buttonGroup.attr()) !== null && _a !== void 0 ? _a : {})
|
|
38
|
+
.forEach(([key, value]) => {
|
|
39
|
+
if (constants_1.formControlReferences.includes(value)) {
|
|
40
|
+
attributesToTransfer.push({ key, value });
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
// remove the form control properties and references from the radio group
|
|
44
|
+
attributesToTransfer.forEach(attr => {
|
|
45
|
+
$buttonGroup.removeAttr(attr.key);
|
|
46
|
+
});
|
|
29
47
|
}
|
|
48
|
+
$labels.each((_j, label) => {
|
|
49
|
+
const $label = $(label);
|
|
50
|
+
const $input = $label.children('input').first();
|
|
51
|
+
// remove the ngb directives
|
|
52
|
+
$label.removeAttr('ngbButtonLabel');
|
|
53
|
+
$input.removeAttr('ngbButton');
|
|
54
|
+
// bind the input with its label via an id
|
|
55
|
+
let inputId = $input.attr('id');
|
|
56
|
+
if (!inputId) {
|
|
57
|
+
inputId = (0, crypto_1.randomUUID)();
|
|
58
|
+
$input.attr('id', inputId);
|
|
59
|
+
}
|
|
60
|
+
$label.attr('for', inputId);
|
|
61
|
+
// transfer attributes from parent
|
|
62
|
+
attributesToTransfer
|
|
63
|
+
.forEach(attr => {
|
|
64
|
+
$input.attr(attr.key, attr.value);
|
|
65
|
+
});
|
|
66
|
+
// move the input before its label
|
|
67
|
+
$label.before($input);
|
|
68
|
+
});
|
|
30
69
|
});
|
|
31
70
|
}
|
|
32
71
|
}
|
|
33
|
-
class ButtonInputClassUpdate {
|
|
34
|
-
constructor() {
|
|
35
|
-
this.selector = '.btn-group input[ngbButton]';
|
|
36
|
-
}
|
|
37
|
-
update($elements) {
|
|
38
|
-
$elements.addClass('btn-check');
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
72
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../schematics/migrations/ngbootstrap/buttons/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../schematics/migrations/ngbootstrap/buttons/index.ts"],"names":[],"mappings":";;AAEA,mCAAoC;AACpC,wDAAwF;AACxF,gEAA8E;AAE9E;IACE,OAAO,IAAA,mCAAmB,EACxB,IAAI,+BAA+B,CACpC,CAAC;AACJ,CAAC;AAJD,4BAIC;AAED,MAAM,+BAA+B;IAArC;QACE,aAAQ,GAAG,YAAY,CAAC;IAqE1B,CAAC;IAnEC,MAAM,CAAC,aAA+B,EAAE,CAAa;QACnD,aAAa;aACV,IAAI,CAAC,CAAC,EAAE,EAAE,WAAW,EAAE,EAAE;;YACxB,MAAM,YAAY,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC;YAEpC,MAAM,OAAO,GAAG,YAAY;iBACzB,QAAQ,CAAC,OAAO,CAAC;iBACjB,MAAM,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE;gBACpB,OAAO,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,KAAK,WAAW,CAAC;YAChE,CAAC,CAAC,CAAC;YAEL,wEAAwE;YACxE,IAAI,CA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,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;gBACpC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;gBAE/B,0CAA0C;gBAC1C,IAAI,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAChC,IAAI,CAAC,OAAO,EAAE;oBACZ,OAAO,GAAG,IAAA,mBAAU,GAAE,CAAC;oBACvB,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;iBAC5B;gBACD,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;gBAE5B,kCAAkC;gBAClC,oBAAoB;qBACjB,OAAO,CAAC,IAAI,CAAC,EAAE;oBACd,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;gBACpC,CAAC,CAAC,CAAC;gBAEL,kCAAkC;gBAClC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YACxB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;CACF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
3
|
+
const dom_migration_1 = require("../../../utils/dom-migration");
|
|
4
4
|
function default_1() {
|
|
5
|
-
return
|
|
5
|
+
return (0, dom_migration_1.getDomMigrationRule)(new CustomSelectFloatingLabelWrapperUpdate, new CustomSelectClassesUpdate, new CustomSelectMenuClassesUpdate);
|
|
6
6
|
}
|
|
7
7
|
exports.default = default_1;
|
|
8
8
|
class CustomSelectFloatingLabelWrapperUpdate {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../schematics/migrations/post/custom-select/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../schematics/migrations/post/cust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CAAC,KAAK,SAAS,CAAC;YAE7E,IAAI,mBAAmB,EAAE;gBACvB,QAAQ;qBACL,WAAW,CAAC,4BAA4B,CAAC;qBACzC,QAAQ,CAAC,aAAa,CAAC,CAAC;aAC5B;QACH,CAAC,CAAC,CAAC;IACP,CAAC;CACF;AAED,MAAM,6BAA6B;IAAnC;QACE,aAAQ,GAAG,qBAAqB,CAAC;IAenC,CAAC;IAbC,MAAM,CAAC,SAA2B,EAAE,CAAa;QAC/C,SAAS;aACN,IAAI,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE;YACpB,MAAM,QAAQ,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC;YAC5B,MAAM,iBAAiB,GAAG,QAAQ,CAAC,IAAI,CAAC,iBAAiB,CAAC,KAAK,SAAS,CAAC;YAEzE,IAAI,iBAAiB,EAAE;gBACrB,QAAQ;qBACL,WAAW,CAAC,oBAAoB,CAAC;qBACjC,QAAQ,CAAC,cAAc,CAAC,CAAC;aAC7B;QACH,CAAC,CAAC,CAAC;IACP,CAAC;CACF"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const dom_migration_1 = require("../../../utils/dom-migration");
|
|
4
|
+
function default_1() {
|
|
5
|
+
return (0, dom_migration_1.getDomMigrationRule)(new StepperContainerUpdate, new StepperBarUpdate, new StepperUpdate, new StepperLinkUpdate);
|
|
6
|
+
}
|
|
7
|
+
exports.default = default_1;
|
|
8
|
+
// replace the aria-label of the stepper containers with a hidden heading
|
|
9
|
+
class StepperContainerUpdate {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.selector = '.stepper-container';
|
|
12
|
+
}
|
|
13
|
+
update($stepperContainers, $) {
|
|
14
|
+
$stepperContainers
|
|
15
|
+
.each((_i, stepperContainer) => {
|
|
16
|
+
const $stepperContainer = $(stepperContainer);
|
|
17
|
+
const simpleAriaLabel = $stepperContainer.attr('aria-label');
|
|
18
|
+
if (simpleAriaLabel) {
|
|
19
|
+
$stepperContainer.removeAttr('aria-label');
|
|
20
|
+
$stepperContainer.prepend(`<h2 class="visually-hidden">${simpleAriaLabel}</h2>`);
|
|
21
|
+
}
|
|
22
|
+
const boundAriaLabel = $stepperContainer.attr('[attr.aria-label]');
|
|
23
|
+
if (boundAriaLabel) {
|
|
24
|
+
$stepperContainer.removeAttr('[attr.aria-label]');
|
|
25
|
+
$stepperContainer.prepend(`<h2 class="visually-hidden">{{ ${boundAriaLabel} }}</h2>`);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
// make the stepper bars aria-hidden and remove their type attribute
|
|
31
|
+
class StepperBarUpdate {
|
|
32
|
+
constructor() {
|
|
33
|
+
this.selector = '.stepper-bar';
|
|
34
|
+
}
|
|
35
|
+
update($stepperBars) {
|
|
36
|
+
$stepperBars
|
|
37
|
+
.attr('aria-hidden', 'true')
|
|
38
|
+
.removeAttr('type');
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
// add a list role to the steppers
|
|
42
|
+
class StepperUpdate {
|
|
43
|
+
constructor() {
|
|
44
|
+
this.selector = '.stepper';
|
|
45
|
+
}
|
|
46
|
+
update($stepper) {
|
|
47
|
+
$stepper.attr('role', 'list');
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
// remove the tabindex on stepper links
|
|
51
|
+
class StepperLinkUpdate {
|
|
52
|
+
constructor() {
|
|
53
|
+
this.selector = '.stepper-link';
|
|
54
|
+
}
|
|
55
|
+
update($stepperBars) {
|
|
56
|
+
$stepperBars
|
|
57
|
+
.removeAttr('tabindex')
|
|
58
|
+
.removeAttr('[attr.tabindex]');
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../schematics/migrations/post/stepper/index.ts"],"names":[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;QAC/B,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,CAAC;CACF;AAED,uCAAuC;AACvC,MAAM,iBAAiB;IAAvB;QACE,aAAQ,GAAG,eAAe,CAAC;IAO7B,CAAC;IALC,MAAM,CAAC,YAA8B;QACnC,YAAY;aACT,UAAU,CAAC,UAAU,CAAC;aACtB,UAAU,CAAC,iBAAiB,CAAC,CAAC;IACnC,CAAC;CACF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
3
|
+
const dom_migration_1 = require("../../../utils/dom-migration");
|
|
4
4
|
function default_1() {
|
|
5
|
-
return
|
|
5
|
+
return (0, dom_migration_1.getDomMigrationRule)(new SubnavigationInvertedClassUpdate);
|
|
6
6
|
}
|
|
7
7
|
exports.default = default_1;
|
|
8
8
|
class SubnavigationInvertedClassUpdate {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../schematics/migrations/post/subnavigation/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../schematics/migrations/post/subnavigation/index.ts"],"names":[],"mappings":";;AAEA,gEAA8E;AAE9E;IACE,OAAO,IAAA,mCAAmB,EACxB,IAAI,gCAAgC,CACrC,CAAC;AACJ,CAAC;AAJD,4BAIC;AAED,MAAM,gCAAgC;IAAtC;QACE,aAAQ,GAAG,yBAAyB,CAAC;IAKvC,CAAC;IAHC,MAAM,CAAC,SAA2B;QAChC,SAAS,CAAC,WAAW,CAAC,wBAAwB,CAAC,CAAC;IAClD,CAAC;CACF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
3
|
+
const dom_migration_1 = require("../../../utils/dom-migration");
|
|
4
4
|
function default_1() {
|
|
5
|
-
return
|
|
5
|
+
return (0, dom_migration_1.getDomMigrationRule)(new TopicTeaserImageWidthAndHeightUpdate, new TopicTeaserImageClassesUpdate, new TopicTeaserContentClassesUpdate, new TopicTeaserLinkListClassesUpdate);
|
|
6
6
|
}
|
|
7
7
|
exports.default = default_1;
|
|
8
8
|
class TopicTeaserImageWidthAndHeightUpdate {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../schematics/migrations/post/topic-teaser/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../schematics/migrations/post/topic-teaser/index.ts"],"names":[],"mappings":";;AAEA,gEAA8E;AAE9E;IACE,OAAO,IAAA,mCAAmB,EACxB,IAAI,oCAAoC,EACxC,IAAI,6BAA6B,EACjC,IAAI,+BAA+B,EACnC,IAAI,gCAAgC,CACrC,CAAC;AACJ,CAAC;AAPD,4BAOC;AAED,MAAM,oCAAoC;IAA1C;QACE,aAAQ,GAAG,qBAAqB,CAAC;IAOnC,CAAC;IALC,MAAM,CAAC,SAA2B;QAChC,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,CAAC,SAA2B;QAChC,SAAS,CAAC,WAAW,CAAC,0BAA0B,CAAC,CAAC;IACpD,CAAC;CACF;AAED,MAAM,+BAA+B;IAArC;QACE,aAAQ,GAAG,uBAAuB,CAAC;IAKrC,CAAC;IAHC,MAAM,CAAC,SAA2B;QAChC,SAAS,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;IAC3C,CAAC;CACF;AAED,MAAM,gCAAgC;IAAtC;QACE,aAAQ,GAAG,4BAA4B,CAAC;IAK1C,CAAC;IAHC,MAAM,CAAC,SAA2B;QAChC,SAAS,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;IAC9C,CAAC;CACF"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "../node_modules/@angular-devkit/schematics/collection-schema.json",
|
|
3
|
-
|
|
4
3
|
"schematics": {
|
|
5
4
|
"migration-general-classes-bg-opacity": {
|
|
6
5
|
"version": "5.0.0",
|
|
@@ -79,7 +78,7 @@
|
|
|
79
78
|
},
|
|
80
79
|
"migration-ng-buttons": {
|
|
81
80
|
"version": "5.0.0",
|
|
82
|
-
"description": "
|
|
81
|
+
"description": "Deprecates ng-bootstrap button component.",
|
|
83
82
|
"factory": "./migrations/ngbootstrap/buttons"
|
|
84
83
|
},
|
|
85
84
|
"migration-post-custom-select": {
|
|
@@ -96,6 +95,11 @@
|
|
|
96
95
|
"version": "5.0.0",
|
|
97
96
|
"description": "Migrates post topic-teaser component.",
|
|
98
97
|
"factory": "./migrations/post/topic-teaser"
|
|
98
|
+
},
|
|
99
|
+
"migration-post-stepper": {
|
|
100
|
+
"version": "6.0.0",
|
|
101
|
+
"description": "Improves the post stepper accessibility.",
|
|
102
|
+
"factory": "./migrations/post/stepper"
|
|
99
103
|
}
|
|
100
104
|
}
|
|
101
105
|
}
|
|
@@ -1,9 +1,73 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.themeColors = exports.sizes = exports.breakpoints = void 0;
|
|
3
|
+
exports.formControlReferences = exports.formControlProperties = exports.themeColors = exports.sizes = exports.breakpoints = void 0;
|
|
4
4
|
exports.breakpoints = ['xs', 'sm', 'rg', 'md', 'lg', 'xl', 'xxl'];
|
|
5
5
|
const bootstrapSizes = ['0', '1', '2', '3', '4', '5', 'auto'];
|
|
6
|
-
const postSizes = [
|
|
6
|
+
const postSizes = [
|
|
7
|
+
'hair',
|
|
8
|
+
'line',
|
|
9
|
+
'micro',
|
|
10
|
+
'mini',
|
|
11
|
+
'small-regular',
|
|
12
|
+
'regular',
|
|
13
|
+
'small-large',
|
|
14
|
+
'large',
|
|
15
|
+
'big',
|
|
16
|
+
'bigger-big',
|
|
17
|
+
'small-huge',
|
|
18
|
+
'huge',
|
|
19
|
+
'small-giant',
|
|
20
|
+
'giant',
|
|
21
|
+
'bigger-giant',
|
|
22
|
+
];
|
|
7
23
|
exports.sizes = [...bootstrapSizes, ...postSizes];
|
|
8
|
-
exports.themeColors = [
|
|
24
|
+
exports.themeColors = [
|
|
25
|
+
'primary',
|
|
26
|
+
'secondary',
|
|
27
|
+
'success',
|
|
28
|
+
'info',
|
|
29
|
+
'warning',
|
|
30
|
+
'danger',
|
|
31
|
+
'active',
|
|
32
|
+
'white',
|
|
33
|
+
'light',
|
|
34
|
+
'dark',
|
|
35
|
+
'nightblue',
|
|
36
|
+
'nightblue-bright',
|
|
37
|
+
'petrol',
|
|
38
|
+
'petrol-bright',
|
|
39
|
+
'coral',
|
|
40
|
+
'coral-bright',
|
|
41
|
+
'olive',
|
|
42
|
+
'olive-bright',
|
|
43
|
+
'purple',
|
|
44
|
+
'purple-bright',
|
|
45
|
+
'aubergine',
|
|
46
|
+
'aubergine-bright',
|
|
47
|
+
];
|
|
48
|
+
// list of all inputs and outputs of directives that can create an instance of formControl
|
|
49
|
+
// - https://angular.io/api/forms/FormControlDirective#properties
|
|
50
|
+
// - https://angular.io/api/forms/FormControlName#properties
|
|
51
|
+
// - https://angular.io/api/forms/NgModel#properties
|
|
52
|
+
exports.formControlProperties = [
|
|
53
|
+
'[formControl]',
|
|
54
|
+
'formControlName',
|
|
55
|
+
'[formControlName]',
|
|
56
|
+
'ngModel',
|
|
57
|
+
'[ngModel]',
|
|
58
|
+
'[(ngModel)]',
|
|
59
|
+
'(ngModelChange)',
|
|
60
|
+
'[ngModelOptions]',
|
|
61
|
+
'name',
|
|
62
|
+
'[name]',
|
|
63
|
+
'disabled',
|
|
64
|
+
'[disabled]',
|
|
65
|
+
];
|
|
66
|
+
// list of all the template variable references of directives that can create an instance of formControl
|
|
67
|
+
// - https://angular.io/api/forms/FormControlDirective#template-variable-references
|
|
68
|
+
// - https://angular.io/api/forms/NgModel#template-variable-references
|
|
69
|
+
exports.formControlReferences = [
|
|
70
|
+
'ngForm',
|
|
71
|
+
'ngModel',
|
|
72
|
+
];
|
|
9
73
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../schematics/utils/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../schematics/utils/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG,CAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAE,CAAC;AAEzE,MAAM,cAAc,GAAG,CAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,CAAE,CAAC;AAChE,MAAM,SAAS,GAAG;IAChB,MAAM;IACN,MAAM;IACN,OAAO;IACP,MAAM;IACN,eAAe;IACf,SAAS;IACT,aAAa;IACb,OAAO;IACP,KAAK;IACL,YAAY;IACZ,YAAY;IACZ,MAAM;IACN,aAAa;IACb,OAAO;IACP,cAAc;CACf,CAAC;AAEW,QAAA,KAAK,GAAG,CAAE,GAAG,cAAc,EAAE,GAAG,SAAS,CAAE,CAAC;AAE5C,QAAA,WAAW,GAAG;IACzB,SAAS;IACT,WAAW;IACX,SAAS;IACT,MAAM;IACN,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,OAAO;IACP,MAAM;IACN,WAAW;IACX,kBAAkB;IAClB,QAAQ;IACR,eAAe;IACf,OAAO;IACP,cAAc;IACd,OAAO;IACP,cAAc;IACd,QAAQ;IACR,eAAe;IACf,WAAW;IACX,kBAAkB;CACnB,CAAC;AAEF,0FAA0F;AAC1F,iEAAiE;AACjE,4DAA4D;AAC5D,oDAAoD;AACvC,QAAA,qBAAqB,GAAG;IACnC,eAAe;IACf,iBAAiB;IACjB,mBAAmB;IACnB,SAAS;IACT,WAAW;IACX,aAAa;IACb,iBAAiB;IACjB,kBAAkB;IAClB,MAAM;IACN,QAAQ;IACR,UAAU;IACV,YAAY;CACb,CAAC;AAEF,wGAAwG;AACxG,mFAAmF;AACnF,sEAAsE;AACzD,QAAA,qBAAqB,GAAG;IACnC,QAAQ;IACR,SAAS;CACV,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom-update.js","sourceRoot":"","sources":["../../../../schematics/utils/dom-migration/dom-update.ts"],"names":[],"mappings":""}
|
|
@@ -9,13 +9,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
|
|
12
|
+
exports.getDomMigrationRule = void 0;
|
|
13
13
|
const core_1 = require("@angular-devkit/core");
|
|
14
14
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
15
|
+
const ng_component_template_1 = require("@angular/core/schematics/utils/ng_component_template");
|
|
15
16
|
const project_tsconfig_paths_1 = require("@angular/core/schematics/utils/project_tsconfig_paths");
|
|
16
17
|
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
18
|
const cheerio = require("cheerio/lib/slim");
|
|
19
|
+
const path_1 = require("path");
|
|
19
20
|
const prettier = require("prettier");
|
|
20
21
|
const htmlParser = require("prettier/parser-html");
|
|
21
22
|
// cheerio/lib/slim export uses htmlparser2 to parse the html
|
|
@@ -26,7 +27,7 @@ const CHEERIO_OPTIONS = {
|
|
|
26
27
|
lowerCaseAttributeNames: false,
|
|
27
28
|
recognizeSelfClosing: true,
|
|
28
29
|
withStartIndices: true,
|
|
29
|
-
withEndIndices: true
|
|
30
|
+
withEndIndices: true,
|
|
30
31
|
};
|
|
31
32
|
const PRETTIER_OPTIONS = {
|
|
32
33
|
parser: 'html',
|
|
@@ -41,13 +42,13 @@ const PRETTIER_OPTIONS = {
|
|
|
41
42
|
trailingComma: 'es5',
|
|
42
43
|
bracketSpacing: true,
|
|
43
44
|
bracketSameLine: false,
|
|
44
|
-
arrowParens:
|
|
45
|
+
arrowParens: 'always',
|
|
45
46
|
htmlWhitespaceSensitivity: 'css',
|
|
46
47
|
endOfLine: 'lf',
|
|
47
48
|
embeddedLanguageFormatting: 'off',
|
|
48
|
-
singleAttributePerLine: true
|
|
49
|
+
singleAttributePerLine: true,
|
|
49
50
|
};
|
|
50
|
-
function
|
|
51
|
+
function getDomMigrationRule(...updates) {
|
|
51
52
|
return (tree, _context) => __awaiter(this, void 0, void 0, function* () {
|
|
52
53
|
var _a, _b, _c, _d;
|
|
53
54
|
const { buildPaths, testPaths } = yield (0, project_tsconfig_paths_1.getProjectTsConfigPaths)(tree);
|
|
@@ -57,24 +58,29 @@ function DomMigrationRule(migration) {
|
|
|
57
58
|
}
|
|
58
59
|
for (const tsconfigPath of [...buildPaths, ...testPaths]) {
|
|
59
60
|
const { program } = (0, compiler_host_1.createMigrationProgram)(tree, tsconfigPath, basePath);
|
|
60
|
-
const sourceFiles = program.getSourceFiles()
|
|
61
|
+
const sourceFiles = program.getSourceFiles()
|
|
62
|
+
.filter((sourceFile) => (0, compiler_host_1.canMigrateFile)(basePath, sourceFile, program));
|
|
61
63
|
const templateVisitor = new ng_component_template_1.NgComponentTemplateVisitor(program.getTypeChecker(), basePath, tree);
|
|
62
64
|
sourceFiles.forEach((sourceFile) => templateVisitor.visitNode(sourceFile));
|
|
63
65
|
for (const template of templateVisitor.resolvedTemplates) {
|
|
64
66
|
const treeFilePath = (0, path_1.relative)((0, core_1.normalize)(basePath), (0, core_1.normalize)(template.filePath));
|
|
65
67
|
let sourceCode = (_b = (_a = tree.read(treeFilePath)) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : '';
|
|
66
|
-
if (!sourceCode)
|
|
68
|
+
if (!sourceCode) {
|
|
67
69
|
continue;
|
|
68
|
-
|
|
70
|
+
}
|
|
71
|
+
for (const [updateKey, { update, selector }] of Object.entries(updates)) {
|
|
69
72
|
// get update class context
|
|
70
|
-
const context =
|
|
73
|
+
const context = updates[Number(updateKey)];
|
|
71
74
|
// create cheerio dom tree
|
|
72
75
|
const $ = cheerio.load(sourceCode, CHEERIO_OPTIONS, false);
|
|
73
76
|
// get "cheerioElement[]" to mutate in "update" method and add cheerio-identifier to each of em
|
|
74
|
-
const $inputElements = $(selector).each((i, element) => {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
+
const $inputElements = $(selector).each((i, element) => {
|
|
78
|
+
$(element).data('cheerio-id', i);
|
|
79
|
+
});
|
|
80
|
+
// continue to next update if no elements were found
|
|
81
|
+
if ($inputElements.length <= 0) {
|
|
77
82
|
continue;
|
|
83
|
+
}
|
|
78
84
|
// map elements to sourceElements for later comparison
|
|
79
85
|
const sourceElements = Array.from($inputElements)
|
|
80
86
|
.map((element, index) => {
|
|
@@ -83,7 +89,7 @@ function DomMigrationRule(migration) {
|
|
|
83
89
|
id: index,
|
|
84
90
|
element: $(element).toString(),
|
|
85
91
|
start: (_a = element.startIndex) !== null && _a !== void 0 ? _a : null,
|
|
86
|
-
end: element.endIndex ? element.endIndex + 1 : null
|
|
92
|
+
end: element.endIndex ? element.endIndex + 1 : null,
|
|
87
93
|
});
|
|
88
94
|
});
|
|
89
95
|
// send "cheerioElement[]" and cheerio instance to the "update" method
|
|
@@ -96,10 +102,13 @@ function DomMigrationRule(migration) {
|
|
|
96
102
|
sourceElements
|
|
97
103
|
.forEach(source => {
|
|
98
104
|
// get corresponding outputelement by cheerio-id
|
|
99
|
-
const distElement = $outputElements.filter((_i, element) => $(element).data('cheerio-id') === source.id)
|
|
105
|
+
const distElement = $outputElements.filter((_i, element) => $(element).data('cheerio-id') === source.id)
|
|
106
|
+
.first()
|
|
107
|
+
.toString();
|
|
100
108
|
// 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)
|
|
109
|
+
if (source.element === distElement || source.start === null || source.end === null) {
|
|
102
110
|
return;
|
|
111
|
+
}
|
|
103
112
|
// remove old "element" out of tree file
|
|
104
113
|
treeUpdateRecorder.remove(source.start, source.end - source.start);
|
|
105
114
|
// write new "element" into the tree file
|
|
@@ -114,5 +123,5 @@ function DomMigrationRule(migration) {
|
|
|
114
123
|
}
|
|
115
124
|
});
|
|
116
125
|
}
|
|
117
|
-
exports.
|
|
118
|
-
//# sourceMappingURL=migration-rule.js.map
|
|
126
|
+
exports.getDomMigrationRule = getDomMigrationRule;
|
|
127
|
+
//# sourceMappingURL=get-dom-migration-rule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-dom-migration-rule.js","sourceRoot":"","sources":["../../../../schematics/utils/dom-migration/get-dom-migration-rule.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAAiD;AACjD,2DAA+F;AAC/F,gGAAkG;AAClG,kGAAgG;AAChG,2FAAiH;AACjH,4CAA4C;AAC5C,+BAAgC;AAChC,qCAAqC;AACrC,mDAAmD;AAInD,6DAA6D;AAC7D,8EAA8E;AAC9E,MAAM,eAAe,GAA2B;IAC9C,cAAc,EAAE,KAAK;IACrB,aAAa,EAAE,KAAK;IACpB,uBAAuB,EAAE,KAAK;IAC9B,oBAAoB,EAAE,IAAI;IAC1B,gBAAgB,EAAE,IAAI;IACtB,cAAc,EAAE,IAAI;CACrB,CAAC;AAEF,MAAM,gBAAgB,GAAqB;IACzC,MAAM,EAAE,MAAM;IACd,OAAO,EAAE,CAAE,UAAU,CAAE;IACvB,UAAU,EAAE,KAAK;IACjB,QAAQ,EAA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yCAAyC;wBACzC,kBAAkB,CAAC,UAAU,CAC3B,MAAM,CAAC,KAAK,EACZ,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CACzE,CAAC;oBACJ,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;AA1FD,kDA0FC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2023 by Swiss Post, Information Technology
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
__exportStar(require("./dom-update"), exports);
|
|
21
|
+
__exportStar(require("./get-dom-migration-rule"), exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../schematics/utils/dom-migration/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;AAEH,+CAA6B;AAC7B,2DAAyC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@use './
|
|
1
|
+
@use './core' as *;
|
|
2
2
|
@import 'bootstrap/scss/accordion';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@use './
|
|
1
|
+
@use './core' as *;
|
|
2
2
|
@import 'bootstrap/scss/alert';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@use './
|
|
1
|
+
@use './core' as *;
|
|
2
2
|
@import 'bootstrap/scss/badge';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@use './
|
|
1
|
+
@use './core' as *;
|
|
2
2
|
@import 'bootstrap/scss/breadcrumb';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@use './
|
|
1
|
+
@use './core' as *;
|
|
2
2
|
@import 'bootstrap/scss/button-group';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@use './
|
|
1
|
+
@use './core' as *;
|
|
2
2
|
@import 'bootstrap/scss/card';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@use './
|
|
1
|
+
@use './core' as *;
|
|
2
2
|
@import 'bootstrap/scss/carousel';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@use './
|
|
1
|
+
@use './core' as *;
|
|
2
2
|
@import 'bootstrap/scss/close';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@use './
|
|
1
|
+
@use './core' as *;
|
|
2
2
|
@import 'bootstrap/scss/containers';
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
@import 'bootstrap/scss/functions';
|
|
2
|
+
|
|
3
|
+
// Optional variable overrides here
|
|
1
4
|
@import './overrides-variables';
|
|
2
5
|
|
|
3
|
-
@import 'bootstrap/scss/functions';
|
|
4
6
|
@import 'bootstrap/scss/variables';
|
|
7
|
+
|
|
8
|
+
// Optional Sass map overrides here
|
|
9
|
+
|
|
10
|
+
@import 'bootstrap/scss/maps';
|
|
5
11
|
@import 'bootstrap/scss/mixins';
|