@beinformed/ui 1.65.3 → 1.65.5

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 (68) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/esm/hooks/__tests__/UseModularUIModel.spec.js.flow +3 -5
  3. package/esm/hooks/useList.js +7 -6
  4. package/esm/hooks/useList.js.flow +7 -6
  5. package/esm/hooks/useList.js.map +1 -1
  6. package/esm/models/concepts/ConceptIndexModel.js +3 -2
  7. package/esm/models/concepts/ConceptIndexModel.js.flow +5 -4
  8. package/esm/models/concepts/ConceptIndexModel.js.map +1 -1
  9. package/esm/models/content/ContentIndexModel.js +7 -1
  10. package/esm/models/content/ContentIndexModel.js.flow +8 -3
  11. package/esm/models/content/ContentIndexModel.js.map +1 -1
  12. package/esm/models/content/ContentModel.js +3 -2
  13. package/esm/models/content/ContentModel.js.flow +4 -3
  14. package/esm/models/content/ContentModel.js.map +1 -1
  15. package/esm/models/content/ContentTOCModel.js +6 -2
  16. package/esm/models/content/ContentTOCModel.js.flow +6 -2
  17. package/esm/models/content/ContentTOCModel.js.map +1 -1
  18. package/esm/models/filters/AssignmentFilterModel.js +54 -26
  19. package/esm/models/filters/AssignmentFilterModel.js.flow +68 -37
  20. package/esm/models/filters/AssignmentFilterModel.js.map +1 -1
  21. package/esm/models/filters/BaseFilterModel.js +0 -110
  22. package/esm/models/filters/BaseFilterModel.js.flow +2 -133
  23. package/esm/models/filters/BaseFilterModel.js.map +1 -1
  24. package/esm/models/filters/ConceptIndexFilterModel.js +2 -2
  25. package/esm/models/filters/ConceptIndexFilterModel.js.flow +2 -2
  26. package/esm/models/filters/ConceptIndexFilterModel.js.map +1 -1
  27. package/esm/models/filters/FilterModel.js +117 -2
  28. package/esm/models/filters/FilterModel.js.flow +146 -1
  29. package/esm/models/filters/FilterModel.js.map +1 -1
  30. package/esm/models/filters/RangeFilterModel.js +2 -2
  31. package/esm/models/filters/RangeFilterModel.js.flow +2 -2
  32. package/esm/models/filters/RangeFilterModel.js.map +1 -1
  33. package/esm/models/types.js.flow +1 -3
  34. package/esm/models/types.js.map +1 -1
  35. package/lib/hooks/useList.js +7 -6
  36. package/lib/hooks/useList.js.map +1 -1
  37. package/lib/models/concepts/ConceptIndexModel.js +3 -2
  38. package/lib/models/concepts/ConceptIndexModel.js.map +1 -1
  39. package/lib/models/content/ContentIndexModel.js +6 -1
  40. package/lib/models/content/ContentIndexModel.js.map +1 -1
  41. package/lib/models/content/ContentModel.js +3 -2
  42. package/lib/models/content/ContentModel.js.map +1 -1
  43. package/lib/models/content/ContentTOCModel.js +6 -2
  44. package/lib/models/content/ContentTOCModel.js.map +1 -1
  45. package/lib/models/filters/AssignmentFilterModel.js +54 -26
  46. package/lib/models/filters/AssignmentFilterModel.js.map +1 -1
  47. package/lib/models/filters/BaseFilterModel.js +0 -109
  48. package/lib/models/filters/BaseFilterModel.js.map +1 -1
  49. package/lib/models/filters/ConceptIndexFilterModel.js +2 -2
  50. package/lib/models/filters/ConceptIndexFilterModel.js.map +1 -1
  51. package/lib/models/filters/FilterModel.js +117 -1
  52. package/lib/models/filters/FilterModel.js.map +1 -1
  53. package/lib/models/filters/RangeFilterModel.js +2 -2
  54. package/lib/models/filters/RangeFilterModel.js.map +1 -1
  55. package/lib/models/types.js.map +1 -1
  56. package/package.json +1 -1
  57. package/src/hooks/__tests__/UseModularUIModel.spec.js +3 -5
  58. package/src/hooks/useList.js +7 -6
  59. package/src/models/concepts/ConceptIndexModel.js +5 -4
  60. package/src/models/content/ContentIndexModel.js +8 -3
  61. package/src/models/content/ContentModel.js +4 -3
  62. package/src/models/content/ContentTOCModel.js +6 -2
  63. package/src/models/filters/AssignmentFilterModel.js +68 -37
  64. package/src/models/filters/BaseFilterModel.js +2 -133
  65. package/src/models/filters/ConceptIndexFilterModel.js +2 -2
  66. package/src/models/filters/FilterModel.js +146 -1
  67. package/src/models/filters/RangeFilterModel.js +2 -2
  68. package/src/models/types.js +1 -3
