UNPKG

@linid-dm/directory-manager-client-core

Version:

Core package by providing a set of angular components for the Directory Manager app.

88 lines (87 loc) 6.95 kB
/** * Copyright (C) 2020-2024 Linagora * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free * Software Foundation, either version 3 of the License, or (at your option) any * later version, provided you comply with the Additional Terms applicable for * LinID Directory Manager software by LINAGORA pursuant to Section 7 of the GNU * Affero General Public License, subsections (b), (c), and (e), pursuant to * which these Appropriate Legal Notices must notably (i) retain the display of * the "LinID™" trademark/logo at the top of the interface window, the display * of the “You are using the Open Source and free version of LinID™, powered by * Linagora © 2009–2013. Contribute to LinID R&D by subscribing to an Enterprise * offer!” infobox and in the e-mails sent with the Program, notice appended to * any type of outbound messages (e.g. e-mail and meeting requests) as well as * in the LinID Directory Manager user interface, (ii) retain all hypertext * links between LinID Directory Manager and https://linid.org/, as well as * between LINAGORA and LINAGORA.com, and (iii) refrain from infringing LINAGORA * intellectual property rights over its trademarks and commercial brands. Other * Additional Terms apply, see <http://www.linagora.com/licenses/> for more * details. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more * details. * * You should have received a copy of the GNU Affero General Public License and * its applicable Additional Terms for LinID Directory Manager along with this * program. If not, see <http://www.gnu.org/licenses/> for the GNU Affero * General Public License version 3 and <http://www.linagora.com/licenses/> for * the Additional Terms applicable to the LinID Directory Manager software. */ import { MatSort } from '@angular/material/sort'; import { MatTableDataSource } from '@angular/material/table'; import { IArrayAccessibility, IArrayAttributeUpdateParams, IAttribute, IAttributeActions, IConfig, IPrimitiveActions } from '../interfaces/configs.interface'; import { IData, IDataSourceRow, IDataTableRow, IGenericArrayColumn, ILink, IUiEntryIds } from '../interfaces/data.interface'; import { IResourceType } from '../interfaces/resources-types.interface'; import { JsTable } from './jstable.helper'; export declare function isLinkObject(attributeValue: any): boolean; export declare function escapeBackSlash(value: string): string; export declare class DataViewProperties { private dataSource; private columns; private displayedColumns; private isClickableRow; private accessibility; constructor(object?: DataViewProperties); getDataSource(): MatTableDataSource<any>; setDataSource(dataSource: MatTableDataSource<any>): void; getColumns(): IGenericArrayColumn[]; setColumns(columns: IGenericArrayColumn[]): void; getDisplayedColumns(): string[]; setDisplayedColumns(displayedColumns: string[]): void; getIsClickableRow(): boolean; setIsClickableRow(isClickableRow: boolean): void; getAccessibility(): IArrayAccessibility; setAccessibility(accessibility: IArrayAccessibility): void; } export declare function getViewPropertiesArrayAttribute(attributeConfig: IAttribute, isClickableRow?: boolean): DataViewProperties; export declare function canDeleteEntries(actions: IPrimitiveActions | IAttributeActions, hasOneDeletableEntry: boolean): boolean; export declare function getRowId(row: IDataTableRow, selectionColumnId: string): string; export declare function convertDataSourceRowToLinkObject(row: IDataSourceRow, columnForId: string, updateActionsParams: IArrayAttributeUpdateParams): ILink; export declare function isDataTableCellElement(cellValue: any): boolean; export declare function isArrayOfDataTableCellElements(cellValue: any): boolean; export declare function getDataSourceArrayUsingDataFromBackend(data: ILink[], columnIds: string[], resourcesTypesIds: string[], resourcesTypes: JsTable<IResourceType>, squashColumnId: string): IDataTableRow[]; export declare function squashArrayRows(dataSource: IDataTableRow[], squashColumnId: string, columnIds: string[]): IDataTableRow[]; export declare function getDataSourceForGenericArray(data: IData, selectedResourceTypeConfig: IConfig, clickableCellsEndpoints?: JsTable<string>, onlyEditableResources?: boolean): any[]; export declare function getDataEntryForGenericArray(dataResource: any, resourceTypeConfig: IConfig, clickableCellsEndpoints?: JsTable<string>): any; export declare function getFlatResource(dataResource: any, resourceTypeConfig: IConfig): any; export declare function getDisplayedAttributeValue(dataResource: any, dataResourceKeys: string[], resourceTypeConfig: IConfig, clickableCellsEndpoints?: JsTable<string>): any; export declare function isArrayOfLinkObjects(attributeValue: any): boolean; export declare function getOrderedKeysArrayAttributes(attributes: IAttribute[], dataResource: any): string[]; export declare function getDisplayedColumnsIds(resourceTypeConfig: IConfig): string[]; export declare function getOrderedKeysSimpleAttributes(attributes: IAttribute[], dataResource: any): string[]; export declare function canDeleteEntry(arrayActions: IPrimitiveActions | IAttributeActions, isSelectOnlyModeEnabled: boolean, isEditableRow: boolean): boolean; export declare function canMoveEntry(arrayActions: IPrimitiveActions | IAttributeActions, canAssignOrMoveEntries: boolean, isSelectOnlyModeEnabled: boolean, isEditableRow: boolean): boolean; export declare function getSelectedElementIds(row: any, selectionColumnId: string): IUiEntryIds; export declare function getUpdatedDisplayedColumns(arrayActions: IPrimitiveActions | IAttributeActions, initialDisplayedColumns: string[], isSelectOnlyModeEnabled: boolean, canAssignOrMoveEntries: boolean, isEditableArray: boolean, updateAffectAnotherResourceType: boolean, isAttributeArray: boolean, data: any[] | IDataTableRow[]): string[]; export declare function canMoveEntries(arrayActions: IPrimitiveActions | IAttributeActions, canAssignOrMoveEntries: boolean, hasOneDeletableEntry: boolean): boolean; export declare function isRowEditable(isAttributeArray: boolean, updateAffectAnotherResourceType: boolean, fieldForUpdate: string, isEditableArray: boolean, row: any): boolean; export declare function sortData(data: any[], sort: MatSort): any[]; export declare function sortingDataAccessor(data: any[], sortHeaderId: string): string | number; export declare function getAllElementsToExport(arrayData: any[], columns: IGenericArrayColumn[]): { [label: string]: any; }[]; export declare function getColumnsLabels(columns: IGenericArrayColumn[]): Map<string, string>;