@openforis/arena-core 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dist/esm/index.js.map +1 -1
  2. package/dist/esm/node/nodePointer.js.map +1 -1
  3. package/dist/esm/node/nodeValueFormatter.js.map +1 -1
  4. package/dist/esm/node/nodeValues.js.map +1 -1
  5. package/dist/esm/nodeDef/factory.js.map +1 -1
  6. package/dist/esm/nodeDef/index.js.map +1 -1
  7. package/dist/esm/nodeDef/nodeDef.js.map +1 -1
  8. package/dist/esm/nodeDef/nodeDefs.js.map +1 -1
  9. package/dist/esm/nodeDef/service.js.map +1 -1
  10. package/dist/esm/nodeDefExpressionEvaluator/context.js.map +1 -1
  11. package/dist/esm/nodeDefExpressionEvaluator/node/identifier.js.map +1 -1
  12. package/dist/esm/record/_records/nodeDefSelfReferences.js.map +1 -1
  13. package/dist/esm/record/_records/recordCompletion.js.map +1 -1
  14. package/dist/esm/record/_records/recordGetters.js.map +1 -1
  15. package/dist/esm/record/recordNodesUpdater/recordNodeDependentsRequiredUpdater.js.map +1 -1
  16. package/dist/esm/record/recordNodesUpdater/recordNodesDependentsUpdaterCommons.js.map +1 -1
  17. package/dist/esm/record/recordValidator/attributeKeyValidator.js.map +1 -1
  18. package/dist/esm/record/recordValidator/attributeTypeValidator.js +1 -1
  19. package/dist/esm/record/recordValidator/attributeTypeValidator.js.map +1 -1
  20. package/dist/esm/record/recordValidator/attributeUniqueValidator.js.map +1 -1
  21. package/dist/esm/record/recordValidator/attributeValidator.js.map +1 -1
  22. package/dist/esm/record/recordValidator/countValidator.js.map +1 -1
  23. package/dist/esm/survey/survey.js.map +1 -1
  24. package/dist/esm/survey/surveys/_nodeDefs/nodeDefsReader.js.map +1 -1
  25. package/dist/esm/survey/surveys/dependencies.js.map +1 -1
  26. package/dist/esm/survey/surveys/nodeDefs.js.map +1 -1
  27. package/dist/esm/tests/builder/recordBuilder/nodeBuilder.js.map +1 -1
  28. package/dist/esm/tests/builder/surveyBuilder/nodeDefAttributeBuilder.js.map +1 -1
  29. package/dist/esm/tests/builder/surveyBuilder/nodeDefBuilder.js.map +1 -1
  30. package/dist/esm/tests/builder/surveyBuilder/nodeDefCodeBuilder.js.map +1 -1
  31. package/dist/esm/tests/builder/surveyBuilder/nodeDefEntityBuilder.js.map +1 -1
  32. package/dist/esm/tests/builder/surveyBuilder/nodeDefTaxonBuilder.js.map +1 -1
  33. package/dist/index.d.ts +1 -1
  34. package/dist/index.js.map +1 -1
  35. package/dist/node/nodePointer.d.ts +2 -2
  36. package/dist/node/nodePointer.js.map +1 -1
  37. package/dist/node/nodeValueFormatter.d.ts +2 -2
  38. package/dist/node/nodeValueFormatter.js.map +1 -1
  39. package/dist/node/nodeValues.d.ts +3 -3
  40. package/dist/node/nodeValues.js.map +1 -1
  41. package/dist/nodeDef/factory.d.ts +3 -3
  42. package/dist/nodeDef/factory.js.map +1 -1
  43. package/dist/nodeDef/index.d.ts +1 -1
  44. package/dist/nodeDef/index.js.map +1 -1
  45. package/dist/nodeDef/nodeDef.d.ts +2 -0
  46. package/dist/nodeDef/nodeDef.js.map +1 -1
  47. package/dist/nodeDef/nodeDefs.d.ts +50 -50
  48. package/dist/nodeDef/nodeDefs.js.map +1 -1
  49. package/dist/nodeDef/service.d.ts +7 -7
  50. package/dist/nodeDef/service.js.map +1 -1
  51. package/dist/nodeDefExpressionEvaluator/context.d.ts +3 -4
  52. package/dist/nodeDefExpressionEvaluator/context.js.map +1 -1
  53. package/dist/nodeDefExpressionEvaluator/node/identifier.d.ts +2 -2
  54. package/dist/nodeDefExpressionEvaluator/node/identifier.js.map +1 -1
  55. package/dist/record/_records/nodeDefSelfReferences.d.ts +2 -2
  56. package/dist/record/_records/nodeDefSelfReferences.js.map +1 -1
  57. package/dist/record/_records/recordCompletion.js.map +1 -1
  58. package/dist/record/_records/recordGetters.d.ts +4 -4
  59. package/dist/record/_records/recordGetters.js.map +1 -1
  60. package/dist/record/recordNodesUpdater/recordNodeDependentsRequiredUpdater.d.ts +2 -2
  61. package/dist/record/recordNodesUpdater/recordNodeDependentsRequiredUpdater.js.map +1 -1
  62. package/dist/record/recordNodesUpdater/recordNodesDependentsUpdaterCommons.d.ts +2 -2
  63. package/dist/record/recordNodesUpdater/recordNodesDependentsUpdaterCommons.js.map +1 -1
  64. package/dist/record/recordValidator/attributeKeyValidator.d.ts +3 -3
  65. package/dist/record/recordValidator/attributeKeyValidator.js.map +1 -1
  66. package/dist/record/recordValidator/attributeTypeValidator.d.ts +2 -2
  67. package/dist/record/recordValidator/attributeTypeValidator.js.map +1 -1
  68. package/dist/record/recordValidator/attributeUniqueValidator.d.ts +2 -2
  69. package/dist/record/recordValidator/attributeUniqueValidator.js.map +1 -1
  70. package/dist/record/recordValidator/attributeValidator.js.map +1 -1
  71. package/dist/record/recordValidator/countValidator.d.ts +2 -2
  72. package/dist/record/recordValidator/countValidator.js.map +1 -1
  73. package/dist/survey/survey.d.ts +2 -2
  74. package/dist/survey/survey.js.map +1 -1
  75. package/dist/survey/surveys/_nodeDefs/nodeDefsReader.d.ts +3 -3
  76. package/dist/survey/surveys/_nodeDefs/nodeDefsReader.js.map +1 -1
  77. package/dist/survey/surveys/dependencies.d.ts +4 -4
  78. package/dist/survey/surveys/dependencies.js.map +1 -1
  79. package/dist/survey/surveys/nodeDefs.d.ts +28 -28
  80. package/dist/survey/surveys/nodeDefs.js.map +1 -1
  81. package/dist/tests/builder/recordBuilder/nodeBuilder.d.ts +2 -2
  82. package/dist/tests/builder/recordBuilder/nodeBuilder.js.map +1 -1
  83. package/dist/tests/builder/surveyBuilder/nodeDefAttributeBuilder.d.ts +2 -2
  84. package/dist/tests/builder/surveyBuilder/nodeDefAttributeBuilder.js.map +1 -1
  85. package/dist/tests/builder/surveyBuilder/nodeDefBuilder.d.ts +3 -3
  86. package/dist/tests/builder/surveyBuilder/nodeDefBuilder.js.map +1 -1
  87. package/dist/tests/builder/surveyBuilder/nodeDefCodeBuilder.d.ts +2 -2
  88. package/dist/tests/builder/surveyBuilder/nodeDefCodeBuilder.js.map +1 -1
  89. package/dist/tests/builder/surveyBuilder/nodeDefEntityBuilder.d.ts +2 -2
  90. package/dist/tests/builder/surveyBuilder/nodeDefEntityBuilder.js.map +1 -1
  91. package/dist/tests/builder/surveyBuilder/nodeDefTaxonBuilder.d.ts +2 -2
  92. package/dist/tests/builder/surveyBuilder/nodeDefTaxonBuilder.js.map +1 -1
  93. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"nodeDefCodeBuilder.js","sourceRoot":"","sources":["../../../../../src/tests/builder/surveyBuilder/nodeDefCodeBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsD,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAClG,OAAO,EAAe,OAAO,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AAEnE,MAAM,OAAO,kBAAmB,SAAQ,uBAAuB;IAI7D,YAAY,IAAY,EAAE,YAAoB;QAC5C,KAAK,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA;QAC7B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;IAClC,CAAC;IAED,mBAAmB,CAAC,uBAA+B;QACjD,IAAI,CAAC,uBAAuB,GAAG,uBAAuB,CAAA;QACtD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,KAAK,CAAC,MAAmE;QAGvE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAA;QACzB,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;QAElC,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;QAClH,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,uBAAuB,IAAI,CAAC,YAAY,aAAa,CAAC,CAAA;QACxE,CAAC;QACD,MAAM,OAAO,GAAqB,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAqB,CAAA;QAC9E,OAAO,CAAC,KAAK,CAAC,YAAY,GAAG,QAAQ,CAAC,IAAI,CAAA;QAC1C,IAAI,IAAI,CAAC,uBAAuB,EAAE,CAAC;YACjC,MAAM,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,uBAAuB,EAAE,CAAC,CAAA;YAC9F,OAAO,CAAC,KAAK,CAAC,iBAAiB,GAAG,aAAa,CAAC,IAAI,CAAA;QACtD,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC;CACF","sourcesContent":["import { ArenaNodeDef, ArenaNodeDefCode, ArenaNodeDefEntity, NodeDefType } from '../../../nodeDef'\nimport { ArenaSurvey, Surveys } from '../../../survey'\nimport { NodeDefAttributeBuilder } from './nodeDefAttributeBuilder'\n\nexport class NodeDefCodeBuilder extends NodeDefAttributeBuilder {\n protected categoryName: string\n protected parentCodeAttributeName: string | undefined\n\n constructor(name: string, categoryName: string) {\n super(name, NodeDefType.code)\n this.categoryName = categoryName\n }\n\n parentCodeAttribute(parentCodeAttributeName: string): NodeDefAttributeBuilder {\n this.parentCodeAttributeName = parentCodeAttributeName\n return this\n }\n\n build(params: { survey: ArenaSurvey; nodeDefParent?: ArenaNodeDefEntity }): {\n [uuid: string]: ArenaNodeDef<NodeDefType>\n } {\n const { survey } = params\n const result = super.build(params)\n\n const category = this.categoryName ? Surveys.getCategoryByName({ survey, categoryName: this.categoryName }) : null\n if (!category) {\n throw new Error(`Category with name \"${this.categoryName}\" not found`)\n }\n const nodeDef: ArenaNodeDefCode = Object.values(result)[0] as ArenaNodeDefCode\n nodeDef.props.categoryUuid = category.uuid\n if (this.parentCodeAttributeName) {\n const parentCodeDef = Surveys.getNodeDefByName({ survey, name: this.parentCodeAttributeName })\n nodeDef.props.parentCodeDefUuid = parentCodeDef.uuid\n }\n\n return result\n }\n}\n"]}
