@tsed/schema-formio 8.11.1 → 8.11.2-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/components/anyToComponent.js +0 -1
- package/lib/esm/components/arrayToComponent.js +0 -1
- package/lib/esm/components/booleanToComponent.js +0 -1
- package/lib/esm/components/dateToComponent.js +0 -1
- package/lib/esm/components/defaultToComponent.js +0 -1
- package/lib/esm/components/enumToComponent.js +0 -1
- package/lib/esm/components/mapToComponent.js +0 -1
- package/lib/esm/components/nestedToComponent.js +0 -1
- package/lib/esm/components/numberToComponent.js +0 -1
- package/lib/esm/components/objectToEditGrid.js +0 -1
- package/lib/esm/components/panelToComponent.js +0 -1
- package/lib/esm/components/propertiesToComponents.js +0 -1
- package/lib/esm/components/stringToComponent.js +0 -1
- package/lib/esm/decorators/component.js +0 -1
- package/lib/esm/decorators/conditional.js +0 -1
- package/lib/esm/decorators/currency.js +0 -1
- package/lib/esm/decorators/customClass.js +0 -1
- package/lib/esm/decorators/customConditional.js +0 -1
- package/lib/esm/decorators/dataSourceJson.js +0 -1
- package/lib/esm/decorators/dataSourceUrl.js +0 -1
- package/lib/esm/decorators/errorLabel.js +0 -1
- package/lib/esm/decorators/errorMessage.js +0 -1
- package/lib/esm/decorators/form.js +0 -1
- package/lib/esm/decorators/hidden.js +0 -1
- package/lib/esm/decorators/inputTags.js +0 -1
- package/lib/esm/decorators/label.js +0 -1
- package/lib/esm/decorators/mask.js +0 -1
- package/lib/esm/decorators/maxWords.js +0 -1
- package/lib/esm/decorators/minWords.js +0 -1
- package/lib/esm/decorators/modalEdit.js +0 -1
- package/lib/esm/decorators/multiple.js +0 -1
- package/lib/esm/decorators/openWhenEmpty.js +0 -1
- package/lib/esm/decorators/password.js +0 -1
- package/lib/esm/decorators/placeholder.js +0 -1
- package/lib/esm/decorators/prefix.js +0 -1
- package/lib/esm/decorators/select.js +0 -1
- package/lib/esm/decorators/suffix.js +0 -1
- package/lib/esm/decorators/tableView.js +0 -1
- package/lib/esm/decorators/tabs.js +0 -1
- package/lib/esm/decorators/textCase.js +0 -1
- package/lib/esm/decorators/textarea.js +0 -1
- package/lib/esm/decorators/tooltip.js +0 -1
- package/lib/esm/decorators/validate.js +0 -1
- package/lib/esm/index.js +0 -1
- package/lib/esm/interfaces/FormioDataResolver.js +0 -1
- package/lib/esm/registries/FormioMappersContainer.js +0 -1
- package/lib/esm/registries/FormsContainer.js +0 -1
- package/lib/esm/utils/getFormioProps.js +0 -1
- package/lib/esm/utils/getFormioSchema.js +0 -1
- package/lib/esm/utils/getRef.js +0 -1
- package/package.json +14 -12
- package/lib/browser/components/anyToComponent.js +0 -23
- package/lib/browser/components/anyToComponent.js.map +0 -1
- package/lib/browser/components/arrayToComponent.js +0 -36
- package/lib/browser/components/arrayToComponent.js.map +0 -1
- package/lib/browser/components/booleanToComponent.js +0 -12
- package/lib/browser/components/booleanToComponent.js.map +0 -1
- package/lib/browser/components/dateToComponent.js +0 -57
- package/lib/browser/components/dateToComponent.js.map +0 -1
- package/lib/browser/components/defaultToComponent.js +0 -17
- package/lib/browser/components/defaultToComponent.js.map +0 -1
- package/lib/browser/components/enumToComponent.js +0 -27
- package/lib/browser/components/enumToComponent.js.map +0 -1
- package/lib/browser/components/mapToComponent.js +0 -19
- package/lib/browser/components/mapToComponent.js.map +0 -1
- package/lib/browser/components/nestedToComponent.js +0 -24
- package/lib/browser/components/nestedToComponent.js.map +0 -1
- package/lib/browser/components/numberToComponent.js +0 -20
- package/lib/browser/components/numberToComponent.js.map +0 -1
- package/lib/browser/components/objectToEditGrid.js +0 -15
- package/lib/browser/components/objectToEditGrid.js.map +0 -1
- package/lib/browser/components/panelToComponent.js +0 -15
- package/lib/browser/components/panelToComponent.js.map +0 -1
- package/lib/browser/components/propertiesToComponents.js +0 -66
- package/lib/browser/components/propertiesToComponents.js.map +0 -1
- package/lib/browser/components/stringToComponent.js +0 -42
- package/lib/browser/components/stringToComponent.js.map +0 -1
- package/lib/browser/decorators/component.js +0 -18
- package/lib/browser/decorators/component.js.map +0 -1
- package/lib/browser/decorators/conditional.js +0 -26
- package/lib/browser/decorators/conditional.js.map +0 -1
- package/lib/browser/decorators/currency.js +0 -16
- package/lib/browser/decorators/currency.js.map +0 -1
- package/lib/browser/decorators/customClass.js +0 -10
- package/lib/browser/decorators/customClass.js.map +0 -1
- package/lib/browser/decorators/customConditional.js +0 -16
- package/lib/browser/decorators/customConditional.js.map +0 -1
- package/lib/browser/decorators/dataSourceJson.js +0 -20
- package/lib/browser/decorators/dataSourceJson.js.map +0 -1
- package/lib/browser/decorators/dataSourceUrl.js +0 -15
- package/lib/browser/decorators/dataSourceUrl.js.map +0 -1
- package/lib/browser/decorators/errorLabel.js +0 -10
- package/lib/browser/decorators/errorLabel.js.map +0 -1
- package/lib/browser/decorators/errorMessage.js +0 -8
- package/lib/browser/decorators/errorMessage.js.map +0 -1
- package/lib/browser/decorators/form.js +0 -20
- package/lib/browser/decorators/form.js.map +0 -1
- package/lib/browser/decorators/hidden.js +0 -10
- package/lib/browser/decorators/hidden.js.map +0 -1
- package/lib/browser/decorators/inputTags.js +0 -18
- package/lib/browser/decorators/inputTags.js.map +0 -1
- package/lib/browser/decorators/label.js +0 -11
- package/lib/browser/decorators/label.js.map +0 -1
- package/lib/browser/decorators/mask.js +0 -17
- package/lib/browser/decorators/mask.js.map +0 -1
- package/lib/browser/decorators/maxWords.js +0 -8
- package/lib/browser/decorators/maxWords.js.map +0 -1
- package/lib/browser/decorators/minWords.js +0 -8
- package/lib/browser/decorators/minWords.js.map +0 -1
- package/lib/browser/decorators/modalEdit.js +0 -10
- package/lib/browser/decorators/modalEdit.js.map +0 -1
- package/lib/browser/decorators/multiple.js +0 -10
- package/lib/browser/decorators/multiple.js.map +0 -1
- package/lib/browser/decorators/openWhenEmpty.js +0 -10
- package/lib/browser/decorators/openWhenEmpty.js.map +0 -1
- package/lib/browser/decorators/password.js +0 -12
- package/lib/browser/decorators/password.js.map +0 -1
- package/lib/browser/decorators/placeholder.js +0 -10
- package/lib/browser/decorators/placeholder.js.map +0 -1
- package/lib/browser/decorators/prefix.js +0 -10
- package/lib/browser/decorators/prefix.js.map +0 -1
- package/lib/browser/decorators/select.js +0 -14
- package/lib/browser/decorators/select.js.map +0 -1
- package/lib/browser/decorators/suffix.js +0 -10
- package/lib/browser/decorators/suffix.js.map +0 -1
- package/lib/browser/decorators/tableView.js +0 -10
- package/lib/browser/decorators/tableView.js.map +0 -1
- package/lib/browser/decorators/tabs.js +0 -14
- package/lib/browser/decorators/tabs.js.map +0 -1
- package/lib/browser/decorators/textCase.js +0 -10
- package/lib/browser/decorators/textCase.js.map +0 -1
- package/lib/browser/decorators/textarea.js +0 -12
- package/lib/browser/decorators/textarea.js.map +0 -1
- package/lib/browser/decorators/tooltip.js +0 -10
- package/lib/browser/decorators/tooltip.js.map +0 -1
- package/lib/browser/decorators/validate.js +0 -12
- package/lib/browser/decorators/validate.js.map +0 -1
- package/lib/browser/index.js +0 -102
- package/lib/browser/index.js.map +0 -1
- package/lib/browser/registries/FormioMappersContainer.js +0 -18
- package/lib/browser/registries/FormioMappersContainer.js.map +0 -1
- package/lib/browser/registries/FormsContainer.js +0 -5
- package/lib/browser/registries/FormsContainer.js.map +0 -1
- package/lib/browser/utils/getFormioProps.js +0 -10
- package/lib/browser/utils/getFormioProps.js.map +0 -1
- package/lib/browser/utils/getFormioSchema.js +0 -45
- package/lib/browser/utils/getFormioSchema.js.map +0 -1
- package/lib/browser/utils/getRef.js +0 -8
- package/lib/browser/utils/getRef.js.map +0 -1
- package/lib/esm/components/anyToComponent.js.map +0 -1
- package/lib/esm/components/arrayToComponent.js.map +0 -1
- package/lib/esm/components/booleanToComponent.js.map +0 -1
- package/lib/esm/components/dateToComponent.js.map +0 -1
- package/lib/esm/components/defaultToComponent.js.map +0 -1
- package/lib/esm/components/enumToComponent.js.map +0 -1
- package/lib/esm/components/mapToComponent.js.map +0 -1
- package/lib/esm/components/nestedToComponent.js.map +0 -1
- package/lib/esm/components/numberToComponent.js.map +0 -1
- package/lib/esm/components/objectToEditGrid.js.map +0 -1
- package/lib/esm/components/panelToComponent.js.map +0 -1
- package/lib/esm/components/propertiesToComponents.js.map +0 -1
- package/lib/esm/components/stringToComponent.js.map +0 -1
- package/lib/esm/decorators/component.js.map +0 -1
- package/lib/esm/decorators/conditional.js.map +0 -1
- package/lib/esm/decorators/currency.js.map +0 -1
- package/lib/esm/decorators/customClass.js.map +0 -1
- package/lib/esm/decorators/customConditional.js.map +0 -1
- package/lib/esm/decorators/dataSourceJson.js.map +0 -1
- package/lib/esm/decorators/dataSourceUrl.js.map +0 -1
- package/lib/esm/decorators/errorLabel.js.map +0 -1
- package/lib/esm/decorators/errorMessage.js.map +0 -1
- package/lib/esm/decorators/form.js.map +0 -1
- package/lib/esm/decorators/hidden.js.map +0 -1
- package/lib/esm/decorators/inputTags.js.map +0 -1
- package/lib/esm/decorators/label.js.map +0 -1
- package/lib/esm/decorators/mask.js.map +0 -1
- package/lib/esm/decorators/maxWords.js.map +0 -1
- package/lib/esm/decorators/minWords.js.map +0 -1
- package/lib/esm/decorators/modalEdit.js.map +0 -1
- package/lib/esm/decorators/multiple.js.map +0 -1
- package/lib/esm/decorators/openWhenEmpty.js.map +0 -1
- package/lib/esm/decorators/password.js.map +0 -1
- package/lib/esm/decorators/placeholder.js.map +0 -1
- package/lib/esm/decorators/prefix.js.map +0 -1
- package/lib/esm/decorators/select.js.map +0 -1
- package/lib/esm/decorators/suffix.js.map +0 -1
- package/lib/esm/decorators/tableView.js.map +0 -1
- package/lib/esm/decorators/tabs.js.map +0 -1
- package/lib/esm/decorators/textCase.js.map +0 -1
- package/lib/esm/decorators/textarea.js.map +0 -1
- package/lib/esm/decorators/tooltip.js.map +0 -1
- package/lib/esm/decorators/validate.js.map +0 -1
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/interfaces/FormioDataResolver.js.map +0 -1
- package/lib/esm/registries/FormioMappersContainer.js.map +0 -1
- package/lib/esm/registries/FormsContainer.js.map +0 -1
- package/lib/esm/utils/getFormioProps.js.map +0 -1
- package/lib/esm/utils/getFormioSchema.js.map +0 -1
- package/lib/esm/utils/getRef.js.map +0 -1
- package/src/components/anyToComponent.ts +0 -28
- package/src/components/arrayToComponent.ts +0 -43
- package/src/components/booleanToComponent.ts +0 -15
- package/src/components/dateToComponent.ts +0 -66
- package/src/components/defaultToComponent.ts +0 -17
- package/src/components/enumToComponent.ts +0 -33
- package/src/components/mapToComponent.ts +0 -17
- package/src/components/nestedToComponent.ts +0 -23
- package/src/components/numberToComponent.ts +0 -20
- package/src/components/objectToEditGrid.ts +0 -13
- package/src/components/panelToComponent.ts +0 -13
- package/src/components/propertiesToComponents.ts +0 -106
- package/src/components/stringToComponent.ts +0 -44
- package/src/decorators/component.ts +0 -34
- package/src/decorators/conditional.spec.ts +0 -73
- package/src/decorators/conditional.ts +0 -49
- package/src/decorators/currency.spec.ts +0 -40
- package/src/decorators/currency.ts +0 -19
- package/src/decorators/customClass.spec.ts +0 -35
- package/src/decorators/customClass.ts +0 -14
- package/src/decorators/customConditional.spec.ts +0 -95
- package/src/decorators/customConditional.ts +0 -85
- package/src/decorators/dataSourceJson.spec.ts +0 -88
- package/src/decorators/dataSourceJson.ts +0 -26
- package/src/decorators/dataSourceUrl.spec.ts +0 -111
- package/src/decorators/dataSourceUrl.ts +0 -19
- package/src/decorators/errorLabel.spec.ts +0 -35
- package/src/decorators/errorLabel.ts +0 -14
- package/src/decorators/errorMessage.spec.ts +0 -35
- package/src/decorators/errorMessage.ts +0 -13
- package/src/decorators/form.ts +0 -25
- package/src/decorators/hidden.spec.ts +0 -35
- package/src/decorators/hidden.ts +0 -18
- package/src/decorators/inputTags.spec.ts +0 -36
- package/src/decorators/inputTags.ts +0 -22
- package/src/decorators/label.spec.ts +0 -34
- package/src/decorators/label.ts +0 -21
- package/src/decorators/mask.spec.ts +0 -105
- package/src/decorators/mask.ts +0 -46
- package/src/decorators/maxWords.spec.ts +0 -35
- package/src/decorators/maxWords.ts +0 -13
- package/src/decorators/minWords.spec.ts +0 -35
- package/src/decorators/minWords.ts +0 -13
- package/src/decorators/modalEdit.spec.ts +0 -35
- package/src/decorators/modalEdit.ts +0 -14
- package/src/decorators/multiple.spec.ts +0 -35
- package/src/decorators/multiple.ts +0 -14
- package/src/decorators/openWhenEmpty.ts +0 -14
- package/src/decorators/password.spec.ts +0 -35
- package/src/decorators/password.ts +0 -20
- package/src/decorators/placeholder.spec.ts +0 -35
- package/src/decorators/placeholder.ts +0 -15
- package/src/decorators/prefix.spec.ts +0 -35
- package/src/decorators/prefix.ts +0 -14
- package/src/decorators/select.spec.ts +0 -82
- package/src/decorators/select.ts +0 -25
- package/src/decorators/suffix.spec.ts +0 -35
- package/src/decorators/suffix.ts +0 -14
- package/src/decorators/tableView.spec.ts +0 -35
- package/src/decorators/tableView.ts +0 -15
- package/src/decorators/tabs.ts +0 -18
- package/src/decorators/textCase.spec.ts +0 -35
- package/src/decorators/textCase.ts +0 -15
- package/src/decorators/textarea.spec.ts +0 -35
- package/src/decorators/textarea.ts +0 -21
- package/src/decorators/tooltip.spec.ts +0 -35
- package/src/decorators/tooltip.ts +0 -15
- package/src/decorators/validate.ts +0 -18
- package/src/index.ts +0 -52
- package/src/interfaces/FormioDataResolver.ts +0 -5
- package/src/registries/FormioMappersContainer.ts +0 -21
- package/src/registries/FormsContainer.ts +0 -4
- package/src/utils/getFormioProps.ts +0 -12
- package/src/utils/getFormioSchema.spec.ts +0 -84
- package/src/utils/getFormioSchema.ts +0 -62
- package/src/utils/getRef.ts +0 -8
- package/vite.config.mts +0 -45
- package/vitest.config.mts +0 -21
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"textCase.js","sourceRoot":"","sources":["../../../src/decorators/textCase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAEzC;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ,CAAC,QAAmC;IAC1D,OAAO,SAAS,CAAC;QACf,IAAI,EAAE,QAAQ;KACf,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.js","sourceRoot":"","sources":["../../../src/decorators/textarea.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAOzC;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,QAAsB,EAAE;IAC/C,OAAO,SAAS,CAAC;QACf,UAAU,EAAE,KAAK;QACjB,GAAG,KAAK;QACR,IAAI,EAAE,UAAU;KACjB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../../src/decorators/tooltip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAEzC;;;;;;;GAOG;AACH,MAAM,UAAU,OAAO,CAAC,OAAe;IACrC,OAAO,SAAS,CAAC;QACf,OAAO;KACR,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../src/decorators/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAEzC;;;;;;;;GAQG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAW,EAAE,KAAU;IAC9C,OAAO,SAAS,CAAC;QACf,QAAQ,EAAE;YACR,CAAC,GAAG,CAAC,EAAE,KAAK;SACb;KACF,CAAC,CAAC;AACL,CAAC"}
|
package/lib/esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,oCAAoC,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AmB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioDataResolver.js","sourceRoot":"","sources":["../../../src/interfaces/FormioDataResolver.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormioMappersContainer.js","sourceRoot":"","sources":["../../../src/registries/FormioMappersContainer.ts"],"names":[],"mappings":"AAIA,MAAM,sBAAsB,GAA8B,IAAI,GAAG,EAAE,CAAC;AAEpE,MAAM,UAAU,oBAAoB,CAAC,IAAY,EAAE,MAAoB;IACrE,OAAO,sBAAsB,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,uBAAuB;IACvB,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CAAC,UAAU,IAAI,wBAAwB,CAAC,CAAC;IAC1D,CAAC;IACD,OAAO,sBAAsB,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,MAAW,EAAE,OAAY;IAChE,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FormsContainer.js","sourceRoot":"","sources":["../../../src/registries/FormsContainer.ts"],"names":[],"mappings":"AAEA,yCAAyC;AACzC,MAAM,CAAC,MAAM,cAAc,GAAsB,IAAI,GAAG,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getFormioProps.js","sourceRoot":"","sources":["../../../src/utils/getFormioProps.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,cAAc,CAAC,MAAW;IACxC,MAAM,WAAW,GAAQ,MAAM,CAAC,OAAO,CAAC,M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Ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAEpC,MAAM,UAAU,MAAM,CAAC,MAAW,EAAE,OAAY;IAC9C,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;QAChB,OAAO,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;IAC9E,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import {execMapper, registerFormioMapper} from "../registries/FormioMappersContainer.js";
|
|
2
|
-
import {getRef} from "../utils/getRef.js";
|
|
3
|
-
|
|
4
|
-
export function anyToComponent(schema: any, options: any) {
|
|
5
|
-
schema = getRef(schema, options);
|
|
6
|
-
|
|
7
|
-
switch (schema?.type) {
|
|
8
|
-
case "object":
|
|
9
|
-
if (!schema.properties && !schema.$ref) {
|
|
10
|
-
return execMapper("map", schema, options);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return execMapper("nested", schema, options);
|
|
14
|
-
case "array":
|
|
15
|
-
return execMapper("array", schema, options);
|
|
16
|
-
case "string":
|
|
17
|
-
return execMapper("string", schema, options);
|
|
18
|
-
case "boolean":
|
|
19
|
-
return execMapper("boolean", schema, options);
|
|
20
|
-
case "integer":
|
|
21
|
-
case "number":
|
|
22
|
-
return execMapper("number", schema, options);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return {};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
registerFormioMapper("any", anyToComponent);
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import {cleanObject} from "@tsed/core";
|
|
2
|
-
|
|
3
|
-
import {execMapper, registerFormioMapper} from "../registries/FormioMappersContainer.js";
|
|
4
|
-
import {getRef} from "../utils/getRef.js";
|
|
5
|
-
|
|
6
|
-
export function arrayToComponent(schema: any, options: any) {
|
|
7
|
-
const itemSchema = schema.items.$ref ? getRef(schema.items, options) : schema.items;
|
|
8
|
-
|
|
9
|
-
const {type} = itemSchema;
|
|
10
|
-
|
|
11
|
-
switch (type) {
|
|
12
|
-
case "object": // editgrid
|
|
13
|
-
return {
|
|
14
|
-
...execMapper("default", schema, options),
|
|
15
|
-
...execMapper("editgrid", itemSchema, options)
|
|
16
|
-
};
|
|
17
|
-
case "string": // tag or enum?
|
|
18
|
-
if (itemSchema.enum) {
|
|
19
|
-
const component = execMapper("enum", itemSchema, options);
|
|
20
|
-
|
|
21
|
-
return {
|
|
22
|
-
...component,
|
|
23
|
-
inline: false,
|
|
24
|
-
type: "selectboxes"
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const component = execMapper(type, itemSchema, options);
|
|
29
|
-
|
|
30
|
-
return cleanObject({
|
|
31
|
-
...component,
|
|
32
|
-
multiple: component.type === "tags" ? undefined : true
|
|
33
|
-
});
|
|
34
|
-
default:
|
|
35
|
-
case "number":
|
|
36
|
-
return {
|
|
37
|
-
...execMapper(type, itemSchema, options),
|
|
38
|
-
multiple: true
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
registerFormioMapper("array", arrayToComponent);
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import {cleanObject} from "@tsed/core";
|
|
2
|
-
|
|
3
|
-
import {execMapper, registerFormioMapper} from "../registries/FormioMappersContainer.js";
|
|
4
|
-
|
|
5
|
-
function booleanToComponent(schema: any, options: any) {
|
|
6
|
-
const component = execMapper("default", schema, options);
|
|
7
|
-
|
|
8
|
-
return cleanObject({
|
|
9
|
-
...component,
|
|
10
|
-
input: true,
|
|
11
|
-
type: component.type || "checkbox"
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
registerFormioMapper("boolean", booleanToComponent);
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import {getValue} from "@tsed/core";
|
|
2
|
-
|
|
3
|
-
import {execMapper, registerFormioMapper} from "../registries/FormioMappersContainer.js";
|
|
4
|
-
|
|
5
|
-
function dateToComponent(schema: any, options: any) {
|
|
6
|
-
const component = execMapper("default", schema, options);
|
|
7
|
-
|
|
8
|
-
const base = {
|
|
9
|
-
enableMinDateInput: false,
|
|
10
|
-
enableMaxDateInput: false,
|
|
11
|
-
input: true,
|
|
12
|
-
...component,
|
|
13
|
-
type: "datetime",
|
|
14
|
-
datePicker: {
|
|
15
|
-
disableWeekends: false,
|
|
16
|
-
disableWeekdays: false,
|
|
17
|
-
...getValue(component, "datePicker")
|
|
18
|
-
},
|
|
19
|
-
widget: {
|
|
20
|
-
type: "calendar",
|
|
21
|
-
displayInTimezone: "viewer",
|
|
22
|
-
locale: "en",
|
|
23
|
-
useLocaleSettings: false,
|
|
24
|
-
allowInput: true,
|
|
25
|
-
mode: "single",
|
|
26
|
-
noCalendar: false,
|
|
27
|
-
hourIncrement: 1,
|
|
28
|
-
minuteIncrement: 1,
|
|
29
|
-
minDate: null,
|
|
30
|
-
disableWeekends: false,
|
|
31
|
-
disableWeekdays: false,
|
|
32
|
-
maxDate: null,
|
|
33
|
-
...getValue(component, "widget")
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
if (schema.format === "date") {
|
|
38
|
-
return {
|
|
39
|
-
...base,
|
|
40
|
-
format: "yyyy-MM-dd",
|
|
41
|
-
enableTime: false,
|
|
42
|
-
widget: {
|
|
43
|
-
...base.widget,
|
|
44
|
-
enableTime: false,
|
|
45
|
-
format: "yyyy-MM-dd",
|
|
46
|
-
...getValue(component, "widget")
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return {
|
|
52
|
-
...base,
|
|
53
|
-
timePicker: {
|
|
54
|
-
showMeridian: false,
|
|
55
|
-
...getValue(component, "timePicker")
|
|
56
|
-
},
|
|
57
|
-
widget: {
|
|
58
|
-
...base.widget,
|
|
59
|
-
enableTime: true,
|
|
60
|
-
time_24hr: true,
|
|
61
|
-
...getValue(component, "widget")
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
registerFormioMapper("date", dateToComponent);
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import {cleanObject} from "@tsed/core";
|
|
2
|
-
|
|
3
|
-
import {registerFormioMapper} from "../registries/FormioMappersContainer.js";
|
|
4
|
-
import {getFormioProps} from "../utils/getFormioProps.js";
|
|
5
|
-
|
|
6
|
-
export function defaultToComponent(schema: any, options: any): any {
|
|
7
|
-
const formioProps = getFormioProps(schema);
|
|
8
|
-
|
|
9
|
-
return cleanObject({
|
|
10
|
-
...formioProps,
|
|
11
|
-
disabled: !!schema.readOnly,
|
|
12
|
-
description: schema.description,
|
|
13
|
-
defaultValue: schema.default
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
registerFormioMapper("default", defaultToComponent);
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import {cleanObject} from "@tsed/core";
|
|
2
|
-
|
|
3
|
-
import {execMapper, registerFormioMapper} from "../registries/FormioMappersContainer.js";
|
|
4
|
-
|
|
5
|
-
export function enumToComponent(schema: any, options: any) {
|
|
6
|
-
const component = execMapper("default", schema, options);
|
|
7
|
-
const values = schema.enum.map((value: any) => {
|
|
8
|
-
return {
|
|
9
|
-
label: value,
|
|
10
|
-
value
|
|
11
|
-
};
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
if (component.type === "select") {
|
|
15
|
-
return cleanObject({
|
|
16
|
-
...component,
|
|
17
|
-
data: {
|
|
18
|
-
json: component.data?.json || JSON.stringify(values)
|
|
19
|
-
},
|
|
20
|
-
dataSrc: "json",
|
|
21
|
-
idPath: "value",
|
|
22
|
-
valueProperty: "value",
|
|
23
|
-
template: component.template || "<span>{{ item.label }}</span>"
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return cleanObject({
|
|
28
|
-
...component,
|
|
29
|
-
values: schema["x-values"] || values.map((value: any) => ({...value, shortcut: ""}))
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
registerFormioMapper("enum", enumToComponent);
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import {execMapper, registerFormioMapper} from "../registries/FormioMappersContainer.js";
|
|
2
|
-
|
|
3
|
-
export function mapToComponent(schema: any, options: any) {
|
|
4
|
-
return {
|
|
5
|
-
...execMapper("default", schema, options),
|
|
6
|
-
type: "datamap",
|
|
7
|
-
tableView: false,
|
|
8
|
-
input: true,
|
|
9
|
-
valueComponent: {
|
|
10
|
-
...(schema.additionalProperties ? execMapper("any", schema.additionalProperties, options) : {}),
|
|
11
|
-
hideLabel: true,
|
|
12
|
-
tableView: true
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
registerFormioMapper("map", mapToComponent);
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import {sentenceCase} from "change-case";
|
|
2
|
-
|
|
3
|
-
import {execMapper, registerFormioMapper} from "../registries/FormioMappersContainer.js";
|
|
4
|
-
|
|
5
|
-
export function nestedToComponent(schema: any, options: any) {
|
|
6
|
-
return {
|
|
7
|
-
...execMapper("default", schema, options),
|
|
8
|
-
label: false,
|
|
9
|
-
tableView: false,
|
|
10
|
-
type: "form",
|
|
11
|
-
display: "form",
|
|
12
|
-
input: true,
|
|
13
|
-
components: [
|
|
14
|
-
{
|
|
15
|
-
key: "panel",
|
|
16
|
-
label: options.parentKey && sentenceCase(options.parentKey),
|
|
17
|
-
...execMapper("panel", schema, options)
|
|
18
|
-
}
|
|
19
|
-
]
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
registerFormioMapper("nested", nestedToComponent);
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import {cleanObject, getValue} from "@tsed/core";
|
|
2
|
-
|
|
3
|
-
import {execMapper, registerFormioMapper} from "../registries/FormioMappersContainer.js";
|
|
4
|
-
|
|
5
|
-
export function numberToComponent(schema: any, options: any) {
|
|
6
|
-
const component = execMapper("default", schema, options);
|
|
7
|
-
|
|
8
|
-
return cleanObject({
|
|
9
|
-
...component,
|
|
10
|
-
input: true,
|
|
11
|
-
delimiter: getValue(component, "delimiter", false),
|
|
12
|
-
inputFormat: getValue(component, "inputFormat", "plain"),
|
|
13
|
-
mask: getValue(component, "mask", false),
|
|
14
|
-
requireDecimal: false,
|
|
15
|
-
type: "number"
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
registerFormioMapper("number", numberToComponent);
|
|
20
|
-
registerFormioMapper("integer", numberToComponent);
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {execMapper, registerFormioMapper} from "../registries/FormioMappersContainer.js";
|
|
2
|
-
|
|
3
|
-
export function objectToEditGrid(schema: any, options: any) {
|
|
4
|
-
return {
|
|
5
|
-
...execMapper("default", schema, options),
|
|
6
|
-
rowDrafts: false,
|
|
7
|
-
type: "editgrid",
|
|
8
|
-
input: true,
|
|
9
|
-
components: execMapper("properties", schema, options)
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
registerFormioMapper("editgrid", objectToEditGrid);
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {execMapper, registerFormioMapper} from "../registries/FormioMappersContainer.js";
|
|
2
|
-
|
|
3
|
-
export function panelToComponent(schema: any, options: any) {
|
|
4
|
-
return {
|
|
5
|
-
...execMapper("default", schema, options),
|
|
6
|
-
collapsible: false,
|
|
7
|
-
input: false,
|
|
8
|
-
tableView: false,
|
|
9
|
-
components: execMapper("properties", schema, options)
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
registerFormioMapper("panel", panelToComponent);
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import {cleanObject, isFunction} from "@tsed/core";
|
|
2
|
-
import {FormioComponent, FormioForm} from "@tsed/formio-types";
|
|
3
|
-
import {sentenceCase} from "change-case";
|
|
4
|
-
|
|
5
|
-
import {execMapper, registerFormioMapper} from "../registries/FormioMappersContainer.js";
|
|
6
|
-
|
|
7
|
-
function bindResolvers(component: FormioComponent, options: any) {
|
|
8
|
-
if (component.data) {
|
|
9
|
-
const data = {...component.data};
|
|
10
|
-
|
|
11
|
-
Object.entries(data).forEach(([key, resolver]) => {
|
|
12
|
-
if (isFunction(resolver)) {
|
|
13
|
-
options.resolvers.push(async (form: FormioForm) => {
|
|
14
|
-
data[key] = await resolver({...options, component, form});
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
return {
|
|
20
|
-
...component,
|
|
21
|
-
data
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return component;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function mapValidation(key: string, base: FormioComponent, schema: any, propSchema: any) {
|
|
29
|
-
const required = (schema.required || []).includes(key);
|
|
30
|
-
const validate = {
|
|
31
|
-
...(base.validate || {}),
|
|
32
|
-
required,
|
|
33
|
-
pattern: propSchema.pattern,
|
|
34
|
-
minLength: !required || (required && propSchema.minLength > 1) ? propSchema.minLength : undefined,
|
|
35
|
-
maxLength: propSchema.maxLength,
|
|
36
|
-
min: propSchema.minimum || propSchema.minItems,
|
|
37
|
-
max: propSchema.maximum || propSchema.maxItems
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
switch (propSchema.type) {
|
|
41
|
-
case "string":
|
|
42
|
-
if (propSchema.minLength === 0 && validate.required) {
|
|
43
|
-
validate.minLength = undefined;
|
|
44
|
-
validate.required = false;
|
|
45
|
-
}
|
|
46
|
-
break;
|
|
47
|
-
case "boolean":
|
|
48
|
-
validate.required = false;
|
|
49
|
-
break;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
return cleanObject(validate);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export function propertiesToComponents(schema: any, options: any): any[] {
|
|
56
|
-
const tabs = {
|
|
57
|
-
label: "Tabs",
|
|
58
|
-
key: "tabs",
|
|
59
|
-
type: "tabs",
|
|
60
|
-
input: false,
|
|
61
|
-
tableView: false,
|
|
62
|
-
components: new Map<string, any>(),
|
|
63
|
-
pushed: false
|
|
64
|
-
};
|
|
65
|
-
const components: any[] = [];
|
|
66
|
-
|
|
67
|
-
Object.entries(schema.properties).forEach(([key, propSchema]: [string, any]) => {
|
|
68
|
-
const tabsOptions = propSchema["x-formiotabs"];
|
|
69
|
-
const base = execMapper("any", propSchema, {...options, parentKey: key});
|
|
70
|
-
|
|
71
|
-
let component = cleanObject({
|
|
72
|
-
key,
|
|
73
|
-
...base,
|
|
74
|
-
label: base.label == false ? undefined : base.label || propSchema.title || sentenceCase(key),
|
|
75
|
-
validate: mapValidation(key, base, schema, propSchema)
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
component = bindResolvers(component, options);
|
|
79
|
-
|
|
80
|
-
if (tabsOptions) {
|
|
81
|
-
if (!tabs.pushed) {
|
|
82
|
-
components.push(tabs);
|
|
83
|
-
tabs.pushed = true;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
if (!tabs.components.has(tabsOptions.key)) {
|
|
87
|
-
tabs.components.set(tabsOptions.key, {
|
|
88
|
-
...tabsOptions,
|
|
89
|
-
components: []
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
tabs.components.get(tabsOptions.key).components.push(component);
|
|
94
|
-
} else {
|
|
95
|
-
components.push(component);
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
if (tabs.components.size) {
|
|
100
|
-
tabs.components = [...tabs.components.values()] as any;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return components;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
registerFormioMapper("properties", propertiesToComponents);
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import {cleanObject} from "@tsed/core";
|
|
2
|
-
|
|
3
|
-
import {execMapper, registerFormioMapper} from "../registries/FormioMappersContainer.js";
|
|
4
|
-
|
|
5
|
-
export function stringToComponent(schema: any, options: any) {
|
|
6
|
-
if (schema.format) {
|
|
7
|
-
const component = execMapper("default", schema, options);
|
|
8
|
-
switch (schema.format) {
|
|
9
|
-
case "date":
|
|
10
|
-
case "date-time":
|
|
11
|
-
return execMapper("date", schema, options);
|
|
12
|
-
case "uri":
|
|
13
|
-
return cleanObject({
|
|
14
|
-
input: true,
|
|
15
|
-
...component,
|
|
16
|
-
type: component.type || "url"
|
|
17
|
-
});
|
|
18
|
-
default:
|
|
19
|
-
return cleanObject({
|
|
20
|
-
input: true,
|
|
21
|
-
...component,
|
|
22
|
-
type: component.type || schema.format
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (schema.enum) {
|
|
28
|
-
const component = execMapper("enum", schema, options);
|
|
29
|
-
|
|
30
|
-
return {
|
|
31
|
-
...component,
|
|
32
|
-
type: component.type || "radio"
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const component = execMapper("default", schema, options);
|
|
37
|
-
return cleanObject({
|
|
38
|
-
input: true,
|
|
39
|
-
type: component.type || "textfield",
|
|
40
|
-
...component
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
registerFormioMapper("string", stringToComponent);
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import {JsonEntityFn, JsonEntityStore} from "@tsed/schema";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Declare a formio Component schema on the decorated propertyKey.
|
|
5
|
-
* @decorator
|
|
6
|
-
* @formio
|
|
7
|
-
* @property
|
|
8
|
-
* @schema
|
|
9
|
-
*/
|
|
10
|
-
export function Component(component: Record<string, any>): PropertyDecorator {
|
|
11
|
-
component = Object.entries(component).reduce((component: Record<string, any>, [key, value]) => {
|
|
12
|
-
if (key === "validate") {
|
|
13
|
-
component["x-formio-validate"] = {
|
|
14
|
-
...(component["x-formio-validate"] || {}),
|
|
15
|
-
...value
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
return {
|
|
20
|
-
...component,
|
|
21
|
-
[`x-formio-${key}`]: value
|
|
22
|
-
};
|
|
23
|
-
}, {});
|
|
24
|
-
|
|
25
|
-
return JsonEntityFn((store: JsonEntityStore) => {
|
|
26
|
-
Object.entries(component).forEach(([key, value]) => {
|
|
27
|
-
store.itemSchema.customKey(key, value);
|
|
28
|
-
|
|
29
|
-
if (store.isCollection) {
|
|
30
|
-
store.schema.customKey(key, value);
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import {getFormioSchema} from "../utils/getFormioSchema.js";
|
|
2
|
-
import {HideWhen, ShowWhen} from "./conditional.js";
|
|
3
|
-
|
|
4
|
-
describe("@Conditional", () => {
|
|
5
|
-
it("should add conditional rule on field (show)", async () => {
|
|
6
|
-
class Model {
|
|
7
|
-
@ShowWhen("test2", 1)
|
|
8
|
-
test: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
expect(await getFormioSchema(Model)).toEqual({
|
|
12
|
-
access: [],
|
|
13
|
-
components: [
|
|
14
|
-
{
|
|
15
|
-
disabled: false,
|
|
16
|
-
input: true,
|
|
17
|
-
key: "test",
|
|
18
|
-
label: "Test",
|
|
19
|
-
type: "textfield",
|
|
20
|
-
conditional: {
|
|
21
|
-
eq: 1,
|
|
22
|
-
show: true,
|
|
23
|
-
when: "test2"
|
|
24
|
-
},
|
|
25
|
-
validate: {
|
|
26
|
-
required: false
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
],
|
|
30
|
-
display: "form",
|
|
31
|
-
machineName: "model",
|
|
32
|
-
name: "model",
|
|
33
|
-
submissionAccess: [],
|
|
34
|
-
tags: [],
|
|
35
|
-
title: "Model",
|
|
36
|
-
type: "form"
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
it("should add conditional rule on field (hide)", async () => {
|
|
40
|
-
class Model {
|
|
41
|
-
@HideWhen("test2", 1)
|
|
42
|
-
test: string;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
expect(await getFormioSchema(Model)).toEqual({
|
|
46
|
-
access: [],
|
|
47
|
-
components: [
|
|
48
|
-
{
|
|
49
|
-
disabled: false,
|
|
50
|
-
input: true,
|
|
51
|
-
key: "test",
|
|
52
|
-
label: "Test",
|
|
53
|
-
type: "textfield",
|
|
54
|
-
conditional: {
|
|
55
|
-
eq: 1,
|
|
56
|
-
show: false,
|
|
57
|
-
when: "test2"
|
|
58
|
-
},
|
|
59
|
-
validate: {
|
|
60
|
-
required: false
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
],
|
|
64
|
-
display: "form",
|
|
65
|
-
machineName: "model",
|
|
66
|
-
name: "model",
|
|
67
|
-
submissionAccess: [],
|
|
68
|
-
tags: [],
|
|
69
|
-
title: "Model",
|
|
70
|
-
type: "form"
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
});
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import {Component} from "./component.js";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Adds a conditional display rule on the input form.
|
|
5
|
-
* @decorator
|
|
6
|
-
* @formio
|
|
7
|
-
* @property
|
|
8
|
-
* @schema
|
|
9
|
-
* @param conditional
|
|
10
|
-
*/
|
|
11
|
-
export function Conditional(conditional: {show: boolean; when: string; eq: any}) {
|
|
12
|
-
return Component({
|
|
13
|
-
conditional
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Adds a conditional display rule on the input form.
|
|
19
|
-
* @decorator
|
|
20
|
-
* @formio
|
|
21
|
-
* @property
|
|
22
|
-
* @schema
|
|
23
|
-
* @param property
|
|
24
|
-
* @param eq
|
|
25
|
-
*/
|
|
26
|
-
export function ShowWhen(property: string, eq: any) {
|
|
27
|
-
return Conditional({
|
|
28
|
-
show: true,
|
|
29
|
-
when: property,
|
|
30
|
-
eq
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Adds a conditional display rule on the input form.
|
|
36
|
-
* @decorator
|
|
37
|
-
* @formio
|
|
38
|
-
* @property
|
|
39
|
-
* @schema
|
|
40
|
-
* @param property
|
|
41
|
-
* @param eq
|
|
42
|
-
*/
|
|
43
|
-
export function HideWhen(property: string, eq: any) {
|
|
44
|
-
return Conditional({
|
|
45
|
-
show: false,
|
|
46
|
-
when: property,
|
|
47
|
-
eq
|
|
48
|
-
});
|
|
49
|
-
}
|