@@ -1 +1 @@
1
- {"version":3,"file":"BaseFilterModel.js","names":["BaseModel","createAttribute","PARAMETER_SEPARATOR","PARAMETER_TYPES","IllegalStateException","BaseFilterModel","constructor","data","contributions","modelOptions","_defineProperty","_attribute","type","param","listKey","listkey","replace","parameterType","getContribution","BODY","QUERY","isMultiple","context","_context","contextLabel","label","_listKey","key","name","attribute","params","value","inputvalue","hasValue","reset","update","isQuickSearch","quicksearch","isActive","initvalue","isValid","readonlyvalue","assistantMessage","formdata"],"sources":["../../../src/models/filters/BaseFilterModel.js"],"sourcesContent":["// @flow\nimport BaseModel from \"../base/BaseModel\";\nimport createAttribute from \"../attributes/_createAttribute\";\nimport {\n PARAMETER_SEPARATOR,\n PARAMETER_TYPES,\n} from \"../../constants/Constants\";\n\nimport type { AttributeType, FilterType, ModelOptions } from \"../types\";\nimport { IllegalStateException } from \"../../exceptions\";\n\n/**\n * Base class for filters\n */\nexport default class BaseFilterModel extends BaseModel {\n _attribute: AttributeType | null = null;\n _context: Object;\n _listKey: string;\n\n /**\n */\n constructor(\n data: Object,\n contributions: Object,\n modelOptions?: ModelOptions,\n ) {\n super(data, contributions, modelOptions);\n\n this._attribute = this.createAttribute(\n this.type,\n this.param,\n this.data,\n this.contributions,\n );\n\n if (this.contributions.listKey) {\n this.listkey = this.contributions.listKey;\n }\n }\n\n /**\n * Get the type of a filter.\n */\n get type(): string {\n return this.contributions.type\n ? this.contributions.type.replace(\"filter\", \"\")\n : \"string\";\n }\n\n /**\n * Returns the parameter type, when the filter can only be used in a POST request the type is 'bodyParameter', else 'queryParameter'.\n */\n get parameterType(): $Values<typeof PARAMETER_TYPES> {\n const parameterType = this.getContribution(\"parameterType\");\n switch (parameterType) {\n case \"bodyParameter\":\n return PARAMETER_TYPES.BODY;\n default:\n return PARAMETER_TYPES.QUERY;\n }\n }\n\n /**\n * Create attribute through the attribute factory. Create type based on filter key without the filter suffix\n */\n createAttribute(\n type: string,\n param: string,\n data: Object,\n contributions: Object,\n ): AttributeType | null {\n if (type === \"assignment\") {\n return null;\n }\n\n return createAttribute(\n param,\n data,\n {\n ...contributions,\n type: type,\n },\n this.modelOptions,\n );\n }\n\n /**\n * Inidiates if filter is multiplechoice\n */\n get isMultiple(): boolean {\n return this.getContribution(\"multiplechoice\", false);\n }\n\n /**\n * Getting context data\n */\n get context(): Object {\n return this._context;\n }\n\n /**\n * Set context of filter\n */\n set context(context: Object) {\n this._context = context;\n }\n\n /**\n * Getting the context label\n */\n get contextLabel(): string {\n return this.context?.label ?? \"\";\n }\n\n /**\n * Getting key of the list these filters apply to\n */\n get listkey(): string {\n return this._listKey;\n }\n\n /**\n * Set key of list this filter belongs to\n */\n set listkey(key: string) {\n this._listKey = key;\n }\n\n /**\n * Getting the label of the filter\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Getting the name of the filter\n */\n get name(): string {\n if (this.listkey) {\n return this.listkey + PARAMETER_SEPARATOR + this.param;\n }\n\n return this.param;\n }\n\n /**\n * Getting the param name of the filter\n */\n get param(): string {\n return this.data.param ?? this.data.name;\n }\n\n /**\n * Get attribute of filter\n */\n get attribute(): AttributeType {\n if (!this._attribute) {\n throw new IllegalStateException(\n `Missing filter attribute on filter model: ${this.label}`,\n );\n }\n return this._attribute;\n }\n\n /**\n * Retrieve the parameters with it's value for this filter\n */\n get params(): Array<{ name: string, value: ?string }> {\n if (!this.param) {\n return [];\n }\n\n return [\n {\n name: this.param,\n value: this.attribute?.value,\n },\n ];\n }\n\n /**\n * Getting the value of the filter\n */\n get value(): string | null {\n return this.attribute?.value;\n }\n\n /**\n * Getting the inputvalue of the filter\n */\n get inputvalue(): string {\n return this.attribute?.inputvalue;\n }\n\n /**\n * Indicates if the filter has a value.\n */\n hasValue(): boolean {\n return this.value !== null && this.value !== \"\";\n }\n\n /**\n * Reset the value of this filter to undefined\n */\n reset(): FilterType {\n if (this.attribute) {\n this.attribute.reset();\n }\n\n return this;\n }\n\n /**\n * Update this filter with input name and value\n */\n update(attribute: AttributeType, value: string) {\n if (this.attribute) {\n this.attribute.update(value);\n }\n }\n\n /**\n * Inidicates if filter is a quick search filter\n */\n isQuickSearch(): boolean {\n return this.contributions.quicksearch === true;\n }\n\n /**\n * Inidiates if filter is active\n */\n isActive(): boolean {\n return this.attribute !== null && this.attribute.initvalue !== null;\n }\n\n /**\n * Inidiates if filter is valid\n */\n get isValid(): boolean {\n return this.attribute !== null && this.attribute.isValid;\n }\n\n /**\n */\n get readonlyvalue(): string {\n if (this.attribute) {\n return this.attribute.readonlyvalue;\n }\n return \"\";\n }\n\n /**\n * Get assistant message\n */\n get assistantMessage(): string | null {\n return this.getContribution(\"assistant\");\n }\n\n /**\n */\n get formdata(): { [string]: any } | null {\n return this.attribute.formdata ?? null;\n }\n}\n"],"mappings":";AACA,OAAOA,SAAS,MAAM,mBAAmB;AACzC,OAAOC,eAAe,MAAM,gCAAgC;AAC5D,SACEC,mBAAmB,EACnBC,eAAe,QACV,2BAA2B;AAGlC,SAASC,qBAAqB,QAAQ,kBAAkB;;AAExD;AACA;AACA;AACA,eAAe,MAAMC,eAAe,SAASL,SAAS,CAAC;EAKrD;AACF;EACEM,WAAWA,CACTC,IAAY,EACZC,aAAqB,EACrBC,YAA2B,EAC3B;IACA,KAAK,CAACF,IAAI,EAAEC,aAAa,EAAEC,YAAY,CAAC;IAACC,eAAA,qBAXR,IAAI;IAAAA,eAAA;IAAAA,eAAA;IAarC,IAAI,CAACC,UAAU,GAAG,IAAI,CAACV,eAAe,CACpC,IAAI,CAACW,IAAI,EACT,IAAI,CAACC,KAAK,EACV,IAAI,CAACN,IAAI,EACT,IAAI,CAACC,aACP,CAAC;IAED,IAAI,IAAI,CAACA,aAAa,CAACM,OAAO,EAAE;MAC9B,IAAI,CAACC,OAAO,GAAG,IAAI,CAACP,aAAa,CAACM,OAAO;IAC3C;EACF;;EAEA;AACF;AACA;EACE,IAAIF,IAAIA,CAAA,EAAW;IACjB,OAAO,IAAI,CAACJ,aAAa,CAACI,IAAI,GAC1B,I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I,CAACL,SAAS,EAAE;MAClB,IAAI,CAACA,SAAS,CAACK,KAAK,CAAC,CAAC;IACxB;IAEA,OAAO,IAAI;EACb;;EAEA;AACF;AACA;EACEC,MAAMA,CAACN,SAAwB,EAAEE,KAAa,EAAE;IAC9C,IAAI,IAAI,CAACF,SAAS,EAAE;MAClB,IAAI,CAACA,SAAS,CAACM,MAAM,CAACJ,KAAK,CAAC;IAC9B;EACF;;EAEA;AACF;AACA;EACEK,aAAaA,CAAA,EAAY;IACvB,OAAO,IAAI,CAAC5B,aAAa,CAAC6B,WAAW,KAAK,IAAI;EAChD;;EAEA;AACF;AACA;EACEC,QAAQA,CAAA,EAAY;IAClB,OAAO,IAAI,CAACT,SAAS,KAAK,IAAI,IAAI,IAAI,CAACA,SAAS,CAACU,SAAS,KAAK,IAAI;EACrE;;EAEA;AACF;AACA;EACE,IAAIC,OAAOA,CAAA,EAAY;IACrB,OAAO,IAAI,CAACX,SAAS,KAAK,IAAI,IAAI,IAAI,CAACA,SAAS,CAACW,OAAO;EAC1D;;EAEA;AACF;EACE,IAAIC,aAAaA,CAAA,EAAW;IAC1B,IAAI,IAAI,CAACZ,SAAS,EAAE;MAClB,OAAO,IAAI,CAACA,SAAS,CAACY,aAAa;IACrC;IACA,OAAO,EAAE;EACX;;EAEA;AACF;AACA;EACE,IAAIC,gBAAgBA,CAAA,EAAkB;IACpC,OAAO,IAAI,CAACxB,eAAe,CAAC,WAAW,CAAC;EAC1C;;EAEA;AACF;EACE,IAAIyB,QAAQA,CAAA,EAA6B;IACvC,OAAO,IAAI,CAACd,SAAS,CAACc,QAAQ,IAAI,IAAI;EACxC;AACF","ignoreList":[]}
1
+ {"version":3,"file":"BaseFilterModel.js","names":["BaseModel","PARAMETER_SEPARATOR","PARAMETER_TYPES","BaseFilterModel","constructor","data","contributions","modelOptions","_defineProperty","listKey","listkey","type","replace","parameterType","getContribution","BODY","QUERY","isMultiple","context","_context","contextLabel","label","_listKey","key","name","param","isQuickSearch","quicksearch","assistantMessage"],"sources":["../../../src/models/filters/BaseFilterModel.js"],"sourcesContent":["// @flow\nimport BaseModel from \"../base/BaseModel\";\n\nimport {\n PARAMETER_SEPARATOR,\n PARAMETER_TYPES,\n} from \"../../constants/Constants\";\n\nimport type { ModelOptions } from \"../types\";\n\n/**\n * Base class for filters\n */\nexport default class BaseFilterModel extends BaseModel {\n _context: Object;\n _listKey: string;\n\n /**\n */\n constructor(\n data: Object,\n contributions: Object,\n modelOptions?: ModelOptions,\n ) {\n super(data, contributions, modelOptions);\n\n if (this.contributions.listKey) {\n this.listkey = this.contributions.listKey;\n }\n }\n\n /**\n * Get the type of a filter.\n */\n get type(): string {\n return this.contributions.type\n ? this.contributions.type.replace(\"filter\", \"\")\n : \"string\";\n }\n\n /**\n * Returns the parameter type, when the filter can only be used in a POST request the type is 'bodyParameter', else 'queryParameter'.\n */\n get parameterType(): $Values<typeof PARAMETER_TYPES> {\n const parameterType = this.getContribution(\"parameterType\");\n switch (parameterType) {\n case \"bodyParameter\":\n return PARAMETER_TYPES.BODY;\n default:\n return PARAMETER_TYPES.QUERY;\n }\n }\n\n /**\n * Inidiates if filter is multiplechoice\n */\n get isMultiple(): boolean {\n return this.getContribution(\"multiplechoice\", false);\n }\n\n /**\n * Getting context data\n */\n get context(): Object {\n return this._context;\n }\n\n /**\n * Set context of filter\n */\n set context(context: Object) {\n this._context = context;\n }\n\n /**\n * Getting the context label\n */\n get contextLabel(): string {\n return this.context?.label ?? \"\";\n }\n\n /**\n * Getting key of the list these filters apply to\n */\n get listkey(): string {\n return this._listKey;\n }\n\n /**\n * Set key of list this filter belongs to\n */\n set listkey(key: string) {\n this._listKey = key;\n }\n\n /**\n * Getting the label of the filter\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Getting the name of the filter\n */\n get name(): string {\n if (this.listkey) {\n return this.listkey + PARAMETER_SEPARATOR + this.param;\n }\n\n return this.param;\n }\n\n /**\n * Getting the param name of the filter\n */\n get param(): string {\n return this.data.param ?? this.data.name;\n }\n\n /**\n * Inidicates if filter is a quick search filter\n */\n isQuickSearch(): boolean {\n return this.contributions.quicksearch === true;\n }\n\n /**\n * Get assistant message\n */\n get assistantMessage(): string | null {\n return this.getContribution(\"assistant\");\n }\n}\n"],"mappings":";AACA,OAAOA,SAAS,MAAM,mBAAmB;AAEzC,SACEC,mBAAmB,EACnBC,eAAe,QACV,2BAA2B;AAIlC;AACA;AACA;AACA,eAAe,MAAMC,eAAe,SAASH,SAAS,CAAC;EAIrD;AACF;EACEI,WAAWA,CACTC,IAAY,EACZC,aAAqB,EACrBC,YAA2B,EAC3B;IACA,KAAK,CAACF,IAAI,EAAEC,aAAa,EAAEC,YAAY,CAAC;IAACC,eAAA;IAAAA,eAAA;IAEzC,IAAI,IAAI,CAACF,aAAa,CAACG,OAAO,EAAE;MAC9B,IAAI,CAACC,OAAO,GAAG,IAAI,CAACJ,aAAa,CAACG,OAAO;IAC3C;EACF;;EAEA;AACF;AACA;EACE,IAAIE,IAAIA,CAAA,EAAW;IACjB,OAAO,IAAI,CAACL,aAAa,CAACK,IAAI,GAC1B,IAAI,CAACL,aAAa,CAACK,IAAI,CAACC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,GAC7C,QAAQ;EACd;;EAEA;AACF;AACA;EACE,IAAIC,aAAaA,CAAA,EAAoC;IACnD,MAAMA,aAAa,GAAG,IAAI,CAACC,eAAe,CAAC,eAAe,CAAC;IAC3D,QAAQD,aAAa;MACnB,KAAK,eAAe;QAClB,OAAOX,eAAe,CAACa,IAAI;MAC7B;QACE,OAAOb,eAAe,CAACc,KAAK;IAChC;EACF;;EAEA;AACF;AACA;EACE,IAAIC,UAAUA,CAAA,EAAY;IACxB,OAAO,IAAI,CAACH,eAAe,CAAC,gBAAgB,EAAE,KAAK,CAAC;EACtD;;EAEA;AACF;AACA;EACE,IAAII,OAAOA,CAAA,EAAW;IACpB,OAAO,IAAI,CAACC,QAAQ;EACtB;;EAEA;AACF;AACA;EACE,IAAID,OAAOA,CAACA,OAAe,EAAE;IAC3B,IAAI,CAACC,QAAQ,GAAGD,OAAO;EACzB;;EAEA;AACF;AACA;EACE,IAAIE,YAAYA,CAAA,EAAW;IACzB,OAAO,IAAI,CAACF,OAAO,EAAEG,KAAK,IAAI,EAAE;EAClC;;EAEA;AACF;AACA;EACE,IAAIX,OAAOA,CAAA,EAAW;IACpB,OAAO,IAAI,CAACY,QAAQ;EACtB;;EAEA;AACF;AACA;EACE,IAAIZ,OAAOA,CAACa,GAAW,EAAE;IACvB,IAAI,CAACD,QAAQ,GAAGC,GAAG;EACrB;;EAEA;AACF;AACA;EACE,IAAIF,KAAKA,CAAA,EAAW;IAClB,OAAO,IAAI,CAACP,eAAe,CAAC,OAAO,EAAE,EAAE,CAAC;EAC1C;;EAEA;AACF;AACA;EACE,IAAIU,IAAIA,CAAA,EAAW;IACjB,IAAI,IAAI,CAACd,OAAO,EAAE;MAChB,OAAO,IAAI,CAACA,OAAO,GAAGT,mBAAmB,GAAG,IAAI,CAACwB,KAAK;IACxD;IAEA,OAAO,IAAI,CAACA,KAAK;EACnB;;EAEA;AACF;AACA;EACE,IAAIA,KAAKA,CAAA,EAAW;IAClB,OAAO,IAAI,CAACpB,IAAI,CAACoB,KAAK,IAAI,IAAI,CAACpB,IAAI,CAACmB,IAAI;EAC1C;;EAEA;AACF;AACA;EACEE,aAAaA,CAAA,EAAY;IACvB,OAAO,IAAI,CAACpB,aAAa,CAACqB,WAAW,KAAK,IAAI;EAChD;;EAEA;AACF;AACA;EACE,IAAIC,gBAAgBA,CAAA,EAAkB;IACpC,OAAO,IAAI,CAACd,eAAe,CAAC,WAAW,CAAC;EAC1C;AACF","ignoreList":[]}
@@ -1,11 +1,11 @@
1
1
  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
2
2
  import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
3
- import BaseFilterModel from "../filters/BaseFilterModel";
3
+ import FilterModel from "../filters/FilterModel";
4
4
  import ChoiceAttributeModel from "../attributes/ChoiceAttributeModel";
5
5
  /**
6
6
  * The concept index model is a special filter used to index all first concept label letters in de modelcatalog.
7
7
  */
