melhoria no componente de data
This commit is contained in:
parent
dbf08a312d
commit
85658f80d0
12 changed files with 2542 additions and 2569 deletions
4708
dist/eli-vue.es.js
vendored
4708
dist/eli-vue.es.js
vendored
File diff suppressed because one or more lines are too long
60
dist/eli-vue.umd.js
vendored
60
dist/eli-vue.umd.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -1,5 +1,14 @@
|
|||
import dayjs from "dayjs";
|
||||
import type { CelulaCalendario, EntradaDataHora } from "./useDataHora";
|
||||
export interface CelulaCalendario {
|
||||
dia: number;
|
||||
data: dayjs.Dayjs;
|
||||
atual: boolean;
|
||||
hoje: boolean;
|
||||
selecionado: boolean;
|
||||
desabilitado: boolean;
|
||||
}
|
||||
export declare const OPCOES_HORAS: string[];
|
||||
export declare const OPCOES_MINUTOS: string[];
|
||||
/**
|
||||
* Gera as 42 células (6 semanas) do calendário para o mês de referência.
|
||||
* Preenche dias do mês anterior, atual e posterior para alinhar a grade.
|
||||
|
|
@ -10,7 +19,7 @@ export declare function gerarCelulas(referencia: dayjs.Dayjs, diaSelecionado: da
|
|||
* @param valor - string ISO 8601 ou null
|
||||
* @param modo - "data" exibe apenas a data, "dataHora" inclui hora
|
||||
*/
|
||||
export declare function formatarValor(valor: string | null, modo: EntradaDataHora["opcoes"]["modo"]): string;
|
||||
export declare function formatarValor(valor: string | null, modo: "data" | "dataHora"): string;
|
||||
/**
|
||||
* Aplica máscara visual de data/hora (DD/MM/YYYY ou DD/MM/YYYY HH:mm) em texto digitado.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -2,18 +2,10 @@ import dayjs from "dayjs";
|
|||
import "dayjs/locale/pt-br";
|
||||
import type { CampoDensidade, CampoVariante } from "../../../tipos";
|
||||
import type { PadroesEntradas } from "../tiposEntradas";
|
||||
import { type CelulaCalendario } from "./calendarioHelpers";
|
||||
import { diasSemana, MESES } from "./useDataHoraProps";
|
||||
export { diasSemana, MESES };
|
||||
export { type CelulaCalendario, diasSemana, MESES };
|
||||
export type EntradaDataHora = PadroesEntradas["dataHora"];
|
||||
export interface CelulaCalendario {
|
||||
dia: number;
|
||||
data: dayjs.Dayjs;
|
||||
atual: boolean;
|
||||
hoje: boolean;
|
||||
selecionado: boolean;
|
||||
desabilitado: boolean;
|
||||
}
|
||||
/** Função de emit genérica do Vue (compatível com defineComponent) */
|
||||
type EmitFn = (event: string, payload?: unknown) => void;
|
||||
type Props = {
|
||||
value?: string | null;
|
||||
|
|
@ -405,6 +397,7 @@ export declare function useDataHora(props: Props, emit: EmitFn): {
|
|||
fechar: () => void;
|
||||
navegarMes: (delta: number) => void;
|
||||
selecionarDia: (cell: CelulaCalendario) => void;
|
||||
definirAgora: () => void;
|
||||
confirmar: () => void;
|
||||
limpar: () => void;
|
||||
onTextInput: (e: Event) => void;
|
||||
|
|
|
|||
|
|
@ -55,5 +55,5 @@ export declare function useDataHoraProps({ props, referencia, diaSelecionado }:
|
|||
anoAtual: import("vue").ComputedRef<number>;
|
||||
mesAtual: import("vue").ComputedRef<number>;
|
||||
listaAnos: import("vue").ComputedRef<number[]>;
|
||||
celulas: import("vue").ComputedRef<import("./useDataHora").CelulaCalendario[]>;
|
||||
celulas: import("vue").ComputedRef<import("./calendarioHelpers").CelulaCalendario[]>;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue