@fieldia/core 0.2.0 → 0.4.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.
Files changed (44) hide show
  1. package/package.json +1 -1
  2. package/schema/page.schema.json +120 -0
  3. package/src/index.d.mts +3 -3
  4. package/src/index.d.ts +3 -3
  5. package/src/index.js +4 -1
  6. package/src/index.js.map +1 -1
  7. package/src/index.mjs +2 -2
  8. package/src/index.mjs.map +1 -1
  9. package/src/lib/format/field.d.mts +130 -0
  10. package/src/lib/format/field.d.ts +130 -0
  11. package/src/lib/format/field.js +45 -2
  12. package/src/lib/format/field.js.map +1 -1
  13. package/src/lib/format/field.mjs +44 -1
  14. package/src/lib/format/field.mjs.map +1 -1
  15. package/src/lib/format/layout.d.mts +37 -2
  16. package/src/lib/format/layout.d.ts +37 -2
  17. package/src/lib/format/layout.js +4 -0
  18. package/src/lib/format/layout.js.map +1 -1
  19. package/src/lib/format/layout.mjs +4 -0
  20. package/src/lib/format/layout.mjs.map +1 -1
  21. package/src/lib/format/page.d.mts +41 -0
  22. package/src/lib/format/page.d.ts +41 -0
  23. package/src/lib/format/validate.js +80 -1
  24. package/src/lib/format/validate.js.map +1 -1
  25. package/src/lib/format/validate.mjs +80 -1
  26. package/src/lib/format/validate.mjs.map +1 -1
  27. package/src/lib/record/data-source.d.mts +7 -0
  28. package/src/lib/record/data-source.d.ts +7 -0
  29. package/src/lib/record/form.d.mts +9 -0
  30. package/src/lib/record/form.d.ts +9 -0
  31. package/src/lib/record/form.js +57 -1
  32. package/src/lib/record/form.js.map +1 -1
  33. package/src/lib/record/form.mjs +58 -2
  34. package/src/lib/record/form.mjs.map +1 -1
  35. package/src/lib/record/memory-data-source.js +8 -0
  36. package/src/lib/record/memory-data-source.js.map +1 -1
  37. package/src/lib/record/memory-data-source.mjs +8 -0
  38. package/src/lib/record/memory-data-source.mjs.map +1 -1
  39. package/src/lib/record/values.d.mts +7 -0
  40. package/src/lib/record/values.d.ts +7 -0
  41. package/src/lib/record/values.js +16 -0
  42. package/src/lib/record/values.js.map +1 -1
  43. package/src/lib/record/values.mjs +15 -0
  44. package/src/lib/record/values.mjs.map +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fieldia/core",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "Headless form model for Fieldia: the page format, modifiers, validation and record state. No DOM.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://fieldia.dev",
@@ -643,6 +643,13 @@
643
643
  "additionalProperties": {
644
644
  "$ref": "#/$defs/LineField"
645
645
  }
646
+ },
647
+ "lineKinds": {
648
+ "$ref": "#/$defs/LineKinds"
649
+ },
650
+ "sequenceField": {
651
+ "type": "string",
652
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
646
653
  }
647
654
  },
648
655
  "required": [
@@ -711,6 +718,12 @@
711
718
  },
712
719
  "default": {
713
720
  "$ref": "#/$defs/JsonValue"
721
+ },
722
+ "definitions": {
723
+ "type": "array",
724
+ "items": {
725
+ "$ref": "#/$defs/PropertyDefinition"
726
+ }
714
727
  }
715
728
  },
716
729
  "required": [
@@ -1429,6 +1442,12 @@
1429
1442
  },
1430
1443
  "default": {
1431
1444
  "$ref": "#/$defs/JsonValue"
1445
+ },
1446
+ "definitions": {
1447
+ "type": "array",
1448
+ "items": {
1449
+ "$ref": "#/$defs/PropertyDefinition"
1450
+ }
1432
1451
  }
1433
1452
  },
1434
1453
  "required": [
@@ -1468,6 +1487,69 @@
1468
1487
  }
1469
1488
  ]
1470
1489
  },
