import { DataUnit, OverflowWatcher } from '@sankhyalabs/core'; import { IAction } from '@sankhyalabs/ezui/dist/types/utils'; import { EventEmitter, VNode } from '../../stencil-public-runtime'; import { PresentationMode } from '../../lib/@types'; import { SnkMessageBuilder } from '../../lib/message/SnkMessageBuilder'; import { SnkApplication } from '../snk-application/snk-application'; import { DataState } from '../snk-data-unit/snk-data-unit'; import { TaskbarElement } from './elements/taskbar-elements'; export declare class SnkTaskbar { readonly TASKBAR_ITEM_ID_PREFIX = "TASKBAR_ITEM_"; readonly TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME = "taskbar-custom-elements-container"; readonly ACTIONS_BUTTON_TAG = "TASKBAR-ACTIONS-BUTTON"; readonly NOT_OVERFLOW_ELEMENTS: string[]; readonly TASKBAR_CUSTOM_ELEMENTS = "taskbar-custom-elements-container"; _application: SnkApplication; _definitions: Array; _overFlowWatcher: OverflowWatcher; _dataUnitInitialized: boolean; private _element; _permissions: any; _overFlowedElements: HTMLElement[]; _customElements: Map; _customElementsId: Array; _slotContainer: Element; _hiddenActionsList: Array; _lastWidth: number | undefined; _hasToUpdateOverFlow: boolean; _isWaitingForSave: boolean; /** * @description Define o alinhamento dos itens da barra de tarefas à direita. */ alignRigth: boolean; /** * @description Define o identificador do slot que recebe elementos personalizados. */ customSlotId: string; /** * @description Define o identificador do contêiner na DOM que é responsável por guardar os elementos personalizados * que não podem ser passados por slot. * @example * Elementos customizados na Taskbar da aba de detalhes. */ customContainerId: string; /** * @description Define como será o comportamento da barra de tarefas quando ocorrer um overflow de itens. */ overflowStrategy: 'hiddenItems' | 'none'; /** * @description Nome da configuração usada para salvar ou recuperar as configurações do formulário. Também é utilizado como fallback para a chave de armazenamento do exportador de dados. */ configName: string; /** * @description Identificador de recursos, como configurações e permissões de acesso. */ resourceID: string; /** * @description Lista de botões, separados por vírgula, que define todos os elementos a serem criados na barra de tarefas. */ buttons: string; /** * @description Mapa com definições de botões personalizados. A chave do mapa deve ser informada na propriedade `buttons` no local onde o botão deve ser renderizado. */ customButtons: Map; /** * @description Lista de ações a serem exibidas no botão "Mais opções". */ actionsList: Array; /** * @description Lista de ações que devem ser usadas no botão "Mais opções" do componente snk-taskbar. */ actionsSettingsList: Array; /** * @description Define qual botão deve ter a aparência de destaque (primário). */ primaryButton: string; /** * @description Array contendo os identificadores de todos os botões que devem ser desabilitados. */ disabledButtons: Array; /** * @description Instância do `DataUnit` com a qual a barra de tarefas irá interagir para realizar operações de dados (ex: salvar, próximo, anterior). */ dataUnit: DataUnit; /** * @description Altera o modo de apresentação dos botões da barra de tarefas. */ presentationMode: PresentationMode; /** * @description Responsável por flexibilizar e padronizar o uso de mensagens nos blocos de construção. */ messagesBuilder: SnkMessageBuilder; /** * @description Emitido sempre que um botão ou uma ação da barra de tarefas é clicado. * @eventProperty */ actionClick: EventEmitter; /** * @description Emitido quando uma ação de salvar é iniciada pela barra de tarefas, indicando um estado de bloqueio para evitar ações concorrentes. * @eventProperty */ taskbarSaveLocker: EventEmitter; /** * @description Emitido quando a ação de salvar é concluída ou cancelada, liberando o estado de bloqueio. * @eventProperty */ taskbarSaveUnlocker: EventEmitter; handleCustomSlotElementsLoaded(event: CustomEvent): void; handleTaskbarSaveLocker(): void; handleTaskbarSaveUnlocker(): void; private hasToSearchCustomElements; _titleKeyByElement: { UPDATE_MULTIPLE: string; UPDATE: string; PREVIOUS: string; NEXT: string; REFRESH: string; CLONE: string; REMOVE: string; MORE_OPTIONS: string; INSERT: string; CANCEL: string; SAVE: string; GRID_MODE: string; FORM_MODE: string; CONFIGURATOR: string; ATTACH: string; }; observeButtons(): void; observeDisabledButtons(): void; observeLastWidth(newValue: any, oldValue: any): void; observeIsWaitingForSave(newValue: any, oldValue: any): void; observeDataUnit(newValue: DataUnit): void; initializeDataUnit(dataUnit: DataUnit): void; elementsFromString(strButtons: string): Array; private isAllowed; /** * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção * através de um pequeno modulo na estrutura da aplicação: * - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js. * Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-taskbar.msg.ts" */ private getTitle; private elementClick; private isEnabled; private validatePresentationMode; getElement(index: number, def: TaskbarElement | CustomButton): HTMLElement; buildDynamicActionsList(): Array; buildActionsSettingsList(): Array; getIdElemBtnNative(taskbarElem: TaskbarElement): string; getIdElemBtnCustom(btnCustom: CustomButton): string; isDivider(element: VNode): boolean; removeEmpty(elements: Array): VNode[]; private appendCustomElementsInTaskbar; private addCustomElementContainer; private getCustomElements; private buildSlotContainer; private onSaveEvent; componentWillLoad(): void; componentWillRender(): void; private handleDefinitions; private updateOverFlowIfNeeded; private handleOverFlow; private resetOverFlowedElements; private doOverFlowElements; private addItemToActionList; private getTaskbarElementName; private getTaskbarElementIcon; private getTaskbarElementLabel; private hasToIgnoreOverFlow; private handleOverFlowStrategy; private buildOverFlowWatcherParams; componentDidLoad(): void; componentDidRender(): void; private updateLastWidth; disconnectedCallback(): void; private unlinkAllCustomElements; private unlinkCustomElementFromTaskbar; render(): any; private getHostClasses; } export interface Action extends IAction { type?: 'divider' | 'item'; children?: Array; subAction?: TaskBarSubAction; group?: string | TaskBarGroup; disableCloseOnSelect?: boolean; eagerInitialize?: boolean; } export interface TaskBarSubAction { id: string; value?: string; label: string; type: 'primary' | 'critical'; } export interface TaskBarGroup { label: string; order?: number; } export interface CustomButton { name: string; hint: string; text?: string; iconName?: string; } export interface TaskbarManager { getButtons: (taskbarId: string, dataState: DataState, currentButtons: Array) => Array; getMoreOptions?: (taskbarId: string, configName: string, dataState: DataState, currentActions: Array) => Array; isEnabled?: (taskbarId: string, dataState: DataState, buttonName: string, currentValue: boolean) => boolean; }