@tsed/schema-formio 8.33.0 → 8.35.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/lib/esm/components/arrayToComponent.js +1 -1
- package/lib/esm/components/booleanToComponent.js +1 -1
- package/lib/esm/components/dateToComponent.js +1 -1
- package/lib/esm/components/defaultToComponent.js +1 -1
- package/lib/esm/components/enumToComponent.js +1 -1
- package/lib/esm/components/nestedToComponent.js +1 -1
- package/lib/esm/components/propertiesToComponents.js +1 -1
- package/lib/esm/components/stringToComponent.js +1 -1
- package/lib/esm/decorators/customConditional.js +1 -1
- package/lib/esm/decorators/dataSourceJson.js +1 -1
- package/lib/esm/decorators/form.js +3 -3
- package/lib/esm/decorators/inputTags.js +1 -1
- package/lib/esm/utils/getFormioSchema.js +4 -4
- package/lib/types/decorators/customConditional.d.ts +2 -3
- package/lib/types/utils/getFormioSchema.d.ts +1 -1
- package/package.json +25 -26
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { cleanObject } from "@tsed/core";
|
|
2
1
|
import { execMapper, registerFormioMapper } from "../registries/FormioMappersContainer.js";
|
|
2
|
+
import { cleanObject } from "@tsed/core";
|
|
3
3
|
import { getRef } from "../utils/getRef.js";
|
|
4
4
|
export function arrayToComponent(schema, options) {
|
|
5
5
|
const itemSchema = schema.items.$ref ? getRef(schema.items, options) : schema.items;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { cleanObject } from "@tsed/core";
|
|
2
1
|
import { execMapper, registerFormioMapper } from "../registries/FormioMappersContainer.js";
|
|
2
|
+
import { cleanObject } from "@tsed/core";
|
|
3
3
|
function booleanToComponent(schema, options) {
|
|
4
4
|
const component = execMapper("default", schema, options);
|
|
5
5
|
return cleanObject({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getValue } from "@tsed/core";
|
|
2
1
|
import { execMapper, registerFormioMapper } from "../registries/FormioMappersContainer.js";
|
|
2
|
+
import { getValue } from "@tsed/core";
|
|
3
3
|
function dateToComponent(schema, options) {
|
|
4
4
|
const component = execMapper("default", schema, options);
|
|
5
5
|
const base = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cleanObject } from "@tsed/core";
|
|
2
|
-
import { registerFormioMapper } from "../registries/FormioMappersContainer.js";
|
|
3
2
|
import { getFormioProps } from "../utils/getFormioProps.js";
|
|
3
|
+
import { registerFormioMapper } from "../registries/FormioMappersContainer.js";
|
|
4
4
|
export function defaultToComponent(schema, options) {
|
|
5
5
|
const formioProps = getFormioProps(schema);
|
|
6
6
|
return cleanObject({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { cleanObject } from "@tsed/core";
|
|
2
1
|
import { execMapper, registerFormioMapper } from "../registries/FormioMappersContainer.js";
|
|
2
|
+
import { cleanObject } from "@tsed/core";
|
|
3
3
|
export function enumToComponent(schema, options) {
|
|
4
4
|
const component = execMapper("default", schema, options);
|
|
5
5
|
const values = schema.enum.map((value) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { sentenceCase } from "change-case";
|
|
2
1
|
import { execMapper, registerFormioMapper } from "../registries/FormioMappersContainer.js";
|
|
2
|
+
import { sentenceCase } from "change-case";
|
|
3
3
|
export function nestedToComponent(schema, options) {
|
|
4
4
|
return {
|
|
5
5
|
...execMapper("default", schema, options),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cleanObject, isFunction } from "@tsed/core";
|
|
2
|
-
import { sentenceCase } from "change-case";
|
|
3
2
|
import { execMapper, registerFormioMapper } from "../registries/FormioMappersContainer.js";
|
|
3
|
+
import { sentenceCase } from "change-case";
|
|
4
4
|
function bindResolvers(component, options) {
|
|
5
5
|
if (component.data) {
|
|
6
6
|
const data = { ...component.data };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { cleanObject } from "@tsed/core";
|
|
2
1
|
import { execMapper, registerFormioMapper } from "../registries/FormioMappersContainer.js";
|
|
2
|
+
import { cleanObject } from "@tsed/core";
|
|
3
3
|
export function stringToComponent(schema, options) {
|
|
4
4
|
if (schema.format) {
|
|
5
5
|
const component = execMapper("default", schema, options);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Name } from "@tsed/schema";
|
|
3
|
-
import { kebabCase } from "change-case";
|
|
1
|
+
import { StoreSet, nameOf, useDecorators } from "@tsed/core";
|
|
4
2
|
import { FormsContainer } from "../registries/FormsContainer.js";
|
|
5
3
|
import { Label } from "./label.js";
|
|
4
|
+
import { Name } from "@tsed/schema";
|
|
5
|
+
import { kebabCase } from "change-case";
|
|
6
6
|
/**
|
|
7
7
|
* Expose the model as Formio Form.
|
|
8
8
|
* @param form
|
|
@@ -11,11 +11,11 @@ import "../components/objectToEditGrid.js";
|
|
|
11
11
|
import "../components/panelToComponent.js";
|
|
12
12
|
import "../components/propertiesToComponents.js";
|
|
13
13
|
import "../components/stringToComponent.js";
|
|
14
|
+
import { compile, s } from "@tsed/schema";
|
|
14
15
|
import { isString } from "@tsed/core";
|
|
15
|
-
import { compile, JsonEntityStore } from "@tsed/schema";
|
|
16
|
-
import { kebabCase } from "change-case";
|
|
17
|
-
import { execMapper } from "../registries/FormioMappersContainer.js";
|
|
18
16
|
import { FormsContainer } from "../registries/FormsContainer.js";
|
|
17
|
+
import { execMapper } from "../registries/FormioMappersContainer.js";
|
|
18
|
+
import { kebabCase } from "change-case";
|
|
19
19
|
export async function getFormioSchema(model, options = {}) {
|
|
20
20
|
if (!model) {
|
|
21
21
|
return undefined;
|
|
@@ -23,7 +23,7 @@ export async function getFormioSchema(model, options = {}) {
|
|
|
23
23
|
if (isString(model)) {
|
|
24
24
|
return getFormioSchema(FormsContainer.get(model), options);
|
|
25
25
|
}
|
|
26
|
-
const entity =
|
|
26
|
+
const entity = s.store(model);
|
|
27
27
|
const schema = compile(model, {
|
|
28
28
|
...options,
|
|
29
29
|
inlineEnums: true,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { FormioComponent, FormioForm, FormioSubmission } from "@tsed/formio-types";
|
|
2
|
-
import type { Utils } from "formiojs";
|
|
3
2
|
import type { LoDashStatic } from "lodash";
|
|
4
3
|
import type { Moment } from "moment";
|
|
5
4
|
export interface CustomConditionalCtx<Value = any, Data = any, Row = any> {
|
|
@@ -42,11 +41,11 @@ export interface CustomConditionalCtx<Value = any, Data = any, Row = any> {
|
|
|
42
41
|
/**
|
|
43
42
|
* An instance of the FormioUtils object.
|
|
44
43
|
*/
|
|
45
|
-
utils: typeof Utils;
|
|
44
|
+
utils: typeof import("@formio/js/utils").Utils;
|
|
46
45
|
/**
|
|
47
46
|
* An alias for "utils".
|
|
48
47
|
*/
|
|
49
|
-
util: typeof Utils;
|
|
48
|
+
util: typeof import("@formio/js/utils").Utils;
|
|
50
49
|
}
|
|
51
50
|
/**
|
|
52
51
|
* Adds custom conditional rule to display or not the input form.
|
|
@@ -11,6 +11,6 @@ import "../components/objectToEditGrid.js";
|
|
|
11
11
|
import "../components/panelToComponent.js";
|
|
12
12
|
import "../components/propertiesToComponents.js";
|
|
13
13
|
import "../components/stringToComponent.js";
|
|
14
|
-
import { FormioForm } from "@tsed/formio-types";
|
|
15
14
|
import { JsonSchemaOptions } from "@tsed/schema";
|
|
15
|
+
import { FormioForm } from "@tsed/formio-types";
|
|
16
16
|
export declare function getFormioSchema(model: string | any | undefined, options?: JsonSchemaOptions): Promise<Omit<FormioForm, "_id" | "deleted" | "owner"> | undefined>;
|
package/package.json
CHANGED
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/schema-formio",
|
|
3
|
+
"version": "8.35.0",
|
|
3
4
|
"description": "Transform Ts.ED Schema & JsonSchema to a valid Formio schema",
|
|
4
|
-
"
|
|
5
|
-
|
|
5
|
+
"keywords": [
|
|
6
|
+
"JsonSchema",
|
|
7
|
+
"TypeScript",
|
|
8
|
+
"class",
|
|
9
|
+
"classes",
|
|
10
|
+
"decorators",
|
|
11
|
+
"formio",
|
|
12
|
+
"json",
|
|
13
|
+
"models",
|
|
14
|
+
"schema",
|
|
15
|
+
"tsed"
|
|
16
|
+
],
|
|
6
17
|
"source": "./src/index.ts",
|
|
18
|
+
"type": "module",
|
|
7
19
|
"main": "./lib/esm/index.js",
|
|
8
20
|
"module": "./lib/esm/index.js",
|
|
9
|
-
"typings": "./lib/types/index.d.ts",
|
|
10
21
|
"browser": "./lib/esm/index.js",
|
|
22
|
+
"typings": "./lib/types/index.d.ts",
|
|
11
23
|
"exports": {
|
|
12
24
|
".": {
|
|
13
25
|
"tsed-source": "./src/index.ts",
|
|
@@ -25,43 +37,33 @@
|
|
|
25
37
|
"build:ts": "tsc --build tsconfig.esm.json",
|
|
26
38
|
"test:ci": "vitest run --coverage.thresholds.autoUpdate=true"
|
|
27
39
|
},
|
|
28
|
-
"keywords": [
|
|
29
|
-
"TypeScript",
|
|
30
|
-
"decorators",
|
|
31
|
-
"models",
|
|
32
|
-
"json",
|
|
33
|
-
"schema",
|
|
34
|
-
"JsonSchema",
|
|
35
|
-
"formio",
|
|
36
|
-
"class",
|
|
37
|
-
"classes",
|
|
38
|
-
"tsed"
|
|
39
|
-
],
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@tsed/formio-types": "8.
|
|
41
|
+
"@tsed/formio-types": "8.35.0",
|
|
42
42
|
"change-case": "^5.4.4",
|
|
43
43
|
"tslib": ">=2.7.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@tsed/barrels": "8.
|
|
47
|
-
"@tsed/core": "8.
|
|
48
|
-
"@tsed/openspec": "8.
|
|
49
|
-
"@tsed/schema": "8.
|
|
50
|
-
"@tsed/typescript": "8.
|
|
51
|
-
"eslint": "9.12.0",
|
|
46
|
+
"@tsed/barrels": "8.35.0",
|
|
47
|
+
"@tsed/core": "8.35.0",
|
|
48
|
+
"@tsed/openspec": "8.35.0",
|
|
49
|
+
"@tsed/schema": "8.35.0",
|
|
50
|
+
"@tsed/typescript": "8.35.0",
|
|
52
51
|
"typescript": "6.0.2",
|
|
53
52
|
"vite": "7.3.2",
|
|
54
53
|
"vitest": "4.1.4"
|
|
55
54
|
},
|
|
56
55
|
"peerDependencies": {
|
|
56
|
+
"@formio/js": ">=5.0.0",
|
|
57
57
|
"@tsed/core": ">=8.0.0",
|
|
58
58
|
"@tsed/openspec": ">=8.0.0",
|
|
59
59
|
"@tsed/schema": ">=8.0.0",
|
|
60
|
-
"formiojs": ">=4.0.0",
|
|
61
60
|
"lodash": ">=4.0.0",
|
|
62
61
|
"moment": ">=2.0.0"
|
|
63
62
|
},
|
|
64
63
|
"peerDependenciesMeta": {
|
|
64
|
+
"@formio/js": {
|
|
65
|
+
"optional": false
|
|
66
|
+
},
|
|
65
67
|
"@tsed/core": {
|
|
66
68
|
"optional": false
|
|
67
69
|
},
|
|
@@ -71,9 +73,6 @@
|
|
|
71
73
|
"@tsed/schema": {
|
|
72
74
|
"optional": false
|
|
73
75
|
},
|
|
74
|
-
"formiojs": {
|
|
75
|
-
"optional": false
|
|
76
|
-
},
|
|
77
76
|
"lodash": {
|
|
78
77
|
"optional": false
|
|
79
78
|
},
|