1490
+ "PropertyDefinition": {
1491
+ "type": "object",
1492
+ "properties": {
1493
+ "name": {
1494
+ "type": "string",
1495
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
1496
+ },
1497
+ "label": {
1498
+ "type": "string"
1499
+ },
1500
+ "type": {
1501
+ "type": "string",
1502
+ "enum": [
1503
+ "char",
1504
+ "text",
1505
+ "integer",
1506
+ "float",
1507
+ "boolean",
1508
+ "selection",
1509
+ "date"
1510
+ ]
1511
+ },
1512
+ "options": {
1513
+ "minItems": 1,
1514
+ "type": "array",
1515
+ "items": {
1516
+ "$ref": "#/$defs/Option"
1517
+ }
1518
+ }
1519
+ },
1520
+ "required": [
1521
+ "name",
1522
+ "label",
1523
+ "type"
1524
+ ],
1525
+ "additionalProperties": false
1526
+ },
1527
+ "LineKinds": {
1528
+ "type": "object",
1529
+ "properties": {
1530
+ "field": {
1531
+ "type": "string",
1532
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
1533
+ },
1534
+ "text": {
1535
+ "type": "string",
1536
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
1537
+ },
1538
+ "section": {
1539
+ "type": "string",
1540
+ "minLength": 1
1541
+ },
1542
+ "note": {
1543
+ "type": "string",
1544
+ "minLength": 1
1545
+ }
1546
+ },
1547
+ "required": [
1548
+ "field",
1549
+ "text"
1550
+ ],
1551
+ "additionalProperties": false
1552
+ },
1471
1553
  "RootLayout": {
1472
1554
  "oneOf": [
1473
1555
  {
@@ -1774,6 +1856,15 @@
1774
1856
  "type": "string",
1775
1857
  "minLength": 1
1776
1858
  },
1859
+ "options": {
1860
+ "type": "object",
1861
+ "propertyNames": {
1862
+ "type": "string"
1863
+ },
1864
+ "additionalProperties": {
1865
+ "$ref": "#/$defs/JsonValue"
1866
+ }
1867
+ },
1777
1868
  "placeholder": {
1778
1869
  "type": "string"
1779
1870
  },
@@ -1793,6 +1884,35 @@
1793
1884
  "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
1794
1885
  }
1795
1886
  },
1887
+ "totals": {
1888
+ "minItems": 1,
1889
+ "type": "array",
1890
+ "items": {
1891
+ "type": "string",
1892
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
1893
+ }
1894
+ },
1895
+ "optionalColumns": {
1896
+ "type": "object",
1897
+ "propertyNames": {
1898
+ "type": "string",
1899
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
1900
+ },
1901
+ "additionalProperties": {
1902
+ "type": "string",
1903
+ "enum": [
1904
+ "show",
1905
+ "hide"
1906
+ ]
1907
+ }
1908
+ },
1909
+ "editMode": {
1910
+ "type": "string",
1911
+ "enum": [
1912
+ "cell",
1913
+ "row"
1914
+ ]
1915
+ },
1796
1916
  "invisible": {
1797
1917
  "$ref": "#/$defs/Modifier"
1798
1918
  },
package/src/index.d.mts CHANGED
@@ -1,14 +1,14 @@
1
1
  export type { JsonValue } from './lib/format/json.mjs';
2
- export { FIELD_NAME, FIELD_TYPES, FieldSchema, FieldsSchema, LineFieldSchema, OptionSchema, FilterConditionSchema, type Field, type Fields, type FieldType, type LineField, type Option, type FilterCondition, } from './lib/format/field.mjs';
2
+ export { FIELD_NAME, FIELD_TYPES, FieldSchema, FieldsSchema, LineFieldSchema, LineKindsSchema, OptionSchema, PropertyDefinitionSchema, FilterConditionSchema, type Field, type Fields, type FieldType, type LineField, type LineKinds, type Option, type PropertyDefinition, type FilterCondition, } from './lib/format/field.mjs';
3
3
  export { ModifierSchema, LayoutNodeSchema, RootLayoutSchema, type Modifier, type Tone, type FieldNode, type ButtonNode, type TextNode, type SlotNode, type SectionNode, type TabNode, type TabsNode, type StepNode, type WizardNode, type SectionsNode, type SheetNode, type SheetTitle, type Statusbar, type StatButton, type Ribbon, type Alert, type LayoutNode, type RootLayout, } from './lib/format/layout.mjs';
4
4
  export { FORMAT_VERSION, PageSchema, type Page, type PageData } from './lib/format/page.mjs';
5
5
  export { validatePage, type PageIssue, type PageValidation } from './lib/format/validate.mjs';
6
6
  export { pageJsonSchema } from './lib/format/json-schema.mjs';
7
7
  export { compileModifier, type CompiledModifier } from './lib/expression/modifier.mjs';
8
8
  export { evaluateModifier, isModifierValid } from './lib/expression/evaluateModifier.mjs';
9
- export { emptyValue, initialValues, isEmpty, expressionContext, type RecordId, type RelatedRecord, type ReferenceValue, type FileValue, type Line, type Value, type Values, } from './lib/record/values.mjs';
9
+ export { emptyValue, initialValues, isEmpty, expressionContext, lineKind, type RecordId, type RelatedRecord, type ReferenceValue, type FileValue, type Line, type Value, type Values, } from './lib/record/values.mjs';
10
10
  export { checkValue, formatBytes } from './lib/record/check.mjs';
11
- export type { DataSource, LoadRequest, SaveRequest, SaveResult, OnchangeRequest, OnchangeResult, SearchRequest, SubmitRequest, SubmitResult, ResolvedFilterCondition, RecordChanges, LineOp, LinkOp, } from './lib/record/data-source.mjs';
11
+ export type { DataSource, LoadRequest, SaveRequest, SaveResult, OnchangeRequest, OnchangeResult, SearchRequest, CreateRequest, SubmitRequest, SubmitResult, ResolvedFilterCondition, RecordChanges, LineOp, LinkOp, } from './lib/record/data-source.mjs';
12
12
  export { createMemoryDataSource, type MemoryDataSource, type MemoryDataSourceOptions } from './lib/record/memory-data-source.mjs';
