import * as i0 from '@angular/core'; import { OnDestroy, Type, InjectionToken, OnChanges, OnInit, EventEmitter, SimpleChanges, ElementRef, ChangeDetectorRef } from '@angular/core'; import * as i7 from '@sinequa/core/intl'; import { AbstractIntlPipe, IntlService } from '@sinequa/core/intl'; import { AppService } from '@sinequa/core/app-utils'; import { LabelsWebService, PrincipalWebService, LabelsRights, Record, Results } from '@sinequa/core/web-services'; import { Observable, Subscription } from 'rxjs'; import * as i15 from '@sinequa/components/action'; import { Action } from '@sinequa/components/action'; import { SearchService } from '@sinequa/components/search'; import * as i12 from '@sinequa/components/selection'; import { SelectionService } from '@sinequa/components/selection'; import { ModalService, ModalResult, ModalButton, ModalRef } from '@sinequa/core/modal'; import { NotificationsService } from '@sinequa/core/notification'; import * as i11 from '@sinequa/components/autocomplete'; import { Autocomplete, AutocompleteItem } from '@sinequa/components/autocomplete'; import * as i5 from '@angular/forms'; import { UntypedFormControl, UntypedFormGroup, UntypedFormBuilder } from '@angular/forms'; import * as i6 from '@angular/common'; import * as i8 from '@sinequa/core/validation'; import * as i9 from '@sinequa/components/utils'; import * as i10 from '@sinequa/components/modal'; import { LoginService } from '@sinequa/core/login'; declare class LabelPipe extends AbstractIntlPipe { updateValue(value: string, _public?: boolean): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } interface LabelsComponents { renameModal: Type; labelsAutocompleteComponent: Type; deleteModal: Type; addModal: Type; editModal: Type; } interface ModalProperties { public: boolean; allowEditPublicLabels: boolean; allowManagePublicLabels: boolean; allowNewLabels: boolean; disableAutocomplete: boolean; action: number; radioButtons: any[]; } declare const enum UpdateLabelsAction { add = 0, remove = 1, rename = 2, delete = 3, bulkAdd = 4, bulkRemove = 5, edit = 6 } declare const LABELS_COMPONENTS: InjectionToken; declare class LabelsService implements OnDestroy { private labelsWebService; private appService; private searchService; private modalService; private principalWebService; private intlService; private notificationService; private selectionService; labelsComponents: LabelsComponents; private static readonly defaultLabelsRights; private labelsRightsSubscription; private labelsRights; constructor(labelsWebService: LabelsWebService, appService: AppService, searchService: SearchService, modalService: ModalService, principalWebService: PrincipalWebService, intlService: IntlService, notificationService: NotificationsService, selectionService: SelectionService, labelsComponents: LabelsComponents); get publicLabelsField(): string | undefined; get privateLabelsField(): string | undefined; get labelsAutoSuggestWildcard(): string | undefined; get allowPublicLabelsManagement(): boolean; get allowPublicLabelsEdition(): boolean; get userLabelsRights(): LabelsRights; ngOnDestroy(): void; /** From navbar */ renameLabelModal(): Promise; deleteLabelModal(): Promise; bulkAddLabelModal(): Promise; bulkRemoveLabelModal(): Promise; private _modalProperties; private _getModalRadioButtonsConf; /** END From navbar */ /** From result selector */ buildSelectionAction(): Action | undefined; editLabelModal(): Promise; /** END result selector */ addLabels(labels: string[], ids: string[], _public: boolean): Observable; removeLabels(labels: string[], ids: string[], _public: boolean): Observable; selectLabels(labels: string[], _public: boolean): Promise; /** * Retrieves the labels that are not in the current filters of breadcrumbs * * @param field The column index containing the labels. * @returns The selected labels */ private getSelectedLabels; renameLabels(labels: string[], newLabel: string, _public: boolean): Observable; deleteLabels(labels: string[], _public: boolean): Observable; bulkAddLabels(labels: string[], _public: boolean): Observable; bulkRemoveLabels(labels: string[], _public: boolean): Observable; sort(labels: string[]): string[]; split(labels: string): string[]; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class Labels implements OnChanges { private appService; private labelsService; record: Record; public: boolean; enableDelete: boolean; /** Display the delete button in the label tag */ protected labelsField: string; showLabels: boolean; labels: string[]; hostClasses: any; constructor(appService: AppService, labelsService: LabelsService); ngOnChanges(): void; private makeLabels; select(label: string): void; remove(index: number): void; canRemove(): boolean; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ResultLabels { record: Record; caption: string; public: boolean; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class LabelsAutocomplete extends Autocomplete implements OnInit, OnChanges { private labelsWebService; private labelsService; /** Event synchronizing the list of selected labels in the parent component */ itemsUpdate: EventEmitter; /** Whether the labels are public or not */ public: boolean; /** Enable adding new labels in labelsItems or not */ allowNewLabels: boolean; /** Define the right of adding new labels in labelsItems or not */ allowManagePublicLabels: boolean; /** Stores the selected labels items selected via Tab */ labelsItems: AutocompleteItem[]; /** Stores the suggestions retrieved by th server in order to perform checks on key.enter events */ private _suggestions; constructor(labelsWebService: LabelsWebService, labelsService: LabelsService); /** * The ngOnInit() method from the original directive is overriden * On initialization, we listen to the autocomplete component for * selection events */ ngOnInit(): void; /** * If the inputs changes state, react accordingly * @param changes */ ngOnChanges(changes: SimpleChanges): void; /** * The getSuggests() method from the original directive is overriden to * use the labelsService rather than suggest service. */ protected getSuggests(): void; private _getLabelsSuggestions; /** * The setAutocompleteItem() method from the original directive is overriden to * Sets the content of the based on the given * Autocomplete Item. * @returns false since labels items don't need to be searched */ protected setAutocompleteItem(item: AutocompleteItem): boolean; /** * The startOrActive() method from the original directive is overriden to * immediately switch to ACTIVE if it is not the case */ protected startOrActive(): void; /** * Listen to user's keyboard actions in the , in order to navigate * and select the autocomplete suggestions. * Overrides the parent keydown method, adds the management of the backspace key * to remove labels items, enhance the enter key to support adding new labels. * @param event the keyboard */ keydown(event: KeyboardEvent): false | undefined; /** * Listens to focus events on the host and overrides the parent focus events in order to launch the autocomplete * If empty input : * - display top relevent labels if the auto-suggest wildcard is configured * - restart the autocomplete if no auto-suggest wildcard is found * If not empty input : * retrieve suggestions based on this input text */ focus(): void; /** * Listens to blur events (out of focus) on the host and overrides the parent blur events */ blur(event: FocusEvent): void; /** * Overrides the parent inputChanged method, so that it is possible to reinitialize the autocomplete * @param event */ inputChanged(event: Event): void; /** * Updates the 's placeholder to avoid displaying something * when there are labelsItems displayed to the left. */ updatePlaceholder(): void; private _manageSetAutocompleteItem; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class LabelsModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } /** * Component containing a form and autocomplete to search * through the list labels according to a specific type (public/private) and select one(s) of them * * The component can be used as custom component in the Action * menu's modals. */ declare class BsLabelsAutocompleteComponent implements OnChanges { private elementRef; /** Event synchronizing the list of selected labels and label's type in the parent component */ labelsUpdate: EventEmitter; public: boolean; /** Whether labels are public/private */ disableAutocomplete: boolean; allowNewLabels: boolean; /** Whether enable adding new labels or not */ allowManagePublicLabels: boolean; /** Define the right of adding new labels */ initLabels: string[]; /** Initial labels to be displayed in the labelsAutocomplete input*/ labelsItems: AutocompleteItem[]; /** List of assigned labels to selected record(s) */ constructor(elementRef: ElementRef); ngOnChanges(changes: SimpleChanges): void; removeItem(item: AutocompleteItem): void; onLabelsItemsChanged(labelsItems: AutocompleteItem[]): void; private getDropdownItem; keydown(event: KeyboardEvent): false | undefined; keypress(event: KeyboardEvent): false | undefined; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class BsRenameLabel implements OnInit, OnDestroy { model: { oldValues: string[]; newValue: string; properties: ModalProperties; }; private formBuilder; private labelsService; private changeDetectorRef; private modalRef; labelControl: UntypedFormControl; form: UntypedFormGroup; formChanges: Subscription; buttons: ModalButton[]; isProcessing: boolean; constructor(model: { oldValues: string[]; newValue: string; properties: ModalProperties; }, formBuilder: UntypedFormBuilder, labelsService: LabelsService, changeDetectorRef: ChangeDetectorRef, modalRef: ModalRef); ngOnInit(): void; ngOnDestroy(): void; updateLabelsNature(nature: boolean): void; onLabelsChanged(values: string[]): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class BsLabelsMenuComponent implements OnInit, OnChanges, OnDestroy { loginService: LoginService; labelsService: LabelsService; results: Results; icon: string; autoAdjust: boolean; autoAdjustBreakpoint: string; collapseBreakpoint: string; size: string; menu: Action | undefined; renameAction: Action; deleteAction: Action; bulkAddAction: Action; bulkDeleteAction: Action; private _loginServiceSubscription; constructor(loginService: LoginService, labelsService: LabelsService); ngOnInit(): void; ngOnDestroy(): void; ngOnChanges(changes: SimpleChanges): void; updateMenu(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class BsDeleteLabel implements OnInit { model: { values: string[]; properties: ModalProperties; }; private labelsService; private changeDetectorRef; private modalRef; buttons: ModalButton[]; title: string; alert: string; btnText: string; isProcessing: boolean; private _action; constructor(model: { values: string[]; properties: ModalProperties; }, labelsService: LabelsService, changeDetectorRef: ChangeDetectorRef, modalRef: ModalRef); ngOnInit(): void; updateLabelsNature(nature: boolean): void; onLabelsChanged(values: string[]): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class BsAddLabel implements OnInit { model: { values: string[]; properties: ModalProperties; }; private labelsService; private changeDetectorRef; private modalRef; buttons: ModalButton[]; isProcessing: boolean; constructor(model: { values: string[]; properties: ModalProperties; }, labelsService: LabelsService, changeDetectorRef: ChangeDetectorRef, modalRef: ModalRef); ngOnInit(): void; updateLabelsNature(nature: boolean): void; onLabelsChanged(values: string[]): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class BsEditLabel implements OnInit { model: { valuesToBeAdded: string[]; valuesToBeRemoved: string[]; properties: ModalProperties; }; private appService; private selectionService; private labelsService; private searchService; private notificationService; private changeDetectorRef; private modalRef; selectedRecordsIds: string[]; buttons: ModalButton[]; /** Initial labels list assigned to a record */ initialLabels: string[]; record: Record | undefined; isProcessing: boolean; constructor(model: { valuesToBeAdded: string[]; valuesToBeRemoved: string[]; properties: ModalProperties; }, appService: AppService, selectionService: SelectionService, labelsService: LabelsService, searchService: SearchService, notificationService: NotificationsService, changeDetectorRef: ChangeDetectorRef, modalRef: ModalRef); ngOnInit(): void; updateLabelsNature(nature: boolean): void; onLabelsChanged(values: string[]): void; onLabelsToBeAddedChanged(values: string[]): void; onLabelsToBeRemovedChanged(values: string[]): void; /** * Return the list of labels already assigned to the selected record */ private _getInitialRecordLabels; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare const defaultLabelComponents: LabelsComponents; declare class BsLabelsModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare const enLabels: any; declare const frLabels: any; declare const deLabels: any; export { BsAddLabel, BsDeleteLabel, BsEditLabel, BsLabelsAutocompleteComponent, BsLabelsMenuComponent, BsLabelsModule, BsRenameLabel, LABELS_COMPONENTS, LabelPipe, Labels, LabelsAutocomplete, LabelsModule, LabelsService, ResultLabels, UpdateLabelsAction, deLabels, defaultLabelComponents, enLabels, frLabels }; export type { LabelsComponents, ModalProperties };