@beinformed/ui 1.38.0 → 1.40.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.
- package/CHANGELOG.md +14 -0
- package/esm/models/attributes/AttributeModel.js +1 -2
- package/esm/models/attributes/AttributeModel.js.map +1 -1
- package/esm/models/attributes/input-constraints/FileSizeConstraint.js +0 -1
- package/esm/models/attributes/input-constraints/FileSizeConstraint.js.map +1 -1
- package/esm/models/content/ContentModel.js +1 -0
- package/esm/models/content/ContentModel.js.map +1 -1
- package/esm/models/content/SubSectionModel.js +5 -1
- package/esm/models/content/SubSectionModel.js.map +1 -1
- package/esm/models/href/Href.js +13 -0
- package/esm/models/href/Href.js.map +1 -1
- package/esm/react-client/contextPath.js +0 -2
- package/esm/react-client/contextPath.js.map +1 -1
- package/esm/react-client/rehydrate.js +0 -2
- package/esm/react-client/rehydrate.js.map +1 -1
- package/esm/react-server/contextPath.js +0 -1
- package/esm/react-server/contextPath.js.map +1 -1
- package/lib/models/attributes/AttributeModel.js +1 -2
- package/lib/models/attributes/AttributeModel.js.flow +1 -3
- package/lib/models/attributes/AttributeModel.js.map +1 -1
- package/lib/models/attributes/__tests__/AttributeModel.spec.js.flow +0 -3
- package/lib/models/attributes/input-constraints/FileSizeConstraint.js +0 -1
- package/lib/models/attributes/input-constraints/FileSizeConstraint.js.map +1 -1
- package/lib/models/content/ContentModel.js +1 -0
- package/lib/models/content/ContentModel.js.flow +1 -0
- package/lib/models/content/ContentModel.js.map +1 -1
- package/lib/models/content/SubSectionModel.js +5 -1
- package/lib/models/content/SubSectionModel.js.flow +3 -2
- package/lib/models/content/SubSectionModel.js.map +1 -1
- package/lib/models/content/__tests__/ContentModel.spec.js.flow +3 -0
- package/lib/models/href/Href.js +13 -0
- package/lib/models/href/Href.js.flow +13 -0
- package/lib/models/href/Href.js.map +1 -1
- package/lib/react-client/contextPath.js +0 -1
- package/lib/react-client/contextPath.js.map +1 -1
- package/lib/react-client/rehydrate.js +0 -2
- package/lib/react-client/rehydrate.js.map +1 -1
- package/package.json +17 -17
- package/src/models/attributes/AttributeModel.js +1 -3
- package/src/models/attributes/__tests__/AttributeModel.spec.js +0 -3
- package/src/models/content/ContentModel.js +1 -0
- package/src/models/content/SubSectionModel.js +3 -2
- package/src/models/content/__tests__/ContentModel.spec.js +3 -0
- package/src/models/href/Href.js +13 -0
- package/types/constants/LayoutHintConfig.d.ts +15 -0
- package/types/constants/LayoutHints.d.ts +4 -0
- package/types/models/actions/ActionModel.d.ts +3 -3
- package/types/models/application/ApplicationModel.d.ts +1 -1
- package/types/models/attributes/AttributeCollection.d.ts +1 -1
- package/types/models/attributes/AttributeModel.d.ts +14 -14
- package/types/models/attributes/AttributeSetModel.d.ts +9 -2
- package/types/models/attributes/BooleanAttributeModel.d.ts +1 -1
- package/types/models/attributes/ChoiceAttributeOptionCollection.d.ts +2 -2
- package/types/models/attributes/ChoiceAttributeOptionModel.d.ts +7 -7
- package/types/models/attributes/CompositeAttributeModel.d.ts +1 -1
- package/types/models/attributes/DatetimeAttributeModel.d.ts +1 -1
- package/types/models/attributes/PasswordAttributeModel.d.ts +3 -3
- package/types/models/attributes/StringAttributeModel.d.ts +1 -1
- package/types/models/attributes/UploadAttributeModel.d.ts +3 -3
- package/types/models/attributes/input-constraints/DateBoundaryConstraint.d.ts +1 -1
- package/types/models/attributes/input-constraints/DatetimeFormatConstraint.d.ts +1 -1
- package/types/models/attributes/input-constraints/RangeConstraint.d.ts +1 -1
- package/types/models/attributes/layouthint-rules/DependentAttribute.d.ts +4 -4
- package/types/models/base/BaseCollection.d.ts +1 -1
- package/types/models/base/BaseModel.d.ts +2 -2
- package/types/models/base/ResourceModel.d.ts +2 -2
- package/types/models/caseview/CaseViewModel.d.ts +1 -1
- package/types/models/concepts/BusinessScenarioModel.d.ts +1 -1
- package/types/models/concepts/ConceptDetailModel.d.ts +1 -1
- package/types/models/concepts/ConceptIndexModel.d.ts +1 -1
- package/types/models/concepts/ConceptLinkModel.d.ts +1 -1
- package/types/models/concepts/ConceptRelationModel.d.ts +1 -1
- package/types/models/content/ContentLinkModel.d.ts +3 -3
- package/types/models/content/ContentModel.d.ts +2 -2
- package/types/models/content/ContentTOCModel.d.ts +1 -1
- package/types/models/content/SectionModel.d.ts +1 -1
- package/types/models/detail/DetailModel.d.ts +3 -3
- package/types/models/error/ErrorResponse.d.ts +1 -1
- package/types/models/filters/BaseFilterModel.d.ts +2 -2
- package/types/models/filters/StringFilterModel.d.ts +2 -2
- package/types/models/form/FormModel.d.ts +14 -14
- package/types/models/form/FormObjectModel.d.ts +3 -3
- package/types/models/href/Href.d.ts +13 -6
- package/types/models/href/ListHref.d.ts +4 -4
- package/types/models/links/LinkCollection.d.ts +1 -1
- package/types/models/links/LinkModel.d.ts +4 -4
- package/types/models/list/ListDetailModel.d.ts +2 -2
- package/types/models/list/ListModel.d.ts +3 -3
- package/types/models/paging/PagesizeModel.d.ts +1 -1
- package/types/models/paging/PagingModel.d.ts +1 -1
- package/types/models/panels/GroupingPanelModel.d.ts +1 -1
- package/types/models/sorting/SortOptionModel.d.ts +2 -2
- package/types/models/tab/TabModel.d.ts +1 -1
- package/types/models/taskgroup/TaskGroupModel.d.ts +5 -0
- package/types/models/user/UserServicesModel.d.ts +1 -1
- package/types/modularui/Authenticate.d.ts +1 -1
- package/types/modularui/ModularUIRequest.d.ts +8 -8
- package/types/modularui/ModularUIResponse.d.ts +5 -5
- package/types/utils/datetime/DateTimeUtil.d.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rehydrate.js","names":["has","Locales","resolveModel","ModularUIResponse","recreateModel","data","modelData","rehydrate","Model","_context","model","childModels","_mapInstanceProperty","call","childModel","addChildModels","isModularUIModelData","rehydratedValue","stateKey","stateValue","Array","isArray","stateItem","locales","locale","noFurtherRehydration","_includesInstanceProperty","state","mappedState","_Object$keys","forEach"],"sources":["../../src/react-client/rehydrate.js"],"sourcesContent":["// @flow\nimport { has } from \"../utils/helpers/objects\";\nimport Locales from \"../i18n/Locales\";\n\nimport resolveModel from \"../models/resolveModel\";\n\nimport ModularUIResponse from \"../modularui/ModularUIResponse\";\n\n/**\n * Recreate a model from dehydrated data obtained after a server render.\n */\nconst recreateModel = (data: Object) => {\n const modelData = ModularUIResponse.rehydrate(data);\n\n const Model = resolveModel(modelData);\n\n if (Model) {\n const model = new Model(modelData);\n model.rehydrate(data);\n\n const childModels = data.childModels.map((childModel) =>\n recreateModel(childModel),\n );\n\n model.addChildModels(childModels);\n\n return model;\n }\n\n return data;\n};\n\n/**\n */\nconst isModularUIModelData = (data: any) =>\n data != null &&\n typeof data === \"object\" &&\n has(data, \"data\") &&\n has(data, \"contributions\");\n\n/**\n */\nconst rehydratedValue = (stateKey: string, stateValue: any) => {\n if (Array.isArray(stateValue)) {\n return stateValue.map((stateItem) => rehydrate(stateItem)); // NOSONAR\n }\n\n if (isModularUIModelData(stateValue)) {\n return recreateModel(stateValue);\n }\n\n if (\n stateKey === \"i18n\" &&\n has(stateValue, \"locales\") &&\n has(stateValue, \"locale\")\n ) {\n return {\n locales: Locales.rehydrate(stateValue.locales),\n locale: stateValue?.locale,\n };\n }\n\n const noFurtherRehydration = [\"preferences\", \"router\", \"progressindicator\"];\n if (noFurtherRehydration.includes(stateKey)) {\n return stateValue;\n }\n\n if (stateValue !== null && typeof stateValue === \"object\") {\n return rehydrate(stateValue); // NOSONAR\n }\n\n return stateValue;\n};\n\n/**\n * Maps dehydrated state to models that can be used to rehydrated the application.\n */\nconst rehydrate = (state: Object): { ... } => {\n const mappedState: { [string]: any } = {};\n\n Object.keys(state).forEach((stateKey) => {\n const stateValue = state[stateKey];\n mappedState[stateKey] = rehydratedValue(stateKey, stateValue);\n });\n\n return mappedState;\n};\n\nexport default rehydrate;\n"],"mappings":";;;AACA,SAASA,GAAG,QAAQ,0BAA0B;AAC9C,OAAOC,OAAO,MAAM,iBAAiB;AAErC,OAAOC,YAAY,MAAM,wBAAwB;AAEjD,OAAOC,iBAAiB,MAAM,gCAAgC;;AAE9D;AACA;AACA;AACA,MAAMC,aAAa,GAAIC,IAAY,IAAK;EACtC,MAAMC,SAAS,GAAGH,iBAAiB,CAACI,SAAS,CAACF,IAAI,CAAC;EAEnD,MAAMG,KAAK,GAAGN,YAAY,CAACI,SAAS,CAAC;EAErC,IAAIE,KAAK,EAAE;IAAA,IAAAC,QAAA;IACT,MAAMC,KAAK,GAAG,IAAIF,KAAK,CAACF,SAAS,CAAC;IAClCI,KAAK,CAACH,SAAS,CAACF,IAAI,CAAC;IAErB,MAAMM,WAAW,GAAGC,oBAAA,CAAAH,QAAA,GAAAJ,IAAI,CAACM,WAAW,EAAAE,IAAA,CAAAJ,QAAA,EAAMK,UAAU,IAClDV,aAAa,CAACU,UAAU,CAC1B,CAAC;IAEDJ,KAAK,CAACK,cAAc,CAACJ,WAAW,CAAC;IAEjC,OAAOD,KAAK;EACd;EAEA,OAAOL,IAAI;AACb,CAAC;;AAED;AACA;AACA,MAAMW,oBAAoB,GAAIX,IAAS,IACrCA,IAAI,IAAI,IAAI,IACZ,OAAOA,IAAI,KAAK,QAAQ,IACxBL,GAAG,CAACK,IAAI,EAAE,MAAM,CAAC,IACjBL,GAAG,CAACK,IAAI,EAAE,eAAe,CAAC;;AAE5B;AACA;AACA,MAAMY,eAAe,GAAGA,CAACC,QAAgB,EAAEC,UAAe,KAAK;EAC7D,IAAIC,KAAK,CAACC,OAAO,CAACF,UAAU,CAAC,EAAE;IAC7B,OAAOP,oBAAA,CAAAO,UAAU,EAAAN,IAAA,CAAVM,UAAU,EAAMG,SAAS,IAAKf,SAAS,CAACe,SAAS,CAAC,CAAC,CAAC,CAAC;EAC9D
|
|
1
|
+
{"version":3,"file":"rehydrate.js","names":["has","Locales","resolveModel","ModularUIResponse","recreateModel","data","modelData","rehydrate","Model","_context","model","childModels","_mapInstanceProperty","call","childModel","addChildModels","isModularUIModelData","rehydratedValue","stateKey","stateValue","Array","isArray","stateItem","locales","locale","noFurtherRehydration","_includesInstanceProperty","state","mappedState","_Object$keys","forEach"],"sources":["../../src/react-client/rehydrate.js"],"sourcesContent":["// @flow\nimport { has } from \"../utils/helpers/objects\";\nimport Locales from \"../i18n/Locales\";\n\nimport resolveModel from \"../models/resolveModel\";\n\nimport ModularUIResponse from \"../modularui/ModularUIResponse\";\n\n/**\n * Recreate a model from dehydrated data obtained after a server render.\n */\nconst recreateModel = (data: Object) => {\n const modelData = ModularUIResponse.rehydrate(data);\n\n const Model = resolveModel(modelData);\n\n if (Model) {\n const model = new Model(modelData);\n model.rehydrate(data);\n\n const childModels = data.childModels.map((childModel) =>\n recreateModel(childModel),\n );\n\n model.addChildModels(childModels);\n\n return model;\n }\n\n return data;\n};\n\n/**\n */\nconst isModularUIModelData = (data: any) =>\n data != null &&\n typeof data === \"object\" &&\n has(data, \"data\") &&\n has(data, \"contributions\");\n\n/**\n */\nconst rehydratedValue = (stateKey: string, stateValue: any) => {\n if (Array.isArray(stateValue)) {\n return stateValue.map((stateItem) => rehydrate(stateItem)); // NOSONAR\n }\n\n if (isModularUIModelData(stateValue)) {\n return recreateModel(stateValue);\n }\n\n if (\n stateKey === \"i18n\" &&\n has(stateValue, \"locales\") &&\n has(stateValue, \"locale\")\n ) {\n return {\n locales: Locales.rehydrate(stateValue.locales),\n locale: stateValue?.locale,\n };\n }\n\n const noFurtherRehydration = [\"preferences\", \"router\", \"progressindicator\"];\n if (noFurtherRehydration.includes(stateKey)) {\n return stateValue;\n }\n\n if (stateValue !== null && typeof stateValue === \"object\") {\n return rehydrate(stateValue); // NOSONAR\n }\n\n return stateValue;\n};\n\n/**\n * Maps dehydrated state to models that can be used to rehydrated the application.\n */\nconst rehydrate = (state: Object): { ... } => {\n const mappedState: { [string]: any } = {};\n\n Object.keys(state).forEach((stateKey) => {\n const stateValue = state[stateKey];\n mappedState[stateKey] = rehydratedValue(stateKey, stateValue);\n });\n\n return mappedState;\n};\n\nexport default rehydrate;\n"],"mappings":";;;AACA,SAASA,GAAG,QAAQ,0BAA0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KAAK,MAAM,IACnBlB,GAAG,CAACmB,UAAU,EAAE,SAAS,CAAC,IAC1BnB,GAAG,CAACmB,UAAU,EAAE,QAAQ,CAAC,EACzB;IACA,OAAO;MACLI,OAAO,EAAEtB,OAAO,CAACM,SAAS,CAACY,UAAU,CAACI,OAAO,CAAC;MAC9CC,MAAM,EAAEL,UAAU,EAAEK;IACtB,CAAC;EACH;EAEA,MAAMC,oBAAoB,GAAG,CAAC,aAAa,EAAE,QAAQ,EAAE,mBAAmB,CAAC;EAC3E,IAAIC,yBAAA,CAAAD,oBAAoB,EAAAZ,IAAA,CAApBY,oBAAoB,EAAUP,QAAQ,CAAC,EAAE;IAC3C,OAAOC,UAAU;EACnB;EAEA,IAAIA,UAAU,KAAK,IAAI,IAAI,OAAOA,UAAU,KAAK,QAAQ,EAAE;IACzD,OAAOZ,SAAS,CAACY,UAAU,CAAC,CAAC,CAAC;EAChC;EAEA,OAAOA,UAAU;AACnB,CAAC;;AAED;AACA;AACA;AACA,MAAMZ,SAAS,GAAIoB,KAAa,IAAc;EAC5C,MAAMC,WAA8B,GAAG,CAAC,CAAC;EAEzCC,YAAA,CAAYF,KAAK,CAAC,CAACG,OAAO,CAAEZ,QAAQ,IAAK;IACvC,MAAMC,UAAU,GAAGQ,KAAK,CAACT,QAAQ,CAAC;IAClCU,WAAW,CAACV,QAAQ,CAAC,GAAGD,eAAe,CAACC,QAAQ,EAAEC,UAAU,CAAC;EAC/D,CAAC,CAAC;EAEF,OAAOS,WAAW;AACpB,CAAC;AAED,eAAerB,SAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contextPath.js","names":["getBasePath","x","__webpack_public_path__"],"sources":["../../src/react-server/contextPath.js"],"sourcesContent":["// @flow\nimport { getBasePath } from \"../constants/Settings\";\n\n(function x() {\n __webpack_public_path__ = `${getBasePath()}/`; // NOSONAR\n})();\n\nexport {};\n"],"mappings":"AACA,SAASA,WAAW,QAAQ,uBAAuB;AAEnD,CAAC,SAASC,CAACA,CAAA,EAAG;EACZC,uBAAuB,GAAI,GAAEF,WAAW,CAAC,CAAE,GAAE,CAAC,CAAC;AACjD,CAAC,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"contextPath.js","names":["getBasePath","x","__webpack_public_path__"],"sources":["../../src/react-server/contextPath.js"],"sourcesContent":["// @flow\nimport { getBasePath } from \"../constants/Settings\";\n\n(function x() {\n __webpack_public_path__ = `${getBasePath()}/`; // NOSONAR\n})();\n\nexport {};\n"],"mappings":"AACA,SAASA,WAAW,QAAQ,uBAAuB;AAEnD,CAAC,SAASC,CAACA,CAAA,EAAG;EACZC,uBAAuB,GAAI,GAAEF,WAAW,CAAC,CAAE,GAAE,CAAC,CAAC;AACjD,CAAC,EAAE,CAAC;AAEJ"}
|
|
@@ -70,8 +70,7 @@ class AttributeModel extends _BaseModel.default {
|
|
|
70
70
|
}
|
|
71
71
|
this._referenceDate = this.getData("referenceDate", _DateTimeUtil.DateUtil.now());
|
|
72
72
|
this._isResult = this.getData("isResult", false);
|
|
73
|
-
this._mandatory = this.layouthint.has(_LayoutHints.MANDATORY) || this.contributions.mandatory
|
|
74
|
-
|
|
73
|
+
this._mandatory = this.layouthint.has(_LayoutHints.MANDATORY) || this.contributions.mandatory;
|
|
75
74
|
this._links = new _LinkCollection.default(this.data._links, this.contributions._links);
|
|
76
75
|
}
|
|
77
76
|
|
|
@@ -102,9 +102,7 @@ export default class AttributeModel
|
|
|
102
102
|
this._isResult = this.getData("isResult", false);
|
|
103
103
|
|
|
104
104
|
this._mandatory =
|
|
105
|
-
this.layouthint.has(MANDATORY) ||
|
|
106
|
-
this.contributions.mandatory ||
|
|
107
|
-
this.contributions.nullable === false; // nullable must be explicitly false to make this mandatory
|
|
105
|
+
this.layouthint.has(MANDATORY) || this.contributions.mandatory;
|
|
108
106
|
|
|
109
107
|
this._links = new LinkCollection(
|
|
110
108
|
this.data._links,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttributeModel.js","names":["_DateTimeUtil","require","_objects","_BaseModel","_interopRequireDefault","_ConstraintCollection","_ErrorCollection","_LinkCollection","_StringLengthConstraint","_MandatoryConstraint","_ConceptDetailModel","_LayoutHints","_Constants","_Settings","_exceptions","_AttributeContent","AttributeModel","BaseModel","constructor","attribute","attributeContributions","_defineProperty2","default","ConstraintCollection","getSetting","hasContentFromData","content","label","_label","contributions","_initvalue","data","value","_inputvalue","getInitialInputValue","_value","_disabled","layouthint","has","DISABLED","_errorCollection","ErrorCollection","message","addServerError","id","parameters","_referenceDate","getData","DateUtil","now","_isResult","_mandatory","MANDATORY","mandatory","nullable","_links","LinkCollection","isApplicableModel","isPlainObject","IllegalArgumentException","getInitialChildModelLinks","hasContentConfiguration","conceptLink","setChildModels","models","conceptHref","href","concept","_find","call","model","selfhref","equalsWithParameters","key","parentKey","_parentKey","name","type","_hasContentConfiguration","indicateContentConfiguration","contentConfiguration","hasQuestionConfig","questions","hasConfig","hasEndResultConfig","isConfiguredEndResultAttribute","hasIntermediateResultConfig","isConfiguredIntermediateResultAttribute","getContentConfiguredLabel","configuredLabelProperties","labelConfig","length","types","_context","configuredLabels","_filter","getLabelElementByIds","configuredLabel","_context2","firstConfiguredLabel","_map","configuredLabelProperty","some","_id","defaultAlignment","alignment","alignmentHints","getByLayoutHint","substring","links","downloadLink","getLinksByGroup","first","getLinkByKey","addParameter","TIMEVERSION_FILTER_NAME","referenceDate","isCacheable","_concept","ConceptDetailModel","date","initvalue","getInputValue","inputvalue","toString","validateValue","validate","hasValue","getValue","getFormData","inError","formdata","getEmptyFormData","updateLastModification","formatValue","readonlyvalue","configuredMandatory","_validatedValue","readonly","_readonly","static","isResult","disabled","format","getContribution","formatLabel","minLength","maxLength","operator","assistantMessage","isValid","constraintCollection","constraints","add","_serverConstraints","MandatoryConstraint","StringLengthConstraint","addConstraints","setUseClientsideValidation","enabled","_useClientsideValidation","useClientsideValidation","isOptionalAndEmpty","_isValid","undefined","errorCollection","collection","invalidConstraints","isChangedSince","resetErrors","error","properties","removeServerError","hasServerErrors","serverErrors","hasErrors","hasItems","addMissingError","removeMissingError","addServerConstraint","defaultMessage","addConstraint","formatParameters","params","_keys","forEach","paramKey","paramValue","_endsWith","hasDynamicValidationData","updateValidations","errors","_lastModification","Date","timestamp","reset","UnsupportedOperationException","mergeAttribute","oldAttribute","update","changedAttribute","isEditable","_isEditable","isVisible","_isHidden","isHidden","show","hide","equals","otherAttribute","readonlyWidth","ATTRIBUTE_WIDTH","MEDIUM","layoutHintRules","_layoutHintRules","rules","processLayoutHintRules","attributes","process","hasAllContentInData","AttributeContent","exports"],"sources":["../../../src/models/attributes/AttributeModel.js"],"sourcesContent":["// @flow\nimport { DateUtil } from \"../../utils/datetime/DateTimeUtil\";\nimport { isPlainObject } from \"../../utils/helpers/objects\";\n\nimport BaseModel from \"../base/BaseModel\";\nimport ConstraintCollection from \"./input-constraints/ConstraintCollection\";\nimport ErrorCollection from \"../error/ErrorCollection\";\nimport LinkCollection from \"../links/LinkCollection\";\n\nimport StringLengthConstraint from \"./input-constraints/StringLengthConstraint\";\nimport MandatoryConstraint from \"./input-constraints/MandatoryConstraint\";\n\nimport ConceptDetailModel from \"../concepts/ConceptDetailModel\";\n\nimport { DISABLED, MANDATORY } from \"../../constants/LayoutHints\";\nimport {\n ATTRIBUTE_WIDTH,\n TIMEVERSION_FILTER_NAME,\n} from \"../../constants/Constants\";\n\nimport { getSetting, hasAllContentInData } from \"../../constants/Settings\";\n\nimport {\n IllegalArgumentException,\n UnsupportedOperationException,\n} from \"../../exceptions\";\n\nimport type { MessageParameters } from \"../../i18n/types\";\nimport type {\n AttributeType,\n FormErrorAnchor,\n IModelWithChildModels,\n ModularUIModel,\n} from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type ContentConfiguration from \"../contentconfiguration/ContentConfiguration\";\nimport type ContentConfigurationElements from \"../contentconfiguration/ContentConfigurationElements\";\nimport type LayoutHintRuleCollection from \"./layouthint-rules/LayoutHintRuleCollection\";\nimport type AttributeCollection from \"./AttributeCollection\";\nimport AttributeContent from \"./AttributeContent\";\n\n/**\n * Attribute model, base model for all kind of attributes\n */\nexport default class AttributeModel\n extends BaseModel\n implements IModelWithChildModels\n{\n _label: string;\n _lastModification: number = 0;\n\n _initvalue: any;\n _inputvalue: string;\n _value: any;\n\n _errorCollection: ErrorCollection;\n _serverConstraints: ConstraintCollection = new ConstraintCollection();\n _useClientsideValidation: boolean = getSetting(\"USE_CLIENTSIDE_VALIDATION\");\n _isValid: boolean = true;\n _validatedValue: string | null;\n _isEditable: boolean = false;\n _concept: ConceptDetailModel | null = null;\n _referenceDate: ISO_DATE;\n _isResult: boolean;\n _isHidden: boolean = false;\n _readonly: boolean;\n _disabled: boolean = false;\n _mandatory: boolean;\n _links: LinkCollection;\n _parentKey: ?string;\n _hasContentConfiguration: boolean;\n _layoutHintRules: LayoutHintRuleCollection;\n\n /**\n */\n constructor(attribute: Object, attributeContributions: Object) {\n super(attribute, attributeContributions);\n\n if (this.hasContentFromData && this.content.label) {\n this._label = this.content.label;\n } else {\n this._label = this.contributions.label;\n }\n\n this._initvalue = this.data.value;\n this._inputvalue = this.getInitialInputValue(this.data.value);\n this._value = this.data.value;\n this._disabled = this.layouthint.has(DISABLED);\n\n this._errorCollection = new ErrorCollection(\"attribute\");\n if (attribute && attribute.message) {\n this._errorCollection.addServerError(\n attribute.message.id,\n attribute.message.message,\n attribute.message.parameters,\n attribute.message.layouthint,\n );\n }\n\n this._referenceDate = this.getData(\"referenceDate\", DateUtil.now());\n\n this._isResult = this.getData(\"isResult\", false);\n\n this._mandatory =\n this.layouthint.has(MANDATORY) ||\n this.contributions.mandatory ||\n this.contributions.nullable === false; // nullable must be explicitly false to make this mandatory\n\n this._links = new LinkCollection(\n this.data._links,\n this.contributions._links,\n );\n }\n\n /**\n */\n static isApplicableModel(contributions: Object): boolean {\n if (!isPlainObject(contributions)) {\n throw new IllegalArgumentException(\n \"Given argument for isApplicableModel is not a contributions object\",\n );\n }\n\n return false;\n }\n\n /**\n * Retrieve initial input value\n */\n getInitialInputValue(value: any): any {\n return value;\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n if (\n !this.hasContentFromData &&\n this.hasContentConfiguration &&\n this.conceptLink\n ) {\n return [this.conceptLink];\n }\n return [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>): void {\n const conceptHref = this.conceptLink?.href;\n if (conceptHref) {\n this.concept = models.find((model) =>\n model.selfhref.equalsWithParameters(conceptHref),\n );\n }\n }\n\n /**\n * Getting the attribute key\n */\n get key(): string {\n return this.data.key;\n }\n\n /**\n */\n get parentKey(): string {\n return this._parentKey || \"\";\n }\n\n /**\n */\n set parentKey(parentKey: string) {\n this._parentKey = parentKey;\n }\n\n /**\n * Getting the attribute name\n */\n get name(): string {\n return this.key;\n }\n\n /**\n * Getting the type of the attribute\n */\n get type(): string {\n return this.contributions.type;\n }\n\n /**\n * Getting the label of the attribute\n */\n get label(): string {\n return this._label || \"\";\n }\n\n /**\n * Set the label of this attribute\n */\n set label(label: string) {\n this._label = label;\n }\n\n /**\n */\n set hasContentConfiguration(hasContentConfiguration: boolean) {\n this._hasContentConfiguration = hasContentConfiguration;\n }\n\n /**\n */\n get hasContentConfiguration(): boolean {\n return this._hasContentConfiguration || false;\n }\n\n /**\n */\n indicateContentConfiguration(\n contentConfiguration: ContentConfiguration,\n ): void {\n if (contentConfiguration) {\n const hasQuestionConfig = contentConfiguration.questions?.hasConfig();\n\n const hasEndResultConfig =\n contentConfiguration.isConfiguredEndResultAttribute(this.key);\n const hasIntermediateResultConfig =\n contentConfiguration.isConfiguredIntermediateResultAttribute(this.key);\n\n this.hasContentConfiguration =\n hasQuestionConfig || hasEndResultConfig || hasIntermediateResultConfig;\n }\n }\n\n /**\n * Retrieve the first permitted label to render when a concept and contentConfiguration is available\n * Be aware that permission could be in place for labels from a concept.\n */\n getContentConfiguredLabel(\n contentConfiguration: ?ContentConfigurationElements,\n ): string {\n if (this.hasContentFromData) {\n return this.content.label ?? this.label;\n }\n\n const configuredLabelProperties =\n contentConfiguration && contentConfiguration.labelConfig.length > 0\n ? contentConfiguration.labelConfig[0].types\n : [];\n\n if (this.concept && configuredLabelProperties.length > 0) {\n const configuredLabels = this.concept\n .getLabelElementByIds(configuredLabelProperties)\n .filter(\n (configuredLabel) =>\n configuredLabel.value && configuredLabel.value !== \"\",\n );\n\n if (configuredLabels.length > 0) {\n const [firstConfiguredLabel] = configuredLabelProperties\n .filter((configuredLabelProperty) =>\n configuredLabels.some(\n (configuredLabel) =>\n configuredLabel._id === configuredLabelProperty,\n ),\n )\n .map((configuredLabelProperty) =>\n configuredLabels.find(\n (configuredLabel) =>\n configuredLabel._id === configuredLabelProperty,\n ),\n );\n\n if (firstConfiguredLabel) {\n return firstConfiguredLabel.value;\n }\n }\n }\n\n return this.label;\n }\n\n /**\n */\n get defaultAlignment(): \"left\" | \"center\" | \"right\" {\n return \"left\";\n }\n\n /**\n * Handles layout hint align-left, align-center and align-right\n */\n get alignment(): \"left\" | \"center\" | \"right\" {\n const alignmentHints = this.layouthint.getByLayoutHint(\"align-\");\n\n // return alignment based on layouthint or the default alignment for the attribute\n const alignment = alignmentHints\n ? alignmentHints.substring(\"align-\".length)\n : this.defaultAlignment;\n\n if (\n alignment === \"left\" ||\n alignment === \"center\" ||\n alignment === \"right\"\n ) {\n return alignment;\n }\n\n return this.defaultAlignment;\n }\n\n /**\n * Retrieve links of attribute\n */\n get links(): LinkCollection {\n if (!this._links) {\n this._links = new LinkCollection(\n this.data._links,\n this.contributions._links,\n );\n }\n\n return this._links;\n }\n\n /**\n * Retrieve link of attribute when available\n */\n get downloadLink(): ?LinkModel {\n const downloadLink = this.links.getLinksByGroup(\"download\").first;\n\n if (downloadLink && downloadLink.key === this.key) {\n return downloadLink;\n }\n\n return null;\n }\n\n /**\n * Retrieve concept link of attribute when available\n */\n get conceptLink(): ?LinkModel {\n const conceptLink = this.links.getLinkByKey(\"concept\");\n\n if (conceptLink !== null) {\n conceptLink.href = conceptLink.href.addParameter(\n TIMEVERSION_FILTER_NAME,\n this.referenceDate,\n );\n\n conceptLink.isCacheable = true;\n }\n\n return conceptLink;\n }\n\n /**\n * Get concept information\n */\n get concept(): ConceptDetailModel | null {\n return this._concept ?? null;\n }\n\n /**\n * Set the concept\n */\n set concept(concept: ?ModularUIModel) {\n this._concept = concept instanceof ConceptDetailModel ? concept : null;\n }\n\n /**\n * Retrieve reference date of attribute which can be used as entryDate for content\n * to get information in correct time version\n */\n get referenceDate(): ISO_DATE {\n return this._referenceDate;\n }\n\n /**\n * Set reference date for concepts and content\n */\n set referenceDate(date: ISO_DATE) {\n this._referenceDate = date;\n }\n\n /**\n * Initial value received from the modular ui service\n */\n get initvalue(): any {\n return this._initvalue;\n }\n\n /**\n * Retrieve input value\n */\n getInputValue(): string {\n const inputvalue = this._inputvalue;\n\n return inputvalue ? inputvalue.toString() : \"\";\n }\n\n /**\n * Returns the value as entered by the user. This can differ from the internal iso value that is stored\n */\n get inputvalue(): string {\n return this.getInputValue();\n }\n\n /**\n * Value that is used when retrieving an error collection of this attribute\n * Mostly this is the input value, but sometimes a different value is needed,\n * for example iban and postcode need to validate length without spaces\n */\n get validateValue(): string {\n return this.inputvalue;\n }\n\n /**\n * Sets the input value to the value entered by the user\n */\n set inputvalue(value: string) {\n this._inputvalue = value;\n this.value = value;\n\n this.validate(value);\n }\n\n /**\n */\n hasValue(): boolean {\n return this._value != null && this._value !== \"\";\n }\n\n /**\n * Getting the value of the attribute\n */\n getValue(): any {\n return this.hasValue() ? this._value : null;\n }\n\n /**\n * Getting data ready to be send to the modular ui\n * Returns null when the attribute should not be send to the server\n */\n getFormData(): { [string]: any } | null {\n if (this.inError()) {\n return null;\n }\n\n return {\n [this.name]: this.value,\n };\n }\n\n /**\n */\n get formdata(): { [string]: any } | null {\n return this.getFormData();\n }\n\n /**\n */\n getEmptyFormData(): { [string]: null } {\n return { [this.name]: null };\n }\n\n /**\n * Getting the value of the attribute\n */\n get value(): any {\n return this.getValue();\n }\n\n /**\n * Setting a value in the element\n */\n set value(value: ?string) {\n this.updateLastModification();\n\n this._value = value;\n }\n\n /**\n */\n formatValue(value: string): string {\n return value;\n }\n\n /**\n * Getting the readonly value, iso value converted for human reading\n */\n get readonlyvalue(): string {\n return this.value ? this.value.toString() : \"\";\n }\n\n /**\n * Getting mandatory status of attribute\n */\n get mandatory(): boolean {\n return this._mandatory || false;\n }\n\n /**\n */\n get configuredMandatory(): ?boolean {\n return this.layouthint.has(MANDATORY) || this.contributions.mandatory;\n }\n\n /**\n * Set mandatory status of attribute\n */\n set mandatory(mandatory: boolean) {\n if (mandatory !== this._mandatory) {\n this._validatedValue = null;\n }\n this._mandatory = mandatory;\n }\n\n /**\n */\n get readonly(): boolean {\n return (\n this._readonly ||\n this.contributions.readonly === true ||\n this.data.static === true ||\n this.isResult === true\n );\n }\n\n /**\n */\n set readonly(readonly: boolean) {\n this._readonly = readonly;\n }\n\n /**\n */\n get disabled(): boolean {\n return this._disabled;\n }\n\n /**\n */\n set disabled(disabled: boolean) {\n this._disabled = disabled;\n }\n\n /**\n */\n get isResult(): boolean {\n return this._isResult;\n }\n\n /**\n */\n set isResult(isResult: boolean) {\n this._isResult = isResult;\n }\n\n /**\n * Getting the display and input format of a attribute\n */\n get format(): string | null {\n return this.getContribution(\"format\");\n }\n\n /**\n */\n get formatLabel(): string {\n return this.format || \"\";\n }\n\n /**\n * Get minimum string length\n */\n get minLength(): number | null {\n return this.getContribution(\"minLength\");\n }\n\n /**\n * Get maximum string length\n */\n get maxLength(): number | null {\n return this.getContribution(\"maxLength\");\n }\n\n /**\n */\n get operator(): string {\n return this.getContribution(\"operator\", \"\");\n }\n\n /**\n * Get assistant message\n */\n get assistantMessage(): string | null {\n return this.getContribution(\"assistant\");\n }\n\n /**\n * Get valid status\n */\n get isValid(): boolean {\n return this.validate(this.validateValue);\n }\n\n /**\n * Retrieve applicable constraint for this attribute\n */\n get constraintCollection(): ConstraintCollection {\n const constraints = new ConstraintCollection();\n\n constraints.add(this._serverConstraints);\n\n // Mandatory constraint\n if (this.mandatory) {\n constraints.add(new MandatoryConstraint());\n }\n\n if (this.minLength || this.maxLength) {\n constraints.add(\n new StringLengthConstraint(this.minLength, this.maxLength),\n );\n }\n\n constraints.add(this.addConstraints());\n\n return constraints;\n }\n\n /**\n * Template method for class extending this model to add extra constraints\n * @abstract\n */\n addConstraints(): ConstraintCollection {\n return new ConstraintCollection();\n }\n\n /**\n * Used to programmatically overwrite the setting USE_CLIENTSIDE_VALIDATION\n */\n setUseClientsideValidation(enabled: boolean): void {\n this._useClientsideValidation = enabled;\n }\n\n /**\n * Indicates if client side validation is enabled\n * @returns {boolean}\n */\n useClientsideValidation(): boolean {\n return this._useClientsideValidation ?? true;\n }\n\n /**\n * Validate input on client side constraint\n */\n validate(value: string): boolean {\n // when client side validation is disabled, this attribute is always valid\n if (!this.useClientsideValidation()) {\n return true;\n }\n\n if (this.isOptionalAndEmpty(value)) {\n this._isValid = true;\n } else if (this._validatedValue !== value) {\n this._isValid = this.constraintCollection.validate(value);\n }\n this._validatedValue = value;\n\n return this._isValid;\n }\n\n /**\n * Indicates if attribute is optional and empty\n */\n isOptionalAndEmpty(value: string): boolean {\n if (value === undefined) {\n throw new IllegalArgumentException(\n \"isOptionalAndEmpty method needs value argument\",\n );\n }\n\n return !this.mandatory && value === \"\";\n }\n\n /**\n * Retrieve error messages of this attribute\n */\n get errorCollection(): ErrorCollection {\n const collection = new ErrorCollection(\"attribute\", this._errorCollection);\n\n collection.addConstraints(\n this.constraintCollection.invalidConstraints(this.validateValue),\n );\n\n return collection;\n }\n\n /**\n * Check if attribute is in error\n */\n inError(): boolean {\n return !this._isValid && this.isChangedSince(0);\n }\n\n /**\n * Reset static error messages on attribute\n */\n resetErrors(): void {\n this._errorCollection = new ErrorCollection(\"attribute\");\n }\n\n /**\n * Registers an error that was received from a server response\n */\n addServerError(error: FormErrorAnchor): void {\n this._errorCollection.addServerError(\n error.id,\n error.message,\n error.properties,\n error.layouthint,\n );\n }\n\n /**\n */\n removeServerError(id: string): void {\n this._errorCollection.removeServerError(id);\n }\n\n /**\n */\n hasServerErrors(): boolean {\n return this.errorCollection.serverErrors.length > 0;\n }\n\n /**\n */\n hasErrors(): boolean {\n return this.errorCollection.hasItems;\n }\n\n /**\n * Registers a missing error that was received from the server\n */\n addMissingError(): void {\n this._errorCollection.addServerError(\"Constraint.Missing\");\n }\n\n /**\n */\n removeMissingError(): void {\n this.removeServerError(\"Constraint.Missing\");\n }\n\n /**\n */\n addServerConstraint(\n id: string,\n defaultMessage?: string,\n parameters?: MessageParameters,\n ) {\n this._serverConstraints.addConstraint(\n id,\n null,\n defaultMessage,\n parameters,\n this.useClientsideValidation(),\n );\n }\n\n /**\n */\n formatParameters(parameters: Object): { [string]: string | number } {\n if (parameters == null) {\n return {};\n }\n\n const params: { [name: string]: string | number } = {};\n\n Object.keys(parameters).forEach((paramKey: string) => {\n const paramValue = parameters[paramKey];\n if (paramKey.endsWith(\"-number\") || paramKey.endsWith(\"-date\")) {\n params[paramKey] = this.formatValue(paramValue);\n } else {\n params[paramKey] = paramValue;\n }\n });\n\n return params;\n }\n\n /**\n */\n get hasDynamicValidationData(): boolean {\n return true;\n }\n\n /**\n */\n updateValidations(errors: Array<Object>): void {\n if (\n errors.some((error) => error.id === \"Constraint.Mandatory\") ||\n this.layouthint.has(MANDATORY)\n ) {\n this.mandatory = true;\n } else if (!this.hasValue()) {\n this.mandatory = false;\n }\n\n this._serverConstraints = new ConstraintCollection();\n this.resetErrors();\n\n errors\n .filter(\n (error) => error.id !== \"Constraint.Mandatory\" || !this.hasValue(),\n )\n .forEach((error) => {\n if (this.hasValue()) {\n this._errorCollection.addServerError(\n error.id,\n error.message,\n this.formatParameters(error.properties),\n error.layouthint,\n );\n } else {\n this.addServerConstraint(\n error.id,\n error.message,\n this.formatParameters(error.properties),\n );\n }\n });\n }\n\n /**\n * Set last modification to current timestamp\n */\n updateLastModification(): void {\n this._lastModification = Date.now();\n }\n\n /**\n * Inidicates if attribute is changed since a given timestamp (Date.now)\n */\n isChangedSince(timestamp: number): boolean {\n return this._lastModification > timestamp;\n }\n\n /**\n * Abstract reset method which should be implemented on each attribute that has this attribute as a base class.\n *\n * @abstract\n */\n reset(): void {\n throw new UnsupportedOperationException(\n `Reset method not implemented for ${this.type}`,\n );\n }\n\n /**\n * Merge old attribute with the attribute from the server.\n * Readonly attributes always need to show the value from the server\n */\n mergeAttribute(oldAttribute: AttributeType): void {\n this.concept = oldAttribute.concept;\n\n if (\n !oldAttribute.readonly &&\n oldAttribute.isValid &&\n oldAttribute.inputvalue !== null\n ) {\n this.update(oldAttribute.inputvalue);\n }\n }\n\n /**\n * Abstract update method which should be implemented on each attribute that has this attribute as a base class.\n * @abstract\n */\n // eslint-disable-next-line no-unused-vars\n update(value: string, changedAttribute?: AttributeType): AttributeType {\n throw new UnsupportedOperationException(\n `Update method not implemented for ${this.type}`,\n );\n }\n\n /**\n * Indicate if attribute is editable\n */\n set isEditable(isEditable: boolean) {\n this._isEditable = isEditable;\n }\n\n /**\n * Retrieve if attribute is editable\n */\n get isEditable(): boolean {\n return this._isEditable;\n }\n\n /**\n * Indicates if the attribute is visible\n */\n get isVisible(): boolean {\n return !this._isHidden;\n }\n\n /**\n */\n get isHidden(): boolean {\n return this._isHidden;\n }\n\n /**\n */\n set isHidden(isHidden: boolean) {\n this._isHidden = isHidden;\n }\n\n /**\n * Explicitly toggle visibility of this attribute\n */\n show(): void {\n this.isHidden = false;\n }\n\n /**\n */\n hide(): void {\n this.isHidden = true;\n }\n\n /**\n */\n equals(otherAttribute: AttributeType): boolean {\n return (\n this.key === otherAttribute.key &&\n this.parentKey === otherAttribute.parentKey\n );\n }\n\n /**\n * Readonly attribute width indicates the proposed width of this attribute\n */\n get readonlyWidth(): $Keys<typeof ATTRIBUTE_WIDTH> {\n return ATTRIBUTE_WIDTH.MEDIUM;\n }\n\n /**\n */\n get layoutHintRules(): LayoutHintRuleCollection {\n return this._layoutHintRules;\n }\n\n /**\n */\n set layoutHintRules(rules: LayoutHintRuleCollection) {\n this._layoutHintRules = rules;\n }\n\n /**\n */\n processLayoutHintRules(attributes: AttributeCollection): void {\n if (this._layoutHintRules) {\n this.layoutHintRules.process(this, attributes);\n }\n }\n\n /**\n * Indicates if content comes from the data service\n */\n get hasContentFromData(): boolean {\n return hasAllContentInData();\n }\n\n /**\n */\n get content(): AttributeContent {\n return new AttributeContent(this.data.content);\n }\n}\n"],"mappings":";;;;;;;;;;;;;AACA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,qBAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,gBAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,eAAA,GAAAH,sBAAA,CAAAH,OAAA;AAEA,IAAAO,uBAAA,GAAAJ,sBAAA,CAAAH,OAAA;AACA,IAAAQ,oBAAA,GAAAL,sBAAA,CAAAH,OAAA;AAEA,IAAAS,mBAAA,GAAAN,sBAAA,CAAAH,OAAA;AAEA,IAAAU,YAAA,GAAAV,OAAA;AACA,IAAAW,UAAA,GAAAX,OAAA;AAKA,IAAAY,SAAA,GAAAZ,OAAA;AAEA,IAAAa,WAAA,GAAAb,OAAA;AAiBA,IAAAc,iBAAA,GAAAX,sBAAA,CAAAH,OAAA;AAEA;AACA;AACA;AACe,MAAMe,cAAc,SACzBC,kBAAS,CAEnB;EA0BE;AACF;EACEC,WAAWA,CAACC,SAAiB,EAAEC,sBAA8B,EAAE;IAC7D,KAAK,CAACD,SAAS,EAAEC,sBAAsB,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA,6BA3Bf,CAAC;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD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GAAG,IAC/B,IAAI,CAACC,SAAS,KAAKuI,cAAc,CAACvI,SAAS;EAE/C;;EAEA;AACF;AACA;EACE,IAAIwI,aAAaA,CAAA,EAAkC;IACjD,OAAOC,0BAAe,CAACC,MAAM;EAC/B;;EAEA;AACF;EACE,IAAIC,eAAeA,CAAA,EAA6B;IAC9C,OAAO,IAAI,CAACC,gBAAgB;EAC9B;;EAEA;AACF;EACE,IAAID,eAAeA,CAACE,KAA+B,EAAE;IACnD,IAAI,CAACD,gBAAgB,GAAGC,KAAK;EAC/B;;EAEA;AACF;EACEC,sBAAsBA,CAACC,UAA+B,EAAQ;IAC5D,IAAI,IAAI,CAACH,gBAAgB,EAAE;MACzB,IAAI,CAACD,eAAe,CAACK,OAAO,CAAC,IAAI,EAAED,UAAU,CAAC;IAChD;EACF;;EAEA;AACF;AACA;EACE,IAAIhM,kBAAkBA,CAAA,EAAY;IAChC,OAAO,IAAAkM,6BAAmB,EAAC,CAAC;EAC9B;;EAEA;AACF;EACE,IAAIjM,OAAOA,CAAA,EAAqB;IAC9B,OAAO,IAAIkM,yBAAgB,CAAC,IAAI,CAAC7L,IAAI,CAACL,OAAO,CAAC;EAChD;AACF;AAACmM,OAAA,CAAAvM,OAAA,GAAAN,cAAA"}
|
|
1
|
+
{"version":3,"file":"AttributeModel.js","names":["_DateTimeUtil","require","_objects","_BaseModel","_interopRequireDefault","_ConstraintCollection","_ErrorCollection","_LinkCollection","_StringLengthConstraint","_MandatoryConstraint","_ConceptDetailModel","_LayoutHints","_Constants","_Settings","_exceptions","_AttributeContent","AttributeModel","BaseModel","constructor","attribute","attributeContributions","_defineProperty2","default","ConstraintCollection","getSetting","hasContentFromData","content","label","_label","contributions","_initvalue","data","value","_inputvalue","getInitialInputValue","_value","_disabled","layouthint","has","DISABLED","_errorCollection","ErrorCollection","message","addServerError","id","parameters","_referenceDate","getData","DateUtil","now","_isResult","_mandatory","MANDATORY","mandatory","_links","LinkCollection","isApplicableModel","isPlainObject","IllegalArgumentException","getInitialChildModelLinks","hasContentConfiguration","conceptLink","setChildModels","models","conceptHref","href","concept","_find","call","model","selfhref","equalsWithParameters","key","parentKey","_parentKey","name","type","_hasContentConfiguration","indicateContentConfiguration","contentConfiguration","hasQuestionConfig","questions","hasConfig","hasEndResultConfig","isConfiguredEndResultAttribute","hasIntermediateResultConfig","isConfiguredIntermediateResultAttribute","getContentConfiguredLabel","configuredLabelProperties","labelConfig","length","types","_context","configuredLabels","_filter","getLabelElementByIds","configuredLabel","_context2","firstConfiguredLabel","_map","configuredLabelProperty","some","_id","defaultAlignment","alignment","alignmentHints","getByLayoutHint","substring","links","downloadLink","getLinksByGroup","first","getLinkByKey","addParameter","TIMEVERSION_FILTER_NAME","referenceDate","isCacheable","_concept","ConceptDetailModel","date","initvalue","getInputValue","inputvalue","toString","validateValue","validate","hasValue","getValue","getFormData","inError","formdata","getEmptyFormData","updateLastModification","formatValue","readonlyvalue","configuredMandatory","_validatedValue","readonly","_readonly","static","isResult","disabled","format","getContribution","formatLabel","minLength","maxLength","operator","assistantMessage","isValid","constraintCollection","constraints","add","_serverConstraints","MandatoryConstraint","StringLengthConstraint","addConstraints","setUseClientsideValidation","enabled","_useClientsideValidation","useClientsideValidation","isOptionalAndEmpty","_isValid","undefined","errorCollection","collection","invalidConstraints","isChangedSince","resetErrors","error","properties","removeServerError","hasServerErrors","serverErrors","hasErrors","hasItems","addMissingError","removeMissingError","addServerConstraint","defaultMessage","addConstraint","formatParameters","params","_keys","forEach","paramKey","paramValue","_endsWith","hasDynamicValidationData","updateValidations","errors","_lastModification","Date","timestamp","reset","UnsupportedOperationException","mergeAttribute","oldAttribute","update","changedAttribute","isEditable","_isEditable","isVisible","_isHidden","isHidden","show","hide","equals","otherAttribute","readonlyWidth","ATTRIBUTE_WIDTH","MEDIUM","layoutHintRules","_layoutHintRules","rules","processLayoutHintRules","attributes","process","hasAllContentInData","AttributeContent","exports"],"sources":["../../../src/models/attributes/AttributeModel.js"],"sourcesContent":["// @flow\nimport { DateUtil } from \"../../utils/datetime/DateTimeUtil\";\nimport { isPlainObject } from \"../../utils/helpers/objects\";\n\nimport BaseModel from \"../base/BaseModel\";\nimport ConstraintCollection from \"./input-constraints/ConstraintCollection\";\nimport ErrorCollection from \"../error/ErrorCollection\";\nimport LinkCollection from \"../links/LinkCollection\";\n\nimport StringLengthConstraint from \"./input-constraints/StringLengthConstraint\";\nimport MandatoryConstraint from \"./input-constraints/MandatoryConstraint\";\n\nimport ConceptDetailModel from \"../concepts/ConceptDetailModel\";\n\nimport { DISABLED, MANDATORY } from \"../../constants/LayoutHints\";\nimport {\n ATTRIBUTE_WIDTH,\n TIMEVERSION_FILTER_NAME,\n} from \"../../constants/Constants\";\n\nimport { getSetting, hasAllContentInData } from \"../../constants/Settings\";\n\nimport {\n IllegalArgumentException,\n UnsupportedOperationException,\n} from \"../../exceptions\";\n\nimport type { MessageParameters } from \"../../i18n/types\";\nimport type {\n AttributeType,\n FormErrorAnchor,\n IModelWithChildModels,\n ModularUIModel,\n} from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type ContentConfiguration from \"../contentconfiguration/ContentConfiguration\";\nimport type ContentConfigurationElements from \"../contentconfiguration/ContentConfigurationElements\";\nimport type LayoutHintRuleCollection from \"./layouthint-rules/LayoutHintRuleCollection\";\nimport type AttributeCollection from \"./AttributeCollection\";\nimport AttributeContent from \"./AttributeContent\";\n\n/**\n * Attribute model, base model for all kind of attributes\n */\nexport default class AttributeModel\n extends BaseModel\n implements IModelWithChildModels\n{\n _label: string;\n _lastModification: number = 0;\n\n _initvalue: any;\n _inputvalue: string;\n _value: any;\n\n _errorCollection: ErrorCollection;\n _serverConstraints: ConstraintCollection = new ConstraintCollection();\n _useClientsideValidation: boolean = getSetting(\"USE_CLIENTSIDE_VALIDATION\");\n _isValid: boolean = true;\n _validatedValue: string | null;\n _isEditable: boolean = false;\n _concept: ConceptDetailModel | null = null;\n _referenceDate: ISO_DATE;\n _isResult: boolean;\n _isHidden: boolean = false;\n _readonly: boolean;\n _disabled: boolean = false;\n _mandatory: boolean;\n _links: LinkCollection;\n _parentKey: ?string;\n _hasContentConfiguration: boolean;\n _layoutHintRules: LayoutHintRuleCollection;\n\n /**\n */\n constructor(attribute: Object, attributeContributions: Object) {\n super(attribute, attributeContributions);\n\n if (this.hasContentFromData && this.content.label) {\n this._label = this.content.label;\n } else {\n this._label = this.contributions.label;\n }\n\n this._initvalue = this.data.value;\n this._inputvalue = this.getInitialInputValue(this.data.value);\n this._value = this.data.value;\n this._disabled = this.layouthint.has(DISABLED);\n\n this._errorCollection = new ErrorCollection(\"attribute\");\n if (attribute && attribute.message) {\n this._errorCollection.addServerError(\n attribute.message.id,\n attribute.message.message,\n attribute.message.parameters,\n attribute.message.layouthint,\n );\n }\n\n this._referenceDate = this.getData(\"referenceDate\", DateUtil.now());\n\n this._isResult = this.getData(\"isResult\", false);\n\n this._mandatory =\n this.layouthint.has(MANDATORY) || this.contributions.mandatory;\n\n this._links = new LinkCollection(\n this.data._links,\n this.contributions._links,\n );\n }\n\n /**\n */\n static isApplicableModel(contributions: Object): boolean {\n if (!isPlainObject(contributions)) {\n throw new IllegalArgumentException(\n \"Given argument for isApplicableModel is not a contributions object\",\n );\n }\n\n return false;\n }\n\n /**\n * Retrieve initial input value\n */\n getInitialInputValue(value: any): any {\n return value;\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n if (\n !this.hasContentFromData &&\n this.hasContentConfiguration &&\n this.conceptLink\n ) {\n return [this.conceptLink];\n }\n return [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>): void {\n const conceptHref = this.conceptLink?.href;\n if (conceptHref) {\n this.concept = models.find((model) =>\n model.selfhref.equalsWithParameters(conceptHref),\n );\n }\n }\n\n /**\n * Getting the attribute key\n */\n get key(): string {\n return this.data.key;\n }\n\n /**\n */\n get parentKey(): string {\n return this._parentKey || \"\";\n }\n\n /**\n */\n set parentKey(parentKey: string) {\n this._parentKey = parentKey;\n }\n\n /**\n * Getting the attribute name\n */\n get name(): string {\n return this.key;\n }\n\n /**\n * Getting the type of the attribute\n */\n get type(): string {\n return this.contributions.type;\n }\n\n /**\n * Getting the label of the attribute\n */\n get label(): string {\n return this._label || \"\";\n }\n\n /**\n * Set the label of this attribute\n */\n set label(label: string) {\n this._label = label;\n }\n\n /**\n */\n set hasContentConfiguration(hasContentConfiguration: boolean) {\n this._hasContentConfiguration = hasContentConfiguration;\n }\n\n /**\n */\n get hasContentConfiguration(): boolean {\n return this._hasContentConfiguration || false;\n }\n\n /**\n */\n indicateContentConfiguration(\n contentConfiguration: ContentConfiguration,\n ): void {\n if (contentConfiguration) {\n const hasQuestionConfig = contentConfiguration.questions?.hasConfig();\n\n const hasEndResultConfig =\n contentConfiguration.isConfiguredEndResultAttribute(this.key);\n const hasIntermediateResultConfig =\n contentConfiguration.isConfiguredIntermediateResultAttribute(this.key);\n\n this.hasContentConfiguration =\n hasQuestionConfig || hasEndResultConfig || hasIntermediateResultConfig;\n }\n }\n\n /**\n * Retrieve the first permitted label to render when a concept and contentConfiguration is available\n * Be aware that permission could be in place for labels from a concept.\n */\n getContentConfiguredLabel(\n contentConfiguration: ?ContentConfigurationElements,\n ): string {\n if (this.hasContentFromData) {\n return this.content.label ?? this.label;\n }\n\n const configuredLabelProperties =\n contentConfiguration && contentConfiguration.labelConfig.length > 0\n ? contentConfiguration.labelConfig[0].types\n : [];\n\n if (this.concept && configuredLabelProperties.length > 0) {\n const configuredLabels = this.concept\n .getLabelElementByIds(configuredLabelProperties)\n .filter(\n (configuredLabel) =>\n configuredLabel.value && configuredLabel.value !== \"\",\n );\n\n if (configuredLabels.length > 0) {\n const [firstConfiguredLabel] = configuredLabelProperties\n .filter((configuredLabelProperty) =>\n configuredLabels.some(\n (configuredLabel) =>\n configuredLabel._id === configuredLabelProperty,\n ),\n )\n .map((configuredLabelProperty) =>\n configuredLabels.find(\n (configuredLabel) =>\n configuredLabel._id === configuredLabelProperty,\n ),\n );\n\n if (firstConfiguredLabel) {\n return firstConfiguredLabel.value;\n }\n }\n }\n\n return this.label;\n }\n\n /**\n */\n get defaultAlignment(): \"left\" | \"center\" | \"right\" {\n return \"left\";\n }\n\n /**\n * Handles layout hint align-left, align-center and align-right\n */\n get alignment(): \"left\" | \"center\" | \"right\" {\n const alignmentHints = this.layouthint.getByLayoutHint(\"align-\");\n\n // return alignment based on layouthint or the default alignment for the attribute\n const alignment = alignmentHints\n ? alignmentHints.substring(\"align-\".length)\n : this.defaultAlignment;\n\n if (\n alignment === \"left\" ||\n alignment === \"center\" ||\n alignment === \"right\"\n ) {\n return alignment;\n }\n\n return this.defaultAlignment;\n }\n\n /**\n * Retrieve links of attribute\n */\n get links(): LinkCollection {\n if (!this._links) {\n this._links = new LinkCollection(\n this.data._links,\n this.contributions._links,\n );\n }\n\n return this._links;\n }\n\n /**\n * Retrieve link of attribute when available\n */\n get downloadLink(): ?LinkModel {\n const downloadLink = this.links.getLinksByGroup(\"download\").first;\n\n if (downloadLink && downloadLink.key === this.key) {\n return downloadLink;\n }\n\n return null;\n }\n\n /**\n * Retrieve concept link of attribute when available\n */\n get conceptLink(): ?LinkModel {\n const conceptLink = this.links.getLinkByKey(\"concept\");\n\n if (conceptLink !== null) {\n conceptLink.href = conceptLink.href.addParameter(\n TIMEVERSION_FILTER_NAME,\n this.referenceDate,\n );\n\n conceptLink.isCacheable = true;\n }\n\n return conceptLink;\n }\n\n /**\n * Get concept information\n */\n get concept(): ConceptDetailModel | null {\n return this._concept ?? null;\n }\n\n /**\n * Set the concept\n */\n set concept(concept: ?ModularUIModel) {\n this._concept = concept instanceof ConceptDetailModel ? concept : null;\n }\n\n /**\n * Retrieve reference date of attribute which can be used as entryDate for content\n * to get information in correct time version\n */\n get referenceDate(): ISO_DATE {\n return this._referenceDate;\n }\n\n /**\n * Set reference date for concepts and content\n */\n set referenceDate(date: ISO_DATE) {\n this._referenceDate = date;\n }\n\n /**\n * Initial value received from the modular ui service\n */\n get initvalue(): any {\n return this._initvalue;\n }\n\n /**\n * Retrieve input value\n */\n getInputValue(): string {\n const inputvalue = this._inputvalue;\n\n return inputvalue ? inputvalue.toString() : \"\";\n }\n\n /**\n * Returns the value as entered by the user. This can differ from the internal iso value that is stored\n */\n get inputvalue(): string {\n return this.getInputValue();\n }\n\n /**\n * Value that is used when retrieving an error collection of this attribute\n * Mostly this is the input value, but sometimes a different value is needed,\n * for example iban and postcode need to validate length without spaces\n */\n get validateValue(): string {\n return this.inputvalue;\n }\n\n /**\n * Sets the input value to the value entered by the user\n */\n set inputvalue(value: string) {\n this._inputvalue = value;\n this.value = value;\n\n this.validate(value);\n }\n\n /**\n */\n hasValue(): boolean {\n return this._value != null && this._value !== \"\";\n }\n\n /**\n * Getting the value of the attribute\n */\n getValue(): any {\n return this.hasValue() ? this._value : null;\n }\n\n /**\n * Getting data ready to be send to the modular ui\n * Returns null when the attribute should not be send to the server\n */\n getFormData(): { [string]: any } | null {\n if (this.inError()) {\n return null;\n }\n\n return {\n [this.name]: this.value,\n };\n }\n\n /**\n */\n get formdata(): { [string]: any } | null {\n return this.getFormData();\n }\n\n /**\n */\n getEmptyFormData(): { [string]: null } {\n return { [this.name]: null };\n }\n\n /**\n * Getting the value of the attribute\n */\n get value(): any {\n return this.getValue();\n }\n\n /**\n * Setting a value in the element\n */\n set value(value: ?string) {\n this.updateLastModification();\n\n this._value = value;\n }\n\n /**\n */\n formatValue(value: string): string {\n return value;\n }\n\n /**\n * Getting the readonly value, iso value converted for human reading\n */\n get readonlyvalue(): string {\n return this.value ? this.value.toString() : \"\";\n }\n\n /**\n * Getting mandatory status of attribute\n */\n get mandatory(): boolean {\n return this._mandatory || false;\n }\n\n /**\n */\n get configuredMandatory(): ?boolean {\n return this.layouthint.has(MANDATORY) || this.contributions.mandatory;\n }\n\n /**\n * Set mandatory status of attribute\n */\n set mandatory(mandatory: boolean) {\n if (mandatory !== this._mandatory) {\n this._validatedValue = null;\n }\n this._mandatory = mandatory;\n }\n\n /**\n */\n get readonly(): boolean {\n return (\n this._readonly ||\n this.contributions.readonly === true ||\n this.data.static === true ||\n this.isResult === true\n );\n }\n\n /**\n */\n set readonly(readonly: boolean) {\n this._readonly = readonly;\n }\n\n /**\n */\n get disabled(): boolean {\n return this._disabled;\n }\n\n /**\n */\n set disabled(disabled: boolean) {\n this._disabled = disabled;\n }\n\n /**\n */\n get isResult(): boolean {\n return this._isResult;\n }\n\n /**\n */\n set isResult(isResult: boolean) {\n this._isResult = isResult;\n }\n\n /**\n * Getting the display and input format of a attribute\n */\n get format(): string | null {\n return this.getContribution(\"format\");\n }\n\n /**\n */\n get formatLabel(): string {\n return this.format || \"\";\n }\n\n /**\n * Get minimum string length\n */\n get minLength(): number | null {\n return this.getContribution(\"minLength\");\n }\n\n /**\n * Get maximum string length\n */\n get maxLength(): number | null {\n return this.getContribution(\"maxLength\");\n }\n\n /**\n */\n get operator(): string {\n return this.getContribution(\"operator\", \"\");\n }\n\n /**\n * Get assistant message\n */\n get assistantMessage(): string | null {\n return this.getContribution(\"assistant\");\n }\n\n /**\n * Get valid status\n */\n get isValid(): boolean {\n return this.validate(this.validateValue);\n }\n\n /**\n * Retrieve applicable constraint for this attribute\n */\n get constraintCollection(): ConstraintCollection {\n const constraints = new ConstraintCollection();\n\n constraints.add(this._serverConstraints);\n\n // Mandatory constraint\n if (this.mandatory) {\n constraints.add(new MandatoryConstraint());\n }\n\n if (this.minLength || this.maxLength) {\n constraints.add(\n new StringLengthConstraint(this.minLength, this.maxLength),\n );\n }\n\n constraints.add(this.addConstraints());\n\n return constraints;\n }\n\n /**\n * Template method for class extending this model to add extra constraints\n * @abstract\n */\n addConstraints(): ConstraintCollection {\n return new ConstraintCollection();\n }\n\n /**\n * Used to programmatically overwrite the setting USE_CLIENTSIDE_VALIDATION\n */\n setUseClientsideValidation(enabled: boolean): void {\n this._useClientsideValidation = enabled;\n }\n\n /**\n * Indicates if client side validation is enabled\n * @returns {boolean}\n */\n useClientsideValidation(): boolean {\n return this._useClientsideValidation ?? true;\n }\n\n /**\n * Validate input on client side constraint\n */\n validate(value: string): boolean {\n // when client side validation is disabled, this attribute is always valid\n if (!this.useClientsideValidation()) {\n return true;\n }\n\n if (this.isOptionalAndEmpty(value)) {\n this._isValid = true;\n } else if (this._validatedValue !== value) {\n this._isValid = this.constraintCollection.validate(value);\n }\n this._validatedValue = value;\n\n return this._isValid;\n }\n\n /**\n * Indicates if attribute is optional and empty\n */\n isOptionalAndEmpty(value: string): boolean {\n if (value === undefined) {\n throw new IllegalArgumentException(\n \"isOptionalAndEmpty method needs value argument\",\n );\n }\n\n return !this.mandatory && value === \"\";\n }\n\n /**\n * Retrieve error messages of this attribute\n */\n get errorCollection(): ErrorCollection {\n const collection = new ErrorCollection(\"attribute\", this._errorCollection);\n\n collection.addConstraints(\n this.constraintCollection.invalidConstraints(this.validateValue),\n );\n\n return collection;\n }\n\n /**\n * Check if attribute is in error\n */\n inError(): boolean {\n return !this._isValid && this.isChangedSince(0);\n }\n\n /**\n * Reset static error messages on attribute\n */\n resetErrors(): void {\n this._errorCollection = new ErrorCollection(\"attribute\");\n }\n\n /**\n * Registers an error that was received from a server response\n */\n addServerError(error: FormErrorAnchor): void {\n this._errorCollection.addServerError(\n error.id,\n error.message,\n error.properties,\n error.layouthint,\n );\n }\n\n /**\n */\n removeServerError(id: string): void {\n this._errorCollection.removeServerError(id);\n }\n\n /**\n */\n hasServerErrors(): boolean {\n return this.errorCollection.serverErrors.length > 0;\n }\n\n /**\n */\n hasErrors(): boolean {\n return this.errorCollection.hasItems;\n }\n\n /**\n * Registers a missing error that was received from the server\n */\n addMissingError(): void {\n this._errorCollection.addServerError(\"Constraint.Missing\");\n }\n\n /**\n */\n removeMissingError(): void {\n this.removeServerError(\"Constraint.Missing\");\n }\n\n /**\n */\n addServerConstraint(\n id: string,\n defaultMessage?: string,\n parameters?: MessageParameters,\n ) {\n this._serverConstraints.addConstraint(\n id,\n null,\n defaultMessage,\n parameters,\n this.useClientsideValidation(),\n );\n }\n\n /**\n */\n formatParameters(parameters: Object): { [string]: string | number } {\n if (parameters == null) {\n return {};\n }\n\n const params: { [name: string]: string | number } = {};\n\n Object.keys(parameters).forEach((paramKey: string) => {\n const paramValue = parameters[paramKey];\n if (paramKey.endsWith(\"-number\") || paramKey.endsWith(\"-date\")) {\n params[paramKey] = this.formatValue(paramValue);\n } else {\n params[paramKey] = paramValue;\n }\n });\n\n return params;\n }\n\n /**\n */\n get hasDynamicValidationData(): boolean {\n return true;\n }\n\n /**\n */\n updateValidations(errors: Array<Object>): void {\n if (\n errors.some((error) => error.id === \"Constraint.Mandatory\") ||\n this.layouthint.has(MANDATORY)\n ) {\n this.mandatory = true;\n } else if (!this.hasValue()) {\n this.mandatory = false;\n }\n\n this._serverConstraints = new ConstraintCollection();\n this.resetErrors();\n\n errors\n .filter(\n (error) => error.id !== \"Constraint.Mandatory\" || !this.hasValue(),\n )\n .forEach((error) => {\n if (this.hasValue()) {\n this._errorCollection.addServerError(\n error.id,\n error.message,\n this.formatParameters(error.properties),\n error.layouthint,\n );\n } else {\n this.addServerConstraint(\n error.id,\n error.message,\n this.formatParameters(error.properties),\n );\n }\n });\n }\n\n /**\n * Set last modification to current timestamp\n */\n updateLastModification(): void {\n this._lastModification = Date.now();\n }\n\n /**\n * Inidicates if attribute is changed since a given timestamp (Date.now)\n */\n isChangedSince(timestamp: number): boolean {\n return this._lastModification > timestamp;\n }\n\n /**\n * Abstract reset method which should be implemented on each attribute that has this attribute as a base class.\n *\n * @abstract\n */\n reset(): void {\n throw new UnsupportedOperationException(\n `Reset method not implemented for ${this.type}`,\n );\n }\n\n /**\n * Merge old attribute with the attribute from the server.\n * Readonly attributes always need to show the value from the server\n */\n mergeAttribute(oldAttribute: AttributeType): void {\n this.concept = oldAttribute.concept;\n\n if (\n !oldAttribute.readonly &&\n oldAttribute.isValid &&\n oldAttribute.inputvalue !== null\n ) {\n this.update(oldAttribute.inputvalue);\n }\n }\n\n /**\n * Abstract update method which should be implemented on each attribute that has this attribute as a base class.\n * @abstract\n */\n // eslint-disable-next-line no-unused-vars\n update(value: string, changedAttribute?: AttributeType): AttributeType {\n throw new UnsupportedOperationException(\n `Update method not implemented for ${this.type}`,\n );\n }\n\n /**\n * Indicate if attribute is editable\n */\n set isEditable(isEditable: boolean) {\n this._isEditable = isEditable;\n }\n\n /**\n * Retrieve if attribute is editable\n */\n get isEditable(): boolean {\n return this._isEditable;\n }\n\n /**\n * Indicates if the attribute is visible\n */\n get isVisible(): boolean {\n return !this._isHidden;\n }\n\n /**\n */\n get isHidden(): boolean {\n return this._isHidden;\n }\n\n /**\n */\n set isHidden(isHidden: boolean) {\n this._isHidden = isHidden;\n }\n\n /**\n * Explicitly toggle visibility of this attribute\n */\n show(): void {\n this.isHidden = false;\n }\n\n /**\n */\n hide(): void {\n this.isHidden = true;\n }\n\n /**\n */\n equals(otherAttribute: AttributeType): boolean {\n return (\n this.key === otherAttribute.key &&\n this.parentKey === otherAttribute.parentKey\n );\n }\n\n /**\n * Readonly attribute width indicates the proposed width of this attribute\n */\n get readonlyWidth(): $Keys<typeof ATTRIBUTE_WIDTH> {\n return ATTRIBUTE_WIDTH.MEDIUM;\n }\n\n /**\n */\n get layoutHintRules(): LayoutHintRuleCollection {\n return this._layoutHintRules;\n }\n\n /**\n */\n set layoutHintRules(rules: LayoutHintRuleCollection) {\n this._layoutHintRules = rules;\n }\n\n /**\n */\n processLayoutHintRules(attributes: AttributeCollection): void {\n if (this._layoutHintRules) {\n this.layoutHintRules.process(this, attributes);\n }\n }\n\n /**\n * Indicates if content comes from the data service\n */\n get hasContentFromData(): boolean {\n return hasAllContentInData();\n }\n\n /**\n */\n get content(): AttributeContent {\n return new AttributeContent(this.data.content);\n }\n}\n"],"mappings":";;;;;;;;;;;;;AACA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,qBAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,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,CAAA,EAAY;IAChC,OAAO,IAAAiM,6BAAmB,EAAC,CAAC;EAC9B;;EAEA;AACF;EACE,IAAIhM,OAAOA,CAAA,EAAqB;IAC9B,OAAO,IAAIiM,yBAAgB,CAAC,IAAI,CAAC5L,IAAI,CAACL,OAAO,CAAC;EAChD;AACF;AAACkM,OAAA,CAAAtM,OAAA,GAAAN,cAAA"}
|
|
@@ -265,9 +265,6 @@ describe("attributeModel", () => {
|
|
|
265
265
|
attribute = new AttributeModel({}, { mandatory: false });
|
|
266
266
|
expect(attribute.mandatory).toBe(false);
|
|
267
267
|
|
|
268
|
-
attribute = new AttributeModel({}, { mandatory: false, nullable: false });
|
|
269
|
-
expect(attribute.mandatory).toBe(true);
|
|
270
|
-
|
|
271
268
|
attribute = new AttributeModel(
|
|
272
269
|
{},
|
|
273
270
|
{ mandatory: false, layouthint: ["mandatory"] },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileSizeConstraint.js","names":["_fileSize","_interopRequireDefault","require","MAX_TOTAL_FILE_SIZE_ID","MAX_FILE_SIZE_ID","FileSizeConstraint","constructor","filesizeConstraint","_defineProperty2","default","_filesizeConstraint","id","isMaxTotal","fileSize","undefined","hasValidation","defaultMessage","filesize","human","maxTotalFileSize","parameters","validate","isMandatoryConstraint","_default","exports"],"sources":["../../../../src/models/attributes/input-constraints/FileSizeConstraint.js"],"sourcesContent":["// @flow\nimport filesize from \"file-size\";\n\nimport type { IConstraintModel, FilesizeConstraintsType } from \"../../types\";\n\nconst MAX_TOTAL_FILE_SIZE_ID = \"Constraint.File.MaxTotalFileSize\";\nconst MAX_FILE_SIZE_ID = \"Constraint.File.MaxFileSize\";\n\n/**\n */\nclass FileSizeConstraint implements IConstraintModel {\n _filesizeConstraint: FilesizeConstraintsType;\n\n /**\n */\n constructor(filesizeConstraint: FilesizeConstraintsType) {\n this._filesizeConstraint = filesizeConstraint;\n }\n\n /**\n */\n get id(): string {\n if (this.filesizeConstraint.isMaxTotal) {\n return MAX_TOTAL_FILE_SIZE_ID;\n } else if (this.filesizeConstraint.fileSize !== undefined) {\n return MAX_FILE_SIZE_ID;\n }\n\n return \"\";\n }\n\n /**\n */\n get filesizeConstraint(): FilesizeConstraintsType {\n return this._filesizeConstraint;\n }\n\n /**\n */\n hasValidation(): boolean {\n return false;\n }\n\n /**\n */\n get defaultMessage(): string {\n if (this.id === MAX_TOTAL_FILE_SIZE_ID) {\n return \"{filesize-left} van {max-total-filesize} over van totaal toegestaan upload bestandsgrootte\"; // NOSONAR\n } else if (this.id === MAX_FILE_SIZE_ID) {\n return \"Maximale bestandsgroote is ${max-filesize}\"; // NOSONAR\n }\n\n return \"\";\n }\n\n /**\n */\n get filesize(): any {\n return filesize(this.filesizeConstraint.fileSize).human(\"jedec\");\n }\n\n /**\n */\n get maxTotalFileSize(): any {\n return filesize(this.filesizeConstraint.maxTotalFileSize).human(\"jedec\");\n }\n\n /**\n */\n get parameters():\n | { ... }\n | { \"filesize-left\": any, \"max-total-filesize\": any }\n | { \"max-filesize\": any } {\n if (this.id === MAX_TOTAL_FILE_SIZE_ID) {\n return {\n \"filesize-left\": this.filesize,\n \"max-total-filesize\": this.maxTotalFileSize,\n };\n } else if (this.id === MAX_FILE_SIZE_ID) {\n return {\n \"max-filesize\": this.filesize,\n };\n }\n\n return {};\n }\n\n /**\n */\n validate(): boolean {\n return true;\n }\n\n /**\n */\n get isMandatoryConstraint(): boolean {\n return false;\n }\n}\n\nexport default FileSizeConstraint;\n"],"mappings":";;;;;;;;AACA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA,MAAMC,sBAAsB,GAAG,kCAAkC;AACjE,MAAMC,gBAAgB,GAAG,6BAA6B;;AAEtD;AACA;AACA,MAAMC,kBAAkB,CAA6B;EAGnD;AACF;EACEC,WAAWA,CAACC,kBAA2C,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IACvD,IAAI,CAACC,mBAAmB,GAAGH,kBAAkB;EAC/C;;EAEA;AACF;EACE,IAAII,EAAEA,CAAA,EAAW;IACf,IAAI,IAAI,CAACJ,kBAAkB,CAACK,UAAU,EAAE;MACtC,OAAOT,sBAAsB;IAC/B,CAAC,MAAM,IAAI,IAAI,CAACI,kBAAkB,CAACM,QAAQ,KAAKC,SAAS,EAAE;MACzD,OAAOV,gBAAgB;IACzB;IAEA,OAAO,EAAE;EACX;;EAEA;AACF;EACE,IAAIG,kBAAkBA,CAAA,EAA4B;IAChD,OAAO,IAAI,CAACG,mBAAmB;EACjC;;EAEA;AACF;EACEK,aAAaA,CAAA,EAAY;IACvB,OAAO,KAAK;EACd;;EAEA;AACF;EACE,IAAIC,cAAcA,CAAA,EAAW;IAC3B,IAAI,IAAI,CAACL,EAAE,KAAKR,sBAAsB,EAAE;MACtC,OAAO,4FAA4F,CAAC,CAAC;IACvG,CAAC,MAAM,IAAI,IAAI,CAACQ,EAAE,KAAKP,gBAAgB,EAAE;MACvC,OAAO,4CAA4C,CAAC,CAAC;IACvD
|
|
1
|
+
{"version":3,"file":"FileSizeConstraint.js","names":["_fileSize","_interopRequireDefault","require","MAX_TOTAL_FILE_SIZE_ID","MAX_FILE_SIZE_ID","FileSizeConstraint","constructor","filesizeConstraint","_defineProperty2","default","_filesizeConstraint","id","isMaxTotal","fileSize","undefined","hasValidation","defaultMessage","filesize","human","maxTotalFileSize","parameters","validate","isMandatoryConstraint","_default","exports"],"sources":["../../../../src/models/attributes/input-constraints/FileSizeConstraint.js"],"sourcesContent":["// @flow\nimport filesize from \"file-size\";\n\nimport type { IConstraintModel, FilesizeConstraintsType } from \"../../types\";\n\nconst MAX_TOTAL_FILE_SIZE_ID = \"Constraint.File.MaxTotalFileSize\";\nconst MAX_FILE_SIZE_ID = \"Constraint.File.MaxFileSize\";\n\n/**\n */\nclass FileSizeConstraint implements IConstraintModel {\n _filesizeConstraint: FilesizeConstraintsType;\n\n /**\n */\n constructor(filesizeConstraint: FilesizeConstraintsType) {\n this._filesizeConstraint = filesizeConstraint;\n }\n\n /**\n */\n get id(): string {\n if (this.filesizeConstraint.isMaxTotal) {\n return MAX_TOTAL_FILE_SIZE_ID;\n } else if (this.filesizeConstraint.fileSize !== undefined) {\n return MAX_FILE_SIZE_ID;\n }\n\n return \"\";\n }\n\n /**\n */\n get filesizeConstraint(): FilesizeConstraintsType {\n return this._filesizeConstraint;\n }\n\n /**\n */\n hasValidation(): boolean {\n return false;\n }\n\n /**\n */\n get defaultMessage(): string {\n if (this.id === MAX_TOTAL_FILE_SIZE_ID) {\n return \"{filesize-left} van {max-total-filesize} over van totaal toegestaan upload bestandsgrootte\"; // NOSONAR\n } else if (this.id === MAX_FILE_SIZE_ID) {\n return \"Maximale bestandsgroote is ${max-filesize}\"; // NOSONAR\n }\n\n return \"\";\n }\n\n /**\n */\n get filesize(): any {\n return filesize(this.filesizeConstraint.fileSize).human(\"jedec\");\n }\n\n /**\n */\n get maxTotalFileSize(): any {\n return filesize(this.filesizeConstraint.maxTotalFileSize).human(\"jedec\");\n }\n\n /**\n */\n get parameters():\n | { ... }\n | { \"filesize-left\": any, \"max-total-filesize\": any }\n | { \"max-filesize\": any } {\n if (this.id === MAX_TOTAL_FILE_SIZE_ID) {\n return {\n \"filesize-left\": this.filesize,\n \"max-total-filesize\": this.maxTotalFileSize,\n };\n } else if (this.id === MAX_FILE_SIZE_ID) {\n return {\n \"max-filesize\": this.filesize,\n };\n }\n\n return {};\n }\n\n /**\n */\n validate(): boolean {\n return true;\n }\n\n /**\n */\n get isMandatoryConstraint(): boolean {\n return false;\n }\n}\n\nexport default FileSizeConstraint;\n"],"mappings":";;;;;;;;AACA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA,MAAMC,sBAAsB,GAAG,kCAAkC;AACjE,MAAMC,gBAAgB,GAAG,6BAA6B;;AAEtD;AACA;AACA,MAAMC,kBAAkB,CAA6B;EAGnD;AACF;EACEC,WAAWA,CAACC,kBAA2C,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IACvD,IAA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AKP,gBAAgB,EAAE;MACvC,OAAO;QACL,cAAc,EAAE,IAAI,CAACa;MACvB,CAAC;IACH;IAEA,OAAO,CAAC,CAAC;EACX;;EAEA;AACF;EACEI,QAAQA,CAAA,EAAY;IAClB,OAAO,IAAI;EACb;;EAEA;AACF;EACE,IAAIC,qBAAqBA,CAAA,EAAY;IACnC,OAAO,KAAK;EACd;AACF;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAf,OAAA,GAEcJ,kBAAkB"}
|
|
@@ -206,6 +206,7 @@ export default class ContentModel extends ResourceModel {
|
|
|
206
206
|
if (relatedConceptsLink) {
|
|
207
207
|
const { href } = relatedConceptsLink;
|
|
208
208
|
href.addParameter("entryDate", this.entryDate);
|
|
209
|
+
href.setReferenceHash(this.referenceHash);
|
|
209
210
|
return href;
|
|
210
211
|
}
|
|
211
212
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentModel.js","names":["_ModularUIResponse","_interopRequireDefault","require","_ResourceModel","_FilterCollection","_ContentLinkModel","_SubSectionModel","_ContentTypeModel","_Constants","_SectionModel","ContentModel","ResourceModel","constructor","response","_defineProperty2","default","_section","SectionModel","data","entryDate","type","modelName","isApplicableModel","contributions","resourcetype","getInitialChildModelLinks","contentTypeLink","links","getLinkByKey","setChildModels","models","contentType","_find","call","model","section","id","_id","filterCollection","_filterCollection","_filter","FilterCollection","filter","entryDateFilter","getFilterByAttributeKey","TIMEVERSION_FILTER_NAME","attribute","value","_contentType","ContentTypeModel","label","number","body","childSectionLinks","selfContentLink","childSections","sections","subSections","relatedConceptsHrefs","hrefs","relatedConceptsHref","push","forEach","subSection","relatedConceptsLink","href","addParameter","referenceHash","exports"],"sources":["../../../src/models/content/ContentModel.js"],"sourcesContent":["// @flow\nimport ModularUIResponse from \"../../modularui/ModularUIResponse\";\n\nimport ResourceModel from \"../base/ResourceModel\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport ContentLinkModel from \"./ContentLinkModel\";\nimport SubSectionModel from \"./SubSectionModel\";\n\nimport ContentTypeModel from \"./ContentTypeModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type Href from \"../href/Href\";\nimport SectionModel from \"./SectionModel\";\n\n/**\n * Content detail model\n */\nexport default class ContentModel extends ResourceModel {\n _section: SectionModel;\n _contentType: ContentTypeModel | null = null;\n _filterCollection: FilterCollection;\n\n constructor(response: ModularUIResponse) {\n super(response);\n\n this._section = new SectionModel(this.data, this.entryDate);\n }\n\n /**\n */\n get type(): string {\n return \"Content\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ContentModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ContentDetail\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const contentTypeLink = this.links.getLinkByKey(\"contenttype\");\n\n if (contentTypeLink) {\n return [contentTypeLink];\n }\n\n return [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.contentType = models.find((model) => model.type === \"ContentType\");\n }\n\n /**\n */\n get section(): SectionModel {\n return this._section;\n }\n\n /**\n */\n get id(): string {\n return this.data._id;\n }\n\n /**\n * Retrieve available filters on concept toc\n */\n get filterCollection(): FilterCollection {\n if (!this._filterCollection && this.data.filter?.entryDate) {\n this._filterCollection = new FilterCollection(\n {\n entryDate: this.data.filter.entryDate,\n },\n {\n filter: this.contributions.filter,\n },\n );\n }\n\n return this._filterCollection;\n }\n\n /**\n * Retrieve entrydate of content toc\n */\n get entryDate(): ISO_DATE | null {\n const entryDateFilter = this.filterCollection?.getFilterByAttributeKey(\n TIMEVERSION_FILTER_NAME,\n );\n if (entryDateFilter && entryDateFilter.attribute) {\n return entryDateFilter.attribute.value;\n }\n\n return null;\n }\n\n /**\n * Get conceptType of concept\n */\n get contentType(): ContentTypeModel | null {\n return this._contentType;\n }\n\n /**\n * Set concept type\n */\n set contentType(contentType: ?ModularUIModel) {\n this._contentType =\n contentType instanceof ContentTypeModel ? contentType : null;\n }\n\n /**\n * Get content label\n */\n get label(): string {\n return this.section.label;\n }\n\n /**\n * Retrieve number of section\n */\n get number(): string | null {\n return this.section.number;\n }\n\n /**\n * Get content body\n */\n get body(): ?string {\n return this.section.body;\n }\n\n /**\n * Retrieve child section links\n */\n get childSectionLinks(): Array<ContentLinkModel> {\n return this.section.childSectionLinks;\n }\n\n /**\n */\n get selfContentLink(): ContentLinkModel {\n return this.section.selfContentLink;\n }\n\n /**\n * Get tree of child sections\n */\n get childSections(): Array<SectionModel> {\n return this.section.childSections;\n }\n\n /**\n * set resolved child sections\n */\n set childSections(sections: Array<SectionModel>) {\n this.section.childSections = sections || [];\n }\n\n /**\n * Get sub sections\n */\n get subSections(): Array<SubSectionModel> {\n return this.section.subSections;\n }\n\n /**\n */\n get relatedConceptsHrefs(): Array<Href> {\n const hrefs = [];\n if (this.relatedConceptsHref) {\n hrefs.push(this.relatedConceptsHref);\n }\n\n this.subSections.forEach((subSection) => {\n hrefs.push(...subSection.relatedConceptsHrefs);\n });\n\n return hrefs;\n }\n\n /**\n * Get related concepts link\n */\n get relatedConceptsHref(): Href | null {\n const relatedConceptsLink = this.links.getLinkByKey(\"relatedConcepts\");\n\n if (relatedConceptsLink) {\n const { href } = relatedConceptsLink;\n href.addParameter(\"entryDate\", this.entryDate);\n return href;\n }\n\n return null;\n }\n\n /**\n */\n get referenceHash(): number {\n return this.section.referenceHash;\n }\n}\n"],"mappings":";;;;;;;;;;AACA,IAAAA,kBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,cAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,iBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,iBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,gBAAA,GAAAL,sBAAA,CAAAC,OA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EAAE,IAAI,CAAC/C,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"ContentModel.js","names":["_ModularUIResponse","_interopRequireDefault","require","_ResourceModel","_FilterCollection","_ContentLinkModel","_SubSectionModel","_ContentTypeModel","_Constants","_SectionModel","ContentModel","ResourceModel","constructor","response","_defineProperty2","default","_section","SectionModel","data","entryDate","type","modelName","isApplicableModel","contributions","resourcetype","getInitialChildModelLinks","contentTypeLink","links","getLinkByKey","setChildModels","models","contentType","_find","call","model","section","id","_id","filterCollection","_filterCollection","_filter","FilterCollection","filter","entryDateFilter","getFilterByAttributeKey","TIMEVERSION_FILTER_NAME","attribute","value","_contentType","ContentTypeModel","label","number","body","childSectionLinks","selfContentLink","childSections","sections","subSections","relatedConceptsHrefs","hrefs","relatedConceptsHref","push","forEach","subSection","relatedConceptsLink","href","addParameter","setReferenceHash","referenceHash","exports"],"sources":["../../../src/models/content/ContentModel.js"],"sourcesContent":["// @flow\nimport ModularUIResponse from \"../../modularui/ModularUIResponse\";\n\nimport ResourceModel from \"../base/ResourceModel\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport ContentLinkModel from \"./ContentLinkModel\";\nimport SubSectionModel from \"./SubSectionModel\";\n\nimport ContentTypeModel from \"./ContentTypeModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type Href from \"../href/Href\";\nimport SectionModel from \"./SectionModel\";\n\n/**\n * Content detail model\n */\nexport default class ContentModel extends ResourceModel {\n _section: SectionModel;\n _contentType: ContentTypeModel | null = null;\n _filterCollection: FilterCollection;\n\n constructor(response: ModularUIResponse) {\n super(response);\n\n this._section = new SectionModel(this.data, this.entryDate);\n }\n\n /**\n */\n get type(): string {\n return \"Content\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ContentModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ContentDetail\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const contentTypeLink = this.links.getLinkByKey(\"contenttype\");\n\n if (contentTypeLink) {\n return [contentTypeLink];\n }\n\n return [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.contentType = models.find((model) => model.type === \"ContentType\");\n }\n\n /**\n */\n get section(): SectionModel {\n return this._section;\n }\n\n /**\n */\n get id(): string {\n return this.data._id;\n }\n\n /**\n * Retrieve available filters on concept toc\n */\n get filterCollection(): FilterCollection {\n if (!this._filterCollection && this.data.filter?.entryDate) {\n this._filterCollection = new FilterCollection(\n {\n entryDate: this.data.filter.entryDate,\n },\n {\n filter: this.contributions.filter,\n },\n );\n }\n\n return this._filterCollection;\n }\n\n /**\n * Retrieve entrydate of content toc\n */\n get entryDate(): ISO_DATE | null {\n const entryDateFilter = this.filterCollection?.getFilterByAttributeKey(\n TIMEVERSION_FILTER_NAME,\n );\n if (entryDateFilter && entryDateFilter.attribute) {\n return entryDateFilter.attribute.value;\n }\n\n return null;\n }\n\n /**\n * Get conceptType of concept\n */\n get contentType(): ContentTypeModel | null {\n return this._contentType;\n }\n\n /**\n * Set concept type\n */\n set contentType(contentType: ?ModularUIModel) {\n this._contentType =\n contentType instanceof ContentTypeModel ? contentType : null;\n }\n\n /**\n * Get content label\n */\n get label(): string {\n return this.section.label;\n }\n\n /**\n * Retrieve number of section\n */\n get number(): string | null {\n return this.section.number;\n }\n\n /**\n * Get content body\n */\n get body(): ?string {\n return this.section.body;\n }\n\n /**\n * Retrieve child section links\n */\n get childSectionLinks(): Array<ContentLinkModel> {\n return this.section.childSectionLinks;\n }\n\n /**\n */\n get selfContentLink(): ContentLinkModel {\n return this.section.selfContentLink;\n }\n\n /**\n * Get tree of child sections\n */\n get childSections(): Array<SectionModel> {\n return this.section.childSections;\n }\n\n /**\n * set resolved child sections\n */\n set childSections(sections: Array<SectionModel>) {\n this.section.childSections = sections || [];\n }\n\n /**\n * Get sub sections\n */\n get subSections(): Array<SubSectionModel> {\n return this.section.subSections;\n }\n\n /**\n */\n get relatedConceptsHrefs(): Array<Href> {\n const hrefs = [];\n if (this.relatedConceptsHref) {\n hrefs.push(this.relatedConceptsHref);\n }\n\n this.subSections.forEach((subSection) => {\n hrefs.push(...subSection.relatedConceptsHrefs);\n });\n\n return hrefs;\n }\n\n /**\n * Get related concepts link\n */\n get relatedConceptsHref(): Href | null {\n const relatedConceptsLink = this.links.getLinkByKey(\"relatedConcepts\");\n\n if (relatedConceptsLink) {\n const { href } = relatedConceptsLink;\n href.addParameter(\"entryDate\", this.entryDate);\n href.setReferenceHash(this.referenceHash);\n return href;\n }\n\n return null;\n }\n\n /**\n */\n get referenceHash(): number {\n return this.section.referenceHash;\n }\n}\n"],"mappings":";;;;;;;;;;AACA,IAAAA,kBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,cAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,iBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,iBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,gBAAA,GAAAL,sBAAA,CAAAC,OAAA;AAEA,IAAAK,iBAAA,GAAAN,sBAAA,CAAAC,OAAA;AAEA,IAAAM,UAAA,GAAAN,OAAA;AAKA,IAAAO,aAAA,GAAAR,sBAAA,CAAAC,OAAA;AAEA;AACA;AACA;AACe,MAAMQ,YAAY,SAASC,sBAAa,CAAC;EAKtDC,WAAWA,CAACC,QAA2B,EAAE;IACvC,KAAK,CAACA,QAAQ,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA,wBAJsB,IAAI;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAM1C,IAAI,CAACC,QAAQ,GAAG,IAAIC,qBAAY,CAAC,IAAI,CAACC,IAAI,EAAE,IAAI,CAACC,SAAS,CAAC;EAC7D;;EAEA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CAACrB,OAAO,CAACoB,aAAa,GAAGC,QAAQ,IAAI,EAAE;EAC7C;;EAEA;AACF;AACA;EACE,IAAIC,WAAWA,CAAA,EAA2B;IACxC,OAAO,IAAI,CAACtB,OAAO,CAACsB,WAAW;EACjC;;EAEA;AACF;EACE,IAAIC,oBAAoBA,CAAA,EAAgB;IACtC,MAAMC,KAAK,GAAG,EAAE;IAChB,IAAI,IAAI,CAACC,mBAAmB,EAAE;MAC5BD,KAAK,CAACE,IAAI,CAAC,IAAI,CAACD,mBAAmB,CAAC;IACtC;IAEA,IAAI,CAACH,WAAW,CAACK,OAAO,CAAEC,UAAU,IAAK;MACvCJ,KAAK,CAACE,IAAI,CAAC,GAAGE,UAAU,CAACL,oBAAoB,CAAC;IAChD,CAAC,CAAC;IAEF,OAAOC,KAAK;EACd;;EAEA;AACF;AACA;EACE,IAAIC,mBAAmBA,CAAA,EAAgB;IACrC,MAAMI,mBAAmB,GAAG,IAAI,CAACrC,KAAK,CAACC,YAAY,CAAC,iBAAiB,CAAC;IAEtE,IAAIoC,mBAAmB,EAAE;MACvB,MAAM;QAAEC;MAAK,CAAC,GAAGD,mBAAmB;MACpCC,IAAI,CAACC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC/C,SAAS,CAAC;MAC9C8C,IAAI,CAACE,gBAAgB,CAAC,IAAI,CAACC,aAAa,CAAC;MACzC,OAAOH,IAAI;IACb;IAEA,OAAO,IAAI;EACb;;EAEA;AACF;EACE,IAAIG,aAAaA,CAAA,EAAW;IAC1B,OAAO,IAAI,CAACjC,OAAO,CAACiC,aAAa;EACnC;AACF;AAACC,OAAA,CAAAtD,OAAA,GAAAL,YAAA"}
|
|
@@ -116,7 +116,11 @@ class SubSectionModel extends _BaseModel.default {
|
|
|
116
116
|
get relatedConceptsHref() {
|
|
117
117
|
const relatedConceptsLink = this.links.getLinkByKey("relatedConcepts");
|
|
118
118
|
if (relatedConceptsLink) {
|
|
119
|
-
|
|
119
|
+
const {
|
|
120
|
+
href
|
|
121
|
+
} = relatedConceptsLink;
|
|
122
|
+
href.setReferenceHash(this.referenceHash);
|
|
123
|
+
return href;
|
|
120
124
|
}
|
|
121
125
|
return null;
|
|
122
126
|
}
|
|
@@ -121,7 +121,9 @@ export default class SubSectionModel extends BaseModel {
|
|
|
121
121
|
const relatedConceptsLink = this.links.getLinkByKey("relatedConcepts");
|
|
122
122
|
|
|
123
123
|
if (relatedConceptsLink) {
|
|
124
|
-
|
|
124
|
+
const { href } = relatedConceptsLink;
|
|
125
|
+
href.setReferenceHash(this.referenceHash);
|
|
126
|
+
return href;
|
|
125
127
|
}
|
|
126
128
|
|
|
127
129
|
return null;
|
|
@@ -131,7 +133,6 @@ export default class SubSectionModel extends BaseModel {
|
|
|
131
133
|
*/
|
|
132
134
|
get referenceHash(): number {
|
|
133
135
|
const selfhref = this.selfhref || new Href();
|
|
134
|
-
|
|
135
136
|
return createHashFromHref(selfhref);
|
|
136
137
|
}
|
|
137
138
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubSectionModel.js","names":["_createHash","require","_BaseModel","_interopRequireDefault","_LinkCollection","_Href","_LinkModel","_utils","SubSectionModel","BaseModel","constructor","data","_defineProperty2","default","referred","id","_id","key","body","getData","retrieveText","number","label","subSections","_context","_map","call","subSection","links","_links","LinkCollection","contributions","selflink","getLinkByKey","selfhref","href","relatedConceptsHrefs","hrefs","relatedConceptsHref","push","forEach","relatedConceptsLink","referenceHash","Href","createHashFromHref","getReferredSections","sections","referredChilds","exports"],"sources":["../../../src/models/content/SubSectionModel.js"],"sourcesContent":["// @flow\nimport { createHashFromHref } from \"../../utils/helpers/createHash\";\n\nimport BaseModel from \"../base/BaseModel\";\nimport LinkCollection from \"../links/LinkCollection\";\nimport Href from \"../href/Href\";\nimport LinkModel from \"../links/LinkModel\";\nimport { retrieveText } from \"../../utils\";\n\n/**\n * Link to a concept\n */\nexport default class SubSectionModel extends BaseModel {\n _links: LinkCollection;\n\n /**\n */\n constructor(data: Object) {\n super(data, {});\n }\n\n /**\n */\n get referred(): boolean {\n return this.data.referred;\n }\n\n /**\n */\n get id(): string {\n return this.data.id || this.data._id;\n }\n\n /**\n * Retrieve key of subsection\n */\n get key(): ?string {\n return this.id;\n }\n\n /**\n * Retrieve html body\n */\n get body(): string {\n const body = this.getData(\"body\", \"\");\n return retrieveText(body);\n }\n\n /**\n * Retrieve number of section\n */\n get number(): string | null {\n return this.data.number ?? null;\n }\n\n /**\n * Retrieve label of section\n */\n get label(): ?string {\n return this.data.label;\n }\n\n /**\n * Get sub sections\n */\n get subSections(): Array<SubSectionModel> {\n return this.data.subSections\n ? this.data.subSections.map(\n (subSection) => new SubSectionModel(subSection),\n )\n : [];\n }\n\n /**\n * Retrieve links of section\n */\n get links(): LinkCollection {\n if (!this._links) {\n this._links = new LinkCollection(\n this.data._links,\n this.contributions._links,\n );\n }\n\n return this._links;\n }\n\n /**\n * Get self link of model\n */\n get selflink(): LinkModel | null {\n return this.links.getLinkByKey(\"self\");\n }\n\n /**\n * Return default self link of resource\n */\n get selfhref(): Href | null {\n return this.selflink ? this.selflink.href : null;\n }\n\n /**\n */\n get relatedConceptsHrefs(): Array<Href> {\n const hrefs = [];\n if (this.relatedConceptsHref) {\n hrefs.push(this.relatedConceptsHref);\n }\n\n this.subSections.forEach((subSection) => {\n hrefs.push(...subSection.relatedConceptsHrefs);\n });\n\n return hrefs;\n }\n\n /**\n * Get related concepts link\n */\n get relatedConceptsHref(): Href | null {\n const relatedConceptsLink = this.links.getLinkByKey(\"relatedConcepts\");\n\n if (relatedConceptsLink) {\n
|
|
1
|
+
{"version":3,"file":"SubSectionModel.js","names":["_createHash","require","_BaseModel","_interopRequireDefault","_LinkCollection","_Href","_LinkModel","_utils","SubSectionModel","BaseModel","constructor","data","_defineProperty2","default","referred","id","_id","key","body","getData","retrieveText","number","label","subSections","_context","_map","call","subSection","links","_links","LinkCollection","contributions","selflink","getLinkByKey","selfhref","href","relatedConceptsHrefs","hrefs","relatedConceptsHref","push","forEach","relatedConceptsLink","setReferenceHash","referenceHash","Href","createHashFromHref","getReferredSections","sections","referredChilds","exports"],"sources":["../../../src/models/content/SubSectionModel.js"],"sourcesContent":["// @flow\nimport { createHashFromHref } from \"../../utils/helpers/createHash\";\n\nimport BaseModel from \"../base/BaseModel\";\nimport LinkCollection from \"../links/LinkCollection\";\nimport Href from \"../href/Href\";\nimport LinkModel from \"../links/LinkModel\";\nimport { retrieveText } from \"../../utils\";\n\n/**\n * Link to a concept\n */\nexport default class SubSectionModel extends BaseModel {\n _links: LinkCollection;\n\n /**\n */\n constructor(data: Object) {\n super(data, {});\n }\n\n /**\n */\n get referred(): boolean {\n return this.data.referred;\n }\n\n /**\n */\n get id(): string {\n return this.data.id || this.data._id;\n }\n\n /**\n * Retrieve key of subsection\n */\n get key(): ?string {\n return this.id;\n }\n\n /**\n * Retrieve html body\n */\n get body(): string {\n const body = this.getData(\"body\", \"\");\n return retrieveText(body);\n }\n\n /**\n * Retrieve number of section\n */\n get number(): string | null {\n return this.data.number ?? null;\n }\n\n /**\n * Retrieve label of section\n */\n get label(): ?string {\n return this.data.label;\n }\n\n /**\n * Get sub sections\n */\n get subSections(): Array<SubSectionModel> {\n return this.data.subSections\n ? this.data.subSections.map(\n (subSection) => new SubSectionModel(subSection),\n )\n : [];\n }\n\n /**\n * Retrieve links of section\n */\n get links(): LinkCollection {\n if (!this._links) {\n this._links = new LinkCollection(\n this.data._links,\n this.contributions._links,\n );\n }\n\n return this._links;\n }\n\n /**\n * Get self link of model\n */\n get selflink(): LinkModel | null {\n return this.links.getLinkByKey(\"self\");\n }\n\n /**\n * Return default self link of resource\n */\n get selfhref(): Href | null {\n return this.selflink ? this.selflink.href : null;\n }\n\n /**\n */\n get relatedConceptsHrefs(): Array<Href> {\n const hrefs = [];\n if (this.relatedConceptsHref) {\n hrefs.push(this.relatedConceptsHref);\n }\n\n this.subSections.forEach((subSection) => {\n hrefs.push(...subSection.relatedConceptsHrefs);\n });\n\n return hrefs;\n }\n\n /**\n * Get related concepts link\n */\n get relatedConceptsHref(): Href | null {\n const relatedConceptsLink = this.links.getLinkByKey(\"relatedConcepts\");\n\n if (relatedConceptsLink) {\n const { href } = relatedConceptsLink;\n href.setReferenceHash(this.referenceHash);\n return href;\n }\n\n return null;\n }\n\n /**\n */\n get referenceHash(): number {\n const selfhref = this.selfhref || new Href();\n return createHashFromHref(selfhref);\n }\n\n /**\n */\n getReferredSections(): Array<SubSectionModel> {\n const sections = [];\n\n for (const subSection of this.subSections) {\n if (subSection.referred) {\n sections.push(subSection);\n }\n\n const referredChilds = subSection.getReferredSections();\n sections.push(...referredChilds);\n }\n\n return sections;\n }\n}\n"],"mappings":";;;;;;;;;AACA,IAAAA,WAAA,GAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,eAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,KAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,UAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAEA;AACA;AACA;AACe,MAAMO,eAAe,SAASC,kBAAS,CAAC;EAGrD;AACF;EACEC,WAAWA,CAACC,IAAY,EAAE;IACxB,KAAK,CAACA,IAAI,EAAE,CAAC,CAAC,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;EAClB;;EAEA;AACF;EACE,IAAIC,QAAQA,CAAA,EAAY;IACtB,OAAO,IAAI,CAACH,IAAI,CAACG,QAAQ;EAC3B;;EAEA;AACF;EACE,IAAIC,EAAEA,CAAA,EAAW;IACf,OAAO,IAAI,CAACJ,IAAI,CAACI,EAAE,IAAI,IAAI,CAACJ,IAAI,CAACK,GAAG;EACtC;;EAEA;AACF;AACA;EACE,IAAIC,GAAGA,CAAA,EAAY;IACjB,OAAO,IAAI,CAACF,EAAE;EAChB;;EAEA;AACF;AACA;EACE,IAAIG,IAAIA,CAAA,EAAW;IACjB,MAAMA,IAA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|
177
177
|
"/content/Incident/Business design/Content/Blaastest subsections.formalsource/Pass/relatedConcepts",
|
|
178
178
|
);
|
|
179
|
+
expect(firstSubSection.relatedConceptsHref.getReferenceHash()).toBe(
|
|
180
|
+
145842294,
|
|
181
|
+
);
|
|
179
182
|
expect(firstSubSection.referenceHash).toBe(145842294);
|
|
180
183
|
});
|
|
181
184
|
});
|
package/lib/models/href/Href.js
CHANGED
|
@@ -28,6 +28,7 @@ class Href {
|
|
|
28
28
|
(0, _defineProperty2.default)(this, "_resourcetype", "");
|
|
29
29
|
(0, _defineProperty2.default)(this, "_method", _constants.HTTP_METHODS.GET);
|
|
30
30
|
(0, _defineProperty2.default)(this, "_state", null);
|
|
31
|
+
(0, _defineProperty2.default)(this, "_referenceHash", void 0);
|
|
31
32
|
this.resourcetype = resourcetype ?? "";
|
|
32
33
|
if (href instanceof Href) {
|
|
33
34
|
this.setFromHref(href);
|
|
@@ -397,6 +398,18 @@ class Href {
|
|
|
397
398
|
return (0, _startsWith.default)(_context11 = this.absolutepath).call(_context11, `${(0, _constants.getBasePath)()}${_constants.CONTENT_PATH}`);
|
|
398
399
|
}
|
|
399
400
|
|
|
401
|
+
/**
|
|
402
|
+
*/
|
|
403
|
+
getReferenceHash() {
|
|
404
|
+
return this._referenceHash;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
*/
|
|
409
|
+
setReferenceHash(referenceHash) {
|
|
410
|
+
this._referenceHash = referenceHash;
|
|
411
|
+
}
|
|
412
|
+
|
|
400
413
|
/**
|
|
401
414
|
* Returns a complete url from the Href
|
|
402
415
|
*/
|
|
@@ -28,6 +28,7 @@ class Href {
|
|
|
28
28
|
_resourcetype: string = "";
|
|
29
29
|
_method: $Keys<typeof HTTP_METHODS> = HTTP_METHODS.GET;
|
|
30
30
|
_state: any = null;
|
|
31
|
+
_referenceHash: ?number;
|
|
31
32
|
|
|
32
33
|
/**
|
|
33
34
|
* Create a Href
|
|
@@ -451,6 +452,18 @@ class Href {
|
|
|
451
452
|
return this.absolutepath.startsWith(`${getBasePath()}${CONTENT_PATH}`);
|
|
452
453
|
}
|
|
453
454
|
|
|
455
|
+
/**
|
|
456
|
+
*/
|
|
457
|
+
getReferenceHash(): ?number {
|
|
458
|
+
return this._referenceHash;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
*/
|
|
463
|
+
setReferenceHash(referenceHash: number) {
|
|
464
|
+
this._referenceHash = referenceHash;
|
|
465
|
+
}
|
|
466
|
+
|
|
454
467
|
/**
|
|
455
468
|
* Returns a complete url from the Href
|
|
456
469
|
*/
|