@beinformed/ui 1.48.1 → 1.49.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/esm/hooks/useForm.js +17 -2
  3. package/esm/hooks/useForm.js.map +1 -1
  4. package/esm/models/attributes/AttributeModel.js +2 -1
  5. package/esm/models/attributes/AttributeModel.js.map +1 -1
  6. package/esm/models/attributes/ChoiceAttributeModel.js +16 -1
  7. package/esm/models/attributes/ChoiceAttributeModel.js.map +1 -1
  8. package/esm/models/attributes/ChoiceAttributeOptionCollection.js +10 -3
  9. package/esm/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
  10. package/esm/models/concepts/ConceptDetailModel.js +7 -0
  11. package/esm/models/concepts/ConceptDetailModel.js.map +1 -1
  12. package/esm/models/form/FormModel.js +22 -2
  13. package/esm/models/form/FormModel.js.map +1 -1
  14. package/esm/models/form/FormObjectModel.js +9 -1
  15. package/esm/models/form/FormObjectModel.js.map +1 -1
  16. package/esm/modularui/ModularUIRequest.js +1 -1
  17. package/esm/modularui/ModularUIRequest.js.map +1 -1
  18. package/esm/redux/_modularui/ModularUIActions.js +4 -10
  19. package/esm/redux/_modularui/ModularUIActions.js.map +1 -1
  20. package/esm/redux/actions/FormAttributeSet.js +22 -6
  21. package/esm/redux/actions/FormAttributeSet.js.map +1 -1
  22. package/esm/redux/actions/FormAutosubmit.js +9 -1
  23. package/esm/redux/actions/FormAutosubmit.js.map +1 -1
  24. package/esm/redux/actions/FormAutoupdate.js +29 -0
  25. package/esm/redux/actions/FormAutoupdate.js.map +1 -0
  26. package/esm/redux/connectors/FormAttributeSet.js +3 -2
  27. package/esm/redux/connectors/FormAttributeSet.js.map +1 -1
  28. package/esm/redux/types.js.map +1 -1
  29. package/esm/utils/fetch/types.js.map +1 -1
  30. package/lib/hooks/useForm.js +17 -2
  31. package/lib/hooks/useForm.js.flow +22 -7
  32. package/lib/hooks/useForm.js.map +1 -1
  33. package/lib/models/attributes/AttributeModel.js +2 -1
  34. package/lib/models/attributes/AttributeModel.js.flow +2 -1
  35. package/lib/models/attributes/AttributeModel.js.map +1 -1
  36. package/lib/models/attributes/ChoiceAttributeModel.js +16 -1
  37. package/lib/models/attributes/ChoiceAttributeModel.js.flow +23 -2
  38. package/lib/models/attributes/ChoiceAttributeModel.js.map +1 -1
  39. package/lib/models/attributes/ChoiceAttributeOptionCollection.js +10 -3
  40. package/lib/models/attributes/ChoiceAttributeOptionCollection.js.flow +16 -8
  41. package/lib/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
  42. package/lib/models/concepts/ConceptDetailModel.js +7 -0
  43. package/lib/models/concepts/ConceptDetailModel.js.flow +8 -0
  44. package/lib/models/concepts/ConceptDetailModel.js.map +1 -1
  45. package/lib/models/form/FormModel.js +22 -2
  46. package/lib/models/form/FormModel.js.flow +25 -5
  47. package/lib/models/form/FormModel.js.map +1 -1
  48. package/lib/models/form/FormObjectModel.js +9 -1
  49. package/lib/models/form/FormObjectModel.js.flow +9 -1
  50. package/lib/models/form/FormObjectModel.js.map +1 -1
  51. package/lib/modularui/ModularUIRequest.js +1 -1
  52. package/lib/modularui/ModularUIRequest.js.flow +1 -1
  53. package/lib/modularui/ModularUIRequest.js.map +1 -1
  54. package/lib/redux/_modularui/ModularUIActions.js +4 -10
  55. package/lib/redux/_modularui/ModularUIActions.js.flow +8 -16
  56. package/lib/redux/_modularui/ModularUIActions.js.map +1 -1
  57. package/lib/redux/actions/FormAttributeSet.js +22 -6
  58. package/lib/redux/actions/FormAttributeSet.js.flow +36 -11
  59. package/lib/redux/actions/FormAttributeSet.js.map +1 -1
  60. package/lib/redux/actions/FormAutosubmit.js +10 -1
  61. package/lib/redux/actions/FormAutosubmit.js.flow +10 -3
  62. package/lib/redux/actions/FormAutosubmit.js.map +1 -1
  63. package/lib/redux/actions/FormAutoupdate.js +37 -0
  64. package/lib/redux/actions/FormAutoupdate.js.flow +43 -0
  65. package/lib/redux/actions/FormAutoupdate.js.map +1 -0
  66. package/lib/redux/connectors/FormAttributeSet.js +3 -2
  67. package/lib/redux/connectors/FormAttributeSet.js.flow +4 -2
  68. package/lib/redux/connectors/FormAttributeSet.js.map +1 -1
  69. package/lib/redux/types.js.flow +1 -0
  70. package/lib/redux/types.js.map +1 -1
  71. package/lib/utils/fetch/types.js.flow +2 -1
  72. package/lib/utils/fetch/types.js.map +1 -1
  73. package/package.json +1 -1
  74. package/src/hooks/useForm.js +22 -7
  75. package/src/models/attributes/AttributeModel.js +2 -1
  76. package/src/models/attributes/ChoiceAttributeModel.js +23 -2
  77. package/src/models/attributes/ChoiceAttributeOptionCollection.js +16 -8
  78. package/src/models/concepts/ConceptDetailModel.js +8 -0
  79. package/src/models/form/FormModel.js +25 -5
  80. package/src/models/form/FormObjectModel.js +9 -1
  81. package/src/modularui/ModularUIRequest.js +1 -1
  82. package/src/redux/_modularui/ModularUIActions.js +8 -16
  83. package/src/redux/actions/FormAttributeSet.js +36 -11
  84. package/src/redux/actions/FormAutosubmit.js +10 -3
  85. package/src/redux/actions/FormAutoupdate.js +43 -0
  86. package/src/redux/connectors/FormAttributeSet.js +4 -2
  87. package/src/redux/types.js +1 -0
  88. package/src/utils/fetch/types.js +2 -1
  89. package/types/hooks/useI18n.d.ts +1 -1
  90. package/types/models/application/ApplicationModel.d.ts +7 -0
  91. package/types/models/attributes/AttributeModel.d.ts +4 -3
  92. package/types/models/attributes/ChoiceAttributeModel.d.ts +4 -0
  93. package/types/models/attributes/ChoiceAttributeOptionCollection.d.ts +1 -1
  94. package/types/models/attributes/ChoiceAttributeOptionModel.d.ts +2 -1
  95. package/types/models/attributes/input-constraints/ConstraintModel.d.ts +1 -1
  96. package/types/models/base/ResourceCollection.d.ts +2 -1
  97. package/types/models/base/ResourceModel.d.ts +3 -2
  98. package/types/models/concepts/BusinessScenarioModel.d.ts +1 -1
  99. package/types/models/concepts/ConceptRelationModel.d.ts +19 -4
  100. package/types/models/content/ContentModel.d.ts +4 -0
  101. package/types/models/content/ContentTOCModel.d.ts +4 -0
  102. package/types/models/form/FormModel.d.ts +7 -1
  103. package/types/models/form/FormObjectModel.d.ts +11 -2
  104. package/types/models/links/normalizeLinkJSON.d.ts +2 -2
  105. package/types/models/list/ListModel.d.ts +4 -0
  106. package/types/models/panels/GroupingPanelModel.d.ts +4 -0
  107. package/types/models/tab/TabModel.d.ts +4 -0
  108. package/types/models/types.d.ts +2 -1
  109. package/types/models/user/UserServicesModel.d.ts +7 -0
  110. package/types/redux/types.d.ts +1 -0
  111. package/types/utils/fetch/types.d.ts +2 -1
