@stonecrop/aform 0.11.10 → 0.12.0

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/aform.d.ts CHANGED
@@ -10,6 +10,7 @@ import AFormLink from './components/form/AFormLink.vue';
10
10
  import ANumericInput from './components/form/ANumericInput.vue';
11
11
  import type { App } from 'vue';
12
12
  import ATextInput from './components/form/ATextInput.vue';
13
+ import type { ColumnSchema } from '@stonecrop/schema';
13
14
  import Login from './components/utilities/Login.vue';
14
15
  import type { TableColumn } from '@stonecrop/atable';
15
16
  import type { TableConfig } from '@stonecrop/atable';
@@ -248,15 +249,16 @@ export { Login }
248
249
  export declare type SchemaTypes = FormSchema | TableSchema | FieldsetSchema;
249
250
 
250
251
  /**
251
- * Schema structure for defining tables inside AForm
252
+ * Schema structure for defining tables inside AForm.
253
+ *
254
+ * Two mutually exclusive forms:
255
+ * - **Columns-based** (no `kind`): caller provides `columns` directly
256
+ * - **Schema-delegated** (`kind: 'table'`): caller provides `schema`; ATable runs
257
+ * `schemaToColumns` to derive columns at render time
258
+ *
252
259
  * @public
253
260
  */
254
261
  export declare type TableSchema = BaseSchema & {
255
- /**
256
- * The columns to display in the table
257
- * @public
258
- */
259
- columns?: TableColumn[];
260
262
  /**
261
263
  * The configuration for the table
262
264
  * @public
@@ -267,7 +269,18 @@ export declare type TableSchema = BaseSchema & {
267
269
  * @public
268
270
  */
269
271
  rows?: TableRow[];
270
- };
272
+ } & ({
273
+ /** Explicit column definitions; `schema` and `kind` must not be set */
274
+ columns?: TableColumn[];
275
+ kind?: never;
276
+ schema?: never;
277
+ } | {
278
+ /** Marks this entry as schema-delegated; ATable derives columns from `schema` */
279
+ kind: 'table';
280
+ /** Child schema passed to ATable's `schema` prop */
281
+ schema: ColumnSchema[];
282
+ columns?: never;
283
+ });
271
284
 
272
285
 
273
286
  export * from "@stonecrop/atable/types";