@c8y/ngx-components
Version:
Angular modules for Cumulocity IoT applications
963 lines (938 loc) • 43.3 kB
TypeScript
import * as i0 from '@angular/core';
import { EventEmitter, TemplateRef, OnInit, OnDestroy, SimpleChanges, ElementRef, OnChanges, ModuleWithProviders } from '@angular/core';
import * as i1 from '@c8y/ngx-components';
import { DataGridService, AppStateService, AlertService, Permissions, AssetTypesRealtimeService, UserPreferencesService, PreviewService, Column, Pagination, ActionControl, BulkActionControl, UserPreferencesGridConfigContext, HeaderActionControl, GainsightService, AbstractConfigurationStrategy, UserPreferencesConfigurationStrategy, GridConfigContext, GridConfigContextProvider, GridConfig, ServerSideDataCallback, DataGridComponent, DisplayOptions, DataSourceModifier, ServerSideDataResult, C8yStepper, FilesService, C8yJSONSchema, ConfirmModalComponent, ModalLabels, StatusType, ModalService, ContextRouteService } from '@c8y/ngx-components';
import * as i2 from '@c8y/ngx-components/device-grid';
import * as i3 from '@angular/forms';
import { FormGroup, FormBuilder } from '@angular/forms';
import * as i4 from 'ngx-bootstrap/popover';
import * as i4$1 from 'ngx-bootstrap/dropdown';
import * as i5 from 'ngx-bootstrap/tooltip';
import { InventoryService, UserService, SmartGroupsService, SmartRulesService, QueriesUtil, IManagedObject, IIdentified, IManagedObjectBinary, InventoryBinaryService } from '@c8y/client';
import { AssetNodeService } from '@c8y/ngx-components/assets-navigator';
import { TranslateService } from '@ngx-translate/core';
import { DeviceListExtensionService } from '@c8y/ngx-components/device-list';
import { BsModalService } from 'ngx-bootstrap/modal';
import { Observable, Subscription, Subject } from 'rxjs';
import { FormlyFieldConfig } from '@ngx-formly/core';
import { JSONSchema7 } from 'json-schema';
import { SupportedIconsSuggestions } from '@c8y/ngx-components/icon-selector/icons';
import { ActivatedRoute, Router } from '@angular/router';
import * as i7 from '@c8y/ngx-components/map';
import { MapComponent, MapConfig, PositionManagedObject, MapService } from '@c8y/ngx-components/map';
import * as i8 from '@c8y/ngx-components/data-grid-columns/asset-type';
import * as L from 'leaflet';
declare class SubAssetsService extends DataGridService {
protected translateService: TranslateService;
protected inventoryService: InventoryService;
protected appState: AppStateService;
protected user: UserService;
protected assetNodeService: AssetNodeService;
protected smartGroupsService: SmartGroupsService;
protected smartRulesService: SmartRulesService;
protected alertService: AlertService;
protected permissionsService: Permissions;
protected assetTypes: AssetTypesRealtimeService;
protected userPreferencesService: UserPreferencesService;
protected previewService: PreviewService;
queriesUtil: QueriesUtil;
protected GRID_CONFIG_DEFAULT_STORAGE_KEY: string;
private IS_DEVICE_GROUP_FRAGMENT;
private IS_DYNAMIC_GROUP_FRAGMENT;
constructor(translateService: TranslateService, inventoryService: InventoryService, appState: AppStateService, user: UserService, assetNodeService: AssetNodeService, smartGroupsService: SmartGroupsService, smartRulesService: SmartRulesService, alertService: AlertService, permissionsService: Permissions, assetTypes: AssetTypesRealtimeService, userPreferencesService: UserPreferencesService, previewService: PreviewService);
getCustomProperties(group: IManagedObject): Promise<IManagedObject[]>;
getDefaultColumns(_filterable?: boolean, _sortable?: boolean): Column[];
getDefaultPagination(): Pagination;
getDefaultActionControls(): ActionControl[];
unassignAsset(asset: IManagedObject, parentRef: IManagedObject): Promise<void>;
isDevice(asset: IManagedObject): boolean;
deleteAsset(asset: IManagedObject, parentRef: IManagedObject, params?: {}): Promise<void>;
shouldShowWithDeviceUserCheckbox(asset: IManagedObject): boolean;
getDefaultBulkActionControls(): BulkActionControl[];
getData(columns: Column[], pagination: Pagination, parentReference?: IManagedObject, baseQuery?: any, text?: string): Promise<any>;
getCount(columns: Column[], pagination: Pagination, parentReference?: IManagedObject, baseQuery?: any, text?: string): Promise<number>;
getTotal(parentReference: IManagedObject, baseQuery?: any): Promise<number>;
canEditGroup(group: IManagedObject): Promise<boolean>;
canCreateGroup(): boolean;
canAssignDevice(group: IManagedObject): Promise<boolean>;
canEditSmartGroup(): boolean;
canDeleteSmartGroup(): boolean;
isSmartGroup(group: IManagedObject): boolean;
isUsingInventoryRoles(): boolean;
protected getAssetsStatistics(parentReference: IManagedObject, filters: object): Promise<number>;
protected buildCombinedRootQueryFilter(columns: any, pagination: any, baseQuery?: {
text?: string;
}, isWildcardSearchEnabled?: boolean, text?: string): string;
private deleteGroup;
private isWildcardSearchEnabled;
private deleteDevice;
private deactivateSmartrulesForAsset;
private isDeviceUser;
private deleteDeviceWithUser;
private getAssetsFilters;
static ɵfac: i0.ɵɵFactoryDeclaration<SubAssetsService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<SubAssetsService>;
}
declare class AssignDevicesComponent {
private alert;
private subAssetsService;
private inventoryService;
private gainsightService;
static readonly GRID_CONFIG_CONTEXT: UserPreferencesGridConfigContext;
CURRENT_LOCATION: string;
PRODUCT_EXPERIENCE: {
readonly EVENT: "subAssets";
readonly DELETE_ASSET: {
readonly COMPONENTS: {
readonly DELETE_ASSETS_MODAL: "delete-assets-modal";
};
readonly ACTIONS: {
readonly CASCADE_DELETE: "cascadeDelete";
readonly DELETE_DEVICE_OWNER: "deleteDeviceOwner";
};
readonly RESULTS: {
readonly CANCELED: "canceled";
readonly DELETED: "deleted";
};
};
readonly ASSIGN_DEVICES: {
readonly COMPONENTS: {
readonly ASSIGN_DEVICES: "assign-devices";
};
readonly ACTIONS: {
readonly ASSIGN: "assign";
readonly CANCEL: "cancel";
readonly DISPLAY_CHILD_DEVICES: "displayChildDevices";
};
};
readonly UNASSIGN_MODAL: {
readonly COMPONENTS: {
readonly UNASSIGN_MODAL: "unassign-modal";
};
readonly RESULTS: {
readonly ASSET_UNASSIGNED: "asset-unassigned";
};
readonly ACTIONS: {
readonly CANCEL: "cancel";
};
};
readonly GROUP_INFO: {
readonly COMPONENTS: {
readonly GROUP_INFO: "group-info";
};
readonly ACTIONS: {
readonly EDIT: "edit";
};
readonly RESULTS: {
readonly EDIT_SAVED: "edit-saved";
};
readonly PROPERTIES: {
readonly NAME: "name";
readonly DESCRIPTION: "description";
};
};
readonly ADD_GROUP: {
readonly COMPONENTS: {
readonly ADD_GROUP: "add-group";
};
readonly ACTIONS: {
readonly ADD: "add";
};
readonly RESULTS: {
readonly ADD_SUCCESS: "group-added";
};
};
};
currentGroupId: string;
refresh: EventEmitter<any>;
onCancel: EventEmitter<any>;
onShowChildDevices: EventEmitter<boolean>;
selectedDevice: EventEmitter<IManagedObject>;
showDevicesToggle: TemplateRef<any>;
deviceQueryStringOutput: string;
pendingStatus: boolean;
pagination: Pagination;
selected: string[];
baseQuery: any;
canAssignDevice: boolean;
actionControls: ActionControl[];
headerActionControls: HeaderActionControl[];
showChildren: boolean;
readonly isSelectable = true;
constructor(alert: AlertService, subAssetsService: SubAssetsService, inventoryService: InventoryService, gainsightService: GainsightService);
onEnterKeyDown(_event: KeyboardEvent): void;
ngOnInit(): Promise<void>;
setNotIncludedInGroupQuery(): void;
setHeaderActionControls(): void;
setActionControls(showChildren: boolean): void;
assignDevices(): Promise<void>;
onSelected(selectedDevicesIDs: string[]): void;
selectChildren(asset: IManagedObject): void;
static ɵfac: i0.ɵɵFactoryDeclaration<AssignDevicesComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<AssignDevicesComponent, "c8y-assign-devices", never, { "currentGroupId": { "alias": "currentGroupId"; "required": false; }; "refresh": { "alias": "refresh"; "required": false; }; }, { "onCancel": "onCancel"; "onShowChildDevices": "onShowChildDevices"; "selectedDevice": "selectedDevice"; }, never, never, true, never>;
}
declare class AssignChildDevicesComponent {
private alert;
private subAssetsService;
private inventoryService;
currentGroupId: string;
parentDevice: IManagedObject;
onCancel: EventEmitter<any>;
onSelectedDevices: EventEmitter<string[]>;
refresh: EventEmitter<any>;
onlySelect: boolean;
selected: string[];
baseQuery: any;
canAssignDevice: boolean;
pendingStatus: boolean;
constructor(alert: AlertService, subAssetsService: SubAssetsService, inventoryService: InventoryService);
onEnterKeyDown(_event: KeyboardEvent): void;
onEscapeKeyDown(_event: KeyboardEvent): void;
ngOnInit(): Promise<void>;
setNotIncludedInGroupQuery(): void;
assignDevices(): Promise<void>;
onSelected(selectedDevicesIDs: string[]): void;
static ɵfac: i0.ɵɵFactoryDeclaration<AssignChildDevicesComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<AssignChildDevicesComponent, "c8y-assign-child-devices", never, { "currentGroupId": { "alias": "currentGroupId"; "required": false; }; "parentDevice": { "alias": "parentDevice"; "required": false; }; "refresh": { "alias": "refresh"; "required": false; }; "onlySelect": { "alias": "onlySelect"; "required": false; }; }, { "onCancel": "onCancel"; "onSelectedDevices": "onSelectedDevices"; }, never, never, true, never>;
}
declare class SmartGroupGridConfigurationStrategy extends AbstractConfigurationStrategy {
protected userPreferencesConfigurationStrategy: UserPreferencesConfigurationStrategy;
protected context: GridConfigContext;
protected contextProvider: GridConfigContextProvider;
constructor(userPreferencesConfigurationStrategy: UserPreferencesConfigurationStrategy, context: GridConfigContext, contextProvider: GridConfigContextProvider);
getConfig$(context?: SubAssetsGridConfigContext): Observable<GridConfig>;
saveConfig$(config: GridConfig, _context?: SubAssetsGridConfigContext): Observable<GridConfig>;
static ɵfac: i0.ɵɵFactoryDeclaration<SmartGroupGridConfigurationStrategy, [null, { optional: true; }, { optional: true; }]>;
static ɵprov: i0.ɵɵInjectableDeclaration<SmartGroupGridConfigurationStrategy>;
}
interface SubAssetsGridConfigContext extends UserPreferencesGridConfigContext {
group: IManagedObject;
}
declare class SubAssetsGridConfigurationStrategy extends AbstractConfigurationStrategy {
protected userPreferencesConfigurationStrategy: UserPreferencesConfigurationStrategy;
protected smartGroupGridConfigurationStrategy: SmartGroupGridConfigurationStrategy;
protected assetNodeService: AssetNodeService;
protected context: GridConfigContext;
protected contextProvider: GridConfigContextProvider;
constructor(userPreferencesConfigurationStrategy: UserPreferencesConfigurationStrategy, smartGroupGridConfigurationStrategy: SmartGroupGridConfigurationStrategy, assetNodeService: AssetNodeService, context: GridConfigContext, contextProvider: GridConfigContextProvider);
getConfig$(context?: SubAssetsGridConfigContext): Observable<GridConfig>;
saveConfig$(config: GridConfig, context?: SubAssetsGridConfigContext): Observable<GridConfig>;
private getStrategy;
static ɵfac: i0.ɵɵFactoryDeclaration<SubAssetsGridConfigurationStrategy, [null, null, null, { optional: true; }, { optional: true; }]>;
static ɵprov: i0.ɵɵInjectableDeclaration<SubAssetsGridConfigurationStrategy>;
}
declare class SubAssetsGridComponent implements OnInit, OnDestroy, GridConfigContextProvider {
subAssetsGridService: SubAssetsService;
private bsModalService;
private smartGroupsService;
private deviceListExtensionService;
private assetNodeService;
PRODUCT_EXPERIENCE: {
readonly EVENT: "subAssets";
readonly DELETE_ASSET: {
readonly COMPONENTS: {
readonly DELETE_ASSETS_MODAL: "delete-assets-modal";
};
readonly ACTIONS: {
readonly CASCADE_DELETE: "cascadeDelete";
readonly DELETE_DEVICE_OWNER: "deleteDeviceOwner";
};
readonly RESULTS: {
readonly CANCELED: "canceled";
readonly DELETED: "deleted";
};
};
readonly ASSIGN_DEVICES: {
readonly COMPONENTS: {
readonly ASSIGN_DEVICES: "assign-devices";
};
readonly ACTIONS: {
readonly ASSIGN: "assign";
readonly CANCEL: "cancel";
readonly DISPLAY_CHILD_DEVICES: "displayChildDevices";
};
};
readonly UNASSIGN_MODAL: {
readonly COMPONENTS: {
readonly UNASSIGN_MODAL: "unassign-modal";
};
readonly RESULTS: {
readonly ASSET_UNASSIGNED: "asset-unassigned";
};
readonly ACTIONS: {
readonly CANCEL: "cancel";
};
};
readonly GROUP_INFO: {
readonly COMPONENTS: {
readonly GROUP_INFO: "group-info";
};
readonly ACTIONS: {
readonly EDIT: "edit";
};
readonly RESULTS: {
readonly EDIT_SAVED: "edit-saved";
};
readonly PROPERTIES: {
readonly NAME: "name";
readonly DESCRIPTION: "description";
};
};
readonly ADD_GROUP: {
readonly COMPONENTS: {
readonly ADD_GROUP: "add-group";
};
readonly ACTIONS: {
readonly ADD: "add";
};
readonly RESULTS: {
readonly ADD_SUCCESS: "group-added";
};
};
};
parentGroup: IManagedObject;
refresh: EventEmitter<void>;
title: string;
emptyStateText: string;
loadingItemsLabel: string;
/** The name of the key where columns configuration will be stored. */
columnsConfigKey: string;
get columns(): Column[];
set columns(value: Column[]);
set _pagination(value: Pagination);
set _actionControls(value: ActionControl[]);
selectable: boolean;
baseQuery: object;
set _bulkActionControls(value: BulkActionControl[]);
filterable: boolean;
sortable: boolean;
onColumnsChange: EventEmitter<Column[]>;
itemsSelect: EventEmitter<string[]>;
pagination: Pagination;
showCounterWarning: boolean;
actionControls: ActionControl[];
bulkActionControls: BulkActionControl[];
serverSideDataCallback: ServerSideDataCallback;
dataGrid: DataGridComponent;
displayOptions: DisplayOptions;
showSearch: boolean;
noResultsMessage: "No matching items.";
noDataMessage: "No items to display.";
noResultsSubtitle: "Refine your search terms or check your spelling.";
private _columns;
private destroyed$;
get isRootGroup(): boolean;
get getInfiniteScrollMode(): string;
set _displayOptions(displayOptions: any);
constructor(subAssetsGridService: SubAssetsService, bsModalService: BsModalService, smartGroupsService: SmartGroupsService, deviceListExtensionService: DeviceListExtensionService, assetNodeService: AssetNodeService);
getGridConfigContext(): SubAssetsGridConfigContext;
ngOnInit(): void;
setActionControls(): void;
onUnassignAsset(asset: IManagedObject, parentRef: IManagedObject): void;
onDeleteAsset(asset: IManagedObject, parentRef: IManagedObject): Promise<void>;
ngOnChanges(changes: SimpleChanges): void;
trackByName(_index: any, column: Column): string;
onReload(): void;
onDataSourceModifier(dataSourceModifier: DataSourceModifier): Promise<ServerSideDataResult>;
ngOnDestroy(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<SubAssetsGridComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<SubAssetsGridComponent, "c8y-sub-assets-grid", never, { "parentGroup": { "alias": "parent-group"; "required": false; }; "refresh": { "alias": "refresh"; "required": false; }; "title": { "alias": "title"; "required": false; }; "emptyStateText": { "alias": "emptyStateText"; "required": false; }; "loadingItemsLabel": { "alias": "loadingItemsLabel"; "required": false; }; "columnsConfigKey": { "alias": "columnsConfigKey"; "required": false; }; "columns": { "alias": "columns"; "required": false; }; "_pagination": { "alias": "pagination"; "required": false; }; "_actionControls": { "alias": "actionControls"; "required": false; }; "selectable": { "alias": "selectable"; "required": false; }; "baseQuery": { "alias": "baseQuery"; "required": false; }; "_bulkActionControls": { "alias": "bulkActionControls"; "required": false; }; "filterable": { "alias": "filterable"; "required": false; }; "sortable": { "alias": "sortable"; "required": false; }; "_displayOptions": { "alias": "displayOptions"; "required": false; }; }, { "onColumnsChange": "onColumnsChange"; "itemsSelect": "itemsSelect"; }, never, never, true, never>;
}
declare class SubAssetsGridsModule {
static ɵfac: i0.ɵɵFactoryDeclaration<SubAssetsGridsModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<SubAssetsGridsModule, never, [typeof i1.CoreModule, typeof i2.DeviceGridModule, typeof i4.PopoverModule, typeof i4$1.BsDropdownModule, typeof i5.TooltipModule, typeof AssignDevicesComponent, typeof AssignChildDevicesComponent, typeof SubAssetsGridComponent], [typeof SubAssetsGridComponent, typeof AssignDevicesComponent, typeof AssignChildDevicesComponent]>;
static ɵinj: i0.ɵɵInjectorDeclaration<SubAssetsGridsModule>;
}
interface GroupForm {
name: string;
description: string;
}
declare class AddGroupService {
private inventoryService;
private GROUP_FRAGMENT_TYPE;
constructor(inventoryService: InventoryService);
createGroupAndAssignDevices(groupForm: GroupForm, groupContextId: string | number, selectedDevices: string[]): Promise<IManagedObject | IIdentified>;
private getGroupMO;
private getGroupType;
private assignDevices;
static ɵfac: i0.ɵɵFactoryDeclaration<AddGroupService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<AddGroupService>;
}
declare class AddGroupComponent {
private fb;
private addGroupService;
private alert;
private subAssetsService;
private gainsightService;
private permissionsService;
currentGroupId: string;
refresh: EventEmitter<void>;
onDeviceQueryStringChange: EventEmitter<string>;
onCancel: EventEmitter<void>;
stepper: C8yStepper;
nameInputRef: ElementRef;
deviceQueryStringOutput: string;
showAssignChildDevices: boolean;
showChildrenForDevice: IManagedObject;
formGroupStepOne: FormGroup;
actionControls: ActionControl[];
pendingStatus: boolean;
pagination: Pagination;
selected: string[];
selectedChildDevices: string[];
subscription: Subscription;
canCreateGroup: boolean;
canAssignDevice: boolean;
PRODUCT_EXPERIENCE: {
readonly EVENT: "subAssets";
readonly DELETE_ASSET: {
readonly COMPONENTS: {
readonly DELETE_ASSETS_MODAL: "delete-assets-modal";
};
readonly ACTIONS: {
readonly CASCADE_DELETE: "cascadeDelete";
readonly DELETE_DEVICE_OWNER: "deleteDeviceOwner";
};
readonly RESULTS: {
readonly CANCELED: "canceled";
readonly DELETED: "deleted";
};
};
readonly ASSIGN_DEVICES: {
readonly COMPONENTS: {
readonly ASSIGN_DEVICES: "assign-devices";
};
readonly ACTIONS: {
readonly ASSIGN: "assign";
readonly CANCEL: "cancel";
readonly DISPLAY_CHILD_DEVICES: "displayChildDevices";
};
};
readonly UNASSIGN_MODAL: {
readonly COMPONENTS: {
readonly UNASSIGN_MODAL: "unassign-modal";
};
readonly RESULTS: {
readonly ASSET_UNASSIGNED: "asset-unassigned";
};
readonly ACTIONS: {
readonly CANCEL: "cancel";
};
};
readonly GROUP_INFO: {
readonly COMPONENTS: {
readonly GROUP_INFO: "group-info";
};
readonly ACTIONS: {
readonly EDIT: "edit";
};
readonly RESULTS: {
readonly EDIT_SAVED: "edit-saved";
};
readonly PROPERTIES: {
readonly NAME: "name";
readonly DESCRIPTION: "description";
};
};
readonly ADD_GROUP: {
readonly COMPONENTS: {
readonly ADD_GROUP: "add-group";
};
readonly ACTIONS: {
readonly ADD: "add";
};
readonly RESULTS: {
readonly ADD_SUCCESS: "group-added";
};
};
};
readonly ITEMS_SELECT_LIMIT: number;
readonly btnLabels: {
next: "Next";
cancel: "Cancel";
create: "Create";
};
private nameInput;
constructor(fb: FormBuilder, addGroupService: AddGroupService, alert: AlertService, subAssetsService: SubAssetsService, gainsightService: GainsightService, permissionsService: Permissions);
onEnterKeyDown(_event: KeyboardEvent): void;
ngOnInit(): Promise<void>;
setActionControls(): void;
ngAfterViewInit(): void;
createGroup(): Promise<void>;
onSelected(selectedDevicesIDs: string[]): void;
onSelectedChildDevices(selectedDevicesIDs: string[]): void;
resetStepper(): void;
ngOnDestroy(): void;
private isGroupDetailsStep;
private isAssignDeviceStep;
private setFocusOnNameInput;
private selectChildren;
static ɵfac: i0.ɵɵFactoryDeclaration<AddGroupComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<AddGroupComponent, "c8y-add-group", never, { "currentGroupId": { "alias": "currentGroupId"; "required": false; }; "refresh": { "alias": "refresh"; "required": false; }; }, { "onDeviceQueryStringChange": "onDeviceQueryStringChange"; "onCancel": "onCancel"; }, never, never, true, never>;
}
declare class AddGroupModule {
static ɵfac: i0.ɵɵFactoryDeclaration<AddGroupModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<AddGroupModule, never, [typeof i1.CoreModule, typeof i2.DeviceGridModule, typeof i3.FormsModule, typeof i3.ReactiveFormsModule, typeof i4.PopoverModule, typeof SubAssetsGridsModule, typeof AddGroupComponent], [typeof AddGroupComponent]>;
static ɵinj: i0.ɵɵInjectorDeclaration<AddGroupModule>;
}
interface AssetPropertiesItem {
key: string;
value: any;
label: string;
type: string;
description?: string;
complex?: AssetPropertiesItem[];
file?: IManagedObjectBinary;
isEdit: boolean;
jsonSchema?: JSONSchema7;
}
declare class AssetPropertiesItemComponent implements AssetPropertiesItem, OnChanges {
private alert;
private c8yJsonSchemaService;
filesService: FilesService;
key: string;
value: any;
label: string;
type: string;
file: IManagedObjectBinary;
complex: AssetPropertiesItem[];
isEdit: boolean;
jsonSchema: JSONSchema7;
form: FormGroup;
fields: FormlyFieldConfig[];
model: any;
previewImage: any;
constructor(alert: AlertService, c8yJsonSchemaService: C8yJSONSchema, filesService: FilesService);
ngOnChanges(changes: SimpleChanges): Promise<void>;
private resolveFile;
private formComplexPropsValue;
private getModel;
private resolveJsonSchema;
private getPreviewIfImage;
static ɵfac: i0.ɵɵFactoryDeclaration<AssetPropertiesItemComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<AssetPropertiesItemComponent, "c8y-asset-properties-item", never, { "key": { "alias": "key"; "required": false; }; "value": { "alias": "value"; "required": false; }; "label": { "alias": "label"; "required": false; }; "type": { "alias": "type"; "required": false; }; "file": { "alias": "file"; "required": false; }; "complex": { "alias": "complex"; "required": false; }; "isEdit": { "alias": "isEdit"; "required": false; }; "jsonSchema": { "alias": "jsonSchema"; "required": false; }; }, {}, never, never, true, never>;
}
declare class AssetPropertiesComponent implements OnChanges {
private assetTypes;
private inventory;
private inventoryBinary;
private alert;
asset: IManagedObject;
assetChange: EventEmitter<IManagedObject>;
properties: IManagedObject[];
assetType: IManagedObject;
customProperties: AssetPropertiesItem[];
isEdit: boolean;
isLoading: boolean;
POSITION_PROPERTY_KEY: string;
constructor(assetTypes: AssetTypesRealtimeService, inventory: InventoryService, inventoryBinary: InventoryBinaryService, alert: AlertService);
ngOnChanges(changes: SimpleChanges): void;
loadAsset(): Promise<void>;
resolveCustomProperties(managedObjects: IManagedObject[]): Promise<any[]>;
deleteTitleFromMOJsonSchema(mo: IManagedObject): void;
/**
* This method is used to order the complex properties in the order specified by the user in asset properties screen.
* @param mo - Managed object of the complex property associated with the asset.
*/
orderComplexProperties(mo: IManagedObject): void;
parseItem(mo: IManagedObject, properties: any, asset: any): Promise<AssetPropertiesItem[]>;
toggleEdit(prop: AssetPropertiesItem): void;
getFileManagedObject(id: string): Promise<IManagedObject>;
save(propertyValue: any, prop: AssetPropertiesItem): Promise<void>;
private updateUndefinedToPropTypeValue;
private getTypeValue;
private keepOrder;
private uploadFiles;
private updatePositionKeyLabel;
private setItemRequired;
static ɵfac: i0.ɵɵFactoryDeclaration<AssetPropertiesComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<AssetPropertiesComponent, "c8y-asset-properties", never, { "asset": { "alias": "asset"; "required": false; }; "properties": { "alias": "properties"; "required": false; }; }, { "assetChange": "assetChange"; }, never, never, true, never>;
}
interface DeleteModalCheckboxes {
cascade?: boolean;
withDeviceUser?: boolean;
}
declare class DeleteAssetsModalComponent {
private translateService;
private gainsightService;
CURRENT_LOCATION: string;
PRODUCT_EXPERIENCE: {
readonly EVENT: "subAssets";
readonly DELETE_ASSET: {
readonly COMPONENTS: {
readonly DELETE_ASSETS_MODAL: "delete-assets-modal";
};
readonly ACTIONS: {
readonly CASCADE_DELETE: "cascadeDelete";
readonly DELETE_DEVICE_OWNER: "deleteDeviceOwner";
};
readonly RESULTS: {
readonly CANCELED: "canceled";
readonly DELETED: "deleted";
};
};
readonly ASSIGN_DEVICES: {
readonly COMPONENTS: {
readonly ASSIGN_DEVICES: "assign-devices";
};
readonly ACTIONS: {
readonly ASSIGN: "assign";
readonly CANCEL: "cancel";
readonly DISPLAY_CHILD_DEVICES: "displayChildDevices";
};
};
readonly UNASSIGN_MODAL: {
readonly COMPONENTS: {
readonly UNASSIGN_MODAL: "unassign-modal";
};
readonly RESULTS: {
readonly ASSET_UNASSIGNED: "asset-unassigned";
};
readonly ACTIONS: {
readonly CANCEL: "cancel";
};
};
readonly GROUP_INFO: {
readonly COMPONENTS: {
readonly GROUP_INFO: "group-info";
};
readonly ACTIONS: {
readonly EDIT: "edit";
};
readonly RESULTS: {
readonly EDIT_SAVED: "edit-saved";
};
readonly PROPERTIES: {
readonly NAME: "name";
readonly DESCRIPTION: "description";
};
};
readonly ADD_GROUP: {
readonly COMPONENTS: {
readonly ADD_GROUP: "add-group";
};
readonly ACTIONS: {
readonly ADD: "add";
};
readonly RESULTS: {
readonly ADD_SUCCESS: "group-added";
};
};
};
showWithCascadeCheckbox: boolean;
showWithDeviceUserCheckbox: boolean;
asset: IManagedObject;
modalRef: ConfirmModalComponent;
closeSubject: Subject<DeleteModalCheckboxes>;
labels: ModalLabels;
title: string;
status: StatusType;
config: DeleteModalCheckboxes;
message: string;
deleteGroupSubAssetsMsg: string;
constructor(translateService: TranslateService, gainsightService: GainsightService);
ngOnInit(): void;
ngAfterViewInit(): Promise<void>;
onClose(): void;
onDismiss(): void;
private setModalTexts;
static ɵfac: i0.ɵɵFactoryDeclaration<DeleteAssetsModalComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<DeleteAssetsModalComponent, "c8y-delete-assets-modal", never, { "showWithCascadeCheckbox": { "alias": "showWithCascadeCheckbox"; "required": false; }; "showWithDeviceUserCheckbox": { "alias": "showWithDeviceUserCheckbox"; "required": false; }; "asset": { "alias": "asset"; "required": false; }; }, {}, never, never, true, never>;
}
/**
* Configuration object of the SubAssetsModule.
*/
interface SubAssetsConfig {
/**
* Allows to show or hide the "Add group" button.
*/
showAddGroupBtn?: boolean;
/**
* Allows to show or hide the "Assign devices" button.
*/
showAssignDeviceBtn?: boolean;
/**
* Allows to change the displayed text in the title and breadcrumbs.
*/
name?: string;
/**
* Allows to set the base query that is responsible for retrieving sub-assets.
*
* **Example**
*
* ```typescript
* SubAssetsModule.config({
* baseQuery: { __has: 'c8y_IsAsset' }
* })
* ```
* Check QueriesUtil service from '@c8y/client' to see more examples.
*/
baseQuery?: object;
/**
* Allows to show or hide asset details.
*/
showDetails?: boolean;
/**
* Allows to show or hide the asset properties.
*/
showProperties?: boolean;
/**
* Allows to show or hide the groups context help.
*/
showGroupsContextHelp?: boolean;
}
declare class GroupInfoComponent implements OnDestroy, OnChanges {
private inventory;
private subAssetsService;
private smartGroupsService;
private alertService;
private modalService;
private assetNodeService;
private assetType;
private deviceListExtensionService;
moduleConfig: SubAssetsConfig;
PRODUCT_EXPERIENCE: {
readonly EVENT: "subAssets";
readonly DELETE_ASSET: {
readonly COMPONENTS: {
readonly DELETE_ASSETS_MODAL: "delete-assets-modal";
};
readonly ACTIONS: {
readonly CASCADE_DELETE: "cascadeDelete";
readonly DELETE_DEVICE_OWNER: "deleteDeviceOwner";
};
readonly RESULTS: {
readonly CANCELED: "canceled";
readonly DELETED: "deleted";
};
};
readonly ASSIGN_DEVICES: {
readonly COMPONENTS: {
readonly ASSIGN_DEVICES: "assign-devices";
};
readonly ACTIONS: {
readonly ASSIGN: "assign";
readonly CANCEL: "cancel";
readonly DISPLAY_CHILD_DEVICES: "displayChildDevices";
};
};
readonly UNASSIGN_MODAL: {
readonly COMPONENTS: {
readonly UNASSIGN_MODAL: "unassign-modal";
};
readonly RESULTS: {
readonly ASSET_UNASSIGNED: "asset-unassigned";
};
readonly ACTIONS: {
readonly CANCEL: "cancel";
};
};
readonly GROUP_INFO: {
readonly COMPONENTS: {
readonly GROUP_INFO: "group-info";
};
readonly ACTIONS: {
readonly EDIT: "edit";
};
readonly RESULTS: {
readonly EDIT_SAVED: "edit-saved";
};
readonly PROPERTIES: {
readonly NAME: "name";
readonly DESCRIPTION: "description";
};
};
readonly ADD_GROUP: {
readonly COMPONENTS: {
readonly ADD_GROUP: "add-group";
};
readonly ACTIONS: {
readonly ADD: "add";
};
readonly RESULTS: {
readonly ADD_SUCCESS: "group-added";
};
};
};
group: IManagedObject;
groupChange: EventEmitter<IManagedObject>;
canEdit: boolean;
groupIcon: SupportedIconsSuggestions;
smartGroupFilter: string;
label: string;
columnsWithFilter: Column[];
groupInfoModel: {
name: string;
c8y_Notes: string;
};
filterMsg: "Smart groups are groups dynamically constructed based on filtering criteria.";
private readonly GROUP_UPDATED_MSG;
private allDevicesGridColumns;
private destroyed$;
constructor(inventory: InventoryService, subAssetsService: SubAssetsService, smartGroupsService: SmartGroupsService, alertService: AlertService, modalService: ModalService, assetNodeService: AssetNodeService, assetType: AssetTypesRealtimeService, deviceListExtensionService: DeviceListExtensionService, moduleConfig: SubAssetsConfig);
ngOnChanges(changes: SimpleChanges): Promise<void>;
isSmartGroup(): boolean;
update(partialGroup: Partial<IManagedObject>): Promise<void>;
ngOnDestroy(): void;
private withPropsFromGridColumn;
private updateGroup;
private updateSmartGroup;
private isQueryExecutable;
static ɵfac: i0.ɵɵFactoryDeclaration<GroupInfoComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<GroupInfoComponent, "c8y-group-info", never, { "group": { "alias": "group"; "required": false; }; }, { "groupChange": "groupChange"; }, never, never, true, never>;
}
declare class GroupsComponent implements OnInit, OnDestroy {
private permissions;
private subAssetsService;
moduleConfig: SubAssetsConfig;
private activeRoute;
private router;
private SHOW_ADD_GROUP;
showAddGroup: i0.WritableSignal<boolean>;
refresh: EventEmitter<void>;
filterable: boolean;
sortable: boolean;
shouldDisableAddGroup: boolean;
columns: Column[];
destroyed: Subject<void>;
constructor(permissions: Permissions, subAssetsService: SubAssetsService, moduleConfig: SubAssetsConfig, activeRoute: ActivatedRoute, router: Router);
ngOnInit(): void;
onAddGroupClick(): void;
ngOnDestroy(): void;
/**
* Updates the query parameter `showAddGroup` based on the value of `showAddGroup` property.
* - If `showAddGroup` is `true`, adds `showAddGroup=true` to the query parameters.
* - If `showAddGroup` is `false`, removes `showAddGroup` from the query parameters.
*/
private handleShowAddGroupQueryParam;
static ɵfac: i0.ɵɵFactoryDeclaration<GroupsComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<GroupsComponent, "c8y-groups-name", never, {}, {}, never, never, true, never>;
}
declare class SubAssetsComponent implements OnInit, OnDestroy {
private activeRoute;
private subAssetsService;
private contextRouteService;
private permissionsService;
moduleConfig: SubAssetsConfig;
private router;
private SHOW_ADD_GROUP;
group: IManagedObject;
currentGroupId: string;
showChildrenForDevice: IManagedObject;
title: string;
toggle: boolean;
showAddGroup: i0.WritableSignal<boolean>;
showAssignDevices: boolean;
requestInProgress: boolean;
showAssignChildDevices: boolean;
refresh: EventEmitter<any>;
filterable: boolean;
shouldDisableAddGroup: boolean;
shouldDisableAssignDevices: boolean;
shouldShowAssetsProperties: boolean;
displayOptions: DisplayOptions;
customProperties: IManagedObject[];
isSmartGroup: boolean;
destroyed: Subject<void>;
constructor(activeRoute: ActivatedRoute, subAssetsService: SubAssetsService, contextRouteService: ContextRouteService, permissionsService: Permissions, moduleConfig: SubAssetsConfig, router: Router);
ngOnInit(): Promise<void>;
init(contextData: any): Promise<void>;
groupChange(group: IManagedObject): void;
onAddGroupClick(): void;
ngOnDestroy(): void;
/**
* Updates the query parameter `showAddGroup` based on the value of `showAddGroup` property.
* - If `showAddGroup` is `true`, adds `showAddGroup=true` to the query parameters.
* - If `showAddGroup` is `false`, removes `showAddGroup` from the query parameters.
*/
private handleShowAddGroupQueryParam;
static ɵfac: i0.ɵɵFactoryDeclaration<SubAssetsComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<SubAssetsComponent, "c8y-sub-assets", never, {}, {}, never, never, true, never>;
}
declare class UnassignModalComponent {
private translateService;
private gainsightService;
CURRENT_LOCATION: string;
asset: IManagedObject;
modalRef: ConfirmModalComponent;
message: string;
closeSubject: Subject<boolean>;
labels: ModalLabels;
title: "Unassign";
status: StatusType;
constructor(translateService: TranslateService, gainsightService: GainsightService);
ngOnInit(): void;
ngAfterViewInit(): Promise<void>;
onClose(): void;
onDismiss(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<UnassignModalComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<UnassignModalComponent, "c8y-unassign-modal", never, { "asset": { "alias": "asset"; "required": false; }; }, {}, never, never, true, never>;
}
declare const defaultMapLocation: {
readonly lat: number;
readonly lng: number;
};
declare class AssetLocationComponent implements OnInit, OnChanges, OnDestroy {
private activatedRouter;
private mapService;
mapView: MapComponent;
isEdit: boolean;
locationMO: IManagedObject;
form: FormGroup;
config: MapConfig;
assets: PositionManagedObject;
isMarkerDraggable: boolean;
isMapClickable: boolean;
dragListener: L.LeafletEventHandlerFn;
formSubscription: Subscription;
showMap: boolean;
constructor(activatedRouter: ActivatedRoute, mapService: MapService);
ngOnInit(): Promise<void>;
ngOnChanges(changes: SimpleChanges): void;
ngOnDestroy(): void;
/**
* This command is used to prefill the latitude and longitude values in the form when the marker is dragged.
*/
onMarkerDrag(event: L.LeafletEvent): void;
/**
* This method is used to update the marker with the specified values and if any one of the values is not availble, sets
* showWarning to true.
* @param latitude - The latitude of the marker
* @param longitude - The longitude of the marker
*/
updateMarker(latitude: number, longitude: number): void;
/**
* This command is used to prefill the latitude and longitude values in the form on click of map.
*/
onClickOfMap(event: L.LeafletMouseEvent): void;
/**
* Used to enable full screen of the map.
*/
enableFullscreen(): void;
/**
* Checks if any one of the values i.e., latitude/longitude is undefined or null.
* @param latitude Latitude value of the position
* @param longitude Longitude value of the position
* @returns returns true if any one of the values are both the values are missing else it returns false.
*/
checkIfAnyValueIsMissing(latitude: number, longitude: number): boolean;
/**
* Sets the view of the map based on the position of marker.
* @param latitude - Latitude of the marker
* @param longitude Longitude of the marker
*/
setView(latitude: number, longitude: number): void;
setLatLngValues(latitude: number, longitude: number): [number, number];
private isNullOrUndefined;
static ɵfac: i0.ɵɵFactoryDeclaration<AssetLocationComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<AssetLocationComponent, "c8y-asset-location", never, { "isEdit": { "alias": "isEdit"; "required": false; }; "locationMO": { "alias": "locationMO"; "required": false; }; "form": { "alias": "form"; "required": false; }; }, {}, never, never, true, never>;
}
declare class SubAssetsModule {
static config(config?: SubAssetsConfig): ModuleWithProviders<SubAssetsModule>;
static ɵfac: i0.ɵɵFactoryDeclaration<SubAssetsModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<SubAssetsModule, never, [typeof i1.CoreModule, typeof i2.DeviceGridModule, typeof AddGroupModule, typeof i4.PopoverModule, typeof i4$1.BsDropdownModule, typeof i5.TooltipModule, typeof i1.FilterMapperModule, typeof i7.MapModule, typeof i8.AssetTypeCellRendererComponent, typeof SubAssetsGridsModule, typeof SubAssetsComponent, typeof GroupsComponent, typeof GroupInfoComponent, typeof DeleteAssetsModalComponent, typeof UnassignModalComponent, typeof AssetPropertiesComponent, typeof AssetPropertiesItemComponent, typeof AssetLocationComponent], [typeof SubAssetsGridComponent, typeof AssetLocationComponent]>;
static ɵinj: i0.ɵɵInjectorDeclaration<SubAssetsModule>;
}
export { AddGroupComponent, AddGroupModule, AddGroupService, AssetLocationComponent, AssetPropertiesComponent, AssetPropertiesItemComponent, AssignChildDevicesComponent, AssignDevicesComponent, DeleteAssetsModalComponent, GroupInfoComponent, GroupsComponent, SmartGroupGridConfigurationStrategy, SubAssetsComponent, SubAssetsGridComponent, SubAssetsGridConfigurationStrategy, SubAssetsModule, SubAssetsService, UnassignModalComponent, defaultMapLocation };
export type { AssetPropertiesItem, DeleteModalCheckboxes, GroupForm, SubAssetsGridConfigContext };
//# sourceMappingURL=index.d.ts.map