13
13
  export { hostScheduler, wait, type Scheduler } from './lib/record/scheduler.mjs';
14
14
  export { createForm, type Form, type FormOptions, type FormState, type FormStatus, type NodeState, type DraftStore, type ActionRequest, } from './lib/record/form.mjs';
package/src/index.d.ts CHANGED
@@ -1,14 +1,14 @@
1
1
  export type { JsonValue } from './lib/format/json';
2
- export { FIELD_NAME, FIELD_TYPES, FieldSchema, FieldsSchema, LineFieldSchema, OptionSchema, FilterConditionSchema, type Field, type Fields, type FieldType, type LineField, type Option, type FilterCondition, } from './lib/format/field';
2
+ export { FIELD_NAME, FIELD_TYPES, FieldSchema, FieldsSchema, LineFieldSchema, LineKindsSchema, OptionSchema, PropertyDefinitionSchema, FilterConditionSchema, type Field, type Fields, type FieldType, type LineField, type LineKinds, type Option, type PropertyDefinition, type FilterCondition, } from './lib/format/field';
3
3
  export { ModifierSchema, LayoutNodeSchema, RootLayoutSchema, type Modifier, type Tone, type FieldNode, type ButtonNode, type TextNode, type SlotNode, type SectionNode, type TabNode, type TabsNode, type StepNode, type WizardNode, type SectionsNode, type SheetNode, type SheetTitle, type Statusbar, type StatButton, type Ribbon, type Alert, type LayoutNode, type RootLayout, } from './lib/format/layout';
4
4
  export { FORMAT_VERSION, PageSchema, type Page, type PageData } from './lib/format/page';
5
5
  export { validatePage, type PageIssue, type PageValidation } from './lib/format/validate';
6
6
  export { pageJsonSchema } from './lib/format/json-schema';
7
7
  export { compileModifier, type CompiledModifier } from './lib/expression/modifier';
8
8
  export { evaluateModifier, isModifierValid } from './lib/expression/evaluateModifier';
9
- export { emptyValue, initialValues, isEmpty, expressionContext, type RecordId, type RelatedRecord, type ReferenceValue, type FileValue, type Line, type Value, type Values, } from './lib/record/values';
9
+ export { emptyValue, initialValues, isEmpty, expressionContext, lineKind, type RecordId, type RelatedRecord, type ReferenceValue, type FileValue, type Line, type Value, type Values, } from './lib/record/values';
10
10
  export { checkValue, formatBytes } from './lib/record/check';
11
- export type { DataSource, LoadRequest, SaveRequest, SaveResult, OnchangeRequest, OnchangeResult, SearchRequest, SubmitRequest, SubmitResult, ResolvedFilterCondition, RecordChanges, LineOp, LinkOp, } from './lib/record/data-source';
11
+ export type { DataSource, LoadRequest, SaveRequest, SaveResult, OnchangeRequest, OnchangeResult, SearchRequest, CreateRequest, SubmitRequest, SubmitResult, ResolvedFilterCondition, RecordChanges, LineOp, LinkOp, } from './lib/record/data-source';
12
12
  export { createMemoryDataSource, type MemoryDataSource, type MemoryDataSourceOptions } from './lib/record/memory-data-source';
13
13
  export { hostScheduler, wait, type Scheduler } from './lib/record/scheduler';
14
14
  export { createForm, type Form, type FormOptions, type FormState, type FormStatus, type NodeState, type DraftStore, type ActionRequest, } from './lib/record/form';
package/src/index.js CHANGED
@@ -1,13 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fill = exports.MESSAGES = exports.createForm = exports.wait = exports.hostScheduler = exports.createMemoryDataSource = exports.formatBytes = exports.checkValue = exports.expressionContext = exports.isEmpty = exports.initialValues = exports.emptyValue = exports.isModifierValid = exports.evaluateModifier = exports.compileModifier = exports.pageJsonSchema = exports.validatePage = exports.PageSchema = exports.FORMAT_VERSION = exports.RootLayoutSchema = exports.LayoutNodeSchema = exports.ModifierSchema = exports.FilterConditionSchema = exports.OptionSchema = exports.LineFieldSchema = exports.FieldsSchema = exports.FieldSchema = exports.FIELD_TYPES = exports.FIELD_NAME = void 0;
3
+ exports.fill = exports.MESSAGES = exports.createForm = exports.wait = exports.hostScheduler = exports.createMemoryDataSource = exports.formatBytes = exports.checkValue = exports.lineKind = exports.expressionContext = exports.isEmpty = exports.initialValues = exports.emptyValue = exports.isModifierValid = exports.evaluateModifier = exports.compileModifier = exports.pageJsonSchema = exports.validatePage = exports.PageSchema = exports.FORMAT_VERSION = exports.RootLayoutSchema = exports.LayoutNodeSchema = exports.ModifierSchema = exports.FilterConditionSchema = exports.PropertyDefinitionSchema = exports.OptionSchema = exports.LineKindsSchema = exports.LineFieldSchema = exports.FieldsSchema = exports.FieldSchema = exports.FIELD_TYPES = exports.FIELD_NAME = void 0;
4
4
  var field_1 = require("./lib/format/field");
