@stonecrop/aform 0.25.0 → 0.27.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 +28 -0
- package/dist/aform.js +1152 -991
- package/dist/aform.js.map +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/src/index.d.ts +4 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +6 -1
- package/dist/src/utils/columns.d.ts +24 -0
- package/dist/src/utils/columns.d.ts.map +1 -0
- package/dist/src/utils/columns.js +33 -0
- package/package.json +5 -5
- package/src/components/AForm.vue +13 -4
- package/src/components/base/ExpandButton.vue +34 -0
- package/src/components/form/ASegmentedControl.vue +342 -0
- package/src/index.ts +7 -0
- package/src/utils/columns.ts +38 -0
package/dist/aform.d.ts
CHANGED
|
@@ -17,10 +17,12 @@ import AFormLoading from './components/AFormLoading.vue';
|
|
|
17
17
|
import ANumericInput from './components/form/ANumericInput.vue';
|
|
18
18
|
import type { App } from 'vue';
|
|
19
19
|
import AQuantityInput from './components/form/AQuantityInput.vue';
|
|
20
|
+
import ASegmentedControl from './components/form/ASegmentedControl.vue';
|
|
20
21
|
import ATextboxInput from './components/form/ATextboxInput.vue';
|
|
21
22
|
import ATextInput from './components/form/ATextInput.vue';
|
|
22
23
|
import type { BadgeDescriptor } from '@stonecrop/schema';
|
|
23
24
|
import type { ColumnSchema } from '@stonecrop/schema';
|
|
25
|
+
import ExpandButton from './components/base/ExpandButton.vue';
|
|
24
26
|
import type { FieldOptions } from '@stonecrop/schema';
|
|
25
27
|
import type { FieldValidation } from '@stonecrop/schema';
|
|
26
28
|
import type { GetRecordsOptions } from '@stonecrop/schema';
|
|
@@ -101,6 +103,8 @@ export { ANumericInput }
|
|
|
101
103
|
|
|
102
104
|
export { AQuantityInput }
|
|
103
105
|
|
|
106
|
+
export { ASegmentedControl }
|
|
107
|
+
|
|
104
108
|
export { ATextboxInput }
|
|
105
109
|
|
|
106
110
|
export { ATextInput }
|
|
@@ -241,6 +245,8 @@ export declare interface CurrencyValue {
|
|
|
241
245
|
*/
|
|
242
246
|
export declare function deserializeFunction<T extends (...args: any[]) => any>(source: string): T;
|
|
243
247
|
|
|
248
|
+
export { ExpandButton }
|
|
249
|
+
|
|
244
250
|
/**
|
|
245
251
|
* Install all AForm components
|
|
246
252
|
* @param app - Vue app instance
|
|
@@ -317,6 +323,28 @@ export declare interface ResolvedFieldset {
|
|
|
317
323
|
schema: ResolvedField[];
|
|
318
324
|
}
|
|
319
325
|
|
|
326
|
+
/**
|
|
327
|
+
* The resolved fields that can be columns in a list or table view, in declaration order.
|
|
328
|
+
*
|
|
329
|
+
* A cell renders one value, so only `kind: 'field'` qualifies. The other three kinds are
|
|
330
|
+
* containers: a `fieldset` groups fields for layout and has no value of its own, while a `link`
|
|
331
|
+
* and a `table` hold a nested record and an array of them. Neither has a `cellComponent`, so a
|
|
332
|
+
* container reaching `ACell` falls through to plain-text rendering and stringifies its children —
|
|
333
|
+
* no error and no log, just a wrong column.
|
|
334
|
+
*
|
|
335
|
+
* A fieldset's *children* are real columns, so it is flattened rather than dropped; losing them is
|
|
336
|
+
* the same silent defect in the other direction.
|
|
337
|
+
*
|
|
338
|
+
* One definition, called by both consumers: `Registry.buildTableConfig` (a child table's columns,
|
|
339
|
+
* from its target's resolved schema) and Desktop's records list. Re-deriving it at either call
|
|
340
|
+
* site produced exactly one of the two failures above at each.
|
|
341
|
+
*
|
|
342
|
+
* @param fields - resolved fields, as produced by `resolveSchema`
|
|
343
|
+
* @returns column definitions, with the `kind` discriminator stripped
|
|
344
|
+
* @public
|
|
345
|
+
*/
|
|
346
|
+
export declare function resolvedFieldsToColumns(fields: readonly ResolvedField[]): ColumnSchema[];
|
|
347
|
+
|
|
320
348
|
/**
|
|
321
349
|
* A resolved Link field with cardinality `one` or `atMostOne` — embedded as a nested form.
|
|
322
350
|
* @public
|