@tsed/schema-formio 7.83.3 → 8.0.0-alpha.10
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/browser/schema-formio.umd.min.js +1 -1
- package/lib/browser/schema-formio.umd.min.js.map +1 -1
- package/lib/esm/components/anyToComponent.js.map +1 -1
- package/lib/esm/components/arrayToComponent.js.map +1 -1
- package/lib/esm/components/booleanToComponent.js.map +1 -1
- package/lib/esm/components/dateToComponent.js.map +1 -1
- package/lib/esm/components/defaultToComponent.js.map +1 -1
- package/lib/esm/components/enumToComponent.js.map +1 -1
- package/lib/esm/components/nestedToComponent.js.map +1 -1
- package/lib/esm/components/numberToComponent.js.map +1 -1
- package/lib/esm/components/propertiesToComponents.js.map +1 -1
- package/lib/esm/components/stringToComponent.js.map +1 -1
- package/lib/esm/decorators/component.js.map +1 -1
- package/lib/esm/decorators/customConditional.js +1 -1
- package/lib/esm/decorators/customConditional.js.map +1 -1
- package/lib/esm/decorators/dataSourceJson.js +1 -1
- package/lib/esm/decorators/dataSourceJson.js.map +1 -1
- package/lib/esm/decorators/dataSourceUrl.js.map +1 -1
- package/lib/esm/decorators/form.js +2 -2
- package/lib/esm/decorators/form.js.map +1 -1
- package/lib/esm/decorators/inputTags.js.map +1 -1
- package/lib/esm/decorators/label.js.map +1 -1
- package/lib/esm/registries/FormioMappersContainer.js.map +1 -1
- package/lib/esm/utils/getFormioProps.js.map +1 -1
- package/lib/esm/utils/getFormioSchema.js +6 -6
- package/lib/esm/utils/getFormioSchema.js.map +1 -1
- package/lib/esm/utils/getRef.js.map +1 -1
- package/lib/types/decorators/customConditional.d.ts +2 -2
- package/lib/types/utils/getFormioSchema.d.ts +14 -14
- package/package.json +22 -20
- package/vitest.config.mts +5 -5
- package/lib/cjs/components/anyToComponent.js +0 -28
- package/lib/cjs/components/anyToComponent.js.map +0 -1
- package/lib/cjs/components/arrayToComponent.js +0 -40
- package/lib/cjs/components/arrayToComponent.js.map +0 -1
- package/lib/cjs/components/booleanToComponent.js +0 -14
- package/lib/cjs/components/booleanToComponent.js.map +0 -1
- package/lib/cjs/components/dateToComponent.js +0 -63
- package/lib/cjs/components/dateToComponent.js.map +0 -1
- package/lib/cjs/components/defaultToComponent.js +0 -18
- package/lib/cjs/components/defaultToComponent.js.map +0 -1
- package/lib/cjs/components/enumToComponent.js +0 -33
- package/lib/cjs/components/enumToComponent.js.map +0 -1
- package/lib/cjs/components/mapToComponent.js +0 -20
- package/lib/cjs/components/mapToComponent.js.map +0 -1
- package/lib/cjs/components/nestedToComponent.js +0 -25
- package/lib/cjs/components/nestedToComponent.js.map +0 -1
- package/lib/cjs/components/numberToComponent.js +0 -21
- package/lib/cjs/components/numberToComponent.js.map +0 -1
- package/lib/cjs/components/objectToEditGrid.js +0 -16
- package/lib/cjs/components/objectToEditGrid.js.map +0 -1
- package/lib/cjs/components/panelToComponent.js +0 -16
- package/lib/cjs/components/panelToComponent.js.map +0 -1
- package/lib/cjs/components/propertiesToComponents.js +0 -93
- package/lib/cjs/components/propertiesToComponents.js.map +0 -1
- package/lib/cjs/components/stringToComponent.js +0 -43
- package/lib/cjs/components/stringToComponent.js.map +0 -1
- package/lib/cjs/decorators/component.js +0 -35
- package/lib/cjs/decorators/component.js.map +0 -1
- package/lib/cjs/decorators/conditional.js +0 -53
- package/lib/cjs/decorators/conditional.js.map +0 -1
- package/lib/cjs/decorators/currency.js +0 -24
- package/lib/cjs/decorators/currency.js.map +0 -1
- package/lib/cjs/decorators/customClass.js +0 -18
- package/lib/cjs/decorators/customClass.js.map +0 -1
- package/lib/cjs/decorators/customConditional.js +0 -32
- package/lib/cjs/decorators/customConditional.js.map +0 -1
- package/lib/cjs/decorators/dataSourceJson.js +0 -27
- package/lib/cjs/decorators/dataSourceJson.js.map +0 -1
- package/lib/cjs/decorators/dataSourceUrl.js +0 -22
- package/lib/cjs/decorators/dataSourceUrl.js.map +0 -1
- package/lib/cjs/decorators/errorLabel.js +0 -18
- package/lib/cjs/decorators/errorLabel.js.map +0 -1
- package/lib/cjs/decorators/errorMessage.js +0 -17
- package/lib/cjs/decorators/errorMessage.js.map +0 -1
- package/lib/cjs/decorators/form.js +0 -22
- package/lib/cjs/decorators/form.js.map +0 -1
- package/lib/cjs/decorators/hidden.js +0 -22
- package/lib/cjs/decorators/hidden.js.map +0 -1
- package/lib/cjs/decorators/inputTags.js +0 -23
- package/lib/cjs/decorators/inputTags.js.map +0 -1
- package/lib/cjs/decorators/label.js +0 -24
- package/lib/cjs/decorators/label.js.map +0 -1
- package/lib/cjs/decorators/mask.js +0 -50
- package/lib/cjs/decorators/mask.js.map +0 -1
- package/lib/cjs/decorators/maxWords.js +0 -17
- package/lib/cjs/decorators/maxWords.js.map +0 -1
- package/lib/cjs/decorators/minWords.js +0 -17
- package/lib/cjs/decorators/minWords.js.map +0 -1
- package/lib/cjs/decorators/modalEdit.js +0 -18
- package/lib/cjs/decorators/modalEdit.js.map +0 -1
- package/lib/cjs/decorators/multiple.js +0 -18
- package/lib/cjs/decorators/multiple.js.map +0 -1
- package/lib/cjs/decorators/openWhenEmpty.js +0 -18
- package/lib/cjs/decorators/openWhenEmpty.js.map +0 -1
- package/lib/cjs/decorators/password.js +0 -20
- package/lib/cjs/decorators/password.js.map +0 -1
- package/lib/cjs/decorators/placeholder.js +0 -19
- package/lib/cjs/decorators/placeholder.js.map +0 -1
- package/lib/cjs/decorators/prefix.js +0 -18
- package/lib/cjs/decorators/prefix.js.map +0 -1
- package/lib/cjs/decorators/select.js +0 -22
- package/lib/cjs/decorators/select.js.map +0 -1
- package/lib/cjs/decorators/suffix.js +0 -18
- package/lib/cjs/decorators/suffix.js.map +0 -1
- package/lib/cjs/decorators/tableView.js +0 -19
- package/lib/cjs/decorators/tableView.js.map +0 -1
- package/lib/cjs/decorators/tabs.js +0 -22
- package/lib/cjs/decorators/tabs.js.map +0 -1
- package/lib/cjs/decorators/textCase.js +0 -19
- package/lib/cjs/decorators/textCase.js.map +0 -1
- package/lib/cjs/decorators/textarea.js +0 -20
- package/lib/cjs/decorators/textarea.js.map +0 -1
- package/lib/cjs/decorators/tooltip.js +0 -19
- package/lib/cjs/decorators/tooltip.js.map +0 -1
- package/lib/cjs/decorators/validate.js +0 -22
- package/lib/cjs/decorators/validate.js.map +0 -1
- package/lib/cjs/domain/FormioDataResolver.js +0 -3
- package/lib/cjs/domain/FormioDataResolver.js.map +0 -1
- package/lib/cjs/index.js +0 -56
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/package.json +0 -3
- package/lib/cjs/registries/FormioMappersContainer.js +0 -21
- package/lib/cjs/registries/FormioMappersContainer.js.map +0 -1
- package/lib/cjs/registries/FormsContainer.js +0 -6
- package/lib/cjs/registries/FormsContainer.js.map +0 -1
- package/lib/cjs/utils/getFormioProps.js +0 -17
- package/lib/cjs/utils/getFormioProps.js.map +0 -1
- package/lib/cjs/utils/getFormioSchema.js +0 -54
- package/lib/cjs/utils/getFormioSchema.js.map +0 -1
- package/lib/cjs/utils/getRef.js +0 -12
- package/lib/cjs/utils/getRef.js.map +0 -1
- package/lib/esm/package.json +0 -3
- package/lib/types-esm/components/anyToComponent.d.ts +0 -1
- package/lib/types-esm/components/arrayToComponent.d.ts +0 -1
- package/lib/types-esm/components/booleanToComponent.d.ts +0 -1
- package/lib/types-esm/components/dateToComponent.d.ts +0 -1
- package/lib/types-esm/components/defaultToComponent.d.ts +0 -1
- package/lib/types-esm/components/enumToComponent.d.ts +0 -1
- package/lib/types-esm/components/mapToComponent.d.ts +0 -1
- package/lib/types-esm/components/nestedToComponent.d.ts +0 -1
- package/lib/types-esm/components/numberToComponent.d.ts +0 -1
- package/lib/types-esm/components/objectToEditGrid.d.ts +0 -1
- package/lib/types-esm/components/panelToComponent.d.ts +0 -1
- package/lib/types-esm/components/propertiesToComponents.d.ts +0 -1
- package/lib/types-esm/components/stringToComponent.d.ts +0 -1
- package/lib/types-esm/decorators/component.d.ts +0 -8
- package/lib/types-esm/decorators/conditional.d.ts +0 -33
- package/lib/types-esm/decorators/currency.d.ts +0 -8
- package/lib/types-esm/decorators/customClass.d.ts +0 -8
- package/lib/types-esm/decorators/customConditional.d.ts +0 -59
- package/lib/types-esm/decorators/dataSourceJson.d.ts +0 -8
- package/lib/types-esm/decorators/dataSourceUrl.d.ts +0 -8
- package/lib/types-esm/decorators/errorLabel.d.ts +0 -8
- package/lib/types-esm/decorators/errorMessage.d.ts +0 -9
- package/lib/types-esm/decorators/form.d.ts +0 -6
- package/lib/types-esm/decorators/hidden.d.ts +0 -12
- package/lib/types-esm/decorators/inputTags.d.ts +0 -8
- package/lib/types-esm/decorators/label.d.ts +0 -9
- package/lib/types-esm/decorators/mask.d.ts +0 -37
- package/lib/types-esm/decorators/maxWords.d.ts +0 -9
- package/lib/types-esm/decorators/minWords.d.ts +0 -9
- package/lib/types-esm/decorators/modalEdit.d.ts +0 -8
- package/lib/types-esm/decorators/multiple.d.ts +0 -8
- package/lib/types-esm/decorators/openWhenEmpty.d.ts +0 -8
- package/lib/types-esm/decorators/password.d.ts +0 -12
- package/lib/types-esm/decorators/placeholder.d.ts +0 -9
- package/lib/types-esm/decorators/prefix.d.ts +0 -8
- package/lib/types-esm/decorators/select.d.ts +0 -14
- package/lib/types-esm/decorators/suffix.d.ts +0 -8
- package/lib/types-esm/decorators/tableView.d.ts +0 -9
- package/lib/types-esm/decorators/tabs.d.ts +0 -8
- package/lib/types-esm/decorators/textCase.d.ts +0 -9
- package/lib/types-esm/decorators/textarea.d.ts +0 -12
- package/lib/types-esm/decorators/tooltip.d.ts +0 -9
- package/lib/types-esm/decorators/validate.d.ts +0 -10
- package/lib/types-esm/domain/FormioDataResolver.d.ts +0 -7
- package/lib/types-esm/index.d.ts +0 -52
- package/lib/types-esm/registries/FormioMappersContainer.d.ts +0 -6
- package/lib/types-esm/registries/FormsContainer.d.ts +0 -2
- package/lib/types-esm/utils/getFormioProps.d.ts +0 -1
- package/lib/types-esm/utils/getFormioSchema.d.ts +0 -16
- package/lib/types-esm/utils/getRef.d.ts +0 -1
- /package/{webpack.config.js → webpack.config.cjs} +0 -0
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.numberToComponent = void 0;
|
|
4
|
-
const core_1 = require("@tsed/core");
|
|
5
|
-
const FormioMappersContainer_js_1 = require("../registries/FormioMappersContainer.js");
|
|
6
|
-
function numberToComponent(schema, options) {
|
|
7
|
-
const component = (0, FormioMappersContainer_js_1.execMapper)("default", schema, options);
|
|
8
|
-
return (0, core_1.cleanObject)({
|
|
9
|
-
...component,
|
|
10
|
-
input: true,
|
|
11
|
-
delimiter: (0, core_1.getValue)(component, "delimiter", false),
|
|
12
|
-
inputFormat: (0, core_1.getValue)(component, "inputFormat", "plain"),
|
|
13
|
-
mask: (0, core_1.getValue)(component, "mask", false),
|
|
14
|
-
requireDecimal: false,
|
|
15
|
-
type: "number"
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
exports.numberToComponent = numberToComponent;
|
|
19
|
-
(0, FormioMappersContainer_js_1.registerFormioMapper)("number", numberToComponent);
|
|
20
|
-
(0, FormioMappersContainer_js_1.registerFormioMapper)("integer", numberToComponent);
|
|
21
|
-
//# sourceMappingURL=numberToComponent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"numberToComponent.js","sourceRoot":"","sources":["../../../src/components/numberToComponent.ts"],"names":[],"mappings":";;;AAAA,qCAAiD;AACjD,uFAAyF;AAEzF,SAAgB,iBAAiB,CAAC,MAAW,EAAE,OAAY;IACzD,MAAM,SAAS,GAAG,IAAA,sCAAU,EAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAEzD,OAAO,IAAA,kBAAW,EAAC;QACjB,GAAG,SAAS;QACZ,KAAK,EAAE,IAAI;QACX,SAAS,EAAE,IAAA,eAAQ,EAAC,SAAS,EAAE,WAAW,EAAE,KAAK,CAAC;QAClD,WAAW,EAAE,IAAA,eAAQ,EAAC,SAAS,EAAE,aAAa,EAAE,OAAO,CAAC;QACxD,IAAI,EAAE,IAAA,eAAQ,EAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC;QACxC,cAAc,EAAE,KAAK;QACrB,IAAI,EAAE,QAAQ;KACf,CAAC,CAAC;AACL,CAAC;AAZD,8CAYC;AAED,IAAA,gDAAoB,EAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;AAClD,IAAA,gDAAoB,EAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.objectToEditGrid = void 0;
|
|
4
|
-
const FormioMappersContainer_js_1 = require("../registries/FormioMappersContainer.js");
|
|
5
|
-
function objectToEditGrid(schema, options) {
|
|
6
|
-
return {
|
|
7
|
-
...(0, FormioMappersContainer_js_1.execMapper)("default", schema, options),
|
|
8
|
-
rowDrafts: false,
|
|
9
|
-
type: "editgrid",
|
|
10
|
-
input: true,
|
|
11
|
-
components: (0, FormioMappersContainer_js_1.execMapper)("properties", schema, options)
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
exports.objectToEditGrid = objectToEditGrid;
|
|
15
|
-
(0, FormioMappersContainer_js_1.registerFormioMapper)("editgrid", objectToEditGrid);
|
|
16
|
-
//# sourceMappingURL=objectToEditGrid.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"objectToEditGrid.js","sourceRoot":"","sources":["../../../src/components/objectToEditGrid.ts"],"names":[],"mappings":";;;AAAA,uFAAyF;AAEzF,SAAgB,gBAAgB,CAAC,MAAW,EAAE,OAAY;IACxD,OAAO;QACL,GAAG,IAAA,sCAAU,EAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC;QACzC,SAAS,EAAE,KAAK;QAChB,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,IAAI;QACX,UAAU,EAAE,IAAA,sCAAU,EAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC;KACtD,CAAC;AACJ,CAAC;AARD,4CAQC;AAED,IAAA,gDAAoB,EAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.panelToComponent = void 0;
|
|
4
|
-
const FormioMappersContainer_js_1 = require("../registries/FormioMappersContainer.js");
|
|
5
|
-
function panelToComponent(schema, options) {
|
|
6
|
-
return {
|
|
7
|
-
...(0, FormioMappersContainer_js_1.execMapper)("default", schema, options),
|
|
8
|
-
collapsible: false,
|
|
9
|
-
input: false,
|
|
10
|
-
tableView: false,
|
|
11
|
-
components: (0, FormioMappersContainer_js_1.execMapper)("properties", schema, options)
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
exports.panelToComponent = panelToComponent;
|
|
15
|
-
(0, FormioMappersContainer_js_1.registerFormioMapper)("panel", panelToComponent);
|
|
16
|
-
//# sourceMappingURL=panelToComponent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"panelToComponent.js","sourceRoot":"","sources":["../../../src/components/panelToComponent.ts"],"names":[],"mappings":";;;AAAA,uFAAyF;AAEzF,SAAgB,gBAAgB,CAAC,MAAW,EAAE,OAAY;IACxD,OAAO;QACL,GAAG,IAAA,sCAAU,EAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC;QACzC,WAAW,EAAE,KAAK;QAClB,KAAK,EAAE,KAAK;QACZ,SAAS,EAAE,KAAK;QAChB,UAAU,EAAE,IAAA,sCAAU,EAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC;KACtD,CAAC;AACJ,CAAC;AARD,4CAQC;AAED,IAAA,gDAAoB,EAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC"}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.propertiesToComponents = void 0;
|
|
4
|
-
const core_1 = require("@tsed/core");
|
|
5
|
-
const change_case_1 = require("change-case");
|
|
6
|
-
const FormioMappersContainer_js_1 = require("../registries/FormioMappersContainer.js");
|
|
7
|
-
function bindResolvers(component, options) {
|
|
8
|
-
if (component.data) {
|
|
9
|
-
const data = { ...component.data };
|
|
10
|
-
Object.entries(data).forEach(([key, resolver]) => {
|
|
11
|
-
if ((0, core_1.isFunction)(resolver)) {
|
|
12
|
-
options.resolvers.push(async (form) => {
|
|
13
|
-
data[key] = await resolver({ ...options, component, form });
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
return {
|
|
18
|
-
...component,
|
|
19
|
-
data
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
return component;
|
|
23
|
-
}
|
|
24
|
-
function mapValidation(key, base, schema, propSchema) {
|
|
25
|
-
const required = (schema.required || []).includes(key);
|
|
26
|
-
const validate = {
|
|
27
|
-
...(base.validate || {}),
|
|
28
|
-
required,
|
|
29
|
-
pattern: propSchema.pattern,
|
|
30
|
-
minLength: !required || (required && propSchema.minLength > 1) ? propSchema.minLength : undefined,
|
|
31
|
-
maxLength: propSchema.maxLength,
|
|
32
|
-
min: propSchema.minimum || propSchema.minItems,
|
|
33
|
-
max: propSchema.maximum || propSchema.maxItems
|
|
34
|
-
};
|
|
35
|
-
switch (propSchema.type) {
|
|
36
|
-
case "string":
|
|
37
|
-
if (propSchema.minLength === 0 && validate.required) {
|
|
38
|
-
validate.minLength = undefined;
|
|
39
|
-
validate.required = false;
|
|
40
|
-
}
|
|
41
|
-
break;
|
|
42
|
-
case "boolean":
|
|
43
|
-
validate.required = false;
|
|
44
|
-
break;
|
|
45
|
-
}
|
|
46
|
-
return (0, core_1.cleanObject)(validate);
|
|
47
|
-
}
|
|
48
|
-
function propertiesToComponents(schema, options) {
|
|
49
|
-
const tabs = {
|
|
50
|
-
label: "Tabs",
|
|
51
|
-
key: "tabs",
|
|
52
|
-
type: "tabs",
|
|
53
|
-
input: false,
|
|
54
|
-
tableView: false,
|
|
55
|
-
components: new Map(),
|
|
56
|
-
pushed: false
|
|
57
|
-
};
|
|
58
|
-
const components = [];
|
|
59
|
-
Object.entries(schema.properties).forEach(([key, propSchema]) => {
|
|
60
|
-
const tabsOptions = propSchema["x-formiotabs"];
|
|
61
|
-
const base = (0, FormioMappersContainer_js_1.execMapper)("any", propSchema, { ...options, parentKey: key });
|
|
62
|
-
let component = (0, core_1.cleanObject)({
|
|
63
|
-
key,
|
|
64
|
-
...base,
|
|
65
|
-
label: base.label == false ? undefined : base.label || propSchema.title || (0, change_case_1.sentenceCase)(key),
|
|
66
|
-
validate: mapValidation(key, base, schema, propSchema)
|
|
67
|
-
});
|
|
68
|
-
component = bindResolvers(component, options);
|
|
69
|
-
if (tabsOptions) {
|
|
70
|
-
if (!tabs.pushed) {
|
|
71
|
-
components.push(tabs);
|
|
72
|
-
tabs.pushed = true;
|
|
73
|
-
}
|
|
74
|
-
if (!tabs.components.has(tabsOptions.key)) {
|
|
75
|
-
tabs.components.set(tabsOptions.key, {
|
|
76
|
-
...tabsOptions,
|
|
77
|
-
components: []
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
tabs.components.get(tabsOptions.key).components.push(component);
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
components.push(component);
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
if (tabs.components.size) {
|
|
87
|
-
tabs.components = [...tabs.components.values()];
|
|
88
|
-
}
|
|
89
|
-
return components;
|
|
90
|
-
}
|
|
91
|
-
exports.propertiesToComponents = propertiesToComponents;
|
|
92
|
-
(0, FormioMappersContainer_js_1.registerFormioMapper)("properties", propertiesToComponents);
|
|
93
|
-
//# sourceMappingURL=propertiesToComponents.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prop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});
|
|
3
|
-
exports.stringToComponent = void 0;
|
|
4
|
-
const core_1 = require("@tsed/core");
|
|
5
|
-
const FormioMappersContainer_js_1 = require("../registries/FormioMappersContainer.js");
|
|
6
|
-
function stringToComponent(schema, options) {
|
|
7
|
-
if (schema.format) {
|
|
8
|
-
const component = (0, FormioMappersContainer_js_1.execMapper)("default", schema, options);
|
|
9
|
-
switch (schema.format) {
|
|
10
|
-
case "date":
|
|
11
|
-
case "date-time":
|
|
12
|
-
return (0, FormioMappersContainer_js_1.execMapper)("date", schema, options);
|
|
13
|
-
case "uri":
|
|
14
|
-
return (0, core_1.cleanObject)({
|
|
15
|
-
input: true,
|
|
16
|
-
...component,
|
|
17
|
-
type: component.type || "url"
|
|
18
|
-
});
|
|
19
|
-
default:
|
|
20
|
-
return (0, core_1.cleanObject)({
|
|
21
|
-
input: true,
|
|
22
|
-
...component,
|
|
23
|
-
type: component.type || schema.format
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
if (schema.enum) {
|
|
28
|
-
const component = (0, FormioMappersContainer_js_1.execMapper)("enum", schema, options);
|
|
29
|
-
return {
|
|
30
|
-
...component,
|
|
31
|
-
type: component.type || "radio"
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
const component = (0, FormioMappersContainer_js_1.execMapper)("default", schema, options);
|
|
35
|
-
return (0, core_1.cleanObject)({
|
|
36
|
-
input: true,
|
|
37
|
-
type: component.type || "textfield",
|
|
38
|
-
...component
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
exports.stringToComponent = stringToComponent;
|
|
42
|
-
(0, FormioMappersContainer_js_1.registerFormioMapper)("string", stringToComponent);
|
|
43
|
-
//# sourceMappingURL=stringToComponent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stringToComponent.js","sourceRoot":"","sources":["../../../src/components/stringToComponent.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AACvC,uFAAyF;AAEzF,SAAgB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exports, "__esModule", { value: true });
|
|
3
|
-
exports.Component = void 0;
|
|
4
|
-
const schema_1 = require("@tsed/schema");
|
|
5
|
-
/**
|
|
6
|
-
* Declare a formio Component schema on the decorated propertyKey.
|
|
7
|
-
* @decorator
|
|
8
|
-
* @formio
|
|
9
|
-
* @property
|
|
10
|
-
* @schema
|
|
11
|
-
*/
|
|
12
|
-
function Component(component) {
|
|
13
|
-
component = Object.entries(component).reduce((component, [key, value]) => {
|
|
14
|
-
if (key === "validate") {
|
|
15
|
-
component["x-formio-validate"] = {
|
|
16
|
-
...(component["x-formio-validate"] || {}),
|
|
17
|
-
...value
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
return {
|
|
21
|
-
...component,
|
|
22
|
-
[`x-formio-${key}`]: value
|
|
23
|
-
};
|
|
24
|
-
}, {});
|
|
25
|
-
return (0, schema_1.JsonEntityFn)((store) => {
|
|
26
|
-
Object.entries(component).forEach(([key, value]) => {
|
|
27
|
-
store.itemSchema.customKey(key, value);
|
|
28
|
-
if (store.isCollection) {
|
|
29
|
-
store.schema.customKey(key, value);
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
exports.Component = Component;
|
|
35
|
-
//# sourceMappingURL=component.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/decorators/component.ts"],"names":[],"mappings":";;;AAAA,yCAA2D;AAE3D;;;;;;GAMG;AACH,SAAgB,SAAS,CAAC,SAA8B;IACtD,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,SAA8B,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QAC5F,IAAI,GAAG,KAAK,UAAU,EAAE;YACtB,SAAS,CAAC,mBAAmB,CAAC,GAAG;gBAC/B,GAAG,CAAC,SAAS,CAAC,mBAAmB,CAAC,IAAI,EAAE,CAAC;gBACzC,GAAG,KAAK;aACT,CAAC;SACH;QAED,OAAO;YACL,GAAG,SAAS;YACZ,CAAC,YAAY,GAAG,EAAE,CAAC,EAAE,KAAK;SAC3B,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,IAAA,qBAAY,EAAC,CAAC,KAAsB,EAAE,EAAE;QAC7C,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;YACjD,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YAEvC,IAAI,KAAK,CAAC,YAAY,EAAE;gBACtB,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;aACpC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAxBD,8BAwBC"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HideWhen = exports.ShowWhen = exports.Conditional = void 0;
|
|
4
|
-
const component_js_1 = require("./component.js");
|
|
5
|
-
/**
|
|
6
|
-
* Adds a conditional display rule on the input form.
|
|
7
|
-
* @decorator
|
|
8
|
-
* @formio
|
|
9
|
-
* @property
|
|
10
|
-
* @schema
|
|
11
|
-
* @param conditional
|
|
12
|
-
*/
|
|
13
|
-
function Conditional(conditional) {
|
|
14
|
-
return (0, component_js_1.Component)({
|
|
15
|
-
conditional
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
exports.Conditional = Conditional;
|
|
19
|
-
/**
|
|
20
|
-
* Adds a conditional display rule on the input form.
|
|
21
|
-
* @decorator
|
|
22
|
-
* @formio
|
|
23
|
-
* @property
|
|
24
|
-
* @schema
|
|
25
|
-
* @param property
|
|
26
|
-
* @param eq
|
|
27
|
-
*/
|
|
28
|
-
function ShowWhen(property, eq) {
|
|
29
|
-
return Conditional({
|
|
30
|
-
show: true,
|
|
31
|
-
when: property,
|
|
32
|
-
eq
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
exports.ShowWhen = ShowWhen;
|
|
36
|
-
/**
|
|
37
|
-
* Adds a conditional display rule on the input form.
|
|
38
|
-
* @decorator
|
|
39
|
-
* @formio
|
|
40
|
-
* @property
|
|
41
|
-
* @schema
|
|
42
|
-
* @param property
|
|
43
|
-
* @param eq
|
|
44
|
-
*/
|
|
45
|
-
function HideWhen(property, eq) {
|
|
46
|
-
return Conditional({
|
|
47
|
-
show: false,
|
|
48
|
-
when: property,
|
|
49
|
-
eq
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
exports.HideWhen = HideWhen;
|
|
53
|
-
//# sourceMappingURL=conditional.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"conditional.js","sourceRoot":"","sources":["../../../src/decorators/conditional.ts"],"names":[],"mappings":";;;AAAA,iDAAyC;AAEzC;;;;;;;GAOG;AACH,SAAgB,WAAW,CAAC,WAAmD;IAC7E,OAAO,IAAA,wBAAS,EAAC;QACf,WAAW;KACZ,CAAC,CAAC;AACL,CAAC;AAJD,kCAIC;AAED;;;;;;;;GAQG;AACH,SAAgB,QAAQ,CAAC,QAAgB,EAAE,EAAO;IAChD,OAAO,WAAW,CAAC;QACjB,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,QAAQ;QACd,EAAE;KACH,CAAC,CAAC;AACL,CAAC;AAND,4BAMC;AAED;;;;;;;;GAQG;AACH,SAAgB,QAAQ,CAAC,QAAgB,EAAE,EAAO;IAChD,OAAO,WAAW,CAAC;QACjB,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,QAAQ;QACd,EAAE;KACH,CAAC,CAAC;AACL,CAAC;AAND,4BAMC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Currency = void 0;
|
|
4
|
-
const component_js_1 = require("./component.js");
|
|
5
|
-
/**
|
|
6
|
-
* Configure the property as Currency component.
|
|
7
|
-
* @decorator
|
|
8
|
-
* @formio
|
|
9
|
-
* @property
|
|
10
|
-
* @schema
|
|
11
|
-
*/
|
|
12
|
-
function Currency(props = {}) {
|
|
13
|
-
return (0, component_js_1.Component)({
|
|
14
|
-
currency: "USD",
|
|
15
|
-
inputFormat: "plain",
|
|
16
|
-
mask: false,
|
|
17
|
-
spellcheck: true,
|
|
18
|
-
delimiter: true,
|
|
19
|
-
...props,
|
|
20
|
-
type: "currency"
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
exports.Currency = Currency;
|
|
24
|
-
//# sourceMappingURL=currency.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"currency.js","sourceRoot":"","sources":["../../../src/decorators/currency.ts"],"names":[],"mappings":";;;AAAA,iDAAyC;AACzC;;;;;;GAMG;AACH,SAAgB,QAAQ,CAAC,QAA6B,EAAE;IACtD,OAAO,IAAA,wBAAS,EAAC;QACf,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,OAAO;QACpB,IAAI,EAAE,KAAK;QACX,UAAU,EAAE,IAAI;QAChB,SAAS,EAAE,IAAI;QACf,GAAG,KAAK;QACR,IAAI,EAAE,UAAU;KACjB,CAAC,CAAC;AACL,CAAC;AAVD,4BAUC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CustomClass = void 0;
|
|
4
|
-
const component_js_1 = require("./component.js");
|
|
5
|
-
/**
|
|
6
|
-
* Add a custom css class.
|
|
7
|
-
* @decorator
|
|
8
|
-
* @formio
|
|
9
|
-
* @property
|
|
10
|
-
* @schema
|
|
11
|
-
*/
|
|
12
|
-
function CustomClass(customClass) {
|
|
13
|
-
return (0, component_js_1.Component)({
|
|
14
|
-
customClass
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
exports.CustomClass = CustomClass;
|
|
18
|
-
//# sourceMappingURL=customClass.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"customClass.js","sourceRoot":"","sources":["../../../src/decorators/customClass.ts"],"names":[],"mappings":";;;AAAA,iDAAyC;AAEzC;;;;;;GAMG;AACH,SAAgB,WAAW,CAAC,WAAmB;IAC7C,OAAO,IAAA,wBAAS,EAAC;QACf,WAAW;KACZ,CAAC,CAAC;AACL,CAAC;AAJD,kCAIC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CustomConditional = void 0;
|
|
4
|
-
const component_js_1 = require("./component.js");
|
|
5
|
-
const core_1 = require("@tsed/core");
|
|
6
|
-
function sanitize(customConditional) {
|
|
7
|
-
const str = customConditional.toString();
|
|
8
|
-
const [signature, ...fn] = str.split("=>");
|
|
9
|
-
let content = fn.join("=>");
|
|
10
|
-
if (!signature.includes("{")) {
|
|
11
|
-
content = content.replace(new RegExp(`${signature.trim()}.`, "gi"), "");
|
|
12
|
-
}
|
|
13
|
-
return `show = ${content.trim()}`;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Adds custom conditional rule to display or not the input form.
|
|
17
|
-
* @decorator
|
|
18
|
-
* @formio
|
|
19
|
-
* @property
|
|
20
|
-
* @schema
|
|
21
|
-
* @param customConditional
|
|
22
|
-
*/
|
|
23
|
-
function CustomConditional(customConditional) {
|
|
24
|
-
if ((0, core_1.isArrowFn)(customConditional)) {
|
|
25
|
-
customConditional = sanitize(customConditional);
|
|
26
|
-
}
|
|
27
|
-
return (0, component_js_1.Component)({
|
|
28
|
-
customConditional
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
exports.CustomConditional = CustomConditional;
|
|
32
|
-
//# sourceMappingURL=customConditional.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"customConditional.js","sourceRoot":"","sources":["../../../src/decorators/customConditional.ts"],"names":[],"mappings":";;;AAIA,iDAAyC;AACzC,qCAAqC;AAiDrC,SAAS,QAAQ,CAAC,iBAA2B;IAC3C,MAAM,GAAG,GAAG,iBAAiB,CAAC,QAAQ,EAAE,CAAC;IAEzC,MAAM,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC3C,IAAI,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAE5B,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QAC5B,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,GAAG,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;KACzE;IAED,OAAO,UAAU,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;AACpC,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,iBAAiB,CAAC,iBAAgE;IAChG,IAAI,IAAA,gBAAS,EAAC,iBAAiB,CAAC,EAAE;QAChC,iBAAiB,GAAG,QAAQ,CAAC,iBAAiB,CAAC,CAAC;KACjD;IAED,OAAO,IAAA,wBAAS,EAAC;QACf,iBAAiB;KAClB,CAAC,CAAC;AACL,CAAC;AARD,8CAQC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DataSourceJson = void 0;
|
|
4
|
-
const component_js_1 = require("./component.js");
|
|
5
|
-
const core_1 = require("@tsed/core");
|
|
6
|
-
const wrap = (resolver) => async (opts) => {
|
|
7
|
-
const result = await resolver(opts);
|
|
8
|
-
return JSON.stringify(result);
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Set custom json data source
|
|
12
|
-
* @param data
|
|
13
|
-
* @param props
|
|
14
|
-
* @constructor
|
|
15
|
-
*/
|
|
16
|
-
function DataSourceJson(data, props = {}) {
|
|
17
|
-
return (0, component_js_1.Component)({
|
|
18
|
-
...props,
|
|
19
|
-
dataSrc: "json",
|
|
20
|
-
data: {
|
|
21
|
-
...props.data,
|
|
22
|
-
json: (0, core_1.isFunction)(data) ? wrap(data) : JSON.stringify(data)
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
exports.DataSourceJson = DataSourceJson;
|
|
27
|
-
//# sourceMappingURL=dataSourceJson.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dataSourceJson.js","sourceRoot":"","sources":["../../../src/decorators/dataSourceJson.ts"],"names":[],"mappings":";;;AAAA,iDAAyC;AAEzC,qCAAsC;AAEtC,MAAM,IAAI,GAAG,CAAC,QAA4B,EAAE,EAAE,CAAC,KAAK,EAAE,IAA2B,EAAE,EAAE;IACnF,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAC;IACpC,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC,CAAC;AAEF;;;;;GAKG;AACH,SAAgB,cAAc,CAAC,IAA8B,EAAE,QAA6B,EAAE;IAC5F,OAAO,IAAA,wBAAS,EAAC;QACf,GAAG,KAAK;QACR,OAAO,EAAE,MAAM;QACf,IAAI,EAAE;YACJ,GAAG,KAAK,CAAC,IAAI;YACb,IAAI,EAAE,IAAA,iBAAU,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;SAC3D;KACF,CAAC,CAAC;AACL,CAAC;AATD,wCASC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DataSourceUrl = void 0;
|
|
4
|
-
const component_js_1 = require("./component.js");
|
|
5
|
-
/**
|
|
6
|
-
* Set URL data on the current component.
|
|
7
|
-
* @param url
|
|
8
|
-
* @param props
|
|
9
|
-
* @constructor
|
|
10
|
-
*/
|
|
11
|
-
function DataSourceUrl(url, props = {}) {
|
|
12
|
-
return (0, component_js_1.Component)({
|
|
13
|
-
...props,
|
|
14
|
-
dataSrc: "url",
|
|
15
|
-
data: {
|
|
16
|
-
...props.data,
|
|
17
|
-
url
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
exports.DataSourceUrl = DataSourceUrl;
|
|
22
|
-
//# sourceMappingURL=dataSourceUrl.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dataSourceUrl.js","sourceRoot":"","sources":["../../../src/decorators/dataSourceUrl.ts"],"names":[],"mappings":";;;AAAA,iDAAyC;AAGzC;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,GAAgC,EAAE,QAA6B,EAAE;IAC7F,OAAO,IAAA,wBAAS,EAAC;QACf,GAAG,KAAK;QACR,OAAO,EAAE,KAAK;QACd,IAAI,EAAE;YACJ,GAAG,KAAK,CAAC,IAAI;YACb,GAAG;SACJ;KACF,CAAC,CAAC;AACL,CAAC;AATD,sCASC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ErrorLabel = void 0;
|
|
4
|
-
const component_js_1 = require("./component.js");
|
|
5
|
-
/**
|
|
6
|
-
* Set the error label when an error occur.
|
|
7
|
-
* @decorator
|
|
8
|
-
* @formio
|
|
9
|
-
* @property
|
|
10
|
-
* @schema
|
|
11
|
-
*/
|
|
12
|
-
function ErrorLabel(message) {
|
|
13
|
-
return (0, component_js_1.Component)({
|
|
14
|
-
errorLabel: message
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
exports.ErrorLabel = ErrorLabel;
|
|
18
|
-
//# sourceMappingURL=errorLabel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errorLabel.js","sourceRoot":"","sources":["../../../src/decorators/errorLabel.ts"],"names":[],"mappings":";;;AAAA,iDAAyC;AAEzC;;;;;;GAMG;AACH,SAAgB,UAAU,CAAC,OAAe;IACxC,OAAO,IAAA,wBAAS,EAAC;QACf,UAAU,EAAE,OAAO;KACpB,CAAC,CAAC;AACL,CAAC;AAJD,gCAIC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ErrorMessage = void 0;
|
|
4
|
-
const validate_js_1 = require("./validate.js");
|
|
5
|
-
/**
|
|
6
|
-
* Add error message when an error occur.
|
|
7
|
-
* @decorator
|
|
8
|
-
* @formio
|
|
9
|
-
* @property
|
|
10
|
-
* @schema
|
|
11
|
-
* @param message
|
|
12
|
-
*/
|
|
13
|
-
function ErrorMessage(message) {
|
|
14
|
-
return (0, validate_js_1.Validate)("customMessage", message);
|
|
15
|
-
}
|
|
16
|
-
exports.ErrorMessage = ErrorMessage;
|
|
17
|
-
//# sourceMappingURL=errorMessage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errorMessage.js","sourceRoot":"","sources":["../../../src/decorators/errorMessage.ts"],"names":[],"mappings":";;;AAAA,+CAAuC;AAEvC;;;;;;;GAOG;AACH,SAAgB,YAAY,CAAC,OAAe;IAC1C,OAAO,IAAA,sBAAQ,EAAC,eAAe,EAAE,OAAO,CAAC,CAAC;AAC5C,CAAC;AAFD,oCAEC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Form = void 0;
|
|
4
|
-
const core_1 = require("@tsed/core");
|
|
5
|
-
const schema_1 = require("@tsed/schema");
|
|
6
|
-
const change_case_1 = require("change-case");
|
|
7
|
-
const FormsContainer_js_1 = require("../registries/FormsContainer.js");
|
|
8
|
-
const label_js_1 = require("./label.js");
|
|
9
|
-
/**
|
|
10
|
-
* Expose the model as Formio Form.
|
|
11
|
-
* @param form
|
|
12
|
-
*/
|
|
13
|
-
function Form(form = {}) {
|
|
14
|
-
return (0, core_1.useDecorators)((target) => {
|
|
15
|
-
const name = form.name || (0, core_1.nameOf)(target);
|
|
16
|
-
const machineName = (0, change_case_1.paramCase)(name);
|
|
17
|
-
FormsContainer_js_1.FormsContainer.set(name, target);
|
|
18
|
-
FormsContainer_js_1.FormsContainer.set(machineName, target);
|
|
19
|
-
}, form.name && (0, schema_1.Name)(form.name), form.label && (0, label_js_1.Label)(form.label), form && (0, core_1.StoreSet)("formio:form", form));
|
|
20
|
-
}
|
|
21
|
-
exports.Form = Form;
|
|
22
|
-
//# sourceMappingURL=form.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"form.js","sourceRoot":"","sources":["../../../src/decorators/form.ts"],"names":[],"mappings":";;;AAAA,qCAA2D;AAE3D,yCAAkC;AAClC,6CAAsC;AACtC,uEAA+D;AAC/D,yCAAiC;AAEjC;;;GAGG;AACH,SAAgB,IAAI,CAAC,OAAwD,EAAE;IAC7E,OAAO,IAAA,oBAAa,EAClB,CAAC,MAAW,EAAE,EAAE;QACd,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,IAAA,aAAM,EAAC,MAAM,CAAC,CAAC;QACzC,MAAM,WAAW,GAAG,IAAA,uBAAS,EAAC,IAAI,CAAC,CAAC;QACpC,kCAAc,CAAC,GAAG,CAAC,IAAI,EAAE,MAAa,CAAC,CAAC;QACxC,kCAAc,CAAC,GAAG,CAAC,WAAW,EAAE,MAAa,CAAC,CAAC;IACjD,CAAC,EACD,IAAI,CAAC,IAAI,IAAI,IAAA,aAAI,EAAC,IAAI,CAAC,IAAI,CAAC,EAC5B,IAAI,CAAC,KAAK,IAAI,IAAA,gBAAK,EAAC,IAAI,CAAC,KAAK,CAAC,EAC/B,IAAI,IAAI,IAAA,eAAQ,EAAC,aAAa,EAAE,IAAI,CAAC,CACtC,CAAC;AACJ,CAAC;AAZD,oBAYC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Hidden = void 0;
|
|
4
|
-
const component_js_1 = require("./component.js");
|
|
5
|
-
/**
|
|
6
|
-
* Set hidden field.
|
|
7
|
-
*
|
|
8
|
-
* A hidden field is still a part of the form, but is hidden from view.
|
|
9
|
-
*
|
|
10
|
-
* @param bool
|
|
11
|
-
* @decorator
|
|
12
|
-
* @formio
|
|
13
|
-
* @property
|
|
14
|
-
* @schema
|
|
15
|
-
*/
|
|
16
|
-
function Hidden(bool = true) {
|
|
17
|
-
return (0, component_js_1.Component)({
|
|
18
|
-
hidden: bool
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
exports.Hidden = Hidden;
|
|
22
|
-
//# sourceMappingURL=hidden.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hidden.js","sourceRoot":"","sources":["../../../src/decorators/hidden.ts"],"names":[],"mappings":";;;AAAA,iDAAyC;AAEzC;;;;;;;;;;GAUG;AACH,SAAgB,MAAM,CAAC,OAAgB,IAAI;IACzC,OAAO,IAAA,wBAAS,EAAC;QACf,MAAM,EAAE,IAAI;KACb,CAAC,CAAC;AACL,CAAC;AAJD,wBAIC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InputTags = void 0;
|
|
4
|
-
const core_1 = require("@tsed/core");
|
|
5
|
-
const schema_1 = require("@tsed/schema");
|
|
6
|
-
const component_js_1 = require("./component.js");
|
|
7
|
-
/**
|
|
8
|
-
* Configure the property as Tags component.
|
|
9
|
-
* @decorator
|
|
10
|
-
* @formio
|
|
11
|
-
* @property
|
|
12
|
-
* @schema
|
|
13
|
-
*/
|
|
14
|
-
function InputTags(props = {}) {
|
|
15
|
-
return (0, core_1.useDecorators)((0, schema_1.CollectionOf)(String), (0, component_js_1.Component)({
|
|
16
|
-
...props,
|
|
17
|
-
tableView: false,
|
|
18
|
-
storeas: "array",
|
|
19
|
-
type: "tags"
|
|
20
|
-
}));
|
|
21
|
-
}
|
|
22
|
-
exports.InputTags = InputTags;
|
|
23
|
-
//# sourceMappingURL=inputTags.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inputTags.js","sourceRoot":"","sources":["../../../src/decorators/inputTags.ts"],"names":[],"mappings":";;;AAAA,qCAAyC;AACzC,yCAA0C;AAC1C,iDAAyC;AACzC;;;;;;GAMG;AACH,SAAgB,SAAS,CAAC,QAA6B,EAAE;IACvD,OAAO,IAAA,oBAAa,EAClB,IAAA,qBAAY,EAAC,MAAM,CAAC,EACpB,IAAA,wBAAS,EAAC;QACR,GAAG,KAAK;QACR,SAAS,EAAE,KAAK;QAChB,OAAO,EAAE,OAAO;QAChB,IAAI,EAAE,MAAM;KACb,CAAC,CACH,CAAC;AACJ,CAAC;AAVD,8BAUC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Label = void 0;
|
|
4
|
-
const schema_1 = require("@tsed/schema");
|
|
5
|
-
const component_js_1 = require("./component.js");
|
|
6
|
-
/**
|
|
7
|
-
* Change the label field
|
|
8
|
-
* @decorator
|
|
9
|
-
* @formio
|
|
10
|
-
* @property
|
|
11
|
-
* @schema
|
|
12
|
-
* @param label
|
|
13
|
-
*/
|
|
14
|
-
function Label(label) {
|
|
15
|
-
return (0, schema_1.JsonEntityFn)((entity) => {
|
|
16
|
-
return entity.decoratorType === "property"
|
|
17
|
-
? (0, component_js_1.Component)({
|
|
18
|
-
label
|
|
19
|
-
})
|
|
20
|
-
: (0, schema_1.CustomKey)("x-formio-label", label);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
exports.Label = Label;
|
|
24
|
-
//# sourceMappingURL=label.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"label.js","sourceRoot":"","sources":["../../../src/decorators/label.ts"],"names":[],"mappings":";;;AAAA,yCAAqD;AACrD,iDAAyC;AAEzC;;;;;;;GAOG;AACH,SAAgB,KAAK,CAAC,KAAa;IACjC,OAAO,IAAA,qBAAY,EAAC,CAAC,MAAM,EAAE,EAAE;QAC7B,OAAO,MAAM,CAAC,aAAa,KAAK,UAAU;YACxC,CAAC,CAAC,IAAA,wBAAS,EAAC;gBACR,KAAK;aACN,CAAC;YACJ,CAAC,CAAC,IAAA,kBAAS,EAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;AACL,CAAC;AARD,sBAQC"}
|