5
5
  Object.defineProperty(exports, "FIELD_NAME", { enumerable: true, get: function () { return field_1.FIELD_NAME; } });
6
6
  Object.defineProperty(exports, "FIELD_TYPES", { enumerable: true, get: function () { return field_1.FIELD_TYPES; } });
7
7
  Object.defineProperty(exports, "FieldSchema", { enumerable: true, get: function () { return field_1.FieldSchema; } });
8
8
  Object.defineProperty(exports, "FieldsSchema", { enumerable: true, get: function () { return field_1.FieldsSchema; } });
9
9
  Object.defineProperty(exports, "LineFieldSchema", { enumerable: true, get: function () { return field_1.LineFieldSchema; } });
10
+ Object.defineProperty(exports, "LineKindsSchema", { enumerable: true, get: function () { return field_1.LineKindsSchema; } });
10
11
  Object.defineProperty(exports, "OptionSchema", { enumerable: true, get: function () { return field_1.OptionSchema; } });
12
+ Object.defineProperty(exports, "PropertyDefinitionSchema", { enumerable: true, get: function () { return field_1.PropertyDefinitionSchema; } });
11
13
  Object.defineProperty(exports, "FilterConditionSchema", { enumerable: true, get: function () { return field_1.FilterConditionSchema; } });
12
14
  var layout_1 = require("./lib/format/layout");
13
15
  Object.defineProperty(exports, "ModifierSchema", { enumerable: true, get: function () { return layout_1.ModifierSchema; } });
