@seedgrid/fe-components 2026.11.1 → 2026.11.3
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/ai/seedgrid-components.manifest.json +1527 -89
- package/dist/buttons/SgButton.d.ts +6 -2
- package/dist/buttons/SgButton.d.ts.map +1 -1
- package/dist/buttons/SgButton.js +2 -2
- package/dist/buttons/SgButton.meta.js +3 -3
- package/dist/buttons/SgFloatActionButton.d.ts +2 -2
- package/dist/buttons/SgFloatActionButton.d.ts.map +1 -1
- package/dist/buttons/SgFloatActionButton.js +7 -7
- package/dist/buttons/SgFloatActionButton.meta.js +2 -2
- package/dist/buttons/SgSplitButton.d.ts +2 -2
- package/dist/buttons/SgSplitButton.d.ts.map +1 -1
- package/dist/buttons/SgSplitButton.js +4 -4
- package/dist/buttons/SgSplitButton.meta.js +3 -3
- package/dist/commons/SgAvatar.d.ts +2 -2
- package/dist/commons/SgAvatar.d.ts.map +1 -1
- package/dist/commons/SgAvatar.js +3 -3
- package/dist/commons/SgBadge.d.ts +1 -1
- package/dist/commons/SgBadge.d.ts.map +1 -1
- package/dist/commons/SgBadge.js +3 -3
- package/dist/generated/compiledStyles.d.ts +1 -1
- package/dist/generated/compiledStyles.d.ts.map +1 -1
- package/dist/generated/compiledStyles.js +1 -1
- package/dist/i18n/en-US.d.ts.map +1 -1
- package/dist/i18n/en-US.js +55 -0
- package/dist/i18n/es.d.ts.map +1 -1
- package/dist/i18n/es.js +55 -0
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +55 -0
- package/dist/i18n/pt-BR.d.ts.map +1 -1
- package/dist/i18n/pt-BR.js +55 -0
- package/dist/i18n/pt-PT.d.ts.map +1 -1
- package/dist/i18n/pt-PT.js +55 -0
- package/dist/index.d.ts +12 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/inputs/SgAutocomplete.d.ts +1 -1
- package/dist/inputs/SgAutocomplete.d.ts.map +1 -1
- package/dist/inputs/SgAutocomplete.js +3 -3
- package/dist/inputs/SgCameraCapture.d.ts +25 -0
- package/dist/inputs/SgCameraCapture.d.ts.map +1 -0
- package/dist/inputs/SgCameraCapture.js +114 -0
- package/dist/inputs/SgCameraCapture.meta.d.ts +4 -0
- package/dist/inputs/SgCameraCapture.meta.d.ts.map +1 -0
- package/dist/inputs/SgCameraCapture.meta.js +63 -0
- package/dist/inputs/SgCheckboxGroup.d.ts +2 -2
- package/dist/inputs/SgCheckboxGroup.d.ts.map +1 -1
- package/dist/inputs/SgCheckboxGroup.js +12 -12
- package/dist/inputs/SgCombobox.js +5 -5
- package/dist/inputs/SgDatatable.js +11 -11
- package/dist/inputs/SgDatatable.meta.d.ts.map +1 -1
- package/dist/inputs/SgDatatable.meta.js +4 -1
- package/dist/inputs/SgFileUpload.d.ts +69 -0
- package/dist/inputs/SgFileUpload.d.ts.map +1 -0
- package/dist/inputs/SgFileUpload.js +234 -0
- package/dist/inputs/SgFileUpload.meta.d.ts +4 -0
- package/dist/inputs/SgFileUpload.meta.d.ts.map +1 -0
- package/dist/inputs/SgFileUpload.meta.js +71 -0
- package/dist/inputs/SgImageUpload.d.ts +20 -0
- package/dist/inputs/SgImageUpload.d.ts.map +1 -0
- package/dist/inputs/SgImageUpload.js +74 -0
- package/dist/inputs/SgImageUpload.meta.d.ts +4 -0
- package/dist/inputs/SgImageUpload.meta.d.ts.map +1 -0
- package/dist/inputs/SgImageUpload.meta.js +73 -0
- package/dist/inputs/SgInputCurrency.d.ts.map +1 -1
- package/dist/inputs/SgInputCurrency.js +6 -4
- package/dist/inputs/SgInputDate.d.ts.map +1 -1
- package/dist/inputs/SgInputDate.js +3 -4
- package/dist/inputs/SgInputDateTime.d.ts +29 -0
- package/dist/inputs/SgInputDateTime.d.ts.map +1 -0
- package/dist/inputs/SgInputDateTime.js +141 -0
- package/dist/inputs/SgInputDateTime.meta.d.ts +4 -0
- package/dist/inputs/SgInputDateTime.meta.d.ts.map +1 -0
- package/dist/inputs/SgInputDateTime.meta.js +73 -0
- package/dist/inputs/SgInputNumber.d.ts.map +1 -1
- package/dist/inputs/SgInputNumber.js +6 -4
- package/dist/inputs/SgInputText.d.ts.map +1 -1
- package/dist/inputs/SgInputText.js +6 -4
- package/dist/inputs/SgInputTextArea.d.ts.map +1 -1
- package/dist/inputs/SgInputTextArea.js +4 -2
- package/dist/inputs/SgMultiSelect.meta.js +1 -1
- package/dist/inputs/SgMultiSelectChips.meta.js +1 -1
- package/dist/inputs/SgMultiSelectDropdown.js +1 -1
- package/dist/inputs/SgOrderList.d.ts +3 -3
- package/dist/inputs/SgOrderList.d.ts.map +1 -1
- package/dist/inputs/SgOrderList.js +13 -13
- package/dist/inputs/SgOrderList.meta.js +1 -1
- package/dist/inputs/SgPeriodSelector.d.ts +1 -1
- package/dist/inputs/SgPeriodSelector.d.ts.map +1 -1
- package/dist/inputs/SgPeriodSelector.js +3 -3
- package/dist/inputs/SgPickList.d.ts +3 -3
- package/dist/inputs/SgPickList.d.ts.map +1 -1
- package/dist/inputs/SgPickList.js +28 -28
- package/dist/inputs/SgPickList.meta.js +1 -1
- package/dist/inputs/SgRadioGroup.d.ts +2 -2
- package/dist/inputs/SgRadioGroup.d.ts.map +1 -1
- package/dist/inputs/SgRadioGroup.js +5 -5
- package/dist/inputs/SgRating.d.ts +1 -1
- package/dist/inputs/SgRating.d.ts.map +1 -1
- package/dist/inputs/SgRating.js +7 -7
- package/dist/inputs/SgRating.meta.js +1 -1
- package/dist/inputs/SgSlider.d.ts +1 -1
- package/dist/inputs/SgSlider.d.ts.map +1 -1
- package/dist/inputs/SgSlider.js +3 -3
- package/dist/inputs/SgSlider.meta.js +1 -1
- package/dist/inputs/SgStepperInput.d.ts +2 -2
- package/dist/inputs/SgStepperInput.d.ts.map +1 -1
- package/dist/inputs/SgStepperInput.js +4 -4
- package/dist/inputs/SgStepperInput.meta.js +1 -1
- package/dist/inputs/SgTextEditor.d.ts +1 -1
- package/dist/inputs/SgTextEditor.d.ts.map +1 -1
- package/dist/inputs/SgTextEditor.js +14 -14
- package/dist/inputs/SgToggleSwitch.meta.js +1 -1
- package/dist/inputs/SgYearPartSelector.d.ts +1 -1
- package/dist/inputs/SgYearPartSelector.d.ts.map +1 -1
- package/dist/inputs/SgYearPartSelector.js +1 -2
- package/dist/inputs/SgYearPartSelector.meta.js +2 -2
- package/dist/inputs/cameraLogic.d.ts +27 -0
- package/dist/inputs/cameraLogic.d.ts.map +1 -0
- package/dist/inputs/cameraLogic.js +57 -0
- package/dist/inputs/dateTimeLogic.d.ts +28 -0
- package/dist/inputs/dateTimeLogic.d.ts.map +1 -0
- package/dist/inputs/dateTimeLogic.js +153 -0
- package/dist/inputs/fileUploadLogic.d.ts +62 -0
- package/dist/inputs/fileUploadLogic.d.ts.map +1 -0
- package/dist/inputs/fileUploadLogic.js +254 -0
- package/dist/inputs/imageUploadLogic.d.ts +31 -0
- package/dist/inputs/imageUploadLogic.d.ts.map +1 -0
- package/dist/inputs/imageUploadLogic.js +70 -0
- package/dist/inputs/useSgMultiSelect.d.ts +1 -1
- package/dist/inputs/useSgMultiSelect.d.ts.map +1 -1
- package/dist/inputs/useSgMultiSelect.js +1 -1
- package/dist/layout/SgAccordion.d.ts +1 -1
- package/dist/layout/SgAccordion.d.ts.map +1 -1
- package/dist/layout/SgAccordion.js +3 -3
- package/dist/layout/SgBreadcrumb.d.ts +1 -1
- package/dist/layout/SgBreadcrumb.d.ts.map +1 -1
- package/dist/layout/SgBreadcrumb.js +1 -1
- package/dist/layout/SgCard.d.ts +1 -1
- package/dist/layout/SgCard.d.ts.map +1 -1
- package/dist/layout/SgCard.js +14 -14
- package/dist/layout/SgMenu.d.ts +1 -1
- package/dist/layout/SgMenu.d.ts.map +1 -1
- package/dist/layout/SgMenu.js +15 -15
- package/dist/layout/SgPageControl.d.ts +1 -1
- package/dist/layout/SgPageControl.d.ts.map +1 -1
- package/dist/layout/SgPageControl.js +4 -4
- package/dist/layout/SgPageControlPage.meta.js +2 -2
- package/dist/layout/SgToolBar.d.ts +1 -1
- package/dist/layout/SgToolBar.d.ts.map +1 -1
- package/dist/layout/SgToolBar.js +4 -4
- package/dist/layout/SgToolbarIconButton.meta.js +2 -2
- package/dist/layout/SgTreeView.d.ts +4 -4
- package/dist/layout/SgTreeView.d.ts.map +1 -1
- package/dist/layout/SgTreeView.js +6 -6
- package/dist/menus/SgDockMenu.d.ts +1 -1
- package/dist/menus/SgDockMenu.d.ts.map +1 -1
- package/dist/menus/SgDockMenu.js +6 -4
- package/dist/notifications/SgNotificationBell.d.ts +51 -0
- package/dist/notifications/SgNotificationBell.d.ts.map +1 -0
- package/dist/notifications/SgNotificationBell.js +348 -0
- package/dist/notifications/SgNotificationBell.meta.d.ts +4 -0
- package/dist/notifications/SgNotificationBell.meta.d.ts.map +1 -0
- package/dist/notifications/SgNotificationBell.meta.js +75 -0
- package/dist/notifications/notificationBellLogic.d.ts +148 -0
- package/dist/notifications/notificationBellLogic.d.ts.map +1 -0
- package/dist/notifications/notificationBellLogic.js +244 -0
- package/dist/overlay/SgConfirmationDialog.d.ts +1 -1
- package/dist/overlay/SgConfirmationDialog.d.ts.map +1 -1
- package/dist/overlay/SgConfirmationDialog.js +1 -1
- package/dist/overlay/SgPopup.d.ts +1 -1
- package/dist/overlay/SgPopup.d.ts.map +1 -1
- package/dist/overlay/SgPopup.js +1 -1
- package/dist/realtime/SgRealtimeProvider.d.ts +5 -0
- package/dist/realtime/SgRealtimeProvider.d.ts.map +1 -1
- package/dist/realtime/SgRealtimeProvider.js +31 -8
- package/dist/sandbox.cjs +77 -66
- package/dist/style.css +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export const sgMeta = {
|
|
2
|
+
version: "0.1",
|
|
3
|
+
componentId: "form.input.file-upload",
|
|
4
|
+
package: "@seedgrid/fe-components",
|
|
5
|
+
exportName: "SgFileUpload",
|
|
6
|
+
slug: "sg-file-upload",
|
|
7
|
+
displayName: "SgFileUpload",
|
|
8
|
+
category: "input",
|
|
9
|
+
subcategory: "file",
|
|
10
|
+
description: "Seleciona um ou varios arquivos (clique ou arrastar e soltar), confere o tipo pelo conteudo e valida quantidade e tamanho (por arquivo e total). Mostra a lista com o icone do tipo e permite remover. Nao envia nada ao servidor: entrega os arquivos ao pai.",
|
|
11
|
+
tags: ["form", "file", "upload", "attachment", "document", "pdf", "spreadsheet", "rhf"],
|
|
12
|
+
capabilities: ["rhf", "controlled", "drag-and-drop", "multiple", "validation"],
|
|
13
|
+
fieldSemantics: ["file", "attachment", "document", "upload", "pdf", "spreadsheet"],
|
|
14
|
+
props: [
|
|
15
|
+
{ name: "id", type: "string", required: true, description: "Identificador unico do campo.", semanticRole: "data", bindable: false },
|
|
16
|
+
{ name: "name", type: "string", description: "Nome do campo para formularios.", semanticRole: "data", bindable: true },
|
|
17
|
+
{ name: "label", type: "string", description: "Rotulo exibido acima da area.", semanticRole: "label", bindable: true },
|
|
18
|
+
{ name: "value", type: "SgFileValue[] | null", description: "Arquivos controlados (sempre lista; um arquivo = lista de um). Um arquivo ja salvo entra como { name, url }.", semanticRole: "data", bindable: true },
|
|
19
|
+
{ name: "mediaType", type: "MediaType[]", description: "Tipos aceitos: image, video, audio, pdf, doc, docx, xls, xlsx, ppt, pptx, csv, txt, zip ou all. O tipo e conferido pelo conteudo do arquivo.", semanticRole: "validation", bindable: true },
|
|
20
|
+
{ name: "accept", type: "string", description: "Tipos extras em texto livre (.pdf, image/png, image/*), separados por virgula; soma-se ao mediaType.", semanticRole: "validation", bindable: true },
|
|
21
|
+
{ name: "maxFiles", type: "number", default: 1, description: "Quantos arquivos o campo guarda. Com 1, escolher outro substitui; maior que 1 liga a selecao multipla.", semanticRole: "validation", bindable: true },
|
|
22
|
+
{ name: "maxSizePerFile", type: "SizeLimit", description: "Tamanho maximo de cada arquivo: bytes (numero) ou texto com unidade (\"500KB\", \"1.5MB\", \"1GB\").", semanticRole: "validation", bindable: true },
|
|
23
|
+
{ name: "maxSizeTotal", type: "SizeLimit", description: "Tamanho maximo da soma dos arquivos: bytes (numero) ou texto com unidade.", semanticRole: "validation", bindable: true },
|
|
24
|
+
{ name: "enabled", type: "boolean", default: true, description: "Desabilita a escolha e a remocao.", semanticRole: "appearance", bindable: true },
|
|
25
|
+
{ name: "onChange", type: "(files: SgFileValue[]) => void", description: "Lista de arquivos validos apos escolher ou remover.", semanticRole: "event", bindable: false },
|
|
26
|
+
{ name: "onError", type: "(code: FileErrorCode, message: string, fileName: string) => void", description: "Arquivo recusado (type, size, total, count). Os demais seguem validos.", semanticRole: "event", bindable: false }
|
|
27
|
+
],
|
|
28
|
+
states: ["default", "focused", "loading", "disabled", "readOnly", "error"],
|
|
29
|
+
examples: [
|
|
30
|
+
{
|
|
31
|
+
id: "basic",
|
|
32
|
+
title: "Basico",
|
|
33
|
+
file: "apps/showcase/src/app/components/sg-file-upload/samples/basico.tsx.sample",
|
|
34
|
+
kind: "sample"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: "many",
|
|
38
|
+
title: "Varios arquivos",
|
|
39
|
+
file: "apps/showcase/src/app/components/sg-file-upload/samples/varios.tsx.sample",
|
|
40
|
+
kind: "sample"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: "playground",
|
|
44
|
+
title: "Playground",
|
|
45
|
+
file: "apps/showcase/src/app/components/sg-file-upload/sg-file-upload.tsx.playground",
|
|
46
|
+
kind: "playground"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
showcase: { route: "/components/sg-file-upload", hasPlayground: true, hasPropsTable: true },
|
|
50
|
+
sdui: { rendererType: "field.file", acceptsDataBinding: true, defaultProps: {} }
|
|
51
|
+
};
|
|
52
|
+
export const aiHints = {
|
|
53
|
+
version: "0.1",
|
|
54
|
+
preferredUseCases: [
|
|
55
|
+
"Anexar um ou varios documentos (PDF, planilhas, apresentacoes, zip) a um cadastro ou solicitacao.",
|
|
56
|
+
"Escolher arquivos validando tipo (pelo conteudo), quantidade e tamanho antes de enviar.",
|
|
57
|
+
"Formularios que precisam de arquivos como campo."
|
|
58
|
+
],
|
|
59
|
+
avoidUseCases: [
|
|
60
|
+
"Fotos e imagens com miniatura, dimensao minima ou proporcao; para isso use SgImageUpload.",
|
|
61
|
+
"Capturar pela camera do dispositivo; para isso use SgCameraCapture.",
|
|
62
|
+
"Envio ao servidor ou progresso de upload; nao fazem parte do componente."
|
|
63
|
+
],
|
|
64
|
+
synonyms: ["file upload", "attachment", "anexar arquivo", "upload de arquivo", "documento", "file picker"],
|
|
65
|
+
relatedEntityFields: ["attachment", "document", "file", "contract", "invoice", "receipt"],
|
|
66
|
+
compositionHints: [
|
|
67
|
+
"Envie os arquivos recebidos em onChange pelo servico de arquivos do host; o componente nunca envia sozinho.",
|
|
68
|
+
"Para imagens com miniatura e regras de dimensao, use SgImageUpload (composicao deste componente)."
|
|
69
|
+
],
|
|
70
|
+
rankingSignals: { freeText: 0, structuredChoice: 0.1, date: 0, number: 0, denseLayout: 0.4 }
|
|
71
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type SgFileUploadProps } from "./SgFileUpload";
|
|
2
|
+
/**
|
|
3
|
+
* SgImageUpload (P133, refeito no P141 como COMPOSICAO do SgFileUpload): so imagens (`mediaType: ["image"]`, tipo
|
|
4
|
+
* conferido pelo conteudo), miniaturas no lugar do icone e as regras que so existem para imagem: largura/altura
|
|
5
|
+
* minimas e proporcao. Valor = lista (uma imagem = lista de uma); `maxFiles` maior que 1 mostra a grade.
|
|
6
|
+
*/
|
|
7
|
+
export type SgImageUploadProps = Omit<SgFileUploadProps, "mediaType" | "extraCheck" | "thumbnailBuilder" | "thumbnailSize" | "dropTextKey" | "dropManyTextKey" | "typeNames" | "pickerAccept" | "keyPrefix"> & {
|
|
8
|
+
/** Restringe os formatos de imagem em texto livre (`.png`, `image/jpeg`), separados por virgula. */
|
|
9
|
+
accept?: string;
|
|
10
|
+
/** Largura minima em px. */
|
|
11
|
+
minWidth?: number;
|
|
12
|
+
/** Altura minima em px. */
|
|
13
|
+
minHeight?: number;
|
|
14
|
+
/** Proporcao largura/altura exigida (1 = quadrada, 16 / 9). */
|
|
15
|
+
aspect?: number;
|
|
16
|
+
/** Altura da miniatura em px (padrao 160; na grade, no maximo 120). */
|
|
17
|
+
previewHeight?: number;
|
|
18
|
+
};
|
|
19
|
+
export declare function SgImageUpload(props: SgImageUploadProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
//# sourceMappingURL=SgImageUpload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SgImageUpload.d.ts","sourceRoot":"","sources":["../../src/inputs/SgImageUpload.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAsC,KAAK,iBAAiB,EAAoB,MAAM,gBAAgB,CAAC;AAE9G;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,iBAAiB,EACjB,WAAW,GAAG,YAAY,GAAG,kBAAkB,GAAG,eAAe,GAAG,aAAa,GAAG,iBAAiB,GAAG,WAAW,GAAG,cAAc,GAAG,WAAW,CACnJ,GAAG;IACF,oGAAoG;IACpG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uEAAuE;IACvE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAqDF,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,2CAgDtD"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { ImageOff } from "lucide-react";
|
|
5
|
+
import { t, useComponentsI18n } from "../i18n";
|
|
6
|
+
import { formatAspect, validateImage } from "./imageUploadLogic";
|
|
7
|
+
import { matchesMedia } from "./fileUploadLogic";
|
|
8
|
+
import { SgFileUpload } from "./SgFileUpload";
|
|
9
|
+
function readDimensions(file) {
|
|
10
|
+
return new Promise((resolve) => {
|
|
11
|
+
const url = URL.createObjectURL(file);
|
|
12
|
+
const img = new Image();
|
|
13
|
+
img.onload = () => {
|
|
14
|
+
URL.revokeObjectURL(url);
|
|
15
|
+
resolve({ width: img.naturalWidth, height: img.naturalHeight });
|
|
16
|
+
};
|
|
17
|
+
img.onerror = () => {
|
|
18
|
+
URL.revokeObjectURL(url);
|
|
19
|
+
resolve(null);
|
|
20
|
+
};
|
|
21
|
+
img.src = url;
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function Thumbnail(props) {
|
|
25
|
+
const { file, id, side } = props;
|
|
26
|
+
const [url, setUrl] = React.useState(null);
|
|
27
|
+
const [broken, setBroken] = React.useState(false);
|
|
28
|
+
React.useEffect(() => {
|
|
29
|
+
setBroken(false);
|
|
30
|
+
if (typeof File !== "undefined" && file instanceof File) {
|
|
31
|
+
const objectUrl = URL.createObjectURL(file);
|
|
32
|
+
setUrl(objectUrl);
|
|
33
|
+
return () => URL.revokeObjectURL(objectUrl);
|
|
34
|
+
}
|
|
35
|
+
setUrl("url" in file && file.url ? file.url : null);
|
|
36
|
+
return undefined;
|
|
37
|
+
}, [file]);
|
|
38
|
+
if (!url || broken) {
|
|
39
|
+
return (_jsx("span", { className: "flex size-full items-center justify-center bg-muted/40 text-muted-foreground", children: _jsx(ImageOff, { className: "size-5", "aria-hidden": "true" }) }));
|
|
40
|
+
}
|
|
41
|
+
return (
|
|
42
|
+
// eslint-disable-next-line @next/next/no-img-element
|
|
43
|
+
_jsx("img", { src: url, alt: file.name, "data-sg": `sg-image-preview-${id}-${file.name}`, width: side, height: side, onError: () => setBroken(true), className: "size-full object-cover" }));
|
|
44
|
+
}
|
|
45
|
+
export function SgImageUpload(props) {
|
|
46
|
+
const i18n = useComponentsI18n();
|
|
47
|
+
const { accept, minWidth, minHeight, aspect, previewHeight = 160, maxFiles, id, ...rest } = props;
|
|
48
|
+
const multi = (maxFiles ?? 1) > 1;
|
|
49
|
+
const side = multi && previewHeight > 120 ? 120 : previewHeight;
|
|
50
|
+
const check = async (file, info) => {
|
|
51
|
+
if ((accept ?? "").trim() && !matchesMedia(file.name, info.mime, undefined, accept)) {
|
|
52
|
+
return { code: "type", message: t(i18n, "components.inputs.fileupload.type", { types: (accept ?? "").trim() }) };
|
|
53
|
+
}
|
|
54
|
+
const needsDimensions = minWidth !== undefined || minHeight !== undefined || aspect !== undefined;
|
|
55
|
+
if (!needsDimensions)
|
|
56
|
+
return null;
|
|
57
|
+
const dims = await readDimensions(file);
|
|
58
|
+
const code = validateImage({ name: "", type: "", size: file.size, width: dims?.width, height: dims?.height }, { accept: "", minWidth, minHeight, aspect });
|
|
59
|
+
if (code === "dimension") {
|
|
60
|
+
return {
|
|
61
|
+
code,
|
|
62
|
+
message: t(i18n, "components.inputs.imageupload.dimension", {
|
|
63
|
+
minWidth: String(minWidth ?? 0),
|
|
64
|
+
minHeight: String(minHeight ?? 0)
|
|
65
|
+
})
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
if (code === "aspect") {
|
|
69
|
+
return { code, message: t(i18n, "components.inputs.imageupload.aspect", { aspect: formatAspect(aspect ?? 1) }) };
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
};
|
|
73
|
+
return (_jsx(SgFileUpload, { ...rest, id: id, maxFiles: maxFiles, keyPrefix: "sg-image", mediaType: ["image"], typeNames: (accept ?? "").trim() ? (accept ?? "").trim() : "image", dropTextKey: "components.inputs.imageupload.drop", dropManyTextKey: "components.inputs.imageupload.dropMany", pickerAccept: (accept ?? "").trim() ? (accept ?? "").trim() : "image/*", extraCheck: check, thumbnailBuilder: (file, size) => _jsx(Thumbnail, { file: file, id: id, side: size }), thumbnailSize: side }));
|
|
74
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SgImageUpload.meta.d.ts","sourceRoot":"","sources":["../../src/inputs/SgImageUpload.meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE9D,eAAO,MAAM,MAAM,EAAE,QAqDpB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,WAmBrB,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export const sgMeta = {
|
|
2
|
+
version: "0.1",
|
|
3
|
+
componentId: "form.input.image-upload",
|
|
4
|
+
package: "@seedgrid/fe-components",
|
|
5
|
+
exportName: "SgImageUpload",
|
|
6
|
+
slug: "sg-image-upload",
|
|
7
|
+
displayName: "SgImageUpload",
|
|
8
|
+
category: "input",
|
|
9
|
+
subcategory: "file",
|
|
10
|
+
description: "Seleciona uma ou varias imagens (clique ou arrastar e soltar), valida tipo (pelo conteudo), tamanho, dimensao minima e proporcao, mostra as miniaturas e permite remover. Composicao do SgFileUpload. Nao envia nada ao servidor: entrega os arquivos ao pai.",
|
|
11
|
+
tags: ["form", "image", "upload", "photo", "avatar", "file", "rhf"],
|
|
12
|
+
capabilities: ["rhf", "controlled", "drag-and-drop", "preview", "validation"],
|
|
13
|
+
fieldSemantics: ["image", "photo", "avatar", "logo", "picture", "attachment"],
|
|
14
|
+
props: [
|
|
15
|
+
{ name: "id", type: "string", required: true, description: "Identificador unico do campo.", semanticRole: "data", bindable: false },
|
|
16
|
+
{ name: "name", type: "string", description: "Nome do campo para formularios.", semanticRole: "data", bindable: true },
|
|
17
|
+
{ name: "label", type: "string", description: "Rotulo exibido acima da area.", semanticRole: "label", bindable: true },
|
|
18
|
+
{ name: "value", type: "SgFileValue[] | null", description: "Imagens controladas (sempre lista; uma imagem = lista de uma). Uma imagem ja salva entra como { name, url }.", semanticRole: "data", bindable: true },
|
|
19
|
+
{ name: "accept", type: "string", description: "Restringe os formatos de imagem em texto livre (.png, image/jpeg), separados por virgula.", semanticRole: "validation", bindable: true },
|
|
20
|
+
{ name: "maxFiles", type: "number", default: 1, description: "Quantas imagens o campo guarda. Com 1, escolher outra substitui; maior que 1 liga a selecao multipla e a grade de miniaturas.", semanticRole: "validation", bindable: true },
|
|
21
|
+
{ name: "maxSizePerFile", type: "SizeLimit", description: "Tamanho maximo de cada imagem: bytes (numero) ou texto com unidade (\"500KB\", \"2MB\").", semanticRole: "validation", bindable: true },
|
|
22
|
+
{ name: "maxSizeTotal", type: "SizeLimit", description: "Tamanho maximo da soma das imagens: bytes (numero) ou texto com unidade.", semanticRole: "validation", bindable: true },
|
|
23
|
+
{ name: "minWidth", type: "number", description: "Largura minima em px.", semanticRole: "validation", bindable: true },
|
|
24
|
+
{ name: "minHeight", type: "number", description: "Altura minima em px.", semanticRole: "validation", bindable: true },
|
|
25
|
+
{ name: "aspect", type: "number", description: "Proporcao largura/altura exigida (1 = quadrada).", semanticRole: "validation", bindable: true },
|
|
26
|
+
{ name: "enabled", type: "boolean", default: true, description: "Desabilita a escolha e a remocao.", semanticRole: "appearance", bindable: true },
|
|
27
|
+
{ name: "onChange", type: "(files: SgFileValue[]) => void", description: "Lista de imagens validas apos escolher ou remover.", semanticRole: "event", bindable: false },
|
|
28
|
+
{ name: "onError", type: "(code: FileErrorCode, message: string, fileName: string) => void", description: "Imagem recusada (type, size, total, count, dimension, aspect). As demais seguem validas.", semanticRole: "event", bindable: false }
|
|
29
|
+
],
|
|
30
|
+
states: ["default", "focused", "loading", "disabled", "readOnly", "error"],
|
|
31
|
+
examples: [
|
|
32
|
+
{
|
|
33
|
+
id: "basic",
|
|
34
|
+
title: "Basico",
|
|
35
|
+
file: "apps/showcase/src/app/components/sg-image-upload/samples/basico.tsx.sample",
|
|
36
|
+
kind: "sample"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: "many",
|
|
40
|
+
title: "Varias imagens",
|
|
41
|
+
file: "apps/showcase/src/app/components/sg-image-upload/samples/varias.tsx.sample",
|
|
42
|
+
kind: "sample"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: "playground",
|
|
46
|
+
title: "Playground",
|
|
47
|
+
file: "apps/showcase/src/app/components/sg-image-upload/sg-image-upload.tsx.playground",
|
|
48
|
+
kind: "playground"
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
showcase: { route: "/components/sg-image-upload", hasPlayground: true, hasPropsTable: true },
|
|
52
|
+
sdui: { rendererType: "field.image", acceptsDataBinding: true, defaultProps: {} }
|
|
53
|
+
};
|
|
54
|
+
export const aiHints = {
|
|
55
|
+
version: "0.1",
|
|
56
|
+
preferredUseCases: [
|
|
57
|
+
"Foto de perfil, avatar, logotipo ou foto de documento com pre-visualizacao.",
|
|
58
|
+
"Escolher uma ou varias imagens validando tipo, tamanho e dimensao antes de enviar.",
|
|
59
|
+
"Formularios que precisam de imagens como campo."
|
|
60
|
+
],
|
|
61
|
+
avoidUseCases: [
|
|
62
|
+
"Arquivos que nao sao imagem (PDF, planilhas); nesses casos use SgFileUpload.",
|
|
63
|
+
"Capturar pela camera do dispositivo; para isso use SgCameraCapture.",
|
|
64
|
+
"Recorte ou compressao de imagem; nao fazem parte do componente."
|
|
65
|
+
],
|
|
66
|
+
synonyms: ["image upload", "photo upload", "avatar picker", "enviar foto", "upload de imagem", "logo upload"],
|
|
67
|
+
relatedEntityFields: ["photo", "avatar", "logo", "image", "picture", "documentPhoto"],
|
|
68
|
+
compositionHints: [
|
|
69
|
+
"Envie os arquivos recebidos em onChange pelo servico de arquivos do host; o componente nunca envia sozinho.",
|
|
70
|
+
"Combine com SgPanel e SgInputText em cadastros de pessoa ou produto."
|
|
71
|
+
],
|
|
72
|
+
rankingSignals: { freeText: 0, structuredChoice: 0.1, date: 0, number: 0, denseLayout: 0.4 }
|
|
73
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SgInputCurrency.d.ts","sourceRoot":"","sources":["../../src/inputs/SgInputCurrency.tsx"],"names":[],"mappings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EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC,WAAW,CAAC,CAAC;IACzE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IAC9C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACjD,CAAC;AA8mBF,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,2CA8D1D;AAGD,eAAO,MAAM,cAAc,wBAAkB,CAAC;AAC9C,MAAM,MAAM,mBAAmB,GAAG,oBAAoB,CAAC"}
|
|
@@ -403,9 +403,11 @@ function SgInputCurrencyBase(props) {
|
|
|
403
403
|
setCaretToEnd(inputRef.current);
|
|
404
404
|
}, [displayValue]);
|
|
405
405
|
const isDisabled = props.enabled === false || props.readOnly || inputProps.readOnly;
|
|
406
|
-
|
|
406
|
+
// O X so aparece com texto, mas o espaco dele fica sempre reservado (o texto do campo nao anda).
|
|
407
|
+
const clearEnabled = (props.clearButton ?? true) && !isDisabled;
|
|
408
|
+
const canShowClear = clearEnabled && isFilled;
|
|
407
409
|
const iconButtonsCount = props.iconButtons?.length ?? 0;
|
|
408
|
-
const hasSuffix =
|
|
410
|
+
const hasSuffix = clearEnabled || iconButtonsCount > 0;
|
|
409
411
|
const paddingLeft = props.prefixIcon ? "pl-10" : "px-3";
|
|
410
412
|
const paddingRight = hasSuffix ? "pr-10" : "pr-3";
|
|
411
413
|
const baseClass = "peer h-11 w-full rounded-md text-sm text-[var(--sg-input-fg,hsl(var(--foreground)))] caret-[var(--sg-input-fg,hsl(var(--foreground)))] placeholder-transparent disabled:text-[var(--sg-input-disabled-fg,hsl(var(--muted-foreground)))] disabled:bg-[var(--sg-input-disabled-bg,hsl(var(--muted)))] focus:outline-none text-right";
|
|
@@ -439,7 +441,7 @@ function SgInputCurrencyBase(props) {
|
|
|
439
441
|
: undefined;
|
|
440
442
|
const labelLeftStyle = prefixPaddingStyle ?? (props.prefixIcon ? "2.5rem" : "0.75rem");
|
|
441
443
|
const iconButtonsPadding = iconButtonsCount > 0 ? `${iconButtonsCount * 1.5}rem` : "0rem";
|
|
442
|
-
const baseRightPadding =
|
|
444
|
+
const baseRightPadding = clearEnabled ? "2rem" : "0.75rem";
|
|
443
445
|
const suffixActionGap = suffixText && hasSuffix ? "0.375rem" : "0rem";
|
|
444
446
|
const suffixPaddingStyle = suffixText
|
|
445
447
|
? `calc(${suffixWidth}px + ${baseRightPadding} + ${iconButtonsPadding} + ${suffixActionGap})`
|
|
@@ -468,7 +470,7 @@ function SgInputCurrencyBase(props) {
|
|
|
468
470
|
? "peer-focus:-top-2 peer-focus:text-xs peer-focus:text-[hsl(var(--destructive))]"
|
|
469
471
|
: "peer-focus:-top-2 peer-focus:text-xs peer-focus:text-[hsl(var(--primary))]",
|
|
470
472
|
props.labelClassName ?? ""
|
|
471
|
-
].join(" "), style: { left: labelLeftStyle }, children: [_jsx("span", { children: labelText }), props.required ? (_jsx("span", { className: "ml-1 text-[hsl(var(--destructive))]", "aria-hidden": "true", children: "*" })) : null] }), hasSuffix ? (_jsxs("span", { className: "absolute right-2 top-1/2 z-20 flex -translate-y-1/2 items-center gap-1", style: clearRightStyle ? { right: clearRightStyle } : undefined, children: [
|
|
473
|
+
].join(" "), style: { left: labelLeftStyle }, children: [_jsx("span", { children: labelText }), props.required ? (_jsx("span", { className: "ml-1 text-[hsl(var(--destructive))]", "aria-hidden": "true", children: "*" })) : null] }), hasSuffix ? (_jsxs("span", { className: "absolute right-2 top-1/2 z-20 flex -translate-y-1/2 items-center gap-1", style: clearRightStyle ? { right: clearRightStyle } : undefined, children: [clearEnabled ? (isFilled ? (_jsx("button", { type: "button", tabIndex: -1, onMouseDown: (event) => event.preventDefault(), onClick: handleClear, className: "rounded px-1 text-xs text-foreground/60 hover:text-foreground", "aria-label": t(i18n, "components.actions.clear"), children: _jsx(X, { size: 16 }) })) : (_jsx("span", { "aria-hidden": "true", className: "inline-block w-6" }))) : null, props.iconButtons?.map((node, index) => (_jsx("span", { children: node }, index)))] })) : null] }), _jsx("div", { className: "mt-1 flex items-center justify-between gap-2", children: _jsx(ErrorText, { message: props.error ?? internalError ?? undefined }) })] }));
|
|
472
474
|
}
|
|
473
475
|
export function SgInputCurrency(props) {
|
|
474
476
|
const i18n = useComponentsI18n();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SgInputDate.d.ts","sourceRoot":"","sources":["../../src/inputs/SgInputDate.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"SgInputDate.d.ts","sourceRoot":"","sources":["../../src/inputs/SgInputDate.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAMnE,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,GAAG;IAC9D,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAmCF,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CA0JlD"}
|
|
@@ -5,6 +5,7 @@ import { SgInputText } from "./SgInputText";
|
|
|
5
5
|
import { resolveFieldError } from "../rhf";
|
|
6
6
|
import { t, useComponentsI18n } from "../i18n";
|
|
7
7
|
import { useDarkFlag } from "../gadgets/clock/themes/useDarkFlag";
|
|
8
|
+
import { formatLocalizedDate } from "./dateTimeLogic";
|
|
8
9
|
function toDateValue(value) {
|
|
9
10
|
if (!value)
|
|
10
11
|
return undefined;
|
|
@@ -16,12 +17,10 @@ function formatDateDisplay(value, locale) {
|
|
|
16
17
|
const iso = toDateValue(value);
|
|
17
18
|
if (!iso)
|
|
18
19
|
return "";
|
|
19
|
-
|
|
20
|
-
return iso;
|
|
21
|
-
const [year, month, day] = iso.split("-");
|
|
20
|
+
const [year, month, day] = iso.slice(0, 10).split("-");
|
|
22
21
|
if (!year || !month || !day)
|
|
23
22
|
return iso;
|
|
24
|
-
return
|
|
23
|
+
return formatLocalizedDate(Number(year), Number(month), Number(day), locale);
|
|
25
24
|
}
|
|
26
25
|
function parseDateValue(value) {
|
|
27
26
|
const date = new Date(value);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type SgInputTextProps } from "./SgInputText";
|
|
2
|
+
export type SgInputDateTimeProps = Omit<SgInputTextProps, "type" | "onChange"> & {
|
|
3
|
+
/** Instante controlado: ISO 8601 (com offset ou "Z") ou `Date`. `null`/"" limpa o campo. */
|
|
4
|
+
value?: string | Date | null;
|
|
5
|
+
/** Instante inicial (campo nao controlado). */
|
|
6
|
+
defaultValue?: string | Date | null;
|
|
7
|
+
/**
|
|
8
|
+
* Disparado a cada alteracao com o instante em ISO 8601 UTC (`2026-11-03T17:30:00.000Z`) ou `null` se o
|
|
9
|
+
* campo ficou vazio/incompleto/invalido; `local` e o texto do campo (`2026-11-03T14:30`) no fuso do campo.
|
|
10
|
+
*/
|
|
11
|
+
onChange?: (value: string | null, local: string) => void;
|
|
12
|
+
/** Disparado ao receber foco — padrao seedgrid. */
|
|
13
|
+
onEnter?: () => void;
|
|
14
|
+
/** Disparado ao perder o foco (apos validacao) — padrao seedgrid. */
|
|
15
|
+
onExit?: () => void;
|
|
16
|
+
/** Menor instante permitido (ISO 8601 ou `Date`). */
|
|
17
|
+
minDate?: string | Date;
|
|
18
|
+
/** Maior instante permitido (ISO 8601 ou `Date`). */
|
|
19
|
+
maxDate?: string | Date;
|
|
20
|
+
/** Fuso em que o campo mostra e interpreta a hora: "local" (padrao), "UTC", "+03:00" ou nome IANA. */
|
|
21
|
+
timeZone?: string;
|
|
22
|
+
/** Mostra e aceita segundos. */
|
|
23
|
+
showSeconds?: boolean;
|
|
24
|
+
/** Passo dos minutos (1, 5, 10, 15, 30...). Ignorado com `showSeconds`. */
|
|
25
|
+
minuteStep?: number;
|
|
26
|
+
alwaysFloat?: boolean;
|
|
27
|
+
};
|
|
28
|
+
export declare function SgInputDateTime(props: SgInputDateTimeProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
//# sourceMappingURL=SgInputDateTime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SgInputDateTime.d.ts","sourceRoot":"","sources":["../../src/inputs/SgInputDateTime.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAYnE,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,gBAAgB,EAAE,MAAM,GAAG,UAAU,CAAC,GAAG;IAC/E,4FAA4F;IAC5F,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAC7B,+CAA+C;IAC/C,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IACpC;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzD,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,sGAAsG;IACtG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,2EAA2E;IAC3E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AASF,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,2CAwK1D"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { SgInputText } from "./SgInputText";
|
|
5
|
+
import { resolveFieldError } from "../rhf";
|
|
6
|
+
import { t, useComponentsI18n } from "../i18n";
|
|
7
|
+
import { useDarkFlag } from "../gadgets/clock/themes/useDarkFlag";
|
|
8
|
+
import { formatWallClock, instantToWallClock, snapMinutes, validateDateTime, wallClockToInstant } from "./dateTimeLogic";
|
|
9
|
+
/** Teto do atributo HTML quando nao ha `maxDate` (o <input> aceitaria ano de 6 digitos). */
|
|
10
|
+
const WIDGET_MAX = "9999-12-31T23:59";
|
|
11
|
+
function localOf(value, timeZone, showSeconds) {
|
|
12
|
+
return instantToWallClock(value ?? undefined, timeZone, showSeconds);
|
|
13
|
+
}
|
|
14
|
+
export function SgInputDateTime(props) {
|
|
15
|
+
const i18n = useComponentsI18n();
|
|
16
|
+
const isDark = useDarkFlag();
|
|
17
|
+
const { value, defaultValue, onChange, minDate, maxDate, timeZone, showSeconds = false, minuteStep, inputProps, alwaysFloat, required, requiredMessage, validateOnBlur, validation, onValidation, error, ...rest } = props;
|
|
18
|
+
const rhfManaged = Boolean(rest.control && rest.name);
|
|
19
|
+
const controlled = value !== undefined;
|
|
20
|
+
const [innerLocal, setInnerLocal] = React.useState(() => localOf(defaultValue, timeZone, showSeconds));
|
|
21
|
+
const local = controlled ? localOf(value, timeZone, showSeconds) : innerLocal;
|
|
22
|
+
const labelText = rest.labelText ?? rest.label ?? "";
|
|
23
|
+
const [internalError, setInternalError] = React.useState(null);
|
|
24
|
+
const hasError = Boolean(error ?? internalError);
|
|
25
|
+
const [hasInteracted, setHasInteracted] = React.useState(false);
|
|
26
|
+
// Segmentos digitados pela metade: o <input type="datetime-local"> entrega "" (validity.badInput). Em modo controlado o
|
|
27
|
+
// React devolveria o `value` antigo e o campo voltaria ao valor anterior; enquanto parcial, o DOM segue sem ser reescrito.
|
|
28
|
+
const [partial, setPartial] = React.useState(false);
|
|
29
|
+
React.useEffect(() => {
|
|
30
|
+
setPartial(false);
|
|
31
|
+
}, [local]);
|
|
32
|
+
const minLocal = minDate ? instantToWallClock(minDate, timeZone, showSeconds) : undefined;
|
|
33
|
+
const maxLocal = maxDate ? instantToWallClock(maxDate, timeZone, showSeconds) : undefined;
|
|
34
|
+
const effectiveStep = showSeconds ? 1 : minuteStep && minuteStep > 1 ? minuteStep * 60 : undefined;
|
|
35
|
+
const runValidation = React.useCallback((text) => {
|
|
36
|
+
const report = (message) => {
|
|
37
|
+
setInternalError(message);
|
|
38
|
+
onValidation?.(message);
|
|
39
|
+
};
|
|
40
|
+
if (!text && required)
|
|
41
|
+
return report(requiredMessage ?? t(i18n, "components.inputs.required"));
|
|
42
|
+
if (!text)
|
|
43
|
+
return report(null);
|
|
44
|
+
const custom = validation?.(text) ?? null;
|
|
45
|
+
if (custom)
|
|
46
|
+
return report(custom);
|
|
47
|
+
const code = validateDateTime(text, { required, min: minDate, max: maxDate, timeZone });
|
|
48
|
+
if (code === "invalid")
|
|
49
|
+
return report(t(i18n, "components.inputs.datetime.invalid"));
|
|
50
|
+
if (code === "min" || code === "max" || code === "range") {
|
|
51
|
+
const min = minLocal ? formatWallClock(minLocal, i18n.locale, showSeconds) : "";
|
|
52
|
+
const max = maxLocal ? formatWallClock(maxLocal, i18n.locale, showSeconds) : "";
|
|
53
|
+
return report(code === "range"
|
|
54
|
+
? t(i18n, "components.inputs.datetime.range", { min, max })
|
|
55
|
+
: code === "min"
|
|
56
|
+
? t(i18n, "components.inputs.datetime.min", { min })
|
|
57
|
+
: t(i18n, "components.inputs.datetime.max", { max }));
|
|
58
|
+
}
|
|
59
|
+
return report(null);
|
|
60
|
+
}, [i18n, maxDate, maxLocal, minDate, minLocal, onValidation, required, requiredMessage, showSeconds, timeZone, validation]);
|
|
61
|
+
// A mensagem de erro e texto pronto: ao trocar o idioma ela e recalculada com o valor atual (sem esperar nova validacao).
|
|
62
|
+
const lastLocaleRef = React.useRef(i18n.locale);
|
|
63
|
+
const runValidationRef = React.useRef(runValidation);
|
|
64
|
+
runValidationRef.current = runValidation;
|
|
65
|
+
React.useEffect(() => {
|
|
66
|
+
if (lastLocaleRef.current === i18n.locale)
|
|
67
|
+
return;
|
|
68
|
+
lastLocaleRef.current = i18n.locale;
|
|
69
|
+
if (internalError !== null)
|
|
70
|
+
runValidationRef.current(local);
|
|
71
|
+
}, [i18n.locale, internalError, local]);
|
|
72
|
+
const emit = (text) => {
|
|
73
|
+
onChange?.(text ? wallClockToInstant(text, timeZone) : null, text);
|
|
74
|
+
};
|
|
75
|
+
const mergedInputProps = {
|
|
76
|
+
...inputProps,
|
|
77
|
+
placeholder: " ",
|
|
78
|
+
min: minLocal,
|
|
79
|
+
max: maxLocal ?? WIDGET_MAX,
|
|
80
|
+
step: effectiveStep,
|
|
81
|
+
...(rhfManaged ? {} : { value: partial ? "" : local }),
|
|
82
|
+
readOnly: inputProps?.readOnly,
|
|
83
|
+
onChange: (event) => {
|
|
84
|
+
const text = event.currentTarget.value;
|
|
85
|
+
setPartial(text === "" && Boolean(event.currentTarget.validity?.badInput));
|
|
86
|
+
setHasInteracted(true);
|
|
87
|
+
if (!controlled)
|
|
88
|
+
setInnerLocal(text);
|
|
89
|
+
if (validateOnBlur === false || internalError)
|
|
90
|
+
runValidation(text);
|
|
91
|
+
emit(text);
|
|
92
|
+
inputProps?.onChange?.(event);
|
|
93
|
+
},
|
|
94
|
+
onBlur: (event) => {
|
|
95
|
+
let text = event.currentTarget.value;
|
|
96
|
+
const snapped = snapMinutes(text, showSeconds ? undefined : minuteStep);
|
|
97
|
+
if (snapped !== text) {
|
|
98
|
+
text = snapped;
|
|
99
|
+
if (!controlled)
|
|
100
|
+
setInnerLocal(text);
|
|
101
|
+
emit(text);
|
|
102
|
+
}
|
|
103
|
+
if ((validateOnBlur ?? true) || hasInteracted)
|
|
104
|
+
runValidation(text);
|
|
105
|
+
inputProps?.onBlur?.(event);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
const inputClassName = (() => {
|
|
109
|
+
if (mergedInputProps.className)
|
|
110
|
+
return mergedInputProps.className;
|
|
111
|
+
const elevationClass = props.elevation === "none" ? "" : props.elevation === "md" ? "shadow-md" : props.elevation === "lg" ? "shadow-lg" : "shadow-sm";
|
|
112
|
+
const baseClass = "peer h-11 w-full rounded-md bg-[var(--sg-input-bg,hsl(var(--background)))] text-[var(--sg-input-fg,hsl(var(--foreground)))] caret-[var(--sg-input-fg,hsl(var(--foreground)))] pl-3 pr-7 py-2.5 text-sm placeholder-transparent focus:outline-none";
|
|
113
|
+
const borderClass = hasError
|
|
114
|
+
? "border border-[hsl(var(--destructive))] focus:border-[hsl(var(--destructive))] focus:ring-2 focus:ring-[hsl(var(--destructive)/0.25)]"
|
|
115
|
+
: "border border-border focus:border-[hsl(var(--primary))] focus:ring-2 focus:ring-[hsl(var(--primary)/0.25)]";
|
|
116
|
+
return [baseClass, borderClass, elevationClass].filter(Boolean).join(" ");
|
|
117
|
+
})();
|
|
118
|
+
const wrapperClassName = ["relative", isDark ? "sg-datetime-dark" : "sg-datetime-light"].join(" ");
|
|
119
|
+
return (_jsxs("div", { className: wrapperClassName, children: [_jsx("style", { children: `
|
|
120
|
+
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
|
|
121
|
+
cursor: pointer;
|
|
122
|
+
}
|
|
123
|
+
.sg-datetime-dark input[type="datetime-local"] {
|
|
124
|
+
color-scheme: dark;
|
|
125
|
+
}
|
|
126
|
+
.sg-datetime-light input[type="datetime-local"] {
|
|
127
|
+
color-scheme: light;
|
|
128
|
+
}
|
|
129
|
+
` }), labelText ? (_jsx("label", { htmlFor: rest.id, className: [
|
|
130
|
+
"pointer-events-none absolute left-3 top-0 z-10 -translate-y-1/2 bg-[var(--sg-input-bg,hsl(var(--background)))] px-1 text-[11px] font-medium leading-none",
|
|
131
|
+
hasError ? "text-[hsl(var(--destructive))]" : "text-foreground/70"
|
|
132
|
+
].join(" "), children: labelText })) : null, _jsx(SgInputText, { ...rest, type: "datetime-local", error: resolveFieldError(error, internalError ?? undefined), inputProps: mergedInputProps, className: inputClassName, labelClassName: "sr-only", onClear: () => {
|
|
133
|
+
setInternalError(null);
|
|
134
|
+
onValidation?.(null);
|
|
135
|
+
setPartial(false);
|
|
136
|
+
if (!controlled)
|
|
137
|
+
setInnerLocal("");
|
|
138
|
+
emit("");
|
|
139
|
+
rest.onClear?.();
|
|
140
|
+
} })] }));
|
|
141
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SgInputDateTime.meta.d.ts","sourceRoot":"","sources":["../../src/inputs/SgInputDateTime.meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE9D,eAAO,MAAM,MAAM,EAAE,QAqDpB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,WAmBrB,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export const sgMeta = {
|
|
2
|
+
version: "0.1",
|
|
3
|
+
componentId: "form.input.datetime",
|
|
4
|
+
package: "@seedgrid/fe-components",
|
|
5
|
+
exportName: "SgInputDateTime",
|
|
6
|
+
slug: "sg-input-date-time",
|
|
7
|
+
displayName: "SgInputDateTime",
|
|
8
|
+
category: "input",
|
|
9
|
+
subcategory: "datetime",
|
|
10
|
+
description: "Campo de data e hora que entrega e recebe instantes ISO 8601 em UTC, exibindo a hora no fuso escolhido, com limites, passo de minutos e validacao.",
|
|
11
|
+
tags: ["form", "date", "time", "datetime", "rhf"],
|
|
12
|
+
capabilities: ["rhf", "controlled", "min-max", "time-zone", "minute-step", "iso-utc"],
|
|
13
|
+
fieldSemantics: ["dateTime", "timestamp", "schedule", "appointment", "deadline"],
|
|
14
|
+
props: [
|
|
15
|
+
{ name: "id", type: "string", required: true, description: "Identificador unico do campo.", semanticRole: "data", bindable: false },
|
|
16
|
+
{ name: "name", type: "string", description: "Nome do campo para formularios.", semanticRole: "data", bindable: true },
|
|
17
|
+
{ name: "label", type: "string", description: "Rotulo principal exibido ao usuario.", semanticRole: "label", bindable: true },
|
|
18
|
+
{ name: "value", type: "string | Date | null", description: "Instante controlado (ISO 8601 ou Date).", semanticRole: "data", bindable: true },
|
|
19
|
+
{ name: "defaultValue", type: "string | Date | null", description: "Instante inicial (nao controlado).", semanticRole: "data", bindable: true },
|
|
20
|
+
{ name: "required", type: "boolean", default: false, description: "Marca o campo como obrigatorio.", semanticRole: "validation", bindable: true },
|
|
21
|
+
{ name: "minDate", type: "string | Date", description: "Menor instante permitido.", semanticRole: "validation", bindable: true },
|
|
22
|
+
{ name: "maxDate", type: "string | Date", description: "Maior instante permitido.", semanticRole: "validation", bindable: true },
|
|
23
|
+
{ name: "timeZone", type: "string", default: "local", description: "Fuso do campo: local, UTC, deslocamento (+03:00) ou nome IANA.", semanticRole: "data", bindable: true },
|
|
24
|
+
{ name: "showSeconds", type: "boolean", default: false, description: "Mostra e aceita segundos.", semanticRole: "appearance", bindable: true },
|
|
25
|
+
{ name: "minuteStep", type: "number", description: "Passo dos minutos (5, 10, 15, 30).", semanticRole: "validation", bindable: true },
|
|
26
|
+
{ name: "onChange", type: "(value: string | null, local: string) => void", description: "Instante ISO UTC (ou null) e texto local do campo.", semanticRole: "event", bindable: false }
|
|
27
|
+
],
|
|
28
|
+
states: ["default", "focused", "disabled", "readOnly", "error"],
|
|
29
|
+
examples: [
|
|
30
|
+
{
|
|
31
|
+
id: "basic",
|
|
32
|
+
title: "Basico",
|
|
33
|
+
file: "apps/showcase/src/app/components/sg-input-date-time/samples/basico.tsx.sample",
|
|
34
|
+
kind: "sample"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: "playground",
|
|
38
|
+
title: "Playground",
|
|
39
|
+
file: "apps/showcase/src/app/components/sg-input-date-time/sg-input-date-time.tsx.playground",
|
|
40
|
+
kind: "playground"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
showcase: {
|
|
44
|
+
route: "/components/sg-input-date-time",
|
|
45
|
+
hasPlayground: true,
|
|
46
|
+
hasPropsTable: true
|
|
47
|
+
},
|
|
48
|
+
sdui: {
|
|
49
|
+
rendererType: "field.datetime",
|
|
50
|
+
acceptsDataBinding: true,
|
|
51
|
+
defaultProps: { labelPosition: "float", clearButton: true }
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
export const aiHints = {
|
|
55
|
+
version: "0.1",
|
|
56
|
+
preferredUseCases: [
|
|
57
|
+
"Agendamentos, compromissos e prazos que exigem data e hora.",
|
|
58
|
+
"Campos de timestamp que precisam trafegar como instante UTC.",
|
|
59
|
+
"Formularios com limites de data e hora e fuso explicito."
|
|
60
|
+
],
|
|
61
|
+
avoidUseCases: [
|
|
62
|
+
"Somente data; prefira SgInputDate.",
|
|
63
|
+
"Somente hora do dia sem data; prefira um campo de hora.",
|
|
64
|
+
"Texto livre; prefira SgInputText."
|
|
65
|
+
],
|
|
66
|
+
synonyms: ["datetime input", "date time picker", "timestamp field", "appointment field"],
|
|
67
|
+
relatedEntityFields: ["createdAt", "scheduledAt", "startsAt", "endsAt", "dueAt", "timestamp"],
|
|
68
|
+
compositionHints: [
|
|
69
|
+
"Combinar dois campos (inicio/fim) com minDate/maxDate para intervalos.",
|
|
70
|
+
"Usar dentro de SgPanel em formularios de agenda."
|
|
71
|
+
],
|
|
72
|
+
rankingSignals: { freeText: 0, structuredChoice: 0.1, date: 0.95, number: 0, denseLayout: 0.7 }
|
|
73
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SgInputNumber.d.ts","sourceRoot":"","sources":["../../src/inputs/SgInputNumber.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAwC,KAAK,aAAa,EAAE,MAAM,QAAQ,CAAC;AAGlF,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG;IAC/C,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;IACzC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,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