From 1244b314b918c24ca1fc5db840c48d27a4f03ce1 Mon Sep 17 00:00:00 2001 From: Konstantin Dinev Date: Thu, 15 Feb 2024 14:25:03 +0200 Subject: [PATCH 1/5] refactor(text-highlight): abstracting service from directive --- .../text-highlight.directive.ts | 34 ++++--------------- .../text-highlight/text-highlight.service.ts | 32 +++++++++++++++++ .../src/lib/grids/grid-base.directive.ts | 9 ++--- .../hierarchical-grid-base.directive.ts | 3 ++ .../hierarchical-grid/row-island.component.ts | 3 ++ .../grids/pivot-grid/pivot-grid.component.ts | 3 ++ .../grids/tree-grid/tree-grid.component.ts | 4 ++- .../src/lib/services/public_api.ts | 1 + 8 files changed, 56 insertions(+), 33 deletions(-) create mode 100644 projects/igniteui-angular/src/lib/directives/text-highlight/text-highlight.service.ts diff --git a/projects/igniteui-angular/src/lib/directives/text-highlight/text-highlight.directive.ts b/projects/igniteui-angular/src/lib/directives/text-highlight/text-highlight.directive.ts index 4ee57368e73..23f5fcbf8b8 100644 --- a/projects/igniteui-angular/src/lib/directives/text-highlight/text-highlight.directive.ts +++ b/projects/igniteui-angular/src/lib/directives/text-highlight/text-highlight.directive.ts @@ -2,7 +2,6 @@ import { AfterViewInit, Directive, ElementRef, - EventEmitter, Input, OnChanges, OnDestroy, @@ -13,6 +12,7 @@ import { import { takeUntil } from 'rxjs/operators'; import { Subject } from 'rxjs'; import { compareMaps } from '../../core/utils'; +import { IgxTextHighlightService } from './text-highlight.service'; export interface IBaseSearchInfo { searchText: string; @@ -49,9 +49,6 @@ export interface IActiveHighlightInfo { standalone: true }) export class IgxTextHighlightDirective implements AfterViewInit, AfterViewChecked, OnDestroy, OnChanges { - public static highlightGroupsMap = new Map(); - private static onActiveElementChanged = new EventEmitter(); - /** * Determines the `CSS` class of the highlight elements. * This allows the developer to provide custom `CSS` to customize the highlight. @@ -202,8 +199,8 @@ export class IgxTextHighlightDirective implements AfterViewInit, AfterViewChecke private _defaultCssClass = 'igx-highlight'; private _defaultActiveCssClass = 'igx-highlight--active'; - constructor(private element: ElementRef, public renderer: Renderer2) { - IgxTextHighlightDirective.onActiveElementChanged.pipe(takeUntil(this.destroy$)).subscribe((groupName) => { + constructor(private element: ElementRef, private service: IgxTextHighlightService, private renderer: Renderer2) { + this.service.onActiveElementChanged.pipe(takeUntil(this.destroy$)).subscribe((groupName) => { if (this.groupName === groupName) { if (this._activeElementIndex !== -1) { this.deactivate(); @@ -213,25 +210,6 @@ export class IgxTextHighlightDirective implements AfterViewInit, AfterViewChecke }); } - /** - * Activates the highlight at a given index. - * (if such index exists) - */ - public static setActiveHighlight(groupName: string, highlight: IActiveHighlightInfo) { - IgxTextHighlightDirective.highlightGroupsMap.set(groupName, highlight); - IgxTextHighlightDirective.onActiveElementChanged.emit(groupName); - } - - /** - * Clears any existing highlight. - */ - public static clearActiveHighlight(groupName) { - IgxTextHighlightDirective.highlightGroupsMap.set(groupName, { - index: -1 - }); - IgxTextHighlightDirective.onActiveElementChanged.emit(groupName); - } - /** * @hidden */ @@ -267,8 +245,8 @@ export class IgxTextHighlightDirective implements AfterViewInit, AfterViewChecke public ngAfterViewInit() { this.parentElement = this.renderer.parentNode(this.element.nativeElement); - if (IgxTextHighlightDirective.highlightGroupsMap.has(this.groupName) === false) { - IgxTextHighlightDirective.highlightGroupsMap.set(this.groupName, { + if (this.service.highlightGroupsMap.has(this.groupName) === false) { + this.service.highlightGroupsMap.set(this.groupName, { index: -1 }); } @@ -338,7 +316,7 @@ export class IgxTextHighlightDirective implements AfterViewInit, AfterViewChecke * Activates the highlight if it is on the currently active row and column. */ public activateIfNecessary(): void { - const group = IgxTextHighlightDirective.highlightGroupsMap.get(this.groupName); + const group = this.service.highlightGroupsMap.get(this.groupName); if (group.index >= 0 && group.column === this.column && group.row === this.row && compareMaps(this.metadata, group.metadata)) { this.activate(group.index); diff --git a/projects/igniteui-angular/src/lib/directives/text-highlight/text-highlight.service.ts b/projects/igniteui-angular/src/lib/directives/text-highlight/text-highlight.service.ts new file mode 100644 index 00000000000..fe1f148e41d --- /dev/null +++ b/projects/igniteui-angular/src/lib/directives/text-highlight/text-highlight.service.ts @@ -0,0 +1,32 @@ +import { EventEmitter, Injectable } from '@angular/core'; +import { IActiveHighlightInfo } from './text-highlight.directive'; + +@Injectable({ + providedIn: 'root' +}) +export class IgxTextHighlightService { + public highlightGroupsMap = new Map(); + public onActiveElementChanged = new EventEmitter(); + + constructor() { } + + /** + * Activates the highlight at a given index. + * (if such index exists) + */ + public setActiveHighlight(groupName: string, highlight: IActiveHighlightInfo) { + this.highlightGroupsMap.set(groupName, highlight); + this.onActiveElementChanged.emit(groupName); + } + + /** + * Clears any existing highlight. + */ + public clearActiveHighlight(groupName) { + this.highlightGroupsMap.set(groupName, { + index: -1 + }); + this.onActiveElementChanged.emit(groupName); + } + +} diff --git a/projects/igniteui-angular/src/lib/grids/grid-base.directive.ts b/projects/igniteui-angular/src/lib/grids/grid-base.directive.ts index 5118ce6342e..295b172b197 100644 --- a/projects/igniteui-angular/src/lib/grids/grid-base.directive.ts +++ b/projects/igniteui-angular/src/lib/grids/grid-base.directive.ts @@ -40,7 +40,7 @@ import { GridColumnDataType } from '../data-operations/data-util'; import { FilteringLogic, IFilteringExpression } from '../data-operations/filtering-expression.interface'; import { IGroupByRecord } from '../data-operations/groupby-record.interface'; import { IForOfDataChangingEventArgs, IgxGridForOfDirective } from '../directives/for-of/for_of.directive'; -import { IgxTextHighlightDirective } from '../directives/text-highlight/text-highlight.directive'; +import { IgxTextHighlightService } from '../directives/text-highlight/text-highlight.service'; import { ISummaryExpression } from './summaries/grid-summary'; import { RowEditPositionStrategy } from './grid.common'; import type { IgxGridToolbarComponent } from './toolbar/grid-toolbar.component'; @@ -3306,6 +3306,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements public navigation: IgxGridNavigationService, /** @hidden @internal */ public filteringService: IgxFilteringService, + protected textHighlightService: IgxTextHighlightService, @Inject(IgxOverlayService) protected overlayService: IgxOverlayService, /** @hidden @internal */ public summaryService: IgxGridSummaryService, @@ -5072,7 +5073,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements this.rebuildMatchCache(); if (updateActiveInfo) { - const activeInfo = IgxTextHighlightDirective.highlightGroupsMap.get(this.id); + const activeInfo = this.textHighlightService.highlightGroupsMap.get(this.id); this.lastSearchInfo.matchInfoCache.forEach((match, i) => { if (match.column === activeInfo.column && match.row === activeInfo.row && @@ -7527,7 +7528,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements this.scrollTo(matchInfo.row, matchInfo.column); } - IgxTextHighlightDirective.setActiveHighlight(this.id, { + this.textHighlightService.setActiveHighlight(this.id, { column: matchInfo.column, row: matchInfo.row, index: matchInfo.index, @@ -7535,7 +7536,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements }); } else { - IgxTextHighlightDirective.clearActiveHighlight(this.id); + this.textHighlightService.clearActiveHighlight(this.id); } return this.lastSearchInfo.matchCount; diff --git a/projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-grid-base.directive.ts b/projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-grid-base.directive.ts index 9f52704eb8a..e081aec5738 100644 --- a/projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-grid-base.directive.ts +++ b/projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-grid-base.directive.ts @@ -40,6 +40,7 @@ import { IgxOverlayService } from '../../services/overlay/overlay'; import { State, Transaction, TransactionService } from '../../services/transaction/transaction'; import { IgxGridTransaction } from '../common/types'; import { IgxGridValidationService } from '../grid/grid-validation.service'; +import { IgxTextHighlightService } from '../../directives/text-highlight/text-highlight.service'; export const hierarchicalTransactionServiceFactory = () => new IgxTransactionService(); @@ -156,6 +157,7 @@ export abstract class IgxHierarchicalGridBaseDirective extends IgxGridBaseDirect envInjector: EnvironmentInjector, navigation: IgxHierarchicalGridNavigationService, filteringService: IgxFilteringService, + textHighlightService: IgxTextHighlightService, @Inject(IgxOverlayService) overlayService: IgxOverlayService, summaryService: IgxGridSummaryService, @Optional() @Inject(DisplayDensityToken) _displayDensityOptions: IDisplayDensityOptions, @@ -178,6 +180,7 @@ export abstract class IgxHierarchicalGridBaseDirective extends IgxGridBaseDirect envInjector, navigation, filteringService, + textHighlightService, overlayService, summaryService, _displayDensityOptions, diff --git a/projects/igniteui-angular/src/lib/grids/hierarchical-grid/row-island.component.ts b/projects/igniteui-angular/src/lib/grids/hierarchical-grid/row-island.component.ts index 641446efc4b..35985dcce51 100644 --- a/projects/igniteui-angular/src/lib/grids/hierarchical-grid/row-island.component.ts +++ b/projects/igniteui-angular/src/lib/grids/hierarchical-grid/row-island.component.ts @@ -48,6 +48,7 @@ import { IgxPaginatorDirective } from '../../paginator/paginator-interfaces'; import { IgxFlatTransactionFactory } from '../../services/transaction/transaction-factory.service'; import { IGridCreatedEventArgs } from './events'; import { IgxGridValidationService } from '../grid/grid-validation.service'; +import { IgxTextHighlightService } from '../../directives/text-highlight/text-highlight.service'; @Component({ changeDetection: ChangeDetectionStrategy.OnPush, @@ -234,6 +235,7 @@ export class IgxRowIslandComponent extends IgxHierarchicalGridBaseDirective envInjector: EnvironmentInjector, navigation: IgxHierarchicalGridNavigationService, filteringService: IgxFilteringService, + textHighlightService: IgxTextHighlightService, @Inject(IgxOverlayService) overlayService: IgxOverlayService, summaryService: IgxGridSummaryService, @Optional() @Inject(DisplayDensityToken) _displayDensityOptions: IDisplayDensityOptions, @@ -256,6 +258,7 @@ export class IgxRowIslandComponent extends IgxHierarchicalGridBaseDirective envInjector, navigation, filteringService, + textHighlightService, overlayService, summaryService, _displayDensityOptions, diff --git a/projects/igniteui-angular/src/lib/grids/pivot-grid/pivot-grid.component.ts b/projects/igniteui-angular/src/lib/grids/pivot-grid/pivot-grid.component.ts index 1107e6ef44f..829f5c825b5 100644 --- a/projects/igniteui-angular/src/lib/grids/pivot-grid/pivot-grid.component.ts +++ b/projects/igniteui-angular/src/lib/grids/pivot-grid/pivot-grid.component.ts @@ -91,6 +91,7 @@ import { IgxGridDragSelectDirective } from '../selection/drag-select.directive'; import { IgxGridBodyDirective } from '../grid.common'; import { IgxColumnResizingService } from '../resizing/resizing.service'; import { DefaultDataCloneStrategy, IDataCloneStrategy } from '../../data-operations/data-clone-strategy'; +import { IgxTextHighlightService } from '../../directives/text-highlight/text-highlight.service'; let NEXT_ID = 0; const MINIMUM_COLUMN_WIDTH = 200; @@ -976,6 +977,7 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni envInjector: EnvironmentInjector, navigation: IgxPivotGridNavigationService, filteringService: IgxFilteringService, + textHighlightService: IgxTextHighlightService, @Inject(IgxOverlayService) overlayService: IgxOverlayService, summaryService: IgxGridSummaryService, @Optional() @Inject(DisplayDensityToken) _displayDensityOptions: IDisplayDensityOptions, @@ -998,6 +1000,7 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni envInjector, navigation, filteringService, + textHighlightService, overlayService, summaryService, _displayDensityOptions, diff --git a/projects/igniteui-angular/src/lib/grids/tree-grid/tree-grid.component.ts b/projects/igniteui-angular/src/lib/grids/tree-grid/tree-grid.component.ts index d5516586b4a..ab614757d33 100644 --- a/projects/igniteui-angular/src/lib/grids/tree-grid/tree-grid.component.ts +++ b/projects/igniteui-angular/src/lib/grids/tree-grid/tree-grid.component.ts @@ -81,6 +81,7 @@ import { IgxColumnMovingDropDirective } from '../moving/moving.drop.directive'; import { IgxGridDragSelectDirective } from '../selection/drag-select.directive'; import { IgxGridBodyDirective } from '../grid.common'; import { IgxGridHeaderRowComponent } from '../headers/grid-header-row.component'; +import { IgxTextHighlightService } from '../../directives/text-highlight/text-highlight.service'; let NEXT_ID = 0; @@ -438,6 +439,7 @@ export class IgxTreeGridComponent extends IgxGridBaseDirective implements GridTy envInjector: EnvironmentInjector, navigation: IgxGridNavigationService, filteringService: IgxFilteringService, + textHighlightService: IgxTextHighlightService, @Inject(IgxOverlayService) overlayService: IgxOverlayService, summaryService: IgxGridSummaryService, @Optional() @Inject(DisplayDensityToken) _displayDensityOptions: IDisplayDensityOptions, @@ -447,7 +449,7 @@ export class IgxTreeGridComponent extends IgxGridBaseDirective implements GridTy HierarchicalTransactionService, ) { super(validationService, selectionService, colResizingService, gridAPI, transactionFactory, _elementRef, - _zone, document, cdr, differs, viewRef, injector, envInjector, navigation, filteringService, + _zone, document, cdr, differs, viewRef, injector, envInjector, navigation, filteringService, textHighlightService, overlayService, summaryService, _displayDensityOptions, localeId, platform, _diTransactions); } diff --git a/projects/igniteui-angular/src/lib/services/public_api.ts b/projects/igniteui-angular/src/lib/services/public_api.ts index c2ccd66e17b..1f588872318 100644 --- a/projects/igniteui-angular/src/lib/services/public_api.ts +++ b/projects/igniteui-angular/src/lib/services/public_api.ts @@ -20,3 +20,4 @@ export * from './transaction/transaction'; export * from './transaction/igx-hierarchical-transaction'; export * from './transaction/hierarchical-transaction'; export * from './transaction/transaction-factory.service'; +export * from '../directives/text-highlight/text-highlight.service'; From 0bdead6ea78f304b55df83a582f0bcb3e34043a5 Mon Sep 17 00:00:00 2001 From: Konstantin Dinev Date: Thu, 15 Feb 2024 14:32:44 +0200 Subject: [PATCH 2/5] test(text-highlight): fixing test component with service injection --- .../text-highlight/text-highlight.directive.spec.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/projects/igniteui-angular/src/lib/directives/text-highlight/text-highlight.directive.spec.ts b/projects/igniteui-angular/src/lib/directives/text-highlight/text-highlight.directive.spec.ts index eaee3c79239..bce041f6c69 100644 --- a/projects/igniteui-angular/src/lib/directives/text-highlight/text-highlight.directive.spec.ts +++ b/projects/igniteui-angular/src/lib/directives/text-highlight/text-highlight.directive.spec.ts @@ -4,6 +4,7 @@ import { TestBed, waitForAsync } from '@angular/core/testing'; import { IgxTextHighlightDirective, IActiveHighlightInfo} from './text-highlight.directive'; import { configureTestSuite } from '../../test-utils/configure-suite'; +import { IgxTextHighlightService } from './text-highlight.service'; describe('IgxHighlight', () => { configureTestSuite(); @@ -321,6 +322,8 @@ class HighlightLoremIpsumComponent { // eslint-disable-next-line max-len public html = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum vulputate luctus dui ut maximus. Quisque sed suscipit lorem. Vestibulum sit.'; + constructor(private highlightService: IgxTextHighlightService) { } + public highlightText(text: string, caseSensitive?: boolean, exactMatch?: boolean) { return this.highlight.highlight(text, caseSensitive, exactMatch); } @@ -339,6 +342,6 @@ class HighlightLoremIpsumComponent { column: 0, index }; - IgxTextHighlightDirective.setActiveHighlight(this.groupName, activeHighlightInfo); + this.highlightService.setActiveHighlight(this.groupName, activeHighlightInfo); } } From e0e5cf71e0bd6df851185f48f660cfb974548578 Mon Sep 17 00:00:00 2001 From: Konstantin Dinev Date: Fri, 16 Feb 2024 11:45:57 +0200 Subject: [PATCH 3/5] docs(changelog): updating with text-highlight tree-shaking --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f270c64a8c6..9539c784836 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,8 +34,7 @@ All notable changes for each version of this project will be documented in this - `IgxForOf` - Unified logic for vertical and horizontal virtualization such as - caching, updating, max browser size exceeding. - Added new method - `addScroll` that can shift the scroll thumb by the specified amount in pixels (negative number to scroll to previous, positive to scroll next). Similar to `addScrollTop` but works for both vertical and horizontal virtualization. - - +- `IgxTextHighlightDirective` is now correctly tree-shaken out of the bundle when not used. - `IgxGrid`, `IgxTreeGrid`, `IgxHierarchicalGrid` - Tree-shaking of the grids has been improved: - The `igx-paginator`, `igx-grid-toolbar` and `igx-action-strip` components should now correctly tree-shake when not used in a grid. From c2c15006d9c8473454946b405b42a71889aa9862 Mon Sep 17 00:00:00 2001 From: Konstantin Dinev Date: Fri, 16 Feb 2024 12:04:29 +0200 Subject: [PATCH 4/5] fix(tree-shaking): marking mkenum /*@__PURE__*/ --- projects/igniteui-angular/src/lib/core/utils.ts | 2 +- .../igniteui-angular/src/lib/grids/common/enums.ts | 14 +++++++------- .../src/lib/slider/slider.common.ts | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/projects/igniteui-angular/src/lib/core/utils.ts b/projects/igniteui-angular/src/lib/core/utils.ts index a034866ff64..871dcf5e7f6 100644 --- a/projects/igniteui-angular/src/lib/core/utils.ts +++ b/projects/igniteui-angular/src/lib/core/utils.ts @@ -71,7 +71,7 @@ export const copyDescriptors = (obj) => { return Object.create( Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj) - ); + ); } } diff --git a/projects/igniteui-angular/src/lib/grids/common/enums.ts b/projects/igniteui-angular/src/lib/grids/common/enums.ts index 824598e345d..dc19c03e82d 100644 --- a/projects/igniteui-angular/src/lib/grids/common/enums.ts +++ b/projects/igniteui-angular/src/lib/grids/common/enums.ts @@ -5,7 +5,7 @@ import { mkenum } from '../../core/utils'; * - quickFilter: Default mode with a filter row UI between the column headers and the first row of records. * - excelStyleFilter: Filter mode where an Excel-style filter is used. */ -export const FilterMode = mkenum({ +export const FilterMode = /*@__PURE__*/mkenum({ quickFilter: 'quickFilter', excelStyleFilter: 'excelStyleFilter' }); @@ -16,7 +16,7 @@ export type FilterMode = (typeof FilterMode)[keyof typeof FilterMode]; * - top: Default value; Summary rows are displayed at the top of the grid. * - bottom: Summary rows are displayed at the bottom of the grid. */ -export const GridSummaryPosition = mkenum({ +export const GridSummaryPosition = /*@__PURE__*/mkenum({ top: 'top', bottom: 'bottom' }); @@ -28,7 +28,7 @@ export type GridSummaryPosition = (typeof GridSummaryPosition)[keyof typeof Grid * - childLevelsOnly: Summaries are calculated only for child levels. * - rootAndChildLevels: Default value; Summaries are calculated for both root and child levels. */ -export const GridSummaryCalculationMode = mkenum({ +export const GridSummaryCalculationMode = /*@__PURE__*/mkenum({ rootLevelOnly: 'rootLevelOnly', childLevelsOnly: 'childLevelsOnly', rootAndChildLevels: 'rootAndChildLevels' @@ -42,8 +42,8 @@ export type GridSummaryCalculationMode = (typeof GridSummaryCalculationMode)[key */ export type GridValidationTrigger = 'change' | 'blur' ; -/** - * Type representing the type of the target object (elements of the grid) for keydown (fired when a key is pressed) events in the grid. +/** + * Type representing the type of the target object (elements of the grid) for keydown (fired when a key is pressed) events in the grid. * - 'dataCell': Represents a data cell within the grid. It contains and displays individual data values * - 'summaryCell': Summary cells display aggregated/summarized data at the bottom of the grid. They provide insights like total record count, min/max values, etc. * - 'groupRow': Group row within the grid. Group rows are used to group related data rows by columns. Contains the related group expression, level, sub-records and group value. @@ -66,7 +66,7 @@ export type GridKeydownTargetType = * - 'multiple': Default cell selection mode. More than one element can be selected at a time. * - 'multipleCascade': Similar to multiple selection. It is used in hierarchical or tree grids. Allows selection not only to an individual item but also all its related or nested items in a single action */ -export const GridSelectionMode = mkenum({ +export const GridSelectionMode = /*@__PURE__*/mkenum({ none: 'none', single: 'single', multiple: 'multiple', @@ -75,7 +75,7 @@ export const GridSelectionMode = mkenum({ export type GridSelectionMode = (typeof GridSelectionMode)[keyof typeof GridSelectionMode]; /** Enumeration representing different column display order options. */ -export const ColumnDisplayOrder = mkenum({ +export const ColumnDisplayOrder = /*@__PURE__*/mkenum({ Alphabetical: 'Alphabetical', DisplayOrder: 'DisplayOrder' }); diff --git a/projects/igniteui-angular/src/lib/slider/slider.common.ts b/projects/igniteui-angular/src/lib/slider/slider.common.ts index 95c3ae854c0..368e7931ec0 100644 --- a/projects/igniteui-angular/src/lib/slider/slider.common.ts +++ b/projects/igniteui-angular/src/lib/slider/slider.common.ts @@ -56,7 +56,7 @@ export interface ISliderValueChangeEventArgs { value: number | IRangeSliderValue; } -export const IgxSliderType = mkenum({ +export const IgxSliderType = /*@__PURE__*/mkenum({ /** * Slider with single thumb. */ @@ -68,7 +68,7 @@ export const IgxSliderType = mkenum({ }); export type IgxSliderType = (typeof IgxSliderType)[keyof typeof IgxSliderType]; -export const SliderHandle = mkenum({ +export const SliderHandle = /*@__PURE__*/mkenum({ FROM: 'from', TO: 'to' }); @@ -77,7 +77,7 @@ export type SliderHandle = (typeof SliderHandle)[keyof typeof SliderHandle]; /** * Slider Tick labels Orientation */ -export const TickLabelsOrientation = mkenum({ +export const TickLabelsOrientation = /*@__PURE__*/mkenum({ Horizontal: 'horizontal', TopToBottom: 'toptobottom', BottomToTop: 'bottomtotop' @@ -87,7 +87,7 @@ export type TickLabelsOrientation = (typeof TickLabelsOrientation)[keyof typeof /** * Slider Ticks orientation */ -export const TicksOrientation = mkenum({ +export const TicksOrientation = /*@__PURE__*/mkenum({ Top: 'top', Bottom: 'bottom', Mirror: 'mirror' From ff365ac9f76da2a8ea2d7c090987e958ce1ffe48 Mon Sep 17 00:00:00 2001 From: Konstantin Dinev Date: Fri, 16 Feb 2024 13:49:47 +0200 Subject: [PATCH 5/5] docs(changelog): adding breaking change --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9539c784836..acd75cd8dad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ All notable changes for each version of this project will be documented in this - Unified logic for vertical and horizontal virtualization such as - caching, updating, max browser size exceeding. - Added new method - `addScroll` that can shift the scroll thumb by the specified amount in pixels (negative number to scroll to previous, positive to scroll next). Similar to `addScrollTop` but works for both vertical and horizontal virtualization. - `IgxTextHighlightDirective` is now correctly tree-shaken out of the bundle when not used. + - **Breaking Change** A new `IgxTextHighlightService` is now exposed and methods `setActiveHighlight` and `clearActiveHighlight` have been moved to it. - `IgxGrid`, `IgxTreeGrid`, `IgxHierarchicalGrid` - Tree-shaking of the grids has been improved: - The `igx-paginator`, `igx-grid-toolbar` and `igx-action-strip` components should now correctly tree-shake when not used in a grid.