8
- export default class ConceptIndexFilterModel extends BaseFilterModel {
8
+ export default class ConceptIndexFilterModel extends FilterModel {
9
9
  /**
10
10
  * Construct a filter
11
11
  */
@@ -1,5 +1,5 @@
1
1
  // @flow
2
- import BaseFilterModel from "../filters/BaseFilterModel";
2
+ import FilterModel from "../filters/FilterModel";
3
3
  import ChoiceAttributeModel from "../attributes/ChoiceAttributeModel";
4
4
 
5
5
  import type { ModelOptions } from "../types";
@@ -7,7 +7,7 @@ import type { ModelOptions } from "../types";
7
7
  /**
8
8
  * The concept index model is a special filter used to index all first concept label letters in de modelcatalog.
9
9
  */
10
- export default class ConceptIndexFilterModel extends BaseFilterModel {
10
+ export default class ConceptIndexFilterModel extends FilterModel {
11
11
  /**
12
12
  * Construct a filter
13
13
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ConceptIndexFilterModel.js","names":["BaseFilterModel","ChoiceAttributeModel","ConceptIndexFilterModel","constructor","data","contributions","modelOptions","attribute","options","_context","_context2","_context3","selectedValues","_mapInstanceProperty","_filterInstanceProperty","call","option","selected","key","hasOptionByCode","forEach","addOption","code","label"],"sources":["../../../src/models/filters/ConceptIndexFilterModel.js"],"sourcesContent":["// @flow\nimport BaseFilterModel from \"../filters/BaseFilterModel\";\nimport ChoiceAttributeModel from \"../attributes/ChoiceAttributeModel\";\n\nimport type { ModelOptions } from \"../types\";\n\n/**\n * The concept index model is a special filter used to index all first concept label letters in de modelcatalog.\n */\nexport default class ConceptIndexFilterModel extends BaseFilterModel {\n /**\n * Construct a filter\n */\n constructor(\n data: Object,\n contributions: Object,\n modelOptions?: ModelOptions,\n ) {\n super(data, contributions, modelOptions);\n\n if (this.attribute instanceof ChoiceAttributeModel) {\n const attribute: ChoiceAttributeModel = this.attribute;\n\n if (attribute && data.options) {\n const selectedValues = data.options\n .filter((option) => option.selected)\n .map((option) => option.key);\n\n data.options\n .filter((option) => !attribute.options.hasOptionByCode(option.key))\n .forEach((option) => {\n attribute.options.addOption(selectedValues, {\n code: option.key,\n label: option.key,\n });\n });\n }\n }\n }\n}\n"],"mappings":";;AACA,OAAOA,eAAe,MAAM,4BAA4B;AACxD,OAAOC,oBAAoB,MAAM,oCAAoC;AAIrE;AACA;AACA;AACA,eAAe,MAAMC,uBAAuB,SAASF,eAAe,CAAC;EACnE;AACF;AACA;EACEG,WAAWA,CACTC,IAAY,EACZC,aAAqB,EACrBC,YAA2B,EAC3B;IACA,KAAK,CAACF,IAAI,EAAEC,aAAa,EAAEC,YAAY,CAAC;IAExC,IAAI,IAAI,CAACC,SAAS,YAAYN,oBAAoB,EAAE;MAClD,MAAMM,SAA+B,GAAG,IAAI,CAACA,SAAS;MAEtD,IAAIA,SAAS,IAAIH,IAAI,CAACI,OAAO,EAAE;QAAA,IAAAC,QAAA,EAAAC,SAAA,EAAAC,SAAA;QAC7B,MAAMC,cAAc,GAAGC,oBAAA,CAAAJ,QAAA,GAAAK,uBAAA,CAAAJ,SAAA,GAAAN,IAAI,CAACI,OAAO,EAAAO,IAAA,CAAAL,SAAA,EACxBM,MAAM,IAAKA,MAAM,CAACC,QAAQ,CAAC,EAAAF,IAAA,CAAAN,QAAA,EAC9BO,MAAM,IAAKA,MAAM,CAACE,GAAG,CAAC;QAE9BJ,uBAAA,CAAAH,SAAA,GAAAP,IAAI,CAACI,OAAO,EAAAO,IAAA,CAAAJ,SAAA,EACDK,MAAM,IAAK,CAACT,SAAS,CAACC,OAAO,CAACW,eAAe,CAACH,MAAM,CAACE,GAAG,CAAC,CAAC,CAClEE,OAAO,CAAEJ,MAAM,IAAK;UACnBT,SAAS,CAACC,OAAO,CAACa,SAAS,CAACT,cAAc,EAAE;YAC1CU,IAAI,EAAEN,MAAM,CAACE,GAAG;YAChBK,KAAK,EAAEP,MAAM,CAACE;UAChB,CAAC,CAAC;QACJ,CAAC,CAAC;MACN;IACF;EACF;AACF","ignoreList":[]}
1
+ {"version":3,"file":"ConceptIndexFilterModel.js","names":["FilterModel","ChoiceAttributeModel","ConceptIndexFilterModel","constructor","data","contributions","modelOptions","attribute","options","_context","_context2","_context3","selectedValues","_mapInstanceProperty","_filterInstanceProperty","call","option","selected","key","hasOptionByCode","forEach","addOption","code","label"],"sources":["../../../src/models/filters/ConceptIndexFilterModel.js"],"sourcesContent":["// @flow\nimport FilterModel from \"../filters/FilterModel\";\nimport ChoiceAttributeModel from \"../attributes/ChoiceAttributeModel\";\n\nimport type { ModelOptions } from \"../types\";\n\n/**\n * The concept index model is a special filter used to index all first concept label letters in de modelcatalog.\n */\nexport default class ConceptIndexFilterModel extends FilterModel {\n /**\n * Construct a filter\n */\n constructor(\n data: Object,\n contributions: Object,\n modelOptions?: ModelOptions,\n ) {\n super(data, contributions, modelOptions);\n\n if (this.attribute instanceof ChoiceAttributeModel) {\n const attribute: ChoiceAttributeModel = this.attribute;\n\n if (attribute && data.options) {\n const selectedValues = data.options\n .filter((option) => option.selected)\n .map((option) => option.key);\n\n data.options\n .filter((option) => !attribute.options.hasOptionByCode(option.key))\n .forEach((option) => {\n attribute.options.addOption(selectedValues, {\n code: option.key,\n label: option.key,\n });\n });\n }\n }\n }\n}\n"],"mappings":";;AACA,OAAOA,WAAW,MAAM,wBAAwB;AAChD,OAAOC,oBAAoB,MAAM,oCAAoC;AAIrE;AACA;AACA;AACA,eAAe,MAAMC,uBAAuB,SAASF,WAAW,CAAC;EAC/D;AACF;AACA;EACEG,WAAWA,CACTC,IAAY,EACZC,aAAqB,EACrBC,YAA2B,EAC3B;IACA,KAAK,CAACF,IAAI,EAAEC,aAAa,EAAEC,YAAY,CAAC;IAExC,IAAI,IAAI,CAACC,SAAS,YAAYN,oBAAoB,EAAE;MAClD,MAAMM,SAA+B,GAAG,IAAI,CAACA,SAAS;MAEtD,IAAIA,SAAS,IAAIH,IAAI,CAACI,OAAO,EAAE;QAAA,IAAAC,QAAA,EAAAC,SAAA,EAAAC,SAAA;QAC7B,MAAMC,cAAc,GAAGC,oBAAA,CAAAJ,QAAA,GAAAK,uBAAA,CAAAJ,SAAA,GAAAN,IAAI,CAACI,OAAO,EAAAO,IAAA,CAAAL,SAAA,EACxBM,MAAM,IAAKA,MAAM,CAACC,QAAQ,CAAC,EAAAF,IAAA,CAAAN,QAAA,EAC9BO,MAAM,IAAKA,MAAM,CAACE,GAAG,CAAC;QAE9BJ,uBAAA,CAAAH,SAAA,GAAAP,IAAI,CAACI,OAAO,EAAAO,IAAA,CAAAJ,SAAA,EACDK,MAAM,IAAK,CAACT,SAAS,CAACC,OAAO,CAACW,eAAe,CAACH,MAAM,CAACE,GAAG,CAAC,CAAC,CAClEE,OAAO,CAAEJ,MAAM,IAAK;UACnBT,SAAS,CAACC,OAAO,CAACa,SAAS,CAACT,cAAc,EAAE;YAC1CU,IAAI,EAAEN,MAAM,CAACE,GAAG;YAChBK,KAAK,EAAEP,MAAM,CAACE;UAChB,CAAC,CAAC;QACJ,CAAC,CAAC;MACN;IACF;EACF;AACF","ignoreList":[]}
@@ -1,6 +1,121 @@
1
+ import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
1
2
  import BaseFilterModel from "../filters/BaseFilterModel";
2
-
3
+ import createAttribute from "../attributes/_createAttribute";
4
+ import { IllegalStateException } from "../../exceptions";
3
5
  /**
4
6
  */
5
- export default class FilterModel extends BaseFilterModel {}
7
+ export default class FilterModel extends BaseFilterModel {
8
+ /**
9
+ */
10
+ constructor(data, contributions, modelOptions) {
11
+ super(data, contributions, modelOptions);
12
+ _defineProperty(this, "_attribute", null);
13
+ this._attribute = this.createAttribute(this.type, this.param, this.data, this.contributions);
14
+ }
15
+
16
+ /**
17
+ * Create attribute through the attribute factory. Create type based on filter key without the filter suffix
18
+ */
19
+ createAttribute(type, param, data, contributions) {
20
+ if (type === "assignment") {
21
+ return null;
22
+ }
23
+ return createAttribute(param, data, {
24
+ ...contributions,
25
+ type: type
26
+ }, this.modelOptions);
27
+ }
28
+
29
+ /**
30
+ * Get attribute of filter
31
+ */
32
+ get attribute() {
33
+ if (!this._attribute) {
34
+ throw new IllegalStateException(`Missing filter attribute on filter model: ${this.label}`);
35
+ }
36
+ return this._attribute;
37
+ }
38
+
39
+ /**
40
+ * Retrieve the parameters with it's value for this filter
41
+ */
42
+ get params() {
43
+ if (!this.param) {
44
+ return [];
45
+ }
46
+ return [{
47
+ name: this.param,
48
+ value: this.attribute?.value
49
+ }];
50
+ }
51
+
52
+ /**
53
+ * Getting the value of the filter
54
+ */
55
+ get value() {
56
+ return this.attribute?.value;
57
+ }
58
+
59
+ /**
60
+ * Getting the inputvalue of the filter
61
+ */
62
+ get inputvalue() {
63
+ return this.attribute?.inputvalue;
64
+ }
65
+
66
+ /**
67
+ * Indicates if the filter has a value.
68
+ */
69
+ hasValue() {
70
+ return this.value !== null && this.value !== "";
71
+ }
72
+
73
+ /**
74
+ * Reset the value of this filter to undefined
75
+ */
76
+ reset() {
77
+ if (this.attribute) {
78
+ this.attribute.reset();
79
+ }
80
+ return this;
81
+ }
82
+
83
+ /**
84
+ * Update this filter with input name and value
85
+ */
86
+ update(attribute, value) {
87
+ if (this.attribute) {
88
+ this.attribute.update(value);
89
+ }
90
+ }
91
+
92
+ /**
93
+ * Inidiates if filter is active
94
+ */
95
+ isActive() {
96
+ return this.attribute?.initvalue !== null;
97
+ }
98
+
99
+ /**
100
+ * Inidiates if filter is valid
101
+ */
102
+ get isValid() {
103
+ return this.attribute?.isValid || true;
104
+ }
105
+
106
+ /**
107
+ */
108
+ get readonlyvalue() {
109
+ if (this.attribute) {
110
+ return this.attribute.readonlyvalue;
111
+ }
112
+ return "";
113
+ }
114
+
115
+ /**
116
+ */
117
+ get formdata() {
118
+ return this.attribute.formdata ?? null;
119
+ }
120
+ }
6
121
  //# sourceMappingURL=FilterModel.js.map
@@ -1,6 +1,151 @@
1
1
  // @flow
2
2
  import BaseFilterModel from "../filters/BaseFilterModel";
3
+ import createAttribute from "../attributes/_createAttribute";
4
+ import { IllegalStateException } from "../../exceptions";
5
+
6
+ import type { AttributeType, FilterType, ModelOptions } from "../types";
3
7
 
4
8
  /**
5
9
  */
6
- export default class FilterModel extends BaseFilterModel {}
10
+ export default class FilterModel extends BaseFilterModel {
11
+ _attribute: AttributeType | null = null;
12
+
13
+ /**
14
+ */
15
+ constructor(
16
+ data: Object,
17
+ contributions: Object,
18
+ modelOptions?: ModelOptions,
19
+ ) {
20
+ super(data, contributions, modelOptions);
21
+
22
+ this._attribute = this.createAttribute(
23
+ this.type,
24
+ this.param,
25
+ this.data,
26
+ this.contributions,
27
+ );
28
+ }
29
+
30
+ /**
31
+ * Create attribute through the attribute factory. Create type based on filter key without the filter suffix
32
+ */
33
+ createAttribute(
34
+ type: string,
35
+ param: string,
36
+ data: Object,
37
+ contributions: Object,
38
+ ): AttributeType | null {
39
+ if (type === "assignment") {
40
+ return null;
41
+ }
42
+
43
+ return createAttribute(
44
+ param,
45
+ data,
46
+ {
47
+ ...contributions,
48
+ type: type,
49
+ },
50
+ this.modelOptions,
51
+ );
52
+ }
53
+
54
+ /**
55
+ * Get attribute of filter
56
+ */
57
+ get attribute(): AttributeType {
58
+ if (!this._attribute) {
59
+ throw new IllegalStateException(
60
+ `Missing filter attribute on filter model: ${this.label}`,
61
+ );
62
+ }
63
+ return this._attribute;
64
+ }
65
+
66
+ /**
67
+ * Retrieve the parameters with it's value for this filter
68
+ */
69
+ get params(): Array<{ name: string, value: ?string }> {
70
+ if (!this.param) {
71
+ return [];
72
+ }
73
+
74
+ return [
75
+ {
76
+ name: this.param,
77
+ value: this.attribute?.value,
78
+ },
79
+ ];
80
+ }
81
+
82
+ /**
83
+ * Getting the value of the filter
84
+ */
85
+ get value(): string | null {
86
+ return this.attribute?.value;
87
+ }
88
+
89
+ /**
90
+ * Getting the inputvalue of the filter
91
+ */
92
+ get inputvalue(): string {
93
+ return this.attribute?.inputvalue;
94
+ }
95
+
96
+ /**
97
+ * Indicates if the filter has a value.
98
+ */
99
+ hasValue(): boolean {
100
+ return this.value !== null && this.value !== "";
101
+ }
102
+
103
+ /**
104
+ * Reset the value of this filter to undefined
105
+ */
106
+ reset(): FilterType {
107
+ if (this.attribute) {
108
+ this.attribute.reset();
109
+ }
110
+
111
+ return this;
112
+ }
113
+
114
+ /**
115
+ * Update this filter with input name and value
116
+ */
117
+ update(attribute: AttributeType, value: string) {
118
+ if (this.attribute) {
119
+ this.attribute.update(value);
120
+ }
121
+ }
122
+
123
+ /**
124
+ * Inidiates if filter is active
125
+ */
126
+ isActive(): boolean {
127
+ return this.attribute?.initvalue !== null;
128
+ }
129
+
130
+ /**
131
+ * Inidiates if filter is valid
132
+ */
133
+ get isValid(): boolean {
134
+ return this.attribute?.isValid || true;
135
+ }
136
+
137
+ /**
138
+ */
139
+ get readonlyvalue(): string {
140
+ if (this.attribute) {
141
+ return this.attribute.readonlyvalue;
142
+ }
143
+ return "";
144
+ }
145
+
146
+ /**
147
+ */
148
+ get formdata(): { [string]: any } | null {
149
+ return this.attribute.formdata ?? null;
150
+ }
151
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"FilterModel.js","names":["BaseFilterModel","FilterModel"],"sources":["../../../src/models/filters/FilterModel.js"],"sourcesContent":["// @flow\nimport BaseFilterModel from \"../filters/BaseFilterModel\";\n\n/**\n */\nexport default class FilterModel extends BaseFilterModel {}\n"],"mappings":"AACA,OAAOA,eAAe,MAAM,4BAA4B;;AAExD;AACA;AACA,eAAe,MAAMC,WAAW,SAASD,eAAe,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"FilterModel.js","names":["BaseFilterModel","createAttribute","IllegalStateException","FilterModel","constructor","data","contributions","modelOptions","_defineProperty","_attribute","type","param","attribute","label","params","name","value","inputvalue","hasValue","reset","update","isActive","initvalue","isValid","readonlyvalue","formdata"],"sources":["../../../src/models/filters/FilterModel.js"],"sourcesContent":["// @flow\nimport BaseFilterModel from \"../filters/BaseFilterModel\";\nimport createAttribute from \"../attributes/_createAttribute\";\nimport { IllegalStateException } from \"../../exceptions\";\n\nimport type { AttributeType, FilterType, ModelOptions } from \"../types\";\n\n/**\n */\nexport default class FilterModel extends BaseFilterModel {\n _attribute: AttributeType | null = null;\n\n /**\n */\n constructor(\n data: Object,\n contributions: Object,\n modelOptions?: ModelOptions,\n ) {\n super(data, contributions, modelOptions);\n\n this._attribute = this.createAttribute(\n this.type,\n this.param,\n this.data,\n this.contributions,\n );\n }\n\n /**\n * Create attribute through the attribute factory. Create type based on filter key without the filter suffix\n */\n createAttribute(\n type: string,\n param: string,\n data: Object,\n contributions: Object,\n ): AttributeType | null {\n if (type === \"assignment\") {\n return null;\n }\n\n return createAttribute(\n param,\n data,\n {\n ...contributions,\n type: type,\n },\n this.modelOptions,\n );\n }\n\n /**\n * Get attribute of filter\n */\n get attribute(): AttributeType {\n if (!this._attribute) {\n throw new IllegalStateException(\n `Missing filter attribute on filter model: ${this.label}`,\n );\n }\n return this._attribute;\n }\n\n /**\n * Retrieve the parameters with it's value for this filter\n */\n get params(): Array<{ name: string, value: ?string }> {\n if (!this.param) {\n return [];\n }\n\n return [\n {\n name: this.param,\n value: this.attribute?.value,\n },\n ];\n }\n\n /**\n * Getting the value of the filter\n */\n get value(): string | null {\n return this.attribute?.value;\n }\n\n /**\n * Getting the inputvalue of the filter\n */\n get inputvalue(): string {\n return this.attribute?.inputvalue;\n }\n\n /**\n * Indicates if the filter has a value.\n */\n hasValue(): boolean {\n return this.value !== null && this.value !== \"\";\n }\n\n /**\n * Reset the value of this filter to undefined\n */\n reset(): FilterType {\n if (this.attribute) {\n this.attribute.reset();\n }\n\n return this;\n }\n\n /**\n * Update this filter with input name and value\n */\n update(attribute: AttributeType, value: string) {\n if (this.attribute) {\n this.attribute.update(value);\n }\n }\n\n /**\n * Inidiates if filter is active\n */\n isActive(): boolean {\n return this.attribute?.initvalue !== null;\n }\n\n /**\n * Inidiates if filter is valid\n */\n get isValid(): boolean {\n return this.attribute?.isValid || true;\n }\n\n /**\n */\n get readonlyvalue(): string {\n if (this.attribute) {\n return this.attribute.readonlyvalue;\n }\n return \"\";\n }\n\n /**\n */\n get formdata(): { [string]: any } | null {\n return this.attribute.formdata ?? null;\n }\n}\n"],"mappings":";AACA,OAAOA,eAAe,MAAM,4BAA4B;AACxD,OAAOC,eAAe,MAAM,gCAAgC;AAC5D,SAASC,qBAAqB,QAAQ,kBAAkB;AAIxD;AACA;AACA,eAAe,MAAMC,WAAW,SAASH,eAAe,CAAC;EAGvD;AACF;EACEI,WAAWA,CACTC,IAAY,EACZC,aAAqB,EACrBC,YAA2B,EAC3B;IACA,KAAK,CAACF,IAAI,EAAEC,aAAa,EAAEC,YAAY,CAAC;IAACC,eAAA,qBATR,IAAI;IAWrC,IAAI,CAACC,UAAU,GAAG,IAAI,CAACR,eAAe,CACpC,IAAI,CAACS,IAAI,EACT,IAAI,CAACC,KAAK,EACV,IAAI,CAACN,IAAI,EACT,IAAI,CAACC,aACP,CAAC;EACH;;EAEA;AACF;AACA;EACEL,eAAeA,CACbS,IAAY,EACZC,KAAa,EACbN,IAAY,EACZC,aAAqB,EACC;IACtB,IAAII,IAAI,KAAK,YAAY,EAAE;MACzB,OAAO,IAAI;IACb;IAEA,OAAOT,eAAe,CACpBU,KAAK,EACLN,IAAI,EACJ;MACE,GAAGC,aAAa;MAChBI,IAAI,EAAEA;IACR,CAAC,EACD,IAAI,CAACH,YACP,CAAC;EACH;;EAEA;AACF;AACA;EACE,IAAIK,SAASA,CAAA,EAAkB;IAC7B,IAAI,CAAC,IAAI,CAACH,UAAU,EAAE;MACpB,MAAM,IAAIP,qBAAqB,CAC7B,6CAA6C,IAAI,CAACW,KAAK,EACzD,CAAC;IACH;IACA,OAAO,IAAI,CAACJ,UAAU;EACxB;;EAEA;AACF;AACA;EACE,IAAIK,MAAMA,CAAA,EAA4C;IACpD,IAAI,CAAC,IAAI,CAACH,KAAK,EAAE;MACf,OAAO,EAAE;IACX;IAEA,OAAO,CACL;MACEI,IAAI,EAAE,IAAI,CAACJ,KAA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  import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
2
- import BaseFilterModel from "../filters/BaseFilterModel";
2
+ import FilterModel from "../filters/FilterModel";
3
3
  import CompositeAttributeModel from "../attributes/CompositeAttributeModel";
4
4
  /**
5
5
  * Range filter, for instance a date range filter or a number range filter
6
6
  */
7
- export default class RangeFilterModel extends BaseFilterModel {
7
+ export default class RangeFilterModel extends FilterModel {
8
8
  /**
9
9
  */
10
10
  update(attribute, value) {
@@ -1,5 +1,5 @@
1
1
  // @flow
2
- import BaseFilterModel from "../filters/BaseFilterModel";
2
+ import FilterModel from "../filters/FilterModel";
3
3
 
4
4
  import CompositeAttributeModel from "../attributes/CompositeAttributeModel";
5
5
  import type { AttributeType } from "../types";
@@ -7,7 +7,7 @@ import type { AttributeType } from "../types";
7
7
  /**
8
8
  * Range filter, for instance a date range filter or a number range filter
9
9
  */
10
- export default class RangeFilterModel extends BaseFilterModel {
10
+ export default class RangeFilterModel extends FilterModel {
11
11
  /**
12
12
  */
13
13
  update(attribute: AttributeType, value: string) {
@@ -1 +1 @@
1
- {"version":3,"file":"RangeFilterModel.js","names":["BaseFilterModel","CompositeAttributeModel","RangeFilterModel","update","attribute","value","params","_context","_mapInstanceProperty","children","call","child","param","data","name"],"sources":["../../../src/models/filters/RangeFilterModel.js"],"sourcesContent":["// @flow\nimport BaseFilterModel from \"../filters/BaseFilterModel\";\n\nimport CompositeAttributeModel from \"../attributes/CompositeAttributeModel\";\nimport type { AttributeType } from \"../types\";\n\n/**\n * Range filter, for instance a date range filter or a number range filter\n */\nexport default class RangeFilterModel extends BaseFilterModel {\n /**\n */\n update(attribute: AttributeType, value: string) {\n if (this.attribute instanceof CompositeAttributeModel) {\n this.attribute.update(value, attribute);\n } else if (this.attribute !== null) {\n this.attribute.update(value);\n }\n }\n\n /**\n */\n get params(): Array<{ name: string, value: ?string }> {\n if (this.attribute instanceof CompositeAttributeModel) {\n return this.attribute.children.map((child) => {\n const { param } = this.data[child.name];\n return {\n name: param,\n value: child.value,\n };\n });\n }\n\n return [];\n }\n}\n"],"mappings":";AACA,OAAOA,eAAe,MAAM,4BAA4B;AAExD,OAAOC,uBAAuB,MAAM,uCAAuC;AAG3E;AACA;AACA;AACA,eAAe,MAAMC,gBAAgB,SAASF,eAAe,CAAC;EAC5D;AACF;EACEG,MAAMA,CAACC,SAAwB,EAAEC,KAAa,EAAE;IAC9C,IAAI,IAAI,CAACD,SAAS,YAAYH,uBAAuB,EAAE;MACrD,IAAI,CAACG,SAAS,CAACD,MAAM,CAACE,KAAK,EAAED,SAAS,CAAC;IACzC,CAAC,MAAM,IAAI,IAAI,CAACA,SAAS,KAAK,IAAI,EAAE;MAClC,IAAI,CAACA,SAAS,CAACD,MAAM,CAACE,KAAK,CAAC;IAC9B;EACF;;EAEA;AACF;EACE,IAAIC,MAAMA,CAAA,EAA4C;IACpD,IAAI,IAAI,CAACF,SAAS,YAAYH,uBAAuB,EAAE;MAAA,IAAAM,QAAA;MACrD,OAAOC,oBAAA,CAAAD,QAAA,OAAI,CAACH,SAAS,CAACK,QAAQ,EAAAC,IAAA,CAAAH,QAAA,EAAMI,KAAK,IAAK;QAC5C,MAAM;UAAEC;QAAM,CAAC,GAAG,IAAI,CAACC,IAAI,CAACF,KAAK,CAACG,IAAI,CAAC;QACvC,OAAO;UACLA,IAAI,EAAEF,KAAK;UACXP,KAAK,EAAEM,KAAK,CAACN;QACf,CAAC;MACH,CAAC,CAAC;IACJ;IAEA,OAAO,EAAE;EACX;AACF","ignoreList":[]}
1
+ {"version":3,"file":"RangeFilterModel.js","names":["FilterModel","CompositeAttributeModel","RangeFilterModel","update","attribute","value","params","_context","_mapInstanceProperty","children","call","child","param","data","name"],"sources":["../../../src/models/filters/RangeFilterModel.js"],"sourcesContent":["// @flow\nimport FilterModel from \"../filters/FilterModel\";\n\nimport CompositeAttributeModel from \"../attributes/CompositeAttributeModel\";\nimport type { AttributeType } from \"../types\";\n\n/**\n * Range filter, for instance a date range filter or a number range filter\n */\nexport default class RangeFilterModel extends FilterModel {\n /**\n */\n update(attribute: AttributeType, value: string) {\n if (this.attribute instanceof CompositeAttributeModel) {\n this.attribute.update(value, attribute);\n } else if (this.attribute !== null) {\n this.attribute.update(value);\n }\n }\n\n /**\n */\n get params(): Array<{ name: string, value: ?string }> {\n if (this.attribute instanceof CompositeAttributeModel) {\n return this.attribute.children.map((child) => {\n const { param } = this.data[child.name];\n return {\n name: param,\n value: child.value,\n };\n });\n }\n\n return [];\n }\n}\n"],"mappings":";AACA,OAAOA,WAAW,MAAM,wBAAwB;AAEhD,OAAOC,uBAAuB,MAAM,uCAAuC;AAG3E;AACA;AACA;AACA,eAAe,MAAMC,gBAAgB,SAASF,WAAW,CAAC;EACxD;AACF;EACEG,MAAMA,CAACC,SAAwB,EAAEC,KAAa,EAAE;IAC9C,IAAI,IAAI,CAACD,SAAS,YAAYH,uBAAuB,EAAE;MACrD,IAAI,CAACG,SAAS,CAACD,MAAM,CAACE,KAAK,EAAED,SAAS,CAAC;IACzC,CAAC,MAAM,IAAI,IAAI,CAACA,SAAS,KAAK,IAAI,EAAE;MAClC,IAAI,CAACA,SAAS,CAACD,MAAM,CAACE,KAAK,CAAC;IAC9B;EACF;;EAEA;AACF;EACE,IAAIC,MAAMA,CAAA,EAA4C;IACpD,IAAI,IAAI,CAACF,SAAS,YAAYH,uBAAuB,EAAE;MAAA,IAAAM,QAAA;MACrD,OAAOC,oBAAA,CAAAD,QAAA,OAAI,CAACH,SAAS,CAACK,QAAQ,EAAAC,IAAA,CAAAH,QAAA,EAAMI,KAAK,IAAK;QAC5C,MAAM;UAAEC;QAAM,CAAC,GAAG,IAAI,CAACC,IAAI,CAACF,KAAK,CAACG,IAAI,CAAC;QACvC,OAAO;UACLA,IAAI,EAAEF,KAAK;UACXP,KAAK,EAAEM,KAAK,CAACN;QACf,CAAC;MACH,CAAC,CAAC;IACJ;IAEA,OAAO,EAAE;EACX;AACF","ignoreList":[]}
@@ -41,7 +41,6 @@ import type UserModel from "./user/UserModel";
41
41
  import type UserServicesModel from "./user/UserServicesModel";
42
42
  import type LinkModel from "./links/LinkModel";
43
43
  import type LookupOptionsModel from "./lookup/LookupOptionsModel";
44
- import type BaseFilterModel from "./filters/BaseFilterModel";
45
44
  import type AttributeCollection from "./attributes/AttributeCollection";
46
45
  import type AttributeModel from "./attributes/AttributeModel";
47
46
  import type LayoutHintCollection from "./layouthint/LayoutHintCollection";
@@ -92,9 +91,8 @@ export type RangeChildAttributeType =
92
91
  | DatetimeAttributeModel;
93
92
 
94
93
  export type FilterType =
95
- | BaseFilterModel
96
- | FilterModel
97
94
  | AssignmentFilterModel
95
+ | FilterModel
98
96
  | RangeFilterModel
99
97
  | ConceptIndexFilterModel;
100
98
 
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../src/models/types.js"],"sourcesContent":["// @flow\nimport type ApplicationModel from \"./application/ApplicationModel\";\nimport type BooleanAttributeModel from \"./attributes/BooleanAttributeModel\";\nimport type CaptchaAttributeModel from \"./attributes/CaptchaAttributeModel\";\nimport type ChoiceAttributeModel from \"./attributes/ChoiceAttributeModel\";\nimport type CompositeAttributeModel from \"./attributes/CompositeAttributeModel\";\nimport type DatetimeAttributeModel from \"./attributes/DatetimeAttributeModel\";\nimport type HelptextAttributeModel from \"./attributes/HelptextAttributeModel\";\nimport type LabelAttributeModel from \"./attributes/LabelAttributeModel\";\nimport type MemoAttributeModel from \"./attributes/MemoAttributeModel\";\nimport type MoneyAttributeModel from \"./attributes/MoneyAttributeModel\";\nimport type NumberAttributeModel from \"./attributes/NumberAttributeModel\";\nimport type PasswordAttributeModel from \"./attributes/PasswordAttributeModel\";\nimport type StringAttributeModel from \"./attributes/StringAttributeModel\";\nimport type UploadAttributeModel from \"./attributes/UploadAttributeModel\";\nimport type XMLAttributeModel from \"./attributes/XMLAttributeModel\";\nimport type CaseViewModel from \"./caseview/CaseViewModel\";\nimport type BusinessScenarioModel from \"./concepts/BusinessScenarioModel\";\nimport type ConceptDetailModel from \"./concepts/ConceptDetailModel\";\nimport type ConceptIndexModel from \"./concepts/ConceptIndexModel\";\nimport type ConceptTypeDetailModel from \"./concepts/ConceptTypeDetailModel\";\nimport type ContentIndexModel from \"./content/ContentIndexModel\";\nimport type ContentModel from \"./content/ContentModel\";\nimport type SectionModel from \"./content/SectionModel\";\nimport type ContentTOCModel from \"./content/ContentTOCModel\";\nimport type ContentTypeModel from \"./content/ContentTypeModel\";\nimport type DetailModel from \"./detail/DetailModel\";\nimport type AssignmentFilterModel from \"./filters/AssignmentFilterModel\";\nimport type FilterModel from \"./filters/FilterModel\";\nimport type RangeFilterModel from \"./filters/RangeFilterModel\";\nimport type ConceptIndexFilterModel from \"./filters/ConceptIndexFilterModel\";\nimport type FormModel from \"./form/FormModel\";\nimport type ListDetailModel from \"./list/ListDetailModel\";\nimport type ListModel from \"./list/ListModel\";\nimport type ModelCatalogModel from \"./modelcatalog/ModelCatalogModel\";\nimport type GroupingPanelModel from \"./panels/GroupingPanelModel\";\nimport type CaseSearchModel from \"./search/CaseSearchModel\";\nimport type TabModel from \"./tab/TabModel\";\nimport type TaskGroupModel from \"./taskgroup/TaskGroupModel\";\nimport type UserModel from \"./user/UserModel\";\nimport type UserServicesModel from \"./user/UserServicesModel\";\nimport type LinkModel from \"./links/LinkModel\";\nimport type LookupOptionsModel from \"./lookup/LookupOptionsModel\";\nimport type BaseFilterModel from \"./filters/BaseFilterModel\";\nimport type AttributeCollection from \"./attributes/AttributeCollection\";\nimport type AttributeModel from \"./attributes/AttributeModel\";\nimport type LayoutHintCollection from \"./layouthint/LayoutHintCollection\";\nimport type ErrorResponse from \"./error/ErrorResponse\";\n\nexport type ModularUIModel =\n | ApplicationModel\n | CaseSearchModel\n | CaseViewModel\n | ListDetailModel\n | DetailModel\n | FormModel\n | GroupingPanelModel\n | ListModel\n | TabModel\n | TaskGroupModel\n | UserModel\n | UserServicesModel\n | ModelCatalogModel\n | ConceptIndexModel\n | ConceptDetailModel\n | BusinessScenarioModel\n | ConceptTypeDetailModel\n | ContentIndexModel\n | ContentTOCModel\n | ContentModel\n | ContentTypeModel\n | LookupOptionsModel;\n\nexport type AttributeType =\n | BooleanAttributeModel\n | CaptchaAttributeModel\n | ChoiceAttributeModel\n | DatetimeAttributeModel\n | HelptextAttributeModel\n | LabelAttributeModel\n | MemoAttributeModel\n | MoneyAttributeModel\n | NumberAttributeModel\n | PasswordAttributeModel\n | CompositeAttributeModel\n | StringAttributeModel\n | UploadAttributeModel\n | XMLAttributeModel;\n\nexport type RangeChildAttributeType =\n | NumberAttributeModel\n | DatetimeAttributeModel;\n\nexport type FilterType =\n | BaseFilterModel\n | FilterModel\n | AssignmentFilterModel\n | RangeFilterModel\n | ConceptIndexFilterModel;\n\nexport type FormErrorAnchor = {\n id: string,\n properties?: {\n [propertyName: string]: string | number,\n },\n anchor?: {\n objectid: string,\n elementid?: string,\n _links?: Object,\n index?: number,\n \"index-identifier\"?: string,\n },\n layouthint: LayoutHintCollection,\n message: string,\n param?: {\n name: string,\n },\n};\n\nexport type labelsJSON = {\n _id: string,\n label: string,\n value: string,\n};\n\nexport type propertyJSON = {\n _id: string,\n type: string,\n mandatory: string,\n label: string,\n value: string,\n};\n\nexport type textfragmentJSON = {\n label: string,\n text: string,\n type: string,\n};\n\nexport interface IConstraintModel {\n +id: string;\n +defaultMessage: string;\n +parameters: Object;\n +isMandatoryConstraint: boolean;\n validate(value: any): boolean;\n hasValidation(): boolean;\n}\n\nexport interface ILayoutHintRule {\n process(attribute: AttributeModel, attributes: AttributeCollection): void;\n}\n\nexport interface IModelWithChildModels {\n getInitialChildModelLinks(): Array<LinkModel>;\n setChildModels(\n models: Array<ModularUIModel>,\n errors: Array<ErrorResponse>,\n ): void;\n}\n\nexport type AuthenticationType = {\n name: string,\n authentication: string,\n redirectUri?: string,\n isPrimary: boolean,\n};\n\nexport type FileEntryType = {\n name: string,\n size?: number,\n progress: number,\n error?: string,\n token?: string,\n};\n\nexport type FilesType = {\n [filename: string]: FileEntryType,\n};\n\nexport type FiletypeConstraintsType = Array<{|\n extensions: Array<string>,\n mimeTypes: Array<string>,\n|}>;\n\nexport type FilesizeConstraintsType = {\n fileSize: ?number,\n maxTotalFileSize: ?number,\n isMaxTotal: boolean,\n};\n\nexport type PropertyData = { type: string, label: string, value: string };\nexport type TextFragmentData = {\n type: string,\n label: string,\n text: string | { id?: string, message: string, properties?: Object },\n};\nexport type SectionData = {\n id: string,\n type: string,\n label?: string,\n number?: string,\n body: string | { id?: string, message: string, properties?: Object },\n _links: { self: { href: string } },\n childSections?: Array<SectionData>,\n sections?: Array<SectionData>,\n subSections: Array<SectionData>,\n};\n\nexport type PropertyElement = {\n propertyElement: {\n label: string,\n layouthint: Array<string>,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElement = {\n textFragmentElement: {\n label: string,\n layouthint: Array<string>,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElement = {\n contentElement: {\n label: string,\n layouthint: Array<string>,\n sections: Array<SectionData>,\n },\n};\n\nexport type PropertyElementMapped = {\n propertyElement: {\n label: string,\n layouthint: LayoutHintCollection,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElementMapped = {\n textFragmentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElementMapped = {\n contentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n sections: Array<SectionModel>,\n },\n};\n\nexport type ContentAll = Array<\n PropertyElementMapped | TextFragmentElementMapped | ContentElementMapped,\n>;\n\nexport type ContentData = {\n header: {\n label?: string,\n description?: { id?: string, message: string, properties?: Object },\n },\n label?: string,\n elements: Array<PropertyElement | TextFragmentElement | ContentElement>,\n};\n\nexport type SectionFragment = {\n text: string,\n startOffset: number,\n endOffset: number,\n};\n\nexport type ModelOptions = {\n origin?: ?string,\n contextPath?: ?string,\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/models/types.js"],"sourcesContent":["// @flow\nimport type ApplicationModel from \"./application/ApplicationModel\";\nimport type BooleanAttributeModel from \"./attributes/BooleanAttributeModel\";\nimport type CaptchaAttributeModel from \"./attributes/CaptchaAttributeModel\";\nimport type ChoiceAttributeModel from \"./attributes/ChoiceAttributeModel\";\nimport type CompositeAttributeModel from \"./attributes/CompositeAttributeModel\";\nimport type DatetimeAttributeModel from \"./attributes/DatetimeAttributeModel\";\nimport type HelptextAttributeModel from \"./attributes/HelptextAttributeModel\";\nimport type LabelAttributeModel from \"./attributes/LabelAttributeModel\";\nimport type MemoAttributeModel from \"./attributes/MemoAttributeModel\";\nimport type MoneyAttributeModel from \"./attributes/MoneyAttributeModel\";\nimport type NumberAttributeModel from \"./attributes/NumberAttributeModel\";\nimport type PasswordAttributeModel from \"./attributes/PasswordAttributeModel\";\nimport type StringAttributeModel from \"./attributes/StringAttributeModel\";\nimport type UploadAttributeModel from \"./attributes/UploadAttributeModel\";\nimport type XMLAttributeModel from \"./attributes/XMLAttributeModel\";\nimport type CaseViewModel from \"./caseview/CaseViewModel\";\nimport type BusinessScenarioModel from \"./concepts/BusinessScenarioModel\";\nimport type ConceptDetailModel from \"./concepts/ConceptDetailModel\";\nimport type ConceptIndexModel from \"./concepts/ConceptIndexModel\";\nimport type ConceptTypeDetailModel from \"./concepts/ConceptTypeDetailModel\";\nimport type ContentIndexModel from \"./content/ContentIndexModel\";\nimport type ContentModel from \"./content/ContentModel\";\nimport type SectionModel from \"./content/SectionModel\";\nimport type ContentTOCModel from \"./content/ContentTOCModel\";\nimport type ContentTypeModel from \"./content/ContentTypeModel\";\nimport type DetailModel from \"./detail/DetailModel\";\nimport type AssignmentFilterModel from \"./filters/AssignmentFilterModel\";\nimport type FilterModel from \"./filters/FilterModel\";\nimport type RangeFilterModel from \"./filters/RangeFilterModel\";\nimport type ConceptIndexFilterModel from \"./filters/ConceptIndexFilterModel\";\nimport type FormModel from \"./form/FormModel\";\nimport type ListDetailModel from \"./list/ListDetailModel\";\nimport type ListModel from \"./list/ListModel\";\nimport type ModelCatalogModel from \"./modelcatalog/ModelCatalogModel\";\nimport type GroupingPanelModel from \"./panels/GroupingPanelModel\";\nimport type CaseSearchModel from \"./search/CaseSearchModel\";\nimport type TabModel from \"./tab/TabModel\";\nimport type TaskGroupModel from \"./taskgroup/TaskGroupModel\";\nimport type UserModel from \"./user/UserModel\";\nimport type UserServicesModel from \"./user/UserServicesModel\";\nimport type LinkModel from \"./links/LinkModel\";\nimport type LookupOptionsModel from \"./lookup/LookupOptionsModel\";\nimport type AttributeCollection from \"./attributes/AttributeCollection\";\nimport type AttributeModel from \"./attributes/AttributeModel\";\nimport type LayoutHintCollection from \"./layouthint/LayoutHintCollection\";\nimport type ErrorResponse from \"./error/ErrorResponse\";\n\nexport type ModularUIModel =\n | ApplicationModel\n | CaseSearchModel\n | CaseViewModel\n | ListDetailModel\n | DetailModel\n | FormModel\n | GroupingPanelModel\n | ListModel\n | TabModel\n | TaskGroupModel\n | UserModel\n | UserServicesModel\n | ModelCatalogModel\n | ConceptIndexModel\n | ConceptDetailModel\n | BusinessScenarioModel\n | ConceptTypeDetailModel\n | ContentIndexModel\n | ContentTOCModel\n | ContentModel\n | ContentTypeModel\n | LookupOptionsModel;\n\nexport type AttributeType =\n | BooleanAttributeModel\n | CaptchaAttributeModel\n | ChoiceAttributeModel\n | DatetimeAttributeModel\n | HelptextAttributeModel\n | LabelAttributeModel\n | MemoAttributeModel\n | MoneyAttributeModel\n | NumberAttributeModel\n | PasswordAttributeModel\n | CompositeAttributeModel\n | StringAttributeModel\n | UploadAttributeModel\n | XMLAttributeModel;\n\nexport type RangeChildAttributeType =\n | NumberAttributeModel\n | DatetimeAttributeModel;\n\nexport type FilterType =\n | AssignmentFilterModel\n | FilterModel\n | RangeFilterModel\n | ConceptIndexFilterModel;\n\nexport type FormErrorAnchor = {\n id: string,\n properties?: {\n [propertyName: string]: string | number,\n },\n anchor?: {\n objectid: string,\n elementid?: string,\n _links?: Object,\n index?: number,\n \"index-identifier\"?: string,\n },\n layouthint: LayoutHintCollection,\n message: string,\n param?: {\n name: string,\n },\n};\n\nexport type labelsJSON = {\n _id: string,\n label: string,\n value: string,\n};\n\nexport type propertyJSON = {\n _id: string,\n type: string,\n mandatory: string,\n label: string,\n value: string,\n};\n\nexport type textfragmentJSON = {\n label: string,\n text: string,\n type: string,\n};\n\nexport interface IConstraintModel {\n +id: string;\n +defaultMessage: string;\n +parameters: Object;\n +isMandatoryConstraint: boolean;\n validate(value: any): boolean;\n hasValidation(): boolean;\n}\n\nexport interface ILayoutHintRule {\n process(attribute: AttributeModel, attributes: AttributeCollection): void;\n}\n\nexport interface IModelWithChildModels {\n getInitialChildModelLinks(): Array<LinkModel>;\n setChildModels(\n models: Array<ModularUIModel>,\n errors: Array<ErrorResponse>,\n ): void;\n}\n\nexport type AuthenticationType = {\n name: string,\n authentication: string,\n redirectUri?: string,\n isPrimary: boolean,\n};\n\nexport type FileEntryType = {\n name: string,\n size?: number,\n progress: number,\n error?: string,\n token?: string,\n};\n\nexport type FilesType = {\n [filename: string]: FileEntryType,\n};\n\nexport type FiletypeConstraintsType = Array<{|\n extensions: Array<string>,\n mimeTypes: Array<string>,\n|}>;\n\nexport type FilesizeConstraintsType = {\n fileSize: ?number,\n maxTotalFileSize: ?number,\n isMaxTotal: boolean,\n};\n\nexport type PropertyData = { type: string, label: string, value: string };\nexport type TextFragmentData = {\n type: string,\n label: string,\n text: string | { id?: string, message: string, properties?: Object },\n};\nexport type SectionData = {\n id: string,\n type: string,\n label?: string,\n number?: string,\n body: string | { id?: string, message: string, properties?: Object },\n _links: { self: { href: string } },\n childSections?: Array<SectionData>,\n sections?: Array<SectionData>,\n subSections: Array<SectionData>,\n};\n\nexport type PropertyElement = {\n propertyElement: {\n label: string,\n layouthint: Array<string>,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElement = {\n textFragmentElement: {\n label: string,\n layouthint: Array<string>,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElement = {\n contentElement: {\n label: string,\n layouthint: Array<string>,\n sections: Array<SectionData>,\n },\n};\n\nexport type PropertyElementMapped = {\n propertyElement: {\n label: string,\n layouthint: LayoutHintCollection,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElementMapped = {\n textFragmentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElementMapped = {\n contentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n sections: Array<SectionModel>,\n },\n};\n\nexport type ContentAll = Array<\n PropertyElementMapped | TextFragmentElementMapped | ContentElementMapped,\n>;\n\nexport type ContentData = {\n header: {\n label?: string,\n description?: { id?: string, message: string, properties?: Object },\n },\n label?: string,\n elements: Array<PropertyElement | TextFragmentElement | ContentElement>,\n};\n\nexport type SectionFragment = {\n text: string,\n startOffset: number,\n endOffset: number,\n};\n\nexport type ModelOptions = {\n origin?: ?string,\n contextPath?: ?string,\n};\n"],"mappings":"","ignoreList":[]}
@@ -11,14 +11,15 @@ var _Constants = require("../constants/Constants");
11
11
  var _redux = require("../redux");
12
12
  var _DetailModel = _interopRequireDefault(require("../models/detail/DetailModel"));
13
13
  var _ListModel = _interopRequireDefault(require("../models/list/ListModel"));
14
+ var _CaseSearchModel = _interopRequireDefault(require("../models/search/CaseSearchModel"));
14
15
  var _ListDetailModel = _interopRequireDefault(require("../models/list/ListDetailModel"));
15
16
  var _Href = _interopRequireDefault(require("../models/href/Href"));
16
17
  var _reactRouter = require("react-router");
17
18
  /**
18
19
  */
19
20
  const useList = (href, options) => (0, _useModularUIBasic.useModularUIBasic)("list", href, {
20
- expectedModels: ["List"],
21
- targetModel: _ListModel.default,
21
+ expectedModels: ["List", "CaseSearch"],
22
+ targetModel: [_ListModel.default, _CaseSearchModel.default],
22
23
  ...options
23
24
  });
24
25
 
@@ -26,8 +27,8 @@ const useList = (href, options) => (0, _useModularUIBasic.useModularUIBasic)("li
26
27
  */
27
28
  exports.useList = useList;
28
29
  const useListOrDetail = (href, options) => (0, _useModularUIBasic.useModularUIBasic)("list", href, {
29
- expectedModels: ["List", "Detail"],
30
- targetModel: [_ListModel.default, _DetailModel.default],
30
+ expectedModels: ["List", "CaseSearch", "Detail"],
31
+ targetModel: [_ListModel.default, _CaseSearchModel.default, _DetailModel.default],
31
32
  ...options
32
33
  });
33
34
 
@@ -60,7 +61,7 @@ const useListNavigation = () => {
60
61
  dispatch((0, _redux.loadModularUI)(list.connectKey, listHref, {
61
62
  method: _Constants.HTTP_METHODS.POST,
62
63
  data: list.formdata,
63
- targetModel: _ListModel.default
64
+ targetModel: [_ListModel.default, _CaseSearchModel.default]
64
65
  }));
65
66
  } else {
66
67
  history.push({
@@ -68,7 +69,7 @@ const useListNavigation = () => {
68
69
  });
69
70
  dispatch((0, _redux.loadModularUI)(list.connectKey, listHref, {
70
71
  method: _Constants.HTTP_METHODS.GET,
71
- targetModel: _ListModel.default
72
+ targetModel: [_ListModel.default, _CaseSearchModel.default]
72
73
  }));
73
74
  }
74
75
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useList.js","names":["_useModularUIBasic","require","_reactRedux","_Constants","_redux","_DetailModel","_interopRequireDefault","_ListModel","_ListDetailModel","_Href","_reactRouter","useList","href","options","useModularUIBasic","expectedModels","targetModel","ListModel","exports","useListOrDetail","DetailModel","useListDetail","ListDetailModel","forceTargetModel","useListNavigation","history","useHistory","dispatch","useDispatch","update","list","resetPage","listHref","selfhref","page","requestMethod","HTTP_METHODS","POST","push","search","querystring","state","formdata","loadModularUI","connectKey","method","data","GET"],"sources":["../../src/hooks/useList.js"],"sourcesContent":["// @flow\nimport { useModularUIBasic } from \"./useModularUIBasic\";\nimport { useDispatch } from \"react-redux\";\nimport { HTTP_METHODS } from \"../constants/Constants\";\nimport { loadModularUI } from \"../redux\";\nimport DetailModel from \"../models/detail/DetailModel\";\nimport ListModel from \"../models/list/ListModel\";\nimport ListDetailModel from \"../models/list/ListDetailModel\";\nimport Href from \"../models/href/Href\";\n\nimport type { HookOptions } from \"./useModularUIBasic\";\nimport { useHistory } from \"react-router\";\n\ntype ListNavigationHook = {\n update: (list: ListModel, resetPage?: boolean) => void,\n};\n\n/**\n */\nexport const useList = (\n href: string | Href,\n options?: HookOptions,\n): ListModel | null =>\n useModularUIBasic(\"list\", href, {\n expectedModels: [\"List\"],\n targetModel: ListModel,\n ...options,\n });\n\n/**\n */\nexport const useListOrDetail = (\n href: string | Href,\n options?: HookOptions,\n): ListModel | DetailModel | null =>\n useModularUIBasic(\"list\", href, {\n expectedModels: [\"List\", \"Detail\"],\n targetModel: [ListModel, DetailModel],\n ...options,\n });\n\n/**\n */\nexport const useListDetail = (\n href: string | Href,\n options?: HookOptions,\n): ListDetailModel | null =>\n useModularUIBasic(\"listdetail\", href, {\n expectedModels: [\"ListDetail\"],\n targetModel: ListDetailModel,\n forceTargetModel: true,\n ...options,\n });\n\n/**\n */\nexport const useListNavigation = (): ListNavigationHook => {\n const history = useHistory();\n const dispatch = useDispatch();\n\n const update = (list: ListModel, resetPage: boolean = false) => {\n const listHref = list.selfhref;\n if (resetPage) {\n listHref.page = null;\n }\n\n if (list.requestMethod === HTTP_METHODS.POST) {\n history.push({ search: listHref.querystring, state: list.formdata });\n dispatch(\n loadModularUI(list.connectKey, listHref, {\n method: HTTP_METHODS.POST,\n data: list.formdata,\n targetModel: ListModel,\n }),\n );\n } else {\n history.push({ search: listHref.querystring });\n dispatch(\n loadModularUI(list.connectKey, listHref, {\n method: HTTP_METHODS.GET,\n targetModel: ListModel,\n }),\n );\n }\n };\n\n return {\n update,\n };\n};\n"],"mappings":";;;;;;;AACA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,UAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,gBAAA,GAAAF,sBAAA,C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AE;MACbC,QAAQ,CAACE,IAAI,GAAG,IAAI;IACtB;IAEA,IAAIJ,IAAI,CAACK,aAAa,KAAKC,uBAAY,CAACC,IAAI,EAAE;MAC5CZ,OAAO,CAACa,IAAI,CAAC;QAAEC,MAAM,EAAEP,QAAQ,CAACQ,WAAW;QAAEC,KAAK,EAAEX,IAAI,CAACY;MAAS,CAAC,CAAC;MACpEf,QAAQ,CACN,IAAAgB,oBAAa,EAACb,IAAI,CAACc,UAAU,EAAEZ,QAAQ,EAAE;QACvCa,MAAM,EAAET,uBAAY,CAACC,IAAI;QACzBS,IAAI,EAAEhB,IAAI,CAACY,QAAQ;QACnB1B,WAAW,EAAEC;MACf,CAAC,CACH,CAAC;IACH,CAAC,MAAM;MACLQ,OAAO,CAACa,IAAI,CAAC;QAAEC,MAAM,EAAEP,QAAQ,CAACQ;MAAY,CAAC,CAAC;MAC9Cb,QAAQ,CACN,IAAAgB,oBAAa,EAACb,IAAI,CAACc,UAAU,EAAEZ,QAAQ,EAAE;QACvCa,MAAM,EAAET,uBAAY,CAACW,GAAG;QACxB/B,WAAW,EAAEC;MACf,CAAC,CACH,CAAC;IACH;EACF,CAAC;EAED,OAAO;IACLY;EACF,CAAC;AACH,CAAC;AAACX,OAAA,CAAAM,iBAAA,GAAAA,iBAAA","ignoreList":[]}
1
+ {"version":3,"file":"useList.js","names":["_useModularUIBasic","require","_reactRedux","_Constants","_redux","_DetailModel","_interopRequireDefault","_ListModel","_CaseSearchModel","_ListDetailModel","_Href","_reactRouter","useList","href","options","useModularUIBasic","expectedModels","targetModel","ListModel","CaseSearchModel","exports","useListOrDetail","DetailModel","useListDetail","ListDetailModel","forceTargetModel","useListNavigation","history","useHistory","dispatch","useDispatch","update","list","resetPage","listHref","selfhref","page","requestMethod","HTTP_METHODS","POST","push","search","querystring","state","formdata","loadModularUI","connectKey","method","data","GET"],"sources":["../../src/hooks/useList.js"],"sourcesContent":["// @flow\nimport { useModularUIBasic } from \"./useModularUIBasic\";\nimport { useDispatch } from \"react-redux\";\nimport { HTTP_METHODS } from \"../constants/Constants\";\nimport { loadModularUI } from \"../redux\";\nimport DetailModel from \"../models/detail/DetailModel\";\nimport ListModel from \"../models/list/ListModel\";\nimport CaseSearchModel from \"../models/search/CaseSearchModel\";\nimport ListDetailModel from \"../models/list/ListDetailModel\";\nimport Href from \"../models/href/Href\";\n\nimport type { HookOptions } from \"./useModularUIBasic\";\nimport { useHistory } from \"react-router\";\n\ntype ListNavigationHook = {\n update: (list: ListModel, resetPage?: boolean) => void,\n};\n\n/**\n */\nexport const useList = (\n href: string | Href,\n options?: HookOptions,\n): ListModel | null =>\n useModularUIBasic(\"list\", href, {\n expectedModels: [\"List\", \"CaseSearch\"],\n targetModel: [ListModel, CaseSearchModel],\n ...options,\n });\n\n/**\n */\nexport const useListOrDetail = (\n href: string | Href,\n options?: HookOptions,\n): ListModel | DetailModel | null =>\n useModularUIBasic(\"list\", href, {\n expectedModels: [\"List\", \"CaseSearch\", \"Detail\"],\n targetModel: [ListModel, CaseSearchModel, DetailModel],\n ...options,\n });\n\n/**\n */\nexport const useListDetail = (\n href: string | Href,\n options?: HookOptions,\n): ListDetailModel | null =>\n useModularUIBasic(\"listdetail\", href, {\n expectedModels: [\"ListDetail\"],\n targetModel: ListDetailModel,\n forceTargetModel: true,\n ...options,\n });\n\n/**\n */\nexport const useListNavigation = (): ListNavigationHook => {\n const history = useHistory();\n const dispatch = useDispatch();\n\n const update = (list: ListModel, resetPage: boolean = false) => {\n const listHref = list.selfhref;\n if (resetPage) {\n listHref.page = null;\n }\n\n if (list.requestMethod === HTTP_METHODS.POST) {\n history.push({ search: listHref.querystring, state: list.formdata });\n dispatch(\n loadModularUI(list.connectKey, listHref, {\n method: HTTP_METHODS.POST,\n data: list.formdata,\n targetModel: [ListModel, CaseSearchModel],\n }),\n );\n } else {\n history.push({ search: listHref.querystring });\n dispatch(\n loadModularUI(list.connectKey, listHref, {\n method: HTTP_METHODS.GET,\n targetModel: [ListModel, CaseSearchModel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AC;AAACX,OAAA,CAAAM,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -112,8 +112,9 @@ class ConceptIndexModel extends _ResourceModel.default {
112
112
  */
113
113
  get entryDate() {
114
114
  const timeversionFilter = this.filterCollection.getFilterByAttributeKey(_Constants.TIMEVERSION_FILTER_NAME);
115
- if (timeversionFilter && timeversionFilter.attribute) {
116
- return timeversionFilter.attribute.value;
115
+ const date = timeversionFilter?.value;
116
+ if (typeof date === "string") {
117
+ return date;
117
118
  }
118
119
  return null;
119
120
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ConceptIndexModel.js","names":["_ResourceModel","_interopRequireDefault","require","_ResourceCollection","_FilterCollection","_ConceptLinkModel","_Constants","ConceptIndexModel","ResourceModel","constructor","modularuiResponse","_context","_defineProperty2","default","_filterCollection","FilterCollection","_filter","data","filter","contributions","dynamicschema","modelOptions","_concepts","ResourceCollection","collection","_embedded","_map","results","call","concept","ConceptLinkModel","entryDate","type","resourcetype","modelName","isApplicableModel","resourceType","getInitialChildModelLinks","items","setChildModels","models","errors","selfhref","href","selflink","filterCollection","hasItems","forEach","params","param","value","setParameter","name","removeParameter","label","getContribution","indexfilter","getFilterByAttributeKey","timeversionFilter","TIMEVERSION_FILTER_NAME","attribute","searchtermfilter","modelCategoryFilter","itemCollection","exports"],"sources":["../../../src/models/concepts/ConceptIndexModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport ResourceCollection from \"../base/ResourceCollection\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport ConceptLinkModel from \"./ConceptLinkModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { FilterType, ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type Href from \"../href/Href\";\nimport type ErrorResponse from \"../error/ErrorResponse\";\n\n/**\n * Get Index of concepts, to filter model catalog\n */\nexport default class ConceptIndexModel extends ResourceModel {\n _filterCollection: FilterCollection;\n _concepts: ResourceCollection<ConceptLinkModel>;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._filterCollection = new FilterCollection(\n this.data.filter,\n {\n filter: this.contributions.filter,\n dynamicschema: this.data.dynamicschema,\n },\n this.modelOptions,\n );\n\n this._concepts = new ResourceCollection();\n this._concepts.collection = this.data._embedded\n ? this.data._embedded.results.map(\n (concept) =>\n new ConceptLinkModel(\n concept.concept,\n this.entryDate,\n this.modelOptions,\n ),\n )\n : [];\n }\n\n /**\n */\n get type(): string {\n if (this.resourcetype === \"RelatedConcepts\") {\n return \"RelatedConcepts\";\n }\n\n return \"ConceptIndex\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ConceptIndexModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n const resourceType = data.contributions?.resourcetype;\n return (\n resourceType === \"ConceptSearch\" ||\n resourceType === \"relatedConcepts\" ||\n resourceType === \"RelatedConcepts\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.items.getInitialChildModelLinks();\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {\n this.items.setChildModels(models, errors);\n }\n\n /**\n * Getting the self link of this list\n */\n get selfhref(): Href {\n const { href } = this.selflink;\n\n if (this.filterCollection.hasItems) {\n this.filterCollection.forEach((filter) => {\n filter.params.forEach((param) => {\n if (param.value) {\n href.setParameter(param.name, param.value);\n } else {\n href.removeParameter(param.name);\n }\n });\n });\n }\n\n return href;\n }\n\n /**\n */\n get label(): string {\n return this.getContribution(\"label\");\n }\n\n /**\n * Retrieve filters of conceptindex model\n */\n get filterCollection(): FilterCollection {\n return this._filterCollection;\n }\n\n /**\n * Get index filter\n */\n get indexfilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"index\");\n }\n\n /**\n * Retrieve modelcatalog.js of content toc\n */\n get entryDate(): string | null {\n const timeversionFilter = this.filterCollection.getFilterByAttributeKey(\n TIMEVERSION_FILTER_NAME,\n );\n if (timeversionFilter && timeversionFilter.attribute) {\n return timeversionFilter.attribute.value;\n }\n\n return null;\n }\n\n /**\n * get searchterm filter\n */\n get searchtermfilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"label\");\n }\n\n /**\n * Get model category filter\n */\n get modelCategoryFilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"modelCategory\");\n }\n\n /**\n * Get concept links found by index filter\n */\n get items(): ResourceCollection<ConceptLinkModel> {\n return this._concepts;\n }\n\n /**\n * Replace the items collection\n */\n set items(itemCollection: ResourceCollection<ConceptLinkModel>) {\n this._concepts = itemCollection;\n }\n}\n"],"mappings":";;;;;;;;;;AACA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,iBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,iBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,IAAAI,UAAA,GAAAJ,OAAA;AAQA;AACA;AACA;AACe,MAAMK,iBAAiB,SAASC,sBAAa,CAAC;EAI3D;AACF;EACEC,WAAWA,CAACC,iBAAoC,EAAE;IAAA,IAAAC,QAAA;IAChD,KAAK,CAACD,iBAAiB,CAAC;IAAC,IAAAE,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAEzB,IAAI,CAACC,iBAAiB,GAAG,IAAIC,yBAAgB,KAAAC,OAAA,CAAAH,OAAA,EAC3C,IAAI,CAACI,IAAI,GACT;MACEC,MAAM,MAAAF,OAAA,CAAAH,OAAA,EAAE,IAAI,CAACM,aAAa,CAAO;MACjCC,aAAa,EAAE,IAAI,CAACH,IAAI,CAACG;IAC3B,CAAC,EACD,IAAI,CAACC,YACP,CAAC;IAED,IAAI,CAACC,SAAS,GAAG,IAAIC,2BAAkB,CAAC,C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EACE,IAAIgB,KAAKA,CAACyB,cAAoD,EAAE;IAC9D,IAAI,CAACzC,SAAS,GAAGyC,cAAc;EACjC;AACF;AAACC,OAAA,CAAAnD,OAAA,GAAAN,iBAAA","ignoreList":[]}
1
+ {"version":3,"file":"ConceptIndexModel.js","names":["_ResourceModel","_interopRequireDefault","require","_ResourceCollection","_FilterCollection","_ConceptLinkModel","_Constants","ConceptIndexModel","ResourceModel","constructor","modularuiResponse","_context","_defineProperty2","default","_filterCollection","FilterCollection","_filter","data","filter","contributions","dynamicschema","modelOptions","_concepts","ResourceCollection","collection","_embedded","_map","results","call","concept","ConceptLinkModel","entryDate","type","resourcetype","modelName","isApplicableModel","resourceType","getInitialChildModelLinks","items","setChildModels","models","errors","selfhref","href","selflink","filterCollection","hasItems","forEach","params","param","value","setParameter","name","removeParameter","label","getContribution","indexfilter","getFilterByAttributeKey","timeversionFilter","TIMEVERSION_FILTER_NAME","date","searchtermfilter","modelCategoryFilter","itemCollection","exports"],"sources":["../../../src/models/concepts/ConceptIndexModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport ResourceCollection from \"../base/ResourceCollection\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport ConceptLinkModel from \"./ConceptLinkModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { FilterType, ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type Href from \"../href/Href\";\nimport type ErrorResponse from \"../error/ErrorResponse\";\n\n/**\n * Get Index of concepts, to filter model catalog\n */\nexport default class ConceptIndexModel extends ResourceModel {\n _filterCollection: FilterCollection;\n _concepts: ResourceCollection<ConceptLinkModel>;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._filterCollection = new FilterCollection(\n this.data.filter,\n {\n filter: this.contributions.filter,\n dynamicschema: this.data.dynamicschema,\n },\n this.modelOptions,\n );\n\n this._concepts = new ResourceCollection();\n this._concepts.collection = this.data._embedded\n ? this.data._embedded.results.map(\n (concept) =>\n new ConceptLinkModel(\n concept.concept,\n this.entryDate,\n this.modelOptions,\n ),\n )\n : [];\n }\n\n /**\n */\n get type(): string {\n if (this.resourcetype === \"RelatedConcepts\") {\n return \"RelatedConcepts\";\n }\n\n return \"ConceptIndex\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ConceptIndexModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n const resourceType = data.contributions?.resourcetype;\n return (\n resourceType === \"ConceptSearch\" ||\n resourceType === \"relatedConcepts\" ||\n resourceType === \"RelatedConcepts\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.items.getInitialChildModelLinks();\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {\n this.items.setChildModels(models, errors);\n }\n\n /**\n * Getting the self link of this list\n */\n get selfhref(): Href {\n const { href } = this.selflink;\n\n if (this.filterCollection.hasItems) {\n this.filterCollection.forEach((filter) => {\n filter.params.forEach((param) => {\n if (param.value) {\n href.setParameter(param.name, param.value);\n } else {\n href.removeParameter(param.name);\n }\n });\n });\n }\n\n return href;\n }\n\n /**\n */\n get label(): string {\n return this.getContribution(\"label\");\n }\n\n /**\n * Retrieve filters of conceptindex model\n */\n get filterCollection(): FilterCollection {\n return this._filterCollection;\n }\n\n /**\n * Get index filter\n */\n get indexfilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"index\");\n }\n\n /**\n * Retrieve modelcatalog.js of content toc\n */\n get entryDate(): ISO_DATE | null {\n const timeversionFilter = this.filterCollection.getFilterByAttributeKey(\n TIMEVERSION_FILTER_NAME,\n );\n\n const date = timeversionFilter?.value;\n if (typeof date === \"string\") {\n return date;\n }\n return null;\n }\n\n /**\n * get searchterm filter\n */\n get searchtermfilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"label\");\n }\n\n /**\n * Get model category filter\n */\n get modelCategoryFilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"modelCategory\");\n }\n\n /**\n * Get concept links found by index filter\n */\n get items(): ResourceCollection<ConceptLinkModel> {\n return this._concepts;\n }\n\n /**\n * Replace the items collection\n */\n set items(itemCollection: ResourceCollection<ConceptLinkModel>) {\n this._concepts = itemCollection;\n }\n}\n"],"mappings":";;;;;;;;;;AACA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,iBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,iBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,IAAAI,UAAA,GAAAJ,OAAA;AAQA;AACA;AACA;AACe,MAAMK,iBAAiB,SAASC,sBAAa,CAAC;EAI3D;AACF;EACEC,WAAWA,CAACC,iBAAoC,EAAE;IAAA,IAAAC,QAAA;IAChD,KAAK,CAACD,iBAAiB,CAAC;IAAC,IAAAE,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAEzB,IAAI,CAACC,iBAAiB,GAAG,IAAIC,yBAAgB,KAAAC,OAAA,CAAAH,OAAA,EAC3C,IAAI,CAACI,IAAI,GACT;MACEC,MAAM,MAAAF,OAAA,CAAAH,OAAA,EAAE,IAAI,CAACM,aAAa,CAAO;MACjCC,aAAa,EAAE,IAAI,CAACH,IAAI,CAACG;IAC3B,CAAC,EACD,IAAI,CAACC,YACP,CAAC;IAED,IAAI,CAACC,SAAS,GAAG,IAAIC,2BAAkB,CAAC,CAAC;IACzC,IAAI,CAACD,SAAS,CAACE,UAAU,GAAG,IAAI,CAACP,IAAI,CAACQ,SAAS,GAC3C,IAAAC,IAAA,CAAAb,OAAA,EAAAF,QAAA,OAAI,CAACM,IAAI,CAACQ,SAAS,CAACE,OAAO,EAAAC,IAAA,CAAAjB,QAAA,EACxBk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