@tsed/schema-formio 7.0.0-alpha.1 → 7.0.0-beta.3
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/jest.config.js +14 -0
- package/lib/cjs/components/anyToComponent.js +28 -0
- package/lib/cjs/components/anyToComponent.js.map +1 -0
- package/lib/cjs/components/arrayToComponent.js +40 -0
- package/lib/cjs/components/arrayToComponent.js.map +1 -0
- package/lib/cjs/components/booleanToComponent.js +14 -0
- package/lib/cjs/components/booleanToComponent.js.map +1 -0
- package/lib/cjs/components/dateToComponent.js +57 -0
- package/lib/cjs/components/dateToComponent.js.map +1 -0
- package/lib/cjs/components/defaultToComponent.js +18 -0
- package/lib/cjs/components/defaultToComponent.js.map +1 -0
- package/lib/cjs/components/enumToComponent.js +33 -0
- package/lib/cjs/components/enumToComponent.js.map +1 -0
- package/lib/cjs/components/index.js +17 -0
- package/lib/cjs/components/index.js.map +1 -0
- package/lib/cjs/components/mapToComponent.js +20 -0
- package/lib/cjs/components/mapToComponent.js.map +1 -0
- package/lib/cjs/components/nestedToComponent.js +25 -0
- package/lib/cjs/components/nestedToComponent.js.map +1 -0
- package/lib/cjs/components/numberToComponent.js +21 -0
- package/lib/cjs/components/numberToComponent.js.map +1 -0
- package/lib/cjs/components/objectToEditGrid.js +16 -0
- package/lib/cjs/components/objectToEditGrid.js.map +1 -0
- package/lib/cjs/components/panelToComponent.js +16 -0
- package/lib/cjs/components/panelToComponent.js.map +1 -0
- package/lib/cjs/components/propertiesToComponents.js +88 -0
- package/lib/cjs/components/propertiesToComponents.js.map +1 -0
- package/lib/cjs/components/stringToComponent.js +43 -0
- package/lib/cjs/components/stringToComponent.js.map +1 -0
- package/lib/cjs/decorators/component.js +35 -0
- package/lib/cjs/decorators/component.js.map +1 -0
- package/lib/cjs/decorators/conditional.js +53 -0
- package/lib/cjs/decorators/conditional.js.map +1 -0
- package/lib/cjs/decorators/currency.js +24 -0
- package/lib/cjs/decorators/currency.js.map +1 -0
- package/lib/cjs/decorators/customClass.js +18 -0
- package/lib/cjs/decorators/customClass.js.map +1 -0
- package/lib/cjs/decorators/customConditional.js +33 -0
- package/lib/cjs/decorators/customConditional.js.map +1 -0
- package/lib/cjs/decorators/dataSourceJson.js +27 -0
- package/lib/cjs/decorators/dataSourceJson.js.map +1 -0
- package/lib/cjs/decorators/dataSourceUrl.js +22 -0
- package/lib/cjs/decorators/dataSourceUrl.js.map +1 -0
- package/lib/cjs/decorators/errorLabel.js +18 -0
- package/lib/cjs/decorators/errorLabel.js.map +1 -0
- package/lib/cjs/decorators/errorMessage.js +17 -0
- package/lib/cjs/decorators/errorMessage.js.map +1 -0
- package/lib/cjs/decorators/form.js +21 -0
- package/lib/cjs/decorators/form.js.map +1 -0
- package/lib/cjs/decorators/hidden.js +22 -0
- package/lib/cjs/decorators/hidden.js.map +1 -0
- package/lib/cjs/decorators/index.js +34 -0
- package/lib/cjs/decorators/index.js.map +1 -0
- package/lib/cjs/decorators/inputTags.js +23 -0
- package/lib/cjs/decorators/inputTags.js.map +1 -0
- package/lib/cjs/decorators/label.js +19 -0
- package/lib/cjs/decorators/label.js.map +1 -0
- package/lib/cjs/decorators/mask.js +50 -0
- package/lib/cjs/decorators/mask.js.map +1 -0
- package/lib/cjs/decorators/maxWords.js +17 -0
- package/lib/cjs/decorators/maxWords.js.map +1 -0
- package/lib/cjs/decorators/minWords.js +17 -0
- package/lib/cjs/decorators/minWords.js.map +1 -0
- package/lib/cjs/decorators/modalEdit.js +18 -0
- package/lib/cjs/decorators/modalEdit.js.map +1 -0
- package/lib/cjs/decorators/multiple.js +18 -0
- package/lib/cjs/decorators/multiple.js.map +1 -0
- package/lib/cjs/decorators/openWhenEmpty.js +18 -0
- package/lib/cjs/decorators/openWhenEmpty.js.map +1 -0
- package/lib/cjs/decorators/password.js +20 -0
- package/lib/cjs/decorators/password.js.map +1 -0
- package/lib/cjs/decorators/placeholder.js +19 -0
- package/lib/cjs/decorators/placeholder.js.map +1 -0
- package/lib/cjs/decorators/prefix.js +18 -0
- package/lib/cjs/decorators/prefix.js.map +1 -0
- package/lib/cjs/decorators/select.js +22 -0
- package/lib/cjs/decorators/select.js.map +1 -0
- package/lib/cjs/decorators/suffix.js +18 -0
- package/lib/cjs/decorators/suffix.js.map +1 -0
- package/lib/cjs/decorators/tableView.js +19 -0
- package/lib/cjs/decorators/tableView.js.map +1 -0
- package/lib/cjs/decorators/tabs.js +22 -0
- package/lib/cjs/decorators/tabs.js.map +1 -0
- package/lib/cjs/decorators/textCase.js +19 -0
- package/lib/cjs/decorators/textCase.js.map +1 -0
- package/lib/cjs/decorators/textarea.js +20 -0
- package/lib/cjs/decorators/textarea.js.map +1 -0
- package/lib/cjs/decorators/tooltip.js +19 -0
- package/lib/cjs/decorators/tooltip.js.map +1 -0
- package/lib/cjs/decorators/validate.js +22 -0
- package/lib/cjs/decorators/validate.js.map +1 -0
- package/lib/cjs/domain/FormioDataResolver.js +3 -0
- package/lib/cjs/domain/FormioDataResolver.js.map +1 -0
- package/lib/cjs/index.js +8 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/registries/FormioMappersContainer.js +21 -0
- package/lib/cjs/registries/FormioMappersContainer.js.map +1 -0
- package/lib/cjs/registries/FormsContainer.js +6 -0
- package/lib/cjs/registries/FormsContainer.js.map +1 -0
- package/lib/cjs/utils/getFormioProps.js +17 -0
- package/lib/cjs/utils/getFormioProps.js.map +1 -0
- package/lib/cjs/utils/getFormioSchema.js +42 -0
- package/lib/cjs/utils/getFormioSchema.js.map +1 -0
- package/lib/cjs/utils/getRef.js +12 -0
- package/lib/cjs/utils/getRef.js.map +1 -0
- package/lib/esm/components/anyToComponent.js +24 -0
- package/lib/esm/components/anyToComponent.js.map +1 -0
- package/lib/esm/components/arrayToComponent.js +36 -0
- package/lib/esm/components/arrayToComponent.js.map +1 -0
- package/lib/esm/components/booleanToComponent.js +12 -0
- package/lib/esm/components/booleanToComponent.js.map +1 -0
- package/lib/esm/components/dateToComponent.js +55 -0
- package/lib/esm/components/dateToComponent.js.map +1 -0
- package/lib/esm/components/defaultToComponent.js +14 -0
- package/lib/esm/components/defaultToComponent.js.map +1 -0
- package/lib/esm/components/enumToComponent.js +29 -0
- package/lib/esm/components/enumToComponent.js.map +1 -0
- package/lib/esm/components/index.js +14 -0
- package/lib/esm/components/index.js.map +1 -0
- package/lib/esm/components/mapToComponent.js +16 -0
- package/lib/esm/components/mapToComponent.js.map +1 -0
- package/lib/esm/components/nestedToComponent.js +21 -0
- package/lib/esm/components/nestedToComponent.js.map +1 -0
- package/lib/esm/components/numberToComponent.js +17 -0
- package/lib/esm/components/numberToComponent.js.map +1 -0
- package/lib/esm/components/objectToEditGrid.js +12 -0
- package/lib/esm/components/objectToEditGrid.js.map +1 -0
- package/lib/esm/components/panelToComponent.js +12 -0
- package/lib/esm/components/panelToComponent.js.map +1 -0
- package/lib/esm/components/propertiesToComponents.js +84 -0
- package/lib/esm/components/propertiesToComponents.js.map +1 -0
- package/lib/esm/components/stringToComponent.js +39 -0
- package/lib/esm/components/stringToComponent.js.map +1 -0
- package/lib/esm/decorators/component.js +31 -0
- package/lib/esm/decorators/component.js.map +1 -0
- package/lib/esm/decorators/conditional.js +47 -0
- package/lib/esm/decorators/conditional.js.map +1 -0
- package/lib/esm/decorators/currency.js +20 -0
- package/lib/esm/decorators/currency.js.map +1 -0
- package/lib/esm/decorators/customClass.js +14 -0
- package/lib/esm/decorators/customClass.js.map +1 -0
- package/lib/esm/decorators/customConditional.js +29 -0
- package/lib/esm/decorators/customConditional.js.map +1 -0
- package/lib/esm/decorators/dataSourceJson.js +23 -0
- package/lib/esm/decorators/dataSourceJson.js.map +1 -0
- package/lib/esm/decorators/dataSourceUrl.js +18 -0
- package/lib/esm/decorators/dataSourceUrl.js.map +1 -0
- package/lib/esm/decorators/errorLabel.js +14 -0
- package/lib/esm/decorators/errorLabel.js.map +1 -0
- package/lib/esm/decorators/errorMessage.js +13 -0
- package/lib/esm/decorators/errorMessage.js.map +1 -0
- package/lib/esm/decorators/form.js +17 -0
- package/lib/esm/decorators/form.js.map +1 -0
- package/lib/esm/decorators/hidden.js +18 -0
- package/lib/esm/decorators/hidden.js.map +1 -0
- package/lib/esm/decorators/index.js +31 -0
- package/lib/esm/decorators/index.js.map +1 -0
- package/lib/esm/decorators/inputTags.js +19 -0
- package/lib/esm/decorators/inputTags.js.map +1 -0
- package/lib/esm/decorators/label.js +15 -0
- package/lib/esm/decorators/label.js.map +1 -0
- package/lib/esm/decorators/mask.js +45 -0
- package/lib/esm/decorators/mask.js.map +1 -0
- package/lib/esm/decorators/maxWords.js +13 -0
- package/lib/esm/decorators/maxWords.js.map +1 -0
- package/lib/esm/decorators/minWords.js +13 -0
- package/lib/esm/decorators/minWords.js.map +1 -0
- package/lib/esm/decorators/modalEdit.js +14 -0
- package/lib/esm/decorators/modalEdit.js.map +1 -0
- package/lib/esm/decorators/multiple.js +14 -0
- package/lib/esm/decorators/multiple.js.map +1 -0
- package/lib/esm/decorators/openWhenEmpty.js +14 -0
- package/lib/esm/decorators/openWhenEmpty.js.map +1 -0
- package/lib/esm/decorators/password.js +16 -0
- package/lib/esm/decorators/password.js.map +1 -0
- package/lib/esm/decorators/placeholder.js +15 -0
- package/lib/esm/decorators/placeholder.js.map +1 -0
- package/lib/esm/decorators/prefix.js +14 -0
- package/lib/esm/decorators/prefix.js.map +1 -0
- package/lib/esm/decorators/select.js +18 -0
- package/lib/esm/decorators/select.js.map +1 -0
- package/lib/esm/decorators/suffix.js +14 -0
- package/lib/esm/decorators/suffix.js.map +1 -0
- package/lib/esm/decorators/tableView.js +15 -0
- package/lib/esm/decorators/tableView.js.map +1 -0
- package/lib/esm/decorators/tabs.js +18 -0
- package/lib/esm/decorators/tabs.js.map +1 -0
- package/lib/esm/decorators/textCase.js +15 -0
- package/lib/esm/decorators/textCase.js.map +1 -0
- package/lib/esm/decorators/textarea.js +16 -0
- package/lib/esm/decorators/textarea.js.map +1 -0
- package/lib/esm/decorators/tooltip.js +15 -0
- package/lib/esm/decorators/tooltip.js.map +1 -0
- package/lib/esm/decorators/validate.js +18 -0
- package/lib/esm/decorators/validate.js.map +1 -0
- package/lib/esm/domain/FormioDataResolver.js +2 -0
- package/lib/esm/domain/FormioDataResolver.js.map +1 -0
- package/lib/esm/index.js +5 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/registries/FormioMappersContainer.js +15 -0
- package/lib/esm/registries/FormioMappersContainer.js.map +1 -0
- package/lib/esm/registries/FormsContainer.js +3 -0
- package/lib/esm/registries/FormsContainer.js.map +1 -0
- package/lib/esm/utils/getFormioProps.js +13 -0
- package/lib/esm/utils/getFormioProps.js.map +1 -0
- package/lib/esm/utils/getFormioSchema.js +38 -0
- package/lib/esm/utils/getFormioSchema.js.map +1 -0
- package/lib/esm/utils/getRef.js +8 -0
- package/lib/esm/utils/getRef.js.map +1 -0
- package/lib/{components → types/components}/anyToComponent.d.ts +0 -0
- package/lib/{components → types/components}/arrayToComponent.d.ts +0 -0
- package/lib/{components → types/components}/booleanToComponent.d.ts +0 -0
- package/lib/{components → types/components}/dateToComponent.d.ts +0 -0
- package/lib/{components → types/components}/defaultToComponent.d.ts +0 -0
- package/lib/{components → types/components}/enumToComponent.d.ts +0 -0
- package/lib/{components → types/components}/index.d.ts +0 -0
- package/lib/{components → types/components}/mapToComponent.d.ts +0 -0
- package/lib/{components → types/components}/nestedToComponent.d.ts +0 -0
- package/lib/{components → types/components}/numberToComponent.d.ts +0 -0
- package/lib/{components → types/components}/objectToEditGrid.d.ts +0 -0
- package/lib/{components → types/components}/panelToComponent.d.ts +0 -0
- package/lib/{components → types/components}/propertiesToComponents.d.ts +0 -0
- package/lib/{components → types/components}/stringToComponent.d.ts +0 -0
- package/lib/{decorators → types/decorators}/component.d.ts +0 -0
- package/lib/types/decorators/conditional.d.ts +33 -0
- package/lib/{decorators → types/decorators}/currency.d.ts +0 -0
- package/lib/types/decorators/customClass.d.ts +8 -0
- package/lib/types/decorators/customConditional.d.ts +59 -0
- package/lib/types/decorators/dataSourceJson.d.ts +8 -0
- package/lib/types/decorators/dataSourceUrl.d.ts +8 -0
- package/lib/types/decorators/errorLabel.d.ts +8 -0
- package/lib/types/decorators/errorMessage.d.ts +9 -0
- package/lib/types/decorators/form.d.ts +6 -0
- package/lib/{decorators → types/decorators}/hidden.d.ts +3 -0
- package/lib/types/decorators/index.d.ts +30 -0
- package/lib/{decorators → types/decorators}/inputTags.d.ts +0 -0
- package/lib/types/decorators/label.d.ts +9 -0
- package/lib/types/decorators/mask.d.ts +37 -0
- package/lib/types/decorators/maxWords.d.ts +9 -0
- package/lib/types/decorators/minWords.d.ts +9 -0
- package/lib/types/decorators/modalEdit.d.ts +8 -0
- package/lib/{decorators → types/decorators}/multiple.d.ts +0 -0
- package/lib/types/decorators/openWhenEmpty.d.ts +8 -0
- package/lib/types/decorators/password.d.ts +12 -0
- package/lib/types/decorators/placeholder.d.ts +9 -0
- package/lib/types/decorators/prefix.d.ts +8 -0
- package/lib/types/decorators/select.d.ts +14 -0
- package/lib/types/decorators/suffix.d.ts +8 -0
- package/lib/{decorators → types/decorators}/tableView.d.ts +0 -0
- package/lib/{decorators → types/decorators}/tabs.d.ts +0 -0
- package/lib/types/decorators/textCase.d.ts +9 -0
- package/lib/types/decorators/textarea.d.ts +12 -0
- package/lib/types/decorators/tooltip.d.ts +9 -0
- package/lib/types/decorators/validate.d.ts +10 -0
- package/lib/types/domain/FormioDataResolver.d.ts +7 -0
- package/lib/{index.d.ts → types/index.d.ts} +0 -0
- package/lib/{registries → types/registries}/FormioMappersContainer.d.ts +0 -0
- package/lib/types/registries/FormsContainer.d.ts +2 -0
- package/lib/{utils → types/utils}/getFormioProps.d.ts +0 -0
- package/lib/types/utils/getFormioSchema.d.ts +4 -0
- package/lib/{utils → types/utils}/getRef.d.ts +0 -0
- package/package.json +24 -16
- package/readme.md +6 -4
- package/tsconfig.compile.esm.json +23 -0
- package/.mocharc.js +0 -5
- package/.nycrc +0 -26
- package/lib/decorators/dataSourceJson.d.ts +0 -7
- package/lib/decorators/dataSourceUrl.d.ts +0 -7
- package/lib/decorators/index.d.ts +0 -11
- package/lib/decorators/password.d.ts +0 -8
- package/lib/decorators/select.d.ts +0 -8
- package/lib/decorators/textarea.d.ts +0 -8
- package/lib/index.js +0 -585
- package/lib/index.js.map +0 -1
- package/lib/index.modern.js +0 -562
- package/lib/index.modern.js.map +0 -1
- package/lib/utils/getFormioSchema.d.ts +0 -11
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HideWhen = exports.ShowWhen = exports.Conditional = void 0;
|
|
4
|
+
const component_1 = require("./component");
|
|
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_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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditional.js","sourceRoot":"","sources":["../../../src/decorators/conditional.ts"],"names":[],"mappings":";;;AAAA,2CAAsC;AAEtC;;;;;;;GAOG;AACH,SAAgB,WAAW,CAAC,WAAmD;IAC7E,OAAO,IAAA,qBAAS,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","sourcesContent":["import {Component} from \"./component\";\n\n/**\n * Adds a conditional display rule on the input form.\n * @decorator\n * @formio\n * @property\n * @schema\n * @param conditional\n */\nexport function Conditional(conditional: {show: boolean; when: string; eq: any}) {\n return Component({\n conditional\n });\n}\n\n/**\n * Adds a conditional display rule on the input form.\n * @decorator\n * @formio\n * @property\n * @schema\n * @param property\n * @param eq\n */\nexport function ShowWhen(property: string, eq: any) {\n return Conditional({\n show: true,\n when: property,\n eq\n });\n}\n\n/**\n * Adds a conditional display rule on the input form.\n * @decorator\n * @formio\n * @property\n * @schema\n * @param property\n * @param eq\n */\nexport function HideWhen(property: string, eq: any) {\n return Conditional({\n show: false,\n when: property,\n eq\n });\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Currency = void 0;
|
|
4
|
+
const component_1 = require("./component");
|
|
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_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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"currency.js","sourceRoot":"","sources":["../../../src/decorators/currency.ts"],"names":[],"mappings":";;;AAAA,2CAAsC;AACtC;;;;;;GAMG;AACH,SAAgB,QAAQ,CAAC,QAA6B,EAAE;IACtD,OAAO,IAAA,qBAAS,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","sourcesContent":["import {Component} from \"./component\";\n/**\n * Configure the property as Currency component.\n * @decorator\n * @formio\n * @property\n * @schema\n */\nexport function Currency(props: Record<string, any> = {}): PropertyDecorator {\n return Component({\n currency: \"USD\",\n inputFormat: \"plain\",\n mask: false,\n spellcheck: true,\n delimiter: true,\n ...props,\n type: \"currency\"\n });\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomClass = void 0;
|
|
4
|
+
const component_1 = require("./component");
|
|
5
|
+
/**
|
|
6
|
+
* Add a custom css class.
|
|
7
|
+
* @decorator
|
|
8
|
+
* @formio
|
|
9
|
+
* @property
|
|
10
|
+
* @schema
|
|
11
|
+
*/
|
|
12
|
+
function CustomClass(customClass) {
|
|
13
|
+
return (0, component_1.Component)({
|
|
14
|
+
customClass
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
exports.CustomClass = CustomClass;
|
|
18
|
+
//# sourceMappingURL=customClass.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customClass.js","sourceRoot":"","sources":["../../../src/decorators/customClass.ts"],"names":[],"mappings":";;;AAAA,2CAAsC;AAEtC;;;;;;GAMG;AACH,SAAgB,WAAW,CAAC,WAAmB;IAC7C,OAAO,IAAA,qBAAS,EAAC;QACf,WAAW;KACZ,CAAC,CAAC;AACL,CAAC;AAJD,kCAIC","sourcesContent":["import {Component} from \"./component\";\n\n/**\n * Add a custom css class.\n * @decorator\n * @formio\n * @property\n * @schema\n */\nexport function CustomClass(customClass: string) {\n return Component({\n customClass\n });\n}\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomConditional = void 0;
|
|
4
|
+
const component_1 = require("./component");
|
|
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
|
+
const reg = `${signature.trim()}\.`;
|
|
12
|
+
content = content.replace(new RegExp(reg, "gi"), "");
|
|
13
|
+
}
|
|
14
|
+
return `show = ${content.trim()}`;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Adds custom conditional rule to display or not the input form.
|
|
18
|
+
* @decorator
|
|
19
|
+
* @formio
|
|
20
|
+
* @property
|
|
21
|
+
* @schema
|
|
22
|
+
* @param customConditional
|
|
23
|
+
*/
|
|
24
|
+
function CustomConditional(customConditional) {
|
|
25
|
+
if ((0, core_1.isArrowFn)(customConditional)) {
|
|
26
|
+
customConditional = sanitize(customConditional);
|
|
27
|
+
}
|
|
28
|
+
return (0, component_1.Component)({
|
|
29
|
+
customConditional
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
exports.CustomConditional = CustomConditional;
|
|
33
|
+
//# sourceMappingURL=customConditional.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customConditional.js","sourceRoot":"","sources":["../../../src/decorators/customConditional.ts"],"names":[],"mappings":";;;AAIA,2CAAsC;AACtC,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,MAAM,GAAG,GAAG,GAAG,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC;QAEpC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;KACtD;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,qBAAS,EAAC;QACf,iBAAiB;KAClB,CAAC,CAAC;AACL,CAAC;AARD,8CAQC","sourcesContent":["import {FormioComponent, FormioForm, FormioSubmission} from \"@tsed/formio-types\";\nimport type {Moment} from \"moment\";\nimport type {LoDashStatic} from \"lodash\";\nimport type {Utils} from \"formiojs\";\nimport {Component} from \"./component\";\nimport {isArrowFn} from \"@tsed/core\";\n\nexport interface CustomConditionalCtx<Value = any, Data = any, Row = any> {\n /**\n * The complete submission object.\n */\n form: FormioForm;\n /**\n * The complete submission object.\n */\n submission: FormioSubmission<Data>;\n /**\n * The complete submission data object.\n */\n data: Data;\n /**\n * Contextual \"row\" data, used within DataGrid, EditGrid, and Container components\n */\n row: Row;\n /**\n * The current component JSON\n */\n component: FormioComponent;\n /**\n * The current component instance.\n */\n instance: any;\n /**\n * The current value of the component.\n */\n value: Value;\n /**\n * The moment.js library for date manipulation.\n */\n moment: Moment;\n /**\n * An instance of Lodash.\n */\n _: LoDashStatic;\n /**\n * An instance of the FormioUtils object.\n */\n utils: typeof Utils;\n /**\n * An alias for \"utils\".\n */\n util: typeof Utils;\n}\n\nfunction sanitize(customConditional: Function) {\n const str = customConditional.toString();\n\n const [signature, ...fn] = str.split(\"=>\");\n let content = fn.join(\"=>\");\n\n if (!signature.includes(\"{\")) {\n const reg = `${signature.trim()}\\.`;\n\n content = content.replace(new RegExp(reg, \"gi\"), \"\");\n }\n\n return `show = ${content.trim()}`;\n}\n\n/**\n * Adds custom conditional rule to display or not the input form.\n * @decorator\n * @formio\n * @property\n * @schema\n * @param customConditional\n */\nexport function CustomConditional(customConditional: string | ((ctx: CustomConditionalCtx) => any)) {\n if (isArrowFn(customConditional)) {\n customConditional = sanitize(customConditional);\n }\n\n return Component({\n customConditional\n });\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DataSourceJson = void 0;
|
|
4
|
+
const component_1 = require("./component");
|
|
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_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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataSourceJson.js","sourceRoot":"","sources":["../../../src/decorators/dataSourceJson.ts"],"names":[],"mappings":";;;AAAA,2CAAsC;AAEtC,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,qBAAS,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","sourcesContent":["import {Component} from \"./component\";\nimport {FormioDataResolver, FormioDataResolverCtx} from \"../domain/FormioDataResolver\";\nimport {isFunction} from \"@tsed/core\";\n\nconst wrap = (resolver: FormioDataResolver) => async (opts: FormioDataResolverCtx) => {\n const result = await resolver(opts);\n return JSON.stringify(result);\n};\n\n/**\n * Set custom json data source\n * @param data\n * @param props\n * @constructor\n */\nexport function DataSourceJson(data: any | FormioDataResolver, props: Record<string, any> = {}) {\n return Component({\n ...props,\n dataSrc: \"json\",\n data: {\n ...props.data,\n json: isFunction(data) ? wrap(data) : JSON.stringify(data)\n }\n });\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DataSourceUrl = void 0;
|
|
4
|
+
const component_1 = require("./component");
|
|
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_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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataSourceUrl.js","sourceRoot":"","sources":["../../../src/decorators/dataSourceUrl.ts"],"names":[],"mappings":";;;AAAA,2CAAsC;AAGtC;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,GAAgC,EAAE,QAA6B,EAAE;IAC7F,OAAO,IAAA,qBAAS,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","sourcesContent":["import {Component} from \"./component\";\nimport {FormioDataResolver} from \"../domain/FormioDataResolver\";\n\n/**\n * Set URL data on the current component.\n * @param url\n * @param props\n * @constructor\n */\nexport function DataSourceUrl(url: string | FormioDataResolver, props: Record<string, any> = {}) {\n return Component({\n ...props,\n dataSrc: \"url\",\n data: {\n ...props.data,\n url\n }\n });\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ErrorLabel = void 0;
|
|
4
|
+
const component_1 = require("./component");
|
|
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_1.Component)({
|
|
14
|
+
errorLabel: message
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
exports.ErrorLabel = ErrorLabel;
|
|
18
|
+
//# sourceMappingURL=errorLabel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errorLabel.js","sourceRoot":"","sources":["../../../src/decorators/errorLabel.ts"],"names":[],"mappings":";;;AAAA,2CAAsC;AAEtC;;;;;;GAMG;AACH,SAAgB,UAAU,CAAC,OAAe;IACxC,OAAO,IAAA,qBAAS,EAAC;QACf,UAAU,EAAE,OAAO;KACpB,CAAC,CAAC;AACL,CAAC;AAJD,gCAIC","sourcesContent":["import {Component} from \"./component\";\n\n/**\n * Set the error label when an error occur.\n * @decorator\n * @formio\n * @property\n * @schema\n */\nexport function ErrorLabel(message: string) {\n return Component({\n errorLabel: message\n });\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ErrorMessage = void 0;
|
|
4
|
+
const validate_1 = require("./validate");
|
|
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_1.Validate)("customMessage", message);
|
|
15
|
+
}
|
|
16
|
+
exports.ErrorMessage = ErrorMessage;
|
|
17
|
+
//# sourceMappingURL=errorMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errorMessage.js","sourceRoot":"","sources":["../../../src/decorators/errorMessage.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AAEpC;;;;;;;GAOG;AACH,SAAgB,YAAY,CAAC,OAAe;IAC1C,OAAO,IAAA,mBAAQ,EAAC,eAAe,EAAE,OAAO,CAAC,CAAC;AAC5C,CAAC;AAFD,oCAEC","sourcesContent":["import {Validate} from \"./validate\";\n\n/**\n * Add error message when an error occur.\n * @decorator\n * @formio\n * @property\n * @schema\n * @param message\n */\nexport function ErrorMessage(message: string) {\n return Validate(\"customMessage\", message);\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
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_1 = require("../registries/FormsContainer");
|
|
8
|
+
/**
|
|
9
|
+
* Expose the model as Formio Form.
|
|
10
|
+
* @param form
|
|
11
|
+
*/
|
|
12
|
+
function Form(form = {}) {
|
|
13
|
+
return (0, core_1.useDecorators)((target) => {
|
|
14
|
+
const name = form.name || (0, core_1.nameOf)(target);
|
|
15
|
+
const machineName = (0, change_case_1.paramCase)(name);
|
|
16
|
+
FormsContainer_1.FormsContainer.set(name, target);
|
|
17
|
+
FormsContainer_1.FormsContainer.set(machineName, target);
|
|
18
|
+
}, form.name && (0, schema_1.Name)(form.name), form && (0, core_1.StoreSet)("formio:form", form));
|
|
19
|
+
}
|
|
20
|
+
exports.Form = Form;
|
|
21
|
+
//# sourceMappingURL=form.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form.js","sourceRoot":"","sources":["../../../src/decorators/form.ts"],"names":[],"mappings":";;;AAAA,qCAA2D;AAC3D,yCAAkC;AAElC,6CAAsC;AACtC,iEAA4D;AAE5D;;;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,+BAAc,CAAC,GAAG,CAAC,IAAI,EAAE,MAAa,CAAC,CAAC;QACxC,+BAAc,CAAC,GAAG,CAAC,WAAW,EAAE,MAAa,CAAC,CAAC;IACjD,CAAC,EACD,IAAI,CAAC,IAAI,IAAI,IAAA,aAAI,EAAC,IAAI,CAAC,IAAI,CAAC,EAC5B,IAAI,IAAI,IAAA,eAAQ,EAAC,aAAa,EAAE,IAAI,CAAC,CACtC,CAAC;AACJ,CAAC;AAXD,oBAWC","sourcesContent":["import {nameOf, StoreSet, useDecorators} from \"@tsed/core\";\nimport {Name} from \"@tsed/schema\";\nimport {FormioForm} from \"@tsed/formio-types\";\nimport {paramCase} from \"change-case\";\nimport {FormsContainer} from \"../registries/FormsContainer\";\n\n/**\n * Expose the model as Formio Form.\n * @param form\n */\nexport function Form(form: Partial<Omit<FormioForm, \"components\" | \"_id\">> = {}): ClassDecorator {\n return useDecorators(\n (target: any) => {\n const name = form.name || nameOf(target);\n const machineName = paramCase(name);\n FormsContainer.set(name, target as any);\n FormsContainer.set(machineName, target as any);\n },\n form.name && Name(form.name),\n form && StoreSet(\"formio:form\", form)\n );\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Hidden = void 0;
|
|
4
|
+
const component_1 = require("./component");
|
|
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_1.Component)({
|
|
18
|
+
hidden: bool
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
exports.Hidden = Hidden;
|
|
22
|
+
//# sourceMappingURL=hidden.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hidden.js","sourceRoot":"","sources":["../../../src/decorators/hidden.ts"],"names":[],"mappings":";;;AAAA,2CAAsC;AAEtC;;;;;;;;;;GAUG;AACH,SAAgB,MAAM,CAAC,OAAgB,IAAI;IACzC,OAAO,IAAA,qBAAS,EAAC;QACf,MAAM,EAAE,IAAI;KACb,CAAC,CAAC;AACL,CAAC;AAJD,wBAIC","sourcesContent":["import {Component} from \"./component\";\n\n/**\n * Set hidden field.\n *\n * A hidden field is still a part of the form, but is hidden from view.\n *\n * @param bool\n * @decorator\n * @formio\n * @property\n * @schema\n */\nexport function Hidden(bool: boolean = true): PropertyDecorator {\n return Component({\n hidden: bool\n });\n}\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
(0, tslib_1.__exportStar)(require("./component"), exports);
|
|
5
|
+
(0, tslib_1.__exportStar)(require("./currency"), exports);
|
|
6
|
+
(0, tslib_1.__exportStar)(require("./dataSourceJson"), exports);
|
|
7
|
+
(0, tslib_1.__exportStar)(require("./dataSourceUrl"), exports);
|
|
8
|
+
(0, tslib_1.__exportStar)(require("./hidden"), exports);
|
|
9
|
+
(0, tslib_1.__exportStar)(require("./inputTags"), exports);
|
|
10
|
+
(0, tslib_1.__exportStar)(require("./multiple"), exports);
|
|
11
|
+
(0, tslib_1.__exportStar)(require("./password"), exports);
|
|
12
|
+
(0, tslib_1.__exportStar)(require("./select"), exports);
|
|
13
|
+
(0, tslib_1.__exportStar)(require("./tableView"), exports);
|
|
14
|
+
(0, tslib_1.__exportStar)(require("./textarea"), exports);
|
|
15
|
+
(0, tslib_1.__exportStar)(require("./errorMessage"), exports);
|
|
16
|
+
(0, tslib_1.__exportStar)(require("./errorLabel"), exports);
|
|
17
|
+
(0, tslib_1.__exportStar)(require("./minWords"), exports);
|
|
18
|
+
(0, tslib_1.__exportStar)(require("./maxWords"), exports);
|
|
19
|
+
(0, tslib_1.__exportStar)(require("./validate"), exports);
|
|
20
|
+
(0, tslib_1.__exportStar)(require("./form"), exports);
|
|
21
|
+
(0, tslib_1.__exportStar)(require("./tabs"), exports);
|
|
22
|
+
(0, tslib_1.__exportStar)(require("./placeholder"), exports);
|
|
23
|
+
(0, tslib_1.__exportStar)(require("./tooltip"), exports);
|
|
24
|
+
(0, tslib_1.__exportStar)(require("./label"), exports);
|
|
25
|
+
(0, tslib_1.__exportStar)(require("./customClass"), exports);
|
|
26
|
+
(0, tslib_1.__exportStar)(require("./modalEdit"), exports);
|
|
27
|
+
(0, tslib_1.__exportStar)(require("./mask"), exports);
|
|
28
|
+
(0, tslib_1.__exportStar)(require("./prefix"), exports);
|
|
29
|
+
(0, tslib_1.__exportStar)(require("./suffix"), exports);
|
|
30
|
+
(0, tslib_1.__exportStar)(require("./textCase"), exports);
|
|
31
|
+
(0, tslib_1.__exportStar)(require("./conditional"), exports);
|
|
32
|
+
(0, tslib_1.__exportStar)(require("./customConditional"), exports);
|
|
33
|
+
(0, tslib_1.__exportStar)(require("./openWhenEmpty"), exports);
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorators/index.ts"],"names":[],"mappings":";;;AAAA,2DAA4B;AAC5B,0DAA2B;AAC3B,gEAAiC;AACjC,+DAAgC;AAChC,wDAAyB;AACzB,2DAA4B;AAC5B,0DAA2B;AAC3B,0DAA2B;AAC3B,wDAAyB;AACzB,2DAA4B;AAC5B,0DAA2B;AAC3B,8DAA+B;AAC/B,4DAA6B;AAC7B,0DAA2B;AAC3B,0DAA2B;AAC3B,0DAA2B;AAC3B,sDAAuB;AACvB,sDAAuB;AACvB,6DAA8B;AAC9B,yDAA0B;AAC1B,uDAAwB;AACxB,6DAA8B;AAC9B,2DAA4B;AAC5B,sDAAuB;AACvB,wDAAyB;AACzB,wDAAyB;AACzB,0DAA2B;AAC3B,6DAA8B;AAC9B,mEAAoC;AACpC,+DAAgC","sourcesContent":["export * from \"./component\";\nexport * from \"./currency\";\nexport * from \"./dataSourceJson\";\nexport * from \"./dataSourceUrl\";\nexport * from \"./hidden\";\nexport * from \"./inputTags\";\nexport * from \"./multiple\";\nexport * from \"./password\";\nexport * from \"./select\";\nexport * from \"./tableView\";\nexport * from \"./textarea\";\nexport * from \"./errorMessage\";\nexport * from \"./errorLabel\";\nexport * from \"./minWords\";\nexport * from \"./maxWords\";\nexport * from \"./validate\";\nexport * from \"./form\";\nexport * from \"./tabs\";\nexport * from \"./placeholder\";\nexport * from \"./tooltip\";\nexport * from \"./label\";\nexport * from \"./customClass\";\nexport * from \"./modalEdit\";\nexport * from \"./mask\";\nexport * from \"./prefix\";\nexport * from \"./suffix\";\nexport * from \"./textCase\";\nexport * from \"./conditional\";\nexport * from \"./customConditional\";\nexport * from \"./openWhenEmpty\";\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
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_1 = require("./component");
|
|
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_1.Component)({
|
|
16
|
+
...props,
|
|
17
|
+
tableView: false,
|
|
18
|
+
storeas: "array",
|
|
19
|
+
type: "tags"
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
exports.InputTags = InputTags;
|
|
23
|
+
//# sourceMappingURL=inputTags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inputTags.js","sourceRoot":"","sources":["../../../src/decorators/inputTags.ts"],"names":[],"mappings":";;;AAAA,qCAAyC;AACzC,yCAA0C;AAC1C,2CAAsC;AACtC;;;;;;GAMG;AACH,SAAgB,SAAS,CAAC,QAA6B,EAAE;IACvD,OAAO,IAAA,oBAAa,EAClB,IAAA,qBAAY,EAAC,MAAM,CAAC,EACpB,IAAA,qBAAS,EAAC;QACR,GAAG,KAAK;QACR,SAAS,EAAE,KAAK;QAChB,OAAO,EAAE,OAAO;QAChB,IAAI,EAAE,MAAM;KACb,CAAC,CACH,CAAC;AACJ,CAAC;AAVD,8BAUC","sourcesContent":["import {useDecorators} from \"@tsed/core\";\nimport {CollectionOf} from \"@tsed/schema\";\nimport {Component} from \"./component\";\n/**\n * Configure the property as Tags component.\n * @decorator\n * @formio\n * @property\n * @schema\n */\nexport function InputTags(props: Record<string, any> = {}): PropertyDecorator {\n return useDecorators(\n CollectionOf(String),\n Component({\n ...props,\n tableView: false,\n storeas: \"array\",\n type: \"tags\"\n })\n );\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Label = void 0;
|
|
4
|
+
const component_1 = require("./component");
|
|
5
|
+
/**
|
|
6
|
+
* Change the label field
|
|
7
|
+
* @decorator
|
|
8
|
+
* @formio
|
|
9
|
+
* @property
|
|
10
|
+
* @schema
|
|
11
|
+
* @param label
|
|
12
|
+
*/
|
|
13
|
+
function Label(label) {
|
|
14
|
+
return (0, component_1.Component)({
|
|
15
|
+
label
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
exports.Label = Label;
|
|
19
|
+
//# sourceMappingURL=label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.js","sourceRoot":"","sources":["../../../src/decorators/label.ts"],"names":[],"mappings":";;;AAAA,2CAAsC;AAEtC;;;;;;;GAOG;AACH,SAAgB,KAAK,CAAC,KAAa;IACjC,OAAO,IAAA,qBAAS,EAAC;QACf,KAAK;KACN,CAAC,CAAC;AACL,CAAC;AAJD,sBAIC","sourcesContent":["import {Component} from \"./component\";\n\n/**\n * Change the label field\n * @decorator\n * @formio\n * @property\n * @schema\n * @param label\n */\nexport function Label(label: string) {\n return Component({\n label\n });\n}\n"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Masks = exports.Mask = void 0;
|
|
4
|
+
const component_1 = require("./component");
|
|
5
|
+
/**
|
|
6
|
+
* An input mask helps the user with input by ensuring a predefined format.
|
|
7
|
+
*
|
|
8
|
+
* - 9: numeric
|
|
9
|
+
* - a: alphabetical
|
|
10
|
+
* - *: alphanumeric
|
|
11
|
+
*
|
|
12
|
+
* Example telephone mask: (999) 999-9999
|
|
13
|
+
*
|
|
14
|
+
* See the [jquery.inputmask](https://github.com/RobinHerbots/Inputmask) documentation for more information.
|
|
15
|
+
*
|
|
16
|
+
* @decorator
|
|
17
|
+
* @formio
|
|
18
|
+
* @property
|
|
19
|
+
* @schema
|
|
20
|
+
*/
|
|
21
|
+
function Mask(inputMask, inputMaskPlaceholderChar = "") {
|
|
22
|
+
return (0, component_1.Component)({
|
|
23
|
+
inputMask,
|
|
24
|
+
inputMaskPlaceholderChar
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
exports.Mask = Mask;
|
|
28
|
+
/**
|
|
29
|
+
* An input mask helps the user with input by ensuring a predefined format.
|
|
30
|
+
*
|
|
31
|
+
* - 9: numeric
|
|
32
|
+
* - a: alphabetical
|
|
33
|
+
* - *: alphanumeric
|
|
34
|
+
*
|
|
35
|
+
* Example telephone mask: (999) 999-9999
|
|
36
|
+
*
|
|
37
|
+
* See the [jquery.inputmask](https://github.com/RobinHerbots/Inputmask) documentation for more information.
|
|
38
|
+
*
|
|
39
|
+
* @decorator
|
|
40
|
+
* @formio
|
|
41
|
+
* @property
|
|
42
|
+
* @schema
|
|
43
|
+
*/
|
|
44
|
+
function Masks(...inputMasks) {
|
|
45
|
+
return (0, component_1.Component)({
|
|
46
|
+
inputMasks
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
exports.Masks = Masks;
|
|
50
|
+
//# sourceMappingURL=mask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mask.js","sourceRoot":"","sources":["../../../src/decorators/mask.ts"],"names":[],"mappings":";;;AAAA,2CAAsC;AAEtC;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,IAAI,CAAC,SAAiB,EAAE,2BAAmC,EAAE;IAC3E,OAAO,IAAA,qBAAS,EAAC;QACf,SAAS;QACT,wBAAwB;KACzB,CAAC,CAAC;AACL,CAAC;AALD,oBAKC;AAED;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,KAAK,CAAC,GAAG,UAA2C;IAClE,OAAO,IAAA,qBAAS,EAAC;QACf,UAAU;KACX,CAAC,CAAC;AACL,CAAC;AAJD,sBAIC","sourcesContent":["import {Component} from \"./component\";\n\n/**\n * An input mask helps the user with input by ensuring a predefined format.\n *\n * - 9: numeric\n * - a: alphabetical\n * - *: alphanumeric\n *\n * Example telephone mask: (999) 999-9999\n *\n * See the [jquery.inputmask](https://github.com/RobinHerbots/Inputmask) documentation for more information.\n *\n * @decorator\n * @formio\n * @property\n * @schema\n */\nexport function Mask(inputMask: string, inputMaskPlaceholderChar: string = \"\") {\n return Component({\n inputMask,\n inputMaskPlaceholderChar\n });\n}\n\n/**\n * An input mask helps the user with input by ensuring a predefined format.\n *\n * - 9: numeric\n * - a: alphabetical\n * - *: alphanumeric\n *\n * Example telephone mask: (999) 999-9999\n *\n * See the [jquery.inputmask](https://github.com/RobinHerbots/Inputmask) documentation for more information.\n *\n * @decorator\n * @formio\n * @property\n * @schema\n */\nexport function Masks(...inputMasks: {label: string; mask: string}[]) {\n return Component({\n inputMasks\n });\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MaxWords = void 0;
|
|
4
|
+
const validate_1 = require("./validate");
|
|
5
|
+
/**
|
|
6
|
+
* Add the minimum amount of words that can be added to this field.
|
|
7
|
+
* @decorator
|
|
8
|
+
* @formio
|
|
9
|
+
* @property
|
|
10
|
+
* @schema
|
|
11
|
+
* @param value
|
|
12
|
+
*/
|
|
13
|
+
function MaxWords(value) {
|
|
14
|
+
return (0, validate_1.Validate)("maxWords", value);
|
|
15
|
+
}
|
|
16
|
+
exports.MaxWords = MaxWords;
|
|
17
|
+
//# sourceMappingURL=maxWords.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maxWords.js","sourceRoot":"","sources":["../../../src/decorators/maxWords.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AAEpC;;;;;;;GAOG;AACH,SAAgB,QAAQ,CAAC,KAAa;IACpC,OAAO,IAAA,mBAAQ,EAAC,UAAU,EAAE,KAAK,CAAC,CAAC;AACrC,CAAC;AAFD,4BAEC","sourcesContent":["import {Validate} from \"./validate\";\n\n/**\n * Add the minimum amount of words that can be added to this field.\n * @decorator\n * @formio\n * @property\n * @schema\n * @param value\n */\nexport function MaxWords(value: number) {\n return Validate(\"maxWords\", value);\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MinWords = void 0;
|
|
4
|
+
const validate_1 = require("./validate");
|
|
5
|
+
/**
|
|
6
|
+
* Add the maximum amount of words that can be added to this field.
|
|
7
|
+
* @decorator
|
|
8
|
+
* @formio
|
|
9
|
+
* @property
|
|
10
|
+
* @schema
|
|
11
|
+
* @param value
|
|
12
|
+
*/
|
|
13
|
+
function MinWords(value) {
|
|
14
|
+
return (0, validate_1.Validate)("minWords", value);
|
|
15
|
+
}
|
|
16
|
+
exports.MinWords = MinWords;
|
|
17
|
+
//# sourceMappingURL=minWords.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minWords.js","sourceRoot":"","sources":["../../../src/decorators/minWords.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AAEpC;;;;;;;GAOG;AACH,SAAgB,QAAQ,CAAC,KAAa;IACpC,OAAO,IAAA,mBAAQ,EAAC,UAAU,EAAE,KAAK,CAAC,CAAC;AACrC,CAAC;AAFD,4BAEC","sourcesContent":["import {Validate} from \"./validate\";\n\n/**\n * Add the maximum amount of words that can be added to this field.\n * @decorator\n * @formio\n * @property\n * @schema\n * @param value\n */\nexport function MinWords(value: number) {\n return Validate(\"minWords\", value);\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ModalEdit = void 0;
|
|
4
|
+
const component_1 = require("./component");
|
|
5
|
+
/**
|
|
6
|
+
* Opens up a modal to edit the value of this component.
|
|
7
|
+
* @decorator
|
|
8
|
+
* @formio
|
|
9
|
+
* @property
|
|
10
|
+
* @schema
|
|
11
|
+
*/
|
|
12
|
+
function ModalEdit(modalEdit = true) {
|
|
13
|
+
return (0, component_1.Component)({
|
|
14
|
+
modalEdit
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
exports.ModalEdit = ModalEdit;
|
|
18
|
+
//# sourceMappingURL=modalEdit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modalEdit.js","sourceRoot":"","sources":["../../../src/decorators/modalEdit.ts"],"names":[],"mappings":";;;AAAA,2CAAsC;AAEtC;;;;;;GAMG;AACH,SAAgB,SAAS,CAAC,SAAS,GAAG,IAAI;IACxC,OAAO,IAAA,qBAAS,EAAC;QACf,SAAS;KACV,CAAC,CAAC;AACL,CAAC;AAJD,8BAIC","sourcesContent":["import {Component} from \"./component\";\n\n/**\n * Opens up a modal to edit the value of this component.\n * @decorator\n * @formio\n * @property\n * @schema\n */\nexport function ModalEdit(modalEdit = true) {\n return Component({\n modalEdit\n });\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Multiple = void 0;
|
|
4
|
+
const component_1 = require("./component");
|
|
5
|
+
/**
|
|
6
|
+
* Change the multiple value on the decorated property.
|
|
7
|
+
* @decorator
|
|
8
|
+
* @formio
|
|
9
|
+
* @property
|
|
10
|
+
* @schema
|
|
11
|
+
*/
|
|
12
|
+
function Multiple(multiple = false) {
|
|
13
|
+
return (0, component_1.Component)({
|
|
14
|
+
multiple
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
exports.Multiple = Multiple;
|
|
18
|
+
//# sourceMappingURL=multiple.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiple.js","sourceRoot":"","sources":["../../../src/decorators/multiple.ts"],"names":[],"mappings":";;;AAAA,2CAAsC;AAEtC;;;;;;GAMG;AACH,SAAgB,QAAQ,CAAC,QAAQ,GAAG,KAAK;IACvC,OAAO,IAAA,qBAAS,EAAC;QACf,QAAQ;KACT,CAAC,CAAC;AACL,CAAC;AAJD,4BAIC","sourcesContent":["import {Component} from \"./component\";\n\n/**\n * Change the multiple value on the decorated property.\n * @decorator\n * @formio\n * @property\n * @schema\n */\nexport function Multiple(multiple = false): PropertyDecorator {\n return Component({\n multiple\n });\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OpenWhenEmpty = void 0;
|
|
4
|
+
const component_1 = require("./component");
|
|
5
|
+
/**
|
|
6
|
+
* Open automatically the editgrid when the list is empty.
|
|
7
|
+
* @decorator
|
|
8
|
+
* @formio
|
|
9
|
+
* @property
|
|
10
|
+
* @schema
|
|
11
|
+
*/
|
|
12
|
+
function OpenWhenEmpty(openWhenEmpty = true) {
|
|
13
|
+
return (0, component_1.Component)({
|
|
14
|
+
openWhenEmpty
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
exports.OpenWhenEmpty = OpenWhenEmpty;
|
|
18
|
+
//# sourceMappingURL=openWhenEmpty.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openWhenEmpty.js","sourceRoot":"","sources":["../../../src/decorators/openWhenEmpty.ts"],"names":[],"mappings":";;;AAAA,2CAAsC;AAEtC;;;;;;GAMG;AACH,SAAgB,aAAa,CAAC,aAAa,GAAG,IAAI;IAChD,OAAO,IAAA,qBAAS,EAAC;QACf,aAAa;KACd,CAAC,CAAC;AACL,CAAC;AAJD,sCAIC","sourcesContent":["import {Component} from \"./component\";\n\n/**\n * Open automatically the editgrid when the list is empty.\n * @decorator\n * @formio\n * @property\n * @schema\n */\nexport function OpenWhenEmpty(openWhenEmpty = true): PropertyDecorator {\n return Component({\n openWhenEmpty\n });\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Password = void 0;
|
|
4
|
+
const component_1 = require("./component");
|
|
5
|
+
/**
|
|
6
|
+
* Configure the property as Password component.
|
|
7
|
+
* @decorator
|
|
8
|
+
* @formio
|
|
9
|
+
* @property
|
|
10
|
+
* @schema
|
|
11
|
+
*/
|
|
12
|
+
function Password(props = {}) {
|
|
13
|
+
return (0, component_1.Component)({
|
|
14
|
+
...props,
|
|
15
|
+
type: "password",
|
|
16
|
+
protected: true
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
exports.Password = Password;
|
|
20
|
+
//# sourceMappingURL=password.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"password.js","sourceRoot":"","sources":["../../../src/decorators/password.ts"],"names":[],"mappings":";;;AAAA,2CAAsC;AAMtC;;;;;;GAMG;AACH,SAAgB,QAAQ,CAAC,QAAsB,EAAE;IAC/C,OAAO,IAAA,qBAAS,EAAC;QACf,GAAG,KAAK;QACR,IAAI,EAAE,UAAU;QAChB,SAAS,EAAE,IAAI;KAChB,CAAC,CAAC;AACL,CAAC;AAND,4BAMC","sourcesContent":["import {Component} from \"./component\";\n\nexport interface PasswordOpts extends Record<string, any> {\n showCharCount?: boolean;\n showWordCount?: boolean;\n}\n/**\n * Configure the property as Password component.\n * @decorator\n * @formio\n * @property\n * @schema\n */\nexport function Password(props: PasswordOpts = {}): PropertyDecorator {\n return Component({\n ...props,\n type: \"password\",\n protected: true\n });\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Placeholder = void 0;
|
|
4
|
+
const component_1 = require("./component");
|
|
5
|
+
/**
|
|
6
|
+
* The placeholder text that will appear when this field is empty.
|
|
7
|
+
* @decorator
|
|
8
|
+
* @formio
|
|
9
|
+
* @property
|
|
10
|
+
* @schema
|
|
11
|
+
* @param placeholder
|
|
12
|
+
*/
|
|
13
|
+
function Placeholder(placeholder) {
|
|
14
|
+
return (0, component_1.Component)({
|
|
15
|
+
placeholder
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
exports.Placeholder = Placeholder;
|
|
19
|
+
//# sourceMappingURL=placeholder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placeholder.js","sourceRoot":"","sources":["../../../src/decorators/placeholder.ts"],"names":[],"mappings":";;;AAAA,2CAAsC;AAEtC;;;;;;;GAOG;AACH,SAAgB,WAAW,CAAC,WAAmB;IAC7C,OAAO,IAAA,qBAAS,EAAC;QACf,WAAW;KACZ,CAAC,CAAC;AACL,CAAC;AAJD,kCAIC","sourcesContent":["import {Component} from \"./component\";\n\n/**\n * The placeholder text that will appear when this field is empty.\n * @decorator\n * @formio\n * @property\n * @schema\n * @param placeholder\n */\nexport function Placeholder(placeholder: string) {\n return Component({\n placeholder\n });\n}\n"]}
|