1
+ {"version":3,"file":"nodeDefCodeBuilder.js","sourceRoot":"","sources":["../../../../../src/tests/builder/surveyBuilder/nodeDefCodeBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyD,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACrG,OAAO,EAAe,OAAO,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AAEnE,MAAM,OAAO,kBAAmB,SAAQ,uBAAuB;IAI7D,YAAY,IAAY,EAAE,YAAoB;QAC5C,KAAK,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA;QAC7B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;IAClC,CAAC;IAED,mBAAmB,CAAC,uBAA+B;QACjD,IAAI,CAAC,uBAAuB,GAAG,uBAAuB,CAAA;QACtD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,KAAK,CAAC,MAAmE;QAGvE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAA;QACzB,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;QAElC,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;QAClH,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,uBAAuB,IAAI,CAAC,YAAY,aAAa,CAAC,CAAA;QACxE,CAAC;QACD,MAAM,OAAO,GAAqB,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAqB,CAAA;QAC9E,OAAO,CAAC,KAAK,CAAC,YAAY,GAAG,QAAQ,CAAC,IAAI,CAAA;QAC1C,IAAI,IAAI,CAAC,uBAAuB,EAAE,CAAC;YACjC,MAAM,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,uBAAuB,EAAE,CAAC,CAAA;YAC9F,OAAO,CAAC,KAAK,CAAC,iBAAiB,GAAG,aAAa,CAAC,IAAI,CAAA;QACtD,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC;CACF","sourcesContent":["import { ArenaAnyNodeDef, ArenaNodeDefCode, ArenaNodeDefEntity, NodeDefType } from '../../../nodeDef'\nimport { ArenaSurvey, Surveys } from '../../../survey'\nimport { NodeDefAttributeBuilder } from './nodeDefAttributeBuilder'\n\nexport class NodeDefCodeBuilder extends NodeDefAttributeBuilder {\n protected categoryName: string\n protected parentCodeAttributeName: string | undefined\n\n constructor(name: string, categoryName: string) {\n super(name, NodeDefType.code)\n this.categoryName = categoryName\n }\n\n parentCodeAttribute(parentCodeAttributeName: string): NodeDefAttributeBuilder {\n this.parentCodeAttributeName = parentCodeAttributeName\n return this\n }\n\n build(params: { survey: ArenaSurvey; nodeDefParent?: ArenaNodeDefEntity }): {\n [uuid: string]: ArenaAnyNodeDef\n } {\n const { survey } = params\n const result = super.build(params)\n\n const category = this.categoryName ? Surveys.getCategoryByName({ survey, categoryName: this.categoryName }) : null\n if (!category) {\n throw new Error(`Category with name \"${this.categoryName}\" not found`)\n }\n const nodeDef: ArenaNodeDefCode = Object.values(result)[0] as ArenaNodeDefCode\n nodeDef.props.categoryUuid = category.uuid\n if (this.parentCodeAttributeName) {\n const parentCodeDef = Surveys.getNodeDefByName({ survey, name: this.parentCodeAttributeName })\n nodeDef.props.parentCodeDefUuid = parentCodeDef.uuid\n }\n\n return result\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"nodeDefEntityBuilder.js","sourceRoot":"","sources":["../../../../../src/tests/builder/survey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AQ,IAAI,CAAA;YACnF,uCAAY,WAAW,GAAK,QAAQ,EAAE;QACxC,CAAC,EACD,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,CACpB,CAAA;IACH,CAAC;CACF","sourcesContent":["import { ArenaNodeDef, ArenaNodeDefEntity, ArenaNodeDefEntityProps, NodeDefType } from '../../../nodeDef'\nimport { ArenaSurvey } from '../../../survey'\nimport { NodeDefBuilder } from './nodeDefBuilder'\n\nexport class NodeDefEntityBuilder extends NodeDefBuilder {\n protected childBuilders: NodeDefBuilder[]\n\n constructor(name: string, ...childBuilders: NodeDefBuilder[]) {\n super(name, NodeDefType.entity)\n this.childBuilders = childBuilders\n }\n\n enumerate(): this {\n const p = this.props as ArenaNodeDefEntityProps\n p.enumerate = true\n return this\n }\n\n enumeratingItemsExpression(expression: string): this {\n this.propsAdvanced.enumeratingItemsExpression = expression\n return this\n }\n\n autoCreateMinCountItems(): this {\n const p = this.props as ArenaNodeDefEntityProps\n p.autoCreateMinCountItems = true\n return this\n }\n\n build(params: { survey: ArenaSurvey; nodeDefParent?: ArenaNodeDefEntity }): {\n [uuid: string]: ArenaNodeDef<NodeDefType>\n } {\n const { survey, nodeDefParent } = params\n const def: ArenaNodeDefEntity = this.createNodeDef({ nodeDefParent }) as ArenaNodeDefEntity\n\n let surveyUpdated = { ...survey }\n\n return this.childBuilders.reduce(\n (nodeDefsAcc: { [uuid: string]: ArenaNodeDef<NodeDefType> }, childBuilder: NodeDefBuilder) => {\n const nodeDefs = childBuilder.build({ survey: surveyUpdated, nodeDefParent: def })\n surveyUpdated = { ...survey, nodeDefs: { ...surveyUpdated.nodeDefs, ...nodeDefs } }\n return { ...nodeDefsAcc, ...nodeDefs }\n },\n { [def.uuid]: def }\n )\n }\n}\n"]}
1
+ {"version":3,"file":"nodeDefEntityBuilder.js","sourceRoot":"","sources":["../../../../../src/tests/builder/surveyBuilder/nodeDefEntityBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EA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QACxC,CAAC,EACD,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,CACpB,CAAA;IACH,CAAC;CACF","sourcesContent":["import { ArenaAnyNodeDef, ArenaNodeDefEntity, ArenaNodeDefEntityProps, NodeDefType } from '../../../nodeDef'\nimport { ArenaSurvey } from '../../../survey'\nimport { NodeDefBuilder } from './nodeDefBuilder'\n\nexport class NodeDefEntityBuilder extends NodeDefBuilder {\n protected childBuilders: NodeDefBuilder[]\n\n constructor(name: string, ...childBuilders: NodeDefBuilder[]) {\n super(name, NodeDefType.entity)\n this.childBuilders = childBuilders\n }\n\n enumerate(): this {\n const p = this.props as ArenaNodeDefEntityProps\n p.enumerate = true\n return this\n }\n\n enumeratingItemsExpression(expression: string): this {\n this.propsAdvanced.enumeratingItemsExpression = expression\n return this\n }\n\n autoCreateMinCountItems(): this {\n const p = this.props as ArenaNodeDefEntityProps\n p.autoCreateMinCountItems = true\n return this\n }\n\n build(params: { survey: ArenaSurvey; nodeDefParent?: ArenaNodeDefEntity }): {\n [uuid: string]: ArenaAnyNodeDef\n } {\n const { survey, nodeDefParent } = params\n const def: ArenaNodeDefEntity = this.createNodeDef({ nodeDefParent }) as ArenaNodeDefEntity\n\n let surveyUpdated = { ...survey }\n\n return this.childBuilders.reduce(\n (nodeDefsAcc: { [uuid: string]: ArenaAnyNodeDef }, childBuilder: NodeDefBuilder) => {\n const nodeDefs = childBuilder.build({ survey: surveyUpdated, nodeDefParent: def })\n surveyUpdated = { ...survey, nodeDefs: { ...surveyUpdated.nodeDefs, ...nodeDefs } }\n return { ...nodeDefsAcc, ...nodeDefs }\n },\n { [def.uuid]: def }\n )\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"nodeDefTaxonBuilder.js","sourceRoot":"","sources":["../../../../../src/tests/builder/surveyBuilder/nodeDefTaxonBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuD,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnG,OAAO,EAAe,OAAO,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AAEnE,MAAM,OAAO,mBAAoB,SAAQ,uBAAuB;IAG9D,YAAY,IAAY,EAAE,YAAoB;QAC5C,KAAK,CAAC,IAAI,EAAE,WAAW,CAAC,KAAK,CAAC,CAAA;QAC9B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;IAClC,CAAC;IAED,KAAK,CAAC,MAAmE;QAGvE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAA;QACzB,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;QAElC,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;QAClH,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,uBAAuB,IAAI,CAAC,YAAY,aAAa,CAAC,CAAA;QACxE,CAAC;QACD,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAsB,CAAA;QAC7D,OAAO,CAAC,KAAK,CAAC,YAAY,GAAG,QAAQ,CAAC,IAAI,CAAA;QAE1C,OAAO,MAAM,CAAA;IACf,CAAC;CACF","sourcesContent":["import { ArenaNodeDef, ArenaNodeDefEntity, ArenaNodeDefTaxon, NodeDefType } from '../../../nodeDef'\nimport { ArenaSurvey, Surveys } from '../../../survey'\nimport { NodeDefAttributeBuilder } from './nodeDefAttributeBuilder'\n\nexport class NodeDefTaxonBuilder extends NodeDefAttributeBuilder {\n protected taxonomyName: string\n\n constructor(name: string, taxonomyName: string) {\n super(name, NodeDefType.taxon)\n this.taxonomyName = taxonomyName\n }\n\n build(params: { survey: ArenaSurvey; nodeDefParent?: ArenaNodeDefEntity }): {\n [uuid: string]: ArenaNodeDef<NodeDefType>\n } {\n const { survey } = params\n const result = super.build(params)\n\n const taxonomy = this.taxonomyName ? Surveys.getTaxonomyByName({ survey, taxonomyName: this.taxonomyName }) : null\n if (!taxonomy) {\n throw new Error(`Taxonomy with name \"${this.taxonomyName}\" not found`)\n }\n const nodeDef = Object.values(result)[0] as ArenaNodeDefTaxon\n nodeDef.props.taxonomyUuid = taxonomy.uuid\n\n return result\n }\n}\n"]}
1
+ {"version":3,"file":"nodeDefTaxonBuilder.js","sourceRoot":"","sources":["../../../../../src/tests/builder/surveyBuilder/nodeDefTaxonBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0D,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACtG,OAAO,EAAe,OAAO,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AAEnE,MAAM,OAAO,mBAAoB,SAAQ,uBAAuB;IAG9D,YAAY,IAAY,EAAE,YAAoB;QAC5C,KAAK,CAAC,IAAI,EAAE,WAAW,CAAC,KAAK,CAAC,CAAA;QAC9B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;IAClC,CAAC;IAED,KAAK,CAAC,MAAmE;QAGvE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAA;QACzB,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;QAElC,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;QAClH,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,uBAAuB,IAAI,CAAC,YAAY,aAAa,CAAC,CAAA;QACxE,CAAC;QACD,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAsB,CAAA;QAC7D,OAAO,CAAC,KAAK,CAAC,YAAY,GAAG,QAAQ,CAAC,IAAI,CAAA;QAE1C,OAAO,MAAM,CAAA;IACf,CAAC;CACF","sourcesContent":["import { ArenaAnyNodeDef, ArenaNodeDefEntity, ArenaNodeDefTaxon, NodeDefType } from '../../../nodeDef'\nimport { ArenaSurvey, Surveys } from '../../../survey'\nimport { NodeDefAttributeBuilder } from './nodeDefAttributeBuilder'\n\nexport class NodeDefTaxonBuilder extends NodeDefAttributeBuilder {\n protected taxonomyName: string\n\n constructor(name: string, taxonomyName: string) {\n super(name, NodeDefType.taxon)\n this.taxonomyName = taxonomyName\n }\n\n build(params: { survey: ArenaSurvey; nodeDefParent?: ArenaNodeDefEntity }): {\n [uuid: string]: ArenaAnyNodeDef\n } {\n const { survey } = params\n const result = super.build(params)\n\n const taxonomy = this.taxonomyName ? Surveys.getTaxonomyByName({ survey, taxonomyName: this.taxonomyName }) : null\n if (!taxonomy) {\n throw new Error(`Taxonomy with name \"${this.taxonomyName}\" not found`)\n }\n const nodeDef = Object.values(result)[0] as ArenaNodeDefTaxon\n nodeDef.props.taxonomyUuid = taxonomy.uuid\n\n return result\n }\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -31,7 +31,7 @@ export type { ArenaRecordNode, ArenaRecordNodeMeta, ArenaRecordNodePointer, Aren
31
31
  export { NodeDefCountType, NodeDefExpressionFactory, NodeDefType, NodeDefFactory, NodeDefs, NodeDefEntityRenderType, NodeDefFileType, NodeDefTextInputType, NodeDefTextRenderType, FormHeaderColor, } from './nodeDef';
32
32
  export { NodeDefExpressionEvaluator, NodeDefExpressionValidator } from './nodeDefExpressionEvaluator';
33
33
  export type { ArenaAreaOfInterestProvider, ArenaCategoryItemProvider, ArenaTaxonProvider, } from './nodeDefExpressionEvaluator';
34
- export type { ArenaNodeDef, ArenaNodeDefLayout, ArenaNodeDefMeta, ArenaNodeDefProps, ArenaNodeDefPropsWithLayout, ArenaNodeDefBoolean, ArenaNodeDefBooleanProps, ArenaNodeDefCode, ArenaNodeDefCodeLayout, ArenaNodeDefCodeProps, ArenaNodeDefCoordinate, ArenaNodeDefCoordinateProps, ArenaNodeDefDate, ArenaNodeDefDecimal, ArenaNodeDefDecimalProps, ArenaNodeDefEntity, ArenaNodeDefEntityChildPosition, ArenaNodeDefEntityLayout, ArenaNodeDefEntityLayoutChildItem, ArenaNodeDefEntityProps, ArenaNodeDefPrintOrientation, ArenaNodeDefFile, ArenaNodeDefFileProps, ArenaNodeDefGeo, ArenaNodeDefGeoProps, ArenaNodeDefFormHeader, ArenaNodeDefFormHeaderProps, ArenaNodeDefInteger, ArenaNodeDefPropsAdvanced, ArenaNodeDefTaxon, ArenaNodeDefTaxonProps, ArenaNodeDefText, ArenaNodeDefTextProps, ArenaNodeDefTextLayout, ArenaNodeDefTime, ArenaNodeDefTimeProps, ArenaNodeDefCountExpression, ArenaNodeDefExpression, ArenaNodeDefExpressionFactoryParams, ArenaNodeDefMap, ArenaNodeDefService, ArenaNodeDefValidations, } from './nodeDef';
34
+ export type { ArenaNodeDef, ArenaAnyNodeDef, ArenaNodeDefLayout, ArenaNodeDefMeta, ArenaNodeDefProps, ArenaNodeDefPropsWithLayout, ArenaNodeDefBoolean, ArenaNodeDefBooleanProps, ArenaNodeDefCode, ArenaNodeDefCodeLayout, ArenaNodeDefCodeProps, ArenaNodeDefCoordinate, ArenaNodeDefCoordinateProps, ArenaNodeDefDate, ArenaNodeDefDecimal, ArenaNodeDefDecimalProps, ArenaNodeDefEntity, ArenaNodeDefEntityChildPosition, ArenaNodeDefEntityLayout, ArenaNodeDefEntityLayoutChildItem, ArenaNodeDefEntityProps, ArenaNodeDefPrintOrientation, ArenaNodeDefFile, ArenaNodeDefFileProps, ArenaNodeDefGeo, ArenaNodeDefGeoProps, ArenaNodeDefFormHeader, ArenaNodeDefFormHeaderProps, ArenaNodeDefInteger, ArenaNodeDefPropsAdvanced, ArenaNodeDefTaxon, ArenaNodeDefTaxonProps, ArenaNodeDefText, ArenaNodeDefTextProps, ArenaNodeDefTextLayout, ArenaNodeDefTime, ArenaNodeDefTimeProps, ArenaNodeDefCountExpression, ArenaNodeDefExpression, ArenaNodeDefExpressionFactoryParams, ArenaNodeDefMap, ArenaNodeDefService, ArenaNodeDefValidations, } from './nodeDef';
35
35
  export { RecordNodePointers, RecordCloner, RecordFactory, RecordFixer, Records, RECORD_STEP_DEFAULT, RecordStepAnalysisCode, RecordStepCleansingCode, RecordStepEntryCode, RecordStepNames, RecordSteps, RecordStepsList, RecordExpressionEvaluator, RecordNodesUpdater, RecordPrettyPrinter, RecordUpdater, RecordUpdateResult, RecordValidator, RecordValidations, } from './record';
36
36
  export type { ArenaAttributeValidatorParams, ArenaAttributesValidatorParams, ArenaRecordNodeCreateParams, ArenaRecordNodesUpdateParams, ArenaRecord, ArenaRecordExpressionContext, ArenaRecordExpressionEvaluationContext, ArenaRecordService, ArenaRecordStep, ArenaRecordUpdateOptions, ArenaRecordValidatorParams, ArenaSortedAttributesValidatorParams, } from './record';
37
37
  export { ServiceRegistry, ServiceType } from './registry';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAEA,+BASe;AARb,kGAAA,UAAU,OAAA;AACV,qGAAA,aAAa,OAAA;AACb,+GAAA,uBAAuB,OAAA;AACvB,kGAAA,UAAU,OAAA;AACV,kGAAA,UAAU,OAAA;AACV,iGAAA,SAAS,OAAA;AACT,mGAAA,WAAW,OAAA;AACX,6FAAA,KAAK,OAAA;AAyBP,uCAAiH;AAAxG,2GAAA,eAAe,OAAA;AAAE,oHAAA,wBAAwB,OAAA;AAAE,+GAAA,mBAAmB,OAAA;AAAE,gHAAA,oBAAoB,OAAA;AAe7F,uCAAsD;AAA7C,sGAAA,UAAU,OAAA;AAAE,yGAAA,aAAa,OAAA;AAElC,iCAA4E;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atus,\n Permission,\n UserTitle,\n UserFactory,\n Users,\n} from './auth'\nexport type {\n ArenaAuthGroup,\n ArenaUser,\n ArenaUserAuthGroup,\n ArenaUserAuthGroupProps,\n ArenaAuthToken,\n ArenaUserAuthTokenPayload,\n ArenaUserAuthTokenService,\n ArenaUserPrefs,\n ArenaUserPrefSurveys,\n ArenaUserProps,\n ArenaUserAuthRefreshToken,\n ArenaUserAuthRefreshTokenProps,\n ArenaUserAuthRefreshTokenPayload,\n ArenaUserService,\n ArenaUserTokenPayload,\n ArenaDownloadAuthTokenPayload,\n ArenaUserGroup,\n ArenaUserGroupProps,\n ArenaUserGroupQualifier,\n ArenaUserInvitation,\n} from './auth'\n\nexport { CategoryFactory, CategoryImportColumnType, CategoryItemFactory, CategoryLevelFactory } from './category'\nexport type {\n ArenaCategoryItemProps,\n ArenaCategory,\n ArenaCategoryItem,\n ArenaCategoryLevel,\n ArenaCategoryLevelProps,\n ArenaCategoryImportSummary,\n ArenaCategoryImportSummaryColumn,\n ArenaCategoryItemService,\n ArenaCategoryLevelService,\n ArenaCategoryProps,\n ArenaCategoryService,\n} from './category'\n\nexport { Categories, CategoryItems } from './category'\n\nexport { ChainFactory, ChainStatusExec, ChainNodeDefFactory } from './chain'\nexport type {\n ArenaChain,\n ArenaChainProps,\n ArenaChainService,\n ArenaChainNodeDef,\n ArenaChainNodeDefProps,\n ArenaChainNodeDefService,\n ArenaChainNodeDefAggregate,\n ArenaChainNodeDefAggregateProps,\n} from './chain'\n\nexport { TraverseMethod } from './common'\nexport type { ArenaObject, ArenaService, ArenaDictionary, ArenaFactory, ArenaI18n } from './common'\n\nexport type { ArenaFlatDataExportOptions, ArenaExportInfoFactoryParams, ArenaExportInfo } from './dataExport'\nexport {\n FlatDataExportDefaultOptions,\n FlatDataExportOption,\n FlatDataFiles,\n FlatDataExportModel,\n FlatDataExportColumnDataType,\n ArenaExportFile,\n ArenaExportInfoFactory,\n ArenaExportType,\n UniqueFileNamesGenerator,\n} from './dataExport'\n\nexport { DataQueryMode, DataQuerySummaries } from './dataQuery'\nexport type { ArenaDataQuery, ArenaDataQuerySummary, ArenaDataQuerySummaryProps } from './dataQuery'\n\nexport { SystemError, SystemErrorKeys } from './error'\n\nexport {\n ExpressionNodeType,\n ExpressionNodeEvaluator,\n ExpressionVariable,\n JavascriptExpressionEvaluator,\n JavascriptExpressionParser,\n} from './expression'\nexport type {\n ArenaArrayExpression,\n ArenaBinaryExpression,\n ArenaCallExpression,\n ArenaCompoundExpression,\n ArenaConditionalExpression,\n ArenaExpressionContext,\n ArenaExpressionEvaluator,\n ArenaExpressionFunction,\n ArenaExpressionFunctions,\n ArenaAnyExpressionNode,\n ArenaExpressionNode,\n ArenaExpressionNodeEvaluatorConstructor,\n ArenaMemberExpression,\n ArenaIdentifierExpression,\n ArenaLiteralExpression,\n ArenaSequenceExpression,\n ArenaThisExpression,\n ArenaUnaryExpression,\n} from './expression'\n\nexport { ExtraPropDataType, ExtraPropsDataGenerator } from './extraProp'\nexport type { ArenaExtraPropDef, ArenaExtraPropDefs } from './extraProp'\n\nexport { PointFactory, Points } from './geo'\nexport type { ArenaAreaOfInterest, ArenaAreaOfInterestDescriptor, ArenaPoint } from './geo'\n\nexport { JobBase, JobEventType, JobStatus } from './job'\nexport type { ArenaJob, ArenaJobContext, ArenaJobEvent, ArenaJobSerialized, ArenaJobTxClient } from './job'\n\nexport { LanguageCode, Languages, LanguagesISO639part2 } from './language'\nexport type { ArenaLabels } from './language'\n\nexport type { ArenaLogger } from './logger'\n\nexport type { ArenaMessage } from './message'\nexport { MessageNotificationType, MessagePropsKey, MessageStatus, MessageTargetUserType, Messages } from './message'\n\nexport {\n RecordNodeFactory,\n RecordNodeKeys,\n RecordNodeMetaKeys,\n RecordNodes,\n RecordNodeValueFormatter,\n RecordNodeValues,\n} from './node'\nexport type {\n ArenaRecordNode,\n ArenaRecordNodeMeta,\n ArenaRecordNodePointer,\n ArenaRecordNodeRefData,\n ArenaRecordNodeService,\n ArenaRecordNodesMap,\n ArenaRecordNodeValueCode,\n ArenaRecordNodeValueCoordinate,\n ArenaRecordNodeValueFile,\n ArenaRecordNodeValueTaxon,\n} from './node'\n\nexport {\n NodeDefCountType,\n NodeDefExpressionFactory,\n NodeDefType,\n NodeDefFactory,\n NodeDefs,\n NodeDefEntityRenderType,\n NodeDefFileType,\n NodeDefTextInputType,\n NodeDefTextRenderType,\n FormHeaderColor,\n} from './nodeDef'\n\nexport { NodeDefExpressionEvaluator, NodeDefExpressionValidator } from './nodeDefExpressionEvaluator'\nexport type {\n ArenaAreaOfInterestProvider,\n ArenaCategoryItemProvider,\n ArenaTaxonProvider,\n} from './nodeDefExpressionEvaluator'\n\nexport type {\n ArenaNodeDef,\n ArenaNodeDefLayout,\n ArenaNodeDefMeta,\n ArenaNodeDefProps,\n ArenaNodeDefPropsWithLayout,\n ArenaNodeDefBoolean,\n ArenaNodeDefBooleanProps,\n ArenaNodeDefCode,\n ArenaNodeDefCodeLayout,\n ArenaNodeDefCodeProps,\n ArenaNodeDefCoordinate,\n ArenaNodeDefCoordinateProps,\n ArenaNodeDefDate,\n ArenaNodeDefDecimal,\n ArenaNodeDefDecimalProps,\n ArenaNodeDefEntity,\n ArenaNodeDefEntityChildPosition,\n ArenaNodeDefEntityLayout,\n ArenaNodeDefEntityLayoutChildItem,\n ArenaNodeDefEntityProps,\n ArenaNodeDefPrintOrientation,\n ArenaNodeDefFile,\n ArenaNodeDefFileProps,\n ArenaNodeDefGeo,\n ArenaNodeDefGeoProps,\n ArenaNodeDefFormHeader,\n ArenaNodeDefFormHeaderProps,\n ArenaNodeDefInteger,\n ArenaNodeDefPropsAdvanced,\n ArenaNodeDefTaxon,\n ArenaNodeDefTaxonProps,\n ArenaNodeDefText,\n ArenaNodeDefTextProps,\n ArenaNodeDefTextLayout,\n ArenaNodeDefTime,\n ArenaNodeDefTimeProps,\n ArenaNodeDefCountExpression,\n ArenaNodeDefExpression,\n ArenaNodeDefExpressionFactoryParams,\n ArenaNodeDefMap,\n ArenaNodeDefService,\n ArenaNodeDefValidations,\n} from './nodeDef'\n\nexport {\n RecordNodePointers,\n RecordCloner,\n RecordFactory,\n RecordFixer,\n Records,\n RECORD_STEP_DEFAULT,\n RecordStepAnalysisCode,\n RecordStepCleansingCode,\n RecordStepEntryCode,\n RecordStepNames,\n RecordSteps,\n RecordStepsList,\n RecordExpressionEvaluator,\n RecordNodesUpdater,\n RecordPrettyPrinter,\n RecordUpdater,\n RecordUpdateResult,\n RecordValidator,\n RecordValidations,\n} from './record'\nexport type {\n ArenaAttributeValidatorParams,\n ArenaAttributesValidatorParams,\n ArenaRecordNodeCreateParams,\n ArenaRecordNodesUpdateParams,\n ArenaRecord,\n ArenaRecordExpressionContext,\n ArenaRecordExpressionEvaluationContext,\n ArenaRecordService,\n ArenaRecordStep,\n ArenaRecordUpdateOptions,\n ArenaRecordValidatorParams,\n ArenaSortedAttributesValidatorParams,\n} from './record'\n\nexport { ServiceRegistry, ServiceType } from './registry'\nexport type { ArenaServiceTypeMap } from './registry'\n\nexport { DEFAULT_SRS, DEFAULT_SRS_INDEX, SRSFactory } from './srs'\nexport type { ArenaSRS, ArenaSRSIndex } from './srs'\n\nexport {\n NodeDefsFixer,\n SurveyDocImages,\n SurveyDocImageFactory,\n SurveyDocPlace,\n SurveyDependencyType,\n SurveyFactory,\n SurveyFileFactory,\n SurveyFileType,\n SurveyRefDataFactory,\n SurveySecurityProp,\n Surveys,\n surveyDocImagePropKeys,\n surveySecurityDefaults,\n defaultCycle,\n} from './survey'\nexport type {\n ArenaSurvey,\n ArenaSurveyCycle,\n ArenaSurveyDependency,\n ArenaSurveyDependencyGraph,\n ArenaSurveyDocImage,\n ArenaSurveyDocImageFactoryParams,\n ArenaSurveyDocImageProps,\n ArenaSurveyFile,\n ArenaSurveyFileFactoryParams,\n ArenaSurveyFileProps,\n ArenaSurveyNodeDefsIndex,\n ArenaSurveyProps,\n ArenaSurveyRefData,\n ArenaSurveySecurity,\n ArenaSurveyService,\n} from './survey'\n\nexport { Taxa, Taxonomies, TaxonomyFactory, TaxonFactory, TaxonGenerator, VernacularNameFactory } from './taxonomy'\nexport type {\n ArenaVernacularNameParams,\n ArenaTaxonomyFactoryParams,\n ArenaTaxonFactoryParams,\n ArenaTaxonomy,\n ArenaTaxonomyService,\n ArenaVernacularNameProps,\n ArenaVernacularName,\n ArenaTaxonProps,\n ArenaTaxon,\n ArenaTaxonomyProps,\n ArenaTaxonService,\n} from './taxonomy'\n\nexport { SurveyBuilder, SurveyObjectBuilders } from './tests/builder/surveyBuilder'\nexport { RecordBuilder, RecordNodeBuilders } from './tests/builder/recordBuilder'\n\nexport {\n Arrays,\n DateFormats,\n Dates,\n FileNames,\n FileProcessor,\n Numbers,\n Objects,\n Promises,\n Queue,\n RetryProcessor,\n Strings,\n UnitOfTime,\n UUIDs,\n Versions,\n} from './utils'\n\nexport type { ArenaFileProcessorConstructorArgs, ArenaMutationOptions, ArenaParsedVersion } from './utils'\n\nexport {\n FieldValidators,\n ValidationFactory,\n ValidationResultFactory,\n ValidationResults,\n Validations,\n ValidationSeverity,\n Validator,\n ValidatorErrorKeys,\n} from './validation'\nexport type {\n ArenaDissocFieldValidationOptions,\n ArenaFieldValidator,\n ArenaValidation,\n ArenaValidationFields,\n ArenaValidationResult,\n ArenaValidationCounts,\n} from './validation'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAEA,+BASe;AARb,kGAAA,UAAU,OAAA;AACV,qGAAA,aAAa,OAAA;AACb,+GAAA,uBAAuB,OAAA;AACvB,kGAAA,UAAU,OAAA;AACV,kGAAA,UAAU,OAAA;AACV,iGAAA,SAAS,OAAA;AACT,mGAAA,WAAW,OAAA;AACX,6FAAA,KAAK,OAAA;AAyBP,uCAAiH;AAAxG,2GAAA,eAAe,OAAA;AAAE,oHAAA,wBAAwB,OAAA;AAAE,+GAAA,mBAAmB,OAAA;AAAE,gHAAA,oBAAoB,OAAA;AAe7F,uCAAsD;AAA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Info } from './app'\n\nexport {\n Authorizer,\n AuthGroupName,\n createDefaultAuthGroups,\n UserStatus,\n Permission,\n UserTitle,\n UserFactory,\n Users,\n} from './auth'\nexport type {\n ArenaAuthGroup,\n ArenaUser,\n ArenaUserAuthGroup,\n ArenaUserAuthGroupProps,\n ArenaAuthToken,\n ArenaUserAuthTokenPayload,\n ArenaUserAuthTokenService,\n ArenaUserPrefs,\n ArenaUserPrefSurveys,\n ArenaUserProps,\n ArenaUserAuthRefreshToken,\n ArenaUserAuthRefreshTokenProps,\n ArenaUserAuthRefreshTokenPayload,\n ArenaUserService,\n ArenaUserTokenPayload,\n ArenaDownloadAuthTokenPayload,\n ArenaUserGroup,\n ArenaUserGroupProps,\n ArenaUserGroupQualifier,\n ArenaUserInvitation,\n} from './auth'\n\nexport { CategoryFactory, CategoryImportColumnType, CategoryItemFactory, CategoryLevelFactory } from './category'\nexport type {\n ArenaCategoryItemProps,\n ArenaCategory,\n ArenaCategoryItem,\n ArenaCategoryLevel,\n ArenaCategoryLevelProps,\n ArenaCategoryImportSummary,\n ArenaCategoryImportSummaryColumn,\n ArenaCategoryItemService,\n ArenaCategoryLevelService,\n ArenaCategoryProps,\n ArenaCategoryService,\n} from './category'\n\nexport { Categories, CategoryItems } from './category'\n\nexport { ChainFactory, ChainStatusExec, ChainNodeDefFactory } from './chain'\nexport type {\n ArenaChain,\n ArenaChainProps,\n ArenaChainService,\n ArenaChainNodeDef,\n ArenaChainNodeDefProps,\n ArenaChainNodeDefService,\n ArenaChainNodeDefAggregate,\n ArenaChainNodeDefAggregateProps,\n} from './chain'\n\nexport { TraverseMethod } from './common'\nexport type { ArenaObject, ArenaService, ArenaDictionary, ArenaFactory, ArenaI18n } from './common'\n\nexport type { ArenaFlatDataExportOptions, ArenaExportInfoFactoryParams, ArenaExportInfo } from './dataExport'\nexport {\n FlatDataExportDefaultOptions,\n FlatDataExportOption,\n FlatDataFiles,\n FlatDataExportModel,\n FlatDataExportColumnDataType,\n ArenaExportFile,\n ArenaExportInfoFactory,\n ArenaExportType,\n UniqueFileNamesGenerator,\n} from './dataExport'\n\nexport { DataQueryMode, DataQuerySummaries } from './dataQuery'\nexport type { ArenaDataQuery, ArenaDataQuerySummary, ArenaDataQuerySummaryProps } from './dataQuery'\n\nexport { SystemError, SystemErrorKeys } from './error'\n\nexport {\n ExpressionNodeType,\n ExpressionNodeEvaluator,\n ExpressionVariable,\n JavascriptExpressionEvaluator,\n JavascriptExpressionParser,\n} from './expression'\nexport type {\n ArenaArrayExpression,\n ArenaBinaryExpression,\n ArenaCallExpression,\n ArenaCompoundExpression,\n ArenaConditionalExpression,\n ArenaExpressionContext,\n ArenaExpressionEvaluator,\n ArenaExpressionFunction,\n ArenaExpressionFunctions,\n ArenaAnyExpressionNode,\n ArenaExpressionNode,\n ArenaExpressionNodeEvaluatorConstructor,\n ArenaMemberExpression,\n ArenaIdentifierExpression,\n ArenaLiteralExpression,\n ArenaSequenceExpression,\n ArenaThisExpression,\n ArenaUnaryExpression,\n} from './expression'\n\nexport { ExtraPropDataType, ExtraPropsDataGenerator } from './extraProp'\nexport type { ArenaExtraPropDef, ArenaExtraPropDefs } from './extraProp'\n\nexport { PointFactory, Points } from './geo'\nexport type { ArenaAreaOfInterest, ArenaAreaOfInterestDescriptor, ArenaPoint } from './geo'\n\nexport { JobBase, JobEventType, JobStatus } from './job'\nexport type { ArenaJob, ArenaJobContext, ArenaJobEvent, ArenaJobSerialized, ArenaJobTxClient } from './job'\n\nexport { LanguageCode, Languages, LanguagesISO639part2 } from './language'\nexport type { ArenaLabels } from './language'\n\nexport type { ArenaLogger } from './logger'\n\nexport type { ArenaMessage } from './message'\nexport { MessageNotificationType, MessagePropsKey, MessageStatus, MessageTargetUserType, Messages } from './message'\n\nexport {\n RecordNodeFactory,\n RecordNodeKeys,\n RecordNodeMetaKeys,\n RecordNodes,\n RecordNodeValueFormatter,\n RecordNodeValues,\n} from './node'\nexport type {\n ArenaRecordNode,\n ArenaRecordNodeMeta,\n ArenaRecordNodePointer,\n ArenaRecordNodeRefData,\n ArenaRecordNodeService,\n ArenaRecordNodesMap,\n ArenaRecordNodeValueCode,\n ArenaRecordNodeValueCoordinate,\n ArenaRecordNodeValueFile,\n ArenaRecordNodeValueTaxon,\n} from './node'\n\nexport {\n NodeDefCountType,\n NodeDefExpressionFactory,\n NodeDefType,\n NodeDefFactory,\n NodeDefs,\n NodeDefEntityRenderType,\n NodeDefFileType,\n NodeDefTextInputType,\n NodeDefTextRenderType,\n FormHeaderColor,\n} from './nodeDef'\n\nexport { NodeDefExpressionEvaluator, NodeDefExpressionValidator } from './nodeDefExpressionEvaluator'\nexport type {\n ArenaAreaOfInterestProvider,\n ArenaCategoryItemProvider,\n ArenaTaxonProvider,\n} from './nodeDefExpressionEvaluator'\n\nexport type {\n ArenaNodeDef,\n ArenaAnyNodeDef,\n ArenaNodeDefLayout,\n ArenaNodeDefMeta,\n ArenaNodeDefProps,\n ArenaNodeDefPropsWithLayout,\n ArenaNodeDefBoolean,\n ArenaNodeDefBooleanProps,\n ArenaNodeDefCode,\n ArenaNodeDefCodeLayout,\n ArenaNodeDefCodeProps,\n ArenaNodeDefCoordinate,\n ArenaNodeDefCoordinateProps,\n ArenaNodeDefDate,\n ArenaNodeDefDecimal,\n ArenaNodeDefDecimalProps,\n ArenaNodeDefEntity,\n ArenaNodeDefEntityChildPosition,\n ArenaNodeDefEntityLayout,\n ArenaNodeDefEntityLayoutChildItem,\n ArenaNodeDefEntityProps,\n ArenaNodeDefPrintOrientation,\n ArenaNodeDefFile,\n ArenaNodeDefFileProps,\n ArenaNodeDefGeo,\n ArenaNodeDefGeoProps,\n ArenaNodeDefFormHeader,\n ArenaNodeDefFormHeaderProps,\n ArenaNodeDefInteger,\n ArenaNodeDefPropsAdvanced,\n ArenaNodeDefTaxon,\n ArenaNodeDefTaxonProps,\n ArenaNodeDefText,\n ArenaNodeDefTextProps,\n ArenaNodeDefTextLayout,\n ArenaNodeDefTime,\n ArenaNodeDefTimeProps,\n ArenaNodeDefCountExpression,\n ArenaNodeDefExpression,\n ArenaNodeDefExpressionFactoryParams,\n ArenaNodeDefMap,\n ArenaNodeDefService,\n ArenaNodeDefValidations,\n} from './nodeDef'\n\nexport {\n RecordNodePointers,\n RecordCloner,\n RecordFactory,\n RecordFixer,\n Records,\n RECORD_STEP_DEFAULT,\n RecordStepAnalysisCode,\n RecordStepCleansingCode,\n RecordStepEntryCode,\n RecordStepNames,\n RecordSteps,\n RecordStepsList,\n RecordExpressionEvaluator,\n RecordNodesUpdater,\n RecordPrettyPrinter,\n RecordUpdater,\n RecordUpdateResult,\n RecordValidator,\n RecordValidations,\n} from './record'\nexport type {\n ArenaAttributeValidatorParams,\n ArenaAttributesValidatorParams,\n ArenaRecordNodeCreateParams,\n ArenaRecordNodesUpdateParams,\n ArenaRecord,\n ArenaRecordExpressionContext,\n ArenaRecordExpressionEvaluationContext,\n ArenaRecordService,\n ArenaRecordStep,\n ArenaRecordUpdateOptions,\n ArenaRecordValidatorParams,\n ArenaSortedAttributesValidatorParams,\n} from './record'\n\nexport { ServiceRegistry, ServiceType } from './registry'\nexport type { ArenaServiceTypeMap } from './registry'\n\nexport { DEFAULT_SRS, DEFAULT_SRS_INDEX, SRSFactory } from './srs'\nexport type { ArenaSRS, ArenaSRSIndex } from './srs'\n\nexport {\n NodeDefsFixer,\n SurveyDocImages,\n SurveyDocImageFactory,\n SurveyDocPlace,\n SurveyDependencyType,\n SurveyFactory,\n SurveyFileFactory,\n SurveyFileType,\n SurveyRefDataFactory,\n SurveySecurityProp,\n Surveys,\n surveyDocImagePropKeys,\n surveySecurityDefaults,\n defaultCycle,\n} from './survey'\nexport type {\n ArenaSurvey,\n ArenaSurveyCycle,\n ArenaSurveyDependency,\n ArenaSurveyDependencyGraph,\n ArenaSurveyDocImage,\n ArenaSurveyDocImageFactoryParams,\n ArenaSurveyDocImageProps,\n ArenaSurveyFile,\n ArenaSurveyFileFactoryParams,\n ArenaSurveyFileProps,\n ArenaSurveyNodeDefsIndex,\n ArenaSurveyProps,\n ArenaSurveyRefData,\n ArenaSurveySecurity,\n ArenaSurveyService,\n} from './survey'\n\nexport { Taxa, Taxonomies, TaxonomyFactory, TaxonFactory, TaxonGenerator, VernacularNameFactory } from './taxonomy'\nexport type {\n ArenaVernacularNameParams,\n ArenaTaxonomyFactoryParams,\n ArenaTaxonFactoryParams,\n ArenaTaxonomy,\n ArenaTaxonomyService,\n ArenaVernacularNameProps,\n ArenaVernacularName,\n ArenaTaxonProps,\n ArenaTaxon,\n ArenaTaxonomyProps,\n ArenaTaxonService,\n} from './taxonomy'\n\nexport { SurveyBuilder, SurveyObjectBuilders } from './tests/builder/surveyBuilder'\nexport { RecordBuilder, RecordNodeBuilders } from './tests/builder/recordBuilder'\n\nexport {\n Arrays,\n DateFormats,\n Dates,\n FileNames,\n FileProcessor,\n Numbers,\n Objects,\n Promises,\n Queue,\n RetryProcessor,\n Strings,\n UnitOfTime,\n UUIDs,\n Versions,\n} from './utils'\n\nexport type { ArenaFileProcessorConstructorArgs, ArenaMutationOptions, ArenaParsedVersion } from './utils'\n\nexport {\n FieldValidators,\n ValidationFactory,\n ValidationResultFactory,\n ValidationResults,\n Validations,\n ValidationSeverity,\n Validator,\n ValidatorErrorKeys,\n} from './validation'\nexport type {\n ArenaDissocFieldValidationOptions,\n ArenaFieldValidator,\n ArenaValidation,\n ArenaValidationFields,\n ArenaValidationResult,\n ArenaValidationCounts,\n} from './validation'\n"]}
@@ -1,6 +1,6 @@
1
1
  import { ArenaRecordNode } from './node';
2
- import { ArenaNodeDef, ArenaNodeDefProps, NodeDefType } from '../nodeDef';
2
+ import { ArenaAnyNodeDef } from '../nodeDef';
3
3
  export interface ArenaRecordNodePointer {
4
4
  nodeCtx: ArenaRecordNode;
5
- nodeDef: ArenaNodeDef<NodeDefType, ArenaNodeDefProps>;
5
+ nodeDef: ArenaAnyNodeDef;
6
6
  }
@@ -1 +1 @@
1
- {"version":3,"file":"nodePointer.js","sourceRoot":"","sources":["../../src/node/nodePointer.ts"],"names":[],"mappings":"","sourcesContent":["import { ArenaRecordNode } from './node'\nimport { ArenaNodeDef, ArenaNodeDefProps, NodeDefType } from '../nodeDef'\n\nexport interface ArenaRecordNodePointer {\n nodeCtx: ArenaRecordNode\n nodeDef: ArenaNodeDef<NodeDefType, ArenaNodeDefProps>\n}\n"]}
1
+ {"version":3,"file":"nodePointer.js","sourceRoot":"","sources":["../../src/node/nodePointer.ts"],"names":[],"mappings":"","sourcesContent":["import { ArenaRecordNode } from './node'\nimport { ArenaAnyNodeDef } from '../nodeDef'\n\nexport interface ArenaRecordNodePointer {\n nodeCtx: ArenaRecordNode\n nodeDef: ArenaAnyNodeDef\n}\n"]}
@@ -1,11 +1,11 @@
1
1
  import { LanguageCode } from '../language';
2
- import { ArenaNodeDef, NodeDefType } from '../nodeDef';
2
+ import { ArenaAnyNodeDef } from '../nodeDef';
3
3
  import { ArenaSurvey } from '../survey';
4
4
  import { ArenaRecordNode } from './node';
5
5
  type FormatParams = {
6
6
  survey: ArenaSurvey;
7
7
  cycle: string;
8
- nodeDef: ArenaNodeDef<NodeDefType>;
8
+ nodeDef: ArenaAnyNodeDef;
9
9
  node?: ArenaRecordNode;
10
10
  value: any;
11
11
  showLabel?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"nodeValueFormatter.js","sourceRoot":"","sources":["../../src/node/nodeValueFormatter.ts"],"names":[],"mappings":";;;AAAA,0CAA8D;AAE9D,wCAAuG;AACvG,sCAAgD;AAChD,0CAAkC;AAClC,oCAAwE;AAExE,6CAA+C;AAE/C,MAAM,mBAAmB,GAAG,CAAC,MAI5B,EAAiC,EAAE;;;IAClC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,CAAA;IAEtC,MAAM,QAAQ,GAAG,6BAAgB,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAA;IACzD,IAAI,CAAC,QAAQ;QAAE,OAAO,SAAS,CAAA;IAE/B,MAAM,IAAI,SAAG,M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CAAA;AAEY,QAAA,wBAAwB,GAAG;IACtC,MAAM;CACP,CAAA","sourcesContent":["import { ArenaCategoryItem, CategoryItems } from '../category'\nimport { LanguageCode } from '../language'\nimport { ArenaNodeDef, ArenaNodeDefCode, ArenaNodeDefDecimal, NodeDefs, NodeDefType } from '../nodeDef'\nimport { ArenaSurvey, Surveys } from '../survey'\nimport { Taxa } from '../taxonomy'\nimport { DateFormats, Dates, Numbers, Objects, Strings } from '../utils'\nimport { ArenaRecordNode } from './node'\nimport { RecordNodeValues } from './nodeValues'\n\nconst extractCategoryItem = (params: {\n survey: ArenaSurvey\n node?: ArenaRecordNode\n value: any\n}): ArenaCategoryItem | undefined => {\n const { survey, node, value } = params\n\n const itemUuid = RecordNodeValues.getValueItemUuid(value)\n if (!itemUuid) return undefined\n\n const item = node?.refData?.categoryItem ?? Surveys.getCategoryItemByUuid({ survey, itemUuid })\n // check the validity of the reference data category item\n return item?.props && Objects.isNotEmpty(CategoryItems.getCode(item)) ? item : undefined\n}\n\ntype FormatParams = {\n survey: ArenaSurvey\n cycle: string\n nodeDef: ArenaNodeDef<NodeDefType>\n node?: ArenaRecordNode\n value: any\n showLabel?: boolean\n quoteLabels?: boolean\n lang?: LanguageCode\n}\n\nconst formatters: { [key in NodeDefType]?: (params: FormatParams) => any } = {\n [NodeDefType.code]: (params: FormatParams) => {\n const { survey, cycle, nodeDef, node, value, showLabel, quoteLabels, lang } = params\n\n if (!showLabel) {\n // item code already inside value, no need to get category item\n const itemCode = RecordNodeValues.getValueCode(value)\n if (!Objects.isEmpty(itemCode)) return itemCode\n }\n const categoryItem = extractCategoryItem({ survey, node, value })\n if (!categoryItem) return null\n\n if (showLabel) {\n let result\n if (NodeDefs.isCodeShown(cycle)(nodeDef as ArenaNodeDefCode)) {\n result = CategoryItems.getLabelWithCode(categoryItem, lang!)\n } else {\n result = CategoryItems.getLabel(categoryItem, lang!, true)\n }\n return quoteLabels ? Strings.quote(result) : result\n }\n return CategoryItems.getCode(categoryItem)\n },\n [NodeDefType.date]: (params: FormatParams) => {\n const { value } = params\n const dateParsed = Dates.parseISO(value)\n return Dates.format(dateParsed, DateFormats.dateDisplay)\n },\n [NodeDefType.decimal]: (params: FormatParams) => {\n const { value, nodeDef } = params\n return Numbers.formatDecimal(value, NodeDefs.getMaxNumberDecimalDigits(nodeDef as ArenaNodeDefDecimal))\n },\n [NodeDefType.integer]: (params: FormatParams) => {\n const { value } = params\n return Numbers.formatInteger(Number(value))\n },\n [NodeDefType.taxon]: (params: FormatParams) => {\n const { survey, value, showLabel } = params\n const taxonUuid = RecordNodeValues.getValueTaxonUuid(value)\n if (!taxonUuid) return null\n const taxon = Surveys.getTaxonByUuid({ survey, taxonUuid })\n if (!taxon) return null\n return showLabel ? Taxa.getScientificName(taxon) : Taxa.getCode(taxon)\n },\n [NodeDefType.text]: (params: FormatParams) => {\n const { value, quoteLabels } = params\n return quoteLabels ? Strings.quote(value) : value\n },\n}\n\nconst format = (params: FormatParams) => {\n const { nodeDef, value } = params\n if (Objects.isEmpty(value)) {\n return ''\n }\n const formatter = formatters[NodeDefs.getType(nodeDef)]\n const formatValue = (v: any) => (formatter ? formatter({ ...params, value: v }) : v)\n\n return NodeDefs.isMultiple(nodeDef) && Array.isArray(value) ? value.map(formatValue).join(', ') : formatValue(value)\n}\n\nexport const RecordNodeValueFormatter = {\n format,\n}\n"]}
1
+ {"version":3,"file":"nodeValueFormatter.js","sourceRoot":"","sources":["../../src/node/nodeValueFormatter.ts"],"names":[],"mappings":";;;AAAA,0CAA8D;AAE9D,wCAA0G;AAC1G,sCAAgD;AAChD,0CAAkC;AAClC,oCAAwE;AAExE,6CAA+C;AAE/C,MAAM,mBAAmB,GAAG,CAAC,MAI5B,EAAiC,EAAE;;;IAClC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,CAAA;IAEtC,MAAM,QAAQ,GAAG,6BAAgB,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAA;IACzD,IAAI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AAC,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;AACtH,CAAC,CAAA;AAEY,QAAA,wBAAwB,GAAG;IACtC,MAAM;CACP,CAAA","sourcesContent":["import { ArenaCategoryItem, CategoryItems } from '../category'\nimport { LanguageCode } from '../language'\nimport { ArenaAnyNodeDef, ArenaNodeDefCode, ArenaNodeDefDecimal, NodeDefs, NodeDefType } from '../nodeDef'\nimport { ArenaSurvey, Surveys } from '../survey'\nimport { Taxa } from '../taxonomy'\nimport { DateFormats, Dates, Numbers, Objects, Strings } from '../utils'\nimport { ArenaRecordNode } from './node'\nimport { RecordNodeValues } from './nodeValues'\n\nconst extractCategoryItem = (params: {\n survey: ArenaSurvey\n node?: ArenaRecordNode\n value: any\n}): ArenaCategoryItem | undefined => {\n const { survey, node, value } = params\n\n const itemUuid = RecordNodeValues.getValueItemUuid(value)\n if (!itemUuid) return undefined\n\n const item = node?.refData?.categoryItem ?? Surveys.getCategoryItemByUuid({ survey, itemUuid })\n // check the validity of the reference data category item\n return item?.props && Objects.isNotEmpty(CategoryItems.getCode(item)) ? item : undefined\n}\n\ntype FormatParams = {\n survey: ArenaSurvey\n cycle: string\n nodeDef: ArenaAnyNodeDef\n node?: ArenaRecordNode\n value: any\n showLabel?: boolean\n quoteLabels?: boolean\n lang?: LanguageCode\n}\n\nconst formatters: { [key in NodeDefType]?: (params: FormatParams) => any } = {\n [NodeDefType.code]: (params: FormatParams) => {\n const { survey, cycle, nodeDef, node, value, showLabel, quoteLabels, lang } = params\n\n if (!showLabel) {\n // item code already inside value, no need to get category item\n const itemCode = RecordNodeValues.getValueCode(value)\n if (!Objects.isEmpty(itemCode)) return itemCode\n }\n const categoryItem = extractCategoryItem({ survey, node, value })\n if (!categoryItem) return null\n\n if (showLabel) {\n let result\n if (NodeDefs.isCodeShown(cycle)(nodeDef as ArenaNodeDefCode)) {\n result = CategoryItems.getLabelWithCode(categoryItem, lang!)\n } else {\n result = CategoryItems.getLabel(categoryItem, lang!, true)\n }\n return quoteLabels ? Strings.quote(result) : result\n }\n return CategoryItems.getCode(categoryItem)\n },\n [NodeDefType.date]: (params: FormatParams) => {\n const { value } = params\n const dateParsed = Dates.parseISO(value)\n return Dates.format(dateParsed, DateFormats.dateDisplay)\n },\n [NodeDefType.decimal]: (params: FormatParams) => {\n const { value, nodeDef } = params\n return Numbers.formatDecimal(value, NodeDefs.getMaxNumberDecimalDigits(nodeDef as ArenaNodeDefDecimal))\n },\n [NodeDefType.integer]: (params: FormatParams) => {\n const { value } = params\n return Numbers.formatInteger(Number(value))\n },\n [NodeDefType.taxon]: (params: FormatParams) => {\n const { survey, value, showLabel } = params\n const taxonUuid = RecordNodeValues.getValueTaxonUuid(value)\n if (!taxonUuid) return null\n const taxon = Surveys.getTaxonByUuid({ survey, taxonUuid })\n if (!taxon) return null\n return showLabel ? Taxa.getScientificName(taxon) : Taxa.getCode(taxon)\n },\n [NodeDefType.text]: (params: FormatParams) => {\n const { value, quoteLabels } = params\n return quoteLabels ? Strings.quote(value) : value\n },\n}\n\nconst format = (params: FormatParams) => {\n const { nodeDef, value } = params\n if (Objects.isEmpty(value)) {\n return ''\n }\n const formatter = formatters[NodeDefs.getType(nodeDef)]\n const formatValue = (v: any) => (formatter ? formatter({ ...params, value: v }) : v)\n\n return NodeDefs.isMultiple(nodeDef) && Array.isArray(value) ? value.map(formatValue).join(', ') : formatValue(value)\n}\n\nexport const RecordNodeValueFormatter = {\n format,\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import { ArenaPoint } from '../geo';
2
- import { ArenaNodeDef, ArenaNodeDefProps, NodeDefType } from '../nodeDef';
2
+ import { ArenaAnyNodeDef, ArenaNodeDef, NodeDefType } from '../nodeDef';
3
3
  import { ArenaRecord } from '../record';
4
4
  import { ArenaSurvey } from '../survey';
5
5
  import { ArenaRecordNode } from './node';
@@ -35,11 +35,11 @@ declare const getVernacularNameUuid: (node: ArenaRecordNode) => string | undefin
35
35
  declare const getValueVernacularNameUuid: (value: any) => string | undefined;
36
36
  declare const getTimeSeconds: (node: ArenaRecordNode) => number;
37
37
  declare const isValueProp: (params: {
38
- nodeDef: ArenaNodeDef<NodeDefType, ArenaNodeDefProps>;
38
+ nodeDef: ArenaAnyNodeDef;
39
39
  prop: string;
40
40
  }) => boolean;
41
41
  declare const getNodeValueProp: (params: {
42
- nodeDef: ArenaNodeDef<NodeDefType, ArenaNodeDefProps>;
42
+ nodeDef: ArenaAnyNodeDef;
43
43
  node: ArenaRecordNode;
44
44
  prop: string;
45
45
  }) => any;
@@ -1 +1 @@
1
- {"version":3,"file":"nodeValues.js","sourceRoot":"","sources":["../../src/node/nodeValues.ts"],"names":[],"mappings":";;;AAAA,0CAA2C;AAC3C,gCAAiD;AACjD,wCAA2F;AAC3F,sCAAgD;AAChD,sCAAgD;AAChD,oCAAsD;AAGtD,qDAOyB;AAEzB;;;GAGG;AACU,QAAA,gBAAgB,GAA+D;IAC1F,CAAC,qBAAW,CAAC,OAAO,CAAC,EAAE,IAAI;IAC3B,CAAC,qBAAW,CAAC,IAAI,CAAC,EAAE,+BAAc;IAClC,CAAC,qBAAW,CAAC,UAAU,CAAC,EAAE,qCAAoB;IAC9C,CAAC,qBAAW,CAAC,IAAI,CAAC,EAAE,+BAAc;IAClC,CAAC,qBAAW,CAAC,OAAO,CAAC,EAAE,IAAI;IAC3B,CAAC,qBAAW,CAAC,GAAG,CAAC,EAAE,IAAI;IACvB,CAAC,qBAAW,CAAC,MAAM,CAAC,EAAE,IAAI;IAC1B,CAAC,qBAAW,CAAC,IAAI,CAAC,EAAE,+BAAc;IAClC,CAAC,qBAAW,CAAC,OAAO,CAAC,EAAE,IAAI;IAC3B,CAAC,qBAAW,CAAC,KAAK,CAAC,EAAE,gCAAe;IACpC,CAAC,qBAAW,CAAC,IAAI,CAAC,EAAE,+BAAc;IAClC,CAAC,qBAAW,CAAC,IAAI,CAAC,EAAE,IAAI;IACxB,kBAAkB;IAClB,CAAC,qBAAW,CAAC,UAAU,CAAC,EAAE,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,WAAW;IACX,qBAAqB;IACrB,WAAW;IACX,WAAW;IAEX,QAAQ;IACR,YAAY;IACZ,iBAAiB;IACjB,iBAAiB;IACjB,sBAAsB;IACtB,iBAAiB;IACjB,sBAAsB;IACtB,qBAAqB;IACrB,0BAA0B;IAE1B,OAAO;IACP,WAAW;IACX,aAAa;IACb,cAAc;IAEd,QAAQ;IACR,YAAY;CACb,CAAA","sourcesContent":["import { CategoryItems } from '../category'\nimport { ArenaPoint, PointFactory } from '../geo'\nimport { ArenaNodeDef, ArenaNodeDefCode, ArenaNodeDefProps, NodeDefType } from '../nodeDef'\nimport { ArenaRecord, Records } from '../record'\nimport { ArenaSurvey, Surveys } from '../survey'\nimport { DateFormats, Dates, Objects } from '../utils'\nimport { ArenaRecordNode } from './node'\nimport { ArenaRecordNodeValueCoordinate } from './nodeValue/coordinate'\nimport {\n ValuePropsCode,\n ValuePropsCoordinate,\n ValuePropsDate,\n ValuePropsFile,\n ValuePropsTaxon,\n ValuePropsTime,\n} from './nodeValueProps'\n\n/**\n * Props of node value indexed by node def type.\n * The node definitions here are only the ones of \"composite\" attributes.\n */\nexport const ValuePropsByType: { [key in NodeDefType]: { [key: string]: string } | null } = {\n [NodeDefType.boolean]: null,\n [NodeDefType.code]: ValuePropsCode,\n [NodeDefType.coordinate]: ValuePropsCoordinate,\n [NodeDefType.date]: ValuePropsDate,\n [NodeDefType.decimal]: null,\n [NodeDefType.geo]: null,\n [NodeDefType.entity]: null,\n [NodeDefType.file]: ValuePropsFile,\n [NodeDefType.integer]: null,\n [NodeDefType.taxon]: ValuePropsTaxon,\n [NodeDefType.time]: ValuePropsTime,\n [NodeDefType.text]: null,\n // layout elements\n [NodeDefType.formHeader]: null,\n}\n\nconst getValuePropRaw = (params: { value: any; prop: string; defaultValue?: any }): any => {\n const { value, prop, defaultValue } = params\n const valueProp = value?.[prop]\n return valueProp === undefined ? defaultValue : valueProp\n}\n\nconst getNodeValuePropRaw = (params: { node: ArenaRecordNode; prop: string; defaultValue?: any }): any => {\n const { node, prop, defaultValue } = params\n return getValuePropRaw({ value: node.value, prop, defaultValue })\n}\n\n// Code\nconst newCodeValue = (params: { itemUuid: string }) => {\n const { itemUuid } = params\n return { [ValuePropsCode[ValuePropsCode.itemUuid]]: itemUuid }\n}\n\nconst getItemUuid = (node: ArenaRecordNode): string | undefined =>\n getNodeValuePropRaw({ node, prop: ValuePropsCode[ValuePropsCode.itemUuid] })\n\nconst getValueCode = (value: any): string | undefined =>\n getValuePropRaw({ value, prop: ValuePropsCode[ValuePropsCode.code] })\n\nconst getValueItemUuid = (value: any): string | undefined =>\n getValuePropRaw({ value, prop: ValuePropsCode[ValuePropsCode.itemUuid] })\n\nconst getDateTimePart = (params: { node: ArenaRecordNode; index: number; separator: string }): number => {\n const { node, index, separator } = params\n return Number((node.value ?? '').split(separator)[index]?.trim())\n}\n\n// Date\nconst getDatePart =\n (index: number) =>\n (node: ArenaRecordNode): number =>\n getDateTimePart({ node, index, separator: '-' })\nconst getDateYear = getDatePart(0)\nconst getDateMonth = getDatePart(1)\nconst getDateDay = getDatePart(2)\n\nconst _datePropGetters: { [key in ValuePropsDate]: (node: ArenaRecordNode) => number } = {\n [ValuePropsDate.day]: getDateDay,\n [ValuePropsDate.month]: getDateMonth,\n [ValuePropsDate.year]: getDateYear,\n}\n\n// File\nconst getFileName = (node: ArenaRecordNode): string | undefined =>\n getNodeValuePropRaw({ node, prop: ValuePropsFile.fileName })\nconst getFileNameCalculated = (node: ArenaRecordNode): string | undefined =>\n getNodeValuePropRaw({ node, prop: ValuePropsFile.fileNameCalculated })\nconst getFileSize = (node: ArenaRecordNode): string | undefined =>\n getNodeValuePropRaw({ node, prop: ValuePropsFile.fileSize })\nconst getFileUuid = (node: ArenaRecordNode): string | undefined =>\n getNodeValuePropRaw({ node, prop: ValuePropsFile.fileUuid })\n\n// Taxon\nconst getTaxonUuid = (node: ArenaRecordNode): string | undefined =>\n getNodeValuePropRaw({ node, prop: ValuePropsTaxon[ValuePropsTaxon.taxonUuid] })\nconst getValueTaxonUuid = (value: any): string | undefined =>\n getValuePropRaw({ value, prop: ValuePropsTaxon[ValuePropsTaxon.taxonUuid] })\nconst getScientificName = (node: ArenaRecordNode): string | undefined =>\n getNodeValuePropRaw({ node, prop: ValuePropsTaxon[ValuePropsTaxon.scientificName] })\nconst getValueScientificName = (value: any): string | undefined =>\n getValuePropRaw({ value, prop: ValuePropsTaxon[ValuePropsTaxon.scientificName] })\nconst getVernacularName = (node: ArenaRecordNode): string | undefined =>\n getNodeValuePropRaw({ node, prop: ValuePropsTaxon[ValuePropsTaxon.vernacularName] })\nconst getValueVernacularName = (value: any): string | undefined =>\n getValuePropRaw({ value, prop: ValuePropsTaxon[ValuePropsTaxon.vernacularName] })\nconst getVernacularNameUuid = (node: ArenaRecordNode): string | undefined =>\n getNodeValuePropRaw({ node, prop: ValuePropsTaxon[ValuePropsTaxon.vernacularNameUuid] })\nconst getValueVernacularNameUuid = (value: any): string | undefined =>\n getValuePropRaw({ value, prop: ValuePropsTaxon[ValuePropsTaxon.vernacularNameUuid] })\n\n// Time\nconst _getTimePart =\n (index: number) =>\n (node: ArenaRecordNode): number =>\n getDateTimePart({ node, index, separator: ':' })\nconst getTimeHour = _getTimePart(0)\nconst getTimeMinute = _getTimePart(1)\nconst getTimeSeconds = (node: ArenaRecordNode): number => {\n const parts = (node.value ?? '').split(':')\n return parts.length > 2 ? _getTimePart(2)(node) : 0\n}\n\nconst _timePropGetters: { [key in ValuePropsTime]: any } = {\n [ValuePropsTime.hour]: getTimeHour,\n [ValuePropsTime.minute]: getTimeMinute,\n [ValuePropsTime.seconds]: getTimeSeconds,\n}\n\nconst _valuePropGetters: { [key in NodeDefType]?: (prop: string) => (node: ArenaRecordNode) => number } = {\n [NodeDefType.date]: (prop: string) => _datePropGetters[ValuePropsDate[prop as keyof typeof ValuePropsDate]],\n [NodeDefType.time]: (prop: string) => _timePropGetters[ValuePropsTime[prop as keyof typeof ValuePropsTime]],\n}\n\nconst isValueProp = (params: { nodeDef: ArenaNodeDef<NodeDefType, ArenaNodeDefProps>; prop: string }): boolean => {\n const { nodeDef, prop } = params\n return Object.values(ValuePropsByType[nodeDef.type] ?? {}).includes(prop)\n}\n\nconst getNodeValueProp = (params: {\n nodeDef: ArenaNodeDef<NodeDefType, ArenaNodeDefProps>\n node: ArenaRecordNode\n prop: string\n}): any => {\n const { nodeDef, node, prop } = params\n const propGetter: any = _valuePropGetters[nodeDef.type]\n return propGetter ? propGetter(prop)(node) : getNodeValuePropRaw({ node, prop })\n}\n\n// value compare\n\nconst singlePropValueEqualComparator = (params: NodeValuesCompareParams): boolean => {\n const { value, valueSearch } = params\n return value === valueSearch || String(value) === String(valueSearch)\n}\n\nconst extractCategoryItemUuidFromValue = (params: NodeValuesCompareParams): string | undefined => {\n const { survey, nodeDef, record, parentNode, value } = params\n const valueItemUuid = getValueItemUuid(value)\n if (valueItemUuid) {\n return valueItemUuid\n }\n // find itemUuid by code\n const valueCode = getValueCode(value)\n if (Objects.isEmpty(valueCode)) return undefined\n\n const nodeDefCode = nodeDef as ArenaNodeDefCode\n const code = valueCode!\n const categoryUuid = nodeDefCode.props?.categoryUuid\n const levelIndex = Surveys.getNodeDefCategoryLevelIndex({ survey, nodeDef: nodeDefCode })\n if (levelIndex === 0) {\n return Surveys.getCategoryItemUuidByCode({ survey, categoryUuid, parentItemUuid: undefined, code })\n }\n if (!record || !parentNode) return undefined\n\n const parentCodeAttribute = Records.getParentCodeAttribute(parentNode, nodeDef as ArenaNodeDefCode)(record)\n if (!parentCodeAttribute) return undefined\n\n const parentItemUuid = getItemUuid(parentCodeAttribute)\n if (!parentItemUuid) return undefined\n\n return Surveys.getCategoryItemUuidByCode({\n survey,\n categoryUuid,\n parentItemUuid,\n code,\n })\n}\n\nconst extractCategoryItemCodeFromValue = (params: { survey: ArenaSurvey; value: any }): string | undefined => {\n const { survey, value } = params\n const itemUuid = getValueItemUuid(value)\n if (itemUuid) {\n const item = Surveys.getCategoryItemByUuid({ survey, itemUuid })\n return item ? CategoryItems.getCode(item) : undefined\n }\n return getValueCode(value)\n}\n\ntype DateTimeFormats = { formatsSource: DateFormats[]; formatTo: DateFormats }\n\nconst dateFormats: DateTimeFormats = {\n formatsSource: [DateFormats.dateDisplay, DateFormats.dateStorage],\n formatTo: DateFormats.dateStorage,\n}\n\nconst timeFormats: DateTimeFormats = {\n formatsSource: [DateFormats.timeStorage, DateFormats.timeWithSeconds],\n formatTo: DateFormats.timeWithSeconds,\n}\n\nconst toDateTime = (params: DateTimeFormats & { value: any }) => {\n const { formatsSource, formatTo, value } = params\n if (value instanceof Date) {\n return Dates.format(value, formatTo)\n }\n const formatFrom = formatsSource.find((format) => Dates.isValidDateInFormat(value, format))\n return formatFrom ? Dates.convertDate({ dateStr: value, formatFrom, formatTo }) : null\n}\n\nconst dateTimeComparator =\n (formats: DateTimeFormats) =>\n (paramsComparator: NodeValuesCompareParams): boolean => {\n const { value, valueSearch } = paramsComparator\n const dateTime = toDateTime({ ...formats, value })\n const dateTimeSearch = toDateTime({ ...formats, value: valueSearch })\n return !!dateTime && !!dateTimeSearch && dateTime === dateTimeSearch\n }\n\nconst valueComparatorByNodeDefType: { [key in NodeDefType]?: (params: NodeValuesCompareParams) => boolean } = {\n [NodeDefType.boolean]: singlePropValueEqualComparator,\n [NodeDefType.code]: (params: NodeValuesCompareParams): boolean => {\n const { survey, record, value, valueSearch, strict } = params\n if (!strict || !record) {\n // compare just codes (record not available, tricky to find the \"correct\" category item without knowing its parent item)\n const code = extractCategoryItemCodeFromValue({ survey, value })\n const codeSearch = extractCategoryItemCodeFromValue({ survey, value: valueSearch })\n return !!code && !!codeSearch && code === codeSearch\n }\n const itemUuid = extractCategoryItemUuidFromValue(params)\n const itemUuidSearch = extractCategoryItemUuidFromValue({\n ...params,\n value: valueSearch,\n })\n return !!itemUuidSearch && !!itemUuid && itemUuidSearch === itemUuid\n },\n [NodeDefType.coordinate]: (params: NodeValuesCompareParams) => {\n const { value, valueSearch } = params\n return Objects.isEqual(value, valueSearch)\n },\n [NodeDefType.date]: dateTimeComparator(dateFormats),\n [NodeDefType.decimal]: singlePropValueEqualComparator,\n [NodeDefType.integer]: singlePropValueEqualComparator,\n [NodeDefType.taxon]: ({ value, valueSearch }) => {\n if (value === valueSearch) return true\n if (!value) return false\n if (!valueSearch) return false\n return value[ValuePropsTaxon.taxonUuid] === valueSearch[ValuePropsTaxon.taxonUuid]\n },\n [NodeDefType.text]: singlePropValueEqualComparator,\n [NodeDefType.time]: dateTimeComparator(timeFormats),\n}\n\ninterface NodeValuesCompareParams {\n survey: ArenaSurvey\n nodeDef: ArenaNodeDef<NodeDefType, any>\n value: any\n valueSearch: any\n record?: ArenaRecord\n parentNode?: ArenaRecordNode\n strict?: boolean\n}\n\nconst isValueEqual = (params: NodeValuesCompareParams): boolean => {\n const { survey, nodeDef, value, valueSearch, record = undefined, parentNode = undefined, strict = false } = params\n if (value === valueSearch) return true\n if (Objects.isEmpty(value) || Objects.isEmpty(valueSearch)) return false\n\n const valueComparator = valueComparatorByNodeDefType[nodeDef.type]\n if (!valueComparator) {\n return Objects.isEqual(value, valueSearch)\n }\n return valueComparator({ survey, nodeDef, record, parentNode, value, valueSearch, strict })\n}\n\nconst primitiveTypes = new Set(['string', 'number', 'boolean', 'undefined', 'bigint'])\n\n// token of a primitive value, equal for strictly equal (===) values only (distinguishes \"1\" from 1);\n// undefined for non primitive values and NaN (not equal to itself)\nconst toPrimitiveToken = (value: any): string | undefined =>\n (value === null || primitiveTypes.has(typeof value)) && !Number.isNaN(value)\n ? `${typeof value}:${String(value)}`\n : undefined\n\nconst dateTimeKeyExtractor =\n (formats: DateTimeFormats) =>\n ({ value }: { value: any }): string | undefined =>\n toDateTime({ ...formats, value }) || undefined\n\nconst valueEqualityKeyByNodeDefType: {\n [key in NodeDefType]?: (params: { survey: ArenaSurvey; value: any }) => string | undefined\n} = {\n [NodeDefType.boolean]: ({ value }) => String(value),\n [NodeDefType.code]: ({ survey, value }) => {\n const code = extractCategoryItemCodeFromValue({ survey, value })\n return code ? toPrimitiveToken(code) : undefined\n },\n [NodeDefType.date]: dateTimeKeyExtractor(dateFormats),\n [NodeDefType.decimal]: ({ value }) => String(value),\n [NodeDefType.integer]: ({ value }) => String(value),\n [NodeDefType.taxon]: ({ value }) => toPrimitiveToken(value[ValuePropsTaxon.taxonUuid]),\n [NodeDefType.text]: ({ value }) => String(value),\n [NodeDefType.time]: dateTimeKeyExtractor(timeFormats),\n}\n\n/**\n * Returns a key such that two values have the same key if and only if they are equal according to isValueEqual\n * (not strict, without record), or undefined if such a key cannot be built for the value (e.g. NaN, empty objects, code values\n * without code, invalid dates, coordinates): such values must be compared with isValueEqual.\n * Not exported in RecordNodeValues: internal, used to look up duplicate values without comparing every pair of values.\n */\nexport const getValueEqualityKey = (params: {\n survey: ArenaSurvey\n nodeDef: ArenaNodeDef<NodeDefType, any>\n value: any\n}): string | undefined => {\n const { survey, nodeDef, value } = params\n if (Objects.isEmpty(value)) {\n // empty values are equal only if identical (===)\n const token = toPrimitiveToken(value)\n return token === undefined ? undefined : `empty:${token}`\n }\n const keyExtractor = valueEqualityKeyByNodeDefType[nodeDef.type]\n const key = keyExtractor?.({ survey, value })\n return key === undefined ? undefined : `value:${key}`\n}\n\nconst getValueAsPoint = (params: { survey: ArenaSurvey; node: ArenaRecordNode }): ArenaPoint | null => {\n const { survey, node } = params\n const nodeValue = node?.value\n\n if (!nodeValue) return null\n\n const nodeDef = Surveys.getNodeDefByUuid({ survey, uuid: node.nodeDefUuid })\n if (nodeDef.type === NodeDefType.coordinate) {\n const { x, y, srs } = nodeValue as ArenaRecordNodeValueCoordinate\n\n const srsObject = Surveys.getSRSByCode(srs)(survey)\n if (!srsObject) return null\n\n return PointFactory.createInstance({ srs, x, y })\n }\n return null\n}\n\nexport const RecordNodeValues = {\n ValuePropsByType,\n ValuePropsCode,\n ValuePropsCoordinate,\n ValuePropsDate,\n ValuePropsFile,\n ValuePropsTaxon,\n ValuePropsTime,\n\n getNodeValueProp,\n isValueProp,\n\n // coordinate\n getValueAsPoint,\n\n // code\n newCodeValue,\n getItemUuid,\n getValueCode,\n getValueItemUuid,\n\n // date\n getDateYear,\n getDateMonth,\n getDateDay,\n\n // file\n getFileName,\n getFileNameCalculated,\n getFileSize,\n getFileUuid,\n\n // taxon\n getTaxonUuid,\n getValueTaxonUuid,\n getScientificName,\n getValueScientificName,\n getVernacularName,\n getValueVernacularName,\n getVernacularNameUuid,\n getValueVernacularNameUuid,\n\n // time\n getTimeHour,\n getTimeMinute,\n getTimeSeconds,\n\n // utils\n isValueEqual,\n}\n"]}
1
+ {"version":3,"file":"nodeValues.js","sourceRoot":"","sources":["../../src/node/nodeValues.ts"],"names":[],"mappings":";;;AAAA,0CAA2C;AAC3C,gCAAiD;AACjD,wCAAyF;AACzF,sCAAgD;AAChD,sCAAgD;AAChD,oCAAsD;AAGtD,qDAOyB;AAEzB;;;GAGG;AACU,QAAA,gBAAgB,GAA+D;IAC1F,CAAC,qBAAW,CAAC,OAAO,CAAC,EAAE,IAAI;IAC3B,CAAC,qBAAW,CAAC,IAAI,CAAC,EAAE,+BAAc;IAClC,CAAC,qBAAW,CAAC,UAAU,CAAC,EAAE,qCAAoB;IAC9C,CAAC,qBAAW,CAAC,IAAI,CAAC,EAAE,+BAAc;IAClC,CAAC,qBAAW,CAAC,OAAO,CAAC,EAAE,IAAI;IAC3B,CAAC,qBAAW,CAAC,GAAG,CAAC,EAAE,IAAI;IACvB,CAAC,qBAAW,CAAC,MAAM,CAAC,EAAE,IAAI;IAC1B,CAAC,qBAAW,CAAC,IAAI,CAAC,EAAE,+BAAc;IAClC,CAAC,qBAAW,CAAC,OAAO,CAAC,EAAE,IAAI;IAC3B,CAAC,qBAAW,CAAC,KAAK,CAAC,EAAE,gCAAe;IACpC,CAAC,qBAAW,CAAC,IAAI,CAAC,EAAE,+BAAc;IAClC,CAAC,qBAAW,CAAC,IAAI,CAAC,EAAE,IAAI;IACxB,kBAAkB;IAClB,CAAC,qBAAW,CAAC,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AU;IAEV,OAAO;IACP,WAAW;IACX,qBAAqB;IACrB,WAAW;IACX,WAAW;IAEX,QAAQ;IACR,YAAY;IACZ,iBAAiB;IACjB,iBAAiB;IACjB,sBAAsB;IACtB,iBAAiB;IACjB,sBAAsB;IACtB,qBAAqB;IACrB,0BAA0B;IAE1B,OAAO;IACP,WAAW;IACX,aAAa;IACb,cAAc;IAEd,QAAQ;IACR,YAAY;CACb,CAAA","sourcesContent":["import { CategoryItems } from '../category'\nimport { ArenaPoint, PointFactory } from '../geo'\nimport { ArenaAnyNodeDef, ArenaNodeDef, ArenaNodeDefCode, NodeDefType } from '../nodeDef'\nimport { ArenaRecord, Records } from '../record'\nimport { ArenaSurvey, Surveys } from '../survey'\nimport { DateFormats, Dates, Objects } from '../utils'\nimport { ArenaRecordNode } from './node'\nimport { ArenaRecordNodeValueCoordinate } from './nodeValue/coordinate'\nimport {\n ValuePropsCode,\n ValuePropsCoordinate,\n ValuePropsDate,\n ValuePropsFile,\n ValuePropsTaxon,\n ValuePropsTime,\n} from './nodeValueProps'\n\n/**\n * Props of node value indexed by node def type.\n * The node definitions here are only the ones of \"composite\" attributes.\n */\nexport const ValuePropsByType: { [key in NodeDefType]: { [key: string]: string } | null } = {\n [NodeDefType.boolean]: null,\n [NodeDefType.code]: ValuePropsCode,\n [NodeDefType.coordinate]: ValuePropsCoordinate,\n [NodeDefType.date]: ValuePropsDate,\n [NodeDefType.decimal]: null,\n [NodeDefType.geo]: null,\n [NodeDefType.entity]: null,\n [NodeDefType.file]: ValuePropsFile,\n [NodeDefType.integer]: null,\n [NodeDefType.taxon]: ValuePropsTaxon,\n [NodeDefType.time]: ValuePropsTime,\n [NodeDefType.text]: null,\n // layout elements\n [NodeDefType.formHeader]: null,\n}\n\nconst getValuePropRaw = (params: { value: any; prop: string; defaultValue?: any }): any => {\n const { value, prop, defaultValue } = params\n const valueProp = value?.[prop]\n return valueProp === undefined ? defaultValue : valueProp\n}\n\nconst getNodeValuePropRaw = (params: { node: ArenaRecordNode; prop: string; defaultValue?: any }): any => {\n const { node, prop, defaultValue } = params\n return getValuePropRaw({ value: node.value, prop, defaultValue })\n}\n\n// Code\nconst newCodeValue = (params: { itemUuid: string }) => {\n const { itemUuid } = params\n return { [ValuePropsCode[ValuePropsCode.itemUuid]]: itemUuid }\n}\n\nconst getItemUuid = (node: ArenaRecordNode): string | undefined =>\n getNodeValuePropRaw({ node, prop: ValuePropsCode[ValuePropsCode.itemUuid] })\n\nconst getValueCode = (value: any): string | undefined =>\n getValuePropRaw({ value, prop: ValuePropsCode[ValuePropsCode.code] })\n\nconst getValueItemUuid = (value: any): string | undefined =>\n getValuePropRaw({ value, prop: ValuePropsCode[ValuePropsCode.itemUuid] })\n\nconst getDateTimePart = (params: { node: ArenaRecordNode; index: number; separator: string }): number => {\n const { node, index, separator } = params\n return Number((node.value ?? '').split(separator)[index]?.trim())\n}\n\n// Date\nconst getDatePart =\n (index: number) =>\n (node: ArenaRecordNode): number =>\n getDateTimePart({ node, index, separator: '-' })\nconst getDateYear = getDatePart(0)\nconst getDateMonth = getDatePart(1)\nconst getDateDay = getDatePart(2)\n\nconst _datePropGetters: { [key in ValuePropsDate]: (node: ArenaRecordNode) => number } = {\n [ValuePropsDate.day]: getDateDay,\n [ValuePropsDate.month]: getDateMonth,\n [ValuePropsDate.year]: getDateYear,\n}\n\n// File\nconst getFileName = (node: ArenaRecordNode): string | undefined =>\n getNodeValuePropRaw({ node, prop: ValuePropsFile.fileName })\nconst getFileNameCalculated = (node: ArenaRecordNode): string | undefined =>\n getNodeValuePropRaw({ node, prop: ValuePropsFile.fileNameCalculated })\nconst getFileSize = (node: ArenaRecordNode): string | undefined =>\n getNodeValuePropRaw({ node, prop: ValuePropsFile.fileSize })\nconst getFileUuid = (node: ArenaRecordNode): string | undefined =>\n getNodeValuePropRaw({ node, prop: ValuePropsFile.fileUuid })\n\n// Taxon\nconst getTaxonUuid = (node: ArenaRecordNode): string | undefined =>\n getNodeValuePropRaw({ node, prop: ValuePropsTaxon[ValuePropsTaxon.taxonUuid] })\nconst getValueTaxonUuid = (value: any): string | undefined =>\n getValuePropRaw({ value, prop: ValuePropsTaxon[ValuePropsTaxon.taxonUuid] })\nconst getScientificName = (node: ArenaRecordNode): string | undefined =>\n getNodeValuePropRaw({ node, prop: ValuePropsTaxon[ValuePropsTaxon.scientificName] })\nconst getValueScientificName = (value: any): string | undefined =>\n getValuePropRaw({ value, prop: ValuePropsTaxon[ValuePropsTaxon.scientificName] })\nconst getVernacularName = (node: ArenaRecordNode): string | undefined =>\n getNodeValuePropRaw({ node, prop: ValuePropsTaxon[ValuePropsTaxon.vernacularName] })\nconst getValueVernacularName = (value: any): string | undefined =>\n getValuePropRaw({ value, prop: ValuePropsTaxon[ValuePropsTaxon.vernacularName] })\nconst getVernacularNameUuid = (node: ArenaRecordNode): string | undefined =>\n getNodeValuePropRaw({ node, prop: ValuePropsTaxon[ValuePropsTaxon.vernacularNameUuid] })\nconst getValueVernacularNameUuid = (value: any): string | undefined =>\n getValuePropRaw({ value, prop: ValuePropsTaxon[ValuePropsTaxon.vernacularNameUuid] })\n\n// Time\nconst _getTimePart =\n (index: number) =>\n (node: ArenaRecordNode): number =>\n getDateTimePart({ node, index, separator: ':' })\nconst getTimeHour = _getTimePart(0)\nconst getTimeMinute = _getTimePart(1)\nconst getTimeSeconds = (node: ArenaRecordNode): number => {\n const parts = (node.value ?? '').split(':')\n return parts.length > 2 ? _getTimePart(2)(node) : 0\n}\n\nconst _timePropGetters: { [key in ValuePropsTime]: any } = {\n [ValuePropsTime.hour]: getTimeHour,\n [ValuePropsTime.minute]: getTimeMinute,\n [ValuePropsTime.seconds]: getTimeSeconds,\n}\n\nconst _valuePropGetters: { [key in NodeDefType]?: (prop: string) => (node: ArenaRecordNode) => number } = {\n [NodeDefType.date]: (prop: string) => _datePropGetters[ValuePropsDate[prop as keyof typeof ValuePropsDate]],\n [NodeDefType.time]: (prop: string) => _timePropGetters[ValuePropsTime[prop as keyof typeof ValuePropsTime]],\n}\n\nconst isValueProp = (params: { nodeDef: ArenaAnyNodeDef; prop: string }): boolean => {\n const { nodeDef, prop } = params\n return Object.values(ValuePropsByType[nodeDef.type] ?? {}).includes(prop)\n}\n\nconst getNodeValueProp = (params: { nodeDef: ArenaAnyNodeDef; node: ArenaRecordNode; prop: string }): any => {\n const { nodeDef, node, prop } = params\n const propGetter: any = _valuePropGetters[nodeDef.type]\n return propGetter ? propGetter(prop)(node) : getNodeValuePropRaw({ node, prop })\n}\n\n// value compare\n\nconst singlePropValueEqualComparator = (params: NodeValuesCompareParams): boolean => {\n const { value, valueSearch } = params\n return value === valueSearch || String(value) === String(valueSearch)\n}\n\nconst extractCategoryItemUuidFromValue = (params: NodeValuesCompareParams): string | undefined => {\n const { survey, nodeDef, record, parentNode, value } = params\n const valueItemUuid = getValueItemUuid(value)\n if (valueItemUuid) {\n return valueItemUuid\n }\n // find itemUuid by code\n const valueCode = getValueCode(value)\n if (Objects.isEmpty(valueCode)) return undefined\n\n const nodeDefCode = nodeDef as ArenaNodeDefCode\n const code = valueCode!\n const categoryUuid = nodeDefCode.props?.categoryUuid\n const levelIndex = Surveys.getNodeDefCategoryLevelIndex({ survey, nodeDef: nodeDefCode })\n if (levelIndex === 0) {\n return Surveys.getCategoryItemUuidByCode({ survey, categoryUuid, parentItemUuid: undefined, code })\n }\n if (!record || !parentNode) return undefined\n\n const parentCodeAttribute = Records.getParentCodeAttribute(parentNode, nodeDef as ArenaNodeDefCode)(record)\n if (!parentCodeAttribute) return undefined\n\n const parentItemUuid = getItemUuid(parentCodeAttribute)\n if (!parentItemUuid) return undefined\n\n return Surveys.getCategoryItemUuidByCode({\n survey,\n categoryUuid,\n parentItemUuid,\n code,\n })\n}\n\nconst extractCategoryItemCodeFromValue = (params: { survey: ArenaSurvey; value: any }): string | undefined => {\n const { survey, value } = params\n const itemUuid = getValueItemUuid(value)\n if (itemUuid) {\n const item = Surveys.getCategoryItemByUuid({ survey, itemUuid })\n return item ? CategoryItems.getCode(item) : undefined\n }\n return getValueCode(value)\n}\n\ntype DateTimeFormats = { formatsSource: DateFormats[]; formatTo: DateFormats }\n\nconst dateFormats: DateTimeFormats = {\n formatsSource: [DateFormats.dateDisplay, DateFormats.dateStorage],\n formatTo: DateFormats.dateStorage,\n}\n\nconst timeFormats: DateTimeFormats = {\n formatsSource: [DateFormats.timeStorage, DateFormats.timeWithSeconds],\n formatTo: DateFormats.timeWithSeconds,\n}\n\nconst toDateTime = (params: DateTimeFormats & { value: any }) => {\n const { formatsSource, formatTo, value } = params\n if (value instanceof Date) {\n return Dates.format(value, formatTo)\n }\n const formatFrom = formatsSource.find((format) => Dates.isValidDateInFormat(value, format))\n return formatFrom ? Dates.convertDate({ dateStr: value, formatFrom, formatTo }) : null\n}\n\nconst dateTimeComparator =\n (formats: DateTimeFormats) =>\n (paramsComparator: NodeValuesCompareParams): boolean => {\n const { value, valueSearch } = paramsComparator\n const dateTime = toDateTime({ ...formats, value })\n const dateTimeSearch = toDateTime({ ...formats, value: valueSearch })\n return !!dateTime && !!dateTimeSearch && dateTime === dateTimeSearch\n }\n\nconst valueComparatorByNodeDefType: { [key in NodeDefType]?: (params: NodeValuesCompareParams) => boolean } = {\n [NodeDefType.boolean]: singlePropValueEqualComparator,\n [NodeDefType.code]: (params: NodeValuesCompareParams): boolean => {\n const { survey, record, value, valueSearch, strict } = params\n if (!strict || !record) {\n // compare just codes (record not available, tricky to find the \"correct\" category item without knowing its parent item)\n const code = extractCategoryItemCodeFromValue({ survey, value })\n const codeSearch = extractCategoryItemCodeFromValue({ survey, value: valueSearch })\n return !!code && !!codeSearch && code === codeSearch\n }\n const itemUuid = extractCategoryItemUuidFromValue(params)\n const itemUuidSearch = extractCategoryItemUuidFromValue({\n ...params,\n value: valueSearch,\n })\n return !!itemUuidSearch && !!itemUuid && itemUuidSearch === itemUuid\n },\n [NodeDefType.coordinate]: (params: NodeValuesCompareParams) => {\n const { value, valueSearch } = params\n return Objects.isEqual(value, valueSearch)\n },\n [NodeDefType.date]: dateTimeComparator(dateFormats),\n [NodeDefType.decimal]: singlePropValueEqualComparator,\n [NodeDefType.integer]: singlePropValueEqualComparator,\n [NodeDefType.taxon]: ({ value, valueSearch }) => {\n if (value === valueSearch) return true\n if (!value) return false\n if (!valueSearch) return false\n return value[ValuePropsTaxon.taxonUuid] === valueSearch[ValuePropsTaxon.taxonUuid]\n },\n [NodeDefType.text]: singlePropValueEqualComparator,\n [NodeDefType.time]: dateTimeComparator(timeFormats),\n}\n\ninterface NodeValuesCompareParams {\n survey: ArenaSurvey\n nodeDef: ArenaNodeDef<NodeDefType, any>\n value: any\n valueSearch: any\n record?: ArenaRecord\n parentNode?: ArenaRecordNode\n strict?: boolean\n}\n\nconst isValueEqual = (params: NodeValuesCompareParams): boolean => {\n const { survey, nodeDef, value, valueSearch, record = undefined, parentNode = undefined, strict = false } = params\n if (value === valueSearch) return true\n if (Objects.isEmpty(value) || Objects.isEmpty(valueSearch)) return false\n\n const valueComparator = valueComparatorByNodeDefType[nodeDef.type]\n if (!valueComparator) {\n return Objects.isEqual(value, valueSearch)\n }\n return valueComparator({ survey, nodeDef, record, parentNode, value, valueSearch, strict })\n}\n\nconst primitiveTypes = new Set(['string', 'number', 'boolean', 'undefined', 'bigint'])\n\n// token of a primitive value, equal for strictly equal (===) values only (distinguishes \"1\" from 1);\n// undefined for non primitive values and NaN (not equal to itself)\nconst toPrimitiveToken = (value: any): string | undefined =>\n (value === null || primitiveTypes.has(typeof value)) && !Number.isNaN(value)\n ? `${typeof value}:${String(value)}`\n : undefined\n\nconst dateTimeKeyExtractor =\n (formats: DateTimeFormats) =>\n ({ value }: { value: any }): string | undefined =>\n toDateTime({ ...formats, value }) || undefined\n\nconst valueEqualityKeyByNodeDefType: {\n [key in NodeDefType]?: (params: { survey: ArenaSurvey; value: any }) => string | undefined\n} = {\n [NodeDefType.boolean]: ({ value }) => String(value),\n [NodeDefType.code]: ({ survey, value }) => {\n const code = extractCategoryItemCodeFromValue({ survey, value })\n return code ? toPrimitiveToken(code) : undefined\n },\n [NodeDefType.date]: dateTimeKeyExtractor(dateFormats),\n [NodeDefType.decimal]: ({ value }) => String(value),\n [NodeDefType.integer]: ({ value }) => String(value),\n [NodeDefType.taxon]: ({ value }) => toPrimitiveToken(value[ValuePropsTaxon.taxonUuid]),\n [NodeDefType.text]: ({ value }) => String(value),\n [NodeDefType.time]: dateTimeKeyExtractor(timeFormats),\n}\n\n/**\n * Returns a key such that two values have the same key if and only if they are equal according to isValueEqual\n * (not strict, without record), or undefined if such a key cannot be built for the value (e.g. NaN, empty objects, code values\n * without code, invalid dates, coordinates): such values must be compared with isValueEqual.\n * Not exported in RecordNodeValues: internal, used to look up duplicate values without comparing every pair of values.\n */\nexport const getValueEqualityKey = (params: {\n survey: ArenaSurvey\n nodeDef: ArenaNodeDef<NodeDefType, any>\n value: any\n}): string | undefined => {\n const { survey, nodeDef, value } = params\n if (Objects.isEmpty(value)) {\n // empty values are equal only if identical (===)\n const token = toPrimitiveToken(value)\n return token === undefined ? undefined : `empty:${token}`\n }\n const keyExtractor = valueEqualityKeyByNodeDefType[nodeDef.type]\n const key = keyExtractor?.({ survey, value })\n return key === undefined ? undefined : `value:${key}`\n}\n\nconst getValueAsPoint = (params: { survey: ArenaSurvey; node: ArenaRecordNode }): ArenaPoint | null => {\n const { survey, node } = params\n const nodeValue = node?.value\n\n if (!nodeValue) return null\n\n const nodeDef = Surveys.getNodeDefByUuid({ survey, uuid: node.nodeDefUuid })\n if (nodeDef.type === NodeDefType.coordinate) {\n const { x, y, srs } = nodeValue as ArenaRecordNodeValueCoordinate\n\n const srsObject = Surveys.getSRSByCode(srs)(survey)\n if (!srsObject) return null\n\n return PointFactory.createInstance({ srs, x, y })\n }\n return null\n}\n\nexport const RecordNodeValues = {\n ValuePropsByType,\n ValuePropsCode,\n ValuePropsCoordinate,\n ValuePropsDate,\n ValuePropsFile,\n ValuePropsTaxon,\n ValuePropsTime,\n\n getNodeValueProp,\n isValueProp,\n\n // coordinate\n getValueAsPoint,\n\n // code\n newCodeValue,\n getItemUuid,\n getValueCode,\n getValueItemUuid,\n\n // date\n getDateYear,\n getDateMonth,\n getDateDay,\n\n // file\n getFileName,\n getFileNameCalculated,\n getFileSize,\n getFileUuid,\n\n // taxon\n getTaxonUuid,\n getValueTaxonUuid,\n getScientificName,\n getValueScientificName,\n getVernacularName,\n getValueVernacularName,\n getVernacularNameUuid,\n getValueVernacularNameUuid,\n\n // time\n getTimeHour,\n getTimeMinute,\n getTimeSeconds,\n\n // utils\n isValueEqual,\n}\n"]}
@@ -1,11 +1,11 @@
1
1
  import { ArenaFactory } from '../common';
2
- import { ArenaNodeDef, NodeDefType, ArenaNodeDefProps, ArenaNodeDefPropsAdvanced } from './nodeDef';
2
+ import { ArenaAnyNodeDef, NodeDefType, ArenaNodeDefProps, ArenaNodeDefPropsAdvanced } from './nodeDef';
3
3
  export type NodeDefFactoryParams = {
4
4
  analysis?: boolean;
5
- nodeDefParent?: ArenaNodeDef<NodeDefType>;
5
+ nodeDefParent?: ArenaAnyNodeDef;
6
6
  props?: ArenaNodeDefProps;
7
7
  propsAdvanced?: ArenaNodeDefPropsAdvanced;
8
8
  type: NodeDefType;
9
9
  virtual?: boolean;
10
10
  };
11
- export declare const NodeDefFactory: ArenaFactory<ArenaNodeDef<NodeDefType>, NodeDefFactoryParams>;
11
+ export declare const NodeDefFactory: ArenaFactory<ArenaAnyNodeDef, NodeDefFactoryParams>;
@@ -1 +1 @@
1
- {"version":3,"file":"factory.js","sourceRoot":"","sources":["../../src/nodeDef/factory.ts"],"names":[],"mappings":";;;AACA,oCAAgC;AAYhC,MAAM,YAAY,GAAG;IACnB,QAAQ,EAAE,KAAK;IACf,KAAK,EAAE,IAAI;IACX,aAAa,EAAE,IAAI;IACnB,SAAS,EAAE,KAAK;IAChB,SAAS,EAAE,IAAI;IACf,OAAO,EAAE,KAAK;CACf,CAAA;AAEY,QAAA,cAAc,GAAkE;IAC3F,cAAc,EAAE,CAAC,MAA4B,EAA6B,EAAE;QAC1E,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,mCAC9F,YAAY,GACZ,MAAM,CACV,CAAA;QAED,OAAO;YACL,QAAQ;YACR,KAAK;YACL,IAAI,EAAE;gBACJ,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;aACtE;YACD,UAAU,EAAE,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,IAAI;YAC/B,KAAK,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE;YAClB,aAAa;YACb,SAAS;YACT,SAAS;YACT,IAAI;YACJ,IAAI,EAAE,aAAK,CAAC,EAAE,EAAE;YAChB,OAAO;SACR,CAAA;IACH,CAAC;CACF,CAAA","sourcesContent":["import { ArenaFactory } from '../common'\nimport { UUIDs } from '../utils'\nimport { ArenaNodeDef, NodeDefType, ArenaNodeDefProps, ArenaNodeDefPropsAdvanced } from './nodeDef'\n\nexport type NodeDefFactoryParams = {\n analysis?: boolean\n nodeDefParent?: ArenaNodeDef<NodeDefType>\n props?: ArenaNodeDefProps\n propsAdvanced?: ArenaNodeDefPropsAdvanced\n type: NodeDefType\n virtual?: boolean\n}\n\nconst defaultProps = {\n analysis: false,\n draft: true,\n nodeDefParent: null,\n published: false,\n temporary: true,\n virtual: false,\n}\n\nexport const NodeDefFactory: ArenaFactory<ArenaNodeDef<NodeDefType>, NodeDefFactoryParams> = {\n createInstance: (params: NodeDefFactoryParams): ArenaNodeDef<NodeDefType> => {\n const { analysis, draft, nodeDefParent, props, propsAdvanced, published, temporary, type, virtual } = {\n ...defaultProps,\n ...params,\n }\n\n return {\n analysis,\n draft,\n meta: {\n h: nodeDefParent ? [...nodeDefParent.meta.h, nodeDefParent.uuid] : [],\n },\n parentUuid: nodeDefParent?.uuid,\n props: props ?? {},\n propsAdvanced,\n published,\n temporary,\n type,\n uuid: UUIDs.v4(),\n virtual,\n }\n },\n}\n"]}
1
+ {"version":3,"file":"factory.js","sourceRoot":"","sources":["../../src/nodeDef/factory.ts"],"names":[],"mappings":";;;AACA,oCAAgC;AAYhC,MAAM,YAAY,GAAG;IACnB,QAAQ,EAAE,KAAK;IACf,KAAK,EAAE,IAAI;IACX,aAAa,EAAE,IAAI;IACnB,SAAS,EAAE,KAAK;IAChB,SAAS,EAAE,IAAI;IACf,OAAO,EAAE,KAAK;CACf,CAAA;AAEY,QAAA,cAAc,GAAwD;IACjF,cAAc,EAAE,CAAC,MAA4B,EAAmB,EAAE;QAChE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,mCAC9F,YAAY,GACZ,MAAM,CACV,CAAA;QAED,OAAO;YACL,QAAQ;YACR,KAAK;YACL,IAAI,EAAE;gBACJ,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;aACtE;YACD,UAAU,EAAE,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,IAAI;YAC/B,KAAK,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE;YAClB,aAAa;YACb,SAAS;YACT,SAAS;YACT,IAAI;YACJ,IAAI,EAAE,aAAK,CAAC,EAAE,EAAE;YAChB,OAAO;SACR,CAAA;IACH,CAAC;CACF,CAAA","sourcesContent":["import { ArenaFactory } from '../common'\nimport { UUIDs } from '../utils'\nimport { ArenaAnyNodeDef, NodeDefType, ArenaNodeDefProps, ArenaNodeDefPropsAdvanced } from './nodeDef'\n\nexport type NodeDefFactoryParams = {\n analysis?: boolean\n nodeDefParent?: ArenaAnyNodeDef\n props?: ArenaNodeDefProps\n propsAdvanced?: ArenaNodeDefPropsAdvanced\n type: NodeDefType\n virtual?: boolean\n}\n\nconst defaultProps = {\n analysis: false,\n draft: true,\n nodeDefParent: null,\n published: false,\n temporary: true,\n virtual: false,\n}\n\nexport const NodeDefFactory: ArenaFactory<ArenaAnyNodeDef, NodeDefFactoryParams> = {\n createInstance: (params: NodeDefFactoryParams): ArenaAnyNodeDef => {\n const { analysis, draft, nodeDefParent, props, propsAdvanced, published, temporary, type, virtual } = {\n ...defaultProps,\n ...params,\n }\n\n return {\n analysis,\n draft,\n meta: {\n h: nodeDefParent ? [...nodeDefParent.meta.h, nodeDefParent.uuid] : [],\n },\n parentUuid: nodeDefParent?.uuid,\n props: props ?? {},\n propsAdvanced,\n published,\n temporary,\n type,\n uuid: UUIDs.v4(),\n virtual,\n }\n },\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  export { NodeDefFactory } from './factory';
2
- export type { ArenaNodeDef, ArenaNodeDefProps, ArenaNodeDefPropsWithLayout, ArenaNodeDefMeta, ArenaNodeDefPropsAdvanced, ArenaNodeDefExpression, ArenaNodeDefLayout, ArenaNodeDefValidations, ArenaNodeDefMap, ArenaNodeDefCountExpression, ArenaNodeDefExpressionFactoryParams, } from './nodeDef';
2
+ export type { ArenaNodeDef, ArenaAnyNodeDef, ArenaNodeDefProps, ArenaNodeDefPropsWithLayout, ArenaNodeDefMeta, ArenaNodeDefPropsAdvanced, ArenaNodeDefExpression, ArenaNodeDefLayout, ArenaNodeDefValidations, ArenaNodeDefMap, ArenaNodeDefCountExpression, ArenaNodeDefExpressionFactoryParams, } from './nodeDef';
3
3
  export { NodeDefCountType, NodeDefExpressionFactory, NodeDefType } from './nodeDef';
4
4
  export { NodeDefs } from './nodeDefs';
5
5
  export type { ArenaNodeDefService } from './service';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/nodeDef/index.ts"],"names":[],"mappings":";;;AAAA,qCAA0C;AAAjC,yGAAA,cAAc,OAAA;AAevB,qCAAmF;AAA1E,2GAAA,gBAAgB,OAAA;AAAE,mHAAA,wBAAwB,OAAA;AAAE,sGAAA,WAAW,OAAA;AAChE,uCAAqC;AAA5B,oGAAA,QAAQ,OAAA;AAwBjB,yCAAwD;AAA/C,iHAAA,uBAAuB,OAAA;AAEhC,qCAA8C;AAArC,uGAAA,eAAe,OAAA;AAKxB,iDAAoD;AAA3C,6GAAA,eAAe,OAAA;AAQxB,qCAA0E;AAAjE,6GAAA,qBAAqB,OAAA;AAAE,4GAAA,oBAAoB,OAAA","sourcesContent":["export { NodeDefFactory } from './factory'\n\nexport type {\n ArenaNodeDef,\n ArenaNodeDefProps,\n ArenaNodeDefPropsWithLayout,\n ArenaNodeDefMeta,\n ArenaNodeDefPropsAdvanced,\n ArenaNodeDefExpression,\n ArenaNodeDefLayout,\n ArenaNodeDefValidations,\n ArenaNodeDefMap,\n ArenaNodeDefCountExpression,\n ArenaNodeDefExpressionFactoryParams,\n} from './nodeDef'\nexport { NodeDefCountType, NodeDefExpressionFactory, NodeDefType } from './nodeDef'\nexport { NodeDefs } from './nodeDefs'\n\nexport type { ArenaNodeDefService } from './service'\n\n// ==== node def types\nexport type { ArenaNodeDefBoolean, ArenaNodeDefBooleanProps } from './types/boolean'\n\nexport type { ArenaNodeDefCode, ArenaNodeDefCodeLayout, ArenaNodeDefCodeProps } from './types/code'\n\nexport type { ArenaNodeDefCoordinate, ArenaNodeDefCoordinateProps } from './types/coordinate'\n\nexport type { ArenaNodeDefDate } from './types/date'\n\nexport type { ArenaNodeDefDecimal, ArenaNodeDefDecimalProps } from './types/decimal'\n\nexport type {\n ArenaNodeDefEntity,\n ArenaNodeDefEntityChildPosition,\n ArenaNodeDefEntityLayout,\n ArenaNodeDefEntityLayoutChildItem,\n ArenaNodeDefEntityProps,\n ArenaNodeDefPrintOrientation,\n} from './types/entity'\n\nexport { NodeDefEntityRenderType } from './types/entity'\n\nexport { NodeDefFileType } from './types/file'\nexport type { ArenaNodeDefFile, ArenaNodeDefFileProps } from './types/file'\n\nexport type { ArenaNodeDefGeo, ArenaNodeDefGeoProps } from './types/geo'\n\nexport { FormHeaderColor } from './types/formHeader'\nexport type { ArenaNodeDefFormHeader, ArenaNodeDefFormHeaderProps } from './types/formHeader'\n\nexport type { ArenaNodeDefInteger } from './types/integer'\n\nexport type { ArenaNodeDefTaxon, ArenaNodeDefTaxonProps } from './types/taxon'\n\nexport type { ArenaNodeDefText, ArenaNodeDefTextProps, ArenaNodeDefTextLayout } from './types/text'\nexport { NodeDefTextRenderType, NodeDefTextInputType } from './types/text'\n\nexport type { ArenaNodeDefTime, ArenaNodeDefTimeProps } from './types/time'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/nodeDef/index.ts"],"names":[],"mappings":";;;AAAA,qCAA0C;AAAjC,yGAAA,cAAc,OAAA;AAgBvB,qCAAmF;AAA1E,2GAAA,gBAAgB,OAAA;AAAE,mHAAA,wBAAwB,OAAA;AAAE,sGAAA,WAAW,OAAA;AAChE,uCAAqC;AAA5B,oGAAA,QAAQ,OAAA;AAwBjB,yCAAwD;AAA/C,iHAAA,uBAAuB,OAAA;AAEhC,qCAA8C;AAArC,uGAAA,eAAe,OAAA;AAKxB,iDAAoD;AAA3C,6GAAA,eAAe,OAAA;AAQxB,qCAA0E;AAAjE,6GAAA,qBAAqB,OAAA;AAAE,4GAAA,oBAAoB,OAAA","sourcesContent":["export { NodeDefFactory } from './factory'\n\nexport type {\n ArenaNodeDef,\n ArenaAnyNodeDef,\n ArenaNodeDefProps,\n ArenaNodeDefPropsWithLayout,\n ArenaNodeDefMeta,\n ArenaNodeDefPropsAdvanced,\n ArenaNodeDefExpression,\n ArenaNodeDefLayout,\n ArenaNodeDefValidations,\n ArenaNodeDefMap,\n ArenaNodeDefCountExpression,\n ArenaNodeDefExpressionFactoryParams,\n} from './nodeDef'\nexport { NodeDefCountType, NodeDefExpressionFactory, NodeDefType } from './nodeDef'\nexport { NodeDefs } from './nodeDefs'\n\nexport type { ArenaNodeDefService } from './service'\n\n// ==== node def types\nexport type { ArenaNodeDefBoolean, ArenaNodeDefBooleanProps } from './types/boolean'\n\nexport type { ArenaNodeDefCode, ArenaNodeDefCodeLayout, ArenaNodeDefCodeProps } from './types/code'\n\nexport type { ArenaNodeDefCoordinate, ArenaNodeDefCoordinateProps } from './types/coordinate'\n\nexport type { ArenaNodeDefDate } from './types/date'\n\nexport type { ArenaNodeDefDecimal, ArenaNodeDefDecimalProps } from './types/decimal'\n\nexport type {\n ArenaNodeDefEntity,\n ArenaNodeDefEntityChildPosition,\n ArenaNodeDefEntityLayout,\n ArenaNodeDefEntityLayoutChildItem,\n ArenaNodeDefEntityProps,\n ArenaNodeDefPrintOrientation,\n} from './types/entity'\n\nexport { NodeDefEntityRenderType } from './types/entity'\n\nexport { NodeDefFileType } from './types/file'\nexport type { ArenaNodeDefFile, ArenaNodeDefFileProps } from './types/file'\n\nexport type { ArenaNodeDefGeo, ArenaNodeDefGeoProps } from './types/geo'\n\nexport { FormHeaderColor } from './types/formHeader'\nexport type { ArenaNodeDefFormHeader, ArenaNodeDefFormHeaderProps } from './types/formHeader'\n\nexport type { ArenaNodeDefInteger } from './types/integer'\n\nexport type { ArenaNodeDefTaxon, ArenaNodeDefTaxonProps } from './types/taxon'\n\nexport type { ArenaNodeDefText, ArenaNodeDefTextProps, ArenaNodeDefTextLayout } from './types/text'\nexport { NodeDefTextRenderType, NodeDefTextInputType } from './types/text'\n\nexport type { ArenaNodeDefTime, ArenaNodeDefTimeProps } from './types/time'\n"]}
@@ -117,6 +117,8 @@ export interface ArenaNodeDef<T extends NodeDefType, P extends ArenaNodeDefProps
117
117
  type: T;
118
118
  virtual?: boolean;
119
119
  }
120
+ /** Node definition of any type. */
121
+ export type ArenaAnyNodeDef = ArenaNodeDef<NodeDefType>;
120
122
  export interface ArenaNodeDefMap {
121
123
  [key: string]: ArenaNodeDef<any>;
122
124
  }
@@ -1 +1 @@
1
- {"version":3,"file":"nodeDef.js","sourceRoot":"","sources":["../../src/nodeDef/nodeDef.ts"],"names":[],"mappings":";;;AAAA,oCAAyC;AAKzC,IAAY,WAeX;AAfD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,4BAAa,CAAA;IACb,wCAAyB,CAAA;IACzB,4BAAa,CAAA;IACb,kCAAmB,CAAA;IACnB,0BAAW,CAAA;IACX,gCAAiB,CAAA;IACjB,4BAAa,CAAA;IACb,kCAAmB,CAAA;IACnB,8BAAe,CAAA;IACf,4BAAa,CAAA;IACb,4BAAa,CAAA;IACb,kBAAkB;IAClB,wCAAyB,CAAA;AAC3B,CAAC,EAfW,WAAW,aAAX,WAAW,GAAX,WAAW,QAetB;AAED,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,+BAAW,CAAA;IACX,+BAAW,CAAA;AACb,CAAC,EAHW,gBAAgB,aAAhB,gBAAgB,GAAhB,gBAAgB,QAG3B;AAqDY,QAAA,wBAAwB,GAA8E;IACjH,cAAc,EAAE,CAAC,MAA2C,EAA0B,EAAE;QACtF,MAAM,MAAM,GAAG,EAAE,IAAI,EAAE,aAAK,CAAC,EAAE,EAAE,EAAE,CAAA;QACnC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,eAAO,CAAC,gBAAgB,mBAAM,MAAM,EAAG,CAAC,CAAA;QAC9D,OAAO,MAAM,CAAA;IACf,CAAC;CACF,CAAA","sourcesContent":["import { Objects, UUIDs } from '../utils'\nimport { ArenaObject, ArenaFactory } from '../common'\nimport { ArenaLabels } from '../language'\nimport { ValidationSeverity } from '../validation'\n\nexport enum NodeDefType {\n boolean = 'boolean',\n code = 'code',\n coordinate = 'coordinate',\n date = 'date',\n decimal = 'decimal',\n geo = 'geo',\n entity = 'entity',\n file = 'file',\n integer = 'integer',\n taxon = 'taxon',\n text = 'text',\n time = 'time',\n // layout elements\n formHeader = 'formHeader',\n}\n\nexport enum NodeDefCountType {\n max = 'max',\n min = 'min',\n}\n\nexport interface ArenaNodeDefMeta {\n h: string[]\n}\n\nexport interface ArenaNodeDefProps {\n cycles?: string[]\n descriptions?: ArenaLabels\n key?: boolean\n autoIncrementalKey?: boolean\n labels?: ArenaLabels\n multiple?: boolean\n name?: string\n qualifier?: boolean\n readOnly?: boolean\n\n // available only when readOnly is true\n hidden?: boolean\n\n visibleFields?: string[]\n}\n\nexport interface ArenaNodeDefLayout {\n hiddenWhenNotRelevant?: boolean\n hiddenInMobile?: boolean\n includedInMultipleEntitySummary?: boolean\n includedInPreviousCycleLink?: boolean\n // code\n codeShown?: boolean\n}\n\nexport interface ArenaNodeDefPropsWithLayout<L extends ArenaNodeDefLayout> extends ArenaNodeDefProps {\n layout?: {\n [cycleKey: string]: L\n }\n}\n\nexport interface ArenaNodeDefExpression {\n applyIf?: string\n expression?: string\n messages?: ArenaLabels\n severity?: ValidationSeverity\n uuid: string\n}\n\nexport interface ArenaNodeDefExpressionFactoryParams {\n applyIf?: string\n expression?: string\n messages?: ArenaLabels\n severity?: ValidationSeverity\n}\n\nexport const NodeDefExpressionFactory: ArenaFactory<ArenaNodeDefExpression, ArenaNodeDefExpressionFactoryParams> = {\n createInstance: (params: ArenaNodeDefExpressionFactoryParams): ArenaNodeDefExpression => {\n const result = { uuid: UUIDs.v4() }\n Object.assign(result, Objects.deleteEmptyProps({ ...params }))\n return result\n },\n}\n\nexport type ArenaNodeDefCountExpression = string | ArenaNodeDefExpression[]\n\nexport interface NodeDefCountValidations {\n max?: ArenaNodeDefCountExpression\n min?: ArenaNodeDefCountExpression\n}\n\nexport interface ArenaNodeDefValidations {\n count?: NodeDefCountValidations\n expressions?: ArenaNodeDefExpression[]\n required?: boolean\n /**\n * Conditions making a single attribute required (alternative to `required`, which makes it always required).\n */\n requiredIf?: ArenaNodeDefExpression[]\n unique?: boolean\n}\n\nexport interface ArenaNodeDefPropsAdvanced {\n applicable?: ArenaNodeDefExpression[]\n defaultValues?: ArenaNodeDefExpression[]\n defaultValueEvaluatedOneTime?: boolean\n editableIf?: ArenaNodeDefExpression[]\n excludedInClone?: boolean\n formula?: ArenaNodeDefExpression[]\n validations?: ArenaNodeDefValidations\n visibleIf?: ArenaNodeDefExpression[]\n // file attribute\n fileNameExpression?: string\n // enumerate entity\n enumeratingItemsExpression?: string\n // code and taxon attribute\n itemsFilter?: string\n\n // Analysis\n script?: string\n chainUuid?: string\n index?: number\n active?: boolean\n aggregateFunctions?: { [key: string]: object }\n\n isBaseUnit?: boolean\n isSampling?: boolean\n hasAreaBasedEstimated?: boolean\n areaBasedEstimatedOf?: string // uuid of area based estimated node def\n}\n\nexport interface ArenaNodeDef<\n T extends NodeDefType,\n P extends ArenaNodeDefProps = ArenaNodeDefProps,\n> extends ArenaObject<P> {\n analysis?: boolean\n dateCreated?: string\n dateModified?: string\n deleted?: boolean\n draft?: boolean\n id?: number\n meta: ArenaNodeDefMeta\n parentUuid?: string\n propsAdvanced?: ArenaNodeDefPropsAdvanced\n propsAdvancedDraft?: ArenaNodeDefPropsAdvanced\n published?: boolean\n temporary?: boolean\n type: T\n virtual?: boolean\n}\n\nexport interface ArenaNodeDefMap {\n [key: string]: ArenaNodeDef<any>\n}\n"]}
1
+ {"version":3,"file":"nodeDef.js","sourceRoot":"","sources":["../../src/nodeDef/nodeDef.ts"],"names":[],"mappings":";;;AAAA,oCAAyC;AAKzC,IAAY,WAeX;AAfD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,4BAAa,CAAA;IACb,wCAAyB,CAAA;IACzB,4BAAa,CAAA;IACb,kCAAmB,CAAA;IACnB,0BAAW,CAAA;IACX,gCAAiB,CAAA;IACjB,4BAAa,CAAA;IACb,kCAAmB,CAAA;IACnB,8BAAe,CAAA;IACf,4BAAa,CAAA;IACb,4BAAa,CAAA;IACb,kBAAkB;IAClB,wCAAyB,CAAA;AAC3B,CAAC,EAfW,WAAW,aAAX,WAAW,GAAX,WAAW,QAetB;AAED,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,+BAAW,CAAA;IACX,+BAAW,CAAA;AACb,CAAC,EAHW,gBAAgB,aAAhB,gBAAgB,GAAhB,gBAAgB,QAG3B;AAqDY,QAAA,wBAAwB,GAA8E;IACjH,cAAc,EAAE,CAAC,MAA2C,EAA0B,EAAE;QACtF,MAAM,MAAM,GAAG,EAAE,IAAI,EAAE,aAAK,CAAC,EAAE,EAAE,EAAE,CAAA;QACnC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,eAAO,CAAC,gBAAgB,mBAAM,MAAM,EAAG,CAAC,CAAA;QAC9D,OAAO,MAAM,CAAA;IACf,CAAC;CACF,CAAA","sourcesContent":["import { Objects, UUIDs } from '../utils'\nimport { ArenaObject, ArenaFactory } from '../common'\nimport { ArenaLabels } from '../language'\nimport { ValidationSeverity } from '../validation'\n\nexport enum NodeDefType {\n boolean = 'boolean',\n code = 'code',\n coordinate = 'coordinate',\n date = 'date',\n decimal = 'decimal',\n geo = 'geo',\n entity = 'entity',\n file = 'file',\n integer = 'integer',\n taxon = 'taxon',\n text = 'text',\n time = 'time',\n // layout elements\n formHeader = 'formHeader',\n}\n\nexport enum NodeDefCountType {\n max = 'max',\n min = 'min',\n}\n\nexport interface ArenaNodeDefMeta {\n h: string[]\n}\n\nexport interface ArenaNodeDefProps {\n cycles?: string[]\n descriptions?: ArenaLabels\n key?: boolean\n autoIncrementalKey?: boolean\n labels?: ArenaLabels\n multiple?: boolean\n name?: string\n qualifier?: boolean\n readOnly?: boolean\n\n // available only when readOnly is true\n hidden?: boolean\n\n visibleFields?: string[]\n}\n\nexport interface ArenaNodeDefLayout {\n hiddenWhenNotRelevant?: boolean\n hiddenInMobile?: boolean\n includedInMultipleEntitySummary?: boolean\n includedInPreviousCycleLink?: boolean\n // code\n codeShown?: boolean\n}\n\nexport interface ArenaNodeDefPropsWithLayout<L extends ArenaNodeDefLayout> extends ArenaNodeDefProps {\n layout?: {\n [cycleKey: string]: L\n }\n}\n\nexport interface ArenaNodeDefExpression {\n applyIf?: string\n expression?: string\n messages?: ArenaLabels\n severity?: ValidationSeverity\n uuid: string\n}\n\nexport interface ArenaNodeDefExpressionFactoryParams {\n applyIf?: string\n expression?: string\n messages?: ArenaLabels\n severity?: ValidationSeverity\n}\n\nexport const NodeDefExpressionFactory: ArenaFactory<ArenaNodeDefExpression, ArenaNodeDefExpressionFactoryParams> = {\n createInstance: (params: ArenaNodeDefExpressionFactoryParams): ArenaNodeDefExpression => {\n const result = { uuid: UUIDs.v4() }\n Object.assign(result, Objects.deleteEmptyProps({ ...params }))\n return result\n },\n}\n\nexport type ArenaNodeDefCountExpression = string | ArenaNodeDefExpression[]\n\nexport interface NodeDefCountValidations {\n max?: ArenaNodeDefCountExpression\n min?: ArenaNodeDefCountExpression\n}\n\nexport interface ArenaNodeDefValidations {\n count?: NodeDefCountValidations\n expressions?: ArenaNodeDefExpression[]\n required?: boolean\n /**\n * Conditions making a single attribute required (alternative to `required`, which makes it always required).\n */\n requiredIf?: ArenaNodeDefExpression[]\n unique?: boolean\n}\n\nexport interface ArenaNodeDefPropsAdvanced {\n applicable?: ArenaNodeDefExpression[]\n defaultValues?: ArenaNodeDefExpression[]\n defaultValueEvaluatedOneTime?: boolean\n editableIf?: ArenaNodeDefExpression[]\n excludedInClone?: boolean\n formula?: ArenaNodeDefExpression[]\n validations?: ArenaNodeDefValidations\n visibleIf?: ArenaNodeDefExpression[]\n // file attribute\n fileNameExpression?: string\n // enumerate entity\n enumeratingItemsExpression?: string\n // code and taxon attribute\n itemsFilter?: string\n\n // Analysis\n script?: string\n chainUuid?: string\n index?: number\n active?: boolean\n aggregateFunctions?: { [key: string]: object }\n\n isBaseUnit?: boolean\n isSampling?: boolean\n hasAreaBasedEstimated?: boolean\n areaBasedEstimatedOf?: string // uuid of area based estimated node def\n}\n\nexport interface ArenaNodeDef<\n T extends NodeDefType,\n P extends ArenaNodeDefProps = ArenaNodeDefProps,\n> extends ArenaObject<P> {\n analysis?: boolean\n dateCreated?: string\n dateModified?: string\n deleted?: boolean\n draft?: boolean\n id?: number\n meta: ArenaNodeDefMeta\n parentUuid?: string\n propsAdvanced?: ArenaNodeDefPropsAdvanced\n propsAdvancedDraft?: ArenaNodeDefPropsAdvanced\n published?: boolean\n temporary?: boolean\n type: T\n virtual?: boolean\n}\n\n/** Node definition of any type. */\nexport type ArenaAnyNodeDef = ArenaNodeDef<NodeDefType>\n\nexport interface ArenaNodeDefMap {\n [key: string]: ArenaNodeDef<any>\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import { LanguageCode } from '../language';
2
- import { ArenaNodeDef, ArenaNodeDefCountExpression, NodeDefCountType, ArenaNodeDefExpression, ArenaNodeDefLayout, ArenaNodeDefProps, ArenaNodeDefPropsWithLayout, NodeDefType, ArenaNodeDefValidations } from './nodeDef';
2
+ import { ArenaAnyNodeDef, ArenaNodeDef, ArenaNodeDefCountExpression, NodeDefCountType, ArenaNodeDefExpression, ArenaNodeDefLayout, ArenaNodeDefPropsWithLayout, NodeDefType, ArenaNodeDefValidations } from './nodeDef';
3
3
  import { ArenaNodeDefBoolean } from './types/boolean';
4
4
  import { ArenaNodeDefCode } from './types/code';
5
5
  import { ArenaNodeDefCoordinate } from './types/coordinate';
@@ -13,52 +13,52 @@ import { ArenaNodeDefInteger } from './types/integer';
13
13
  import { ArenaNodeDefTaxon } from './types/taxon';
14
14
  import { ArenaNodeDefText, NodeDefTextInputType } from './types/text';
15
15
  import { ArenaNodeDefTime } from './types/time';
16
- declare const isRoot: (nodeDef: ArenaNodeDef<NodeDefType>) => boolean;
17
- declare const isAttribute: (nodeDef: ArenaNodeDef<NodeDefType>) => boolean;
18
- declare const isEntity: (nodeDef: ArenaNodeDef<NodeDefType>) => nodeDef is ArenaNodeDefEntity;
19
- declare const isBoolean: (nodeDef: ArenaNodeDef<NodeDefType>) => nodeDef is ArenaNodeDefBoolean;
20
- declare const isCode: (nodeDef: ArenaNodeDef<NodeDefType>) => nodeDef is ArenaNodeDefCode;
21
- declare const isCoordinate: (nodeDef: ArenaNodeDef<NodeDefType>) => nodeDef is ArenaNodeDefCoordinate;
22
- declare const isDate: (nodeDef: ArenaNodeDef<NodeDefType>) => nodeDef is ArenaNodeDefDate;
23
- declare const isDecimal: (nodeDef: ArenaNodeDef<NodeDefType>) => nodeDef is ArenaNodeDefDecimal;
24
- declare const isFile: (nodeDef: ArenaNodeDef<NodeDefType>) => nodeDef is ArenaNodeDefFile;
25
- declare const isGeo: (nodeDef: ArenaNodeDef<NodeDefType>) => nodeDef is ArenaNodeDefGeo;
26
- declare const isInteger: (nodeDef: ArenaNodeDef<NodeDefType>) => nodeDef is ArenaNodeDefInteger;
27
- declare const isTaxon: (nodeDef: ArenaNodeDef<NodeDefType>) => nodeDef is ArenaNodeDefTaxon;
28
- declare const isText: (nodeDef: ArenaNodeDef<NodeDefType>) => nodeDef is ArenaNodeDefText;
29
- declare const isTime: (nodeDef: ArenaNodeDef<NodeDefType>) => nodeDef is ArenaNodeDefTime;
30
- declare const isMultiple: (nodeDef: ArenaNodeDef<NodeDefType>) => boolean;
31
- declare const isSingle: (nodeDef: ArenaNodeDef<NodeDefType>) => boolean;
32
- declare const isSingleEntity: (nodeDef: ArenaNodeDef<NodeDefType>) => nodeDef is ArenaNodeDefEntity;
33
- declare const isSingleAttribute: (nodeDef: ArenaNodeDef<NodeDefType>) => boolean;
34
- declare const isMultipleEntity: (nodeDef: ArenaNodeDef<NodeDefType>) => nodeDef is ArenaNodeDefEntity;
35
- declare const isMultipleAttribute: (nodeDef: ArenaNodeDef<NodeDefType>) => boolean;
36
- declare const isKey: (nodeDef: ArenaNodeDef<NodeDefType, ArenaNodeDefProps>) => boolean;
37
- declare const isAutoIncrementalKey: (nodeDef: ArenaNodeDef<NodeDefType, ArenaNodeDefProps>) => boolean;
38
- declare const isAnalysis: (nodeDef: ArenaNodeDef<NodeDefType>) => boolean;
39
- declare const getType: (nodeDef: ArenaNodeDef<NodeDefType>) => NodeDefType;
40
- declare const isLayoutElement: (nodeDef: ArenaNodeDef<NodeDefType>) => nodeDef is ArenaNodeDefFormHeader;
41
- declare const getName: (nodeDef: ArenaNodeDef<NodeDefType, ArenaNodeDefProps>) => string;
42
- declare const getLabelOrName: (nodeDef: ArenaNodeDef<NodeDefType, ArenaNodeDefProps>, lang: LanguageCode) => string;
43
- declare const getDescription: (nodeDef: ArenaNodeDef<NodeDefType, ArenaNodeDefProps>, lang: LanguageCode) => string;
44
- declare const isQualifier: (nodeDef: ArenaNodeDef<NodeDefType>) => boolean;
16
+ declare const isRoot: (nodeDef: ArenaAnyNodeDef) => boolean;
17
+ declare const isAttribute: (nodeDef: ArenaAnyNodeDef) => boolean;
18
+ declare const isEntity: (nodeDef: ArenaAnyNodeDef) => nodeDef is ArenaNodeDefEntity;
19
+ declare const isBoolean: (nodeDef: ArenaAnyNodeDef) => nodeDef is ArenaNodeDefBoolean;
20
+ declare const isCode: (nodeDef: ArenaAnyNodeDef) => nodeDef is ArenaNodeDefCode;
21
+ declare const isCoordinate: (nodeDef: ArenaAnyNodeDef) => nodeDef is ArenaNodeDefCoordinate;
22
+ declare const isDate: (nodeDef: ArenaAnyNodeDef) => nodeDef is ArenaNodeDefDate;
23
+ declare const isDecimal: (nodeDef: ArenaAnyNodeDef) => nodeDef is ArenaNodeDefDecimal;
24
+ declare const isFile: (nodeDef: ArenaAnyNodeDef) => nodeDef is ArenaNodeDefFile;
25
+ declare const isGeo: (nodeDef: ArenaAnyNodeDef) => nodeDef is ArenaNodeDefGeo;
26
+ declare const isInteger: (nodeDef: ArenaAnyNodeDef) => nodeDef is ArenaNodeDefInteger;
27
+ declare const isTaxon: (nodeDef: ArenaAnyNodeDef) => nodeDef is ArenaNodeDefTaxon;
28
+ declare const isText: (nodeDef: ArenaAnyNodeDef) => nodeDef is ArenaNodeDefText;
29
+ declare const isTime: (nodeDef: ArenaAnyNodeDef) => nodeDef is ArenaNodeDefTime;
30
+ declare const isMultiple: (nodeDef: ArenaAnyNodeDef) => boolean;
31
+ declare const isSingle: (nodeDef: ArenaAnyNodeDef) => boolean;
32
+ declare const isSingleEntity: (nodeDef: ArenaAnyNodeDef) => nodeDef is ArenaNodeDefEntity;
33
+ declare const isSingleAttribute: (nodeDef: ArenaAnyNodeDef) => boolean;
34
+ declare const isMultipleEntity: (nodeDef: ArenaAnyNodeDef) => nodeDef is ArenaNodeDefEntity;
35
+ declare const isMultipleAttribute: (nodeDef: ArenaAnyNodeDef) => boolean;
36
+ declare const isKey: (nodeDef: ArenaAnyNodeDef) => boolean;
37
+ declare const isAutoIncrementalKey: (nodeDef: ArenaAnyNodeDef) => boolean;
38
+ declare const isAnalysis: (nodeDef: ArenaAnyNodeDef) => boolean;
39
+ declare const getType: (nodeDef: ArenaAnyNodeDef) => NodeDefType;
40
+ declare const isLayoutElement: (nodeDef: ArenaAnyNodeDef) => nodeDef is ArenaNodeDefFormHeader;
41
+ declare const getName: (nodeDef: ArenaAnyNodeDef) => string;
42
+ declare const getLabelOrName: (nodeDef: ArenaAnyNodeDef, lang: LanguageCode) => string;
43
+ declare const getDescription: (nodeDef: ArenaAnyNodeDef, lang: LanguageCode) => string;
44
+ declare const isQualifier: (nodeDef: ArenaAnyNodeDef) => boolean;
45
45
  declare const isReadOnly: (nodeDef: ArenaNodeDef<any>) => boolean;
46
46
  declare const isHidden: (nodeDef: ArenaNodeDef<any>) => boolean;
47
47
  declare const isEnumerate: (nodeDef: ArenaNodeDefEntity) => boolean;
48
48
  declare const getEnumeratingItemsExpression: (nodeDef: ArenaNodeDefEntity) => string | undefined;
49
49
  declare const isAutoCreateMinCountItems: (nodeDef: ArenaNodeDefEntity) => boolean;
50
50
  declare const getPrintOrientation: (nodeDef: ArenaNodeDefEntity) => ArenaNodeDefPrintOrientation | undefined;
51
- declare const getDefaultValues: (nodeDef: ArenaNodeDef<NodeDefType>) => ArenaNodeDefExpression[];
52
- declare const isDefaultValueEvaluatedOneTime: (nodeDef: ArenaNodeDef<NodeDefType>) => boolean;
53
- declare const getApplicable: (nodeDef: ArenaNodeDef<NodeDefType>) => ArenaNodeDefExpression[];
54
- declare const getVisibleFields: (nodeDef: ArenaNodeDef<NodeDefType>) => string[] | undefined;
51
+ declare const getDefaultValues: (nodeDef: ArenaAnyNodeDef) => ArenaNodeDefExpression[];
52
+ declare const isDefaultValueEvaluatedOneTime: (nodeDef: ArenaAnyNodeDef) => boolean;
53
+ declare const getApplicable: (nodeDef: ArenaAnyNodeDef) => ArenaNodeDefExpression[];
54
+ declare const getVisibleFields: (nodeDef: ArenaAnyNodeDef) => string[] | undefined;
55
55
  declare const isFieldVisible: (field: string) => (nodeDef: ArenaNodeDef<any>) => boolean;
56
- declare const isInCycle: (cycle: string) => (nodeDef: ArenaNodeDef<NodeDefType>) => boolean;
57
- declare const isExcludedInClone: (nodeDef: ArenaNodeDef<NodeDefType>) => boolean;
58
- declare const getEditableIf: (nodeDef: ArenaNodeDef<NodeDefType>) => ArenaNodeDefExpression[];
59
- declare const isAlwaysEditable: (nodeDef: ArenaNodeDef<NodeDefType>) => boolean;
60
- declare const getVisibleIf: (nodeDef: ArenaNodeDef<NodeDefType>) => ArenaNodeDefExpression[];
61
- declare const isAlwaysVisible: (nodeDef: ArenaNodeDef<NodeDefType>) => boolean;
56
+ declare const isInCycle: (cycle: string) => (nodeDef: ArenaAnyNodeDef) => boolean;
57
+ declare const isExcludedInClone: (nodeDef: ArenaAnyNodeDef) => boolean;
58
+ declare const getEditableIf: (nodeDef: ArenaAnyNodeDef) => ArenaNodeDefExpression[];
59
+ declare const isAlwaysEditable: (nodeDef: ArenaAnyNodeDef) => boolean;
60
+ declare const getVisibleIf: (nodeDef: ArenaAnyNodeDef) => ArenaNodeDefExpression[];
61
+ declare const isAlwaysVisible: (nodeDef: ArenaAnyNodeDef) => boolean;
62
62
  declare const getCategoryUuid: (nodeDef: ArenaNodeDefCode) => string | undefined;
63
63
  declare const getParentCodeDefUuid: (nodeDef: ArenaNodeDefCode) => string | undefined;
64
64
  declare const isAllowOnlyDeviceCoordinate: (nodeDef: ArenaNodeDefCoordinate) => boolean;
@@ -77,19 +77,19 @@ declare const isVernacularNameAlwaysIncludedIfSingle: (nodeDef: ArenaNodeDefTaxo
77
77
  declare const getTextTransform: (nodeDef: ArenaNodeDefText) => string | undefined;
78
78
  declare const getTextInputType: (nodeDef: ArenaNodeDefText) => NodeDefTextInputType | undefined;
79
79
  declare const getItemsFilter: (nodeDef: ArenaNodeDef<any>) => string | undefined;
80
- declare const getValidations: (nodeDef: ArenaNodeDef<NodeDefType>) => ArenaNodeDefValidations | undefined;
81
- declare const getValidationsExpressions: (nodeDef: ArenaNodeDef<NodeDefType>) => ArenaNodeDefExpression[];
82
- declare const isRequired: (nodeDef: ArenaNodeDef<NodeDefType>) => boolean;
83
- declare const getRequiredIf: (nodeDef: ArenaNodeDef<NodeDefType>) => ArenaNodeDefExpression[];
84
- declare const isRequiredIfDefined: (nodeDef: ArenaNodeDef<NodeDefType>) => boolean;
80
+ declare const getValidations: (nodeDef: ArenaAnyNodeDef) => ArenaNodeDefValidations | undefined;
81
+ declare const getValidationsExpressions: (nodeDef: ArenaAnyNodeDef) => ArenaNodeDefExpression[];
82
+ declare const isRequired: (nodeDef: ArenaAnyNodeDef) => boolean;
83
+ declare const getRequiredIf: (nodeDef: ArenaAnyNodeDef) => ArenaNodeDefExpression[];
84
+ declare const isRequiredIfDefined: (nodeDef: ArenaAnyNodeDef) => boolean;
85
85
  /**
86
86
  * True if the node def is always required or required when a condition is met (node def level, not record level).
87
87
  */
88
- declare const isRequiredOrConditionallyRequired: (nodeDef: ArenaNodeDef<NodeDefType>) => boolean;
89
- declare const getCount: (nodeDef: ArenaNodeDef<NodeDefType>, countType: NodeDefCountType) => ArenaNodeDefCountExpression | undefined;
90
- declare const getMinCount: (nodeDef: ArenaNodeDef<NodeDefType>) => ArenaNodeDefCountExpression | undefined;
91
- declare const getMaxCount: (nodeDef: ArenaNodeDef<NodeDefType>) => ArenaNodeDefCountExpression | undefined;
92
- declare const hasMinOrMaxCount: (nodeDef: ArenaNodeDef<NodeDefType>) => boolean;
88
+ declare const isRequiredOrConditionallyRequired: (nodeDef: ArenaAnyNodeDef) => boolean;
89
+ declare const getCount: (nodeDef: ArenaAnyNodeDef, countType: NodeDefCountType) => ArenaNodeDefCountExpression | undefined;
90
+ declare const getMinCount: (nodeDef: ArenaAnyNodeDef) => ArenaNodeDefCountExpression | undefined;
91
+ declare const getMaxCount: (nodeDef: ArenaAnyNodeDef) => ArenaNodeDefCountExpression | undefined;
92
+ declare const hasMinOrMaxCount: (nodeDef: ArenaAnyNodeDef) => boolean;
93
93
  declare const getLayoutProps: (cycle?: string) => (nodeDef: ArenaNodeDef<any, ArenaNodeDefPropsWithLayout<any>>) => any;
94
94
  declare const getLayoutRenderType: (cycle?: string) => (nodeDef: ArenaNodeDef<any, ArenaNodeDefPropsWithLayout<any>>) => string | undefined;
95
95
  declare const isLayoutRenderTypeForm: (cycle?: string) => (nodeDef: ArenaNodeDefEntity) => boolean;