@cnc-ti/layout-basic 8.6.0 → 8.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/dist/index.css +423 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +136 -1
- package/dist/index.d.ts +136 -1
- package/dist/index.js +803 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +796 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1157,6 +1157,7 @@ declare class ErroNotificacoes extends Error {
|
|
|
1157
1157
|
readonly status?: number;
|
|
1158
1158
|
constructor(mensagem: string, status?: number);
|
|
1159
1159
|
}
|
|
1160
|
+
declare function normalizarBaseUrl(baseUrl: string): string;
|
|
1160
1161
|
|
|
1161
1162
|
/**
|
|
1162
1163
|
* Sino de notificações do cabeçalho: badge de não lidas, painel com a lista,
|
|
@@ -1191,4 +1192,138 @@ declare class ErroNotificacoes extends Error {
|
|
|
1191
1192
|
*/
|
|
1192
1193
|
declare function HeaderNotifications(props: HeaderNotificationsProps): react_jsx_runtime.JSX.Element;
|
|
1193
1194
|
|
|
1194
|
-
|
|
1195
|
+
type StatusAlerta = 'PENDENTE' | 'CONCLUIDO' | 'CANCELADO';
|
|
1196
|
+
interface Alerta {
|
|
1197
|
+
id: string;
|
|
1198
|
+
titulo: string;
|
|
1199
|
+
dataReferencia: string;
|
|
1200
|
+
lembrarNoDia?: boolean;
|
|
1201
|
+
diasAntes: number;
|
|
1202
|
+
alertasDiasAntes?: number[];
|
|
1203
|
+
dataAlerta: string;
|
|
1204
|
+
mensagem?: string;
|
|
1205
|
+
status: StatusAlerta;
|
|
1206
|
+
enviarEmail?: boolean;
|
|
1207
|
+
criadoEm: string;
|
|
1208
|
+
criadoPor?: {
|
|
1209
|
+
nome: string;
|
|
1210
|
+
email: string;
|
|
1211
|
+
};
|
|
1212
|
+
concluidoEm?: string;
|
|
1213
|
+
canceladoEm?: string;
|
|
1214
|
+
motivoCancelamento?: string;
|
|
1215
|
+
}
|
|
1216
|
+
interface CriarAlertaInput {
|
|
1217
|
+
titulo: string;
|
|
1218
|
+
dataReferencia: string;
|
|
1219
|
+
lembrarNoDia?: boolean;
|
|
1220
|
+
diasAntes?: number;
|
|
1221
|
+
alertasDiasAntes?: number[];
|
|
1222
|
+
mensagem?: string;
|
|
1223
|
+
enviarEmail?: boolean;
|
|
1224
|
+
}
|
|
1225
|
+
type AtualizarAlertaInput = CriarAlertaInput;
|
|
1226
|
+
interface AlertaFormValues {
|
|
1227
|
+
titulo: string;
|
|
1228
|
+
dataReferencia: string;
|
|
1229
|
+
lembrarNoDia: boolean;
|
|
1230
|
+
diasAntes: string;
|
|
1231
|
+
alertasDiasAntes: string[];
|
|
1232
|
+
novoAlertaDiasAntes: string;
|
|
1233
|
+
mensagem: string;
|
|
1234
|
+
enviarEmail: boolean;
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
interface AlertasProps {
|
|
1238
|
+
alertas?: Alerta[];
|
|
1239
|
+
isLoading?: boolean;
|
|
1240
|
+
isSaving?: boolean;
|
|
1241
|
+
isRemovendo?: boolean;
|
|
1242
|
+
podeCriar?: boolean;
|
|
1243
|
+
/**
|
|
1244
|
+
* Criar/editar/concluir/excluir são sempre responsabilidade do projeto que usa
|
|
1245
|
+
* a lib — ela nunca faz essas requisições sozinha. Implemente aqui a chamada
|
|
1246
|
+
* ao backend do próprio projeto (que por sua vez fala com a API de
|
|
1247
|
+
* notificações). Pode ser assíncrono: a lib aguarda antes de fechar o
|
|
1248
|
+
* formulário e atualizar a lista.
|
|
1249
|
+
*/
|
|
1250
|
+
onCriar?: (payload: CriarAlertaInput) => void | Promise<void>;
|
|
1251
|
+
onAtualizar?: (alertaId: string, payload: AtualizarAlertaInput) => void | Promise<void>;
|
|
1252
|
+
onConcluir?: (alertaId: string) => void | Promise<void>;
|
|
1253
|
+
onExcluir?: (alerta: Alerta) => void | Promise<void>;
|
|
1254
|
+
/** E-mail do destinatário. Vira `?email=` no GET da lista de alertas. */
|
|
1255
|
+
email?: string;
|
|
1256
|
+
/** Identificador do sistema chamador, ex.: "gestao-eventos". */
|
|
1257
|
+
sistema?: string;
|
|
1258
|
+
/**
|
|
1259
|
+
* Raiz da API já versionada, ex.: `https://.../v1`. Quando omitida, usa
|
|
1260
|
+
* `URL_PADRAO_NOTIFICACOES`, que aponta para o **ambiente de
|
|
1261
|
+
* desenvolvimento** — em produção passe explicitamente.
|
|
1262
|
+
*/
|
|
1263
|
+
baseUrl?: string;
|
|
1264
|
+
fetchFn?: typeof fetch;
|
|
1265
|
+
eventoId?: number | string;
|
|
1266
|
+
/** Falha ao buscar a lista (GET) ou ao salvar/concluir/excluir (erro relançado por onCriar/onAtualizar/onConcluir/onExcluir). */
|
|
1267
|
+
onErro?: (erro: Error) => void;
|
|
1268
|
+
}
|
|
1269
|
+
declare function Alertas({ alertas: alertasProps, isLoading, isSaving, isRemovendo, podeCriar, onCriar, onAtualizar, onConcluir, onExcluir, baseUrl, sistema, email, fetchFn, eventoId, onErro, }: AlertasProps): react_jsx_runtime.JSX.Element;
|
|
1270
|
+
|
|
1271
|
+
interface FormularioAlertaProps {
|
|
1272
|
+
alertaEmEdicao?: Alerta | null;
|
|
1273
|
+
isSaving?: boolean;
|
|
1274
|
+
onSalvar: (payload: CriarAlertaInput | AtualizarAlertaInput) => void;
|
|
1275
|
+
onCancelar: () => void;
|
|
1276
|
+
}
|
|
1277
|
+
declare function FormularioAlerta({ alertaEmEdicao, isSaving, onSalvar, onCancelar, }: FormularioAlertaProps): react_jsx_runtime.JSX.Element;
|
|
1278
|
+
|
|
1279
|
+
interface AlertaItemProps {
|
|
1280
|
+
alerta: Alerta;
|
|
1281
|
+
disabled?: boolean;
|
|
1282
|
+
selecionado?: boolean;
|
|
1283
|
+
onEditar: () => void;
|
|
1284
|
+
onConcluir: () => void;
|
|
1285
|
+
onExcluir: () => void;
|
|
1286
|
+
}
|
|
1287
|
+
declare function AlertaItem({ alerta, disabled, selecionado, onEditar, onConcluir, onExcluir, }: AlertaItemProps): react_jsx_runtime.JSX.Element;
|
|
1288
|
+
|
|
1289
|
+
/**
|
|
1290
|
+
* Só a leitura (listagem) fala com a API de notificações direto do browser.
|
|
1291
|
+
* Criar, editar, concluir e excluir são sempre responsabilidade do backend do
|
|
1292
|
+
* projeto que usa a lib — não existe função de mutação aqui de propósito.
|
|
1293
|
+
*/
|
|
1294
|
+
declare class ErroAlertas extends Error {
|
|
1295
|
+
readonly status?: number;
|
|
1296
|
+
constructor(mensagem: string, status?: number);
|
|
1297
|
+
}
|
|
1298
|
+
interface ParametrosBuscaAlertas {
|
|
1299
|
+
baseUrl: string;
|
|
1300
|
+
sistema: string;
|
|
1301
|
+
email: string;
|
|
1302
|
+
eventoId?: number | string;
|
|
1303
|
+
fetchFn?: typeof fetch;
|
|
1304
|
+
signal?: AbortSignal;
|
|
1305
|
+
}
|
|
1306
|
+
declare function buscarAlertas({ baseUrl, sistema, email, fetchFn, signal, eventoId, }: ParametrosBuscaAlertas): Promise<Alerta[]>;
|
|
1307
|
+
|
|
1308
|
+
/**
|
|
1309
|
+
* Só busca a lista de alertas (GET), direto na API de notificações. Criar,
|
|
1310
|
+
* editar, concluir e excluir são sempre responsabilidade do projeto que usa a
|
|
1311
|
+
* lib — ver `onCriar`/`onAtualizar`/`onConcluir`/`onExcluir` em `Alertas`.
|
|
1312
|
+
*/
|
|
1313
|
+
interface OpcoesUsarAlertas {
|
|
1314
|
+
baseUrl?: string;
|
|
1315
|
+
sistema?: string;
|
|
1316
|
+
email?: string;
|
|
1317
|
+
fetchFn?: typeof fetch;
|
|
1318
|
+
eventoId?: number | string;
|
|
1319
|
+
habilitado?: boolean;
|
|
1320
|
+
onErro?: (erro: Error) => void;
|
|
1321
|
+
}
|
|
1322
|
+
interface RetornoUsarAlertas {
|
|
1323
|
+
alertas: Alerta[];
|
|
1324
|
+
carregando: boolean;
|
|
1325
|
+
atualizar: () => void;
|
|
1326
|
+
}
|
|
1327
|
+
declare function usarAlertas({ baseUrl, sistema, email, fetchFn, eventoId, habilitado, onErro, }: OpcoesUsarAlertas): RetornoUsarAlertas;
|
|
1328
|
+
|
|
1329
|
+
export { type Alerta, type AlertaFormValues, AlertaItem, type AlertaItemProps, Alertas, type AlertasProps, AplicationsHeader, type AppInput, type AppItem, AppsMenu, type AppsMenuProps, type AtualizarAlertaInput, Avatar, type AvatarProps, Badge, type BadgeSize, type BadgeVariant, Button, type ButtonProps, Card, CardContent, CardFooter, CardFooterItem, CardHeader, CardList, type CardListProps, Checkbox, type CheckboxProps, Collapsible, AnimatedCollapsibleContent as CollapsibleContent, CollapsibleTrigger, Combobox, type ComboboxFooterAction, type ComboboxFooterRenderContext, type ComboboxProps, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ConfirmDialog, type ConfirmDialogProps, type CriarAlertaInput, DIAS_SEMANA_PT_BR, DateTimeRangeList, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerBody, DrawerClose, DrawerContent, type DrawerContentProps, DrawerContext, type DrawerContextValue, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerProvider, type DrawerProviderProps, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, ErroAlertas, ErroNotificacoes, FileList, type FileListItem, type FileListProps, type FileRejection, type FileRejectionReason, FileUpload, type FileUploadProps, Filter, type FilterField, type FilterFieldType, type FilterProps, type FilterValues, FormularioAlerta, type FormularioAlertaProps, Header, HeaderContainer, type HeaderNotificationItem, HeaderNotifications, type HeaderNotificationsBaseProps, type HeaderNotificationsConectadoProps, type HeaderNotificationsControladoProps, type HeaderNotificationsProps, HeaderProfileHeader, HeaderProfileItem, type HeaderProps, Input, type InputProps, type ItemOption, LabelValue, type LabelValueProps, MESES_PT_BR, MESES_PT_BR_ABREV, MiniMonthCalendar, type MiniMonthCalendarDay, type MiniMonthCalendarProps, Modal, ModalEntidade, ModalMudancaEntidade, type ModalProps, type MonthDay, MonthYearPicker, type MonthYearPickerProps, MultiSelect, type MultiSelectOption, type MultiSelectProps, type Notificacao, type OpcoesUsarAlertas, PageHeader, PageHeaderActionsContainer, PageHeaderTitle, PageHeaderTitleContent, type ParametrosBuscaAlertas, type PeriodRange, type PeriodRangeInputType, PeriodRangeList, type PeriodRangeListLabels, type PeriodRangeListProps, type PeriodRangeListValidateOptions, Popover, PopoverContent, PopoverTrigger, ResultMetadata, type ResultMetadataGender, type ResultMetadataProps, type RetornoUsarAlertas, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectPortal, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SelectViewport, Sidebar, SidebarContainer, type SidebarContainerProps, SidebarImageBrand, type SidebarImageBrandProps, SidebarNavCollapse, type SidebarNavCollapseProps, SidebarNavLink, type SidebarNavLinkProps, type SidebarProps, type StatusAlerta, type StatusLeitura, type StatusNotificacao, Switch, type SwitchProps, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, Title, Tooltip, type TooltipProps, URL_PADRAO_NOTIFICACOES, type ValidateFilesOptions, availableApps, buildMonthDays, buscarAlertas, buttonVariants, formatDayAriaLabel, formatFileSize, formatMonthYear, isSameDay, isToday, normalizarBaseUrl, toDateKey, toLocalNoon, usarAlertas, useDrawer, validateFiles };
|