@tooark/web-components 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -7
- package/README.pt-BR.md +15 -7
- package/dist/index.cjs +8050 -3572
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +709 -11
- package/dist/index.d.ts +709 -11
- package/dist/index.js +8043 -3574
- package/dist/index.js.map +1 -1
- package/dist/styles.css +2 -2
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ArkButtonStatus, ArkButtonType, ArkCalendarEvent, ArkColorSwatch, ArkDialogCloseReason, ArkDrawerSide, ArkDrawerMode, ArkDrawerCloseReason, ArkKvRow, ArkKvBulkFormat, ArkKvValueField, ArkMarkShape, ArkSchedulerEvent, ArkSchedulerView, ArkSelectOption, ArkSplitPaneDirection, ArkToastOptions } from '@tooark/core';
|
|
1
|
+
import { ArkButtonStatus, ArkButtonType, ArkCalendarEvent, ArkColorSwatch, ArkDataViewRow, ArkDataViewColumn, ArkDataViewKey, ArkDataViewCardRender, ArkDataViewView, ArkDataViewLayout, ArkDataViewMode, ArkDataViewSort, ArkDataViewQuery, ArkDialogCloseReason, ArkDrawerSide, ArkDrawerMode, ArkDrawerCloseReason, ArkKvRow, ArkKvBulkFormat, ArkKvValueField, ArkMarkShape, ArkNavVariant, ArkNavSide, ArkNavCollapsible, ArkSchedulerEvent, ArkSchedulerView, ArkSelectOption, ArkSplitPaneDirection, ArkTimeFormat, ArkToastOptions, ArkTreeSelection } from '@tooark/core';
|
|
2
2
|
|
|
3
3
|
/** `HTMLElement` no navegador; fora dele, uma classe vazia para o módulo poder ser importado no servidor. */
|
|
4
4
|
declare const HTMLElementBase: typeof HTMLElement;
|
|
@@ -104,10 +104,13 @@ declare class ArkBadge extends HTMLElementBase {
|
|
|
104
104
|
*
|
|
105
105
|
* O PRÓPRIO host é o controle: recebe as classes, `role="button"`, foco,
|
|
106
106
|
* teclado (Enter/Espaço) e participa de formulários via ElementInternals
|
|
107
|
-
* (`type="submit"`/`"reset"
|
|
107
|
+
* (`type="submit"`/`"reset"`; o primeiro de submit é o botão padrão do Enter
|
|
108
|
+
* nos campos do formulário). Nenhum filho do usuário é movido ou envolvido,
|
|
108
109
|
* então frameworks que gerenciam os filhos (React, Vue, Angular) continuam
|
|
109
110
|
* donos deles. Com `href`, um `<a>` "esticado" cobre o host, recebe o foco e
|
|
110
|
-
* é nomeado pelo conteúdo do host (`aria-labelledby`)
|
|
111
|
+
* é nomeado pelo conteúdo do host (`aria-labelledby`); `download` passa ao
|
|
112
|
+
* `<a>`, e um clique simples no link emite `ark-navigate` cancelável antes de
|
|
113
|
+
* o navegador seguir o `href`, para um app SPA rotear, como no ark-nav-item.
|
|
111
114
|
*/
|
|
112
115
|
declare class ArkButton extends HTMLElementBase {
|
|
113
116
|
static readonly tagName: string;
|
|
@@ -120,6 +123,8 @@ declare class ArkButton extends HTMLElementBase {
|
|
|
120
123
|
private ownClasses;
|
|
121
124
|
private syncingClass;
|
|
122
125
|
private formDisabled;
|
|
126
|
+
/** Listener único de Enter no documento, instalado pelo primeiro botão conectado. */
|
|
127
|
+
private static implicitSubmitInstalled;
|
|
123
128
|
/**
|
|
124
129
|
* Atributos observados pelo componente, a que ele reage em attributeChangedCallback.
|
|
125
130
|
* @returns Array de nomes de atributos observados.
|
|
@@ -182,6 +187,18 @@ declare class ArkButton extends HTMLElementBase {
|
|
|
182
187
|
* @param event Evento de clique.
|
|
183
188
|
*/
|
|
184
189
|
private readonly handleClick;
|
|
190
|
+
private static installImplicitSubmit;
|
|
191
|
+
/** Enter num campo de texto do formulário clica o primeiro `ark-button` de submit, como o botão padrão nativo. */
|
|
192
|
+
private static readonly handleImplicitSubmit;
|
|
193
|
+
/** Primeiro `ark-button` de submit do formulário, ou nenhum quando há um submit nativo (o navegador já o clica). */
|
|
194
|
+
private static defaultButton;
|
|
195
|
+
/**
|
|
196
|
+
* Link: um clique simples emite `ark-navigate` (cancelável, `detail: { href }`) antes de o navegador seguir o
|
|
197
|
+
* `href`; um app SPA cancela e roteia. Modificadores, outro botão do mouse, `target` de outra janela e `download`
|
|
198
|
+
* são do navegador (nova aba, janela, arquivo): sem evento, como fazem os routers e o ark-nav-item. Um clique já
|
|
199
|
+
* cancelado também passa direto, então quem ainda intercepta o clique por conta própria não navega duas vezes.
|
|
200
|
+
*/
|
|
201
|
+
private handleLinkClick;
|
|
185
202
|
/**
|
|
186
203
|
* Manipula o pressionamento de tecla no botão, tratando Enter e Espaço.
|
|
187
204
|
* @param event Evento de teclado.
|
|
@@ -249,6 +266,7 @@ declare class ArkCalendar extends HTMLElementBase {
|
|
|
249
266
|
private justSelectedISO;
|
|
250
267
|
static get observedAttributes(): string[];
|
|
251
268
|
connectedCallback(): void;
|
|
269
|
+
disconnectedCallback(): void;
|
|
252
270
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
253
271
|
/** Lista de eventos (propriedade JS; tem precedência sobre o atributo `events`). */
|
|
254
272
|
get events(): ArkCalendarEvent[];
|
|
@@ -293,10 +311,12 @@ declare class ArkCalendar extends HTMLElementBase {
|
|
|
293
311
|
* filhos do usuário ficam onde estão: `slot="header"` e `slot="actions"` na
|
|
294
312
|
* linha de cima (título à esquerda, ações à direita), `slot="footer"` na
|
|
295
313
|
* última linha, com divisor, e os demais são o corpo, na largura toda e na
|
|
296
|
-
* ordem do DOM. `heading` cria um h2 próprio no início do host
|
|
297
|
-
* `slot="header"` do usuário vira a linha
|
|
314
|
+
* ordem do DOM. `heading` cria um h2 próprio no início do host (outro nível
|
|
315
|
+
* com `heading-level`); com ele, o `slot="header"` do usuário vira a linha
|
|
316
|
+
* seguinte do cabeçalho. `padding`
|
|
298
317
|
* escala o espaçamento interno (padding do host e gap entre as linhas) e
|
|
299
|
-
* `rounded` os cantos.
|
|
318
|
+
* `rounded` os cantos. `wrap-actions` (só CSS) faz as ações quebrarem linha em
|
|
319
|
+
* vez de esmagar o título. Não é interativo e não tem role próprio.
|
|
300
320
|
*/
|
|
301
321
|
declare class ArkCard extends HTMLElementBase {
|
|
302
322
|
static readonly tagName = "ark-card";
|
|
@@ -455,6 +475,7 @@ declare class ArkClock extends HTMLElementBase {
|
|
|
455
475
|
private syncingValue;
|
|
456
476
|
static get observedAttributes(): string[];
|
|
457
477
|
connectedCallback(): void;
|
|
478
|
+
disconnectedCallback(): void;
|
|
458
479
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
459
480
|
get value(): string;
|
|
460
481
|
set value(value: string | null | undefined);
|
|
@@ -663,6 +684,215 @@ declare class ArkCopyButton extends ArkButton {
|
|
|
663
684
|
protected updateAppearance(): void;
|
|
664
685
|
}
|
|
665
686
|
|
|
687
|
+
/**
|
|
688
|
+
* Coleção de registros em duas apresentações, tabela e cards. Recebe `rows`
|
|
689
|
+
* (objetos do app, guardados por referência) e `columns` (qual campo aparece,
|
|
690
|
+
* onde e como) e desenha tudo: não há filhos do usuário no conteúdo, só nos
|
|
691
|
+
* slots `toolbar` (ações ao lado da busca), `selection` (ações em massa,
|
|
692
|
+
* visíveis enquanto há seleção) e `empty` (estado vazio próprio), que ficam
|
|
693
|
+
* onde estão e são posicionados por CSS na grid do host; os nós do componente
|
|
694
|
+
* se encaixam em volta deles, para a ordem de tabulação seguir a visual.
|
|
695
|
+
*
|
|
696
|
+
* `view="auto"` (o padrão) mostra cards quando o PRÓPRIO componente fica mais
|
|
697
|
+
* estreito que `breakpoint` (ResizeObserver no host, não a largura da tela);
|
|
698
|
+
* "table" e "cards" fixam uma apresentação. A escolha do usuário no seletor
|
|
699
|
+
* do canto reescreve `view`; `no-view-selector` esconde o seletor e `view`
|
|
700
|
+
* continua valendo. No `mode="client"` o componente
|
|
701
|
+
* busca, ordena e pagina `rows`; no `mode="server"` ele só publica a consulta
|
|
702
|
+
* em `ark-query-change` e o app devolve `rows`, `total` e `loading`. O
|
|
703
|
+
* conteúdo de uma célula é o texto do campo ou o que `render` da coluna
|
|
704
|
+
* devolver (um nó ou um texto, nunca HTML). Opt-in: `searchable`,
|
|
705
|
+
* `page-size` (paginação), `selectable` (caixas de seleção), `reorderable`
|
|
706
|
+
* (alça de arrastar, com setas no teclado e um menu de mover no clique, para
|
|
707
|
+
* quem não arrasta) e `clickable` (linha focável que emite `ark-row-click`).
|
|
708
|
+
* Depois de cada redesenho do conteúdo o host emite `ark-render` (não sobe),
|
|
709
|
+
* para integrações que preenchem as células: os wrappers de framework põem
|
|
710
|
+
* JSX, slots e templates nos nós que o `render` deles devolve. Compõe
|
|
711
|
+
* ark-input, ark-select, ark-toggle-group, ark-checkbox, ark-button,
|
|
712
|
+
* ark-empty, ark-skeleton, ark-pagination e ark-menu.
|
|
713
|
+
*/
|
|
714
|
+
declare class ArkDataView extends HTMLElementBase {
|
|
715
|
+
static readonly tagName = "ark-data-view";
|
|
716
|
+
private rowsModel;
|
|
717
|
+
private columnsModel;
|
|
718
|
+
/** Seleção: a chave em texto (a do DOM) → a chave como o app a conhece. */
|
|
719
|
+
private selection;
|
|
720
|
+
/** Desenho próprio do corpo do card (`cardRender`); sem ele, a grade de campos. */
|
|
721
|
+
private cardFactory;
|
|
722
|
+
private searchEl;
|
|
723
|
+
private sortEl;
|
|
724
|
+
private viewsEl;
|
|
725
|
+
private selectionEl;
|
|
726
|
+
/** Caixa de selecionar tudo da barra de seleção, usada nos cards (a tabela tem a do cabeçalho). */
|
|
727
|
+
private selectionAllEl;
|
|
728
|
+
private selectionCountEl;
|
|
729
|
+
private clearEl;
|
|
730
|
+
private contentEl;
|
|
731
|
+
private footerEl;
|
|
732
|
+
private paginationEl;
|
|
733
|
+
/** Caixa de selecionar tudo do cabeçalho da tabela, refeita a cada renderização. */
|
|
734
|
+
private headAllEl;
|
|
735
|
+
/** Nó de cada registro visível (tr ou li), pela chave em texto. */
|
|
736
|
+
private rowEls;
|
|
737
|
+
/** Registros visíveis e os nós deles, na ordem da tela. */
|
|
738
|
+
private visible;
|
|
739
|
+
private rowOrder;
|
|
740
|
+
/** Consulta da última renderização, para `query` não refazer busca e ordenação. */
|
|
741
|
+
private computed;
|
|
742
|
+
private ownClasses;
|
|
743
|
+
private syncingClass;
|
|
744
|
+
private slotObserver;
|
|
745
|
+
private resizeObserver;
|
|
746
|
+
/** O host está mais estreito que `breakpoint`: `auto` vira cards e a barra de ferramentas empilha. */
|
|
747
|
+
private narrow;
|
|
748
|
+
/** Quadro agendado para reagir a uma mudança de largura. */
|
|
749
|
+
private resizeFrame;
|
|
750
|
+
private searchTimer;
|
|
751
|
+
private drag;
|
|
752
|
+
/** Quadro agendado da rolagem automática de um arrasto. */
|
|
753
|
+
private scrollFrame;
|
|
754
|
+
/** O clique que encerra um arrasto não abre o menu da alça. */
|
|
755
|
+
private suppressHandleClick;
|
|
756
|
+
/** Menu de mover da alça, criado no primeiro uso; o registro e a posição na tela sobre os quais ele age. */
|
|
757
|
+
private menuEl;
|
|
758
|
+
private menuTarget;
|
|
759
|
+
/** Registro cujo menu acabou de fechar sem escolha, e quando: o clique que o fechou não o reabre. */
|
|
760
|
+
private menuClosed;
|
|
761
|
+
/** Foco pedido para a próxima renderização (a alça do registro que o teclado acabou de mover). */
|
|
762
|
+
private pendingFocus;
|
|
763
|
+
/** Várias gravações de atributo numa só mudança (ordenação e página) renderizam uma vez, ao fim. */
|
|
764
|
+
private suspended;
|
|
765
|
+
static get observedAttributes(): string[];
|
|
766
|
+
connectedCallback(): void;
|
|
767
|
+
disconnectedCallback(): void;
|
|
768
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
769
|
+
/** Os registros (os mesmos objetos recebidos, numa lista nova); atribuir substitui tudo e renderiza de novo. */
|
|
770
|
+
get rows(): ArkDataViewRow[];
|
|
771
|
+
set rows(value: ArkDataViewRow[] | string | null | undefined);
|
|
772
|
+
/** As colunas (propriedade JS, a única forma de passar `render` e `compare`; o atributo aceita o JSON sem eles). */
|
|
773
|
+
get columns(): ArkDataViewColumn[];
|
|
774
|
+
set columns(value: ArkDataViewColumn[] | string | null | undefined);
|
|
775
|
+
/** Campo que identifica cada registro (atributo `row-key`). Padrão: "id". */
|
|
776
|
+
get rowKey(): string;
|
|
777
|
+
set rowKey(value: string | null | undefined);
|
|
778
|
+
/** Chaves selecionadas, na ordem em que foram marcadas; atribuir substitui a seleção sem emitir evento. */
|
|
779
|
+
get selected(): ArkDataViewKey[];
|
|
780
|
+
set selected(value: ArkDataViewKey[] | null | undefined);
|
|
781
|
+
/**
|
|
782
|
+
* Desenho próprio do corpo de cada card (propriedade JS), no lugar da grade de campos; `null` num card mantém a
|
|
783
|
+
* grade nele. Uma função nova refaz os cards.
|
|
784
|
+
*/
|
|
785
|
+
get cardRender(): ArkDataViewCardRender | null;
|
|
786
|
+
set cardRender(value: ArkDataViewCardRender | null | undefined);
|
|
787
|
+
/** Apresentação pedida: "table", "cards" ou "auto" (padrão), que segue a largura do componente. */
|
|
788
|
+
get view(): ArkDataViewView;
|
|
789
|
+
set view(value: ArkDataViewView | string | null | undefined);
|
|
790
|
+
/**
|
|
791
|
+
* Esconde o seletor de visualização do canto (atributo `no-view-selector`). `view` continua decidindo a
|
|
792
|
+
* apresentação: "auto" segue a largura, "table" e "cards" fixam uma.
|
|
793
|
+
*/
|
|
794
|
+
get noViewSelector(): boolean;
|
|
795
|
+
set noViewSelector(value: boolean | string | null | undefined);
|
|
796
|
+
/** Apresentação em uso: a de `view`, ou em "auto" a que a largura do componente pede. */
|
|
797
|
+
get resolvedView(): ArkDataViewLayout;
|
|
798
|
+
/** Largura do componente, em px, abaixo da qual "auto" mostra cards. Padrão: 640. */
|
|
799
|
+
get breakpoint(): number;
|
|
800
|
+
set breakpoint(value: number | string | null | undefined);
|
|
801
|
+
/** Colunas da grade de campos do card (atributo `card-columns`), de 1 a 4. Padrão: 2. */
|
|
802
|
+
get cardColumns(): number;
|
|
803
|
+
set cardColumns(value: number | string | null | undefined);
|
|
804
|
+
/** Quem busca, ordena e pagina: "client" (padrão, o componente) ou "server" (o app, a cada `ark-query-change`). */
|
|
805
|
+
get mode(): ArkDataViewMode;
|
|
806
|
+
set mode(value: ArkDataViewMode | string | null | undefined);
|
|
807
|
+
/** Página pedida, a partir de 1; a exibida é limitada ao total de páginas (ver `query`). Padrão: 1. */
|
|
808
|
+
get page(): number;
|
|
809
|
+
set page(value: number | string | null | undefined);
|
|
810
|
+
/** Itens por página (atributo `page-size`); 0, o padrão, mostra todos e esconde a paginação. */
|
|
811
|
+
get pageSize(): number;
|
|
812
|
+
set pageSize(value: number | string | null | undefined);
|
|
813
|
+
/** Opções do seletor de itens por página (atributo `page-sizes`, separado por vírgula); vazio esconde o seletor. */
|
|
814
|
+
get pageSizes(): number[];
|
|
815
|
+
set pageSizes(value: number[] | string | null | undefined);
|
|
816
|
+
/** Total de registros no servidor (modo "server"); `null` usa o tamanho de `rows`. */
|
|
817
|
+
get total(): number | null;
|
|
818
|
+
set total(value: number | string | null | undefined);
|
|
819
|
+
/** Ordenação atual, ou `null`; o atributo `sort` é "chave:asc" ou "chave:desc". */
|
|
820
|
+
get sort(): ArkDataViewSort | null;
|
|
821
|
+
set sort(value: ArkDataViewSort | string | null | undefined);
|
|
822
|
+
/** Texto da busca. */
|
|
823
|
+
get search(): string;
|
|
824
|
+
set search(value: string | null | undefined);
|
|
825
|
+
/** A consulta em uso: página exibida, itens por página, ordenação e busca. */
|
|
826
|
+
get query(): ArkDataViewQuery;
|
|
827
|
+
/** Campo de busca visível. */
|
|
828
|
+
get searchable(): boolean;
|
|
829
|
+
set searchable(value: boolean | string | null | undefined);
|
|
830
|
+
/** Caixa de seleção por registro e a de selecionar tudo. */
|
|
831
|
+
get selectable(): boolean;
|
|
832
|
+
set selectable(value: boolean | string | null | undefined);
|
|
833
|
+
/** Alça de reordenar por registro; inativa enquanto há ordenação ou busca. */
|
|
834
|
+
get reorderable(): boolean;
|
|
835
|
+
set reorderable(value: boolean | string | null | undefined);
|
|
836
|
+
/** Linha e card focáveis, que emitem `ark-row-click` ao clique, Enter ou Espaço. */
|
|
837
|
+
get clickable(): boolean;
|
|
838
|
+
set clickable(value: boolean | string | null | undefined);
|
|
839
|
+
/** Consulta em andamento: placeholders sem registros, ou os registros atuais esmaecidos, com `aria-busy`. */
|
|
840
|
+
get loading(): boolean;
|
|
841
|
+
set loading(value: boolean | string | null | undefined);
|
|
842
|
+
/** Limpa a seleção e emite `ark-selection-change`; sem seleção, não faz nada. */
|
|
843
|
+
clearSelection(): void;
|
|
844
|
+
private getLocale;
|
|
845
|
+
private getSize;
|
|
846
|
+
private keyOf;
|
|
847
|
+
private setRows;
|
|
848
|
+
private setColumns;
|
|
849
|
+
private compute;
|
|
850
|
+
/** Texto principal de um registro (a coluna de título, ou a primeira), para os rótulos acessíveis. */
|
|
851
|
+
private primaryText;
|
|
852
|
+
private changeQuery;
|
|
853
|
+
private resetPage;
|
|
854
|
+
private emitSelection;
|
|
855
|
+
private emitRowClick;
|
|
856
|
+
private toggleSort;
|
|
857
|
+
private applySort;
|
|
858
|
+
private scheduleSearch;
|
|
859
|
+
private commitSearch;
|
|
860
|
+
private readonly handleContentClick;
|
|
861
|
+
private readonly handleContentKeydown;
|
|
862
|
+
private readonly handleSelectChange;
|
|
863
|
+
private measureNarrow;
|
|
864
|
+
private handleResize;
|
|
865
|
+
private readonly handleDragStart;
|
|
866
|
+
private readonly handleDragMove;
|
|
867
|
+
private markDrop;
|
|
868
|
+
private readonly autoScroll;
|
|
869
|
+
private readonly handleDragEnd;
|
|
870
|
+
private readonly handleHandleClick;
|
|
871
|
+
private ensureMenu;
|
|
872
|
+
private readonly handleHandleKeydown;
|
|
873
|
+
private endDrag;
|
|
874
|
+
private dropIndexAt;
|
|
875
|
+
private moveRow;
|
|
876
|
+
private moveTo;
|
|
877
|
+
private arrangeChrome;
|
|
878
|
+
private render;
|
|
879
|
+
private fillCell;
|
|
880
|
+
private createHandle;
|
|
881
|
+
private createRowCheckbox;
|
|
882
|
+
private registerRow;
|
|
883
|
+
private buildTable;
|
|
884
|
+
private buildCards;
|
|
885
|
+
private buildSkeleton;
|
|
886
|
+
private renderContent;
|
|
887
|
+
private captureFocus;
|
|
888
|
+
private restoreFocus;
|
|
889
|
+
private syncSelection;
|
|
890
|
+
private syncOverflow;
|
|
891
|
+
private syncSlots;
|
|
892
|
+
private applyOwnClasses;
|
|
893
|
+
private updateAppearance;
|
|
894
|
+
}
|
|
895
|
+
|
|
666
896
|
/**
|
|
667
897
|
* Seletor de data/hora que compõe ark-input + ark-calendar + ark-clock.
|
|
668
898
|
*
|
|
@@ -726,6 +956,7 @@ declare class ArkDatepicker extends HTMLElementBase {
|
|
|
726
956
|
private emitChange;
|
|
727
957
|
private readonly handleCalendarChange;
|
|
728
958
|
private readonly handleClockChange;
|
|
959
|
+
/** Aplica o texto digitado no campo; `false` quando ele era inválido e o campo voltou ao último valor válido. */
|
|
729
960
|
private commitTyped;
|
|
730
961
|
private focusPanel;
|
|
731
962
|
private openPopup;
|
|
@@ -937,6 +1168,7 @@ declare class ArkFileInput extends HTMLElementBase {
|
|
|
937
1168
|
private selectionSeq;
|
|
938
1169
|
static get observedAttributes(): string[];
|
|
939
1170
|
connectedCallback(): void;
|
|
1171
|
+
disconnectedCallback(): void;
|
|
940
1172
|
attributeChangedCallback(): void;
|
|
941
1173
|
/** O <input type="file"> nativo oculto, para composição e para `setInputFiles` em testes. */
|
|
942
1174
|
get inputElement(): HTMLInputElement | null;
|
|
@@ -1080,6 +1312,7 @@ declare class ArkKvEditor extends HTMLElementBase {
|
|
|
1080
1312
|
static get observedAttributes(): string[];
|
|
1081
1313
|
constructor();
|
|
1082
1314
|
connectedCallback(): void;
|
|
1315
|
+
disconnectedCallback(): void;
|
|
1083
1316
|
attributeChangedCallback(name: string, _oldValue: string | null, newValue: string | null): void;
|
|
1084
1317
|
/** As linhas atuais (cópia); atribuir substitui tudo e renderiza de novo. */
|
|
1085
1318
|
get rows(): ArkKvRow[];
|
|
@@ -1167,7 +1400,8 @@ declare class ArkMark extends HTMLElementBase {
|
|
|
1167
1400
|
/**
|
|
1168
1401
|
* Menu suspenso ou de contexto. O PRÓPRIO host é o painel (`role="menu"`),
|
|
1169
1402
|
* aberto como `popover="auto"` (top layer, light dismiss e Esc nativos, sem
|
|
1170
|
-
* portal nem z-index): os itens `ark-menu-item` do usuário ficam onde estão
|
|
1403
|
+
* portal nem z-index): os itens `ark-menu-item` do usuário ficam onde estão,
|
|
1404
|
+
* soltos ou dentro de um `ark-menu-group` com rótulo, que as setas atravessam.
|
|
1171
1405
|
* O gatilho é referenciado por `for="<id>"`: o componente só escreve `aria-*`
|
|
1172
1406
|
* nele (haspopup, expanded, controls), escuta clique e setas, e nomeia o menu
|
|
1173
1407
|
* por ele. `openAt(x, y)` abre num ponto (menu de contexto).
|
|
@@ -1228,7 +1462,7 @@ declare class ArkMenu extends HTMLElementBase {
|
|
|
1228
1462
|
private getItems;
|
|
1229
1463
|
private enabledItems;
|
|
1230
1464
|
private focusItem;
|
|
1231
|
-
/** Propaga size/theme aos itens depois de mudanças nos filhos ou nos atributos. */
|
|
1465
|
+
/** Propaga size/theme aos itens e aos grupos depois de mudanças nos filhos ou nos atributos. */
|
|
1232
1466
|
private syncItems;
|
|
1233
1467
|
private readonly handleItemSelect;
|
|
1234
1468
|
private readonly handleKeydown;
|
|
@@ -1236,6 +1470,34 @@ declare class ArkMenu extends HTMLElementBase {
|
|
|
1236
1470
|
private updateAppearance;
|
|
1237
1471
|
}
|
|
1238
1472
|
|
|
1473
|
+
/**
|
|
1474
|
+
* Grupo nomeado de itens dentro de um ark-menu. O PRÓPRIO host é o grupo
|
|
1475
|
+
* (`role="group"`): os `ark-menu-item` do usuário ficam onde estão, e as setas,
|
|
1476
|
+
* Home e End do menu os atravessam como se estivessem soltos. `label` cria o
|
|
1477
|
+
* rótulo visível no início do host, que nomeia o grupo por `aria-labelledby`;
|
|
1478
|
+
* sem ele, um `aria-label` no host nomeia. `size` e `theme` chegam propagados
|
|
1479
|
+
* do ark-menu.
|
|
1480
|
+
*/
|
|
1481
|
+
declare class ArkMenuGroup extends HTMLElementBase {
|
|
1482
|
+
static readonly tagName = "ark-menu-group";
|
|
1483
|
+
private ownClasses;
|
|
1484
|
+
private syncingClass;
|
|
1485
|
+
/** Rótulo visível (nó próprio), presente só com `label`. */
|
|
1486
|
+
private labelEl;
|
|
1487
|
+
/** O `aria-labelledby` do host foi escrito pelo componente (aponta para o rótulo próprio). */
|
|
1488
|
+
private ownLabelledBy;
|
|
1489
|
+
static get observedAttributes(): string[];
|
|
1490
|
+
connectedCallback(): void;
|
|
1491
|
+
attributeChangedCallback(name: string): void;
|
|
1492
|
+
/** Rótulo visível do grupo, que também o nomeia. Padrão: nenhum. */
|
|
1493
|
+
get label(): string;
|
|
1494
|
+
set label(value: string | null | undefined);
|
|
1495
|
+
private labelClasses;
|
|
1496
|
+
private syncLabel;
|
|
1497
|
+
private applyOwnClasses;
|
|
1498
|
+
private updateAppearance;
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1239
1501
|
/**
|
|
1240
1502
|
* Item de um ark-menu. O PRÓPRIO host é o item (`role="menuitem"`, foco,
|
|
1241
1503
|
* teclado): ícone e texto são filhos livres e um filho `slot="trailing"`
|
|
@@ -1275,6 +1537,234 @@ declare class ArkMenuItem extends HTMLElementBase {
|
|
|
1275
1537
|
private updateAppearance;
|
|
1276
1538
|
}
|
|
1277
1539
|
|
|
1540
|
+
/**
|
|
1541
|
+
* Navegação do app. O PRÓPRIO host é o `role="navigation"` (classes, largura,
|
|
1542
|
+
* borda): os `ark-nav-item` e `ark-nav-group` do usuário ficam onde estão, um
|
|
1543
|
+
* filho `slot="header"` (logo) vai ao início e um `slot="footer"` (avatar,
|
|
1544
|
+
* seletor) ao fim, por CSS. Três apresentações: `sidebar` (coluna, padrão),
|
|
1545
|
+
* `navbar` (barra horizontal) e `tabbar` (abas de rodapé, ícone sobre o
|
|
1546
|
+
* texto). Na sidebar o cabeçalho, o rodapé e o botão de recolher ficam presos
|
|
1547
|
+
* nas pontas e só os itens rolam entre eles. Recolhida (`collapsed`) ela vira
|
|
1548
|
+
* um trilho de ícones ou, com `collapsible="hidden"`, só o logo e o botão de
|
|
1549
|
+
* expandir; `collapsible` também desenha o botão de recolher e o clique nele
|
|
1550
|
+
* emite `ark-collapse`. A navbar recolhida fica só com ícones (sem botão).
|
|
1551
|
+
* `value` marca o item atual pelo `value` (ou `href`) dele; o `ark-navigate`
|
|
1552
|
+
* cancelável de cada item sobe pelo host sem ser consolidado. O app posiciona
|
|
1553
|
+
* o componente (grid, `position: fixed` no tabbar): ele não faz layout de
|
|
1554
|
+
* página.
|
|
1555
|
+
*/
|
|
1556
|
+
declare class ArkNav extends HTMLElementBase {
|
|
1557
|
+
static readonly tagName = "ark-nav";
|
|
1558
|
+
private observer;
|
|
1559
|
+
private toggleEl;
|
|
1560
|
+
private toggleLabelEl;
|
|
1561
|
+
private ownClasses;
|
|
1562
|
+
private syncingClass;
|
|
1563
|
+
/** `aria-label` que o próprio componente escreveu a partir de `label`, para não apagar um do usuário. */
|
|
1564
|
+
private appliedLabel;
|
|
1565
|
+
static get observedAttributes(): string[];
|
|
1566
|
+
connectedCallback(): void;
|
|
1567
|
+
disconnectedCallback(): void;
|
|
1568
|
+
attributeChangedCallback(name: string): void;
|
|
1569
|
+
/** sidebar (coluna), navbar (barra) ou tabbar (abas de rodapé). Padrão: "sidebar". */
|
|
1570
|
+
get variant(): ArkNavVariant;
|
|
1571
|
+
set variant(value: ArkNavVariant | null | undefined);
|
|
1572
|
+
/** Borda em que a sidebar encosta (borda desenhada e direção do chevron). Padrão: "left". */
|
|
1573
|
+
get side(): ArkNavSide;
|
|
1574
|
+
set side(value: ArkNavSide | null | undefined);
|
|
1575
|
+
/** `value` (ou `href`) do item atual; sem o atributo cada item mantém o próprio `current`. */
|
|
1576
|
+
get value(): string;
|
|
1577
|
+
set value(value: string | null | undefined);
|
|
1578
|
+
/** Sidebar recolhida (atributo `collapsed`). */
|
|
1579
|
+
get collapsed(): boolean;
|
|
1580
|
+
set collapsed(value: boolean | string | null | undefined);
|
|
1581
|
+
/** Botão de recolher e o que resta recolhida: "rail" (ícones) ou "hidden" (só o logo). `null` sem o atributo. */
|
|
1582
|
+
get collapsible(): ArkNavCollapsible | null;
|
|
1583
|
+
set collapsible(value: ArkNavCollapsible | boolean | string | null | undefined);
|
|
1584
|
+
/** Nome acessível da navegação (`aria-label`), para distinguir vários `role="navigation"` na página. */
|
|
1585
|
+
get label(): string | null;
|
|
1586
|
+
set label(value: string | null | undefined);
|
|
1587
|
+
/** Recolhe ou expande a sidebar e emite `ark-collapse` com `detail: { collapsed }`, como o botão faz. */
|
|
1588
|
+
toggle(): void;
|
|
1589
|
+
/** Trilho (só ícones): a sidebar recolhida sem `collapsible="hidden"`, ou a navbar recolhida; o tabbar não recolhe. */
|
|
1590
|
+
private isRail;
|
|
1591
|
+
/** Só o cabeçalho e o botão: sidebar recolhida com `collapsible="hidden"`. */
|
|
1592
|
+
private isHidden;
|
|
1593
|
+
private getLocale;
|
|
1594
|
+
private getItems;
|
|
1595
|
+
private getGroups;
|
|
1596
|
+
/** Propaga variant/size/intent/theme e o estado de trilho a itens e grupos, marca o atual e os slots. */
|
|
1597
|
+
private syncChildren;
|
|
1598
|
+
private syncToggle;
|
|
1599
|
+
private computeClasses;
|
|
1600
|
+
private applyOwnClasses;
|
|
1601
|
+
private updateAppearance;
|
|
1602
|
+
private ringClass;
|
|
1603
|
+
}
|
|
1604
|
+
|
|
1605
|
+
/**
|
|
1606
|
+
* Seção de um ark-nav. O PRÓPRIO host é o grupo (`role="group"`, nomeado pelo
|
|
1607
|
+
* cabeçalho); os `ark-nav-item` do usuário ficam onde estão. `label` cria o
|
|
1608
|
+
* cabeçalho num nó próprio: um título de seção ou, com `expandable`, um botão
|
|
1609
|
+
* (`aria-expanded`) que abre e fecha os itens (`open`, refletido) e emite
|
|
1610
|
+
* `ark-toggle`. No trilho (sidebar recolhida) o cabeçalho some e o grupo vira
|
|
1611
|
+
* uma faixa separada por uma linha, com todos os itens à mostra; no navbar e
|
|
1612
|
+
* no tabbar o grupo não tem caixa (`display: contents`) e os itens entram na
|
|
1613
|
+
* barra. Tamanho e apresentação chegam propagados do ark-nav.
|
|
1614
|
+
*/
|
|
1615
|
+
declare class ArkNavGroup extends HTMLElementBase {
|
|
1616
|
+
static readonly tagName = "ark-nav-group";
|
|
1617
|
+
private ownClasses;
|
|
1618
|
+
private syncingClass;
|
|
1619
|
+
/** Cabeçalho próprio: `div` (título) ou `button` (expansível). */
|
|
1620
|
+
private headingEl;
|
|
1621
|
+
private readonly headingId;
|
|
1622
|
+
/** `aria-labelledby` que o próprio componente escreveu, para não apagar um do usuário. */
|
|
1623
|
+
private appliedLabelledBy;
|
|
1624
|
+
static get observedAttributes(): string[];
|
|
1625
|
+
connectedCallback(): void;
|
|
1626
|
+
attributeChangedCallback(name: string): void;
|
|
1627
|
+
/** Texto do cabeçalho; sem ele o grupo não tem cabeçalho nem nome. */
|
|
1628
|
+
get label(): string | null;
|
|
1629
|
+
set label(value: string | null | undefined);
|
|
1630
|
+
/** O cabeçalho é um botão que abre e fecha os itens. */
|
|
1631
|
+
get expandable(): boolean;
|
|
1632
|
+
set expandable(value: boolean | string | null | undefined);
|
|
1633
|
+
/** Itens à mostra (só importa com `expandable`). */
|
|
1634
|
+
get open(): boolean;
|
|
1635
|
+
set open(value: boolean | string | null | undefined);
|
|
1636
|
+
/** Abre ou fecha um grupo expansível e emite `ark-toggle` com `detail: { open }`. */
|
|
1637
|
+
toggle(): void;
|
|
1638
|
+
private getVariant;
|
|
1639
|
+
/** Trilho: a sidebar recolhida só com ícones (o ark-nav propaga `data-ark-rail`). */
|
|
1640
|
+
private isRail;
|
|
1641
|
+
private syncHeading;
|
|
1642
|
+
private applyOwnClasses;
|
|
1643
|
+
private updateAppearance;
|
|
1644
|
+
}
|
|
1645
|
+
|
|
1646
|
+
/**
|
|
1647
|
+
* Item de um ark-nav. O PRÓPRIO host é a linha (classes, cores do item atual);
|
|
1648
|
+
* o texto vem de `label` num nó próprio, o ícone do usuário fica em
|
|
1649
|
+
* `slot="icon"` e um badge ou atalho em `slot="trailing"`, todos onde estão.
|
|
1650
|
+
* Com `href`, um `<a>` "esticado" cobre o host, recebe o foco e é nomeado pelo
|
|
1651
|
+
* conteúdo do host (`aria-labelledby`), como no ark-button: Ctrl/Cmd+clique,
|
|
1652
|
+
* clique do meio e "abrir em nova aba" funcionam como num link. Sem `href` o
|
|
1653
|
+
* host é um `role="button"`. O clique emite `ark-navigate` cancelável antes de
|
|
1654
|
+
* o navegador seguir o link: um app SPA chama `preventDefault()` e roteia por
|
|
1655
|
+
* conta própria. `current` marca a página atual (`aria-current="page"`).
|
|
1656
|
+
* `divider` vira `role="separator"`. Tamanho, intent, apresentação e o estado
|
|
1657
|
+
* de trilho (sidebar ou navbar recolhidas: só o ícone, rótulo sr-only e
|
|
1658
|
+
* `title` no host) chegam propagados do ark-nav.
|
|
1659
|
+
*/
|
|
1660
|
+
declare class ArkNavItem extends HTMLElementBase {
|
|
1661
|
+
static readonly tagName = "ark-nav-item";
|
|
1662
|
+
private ownClasses;
|
|
1663
|
+
private syncingClass;
|
|
1664
|
+
private anchorEl;
|
|
1665
|
+
private labelEl;
|
|
1666
|
+
/** `title` que o próprio componente escreveu no trilho, para não apagar um do usuário. */
|
|
1667
|
+
private appliedTitle;
|
|
1668
|
+
static get observedAttributes(): string[];
|
|
1669
|
+
constructor();
|
|
1670
|
+
connectedCallback(): void;
|
|
1671
|
+
attributeChangedCallback(name: string): void;
|
|
1672
|
+
/** Destino do link; sem ele o item é um botão. */
|
|
1673
|
+
get href(): string | null;
|
|
1674
|
+
set href(value: string | null | undefined);
|
|
1675
|
+
/** `target` do link (`_blank` ganha `rel="noopener noreferrer"`). */
|
|
1676
|
+
get target(): string | null;
|
|
1677
|
+
set target(value: string | null | undefined);
|
|
1678
|
+
/** Texto do item, desenhado num nó próprio (oculto no trilho, pequeno sob o ícone no tabbar). */
|
|
1679
|
+
get label(): string | null;
|
|
1680
|
+
set label(value: string | null | undefined);
|
|
1681
|
+
/** Identificador publicado em `ark-navigate` e comparado com o `value` do ark-nav. Padrão: o `href`. */
|
|
1682
|
+
get value(): string;
|
|
1683
|
+
set value(value: string | null | undefined);
|
|
1684
|
+
/** Página atual (`aria-current="page"`); o ark-nav o escreve a partir do próprio `value` quando tem um. */
|
|
1685
|
+
get current(): boolean;
|
|
1686
|
+
set current(value: boolean | string | null | undefined);
|
|
1687
|
+
get disabled(): boolean;
|
|
1688
|
+
set disabled(value: boolean | string | null | undefined);
|
|
1689
|
+
/** Linha separadora (`role="separator"`), sem link nem texto. */
|
|
1690
|
+
get divider(): boolean;
|
|
1691
|
+
set divider(value: boolean | string | null | undefined);
|
|
1692
|
+
/** Emite `ark-navigate` (cancelável) com `href` e `value`; devolve false quando o app cancelou. */
|
|
1693
|
+
private emitNavigate;
|
|
1694
|
+
private readonly handleClick;
|
|
1695
|
+
private readonly handleKeydown;
|
|
1696
|
+
private getVariant;
|
|
1697
|
+
/** Trilho: só o ícone (o ark-nav propaga `data-ark-rail` na sidebar e na navbar recolhidas). */
|
|
1698
|
+
private isRail;
|
|
1699
|
+
private ensureId;
|
|
1700
|
+
private getPalette;
|
|
1701
|
+
private computeClasses;
|
|
1702
|
+
private syncLabel;
|
|
1703
|
+
/** Modo link: cria/remove o <a> esticado conforme `href` entra/sai. */
|
|
1704
|
+
private syncAnchor;
|
|
1705
|
+
private syncTitle;
|
|
1706
|
+
private syncHostSemantics;
|
|
1707
|
+
private applyOwnClasses;
|
|
1708
|
+
private updateAppearance;
|
|
1709
|
+
}
|
|
1710
|
+
|
|
1711
|
+
/**
|
|
1712
|
+
* Paginação: resumo do intervalo ("1–10 de 134"), seletor opcional de itens
|
|
1713
|
+
* por página e a faixa de páginas com anterior e próxima. O PRÓPRIO host é a
|
|
1714
|
+
* `role="navigation"`; tudo dentro é do componente (não há filhos do usuário).
|
|
1715
|
+
* `page`, `page-size` e `total` são a fonte da verdade: um clique reescreve
|
|
1716
|
+
* `page` (e `page-size`, pelo seletor que `page-sizes` liga), emite
|
|
1717
|
+
* `ark-page-change` e anuncia a página ao leitor de tela. Quem pagina os dados
|
|
1718
|
+
* é o app: o componente só conta páginas. Trocar os itens por página mantém à
|
|
1719
|
+
* vista o primeiro item que estava na tela. Compõe o ark-select.
|
|
1720
|
+
*/
|
|
1721
|
+
declare class ArkPagination extends HTMLElementBase {
|
|
1722
|
+
static readonly tagName = "ark-pagination";
|
|
1723
|
+
private summaryEl;
|
|
1724
|
+
private sizeWrapEl;
|
|
1725
|
+
private sizeLabelEl;
|
|
1726
|
+
private sizeEl;
|
|
1727
|
+
private listEl;
|
|
1728
|
+
private ownClasses;
|
|
1729
|
+
private syncingClass;
|
|
1730
|
+
/** Rótulo que o próprio componente gravou no host; um `aria-label` do app, diferente dele, fica como está. */
|
|
1731
|
+
private writtenLabel;
|
|
1732
|
+
/** Várias gravações de atributo numa só mudança (página e itens por página) renderizam uma vez, ao fim. */
|
|
1733
|
+
private suspended;
|
|
1734
|
+
static get observedAttributes(): string[];
|
|
1735
|
+
connectedCallback(): void;
|
|
1736
|
+
disconnectedCallback(): void;
|
|
1737
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
1738
|
+
/** Página atual, a partir de 1, limitada ao total de páginas. Padrão: 1. */
|
|
1739
|
+
get page(): number;
|
|
1740
|
+
set page(value: number | string | null | undefined);
|
|
1741
|
+
/** Itens por página (atributo `page-size`). Padrão: 10. */
|
|
1742
|
+
get pageSize(): number;
|
|
1743
|
+
set pageSize(value: number | string | null | undefined);
|
|
1744
|
+
/** Total de itens. Padrão: 0. */
|
|
1745
|
+
get total(): number;
|
|
1746
|
+
set total(value: number | string | null | undefined);
|
|
1747
|
+
/** Opções do seletor de itens por página (atributo `page-sizes`, separado por vírgula); vazio esconde o seletor. */
|
|
1748
|
+
get pageSizes(): number[];
|
|
1749
|
+
set pageSizes(value: number[] | string | null | undefined);
|
|
1750
|
+
/** Páginas vizinhas da atual exibidas de cada lado. Padrão: 1. */
|
|
1751
|
+
get siblings(): number;
|
|
1752
|
+
set siblings(value: number | string | null | undefined);
|
|
1753
|
+
get disabled(): boolean;
|
|
1754
|
+
set disabled(value: boolean | string | null | undefined);
|
|
1755
|
+
/** Total de páginas: pelo menos 1, mesmo sem itens. */
|
|
1756
|
+
get pageCount(): number;
|
|
1757
|
+
private getLocale;
|
|
1758
|
+
private getSize;
|
|
1759
|
+
private goTo;
|
|
1760
|
+
private render;
|
|
1761
|
+
private createButton;
|
|
1762
|
+
private syncPages;
|
|
1763
|
+
private syncPageSize;
|
|
1764
|
+
private applyOwnClasses;
|
|
1765
|
+
private updateAppearance;
|
|
1766
|
+
}
|
|
1767
|
+
|
|
1278
1768
|
/**
|
|
1279
1769
|
* Barra de progresso: o PRÓPRIO host é o `role="progressbar"` (aria-valuenow,
|
|
1280
1770
|
* min e max, nome por `label`), uma linha com o trilho, que cresce, e o
|
|
@@ -1509,6 +1999,7 @@ declare class ArkShapePicker extends HTMLElementBase {
|
|
|
1509
1999
|
static get observedAttributes(): string[];
|
|
1510
2000
|
constructor();
|
|
1511
2001
|
connectedCallback(): void;
|
|
2002
|
+
disconnectedCallback(): void;
|
|
1512
2003
|
attributeChangedCallback(name: string): void;
|
|
1513
2004
|
/** Forma selecionada; sem atributo ou com valor inválido, nenhuma. */
|
|
1514
2005
|
get value(): ArkMarkShape | "";
|
|
@@ -1581,6 +2072,7 @@ declare class ArkSpinner extends HTMLElementBase {
|
|
|
1581
2072
|
private labelEl;
|
|
1582
2073
|
static get observedAttributes(): string[];
|
|
1583
2074
|
connectedCallback(): void;
|
|
2075
|
+
disconnectedCallback(): void;
|
|
1584
2076
|
attributeChangedCallback(name: string): void;
|
|
1585
2077
|
private getLocale;
|
|
1586
2078
|
private getSizeClass;
|
|
@@ -1661,7 +2153,10 @@ declare class ArkStatusDot extends HTMLElementBase {
|
|
|
1661
2153
|
* Interruptor liga/desliga com trilho e polegar. O trilho é um <button>
|
|
1662
2154
|
* `role="switch"`; um checkbox oculto espelha o estado para o formulário,
|
|
1663
2155
|
* submetendo `name`/`value` apenas quando marcado. Tem tabela de proporções
|
|
1664
|
-
* própria, em vez da escala de altura dos demais controles.
|
|
2156
|
+
* própria, em vez da escala de altura dos demais controles. Nome acessível:
|
|
2157
|
+
* `aria-label`, senão `label`, senão os filhos do usuário, que viram rótulo
|
|
2158
|
+
* visível (opt-in por construção): o host passa a ser uma linha com o trilho
|
|
2159
|
+
* antes do texto, e um clique no texto alterna, como num `<label>`.
|
|
1665
2160
|
*/
|
|
1666
2161
|
declare class ArkSwitch extends HTMLElementBase {
|
|
1667
2162
|
static readonly tagName = "ark-switch";
|
|
@@ -1670,12 +2165,21 @@ declare class ArkSwitch extends HTMLElementBase {
|
|
|
1670
2165
|
private labelOnEl;
|
|
1671
2166
|
private labelOffEl;
|
|
1672
2167
|
private inputEl;
|
|
2168
|
+
private observer;
|
|
2169
|
+
private ownClasses;
|
|
2170
|
+
private syncingClass;
|
|
1673
2171
|
static get observedAttributes(): string[];
|
|
2172
|
+
constructor();
|
|
1674
2173
|
connectedCallback(): void;
|
|
1675
|
-
|
|
2174
|
+
disconnectedCallback(): void;
|
|
2175
|
+
attributeChangedCallback(name: string): void;
|
|
1676
2176
|
get checked(): boolean;
|
|
1677
2177
|
set checked(value: boolean | string | null | undefined);
|
|
1678
2178
|
toggle(): void;
|
|
2179
|
+
private readonly handleHostClick;
|
|
2180
|
+
/** Filhos do usuário com conteúdo (texto ou elemento), que viram o rótulo visível. */
|
|
2181
|
+
private hasLabelChildren;
|
|
2182
|
+
private applyOwnClasses;
|
|
1679
2183
|
private getIntent;
|
|
1680
2184
|
private getPalette;
|
|
1681
2185
|
private getSizing;
|
|
@@ -1700,6 +2204,7 @@ declare class ArkTab extends HTMLElementBase {
|
|
|
1700
2204
|
static get observedAttributes(): string[];
|
|
1701
2205
|
constructor();
|
|
1702
2206
|
connectedCallback(): void;
|
|
2207
|
+
disconnectedCallback(): void;
|
|
1703
2208
|
attributeChangedCallback(name: string): void;
|
|
1704
2209
|
get value(): string;
|
|
1705
2210
|
set value(value: string | null | undefined);
|
|
@@ -1802,6 +2307,40 @@ declare class ArkTextarea extends HTMLElementBase {
|
|
|
1802
2307
|
private updateAppearance;
|
|
1803
2308
|
}
|
|
1804
2309
|
|
|
2310
|
+
/**
|
|
2311
|
+
* Data e hora formatadas pelo idioma (`Intl`), relativas a agora ("há 3 minutos", "ontem") ou absolutas. O
|
|
2312
|
+
* conteúdo é um `<time datetime>` próprio, com a data completa no `title`; no formato relativo o texto se atualiza
|
|
2313
|
+
* sozinho no próximo ponto em que muda (cada segundo no primeiro minuto, cada minuto na primeira hora...), e para
|
|
2314
|
+
* fora do documento ou com a aba oculta. O idioma é o `lang` próprio, senão o de `setArkLocale()`, senão "en", com a
|
|
2315
|
+
* tag inteira (`pt-BR`) indo para o `Intl`.
|
|
2316
|
+
*/
|
|
2317
|
+
declare class ArkTime extends HTMLElementBase {
|
|
2318
|
+
static readonly tagName = "ark-time";
|
|
2319
|
+
private timeEl;
|
|
2320
|
+
private timer;
|
|
2321
|
+
static get observedAttributes(): string[];
|
|
2322
|
+
connectedCallback(): void;
|
|
2323
|
+
disconnectedCallback(): void;
|
|
2324
|
+
attributeChangedCallback(): void;
|
|
2325
|
+
/**
|
|
2326
|
+
* Instante mostrado: ISO com fuso (`2026-09-15T13:00:00Z`), hora local sem fuso (`2026-09-15T10:00`) ou só a data
|
|
2327
|
+
* (`2026-09-15`). Atribuir um `Date` ou um número (ms) grava o ISO. Padrão: nenhum (nada é mostrado).
|
|
2328
|
+
*/
|
|
2329
|
+
get datetime(): string;
|
|
2330
|
+
set datetime(value: string | number | Date | null | undefined);
|
|
2331
|
+
/** relative ("há 3 minutos"), date, time ou datetime. Padrão: "relative". */
|
|
2332
|
+
get format(): ArkTimeFormat;
|
|
2333
|
+
set format(value: string | null | undefined);
|
|
2334
|
+
/** O instante como `Date`, ou `null` sem um `datetime` válido. */
|
|
2335
|
+
get date(): Date | null;
|
|
2336
|
+
/** Tag de idioma para o Intl: o `lang` próprio, senão o de setArkLocale(); uma que o Intl não conheça vira "en". */
|
|
2337
|
+
private locale;
|
|
2338
|
+
private readonly handleVisibility;
|
|
2339
|
+
private clearTimer;
|
|
2340
|
+
private relative;
|
|
2341
|
+
private update;
|
|
2342
|
+
}
|
|
2343
|
+
|
|
1805
2344
|
/**
|
|
1806
2345
|
* Pilha de toasts da página. Não é chamado diretamente: escuta `ark-toast` e
|
|
1807
2346
|
* `ark-toast-dismiss` em window, disparados pelo serviço `toast` do
|
|
@@ -1974,6 +2513,155 @@ declare class ArkTooltip extends HTMLElementBase {
|
|
|
1974
2513
|
private updateAppearance;
|
|
1975
2514
|
}
|
|
1976
2515
|
|
|
2516
|
+
/** Estado da caixa de um nó com `checkboxes`. */
|
|
2517
|
+
type ArkTreeItemChecked = "true" | "false" | "mixed";
|
|
2518
|
+
/**
|
|
2519
|
+
* Nó de um ark-tree. A linha própria é o `role="treeitem"` (foco, teclado e
|
|
2520
|
+
* estado em aria-*, com nível, posição e tamanho do conjunto explícitos, como
|
|
2521
|
+
* numa árvore plana) e o host fica `role="none"`: assim os `ark-tree-item`
|
|
2522
|
+
* filhos continuam onde o app os declarou, sem group nem aria-owns, e cada um
|
|
2523
|
+
* tem a própria linha. O chevron, a caixa e o rótulo são chrome próprio; o
|
|
2524
|
+
* `slot="icon"` e o `slot="trailing"` do usuário entram na linha pela grid do
|
|
2525
|
+
* components.css (e ficam fora do treeitem, então um botão no trailing é um
|
|
2526
|
+
* controle à parte). Seleção, foco, teclado e a estrutura são coordenados pelo
|
|
2527
|
+
* ark-tree.
|
|
2528
|
+
*/
|
|
2529
|
+
declare class ArkTreeItem extends HTMLElementBase {
|
|
2530
|
+
static readonly tagName = "ark-tree-item";
|
|
2531
|
+
private rowEl;
|
|
2532
|
+
private toggleEl;
|
|
2533
|
+
private checkEl;
|
|
2534
|
+
private labelEl;
|
|
2535
|
+
/** Ícones em uso no chevron e na caixa: trocar o innerHTML sem mudança geraria mutações sem fim no observer da árvore. */
|
|
2536
|
+
private toggleIcon;
|
|
2537
|
+
private checkIcon;
|
|
2538
|
+
static get observedAttributes(): string[];
|
|
2539
|
+
connectedCallback(): void;
|
|
2540
|
+
attributeChangedCallback(): void;
|
|
2541
|
+
/** Identidade do nó nos eventos e no `value` da árvore. */
|
|
2542
|
+
get value(): string;
|
|
2543
|
+
set value(value: string | null | undefined);
|
|
2544
|
+
/** Texto do nó, também usado na busca por digitação. */
|
|
2545
|
+
get label(): string;
|
|
2546
|
+
set label(value: string | null | undefined);
|
|
2547
|
+
/** Aberto; refletido quando o usuário expande ou recolhe. */
|
|
2548
|
+
get expanded(): boolean;
|
|
2549
|
+
set expanded(value: boolean | string | null | undefined);
|
|
2550
|
+
/** Mostra o chevron mesmo sem filhos: o app carrega os filhos ao receber o `ark-toggle`. */
|
|
2551
|
+
get lazy(): boolean;
|
|
2552
|
+
set lazy(value: boolean | string | null | undefined);
|
|
2553
|
+
/** Spinner no lugar do chevron e `aria-busy` enquanto os filhos carregam. */
|
|
2554
|
+
get loading(): boolean;
|
|
2555
|
+
set loading(value: boolean | string | null | undefined);
|
|
2556
|
+
/** Selecionado (o ark-tree reescreve). */
|
|
2557
|
+
get selected(): boolean;
|
|
2558
|
+
set selected(value: boolean | string | null | undefined);
|
|
2559
|
+
/** Caixa marcada com `checkboxes`: true, false ou mixed (o ark-tree reescreve). */
|
|
2560
|
+
get checked(): ArkTreeItemChecked;
|
|
2561
|
+
set checked(value: boolean | string | null | undefined);
|
|
2562
|
+
/** Fora da seleção e da ativação; o foco ainda passa por ele. */
|
|
2563
|
+
get disabled(): boolean;
|
|
2564
|
+
set disabled(value: boolean | string | null | undefined);
|
|
2565
|
+
/** O nó pai (ark-tree-item) ou `null` no primeiro nível; atravessa wrappers de framework. */
|
|
2566
|
+
get parentItem(): ArkTreeItem | null;
|
|
2567
|
+
/** Os subitens diretos, mesmo dentro de um wrapper de framework entre este nó e eles. */
|
|
2568
|
+
get childItems(): ArkTreeItem[];
|
|
2569
|
+
/** Tem subitens ou é `lazy`: mostra o chevron e leva `aria-expanded`. */
|
|
2570
|
+
get isBranch(): boolean;
|
|
2571
|
+
/** A linha própria: o treeitem (foco, aria-*) e a faixa de fundo. */
|
|
2572
|
+
get rowElement(): HTMLDivElement | null;
|
|
2573
|
+
/** O chevron próprio, para a árvore distinguir o clique que só expande. */
|
|
2574
|
+
get toggleElement(): HTMLSpanElement | null;
|
|
2575
|
+
/** A caixa própria, para a árvore distinguir o clique que só marca. */
|
|
2576
|
+
get checkElement(): HTMLSpanElement | null;
|
|
2577
|
+
/** Refaz o que depende dos subitens (chevron, aria-expanded), chamado pela árvore quando a estrutura muda. */
|
|
2578
|
+
syncStructure(): void;
|
|
2579
|
+
private render;
|
|
2580
|
+
private sizeClasses;
|
|
2581
|
+
private updateAppearance;
|
|
2582
|
+
}
|
|
2583
|
+
|
|
2584
|
+
/**
|
|
2585
|
+
* Árvore de itens (`role="tree"`). O PRÓPRIO host é a árvore: os
|
|
2586
|
+
* `ark-tree-item` do usuário ficam onde estão, aninhados como ele os declarou,
|
|
2587
|
+
* e a linha de cada um é o treeitem (árvore plana para a acessibilidade, com
|
|
2588
|
+
* nível e posição explícitos). A árvore calcula a estrutura, coordena foco (um
|
|
2589
|
+
* tab stop só), teclado do padrão WAI-ARIA, seleção e caixas, e publica os
|
|
2590
|
+
* eventos consolidados: `ark-toggle`, `ark-selection-change` e `ark-activate`.
|
|
2591
|
+
* Simples por padrão: sem `selection` só navega, expande e ativa.
|
|
2592
|
+
*/
|
|
2593
|
+
declare class ArkTree extends HTMLElementBase {
|
|
2594
|
+
static readonly tagName = "ark-tree";
|
|
2595
|
+
private ownClasses;
|
|
2596
|
+
private syncingClass;
|
|
2597
|
+
private observer;
|
|
2598
|
+
/** Item com o tab stop (roving tabindex). */
|
|
2599
|
+
private tabStop;
|
|
2600
|
+
/** Escrevendo `value` a partir da seleção: o attributeChangedCallback não relê. */
|
|
2601
|
+
private syncingValue;
|
|
2602
|
+
/** Itens já vistos, para um filho que chega depois (carga de um `lazy`) herdar a caixa marcada do pai. */
|
|
2603
|
+
private known;
|
|
2604
|
+
private typeahead;
|
|
2605
|
+
private typeaheadTimer;
|
|
2606
|
+
static get observedAttributes(): string[];
|
|
2607
|
+
constructor();
|
|
2608
|
+
connectedCallback(): void;
|
|
2609
|
+
disconnectedCallback(): void;
|
|
2610
|
+
attributeChangedCallback(name: string): void;
|
|
2611
|
+
/** none (só navega, expande e ativa), single ou multiple. Padrão: "none". */
|
|
2612
|
+
get selection(): ArkTreeSelection;
|
|
2613
|
+
set selection(value: string | null | undefined);
|
|
2614
|
+
/** Com `multiple`: uma caixa por nó, que marca em vez de selecionar a linha. */
|
|
2615
|
+
get checkboxes(): boolean;
|
|
2616
|
+
set checkboxes(value: boolean | string | null | undefined);
|
|
2617
|
+
/** Com `checkboxes`: marcar um pai marca os descendentes, e o pai fica `mixed` com parte marcada. */
|
|
2618
|
+
get propagate(): boolean;
|
|
2619
|
+
set propagate(value: boolean | string | null | undefined);
|
|
2620
|
+
/**
|
|
2621
|
+
* Valores selecionados (ou marcados, com `checkboxes`): um valor em `single`, lista JSON em `multiple`. O
|
|
2622
|
+
* componente o reescreve a cada mudança; atribuir seleciona os itens desses valores.
|
|
2623
|
+
*/
|
|
2624
|
+
get value(): string;
|
|
2625
|
+
set value(value: string | null | undefined);
|
|
2626
|
+
/** Valores selecionados ou marcados, como lista. Atribuir seleciona os itens desses valores. */
|
|
2627
|
+
get values(): string[];
|
|
2628
|
+
set values(next: string[] | string | null | undefined);
|
|
2629
|
+
/** Todos os itens desta árvore, em ordem de documento. */
|
|
2630
|
+
get items(): ArkTreeItem[];
|
|
2631
|
+
/** Itens visíveis (nenhum ancestral recolhido), na ordem da tela. */
|
|
2632
|
+
get visibleItems(): ArkTreeItem[];
|
|
2633
|
+
/** Expande ou recolhe um item e publica `ark-toggle` (o `lazy` carrega os filhos ao receber `expanded: true`). */
|
|
2634
|
+
toggleItem(item: ArkTreeItem, expanded?: boolean): void;
|
|
2635
|
+
/** Leva o foco (e o tab stop) à linha de um item. */
|
|
2636
|
+
focusItem(item: ArkTreeItem): void;
|
|
2637
|
+
private isVisible;
|
|
2638
|
+
private checkMode;
|
|
2639
|
+
/** Recalcula a estrutura: nível, posição, atributos propagados, caixas herdadas e o tab stop. */
|
|
2640
|
+
private syncItems;
|
|
2641
|
+
private syncTabStop;
|
|
2642
|
+
private setTabStop;
|
|
2643
|
+
/** Itens escolhidos: selecionados, ou marcados por inteiro com `checkboxes`. */
|
|
2644
|
+
private chosenItems;
|
|
2645
|
+
/** Reescreve o `value` a partir do estado dos itens (sem reler pelo attributeChangedCallback). */
|
|
2646
|
+
private syncValue;
|
|
2647
|
+
/** Aplica o `value` (atribuído pelo app) aos itens. */
|
|
2648
|
+
private applyValue;
|
|
2649
|
+
private emitSelection;
|
|
2650
|
+
private select;
|
|
2651
|
+
private toggleCheck;
|
|
2652
|
+
private setSubtree;
|
|
2653
|
+
private recomputeParents;
|
|
2654
|
+
private activate;
|
|
2655
|
+
/** O item desta árvore dono do evento, ou `null` se veio de um controle do usuário dentro do item. */
|
|
2656
|
+
private itemFromEvent;
|
|
2657
|
+
private readonly handleFocusIn;
|
|
2658
|
+
private readonly handleClick;
|
|
2659
|
+
private readonly handleKeydown;
|
|
2660
|
+
private handleTypeahead;
|
|
2661
|
+
private applyOwnClasses;
|
|
2662
|
+
private updateAppearance;
|
|
2663
|
+
}
|
|
2664
|
+
|
|
1977
2665
|
declare global {
|
|
1978
2666
|
interface HTMLElementTagNameMap {
|
|
1979
2667
|
"ark-alert": ArkAlert;
|
|
@@ -1989,6 +2677,7 @@ declare global {
|
|
|
1989
2677
|
"ark-command-item": ArkCommandItem;
|
|
1990
2678
|
"ark-command-palette": ArkCommandPalette;
|
|
1991
2679
|
"ark-copy-button": ArkCopyButton;
|
|
2680
|
+
"ark-data-view": ArkDataView;
|
|
1992
2681
|
"ark-datepicker": ArkDatepicker;
|
|
1993
2682
|
"ark-dialog": ArkDialog;
|
|
1994
2683
|
"ark-drawer": ArkDrawer;
|
|
@@ -1999,7 +2688,12 @@ declare global {
|
|
|
1999
2688
|
"ark-kv-editor": ArkKvEditor;
|
|
2000
2689
|
"ark-mark": ArkMark;
|
|
2001
2690
|
"ark-menu": ArkMenu;
|
|
2691
|
+
"ark-menu-group": ArkMenuGroup;
|
|
2002
2692
|
"ark-menu-item": ArkMenuItem;
|
|
2693
|
+
"ark-nav": ArkNav;
|
|
2694
|
+
"ark-nav-group": ArkNavGroup;
|
|
2695
|
+
"ark-nav-item": ArkNavItem;
|
|
2696
|
+
"ark-pagination": ArkPagination;
|
|
2003
2697
|
"ark-progress": ArkProgress;
|
|
2004
2698
|
"ark-radio": ArkRadio;
|
|
2005
2699
|
"ark-scheduler": ArkScheduler;
|
|
@@ -2013,10 +2707,13 @@ declare global {
|
|
|
2013
2707
|
"ark-tab": ArkTab;
|
|
2014
2708
|
"ark-tabs": ArkTabs;
|
|
2015
2709
|
"ark-textarea": ArkTextarea;
|
|
2710
|
+
"ark-time": ArkTime;
|
|
2016
2711
|
"ark-toaster": ArkToaster;
|
|
2017
2712
|
"ark-toggle": ArkToggle;
|
|
2018
2713
|
"ark-toggle-group": ArkToggleGroup;
|
|
2019
2714
|
"ark-tooltip": ArkTooltip;
|
|
2715
|
+
"ark-tree": ArkTree;
|
|
2716
|
+
"ark-tree-item": ArkTreeItem;
|
|
2020
2717
|
}
|
|
2021
2718
|
}
|
|
2022
2719
|
|
|
@@ -2027,4 +2724,5 @@ declare global {
|
|
|
2027
2724
|
*/
|
|
2028
2725
|
declare function registerTooarkComponents(): void;
|
|
2029
2726
|
|
|
2030
|
-
export { ARK_MARK_PATHS, ARK_MARK_SHAPES, ArkAlert, ArkAvatar, ArkBadge, ArkButton, ArkCalendar, ArkCard, ArkCarousel, ArkCheckbox, ArkClock, ArkColorSwatches, ArkCommandItem, ArkCommandPalette, ArkCopyButton, ArkDatepicker, ArkDialog, ArkDrawer, ArkEmpty, ArkFileInput, ArkInput, ArkKbd, ArkKvEditor, ArkMark, ArkMenu, ArkMenuItem, ArkProgress, ArkRadio, ArkScheduler, ArkSelect, ArkShapePicker, ArkSkeleton, ArkSpinner, ArkSplitPane, ArkStatusDot, ArkSwitch, ArkTab, ArkTabs, ArkTextarea, ArkToaster, ArkToggle, ArkToggleGroup, ArkTooltip, normalizeMarkShape, registerTooarkComponents };
|
|
2727
|
+
export { ARK_MARK_PATHS, ARK_MARK_SHAPES, ArkAlert, ArkAvatar, ArkBadge, ArkButton, ArkCalendar, ArkCard, ArkCarousel, ArkCheckbox, ArkClock, ArkColorSwatches, ArkCommandItem, ArkCommandPalette, ArkCopyButton, ArkDataView, ArkDatepicker, ArkDialog, ArkDrawer, ArkEmpty, ArkFileInput, ArkInput, ArkKbd, ArkKvEditor, ArkMark, ArkMenu, ArkMenuGroup, ArkMenuItem, ArkNav, ArkNavGroup, ArkNavItem, ArkPagination, ArkProgress, ArkRadio, ArkScheduler, ArkSelect, ArkShapePicker, ArkSkeleton, ArkSpinner, ArkSplitPane, ArkStatusDot, ArkSwitch, ArkTab, ArkTabs, ArkTextarea, ArkTime, ArkToaster, ArkToggle, ArkToggleGroup, ArkTooltip, ArkTree, ArkTreeItem, normalizeMarkShape, registerTooarkComponents };
|
|
2728
|
+
export type { ArkTreeItemChecked };
|