From dc30a6d33b8e62caf141a2678770c30459e2743c Mon Sep 17 00:00:00 2001 From: zdrawku Date: Thu, 8 Dec 2022 13:39:12 +0200 Subject: [PATCH 1/4] chore(*): buildExport with removal of params --- gulpfile.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 80c2a7499ef..f2b2d733133 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -188,8 +188,6 @@ function typedocBuildExportFn(cb) { TYPEDOC.PROJECT_PATH, "--generate-json", TYPEDOC.EXPORT_JSON_PATH, - "--tags", - "--params", "--tsconfig", path.join(__dirname, "tsconfig.typedoc.json")], { stdio: 'inherit', shell: true }); From 60443b381850962f33ff8b1219f45590cfeda1e0 Mon Sep 17 00:00:00 2001 From: zdrawku Date: Thu, 8 Dec 2022 13:45:21 +0200 Subject: [PATCH 2/4] chore(*): Upgrade localization plugin --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5f1337f48bc..1f1de09d555 100644 --- a/package-lock.json +++ b/package-lock.json @@ -90,7 +90,7 @@ "stylelint-scss": "^4.1.0", "ts-node": "^10.8.1", "typedoc": "^0.23.21", - "typedoc-plugin-localization": "^2.4.0", + "typedoc-plugin-localization": "^3.0.0-beta.0", "typescript": "4.8.4" } }, @@ -22174,9 +22174,9 @@ } }, "node_modules/typedoc-plugin-localization": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/typedoc-plugin-localization/-/typedoc-plugin-localization-2.4.0.tgz", - "integrity": "sha512-dgoENIqw24rsEqcEGfVFD78G4mBEgxqyya+e5l8FkmSOsmwJnaQUsqVyfHLOgN8puWqn+laKucnRLOeEWaVTrQ==", + "version": "3.0.0-beta.0", + "resolved": "https://registry.npmjs.org/typedoc-plugin-localization/-/typedoc-plugin-localization-3.0.0-beta.0.tgz", + "integrity": "sha512-txKhbAUKCfVQQFzirtYPTfCn4L8Si4l7hNYJGuPh6BgGThkTaK1DiMEQvYqZxjg/Jdfz7mvmx7Y677QNjYwczA==", "dev": true, "dependencies": { "fs-extra": "^10.1.0" @@ -40644,9 +40644,9 @@ } }, "typedoc-plugin-localization": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/typedoc-plugin-localization/-/typedoc-plugin-localization-2.4.0.tgz", - "integrity": "sha512-dgoENIqw24rsEqcEGfVFD78G4mBEgxqyya+e5l8FkmSOsmwJnaQUsqVyfHLOgN8puWqn+laKucnRLOeEWaVTrQ==", + "version": "3.0.0-beta.0", + "resolved": "https://registry.npmjs.org/typedoc-plugin-localization/-/typedoc-plugin-localization-3.0.0-beta.0.tgz", + "integrity": "sha512-txKhbAUKCfVQQFzirtYPTfCn4L8Si4l7hNYJGuPh6BgGThkTaK1DiMEQvYqZxjg/Jdfz7mvmx7Y677QNjYwczA==", "dev": true, "requires": { "fs-extra": "^10.1.0" diff --git a/package.json b/package.json index e671d1f0432..0e850e069f8 100644 --- a/package.json +++ b/package.json @@ -134,7 +134,7 @@ "stylelint-scss": "^4.1.0", "ts-node": "^10.8.1", "typedoc": "^0.23.21", - "typedoc-plugin-localization": "^2.4.0", + "typedoc-plugin-localization": "^3.0.0-beta.0", "typescript": "4.8.4" } } From 738565385b26726d7a4d435ac35a11f8da395afd Mon Sep 17 00:00:00 2001 From: dobromirts Date: Mon, 20 Feb 2023 18:19:19 +0200 Subject: [PATCH 3/4] chore(*): replace inheritDoc with summary comment --- .../src/lib/combo/combo-add-item.component.ts | 3 - .../src/lib/combo/combo-item.component.ts | 3 - .../lib/drop-down/drop-down-item.component.ts | 38 +++++++---- .../src/lib/grids/grid/grid.component.ts | 7 +- .../grids/tree-grid/tree-grid.component.ts | 7 +- .../lib/select/select-positioning-strategy.ts | 17 ++++- .../position/auto-position-strategy.ts | 7 +- .../position/base-fit-position-strategy.ts | 13 +++- .../connected-positioning-strategy.ts | 36 +++++++---- .../position/container-position-strategy.ts | 4 +- .../position/elastic-position-strategy.ts | 7 +- .../position/global-position-strategy.ts | 24 ++++++- .../overlay/scroll/NoOpScrollStrategy.ts | 18 +++++- .../scroll/absolute-scroll-strategy.ts | 25 +++++++- .../overlay/scroll/block-scroll-strategy.ts | 19 +++++- .../overlay/scroll/close-scroll-strategy.ts | 25 +++++++- .../overlay/scroll/scroll-strategy.ts | 25 +++++++- .../services/transaction/base-transaction.ts | 64 +++++++++++++------ .../services/transaction/igx-transaction.ts | 57 ++++++++++++----- 19 files changed, 311 insertions(+), 88 deletions(-) diff --git a/projects/igniteui-angular/src/lib/combo/combo-add-item.component.ts b/projects/igniteui-angular/src/lib/combo/combo-add-item.component.ts index c352014af07..c7b07044ca5 100644 --- a/projects/igniteui-angular/src/lib/combo/combo-add-item.component.ts +++ b/projects/igniteui-angular/src/lib/combo/combo-add-item.component.ts @@ -16,9 +16,6 @@ export class IgxComboAddItemComponent extends IgxComboItemComponent { public set selected(value: boolean) { } - /** - * @inheritDoc - */ public clicked(event?) {// eslint-disable-line this.comboAPI.disableTransitions = false; this.comboAPI.add_custom_item(); diff --git a/projects/igniteui-angular/src/lib/combo/combo-item.component.ts b/projects/igniteui-angular/src/lib/combo/combo-item.component.ts index dafbc702568..3b6fb42abd3 100644 --- a/projects/igniteui-angular/src/lib/combo/combo-item.component.ts +++ b/projects/igniteui-angular/src/lib/combo/combo-item.component.ts @@ -95,9 +95,6 @@ export class IgxComboItemComponent extends IgxDropDownItemComponent { return rect.y >= parentDiv.y; } - /** - * @inheritDoc - */ public clicked(event): void { this.comboAPI.disableTransitions = false; if (!this.isSelectable) { diff --git a/projects/igniteui-angular/src/lib/drop-down/drop-down-item.component.ts b/projects/igniteui-angular/src/lib/drop-down/drop-down-item.component.ts index 9367e24d001..fd8833ab8cb 100644 --- a/projects/igniteui-angular/src/lib/drop-down/drop-down-item.component.ts +++ b/projects/igniteui-angular/src/lib/drop-down/drop-down-item.component.ts @@ -14,7 +14,11 @@ import { IgxDropDownItemBaseDirective } from './drop-down-item.base'; }) export class IgxDropDownItemComponent extends IgxDropDownItemBaseDirective { /** - * @inheritDoc + * Sets/gets if the given item is focused + * ```typescript + * let mySelectedItem = this.dropdown.selectedItem; + * let isMyItemFocused = mySelectedItem.focused; + * ``` */ public get focused(): boolean { let focusedState = this._focused; @@ -27,15 +31,29 @@ export class IgxDropDownItemComponent extends IgxDropDownItemBaseDirective { } /** - * @inheritDoc + * Sets/gets if the given item is focused + * ```typescript + * let mySelectedItem = this.dropdown.selectedItem; + * let isMyItemFocused = mySelectedItem.focused; + * ``` */ - public set focused(value: boolean) { + public set focused(value: boolean) { this._focused = value; } /** - * @inheritDoc + * Sets/Gets if the item is the currently selected one in the dropdown + * + * ```typescript + * let mySelectedItem = this.dropdown.selectedItem; + * let isMyItemSelected = mySelectedItem.selected; // true + * ``` + * + * Two-way data binding + * ```html + * + * ``` */ - public get selected(): boolean { + public get selected(): boolean { if (this.hasIndex) { const item = this.selection.first_item(`${this.dropDown.id}`); return item ? item.index === this._index && item.value === this.value : false; @@ -44,9 +62,10 @@ export class IgxDropDownItemComponent extends IgxDropDownItemBaseDirective { } /** - * @inheritDoc + * Sets/Gets if the item is the currently selected one in the dropdown + * */ - public set selected(value: boolean) { + public set selected(value: boolean) { if (this.isHeader) { return; } @@ -66,10 +85,7 @@ export class IgxDropDownItemComponent extends IgxDropDownItemBaseDirective { } } - /** - * @inheritDoc - */ - public clicked(event): void { + public clicked(event): void { if (!this.isSelectable) { this.ensureItemFocus(); return; diff --git a/projects/igniteui-angular/src/lib/grids/grid/grid.component.ts b/projects/igniteui-angular/src/lib/grids/grid/grid.component.ts index e782cccd87a..a0158d1e65f 100644 --- a/projects/igniteui-angular/src/lib/grids/grid/grid.component.ts +++ b/projects/igniteui-angular/src/lib/grids/grid/grid.component.ts @@ -1065,7 +1065,12 @@ export class IgxGridComponent extends IgxGridBaseDirective implements GridType, } /** - * @inheritDoc + * + * Returns an array of the current cell selection in the form of `[{ column.field: cell.value }, ...]`. + * + * @remarks + * If `formatters` is enabled, the cell value will be formatted by its respective column formatter (if any). + * If `headers` is enabled, it will use the column header (if any) instead of the column field. */ public getSelectedData(formatters = false, headers = false): any[] { if (this.groupingExpressions.length || this.hasDetails) { 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 b2e587cd1bf..ce849e68892 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 @@ -673,7 +673,12 @@ export class IgxTreeGridComponent extends IgxGridBaseDirective implements GridTy } /** - * @inheritDoc + * + * Returns an array of the current cell selection in the form of `[{ column.field: cell.value }, ...]`. + * + * @remarks + * If `formatters` is enabled, the cell value will be formatted by its respective column formatter (if any). + * If `headers` is enabled, it will use the column header (if any) instead of the column field. */ public getSelectedData(formatters = false, headers = false): any[] { let source = []; diff --git a/projects/igniteui-angular/src/lib/select/select-positioning-strategy.ts b/projects/igniteui-angular/src/lib/select/select-positioning-strategy.ts index 2d2422d7e77..e40393252c7 100644 --- a/projects/igniteui-angular/src/lib/select/select-positioning-strategy.ts +++ b/projects/igniteui-angular/src/lib/select/select-positioning-strategy.ts @@ -8,7 +8,9 @@ import { Optional } from '@angular/core'; /** @hidden @internal */ export class SelectPositioningStrategy extends BaseFitPositionStrategy implements IPositionStrategy { - /** @inheritDoc */ + /** + * PositionSettings to use when position the component in the overlay + */ public settings: PositionSettings; private _selectDefaultSettings = { @@ -30,7 +32,18 @@ export class SelectPositioningStrategy extends BaseFitPositionStrategy implement this.settings = Object.assign({}, this._selectDefaultSettings, settings); } - /** @inheritDoc */ + /** + * Position the element based on the PositionStrategy implementing this interface. + * + * @param contentElement The HTML element to be positioned + * @param size Size of the element + * @param document reference to the Document object + * @param initialCall should be true if this is the initial call to the method + * @param target attaching target for the component to show + * ```typescript + * settings.positionStrategy.position(content, size, document, true); + * ``` + */ public position(contentElement: HTMLElement, size: Size, document?: Document, diff --git a/projects/igniteui-angular/src/lib/services/overlay/position/auto-position-strategy.ts b/projects/igniteui-angular/src/lib/services/overlay/position/auto-position-strategy.ts index 5f76dc1f57c..336a11adec2 100644 --- a/projects/igniteui-angular/src/lib/services/overlay/position/auto-position-strategy.ts +++ b/projects/igniteui-angular/src/lib/services/overlay/position/auto-position-strategy.ts @@ -9,7 +9,12 @@ import { BaseFitPositionStrategy } from './base-fit-position-strategy'; */ export class AutoPositionStrategy extends BaseFitPositionStrategy { - /** @inheritDoc */ + /** + * Fits the element into viewport according to the position settings + * + * @param element element to fit in viewport + * @param connectedFit connectedFit object containing all necessary parameters + */ protected fitInViewport(element: HTMLElement, connectedFit: ConnectedFit) { const transformString: string[] = []; if (connectedFit.fitHorizontal.back < 0 || connectedFit.fitHorizontal.forward < 0) { diff --git a/projects/igniteui-angular/src/lib/services/overlay/position/base-fit-position-strategy.ts b/projects/igniteui-angular/src/lib/services/overlay/position/base-fit-position-strategy.ts index e5758302d00..de94eee4cac 100644 --- a/projects/igniteui-angular/src/lib/services/overlay/position/base-fit-position-strategy.ts +++ b/projects/igniteui-angular/src/lib/services/overlay/position/base-fit-position-strategy.ts @@ -5,7 +5,18 @@ export abstract class BaseFitPositionStrategy extends ConnectedPositioningStrate protected _initialSize: Size; protected _initialSettings: PositionSettings; - /** @inheritDoc */ + /** + * Position the element based on the PositionStrategy implementing this interface. + * + * @param contentElement The HTML element to be positioned + * @param size Size of the element + * @param document reference to the Document object + * @param initialCall should be true if this is the initial call to the method + * @param target attaching target for the component to show + * ```typescript + * settings.positionStrategy.position(content, size, document, true); + * ``` + */ public position( contentElement: HTMLElement, size: Size, document?: Document, initialCall?: boolean, target?: Point | HTMLElement): void { const targetElement = target || this.settings.target; diff --git a/projects/igniteui-angular/src/lib/services/overlay/position/connected-positioning-strategy.ts b/projects/igniteui-angular/src/lib/services/overlay/position/connected-positioning-strategy.ts index fea52d2d401..ab25b99cd9c 100644 --- a/projects/igniteui-angular/src/lib/services/overlay/position/connected-positioning-strategy.ts +++ b/projects/igniteui-angular/src/lib/services/overlay/position/connected-positioning-strategy.ts @@ -15,7 +15,9 @@ import { IPositionStrategy } from './IPositionStrategy'; * It is possible to either pass a start point or an HTMLElement as a positioning base. */ export class ConnectedPositioningStrategy implements IPositionStrategy { - /** @inheritDoc */ + /** + * PositionSettings to use when position the component in the overlay + */ public settings: PositionSettings; private _defaultSettings: PositionSettings = { @@ -32,15 +34,25 @@ export class ConnectedPositioningStrategy implements IPositionStrategy { this.settings = Object.assign({}, this._defaultSettings, settings); } - /** @inheritDoc */ + /** + * Position the element based on the PositionStrategy implementing this interface. + * + * @param contentElement The HTML element to be positioned + * @param size Size of the element + * @param document reference to the Document object + * @param initialCall should be true if this is the initial call to the method + * @param target attaching target for the component to show + * ```typescript + * settings.positionStrategy.position(content, size, document, true); + * ``` + */ public position(contentElement: HTMLElement, size: Size, document?: Document, initialCall?: boolean, target?: Point | HTMLElement): void { const targetElement = target || this.settings.target; - const rects = this.calculateElementRectangles(contentElement, targetElement); + const rects = this.calculateElementRectangles(contentElement, targetElement); this.setStyle(contentElement, rects.targetRect, rects.elementRect, {}); } /** - * @inheritDoc * Creates clone of this position strategy * @returns clone of this position strategy */ @@ -53,12 +65,12 @@ export class ConnectedPositioningStrategy implements IPositionStrategy { * * @returns target and element DomRect objects */ - protected calculateElementRectangles(contentElement, target: Point | HTMLElement): - { targetRect: Partial; elementRect: Partial } { - return { - targetRect: Util.getTargetRect(target), - elementRect: contentElement.getBoundingClientRect() as DOMRect - }; + protected calculateElementRectangles(contentElement, target: Point | HTMLElement): + { targetRect: Partial; elementRect: Partial } { + return { + targetRect: Util.getTargetRect(target), + elementRect: contentElement.getBoundingClientRect() as DOMRect + }; } /** @@ -70,8 +82,8 @@ export class ConnectedPositioningStrategy implements IPositionStrategy { * @param elementRect Bounding rectangle of the element */ protected setStyle(element: HTMLElement, targetRect: Partial, elementRect: Partial, connectedFit: ConnectedFit) { - const horizontalOffset = connectedFit.horizontalOffset ? connectedFit.horizontalOffset : 0; - const verticalOffset = connectedFit.verticalOffset ? connectedFit.verticalOffset : 0; + const horizontalOffset = connectedFit.horizontalOffset ? connectedFit.horizontalOffset : 0; + const verticalOffset = connectedFit.verticalOffset ? connectedFit.verticalOffset : 0; const startPoint: Point = { x: targetRect.right + targetRect.width * this.settings.horizontalStartPoint + horizontalOffset, y: targetRect.bottom + targetRect.height * this.settings.verticalStartPoint + verticalOffset diff --git a/projects/igniteui-angular/src/lib/services/overlay/position/container-position-strategy.ts b/projects/igniteui-angular/src/lib/services/overlay/position/container-position-strategy.ts index 5d56ed8ebf7..29779778d3c 100644 --- a/projects/igniteui-angular/src/lib/services/overlay/position/container-position-strategy.ts +++ b/projects/igniteui-angular/src/lib/services/overlay/position/container-position-strategy.ts @@ -10,7 +10,9 @@ export class ContainerPositionStrategy extends GlobalPositionStrategy { super(settings); } - /** @inheritDoc */ + /** + * Position the element based on the PositionStrategy implementing this interface. + */ public position(contentElement: HTMLElement): void { contentElement.classList.add('igx-overlay__content--relative'); contentElement.parentElement.classList.add('igx-overlay__wrapper--flex-container'); diff --git a/projects/igniteui-angular/src/lib/services/overlay/position/elastic-position-strategy.ts b/projects/igniteui-angular/src/lib/services/overlay/position/elastic-position-strategy.ts index c7e62749788..12b23619297 100644 --- a/projects/igniteui-angular/src/lib/services/overlay/position/elastic-position-strategy.ts +++ b/projects/igniteui-angular/src/lib/services/overlay/position/elastic-position-strategy.ts @@ -6,7 +6,12 @@ import { BaseFitPositionStrategy } from './base-fit-position-strategy'; * to fit in the view port in case the element is partially getting out of view */ export class ElasticPositionStrategy extends BaseFitPositionStrategy { - /** @inheritDoc */ + /** + * Fits the element into viewport according to the position settings + * + * @param element element to fit in viewport + * @param connectedFit connectedFit object containing all necessary parameters + */ protected fitInViewport(element: HTMLElement, connectedFit: ConnectedFit) { element.classList.add('igx-overlay__content--elastic'); const transformString: string[] = []; diff --git a/projects/igniteui-angular/src/lib/services/overlay/position/global-position-strategy.ts b/projects/igniteui-angular/src/lib/services/overlay/position/global-position-strategy.ts index 3afa253b364..64b742e1868 100644 --- a/projects/igniteui-angular/src/lib/services/overlay/position/global-position-strategy.ts +++ b/projects/igniteui-angular/src/lib/services/overlay/position/global-position-strategy.ts @@ -7,7 +7,9 @@ import { IPositionStrategy } from './IPositionStrategy'; * These are Top/Middle/Bottom for verticalDirection and Left/Center/Right for horizontalDirection */ export class GlobalPositionStrategy implements IPositionStrategy { - /** @inheritDoc */ + /** + * PositionSettings to use when position the component in the overlay + */ public settings: PositionSettings; protected _defaultSettings: PositionSettings = { @@ -24,14 +26,30 @@ export class GlobalPositionStrategy implements IPositionStrategy { this.settings = Object.assign({}, this._defaultSettings, settings); } - /** @inheritDoc */ + /** + * Position the element based on the PositionStrategy implementing this interface. + * + * @param contentElement The HTML element to be positioned + * @param size Size of the element + * @param document reference to the Document object + * @param initialCall should be true if this is the initial call to the method + * @param target attaching target for the component to show + * ```typescript + * settings.positionStrategy.position(content, size, document, true); + * ``` + */ public position(contentElement: HTMLElement): void { contentElement.classList.add('igx-overlay__content--relative'); contentElement.parentElement.classList.add('igx-overlay__wrapper--flex'); this.setPosition(contentElement); } - /** @inheritDoc */ + /** + * Clone the strategy instance. + * ```typescript + * settings.positionStrategy.clone(); + * ``` + */ public clone(): IPositionStrategy { return Util.cloneInstance(this); } diff --git a/projects/igniteui-angular/src/lib/services/overlay/scroll/NoOpScrollStrategy.ts b/projects/igniteui-angular/src/lib/services/overlay/scroll/NoOpScrollStrategy.ts index fc0efa90faa..4bc8d91a32d 100644 --- a/projects/igniteui-angular/src/lib/services/overlay/scroll/NoOpScrollStrategy.ts +++ b/projects/igniteui-angular/src/lib/services/overlay/scroll/NoOpScrollStrategy.ts @@ -7,12 +7,24 @@ export class NoOpScrollStrategy extends ScrollStrategy { constructor() { super(); } - /** @inheritDoc */ + /** + * Initializes the strategy. Should be called once + */ public initialize() { } - /** @inheritDoc */ + /** + * Detaches the strategy + * ```typescript + * settings.scrollStrategy.detach(); + * ``` + */ public attach(): void { } - /** @inheritDoc */ + /** + * Detaches the strategy + * ```typescript + * settings.scrollStrategy.detach(); + * ``` + */ public detach(): void { } } diff --git a/projects/igniteui-angular/src/lib/services/overlay/scroll/absolute-scroll-strategy.ts b/projects/igniteui-angular/src/lib/services/overlay/scroll/absolute-scroll-strategy.ts index d0e8ce1e28e..d4d85d57306 100644 --- a/projects/igniteui-angular/src/lib/services/overlay/scroll/absolute-scroll-strategy.ts +++ b/projects/igniteui-angular/src/lib/services/overlay/scroll/absolute-scroll-strategy.ts @@ -18,7 +18,16 @@ export class AbsoluteScrollStrategy extends ScrollStrategy { this._scrollContainer = scrollContainer; } - /** @inheritDoc */ + /** + * Initializes the strategy. Should be called once + * + * @param document reference to Document object. + * @param overlayService IgxOverlay service to use in this strategy. + * @param id Unique id for this strategy. + * ```typescript + * settings.scrollStrategy.initialize(document, overlay, id); + * ``` + */ public initialize(document: Document, overlayService: IgxOverlayService, id: string) { if (this._initialized) { return; @@ -30,7 +39,12 @@ export class AbsoluteScrollStrategy extends ScrollStrategy { this._initialized = true; } - /** @inheritDoc */ + /** + * Attaches the strategy + * ```typescript + * settings.scrollStrategy.attach(); + * ``` + */ public attach(): void { if (this._zone) { this._zone.runOutsideAngular(() => { @@ -41,7 +55,12 @@ export class AbsoluteScrollStrategy extends ScrollStrategy { } } - /** @inheritDoc */ + /** + * Detaches the strategy + * ```typescript + * settings.scrollStrategy.detach(); + * ``` + */ public detach(): void { if (this._scrollContainer) { this._scrollContainer.removeEventListener('scroll', this.onScroll, true); diff --git a/projects/igniteui-angular/src/lib/services/overlay/scroll/block-scroll-strategy.ts b/projects/igniteui-angular/src/lib/services/overlay/scroll/block-scroll-strategy.ts index 5f228aeb5e5..1412795bceb 100644 --- a/projects/igniteui-angular/src/lib/services/overlay/scroll/block-scroll-strategy.ts +++ b/projects/igniteui-angular/src/lib/services/overlay/scroll/block-scroll-strategy.ts @@ -14,7 +14,10 @@ export class BlockScrollStrategy extends ScrollStrategy { super(); } - /** @inheritDoc */ + /** + * Initializes the strategy. Should be called once + * + */ public initialize(document: Document) { if (this._initialized) { return; @@ -24,12 +27,22 @@ export class BlockScrollStrategy extends ScrollStrategy { this._initialized = true; } - /** @inheritDoc */ + /** + * Attaches the strategy + * ```typescript + * settings.scrollStrategy.attach(); + * ``` + */ public attach(): void { this._document.addEventListener('scroll', this.onScroll, true); } - /** @inheritDoc */ + /** + * Detaches the strategy + * ```typescript + * settings.scrollStrategy.detach(); + * ``` + */ public detach(): void { this._document.removeEventListener('scroll', this.onScroll, true); this._sourceElement = null; diff --git a/projects/igniteui-angular/src/lib/services/overlay/scroll/close-scroll-strategy.ts b/projects/igniteui-angular/src/lib/services/overlay/scroll/close-scroll-strategy.ts index a49f2306234..f7dff177fee 100644 --- a/projects/igniteui-angular/src/lib/services/overlay/scroll/close-scroll-strategy.ts +++ b/projects/igniteui-angular/src/lib/services/overlay/scroll/close-scroll-strategy.ts @@ -23,7 +23,16 @@ export class CloseScrollStrategy extends ScrollStrategy { this._threshold = 10; } - /** @inheritDoc */ + /** + * Initializes the strategy. Should be called once + * + * @param document reference to Document object. + * @param overlayService IgxOverlay service to use in this strategy. + * @param id Unique id for this strategy. + * ```typescript + * settings.scrollStrategy.initialize(document, overlay, id); + * ``` + */ public initialize(document: Document, overlayService: IgxOverlayService, id: string) { if (this._initialized) { return; @@ -35,7 +44,12 @@ export class CloseScrollStrategy extends ScrollStrategy { this._overlayInfo = overlayService.getOverlayById(id); } - /** @inheritDoc */ + /** + * Attaches the strategy + * ```typescript + * settings.scrollStrategy.attach(); + * ``` + */ public attach(): void { if (this._scrollContainer) { this._scrollContainer.addEventListener('scroll', this.onScroll); @@ -45,7 +59,12 @@ export class CloseScrollStrategy extends ScrollStrategy { } } - /** @inheritDoc */ + /** + * Detaches the strategy + * ```typescript + * settings.scrollStrategy.detach(); + * ``` + */ public detach(): void { // TODO: check why event listener removes only on first call and remains on each next!!! if (this._scrollContainer) { diff --git a/projects/igniteui-angular/src/lib/services/overlay/scroll/scroll-strategy.ts b/projects/igniteui-angular/src/lib/services/overlay/scroll/scroll-strategy.ts index 7e5d91fa7b0..0a9e3550774 100644 --- a/projects/igniteui-angular/src/lib/services/overlay/scroll/scroll-strategy.ts +++ b/projects/igniteui-angular/src/lib/services/overlay/scroll/scroll-strategy.ts @@ -3,12 +3,31 @@ import { IgxOverlayService } from '../overlay'; export abstract class ScrollStrategy implements IScrollStrategy { constructor() { } - /** @inheritDoc */ + /** + * Initializes the strategy. Should be called once + * + * @param document reference to Document object. + * @param overlayService IgxOverlay service to use in this strategy. + * @param id Unique id for this strategy. + * ```typescript + * settings.scrollStrategy.initialize(document, overlay, id); + * ``` + */ public abstract initialize(document: Document, overlayService: IgxOverlayService, id: string); - /** @inheritDoc */ + /** + * Attaches the strategy + * ```typescript + * settings.scrollStrategy.attach(); + * ``` + */ public abstract attach(): void; - /** @inheritDoc */ + /** + * Detaches the strategy + * ```typescript + * settings.scrollStrategy.detach(); + * ``` + */ public abstract detach(): void; } diff --git a/projects/igniteui-angular/src/lib/services/transaction/base-transaction.ts b/projects/igniteui-angular/src/lib/services/transaction/base-transaction.ts index a3f3a3b659a..244fa416b8f 100644 --- a/projects/igniteui-angular/src/lib/services/transaction/base-transaction.ts +++ b/projects/igniteui-angular/src/lib/services/transaction/base-transaction.ts @@ -5,7 +5,7 @@ import { DefaultDataCloneStrategy, IDataCloneStrategy } from '../../data-operati export class IgxBaseTransactionService implements TransactionService { /** - * @inheritDoc + * Gets/Sets the data clone strategy used to clone data */ public get cloneStrategy(): IDataCloneStrategy { return this._cloneStrategy; @@ -18,28 +18,28 @@ export class IgxBaseTransactionService i } /** - * @inheritDoc + * @returns if there are any transactions in the Redo stack */ public get canRedo(): boolean { return false; } /** - * @inheritDoc + * @returns if there are any transactions in the Undo stack */ public get canUndo(): boolean { return false; } /** - * @inheritDoc + * Returns whether transaction is enabled for this service */ public get enabled(): boolean { return this._isPending; } /** - * @inheritDoc + * Event fired when transaction state has changed - add transaction, commit all transactions, undo and redo */ public onStateUpdate = new EventEmitter(); @@ -49,7 +49,10 @@ export class IgxBaseTransactionService i private _cloneStrategy: IDataCloneStrategy = new DefaultDataCloneStrategy(); /** - * @inheritDoc + * Adds provided transaction with recordRef if any + * + * @param transaction Transaction to be added + * @param recordRef Reference to the value of the record in the data source related to the changed item */ public add(transaction: T, recordRef?: any): void { if (this._isPending) { @@ -59,24 +62,31 @@ export class IgxBaseTransactionService i } /** - * @inheritDoc + * Returns all recorded transactions in chronological order + * + * @param id Optional record id to get transactions for + * @returns All transaction in the service or for the specified record */ public getTransactionLog(_id?: any): T[] { return []; } /** - * @inheritDoc + * Remove the last transaction if any */ public undo(): void { } - /** - * @inheritDoc - */ + /** + * Applies the last undone transaction if any + */ public redo(): void { } /** - * @inheritDoc + * Returns aggregated changes from all transactions + * + * @param mergeChanges If set to true will merge each state's value over relate recordRef + * and will record resulting value in the related transaction + * @returns Collection of aggregated transactions for each changed record */ public getAggregatedChanges(mergeChanges: boolean): T[] { const result: T[] = []; @@ -88,14 +98,23 @@ export class IgxBaseTransactionService i } /** - * @inheritDoc + * Returns the state of the record with provided id + * + * @param id The id of the record + * @param pending Should get pending state + * @returns State of the record if any */ public getState(id: any): S { return this._pendingStates.get(id); } /** - * @inheritDoc + * Returns value of the required id including all uncommitted changes + * + * @param id The id of the record to return value for + * @param mergeChanges If set to true will merge state's value over relate recordRef + * and will return merged value + * @returns Value with changes or **null** */ public getAggregatedValue(id: any, mergeChanges: boolean): any { const state = this._pendingStates.get(id); @@ -109,12 +128,17 @@ export class IgxBaseTransactionService i } /** - * @inheritDoc + * Applies all transactions over the provided data + * + * @param data Data source to update + * @param id Optional record id to commit transactions for */ public commit(_data: any[], _id?: any): void { } /** - * @inheritDoc + * Clears all transactions + * + * @param id Optional record id to clear transactions for */ public clear(_id?: any): void { this._pendingStates.clear(); @@ -122,14 +146,18 @@ export class IgxBaseTransactionService i } /** - * @inheritDoc + * Starts pending transactions. All transactions passed after call to startPending + * will not be added to transaction log */ public startPending(): void { this._isPending = true; } /** - * @inheritDoc + * Clears all pending transactions and aggregated pending state. If commit is set to true + * commits pending states as single transaction + * + * @param commit Should commit the pending states */ public endPending(_commit: boolean): void { this._isPending = false; diff --git a/projects/igniteui-angular/src/lib/services/transaction/igx-transaction.ts b/projects/igniteui-angular/src/lib/services/transaction/igx-transaction.ts index 8ac37946951..1cfcb6fd0e8 100644 --- a/projects/igniteui-angular/src/lib/services/transaction/igx-transaction.ts +++ b/projects/igniteui-angular/src/lib/services/transaction/igx-transaction.ts @@ -5,7 +5,7 @@ import { isObject, mergeObjects } from '../../core/utils'; export class IgxTransactionService extends IgxBaseTransactionService { /** - * @inheritDoc + * Event fired when transaction state has changed - add transaction, commit all transactions, undo and redo */ public onStateUpdate = new EventEmitter(); @@ -15,21 +15,24 @@ export class IgxTransactionService exten protected _states: Map = new Map(); /** - * @inheritDoc + * @returns if there are any transactions in the Undo stack */ public get canUndo(): boolean { return this._undoStack.length > 0; } /** - * @inheritDoc + * @returns if there are any transactions in the Redo stack */ public get canRedo(): boolean { return this._redoStack.length > 0; } /** - * @inheritDoc + * Adds provided transaction with recordRef if any + * + * @param transaction Transaction to be added + * @param recordRef Reference to the value of the record in the data source related to the changed item */ public add(transaction: T, recordRef?: any): void { const states = this._isPending ? this._pendingStates : this._states; @@ -38,7 +41,10 @@ export class IgxTransactionService exten } /** - * @inheritDoc + * Returns all recorded transactions in chronological order + * + * @param id Optional record id to get transactions for + * @returns All transaction in the service or for the specified record */ public getTransactionLog(id?: any): T[] { if (id !== undefined) { @@ -48,7 +54,11 @@ export class IgxTransactionService exten } /** - * @inheritDoc + * Returns aggregated changes from all transactions + * + * @param mergeChanges If set to true will merge each state's value over relate recordRef + * and will record resulting value in the related transaction + * @returns Collection of aggregated transactions for each changed record */ public getAggregatedChanges(mergeChanges: boolean): T[] { const result: T[] = []; @@ -60,21 +70,30 @@ export class IgxTransactionService exten } /** - * @inheritDoc + * Returns the state of the record with provided id + * + * @param id The id of the record + * @param pending Should get pending state + * @returns State of the record if any */ public getState(id: any, pending: boolean = false): S { return pending ? this._pendingStates.get(id) : this._states.get(id); } /** - * @inheritDoc + * Returns whether transaction is enabled for this service */ public get enabled(): boolean { return true; } /** - * @inheritDoc + * Returns value of the required id including all uncommitted changes + * + * @param id The id of the record to return value for + * @param mergeChanges If set to true will merge state's value over relate recordRef + * and will return merged value + * @returns Value with changes or **null** */ public getAggregatedValue(id: any, mergeChanges: boolean): any { const state = this._states.get(id); @@ -96,7 +115,10 @@ export class IgxTransactionService exten } /** - * @inheritDoc + * Clears all pending transactions and aggregated pending state. If commit is set to true + * commits pending states as single transaction + * + * @param commit Should commit the pending states */ public endPending(commit: boolean): void { this._isPending = false; @@ -119,7 +141,10 @@ export class IgxTransactionService exten } /** - * @inheritDoc + * Applies all transactions over the provided data + * + * @param data Data source to update + * @param id Optional record id to commit transactions for */ public commit(data: any[], id?: any): void { if (id !== undefined) { @@ -136,7 +161,9 @@ export class IgxTransactionService exten } /** - * @inheritDoc + * Clears all transactions + * + * @param id Optional record id to clear transactions for */ public clear(id?: any): void { if (id !== undefined) { @@ -157,7 +184,7 @@ export class IgxTransactionService exten } /** - * @inheritDoc + * Remove the last transaction if any */ public undo(): void { if (this._undoStack.length <= 0) { @@ -179,7 +206,7 @@ export class IgxTransactionService exten } /** - * @inheritDoc + * Applies the last undone transaction if any */ public redo(): void { if (this._redoStack.length > 0) { @@ -272,7 +299,7 @@ export class IgxTransactionService exten state.value = this.mergeValues(state.value, transaction.newValue); } if (state.type === TransactionType.UPDATE) { - mergeObjects(state.value, transaction.newValue); + mergeObjects(state.value, transaction.newValue); } } else { state.value = transaction.newValue; From 77d3f739f291a5a2293f48ac34ba3e6e62521184 Mon Sep 17 00:00:00 2001 From: zdrawku Date: Thu, 23 Mar 2023 15:02:32 +0200 Subject: [PATCH 4/4] chore(*): Update to official 3.0.0 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6172c369572..217de38e514 100644 --- a/package-lock.json +++ b/package-lock.json @@ -87,7 +87,7 @@ "stylelint-scss": "^4.1.0", "ts-node": "^10.8.1", "typedoc": "^0.23.21", - "typedoc-plugin-localization": "^3.0.0-beta.0", + "typedoc-plugin-localization": "^3.0.0", "typescript": "4.9.5" } }, @@ -21850,9 +21850,9 @@ } }, "node_modules/typedoc-plugin-localization": { - "version": "3.0.0-beta.0", - "resolved": "https://registry.npmjs.org/typedoc-plugin-localization/-/typedoc-plugin-localization-3.0.0-beta.0.tgz", - "integrity": "sha512-txKhbAUKCfVQQFzirtYPTfCn4L8Si4l7hNYJGuPh6BgGThkTaK1DiMEQvYqZxjg/Jdfz7mvmx7Y677QNjYwczA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/typedoc-plugin-localization/-/typedoc-plugin-localization-3.0.0.tgz", + "integrity": "sha512-Pnp06S+G/3VrC2TP0LpnjJWx2HQn/c5yzdAQHVFf7KxcoEWrp2etzyS4YefRdgXhd6F+THx51gaK7EO7/bCO4Q==", "dev": true, "dependencies": { "fs-extra": "^10.1.0" diff --git a/package.json b/package.json index 3aa2d6c6b0c..368d78fae38 100644 --- a/package.json +++ b/package.json @@ -131,7 +131,7 @@ "stylelint-scss": "^4.1.0", "ts-node": "^10.8.1", "typedoc": "^0.23.21", - "typedoc-plugin-localization": "^3.0.0-beta.0", + "typedoc-plugin-localization": "^3.0.0", "typescript": "4.9.5" } }