@beinformed/ui 1.13.2 → 1.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/esm/constants/LayoutHintConfig.js +9 -0
- package/esm/constants/LayoutHintConfig.js.map +1 -1
- package/esm/constants/LayoutHints.js +5 -0
- package/esm/constants/LayoutHints.js.map +1 -1
- package/esm/models/attributes/DatetimeAttributeModel.js +7 -3
- package/esm/models/attributes/DatetimeAttributeModel.js.map +1 -1
- package/lib/constants/LayoutHintConfig.js +9 -0
- package/lib/constants/LayoutHintConfig.js.flow +9 -0
- package/lib/constants/LayoutHintConfig.js.map +1 -1
- package/lib/constants/LayoutHints.js +8 -2
- package/lib/constants/LayoutHints.js.flow +4 -0
- package/lib/constants/LayoutHints.js.map +1 -1
- package/lib/models/attributes/DatetimeAttributeModel.js +7 -3
- package/lib/models/attributes/DatetimeAttributeModel.js.flow +9 -4
- package/lib/models/attributes/DatetimeAttributeModel.js.map +1 -1
- package/package.json +10 -10
- package/src/constants/LayoutHintConfig.js +9 -0
- package/src/constants/LayoutHints.js +4 -0
- package/src/models/attributes/DatetimeAttributeModel.js +9 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.13.3](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.13.2...v1.13.3) (2022-02-04)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- **date-format:** add hint that makes it possible to ignore global date format for specific attribute ([dc54191](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/dc5419151a6c42a013901f0e12634c1943ff0644))
|
|
10
|
+
|
|
5
11
|
### [1.13.2](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.13.1...v1.13.2) (2022-01-28)
|
|
6
12
|
|
|
7
13
|
### Bug Fixes
|
|
@@ -89,6 +89,15 @@ export var LayoutHintConfiguration = {
|
|
|
89
89
|
link: "",
|
|
90
90
|
component: ["attribute/number"]
|
|
91
91
|
},
|
|
92
|
+
IGNORE_FORMAT_SETTING: {
|
|
93
|
+
hint: "ignore-format-setting",
|
|
94
|
+
description: {
|
|
95
|
+
NL: "Maakt het mogelijk om de global date format setting te negeren voor een specifiek attribuut",
|
|
96
|
+
EN: "Makes it possible to ignore the global date format for a specific attribute"
|
|
97
|
+
},
|
|
98
|
+
link: "",
|
|
99
|
+
component: ["attribute/date", "attribute/datetime"]
|
|
100
|
+
},
|
|
92
101
|
CREATE_ACTION: {
|
|
93
102
|
hint: "create",
|
|
94
103
|
description: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/constants/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"],"mappings":"AACA,OAAO,IAAMA,uBAAuB,GAAG;AACrCC,EAAAA,SAAS,EAAE;AACTC,IAAAA,IAAI,EAAE,WADG;AAETC,IAAAA,WAAW,EAAE;AACXC,MAAAA,EAAE,EAAE,iGADO;AAEXC,MAAAA,EAAE,EAAE;AAFO,KAFJ;AAMTC,IAAAA,IAAI,EAAE,EANG;AAOTC,IAAAA,SAAS,EAAE,CAAC,WAAD;AAPF,GAD0B;AAUrCC,EAAAA,2BAA2B,EAAE;AAC3BN,IAAAA,IAAI,EAAE,wCADqB;AAE3BC,IAAAA,W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ow\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};\n"],"file":"LayoutHintConfig.js"}
|
|
1
|
+
{"version":3,"sources":["../../src/constants/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","IGNORE_FORMAT_SETTING","CREATE_ACTION","UPDATE_ACTION","DELETE_ACTION","SORT_OPTIONS","CASEVIEW_LINK","DISABLED"],"mappings":"AACA,OAAO,IAAMA,uBAAuB,GAAG;AACrCC,EAAAA,SAAS,EAAE;AACTC,IAAAA,IAAI,EAAE,WADG;AAETC,IAAAA,WAAW,EAAE;AACXC,MAAAA,EAAE,EAAE,iGADO;AAEXC,MAAAA,EAAE,EAAE;AAFO,KAFJ;AAMTC,IAAAA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AAA,WAAW,EAAE;AACXC,MAAAA,EAAE,EAAE,uHADO;AAEXC,MAAAA,EAAE,EAAE;AAFO,KAFA;AAMbE,IAAAA,SAAS,EAAE,CAAC,qBAAD,EAAwB,sBAAxB;AANE,GAvJsB;AA+JrCgB,EAAAA,QAAQ,EAAE;AACRrB,IAAAA,IAAI,EAAE,UADE;AAERC,IAAAA,WAAW,EAAE;AACXC,MAAAA,EAAE,EAAE,8CADO;AAEXC,MAAAA,EAAE,EAAE;AAFO,KAFL;AAMRC,IAAAA,IAAI,EAAE,EANE;AAORC,IAAAA,SAAS,EAAE,CAAC,WAAD;AAPH;AA/J2B,CAAhC","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 IGNORE_FORMAT_SETTING: {\n hint: \"ignore-format-setting\",\n description: {\n NL: \"Maakt het mogelijk om de global date format setting te negeren voor een specifiek attribuut\",\n EN: \"Makes it possible to ignore the global date format for a specific attribute\",\n },\n link: \"\",\n component: [\"attribute/date\", \"attribute/datetime\"],\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};\n"],"file":"LayoutHintConfig.js"}
|
|
@@ -58,6 +58,11 @@ export var SORT_OPTIONS = getHint("SORT_OPTIONS");
|
|
|
58
58
|
*/
|
|
59
59
|
|
|
60
60
|
export var TITLE = getHint("TITLE");
|
|
61
|
+
/**
|
|
62
|
+
* Layout-hint: Ignore the global input format for specific attribute
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
export var IGNORE_FORMAT_SETTING = getHint("IGNORE_FORMAT_SETTING");
|
|
61
66
|
/*
|
|
62
67
|
* --------------------------------
|
|
63
68
|
* FORM
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/constants/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","getLayoutHintConfiguration"],"mappings":"AACA,SAASA,uBAAT,QAAwC,oBAAxC;AAEA;AACA;AACA;;AACA,IAAMC,OAAO,GAAG,SAAVA,OAAU,CAACC,IAAD,EAA0B;AACxC,MAAIF,uBAAuB,CAACE,IAAD,CAA3B,EAAmC;AACjC,WAAOF,uBAAuB,CAACE,IAAD,CAAvB,CAA8BA,IAArC;AACD;;AAED,SAAO,EAAP;AACD,CAND;AAQA;AACA;AACA;;;AACA,OAAO,IAAMC,SAAiB,GAAGF,OAAO,CAAC,WAAD,CAAjC;AAEP;AACA;AACA;AACA;;AACA,OAAO,IAAMG,QAAgB,GAAGH,OAAO,CAAC,UAAD,CAAhC;AAEP;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;;AACA,OAAO,IAAMI,2BAA2B,GAAG,mBAApC;AACP;AACA;;AACA,OAAO,IAAMC,mBAAmB,GAAG,sBAA5B;AAEP;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;;AACA,OAAO,IAAMC,gBAAwB,GAAGN,OAAO,CAAC,kBAAD,CAAxC;AACP;AACA;AACA;;AACA,OAAO,IAAMO,YAAoB,GAAGP,OAAO,CAAC,cAAD,CAApC;AACP;AACA;AACA;;AACA,OAAO,IAAMQ,KAAa,GAAGR,OAAO,CAAC,OAAD,CAA7B;AAEP;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;;AACA,OAAO,
|
|
1
|
+
{"version":3,"sources":["../../src/constants/LayoutHints.js"],"names":["LayoutHintConfiguration","getHint","hint","MANDATORY","DISABLED","DEPENDENT_ATTRIBUTE_CONTROL","DEPENDENT_ATTRIBUTE","CONFIRM_PASSWORD","SORT_OPTIONS","TITLE","IGNORE_FORMAT_SETTING","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","getLayoutHintConfiguration"],"mappings":"AACA,SAASA,uBAAT,QAAwC,oBAAxC;AAEA;AACA;AACA;;AACA,IAAMC,OAAO,GAAG,SAAVA,OAAU,CAACC,IAAD,EAA0B;AACxC,MAAIF,uBAAuB,CAACE,IAAD,CAA3B,EAAmC;AACjC,WAAOF,uBAAuB,CAACE,IAAD,CAAvB,CAA8BA,IAArC;AACD;;AAED,SAAO,EAAP;AACD,CAND;AAQA;AACA;AACA;;;AACA,OAAO,IAAMC,SAAiB,GAAGF,OAAO,CAAC,WAAD,CAAjC;AAEP;AACA;AACA;AACA;;AACA,OAAO,IAAMG,QAAgB,GAAGH,OAAO,CAAC,UAAD,CAAhC;AAEP;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;;AACA,OAAO,IAAMI,2BAA2B,GAAG,mBAApC;AACP;AACA;;AACA,OA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AAAA,CAAnC;AAEP,eAAeC,OAAf","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 * Layout-hint: Ignore the global input format for specific attribute\n */\nexport const IGNORE_FORMAT_SETTING: string = getHint(\"IGNORE_FORMAT_SETTING\");\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 */\nexport const getLayoutHintConfiguration = (): Object => LayoutHintConfiguration;\n\nexport default getHint;\n"],"file":"LayoutHints.js"}
|
|
@@ -278,10 +278,14 @@ var DatetimeAttributeModel = /*#__PURE__*/function (_StringAttributeModel) {
|
|
|
278
278
|
} // setting for date input
|
|
279
279
|
|
|
280
280
|
|
|
281
|
-
var
|
|
281
|
+
var ignoreDateInputFormatSetting = getSetting("IGNORE_FORMAT_SETTING", false);
|
|
282
282
|
|
|
283
|
-
if (
|
|
284
|
-
|
|
283
|
+
if (!ignoreDateInputFormatSetting) {
|
|
284
|
+
var dateInputFormatSetting = getSetting("DATE_INPUT_FORMAT", "");
|
|
285
|
+
|
|
286
|
+
if (dateInputFormatSetting) {
|
|
287
|
+
return dateInputFormatSetting;
|
|
288
|
+
}
|
|
285
289
|
}
|
|
286
290
|
|
|
287
291
|
var format = this.format;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/models/attributes/DatetimeAttributeModel.js"],"names":["has","DateUtil","DateTimeUtil","TimeUtil","TimestampUtil","StringAttributeModel","ConstraintCollection","DateTimeDateFormatConstraint","DateTimeTimeFormatConstraint","DatetimeFormatConstraint","DateBoundaryConstraint","ATTRIBUTE_WIDTH","ISO_DATE_FORMAT","getSetting","PRODUCT_DEFAULT_DATE_FORMAT","DatetimeAttributeModel","attribute","attributeContributions","updateInitValue","type","value","data","length","split","hasTime","getTimeValue","timeValue","timeInputFormat","toLowerCase","formatUtil","setHour","setMinute","setSecond","setMilliseconds","getInitValue","_initvalue","_inputvalue","getInitialInputValue","_value","initValue","toFormat","inputFormat","getContribution","toString","getInputValue","validate","toISO","format","convertFormat","dateInputFormat","hasDate","dateInputFormatSetting","dateFormat","replace","readonlyFormatSetting","_placeholder","formatLabel","placeholder","timeFormatParts","push","timeFormat","join","hasFormat","dateReadonlyFormat","dateTimeReadonlyFormat","timeReadonlyFormat","formatValue","error","id","message","properties","_errorCollection","addServerError","constraints","add","getFormatConstraint","mindate","maxdate","SMALL","MEDIUM","contributions"],"mappings":";;;;;;;;;;;;;;AACA,SAASA,GAAT,QAAoB,6BAApB;AAEA,SACEC,QADF,EAEEC,YAFF,EAGEC,QAHF,EAIEC,aAJF,QAKO,mCALP;AAOA,OAAOC,oBAAP,MAAiC,wBAAjC;AAEA,OAAOC,oBAAP,MAAiC,0CAAjC;AACA,OAAOC,4BAAP,MAAyC,kDAAzC;AACA,OAAOC,4BAAP,MAAyC,kDAAzC;AACA,OAAOC,wBAAP,MAAqC,8CAArC;AACA,OAAOC,sBAAP,MAAmC,4CAAnC;AAEA,SAASC,eAAT,EAA0BC,eAA1B,QAAiD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ourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport {\n DateUtil,\n DateTimeUtil,\n TimeUtil,\n TimestampUtil,\n} from \"../../utils/datetime/DateTimeUtil\";\n\nimport StringAttributeModel from \"./StringAttributeModel\";\n\nimport ConstraintCollection from \"./input-constraints/ConstraintCollection\";\nimport DateTimeDateFormatConstraint from \"./input-constraints/DateTimeDateFormatConstraint\";\nimport DateTimeTimeFormatConstraint from \"./input-constraints/DateTimeTimeFormatConstraint\";\nimport DatetimeFormatConstraint from \"./input-constraints/DatetimeFormatConstraint\";\nimport DateBoundaryConstraint from \"./input-constraints/DateBoundaryConstraint\";\n\nimport { ATTRIBUTE_WIDTH, ISO_DATE_FORMAT } from \"../../constants\";\nimport { getSetting } from \"../../constants/Settings\";\n\nimport type { FormErrorAnchor, IConstraintModel } from \"../types\";\n\n// date format of default\nconst PRODUCT_DEFAULT_DATE_FORMAT = \"dd-MM-yyyy\";\n\n/**\n */\nclass DatetimeAttributeModel extends StringAttributeModel {\n /**\n */\n constructor(attribute: Object, attributeContributions: Object) {\n super(attribute, attributeContributions);\n\n this.updateInitValue();\n }\n\n /**\n */\n static isApplicableModel(contributions: Object): boolean {\n return [\"date\", \"time\", \"datetime\", \"timestamp\"].includes(\n contributions.type\n );\n }\n\n /**\n */\n get formatUtil():\n | typeof TimeUtil\n | typeof TimestampUtil\n | typeof DateTimeUtil\n | typeof DateUtil {\n switch (this.type) {\n case \"time\":\n return TimeUtil;\n case \"timestamp\":\n return TimestampUtil;\n case \"datetime\":\n return DateTimeUtil;\n default:\n return DateUtil;\n }\n }\n\n /**\n */\n getInitValue(): string | null {\n let value = this.data.value;\n if (value != null) {\n if (this.type === \"time\" && value.length === 5) {\n value = `${value}:00`;\n }\n\n // handle old datetime values, which contained ms\n if (this.type === \"datetime\" && value.includes(\".\")) {\n value = value.split(\".\")[0];\n }\n\n if (this.hasTime) {\n value = this.getTimeValue(value);\n }\n }\n\n return value;\n }\n\n /**\n */\n getTimeValue(value: string): string {\n let timeValue = value;\n if (!this.timeInputFormat.toLowerCase().includes(\"h\")) {\n timeValue = this.formatUtil.setHour(value, 0);\n }\n if (!this.timeInputFormat.includes(\"m\")) {\n timeValue = this.formatUtil.setMinute(value, 0);\n }\n if (!this.timeInputFormat.includes(\"s\")) {\n timeValue = this.formatUtil.setSecond(value, 0);\n }\n if (this.type === \"timestamp\" && !this.timeInputFormat.includes(\"S\")) {\n timeValue = this.formatUtil.setMilliseconds(value, 0);\n }\n return timeValue;\n }\n\n /**\n * Set time in the correct value based on available elements in the time format\n */\n updateInitValue() {\n const value = this.getInitValue();\n if (value != null) {\n this._initvalue = value;\n this._inputvalue = this.getInitialInputValue(value);\n this._value = value;\n }\n }\n\n /**\n * Get initial user input value\n */\n getInitialInputValue(value?: string): string {\n if (!value) {\n return \"\";\n }\n\n let initValue = value;\n if (this.type === \"time\" && value.length === 5) {\n initValue = `${value}:00`;\n }\n\n return this.formatUtil.toFormat(initValue, this.inputFormat);\n }\n\n /**\n * Set type to date\n */\n get type(): string {\n return this.getContribution(\"type\", \"date\");\n }\n\n /**\n * Returns the value as entered by the user. This can differ from the internal iso value that is stored\n */\n getInputValue(): string {\n return this._inputvalue ? this._inputvalue.toString() : \"\";\n }\n\n /**\n * Get input value\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.validate(value);\n\n this._inputvalue = value;\n\n this.value =\n value !== null && value !== \"\"\n ? this.formatUtil.toISO(value, this.inputFormat)\n : null;\n }\n\n /**\n * Get date format\n */\n get format(): string {\n const format = this.getContribution(\"format\", \"\");\n return this.formatUtil.convertFormat(format);\n }\n\n /**\n */\n get operator(): string {\n return this.getContribution(\"operator\", \"\");\n }\n\n /**\n */\n get hasDate(): boolean {\n return (\n this.type === \"date\" ||\n this.type === \"datetime\" ||\n this.type === \"timestamp\"\n );\n }\n\n /**\n */\n get hasTime(): boolean {\n return (\n this.type === \"time\" ||\n this.type === \"datetime\" ||\n this.type === \"timestamp\"\n );\n }\n\n /**\n */\n get formatLabel(): string {\n switch (this.type) {\n case \"date\":\n return this.dateInputFormat.toLowerCase();\n case \"time\":\n return this.timeInputFormat.toLowerCase();\n default:\n return this.format.toLowerCase();\n }\n }\n\n /**\n */\n get inputFormat(): string {\n if (this.hasDate && this.hasTime) {\n return `${this.dateInputFormat} ${this.timeInputFormat}`.trim();\n }\n\n if (this.hasDate) {\n return this.dateInputFormat;\n }\n\n if (this.hasTime) {\n return this.timeInputFormat;\n }\n\n return \"\";\n }\n\n /**\n */\n get dateInputFormat(): string {\n if (!this.hasDate) {\n return \"\";\n }\n\n // setting for date input\n const dateInputFormatSetting = getSetting(\"DATE_INPUT_FORMAT\", \"\");\n\n if (dateInputFormatSetting) {\n return dateInputFormatSetting;\n }\n\n let format = this.format;\n\n let dateFormat = this.hasTime\n ? format.replace(this.timeInputFormat, \"\").trim()\n : format;\n\n return dateFormat;\n }\n\n /**\n */\n get dateReadonlyFormat(): string {\n if (!this.hasDate) {\n return \"\";\n }\n\n let format = this.format;\n\n let dateFormat = this.hasTime\n ? format.replace(this.timeInputFormat, \"\").trim()\n : format;\n\n const readonlyFormatSetting = getSetting(\"DATE_READONLY_FORMAT\", \"\");\n\n if (dateFormat === PRODUCT_DEFAULT_DATE_FORMAT && readonlyFormatSetting) {\n dateFormat = readonlyFormatSetting;\n }\n\n return dateFormat;\n }\n\n /**\n * return attribute placeholder or, if DATE_INPUT_FORMAT setting is used, lowercased setting, otherwise return formatlabel without time input format from contributions\n */\n get placeholder(): string {\n if (this._placeholder !== \"\") {\n return this._placeholder;\n }\n\n const dateInputFormatSetting = getSetting(\"DATE_INPUT_FORMAT\", \"\");\n\n if (dateInputFormatSetting) {\n return dateInputFormatSetting.toLowerCase();\n }\n\n const formatLabel = this.getContribution(\"formatlabel\", \"\");\n\n if (this.hasDate && this.hasTime && formatLabel.includes(\" \")) {\n // return first part of formatlabel to keep placeholder matching date input\n return formatLabel.split(\" \")[0];\n }\n\n return formatLabel;\n }\n\n /**\n * Set placeholder text\n */\n set placeholder(placeholder: string) {\n this._placeholder = placeholder;\n }\n\n /**\n */\n get timeInputFormat(): string {\n if (!this.hasTime) {\n return \"\";\n }\n\n const format = this.format;\n\n let timeFormatParts = [];\n if (format.includes(\"H\")) {\n timeFormatParts.push(\"HH\");\n } else if (format.includes(\"h\")) {\n timeFormatParts.push(\"hh\");\n }\n if (format.includes(\"m\")) {\n timeFormatParts.push(\"mm\");\n }\n if (format.includes(\"s\")) {\n timeFormatParts.push(\"ss\");\n }\n\n let timeFormat = timeFormatParts.join(\":\");\n if (format.includes(\"S\")) {\n timeFormat = `${timeFormat}.SSS`;\n }\n if (format.includes(\"a\")) {\n return `${timeFormat} a`;\n }\n return timeFormat;\n }\n\n /**\n */\n get timeReadonlyFormat(): string {\n if (!this.hasTime) {\n return \"\";\n }\n\n return this.timeInputFormat;\n }\n\n /**\n */\n get dateInputValue(): string {\n return typeof this.value === \"string\" && this.dateInputFormat !== \"\"\n ? this.formatUtil.toFormat(this.value, this.dateInputFormat)\n : \"\";\n }\n\n /**\n */\n get timeInputValue(): string {\n return typeof this.value === \"string\" && this.timeInputFormat !== \"\"\n ? this.formatUtil.toFormat(this.value, this.timeInputFormat)\n : \"\";\n }\n\n // format value in readonly rendering\n /**\n */\n formatValue(value: ?string): string {\n if (value == null || value.toString() === \"\") {\n return \"\";\n }\n\n // when the value is exactly an iso date, render as date\n if (\n (this.type === \"datetime\" || this.type === \"timestamp\") &&\n DateUtil.hasFormat(value, ISO_DATE_FORMAT)\n ) {\n return DateUtil.toFormat(value, this.dateReadonlyFormat);\n }\n\n if (this.hasDate && this.hasTime) {\n const dateTimeReadonlyFormat = `${this.dateReadonlyFormat} ${this.timeReadonlyFormat}`;\n return this.formatUtil.toFormat(value, dateTimeReadonlyFormat);\n }\n\n if (this.type === \"date\") {\n return this.formatUtil.toFormat(value, this.dateReadonlyFormat);\n }\n\n return this.formatUtil.toFormat(value, this.format);\n }\n\n /**\n * Retrieve readonly value, the date in the configurated format\n */\n get readonlyvalue(): string {\n if (typeof this.value === \"string\") {\n return this.formatValue(this.value.toString());\n }\n\n return \"\";\n }\n\n /**\n * Get minimum date\n */\n get mindate(): string | null {\n return this.getContribution(\"mindate\");\n }\n\n /**\n * Get maximum date\n */\n get maxdate(): string | null {\n return this.getContribution(\"maxdate\");\n }\n\n /**\n * Registers an error that was received from a server response\n */\n addServerError(error: FormErrorAnchor) {\n const { id, message, properties } = error;\n if (properties && has(properties, \"format\") && this.formatLabel) {\n properties.format = this.formatLabel;\n }\n\n this._errorCollection.addServerError(id, message, properties);\n }\n\n /**\n */\n getFormatConstraint(): IConstraintModel {\n switch (this.type) {\n case \"date\":\n return new DateTimeDateFormatConstraint(\n this.dateInputFormat,\n this.formatLabel\n );\n case \"time\":\n return new DateTimeTimeFormatConstraint(\n this.timeInputFormat,\n this.formatLabel\n );\n default:\n return new DatetimeFormatConstraint(\n this.type,\n this.inputFormat,\n this.formatLabel\n );\n }\n }\n\n /**\n * Add Date constraints for attribute\n */\n addConstraints(): ConstraintCollection {\n const constraints = new ConstraintCollection();\n\n constraints.add(this.getFormatConstraint());\n\n if (this.mindate || this.maxdate) {\n constraints.add(\n new DateBoundaryConstraint(\n this.type,\n this.mindate,\n this.maxdate,\n this.inputFormat\n )\n );\n }\n\n return constraints;\n }\n\n /**\n */\n get readonlyWidth(): $Keys<typeof ATTRIBUTE_WIDTH> {\n if (this.type === \"date\" || this.type === \"time\") {\n return ATTRIBUTE_WIDTH.SMALL;\n }\n\n return ATTRIBUTE_WIDTH.MEDIUM;\n }\n}\n\nexport default DatetimeAttributeModel;\n"],"file":"DatetimeAttributeModel.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/models/attributes/DatetimeAttributeModel.js"],"names":["has","DateUtil","DateTimeUtil","TimeUtil","TimestampUtil","StringAttributeModel","ConstraintCollection","DateTimeDateFormatConstraint","DateTimeTimeFormatConstraint","DatetimeFormatConstraint","DateBoundaryConstraint","ATTRIBUTE_WIDTH","ISO_DATE_FORMAT","getSetting","PRODUCT_DEFAULT_DATE_FORMAT","DatetimeAttributeModel","attribute","attributeContributions","updateInitValue","type","value","data","length","split","hasTime","getTimeValue","timeValue","timeInputFormat","toLowerCase","formatUtil","setHour","setMinute","setSecond","setMilliseconds","getInitValue","_initvalue","_inputvalue","getInitialInputValue","_value","initValue","toFormat","inputFormat","getContribution","toString","getInputValue","validate","toISO","format","convertFormat","dateInputFormat","hasDate","ignoreDateInputFormatSetting","dateInputFormatSetting","dateFormat","replace","readonlyFormatSetting","_placeholder","formatLabel","placeholder","timeFormatParts","push","timeFormat","join","hasFormat","dateReadonlyFormat","dateTimeReadonlyFormat","timeReadonlyFormat","formatValue","error","id","message","properties","_errorCollection","addServerError","constraints","add","getFormatConstraint","mindate","maxdate","SMALL","MEDIUM","contributions"],"mappings":";;;;;;;;;;;;;;AACA,SAASA,GAAT,QAAoB,6BAApB;AAEA,SACEC,QADF,EAEEC,YAFF,EAGEC,QAHF,EAIEC,aAJF,QAKO,mCALP;AAOA,OAAOC,oBAAP,MAAiC,wBAAjC;AAEA,OAAOC,oBAAP,MAAiC,0CAAjC;AACA,OAAOC,4BAAP,MAAyC,kDAAzC;AACA,OAAOC,4BAAP,MAAyC,kDAAzC;AACA,OAAOC,wBAAP,MAAqC,8CAArC;AACA,OAAOC,sBAAP,MAAmC,4CAAnC;AAEA,SAASC,eAAT,EAA0BC,eAA1B,QAAiD,iBAAjD;AACA,SAASC,UAAT,QAA2B,0BAA3B;AAIA;AACA,IAAMC,2BAA2B,GAAG,YAApC;AAEA;AACA;;IACMC,sB;;;;;AACJ;AACF;AACE,kCAAYC,SAAZ,EAA+BC,sBAA/B,EAA+D;AAAA;;AAAA;;AAC7D,8BAAMD,SAAN,EAAiBC,sBAAjB;;AAEA,UAAKC,eAAL;;AAH6D;AAI9D;AAED;AACF;;;;;;AAOE;AACF;AACE,mBAIoB;AAClB,cAAQ,KAAKC,IAAb;AACE,aA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AAL;AACE,iBAAO,IAAIZ,4BAAJ,CACL,KAAK0C,eADA,EAEL,KAAKQ,WAFA,CAAP;;AAIF,aAAK,MAAL;AACE,iBAAO,IAAIjD,4BAAJ,CACL,KAAKmB,eADA,EAEL,KAAK8B,WAFA,CAAP;;AAIF;AACE,iBAAO,IAAIhD,wBAAJ,CACL,KAAKU,IADA,EAEL,KAAKsB,WAFA,EAGL,KAAKgB,WAHA,CAAP;AAZJ;AAkBD;AAED;AACF;AACA;;;;WACE,0BAAuC;AACrC,UAAMiB,WAAW,GAAG,IAAIpE,oBAAJ,EAApB;AAEAoE,MAAAA,WAAW,CAACC,GAAZ,CAAgB,KAAKC,mBAAL,EAAhB;;AAEA,UAAI,KAAKC,OAAL,IAAgB,KAAKC,OAAzB,EAAkC;AAChCJ,QAAAA,WAAW,CAACC,GAAZ,CACE,IAAIjE,sBAAJ,CACE,KAAKS,IADP,EAEE,KAAK0D,OAFP,EAGE,KAAKC,OAHP,EAIE,KAAKrC,WAJP,CADF;AAQD;;AAED,aAAOiC,WAAP;AACD;AAED;AACF;;;;SACE,eAAmD;AACjD,UAAI,KAAKvD,IAAL,KAAc,MAAd,IAAwB,KAAKA,IAAL,KAAc,MAA1C,EAAkD;AAChD,eAAOR,eAAe,CAACoE,KAAvB;AACD;;AAED,aAAOpE,eAAe,CAACqE,MAAvB;AACD;;;WAncD,2BAAyBC,aAAzB,EAAyD;AAAA;;AACvD,aAAO,wCAAC,MAAD,EAAS,MAAT,EAAiB,UAAjB,EAA6B,WAA7B,oBACLA,aAAa,CAAC9D,IADT,CAAP;AAGD;;;;EAfkCd,oB;;AAidrC,eAAeU,sBAAf","sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport {\n DateUtil,\n DateTimeUtil,\n TimeUtil,\n TimestampUtil,\n} from \"../../utils/datetime/DateTimeUtil\";\n\nimport StringAttributeModel from \"./StringAttributeModel\";\n\nimport ConstraintCollection from \"./input-constraints/ConstraintCollection\";\nimport DateTimeDateFormatConstraint from \"./input-constraints/DateTimeDateFormatConstraint\";\nimport DateTimeTimeFormatConstraint from \"./input-constraints/DateTimeTimeFormatConstraint\";\nimport DatetimeFormatConstraint from \"./input-constraints/DatetimeFormatConstraint\";\nimport DateBoundaryConstraint from \"./input-constraints/DateBoundaryConstraint\";\n\nimport { ATTRIBUTE_WIDTH, ISO_DATE_FORMAT } from \"../../constants\";\nimport { getSetting } from \"../../constants/Settings\";\n\nimport type { FormErrorAnchor, IConstraintModel } from \"../types\";\n\n// date format of default\nconst PRODUCT_DEFAULT_DATE_FORMAT = \"dd-MM-yyyy\";\n\n/**\n */\nclass DatetimeAttributeModel extends StringAttributeModel {\n /**\n */\n constructor(attribute: Object, attributeContributions: Object) {\n super(attribute, attributeContributions);\n\n this.updateInitValue();\n }\n\n /**\n */\n static isApplicableModel(contributions: Object): boolean {\n return [\"date\", \"time\", \"datetime\", \"timestamp\"].includes(\n contributions.type\n );\n }\n\n /**\n */\n get formatUtil():\n | typeof TimeUtil\n | typeof TimestampUtil\n | typeof DateTimeUtil\n | typeof DateUtil {\n switch (this.type) {\n case \"time\":\n return TimeUtil;\n case \"timestamp\":\n return TimestampUtil;\n case \"datetime\":\n return DateTimeUtil;\n default:\n return DateUtil;\n }\n }\n\n /**\n */\n getInitValue(): string | null {\n let value = this.data.value;\n if (value != null) {\n if (this.type === \"time\" && value.length === 5) {\n value = `${value}:00`;\n }\n\n // handle old datetime values, which contained ms\n if (this.type === \"datetime\" && value.includes(\".\")) {\n value = value.split(\".\")[0];\n }\n\n if (this.hasTime) {\n value = this.getTimeValue(value);\n }\n }\n\n return value;\n }\n\n /**\n */\n getTimeValue(value: string): string {\n let timeValue = value;\n if (!this.timeInputFormat.toLowerCase().includes(\"h\")) {\n timeValue = this.formatUtil.setHour(value, 0);\n }\n if (!this.timeInputFormat.includes(\"m\")) {\n timeValue = this.formatUtil.setMinute(value, 0);\n }\n if (!this.timeInputFormat.includes(\"s\")) {\n timeValue = this.formatUtil.setSecond(value, 0);\n }\n if (this.type === \"timestamp\" && !this.timeInputFormat.includes(\"S\")) {\n timeValue = this.formatUtil.setMilliseconds(value, 0);\n }\n return timeValue;\n }\n\n /**\n * Set time in the correct value based on available elements in the time format\n */\n updateInitValue() {\n const value = this.getInitValue();\n if (value != null) {\n this._initvalue = value;\n this._inputvalue = this.getInitialInputValue(value);\n this._value = value;\n }\n }\n\n /**\n * Get initial user input value\n */\n getInitialInputValue(value?: string): string {\n if (!value) {\n return \"\";\n }\n\n let initValue = value;\n if (this.type === \"time\" && value.length === 5) {\n initValue = `${value}:00`;\n }\n\n return this.formatUtil.toFormat(initValue, this.inputFormat);\n }\n\n /**\n * Set type to date\n */\n get type(): string {\n return this.getContribution(\"type\", \"date\");\n }\n\n /**\n * Returns the value as entered by the user. This can differ from the internal iso value that is stored\n */\n getInputValue(): string {\n return this._inputvalue ? this._inputvalue.toString() : \"\";\n }\n\n /**\n * Get input value\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.validate(value);\n\n this._inputvalue = value;\n\n this.value =\n value !== null && value !== \"\"\n ? this.formatUtil.toISO(value, this.inputFormat)\n : null;\n }\n\n /**\n * Get date format\n */\n get format(): string {\n const format = this.getContribution(\"format\", \"\");\n return this.formatUtil.convertFormat(format);\n }\n\n /**\n */\n get operator(): string {\n return this.getContribution(\"operator\", \"\");\n }\n\n /**\n */\n get hasDate(): boolean {\n return (\n this.type === \"date\" ||\n this.type === \"datetime\" ||\n this.type === \"timestamp\"\n );\n }\n\n /**\n */\n get hasTime(): boolean {\n return (\n this.type === \"time\" ||\n this.type === \"datetime\" ||\n this.type === \"timestamp\"\n );\n }\n\n /**\n */\n get formatLabel(): string {\n switch (this.type) {\n case \"date\":\n return this.dateInputFormat.toLowerCase();\n case \"time\":\n return this.timeInputFormat.toLowerCase();\n default:\n return this.format.toLowerCase();\n }\n }\n\n /**\n */\n get inputFormat(): string {\n if (this.hasDate && this.hasTime) {\n return `${this.dateInputFormat} ${this.timeInputFormat}`.trim();\n }\n\n if (this.hasDate) {\n return this.dateInputFormat;\n }\n\n if (this.hasTime) {\n return this.timeInputFormat;\n }\n\n return \"\";\n }\n\n /**\n */\n get dateInputFormat(): string {\n if (!this.hasDate) {\n return \"\";\n }\n\n // setting for date input\n const ignoreDateInputFormatSetting = getSetting(\n \"IGNORE_FORMAT_SETTING\",\n false\n );\n if (!ignoreDateInputFormatSetting) {\n const dateInputFormatSetting = getSetting(\"DATE_INPUT_FORMAT\", \"\");\n if (dateInputFormatSetting) {\n return dateInputFormatSetting;\n }\n }\n\n let format = this.format;\n\n let dateFormat = this.hasTime\n ? format.replace(this.timeInputFormat, \"\").trim()\n : format;\n\n return dateFormat;\n }\n\n /**\n */\n get dateReadonlyFormat(): string {\n if (!this.hasDate) {\n return \"\";\n }\n\n let format = this.format;\n\n let dateFormat = this.hasTime\n ? format.replace(this.timeInputFormat, \"\").trim()\n : format;\n\n const readonlyFormatSetting = getSetting(\"DATE_READONLY_FORMAT\", \"\");\n\n if (dateFormat === PRODUCT_DEFAULT_DATE_FORMAT && readonlyFormatSetting) {\n dateFormat = readonlyFormatSetting;\n }\n\n return dateFormat;\n }\n\n /**\n * return attribute placeholder or, if DATE_INPUT_FORMAT setting is used, lowercased setting, otherwise return formatlabel without time input format from contributions\n */\n get placeholder(): string {\n if (this._placeholder !== \"\") {\n return this._placeholder;\n }\n\n const dateInputFormatSetting = getSetting(\"DATE_INPUT_FORMAT\", \"\");\n\n if (dateInputFormatSetting) {\n return dateInputFormatSetting.toLowerCase();\n }\n\n const formatLabel = this.getContribution(\"formatlabel\", \"\");\n\n if (this.hasDate && this.hasTime && formatLabel.includes(\" \")) {\n // return first part of formatlabel to keep placeholder matching date input\n return formatLabel.split(\" \")[0];\n }\n\n return formatLabel;\n }\n\n /**\n * Set placeholder text\n */\n set placeholder(placeholder: string) {\n this._placeholder = placeholder;\n }\n\n /**\n */\n get timeInputFormat(): string {\n if (!this.hasTime) {\n return \"\";\n }\n\n const format = this.format;\n\n let timeFormatParts = [];\n if (format.includes(\"H\")) {\n timeFormatParts.push(\"HH\");\n } else if (format.includes(\"h\")) {\n timeFormatParts.push(\"hh\");\n }\n if (format.includes(\"m\")) {\n timeFormatParts.push(\"mm\");\n }\n if (format.includes(\"s\")) {\n timeFormatParts.push(\"ss\");\n }\n\n let timeFormat = timeFormatParts.join(\":\");\n if (format.includes(\"S\")) {\n timeFormat = `${timeFormat}.SSS`;\n }\n if (format.includes(\"a\")) {\n return `${timeFormat} a`;\n }\n return timeFormat;\n }\n\n /**\n */\n get timeReadonlyFormat(): string {\n if (!this.hasTime) {\n return \"\";\n }\n\n return this.timeInputFormat;\n }\n\n /**\n */\n get dateInputValue(): string {\n return typeof this.value === \"string\" && this.dateInputFormat !== \"\"\n ? this.formatUtil.toFormat(this.value, this.dateInputFormat)\n : \"\";\n }\n\n /**\n */\n get timeInputValue(): string {\n return typeof this.value === \"string\" && this.timeInputFormat !== \"\"\n ? this.formatUtil.toFormat(this.value, this.timeInputFormat)\n : \"\";\n }\n\n // format value in readonly rendering\n /**\n */\n formatValue(value: ?string): string {\n if (value == null || value.toString() === \"\") {\n return \"\";\n }\n\n // when the value is exactly an iso date, render as date\n if (\n (this.type === \"datetime\" || this.type === \"timestamp\") &&\n DateUtil.hasFormat(value, ISO_DATE_FORMAT)\n ) {\n return DateUtil.toFormat(value, this.dateReadonlyFormat);\n }\n\n if (this.hasDate && this.hasTime) {\n const dateTimeReadonlyFormat = `${this.dateReadonlyFormat} ${this.timeReadonlyFormat}`;\n return this.formatUtil.toFormat(value, dateTimeReadonlyFormat);\n }\n\n if (this.type === \"date\") {\n return this.formatUtil.toFormat(value, this.dateReadonlyFormat);\n }\n\n return this.formatUtil.toFormat(value, this.format);\n }\n\n /**\n * Retrieve readonly value, the date in the configurated format\n */\n get readonlyvalue(): string {\n if (typeof this.value === \"string\") {\n return this.formatValue(this.value.toString());\n }\n\n return \"\";\n }\n\n /**\n * Get minimum date\n */\n get mindate(): string | null {\n return this.getContribution(\"mindate\");\n }\n\n /**\n * Get maximum date\n */\n get maxdate(): string | null {\n return this.getContribution(\"maxdate\");\n }\n\n /**\n * Registers an error that was received from a server response\n */\n addServerError(error: FormErrorAnchor) {\n const { id, message, properties } = error;\n if (properties && has(properties, \"format\") && this.formatLabel) {\n properties.format = this.formatLabel;\n }\n\n this._errorCollection.addServerError(id, message, properties);\n }\n\n /**\n */\n getFormatConstraint(): IConstraintModel {\n switch (this.type) {\n case \"date\":\n return new DateTimeDateFormatConstraint(\n this.dateInputFormat,\n this.formatLabel\n );\n case \"time\":\n return new DateTimeTimeFormatConstraint(\n this.timeInputFormat,\n this.formatLabel\n );\n default:\n return new DatetimeFormatConstraint(\n this.type,\n this.inputFormat,\n this.formatLabel\n );\n }\n }\n\n /**\n * Add Date constraints for attribute\n */\n addConstraints(): ConstraintCollection {\n const constraints = new ConstraintCollection();\n\n constraints.add(this.getFormatConstraint());\n\n if (this.mindate || this.maxdate) {\n constraints.add(\n new DateBoundaryConstraint(\n this.type,\n this.mindate,\n this.maxdate,\n this.inputFormat\n )\n );\n }\n\n return constraints;\n }\n\n /**\n */\n get readonlyWidth(): $Keys<typeof ATTRIBUTE_WIDTH> {\n if (this.type === \"date\" || this.type === \"time\") {\n return ATTRIBUTE_WIDTH.SMALL;\n }\n\n return ATTRIBUTE_WIDTH.MEDIUM;\n }\n}\n\nexport default DatetimeAttributeModel;\n"],"file":"DatetimeAttributeModel.js"}
|
|
@@ -95,6 +95,15 @@ var LayoutHintConfiguration = {
|
|
|
95
95
|
link: "",
|
|
96
96
|
component: ["attribute/number"]
|
|
97
97
|
},
|
|
98
|
+
IGNORE_FORMAT_SETTING: {
|
|
99
|
+
hint: "ignore-format-setting",
|
|
100
|
+
description: {
|
|
101
|
+
NL: "Maakt het mogelijk om de global date format setting te negeren voor een specifiek attribuut",
|
|
102
|
+
EN: "Makes it possible to ignore the global date format for a specific attribute"
|
|
103
|
+
},
|
|
104
|
+
link: "",
|
|
105
|
+
component: ["attribute/date", "attribute/datetime"]
|
|
106
|
+
},
|
|
98
107
|
CREATE_ACTION: {
|
|
99
108
|
hint: "create",
|
|
100
109
|
description: {
|
|
@@ -109,6 +109,15 @@ export const LayoutHintConfiguration = {
|
|
|
109
109
|
link: "",
|
|
110
110
|
component: ["attribute/number"],
|
|
111
111
|
},
|
|
112
|
+
IGNORE_FORMAT_SETTING: {
|
|
113
|
+
hint: "ignore-format-setting",
|
|
114
|
+
description: {
|
|
115
|
+
NL: "Maakt het mogelijk om de global date format setting te negeren voor een specifiek attribuut",
|
|
116
|
+
EN: "Makes it possible to ignore the global date format for a specific attribute",
|
|
117
|
+
},
|
|
118
|
+
link: "",
|
|
119
|
+
component: ["attribute/date", "attribute/datetime"],
|
|
120
|
+
},
|
|
112
121
|
CREATE_ACTION: {
|
|
113
122
|
hint: "create",
|
|
114
123
|
description: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/constants/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"],"mappings":";;;;;;AACO,IAAMA,uBAAuB,GAAG;AACrCC,EAAAA,SAAS,EAAE;AACTC,IAAAA,IAAI,EAAE,WADG;AAETC,IAAAA,WAAW,EAAE;AACXC,MAAAA,EAAE,EAAE,iGADO;AAEXC,MAAAA,EAAE,EAAE;AAFO,KAFJ;AAMTC,IAAAA,IAAI,EAAE,EANG;AAOTC,IAAAA,SAAS,EAAE,CAAC,WAAD;AAPF,GAD0B;AAUrCC,EAAAA,2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AAA,SAAS,EAAE,CAAC,WAAD;AAPH;AAtJ2B,CAAhC","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};\n"],"file":"LayoutHintConfig.js"}
|
|
1
|
+
{"version":3,"sources":["../../src/constants/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","IGNORE_FORMAT_SETTING","CREATE_ACTION","UPDATE_ACTION","DELETE_ACTION","SORT_OPTIONS","CASEVIEW_LINK","DISABLED"],"mappings":";;;;;;AACO,IAAMA,uBAAuB,GAAG;AACrCC,EAAAA,SAAS,EAAE;AACTC,IAAAA,IAAI,EAAE,WADG;AAETC,IAAAA,WAAW,EAAE;AACXC,MAAAA,EAAE,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Ce,EAAAA,aAAa,EAAE;AACbpB,IAAAA,IAAI,EAAE,gBADO;AAEbC,IAAAA,WAAW,EAAE;AACXC,MAAAA,EAAE,EAAE,uHADO;AAEXC,MAAAA,EAAE,EAAE;AAFO,KAFA;AAMbE,IAAAA,SAAS,EAAE,CAAC,qBAAD,EAAwB,sBAAxB;AANE,GAvJsB;AA+JrCgB,EAAAA,QAAQ,EAAE;AACRrB,IAAAA,IAAI,EAAE,UADE;AAERC,IAAAA,WAAW,EAAE;AACXC,MAAAA,EAAE,EAAE,8CADO;AAEXC,MAAAA,EAAE,EAAE;AAFO,KAFL;AAMRC,IAAAA,IAAI,EAAE,EANE;AAORC,IAAAA,SAAS,EAAE,CAAC,WAAD;AAPH;AA/J2B,CAAhC","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 IGNORE_FORMAT_SETTING: {\n hint: \"ignore-format-setting\",\n description: {\n NL: \"Maakt het mogelijk om de global date format setting te negeren voor een specifiek attribuut\",\n EN: \"Makes it possible to ignore the global date format for a specific attribute\",\n },\n link: \"\",\n component: [\"attribute/date\", \"attribute/datetime\"],\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};\n"],"file":"LayoutHintConfig.js"}
|
|
@@ -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.DISABLED = exports.DEPENDENT_ATTRIBUTE_CONTROL = exports.DEPENDENT_ATTRIBUTE = exports.DELETE_ACTION = exports.CREATE_ACTION = exports.CONFIRM_PASSWORD = exports.CASEVIEW_LINK = void 0;
|
|
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.IGNORE_FORMAT_SETTING = exports.HIDE_WHEN_EMPTY = exports.DISABLED = exports.DEPENDENT_ATTRIBUTE_CONTROL = exports.DEPENDENT_ATTRIBUTE = exports.DELETE_ACTION = exports.CREATE_ACTION = exports.CONFIRM_PASSWORD = exports.CASEVIEW_LINK = void 0;
|
|
7
7
|
|
|
8
8
|
var _LayoutHintConfig = require("./LayoutHintConfig");
|
|
9
9
|
|
|
@@ -71,6 +71,12 @@ var SORT_OPTIONS = getHint("SORT_OPTIONS");
|
|
|
71
71
|
|
|
72
72
|
exports.SORT_OPTIONS = SORT_OPTIONS;
|
|
73
73
|
var TITLE = getHint("TITLE");
|
|
74
|
+
/**
|
|
75
|
+
* Layout-hint: Ignore the global input format for specific attribute
|
|
76
|
+
*/
|
|
77
|
+
|
|
78
|
+
exports.TITLE = TITLE;
|
|
79
|
+
var IGNORE_FORMAT_SETTING = getHint("IGNORE_FORMAT_SETTING");
|
|
74
80
|
/*
|
|
75
81
|
* --------------------------------
|
|
76
82
|
* FORM
|
|
@@ -81,7 +87,7 @@ var TITLE = getHint("TITLE");
|
|
|
81
87
|
* Layout-hint: Mark task as delete task
|
|
82
88
|
*/
|
|
83
89
|
|
|
84
|
-
exports.
|
|
90
|
+
exports.IGNORE_FORMAT_SETTING = IGNORE_FORMAT_SETTING;
|
|
85
91
|
var DELETE_ACTION = getHint("DELETE_ACTION");
|
|
86
92
|
/**
|
|
87
93
|
* Layout-hint: Mark task as update task
|
|
@@ -53,6 +53,10 @@ export const SORT_OPTIONS: string = getHint("SORT_OPTIONS");
|
|
|
53
53
|
* Layout-hint: Marks an attribute as a title attribute
|
|
54
54
|
*/
|
|
55
55
|
export const TITLE: string = getHint("TITLE");
|
|
56
|
+
/**
|
|
57
|
+
* Layout-hint: Ignore the global input format for specific attribute
|
|
58
|
+
*/
|
|
59
|
+
export const IGNORE_FORMAT_SETTING: string = getHint("IGNORE_FORMAT_SETTING");
|
|
56
60
|
|
|
57
61
|
/*
|
|
58
62
|
* --------------------------------
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/constants/LayoutHints.js"],"names":["getHint","hint","LayoutHintConfiguration","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","getLayoutHintConfiguration"],"mappings":";;;;;;;AACA;;AAEA;AACA;AACA;AACA,IAAMA,OAAO,GAAG,SAAVA,OAAU,CAACC,IAAD,EAA0B;AACxC,MAAIC,0CAAwBD,IAAxB,CAAJ,EAAmC;AACjC,WAAOC,0CAAwBD,IAAxB,EAA8BA,IAArC;AACD;;AAED,SAAO,EAAP;AACD,CAND;AAQA;AACA;AACA;;;AACO,IAAME,SAAiB,GAAGH,OAAO,CAAC,WAAD,CAAjC;AAEP;AACA;AACA;AACA;;;AACO,IAAMI,QAAgB,GAAGJ,OAAO,CAAC,UAAD,CAAhC;AAEP;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;;;AACO,IAAMK,2BAA2B,GAAG,mBAApC;AACP;AACA;;;AACO,IAAMC,mBAAmB,GAAG,sBAA5B;AAEP;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;;;AACO,IAAMC,gBAAwB,GAAGP,OAAO,CAAC,kBAAD,CAAxC;AACP;AACA;AACA;;;AACO,IAAMQ,YAAoB,GAAGR,OAAO,CAAC,cAAD,CAApC;AACP;AACA;AACA;;;AACO,IAAMS,KAAa,GAAGT,OAAO,CAAC,OAAD,CAA7B;AAEP;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;;;AACO,
|
|
1
|
+
{"version":3,"sources":["../../src/constants/LayoutHints.js"],"names":["getHint","hint","LayoutHintConfiguration","MANDATORY","DISABLED","DEPENDENT_ATTRIBUTE_CONTROL","DEPENDENT_ATTRIBUTE","CONFIRM_PASSWORD","SORT_OPTIONS","TITLE","IGNORE_FORMAT_SETTING","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","getLayoutHintConfiguration"],"mappings":";;;;;;;AACA;;AAEA;AACA;AACA;AACA,IAAMA,OAAO,GAAG,SAAVA,OAAU,CAACC,IAAD,EAA0B;AACxC,MAAIC,0CAAwBD,IAAxB,CAAJ,EAAmC;AACjC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;AACO,IAAMkB,cAAsB,GAAG,iBAA/B;AACP;AACA;AACA;;;AACO,IAAMC,aAAqB,GAAGnB,OAAO,CAAC,eAAD,CAArC;AAEP;AACA;AACA;;;AACO,IAAMoB,oBAAoB,GAAG,sBAA7B;AAEP;AACA;;;;AACO,IAAMC,0BAA0B,GAAG,SAA7BA,0BAA6B;AAAA,SAAcnB,yCAAd;AAAA,CAAnC;;;eAEQF,O","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 * Layout-hint: Ignore the global input format for specific attribute\n */\nexport const IGNORE_FORMAT_SETTING: string = getHint(\"IGNORE_FORMAT_SETTING\");\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 */\nexport const getLayoutHintConfiguration = (): Object => LayoutHintConfiguration;\n\nexport default getHint;\n"],"file":"LayoutHints.js"}
|
|
@@ -304,10 +304,14 @@ var DatetimeAttributeModel = /*#__PURE__*/function (_StringAttributeModel) {
|
|
|
304
304
|
} // setting for date input
|
|
305
305
|
|
|
306
306
|
|
|
307
|
-
var
|
|
307
|
+
var ignoreDateInputFormatSetting = (0, _Settings.getSetting)("IGNORE_FORMAT_SETTING", false);
|
|
308
308
|
|
|
309
|
-
if (
|
|
310
|
-
|
|
309
|
+
if (!ignoreDateInputFormatSetting) {
|
|
310
|
+
var dateInputFormatSetting = (0, _Settings.getSetting)("DATE_INPUT_FORMAT", "");
|
|
311
|
+
|
|
312
|
+
if (dateInputFormatSetting) {
|
|
313
|
+
return dateInputFormatSetting;
|
|
314
|
+
}
|
|
311
315
|
}
|
|
312
316
|
|
|
313
317
|
var format = this.format;
|
|
@@ -239,10 +239,15 @@ class DatetimeAttributeModel extends StringAttributeModel {
|
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
// setting for date input
|
|
242
|
-
const
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
242
|
+
const ignoreDateInputFormatSetting = getSetting(
|
|
243
|
+
"IGNORE_FORMAT_SETTING",
|
|
244
|
+
false
|
|
245
|
+
);
|
|
246
|
+
if (!ignoreDateInputFormatSetting) {
|
|
247
|
+
const dateInputFormatSetting = getSetting("DATE_INPUT_FORMAT", "");
|
|
248
|
+
if (dateInputFormatSetting) {
|
|
249
|
+
return dateInputFormatSetting;
|
|
250
|
+
}
|
|
246
251
|
}
|
|
247
252
|
|
|
248
253
|
let format = this.format;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/models/attributes/DatetimeAttributeModel.js"],"names":["PRODUCT_DEFAULT_DATE_FORMAT","DatetimeAttributeModel","attribute","attributeContributions","updateInitValue","type","TimeUtil","TimestampUtil","DateTimeUtil","DateUtil","value","data","length","split","hasTime","getTimeValue","timeValue","timeInputFormat","toLowerCase","formatUtil","setHour","setMinute","setSecond","setMilliseconds","getInitValue","_initvalue","_inputvalue","getInitialInputValue","_value","initValue","toFormat","inputFormat","getContribution","toString","getInputValue","validate","toISO","format","convertFormat","dateInputFormat","hasDate","dateInputFormatSetting","dateFormat","replace","readonlyFormatSetting","_placeholder","formatLabel","placeholder","timeFormatParts","push","timeFormat","join","hasFormat","ISO_DATE_FORMAT","dateReadonlyFormat","dateTimeReadonlyFormat","timeReadonlyFormat","formatValue","error","id","message","properties","_errorCollection","addServerError","DateTimeDateFormatConstraint","DateTimeTimeFormatConstraint","DatetimeFormatConstraint","constraints","ConstraintCollection","add","getFormatConstraint","mindate","maxdate","DateBoundaryConstraint","ATTRIBUTE_WIDTH","SMALL","MEDIUM","contributions","StringAttributeModel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AAEA;;AAOA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;AAIA;AACA,IAAMA,2BAA2B,GAAG,YAApC;AAEA;AACA;;IACMC,sB;;;;;AACJ;AACF;AACE,kCAAYC,SAAZ,EAA+BC,sBAA/B,EAA+D;AAAA;;AAAA;AAC7D,8BAAMD,SAAN,EAAiBC,sBAAjB;;AAEA,UAAKC,eAAL;;AAH6D;AAI9D;AAED;AACF;;;;;;AAOE;AACF;AACE,mBAIoB;AAClB,cAAQ,KAAKC,IAAb;AACE,aAAK,MAAL;AACE,iBAAOC,sBAAP;;AACF,aAAK,WAAL;AACE,iBAAOC,2BAAP;;AACF,aAAK,UAAL;AACE,iBAAOC,0BAAP;;AACF;AACE,iBAAOC,sBAAP;AARJ;AAUD;AAED;AACF;;;;WACE,wBAA8B;AAC5B,UAAIC,KAAK,GAAG,KAAKC,IAAL,CAAUD,KAAtB;;AACA,UAAIA,KAAK,IAAI,IAAb,EAAmB;AACjB,YAAI,KAAKL,IAAL,KAAc,MAAd,IAAwBK,KAAK,CAACE,MAAN,KAAiB,CAA7C,EAAgD;AAC9CF,UAAAA,KAAK,aAAMA,KAAN,QAAL;AACD,SAHgB,CAKjB;;;AACA,YAAI,KAAKL,IAAL,KAAc,UAAd,IAA4B,uBAAAK,KAAK,MAAL,CAAAA,KAAK,EAAU,GAAV,CAAr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;;;;SACE,eAAmD;AACjD,UAAI,KAAK9D,IAAL,KAAc,MAAd,IAAwB,KAAKA,IAAL,KAAc,MAA1C,EAAkD;AAChD,eAAOqE,2BAAgBC,KAAvB;AACD;;AAED,aAAOD,2BAAgBE,MAAvB;AACD;;;WA9bD,2BAAyBC,aAAzB,EAAyD;AAAA;;AACvD,aAAO,qCAAC,MAAD,EAAS,MAAT,EAAiB,UAAjB,EAA6B,WAA7B,oBACLA,aAAa,CAACxE,IADT,CAAP;AAGD;;;EAfkCyE,8B;;eA4ctB7E,sB","sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport {\n DateUtil,\n DateTimeUtil,\n TimeUtil,\n TimestampUtil,\n} from \"../../utils/datetime/DateTimeUtil\";\n\nimport StringAttributeModel from \"./StringAttributeModel\";\n\nimport ConstraintCollection from \"./input-constraints/ConstraintCollection\";\nimport DateTimeDateFormatConstraint from \"./input-constraints/DateTimeDateFormatConstraint\";\nimport DateTimeTimeFormatConstraint from \"./input-constraints/DateTimeTimeFormatConstraint\";\nimport DatetimeFormatConstraint from \"./input-constraints/DatetimeFormatConstraint\";\nimport DateBoundaryConstraint from \"./input-constraints/DateBoundaryConstraint\";\n\nimport { ATTRIBUTE_WIDTH, ISO_DATE_FORMAT } from \"../../constants\";\nimport { getSetting } from \"../../constants/Settings\";\n\nimport type { FormErrorAnchor, IConstraintModel } from \"../types\";\n\n// date format of default\nconst PRODUCT_DEFAULT_DATE_FORMAT = \"dd-MM-yyyy\";\n\n/**\n */\nclass DatetimeAttributeModel extends StringAttributeModel {\n /**\n */\n constructor(attribute: Object, attributeContributions: Object) {\n super(attribute, attributeContributions);\n\n this.updateInitValue();\n }\n\n /**\n */\n static isApplicableModel(contributions: Object): boolean {\n return [\"date\", \"time\", \"datetime\", \"timestamp\"].includes(\n contributions.type\n );\n }\n\n /**\n */\n get formatUtil():\n | typeof TimeUtil\n | typeof TimestampUtil\n | typeof DateTimeUtil\n | typeof DateUtil {\n switch (this.type) {\n case \"time\":\n return TimeUtil;\n case \"timestamp\":\n return TimestampUtil;\n case \"datetime\":\n return DateTimeUtil;\n default:\n return DateUtil;\n }\n }\n\n /**\n */\n getInitValue(): string | null {\n let value = this.data.value;\n if (value != null) {\n if (this.type === \"time\" && value.length === 5) {\n value = `${value}:00`;\n }\n\n // handle old datetime values, which contained ms\n if (this.type === \"datetime\" && value.includes(\".\")) {\n value = value.split(\".\")[0];\n }\n\n if (this.hasTime) {\n value = this.getTimeValue(value);\n }\n }\n\n return value;\n }\n\n /**\n */\n getTimeValue(value: string): string {\n let timeValue = value;\n if (!this.timeInputFormat.toLowerCase().includes(\"h\")) {\n timeValue = this.formatUtil.setHour(value, 0);\n }\n if (!this.timeInputFormat.includes(\"m\")) {\n timeValue = this.formatUtil.setMinute(value, 0);\n }\n if (!this.timeInputFormat.includes(\"s\")) {\n timeValue = this.formatUtil.setSecond(value, 0);\n }\n if (this.type === \"timestamp\" && !this.timeInputFormat.includes(\"S\")) {\n timeValue = this.formatUtil.setMilliseconds(value, 0);\n }\n return timeValue;\n }\n\n /**\n * Set time in the correct value based on available elements in the time format\n */\n updateInitValue() {\n const value = this.getInitValue();\n if (value != null) {\n this._initvalue = value;\n this._inputvalue = this.getInitialInputValue(value);\n this._value = value;\n }\n }\n\n /**\n * Get initial user input value\n */\n getInitialInputValue(value?: string): string {\n if (!value) {\n return \"\";\n }\n\n let initValue = value;\n if (this.type === \"time\" && value.length === 5) {\n initValue = `${value}:00`;\n }\n\n return this.formatUtil.toFormat(initValue, this.inputFormat);\n }\n\n /**\n * Set type to date\n */\n get type(): string {\n return this.getContribution(\"type\", \"date\");\n }\n\n /**\n * Returns the value as entered by the user. This can differ from the internal iso value that is stored\n */\n getInputValue(): string {\n return this._inputvalue ? this._inputvalue.toString() : \"\";\n }\n\n /**\n * Get input value\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.validate(value);\n\n this._inputvalue = value;\n\n this.value =\n value !== null && value !== \"\"\n ? this.formatUtil.toISO(value, this.inputFormat)\n : null;\n }\n\n /**\n * Get date format\n */\n get format(): string {\n const format = this.getContribution(\"format\", \"\");\n return this.formatUtil.convertFormat(format);\n }\n\n /**\n */\n get operator(): string {\n return this.getContribution(\"operator\", \"\");\n }\n\n /**\n */\n get hasDate(): boolean {\n return (\n this.type === \"date\" ||\n this.type === \"datetime\" ||\n this.type === \"timestamp\"\n );\n }\n\n /**\n */\n get hasTime(): boolean {\n return (\n this.type === \"time\" ||\n this.type === \"datetime\" ||\n this.type === \"timestamp\"\n );\n }\n\n /**\n */\n get formatLabel(): string {\n switch (this.type) {\n case \"date\":\n return this.dateInputFormat.toLowerCase();\n case \"time\":\n return this.timeInputFormat.toLowerCase();\n default:\n return this.format.toLowerCase();\n }\n }\n\n /**\n */\n get inputFormat(): string {\n if (this.hasDate && this.hasTime) {\n return `${this.dateInputFormat} ${this.timeInputFormat}`.trim();\n }\n\n if (this.hasDate) {\n return this.dateInputFormat;\n }\n\n if (this.hasTime) {\n return this.timeInputFormat;\n }\n\n return \"\";\n }\n\n /**\n */\n get dateInputFormat(): string {\n if (!this.hasDate) {\n return \"\";\n }\n\n // setting for date input\n const dateInputFormatSetting = getSetting(\"DATE_INPUT_FORMAT\", \"\");\n\n if (dateInputFormatSetting) {\n return dateInputFormatSetting;\n }\n\n let format = this.format;\n\n let dateFormat = this.hasTime\n ? format.replace(this.timeInputFormat, \"\").trim()\n : format;\n\n return dateFormat;\n }\n\n /**\n */\n get dateReadonlyFormat(): string {\n if (!this.hasDate) {\n return \"\";\n }\n\n let format = this.format;\n\n let dateFormat = this.hasTime\n ? format.replace(this.timeInputFormat, \"\").trim()\n : format;\n\n const readonlyFormatSetting = getSetting(\"DATE_READONLY_FORMAT\", \"\");\n\n if (dateFormat === PRODUCT_DEFAULT_DATE_FORMAT && readonlyFormatSetting) {\n dateFormat = readonlyFormatSetting;\n }\n\n return dateFormat;\n }\n\n /**\n * return attribute placeholder or, if DATE_INPUT_FORMAT setting is used, lowercased setting, otherwise return formatlabel without time input format from contributions\n */\n get placeholder(): string {\n if (this._placeholder !== \"\") {\n return this._placeholder;\n }\n\n const dateInputFormatSetting = getSetting(\"DATE_INPUT_FORMAT\", \"\");\n\n if (dateInputFormatSetting) {\n return dateInputFormatSetting.toLowerCase();\n }\n\n const formatLabel = this.getContribution(\"formatlabel\", \"\");\n\n if (this.hasDate && this.hasTime && formatLabel.includes(\" \")) {\n // return first part of formatlabel to keep placeholder matching date input\n return formatLabel.split(\" \")[0];\n }\n\n return formatLabel;\n }\n\n /**\n * Set placeholder text\n */\n set placeholder(placeholder: string) {\n this._placeholder = placeholder;\n }\n\n /**\n */\n get timeInputFormat(): string {\n if (!this.hasTime) {\n return \"\";\n }\n\n const format = this.format;\n\n let timeFormatParts = [];\n if (format.includes(\"H\")) {\n timeFormatParts.push(\"HH\");\n } else if (format.includes(\"h\")) {\n timeFormatParts.push(\"hh\");\n }\n if (format.includes(\"m\")) {\n timeFormatParts.push(\"mm\");\n }\n if (format.includes(\"s\")) {\n timeFormatParts.push(\"ss\");\n }\n\n let timeFormat = timeFormatParts.join(\":\");\n if (format.includes(\"S\")) {\n timeFormat = `${timeFormat}.SSS`;\n }\n if (format.includes(\"a\")) {\n return `${timeFormat} a`;\n }\n return timeFormat;\n }\n\n /**\n */\n get timeReadonlyFormat(): string {\n if (!this.hasTime) {\n return \"\";\n }\n\n return this.timeInputFormat;\n }\n\n /**\n */\n get dateInputValue(): string {\n return typeof this.value === \"string\" && this.dateInputFormat !== \"\"\n ? this.formatUtil.toFormat(this.value, this.dateInputFormat)\n : \"\";\n }\n\n /**\n */\n get timeInputValue(): string {\n return typeof this.value === \"string\" && this.timeInputFormat !== \"\"\n ? this.formatUtil.toFormat(this.value, this.timeInputFormat)\n : \"\";\n }\n\n // format value in readonly rendering\n /**\n */\n formatValue(value: ?string): string {\n if (value == null || value.toString() === \"\") {\n return \"\";\n }\n\n // when the value is exactly an iso date, render as date\n if (\n (this.type === \"datetime\" || this.type === \"timestamp\") &&\n DateUtil.hasFormat(value, ISO_DATE_FORMAT)\n ) {\n return DateUtil.toFormat(value, this.dateReadonlyFormat);\n }\n\n if (this.hasDate && this.hasTime) {\n const dateTimeReadonlyFormat = `${this.dateReadonlyFormat} ${this.timeReadonlyFormat}`;\n return this.formatUtil.toFormat(value, dateTimeReadonlyFormat);\n }\n\n if (this.type === \"date\") {\n return this.formatUtil.toFormat(value, this.dateReadonlyFormat);\n }\n\n return this.formatUtil.toFormat(value, this.format);\n }\n\n /**\n * Retrieve readonly value, the date in the configurated format\n */\n get readonlyvalue(): string {\n if (typeof this.value === \"string\") {\n return this.formatValue(this.value.toString());\n }\n\n return \"\";\n }\n\n /**\n * Get minimum date\n */\n get mindate(): string | null {\n return this.getContribution(\"mindate\");\n }\n\n /**\n * Get maximum date\n */\n get maxdate(): string | null {\n return this.getContribution(\"maxdate\");\n }\n\n /**\n * Registers an error that was received from a server response\n */\n addServerError(error: FormErrorAnchor) {\n const { id, message, properties } = error;\n if (properties && has(properties, \"format\") && this.formatLabel) {\n properties.format = this.formatLabel;\n }\n\n this._errorCollection.addServerError(id, message, properties);\n }\n\n /**\n */\n getFormatConstraint(): IConstraintModel {\n switch (this.type) {\n case \"date\":\n return new DateTimeDateFormatConstraint(\n this.dateInputFormat,\n this.formatLabel\n );\n case \"time\":\n return new DateTimeTimeFormatConstraint(\n this.timeInputFormat,\n this.formatLabel\n );\n default:\n return new DatetimeFormatConstraint(\n this.type,\n this.inputFormat,\n this.formatLabel\n );\n }\n }\n\n /**\n * Add Date constraints for attribute\n */\n addConstraints(): ConstraintCollection {\n const constraints = new ConstraintCollection();\n\n constraints.add(this.getFormatConstraint());\n\n if (this.mindate || this.maxdate) {\n constraints.add(\n new DateBoundaryConstraint(\n this.type,\n this.mindate,\n this.maxdate,\n this.inputFormat\n )\n );\n }\n\n return constraints;\n }\n\n /**\n */\n get readonlyWidth(): $Keys<typeof ATTRIBUTE_WIDTH> {\n if (this.type === \"date\" || this.type === \"time\") {\n return ATTRIBUTE_WIDTH.SMALL;\n }\n\n return ATTRIBUTE_WIDTH.MEDIUM;\n }\n}\n\nexport default DatetimeAttributeModel;\n"],"file":"DatetimeAttributeModel.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/models/attributes/DatetimeAttributeModel.js"],"names":["PRODUCT_DEFAULT_DATE_FORMAT","DatetimeAttributeModel","attribute","attributeContributions","updateInitValue","type","TimeUtil","TimestampUtil","DateTimeUtil","DateUtil","value","data","length","split","hasTime","getTimeValue","timeValue","timeInputFormat","toLowerCase","formatUtil","setHour","setMinute","setSecond","setMilliseconds","getInitValue","_initvalue","_inputvalue","getInitialInputValue","_value","initValue","toFormat","inputFormat","getContribution","toString","getInputValue","validate","toISO","format","convertFormat","dateInputFormat","hasDate","ignoreDateInputFormatSetting","dateInputFormatSetting","dateFormat","replace","readonlyFormatSetting","_placeholder","formatLabel","placeholder","timeFormatParts","push","timeFormat","join","hasFormat","ISO_DATE_FORMAT","dateReadonlyFormat","dateTimeReadonlyFormat","timeReadonlyFormat","formatValue","error","id","message","properties","_errorCollection","addServerError","DateTimeDateFormatConstraint","DateTimeTimeFormatConstraint","DatetimeFormatConstraint","constraints","ConstraintCollection","add","getFormatConstraint","mindate","maxdate","DateBoundaryConstraint","ATTRIBUTE_WIDTH","SMALL","MEDIUM","contributions","StringAttributeModel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AAEA;;AAOA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;AAIA;AACA,IAAMA,2BAA2B,GAAG,YAApC;AAEA;AACA;;IACMC,sB;;;;;AACJ;AACF;AACE,kCAAYC,SAAZ,EAA+BC,sBAA/B,EAA+D;AAAA;;AAAA;AAC7D,8BAAMD,SAAN,EAAiBC,sBAAjB;;AAEA,UAAKC,eAAL;;AAH6D;AAI9D;AAED;AACF;;;;;;AAOE;AACF;AACE,mBAIoB;AAClB,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,qCAAJ,CACL,KAAK1B,eADA,EAEL,KAAKQ,WAFA,CAAP;;AAIF,aAAK,MAAL;AACE,iBAAO,IAAImB,qCAAJ,CACL,KAAKjD,eADA,EAEL,KAAK8B,WAFA,CAAP;;AAIF;AACE,iBAAO,IAAIoB,iCAAJ,CACL,KAAK9D,IADA,EAEL,KAAK0B,WAFA,EAGL,KAAKgB,WAHA,CAAP;AAZJ;AAkBD;AAED;AACF;AACA;;;;WACE,0BAAuC;AACrC,UAAMqB,WAAW,GAAG,IAAIC,6BAAJ,EAApB;AAEAD,MAAAA,WAAW,CAACE,GAAZ,CAAgB,KAAKC,mBAAL,EAAhB;;AAEA,UAAI,KAAKC,OAAL,IAAgB,KAAKC,OAAzB,EAAkC;AAChCL,QAAAA,WAAW,CAACE,GAAZ,CACE,IAAII,+BAAJ,CACE,KAAKrE,IADP,EAEE,KAAKmE,OAFP,EAGE,KAAKC,OAHP,EAIE,KAAK1C,WAJP,CADF;AAQD;;AAED,aAAOqC,WAAP;AACD;AAED;AACF;;;;SACE,eAAmD;AACjD,UAAI,KAAK/D,IAAL,KAAc,MAAd,IAAwB,KAAKA,IAAL,KAAc,MAA1C,EAAkD;AAChD,eAAOsE,2BAAgBC,KAAvB;AACD;;AAED,aAAOD,2BAAgBE,MAAvB;AACD;;;WAncD,2BAAyBC,aAAzB,EAAyD;AAAA;;AACvD,aAAO,qCAAC,MAAD,EAAS,MAAT,EAAiB,UAAjB,EAA6B,WAA7B,oBACLA,aAAa,CAACzE,IADT,CAAP;AAGD;;;EAfkC0E,8B;;eAidtB9E,sB","sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport {\n DateUtil,\n DateTimeUtil,\n TimeUtil,\n TimestampUtil,\n} from \"../../utils/datetime/DateTimeUtil\";\n\nimport StringAttributeModel from \"./StringAttributeModel\";\n\nimport ConstraintCollection from \"./input-constraints/ConstraintCollection\";\nimport DateTimeDateFormatConstraint from \"./input-constraints/DateTimeDateFormatConstraint\";\nimport DateTimeTimeFormatConstraint from \"./input-constraints/DateTimeTimeFormatConstraint\";\nimport DatetimeFormatConstraint from \"./input-constraints/DatetimeFormatConstraint\";\nimport DateBoundaryConstraint from \"./input-constraints/DateBoundaryConstraint\";\n\nimport { ATTRIBUTE_WIDTH, ISO_DATE_FORMAT } from \"../../constants\";\nimport { getSetting } from \"../../constants/Settings\";\n\nimport type { FormErrorAnchor, IConstraintModel } from \"../types\";\n\n// date format of default\nconst PRODUCT_DEFAULT_DATE_FORMAT = \"dd-MM-yyyy\";\n\n/**\n */\nclass DatetimeAttributeModel extends StringAttributeModel {\n /**\n */\n constructor(attribute: Object, attributeContributions: Object) {\n super(attribute, attributeContributions);\n\n this.updateInitValue();\n }\n\n /**\n */\n static isApplicableModel(contributions: Object): boolean {\n return [\"date\", \"time\", \"datetime\", \"timestamp\"].includes(\n contributions.type\n );\n }\n\n /**\n */\n get formatUtil():\n | typeof TimeUtil\n | typeof TimestampUtil\n | typeof DateTimeUtil\n | typeof DateUtil {\n switch (this.type) {\n case \"time\":\n return TimeUtil;\n case \"timestamp\":\n return TimestampUtil;\n case \"datetime\":\n return DateTimeUtil;\n default:\n return DateUtil;\n }\n }\n\n /**\n */\n getInitValue(): string | null {\n let value = this.data.value;\n if (value != null) {\n if (this.type === \"time\" && value.length === 5) {\n value = `${value}:00`;\n }\n\n // handle old datetime values, which contained ms\n if (this.type === \"datetime\" && value.includes(\".\")) {\n value = value.split(\".\")[0];\n }\n\n if (this.hasTime) {\n value = this.getTimeValue(value);\n }\n }\n\n return value;\n }\n\n /**\n */\n getTimeValue(value: string): string {\n let timeValue = value;\n if (!this.timeInputFormat.toLowerCase().includes(\"h\")) {\n timeValue = this.formatUtil.setHour(value, 0);\n }\n if (!this.timeInputFormat.includes(\"m\")) {\n timeValue = this.formatUtil.setMinute(value, 0);\n }\n if (!this.timeInputFormat.includes(\"s\")) {\n timeValue = this.formatUtil.setSecond(value, 0);\n }\n if (this.type === \"timestamp\" && !this.timeInputFormat.includes(\"S\")) {\n timeValue = this.formatUtil.setMilliseconds(value, 0);\n }\n return timeValue;\n }\n\n /**\n * Set time in the correct value based on available elements in the time format\n */\n updateInitValue() {\n const value = this.getInitValue();\n if (value != null) {\n this._initvalue = value;\n this._inputvalue = this.getInitialInputValue(value);\n this._value = value;\n }\n }\n\n /**\n * Get initial user input value\n */\n getInitialInputValue(value?: string): string {\n if (!value) {\n return \"\";\n }\n\n let initValue = value;\n if (this.type === \"time\" && value.length === 5) {\n initValue = `${value}:00`;\n }\n\n return this.formatUtil.toFormat(initValue, this.inputFormat);\n }\n\n /**\n * Set type to date\n */\n get type(): string {\n return this.getContribution(\"type\", \"date\");\n }\n\n /**\n * Returns the value as entered by the user. This can differ from the internal iso value that is stored\n */\n getInputValue(): string {\n return this._inputvalue ? this._inputvalue.toString() : \"\";\n }\n\n /**\n * Get input value\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.validate(value);\n\n this._inputvalue = value;\n\n this.value =\n value !== null && value !== \"\"\n ? this.formatUtil.toISO(value, this.inputFormat)\n : null;\n }\n\n /**\n * Get date format\n */\n get format(): string {\n const format = this.getContribution(\"format\", \"\");\n return this.formatUtil.convertFormat(format);\n }\n\n /**\n */\n get operator(): string {\n return this.getContribution(\"operator\", \"\");\n }\n\n /**\n */\n get hasDate(): boolean {\n return (\n this.type === \"date\" ||\n this.type === \"datetime\" ||\n this.type === \"timestamp\"\n );\n }\n\n /**\n */\n get hasTime(): boolean {\n return (\n this.type === \"time\" ||\n this.type === \"datetime\" ||\n this.type === \"timestamp\"\n );\n }\n\n /**\n */\n get formatLabel(): string {\n switch (this.type) {\n case \"date\":\n return this.dateInputFormat.toLowerCase();\n case \"time\":\n return this.timeInputFormat.toLowerCase();\n default:\n return this.format.toLowerCase();\n }\n }\n\n /**\n */\n get inputFormat(): string {\n if (this.hasDate && this.hasTime) {\n return `${this.dateInputFormat} ${this.timeInputFormat}`.trim();\n }\n\n if (this.hasDate) {\n return this.dateInputFormat;\n }\n\n if (this.hasTime) {\n return this.timeInputFormat;\n }\n\n return \"\";\n }\n\n /**\n */\n get dateInputFormat(): string {\n if (!this.hasDate) {\n return \"\";\n }\n\n // setting for date input\n const ignoreDateInputFormatSetting = getSetting(\n \"IGNORE_FORMAT_SETTING\",\n false\n );\n if (!ignoreDateInputFormatSetting) {\n const dateInputFormatSetting = getSetting(\"DATE_INPUT_FORMAT\", \"\");\n if (dateInputFormatSetting) {\n return dateInputFormatSetting;\n }\n }\n\n let format = this.format;\n\n let dateFormat = this.hasTime\n ? format.replace(this.timeInputFormat, \"\").trim()\n : format;\n\n return dateFormat;\n }\n\n /**\n */\n get dateReadonlyFormat(): string {\n if (!this.hasDate) {\n return \"\";\n }\n\n let format = this.format;\n\n let dateFormat = this.hasTime\n ? format.replace(this.timeInputFormat, \"\").trim()\n : format;\n\n const readonlyFormatSetting = getSetting(\"DATE_READONLY_FORMAT\", \"\");\n\n if (dateFormat === PRODUCT_DEFAULT_DATE_FORMAT && readonlyFormatSetting) {\n dateFormat = readonlyFormatSetting;\n }\n\n return dateFormat;\n }\n\n /**\n * return attribute placeholder or, if DATE_INPUT_FORMAT setting is used, lowercased setting, otherwise return formatlabel without time input format from contributions\n */\n get placeholder(): string {\n if (this._placeholder !== \"\") {\n return this._placeholder;\n }\n\n const dateInputFormatSetting = getSetting(\"DATE_INPUT_FORMAT\", \"\");\n\n if (dateInputFormatSetting) {\n return dateInputFormatSetting.toLowerCase();\n }\n\n const formatLabel = this.getContribution(\"formatlabel\", \"\");\n\n if (this.hasDate && this.hasTime && formatLabel.includes(\" \")) {\n // return first part of formatlabel to keep placeholder matching date input\n return formatLabel.split(\" \")[0];\n }\n\n return formatLabel;\n }\n\n /**\n * Set placeholder text\n */\n set placeholder(placeholder: string) {\n this._placeholder = placeholder;\n }\n\n /**\n */\n get timeInputFormat(): string {\n if (!this.hasTime) {\n return \"\";\n }\n\n const format = this.format;\n\n let timeFormatParts = [];\n if (format.includes(\"H\")) {\n timeFormatParts.push(\"HH\");\n } else if (format.includes(\"h\")) {\n timeFormatParts.push(\"hh\");\n }\n if (format.includes(\"m\")) {\n timeFormatParts.push(\"mm\");\n }\n if (format.includes(\"s\")) {\n timeFormatParts.push(\"ss\");\n }\n\n let timeFormat = timeFormatParts.join(\":\");\n if (format.includes(\"S\")) {\n timeFormat = `${timeFormat}.SSS`;\n }\n if (format.includes(\"a\")) {\n return `${timeFormat} a`;\n }\n return timeFormat;\n }\n\n /**\n */\n get timeReadonlyFormat(): string {\n if (!this.hasTime) {\n return \"\";\n }\n\n return this.timeInputFormat;\n }\n\n /**\n */\n get dateInputValue(): string {\n return typeof this.value === \"string\" && this.dateInputFormat !== \"\"\n ? this.formatUtil.toFormat(this.value, this.dateInputFormat)\n : \"\";\n }\n\n /**\n */\n get timeInputValue(): string {\n return typeof this.value === \"string\" && this.timeInputFormat !== \"\"\n ? this.formatUtil.toFormat(this.value, this.timeInputFormat)\n : \"\";\n }\n\n // format value in readonly rendering\n /**\n */\n formatValue(value: ?string): string {\n if (value == null || value.toString() === \"\") {\n return \"\";\n }\n\n // when the value is exactly an iso date, render as date\n if (\n (this.type === \"datetime\" || this.type === \"timestamp\") &&\n DateUtil.hasFormat(value, ISO_DATE_FORMAT)\n ) {\n return DateUtil.toFormat(value, this.dateReadonlyFormat);\n }\n\n if (this.hasDate && this.hasTime) {\n const dateTimeReadonlyFormat = `${this.dateReadonlyFormat} ${this.timeReadonlyFormat}`;\n return this.formatUtil.toFormat(value, dateTimeReadonlyFormat);\n }\n\n if (this.type === \"date\") {\n return this.formatUtil.toFormat(value, this.dateReadonlyFormat);\n }\n\n return this.formatUtil.toFormat(value, this.format);\n }\n\n /**\n * Retrieve readonly value, the date in the configurated format\n */\n get readonlyvalue(): string {\n if (typeof this.value === \"string\") {\n return this.formatValue(this.value.toString());\n }\n\n return \"\";\n }\n\n /**\n * Get minimum date\n */\n get mindate(): string | null {\n return this.getContribution(\"mindate\");\n }\n\n /**\n * Get maximum date\n */\n get maxdate(): string | null {\n return this.getContribution(\"maxdate\");\n }\n\n /**\n * Registers an error that was received from a server response\n */\n addServerError(error: FormErrorAnchor) {\n const { id, message, properties } = error;\n if (properties && has(properties, \"format\") && this.formatLabel) {\n properties.format = this.formatLabel;\n }\n\n this._errorCollection.addServerError(id, message, properties);\n }\n\n /**\n */\n getFormatConstraint(): IConstraintModel {\n switch (this.type) {\n case \"date\":\n return new DateTimeDateFormatConstraint(\n this.dateInputFormat,\n this.formatLabel\n );\n case \"time\":\n return new DateTimeTimeFormatConstraint(\n this.timeInputFormat,\n this.formatLabel\n );\n default:\n return new DatetimeFormatConstraint(\n this.type,\n this.inputFormat,\n this.formatLabel\n );\n }\n }\n\n /**\n * Add Date constraints for attribute\n */\n addConstraints(): ConstraintCollection {\n const constraints = new ConstraintCollection();\n\n constraints.add(this.getFormatConstraint());\n\n if (this.mindate || this.maxdate) {\n constraints.add(\n new DateBoundaryConstraint(\n this.type,\n this.mindate,\n this.maxdate,\n this.inputFormat\n )\n );\n }\n\n return constraints;\n }\n\n /**\n */\n get readonlyWidth(): $Keys<typeof ATTRIBUTE_WIDTH> {\n if (this.type === \"date\" || this.type === \"time\") {\n return ATTRIBUTE_WIDTH.SMALL;\n }\n\n return ATTRIBUTE_WIDTH.MEDIUM;\n }\n}\n\nexport default DatetimeAttributeModel;\n"],"file":"DatetimeAttributeModel.js"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beinformed/ui",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.3",
|
|
4
4
|
"description": "Toolbox for be informed javascript layouts",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"bugs": "http://support.beinformed.com",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"styled-components": "^5.2.0"
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
|
-
"@babel/runtime-corejs3": "^7.
|
|
81
|
+
"@babel/runtime-corejs3": "^7.17.0",
|
|
82
82
|
"big.js": "^6.1.1",
|
|
83
83
|
"date-fns": "^2.28.0",
|
|
84
84
|
"deepmerge": "^4.2.2",
|
|
@@ -95,12 +95,12 @@
|
|
|
95
95
|
"setimmediate": "^1.0.5"
|
|
96
96
|
},
|
|
97
97
|
"devDependencies": {
|
|
98
|
-
"@babel/cli": "^7.
|
|
99
|
-
"@babel/core": "^7.
|
|
100
|
-
"@babel/eslint-parser": "^7.
|
|
98
|
+
"@babel/cli": "^7.17.0",
|
|
99
|
+
"@babel/core": "^7.17.0",
|
|
100
|
+
"@babel/eslint-parser": "^7.17.0",
|
|
101
101
|
"@babel/eslint-plugin": "^7.16.5",
|
|
102
102
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
103
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
103
|
+
"@babel/plugin-transform-runtime": "^7.17.0",
|
|
104
104
|
"@babel/preset-env": "^7.16.11",
|
|
105
105
|
"@babel/preset-flow": "^7.16.7",
|
|
106
106
|
"@babel/preset-react": "^7.16.7",
|
|
@@ -113,13 +113,13 @@
|
|
|
113
113
|
"cherry-pick": "^0.5.0",
|
|
114
114
|
"cross-env": "^7.0.3",
|
|
115
115
|
"documentation": "^13.2.5",
|
|
116
|
-
"eslint": "^8.
|
|
116
|
+
"eslint": "^8.8.0",
|
|
117
117
|
"eslint-config-prettier": "^8.3.0",
|
|
118
118
|
"eslint-plugin-babel": "^5.3.1",
|
|
119
119
|
"eslint-plugin-flowtype": "^8.0.3",
|
|
120
120
|
"eslint-plugin-import": "^2.25.4",
|
|
121
121
|
"eslint-plugin-jest": "^26.0.0",
|
|
122
|
-
"eslint-plugin-jsdoc": "^37.7.
|
|
122
|
+
"eslint-plugin-jsdoc": "^37.7.1",
|
|
123
123
|
"eslint-plugin-react": "^7.28.0",
|
|
124
124
|
"eslint-plugin-react-hooks": "^4.3.0",
|
|
125
125
|
"flow-bin": "0.152.0",
|
|
@@ -131,8 +131,8 @@
|
|
|
131
131
|
"jest": "^27.4.7",
|
|
132
132
|
"jest-junit": "^13.0.0",
|
|
133
133
|
"jest-sonar-reporter": "^2.0.0",
|
|
134
|
-
"jscodeshift": "^0.13.
|
|
135
|
-
"lint-staged": "^12.3.
|
|
134
|
+
"jscodeshift": "^0.13.1",
|
|
135
|
+
"lint-staged": "^12.3.3",
|
|
136
136
|
"polished": "^4.1.4",
|
|
137
137
|
"prettier": "^2.5.1",
|
|
138
138
|
"react": "^17.0.2",
|
|
@@ -109,6 +109,15 @@ export const LayoutHintConfiguration = {
|
|
|
109
109
|
link: "",
|
|
110
110
|
component: ["attribute/number"],
|
|
111
111
|
},
|
|
112
|
+
IGNORE_FORMAT_SETTING: {
|
|
113
|
+
hint: "ignore-format-setting",
|
|
114
|
+
description: {
|
|
115
|
+
NL: "Maakt het mogelijk om de global date format setting te negeren voor een specifiek attribuut",
|
|
116
|
+
EN: "Makes it possible to ignore the global date format for a specific attribute",
|
|
117
|
+
},
|
|
118
|
+
link: "",
|
|
119
|
+
component: ["attribute/date", "attribute/datetime"],
|
|
120
|
+
},
|
|
112
121
|
CREATE_ACTION: {
|
|
113
122
|
hint: "create",
|
|
114
123
|
description: {
|
|
@@ -53,6 +53,10 @@ export const SORT_OPTIONS: string = getHint("SORT_OPTIONS");
|
|
|
53
53
|
* Layout-hint: Marks an attribute as a title attribute
|
|
54
54
|
*/
|
|
55
55
|
export const TITLE: string = getHint("TITLE");
|
|
56
|
+
/**
|
|
57
|
+
* Layout-hint: Ignore the global input format for specific attribute
|
|
58
|
+
*/
|
|
59
|
+
export const IGNORE_FORMAT_SETTING: string = getHint("IGNORE_FORMAT_SETTING");
|
|
56
60
|
|
|
57
61
|
/*
|
|
58
62
|
* --------------------------------
|
|
@@ -239,10 +239,15 @@ class DatetimeAttributeModel extends StringAttributeModel {
|
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
// setting for date input
|
|
242
|
-
const
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
242
|
+
const ignoreDateInputFormatSetting = getSetting(
|
|
243
|
+
"IGNORE_FORMAT_SETTING",
|
|
244
|
+
false
|
|
245
|
+
);
|
|
246
|
+
if (!ignoreDateInputFormatSetting) {
|
|
247
|
+
const dateInputFormatSetting = getSetting("DATE_INPUT_FORMAT", "");
|
|
248
|
+
if (dateInputFormatSetting) {
|
|
249
|
+
return dateInputFormatSetting;
|
|
250
|
+
}
|
|
246
251
|
}
|
|
247
252
|
|
|
248
253
|
let format = this.format;
|