@@ -30,6 +32,7 @@ Object.defineProperty(exports, "emptyValue", { enumerable: true, get: function (
30
32
  Object.defineProperty(exports, "initialValues", { enumerable: true, get: function () { return values_1.initialValues; } });
31
33
  Object.defineProperty(exports, "isEmpty", { enumerable: true, get: function () { return values_1.isEmpty; } });
32
34
  Object.defineProperty(exports, "expressionContext", { enumerable: true, get: function () { return values_1.expressionContext; } });
35
+ Object.defineProperty(exports, "lineKind", { enumerable: true, get: function () { return values_1.lineKind; } });
33
36
  var check_1 = require("./lib/record/check");
34
37
  Object.defineProperty(exports, "checkValue", { enumerable: true, get: function () { return check_1.checkValue; } });
35
38
  Object.defineProperty(exports, "formatBytes", { enumerable: true, get: function () { return check_1.formatBytes; } });
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/core/src/index.ts"],"names":[],"mappings":";;;AACA,4CAc4B;AAb1B,mGAAA,UAAU,OAAA;AACV,oGAAA,WAAW,OAAA;AACX,oGAAA,WAAW,OAAA;AACX,qGAAA,YAAY,OAAA;AACZ,wGAAA,eAAe,OAAA;AACf,qGAAA,YAAY,OAAA;AACZ,8GAAA,qBAAqB,OAAA;AAQvB,8CAwB6B;AAvB3B,wGAAA,cAAc,OAAA;AACd,0GAAA,gBAAgB,OAAA;AAChB,0GAAA,gBAAgB,OAAA;AAsBlB,0CAAyF;AAAhF,sGAAA,cAAc,OAAA;AAAE,kGAAA,UAAU,OAAA;AACnC,kDAA0F;AAAjF,wGAAA,YAAY,OAAA;AACrB,wDAA0D;AAAjD,6GAAA,cAAc,OAAA;AACvB,sDAAmF;AAA1E,2GAAA,eAAe,OAAA;AACxB,sEAAsF;AAA7E,oHAAA,gBAAgB,OAAA;AAAE,mHAAA,eAAe,OAAA;AAC1C,8CAY6B;AAX3B,oGAAA,UAAU,OAAA;AACV,uGAAA,aAAa,OAAA;AACb,iGAAA,OAAO,OAAA;A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,OAAA;AAC/B,oDAA6E;AAApE,0GAAA,aAAa,OAAA;AAAE,iGAAA,IAAI,OAAA;AAC5B,0CAS2B;AARzB,kGAAA,UAAU,OAAA;AASZ,kDAAmF;AAA1E,oGAAA,QAAQ,OAAA;AAAE,gGAAA,IAAI,OAAA"}
package/src/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
- export { FIELD_NAME, FIELD_TYPES, FieldSchema, FieldsSchema, LineFieldSchema, OptionSchema, FilterConditionSchema, } from './lib/format/field.mjs';
1
+ export { FIELD_NAME, FIELD_TYPES, FieldSchema, FieldsSchema, LineFieldSchema, LineKindsSchema, OptionSchema, PropertyDefinitionSchema, FilterConditionSchema, } from './lib/format/field.mjs';
2
2
  export { ModifierSchema, LayoutNodeSchema, RootLayoutSchema, } from './lib/format/layout.mjs';
3
3
  export { FORMAT_VERSION, PageSchema } from './lib/format/page.mjs';
4
4
  export { validatePage } from './lib/format/validate.mjs';
5
5
  export { pageJsonSchema } from './lib/format/json-schema.mjs';
6
6
  export { compileModifier } from './lib/expression/modifier.mjs';
7
7
  export { evaluateModifier, isModifierValid } from './lib/expression/evaluateModifier.mjs';
8
- export { emptyValue, initialValues, isEmpty, expressionContext, } from './lib/record/values.mjs';
8
+ export { emptyValue, initialValues, isEmpty, expressionContext, lineKind, } from './lib/record/values.mjs';
9
9
  export { checkValue, formatBytes } from './lib/record/check.mjs';
10
10
  export { createMemoryDataSource } from './lib/record/memory-data-source.mjs';
11
11
  export { hostScheduler, wait } from './lib/record/scheduler.mjs';
package/src/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../../libs/core/src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,WAAW,EACX,WAAW,EACX,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,qBAAqB,GAOtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,gBAAgB,GAqBjB,MA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BAAgB,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACtF,OAAO,EACL,UAAU,EACV,aAAa,EACb,OAAO,EACP,iBAAiB,EACjB,QAAQ,GAQT,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAiB7D,OAAO,EAAE,sBAAsB,EAAuD,MAAM,iCAAiC,CAAC;AAC9H,OAAO,EAAE,aAAa,EAAE,IAAI,EAAkB,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EACL,UAAU,GAQX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,IAAI,EAA8B,MAAM,uBAAuB,CAAC"}
@@ -40,6 +40,25 @@ export declare const FilterConditionSchema: z.ZodObject<{
40
40
  valueFrom: z.ZodOptional<z.ZodString>;
41
41
  }, z.core.$strict>;
42
42
  export type FilterCondition = z.infer<typeof FilterConditionSchema>;
43
+ /** One property of a properties field: its own small field, edited with the widget for its type. */
44
+ export declare const PropertyDefinitionSchema: z.ZodObject<{
45
+ name: z.ZodString;
46
+ label: z.ZodString;
47
+ type: z.ZodEnum<{
48
+ boolean: "boolean";
49
+ char: "char";
50
+ text: "text";
51
+ integer: "integer";
52
+ float: "float";
53
+ date: "date";
54
+ selection: "selection";
55
+ }>;
56
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
57
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
58
+ label: z.ZodString;
59
+ }, z.core.$strict>>>;
60
+ }, z.core.$strict>;
61
+ export type PropertyDefinition = z.infer<typeof PropertyDefinitionSchema>;
43
62
  /** A field of a one2many's lines. Lines cannot hold lines of their own. */
44
63
  export declare const LineFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
45
64
  size: z.ZodOptional<z.ZodInt>;
@@ -208,6 +227,23 @@ export declare const LineFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
208
227
  default: z.ZodOptional<z.ZodJSONSchema>;
209
228
  type: z.ZodLiteral<"reference">;
210
229
  }, z.core.$strict>, z.ZodObject<{
230
+ definitions: z.ZodOptional<z.ZodArray<z.ZodObject<{
231
+ name: z.ZodString;
232
+ label: z.ZodString;
233
+ type: z.ZodEnum<{
234
+ boolean: "boolean";
235
+ char: "char";
236
+ text: "text";
237
+ integer: "integer";
238
+ float: "float";
239
+ date: "date";
240
+ selection: "selection";
241
+ }>;
242
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
243
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
244
+ label: z.ZodString;
245
+ }, z.core.$strict>>>;
246
+ }, z.core.$strict>>>;
211
247
  label: z.ZodString;
212
248
  help: z.ZodOptional<z.ZodString>;
213
249
  required: z.ZodOptional<z.ZodBoolean>;
@@ -223,6 +259,18 @@ export declare const LineFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
223
259
  type: z.ZodLiteral<"json">;
224
260
  }, z.core.$strict>], "type">;
225
261
  export type LineField = z.infer<typeof LineFieldSchema>;
262
+ /**
263
+ * Lines that are not items: section headings and notes between them, told
264
+ * apart by a line field's value (a backend's `display_type`). Their text spans
265
+ * the row, and they are not asked for the fields an item needs.
266
+ */
267
+ export declare const LineKindsSchema: z.ZodObject<{
268
+ field: z.ZodString;
269
+ text: z.ZodString;
270
+ section: z.ZodOptional<z.ZodString>;
271
+ note: z.ZodOptional<z.ZodString>;
272
+ }, z.core.$strict>;
273
+ export type LineKinds = z.infer<typeof LineKindsSchema>;
226
274
  export declare const FieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
227
275
  size: z.ZodOptional<z.ZodInt>;
