runeforge 0.0.23 → 0.0.25

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.
@@ -1,6 +1,6 @@
1
1
  import type { Component } from 'svelte';
2
2
  import type { FullAutoFill } from 'svelte/elements';
3
- import type { AttributeType, SearchResolver } from './attribute.js';
3
+ import type { AttributeType, SearchResolver, RequiredResolver } from './attribute.js';
4
4
  import type { CellComponent, CellFormatter } from './table.js';
5
5
  export type ColumnDefinition<T extends object = Record<string, unknown>> = {
6
6
  [K in keyof T & string]: {
@@ -17,7 +17,7 @@ export interface FieldDefinition<T extends object = Record<string, unknown>> {
17
17
  attribute: keyof T & string;
18
18
  title?: string;
19
19
  type?: AttributeType;
20
- required?: boolean;
20
+ required?: boolean | RequiredResolver;
21
21
  autocomplete?: FullAutoFill;
22
22
  placeholder?: string;
23
23
  default?: any;
@@ -39,6 +39,11 @@ export interface FieldDefinition<T extends object = Record<string, unknown>> {
39
39
  minLength?: number;
40
40
  maxLength?: number;
41
41
  pattern?: string;
42
+ /** Embedded fields only: sub-field definitions for each item, built from
43
+ * the metadata's `fields`. */
44
+ fields?: FieldDefinition<Record<string, unknown>>[];
45
+ /** Embedded fields only: short label for an item in the list. */
46
+ itemLabel?: (item: Record<string, unknown>) => string;
42
47
  }
43
48
  export interface ActionConfiguration<T extends object = Record<string, unknown>> {
44
49
  enabled?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "runeforge",
3
- "version": "0.0.23",
3
+ "version": "0.0.25",
4
4
  "description": "SvelteKit toolkit for building metadata-driven CRUD interfaces with tables, forms, and actions",
5
5
  "license": "MIT",
6
6
  "author": "Ezequiel Puerta",