forlogic-core 2.1.4 → 2.1.5
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/.note/memory/features/import/attachment-idempotency-registry.md +8 -8
- package/.note/memory/features/import/attachment-strategy.md +30 -30
- package/.note/memory/patterns/admin-i18n-policy.md +20 -20
- package/.note/memory/patterns/alias-url-resolution.md +69 -69
- package/.note/memory/patterns/doc-sync-rule.md +35 -35
- package/.note/memory/patterns/documentation-standard.md +17 -17
- package/.note/memory/patterns/dynamic-supabase-config.md +4 -4
- package/.note/memory/patterns/environment-detection-logic.md +35 -35
- package/.note/memory/patterns/i18n-architecture.md +3 -3
- package/README.md +68 -68
- package/dist/action-plans/components/ActionPlanStatusBadge.d.ts +6 -2
- package/dist/components/ui/__tests__/status-badge.test.d.ts +1 -0
- package/dist/components/ui/status-badge.d.ts +49 -0
- package/dist/crud/primitives/Table.d.ts +1 -1
- package/dist/crud/primitives/types.d.ts +6 -0
- package/dist/exports/crud.d.ts +5 -0
- package/dist/exports/ui.d.ts +1 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/utils/color.d.ts +26 -0
- package/dist/utils/index.d.ts +1 -0
- package/docs/PUBLISH.md +168 -0
- package/docs/WORKSPACE_KNOWLEDGE.md +119 -119
- package/docs/design-system/README.md +1 -1
- package/docs/design-system/buttons-actions.md +130 -130
- package/docs/design-system/charts-dashboards.md +340 -301
- package/docs/design-system/crud.md +174 -114
- package/docs/design-system/data-display.md +108 -103
- package/docs/design-system/dialogs.md +212 -212
- package/docs/design-system/domain.md +317 -317
- package/docs/design-system/examples.md +275 -275
- package/docs/design-system/foundation.md +1 -1
- package/docs/design-system/inputs.md +131 -131
- package/docs/design-system/layout.md +202 -154
- package/docs/design-system/navigation.md +271 -325
- package/docs/design-system/notifications-feedback.md +34 -34
- package/docs/design-system/patterns/README.md +53 -53
- package/docs/design-system/patterns/action-button.md +22 -22
- package/docs/design-system/patterns/alertdialog-deletion.md +46 -46
- package/docs/design-system/patterns/baseform-custom-fields.md +59 -59
- package/docs/design-system/patterns/baseform-usage.md +42 -42
- package/docs/design-system/patterns/body-content-scroll.md +56 -56
- package/docs/design-system/patterns/combo-tree.md +23 -23
- package/docs/design-system/patterns/components-registry.md +17 -17
- package/docs/design-system/patterns/core-providers.md +39 -39
- package/docs/design-system/patterns/crud-bulk-actions.md +12 -12
- package/docs/design-system/patterns/crud-config-props.md +16 -16
- package/docs/design-system/patterns/crud-defaults.md +17 -17
- package/docs/design-system/patterns/crud-toolbar.md +28 -28
- package/docs/design-system/patterns/delete-confirmation.md +40 -40
- package/docs/design-system/patterns/dialog-body-scroll.md +26 -26
- package/docs/design-system/patterns/dialog-structure.md +32 -32
- package/docs/design-system/patterns/dialog-variants.md +41 -41
- package/docs/design-system/patterns/feature-flags.md +24 -20
- package/docs/design-system/patterns/header-metadata.md +57 -57
- package/docs/design-system/patterns/i18n-setup.md +117 -117
- package/docs/design-system/patterns/pagination.md +27 -27
- package/docs/design-system/patterns/single-scroll.md +39 -39
- package/docs/design-system/patterns/vite-tailwind-setup.md +48 -48
- package/docs/design-system/platform.md +18 -18
- package/docs/design-system/selectors.md +236 -236
- package/docs/design-system/tables-grids.md +95 -38
- package/package.json +144 -144
- package/dist/README.md +0 -1079
- package/dist/bin/bootstrap.js +0 -40
- package/dist/bin/pull-docs.js +0 -186
- package/dist/docs/KNOWLEDGE.md +0 -109
|
@@ -11,24 +11,24 @@ Campo de entrada de texto com suporte a todos os tipos HTML. Inclui Label para r
|
|
|
11
11
|
|
|
12
12
|
**Uso:**
|
|
13
13
|
```tsx
|
|
14
|
-
import { Input, Label } from "forlogic-core"
|
|
15
|
-
|
|
16
|
-
// Input básico
|
|
17
|
-
<Input placeholder="Digite algo..." />
|
|
18
|
-
|
|
19
|
-
// Com Label
|
|
20
|
-
<div className="grid w-full items-center gap-1.5">
|
|
21
|
-
<Label htmlFor="email">Email</Label>
|
|
22
|
-
<Input type="email" id="email" placeholder="email@exemplo.com" />
|
|
23
|
-
</div>
|
|
24
|
-
|
|
25
|
-
// InputGroup com prefixo e sufixo
|
|
26
|
-
import { InputGroup, InputGroupInput, InputGroupAddon, InputGroupButton } from "forlogic-core"
|
|
27
|
-
|
|
28
|
-
<InputGroup>
|
|
29
|
-
<InputGroupAddon align="inline-start">https://</InputGroupAddon>
|
|
30
|
-
<InputGroupInput placeholder="exemplo.com" />
|
|
31
|
-
<InputGroupAddon align="inline-end">.com.br</InputGroupAddon>
|
|
14
|
+
import { Input, Label } from "forlogic-core"
|
|
15
|
+
|
|
16
|
+
// Input básico
|
|
17
|
+
<Input placeholder="Digite algo..." />
|
|
18
|
+
|
|
19
|
+
// Com Label
|
|
20
|
+
<div className="grid w-full items-center gap-1.5">
|
|
21
|
+
<Label htmlFor="email">Email</Label>
|
|
22
|
+
<Input type="email" id="email" placeholder="email@exemplo.com" />
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
// InputGroup com prefixo e sufixo
|
|
26
|
+
import { InputGroup, InputGroupInput, InputGroupAddon, InputGroupButton } from "forlogic-core"
|
|
27
|
+
|
|
28
|
+
<InputGroup>
|
|
29
|
+
<InputGroupAddon align="inline-start">https://</InputGroupAddon>
|
|
30
|
+
<InputGroupInput placeholder="exemplo.com" />
|
|
31
|
+
<InputGroupAddon align="inline-end">.com.br</InputGroupAddon>
|
|
32
32
|
</InputGroup>
|
|
33
33
|
```
|
|
34
34
|
|
|
@@ -60,21 +60,21 @@ import { InputGroup, InputGroupInput, InputGroupAddon, InputGroupButton } from "
|
|
|
60
60
|
<div className=
|
|
61
61
|
```
|
|
62
62
|
```tsx
|
|
63
|
-
// Normal
|
|
63
|
+
// Normal
|
|
64
64
|
<Input placeholder=
|
|
65
65
|
```
|
|
66
66
|
```tsx
|
|
67
|
-
// Ícone à esquerda
|
|
67
|
+
// Ícone à esquerda
|
|
68
68
|
<div className=
|
|
69
69
|
```
|
|
70
70
|
```tsx
|
|
71
|
-
// Prefixo
|
|
72
|
-
<InputGroup>
|
|
71
|
+
// Prefixo
|
|
72
|
+
<InputGroup>
|
|
73
73
|
<InputGroupAddon align=
|
|
74
74
|
```
|
|
75
75
|
```tsx
|
|
76
|
-
// Ícone de usuário
|
|
77
|
-
<InputGroup>
|
|
76
|
+
// Ícone de usuário
|
|
77
|
+
<InputGroup>
|
|
78
78
|
<InputGroupAddon align=
|
|
79
79
|
```
|
|
80
80
|
|
|
@@ -120,7 +120,7 @@ import { InputGroup, InputGroupInput, InputGroupAddon, InputGroupButton } from "
|
|
|
120
120
|
- para feedback visual no hover.
|
|
121
121
|
- 🎨 **Padrão v2**: Bordas dos inputs têm contraste aumentado (luminosidade 82% light / 25% dark) para maior realce visual.
|
|
122
122
|
|
|
123
|
-
> Fonte: `src
|
|
123
|
+
> Fonte: `src/design-system/docs/components/InputDoc.tsx`
|
|
124
124
|
|
|
125
125
|
---
|
|
126
126
|
|
|
@@ -130,8 +130,8 @@ Exibe um textarea de formulário ou um componente que se parece com um textarea.
|
|
|
130
130
|
|
|
131
131
|
**Uso:**
|
|
132
132
|
```tsx
|
|
133
|
-
import { Textarea } from "forlogic-core"
|
|
134
|
-
|
|
133
|
+
import { Textarea } from "forlogic-core"
|
|
134
|
+
|
|
135
135
|
<Textarea placeholder="Digite sua mensagem aqui." />
|
|
136
136
|
```
|
|
137
137
|
|
|
@@ -159,7 +159,7 @@ import { Textarea } from "forlogic-core"
|
|
|
159
159
|
- com
|
|
160
160
|
- para feedback visual no hover.
|
|
161
161
|
|
|
162
|
-
> Fonte: `src
|
|
162
|
+
> Fonte: `src/design-system/docs/components/TextareaDoc.tsx`
|
|
163
163
|
|
|
164
164
|
---
|
|
165
165
|
|
|
@@ -169,11 +169,11 @@ Um controle que permite ao usuário alternar entre marcado e desmarcado.
|
|
|
169
169
|
|
|
170
170
|
**Uso:**
|
|
171
171
|
```tsx
|
|
172
|
-
import { Checkbox } from "forlogic-core"
|
|
173
|
-
|
|
174
|
-
<div className="flex items-center space-x-2">
|
|
175
|
-
<Checkbox id="terms" />
|
|
176
|
-
<label htmlFor="terms">Accept terms and conditions</label>
|
|
172
|
+
import { Checkbox } from "forlogic-core"
|
|
173
|
+
|
|
174
|
+
<div className="flex items-center space-x-2">
|
|
175
|
+
<Checkbox id="terms" />
|
|
176
|
+
<label htmlFor="terms">Accept terms and conditions</label>
|
|
177
177
|
</div>
|
|
178
178
|
```
|
|
179
179
|
|
|
@@ -199,7 +199,7 @@ import { Checkbox } from "forlogic-core"
|
|
|
199
199
|
- Gerenciamento adequado de foco
|
|
200
200
|
- Funciona com labels de formulário
|
|
201
201
|
|
|
202
|
-
> Fonte: `src
|
|
202
|
+
> Fonte: `src/design-system/docs/components/CheckboxDoc.tsx`
|
|
203
203
|
|
|
204
204
|
---
|
|
205
205
|
|
|
@@ -209,17 +209,17 @@ Um conjunto de botões marcáveis—conhecidos como botões de rádio—onde ape
|
|
|
209
209
|
|
|
210
210
|
**Uso:**
|
|
211
211
|
```tsx
|
|
212
|
-
import { RadioGroup, RadioGroupItem } from "forlogic-core"
|
|
213
|
-
|
|
214
|
-
<RadioGroup defaultValue="option-one">
|
|
215
|
-
<div className="flex items-center space-x-2">
|
|
216
|
-
<RadioGroupItem value="option-one" id="r1" />
|
|
217
|
-
<Label htmlFor="r1">Option One</Label>
|
|
218
|
-
</div>
|
|
219
|
-
<div className="flex items-center space-x-2">
|
|
220
|
-
<RadioGroupItem value="option-two" id="r2" />
|
|
221
|
-
<Label htmlFor="r2">Option Two</Label>
|
|
222
|
-
</div>
|
|
212
|
+
import { RadioGroup, RadioGroupItem } from "forlogic-core"
|
|
213
|
+
|
|
214
|
+
<RadioGroup defaultValue="option-one">
|
|
215
|
+
<div className="flex items-center space-x-2">
|
|
216
|
+
<RadioGroupItem value="option-one" id="r1" />
|
|
217
|
+
<Label htmlFor="r1">Option One</Label>
|
|
218
|
+
</div>
|
|
219
|
+
<div className="flex items-center space-x-2">
|
|
220
|
+
<RadioGroupItem value="option-two" id="r2" />
|
|
221
|
+
<Label htmlFor="r2">Option Two</Label>
|
|
222
|
+
</div>
|
|
223
223
|
</RadioGroup>
|
|
224
224
|
```
|
|
225
225
|
|
|
@@ -251,7 +251,7 @@ import { RadioGroup, RadioGroupItem } from "forlogic-core"
|
|
|
251
251
|
- Segue o padrão de grupo de rádio WAI-ARIA
|
|
252
252
|
- Gerenciamento adequado de foco
|
|
253
253
|
|
|
254
|
-
> Fonte: `src
|
|
254
|
+
> Fonte: `src/design-system/docs/components/RadioGroupDoc.tsx`
|
|
255
255
|
|
|
256
256
|
---
|
|
257
257
|
|
|
@@ -261,9 +261,9 @@ Renderiza uma label acessível associada a controles de formulário.
|
|
|
261
261
|
|
|
262
262
|
**Uso:**
|
|
263
263
|
```tsx
|
|
264
|
-
import { Label } from "forlogic-core"
|
|
265
|
-
|
|
266
|
-
<Label htmlFor="email">Email</Label>
|
|
264
|
+
import { Label } from "forlogic-core"
|
|
265
|
+
|
|
266
|
+
<Label htmlFor="email">Email</Label>
|
|
267
267
|
<Input id="email" type="email" />
|
|
268
268
|
```
|
|
269
269
|
|
|
@@ -315,7 +315,7 @@ import { Label } from "forlogic-core"
|
|
|
315
315
|
- (12px) e
|
|
316
316
|
- para hierarquia visual clara sem competir com o conteúdo do campo.
|
|
317
317
|
|
|
318
|
-
> Fonte: `src
|
|
318
|
+
> Fonte: `src/design-system/docs/components/LabelDoc.tsx`
|
|
319
319
|
|
|
320
320
|
---
|
|
321
321
|
|
|
@@ -325,8 +325,8 @@ Um input onde o usuário seleciona um valor dentro de um intervalo determinado.
|
|
|
325
325
|
|
|
326
326
|
**Uso:**
|
|
327
327
|
```tsx
|
|
328
|
-
import { Slider } from "forlogic-core"
|
|
329
|
-
|
|
328
|
+
import { Slider } from "forlogic-core"
|
|
329
|
+
|
|
330
330
|
<Slider defaultValue={[50]} max={100} step={1} />
|
|
331
331
|
```
|
|
332
332
|
|
|
@@ -336,7 +336,7 @@ import { Slider } from "forlogic-core"
|
|
|
336
336
|
- Labels e valores ARIA adequados
|
|
337
337
|
- Indicadores de foco visíveis
|
|
338
338
|
|
|
339
|
-
> Fonte: `src
|
|
339
|
+
> Fonte: `src/design-system/docs/components/SliderDoc.tsx`
|
|
340
340
|
|
|
341
341
|
---
|
|
342
342
|
|
|
@@ -346,16 +346,16 @@ Componente de upload de arquivo único com drag & drop, validação de tipo/tama
|
|
|
346
346
|
|
|
347
347
|
**Uso:**
|
|
348
348
|
```tsx
|
|
349
|
-
import { SingleFileUpload } from 'forlogic-core';
|
|
350
|
-
|
|
351
|
-
<SingleFileUpload
|
|
352
|
-
storedFile={{ id: '1', name: 'doc.pdf', extension: 'pdf', size: 1024 }}
|
|
353
|
-
allowedExtensions={['pdf', 'docx']}
|
|
354
|
-
maxSizeInBytes={10 * 1024 * 1024}
|
|
355
|
-
onFileSelect={(file) => console.log(file)}
|
|
356
|
-
onFileRemove={() => console.log('removed')}
|
|
357
|
-
onDownload={async (f) => downloadFile(f.id)}
|
|
358
|
-
onView={(f) => openViewer(f.id)}
|
|
349
|
+
import { SingleFileUpload } from 'forlogic-core';
|
|
350
|
+
|
|
351
|
+
<SingleFileUpload
|
|
352
|
+
storedFile={{ id: '1', name: 'doc.pdf', extension: 'pdf', size: 1024 }}
|
|
353
|
+
allowedExtensions={['pdf', 'docx']}
|
|
354
|
+
maxSizeInBytes={10 * 1024 * 1024}
|
|
355
|
+
onFileSelect={(file) => console.log(file)}
|
|
356
|
+
onFileRemove={() => console.log('removed')}
|
|
357
|
+
onDownload={async (f) => downloadFile(f.id)}
|
|
358
|
+
onView={(f) => openViewer(f.id)}
|
|
359
359
|
/>
|
|
360
360
|
```
|
|
361
361
|
|
|
@@ -370,17 +370,17 @@ import { SingleFileUpload } from 'forlogic-core';
|
|
|
370
370
|
|
|
371
371
|
**Exemplos:**
|
|
372
372
|
```tsx
|
|
373
|
-
<SingleFileUpload
|
|
374
|
-
onFileSelect={(f) => handleSelect(f)}
|
|
375
|
-
onFileRemove={() => handleRemove()}
|
|
373
|
+
<SingleFileUpload
|
|
374
|
+
onFileSelect={(f) => handleSelect(f)}
|
|
375
|
+
onFileRemove={() => handleRemove()}
|
|
376
376
|
/>
|
|
377
377
|
```
|
|
378
378
|
```tsx
|
|
379
|
-
<SingleFileUpload
|
|
379
|
+
<SingleFileUpload
|
|
380
380
|
storedFile={{ id:
|
|
381
381
|
```
|
|
382
382
|
```tsx
|
|
383
|
-
<SingleFileUpload
|
|
383
|
+
<SingleFileUpload
|
|
384
384
|
allowedExtensions={[
|
|
385
385
|
```
|
|
386
386
|
|
|
@@ -390,7 +390,7 @@ import { SingleFileUpload } from 'forlogic-core';
|
|
|
390
390
|
- O componente gerencia estados internos de arquivo local vs servidor (StoredFile).
|
|
391
391
|
- Tipos proibidos são bloqueados automaticamente independente da prop allowedExtensions.
|
|
392
392
|
|
|
393
|
-
> Fonte: `src
|
|
393
|
+
> Fonte: `src/design-system/docs/components/FileUploadDoc.tsx`
|
|
394
394
|
|
|
395
395
|
---
|
|
396
396
|
|
|
@@ -400,22 +400,22 @@ Exibe uma lista de opções para o usuário escolher—acionada por um botão.
|
|
|
400
400
|
|
|
401
401
|
**Uso:**
|
|
402
402
|
```tsx
|
|
403
|
-
import {
|
|
404
|
-
Select,
|
|
405
|
-
SelectContent,
|
|
406
|
-
SelectItem,
|
|
407
|
-
SelectTrigger,
|
|
408
|
-
SelectValue,
|
|
409
|
-
} from "forlogic-core"
|
|
410
|
-
|
|
411
|
-
<Select>
|
|
412
|
-
<SelectTrigger className="w-[180px]">
|
|
413
|
-
<SelectValue placeholder="Theme" />
|
|
414
|
-
</SelectTrigger>
|
|
415
|
-
<SelectContent>
|
|
416
|
-
<SelectItem value="light">Light</SelectItem>
|
|
417
|
-
<SelectItem value="dark">Dark</SelectItem>
|
|
418
|
-
</SelectContent>
|
|
403
|
+
import {
|
|
404
|
+
Select,
|
|
405
|
+
SelectContent,
|
|
406
|
+
SelectItem,
|
|
407
|
+
SelectTrigger,
|
|
408
|
+
SelectValue,
|
|
409
|
+
} from "forlogic-core"
|
|
410
|
+
|
|
411
|
+
<Select>
|
|
412
|
+
<SelectTrigger className="w-[180px]">
|
|
413
|
+
<SelectValue placeholder="Theme" />
|
|
414
|
+
</SelectTrigger>
|
|
415
|
+
<SelectContent>
|
|
416
|
+
<SelectItem value="light">Light</SelectItem>
|
|
417
|
+
<SelectItem value="dark">Dark</SelectItem>
|
|
418
|
+
</SelectContent>
|
|
419
419
|
</Select>
|
|
420
420
|
```
|
|
421
421
|
|
|
@@ -441,13 +441,13 @@ import {
|
|
|
441
441
|
- quando o Select estiver dentro de um Dialog para evitar problemas de scroll
|
|
442
442
|
- 💡 Para seleção com busca, considere usar
|
|
443
443
|
- ao invés de
|
|
444
|
-
- ,
|
|
444
|
+
- ,
|
|
445
445
|
|
|
446
446
|
- rounded-lg
|
|
447
447
|
- hover:border-primary
|
|
448
448
|
- transition-colors
|
|
449
449
|
|
|
450
|
-
> Fonte: `src
|
|
450
|
+
> Fonte: `src/design-system/docs/components/SelectDoc.tsx`
|
|
451
451
|
|
|
452
452
|
---
|
|
453
453
|
|
|
@@ -457,14 +457,14 @@ Editor de texto rico construído com Tiptap, suportando formatação visual, edi
|
|
|
457
457
|
|
|
458
458
|
**Uso:**
|
|
459
459
|
```tsx
|
|
460
|
-
import { RichTextEditor } from "forlogic-core"
|
|
461
|
-
|
|
462
|
-
const [content, setContent] = useState('')
|
|
463
|
-
|
|
464
|
-
<RichTextEditor
|
|
465
|
-
value={content}
|
|
466
|
-
onChange={setContent}
|
|
467
|
-
placeholder="Escreva algo aqui..."
|
|
460
|
+
import { RichTextEditor } from "forlogic-core"
|
|
461
|
+
|
|
462
|
+
const [content, setContent] = useState('')
|
|
463
|
+
|
|
464
|
+
<RichTextEditor
|
|
465
|
+
value={content}
|
|
466
|
+
onChange={setContent}
|
|
467
|
+
placeholder="Escreva algo aqui..."
|
|
468
468
|
/>
|
|
469
469
|
```
|
|
470
470
|
|
|
@@ -480,25 +480,25 @@ const [content, setContent] = useState('')
|
|
|
480
480
|
|
|
481
481
|
**Exemplos:**
|
|
482
482
|
```tsx
|
|
483
|
-
<RichTextEditor
|
|
484
|
-
value={content}
|
|
485
|
-
onChange={setContent}
|
|
486
|
-
showVariableHint={false}
|
|
483
|
+
<RichTextEditor
|
|
484
|
+
value={content}
|
|
485
|
+
onChange={setContent}
|
|
486
|
+
showVariableHint={false}
|
|
487
487
|
placeholder=
|
|
488
488
|
```
|
|
489
489
|
```tsx
|
|
490
|
-
<RichTextEditor
|
|
491
|
-
value={content}
|
|
492
|
-
onChange={setContent}
|
|
493
|
-
showModeToggle={false}
|
|
494
|
-
showVariableHint={false}
|
|
490
|
+
<RichTextEditor
|
|
491
|
+
value={content}
|
|
492
|
+
onChange={setContent}
|
|
493
|
+
showModeToggle={false}
|
|
494
|
+
showVariableHint={false}
|
|
495
495
|
minHeight=
|
|
496
496
|
```
|
|
497
497
|
```tsx
|
|
498
|
-
<RichTextEditor
|
|
499
|
-
value={content}
|
|
500
|
-
onChange={setContent}
|
|
501
|
-
disabled
|
|
498
|
+
<RichTextEditor
|
|
499
|
+
value={content}
|
|
500
|
+
onChange={setContent}
|
|
501
|
+
disabled
|
|
502
502
|
/>
|
|
503
503
|
```
|
|
504
504
|
|
|
@@ -509,7 +509,7 @@ const [content, setContent] = useState('')
|
|
|
509
509
|
- Contraste adequado nos estados ativo/inativo
|
|
510
510
|
- Focus visível em todos os elementos interativos
|
|
511
511
|
|
|
512
|
-
> Fonte: `src
|
|
512
|
+
> Fonte: `src/design-system/docs/components/RichTextEditorDoc.tsx`
|
|
513
513
|
|
|
514
514
|
---
|
|
515
515
|
|
|
@@ -519,27 +519,27 @@ Componente container que renderiza campos de formulário dinâmicos baseados em
|
|
|
519
519
|
|
|
520
520
|
**Uso:**
|
|
521
521
|
```tsx
|
|
522
|
-
import { CustomFormFields, ECustomFormFieldType, validateFields } from "forlogic-core"
|
|
523
|
-
import type { FieldAssociation } from "forlogic-core"
|
|
524
|
-
|
|
525
|
-
const fields: FieldAssociation[] = [
|
|
526
|
-
{
|
|
527
|
-
id: 'f1',
|
|
528
|
-
type: ECustomFormFieldType.text,
|
|
529
|
-
name: 'Nome',
|
|
530
|
-
required: true,
|
|
531
|
-
config: { multiline: false },
|
|
532
|
-
isActive: true,
|
|
533
|
-
},
|
|
534
|
-
// ...mais campos
|
|
535
|
-
];
|
|
536
|
-
|
|
537
|
-
const [formFields, setFormFields] = useState(fields);
|
|
538
|
-
|
|
539
|
-
<CustomFormFields
|
|
540
|
-
fields={formFields}
|
|
541
|
-
onChange={setFormFields}
|
|
542
|
-
onFieldChange={(field) => console.log('Changed:', field)}
|
|
522
|
+
import { CustomFormFields, ECustomFormFieldType, validateFields } from "forlogic-core"
|
|
523
|
+
import type { FieldAssociation } from "forlogic-core"
|
|
524
|
+
|
|
525
|
+
const fields: FieldAssociation[] = [
|
|
526
|
+
{
|
|
527
|
+
id: 'f1',
|
|
528
|
+
type: ECustomFormFieldType.text,
|
|
529
|
+
name: 'Nome',
|
|
530
|
+
required: true,
|
|
531
|
+
config: { multiline: false },
|
|
532
|
+
isActive: true,
|
|
533
|
+
},
|
|
534
|
+
// ...mais campos
|
|
535
|
+
];
|
|
536
|
+
|
|
537
|
+
const [formFields, setFormFields] = useState(fields);
|
|
538
|
+
|
|
539
|
+
<CustomFormFields
|
|
540
|
+
fields={formFields}
|
|
541
|
+
onChange={setFormFields}
|
|
542
|
+
onFieldChange={(field) => console.log('Changed:', field)}
|
|
543
543
|
/>
|
|
544
544
|
```
|
|
545
545
|
|
|
@@ -551,6 +551,6 @@ const [formFields, setFormFields] = useState(fields);
|
|
|
551
551
|
- Use setFormFieldValues() para aplicar valores salvos a uma lista de campos.
|
|
552
552
|
- Campos de seleção suportam dataSource custom (dados estáticos) e users (lista de usuários do sistema).
|
|
553
553
|
|
|
554
|
-
> Fonte: `src
|
|
554
|
+
> Fonte: `src/design-system/docs/components/CustomFormFieldsDoc.tsx`
|
|
555
555
|
|
|
556
556
|
---
|