228
276
  pattern: z.ZodOptional<z.ZodString>;
@@ -547,6 +595,23 @@ export declare const FieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
547
595
  default: z.ZodOptional<z.ZodJSONSchema>;
548
596
  type: z.ZodLiteral<"reference">;
549
597
  }, z.core.$strict>, z.ZodObject<{
598
+ definitions: z.ZodOptional<z.ZodArray<z.ZodObject<{
599
+ name: z.ZodString;
600
+ label: z.ZodString;
601
+ type: z.ZodEnum<{
602
+ boolean: "boolean";
603
+ char: "char";
604
+ text: "text";
605
+ integer: "integer";
606
+ float: "float";
607
+ date: "date";
608
+ selection: "selection";
609
+ }>;
610
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
611
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
612
+ label: z.ZodString;
613
+ }, z.core.$strict>>>;
614
+ }, z.core.$strict>>>;
550
615
  label: z.ZodString;
551
616
  help: z.ZodOptional<z.ZodString>;
552
617
  required: z.ZodOptional<z.ZodBoolean>;
@@ -561,6 +626,13 @@ export declare const FieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
561
626
  default: z.ZodOptional<z.ZodJSONSchema>;
562
627
  type: z.ZodLiteral<"json">;
563
628
  }, z.core.$strict>], "type">>;
629
+ lineKinds: z.ZodOptional<z.ZodObject<{
630
+ field: z.ZodString;
631
+ text: z.ZodString;
632
+ section: z.ZodOptional<z.ZodString>;
633
+ note: z.ZodOptional<z.ZodString>;
634
+ }, z.core.$strict>>;
635
+ sequenceField: z.ZodOptional<z.ZodString>;
564
636
  label: z.ZodString;
565
637
  help: z.ZodOptional<z.ZodString>;
566
638
  required: z.ZodOptional<z.ZodBoolean>;
@@ -579,6 +651,23 @@ export declare const FieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
579
651
  default: z.ZodOptional<z.ZodJSONSchema>;
580
652
  type: z.ZodLiteral<"reference">;
581
653
  }, z.core.$strict>, z.ZodObject<{
654
+ definitions: z.ZodOptional<z.ZodArray<z.ZodObject<{
655
+ name: z.ZodString;
656
+ label: z.ZodString;
657
+ type: z.ZodEnum<{
658
+ boolean: "boolean";
659
+ char: "char";
660
+ text: "text";
661
+ integer: "integer";
662
+ float: "float";
663
+ date: "date";
664
+ selection: "selection";
665
+ }>;
666
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
667
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
668
+ label: z.ZodString;
669
+ }, z.core.$strict>>>;
670
+ }, z.core.$strict>>>;
582
671
  label: z.ZodString;
583
672
  help: z.ZodOptional<z.ZodString>;
584
673
  required: z.ZodOptional<z.ZodBoolean>;
@@ -918,6 +1007,23 @@ export declare const FieldsSchema: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUn
918
1007
  default: z.ZodOptional<z.ZodJSONSchema>;
919
1008
  type: z.ZodLiteral<"reference">;
920
1009
  }, z.core.$strict>, z.ZodObject<{
1010
+ definitions: z.ZodOptional<z.ZodArray<z.ZodObject<{
1011
+ name: z.ZodString;
1012
+ label: z.ZodString;
1013
+ type: z.ZodEnum<{
1014
+ boolean: "boolean";
1015
+ char: "char";
1016
+ text: "text";
1017
+ integer: "integer";
1018
+ float: "float";
1019
+ date: "date";
1020
+ selection: "selection";
1021
+ }>;
1022
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
1023
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
1024
+ label: z.ZodString;
1025
+ }, z.core.$strict>>>;
1026
+ }, z.core.$strict>>>;
921
1027
  label: z.ZodString;
922
1028
  help: z.ZodOptional<z.ZodString>;
923
1029
  required: z.ZodOptional<z.ZodBoolean>;
@@ -932,6 +1038,13 @@ export declare const FieldsSchema: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUn
932
1038
  default: z.ZodOptional<z.ZodJSONSchema>;
933
1039
  type: z.ZodLiteral<"json">;
934
1040
  }, z.core.$strict>], "type">>;
1041
+ lineKinds: z.ZodOptional<z.ZodObject<{
1042
+ field: z.ZodString;
1043
+ text: z.ZodString;
1044
+ section: z.ZodOptional<z.ZodString>;
1045
+ note: z.ZodOptional<z.ZodString>;
1046
+ }, z.core.$strict>>;
1047
+ sequenceField: z.ZodOptional<z.ZodString>;
935
1048
  label: z.ZodString;
936
1049
  help: z.ZodOptional<z.ZodString>;
937
1050
  required: z.ZodOptional<z.ZodBoolean>;
@@ -950,6 +1063,23 @@ export declare const FieldsSchema: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUn
950
1063
  default: z.ZodOptional<z.ZodJSONSchema>;
951
1064
  type: z.ZodLiteral<"reference">;
