@oondemand/oon-core-front 0.3.11 → 0.3.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -267,6 +267,138 @@ interface OonActionDef {
267
267
  capabilities?: string[];
268
268
  action?: string;
269
269
  }
270
+ type OonListFilterDef = {
271
+ field: string;
272
+ label?: string;
273
+ type?: "text" | "select" | "date" | "dateRange" | "numberRange" | "boolean" | "ref";
274
+ options?: Array<{
275
+ label: string;
276
+ value: string | number | boolean | null;
277
+ }>;
278
+ defaultValue?: unknown;
279
+ placeholder?: string;
280
+ };
281
+ type OonConditionDef = {
282
+ field: string;
283
+ exists: boolean;
284
+ } | {
285
+ field: string;
286
+ equals: unknown;
287
+ } | {
288
+ field: string;
289
+ notEquals: unknown;
290
+ } | {
291
+ field: string;
292
+ in: unknown[];
293
+ } | {
294
+ field: string;
295
+ gt: number;
296
+ } | {
297
+ field: string;
298
+ gte: number;
299
+ } | {
300
+ field: string;
301
+ lt: number;
302
+ } | {
303
+ field: string;
304
+ lte: number;
305
+ };
306
+ type OonRowActionDef = {
307
+ id?: string;
308
+ label: string;
309
+ icon?: string;
310
+ type: "openDetailModal" | "navigate" | "apiAction" | "customAction";
311
+ method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
312
+ endpoint?: string;
313
+ href?: string;
314
+ initialTab?: string;
315
+ confirm?: {
316
+ title?: string;
317
+ description?: string;
318
+ };
319
+ disabledWhen?: OonConditionDef;
320
+ hiddenWhen?: OonConditionDef;
321
+ refresh?: Array<"self" | "parent" | "all" | string>;
322
+ roles?: string[];
323
+ permissions?: string[];
324
+ capabilities?: string[];
325
+ renderer?: string;
326
+ };
327
+ type OonCollectionListConfig = {
328
+ filters?: OonListFilterDef[];
329
+ columns?: Array<string | OonColumnDef>;
330
+ rowActions?: OonRowActionDef[];
331
+ };
332
+ type OonRelationDef = {
333
+ model: string;
334
+ foreignKey: string;
335
+ parentKey?: string;
336
+ label?: string;
337
+ };
338
+ type OonRelatedGridColumnDef = OonColumnDef & {
339
+ editable?: boolean;
340
+ readonly?: boolean;
341
+ format?: "text" | "number" | "currency" | "percent" | "date" | "badge";
342
+ editor?: "string" | "number" | "currency" | "date" | "enum" | "select" | "ref" | "boolean" | "textarea";
343
+ hidden?: boolean;
344
+ roles?: string[];
345
+ required?: boolean;
346
+ display?: "badgeExists" | "badge" | string;
347
+ };
348
+ type OonSummaryCardDef = {
349
+ label: string;
350
+ source?: "field" | "relatedCount" | "relatedSum" | "relatedAvg" | "customMetric";
351
+ field?: string;
352
+ relation?: string | OonRelationDef;
353
+ metric?: string;
354
+ format?: "text" | "number" | "currency" | "percent" | "date" | "badge";
355
+ };
356
+ type OonDetailTabDef = {
357
+ id: string;
358
+ label: string;
359
+ type: "summary";
360
+ cards?: OonSummaryCardDef[];
361
+ } | {
362
+ id: string;
363
+ label: string;
364
+ type: "form";
365
+ groups?: Array<{
366
+ label: string;
367
+ description?: string;
368
+ fields: string[];
369
+ columns?: 1 | 2 | 3 | 4;
370
+ }>;
371
+ fields?: string[];
372
+ } | {
373
+ id: string;
374
+ label: string;
375
+ type: "relatedGrid";
376
+ relation: string | OonRelationDef;
377
+ editable?: boolean;
378
+ editMode?: "inline" | "modal" | "drawer";
379
+ columns?: Array<string | OonRelatedGridColumnDef>;
380
+ rowActions?: OonRowActionDef[];
381
+ } | {
382
+ id: string;
383
+ label: string;
384
+ type: "readonlyGrid";
385
+ relation: string | OonRelationDef;
386
+ columns?: Array<string | OonRelatedGridColumnDef>;
387
+ rowActions?: OonRowActionDef[];
388
+ } | {
389
+ id: string;
390
+ label: string;
391
+ type: "customComponent";
392
+ component: string;
393
+ props?: Record<string, unknown>;
394
+ };
395
+ type OonDetailModalConfig = {
396
+ enabled?: boolean;
397
+ titleField?: string;
398
+ size?: "md" | "lg" | "xl" | "full";
399
+ defaultTab?: string;
400
+ tabs: OonDetailTabDef[];
401
+ };
270
402
  interface CollectionViewDef {
271
403
  type: "collection";
272
404
  /** id de rota/menu; default = model em minúsculas. */
@@ -286,6 +418,9 @@ interface CollectionViewDef {
286
418
  renderer?: string;
287
419
  cardRenderer?: string;
288
420
  actions?: OonActionDef[];
421
+ list?: OonCollectionListConfig;
422
+ relations?: Record<string, OonRelationDef>;
423
+ detailModal?: OonDetailModalConfig;
289
424
  permissions?: string[];
290
425
  capabilities?: string[];
291
426
  }
@@ -448,6 +583,9 @@ interface CentralUiManifest {
448
583
  path?: string;
449
584
  label?: string;
450
585
  section?: string;
586
+ list?: OonCollectionListConfig;
587
+ relations?: Record<string, OonRelationDef>;
588
+ detailModal?: OonDetailModalConfig;
451
589
  }>;
452
590
  pipelines?: Array<{
453
591
  name?: string;
@@ -517,8 +655,11 @@ interface CoreCollectionProps {
517
655
  columns?: OonColumnDef[];
518
656
  form?: OonFormFieldDef[];
519
657
  importExport?: boolean;
658
+ list?: OonCollectionListConfig;
659
+ relations?: Record<string, OonRelationDef>;
660
+ detailModal?: OonDetailModalConfig;
520
661
  }
521
- declare function CoreCollection({ model, label, section, mode, endpoint, columns, form, importExport }: CoreCollectionProps): react.JSX.Element;
662
+ declare function CoreCollection({ model, label, section, mode, endpoint, columns, form, importExport, list, relations, detailModal }: CoreCollectionProps): react.JSX.Element;
522
663
 
523
664
  interface CoreDocumentProps {
524
665
  model: string;