@beinformed/ui 1.41.0 → 1.41.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/esm/constants/LayoutHintConfig.js +10 -10
- package/esm/constants/LayoutHintConfig.js.map +1 -1
- package/esm/constants/LayoutHints.js +1 -1
- package/esm/constants/LayoutHints.js.map +1 -1
- package/esm/models/attributes/StringAttributeModel.js +7 -1
- package/esm/models/attributes/StringAttributeModel.js.map +1 -1
- package/esm/models/detail/DetailModel.js +3 -3
- package/esm/models/detail/DetailModel.js.map +1 -1
- package/lib/constants/LayoutHintConfig.js +10 -10
- package/lib/constants/LayoutHintConfig.js.flow +10 -48
- package/lib/constants/LayoutHintConfig.js.map +1 -1
- package/lib/constants/LayoutHints.js +2 -2
- package/lib/constants/LayoutHints.js.flow +1 -1
- package/lib/constants/LayoutHints.js.map +1 -1
- package/lib/models/attributes/StringAttributeModel.js +7 -1
- package/lib/models/attributes/StringAttributeModel.js.flow +7 -1
- package/lib/models/attributes/StringAttributeModel.js.map +1 -1
- package/lib/models/detail/DetailModel.js +2 -2
- package/lib/models/detail/DetailModel.js.flow +3 -3
- package/lib/models/detail/DetailModel.js.map +1 -1
- package/package.json +1 -1
- package/src/constants/LayoutHintConfig.js +10 -48
- package/src/constants/LayoutHints.js +1 -1
- package/src/models/attributes/StringAttributeModel.js +7 -1
- package/src/models/detail/DetailModel.js +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [1.41.2](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.41.1...v1.41.2) (2024-02-20)
|
|
6
|
+
|
|
7
|
+
## [1.41.1](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.41.0...v1.41.1) (2024-02-19)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* **avatarForTitleAttribute:** changed LayoutHint AVATAR_FOR_TITLE to AVATAR_IN_TITLE ([2a87110](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/2a87110bcbe3d9d1c08551afcd8b6ebbe3f94042))
|
|
13
|
+
|
|
5
14
|
## [1.41.0](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.40.0...v1.41.0) (2024-02-11)
|
|
6
15
|
|
|
7
16
|
|
|
@@ -147,15 +147,6 @@ export const LayoutHintConfiguration = {
|
|
|
147
147
|
link: "",
|
|
148
148
|
component: ["tab"]
|
|
149
149
|
},
|
|
150
|
-
AVATAR_FOR_TITLE: {
|
|
151
|
-
hint: "avatar-for-title",
|
|
152
|
-
description: {
|
|
153
|
-
NL: "Markeert een attribuut als een avatar voor het titelattribuut.",
|
|
154
|
-
EN: "Marks an attribute as an avatar for the title attribute."
|
|
155
|
-
},
|
|
156
|
-
link: "",
|
|
157
|
-
component: ["caseview_table", "codemap", "list/appointment_table", "list/assignment_table", "list/caseproperties_table", "list/document_table", "list/timelimit_table", "list/eventhistory_table", "list/note_table", "list/record_table", "list/case_table", "list/casesearch_table", "list/datastore_table", "list/datastoreview_table", "list/instrumentresult_table", "list/event_table", "list/user_table", "list/organization_table"]
|
|
158
|
-
},
|
|
159
150
|
AVATAR: {
|
|
160
151
|
hint: "avatar",
|
|
161
152
|
description: {
|
|
@@ -163,7 +154,16 @@ export const LayoutHintConfiguration = {
|
|
|
163
154
|
EN: "Render the attribute as the user's avatar."
|
|
164
155
|
},
|
|
165
156
|
link: "",
|
|
166
|
-
component: ["
|
|
157
|
+
component: ["attribute/upload", "list/user_table"]
|
|
158
|
+
},
|
|
159
|
+
AVATAR_IN_TITLE: {
|
|
160
|
+
hint: "avatar-in-title",
|
|
161
|
+
description: {
|
|
162
|
+
NL: "Geeft aan dat de avatarafbeelding in de titel wordt opgenomen. De avatarafbeelding wordt vóór het titel attribuut weergegeven in de lijstweergave en de snelle lijst quick view.",
|
|
163
|
+
EN: "Indicates that the avatar image will be included in the title. The avatar image is shown in front of the title attribute in the list view and list quick view."
|
|
164
|
+
},
|
|
165
|
+
link: "",
|
|
166
|
+
component: ["list/user_table"]
|
|
167
167
|
}
|
|
168
168
|
};
|
|
169
169
|
//# sourceMappingURL=LayoutHintConfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutHintConfig.js","names":["LayoutHintConfiguration","MANDATORY","hint","description","NL","EN","link","component","DEPENDENT_ATTRIBUTE_CONTROL","DEPENDENT_ATTRIBUTE_ACTION","SHOW_ONE_RESULT_AS_DETAIL","HIDE_WHEN_EMPTY","INITIAL_FILTER","CONFIRM_PASSWORD","TITLE","INITIAL_TOTAL_FILESIZE","MAX_TOTAL_FILESIZE","CREATE_ACTION","UPDATE_ACTION","DELETE_ACTION","SORT_OPTIONS","CASEVIEW_LINK","DISABLED","HIDE_IN_USER_INTERFACE","AVATAR_FOR_TITLE","AVATAR"],"sources":["../../src/constants/LayoutHintConfig.js"],"sourcesContent":["// @flow\nexport const LayoutHintConfiguration = {\n MANDATORY: {\n hint: \"mandatory\",\n description: {\n NL: \"Geeft aan of een attribuut verplicht is. Dient samen met de dependency hint gebruikt te worden.\",\n EN: \"Indicates a mandatory attribute.\\nShould be used together with the dependency hint.\",\n },\n link: \"\",\n component: [\"attribute\"],\n },\n DEPENDENT_ATTRIBUTE_CONTROL: {\n hint: \"dependent-control:${unique-control-id}\",\n description: {\n NL: \"Geeft aan dat dit het attribuut is waar attributen van afhankelijk zijn. Het unique-control-id is een uniek id dat kan worden gebruikt in the hint voor de show|hide actie op het afhankelijke attribuut.\",\n EN: \"Marks the choice attribute where other attributes depend on. The unique control id is a unique id that can be used in the hint for the show|hide action on the dependent attribute.\",\n },\n link: \"\",\n component: [\"attribute/boolean\", \"attribute/choice\"],\n },\n DEPENDENT_ATTRIBUTE_ACTION: {\n hint: \"dependent-attribute:(show|hide) when dependent-control:${unique-control-id} (equals|includes|notEquals|notIncludes) [${codemaps}]\",\n description: {\n NL: \"Toon of verberg een attribute dat afhankelijk is van de geselecteerde opties van een keuze attribute\",\n EN: \"To show or hide an attribute dependent on options of the choice control codemap that are selected or not selected.\",\n },\n link: \"\",\n component: [\"attribute\"],\n },\n SHOW_ONE_RESULT_AS_DETAIL: {\n hint: \"show-one-result-as-detail\",\n description: {\n NL: \"Een lijst met maar één item mag direct als detail getoond worden.\",\n EN: \"A list with only one detail must be shown as a detail.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n HIDE_WHEN_EMPTY: {\n hint: \"hide-when-empty\",\n description: {\n NL: \"Een lijst zonder lijst-items en lijst-taken dient niet getoond worden.\",\n EN: \"A list without list-items and list-tasks should not be shown.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n INITIAL_FILTER: {\n hint: \"initial-filter:${filter-name}=${initial-value}\",\n description: {\n NL: \"Laad de lijst met een standaardwaarde voor een filter, er is geen controle op het bestaan van het filter. Als het filter niet is geconfigureerd, treedt er een fout op. Houd er rekening mee dat filters hoofdlettergevoelig zijn.\",\n EN: \"Load the list with a default value for a filter, there is no check for the existence of the filter. If the filter is not configured, an error occurs. Keep in mind that filters are case sensitive.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n CONFIRM_PASSWORD: {\n hint: \"confirm-password\",\n description: {\n NL: \"Wachtwoord attribuut moet bevestigd worden dmv een tweede wachtwoord attribuut.\",\n EN: \"Password attribute must be confirmed using a second password attribute.\",\n },\n link: \"\",\n component: [\"attribute/password\"],\n },\n TITLE: {\n hint: \"title\",\n description: {\n NL: \"Markeert een attribuut als een titel attribuut\",\n EN: \"Marks an attribute as a title attribute\",\n },\n link: \"\",\n component: [\n \"caseview_table\",\n \"codemap\",\n \"list/appointment_table\",\n \"list/assignment_table\",\n \"list/caseproperties_table\",\n \"list/document_table\",\n \"list/timelimit_table\",\n \"list/eventhistory_table\",\n \"list/note_table\",\n \"list/record_table\",\n \"list/case_table\",\n \"list/casesearch_table\",\n \"list/datastore_table\",\n \"list/datastoreview_table\",\n \"list/instrumentresult_table\",\n \"list/event_table\",\n \"list/user_table\",\n \"list/organization_table\",\n ],\n },\n INITIAL_TOTAL_FILESIZE: {\n hint: \"initial-total-file-size\",\n description: {\n NL: \"Wordt gebruikt in samenwerking met een upload attribuut, deze hint moet worden gezet op een readonly attribuut dat de reeds gebruikte file grootte bevat.\",\n EN: \"Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the file size currently used.\",\n },\n link: \"\",\n component: [\"attribute/number\"],\n },\n MAX_TOTAL_FILESIZE: {\n hint: \"max-total-file-size\",\n description: {\n NL: \"Wordt gebruikt in samenwerking met een upload attribuut, deze hint moet worden gezet op een readonly attribuut dat de maximaal toegestane file grootte bevat.\",\n EN: \"Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the maximum allowed total file size.\",\n },\n link: \"\",\n component: [\"attribute/number\"],\n },\n CREATE_ACTION: {\n hint: \"create\",\n description: {\n NL: \"Markeer taak als creëer taak.\",\n EN: \"Mark task as create task\",\n },\n component: [\"form\"],\n },\n UPDATE_ACTION: {\n hint: \"update\",\n description: {\n NL: \"Markeer taak als bewerk taak.\",\n EN: \"Mark task as update task\",\n },\n component: [\"form\"],\n },\n DELETE_ACTION: {\n hint: \"delete\",\n description: {\n NL: \"Markeer taak als verwijder taak.\",\n EN: \"Mark task as delete task\",\n },\n component: [\"form\"],\n },\n SORT_OPTIONS: {\n hint: \"sort-options\",\n description: {\n NL: \"Sorteer opties alfabetisch\",\n EN: \"Sort options alphabetically\",\n },\n component: [\"attribute/choice\"],\n },\n CASEVIEW_LINK: {\n hint: \"case-view-link\",\n description: {\n NL: \"Markeer een case id reference attribute als de referentie naar de case view. Vervangt de self link van een lijst item\",\n EN: \"Mark a case id reference attribute as the reference to the case view. Replaces the self link of a list item\",\n },\n component: [\"attribute/reference\", \"list/datastore_table\"],\n },\n DISABLED: {\n hint: \"disabled\",\n description: {\n NL: \"Geeft aan of een attribuut uitgeschakeld is.\",\n EN: \"Indicates a disabled attribute.\",\n },\n link: \"\",\n component: [\"attribute\"],\n },\n HIDE_IN_USER_INTERFACE: {\n hint: \"hide-in-user-interface\",\n description: {\n NL: \"Verberg een tab in de user interface.\",\n EN: \"Hide a tab in the user interface.\",\n },\n link: \"\",\n component: [\"tab\"],\n },\n AVATAR_FOR_TITLE: {\n hint: \"avatar-for-title\",\n description: {\n NL: \"Markeert een attribuut als een avatar voor het titelattribuut.\",\n EN: \"Marks an attribute as an avatar for the title attribute.\",\n },\n link: \"\",\n component: [\n \"caseview_table\",\n \"codemap\",\n \"list/appointment_table\",\n \"list/assignment_table\",\n \"list/caseproperties_table\",\n \"list/document_table\",\n \"list/timelimit_table\",\n \"list/eventhistory_table\",\n \"list/note_table\",\n \"list/record_table\",\n \"list/case_table\",\n \"list/casesearch_table\",\n \"list/datastore_table\",\n \"list/datastoreview_table\",\n \"list/instrumentresult_table\",\n \"list/event_table\",\n \"list/user_table\",\n \"list/organization_table\",\n ],\n },\n AVATAR: {\n hint: \"avatar\",\n description: {\n NL: \"Geef het attribuut weer als de avatar van de gebruiker.\",\n EN: \"Render the attribute as the user's avatar.\",\n },\n link: \"\",\n component: [\n \"caseview_table\",\n \"codemap\",\n \"list/appointment_table\",\n \"list/assignment_table\",\n \"list/caseproperties_table\",\n \"list/document_table\",\n \"list/timelimit_table\",\n \"list/eventhistory_table\",\n \"list/note_table\",\n \"list/record_table\",\n \"list/case_table\",\n \"list/casesearch_table\",\n \"list/datastore_table\",\n \"list/datastoreview_table\",\n \"list/instrumentresult_table\",\n \"list/event_table\",\n \"list/user_table\",\n \"list/organization_table\",\n ],\n },\n};\n"],"mappings":"AACA,OAAO,MAAMA,uBAAuB,GAAG;EACrCC,SAAS,EAAE;IACTC,IAAI,EAAE,WAAW;IACjBC,WAAW,EAAE;MACXC,EAAE,EAAE,iGAAiG;MACrGC,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jB,yBAAyB;EAE7B,CAAC;EACDkB,MAAM,EAAE;IACNvB,IAAI,EAAE,QAAQ;IACdC,WAAW,EAAE;MACXC,EAAE,EAAE,yDAAyD;MAC7DC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CACT,gBAAgB,EAChB,SAAS,EACT,wBAAwB,EACxB,uBAAuB,EACvB,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,sBAAsB,EACtB,0BAA0B,EAC1B,6BAA6B,EAC7B,kBAAkB,EAClB,iBAAiB,EACjB,yBAAyB;EAE7B;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"LayoutHintConfig.js","names":["LayoutHintConfiguration","MANDATORY","hint","description","NL","EN","link","component","DEPENDENT_ATTRIBUTE_CONTROL","DEPENDENT_ATTRIBUTE_ACTION","SHOW_ONE_RESULT_AS_DETAIL","HIDE_WHEN_EMPTY","INITIAL_FILTER","CONFIRM_PASSWORD","TITLE","INITIAL_TOTAL_FILESIZE","MAX_TOTAL_FILESIZE","CREATE_ACTION","UPDATE_ACTION","DELETE_ACTION","SORT_OPTIONS","CASEVIEW_LINK","DISABLED","HIDE_IN_USER_INTERFACE","AVATAR","AVATAR_IN_TITLE"],"sources":["../../src/constants/LayoutHintConfig.js"],"sourcesContent":["// @flow\nexport const LayoutHintConfiguration = {\n MANDATORY: {\n hint: \"mandatory\",\n description: {\n NL: \"Geeft aan of een attribuut verplicht is. Dient samen met de dependency hint gebruikt te worden.\",\n EN: \"Indicates a mandatory attribute.\\nShould be used together with the dependency hint.\",\n },\n link: \"\",\n component: [\"attribute\"],\n },\n DEPENDENT_ATTRIBUTE_CONTROL: {\n hint: \"dependent-control:${unique-control-id}\",\n description: {\n NL: \"Geeft aan dat dit het attribuut is waar attributen van afhankelijk zijn. Het unique-control-id is een uniek id dat kan worden gebruikt in the hint voor de show|hide actie op het afhankelijke attribuut.\",\n EN: \"Marks the choice attribute where other attributes depend on. The unique control id is a unique id that can be used in the hint for the show|hide action on the dependent attribute.\",\n },\n link: \"\",\n component: [\"attribute/boolean\", \"attribute/choice\"],\n },\n DEPENDENT_ATTRIBUTE_ACTION: {\n hint: \"dependent-attribute:(show|hide) when dependent-control:${unique-control-id} (equals|includes|notEquals|notIncludes) [${codemaps}]\",\n description: {\n NL: \"Toon of verberg een attribute dat afhankelijk is van de geselecteerde opties van een keuze attribute\",\n EN: \"To show or hide an attribute dependent on options of the choice control codemap that are selected or not selected.\",\n },\n link: \"\",\n component: [\"attribute\"],\n },\n SHOW_ONE_RESULT_AS_DETAIL: {\n hint: \"show-one-result-as-detail\",\n description: {\n NL: \"Een lijst met maar één item mag direct als detail getoond worden.\",\n EN: \"A list with only one detail must be shown as a detail.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n HIDE_WHEN_EMPTY: {\n hint: \"hide-when-empty\",\n description: {\n NL: \"Een lijst zonder lijst-items en lijst-taken dient niet getoond worden.\",\n EN: \"A list without list-items and list-tasks should not be shown.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n INITIAL_FILTER: {\n hint: \"initial-filter:${filter-name}=${initial-value}\",\n description: {\n NL: \"Laad de lijst met een standaardwaarde voor een filter, er is geen controle op het bestaan van het filter. Als het filter niet is geconfigureerd, treedt er een fout op. Houd er rekening mee dat filters hoofdlettergevoelig zijn.\",\n EN: \"Load the list with a default value for a filter, there is no check for the existence of the filter. If the filter is not configured, an error occurs. Keep in mind that filters are case sensitive.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n CONFIRM_PASSWORD: {\n hint: \"confirm-password\",\n description: {\n NL: \"Wachtwoord attribuut moet bevestigd worden dmv een tweede wachtwoord attribuut.\",\n EN: \"Password attribute must be confirmed using a second password attribute.\",\n },\n link: \"\",\n component: [\"attribute/password\"],\n },\n TITLE: {\n hint: \"title\",\n description: {\n NL: \"Markeert een attribuut als een titel attribuut\",\n EN: \"Marks an attribute as a title attribute\",\n },\n link: \"\",\n component: [\n \"caseview_table\",\n \"codemap\",\n \"list/appointment_table\",\n \"list/assignment_table\",\n \"list/caseproperties_table\",\n \"list/document_table\",\n \"list/timelimit_table\",\n \"list/eventhistory_table\",\n \"list/note_table\",\n \"list/record_table\",\n \"list/case_table\",\n \"list/casesearch_table\",\n \"list/datastore_table\",\n \"list/datastoreview_table\",\n \"list/instrumentresult_table\",\n \"list/event_table\",\n \"list/user_table\",\n \"list/organization_table\",\n ],\n },\n INITIAL_TOTAL_FILESIZE: {\n hint: \"initial-total-file-size\",\n description: {\n NL: \"Wordt gebruikt in samenwerking met een upload attribuut, deze hint moet worden gezet op een readonly attribuut dat de reeds gebruikte file grootte bevat.\",\n EN: \"Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the file size currently used.\",\n },\n link: \"\",\n component: [\"attribute/number\"],\n },\n MAX_TOTAL_FILESIZE: {\n hint: \"max-total-file-size\",\n description: {\n NL: \"Wordt gebruikt in samenwerking met een upload attribuut, deze hint moet worden gezet op een readonly attribuut dat de maximaal toegestane file grootte bevat.\",\n EN: \"Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the maximum allowed total file size.\",\n },\n link: \"\",\n component: [\"attribute/number\"],\n },\n CREATE_ACTION: {\n hint: \"create\",\n description: {\n NL: \"Markeer taak als creëer taak.\",\n EN: \"Mark task as create task\",\n },\n component: [\"form\"],\n },\n UPDATE_ACTION: {\n hint: \"update\",\n description: {\n NL: \"Markeer taak als bewerk taak.\",\n EN: \"Mark task as update task\",\n },\n component: [\"form\"],\n },\n DELETE_ACTION: {\n hint: \"delete\",\n description: {\n NL: \"Markeer taak als verwijder taak.\",\n EN: \"Mark task as delete task\",\n },\n component: [\"form\"],\n },\n SORT_OPTIONS: {\n hint: \"sort-options\",\n description: {\n NL: \"Sorteer opties alfabetisch\",\n EN: \"Sort options alphabetically\",\n },\n component: [\"attribute/choice\"],\n },\n CASEVIEW_LINK: {\n hint: \"case-view-link\",\n description: {\n NL: \"Markeer een case id reference attribute als de referentie naar de case view. Vervangt de self link van een lijst item\",\n EN: \"Mark a case id reference attribute as the reference to the case view. Replaces the self link of a list item\",\n },\n component: [\"attribute/reference\", \"list/datastore_table\"],\n },\n DISABLED: {\n hint: \"disabled\",\n description: {\n NL: \"Geeft aan of een attribuut uitgeschakeld is.\",\n EN: \"Indicates a disabled attribute.\",\n },\n link: \"\",\n component: [\"attribute\"],\n },\n HIDE_IN_USER_INTERFACE: {\n hint: \"hide-in-user-interface\",\n description: {\n NL: \"Verberg een tab in de user interface.\",\n EN: \"Hide a tab in the user interface.\",\n },\n link: \"\",\n component: [\"tab\"],\n },\n AVATAR: {\n hint: \"avatar\",\n description: {\n NL: \"Geef het attribuut weer als de avatar van de gebruiker.\",\n EN: \"Render the attribute as the user's avatar.\",\n },\n link: \"\",\n component: [\"attribute/upload\", \"list/user_table\"],\n },\n AVATAR_IN_TITLE: {\n hint: \"avatar-in-title\",\n description: {\n NL: \"Geeft aan dat de avatarafbeelding in de titel wordt opgenomen. De avatarafbeelding wordt vóór het titel attribuut weergegeven in de lijstweergave en de snelle lijst quick view.\",\n EN: \"Indicates that the avatar image will be included in the title. The avatar image is shown in front of the title attribute in the list view and list quick view.\",\n },\n link: \"\",\n component: [\"list/user_table\"],\n },\n};\n"],"mappings":"AACA,OAAO,MAAMA,uBAAuB,GAAG;EACrCC,SAAS,EAAE;IACTC,IAAI,EAAE,WAAW;IACjBC,WAAW,EAAE;MACXC,EAAE,EAAE,iGAAiG;MACrGC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CAAC,WAAW;EACzB,CAAC;EACDC,2BAA2B,EAAE;IAC3BN,IAAI,EAAE,wCAAwC;IAC9CC,WAAW,EAAE;MACXC,EAAE,EAAE,2MAA2M;MAC/MC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CAAC,mBAAm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IACbnB,IAAI,EAAE,gBAAgB;IACtBC,WAAW,EAAE;MACXC,EAAE,EAAE,uHAAuH;MAC3HC,EAAE,EAAE;IACN,CAAC;IACDE,SAAS,EAAE,CAAC,qBAAqB,EAAE,sBAAsB;EAC3D,CAAC;EACDe,QAAQ,EAAE;IACRpB,IAAI,EAAE,UAAU;IAChBC,WAAW,EAAE;MACXC,EAAE,EAAE,8CAA8C;MAClDC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CAAC,WAAW;EACzB,CAAC;EACDgB,sBAAsB,EAAE;IACtBrB,IAAI,EAAE,wBAAwB;IAC9BC,WAAW,EAAE;MACXC,EAAE,EAAE,uCAAuC;MAC3CC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CAAC,KAAK;EACnB,CAAC;EACDiB,MAAM,EAAE;IACNtB,IAAI,EAAE,QAAQ;IACdC,WAAW,EAAE;MACXC,EAAE,EAAE,yDAAyD;MAC7DC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CAAC,kBAAkB,EAAE,iBAAiB;EACnD,CAAC;EACDkB,eAAe,EAAE;IACfvB,IAAI,EAAE,iBAAiB;IACvBC,WAAW,EAAE;MACXC,EAAE,EAAE,kLAAkL;MACtLC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CAAC,iBAAiB;EAC/B;AACF,CAAC"}
|
|
@@ -123,7 +123,7 @@ export const getLayoutHintConfiguration = () => LayoutHintConfiguration;
|
|
|
123
123
|
/**
|
|
124
124
|
* Layout-hint: Marks an attribute as an avatar for the title attribute.
|
|
125
125
|
*/
|
|
126
|
-
export const
|
|
126
|
+
export const AVATAR_IN_TITLE = getHint("AVATAR_IN_TITLE");
|
|
127
127
|
export const AVATAR = getHint("AVATAR");
|
|
128
128
|
export default getHint;
|
|
129
129
|
//# sourceMappingURL=LayoutHints.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutHints.js","names":["LayoutHintConfiguration","getHint","hint","MANDATORY","DISABLED","DEPENDENT_ATTRIBUTE_CONTROL","DEPENDENT_ATTRIBUTE","CONFIRM_PASSWORD","SORT_OPTIONS","TITLE","DELETE_ACTION","UPDATE_ACTION","CREATE_ACTION","INITIAL_TOTAL_FILESIZE","MAX_TOTAL_FILESIZE","SHOW_ONE_RESULT_AS_DETAIL","HIDE_WHEN_EMPTY","INITIAL_FILTER","CASEVIEW_LINK","RENDER_SECTION_LABEL","HIDE_IN_USER_INTERFACE","getLayoutHintConfiguration","
|
|
1
|
+
{"version":3,"file":"LayoutHints.js","names":["LayoutHintConfiguration","getHint","hint","MANDATORY","DISABLED","DEPENDENT_ATTRIBUTE_CONTROL","DEPENDENT_ATTRIBUTE","CONFIRM_PASSWORD","SORT_OPTIONS","TITLE","DELETE_ACTION","UPDATE_ACTION","CREATE_ACTION","INITIAL_TOTAL_FILESIZE","MAX_TOTAL_FILESIZE","SHOW_ONE_RESULT_AS_DETAIL","HIDE_WHEN_EMPTY","INITIAL_FILTER","CASEVIEW_LINK","RENDER_SECTION_LABEL","HIDE_IN_USER_INTERFACE","getLayoutHintConfiguration","AVATAR_IN_TITLE","AVATAR"],"sources":["../../src/constants/LayoutHints.js"],"sourcesContent":["// @flow\nimport { LayoutHintConfiguration } from \"./LayoutHintConfig\";\n\n/**\n * Retrieve layout hint by id from the layout hint configuration\n */\nconst getHint = (hint: string): string => {\n if (LayoutHintConfiguration[hint]) {\n return LayoutHintConfiguration[hint].hint;\n }\n\n return \"\";\n};\n\n/**\n * Layout-hint: Indicates a mandatory attribute. Should be used together with the dependency hint.\n */\nexport const MANDATORY: string = getHint(\"MANDATORY\");\n\n/**\n * Layout-hint: Indicates a disabled attribute.\n * @constant\n */\nexport const DISABLED: string = getHint(\"DISABLED\");\n\n/*\n * --------------------------------\n * SELECT DEPENDENT ATTRIBUTES\n * --------------------------------\n */\n/**\n * Layout-hint: Marks the choice attribute where other attributes depend on. The unique control id is a unique id that can be used in the hint for the show|hide action on the dependent attribute.\n */\nexport const DEPENDENT_ATTRIBUTE_CONTROL = \"dependent-control\";\n/**\n */\nexport const DEPENDENT_ATTRIBUTE = \"dependent-attribute:\";\n\n/*\n * --------------------------------\n * ATTRIBUTES\n * --------------------------------\n */\n/**\n * Layout-hint: Password attribute must be confirmed using a second password attribute.\n */\nexport const CONFIRM_PASSWORD: string = getHint(\"CONFIRM_PASSWORD\");\n/**\n * Layout-hint: Sort options alphabetically\n */\nexport const SORT_OPTIONS: string = getHint(\"SORT_OPTIONS\");\n/**\n * Layout-hint: Marks an attribute as a title attribute\n */\nexport const TITLE: string = getHint(\"TITLE\");\n\n/*\n * --------------------------------\n * FORM\n * --------------------------------\n */\n/**\n * Layout-hint: Mark task as delete task\n */\nexport const DELETE_ACTION: string = getHint(\"DELETE_ACTION\");\n/**\n * Layout-hint: Mark task as update task\n */\nexport const UPDATE_ACTION: string = getHint(\"UPDATE_ACTION\");\n/**\n * Layout-hint: Mark task as create task\n */\nexport const CREATE_ACTION: string = getHint(\"CREATE_ACTION\");\n\n/*\n * --------------------------------\n * UPLOAD TOTAL FILE SIZE\n * --------------------------------\n */\n/**\n * Layout-hint: Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the file size currently used.\n */\nexport const INITIAL_TOTAL_FILESIZE: string = getHint(\"INITIAL_TOTAL_FILESIZE\");\n/**\n * Layout-hint: Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the maximum allowed total file size.\n */\nexport const MAX_TOTAL_FILESIZE: string = getHint(\"MAX_TOTAL_FILESIZE\");\n\n/*\n * --------------------------------\n * LISTS\n * --------------------------------\n */\n/**\n * Layout-hint: A list with only one detail must be shown as a detail\n */\nexport const SHOW_ONE_RESULT_AS_DETAIL: string = getHint(\n \"SHOW_ONE_RESULT_AS_DETAIL\",\n);\n/**\n * Layout-hint: A list without list-items and list-tasks should not be shown.\n */\nexport const HIDE_WHEN_EMPTY: string = getHint(\"HIDE_WHEN_EMPTY\");\n/**\n * Layout-hint: Sets a default value on a filter\n */\nexport const INITIAL_FILTER: string = \"initial-filter:\";\n/**\n * Layout-hint: Mark a case id reference attribute as the reference to the case view. Replaces the self link of a list item\n */\nexport const CASEVIEW_LINK: string = getHint(\"CASEVIEW_LINK\");\n\n/**\n * Layout-hint: Set on configuration of instruments to show content in a popover on a label\n */\nexport const RENDER_SECTION_LABEL = \"render-section-label\";\n\n/**\n * Layout-hint: Hide a link to a component\n */\nexport const HIDE_IN_USER_INTERFACE: string = getHint(\"HIDE_IN_USER_INTERFACE\");\n\n/**\n */\nexport const getLayoutHintConfiguration = (): Object => LayoutHintConfiguration;\n\n/**\n * Layout-hint: Marks an attribute as an avatar for the title attribute.\n */\nexport const AVATAR_IN_TITLE: string = getHint(\"AVATAR_IN_TITLE\");\n\nexport const AVATAR: string = getHint(\"AVATAR\");\n\nexport default getHint;\n"],"mappings":"AACA,SAASA,uBAAuB,QAAQ,oBAAoB;;AAE5D;AACA;AACA;AACA,MAAMC,OAAO,GAAIC,IAAY,IAAa;EACxC,IAAIF,uBAAuB,CAACE,IAAI,CAAC,EAAE;IACjC,OAAOF,uBAAuB,CAACE,IAAI,CAAC,CAACA,IAAI;EAC3C;EAEA,OAAO,EAAE;AACX,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMC,SAAiB,GAAGF,OAAO,CAAC,WAAW,CAAC;;AAErD;AACA;AACA;AACA;AACA,OAAO,MAAMG,QAAgB,GAAGH,OAAO,CAAC,UAAU,CAAC;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMI,2BAA2B,GAAG,mBAAmB;AAC9D;AACA;AACA,OAAO,MAAMC,mBAAmB,GAAG,sBAAsB;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAwB,GAAGN,OAAO,CAAC,kBAAkB,CAAC;AACn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AeA,OAAO"}
|
|
@@ -98,6 +98,12 @@ export default class StringAttributeModel extends AttributeModel {
|
|
|
98
98
|
return this.layouthint.has("zipcode");
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
/**
|
|
102
|
+
*/
|
|
103
|
+
isAvatar() {
|
|
104
|
+
return this.layouthint.has("avatar");
|
|
105
|
+
}
|
|
106
|
+
|
|
101
107
|
/**
|
|
102
108
|
*/
|
|
103
109
|
isEmail() {
|
|
@@ -252,7 +258,7 @@ export default class StringAttributeModel extends AttributeModel {
|
|
|
252
258
|
/**
|
|
253
259
|
*/
|
|
254
260
|
get readonlyWidth() {
|
|
255
|
-
if (this.isZipcode() || this.isBSN()) {
|
|
261
|
+
if (this.isZipcode() || this.isBSN() || this.isAvatar()) {
|
|
256
262
|
return ATTRIBUTE_WIDTH.SMALL;
|
|
257
263
|
}
|
|
258
264
|
if (this.isIBAN()) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StringAttributeModel.js","names":["AttributeModel","ConstraintCollection","RegexConstraint","BSNConstraint","IBANConstraint","ATTRIBUTE_WIDTH","StringAttributeModel","constructor","attribute","attributeContributions","_defineProperty","_placeholder","getContribution","getInitialInputValue","value","formatValue","isApplicableModel","contributions","layouthint","type","Array","isArray","_includesInstanceProperty","call","regexp","regexpvalidationmessage","postfix","prefix","placeholder","isBSN","has","isIBAN","isZipcode","isEmail","addConstraints","constraints","add","messageKey","defaultMessage","regex","RegExp","reset","inputvalue","formatIBAN","noFormat","removeFormat","groups","replace","match","join","formatZipcode","length","substring","toUpperCase","formatBSN","toString","validateValue","getInputValue","_inputvalue","validate","readonlyvalue","formattedValue","update","updateLastModification","readonlyWidth","SMALL","LARGE","MEDIUM"],"sources":["../../../src/models/attributes/StringAttributeModel.js"],"sourcesContent":["// @flow\nimport AttributeModel from \"./AttributeModel\";\nimport ConstraintCollection from \"./input-constraints/ConstraintCollection\";\nimport RegexConstraint from \"./input-constraints/RegexConstraint\";\nimport BSNConstraint from \"./input-constraints/BSNConstraint\";\nimport IBANConstraint from \"./input-constraints/IBANConstraint\";\n\nimport { ATTRIBUTE_WIDTH } from \"../../constants\";\n\n/**\n * String attribute\n */\nexport default class StringAttributeModel extends AttributeModel {\n _placeholder: string;\n\n /**\n */\n constructor(attribute: Object, attributeContributions: Object) {\n super(attribute, attributeContributions);\n\n this._placeholder = this.getContribution(\"placeholder\", \"\");\n }\n\n /**\n * Retrieve initial input value\n */\n getInitialInputValue(value: any): string {\n return this.formatValue(value);\n }\n\n /**\n */\n static isApplicableModel(contributions: Object): boolean {\n const layouthint = contributions?.layouthint;\n return (\n contributions.type === \"string\" ||\n (Array.isArray(layouthint) && layouthint.includes(\"string\"))\n );\n }\n\n /**\n */\n get type(): string {\n return \"string\";\n }\n\n /**\n * Get Regexp pattern\n */\n get regexp(): string | null {\n return this.getContribution(\"regexp\");\n }\n\n /**\n */\n get regexpvalidationmessage(): string | null {\n return this.getContribution(\"regexpValidationMessage\");\n }\n\n /**\n * Get postfix text\n */\n get postfix(): string {\n return this.getContribution(\"postfix\", \"\");\n }\n\n /**\n * Get prefix text\n */\n get prefix(): string {\n return this.getContribution(\"prefix\", \"\");\n }\n\n /**\n * Get placeholder text\n */\n get placeholder(): string {\n return this._placeholder;\n }\n\n /**\n * Set placeholder text\n */\n set placeholder(placeholder: string) {\n this._placeholder = placeholder;\n }\n\n /**\n */\n isBSN(): boolean {\n return this.layouthint.has(\"bsn\");\n }\n\n /**\n */\n isIBAN(): boolean {\n return this.layouthint.has(\"iban\");\n }\n\n /**\n */\n isZipcode(): boolean {\n return this.layouthint.has(\"zipcode\");\n }\n\n /**\n */\n isEmail(): boolean {\n return this.layouthint.has(\"email\");\n }\n\n /**\n * Add regex constraints\n */\n addConstraints(): ConstraintCollection {\n const constraints = new ConstraintCollection();\n\n if (this.isBSN()) {\n constraints.add(new BSNConstraint());\n } else if (this.isIBAN()) {\n constraints.add(new IBANConstraint());\n }\n\n if (this.isZipcode()) {\n // validate zip when regex is set is set or exact or isNot\n constraints.add(\n new RegexConstraint({\n messageKey: \"Constraint.ZipCode.InvalidFormat\",\n defaultMessage: \"Must be a valid Dutch ZIP code, e.g. 1234 AB\",\n regex: new RegExp(\"^[1-9][0-9]{3} ?[a-zA-Z]{2}$\", \"gi\"),\n }),\n );\n } else if (this.isEmail() && this.regexp) {\n constraints.add(\n new RegexConstraint({\n messageKey: \"Constraint.Email.InvalidFormat\",\n defaultMessage: \"Must be a valid e-mail address\",\n regex: new RegExp(this.regexp, \"gi\"),\n }),\n );\n } else if (this.regexp) {\n constraints.add(\n new RegexConstraint({\n messageKey: \"Constraint.String.InvalidRegex\",\n defaultMessage: this.regexpvalidationmessage,\n regex: this.regexp,\n }),\n );\n }\n\n return constraints;\n }\n\n /**\n * Reset attribute to empty string\n */\n reset() {\n this.inputvalue = \"\";\n }\n\n /**\n */\n formatIBAN(value: string): string {\n const noFormat = this.removeFormat(value);\n\n const groups = noFormat.replace(/\\s/g, \"\").match(/.{1,4}/g);\n return groups == null ? \"\" : groups.join(\" \");\n }\n\n /**\n */\n formatZipcode(value: string): string {\n const noFormat = this.removeFormat(value);\n if (noFormat.length === 6) {\n return (\n noFormat.substring(0, 4) + \" \" + noFormat.substring(4).toUpperCase()\n );\n }\n return noFormat;\n }\n\n /**\n */\n formatBSN(value: string): string {\n return this.removeFormat(value);\n }\n\n /**\n */\n formatValue(value: ?string): string {\n if (value == null || value.toString() === \"\") {\n return \"\";\n }\n\n if (typeof value !== \"string\") {\n return value;\n }\n\n if (this.isIBAN()) {\n return this.formatIBAN(value);\n }\n\n if (this.isZipcode()) {\n return this.formatZipcode(value);\n }\n\n if (this.isBSN()) {\n return this.formatBSN(value);\n }\n\n return value.replace(/ {2}/gi, \" \\u00A0\");\n }\n\n /**\n */\n removeFormat(value: ?string): string {\n if (value == null || value.toString() === \"\") {\n return \"\";\n }\n\n if (this.isIBAN() || this.isZipcode() || this.isBSN()) {\n return value.replace(/[^a-z0-9,]/gi, \"\");\n }\n\n return value;\n }\n\n /**\n */\n get validateValue(): string {\n return this.removeFormat(this.inputvalue);\n }\n\n /**\n */\n get inputvalue(): string {\n return this.getInputValue();\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\n if (value == null) {\n this.value = value;\n } else {\n this.value = this.removeFormat(value);\n }\n\n this.validate(this.validateValue);\n }\n\n /**\n */\n get readonlyvalue(): string {\n if (typeof this.value === \"string\") {\n const formattedValue = this.formatValue(this.value);\n // fix for rendering of multiple spaces\n return formattedValue.replace(/ {2}/gi, \" \\u00A0\");\n }\n\n return this.value == null ? \"\" : this.value;\n }\n\n /**\n * Update the attribute by name and value\n */\n update(value: string): StringAttributeModel {\n if (this.inputvalue === value) {\n return this;\n }\n\n this.updateLastModification();\n this.inputvalue = value;\n\n return this;\n }\n\n /**\n */\n get readonlyWidth(): $Keys<typeof ATTRIBUTE_WIDTH> {\n if (this.isZipcode() || this.isBSN()) {\n return ATTRIBUTE_WIDTH.SMALL;\n }\n\n if (this.isIBAN()) {\n return ATTRIBUTE_WIDTH.LARGE;\n }\n\n // default value (also applied for email address + download attribute)\n return ATTRIBUTE_WIDTH.MEDIUM;\n }\n}\n"],"mappings":";;AACA,OAAOA,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,oBAAoB,MAAM,0CAA0C;AAC3E,OAAOC,eAAe,MAAM,qCAAqC;AACjE,OAAOC,aAAa,MAAM,mCAAmC;AAC7D,OAAOC,cAAc,MAAM,oCAAoC;AAE/D,SAASC,eAAe,QAAQ,iBAAiB;;AAEjD;AACA;AACA;AACA,eAAe,MAAMC,oBAAoB,SAASN,cAAc,CAAC;EAG/D;AACF;EACEO,WAAWA,CAACC,SAAiB,EAAEC,sBAA8B,EAAE;IAC7D,KAAK,CAACD,SAAS,EAAEC,sBAAsB,CAAC;IAACC,eAAA;IAEzC,IAAI,CAACC,YAAY,GAAG,IAAI,CAACC,eAAe,CAAC,aAAa,EAAE,EAAE,CAAC;EAC7D;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AI,CAAC6C,QAAQ,CAAC,IAAI,CAACH,aAAa,CAAC;EACnC;;EAEA;AACF;EACE,IAAII,aAAaA,CAAA,EAAW;IAC1B,IAAI,OAAO,IAAI,CAAC9C,KAAK,KAAK,QAAQ,EAAE;MAClC,MAAM+C,cAAc,GAAG,IAAI,CAAC9C,WAAW,CAAC,IAAI,CAACD,KAAK,CAAC;MACnD;MACA,OAAO+C,cAAc,CAACd,OAAO,CAAC,QAAQ,EAAE,SAAS,CAAC;IACpD;IAEA,OAAO,IAAI,CAACjC,KAAK,IAAI,IAAI,GAAG,EAAE,GAAG,IAAI,CAACA,KAAK;EAC7C;;EAEA;AACF;AACA;EACEgD,MAAMA,CAAChD,KAAa,EAAwB;IAC1C,IAAI,IAAI,CAAC4B,UAAU,KAAK5B,KAAK,EAAE;MAC7B,OAAO,IAAI;IACb;IAEA,IAAI,CAACiD,sBAAsB,CAAC,CAAC;IAC7B,IAAI,CAACrB,UAAU,GAAG5B,KAAK;IAEvB,OAAO,IAAI;EACb;;EAEA;AACF;EACE,IAAIkD,aAAaA,CAAA,EAAkC;IACjD,IAAI,IAAI,CAAChC,SAAS,CAAC,CAAC,IAAI,IAAI,CAACH,KAAK,CAAC,CAAC,EAAE;MACpC,OAAOxB,eAAe,CAAC4D,KAAK;IAC9B;IAEA,IAAI,IAAI,CAAClC,MAAM,CAAC,CAAC,EAAE;MACjB,OAAO1B,eAAe,CAAC6D,KAAK;IAC9B;;IAEA;IACA,OAAO7D,eAAe,CAAC8D,MAAM;EAC/B;AACF"}
|
|
1
|
+
{"version":3,"file":"StringAttributeModel.js","names":["AttributeModel","ConstraintCollection","RegexConstraint","BSNConstraint","IBANConstraint","ATTRIBUTE_WIDTH","StringAttributeModel","constructor","attribute","attributeContributions","_defineProperty","_placeholder","getContribution","getInitialInputValue","value","formatValue","isApplicableModel","contributions","layouthint","type","Array","isArray","_includesInstanceProperty","call","regexp","regexpvalidationmessage","postfix","prefix","placeholder","isBSN","has","isIBAN","isZipcode","isAvatar","isEmail","addConstraints","constraints","add","messageKey","defaultMessage","regex","RegExp","reset","inputvalue","formatIBAN","noFormat","removeFormat","groups","replace","match","join","formatZipcode","length","substring","toUpperCase","formatBSN","toString","validateValue","getInputValue","_inputvalue","validate","readonlyvalue","formattedValue","update","updateLastModification","readonlyWidth","SMALL","LARGE","MEDIUM"],"sources":["../../../src/models/attributes/StringAttributeModel.js"],"sourcesContent":["// @flow\nimport AttributeModel from \"./AttributeModel\";\nimport ConstraintCollection from \"./input-constraints/ConstraintCollection\";\nimport RegexConstraint from \"./input-constraints/RegexConstraint\";\nimport BSNConstraint from \"./input-constraints/BSNConstraint\";\nimport IBANConstraint from \"./input-constraints/IBANConstraint\";\n\nimport { ATTRIBUTE_WIDTH } from \"../../constants\";\n\n/**\n * String attribute\n */\nexport default class StringAttributeModel extends AttributeModel {\n _placeholder: string;\n\n /**\n */\n constructor(attribute: Object, attributeContributions: Object) {\n super(attribute, attributeContributions);\n\n this._placeholder = this.getContribution(\"placeholder\", \"\");\n }\n\n /**\n * Retrieve initial input value\n */\n getInitialInputValue(value: any): string {\n return this.formatValue(value);\n }\n\n /**\n */\n static isApplicableModel(contributions: Object): boolean {\n const layouthint = contributions?.layouthint;\n return (\n contributions.type === \"string\" ||\n (Array.isArray(layouthint) && layouthint.includes(\"string\"))\n );\n }\n\n /**\n */\n get type(): string {\n return \"string\";\n }\n\n /**\n * Get Regexp pattern\n */\n get regexp(): string | null {\n return this.getContribution(\"regexp\");\n }\n\n /**\n */\n get regexpvalidationmessage(): string | null {\n return this.getContribution(\"regexpValidationMessage\");\n }\n\n /**\n * Get postfix text\n */\n get postfix(): string {\n return this.getContribution(\"postfix\", \"\");\n }\n\n /**\n * Get prefix text\n */\n get prefix(): string {\n return this.getContribution(\"prefix\", \"\");\n }\n\n /**\n * Get placeholder text\n */\n get placeholder(): string {\n return this._placeholder;\n }\n\n /**\n * Set placeholder text\n */\n set placeholder(placeholder: string) {\n this._placeholder = placeholder;\n }\n\n /**\n */\n isBSN(): boolean {\n return this.layouthint.has(\"bsn\");\n }\n\n /**\n */\n isIBAN(): boolean {\n return this.layouthint.has(\"iban\");\n }\n\n /**\n */\n isZipcode(): boolean {\n return this.layouthint.has(\"zipcode\");\n }\n\n /**\n */\n isAvatar(): boolean {\n return this.layouthint.has(\"avatar\");\n }\n\n /**\n */\n isEmail(): boolean {\n return this.layouthint.has(\"email\");\n }\n\n /**\n * Add regex constraints\n */\n addConstraints(): ConstraintCollection {\n const constraints = new ConstraintCollection();\n\n if (this.isBSN()) {\n constraints.add(new BSNConstraint());\n } else if (this.isIBAN()) {\n constraints.add(new IBANConstraint());\n }\n\n if (this.isZipcode()) {\n // validate zip when regex is set is set or exact or isNot\n constraints.add(\n new RegexConstraint({\n messageKey: \"Constraint.ZipCode.InvalidFormat\",\n defaultMessage: \"Must be a valid Dutch ZIP code, e.g. 1234 AB\",\n regex: new RegExp(\"^[1-9][0-9]{3} ?[a-zA-Z]{2}$\", \"gi\"),\n }),\n );\n } else if (this.isEmail() && this.regexp) {\n constraints.add(\n new RegexConstraint({\n messageKey: \"Constraint.Email.InvalidFormat\",\n defaultMessage: \"Must be a valid e-mail address\",\n regex: new RegExp(this.regexp, \"gi\"),\n }),\n );\n } else if (this.regexp) {\n constraints.add(\n new RegexConstraint({\n messageKey: \"Constraint.String.InvalidRegex\",\n defaultMessage: this.regexpvalidationmessage,\n regex: this.regexp,\n }),\n );\n }\n\n return constraints;\n }\n\n /**\n * Reset attribute to empty string\n */\n reset() {\n this.inputvalue = \"\";\n }\n\n /**\n */\n formatIBAN(value: string): string {\n const noFormat = this.removeFormat(value);\n\n const groups = noFormat.replace(/\\s/g, \"\").match(/.{1,4}/g);\n return groups == null ? \"\" : groups.join(\" \");\n }\n\n /**\n */\n formatZipcode(value: string): string {\n const noFormat = this.removeFormat(value);\n if (noFormat.length === 6) {\n return (\n noFormat.substring(0, 4) + \" \" + noFormat.substring(4).toUpperCase()\n );\n }\n return noFormat;\n }\n\n /**\n */\n formatBSN(value: string): string {\n return this.removeFormat(value);\n }\n\n /**\n */\n formatValue(value: ?string): string {\n if (value == null || value.toString() === \"\") {\n return \"\";\n }\n\n if (typeof value !== \"string\") {\n return value;\n }\n\n if (this.isIBAN()) {\n return this.formatIBAN(value);\n }\n\n if (this.isZipcode()) {\n return this.formatZipcode(value);\n }\n\n if (this.isBSN()) {\n return this.formatBSN(value);\n }\n\n return value.replace(/ {2}/gi, \" \\u00A0\");\n }\n\n /**\n */\n removeFormat(value: ?string): string {\n if (value == null || value.toString() === \"\") {\n return \"\";\n }\n\n if (this.isIBAN() || this.isZipcode() || this.isBSN()) {\n return value.replace(/[^a-z0-9,]/gi, \"\");\n }\n\n return value;\n }\n\n /**\n */\n get validateValue(): string {\n return this.removeFormat(this.inputvalue);\n }\n\n /**\n */\n get inputvalue(): string {\n return this.getInputValue();\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\n if (value == null) {\n this.value = value;\n } else {\n this.value = this.removeFormat(value);\n }\n\n this.validate(this.validateValue);\n }\n\n /**\n */\n get readonlyvalue(): string {\n if (typeof this.value === \"string\") {\n const formattedValue = this.formatValue(this.value);\n // fix for rendering of multiple spaces\n return formattedValue.replace(/ {2}/gi, \" \\u00A0\");\n }\n\n return this.value == null ? \"\" : this.value;\n }\n\n /**\n * Update the attribute by name and value\n */\n update(value: string): StringAttributeModel {\n if (this.inputvalue === value) {\n return this;\n }\n\n this.updateLastModification();\n this.inputvalue = value;\n\n return this;\n }\n\n /**\n */\n get readonlyWidth(): $Keys<typeof ATTRIBUTE_WIDTH> {\n if (this.isZipcode() || this.isBSN() || this.isAvatar()) {\n return ATTRIBUTE_WIDTH.SMALL;\n }\n\n if (this.isIBAN()) {\n return ATTRIBUTE_WIDTH.LARGE;\n }\n\n // default value (also applied for email address + download attribute)\n return ATTRIBUTE_WIDTH.MEDIUM;\n }\n}\n"],"mappings":";;AACA,OAAOA,cAAc,MAAM,kBAAkB;AAC7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jC,SAAS,CAAC,CAAC,IAAI,IAAI,CAACH,KAAK,CAAC,CAAC,IAAI,IAAI,CAACI,QAAQ,CAAC,CAAC,EAAE;MACvD,OAAO5B,eAAe,CAAC6D,KAAK;IAC9B;IAEA,IAAI,IAAI,CAACnC,MAAM,CAAC,CAAC,EAAE;MACjB,OAAO1B,eAAe,CAAC8D,KAAK;IAC9B;;IAEA;IACA,OAAO9D,eAAe,CAAC+D,MAAM;EAC/B;AACF"}
|
|
@@ -9,7 +9,7 @@ import { has } from "../../utils/helpers/objects";
|
|
|
9
9
|
import ActionCollection from "../actions/ActionCollection";
|
|
10
10
|
import AttributeCollection from "../attributes/AttributeCollection";
|
|
11
11
|
import ResourceModel from "../base/ResourceModel";
|
|
12
|
-
import { AVATAR,
|
|
12
|
+
import { AVATAR, AVATAR_IN_TITLE, TITLE } from "../../constants/LayoutHints";
|
|
13
13
|
/**
|
|
14
14
|
* Base class for details<br/>
|
|
15
15
|
* For instance the details of case 1<br/>
|
|
@@ -105,7 +105,7 @@ export default class DetailModel extends ResourceModel {
|
|
|
105
105
|
return _filterInstanceProperty(_context3 = this.attributeCollection.all).call(_context3, attribute => {
|
|
106
106
|
const hasTitle = attribute.layouthint.hasExact(TITLE);
|
|
107
107
|
const hasAvatar = attribute.layouthint.hasExact(AVATAR);
|
|
108
|
-
const hasAvatarForTitle = attribute.layouthint.hasExact(
|
|
108
|
+
const hasAvatarForTitle = attribute.layouthint.hasExact(AVATAR_IN_TITLE);
|
|
109
109
|
return !attribute.isHidden && (!hasTitle || hasTitle && hasAvatar) && (!hasAvatarForTitle || hasAvatarForTitle && !hasAvatar);
|
|
110
110
|
});
|
|
111
111
|
}
|
|
@@ -172,7 +172,7 @@ export default class DetailModel extends ResourceModel {
|
|
|
172
172
|
get avatarForTitleAttribute() {
|
|
173
173
|
var _context5;
|
|
174
174
|
const avatarAttributes = _filterInstanceProperty(_context5 = this._attributeCollection.all).call(_context5, attribute => attribute.layouthint.hasExact(AVATAR));
|
|
175
|
-
const avatarForTitleAttribute = _findInstanceProperty(avatarAttributes).call(avatarAttributes, attribute => attribute.layouthint.hasExact(
|
|
175
|
+
const avatarForTitleAttribute = _findInstanceProperty(avatarAttributes).call(avatarAttributes, attribute => attribute.layouthint.hasExact(AVATAR_IN_TITLE));
|
|
176
176
|
return avatarForTitleAttribute || null;
|
|
177
177
|
}
|
|
178
178
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DetailModel.js","names":["has","ActionCollection","AttributeCollection","ResourceModel","AVATAR","AVATAR_FOR_TITLE","TITLE","DetailModel","constructor","modularuiResponse","_defineProperty","createAttributeCollection","createMetadataCollection","createActionCollection","type","modelName","isApplicableModel","data","_context","resourceType","contributions","resourcetype","_endsWithInstanceProperty","call","_includesInstanceProperty","getInitialChildModelLinks","_attributeCollection","setChildModels","models","id","getData","key","label","getContribution","_context2","attributeContributions","attributes","_filterInstanceProperty","contribution","_Object$keys","attributeCollection","collection","_context3","all","attribute","hasTitle","layouthint","hasExact","hasAvatar","hasAvatarForTitle","isHidden","getAttributeByKey","_context4","metadataContributions","metadata","_mapInstanceProperty","metadataKey","metadataCollection","_metadataCollection","_actionCollection","actions","actionCollection","isCase","avatarForTitleAttribute","_context5","avatarAttributes","_findInstanceProperty","titleAttribute","_context6","nonAvatarAttributes","update","model","clonedModel","clone","equals","toString"],"sources":["../../../src/models/detail/DetailModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport ActionCollection from \"../actions/ActionCollection\";\nimport AttributeCollection from \"../attributes/AttributeCollection\";\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport { AVATAR, AVATAR_FOR_TITLE, TITLE } from \"../../constants/LayoutHints\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { ModularUIModel, AttributeType } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Base class for details<br/>\n * For instance the details of case 1<br/>\n * For instance the details of record 12<br/>\n */\nexport default class DetailModel extends ResourceModel {\n _attributeCollection: AttributeCollection;\n _metadataCollection: AttributeCollection;\n _actionCollection: ActionCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this.createAttributeCollection();\n this.createMetadataCollection();\n this.createActionCollection();\n }\n\n /**\n */\n get type(): string {\n return \"Detail\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"DetailModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n const resourceType = data.contributions?.resourcetype;\n return (\n resourceType &&\n (resourceType.endsWith(\"DetailPanel\") ||\n [\"Detail\", \"CasePropertiesPanel\", \"CasePropertiesPanelDetail\"].includes(\n resourceType,\n ))\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this._attributeCollection.getInitialChildModelLinks();\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this._attributeCollection.setChildModels(models);\n }\n\n /**\n * Getting the unique identifier of the details\n */\n get id(): string {\n return this.getData(\"_id\", this.key);\n }\n\n /**\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Attribute collection\n */\n createAttributeCollection() {\n const attributeContributions = this.contributions.attributes\n ? this.contributions.attributes.filter((contribution) => {\n const [key] = Object.keys(contribution);\n return has(this.data, key);\n })\n : [];\n\n this.attributeCollection = new AttributeCollection(\n this.data,\n attributeContributions,\n true,\n );\n }\n\n /**\n */\n get attributeCollection(): AttributeCollection {\n return this._attributeCollection;\n }\n\n /**\n */\n set attributeCollection(collection: AttributeCollection) {\n this._attributeCollection = collection;\n }\n\n /**\n * Retrieve list of visible attributes\n */\n get attributes(): Array<AttributeType> {\n return this.attributeCollection.all.filter((attribute) => {\n const hasTitle = attribute.layouthint.hasExact(TITLE);\n const hasAvatar = attribute.layouthint.hasExact(AVATAR);\n const hasAvatarForTitle = attribute.layouthint.hasExact(AVATAR_FOR_TITLE);\n return (\n !attribute.isHidden &&\n (!hasTitle || (hasTitle && hasAvatar)) &&\n (!hasAvatarForTitle || (hasAvatarForTitle && !hasAvatar))\n );\n });\n }\n\n /**\n * Retrieve an attribute by it's key\n */\n getAttributeByKey(key: string): AttributeType | null {\n return this._attributeCollection.getAttributeByKey(key);\n }\n\n /**\n * Metadata collection\n */\n createMetadataCollection() {\n const metadataContributions = this.contributions.metadata\n ? Object.keys(this.contributions.metadata).map((metadataKey) => ({\n [metadataKey]: this.contributions.metadata[metadataKey],\n }))\n : [];\n\n this.metadataCollection = new AttributeCollection(\n this.data,\n metadataContributions,\n true,\n );\n }\n\n /**\n */\n get metadataCollection(): AttributeCollection {\n return this._metadataCollection;\n }\n\n /**\n */\n set metadataCollection(collection: AttributeCollection) {\n this._metadataCollection = collection;\n }\n\n /**\n * Action collection\n */\n createActionCollection() {\n this._actionCollection = new ActionCollection(\n this.data.actions,\n this.contributions.actions,\n );\n }\n\n /**\n */\n get actionCollection(): ActionCollection {\n return this._actionCollection;\n }\n\n /**\n */\n set actionCollection(actionCollection: ActionCollection) {\n this._actionCollection = actionCollection;\n }\n\n /**\n * Determines if this is a case\n */\n get isCase(): boolean {\n return this.contributions.resourcetype === \"CaseView\";\n }\n\n /**\n * Getting the attribute that has as layout hint 'avatar-for-title'\n */\n get avatarForTitleAttribute(): ?AttributeType {\n const avatarAttributes = this._attributeCollection.all.filter((attribute) =>\n attribute.layouthint.hasExact(AVATAR),\n );\n\n const avatarForTitleAttribute = avatarAttributes.find((attribute) =>\n attribute.layouthint.hasExact(AVATAR_FOR_TITLE),\n );\n\n return avatarForTitleAttribute || null;\n }\n\n /**\n * Getting the attribute that has as layout hint 'title'\n */\n get titleAttribute(): ?AttributeType {\n const nonAvatarAttributes = this._attributeCollection.all.filter(\n (attribute) => !attribute.layouthint.hasExact(AVATAR),\n );\n\n const titleAttribute = nonAvatarAttributes.find((attribute) =>\n attribute.layouthint.has(TITLE),\n );\n\n return titleAttribute || null;\n }\n\n /**\n * Update current detail with a new detail model and return a cloned version of the model\n */\n update(model: ModularUIModel): DetailModel {\n if (model instanceof DetailModel) {\n const clonedModel = this.clone();\n\n clonedModel.attributeCollection = model._attributeCollection;\n clonedModel.metadataCollection = model._metadataCollection;\n clonedModel.actionCollection = model._actionCollection;\n\n return clonedModel;\n }\n\n return this;\n }\n\n /**\n */\n equals(model: DetailModel): boolean {\n return this.id.toString() === model.id.toString();\n }\n}\n"],"mappings":";;;;;;;AACA,SAASA,GAAG,QAAQ,6BAA6B;AAEjD,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,mBAAmB,MAAM,mCAAmC;AACnE,OAAOC,aAAa,MAAM,uBAAuB;AAEjD,SAASC,MAAM,EAAEC,gBAAgB,EAAEC,KAAK,QAAQ,6BAA6B;AAM7E;AACA;AACA;AACA;AACA;AACA,eAAe,MAAMC,WAAW,SAASJ,aAAa,CAAC;EAKrD;AACF;EACEK,WAAWA,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAACC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAEzB,IAAI,CAACC,yBAAyB,CAAC,CAAC;IAChC,IAAI,CAACC,wBAAwB,CAAC,CAAC;IAC/B,IAAI,CAACC,sBAAsB,CAAC,CAAC;EAC/B;;EAEA;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,QAAQ;EACjB;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,aAAa;EACtB;;EAEA;AACF;EACE,OAAOC,iBAAiBA,CAACC,IAAuB,EAAW;IAAA,IAAAC,QAAA;IACzD,MAAMC,YAAY,GAAGF,IAAI,CAACG,aAAa,EAAEC,YAAY;IACrD,OACEF,YAAY,KACXG,yBAAA,CAAAH,YAAY,EAAAI,IAAA,CAAZJ,YAAY,EAAU,aAAa,CAAC,IACnCK,yBAAA,CAAAN,QAAA,IAAC,QAAQ,EAAE,qBAAqB,EAAE,2BAA2B,CAAC,EAAAK,IAAA,CAAAL,QAAA,EAC5DC,YACF,C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AAS,IAAK,CAACA,SAAS,CAACE,UAAU,CAACC,QAAQ,CAAC3C,MAAM,CACtD,CAAC;IAED,MAAM+D,cAAc,GAAGD,qBAAA,CAAAG,mBAAmB,EAAA9C,IAAA,CAAnB8C,mBAAmB,EAAOzB,SAAS,IACxDA,SAAS,CAACE,UAAU,CAAC9C,GAAG,CAACM,KAAK,CAChC,CAAC;IAED,OAAO6D,cAAc,IAAI,IAAI;EAC/B;;EAEA;AACF;AACA;EACEG,MAAMA,CAACC,KAAqB,EAAe;IACzC,IAAIA,KAAK,YAAYhE,WAAW,EAAE;MAChC,MAAMiE,WAAW,GAAG,IAAI,CAACC,KAAK,CAAC,CAAC;MAEhCD,WAAW,CAAChC,mBAAmB,GAAG+B,KAAK,CAAC7C,oBAAoB;MAC5D8C,WAAW,CAACf,kBAAkB,GAAGc,KAAK,CAACb,mBAAmB;MAC1Dc,WAAW,CAACX,gBAAgB,GAAGU,KAAK,CAACZ,iBAAiB;MAEtD,OAAOa,WAAW;IACpB;IAEA,OAAO,IAAI;EACb;;EAEA;AACF;EACEE,MAAMA,CAACH,KAAkB,EAAW;IAClC,OAAO,IAAI,CAAC1C,EAAE,CAAC8C,QAAQ,CAAC,CAAC,KAAKJ,KAAK,CAAC1C,EAAE,CAAC8C,QAAQ,CAAC,CAAC;EACnD;AACF"}
|
|
1
|
+
{"version":3,"file":"DetailModel.js","names":["has","ActionCollection","AttributeCollection","ResourceModel","AVATAR","AVATAR_IN_TITLE","TITLE","DetailModel","constructor","modularuiResponse","_defineProperty","createAttributeCollection","createMetadataCollection","createActionCollection","type","modelName","isApplicableModel","data","_context","resourceType","contributions","resourcetype","_endsWithInstanceProperty","call","_includesInstanceProperty","getInitialChildModelLinks","_attributeCollection","setChildModels","models","id","getData","key","label","getContribution","_context2","attributeContributions","attributes","_filterInstanceProperty","contribution","_Object$keys","attributeCollection","collection","_context3","all","attribute","hasTitle","layouthint","hasExact","hasAvatar","hasAvatarForTitle","isHidden","getAttributeByKey","_context4","metadataContributions","metadata","_mapInstanceProperty","metadataKey","metadataCollection","_metadataCollection","_actionCollection","actions","actionCollection","isCase","avatarForTitleAttribute","_context5","avatarAttributes","_findInstanceProperty","titleAttribute","_context6","nonAvatarAttributes","update","model","clonedModel","clone","equals","toString"],"sources":["../../../src/models/detail/DetailModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport ActionCollection from \"../actions/ActionCollection\";\nimport AttributeCollection from \"../attributes/AttributeCollection\";\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport { AVATAR, AVATAR_IN_TITLE, TITLE } from \"../../constants/LayoutHints\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { ModularUIModel, AttributeType } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Base class for details<br/>\n * For instance the details of case 1<br/>\n * For instance the details of record 12<br/>\n */\nexport default class DetailModel extends ResourceModel {\n _attributeCollection: AttributeCollection;\n _metadataCollection: AttributeCollection;\n _actionCollection: ActionCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this.createAttributeCollection();\n this.createMetadataCollection();\n this.createActionCollection();\n }\n\n /**\n */\n get type(): string {\n return \"Detail\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"DetailModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n const resourceType = data.contributions?.resourcetype;\n return (\n resourceType &&\n (resourceType.endsWith(\"DetailPanel\") ||\n [\"Detail\", \"CasePropertiesPanel\", \"CasePropertiesPanelDetail\"].includes(\n resourceType,\n ))\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this._attributeCollection.getInitialChildModelLinks();\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this._attributeCollection.setChildModels(models);\n }\n\n /**\n * Getting the unique identifier of the details\n */\n get id(): string {\n return this.getData(\"_id\", this.key);\n }\n\n /**\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Attribute collection\n */\n createAttributeCollection() {\n const attributeContributions = this.contributions.attributes\n ? this.contributions.attributes.filter((contribution) => {\n const [key] = Object.keys(contribution);\n return has(this.data, key);\n })\n : [];\n\n this.attributeCollection = new AttributeCollection(\n this.data,\n attributeContributions,\n true,\n );\n }\n\n /**\n */\n get attributeCollection(): AttributeCollection {\n return this._attributeCollection;\n }\n\n /**\n */\n set attributeCollection(collection: AttributeCollection) {\n this._attributeCollection = collection;\n }\n\n /**\n * Retrieve list of visible attributes\n */\n get attributes(): Array<AttributeType> {\n return this.attributeCollection.all.filter((attribute) => {\n const hasTitle = attribute.layouthint.hasExact(TITLE);\n const hasAvatar = attribute.layouthint.hasExact(AVATAR);\n const hasAvatarForTitle = attribute.layouthint.hasExact(AVATAR_IN_TITLE);\n return (\n !attribute.isHidden &&\n (!hasTitle || (hasTitle && hasAvatar)) &&\n (!hasAvatarForTitle || (hasAvatarForTitle && !hasAvatar))\n );\n });\n }\n\n /**\n * Retrieve an attribute by it's key\n */\n getAttributeByKey(key: string): AttributeType | null {\n return this._attributeCollection.getAttributeByKey(key);\n }\n\n /**\n * Metadata collection\n */\n createMetadataCollection() {\n const metadataContributions = this.contributions.metadata\n ? Object.keys(this.contributions.metadata).map((metadataKey) => ({\n [metadataKey]: this.contributions.metadata[metadataKey],\n }))\n : [];\n\n this.metadataCollection = new AttributeCollection(\n this.data,\n metadataContributions,\n true,\n );\n }\n\n /**\n */\n get metadataCollection(): AttributeCollection {\n return this._metadataCollection;\n }\n\n /**\n */\n set metadataCollection(collection: AttributeCollection) {\n this._metadataCollection = collection;\n }\n\n /**\n * Action collection\n */\n createActionCollection() {\n this._actionCollection = new ActionCollection(\n this.data.actions,\n this.contributions.actions,\n );\n }\n\n /**\n */\n get actionCollection(): ActionCollection {\n return this._actionCollection;\n }\n\n /**\n */\n set actionCollection(actionCollection: ActionCollection) {\n this._actionCollection = actionCollection;\n }\n\n /**\n * Determines if this is a case\n */\n get isCase(): boolean {\n return this.contributions.resourcetype === \"CaseView\";\n }\n\n /**\n * Getting the attribute that has as layout hint 'avatar-for-title'\n */\n get avatarForTitleAttribute(): ?AttributeType {\n const avatarAttributes = this._attributeCollection.all.filter((attribute) =>\n attribute.layouthint.hasExact(AVATAR),\n );\n\n const avatarForTitleAttribute = avatarAttributes.find((attribute) =>\n attribute.layouthint.hasExact(AVATAR_IN_TITLE),\n );\n\n return avatarForTitleAttribute || null;\n }\n\n /**\n * Getting the attribute that has as layout hint 'title'\n */\n get titleAttribute(): ?AttributeType {\n const nonAvatarAttributes = this._attributeCollection.all.filter(\n (attribute) => !attribute.layouthint.hasExact(AVATAR),\n );\n\n const titleAttribute = nonAvatarAttributes.find((attribute) =>\n attribute.layouthint.has(TITLE),\n );\n\n return titleAttribute || null;\n }\n\n /**\n * Update current detail with a new detail model and return a cloned version of the model\n */\n update(model: ModularUIModel): DetailModel {\n if (model instanceof DetailModel) {\n const clonedModel = this.clone();\n\n clonedModel.attributeCollection = model._attributeCollection;\n clonedModel.metadataCollection = model._metadataCollection;\n clonedModel.actionCollection = model._actionCollection;\n\n return clonedModel;\n }\n\n return this;\n }\n\n /**\n */\n equals(model: DetailModel): boolean {\n return this.id.toString() === model.id.toString();\n }\n}\n"],"mappings":";;;;;;;AACA,SAASA,GAAG,QAAQ,6BAA6B;AAEjD,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,mBAAmB,MAAM,mCAAmC;AACnE,OAAOC,aAAa,MAAM,uBAAuB;AAEjD,SAASC,MAAM,EAAEC,eAAe,EAAEC,KAAK,QAAQ,6BAA6B;AAM5E;AACA;AACA;AACA;AACA;AACA,eAAe,MAAMC,WAAW,SAASJ,aAAa,CAAC;EAKrD;AACF;EACEK,WAAWA,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAACC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAEzB,IAAI,CAACC,yBAAyB,CAAC,CAAC;IACh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kB,EAAW;IAClC,OAAO,IAAI,CAAC1C,EAAE,CAAC8C,QAAQ,CAAC,CAAC,KAAKJ,KAAK,CAAC1C,EAAE,CAAC8C,QAAQ,CAAC,CAAC;EACnD;AACF"}
|
|
@@ -153,15 +153,6 @@ const LayoutHintConfiguration = exports.LayoutHintConfiguration = {
|
|
|
153
153
|
link: "",
|
|
154
154
|
component: ["tab"]
|
|
155
155
|
},
|
|
156
|
-
AVATAR_FOR_TITLE: {
|
|
157
|
-
hint: "avatar-for-title",
|
|
158
|
-
description: {
|
|
159
|
-
NL: "Markeert een attribuut als een avatar voor het titelattribuut.",
|
|
160
|
-
EN: "Marks an attribute as an avatar for the title attribute."
|
|
161
|
-
},
|
|
162
|
-
link: "",
|
|
163
|
-
component: ["caseview_table", "codemap", "list/appointment_table", "list/assignment_table", "list/caseproperties_table", "list/document_table", "list/timelimit_table", "list/eventhistory_table", "list/note_table", "list/record_table", "list/case_table", "list/casesearch_table", "list/datastore_table", "list/datastoreview_table", "list/instrumentresult_table", "list/event_table", "list/user_table", "list/organization_table"]
|
|
164
|
-
},
|
|
165
156
|
AVATAR: {
|
|
166
157
|
hint: "avatar",
|
|
167
158
|
description: {
|
|
@@ -169,7 +160,16 @@ const LayoutHintConfiguration = exports.LayoutHintConfiguration = {
|
|
|
169
160
|
EN: "Render the attribute as the user's avatar."
|
|
170
161
|
},
|
|
171
162
|
link: "",
|
|
172
|
-
component: ["
|
|
163
|
+
component: ["attribute/upload", "list/user_table"]
|
|
164
|
+
},
|
|
165
|
+
AVATAR_IN_TITLE: {
|
|
166
|
+
hint: "avatar-in-title",
|
|
167
|
+
description: {
|
|
168
|
+
NL: "Geeft aan dat de avatarafbeelding in de titel wordt opgenomen. De avatarafbeelding wordt vóór het titel attribuut weergegeven in de lijstweergave en de snelle lijst quick view.",
|
|
169
|
+
EN: "Indicates that the avatar image will be included in the title. The avatar image is shown in front of the title attribute in the list view and list quick view."
|
|
170
|
+
},
|
|
171
|
+
link: "",
|
|
172
|
+
component: ["list/user_table"]
|
|
173
173
|
}
|
|
174
174
|
};
|
|
175
175
|
//# sourceMappingURL=LayoutHintConfig.js.map
|
|
@@ -167,34 +167,6 @@ export const LayoutHintConfiguration = {
|
|
|
167
167
|
link: "",
|
|
168
168
|
component: ["tab"],
|
|
169
169
|
},
|
|
170
|
-
AVATAR_FOR_TITLE: {
|
|
171
|
-
hint: "avatar-for-title",
|
|
172
|
-
description: {
|
|
173
|
-
NL: "Markeert een attribuut als een avatar voor het titelattribuut.",
|
|
174
|
-
EN: "Marks an attribute as an avatar for the title attribute.",
|
|
175
|
-
},
|
|
176
|
-
link: "",
|
|
177
|
-
component: [
|
|
178
|
-
"caseview_table",
|
|
179
|
-
"codemap",
|
|
180
|
-
"list/appointment_table",
|
|
181
|
-
"list/assignment_table",
|
|
182
|
-
"list/caseproperties_table",
|
|
183
|
-
"list/document_table",
|
|
184
|
-
"list/timelimit_table",
|
|
185
|
-
"list/eventhistory_table",
|
|
186
|
-
"list/note_table",
|
|
187
|
-
"list/record_table",
|
|
188
|
-
"list/case_table",
|
|
189
|
-
"list/casesearch_table",
|
|
190
|
-
"list/datastore_table",
|
|
191
|
-
"list/datastoreview_table",
|
|
192
|
-
"list/instrumentresult_table",
|
|
193
|
-
"list/event_table",
|
|
194
|
-
"list/user_table",
|
|
195
|
-
"list/organization_table",
|
|
196
|
-
],
|
|
197
|
-
},
|
|
198
170
|
AVATAR: {
|
|
199
171
|
hint: "avatar",
|
|
200
172
|
description: {
|
|
@@ -202,25 +174,15 @@ export const LayoutHintConfiguration = {
|
|
|
202
174
|
EN: "Render the attribute as the user's avatar.",
|
|
203
175
|
},
|
|
204
176
|
link: "",
|
|
205
|
-
component: [
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
"
|
|
211
|
-
"list
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
"list/record_table",
|
|
216
|
-
"list/case_table",
|
|
217
|
-
"list/casesearch_table",
|
|
218
|
-
"list/datastore_table",
|
|
219
|
-
"list/datastoreview_table",
|
|
220
|
-
"list/instrumentresult_table",
|
|
221
|
-
"list/event_table",
|
|
222
|
-
"list/user_table",
|
|
223
|
-
"list/organization_table",
|
|
224
|
-
],
|
|
177
|
+
component: ["attribute/upload", "list/user_table"],
|
|
178
|
+
},
|
|
179
|
+
AVATAR_IN_TITLE: {
|
|
180
|
+
hint: "avatar-in-title",
|
|
181
|
+
description: {
|
|
182
|
+
NL: "Geeft aan dat de avatarafbeelding in de titel wordt opgenomen. De avatarafbeelding wordt vóór het titel attribuut weergegeven in de lijstweergave en de snelle lijst quick view.",
|
|
183
|
+
EN: "Indicates that the avatar image will be included in the title. The avatar image is shown in front of the title attribute in the list view and list quick view.",
|
|
184
|
+
},
|
|
185
|
+
link: "",
|
|
186
|
+
component: ["list/user_table"],
|
|
225
187
|
},
|
|
226
188
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutHintConfig.js","names":["LayoutHintConfiguration","exports","MANDATORY","hint","description","NL","EN","link","component","DEPENDENT_ATTRIBUTE_CONTROL","DEPENDENT_ATTRIBUTE_ACTION","SHOW_ONE_RESULT_AS_DETAIL","HIDE_WHEN_EMPTY","INITIAL_FILTER","CONFIRM_PASSWORD","TITLE","INITIAL_TOTAL_FILESIZE","MAX_TOTAL_FILESIZE","CREATE_ACTION","UPDATE_ACTION","DELETE_ACTION","SORT_OPTIONS","CASEVIEW_LINK","DISABLED","HIDE_IN_USER_INTERFACE","AVATAR_FOR_TITLE","AVATAR"],"sources":["../../src/constants/LayoutHintConfig.js"],"sourcesContent":["// @flow\nexport const LayoutHintConfiguration = {\n MANDATORY: {\n hint: \"mandatory\",\n description: {\n NL: \"Geeft aan of een attribuut verplicht is. Dient samen met de dependency hint gebruikt te worden.\",\n EN: \"Indicates a mandatory attribute.\\nShould be used together with the dependency hint.\",\n },\n link: \"\",\n component: [\"attribute\"],\n },\n DEPENDENT_ATTRIBUTE_CONTROL: {\n hint: \"dependent-control:${unique-control-id}\",\n description: {\n NL: \"Geeft aan dat dit het attribuut is waar attributen van afhankelijk zijn. Het unique-control-id is een uniek id dat kan worden gebruikt in the hint voor de show|hide actie op het afhankelijke attribuut.\",\n EN: \"Marks the choice attribute where other attributes depend on. The unique control id is a unique id that can be used in the hint for the show|hide action on the dependent attribute.\",\n },\n link: \"\",\n component: [\"attribute/boolean\", \"attribute/choice\"],\n },\n DEPENDENT_ATTRIBUTE_ACTION: {\n hint: \"dependent-attribute:(show|hide) when dependent-control:${unique-control-id} (equals|includes|notEquals|notIncludes) [${codemaps}]\",\n description: {\n NL: \"Toon of verberg een attribute dat afhankelijk is van de geselecteerde opties van een keuze attribute\",\n EN: \"To show or hide an attribute dependent on options of the choice control codemap that are selected or not selected.\",\n },\n link: \"\",\n component: [\"attribute\"],\n },\n SHOW_ONE_RESULT_AS_DETAIL: {\n hint: \"show-one-result-as-detail\",\n description: {\n NL: \"Een lijst met maar één item mag direct als detail getoond worden.\",\n EN: \"A list with only one detail must be shown as a detail.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n HIDE_WHEN_EMPTY: {\n hint: \"hide-when-empty\",\n description: {\n NL: \"Een lijst zonder lijst-items en lijst-taken dient niet getoond worden.\",\n EN: \"A list without list-items and list-tasks should not be shown.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n INITIAL_FILTER: {\n hint: \"initial-filter:${filter-name}=${initial-value}\",\n description: {\n NL: \"Laad de lijst met een standaardwaarde voor een filter, er is geen controle op het bestaan van het filter. Als het filter niet is geconfigureerd, treedt er een fout op. Houd er rekening mee dat filters hoofdlettergevoelig zijn.\",\n EN: \"Load the list with a default value for a filter, there is no check for the existence of the filter. If the filter is not configured, an error occurs. Keep in mind that filters are case sensitive.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n CONFIRM_PASSWORD: {\n hint: \"confirm-password\",\n description: {\n NL: \"Wachtwoord attribuut moet bevestigd worden dmv een tweede wachtwoord attribuut.\",\n EN: \"Password attribute must be confirmed using a second password attribute.\",\n },\n link: \"\",\n component: [\"attribute/password\"],\n },\n TITLE: {\n hint: \"title\",\n description: {\n NL: \"Markeert een attribuut als een titel attribuut\",\n EN: \"Marks an attribute as a title attribute\",\n },\n link: \"\",\n component: [\n \"caseview_table\",\n \"codemap\",\n \"list/appointment_table\",\n \"list/assignment_table\",\n \"list/caseproperties_table\",\n \"list/document_table\",\n \"list/timelimit_table\",\n \"list/eventhistory_table\",\n \"list/note_table\",\n \"list/record_table\",\n \"list/case_table\",\n \"list/casesearch_table\",\n \"list/datastore_table\",\n \"list/datastoreview_table\",\n \"list/instrumentresult_table\",\n \"list/event_table\",\n \"list/user_table\",\n \"list/organization_table\",\n ],\n },\n INITIAL_TOTAL_FILESIZE: {\n hint: \"initial-total-file-size\",\n description: {\n NL: \"Wordt gebruikt in samenwerking met een upload attribuut, deze hint moet worden gezet op een readonly attribuut dat de reeds gebruikte file grootte bevat.\",\n EN: \"Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the file size currently used.\",\n },\n link: \"\",\n component: [\"attribute/number\"],\n },\n MAX_TOTAL_FILESIZE: {\n hint: \"max-total-file-size\",\n description: {\n NL: \"Wordt gebruikt in samenwerking met een upload attribuut, deze hint moet worden gezet op een readonly attribuut dat de maximaal toegestane file grootte bevat.\",\n EN: \"Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the maximum allowed total file size.\",\n },\n link: \"\",\n component: [\"attribute/number\"],\n },\n CREATE_ACTION: {\n hint: \"create\",\n description: {\n NL: \"Markeer taak als creëer taak.\",\n EN: \"Mark task as create task\",\n },\n component: [\"form\"],\n },\n UPDATE_ACTION: {\n hint: \"update\",\n description: {\n NL: \"Markeer taak als bewerk taak.\",\n EN: \"Mark task as update task\",\n },\n component: [\"form\"],\n },\n DELETE_ACTION: {\n hint: \"delete\",\n description: {\n NL: \"Markeer taak als verwijder taak.\",\n EN: \"Mark task as delete task\",\n },\n component: [\"form\"],\n },\n SORT_OPTIONS: {\n hint: \"sort-options\",\n description: {\n NL: \"Sorteer opties alfabetisch\",\n EN: \"Sort options alphabetically\",\n },\n component: [\"attribute/choice\"],\n },\n CASEVIEW_LINK: {\n hint: \"case-view-link\",\n description: {\n NL: \"Markeer een case id reference attribute als de referentie naar de case view. Vervangt de self link van een lijst item\",\n EN: \"Mark a case id reference attribute as the reference to the case view. Replaces the self link of a list item\",\n },\n component: [\"attribute/reference\", \"list/datastore_table\"],\n },\n DISABLED: {\n hint: \"disabled\",\n description: {\n NL: \"Geeft aan of een attribuut uitgeschakeld is.\",\n EN: \"Indicates a disabled attribute.\",\n },\n link: \"\",\n component: [\"attribute\"],\n },\n HIDE_IN_USER_INTERFACE: {\n hint: \"hide-in-user-interface\",\n description: {\n NL: \"Verberg een tab in de user interface.\",\n EN: \"Hide a tab in the user interface.\",\n },\n link: \"\",\n component: [\"tab\"],\n },\n AVATAR_FOR_TITLE: {\n hint: \"avatar-for-title\",\n description: {\n NL: \"Markeert een attribuut als een avatar voor het titelattribuut.\",\n EN: \"Marks an attribute as an avatar for the title attribute.\",\n },\n link: \"\",\n component: [\n \"caseview_table\",\n \"codemap\",\n \"list/appointment_table\",\n \"list/assignment_table\",\n \"list/caseproperties_table\",\n \"list/document_table\",\n \"list/timelimit_table\",\n \"list/eventhistory_table\",\n \"list/note_table\",\n \"list/record_table\",\n \"list/case_table\",\n \"list/casesearch_table\",\n \"list/datastore_table\",\n \"list/datastoreview_table\",\n \"list/instrumentresult_table\",\n \"list/event_table\",\n \"list/user_table\",\n \"list/organization_table\",\n ],\n },\n AVATAR: {\n hint: \"avatar\",\n description: {\n NL: \"Geef het attribuut weer als de avatar van de gebruiker.\",\n EN: \"Render the attribute as the user's avatar.\",\n },\n link: \"\",\n component: [\n \"caseview_table\",\n \"codemap\",\n \"list/appointment_table\",\n \"list/assignment_table\",\n \"list/caseproperties_table\",\n \"list/document_table\",\n \"list/timelimit_table\",\n \"list/eventhistory_table\",\n \"list/note_table\",\n \"list/record_table\",\n \"list/case_table\",\n \"list/casesearch_table\",\n \"list/datastore_table\",\n \"list/datastoreview_table\",\n \"list/instrumentresult_table\",\n \"list/event_table\",\n \"list/user_table\",\n \"list/organization_table\",\n ],\n },\n};\n"],"mappings":";;;;;;AACO,MAAMA,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAG;EACrCE,SAAS,EAAE;IACTC,IAAI,EAAE,WAAW;IACjBC,WAAW,EAAE;MACXC,EAAE,EAAE,iGAAiG;MACrGC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CAAC,WAAW;EACzB,CAAC;EACDC,2BAA2B,EAAE;IAC3BN,IAAI,EAAE,wCAAwC;IAC9CC,WAAW,EAAE;MACXC,EAAE,EAAE,2MAA2M;MAC/MC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CAAC,mBAAmB,EAAE,kBAAkB;EACrD,CAAC;EACDE,0BAA0B,EAAE;IAC1BP,IAAI,EAAE,mIAAmI;IACzIC,WAAW,EAAE;MACXC,EAAE,EAAE,sGAAsG;MAC1GC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CAAC,WAAW;EACzB,CAAC;EACDG,yBAAyB,EAAE;IACzBR,IAAI,EAAE,2BAA2B;IACjCC,WAAW,EAAE;MACXC,EAAE,EAAE,mEAAmE;MACvEC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CAAC,MAAM;EACpB,CAAC;EACDI,eAAe,EAAE;IACfT,IAAI,EAAE,iBAAiB;IACvBC,WAAW,EAAE;MACXC,EAAE,EAAE,wEAAwE;MAC5EC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CAAC,MAAM;EACpB,CAAC;EACDK,cAAc,EAAE;IACdV,IAAI,EAAE,gDAAgD;IACtDC,WAAW,EAAE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IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CACT,gBAAgB,EAChB,SAAS,EACT,wBAAwB,EACxB,uBAAuB,EACvB,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,sBAAsB,EACtB,0BAA0B,EAC1B,6BAA6B,EAC7B,kBAAkB,EAClB,iBAAiB,EACjB,yBAAyB;EAE7B,CAAC;EACDkB,MAAM,EAAE;IACNvB,IAAI,EAAE,QAAQ;IACdC,WAAW,EAAE;MACXC,EAAE,EAAE,yDAAyD;MAC7DC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CACT,gBAAgB,EAChB,SAAS,EACT,wBAAwB,EACxB,uBAAuB,EACvB,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,sBAAsB,EACtB,0BAA0B,EAC1B,6BAA6B,EAC7B,kBAAkB,EAClB,iBAAiB,EACjB,yBAAyB;EAE7B;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"LayoutHintConfig.js","names":["LayoutHintConfiguration","exports","MANDATORY","hint","description","NL","EN","link","component","DEPENDENT_ATTRIBUTE_CONTROL","DEPENDENT_ATTRIBUTE_ACTION","SHOW_ONE_RESULT_AS_DETAIL","HIDE_WHEN_EMPTY","INITIAL_FILTER","CONFIRM_PASSWORD","TITLE","INITIAL_TOTAL_FILESIZE","MAX_TOTAL_FILESIZE","CREATE_ACTION","UPDATE_ACTION","DELETE_ACTION","SORT_OPTIONS","CASEVIEW_LINK","DISABLED","HIDE_IN_USER_INTERFACE","AVATAR","AVATAR_IN_TITLE"],"sources":["../../src/constants/LayoutHintConfig.js"],"sourcesContent":["// @flow\nexport const LayoutHintConfiguration = {\n MANDATORY: {\n hint: \"mandatory\",\n description: {\n NL: \"Geeft aan of een attribuut verplicht is. Dient samen met de dependency hint gebruikt te worden.\",\n EN: \"Indicates a mandatory attribute.\\nShould be used together with the dependency hint.\",\n },\n link: \"\",\n component: [\"attribute\"],\n },\n DEPENDENT_ATTRIBUTE_CONTROL: {\n hint: \"dependent-control:${unique-control-id}\",\n description: {\n NL: \"Geeft aan dat dit het attribuut is waar attributen van afhankelijk zijn. Het unique-control-id is een uniek id dat kan worden gebruikt in the hint voor de show|hide actie op het afhankelijke attribuut.\",\n EN: \"Marks the choice attribute where other attributes depend on. The unique control id is a unique id that can be used in the hint for the show|hide action on the dependent attribute.\",\n },\n link: \"\",\n component: [\"attribute/boolean\", \"attribute/choice\"],\n },\n DEPENDENT_ATTRIBUTE_ACTION: {\n hint: \"dependent-attribute:(show|hide) when dependent-control:${unique-control-id} (equals|includes|notEquals|notIncludes) [${codemaps}]\",\n description: {\n NL: \"Toon of verberg een attribute dat afhankelijk is van de geselecteerde opties van een keuze attribute\",\n EN: \"To show or hide an attribute dependent on options of the choice control codemap that are selected or not selected.\",\n },\n link: \"\",\n component: [\"attribute\"],\n },\n SHOW_ONE_RESULT_AS_DETAIL: {\n hint: \"show-one-result-as-detail\",\n description: {\n NL: \"Een lijst met maar één item mag direct als detail getoond worden.\",\n EN: \"A list with only one detail must be shown as a detail.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n HIDE_WHEN_EMPTY: {\n hint: \"hide-when-empty\",\n description: {\n NL: \"Een lijst zonder lijst-items en lijst-taken dient niet getoond worden.\",\n EN: \"A list without list-items and list-tasks should not be shown.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n INITIAL_FILTER: {\n hint: \"initial-filter:${filter-name}=${initial-value}\",\n description: {\n NL: \"Laad de lijst met een standaardwaarde voor een filter, er is geen controle op het bestaan van het filter. Als het filter niet is geconfigureerd, treedt er een fout op. Houd er rekening mee dat filters hoofdlettergevoelig zijn.\",\n EN: \"Load the list with a default value for a filter, there is no check for the existence of the filter. If the filter is not configured, an error occurs. Keep in mind that filters are case sensitive.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n CONFIRM_PASSWORD: {\n hint: \"confirm-password\",\n description: {\n NL: \"Wachtwoord attribuut moet bevestigd worden dmv een tweede wachtwoord attribuut.\",\n EN: \"Password attribute must be confirmed using a second password attribute.\",\n },\n link: \"\",\n component: [\"attribute/password\"],\n },\n TITLE: {\n hint: \"title\",\n description: {\n NL: \"Markeert een attribuut als een titel attribuut\",\n EN: \"Marks an attribute as a title attribute\",\n },\n link: \"\",\n component: [\n \"caseview_table\",\n \"codemap\",\n \"list/appointment_table\",\n \"list/assignment_table\",\n \"list/caseproperties_table\",\n \"list/document_table\",\n \"list/timelimit_table\",\n \"list/eventhistory_table\",\n \"list/note_table\",\n \"list/record_table\",\n \"list/case_table\",\n \"list/casesearch_table\",\n \"list/datastore_table\",\n \"list/datastoreview_table\",\n \"list/instrumentresult_table\",\n \"list/event_table\",\n \"list/user_table\",\n \"list/organization_table\",\n ],\n },\n INITIAL_TOTAL_FILESIZE: {\n hint: \"initial-total-file-size\",\n description: {\n NL: \"Wordt gebruikt in samenwerking met een upload attribuut, deze hint moet worden gezet op een readonly attribuut dat de reeds gebruikte file grootte bevat.\",\n EN: \"Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the file size currently used.\",\n },\n link: \"\",\n component: [\"attribute/number\"],\n },\n MAX_TOTAL_FILESIZE: {\n hint: \"max-total-file-size\",\n description: {\n NL: \"Wordt gebruikt in samenwerking met een upload attribuut, deze hint moet worden gezet op een readonly attribuut dat de maximaal toegestane file grootte bevat.\",\n EN: \"Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the maximum allowed total file size.\",\n },\n link: \"\",\n component: [\"attribute/number\"],\n },\n CREATE_ACTION: {\n hint: \"create\",\n description: {\n NL: \"Markeer taak als creëer taak.\",\n EN: \"Mark task as create task\",\n },\n component: [\"form\"],\n },\n UPDATE_ACTION: {\n hint: \"update\",\n description: {\n NL: \"Markeer taak als bewerk taak.\",\n EN: \"Mark task as update task\",\n },\n component: [\"form\"],\n },\n DELETE_ACTION: {\n hint: \"delete\",\n description: {\n NL: \"Markeer taak als verwijder taak.\",\n EN: \"Mark task as delete task\",\n },\n component: [\"form\"],\n },\n SORT_OPTIONS: {\n hint: \"sort-options\",\n description: {\n NL: \"Sorteer opties alfabetisch\",\n EN: \"Sort options alphabetically\",\n },\n component: [\"attribute/choice\"],\n },\n CASEVIEW_LINK: {\n hint: \"case-view-link\",\n description: {\n NL: \"Markeer een case id reference attribute als de referentie naar de case view. Vervangt de self link van een lijst item\",\n EN: \"Mark a case id reference attribute as the reference to the case view. Replaces the self link of a list item\",\n },\n component: [\"attribute/reference\", \"list/datastore_table\"],\n },\n DISABLED: {\n hint: \"disabled\",\n description: {\n NL: \"Geeft aan of een attribuut uitgeschakeld is.\",\n EN: \"Indicates a disabled attribute.\",\n },\n link: \"\",\n component: [\"attribute\"],\n },\n HIDE_IN_USER_INTERFACE: {\n hint: \"hide-in-user-interface\",\n description: {\n NL: \"Verberg een tab in de user interface.\",\n EN: \"Hide a tab in the user interface.\",\n },\n link: \"\",\n component: [\"tab\"],\n },\n AVATAR: {\n hint: \"avatar\",\n description: {\n NL: \"Geef het attribuut weer als de avatar van de gebruiker.\",\n EN: \"Render the attribute as the user's avatar.\",\n },\n link: \"\",\n component: [\"attribute/upload\", \"list/user_table\"],\n },\n AVATAR_IN_TITLE: {\n hint: \"avatar-in-title\",\n description: {\n NL: \"Geeft aan dat de avatarafbeelding in de titel wordt opgenomen. De avatarafbeelding wordt vóór het titel attribuut weergegeven in de lijstweergave en de snelle lijst quick view.\",\n EN: \"Indicates that the avatar image will be included in the title. The avatar image is shown in front of the title attribute in the list view and list quick view.\",\n },\n link: \"\",\n component: [\"list/user_table\"],\n },\n};\n"],"mappings":";;;;;;AACO,MAAMA,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAG;EACrCE,SAAS,EAAE;IACTC,IAAI,EAAE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C,SAAS,EAAE,CAAC,iBAAiB;EAC/B;AACF,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getLayoutHintConfiguration = exports.default = exports.UPDATE_ACTION = exports.TITLE = exports.SORT_OPTIONS = exports.SHOW_ONE_RESULT_AS_DETAIL = exports.RENDER_SECTION_LABEL = exports.MAX_TOTAL_FILESIZE = exports.MANDATORY = exports.INITIAL_TOTAL_FILESIZE = exports.INITIAL_FILTER = exports.HIDE_WHEN_EMPTY = exports.HIDE_IN_USER_INTERFACE = exports.DISABLED = exports.DEPENDENT_ATTRIBUTE_CONTROL = exports.DEPENDENT_ATTRIBUTE = exports.DELETE_ACTION = exports.CREATE_ACTION = exports.CONFIRM_PASSWORD = exports.CASEVIEW_LINK = exports.
|
|
6
|
+
exports.getLayoutHintConfiguration = exports.default = exports.UPDATE_ACTION = exports.TITLE = exports.SORT_OPTIONS = exports.SHOW_ONE_RESULT_AS_DETAIL = exports.RENDER_SECTION_LABEL = exports.MAX_TOTAL_FILESIZE = exports.MANDATORY = exports.INITIAL_TOTAL_FILESIZE = exports.INITIAL_FILTER = exports.HIDE_WHEN_EMPTY = exports.HIDE_IN_USER_INTERFACE = exports.DISABLED = exports.DEPENDENT_ATTRIBUTE_CONTROL = exports.DEPENDENT_ATTRIBUTE = exports.DELETE_ACTION = exports.CREATE_ACTION = exports.CONFIRM_PASSWORD = exports.CASEVIEW_LINK = exports.AVATAR_IN_TITLE = exports.AVATAR = void 0;
|
|
7
7
|
var _LayoutHintConfig = require("./LayoutHintConfig");
|
|
8
8
|
/**
|
|
9
9
|
* Retrieve layout hint by id from the layout hint configuration
|
|
@@ -129,7 +129,7 @@ const getLayoutHintConfiguration = () => _LayoutHintConfig.LayoutHintConfigurati
|
|
|
129
129
|
* Layout-hint: Marks an attribute as an avatar for the title attribute.
|
|
130
130
|
*/
|
|
131
131
|
exports.getLayoutHintConfiguration = getLayoutHintConfiguration;
|
|
132
|
-
const
|
|
132
|
+
const AVATAR_IN_TITLE = exports.AVATAR_IN_TITLE = getHint("AVATAR_IN_TITLE");
|
|
133
133
|
const AVATAR = exports.AVATAR = getHint("AVATAR");
|
|
134
134
|
var _default = exports.default = getHint;
|
|
135
135
|
//# sourceMappingURL=LayoutHints.js.map
|
|
@@ -127,7 +127,7 @@ export const getLayoutHintConfiguration = (): Object => LayoutHintConfiguration;
|
|
|
127
127
|
/**
|
|
128
128
|
* Layout-hint: Marks an attribute as an avatar for the title attribute.
|
|
129
129
|
*/
|
|
130
|
-
export const
|
|
130
|
+
export const AVATAR_IN_TITLE: string = getHint("AVATAR_IN_TITLE");
|
|
131
131
|
|
|
132
132
|
export const AVATAR: string = getHint("AVATAR");
|
|
133
133
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutHints.js","names":["_LayoutHintConfig","require","getHint","hint","LayoutHintConfiguration","MANDATORY","exports","DISABLED","DEPENDENT_ATTRIBUTE_CONTROL","DEPENDENT_ATTRIBUTE","CONFIRM_PASSWORD","SORT_OPTIONS","TITLE","DELETE_ACTION","UPDATE_ACTION","CREATE_ACTION","INITIAL_TOTAL_FILESIZE","MAX_TOTAL_FILESIZE","SHOW_ONE_RESULT_AS_DETAIL","HIDE_WHEN_EMPTY","INITIAL_FILTER","CASEVIEW_LINK","RENDER_SECTION_LABEL","HIDE_IN_USER_INTERFACE","getLayoutHintConfiguration","
|
|
1
|
+
{"version":3,"file":"LayoutHints.js","names":["_LayoutHintConfig","require","getHint","hint","LayoutHintConfiguration","MANDATORY","exports","DISABLED","DEPENDENT_ATTRIBUTE_CONTROL","DEPENDENT_ATTRIBUTE","CONFIRM_PASSWORD","SORT_OPTIONS","TITLE","DELETE_ACTION","UPDATE_ACTION","CREATE_ACTION","INITIAL_TOTAL_FILESIZE","MAX_TOTAL_FILESIZE","SHOW_ONE_RESULT_AS_DETAIL","HIDE_WHEN_EMPTY","INITIAL_FILTER","CASEVIEW_LINK","RENDER_SECTION_LABEL","HIDE_IN_USER_INTERFACE","getLayoutHintConfiguration","AVATAR_IN_TITLE","AVATAR","_default","default"],"sources":["../../src/constants/LayoutHints.js"],"sourcesContent":["// @flow\nimport { LayoutHintConfiguration } from \"./LayoutHintConfig\";\n\n/**\n * Retrieve layout hint by id from the layout hint configuration\n */\nconst getHint = (hint: string): string => {\n if (LayoutHintConfiguration[hint]) {\n return LayoutHintConfiguration[hint].hint;\n }\n\n return \"\";\n};\n\n/**\n * Layout-hint: Indicates a mandatory attribute. Should be used together with the dependency hint.\n */\nexport const MANDATORY: string = getHint(\"MANDATORY\");\n\n/**\n * Layout-hint: Indicates a disabled attribute.\n * @constant\n */\nexport const DISABLED: string = getHint(\"DISABLED\");\n\n/*\n * --------------------------------\n * SELECT DEPENDENT ATTRIBUTES\n * --------------------------------\n */\n/**\n * Layout-hint: Marks the choice attribute where other attributes depend on. The unique control id is a unique id that can be used in the hint for the show|hide action on the dependent attribute.\n */\nexport const DEPENDENT_ATTRIBUTE_CONTROL = \"dependent-control\";\n/**\n */\nexport const DEPENDENT_ATTRIBUTE = \"dependent-attribute:\";\n\n/*\n * --------------------------------\n * ATTRIBUTES\n * --------------------------------\n */\n/**\n * Layout-hint: Password attribute must be confirmed using a second password attribute.\n */\nexport const CONFIRM_PASSWORD: string = getHint(\"CONFIRM_PASSWORD\");\n/**\n * Layout-hint: Sort options alphabetically\n */\nexport const SORT_OPTIONS: string = getHint(\"SORT_OPTIONS\");\n/**\n * Layout-hint: Marks an attribute as a title attribute\n */\nexport const TITLE: string = getHint(\"TITLE\");\n\n/*\n * --------------------------------\n * FORM\n * --------------------------------\n */\n/**\n * Layout-hint: Mark task as delete task\n */\nexport const DELETE_ACTION: string = getHint(\"DELETE_ACTION\");\n/**\n * Layout-hint: Mark task as update task\n */\nexport const UPDATE_ACTION: string = getHint(\"UPDATE_ACTION\");\n/**\n * Layout-hint: Mark task as create task\n */\nexport const CREATE_ACTION: string = getHint(\"CREATE_ACTION\");\n\n/*\n * --------------------------------\n * UPLOAD TOTAL FILE SIZE\n * --------------------------------\n */\n/**\n * Layout-hint: Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the file size currently used.\n */\nexport const INITIAL_TOTAL_FILESIZE: string = getHint(\"INITIAL_TOTAL_FILESIZE\");\n/**\n * Layout-hint: Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the maximum allowed total file size.\n */\nexport const MAX_TOTAL_FILESIZE: string = getHint(\"MAX_TOTAL_FILESIZE\");\n\n/*\n * --------------------------------\n * LISTS\n * --------------------------------\n */\n/**\n * Layout-hint: A list with only one detail must be shown as a detail\n */\nexport const SHOW_ONE_RESULT_AS_DETAIL: string = getHint(\n \"SHOW_ONE_RESULT_AS_DETAIL\",\n);\n/**\n * Layout-hint: A list without list-items and list-tasks should not be shown.\n */\nexport const HIDE_WHEN_EMPTY: string = getHint(\"HIDE_WHEN_EMPTY\");\n/**\n * Layout-hint: Sets a default value on a filter\n */\nexport const INITIAL_FILTER: string = \"initial-filter:\";\n/**\n * Layout-hint: Mark a case id reference attribute as the reference to the case view. Replaces the self link of a list item\n */\nexport const CASEVIEW_LINK: string = getHint(\"CASEVIEW_LINK\");\n\n/**\n * Layout-hint: Set on configuration of instruments to show content in a popover on a label\n */\nexport const RENDER_SECTION_LABEL = \"render-section-label\";\n\n/**\n * Layout-hint: Hide a link to a component\n */\nexport const HIDE_IN_USER_INTERFACE: string = getHint(\"HIDE_IN_USER_INTERFACE\");\n\n/**\n */\nexport const getLayoutHintConfiguration = (): Object => LayoutHintConfiguration;\n\n/**\n * Layout-hint: Marks an attribute as an avatar for the title attribute.\n */\nexport const AVATAR_IN_TITLE: string = getHint(\"AVATAR_IN_TITLE\");\n\nexport const AVATAR: string = getHint(\"AVATAR\");\n\nexport default getHint;\n"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA,MAAMC,OAAO,GAAIC,IAAY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,CAAC,wBAAwB,CAAC;AAC/E;AACA;AACA;AACO,MAAMe,kBAA0B,GAAAX,OAAA,CAAAW,kBAAA,GAAGf,OAAO,CAAC,oBAAoB,CAAC;;AAEvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMgB,yBAAiC,GAAAZ,OAAA,CAAAY,yBAAA,GAAGhB,OAAO,CACtD,2BACF,CAAC;AACD;AACA;AACA;AACO,MAAMiB,eAAuB,GAAAb,OAAA,CAAAa,eAAA,GAAGjB,OAAO,CAAC,iBAAiB,CAAC;AACjE;AACA;AACA;AACO,MAAMkB,cAAsB,GAAAd,OAAA,CAAAc,cAAA,GAAG,iBAAiB;AACvD;AACA;AACA;AACO,MAAMC,aAAqB,GAAAf,OAAA,CAAAe,aAAA,GAAGnB,OAAO,CAAC,eAAe,CAAC;;AAE7D;AACA;AACA;AACO,MAAMoB,oBAAoB,GAAAhB,OAAA,CAAAgB,oBAAA,GAAG,sBAAsB;;AAE1D;AACA;AACA;AACO,MAAMC,sBAA8B,GAAAjB,OAAA,CAAAiB,sBAAA,GAAGrB,OAAO,CAAC,wBAAwB,CAAC;;AAE/E;AACA;AACO,MAAMsB,0BAA0B,GAAGA,CAAA,KAAcpB,yCAAuB;;AAE/E;AACA;AACA;AAFAE,OAAA,CAAAkB,0BAAA,GAAAA,0BAAA;AAGO,MAAMC,eAAuB,GAAAnB,OAAA,CAAAmB,eAAA,GAAGvB,OAAO,CAAC,iBAAiB,CAAC;AAE1D,MAAMwB,MAAc,GAAApB,OAAA,CAAAoB,MAAA,GAAGxB,OAAO,CAAC,QAAQ,CAAC;AAAC,IAAAyB,QAAA,GAAArB,OAAA,CAAAsB,OAAA,GAEjC1B,OAAO"}
|
|
@@ -104,6 +104,12 @@ class StringAttributeModel extends _AttributeModel.default {
|
|
|
104
104
|
return this.layouthint.has("zipcode");
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
/**
|
|
108
|
+
*/
|
|
109
|
+
isAvatar() {
|
|
110
|
+
return this.layouthint.has("avatar");
|
|
111
|
+
}
|
|
112
|
+
|
|
107
113
|
/**
|
|
108
114
|
*/
|
|
109
115
|
isEmail() {
|
|
@@ -258,7 +264,7 @@ class StringAttributeModel extends _AttributeModel.default {
|
|
|
258
264
|
/**
|
|
259
265
|
*/
|
|
260
266
|
get readonlyWidth() {
|
|
261
|
-
if (this.isZipcode() || this.isBSN()) {
|
|
267
|
+
if (this.isZipcode() || this.isBSN() || this.isAvatar()) {
|
|
262
268
|
return _constants.ATTRIBUTE_WIDTH.SMALL;
|
|
263
269
|
}
|
|
264
270
|
if (this.isIBAN()) {
|
|
@@ -103,6 +103,12 @@ export default class StringAttributeModel extends AttributeModel {
|
|
|
103
103
|
return this.layouthint.has("zipcode");
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
+
/**
|
|
107
|
+
*/
|
|
108
|
+
isAvatar(): boolean {
|
|
109
|
+
return this.layouthint.has("avatar");
|
|
110
|
+
}
|
|
111
|
+
|
|
106
112
|
/**
|
|
107
113
|
*/
|
|
108
114
|
isEmail(): boolean {
|
|
@@ -281,7 +287,7 @@ export default class StringAttributeModel extends AttributeModel {
|
|
|
281
287
|
/**
|
|
282
288
|
*/
|
|
283
289
|
get readonlyWidth(): $Keys<typeof ATTRIBUTE_WIDTH> {
|
|
284
|
-
if (this.isZipcode() || this.isBSN()) {
|
|
290
|
+
if (this.isZipcode() || this.isBSN() || this.isAvatar()) {
|
|
285
291
|
return ATTRIBUTE_WIDTH.SMALL;
|
|
286
292
|
}
|
|
287
293
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StringAttributeModel.js","names":["_AttributeModel","_interopRequireDefault","require","_ConstraintCollection","_RegexConstraint","_BSNConstraint","_IBANConstraint","_constants","StringAttributeModel","AttributeModel","constructor","attribute","attributeContributions","_defineProperty2","default","_placeholder","getContribution","getInitialInputValue","value","formatValue","isApplicableModel","contributions","layouthint","type","Array","isArray","_includes","call","regexp","regexpvalidationmessage","postfix","prefix","placeholder","isBSN","has","isIBAN","isZipcode","isEmail","addConstraints","constraints","ConstraintCollection","add","BSNConstraint","IBANConstraint","RegexConstraint","messageKey","defaultMessage","regex","RegExp","reset","inputvalue","formatIBAN","noFormat","removeFormat","groups","replace","match","join","formatZipcode","length","substring","toUpperCase","formatBSN","toString","validateValue","getInputValue","_inputvalue","validate","readonlyvalue","formattedValue","update","updateLastModification","readonlyWidth","ATTRIBUTE_WIDTH","SMALL","LARGE","MEDIUM","exports"],"sources":["../../../src/models/attributes/StringAttributeModel.js"],"sourcesContent":["// @flow\nimport AttributeModel from \"./AttributeModel\";\nimport ConstraintCollection from \"./input-constraints/ConstraintCollection\";\nimport RegexConstraint from \"./input-constraints/RegexConstraint\";\nimport BSNConstraint from \"./input-constraints/BSNConstraint\";\nimport IBANConstraint from \"./input-constraints/IBANConstraint\";\n\nimport { ATTRIBUTE_WIDTH } from \"../../constants\";\n\n/**\n * String attribute\n */\nexport default class StringAttributeModel extends AttributeModel {\n _placeholder: string;\n\n /**\n */\n constructor(attribute: Object, attributeContributions: Object) {\n super(attribute, attributeContributions);\n\n this._placeholder = this.getContribution(\"placeholder\", \"\");\n }\n\n /**\n * Retrieve initial input value\n */\n getInitialInputValue(value: any): string {\n return this.formatValue(value);\n }\n\n /**\n */\n static isApplicableModel(contributions: Object): boolean {\n const layouthint = contributions?.layouthint;\n return (\n contributions.type === \"string\" ||\n (Array.isArray(layouthint) && layouthint.includes(\"string\"))\n );\n }\n\n /**\n */\n get type(): string {\n return \"string\";\n }\n\n /**\n * Get Regexp pattern\n */\n get regexp(): string | null {\n return this.getContribution(\"regexp\");\n }\n\n /**\n */\n get regexpvalidationmessage(): string | null {\n return this.getContribution(\"regexpValidationMessage\");\n }\n\n /**\n * Get postfix text\n */\n get postfix(): string {\n return this.getContribution(\"postfix\", \"\");\n }\n\n /**\n * Get prefix text\n */\n get prefix(): string {\n return this.getContribution(\"prefix\", \"\");\n }\n\n /**\n * Get placeholder text\n */\n get placeholder(): string {\n return this._placeholder;\n }\n\n /**\n * Set placeholder text\n */\n set placeholder(placeholder: string) {\n this._placeholder = placeholder;\n }\n\n /**\n */\n isBSN(): boolean {\n return this.layouthint.has(\"bsn\");\n }\n\n /**\n */\n isIBAN(): boolean {\n return this.layouthint.has(\"iban\");\n }\n\n /**\n */\n isZipcode(): boolean {\n return this.layouthint.has(\"zipcode\");\n }\n\n /**\n */\n isEmail(): boolean {\n return this.layouthint.has(\"email\");\n }\n\n /**\n * Add regex constraints\n */\n addConstraints(): ConstraintCollection {\n const constraints = new ConstraintCollection();\n\n if (this.isBSN()) {\n constraints.add(new BSNConstraint());\n } else if (this.isIBAN()) {\n constraints.add(new IBANConstraint());\n }\n\n if (this.isZipcode()) {\n // validate zip when regex is set is set or exact or isNot\n constraints.add(\n new RegexConstraint({\n messageKey: \"Constraint.ZipCode.InvalidFormat\",\n defaultMessage: \"Must be a valid Dutch ZIP code, e.g. 1234 AB\",\n regex: new RegExp(\"^[1-9][0-9]{3} ?[a-zA-Z]{2}$\", \"gi\"),\n }),\n );\n } else if (this.isEmail() && this.regexp) {\n constraints.add(\n new RegexConstraint({\n messageKey: \"Constraint.Email.InvalidFormat\",\n defaultMessage: \"Must be a valid e-mail address\",\n regex: new RegExp(this.regexp, \"gi\"),\n }),\n );\n } else if (this.regexp) {\n constraints.add(\n new RegexConstraint({\n messageKey: \"Constraint.String.InvalidRegex\",\n defaultMessage: this.regexpvalidationmessage,\n regex: this.regexp,\n }),\n );\n }\n\n return constraints;\n }\n\n /**\n * Reset attribute to empty string\n */\n reset() {\n this.inputvalue = \"\";\n }\n\n /**\n */\n formatIBAN(value: string): string {\n const noFormat = this.removeFormat(value);\n\n const groups = noFormat.replace(/\\s/g, \"\").match(/.{1,4}/g);\n return groups == null ? \"\" : groups.join(\" \");\n }\n\n /**\n */\n formatZipcode(value: string): string {\n const noFormat = this.removeFormat(value);\n if (noFormat.length === 6) {\n return (\n noFormat.substring(0, 4) + \" \" + noFormat.substring(4).toUpperCase()\n );\n }\n return noFormat;\n }\n\n /**\n */\n formatBSN(value: string): string {\n return this.removeFormat(value);\n }\n\n /**\n */\n formatValue(value: ?string): string {\n if (value == null || value.toString() === \"\") {\n return \"\";\n }\n\n if (typeof value !== \"string\") {\n return value;\n }\n\n if (this.isIBAN()) {\n return this.formatIBAN(value);\n }\n\n if (this.isZipcode()) {\n return this.formatZipcode(value);\n }\n\n if (this.isBSN()) {\n return this.formatBSN(value);\n }\n\n return value.replace(/ {2}/gi, \" \\u00A0\");\n }\n\n /**\n */\n removeFormat(value: ?string): string {\n if (value == null || value.toString() === \"\") {\n return \"\";\n }\n\n if (this.isIBAN() || this.isZipcode() || this.isBSN()) {\n return value.replace(/[^a-z0-9,]/gi, \"\");\n }\n\n return value;\n }\n\n /**\n */\n get validateValue(): string {\n return this.removeFormat(this.inputvalue);\n }\n\n /**\n */\n get inputvalue(): string {\n return this.getInputValue();\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\n if (value == null) {\n this.value = value;\n } else {\n this.value = this.removeFormat(value);\n }\n\n this.validate(this.validateValue);\n }\n\n /**\n */\n get readonlyvalue(): string {\n if (typeof this.value === \"string\") {\n const formattedValue = this.formatValue(this.value);\n // fix for rendering of multiple spaces\n return formattedValue.replace(/ {2}/gi, \" \\u00A0\");\n }\n\n return this.value == null ? \"\" : this.value;\n }\n\n /**\n * Update the attribute by name and value\n */\n update(value: string): StringAttributeModel {\n if (this.inputvalue === value) {\n return this;\n }\n\n this.updateLastModification();\n this.inputvalue = value;\n\n return this;\n }\n\n /**\n */\n get readonlyWidth(): $Keys<typeof ATTRIBUTE_WIDTH> {\n if (this.isZipcode() || this.isBSN()) {\n return ATTRIBUTE_WIDTH.SMALL;\n }\n\n if (this.isIBAN()) {\n return ATTRIBUTE_WIDTH.LARGE;\n }\n\n // default value (also applied for email address + download attribute)\n return ATTRIBUTE_WIDTH.MEDIUM;\n }\n}\n"],"mappings":";;;;;;;;;AACA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IAAI,CAACpC,SAAS,CAAC,CAAC,IAAI,IAAI,CAACH,KAAK,CAAC,CAAC,EAAE;MACpC,OAAOwC,0BAAe,CAACC,KAAK;IAC9B;IAEA,IAAI,IAAI,CAACvC,MAAM,CAAC,CAAC,EAAE;MACjB,OAAOsC,0BAAe,CAACE,KAAK;IAC9B;;IAEA;IACA,OAAOF,0BAAe,CAACG,MAAM;EAC/B;AACF;AAACC,OAAA,CAAA/D,OAAA,GAAAN,oBAAA"}
|
|
1
|
+
{"version":3,"file":"StringAttributeModel.js","names":["_AttributeModel","_interopRequireDefault","require","_ConstraintCollection","_RegexConstraint","_BSNConstraint","_IBANConstraint","_constants","StringAttributeModel","AttributeModel","constructor","attribute","attributeContributions","_defineProperty2","default","_placeholder","getContribution","getInitialInputValue","value","formatValue","isApplicableModel","contributions","layouthint","type","Array","isArray","_includes","call","regexp","regexpvalidationmessage","postfix","prefix","placeholder","isBSN","has","isIBAN","isZipcode","isAvatar","isEmail","addConstraints","constraints","ConstraintCollection","add","BSNConstraint","IBANConstraint","RegexConstraint","messageKey","defaultMessage","regex","RegExp","reset","inputvalue","formatIBAN","noFormat","removeFormat","groups","replace","match","join","formatZipcode","length","substring","toUpperCase","formatBSN","toString","validateValue","getInputValue","_inputvalue","validate","readonlyvalue","formattedValue","update","updateLastModification","readonlyWidth","ATTRIBUTE_WIDTH","SMALL","LARGE","MEDIUM","exports"],"sources":["../../../src/models/attributes/StringAttributeModel.js"],"sourcesContent":["// @flow\nimport AttributeModel from \"./AttributeModel\";\nimport ConstraintCollection from \"./input-constraints/ConstraintCollection\";\nimport RegexConstraint from \"./input-constraints/RegexConstraint\";\nimport BSNConstraint from \"./input-constraints/BSNConstraint\";\nimport IBANConstraint from \"./input-constraints/IBANConstraint\";\n\nimport { ATTRIBUTE_WIDTH } from \"../../constants\";\n\n/**\n * String attribute\n */\nexport default class StringAttributeModel extends AttributeModel {\n _placeholder: string;\n\n /**\n */\n constructor(attribute: Object, attributeContributions: Object) {\n super(attribute, attributeContributions);\n\n this._placeholder = this.getContribution(\"placeholder\", \"\");\n }\n\n /**\n * Retrieve initial input value\n */\n getInitialInputValue(value: any): string {\n return this.formatValue(value);\n }\n\n /**\n */\n static isApplicableModel(contributions: Object): boolean {\n const layouthint = contributions?.layouthint;\n return (\n contributions.type === \"string\" ||\n (Array.isArray(layouthint) && layouthint.includes(\"string\"))\n );\n }\n\n /**\n */\n get type(): string {\n return \"string\";\n }\n\n /**\n * Get Regexp pattern\n */\n get regexp(): string | null {\n return this.getContribution(\"regexp\");\n }\n\n /**\n */\n get regexpvalidationmessage(): string | null {\n return this.getContribution(\"regexpValidationMessage\");\n }\n\n /**\n * Get postfix text\n */\n get postfix(): string {\n return this.getContribution(\"postfix\", \"\");\n }\n\n /**\n * Get prefix text\n */\n get prefix(): string {\n return this.getContribution(\"prefix\", \"\");\n }\n\n /**\n * Get placeholder text\n */\n get placeholder(): string {\n return this._placeholder;\n }\n\n /**\n * Set placeholder text\n */\n set placeholder(placeholder: string) {\n this._placeholder = placeholder;\n }\n\n /**\n */\n isBSN(): boolean {\n return this.layouthint.has(\"bsn\");\n }\n\n /**\n */\n isIBAN(): boolean {\n return this.layouthint.has(\"iban\");\n }\n\n /**\n */\n isZipcode(): boolean {\n return this.layouthint.has(\"zipcode\");\n }\n\n /**\n */\n isAvatar(): boolean {\n return this.layouthint.has(\"avatar\");\n }\n\n /**\n */\n isEmail(): boolean {\n return this.layouthint.has(\"email\");\n }\n\n /**\n * Add regex constraints\n */\n addConstraints(): ConstraintCollection {\n const constraints = new ConstraintCollection();\n\n if (this.isBSN()) {\n constraints.add(new BSNConstraint());\n } else if (this.isIBAN()) {\n constraints.add(new IBANConstraint());\n }\n\n if (this.isZipcode()) {\n // validate zip when regex is set is set or exact or isNot\n constraints.add(\n new RegexConstraint({\n messageKey: \"Constraint.ZipCode.InvalidFormat\",\n defaultMessage: \"Must be a valid Dutch ZIP code, e.g. 1234 AB\",\n regex: new RegExp(\"^[1-9][0-9]{3} ?[a-zA-Z]{2}$\", \"gi\"),\n }),\n );\n } else if (this.isEmail() && this.regexp) {\n constraints.add(\n new RegexConstraint({\n messageKey: \"Constraint.Email.InvalidFormat\",\n defaultMessage: \"Must be a valid e-mail address\",\n regex: new RegExp(this.regexp, \"gi\"),\n }),\n );\n } else if (this.regexp) {\n constraints.add(\n new RegexConstraint({\n messageKey: \"Constraint.String.InvalidRegex\",\n defaultMessage: this.regexpvalidationmessage,\n regex: this.regexp,\n }),\n );\n }\n\n return constraints;\n }\n\n /**\n * Reset attribute to empty string\n */\n reset() {\n this.inputvalue = \"\";\n }\n\n /**\n */\n formatIBAN(value: string): string {\n const noFormat = this.removeFormat(value);\n\n const groups = noFormat.replace(/\\s/g, \"\").match(/.{1,4}/g);\n return groups == null ? \"\" : groups.join(\" \");\n }\n\n /**\n */\n formatZipcode(value: string): string {\n const noFormat = this.removeFormat(value);\n if (noFormat.length === 6) {\n return (\n noFormat.substring(0, 4) + \" \" + noFormat.substring(4).toUpperCase()\n );\n }\n return noFormat;\n }\n\n /**\n */\n formatBSN(value: string): string {\n return this.removeFormat(value);\n }\n\n /**\n */\n formatValue(value: ?string): string {\n if (value == null || value.toString() === \"\") {\n return \"\";\n }\n\n if (typeof value !== \"string\") {\n return value;\n }\n\n if (this.isIBAN()) {\n return this.formatIBAN(value);\n }\n\n if (this.isZipcode()) {\n return this.formatZipcode(value);\n }\n\n if (this.isBSN()) {\n return this.formatBSN(value);\n }\n\n return value.replace(/ {2}/gi, \" \\u00A0\");\n }\n\n /**\n */\n removeFormat(value: ?string): string {\n if (value == null || value.toString() === \"\") {\n return \"\";\n }\n\n if (this.isIBAN() || this.isZipcode() || this.isBSN()) {\n return value.replace(/[^a-z0-9,]/gi, \"\");\n }\n\n return value;\n }\n\n /**\n */\n get validateValue(): string {\n return this.removeFormat(this.inputvalue);\n }\n\n /**\n */\n get inputvalue(): string {\n return this.getInputValue();\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\n if (value == null) {\n this.value = value;\n } else {\n this.value = this.removeFormat(value);\n }\n\n this.validate(this.validateValue);\n }\n\n /**\n */\n get readonlyvalue(): string {\n if (typeof this.value === \"string\") {\n const formattedValue = this.formatValue(this.value);\n // fix for rendering of multiple spaces\n return formattedValue.replace(/ {2}/gi, \" \\u00A0\");\n }\n\n return this.value == null ? \"\" : this.value;\n }\n\n /**\n * Update the attribute by name and value\n */\n update(value: string): StringAttributeModel {\n if (this.inputvalue === value) {\n return this;\n }\n\n this.updateLastModification();\n this.inputvalue = value;\n\n return this;\n }\n\n /**\n */\n get readonlyWidth(): $Keys<typeof ATTRIBUTE_WIDTH> {\n if (this.isZipcode() || this.isBSN() || this.isAvatar()) {\n return ATTRIBUTE_WIDTH.SMALL;\n }\n\n if (this.isIBAN()) {\n return ATTRIBUTE_WIDTH.LARGE;\n }\n\n // default value (also applied for email address + download attribute)\n return ATTRIBUTE_WIDTH.MEDIUM;\n }\n}\n"],"mappings":";;;;;;;;;AACA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,gBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,cAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,eAAA,GAAAL,sBAAA,CAAAC,OAAA;AAEA,IAAAK,UAAA,GAAAL,OAAA;AAEA;AACA;AACA;AACe,MAAMM,oBAAoB,SAASC,uBAAc,CAAC;EAG/D;AACF;EACEC,WAAWA,CAACC,SAAiB,EAAEC,sBAA8B,EAAE;IAC7D,KAAK,CAACD,SAAS,EAAEC,sBAAsB,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;IAEzC,IAAI,CAACC,YAAY,GAAG,IAAI,CAACC,eAAe,CAAC,aAAa,EAAE,EAAE,CAAC;EAC7D;;EAEA;AACF;AACA;EACEC,oBAAoBA,CAACC,KAAU,EAAU;IACvC,OAA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AI,CAACoC,YAAY,CAACpC,KAAK,CAAC;IACvC;IAEA,IAAI,CAACkD,QAAQ,CAAC,IAAI,CAACH,aAAa,CAAC;EACnC;;EAEA;AACF;EACE,IAAII,aAAaA,CAAA,EAAW;IAC1B,IAAI,OAAO,IAAI,CAACnD,KAAK,KAAK,QAAQ,EAAE;MAClC,MAAMoD,cAAc,GAAG,IAAI,CAACnD,WAAW,CAAC,IAAI,CAACD,KAAK,CAAC;MACnD;MACA,OAAOoD,cAAc,CAACd,OAAO,CAAC,QAAQ,EAAE,SAAS,CAAC;IACpD;IAEA,OAAO,IAAI,CAACtC,KAAK,IAAI,IAAI,GAAG,EAAE,GAAG,IAAI,CAACA,KAAK;EAC7C;;EAEA;AACF;AACA;EACEqD,MAAMA,CAACrD,KAAa,EAAwB;IAC1C,IAAI,IAAI,CAACiC,UAAU,KAAKjC,KAAK,EAAE;MAC7B,OAAO,IAAI;IACb;IAEA,IAAI,CAACsD,sBAAsB,CAAC,CAAC;IAC7B,IAAI,CAACrB,UAAU,GAAGjC,KAAK;IAEvB,OAAO,IAAI;EACb;;EAEA;AACF;EACE,IAAIuD,aAAaA,CAAA,EAAkC;IACjD,IAAI,IAAI,CAACrC,SAAS,CAAC,CAAC,IAAI,IAAI,CAACH,KAAK,CAAC,CAAC,IAAI,IAAI,CAACI,QAAQ,CAAC,CAAC,EAAE;MACvD,OAAOqC,0BAAe,CAACC,KAAK;IAC9B;IAEA,IAAI,IAAI,CAACxC,MAAM,CAAC,CAAC,EAAE;MACjB,OAAOuC,0BAAe,CAACE,KAAK;IAC9B;;IAEA;IACA,OAAOF,0BAAe,CAACG,MAAM;EAC/B;AACF;AAACC,OAAA,CAAAhE,OAAA,GAAAN,oBAAA"}
|
|
@@ -112,7 +112,7 @@ class DetailModel extends _ResourceModel.default {
|
|
|
112
112
|
return (0, _filter.default)(_context3 = this.attributeCollection.all).call(_context3, attribute => {
|
|
113
113
|
const hasTitle = attribute.layouthint.hasExact(_LayoutHints.TITLE);
|
|
114
114
|
const hasAvatar = attribute.layouthint.hasExact(_LayoutHints.AVATAR);
|
|
115
|
-
const hasAvatarForTitle = attribute.layouthint.hasExact(_LayoutHints.
|
|
115
|
+
const hasAvatarForTitle = attribute.layouthint.hasExact(_LayoutHints.AVATAR_IN_TITLE);
|
|
116
116
|
return !attribute.isHidden && (!hasTitle || hasTitle && hasAvatar) && (!hasAvatarForTitle || hasAvatarForTitle && !hasAvatar);
|
|
117
117
|
});
|
|
118
118
|
}
|
|
@@ -179,7 +179,7 @@ class DetailModel extends _ResourceModel.default {
|
|
|
179
179
|
get avatarForTitleAttribute() {
|
|
180
180
|
var _context5;
|
|
181
181
|
const avatarAttributes = (0, _filter.default)(_context5 = this._attributeCollection.all).call(_context5, attribute => attribute.layouthint.hasExact(_LayoutHints.AVATAR));
|
|
182
|
-
const avatarForTitleAttribute = (0, _find.default)(avatarAttributes).call(avatarAttributes, attribute => attribute.layouthint.hasExact(_LayoutHints.
|
|
182
|
+
const avatarForTitleAttribute = (0, _find.default)(avatarAttributes).call(avatarAttributes, attribute => attribute.layouthint.hasExact(_LayoutHints.AVATAR_IN_TITLE));
|
|
183
183
|
return avatarForTitleAttribute || null;
|
|
184
184
|
}
|
|
185
185
|
|
|
@@ -5,7 +5,7 @@ import ActionCollection from "../actions/ActionCollection";
|
|
|
5
5
|
import AttributeCollection from "../attributes/AttributeCollection";
|
|
6
6
|
import ResourceModel from "../base/ResourceModel";
|
|
7
7
|
|
|
8
|
-
import { AVATAR,
|
|
8
|
+
import { AVATAR, AVATAR_IN_TITLE, TITLE } from "../../constants/LayoutHints";
|
|
9
9
|
|
|
10
10
|
import type { ModularUIResponse } from "../../modularui";
|
|
11
11
|
import type { ModularUIModel, AttributeType } from "../types";
|
|
@@ -118,7 +118,7 @@ export default class DetailModel extends ResourceModel {
|
|
|
118
118
|
return this.attributeCollection.all.filter((attribute) => {
|
|
119
119
|
const hasTitle = attribute.layouthint.hasExact(TITLE);
|
|
120
120
|
const hasAvatar = attribute.layouthint.hasExact(AVATAR);
|
|
121
|
-
const hasAvatarForTitle = attribute.layouthint.hasExact(
|
|
121
|
+
const hasAvatarForTitle = attribute.layouthint.hasExact(AVATAR_IN_TITLE);
|
|
122
122
|
return (
|
|
123
123
|
!attribute.isHidden &&
|
|
124
124
|
(!hasTitle || (hasTitle && hasAvatar)) &&
|
|
@@ -201,7 +201,7 @@ export default class DetailModel extends ResourceModel {
|
|
|
201
201
|
);
|
|
202
202
|
|
|
203
203
|
const avatarForTitleAttribute = avatarAttributes.find((attribute) =>
|
|
204
|
-
attribute.layouthint.hasExact(
|
|
204
|
+
attribute.layouthint.hasExact(AVATAR_IN_TITLE),
|
|
205
205
|
);
|
|
206
206
|
|
|
207
207
|
return avatarForTitleAttribute || null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DetailModel.js","names":["_objects","require","_ActionCollection","_interopRequireDefault","_AttributeCollection","_ResourceModel","_LayoutHints","DetailModel","ResourceModel","constructor","modularuiResponse","_defineProperty2","default","createAttributeCollection","createMetadataCollection","createActionCollection","type","modelName","isApplicableModel","data","_context","resourceType","contributions","resourcetype","_endsWith","call","_includes","getInitialChildModelLinks","_attributeCollection","setChildModels","models","id","getData","key","label","getContribution","_context2","attributeContributions","attributes","_filter","contribution","_keys","has","attributeCollection","AttributeCollection","collection","_context3","all","attribute","hasTitle","layouthint","hasExact","TITLE","hasAvatar","AVATAR","hasAvatarForTitle","AVATAR_FOR_TITLE","isHidden","getAttributeByKey","_context4","metadataContributions","metadata","_map","metadataKey","metadataCollection","_metadataCollection","_actionCollection","ActionCollection","actions","actionCollection","isCase","avatarForTitleAttribute","_context5","avatarAttributes","_find","titleAttribute","_context6","nonAvatarAttributes","update","model","clonedModel","clone","equals","toString","exports"],"sources":["../../../src/models/detail/DetailModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport ActionCollection from \"../actions/ActionCollection\";\nimport AttributeCollection from \"../attributes/AttributeCollection\";\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport { AVATAR, AVATAR_FOR_TITLE, TITLE } from \"../../constants/LayoutHints\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { ModularUIModel, AttributeType } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Base class for details<br/>\n * For instance the details of case 1<br/>\n * For instance the details of record 12<br/>\n */\nexport default class DetailModel extends ResourceModel {\n _attributeCollection: AttributeCollection;\n _metadataCollection: AttributeCollection;\n _actionCollection: ActionCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this.createAttributeCollection();\n this.createMetadataCollection();\n this.createActionCollection();\n }\n\n /**\n */\n get type(): string {\n return \"Detail\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"DetailModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n const resourceType = data.contributions?.resourcetype;\n return (\n resourceType &&\n (resourceType.endsWith(\"DetailPanel\") ||\n [\"Detail\", \"CasePropertiesPanel\", \"CasePropertiesPanelDetail\"].includes(\n resourceType,\n ))\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this._attributeCollection.getInitialChildModelLinks();\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this._attributeCollection.setChildModels(models);\n }\n\n /**\n * Getting the unique identifier of the details\n */\n get id(): string {\n return this.getData(\"_id\", this.key);\n }\n\n /**\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Attribute collection\n */\n createAttributeCollection() {\n const attributeContributions = this.contributions.attributes\n ? this.contributions.attributes.filter((contribution) => {\n const [key] = Object.keys(contribution);\n return has(this.data, key);\n })\n : [];\n\n this.attributeCollection = new AttributeCollection(\n this.data,\n attributeContributions,\n true,\n );\n }\n\n /**\n */\n get attributeCollection(): AttributeCollection {\n return this._attributeCollection;\n }\n\n /**\n */\n set attributeCollection(collection: AttributeCollection) {\n this._attributeCollection = collection;\n }\n\n /**\n * Retrieve list of visible attributes\n */\n get attributes(): Array<AttributeType> {\n return this.attributeCollection.all.filter((attribute) => {\n const hasTitle = attribute.layouthint.hasExact(TITLE);\n const hasAvatar = attribute.layouthint.hasExact(AVATAR);\n const hasAvatarForTitle = attribute.layouthint.hasExact(AVATAR_FOR_TITLE);\n return (\n !attribute.isHidden &&\n (!hasTitle || (hasTitle && hasAvatar)) &&\n (!hasAvatarForTitle || (hasAvatarForTitle && !hasAvatar))\n );\n });\n }\n\n /**\n * Retrieve an attribute by it's key\n */\n getAttributeByKey(key: string): AttributeType | null {\n return this._attributeCollection.getAttributeByKey(key);\n }\n\n /**\n * Metadata collection\n */\n createMetadataCollection() {\n const metadataContributions = this.contributions.metadata\n ? Object.keys(this.contributions.metadata).map((metadataKey) => ({\n [metadataKey]: this.contributions.metadata[metadataKey],\n }))\n : [];\n\n this.metadataCollection = new AttributeCollection(\n this.data,\n metadataContributions,\n true,\n );\n }\n\n /**\n */\n get metadataCollection(): AttributeCollection {\n return this._metadataCollection;\n }\n\n /**\n */\n set metadataCollection(collection: AttributeCollection) {\n this._metadataCollection = collection;\n }\n\n /**\n * Action collection\n */\n createActionCollection() {\n this._actionCollection = new ActionCollection(\n this.data.actions,\n this.contributions.actions,\n );\n }\n\n /**\n */\n get actionCollection(): ActionCollection {\n return this._actionCollection;\n }\n\n /**\n */\n set actionCollection(actionCollection: ActionCollection) {\n this._actionCollection = actionCollection;\n }\n\n /**\n * Determines if this is a case\n */\n get isCase(): boolean {\n return this.contributions.resourcetype === \"CaseView\";\n }\n\n /**\n * Getting the attribute that has as layout hint 'avatar-for-title'\n */\n get avatarForTitleAttribute(): ?AttributeType {\n const avatarAttributes = this._attributeCollection.all.filter((attribute) =>\n attribute.layouthint.hasExact(AVATAR),\n );\n\n const avatarForTitleAttribute = avatarAttributes.find((attribute) =>\n attribute.layouthint.hasExact(AVATAR_FOR_TITLE),\n );\n\n return avatarForTitleAttribute || null;\n }\n\n /**\n * Getting the attribute that has as layout hint 'title'\n */\n get titleAttribute(): ?AttributeType {\n const nonAvatarAttributes = this._attributeCollection.all.filter(\n (attribute) => !attribute.layouthint.hasExact(AVATAR),\n );\n\n const titleAttribute = nonAvatarAttributes.find((attribute) =>\n attribute.layouthint.has(TITLE),\n );\n\n return titleAttribute || null;\n }\n\n /**\n * Update current detail with a new detail model and return a cloned version of the model\n */\n update(model: ModularUIModel): DetailModel {\n if (model instanceof DetailModel) {\n const clonedModel = this.clone();\n\n clonedModel.attributeCollection = model._attributeCollection;\n clonedModel.metadataCollection = model._metadataCollection;\n clonedModel.actionCollection = model._actionCollection;\n\n return clonedModel;\n }\n\n return this;\n }\n\n /**\n */\n equals(model: DetailModel): boolean {\n return this.id.toString() === model.id.toString();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,cAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA,IAAAK,YAAA,GAAAL,OAAA;AAMA;AACA;AACA;AACA;AACA;AACe,MAAMM,WAAW,SAASC,sBAAa,CAAC;EAKrD;AACF;EACEC,WAAWA,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAEzB,IAAI,CAACC,yBAAyB,CAAC,CAAC;IAChC,IAAI,CAACC,wBAAwB,CAAC,CAAC;IAC/B,IAAI,CAACC,sBAAsB,CAAC,CAAC;EAC/B;;EAEA;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,QAAQ;EACjB;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,aAAa;EACtB;;EAEA;AACF;EACE,OAA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CAAChD,EAAE,CAACoD,QAAQ,CAAC,CAAC,KAAKJ,KAAK,CAAChD,EAAE,CAACoD,QAAQ,CAAC,CAAC;EACnD;AACF;AAACC,OAAA,CAAAxE,OAAA,GAAAL,WAAA"}
|
|
1
|
+
{"version":3,"file":"DetailModel.js","names":["_objects","require","_ActionCollection","_interopRequireDefault","_AttributeCollection","_ResourceModel","_LayoutHints","DetailModel","ResourceModel","constructor","modularuiResponse","_defineProperty2","default","createAttributeCollection","createMetadataCollection","createActionCollection","type","modelName","isApplicableModel","data","_context","resourceType","contributions","resourcetype","_endsWith","call","_includes","getInitialChildModelLinks","_attributeCollection","setChildModels","models","id","getData","key","label","getContribution","_context2","attributeContributions","attributes","_filter","contribution","_keys","has","attributeCollection","AttributeCollection","collection","_context3","all","attribute","hasTitle","layouthint","hasExact","TITLE","hasAvatar","AVATAR","hasAvatarForTitle","AVATAR_IN_TITLE","isHidden","getAttributeByKey","_context4","metadataContributions","metadata","_map","metadataKey","metadataCollection","_metadataCollection","_actionCollection","ActionCollection","actions","actionCollection","isCase","avatarForTitleAttribute","_context5","avatarAttributes","_find","titleAttribute","_context6","nonAvatarAttributes","update","model","clonedModel","clone","equals","toString","exports"],"sources":["../../../src/models/detail/DetailModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport ActionCollection from \"../actions/ActionCollection\";\nimport AttributeCollection from \"../attributes/AttributeCollection\";\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport { AVATAR, AVATAR_IN_TITLE, TITLE } from \"../../constants/LayoutHints\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { ModularUIModel, AttributeType } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Base class for details<br/>\n * For instance the details of case 1<br/>\n * For instance the details of record 12<br/>\n */\nexport default class DetailModel extends ResourceModel {\n _attributeCollection: AttributeCollection;\n _metadataCollection: AttributeCollection;\n _actionCollection: ActionCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this.createAttributeCollection();\n this.createMetadataCollection();\n this.createActionCollection();\n }\n\n /**\n */\n get type(): string {\n return \"Detail\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"DetailModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n const resourceType = data.contributions?.resourcetype;\n return (\n resourceType &&\n (resourceType.endsWith(\"DetailPanel\") ||\n [\"Detail\", \"CasePropertiesPanel\", \"CasePropertiesPanelDetail\"].includes(\n resourceType,\n ))\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this._attributeCollection.getInitialChildModelLinks();\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this._attributeCollection.setChildModels(models);\n }\n\n /**\n * Getting the unique identifier of the details\n */\n get id(): string {\n return this.getData(\"_id\", this.key);\n }\n\n /**\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Attribute collection\n */\n createAttributeCollection() {\n const attributeContributions = this.contributions.attributes\n ? this.contributions.attributes.filter((contribution) => {\n const [key] = Object.keys(contribution);\n return has(this.data, key);\n })\n : [];\n\n this.attributeCollection = new AttributeCollection(\n this.data,\n attributeContributions,\n true,\n );\n }\n\n /**\n */\n get attributeCollection(): AttributeCollection {\n return this._attributeCollection;\n }\n\n /**\n */\n set attributeCollection(collection: AttributeCollection) {\n this._attributeCollection = collection;\n }\n\n /**\n * Retrieve list of visible attributes\n */\n get attributes(): Array<AttributeType> {\n return this.attributeCollection.all.filter((attribute) => {\n const hasTitle = attribute.layouthint.hasExact(TITLE);\n const hasAvatar = attribute.layouthint.hasExact(AVATAR);\n const hasAvatarForTitle = attribute.layouthint.hasExact(AVATAR_IN_TITLE);\n return (\n !attribute.isHidden &&\n (!hasTitle || (hasTitle && hasAvatar)) &&\n (!hasAvatarForTitle || (hasAvatarForTitle && !hasAvatar))\n );\n });\n }\n\n /**\n * Retrieve an attribute by it's key\n */\n getAttributeByKey(key: string): AttributeType | null {\n return this._attributeCollection.getAttributeByKey(key);\n }\n\n /**\n * Metadata collection\n */\n createMetadataCollection() {\n const metadataContributions = this.contributions.metadata\n ? Object.keys(this.contributions.metadata).map((metadataKey) => ({\n [metadataKey]: this.contributions.metadata[metadataKey],\n }))\n : [];\n\n this.metadataCollection = new AttributeCollection(\n this.data,\n metadataContributions,\n true,\n );\n }\n\n /**\n */\n get metadataCollection(): AttributeCollection {\n return this._metadataCollection;\n }\n\n /**\n */\n set metadataCollection(collection: AttributeCollection) {\n this._metadataCollection = collection;\n }\n\n /**\n * Action collection\n */\n createActionCollection() {\n this._actionCollection = new ActionCollection(\n this.data.actions,\n this.contributions.actions,\n );\n }\n\n /**\n */\n get actionCollection(): ActionCollection {\n return this._actionCollection;\n }\n\n /**\n */\n set actionCollection(actionCollection: ActionCollection) {\n this._actionCollection = actionCollection;\n }\n\n /**\n * Determines if this is a case\n */\n get isCase(): boolean {\n return this.contributions.resourcetype === \"CaseView\";\n }\n\n /**\n * Getting the attribute that has as layout hint 'avatar-for-title'\n */\n get avatarForTitleAttribute(): ?AttributeType {\n const avatarAttributes = this._attributeCollection.all.filter((attribute) =>\n attribute.layouthint.hasExact(AVATAR),\n );\n\n const avatarForTitleAttribute = avatarAttributes.find((attribute) =>\n attribute.layouthint.hasExact(AVATAR_IN_TITLE),\n );\n\n return avatarForTitleAttribute || null;\n }\n\n /**\n * Getting the attribute that has as layout hint 'title'\n */\n get titleAttribute(): ?AttributeType {\n const nonAvatarAttributes = this._attributeCollection.all.filter(\n (attribute) => !attribute.layouthint.hasExact(AVATAR),\n );\n\n const titleAttribute = nonAvatarAttributes.find((attribute) =>\n attribute.layouthint.has(TITLE),\n );\n\n return titleAttribute || null;\n }\n\n /**\n * Update current detail with a new detail model and return a cloned version of the model\n */\n update(model: ModularUIModel): DetailModel {\n if (model instanceof DetailModel) {\n const clonedModel = this.clone();\n\n clonedModel.attributeCollection = model._attributeCollection;\n clonedModel.metadataCollection = model._metadataCollection;\n clonedModel.actionCollection = model._actionCollection;\n\n return clonedModel;\n }\n\n return this;\n }\n\n /**\n */\n equals(model: DetailModel): boolean {\n return this.id.toString() === model.id.toString();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,cAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA,IAAAK,YAAA,GAAAL,OAAA;AAMA;AACA;AACA;AACA;AACA;AACe,MAAMM,WAAW,SAASC,sBAAa,CAAC;EAKrD;AACF;EACEC,WAAWA,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAEzB,IAAI,CAACC,yBAAyB,CAAC,CAAC;IAChC,IAAI,CAACC,wBAAwB,CAAC,CAAC;IAC/B,IAAI,CAACC,sBAAsB,CAAC,CAAC;EAC/B;;EAEA;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,QAAQ;EACjB;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,aAAa;EACtB;;EAEA;AACF;EACE,OAAOC,iBAAiBA,CAACC,IAAuB,EAAW;IAAA,IAAAC,QAAA;IACzD,MAAMC,YAAY,GAAGF,IAAI,CAACG,aAAa,EAAEC,YAAY;IACrD,OACEF,YAAY,KACX,IAAAG,SAAA,CAAAZ,OAAA,EAAAS,YAAY,EAAAI,IAAA,CAAZJ,YAAY,EAAU,aAAa,CAAC,IACnC,IAAAK,SAAA,CAAAd,OAAA,EAAAQ,QAAA,IAAC,QAAQ,EAAE,qBAAqB,EAAE,2BAA2B,CAAC,EAAAK,IAAA,CAAAL,QAAA,EAC5DC,Y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,IAAAC,SAAA;IACnC,MAAMC,mBAAmB,GAAG,IAAAtC,OAAA,CAAA3B,OAAA,EAAAgE,SAAA,OAAI,CAAChD,oBAAoB,CAACmB,GAAG,EAAAtB,IAAA,CAAAmD,SAAA,EACtD5B,SAAS,IAAK,CAACA,SAAS,CAACE,UAAU,CAACC,QAAQ,CAACG,mBAAM,CACtD,CAAC;IAED,MAAMqB,cAAc,GAAG,IAAAD,KAAA,CAAA9D,OAAA,EAAAiE,mBAAmB,EAAApD,IAAA,CAAnBoD,mBAAmB,EAAO7B,SAAS,IACxDA,SAAS,CAACE,UAAU,CAACR,GAAG,CAACU,kBAAK,CAChC,CAAC;IAED,OAAOuB,cAAc,IAAI,IAAI;EAC/B;;EAEA;AACF;AACA;EACEG,MAAMA,CAACC,KAAqB,EAAe;IACzC,IAAIA,KAAK,YAAYxE,WAAW,EAAE;MAChC,MAAMyE,WAAW,GAAG,IAAI,CAACC,KAAK,CAAC,CAAC;MAEhCD,WAAW,CAACrC,mBAAmB,GAAGoC,KAAK,CAACnD,oBAAoB;MAC5DoD,WAAW,CAAChB,kBAAkB,GAAGe,KAAK,CAACd,mBAAmB;MAC1De,WAAW,CAACX,gBAAgB,GAAGU,KAAK,CAACb,iBAAiB;MAEtD,OAAOc,WAAW;IACpB;IAEA,OAAO,IAAI;EACb;;EAEA;AACF;EACEE,MAAMA,CAACH,KAAkB,EAAW;IAClC,OAAO,IAAI,CAAChD,EAAE,CAACoD,QAAQ,CAAC,CAAC,KAAKJ,KAAK,CAAChD,EAAE,CAACoD,QAAQ,CAAC,CAAC;EACnD;AACF;AAACC,OAAA,CAAAxE,OAAA,GAAAL,WAAA"}
|
package/package.json
CHANGED
|
@@ -167,34 +167,6 @@ export const LayoutHintConfiguration = {
|
|
|
167
167
|
link: "",
|
|
168
168
|
component: ["tab"],
|
|
169
169
|
},
|
|
170
|
-
AVATAR_FOR_TITLE: {
|
|
171
|
-
hint: "avatar-for-title",
|
|
172
|
-
description: {
|
|
173
|
-
NL: "Markeert een attribuut als een avatar voor het titelattribuut.",
|
|
174
|
-
EN: "Marks an attribute as an avatar for the title attribute.",
|
|
175
|
-
},
|
|
176
|
-
link: "",
|
|
177
|
-
component: [
|
|
178
|
-
"caseview_table",
|
|
179
|
-
"codemap",
|
|
180
|
-
"list/appointment_table",
|
|
181
|
-
"list/assignment_table",
|
|
182
|
-
"list/caseproperties_table",
|
|
183
|
-
"list/document_table",
|
|
184
|
-
"list/timelimit_table",
|
|
185
|
-
"list/eventhistory_table",
|
|
186
|
-
"list/note_table",
|
|
187
|
-
"list/record_table",
|
|
188
|
-
"list/case_table",
|
|
189
|
-
"list/casesearch_table",
|
|
190
|
-
"list/datastore_table",
|
|
191
|
-
"list/datastoreview_table",
|
|
192
|
-
"list/instrumentresult_table",
|
|
193
|
-
"list/event_table",
|
|
194
|
-
"list/user_table",
|
|
195
|
-
"list/organization_table",
|
|
196
|
-
],
|
|
197
|
-
},
|
|
198
170
|
AVATAR: {
|
|
199
171
|
hint: "avatar",
|
|
200
172
|
description: {
|
|
@@ -202,25 +174,15 @@ export const LayoutHintConfiguration = {
|
|
|
202
174
|
EN: "Render the attribute as the user's avatar.",
|
|
203
175
|
},
|
|
204
176
|
link: "",
|
|
205
|
-
component: [
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
"
|
|
211
|
-
"list
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
"list/record_table",
|
|
216
|
-
"list/case_table",
|
|
217
|
-
"list/casesearch_table",
|
|
218
|
-
"list/datastore_table",
|
|
219
|
-
"list/datastoreview_table",
|
|
220
|
-
"list/instrumentresult_table",
|
|
221
|
-
"list/event_table",
|
|
222
|
-
"list/user_table",
|
|
223
|
-
"list/organization_table",
|
|
224
|
-
],
|
|
177
|
+
component: ["attribute/upload", "list/user_table"],
|
|
178
|
+
},
|
|
179
|
+
AVATAR_IN_TITLE: {
|
|
180
|
+
hint: "avatar-in-title",
|
|
181
|
+
description: {
|
|
182
|
+
NL: "Geeft aan dat de avatarafbeelding in de titel wordt opgenomen. De avatarafbeelding wordt vóór het titel attribuut weergegeven in de lijstweergave en de snelle lijst quick view.",
|
|
183
|
+
EN: "Indicates that the avatar image will be included in the title. The avatar image is shown in front of the title attribute in the list view and list quick view.",
|
|
184
|
+
},
|
|
185
|
+
link: "",
|
|
186
|
+
component: ["list/user_table"],
|
|
225
187
|
},
|
|
226
188
|
};
|
|
@@ -127,7 +127,7 @@ export const getLayoutHintConfiguration = (): Object => LayoutHintConfiguration;
|
|
|
127
127
|
/**
|
|
128
128
|
* Layout-hint: Marks an attribute as an avatar for the title attribute.
|
|
129
129
|
*/
|
|
130
|
-
export const
|
|
130
|
+
export const AVATAR_IN_TITLE: string = getHint("AVATAR_IN_TITLE");
|
|
131
131
|
|
|
132
132
|
export const AVATAR: string = getHint("AVATAR");
|
|
133
133
|
|
|
@@ -103,6 +103,12 @@ export default class StringAttributeModel extends AttributeModel {
|
|
|
103
103
|
return this.layouthint.has("zipcode");
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
+
/**
|
|
107
|
+
*/
|
|
108
|
+
isAvatar(): boolean {
|
|
109
|
+
return this.layouthint.has("avatar");
|
|
110
|
+
}
|
|
111
|
+
|
|
106
112
|
/**
|
|
107
113
|
*/
|
|
108
114
|
isEmail(): boolean {
|
|
@@ -281,7 +287,7 @@ export default class StringAttributeModel extends AttributeModel {
|
|
|
281
287
|
/**
|
|
282
288
|
*/
|
|
283
289
|
get readonlyWidth(): $Keys<typeof ATTRIBUTE_WIDTH> {
|
|
284
|
-
if (this.isZipcode() || this.isBSN()) {
|
|
290
|
+
if (this.isZipcode() || this.isBSN() || this.isAvatar()) {
|
|
285
291
|
return ATTRIBUTE_WIDTH.SMALL;
|
|
286
292
|
}
|
|
287
293
|
|
|
@@ -5,7 +5,7 @@ import ActionCollection from "../actions/ActionCollection";
|
|
|
5
5
|
import AttributeCollection from "../attributes/AttributeCollection";
|
|
6
6
|
import ResourceModel from "../base/ResourceModel";
|
|
7
7
|
|
|
8
|
-
import { AVATAR,
|
|
8
|
+
import { AVATAR, AVATAR_IN_TITLE, TITLE } from "../../constants/LayoutHints";
|
|
9
9
|
|
|
10
10
|
import type { ModularUIResponse } from "../../modularui";
|
|
11
11
|
import type { ModularUIModel, AttributeType } from "../types";
|
|
@@ -118,7 +118,7 @@ export default class DetailModel extends ResourceModel {
|
|
|
118
118
|
return this.attributeCollection.all.filter((attribute) => {
|
|
119
119
|
const hasTitle = attribute.layouthint.hasExact(TITLE);
|
|
120
120
|
const hasAvatar = attribute.layouthint.hasExact(AVATAR);
|
|
121
|
-
const hasAvatarForTitle = attribute.layouthint.hasExact(
|
|
121
|
+
const hasAvatarForTitle = attribute.layouthint.hasExact(AVATAR_IN_TITLE);
|
|
122
122
|
return (
|
|
123
123
|
!attribute.isHidden &&
|
|
124
124
|
(!hasTitle || (hasTitle && hasAvatar)) &&
|
|
@@ -201,7 +201,7 @@ export default class DetailModel extends ResourceModel {
|
|
|
201
201
|
);
|
|
202
202
|
|
|
203
203
|
const avatarForTitleAttribute = avatarAttributes.find((attribute) =>
|
|
204
|
-
attribute.layouthint.hasExact(
|
|
204
|
+
attribute.layouthint.hasExact(AVATAR_IN_TITLE),
|
|
205
205
|
);
|
|
206
206
|
|
|
207
207
|
return avatarForTitleAttribute || null;
|