@stonecrop/stonecrop 0.11.8 → 0.11.9
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/src/registry.d.ts.map +1 -1
- package/dist/src/registry.js +6 -2
- package/dist/src/types/doctype.d.ts +2 -2
- package/dist/src/types/doctype.d.ts.map +1 -1
- package/dist/stonecrop.d.ts +2 -1
- package/dist/stonecrop.js +6 -1
- package/dist/stonecrop.js.map +1 -1
- package/package.json +4 -4
- package/src/registry.ts +8 -3
- package/src/types/doctype.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAe,MAAM,kBAAkB,CAAA;AAChE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAe,MAAM,kBAAkB,CAAA;AAChE,OAAO,KAAK,EAAa,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAEnC,OAAO,OAAO,MAAM,WAAW,CAAA;AAE/B,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE/C;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,QAAQ;IAC5B;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAA;IAEtB;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAa;IAElC;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAK;IAE/C;;;;;;;OAOG;IACH,OAAO,CAAC,cAAc,CAAqE;IAE3F;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB,CAAgB;IAE3C;;;OAGG;IACH,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Link') {
|
|
140
140
|
const link = linksByFieldname.get(field.fieldname);
|
|
141
141
|
if (!link) {
|
|
142
|
-
|
|
143
|
-
resolvedFields.push({
|
|
142
|
+
const doctype = typeof field.options === 'string' ? field.options : undefined;
|
|
143
|
+
resolvedFields.push({
|
|
144
|
+
...field,
|
|
145
|
+
component: 'AFormLink',
|
|
146
|
+
...(doctype !== undefined ? { doctype } : {}),
|
|
147
|
+
});
|
|
144
148
|
continue;
|
|
145
149
|
}
|
|
146
150
|
const targetDoctype = this.registry[link.target];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SchemaTypes } from '@stonecrop/aform';
|
|
2
|
-
import type { LinkDeclaration, WorkflowMeta } from '@stonecrop/schema';
|
|
2
|
+
import type { FieldMeta, LinkDeclaration, WorkflowMeta } from '@stonecrop/schema';
|
|
3
3
|
import { List, Map } from 'immutable';
|
|
4
4
|
import type { AnyStateNodeConfig, UnknownMachineConfig } from 'xstate';
|
|
5
5
|
/**
|
|
@@ -43,7 +43,7 @@ export type DoctypeConfig = {
|
|
|
43
43
|
/** Database table name */
|
|
44
44
|
tableName?: string;
|
|
45
45
|
/** Field definitions (including link fields with fieldtype: 'Link') */
|
|
46
|
-
fields?: SchemaTypes[];
|
|
46
|
+
fields?: (SchemaTypes | FieldMeta)[];
|
|
47
47
|
/** Relationship links to other doctypes */
|
|
48
48
|
links?: Record<string, LinkDeclaration>;
|
|
49
49
|
/** Workflow configuration (XState format or simple WorkflowMeta) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctype.d.ts","sourceRoot":"","sources":["../../../src/types/doctype.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"doctype.d.ts","sourceRoot":"","sources":["../../../src/types/doctype.ts"],"names":[],"mappings":"AAAA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AClB,uEAAuE;IACvE,MAAM,CAAC,EAAE,CAAC,WAAW,GAAG,SAAS,CAAC,EAAE,CAAA;IACpC,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;IACvC,oEAAoE;IACpE,QAAQ,CAAC,EAAE,oBAAoB,GAAG,YAAY,CAAA;IAC9C,uCAAuC;IACvC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;IAClC,uCAAuC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA"}
|
package/dist/stonecrop.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { AnyStateNodeConfig } from 'xstate';
|
|
|
2
2
|
import { Component } from 'vue';
|
|
3
3
|
import { ComputedRef } from 'vue';
|
|
4
4
|
import type { DataClient } from '@stonecrop/schema';
|
|
5
|
+
import type { FieldMeta } from '@stonecrop/schema';
|
|
5
6
|
import type { LinkDeclaration } from '@stonecrop/schema';
|
|
6
7
|
import { List } from 'immutable';
|
|
7
8
|
import { Map as Map_2 } from 'immutable';
|
|
@@ -320,7 +321,7 @@ export declare type DoctypeConfig = {
|
|
|
320
321
|
/** Database table name */
|
|
321
322
|
tableName?: string;
|
|
322
323
|
/** Field definitions (including link fields with fieldtype: 'Link') */
|
|
323
|
-
fields?: SchemaTypes[];
|
|
324
|
+
fields?: (SchemaTypes | FieldMeta)[];
|
|
324
325
|
/** Relationship links to other doctypes */
|
|
325
326
|
links?: Record<string, LinkDeclaration>;
|
|
326
327
|
/** Workflow configuration (XState format or simple WorkflowMeta) */
|
package/dist/stonecrop.js
CHANGED
|
@@ -5565,7 +5565,12 @@ class me {
|
|
|
5565
5565
|
if ("fieldtype" in u && u.fieldtype === "Link") {
|
|
5566
5566
|
const c = s.get(u.fieldname);
|
|
5567
5567
|
if (!c) {
|
|
5568
|
-
|
|
5568
|
+
const S = typeof u.options == "string" ? u.options : void 0;
|
|
5569
|
+
a.push({
|
|
5570
|
+
...u,
|
|
5571
|
+
component: "AFormLink",
|
|
5572
|
+
...S !== void 0 ? { doctype: S } : {}
|
|
5573
|
+
});
|
|
5569
5574
|
continue;
|
|
5570
5575
|
}
|
|
5571
5576
|
const f = this.registry[c.target];
|