@@ -4,8 +4,9 @@ import { addRepeatableAttributeSet, cancelRepeatableAttributeSet, removeRepeatab
4
4
  const mapDispatchToProps = (dispatch, ownProps) => ({
5
5
  onAttributeChange: function (attribute, value) {
6
6
  let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
7
- autosubmit: ownProps.autosubmit || false,
8
- autosave: ownProps.autosave || false
7
+ autosubmit: ownProps.autosubmit ?? false,
8
+ autosave: ownProps.autosave ?? false,
9
+ autoupdate: ownProps.autoupdate ?? false
9
10
  };
10
11
  return dispatch(updateFormAttribute(ownProps.form, ownProps.object, attribute, value, options));
11
12
  },
@@ -1 +1 @@
1
- {"version":3,"file":"FormAttributeSet.js","names":["connect","updateFormAttribute","addRepeatableAttributeSet","cancelRepeatableAttributeSet","removeRepeatableAttributeSet","mapDispatchToProps","dispatch","ownProps","onAttributeChange","attribute","value","options","arguments","length","undefined","autosubmit","autosave","form","object","onAddAttributeSetClick","onCancelAttributeSetClick","formObject","onRemoveAttributeSetClick","connectFormAttributeSet"],"sources":["../../../src/redux/connectors/FormAttributeSet.js"],"sourcesContent":["// @flow\nimport { connect } from \"react-redux\";\n\nimport { updateFormAttribute } from \"../actions/FormAttributeSet\";\nimport {\n addRepeatableAttributeSet,\n cancelRepeatableAttributeSet,\n removeRepeatableAttributeSet,\n} from \"../actions/FormAttributeSetRepeatable\";\n\nimport type { ThunkAction, UpdateFormOptions } from \"../types\";\nimport type { UpdateFormAction } from \"../_modularui/types\";\nimport type { AttributeType } from \"../../models/types\";\nimport type FormModel from \"../../models/form/FormModel\";\nimport type FormObjectModel from \"../../models/form/FormObjectModel\";\nimport type { DispatchAPI } from \"redux\";\nimport type { ComponentType } from \"react\";\n\ntype Dispatch = DispatchAPI<UpdateFormAction> & DispatchAPI<ThunkAction>;\n\ntype OwnProps = {\n form: FormModel,\n object: FormObjectModel,\n formLayout?: \"vertical\" | \"horizontal\" | \"compact\",\n autosubmit?: boolean,\n autosave?: boolean,\n};\n\ntype DispatchProps = {\n onAttributeChange: (\n attribute: AttributeType,\n value: string,\n options: UpdateFormOptions,\n ) => ThunkAction,\n onAddAttributeSetClick: () => UpdateFormAction,\n onCancelAttributeSetClick: (formObject: FormObjectModel) => UpdateFormAction,\n onRemoveAttributeSetClick: (formObject: FormObjectModel) => UpdateFormAction,\n};\n\ntype Props = {\n ...OwnProps,\n ...DispatchProps,\n};\n\nconst mapDispatchToProps = (\n dispatch: Dispatch,\n ownProps: OwnProps,\n): DispatchProps => ({\n onAttributeChange: (\n attribute: AttributeType,\n value: string,\n options: UpdateFormOptions = {\n autosubmit: ownProps.autosubmit || false,\n autosave: ownProps.autosave || false,\n },\n ) =>\n dispatch(\n updateFormAttribute(\n ownProps.form,\n ownProps.object,\n attribute,\n value,\n options,\n ),\n ),\n onAddAttributeSetClick: () =>\n dispatch(addRepeatableAttributeSet(ownProps.form)),\n onCancelAttributeSetClick: (formObject: FormObjectModel) =>\n dispatch(cancelRepeatableAttributeSet(ownProps.form, formObject)),\n onRemoveAttributeSetClick: (formObject: FormObjectModel) =>\n dispatch(removeRepeatableAttributeSet(ownProps.form, formObject)),\n});\n\n/**\n */\nexport const connectFormAttributeSet: ComponentType<any> = connect<\n Props,\n OwnProps,\n _,\n DispatchProps,\n _,\n _,\n>(null, mapDispatchToProps);\n"],"mappings":"AACA,SAASA,OAAO,QAAQ,aAAa;AAErC,SAASC,mBAAmB,QAAQ,6BAA6B;AACjE,SACEC,yBAAyB,EACzBC,4BAA4B,EAC5BC,4BAA4B,QACvB,uCAAuC;AAoC9C,MAAMC,kBAAkB,GAAGA,CACzBC,QAAkB,EAClBC,QAAkB,MACC;EACnBC,iBAAiB,EAAE,SAAAA,CACjBC,SAAwB,EACxBC,KAAa;IAAA,IACbC,OAA0B,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG;MAC3BG,UAAU,EAAER,QAAQ,CAACQ,UAAU,IAAI,KAAK;MACxCC,QAAQ,EAAET,QAAQ,CAACS,QAAQ,IAAI;IACjC,CAAC;IAAA,OAEDV,QAAQ,CACNL,mBAAmB,CACjBM,QAAQ,CAACU,IAAI,EACbV,QAAQ,CAACW,MAAM,EACfT,SAAS,EACTC,KAAK,EACLC,OACF,CACF,CAAC;EAAA;EACHQ,sBAAsB,EAAEA,CAAA,KACtBb,QAAQ,CAACJ,yBAAyB,CAACK,QAAQ,CAACU,IAAI,CAAC,CAAC;EACpDG,yBAAyB,EAAGC,UAA2B,IACrDf,QAAQ,CAACH,4BAA4B,CAACI,QAAQ,CAACU,IAAI,EAAEI,UAAU,CAAC,CAAC;EACnEC,yBAAyB,EAAGD,UAA2B,IACrDf,QAAQ,CAACF,4BAA4B,CAACG,QAAQ,CAACU,IAAI,EAAEI,UAAU,CAAC;AACpE,CAAC,CAAC;;AAEF;AACA;AACA,OAAO,MAAME,uBAA2C,GAAGvB,OAAO,CAOhE,IAAI,EAAEK,kBAAkB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"FormAttributeSet.js","names":["connect","updateFormAttribute","addRepeatableAttributeSet","cancelRepeatableAttributeSet","removeRepeatableAttributeSet","mapDispatchToProps","dispatch","ownProps","onAttributeChange","attribute","value","options","arguments","length","undefined","autosubmit","autosave","autoupdate","form","object","onAddAttributeSetClick","onCancelAttributeSetClick","formObject","onRemoveAttributeSetClick","connectFormAttributeSet"],"sources":["../../../src/redux/connectors/FormAttributeSet.js"],"sourcesContent":["// @flow\nimport { connect } from \"react-redux\";\n\nimport { updateFormAttribute } from \"../actions/FormAttributeSet\";\nimport {\n addRepeatableAttributeSet,\n cancelRepeatableAttributeSet,\n removeRepeatableAttributeSet,\n} from \"../actions/FormAttributeSetRepeatable\";\n\nimport type { ThunkAction, UpdateFormOptions } from \"../types\";\nimport type { UpdateFormAction } from \"../_modularui/types\";\nimport type { AttributeType } from \"../../models/types\";\nimport type FormModel from \"../../models/form/FormModel\";\nimport type FormObjectModel from \"../../models/form/FormObjectModel\";\nimport type { DispatchAPI } from \"redux\";\nimport type { ComponentType } from \"react\";\n\ntype Dispatch = DispatchAPI<UpdateFormAction> & DispatchAPI<ThunkAction>;\n\ntype OwnProps = {\n form: FormModel,\n object: FormObjectModel,\n formLayout?: \"vertical\" | \"horizontal\" | \"compact\",\n autosubmit?: boolean,\n autosave?: boolean,\n autoupdate?: boolean,\n};\n\ntype DispatchProps = {\n onAttributeChange: (\n attribute: AttributeType,\n value: string,\n options: UpdateFormOptions,\n ) => ThunkAction,\n onAddAttributeSetClick: () => UpdateFormAction,\n onCancelAttributeSetClick: (formObject: FormObjectModel) => UpdateFormAction,\n onRemoveAttributeSetClick: (formObject: FormObjectModel) => UpdateFormAction,\n};\n\ntype Props = {\n ...OwnProps,\n ...DispatchProps,\n};\n\nconst mapDispatchToProps = (\n dispatch: Dispatch,\n ownProps: OwnProps,\n): DispatchProps => ({\n onAttributeChange: (\n attribute: AttributeType,\n value: string,\n options: UpdateFormOptions = {\n autosubmit: ownProps.autosubmit ?? false,\n autosave: ownProps.autosave ?? false,\n autoupdate: ownProps.autoupdate ?? false,\n },\n ) =>\n dispatch(\n updateFormAttribute(\n ownProps.form,\n ownProps.object,\n attribute,\n value,\n options,\n ),\n ),\n onAddAttributeSetClick: () =>\n dispatch(addRepeatableAttributeSet(ownProps.form)),\n onCancelAttributeSetClick: (formObject: FormObjectModel) =>\n dispatch(cancelRepeatableAttributeSet(ownProps.form, formObject)),\n onRemoveAttributeSetClick: (formObject: FormObjectModel) =>\n dispatch(removeRepeatableAttributeSet(ownProps.form, formObject)),\n});\n\n/**\n */\nexport const connectFormAttributeSet: ComponentType<any> = connect<\n Props,\n OwnProps,\n _,\n DispatchProps,\n _,\n _,\n>(null, mapDispatchToProps);\n"],"mappings":"AACA,SAASA,OAAO,QAAQ,aAAa;AAErC,SAASC,mBAAmB,QAAQ,6BAA6B;AACjE,SACEC,yBAAyB,EACzBC,4BAA4B,EAC5BC,4BAA4B,QACvB,uCAAuC;AAqC9C,MAAMC,kBAAkB,GAAGA,CACzBC,QAAkB,EAClBC,QAAkB,MACC;EACnBC,iBAAiB,EAAE,SAAAA,CACjBC,SAAwB,EACxBC,KAAa;IAAA,IACbC,OAA0B,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG;MAC3BG,UAAU,EAAER,QAAQ,CAACQ,UAAU,IAAI,KAAK;MACxCC,QAAQ,EAAET,QAAQ,CAACS,QAAQ,IAAI,KAAK;MACpCC,UAAU,EAAEV,QAAQ,CAACU,UAAU,IAAI;IACrC,CAAC;IAAA,OAEDX,QAAQ,CACNL,mBAAmB,CACjBM,QAAQ,CAACW,IAAI,EACbX,QAAQ,CAACY,MAAM,EACfV,SAAS,EACTC,KAAK,EACLC,OACF,CACF,CAAC;EAAA;EACHS,sBAAsB,EAAEA,CAAA,KACtBd,QAAQ,CAACJ,yBAAyB,CAACK,QAAQ,CAACW,IAAI,CAAC,CAAC;EACpDG,yBAAyB,EAAGC,UAA2B,IACrDhB,QAAQ,CAACH,4BAA4B,CAACI,QAAQ,CAACW,IAAI,EAAEI,UAAU,CAAC,CAAC;EACnEC,yBAAyB,EAAGD,UAA2B,IACrDhB,QAAQ,CAACF,4BAA4B,CAACG,QAAQ,CAACW,IAAI,EAAEI,UAAU,CAAC;AACpE,CAAC,CAAC;;AAEF;AACA;AACA,OAAO,MAAME,uBAA2C,GAAGxB,OAAO,CAOhE,IAAI,EAAEK,kBAAkB,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../src/redux/types.js"],"sourcesContent":["// @flow\nimport type { Store, DispatchAPI } from \"redux\";\n\nimport type ErrorResponse from \"../models/error/ErrorResponse\";\n\nimport type FormModel from \"../models/form/FormModel\";\nimport typeof {\n NOTIFICATION_TYPES,\n AUTOSAVE_STATUS,\n} from \"../constants/Constants\";\n\nimport type { MessageObject } from \"../i18n/types\";\nimport type {\n I18nState,\n UpdateLocaleAction,\n SetLocalesAction,\n} from \"./_i18n/types\";\nimport type {\n ModularUIState,\n ModularUIAction,\n UpdateStatusAction,\n SetModelAction,\n UpdateModelAction,\n UpdateFormAction,\n RemoveModelByKeyAction,\n ResetModularUIAction,\n InitModelAction,\n} from \"./_modularui/types\";\nimport type {\n RouterState,\n LocationChangeAction,\n PushAction,\n ReplaceAction,\n GoAction,\n GoBackAction,\n GoForwardAction,\n} from \"./_router/types\";\n\nexport type PreferenceValue =\n | null\n | string\n | boolean\n | { [key: string]: any }\n | Array<PreferenceValue>;\n\nexport type UpdateFormOptions = {\n autosubmit: boolean,\n autosave: boolean,\n forceUpdate?: boolean,\n /** Default true: Activate/deactivate the form object validate by an update */\n validate?: boolean,\n};\n\nexport type NoAction = {\n type: \"NO_ACTION\",\n};\n\nexport type SaveErrorAction = {\n type: \"SAVE_ERROR\",\n payload: ErrorResponse,\n};\n\nexport type ShowModalAction = {\n type: \"SHOW_MODAL\",\n payload: string,\n};\n\nexport type CloseModalAction = {\n type: \"CLOSE_MODAL\",\n payload: string,\n};\n\nexport type DismissNotificationAction = {\n type: \"DISMISS_NOTIFICATION\",\n};\nexport type ShowNotificationAction = {\n type: \"SHOW_NOTIFICATION\",\n payload: {\n type: $Keys<NOTIFICATION_TYPES>,\n message: MessageObject,\n error: ?ErrorResponse,\n },\n};\n\nexport type SetPreferenceAction = {\n type: \"SET_PREFERENCE\",\n payload: { [name: string]: PreferenceValue },\n};\nexport type SetPreferencesAction = {\n type: \"SET_PREFERENCES\",\n payload: { [name: string]: PreferenceValue },\n};\n\nexport type StartProgressAction = {\n type: \"START_PROGRESS\",\n};\nexport type FinishProgressAction = {\n type: \"FINISH_PROGRESS\",\n};\nexport type ResetProgressAction = {\n type: \"RESET_PROGRESS\",\n};\nexport type UpdateProgressAction = {\n type: \"UPDATE_PROGRESS\",\n payload: { percentComplete: number },\n};\n\nexport type SendAuthenticationErrorAction = {\n type: \"AUTHENTICATION_ERROR\",\n payload: string,\n};\n\nexport type ResetAuthErrorsAction = {\n type: \"AUTHENTICATION_RESET_ERRORS\",\n};\n\nexport type LoginSuccessAction = {\n type: \"AUTHENTICATION_SUCCESS\",\n};\n\nexport type ChangePasswordAction = {\n type: \"CHANGE_PASSWORD\",\n};\n\nexport type LogoutSuccessAction = {\n type: \"AUTHENTICATION_LOGOUT\",\n};\n\nexport type UpdateAutosaveAction = {\n type: \"UPDATE_AUTOSAVE_STATUS\",\n payload: {\n status: $Keys<AUTOSAVE_STATUS>,\n model: FormModel,\n },\n};\n\nexport type ReduxAction =\n | UpdateStatusAction\n | SetModelAction\n | InitModelAction\n | UpdateModelAction\n | UpdateFormAction\n | RemoveModelByKeyAction\n | ResetModularUIAction\n | SaveErrorAction\n | UpdateLocaleAction\n | SetLocalesAction\n | ShowModalAction\n | CloseModalAction\n | DismissNotificationAction\n | ShowNotificationAction\n | SetPreferenceAction\n | SetPreferencesAction\n | StartProgressAction\n | FinishProgressAction\n | ResetProgressAction\n | UpdateProgressAction\n | ResetAuthErrorsAction\n | SendAuthenticationErrorAction\n | LoginSuccessAction\n | ChangePasswordAction\n | LogoutSuccessAction\n | UpdateAutosaveAction\n | LocationChangeAction\n | PushAction\n | ReplaceAction\n | GoAction\n | GoBackAction\n | GoForwardAction\n | ModularUIAction\n | NoAction;\n\n// Redux state\nexport type AuthState = {\n +mustChangePassword: boolean,\n +error: ?string,\n};\n\nexport type ErrorState = null | ErrorResponse;\n\nexport type ModalState = {\n +key: string,\n +visible: boolean,\n +size?: string,\n};\n\nexport type ModalsState = {\n +modals: Array<ModalState>,\n};\n\nexport type NotificationState = {\n +render: boolean,\n +messageType: string | null,\n +message: MessageObject | null,\n +error: ?ErrorResponse | null,\n};\n\nexport type PreferencesState = {\n +[name: string]: PreferenceValue,\n};\n\nexport type ProgressIndicatorState = {\n +count: number,\n +timestamp: number,\n +percentComplete: number,\n};\n\nexport type ReduxState = {\n +router: RouterState,\n +modularui: ModularUIState,\n +i18n: I18nState,\n +auth: AuthState,\n +error: ErrorState,\n +modals: ModalsState,\n +notification: NotificationState,\n +progressindicator: ProgressIndicatorState,\n +preferences: PreferencesState,\n ...\n};\n\nexport type GetState = () => ReduxState;\nexport type ThunkAction = (dispatch: Dispatch, getState: GetState) => any;\nexport type PromiseAction = Promise<PossibleAction>;\nexport type Dispatch = DispatchAPI<PossibleAction>;\nexport type ReduxStore = Store<ReduxState, ReduxAction, Dispatch>;\n\nexport type PossibleAction = ReduxAction | ThunkAction | PromiseAction;\n\nexport type CustomReducers = { [reducerKey: string]: any };\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/redux/types.js"],"sourcesContent":["// @flow\nimport type { Store, DispatchAPI } from \"redux\";\n\nimport type ErrorResponse from \"../models/error/ErrorResponse\";\n\nimport type FormModel from \"../models/form/FormModel\";\nimport typeof {\n NOTIFICATION_TYPES,\n AUTOSAVE_STATUS,\n} from \"../constants/Constants\";\n\nimport type { MessageObject } from \"../i18n/types\";\nimport type {\n I18nState,\n UpdateLocaleAction,\n SetLocalesAction,\n} from \"./_i18n/types\";\nimport type {\n ModularUIState,\n ModularUIAction,\n UpdateStatusAction,\n SetModelAction,\n UpdateModelAction,\n UpdateFormAction,\n RemoveModelByKeyAction,\n ResetModularUIAction,\n InitModelAction,\n} from \"./_modularui/types\";\nimport type {\n RouterState,\n LocationChangeAction,\n PushAction,\n ReplaceAction,\n GoAction,\n GoBackAction,\n GoForwardAction,\n} from \"./_router/types\";\n\nexport type PreferenceValue =\n | null\n | string\n | boolean\n | { [key: string]: any }\n | Array<PreferenceValue>;\n\nexport type UpdateFormOptions = {\n autosubmit: boolean,\n autosave: boolean,\n autoupdate: boolean,\n forceUpdate?: boolean,\n /** Default true: Activate/deactivate the form object validate by an update */\n validate?: boolean,\n};\n\nexport type NoAction = {\n type: \"NO_ACTION\",\n};\n\nexport type SaveErrorAction = {\n type: \"SAVE_ERROR\",\n payload: ErrorResponse,\n};\n\nexport type ShowModalAction = {\n type: \"SHOW_MODAL\",\n payload: string,\n};\n\nexport type CloseModalAction = {\n type: \"CLOSE_MODAL\",\n payload: string,\n};\n\nexport type DismissNotificationAction = {\n type: \"DISMISS_NOTIFICATION\",\n};\nexport type ShowNotificationAction = {\n type: \"SHOW_NOTIFICATION\",\n payload: {\n type: $Keys<NOTIFICATION_TYPES>,\n message: MessageObject,\n error: ?ErrorResponse,\n },\n};\n\nexport type SetPreferenceAction = {\n type: \"SET_PREFERENCE\",\n payload: { [name: string]: PreferenceValue },\n};\nexport type SetPreferencesAction = {\n type: \"SET_PREFERENCES\",\n payload: { [name: string]: PreferenceValue },\n};\n\nexport type StartProgressAction = {\n type: \"START_PROGRESS\",\n};\nexport type FinishProgressAction = {\n type: \"FINISH_PROGRESS\",\n};\nexport type ResetProgressAction = {\n type: \"RESET_PROGRESS\",\n};\nexport type UpdateProgressAction = {\n type: \"UPDATE_PROGRESS\",\n payload: { percentComplete: number },\n};\n\nexport type SendAuthenticationErrorAction = {\n type: \"AUTHENTICATION_ERROR\",\n payload: string,\n};\n\nexport type ResetAuthErrorsAction = {\n type: \"AUTHENTICATION_RESET_ERRORS\",\n};\n\nexport type LoginSuccessAction = {\n type: \"AUTHENTICATION_SUCCESS\",\n};\n\nexport type ChangePasswordAction = {\n type: \"CHANGE_PASSWORD\",\n};\n\nexport type LogoutSuccessAction = {\n type: \"AUTHENTICATION_LOGOUT\",\n};\n\nexport type UpdateAutosaveAction = {\n type: \"UPDATE_AUTOSAVE_STATUS\",\n payload: {\n status: $Keys<AUTOSAVE_STATUS>,\n model: FormModel,\n },\n};\n\nexport type ReduxAction =\n | UpdateStatusAction\n | SetModelAction\n | InitModelAction\n | UpdateModelAction\n | UpdateFormAction\n | RemoveModelByKeyAction\n | ResetModularUIAction\n | SaveErrorAction\n | UpdateLocaleAction\n | SetLocalesAction\n | ShowModalAction\n | CloseModalAction\n | DismissNotificationAction\n | ShowNotificationAction\n | SetPreferenceAction\n | SetPreferencesAction\n | StartProgressAction\n | FinishProgressAction\n | ResetProgressAction\n | UpdateProgressAction\n | ResetAuthErrorsAction\n | SendAuthenticationErrorAction\n | LoginSuccessAction\n | ChangePasswordAction\n | LogoutSuccessAction\n | UpdateAutosaveAction\n | LocationChangeAction\n | PushAction\n | ReplaceAction\n | GoAction\n | GoBackAction\n | GoForwardAction\n | ModularUIAction\n | NoAction;\n\n// Redux state\nexport type AuthState = {\n +mustChangePassword: boolean,\n +error: ?string,\n};\n\nexport type ErrorState = null | ErrorResponse;\n\nexport type ModalState = {\n +key: string,\n +visible: boolean,\n +size?: string,\n};\n\nexport type ModalsState = {\n +modals: Array<ModalState>,\n};\n\nexport type NotificationState = {\n +render: boolean,\n +messageType: string | null,\n +message: MessageObject | null,\n +error: ?ErrorResponse | null,\n};\n\nexport type PreferencesState = {\n +[name: string]: PreferenceValue,\n};\n\nexport type ProgressIndicatorState = {\n +count: number,\n +timestamp: number,\n +percentComplete: number,\n};\n\nexport type ReduxState = {\n +router: RouterState,\n +modularui: ModularUIState,\n +i18n: I18nState,\n +auth: AuthState,\n +error: ErrorState,\n +modals: ModalsState,\n +notification: NotificationState,\n +progressindicator: ProgressIndicatorState,\n +preferences: PreferencesState,\n ...\n};\n\nexport type GetState = () => ReduxState;\nexport type ThunkAction = (dispatch: Dispatch, getState: GetState) => any;\nexport type PromiseAction = Promise<PossibleAction>;\nexport type Dispatch = DispatchAPI<PossibleAction>;\nexport type ReduxStore = Store<ReduxState, ReduxAction, Dispatch>;\n\nexport type PossibleAction = ReduxAction | ThunkAction | PromiseAction;\n\nexport type CustomReducers = { [reducerKey: string]: any };\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../src/utils/fetch/types.js"],"sourcesContent":["// @flow\nimport typeof { HTTP_METHODS } from \"../../constants/Constants\";\nimport type { ModularUIModel } from \"../../models/types\";\nimport type { TargetModel } from \"../../modularui/types\";\n\nexport type RequestURLOptions = {\n url: string,\n};\n\nexport type RequestBaseOptions = {\n method?: $Keys<HTTP_METHODS>,\n params?: string,\n data?: any,\n timeout?: number,\n responseType?: string,\n headers?: {\n [headerName: string]: string,\n Accept?: string,\n \"Accept-Language\"?: string,\n \"Content-Type\"?: string,\n \"x-filename\"?: string,\n \"x-filesize\"?: string,\n },\n events?: { [eventName: string]: () => void },\n onProgress?: ProgressEventHandler,\n includeContext?: boolean,\n locale?: string,\n cache?: boolean,\n isReload?: boolean,\n};\n\nexport type RequestOptions = { ...RequestURLOptions, ...RequestBaseOptions };\n\nexport type RequestModularUIOptions = {\n ...RequestBaseOptions,\n targetModel?: TargetModel,\n forceTargetModel?: boolean,\n updateModel?: ModularUIModel,\n childmodels?: boolean,\n isValidationRequest?: boolean,\n removeOnUnmount?: boolean,\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../src/utils/fetch/types.js"],"sourcesContent":["// @flow\nimport typeof { HTTP_METHODS } from \"../../constants/Constants\";\nimport type { ModularUIModel } from \"../../models/types\";\nimport type { TargetModel } from \"../../modularui/types\";\n\nexport type RequestURLOptions = {\n url: string,\n};\n\nexport type RequestBaseOptions = {\n method?: $Keys<HTTP_METHODS>,\n params?: string,\n data?: any,\n timeout?: number,\n responseType?: string,\n headers?: {\n [headerName: string]: string,\n Accept?: string,\n \"Accept-Language\"?: string,\n \"Content-Type\"?: string,\n \"x-filename\"?: string,\n \"x-filesize\"?: string,\n },\n events?: { [eventName: string]: () => void },\n onProgress?: ProgressEventHandler,\n includeContext?: boolean,\n locale?: string,\n cache?: boolean,\n isReload?: boolean,\n};\n\nexport type RequestOptions = { ...RequestURLOptions, ...RequestBaseOptions };\n\nexport type UpdateHandler = (newModel: ModularUIModel) => ModularUIModel;\nexport type RequestModularUIOptions = {\n ...RequestBaseOptions,\n targetModel?: TargetModel,\n forceTargetModel?: boolean,\n updateHandler?: UpdateHandler | void,\n childmodels?: boolean,\n isValidationRequest?: boolean,\n removeOnUnmount?: boolean,\n};\n"],"mappings":"","ignoreList":[]}
@@ -42,7 +42,14 @@ const useFormNavigation = () => {
42
42
  const submit = form => dispatch((0, _modularui.loadModularUI)(form.connectKey, form.selfhref, {
43
43
  method: _constants.HTTP_METHODS.POST,
44
44
  data: form.formdata,
45
- updateModel: form,
45
+ updateHandler: newModel => {
46
+ if (newModel instanceof _FormModel.default) {
47
+ const clonedModel = form.clone();
48
+ clonedModel.update(newModel);
49
+ return clonedModel;
50
+ }
51
+ return newModel;
52
+ },
46
53
  targetModel: _FormModel.default
47
54
  }));
48
55
  const remove = form => dispatch((0, _modularui.removeModelByKey)(form.connectKey));
@@ -57,7 +64,15 @@ const useFormNavigation = () => {
57
64
  };
58
65
 
59
66
  /**
60
- * Update attributes of a form
67
+ * Hook that returns a function to update attributes of a form object.
68
+ * <br >
69
+ * The returned function accepts the following options:
70
+ *
71
+ * - autosubmit: Automatically submit the form after a change
72
+ * - autosav: Automatically save the form (in the background) after a change
73
+ * - autoupdate: Automatically update the current form object after a change
74
+ * - forceUpdate: Force the update even if conditions are not met.
75
+ * - validate: Activate/deactivate the form object validation by an update.
61
76
  */
62
77
  exports.useFormNavigation = useFormNavigation;
63
78
  const useAttributeUpdate = (form, object) => {
@@ -5,6 +5,10 @@ import Href from "../models/href/Href";
5
5
 
6
6
  import { getSetting, HTTP_METHODS } from "../constants";
7
7
 
8
+ import type {
9
+ RemoveModelByKeyAction,
10
+ UpdateFormAction,
11
+ } from "../redux/_modularui";
8
12
  import { loadModularUI, removeModelByKey } from "../redux/_modularui";
9
13
  import { useModularUI } from "./useModularUI";
10
14
 
@@ -20,12 +24,8 @@ import {
20
24
 
21
25
  import FormModel from "../models/form/FormModel";
22
26
 
23
- import type { FormObjectModel, AttributeType } from "../models";
27
+ import type { AttributeType, FormObjectModel, ModularUIModel } from "../models";
24
28
  import type { UpdateFormOptions } from "../redux/types";
25
- import type {
26
- RemoveModelByKeyAction,
27
- UpdateFormAction,
28
- } from "../redux/_modularui";
29
29
 
30
30
  type FormNavigationHook = {
31
31
  previous: (form: FormModel) => UpdateFormAction,
@@ -84,7 +84,14 @@ export const useFormNavigation = (): FormNavigationHook => {
84
84
  loadModularUI(form.connectKey, form.selfhref, {
85
85
  method: HTTP_METHODS.POST,
86
86
  data: form.formdata,
87
- updateModel: form,
87
+ updateHandler: (newModel: ModularUIModel): ModularUIModel => {
88
+ if (newModel instanceof FormModel) {
89
+ const clonedModel: FormModel = form.clone();
90
+ clonedModel.update(newModel);
91
+ return clonedModel;
92
+ }
93
+ return newModel;
94
+ },
88
95
  targetModel: FormModel,
89
96
  }),
90
97
  );
@@ -105,7 +112,15 @@ export const useFormNavigation = (): FormNavigationHook => {
105
112
  };
106
113
 
107
114
  /**
108
- * Update attributes of a form
115
+ * Hook that returns a function to update attributes of a form object.
116
+ * <br >
117
+ * The returned function accepts the following options:
118
+ *
119
+ * - autosubmit: Automatically submit the form after a change
120
+ * - autosav: Automatically save the form (in the background) after a change
121
+ * - autoupdate: Automatically update the current form object after a change
122
+ * - forceUpdate: Force the update even if conditions are not met.
123
+ * - validate: Activate/deactivate the form object validation by an update.
109
124
  */
110
125
  export const useAttributeUpdate = (
111
126
  form: FormModel,
@@ -1 +1 @@
1
- {"version":3,"file":"useForm.js","names":["_reactRedux","require","_Href","_interopRequireDefault","_constants","_modularui","_useModularUI","_actions","_FormModel","useForm","href","data","formHref","Href","getSetting","addParameter","form","useModularUI","method","HTTP_METHODS","POST","targetModel","FormModel","removeOnUnmount","model","exports","useFormNavigation","dispatch","useDispatch","previous","previousObject","cancel","cancelForm","submit","loadModularUI","connectKey","selfhref","formdata","updateModel","remove","removeModelByKey","showFormNotificationAction","showFormNotification","useAttributeUpdate","object","attribute","value","options","updateFormAttribute","useAttributeSet","save","addRepeatableAttributeSet","cancelRepeatableAttributeSet","removeRepeatableAttributeSet"],"sources":["../../src/hooks/useForm.js"],"sourcesContent":["// @flow\nimport { useDispatch } from \"react-redux\";\n\nimport Href from \"../models/href/Href\";\n\nimport { getSetting, HTTP_METHODS } from \"../constants\";\n\nimport { loadModularUI, removeModelByKey } from \"../redux/_modularui\";\nimport { useModularUI } from \"./useModularUI\";\n\nimport {\n addRepeatableAttributeSet,\n cancelForm,\n cancelRepeatableAttributeSet,\n previousObject,\n removeRepeatableAttributeSet,\n showFormNotification,\n updateFormAttribute,\n} from \"../redux/actions\";\n\nimport FormModel from \"../models/form/FormModel\";\n\nimport type { FormObjectModel, AttributeType } from \"../models\";\nimport type { UpdateFormOptions } from \"../redux/types\";\nimport type {\n RemoveModelByKeyAction,\n UpdateFormAction,\n} from \"../redux/_modularui\";\n\ntype FormNavigationHook = {\n previous: (form: FormModel) => UpdateFormAction,\n cancel: (form: FormModel) => void,\n submit: (form: FormModel) => void,\n showFormNotification: (form: FormModel) => void,\n remove: (form: FormModel) => RemoveModelByKeyAction,\n};\n\ntype AttributeSetHook = {\n save: () => UpdateFormAction,\n cancel: (object: FormObjectModel) => UpdateFormAction,\n remove: (object: FormObjectModel) => UpdateFormAction,\n};\n\ntype AttributeUpdateHook = (\n attribute: AttributeType,\n value: string,\n options: UpdateFormOptions,\n) => void;\n\n/**\n * Load a form by href\n */\nexport const useForm = (href: string | Href, data?: Object): ?FormModel => {\n const formHref = new Href(href);\n\n if (!getSetting(\"ALWAYS_COMMIT_FORM\")) {\n formHref.addParameter(\"commit\", \"false\");\n }\n\n const form = useModularUI(\"form\", formHref, {\n method: HTTP_METHODS.POST,\n targetModel: FormModel,\n removeOnUnmount: true,\n data,\n });\n\n if (form?.model) {\n return form.model;\n }\n};\n\n/**\n * Form navigation methods\n */\nexport const useFormNavigation = (): FormNavigationHook => {\n const dispatch = useDispatch();\n\n const previous = (form: FormModel) => dispatch(previousObject(form));\n\n const cancel = (form: FormModel) => dispatch(cancelForm(form));\n\n const submit = (form: FormModel) =>\n dispatch(\n loadModularUI(form.connectKey, form.selfhref, {\n method: HTTP_METHODS.POST,\n data: form.formdata,\n updateModel: form,\n targetModel: FormModel,\n }),\n );\n\n const remove = (form: FormModel) =>\n dispatch(removeModelByKey(form.connectKey));\n\n const showFormNotificationAction = (form: FormModel) =>\n dispatch(showFormNotification(form));\n\n return {\n previous,\n cancel,\n submit,\n remove,\n showFormNotification: showFormNotificationAction,\n };\n};\n\n/**\n * Update attributes of a form\n */\nexport const useAttributeUpdate = (\n form: FormModel,\n object: FormObjectModel,\n): AttributeUpdateHook => {\n const dispatch = useDispatch();\n\n return (\n attribute: AttributeType,\n value: string,\n options: UpdateFormOptions,\n ) => dispatch(updateFormAttribute(form, object, attribute, value, options));\n};\n\n/**\n * Attributeset actions\n */\nexport const useAttributeSet = (form: FormModel): AttributeSetHook => {\n const dispatch = useDispatch();\n\n return {\n save: () => dispatch(addRepeatableAttributeSet(form)),\n cancel: (object: FormObjectModel) =>\n dispatch(cancelRepeatableAttributeSet(form, object)),\n remove: (object: FormObjectModel) =>\n dispatch(removeRepeatableAttributeSet(form, object)),\n };\n};\n"],"mappings":";;;;;;;AACA,IAAAA,WAAA,GAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,UAAA,GAAAH,OAAA;AAEA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AAEA,IAAAM,QAAA,GAAAN,OAAA;AAUA,IAAAO,UAAA,GAAAL,sBAAA,CAAAF,OAAA;AA6BA;AACA;AACA;AACO,MAAMQ,OAAO,GAAGA,CAACC,IAAmB,EAAEC,IAAa,KAA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,IAAe,IACjDW,QAAQ,CAAC,IAAAe,6BAAoB,EAAC1B,IAAI,CAAC,CAAC;EAEtC,OAAO;IACLa,QAAQ;IACRE,MAAM;IACNE,MAAM;IACNM,MAAM;IACNG,oBAAoB,EAAED;EACxB,CAAC;AACH,CAAC;;AAED;AACA;AACA;AAFAhB,OAAA,CAAAC,iBAAA,GAAAA,iBAAA;AAGO,MAAMiB,kBAAkB,GAAGA,CAChC3B,IAAe,EACf4B,MAAuB,KACC;EACxB,MAAMjB,QAAQ,GAAG,IAAAC,uBAAW,EAAC,CAAC;EAE9B,OAAO,CACLiB,SAAwB,EACxBC,KAAa,EACbC,OAA0B,KACvBpB,QAAQ,CAAC,IAAAqB,4BAAmB,EAAChC,IAAI,EAAE4B,MAAM,EAAEC,SAAS,EAAEC,KAAK,EAAEC,OAAO,CAAC,CAAC;AAC7E,CAAC;;AAED;AACA;AACA;AAFAtB,OAAA,CAAAkB,kBAAA,GAAAA,kBAAA;AAGO,MAAMM,eAAe,GAAIjC,IAAe,IAAuB;EACpE,MAAMW,QAAQ,GAAG,IAAAC,uBAAW,EAAC,CAAC;EAE9B,OAAO;IACLsB,IAAI,EAAEA,CAAA,KAAMvB,QAAQ,CAAC,IAAAwB,kCAAyB,EAACnC,IAAI,CAAC,CAAC;IACrDe,MAAM,EAAGa,MAAuB,IAC9BjB,QAAQ,CAAC,IAAAyB,qCAA4B,EAACpC,IAAI,EAAE4B,MAAM,CAAC,CAAC;IACtDL,MAAM,EAAGK,MAAuB,IAC9BjB,QAAQ,CAAC,IAAA0B,qCAA4B,EAACrC,IAAI,EAAE4B,MAAM,CAAC;EACvD,CAAC;AACH,CAAC;AAACnB,OAAA,CAAAwB,eAAA,GAAAA,eAAA","ignoreList":[]}
1
+ {"version":3,"file":"useForm.js","names":["_reactRedux","require","_Href","_interopRequireDefault","_constants","_modularui","_useModularUI","_actions","_FormModel","useForm","href","data","formHref","Href","getSetting","addParameter","form","useModularUI","method","HTTP_METHODS","POST","targetModel","FormModel","removeOnUnmount","model","exports","useFormNavigation","dispatch","useDispatch","previous","previousObject","cancel","cancelForm","submit","loadModularUI","connectKey","selfhref","formdata","updateHandler","newModel","clonedModel","clone","update","remove","removeModelByKey","showFormNotificationAction","showFormNotification","useAttributeUpdate","object","attribute","value","options","updateFormAttribute","useAttributeSet","save","addRepeatableAttributeSet","cancelRepeatableAttributeSet","removeRepeatableAttributeSet"],"sources":["../../src/hooks/useForm.js"],"sourcesContent":["// @flow\nimport { useDispatch } from \"react-redux\";\n\nimport Href from \"../models/href/Href\";\n\nimport { getSetting, HTTP_METHODS } from \"../constants\";\n\nimport type {\n RemoveModelByKeyAction,\n UpdateFormAction,\n} from \"../redux/_modularui\";\nimport { loadModularUI, removeModelByKey } from \"../redux/_modularui\";\nimport { useModularUI } from \"./useModularUI\";\n\nimport {\n addRepeatableAttributeSet,\n cancelForm,\n cancelRepeatableAttributeSet,\n previousObject,\n removeRepeatableAttributeSet,\n showFormNotification,\n updateFormAttribute,\n} from \"../redux/actions\";\n\nimport FormModel from \"../models/form/FormModel\";\n\nimport type { AttributeType, FormObjectModel, ModularUIModel } from \"../models\";\nimport type { UpdateFormOptions } from \"../redux/types\";\n\ntype FormNavigationHook = {\n previous: (form: FormModel) => UpdateFormAction,\n cancel: (form: FormModel) => void,\n submit: (form: FormModel) => void,\n showFormNotification: (form: FormModel) => void,\n remove: (form: FormModel) => RemoveModelByKeyAction,\n};\n\ntype AttributeSetHook = {\n save: () => UpdateFormAction,\n cancel: (object: FormObjectModel) => UpdateFormAction,\n remove: (object: FormObjectModel) => UpdateFormAction,\n};\n\ntype AttributeUpdateHook = (\n attribute: AttributeType,\n value: string,\n options: UpdateFormOptions,\n) => void;\n\n/**\n * Load a form by href\n */\nexport const useForm = (href: string | Href, data?: Object): ?FormModel => {\n const formHref = new Href(href);\n\n if (!getSetting(\"ALWAYS_COMMIT_FORM\")) {\n formHref.addParameter(\"commit\", \"false\");\n }\n\n const form = useModularUI(\"form\", formHref, {\n method: HTTP_METHODS.POST,\n targetModel: FormModel,\n removeOnUnmount: true,\n data,\n });\n\n if (form?.model) {\n return form.model;\n }\n};\n\n/**\n * Form navigation methods\n */\nexport const useFormNavigation = (): FormNavigationHook => {\n const dispatch = useDispatch();\n\n const previous = (form: FormModel) => dispatch(previousObject(form));\n\n const cancel = (form: FormModel) => dispatch(cancelForm(form));\n\n const submit = (form: FormModel) =>\n dispatch(\n loadModularUI(form.connectKey, form.selfhref, {\n method: HTTP_METHODS.POST,\n data: form.formdata,\n updateHandler: (newModel: ModularUIModel): ModularUIModel => {\n if (newModel instanceof FormModel) {\n const clonedModel: FormModel = form.clone();\n clonedModel.update(newModel);\n return clonedModel;\n }\n return newModel;\n },\n targetModel: FormModel,\n }),\n );\n\n const remove = (form: FormModel) =>\n dispatch(removeModelByKey(form.connectKey));\n\n const showFormNotificationAction = (form: FormModel) =>\n dispatch(showFormNotification(form));\n\n return {\n previous,\n cancel,\n submit,\n remove,\n showFormNotification: showFormNotificationAction,\n };\n};\n\n/**\n * Hook that returns a function to update attributes of a form object.\n * <br >\n * The returned function accepts the following options:\n *\n * - autosubmit: Automatically submit the form after a change\n * - autosav: Automatically save the form (in the background) after a change\n * - autoupdate: Automatically update the current form object after a change\n * - forceUpdate: Force the update even if conditions are not met.\n * - validate: Activate/deactivate the form object validation by an update.\n */\nexport const useAttributeUpdate = (\n form: FormModel,\n object: FormObjectModel,\n): AttributeUpdateHook => {\n const dispatch = useDispatch();\n\n return (\n attribute: AttributeType,\n value: string,\n options: UpdateFormOptions,\n ) => dispatch(updateFormAttribute(form, object, attribute, value, options));\n};\n\n/**\n * Attributeset actions\n */\nexport const useAttributeSet = (form: FormModel): AttributeSetHook => {\n const dispatch = useDispatch();\n\n return {\n save: () => dispatch(addRepeatableAttributeSet(form)),\n cancel: (object: FormObjectModel) =>\n dispatch(cancelRepeatableAttributeSet(form, object)),\n remove: (object: FormObjectModel) =>\n dispatch(removeRepeatableAttributeSet(form, object)),\n };\n};\n"],"mappings":";;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pE,MAAMW,QAAQ,GAAG,IAAAC,uBAAW,EAAC,CAAC;EAE9B,OAAO;IACL0B,IAAI,EAAEA,CAAA,KAAM3B,QAAQ,CAAC,IAAA4B,kCAAyB,EAACvC,IAAI,CAAC,CAAC;IACrDe,MAAM,EAAGiB,MAAuB,IAC9BrB,QAAQ,CAAC,IAAA6B,qCAA4B,EAACxC,IAAI,EAAEgC,MAAM,CAAC,CAAC;IACtDL,MAAM,EAAGK,MAAuB,IAC9BrB,QAAQ,CAAC,IAAA8B,qCAA4B,EAACzC,IAAI,EAAEgC,MAAM,CAAC;EACvD,CAAC;AACH,CAAC;AAACvB,OAAA,CAAA4B,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -617,7 +617,8 @@ class AttributeModel extends _BaseModel.default {
617
617
  /**
618
618
  * Registers a missing error that was received from the server
619
619
  */
620
- addMissingError() {
620
+ // eslint-disable-next-line no-unused-vars
621
+ addMissingError(receivedAttribute) {
621
622
  this._errorCollection.addServerError("Constraint.Missing");
622
623
  }
623
624
 
@@ -744,7 +744,8 @@ export default class AttributeModel
744
744
  /**
745
745
  * Registers a missing error that was received from the server
746
746
  */
747
- addMissingError(): void {
747
+ // eslint-disable-next-line no-unused-vars
748
+ addMissingError(receivedAttribute?: AttributeType): void {
748
749
  this._errorCollection.addServerError("Constraint.Missing");
749
750
  }
750
751
 
@@ -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","_links","LinkCollection","isApplicableModel","isPlainObject","IllegalArgumentException","getInitialChildModelLinks","hasContentConfiguration","conceptLink","setChildModels","models","errors","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","_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\";\nimport type ErrorResponse from \"../error/ErrorResponse\";\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(\n models: Array<ModularUIModel>,\n errors: Array<ErrorResponse>, // eslint-disable-line no-unused-vars\n ): 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,GAAA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AA+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,IAAI/L,kBAAkBA,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","ignoreList":[]}
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","errors","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","receivedAttribute","removeMissingError","addServerConstraint","defaultMessage","addConstraint","formatParameters","params","_keys","forEach","paramKey","paramValue","_endsWith","hasDynamicValidationData","updateValidations","_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\";\nimport type ErrorResponse from \"../error/ErrorResponse\";\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(\n models: Array<ModularUIModel>,\n errors: Array<ErrorResponse>, // eslint-disable-line no-unused-vars\n ): 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 // eslint-disable-next-line no-unused-vars\n addMissingError(receivedAttribute?: AttributeType): 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,Y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,OAAA,CAAAvM,OAAA,GAAAN,cAAA","ignoreList":[]}
@@ -253,10 +253,12 @@ class ChoiceAttributeModel extends _AttributeModel.default {
253
253
  /**
254
254
  */
255
255
  mergeAttribute(oldAttribute) {
256
+ let addNotExistingOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
257
+ let removeNotExistingOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
256
258
  // when attribute is readonly, don't merge the options no modifications necessary
257
259
  if (!this.readonly && oldAttribute instanceof ChoiceAttributeModel) {
258
260
  this.concept = oldAttribute.concept;
259
- this.options.mergeOptions(oldAttribute.options, this.type === "lookup");
261
+ this.options.mergeOptions(oldAttribute.options, addNotExistingOptions ?? this.type === "lookup", removeNotExistingOptions);
260
262
  this.options.deselectAll();
261
263
  if (oldAttribute.isValid && oldAttribute.inputvalue !== null) {
262
264
  this.update(oldAttribute.inputvalue);
@@ -294,6 +296,19 @@ class ChoiceAttributeModel extends _AttributeModel.default {
294
296
  return this;
295
297
  }
296
298
 
299
+ /**
300
+ * Registers a missing error that was received from the server
301
+ */
302
+ addMissingError(receivedAttribute) {
303
+ if (this.isChangedSince(0)) {
304
+ this._errorCollection.addServerError("Constraint.Missing");
305
+ }
306
+ // update choice options
307
+ if (receivedAttribute instanceof ChoiceAttributeModel) {
308
+ this.mergeAttribute(receivedAttribute, true, true);
309
+ }
310
+ }
311
+
297
312
  /**
298
313
  */
299
314
  set hasContentConfiguration(hasContentConfiguration) {
@@ -303,11 +303,19 @@ export default class ChoiceAttributeModel extends AttributeModel {
303
303
 
304
304
  /**
305
305
  */
306
- mergeAttribute(oldAttribute: AttributeType) {
306
+ mergeAttribute(
307
+ oldAttribute: AttributeType,
308
+ addNotExistingOptions: boolean = false,
309
+ removeNotExistingOptions: boolean = false,
310
+ ) {
307
311
  // when attribute is readonly, don't merge the options no modifications necessary
308
312
  if (!this.readonly && oldAttribute instanceof ChoiceAttributeModel) {
309
313
  this.concept = oldAttribute.concept;
310
- this.options.mergeOptions(oldAttribute.options, this.type === "lookup");
314
+ this.options.mergeOptions(
315
+ oldAttribute.options,
316
+ addNotExistingOptions ?? this.type === "lookup",
317
+ removeNotExistingOptions,
318
+ );
311
319
  this.options.deselectAll();
312
320
 
313
321
  if (oldAttribute.isValid && oldAttribute.inputvalue !== null) {
@@ -354,6 +362,19 @@ export default class ChoiceAttributeModel extends AttributeModel {
354
362
  return this;
355
363
  }
356
364
 
365
+ /**
366
+ * Registers a missing error that was received from the server
367
+ */
368
+ addMissingError(receivedAttribute?: AttributeType): void {
369
+ if (this.isChangedSince(0)) {
370
+ this._errorCollection.addServerError("Constraint.Missing");
371
+ }
372
+ // update choice options
373
+ if (receivedAttribute instanceof ChoiceAttributeModel) {
374
+ this.mergeAttribute(receivedAttribute, true, true);
375
+ }
376
+ }
377
+
357
378
  /**
358
379
  */
359
380
  set hasContentConfiguration(hasContentConfiguration: boolean) {