952
1065
  }, z.core.$strict>, z.ZodObject<{
1066
+ definitions: z.ZodOptional<z.ZodArray<z.ZodObject<{
1067
+ name: z.ZodString;
1068
+ label: z.ZodString;
1069
+ type: z.ZodEnum<{
1070
+ boolean: "boolean";
1071
+ char: "char";
1072
+ text: "text";
1073
+ integer: "integer";
1074
+ float: "float";
1075
+ date: "date";
1076
+ selection: "selection";
1077
+ }>;
1078
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
1079
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
1080
+ label: z.ZodString;
1081
+ }, z.core.$strict>>>;
1082
+ }, z.core.$strict>>>;
953
1083
  label: z.ZodString;
954
1084
  help: z.ZodOptional<z.ZodString>;
955
1085
  required: z.ZodOptional<z.ZodBoolean>;
@@ -40,6 +40,25 @@ export declare const FilterConditionSchema: z.ZodObject<{
40
40
  valueFrom: z.ZodOptional<z.ZodString>;
41
41
  }, z.z.core.$strict>;
42
42
  export type FilterCondition = z.infer<typeof FilterConditionSchema>;
43
+ /** One property of a properties field: its own small field, edited with the widget for its type. */
44
+ export declare const PropertyDefinitionSchema: z.ZodObject<{
45
+ name: z.ZodString;
46
+ label: z.ZodString;
47
+ type: z.ZodEnum<{
48
+ boolean: "boolean";
49
+ char: "char";
50
+ text: "text";
51
+ integer: "integer";
52
+ float: "float";
53
+ date: "date";
54
+ selection: "selection";
55
+ }>;
56
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
57
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
58
+ label: z.ZodString;
59
+ }, z.z.core.$strict>>>;
60
+ }, z.z.core.$strict>;
61
+ export type PropertyDefinition = z.infer<typeof PropertyDefinitionSchema>;
43
62
  /** A field of a one2many's lines. Lines cannot hold lines of their own. */
44
63
  export declare const LineFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
45
64
  size: z.ZodOptional<z.ZodInt>;
@@ -208,6 +227,23 @@ export declare const LineFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
208
227
  default: z.ZodOptional<z.ZodJSONSchema>;
209
228
  type: z.ZodLiteral<"reference">;
210
229
  }, z.z.core.$strict>, z.ZodObject<{
230
+ definitions: z.ZodOptional<z.ZodArray<z.ZodObject<{
231
+ name: z.ZodString;
232
+ label: z.ZodString;
233
+ type: z.ZodEnum<{
234
+ boolean: "boolean";
235
+ char: "char";
236
+ text: "text";
237
+ integer: "integer";
238
+ float: "float";
239
+ date: "date";
240
+ selection: "selection";
241
+ }>;
242
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
243
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
244
+ label: z.ZodString;
245
+ }, z.z.core.$strict>>>;
246
+ }, z.z.core.$strict>>>;
211
247
  label: z.ZodString;
212
248
  help: z.ZodOptional<z.ZodString>;
213
249
  required: z.ZodOptional<z.ZodBoolean>;
@@ -223,6 +259,18 @@ export declare const LineFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
223
259
  type: z.ZodLiteral<"json">;
224
260
  }, z.z.core.$strict>], "type">;
225
261
  export type LineField = z.infer<typeof LineFieldSchema>;
262
+ /**
263
+ * Lines that are not items: section headings and notes between them, told
264
+ * apart by a line field's value (a backend's `display_type`). Their text spans
265
+ * the row, and they are not asked for the fields an item needs.
266
+ */
267
+ export declare const LineKindsSchema: z.ZodObject<{
268
+ field: z.ZodString;
269
+ text: z.ZodString;
270
+ section: z.ZodOptional<z.ZodString>;
271
+ note: z.ZodOptional<z.ZodString>;
272
+ }, z.z.core.$strict>;
273
+ export type LineKinds = z.infer<typeof LineKindsSchema>;
226
274
  export declare const FieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
227
275
  size: z.ZodOptional<z.ZodInt>;
228
276
  pattern: z.ZodOptional<z.ZodString>;
@@ -547,6 +595,23 @@ export declare const FieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
547
595
  default: z.ZodOptional<z.ZodJSONSchema>;
548
596
  type: z.ZodLiteral<"reference">;
549
597
  }, z.z.core.$strict>, z.ZodObject<{
598
+ definitions: z.ZodOptional<z.ZodArray<z.ZodObject<{
599
+ name: z.ZodString;
600
+ label: z.ZodString;
601
+ type: z.ZodEnum<{
602
+ boolean: "boolean";
603
+ char: "char";
604
+ text: "text";
605
+ integer: "integer";
606
+ float: "float";
607
+ date: "date";
608
+ selection: "selection";
609
+ }>;
610
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
611
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
612
+ label: z.ZodString;
613
+ }, z.z.core.$strict>>>;
614
+ }, z.z.core.$strict>>>;
550
615
  label: z.ZodString;
