forlogic-core 2.2.5 → 2.2.7
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 +120 -120
- package/dist/README.md +1079 -0
- package/dist/bin/bootstrap.js +40 -0
- package/dist/bin/pull-docs.js +186 -0
- package/dist/components/ui/color-picker.d.ts +2 -0
- package/dist/components/ui/combo-tree.d.ts +3 -1
- package/dist/components/ui/combobox.d.ts +2 -1
- package/dist/components/ui/select.d.ts +9 -2
- package/dist/docs/KNOWLEDGE.md +109 -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/docs/PUBLISH.md +168 -168
- package/docs/STORAGE_BUCKETS.md +456 -456
- package/docs/SUPABASE_SECRETS.md +122 -122
- package/docs/WORKSPACE_KNOWLEDGE.md +154 -154
- package/docs/design-system/buttons-actions.md +130 -130
- package/docs/design-system/charts-dashboards.md +301 -340
- package/docs/design-system/crud.md +114 -174
- package/docs/design-system/data-display.md +106 -106
- package/docs/design-system/dialogs.md +212 -212
- package/docs/design-system/domain.md +329 -319
- package/docs/design-system/examples.md +275 -275
- package/docs/design-system/foundation.md +1 -1
- package/docs/design-system/inputs.md +137 -132
- package/docs/design-system/layout.md +154 -202
- package/docs/design-system/navigation.md +331 -272
- 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 +41 -41
- 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 +81 -81
- 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 +49 -49
- package/docs/design-system/platform.md +18 -18
- package/docs/design-system/selectors.md +287 -258
- package/docs/design-system/tables-grids.md +38 -95
- package/package.json +152 -152
- package/dist/assets/docs-BEwTKYu3.css +0 -1
- package/dist/assets/docs-Bgpz6ETN.js +0 -10752
- package/dist/assets/index-SqMwTzMJ.js +0 -97
- package/dist/index.html +0 -34
|
@@ -11,29 +11,29 @@ Componente de página completa para gerenciar planos de ação. Inclui formulár
|
|
|
11
11
|
|
|
12
12
|
**Uso:**
|
|
13
13
|
```tsx
|
|
14
|
-
import { ActionPlanPage, ETaskPlanStatus } from "forlogic-core"
|
|
15
|
-
|
|
16
|
-
<ActionPlanPage
|
|
17
|
-
actionPlan={actionPlan}
|
|
18
|
-
config={{
|
|
19
|
-
enablePredecessors: true,
|
|
20
|
-
enableCosts: true,
|
|
21
|
-
enableAttachments: true,
|
|
22
|
-
enableComments: true,
|
|
23
|
-
enableHistory: true,
|
|
24
|
-
}}
|
|
25
|
-
users={users}
|
|
26
|
-
places={places}
|
|
27
|
-
progress={progress}
|
|
28
|
-
comments={comments}
|
|
29
|
-
history={history}
|
|
30
|
-
attachments={attachments}
|
|
31
|
-
onSave={handleSave}
|
|
32
|
-
onCancel={() => navigate(-1)}
|
|
33
|
-
onChangeStatus={handleChangeStatus}
|
|
34
|
-
onReportProgress={handleReportProgress}
|
|
35
|
-
onAddComment={handleAddComment}
|
|
36
|
-
onUploadAttachment={handleUploadAttachment}
|
|
14
|
+
import { ActionPlanPage, ETaskPlanStatus } from "forlogic-core"
|
|
15
|
+
|
|
16
|
+
<ActionPlanPage
|
|
17
|
+
actionPlan={actionPlan}
|
|
18
|
+
config={{
|
|
19
|
+
enablePredecessors: true,
|
|
20
|
+
enableCosts: true,
|
|
21
|
+
enableAttachments: true,
|
|
22
|
+
enableComments: true,
|
|
23
|
+
enableHistory: true,
|
|
24
|
+
}}
|
|
25
|
+
users={users}
|
|
26
|
+
places={places}
|
|
27
|
+
progress={progress}
|
|
28
|
+
comments={comments}
|
|
29
|
+
history={history}
|
|
30
|
+
attachments={attachments}
|
|
31
|
+
onSave={handleSave}
|
|
32
|
+
onCancel={() => navigate(-1)}
|
|
33
|
+
onChangeStatus={handleChangeStatus}
|
|
34
|
+
onReportProgress={handleReportProgress}
|
|
35
|
+
onAddComment={handleAddComment}
|
|
36
|
+
onUploadAttachment={handleUploadAttachment}
|
|
37
37
|
/>
|
|
38
38
|
```
|
|
39
39
|
|
|
@@ -47,47 +47,47 @@ import { ActionPlanPage, ETaskPlanStatus } from "forlogic-core"
|
|
|
47
47
|
|
|
48
48
|
**Exemplos:**
|
|
49
49
|
```tsx
|
|
50
|
-
<ActionPlanPage
|
|
51
|
-
actionPlan={actionPlan}
|
|
52
|
-
config={{
|
|
53
|
-
enablePredecessors: true,
|
|
54
|
-
enableCosts: true,
|
|
55
|
-
enableAttachments: true,
|
|
56
|
-
enableComments: true,
|
|
57
|
-
enableHistory: true,
|
|
58
|
-
hasComments: true,
|
|
59
|
-
}}
|
|
60
|
-
users={users}
|
|
61
|
-
places={places}
|
|
62
|
-
actionTypes={actionTypes}
|
|
63
|
-
causes={causes}
|
|
64
|
-
progress={progress}
|
|
65
|
-
predecessors={predecessors}
|
|
66
|
-
costs={costs}
|
|
67
|
-
comments={comments}
|
|
68
|
-
history={history}
|
|
69
|
-
attachments={attachments}
|
|
70
|
-
onSave={handleSave}
|
|
71
|
-
onChangeStatus={handleChangeStatus}
|
|
72
|
-
onReportProgress={handleReportProgress}
|
|
73
|
-
onAddComment={handleAddComment}
|
|
74
|
-
onEditComment={handleEditComment}
|
|
75
|
-
onDeleteComment={handleDeleteComment}
|
|
76
|
-
onUploadAttachment={handleUploadAttachment}
|
|
77
|
-
onDeleteAttachment={handleDeleteAttachment}
|
|
78
|
-
onRenameAttachment={handleRenameAttachment}
|
|
79
|
-
onDownloadAttachment={handleDownloadAttachment}
|
|
80
|
-
onViewAttachment={handleViewAttachment}
|
|
50
|
+
<ActionPlanPage
|
|
51
|
+
actionPlan={actionPlan}
|
|
52
|
+
config={{
|
|
53
|
+
enablePredecessors: true,
|
|
54
|
+
enableCosts: true,
|
|
55
|
+
enableAttachments: true,
|
|
56
|
+
enableComments: true,
|
|
57
|
+
enableHistory: true,
|
|
58
|
+
hasComments: true,
|
|
59
|
+
}}
|
|
60
|
+
users={users}
|
|
61
|
+
places={places}
|
|
62
|
+
actionTypes={actionTypes}
|
|
63
|
+
causes={causes}
|
|
64
|
+
progress={progress}
|
|
65
|
+
predecessors={predecessors}
|
|
66
|
+
costs={costs}
|
|
67
|
+
comments={comments}
|
|
68
|
+
history={history}
|
|
69
|
+
attachments={attachments}
|
|
70
|
+
onSave={handleSave}
|
|
71
|
+
onChangeStatus={handleChangeStatus}
|
|
72
|
+
onReportProgress={handleReportProgress}
|
|
73
|
+
onAddComment={handleAddComment}
|
|
74
|
+
onEditComment={handleEditComment}
|
|
75
|
+
onDeleteComment={handleDeleteComment}
|
|
76
|
+
onUploadAttachment={handleUploadAttachment}
|
|
77
|
+
onDeleteAttachment={handleDeleteAttachment}
|
|
78
|
+
onRenameAttachment={handleRenameAttachment}
|
|
79
|
+
onDownloadAttachment={handleDownloadAttachment}
|
|
80
|
+
onViewAttachment={handleViewAttachment}
|
|
81
81
|
/>
|
|
82
82
|
```
|
|
83
83
|
```tsx
|
|
84
|
-
<ActionPlanPage
|
|
85
|
-
isNew
|
|
86
|
-
config={{}}
|
|
87
|
-
users={users}
|
|
88
|
-
places={places}
|
|
89
|
-
onSave={handleSave}
|
|
90
|
-
onCancel={() => navigate(-1)}
|
|
84
|
+
<ActionPlanPage
|
|
85
|
+
isNew
|
|
86
|
+
config={{}}
|
|
87
|
+
users={users}
|
|
88
|
+
places={places}
|
|
89
|
+
onSave={handleSave}
|
|
90
|
+
onCancel={() => navigate(-1)}
|
|
91
91
|
/>
|
|
92
92
|
```
|
|
93
93
|
```tsx
|
|
@@ -103,7 +103,7 @@ import { ActionPlanStatusBadge, ETaskPlanStatus } from
|
|
|
103
103
|
- Anexos suportam upload múltiplo, barra de progresso, renomear inline, context menu (visualizar, download, excluir) e detecção de duplicatas.
|
|
104
104
|
- Slots (attachmentsSlot, commentsSlot, historySlot) permitem substituir os componentes padrão por implementações customizadas do projeto consumidor.
|
|
105
105
|
|
|
106
|
-
> Fonte: `src
|
|
106
|
+
> Fonte: `src\design-system\docs\components\ActionPlanDoc.tsx`
|
|
107
107
|
|
|
108
108
|
---
|
|
109
109
|
|
|
@@ -143,7 +143,7 @@ import { AuditTrailPage } from 'forlogic-core';
|
|
|
143
143
|
- Componente de página completa — inclui toolbar, filtros e tabela
|
|
144
144
|
- Requer implementação dos callbacks de busca no backend
|
|
145
145
|
|
|
146
|
-
> Fonte: `src
|
|
146
|
+
> Fonte: `src\design-system\docs\components\AuditTrailDoc.tsx`
|
|
147
147
|
|
|
148
148
|
---
|
|
149
149
|
|
|
@@ -153,27 +153,27 @@ Componente container que renderiza campos de formulário dinâmicos baseados em
|
|
|
153
153
|
|
|
154
154
|
**Uso:**
|
|
155
155
|
```tsx
|
|
156
|
-
import { CustomFormFields, ECustomFormFieldType, validateFields } from "forlogic-core"
|
|
157
|
-
import type { FieldAssociation } from "forlogic-core"
|
|
158
|
-
|
|
159
|
-
const fields: FieldAssociation[] = [
|
|
160
|
-
{
|
|
161
|
-
id: 'f1',
|
|
162
|
-
type: ECustomFormFieldType.text,
|
|
163
|
-
name: 'Nome',
|
|
164
|
-
required: true,
|
|
165
|
-
config: { multiline: false },
|
|
166
|
-
isActive: true,
|
|
167
|
-
},
|
|
168
|
-
// ...mais campos
|
|
169
|
-
];
|
|
170
|
-
|
|
171
|
-
const [formFields, setFormFields] = useState(fields);
|
|
172
|
-
|
|
173
|
-
<CustomFormFields
|
|
174
|
-
fields={formFields}
|
|
175
|
-
onChange={setFormFields}
|
|
176
|
-
onFieldChange={(field) => console.log('Changed:', field)}
|
|
156
|
+
import { CustomFormFields, ECustomFormFieldType, validateFields } from "forlogic-core"
|
|
157
|
+
import type { FieldAssociation } from "forlogic-core"
|
|
158
|
+
|
|
159
|
+
const fields: FieldAssociation[] = [
|
|
160
|
+
{
|
|
161
|
+
id: 'f1',
|
|
162
|
+
type: ECustomFormFieldType.text,
|
|
163
|
+
name: 'Nome',
|
|
164
|
+
required: true,
|
|
165
|
+
config: { multiline: false },
|
|
166
|
+
isActive: true,
|
|
167
|
+
},
|
|
168
|
+
// ...mais campos
|
|
169
|
+
];
|
|
170
|
+
|
|
171
|
+
const [formFields, setFormFields] = useState(fields);
|
|
172
|
+
|
|
173
|
+
<CustomFormFields
|
|
174
|
+
fields={formFields}
|
|
175
|
+
onChange={setFormFields}
|
|
176
|
+
onFieldChange={(field) => console.log('Changed:', field)}
|
|
177
177
|
/>
|
|
178
178
|
```
|
|
179
179
|
|
|
@@ -185,32 +185,32 @@ const [formFields, setFormFields] = useState(fields);
|
|
|
185
185
|
- Use setFormFieldValues() para aplicar valores salvos a uma lista de campos.
|
|
186
186
|
- Campos de seleção suportam dataSource custom (dados estáticos) e users (lista de usuários do sistema).
|
|
187
187
|
|
|
188
|
-
> Fonte: `src
|
|
188
|
+
> Fonte: `src\design-system\docs\components\CustomFormFieldsDoc.tsx`
|
|
189
189
|
|
|
190
190
|
---
|
|
191
191
|
|
|
192
192
|
### Select
|
|
193
193
|
|
|
194
|
-
Exibe uma lista de opções para o usuário escolher—acionada por um botão.
|
|
194
|
+
Exibe uma lista de opções para o usuário escolher—acionada por um botão. O item selecionado é destacado por background (accent), fonte medium e borda esquerda na cor primary. A prop `showCheck` (opcional) adiciona um ícone de check à esquerda do item selecionado.
|
|
195
195
|
|
|
196
196
|
**Uso:**
|
|
197
197
|
```tsx
|
|
198
|
-
import {
|
|
199
|
-
Select,
|
|
200
|
-
SelectContent,
|
|
201
|
-
SelectItem,
|
|
202
|
-
SelectTrigger,
|
|
203
|
-
SelectValue,
|
|
204
|
-
} from "forlogic-core"
|
|
205
|
-
|
|
206
|
-
<Select>
|
|
207
|
-
<SelectTrigger className="w-[180px]">
|
|
208
|
-
<SelectValue placeholder="Theme" />
|
|
209
|
-
</SelectTrigger>
|
|
210
|
-
<SelectContent>
|
|
211
|
-
<SelectItem value="light">Light</SelectItem>
|
|
212
|
-
<SelectItem value="dark">Dark</SelectItem>
|
|
213
|
-
</SelectContent>
|
|
198
|
+
import {
|
|
199
|
+
Select,
|
|
200
|
+
SelectContent,
|
|
201
|
+
SelectItem,
|
|
202
|
+
SelectTrigger,
|
|
203
|
+
SelectValue,
|
|
204
|
+
} from "forlogic-core"
|
|
205
|
+
|
|
206
|
+
<Select>
|
|
207
|
+
<SelectTrigger className="w-[180px]">
|
|
208
|
+
<SelectValue placeholder="Theme" />
|
|
209
|
+
</SelectTrigger>
|
|
210
|
+
<SelectContent>
|
|
211
|
+
<SelectItem value="light">Light</SelectItem>
|
|
212
|
+
<SelectItem value="dark">Dark</SelectItem>
|
|
213
|
+
</SelectContent>
|
|
214
214
|
</Select>
|
|
215
215
|
```
|
|
216
216
|
|
|
@@ -221,6 +221,7 @@ import {
|
|
|
221
221
|
| `value` | `string` | - | O valor selecionado controlado. |
|
|
222
222
|
| `onValueChange` | `(value: string) => void` | - | Manipulador de evento quando o valor muda. |
|
|
223
223
|
| `disabled` | `boolean` | false | Se o select está desabilitado. |
|
|
224
|
+
| `showCheck` | `boolean` | false | Exibe o ícone de check à esquerda do item selecionado. Quando false, o item selecionado é destacado apenas pelo background, fonte medium e borda esquerda primary. |
|
|
224
225
|
| `container (SelectContent)` | `HTMLElement` | - | Container HTML para portal (útil dentro de Dialog). |
|
|
225
226
|
| `collisionBoundary (SelectContent)` | `HTMLElement` | - | Elemento para detecção de colisão de posicionamento. |
|
|
226
227
|
|
|
@@ -236,13 +237,17 @@ import {
|
|
|
236
237
|
- quando o Select estiver dentro de um Dialog para evitar problemas de scroll
|
|
237
238
|
- 💡 Para seleção com busca, considere usar
|
|
238
239
|
- ao invés de
|
|
239
|
-
- ,
|
|
240
|
+
- ,
|
|
240
241
|
|
|
241
242
|
- rounded-lg
|
|
242
243
|
- hover:border-primary
|
|
243
244
|
- transition-colors
|
|
245
|
+
- ,
|
|
246
|
+
|
|
247
|
+
- Combobox
|
|
248
|
+
- showCheck
|
|
244
249
|
|
|
245
|
-
> Fonte: `src
|
|
250
|
+
> Fonte: `src\design-system\docs\components\SelectDoc.tsx`
|
|
246
251
|
|
|
247
252
|
---
|
|
248
253
|
|
|
@@ -252,40 +257,40 @@ Módulo hierárquico de liderança para gerenciar relações de liderança entre
|
|
|
252
257
|
|
|
253
258
|
**Uso:**
|
|
254
259
|
```tsx
|
|
255
|
-
// Página completa de liderança
|
|
256
|
-
import { LeadershipPage } from 'forlogic-core';
|
|
257
|
-
|
|
258
|
-
function MyLeadershipPage() {
|
|
259
|
-
return <LeadershipPage />;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
// Ou use componentes individuais
|
|
263
|
-
import {
|
|
264
|
-
LeadershipDialog,
|
|
265
|
-
useLeadershipApi
|
|
266
|
-
} from 'forlogic-core';
|
|
267
|
-
|
|
268
|
-
function CustomLeadershipView() {
|
|
269
|
-
const { data: leaders, isLoading } = useLeadershipApi();
|
|
270
|
-
const [dialogOpen, setDialogOpen] = useState(false);
|
|
271
|
-
|
|
272
|
-
if (isLoading) return <div>Carregando...</div>;
|
|
273
|
-
|
|
274
|
-
return (
|
|
275
|
-
<div>
|
|
276
|
-
<Button onClick={() => setDialogOpen(true)}>
|
|
277
|
-
Adicionar Líder
|
|
278
|
-
</Button>
|
|
279
|
-
|
|
280
|
-
<LeadershipDialog
|
|
281
|
-
open={dialogOpen}
|
|
282
|
-
onOpenChange={setDialogOpen}
|
|
283
|
-
title="Novo Líder"
|
|
284
|
-
/>
|
|
285
|
-
|
|
286
|
-
{/* Renderizar hierarquia */}
|
|
287
|
-
</div>
|
|
288
|
-
);
|
|
260
|
+
// Página completa de liderança
|
|
261
|
+
import { LeadershipPage } from 'forlogic-core';
|
|
262
|
+
|
|
263
|
+
function MyLeadershipPage() {
|
|
264
|
+
return <LeadershipPage />;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// Ou use componentes individuais
|
|
268
|
+
import {
|
|
269
|
+
LeadershipDialog,
|
|
270
|
+
useLeadershipApi
|
|
271
|
+
} from 'forlogic-core';
|
|
272
|
+
|
|
273
|
+
function CustomLeadershipView() {
|
|
274
|
+
const { data: leaders, isLoading } = useLeadershipApi();
|
|
275
|
+
const [dialogOpen, setDialogOpen] = useState(false);
|
|
276
|
+
|
|
277
|
+
if (isLoading) return <div>Carregando...</div>;
|
|
278
|
+
|
|
279
|
+
return (
|
|
280
|
+
<div>
|
|
281
|
+
<Button onClick={() => setDialogOpen(true)}>
|
|
282
|
+
Adicionar Líder
|
|
283
|
+
</Button>
|
|
284
|
+
|
|
285
|
+
<LeadershipDialog
|
|
286
|
+
open={dialogOpen}
|
|
287
|
+
onOpenChange={setDialogOpen}
|
|
288
|
+
title="Novo Líder"
|
|
289
|
+
/>
|
|
290
|
+
|
|
291
|
+
{/* Renderizar hierarquia */}
|
|
292
|
+
</div>
|
|
293
|
+
);
|
|
289
294
|
}
|
|
290
295
|
```
|
|
291
296
|
|
|
@@ -322,7 +327,7 @@ function CustomLeadershipView() {
|
|
|
322
327
|
- O estado de expansão é persistido no localStorage por alias.
|
|
323
328
|
- Soft delete é usado para remoção (is_removed = true).
|
|
324
329
|
|
|
325
|
-
> Fonte: `src
|
|
330
|
+
> Fonte: `src\design-system\docs\components\LeadershipDoc.tsx`
|
|
326
331
|
|
|
327
332
|
---
|
|
328
333
|
|
|
@@ -332,30 +337,30 @@ Módulo completo para upload, edição e renderização de imagens e vídeos. In
|
|
|
332
337
|
|
|
333
338
|
**Uso:**
|
|
334
339
|
```tsx
|
|
335
|
-
// Exemplo básico de upload de imagem
|
|
336
|
-
const { upload, uploading, progress } = useMediaUpload({
|
|
337
|
-
uploadFunction: async (file, options) => {
|
|
338
|
-
// Implementação do upload para seu storage
|
|
339
|
-
const url = await uploadToStorage(file, options);
|
|
340
|
-
return { url, path: file.name };
|
|
341
|
-
}
|
|
342
|
-
});
|
|
343
|
-
|
|
344
|
-
// Renderizar uma imagem
|
|
345
|
-
<ImageRenderer
|
|
346
|
-
content={{
|
|
347
|
-
imageUrl: 'https://example.com/image.jpg',
|
|
348
|
-
caption: 'Legenda da imagem',
|
|
349
|
-
alignment: 'center'
|
|
350
|
-
}}
|
|
351
|
-
/>
|
|
352
|
-
|
|
353
|
-
// Renderizar um vídeo
|
|
354
|
-
<VideoRenderer
|
|
355
|
-
content={{
|
|
356
|
-
videoUrl: 'https://youtube.com/watch?v=...',
|
|
357
|
-
controls: true
|
|
358
|
-
}}
|
|
340
|
+
// Exemplo básico de upload de imagem
|
|
341
|
+
const { upload, uploading, progress } = useMediaUpload({
|
|
342
|
+
uploadFunction: async (file, options) => {
|
|
343
|
+
// Implementação do upload para seu storage
|
|
344
|
+
const url = await uploadToStorage(file, options);
|
|
345
|
+
return { url, path: file.name };
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
// Renderizar uma imagem
|
|
350
|
+
<ImageRenderer
|
|
351
|
+
content={{
|
|
352
|
+
imageUrl: 'https://example.com/image.jpg',
|
|
353
|
+
caption: 'Legenda da imagem',
|
|
354
|
+
alignment: 'center'
|
|
355
|
+
}}
|
|
356
|
+
/>
|
|
357
|
+
|
|
358
|
+
// Renderizar um vídeo
|
|
359
|
+
<VideoRenderer
|
|
360
|
+
content={{
|
|
361
|
+
videoUrl: 'https://youtube.com/watch?v=...',
|
|
362
|
+
controls: true
|
|
363
|
+
}}
|
|
359
364
|
/>
|
|
360
365
|
```
|
|
361
366
|
|
|
@@ -398,7 +403,7 @@ import { useMediaUpload, getSupabaseClient } from
|
|
|
398
403
|
- O módulo não inclui implementação de storage - use Supabase, S3, etc.
|
|
399
404
|
- Helpers de imagem usam Canvas API para compressão e resize
|
|
400
405
|
|
|
401
|
-
> Fonte: `src
|
|
406
|
+
> Fonte: `src\design-system\docs\components\MediaDoc.tsx`
|
|
402
407
|
|
|
403
408
|
---
|
|
404
409
|
|
|
@@ -408,81 +413,81 @@ Módulo para gerenciar estruturas hierárquicas de locais integrado com a API Qu
|
|
|
408
413
|
|
|
409
414
|
**Uso:**
|
|
410
415
|
```tsx
|
|
411
|
-
// =====================
|
|
412
|
-
// BUSCAR LOCAIS
|
|
413
|
-
// =====================
|
|
414
|
-
import { placeService } from 'forlogic-core';
|
|
415
|
-
|
|
416
|
-
async function loadPlaces() {
|
|
417
|
-
const places = await placeService.getPlaces(alias, companyId);
|
|
418
|
-
// places já vem em estrutura hierárquica
|
|
419
|
-
console.log(places);
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
// =====================
|
|
423
|
-
// LISTA SIMPLES (SEM GESTÃO DE ACESSOS)
|
|
424
|
-
// =====================
|
|
425
|
-
import { PlacesList } from 'forlogic-core';
|
|
426
|
-
|
|
427
|
-
function MyPlacesPage() {
|
|
428
|
-
const [places, setPlaces] = useState<Place[]>([]);
|
|
429
|
-
const [isLoading, setIsLoading] = useState(true);
|
|
430
|
-
|
|
431
|
-
useEffect(() => {
|
|
432
|
-
placeService.getPlaces(alias, companyId)
|
|
433
|
-
.then(setPlaces)
|
|
434
|
-
.finally(() => setIsLoading(false));
|
|
435
|
-
}, [alias, companyId]);
|
|
436
|
-
|
|
437
|
-
return (
|
|
438
|
-
<PlacesList
|
|
439
|
-
places={places}
|
|
440
|
-
isLoading={isLoading}
|
|
441
|
-
/>
|
|
442
|
-
);
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
// =====================
|
|
446
|
-
// COM GESTÃO DE ACESSOS
|
|
447
|
-
// =====================
|
|
448
|
-
import { PlacesList, PlaceCard } from 'forlogic-core';
|
|
449
|
-
|
|
450
|
-
function PlacesWithAccess() {
|
|
451
|
-
const [places, setPlaces] = useState<Place[]>([]);
|
|
452
|
-
const [managers, setManagers] = useState<Record<string, string>>({});
|
|
453
|
-
const [members, setMembers] = useState<Record<string, string[]>>({});
|
|
454
|
-
|
|
455
|
-
const manageAccessConfig = {
|
|
456
|
-
onMakeManager: async (userId, placeId) => {
|
|
457
|
-
setManagers(prev => ({ ...prev, [placeId]: userId }));
|
|
458
|
-
// Chamar API para salvar
|
|
459
|
-
},
|
|
460
|
-
onMakeMembers: async (userIds, placeId) => {
|
|
461
|
-
setMembers(prev => ({ ...prev, [placeId]: userIds }));
|
|
462
|
-
// Chamar API para salvar
|
|
463
|
-
},
|
|
464
|
-
getCurrentManagerId: (placeId) => managers[placeId],
|
|
465
|
-
getCurrentMemberIds: (placeId) => members[placeId] || []
|
|
466
|
-
};
|
|
467
|
-
|
|
468
|
-
return (
|
|
469
|
-
<PlacesList
|
|
470
|
-
places={places}
|
|
471
|
-
isLoading={false}
|
|
472
|
-
manageAccessConfig={manageAccessConfig}
|
|
473
|
-
/>
|
|
474
|
-
);
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
// =====================
|
|
478
|
-
// PLACECARD INDIVIDUAL
|
|
479
|
-
// =====================
|
|
480
|
-
import { PlaceCard } from 'forlogic-core';
|
|
481
|
-
|
|
482
|
-
<PlaceCard
|
|
483
|
-
place={myPlace}
|
|
484
|
-
level={0}
|
|
485
|
-
manageAccessConfig={manageAccessConfig}
|
|
416
|
+
// =====================
|
|
417
|
+
// BUSCAR LOCAIS
|
|
418
|
+
// =====================
|
|
419
|
+
import { placeService } from 'forlogic-core';
|
|
420
|
+
|
|
421
|
+
async function loadPlaces() {
|
|
422
|
+
const places = await placeService.getPlaces(alias, companyId);
|
|
423
|
+
// places já vem em estrutura hierárquica
|
|
424
|
+
console.log(places);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
// =====================
|
|
428
|
+
// LISTA SIMPLES (SEM GESTÃO DE ACESSOS)
|
|
429
|
+
// =====================
|
|
430
|
+
import { PlacesList } from 'forlogic-core';
|
|
431
|
+
|
|
432
|
+
function MyPlacesPage() {
|
|
433
|
+
const [places, setPlaces] = useState<Place[]>([]);
|
|
434
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
435
|
+
|
|
436
|
+
useEffect(() => {
|
|
437
|
+
placeService.getPlaces(alias, companyId)
|
|
438
|
+
.then(setPlaces)
|
|
439
|
+
.finally(() => setIsLoading(false));
|
|
440
|
+
}, [alias, companyId]);
|
|
441
|
+
|
|
442
|
+
return (
|
|
443
|
+
<PlacesList
|
|
444
|
+
places={places}
|
|
445
|
+
isLoading={isLoading}
|
|
446
|
+
/>
|
|
447
|
+
);
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
// =====================
|
|
451
|
+
// COM GESTÃO DE ACESSOS
|
|
452
|
+
// =====================
|
|
453
|
+
import { PlacesList, PlaceCard } from 'forlogic-core';
|
|
454
|
+
|
|
455
|
+
function PlacesWithAccess() {
|
|
456
|
+
const [places, setPlaces] = useState<Place[]>([]);
|
|
457
|
+
const [managers, setManagers] = useState<Record<string, string>>({});
|
|
458
|
+
const [members, setMembers] = useState<Record<string, string[]>>({});
|
|
459
|
+
|
|
460
|
+
const manageAccessConfig = {
|
|
461
|
+
onMakeManager: async (userId, placeId) => {
|
|
462
|
+
setManagers(prev => ({ ...prev, [placeId]: userId }));
|
|
463
|
+
// Chamar API para salvar
|
|
464
|
+
},
|
|
465
|
+
onMakeMembers: async (userIds, placeId) => {
|
|
466
|
+
setMembers(prev => ({ ...prev, [placeId]: userIds }));
|
|
467
|
+
// Chamar API para salvar
|
|
468
|
+
},
|
|
469
|
+
getCurrentManagerId: (placeId) => managers[placeId],
|
|
470
|
+
getCurrentMemberIds: (placeId) => members[placeId] || []
|
|
471
|
+
};
|
|
472
|
+
|
|
473
|
+
return (
|
|
474
|
+
<PlacesList
|
|
475
|
+
places={places}
|
|
476
|
+
isLoading={false}
|
|
477
|
+
manageAccessConfig={manageAccessConfig}
|
|
478
|
+
/>
|
|
479
|
+
);
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
// =====================
|
|
483
|
+
// PLACECARD INDIVIDUAL
|
|
484
|
+
// =====================
|
|
485
|
+
import { PlaceCard } from 'forlogic-core';
|
|
486
|
+
|
|
487
|
+
<PlaceCard
|
|
488
|
+
place={myPlace}
|
|
489
|
+
level={0}
|
|
490
|
+
manageAccessConfig={manageAccessConfig}
|
|
486
491
|
/>
|
|
487
492
|
```
|
|
488
493
|
|
|
@@ -500,7 +505,7 @@ import { PlaceCard } from 'forlogic-core';
|
|
|
500
505
|
- A gestão de acessos é opcional - sem manageAccessConfig, apenas exibe.
|
|
501
506
|
- Níveis de hierarquia são controlados pela prop level no PlaceCard.
|
|
502
507
|
|
|
503
|
-
> Fonte: `src
|
|
508
|
+
> Fonte: `src\design-system\docs\components\PlacesDoc.tsx`
|
|
504
509
|
|
|
505
510
|
---
|
|
506
511
|
|
|
@@ -510,65 +515,65 @@ Campo de seleção de usuários integrado com a API Qualiex. Suporta seleção
|
|
|
510
515
|
|
|
511
516
|
**Uso:**
|
|
512
517
|
```tsx
|
|
513
|
-
import { QualiexUserField } from "forlogic-core"
|
|
514
|
-
|
|
515
|
-
// =====================
|
|
516
|
-
// USO BÁSICO
|
|
517
|
-
// =====================
|
|
518
|
-
<QualiexUserField
|
|
519
|
-
value={userId}
|
|
520
|
-
onChange={setUserId}
|
|
521
|
-
placeholder="Selecione..."
|
|
522
|
-
/>
|
|
523
|
-
|
|
524
|
-
// =====================
|
|
525
|
-
// COM LABEL E REQUIRED
|
|
526
|
-
// =====================
|
|
527
|
-
import { UserCheck } from "lucide-react"
|
|
528
|
-
|
|
529
|
-
<QualiexUserField
|
|
530
|
-
label="Responsável"
|
|
531
|
-
required
|
|
532
|
-
icon={UserCheck}
|
|
533
|
-
value={userId}
|
|
534
|
-
onChange={setUserId}
|
|
535
|
-
/>
|
|
536
|
-
|
|
537
|
-
// =====================
|
|
538
|
-
// SELEÇÃO MÚLTIPLA
|
|
539
|
-
// =====================
|
|
540
|
-
const [userIds, setUserIds] = useState<string[]>([])
|
|
541
|
-
|
|
542
|
-
<QualiexUserField
|
|
543
|
-
multiple
|
|
544
|
-
label="Avaliadores"
|
|
545
|
-
required
|
|
546
|
-
value={userIds}
|
|
547
|
-
onChange={setUserIds}
|
|
548
|
-
maxDisplayedBadges={3}
|
|
549
|
-
/>
|
|
550
|
-
|
|
551
|
-
// =====================
|
|
552
|
-
// DISPLAY CUSTOMIZADO
|
|
553
|
-
// =====================
|
|
554
|
-
|
|
555
|
-
// Exibir nome + email
|
|
556
|
-
<QualiexUserField
|
|
557
|
-
displayFormat="name-email"
|
|
558
|
-
value={userId}
|
|
559
|
-
onChange={setUserId}
|
|
560
|
-
/>
|
|
561
|
-
|
|
562
|
-
// Exibir nome + cargo
|
|
563
|
-
<QualiexUserField
|
|
564
|
-
displayFormat="name-role"
|
|
565
|
-
value={userId}
|
|
566
|
-
onChange={setUserId}
|
|
567
|
-
/>
|
|
568
|
-
|
|
569
|
-
// Custom display function
|
|
570
|
-
<QualiexUserField
|
|
571
|
-
displayFormat="custom"
|
|
518
|
+
import { QualiexUserField } from "forlogic-core"
|
|
519
|
+
|
|
520
|
+
// =====================
|
|
521
|
+
// USO BÁSICO
|
|
522
|
+
// =====================
|
|
523
|
+
<QualiexUserField
|
|
524
|
+
value={userId}
|
|
525
|
+
onChange={setUserId}
|
|
526
|
+
placeholder="Selecione..."
|
|
527
|
+
/>
|
|
528
|
+
|
|
529
|
+
// =====================
|
|
530
|
+
// COM LABEL E REQUIRED
|
|
531
|
+
// =====================
|
|
532
|
+
import { UserCheck } from "lucide-react"
|
|
533
|
+
|
|
534
|
+
<QualiexUserField
|
|
535
|
+
label="Responsável"
|
|
536
|
+
required
|
|
537
|
+
icon={UserCheck}
|
|
538
|
+
value={userId}
|
|
539
|
+
onChange={setUserId}
|
|
540
|
+
/>
|
|
541
|
+
|
|
542
|
+
// =====================
|
|
543
|
+
// SELEÇÃO MÚLTIPLA
|
|
544
|
+
// =====================
|
|
545
|
+
const [userIds, setUserIds] = useState<string[]>([])
|
|
546
|
+
|
|
547
|
+
<QualiexUserField
|
|
548
|
+
multiple
|
|
549
|
+
label="Avaliadores"
|
|
550
|
+
required
|
|
551
|
+
value={userIds}
|
|
552
|
+
onChange={setUserIds}
|
|
553
|
+
maxDisplayedBadges={3}
|
|
554
|
+
/>
|
|
555
|
+
|
|
556
|
+
// =====================
|
|
557
|
+
// DISPLAY CUSTOMIZADO
|
|
558
|
+
// =====================
|
|
559
|
+
|
|
560
|
+
// Exibir nome + email
|
|
561
|
+
<QualiexUserField
|
|
562
|
+
displayFormat="name-email"
|
|
563
|
+
value={userId}
|
|
564
|
+
onChange={setUserId}
|
|
565
|
+
/>
|
|
566
|
+
|
|
567
|
+
// Exibir nome + cargo
|
|
568
|
+
<QualiexUserField
|
|
569
|
+
displayFormat="name-role"
|
|
570
|
+
value={userId}
|
|
571
|
+
onChange={setUserId}
|
|
572
|
+
/>
|
|
573
|
+
|
|
574
|
+
// Custom display function
|
|
575
|
+
<QualiexUserField
|
|
576
|
+
displayFormat="custom"
|
|
572
577
|
customDisplayFn={(user) => \`\${user.userName} - \${user.placeName || 'Sem local'}\
|
|
573
578
|
```
|
|
574
579
|
|
|
@@ -587,7 +592,7 @@ const [userIds, setUserIds] = useState<string[]>([])
|
|
|
587
592
|
- O hook useQualiexUsers é usado internamente para buscar os usuários
|
|
588
593
|
- Integrado automaticamente com BaseForm via type=
|
|
589
594
|
|
|
590
|
-
> Fonte: `src
|
|
595
|
+
> Fonte: `src\design-system\docs\components\QualiexUserFieldDoc.tsx`
|
|
591
596
|
|
|
592
597
|
---
|
|
593
598
|
|
|
@@ -599,26 +604,26 @@ const [userIds, setUserIds] = useState<string[]>([])
|
|
|
599
604
|
|
|
600
605
|
### Select
|
|
601
606
|
|
|
602
|
-
Exibe uma lista de opções para o usuário escolher—acionada por um botão.
|
|
607
|
+
Exibe uma lista de opções para o usuário escolher—acionada por um botão. O item selecionado é destacado por background (accent), fonte medium e borda esquerda na cor primary. A prop `showCheck` (opcional) adiciona um ícone de check à esquerda do item selecionado.
|
|
603
608
|
|
|
604
609
|
**Uso:**
|
|
605
610
|
```tsx
|
|
606
|
-
import {
|
|
607
|
-
Select,
|
|
608
|
-
SelectContent,
|
|
609
|
-
SelectItem,
|
|
610
|
-
SelectTrigger,
|
|
611
|
-
SelectValue,
|
|
612
|
-
} from "forlogic-core"
|
|
613
|
-
|
|
614
|
-
<Select>
|
|
615
|
-
<SelectTrigger className="w-[180px]">
|
|
616
|
-
<SelectValue placeholder="Theme" />
|
|
617
|
-
</SelectTrigger>
|
|
618
|
-
<SelectContent>
|
|
619
|
-
<SelectItem value="light">Light</SelectItem>
|
|
620
|
-
<SelectItem value="dark">Dark</SelectItem>
|
|
621
|
-
</SelectContent>
|
|
611
|
+
import {
|
|
612
|
+
Select,
|
|
613
|
+
SelectContent,
|
|
614
|
+
SelectItem,
|
|
615
|
+
SelectTrigger,
|
|
616
|
+
SelectValue,
|
|
617
|
+
} from "forlogic-core"
|
|
618
|
+
|
|
619
|
+
<Select>
|
|
620
|
+
<SelectTrigger className="w-[180px]">
|
|
621
|
+
<SelectValue placeholder="Theme" />
|
|
622
|
+
</SelectTrigger>
|
|
623
|
+
<SelectContent>
|
|
624
|
+
<SelectItem value="light">Light</SelectItem>
|
|
625
|
+
<SelectItem value="dark">Dark</SelectItem>
|
|
626
|
+
</SelectContent>
|
|
622
627
|
</Select>
|
|
623
628
|
```
|
|
624
629
|
|
|
@@ -629,6 +634,7 @@ import {
|
|
|
629
634
|
| `value` | `string` | - | O valor selecionado controlado. |
|
|
630
635
|
| `onValueChange` | `(value: string) => void` | - | Manipulador de evento quando o valor muda. |
|
|
631
636
|
| `disabled` | `boolean` | false | Se o select está desabilitado. |
|
|
637
|
+
| `showCheck` | `boolean` | false | Exibe o ícone de check à esquerda do item selecionado. Quando false, o item selecionado é destacado apenas pelo background, fonte medium e borda esquerda primary. |
|
|
632
638
|
| `container (SelectContent)` | `HTMLElement` | - | Container HTML para portal (útil dentro de Dialog). |
|
|
633
639
|
| `collisionBoundary (SelectContent)` | `HTMLElement` | - | Elemento para detecção de colisão de posicionamento. |
|
|
634
640
|
|
|
@@ -644,13 +650,17 @@ import {
|
|
|
644
650
|
- quando o Select estiver dentro de um Dialog para evitar problemas de scroll
|
|
645
651
|
- 💡 Para seleção com busca, considere usar
|
|
646
652
|
- ao invés de
|
|
647
|
-
- ,
|
|
653
|
+
- ,
|
|
648
654
|
|
|
649
655
|
- rounded-lg
|
|
650
656
|
- hover:border-primary
|
|
651
657
|
- transition-colors
|
|
658
|
+
- ,
|
|
659
|
+
|
|
660
|
+
- Combobox
|
|
661
|
+
- showCheck
|
|
652
662
|
|
|
653
|
-
> Fonte: `src
|
|
663
|
+
> Fonte: `src\design-system\docs\components\SelectDoc.tsx`
|
|
654
664
|
|
|
655
665
|
---
|
|
656
666
|
|