@taiga-ui/cdk 3.59.0 → 3.60.0-canary.799e7d6
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/bundles/taiga-ui-cdk-abstract.umd.js +11 -11
- package/bundles/taiga-ui-cdk-abstract.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-coercion.umd.js +1 -1
- package/bundles/taiga-ui-cdk-coercion.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-components-dropdown-host.umd.js +2 -2
- package/bundles/taiga-ui-cdk-components-dropdown-host.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-constants.umd.js +80 -80
- package/bundles/taiga-ui-cdk-constants.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-date-time.umd.js +27 -27
- package/bundles/taiga-ui-cdk-date-time.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-decorators.umd.js +4 -4
- package/bundles/taiga-ui-cdk-decorators.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js +30 -30
- package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-directives-hovered.umd.js +2 -2
- package/bundles/taiga-ui-cdk-directives-hovered.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-exceptions.umd.js +13 -13
- package/bundles/taiga-ui-cdk-exceptions.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-observables.umd.js +9 -9
- package/bundles/taiga-ui-cdk-observables.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-pipes-filter.umd.js +1 -1
- package/bundles/taiga-ui-cdk-pipes-filter.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-pipes-is-present.umd.js +1 -1
- package/bundles/taiga-ui-cdk-pipes-is-present.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-pipes-keys.umd.js +1 -1
- package/bundles/taiga-ui-cdk-pipes-keys.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-pipes-mapper.umd.js +1 -1
- package/bundles/taiga-ui-cdk-pipes-mapper.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-pipes-replace.umd.js +2 -2
- package/bundles/taiga-ui-cdk-pipes-replace.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-services.umd.js +28 -25
- package/bundles/taiga-ui-cdk-services.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-tokens.umd.js +24 -24
- package/bundles/taiga-ui-cdk-tokens.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-browser.umd.js +8 -8
- package/bundles/taiga-ui-cdk-utils-browser.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-color.umd.js +20 -20
- package/bundles/taiga-ui-cdk-utils-color.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-dom.umd.js +11 -11
- package/bundles/taiga-ui-cdk-utils-dom.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-focus.umd.js +19 -19
- package/bundles/taiga-ui-cdk-utils-focus.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-format.umd.js +1 -1
- package/bundles/taiga-ui-cdk-utils-format.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-math.umd.js +7 -7
- package/bundles/taiga-ui-cdk-utils-math.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js +15 -15
- package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-os.umd.js +1 -1
- package/bundles/taiga-ui-cdk-utils-os.umd.js.map +1 -1
- package/bundles/taiga-ui-cdk-utils-svg.umd.js +11 -11
- package/bundles/taiga-ui-cdk-utils-svg.umd.js.map +1 -1
- package/constants/version.d.ts +1 -1
- package/constants/version.js +1 -1
- package/esm2015/abstract/control.js +4 -4
- package/esm2015/abstract/interactive.js +7 -7
- package/esm2015/abstract/portal-host.js +2 -2
- package/esm2015/abstract/theme-switcher.js +2 -2
- package/esm2015/coercion/coerce-boolean-property.js +2 -2
- package/esm2015/components/dropdown-host/dropdown-portal.service.js +3 -3
- package/esm2015/constants/parent-animation.js +4 -4
- package/esm2015/constants/svg-node-filter.js +2 -2
- package/esm2015/constants/unicode-chars.js +13 -13
- package/esm2015/constants/used-icons.js +64 -64
- package/esm2015/constants/version.js +2 -2
- package/esm2015/date-time/date-format.js +2 -2
- package/esm2015/date-time/date-separator.js +2 -2
- package/esm2015/date-time/day-range.js +3 -3
- package/esm2015/date-time/day.js +14 -14
- package/esm2015/date-time/month.js +2 -2
- package/esm2015/date-time/time.js +7 -7
- package/esm2015/date-time/year.js +2 -2
- package/esm2015/decorators/pure.js +5 -5
- package/esm2015/directives/auto-focus/autofocus.options.js +2 -2
- package/esm2015/directives/auto-focus/handlers/abstract.handler.js +2 -2
- package/esm2015/directives/auto-focus/handlers/default.handler.js +2 -2
- package/esm2015/directives/auto-focus/handlers/ios.handler.js +28 -28
- package/esm2015/directives/hovered/hovered.service.js +3 -3
- package/esm2015/exceptions/computed-document.exception.js +2 -2
- package/esm2015/exceptions/document-selection.exception.js +2 -2
- package/esm2015/exceptions/invalid-day.exception.js +2 -2
- package/esm2015/exceptions/invalid-month.exception.js +2 -2
- package/esm2015/exceptions/invalid-year.exception.js +2 -2
- package/esm2015/exceptions/no-host.exception.js +2 -2
- package/esm2015/exceptions/owner-document.exception.js +2 -2
- package/esm2015/exceptions/pure.exception.js +2 -2
- package/esm2015/exceptions/table-sort-key.exception.js +2 -2
- package/esm2015/exceptions/ts-parser.exception.js +2 -2
- package/esm2015/exceptions/value-changes.exception.js +2 -2
- package/esm2015/exceptions/value-present.exception.js +2 -2
- package/esm2015/exceptions/xml-parsing.exception.js +2 -2
- package/esm2015/observables/drag-and-drop-from.js +2 -2
- package/esm2015/observables/focus-visible-observable.js +5 -5
- package/esm2015/observables/is-observed.js +2 -2
- package/esm2015/observables/mouse-drag-finish-from.js +2 -2
- package/esm2015/observables/pressed-observable.js +2 -2
- package/esm2015/observables/scroll-from.js +2 -2
- package/esm2015/pipes/filter/filter.pipe.js +2 -2
- package/esm2015/pipes/is-present/is-present.pipe.js +2 -2
- package/esm2015/pipes/keys/keys.pipe.js +2 -2
- package/esm2015/pipes/mapper/mapper.pipe.js +2 -2
- package/esm2015/pipes/replace/replace.pipe.js +3 -3
- package/esm2015/services/directive-styles.service.js +6 -3
- package/esm2015/services/id.service.js +4 -4
- package/esm2015/services/obscured.service.js +2 -2
- package/esm2015/services/pan.service.js +5 -5
- package/esm2015/services/parents-scroll.service.js +2 -2
- package/esm2015/services/scroll.service.js +8 -8
- package/esm2015/services/static-request.service.js +4 -4
- package/esm2015/services/swipe.service.js +2 -2
- package/esm2015/services/zoom.service.js +3 -3
- package/esm2015/tokens/active-element.js +9 -9
- package/esm2015/tokens/base-href.js +2 -2
- package/esm2015/tokens/ensure-base-href.js +4 -4
- package/esm2015/tokens/focusable-item-accessor.js +2 -2
- package/esm2015/tokens/fonts-ready.js +2 -2
- package/esm2015/tokens/is-firefox.js +2 -2
- package/esm2015/tokens/is-stackblitz.js +2 -2
- package/esm2015/tokens/platform.js +5 -5
- package/esm2015/tokens/touch-supported.js +2 -2
- package/esm2015/tokens/window-size.js +3 -3
- package/esm2015/utils/browser/is-edge-older-than.js +2 -2
- package/esm2015/utils/browser/is-edge.js +2 -2
- package/esm2015/utils/browser/is-firefox.js +2 -2
- package/esm2015/utils/browser/is-safari.js +6 -6
- package/esm2015/utils/color/hex-to-rgb.js +4 -4
- package/esm2015/utils/color/hex-to-rgba.js +5 -5
- package/esm2015/utils/color/parse-color.js +7 -7
- package/esm2015/utils/color/rgb-to-hex.js +2 -2
- package/esm2015/utils/color/rgba-to-hex.js +7 -7
- package/esm2015/utils/dom/element-checks.js +4 -4
- package/esm2015/utils/dom/get-clipboard-data-text.js +4 -4
- package/esm2015/utils/dom/get-document-or-shadow-root.js +2 -2
- package/esm2015/utils/dom/get-element-offset.js +2 -2
- package/esm2015/utils/dom/retarget-boundary-crossing.js +4 -4
- package/esm2015/utils/focus/is-native-keyboard-focusable.js +14 -14
- package/esm2015/utils/focus/is-native-mouse-focusable.js +3 -3
- package/esm2015/utils/focus/set-native-mouse-focused.js +5 -5
- package/esm2015/utils/format/px.js +2 -2
- package/esm2015/utils/math/round-with.js +4 -4
- package/esm2015/utils/math/round.js +5 -5
- package/esm2015/utils/miscellaneous/clean-object.js +2 -2
- package/esm2015/utils/miscellaneous/create-token.js +2 -2
- package/esm2015/utils/miscellaneous/ease-in-out-quad.js +2 -2
- package/esm2015/utils/miscellaneous/get-swipe-direction.js +3 -3
- package/esm2015/utils/miscellaneous/is-number.js +2 -2
- package/esm2015/utils/miscellaneous/is-object.js +2 -2
- package/esm2015/utils/miscellaneous/is-string.js +2 -2
- package/esm2015/utils/miscellaneous/is-valid-url.js +8 -8
- package/esm2015/utils/os/is-apple-platform.js +2 -2
- package/esm2015/utils/svg/svg-linear-gradient-processor.js +12 -12
- package/fesm2015/taiga-ui-cdk-abstract.js +11 -11
- package/fesm2015/taiga-ui-cdk-abstract.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-coercion.js +1 -1
- package/fesm2015/taiga-ui-cdk-coercion.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-components-dropdown-host.js +2 -2
- package/fesm2015/taiga-ui-cdk-components-dropdown-host.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-constants.js +80 -80
- package/fesm2015/taiga-ui-cdk-constants.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-date-time.js +25 -25
- package/fesm2015/taiga-ui-cdk-date-time.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-decorators.js +4 -4
- package/fesm2015/taiga-ui-cdk-decorators.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-directives-auto-focus.js +30 -30
- package/fesm2015/taiga-ui-cdk-directives-auto-focus.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-directives-hovered.js +2 -2
- package/fesm2015/taiga-ui-cdk-directives-hovered.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-exceptions.js +13 -13
- package/fesm2015/taiga-ui-cdk-exceptions.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-observables.js +9 -9
- package/fesm2015/taiga-ui-cdk-observables.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-pipes-filter.js +1 -1
- package/fesm2015/taiga-ui-cdk-pipes-filter.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-pipes-is-present.js +1 -1
- package/fesm2015/taiga-ui-cdk-pipes-is-present.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-pipes-keys.js +1 -1
- package/fesm2015/taiga-ui-cdk-pipes-keys.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-pipes-mapper.js +1 -1
- package/fesm2015/taiga-ui-cdk-pipes-mapper.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-pipes-replace.js +2 -2
- package/fesm2015/taiga-ui-cdk-pipes-replace.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-services.js +27 -24
- package/fesm2015/taiga-ui-cdk-services.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-tokens.js +23 -23
- package/fesm2015/taiga-ui-cdk-tokens.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-browser.js +8 -8
- package/fesm2015/taiga-ui-cdk-utils-browser.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-color.js +20 -20
- package/fesm2015/taiga-ui-cdk-utils-color.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-dom.js +11 -11
- package/fesm2015/taiga-ui-cdk-utils-dom.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-focus.js +19 -19
- package/fesm2015/taiga-ui-cdk-utils-focus.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-format.js +1 -1
- package/fesm2015/taiga-ui-cdk-utils-format.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-math.js +7 -7
- package/fesm2015/taiga-ui-cdk-utils-math.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js +15 -15
- package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-os.js +1 -1
- package/fesm2015/taiga-ui-cdk-utils-os.js.map +1 -1
- package/fesm2015/taiga-ui-cdk-utils-svg.js +11 -11
- package/fesm2015/taiga-ui-cdk-utils-svg.js.map +1 -1
- package/package.json +69 -69
- package/schematics/constants/file-globs.js +24 -24
- package/schematics/constants/taiga-styles.js +4 -4
- package/schematics/ng-add/constants/modules.js +12 -12
- package/schematics/ng-add/constants/packages.js +1 -1
- package/schematics/ng-add/constants/versions.js +3 -3
- package/schematics/ng-add/index.js +10 -10
- package/schematics/ng-add/steps/add-taiga-icons.js +4 -4
- package/schematics/ng-add/steps/add-taiga-modules.js +14 -14
- package/schematics/ng-add/steps/wrap-with-tui-root.js +12 -12
- package/schematics/ng-update/steps/icons/replace-imports.js +2 -2
- package/schematics/ng-update/steps/remove-module.js +2 -2
- package/schematics/ng-update/steps/rename-types.js +5 -5
- package/schematics/ng-update/steps/replace-deep-import.js +4 -4
- package/schematics/ng-update/steps/replace-enums.js +2 -2
- package/schematics/ng-update/steps/replace-identifier.js +2 -2
- package/schematics/ng-update/steps/replace-services.js +4 -4
- package/schematics/ng-update/steps/show-warnings.js +1 -1
- package/schematics/ng-update/utils/replace-text.js +1 -1
- package/schematics/ng-update/utils/templates/replace-tag.js +1 -1
- package/schematics/ng-update/v3/constants/breakpoints.js +27 -27
- package/schematics/ng-update/v3/constants/constants.js +187 -187
- package/schematics/ng-update/v3/constants/deprecated-functions.js +405 -405
- package/schematics/ng-update/v3/constants/enums.js +153 -153
- package/schematics/ng-update/v3/constants/modules.js +4 -4
- package/schematics/ng-update/v3/constants/services.js +16 -16
- package/schematics/ng-update/v3/constants/templates.js +295 -295
- package/schematics/ng-update/v3/constants/tui-interactive-selectors.js +50 -50
- package/schematics/ng-update/v3/constants/types.js +88 -88
- package/schematics/ng-update/v3/constants/warnings.js +62 -62
- package/schematics/ng-update/v3/index.js +7 -7
- package/schematics/ng-update/v3/steps/migrate-date-time.js +42 -42
- package/schematics/ng-update/v3/steps/migrate-polymorpheus.js +14 -14
- package/schematics/ng-update/v3/steps/migrate-progress.js +6 -6
- package/schematics/ng-update/v3/steps/migrate-sliders/index.js +4 -4
- package/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-range.js +27 -27
- package/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-slider.js +26 -26
- package/schematics/ng-update/v3/steps/migrate-taiga-proprietary-icons.js +7 -7
- package/schematics/ng-update/v3/steps/migrate-templates.js +18 -18
- package/schematics/ng-update/v3/steps/migrate-textfield-controller.js +33 -33
- package/schematics/ng-update/v3/steps/miscellaneous.js +16 -16
- package/schematics/ng-update/v3/steps/replace-functions.js +17 -17
- package/schematics/ng-update/v3/steps/replace-styles.js +12 -12
- package/schematics/ng-update/v3-30/constants/constants.js +2 -2
- package/schematics/ng-update/v3-30/constants/icons.js +494 -494
- package/schematics/ng-update/v3-30/index.js +4 -4
- package/schematics/ng-update/v3-35/constants/constants.js +2 -2
- package/schematics/ng-update/v3-35/constants/icons.js +1266 -1266
- package/schematics/ng-update/v3-35/index.js +5 -5
- package/schematics/ng-update/v3-36/index.js +6 -6
- package/schematics/ng-update/v3-40/index.js +11 -11
- package/schematics/ng-update/v3-5/index.js +1 -1
- package/schematics/ng-update/v3-5/steps/migrate-expand-templates.js +7 -7
- package/schematics/ng-update/v4/index.js +2 -2
- package/schematics/ng-update/v4/steps/constants/attr-to-directive-replace.js +19 -19
- package/schematics/ng-update/v4/steps/constants/attrs-to-replace.js +21 -21
- package/schematics/ng-update/v4/steps/constants/html-comments.js +9 -9
- package/schematics/ng-update/v4/steps/constants/identifiers-to-replace.js +21 -21
- package/schematics/ng-update/v4/steps/constants/inputs-to-remove.js +4 -4
- package/schematics/ng-update/v4/steps/constants/tags-to-replace.js +2 -2
- package/schematics/ng-update/v4/steps/migrate-templates.js +3 -3
- package/schematics/ng-update/v4/steps/restore-tui-mapper.js +6 -6
- package/schematics/ng-update/v4/steps/restore-tui-matcher.js +6 -6
- package/schematics/ng-update/v4/steps/templates/migrate-avatar.js +14 -14
- package/schematics/ng-update/v4/steps/templates/migrate-badge.js +3 -3
- package/schematics/ng-update/v4/steps/templates/toggles/common.js +5 -5
- package/schematics/ng-update/v4/steps/templates/toggles/migrate-checkbox.js +4 -4
- package/schematics/ng-update/v4/steps/templates/toggles/migrate-radio.js +4 -4
- package/schematics/ng-update/v4/steps/templates/toggles/migrate-toggle.js +4 -4
- package/schematics/utils/add-import-to-component.js +1 -1
- package/schematics/utils/angular/is-standalone-component.js +3 -3
- package/schematics/utils/angular/ng-component.js +1 -1
- package/schematics/utils/angular/ng-module.js +1 -1
- package/schematics/utils/angular-json-manipulations.js +5 -5
- package/schematics/utils/colored-log.js +11 -11
- package/schematics/utils/create-angular-json.js +3 -3
- package/schematics/utils/get-component-from-identifier.js +1 -1
- package/schematics/utils/get-named-import-references.js +1 -1
- package/schematics/utils/get-projects.js +2 -2
- package/schematics/utils/get-standalone-bootstrap-function.js +1 -1
- package/schematics/utils/insert-todo.js +1 -1
- package/schematics/utils/is-ci.js +1 -1
- package/schematics/utils/progress.js +2 -2
- package/schematics/utils/project-root.js +1 -1
- package/schematics/utils/push-to-array-property.js +1 -1
- package/schematics/utils/templates/elements.js +1 -1
- package/schematics/utils/templates/get-component-templates.js +5 -5
- package/schematics/utils/templates/ng-component-input-manipulations.js +5 -5
- package/schematics/utils/templates/template-resource.js +3 -3
- package/services/directive-styles.service.d.ts +3 -2
- package/utils/miscellaneous/is-string.js +1 -1
@@ -2,20 +2,20 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.closeStartTag = exports.removeClosingTag = exports.replaceSizeAttr = exports.replaceOpenTag = void 0;
|
4
4
|
const sizeMap = {
|
5
|
-
l:
|
6
|
-
m:
|
5
|
+
l: 'm',
|
6
|
+
m: 's',
|
7
7
|
};
|
8
8
|
function replaceOpenTag(sourceCodeLocation, recorder, templateOffset, { tag, directive, type }) {
|
9
9
|
const { startTag } = sourceCodeLocation;
|
10
10
|
const { startOffset, startCol } = startTag;
|
11
|
-
const spaces =
|
11
|
+
const spaces = ' '.repeat(startCol + 3);
|
12
12
|
recorder.remove(templateOffset + startOffset, `<${tag}`.length);
|
13
13
|
recorder.insertRight(templateOffset + startOffset, `<input\n${spaces}${directive}\n${spaces}type="${type}"`);
|
14
14
|
}
|
15
15
|
exports.replaceOpenTag = replaceOpenTag;
|
16
16
|
function replaceSizeAttr(attrs, sourceCodeLocation, recorder, templateOffset) {
|
17
17
|
var _a;
|
18
|
-
const sizeAttr = attrs.find(attr => attr.name ===
|
18
|
+
const sizeAttr = attrs.find(attr => attr.name === 'size');
|
19
19
|
if (sizeAttr) {
|
20
20
|
const { startOffset, endOffset } = ((_a = sourceCodeLocation.attrs) === null || _a === void 0 ? void 0 : _a[sizeAttr.name]) || {
|
21
21
|
startOffset: 0,
|
@@ -35,6 +35,6 @@ function removeClosingTag(sourceCodeLocation, recorder, templateOffset) {
|
|
35
35
|
}
|
36
36
|
exports.removeClosingTag = removeClosingTag;
|
37
37
|
function closeStartTag({ startTag }, recorder, templateOffset) {
|
38
|
-
recorder.insertRight(templateOffset + startTag.endOffset - 1,
|
38
|
+
recorder.insertRight(templateOffset + startTag.endOffset - 1, '/');
|
39
39
|
}
|
40
40
|
exports.closeStartTag = closeStartTag;
|
@@ -7,16 +7,16 @@ const common_1 = require("./common");
|
|
7
7
|
function migrateCheckbox({ resource, recorder, fileSystem, }) {
|
8
8
|
const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
|
9
9
|
const templateOffset = template_resource_1.getTemplateOffset(resource);
|
10
|
-
const elements = elements_1.findElementsByTagName(template,
|
10
|
+
const elements = elements_1.findElementsByTagName(template, 'tui-checkbox');
|
11
11
|
elements.forEach(({ attrs, sourceCodeLocation }) => {
|
12
12
|
if (!sourceCodeLocation) {
|
13
13
|
return;
|
14
14
|
}
|
15
15
|
common_1.replaceSizeAttr(attrs, sourceCodeLocation, recorder, templateOffset);
|
16
16
|
common_1.replaceOpenTag(sourceCodeLocation, recorder, templateOffset, {
|
17
|
-
tag:
|
18
|
-
directive:
|
19
|
-
type:
|
17
|
+
tag: 'tui-checkbox',
|
18
|
+
directive: 'tuiCheckbox',
|
19
|
+
type: 'checkbox',
|
20
20
|
});
|
21
21
|
common_1.closeStartTag(sourceCodeLocation, recorder, templateOffset);
|
22
22
|
common_1.removeClosingTag(sourceCodeLocation, recorder, templateOffset);
|
@@ -7,16 +7,16 @@ const common_1 = require("./common");
|
|
7
7
|
function migrateRadio({ resource, recorder, fileSystem, }) {
|
8
8
|
const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
|
9
9
|
const templateOffset = template_resource_1.getTemplateOffset(resource);
|
10
|
-
const elements = elements_1.findElementsByTagName(template,
|
10
|
+
const elements = elements_1.findElementsByTagName(template, 'tui-radio');
|
11
11
|
elements.forEach(({ attrs, sourceCodeLocation }) => {
|
12
12
|
if (!sourceCodeLocation) {
|
13
13
|
return;
|
14
14
|
}
|
15
15
|
common_1.replaceSizeAttr(attrs, sourceCodeLocation, recorder, templateOffset);
|
16
16
|
common_1.replaceOpenTag(sourceCodeLocation, recorder, templateOffset, {
|
17
|
-
tag:
|
18
|
-
directive:
|
19
|
-
type:
|
17
|
+
tag: 'tui-radio',
|
18
|
+
directive: 'tuiRadio',
|
19
|
+
type: 'radio',
|
20
20
|
});
|
21
21
|
common_1.closeStartTag(sourceCodeLocation, recorder, templateOffset);
|
22
22
|
common_1.removeClosingTag(sourceCodeLocation, recorder, templateOffset);
|
@@ -7,16 +7,16 @@ const common_1 = require("./common");
|
|
7
7
|
function migrateToggle({ resource, recorder, fileSystem, }) {
|
8
8
|
const template = template_resource_1.getTemplateFromTemplateResource(resource, fileSystem);
|
9
9
|
const templateOffset = template_resource_1.getTemplateOffset(resource);
|
10
|
-
const elements = elements_1.findElementsByTagName(template,
|
10
|
+
const elements = elements_1.findElementsByTagName(template, 'tui-toggle');
|
11
11
|
elements.forEach(({ attrs, sourceCodeLocation }) => {
|
12
12
|
if (!sourceCodeLocation) {
|
13
13
|
return;
|
14
14
|
}
|
15
15
|
common_1.replaceSizeAttr(attrs, sourceCodeLocation, recorder, templateOffset);
|
16
16
|
common_1.replaceOpenTag(sourceCodeLocation, recorder, templateOffset, {
|
17
|
-
tag:
|
18
|
-
directive:
|
19
|
-
type:
|
17
|
+
tag: 'tui-toggle',
|
18
|
+
directive: 'tuiToggle',
|
19
|
+
type: 'checkbox',
|
20
20
|
});
|
21
21
|
common_1.closeStartTag(sourceCodeLocation, recorder, templateOffset);
|
22
22
|
common_1.removeClosingTag(sourceCodeLocation, recorder, templateOffset);
|
@@ -4,7 +4,7 @@ exports.addImportToComponent = void 0;
|
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
5
|
// TODO: delete after adding to ng-morph
|
6
6
|
function addImportToComponent(classDeclaration, moduleName, { unique = true } = {}) {
|
7
|
-
ng_morph_1.pushToDecoratorArrayProperty(classDeclaration,
|
7
|
+
ng_morph_1.pushToDecoratorArrayProperty(classDeclaration, 'Component', 'imports', moduleName, {
|
8
8
|
unique,
|
9
9
|
forceToArray: true,
|
10
10
|
});
|
@@ -5,7 +5,7 @@ const ng_morph_1 = require("ng-morph");
|
|
5
5
|
// TODO: add to ng-morph
|
6
6
|
function isStandaloneComponent(component) {
|
7
7
|
var _a;
|
8
|
-
const decorator = component.getDecorator(
|
8
|
+
const decorator = component.getDecorator('Component');
|
9
9
|
if (!decorator) {
|
10
10
|
return false;
|
11
11
|
}
|
@@ -13,10 +13,10 @@ function isStandaloneComponent(component) {
|
|
13
13
|
if (!ng_morph_1.Node.isObjectLiteralExpression(metadata)) {
|
14
14
|
return false;
|
15
15
|
}
|
16
|
-
const property = metadata.getProperty(
|
16
|
+
const property = metadata.getProperty('standalone');
|
17
17
|
if (!ng_morph_1.Node.isPropertyAssignment(property)) {
|
18
18
|
return false;
|
19
19
|
}
|
20
|
-
return ((_a = property.getInitializer()) === null || _a === void 0 ? void 0 : _a.getText()) ===
|
20
|
+
return ((_a = property.getInitializer()) === null || _a === void 0 ? void 0 : _a.getText()) === 'true';
|
21
21
|
}
|
22
22
|
exports.isStandaloneComponent = isStandaloneComponent;
|
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getNgComponents = void 0;
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
5
|
function getNgComponents(pattern, query) {
|
6
|
-
return ng_morph_1.getClasses(pattern, query).filter(declaration => !!declaration.getDecorator(
|
6
|
+
return ng_morph_1.getClasses(pattern, query).filter(declaration => !!declaration.getDecorator('Component'));
|
7
7
|
}
|
8
8
|
exports.getNgComponents = getNgComponents;
|
@@ -4,7 +4,7 @@ exports.findNgModule = exports.getNgModules = void 0;
|
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
5
|
const constants_1 = require("../../constants");
|
6
6
|
function getNgModules(pattern, query) {
|
7
|
-
return ng_morph_1.getClasses(pattern, query).filter(declaration => !!declaration.getDecorator(
|
7
|
+
return ng_morph_1.getClasses(pattern, query).filter(declaration => !!declaration.getDecorator('NgModule'));
|
8
8
|
}
|
9
9
|
exports.getNgModules = getNgModules;
|
10
10
|
/**
|
@@ -13,8 +13,8 @@ function hasTaigaIcons(assets) {
|
|
13
13
|
return !!(assets === null || assets === void 0 ? void 0 : assets.find(asset => {
|
14
14
|
var _a;
|
15
15
|
return is_string_1.tuiIsString(asset)
|
16
|
-
? asset.includes(
|
17
|
-
: (_a = asset === null || asset === void 0 ? void 0 : asset.input) === null || _a === void 0 ? void 0 : _a.includes(
|
16
|
+
? asset.includes('taiga-ui')
|
17
|
+
: (_a = asset === null || asset === void 0 ? void 0 : asset.input) === null || _a === void 0 ? void 0 : _a.includes('taiga-ui');
|
18
18
|
}));
|
19
19
|
}
|
20
20
|
function isInvalidAngularJson(tree) {
|
@@ -32,7 +32,7 @@ function isInvalidAngularJson(tree) {
|
|
32
32
|
}
|
33
33
|
exports.isInvalidAngularJson = isInvalidAngularJson;
|
34
34
|
function addStylesToAngularJson(options, context, taigaStyles, filter, stylesToReplace, tree) {
|
35
|
-
const MANUAL_MIGRATION_TIPS = `Add styles ${taigaStyles.join(
|
35
|
+
const MANUAL_MIGRATION_TIPS = `Add styles ${taigaStyles.join(',')} to angular.json manually.`;
|
36
36
|
return workspace_1.updateWorkspace(workspace => {
|
37
37
|
const projects = get_projects_1.getProjects(options, workspace);
|
38
38
|
if (!projects.length) {
|
@@ -42,7 +42,7 @@ function addStylesToAngularJson(options, context, taigaStyles, filter, stylesToR
|
|
42
42
|
for (const project of projects) {
|
43
43
|
let targetOptions;
|
44
44
|
try {
|
45
|
-
targetOptions = get_project_target_options_1.getProjectTargetOptions(project,
|
45
|
+
targetOptions = get_project_target_options_1.getProjectTargetOptions(project, 'build');
|
46
46
|
}
|
47
47
|
catch (_a) {
|
48
48
|
context.logger.warn(`[WARNING]: No buildable project was found. ${MANUAL_MIGRATION_TIPS}`);
|
@@ -71,7 +71,7 @@ function addStylesToAngularJson(options, context, taigaStyles, filter, stylesToR
|
|
71
71
|
}
|
72
72
|
if (tree && stylesToReplace) {
|
73
73
|
ng_morph_1.addPackageJsonDependency(tree, {
|
74
|
-
name:
|
74
|
+
name: '@taiga-ui/styles',
|
75
75
|
version: versions_1.TAIGA_VERSION,
|
76
76
|
});
|
77
77
|
context.addTask(new tasks_1.NodePackageInstallTask());
|
@@ -2,28 +2,28 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.SUCCESS_SYMBOL = exports.PROCESSING_SYMBOL = exports.REPLACE_SYMBOL = exports.FINISH_SYMBOL = exports.START_SYMBOL = exports.SMALL_TAB_SYMBOL = exports.titleLog = exports.infoLog = exports.successLog = exports.errorLog = exports.processLog = void 0;
|
4
4
|
function processLog(message) {
|
5
|
-
console.info(
|
5
|
+
console.info('\x1B[36m%s\x1B[0m', message);
|
6
6
|
}
|
7
7
|
exports.processLog = processLog;
|
8
8
|
function errorLog(message) {
|
9
|
-
console.info(
|
9
|
+
console.info('\x1B[31m%s\x1B[0m', message);
|
10
10
|
}
|
11
11
|
exports.errorLog = errorLog;
|
12
12
|
function successLog(message) {
|
13
|
-
console.info(
|
13
|
+
console.info('\x1B[32m%s\x1B[0m', message);
|
14
14
|
}
|
15
15
|
exports.successLog = successLog;
|
16
16
|
function infoLog(message) {
|
17
|
-
console.info(
|
17
|
+
console.info('\x1B[34m%s\x1B[0m', message);
|
18
18
|
}
|
19
19
|
exports.infoLog = infoLog;
|
20
20
|
function titleLog(message) {
|
21
|
-
console.info(
|
21
|
+
console.info('\x1B[35m', message);
|
22
22
|
}
|
23
23
|
exports.titleLog = titleLog;
|
24
|
-
exports.SMALL_TAB_SYMBOL =
|
25
|
-
exports.START_SYMBOL =
|
26
|
-
exports.FINISH_SYMBOL =
|
27
|
-
exports.REPLACE_SYMBOL =
|
28
|
-
exports.PROCESSING_SYMBOL =
|
29
|
-
exports.SUCCESS_SYMBOL =
|
24
|
+
exports.SMALL_TAB_SYMBOL = ' '; // @note: if you use \t then we have big gaps
|
25
|
+
exports.START_SYMBOL = '🚀';
|
26
|
+
exports.FINISH_SYMBOL = '🏆';
|
27
|
+
exports.REPLACE_SYMBOL = '⚡️';
|
28
|
+
exports.PROCESSING_SYMBOL = '> ';
|
29
|
+
exports.SUCCESS_SYMBOL = '✅ ';
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createAngularJsonWithAssets = exports.createAngularJson = void 0;
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
5
|
function createAngularJson({ stylesExist } = { stylesExist: false }) {
|
6
|
-
ng_morph_1.createSourceFile(
|
6
|
+
ng_morph_1.createSourceFile('angular.json', `
|
7
7
|
{
|
8
8
|
"version": 1,
|
9
9
|
"defaultProject": "demo",
|
@@ -19,7 +19,7 @@ function createAngularJson({ stylesExist } = { stylesExist: false }) {
|
|
19
19
|
"some.style"
|
20
20
|
]
|
21
21
|
`
|
22
|
-
:
|
22
|
+
: ''}}
|
23
23
|
}
|
24
24
|
}
|
25
25
|
}
|
@@ -28,7 +28,7 @@ function createAngularJson({ stylesExist } = { stylesExist: false }) {
|
|
28
28
|
}
|
29
29
|
exports.createAngularJson = createAngularJson;
|
30
30
|
function createAngularJsonWithAssets() {
|
31
|
-
ng_morph_1.createSourceFile(
|
31
|
+
ng_morph_1.createSourceFile('angular.json', `
|
32
32
|
{
|
33
33
|
"version": 1,
|
34
34
|
"defaultProject": "demo",
|
@@ -8,7 +8,7 @@ function getComponentFromIdentifier(identifier) {
|
|
8
8
|
const rootImportDeclaration = ng_morph_1.getImports(identifier.getSourceFile().getFilePath(), {
|
9
9
|
namedImports: [identifier.getText()],
|
10
10
|
})[0];
|
11
|
-
const rootComponentPath = ((_a = rootImportDeclaration.getModuleSpecifierSourceFile()) === null || _a === void 0 ? void 0 : _a.getFilePath()) ||
|
11
|
+
const rootComponentPath = ((_a = rootImportDeclaration.getModuleSpecifierSourceFile()) === null || _a === void 0 ? void 0 : _a.getFilePath()) || '';
|
12
12
|
return ng_component_1.getNgComponents(rootComponentPath, {
|
13
13
|
name: identifier.getText(),
|
14
14
|
})[0];
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getNamedImportReferences = void 0;
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
5
|
const constants_1 = require("../constants");
|
6
|
-
function getNamedImportReferences(namedImport, moduleSpecifier =
|
6
|
+
function getNamedImportReferences(namedImport, moduleSpecifier = '**/**', files = constants_1.ALL_TS_FILES) {
|
7
7
|
const importDeclarations = ng_morph_1.getImports(files, {
|
8
8
|
namedImports: [namedImport],
|
9
9
|
moduleSpecifier,
|
@@ -4,9 +4,9 @@ exports.getProjects = void 0;
|
|
4
4
|
function getProjects(options, workspace) {
|
5
5
|
var _a;
|
6
6
|
const projects = Array.from(workspace.projects.entries())
|
7
|
-
.filter(([_, project]) => project.targets.get(
|
7
|
+
.filter(([_, project]) => project.targets.get('build'))
|
8
8
|
.map(([_, project]) => project);
|
9
|
-
const nameFromContext = options.project || ((_a = workspace.extensions.defaultProject) === null || _a === void 0 ? void 0 : _a.toString()) ||
|
9
|
+
const nameFromContext = options.project || ((_a = workspace.extensions.defaultProject) === null || _a === void 0 ? void 0 : _a.toString()) || '';
|
10
10
|
const projectFromContext = workspace.projects.get(nameFromContext);
|
11
11
|
return projectFromContext ? [projectFromContext] : projects;
|
12
12
|
}
|
@@ -4,7 +4,7 @@ exports.getStandaloneBootstrapFunction = void 0;
|
|
4
4
|
const ng_morph_1 = require("ng-morph");
|
5
5
|
const get_named_import_references_1 = require("./get-named-import-references");
|
6
6
|
function getStandaloneBootstrapFunction(path) {
|
7
|
-
const standaloneBootstrapIdentifier = get_named_import_references_1.getNamedImportReferences(
|
7
|
+
const standaloneBootstrapIdentifier = get_named_import_references_1.getNamedImportReferences('bootstrapApplication', '@angular/platform-browser', path)
|
8
8
|
.map(ref => ref.getParent())
|
9
9
|
.filter(node => ng_morph_1.Node.isCallExpression(node))[0];
|
10
10
|
const standaloneBootstrapFunction = standaloneBootstrapIdentifier;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.insertTodo = exports.TODO_MARK = void 0;
|
4
|
-
exports.TODO_MARK =
|
4
|
+
exports.TODO_MARK = 'TODO: (Taiga UI migration)';
|
5
5
|
function insertTodo(identifier, message) {
|
6
6
|
const startLinePos = identifier.getStartLinePos();
|
7
7
|
const sourceFile = identifier.getSourceFile();
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4
4
|
exports.tuiIsCI = void 0;
|
5
5
|
function tuiIsCI() {
|
6
|
-
return (process.env.TUI_CI ===
|
6
|
+
return (process.env.TUI_CI === 'true' ||
|
7
7
|
!!process.env.CI || // Another CI
|
8
8
|
!!process.env.GITHUB_ACTION || // Github CI
|
9
9
|
!!process.env.GITLAB_CI || // Gitlab CI
|
@@ -5,7 +5,7 @@ exports.setupProgressLogger = void 0;
|
|
5
5
|
const readline_1 = require("readline");
|
6
6
|
const colored_log_1 = require("./colored-log");
|
7
7
|
const is_ci_1 = require("./is-ci");
|
8
|
-
function setupProgressLogger({ total, prefix =
|
8
|
+
function setupProgressLogger({ total, prefix = '', tabs = 2, }) {
|
9
9
|
let i = 1;
|
10
10
|
return (message, incrementIndex = true) => {
|
11
11
|
if (is_ci_1.tuiIsCI()) {
|
@@ -18,7 +18,7 @@ function setupProgressLogger({ total, prefix = ``, tabs = 2, }) {
|
|
18
18
|
readline_1.cursorTo(process.stdout, 0);
|
19
19
|
process.stdout.write(colored_log_1.SMALL_TAB_SYMBOL.repeat(tabs) + progressLog);
|
20
20
|
if (isLast && incrementIndex) {
|
21
|
-
process.stdout.write(
|
21
|
+
process.stdout.write('\n');
|
22
22
|
}
|
23
23
|
};
|
24
24
|
}
|
@@ -21,7 +21,7 @@ function pushToObjectArrayProperty(objectExpression, propertyName, initializer,
|
|
21
21
|
.some(element => element.getText() === initializer)) {
|
22
22
|
return;
|
23
23
|
}
|
24
|
-
if (typeof index ===
|
24
|
+
if (typeof index === 'number') {
|
25
25
|
importsInitializer.insertElement(index, initializer);
|
26
26
|
}
|
27
27
|
else {
|
@@ -65,7 +65,7 @@ function findAttributeOnElementWithTag(html, name, tagNames,
|
|
65
65
|
// eslint-disable-next-line no-restricted-syntax
|
66
66
|
filterFn = () => true) {
|
67
67
|
return findElementsWithAttribute(html, name)
|
68
|
-
.filter(element => (tagNames.includes(element.tagName) || tagNames.includes(
|
68
|
+
.filter(element => (tagNames.includes(element.tagName) || tagNames.includes('*')) &&
|
69
69
|
filterFn(element))
|
70
70
|
.map(element => getStartOffsetOfAttribute(element, name));
|
71
71
|
}
|
@@ -7,11 +7,11 @@ const path = tslib_1.__importStar(require("path"));
|
|
7
7
|
function decoratorToTemplateResource(decorator) {
|
8
8
|
var _a, _b, _c;
|
9
9
|
const [metadata] = decorator.getArguments();
|
10
|
-
const templateUrl = metadata.getProperty(
|
11
|
-
const template = metadata.getProperty(
|
10
|
+
const templateUrl = metadata.getProperty('templateUrl');
|
11
|
+
const template = metadata.getProperty('template');
|
12
12
|
const componentPath = decorator.getSourceFile().getFilePath();
|
13
13
|
if (templateUrl) {
|
14
|
-
const templatePath = path.parse(((_a = templateUrl === null || templateUrl === void 0 ? void 0 : templateUrl.getInitializer()) === null || _a === void 0 ? void 0 : _a.getText().replace(/['"`]/g,
|
14
|
+
const templatePath = path.parse(((_a = templateUrl === null || templateUrl === void 0 ? void 0 : templateUrl.getInitializer()) === null || _a === void 0 ? void 0 : _a.getText().replace(/['"`]/g, '')) || '');
|
15
15
|
return {
|
16
16
|
componentPath,
|
17
17
|
templatePath: getFullTemplatePath(templatePath, path.parse(componentPath)),
|
@@ -20,7 +20,7 @@ function decoratorToTemplateResource(decorator) {
|
|
20
20
|
if (template) {
|
21
21
|
return {
|
22
22
|
componentPath,
|
23
|
-
template: ((_b = template.getInitializer()) === null || _b === void 0 ? void 0 : _b.getText()) ||
|
23
|
+
template: ((_b = template.getInitializer()) === null || _b === void 0 ? void 0 : _b.getText()) || '',
|
24
24
|
offset: ((_c = template.getInitializer()) === null || _c === void 0 ? void 0 : _c.getStart()) || 0,
|
25
25
|
};
|
26
26
|
}
|
@@ -31,7 +31,7 @@ function getFullTemplatePath(templatePath, componentPath) {
|
|
31
31
|
}
|
32
32
|
function getComponentTemplates(pattern, query) {
|
33
33
|
return ng_morph_1.getClasses(pattern, query)
|
34
|
-
.map(declaration => declaration.getDecorator(
|
34
|
+
.map(declaration => declaration.getDecorator('Component'))
|
35
35
|
.filter((decorator) => !!decorator)
|
36
36
|
.map(decoratorToTemplateResource)
|
37
37
|
.filter((x) => Boolean(x));
|
@@ -29,7 +29,7 @@ const template_resource_1 = require("./template-resource");
|
|
29
29
|
* ___
|
30
30
|
* @return true if something was changed
|
31
31
|
*/
|
32
|
-
function replaceInputProperty({ templateResource, fileSystem, componentSelector, from, to, newValue =
|
32
|
+
function replaceInputProperty({ templateResource, fileSystem, componentSelector, from, to, newValue = '', filterFn, }) {
|
33
33
|
const template = template_resource_1.getTemplateFromTemplateResource(templateResource, fileSystem);
|
34
34
|
const path = fileSystem.resolve(template_resource_1.getPathFromTemplateResource(templateResource));
|
35
35
|
const recorder = fileSystem.edit(path);
|
@@ -60,7 +60,7 @@ function replaceInputProperty({ templateResource, fileSystem, componentSelector,
|
|
60
60
|
});
|
61
61
|
propertyBindings.forEach(offset => {
|
62
62
|
recorder.remove(offset, `[${from}]`.length);
|
63
|
-
recorder.insertRight(offset, to.startsWith(
|
63
|
+
recorder.insertRight(offset, to.startsWith('[') ? to : `[${to}]`);
|
64
64
|
});
|
65
65
|
propertyValues.forEach(([startOffset, endOffset]) => {
|
66
66
|
recorder.remove(startOffset, endOffset - startOffset);
|
@@ -80,7 +80,7 @@ function getInputPropertyOffsets(html, attrName, tags,
|
|
80
80
|
// eslint-disable-next-line no-restricted-syntax
|
81
81
|
filterFn = () => true) {
|
82
82
|
return elements_1.findElementsWithAttribute(html, attrName)
|
83
|
-
.filter(element => (tags.includes(element.tagName) || tags.includes(
|
83
|
+
.filter(element => (tags.includes(element.tagName) || tags.includes('*')) &&
|
84
84
|
filterFn(element))
|
85
85
|
.map((element) => {
|
86
86
|
var _a, _b;
|
@@ -97,8 +97,8 @@ exports.getInputPropertyOffsets = getInputPropertyOffsets;
|
|
97
97
|
* getInputPropertyValueOffsets(template, 'size', ['tui-card']) // [ [16, 18] ]
|
98
98
|
*/
|
99
99
|
function getInputPropertyValueOffsets(template, attrName, tags) {
|
100
|
-
const stringProperties = getInputPropertyOffsets(template, attrName, tags).map(([start, end]) => [start + attrName.length +
|
101
|
-
const propertyBindings = getInputPropertyOffsets(template, `[${attrName}]`, tags).map(([start, end]) => [start + `[${attrName}]`.length +
|
100
|
+
const stringProperties = getInputPropertyOffsets(template, attrName, tags).map(([start, end]) => [start + attrName.length + '="'.length, end - 1]);
|
101
|
+
const propertyBindings = getInputPropertyOffsets(template, `[${attrName}]`, tags).map(([start, end]) => [start + `[${attrName}]`.length + '="'.length, end - 1]);
|
102
102
|
return [...stringProperties, ...propertyBindings];
|
103
103
|
}
|
104
104
|
exports.getInputPropertyValueOffsets = getInputPropertyValueOffsets;
|
@@ -2,7 +2,7 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.getTemplateOffset = exports.getPathFromTemplateResource = exports.getTemplateFromTemplateResource = void 0;
|
4
4
|
function getTemplateFromTemplateResource(templateRes, fileSystem) {
|
5
|
-
if (
|
5
|
+
if ('template' in templateRes) {
|
6
6
|
return templateRes.template;
|
7
7
|
}
|
8
8
|
const path = fileSystem.resolve(templateRes.templatePath);
|
@@ -10,13 +10,13 @@ function getTemplateFromTemplateResource(templateRes, fileSystem) {
|
|
10
10
|
}
|
11
11
|
exports.getTemplateFromTemplateResource = getTemplateFromTemplateResource;
|
12
12
|
function getPathFromTemplateResource(templateRes) {
|
13
|
-
if (
|
13
|
+
if ('templatePath' in templateRes) {
|
14
14
|
return templateRes.templatePath;
|
15
15
|
}
|
16
16
|
return templateRes.componentPath;
|
17
17
|
}
|
18
18
|
exports.getPathFromTemplateResource = getPathFromTemplateResource;
|
19
19
|
function getTemplateOffset(templateRes) {
|
20
|
-
return
|
20
|
+
return 'offset' in templateRes ? templateRes.offset : 0;
|
21
21
|
}
|
22
22
|
exports.getTemplateOffset = getTemplateOffset;
|
@@ -1,14 +1,15 @@
|
|
1
|
-
import { ComponentFactoryResolver, Injector, Type } from '@angular/core';
|
1
|
+
import { ComponentFactoryResolver, Injector, OnDestroy, Type } from '@angular/core';
|
2
2
|
import * as i0 from "@angular/core";
|
3
3
|
/**
|
4
4
|
* Service to use styles with directives
|
5
5
|
*/
|
6
|
-
export declare class TuiDirectiveStylesService {
|
6
|
+
export declare class TuiDirectiveStylesService implements OnDestroy {
|
7
7
|
private readonly resolver;
|
8
8
|
private readonly injector;
|
9
9
|
private readonly map;
|
10
10
|
constructor(resolver: ComponentFactoryResolver, injector: Injector);
|
11
11
|
addComponent(component: Type<unknown>): void;
|
12
|
+
ngOnDestroy(): void;
|
12
13
|
static ɵfac: i0.ɵɵFactoryDeclaration<TuiDirectiveStylesService, never>;
|
13
14
|
static ɵprov: i0.ɵɵInjectableDeclaration<TuiDirectiveStylesService>;
|
14
15
|
}
|