551
616
  help: z.ZodOptional<z.ZodString>;
552
617
  required: z.ZodOptional<z.ZodBoolean>;
@@ -561,6 +626,13 @@ export declare const FieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
561
626
  default: z.ZodOptional<z.ZodJSONSchema>;
562
627
  type: z.ZodLiteral<"json">;
563
628
  }, z.z.core.$strict>], "type">>;
629
+ lineKinds: z.ZodOptional<z.ZodObject<{
630
+ field: z.ZodString;
631
+ text: z.ZodString;
632
+ section: z.ZodOptional<z.ZodString>;
633
+ note: z.ZodOptional<z.ZodString>;
634
+ }, z.z.core.$strict>>;
635
+ sequenceField: z.ZodOptional<z.ZodString>;
564
636
  label: z.ZodString;
565
637
  help: z.ZodOptional<z.ZodString>;
566
638
  required: z.ZodOptional<z.ZodBoolean>;
@@ -579,6 +651,23 @@ export declare const FieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
579
651
  default: z.ZodOptional<z.ZodJSONSchema>;
580
652
  type: z.ZodLiteral<"reference">;
581
653
  }, z.z.core.$strict>, z.ZodObject<{
654
+ definitions: z.ZodOptional<z.ZodArray<z.ZodObject<{
655
+ name: z.ZodString;
656
+ label: z.ZodString;
657
+ type: z.ZodEnum<{
658
+ boolean: "boolean";
659
+ char: "char";
660
+ text: "text";
661
+ integer: "integer";
662
+ float: "float";
663
+ date: "date";
664
+ selection: "selection";
665
+ }>;
666
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
667
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
668
+ label: z.ZodString;
669
+ }, z.z.core.$strict>>>;
670
+ }, z.z.core.$strict>>>;
582
671
  label: z.ZodString;
583
672
  help: z.ZodOptional<z.ZodString>;
584
673
  required: z.ZodOptional<z.ZodBoolean>;
@@ -918,6 +1007,23 @@ export declare const FieldsSchema: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUn
918
1007
  default: z.ZodOptional<z.ZodJSONSchema>;
919
1008
  type: z.ZodLiteral<"reference">;
920
1009
  }, z.z.core.$strict>, z.ZodObject<{
1010
+ definitions: z.ZodOptional<z.ZodArray<z.ZodObject<{
1011
+ name: z.ZodString;
1012
+ label: z.ZodString;
1013
+ type: z.ZodEnum<{
1014
+ boolean: "boolean";
1015
+ char: "char";
1016
+ text: "text";
1017
+ integer: "integer";
1018
+ float: "float";
1019
+ date: "date";
1020
+ selection: "selection";
1021
+ }>;
1022
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
1023
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
1024
+ label: z.ZodString;
1025
+ }, z.z.core.$strict>>>;
1026
+ }, z.z.core.$strict>>>;
921
1027
  label: z.ZodString;
922
1028
  help: z.ZodOptional<z.ZodString>;
923
1029
  required: z.ZodOptional<z.ZodBoolean>;
@@ -932,6 +1038,13 @@ export declare const FieldsSchema: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUn
932
1038
  default: z.ZodOptional<z.ZodJSONSchema>;
933
1039
  type: z.ZodLiteral<"json">;
934
1040
  }, z.z.core.$strict>], "type">>;
1041
+ lineKinds: z.ZodOptional<z.ZodObject<{
1042
+ field: z.ZodString;
1043
+ text: z.ZodString;
1044
+ section: z.ZodOptional<z.ZodString>;
1045
+ note: z.ZodOptional<z.ZodString>;
1046
+ }, z.z.core.$strict>>;
1047
+ sequenceField: z.ZodOptional<z.ZodString>;
935
1048
  label: z.ZodString;
936
1049
  help: z.ZodOptional<z.ZodString>;
937
1050
  required: z.ZodOptional<z.ZodBoolean>;
@@ -950,6 +1063,23 @@ export declare const FieldsSchema: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUn
950
1063
  default: z.ZodOptional<z.ZodJSONSchema>;
951
1064
  type: z.ZodLiteral<"reference">;
952
1065
  }, z.z.core.$strict>, z.ZodObject<{
1066
+ definitions: z.ZodOptional<z.ZodArray<z.ZodObject<{
1067
+ name: z.ZodString;
1068
+ label: z.ZodString;
1069
+ type: z.ZodEnum<{
1070
+ boolean: "boolean";
1071
+ char: "char";
1072
+ text: "text";
1073
+ integer: "integer";
1074
+ float: "float";
1075
+ date: "date";
1076
+ selection: "selection";
1077
+ }>;
1078
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
1079
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
1080
+ label: z.ZodString;
1081
+ }, z.z.core.$strict>>>;
1082
+ }, z.z.core.$strict>>>;
953
1083
  label: z.ZodString;
954
1084
  help: z.ZodOptional<z.ZodString>;
955
1085
  required: z.ZodOptional<z.ZodBoolean>;