Skip to content

Commit

Permalink
Merge pull request #12440 from IgniteUI/typedoc-changes-master
Browse files Browse the repository at this point in the history
Upgrade localization plugin to 3.3.0
  • Loading branch information
zdrawku authored Mar 23, 2023
2 parents 3a322c5 + 77d3f73 commit 1f31d24
Show file tree
Hide file tree
Showing 22 changed files with 318 additions and 97 deletions.
2 changes: 0 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@
"stylelint": "^15.1.0",
"stylelint-scss": "^4.1.0",
"ts-node": "^10.8.1",
"typedoc": "^0.23.24",
"typedoc-plugin-localization": "^2.4.0",
"typedoc": "^0.23.21",
"typedoc-plugin-localization": "^3.0.0",
"typescript": "4.9.5"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@ export class IgxComboItemComponent extends IgxDropDownItemComponent {
return rect.y >= parentDiv.y;
}

/**
* @inheritDoc
*/
public clicked(event): void {
this.comboAPI.disableTransitions = false;
if (!this.isSelectable) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
* <igx-drop-down-item [(selected)]='model.isSelected'></igx-drop-down-item>
* ```
*/
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;
Expand All @@ -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;
}
Expand All @@ -66,10 +85,7 @@ export class IgxDropDownItemComponent extends IgxDropDownItemBaseDirective {
}
}

/**
* @inheritDoc
*/
public clicked(event): void {
public clicked(event): void {
if (!this.isSelectable) {
this.ensureItemFocus();
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,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 = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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
*/
Expand All @@ -53,12 +65,12 @@ export class ConnectedPositioningStrategy implements IPositionStrategy {
*
* @returns target and element DomRect objects
*/
protected calculateElementRectangles(contentElement, target: Point | HTMLElement):
{ targetRect: Partial<DOMRect>; elementRect: Partial<DOMRect> } {
return {
targetRect: Util.getTargetRect(target),
elementRect: contentElement.getBoundingClientRect() as DOMRect
};
protected calculateElementRectangles(contentElement, target: Point | HTMLElement):
{ targetRect: Partial<DOMRect>; elementRect: Partial<DOMRect> } {
return {
targetRect: Util.getTargetRect(target),
elementRect: contentElement.getBoundingClientRect() as DOMRect
};
}

/**
Expand All @@ -70,8 +82,8 @@ export class ConnectedPositioningStrategy implements IPositionStrategy {
* @param elementRect Bounding rectangle of the element
*/
protected setStyle(element: HTMLElement, targetRect: Partial<DOMRect>, elementRect: Partial<DOMRect>, 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 { }
}
Loading

0 comments on commit 1f31d24

Please sign in to comment.