From 71866f55e34afa7bcb3352915b1286b4e0eaa683 Mon Sep 17 00:00:00 2001 From: taiga-family-bot <140712314+taiga-family-bot@users.noreply.github.com> Date: Thu, 4 Jul 2024 19:34:03 +0300 Subject: [PATCH] chore(deps): update taiga-ui (#8044) Co-authored-by: taiga-family-bot --- package-lock.json | 119 +++++++++--------- package.json | 16 +-- .../arc-chart/arc-chart.component.ts | 4 +- .../components/bar-set/bar-set.component.ts | 2 +- .../line-chart/line-chart-hint.directive.ts | 18 +-- .../line-chart/line-chart.component.ts | 2 +- .../line-days-chart-hint.directive.ts | 6 +- .../line-days-chart.component.ts | 14 +-- .../pie-chart/pie-chart.directive.ts | 6 +- projects/addon-charts/package.json | 2 +- .../input-card-group.component.ts | 2 +- .../input-card/input-card.directive.ts | 2 +- .../constants/default-card-validator.ts | 2 +- .../constants/mask-card-holder.ts | 2 +- projects/addon-commerce/constants/mask-cvc.ts | 2 +- projects/addon-commerce/package.json | 2 +- .../pipes/amount/amount.pipe.ts | 2 +- .../code/tests/code.component.spec.ts | 2 +- .../documentation/documentation.component.ts | 2 +- .../documentation/pipes/color.pipe.ts | 2 +- .../example/example-get-tabs.pipe.ts | 2 +- .../components/example/example.component.ts | 4 +- .../components/example/example.options.ts | 2 +- .../navigation/navigation.component.ts | 14 +-- .../navigation/navigation.providers.ts | 6 +- .../navigation/scroll-into-view.directive.ts | 2 +- .../components/page/page.providers.ts | 4 +- projects/addon-doc/package.json | 2 +- .../addon-doc/pipes/markdown/markdown.pipe.ts | 2 +- projects/addon-doc/utils/sort-pages.ts | 4 +- projects/addon-doc/utils/to-flat-map-pages.ts | 4 +- .../addon-doc/utils/type-reference-parser.ts | 4 +- .../mobile-calendar.component.ts | 10 +- .../pull-to-refresh.component.ts | 6 +- .../pull-to-refresh.service.ts | 8 +- .../sheet-dialog/sheet-dialog.component.ts | 2 +- .../elastic-sticky/elastic-sticky.service.ts | 2 +- .../touchable/touchable.directive.ts | 2 +- projects/addon-mobile/package.json | 2 +- .../addon-mobile/services/keyboard.service.ts | 2 +- .../components/reorder/reorder.component.ts | 8 +- .../directives/direction-order.directive.ts | 2 +- .../table/directives/sort-by.directive.ts | 6 +- .../table/directives/stuck.directive.ts | 2 +- .../components/table/tr/tr.component.ts | 6 +- .../table-filters/table-filters.directive.ts | 6 +- projects/addon-table/package.json | 2 +- projects/cdk/classes/control.ts | 4 +- projects/cdk/constants/test/matchers.spec.ts | 2 +- .../active-zone/active-zone.directive.ts | 4 +- .../auto-focus/handlers/ios.handler.ts | 4 +- .../click-outside/click-outside.directive.ts | 2 +- .../droppable/droppable.directive.ts | 4 +- .../cdk/directives/hovered/hovered.service.ts | 2 +- .../directives/obscured/obscured.directive.ts | 2 +- .../directives/obscured/obscured.service.ts | 2 +- projects/cdk/directives/pan/pan.service.ts | 2 +- .../cdk/directives/swipe/swipe.service.ts | 2 +- projects/cdk/directives/zoom/zoom.service.ts | 6 +- projects/cdk/observables/control-value.ts | 2 +- .../cdk/observables/drag-and-drop-from.ts | 6 +- projects/cdk/observables/events.ts | 4 +- projects/cdk/observables/if-map.ts | 2 +- projects/cdk/observables/must-be-present.ts | 2 +- .../observables/test/control-value.spec.ts | 4 +- .../observables/test/drag-and-drop.spec.ts | 6 +- .../test/query-list-changes.spec.ts | 4 +- projects/cdk/observables/zone.ts | 10 +- projects/cdk/package.json | 2 +- projects/cdk/pipes/filter/filter.pipe.ts | 2 +- projects/cdk/schematics/ng-add/index.ts | 2 +- .../ng-add/steps/add-taiga-icons.ts | 2 +- .../ng-add/steps/add-taiga-modules.ts | 6 +- .../ng-update/steps/icons/replace-imports.ts | 10 +- .../ng-update/steps/remove-module.ts | 4 +- .../ng-update/steps/rename-types.ts | 4 +- .../ng-update/steps/replace-deep-import.ts | 4 +- .../ng-update/steps/replace-enums.ts | 4 +- .../ng-update/steps/replace-identifier.ts | 2 +- .../ng-update/steps/replace-services.ts | 10 +- .../ng-update/steps/show-warnings.ts | 8 +- .../ng-update/utils/replace-text.ts | 2 +- .../utils/templates/replace-attr-values.ts | 8 +- .../utils/templates/replace-attrs.ts | 2 +- .../utils/templates/template-comments.ts | 4 +- .../cdk/schematics/ng-update/v3-40/index.ts | 2 +- .../v3-5/steps/migrate-expand-templates.ts | 8 +- .../ng-update/v3/constants/templates.ts | 24 ++-- projects/cdk/schematics/ng-update/v3/index.ts | 5 +- .../ng-update/v3/steps/migrate-date-time.ts | 20 +-- .../v3/steps/migrate-polymorpheus.ts | 16 +-- .../ng-update/v3/steps/migrate-progress.ts | 11 +- .../migrate-sliders/migrate-input-range.ts | 6 +- .../migrate-sliders/migrate-input-slider.ts | 8 +- .../steps/migrate-taiga-proprietary-icons.ts | 4 +- .../ng-update/v3/steps/migrate-templates.ts | 34 ++--- .../v3/steps/migrate-textfield-controller.ts | 16 +-- .../ng-update/v3/steps/miscellaneous.ts | 10 +- .../ng-update/v3/steps/replace-functions.ts | 24 ++-- .../ng-update/v3/steps/replace-styles.ts | 4 +- .../v4/migrate-css-vars/rename-css-vars.ts | 4 +- .../v4/migrate-icons/rename-icons.ts | 4 +- .../migrate-icons/rename-proprietary-icons.ts | 4 +- .../constants/attr-to-directive-replace.ts | 4 +- .../constants/attr-with-values-to-replace.ts | 2 +- .../v4/steps/constants/attrs-to-replace.ts | 9 +- .../v4/steps/constants/inputs-to-remove.ts | 2 +- .../v4/steps/constants/tags-to-replace.ts | 12 +- .../v4/steps/migrate-all-country-iso-codes.ts | 2 +- .../v4/steps/migrate-destroy-service.ts | 8 +- .../ng-update/v4/steps/migrate-legacy-mask.ts | 4 +- .../v4/steps/migrate-option-providers.ts | 4 +- .../ng-update/v4/steps/migrate-proprietary.ts | 6 +- .../ng-update/v4/steps/migrate-styles.ts | 2 +- .../ng-update/v4/steps/migrate-templates.ts | 2 +- .../v4/steps/templates/migrate-badge.ts | 8 +- .../v4/steps/templates/migrate-expandable.ts | 4 +- .../v4/steps/templates/migrate-focusable.ts | 2 +- .../steps/templates/migrate-thumbnail-card.ts | 2 +- .../v4/steps/templates/toggles/common.ts | 2 +- .../ng-update/v4/steps/update-packages.ts | 2 +- .../ng-update/v4/steps/utils/remove-attrs.ts | 2 +- .../utils/replace-modules-with-providers.ts | 2 +- .../v4/steps/utils/replace-substrings.ts | 2 +- .../cdk/schematics/utils/add-unique-import.ts | 2 +- .../utils/angular-json-manipulations.ts | 8 +- .../utils/get-named-import-references.ts | 8 +- .../get-standalone-bootstrap-function.ts | 4 +- .../schematics/utils/import-manipulations.ts | 2 +- .../utils/push-to-array-property.ts | 2 +- .../schematics/utils/templates/elements.ts | 33 ++--- .../templates/get-component-templates.ts | 2 +- .../cdk/schematics/utils/templates/inputs.ts | 2 +- .../ng-component-input-manipulations.ts | 10 +- projects/cdk/services/popover.service.ts | 4 +- projects/cdk/services/scroll.service.ts | 8 +- .../cdk/services/static-request.service.ts | 2 +- projects/cdk/tokens/active-element.ts | 6 +- projects/cdk/tokens/removed-element.ts | 2 +- projects/cdk/utils/color/hex-to-rgb.ts | 2 +- projects/cdk/utils/color/parse-color.ts | 4 +- projects/cdk/utils/color/rgb-to-hex.ts | 2 +- .../cdk/utils/dom/get-element-obscurers.ts | 4 +- .../dom/test/get-element-obscurers.spec.ts | 6 +- .../mark-control-as-touched-and-validate.ts | 4 +- .../cdk/utils/miscellaneous/with-styles.ts | 2 +- projects/core/classes/accessors.ts | 5 +- projects/core/classes/driver.ts | 2 +- .../core/components/alert/alert.tokens.ts | 2 +- .../core/components/alert/alerts.component.ts | 2 +- .../calendar/calendar-sheet.component.ts | 2 +- .../calendar/calendar-year.component.ts | 2 +- .../components/calendar/calendar.component.ts | 2 +- .../test/calendar-sheet.component.spec.ts | 4 +- .../components/dialog/dialog-close.service.ts | 8 +- .../core/components/root/root.component.ts | 2 +- .../components/scrollbar/scrollbar.service.ts | 8 +- .../date-format/date-format.directive.ts | 2 +- .../dropdown/dropdown-hover.directive.ts | 10 +- .../dropdown/dropdown-open.directive.ts | 5 +- .../dropdown/dropdown-selection.directive.ts | 2 +- .../directives/dropdown/dropdown.component.ts | 2 +- .../hint/hint-describe.directive.ts | 4 +- .../directives/hint/hint-hover.directive.ts | 10 +- .../directives/hint/hint-manual.directive.ts | 2 +- .../hint/hint-position.directive.ts | 2 +- .../core/directives/hint/hint.component.ts | 4 +- projects/core/directives/hint/hint.service.ts | 2 +- .../core/directives/hint/hints.component.ts | 2 +- .../number-format/number-format.directive.ts | 2 +- projects/core/package.json | 2 +- .../calendar-sheet/calendar-sheet.pipe.ts | 2 +- .../pipes/format-number/format-number.pipe.ts | 2 +- projects/core/pipes/month/month.pipe.ts | 2 +- .../order-week-days/order-week-days.pipe.ts | 2 +- projects/core/services/breakpoint.service.ts | 6 +- projects/core/services/dark-theme.service.ts | 2 +- projects/core/services/position.service.ts | 4 +- .../services/test/dark-theme.service.spec.ts | 4 +- projects/core/tokens/date-format.ts | 2 +- projects/core/tokens/day-type-handler.ts | 2 +- projects/core/tokens/icon-resolver.ts | 4 +- projects/core/tokens/number-format.ts | 2 +- .../core/utils/miscellaneous/is-obscured.ts | 2 +- .../utils/miscellaneous/override-options.ts | 2 +- .../demo-cypress/src/support/component.ts | 2 +- projects/demo-cypress/src/tests/hint.cy.ts | 2 +- .../src/tests/input-phone-international.cy.ts | 2 +- .../src/tests/mobile-calendar.cy.ts | 4 +- projects/demo-cypress/src/tests/pan.cy.ts | 4 +- projects/demo-cypress/src/tests/range.cy.ts | 2 +- .../src/tests/static-request.cy.ts | 4 +- projects/demo-cypress/src/tests/swipe.cy.ts | 8 +- projects/demo-cypress/src/tests/tabs.cy.ts | 2 +- projects/demo-cypress/src/tests/zoom.cy.ts | 6 +- .../tests/core/hint/hint.spec.ts | 6 +- .../tests/core/textarea/textarea.spec.ts | 2 +- .../tests/deep/deep-select.spec.ts | 2 +- .../tests/deep/deep-toggle.spec.ts | 2 +- .../demo-playwright/tests/demo/demo.spec.ts | 2 +- .../tests/demo/get-demo-paths.ts | 2 +- .../tests/kit/combo-box/combobox.spec.ts | 2 +- .../input-date-range/input-date-range.spec.ts | 2 +- .../tests/kit/input-date/input-date.spec.ts | 4 +- .../tests/kit/input-files/input-files.spec.ts | 4 +- .../tests/kit/input-time/input-time.spec.ts | 4 +- .../tests/kit/input/input.spec.ts | 2 +- .../kit/multi-select/multi-select.spec.ts | 4 +- .../tests/kit/slider/slider.spec.ts | 4 +- .../tests/kit/tabs/tabs.spec.ts | 2 +- projects/demo-playwright/utils/goto.ts | 4 +- .../demo-playwright/utils/hide-element.ts | 4 +- projects/demo-playwright/utils/mock-date.ts | 2 +- projects/demo-playwright/utils/mock-images.ts | 4 +- .../page-objects/documentation-api-page.po.ts | 4 +- .../utils/page-objects/slider.po.ts | 2 +- projects/demo/src/main.ts | 2 +- .../demo/src/modules/app/app.component.ts | 2 +- projects/demo/src/modules/app/app.config.ts | 2 +- .../src/modules/app/classes/ts-file.parser.ts | 2 +- .../app/home/examples/main-standalone.md | 2 +- .../src/modules/app/server-error-handler.ts | 2 +- .../stackblitz/project-files/src/main.ts.md | 4 +- .../modules/app/stackblitz/starter/index.ts | 2 +- .../demo/src/modules/app/stackblitz/utils.ts | 4 +- .../app/utils/ready-to-scroll-factory.ts | 4 +- .../components/action-bar/examples/1/index.ts | 2 +- .../components/alert/examples/3/index.ts | 2 +- .../components/alert/examples/4/index.ts | 2 +- .../src/modules/components/alert/index.ts | 2 +- .../components/animations/examples/3/index.ts | 2 +- .../demo/src/modules/components/axes/index.ts | 2 +- .../block-status/examples/2/index.ts | 2 +- .../block-status/examples/3/index.ts | 2 +- .../components/calendar/examples/6/index.ts | 4 +- .../components/combo-box/examples/1/index.ts | 6 +- .../combo-box/examples/2/request.service.ts | 4 +- .../components/combo-box/examples/8/index.ts | 2 +- .../src/modules/components/combo-box/index.ts | 4 +- .../components/confirm/examples/1/index.ts | 2 +- .../confirm/examples/import/service.md | 2 +- .../src/modules/components/confirm/index.ts | 2 +- .../data-list-wrapper/examples/1/index.ts | 2 +- .../components/data-list/examples/4/index.ts | 2 +- .../components/dialog/examples/2/index.ts | 2 +- .../9/pay-modal/pay-modal.component.ts | 4 +- .../examples/import/dialogs-close-token.md | 2 +- .../src/modules/components/dialog/index.ts | 2 +- .../components/filter/examples/1/index.ts | 2 +- .../components/filter/examples/2/index.ts | 2 +- .../components/filter/examples/4/index.ts | 4 +- .../src/modules/components/filter/index.ts | 8 +- .../components/icon/examples/2/index.ts | 2 +- .../icons-group/icons-group.component.ts | 8 +- .../input-files/examples/1/index.ts | 2 +- .../input-files/examples/2/index.ts | 4 +- .../input-files/examples/3/index.ts | 4 +- .../input-files/examples/7/index.ts | 6 +- .../modules/components/input-files/index.ts | 4 +- .../input-inline/examples/3/index.ts | 2 +- .../examples/1/index.ts | 2 +- .../input-phone/examples/3/index.ts | 12 +- .../components/input-tag/examples/2/index.ts | 4 +- .../components/input-tag/examples/4/index.ts | 2 +- .../src/modules/components/input-tag/index.ts | 6 +- .../modules/components/input-year/index.ts | 2 +- .../components/input/examples/4/index.ts | 4 +- .../components/input/examples/8/index.ts | 6 +- .../modules/components/line-chart/index.ts | 4 +- .../line-days-chart/examples/1/index.ts | 6 +- .../line-days-chart/examples/2/index.ts | 4 +- .../components/line-days-chart/index.ts | 10 +- .../mobile-calendar/examples/1/index.ts | 2 +- .../mobile-calendar/examples/4/index.ts | 2 +- .../mobile-calendar/examples/5/index.ts | 4 +- .../mobile-dialog/examples/1/index.ts | 2 +- .../multi-select/examples/1/index.ts | 4 +- .../multi-select/examples/10/index.ts | 4 +- .../multi-select/examples/11/index.ts | 2 +- .../multi-select/examples/2/index.ts | 6 +- .../multi-select/examples/3/index.ts | 2 +- .../multi-select/examples/4/index.ts | 8 +- .../modules/components/multi-select/index.ts | 6 +- .../components/pdf-viewer/examples/2/index.ts | 6 +- .../components/preview/examples/4/index.ts | 10 +- .../progress-bar/examples/1/index.ts | 2 +- .../progress-bar/examples/4/index.ts | 4 +- .../progress-circle/examples/1/index.ts | 4 +- .../progress-circle/examples/3/index.ts | 4 +- .../progress-circle/examples/5/index.ts | 4 +- .../progress-circle/examples/6/index.ts | 2 +- .../components/push/examples/2/index.ts | 2 +- .../components/radio/examples/3/index.ts | 2 +- .../components/range/examples/3/index.ts | 2 +- .../components/select/examples/11/index.ts | 4 +- .../sheet-dialog/examples/4/index.ts | 2 +- .../components/slider/examples/6/index.ts | 2 +- .../components/table/examples/2/index.ts | 2 +- .../components/table/examples/3/index.ts | 4 +- .../components/table/examples/4/index.ts | 10 +- .../components/table/examples/6/index.ts | 2 +- .../components/tabs/examples/5/index.ts | 2 +- .../components/tooltip/examples/1/index.ts | 2 +- .../components/tree/examples/3/index.ts | 2 +- .../components/tree/examples/4/index.ts | 2 +- .../components/tree/examples/5/index.ts | 2 +- .../components/tree/examples/6/index.ts | 4 +- .../components/tree/examples/7/index.ts | 2 +- .../customization/dialogs/examples/1/index.ts | 2 +- .../src/modules/customization/i18n/index.ts | 2 +- .../customization/wrapper/examples/1/index.ts | 2 +- .../copy-processor/examples/1/index.ts | 4 +- .../dropdown-selection/examples/2/index.ts | 2 +- .../directives/dropdown/examples/3/index.ts | 2 +- .../elastic-sticky/examples/1/index.ts | 2 +- .../directives/pan/examples/1/index.ts | 2 +- .../directives/zoom/examples/1/index.ts | 2 +- .../src/modules/markup/breakpoints/index.ts | 4 +- .../pipes/field-error/examples/1/index.ts | 2 +- .../pipes/field-error/examples/2/index.ts | 2 +- .../pipes/field-error/examples/4/index.ts | 3 +- .../modules/pipes/mapper/examples/2/index.ts | 2 +- projects/demo/src/utils/example.pipe.ts | 2 +- projects/demo/webpack.config.ts | 4 +- projects/experimental/package.json | 2 +- .../accordion/accordion.directive.ts | 10 +- .../calendar-month.component.ts | 2 +- .../calendar-range.component.ts | 8 +- .../test/calendar-range.component.spec.ts | 6 +- .../components/carousel/carousel.directive.ts | 4 +- .../components/checkbox/checkbox.component.ts | 2 +- .../components/checkbox/checkbox.options.ts | 2 +- .../elastic-container.component.ts | 2 +- .../components/files/file/file.component.ts | 4 +- projects/kit/components/files/files.utils.ts | 2 +- .../kit/components/files/files.validators.ts | 8 +- .../files/input-files/input-files.content.ts | 2 +- .../kit/components/filter/filter.component.ts | 6 +- .../filter/test/filter.component.spec.ts | 4 +- .../input-phone-international.options.ts | 2 +- ...nput-phone-international.component.spec.ts | 6 +- .../items-with-more.service.ts | 2 +- .../radio-list/radio-list.component.ts | 2 +- .../range/range-change.directive.ts | 4 +- .../test/generate-dialogable-route.spec.ts | 2 +- .../segmented/segmented.directive.ts | 4 +- .../helpers/slider-readonly.directive.ts | 2 +- .../components/stepper/stepper.component.ts | 2 +- .../kit/components/switch/switch.options.ts | 2 +- .../tabs/tabs-with-more.component.ts | 4 +- .../kit/components/tabs/tabs.directive.ts | 4 +- .../tabs/test/tabs.component.spec.ts | 4 +- projects/kit/components/tiles/tile.service.ts | 2 +- .../kit/components/tiles/tiles.component.ts | 2 +- .../kit/components/tree/misc/tree.service.ts | 10 +- .../data-list-dropdown-manager.directive.ts | 14 +-- .../lazy-loading/lazy-loading.directive.ts | 2 +- .../lazy-loading/lazy-loading.service.ts | 4 +- .../directives/tooltip/tooltip.directive.ts | 2 +- projects/kit/package.json | 2 +- projects/kit/pipes/emails/emails.pipe.spec.ts | 2 +- projects/kit/pipes/emails/emails.pipe.ts | 7 +- .../kit/pipes/field-error/field-error-pipe.ts | 4 +- .../filter-by-input/filter-by-input.pipe.ts | 8 +- .../sort-countries/sort-countries.pipe.ts | 4 +- .../kit/pipes/stringify/stringify.pipe.ts | 2 +- projects/kit/tokens/calendar-date-stream.ts | 2 +- projects/kit/utils/create-time-periods.ts | 2 +- projects/kit/utils/toggle-day.ts | 4 +- projects/layout/package.json | 2 +- projects/legacy/classes/control.ts | 4 +- .../color-selector.component.ts | 8 +- .../flat-picker/flat-picker.component.ts | 2 +- .../color-selector/services/picker.service.ts | 4 +- .../combo-box/combo-box.component.ts | 4 +- .../input-copy/input-copy.component.ts | 4 +- .../input-date-multi.component.ts | 9 +- .../input-date-range.component.ts | 8 +- .../test/input-date-range.component.spec.ts | 5 +- .../input-date-time.component.ts | 4 +- .../test/input-date-time.component.spec.ts | 7 +- .../input-date/input-date.component.ts | 6 +- .../test/input-date.component.spec.ts | 5 +- .../input-month-range.directive.ts | 2 +- .../input-month/input-month.directive.ts | 2 +- .../input-number/input-number.component.ts | 4 +- .../test/input-number.component.spec.ts | 2 +- ...nput-phone-international.component.spec.ts | 6 +- .../utils/create-phone-mask-expression.ts | 2 +- .../input-tag/input-tag.component.ts | 8 +- .../test/input-tag.component.spec.ts | 6 +- .../input-time/input-time.component.ts | 6 +- .../native-time/native-time.component.ts | 2 +- .../multi-select-option.component.ts | 2 +- .../multi-select/hide-selected.pipe.ts | 6 +- .../multi-select-group.component.ts | 12 +- .../multi-select-group.directive.ts | 2 +- .../multi-select/multi-select.component.ts | 6 +- .../multi-select/multi-select.directive.ts | 2 +- .../native-multi-select-group.component.ts | 2 +- .../native-multi-select.component.ts | 2 +- .../sheet-bar/sheet-bar.component.ts | 2 +- .../sheet/components/sheet/sheet.component.ts | 4 +- .../sheets-host/sheets-host.component.ts | 2 +- .../sheet-close/sheet-close.directive.ts | 2 +- .../sheet-stop/sheet-stop.directive.ts | 2 +- .../sheet-top/sheet-top.directive.ts | 12 +- .../sheet-wrapper/sheet-wrapper.directive.ts | 2 +- .../legacy/components/sheet/sheet.service.ts | 4 +- .../components/svg/content-processor.ts | 2 +- projects/legacy/components/svg/svg-options.ts | 4 +- .../legacy/components/svg/svg.component.ts | 2 +- projects/legacy/components/svg/svg.service.ts | 2 +- .../legacy-dropdown-open-monitor.ts | 2 +- .../to-country-code/to-country-code.pipe.ts | 2 +- projects/legacy/tokens/month-formatter.ts | 4 +- projects/legacy/utils/icons-path-factory.ts | 4 +- projects/testing/setup-jest/index.ts | 6 +- projects/testing/utils/page-object.ts | 2 +- .../combine-playwright-failed-screenshots.ts | 8 +- scripts/generate-demo-routes-file.ts | 6 +- scripts/generate-used-icons.ts | 2 +- scripts/shared/argv.utils.ts | 2 +- scripts/shared/bump-tui-deps.ts | 4 +- scripts/shared/check-changelog-before-push.ts | 2 +- scripts/shared/get-last-major-version.ts | 2 +- scripts/shared/parse-version.ts | 2 +- scripts/shared/sync-versions.ts | 8 +- 428 files changed, 961 insertions(+), 926 deletions(-) diff --git a/package-lock.json b/package-lock.json index efb8d5d75051..13ab2dcdfe03 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,15 +28,15 @@ "@nx/jest": "18.3.4", "@nx/workspace": "18.3.4", "@schematics/angular": "16.2.12", - "@taiga-ui/browserslist-config": "0.109.2", - "@taiga-ui/commitlint-config": "0.109.2", - "@taiga-ui/cspell-config": "0.109.2", - "@taiga-ui/design-tokens": "0.91.0", - "@taiga-ui/eslint-plugin-experience": "0.109.2", + "@taiga-ui/browserslist-config": "0.113.1", + "@taiga-ui/commitlint-config": "0.113.1", + "@taiga-ui/cspell-config": "0.113.1", + "@taiga-ui/design-tokens": "0.103.0", + "@taiga-ui/eslint-plugin-experience": "0.113.1", "@taiga-ui/event-plugins": "4.0.1", - "@taiga-ui/prettier-config": "0.109.2", - "@taiga-ui/stylelint-config": "0.109.2", - "@taiga-ui/tsconfig": "0.109.2", + "@taiga-ui/prettier-config": "0.113.1", + "@taiga-ui/stylelint-config": "0.113.1", + "@taiga-ui/tsconfig": "0.113.1", "@types/glob": "8.1.0", "@types/loader-utils": "2.0.6", "@types/node": "20.14.9", @@ -6686,22 +6686,6 @@ "libphonenumber-js": ">=1.0.0" } }, - "node_modules/@miller-svt/stylelint-no-px": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@miller-svt/stylelint-no-px/-/stylelint-no-px-1.0.1.tgz", - "integrity": "sha512-48pXblV7F/4Usjmci0ConuogcZLAfqeQQ5dYShHIyBT6vSdqN/05YFttYXPTmQAQrIQRSNy2iszs9EMDS1rv7A==", - "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "postcss-less": "^6.0.0", - "postcss-value-parser": "^4.2.0" - }, - "peerDependencies": { - "stylelint": ">= 16" - } - }, "node_modules/@ng-web-apis/common": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/@ng-web-apis/common/-/common-4.1.2.tgz", @@ -9380,9 +9364,9 @@ "link": true }, "node_modules/@taiga-ui/browserslist-config": { - "version": "0.109.2", - "resolved": "https://registry.npmjs.org/@taiga-ui/browserslist-config/-/browserslist-config-0.109.2.tgz", - "integrity": "sha512-6PDEe1lXnQbKVuD5V71gSoT1GiOZrO0fp7hKFLgST8NYI8du2UNj9AfYpICKIrlSzt4OIrx3E/dAG0hZbTM0yg==", + "version": "0.113.1", + "resolved": "https://registry.npmjs.org/@taiga-ui/browserslist-config/-/browserslist-config-0.113.1.tgz", + "integrity": "sha512-xVQ1yDW3JaClVQkwRKgy/QQb2qVqbKSQd9M4/PzU60nFKMFhNA0uUY4z/dijqa/l4huB5nzVqRSRXK6zQo5whQ==", "dev": true, "license": "Apache-2.0" }, @@ -9391,9 +9375,9 @@ "link": true }, "node_modules/@taiga-ui/commitlint-config": { - "version": "0.109.2", - "resolved": "https://registry.npmjs.org/@taiga-ui/commitlint-config/-/commitlint-config-0.109.2.tgz", - "integrity": "sha512-iigkmcJxD/8LMnEu8pUxS1hbYn8He5VzLMU0A/i6GxXKV3J2rKT2F+Y1+0JIUnXBr65Z8fP5yowW1g0rti/z5w==", + "version": "0.113.1", + "resolved": "https://registry.npmjs.org/@taiga-ui/commitlint-config/-/commitlint-config-0.113.1.tgz", + "integrity": "sha512-6urZBq2oUynKYjuIGtkKLSp/bJRsoZSrzBz1Od6SoUxhZHwsADP9ltUEqBMg8qJh05Yq6/OrwPGp+VlGR+SzLQ==", "dev": true, "license": "Apache-2.0", "peerDependencies": { @@ -9406,9 +9390,9 @@ "link": true }, "node_modules/@taiga-ui/cspell-config": { - "version": "0.109.2", - "resolved": "https://registry.npmjs.org/@taiga-ui/cspell-config/-/cspell-config-0.109.2.tgz", - "integrity": "sha512-MVWRo3FDnDHYBouk+LeMTz/1ajgvODsbSUxq3yEO8svcrKoWms0yjm+SJe1fU9GvRHA42AwQmgMKzaVqDapxBg==", + "version": "0.113.1", + "resolved": "https://registry.npmjs.org/@taiga-ui/cspell-config/-/cspell-config-0.113.1.tgz", + "integrity": "sha512-TzgAzHEGzIa3M9nDc3TCS79eK19lZBbak+dk1W9LWnZ305IjriDAT2mDi5TMo3Tc5wp4D9V8jEan0RW0NQmW9Q==", "dev": true, "license": "Apache-2.0", "peerDependencies": { @@ -9416,7 +9400,7 @@ "@cspell/dict-lorem-ipsum": "^4.0.0", "@cspell/dict-ru_ru": "^2.2.1", "@cspell/dict-scientific-terms-us": "^3.0.1", - "cspell": "^8.9.1" + "cspell": "^8.10.0" } }, "node_modules/@taiga-ui/demo": { @@ -9432,9 +9416,9 @@ "link": true }, "node_modules/@taiga-ui/design-tokens": { - "version": "0.91.0", - "resolved": "https://registry.npmjs.org/@taiga-ui/design-tokens/-/design-tokens-0.91.0.tgz", - "integrity": "sha512-jy8ijWL3IWVNdbs0OVkA7kEZ4dFzVOA3cEM0rIteSzfQ839zAfRHnokcCGFBeL+JGBd4jbU2wKCs9yTwlMpGbg==", + "version": "0.103.0", + "resolved": "https://registry.npmjs.org/@taiga-ui/design-tokens/-/design-tokens-0.103.0.tgz", + "integrity": "sha512-abiIm3KicfSm6w7l+1ixg6JDyVAbX6nm2PdyId0KcQ3sgjuHyJnUPw5mxU8GrQi0TRbSXymCfFBgQgVACBG16g==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -9457,9 +9441,9 @@ } }, "node_modules/@taiga-ui/eslint-plugin-experience": { - "version": "0.109.2", - "resolved": "https://registry.npmjs.org/@taiga-ui/eslint-plugin-experience/-/eslint-plugin-experience-0.109.2.tgz", - "integrity": "sha512-7gtQYyDAk4CqEEATY1FE5334m8Rbyijw0qMgeiDq9lXJhks5ogfkLR9YfkyCvIzh9XG75IUy9+Vxyv2qQVmg7A==", + "version": "0.113.1", + "resolved": "https://registry.npmjs.org/@taiga-ui/eslint-plugin-experience/-/eslint-plugin-experience-0.113.1.tgz", + "integrity": "sha512-Z5iA5j66P+n0W5n3BhRXN/NrHb5uqw4fRBRztz3wL1SUlY+KnxRAwK2Jj4GO7oCph+pk2iFEP9vNNv6RtPg9Jw==", "dev": true, "peerDependencies": { "@angular-eslint/eslint-plugin": "^18.1.0", @@ -9549,9 +9533,9 @@ } }, "node_modules/@taiga-ui/prettier-config": { - "version": "0.109.2", - "resolved": "https://registry.npmjs.org/@taiga-ui/prettier-config/-/prettier-config-0.109.2.tgz", - "integrity": "sha512-oVowNfDfY445h++WTv+0MKmT5EWS6epY9itmzeecVpvRBP3d9EEcnM71lV4Rn2zk/iH0q5JiRHwu7JxTYANH+g==", + "version": "0.113.1", + "resolved": "https://registry.npmjs.org/@taiga-ui/prettier-config/-/prettier-config-0.113.1.tgz", + "integrity": "sha512-qs0KnXEWbFsTOq8OdZDeD0Gj+7jAvN8m/JhzP56Trz1tRfvjcPw0Ysd6yfMtm3uHNOSAfwN1RnrPInf+X9I5Ww==", "dev": true, "license": "Apache-2.0", "peerDependencies": { @@ -9564,17 +9548,17 @@ } }, "node_modules/@taiga-ui/stylelint-config": { - "version": "0.109.2", - "resolved": "https://registry.npmjs.org/@taiga-ui/stylelint-config/-/stylelint-config-0.109.2.tgz", - "integrity": "sha512-cSYF1ZaAItEpotLR9rqy83MV/2ham+6CNL58VQ7jD/PAIvrmJxYey+ghBRwFZOcBhGDy1LHQlX5XkvXbkfn15A==", + "version": "0.113.1", + "resolved": "https://registry.npmjs.org/@taiga-ui/stylelint-config/-/stylelint-config-0.113.1.tgz", + "integrity": "sha512-tDfWuw8JRf6w9Wa/LArMAd8WfgsatBOkU2W9y5/pSkuBBmeZfD0QXwLfWAT2DA8A0fDb7g3bdaQCFrZ2ZHPlhw==", "dev": true, "license": "Apache-2.0", "peerDependencies": { - "@miller-svt/stylelint-no-px": "^1.0.1", "postcss": "^8.4.39", "postcss-less": "^6.0.0", "stylelint": "^16.6.1", "stylelint-config-standard": "^36.0.1", + "stylelint-no-px": "^2.0.0", "stylelint-order": "^6.0.4" } }, @@ -9587,9 +9571,9 @@ "link": true }, "node_modules/@taiga-ui/tsconfig": { - "version": "0.109.2", - "resolved": "https://registry.npmjs.org/@taiga-ui/tsconfig/-/tsconfig-0.109.2.tgz", - "integrity": "sha512-bN7HJnzOeajJH1MXLeL6rVoIbclX422LHH3epzGG9lj06jHtErRyl2FcQuknIoefwarPtzYON7e6ZWABmtmGsw==", + "version": "0.113.1", + "resolved": "https://registry.npmjs.org/@taiga-ui/tsconfig/-/tsconfig-0.113.1.tgz", + "integrity": "sha512-6usvintqKGB2ObBID2itKr5P6u/b8UnM5hAi35sDDNS4EbKoLsBPm+02BUsoe0i24ME/T8DqRqqgTt68/IJYUw==", "dev": true, "license": "Apache-2.0" }, @@ -35366,6 +35350,21 @@ "stylelint": "^16.1.0" } }, + "node_modules/stylelint-no-px": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/stylelint-no-px/-/stylelint-no-px-2.0.0.tgz", + "integrity": "sha512-uuiKhXIlLATtetsqvGG0tx8LUlqKDKI4BzYUeEp2mrJD7gb0AazPPtEHdRMrMeEJGwnRcPyiOYvAZ29In4m+1g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "postcss-less": "^6.0.0", + "postcss-value-parser": "^4.2.0" + }, + "peerDependencies": { + "stylelint": ">= 16" + } + }, "node_modules/stylelint-order": { "version": "6.0.4", "resolved": "https://registry.npmjs.org/stylelint-order/-/stylelint-order-6.0.4.tgz", @@ -38979,7 +38978,7 @@ "@ng-web-apis/common": "^4.1.2", "@taiga-ui/cdk": "^4.0.0-rc.2", "@taiga-ui/core": "^4.0.0-rc.2", - "@taiga-ui/polymorpheus": "^4.6.3", + "@taiga-ui/polymorpheus": "^4.6.4", "tslib": "^2.6.3" } }, @@ -38999,7 +38998,7 @@ "@taiga-ui/core": "^4.0.0-rc.2", "@taiga-ui/i18n": "^4.0.0-rc.2", "@taiga-ui/kit": "^4.0.0-rc.2", - "@taiga-ui/polymorpheus": "^4.6.3", + "@taiga-ui/polymorpheus": "^4.6.4", "rxjs": ">=7.0.0", "tslib": "^2.6.3" } @@ -39027,7 +39026,7 @@ "@taiga-ui/cdk": "^4.0.0-rc.2", "@taiga-ui/core": "^4.0.0-rc.2", "@taiga-ui/kit": "^4.0.0-rc.2", - "@taiga-ui/polymorpheus": "^4.6.3", + "@taiga-ui/polymorpheus": "^4.6.4", "tslib": "^2.6.3" } }, @@ -39043,7 +39042,7 @@ "@taiga-ui/cdk": "^4.0.0-rc.2", "@taiga-ui/core": "^4.0.0-rc.2", "@taiga-ui/kit": "^4.0.0-rc.2", - "@taiga-ui/polymorpheus": "^4.6.3", + "@taiga-ui/polymorpheus": "^4.6.4", "rxjs": ">=7.0.0", "tslib": "^2.6.3" } @@ -39060,7 +39059,7 @@ "@taiga-ui/core": "^4.0.0-rc.2", "@taiga-ui/i18n": "^4.0.0-rc.2", "@taiga-ui/kit": "^4.0.0-rc.2", - "@taiga-ui/polymorpheus": "^4.6.3", + "@taiga-ui/polymorpheus": "^4.6.4", "rxjs": ">=7.0.0", "tslib": "^2.6.3" } @@ -39095,7 +39094,7 @@ "@ng-web-apis/mutation-observer": "^4.1.2", "@ng-web-apis/resize-observer": "^4.1.2", "@taiga-ui/event-plugins": "^4.0.1", - "@taiga-ui/polymorpheus": "^4.6.3", + "@taiga-ui/polymorpheus": "^4.6.4", "rxjs": ">=7.0.0" } }, @@ -39118,7 +39117,7 @@ "@taiga-ui/cdk": "^4.0.0-rc.2", "@taiga-ui/event-plugins": "^4.0.1", "@taiga-ui/i18n": "^4.0.0-rc.2", - "@taiga-ui/polymorpheus": "^4.6.3", + "@taiga-ui/polymorpheus": "^4.6.4", "rxjs": ">=7.0.0", "tslib": "^2.6.3" } @@ -39174,7 +39173,7 @@ "@taiga-ui/cdk": "^4.0.0-rc.2", "@taiga-ui/core": "^4.0.0-rc.2", "@taiga-ui/kit": "^4.0.0-rc.2", - "@taiga-ui/polymorpheus": "^4.6.3", + "@taiga-ui/polymorpheus": "^4.6.4", "rxjs": ">=7.0.0", "tslib": "^2.6.3" } @@ -39218,7 +39217,7 @@ "@taiga-ui/cdk": "^4.0.0-rc.2", "@taiga-ui/core": "^4.0.0-rc.2", "@taiga-ui/i18n": "^4.0.0-rc.2", - "@taiga-ui/polymorpheus": "^4.6.3", + "@taiga-ui/polymorpheus": "^4.6.4", "rxjs": ">=7.0.0", "tslib": "^2.6.3" } @@ -39232,7 +39231,7 @@ "@angular/core": ">=16.0.0", "@taiga-ui/cdk": "^4.0.0-rc.2", "@taiga-ui/core": "^4.0.0-rc.2", - "@taiga-ui/polymorpheus": "^4.6.3", + "@taiga-ui/polymorpheus": "^4.6.4", "rxjs": ">=7.0.0", "tslib": "^2.6.3" } diff --git a/package.json b/package.json index 50de564f015e..01f8bde80295 100644 --- a/package.json +++ b/package.json @@ -114,15 +114,15 @@ "@nx/jest": "18.3.4", "@nx/workspace": "18.3.4", "@schematics/angular": "16.2.12", - "@taiga-ui/browserslist-config": "0.109.2", - "@taiga-ui/commitlint-config": "0.109.2", - "@taiga-ui/cspell-config": "0.109.2", - "@taiga-ui/design-tokens": "0.91.0", - "@taiga-ui/eslint-plugin-experience": "0.109.2", + "@taiga-ui/browserslist-config": "0.113.1", + "@taiga-ui/commitlint-config": "0.113.1", + "@taiga-ui/cspell-config": "0.113.1", + "@taiga-ui/design-tokens": "0.103.0", + "@taiga-ui/eslint-plugin-experience": "0.113.1", "@taiga-ui/event-plugins": "4.0.1", - "@taiga-ui/prettier-config": "0.109.2", - "@taiga-ui/stylelint-config": "0.109.2", - "@taiga-ui/tsconfig": "0.109.2", + "@taiga-ui/prettier-config": "0.113.1", + "@taiga-ui/stylelint-config": "0.113.1", + "@taiga-ui/tsconfig": "0.113.1", "@types/glob": "8.1.0", "@types/loader-utils": "2.0.6", "@types/node": "20.14.9", diff --git a/projects/addon-charts/components/arc-chart/arc-chart.component.ts b/projects/addon-charts/components/arc-chart/arc-chart.component.ts index 9a9eedc74ba3..aa99d7914061 100644 --- a/projects/addon-charts/components/arc-chart/arc-chart.component.ts +++ b/projects/addon-charts/components/arc-chart/arc-chart.component.ts @@ -79,13 +79,13 @@ export class TuiArcChart { @Output() public readonly activeItemIndexChange = this.arcs$.pipe( - switchMap(arcs => + switchMap((arcs) => arcs.changes.pipe( startWith(null), switchMap(() => merge(...arcsToIndex(arcs))), ), ), - tap(index => { + tap((index) => { this.activeItemIndex = index; }), ); diff --git a/projects/addon-charts/components/bar-set/bar-set.component.ts b/projects/addon-charts/components/bar-set/bar-set.component.ts index 861cdfd33d2e..557b314164fd 100644 --- a/projects/addon-charts/components/bar-set/bar-set.component.ts +++ b/projects/addon-charts/components/bar-set/bar-set.component.ts @@ -44,7 +44,7 @@ export class TuiBarSet { @tuiPure private getLargest(value: readonly number[]): number { - return value.some(a => a > 0) + return value.some((a) => a > 0) ? value.reduce((a, b) => (a > b ? a : b), 0) : Math.abs(value.reduce((a, b) => (a < b ? a : b), 0)); } diff --git a/projects/addon-charts/components/line-chart/line-chart-hint.directive.ts b/projects/addon-charts/components/line-chart/line-chart-hint.directive.ts index 7232b388fd5d..a6d6c0862635 100644 --- a/projects/addon-charts/components/line-chart/line-chart-hint.directive.ts +++ b/projects/addon-charts/components/line-chart/line-chart-hint.directive.ts @@ -53,12 +53,12 @@ export class TuiLineChartHint implements AfterViewInit { public ngAfterViewInit(): void { combineLatest([tuiLineChartDrivers(this.charts), this.hovered$]) .pipe( - filter(result => !result.some(Boolean)), + filter((result) => !result.some(Boolean)), tuiZonefree(this.zone), takeUntilDestroyed(this.destroyRef), ) .subscribe(() => { - this.charts.forEach(chart => chart.onHovered(NaN)); + this.charts.forEach((chart) => chart.onHovered(NaN)); }); } @@ -69,10 +69,10 @@ export class TuiLineChartHint implements AfterViewInit { // _chart is required by TuiLineDaysChartComponent that impersonates this directive public raise(index: number, _chart: TuiLineChart): void { - const current = this.charts.map(chart => chart.value[index]); + const current = this.charts.map((chart) => chart.value[index]); const sorted = [...current].sort((a, b) => a[1] - b[1]); - this.charts.forEach(chart => chart.onHovered(index)); + this.charts.forEach((chart) => chart.onHovered(index)); this.chartsRef.forEach(({nativeElement}, index) => this.renderer.setStyle( nativeElement, @@ -86,7 +86,7 @@ export class TuiLineChartHint implements AfterViewInit { private computeContext( ...values: ReadonlyArray ): ReadonlyArray { - return (values[0] || []).map((_, index) => values.map(value => value[index])); + return (values[0] || []).map((_, index) => values.map((value) => value[index])); } } @@ -96,13 +96,13 @@ export function tuiLineChartDrivers( return combineLatest( charts.map(({drivers}) => tuiQueryListChanges(drivers).pipe( - map(drivers => drivers.map(driver => driver.pipe(startWith(false)))), + map((drivers) => drivers.map((driver) => driver.pipe(startWith(false)))), ), ), ).pipe( - map(all => all.reduce((acc, drivers) => acc.concat(drivers), [])), - switchMap(drivers => combineLatest(drivers)), - map(values => values.some(Boolean)), + map((all) => all.reduce((acc, drivers) => acc.concat(drivers), [])), + switchMap((drivers) => combineLatest(drivers)), + map((values) => values.some(Boolean)), distinctUntilChanged(), ); } diff --git a/projects/addon-charts/components/line-chart/line-chart.component.ts b/projects/addon-charts/components/line-chart/line-chart.component.ts index e5c48612a90a..d97a7e83be91 100644 --- a/projects/addon-charts/components/line-chart/line-chart.component.ts +++ b/projects/addon-charts/components/line-chart/line-chart.component.ts @@ -86,7 +86,7 @@ export class TuiLineChart { @Input('value') public set valueSetter(value: readonly TuiPoint[]) { - this.value = value.filter(item => !item.some(Number.isNaN)); + this.value = value.filter((item) => !item.some(Number.isNaN)); } public onHovered(index: number): void { diff --git a/projects/addon-charts/components/line-days-chart/line-days-chart-hint.directive.ts b/projects/addon-charts/components/line-days-chart/line-days-chart-hint.directive.ts index ae711e6dcb08..fdbeb393b10b 100644 --- a/projects/addon-charts/components/line-days-chart/line-days-chart-hint.directive.ts +++ b/projects/addon-charts/components/line-days-chart/line-days-chart-hint.directive.ts @@ -49,12 +49,12 @@ export class TuiLineDaysChartHint implements AfterContentInit { this.hovered$, ]) .pipe( - filter(result => !result.some(Boolean)), + filter((result) => !result.some(Boolean)), tuiZonefree(this.zone), takeUntilDestroyed(this.destroyRef), ) .subscribe(() => { - this.charts.forEach(chart => chart.onHovered(NaN)); + this.charts.forEach((chart) => chart.onHovered(NaN)); }); } @@ -82,7 +82,7 @@ export class TuiLineDaysChartHint implements AfterContentInit { (map, [day]) => map.set( String(day), - values.map(value => find(value, day)), + values.map((value) => find(value, day)), ), new Map>(), ); diff --git a/projects/addon-charts/components/line-days-chart/line-days-chart.component.ts b/projects/addon-charts/components/line-days-chart/line-days-chart.component.ts index 939569442c70..a89279b9e9d2 100644 --- a/projects/addon-charts/components/line-days-chart/line-days-chart.component.ts +++ b/projects/addon-charts/components/line-days-chart/line-days-chart.component.ts @@ -110,7 +110,7 @@ export class TuiLineDaysChart implements AfterViewInit { public ngAfterViewInit(): void { combineLatest([tuiLineChartDrivers(this.charts), this.hovered$]) .pipe( - filter(result => !result.some(Boolean)), + filter((result) => !result.some(Boolean)), tuiZonefree(this.zone), takeUntilDestroyed(this.destroyRef), ) @@ -121,7 +121,7 @@ export class TuiLineDaysChart implements AfterViewInit { public onHovered(day: TuiDay | number): void { if (tuiIsNumber(day)) { - this.charts.forEach(chart => chart.onHovered(NaN)); + this.charts.forEach((chart) => chart.onHovered(NaN)); return; } @@ -130,9 +130,9 @@ export class TuiLineDaysChart implements AfterViewInit { const x = TuiDay.lengthBetween(this.value[0][0], day) + this.value[0][0].day - 1; const current = this.charts.get(index); - this.charts.forEach(chart => { + this.charts.forEach((chart) => { if (chart === current) { - current.onHovered(current.value.findIndex(point => point[0] === x)); + current.onHovered(current.value.findIndex((point) => point[0] === x)); } else { chart.onHovered(NaN); } @@ -161,7 +161,7 @@ export class TuiLineDaysChart implements AfterViewInit { return value[x - value[0][0].day + 1]; } - protected readonly daysStringify: TuiStringHandler = index => + protected readonly daysStringify: TuiStringHandler = (index) => this.xStringify ? this.xStringify(this.getDay(index)) : ''; protected getX(index: number): number { @@ -205,7 +205,7 @@ export class TuiLineDaysChart implements AfterViewInit { {length: TuiMonth.lengthBetween(value[0][0], value[value.length - 1][0]) + 1}, (_, i) => i + value[0][0].month + value[0][0].year * 12, ) - .map(absoluteMonth => + .map((absoluteMonth) => value .map(([{month, year}, y], index) => month + year * 12 === absoluteMonth ? [index + offset, y] : null, @@ -217,7 +217,7 @@ export class TuiLineDaysChart implements AfterViewInit { ? month : [ ...month, - array[index + 1].find(day => !Number.isNaN(day[1])) || DUMMY, + array[index + 1].find((day) => !Number.isNaN(day[1])) || DUMMY, ], ); } diff --git a/projects/addon-charts/components/pie-chart/pie-chart.directive.ts b/projects/addon-charts/components/pie-chart/pie-chart.directive.ts index 4d14c529f02d..434b496be5a0 100644 --- a/projects/addon-charts/components/pie-chart/pie-chart.directive.ts +++ b/projects/addon-charts/components/pie-chart/pie-chart.directive.ts @@ -32,13 +32,13 @@ export class TuiPieChartDirective { const endDelta = cur[1] - prev[1]; return animationFrame$.pipe( - map(timestamp => + map((timestamp) => tuiEaseInOutQuad( tuiClamp((timestamp - now) / tuiGetDuration(speed), 0, 1), ), ), - takeWhile(progress => progress < 1, true), - map(progress => [ + takeWhile((progress) => progress < 1, true), + map((progress) => [ prev[0] + startDelta * progress, cur[1] > 359 ? cur[1] : prev[1] + endDelta * progress, ]), diff --git a/projects/addon-charts/package.json b/projects/addon-charts/package.json index 4a71d9797633..0596a11fce06 100644 --- a/projects/addon-charts/package.json +++ b/projects/addon-charts/package.json @@ -19,7 +19,7 @@ "@ng-web-apis/common": "^4.1.2", "@taiga-ui/cdk": "^4.0.0-rc.2", "@taiga-ui/core": "^4.0.0-rc.2", - "@taiga-ui/polymorpheus": "^4.6.3", + "@taiga-ui/polymorpheus": "^4.6.4", "tslib": "^2.6.3" } } diff --git a/projects/addon-commerce/components/input-card-group/input-card-group.component.ts b/projects/addon-commerce/components/input-card-group/input-card-group.component.ts index 67b5e3856ea5..59ce0e8be988 100644 --- a/projects/addon-commerce/components/input-card-group/input-card-group.component.ts +++ b/projects/addon-commerce/components/input-card-group/input-card-group.component.ts @@ -163,7 +163,7 @@ export class TuiInputCardGroup protected readonly sub = inject(TuiDropdownOpen) .tuiDropdownOpenChange.pipe(takeUntilDestroyed()) - .subscribe(open => { + .subscribe((open) => { this.open.set(open); }); diff --git a/projects/addon-commerce/components/input-card/input-card.directive.ts b/projects/addon-commerce/components/input-card/input-card.directive.ts index 5299473ae6d6..1e7f20a359e2 100644 --- a/projects/addon-commerce/components/input-card/input-card.directive.ts +++ b/projects/addon-commerce/components/input-card/input-card.directive.ts @@ -43,7 +43,7 @@ export class TuiInputCard implements OnInit { @Output() public readonly binChange = timer(0).pipe( switchMap(() => tuiControlValue(this.control)), - map(value => (value.length < 6 ? null : value.replace(' ', '').slice(0, 6))), + map((value) => (value.length < 6 ? null : value.replace(' ', '').slice(0, 6))), startWith(null), distinctUntilChanged(), skip(1), diff --git a/projects/addon-commerce/constants/default-card-validator.ts b/projects/addon-commerce/constants/default-card-validator.ts index e3ba05c0750d..83fc82157f80 100644 --- a/projects/addon-commerce/constants/default-card-validator.ts +++ b/projects/addon-commerce/constants/default-card-validator.ts @@ -1,5 +1,5 @@ import {tuiIsCardLengthValid, tuiIsCardNumberValid} from '@taiga-ui/addon-commerce/utils'; import type {TuiBooleanHandler} from '@taiga-ui/cdk/types'; -export const tuiDefaultCardValidator: TuiBooleanHandler = card => +export const tuiDefaultCardValidator: TuiBooleanHandler = (card) => card.length > 11 && tuiIsCardLengthValid(card) && tuiIsCardNumberValid(card); diff --git a/projects/addon-commerce/constants/mask-card-holder.ts b/projects/addon-commerce/constants/mask-card-holder.ts index 7d07e9a9c65e..a1804aa921eb 100644 --- a/projects/addon-commerce/constants/mask-card-holder.ts +++ b/projects/addon-commerce/constants/mask-card-holder.ts @@ -33,7 +33,7 @@ function toEnglishUppercase(value: string): string { return value .toUpperCase() .split('') - .map(char => MAP[char] || char) + .map((char) => MAP[char] || char) .join(''); } diff --git a/projects/addon-commerce/constants/mask-cvc.ts b/projects/addon-commerce/constants/mask-cvc.ts index 5c4da57da15a..5b96ce456555 100644 --- a/projects/addon-commerce/constants/mask-cvc.ts +++ b/projects/addon-commerce/constants/mask-cvc.ts @@ -2,6 +2,6 @@ import type {MaskitoOptions} from '@maskito/core'; import {TUI_DIGIT_REGEXP} from '@taiga-ui/cdk/constants'; import type {TuiHandler} from '@taiga-ui/cdk/types'; -export const TUI_MASK_CVC: TuiHandler = length => ({ +export const TUI_MASK_CVC: TuiHandler = (length) => ({ mask: new Array(length).fill(TUI_DIGIT_REGEXP), }); diff --git a/projects/addon-commerce/package.json b/projects/addon-commerce/package.json index 4dd2ce6932ef..fa597e040b9e 100644 --- a/projects/addon-commerce/package.json +++ b/projects/addon-commerce/package.json @@ -25,7 +25,7 @@ "@taiga-ui/core": "^4.0.0-rc.2", "@taiga-ui/i18n": "^4.0.0-rc.2", "@taiga-ui/kit": "^4.0.0-rc.2", - "@taiga-ui/polymorpheus": "^4.6.3", + "@taiga-ui/polymorpheus": "^4.6.4", "rxjs": ">=7.0.0", "tslib": "^2.6.3" } diff --git a/projects/addon-commerce/pipes/amount/amount.pipe.ts b/projects/addon-commerce/pipes/amount/amount.pipe.ts index 95b141c682df..4ffce2feb65c 100644 --- a/projects/addon-commerce/pipes/amount/amount.pipe.ts +++ b/projects/addon-commerce/pipes/amount/amount.pipe.ts @@ -25,7 +25,7 @@ export class TuiAmountPipe implements PipeTransform { currencyAlign: TuiHorizontalDirection = this.options.currencyAlign, ): Observable { return this.format.pipe( - map(format => { + map((format) => { const sign = tuiFormatSignSymbol(value, this.options.sign); const currencySymbol = tuiFormatCurrency(currency); const formatted = tuiFormatNumber(Math.abs(value), { diff --git a/projects/addon-doc/components/code/tests/code.component.spec.ts b/projects/addon-doc/components/code/tests/code.component.spec.ts index 19b11ce6d521..40a68b0b4f3a 100644 --- a/projects/addon-doc/components/code/tests/code.component.spec.ts +++ b/projects/addon-doc/components/code/tests/code.component.spec.ts @@ -99,7 +99,7 @@ describe('TuiDocCodeComponent', () => { async function waitHighlightJsParseContent(): Promise { await fixture?.whenStable(); fixture.detectChanges(); - await new Promise(resolve => { + await new Promise((resolve) => { setTimeout(resolve, 100); }); } diff --git a/projects/addon-doc/components/documentation/documentation.component.ts b/projects/addon-doc/components/documentation/documentation.component.ts index 3fee87ab1cf6..0c8c8e4f0db4 100644 --- a/projects/addon-doc/components/documentation/documentation.component.ts +++ b/projects/addon-doc/components/documentation/documentation.component.ts @@ -121,7 +121,7 @@ export class TuiDocDocumentation implements AfterContentInit { public ngAfterContentInit(): void { tuiQueryListChanges(this.propertiesConnectors) .pipe( - switchMap(items => merge(...items.map(({changed$}) => changed$))), + switchMap((items) => merge(...items.map(({changed$}) => changed$))), tuiWatch(this.cdr), takeUntilDestroyed(this.destroyRef), ) diff --git a/projects/addon-doc/components/documentation/pipes/color.pipe.ts b/projects/addon-doc/components/documentation/pipes/color.pipe.ts index 36d616f35a4b..4e0e4aee390e 100644 --- a/projects/addon-doc/components/documentation/pipes/color.pipe.ts +++ b/projects/addon-doc/components/documentation/pipes/color.pipe.ts @@ -30,7 +30,7 @@ export class TuiGetColorPipe implements PipeTransform { .replace(')', '') .replace(' ', '') .split(',') - .map(v => Number.parseInt(v, 10)) as [number, number, number]; + .map((v) => Number.parseInt(v, 10)) as [number, number, number]; return tuiRgbToHex(...parsed); } diff --git a/projects/addon-doc/components/example/example-get-tabs.pipe.ts b/projects/addon-doc/components/example/example-get-tabs.pipe.ts index 9588dbed17f2..d63b9558b71d 100644 --- a/projects/addon-doc/components/example/example-get-tabs.pipe.ts +++ b/projects/addon-doc/components/example/example-get-tabs.pipe.ts @@ -7,6 +7,6 @@ import {Pipe} from '@angular/core'; }) export class TuiDocExampleGetTabsPipe implements PipeTransform { public transform(content: Record, defaultTab: string): string[] { - return [defaultTab, ...Object.keys(content).filter(tab => content[tab])]; + return [defaultTab, ...Object.keys(content).filter((tab) => content[tab])]; } } diff --git a/projects/addon-doc/components/example/example.component.ts b/projects/addon-doc/components/example/example.component.ts index 28d7a7ead131..f1a26e70fc02 100644 --- a/projects/addon-doc/components/example/example.component.ts +++ b/projects/addon-doc/components/example/example.component.ts @@ -95,12 +95,12 @@ export class TuiDocExample { protected readonly processor$: Observable> = this.rawLoader$$.pipe( switchMap(tuiRawLoadRecord), - map(value => this.processContent(value)), + map((value) => this.processContent(value)), ); protected readonly lazyComponent$ = this.lazyLoader$$.pipe( switchAll(), - map(module => new PolymorpheusComponent(module.default)), + map((module) => new PolymorpheusComponent(module.default)), ); @Input() diff --git a/projects/addon-doc/components/example/example.options.ts b/projects/addon-doc/components/example/example.options.ts index 280b50a443b6..1a2e290bff46 100644 --- a/projects/addon-doc/components/example/example.options.ts +++ b/projects/addon-doc/components/example/example.options.ts @@ -11,7 +11,7 @@ export interface TuiDocExampleOptions { } export const TUI_DOC_EXAMPLE_DEFAULT_OPTIONS: TuiDocExampleOptions = { - codeEditorVisibilityHandler: files => + codeEditorVisibilityHandler: (files) => Boolean( files[TUI_EXAMPLE_PRIMARY_FILE_NAME.TS] && files[TUI_EXAMPLE_PRIMARY_FILE_NAME.HTML], diff --git a/projects/addon-doc/components/navigation/navigation.component.ts b/projects/addon-doc/components/navigation/navigation.component.ts index c0308e2cc213..ce7879dd02a7 100644 --- a/projects/addon-doc/components/navigation/navigation.component.ts +++ b/projects/addon-doc/components/navigation/navigation.component.ts @@ -101,8 +101,8 @@ export class TuiDocNavigation { protected readonly search = new FormControl(''); protected readonly filtered$ = tuiControlValue(this.search).pipe( - filter(search => search.trim().length > 2), - map(search => this.filterItems(this.flattenSubPages(this.items), search)), + filter((search) => search.trim().length > 2), + map((search) => this.filterItems(this.flattenSubPages(this.items), search)), ); constructor() { @@ -111,7 +111,7 @@ export class TuiDocNavigation { inject(NAVIGATION_TITLE) .pipe(tuiWatch(inject(ChangeDetectorRef)), takeUntilDestroyed()) - .subscribe(title => { + .subscribe((title) => { titleService.setTitle(title); this.openActivePageGroup(); }); @@ -130,7 +130,7 @@ export class TuiDocNavigation { filter(Boolean), takeUntilDestroyed(), ) - .subscribe(anchor => this.navigateToAnchorLink(anchor)); + .subscribe((anchor) => this.navigateToAnchorLink(anchor)); } protected get canOpen(): boolean { @@ -169,7 +169,7 @@ export class TuiDocNavigation { items: ReadonlyArray, search: string, ): ReadonlyArray { - return items.map(section => + return items.map((section) => tuiUniqBy( section.filter(({title, keywords = ''}) => { search = search.toLowerCase().trim(); @@ -184,7 +184,7 @@ export class TuiDocNavigation { search.replaceAll('-', '').includes(title) || title.includes(search.replaceAll(/\s|tui/g, '')) || keywords.includes(search.replaceAll(/\s|tui/g, '')) || - search.split(/\s/).find(word => title.includes(word)) + search.split(/\s/).find((word) => title.includes(word)) ); }), 'title', @@ -229,7 +229,7 @@ export class TuiDocNavigation { } if ('subPages' in page) { - page.subPages.forEach(subPage => { + page.subPages.forEach((subPage) => { if (this.isActiveRoute(subPage.route)) { this.openPagesArr[pagesIndex] = true; this.openPagesGroupsArr[pagesIndex * 100 + pageIndex] = true; diff --git a/projects/addon-doc/components/navigation/navigation.providers.ts b/projects/addon-doc/components/navigation/navigation.providers.ts index 76dc2b90855f..7fd684db5977 100644 --- a/projects/addon-doc/components/navigation/navigation.providers.ts +++ b/projects/addon-doc/components/navigation/navigation.providers.ts @@ -47,7 +47,7 @@ export const NAVIGATION_PROVIDERS: Provider[] = [ titlePrefix: string, ): Observable => router.events.pipe( - filter(event => event instanceof NavigationEnd), + filter((event) => event instanceof NavigationEnd), map(() => activatedRoute.firstChild), filter(tuiIsPresent), mergeMap(({data}) => data), @@ -67,8 +67,8 @@ export const NAVIGATION_PROVIDERS: Provider[] = [ const labels = labelsProviderFactory(pages); return [ - ...labels.map(label => pages.filter(({section}) => section === label)), - pages.filter(page => !page.section), + ...labels.map((label) => pages.filter(({section}) => section === label)), + pages.filter((page) => !page.section), ]; }, }, diff --git a/projects/addon-doc/components/navigation/scroll-into-view.directive.ts b/projects/addon-doc/components/navigation/scroll-into-view.directive.ts index a7228cd4d02c..4ca4938aeda8 100644 --- a/projects/addon-doc/components/navigation/scroll-into-view.directive.ts +++ b/projects/addon-doc/components/navigation/scroll-into-view.directive.ts @@ -17,7 +17,7 @@ export class TuiDocScrollIntoViewLink { filter(Boolean), switchMap(() => this.scroll$), debounceTime(750), - filter(shallWe => shallWe && !!tuiGetElementObscures(this.el)), + filter((shallWe) => shallWe && !!tuiGetElementObscures(this.el)), takeUntilDestroyed(), ) .subscribe(() => this.el.scrollIntoView()); diff --git a/projects/addon-doc/components/page/page.providers.ts b/projects/addon-doc/components/page/page.providers.ts index a11a6b385cee..8a1bc95a393f 100644 --- a/projects/addon-doc/components/page/page.providers.ts +++ b/projects/addon-doc/components/page/page.providers.ts @@ -17,13 +17,13 @@ export const PAGE_PROVIDERS: Provider[] = [ ): readonly string[] => { const currentHeader = nativeElement.getAttribute('header'); const groups = - seeAlsoGroups.filter(group => group.includes(currentHeader)) || []; + seeAlsoGroups.filter((group) => group.includes(currentHeader)) || []; const seeAlsoSet = new Set( groups .join() .split(',') - .filter(component => component && component !== currentHeader), + .filter((component) => component && component !== currentHeader), ); return Array.from(seeAlsoSet); diff --git a/projects/addon-doc/package.json b/projects/addon-doc/package.json index 10980430bc76..e48cf4e03f43 100644 --- a/projects/addon-doc/package.json +++ b/projects/addon-doc/package.json @@ -32,7 +32,7 @@ "@taiga-ui/cdk": "^4.0.0-rc.2", "@taiga-ui/core": "^4.0.0-rc.2", "@taiga-ui/kit": "^4.0.0-rc.2", - "@taiga-ui/polymorpheus": "^4.6.3", + "@taiga-ui/polymorpheus": "^4.6.4", "tslib": "^2.6.3" } } diff --git a/projects/addon-doc/pipes/markdown/markdown.pipe.ts b/projects/addon-doc/pipes/markdown/markdown.pipe.ts index cae14ba599a1..e1e7fd1a5bb8 100644 --- a/projects/addon-doc/pipes/markdown/markdown.pipe.ts +++ b/projects/addon-doc/pipes/markdown/markdown.pipe.ts @@ -19,7 +19,7 @@ export class TuiDocMarkdownPipe implements PipeTransform { return of(value).pipe( switchMap(tuiRawLoad), map(mapper), - switchMap(async markdown => + switchMap(async (markdown) => marked .use({ async: true, diff --git a/projects/addon-doc/utils/sort-pages.ts b/projects/addon-doc/utils/sort-pages.ts index b7c42bf291bd..accb165fa13c 100644 --- a/projects/addon-doc/utils/sort-pages.ts +++ b/projects/addon-doc/utils/sort-pages.ts @@ -6,7 +6,7 @@ export function tuiSortPages( pages: readonly T[], excludeSections = new Set(), ): readonly T[] { - const sections = Array.from(new Set(pages.map(page => page.section))); + const sections = Array.from(new Set(pages.map((page) => page.section))); const sortedPages = pages.slice().sort((a, b) => { if ( @@ -30,7 +30,7 @@ export function tuiSortPages( return a.title.localeCompare(b.title); }); - return sortedPages.map(page => + return sortedPages.map((page) => tuiIsRoutePageGroup(page) ? { ...page, diff --git a/projects/addon-doc/utils/to-flat-map-pages.ts b/projects/addon-doc/utils/to-flat-map-pages.ts index c7a857b01119..aeee91c1079f 100644 --- a/projects/addon-doc/utils/to-flat-map-pages.ts +++ b/projects/addon-doc/utils/to-flat-map-pages.ts @@ -15,9 +15,9 @@ function assertTitle(page: TuiDocRoutePage, map: Map): export function tuiToFlatMapPages(pages: TuiDocRoutePages): Map { const map = new Map(); - pages.forEach(page => { + pages.forEach((page) => { if ('subPages' in page) { - page.subPages.forEach(subPage => { + page.subPages.forEach((subPage) => { ngDevMode && assertTitle(subPage, map); map.set(subPage.title, subPage); }); diff --git a/projects/addon-doc/utils/type-reference-parser.ts b/projects/addon-doc/utils/type-reference-parser.ts index 6e101d1eedbc..bf6b5bf1c75d 100644 --- a/projects/addon-doc/utils/type-reference-parser.ts +++ b/projects/addon-doc/utils/type-reference-parser.ts @@ -11,8 +11,8 @@ export function tuiTypeReferenceParser(types: string): TuiDocTypeReferenceParsed types, ) .split('|') - .map(item => item.trim()) - : types.split('|').map(item => item.trim()); + .map((item) => item.trim()) + : types.split('|').map((item) => item.trim()); return escaped.reduce((result, type) => { let extracted = type.trim().replaceAll('readonly ', '').replaceAll('[]', ''); diff --git a/projects/addon-mobile/components/mobile-calendar/mobile-calendar.component.ts b/projects/addon-mobile/components/mobile-calendar/mobile-calendar.component.ts index 40ceb13c6995..bc302599fcd1 100644 --- a/projects/addon-mobile/components/mobile-calendar/mobile-calendar.component.ts +++ b/projects/addon-mobile/components/mobile-calendar/mobile-calendar.component.ts @@ -165,7 +165,7 @@ export class TuiMobileCalendar implements AfterViewInit { constructor() { inject(TUI_VALUE_STREAM) .pipe(takeUntilDestroyed()) - .subscribe(value => { + .subscribe((value) => { this.value = value; }); } @@ -255,7 +255,7 @@ export class TuiMobileCalendar implements AfterViewInit { protected readonly disabledItemHandlerMapper: TuiMapper< [TuiBooleanHandler, TuiDay, TuiDay], TuiBooleanHandler - > = (disabledItemHandler, min, max) => item => + > = (disabledItemHandler, min, max) => (item) => item.dayBefore(min) || (max !== null && item.dayAfter(max)) || disabledItemHandler(item); @@ -368,7 +368,7 @@ export class TuiMobileCalendar implements AfterViewInit { .pipe( // Ignore smooth scroll resulting from click on the exact year windowToggle(touchstart$, () => click$), - mergeMap(x => x), + mergeMap((x) => x), // Delay is required to run months scroll in the next frame to prevent flicker delay(0), map( @@ -379,10 +379,10 @@ export class TuiMobileCalendar implements AfterViewInit { Math.floor(YEARS_IN_ROW / 2) + STARTING_YEAR, ), - filter(activeYear => activeYear !== this.activeYear), + filter((activeYear) => activeYear !== this.activeYear), takeUntilDestroyed(this.destroyRef), ) - .subscribe(activeYear => { + .subscribe((activeYear) => { this.activeMonth += this.getMonthOffset(activeYear); this.activeYear = activeYear; this.scrollToActiveMonth(); diff --git a/projects/addon-mobile/components/pull-to-refresh/pull-to-refresh.component.ts b/projects/addon-mobile/components/pull-to-refresh/pull-to-refresh.component.ts index f0353b6f15ed..49c55295bea8 100644 --- a/projects/addon-mobile/components/pull-to-refresh/pull-to-refresh.component.ts +++ b/projects/addon-mobile/components/pull-to-refresh/pull-to-refresh.component.ts @@ -43,18 +43,18 @@ export class TuiPullToRefresh { ); protected readonly dropped$: Observable = this.pulling$.pipe( - map(distance => distance <= MICRO_OFFSET || distance === this.threshold), + map((distance) => distance <= MICRO_OFFSET || distance === this.threshold), distinctUntilChanged(), ); @Input() public styleHandler: TuiHandler | null> = this.isIOS - ? distance => ({top: tuiPx(distance / 2)}) + ? (distance) => ({top: tuiPx(distance / 2)}) : () => null; @Output() public readonly pulled: Observable = inject(TuiPullToRefreshService).pipe( - filter(distance => distance === this.threshold), + filter((distance) => distance === this.threshold), ); constructor() { diff --git a/projects/addon-mobile/components/pull-to-refresh/pull-to-refresh.service.ts b/projects/addon-mobile/components/pull-to-refresh/pull-to-refresh.service.ts index a3393618a9c4..13266374b588 100644 --- a/projects/addon-mobile/components/pull-to-refresh/pull-to-refresh.service.ts +++ b/projects/addon-mobile/components/pull-to-refresh/pull-to-refresh.service.ts @@ -43,13 +43,13 @@ export class TuiPullToRefreshService extends Observable { tuiTypedFromEvent(this.el, 'touchstart', {passive: true}).pipe( filter(() => !this.scrollRef.scrollTop), map(({touches}) => touches[0].clientY), - switchMap(start => + switchMap((start) => tuiTypedFromEvent(this.el, 'touchmove').pipe( tap((): void => { this.touched = true; }), map(({touches}) => touches[0].clientY - start), - filter(distance => distance > 0), + filter((distance) => distance > 0), takeUntil( tuiTypedFromEvent(this.el, 'touchend').pipe( tap((): void => { @@ -68,7 +68,7 @@ export class TuiPullToRefreshService extends Observable { : current + current * MICRO_OFFSET, 0, ), - takeWhile(distance => distance !== this.threshold, true), + takeWhile((distance) => distance !== this.threshold, true), startWith(0), ), ), @@ -79,6 +79,6 @@ export class TuiPullToRefreshService extends Observable { constructor() { const component = inject(TUI_PULL_TO_REFRESH_COMPONENT); - super(subscriber => (component ? this.pulling$ : EMPTY).subscribe(subscriber)); + super((subscriber) => (component ? this.pulling$ : EMPTY).subscribe(subscriber)); } } diff --git a/projects/addon-mobile/components/sheet-dialog/sheet-dialog.component.ts b/projects/addon-mobile/components/sheet-dialog/sheet-dialog.component.ts index 08e8386c64f6..a932b90116a8 100644 --- a/projects/addon-mobile/components/sheet-dialog/sheet-dialog.component.ts +++ b/projects/addon-mobile/components/sheet-dialog/sheet-dialog.component.ts @@ -80,7 +80,7 @@ export class TuiSheetDialogComponent implements AfterViewInit { protected readonly stuck$$ = this.stuck$ .pipe(takeUntilDestroyed()) - .subscribe(add => + .subscribe((add) => add ? this.el.classList.add('_stuck') : this.el.classList.remove('_stuck'), ); diff --git a/projects/addon-mobile/directives/elastic-sticky/elastic-sticky.service.ts b/projects/addon-mobile/directives/elastic-sticky/elastic-sticky.service.ts index 2f36458b0f90..9ff1f7d329c5 100644 --- a/projects/addon-mobile/directives/elastic-sticky/elastic-sticky.service.ts +++ b/projects/addon-mobile/directives/elastic-sticky/elastic-sticky.service.ts @@ -24,7 +24,7 @@ export class TuiElasticStickyService extends Observable { private readonly destroyRef = inject(DestroyRef); constructor() { - super(subscriber => { + super((subscriber) => { const subscription = new Subscription(); afterNextRender( diff --git a/projects/addon-mobile/directives/touchable/touchable.directive.ts b/projects/addon-mobile/directives/touchable/touchable.directive.ts index 92663faebd0c..895cb0618c54 100644 --- a/projects/addon-mobile/directives/touchable/touchable.directive.ts +++ b/projects/addon-mobile/directives/touchable/touchable.directive.ts @@ -43,7 +43,7 @@ export class TuiTouchable { .pipe( tap(() => this.onTouchStart()), map(({touches}) => touches[touches.length - 1].identifier), - switchMap(identifier => + switchMap((identifier) => race( tuiTypedFromEvent(this.el, 'touchmove', {passive: true}).pipe( filter(({touches}) => diff --git a/projects/addon-mobile/package.json b/projects/addon-mobile/package.json index 447de3fd7d5f..4236f98914b6 100644 --- a/projects/addon-mobile/package.json +++ b/projects/addon-mobile/package.json @@ -18,7 +18,7 @@ "@taiga-ui/cdk": "^4.0.0-rc.2", "@taiga-ui/core": "^4.0.0-rc.2", "@taiga-ui/kit": "^4.0.0-rc.2", - "@taiga-ui/polymorpheus": "^4.6.3", + "@taiga-ui/polymorpheus": "^4.6.4", "rxjs": ">=7.0.0", "tslib": "^2.6.3" } diff --git a/projects/addon-mobile/services/keyboard.service.ts b/projects/addon-mobile/services/keyboard.service.ts index 417c10592503..4ce2af9dc79c 100644 --- a/projects/addon-mobile/services/keyboard.service.ts +++ b/projects/addon-mobile/services/keyboard.service.ts @@ -12,7 +12,7 @@ export class TuiKeyboardService implements OnDestroy { private readonly sub = merge( fromEvent(this.doc, 'focusout'), fromEvent(this.doc, 'mousedown').pipe( - filter(e => Object.is(e.target, this.element)), + filter((e) => Object.is(e.target, this.element)), ), ).subscribe(() => { this.show(); diff --git a/projects/addon-table/components/reorder/reorder.component.ts b/projects/addon-table/components/reorder/reorder.component.ts index d4ec2d09e388..b88508e0d1ea 100644 --- a/projects/addon-table/components/reorder/reorder.component.ts +++ b/projects/addon-table/components/reorder/reorder.component.ts @@ -55,7 +55,7 @@ export class TuiReorderComponent { public set items(items: readonly T[]) { if ( items.length !== this.unsortedItems.length || - !items.every(item => this.unsortedItems.includes(item)) + !items.every((item) => this.unsortedItems.includes(item)) ) { this.unsortedItems = items; } @@ -94,7 +94,7 @@ export class TuiReorderComponent { protected toggle(toggled: T): void { this.enabled = this.isEnabled(toggled) - ? this.enabled.filter(item => item !== toggled) + ? this.enabled.filter((item) => item !== toggled) : this.enabled.concat(toggled); this.updateEnabled(); @@ -112,7 +112,7 @@ export class TuiReorderComponent { const newIndex = oldIndex + direction; const oldItem = Array.from(this.order.values()).findIndex( - item => item === newIndex, + (item) => item === newIndex, ); this.order.set(index, newIndex); @@ -138,7 +138,7 @@ export class TuiReorderComponent { } private updateEnabled(): void { - const enabled = this.getSortedItems().filter(item => this.isEnabled(item)); + const enabled = this.getSortedItems().filter((item) => this.isEnabled(item)); this.enabled = enabled; this.enabledChange.emit(enabled); diff --git a/projects/addon-table/components/table/directives/direction-order.directive.ts b/projects/addon-table/components/table/directives/direction-order.directive.ts index e35a2ea6f980..ca6de78c4314 100644 --- a/projects/addon-table/components/table/directives/direction-order.directive.ts +++ b/projects/addon-table/components/table/directives/direction-order.directive.ts @@ -12,7 +12,7 @@ export class TuiTableDirectionOrder { @Output() public readonly directionOrderChange = this.table.directionChange.pipe( - map(dir => (dir === 1 ? 'asc' : 'desc')), + map((dir) => (dir === 1 ? 'asc' : 'desc')), ); @Input() diff --git a/projects/addon-table/components/table/directives/sort-by.directive.ts b/projects/addon-table/components/table/directives/sort-by.directive.ts index f97c2ade7077..f4979f0899c0 100644 --- a/projects/addon-table/components/table/directives/sort-by.directive.ts +++ b/projects/addon-table/components/table/directives/sort-by.directive.ts @@ -22,7 +22,7 @@ export class TuiTableSortBy>> { // delay is for getting actual ContentChildren (sortables) https://github.com/angular/angular/issues/38976 delay(0), filter(() => !!this.sortables.length), - map(sorter => this.getKey(sorter)), + map((sorter) => this.getKey(sorter)), ); public tuiSortBy: string | keyof T | null = null; @@ -34,10 +34,10 @@ export class TuiTableSortBy>> { } protected checkSortables(): void { - this.sortables.forEach(s => s.check()); + this.sortables.forEach((s) => s.check()); } private getKey(sorter: TuiComparator | null): keyof T | null { - return this.sortables.find(s => s.sorter === sorter)?.key || null; + return this.sortables.find((s) => s.sorter === sorter)?.key || null; } } diff --git a/projects/addon-table/components/table/directives/stuck.directive.ts b/projects/addon-table/components/table/directives/stuck.directive.ts index 072e39f574c0..fc934f2d9bc8 100644 --- a/projects/addon-table/components/table/directives/stuck.directive.ts +++ b/projects/addon-table/components/table/directives/stuck.directive.ts @@ -23,7 +23,7 @@ import {catchError, distinctUntilChanged, EMPTY, map} from 'rxjs'; export class TuiStuck { protected readonly stuck = toSignal( inject(IntersectionObserverService).pipe( - map(entries => entries[entries.length - 1].intersectionRatio < 1), + map((entries) => entries[entries.length - 1].intersectionRatio < 1), distinctUntilChanged(), tuiWatch(inject(ChangeDetectorRef)), catchError(() => EMPTY), // SSR diff --git a/projects/addon-table/components/table/tr/tr.component.ts b/projects/addon-table/components/table/tr/tr.component.ts index eba2954cf8d4..3d3afae641ae 100644 --- a/projects/addon-table/components/table/tr/tr.component.ts +++ b/projects/addon-table/components/table/tr/tr.component.ts @@ -41,7 +41,7 @@ export class TuiTableTr>> protected readonly cells$ = this.contentReady$.pipe( switchMap(() => tuiQueryListChanges(this.cells)), - map(cells => + map((cells) => cells.reduce( (record, item) => ({...record, [item.tuiCell]: item}), {} as Record, @@ -52,8 +52,8 @@ export class TuiTableTr>> protected readonly item$ = this.contentReady$.pipe( switchMap(() => tuiQueryListChanges(this.body.rows)), map( - rows => - this.body.data[rows.findIndex(row => row === this)] as Record< + (rows) => + this.body.data[rows.findIndex((row) => row === this)] as Record< string | keyof T, any >, diff --git a/projects/addon-table/directives/table-filters/table-filters.directive.ts b/projects/addon-table/directives/table-filters/table-filters.directive.ts index 2a4dc2da9b57..b05e4d58e290 100644 --- a/projects/addon-table/directives/table-filters/table-filters.directive.ts +++ b/projects/addon-table/directives/table-filters/table-filters.directive.ts @@ -19,7 +19,7 @@ export class TuiTableFiltersDirective { } public unregister(filter: TuiTableFilter): void { - this.filters = this.filters.filter(item => item !== filter); + this.filters = this.filters.filter((item) => item !== filter); this.update(); } @@ -27,12 +27,12 @@ export class TuiTableFiltersDirective { return this.refresh$.pipe( switchMap(identity), startWith(null), - map(() => items.filter(item => this.check(item))), + map(() => items.filter((item) => this.check(item))), ); } private check(item: T): boolean { - return this.filters.every(filter => filter.filter(item)); + return this.filters.every((filter) => filter.filter(item)); } private update(): void { diff --git a/projects/addon-table/package.json b/projects/addon-table/package.json index 55049ef360c6..60dccbd6bbf0 100644 --- a/projects/addon-table/package.json +++ b/projects/addon-table/package.json @@ -20,7 +20,7 @@ "@taiga-ui/core": "^4.0.0-rc.2", "@taiga-ui/i18n": "^4.0.0-rc.2", "@taiga-ui/kit": "^4.0.0-rc.2", - "@taiga-ui/polymorpheus": "^4.6.3", + "@taiga-ui/polymorpheus": "^4.6.4", "rxjs": ">=7.0.0", "tslib": "^2.6.3" } diff --git a/projects/cdk/classes/control.ts b/projects/cdk/classes/control.ts index 00ff7d73bf45..4c25eae9ee71 100644 --- a/projects/cdk/classes/control.ts +++ b/projects/cdk/classes/control.ts @@ -74,7 +74,9 @@ export abstract class TuiControl implements ControlValueAccessor { map(() => this.control.control), filter(tuiIsPresent), distinctUntilChanged(), - switchMap(control => merge(control.valueChanges, control.statusChanges)), + switchMap((control) => + merge(control.valueChanges, control.statusChanges), + ), takeUntilDestroyed(this.destroyRef), ) .subscribe(() => { diff --git a/projects/cdk/constants/test/matchers.spec.ts b/projects/cdk/constants/test/matchers.spec.ts index 92585f6f9d31..b4f0a53141fa 100644 --- a/projects/cdk/constants/test/matchers.spec.ts +++ b/projects/cdk/constants/test/matchers.spec.ts @@ -20,7 +20,7 @@ describe('Matcher functions', () => { const defaultMatcher = TUI_DEFAULT_MATCHER; const strictMatcher = TUI_STRICT_MATCHER; const identityMatcher = TUI_DEFAULT_IDENTITY_MATCHER; - const stringify: TuiStringHandler = item => item.price.toString(); + const stringify: TuiStringHandler = (item) => item.price.toString(); const search = 'HOLY GRAIL'; const item = new Item('Monty Python and the Holy Grail DVD', 99); diff --git a/projects/cdk/directives/active-zone/active-zone.directive.ts b/projects/cdk/directives/active-zone/active-zone.directive.ts index 670c7d0dfa25..cbb7e08cb4ee 100644 --- a/projects/cdk/directives/active-zone/active-zone.directive.ts +++ b/projects/cdk/directives/active-zone/active-zone.directive.ts @@ -30,11 +30,11 @@ export class TuiActiveZone implements OnDestroy { @Output() public readonly tuiActiveZoneChange = this.active$.pipe( - map(element => !!element && this.contains(element)), + map((element) => !!element && this.contains(element)), startWith(false), distinctUntilChanged(), skip(1), - tap(active => { + tap((active) => { if (!active && typeof this.control?.valueAccessor.onTouched === 'function') { this.control.valueAccessor.onTouched(); } diff --git a/projects/cdk/directives/auto-focus/handlers/ios.handler.ts b/projects/cdk/directives/auto-focus/handlers/ios.handler.ts index fda964f03600..b53523be68b4 100644 --- a/projects/cdk/directives/auto-focus/handlers/ios.handler.ts +++ b/projects/cdk/directives/auto-focus/handlers/ios.handler.ts @@ -141,7 +141,7 @@ export class TuiIosAutofocusHandler extends AbstractTuiAutofocusHandler { * so that when focusing the dialogs don't shake */ private patchCssStyles(): void { - [this.win.document.documentElement, this.win.document.body].forEach(element => { + [this.win.document.documentElement, this.win.document.body].forEach((element) => { element.style.setProperty('overflow', 'auto'); element.style.setProperty('height', '100%'); }); @@ -154,7 +154,7 @@ export class TuiIosAutofocusHandler extends AbstractTuiAutofocusHandler { * for example [inputMode=numeric, autocomplete=cc-number] */ private patchFakeInputFromFocusableElement(fakeInput: HTMLInputElement): void { - TEXTFIELD_ATTRS.forEach(attr => { + TEXTFIELD_ATTRS.forEach((attr) => { const value = this.element.getAttribute(attr); if (tuiIsPresent(value)) { diff --git a/projects/cdk/directives/click-outside/click-outside.directive.ts b/projects/cdk/directives/click-outside/click-outside.directive.ts index f165b5a77560..45e81f627cb3 100644 --- a/projects/cdk/directives/click-outside/click-outside.directive.ts +++ b/projects/cdk/directives/click-outside/click-outside.directive.ts @@ -24,7 +24,7 @@ export class TuiClickOutside { 'mouseup', ).pipe( map(tuiGetActualTarget), - filter(target => this.isOutside(target)), + filter((target) => this.isOutside(target)), tuiZoneOptimized(this.zone), ); diff --git a/projects/cdk/directives/droppable/droppable.directive.ts b/projects/cdk/directives/droppable/droppable.directive.ts index 7ec998216520..636a380e44d0 100644 --- a/projects/cdk/directives/droppable/droppable.directive.ts +++ b/projects/cdk/directives/droppable/droppable.directive.ts @@ -17,7 +17,7 @@ export class TuiDroppable { @Output() public readonly tuiDroppableDropped = tuiTypedFromEvent(this.el, 'drop').pipe( tuiPreventDefault(), - map(event => event.dataTransfer), + map((event) => event.dataTransfer), filter(tuiIsPresent), ); @@ -29,7 +29,7 @@ export class TuiDroppable { switchMap(({target, dataTransfer}) => merge( tuiTypedFromEvent(this.el, 'dragleave').pipe( - filter(event => event.target === target), + filter((event) => event.target === target), ), tuiTypedFromEvent(this.el, 'drop'), ).pipe( diff --git a/projects/cdk/directives/hovered/hovered.service.ts b/projects/cdk/directives/hovered/hovered.service.ts index 5c3f39bfe622..2d4340ff65c8 100644 --- a/projects/cdk/directives/hovered/hovered.service.ts +++ b/projects/cdk/directives/hovered/hovered.service.ts @@ -31,7 +31,7 @@ export class TuiHoveredService extends Observable { ).pipe(distinctUntilChanged(), tuiZoneOptimized(this.zone)); constructor() { - super(subscriber => this.stream$.subscribe(subscriber)); + super((subscriber) => this.stream$.subscribe(subscriber)); } } diff --git a/projects/cdk/directives/obscured/obscured.directive.ts b/projects/cdk/directives/obscured/obscured.directive.ts index 3e9c4142fbfa..cc956b826926 100644 --- a/projects/cdk/directives/obscured/obscured.directive.ts +++ b/projects/cdk/directives/obscured/obscured.directive.ts @@ -17,7 +17,7 @@ export class TuiObscured { private readonly activeZone = inject(TuiActiveZone, {optional: true}); private readonly enabled$ = new Subject(); private readonly obscured$ = inject(TuiObscuredService, {self: true}).pipe( - map(by => !!by?.every(el => !this.activeZone?.contains(el))), + map((by) => !!by?.every((el) => !this.activeZone?.contains(el))), ); @Output() diff --git a/projects/cdk/directives/obscured/obscured.service.ts b/projects/cdk/directives/obscured/obscured.service.ts index 3ddf12fa3568..ee04f40e1345 100644 --- a/projects/cdk/directives/obscured/obscured.service.ts +++ b/projects/cdk/directives/obscured/obscured.service.ts @@ -20,6 +20,6 @@ export class TuiObscuredService extends Observable { ); constructor() { - super(subscriber => this.obscured$.subscribe(subscriber)); + super((subscriber) => this.obscured$.subscribe(subscriber)); } } diff --git a/projects/cdk/directives/pan/pan.service.ts b/projects/cdk/directives/pan/pan.service.ts index eec08856233c..324990b4b4c2 100644 --- a/projects/cdk/directives/pan/pan.service.ts +++ b/projects/cdk/directives/pan/pan.service.ts @@ -19,7 +19,7 @@ export class TuiPanService extends Observable { const el = tuiInjectElement(); const doc = inject(DOCUMENT); - super(subscriber => { + super((subscriber) => { merge( tuiTypedFromEvent(el, 'touchstart', {passive: true}), tuiTypedFromEvent(el, 'mousedown'), diff --git a/projects/cdk/directives/swipe/swipe.service.ts b/projects/cdk/directives/swipe/swipe.service.ts index ac1ede127610..b734cf2719f3 100644 --- a/projects/cdk/directives/swipe/swipe.service.ts +++ b/projects/cdk/directives/swipe/swipe.service.ts @@ -15,7 +15,7 @@ export class TuiSwipeService extends Observable { const el = tuiInjectElement(); const {timeout, threshold} = inject(TUI_SWIPE_OPTIONS); - super(subscriber => { + super((subscriber) => { merge( tuiTypedFromEvent(el, 'touchstart', {passive: true}), tuiTypedFromEvent(doc, 'touchend'), diff --git a/projects/cdk/directives/zoom/zoom.service.ts b/projects/cdk/directives/zoom/zoom.service.ts index ffcc86149cfe..f85e460b1f79 100644 --- a/projects/cdk/directives/zoom/zoom.service.ts +++ b/projects/cdk/directives/zoom/zoom.service.ts @@ -14,11 +14,11 @@ export class TuiZoomService extends Observable { const el = tuiInjectElement(); const {wheelSensitivity} = inject(TUI_ZOOM_OPTIONS); - super(subscriber => { + super((subscriber) => { merge( tuiTypedFromEvent(el, 'touchstart', {passive: true}).pipe( filter(({touches}) => touches.length > 1), - switchMap(startEvent => + switchMap((startEvent) => tuiTypedFromEvent(el, 'touchmove', {passive: true}).pipe( tuiPreventDefault(), scan( @@ -57,7 +57,7 @@ export class TuiZoomService extends Observable { ), tuiTypedFromEvent(el, 'wheel', {passive: false}).pipe( tuiPreventDefault(), - map(wheel => ({ + map((wheel) => ({ clientX: wheel.clientX, clientY: wheel.clientY, delta: -wheel.deltaY * wheelSensitivity, diff --git a/projects/cdk/observables/control-value.ts b/projects/cdk/observables/control-value.ts index 4f462fce1ad9..77448960814c 100644 --- a/projects/cdk/observables/control-value.ts +++ b/projects/cdk/observables/control-value.ts @@ -9,7 +9,7 @@ import {Observable, startWith} from 'rxjs'; export function tuiControlValue( control: AbstractControl | AbstractControlDirective | null, ): Observable { - return new Observable(subscriber => { + return new Observable((subscriber) => { if (!control?.valueChanges) { throw new TuiValueChangesException(); } diff --git a/projects/cdk/observables/drag-and-drop-from.ts b/projects/cdk/observables/drag-and-drop-from.ts index e9982600029a..8b26395ebdb2 100644 --- a/projects/cdk/observables/drag-and-drop-from.ts +++ b/projects/cdk/observables/drag-and-drop-from.ts @@ -19,18 +19,18 @@ export function tuiDragAndDropFrom(element: Element): Observable { return concat( tuiTypedFromEvent(element, 'mousedown').pipe( take(1), - map(event => new TuiDragState('start', event)), + map((event) => new TuiDragState('start', event)), ), merge( tuiTypedFromEvent(ownerDocument, 'mousemove').pipe( - map(event => new TuiDragState('continues', event)), + map((event) => new TuiDragState('continues', event)), ), merge( tuiTypedFromEvent(ownerDocument, 'mouseup'), tuiTypedFromEvent(ownerDocument, 'dragend'), ).pipe( take(1), - map(event => new TuiDragState('end', event)), + map((event) => new TuiDragState('end', event)), endWith(null), ), ).pipe(takeWhile(tuiIsPresent)), diff --git a/projects/cdk/observables/events.ts b/projects/cdk/observables/events.ts index 14299f666255..2363a6207230 100644 --- a/projects/cdk/observables/events.ts +++ b/projects/cdk/observables/events.ts @@ -2,9 +2,9 @@ import type {MonoTypeOperatorFunction} from 'rxjs'; import {tap} from 'rxjs'; export function tuiPreventDefault(): MonoTypeOperatorFunction { - return tap(event => event.preventDefault()); + return tap((event) => event.preventDefault()); } export function tuiStopPropagation(): MonoTypeOperatorFunction { - return tap(event => event.stopPropagation()); + return tap((event) => event.stopPropagation()); } diff --git a/projects/cdk/observables/if-map.ts b/projects/cdk/observables/if-map.ts index a4d3494d928a..9e937ebd5ece 100644 --- a/projects/cdk/observables/if-map.ts +++ b/projects/cdk/observables/if-map.ts @@ -6,5 +6,5 @@ export function tuiIfMap( project: (value: T) => Observable, predicate: TuiBooleanHandler = Boolean, ): OperatorFunction { - return pipe(switchMap(value => (predicate(value) ? project(value) : EMPTY))); + return pipe(switchMap((value) => (predicate(value) ? project(value) : EMPTY))); } diff --git a/projects/cdk/observables/must-be-present.ts b/projects/cdk/observables/must-be-present.ts index 9fc8fa9cf26d..48717c812eb5 100644 --- a/projects/cdk/observables/must-be-present.ts +++ b/projects/cdk/observables/must-be-present.ts @@ -5,7 +5,7 @@ import type {OperatorFunction} from 'rxjs'; import {map} from 'rxjs'; export function tuiMustBePresent(): OperatorFunction { - return map(value => { + return map((value) => { if (!tuiIsPresent(value)) { throw new TuiValuePresentException(); } diff --git a/projects/cdk/observables/test/control-value.spec.ts b/projects/cdk/observables/test/control-value.spec.ts index f99acc5401f4..138665faae8e 100644 --- a/projects/cdk/observables/test/control-value.spec.ts +++ b/projects/cdk/observables/test/control-value.spec.ts @@ -10,7 +10,7 @@ describe('tuiControlValue', () => { let actual = ''; const control = new FormControl('hello'); - tuiControlValue(control).subscribe(value => { + tuiControlValue(control).subscribe((value) => { actual = value; }); @@ -23,7 +23,7 @@ describe('tuiControlValue', () => { tuiControlValue(control) .pipe(skip(1)) - .subscribe(value => { + .subscribe((value) => { actual = value; }); diff --git a/projects/cdk/observables/test/drag-and-drop.spec.ts b/projects/cdk/observables/test/drag-and-drop.spec.ts index c30a29fa2b98..e7192cb40c40 100644 --- a/projects/cdk/observables/test/drag-and-drop.spec.ts +++ b/projects/cdk/observables/test/drag-and-drop.spec.ts @@ -21,7 +21,7 @@ describe('tuiDragAndDropFrom', () => { tuiDragAndDropFrom(element) .pipe(take(1)) - .subscribe(event => { + .subscribe((event) => { result = event.stage; }); @@ -36,7 +36,7 @@ describe('tuiDragAndDropFrom', () => { tuiDragAndDropFrom(element) .pipe(skip(1), take(1)) - .subscribe(event => { + .subscribe((event) => { result = event.stage; }); @@ -51,7 +51,7 @@ describe('tuiDragAndDropFrom', () => { tuiDragAndDropFrom(element) .pipe(skip(2), take(1)) - .subscribe(event => { + .subscribe((event) => { result = event.stage; }); diff --git a/projects/cdk/observables/test/query-list-changes.spec.ts b/projects/cdk/observables/test/query-list-changes.spec.ts index 9738652c17ac..f81fb110435b 100644 --- a/projects/cdk/observables/test/query-list-changes.spec.ts +++ b/projects/cdk/observables/test/query-list-changes.spec.ts @@ -12,7 +12,7 @@ describe('tuiQueryListChanges', () => { it('emits current array on subscription', () => { let result: readonly number[] | null = null; - tuiQueryListChanges(queryList).subscribe(data => { + tuiQueryListChanges(queryList).subscribe((data) => { result = data; }); @@ -22,7 +22,7 @@ describe('tuiQueryListChanges', () => { it('emits new array on changes', () => { let result: readonly number[] | null = null; - tuiQueryListChanges(queryList).subscribe(data => { + tuiQueryListChanges(queryList).subscribe((data) => { result = data; }); diff --git a/projects/cdk/observables/zone.ts b/projects/cdk/observables/zone.ts index 3c6624f3d296..421101f4d261 100644 --- a/projects/cdk/observables/zone.ts +++ b/projects/cdk/observables/zone.ts @@ -3,10 +3,10 @@ import type {MonoTypeOperatorFunction} from 'rxjs'; import {Observable, pipe} from 'rxjs'; export function tuiZonefull(zone: NgZone): MonoTypeOperatorFunction { - return source => - new Observable(subscriber => + return (source) => + new Observable((subscriber) => source.subscribe({ - next: value => zone.run(() => subscriber.next(value)), + next: (value) => zone.run(() => subscriber.next(value)), error: (error: unknown) => zone.run(() => subscriber.error(error)), complete: () => zone.run(() => subscriber.complete()), }), @@ -14,8 +14,8 @@ export function tuiZonefull(zone: NgZone): MonoTypeOperatorFunction { } export function tuiZonefree(zone: NgZone): MonoTypeOperatorFunction { - return source => - new Observable(subscriber => + return (source) => + new Observable((subscriber) => zone.runOutsideAngular(() => source.subscribe(subscriber)), ); } diff --git a/projects/cdk/package.json b/projects/cdk/package.json index 21b0c768bd50..755509db754f 100644 --- a/projects/cdk/package.json +++ b/projects/cdk/package.json @@ -33,7 +33,7 @@ "@ng-web-apis/mutation-observer": "^4.1.2", "@ng-web-apis/resize-observer": "^4.1.2", "@taiga-ui/event-plugins": "^4.0.1", - "@taiga-ui/polymorpheus": "^4.6.3", + "@taiga-ui/polymorpheus": "^4.6.4", "rxjs": ">=7.0.0" }, "optionalDependencies": { diff --git a/projects/cdk/pipes/filter/filter.pipe.ts b/projects/cdk/pipes/filter/filter.pipe.ts index b0726cd1f1c6..2092220a310c 100644 --- a/projects/cdk/pipes/filter/filter.pipe.ts +++ b/projects/cdk/pipes/filter/filter.pipe.ts @@ -19,6 +19,6 @@ export class TuiFilterPipe implements PipeTransform { matcher: TuiMatcher<[T, ...U]>, ...args: U ): T[] { - return items.filter(item => matcher(item, ...args)); + return items.filter((item) => matcher(item, ...args)); } } diff --git a/projects/cdk/schematics/ng-add/index.ts b/projects/cdk/schematics/ng-add/index.ts index 828926702b36..9e215fead4cd 100644 --- a/projects/cdk/schematics/ng-add/index.ts +++ b/projects/cdk/schematics/ng-add/index.ts @@ -13,7 +13,7 @@ import type {TuiSchema} from './schema'; function addDependencies(tree: Tree, options: TuiSchema): void { const packages = [...MAIN_PACKAGES, ...options.addons]; - packages.forEach(pack => { + packages.forEach((pack) => { addPackageJsonDependency(tree, { name: `@taiga-ui/${pack}`, version: TAIGA_VERSION, diff --git a/projects/cdk/schematics/ng-add/steps/add-taiga-icons.ts b/projects/cdk/schematics/ng-add/steps/add-taiga-icons.ts index 79772eee4fc6..477aaa3f017b 100644 --- a/projects/cdk/schematics/ng-add/steps/add-taiga-icons.ts +++ b/projects/cdk/schematics/ng-add/steps/add-taiga-icons.ts @@ -17,7 +17,7 @@ export function addTaigaIcons(options: TuiSchema): Rule { } export function addTaigaAssetsToAngularJson(options: TuiSchema): Rule { - return updateWorkspace(workspace => { + return updateWorkspace((workspace) => { const project = getProjects(options, workspace)[0]; if (project) { diff --git a/projects/cdk/schematics/ng-add/steps/add-taiga-modules.ts b/projects/cdk/schematics/ng-add/steps/add-taiga-modules.ts index 5ce46fe1e9f7..8165aacdc2cb 100644 --- a/projects/cdk/schematics/ng-add/steps/add-taiga-modules.ts +++ b/projects/cdk/schematics/ng-add/steps/add-taiga-modules.ts @@ -41,13 +41,13 @@ function addTuiModules({ const modules = getModules([BROWSER_ANIMATION_MODULE]); const mainModulePath = mainClass.getSourceFile().getFilePath(); - modules.forEach(module => { + modules.forEach((module) => { addImportToNgModule(mainClass, module.name, {unique: true}); addUniqueImport(mainModulePath, module.name, module.packageName); }); context.logger.info( - `${modules.map(module => module.name)} was added to ${mainModulePath}`, + `${modules.map((module) => module.name)} was added to ${mainModulePath}`, ); } @@ -85,7 +85,7 @@ function addRootTuiProvidersToBootstrapFn( const provideAnimations = initializer .getElements() .find( - el => + (el) => Node.isCallExpression(el) && el.getExpression().getText() === 'provideAnimations', ); diff --git a/projects/cdk/schematics/ng-update/steps/icons/replace-imports.ts b/projects/cdk/schematics/ng-update/steps/icons/replace-imports.ts index e44512df3cfa..4fcb0089fb02 100644 --- a/projects/cdk/schematics/ng-update/steps/icons/replace-imports.ts +++ b/projects/cdk/schematics/ng-update/steps/icons/replace-imports.ts @@ -19,21 +19,21 @@ export function replaceImports( replaceable.forEach(({from, to}) => { const importDeclarations = allImports.filter( - declaration => + (declaration) => !declaration.wasForgotten() && declaration.getModuleSpecifierValue() === from.moduleSpecifier && declaration .getNamedImports() - .some(specifier => specifier.getName() === from.name), + .some((specifier) => specifier.getName() === from.name), ); - const namedImports = importDeclarations.map(declaration => + const namedImports = importDeclarations.map((declaration) => declaration .getNamedImports() - .find(specifier => specifier.getName() === from.name), + .find((specifier) => specifier.getName() === from.name), ); - namedImports.forEach(namedImport => { + namedImports.forEach((namedImport) => { if (Node.isImportSpecifier(namedImport) && !namedImport.wasForgotten()) { removeImport(namedImport); addUniqueImport( diff --git a/projects/cdk/schematics/ng-update/steps/remove-module.ts b/projects/cdk/schematics/ng-update/steps/remove-module.ts index a395358e6bdc..a6055839af3d 100644 --- a/projects/cdk/schematics/ng-update/steps/remove-module.ts +++ b/projects/cdk/schematics/ng-update/steps/remove-module.ts @@ -28,7 +28,7 @@ export function removeModules( export function removeModule(name: string, moduleSpecifier: string): void { const references = getNamedImportReferences(name, moduleSpecifier); - references.forEach(ref => { + references.forEach((ref) => { if (ref.wasForgotten()) { return; } @@ -38,7 +38,7 @@ export function removeModule(name: string, moduleSpecifier: string): void { if (Node.isImportSpecifier(parent)) { removeImport(parent); } else if (Node.isArrayLiteralExpression(parent)) { - const index = parent.getElements().findIndex(el => el.getText() === name); + const index = parent.getElements().findIndex((el) => el.getText() === name); parent.removeElement(index); } diff --git a/projects/cdk/schematics/ng-update/steps/rename-types.ts b/projects/cdk/schematics/ng-update/steps/rename-types.ts index 55cc9a3a8c16..87918a3c3863 100644 --- a/projects/cdk/schematics/ng-update/steps/rename-types.ts +++ b/projects/cdk/schematics/ng-update/steps/rename-types.ts @@ -23,7 +23,7 @@ function renameType( ): void { const references = getNamedImportReferences(from, moduleSpecifier); - references.forEach(ref => { + references.forEach((ref) => { if (ref.wasForgotten()) { return; } @@ -64,7 +64,7 @@ function removeGeneric(type: string): string { } function addGeneric(typeName: string, generics: TypeNode[]): string { - const typeArgs = generics.map(t => t.getType().getText()); + const typeArgs = generics.map((t) => t.getType().getText()); const genericType = typeArgs.length ? `<${typeArgs.join(', ')}>` : ''; return typeName + genericType; diff --git a/projects/cdk/schematics/ng-update/steps/replace-deep-import.ts b/projects/cdk/schematics/ng-update/steps/replace-deep-import.ts index 772e4e125b80..bf5ac563433e 100644 --- a/projects/cdk/schematics/ng-update/steps/replace-deep-import.ts +++ b/projects/cdk/schematics/ng-update/steps/replace-deep-import.ts @@ -20,11 +20,11 @@ export function replaceDeepImports(options: TuiSchema): void { !options['skip-logs'] && infoLog(`${SMALL_TAB_SYMBOL}${REPLACE_SYMBOL} replacing deep imports...`); - const deepImports = getImports(ALL_TS_FILES).filter(imp => + const deepImports = getImports(ALL_TS_FILES).filter((imp) => DEEP_REGEX.test(imp.getModuleSpecifier().getLiteralValue()), ); - editImports(deepImports, deepImport => { + editImports(deepImports, (deepImport) => { const specifier = deepImport.moduleSpecifier.replace(DEEP_REGEX, '$1'); return {moduleSpecifier: specifier}; diff --git a/projects/cdk/schematics/ng-update/steps/replace-enums.ts b/projects/cdk/schematics/ng-update/steps/replace-enums.ts index 26f1ddd82ca2..28a5a688d29a 100644 --- a/projects/cdk/schematics/ng-update/steps/replace-enums.ts +++ b/projects/cdk/schematics/ng-update/steps/replace-enums.ts @@ -43,7 +43,7 @@ function replaceEnumWithString( continue; } - const key = Object.keys(replaceValues).find(key => parent.getName() === key); + const key = Object.keys(replaceValues).find((key) => parent.getName() === key); if (key) { parent.replaceWithText(`'${replaceValues[key]}'`); @@ -55,7 +55,7 @@ function containTypeRef(node: ImportSpecifier): boolean { return node .getNameNode() .findReferencesAsNodes() - .some(ref => Node.isTypeReference(ref.getParent())); + .some((ref) => Node.isTypeReference(ref.getParent())); } export function replaceEnums(options: TuiSchema, enums: ReplacementEnum[]): void { diff --git a/projects/cdk/schematics/ng-update/steps/replace-identifier.ts b/projects/cdk/schematics/ng-update/steps/replace-identifier.ts index bbce856913c4..10b0735323d3 100644 --- a/projects/cdk/schematics/ng-update/steps/replace-identifier.ts +++ b/projects/cdk/schematics/ng-update/steps/replace-identifier.ts @@ -29,7 +29,7 @@ export function replaceIdentifiers( export function replaceIdentifier({from, to}: ReplacementIdentifierMulti): void { const references = getNamedImportReferences(from.name, from.moduleSpecifier); - references.forEach(ref => { + references.forEach((ref) => { if (ref.wasForgotten()) { return; } diff --git a/projects/cdk/schematics/ng-update/steps/replace-services.ts b/projects/cdk/schematics/ng-update/steps/replace-services.ts index 429a26e2c1ca..369597aab872 100644 --- a/projects/cdk/schematics/ng-update/steps/replace-services.ts +++ b/projects/cdk/schematics/ng-update/steps/replace-services.ts @@ -27,7 +27,7 @@ function replaceService( const references = getNamedImportReferences(from.name, from.moduleSpecifier); - references.forEach(ref => { + references.forEach((ref) => { if (ref.wasForgotten()) { return; } @@ -60,7 +60,7 @@ function replaceProperties( const statement = parent.getParent(); const identifier = statement.getChildrenOfKind(SyntaxKind.Identifier)[0]; - identifier?.findReferencesAsNodes().forEach(ref => { + identifier?.findReferencesAsNodes().forEach((ref) => { let parent = ref.getParent(); if ( @@ -83,9 +83,9 @@ function replaceProperty( ): void { const identifiers = node.getChildrenOfKind(SyntaxKind.Identifier); - identifiers.forEach(identifier => { + identifiers.forEach((identifier) => { const property = properties?.find( - property => property.from === identifier.getText(), + (property) => property.from === identifier.getText(), ); if (property) { @@ -101,7 +101,7 @@ export function replaceServices( !options['skip-logs'] && infoLog(`${SMALL_TAB_SYMBOL}${REPLACE_SYMBOL} replacing services...`); - services.forEach(service => replaceService(service, options)); + services.forEach((service) => replaceService(service, options)); !options['skip-logs'] && successLog(`${SMALL_TAB_SYMBOL}${SUCCESS_SYMBOL} services replaced \n`); diff --git a/projects/cdk/schematics/ng-update/steps/show-warnings.ts b/projects/cdk/schematics/ng-update/steps/show-warnings.ts index e23a0e8e0d8c..d8316bf94bb3 100644 --- a/projects/cdk/schematics/ng-update/steps/show-warnings.ts +++ b/projects/cdk/schematics/ng-update/steps/show-warnings.ts @@ -12,15 +12,15 @@ function showWarning( moduleSpecifier, namedImports: [name], }) - .map(i => + .map((i) => i .getNamedImports() - .find(namedImport => namedImport.getName() === name) + .find((namedImport) => namedImport.getName() === name) ?.getNameNode(), ) .filter((namedImport?: T): namedImport is T => Boolean(namedImport)); - const referencesMeta = references.map(ref => { + const referencesMeta = references.map((ref) => { const sourceFile = ref.getSourceFile(); return { @@ -45,5 +45,5 @@ export function showWarnings( context: SchematicContext, warnings: readonly MigrationWarning[], ): void { - warnings.forEach(warning => showWarning(warning, context)); + warnings.forEach((warning) => showWarning(warning, context)); } diff --git a/projects/cdk/schematics/ng-update/utils/replace-text.ts b/projects/cdk/schematics/ng-update/utils/replace-text.ts index a0c57164e932..0e874c455c91 100644 --- a/projects/cdk/schematics/ng-update/utils/replace-text.ts +++ b/projects/cdk/schematics/ng-update/utils/replace-text.ts @@ -8,7 +8,7 @@ export function replaceText( ): void { const sourceFiles = getSourceFiles(pattern); - sourceFiles.forEach(file => { + sourceFiles.forEach((file) => { let text = file.getFullText(); replaceable.forEach(({from, to}) => { diff --git a/projects/cdk/schematics/ng-update/utils/templates/replace-attr-values.ts b/projects/cdk/schematics/ng-update/utils/templates/replace-attr-values.ts index 9caa625b37bf..d50336df10e0 100644 --- a/projects/cdk/schematics/ng-update/utils/templates/replace-attr-values.ts +++ b/projects/cdk/schematics/ng-update/utils/templates/replace-attr-values.ts @@ -33,10 +33,10 @@ export function replaceAttrValues({ ), ]; - elements.forEach(element => { + elements.forEach((element) => { const {name, value} = - element.attrs.find(attr => - attrNames.map(name => name.toLowerCase()).includes(attr.name), + element.attrs.find((attr) => + attrNames.map((name) => name.toLowerCase()).includes(attr.name), ) || {}; if (!name || !value) { @@ -44,7 +44,7 @@ export function replaceAttrValues({ } const attributeName = attrNames.find( - attrName => attrName.toLowerCase() === name, + (attrName) => attrName.toLowerCase() === name, ); values.forEach(({from, to}) => { diff --git a/projects/cdk/schematics/ng-update/utils/templates/replace-attrs.ts b/projects/cdk/schematics/ng-update/utils/templates/replace-attrs.ts index bfc140359679..74b89dfb67d6 100644 --- a/projects/cdk/schematics/ng-update/utils/templates/replace-attrs.ts +++ b/projects/cdk/schematics/ng-update/utils/templates/replace-attrs.ts @@ -42,7 +42,7 @@ export function replaceAttrs({ ), ]; - offsets.forEach(offset => { + offsets.forEach((offset) => { recorder.remove(offset + templateOffset, from.attrName.length); recorder.insertRight(offset + templateOffset, to.attrName); }); diff --git a/projects/cdk/schematics/ng-update/utils/templates/template-comments.ts b/projects/cdk/schematics/ng-update/utils/templates/template-comments.ts index 1958faf2dff6..ffbdc0c86d7f 100644 --- a/projects/cdk/schematics/ng-update/utils/templates/template-comments.ts +++ b/projects/cdk/schematics/ng-update/utils/templates/template-comments.ts @@ -29,7 +29,7 @@ export function addHTMLCommentTags({ ...(withAttrs.length ? findElementsWithAttributeOnTag( template, - withAttrs.map(attr => `[${attr}]`), + withAttrs.map((attr) => `[${attr}]`), [tag], ) : []), @@ -38,7 +38,7 @@ export function addHTMLCommentTags({ (sourceCodeLocation?.startOffset || 0) + templateOffset, ); - elementStartOffsets.forEach(offset => { + elementStartOffsets.forEach((offset) => { recorder.insertLeft(offset, `\n`); }); }); diff --git a/projects/cdk/schematics/ng-update/v3-40/index.ts b/projects/cdk/schematics/ng-update/v3-40/index.ts index b5a882ac760b..028d3678aaa9 100644 --- a/projects/cdk/schematics/ng-update/v3-40/index.ts +++ b/projects/cdk/schematics/ng-update/v3-40/index.ts @@ -28,7 +28,7 @@ function replaceTextareaTag(options: TuiSchema, fileSystem: DevkitFileSystem): v `${SMALL_TAB_SYMBOL}${REPLACE_SYMBOL} replacing to `, ); - getComponentTemplates(ALL_TS_FILES).forEach(resource => { + getComponentTemplates(ALL_TS_FILES).forEach((resource) => { const template = getTemplateFromTemplateResource(resource, fileSystem); const elements = findElementsByTagName(template, 'tui-text-area'); const path = fileSystem.resolve(getPathFromTemplateResource(resource)); diff --git a/projects/cdk/schematics/ng-update/v3-5/steps/migrate-expand-templates.ts b/projects/cdk/schematics/ng-update/v3-5/steps/migrate-expand-templates.ts index c354b2f84146..de071a27ef2a 100644 --- a/projects/cdk/schematics/ng-update/v3-5/steps/migrate-expand-templates.ts +++ b/projects/cdk/schematics/ng-update/v3-5/steps/migrate-expand-templates.ts @@ -34,10 +34,10 @@ function migrateExpand({ const elements = findElementsByTagName(template, 'tui-expand'); - elements.forEach(element => { + elements.forEach((element) => { const templateElement = findElementsByFn( element.childNodes, - el => el.tagName === 'ng-template', + (el) => el.tagName === 'ng-template', )[0]; if (!templateElement) { @@ -45,7 +45,7 @@ function migrateExpand({ } const tuiExpandAttr = templateElement.attrs.find( - attr => attr.name === 'tuiexpandcontent', + (attr) => attr.name === 'tuiexpandcontent', ); const insertTo = templateElement?.sourceCodeLocation?.startTag?.endOffset ?? 0; @@ -71,7 +71,7 @@ export function migrateExpandTemplates( total: componentWithTemplatesPaths.length, }); - componentWithTemplatesPaths.forEach(resource => { + componentWithTemplatesPaths.forEach((resource) => { const path = fileSystem.resolve(getPathFromTemplateResource(resource)); const recorder = fileSystem.edit(path); diff --git a/projects/cdk/schematics/ng-update/v3/constants/templates.ts b/projects/cdk/schematics/ng-update/v3/constants/templates.ts index e62002ffed3a..3fe38af5a84e 100644 --- a/projects/cdk/schematics/ng-update/v3/constants/templates.ts +++ b/projects/cdk/schematics/ng-update/v3/constants/templates.ts @@ -590,8 +590,8 @@ export const ATTR_TO_DIRECTIVE: ReplacementAttributeToDirective[] = [ name: 'TuiTextfieldControllerModule', moduleSpecifier: '@taiga-ui/core', }, - filterFn: element => - element.attrs.find(attr => attr.name === 'iconalign')?.value === 'right', + filterFn: (element) => + element.attrs.find((attr) => attr.name === 'iconalign')?.value === 'right', }, { componentSelector: 'tui-input', @@ -601,9 +601,9 @@ export const ATTR_TO_DIRECTIVE: ReplacementAttributeToDirective[] = [ name: 'TuiTextfieldControllerModule', moduleSpecifier: '@taiga-ui/core', }, - filterFn: element => + filterFn: (element) => !hasElementAttribute(element, 'iconAlign') || - element.attrs.find(attr => attr.name === 'iconalign')?.value === 'left', + element.attrs.find((attr) => attr.name === 'iconalign')?.value === 'left', }, { componentSelector: 'tui-primitive-textfield', @@ -613,9 +613,9 @@ export const ATTR_TO_DIRECTIVE: ReplacementAttributeToDirective[] = [ name: 'TuiTextfieldControllerModule', moduleSpecifier: '@taiga-ui/core', }, - filterFn: element => + filterFn: (element) => !hasElementAttribute(element, 'iconAlign') || - element.attrs.find(attr => attr.name === 'iconalign')?.value === 'right', + element.attrs.find((attr) => attr.name === 'iconalign')?.value === 'right', }, { componentSelector: 'tui-primitive-textfield', @@ -625,8 +625,8 @@ export const ATTR_TO_DIRECTIVE: ReplacementAttributeToDirective[] = [ name: 'TuiTextfieldControllerModule', moduleSpecifier: '@taiga-ui/core', }, - filterFn: element => - element.attrs.find(attr => attr.name === 'iconalign')?.value === 'left', + filterFn: (element) => + element.attrs.find((attr) => attr.name === 'iconalign')?.value === 'left', }, { componentSelector: 'tui-input-tag', @@ -636,9 +636,9 @@ export const ATTR_TO_DIRECTIVE: ReplacementAttributeToDirective[] = [ name: 'TuiTextfieldControllerModule', moduleSpecifier: '@taiga-ui/core', }, - filterFn: element => + filterFn: (element) => !hasElementAttribute(element, 'iconAlign') || - element.attrs.find(attr => attr.name === 'iconalign')?.value === 'right', + element.attrs.find((attr) => attr.name === 'iconalign')?.value === 'right', }, { componentSelector: 'tui-input-tag', @@ -648,8 +648,8 @@ export const ATTR_TO_DIRECTIVE: ReplacementAttributeToDirective[] = [ name: 'TuiTextfieldControllerModule', moduleSpecifier: '@taiga-ui/core', }, - filterFn: element => - element.attrs.find(attr => attr.name === 'iconalign')?.value === 'left', + filterFn: (element) => + element.attrs.find((attr) => attr.name === 'iconalign')?.value === 'left', }, { componentSelector: '*', diff --git a/projects/cdk/schematics/ng-update/v3/index.ts b/projects/cdk/schematics/ng-update/v3/index.ts index b8a5f2068b6a..b0cbe52998ab 100644 --- a/projects/cdk/schematics/ng-update/v3/index.ts +++ b/projects/cdk/schematics/ng-update/v3/index.ts @@ -92,9 +92,10 @@ function addTaigaStyles(options: TuiSchema): Rule { options, context, taigaStyles, - existingStyles => + (existingStyles) => !!existingStyles?.some( - style => typeof style === 'string' && style.includes('tinkoff-theme'), + (style) => + typeof style === 'string' && style.includes('tinkoff-theme'), ), stylesToReplace, tree, diff --git a/projects/cdk/schematics/ng-update/v3/steps/migrate-date-time.ts b/projects/cdk/schematics/ng-update/v3/steps/migrate-date-time.ts index 277dc10cb78e..5e01538d14fb 100644 --- a/projects/cdk/schematics/ng-update/v3/steps/migrate-date-time.ts +++ b/projects/cdk/schematics/ng-update/v3/steps/migrate-date-time.ts @@ -30,7 +30,7 @@ function migrateProperty({ }): void { const references = getNamedImportReferences(namedImport, moduleSpecifier); - references.forEach(ref => { + references.forEach((ref) => { if (ref.wasForgotten()) { return; } @@ -47,7 +47,7 @@ function migrateProperty({ ); const searched = accessExpression ?.getChildrenOfKind(SyntaxKind.Identifier) - .find(identifier => identifier.getText() === from); + .find((identifier) => identifier.getText() === from); if (searched && accessExpression) { callback(accessExpression); @@ -59,7 +59,7 @@ function migrateProperty({ if (Node.isPropertyAccessExpression(parent)) { const searched = parent .getChildrenOfKind(SyntaxKind.Identifier) - .find(identifier => identifier.getText() === from); + .find((identifier) => identifier.getText() === from); if (searched && !parent.wasForgotten()) { callback(parent); @@ -113,8 +113,8 @@ function replaceIdentifierReferences( * If `identifier` is equal to `var` from `method1` (1), * then `identifier.findReferencesAsNodes` will return array with 2 references: (2) and (3). */ - .filter(ref => !areBothObjectDestructuring(ref, identifier)) - .forEach(ref => { + .filter((ref) => !areBothObjectDestructuring(ref, identifier)) + .forEach((ref) => { if (ref.wasForgotten()) { return; } @@ -139,7 +139,7 @@ function replaceIdentifierReferences( if (Node.isPropertyAccessExpression(parent)) { const searched = parent .getChildrenOfKind(SyntaxKind.Identifier) - .find(identifier => identifier.getText() === from); + .find((identifier) => identifier.getText() === from); if (searched) { callback(parent); @@ -185,7 +185,7 @@ export function dateTimeMigrations(options: TuiSchema): void { namedImport: 'TuiDay', moduleSpecifier: '@taiga-ui/cdk', from: 'formattedDay', - callback: node => + callback: (node) => node.replaceWithText( node.getText().replace('formattedDay', 'getFormattedDay("DMY", ".")'), ), @@ -202,7 +202,7 @@ export function dateTimeMigrations(options: TuiSchema): void { namedImport: 'TuiDayRange', moduleSpecifier: '@taiga-ui/cdk', from: 'formattedDayRange', - callback: node => + callback: (node) => node.replaceWithText( node .getText() @@ -221,7 +221,7 @@ export function dateTimeMigrations(options: TuiSchema): void { namedImport: 'TuiDayRange', moduleSpecifier: '@taiga-ui/cdk', from: 'normalizeParse', - callback: node => { + callback: (node) => { const parent = node.getParent(); if (Node.isCallExpression(parent)) { @@ -285,7 +285,7 @@ export function dateTimeMigrations(options: TuiSchema): void { namedImport, moduleSpecifier: '@taiga-ui/cdk', from: field, - callback: node => insertTodoBeforeNode(node, message), + callback: (node) => insertTodoBeforeNode(node, message), }); !options['skip-logs'] && diff --git a/projects/cdk/schematics/ng-update/v3/steps/migrate-polymorpheus.ts b/projects/cdk/schematics/ng-update/v3/steps/migrate-polymorpheus.ts index c91664751851..021a0e0d2e58 100644 --- a/projects/cdk/schematics/ng-update/v3/steps/migrate-polymorpheus.ts +++ b/projects/cdk/schematics/ng-update/v3/steps/migrate-polymorpheus.ts @@ -48,13 +48,13 @@ function removeOldInputs( templateOffset: number, ): void { const offsets = [ - ...getInputPropertyOffsets(template, '[content]', ['*'], el => + ...getInputPropertyOffsets(template, '[content]', ['*'], (el) => hasElementAttribute(el, 'polymorpheus-outlet'), ), - ...getInputPropertyOffsets(template, '[context]', ['*'], el => + ...getInputPropertyOffsets(template, '[context]', ['*'], (el) => hasElementAttribute(el, 'polymorpheus-outlet'), ), - ...getInputPropertyOffsets(template, 'polymorpheus-outlet', ['*'], el => + ...getInputPropertyOffsets(template, 'polymorpheus-outlet', ['*'], (el) => hasElementAttribute(el, 'polymorpheus-outlet'), ), ]; @@ -79,7 +79,7 @@ function insertPolymorpheusWithDefault({ template: string; templateOffset: number; }): void { - const templateVar = defaultTemplateEl.attrs.find(attr => + const templateVar = defaultTemplateEl.attrs.find((attr) => attr.name.startsWith('let-'), ); @@ -126,13 +126,13 @@ export function migratePolymorpheus({ const elements = findElementsWithAttribute(template, 'polymorpheus-outlet'); - elements.forEach(element => { - const contentVal = element.attrs.find(attr => attr.name === '[content]')?.value; - const contextVal = element.attrs.find(attr => attr.name === '[context]')?.value; + elements.forEach((element) => { + const contentVal = element.attrs.find((attr) => attr.name === '[content]')?.value; + const contextVal = element.attrs.find((attr) => attr.name === '[context]')?.value; const defaultTemplateEl = findElementsByFn( element.childNodes, - el => el.tagName === 'ng-template', + (el) => el.tagName === 'ng-template', )[0]; if (!contentVal) { diff --git a/projects/cdk/schematics/ng-update/v3/steps/migrate-progress.ts b/projects/cdk/schematics/ng-update/v3/steps/migrate-progress.ts index 2e295bb541a2..a690a572af02 100644 --- a/projects/cdk/schematics/ng-update/v3/steps/migrate-progress.ts +++ b/projects/cdk/schematics/ng-update/v3/steps/migrate-progress.ts @@ -37,10 +37,11 @@ export function replaceProgressColorSegmentsPipe( findElementsWithAttribute(template, PROPERTY_FOR_DEPRECATED_PIPES) .filter(isProgressWithDeprecatedPipe) - .forEach(progressEl => { + .forEach((progressEl) => { const oldValue = - progressEl.attrs.find(attr => attr.name === PROPERTY_FOR_DEPRECATED_PIPES) - ?.value || ''; + progressEl.attrs.find( + (attr) => attr.name === PROPERTY_FOR_DEPRECATED_PIPES, + )?.value || ''; const newValue = oldValue.replaceAll(DEPRECATED_PROGRESS_PIPES_REG, ''); const attrLocations = progressEl.sourceCodeLocation?.attrs; @@ -62,7 +63,7 @@ export function isProgressWithDeprecatedPipe(element: Element): boolean { return ( element.tagName === 'progress' && element.attrs.some( - attr => + (attr) => attr.name === PROPERTY_FOR_DEPRECATED_PIPES && attr.value.match(DEPRECATED_PROGRESS_PIPES_REG), ) @@ -73,7 +74,7 @@ export function migrateProgress(fileSystem: DevkitFileSystem, options: TuiSchema !options['skip-logs'] && infoLog(`${SMALL_TAB_SYMBOL}${REPLACE_SYMBOL} migrating progress bars...`); - getComponentTemplates(ALL_TS_FILES).forEach(templateResource => + getComponentTemplates(ALL_TS_FILES).forEach((templateResource) => replaceProgressColorSegmentsPipe(templateResource, fileSystem), ); diff --git a/projects/cdk/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-range.ts b/projects/cdk/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-range.ts index 14e940cf7e91..9d571318f233 100644 --- a/projects/cdk/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-range.ts +++ b/projects/cdk/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-range.ts @@ -103,7 +103,7 @@ export function migrateInputRange( prefix: '[replaceMinMaxLabel]', }); - templateResources.forEach(templateResource => { + templateResources.forEach((templateResource) => { !options['skip-logs'] && progressLog(templateResource.componentPath); replaceMinLabel(templateResource, fileSystem, COMPONENTS_WITH_MIN_LABELS); replaceMaxLabel(templateResource, fileSystem, COMPONENTS_WITH_MAX_LABELS); @@ -116,7 +116,7 @@ export function migrateInputRange( prefix: '[COMPONENTS_WITH_MIN_LABELS]', }); - Array.from(COMPONENTS_WITH_MIN_LABELS).forEach(componentPath => { + Array.from(COMPONENTS_WITH_MIN_LABELS).forEach((componentPath) => { !options['skip-logs'] && progressLog(componentPath); addMinMaxLabelMethod(componentPath, MIN_LABELS_MIGRATION_METHOD_NAME, [ 'const currentValue = context.$implicit;', @@ -132,7 +132,7 @@ export function migrateInputRange( prefix: '[COMPONENTS_WITH_MAX_LABELS]', }); - Array.from(COMPONENTS_WITH_MAX_LABELS).forEach(componentPath => { + Array.from(COMPONENTS_WITH_MAX_LABELS).forEach((componentPath) => { !options['skip-logs'] && progressLog(componentPath); addMinMaxLabelMethod(componentPath, MAX_LABELS_MIGRATION_METHOD_NAME, [ 'const currentValue = context.$implicit;', diff --git a/projects/cdk/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-slider.ts b/projects/cdk/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-slider.ts index 22f5b14305d5..895feb272bd9 100644 --- a/projects/cdk/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-slider.ts +++ b/projects/cdk/schematics/ng-update/v3/steps/migrate-sliders/migrate-input-slider.ts @@ -42,7 +42,7 @@ function replaceMinMaxLabels( from: 'minLabel', to: '[valueContent]', newValue: MIN_MAX_LABELS_MIGRATION_METHOD_NAME, - filterFn: element => !hasElementAttribute(element, 'maxLabel'), + filterFn: (element) => !hasElementAttribute(element, 'maxLabel'), }); removeInputProperty({ @@ -50,7 +50,7 @@ function replaceMinMaxLabels( fileSystem, componentSelector: 'tui-input-slider', inputProperty: 'minLabel', - filterFn: element => hasElementAttribute(element, 'maxLabel'), + filterFn: (element) => hasElementAttribute(element, 'maxLabel'), }); if (wasMaxLabelModified || wasMinLabelModified) { @@ -93,7 +93,7 @@ export function migrateInputSlider( prefix: '[replaceMinMaxLabels]', }); - templateResources.forEach(templateResource => { + templateResources.forEach((templateResource) => { !options['skip-logs'] && progressLog(templateResource.componentPath); replaceMinMaxLabels(templateResource, fileSystem, COMPONENTS_WITH_MIN_MAX_LABELS); }); @@ -111,7 +111,7 @@ export function migrateInputSlider( prefix: '[addMinMaxLabelMethod]', }); - Array.from(COMPONENTS_WITH_MIN_MAX_LABELS).forEach(componentPath => { + Array.from(COMPONENTS_WITH_MIN_MAX_LABELS).forEach((componentPath) => { !options['skip-logs'] && progressLog(componentPath); addMinMaxLabelMethod(componentPath); }); diff --git a/projects/cdk/schematics/ng-update/v3/steps/migrate-taiga-proprietary-icons.ts b/projects/cdk/schematics/ng-update/v3/steps/migrate-taiga-proprietary-icons.ts index ad086db5ab43..908aeef0e38d 100644 --- a/projects/cdk/schematics/ng-update/v3/steps/migrate-taiga-proprietary-icons.ts +++ b/projects/cdk/schematics/ng-update/v3/steps/migrate-taiga-proprietary-icons.ts @@ -42,7 +42,7 @@ export function migrateTaigaProprietaryIcons(options: TuiSchema): Rule { } return getSourceFiles('**/angular.json').length > 0 - ? updateWorkspace(workspace => { + ? updateWorkspace((workspace) => { if (proprietaryIcons === null) { return; } @@ -73,7 +73,7 @@ export function migrateTaigaProprietaryIcons(options: TuiSchema): Rule { if (Array.isArray(targetOptions?.assets)) { const tdsSrc = '@taiga-ui/proprietary-tds-icons/src'; const hasIcons = (targetOptions.assets as Asset[]).find( - asset => + (asset) => tuiIsString(asset) ? asset.includes(tdsSrc) : asset?.input?.includes(tdsSrc), diff --git a/projects/cdk/schematics/ng-update/v3/steps/migrate-templates.ts b/projects/cdk/schematics/ng-update/v3/steps/migrate-templates.ts index 87b5061910eb..ff792d280944 100644 --- a/projects/cdk/schematics/ng-update/v3/steps/migrate-templates.ts +++ b/projects/cdk/schematics/ng-update/v3/steps/migrate-templates.ts @@ -115,10 +115,10 @@ function addHTMLCommentTags({ ...findElementsWithAttribute(template, withAttr), ...findElementsWithAttribute(template, `[${withAttr}]`), ] - .filter(el => el.tagName === tag) - .map(el => (el.sourceCodeLocation?.startOffset || 0) + templateOffset); + .filter((el) => el.tagName === tag) + .map((el) => (el.sourceCodeLocation?.startOffset || 0) + templateOffset); - elementStartOffsets.forEach(offset => { + elementStartOffsets.forEach((offset) => { recorder.insertRight(offset, `\n`); }); }); @@ -138,8 +138,8 @@ function replaceBreadcrumbs({ const elements = findElementsByTagName(template, 'tui-breadcrumbs'); - elements.forEach(element => { - const itemsAttr = element.attrs.find(attr => attr.name === '[items]'); + elements.forEach((element) => { + const itemsAttr = element.attrs.find((attr) => attr.name === '[items]'); const itemsValue = itemsAttr?.value; const insertTo = element?.sourceCodeLocation?.startTag?.endOffset ?? 0; @@ -183,8 +183,8 @@ function replaceFieldError({ const elements = findElementsByTagName(template, 'tui-field-error'); - elements.forEach(element => { - const orderAttr = element.attrs.find(attr => attr.name === '[order]'); + elements.forEach((element) => { + const orderAttr = element.attrs.find((attr) => attr.name === '[order]'); const orderVal = orderAttr?.value; if (orderAttr) { @@ -224,7 +224,7 @@ function addEditorProviders({ }): void { const template = getTemplateFromTemplateResource(resource, fileSystem); const elements = findElementsByTagName(template, 'tui-editor').filter( - element => !hasElementAttribute(element, 'new'), + (element) => !hasElementAttribute(element, 'new'), ); if (elements.length) { @@ -263,13 +263,13 @@ function migrateTuiHideSelectedPipe({ const template = getTemplateFromTemplateResource(resource, fileSystem); const templateOffset = getTemplateOffset(resource); - const elementsWithPipe = findElementsInTemplateByFn(template, el => - el.attrs?.some(attr => attr.value.match(HIDE_SELECTED_PIPE_WITH_ARGS_REG)), + const elementsWithPipe = findElementsInTemplateByFn(template, (el) => + el.attrs?.some((attr) => attr.value.match(HIDE_SELECTED_PIPE_WITH_ARGS_REG)), ); - elementsWithPipe.forEach(el => { + elementsWithPipe.forEach((el) => { const {name, value: oldValue} = - el.attrs.find(attr => attr.value.match(HIDE_SELECTED_PIPE_WITH_ARGS_REG)) || + el.attrs.find((attr) => attr.value.match(HIDE_SELECTED_PIPE_WITH_ARGS_REG)) || {}; const attrLocations = el.sourceCodeLocation?.attrs; @@ -302,15 +302,15 @@ function migrateBinaryAttributes({ const template = getTemplateFromTemplateResource(resource, fileSystem); const templateOffset = getTemplateOffset(resource); - TRUTHY_BOOLEAN_INPUT_TO_HTML_BINARY_ATTRIBUTE.forEach(attrName => { - const elements = findElementsInTemplateByFn(template, el => + TRUTHY_BOOLEAN_INPUT_TO_HTML_BINARY_ATTRIBUTE.forEach((attrName) => { + const elements = findElementsInTemplateByFn(template, (el) => el.attrs?.some( - attr => + (attr) => attr.value === 'true' && attr.name.includes(attrName.toLowerCase()), ), ); - elements.forEach(el => { + elements.forEach((el) => { const attrLocations = el.sourceCodeLocation?.attrs; if (!attrLocations) { @@ -402,7 +402,7 @@ export function migrateTemplates(fileSystem: DevkitFileSystem, options: TuiSchem total: componentWithTemplatesPaths.length, }); - componentWithTemplatesPaths.forEach(resource => { + componentWithTemplatesPaths.forEach((resource) => { const path = fileSystem.resolve(getPathFromTemplateResource(resource)); const recorder = fileSystem.edit(path); diff --git a/projects/cdk/schematics/ng-update/v3/steps/migrate-textfield-controller.ts b/projects/cdk/schematics/ng-update/v3/steps/migrate-textfield-controller.ts index f0c5e7c43c19..6c6cb3a91e86 100644 --- a/projects/cdk/schematics/ng-update/v3/steps/migrate-textfield-controller.ts +++ b/projects/cdk/schematics/ng-update/v3/steps/migrate-textfield-controller.ts @@ -47,7 +47,7 @@ const ATTRS_MAP: Record = { '[tuitextfieldexampletext]': '[attr.placeholder]', }; -const CONTROLLER_ITEMS = Object.keys(ATTRS_MAP).map(attr => attr.toLowerCase()); +const CONTROLLER_ITEMS = Object.keys(ATTRS_MAP).map((attr) => attr.toLowerCase()); function insertTuiTextfieldInput({ element, @@ -61,7 +61,7 @@ function insertTuiTextfieldInput({ templateOffset: number; }): void { const newAttrs = attrs - .map(attr => `${ATTRS_MAP[attr.name]}="${attr.value}"`) + .map((attr) => `${ATTRS_MAP[attr.name]}="${attr.value}"`) .join('\n'); const content = element.tagName === 'tui-text-area' @@ -86,7 +86,7 @@ function addAttrToExistingInput({ recorder: UpdateRecorder; templateOffset: number; }): void { - attrs.forEach(attr => { + attrs.forEach((attr) => { const insertTo = existingInput.sourceCodeLocation?.attrs?.tuitextfield?.endOffset; if (insertTo) { @@ -104,7 +104,7 @@ function removeOldInputs( templateOffset: number, ): void { const offsets = arrayFlat( - CONTROLLER_ITEMS.map(item => + CONTROLLER_ITEMS.map((item) => getInputPropertyOffsets(template, item, getTagsToRemove(item)), ), ); @@ -116,7 +116,7 @@ function removeOldInputs( function getTagsToRemove(attrName: string): string[] { return ['[tuitextfieldmaxlength]', 'tuitextfieldmaxlength'].includes(attrName) - ? TEXTFIELDS.filter(tag => tag !== 'tui-text-area') + ? TEXTFIELDS.filter((tag) => tag !== 'tui-text-area') : TEXTFIELDS; } @@ -142,9 +142,9 @@ export function migrateTextfieldController({ const elements = findElementsByTagNames(template, TEXTFIELDS); - elements.forEach(element => { + elements.forEach((element) => { const attrs = element.attrs.filter( - attr => + (attr) => CONTROLLER_ITEMS.includes(attr.name) && !exclusion(element, attr.name), ); @@ -154,7 +154,7 @@ export function migrateTextfieldController({ const existingInput = findElementsByFn( element.childNodes, - el => + (el) => (el.tagName === 'input' || el.tagName === 'textarea') && hasElementAttribute(el, 'tuiTextfield'), )[0]; diff --git a/projects/cdk/schematics/ng-update/v3/steps/miscellaneous.ts b/projects/cdk/schematics/ng-update/v3/steps/miscellaneous.ts index c1cd64471445..fc598864c158 100644 --- a/projects/cdk/schematics/ng-update/v3/steps/miscellaneous.ts +++ b/projects/cdk/schematics/ng-update/v3/steps/miscellaneous.ts @@ -15,7 +15,7 @@ import {insertTodo} from '../../../utils/insert-todo'; function addWarningToMethod(className: string, method: string, message: string): void { const references = getNamedImportReferences(className); - references.forEach(ref => { + references.forEach((ref) => { const parent = ref.getParent(); if (Node.isTypeReference(parent)) { @@ -35,14 +35,14 @@ function replaceEnumProperty({ }): void { const references = getNamedImportReferences(enumName); - references.forEach(ref => { + references.forEach((ref) => { const parent = ref.getParent(); if (!Node.isPropertyAccessExpression(parent)) { return; } - parent.getChildren().forEach(node => { + parent.getChildren().forEach((node) => { if (node.getText() === from) { node.replaceWithText(to); } @@ -54,7 +54,7 @@ function checkMethod(node: TypeReferenceNode, method: string, message: string): const statement = node.getParent(); const identifier = statement.getChildrenOfKind(SyntaxKind.Identifier)[0]; - identifier.findReferencesAsNodes().forEach(ref => { + identifier.findReferencesAsNodes().forEach((ref) => { let parent = ref.getParent(); if ( @@ -66,7 +66,7 @@ function checkMethod(node: TypeReferenceNode, method: string, message: string): } if (Node.isPropertyAccessExpression(parent)) { - parent.getChildrenOfKind(SyntaxKind.Identifier).forEach(identifier => { + parent.getChildrenOfKind(SyntaxKind.Identifier).forEach((identifier) => { if (identifier.getText() === method) { insertTodo(identifier, message); } diff --git a/projects/cdk/schematics/ng-update/v3/steps/replace-functions.ts b/projects/cdk/schematics/ng-update/v3/steps/replace-functions.ts index b2eb9e19b696..3db070c6ea89 100644 --- a/projects/cdk/schematics/ng-update/v3/steps/replace-functions.ts +++ b/projects/cdk/schematics/ng-update/v3/steps/replace-functions.ts @@ -14,7 +14,7 @@ import {DEPRECATED_FUNCTIONS} from '../constants/deprecated-functions'; function replaceDeprecatedFunction(): void { DEPRECATED_FUNCTIONS.forEach(({from, to, moduleSpecifier}) => { - getNamedImportReferences(from, moduleSpecifier).forEach(ref => { + getNamedImportReferences(from, moduleSpecifier).forEach((ref) => { if (ref.wasForgotten()) { return; } @@ -34,7 +34,7 @@ function replaceDeprecatedFunction(): void { } function replacePadStart(references: Node[]): void { - references.forEach(ref => { + references.forEach((ref) => { const parent = ref.getParent(); if (Node.isImportSpecifier(parent)) { @@ -52,7 +52,7 @@ function replacePadStart(references: Node[]): void { } function replaceNativeFocused(references: Node[]): void { - references.forEach(ref => { + references.forEach((ref) => { const parent = ref.getParent(); if (Node.isImportSpecifier(parent)) { @@ -73,7 +73,7 @@ function replaceNativeFocused(references: Node[]): void { } function replaceClosestElement(references: Node[]): void { - references.forEach(ref => { + references.forEach((ref) => { const parent = ref.getParent(); if (Node.isImportSpecifier(parent)) { @@ -91,7 +91,7 @@ function replaceClosestElement(references: Node[]): void { } function replaceCustomEvent(references: Node[]): void { - references.forEach(ref => { + references.forEach((ref) => { const parent = ref.getParent(); if (Node.isImportSpecifier(parent)) { @@ -107,7 +107,7 @@ function replaceCustomEvent(references: Node[]): void { } function replaceFallbackValue(references: Node[]): void { - references.forEach(ref => { + references.forEach((ref) => { const parent = ref.getParent(); if (Node.isImportSpecifier(parent)) { @@ -125,9 +125,9 @@ function modifyFormatNumberArgs(): void { ...getNamedImportReferences('formatNumber', '@taiga-ui/core'), ...getNamedImportReferences('tuiFormatNumber', '@taiga-ui/core'), ] - .map(ref => ref.getParent()) + .map((ref) => ref.getParent()) .filter(Node.isCallExpression) - .forEach(fn => { + .forEach((fn) => { const args = fn.getArguments(); if (args.length > 1) { @@ -137,7 +137,7 @@ function modifyFormatNumberArgs(): void { decimalSeparator = "','", thousandSeparator = "'\u00A0'", zeroPadding = true, - ] = args.map(arg => arg.getText()); + ] = args.map((arg) => arg.getText()); const notNullDecimalLimit = decimalLimit === 'null' ? 'Infinity' : decimalLimit; const conditionalDecimalLimit = !Number.isNaN(Number(notNullDecimalLimit)) @@ -153,13 +153,13 @@ function modifyFormatNumberArgs(): void { function modifyClosestFocusable(): void { getNamedImportReferences('tuiGetClosestFocusable', '@taiga-ui/cdk') - .map(ref => ref.getParent()) + .map((ref) => ref.getParent()) .filter(Node.isCallExpression) - .forEach(fn => { + .forEach((fn) => { const args = fn.getArguments(); if (args.length > 1) { - const [initial, prev = false, root, keyboard = true] = args.map(arg => + const [initial, prev = false, root, keyboard = true] = args.map((arg) => arg.getText(), ); diff --git a/projects/cdk/schematics/ng-update/v3/steps/replace-styles.ts b/projects/cdk/schematics/ng-update/v3/steps/replace-styles.ts index c15470e3170d..33986ed00ab5 100644 --- a/projects/cdk/schematics/ng-update/v3/steps/replace-styles.ts +++ b/projects/cdk/schematics/ng-update/v3/steps/replace-styles.ts @@ -13,7 +13,7 @@ export const TUI_WARNING_WRAPPER_MIXINS = export function replaceStyles(): void { getActiveProject() ?.getSourceFiles('**/**.less') - .forEach(sourceFile => { + .forEach((sourceFile) => { let fullText = sourceFile.getFullText(); if (fullText.includes('taiga-ui')) { @@ -37,7 +37,7 @@ export function replaceStyles(): void { "@import '@taiga-ui/core/styles/taiga-ui-global", `${TUI_WARNING_NORMALIZE}\n@import '@taiga-ui/styles/taiga-ui-global`, ) - .replaceAll(/@import '@taiga-ui\/.+(.less)?';/g, val => + .replaceAll(/@import '@taiga-ui\/.+(.less)?';/g, (val) => `${val.replace("';", '')}.less';`.replace('.less.less', '.less'), ); diff --git a/projects/cdk/schematics/ng-update/v4/migrate-css-vars/rename-css-vars.ts b/projects/cdk/schematics/ng-update/v4/migrate-css-vars/rename-css-vars.ts index 06c11e8dcb21..0ceea72bf3d6 100644 --- a/projects/cdk/schematics/ng-update/v4/migrate-css-vars/rename-css-vars.ts +++ b/projects/cdk/schematics/ng-update/v4/migrate-css-vars/rename-css-vars.ts @@ -12,12 +12,12 @@ import { export function renameCssVars(pattern = ALL_FILES): void { const sourceFiles = getSourceFiles(pattern); - sourceFiles.forEach(file => { + sourceFiles.forEach((file) => { let text = file.getFullText(); // leave comments if (!file.getFilePath().endsWith('html')) { - DEPRECATE_VARS_WITH_COMMENT.forEach(variable => { + DEPRECATE_VARS_WITH_COMMENT.forEach((variable) => { const wordRegex = new RegExp(`(^|\\n)(?=[^\\n]*\\b${variable}\\b)`, 'g'); text = text.replaceAll(wordRegex, `$1// ${NIGHT_VAR_COMMENT}\n`); diff --git a/projects/cdk/schematics/ng-update/v4/migrate-icons/rename-icons.ts b/projects/cdk/schematics/ng-update/v4/migrate-icons/rename-icons.ts index 862e7d6a025e..e4d826bd8b09 100644 --- a/projects/cdk/schematics/ng-update/v4/migrate-icons/rename-icons.ts +++ b/projects/cdk/schematics/ng-update/v4/migrate-icons/rename-icons.ts @@ -21,7 +21,7 @@ const CHANGED_ICONS = [ export function renameIcons(pattern = ALL_FILES): void { const sourceFiles = getSourceFiles(pattern); - sourceFiles.forEach(file => { + sourceFiles.forEach((file) => { let text = file.getFullText(); CHANGED_ICONS.map(({from, to}) => ({ @@ -33,7 +33,7 @@ export function renameIcons(pattern = ALL_FILES): void { const regex = /\btuiIcon(?!Button\b)[A-Z][a-zA-Z0-9]*\b/g; - text = text.replaceAll(regex, match => convertString(match)); + text = text.replaceAll(regex, (match) => convertString(match)); file.replaceWithText(text); }); diff --git a/projects/cdk/schematics/ng-update/v4/migrate-icons/rename-proprietary-icons.ts b/projects/cdk/schematics/ng-update/v4/migrate-icons/rename-proprietary-icons.ts index 588c4526687a..927473130de9 100644 --- a/projects/cdk/schematics/ng-update/v4/migrate-icons/rename-proprietary-icons.ts +++ b/projects/cdk/schematics/ng-update/v4/migrate-icons/rename-proprietary-icons.ts @@ -6,12 +6,12 @@ import {ALL_FILES} from '../../../constants'; export function renameProprietaryIcons(pattern = ALL_FILES): void { const sourceFiles = getSourceFiles(pattern); - sourceFiles.forEach(file => { + sourceFiles.forEach((file) => { let text = file.getFullText(); const regex = /\btuiIcon(?!Button\b)[A-Z][a-zA-Z0-9]*\b/g; - text = text.replaceAll(regex, match => convertString(match)); + text = text.replaceAll(regex, (match) => convertString(match)); file.replaceWithText(text); }); diff --git a/projects/cdk/schematics/ng-update/v4/steps/constants/attr-to-directive-replace.ts b/projects/cdk/schematics/ng-update/v4/steps/constants/attr-to-directive-replace.ts index c3a013444816..2d68b5c97bf5 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/constants/attr-to-directive-replace.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/constants/attr-to-directive-replace.ts @@ -40,7 +40,7 @@ export const ATTRS_TO_DIRECTIVE_REPLACE: ReplacementAttributeToDirective[] = [ }, { componentSelector: ['a', 'button'], - filterFn: el => hasElementAttribute(el, 'tuiLink'), + filterFn: (el) => hasElementAttribute(el, 'tuiLink'), inputProperty: 'iconRotated', directive: 'tuiChevron', directiveModule: { @@ -56,6 +56,6 @@ export const ATTRS_TO_DIRECTIVE_REPLACE: ReplacementAttributeToDirective[] = [ name: 'TuiButtonLoading', moduleSpecifier: '@taiga-ui/kit', }, - filterFn: el => hasElementAttribute(el, 'tuiButton'), + filterFn: (el) => hasElementAttribute(el, 'tuiButton'), }, ]; diff --git a/projects/cdk/schematics/ng-update/v4/steps/constants/attr-with-values-to-replace.ts b/projects/cdk/schematics/ng-update/v4/steps/constants/attr-with-values-to-replace.ts index 52917ca2da25..7f947a533689 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/constants/attr-with-values-to-replace.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/constants/attr-with-values-to-replace.ts @@ -7,7 +7,7 @@ export const ATTR_WITH_VALUES_TO_REPLACE: ReplacementAttributeValue[] = [ newAttrName: '[style.border-radius.%]', values: [{from: 'rounded', to: '100'}], withTagNames: ['button'], - filterFn: el => hasElementAttribute(el, 'tuiButton'), + filterFn: (el) => hasElementAttribute(el, 'tuiButton'), }, { attrNames: ['tuiMode'], diff --git a/projects/cdk/schematics/ng-update/v4/steps/constants/attrs-to-replace.ts b/projects/cdk/schematics/ng-update/v4/steps/constants/attrs-to-replace.ts index c9941deee43b..f0e03d7ae08b 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/constants/attrs-to-replace.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/constants/attrs-to-replace.ts @@ -181,9 +181,10 @@ export const ATTRS_TO_REPLACE: ReplacementAttribute[] = [ from: { attrName: 'icon', withAttrsNames: ['tuiLink'], - filterFn: element => + filterFn: (element) => !hasElementAttribute(element, 'iconAlign') || - element.attrs.find(attr => attr.name === 'iconalign')?.value === 'right', + element.attrs.find((attr) => attr.name === 'iconalign')?.value === + 'right', }, to: {attrName: 'iconEnd'}, }, @@ -191,8 +192,8 @@ export const ATTRS_TO_REPLACE: ReplacementAttribute[] = [ from: { attrName: 'icon', withAttrsNames: ['tuiLink'], - filterFn: element => - element.attrs.find(attr => attr.name === 'iconalign')?.value === 'left', + filterFn: (element) => + element.attrs.find((attr) => attr.name === 'iconalign')?.value === 'left', }, to: {attrName: 'iconStart'}, }, diff --git a/projects/cdk/schematics/ng-update/v4/steps/constants/inputs-to-remove.ts b/projects/cdk/schematics/ng-update/v4/steps/constants/inputs-to-remove.ts index 654588764a7b..0f9ba21a4293 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/constants/inputs-to-remove.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/constants/inputs-to-remove.ts @@ -9,6 +9,6 @@ export const INPUTS_TO_REMOVE: RemovableInput[] = [ { inputName: 'iconAlign', tags: ['button', 'a'], - filterFn: el => hasElementAttribute(el, 'tuiLink'), + filterFn: (el) => hasElementAttribute(el, 'tuiLink'), }, ]; diff --git a/projects/cdk/schematics/ng-update/v4/steps/constants/tags-to-replace.ts b/projects/cdk/schematics/ng-update/v4/steps/constants/tags-to-replace.ts index b141a3e98391..3595445d276a 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/constants/tags-to-replace.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/constants/tags-to-replace.ts @@ -7,13 +7,13 @@ export const TAGS_TO_REPLACE: ReplacementTag[] = [ from: 'tui-input-count', to: 'tui-input-number', addAttributes: ['decimal="never"'], - filterFn: element => element.attrs.some(attr => attr.name === '[step]'), + filterFn: (element) => element.attrs.some((attr) => attr.name === '[step]'), }, { from: 'tui-input-count', to: 'tui-input-number', addAttributes: ['decimal="never"', '[step]="1"'], - filterFn: element => element.attrs.every(attr => attr.name !== '[step]'), + filterFn: (element) => element.attrs.every((attr) => attr.name !== '[step]'), }, { from: 'tui-money', @@ -32,14 +32,14 @@ export const TAGS_TO_REPLACE: ReplacementTag[] = [ { from: 'tui-hosted-dropdown', to: 'div', - filterFn: el => - el.attrs.some(attr => attr.name === '[open]' || attr.name === '[(open)]'), + filterFn: (el) => + el.attrs.some((attr) => attr.name === '[open]' || attr.name === '[(open)]'), }, { from: 'tui-hosted-dropdown', to: 'div', - filterFn: el => - el.attrs.every(attr => attr.name !== '[open]' && attr.name !== '[(open)]'), + filterFn: (el) => + el.attrs.every((attr) => attr.name !== '[open]' && attr.name !== '[(open)]'), addAttributes: ['tuiDropdownOpen'], }, { diff --git a/projects/cdk/schematics/ng-update/v4/steps/migrate-all-country-iso-codes.ts b/projects/cdk/schematics/ng-update/v4/steps/migrate-all-country-iso-codes.ts index f4567e0452ed..17e1fe7bdf3a 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/migrate-all-country-iso-codes.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/migrate-all-country-iso-codes.ts @@ -19,7 +19,7 @@ export function migrateAllCountryIsoCodes(options: TuiSchema): void { const references = getNamedImportReferences('TuiCountryIsoCode', '@taiga-ui/i18n'); - references.forEach(ref => { + references.forEach((ref) => { if (ref.wasForgotten()) { return; } diff --git a/projects/cdk/schematics/ng-update/v4/steps/migrate-destroy-service.ts b/projects/cdk/schematics/ng-update/v4/steps/migrate-destroy-service.ts index 008288bdd6f2..6c8e166452e4 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/migrate-destroy-service.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/migrate-destroy-service.ts @@ -23,7 +23,7 @@ export function migrateDestroyService(options: TuiSchema): void { const references = getNamedImportReferences('TuiDestroyService', '@taiga-ui/cdk'); const nodesForComments: Node[] = []; - references.forEach(ref => { + references.forEach((ref) => { if (ref.wasForgotten()) { return; } @@ -47,7 +47,7 @@ export function migrateDestroyService(options: TuiSchema): void { // providers: [TuiDestroyService] const index = parent .getElements() - .findIndex(el => el.getText() === 'TuiDestroyService'); + .findIndex((el) => el.getText() === 'TuiDestroyService'); parent.removeElement(index); } else if (Node.isTypeReference(parent)) { @@ -95,7 +95,7 @@ export function migrateDestroyService(options: TuiSchema): void { nodesForComments.push(ref); } - destroyObservableUsages.forEach(node => { + destroyObservableUsages.forEach((node) => { const possibleTakeUntil = findTakeUntil(node); if (!possibleTakeUntil) { @@ -155,7 +155,7 @@ export function migrateDestroyService(options: TuiSchema): void { * --- * @see https://ts-morph.com/manipulation/#strongwarningstrong */ - nodesForComments.forEach(ref => { + nodesForComments.forEach((ref) => { if (ref.wasForgotten()) { return; } diff --git a/projects/cdk/schematics/ng-update/v4/steps/migrate-legacy-mask.ts b/projects/cdk/schematics/ng-update/v4/steps/migrate-legacy-mask.ts index c739b217331e..d398b0974a9e 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/migrate-legacy-mask.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/migrate-legacy-mask.ts @@ -31,7 +31,7 @@ function migrateTuiMaskedMoneyValueIsEmpty(options: TuiSchema): void { '@taiga-ui/core', ); - references.forEach(ref => { + references.forEach((ref) => { if (ref.wasForgotten()) { return; } @@ -64,7 +64,7 @@ function migrateTuiMaskedNumberStringToNumber(options: TuiSchema): void { '@taiga-ui/core', ); - references.forEach(ref => { + references.forEach((ref) => { if (ref.wasForgotten()) { return; } diff --git a/projects/cdk/schematics/ng-update/v4/steps/migrate-option-providers.ts b/projects/cdk/schematics/ng-update/v4/steps/migrate-option-providers.ts index 8d6c1ed08cdf..32c7ef1b7793 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/migrate-option-providers.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/migrate-option-providers.ts @@ -30,7 +30,7 @@ function migrateInputNumberOptions(options: TuiSchema): void { ...getNamedImportReferences('tuiInputNumberOptionsProvider', '@taiga-ui/legacy'), ]; - references.forEach(ref => { + references.forEach((ref) => { if (ref.wasForgotten()) { return; } @@ -49,7 +49,7 @@ function migrateInputNumberOptions(options: TuiSchema): void { [precision, decimal] .filter((property): property is ObjectLiteralElementLike => !!property) - .forEach(property => property.remove()); + .forEach((property) => property.remove()); if (precision || decimal) { insertTodo( diff --git a/projects/cdk/schematics/ng-update/v4/steps/migrate-proprietary.ts b/projects/cdk/schematics/ng-update/v4/steps/migrate-proprietary.ts index 0bd8e60aa5c1..383905c35e1e 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/migrate-proprietary.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/migrate-proprietary.ts @@ -41,7 +41,7 @@ export function migrateProprietary( function replaceScopePackages(): void { getActiveProject() ?.getSourceFiles('**/**.{ts,less,scss}') - .forEach(sourceFile => { + .forEach((sourceFile) => { let fullText = sourceFile.getFullText(); fullText = fullText @@ -59,7 +59,7 @@ function replaceScopePackages(): void { function replaceProprietaryIconPath(): void { getActiveProject() ?.getSourceFiles('**/{angular,project}.json') - .forEach(sourceFile => { + .forEach((sourceFile) => { let fullText = sourceFile.getFullText(); fullText = fullText @@ -92,7 +92,7 @@ export function removeProprietaryPackages(fileSystem: DevkitFileSystem): void { '@taiga-ui/proprietary-icons', '@taiga-ui/proprietary-tds-icons', '@taiga-ui/proprietary-tds-palette', - ].forEach(name => removePackageJsonDependency(fileSystem.tree, name)); + ].forEach((name) => removePackageJsonDependency(fileSystem.tree, name)); addPackageJsonDependency(fileSystem.tree, { name: '@taiga-ui/proprietary', diff --git a/projects/cdk/schematics/ng-update/v4/steps/migrate-styles.ts b/projects/cdk/schematics/ng-update/v4/steps/migrate-styles.ts index 17c1532099d5..2fa33982ca79 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/migrate-styles.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/migrate-styles.ts @@ -7,7 +7,7 @@ export const TUI_RATING_WARNING = export function migrateStyles(): void { getActiveProject() ?.getSourceFiles('**/**.{less,sass,scss,css}') - .forEach(sourceFile => { + .forEach((sourceFile) => { let fullText = sourceFile.getFullText(); fullText = fullText diff --git a/projects/cdk/schematics/ng-update/v4/steps/migrate-templates.ts b/projects/cdk/schematics/ng-update/v4/steps/migrate-templates.ts index c37f9456dc82..970b6e4a028c 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/migrate-templates.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/migrate-templates.ts @@ -110,7 +110,7 @@ export function migrateTemplates(fileSystem: DevkitFileSystem, options: TuiSchem total: componentWithTemplatesPaths.length, }); - componentWithTemplatesPaths.forEach(resource => { + componentWithTemplatesPaths.forEach((resource) => { const path = fileSystem.resolve(getPathFromTemplateResource(resource)); const recorder = fileSystem.edit(path); diff --git a/projects/cdk/schematics/ng-update/v4/steps/templates/migrate-badge.ts b/projects/cdk/schematics/ng-update/v4/steps/templates/migrate-badge.ts index 3aefa5316518..546efbf82431 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/templates/migrate-badge.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/templates/migrate-badge.ts @@ -30,7 +30,7 @@ export function migrateBadge({ } const valueAttr = attrs.find( - attr => attr.name === '[value]' || attr.name === 'value', + (attr) => attr.name === '[value]' || attr.name === 'value', ); // migration for icon-only badges @@ -40,7 +40,9 @@ export function migrateBadge({ return; } - const svg = (childNodes as Element[])?.find(node => node.nodeName === 'tui-svg'); + const svg = (childNodes as Element[])?.find( + (node) => node.nodeName === 'tui-svg', + ); if (svg) { migrateIcon({svg, sourceCodeLocation, recorder, templateOffset}); @@ -66,7 +68,7 @@ function migrateIcon({ recorder: UpdateRecorder; templateOffset: number; }): void { - const src = svg.attrs?.find(attr => attr.name === 'src'); + const src = svg.attrs?.find((attr) => attr.name === 'src'); const srcValue = src?.value; if (!srcValue) { diff --git a/projects/cdk/schematics/ng-update/v4/steps/templates/migrate-expandable.ts b/projects/cdk/schematics/ng-update/v4/steps/templates/migrate-expandable.ts index 8632127423ec..483b79f31dc3 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/templates/migrate-expandable.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/templates/migrate-expandable.ts @@ -27,7 +27,7 @@ export function migrateExpandable({ ); elements.forEach(({attrs, sourceCodeLocation}) => { - const expandableAttr = attrs.find(attr => attr.name === '[expandable]'); + const expandableAttr = attrs.find((attr) => attr.name === '[expandable]'); if (!expandableAttr) { return; @@ -40,7 +40,7 @@ export function migrateExpandable({ sourceCodeLocation?.attrs?.[expandableAttr.name]?.endOffset ?? 0; if (expandableValue === 'false') { - const rowsAttr = attrs.find(attr => attr.name === '[rows]'); + const rowsAttr = attrs.find((attr) => attr.name === '[rows]'); const insertTo = (sourceCodeLocation?.startTag?.endOffset ?? 0) - 1; diff --git a/projects/cdk/schematics/ng-update/v4/steps/templates/migrate-focusable.ts b/projects/cdk/schematics/ng-update/v4/steps/templates/migrate-focusable.ts index b73efa16b505..53a74893c059 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/templates/migrate-focusable.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/templates/migrate-focusable.ts @@ -30,7 +30,7 @@ export function migrateFocusable({ return; } - const focusableAttr = attrs.find(attr => attr.name === LEGACY_ATTRIBUTE_NAME); + const focusableAttr = attrs.find((attr) => attr.name === LEGACY_ATTRIBUTE_NAME); const attributeLocation = sourceCodeLocation.attrs?.[LEGACY_ATTRIBUTE_NAME]; if (!focusableAttr || !attributeLocation) { diff --git a/projects/cdk/schematics/ng-update/v4/steps/templates/migrate-thumbnail-card.ts b/projects/cdk/schematics/ng-update/v4/steps/templates/migrate-thumbnail-card.ts index dea3cb2fc7a5..100d5b9de674 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/templates/migrate-thumbnail-card.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/templates/migrate-thumbnail-card.ts @@ -29,7 +29,7 @@ export function migrateThumbnailCard({ } const valueAttr = attrs.find( - attr => attr.name === '[cardnumber]' || attr.name === 'cardnumber', + (attr) => attr.name === '[cardnumber]' || attr.name === 'cardnumber', ); if (!valueAttr) { diff --git a/projects/cdk/schematics/ng-update/v4/steps/templates/toggles/common.ts b/projects/cdk/schematics/ng-update/v4/steps/templates/toggles/common.ts index 0ab5f9f0b7b1..2bf81069c796 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/templates/toggles/common.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/templates/toggles/common.ts @@ -33,7 +33,7 @@ export function replaceSizeAttr( templateOffset: number, map = sizeMap, ): void { - const sizeAttr = attrs.find(attr => attr.name === 'size'); + const sizeAttr = attrs.find((attr) => attr.name === 'size'); if (sizeAttr) { const {startOffset, endOffset} = sourceCodeLocation.attrs?.[sizeAttr.name] || { diff --git a/projects/cdk/schematics/ng-update/v4/steps/update-packages.ts b/projects/cdk/schematics/ng-update/v4/steps/update-packages.ts index 95b9c7a9b5be..e9ce21036708 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/update-packages.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/update-packages.ts @@ -10,7 +10,7 @@ import {replacePackageName} from '../../steps'; export function updatePackages({tree}: DevkitFileSystem, _: TuiSchema): void { const packagesToRemove = ['@taiga-ui/addon-tablebars', '@taiga-ui/addon-preview']; - packagesToRemove.forEach(pkg => { + packagesToRemove.forEach((pkg) => { removePackageJsonDependency(tree, pkg); }); diff --git a/projects/cdk/schematics/ng-update/v4/steps/utils/remove-attrs.ts b/projects/cdk/schematics/ng-update/v4/steps/utils/remove-attrs.ts index 2314c3296d42..16403bae6b62 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/utils/remove-attrs.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/utils/remove-attrs.ts @@ -7,7 +7,7 @@ export function removeAttrs( recorder: UpdateRecorder, templateOffset: number, ): void { - attrs.forEach(attr => { + attrs.forEach((attr) => { const attrOffset = sourceCodeLocation.attrs?.[attr.name]; if (attrOffset) { diff --git a/projects/cdk/schematics/ng-update/v4/steps/utils/replace-modules-with-providers.ts b/projects/cdk/schematics/ng-update/v4/steps/utils/replace-modules-with-providers.ts index 7fe77f66d065..8f898ccc9792 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/utils/replace-modules-with-providers.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/utils/replace-modules-with-providers.ts @@ -41,7 +41,7 @@ export const replaceModulesWithProviders = ( function replaceModule({from, to}: ModuleToReplace): void { const references = getNamedImportReferences(from.name, from.moduleSpecifier); - references.forEach(ref => { + references.forEach((ref) => { if (ref.wasForgotten()) { return; } diff --git a/projects/cdk/schematics/ng-update/v4/steps/utils/replace-substrings.ts b/projects/cdk/schematics/ng-update/v4/steps/utils/replace-substrings.ts index 9f7e839f7ce1..ae2e780b6637 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/utils/replace-substrings.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/utils/replace-substrings.ts @@ -16,7 +16,7 @@ export function replaceSubstrings(text: string, replacements: Replacement[]): st let transformed = text; let acc = 0; - replacements.forEach(replacement => { + replacements.forEach((replacement) => { replacement.start += acc; transformed = replaceSubstring(transformed, replacement); acc += replacement.to.length - replacement.from.length; diff --git a/projects/cdk/schematics/utils/add-unique-import.ts b/projects/cdk/schematics/utils/add-unique-import.ts index c79be50dbac1..dde4113e038d 100644 --- a/projects/cdk/schematics/utils/add-unique-import.ts +++ b/projects/cdk/schematics/utils/add-unique-import.ts @@ -21,7 +21,7 @@ export function addUniqueImport( if (existingDeclaration.length) { const modules = existingDeclaration[0] .getNamedImports() - .map(namedImport => namedImport.getText()); + .map((namedImport) => namedImport.getText()); editImports(existingDeclaration[0], () => ({ namedImports: [...modules, namedImport], diff --git a/projects/cdk/schematics/utils/angular-json-manipulations.ts b/projects/cdk/schematics/utils/angular-json-manipulations.ts index 3fbdca5baa8c..279018fda1f0 100644 --- a/projects/cdk/schematics/utils/angular-json-manipulations.ts +++ b/projects/cdk/schematics/utils/angular-json-manipulations.ts @@ -12,7 +12,7 @@ import {getProjectTargetOptions} from './get-project-target-options'; import {getProjects} from './get-projects'; function hasTaigaIcons(assets: Asset[]): boolean { - return !!assets?.find(asset => + return !!assets?.find((asset) => tuiIsString(asset) ? asset.includes('taiga-ui') : asset?.input?.includes('taiga-ui'), @@ -45,7 +45,7 @@ export function addStylesToAngularJson( ',', )} to angular.json manually.`; - return updateWorkspace(workspace => { + return updateWorkspace((workspace) => { const projects = getProjects(options, workspace); if (!projects.length) { @@ -85,13 +85,13 @@ export function addStylesToAngularJson( if ( stylesToReplace && - styles?.filter(style => style !== stylesToReplace.from) + styles?.filter((style) => style !== stylesToReplace.from) ) { targetOptions.styles = Array.from( new Set([ ...taigaStyles, ...stylesToReplace.to, - ...styles.filter(style => style !== stylesToReplace.from), + ...styles.filter((style) => style !== stylesToReplace.from), ]), ); } else { diff --git a/projects/cdk/schematics/utils/get-named-import-references.ts b/projects/cdk/schematics/utils/get-named-import-references.ts index 73e8d4e38fc4..1b3fdb5c127e 100644 --- a/projects/cdk/schematics/utils/get-named-import-references.ts +++ b/projects/cdk/schematics/utils/get-named-import-references.ts @@ -13,22 +13,22 @@ export function getNamedImportReferences( moduleSpecifier, }); - const namedImports = importDeclarations.map(declaration => + const namedImports = importDeclarations.map((declaration) => declaration .getNamedImports() - .find(specifier => specifier.getName() === namedImport) + .find((specifier) => specifier.getName() === namedImport) ?.getNameNode(), ); return arrayFlat( namedImports.map( - specifier => + (specifier) => specifier?.findReferencesAsNodes().filter( /** * Otherwise, each `findReferencesAsNodes` will return references across THE WHOLE project. * It will cause a lot of duplicates in the result and significantly slow down the process. */ - ref => + (ref) => ref.getSourceFile().getFilePath() === specifier?.getSourceFile().getFilePath(), ) || [], diff --git a/projects/cdk/schematics/utils/get-standalone-bootstrap-function.ts b/projects/cdk/schematics/utils/get-standalone-bootstrap-function.ts index 0213c679d3ff..e63fd67472f5 100644 --- a/projects/cdk/schematics/utils/get-standalone-bootstrap-function.ts +++ b/projects/cdk/schematics/utils/get-standalone-bootstrap-function.ts @@ -9,8 +9,8 @@ export function getStandaloneBootstrapFunction(path: string): CallExpression | n '@angular/platform-browser', path, ) - .map(ref => ref.getParent()) - .find(node => Node.isCallExpression(node)); + .map((ref) => ref.getParent()) + .find((node) => Node.isCallExpression(node)); const standaloneBootstrapFunction = standaloneBootstrapIdentifier as CallExpression; diff --git a/projects/cdk/schematics/utils/import-manipulations.ts b/projects/cdk/schematics/utils/import-manipulations.ts index 9876f33b096c..aa784bfa649a 100644 --- a/projects/cdk/schematics/utils/import-manipulations.ts +++ b/projects/cdk/schematics/utils/import-manipulations.ts @@ -12,7 +12,7 @@ export function renameImport(specifier: ImportSpecifier, to: string, from: strin const namedImport = specifier .getImportDeclaration() .getNamedImports() - .find(specifier => specifier.getName() === from); + .find((specifier) => specifier.getName() === from); namedImport?.replaceWithText(to); } diff --git a/projects/cdk/schematics/utils/push-to-array-property.ts b/projects/cdk/schematics/utils/push-to-array-property.ts index ca9a86745a46..e7da95706b6b 100644 --- a/projects/cdk/schematics/utils/push-to-array-property.ts +++ b/projects/cdk/schematics/utils/push-to-array-property.ts @@ -33,7 +33,7 @@ export function pushToObjectArrayProperty( unique && importsInitializer .getElements() - .some(element => element.getText() === initializer) + .some((element) => element.getText() === initializer) ) { return; } diff --git a/projects/cdk/schematics/utils/templates/elements.ts b/projects/cdk/schematics/utils/templates/elements.ts index 2b91402d654d..9b28c2299f4b 100644 --- a/projects/cdk/schematics/utils/templates/elements.ts +++ b/projects/cdk/schematics/utils/templates/elements.ts @@ -8,7 +8,7 @@ export function findElementsByFn( const elements: Element[] = []; const visitNodes = (nodes: ChildNode[]): void => { - nodes.forEach(n => { + nodes.forEach((n) => { const node = n as Element; if (node.childNodes) { @@ -46,11 +46,14 @@ export function findElementsByTagName( // eslint-disable-next-line no-restricted-syntax filterFn: (element: Element) => boolean = () => true, ): Element[] { - return findElementsInTemplateByFn(html, el => el.tagName === tagName && filterFn(el)); + return findElementsInTemplateByFn( + html, + (el) => el.tagName === tagName && filterFn(el), + ); } export function findElementsByTagNames(html: string, tagNames: string[]): Element[] { - return findElementsInTemplateByFn(html, el => tagNames.includes(el.tagName)); + return findElementsInTemplateByFn(html, (el) => tagNames.includes(el.tagName)); } /** @@ -64,7 +67,7 @@ export function findElementsWithDirective( const lowercasedAttrName = attributeName.toLowerCase(); const inputName = `[${lowercasedAttrName}]`; - return findElementsInTemplateByFn(html, el => + return findElementsInTemplateByFn(html, (el) => el.attrs?.some(({name}) => name === lowercasedAttrName || name === inputName), ); } @@ -77,8 +80,8 @@ export function findElementsWithAttribute( html: string, attributeName: string, ): Element[] { - return findElementsInTemplateByFn(html, el => - el.attrs?.some(attr => attr.name === attributeName.toLowerCase()), + return findElementsInTemplateByFn(html, (el) => + el.attrs?.some((attr) => attr.name === attributeName.toLowerCase()), ); } @@ -96,10 +99,10 @@ export function findElementsWithAttributeOnTag( ): Element[] { return findElementsInTemplateByFn( html, - el => + (el) => (!attributeNames.length || - el.attrs?.some(attr => - attributeNames.map(name => name.toLowerCase()).includes(attr.name), + el.attrs?.some((attr) => + attributeNames.map((name) => name.toLowerCase()).includes(attr.name), )) && (tagNames.includes(el.tagName) || tagNames.includes('*') || @@ -121,11 +124,11 @@ export function findAttributeOnElementWithTag( ): number[] { return findElementsWithAttribute(html, name) .filter( - element => + (element) => (tagNames.includes(element.tagName) || tagNames.includes('*')) && filterFn(element), ) - .map(element => getStartOffsetOfAttribute(element, name)); + .map((element) => getStartOffsetOfAttribute(element, name)); } /** @@ -141,16 +144,16 @@ export function findAttributeOnElementWithAttrs( ): number[] { return findElementsWithAttribute(html, name) .filter( - element => - attrs.some(attr => hasElementAttribute(element, attr)) && + (element) => + attrs.some((attr) => hasElementAttribute(element, attr)) && filterFn(element), ) - .map(element => getStartOffsetOfAttribute(element, name)); + .map((element) => getStartOffsetOfAttribute(element, name)); } /** Shorthand function that checks if the specified element contains the given attribute. */ export function hasElementAttribute(element: Element, attributeName: string): boolean { - return element.attrs?.some(attr => attr.name === attributeName.toLowerCase()); + return element.attrs?.some((attr) => attr.name === attributeName.toLowerCase()); } /** Gets the start offset of the given attribute from a Parse5 element. */ diff --git a/projects/cdk/schematics/utils/templates/get-component-templates.ts b/projects/cdk/schematics/utils/templates/get-component-templates.ts index be17b23e5555..4e1799c90e53 100644 --- a/projects/cdk/schematics/utils/templates/get-component-templates.ts +++ b/projects/cdk/schematics/utils/templates/get-component-templates.ts @@ -58,7 +58,7 @@ export function getComponentTemplates( query?: Query, 'kind'>>, ): TemplateResource[] { return getClasses(pattern, query) - .map(declaration => declaration.getDecorator('Component')) + .map((declaration) => declaration.getDecorator('Component')) .filter((decorator): decorator is Decorator => !!decorator) .map(decoratorToTemplateResource) .filter((x: T | null): x is T => Boolean(x)); diff --git a/projects/cdk/schematics/utils/templates/inputs.ts b/projects/cdk/schematics/utils/templates/inputs.ts index c5033a126ef7..5494167b48e1 100644 --- a/projects/cdk/schematics/utils/templates/inputs.ts +++ b/projects/cdk/schematics/utils/templates/inputs.ts @@ -1,7 +1,7 @@ import type {Attribute} from 'parse5/dist/common/token'; export function findAttr(attrs: Attribute[], name: string): Attribute | undefined { - return attrs.find(attr => attr.name === name || attr.name === `[${name}]`); + return attrs.find((attr) => attr.name === name || attr.name === `[${name}]`); } export function isBinding(attr: Attribute): boolean { diff --git a/projects/cdk/schematics/utils/templates/ng-component-input-manipulations.ts b/projects/cdk/schematics/utils/templates/ng-component-input-manipulations.ts index 0c998af3ec4d..b462720d9c23 100644 --- a/projects/cdk/schematics/utils/templates/ng-component-input-manipulations.ts +++ b/projects/cdk/schematics/utils/templates/ng-component-input-manipulations.ts @@ -66,11 +66,11 @@ export function replaceInputProperty({ const stringProperties = [ ...findAttributeOnElementWithTag(template, from, selector, filterFn), ...findAttributeOnElementWithAttrs(template, from, selector, filterFn), - ].map(offset => templateOffset + offset); + ].map((offset) => templateOffset + offset); const propertyBindings = [ ...findAttributeOnElementWithTag(template, `[${from}]`, selector, filterFn), ...findAttributeOnElementWithAttrs(template, `[${from}]`, selector, filterFn), - ].map(offset => templateOffset + offset); + ].map((offset) => templateOffset + offset); const propertyValues = newValue ? getInputPropertyValueOffsets(template, from, selector).map(([start, end]) => [ templateOffset + start, @@ -82,12 +82,12 @@ export function replaceInputProperty({ return false; } - stringProperties.forEach(offset => { + stringProperties.forEach((offset) => { recorder.remove(offset, from.length); recorder.insertRight(offset, to); }); - propertyBindings.forEach(offset => { + propertyBindings.forEach((offset) => { recorder.remove(offset, `[${from}]`.length); recorder.insertRight(offset, to.startsWith('[') ? to : `[${to}]`); }); @@ -116,7 +116,7 @@ export function getInputPropertyOffsets( ): Array<[number, number]> { return findElementsWithAttribute(html, attrName) .filter( - element => + (element) => (tags.includes(element.tagName) || tags.includes('*')) && filterFn(element), ) diff --git a/projects/cdk/services/popover.service.ts b/projects/cdk/services/popover.service.ts index 19b0b69b32ee..22c0792e6aa0 100644 --- a/projects/cdk/services/popover.service.ts +++ b/projects/cdk/services/popover.service.ts @@ -40,7 +40,7 @@ export abstract class TuiPopoverService { content: PolymorpheusContent>, options: Partial = {}, ): Observable { - return new Observable(observer => { + return new Observable((observer) => { const item = { ...this.options, ...options, @@ -58,7 +58,7 @@ export abstract class TuiPopoverService { this.items$.next([...this.items$.value, item]); return () => { - this.items$.next(this.items$.value.filter(value => value !== item)); + this.items$.next(this.items$.value.filter((value) => value !== item)); }; }); } diff --git a/projects/cdk/services/scroll.service.ts b/projects/cdk/services/scroll.service.ts index fe425f3c7bde..4539b02e673d 100644 --- a/projects/cdk/services/scroll.service.ts +++ b/projects/cdk/services/scroll.service.ts @@ -44,9 +44,11 @@ export class TuiScrollService { const observable = !duration ? of<[number, number]>([scrollTop, scrollLeft]) : defer(() => of(this.performanceRef.now())).pipe( - switchMap(start => this.animationFrame$.pipe(map(now => now - start))), - map(elapsed => tuiEaseInOutQuad(tuiClamp(elapsed / duration, 0, 1))), - map(percent => [ + switchMap((start) => + this.animationFrame$.pipe(map((now) => now - start)), + ), + map((elapsed) => tuiEaseInOutQuad(tuiClamp(elapsed / duration, 0, 1))), + map((percent) => [ initialTop + deltaTop * percent, initialLeft + deltaLeft * percent, ]), diff --git a/projects/cdk/services/static-request.service.ts b/projects/cdk/services/static-request.service.ts index 8714318d8989..ca262a3e0326 100644 --- a/projects/cdk/services/static-request.service.ts +++ b/projects/cdk/services/static-request.service.ts @@ -17,7 +17,7 @@ export class TuiStaticRequestService { } const piped = fromFetch(url).pipe( - switchMap(async response => { + switchMap(async (response) => { if (response.ok) { return response.text(); } diff --git a/projects/cdk/tokens/active-element.ts b/projects/cdk/tokens/active-element.ts index a5b79910074d..c8d3711221b1 100644 --- a/projects/cdk/tokens/active-element.ts +++ b/projects/cdk/tokens/active-element.ts @@ -77,10 +77,10 @@ export const TUI_ACTIVE_ELEMENT = tuiCreateTokenFromFactory< ), blur$.pipe( map(() => doc.activeElement), - filter(element => !!element?.matches('iframe')), + filter((element) => !!element?.matches('iframe')), ), focusin$.pipe( - switchMap(event => { + switchMap((event) => { const target = tuiGetActualTarget(event); const root = tuiGetDocumentOrShadowRoot(target) as Document; @@ -90,7 +90,7 @@ export const TUI_ACTIVE_ELEMENT = tuiCreateTokenFromFactory< }), ), mousedown$.pipe( - switchMap(event => { + switchMap((event) => { const actualTargetInCurrentTime = tuiGetActualTarget(event); return !doc.activeElement || doc.activeElement === doc.body diff --git a/projects/cdk/tokens/removed-element.ts b/projects/cdk/tokens/removed-element.ts index a878659799c3..75141802974c 100644 --- a/projects/cdk/tokens/removed-element.ts +++ b/projects/cdk/tokens/removed-element.ts @@ -18,7 +18,7 @@ export const TUI_REMOVED_ELEMENT = tuiCreateTokenFromFactory(() => { }; return element$.pipe( - switchMap(element => + switchMap((element) => timer(0).pipe( map(() => null), startWith(element), diff --git a/projects/cdk/utils/color/hex-to-rgb.ts b/projects/cdk/utils/color/hex-to-rgb.ts index 662206e2c7af..547854a7e443 100644 --- a/projects/cdk/utils/color/hex-to-rgb.ts +++ b/projects/cdk/utils/color/hex-to-rgb.ts @@ -7,6 +7,6 @@ export function tuiHexToRgb(hex: string): [number, number, number] { .match(/.{2}/g); return matches - ? (matches.map(x => Number.parseInt(x, 16)) as [number, number, number]) + ? (matches.map((x) => Number.parseInt(x, 16)) as [number, number, number]) : [0, 0, 0]; } diff --git a/projects/cdk/utils/color/parse-color.ts b/projects/cdk/utils/color/parse-color.ts index 416158dce68a..06f84007e053 100644 --- a/projects/cdk/utils/color/parse-color.ts +++ b/projects/cdk/utils/color/parse-color.ts @@ -6,7 +6,7 @@ export function tuiParseColor(color: string): [number, number, number, number] { .replace('rgba(', '') .replace('rgb(', '') .replace(')', ''); - const array = stripped.split(',').map(item => parseFloat(item)); + const array = stripped.split(',').map((item) => parseFloat(item)); if (array.length === 4) { return array as [number, number, number, number]; @@ -22,7 +22,7 @@ export function tuiParseColor(color: string): [number, number, number, number] { return DEFAULT; } - const parsed = matches.map(char => + const parsed = matches.map((char) => parseInt(stripped.length % 2 ? char + char : char, 16), ); diff --git a/projects/cdk/utils/color/rgb-to-hex.ts b/projects/cdk/utils/color/rgb-to-hex.ts index 411638abb550..e02033d86085 100644 --- a/projects/cdk/utils/color/rgb-to-hex.ts +++ b/projects/cdk/utils/color/rgb-to-hex.ts @@ -1,3 +1,3 @@ export function tuiRgbToHex(r: number, g: number, b: number): string { - return `#${[r, g, b].map(x => x.toString(16).padStart(2, '0')).join('')}`; + return `#${[r, g, b].map((x) => x.toString(16).padStart(2, '0')).join('')}`; } diff --git a/projects/cdk/utils/dom/get-element-obscurers.ts b/projects/cdk/utils/dom/get-element-obscurers.ts index 98867aaa48ca..42ccae10d7cb 100644 --- a/projects/cdk/utils/dom/get-element-obscurers.ts +++ b/projects/cdk/utils/dom/get-element-obscurers.ts @@ -54,7 +54,9 @@ export function tuiGetElementObscures( return []; } - const filtered = nonNull.filter(el => !element.contains(el) && !el.contains(element)); + const filtered = nonNull.filter( + (el) => !element.contains(el) && !el.contains(element), + ); return filtered.length === 4 ? (filtered as [Element, Element, Element, Element]) diff --git a/projects/cdk/utils/dom/test/get-element-obscurers.spec.ts b/projects/cdk/utils/dom/test/get-element-obscurers.spec.ts index 74bb6e98844a..af2b819526d3 100644 --- a/projects/cdk/utils/dom/test/get-element-obscurers.spec.ts +++ b/projects/cdk/utils/dom/test/get-element-obscurers.spec.ts @@ -67,7 +67,7 @@ describe('tuiGetElementObscures', () => { ownerDocument.createElement('p'), ]; - others.forEach(el => document.body.appendChild(el)); + others.forEach((el) => document.body.appendChild(el)); const mockElementFromPoint = jest .fn() @@ -96,7 +96,7 @@ describe('tuiGetElementObscures', () => { ownerDocument.createElement('p'), ]; - others.forEach(el => document.body.appendChild(el)); + others.forEach((el) => document.body.appendChild(el)); const mockElementFromPoint = jest.mocked(ownerDocument.elementFromPoint); @@ -154,7 +154,7 @@ describe('tuiGetElementObscures', () => { ownerDocument.createElement('p'), ]; - others.forEach(el => document.body.appendChild(el)); + others.forEach((el) => document.body.appendChild(el)); const mockElementFromPoint = jest .fn() diff --git a/projects/cdk/utils/miscellaneous/mark-control-as-touched-and-validate.ts b/projects/cdk/utils/miscellaneous/mark-control-as-touched-and-validate.ts index deb738b515b2..79372bae921a 100644 --- a/projects/cdk/utils/miscellaneous/mark-control-as-touched-and-validate.ts +++ b/projects/cdk/utils/miscellaneous/mark-control-as-touched-and-validate.ts @@ -3,13 +3,13 @@ import {FormArray, FormGroup} from '@angular/forms'; export function tuiMarkControlAsTouchedAndValidate(control: AbstractControl): void { if (control instanceof FormArray) { - control.controls.forEach(nestedControl => { + control.controls.forEach((nestedControl) => { tuiMarkControlAsTouchedAndValidate(nestedControl); }); } if (control instanceof FormGroup) { - Object.values(control.controls).forEach(nestedControl => { + Object.values(control.controls).forEach((nestedControl) => { tuiMarkControlAsTouchedAndValidate(nestedControl); }); } diff --git a/projects/cdk/utils/miscellaneous/with-styles.ts b/projects/cdk/utils/miscellaneous/with-styles.ts index 8d1927d63ddc..e43637eb12de 100644 --- a/projects/cdk/utils/miscellaneous/with-styles.ts +++ b/projects/cdk/utils/miscellaneous/with-styles.ts @@ -6,7 +6,7 @@ import {tuiCreateTokenFromFactory} from './create-token'; const MAP = tuiCreateTokenFromFactory(() => { const map = new Map(); - inject(DestroyRef).onDestroy(() => map.forEach(component => component.destroy())); + inject(DestroyRef).onDestroy(() => map.forEach((component) => component.destroy())); return map; }); diff --git a/projects/core/classes/accessors.ts b/projects/core/classes/accessors.ts index b505dc9e8119..dc1125767136 100644 --- a/projects/core/classes/accessors.ts +++ b/projects/core/classes/accessors.ts @@ -31,8 +31,9 @@ export function tuiFallbackAccessor( type: string, ): (accessors: readonly T[] | null, fallback: T) => T { return (accessors, fallback) => - accessors?.find?.(accessor => accessor !== fallback && accessor.type === type) || - fallback; + accessors?.find?.( + (accessor) => accessor !== fallback && accessor.type === type, + ) || fallback; } export function tuiPositionAccessorFor( diff --git a/projects/core/classes/driver.ts b/projects/core/classes/driver.ts index b81eed6dc0a5..457c1ddcba70 100644 --- a/projects/core/classes/driver.ts +++ b/projects/core/classes/driver.ts @@ -27,7 +27,7 @@ export abstract class TuiDriverDirective implements OnInit { merge(...this.drivers.filter(({type}) => type === this.type)) .pipe(distinctUntilChanged(), takeUntilDestroyed(this.destroyRef)) - .subscribe(value => { + .subscribe((value) => { vehicle?.toggle(value); }); } diff --git a/projects/core/components/alert/alert.tokens.ts b/projects/core/components/alert/alert.tokens.ts index 92472f279a2c..5dacfb74ae00 100644 --- a/projects/core/components/alert/alert.tokens.ts +++ b/projects/core/components/alert/alert.tokens.ts @@ -42,7 +42,7 @@ export const TUI_ALERTS_GROUPED = tuiCreateTokenFromFactory(() => map(([map, alerts]) => { map.forEach((_, key) => map.set(key, [])); - alerts.forEach(alert => { + alerts.forEach((alert) => { const key = alert.component.component; const value = map.get(key) || []; diff --git a/projects/core/components/alert/alerts.component.ts b/projects/core/components/alert/alerts.component.ts index ae6e428fe5f9..e4c2fac473e5 100644 --- a/projects/core/components/alert/alerts.component.ts +++ b/projects/core/components/alert/alerts.component.ts @@ -33,7 +33,7 @@ export class TuiAlerts { protected readonly alerts$ = inject(TUI_ALERTS_GROUPED); protected readonly trackBy = identity; - protected readonly mapper: TuiMapper<[Type], Injector> = useValue => + protected readonly mapper: TuiMapper<[Type], Injector> = (useValue) => Injector.create({ providers: [ { diff --git a/projects/core/components/calendar/calendar-sheet.component.ts b/projects/core/components/calendar/calendar-sheet.component.ts index fcb4c11de7d5..70a4bb9d70b2 100644 --- a/projects/core/components/calendar/calendar-sheet.component.ts +++ b/projects/core/components/calendar/calendar-sheet.component.ts @@ -104,7 +104,7 @@ export class TuiCalendarSheet { } if (!(value instanceof TuiDayRange)) { - return value.find(day => day.daySame(item)) ? 'single' : null; + return value.find((day) => day.daySame(item)) ? 'single' : null; } if ( diff --git a/projects/core/components/calendar/calendar-year.component.ts b/projects/core/components/calendar/calendar-year.component.ts index d378e1be82e7..ec0ff27237ca 100644 --- a/projects/core/components/calendar/calendar-year.component.ts +++ b/projects/core/components/calendar/calendar-year.component.ts @@ -87,7 +87,7 @@ export class TuiCalendarYear { } if (!(value instanceof TuiMonthRange)) { - return value.find(day => day.year === item) ? 'single' : null; + return value.find((day) => day.year === item) ? 'single' : null; } if ( diff --git a/projects/core/components/calendar/calendar.component.ts b/projects/core/components/calendar/calendar.component.ts index f49cafcab215..9c912e36aead 100644 --- a/projects/core/components/calendar/calendar.component.ts +++ b/projects/core/components/calendar/calendar.component.ts @@ -134,7 +134,7 @@ export class TuiCalendar { protected readonly disabledItemHandlerMapper: TuiMapper< [TuiBooleanHandler, TuiDay, TuiDay], TuiBooleanHandler - > = (disabledItemHandler, min, max) => item => + > = (disabledItemHandler, min, max) => (item) => item.dayBefore(min) || item.dayAfter(max) || disabledItemHandler(item); protected onPaginationYearClick(): void { diff --git a/projects/core/components/calendar/test/calendar-sheet.component.spec.ts b/projects/core/components/calendar/test/calendar-sheet.component.spec.ts index 2553e4a26d90..04988aaeee51 100644 --- a/projects/core/components/calendar/test/calendar-sheet.component.spec.ts +++ b/projects/core/components/calendar/test/calendar-sheet.component.spec.ts @@ -333,7 +333,7 @@ describe('CalendarSheet', () => { fixture.debugElement.queryAll(By.css('.t-row_weekday .t-cell')) || []; return daysOfWeekContainers.map( - container => container.nativeElement.textContent, + (container) => container.nativeElement.textContent, ); } @@ -352,7 +352,7 @@ describe('CalendarSheet', () => { function getColumnDates(columnIndex: number): string[] { const columnDatesContainers = getColumnCells(columnIndex); - return columnDatesContainers.map(container => + return columnDatesContainers.map((container) => container.nativeElement.textContent.trim(), ); } diff --git a/projects/core/components/dialog/dialog-close.service.ts b/projects/core/components/dialog/dialog-close.service.ts index dd2fa51994c6..94f8c31f4603 100644 --- a/projects/core/components/dialog/dialog-close.service.ts +++ b/projects/core/components/dialog/dialog-close.service.ts @@ -20,7 +20,7 @@ export class TuiDialogCloseService extends Observable { private readonly el = tuiInjectElement(); private readonly esc$ = tuiTypedFromEvent(this.doc, 'keydown').pipe( - filter(event => { + filter((event) => { const target = tuiGetActualTarget(event); return ( @@ -33,7 +33,7 @@ export class TuiDialogCloseService extends Observable { private readonly mousedown$ = tuiTypedFromEvent(this.doc, 'mousedown').pipe( filter( - event => + (event) => tuiGetViewportWidth(this.win) - event.clientX > SCROLLBAR_PLACEHOLDER && this.isOutside(tuiGetActualTarget(event)), ), @@ -41,13 +41,13 @@ export class TuiDialogCloseService extends Observable { tuiTypedFromEvent(this.doc, 'mouseup').pipe( take(1), map(tuiGetActualTarget), - filter(target => this.isOutside(target)), + filter((target) => this.isOutside(target)), ), ), ); constructor() { - super(subscriber => merge(this.esc$, this.mousedown$).subscribe(subscriber)); + super((subscriber) => merge(this.esc$, this.mousedown$).subscribe(subscriber)); } private isOutside(target: EventTarget): boolean { diff --git a/projects/core/components/root/root.component.ts b/projects/core/components/root/root.component.ts index 4e568f1f006b..4d34a60974f5 100644 --- a/projects/core/components/root/root.component.ts +++ b/projects/core/components/root/root.component.ts @@ -55,7 +55,7 @@ export class TuiRoot { protected readonly isMobileRes = toSignal( inject(TuiBreakpointService).pipe( - map(breakpoint => breakpoint === 'mobile'), + map((breakpoint) => breakpoint === 'mobile'), tuiWatch(inject(ChangeDetectorRef)), ), ); diff --git a/projects/core/components/scrollbar/scrollbar.service.ts b/projects/core/components/scrollbar/scrollbar.service.ts index cdf85e4bfc3e..0644d56fa9e8 100644 --- a/projects/core/components/scrollbar/scrollbar.service.ts +++ b/projects/core/components/scrollbar/scrollbar.service.ts @@ -10,18 +10,18 @@ export class TuiScrollbarService extends Observable<[number, number]> { private readonly element = inject(TUI_SCROLL_REF).nativeElement; private readonly scroll$ = merge( tuiTypedFromEvent(this.el.parentElement!, 'mousedown').pipe( - map(event => this.getScrolled(event, 0.5, 0.5)), + map((event) => this.getScrolled(event, 0.5, 0.5)), ), tuiTypedFromEvent(this.el, 'mousedown').pipe( tuiZonefree(inject(NgZone)), - switchMap(event => { + switchMap((event) => { const {ownerDocument} = this.el; const rect = this.el.getBoundingClientRect(); const vertical = getOffsetVertical(event, rect); const horizontal = getOffsetHorizontal(event, rect); return tuiTypedFromEvent(ownerDocument, 'mousemove').pipe( - map(event => this.getScrolled(event, vertical, horizontal)), + map((event) => this.getScrolled(event, vertical, horizontal)), takeUntil(tuiTypedFromEvent(ownerDocument, 'mouseup')), ); }), @@ -29,7 +29,7 @@ export class TuiScrollbarService extends Observable<[number, number]> { ); constructor() { - super(subscriber => this.scroll$.subscribe(subscriber)); + super((subscriber) => this.scroll$.subscribe(subscriber)); } private getScrolled( diff --git a/projects/core/directives/date-format/date-format.directive.ts b/projects/core/directives/date-format/date-format.directive.ts index 1fab9aa4939a..f55c9dd86776 100644 --- a/projects/core/directives/date-format/date-format.directive.ts +++ b/projects/core/directives/date-format/date-format.directive.ts @@ -14,7 +14,7 @@ export class TuiDateFormat extends Observable { private readonly parent = inject(TUI_DATE_FORMAT, {skipSelf: true}); constructor() { - super(subscriber => + super((subscriber) => combineLatest([this.parent, this.settings]) .pipe(map(([parent, settings]) => ({...parent, ...settings}))) .subscribe(subscriber), diff --git a/projects/core/directives/dropdown/dropdown-hover.directive.ts b/projects/core/directives/dropdown/dropdown-hover.directive.ts index 5e7a8712c7bd..3c7226685eed 100644 --- a/projects/core/directives/dropdown/dropdown-hover.directive.ts +++ b/projects/core/directives/dropdown/dropdown-hover.directive.ts @@ -37,13 +37,13 @@ export class TuiDropdownHover extends TuiDriver { private readonly open = inject(TuiDropdownOpen, {optional: true}); private readonly stream$ = merge( tuiTypedFromEvent(this.doc, 'mouseover').pipe(map(tuiGetActualTarget)), - tuiTypedFromEvent(this.doc, 'mouseout').pipe(map(e => e.relatedTarget)), + tuiTypedFromEvent(this.doc, 'mouseout').pipe(map((e) => e.relatedTarget)), ).pipe( - map(element => tuiIsElement(element) && this.isHovered(element)), + map((element) => tuiIsElement(element) && this.isHovered(element)), distinctUntilChanged(), - switchMap(v => of(v).pipe(delay(v ? this.showDelay : this.hideDelay))), + switchMap((v) => of(v).pipe(delay(v ? this.showDelay : this.hideDelay))), tuiZoneOptimized(inject(NgZone)), - tap(hovered => { + tap((hovered) => { this.hovered = hovered; this.open?.toggle(hovered); }), @@ -61,7 +61,7 @@ export class TuiDropdownHover extends TuiDriver { public readonly type = 'dropdown'; constructor() { - super(subscriber => this.stream$.subscribe(subscriber)); + super((subscriber) => this.stream$.subscribe(subscriber)); } @HostListener('click.capture', ['$event']) diff --git a/projects/core/directives/dropdown/dropdown-open.directive.ts b/projects/core/directives/dropdown/dropdown-open.directive.ts index 6ab1c26f12e4..fc852bf9ade8 100644 --- a/projects/core/directives/dropdown/dropdown-open.directive.ts +++ b/projects/core/directives/dropdown/dropdown-open.directive.ts @@ -68,11 +68,12 @@ export class TuiDropdownOpen implements OnChanges { protected readonly sub = merge( this.obscured.tuiObscured.pipe(filter(Boolean)), - inject(TuiActiveZone).tuiActiveZoneChange.pipe(filter(a => !a)), + inject(TuiActiveZone).tuiActiveZoneChange.pipe(filter((a) => !a)), fromEvent(this.el, 'focusin').pipe( map(tuiGetActualTarget), filter( - target => !this.host.contains(target) || !this.directive?.dropdownBoxRef, + (target) => + !this.host.contains(target) || !this.directive?.dropdownBoxRef, ), ), ) diff --git a/projects/core/directives/dropdown/dropdown-selection.directive.ts b/projects/core/directives/dropdown/dropdown-selection.directive.ts index 20d0a97caa1b..b7bc0205598d 100644 --- a/projects/core/directives/dropdown/dropdown-selection.directive.ts +++ b/projects/core/directives/dropdown/dropdown-selection.directive.ts @@ -79,7 +79,7 @@ export class TuiDropdownSelection public readonly type = 'dropdown'; constructor() { - super(subscriber => this.stream$.subscribe(subscriber)); + super((subscriber) => this.stream$.subscribe(subscriber)); } @Input() diff --git a/projects/core/directives/dropdown/dropdown.component.ts b/projects/core/directives/dropdown/dropdown.component.ts index 0ee3ff0b0be7..a3d059a57efa 100644 --- a/projects/core/directives/dropdown/dropdown.component.ts +++ b/projects/core/directives/dropdown/dropdown.component.ts @@ -66,7 +66,7 @@ export class TuiDropdownComponent implements OnInit { protected readonly sub = inject(TuiPositionService) .pipe( - map(v => (this.directive.position === 'fixed' ? this.vvs.correct(v) : v)), + map((v) => (this.directive.position === 'fixed' ? this.vvs.correct(v) : v)), takeUntilDestroyed(), ) .subscribe(([top, left]) => { diff --git a/projects/core/directives/hint/hint-describe.directive.ts b/projects/core/directives/hint/hint-describe.directive.ts index ac0254bdd1c7..ef9e536709d4 100644 --- a/projects/core/directives/hint/hint-describe.directive.ts +++ b/projects/core/directives/hint/hint-describe.directive.ts @@ -39,7 +39,7 @@ export class TuiHintDescribe extends TuiDriver { tuiTypedFromEvent(this.element, 'blur'), ).pipe(map(() => this.focused)), ), - debounce(visible => (visible ? timer(1000) : of(null))), + debounce((visible) => (visible ? timer(1000) : of(null))), startWith(false), distinctUntilChanged(), skip(1), @@ -49,7 +49,7 @@ export class TuiHintDescribe extends TuiDriver { public readonly type = 'hint'; constructor() { - super(subscriber => this.stream$.subscribe(subscriber)); + super((subscriber) => this.stream$.subscribe(subscriber)); } @Input() diff --git a/projects/core/directives/hint/hint-hover.directive.ts b/projects/core/directives/hint/hint-hover.directive.ts index e1b2be4a3233..79005034f1f8 100644 --- a/projects/core/directives/hint/hint-hover.directive.ts +++ b/projects/core/directives/hint/hint-hover.directive.ts @@ -32,14 +32,14 @@ export class TuiHintHover extends TuiDriver { private readonly toggle$ = new Subject(); private readonly stream$ = merge( this.toggle$.pipe( - switchMap(visible => + switchMap((visible) => of(visible).pipe(delay(visible ? 0 : this.tuiHintHideDelay)), ), takeUntil(this.hovered$), repeat(), ), this.hovered$.pipe( - switchMap(visible => + switchMap((visible) => of(visible).pipe( delay(visible ? this.tuiHintShowDelay : this.tuiHintHideDelay), ), @@ -50,11 +50,11 @@ export class TuiHintHover extends TuiDriver { ).pipe( filter(() => this.enabled), map( - value => + (value) => value && (this.el.hasAttribute('tuiHintPointer') || !tuiIsObscured(this.el)), ), - tap(visible => { + tap((visible) => { this.visible = visible; }), ); @@ -77,7 +77,7 @@ export class TuiHintHover extends TuiDriver { public readonly el = tuiInjectElement(); constructor() { - super(subscriber => this.stream$.subscribe(subscriber)); + super((subscriber) => this.stream$.subscribe(subscriber)); } public toggle(visible = !this.visible): void { diff --git a/projects/core/directives/hint/hint-manual.directive.ts b/projects/core/directives/hint/hint-manual.directive.ts index ff7fa5c38324..b99a9f08ed67 100644 --- a/projects/core/directives/hint/hint-manual.directive.ts +++ b/projects/core/directives/hint/hint-manual.directive.ts @@ -20,7 +20,7 @@ export class TuiHintManual extends TuiDriver implements OnChanges { public readonly type = 'hint'; constructor() { - super(subscriber => this.stream$.subscribe(subscriber)); + super((subscriber) => this.stream$.subscribe(subscriber)); this.hover.enabled = false; } diff --git a/projects/core/directives/hint/hint-position.directive.ts b/projects/core/directives/hint/hint-position.directive.ts index f970fc414b61..df1f69f21fc2 100644 --- a/projects/core/directives/hint/hint-position.directive.ts +++ b/projects/core/directives/hint/hint-position.directive.ts @@ -76,7 +76,7 @@ export class TuiHintPosition extends TuiPositionAccessor { return this.points[this.direction]; } - const direction = TUI_HINT_DIRECTIONS.find(direction => + const direction = TUI_HINT_DIRECTIONS.find((direction) => this.checkPosition(this.points[direction], width, height), ); diff --git a/projects/core/directives/hint/hint.component.ts b/projects/core/directives/hint/hint.component.ts index de3f46f8d245..cf7cd1eddbb5 100644 --- a/projects/core/directives/hint/hint.component.ts +++ b/projects/core/directives/hint/hint.component.ts @@ -82,7 +82,7 @@ export class TuiHintComponent { constructor() { inject(TuiPositionService) .pipe( - map(point => this.vvs.correct(point)), + map((point) => this.vvs.correct(point)), takeUntilDestroyed(), ) .subscribe(([top, left]) => { @@ -91,7 +91,7 @@ export class TuiHintComponent { inject(TuiHoveredService) .pipe(takeUntilDestroyed()) - .subscribe(hover => this.hover.toggle(hover)); + .subscribe((hover) => this.hover.toggle(hover)); } protected get content(): PolymorpheusContent { diff --git a/projects/core/directives/hint/hint.service.ts b/projects/core/directives/hint/hint.service.ts index b8f4dc4ade67..b7996ec9ae26 100644 --- a/projects/core/directives/hint/hint.service.ts +++ b/projects/core/directives/hint/hint.service.ts @@ -19,7 +19,7 @@ export class TuiHintService extends BehaviorSubject { public remove(directive: TuiPortalItem): void { if (this.value.includes(directive)) { - this.next(this.value.filter(hint => hint !== directive)); + this.next(this.value.filter((hint) => hint !== directive)); } } } diff --git a/projects/core/directives/hint/hints.component.ts b/projects/core/directives/hint/hints.component.ts index 04bd23737777..5abd873aec3d 100644 --- a/projects/core/directives/hint/hints.component.ts +++ b/projects/core/directives/hint/hints.component.ts @@ -39,7 +39,7 @@ export class TuiHints implements OnInit { public ngOnInit(): void { // Due to this view being parallel to app content, `markForCheck` from `async` pipe // can happen after view was checked, so calling `detectChanges` instead - this.hints$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(hints => { + this.hints$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((hints) => { this.hints = hints; this.cdr.detectChanges(); }); diff --git a/projects/core/directives/number-format/number-format.directive.ts b/projects/core/directives/number-format/number-format.directive.ts index fba7884cf17a..162ddb025311 100644 --- a/projects/core/directives/number-format/number-format.directive.ts +++ b/projects/core/directives/number-format/number-format.directive.ts @@ -14,7 +14,7 @@ export class TuiNumberFormat extends Observable { private readonly parent = inject(TUI_NUMBER_FORMAT, {skipSelf: true}); constructor() { - super(subscriber => + super((subscriber) => combineLatest([this.parent, this.settings]) .pipe(map(([parent, settings]) => ({...parent, ...settings}))) .subscribe(subscriber), diff --git a/projects/core/package.json b/projects/core/package.json index d9d39d68c279..15d28c1f67d3 100644 --- a/projects/core/package.json +++ b/projects/core/package.json @@ -32,7 +32,7 @@ "@taiga-ui/cdk": "^4.0.0-rc.2", "@taiga-ui/event-plugins": "^4.0.1", "@taiga-ui/i18n": "^4.0.0-rc.2", - "@taiga-ui/polymorpheus": "^4.6.3", + "@taiga-ui/polymorpheus": "^4.6.4", "rxjs": ">=7.0.0", "tslib": "^2.6.3" }, diff --git a/projects/core/pipes/calendar-sheet/calendar-sheet.pipe.ts b/projects/core/pipes/calendar-sheet/calendar-sheet.pipe.ts index 40ef9c34f69b..11b0f132b413 100644 --- a/projects/core/pipes/calendar-sheet/calendar-sheet.pipe.ts +++ b/projects/core/pipes/calendar-sheet/calendar-sheet.pipe.ts @@ -58,7 +58,7 @@ export class TuiCalendarSheetPipe implements PipeTransform { sheet.push(row); } - this.currentSheet = sheet.filter(row => row.length); + this.currentSheet = sheet.filter((row) => row.length); this.currentMonth = month; return this.currentSheet; diff --git a/projects/core/pipes/format-number/format-number.pipe.ts b/projects/core/pipes/format-number/format-number.pipe.ts index 043668ecf711..16a2c69c0102 100644 --- a/projects/core/pipes/format-number/format-number.pipe.ts +++ b/projects/core/pipes/format-number/format-number.pipe.ts @@ -24,7 +24,7 @@ export class TuiFormatNumberPipe implements PipeTransform { settings: Partial = {}, ): Observable { return this.numberFormat.pipe( - map(format => + map((format) => tuiFormatNumber(value, { ...format, precision: Number.isNaN(format.precision) diff --git a/projects/core/pipes/month/month.pipe.ts b/projects/core/pipes/month/month.pipe.ts index 676e28f792af..ebcc09b91770 100644 --- a/projects/core/pipes/month/month.pipe.ts +++ b/projects/core/pipes/month/month.pipe.ts @@ -13,6 +13,6 @@ export class TuiMonthPipe implements PipeTransform { private readonly months$ = inject(TUI_MONTHS); public transform({month}: TuiMonth): Observable { - return this.months$.pipe(map(months => months[month])); + return this.months$.pipe(map((months) => months[month])); } } diff --git a/projects/core/pipes/order-week-days/order-week-days.pipe.ts b/projects/core/pipes/order-week-days/order-week-days.pipe.ts index d95d5dc8ce3f..e44b0a8e9663 100644 --- a/projects/core/pipes/order-week-days/order-week-days.pipe.ts +++ b/projects/core/pipes/order-week-days/order-week-days.pipe.ts @@ -28,7 +28,7 @@ export class TuiOrderWeekDaysPipe implements PipeTransform { return mondayFirstWeekDays$.pipe( map(convertToSundayFirstWeekFormat), map( - weekDays => + (weekDays) => [ ...weekDays.slice(this.firstDayOfWeekIndex), ...weekDays.slice(0, this.firstDayOfWeekIndex), diff --git a/projects/core/services/breakpoint.service.ts b/projects/core/services/breakpoint.service.ts index 23ef10aca0ec..f47ee1efe7b3 100644 --- a/projects/core/services/breakpoint.service.ts +++ b/projects/core/services/breakpoint.service.ts @@ -27,14 +27,14 @@ export class TuiBreakpointService extends Observable this.sorted.find(size => size > width)), - map(key => this.invert[key || this.sorted[this.sorted.length - 1]]), + map(({width}) => this.sorted.find((size) => size > width)), + map((key) => this.invert[key || this.sorted[this.sorted.length - 1]]), distinctUntilChanged(), tuiZoneOptimized(inject(NgZone)), shareReplay({bufferSize: 1, refCount: true}), ); constructor() { - super(subscriber => this.stream$.subscribe(subscriber)); + super((subscriber) => this.stream$.subscribe(subscriber)); } } diff --git a/projects/core/services/dark-theme.service.ts b/projects/core/services/dark-theme.service.ts index 7dd221df6b33..02628fd5885f 100644 --- a/projects/core/services/dark-theme.service.ts +++ b/projects/core/services/dark-theme.service.ts @@ -14,6 +14,6 @@ export class TuiDarkThemeService extends Observable { shareReplay({bufferSize: 1, refCount: true}), ); - super(subscriber => media$.subscribe(subscriber)); + super((subscriber) => media$.subscribe(subscriber)); } } diff --git a/projects/core/services/position.service.ts b/projects/core/services/position.service.ts index 2a3dfecce20a..befed265a7c9 100644 --- a/projects/core/services/position.service.ts +++ b/projects/core/services/position.service.ts @@ -16,11 +16,11 @@ export class TuiPositionService extends Observable { const animationFrame$ = inject(ANIMATION_FRAME); const zone = inject(NgZone); - super(subscriber => + super((subscriber) => animationFrame$ .pipe( map(() => this.el.getBoundingClientRect()), - map(rect => this.accessor.getPosition(rect)), + map((rect) => this.accessor.getPosition(rect)), tuiZonefree(zone), finalize(() => this.accessor.getPosition(EMPTY_CLIENT_RECT)), ) diff --git a/projects/core/services/test/dark-theme.service.spec.ts b/projects/core/services/test/dark-theme.service.spec.ts index f2b8ce47ca78..5c4a3ffa64b0 100644 --- a/projects/core/services/test/dark-theme.service.spec.ts +++ b/projects/core/services/test/dark-theme.service.spec.ts @@ -29,7 +29,7 @@ describe('TuiDarkThemeService', () => { it('returns actual value', () => { let value = false; - service.pipe(take(1)).subscribe(v => { + service.pipe(take(1)).subscribe((v) => { value = v; }); @@ -39,7 +39,7 @@ describe('TuiDarkThemeService', () => { it('fires upon refresh', () => { let value = false; - service.pipe(take(2)).subscribe(v => { + service.pipe(take(2)).subscribe((v) => { value = v; }); diff --git a/projects/core/tokens/date-format.ts b/projects/core/tokens/date-format.ts index 2390085466ca..1bbebd88ee7b 100644 --- a/projects/core/tokens/date-format.ts +++ b/projects/core/tokens/date-format.ts @@ -39,7 +39,7 @@ export function tuiDateFormatProvider(options: Partial): parent: Observable | null, ): Observable => (parent || of(TUI_DEFAULT_DATE_FORMAT)).pipe( - map(format => ({...format, ...options})), + map((format) => ({...format, ...options})), ), }; } diff --git a/projects/core/tokens/day-type-handler.ts b/projects/core/tokens/day-type-handler.ts index 0b871a37ecb7..0351c6ebac13 100644 --- a/projects/core/tokens/day-type-handler.ts +++ b/projects/core/tokens/day-type-handler.ts @@ -5,6 +5,6 @@ import {tuiCreateToken} from '@taiga-ui/cdk/utils/miscellaneous'; /** * Token for adding data-type attribute to calendar cell */ -export const TUI_DAY_TYPE_HANDLER = tuiCreateToken>(day => +export const TUI_DAY_TYPE_HANDLER = tuiCreateToken>((day) => day.isWeekend ? 'weekend' : 'weekday', ); diff --git a/projects/core/tokens/icon-resolver.ts b/projects/core/tokens/icon-resolver.ts index 833487e1e8a6..1b0c05c27c9d 100644 --- a/projects/core/tokens/icon-resolver.ts +++ b/projects/core/tokens/icon-resolver.ts @@ -11,7 +11,7 @@ export const TUI_ICON_START_RESOLVER = tuiCreateTokenFromFactory< >(() => { const path = inject(TUI_ASSETS_PATH); - return icon => + return (icon) => !icon || icon.includes('/') ? icon : `${path}/${icon.replace('@tui.', '').split('.').join('/')}.svg`; @@ -21,7 +21,7 @@ export function tuiInjectIconResolver(): TuiStringHandler { const icons = inject(TUI_ICON_STARTS); const resolver = inject(TUI_ICON_START_RESOLVER); - return icon => icons[icon] || resolver(icon); + return (icon) => icons[icon] || resolver(icon); } export function tuiIconResolverProvider(useValue: TuiStringHandler): Provider { diff --git a/projects/core/tokens/number-format.ts b/projects/core/tokens/number-format.ts index b290b6c1c682..df8d45e70e9f 100644 --- a/projects/core/tokens/number-format.ts +++ b/projects/core/tokens/number-format.ts @@ -62,7 +62,7 @@ export function tuiNumberFormatProvider( parent: Observable | null, ): Observable => (parent || of(TUI_DEFAULT_NUMBER_FORMAT)).pipe( - map(format => ({...format, ...options})), + map((format) => ({...format, ...options})), ), }; } diff --git a/projects/core/utils/miscellaneous/is-obscured.ts b/projects/core/utils/miscellaneous/is-obscured.ts index 5d8174399ba5..c059afe6ebce 100644 --- a/projects/core/utils/miscellaneous/is-obscured.ts +++ b/projects/core/utils/miscellaneous/is-obscured.ts @@ -4,5 +4,5 @@ import {tuiGetElementObscures} from '@taiga-ui/cdk/utils/dom'; * @internal */ export function tuiIsObscured(el: HTMLElement, exceptSelector = 'tui-hints'): boolean { - return !!tuiGetElementObscures(el)?.some(el => !el.closest(exceptSelector)); + return !!tuiGetElementObscures(el)?.some((el) => !el.closest(exceptSelector)); } diff --git a/projects/core/utils/miscellaneous/override-options.ts b/projects/core/utils/miscellaneous/override-options.ts index 49aac23f4d1d..4c1527037df7 100644 --- a/projects/core/utils/miscellaneous/override-options.ts +++ b/projects/core/utils/miscellaneous/override-options.ts @@ -5,7 +5,7 @@ export function tuiOverrideOptions( return (directive, options) => { const result: T = directive || {...(options || fallback)}; - Object.keys(override).forEach(key => { + Object.keys(override).forEach((key) => { // Update directive props with new defaults before inputs are processed (result as Record)[key] = override[key as keyof T]; }); diff --git a/projects/demo-cypress/src/support/component.ts b/projects/demo-cypress/src/support/component.ts index 2d9e1a7a6240..fa2112b67934 100644 --- a/projects/demo-cypress/src/support/component.ts +++ b/projects/demo-cypress/src/support/component.ts @@ -10,7 +10,7 @@ declare global { } export const stableMount: typeof mount = (...mountArgs) => - mount(...mountArgs).then(mountResponse => + mount(...mountArgs).then((mountResponse) => cy .get('body') .find('[data-cy-root]') diff --git a/projects/demo-cypress/src/tests/hint.cy.ts b/projects/demo-cypress/src/tests/hint.cy.ts index f4b2a84d23d1..2d0986bd9188 100644 --- a/projects/demo-cypress/src/tests/hint.cy.ts +++ b/projects/demo-cypress/src/tests/hint.cy.ts @@ -45,7 +45,7 @@ describe('TuiHint', () => { imports: [NoopAnimationsModule, Host], providers: [NG_EVENT_PLUGINS], }) - .then(wrap => { + .then((wrap) => { component = wrap.component; wrapper = wrap; }), diff --git a/projects/demo-cypress/src/tests/input-phone-international.cy.ts b/projects/demo-cypress/src/tests/input-phone-international.cy.ts index f95345b5b2be..3e1dd4c62ec1 100644 --- a/projects/demo-cypress/src/tests/input-phone-international.cy.ts +++ b/projects/demo-cypress/src/tests/input-phone-international.cy.ts @@ -40,7 +40,7 @@ export class Test implements OnInit { public ngOnInit(): void { this.control.valueChanges .pipe(takeUntilDestroyed(this.destroyRef)) - .subscribe(value => { + .subscribe((value) => { this.valueChange.emit(value); }); } diff --git a/projects/demo-cypress/src/tests/mobile-calendar.cy.ts b/projects/demo-cypress/src/tests/mobile-calendar.cy.ts index 625192714fbb..313513953671 100644 --- a/projects/demo-cypress/src/tests/mobile-calendar.cy.ts +++ b/projects/demo-cypress/src/tests/mobile-calendar.cy.ts @@ -128,8 +128,8 @@ describe('Mobile calendar', () => { onConfirm: createOutputSpy('onConfirmSpy'), }, }) - .then(wrapper => wrapper.component) - .then(component => { + .then((wrapper) => wrapper.component) + .then((component) => { cy.wait(500).then(() => { component.calendar.setYear(1950); diff --git a/projects/demo-cypress/src/tests/pan.cy.ts b/projects/demo-cypress/src/tests/pan.cy.ts index 8ca84bfc8716..7f746d1d592f 100644 --- a/projects/demo-cypress/src/tests/pan.cy.ts +++ b/projects/demo-cypress/src/tests/pan.cy.ts @@ -24,14 +24,14 @@ describe('TuiPan', () => { imports: [TuiPan], providers: [NG_EVENT_PLUGINS], }) - .then(wrapper => { + .then((wrapper) => { component = wrapper.component; }), ); it('emits delta', () => { cy.get('section') - .then(query => { + .then((query) => { const element = query.get(0); sendTouchEvent(0, 0, element, 'touchstart'); diff --git a/projects/demo-cypress/src/tests/range.cy.ts b/projects/demo-cypress/src/tests/range.cy.ts index 7d7720f4b6d8..077db8fcc690 100644 --- a/projects/demo-cypress/src/tests/range.cy.ts +++ b/projects/demo-cypress/src/tests/range.cy.ts @@ -40,7 +40,7 @@ describe('TuiRange', () => { cy.mount(Test, { imports: [TuiRange, ReactiveFormsModule], providers: [NG_EVENT_PLUGINS], - }).then(wrapper => { + }).then((wrapper) => { component = wrapper.component; fixture = wrapper.fixture; }); diff --git a/projects/demo-cypress/src/tests/static-request.cy.ts b/projects/demo-cypress/src/tests/static-request.cy.ts index cdac2ca1450a..933ad6168572 100644 --- a/projects/demo-cypress/src/tests/static-request.cy.ts +++ b/projects/demo-cypress/src/tests/static-request.cy.ts @@ -50,7 +50,7 @@ describe('TuiStaticRequestService', () => { let completed = false; service.request(`${baseUrl}/test`).subscribe({ - next: response => { + next: (response) => { result1 = response; }, complete: () => { @@ -59,7 +59,7 @@ describe('TuiStaticRequestService', () => { }); service.request(`${baseUrl}/test`).subscribe({ - next: response => { + next: (response) => { result2 = response; }, complete: () => { diff --git a/projects/demo-cypress/src/tests/swipe.cy.ts b/projects/demo-cypress/src/tests/swipe.cy.ts index c8b455a99c31..8ba19cc956a0 100644 --- a/projects/demo-cypress/src/tests/swipe.cy.ts +++ b/projects/demo-cypress/src/tests/swipe.cy.ts @@ -28,14 +28,14 @@ describe('TuiSwipe', () => { imports: [TuiSwipe], providers: [NG_EVENT_PLUGINS], }) - .then(wrapper => { + .then((wrapper) => { component = wrapper.component; }), ); it('emits events bottom', () => { cy.get('section') - .then(query => + .then((query) => cy .wrap(query) .trigger(...touch('touchstart', 0, 0, query.get(0))) @@ -46,7 +46,7 @@ describe('TuiSwipe', () => { it('emits events right', () => { cy.get('section') - .then(query => + .then((query) => cy .wrap(query) .trigger(...touch('touchstart', 0, 0, query.get(0))) @@ -57,7 +57,7 @@ describe('TuiSwipe', () => { it('does not emit events due to threshold', () => { cy.get('section') - .then(query => + .then((query) => cy .wrap(query) .trigger(...touch('touchstart', 0, 0, query.get(0))) diff --git a/projects/demo-cypress/src/tests/tabs.cy.ts b/projects/demo-cypress/src/tests/tabs.cy.ts index 0e265fffdecd..14e5e9b96f0c 100644 --- a/projects/demo-cypress/src/tests/tabs.cy.ts +++ b/projects/demo-cypress/src/tests/tabs.cy.ts @@ -46,7 +46,7 @@ describe('Tabs', () => { imports: [TuiTabs], providers: [NG_EVENT_PLUGINS], }) - .then(wrapper => { + .then((wrapper) => { component = wrapper.component; }), ); diff --git a/projects/demo-cypress/src/tests/zoom.cy.ts b/projects/demo-cypress/src/tests/zoom.cy.ts index 8dce0006be12..d4f86dbf21d5 100644 --- a/projects/demo-cypress/src/tests/zoom.cy.ts +++ b/projects/demo-cypress/src/tests/zoom.cy.ts @@ -28,14 +28,14 @@ describe('TuiZoom', () => { imports: [TuiZoom], providers: [NG_EVENT_PLUGINS], }) - .then(wrapper => { + .then((wrapper) => { component = wrapper.component; }), ); it('pinch', () => { cy.get('section') - .then(query => + .then((query) => cy .wrap(query) .trigger(...touch('touchstart', [10, 10], [20, 20], query.get(0))) @@ -47,7 +47,7 @@ describe('TuiZoom', () => { it('wheel', () => { cy.get('section') - .then(query => + .then((query) => cy.wrap(query).trigger('wheel', new WheelEvent('wheel', {deltaY: 1.1})), ) .then(() => expect(tuiFloor(component.scale, 2)).to.eql(1.01)); diff --git a/projects/demo-playwright/tests/core/hint/hint.spec.ts b/projects/demo-playwright/tests/core/hint/hint.spec.ts index 9847422b77a0..0a23a0539994 100644 --- a/projects/demo-playwright/tests/core/hint/hint.spec.ts +++ b/projects/demo-playwright/tests/core/hint/hint.spec.ts @@ -29,8 +29,8 @@ test.describe('TuiHint', () => { 'top', ]; - directions.forEach(direction => { - [256, 1280].forEach(width => { + directions.forEach((direction) => { + [256, 1280].forEach((width) => { test(`tuiHintDirection is ${direction}, viewport width is ${width}px`, async ({ page, }) => { @@ -48,7 +48,7 @@ test.describe('TuiHint', () => { }); }); - ['true', 'false'].forEach(mode => { + ['true', 'false'].forEach((mode) => { test(`${mode} mode hint without delay`, async ({page}) => { await page.setViewportSize({width: 750, height: 200}); await tuiGoto( diff --git a/projects/demo-playwright/tests/core/textarea/textarea.spec.ts b/projects/demo-playwright/tests/core/textarea/textarea.spec.ts index 31a93f0293c7..4c350cb2a047 100644 --- a/projects/demo-playwright/tests/core/textarea/textarea.spec.ts +++ b/projects/demo-playwright/tests/core/textarea/textarea.spec.ts @@ -7,7 +7,7 @@ test.describe('Textarea', () => { await page.setViewportSize({width: 400, height: 600}); }); - ['m', 'l'].forEach(size => { + ['m', 'l'].forEach((size) => { test(`size of ${size}`, async ({page}) => { await tuiGoto(page, `components/textarea/API?tuiTextfieldSize=${size}`); const {apiPageExample} = new TuiDocumentationPagePO(page); diff --git a/projects/demo-playwright/tests/deep/deep-select.spec.ts b/projects/demo-playwright/tests/deep/deep-select.spec.ts index f121ef2cf8d5..032168f3c8e1 100644 --- a/projects/demo-playwright/tests/deep/deep-select.spec.ts +++ b/projects/demo-playwright/tests/deep/deep-select.spec.ts @@ -4,7 +4,7 @@ import {expect, test} from '@playwright/test'; test.describe('Deep / Select', () => { const deepPaths: string[] = JSON.parse(process.env['DEMO_PATHS']!); - deepPaths.forEach(path => + deepPaths.forEach((path) => test(path, async ({page}) => { await tuiMockImages(page); await tuiGoto(page, `${path}/API`); diff --git a/projects/demo-playwright/tests/deep/deep-toggle.spec.ts b/projects/demo-playwright/tests/deep/deep-toggle.spec.ts index d59a9bef0483..4eef2220fe19 100644 --- a/projects/demo-playwright/tests/deep/deep-toggle.spec.ts +++ b/projects/demo-playwright/tests/deep/deep-toggle.spec.ts @@ -4,7 +4,7 @@ import {expect, test} from '@playwright/test'; test.describe('Deep / Toggle', () => { const deepPaths: string[] = JSON.parse(process.env['DEMO_PATHS']!); - deepPaths.forEach(path => + deepPaths.forEach((path) => test(path, async ({page}) => { await tuiMockImages(page); await tuiGoto(page, `${path}/API`); diff --git a/projects/demo-playwright/tests/demo/demo.spec.ts b/projects/demo-playwright/tests/demo/demo.spec.ts index 309ac73d2c5f..83159721eb5c 100644 --- a/projects/demo-playwright/tests/demo/demo.spec.ts +++ b/projects/demo-playwright/tests/demo/demo.spec.ts @@ -6,7 +6,7 @@ import {tuiIsFlakyExample} from './is-flaky-examples'; test.describe('Demo', () => { const demoPaths: string[] = JSON.parse(process.env['DEMO_PATHS']!); - demoPaths.forEach(path => { + demoPaths.forEach((path) => { test(path, async ({page}) => { const documentation = new TuiDocumentationPagePO(page); diff --git a/projects/demo-playwright/tests/demo/get-demo-paths.ts b/projects/demo-playwright/tests/demo/get-demo-paths.ts index 7a83e2398d51..f80ca20018f0 100644 --- a/projects/demo-playwright/tests/demo/get-demo-paths.ts +++ b/projects/demo-playwright/tests/demo/get-demo-paths.ts @@ -33,7 +33,7 @@ export function tuiGetDemoPathsForE2E( new Set( flatPages(pages) .filter( - page => + (page) => !exclusionSection.includes(page.section!) && !exclusionRoutes.includes(page.route) && !page.route.includes('://'), diff --git a/projects/demo-playwright/tests/kit/combo-box/combobox.spec.ts b/projects/demo-playwright/tests/kit/combo-box/combobox.spec.ts index ffad3984a8d6..04c6ed02300c 100644 --- a/projects/demo-playwright/tests/kit/combo-box/combobox.spec.ts +++ b/projects/demo-playwright/tests/kit/combo-box/combobox.spec.ts @@ -26,7 +26,7 @@ test.describe('ComboBox', () => { }); test.describe('API', () => { - [true, false].forEach(strict => { + [true, false].forEach((strict) => { test(`search shouldn't be reset if an exact match is entered when strict is ${strict}`, async ({ page, }) => { diff --git a/projects/demo-playwright/tests/kit/input-date-range/input-date-range.spec.ts b/projects/demo-playwright/tests/kit/input-date-range/input-date-range.spec.ts index 9c11ac0863f7..94327c5edd73 100644 --- a/projects/demo-playwright/tests/kit/input-date-range/input-date-range.spec.ts +++ b/projects/demo-playwright/tests/kit/input-date-range/input-date-range.spec.ts @@ -29,7 +29,7 @@ test.describe('InputDateRange', () => { }); test.describe('API', () => { - ['s', 'm', 'l'].forEach(size => { + ['s', 'm', 'l'].forEach((size) => { test(`correct filler display for size ${size.toUpperCase()}`, async ({ page, }) => { diff --git a/projects/demo-playwright/tests/kit/input-date/input-date.spec.ts b/projects/demo-playwright/tests/kit/input-date/input-date.spec.ts index 571c0f161032..11c225cc0d32 100644 --- a/projects/demo-playwright/tests/kit/input-date/input-date.spec.ts +++ b/projects/demo-playwright/tests/kit/input-date/input-date.spec.ts @@ -60,7 +60,7 @@ test.describe('InputDate', () => { ); }); - ['s', 'm', 'l'].forEach(size => { + ['s', 'm', 'l'].forEach((size) => { test(`correct filler display for size=${size}`, async ({page}) => { await tuiGoto( page, @@ -140,7 +140,7 @@ test.describe('InputDate', () => { userAgent: TUI_PLAYWRIGHT_MOBILE_USER_AGENT, }); - ['russian', 'english', 'spanish'].forEach(language => { + ['russian', 'english', 'spanish'].forEach((language) => { test(`mobile calendar - ${language}`, async ({page}) => { await tuiGoto(page, DemoRoute.InputDate, {language}); const api = new TuiDocumentationPagePO(page); diff --git a/projects/demo-playwright/tests/kit/input-files/input-files.spec.ts b/projects/demo-playwright/tests/kit/input-files/input-files.spec.ts index 50e4b1e843b0..c2cc6dbc371a 100644 --- a/projects/demo-playwright/tests/kit/input-files/input-files.spec.ts +++ b/projects/demo-playwright/tests/kit/input-files/input-files.spec.ts @@ -12,7 +12,7 @@ test.describe('InputFiles', () => { example = new TuiDocumentationApiPagePO(page).apiPageExample; }); - ['english', 'dutch', 'russian'].forEach(language => + ['english', 'dutch', 'russian'].forEach((language) => test(`Wrong file type (i18n: ${language})`, async ({page}) => { await tuiGoto(page, `${DemoRoute.InputFiles}/API?accept=application/pdf`, { language, @@ -25,7 +25,7 @@ test.describe('InputFiles', () => { }), ); - ['english', 'dutch', 'russian'].forEach(language => + ['english', 'dutch', 'russian'].forEach((language) => test(`File is bigger than (i18n: ${language})`, async ({page}) => { await tuiGoto( page, diff --git a/projects/demo-playwright/tests/kit/input-time/input-time.spec.ts b/projects/demo-playwright/tests/kit/input-time/input-time.spec.ts index aa3a79ca8d18..3b5ea4891227 100644 --- a/projects/demo-playwright/tests/kit/input-time/input-time.spec.ts +++ b/projects/demo-playwright/tests/kit/input-time/input-time.spec.ts @@ -52,7 +52,7 @@ test.describe('InputTime', () => { inputTime = new TuiInputTimePO(apiPageExample.locator('tui-input-time')); }); - ['HH:MM', 'HH:MM:SS', 'HH:MM:SS.MSS'].forEach(mode => { + ['HH:MM', 'HH:MM:SS', 'HH:MM:SS.MSS'].forEach((mode) => { test(`the input is configured for ${mode} mode`, async ({page}) => { await tuiGoto(page, `components/input-time/API?mode=${mode}`, { date: MOCK_DATE, @@ -94,7 +94,7 @@ test.describe('InputTime', () => { ); }); - ['s', 'm', 'l'].forEach(size => { + ['s', 'm', 'l'].forEach((size) => { test(`the dropdown is configured for ${size} size`, async ({page}) => { await tuiGoto( page, diff --git a/projects/demo-playwright/tests/kit/input/input.spec.ts b/projects/demo-playwright/tests/kit/input/input.spec.ts index 8ed3563764f7..2ecdb7fd1eeb 100644 --- a/projects/demo-playwright/tests/kit/input/input.spec.ts +++ b/projects/demo-playwright/tests/kit/input/input.spec.ts @@ -129,7 +129,7 @@ test.describe('Input', () => { }); test.describe('check tuiTextfieldCleaner', () => { - ['s', 'm', 'l'].forEach(size => { + ['s', 'm', 'l'].forEach((size) => { test(`size=${size}`, async ({page}) => { await tuiGoto( page, diff --git a/projects/demo-playwright/tests/kit/multi-select/multi-select.spec.ts b/projects/demo-playwright/tests/kit/multi-select/multi-select.spec.ts index 89f2a5407670..c39e65a22ac7 100644 --- a/projects/demo-playwright/tests/kit/multi-select/multi-select.spec.ts +++ b/projects/demo-playwright/tests/kit/multi-select/multi-select.spec.ts @@ -101,7 +101,7 @@ test.describe('MultiSelect', () => { }); test.describe('sizes', () => { - ['s', 'm', 'l'].forEach(size => { + ['s', 'm', 'l'].forEach((size) => { test(`tuiTextfieldSize=${size}`, async ({page}) => { await tuiGoto( page, @@ -122,7 +122,7 @@ test.describe('MultiSelect', () => { test.describe('Form changes by updateOn', () => { test.use({viewport: {width: 400, height: 500}}); - (['submit', 'blur', 'change'] as const).forEach(type => { + (['submit', 'blur', 'change'] as const).forEach((type) => { test(`updateOn: ${type}`, async ({page}) => { await tuiGoto( page, diff --git a/projects/demo-playwright/tests/kit/slider/slider.spec.ts b/projects/demo-playwright/tests/kit/slider/slider.spec.ts index e70a12d83eb3..073113fbf7f6 100644 --- a/projects/demo-playwright/tests/kit/slider/slider.spec.ts +++ b/projects/demo-playwright/tests/kit/slider/slider.spec.ts @@ -8,7 +8,7 @@ test.describe('Slider', () => { test.use({viewport: {width: 500, height: 500}}); test.describe('correctly displays values with float percentage progress', () => { - [4, 7, 13, 24, 39, 78].forEach(value => { + [4, 7, 13, 24, 39, 78].forEach((value) => { test(`value = ${value}`, async ({page}) => { await tuiGoto(page, `${DemoRoute.Slider}/API?max=89&min=0&step=1`); @@ -50,7 +50,7 @@ test.describe('Slider', () => { const controlValue = await example .getByTestId('key-steps-example-control-value') .textContent() - .then(x => maskitoParseNumber(x || '')); + .then((x) => maskitoParseNumber(x || '')); expect(controlValue).toBe(expectedControlValue); await expect(example).toHaveScreenshot( diff --git a/projects/demo-playwright/tests/kit/tabs/tabs.spec.ts b/projects/demo-playwright/tests/kit/tabs/tabs.spec.ts index 258c9f953ae9..8ef1b09d17e4 100644 --- a/projects/demo-playwright/tests/kit/tabs/tabs.spec.ts +++ b/projects/demo-playwright/tests/kit/tabs/tabs.spec.ts @@ -32,7 +32,7 @@ test.describe('Tabs', () => { }); test.describe('API', () => { - [-2, -1, 0, 1, 2, 3, 4, 5, 100, 1000].forEach(index => { + [-2, -1, 0, 1, 2, 3, 4, 5, 100, 1000].forEach((index) => { test(`clamp active activeItemIndex=${index}`, async ({page}) => { await tuiGoto(page, `/navigation/tabs/API?activeItemIndex=${index}`); await expect( diff --git a/projects/demo-playwright/utils/goto.ts b/projects/demo-playwright/utils/goto.ts index 1764f850529c..b488334289b6 100644 --- a/projects/demo-playwright/utils/goto.ts +++ b/projects/demo-playwright/utils/goto.ts @@ -43,14 +43,14 @@ export async function tuiGoto( if (language) { await page.addInitScript( - lang => globalThis.localStorage.setItem('tuiLanguage', lang), + (lang) => globalThis.localStorage.setItem('tuiLanguage', lang), language, ); } await tuiMockDate(page, date); - await page.route('https://fonts.gstatic.com/**', async route => + await page.route('https://fonts.gstatic.com/**', async (route) => route.fulfill({path: `${__dirname}/../stubs/manrope-fonts.ttf`}), ); diff --git a/projects/demo-playwright/utils/hide-element.ts b/projects/demo-playwright/utils/hide-element.ts index bfaa74d1055c..2b51ab4e15eb 100644 --- a/projects/demo-playwright/utils/hide-element.ts +++ b/projects/demo-playwright/utils/hide-element.ts @@ -1,11 +1,11 @@ import type {Locator} from '@playwright/test'; export async function tuiHideElement(element: Locator): Promise { - return element.evaluate(el => { + return element.evaluate((el) => { el.style.opacity = '0'; }); } export async function tuiRemoveElement(element: Locator): Promise { - return element.evaluate(el => el.remove()); + return element.evaluate((el) => el.remove()); } diff --git a/projects/demo-playwright/utils/mock-date.ts b/projects/demo-playwright/utils/mock-date.ts index 160cc77a7ab9..5830323518d6 100644 --- a/projects/demo-playwright/utils/mock-date.ts +++ b/projects/demo-playwright/utils/mock-date.ts @@ -1,7 +1,7 @@ import type {Page} from '@playwright/test'; export async function tuiMockDate(page: Page, date: Date): Promise { - await page.addInitScript(fakeNow => { + await page.addInitScript((fakeNow) => { // @ts-ignore globalThis.Date = class extends Date { constructor(...args: any[]) { diff --git a/projects/demo-playwright/utils/mock-images.ts b/projects/demo-playwright/utils/mock-images.ts index 5caac17f63dc..75a90ab52863 100644 --- a/projects/demo-playwright/utils/mock-images.ts +++ b/projects/demo-playwright/utils/mock-images.ts @@ -34,8 +34,8 @@ export async function tuiMockImages( }> = DEFAULT_MOCKS, ): Promise { for (const {patterns, mockImage} of imagesMocks) { - const pattern = new RegExp(patterns.map(reg => reg.source).join('|')); + const pattern = new RegExp(patterns.map((reg) => reg.source).join('|')); - await page.route(pattern, async route => route.fulfill({path: mockImage})); + await page.route(pattern, async (route) => route.fulfill({path: mockImage})); } } diff --git a/projects/demo-playwright/utils/page-objects/documentation-api-page.po.ts b/projects/demo-playwright/utils/page-objects/documentation-api-page.po.ts index 73e71f031b85..2caf6042b34f 100644 --- a/projects/demo-playwright/utils/page-objects/documentation-api-page.po.ts +++ b/projects/demo-playwright/utils/page-objects/documentation-api-page.po.ts @@ -72,10 +72,10 @@ export class TuiDocumentationApiPagePO { } if ((await this.apiPageExample.all()).length) { - await this.apiPageExample.evaluate(el => el.scrollIntoView()); + await this.apiPageExample.evaluate((el) => el.scrollIntoView()); await expect(async () => { expect( - await this.apiPageExample.boundingBox().then(box => box?.y), + await this.apiPageExample.boundingBox().then((box) => box?.y), ).toBeGreaterThanOrEqual(64); }).toPass(); } diff --git a/projects/demo-playwright/utils/page-objects/slider.po.ts b/projects/demo-playwright/utils/page-objects/slider.po.ts index 5b8f48418a9a..a89977c19c8d 100644 --- a/projects/demo-playwright/utils/page-objects/slider.po.ts +++ b/projects/demo-playwright/utils/page-objects/slider.po.ts @@ -9,7 +9,7 @@ export class TuiSliderPO { } public get fillPercentage(): Promise { - return this.host.evaluate(el => + return this.host.evaluate((el) => Math.round( parseFloat( globalThis diff --git a/projects/demo/src/main.ts b/projects/demo/src/main.ts index d673bfe7ebf2..528660e07bea 100644 --- a/projects/demo/src/main.ts +++ b/projects/demo/src/main.ts @@ -9,4 +9,4 @@ if (environment.production) { enableProdMode(); } -bootstrapApplication(App, config).catch(err => console.error(err)); +bootstrapApplication(App, config).catch((err) => console.error(err)); diff --git a/projects/demo/src/modules/app/app.component.ts b/projects/demo/src/modules/app/app.component.ts index bd1f6ac2b8c2..12e064878ae7 100644 --- a/projects/demo/src/modules/app/app.component.ts +++ b/projects/demo/src/modules/app/app.component.ts @@ -61,7 +61,7 @@ export class App extends AbstractDemo implements OnInit { filter((event): event is NavigationEnd => event instanceof NavigationEnd), takeUntilDestroyed(this.destroyRef), ) - .subscribe(event => + .subscribe((event) => this.ym.hit(event.urlAfterRedirects, {referer: event.url}), ); } diff --git a/projects/demo/src/modules/app/app.config.ts b/projects/demo/src/modules/app/app.config.ts index f9a7ed45be6a..042120128bb6 100644 --- a/projects/demo/src/modules/app/app.config.ts +++ b/projects/demo/src/modules/app/app.config.ts @@ -105,7 +105,7 @@ export const config: ApplicationConfig = { return `${link}/${pkg.toLowerCase()}/${type.toLowerCase()}/${( header[0].toLowerCase() + header.slice(1) - ).replaceAll(/[A-Z]/g, m => `-${m.toLowerCase()}`)}`; + ).replaceAll(/[A-Z]/g, (m) => `-${m.toLowerCase()}`)}`; }, }, { diff --git a/projects/demo/src/modules/app/classes/ts-file.parser.ts b/projects/demo/src/modules/app/classes/ts-file.parser.ts index 3ba953a16b67..d8774ee34ae5 100644 --- a/projects/demo/src/modules/app/classes/ts-file.parser.ts +++ b/projects/demo/src/modules/app/classes/ts-file.parser.ts @@ -56,7 +56,7 @@ export class TsFileParser { 'gm', ); - return this.rawFileContent.replace(packageImportsRegex, parsed => + return this.rawFileContent.replace(packageImportsRegex, (parsed) => parsed.includes(entity) ? parsed : parsed.replace('{', `{${entity}, `), ); } diff --git a/projects/demo/src/modules/app/home/examples/main-standalone.md b/projects/demo/src/modules/app/home/examples/main-standalone.md index a0a28d0496d3..842686f0d47a 100644 --- a/projects/demo/src/modules/app/home/examples/main-standalone.md +++ b/projects/demo/src/modules/app/home/examples/main-standalone.md @@ -8,5 +8,5 @@ bootstrapApplication(App, { NG_EVENT_PLUGINS, //... ], -}).catch(err => console.error(err)); +}).catch((err) => console.error(err)); ``` diff --git a/projects/demo/src/modules/app/server-error-handler.ts b/projects/demo/src/modules/app/server-error-handler.ts index 1c88794cb655..2cdfc5700652 100644 --- a/projects/demo/src/modules/app/server-error-handler.ts +++ b/projects/demo/src/modules/app/server-error-handler.ts @@ -25,7 +25,7 @@ export class ServerErrorHandler implements ErrorHandler { public handleError(error: Error | string): void { const errorMessage = (typeof error === 'string' ? error : error.message) || ''; - if (KNOWN_ISSUES.some(issue => errorMessage.includes(issue))) { + if (KNOWN_ISSUES.some((issue) => errorMessage.includes(issue))) { return; } diff --git a/projects/demo/src/modules/app/stackblitz/project-files/src/main.ts.md b/projects/demo/src/modules/app/stackblitz/project-files/src/main.ts.md index cbdf9bc0f80e..341f5b9fadb5 100644 --- a/projects/demo/src/modules/app/stackblitz/project-files/src/main.ts.md +++ b/projects/demo/src/modules/app/stackblitz/project-files/src/main.ts.md @@ -7,7 +7,7 @@ import {AppModule} from './app/app.module'; platformBrowserDynamic() .bootstrapModule(AppModule) - .then(ref => { + .then((ref) => { // Stackblitz: Ensure Angular destroys itself on hot reloads. if (window['ngRef']) { window['ngRef'].destroy(); @@ -17,5 +17,5 @@ platformBrowserDynamic() // Otherwise, log the boot error }) - .catch(err => console.error(err)); + .catch((err) => console.error(err)); ``` diff --git a/projects/demo/src/modules/app/stackblitz/starter/index.ts b/projects/demo/src/modules/app/stackblitz/starter/index.ts index a03337f74f58..0939fe4961e2 100644 --- a/projects/demo/src/modules/app/stackblitz/starter/index.ts +++ b/projects/demo/src/modules/app/stackblitz/starter/index.ts @@ -34,7 +34,7 @@ export default class Page implements OnInit { import('./files/index.html.md?raw'), import('./files/styles.less.md?raw'), ].map(tuiRawLoad), - ).then(markdowns => markdowns.map(md => tuiTryParseMarkdownCodeBlock(md)[0])); + ).then((markdowns) => markdowns.map((md) => tuiTryParseMarkdownCodeBlock(md)[0])); return this.stackblitz.openStarter( { diff --git a/projects/demo/src/modules/app/stackblitz/utils.ts b/projects/demo/src/modules/app/stackblitz/utils.ts index bdbd65859ff3..e420d86fe307 100644 --- a/projects/demo/src/modules/app/stackblitz/utils.ts +++ b/projects/demo/src/modules/app/stackblitz/utils.ts @@ -111,10 +111,10 @@ export async function getAllTaigaUIModulesFile( import('@taiga-ui/addon-commerce'), import('@taiga-ui/addon-mobile'), import('@taiga-ui/addon-table'), - ]).then(modules => { + ]).then((modules) => { const allModuleNames = new Set(); - return modules.map(entryPoint => getAllModules(entryPoint, allModuleNames)); + return modules.map((entryPoint) => getAllModules(entryPoint, allModuleNames)); }); const additionalModulesImports = additionalModules diff --git a/projects/demo/src/modules/app/utils/ready-to-scroll-factory.ts b/projects/demo/src/modules/app/utils/ready-to-scroll-factory.ts index 27a0ace1a9fa..7987a3dcec29 100644 --- a/projects/demo/src/modules/app/utils/ready-to-scroll-factory.ts +++ b/projects/demo/src/modules/app/utils/ready-to-scroll-factory.ts @@ -16,8 +16,8 @@ export function readyToScrollFactory( const codeElements = Array.from(host.querySelectorAll('tui-doc-code')); return ( - exampleElements.every(el => el.querySelector('.t-example')) && - codeElements.every(el => el.querySelector('.t-code')) + exampleElements.every((el) => el.querySelector('.t-example')) && + codeElements.every((el) => el.querySelector('.t-code')) ); }), takeUntilDestroyed(), diff --git a/projects/demo/src/modules/components/action-bar/examples/1/index.ts b/projects/demo/src/modules/components/action-bar/examples/1/index.ts index 5a7aeb8222d7..e319a5bb6089 100644 --- a/projects/demo/src/modules/components/action-bar/examples/1/index.ts +++ b/projects/demo/src/modules/components/action-bar/examples/1/index.ts @@ -37,7 +37,7 @@ export default class Example { protected expanded = false; protected readonly isMobile = toSignal( - inject(TuiBreakpointService).pipe(map(size => size === 'mobile')), + inject(TuiBreakpointService).pipe(map((size) => size === 'mobile')), ); protected get value(): string[] { diff --git a/projects/demo/src/modules/components/alert/examples/3/index.ts b/projects/demo/src/modules/components/alert/examples/3/index.ts index bc23d9c83ffd..0e6f72e24d44 100644 --- a/projects/demo/src/modules/components/alert/examples/3/index.ts +++ b/projects/demo/src/modules/components/alert/examples/3/index.ts @@ -49,7 +49,7 @@ export default class Example { autoClose: 0, }) .pipe( - switchMap(response => + switchMap((response) => this.alerts.open(`Got a value — ${response}`, {label: 'Information'}), ), takeUntil(inject(Router).events), diff --git a/projects/demo/src/modules/components/alert/examples/4/index.ts b/projects/demo/src/modules/components/alert/examples/4/index.ts index 09d066528e95..07dc51eb414c 100644 --- a/projects/demo/src/modules/components/alert/examples/4/index.ts +++ b/projects/demo/src/modules/components/alert/examples/4/index.ts @@ -68,7 +68,7 @@ export default class Example { autoClose: 0, }) .pipe( - switchMap(response => + switchMap((response) => this.alerts.open(`Got a value — ${response}`, {label: 'Information'}), ), takeUntil(inject(Router).events), diff --git a/projects/demo/src/modules/components/alert/index.ts b/projects/demo/src/modules/components/alert/index.ts index d5fe2ff3ce4b..41b00c447d70 100644 --- a/projects/demo/src/modules/components/alert/index.ts +++ b/projects/demo/src/modules/components/alert/index.ts @@ -99,7 +99,7 @@ export default class Page { icon: this.icon === this.iconVariants[0] ? this.defaultIcon : this.icon, }) .pipe( - switchMap(response => + switchMap((response) => this.alerts.open(response, { label: 'Notification responded with:', }), diff --git a/projects/demo/src/modules/components/animations/examples/3/index.ts b/projects/demo/src/modules/components/animations/examples/3/index.ts index 2d0de1482dd7..c62c121dc451 100644 --- a/projects/demo/src/modules/components/animations/examples/3/index.ts +++ b/projects/demo/src/modules/components/animations/examples/3/index.ts @@ -23,7 +23,7 @@ export default class Example { protected isShown$ = isPlatformBrowser(inject(PLATFORM_ID)) ? from([false, true]).pipe( - concatMap(val => of(val).pipe(delay(1.5 * this.speed.value))), + concatMap((val) => of(val).pipe(delay(1.5 * this.speed.value))), repeat(), startWith(true), ) diff --git a/projects/demo/src/modules/components/axes/index.ts b/projects/demo/src/modules/components/axes/index.ts index e4f47b0ed812..0292b6312b13 100644 --- a/projects/demo/src/modules/components/axes/index.ts +++ b/projects/demo/src/modules/components/axes/index.ts @@ -38,7 +38,7 @@ export default class Page { protected readonly handlerVariants: readonly TuiLineHandler[] = [ TUI_ALWAYS_SOLID, TUI_ALWAYS_DASHED, - index => (index % 2 ? 'dashed' : 'solid'), + (index) => (index % 2 ? 'dashed' : 'solid'), ]; protected axisX = this.lineVariants[0]; diff --git a/projects/demo/src/modules/components/block-status/examples/2/index.ts b/projects/demo/src/modules/components/block-status/examples/2/index.ts index 3658c5b31daa..4238346a79de 100644 --- a/projects/demo/src/modules/components/block-status/examples/2/index.ts +++ b/projects/demo/src/modules/components/block-status/examples/2/index.ts @@ -20,6 +20,6 @@ export default class Example { protected readonly breakpointService = inject(TuiBreakpointService); protected size$: Observable = this.breakpointService.pipe( - map(key => (key === 'mobile' ? 'm' : 'l')), + map((key) => (key === 'mobile' ? 'm' : 'l')), ); } diff --git a/projects/demo/src/modules/components/block-status/examples/3/index.ts b/projects/demo/src/modules/components/block-status/examples/3/index.ts index 3658c5b31daa..4238346a79de 100644 --- a/projects/demo/src/modules/components/block-status/examples/3/index.ts +++ b/projects/demo/src/modules/components/block-status/examples/3/index.ts @@ -20,6 +20,6 @@ export default class Example { protected readonly breakpointService = inject(TuiBreakpointService); protected size$: Observable = this.breakpointService.pipe( - map(key => (key === 'mobile' ? 'm' : 'l')), + map((key) => (key === 'mobile' ? 'm' : 'l')), ); } diff --git a/projects/demo/src/modules/components/calendar/examples/6/index.ts b/projects/demo/src/modules/components/calendar/examples/6/index.ts index 3d82c009d58c..fec6be5713cc 100644 --- a/projects/demo/src/modules/components/calendar/examples/6/index.ts +++ b/projects/demo/src/modules/components/calendar/examples/6/index.ts @@ -16,8 +16,8 @@ export default class Example { protected value: readonly TuiDay[] = []; protected onDayClick(day: TuiDay): void { - this.value = this.value.find(item => item.daySame(day)) - ? this.value.filter(item => !item.daySame(day)) + this.value = this.value.find((item) => item.daySame(day)) + ? this.value.filter((item) => !item.daySame(day)) : this.value.concat(day); } } diff --git a/projects/demo/src/modules/components/combo-box/examples/1/index.ts b/projects/demo/src/modules/components/combo-box/examples/1/index.ts index 717155cca26f..fa005e32f388 100644 --- a/projects/demo/src/modules/components/combo-box/examples/1/index.ts +++ b/projects/demo/src/modules/components/combo-box/examples/1/index.ts @@ -49,8 +49,8 @@ export default class Example { protected readonly search$ = new Subject(); protected readonly items$: Observable = this.search$.pipe( - filter(value => value !== null), - switchMap(search => + filter((value) => value !== null), + switchMap((search) => this.serverRequest(search).pipe(startWith(null)), ), startWith(databaseMockData), @@ -70,7 +70,7 @@ export default class Example { * Service request emulation */ private serverRequest(searchQuery: string | null): Observable { - const result = databaseMockData.filter(user => + const result = databaseMockData.filter((user) => TUI_DEFAULT_MATCHER(user, searchQuery || ''), ); diff --git a/projects/demo/src/modules/components/combo-box/examples/2/request.service.ts b/projects/demo/src/modules/components/combo-box/examples/2/request.service.ts index 0ec7dd3ba756..b9d20cc9cbd9 100644 --- a/projects/demo/src/modules/components/combo-box/examples/2/request.service.ts +++ b/projects/demo/src/modules/components/combo-box/examples/2/request.service.ts @@ -23,8 +23,8 @@ export class RequestService { // Imitating server request with switchMap + delay pair private readonly response$ = this.request$.pipe( distinctUntilChanged(), - switchMap(query => - of(databaseMockData.filter(user => TUI_DEFAULT_MATCHER(user, query))).pipe( + switchMap((query) => + of(databaseMockData.filter((user) => TUI_DEFAULT_MATCHER(user, query))).pipe( delay(Math.random() * 1000 + 500), startWith(null), ), diff --git a/projects/demo/src/modules/components/combo-box/examples/8/index.ts b/projects/demo/src/modules/components/combo-box/examples/8/index.ts index 97eb9bae0f30..fc28274542c9 100644 --- a/projects/demo/src/modules/components/combo-box/examples/8/index.ts +++ b/projects/demo/src/modules/components/combo-box/examples/8/index.ts @@ -42,5 +42,5 @@ export default class Example { protected readonly control = new FormControl(3); protected readonly items = DICTIONARY.map(({id}) => id); protected readonly stringify = (id: number): string => - DICTIONARY.find(item => item.id === id)?.name || ''; + DICTIONARY.find((item) => item.id === id)?.name || ''; } diff --git a/projects/demo/src/modules/components/combo-box/index.ts b/projects/demo/src/modules/components/combo-box/index.ts index c839a343ab78..96dd453e70f4 100644 --- a/projects/demo/src/modules/components/combo-box/index.ts +++ b/projects/demo/src/modules/components/combo-box/index.ts @@ -95,7 +95,7 @@ export default class Example extends AbstractExampleTuiControl { protected readonly stringifyVariants: Array> = [ String, - item => String(String(item).match(/\d+/)), + (item) => String(String(item).match(/\d+/)), ]; protected stringify = this.stringifyVariants[0]; @@ -132,7 +132,7 @@ export default class Example extends AbstractExampleTuiControl { @tuiPure protected filter(query: string | null): readonly Account[] { - return this.items.filter(item => TUI_DEFAULT_MATCHER(item, query || '')); + return this.items.filter((item) => TUI_DEFAULT_MATCHER(item, query || '')); } protected setValue(): void { diff --git a/projects/demo/src/modules/components/confirm/examples/1/index.ts b/projects/demo/src/modules/components/confirm/examples/1/index.ts index 77b29ffd14a2..8d222ec7d525 100644 --- a/projects/demo/src/modules/components/confirm/examples/1/index.ts +++ b/projects/demo/src/modules/components/confirm/examples/1/index.ts @@ -31,7 +31,7 @@ export default class Example { size: 's', data, }) - .pipe(switchMap(response => this.alerts.open(String(response)))) + .pipe(switchMap((response) => this.alerts.open(String(response)))) .subscribe(); } } diff --git a/projects/demo/src/modules/components/confirm/examples/import/service.md b/projects/demo/src/modules/components/confirm/examples/import/service.md index c45045b68bbd..ad82d456be35 100644 --- a/projects/demo/src/modules/components/confirm/examples/import/service.md +++ b/projects/demo/src/modules/components/confirm/examples/import/service.md @@ -15,7 +15,7 @@ export class Example { no: 'Oops!', }, }) - .subscribe(response => { + .subscribe((response) => { // ... }); } diff --git a/projects/demo/src/modules/components/confirm/index.ts b/projects/demo/src/modules/components/confirm/index.ts index 4bfe59e25a51..04eb2b48123d 100644 --- a/projects/demo/src/modules/components/confirm/index.ts +++ b/projects/demo/src/modules/components/confirm/index.ts @@ -36,7 +36,7 @@ export default class Example implements TuiConfirmData { size: 's', data: this, }) - .pipe(switchMap(response => this.alerts.open(String(response)))) + .pipe(switchMap((response) => this.alerts.open(String(response)))) .subscribe(); } } diff --git a/projects/demo/src/modules/components/data-list-wrapper/examples/1/index.ts b/projects/demo/src/modules/components/data-list-wrapper/examples/1/index.ts index 47b7542e50e1..a49892c56292 100644 --- a/projects/demo/src/modules/components/data-list-wrapper/examples/1/index.ts +++ b/projects/demo/src/modules/components/data-list-wrapper/examples/1/index.ts @@ -30,6 +30,6 @@ export default class Example { 'Terry Jones', ]; - protected readonly disabledItemHandler: TuiBooleanHandler = v => + protected readonly disabledItemHandler: TuiBooleanHandler = (v) => v.startsWith('T'); } diff --git a/projects/demo/src/modules/components/data-list/examples/4/index.ts b/projects/demo/src/modules/components/data-list/examples/4/index.ts index a6b3dffd2fc5..09a72b0de6ae 100644 --- a/projects/demo/src/modules/components/data-list/examples/4/index.ts +++ b/projects/demo/src/modules/components/data-list/examples/4/index.ts @@ -55,7 +55,7 @@ export default class Example { protected readonly identityMatcher: TuiIdentityMatcher = ( items1, items2, - ) => items1.length === items2.length && items1.every(item => items2.includes(item)); + ) => items1.length === items2.length && items1.every((item) => items2.includes(item)); protected readonly valueContent: TuiStringHandler> = ({ $implicit, diff --git a/projects/demo/src/modules/components/dialog/examples/2/index.ts b/projects/demo/src/modules/components/dialog/examples/2/index.ts index 66b17844d8ee..407a33a91104 100644 --- a/projects/demo/src/modules/components/dialog/examples/2/index.ts +++ b/projects/demo/src/modules/components/dialog/examples/2/index.ts @@ -28,7 +28,7 @@ export default class Example { protected showDialog(): void { this.dialog.subscribe({ - next: data => { + next: (data) => { console.info(`Dialog emitted data = ${data}`); }, complete: () => { diff --git a/projects/demo/src/modules/components/dialog/examples/9/pay-modal/pay-modal.component.ts b/projects/demo/src/modules/components/dialog/examples/9/pay-modal/pay-modal.component.ts index f59dd43a9f5a..800f227ed1e2 100644 --- a/projects/demo/src/modules/components/dialog/examples/9/pay-modal/pay-modal.component.ts +++ b/projects/demo/src/modules/components/dialog/examples/9/pay-modal/pay-modal.component.ts @@ -138,10 +138,10 @@ export class PayModal implements OnInit { this.payService .preparePayment(this.context.data.amount) .pipe( - switchMap(amount => + switchMap((amount) => this.payService .getPrimaryCard() - .pipe(map(data => [amount, data] as [number, FetchedCards])), + .pipe(map((data) => [amount, data] as [number, FetchedCards])), ), takeUntilDestroyed(this.destroyRef), ) diff --git a/projects/demo/src/modules/components/dialog/examples/import/dialogs-close-token.md b/projects/demo/src/modules/components/dialog/examples/import/dialogs-close-token.md index f9b79d8d5c99..4f4719ca482e 100644 --- a/projects/demo/src/modules/components/dialog/examples/import/dialogs-close-token.md +++ b/projects/demo/src/modules/components/dialog/examples/import/dialogs-close-token.md @@ -6,7 +6,7 @@ { provide: TUI_DIALOGS_CLOSE, deps: [AuthService], - useFactory: authService => authService.logout$, + useFactory: (authService) => authService.logout$, }, ], }) diff --git a/projects/demo/src/modules/components/dialog/index.ts b/projects/demo/src/modules/components/dialog/index.ts index 77cf0d4a874a..729c60720d2a 100644 --- a/projects/demo/src/modules/components/dialog/index.ts +++ b/projects/demo/src/modules/components/dialog/index.ts @@ -119,7 +119,7 @@ export default class Page { size, appearance, }) - .pipe(switchMap(response => this.alerts.open(String(response)))) + .pipe(switchMap((response) => this.alerts.open(String(response)))) .subscribe(); } } diff --git a/projects/demo/src/modules/components/filter/examples/1/index.ts b/projects/demo/src/modules/components/filter/examples/1/index.ts index 99bc6416f584..30a902efb341 100644 --- a/projects/demo/src/modules/components/filter/examples/1/index.ts +++ b/projects/demo/src/modules/components/filter/examples/1/index.ts @@ -30,5 +30,5 @@ export default class Example { 'Building materials', ]; - protected disabledItemHandler: TuiBooleanHandler = item => item.length < 7; + protected disabledItemHandler: TuiBooleanHandler = (item) => item.length < 7; } diff --git a/projects/demo/src/modules/components/filter/examples/2/index.ts b/projects/demo/src/modules/components/filter/examples/2/index.ts index 35c61f6c5cb6..98d2d3fba50a 100644 --- a/projects/demo/src/modules/components/filter/examples/2/index.ts +++ b/projects/demo/src/modules/components/filter/examples/2/index.ts @@ -97,6 +97,6 @@ export default class Example { item2: Operations, ) => item1.title === item2.title; - protected badgeHandler: TuiHandler = item => + protected badgeHandler: TuiHandler = (item) => item.operations.length; } diff --git a/projects/demo/src/modules/components/filter/examples/4/index.ts b/projects/demo/src/modules/components/filter/examples/4/index.ts index 7f5985192ee2..75d610c2b08e 100644 --- a/projects/demo/src/modules/components/filter/examples/4/index.ts +++ b/projects/demo/src/modules/components/filter/examples/4/index.ts @@ -40,14 +40,14 @@ export default class Example { @tuiPure protected get model$(): Observable { return this.filters$.pipe( - map(value => (value.length === this.items.length ? [] : value)), + map((value) => (value.length === this.items.length ? [] : value)), ); } @tuiPure protected get buttonAppearance$(): Observable { return this.filters$.pipe( - map(value => + map((value) => value.length === this.items.length ? 'whiteblock-active' : 'whiteblock', ), ); diff --git a/projects/demo/src/modules/components/filter/index.ts b/projects/demo/src/modules/components/filter/index.ts index c4c4ddc98820..29f68ae25690 100644 --- a/projects/demo/src/modules/components/filter/index.ts +++ b/projects/demo/src/modules/components/filter/index.ts @@ -42,8 +42,8 @@ export default class Page { ]; protected badgeHandlerVariants: ReadonlyArray> = [ - item => Number(item), - item => String(item).length, + (item) => Number(item), + (item) => String(item).length, ]; protected badgeHandler = this.badgeHandlerVariants[0]; @@ -52,8 +52,8 @@ export default class Page { TuiBooleanHandler > = [ TUI_FALSE_HANDLER, - item => item === 'Roman Sedov', - item => (Number(item.valueOf()) || 0) >= 30, + (item) => item === 'Roman Sedov', + (item) => (Number(item.valueOf()) || 0) >= 30, ]; protected disabledItemHandler = this.disabledItemHandlerVariants[0]; diff --git a/projects/demo/src/modules/components/icon/examples/2/index.ts b/projects/demo/src/modules/components/icon/examples/2/index.ts index 7d1bce847aa6..def310eb2f0a 100644 --- a/projects/demo/src/modules/components/icon/examples/2/index.ts +++ b/projects/demo/src/modules/components/icon/examples/2/index.ts @@ -11,7 +11,7 @@ import {TuiIcon, tuiIconResolverProvider} from '@taiga-ui/core'; encapsulation, changeDetection, providers: [ - tuiIconResolverProvider(icon => + tuiIconResolverProvider((icon) => icon.includes('/') ? icon : `/assets/icons/${icon}.svg`, ), ], diff --git a/projects/demo/src/modules/components/icons/icons-group/icons-group.component.ts b/projects/demo/src/modules/components/icons/icons-group/icons-group.component.ts index 7e63a745c2ea..8ff662b656ff 100644 --- a/projects/demo/src/modules/components/icons/icons-group/icons-group.component.ts +++ b/projects/demo/src/modules/components/icons/icons-group/icons-group.component.ts @@ -57,7 +57,7 @@ export class IconsGroup implements OnInit { protected control = new FormControl(''); protected search$: Observable = this.route.queryParams.pipe( - map(queryParams => queryParams['search'] ?? ''), + map((queryParams) => queryParams['search'] ?? ''), distinctUntilChanged(), ); @@ -72,11 +72,11 @@ export class IconsGroup implements OnInit { this.control.valueChanges .pipe( debounceTime(500), - map(search => search || ''), - filter(search => search.length > 2 || search.length === 0), + map((search) => search || ''), + filter((search) => search.length > 2 || search.length === 0), takeUntilDestroyed(this.destroyRef), ) - .subscribe(search => { + .subscribe((search) => { void this.router.navigate([], {queryParams: {search}}); }); } diff --git a/projects/demo/src/modules/components/input-files/examples/1/index.ts b/projects/demo/src/modules/components/input-files/examples/1/index.ts index d012a3c23305..8217c0212e06 100644 --- a/projects/demo/src/modules/components/input-files/examples/1/index.ts +++ b/projects/demo/src/modules/components/input-files/examples/1/index.ts @@ -20,7 +20,7 @@ export default class Example { protected readonly failedFiles$ = new Subject(); protected readonly loadingFiles$ = new Subject(); protected readonly loadedFiles$ = this.control.valueChanges.pipe( - switchMap(file => this.processFile(file)), + switchMap((file) => this.processFile(file)), ); protected removeFile(): void { diff --git a/projects/demo/src/modules/components/input-files/examples/2/index.ts b/projects/demo/src/modules/components/input-files/examples/2/index.ts index 8d71b7f06348..976866911555 100644 --- a/projects/demo/src/modules/components/input-files/examples/2/index.ts +++ b/projects/demo/src/modules/components/input-files/examples/2/index.ts @@ -36,9 +36,9 @@ export default class Example { } protected onRemove(file: File): void { - this.rejected = this.rejected.filter(rejected => rejected !== file); + this.rejected = this.rejected.filter((rejected) => rejected !== file); this.control.setValue( - this.control.value?.filter(current => current !== file) ?? [], + this.control.value?.filter((current) => current !== file) ?? [], ); } } diff --git a/projects/demo/src/modules/components/input-files/examples/3/index.ts b/projects/demo/src/modules/components/input-files/examples/3/index.ts index 2615bec1abc8..33ad5185b5cb 100644 --- a/projects/demo/src/modules/components/input-files/examples/3/index.ts +++ b/projects/demo/src/modules/components/input-files/examples/3/index.ts @@ -59,14 +59,14 @@ export default class Example { this.restoredFiles = [...this.restoredFiles, file]; this.removedFiles = this.removedFiles.filter( - removed => file.name !== removed?.name, + (removed) => file.name !== removed?.name, ); } protected remove(file: TuiFileLike): void { this.removedFiles = [...this.removedFiles, file]; this.restoredFiles = this.restoredFiles.filter( - restored => file.name !== restored?.name, + (restored) => file.name !== restored?.name, ); } } diff --git a/projects/demo/src/modules/components/input-files/examples/7/index.ts b/projects/demo/src/modules/components/input-files/examples/7/index.ts index 2512e3a27b4c..dec2b5cc31f9 100644 --- a/projects/demo/src/modules/components/input-files/examples/7/index.ts +++ b/projects/demo/src/modules/components/input-files/examples/7/index.ts @@ -17,12 +17,12 @@ export default class Example { protected rejected: File[] = []; protected onRemove(remove: File): void { - this.files = this.files.filter(file => file !== remove); - this.rejected = this.rejected.filter(file => file !== remove); + this.files = this.files.filter((file) => file !== remove); + this.rejected = this.rejected.filter((file) => file !== remove); } protected onChange(files: File[]): void { - this.files = files.filter(file => !this.rejected.includes(file)); + this.files = files.filter((file) => !this.rejected.includes(file)); } protected onReject(rejected: File[]): void { diff --git a/projects/demo/src/modules/components/input-files/index.ts b/projects/demo/src/modules/components/input-files/index.ts index 1af98183c3e4..ab449ba7b2d8 100644 --- a/projects/demo/src/modules/components/input-files/index.ts +++ b/projects/demo/src/modules/components/input-files/index.ts @@ -50,9 +50,9 @@ export default class PageComponent extends AbstractExampleTuiControl { ); protected removeFile(file: File): void { - this.rejected = this.rejected.filter(current => current !== file); + this.rejected = this.rejected.filter((current) => current !== file); this.control.setValue( - this.control.value?.filter(current => current !== file) || null, + this.control.value?.filter((current) => current !== file) || null, ); } diff --git a/projects/demo/src/modules/components/input-inline/examples/3/index.ts b/projects/demo/src/modules/components/input-inline/examples/3/index.ts index 99e08e240fa6..7c4a1db240d9 100644 --- a/projects/demo/src/modules/components/input-inline/examples/3/index.ts +++ b/projects/demo/src/modules/components/input-inline/examples/3/index.ts @@ -36,7 +36,7 @@ export default class Example implements OnInit { tuiWatch(this.cd), takeUntilDestroyed(this.destroyRef), ) - .subscribe(value => { + .subscribe((value) => { this.count = String(value); }); } diff --git a/projects/demo/src/modules/components/input-phone-international/examples/1/index.ts b/projects/demo/src/modules/components/input-phone-international/examples/1/index.ts index 88d6c7c9b80f..ad394b762752 100644 --- a/projects/demo/src/modules/components/input-phone-international/examples/1/index.ts +++ b/projects/demo/src/modules/components/input-phone-international/examples/1/index.ts @@ -22,7 +22,7 @@ import {defer} from 'rxjs'; */ tuiInputPhoneInternationalOptionsProvider({ metadata: defer(async () => - import('libphonenumber-js/max/metadata').then(m => m.default), + import('libphonenumber-js/max/metadata').then((m) => m.default), ), }), /** diff --git a/projects/demo/src/modules/components/input-phone/examples/3/index.ts b/projects/demo/src/modules/components/input-phone/examples/3/index.ts index 5a4720e0e13b..c58a171d839c 100644 --- a/projects/demo/src/modules/components/input-phone/examples/3/index.ts +++ b/projects/demo/src/modules/components/input-phone/examples/3/index.ts @@ -73,16 +73,16 @@ export default class Example { protected readonly user$ = merge( this.selected$, this.search$.pipe( - switchMap(value => + switchMap((value) => this.request(value).pipe( - map(response => + map((response) => this.isFullMatch(response, value) ? response[0] : null, ), ), ), ), ).pipe( - tap(user => { + tap((user) => { if (user) { this.value = user.phone; } @@ -91,9 +91,9 @@ export default class Example { protected readonly items$ = this.search$.pipe( startWith(''), - switchMap(value => + switchMap((value) => this.request(value).pipe( - map(response => (this.isFullMatch(response, value) ? [] : response)), + map((response) => (this.isFullMatch(response, value) ? [] : response)), ), ), ); @@ -116,7 +116,7 @@ export default class Example { private request(query: string): Observable { return of( DATA.filter( - item => + (item) => TUI_DEFAULT_MATCHER(item, query) || TUI_DEFAULT_MATCHER(item.phone, query), ), diff --git a/projects/demo/src/modules/components/input-tag/examples/2/index.ts b/projects/demo/src/modules/components/input-tag/examples/2/index.ts index ad49aaac1a05..cd94a7a9d2c8 100644 --- a/projects/demo/src/modules/components/input-tag/examples/2/index.ts +++ b/projects/demo/src/modules/components/input-tag/examples/2/index.ts @@ -38,7 +38,7 @@ export default class Example { protected value = []; protected readonly items$ = this.search$.pipe( - switchMap(search => + switchMap((search) => this.serverRequest(search).pipe(startWith(null)), ), startWith(databaseMockData), @@ -52,7 +52,7 @@ export default class Example { * Server request emulation */ private serverRequest(search: string): Observable { - const result = databaseMockData.filter(item => + const result = databaseMockData.filter((item) => item.toLowerCase().includes(search.toLowerCase()), ); diff --git a/projects/demo/src/modules/components/input-tag/examples/4/index.ts b/projects/demo/src/modules/components/input-tag/examples/4/index.ts index 7deb987be541..c7c5a1b0d97d 100644 --- a/projects/demo/src/modules/components/input-tag/examples/4/index.ts +++ b/projects/demo/src/modules/components/input-tag/examples/4/index.ts @@ -67,7 +67,7 @@ export default class Example { @tuiPure private filterBy(search: string, value: readonly string[]): readonly string[] { return ITEMS.filter( - item => TUI_DEFAULT_MATCHER(item, search) && !value.includes(item), + (item) => TUI_DEFAULT_MATCHER(item, search) && !value.includes(item), ); } } diff --git a/projects/demo/src/modules/components/input-tag/index.ts b/projects/demo/src/modules/components/input-tag/index.ts index 5a706afac181..995801776b1d 100644 --- a/projects/demo/src/modules/components/input-tag/index.ts +++ b/projects/demo/src/modules/components/input-tag/index.ts @@ -58,8 +58,8 @@ export default class PageComponent extends AbstractExampleTuiControl { protected tagValidatorVariants: ReadonlyArray> = [ TUI_TRUE_HANDLER, - item => item === 'test', - item => item !== 'mail', + (item) => item === 'test', + (item) => item !== 'mail', ]; protected tagValidator = this.tagValidatorVariants[0]; @@ -68,7 +68,7 @@ export default class PageComponent extends AbstractExampleTuiControl { protected readonly disabledItemHandlerVariants: Array< TuiBooleanHandler | string> - > = [TUI_FALSE_HANDLER, item => String(item).startsWith('T')]; + > = [TUI_FALSE_HANDLER, (item) => String(item).startsWith('T')]; protected disabledItemHandler = this.disabledItemHandlerVariants[0]; diff --git a/projects/demo/src/modules/components/input-year/index.ts b/projects/demo/src/modules/components/input-year/index.ts index 386131feccba..7185845bf2a0 100644 --- a/projects/demo/src/modules/components/input-year/index.ts +++ b/projects/demo/src/modules/components/input-year/index.ts @@ -32,7 +32,7 @@ export default class PageComponent extends AbstractExampleTuiControl { protected readonly disabledItemHandlerVariants: ReadonlyArray< TuiBooleanHandler - > = [TUI_FALSE_HANDLER, year => year % 3 === 0]; + > = [TUI_FALSE_HANDLER, (year) => year % 3 === 0]; protected disabledItemHandler = this.disabledItemHandlerVariants[0]; diff --git a/projects/demo/src/modules/components/input/examples/4/index.ts b/projects/demo/src/modules/components/input/examples/4/index.ts index e0b97ad8d383..52cd20248159 100644 --- a/projects/demo/src/modules/components/input/examples/4/index.ts +++ b/projects/demo/src/modules/components/input/examples/4/index.ts @@ -131,8 +131,8 @@ export default class Example { protected lastUser: User | null = null; protected readonly users$ = tuiControlValue(this.user).pipe( - map(value => { - const filtered = USERS.filter(user => TUI_DEFAULT_MATCHER(user, value)); + map((value) => { + const filtered = USERS.filter((user) => TUI_DEFAULT_MATCHER(user, value)); if ( filtered.length !== 1 || diff --git a/projects/demo/src/modules/components/input/examples/8/index.ts b/projects/demo/src/modules/components/input/examples/8/index.ts index da8cf90eba93..c6f39d167213 100644 --- a/projects/demo/src/modules/components/input/examples/8/index.ts +++ b/projects/demo/src/modules/components/input/examples/8/index.ts @@ -56,9 +56,9 @@ export default class Example { protected readonly items$ = this.control.valueChanges.pipe( startWith(''), - switchMap(value => + switchMap((value) => this.request(value ?? '').pipe( - map(response => { + map((response) => { if (response.length === 1 && String(response[0]) === value) { this.onClick(response[0]); @@ -79,6 +79,6 @@ export default class Example { // Request imitation private request(query: string): Observable { - return of(DATA.filter(item => TUI_DEFAULT_MATCHER(item, query))); + return of(DATA.filter((item) => TUI_DEFAULT_MATCHER(item, query))); } } diff --git a/projects/demo/src/modules/components/line-chart/index.ts b/projects/demo/src/modules/components/line-chart/index.ts index 58e8bbf76b63..7b44c17a3a5c 100644 --- a/projects/demo/src/modules/components/line-chart/index.ts +++ b/projects/demo/src/modules/components/line-chart/index.ts @@ -32,11 +32,11 @@ export default class Page { ]; protected readonly yStringifyVariants: ReadonlyArray> = [ - y => `${(10 * y).toLocaleString('ru-RU', {maximumFractionDigits: 0})} $`, + (y) => `${(10 * y).toLocaleString('ru-RU', {maximumFractionDigits: 0})} $`, ]; protected readonly xStringifyVariants: ReadonlyArray> = [ - x => `${100 * x}`, + (x) => `${100 * x}`, ]; protected yStringify: TuiStringHandler | null = null; diff --git a/projects/demo/src/modules/components/line-days-chart/examples/1/index.ts b/projects/demo/src/modules/components/line-days-chart/examples/1/index.ts index cc055b2b1e58..0f53f7f07d7c 100644 --- a/projects/demo/src/modules/components/line-days-chart/examples/1/index.ts +++ b/projects/demo/src/modules/components/line-days-chart/examples/1/index.ts @@ -40,7 +40,7 @@ export default class Example { protected readonly xStringify$: Observable> = this.months$.pipe( map( - months => + (months) => ({month, day}) => `${months[month]}, ${day}`, ), @@ -53,7 +53,7 @@ export default class Example { @tuiPure protected computeLabels$({from, to}: TuiDayRange): Observable { return this.months$.pipe( - map(months => + map((months) => Array.from( {length: TuiMonth.lengthBetween(from, to) + 1}, (_, i) => months[from.append({month: i}).month], @@ -62,7 +62,7 @@ export default class Example { ); } - protected readonly yStringify: TuiStringHandler = y => + protected readonly yStringify: TuiStringHandler = (y) => `${(10 * y).toLocaleString('en-US', {maximumFractionDigits: 0})} $`; @tuiPure diff --git a/projects/demo/src/modules/components/line-days-chart/examples/2/index.ts b/projects/demo/src/modules/components/line-days-chart/examples/2/index.ts index 1440fe0dc001..6b2835782db4 100644 --- a/projects/demo/src/modules/components/line-days-chart/examples/2/index.ts +++ b/projects/demo/src/modules/components/line-days-chart/examples/2/index.ts @@ -79,7 +79,7 @@ export default class Example { if (length > 90) { return this.months$.pipe( - map(months => + map((months) => Array.from( {length: TuiMonth.lengthBetween(from, to) + 1}, (_, i) => months[from.append({month: i}).month], @@ -187,7 +187,7 @@ export default class Example { } function onlyMondays(range: readonly TuiDay[]): readonly string[] { - return range.filter(day => !day.dayOfWeek()).map(String); + return range.filter((day) => !day.dayOfWeek()).map(String); } function even(array: readonly T[]): readonly T[] { diff --git a/projects/demo/src/modules/components/line-days-chart/index.ts b/projects/demo/src/modules/components/line-days-chart/index.ts index b272a5caf1c4..e5a2673c282d 100644 --- a/projects/demo/src/modules/components/line-days-chart/index.ts +++ b/projects/demo/src/modules/components/line-days-chart/index.ts @@ -38,21 +38,23 @@ export default class Page { protected value = this.valueVariants[0]; protected readonly labels$: Observable = this.months$.pipe( - map(months => Array.from({length: 3}, (_, i) => months[i])), + map((months) => Array.from({length: 3}, (_, i) => months[i])), ); protected readonly yStringifyVariants: ReadonlyArray> = [ - y => `${(10 * y).toLocaleString('en-US', {maximumFractionDigits: 0})} $`, + (y) => `${(10 * y).toLocaleString('en-US', {maximumFractionDigits: 0})} $`, ]; protected readonly xStringifyVariants$: Observable< ReadonlyArray> - > = this.months$.pipe(map(months => [({month, day}) => `${months[month]}, ${day}`])); + > = this.months$.pipe( + map((months) => [({month, day}) => `${months[month]}, ${day}`]), + ); protected readonly hintContentVariants$: Observable< ReadonlyArray>> > = this.months$.pipe( - map(months => [ + map((months) => [ '', ({$implicit}) => `${months[$implicit[0].month]}, ${$implicit[0].day}\n${( diff --git a/projects/demo/src/modules/components/mobile-calendar/examples/1/index.ts b/projects/demo/src/modules/components/mobile-calendar/examples/1/index.ts index 0dfc71e6c0e7..4d24d518647f 100644 --- a/projects/demo/src/modules/components/mobile-calendar/examples/1/index.ts +++ b/projects/demo/src/modules/components/mobile-calendar/examples/1/index.ts @@ -64,6 +64,6 @@ export default class Example { } protected onClick(): void { - this.dialog$.subscribe(value => this.control.setValue(value)); + this.dialog$.subscribe((value) => this.control.setValue(value)); } } diff --git a/projects/demo/src/modules/components/mobile-calendar/examples/4/index.ts b/projects/demo/src/modules/components/mobile-calendar/examples/4/index.ts index 11cc1f6895b3..d39c2e31fe6c 100644 --- a/projects/demo/src/modules/components/mobile-calendar/examples/4/index.ts +++ b/projects/demo/src/modules/components/mobile-calendar/examples/4/index.ts @@ -70,6 +70,6 @@ export default class Example { } protected onClick(): void { - this.dialog$.subscribe(value => this.control.setValue(value)); + this.dialog$.subscribe((value) => this.control.setValue(value)); } } diff --git a/projects/demo/src/modules/components/mobile-calendar/examples/5/index.ts b/projects/demo/src/modules/components/mobile-calendar/examples/5/index.ts index a93341cdfdc6..ae048c4b295e 100644 --- a/projects/demo/src/modules/components/mobile-calendar/examples/5/index.ts +++ b/projects/demo/src/modules/components/mobile-calendar/examples/5/index.ts @@ -58,7 +58,7 @@ export default class Example { } return value - .map(day => `${months[day.month]} ${day.day}, ${day.year}`) + .map((day) => `${months[day.month]} ${day.day}, ${day.year}`) .join('; '); }), ); @@ -68,6 +68,6 @@ export default class Example { } protected onClick(): void { - this.dialog$.subscribe(value => this.control.setValue(value)); + this.dialog$.subscribe((value) => this.control.setValue(value)); } } diff --git a/projects/demo/src/modules/components/mobile-dialog/examples/1/index.ts b/projects/demo/src/modules/components/mobile-dialog/examples/1/index.ts index 86379716d44f..77943642a15d 100644 --- a/projects/demo/src/modules/components/mobile-dialog/examples/1/index.ts +++ b/projects/demo/src/modules/components/mobile-dialog/examples/1/index.ts @@ -34,7 +34,7 @@ export default class Example { actions, }, ) - .pipe(switchMap(index => this.alerts.open(`Selected: ${actions[index]}`))) + .pipe(switchMap((index) => this.alerts.open(`Selected: ${actions[index]}`))) .subscribe(); } } diff --git a/projects/demo/src/modules/components/multi-select/examples/1/index.ts b/projects/demo/src/modules/components/multi-select/examples/1/index.ts index 95659debcc35..6b35ccc6e7a9 100644 --- a/projects/demo/src/modules/components/multi-select/examples/1/index.ts +++ b/projects/demo/src/modules/components/multi-select/examples/1/index.ts @@ -37,8 +37,8 @@ export default class Example { @tuiPure protected filter(search: string | null): readonly string[] { - return ITEMS.filter(item => TUI_DEFAULT_MATCHER(item, search || '')); + return ITEMS.filter((item) => TUI_DEFAULT_MATCHER(item, search || '')); } - protected tagValidator: TuiBooleanHandler = tag => !tag.startsWith('Han'); + protected tagValidator: TuiBooleanHandler = (tag) => !tag.startsWith('Han'); } diff --git a/projects/demo/src/modules/components/multi-select/examples/10/index.ts b/projects/demo/src/modules/components/multi-select/examples/10/index.ts index b53632f2a921..c942838be838 100644 --- a/projects/demo/src/modules/components/multi-select/examples/10/index.ts +++ b/projects/demo/src/modules/components/multi-select/examples/10/index.ts @@ -66,9 +66,9 @@ export default class Example { protected labels = ['Salad', 'Soup']; - protected stringify: TuiStringHandler = item => item.name; + protected stringify: TuiStringHandler = (item) => item.name; - protected disableHandler: TuiBooleanHandler = item => + protected disableHandler: TuiBooleanHandler = (item) => item.startsWith('Broccoli'); protected disableItemHandler: TuiBooleanHandler = ({name}) => diff --git a/projects/demo/src/modules/components/multi-select/examples/11/index.ts b/projects/demo/src/modules/components/multi-select/examples/11/index.ts index 7dbe5a5143be..84344106ebc1 100644 --- a/projects/demo/src/modules/components/multi-select/examples/11/index.ts +++ b/projects/demo/src/modules/components/multi-select/examples/11/index.ts @@ -46,6 +46,6 @@ export default class Example { }) => `Selected: ${length}`; protected remove(item: string): void { - this.value = this.value.filter(val => val !== item); + this.value = this.value.filter((val) => val !== item); } } diff --git a/projects/demo/src/modules/components/multi-select/examples/2/index.ts b/projects/demo/src/modules/components/multi-select/examples/2/index.ts index 1af2e89b58e3..7e3ece6607dc 100644 --- a/projects/demo/src/modules/components/multi-select/examples/2/index.ts +++ b/projects/demo/src/modules/components/multi-select/examples/2/index.ts @@ -55,8 +55,8 @@ export default class Example { protected readonly search$ = new Subject(); protected readonly items$: Observable = this.search$.pipe( - filter(value => value !== null), - switchMap(search => + filter((value) => value !== null), + switchMap((search) => this.serverRequest(search).pipe(startWith(null)), ), startWith(databaseMockData), @@ -72,7 +72,7 @@ export default class Example { * Server request emulation */ private serverRequest(searchQuery: string | null): Observable { - const result = databaseMockData.filter(user => + const result = databaseMockData.filter((user) => TUI_DEFAULT_MATCHER(user, searchQuery || ''), ); diff --git a/projects/demo/src/modules/components/multi-select/examples/3/index.ts b/projects/demo/src/modules/components/multi-select/examples/3/index.ts index 39c52b27b892..288bdadab2b8 100644 --- a/projects/demo/src/modules/components/multi-select/examples/3/index.ts +++ b/projects/demo/src/modules/components/multi-select/examples/3/index.ts @@ -39,7 +39,7 @@ export default class Example { protected readonly control = new FormControl([this.items[3], this.items[4]]); - protected readonly stringify: TuiStringHandler> = item => + protected readonly stringify: TuiStringHandler> = (item) => 'name' in item ? item.name : item.$implicit.name; protected readonly identityMatcher: TuiIdentityMatcher = (hero1, hero2) => diff --git a/projects/demo/src/modules/components/multi-select/examples/4/index.ts b/projects/demo/src/modules/components/multi-select/examples/4/index.ts index fa83c98a70f9..250982ca73c2 100644 --- a/projects/demo/src/modules/components/multi-select/examples/4/index.ts +++ b/projects/demo/src/modules/components/multi-select/examples/4/index.ts @@ -45,9 +45,9 @@ export default class Example { // Items only hold IDs protected readonly items$ = this.search$.pipe( startWith(''), - switchMap(search => + switchMap((search) => this.server$.pipe( - map(items => + map((items) => items .filter(({name}) => TUI_DEFAULT_MATCHER(name, search)) .map(({id}) => id), @@ -61,10 +61,10 @@ export default class Example { protected readonly stringify$: Observable< TuiHandler | number, string> > = this.server$.pipe( - map(items => new Map(items.map<[number, string]>(({id, name}) => [id, name]))), + map((items) => new Map(items.map<[number, string]>(({id, name}) => [id, name]))), startWith(new Map()), map( - map => (id: TuiContext | number) => + (map) => (id: TuiContext | number) => (tuiIsNumber(id) ? map.get(id) : map.get(id.$implicit)) || 'Loading...', ), ); diff --git a/projects/demo/src/modules/components/multi-select/index.ts b/projects/demo/src/modules/components/multi-select/index.ts index a26ee6cfc34a..3f1cf5ae2f59 100644 --- a/projects/demo/src/modules/components/multi-select/index.ts +++ b/projects/demo/src/modules/components/multi-select/index.ts @@ -83,7 +83,7 @@ export default class PageComponent extends AbstractExampleTuiControl { protected stringifyVariants: Array> = [ String, - item => String(String(item).match(/\d+/)), + (item) => String(String(item).match(/\d+/)), ]; protected stringify = this.stringifyVariants[0]; @@ -97,8 +97,8 @@ export default class PageComponent extends AbstractExampleTuiControl { protected tagValidatorVariants: ReadonlyArray> = [ TUI_TRUE_HANDLER, - item => item.balance > 300, - item => !item.name.startsWith('Pounds'), + (item) => item.balance > 300, + (item) => !item.name.startsWith('Pounds'), ]; protected tagValidator = this.tagValidatorVariants[0]; diff --git a/projects/demo/src/modules/components/pdf-viewer/examples/2/index.ts b/projects/demo/src/modules/components/pdf-viewer/examples/2/index.ts index 4d1dc3439d6e..1dc5153bc10b 100644 --- a/projects/demo/src/modules/components/pdf-viewer/examples/2/index.ts +++ b/projects/demo/src/modules/components/pdf-viewer/examples/2/index.ts @@ -36,18 +36,18 @@ export default class Example { data: [ { text: 'Sign', - onClick: context => context.completeWith('Document signed'), + onClick: (context) => context.completeWith('Document signed'), }, { text: 'Deny', - onClick: context => context.completeWith('Document denied'), + onClick: (context) => context.completeWith('Document denied'), }, ], }; this.pdfService .open(new PolymorpheusComponent(PdfContent), options) - .pipe(switchMap(response => this.alerts.open(response))) + .pipe(switchMap((response) => this.alerts.open(response))) .subscribe(); } } diff --git a/projects/demo/src/modules/components/preview/examples/4/index.ts b/projects/demo/src/modules/components/preview/examples/4/index.ts index 10110f883121..3183de5007f6 100644 --- a/projects/demo/src/modules/components/preview/examples/4/index.ts +++ b/projects/demo/src/modules/components/preview/examples/4/index.ts @@ -38,23 +38,23 @@ export default class Example { protected readonly index$$ = new BehaviorSubject(0); protected readonly item$ = this.index$$.pipe( - map(index => this.items[index]), + map((index) => this.items[index]), filter(tuiIsPresent), ); - protected readonly title$ = this.item$.pipe(map(item => item.title)); + protected readonly title$ = this.item$.pipe(map((item) => item.title)); protected readonly contentUnavailable$ = this.item$.pipe( - map(item => !item.hasPreview), + map((item) => !item.hasPreview), ); protected readonly imageSrc$ = this.item$.pipe( - switchMap(item => + switchMap((item) => item.hasPreview ? this.emulateBackendRequest().pipe(startWith('')) : of(null), ), ); - protected readonly loading$ = this.imageSrc$.pipe(map(src => src === '')); + protected readonly loading$ = this.imageSrc$.pipe(map((src) => src === '')); protected show(): void { this.previewDialogService.open(this.preview || '').subscribe(); diff --git a/projects/demo/src/modules/components/progress-bar/examples/1/index.ts b/projects/demo/src/modules/components/progress-bar/examples/1/index.ts index 5e25375493f4..245ead66e52e 100644 --- a/projects/demo/src/modules/components/progress-bar/examples/1/index.ts +++ b/projects/demo/src/modules/components/progress-bar/examples/1/index.ts @@ -18,7 +18,7 @@ export default class Example { inject(TUI_IS_E2E) || isPlatformServer(inject(PLATFORM_ID)) ? of(40) : timer(300, 300).pipe( - map(i => i + 30), + map((i) => i + 30), startWith(30), ); } diff --git a/projects/demo/src/modules/components/progress-bar/examples/4/index.ts b/projects/demo/src/modules/components/progress-bar/examples/4/index.ts index caacc85a8415..d425afa5d18c 100644 --- a/projects/demo/src/modules/components/progress-bar/examples/4/index.ts +++ b/projects/demo/src/modules/components/progress-bar/examples/4/index.ts @@ -20,8 +20,8 @@ export default class Example { inject(TUI_IS_E2E) || isPlatformServer(inject(PLATFORM_ID)) ? of(30) : timer(300, 300).pipe( - map(i => i + 30), + map((i) => i + 30), startWith(30), - takeWhile(value => value <= this.max), + takeWhile((value) => value <= this.max), ); } diff --git a/projects/demo/src/modules/components/progress-circle/examples/1/index.ts b/projects/demo/src/modules/components/progress-circle/examples/1/index.ts index ba56fd1843ed..d385c8b0089c 100644 --- a/projects/demo/src/modules/components/progress-circle/examples/1/index.ts +++ b/projects/demo/src/modules/components/progress-circle/examples/1/index.ts @@ -19,8 +19,8 @@ export default class Example { inject(TUI_IS_E2E) || isPlatformServer(inject(PLATFORM_ID)) ? of(30) : timer(300, 200).pipe( - map(i => i + 30), + map((i) => i + 30), startWith(30), - takeWhile(value => value <= this.max), + takeWhile((value) => value <= this.max), ); } diff --git a/projects/demo/src/modules/components/progress-circle/examples/3/index.ts b/projects/demo/src/modules/components/progress-circle/examples/3/index.ts index 232a0a2f4935..a2cb42874950 100644 --- a/projects/demo/src/modules/components/progress-circle/examples/3/index.ts +++ b/projects/demo/src/modules/components/progress-circle/examples/3/index.ts @@ -20,8 +20,8 @@ export default class Example { inject(TUI_IS_E2E) || isPlatformServer(inject(PLATFORM_ID)) ? of(30) : timer(300, 200).pipe( - map(i => i + 30), + map((i) => i + 30), startWith(30), - takeWhile(value => value <= this.max), + takeWhile((value) => value <= this.max), ); } diff --git a/projects/demo/src/modules/components/progress-circle/examples/5/index.ts b/projects/demo/src/modules/components/progress-circle/examples/5/index.ts index aa7663d2d0f7..16b1635da155 100644 --- a/projects/demo/src/modules/components/progress-circle/examples/5/index.ts +++ b/projects/demo/src/modules/components/progress-circle/examples/5/index.ts @@ -21,13 +21,13 @@ export default class Example { inject(TUI_IS_E2E) || isPlatformServer(inject(PLATFORM_ID)) ? of(30) : timer(300, 200).pipe( - takeWhile(value => value <= this.max), + takeWhile((value) => value <= this.max), share(), repeat(), ); protected readonly color$ = this.value$.pipe( - map(value => { + map((value) => { if (value < 33) { return 'red'; } diff --git a/projects/demo/src/modules/components/progress-circle/examples/6/index.ts b/projects/demo/src/modules/components/progress-circle/examples/6/index.ts index 6ce72416a35f..9c7cf6c515e3 100644 --- a/projects/demo/src/modules/components/progress-circle/examples/6/index.ts +++ b/projects/demo/src/modules/components/progress-circle/examples/6/index.ts @@ -20,7 +20,7 @@ export default class Example { inject(TUI_IS_E2E) || isPlatformServer(inject(PLATFORM_ID)) ? of(30) : timer(300, 200).pipe( - takeWhile(value => value <= this.max), + takeWhile((value) => value <= this.max), repeat(), ); } diff --git a/projects/demo/src/modules/components/push/examples/2/index.ts b/projects/demo/src/modules/components/push/examples/2/index.ts index 396f87ca3d98..70d8e5681ba7 100644 --- a/projects/demo/src/modules/components/push/examples/2/index.ts +++ b/projects/demo/src/modules/components/push/examples/2/index.ts @@ -26,7 +26,7 @@ export default class Example { }) .pipe( take(1), - switchMap(button => this.alert.open(button)), + switchMap((button) => this.alert.open(button)), ) .subscribe(); } diff --git a/projects/demo/src/modules/components/radio/examples/3/index.ts b/projects/demo/src/modules/components/radio/examples/3/index.ts index 6d96b12cda1a..06752c35e4a6 100644 --- a/projects/demo/src/modules/components/radio/examples/3/index.ts +++ b/projects/demo/src/modules/components/radio/examples/3/index.ts @@ -43,6 +43,6 @@ export default class Example { protected horizontal = this.strings[0]; - protected readonly handler: TuiBooleanHandler = item => + protected readonly handler: TuiBooleanHandler = (item) => item === this.strings[2]; } diff --git a/projects/demo/src/modules/components/range/examples/3/index.ts b/projects/demo/src/modules/components/range/examples/3/index.ts index fad0ea880b03..0abd06ecee80 100644 --- a/projects/demo/src/modules/components/range/examples/3/index.ts +++ b/projects/demo/src/modules/components/range/examples/3/index.ts @@ -20,7 +20,7 @@ export default class Example { protected readonly step = 250; protected readonly segments = 4; protected readonly labels = [...new Array(this.segments + 1).keys()].map( - i => this.min + this.step * i, + (i) => this.min + this.step * i, ); protected value = [0, 250]; diff --git a/projects/demo/src/modules/components/select/examples/11/index.ts b/projects/demo/src/modules/components/select/examples/11/index.ts index a2948e248694..791016c89ad9 100644 --- a/projects/demo/src/modules/components/select/examples/11/index.ts +++ b/projects/demo/src/modules/components/select/examples/11/index.ts @@ -47,8 +47,8 @@ export default class Example { protected labels = ['Salad', 'Soup']; - protected stringify: TuiStringHandler = item => item.name; + protected stringify: TuiStringHandler = (item) => item.name; - protected disabledItemHandler: TuiBooleanHandler = item => + protected disabledItemHandler: TuiBooleanHandler = (item) => item.startsWith('Chicken'); } diff --git a/projects/demo/src/modules/components/sheet-dialog/examples/4/index.ts b/projects/demo/src/modules/components/sheet-dialog/examples/4/index.ts index 1e6bb0cec6b2..aab2abfa678c 100644 --- a/projects/demo/src/modules/components/sheet-dialog/examples/4/index.ts +++ b/projects/demo/src/modules/components/sheet-dialog/examples/4/index.ts @@ -72,7 +72,7 @@ export default class Example { protected readonly search = new FormControl(''); protected readonly users$ = tuiControlValue(this.search).pipe( - map(search => USERS.filter(user => TUI_DEFAULT_MATCHER(user, search))), + map((search) => USERS.filter((user) => TUI_DEFAULT_MATCHER(user, search))), ); protected readonly height$ = this.size$.pipe( diff --git a/projects/demo/src/modules/components/slider/examples/6/index.ts b/projects/demo/src/modules/components/slider/examples/6/index.ts index 93c3f9aee931..f54b8334e486 100644 --- a/projects/demo/src/modules/components/slider/examples/6/index.ts +++ b/projects/demo/src/modules/components/slider/examples/6/index.ts @@ -24,7 +24,7 @@ export default class Example { protected readonly active$ = new BehaviorSubject(false); protected readonly showHint$ = this.active$.pipe( distinctUntilChanged(), - switchMap(active => + switchMap((active) => active ? of(true) : timer(1000).pipe(map(TUI_FALSE_HANDLER)), ), ); diff --git a/projects/demo/src/modules/components/table/examples/2/index.ts b/projects/demo/src/modules/components/table/examples/2/index.ts index 376d010c7f43..63a9792d333d 100644 --- a/projects/demo/src/modules/components/table/examples/2/index.ts +++ b/projects/demo/src/modules/components/table/examples/2/index.ts @@ -77,7 +77,7 @@ export default class Example { ]); protected remove(item: User): void { - const users = this.users$.getValue().filter(user => user !== item); + const users = this.users$.getValue().filter((user) => user !== item); this.users$.next(users); } diff --git a/projects/demo/src/modules/components/table/examples/3/index.ts b/projects/demo/src/modules/components/table/examples/3/index.ts index 776984083e29..ba838f538e5c 100644 --- a/projects/demo/src/modules/components/table/examples/3/index.ts +++ b/projects/demo/src/modules/components/table/examples/3/index.ts @@ -129,12 +129,12 @@ export default class Example { this.pythons = data === this.pythons - ? this.pythons.map(item => (item === current ? updated : item)) + ? this.pythons.map((item) => (item === current ? updated : item)) : this.pythons; this.starwars = data === this.starwars - ? this.starwars.map(item => (item === current ? updated : item)) + ? this.starwars.map((item) => (item === current ? updated : item)) : this.starwars; } } diff --git a/projects/demo/src/modules/components/table/examples/4/index.ts b/projects/demo/src/modules/components/table/examples/4/index.ts index bcc2ae07be7f..89b7c7677366 100644 --- a/projects/demo/src/modules/components/table/examples/4/index.ts +++ b/projects/demo/src/modules/components/table/examples/4/index.ts @@ -142,7 +142,7 @@ export default class Example { ]).pipe( // zero time debounce for a case when both key and direction change debounceTime(0), - switchMap(query => this.getData(...query).pipe(startWith(null))), + switchMap((query) => this.getData(...query).pipe(startWith(null))), share(), ); @@ -164,7 +164,7 @@ export default class Example { protected readonly data$: Observable = this.request$.pipe( filter(tuiIsPresent), - map(users => users.filter(tuiIsPresent)), + map((users) => users.filter(tuiIsPresent)), startWith([]), ); @@ -173,8 +173,8 @@ export default class Example { protected onEnabled(enabled: readonly string[]): void { this.enabled = enabled; this.columns = this.initial - .filter(column => enabled.includes(column)) - .map(column => KEYS[column]); + .filter((column) => enabled.includes(column)) + .map((column) => KEYS[column]); } protected onDirection(direction: -1 | 1): void { @@ -203,7 +203,7 @@ export default class Example { const end = start + size; const result = [...DATA] .sort(sortBy(key, direction)) - .filter(user => getAge(user) >= minAge) + .filter((user) => getAge(user) >= minAge) .map((user, index) => (index >= start && index < end ? user : null)); // Imitating server response diff --git a/projects/demo/src/modules/components/table/examples/6/index.ts b/projects/demo/src/modules/components/table/examples/6/index.ts index 83853d0ef176..be3e3ad9b607 100644 --- a/projects/demo/src/modules/components/table/examples/6/index.ts +++ b/projects/demo/src/modules/components/table/examples/6/index.ts @@ -22,7 +22,7 @@ export default class Example { } protected addColumn(): void { - this.data = this.data.map(item => ({ + this.data = this.data.map((item) => ({ ...item, [`extra-${this.columns.length + 1}`]: `extra column ${ this.columns.length + 1 diff --git a/projects/demo/src/modules/components/tabs/examples/5/index.ts b/projects/demo/src/modules/components/tabs/examples/5/index.ts index 710fd5387a56..57f9d9d79d21 100644 --- a/projects/demo/src/modules/components/tabs/examples/5/index.ts +++ b/projects/demo/src/modules/components/tabs/examples/5/index.ts @@ -27,7 +27,7 @@ export default class Example { protected remove(removed: string): void { const index = this.items.indexOf(removed); - this.items = this.items.filter(item => item !== removed); + this.items = this.items.filter((item) => item !== removed); if (index <= this.activeItemIndex) { this.activeItemIndex = Math.max(this.activeItemIndex - 1, 0); diff --git a/projects/demo/src/modules/components/tooltip/examples/1/index.ts b/projects/demo/src/modules/components/tooltip/examples/1/index.ts index a477508db481..579ca1dd2ae4 100644 --- a/projects/demo/src/modules/components/tooltip/examples/1/index.ts +++ b/projects/demo/src/modules/components/tooltip/examples/1/index.ts @@ -17,7 +17,7 @@ import {interval, map, startWith} from 'rxjs'; }) export default class Example { protected isLoading$ = interval(2000).pipe( - map(i => Boolean(i % 2)), + map((i) => Boolean(i % 2)), startWith(true), ); } diff --git a/projects/demo/src/modules/components/tree/examples/3/index.ts b/projects/demo/src/modules/components/tree/examples/3/index.ts index a4d547b2bdcc..189f31ab7d9f 100644 --- a/projects/demo/src/modules/components/tree/examples/3/index.ts +++ b/projects/demo/src/modules/components/tree/examples/3/index.ts @@ -47,6 +47,6 @@ export default class Example { ], }; - protected readonly handler: TuiHandler = item => + protected readonly handler: TuiHandler = (item) => item.children || EMPTY_ARRAY; } diff --git a/projects/demo/src/modules/components/tree/examples/4/index.ts b/projects/demo/src/modules/components/tree/examples/4/index.ts index 907ffd4e6f15..c609727ff628 100644 --- a/projects/demo/src/modules/components/tree/examples/4/index.ts +++ b/projects/demo/src/modules/components/tree/examples/4/index.ts @@ -45,7 +45,7 @@ export default class Example { protected readonly map = new Map(); - protected readonly handler: TuiHandler = item => + protected readonly handler: TuiHandler = (item) => item.children || EMPTY_ARRAY; protected toggleTopmost(): void { diff --git a/projects/demo/src/modules/components/tree/examples/5/index.ts b/projects/demo/src/modules/components/tree/examples/5/index.ts index 26e341d72406..a2c5650ad09f 100644 --- a/projects/demo/src/modules/components/tree/examples/5/index.ts +++ b/projects/demo/src/modules/components/tree/examples/5/index.ts @@ -53,6 +53,6 @@ export default class Example { ], }; - protected readonly handler: TuiHandler = item => + protected readonly handler: TuiHandler = (item) => item.children || EMPTY_ARRAY; } diff --git a/projects/demo/src/modules/components/tree/examples/6/index.ts b/projects/demo/src/modules/components/tree/examples/6/index.ts index f5e1d3175804..9c74749f7050 100644 --- a/projects/demo/src/modules/components/tree/examples/6/index.ts +++ b/projects/demo/src/modules/components/tree/examples/6/index.ts @@ -53,7 +53,7 @@ export default class Example { ], }; - protected readonly handler: TuiHandler = item => + protected readonly handler: TuiHandler = (item) => item.children || EMPTY_ARRAY; protected readonly getValue = ( @@ -73,7 +73,7 @@ export default class Example { }; protected onChecked(node: TreeNode, value: boolean): void { - flatten(node).forEach(item => this.map.set(item, value)); + flatten(node).forEach((item) => this.map.set(item, value)); this.map = new Map(this.map.entries()); } diff --git a/projects/demo/src/modules/components/tree/examples/7/index.ts b/projects/demo/src/modules/components/tree/examples/7/index.ts index ee15a352e115..4bf90a0a500a 100644 --- a/projects/demo/src/modules/components/tree/examples/7/index.ts +++ b/projects/demo/src/modules/components/tree/examples/7/index.ts @@ -62,7 +62,7 @@ export default class Example { protected map = new Map(); - protected childrenHandler: TuiHandler = item => + protected childrenHandler: TuiHandler = (item) => this.service.getChildren(item); protected onToggled(item: Item): void { diff --git a/projects/demo/src/modules/customization/dialogs/examples/1/index.ts b/projects/demo/src/modules/customization/dialogs/examples/1/index.ts index 5de5e7b4e12c..e529724827cc 100644 --- a/projects/demo/src/modules/customization/dialogs/examples/1/index.ts +++ b/projects/demo/src/modules/customization/dialogs/examples/1/index.ts @@ -30,7 +30,7 @@ export class TuiDialogsExample1 { buttons: ['Absolutely!', 'No way!'], }) .pipe( - switchMap(response => + switchMap((response) => response ? this.alerts.open(wisely, { status: 'success', diff --git a/projects/demo/src/modules/customization/i18n/index.ts b/projects/demo/src/modules/customization/i18n/index.ts index 663f8c407158..fd3716e0d577 100644 --- a/projects/demo/src/modules/customization/i18n/index.ts +++ b/projects/demo/src/modules/customization/i18n/index.ts @@ -16,7 +16,7 @@ export default class Page { import('../../../../../i18n/README.md?raw') as Promise<{ default: string; }>, - ).pipe(map(readme => readme.default.split('Supported languages:')[1])); + ).pipe(map((readme) => readme.default.split('Supported languages:')[1])); protected exampleModule = import('./app.module.md?raw'); protected exampleEsbuildModule = import('./app.esbuild.module.md?raw'); diff --git a/projects/demo/src/modules/customization/wrapper/examples/1/index.ts b/projects/demo/src/modules/customization/wrapper/examples/1/index.ts index 161bb0d6101c..3be6ffa87ba7 100644 --- a/projects/demo/src/modules/customization/wrapper/examples/1/index.ts +++ b/projects/demo/src/modules/customization/wrapper/examples/1/index.ts @@ -19,7 +19,7 @@ import {TUI_TEXTFIELD_APPEARANCE_DIRECTIVE, TuiInputModule} from '@taiga-ui/lega }, }, tuiCheckboxOptionsProvider({ - appearance: el => + appearance: (el) => el.checked || el.indeterminate ? 'material-checkbox-on' : 'material-checkbox-off', diff --git a/projects/demo/src/modules/directives/copy-processor/examples/1/index.ts b/projects/demo/src/modules/directives/copy-processor/examples/1/index.ts index 0ef638a0469b..5995676cedef 100644 --- a/projects/demo/src/modules/directives/copy-processor/examples/1/index.ts +++ b/projects/demo/src/modules/directives/copy-processor/examples/1/index.ts @@ -24,7 +24,7 @@ export default class Example { protected numberProcessor$ = this.format.pipe( map( - format => (text: string) => + (format) => (text: string) => text .replace(format.decimalSeparator, '.') .replaceAll(new RegExp(format.thousandSeparator, 'g'), ''), @@ -36,6 +36,6 @@ export default class Example { this.alerts.open(event.clipboardData?.getData('text/plain') ?? '').subscribe(); } - protected readonly textProcessor: TuiStringHandler = text => + protected readonly textProcessor: TuiStringHandler = (text) => text.toUpperCase(); } diff --git a/projects/demo/src/modules/directives/dropdown-selection/examples/2/index.ts b/projects/demo/src/modules/directives/dropdown-selection/examples/2/index.ts index 05f7762fca3f..3fbeb49efc6d 100644 --- a/projects/demo/src/modules/directives/dropdown-selection/examples/2/index.ts +++ b/projects/demo/src/modules/directives/dropdown-selection/examples/2/index.ts @@ -65,7 +65,7 @@ export default class Example { }, ]; - protected predicate: TuiBooleanHandler = range => + protected predicate: TuiBooleanHandler = (range) => tuiGetWordRange(range).toString().startsWith('@'); protected onArrow(event: Event, which: 'first' | 'last'): void { diff --git a/projects/demo/src/modules/directives/dropdown/examples/3/index.ts b/projects/demo/src/modules/directives/dropdown/examples/3/index.ts index e59e8082f7be..1d5e4e6b713e 100644 --- a/projects/demo/src/modules/directives/dropdown/examples/3/index.ts +++ b/projects/demo/src/modules/directives/dropdown/examples/3/index.ts @@ -31,5 +31,5 @@ export default class Example { protected value = 'some data'; - protected showBigText$ = interval(3000).pipe(map(i => !(i % 2))); + protected showBigText$ = interval(3000).pipe(map((i) => !(i % 2))); } diff --git a/projects/demo/src/modules/directives/elastic-sticky/examples/1/index.ts b/projects/demo/src/modules/directives/elastic-sticky/examples/1/index.ts index e65d4b791679..1f81f5504f0e 100644 --- a/projects/demo/src/modules/directives/elastic-sticky/examples/1/index.ts +++ b/projects/demo/src/modules/directives/elastic-sticky/examples/1/index.ts @@ -32,7 +32,7 @@ export default class Example implements AfterViewInit { // If we use it like that instead of (tuiElasticSticky)="onElasticSticky($event)" // we will not trigger unnecessary change detection when scale is less than 0.5 this.scale$ = this.elasticSticky.tuiElasticSticky.pipe( - map(scale => tuiClamp(scale, 0.5, 1)), + map((scale) => tuiClamp(scale, 0.5, 1)), startWith(1), distinctUntilChanged(), ); diff --git a/projects/demo/src/modules/directives/pan/examples/1/index.ts b/projects/demo/src/modules/directives/pan/examples/1/index.ts index 088275abb167..9a4ebec5e270 100644 --- a/projects/demo/src/modules/directives/pan/examples/1/index.ts +++ b/projects/demo/src/modules/directives/pan/examples/1/index.ts @@ -20,7 +20,7 @@ export default class Example { protected readonly coordinates$ = new BehaviorSubject([0, 0]); protected readonly transform$ = this.coordinates$.pipe( - map(coords => + map((coords) => this.sanitizer.bypassSecurityTrustStyle( `translate(${coords[0]}px, ${coords[1]}px)`, ), diff --git a/projects/demo/src/modules/directives/zoom/examples/1/index.ts b/projects/demo/src/modules/directives/zoom/examples/1/index.ts index 80fc42250059..525af6984408 100644 --- a/projects/demo/src/modules/directives/zoom/examples/1/index.ts +++ b/projects/demo/src/modules/directives/zoom/examples/1/index.ts @@ -22,7 +22,7 @@ export default class Example { startWith(1), ); - protected readonly transform$ = this.scale$.pipe(map(scale => `scale(${scale})`)); + protected readonly transform$ = this.scale$.pipe(map((scale) => `scale(${scale})`)); protected onZoom({delta}: TuiZoomEvent): void { this.delta$.next(delta); diff --git a/projects/demo/src/modules/markup/breakpoints/index.ts b/projects/demo/src/modules/markup/breakpoints/index.ts index cda03e2c8f7f..bdae8a0ec05f 100644 --- a/projects/demo/src/modules/markup/breakpoints/index.ts +++ b/projects/demo/src/modules/markup/breakpoints/index.ts @@ -21,9 +21,9 @@ function parseBreakpoints(file: string): Array<{name: string; value: string}> { return file .replaceAll(CODE_COMMENTS, '') .split(';') - .map(line => line.trim()) + .map((line) => line.trim()) .filter(Boolean) - .map(line => { + .map((line) => { const [name, ...value] = line.split(':'); return {name, value: value.join(':').replaceAll(/[~'"]/g, '').trim()}; diff --git a/projects/demo/src/modules/pipes/field-error/examples/1/index.ts b/projects/demo/src/modules/pipes/field-error/examples/1/index.ts index e47879140bec..233dada8cdcc 100644 --- a/projects/demo/src/modules/pipes/field-error/examples/1/index.ts +++ b/projects/demo/src/modules/pipes/field-error/examples/1/index.ts @@ -67,7 +67,7 @@ export default class Example { superComputerValidator, ]), }, - control => + (control) => Object.values((control as FormGroup).controls).every(({valid}) => valid) ? null : {other: 'Form is invalid'}, diff --git a/projects/demo/src/modules/pipes/field-error/examples/2/index.ts b/projects/demo/src/modules/pipes/field-error/examples/2/index.ts index 68661dbc8b55..c88e95ce80d3 100644 --- a/projects/demo/src/modules/pipes/field-error/examples/2/index.ts +++ b/projects/demo/src/modules/pipes/field-error/examples/2/index.ts @@ -40,7 +40,7 @@ import {interval, map, of, scan, startWith} from 'rxjs'; of(`Minimum length — ${requiredLength}`), min: interval(2000).pipe( scan(tuiIsFalsy, false), - map(val => (val ? 'Fix please' : 'Min number 3')), + map((val) => (val ? 'Fix please' : 'Min number 3')), startWith('Min number 3'), ), }, diff --git a/projects/demo/src/modules/pipes/field-error/examples/4/index.ts b/projects/demo/src/modules/pipes/field-error/examples/4/index.ts index fdad435a1bb4..8e1937bbe0ac 100644 --- a/projects/demo/src/modules/pipes/field-error/examples/4/index.ts +++ b/projects/demo/src/modules/pipes/field-error/examples/4/index.ts @@ -87,7 +87,8 @@ export default class Example { private getPhoneArrayValidator(): ValidatorFn { return ((array: FormArray): ValidationErrors | null => array.controls.length < 2 || - (!!array.controls.filter(item => item.errors).length && array.controls.length) + (!!array.controls.filter((item) => item.errors).length && + array.controls.length) ? { length: new TuiValidationError( 'You should add at least 2 phone number', diff --git a/projects/demo/src/modules/pipes/mapper/examples/2/index.ts b/projects/demo/src/modules/pipes/mapper/examples/2/index.ts index 5d24d526ae6e..afd87c683258 100644 --- a/projects/demo/src/modules/pipes/mapper/examples/2/index.ts +++ b/projects/demo/src/modules/pipes/mapper/examples/2/index.ts @@ -17,5 +17,5 @@ export default class Example { protected readonly mapper: TuiMapper<[readonly number[], number], number[]> = ( numbers, multiplier, - ) => numbers.map(number => number * multiplier); + ) => numbers.map((number) => number * multiplier); } diff --git a/projects/demo/src/utils/example.pipe.ts b/projects/demo/src/utils/example.pipe.ts index 29724fc433b4..d41f6e43e099 100644 --- a/projects/demo/src/utils/example.pipe.ts +++ b/projects/demo/src/utils/example.pipe.ts @@ -24,7 +24,7 @@ export class TuiExamplePipe implements PipeTransform { return Object.fromEntries( formats .split(',') - .map(format => [ + .map((format) => [ format === 'ts' ? 'TypeScript' : format.toUpperCase(), import( `../modules/${this.page.type}/${toKebab(this.page.header)}/examples/${index}/index.${format}?raw` diff --git a/projects/demo/webpack.config.ts b/projects/demo/webpack.config.ts index 5baeaabff187..34f07ddc23e5 100644 --- a/projects/demo/webpack.config.ts +++ b/projects/demo/webpack.config.ts @@ -80,11 +80,11 @@ export function makeWebpackConfig({server}: Options): WebpackConf { }); return (ngConfigs: Configuration): Configuration => { - const ngRules = [...(ngConfigs.module?.rules || [])].map(rule => + const ngRules = [...(ngConfigs.module?.rules || [])].map((rule) => typeof rule === 'object' && !!rule && DO_NOT_MUTATE_RAW_FILE_CONTENTS.some( - pattern => rule.test instanceof RegExp && rule.test?.test(pattern), + (pattern) => rule.test instanceof RegExp && rule.test?.test(pattern), ) ? { ...(rule as unknown as RuleSetRule), diff --git a/projects/experimental/package.json b/projects/experimental/package.json index e20662817a53..1ce5d31141f7 100644 --- a/projects/experimental/package.json +++ b/projects/experimental/package.json @@ -17,7 +17,7 @@ "@taiga-ui/cdk": "^4.0.0-rc.2", "@taiga-ui/core": "^4.0.0-rc.2", "@taiga-ui/kit": "^4.0.0-rc.2", - "@taiga-ui/polymorpheus": "^4.6.3", + "@taiga-ui/polymorpheus": "^4.6.4", "rxjs": ">=7.0.0", "tslib": "^2.6.3" } diff --git a/projects/kit/components/accordion/accordion.directive.ts b/projects/kit/components/accordion/accordion.directive.ts index 93ed39890105..06e9168313b4 100644 --- a/projects/kit/components/accordion/accordion.directive.ts +++ b/projects/kit/components/accordion/accordion.directive.ts @@ -41,15 +41,15 @@ export class TuiAccordionDirective implements AfterContentInit { const newOpenRow$ = rows$.pipe( pairwise(), map(([previous, current]) => - current.find(item => !previous.includes(item) && item.open), + current.find((item) => !previous.includes(item) && item.open), ), filter(tuiIsPresent), ); const rowsOpen$ = merge( rows$.pipe( - switchMap(rows => + switchMap((rows) => merge( - ...rows.map(row => + ...rows.map((row) => row.openChange.pipe( filter(identity), map(() => row), @@ -64,8 +64,8 @@ export class TuiAccordionDirective implements AfterContentInit { takeUntilDestroyed(this.destroyRef), ); - rowsOpen$.subscribe(currentRow => { - accordionItems.forEach(row => { + rowsOpen$.subscribe((currentRow) => { + accordionItems.forEach((row) => { if (currentRow !== row) { row.close(); } diff --git a/projects/kit/components/calendar-month/calendar-month.component.ts b/projects/kit/components/calendar-month/calendar-month.component.ts index b2a180d25c22..7bb83747001a 100644 --- a/projects/kit/components/calendar-month/calendar-month.component.ts +++ b/projects/kit/components/calendar-month/calendar-month.component.ts @@ -228,7 +228,7 @@ export class TuiCalendarMonth { minLength: number | null, maxLength: number | null, ): TuiBooleanHandler { - return item => { + return (item) => { const delta = value instanceof TuiMonthRange && value.isSingleMonth ? Math.abs( diff --git a/projects/kit/components/calendar-range/calendar-range.component.ts b/projects/kit/components/calendar-range/calendar-range.component.ts index 62f78232be11..5c753da9783b 100644 --- a/projects/kit/components/calendar-range/calendar-range.component.ts +++ b/projects/kit/components/calendar-range/calendar-range.component.ts @@ -84,7 +84,7 @@ export class TuiCalendarRange implements OnChanges { constructor() { inject>(TUI_CALENDAR_DATE_STREAM, {optional: true}) ?.pipe(tuiWatch(this.cdr), takeUntilDestroyed()) - .subscribe(value => { + .subscribe((value) => { this.value = value; }); } @@ -127,7 +127,7 @@ export class TuiCalendarRange implements OnChanges { ReadonlyArray > = (items, min, max, minLength, otherDateText) => [ ...items.filter( - item => + (item) => (minLength === null || item.range.from.append(minLength).daySameOrBefore(item.range.to)) && (min === null || item.range.to.daySameOrAfter(min)) && @@ -175,7 +175,7 @@ export class TuiCalendarRange implements OnChanges { private get activePeriod(): TuiDayRangePeriod | null { return ( this.selectedActivePeriod ?? - (this.items.find(item => + (this.items.find((item) => tuiNullableSame( this.value, item.range, @@ -194,7 +194,7 @@ export class TuiCalendarRange implements OnChanges { value: TuiDayRange | null, minLength: TuiDayLike | null, ): TuiBooleanHandler { - return item => { + return (item) => { if (!value?.isSingleDay || !minLength) { return disabledItemHandler(item); } diff --git a/projects/kit/components/calendar-range/test/calendar-range.component.spec.ts b/projects/kit/components/calendar-range/test/calendar-range.component.spec.ts index 8806c8a45aea..a849955de297 100644 --- a/projects/kit/components/calendar-range/test/calendar-range.component.spec.ts +++ b/projects/kit/components/calendar-range/test/calendar-range.component.spec.ts @@ -161,10 +161,10 @@ describe('rangeCalendarComponent', () => { testComponent.max = TuiDay.currentLocal().append({day: -1}); fixture.detectChanges(); - const items = getItems().map(item => item.nativeElement.textContent.trim()); + const items = getItems().map((item) => item.nativeElement.textContent.trim()); - expect(items.some(item => item === 'Yesterday')).toBe(true); - expect(items.some(item => item === 'Today')).toBe(false); + expect(items.some((item) => item === 'Yesterday')).toBe(true); + expect(items.some((item) => item === 'Today')).toBe(false); }); it('when redefining intervals, the list always contains "Other date..."', () => { diff --git a/projects/kit/components/carousel/carousel.directive.ts b/projects/kit/components/carousel/carousel.directive.ts index e8292c408599..295b274e6a33 100644 --- a/projects/kit/components/carousel/carousel.directive.ts +++ b/projects/kit/components/carousel/carousel.directive.ts @@ -24,12 +24,12 @@ export class TuiCarouselDirective extends Observable { private readonly output$ = combineLatest([this.duration$, this.running$]).pipe( tuiIfMap( ([duration]) => interval(duration), - values => values.every(Boolean), + (values) => values.every(Boolean), ), ); constructor() { - super(subscriber => this.output$.subscribe(subscriber)); + super((subscriber) => this.output$.subscribe(subscriber)); } @Input() diff --git a/projects/kit/components/checkbox/checkbox.component.ts b/projects/kit/components/checkbox/checkbox.component.ts index 6b694ad2d17b..734205a2d12d 100644 --- a/projects/kit/components/checkbox/checkbox.component.ts +++ b/projects/kit/components/checkbox/checkbox.component.ts @@ -55,7 +55,7 @@ export class TuiCheckbox implements OnInit, DoCheck { tuiControlValue(this.control) .pipe(takeUntilDestroyed(this.destroyRef)) - .subscribe(value => { + .subscribe((value) => { // https://github.com/angular/angular/issues/14988 const fix = this.control instanceof NgModel ? this.control.model : value; diff --git a/projects/kit/components/checkbox/checkbox.options.ts b/projects/kit/components/checkbox/checkbox.options.ts index 39a9287a726c..b55acb415061 100644 --- a/projects/kit/components/checkbox/checkbox.options.ts +++ b/projects/kit/components/checkbox/checkbox.options.ts @@ -14,7 +14,7 @@ export interface TuiCheckboxOptions { export const TUI_CHECKBOX_DEFAULT_OPTIONS: TuiCheckboxOptions = { size: 'm', - appearance: el => (el.checked || el.indeterminate ? 'primary' : 'whiteblock'), + appearance: (el) => (el.checked || el.indeterminate ? 'primary' : 'whiteblock'), icons: { checked: () => '@tui.check', indeterminate: () => '@tui.minus', diff --git a/projects/kit/components/elastic-container/elastic-container.component.ts b/projects/kit/components/elastic-container/elastic-container.component.ts index e8cd372b987f..6a5cd7712765 100644 --- a/projects/kit/components/elastic-container/elastic-container.component.ts +++ b/projects/kit/components/elastic-container/elastic-container.component.ts @@ -18,7 +18,7 @@ export class TuiElasticContainer { @HostBinding('class._transitioning') protected transitions = 0; - @shouldCall(name => name === 'height') + @shouldCall((name) => name === 'height') protected onAnimation(_name: string, count: number): void { this.transitions += count; } diff --git a/projects/kit/components/files/file/file.component.ts b/projects/kit/components/files/file/file.component.ts index 5b4902b5cadb..672d8dcf4f39 100644 --- a/projects/kit/components/files/file/file.component.ts +++ b/projects/kit/components/files/file/file.component.ts @@ -131,7 +131,7 @@ export class TuiFile { fileTexts$: Observable>, ): Observable { return state === 'error' && !file.content - ? fileTexts$.pipe(map(texts => texts.loadingError)) + ? fileTexts$.pipe(map((texts) => texts.loadingError)) : of(this.file.content || ''); } @@ -140,7 +140,7 @@ export class TuiFile { file: TuiFileLike, units$: Observable<[string, string, string]>, ): Observable { - return units$.pipe(map(units => this.options.formatSize(units, file.size))); + return units$.pipe(map((units) => this.options.formatSize(units, file.size))); } @tuiPure diff --git a/projects/kit/components/files/files.utils.ts b/projects/kit/components/files/files.utils.ts index ac0e328ffcf1..d876a6c70a1f 100644 --- a/projects/kit/components/files/files.utils.ts +++ b/projects/kit/components/files/files.utils.ts @@ -20,7 +20,7 @@ export function tuiFilesAccepted(control?: AbstractControl | null): File[] { const size: File[] = control?.getError(TUI_SIZE_ERROR)?.$implicit || []; const format: File[] = control?.getError(TUI_FORMAT_ERROR)?.$implicit || []; - return files.filter(file => !size.includes(file) && !format.includes(file)); + return files.filter((file) => !size.includes(file) && !format.includes(file)); } export function tuiFormatSize( diff --git a/projects/kit/components/files/files.validators.ts b/projects/kit/components/files/files.validators.ts index cd2406253c5f..bf21c8098bb9 100644 --- a/projects/kit/components/files/files.validators.ts +++ b/projects/kit/components/files/files.validators.ts @@ -16,7 +16,7 @@ interface FileSizeError { export function tuiCreateFileSizeValidator(size: number): ValidatorFn { return ({value}: {value: File | readonly File[] | null}): FileSizeError | null => { const files = value && coerceArray(value); - const $implicit = value && files?.filter(file => file.size > size); + const $implicit = value && files?.filter((file) => file.size > size); return $implicit?.length ? {[TUI_SIZE_ERROR]: {$implicit, size}} : null; }; @@ -26,7 +26,7 @@ export function tuiCreateFileFormatValidator(accept: string): ValidatorFn { return ({value}: {value: File | readonly File[] | null}): FileFormatError | null => { const files = value && coerceArray(value); const formats = toArray(accept); - const $implicit = value && files?.filter(file => !checkFormat(file, formats)); + const $implicit = value && files?.filter((file) => !checkFormat(file, formats)); return $implicit?.length && accept ? {[TUI_FORMAT_ERROR]: {$implicit}} : null; }; @@ -36,7 +36,7 @@ function checkFormat({name, type}: File, formats: readonly string[]): boolean { const extension = `.${(name.split('.').pop() || '').toLowerCase()}`; return formats.some( - format => + (format) => format === extension || format === type || (format.split('/')[1] === '*' && type.split('/')[0] === format.split('/')[0]), @@ -47,5 +47,5 @@ function toArray(accept: string): readonly string[] { return accept .toLowerCase() .split(',') - .map(format => format.trim().toLowerCase()); + .map((format) => format.trim().toLowerCase()); } diff --git a/projects/kit/components/files/input-files/input-files.content.ts b/projects/kit/components/files/input-files/input-files.content.ts index 9cc109bd2f36..d683cb7bde2e 100644 --- a/projects/kit/components/files/input-files/input-files.content.ts +++ b/projects/kit/components/files/input-files/input-files.content.ts @@ -45,7 +45,7 @@ export class TuiInputFilesContent { return fileDragged ? of('') : this.text$.pipe( - map(t => (multiple ? t.defaultLinkMultiple : t.defaultLinkSingle)), + map((t) => (multiple ? t.defaultLinkMultiple : t.defaultLinkSingle)), ); } diff --git a/projects/kit/components/filter/filter.component.ts b/projects/kit/components/filter/filter.component.ts index 92213f5e995a..10b5eab24836 100644 --- a/projects/kit/components/filter/filter.component.ts +++ b/projects/kit/components/filter/filter.component.ts @@ -67,14 +67,14 @@ export class TuiFilterComponent extends TuiControl { public content: PolymorpheusContent = ({$implicit}) => String($implicit); @Input() - public badgeHandler: TuiHandler = item => Number(item); + public badgeHandler: TuiHandler = (item) => Number(item); public onCheckbox(value: boolean, item: T): void { this.toggledItem.emit(item); this.onChange( value ? [...this.value(), item] - : this.value().filter(arrItem => !this.identityMatcher(arrItem, item)), + : this.value().filter((arrItem) => !this.identityMatcher(arrItem, item)), ); } @@ -83,6 +83,6 @@ export class TuiFilterComponent extends TuiControl { } protected isCheckboxEnabled(item: T): boolean { - return this.value().some(arrItem => this.identityMatcher(arrItem, item)); + return this.value().some((arrItem) => this.identityMatcher(arrItem, item)); } } diff --git a/projects/kit/components/filter/test/filter.component.spec.ts b/projects/kit/components/filter/test/filter.component.spec.ts index 200127c9e2da..4fba0abb0b32 100644 --- a/projects/kit/components/filter/test/filter.component.spec.ts +++ b/projects/kit/components/filter/test/filter.component.spec.ts @@ -57,7 +57,7 @@ describe('Filter', () => { public size: TuiSizeS = 'm'; - public badgeHandler: TuiHandler = item => Number(item); + public badgeHandler: TuiHandler = (item) => Number(item); } let fixture: ComponentFixture; @@ -153,7 +153,7 @@ describe('Filter', () => { }); it('present if disabledHandler returned true', async () => { - testComponent.disabledItemHandler = item => item.indexOf('footwear') > -1; + testComponent.disabledItemHandler = (item) => item.indexOf('footwear') > -1; fixture.detectChanges(); await fixture.whenStable(); diff --git a/projects/kit/components/input-phone-international/input-phone-international.options.ts b/projects/kit/components/input-phone-international/input-phone-international.options.ts index da187311fb92..27d20fcb3224 100644 --- a/projects/kit/components/input-phone-international/input-phone-international.options.ts +++ b/projects/kit/components/input-phone-international/input-phone-international.options.ts @@ -16,7 +16,7 @@ export const TUI_INPUT_PHONE_INTERNATIONAL_DEFAULT_OPTIONS: TuiInputPhoneInterna countries: [], countryIsoCode: 'RU', metadata: defer(async () => - import('libphonenumber-js/min/metadata').then(m => m.default), + import('libphonenumber-js/min/metadata').then((m) => m.default), ), }; diff --git a/projects/kit/components/input-phone-international/test/input-phone-international.component.spec.ts b/projects/kit/components/input-phone-international/test/input-phone-international.component.spec.ts index d7e1e332a0a6..8a5e1f0fbc9c 100644 --- a/projects/kit/components/input-phone-international/test/input-phone-international.component.spec.ts +++ b/projects/kit/components/input-phone-international/test/input-phone-international.component.spec.ts @@ -125,7 +125,7 @@ describe('InputPhoneInternational', () => { }); describe('should set KZ country code on paste event', () => { - ['+7 777 777-7777', '+7 7272 588300'].forEach(phone => { + ['+7 777 777-7777', '+7 7272 588300'].forEach((phone) => { it(`${phone}`, async () => { await paste(phone); @@ -169,7 +169,7 @@ describe('InputPhoneInternational', () => { let result: unknown; const phoneNumber = '+380123456789'; - testComponent.control.valueChanges.subscribe(value => { + testComponent.control.valueChanges.subscribe((value) => { result = value; }); @@ -221,7 +221,7 @@ describe('InputPhoneInternational', () => { const countryNameContainers = fixture.debugElement.queryAll(By.css('.t-country-item-name')) || []; - return countryNameContainers.map(container => + return countryNameContainers.map((container) => container.nativeElement.textContent?.trim(), ); } diff --git a/projects/kit/components/items-with-more/items-with-more.service.ts b/projects/kit/components/items-with-more/items-with-more.service.ts index 1ef8b2004ca6..cf96ebcfc18a 100644 --- a/projects/kit/components/items-with-more/items-with-more.service.ts +++ b/projects/kit/components/items-with-more/items-with-more.service.ts @@ -26,7 +26,7 @@ export class TuiItemsWithMoreService extends Observable { ); constructor() { - super(subscriber => this.stream$.subscribe(subscriber)); + super((subscriber) => this.stream$.subscribe(subscriber)); } private get maxItems(): number { diff --git a/projects/kit/components/radio-list/radio-list.component.ts b/projects/kit/components/radio-list/radio-list.component.ts index 7d2ac2f2c111..5345a3c4574c 100644 --- a/projects/kit/components/radio-list/radio-list.component.ts +++ b/projects/kit/components/radio-list/radio-list.component.ts @@ -75,7 +75,7 @@ export class TuiRadioList extends TuiControl { @HostListener('focusout') protected onFocusOut(): void { - this.controls.forEach(control => control.control?.markAsTouched()); + this.controls.forEach((control) => control.control?.markAsTouched()); if (!this.touched()) { this.onTouched(); diff --git a/projects/kit/components/range/range-change.directive.ts b/projects/kit/components/range/range-change.directive.ts index 82d73a647e94..cb198aaf3744 100644 --- a/projects/kit/components/range/range-change.directive.ts +++ b/projects/kit/components/range/range-change.directive.ts @@ -56,13 +56,13 @@ export class TuiRangeChange { this.el.focus(); } }), - switchMap(event => this.pointerMove$.pipe(startWith(event))), + switchMap((event) => this.pointerMove$.pipe(startWith(event))), map(({clientX}) => this.getFractionFromEvents(clientX)), takeUntil(this.pointerUp$), repeat(), takeUntilDestroyed(), ) - .subscribe(fraction => { + .subscribe((fraction) => { const value = this.range.toValue(fraction); this.range.processValue(value, activeThumb === 'right'); diff --git a/projects/kit/components/routable-dialog/test/generate-dialogable-route.spec.ts b/projects/kit/components/routable-dialog/test/generate-dialogable-route.spec.ts index aadaa4c41290..1c2bed50d77c 100644 --- a/projects/kit/components/routable-dialog/test/generate-dialogable-route.spec.ts +++ b/projects/kit/components/routable-dialog/test/generate-dialogable-route.spec.ts @@ -4,7 +4,7 @@ import TuiRoutableDialog from '../routable-dialog.component'; class Dialog {} describe('tuiGenerateDialogableRoute', () => { - it('generated route should have component: TuiRoutableDialogComponent', done => { + it('generated route should have component: TuiRoutableDialogComponent', (done) => { const result = tuiGenerateDialogableRoute(Dialog); void Promise.resolve(result.loadComponent?.()).then((module: any) => { diff --git a/projects/kit/components/segmented/segmented.directive.ts b/projects/kit/components/segmented/segmented.directive.ts index ffe3f10eeb77..6ce6fa5a98c8 100644 --- a/projects/kit/components/segmented/segmented.directive.ts +++ b/projects/kit/components/segmented/segmented.directive.ts @@ -62,10 +62,10 @@ export class TuiSegmentedDirective implements AfterContentChecked, AfterContentI } private get linkIndex(): number { - return this.links.toArray().findIndex(link => link.isActive); + return this.links.toArray().findIndex((link) => link.isActive); } private getIndex(element: Element | null): number { - return Array.from(this.el.children).findIndex(tab => tab.contains(element)); + return Array.from(this.el.children).findIndex((tab) => tab.contains(element)); } } diff --git a/projects/kit/components/slider/helpers/slider-readonly.directive.ts b/projects/kit/components/slider/helpers/slider-readonly.directive.ts index 1aede16444e9..5640e3b541e6 100644 --- a/projects/kit/components/slider/helpers/slider-readonly.directive.ts +++ b/projects/kit/components/slider/helpers/slider-readonly.directive.ts @@ -47,7 +47,7 @@ export class TuiSliderReadonly { const shouldPreventMove$ = merge( touchStart$.pipe( - tap(e => this.preventEvent(e)), + tap((e) => this.preventEvent(e)), map(TUI_TRUE_HANDLER), ), touchEnd$.pipe(map(TUI_FALSE_HANDLER)), diff --git a/projects/kit/components/stepper/stepper.component.ts b/projects/kit/components/stepper/stepper.component.ts index 926d12a996c9..24e0ebc2fc8b 100644 --- a/projects/kit/components/stepper/stepper.component.ts +++ b/projects/kit/components/stepper/stepper.component.ts @@ -131,7 +131,7 @@ export class TuiStepperComponent { } const stepElements = this.steps.toArray().map(({nativeElement}) => nativeElement); - const index = stepElements.findIndex(element => element === current); + const index = stepElements.findIndex((element) => element === current); tuiMoveFocus(index, stepElements, step); } diff --git a/projects/kit/components/switch/switch.options.ts b/projects/kit/components/switch/switch.options.ts index e5af4de86928..7b48b9b32ef6 100644 --- a/projects/kit/components/switch/switch.options.ts +++ b/projects/kit/components/switch/switch.options.ts @@ -14,7 +14,7 @@ export const TUI_SWITCH_DEFAULT_OPTIONS: TuiSwitchOptions = { showIcons: true, size: 'm', icon: '@tui.check', - appearance: el => (el.checked ? 'primary' : 'secondary'), + appearance: (el) => (el.checked ? 'primary' : 'secondary'), }; export const TUI_SWITCH_OPTIONS = tuiCreateToken(TUI_SWITCH_DEFAULT_OPTIONS); diff --git a/projects/kit/components/tabs/tabs-with-more.component.ts b/projects/kit/components/tabs/tabs-with-more.component.ts index 7edcd8581d5e..2705702782bf 100644 --- a/projects/kit/components/tabs/tabs-with-more.component.ts +++ b/projects/kit/components/tabs/tabs-with-more.component.ts @@ -115,9 +115,9 @@ export class TuiTabsWithMore implements AfterViewChecked, AfterViewInit { .pipe( map(() => this.getMaxIndex()), tap(() => this.refresh()), - filter(maxIndex => this.maxIndex !== maxIndex), + filter((maxIndex) => this.maxIndex !== maxIndex), ) - .subscribe(maxIndex => { + .subscribe((maxIndex) => { this.maxIndex = maxIndex; this.cdr.detectChanges(); }); diff --git a/projects/kit/components/tabs/tabs.directive.ts b/projects/kit/components/tabs/tabs.directive.ts index 5cf8e1d4c3e0..c0ad8fd74aa1 100644 --- a/projects/kit/components/tabs/tabs.directive.ts +++ b/projects/kit/components/tabs/tabs.directive.ts @@ -79,7 +79,7 @@ export class TuiTabsDirective implements AfterViewChecked { @HostListener(TUI_TAB_ACTIVATE, ['$event', '$event.target']) protected onActivate(event: Event, element: HTMLElement): void { - const index = this.tabs.findIndex(tab => tab === element); + const index = this.tabs.findIndex((tab) => tab === element); event.stopPropagation(); @@ -94,7 +94,7 @@ export class TuiTabsDirective implements AfterViewChecked { protected markTabAsActive(): void { const {tabs, activeElement} = this; - tabs.forEach(nativeElement => { + tabs.forEach((nativeElement) => { const active = nativeElement === activeElement; nativeElement.classList.toggle('_active', active); diff --git a/projects/kit/components/tabs/test/tabs.component.spec.ts b/projects/kit/components/tabs/test/tabs.component.spec.ts index 4ad9b1903ca5..84fdf7c9cfaa 100644 --- a/projects/kit/components/tabs/test/tabs.component.spec.ts +++ b/projects/kit/components/tabs/test/tabs.component.spec.ts @@ -65,7 +65,7 @@ describe('Tabs', () => { it('when you click on a tab it changes the active tab', () => { const [firstTab, secondTab] = getTabs().map( - tab => tab.nativeElement as HTMLButtonElement, + (tab) => tab.nativeElement as HTMLButtonElement, ); expect(firstTab).toEqual(component.tabsDirective.activeElement); @@ -79,7 +79,7 @@ describe('Tabs', () => { it('when a tab is active, it has the class _active', () => { const [firstTab, secondTab] = getTabs().map( - tab => tab.nativeElement as HTMLButtonElement, + (tab) => tab.nativeElement as HTMLButtonElement, ); expect(firstTab.classList.contains('_active')).toBeTruthy(); diff --git a/projects/kit/components/tiles/tile.service.ts b/projects/kit/components/tiles/tile.service.ts index 77661c5f7a5c..dd22495cc01c 100644 --- a/projects/kit/components/tiles/tile.service.ts +++ b/projects/kit/components/tiles/tile.service.ts @@ -35,7 +35,7 @@ export class TuiTileService implements OnDestroy { public init(element: HTMLElement): void { if (this.isBrowser) { this.sub.add( - this.position$.subscribe(offset => { + this.position$.subscribe((offset) => { this.setPosition(element, offset); this.setRect(element, offset); }), diff --git a/projects/kit/components/tiles/tiles.component.ts b/projects/kit/components/tiles/tiles.component.ts index 051baa0eab1a..d333c401b98c 100644 --- a/projects/kit/components/tiles/tiles.component.ts +++ b/projects/kit/components/tiles/tiles.component.ts @@ -42,7 +42,7 @@ export class TuiTilesComponent { public readonly orderChange = this.el$.pipe( debounce(() => timer(this.debounce)), filter(this.filter.bind(this)), - map(element => this.reorder(element)), + map((element) => this.reorder(element)), ); @HostBinding('class._dragged') diff --git a/projects/kit/components/tree/misc/tree.service.ts b/projects/kit/components/tree/misc/tree.service.ts index 5d655c41cc3a..213ea2e10041 100644 --- a/projects/kit/components/tree/misc/tree.service.ts +++ b/projects/kit/components/tree/misc/tree.service.ts @@ -13,11 +13,13 @@ export class TuiTreeService { private readonly load$ = new Subject(); public readonly data$ = this.load$.pipe( - switchMap(item => + switchMap((item) => this.loader.loadChildren(item).pipe( - tap(children => this.map.set(item, children)), - map(children => children.filter(item => !this.loader.hasChildren(item))), - tap(children => children.forEach(child => this.map.set(child, []))), + tap((children) => this.map.set(item, children)), + map((children) => + children.filter((item) => !this.loader.hasChildren(item)), + ), + tap((children) => children.forEach((child) => this.map.set(child, []))), ), ), startWith(null), diff --git a/projects/kit/directives/data-list-dropdown-manager/data-list-dropdown-manager.directive.ts b/projects/kit/directives/data-list-dropdown-manager/data-list-dropdown-manager.directive.ts index 658420c9017a..5c1d4351e493 100644 --- a/projects/kit/directives/data-list-dropdown-manager/data-list-dropdown-manager.directive.ts +++ b/projects/kit/directives/data-list-dropdown-manager/data-list-dropdown-manager.directive.ts @@ -37,13 +37,13 @@ export class TuiDataListDropdownManager implements AfterViewInit { private readonly destroyRef = inject(DestroyRef); public ngAfterViewInit(): void { - this.right$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(index => { + this.right$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((index) => { this.tryToFocus(index); }); merge(this.immediate$, this.debounce$) .pipe( - switchMap(active => { + switchMap((active) => { this.dropdowns.forEach((dropdown, index) => { dropdown.toggle(index === active); }); @@ -66,7 +66,7 @@ export class TuiDataListDropdownManager implements AfterViewInit { ).pipe(filter(({key}) => key === 'Escape')); return merge(mouseEnter$, esc$).pipe( - tap(event => { + tap((event) => { if (dropdown.dropdownBoxRef) { event.stopPropagation(); } @@ -84,7 +84,7 @@ export class TuiDataListDropdownManager implements AfterViewInit { @tuiPure private get elements$(): Observable { return tuiQueryListChanges(this.els).pipe( - map(array => array.map(({nativeElement}) => nativeElement)), + map((array) => array.map(({nativeElement}) => nativeElement)), shareReplay({bufferSize: 1, refCount: true}), ); } @@ -92,7 +92,7 @@ export class TuiDataListDropdownManager implements AfterViewInit { @tuiPure private get right$(): Observable { return this.elements$.pipe( - switchMap(elements => + switchMap((elements) => merge( ...elements.map((element, index) => tuiTypedFromEvent(element, 'keydown').pipe( @@ -109,7 +109,7 @@ export class TuiDataListDropdownManager implements AfterViewInit { @tuiPure private get immediate$(): Observable { return this.elements$.pipe( - switchMap(elements => + switchMap((elements) => merge( ...elements.map((element, index) => tuiTypedFromEvent(element, 'click').pipe(map(() => index)), @@ -122,7 +122,7 @@ export class TuiDataListDropdownManager implements AfterViewInit { @tuiPure private get debounce$(): Observable { return this.elements$.pipe( - switchMap(elements => + switchMap((elements) => merge( ...elements.map((element, index) => merge( diff --git a/projects/kit/directives/lazy-loading/lazy-loading.directive.ts b/projects/kit/directives/lazy-loading/lazy-loading.directive.ts index 9c264e5b56f8..125a666a63be 100644 --- a/projects/kit/directives/lazy-loading/lazy-loading.directive.ts +++ b/projects/kit/directives/lazy-loading/lazy-loading.directive.ts @@ -26,7 +26,7 @@ export class TuiImgLazyLoading { constructor() { if (!this.supported) { - this.src$.pipe(takeUntilDestroyed()).subscribe(src => { + this.src$.pipe(takeUntilDestroyed()).subscribe((src) => { this.src = src; }); } diff --git a/projects/kit/directives/lazy-loading/lazy-loading.service.ts b/projects/kit/directives/lazy-loading/lazy-loading.service.ts index 22bdbf523aff..2080000f1753 100644 --- a/projects/kit/directives/lazy-loading/lazy-loading.service.ts +++ b/projects/kit/directives/lazy-loading/lazy-loading.service.ts @@ -9,7 +9,7 @@ export class TuiLazyLoadingService extends Observable private readonly src$ = new Subject(); private readonly intersections$ = inject(IntersectionObserverService); private readonly stream$ = this.src$.pipe( - switchMap(src => + switchMap((src) => this.intersections$.pipe( filter(([{isIntersecting}]) => isIntersecting), map(() => src), @@ -20,7 +20,7 @@ export class TuiLazyLoadingService extends Observable ); constructor() { - super(subscriber => this.stream$.subscribe(subscriber)); + super((subscriber) => this.stream$.subscribe(subscriber)); } public next(src: SafeResourceUrl | string): void { diff --git a/projects/kit/directives/tooltip/tooltip.directive.ts b/projects/kit/directives/tooltip/tooltip.directive.ts index 12ab10935f81..67cf316c60ac 100644 --- a/projects/kit/directives/tooltip/tooltip.directive.ts +++ b/projects/kit/directives/tooltip/tooltip.directive.ts @@ -98,7 +98,7 @@ function bindAppearanceState(): Signal { 'tuiAppearanceState', toSignal( inject(TuiHintHover).pipe( - map(hover => (hover ? 'hover' : null)), + map((hover) => (hover ? 'hover' : null)), tuiWatch(inject(ChangeDetectorRef)), ), {initialValue: null}, diff --git a/projects/kit/package.json b/projects/kit/package.json index 003bfe3721ec..b3d55baf0e36 100644 --- a/projects/kit/package.json +++ b/projects/kit/package.json @@ -28,7 +28,7 @@ "@taiga-ui/cdk": "^4.0.0-rc.2", "@taiga-ui/core": "^4.0.0-rc.2", "@taiga-ui/i18n": "^4.0.0-rc.2", - "@taiga-ui/polymorpheus": "^4.6.3", + "@taiga-ui/polymorpheus": "^4.6.4", "rxjs": ">=7.0.0", "tslib": "^2.6.3" } diff --git a/projects/kit/pipes/emails/emails.pipe.spec.ts b/projects/kit/pipes/emails/emails.pipe.spec.ts index d714c2370341..a28cae2408f9 100644 --- a/projects/kit/pipes/emails/emails.pipe.spec.ts +++ b/projects/kit/pipes/emails/emails.pipe.spec.ts @@ -30,7 +30,7 @@ describe('TuiEmailsPipe', () => { it('should not filter suggestions if query contains "@" and is empty', () => { const result = pipe.transform('@'); - expect(result).toEqual(options.map(item => `@${item}`)); + expect(result).toEqual(options.map((item) => `@${item}`)); }); it('should filter suggestions if query contains "@" and is not empty', () => { diff --git a/projects/kit/pipes/emails/emails.pipe.ts b/projects/kit/pipes/emails/emails.pipe.ts index 3ae409c8f30c..cbac44c7b738 100644 --- a/projects/kit/pipes/emails/emails.pipe.ts +++ b/projects/kit/pipes/emails/emails.pipe.ts @@ -16,8 +16,11 @@ export class TuiEmailsPipe implements PipeTransform { ): readonly string[] { return query.includes('@') ? suggestions - .map(item => query.slice(0, Math.max(0, query.indexOf('@') + 1)) + item) - .filter(item => item.startsWith(query)) + .map( + (item) => + query.slice(0, Math.max(0, query.indexOf('@') + 1)) + item, + ) + .filter((item) => item.startsWith(query)) : []; } } diff --git a/projects/kit/pipes/field-error/field-error-pipe.ts b/projects/kit/pipes/field-error/field-error-pipe.ts index 4bfd6a9eb7b7..54cea53d5807 100644 --- a/projects/kit/pipes/field-error/field-error-pipe.ts +++ b/projects/kit/pipes/field-error/field-error-pipe.ts @@ -14,7 +14,7 @@ function unwrapObservable( content: Observable, context: any, ): Observable { - return content.pipe(map(error => new TuiValidationError(error || '', context))); + return content.pipe(map((error) => new TuiValidationError(error || '', context))); } function defaultError( @@ -128,7 +128,7 @@ export class TuiFieldErrorPipe implements PipeTransform, ControlValueAccessor { order: readonly string[], controlErrors: Record, ): string { - const id = order?.find(errorId => controlErrors[errorId]); + const id = order?.find((errorId) => controlErrors[errorId]); const fallback = Object.keys(controlErrors)[0]; return id || fallback || ''; diff --git a/projects/kit/pipes/filter-by-input/filter-by-input.pipe.ts b/projects/kit/pipes/filter-by-input/filter-by-input.pipe.ts index 7005c1e8a0e9..42eb6668e678 100644 --- a/projects/kit/pipes/filter-by-input/filter-by-input.pipe.ts +++ b/projects/kit/pipes/filter-by-input/filter-by-input.pipe.ts @@ -66,7 +66,7 @@ export class TuiFilterByInputPipe implements PipeTransform { return tuiIsPresent(match) ? items - : items.filter(item => matcher(item, query, stringify)); + : items.filter((item) => matcher(item, query, stringify)); } private filter2d( @@ -75,13 +75,13 @@ export class TuiFilterByInputPipe implements PipeTransform { stringify: TuiStringHandler, query: string, ): ReadonlyArray { - const match = items.find(item => + const match = items.find((item) => tuiIsPresent(this.getMatch(item, stringify, query)), ); return tuiIsPresent(match) ? items - : items.map(inner => this.filterFlat(inner, matcher, stringify, query)); + : items.map((inner) => this.filterFlat(inner, matcher, stringify, query)); } private getMatch( @@ -90,7 +90,7 @@ export class TuiFilterByInputPipe implements PipeTransform { query: string, ): T | undefined { return items.find( - item => stringify(item).toLocaleLowerCase() === query.toLocaleLowerCase(), + (item) => stringify(item).toLocaleLowerCase() === query.toLocaleLowerCase(), ); } } diff --git a/projects/kit/pipes/sort-countries/sort-countries.pipe.ts b/projects/kit/pipes/sort-countries/sort-countries.pipe.ts index bc4df86866c0..b5c92ea3a7e3 100644 --- a/projects/kit/pipes/sort-countries/sort-countries.pipe.ts +++ b/projects/kit/pipes/sort-countries/sort-countries.pipe.ts @@ -16,7 +16,9 @@ export class TuiSortCountriesPipe implements PipeTransform { countries: readonly TuiCountryIsoCode[], ): Observable { return this.countriesNames$.pipe( - map(names => [...countries].sort((a, b) => names[a].localeCompare(names[b]))), + map((names) => + [...countries].sort((a, b) => names[a].localeCompare(names[b])), + ), ); } } diff --git a/projects/kit/pipes/stringify/stringify.pipe.ts b/projects/kit/pipes/stringify/stringify.pipe.ts index 7919e1b76ae9..e710486ff7be 100644 --- a/projects/kit/pipes/stringify/stringify.pipe.ts +++ b/projects/kit/pipes/stringify/stringify.pipe.ts @@ -10,6 +10,6 @@ export class TuiStringifyPipe implements PipeTransform { public transform( key: K, ): TuiStringHandler & Record>> { - return value => String(value[key] ?? ''); + return (value) => String(value[key] ?? ''); } } diff --git a/projects/kit/tokens/calendar-date-stream.ts b/projects/kit/tokens/calendar-date-stream.ts index 7d4ed89b097d..dd427e1cf6f6 100644 --- a/projects/kit/tokens/calendar-date-stream.ts +++ b/projects/kit/tokens/calendar-date-stream.ts @@ -35,7 +35,7 @@ function tuiControlValueFactory< ): Observable | null { return control ? tuiControlValue(control).pipe( - map(value => + map((value) => transformer ? transformer?.fromControlValue(value) : (value as T), ), ) diff --git a/projects/kit/utils/create-time-periods.ts b/projects/kit/utils/create-time-periods.ts index da968cf94a36..bf1d862a4be0 100644 --- a/projects/kit/utils/create-time-periods.ts +++ b/projects/kit/utils/create-time-periods.ts @@ -8,7 +8,7 @@ export function tuiCreateTimePeriods( const timeArray: TuiTime[] = []; for (let i = minHour; i < maxHour; i++) { - minutes.forEach(minute => { + minutes.forEach((minute) => { const time = new TuiTime(i, minute); timeArray.push(time); diff --git a/projects/kit/utils/toggle-day.ts b/projects/kit/utils/toggle-day.ts index 322e898d1363..3558257aa12d 100644 --- a/projects/kit/utils/toggle-day.ts +++ b/projects/kit/utils/toggle-day.ts @@ -5,8 +5,8 @@ export function tuiToggleDay( day: TuiDay, ): readonly TuiDay[] { return ( - (days?.find(item => item.daySame(day)) - ? days.filter(item => !item.daySame(day)) + (days?.find((item) => item.daySame(day)) + ? days.filter((item) => !item.daySame(day)) : days?.concat(day)) || [] ); } diff --git a/projects/layout/package.json b/projects/layout/package.json index 84214cf17ee4..0bfbb5995ffc 100644 --- a/projects/layout/package.json +++ b/projects/layout/package.json @@ -15,7 +15,7 @@ "@angular/core": ">=16.0.0", "@taiga-ui/cdk": "^4.0.0-rc.2", "@taiga-ui/core": "^4.0.0-rc.2", - "@taiga-ui/polymorpheus": "^4.6.3", + "@taiga-ui/polymorpheus": "^4.6.4", "rxjs": ">=7.0.0", "tslib": "^2.6.3" } diff --git a/projects/legacy/classes/control.ts b/projects/legacy/classes/control.ts index 95563138e8eb..c199e3b91575 100644 --- a/projects/legacy/classes/control.ts +++ b/projects/legacy/classes/control.ts @@ -140,7 +140,9 @@ export abstract class AbstractTuiControl map(() => this.ngControl?.control), filter(tuiIsPresent), distinctUntilChanged(), - switchMap(control => merge(control.valueChanges, control.statusChanges)), + switchMap((control) => + merge(control.valueChanges, control.statusChanges), + ), takeUntilDestroyed(this.destroyRef), ) .subscribe(() => { diff --git a/projects/legacy/components/color-selector/color-selector.component.ts b/projects/legacy/components/color-selector/color-selector.component.ts index efad38bab066..8d6db9ced8be 100644 --- a/projects/legacy/components/color-selector/color-selector.component.ts +++ b/projects/legacy/components/color-selector/color-selector.component.ts @@ -186,8 +186,8 @@ export class TuiColorSelectorComponent { } public onStopsChange(stopsKeys: readonly number[]): void { - const removed = this.stopsKeys.find(item => !stopsKeys.includes(item)); - const added = stopsKeys.find(item => !this.stopsKeys.includes(item)); + const removed = this.stopsKeys.find((item) => !stopsKeys.includes(item)); + const added = stopsKeys.find((item) => !this.stopsKeys.includes(item)); if (removed === undefined && added !== undefined) { this.addStop(added); @@ -235,7 +235,7 @@ export class TuiColorSelectorComponent { private getGradient(direction: TuiGradientDirection): string { return `linear-gradient(${direction}, ${[...this.stopsKeys] .sort(tuiDefaultSort) - .map(key => `rgba(${this.getStop(key).join(', ')}) ${key * 100}%`) + .map((key) => `rgba(${this.getStop(key).join(', ')}) ${key * 100}%`) .join(', ')})`; } @@ -265,7 +265,7 @@ export class TuiColorSelectorComponent { this.currentStop = added; this.stops = new Map( - this.stopsKeys.map<[number, [number, number, number, number]]>(key => + this.stopsKeys.map<[number, [number, number, number, number]]>((key) => key === removed ? [added, value] : [key, this.getStop(key)], ), ); diff --git a/projects/legacy/components/color-selector/flat-picker/flat-picker.component.ts b/projects/legacy/components/color-selector/flat-picker/flat-picker.component.ts index adf11779205a..60c2cf81462f 100644 --- a/projects/legacy/components/color-selector/flat-picker/flat-picker.component.ts +++ b/projects/legacy/components/color-selector/flat-picker/flat-picker.component.ts @@ -31,7 +31,7 @@ export class TuiFlatPickerComponent { constructor() { inject(TuiPickerService) .pipe(takeUntilDestroyed()) - .subscribe(point => { + .subscribe((point) => { this.value = point; this.valueChange.emit([point[0], point[1]]); }); diff --git a/projects/legacy/components/color-selector/services/picker.service.ts b/projects/legacy/components/color-selector/services/picker.service.ts index 17af2659b4dd..95bf59d48917 100644 --- a/projects/legacy/components/color-selector/services/picker.service.ts +++ b/projects/legacy/components/color-selector/services/picker.service.ts @@ -17,7 +17,7 @@ export class TuiPickerService extends Observable { const point$ = tuiTypedFromEvent(nativeElement, 'mousedown').pipe( tuiPreventDefault(), - switchMap(event => { + switchMap((event) => { const mouseMove$ = tuiTypedFromEvent(doc, 'mousemove').pipe( map(({clientX, clientY}) => tuiGetElementPoint(clientX, clientY, nativeElement), @@ -40,6 +40,6 @@ export class TuiPickerService extends Observable { takeUntilDestroyed(), ); - super(subscriber => point$.subscribe(subscriber)); + super((subscriber) => point$.subscribe(subscriber)); } } diff --git a/projects/legacy/components/combo-box/combo-box.component.ts b/projects/legacy/components/combo-box/combo-box.component.ts index ac5e176cb512..870a9370adf4 100644 --- a/projects/legacy/components/combo-box/combo-box.component.ts +++ b/projects/legacy/components/combo-box/combo-box.component.ts @@ -146,7 +146,9 @@ export class TuiComboBoxComponent public onValueChange(value: string): void { this.updateSearch(value); - const match = this.accessor?.getOptions().find(item => this.isStrictMatch(item)); + const match = this.accessor + ?.getOptions() + .find((item) => this.isStrictMatch(item)); if (match !== undefined) { this.value = match; diff --git a/projects/legacy/components/input-copy/input-copy.component.ts b/projects/legacy/components/input-copy/input-copy.component.ts index a80dad6c573a..a5ad155b5bf9 100644 --- a/projects/legacy/components/input-copy/input-copy.component.ts +++ b/projects/legacy/components/input-copy/input-copy.component.ts @@ -87,9 +87,9 @@ export class TuiInputCopyComponent @tuiPure protected get hintText$(): Observable { return this.copyTexts$.pipe( - switchMap(texts => + switchMap((texts) => this.copied$.pipe( - switchMap(copied => { + switchMap((copied) => { if (!copied) { return of(texts[0]); } diff --git a/projects/legacy/components/input-date-multi/input-date-multi.component.ts b/projects/legacy/components/input-date-multi/input-date-multi.component.ts index 90fb56614027..7d2545760ce8 100644 --- a/projects/legacy/components/input-date-multi/input-date-multi.component.ts +++ b/projects/legacy/components/input-date-multi/input-date-multi.component.ts @@ -87,7 +87,7 @@ export class TuiInputDateMultiComponent protected readonly isMobile = inject(TUI_IS_MOBILE); protected readonly doneWord$ = inject(TUI_DONE_WORD); protected readonly filler$: Observable = this.dateTexts$.pipe( - map(dateTexts => + map((dateTexts) => changeDateSeparator( dateTexts[this.dateFormat.mode], this.dateFormat.separator, @@ -97,7 +97,7 @@ export class TuiInputDateMultiComponent protected readonly dateFormat$ = inject(TUI_DATE_FORMAT) .pipe(tuiWatch(this.cdr), takeUntilDestroyed()) - .subscribe(format => { + .subscribe((format) => { this.dateFormat = format; }); @@ -216,13 +216,14 @@ export class TuiInputDateMultiComponent protected readonly disabledItemHandlerWrapper: TuiMapper< [TuiBooleanHandler | TuiBooleanHandler], TuiBooleanHandler | string> - > = handler => stringifiable => + > = (handler) => (stringifiable) => tuiIsString(stringifiable) || handler(stringifiable.item); protected readonly valueMapper: TuiMapper< [readonly TuiDay[]], ReadonlyArray> - > = value => value.map(item => new TuiStringifiableItem(item, item => String(item))); + > = (value) => + value.map((item) => new TuiStringifiableItem(item, (item) => String(item))); protected onEnter(search: string): void { if (!this.tagValidator(search)) { diff --git a/projects/legacy/components/input-date-range/input-date-range.component.ts b/projects/legacy/components/input-date-range/input-date-range.component.ts index a4ecb0455648..88c53d7db0cc 100644 --- a/projects/legacy/components/input-date-range/input-date-range.component.ts +++ b/projects/legacy/components/input-date-range/input-date-range.component.ts @@ -100,7 +100,7 @@ export class TuiInputDateRangeComponent ); protected readonly dateFiller$ = this.dateTexts$.pipe( - map(dateTexts => + map((dateTexts) => changeDateSeparator( dateTexts[this.dateFormat.mode], this.dateFormat.separator, @@ -111,7 +111,7 @@ export class TuiInputDateRangeComponent protected dateFormat = TUI_DEFAULT_DATE_FORMAT; protected readonly dateFormat$ = inject(TUI_DATE_FORMAT) .pipe(tuiWatch(this.cdr), takeUntilDestroyed()) - .subscribe(format => { + .subscribe((format) => { this.dateFormat = format; }); @@ -252,7 +252,7 @@ export class TuiInputDateRangeComponent protected get activePeriod(): TuiDayRangePeriod | null { return ( this.selectedActivePeriod ?? - (this.items.find(item => + (this.items.find((item) => tuiNullableSame( this.value, item.range, @@ -334,7 +334,7 @@ export class TuiInputDateRangeComponent } private get itemSelected(): boolean { - return this.items.findIndex(item => String(item) === this.nativeValue) !== -1; + return this.items.findIndex((item) => String(item) === this.nativeValue) !== -1; } @tuiPure diff --git a/projects/legacy/components/input-date-range/test/input-date-range.component.spec.ts b/projects/legacy/components/input-date-range/test/input-date-range.component.spec.ts index 998c617f0719..562170c35464 100644 --- a/projects/legacy/components/input-date-range/test/input-date-range.component.spec.ts +++ b/projects/legacy/components/input-date-range/test/input-date-range.component.spec.ts @@ -483,8 +483,9 @@ describe('InputDateRangeComponent', () => { return ( pageObject .getAllByAutomationId('tui-calendar-sheet__cell', calendarEl) - .find(el => Number(el.nativeElement.textContent.trim()) === dayNumber) || - null + .find( + (el) => Number(el.nativeElement.textContent.trim()) === dayNumber, + ) || null ); } }); diff --git a/projects/legacy/components/input-date-time/input-date-time.component.ts b/projects/legacy/components/input-date-time/input-date-time.component.ts index f4919f052ee7..ffe1aea8dfc3 100644 --- a/projects/legacy/components/input-date-time/input-date-time.component.ts +++ b/projects/legacy/components/input-date-time/input-date-time.component.ts @@ -87,7 +87,7 @@ export class TuiInputDateTimeComponent protected readonly filler$: Observable = combineLatest([ this.dateTexts$.pipe( - map(dateTexts => + map((dateTexts) => changeDateSeparator( dateTexts[this.dateFormat.mode], this.dateFormat.separator, @@ -106,7 +106,7 @@ export class TuiInputDateTimeComponent protected readonly isMobile = inject(TUI_IS_MOBILE); protected readonly dateFormat$ = inject(TUI_DATE_FORMAT) .pipe(tuiWatch(this.cdr), takeUntilDestroyed()) - .subscribe(format => { + .subscribe((format) => { this.dateFormat = format; }); diff --git a/projects/legacy/components/input-date-time/test/input-date-time.component.spec.ts b/projects/legacy/components/input-date-time/test/input-date-time.component.spec.ts index f786a57ecf5f..8d8d41f047ba 100644 --- a/projects/legacy/components/input-date-time/test/input-date-time.component.spec.ts +++ b/projects/legacy/components/input-date-time/test/input-date-time.component.spec.ts @@ -421,7 +421,7 @@ describe('InputDateTime', () => { testContext.calendarCellAutomationId, ); const cell = cells.find( - debugEl => debugEl.nativeElement.textContent.trim() === `${dayNumber}`, + (debugEl) => debugEl.nativeElement.textContent.trim() === `${dayNumber}`, ); cell?.nativeElement.click(); @@ -448,8 +448,9 @@ describe('InputDateTime', () => { return ( pageObject .getAllByAutomationId(testContext.calendarCellAutomationId) - .find(el => Number(el.nativeElement.textContent.trim()) === dayNumber) || - null + .find( + (el) => Number(el.nativeElement.textContent.trim()) === dayNumber, + ) || null ); } }); diff --git a/projects/legacy/components/input-date/input-date.component.ts b/projects/legacy/components/input-date/input-date.component.ts index 3d3e33562f4e..65a5ccadcfa3 100644 --- a/projects/legacy/components/input-date/input-date.component.ts +++ b/projects/legacy/components/input-date/input-date.component.ts @@ -111,7 +111,7 @@ export class TuiInputDateComponent protected readonly isMobile = inject(TUI_IS_MOBILE); protected readonly type!: TuiContext; protected readonly filler$: Observable = this.dateTexts$.pipe( - map(dateTexts => + map((dateTexts) => changeDateSeparator( dateTexts[this.dateFormat.mode], this.dateFormat.separator, @@ -121,7 +121,7 @@ export class TuiInputDateComponent protected readonly dateFormat$ = inject(TUI_DATE_FORMAT) .pipe(tuiWatch(this.cdr), takeUntilDestroyed()) - .subscribe(format => { + .subscribe((format) => { this.dateFormat = format; }); @@ -227,7 +227,7 @@ export class TuiInputDateComponent protected get activeItem(): TuiNamedDay | null { const {value} = this; - return (value && this.items.find(item => item.day.daySame(value))) || null; + return (value && this.items.find((item) => item.day.daySame(value))) || null; } @HostListener('click') diff --git a/projects/legacy/components/input-date/test/input-date.component.spec.ts b/projects/legacy/components/input-date/test/input-date.component.spec.ts index 072de7fe4b80..a616caa86cd2 100644 --- a/projects/legacy/components/input-date/test/input-date.component.spec.ts +++ b/projects/legacy/components/input-date/test/input-date.component.spec.ts @@ -432,8 +432,9 @@ describe('InputDate', () => { return ( pageObject .getAllByAutomationId('tui-calendar-sheet__cell') - .find(el => Number(el.nativeElement.textContent.trim()) === dayNumber) || - null + .find( + (el) => Number(el.nativeElement.textContent.trim()) === dayNumber, + ) || null ); } }); diff --git a/projects/legacy/components/input-month-range/input-month-range.directive.ts b/projects/legacy/components/input-month-range/input-month-range.directive.ts index 5cd7ade13f08..2efc086fb429 100644 --- a/projects/legacy/components/input-month-range/input-month-range.directive.ts +++ b/projects/legacy/components/input-month-range/input-month-range.directive.ts @@ -39,7 +39,7 @@ export class TuiInputMonthRangeDirective ), takeUntilDestroyed(), ) - .subscribe(localizedValue => { + .subscribe((localizedValue) => { this.localizedValue = localizedValue; }); } diff --git a/projects/legacy/components/input-month/input-month.directive.ts b/projects/legacy/components/input-month/input-month.directive.ts index 283abedc43d8..eeb22e64a982 100644 --- a/projects/legacy/components/input-month/input-month.directive.ts +++ b/projects/legacy/components/input-month/input-month.directive.ts @@ -32,7 +32,7 @@ export class TuiInputMonthDirective switchMap(inject(TUI_MONTH_FORMATTER)), takeUntilDestroyed(), ) - .subscribe(localizedValue => { + .subscribe((localizedValue) => { this.localizedValue = localizedValue; }); } diff --git a/projects/legacy/components/input-number/input-number.component.ts b/projects/legacy/components/input-number/input-number.component.ts index 4d5cf20596e4..1e47f6ee39c5 100644 --- a/projects/legacy/components/input-number/input-number.component.ts +++ b/projects/legacy/components/input-number/input-number.component.ts @@ -87,7 +87,7 @@ export class TuiInputNumberComponent protected readonly controller = inject(TUI_TEXTFIELD_WATCHED_CONTROLLER); protected readonly numberFormat$ = inject(TUI_NUMBER_FORMAT) .pipe(tuiWatch(this.cdr), takeUntilDestroyed()) - .subscribe(format => { + .subscribe((format) => { this.numberFormat = format; }); @@ -344,7 +344,7 @@ export class TuiInputNumberComponent ...options, plugins: [ ...plugins, - maskitoCaretGuard(value => [ + maskitoCaretGuard((value) => [ prefix.length, value.length - postfix.length, ]), diff --git a/projects/legacy/components/input-number/test/input-number.component.spec.ts b/projects/legacy/components/input-number/test/input-number.component.spec.ts index cad5eff9afbf..47eb2f8345c7 100644 --- a/projects/legacy/components/input-number/test/input-number.component.spec.ts +++ b/projects/legacy/components/input-number/test/input-number.component.spec.ts @@ -84,7 +84,7 @@ describe('InputNumber', () => { inputPO = new TuiNativeInputPO(fixture, 'tui-primitive-textfield__native-input'); - document.querySelectorAll('input').forEach(el => { + document.querySelectorAll('input').forEach((el) => { const maxlength = el.getAttribute('maxlength'); const oldSpecification = 52488; // Note: https://bugs.chromium.org/p/chromium/issues/detail?id=450544 diff --git a/projects/legacy/components/input-phone-international/test/input-phone-international.component.spec.ts b/projects/legacy/components/input-phone-international/test/input-phone-international.component.spec.ts index a186c8d276c7..15b6ba87483f 100644 --- a/projects/legacy/components/input-phone-international/test/input-phone-international.component.spec.ts +++ b/projects/legacy/components/input-phone-international/test/input-phone-international.component.spec.ts @@ -115,7 +115,7 @@ describe('InputPhoneInternational', () => { }); describe('should set KZ country code on paste event', () => { - ['+7(600)555-3535', '+7 7272 588300'].forEach(phone => { + ['+7(600)555-3535', '+7 7272 588300'].forEach((phone) => { it(`${phone}`, () => { const data = new DataTransfer(); @@ -239,7 +239,7 @@ describe('InputPhoneInternational', () => { let result: unknown; const phoneNumber = '+380123456789'; - testComponent.control.valueChanges.subscribe(value => { + testComponent.control.valueChanges.subscribe((value) => { result = value; }); @@ -305,7 +305,7 @@ describe('InputPhoneInternational', () => { const countryNameContainers = fixture.debugElement.queryAll(By.css('.t-country-item-name')) || []; - return countryNameContainers.map(container => + return countryNameContainers.map((container) => container.nativeElement.textContent?.trim(), ); } diff --git a/projects/legacy/components/input-phone/utils/create-phone-mask-expression.ts b/projects/legacy/components/input-phone/utils/create-phone-mask-expression.ts index ae9afb0b5cd1..31a24a7eb98d 100644 --- a/projects/legacy/components/input-phone/utils/create-phone-mask-expression.ts +++ b/projects/legacy/components/input-phone/utils/create-phone-mask-expression.ts @@ -14,6 +14,6 @@ export function tuiCreatePhoneMaskExpression( ...phoneMaskAfterCountryCode .replaceAll(/[^#\- ()]+/g, '') .split('') - .map(item => (item === '#' ? /\d/ : item)), + .map((item) => (item === '#' ? /\d/ : item)), ]; } diff --git a/projects/legacy/components/input-tag/input-tag.component.ts b/projects/legacy/components/input-tag/input-tag.component.ts index 403fe2f1ea62..6aba487d56f0 100644 --- a/projects/legacy/components/input-tag/input-tag.component.ts +++ b/projects/legacy/components/input-tag/input-tag.component.ts @@ -223,7 +223,7 @@ export class TuiInputTagComponent ? tag : value .split(this.separator) - .map(tag => tag.trim()) + .map((tag) => tag.trim()) .filter(Boolean), ) .reduce( @@ -397,9 +397,9 @@ export class TuiInputTagComponent protected onInput(value: string): void { const array = value.split(this.separator); const tags = array - .map(item => this.clippedValue(item.trim())) + .map((item) => this.clippedValue(item.trim())) .filter((item, index, {length}) => item.length > 0 && index !== length - 1); - const validated = tags.filter(tag => !this.disabledItemHandler(tag)); + const validated = tags.filter((tag) => !this.disabledItemHandler(tag)); if (array.length > 1) { this.updateSearch(this.clippedValue(array[array.length - 1].trim())); @@ -451,7 +451,7 @@ export class TuiInputTagComponent return value .reverse() .filter( - item => !this.uniqueTags || (item && !seen.has(item) && seen.add(item)), + (item) => !this.uniqueTags || (item && !seen.has(item) && seen.add(item)), ) .reverse(); } diff --git a/projects/legacy/components/input-tag/test/input-tag.component.spec.ts b/projects/legacy/components/input-tag/test/input-tag.component.spec.ts index d660f0c3fb10..d1c1cdefeb36 100644 --- a/projects/legacy/components/input-tag/test/input-tag.component.spec.ts +++ b/projects/legacy/components/input-tag/test/input-tag.component.spec.ts @@ -190,7 +190,7 @@ describe('InputTag', () => { }); it("doesn't add tag on hitting Enter if disabledItemHandler returned false", () => { - component.disabledItemHandler = item => item === 'Tag'; + component.disabledItemHandler = (item) => item === 'Tag'; inputPO.sendText('Tag'); inputPO.sendKeydown('enter'); @@ -284,10 +284,10 @@ describe('InputTag', () => { const secondValidTag = 'second'; const invalidTag = 'invalid'; - component.disabledItemHandler = item => item === invalidTag; + component.disabledItemHandler = (item) => item === invalidTag; inputPO.sendText(`${firstValidTag}, ${invalidTag}, ${secondValidTag}`); - expect(component.value.find(tag => tag === invalidTag)).toBeUndefined(); + expect(component.value.find((tag) => tag === invalidTag)).toBeUndefined(); }); }); diff --git a/projects/legacy/components/input-time/input-time.component.ts b/projects/legacy/components/input-time/input-time.component.ts index 0ecab7a8e58a..b8645dfb6f58 100644 --- a/projects/legacy/components/input-time/input-time.component.ts +++ b/projects/legacy/components/input-time/input-time.component.ts @@ -191,7 +191,7 @@ export class TuiInputTimeComponent @tuiPure protected getFiller$(mode: TuiTimeMode): Observable { - return this.timeTexts$.pipe(map(texts => texts[mode])); + return this.timeTexts$.pipe(map((texts) => texts[mode])); } @HostListener('click') @@ -267,7 +267,7 @@ export class TuiInputTimeComponent mode: TuiTimeMode, search: string, ): readonly TuiTime[] { - return items.filter(item => item.toString(mode).includes(search)); + return items.filter((item) => item.toString(mode).includes(search)); } private findNearestTimeFromItems(value: TuiTime): TuiTime | null { @@ -282,7 +282,7 @@ export class TuiInputTimeComponent } private getMatch(value: string): TuiTime | undefined { - return this.items.find(item => TUI_STRICT_MATCHER(item, value)); + return this.items.find((item) => TUI_STRICT_MATCHER(item, value)); } private close(): void { diff --git a/projects/legacy/components/input-time/native-time/native-time.component.ts b/projects/legacy/components/input-time/native-time/native-time.component.ts index 6af9d190fdb9..f4093c7ec681 100644 --- a/projects/legacy/components/input-time/native-time/native-time.component.ts +++ b/projects/legacy/components/input-time/native-time/native-time.component.ts @@ -36,7 +36,7 @@ export class TuiNativeTimeComponent { protected readonly autoIdString: string = inject(TuiIdService).generate(); protected get items(): string[] { - return this.host.items.map(item => item.toString(this.host.mode)); + return this.host.items.map((item) => item.toString(this.host.mode)); } protected get value(): string { diff --git a/projects/legacy/components/multi-select-option/multi-select-option.component.ts b/projects/legacy/components/multi-select-option/multi-select-option.component.ts index 7c92ed1c739d..fcae1db4ef48 100644 --- a/projects/legacy/components/multi-select-option/multi-select-option.component.ts +++ b/projects/legacy/components/multi-select-option/multi-select-option.component.ts @@ -25,7 +25,7 @@ export class TuiMultiSelectOptionComponent< return ( tuiIsPresent(value) && tuiIsPresent(this.value) && - this.value.some(item => this.matcher(item, value)) + this.value.some((item) => this.matcher(item, value)) ); } } diff --git a/projects/legacy/components/multi-select/hide-selected.pipe.ts b/projects/legacy/components/multi-select/hide-selected.pipe.ts index b855a2821612..37d9ba793663 100644 --- a/projects/legacy/components/multi-select/hide-selected.pipe.ts +++ b/projects/legacy/components/multi-select/hide-selected.pipe.ts @@ -37,7 +37,7 @@ export class TuiHideSelectedPipe implements PipeTransform { value: readonly T[], matcher: TuiIdentityMatcher, ): ReadonlyArray { - return items.map(subItems => this.filter(subItems, value, matcher)); + return items.map((subItems) => this.filter(subItems, value, matcher)); } @tuiPure @@ -46,6 +46,8 @@ export class TuiHideSelectedPipe implements PipeTransform { value: readonly T[], matcher: TuiIdentityMatcher, ): readonly T[] { - return items.filter(item => value.every(selected => !matcher(selected, item))); + return items.filter((item) => + value.every((selected) => !matcher(selected, item)), + ); } } diff --git a/projects/legacy/components/multi-select/multi-select-group/multi-select-group.component.ts b/projects/legacy/components/multi-select/multi-select-group/multi-select-group.component.ts index fc2d2eb8aa0f..de593a194575 100644 --- a/projects/legacy/components/multi-select/multi-select-group/multi-select-group.component.ts +++ b/projects/legacy/components/multi-select/multi-select-group/multi-select-group.component.ts @@ -49,7 +49,7 @@ export class TuiMultiSelectGroupComponent { @tuiPure protected get disabled$(): Observable { return tuiQueryListChanges(this.options).pipe( - map(items => items.every(({disabled}) => disabled)), + map((items) => items.every(({disabled}) => disabled)), ); } @@ -60,7 +60,7 @@ export class TuiMultiSelectGroupComponent { let result = false; for (let i = 0; i < items.length; i++) { - const selected = current.some(selected => + const selected = current.some((selected) => this.matcher(selected, items[i]), ); @@ -83,8 +83,8 @@ export class TuiMultiSelectGroupComponent { const controlValue: readonly T[] = this.control.value || []; const {values} = this; - const filtered = controlValue.filter(current => - values.every(item => !this.matcher(current, item)), + const filtered = controlValue.filter((current) => + values.every((item) => !this.matcher(current, item)), ); this.control.control.setValue(checked ? filtered : [...filtered, ...values]); @@ -93,14 +93,14 @@ export class TuiMultiSelectGroupComponent { @tuiPure private get items$(): Observable { return tuiQueryListChanges(this.options).pipe( - map(options => options.map(({value}) => value).filter(tuiIsPresent)), + map((options) => options.map(({value}) => value).filter(tuiIsPresent)), ); } @tuiPure private get valueChanges$(): Observable { return tuiControlValue(this.control).pipe( - map(value => value || []), + map((value) => value || []), ); } diff --git a/projects/legacy/components/multi-select/multi-select-group/multi-select-group.directive.ts b/projects/legacy/components/multi-select/multi-select-group/multi-select-group.directive.ts index ce7ae432ec73..4575259c2353 100644 --- a/projects/legacy/components/multi-select/multi-select-group/multi-select-group.directive.ts +++ b/projects/legacy/components/multi-select/multi-select-group/multi-select-group.directive.ts @@ -31,7 +31,7 @@ export const TUI_MULTI_SELECT_OPTION = new PolymorpheusComponent( host: TuiDataListHost | null, ): TuiDataListHost => host || { - handleOption: option => + handleOption: (option) => control.control?.setValue( tuiArrayToggle(control.value || [], option), ), diff --git a/projects/legacy/components/multi-select/multi-select.component.ts b/projects/legacy/components/multi-select/multi-select.component.ts index be2781c4acf2..f6551c0630ca 100644 --- a/projects/legacy/components/multi-select/multi-select.component.ts +++ b/projects/legacy/components/multi-select/multi-select.component.ts @@ -165,7 +165,7 @@ export class TuiMultiSelectComponent public handleOption(option: T): void { const {value, identityMatcher} = this; - const index = value.findIndex(item => identityMatcher(item, option)); + const index = value.findIndex((item) => identityMatcher(item, option)); this.value = index === -1 ? [...value, option] : value.filter((_, i) => i !== index); @@ -216,12 +216,12 @@ export class TuiMultiSelectComponent > = (value, stringify, group) => group ? EMPTY_ARRAY - : value.map(item => new TuiStringifiableItem(item, stringify)); + : value.map((item) => new TuiStringifiableItem(item, stringify)); protected readonly disabledItemHandlerWrapper: TuiMapper< [TuiBooleanHandler], TuiBooleanHandler | string> - > = handler => stringifiable => + > = (handler) => (stringifiable) => tuiIsString(stringifiable) || handler(stringifiable.item); protected onSpace(event: Event): void { diff --git a/projects/legacy/components/multi-select/multi-select.directive.ts b/projects/legacy/components/multi-select/multi-select.directive.ts index ffb37e65aadc..57eb35aa33d9 100644 --- a/projects/legacy/components/multi-select/multi-select.directive.ts +++ b/projects/legacy/components/multi-select/multi-select.directive.ts @@ -24,7 +24,7 @@ export class TuiMultiSelectDirective extends AbstractTuiTextfieldHos return this.host.stringify; } - public disableItemHandler: TuiBooleanHandler = item => + public disableItemHandler: TuiBooleanHandler = (item) => this.host.disabledItemHandler(item); public onValueChange(): void {} diff --git a/projects/legacy/components/multi-select/native-multi-select/native-multi-select-group.component.ts b/projects/legacy/components/multi-select/native-multi-select/native-multi-select-group.component.ts index f1f590ef0aef..5f4733b27890 100644 --- a/projects/legacy/components/multi-select/native-multi-select/native-multi-select-group.component.ts +++ b/projects/legacy/components/multi-select/native-multi-select/native-multi-select-group.component.ts @@ -38,7 +38,7 @@ export class TuiNativeMultiSelectGroupComponent< public labels: readonly string[] = []; protected onValueChange(selectedOptions: HTMLSelectElement['selectedOptions']): void { - const selected = Array.from(selectedOptions).map(option => option.index); + const selected = Array.from(selectedOptions).map((option) => option.index); const flatItems = this.items?.reduce((acc, val) => acc.concat(val), []) || []; const value = flatItems.filter((_, index) => selected.includes(index)); diff --git a/projects/legacy/components/multi-select/native-multi-select/native-multi-select.component.ts b/projects/legacy/components/multi-select/native-multi-select/native-multi-select.component.ts index 7d793eac44c6..b093025d1bae 100644 --- a/projects/legacy/components/multi-select/native-multi-select/native-multi-select.component.ts +++ b/projects/legacy/components/multi-select/native-multi-select/native-multi-select.component.ts @@ -32,7 +32,7 @@ export class TuiNativeMultiSelectComponent extends AbstractTuiNativeMultiSele public items: readonly T[] | null = []; protected onValueChange(selectedOptions: HTMLSelectElement['selectedOptions']): void { - const selected = Array.from(selectedOptions).map(option => option.index); + const selected = Array.from(selectedOptions).map((option) => option.index); const value = this.items?.filter((_, index) => selected.includes(index)) || []; this.host.onSelectionChange(value); diff --git a/projects/legacy/components/sheet/components/sheet-bar/sheet-bar.component.ts b/projects/legacy/components/sheet/components/sheet-bar/sheet-bar.component.ts index 3abbfd8d5d7d..08d9466d0e2a 100644 --- a/projects/legacy/components/sheet/components/sheet-bar/sheet-bar.component.ts +++ b/projects/legacy/components/sheet/components/sheet-bar/sheet-bar.component.ts @@ -17,7 +17,7 @@ export class TuiSheetBarComponent { private readonly zone = inject(NgZone); protected readonly rotate$ = this.scroll$.pipe( - map(y => tuiClamp(10 - (y - this.stop) / 5, 0, 10)), + map((y) => tuiClamp(10 - (y - this.stop) / 5, 0, 10)), distinctUntilChanged(), tuiZonefull(this.zone), ); diff --git a/projects/legacy/components/sheet/components/sheet/sheet.component.ts b/projects/legacy/components/sheet/components/sheet/sheet.component.ts index 0b7d3ed99bdb..0bb5932e0109 100644 --- a/projects/legacy/components/sheet/components/sheet/sheet.component.ts +++ b/projects/legacy/components/sheet/components/sheet/sheet.component.ts @@ -57,12 +57,12 @@ export class TuiSheetComponent implements TuiSheetRequiredProps, AfterView protected readonly isIos = inject(TUI_IS_IOS); protected readonly moreWord$ = inject(TUI_MORE_WORD); protected readonly stuck$ = this.scroll$.pipe( - map(y => Math.floor(y) > this.contentTop), + map((y) => Math.floor(y) > this.contentTop), ); protected readonly stuck$$ = this.stuck$ .pipe(takeUntilDestroyed()) - .subscribe(add => + .subscribe((add) => add ? this.el.classList.add('_stuck') : this.el.classList.remove('_stuck'), ); diff --git a/projects/legacy/components/sheet/components/sheets-host/sheets-host.component.ts b/projects/legacy/components/sheet/components/sheets-host/sheets-host.component.ts index a1014f0d6125..2b581349d105 100644 --- a/projects/legacy/components/sheet/components/sheets-host/sheets-host.component.ts +++ b/projects/legacy/components/sheet/components/sheets-host/sheets-host.component.ts @@ -38,7 +38,7 @@ export class TuiSheetsHostComponent implements OnInit { // can happen after view was checked, so calling `detectChanges` instead this.service.sheets$ .pipe(takeUntilDestroyed(this.destroyRef)) - .subscribe(sheets => { + .subscribe((sheets) => { this.sheets = sheets; this.cdr.detectChanges(); }); diff --git a/projects/legacy/components/sheet/directives/sheet-close/sheet-close.directive.ts b/projects/legacy/components/sheet/directives/sheet-close/sheet-close.directive.ts index 1b50faaa115f..4be467b51d3a 100644 --- a/projects/legacy/components/sheet/directives/sheet-close/sheet-close.directive.ts +++ b/projects/legacy/components/sheet/directives/sheet-close/sheet-close.directive.ts @@ -26,7 +26,7 @@ export class TuiSheetCloseDirective { tuiTypedFromEvent(this.el, TUI_SHEET_CLOSE), this.dragged$.pipe( tuiIfMap(() => this.scroll$.pipe(startWith(this.el.scrollTop)), tuiIsFalsy), - filter(y => this.sheet.item?.closeable && this.shouldClose(y)), + filter((y) => this.sheet.item?.closeable && this.shouldClose(y)), distinctUntilChanged(), tuiZonefull(this.zone), ), diff --git a/projects/legacy/components/sheet/directives/sheet-stop/sheet-stop.directive.ts b/projects/legacy/components/sheet/directives/sheet-stop/sheet-stop.directive.ts index 32a714f9dd67..03af22a192c5 100644 --- a/projects/legacy/components/sheet/directives/sheet-stop/sheet-stop.directive.ts +++ b/projects/legacy/components/sheet/directives/sheet-stop/sheet-stop.directive.ts @@ -24,7 +24,7 @@ export class TuiSheetStopDirective { inject(TUI_SHEET_SCROLL) .pipe( - map(y => Math.floor(y) > el.offsetTop), + map((y) => Math.floor(y) > el.offsetTop), distinctUntilChanged(), withLatestFrom(inject(TUI_SHEET_DRAGGED)), map(([above, dragged]) => !above && !dragged), diff --git a/projects/legacy/components/sheet/directives/sheet-top/sheet-top.directive.ts b/projects/legacy/components/sheet/directives/sheet-top/sheet-top.directive.ts index 44a538ceee28..1519ee3ea0c2 100644 --- a/projects/legacy/components/sheet/directives/sheet-top/sheet-top.directive.ts +++ b/projects/legacy/components/sheet/directives/sheet-top/sheet-top.directive.ts @@ -20,9 +20,9 @@ export class TuiSheetTopDirective { private readonly el = tuiInjectElement(); protected readonly rounded$ = this.scroll$ - .pipe(map(y => y < this.stop + OFFSET)) + .pipe(map((y) => y < this.stop + OFFSET)) .pipe(takeUntilDestroyed()) - .subscribe(add => + .subscribe((add) => add ? this.el.classList.add('_rounded') : this.el.classList.remove('_rounded'), @@ -30,17 +30,17 @@ export class TuiSheetTopDirective { protected readonly transform$ = this.scroll$ .pipe( - map(y => `translateY(${this.getY(y)}%) scaleX(-1)`), + map((y) => `translateY(${this.getY(y)}%) scaleX(-1)`), takeUntilDestroyed(), ) - .subscribe(transform => this.el.style.setProperty('transform', transform)); + .subscribe((transform) => this.el.style.setProperty('transform', transform)); protected readonly clickthrough$ = this.scroll$ .pipe( - map(y => !!Math.round(this.getY(y))), + map((y) => !!Math.round(this.getY(y))), takeUntilDestroyed(), ) - .subscribe(add => + .subscribe((add) => add ? this.el.classList.add('_clickthrough') : this.el.classList.remove('_clickthrough'), diff --git a/projects/legacy/components/sheet/directives/sheet-wrapper/sheet-wrapper.directive.ts b/projects/legacy/components/sheet/directives/sheet-wrapper/sheet-wrapper.directive.ts index 18510154c840..26b9c797a6a1 100644 --- a/projects/legacy/components/sheet/directives/sheet-wrapper/sheet-wrapper.directive.ts +++ b/projects/legacy/components/sheet/directives/sheet-wrapper/sheet-wrapper.directive.ts @@ -69,7 +69,7 @@ export class TuiSheetWrapperDirective { @tuiPure public get overlay$(): Observable { return this.scroll$.pipe( - map(y => y + 16 > this.win.innerHeight - this.tuiSheetWrapper), + map((y) => y + 16 > this.win.innerHeight - this.tuiSheetWrapper), distinctUntilChanged(), tuiZonefull(this.zone), ); diff --git a/projects/legacy/components/sheet/sheet.service.ts b/projects/legacy/components/sheet/sheet.service.ts index 15a5c01a35f1..3135e0270766 100644 --- a/projects/legacy/components/sheet/sheet.service.ts +++ b/projects/legacy/components/sheet/sheet.service.ts @@ -24,7 +24,7 @@ export class TuiSheetService { content: PolymorpheusContent>, options: Partial = {}, ): Observable { - return new Observable($implicit => { + return new Observable(($implicit) => { const completeWith = (result: G): void => { $implicit.next(result); $implicit.complete(); @@ -46,7 +46,7 @@ export class TuiSheetService { this.sheets$.next([...this.sheets$.value, sheet]); return () => { - this.sheets$.next(this.sheets$.value.filter(item => item !== sheet)); + this.sheets$.next(this.sheets$.value.filter((item) => item !== sheet)); }; }); } diff --git a/projects/legacy/components/svg/content-processor.ts b/projects/legacy/components/svg/content-processor.ts index 3efd39902438..f0714522e0f5 100644 --- a/projects/legacy/components/svg/content-processor.ts +++ b/projects/legacy/components/svg/content-processor.ts @@ -6,7 +6,7 @@ function makeRandomSalt(): number { } function extractLinearGradientIdsFromSvg(svg: string): string[] { - const ids = (svg.match(/url\(("?)('*)#(.*?)('*)\)/g) ?? []).map(url => + const ids = (svg.match(/url\(("?)('*)#(.*?)('*)\)/g) ?? []).map((url) => url.slice(4, url.length - 1).replaceAll(/['"#]+/g, ''), ); diff --git a/projects/legacy/components/svg/svg-options.ts b/projects/legacy/components/svg/svg-options.ts index c4e12df18519..477a54ae8939 100644 --- a/projects/legacy/components/svg/svg-options.ts +++ b/projects/legacy/components/svg/svg-options.ts @@ -39,7 +39,7 @@ export const TUI_SVG_DEFAULT_OPTIONS: TuiSvgOptions = { path: tuiIconsPathFactory(TUI_DEFAULT_ICONS_PLACE), srcProcessor: identity, contentProcessor: tuiSvgLinearGradientProcessor, - deprecated: src => { + deprecated: (src) => { const oldIcon = src.replace('Large', '').replace('Outline', ''); const newIcon = TUI_DEPRECATED_ICONS[oldIcon]; @@ -86,7 +86,7 @@ export const tuiSvgOptionsProvider: ( options: Partial> & { path?: TuiSvgOptions['path'] | string; }, -) => FactoryProvider = options => ({ +) => FactoryProvider = (options) => ({ provide: TUI_SVG_OPTIONS, deps: [[new SkipSelf(), new Optional(), TUI_SVG_OPTIONS]], useFactory: (fallback: TuiSvgOptions | null): TuiSvgOptions => ({ diff --git a/projects/legacy/components/svg/svg.component.ts b/projects/legacy/components/svg/svg.component.ts index fe0da6627b5c..3b4b76f68483 100644 --- a/projects/legacy/components/svg/svg.component.ts +++ b/projects/legacy/components/svg/svg.component.ts @@ -210,7 +210,7 @@ export class TuiSvgComponent { return of(''); }), - map(response => + map((response) => this.sanitize(response.replace('): void { const {value} = this.items$; - Object.keys(icons).forEach(key => { + Object.keys(icons).forEach((key) => { this.defineIcon(key, icons[key], value); }); diff --git a/projects/legacy/directives/legacy-dropdown-open-monitor/legacy-dropdown-open-monitor.ts b/projects/legacy/directives/legacy-dropdown-open-monitor/legacy-dropdown-open-monitor.ts index 7a4886a56f8c..339ca3282987 100644 --- a/projects/legacy/directives/legacy-dropdown-open-monitor/legacy-dropdown-open-monitor.ts +++ b/projects/legacy/directives/legacy-dropdown-open-monitor/legacy-dropdown-open-monitor.ts @@ -27,7 +27,7 @@ export class TuiLegacyDropdownOpenMonitorDirective { ), takeUntilDestroyed(), ) - .subscribe(value => { + .subscribe((value) => { if (value) { tuiGetClosestFocusable({ initial: this.el, diff --git a/projects/legacy/pipes/to-country-code/to-country-code.pipe.ts b/projects/legacy/pipes/to-country-code/to-country-code.pipe.ts index 23c81c77976b..c9c8a9b32c20 100644 --- a/projects/legacy/pipes/to-country-code/to-country-code.pipe.ts +++ b/projects/legacy/pipes/to-country-code/to-country-code.pipe.ts @@ -49,7 +49,7 @@ export class TuiToCountryCodePipe implements PipeTransform { value: string, countries: readonly TuiCountryIsoCode[], ): TuiCountryIsoCode | undefined { - return countries.find(countryIsoCode => { + return countries.find((countryIsoCode) => { const ruCodeTest = countryIsoCode === 'RU' && /^[78]/.test(value) && diff --git a/projects/legacy/tokens/month-formatter.ts b/projects/legacy/tokens/month-formatter.ts index 72a68163b46f..df31164276dd 100644 --- a/projects/legacy/tokens/month-formatter.ts +++ b/projects/legacy/tokens/month-formatter.ts @@ -19,10 +19,10 @@ export const TUI_MONTH_FORMATTER_PROVIDER: FactoryProvider = { deps: [TuiMonthPipe], useFactory: (pipe: TuiMonthPipe): TuiHandler> => - month => + (month) => month ? pipe .transform(month) - .pipe(map(formatted => `${formatted} ${month.formattedYear}`)) + .pipe(map((formatted) => `${formatted} ${month.formattedYear}`)) : of(''), }; diff --git a/projects/legacy/utils/icons-path-factory.ts b/projects/legacy/utils/icons-path-factory.ts index ed6dc5af4567..e4695ca45eaf 100644 --- a/projects/legacy/utils/icons-path-factory.ts +++ b/projects/legacy/utils/icons-path-factory.ts @@ -9,7 +9,7 @@ export const TUI_CACHE_BUSTING_PAYLOAD = `?v=${TUI_VERSION}` as const; /** * @deprecated: drop in v5.0 */ -export const DEFAULT_ICONS_PATH: TuiStringHandler = name => +export const DEFAULT_ICONS_PATH: TuiStringHandler = (name) => name.includes('.svg#') ? name : `#${name}`; /** @@ -18,7 +18,7 @@ export const DEFAULT_ICONS_PATH: TuiStringHandler = name => export function tuiIconsPathFactory(staticPath: string): TuiStringHandler { const base = staticPath.endsWith('/') ? staticPath : `${staticPath}/`; - return name => { + return (name) => { if (name.startsWith('tuiIcon')) { return `${base}${name}.svg${TUI_CACHE_BUSTING_PAYLOAD}#${name}`; } diff --git a/projects/testing/setup-jest/index.ts b/projects/testing/setup-jest/index.ts index e5c4f06b7cc9..0024531f6dfb 100644 --- a/projects/testing/setup-jest/index.ts +++ b/projects/testing/setup-jest/index.ts @@ -21,13 +21,13 @@ const resizeEvent = document.createEvent('Event'); resizeEvent.initEvent('resize', true, true); -global.window.resizeTo = width => { +global.window.resizeTo = (width) => { (global.window as any).innerWidth = width || global.window.innerWidth; (global.window as any).innerHeight = width || global.window.innerHeight; global.window.dispatchEvent(resizeEvent); }; -global.URL.createObjectURL = jest.fn(blob => `${blob}`); +global.URL.createObjectURL = jest.fn((blob) => `${blob}`); global.URL.revokeObjectURL = jest.fn(); Object.defineProperty(global.window, 'CSS', {value: null}); @@ -52,7 +52,7 @@ Object.defineProperty(global.document.body.style, 'transform', { Object.defineProperty(global.window, 'matchMedia', { writable: true, - value: jest.fn().mockImplementation(query => ({ + value: jest.fn().mockImplementation((query) => ({ matches: false, media: query, onchange: null, diff --git a/projects/testing/utils/page-object.ts b/projects/testing/utils/page-object.ts index 1433afb27e6a..3c8f3b496203 100644 --- a/projects/testing/utils/page-object.ts +++ b/projects/testing/utils/page-object.ts @@ -15,7 +15,7 @@ export class TuiPageObject { } private static byAutomationId(automationId: string): Predicate { - return debugElement => TuiPageObject.containsId(debugElement, automationId); + return (debugElement) => TuiPageObject.containsId(debugElement, automationId); } public getByAutomationId( diff --git a/scripts/combine-playwright-failed-screenshots.ts b/scripts/combine-playwright-failed-screenshots.ts index aac49af0043d..12f58d0e20d5 100644 --- a/scripts/combine-playwright-failed-screenshots.ts +++ b/scripts/combine-playwright-failed-screenshots.ts @@ -21,15 +21,15 @@ console.info('canvas:', version); }); for (const {name} of filesOrDirs.filter( - x => x.isDirectory() && !x.name.match(/-retry\d$/), + (x) => x.isDirectory() && !x.name.match(/-retry\d$/), )) { await combinePlaywrightFailedScreenshots(`${rootPath}/${name}`); } const imagesPaths: string[] = filesOrDirs - .filter(x => x.isFile() && x.name.endsWith('.png')) + .filter((x) => x.isFile() && x.name.endsWith('.png')) .map(({name}) => `${rootPath}/${name}`); - const diffImage = imagesPaths.find(path => path.endsWith(DIFF_IMAGE_POSTFIX)); + const diffImage = imagesPaths.find((path) => path.endsWith(DIFF_IMAGE_POSTFIX)); if (!diffImage) { return; @@ -45,7 +45,7 @@ console.info('canvas:', version); images .reverse() // After <= Diff => Before - .forEach(image => { + .forEach((image) => { ctx.drawImage(image, prevWidth, 0); prevWidth += image.width; }); diff --git a/scripts/generate-demo-routes-file.ts b/scripts/generate-demo-routes-file.ts index 07a04770290c..6b16c1efff5f 100644 --- a/scripts/generate-demo-routes-file.ts +++ b/scripts/generate-demo-routes-file.ts @@ -50,9 +50,9 @@ const EXCEPTIONS = [ demoRoutesFileContent .match(/['"`](.*)['"`]/g) // @ts-ignore Try changing the lib compiler option to es2021 or later - ?.map(route => route.replaceAll(/['"`]/g, '')) || []; + ?.map((route) => route.replaceAll(/['"`]/g, '')) || []; - routes.forEach(route => { + routes.forEach((route) => { if ( /** * Temporarily workaround! @@ -78,7 +78,7 @@ const EXCEPTIONS = [ titleLog('Generated routes:'); [...routes] .sort((a, b) => a.localeCompare(b)) - .forEach(route => infoLog(`${SMALL_TAB_SYMBOL}* ${route}`)); + .forEach((route) => infoLog(`${SMALL_TAB_SYMBOL}* ${route}`)); writeFileSync( join(process.cwd(), 'projects', 'demo', 'routes.txt'), diff --git a/scripts/generate-used-icons.ts b/scripts/generate-used-icons.ts index c9cb35c6cf0e..513fb583fc5e 100644 --- a/scripts/generate-used-icons.ts +++ b/scripts/generate-used-icons.ts @@ -103,7 +103,7 @@ function findTuiIconNames( ); if (tuiIconMatches) { - tuiIconMatches.forEach(match => { + tuiIconMatches.forEach((match) => { if (!excludedNames.includes(match)) { tuiIconNames.add(match); } diff --git a/scripts/shared/argv.utils.ts b/scripts/shared/argv.utils.ts index 55205a78d0f3..d3f4735e34e5 100644 --- a/scripts/shared/argv.utils.ts +++ b/scripts/shared/argv.utils.ts @@ -26,7 +26,7 @@ export function hasFlag(flag: string): boolean { } export function findIndexFlag(flag: string): number { - return process.argv.findIndex(arg => arg === flag || arg.split('=')[0] === flag); + return process.argv.findIndex((arg) => arg === flag || arg.split('=')[0] === flag); } export function stringifier(value?: string): string | undefined { diff --git a/scripts/shared/bump-tui-deps.ts b/scripts/shared/bump-tui-deps.ts index 4539e80f91d8..840f0c11c883 100644 --- a/scripts/shared/bump-tui-deps.ts +++ b/scripts/shared/bump-tui-deps.ts @@ -17,8 +17,8 @@ export function bumpTuiDeps({ ignores, }: TuiBumpDepsOptions): void { Object.keys(deps) - .filter(key => isTuiPackageName(key, ignores)) - .forEach(key => { + .filter((key) => isTuiPackageName(key, ignores)) + .forEach((key) => { if (tuiIsString(deps[key])) { deps[key] = isPeerDependency ? (deps[key] as string)?.replace(prevVersion, newVersion) diff --git a/scripts/shared/check-changelog-before-push.ts b/scripts/shared/check-changelog-before-push.ts index b332fe8b748e..560f18fb328d 100644 --- a/scripts/shared/check-changelog-before-push.ts +++ b/scripts/shared/check-changelog-before-push.ts @@ -13,7 +13,7 @@ export async function checkChangelogBeforePush(): Promise { return new Promise((resolve: (value?: PromiseLike | string) => void) => { let response: string; - readline.on('line', userInput => { + readline.on('line', (userInput) => { response = userInput; readline.close(); }); diff --git a/scripts/shared/get-last-major-version.ts b/scripts/shared/get-last-major-version.ts index 6058659b868c..c8dee07230e0 100644 --- a/scripts/shared/get-last-major-version.ts +++ b/scripts/shared/get-last-major-version.ts @@ -1,3 +1,3 @@ export function getLastMajorVersion(versions: string[], currentMajor: number): number { - return Math.max(...versions.map(x => parseInt(x, 10)), currentMajor); + return Math.max(...versions.map((x) => parseInt(x, 10)), currentMajor); } diff --git a/scripts/shared/parse-version.ts b/scripts/shared/parse-version.ts index af7688c31ad5..7cdadca27d3d 100644 --- a/scripts/shared/parse-version.ts +++ b/scripts/shared/parse-version.ts @@ -8,7 +8,7 @@ interface ParsedVersion { export function parseVersion(version: string): ParsedVersion { const [major, minor, patch, , rc = -1] = version .split(/[.-]/) - .map(value => Number(value)); + .map((value) => Number(value)); return {major, minor, patch, rc}; } diff --git a/scripts/shared/sync-versions.ts b/scripts/shared/sync-versions.ts index 63b575b6efe1..b08efe7c9359 100644 --- a/scripts/shared/sync-versions.ts +++ b/scripts/shared/sync-versions.ts @@ -12,16 +12,16 @@ export function syncVersions( newVersion: string, ignores: readonly string[] = [], ): void { - const patterns = filesOrDirectories.map(pattern => + const patterns = filesOrDirectories.map((pattern) => pattern.endsWith('.json') ? pattern : `${pattern}/**/*(package.json|package-lock.json)`, ); const files = patterns - .map(pattern => glob.sync(pattern, {ignore: '**/node_modules/**'})) - .flatMap(files => files) - .filter(file => !file.includes('node_modules')); + .map((pattern) => glob.sync(pattern, {ignore: '**/node_modules/**'})) + .flatMap((files) => files) + .filter((file) => !file.includes('node_modules')); for (const file of files) { const originalJSON = JSON.stringify(