@tooark/web-components 1.0.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/LICENSE +201 -0
- package/NOTICE +12 -0
- package/README.md +193 -0
- package/README.pt-BR.md +193 -0
- package/dist/index.cjs +12564 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1077 -0
- package/dist/index.d.ts +1077 -0
- package/dist/index.js +12540 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +2 -0
- package/package.json +89 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,1077 @@
|
|
|
1
|
+
import { ArkButtonStatus, ArkButtonType, ArkCalendarEvent, ArkDialogCloseReason, ArkSchedulerEvent, ArkSchedulerView, ArkSelectOption, ArkToastOptions } from '@tooark/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Rótulo curto de status ou categoria. O PRÓPRIO host é o badge (classes e
|
|
5
|
+
* hooks): os filhos do usuário, ícone e texto, ficam onde estão. Não é
|
|
6
|
+
* interativo; um badge clicável é um ark-button pequeno.
|
|
7
|
+
*/
|
|
8
|
+
declare class ArkBadge extends HTMLElement {
|
|
9
|
+
static readonly tagName = "ark-badge";
|
|
10
|
+
private ownClasses;
|
|
11
|
+
private syncingClass;
|
|
12
|
+
static get observedAttributes(): string[];
|
|
13
|
+
connectedCallback(): void;
|
|
14
|
+
attributeChangedCallback(name: string): void;
|
|
15
|
+
private getVariant;
|
|
16
|
+
private getSize;
|
|
17
|
+
private getPalette;
|
|
18
|
+
private computeClasses;
|
|
19
|
+
private applyCustomColor;
|
|
20
|
+
private applyOwnClasses;
|
|
21
|
+
private updateAppearance;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Botão da família Ark.
|
|
26
|
+
*
|
|
27
|
+
* O PRÓPRIO host é o controle: recebe as classes, `role="button"`, foco,
|
|
28
|
+
* teclado (Enter/Espaço) e participa de formulários via ElementInternals
|
|
29
|
+
* (`type="submit"`/`"reset"`). Nenhum filho do usuário é movido ou envolvido,
|
|
30
|
+
* então frameworks que gerenciam os filhos (React, Vue, Angular) continuam
|
|
31
|
+
* donos deles. Com `href`, um `<a>` "esticado" cobre o host, recebe o foco e
|
|
32
|
+
* é nomeado pelo conteúdo do host (`aria-labelledby`).
|
|
33
|
+
*/
|
|
34
|
+
declare class ArkButton extends HTMLElement {
|
|
35
|
+
static readonly tagName: string;
|
|
36
|
+
static readonly formAssociated = true;
|
|
37
|
+
private readonly internals;
|
|
38
|
+
private spinnerEl;
|
|
39
|
+
/** Glifo de `status` (check ou alerta), nó próprio na frente do conteúdo; some sob `loading`. */
|
|
40
|
+
private statusEl;
|
|
41
|
+
private anchorEl;
|
|
42
|
+
private ownClasses;
|
|
43
|
+
private syncingClass;
|
|
44
|
+
private formDisabled;
|
|
45
|
+
/**
|
|
46
|
+
* Observa os atributos do elemento para reagir a mudanças.
|
|
47
|
+
* @returns Uma lista de atributos observados pelo componente.
|
|
48
|
+
*/
|
|
49
|
+
static get observedAttributes(): string[];
|
|
50
|
+
/**
|
|
51
|
+
* Inicializa uma nova instância do botão Ark.
|
|
52
|
+
*/
|
|
53
|
+
constructor();
|
|
54
|
+
/**
|
|
55
|
+
* Chamado pelo navegador quando o elemento é adicionado ao DOM.
|
|
56
|
+
*/
|
|
57
|
+
connectedCallback(): void;
|
|
58
|
+
/**
|
|
59
|
+
* Chamado pelo navegador quando um atributo observado do elemento é alterado.
|
|
60
|
+
* @param name O nome do atributo que foi alterado.
|
|
61
|
+
*/
|
|
62
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
63
|
+
/** Feedback do resultado: "success" ou "error" trocam o glifo; "idle" (ou ausente) não mostra nada. */
|
|
64
|
+
get status(): ArkButtonStatus;
|
|
65
|
+
set status(value: ArkButtonStatus | null | undefined);
|
|
66
|
+
/** Texto anunciado ao leitor de tela quando o status vira success ou error. */
|
|
67
|
+
get statusLabel(): string;
|
|
68
|
+
set statusLabel(value: string | null | undefined);
|
|
69
|
+
private announceStatus;
|
|
70
|
+
/**
|
|
71
|
+
* Chamado pelo navegador quando um <fieldset disabled> ancestral muda.
|
|
72
|
+
* @param disabled Indica se o <fieldset> ancestral está desabilitado.
|
|
73
|
+
*/
|
|
74
|
+
formDisabledCallback(disabled: boolean): void;
|
|
75
|
+
/**
|
|
76
|
+
* Indica se o botão está desabilitado.
|
|
77
|
+
*/
|
|
78
|
+
get disabled(): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Define se o botão está desabilitado.
|
|
81
|
+
*/
|
|
82
|
+
set disabled(value: boolean | string | null | undefined);
|
|
83
|
+
/**
|
|
84
|
+
* Indica se o botão está em estado de carregamento.
|
|
85
|
+
*/
|
|
86
|
+
get loading(): boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Define se o botão está em estado de carregamento.
|
|
89
|
+
*/
|
|
90
|
+
set loading(value: boolean | string | null | undefined);
|
|
91
|
+
/**
|
|
92
|
+
* Indica o tipo do botão.
|
|
93
|
+
*/
|
|
94
|
+
get type(): ArkButtonType;
|
|
95
|
+
/**
|
|
96
|
+
* Formulário ao qual o botão pertence (via ElementInternals).
|
|
97
|
+
*/
|
|
98
|
+
get form(): HTMLFormElement | null;
|
|
99
|
+
/**
|
|
100
|
+
* Manipula o clique no botão, tratando submissão e reset de formulários.
|
|
101
|
+
* @param event Evento de clique no botão.
|
|
102
|
+
*/
|
|
103
|
+
private readonly handleClick;
|
|
104
|
+
/**
|
|
105
|
+
* Manipula o pressionamento de tecla no botão, tratando Enter e Espaço.
|
|
106
|
+
* @param event Evento de teclado no botão.
|
|
107
|
+
*/
|
|
108
|
+
private readonly handleKeydown;
|
|
109
|
+
/**
|
|
110
|
+
* Manipula o keyup no botão, tratando a tecla Espaço.
|
|
111
|
+
* @param event Evento de teclado no botão.
|
|
112
|
+
* @returns void
|
|
113
|
+
*/
|
|
114
|
+
private readonly handleKeyup;
|
|
115
|
+
/**
|
|
116
|
+
* Normaliza o valor do intent, garantindo que seja um dos valores válidos.
|
|
117
|
+
* @param value Valor do intent.
|
|
118
|
+
* @returns Intent normalizado.
|
|
119
|
+
*/
|
|
120
|
+
private normalizeIntent;
|
|
121
|
+
/**
|
|
122
|
+
* Resolve a variante e o intent do botão com base nos atributos.
|
|
123
|
+
* @returns Objeto contendo a variante de estilo e o intent.
|
|
124
|
+
*/
|
|
125
|
+
private resolveVariantAndIntent;
|
|
126
|
+
/**
|
|
127
|
+
* Obtém a paleta de estilos do botão com base no intent.
|
|
128
|
+
* @param intent Intent do botão.
|
|
129
|
+
* @returns Paleta de estilos correspondente ao intent.
|
|
130
|
+
*/
|
|
131
|
+
private getPalette;
|
|
132
|
+
/** Desabilitado por atributo, por `loading` ou pelo formulário; subclasses consultam antes de agir. */
|
|
133
|
+
protected isDisabled(): boolean;
|
|
134
|
+
private computeClasses;
|
|
135
|
+
/** Troca as classes do componente no host sem tocar nas classes do usuário. */
|
|
136
|
+
private applyOwnClasses;
|
|
137
|
+
private applyCustomColors;
|
|
138
|
+
private syncLoading;
|
|
139
|
+
private syncStatus;
|
|
140
|
+
private ensureId;
|
|
141
|
+
/** Modo link: cria/remove o <a> esticado conforme `href` entra/sai. */
|
|
142
|
+
private syncAnchor;
|
|
143
|
+
private syncHostSemantics;
|
|
144
|
+
/** Ponto único de atualização; subclasses o estendem (chamando super) para o próprio chrome. */
|
|
145
|
+
protected updateAppearance(): void;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Grid de mês inline para seleção de data — equivalente ao DateCalendar do MUI.
|
|
150
|
+
* Título clicável alterna as views dias → meses → anos. Suporta marcadores de
|
|
151
|
+
* eventos por dia (`events` + `event-display`). O ark-datepicker embute este
|
|
152
|
+
* componente (modo inline e no popup do modo input).
|
|
153
|
+
*/
|
|
154
|
+
declare class ArkCalendar extends HTMLElement {
|
|
155
|
+
static readonly tagName = "ark-calendar";
|
|
156
|
+
private root;
|
|
157
|
+
private viewDate;
|
|
158
|
+
private selectedDate;
|
|
159
|
+
private locale;
|
|
160
|
+
private syncingValue;
|
|
161
|
+
private pendingFocusISO;
|
|
162
|
+
private view;
|
|
163
|
+
private eventsProp;
|
|
164
|
+
/** Direção da navegação de mês por clique nas setas: dirige o slide do grid. */
|
|
165
|
+
private navDirection;
|
|
166
|
+
/** Última seleção feita pelo usuário: recebe um "pop" de entrada. */
|
|
167
|
+
private justSelectedISO;
|
|
168
|
+
static get observedAttributes(): string[];
|
|
169
|
+
connectedCallback(): void;
|
|
170
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
171
|
+
/** Lista de eventos (propriedade JS; tem precedência sobre o atributo `events`). */
|
|
172
|
+
get events(): ArkCalendarEvent[];
|
|
173
|
+
set events(list: ArkCalendarEvent[]);
|
|
174
|
+
private parseEventsAttr;
|
|
175
|
+
private getEventDisplay;
|
|
176
|
+
private eventsByDay;
|
|
177
|
+
private eventColors;
|
|
178
|
+
/**
|
|
179
|
+
* Parse seguro de datas: strings "YYYY-MM-DD" são interpretadas no fuso LOCAL.
|
|
180
|
+
* `new Date("YYYY-MM-DD")` usa meia-noite UTC, o que desloca a data em um dia
|
|
181
|
+
* em fusos negativos (ex.: UTC-3).
|
|
182
|
+
*/
|
|
183
|
+
private parseDate;
|
|
184
|
+
private startOfDay;
|
|
185
|
+
private getLocale;
|
|
186
|
+
private getIntent;
|
|
187
|
+
private getAccentColor;
|
|
188
|
+
private getPalette;
|
|
189
|
+
private getMinDate;
|
|
190
|
+
private getMaxDate;
|
|
191
|
+
private isDateDisabled;
|
|
192
|
+
private isSameDay;
|
|
193
|
+
private isToday;
|
|
194
|
+
private formatISO;
|
|
195
|
+
/** Caminho único de seleção usado pelo clique no dia e pelo botão "Hoje". */
|
|
196
|
+
private selectDate;
|
|
197
|
+
private addMonths;
|
|
198
|
+
private focusDay;
|
|
199
|
+
/** Navegação por teclado no grid (padrão WAI-ARIA de grade de datas). */
|
|
200
|
+
private readonly handleGridKeydown;
|
|
201
|
+
private yearsBlockStart;
|
|
202
|
+
private buildMonthsGrid;
|
|
203
|
+
private buildYearsGrid;
|
|
204
|
+
private build;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Carousel com CSS scroll snap: o PRÓPRIO host é o container rolável e os
|
|
209
|
+
* slides são os filhos diretos, exatamente onde o usuário os declarou — nada
|
|
210
|
+
* é movido, então frameworks podem adicionar e remover slides à vontade.
|
|
211
|
+
* Setas e dots vivem num overlay `position: sticky` (ver components.css).
|
|
212
|
+
* Arrasto com mouse é emulado; touch/trackpad usam a rolagem nativa.
|
|
213
|
+
*/
|
|
214
|
+
declare class ArkCarousel extends HTMLElement {
|
|
215
|
+
static readonly tagName = "ark-carousel";
|
|
216
|
+
private overlayEl;
|
|
217
|
+
private dotsEl;
|
|
218
|
+
private arrowPrevEl;
|
|
219
|
+
private arrowNextEl;
|
|
220
|
+
private currentIndex;
|
|
221
|
+
private autoplayId;
|
|
222
|
+
private scrollTimer;
|
|
223
|
+
private observer;
|
|
224
|
+
private resizeObserver;
|
|
225
|
+
private ownClasses;
|
|
226
|
+
private syncingClass;
|
|
227
|
+
private dragging;
|
|
228
|
+
private dragStartX;
|
|
229
|
+
private dragStartScroll;
|
|
230
|
+
private dragMoved;
|
|
231
|
+
static get observedAttributes(): string[];
|
|
232
|
+
constructor();
|
|
233
|
+
connectedCallback(): void;
|
|
234
|
+
disconnectedCallback(): void;
|
|
235
|
+
attributeChangedCallback(name: string): void;
|
|
236
|
+
/** Índice do slide atual (primeiro visível). */
|
|
237
|
+
get index(): number;
|
|
238
|
+
/** Slides do usuário: filhos diretos que não são o overlay do componente. */
|
|
239
|
+
get slides(): HTMLElement[];
|
|
240
|
+
next(): void;
|
|
241
|
+
prev(): void;
|
|
242
|
+
private getIntent;
|
|
243
|
+
private getAccentColor;
|
|
244
|
+
private getSlidesPerView;
|
|
245
|
+
private getGap;
|
|
246
|
+
private getStartIndex;
|
|
247
|
+
private isLoopEnabled;
|
|
248
|
+
private isAutoplayEnabled;
|
|
249
|
+
private getAutoplayDelay;
|
|
250
|
+
private shouldShowDots;
|
|
251
|
+
private shouldShowArrows;
|
|
252
|
+
private getSnapMode;
|
|
253
|
+
private getMaxIndex;
|
|
254
|
+
private normalizeIndex;
|
|
255
|
+
private getPalette;
|
|
256
|
+
private slideOffset;
|
|
257
|
+
private goTo;
|
|
258
|
+
private emitSlideChange;
|
|
259
|
+
/** Índice do slide mais próximo da borda esquerda visível. */
|
|
260
|
+
private indexFromScroll;
|
|
261
|
+
private readonly handleScroll;
|
|
262
|
+
private handleSlidesChanged;
|
|
263
|
+
private readonly handlePointerDown;
|
|
264
|
+
private readonly handlePointerMove;
|
|
265
|
+
private readonly handlePointerUp;
|
|
266
|
+
private readonly handleMouseEnter;
|
|
267
|
+
private readonly handleMouseLeave;
|
|
268
|
+
private startAutoplay;
|
|
269
|
+
private stopAutoplay;
|
|
270
|
+
private syncArrowState;
|
|
271
|
+
private renderDots;
|
|
272
|
+
private applyOwnClasses;
|
|
273
|
+
private build;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Superfície de seleção de hora — colunas digitais roláveis de hora/minuto
|
|
278
|
+
* (/segundo), no estilo DigitalClock do MUI. Valor sempre em 24h "HH:mm:ss";
|
|
279
|
+
* `hours-format="12"` só muda a exibição (coluna AM/PM).
|
|
280
|
+
*/
|
|
281
|
+
declare class ArkClock extends HTMLElement {
|
|
282
|
+
static readonly tagName = "ark-clock";
|
|
283
|
+
private root;
|
|
284
|
+
private columnEls;
|
|
285
|
+
private syncingValue;
|
|
286
|
+
static get observedAttributes(): string[];
|
|
287
|
+
connectedCallback(): void;
|
|
288
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
289
|
+
get value(): string;
|
|
290
|
+
private getIntent;
|
|
291
|
+
private showSeconds;
|
|
292
|
+
private is12h;
|
|
293
|
+
private getStepMinutes;
|
|
294
|
+
private parseValue;
|
|
295
|
+
private getPalette;
|
|
296
|
+
private selectPart;
|
|
297
|
+
private selectedValueFor;
|
|
298
|
+
/** Atualiza classes/aria das opções sem reconstruir (evita saltos de scroll). */
|
|
299
|
+
private updateSelection;
|
|
300
|
+
private centerOption;
|
|
301
|
+
private readonly handleColumnKeydown;
|
|
302
|
+
private build;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Seletor de data/hora que compõe ark-input + ark-calendar + ark-clock.
|
|
307
|
+
*
|
|
308
|
+
* - `mode`: "datetime" (padrão, data + hora), "date" (só calendário) ou "time"
|
|
309
|
+
* (só relógio). O valor é ISO por modo: "YYYY-MM-DDTHH:mm:ss", "YYYY-MM-DD"
|
|
310
|
+
* ou "HH:mm:ss".
|
|
311
|
+
* - Sem o atributo `input`, renderiza o(s) painel(is) inline.
|
|
312
|
+
* - Com `input`, renderiza um ark-input com botão no sufixo e popup com o
|
|
313
|
+
* painel; suporta digitação com parse (`format` com tokens YYYY MM DD HH mm ss,
|
|
314
|
+
* sensível a maiúsculas), Esc/clique fora e formulário via input hidden. O
|
|
315
|
+
* popup é um `popover="manual"` próprio (top layer: nenhum `overflow` do
|
|
316
|
+
* app o corta, sem z-index), ancorado no campo por `positionAnchored` de
|
|
317
|
+
* core (abre abaixo, vira para cima sem espaço) e animado com `scale` a
|
|
318
|
+
* partir da origem.
|
|
319
|
+
*/
|
|
320
|
+
declare class ArkDatepicker extends HTMLElement {
|
|
321
|
+
static readonly tagName = "ark-datepicker";
|
|
322
|
+
private calendarEl;
|
|
323
|
+
private clockEl;
|
|
324
|
+
private inputComp;
|
|
325
|
+
private toggleEl;
|
|
326
|
+
private popupEl;
|
|
327
|
+
/** Para de reposicionar o popup em scroll/resize; só existe enquanto aberto. */
|
|
328
|
+
private disposePosition;
|
|
329
|
+
private hiddenInputEl;
|
|
330
|
+
private popupOpen;
|
|
331
|
+
private syncingValue;
|
|
332
|
+
private syncingChild;
|
|
333
|
+
private dateISO;
|
|
334
|
+
private timeISO;
|
|
335
|
+
static get observedAttributes(): string[];
|
|
336
|
+
connectedCallback(): void;
|
|
337
|
+
disconnectedCallback(): void;
|
|
338
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
339
|
+
get value(): string;
|
|
340
|
+
private hasRendered;
|
|
341
|
+
private getMode;
|
|
342
|
+
private isInputMode;
|
|
343
|
+
private hasDatePanel;
|
|
344
|
+
private hasTimePanel;
|
|
345
|
+
private getLocale;
|
|
346
|
+
private normalizeTime;
|
|
347
|
+
private syncFromValue;
|
|
348
|
+
private composeValue;
|
|
349
|
+
private toDate;
|
|
350
|
+
private getFormat;
|
|
351
|
+
private formatDisplay;
|
|
352
|
+
private parseDisplay;
|
|
353
|
+
private teardown;
|
|
354
|
+
private forwardAttr;
|
|
355
|
+
private buildPanel;
|
|
356
|
+
private render;
|
|
357
|
+
private applyHooks;
|
|
358
|
+
private pushValueToChildren;
|
|
359
|
+
/** Sincroniza aparência/estado do campo com os atributos atuais. */
|
|
360
|
+
private syncField;
|
|
361
|
+
private updateInputDisplay;
|
|
362
|
+
private emitChange;
|
|
363
|
+
private readonly handleCalendarChange;
|
|
364
|
+
private readonly handleClockChange;
|
|
365
|
+
private commitTyped;
|
|
366
|
+
private focusPanel;
|
|
367
|
+
private openPopup;
|
|
368
|
+
private closePopup;
|
|
369
|
+
private readonly handleOutsidePointer;
|
|
370
|
+
private readonly handleKeydown;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Diálogo modal. O PRÓPRIO host é o painel, aberto como `popover="manual"`
|
|
375
|
+
* (top layer, `::backdrop` como scrim, sem portal nem z-index): os filhos do
|
|
376
|
+
* usuário são o corpo e ficam onde estão, e um filho `slot="footer"` vira o
|
|
377
|
+
* rodapé por CSS. O componente cria o cabeçalho (título `h2` a partir de
|
|
378
|
+
* `label` e botão de fechar) como primeiro filho, marcado `data-ark-chrome`,
|
|
379
|
+
* para a ordem de leitura começar pelo título.
|
|
380
|
+
*
|
|
381
|
+
* `open` é a fonte da verdade: `show()`/`close(reason)` e a propriedade só o
|
|
382
|
+
* alternam, e a saída anima antes de sair do top layer mesmo quando um
|
|
383
|
+
* framework remove o atributo. A Popover API não aplica `inert` ao resto da
|
|
384
|
+
* página: o `trapFocus` de core cobre teclado e ponteiro; um leitor de tela
|
|
385
|
+
* navegando por cursor virtual ainda alcança o conteúdo atrás. A página para
|
|
386
|
+
* de rolar enquanto aberto (`lockScroll` de core), salvo com `no-scroll-lock`.
|
|
387
|
+
*/
|
|
388
|
+
declare class ArkDialog extends HTMLElement {
|
|
389
|
+
static readonly tagName = "ark-dialog";
|
|
390
|
+
private headerEl;
|
|
391
|
+
private titleEl;
|
|
392
|
+
private closeEl;
|
|
393
|
+
private observer;
|
|
394
|
+
private ownClasses;
|
|
395
|
+
private syncingClass;
|
|
396
|
+
/** Visibilidade real: `open` também cobre a animação de entrada; `closing` é a saída ainda visível. */
|
|
397
|
+
private state;
|
|
398
|
+
private releaseTrap;
|
|
399
|
+
/** Motivo pedido por `close(reason)`, lido quando o atributo `open` some. */
|
|
400
|
+
private pendingReason;
|
|
401
|
+
/** Aviso de nome acessível ausente, uma vez por elemento. */
|
|
402
|
+
private warned;
|
|
403
|
+
private readonly titleId;
|
|
404
|
+
/** `aria-labelledby` que o próprio componente escreveu, para não apagar um do usuário. */
|
|
405
|
+
private appliedLabelledBy;
|
|
406
|
+
static get observedAttributes(): string[];
|
|
407
|
+
constructor();
|
|
408
|
+
connectedCallback(): void;
|
|
409
|
+
disconnectedCallback(): void;
|
|
410
|
+
attributeChangedCallback(name: string): void;
|
|
411
|
+
/** Aberto (atributo `open`). */
|
|
412
|
+
get open(): boolean;
|
|
413
|
+
set open(value: boolean | string | null | undefined);
|
|
414
|
+
/** Esc e clique no scrim não fecham. */
|
|
415
|
+
get persistent(): boolean;
|
|
416
|
+
set persistent(value: boolean | string | null | undefined);
|
|
417
|
+
/** A página continua rolando com o diálogo aberto (atributo `no-scroll-lock`). */
|
|
418
|
+
get noScrollLock(): boolean;
|
|
419
|
+
set noScrollLock(value: boolean | string | null | undefined);
|
|
420
|
+
/** Abre o diálogo: adiciona `open`, que faz o resto. */
|
|
421
|
+
show(): void;
|
|
422
|
+
/** Fecha o diálogo publicando `ark-close` com o motivo (padrão "api"); a saída anima antes de esconder. */
|
|
423
|
+
close(reason?: ArkDialogCloseReason): void;
|
|
424
|
+
private openNow;
|
|
425
|
+
private closeNow;
|
|
426
|
+
/** Foco inicial: `autofocus` do usuário, senão o primeiro focável do corpo, senão o botão de fechar, senão o painel. */
|
|
427
|
+
private initialFocus;
|
|
428
|
+
private warnWithoutName;
|
|
429
|
+
private readonly handleKeydown;
|
|
430
|
+
private getSize;
|
|
431
|
+
/** Medidas próprias em custom properties inline do host, lidas pelas classes `ark:w-(--ark-dialog-width)` etc. */
|
|
432
|
+
private syncDimensions;
|
|
433
|
+
private getLocale;
|
|
434
|
+
private computeClasses;
|
|
435
|
+
private syncHeader;
|
|
436
|
+
private syncLabelledBy;
|
|
437
|
+
private syncFooter;
|
|
438
|
+
private applyOwnClasses;
|
|
439
|
+
private updateAppearance;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Estado vazio: caixa de borda tracejada com ícone apagado, título, descrição
|
|
444
|
+
* e ação opcional. O PRÓPRIO host é a caixa: os filhos do usuário
|
|
445
|
+
* (`slot="icon"` e `slot="action"`, um ark-button) ficam onde estão e são
|
|
446
|
+
* ordenados por CSS; título e descrição vêm dos atributos `heading` e
|
|
447
|
+
* `description`, em nós do componente ao fim do host. Filhos sem slot entram
|
|
448
|
+
* entre a descrição e a ação. Não é interativo e não tem role próprio.
|
|
449
|
+
*/
|
|
450
|
+
declare class ArkEmpty extends HTMLElement {
|
|
451
|
+
static readonly tagName = "ark-empty";
|
|
452
|
+
private ownClasses;
|
|
453
|
+
private syncingClass;
|
|
454
|
+
private observer;
|
|
455
|
+
private headingEl;
|
|
456
|
+
private descriptionEl;
|
|
457
|
+
static get observedAttributes(): string[];
|
|
458
|
+
connectedCallback(): void;
|
|
459
|
+
disconnectedCallback(): void;
|
|
460
|
+
attributeChangedCallback(name: string): void;
|
|
461
|
+
private syncText;
|
|
462
|
+
private syncSlots;
|
|
463
|
+
private applyOwnClasses;
|
|
464
|
+
private updateAppearance;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* Campo de texto padronizado da família Ark. Serve tanto de componente público
|
|
469
|
+
* quanto de base visual para orquestradores (ark-datepicker etc.), que colocam
|
|
470
|
+
* seus botões na área de sufixo (`slot="suffix"`) e acessam o campo nativo via
|
|
471
|
+
* `inputElement`/`focus()`.
|
|
472
|
+
*
|
|
473
|
+
* Layout em grid no PRÓPRIO host (ver components.css): label, campo e mensagem
|
|
474
|
+
* são criados pelo componente; os filhos `slot="prefix"` e `slot="suffix"` do
|
|
475
|
+
* usuário ficam onde estão e são posicionados por CSS sobre as pontas do
|
|
476
|
+
* campo — nada é movido. Com `reveal` num campo de senha, o componente cria
|
|
477
|
+
* um botão de mostrar/ocultar na ponta direita. Atributos nativos como
|
|
478
|
+
* `maxlength` ou `inputmode` são espelhados no <input> sem interpretação.
|
|
479
|
+
*/
|
|
480
|
+
declare class ArkInput extends HTMLElement {
|
|
481
|
+
static readonly tagName = "ark-input";
|
|
482
|
+
private inputEl;
|
|
483
|
+
private labelEl;
|
|
484
|
+
private messageEl;
|
|
485
|
+
private revealEl;
|
|
486
|
+
private observer;
|
|
487
|
+
/** Senha visível no momento (só com `reveal`). */
|
|
488
|
+
private revealed;
|
|
489
|
+
static get observedAttributes(): string[];
|
|
490
|
+
connectedCallback(): void;
|
|
491
|
+
disconnectedCallback(): void;
|
|
492
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
493
|
+
/** O <input> nativo interno, para composição por outros componentes. */
|
|
494
|
+
get inputElement(): HTMLInputElement | null;
|
|
495
|
+
get value(): string;
|
|
496
|
+
set value(next: string);
|
|
497
|
+
focus(options?: FocusOptions): void;
|
|
498
|
+
private getIntent;
|
|
499
|
+
private getSlotEl;
|
|
500
|
+
private getLocale;
|
|
501
|
+
private render;
|
|
502
|
+
private syncReveal;
|
|
503
|
+
private updateAppearance;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* Menu suspenso ou de contexto. O PRÓPRIO host é o painel (`role="menu"`),
|
|
508
|
+
* aberto como `popover="auto"` (top layer, light dismiss e Esc nativos, sem
|
|
509
|
+
* portal nem z-index): os itens `ark-menu-item` do usuário ficam onde estão.
|
|
510
|
+
* O gatilho é referenciado por `for="<id>"`: o componente só escreve `aria-*`
|
|
511
|
+
* nele (haspopup, expanded, controls), escuta clique e setas, e nomeia o menu
|
|
512
|
+
* por ele. `openAt(x, y)` abre num ponto (menu de contexto).
|
|
513
|
+
*
|
|
514
|
+
* Posicionado por JS (`positionAnchored` de core) a partir do
|
|
515
|
+
* `getBoundingClientRect()` do gatilho, com flip quando não cabe. A entrada e
|
|
516
|
+
* a saída são transições CSS em components.css, porque o light dismiss de um
|
|
517
|
+
* popover auto não pode ser interceptado por JS para animar antes de esconder.
|
|
518
|
+
*/
|
|
519
|
+
declare class ArkMenu extends HTMLElement {
|
|
520
|
+
static readonly tagName = "ark-menu";
|
|
521
|
+
private ownClasses;
|
|
522
|
+
private syncingClass;
|
|
523
|
+
private childObserver;
|
|
524
|
+
private triggerObserver;
|
|
525
|
+
/** Gatilho com o `aria-*` e os listeners do componente, para limpar ao trocar ou desconectar. */
|
|
526
|
+
private trigger;
|
|
527
|
+
/** Estado real do popover; `open` é refletido a partir dele. */
|
|
528
|
+
private isOpen;
|
|
529
|
+
private syncingOpen;
|
|
530
|
+
private disposePosition;
|
|
531
|
+
/** Ponto de `openAt`, usado como âncora no lugar do gatilho enquanto aberto. */
|
|
532
|
+
private pointAnchor;
|
|
533
|
+
/** Com o menu aberto, o pointerdown no gatilho já fecha por light dismiss; o click que segue não deve reabrir. */
|
|
534
|
+
private suppressTriggerClick;
|
|
535
|
+
static get observedAttributes(): string[];
|
|
536
|
+
constructor();
|
|
537
|
+
connectedCallback(): void;
|
|
538
|
+
disconnectedCallback(): void;
|
|
539
|
+
attributeChangedCallback(name: string): void;
|
|
540
|
+
/** Aberto (atributo `open`, refletido do estado do popover). */
|
|
541
|
+
get open(): boolean;
|
|
542
|
+
set open(value: boolean | string | null | undefined);
|
|
543
|
+
/** Abre ancorado ao gatilho (`for`). */
|
|
544
|
+
show(): void;
|
|
545
|
+
/** Fecha; o foco volta ao gatilho se estava no menu. */
|
|
546
|
+
hide(): void;
|
|
547
|
+
/**
|
|
548
|
+
* Abre num ponto da viewport (menu de contexto), reposicionando para caber. Enquanto aberto assim o popover é
|
|
549
|
+
* `manual`, com o fechamento por clique fora feito pelo componente: no Mac o `contextmenu` dispara no
|
|
550
|
+
* mousedown e o pointerup seguinte faria o light dismiss fechar o menu na hora.
|
|
551
|
+
*/
|
|
552
|
+
openAt(x: number, y: number): void;
|
|
553
|
+
private setPopoverMode;
|
|
554
|
+
private showNow;
|
|
555
|
+
/** Único ponto que muda o estado: chamado por show/hide e pelo `toggle` (light dismiss, popovertarget). */
|
|
556
|
+
private syncOpenState;
|
|
557
|
+
private readonly handleBeforeToggle;
|
|
558
|
+
private readonly handleToggle;
|
|
559
|
+
private isPopoverOpen;
|
|
560
|
+
private place;
|
|
561
|
+
private readonly handleOutsidePointer;
|
|
562
|
+
private resolveTrigger;
|
|
563
|
+
private wireTrigger;
|
|
564
|
+
private readonly handleTriggerPointerdown;
|
|
565
|
+
private readonly handleTriggerClick;
|
|
566
|
+
private readonly handleTriggerKeydown;
|
|
567
|
+
private getItems;
|
|
568
|
+
private enabledItems;
|
|
569
|
+
private focusItem;
|
|
570
|
+
/** Propaga size/theme aos itens depois de mudanças nos filhos ou nos atributos. */
|
|
571
|
+
private syncItems;
|
|
572
|
+
private readonly handleItemSelect;
|
|
573
|
+
private readonly handleKeydown;
|
|
574
|
+
private applyOwnClasses;
|
|
575
|
+
private updateAppearance;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
/**
|
|
579
|
+
* Item de um ark-menu. O PRÓPRIO host é o item (`role="menuitem"`, foco,
|
|
580
|
+
* teclado): ícone e texto são filhos livres e um filho `slot="trailing"`
|
|
581
|
+
* (atalho, badge) vai para o fim por CSS. `checked` faz dele um
|
|
582
|
+
* `menuitemcheckbox` com o check ao fim; `divider` vira `role="separator"`;
|
|
583
|
+
* `static` é conteúdo não interativo (nome e e-mail do usuário) sem role de
|
|
584
|
+
* item. Seleção, foco e teclado são coordenados pelo ark-menu; `size` e
|
|
585
|
+
* `theme` chegam propagados dele.
|
|
586
|
+
*/
|
|
587
|
+
declare class ArkMenuItem extends HTMLElement {
|
|
588
|
+
static readonly tagName = "ark-menu-item";
|
|
589
|
+
private ownClasses;
|
|
590
|
+
private syncingClass;
|
|
591
|
+
private checkEl;
|
|
592
|
+
static get observedAttributes(): string[];
|
|
593
|
+
constructor();
|
|
594
|
+
connectedCallback(): void;
|
|
595
|
+
attributeChangedCallback(name: string): void;
|
|
596
|
+
get value(): string;
|
|
597
|
+
get disabled(): boolean;
|
|
598
|
+
set disabled(value: boolean | string | null | undefined);
|
|
599
|
+
/** Marcado; só faz sentido num item checkbox (atributo `checked` presente, `"false"` é desmarcado). */
|
|
600
|
+
get checked(): boolean;
|
|
601
|
+
set checked(value: boolean | string | null | undefined);
|
|
602
|
+
/** Item selecionável (não é divisor nem conteúdo estático). */
|
|
603
|
+
get interactive(): boolean;
|
|
604
|
+
/** Seleciona o item: emite `ark-select` com o value, que o ark-menu consolida e fecha em seguida. */
|
|
605
|
+
select(): void;
|
|
606
|
+
private kind;
|
|
607
|
+
private readonly handleClick;
|
|
608
|
+
private readonly handleKeydown;
|
|
609
|
+
private getPalette;
|
|
610
|
+
private computeClasses;
|
|
611
|
+
private syncCheck;
|
|
612
|
+
private applyOwnClasses;
|
|
613
|
+
private updateAppearance;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* Agenda/scheduler: exibe eventos em quatro views — `week` e `day` com timeline
|
|
618
|
+
* por horário (eventos posicionados e sobreposições resolvidas em colunas),
|
|
619
|
+
* `month` em grid com chips por dia e `agenda` como lista cronológica.
|
|
620
|
+
*
|
|
621
|
+
* Diferente do ark-calendar (que é uma superfície de SELEÇÃO de data), aqui os
|
|
622
|
+
* eventos são o conteúdo: clicar num evento emite `ark-event-click` e clicar num
|
|
623
|
+
* espaço livre emite `ark-slot-click` (útil para criar um evento).
|
|
624
|
+
*/
|
|
625
|
+
declare class ArkScheduler extends HTMLElement {
|
|
626
|
+
static readonly tagName = "ark-scheduler";
|
|
627
|
+
private root;
|
|
628
|
+
private locale;
|
|
629
|
+
private eventsProp;
|
|
630
|
+
private refDate;
|
|
631
|
+
private nowTimer;
|
|
632
|
+
private navDirection;
|
|
633
|
+
private syncingAttr;
|
|
634
|
+
/** Linhas de "agora" vivas na tela: reposicionadas sem rebuild a cada minuto. */
|
|
635
|
+
private nowLines;
|
|
636
|
+
/** Identifica view + período: se não mudou, o rebuild preserva o scroll do usuário. */
|
|
637
|
+
private lastRenderKey;
|
|
638
|
+
private lastScrollTop;
|
|
639
|
+
static get observedAttributes(): string[];
|
|
640
|
+
connectedCallback(): void;
|
|
641
|
+
disconnectedCallback(): void;
|
|
642
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
643
|
+
/** Lista de eventos (propriedade JS; tem precedência sobre o atributo `events`). */
|
|
644
|
+
get events(): ArkSchedulerEvent[];
|
|
645
|
+
set events(list: ArkSchedulerEvent[]);
|
|
646
|
+
/** View atual. */
|
|
647
|
+
get view(): ArkSchedulerView;
|
|
648
|
+
set view(next: ArkSchedulerView);
|
|
649
|
+
/** Data de referência da view atual (ISO YYYY-MM-DD). */
|
|
650
|
+
get date(): string;
|
|
651
|
+
private parseEventsAttr;
|
|
652
|
+
private getLocale;
|
|
653
|
+
private getIntent;
|
|
654
|
+
private getHourRange;
|
|
655
|
+
private getSlotMinutes;
|
|
656
|
+
private getAvailableViews;
|
|
657
|
+
private formatHour;
|
|
658
|
+
private eventColors;
|
|
659
|
+
private eventStart;
|
|
660
|
+
private eventEnd;
|
|
661
|
+
private eventsForDay;
|
|
662
|
+
/**
|
|
663
|
+
* Resolve sobreposições: agrupa eventos que se cruzam em clusters e distribui
|
|
664
|
+
* cada cluster em colunas lado a lado (padrão de agenda do Google/MUI).
|
|
665
|
+
*/
|
|
666
|
+
private placeEvents;
|
|
667
|
+
private getPalette;
|
|
668
|
+
private getRange;
|
|
669
|
+
private getTitle;
|
|
670
|
+
private navigate;
|
|
671
|
+
private goToToday;
|
|
672
|
+
private syncDateAttr;
|
|
673
|
+
private emitRangeChange;
|
|
674
|
+
private emitEventClick;
|
|
675
|
+
private emitSlotClick;
|
|
676
|
+
private buildHeader;
|
|
677
|
+
private buildEventButton;
|
|
678
|
+
private eventTimeLabel;
|
|
679
|
+
private buildTimeGrid;
|
|
680
|
+
private buildMonthGrid;
|
|
681
|
+
private buildAgenda;
|
|
682
|
+
/** Move só a linha de "agora"; rebuildar a cada minuto custaria o scroll e o foco. */
|
|
683
|
+
private updateNowIndicator;
|
|
684
|
+
private build;
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
/**
|
|
688
|
+
* Campo de seleção padronizado: um <select> nativo estilizado, com teclado,
|
|
689
|
+
* leitor de tela e mobile de graça. Layout em grid no PRÓPRIO host (ver
|
|
690
|
+
* components.css): label, campo, chevron e mensagem são criados pelo
|
|
691
|
+
* componente. As opções vêm de dados (atributo `options` em JSON ou
|
|
692
|
+
* propriedade JS), nunca de filhos: o <select> exige os <option> dentro dele
|
|
693
|
+
* e a lib não move filhos do usuário.
|
|
694
|
+
*/
|
|
695
|
+
declare class ArkSelect extends HTMLElement {
|
|
696
|
+
static readonly tagName = "ark-select";
|
|
697
|
+
private selectEl;
|
|
698
|
+
private labelEl;
|
|
699
|
+
private chevronEl;
|
|
700
|
+
private messageEl;
|
|
701
|
+
private optionsProp;
|
|
702
|
+
/** Assinatura das opções renderizadas; o <select> só é reconstruído quando ela muda. */
|
|
703
|
+
private optionsKey;
|
|
704
|
+
static get observedAttributes(): string[];
|
|
705
|
+
connectedCallback(): void;
|
|
706
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
707
|
+
/** O <select> nativo interno, para composição por outros componentes. */
|
|
708
|
+
get selectElement(): HTMLSelectElement | null;
|
|
709
|
+
/** Opções (propriedade JS; tem precedência sobre o atributo `options`). */
|
|
710
|
+
get options(): ArkSelectOption[];
|
|
711
|
+
set options(list: ArkSelectOption[] | string | null);
|
|
712
|
+
get value(): string;
|
|
713
|
+
set value(next: string);
|
|
714
|
+
focus(options?: FocusOptions): void;
|
|
715
|
+
private parseOptionsAttr;
|
|
716
|
+
private render;
|
|
717
|
+
private readonly handleChange;
|
|
718
|
+
/** Reconstrói os <option> quando placeholder ou opções mudaram; devolve true nesse caso. */
|
|
719
|
+
private syncOptions;
|
|
720
|
+
private applyValue;
|
|
721
|
+
private updateAppearance;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
/**
|
|
725
|
+
* Placeholder de carregamento. O PRÓPRIO host é o bloco (`.ark-skeleton` de
|
|
726
|
+
* core: fundo muted suave e raio), `aria-hidden` porque não há nada para ler.
|
|
727
|
+
* Largura e altura vêm de `class` ou `style` do usuário (padrão 1rem de
|
|
728
|
+
* altura; `ratio` dá a altura pela largura, para imagem e avatar; `color`
|
|
729
|
+
* troca o tint base). `rows` acima de 1 troca o bloco por N barras próprias
|
|
730
|
+
* em coluna, a última mais curta. `animated` liga o brilho que varre
|
|
731
|
+
* (`.ark-skeleton-animated`), com fase sorteada por elemento e escalonada
|
|
732
|
+
* entre as barras, opt-in e parado sob movimento reduzido; o conteúdo que
|
|
733
|
+
* substitui o skeleton
|
|
734
|
+
* entra com `.ark-animate-fade-in`, sem elemento próprio para isso.
|
|
735
|
+
*/
|
|
736
|
+
declare class ArkSkeleton extends HTMLElement {
|
|
737
|
+
static readonly tagName = "ark-skeleton";
|
|
738
|
+
private ownClasses;
|
|
739
|
+
private syncingClass;
|
|
740
|
+
private rowEls;
|
|
741
|
+
/** Fase do brilho deste elemento, sorteada uma vez: skeletons vizinhos não varrem em sincronia. */
|
|
742
|
+
private readonly phase;
|
|
743
|
+
static get observedAttributes(): string[];
|
|
744
|
+
connectedCallback(): void;
|
|
745
|
+
attributeChangedCallback(name: string): void;
|
|
746
|
+
/** Número de barras; 1 (padrão) é o bloco único. */
|
|
747
|
+
get rows(): number;
|
|
748
|
+
set rows(value: number);
|
|
749
|
+
get animated(): boolean;
|
|
750
|
+
set animated(value: boolean | string | null | undefined);
|
|
751
|
+
private getRadius;
|
|
752
|
+
/** `ratio` como valor de aspect-ratio: "16/9", "16:9" ou um número; inválido vira null. */
|
|
753
|
+
private getRatio;
|
|
754
|
+
private skeletonClasses;
|
|
755
|
+
/** Atraso negativo que desloca a fase do brilho; as barras seguem a razão áurea a partir da fase do host. */
|
|
756
|
+
private shimmerDelay;
|
|
757
|
+
private syncRows;
|
|
758
|
+
private applyOwnClasses;
|
|
759
|
+
private updateAppearance;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
/**
|
|
763
|
+
* Interruptor liga/desliga com trilho e polegar. O trilho é um <button>
|
|
764
|
+
* `role="switch"`; um checkbox oculto espelha o estado para o formulário,
|
|
765
|
+
* submetendo `name`/`value` apenas quando marcado. Tem tabela de proporções
|
|
766
|
+
* própria, em vez da escala de altura dos demais controles.
|
|
767
|
+
*/
|
|
768
|
+
declare class ArkSwitch extends HTMLElement {
|
|
769
|
+
static readonly tagName = "ark-switch";
|
|
770
|
+
private trackEl;
|
|
771
|
+
private thumbEl;
|
|
772
|
+
private labelOnEl;
|
|
773
|
+
private labelOffEl;
|
|
774
|
+
private inputEl;
|
|
775
|
+
static get observedAttributes(): string[];
|
|
776
|
+
connectedCallback(): void;
|
|
777
|
+
attributeChangedCallback(): void;
|
|
778
|
+
get checked(): boolean;
|
|
779
|
+
set checked(value: boolean | string | null | undefined);
|
|
780
|
+
toggle(): void;
|
|
781
|
+
private getIntent;
|
|
782
|
+
private getPalette;
|
|
783
|
+
private getSizing;
|
|
784
|
+
private render;
|
|
785
|
+
private updateAppearance;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
/**
|
|
789
|
+
* Aba de um ark-tabs. O PRÓPRIO host é o controle (`role="tab"`, foco,
|
|
790
|
+
* teclado): os filhos do usuário — ícone, texto, badge — ficam onde estão.
|
|
791
|
+
* Na variante `editor` pode ser fechável (`closable`, com botão próprio,
|
|
792
|
+
* clique do meio e tecla Delete) e marcar alterações não salvas (`dirty`).
|
|
793
|
+
* Seleção e roving tabindex são coordenados pelo ark-tabs; `variant`,
|
|
794
|
+
* `size`, `intent`, `theme` e idioma chegam propagados dele.
|
|
795
|
+
*/
|
|
796
|
+
declare class ArkTab extends HTMLElement {
|
|
797
|
+
static readonly tagName = "ark-tab";
|
|
798
|
+
private ownClasses;
|
|
799
|
+
private syncingClass;
|
|
800
|
+
private closeEl;
|
|
801
|
+
private dirtyEl;
|
|
802
|
+
static get observedAttributes(): string[];
|
|
803
|
+
constructor();
|
|
804
|
+
connectedCallback(): void;
|
|
805
|
+
attributeChangedCallback(name: string): void;
|
|
806
|
+
get value(): string;
|
|
807
|
+
/** Aba ativa; o ark-tabs reflete aqui o seu `value`. */
|
|
808
|
+
get selected(): boolean;
|
|
809
|
+
set selected(value: boolean | string | null | undefined);
|
|
810
|
+
get disabled(): boolean;
|
|
811
|
+
set disabled(value: boolean | string | null | undefined);
|
|
812
|
+
get dirty(): boolean;
|
|
813
|
+
set dirty(value: boolean | string | null | undefined);
|
|
814
|
+
/** Fechável só na variante `editor`; nas outras o atributo é ignorado. */
|
|
815
|
+
get closable(): boolean;
|
|
816
|
+
/** Pede a seleção desta aba: emite `change` com o valor, que o ark-tabs consolida. */
|
|
817
|
+
select(): void;
|
|
818
|
+
/** Pede o fechamento: emite `ark-close`; remover a aba do DOM é do app. */
|
|
819
|
+
close(): void;
|
|
820
|
+
private readonly handleClick;
|
|
821
|
+
private readonly handleAuxClick;
|
|
822
|
+
private readonly handleKeydown;
|
|
823
|
+
private getVariant;
|
|
824
|
+
private getFill;
|
|
825
|
+
private getLocale;
|
|
826
|
+
private getPalette;
|
|
827
|
+
private computeClasses;
|
|
828
|
+
private syncClose;
|
|
829
|
+
private syncDirty;
|
|
830
|
+
private applyOwnClasses;
|
|
831
|
+
private updateAppearance;
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
/**
|
|
835
|
+
* Faixa de abas. O PRÓPRIO host é o `role="tablist"` (classes, roving
|
|
836
|
+
* tabindex, teclado): as abas `ark-tab` do usuário ficam onde estão, e um
|
|
837
|
+
* filho `slot="actions"` vai para o fim da faixa. Os painéis são do app: o
|
|
838
|
+
* grupo só publica `change` com o `value` da aba ativa. Três variantes:
|
|
839
|
+
* `underline` (padrão), `chips` e `editor` (abas fecháveis, como um editor).
|
|
840
|
+
*
|
|
841
|
+
* As abas são lidas por atributo, nunca por propriedade: num subárvore
|
|
842
|
+
* inserido de uma vez o grupo pode rodar antes de as abas serem upgraded, e
|
|
843
|
+
* uma propriedade escrita antes do upgrade esconderia o accessor da classe.
|
|
844
|
+
*/
|
|
845
|
+
declare class ArkTabs extends HTMLElement {
|
|
846
|
+
static readonly tagName = "ark-tabs";
|
|
847
|
+
private observer;
|
|
848
|
+
private syncingValue;
|
|
849
|
+
private ownClasses;
|
|
850
|
+
private syncingClass;
|
|
851
|
+
/** `aria-label` que o próprio componente escreveu a partir de `label`, para não apagar um do usuário. */
|
|
852
|
+
private appliedLabel;
|
|
853
|
+
/** Posição da última aba ativa, para eleger a vizinha quando ela é removida. */
|
|
854
|
+
private lastSelectedIndex;
|
|
855
|
+
static get observedAttributes(): string[];
|
|
856
|
+
constructor();
|
|
857
|
+
connectedCallback(): void;
|
|
858
|
+
disconnectedCallback(): void;
|
|
859
|
+
attributeChangedCallback(name: string): void;
|
|
860
|
+
get value(): string;
|
|
861
|
+
set value(next: string);
|
|
862
|
+
private getVariant;
|
|
863
|
+
private getTabs;
|
|
864
|
+
private isEnabled;
|
|
865
|
+
private getActionsEl;
|
|
866
|
+
private readonly handleTabChange;
|
|
867
|
+
private commitValue;
|
|
868
|
+
private readonly handleKeydown;
|
|
869
|
+
/** Reflete o `value` do grupo em cada aba e garante uma parada de Tab quando nenhuma está ativa. */
|
|
870
|
+
private applyValue;
|
|
871
|
+
/** Propaga variant/size/intent/theme/idioma às abas e resolve a seleção depois de mudanças nos filhos. */
|
|
872
|
+
private syncTabs;
|
|
873
|
+
private applyOwnClasses;
|
|
874
|
+
private updateAppearance;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
/**
|
|
878
|
+
* Área de texto padronizada: a mesma grid label / campo / mensagem do
|
|
879
|
+
* ark-input (ver components.css) e os mesmos atributos de label, helper e
|
|
880
|
+
* erro. `rows` dá a altura inicial, `autosize` cresce com o conteúdo
|
|
881
|
+
* (`field-sizing: content` nativo, com fallback por JS), `monospace` e
|
|
882
|
+
* `resize` atendem edição de código e de dados.
|
|
883
|
+
*/
|
|
884
|
+
declare class ArkTextarea extends HTMLElement {
|
|
885
|
+
static readonly tagName = "ark-textarea";
|
|
886
|
+
private textareaEl;
|
|
887
|
+
private labelEl;
|
|
888
|
+
private messageEl;
|
|
889
|
+
/** Autosize por JS quando o navegador não tem field-sizing: a altura é medida a cada input. */
|
|
890
|
+
private autosizeByJs;
|
|
891
|
+
static get observedAttributes(): string[];
|
|
892
|
+
connectedCallback(): void;
|
|
893
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
894
|
+
/** O <textarea> nativo interno, para composição por outros componentes. */
|
|
895
|
+
get textareaElement(): HTMLTextAreaElement | null;
|
|
896
|
+
get value(): string;
|
|
897
|
+
set value(next: string);
|
|
898
|
+
focus(options?: FocusOptions): void;
|
|
899
|
+
private render;
|
|
900
|
+
private supportsFieldSizing;
|
|
901
|
+
private fitHeight;
|
|
902
|
+
private updateAppearance;
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
/**
|
|
906
|
+
* Pilha de toasts da página. Não é chamado diretamente: escuta `ark-toast` e
|
|
907
|
+
* `ark-toast-dismiss` em window, disparados pelo serviço `toast` do
|
|
908
|
+
* @tooark/core, o que mantém serviço e elemento desacoplados. Mostra até
|
|
909
|
+
* `max-visible` de cada vez e enfileira o excedente. A pilha é um
|
|
910
|
+
* `popover="manual"` próprio: fica no top layer sem z-index, acima de
|
|
911
|
+
* dialogs e menus, e é reaberta a cada toast novo para voltar ao topo da
|
|
912
|
+
* pilha do top layer quando um overlay abriu depois dela.
|
|
913
|
+
*/
|
|
914
|
+
declare class ArkToaster extends HTMLElement {
|
|
915
|
+
static readonly tagName = "ark-toaster";
|
|
916
|
+
private root;
|
|
917
|
+
private toasts;
|
|
918
|
+
private timers;
|
|
919
|
+
private entered;
|
|
920
|
+
private exiting;
|
|
921
|
+
static get observedAttributes(): string[];
|
|
922
|
+
connectedCallback(): void;
|
|
923
|
+
disconnectedCallback(): void;
|
|
924
|
+
attributeChangedCallback(): void;
|
|
925
|
+
toast(options: ArkToastOptions): string;
|
|
926
|
+
dismiss(id?: string): void;
|
|
927
|
+
private readonly handleToast;
|
|
928
|
+
private readonly handleDismiss;
|
|
929
|
+
private getPosition;
|
|
930
|
+
private getMaxVisible;
|
|
931
|
+
private getBaseDuration;
|
|
932
|
+
private getCloseLabel;
|
|
933
|
+
private hasCloseButton;
|
|
934
|
+
private hasRichColors;
|
|
935
|
+
private clearTimer;
|
|
936
|
+
private scheduleDismiss;
|
|
937
|
+
private syncPopover;
|
|
938
|
+
private raise;
|
|
939
|
+
private getPalette;
|
|
940
|
+
private getEnterPreset;
|
|
941
|
+
private getExitPreset;
|
|
942
|
+
private getPositionClasses;
|
|
943
|
+
private getToastTypeClasses;
|
|
944
|
+
private getToastIcon;
|
|
945
|
+
private build;
|
|
946
|
+
private render;
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
/**
|
|
950
|
+
* Botão de estado pressionado (`aria-pressed`). O PRÓPRIO host é o controle
|
|
951
|
+
* (classes, role, foco, teclado): os filhos do usuário ficam onde estão.
|
|
952
|
+
* Dentro de um ark-toggle-group vira item de segmented control.
|
|
953
|
+
*/
|
|
954
|
+
declare class ArkToggle extends HTMLElement {
|
|
955
|
+
static readonly tagName = "ark-toggle";
|
|
956
|
+
private ownClasses;
|
|
957
|
+
private syncingClass;
|
|
958
|
+
static get observedAttributes(): string[];
|
|
959
|
+
constructor();
|
|
960
|
+
connectedCallback(): void;
|
|
961
|
+
attributeChangedCallback(name: string): void;
|
|
962
|
+
get pressed(): boolean;
|
|
963
|
+
set pressed(value: boolean | string | null | undefined);
|
|
964
|
+
get disabled(): boolean;
|
|
965
|
+
set disabled(value: boolean | string | null | undefined);
|
|
966
|
+
get value(): string;
|
|
967
|
+
toggle(): void;
|
|
968
|
+
private readonly handleClick;
|
|
969
|
+
private readonly handleKeydown;
|
|
970
|
+
private readonly handleKeyup;
|
|
971
|
+
private isInGroup;
|
|
972
|
+
private getIntent;
|
|
973
|
+
private getPalette;
|
|
974
|
+
private computeClasses;
|
|
975
|
+
private applyOwnClasses;
|
|
976
|
+
private updateAppearance;
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
/**
|
|
980
|
+
* Segmented control de ark-toggle. O PRÓPRIO host é o container
|
|
981
|
+
* (`role="group"` + classes): os itens do usuário ficam onde estão, então
|
|
982
|
+
* frameworks podem adicionar/remover toggles livremente.
|
|
983
|
+
*/
|
|
984
|
+
declare class ArkToggleGroup extends HTMLElement {
|
|
985
|
+
static readonly tagName = "ark-toggle-group";
|
|
986
|
+
private observer;
|
|
987
|
+
private syncingValue;
|
|
988
|
+
private ownClasses;
|
|
989
|
+
private syncingClass;
|
|
990
|
+
static get observedAttributes(): string[];
|
|
991
|
+
constructor();
|
|
992
|
+
connectedCallback(): void;
|
|
993
|
+
disconnectedCallback(): void;
|
|
994
|
+
attributeChangedCallback(name: string): void;
|
|
995
|
+
get value(): string;
|
|
996
|
+
set value(next: string);
|
|
997
|
+
get values(): string[];
|
|
998
|
+
private isMultiple;
|
|
999
|
+
private getToggles;
|
|
1000
|
+
private readonly handleToggleChange;
|
|
1001
|
+
private applyValueToToggles;
|
|
1002
|
+
/** Propaga size/intent/theme/disabled do grupo para os itens. */
|
|
1003
|
+
private syncToggles;
|
|
1004
|
+
private applyOwnClasses;
|
|
1005
|
+
private updateAppearance;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
/**
|
|
1009
|
+
* Dica de contexto. O host envolve o gatilho do usuário (primeiro filho sem
|
|
1010
|
+
* `slot`) sem movê-lo e cria o balão: `role="tooltip"` com `popover="manual"`,
|
|
1011
|
+
* para escapar de `overflow` e ficar no top layer. O texto vem de `content`;
|
|
1012
|
+
* conteúdo rico vem num filho `slot="content"`, que então É o balão (o
|
|
1013
|
+
* componente só escreve `popover`, `role`, `id` e o hook nele; o visual vem do
|
|
1014
|
+
* components.css). O gatilho recebe `aria-describedby` do balão e precisa ser
|
|
1015
|
+
* focável por conta própria.
|
|
1016
|
+
*
|
|
1017
|
+
* Abre em hover (depois de `delay`) e em foco (na hora); fecha ao sair, ao
|
|
1018
|
+
* perder o foco, com Esc e no pointerdown. Posicionado por `positionAnchored`
|
|
1019
|
+
* de core, com flip quando não cabe. Entrada `fade` quick, sem saída animada.
|
|
1020
|
+
*/
|
|
1021
|
+
declare class ArkTooltip extends HTMLElement {
|
|
1022
|
+
static readonly tagName = "ark-tooltip";
|
|
1023
|
+
private ownClasses;
|
|
1024
|
+
private syncingClass;
|
|
1025
|
+
private observer;
|
|
1026
|
+
/** Balão criado pelo componente, usado quando não há filho `slot="content"`. */
|
|
1027
|
+
private ownBubble;
|
|
1028
|
+
/** Balão em uso: o próprio ou o filho `slot="content"` do usuário. */
|
|
1029
|
+
private bubble;
|
|
1030
|
+
private trigger;
|
|
1031
|
+
private openTimer;
|
|
1032
|
+
private disposePosition;
|
|
1033
|
+
private isOpen;
|
|
1034
|
+
private syncingOpen;
|
|
1035
|
+
/** Clique em andamento no gatilho: o foco que ele dá não reabre a dica que o pointerdown acabou de dispensar. */
|
|
1036
|
+
private pointerPressed;
|
|
1037
|
+
private readonly bubbleId;
|
|
1038
|
+
static get observedAttributes(): string[];
|
|
1039
|
+
constructor();
|
|
1040
|
+
connectedCallback(): void;
|
|
1041
|
+
disconnectedCallback(): void;
|
|
1042
|
+
attributeChangedCallback(name: string): void;
|
|
1043
|
+
/** Aberto (atributo `open`, refletido do estado do balão). */
|
|
1044
|
+
get open(): boolean;
|
|
1045
|
+
set open(value: boolean | string | null | undefined);
|
|
1046
|
+
/** Abre na hora, sem o atraso do hover. */
|
|
1047
|
+
show(): void;
|
|
1048
|
+
/** Fecha na hora, sem animação de saída. */
|
|
1049
|
+
hide(): void;
|
|
1050
|
+
private reflectOpen;
|
|
1051
|
+
private getDelay;
|
|
1052
|
+
private getSide;
|
|
1053
|
+
private clearTimer;
|
|
1054
|
+
private scheduleShow;
|
|
1055
|
+
private place;
|
|
1056
|
+
private isInside;
|
|
1057
|
+
private readonly handlePointerOver;
|
|
1058
|
+
private readonly handlePointerOut;
|
|
1059
|
+
private readonly handlePointerDown;
|
|
1060
|
+
private readonly handlePointerUp;
|
|
1061
|
+
private readonly handleFocusIn;
|
|
1062
|
+
private readonly handleFocusOut;
|
|
1063
|
+
private readonly handleDocumentKeydown;
|
|
1064
|
+
private wireTrigger;
|
|
1065
|
+
private syncBubble;
|
|
1066
|
+
private applyOwnClasses;
|
|
1067
|
+
private updateAppearance;
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
/**
|
|
1071
|
+
* Registra os componentes personalizados do Tooark no navegador.
|
|
1072
|
+
* Esta função deve ser chamada antes de usar os componentes em qualquer framework (React, Angular, Vue)
|
|
1073
|
+
* para garantir que eles estejam disponíveis como elementos personalizados.
|
|
1074
|
+
*/
|
|
1075
|
+
declare function registerTooarkComponents(): void;
|
|
1076
|
+
|
|
1077
|
+
export { ArkBadge, ArkButton, ArkCalendar, ArkCarousel, ArkClock, ArkDatepicker, ArkDialog, ArkEmpty, ArkInput, ArkMenu, ArkMenuItem, ArkScheduler, ArkSelect, ArkSkeleton, ArkSwitch, ArkTab, ArkTabs, ArkTextarea, ArkToaster, ArkToggle, ArkToggleGroup, ArkTooltip, registerTooarkComponents };
|