@1doc/1ds-vue 2.9.0 → 2.10.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/CHANGELOG.md +434 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +119 -8
- package/dist/index.mjs +9512 -8153
- package/dist/index.umd.js +4 -4
- package/package.json +3 -3
- package/src/teste/accordion-titulo-neutro.test.mjs +32 -0
- package/src/teste/appsubheader-regiao.test.mjs +18 -0
- package/src/teste/attachmentcard-lista.test.mjs +39 -0
- package/src/teste/attachmentcard-sm.test.mjs +28 -0
- package/src/teste/badge-neutro-colado.test.mjs +30 -0
- package/src/teste/badge-tag.test.mjs +8 -0
- package/src/teste/calendar-slots-cabecalho.test.mjs +46 -0
- package/src/teste/coachmark-sem-veu.test.mjs +70 -0
- package/src/teste/color-picker-xs.test.mjs +28 -0
- package/src/teste/datatable-arvore-variantes.test.mjs +194 -0
- package/src/teste/descriptionlist-compacta.test.mjs +32 -0
- package/src/teste/dom.mjs +2 -0
- package/src/teste/empty-state-titulo-rico.test.mjs +39 -0
- package/src/teste/input-agrupado.test.mjs +44 -0
- package/src/teste/list-item-standalone.test.mjs +75 -0
- package/src/teste/list.test.mjs +2 -1
- package/src/teste/rich-text-editor-alinha-imagem-tabela.test.mjs +164 -0
- package/src/teste/rich-text-editor-estilo-de-texto.test.mjs +87 -0
- package/src/teste/segmented-contador.test.mjs +39 -0
- package/src/teste/select-aberto-controlado-flutuante.test.mjs +120 -0
- package/src/teste/select-filtro-cor-tamanho.test.mjs +62 -0
- package/src/teste/statcard-secundaria-tom.test.mjs +41 -0
- package/src/teste/toast-acao-detalhes.test.mjs +48 -0
- package/src/utils/html-seguro.ts +105 -2
- package/src/utils/toast.ts +12 -2
package/dist/index.d.ts
CHANGED
|
@@ -112,6 +112,8 @@ export interface AccordionProps {
|
|
|
112
112
|
items: AccordionItemData[];
|
|
113
113
|
multiple?: boolean;
|
|
114
114
|
variant?: "default" | "bordered" | "separated";
|
|
115
|
+
/** Título dos itens. `neutral`: 14px na cor do texto, peso médio. @default 'default' */
|
|
116
|
+
titleVariant?: "default" | "neutral";
|
|
115
117
|
className?: string;
|
|
116
118
|
}
|
|
117
119
|
|
|
@@ -429,6 +431,8 @@ export interface AttachmentCardProps {
|
|
|
429
431
|
closePanelOnAction?: boolean;
|
|
430
432
|
onCopyField?: (field: AttachmentCardField) => void;
|
|
431
433
|
icon?: IconProp;
|
|
434
|
+
/** Tamanho do cartão. `sm`: ícone do preview de 40px e ícone do rodapé de 12px. @default 'md' */
|
|
435
|
+
size?: "md" | "sm";
|
|
432
436
|
onOpen?: (event?: any) => void;
|
|
433
437
|
openAriaLabel?: string;
|
|
434
438
|
/** Complemento lido depois do selo, para dizer de qual documento ele é. Recebe o tipo de documento (ou o nome do arquivo). Troque para traduzir. @default (subject) => 'conferência de ' + subject */
|
|
@@ -585,14 +589,24 @@ export interface BadgeProps {
|
|
|
585
589
|
size?: "2xs" | "xs" | "sm" | "md" | "lg" | "pill";
|
|
586
590
|
|
|
587
591
|
/**
|
|
588
|
-
* Cola o badge no canto superior
|
|
592
|
+
* Cola o badge no canto superior do card (rótulo de card, como
|
|
589
593
|
* "Tarefa pendente"): cantos de baixo arredondados, os de cima retos.
|
|
590
594
|
* Posiciona em `absolute`, então o pai precisa de `position: relative`
|
|
591
|
-
* (o `Card` e o `Box` com `position` já servem).
|
|
595
|
+
* (o `Card` e o `Box` com `position` já servem). O canto é o esquerdo, ou o
|
|
596
|
+
* direito com `attachedSide="right"`. Com `variant="neutral"` e `appearance="solid"` o
|
|
597
|
+
* rótulo colado é o cinza claro com texto escuro (o "Tarefa manual" do CrisDoc), e não o
|
|
598
|
+
* cinza escuro do `solid`, pesado demais para um rótulo de card.
|
|
592
599
|
* @default false
|
|
593
600
|
*/
|
|
594
601
|
attached?: boolean;
|
|
595
602
|
|
|
603
|
+
/**
|
|
604
|
+
* Em que canto do card o `attached` cola: `left` (padrão) ou `right`.
|
|
605
|
+
* Só vale com `attached`.
|
|
606
|
+
* @default 'left'
|
|
607
|
+
*/
|
|
608
|
+
attachedSide?: "left" | "right";
|
|
609
|
+
|
|
596
610
|
/**
|
|
597
611
|
* Estilo visual do badge.
|
|
598
612
|
* @default 'soft'
|
|
@@ -903,9 +917,9 @@ export interface CalendarProps {
|
|
|
903
917
|
moreAriaLabel?: string;
|
|
904
918
|
dayLabel?: (iso: string, count: number) => string;
|
|
905
919
|
className?: string;
|
|
906
|
-
/**
|
|
920
|
+
/** Cabeçalho, à esquerda: um filtro de escopo. React: o nó nesta prop. Vue: o slot `#header-start` (com hífen). */
|
|
907
921
|
headerStart?: any;
|
|
908
|
-
/**
|
|
922
|
+
/** Cabeçalho, à direita, antes do seletor de visão: a legenda. React: o nó nesta prop. Vue: o slot `#header-end` (com hífen). */
|
|
909
923
|
headerEnd?: any;
|
|
910
924
|
onDayClick?: (iso: string) => void;
|
|
911
925
|
onEventClick?: (event: CalendarEvent) => void;
|
|
@@ -1097,6 +1111,12 @@ export interface CoachmarkStep {
|
|
|
1097
1111
|
|
|
1098
1112
|
export interface CoachmarkProps {
|
|
1099
1113
|
open?: boolean;
|
|
1114
|
+
/**
|
|
1115
|
+
* `true` (padrão): véu, recorte e foco preso. `false`: o cartão é um popover
|
|
1116
|
+
* ancorado, sem véu nem foco preso. `any` de propósito: no Vue uma prop `boolean`
|
|
1117
|
+
* sem valor chega como `false`, e o tour modal viraria sem véu por engano.
|
|
1118
|
+
*/
|
|
1119
|
+
modal?: any;
|
|
1100
1120
|
steps?: CoachmarkStep[];
|
|
1101
1121
|
step?: number;
|
|
1102
1122
|
defaultStep?: number;
|
|
@@ -1147,7 +1167,7 @@ export interface ColorPickerProps {
|
|
|
1147
1167
|
allowCustom?: boolean;
|
|
1148
1168
|
customLabel?: string;
|
|
1149
1169
|
customErrorMessage?: string;
|
|
1150
|
-
size?: "sm" | "md";
|
|
1170
|
+
size?: "xs" | "sm" | "md";
|
|
1151
1171
|
disabled?: boolean;
|
|
1152
1172
|
id?: string;
|
|
1153
1173
|
className?: string;
|
|
@@ -1382,6 +1402,38 @@ export interface DataTableProps {
|
|
|
1382
1402
|
/** `document`: tabela de conteúdo de documento, imprimível e sem interação. @default 'default' */
|
|
1383
1403
|
variant?: "default" | "document";
|
|
1384
1404
|
density?: "default" | "compact";
|
|
1405
|
+
/** `dark`: cabeçalho navy com texto claro (o do CrisDoc). @default 'default' */
|
|
1406
|
+
headerVariant?: "default" | "dark";
|
|
1407
|
+
/** Rótulos do cabeçalho em caixa alta. @default false */
|
|
1408
|
+
headerUppercase?: boolean;
|
|
1409
|
+
/** Zebra nas linhas ímpares. @default false */
|
|
1410
|
+
striped?: boolean;
|
|
1411
|
+
/** Chaves das linhas destacadas (só visual, sem checkbox; requer `rowKey`). */
|
|
1412
|
+
selectedRowKeys?: Array<string | number>;
|
|
1413
|
+
/** Destaque de linha por função `(row, rowIndex) => boolean`. */
|
|
1414
|
+
isRowSelected?: (row: Record<string, any>, rowIndex: number) => boolean;
|
|
1415
|
+
/** Ícone do estado vazio (objeto Font Awesome importado). @default faInbox */
|
|
1416
|
+
emptyIcon?: IconProp;
|
|
1417
|
+
/** Texto de apoio abaixo de `emptyMessage`. */
|
|
1418
|
+
emptyDescription?: string;
|
|
1419
|
+
/** Esconde o cabeçalho só na tela; o leitor de tela continua lendo as colunas. @default false */
|
|
1420
|
+
hideHeader?: boolean;
|
|
1421
|
+
/** Linhas hierárquicas (`role="treegrid"`), com filhas em `row[childrenKey]`. @default false */
|
|
1422
|
+
treeData?: boolean;
|
|
1423
|
+
/** Campo das linhas filhas. @default 'children' */
|
|
1424
|
+
childrenKey?: string;
|
|
1425
|
+
/** Chaves das linhas expandidas (controlado). */
|
|
1426
|
+
expandedKeys?: Array<string | number>;
|
|
1427
|
+
/** Chaves expandidas na abertura (não controlado). */
|
|
1428
|
+
defaultExpandedKeys?: Array<string | number>;
|
|
1429
|
+
/** Abre a árvore toda na abertura (não controlado). @default false */
|
|
1430
|
+
defaultExpandAll?: boolean;
|
|
1431
|
+
/** Ao expandir ou recolher: `(chavesExpandidas, linha, expandida)`. */
|
|
1432
|
+
onExpand?: (expandedKeys: Array<string | number>, row: Record<string, any>, expanded: boolean) => void;
|
|
1433
|
+
/** Nome acessível do botão de expandir. Troque para traduzir. @default 'Expandir' */
|
|
1434
|
+
expandLabel?: string;
|
|
1435
|
+
/** Nome acessível do botão de recolher. Troque para traduzir. @default 'Recolher' */
|
|
1436
|
+
collapseLabel?: string;
|
|
1385
1437
|
sortKey?: string;
|
|
1386
1438
|
sortDirection?: "asc" | "desc";
|
|
1387
1439
|
skeletonRows?: number;
|
|
@@ -1508,6 +1560,8 @@ export interface DescriptionListProps {
|
|
|
1508
1560
|
layout?: "inline" | "stacked";
|
|
1509
1561
|
columns?: 1 | 2 | 3 | 4;
|
|
1510
1562
|
bordered?: boolean;
|
|
1563
|
+
/** Densidade. `compact`: fonte de 12px e espaço menor entre os pares. @default 'default' */
|
|
1564
|
+
density?: "default" | "compact";
|
|
1511
1565
|
fit?: boolean;
|
|
1512
1566
|
emptyValue?: string;
|
|
1513
1567
|
ariaLabel?: string;
|
|
@@ -1592,7 +1646,8 @@ export interface DropdownProps {
|
|
|
1592
1646
|
|
|
1593
1647
|
export interface EmptyStateProps {
|
|
1594
1648
|
icon?: IconProp;
|
|
1595
|
-
|
|
1649
|
+
/** Título: texto ou conteúdo rico. No Vue, texto, ou o slot `title`. */
|
|
1650
|
+
title?: any;
|
|
1596
1651
|
description?: string;
|
|
1597
1652
|
actionLabel?: string;
|
|
1598
1653
|
onAction?: () => void;
|
|
@@ -1795,6 +1850,12 @@ export interface InputProps {
|
|
|
1795
1850
|
iconRight?: IconProp;
|
|
1796
1851
|
/** Sem borda, fundo e raio, para o campo dentro de um grupo que já tem a moldura. O foco e o erro continuam visíveis. @default false */
|
|
1797
1852
|
borderless?: boolean;
|
|
1853
|
+
/**
|
|
1854
|
+
* O campo dentro de um contêiner que já tem a moldura e o foco (o campo de chips).
|
|
1855
|
+
* Implica `borderless` e tira a altura de campo, o padding e o anel de foco
|
|
1856
|
+
* próprio: o foco vem do contêiner (`:focus-within`). @default false
|
|
1857
|
+
*/
|
|
1858
|
+
grouped?: boolean;
|
|
1798
1859
|
/** Máscara simples. O valor exibido e o de `onChange` já saem formatados. */
|
|
1799
1860
|
mask?: "cpf" | "cnpj" | "cep" | "phone";
|
|
1800
1861
|
|
|
@@ -2004,6 +2065,10 @@ export interface ListItemProps {
|
|
|
2004
2065
|
selected?: boolean;
|
|
2005
2066
|
/** Bloqueia clique e foco. @default false */
|
|
2006
2067
|
disabled?: boolean;
|
|
2068
|
+
/** Dica nativa do navegador: vira o atributo HTML `title` do elemento interativo. */
|
|
2069
|
+
tooltip?: string;
|
|
2070
|
+
/** Sem o `li`: só o elemento interativo, para usar fora de um `List`. @default false */
|
|
2071
|
+
standalone?: boolean;
|
|
2007
2072
|
/** Título da linha. Texto, ou slot `title` para um nó. */
|
|
2008
2073
|
title?: any;
|
|
2009
2074
|
/** Segunda linha. Texto, ou slot `subtitle` para um nó. */
|
|
@@ -2573,6 +2638,15 @@ export type RichTextTool =
|
|
|
2573
2638
|
| "undo"
|
|
2574
2639
|
| "redo"
|
|
2575
2640
|
| "clear"
|
|
2641
|
+
| "alignLeft"
|
|
2642
|
+
| "alignCenter"
|
|
2643
|
+
| "alignRight"
|
|
2644
|
+
| "alignJustify"
|
|
2645
|
+
| "image"
|
|
2646
|
+
| "table"
|
|
2647
|
+
| "fontFamily"
|
|
2648
|
+
| "fontSize"
|
|
2649
|
+
| "textColor"
|
|
2576
2650
|
| "|";
|
|
2577
2651
|
|
|
2578
2652
|
export interface SegmentedControlOption {
|
|
@@ -2581,6 +2655,7 @@ export interface SegmentedControlOption {
|
|
|
2581
2655
|
icon?: any;
|
|
2582
2656
|
ariaLabel?: string;
|
|
2583
2657
|
disabled?: boolean;
|
|
2658
|
+
count?: number | string;
|
|
2584
2659
|
[key: string]: any;
|
|
2585
2660
|
}
|
|
2586
2661
|
|
|
@@ -2604,6 +2679,8 @@ export interface SegmentedControlProps {
|
|
|
2604
2679
|
export interface SelectOption {
|
|
2605
2680
|
label: string;
|
|
2606
2681
|
value: string | number;
|
|
2682
|
+
/** Cor da opção (token): amostra antes do texto, e no gatilho quando escolhida. */
|
|
2683
|
+
color?: string;
|
|
2607
2684
|
[key: string]: any;
|
|
2608
2685
|
}
|
|
2609
2686
|
|
|
@@ -2644,8 +2721,20 @@ export interface SelectProps {
|
|
|
2644
2721
|
size?: "sm" | "md" | "lg";
|
|
2645
2722
|
/** Onde a lista abre. @default 'bottom' */
|
|
2646
2723
|
placement?: "bottom" | "top" | "auto";
|
|
2647
|
-
/** Variante visual. @default 'default' */
|
|
2648
|
-
variant?: "default" | "filter";
|
|
2724
|
+
/** Variante visual. `filter`, `search` e `combo` são o filtro de barra. @default 'default' */
|
|
2725
|
+
variant?: "default" | "filter" | "search" | "combo";
|
|
2726
|
+
/**
|
|
2727
|
+
* Abre/fecha a lista de fora (modo controlado). `any` de propósito: no Vue uma
|
|
2728
|
+
* prop `boolean` sem valor chega como `false`, e `props.open !== undefined`
|
|
2729
|
+
* ficaria sempre verdadeiro (o Select se acharia controlado e nunca abriria).
|
|
2730
|
+
*/
|
|
2731
|
+
open?: any;
|
|
2732
|
+
/** Pede para abrir ou fechar a lista. No modo controlado, o pai decide o novo `open`. */
|
|
2733
|
+
onOpenChange?: (open: boolean) => void;
|
|
2734
|
+
/** Ícone à esquerda do texto do gatilho. */
|
|
2735
|
+
triggerIcon?: IconProp;
|
|
2736
|
+
/** Amostra de cor à esquerda do texto do gatilho (token de cor). */
|
|
2737
|
+
triggerSwatch?: string;
|
|
2649
2738
|
/** Opção "sem filtro" no topo da lista (seleção única). Escolhê-la chama `onChange("")`. */
|
|
2650
2739
|
emptyOptionLabel?: string;
|
|
2651
2740
|
/** Rodapé fixo da lista (ações). React node ou slot `footer` no Vue. */
|
|
@@ -2894,6 +2983,12 @@ export interface StatCardProps {
|
|
|
2894
2983
|
* @default 'bottom'
|
|
2895
2984
|
*/
|
|
2896
2985
|
labelPosition?: "bottom" | "top";
|
|
2986
|
+
/** Segunda medida, menor, à direita da principal. 0 aparece; vazio e ausente não. */
|
|
2987
|
+
secondaryValue?: string | number;
|
|
2988
|
+
/** O que a segunda medida significa. */
|
|
2989
|
+
secondaryLabel?: string;
|
|
2990
|
+
/** Cor do número principal. @default 'default' */
|
|
2991
|
+
valueTone?: "default" | "primary" | "positive" | "negative" | "info";
|
|
2897
2992
|
/**
|
|
2898
2993
|
* Texto de ajuda: mostra o ⓘ ao lado do rótulo, com um Tooltip escuro. É um
|
|
2899
2994
|
* botão focável dentro do cartão; com `onClick` no cartão, evite.
|
|
@@ -3409,6 +3504,22 @@ export interface ToastProps {
|
|
|
3409
3504
|
*/
|
|
3410
3505
|
description?: string;
|
|
3411
3506
|
|
|
3507
|
+
/**
|
|
3508
|
+
* Lista de detalhes, uma linha por item, abaixo da descrição ("Anexo 3 acima
|
|
3509
|
+
* de 10 MB", "Despacho sem assunto").
|
|
3510
|
+
*/
|
|
3511
|
+
details?: string[];
|
|
3512
|
+
|
|
3513
|
+
/**
|
|
3514
|
+
* Rótulo do botão de ação ("Desfazer"). O botão só aparece com `onAction`.
|
|
3515
|
+
*/
|
|
3516
|
+
actionLabel?: string;
|
|
3517
|
+
|
|
3518
|
+
/**
|
|
3519
|
+
* Chamado ao acionar o botão de ação. Depois dele o toast fecha (`onClose`).
|
|
3520
|
+
*/
|
|
3521
|
+
onAction?: (event?: any) => void;
|
|
3522
|
+
|
|
3412
3523
|
/**
|
|
3413
3524
|
* Posição na tela onde o toast é fixado.
|
|
3414
3525
|
* @default 'top-right'
|