@beinformed/ui 1.27.6 → 1.28.1
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 +17 -1
- package/esm/constants/LayoutHintConfig.js +0 -9
- package/esm/constants/LayoutHintConfig.js.map +1 -1
- package/esm/constants/LayoutHints.js +0 -4
- package/esm/constants/LayoutHints.js.map +1 -1
- package/esm/constants/Settings.js +0 -4
- package/esm/constants/Settings.js.map +1 -1
- package/esm/models/attributes/DatetimeAttributeModel.js +3 -29
- package/esm/models/attributes/DatetimeAttributeModel.js.map +1 -1
- package/esm/react-client/Init.js +2 -2
- package/esm/react-client/Init.js.map +1 -1
- package/esm/react-client/client.js +80 -53
- package/esm/react-client/client.js.map +1 -1
- package/esm/react-client/index.js +1 -1
- package/esm/react-client/index.js.map +1 -1
- package/esm/redux/store/configureStore.js +4 -4
- package/esm/redux/store/configureStore.js.map +1 -1
- package/lib/constants/LayoutHintConfig.js +0 -9
- package/lib/constants/LayoutHintConfig.js.flow +0 -9
- package/lib/constants/LayoutHintConfig.js.map +1 -1
- package/lib/constants/LayoutHints.js +2 -7
- package/lib/constants/LayoutHints.js.flow +0 -4
- package/lib/constants/LayoutHints.js.map +1 -1
- package/lib/constants/Settings.js +0 -4
- package/lib/constants/Settings.js.flow +0 -6
- package/lib/constants/Settings.js.map +1 -1
- package/lib/models/attributes/DatetimeAttributeModel.js +3 -29
- package/lib/models/attributes/DatetimeAttributeModel.js.flow +7 -41
- package/lib/models/attributes/DatetimeAttributeModel.js.map +1 -1
- package/lib/models/attributes/__tests__/DateAttributeModel.spec.js.flow +1 -35
- package/lib/models/attributes/__tests__/DatetimeAttributeModel.spec.js.flow +158 -216
- package/lib/models/attributes/__tests__/TimestampModel.spec.js.flow +0 -5
- package/lib/react-client/Init.js +2 -2
- package/lib/react-client/Init.js.flow +3 -3
- package/lib/react-client/Init.js.map +1 -1
- package/lib/react-client/client.js +84 -55
- package/lib/react-client/client.js.flow +105 -68
- package/lib/react-client/client.js.map +1 -1
- package/lib/react-client/index.js +17 -7
- package/lib/react-client/index.js.flow +1 -2
- package/lib/react-client/index.js.map +1 -1
- package/lib/redux/store/configureStore.js +4 -4
- package/lib/redux/store/configureStore.js.flow +5 -5
- package/lib/redux/store/configureStore.js.map +1 -1
- package/package.json +17 -19
- package/src/constants/LayoutHintConfig.js +0 -9
- package/src/constants/LayoutHints.js +0 -4
- package/src/constants/Settings.js +0 -6
- package/src/models/attributes/DatetimeAttributeModel.js +7 -41
- package/src/models/attributes/__tests__/DateAttributeModel.spec.js +1 -35
- package/src/models/attributes/__tests__/DatetimeAttributeModel.spec.js +158 -216
- package/src/models/attributes/__tests__/TimestampModel.spec.js +0 -5
- package/src/react-client/Init.js +3 -3
- package/src/react-client/client.js +105 -68
- package/src/react-client/index.js +1 -2
- package/src/redux/store/configureStore.js +5 -5
- package/types/constants/LayoutHintConfig.d.ts +8 -23
- package/types/constants/LayoutHints.d.ts +0 -4
- package/types/models/actions/ActionCollection.d.ts +1 -1
- package/types/models/attributes/DatetimeAttributeModel.d.ts +8 -2
- package/types/redux/_modularui/types.d.ts +4 -0
- package/types/redux/types.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
All notable changes to this project will be documented in this file. See [
|
|
3
|
+
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
|
4
|
+
|
|
5
|
+
## [1.28.1](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.28.0...v1.28.1) (2023-02-20)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- **export:** make all parts of react-client importable ([11c4465](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/11c446547c576385644fc8519350c33fd517e009))
|
|
10
|
+
|
|
11
|
+
## [1.28.0](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.27.6...v1.28.0) (2023-02-20)
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
- **remove-setting:** settings DATE_INPUT_FORMAT and DATE_READONLY_FORMAT are removed ([4e536bd](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/4e536bde53e0c4e6fefbff459aa99bb492f642b5))
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
- **polyfill:** remove native supported polyfills ([9ebdf11](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/9ebdf1160a9b41c1f14c0aecf6b141beb9b252a7))
|
|
4
20
|
|
|
5
21
|
### [1.27.6](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.27.5...v1.27.6) (2023-02-07)
|
|
6
22
|
|
|
@@ -89,15 +89,6 @@ export const 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
|
-
},
|
|
101
92
|
CREATE_ACTION: {
|
|
102
93
|
hint: "create",
|
|
103
94
|
description: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutHintConfig.js","names":["LayoutHintConfiguration","MANDATORY","hint","description","NL","EN","link","component","DEPENDENT_ATTRIBUTE_CONTROL","DEPENDENT_ATTRIBUTE_ACTION","SHOW_ONE_RESULT_AS_DETAIL","HIDE_WHEN_EMPTY","INITIAL_FILTER","CONFIRM_PASSWORD","TITLE","INITIAL_TOTAL_FILESIZE","MAX_TOTAL_FILESIZE","IGNORE_FORMAT_SETTING","CREATE_ACTION","UPDATE_ACTION","DELETE_ACTION","SORT_OPTIONS","CASEVIEW_LINK","DISABLED"],"sources":["../../src/constants/LayoutHintConfig.js"],"sourcesContent":["// @flow\nexport const LayoutHintConfiguration = {\n MANDATORY: {\n hint: \"mandatory\",\n description: {\n NL: \"Geeft aan of een attribuut verplicht is. Dient samen met de dependency hint gebruikt te worden.\",\n EN: \"Indicates a mandatory attribute.\\nShould be used together with the dependency hint.\",\n },\n link: \"\",\n component: [\"attribute\"],\n },\n DEPENDENT_ATTRIBUTE_CONTROL: {\n hint: \"dependent-control:${unique-control-id}\",\n description: {\n NL: \"Geeft aan dat dit het attribuut is waar attributen van afhankelijk zijn. Het unique-control-id is een uniek id dat kan worden gebruikt in the hint voor de show|hide actie op het afhankelijke attribuut.\",\n EN: \"Marks the choice attribute where other attributes depend on. The unique control id is a unique id that can be used in the hint for the show|hide action on the dependent attribute.\",\n },\n link: \"\",\n component: [\"attribute/boolean\", \"attribute/choice\"],\n },\n DEPENDENT_ATTRIBUTE_ACTION: {\n hint: \"dependent-attribute:(show|hide) when dependent-control:${unique-control-id} (equals|includes|notEquals|notIncludes) [${codemaps}]\",\n description: {\n NL: \"Toon of verberg een attribute dat afhankelijk is van de geselecteerde opties van een keuze attribute\",\n EN: \"To show or hide an attribute dependent on options of the choice control codemap that are selected or not selected.\",\n },\n link: \"\",\n component: [\"attribute\"],\n },\n SHOW_ONE_RESULT_AS_DETAIL: {\n hint: \"show-one-result-as-detail\",\n description: {\n NL: \"Een lijst met maar één item mag direct als detail getoond worden.\",\n EN: \"A list with only one detail must be shown as a detail.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n HIDE_WHEN_EMPTY: {\n hint: \"hide-when-empty\",\n description: {\n NL: \"Een lijst zonder lijst-items en lijst-taken dient niet getoond worden.\",\n EN: \"A list without list-items and list-tasks should not be shown.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n INITIAL_FILTER: {\n hint: \"initial-filter:${filter-name}=${initial-value}\",\n description: {\n NL: \"Laad de lijst met een standaardwaarde voor een filter, er is geen controle op het bestaan van het filter. Als het filter niet is geconfigureerd, treedt er een fout op. Houd er rekening mee dat filters hoofdlettergevoelig zijn.\",\n EN: \"Load the list with a default value for a filter, there is no check for the existence of the filter. If the filter is not configured, an error occurs. Keep in mind that filters are case sensitive.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n CONFIRM_PASSWORD: {\n hint: \"confirm-password\",\n description: {\n NL: \"Wachtwoord attribuut moet bevestigd worden dmv een tweede wachtwoord attribuut.\",\n EN: \"Password attribute must be confirmed using a second password attribute.\",\n },\n link: \"\",\n component: [\"attribute/password\"],\n },\n TITLE: {\n hint: \"title\",\n description: {\n NL: \"Markeert een attribuut als een titel attribuut\",\n EN: \"Marks an attribute as a title attribute\",\n },\n link: \"\",\n component: [\n \"caseview_table\",\n \"codemap\",\n \"list/appointment_table\",\n \"list/assignment_table\",\n \"list/caseproperties_table\",\n \"list/document_table\",\n \"list/timelimit_table\",\n \"list/eventhistory_table\",\n \"list/note_table\",\n \"list/record_table\",\n \"list/case_table\",\n \"list/casesearch_table\",\n \"list/datastore_table\",\n \"list/datastoreview_table\",\n \"list/instrumentresult_table\",\n \"list/event_table\",\n \"list/user_table\",\n \"list/organization_table\",\n ],\n },\n INITIAL_TOTAL_FILESIZE: {\n hint: \"initial-total-file-size\",\n description: {\n NL: \"Wordt gebruikt in samenwerking met een upload attribuut, deze hint moet worden gezet op een readonly attribuut dat de reeds gebruikte file grootte bevat.\",\n EN: \"Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the file size currently used.\",\n },\n link: \"\",\n component: [\"attribute/number\"],\n },\n MAX_TOTAL_FILESIZE: {\n hint: \"max-total-file-size\",\n description: {\n NL: \"Wordt gebruikt in samenwerking met een upload attribuut, deze hint moet worden gezet op een readonly attribuut dat de maximaal toegestane file grootte bevat.\",\n EN: \"Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the maximum allowed total file size.\",\n },\n link: \"\",\n component: [\"attribute/number\"],\n },\n 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"],"mappings":"AACA,OAAO,MAAMA,uBAAuB,GAAG;EACrCC,SAAS,EAAE;IACTC,IAAI,EAAE,WAAW;IACjBC,WAAW,EAAE;MACXC,EAAE,EAAE,iGAAiG;MACrGC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CAAC,WAAW;EACzB,CAAC;EACDC,2BAA2B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AAS,EAAE,CAAC,MAAM;EACpB,CAAC;EACDa,aAAa,EAAE;IACblB,IAAI,EAAE,QAAQ;IACdC,WAAW,EAAE;MACXC,EAAE,EAAE,kCAAkC;MACtCC,EAAE,EAAE;IACN,CAAC;IACDE,SAAS,EAAE,CAAC,MAAM;EACpB,CAAC;EACDc,YAAY,EAAE;IACZnB,IAAI,EAAE,cAAc;IACpBC,WAAW,EAAE;MACXC,EAAE,EAAE,4BAA4B;MAChCC,EAAE,EAAE;IACN,CAAC;IACDE,SAAS,EAAE,CAAC,kBAAkB;EAChC,CAAC;EACDe,aAAa,EAAE;IACbpB,IAAI,EAAE,gBAAgB;IACtBC,WAAW,EAAE;MACXC,EAAE,EAAE,uHAAuH;MAC3HC,EAAE,EAAE;IACN,CAAC;IACDE,SAAS,EAAE,CAAC,qBAAqB,EAAE,sBAAsB;EAC3D,CAAC;EACDgB,QAAQ,EAAE;IACRrB,IAAI,EAAE,UAAU;IAChBC,WAAW,EAAE;MACXC,EAAE,EAAE,8CAA8C;MAClDC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CAAC,WAAW;EACzB;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"LayoutHintConfig.js","names":["LayoutHintConfiguration","MANDATORY","hint","description","NL","EN","link","component","DEPENDENT_ATTRIBUTE_CONTROL","DEPENDENT_ATTRIBUTE_ACTION","SHOW_ONE_RESULT_AS_DETAIL","HIDE_WHEN_EMPTY","INITIAL_FILTER","CONFIRM_PASSWORD","TITLE","INITIAL_TOTAL_FILESIZE","MAX_TOTAL_FILESIZE","CREATE_ACTION","UPDATE_ACTION","DELETE_ACTION","SORT_OPTIONS","CASEVIEW_LINK","DISABLED"],"sources":["../../src/constants/LayoutHintConfig.js"],"sourcesContent":["// @flow\nexport const LayoutHintConfiguration = {\n MANDATORY: {\n hint: \"mandatory\",\n description: {\n NL: \"Geeft aan of een attribuut verplicht is. Dient samen met de dependency hint gebruikt te worden.\",\n EN: \"Indicates a mandatory attribute.\\nShould be used together with the dependency hint.\",\n },\n link: \"\",\n component: [\"attribute\"],\n },\n DEPENDENT_ATTRIBUTE_CONTROL: {\n hint: \"dependent-control:${unique-control-id}\",\n description: {\n NL: \"Geeft aan dat dit het attribuut is waar attributen van afhankelijk zijn. Het unique-control-id is een uniek id dat kan worden gebruikt in the hint voor de show|hide actie op het afhankelijke attribuut.\",\n EN: \"Marks the choice attribute where other attributes depend on. The unique control id is a unique id that can be used in the hint for the show|hide action on the dependent attribute.\",\n },\n link: \"\",\n component: [\"attribute/boolean\", \"attribute/choice\"],\n },\n DEPENDENT_ATTRIBUTE_ACTION: {\n hint: \"dependent-attribute:(show|hide) when dependent-control:${unique-control-id} (equals|includes|notEquals|notIncludes) [${codemaps}]\",\n description: {\n NL: \"Toon of verberg een attribute dat afhankelijk is van de geselecteerde opties van een keuze attribute\",\n EN: \"To show or hide an attribute dependent on options of the choice control codemap that are selected or not selected.\",\n },\n link: \"\",\n component: [\"attribute\"],\n },\n SHOW_ONE_RESULT_AS_DETAIL: {\n hint: \"show-one-result-as-detail\",\n description: {\n NL: \"Een lijst met maar één item mag direct als detail getoond worden.\",\n EN: \"A list with only one detail must be shown as a detail.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n HIDE_WHEN_EMPTY: {\n hint: \"hide-when-empty\",\n description: {\n NL: \"Een lijst zonder lijst-items en lijst-taken dient niet getoond worden.\",\n EN: \"A list without list-items and list-tasks should not be shown.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n INITIAL_FILTER: {\n hint: \"initial-filter:${filter-name}=${initial-value}\",\n description: {\n NL: \"Laad de lijst met een standaardwaarde voor een filter, er is geen controle op het bestaan van het filter. Als het filter niet is geconfigureerd, treedt er een fout op. Houd er rekening mee dat filters hoofdlettergevoelig zijn.\",\n EN: \"Load the list with a default value for a filter, there is no check for the existence of the filter. If the filter is not configured, an error occurs. Keep in mind that filters are case sensitive.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n CONFIRM_PASSWORD: {\n hint: \"confirm-password\",\n description: {\n NL: \"Wachtwoord attribuut moet bevestigd worden dmv een tweede wachtwoord attribuut.\",\n EN: \"Password attribute must be confirmed using a second password attribute.\",\n },\n link: \"\",\n component: [\"attribute/password\"],\n },\n TITLE: {\n hint: \"title\",\n description: {\n NL: \"Markeert een attribuut als een titel attribuut\",\n EN: \"Marks an attribute as a title attribute\",\n },\n link: \"\",\n component: [\n \"caseview_table\",\n \"codemap\",\n \"list/appointment_table\",\n \"list/assignment_table\",\n \"list/caseproperties_table\",\n \"list/document_table\",\n \"list/timelimit_table\",\n \"list/eventhistory_table\",\n \"list/note_table\",\n \"list/record_table\",\n \"list/case_table\",\n \"list/casesearch_table\",\n \"list/datastore_table\",\n \"list/datastoreview_table\",\n \"list/instrumentresult_table\",\n \"list/event_table\",\n \"list/user_table\",\n \"list/organization_table\",\n ],\n },\n INITIAL_TOTAL_FILESIZE: {\n hint: \"initial-total-file-size\",\n description: {\n NL: \"Wordt gebruikt in samenwerking met een upload attribuut, deze hint moet worden gezet op een readonly attribuut dat de reeds gebruikte file grootte bevat.\",\n EN: \"Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the file size currently used.\",\n },\n link: \"\",\n component: [\"attribute/number\"],\n },\n MAX_TOTAL_FILESIZE: {\n hint: \"max-total-file-size\",\n description: {\n NL: \"Wordt gebruikt in samenwerking met een upload attribuut, deze hint moet worden gezet op een readonly attribuut dat de maximaal toegestane file grootte bevat.\",\n EN: \"Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the maximum allowed total file size.\",\n },\n link: \"\",\n component: [\"attribute/number\"],\n },\n CREATE_ACTION: {\n hint: \"create\",\n description: {\n NL: \"Markeer taak als creëer taak.\",\n EN: \"Mark task as create task\",\n },\n component: [\"form\"],\n },\n UPDATE_ACTION: {\n hint: \"update\",\n description: {\n NL: \"Markeer taak als bewerk taak.\",\n EN: \"Mark task as update task\",\n },\n component: [\"form\"],\n },\n DELETE_ACTION: {\n hint: \"delete\",\n description: {\n NL: \"Markeer taak als verwijder taak.\",\n EN: \"Mark task as delete task\",\n },\n component: [\"form\"],\n },\n SORT_OPTIONS: {\n hint: \"sort-options\",\n description: {\n NL: \"Sorteer opties alfabetisch\",\n EN: \"Sort options alphabetically\",\n },\n component: [\"attribute/choice\"],\n },\n CASEVIEW_LINK: {\n hint: \"case-view-link\",\n description: {\n NL: \"Markeer een case id reference attribute als de referentie naar de case view. Vervangt de self link van een lijst item\",\n EN: \"Mark a case id reference attribute as the reference to the case view. Replaces the self link of a list item\",\n },\n component: [\"attribute/reference\", \"list/datastore_table\"],\n },\n DISABLED: {\n hint: \"disabled\",\n description: {\n NL: \"Geeft aan of een attribuut uitgeschakeld is.\",\n EN: \"Indicates a disabled attribute.\",\n },\n link: \"\",\n component: [\"attribute\"],\n },\n};\n"],"mappings":"AACA,OAAO,MAAMA,uBAAuB,GAAG;EACrCC,SAAS,EAAE;IACTC,IAAI,EAAE,WAAW;IACjBC,WAAW,EAAE;MACXC,EAAE,EAAE,iGAAiG;MACrGC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CAAC,WAAW;EACzB,CAAC;EACDC,2BAA2B,EAAE;IAC3BN,IAAI,EAAE,wCAAwC;IAC9CC,WAAW,EAAE;MACXC,EAAE,EAAE,2MAA2M;MAC/MC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CAAC,mBAAmB,EAAE,kBAAkB;EACrD,CAAC;EACDE,0BAA0B,EAAE;IAC1BP,IAAI,EAAE,mIAAmI;IACzIC,WAAW,EAAE;MACXC,EAAE,EAAE,sGAAsG;MAC1GC,EAAE,EAAE;IACN,CAAC;IACDC,IAAI,EAAE,EAAE;IACRC,SAAS,EAAE,CAAC,WAAW;EACzB,CAAC;EACDG,yBAAyB,EAAE;IACzBR,IAAI,EAAE,2BAA2B;IACjCC,WAAW,EAAE;MACXC,EAAE,EAA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AAE;IACRC,SAAS,EAAE,CAAC,WAAW;EACzB;AACF,CAAC"}
|
|
@@ -51,10 +51,6 @@ export const SORT_OPTIONS = getHint("SORT_OPTIONS");
|
|
|
51
51
|
* Layout-hint: Marks an attribute as a title attribute
|
|
52
52
|
*/
|
|
53
53
|
export const TITLE = getHint("TITLE");
|
|
54
|
-
/**
|
|
55
|
-
* Layout-hint: Ignore the global input format for specific attribute
|
|
56
|
-
*/
|
|
57
|
-
export const IGNORE_FORMAT_SETTING = getHint("IGNORE_FORMAT_SETTING");
|
|
58
54
|
|
|
59
55
|
/*
|
|
60
56
|
* --------------------------------
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutHints.js","names":["LayoutHintConfiguration","getHint","hint","MANDATORY","DISABLED","DEPENDENT_ATTRIBUTE_CONTROL","DEPENDENT_ATTRIBUTE","CONFIRM_PASSWORD","SORT_OPTIONS","TITLE","
|
|
1
|
+
{"version":3,"file":"LayoutHints.js","names":["LayoutHintConfiguration","getHint","hint","MANDATORY","DISABLED","DEPENDENT_ATTRIBUTE_CONTROL","DEPENDENT_ATTRIBUTE","CONFIRM_PASSWORD","SORT_OPTIONS","TITLE","DELETE_ACTION","UPDATE_ACTION","CREATE_ACTION","INITIAL_TOTAL_FILESIZE","MAX_TOTAL_FILESIZE","SHOW_ONE_RESULT_AS_DETAIL","HIDE_WHEN_EMPTY","INITIAL_FILTER","CASEVIEW_LINK","RENDER_SECTION_LABEL","getLayoutHintConfiguration"],"sources":["../../src/constants/LayoutHints.js"],"sourcesContent":["// @flow\nimport { LayoutHintConfiguration } from \"./LayoutHintConfig\";\n\n/**\n * Retrieve layout hint by id from the layout hint configuration\n */\nconst getHint = (hint: string): string => {\n if (LayoutHintConfiguration[hint]) {\n return LayoutHintConfiguration[hint].hint;\n }\n\n return \"\";\n};\n\n/**\n * Layout-hint: Indicates a mandatory attribute. Should be used together with the dependency hint.\n */\nexport const MANDATORY: string = getHint(\"MANDATORY\");\n\n/**\n * Layout-hint: Indicates a disabled attribute.\n * @constant\n */\nexport const DISABLED: string = getHint(\"DISABLED\");\n\n/*\n * --------------------------------\n * SELECT DEPENDENT ATTRIBUTES\n * --------------------------------\n */\n/**\n * Layout-hint: Marks the choice attribute where other attributes depend on. The unique control id is a unique id that can be used in the hint for the show|hide action on the dependent attribute.\n */\nexport const DEPENDENT_ATTRIBUTE_CONTROL = \"dependent-control\";\n/**\n */\nexport const DEPENDENT_ATTRIBUTE = \"dependent-attribute:\";\n\n/*\n * --------------------------------\n * ATTRIBUTES\n * --------------------------------\n */\n/**\n * Layout-hint: Password attribute must be confirmed using a second password attribute.\n */\nexport const CONFIRM_PASSWORD: string = getHint(\"CONFIRM_PASSWORD\");\n/**\n * Layout-hint: Sort options alphabetically\n */\nexport const SORT_OPTIONS: string = getHint(\"SORT_OPTIONS\");\n/**\n * Layout-hint: Marks an attribute as a title attribute\n */\nexport const TITLE: string = getHint(\"TITLE\");\n\n/*\n * --------------------------------\n * FORM\n * --------------------------------\n */\n/**\n * Layout-hint: Mark task as delete task\n */\nexport const DELETE_ACTION: string = getHint(\"DELETE_ACTION\");\n/**\n * Layout-hint: Mark task as update task\n */\nexport const UPDATE_ACTION: string = getHint(\"UPDATE_ACTION\");\n/**\n * Layout-hint: Mark task as create task\n */\nexport const CREATE_ACTION: string = getHint(\"CREATE_ACTION\");\n\n/*\n * --------------------------------\n * UPLOAD TOTAL FILE SIZE\n * --------------------------------\n */\n/**\n * Layout-hint: Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the file size currently used.\n */\nexport const INITIAL_TOTAL_FILESIZE: string = getHint(\"INITIAL_TOTAL_FILESIZE\");\n/**\n * Layout-hint: Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the maximum allowed total file size.\n */\nexport const MAX_TOTAL_FILESIZE: string = getHint(\"MAX_TOTAL_FILESIZE\");\n\n/*\n * --------------------------------\n * LISTS\n * --------------------------------\n */\n/**\n * Layout-hint: A list with only one detail must be shown as a detail\n */\nexport const SHOW_ONE_RESULT_AS_DETAIL: string = getHint(\n \"SHOW_ONE_RESULT_AS_DETAIL\"\n);\n/**\n * Layout-hint: A list without list-items and list-tasks should not be shown.\n */\nexport const HIDE_WHEN_EMPTY: string = getHint(\"HIDE_WHEN_EMPTY\");\n/**\n * Layout-hint: Sets a default value on a filter\n */\nexport const INITIAL_FILTER: string = \"initial-filter:\";\n/**\n * Layout-hint: Mark a case id reference attribute as the reference to the case view. Replaces the self link of a list item\n */\nexport const CASEVIEW_LINK: string = getHint(\"CASEVIEW_LINK\");\n\n/**\n * Layout-hint: Set on configuration of instruments to show content in a popover on a label\n */\nexport const RENDER_SECTION_LABEL = \"render-section-label\";\n\n/**\n */\nexport const getLayoutHintConfiguration = (): Object => LayoutHintConfiguration;\n\nexport default getHint;\n"],"mappings":"AACA,SAASA,uBAAuB,QAAQ,oBAAoB;;AAE5D;AACA;AACA;AACA,MAAMC,OAAO,GAAIC,IAAY,IAAa;EACxC,IAAIF,uBAAuB,CAACE,IAAI,CAAC,EAAE;IACjC,OAAOF,uBAAuB,CAACE,IAAI,CAAC,CAACA,IAAI;EAC3C;EAEA,OAAO,EAAE;AACX,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMC,SAAiB,GAAGF,OAAO,CAAC,WAAW,CAAC;;AAErD;AACA;AACA;AACA;AACA,OAAO,MAAMG,QAAgB,GAAGH,OAAO,CAAC,UAAU,CAAC;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMI,2BAA2B,GAAG,mBAAmB;AAC9D;AACA;AACA,OAAO,MAAMC,mBAAmB,GAAG,sBAAsB;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAwB,GAAGN,OAAO,CAAC,kBAAkB,CAAC;AACnE;AACA;AACA;AACA,OAAO,MAAMO,YAAoB,GAAGP,OAAO,CAAC,cAAc,CAAC;AAC3D;AACA;AACA;AACA,OAAO,MAAMQ,KAAa,GAAGR,OAAO,CAAC,OAAO,CAAC;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMS,aAAqB,GAAGT,OAAO,CAAC,eAAe,CAAC;AAC7D;AACA;AACA;AACA,OAAO,MAAMU,aAAqB,GAAGV,OAAO,CAAC,eAAe,CAAC;AAC7D;AACA;AACA;AACA,OAAO,MAAMW,aAAqB,GAAGX,OAAO,CAAC,eAAe,CAAC;;AAE7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMY,sBAA8B,GAAGZ,OAAO,CAAC,wBAAwB,CAAC;AAC/E;AACA;AACA;AACA,OAAO,MAAMa,kBAA0B,GAAGb,OAAO,CAAC,oBAAoB,CAAC;;AAEvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMc,yBAAiC,GAAGd,OAAO,CACtD,2BAA2B,CAC5B;AACD;AACA;AACA;AACA,OAAO,MAAMe,eAAuB,GAAGf,OAAO,CAAC,iBAAiB,CAAC;AACjE;AACA;AACA;AACA,OAAO,MAAMgB,cAAsB,GAAG,iBAAiB;AACvD;AACA;AACA;AACA,OAAO,MAAMC,aAAqB,GAAGjB,OAAO,CAAC,eAAe,CAAC;;AAE7D;AACA;AACA;AACA,OAAO,MAAMkB,oBAAoB,GAAG,sBAAsB;;AAE1D;AACA;AACA,OAAO,MAAMC,0BAA0B,GAAG,MAAcpB,uBAAuB;AAE/E,eAAeC,OAAO"}
|
|
@@ -51,10 +51,6 @@ const defaultSettings = {
|
|
|
51
51
|
BUSINESS_SCENARIO_CONCEPT_TYPE: ["/Library/KMTs/Business scenarios.bixml/BusinessScenario"],
|
|
52
52
|
BUSINESS_SCENARIO_STEP_CONCEPT_TYPE: ["/Library/KMTs/Business scenarios.bixml/ScenarioStep"],
|
|
53
53
|
BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE: ["/Library/KMTs/Business scenarios.bixml/Persona"],
|
|
54
|
-
// Input format for dates. Without this setting having a value, the contributions format is used
|
|
55
|
-
DATE_INPUT_FORMAT: "",
|
|
56
|
-
// Readonly format for dates. Without this setting having a value, the contributions format is used
|
|
57
|
-
DATE_READONLY_FORMAT: "",
|
|
58
54
|
// indicates on what day the week starts (0 = Sunday)
|
|
59
55
|
CALENDAR_WEEK_STARTS_ON: 1,
|
|
60
56
|
// indicates which date indicates the first week of the year
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Settings.js","names":["isPlainObject","has","getRepositoryResourceUrl","ALL_CONTENT_IN_DATA_SETTING","INTERNAL_LOGIN_TYPE","LOGIN_TYPE","LOGIN_PATH_SETTING","LOGIN_USERNAME_SETTING","LOGIN_PASSWORD_SETTING","LOGOUT_PATH_SETTING","UPLOAD_PATH","CAPTCHA_PATH","serverBase","__CONTEXT_PATH__","defaultSettings","CONTEXT_PATH","window","contextPath","CACHE_CONTRIBUTIONS","DEBUG_I18N_MESSAGE_NOT_FOUND","HIDE_NOTIFICATION_TIMEOUT","ALWAYS_COMMIT_FORM","RENDER_QUESTION_LABELS","RENDER_MANDATORY_ATTRIBUTE_INDICATION","RENDER_OPTIONAL_ATTRIBUTE_INDICATION","AVAILABLE_LIST_VIEWS","USE_CLIENTSIDE_VALIDATION","USE_INSTANT_SERVER_VALIDATION","ENABLED_LOCALES","RENDER_GLOBAL_LOGIN_PAGE","RENDER_GLOBAL_LOGOUT_PAGE","RENDER_MULTI_LOGIN_ON_GLOBAL_LOGOUT_PAGE","LOGIN_PATH","ADMINISTRATOR_LOGIN_PATH","LOGOUT_PATH","RENDER_FORMS_IN_MODAL","SHOW_SUBMIT_WAIT_TIMEOUT","SWIM_LANE_DIAGRAM_CONFIGURATION","BUSINESS_SCENARIO_CONCEPT_TYPE","BUSINESS_SCENARIO_STEP_CONCEPT_TYPE","BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE","DATE_INPUT_FORMAT","DATE_READONLY_FORMAT","CALENDAR_WEEK_STARTS_ON","CALENDAR_FIRST_WEEK_CONTAINS_DATE","UI_PARAMETERS","ALLOW_HIDE_WHEN_EMPTY_ON_TABS","PAGE_RELOAD_ON_UNAUTHORIZED_ERROR","XHR_TIMEOUT_MS","HIDE_WHEN_EMPTY_IGNORE_TASKS","settings","setSettings","config","getSetting","key","defaultValue","undefined","Error","setSetting","value","allSettings","cacheContributions","getBasePath","getUploadPath","getCaptchaPath","hasAllContentInData","loginType","JAAS","loginPath","loginUsernameField","loginPasswordField","logoutPath","getSwimLaneDiagramConfiguration","configLocation","BASE"],"sources":["../../src/constants/Settings.js"],"sourcesContent":["// @flow\nimport { isPlainObject, has } from \"../utils/helpers/objects\";\nimport { getRepositoryResourceUrl } from \"../utils/helpers/repositoryResource\";\nimport {\n ALL_CONTENT_IN_DATA_SETTING,\n INTERNAL_LOGIN_TYPE,\n LOGIN_TYPE,\n LOGIN_PATH_SETTING,\n LOGIN_USERNAME_SETTING,\n LOGIN_PASSWORD_SETTING,\n LOGOUT_PATH_SETTING,\n UPLOAD_PATH,\n CAPTCHA_PATH,\n} from \"./Constants\";\n\ntype Setting = boolean | string | number | Array<string>;\n\nconst serverBase =\n typeof __CONTEXT_PATH__ === \"undefined\" ? null : __CONTEXT_PATH__;\n\nconst defaultSettings: { [name: string]: Setting } = {\n // This uses contextPath set from property from server\n CONTEXT_PATH:\n serverBase ??\n (typeof window !== \"undefined\" && window.contextPath\n ? window.contextPath\n : \"/BeInformed\"),\n\n // Indicates if contributions should be cached\n CACHE_CONTRIBUTIONS: true,\n\n // Debug missing i18n messages in layout\n DEBUG_I18N_MESSAGE_NOT_FOUND: true,\n\n // Time to show the notification bar\n HIDE_NOTIFICATION_TIMEOUT: 5000,\n\n // Always commit form, does not show result pages for instruments\n ALWAYS_COMMIT_FORM: false,\n\n // Render instrument and event question labels on forms (might result in duplicate labels)\n RENDER_QUESTION_LABELS: true,\n\n // Render mandatory indications on attributes\n RENDER_MANDATORY_ATTRIBUTE_INDICATION: true,\n\n // Render optional indications on attributes\n RENDER_OPTIONAL_ATTRIBUTE_INDICATION: false,\n\n // Renders a toggle with supported list views, options are ListView and TableView\n AVAILABLE_LIST_VIEWS: [\"ListView\", \"TableView\"],\n\n // Toggle client side validation\n USE_CLIENTSIDE_VALIDATION: true,\n\n // Indicates if server validation should be used when a form field is changed\n USE_INSTANT_SERVER_VALIDATION: true,\n\n // Indicates which locales are enabled\n ENABLED_LOCALES: [\"en\", \"nl\"],\n\n // Renders the global log in page\n RENDER_GLOBAL_LOGIN_PAGE: false,\n\n // Renders the global log out page\n RENDER_GLOBAL_LOGOUT_PAGE: false,\n\n // Renders the login variants as option on the global logout page\n RENDER_MULTI_LOGIN_ON_GLOBAL_LOGOUT_PAGE: false,\n\n // Path to login page / component\n LOGIN_PATH: \"/signin\",\n\n // Path to administrator login page / component\n ADMINISTRATOR_LOGIN_PATH: \"\",\n\n // Path to logout page / component\n LOGOUT_PATH: \"/signout\",\n\n // Render forms in a modal\n RENDER_FORMS_IN_MODAL: true,\n\n // Wait timeout before rendering submit wait icon\n SHOW_SUBMIT_WAIT_TIMEOUT: 300,\n\n // Swim lane diagram configuration file\n SWIM_LANE_DIAGRAM_CONFIGURATION: \"/Library/Diagrams/Overviews.json\",\n\n // Business scenario concept types\n BUSINESS_SCENARIO_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/BusinessScenario\",\n ],\n BUSINESS_SCENARIO_STEP_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/ScenarioStep\",\n ],\n BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/Persona\",\n ],\n\n // Input format for dates. Without this setting having a value, the contributions format is used\n DATE_INPUT_FORMAT: \"\",\n\n // Readonly format for dates. Without this setting having a value, the contributions format is used\n DATE_READONLY_FORMAT: \"\",\n\n // indicates on what day the week starts (0 = Sunday)\n CALENDAR_WEEK_STARTS_ON: 1,\n\n // indicates which date indicates the first week of the year\n CALENDAR_FIRST_WEEK_CONTAINS_DATE: 1,\n\n // parameters that are added for the ui state, but should not be send to the modular ui\n UI_PARAMETERS: [],\n\n // disable hide-when-empty hint for layouts running on Be Informed versions older than 21.1\n ALLOW_HIDE_WHEN_EMPTY_ON_TABS: true,\n\n // reload the complete page on signout, usefull when third party authentication is in place\n PAGE_RELOAD_ON_UNAUTHORIZED_ERROR: false,\n\n XHR_TIMEOUT_MS: 300000,\n\n HIDE_WHEN_EMPTY_IGNORE_TASKS: false,\n};\n\nlet settings = defaultSettings;\n\n/**\n */\nexport const setSettings = (config: Object) => {\n if (isPlainObject(config)) {\n settings = Object.assign(defaultSettings, config);\n }\n};\n\n/**\n */\nexport const getSetting = (key: string, defaultValue?: any): any => {\n if (!has(settings, key) && defaultValue === undefined) {\n throw new Error(\n `Setting with name ${key} not found and no defaultValue given`\n );\n }\n\n return settings[key] ?? defaultValue;\n};\n\n/**\n */\nexport const setSetting = (key: string, value: any) => {\n settings[key] = value;\n};\n\n/**\n */\nexport const allSettings = (): { [name: string]: Setting } => settings;\n\n/**\n * Indicates if contributions must be cached\n */\nexport const cacheContributions = (): boolean =>\n getSetting(\"CACHE_CONTRIBUTIONS\", true);\n\n/**\n * Base path\n * This uses contextPath set from property from server\n * When requesting a remote server with CORS enabled, add the origin, for example:\n * export const BEINFORMED_PATH = 'http://192.168.128.61:8080/BeInformed';\n */\nexport const getBasePath = (): string =>\n getSetting(\"CONTEXT_PATH\", \"/BeInformed\");\n\n/**\n * Path to upload service\n */\nexport const getUploadPath = (): string => `${getBasePath()}${UPLOAD_PATH}`;\n\n/**\n * Path to captcha service\n */\nexport const getCaptchaPath = (): string => `${getBasePath()}${CAPTCHA_PATH}`;\n\n/**\n */\nexport const hasAllContentInData = (): boolean =>\n getSetting(ALL_CONTENT_IN_DATA_SETTING, true);\n\n/**\n * Login type, only available when pac4j is configured\n *\n * Preview does not support pac4j, thus is probably not configured when started, which results in login type JAAS\n */\nexport const loginType = (): string =>\n getSetting(LOGIN_TYPE, INTERNAL_LOGIN_TYPE.JAAS);\n\n/**\n */\nexport const loginPath = (): string =>\n getSetting(LOGIN_PATH_SETTING, \"/callback?client_name=FormClient\");\n/**\n */\nexport const loginUsernameField = (): string =>\n getSetting(LOGIN_USERNAME_SETTING, \"j_username\");\n/**\n */\nexport const loginPasswordField = (): string =>\n getSetting(LOGIN_PASSWORD_SETTING, \"j_password\");\n/**\n */\nexport const logoutPath = (): string =>\n getSetting(LOGOUT_PATH_SETTING, \"/logout\");\n\nexport const LOGIN_PATH: string = loginPath();\nexport const LOGOUT_PATH: string = logoutPath();\n\n/**\n * Model overview swim lane configuration\n */\nexport const getSwimLaneDiagramConfiguration: Object = () => {\n let configLocation = getSetting(\n \"SWIM_LANE_DIAGRAM_CONFIGURATION\",\n \"/Library/Diagrams/Overviews.json\"\n );\n if (!configLocation.startsWith(\"/\")) {\n configLocation = `/${configLocation}`;\n }\n return getRepositoryResourceUrl(configLocation);\n};\n\n/**\n * Backwards compatible export of BASE constant\n */\nexport const BASE: string = getBasePath();\n"],"mappings":";;AACA,SAASA,aAAa,EAAEC,GAAG,QAAQ,0BAA0B;AAC7D,SAASC,wBAAwB,QAAQ,qCAAqC;AAC9E,SACEC,2BAA2B,EAC3BC,mBAAmB,EACnBC,UAAU,EACVC,kBAAkB,EAClBC,sBAAsB,EACtBC,sBAAsB,EACtBC,mBAAmB,EACnBC,WAAW,EACXC,YAAY,QACP,aAAa;AAIpB,MAAMC,UAAU,GACd,OAAOC,gBAAgB,KAAK,WAAW,GAAG,IAAI,GAAGA,gBAAgB;AAEnE,MAAMC,eAA4C,GAAG;EACnD;EACAC,YAAY,EACVH,UAAU,KACT,OAAOI,MAAM,KAAK,WAAW,IAAIA,MAAM,CAACC,WAAW,GAChDD,MAAM,CAACC,WAAW,GAClB,aAAa,CAAC;EAEpB;EACAC,mBAAmB,EAAE,IAAI;EAEzB;EACAC,4BAA4B,EAAE,IAAI;EAElC;EACAC,yBAAyB,EAAE,IAAI;EAE/B;EACAC,kBAAkB,EAAE,KAAK;EAEzB;EACAC,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AAY,CAAC;AAClD;AACA;AACA,OAAO,MAAM+D,kBAAkB,GAAG,MAChCjB,UAAU,CAAC7C,sBAAsB,EAAE,YAAY,CAAC;AAClD;AACA;AACA,OAAO,MAAM+D,UAAU,GAAG,MACxBlB,UAAU,CAAC5C,mBAAmB,EAAE,SAAS,CAAC;AAE5C,OAAO,MAAMuB,UAAkB,GAAGoC,SAAS,EAAE;AAC7C,OAAO,MAAMlC,WAAmB,GAAGqC,UAAU,EAAE;;AAE/C;AACA;AACA;AACA,OAAO,MAAMC,+BAAuC,GAAG,MAAM;EAC3D,IAAIC,cAAc,GAAGpB,UAAU,CAC7B,iCAAiC,EACjC,kCAAkC,CACnC;EACD,IAAI,CAAC,4BAAAoB,cAAc,OAAdA,cAAc,EAAY,GAAG,CAAC,EAAE;IACnCA,cAAc,GAAI,IAAGA,cAAe,EAAC;EACvC;EACA,OAAOvE,wBAAwB,CAACuE,cAAc,CAAC;AACjD,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMC,IAAY,GAAGZ,WAAW,EAAE"}
|
|
1
|
+
{"version":3,"file":"Settings.js","names":["isPlainObject","has","getRepositoryResourceUrl","ALL_CONTENT_IN_DATA_SETTING","INTERNAL_LOGIN_TYPE","LOGIN_TYPE","LOGIN_PATH_SETTING","LOGIN_USERNAME_SETTING","LOGIN_PASSWORD_SETTING","LOGOUT_PATH_SETTING","UPLOAD_PATH","CAPTCHA_PATH","serverBase","__CONTEXT_PATH__","defaultSettings","CONTEXT_PATH","window","contextPath","CACHE_CONTRIBUTIONS","DEBUG_I18N_MESSAGE_NOT_FOUND","HIDE_NOTIFICATION_TIMEOUT","ALWAYS_COMMIT_FORM","RENDER_QUESTION_LABELS","RENDER_MANDATORY_ATTRIBUTE_INDICATION","RENDER_OPTIONAL_ATTRIBUTE_INDICATION","AVAILABLE_LIST_VIEWS","USE_CLIENTSIDE_VALIDATION","USE_INSTANT_SERVER_VALIDATION","ENABLED_LOCALES","RENDER_GLOBAL_LOGIN_PAGE","RENDER_GLOBAL_LOGOUT_PAGE","RENDER_MULTI_LOGIN_ON_GLOBAL_LOGOUT_PAGE","LOGIN_PATH","ADMINISTRATOR_LOGIN_PATH","LOGOUT_PATH","RENDER_FORMS_IN_MODAL","SHOW_SUBMIT_WAIT_TIMEOUT","SWIM_LANE_DIAGRAM_CONFIGURATION","BUSINESS_SCENARIO_CONCEPT_TYPE","BUSINESS_SCENARIO_STEP_CONCEPT_TYPE","BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE","CALENDAR_WEEK_STARTS_ON","CALENDAR_FIRST_WEEK_CONTAINS_DATE","UI_PARAMETERS","ALLOW_HIDE_WHEN_EMPTY_ON_TABS","PAGE_RELOAD_ON_UNAUTHORIZED_ERROR","XHR_TIMEOUT_MS","HIDE_WHEN_EMPTY_IGNORE_TASKS","settings","setSettings","config","getSetting","key","defaultValue","undefined","Error","setSetting","value","allSettings","cacheContributions","getBasePath","getUploadPath","getCaptchaPath","hasAllContentInData","loginType","JAAS","loginPath","loginUsernameField","loginPasswordField","logoutPath","getSwimLaneDiagramConfiguration","configLocation","BASE"],"sources":["../../src/constants/Settings.js"],"sourcesContent":["// @flow\nimport { isPlainObject, has } from \"../utils/helpers/objects\";\nimport { getRepositoryResourceUrl } from \"../utils/helpers/repositoryResource\";\nimport {\n ALL_CONTENT_IN_DATA_SETTING,\n INTERNAL_LOGIN_TYPE,\n LOGIN_TYPE,\n LOGIN_PATH_SETTING,\n LOGIN_USERNAME_SETTING,\n LOGIN_PASSWORD_SETTING,\n LOGOUT_PATH_SETTING,\n UPLOAD_PATH,\n CAPTCHA_PATH,\n} from \"./Constants\";\n\ntype Setting = boolean | string | number | Array<string>;\n\nconst serverBase =\n typeof __CONTEXT_PATH__ === \"undefined\" ? null : __CONTEXT_PATH__;\n\nconst defaultSettings: { [name: string]: Setting } = {\n // This uses contextPath set from property from server\n CONTEXT_PATH:\n serverBase ??\n (typeof window !== \"undefined\" && window.contextPath\n ? window.contextPath\n : \"/BeInformed\"),\n\n // Indicates if contributions should be cached\n CACHE_CONTRIBUTIONS: true,\n\n // Debug missing i18n messages in layout\n DEBUG_I18N_MESSAGE_NOT_FOUND: true,\n\n // Time to show the notification bar\n HIDE_NOTIFICATION_TIMEOUT: 5000,\n\n // Always commit form, does not show result pages for instruments\n ALWAYS_COMMIT_FORM: false,\n\n // Render instrument and event question labels on forms (might result in duplicate labels)\n RENDER_QUESTION_LABELS: true,\n\n // Render mandatory indications on attributes\n RENDER_MANDATORY_ATTRIBUTE_INDICATION: true,\n\n // Render optional indications on attributes\n RENDER_OPTIONAL_ATTRIBUTE_INDICATION: false,\n\n // Renders a toggle with supported list views, options are ListView and TableView\n AVAILABLE_LIST_VIEWS: [\"ListView\", \"TableView\"],\n\n // Toggle client side validation\n USE_CLIENTSIDE_VALIDATION: true,\n\n // Indicates if server validation should be used when a form field is changed\n USE_INSTANT_SERVER_VALIDATION: true,\n\n // Indicates which locales are enabled\n ENABLED_LOCALES: [\"en\", \"nl\"],\n\n // Renders the global log in page\n RENDER_GLOBAL_LOGIN_PAGE: false,\n\n // Renders the global log out page\n RENDER_GLOBAL_LOGOUT_PAGE: false,\n\n // Renders the login variants as option on the global logout page\n RENDER_MULTI_LOGIN_ON_GLOBAL_LOGOUT_PAGE: false,\n\n // Path to login page / component\n LOGIN_PATH: \"/signin\",\n\n // Path to administrator login page / component\n ADMINISTRATOR_LOGIN_PATH: \"\",\n\n // Path to logout page / component\n LOGOUT_PATH: \"/signout\",\n\n // Render forms in a modal\n RENDER_FORMS_IN_MODAL: true,\n\n // Wait timeout before rendering submit wait icon\n SHOW_SUBMIT_WAIT_TIMEOUT: 300,\n\n // Swim lane diagram configuration file\n SWIM_LANE_DIAGRAM_CONFIGURATION: \"/Library/Diagrams/Overviews.json\",\n\n // Business scenario concept types\n BUSINESS_SCENARIO_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/BusinessScenario\",\n ],\n BUSINESS_SCENARIO_STEP_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/ScenarioStep\",\n ],\n BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/Persona\",\n ],\n\n // indicates on what day the week starts (0 = Sunday)\n CALENDAR_WEEK_STARTS_ON: 1,\n\n // indicates which date indicates the first week of the year\n CALENDAR_FIRST_WEEK_CONTAINS_DATE: 1,\n\n // parameters that are added for the ui state, but should not be send to the modular ui\n UI_PARAMETERS: [],\n\n // disable hide-when-empty hint for layouts running on Be Informed versions older than 21.1\n ALLOW_HIDE_WHEN_EMPTY_ON_TABS: true,\n\n // reload the complete page on signout, usefull when third party authentication is in place\n PAGE_RELOAD_ON_UNAUTHORIZED_ERROR: false,\n\n XHR_TIMEOUT_MS: 300000,\n\n HIDE_WHEN_EMPTY_IGNORE_TASKS: false,\n};\n\nlet settings = defaultSettings;\n\n/**\n */\nexport const setSettings = (config: Object) => {\n if (isPlainObject(config)) {\n settings = Object.assign(defaultSettings, config);\n }\n};\n\n/**\n */\nexport const getSetting = (key: string, defaultValue?: any): any => {\n if (!has(settings, key) && defaultValue === undefined) {\n throw new Error(\n `Setting with name ${key} not found and no defaultValue given`\n );\n }\n\n return settings[key] ?? defaultValue;\n};\n\n/**\n */\nexport const setSetting = (key: string, value: any) => {\n settings[key] = value;\n};\n\n/**\n */\nexport const allSettings = (): { [name: string]: Setting } => settings;\n\n/**\n * Indicates if contributions must be cached\n */\nexport const cacheContributions = (): boolean =>\n getSetting(\"CACHE_CONTRIBUTIONS\", true);\n\n/**\n * Base path\n * This uses contextPath set from property from server\n * When requesting a remote server with CORS enabled, add the origin, for example:\n * export const BEINFORMED_PATH = 'http://192.168.128.61:8080/BeInformed';\n */\nexport const getBasePath = (): string =>\n getSetting(\"CONTEXT_PATH\", \"/BeInformed\");\n\n/**\n * Path to upload service\n */\nexport const getUploadPath = (): string => `${getBasePath()}${UPLOAD_PATH}`;\n\n/**\n * Path to captcha service\n */\nexport const getCaptchaPath = (): string => `${getBasePath()}${CAPTCHA_PATH}`;\n\n/**\n */\nexport const hasAllContentInData = (): boolean =>\n getSetting(ALL_CONTENT_IN_DATA_SETTING, true);\n\n/**\n * Login type, only available when pac4j is configured\n *\n * Preview does not support pac4j, thus is probably not configured when started, which results in login type JAAS\n */\nexport const loginType = (): string =>\n getSetting(LOGIN_TYPE, INTERNAL_LOGIN_TYPE.JAAS);\n\n/**\n */\nexport const loginPath = (): string =>\n getSetting(LOGIN_PATH_SETTING, \"/callback?client_name=FormClient\");\n/**\n */\nexport const loginUsernameField = (): string =>\n getSetting(LOGIN_USERNAME_SETTING, \"j_username\");\n/**\n */\nexport const loginPasswordField = (): string =>\n getSetting(LOGIN_PASSWORD_SETTING, \"j_password\");\n/**\n */\nexport const logoutPath = (): string =>\n getSetting(LOGOUT_PATH_SETTING, \"/logout\");\n\nexport const LOGIN_PATH: string = loginPath();\nexport const LOGOUT_PATH: string = logoutPath();\n\n/**\n * Model overview swim lane configuration\n */\nexport const getSwimLaneDiagramConfiguration: Object = () => {\n let configLocation = getSetting(\n \"SWIM_LANE_DIAGRAM_CONFIGURATION\",\n \"/Library/Diagrams/Overviews.json\"\n );\n if (!configLocation.startsWith(\"/\")) {\n configLocation = `/${configLocation}`;\n }\n return getRepositoryResourceUrl(configLocation);\n};\n\n/**\n * Backwards compatible export of BASE constant\n */\nexport const BASE: string = getBasePath();\n"],"mappings":";;AACA,SAASA,aAAa,EAAEC,GAAG,QAAQ,0BAA0B;AAC7D,SAASC,wBAAwB,QAAQ,qCAAqC;AAC9E,SACEC,2BAA2B,EAC3BC,mBAAmB,EACnBC,UAAU,EACVC,kBAAkB,EAClBC,sBAAsB,EACtBC,sBAAsB,EACtBC,mBAAmB,EACnBC,WAAW,EACXC,YAAY,QACP,aAAa;AAIpB,MAAMC,UAAU,GACd,OAAOC,gBAAgB,KAAK,WAAW,GAAG,IAAI,GAAGA,gBAAgB;AAEnE,MAAMC,eAA4C,GAAG;EACnD;EACAC,YAAY,EACVH,UAA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I,CAAC;;AAElD;AACA;AACA,OAAO,MAAMC,SAAS,GAAG,MACvBf,UAAU,CAAC7C,kBAAkB,EAAE,kCAAkC,CAAC;AACpE;AACA;AACA,OAAO,MAAM6D,kBAAkB,GAAG,MAChChB,UAAU,CAAC5C,sBAAsB,EAAE,YAAY,CAAC;AAClD;AACA;AACA,OAAO,MAAM6D,kBAAkB,GAAG,MAChCjB,UAAU,CAAC3C,sBAAsB,EAAE,YAAY,CAAC;AAClD;AACA;AACA,OAAO,MAAM6D,UAAU,GAAG,MACxBlB,UAAU,CAAC1C,mBAAmB,EAAE,SAAS,CAAC;AAE5C,OAAO,MAAMuB,UAAkB,GAAGkC,SAAS,EAAE;AAC7C,OAAO,MAAMhC,WAAmB,GAAGmC,UAAU,EAAE;;AAE/C;AACA;AACA;AACA,OAAO,MAAMC,+BAAuC,GAAG,MAAM;EAC3D,IAAIC,cAAc,GAAGpB,UAAU,CAC7B,iCAAiC,EACjC,kCAAkC,CACnC;EACD,IAAI,CAAC,4BAAAoB,cAAc,OAAdA,cAAc,EAAY,GAAG,CAAC,EAAE;IACnCA,cAAc,GAAI,IAAGA,cAAe,EAAC;EACvC;EACA,OAAOrE,wBAAwB,CAACqE,cAAc,CAAC;AACjD,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMC,IAAY,GAAGZ,WAAW,EAAE"}
|
|
@@ -9,11 +9,6 @@ import DateTimeTimeFormatConstraint from "./input-constraints/DateTimeTimeFormat
|
|
|
9
9
|
import DatetimeFormatConstraint from "./input-constraints/DatetimeFormatConstraint";
|
|
10
10
|
import DateBoundaryConstraint from "./input-constraints/DateBoundaryConstraint";
|
|
11
11
|
import { ATTRIBUTE_WIDTH, ISO_DATE_FORMAT } from "../../constants";
|
|
12
|
-
import { getSetting } from "../../constants/Settings";
|
|
13
|
-
import { IGNORE_FORMAT_SETTING } from "../../constants/LayoutHints";
|
|
14
|
-
// date format of default
|
|
15
|
-
const PRODUCT_DEFAULT_DATE_FORMAT = "dd-MM-yyyy";
|
|
16
|
-
|
|
17
12
|
/**
|
|
18
13
|
*/
|
|
19
14
|
class DatetimeAttributeModel extends StringAttributeModel {
|
|
@@ -204,18 +199,7 @@ class DatetimeAttributeModel extends StringAttributeModel {
|
|
|
204
199
|
if (!this.hasDate) {
|
|
205
200
|
return "";
|
|
206
201
|
}
|
|
207
|
-
|
|
208
|
-
// setting for date input
|
|
209
|
-
const ignoreFormatSetting = this.layouthint.has(IGNORE_FORMAT_SETTING);
|
|
210
|
-
if (!ignoreFormatSetting) {
|
|
211
|
-
const dateInputFormatSetting = getSetting("DATE_INPUT_FORMAT", "");
|
|
212
|
-
if (dateInputFormatSetting) {
|
|
213
|
-
return dateInputFormatSetting;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
let format = this.format;
|
|
217
|
-
let dateFormat = this.hasTime ? _trimInstanceProperty(_context7 = format.replace(this.timeInputFormat, "")).call(_context7) : format;
|
|
218
|
-
return dateFormat;
|
|
202
|
+
return this.hasTime ? _trimInstanceProperty(_context7 = this.format.replace(this.timeInputFormat, "")).call(_context7) : this.format;
|
|
219
203
|
}
|
|
220
204
|
|
|
221
205
|
/**
|
|
@@ -225,26 +209,16 @@ class DatetimeAttributeModel extends StringAttributeModel {
|
|
|
225
209
|
if (!this.hasDate) {
|
|
226
210
|
return "";
|
|
227
211
|
}
|
|
228
|
-
|
|
229
|
-
let dateFormat = this.hasTime ? _trimInstanceProperty(_context8 = format.replace(this.timeInputFormat, "")).call(_context8) : format;
|
|
230
|
-
const readonlyFormatSetting = getSetting("DATE_READONLY_FORMAT", "");
|
|
231
|
-
if (dateFormat === PRODUCT_DEFAULT_DATE_FORMAT && readonlyFormatSetting) {
|
|
232
|
-
dateFormat = readonlyFormatSetting;
|
|
233
|
-
}
|
|
234
|
-
return dateFormat;
|
|
212
|
+
return this.hasTime ? _trimInstanceProperty(_context8 = this.format.replace(this.timeInputFormat, "")).call(_context8) : this.format;
|
|
235
213
|
}
|
|
236
214
|
|
|
237
215
|
/**
|
|
238
|
-
* return attribute placeholder or
|
|
216
|
+
* return attribute placeholder or return formatlabel without time input format from contributions
|
|
239
217
|
*/
|
|
240
218
|
get placeholder() {
|
|
241
219
|
if (this._placeholder !== "") {
|
|
242
220
|
return this._placeholder;
|
|
243
221
|
}
|
|
244
|
-
const dateInputFormatSetting = getSetting("DATE_INPUT_FORMAT", "");
|
|
245
|
-
if (dateInputFormatSetting) {
|
|
246
|
-
return dateInputFormatSetting.toLowerCase();
|
|
247
|
-
}
|
|
248
222
|
const formatLabel = this.getContribution("formatlabel", "");
|
|
249
223
|
if (this.hasDate && this.hasTime && _includesInstanceProperty(formatLabel).call(formatLabel, " ")) {
|
|
250
224
|
// return first part of formatlabel to keep placeholder matching date input
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatetimeAttributeModel.js","names":["has","DateUtil","DateTimeUtil","TimeUtil","TimestampUtil","StringAttributeModel","ConstraintCollection","DateTimeDateFormatConstraint","DateTimeTimeFormatConstraint","DatetimeFormatConstraint","DateBoundaryConstraint","ATTRIBUTE_WIDTH","ISO_DATE_FORMAT","getSetting","IGNORE_FORMAT_SETTING","PRODUCT_DEFAULT_DATE_FORMAT","DatetimeAttributeModel","constructor","attribute","attributeContributions","updateInitValue","isApplicableModel","contributions","type","formatUtil","getInitValue","value","data","length","split","hasTime","getTimeValue","timeValue","timeInputFormat","toLowerCase","setHour","setMinute","setSecond","setMilliseconds","_initvalue","_inputvalue","getInitialInputValue","_value","initValue","toFormat","inputFormat","getContribution","getInputValue","toString","inputvalue","validate","toISO","format","convertFormat","operator","hasDate","formatLabel","dateInputFormat","ignoreFormatSetting","layouthint","dateInputFormatSetting","dateFormat","replace","dateReadonlyFormat","readonlyFormatSetting","placeholder","_placeholder","timeFormatParts","push","timeFormat","join","timeReadonlyFormat","dateInputValue","timeInputValue","formatValue","hasFormat","dateTimeReadonlyFormat","readonlyvalue","mindate","maxdate","addServerError","error","id","message","properties","_errorCollection","getFormatConstraint","addConstraints","constraints","add","readonlyWidth","SMALL","MEDIUM"],"sources":["../../../src/models/attributes/DatetimeAttributeModel.js"],"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\";\nimport { IGNORE_FORMAT_SETTING } from \"../../constants/LayoutHints\";\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 ignoreFormatSetting = this.layouthint.has(IGNORE_FORMAT_SETTING);\n if (!ignoreFormatSetting) {\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, layouthint } = error;\n if (properties && has(properties, \"format\") && this.formatLabel) {\n properties.format = this.formatLabel;\n }\n\n this._errorCollection.addServerError(id, message, properties, layouthint);\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"],"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CAACE,EAAE,EAAEC,OAAO,EAAEC,UAAU,EAAEzB,UAAU,CAAC;EAC3E;;EAEA;AACF;EACE2B,mBAAmB,GAAqB;IACtC,QAAQ,IAAI,CAAC/D,IAAI;MACf,KAAK,MAAM;QACT,OAAO,IAAIhB,4BAA4B,CACrC,IAAI,CAACkD,eAAe,EACpB,IAAI,CAACD,WAAW,CACjB;MACH,KAAK,MAAM;QACT,OAAO,IAAIhD,4BAA4B,CACrC,IAAI,CAACyB,eAAe,EACpB,IAAI,CAACuB,WAAW,CACjB;MACH;QACE,OAAO,IAAI/C,wBAAwB,CACjC,IAAI,CAACc,IAAI,EACT,IAAI,CAACsB,WAAW,EAChB,IAAI,CAACW,WAAW,CACjB;IAAC;EAER;;EAEA;AACF;AACA;EACE+B,cAAc,GAAyB;IACrC,MAAMC,WAAW,GAAG,IAAIlF,oBAAoB,EAAE;IAE9CkF,WAAW,CAACC,GAAG,CAAC,IAAI,CAACH,mBAAmB,EAAE,CAAC;IAE3C,IAAI,IAAI,CAACR,OAAO,IAAI,IAAI,CAACC,OAAO,EAAE;MAChCS,WAAW,CAACC,GAAG,CACb,IAAI/E,sBAAsB,CACxB,IAAI,CAACa,IAAI,EACT,IAAI,CAACuD,OAAO,EACZ,IAAI,CAACC,OAAO,EACZ,IAAI,CAAClC,WAAW,CACjB,CACF;IACH;IAEA,OAAO2C,WAAW;EACpB;;EAEA;AACF;EACE,IAAIE,aAAa,GAAkC;IACjD,IAAI,IAAI,CAACnE,IAAI,KAAK,MAAM,IAAI,IAAI,CAACA,IAAI,KAAK,MAAM,EAAE;MAChD,OAAOZ,eAAe,CAACgF,KAAK;IAC9B;IAEA,OAAOhF,eAAe,CAACiF,MAAM;EAC/B;AACF;AAEA,eAAe5E,sBAAsB"}
|
|
1
|
+
{"version":3,"file":"DatetimeAttributeModel.js","names":["has","DateUtil","DateTimeUtil","TimeUtil","TimestampUtil","StringAttributeModel","ConstraintCollection","DateTimeDateFormatConstraint","DateTimeTimeFormatConstraint","DatetimeFormatConstraint","DateBoundaryConstraint","ATTRIBUTE_WIDTH","ISO_DATE_FORMAT","DatetimeAttributeModel","constructor","attribute","attributeContributions","updateInitValue","isApplicableModel","contributions","type","formatUtil","getInitValue","value","data","length","split","hasTime","getTimeValue","timeValue","timeInputFormat","toLowerCase","setHour","setMinute","setSecond","setMilliseconds","_initvalue","_inputvalue","getInitialInputValue","_value","initValue","toFormat","inputFormat","getContribution","getInputValue","toString","inputvalue","validate","toISO","format","convertFormat","operator","hasDate","formatLabel","dateInputFormat","replace","dateReadonlyFormat","placeholder","_placeholder","timeFormatParts","push","timeFormat","join","timeReadonlyFormat","dateInputValue","timeInputValue","formatValue","hasFormat","dateTimeReadonlyFormat","readonlyvalue","mindate","maxdate","addServerError","error","id","message","properties","layouthint","_errorCollection","getFormatConstraint","addConstraints","constraints","add","readonlyWidth","SMALL","MEDIUM"],"sources":["../../../src/models/attributes/DatetimeAttributeModel.js"],"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\";\n\nimport type { FormErrorAnchor, IConstraintModel } from \"../types\";\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 return this.hasTime\n ? this.format.replace(this.timeInputFormat, \"\").trim()\n : this.format;\n }\n\n /**\n */\n get dateReadonlyFormat(): string {\n if (!this.hasDate) {\n return \"\";\n }\n\n return this.hasTime\n ? this.format.replace(this.timeInputFormat, \"\").trim()\n : this.format;\n }\n\n /**\n * return attribute placeholder or 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 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, layouthint } = error;\n if (properties && has(properties, \"format\") && this.formatLabel) {\n properties.format = this.formatLabel;\n }\n\n this._errorCollection.addServerError(id, message, properties, layouthint);\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"],"mappings":";;AACA,SAASA,GAAG,QAAQ,6BAA6B;AAEjD,SACEC,QAAQ,EACRC,YAAY,EACZC,QAAQ,EACRC,aAAa,QACR,mCAAmC;AAE1C,OAAOC,oBAAoB,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IAAI,CAACA,IAAI,KAAK,MAAM,EAAE;MAChD,OAAOT,eAAe,CAACyE,KAAK;IAC9B;IAEA,OAAOzE,eAAe,CAAC0E,MAAM;EAC/B;AACF;AAEA,eAAexE,sBAAsB"}
|
package/esm/react-client/Init.js
CHANGED
|
@@ -9,7 +9,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
9
9
|
const Init = _ref => {
|
|
10
10
|
let {
|
|
11
11
|
store,
|
|
12
|
-
|
|
12
|
+
routerHistory,
|
|
13
13
|
contextPath,
|
|
14
14
|
theme,
|
|
15
15
|
children,
|
|
@@ -23,7 +23,7 @@ const Init = _ref => {
|
|
|
23
23
|
children: /*#__PURE__*/_jsx(ErrorBoundary, {
|
|
24
24
|
FallbackComponent: ErrorFallbackComponent,
|
|
25
25
|
children: /*#__PURE__*/_jsx(Router, {
|
|
26
|
-
history:
|
|
26
|
+
history: routerHistory,
|
|
27
27
|
basename: contextPath,
|
|
28
28
|
children: children
|
|
29
29
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Init.js","names":["Provider","HelmetProvider","Router","ThemeProvider","ErrorBoundary","Init","store","
|
|
1
|
+
{"version":3,"file":"Init.js","names":["Provider","HelmetProvider","Router","ThemeProvider","ErrorBoundary","Init","store","routerHistory","contextPath","theme","children","ErrorFallbackComponent","displayName"],"sources":["../../src/react-client/Init.js"],"sourcesContent":["// @flow\nimport { Provider } from \"react-redux\";\nimport { HelmetProvider } from \"react-helmet-async\";\nimport { Router } from \"react-router\";\n\nimport ThemeProvider from \"../react-theme/ThemeProvider\";\nimport ErrorBoundary from \"../react/ErrorBoundary\";\n\nimport type { ComponentType, Node } from \"react\";\nimport type { RouterHistory } from \"react-router\";\nimport type { Theme } from \"../react-theme/types\";\nimport type { ReduxStore } from \"../redux/types\";\nimport type { Props as FallbackProps } from \"../react/ErrorBoundaryFallback\";\n\nexport type Props = {\n +store: ReduxStore,\n +routerHistory: RouterHistory,\n +contextPath: string,\n +theme?: Theme | Array<Theme>,\n +children: ?Node,\n +ErrorFallbackComponent?: ComponentType<FallbackProps>,\n};\n\n/**\n */\nconst Init = ({\n store,\n routerHistory,\n contextPath,\n theme,\n children,\n ErrorFallbackComponent,\n}: Props): Node => (\n <Provider store={store}>\n <ThemeProvider theme={theme}>\n <HelmetProvider>\n <ErrorBoundary FallbackComponent={ErrorFallbackComponent}>\n <Router history={routerHistory} basename={contextPath}>\n {children}\n </Router>\n </ErrorBoundary>\n </HelmetProvider>\n </ThemeProvider>\n </Provider>\n);\n\nInit.displayName = \"BI.Init\";\n\nexport default Init;\n"],"mappings":"AACA,SAASA,QAAQ,QAAQ,aAAa;AACtC,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,MAAM,QAAQ,cAAc;AAErC,OAAOC,aAAa,MAAM,8BAA8B;AACxD,OAAOC,aAAa,MAAM,wBAAwB;AAAC;AAiBnD;AACA;AACA,MAAMC,IAAI,GAAG;EAAA,IAAC;IACZC,KAAK;IACLC,aAAa;IACbC,WAAW;IACXC,KAAK;IACLC,QAAQ;IACRC;EACK,CAAC;EAAA,oBACN,KAAC,QAAQ;IAAC,KAAK,EAAEL,KAAM;IAAA,uBACrB,KAAC,aAAa;MAAC,KAAK,EAAEG,KAAM;MAAA,uBAC1B,KAAC,cAAc;QAAA,uBACb,KAAC,aAAa;UAAC,iBAAiB,EAAEE,sBAAuB;UAAA,uBACvD,KAAC,MAAM;YAAC,OAAO,EAAEJ,aAAc;YAAC,QAAQ,EAAEC,WAAY;YAAA,UACnDE;UAAQ;QACF;MACK;IACD;EACH,EACP;AAAA,CACZ;AAEDL,IAAI,CAACO,WAAW,GAAG,SAAS;AAE5B,eAAeP,IAAI"}
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import _trimInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/trim";
|
|
2
|
-
|
|
3
|
-
import elementClosest from "element-closest";
|
|
4
|
-
elementClosest(window);
|
|
5
|
-
|
|
6
|
-
/* polyfill for focus-visible */
|
|
7
|
-
import "focus-visible";
|
|
8
|
-
import { hydrate, render as reactRender } from "react-dom";
|
|
2
|
+
import { hydrate, render } from "react-dom";
|
|
9
3
|
import { has } from "../utils/helpers/objects";
|
|
10
4
|
import setImmediate from "setimmediate";
|
|
11
5
|
import Cache from "../utils/browser/Cache";
|
|
@@ -25,8 +19,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
25
19
|
/*
|
|
26
20
|
* deserialize serialized data from the server to provide a smooth dehydration.
|
|
27
21
|
*/
|
|
28
|
-
/**
|
|
29
|
-
*/
|
|
30
22
|
const parseDataToJSON = data => {
|
|
31
23
|
try {
|
|
32
24
|
return JSON.parse(data);
|
|
@@ -34,22 +26,41 @@ const parseDataToJSON = data => {
|
|
|
34
26
|
throw new JsonParseException(`Error parsing content ${data}`);
|
|
35
27
|
}
|
|
36
28
|
};
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Mount the webapplication to the DOM, used client side when JavaScript is enabled.
|
|
40
|
-
*/
|
|
41
|
-
const client = props => {
|
|
29
|
+
const getDataFromServer = () => {
|
|
42
30
|
var _context;
|
|
43
|
-
if (typeof window.contextPath === "undefined") {
|
|
44
|
-
throw new Error("Missing contextPath on window object");
|
|
45
|
-
}
|
|
46
31
|
const dataElement = document.querySelector('script[type="application/json"][data-app-state="app-json"]');
|
|
47
32
|
if (!dataElement) {
|
|
48
33
|
throw new Error("Error loading state, json not found");
|
|
49
34
|
} else if (_trimInstanceProperty(_context = dataElement.textContent).call(_context) === "") {
|
|
50
|
-
return;
|
|
35
|
+
return {};
|
|
36
|
+
}
|
|
37
|
+
return parseDataToJSON(dataElement.textContent);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
*/
|
|
42
|
+
export const setUnhandledRejectionEvent = store => {
|
|
43
|
+
window.onunhandledrejection = event => {
|
|
44
|
+
if (event.detail) {
|
|
45
|
+
return setImmediate(() => {
|
|
46
|
+
const errorMessage = event.detail.reason.message.toString();
|
|
47
|
+
store.dispatch(showXHRErrorNotification(errorMessage));
|
|
48
|
+
throw event.detail.reason;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return event;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
*/
|
|
57
|
+
export const setupClient = function () {
|
|
58
|
+
let customReducers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
59
|
+
let beforeRenderHooks = arguments.length > 1 ? arguments[1] : undefined;
|
|
60
|
+
if (typeof window.contextPath === "undefined") {
|
|
61
|
+
throw new Error("Missing contextPath on window object");
|
|
51
62
|
}
|
|
52
|
-
const data =
|
|
63
|
+
const data = getDataFromServer();
|
|
53
64
|
|
|
54
65
|
// remove all resources from cache
|
|
55
66
|
Cache.clear("^res:");
|
|
@@ -59,9 +70,9 @@ const client = props => {
|
|
|
59
70
|
basename: getBasePath()
|
|
60
71
|
});
|
|
61
72
|
const {
|
|
62
|
-
|
|
73
|
+
routerHistory,
|
|
63
74
|
store
|
|
64
|
-
} = configureStore(browserHistory,
|
|
75
|
+
} = configureStore(browserHistory, customReducers, rehydrate(data));
|
|
65
76
|
setAllContentInDataSetting(store.getState());
|
|
66
77
|
setLoginPreferences(store.getState());
|
|
67
78
|
|
|
@@ -72,7 +83,7 @@ const client = props => {
|
|
|
72
83
|
}
|
|
73
84
|
});
|
|
74
85
|
if (has(data, "error.name")) {
|
|
75
|
-
const error = new FetchException(data
|
|
86
|
+
const error = new FetchException(data?.error?.response);
|
|
76
87
|
store.dispatch(handleError(error));
|
|
77
88
|
}
|
|
78
89
|
if (Cache.getItem("auth")) {
|
|
@@ -80,53 +91,69 @@ const client = props => {
|
|
|
80
91
|
}
|
|
81
92
|
|
|
82
93
|
// listen to history change and update the redux router store
|
|
83
|
-
|
|
94
|
+
routerHistory.listen((location, action) => {
|
|
84
95
|
store.dispatch(locationChange(location, action));
|
|
85
96
|
});
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
*/
|
|
89
|
-
window.onunhandledrejection = event => {
|
|
90
|
-
if (event.detail) {
|
|
91
|
-
return setImmediate(() => {
|
|
92
|
-
const errorMessage = event.detail.reason.message.toString();
|
|
93
|
-
store.dispatch(showXHRErrorNotification(errorMessage));
|
|
94
|
-
throw event.detail.reason;
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
return event;
|
|
98
|
-
};
|
|
97
|
+
setUnhandledRejectionEvent(store);
|
|
99
98
|
if (document.body) {
|
|
100
99
|
document.body.className = "js";
|
|
101
100
|
}
|
|
102
|
-
if (
|
|
103
|
-
handleBeforeRenderHooks(
|
|
101
|
+
if (beforeRenderHooks) {
|
|
102
|
+
handleBeforeRenderHooks(beforeRenderHooks, {
|
|
104
103
|
store
|
|
105
104
|
});
|
|
106
105
|
}
|
|
107
|
-
|
|
106
|
+
return {
|
|
107
|
+
store,
|
|
108
|
+
routerHistory
|
|
109
|
+
};
|
|
108
110
|
};
|
|
109
111
|
|
|
110
112
|
/**
|
|
111
113
|
*/
|
|
112
|
-
const addContentLoadedEvent = (store,
|
|
114
|
+
export const addContentLoadedEvent = (store, routerHistory, theme, render, ErrorFallbackComponent, mount) => {
|
|
113
115
|
window.addEventListener("DOMContentLoaded", () => {
|
|
114
116
|
const applicationNode = document.querySelector("#application");
|
|
115
|
-
if (applicationNode) {
|
|
116
|
-
const isSSR = applicationNode.querySelector(".application");
|
|
117
|
-
const mount = isSSR ? hydrate : reactRender;
|
|
118
|
-
mount( /*#__PURE__*/_jsx(Init, {
|
|
119
|
-
store: store,
|
|
120
|
-
history: history,
|
|
121
|
-
contextPath: window.contextPath,
|
|
122
|
-
theme: theme,
|
|
123
|
-
ErrorFallbackComponent: ErrorFallbackComponent,
|
|
124
|
-
children: render()
|
|
125
|
-
}), applicationNode);
|
|
126
|
-
} else {
|
|
117
|
+
if (!applicationNode) {
|
|
127
118
|
throw new Error("No DOM element with id application found to attach client to");
|
|
128
119
|
}
|
|
120
|
+
mount(applicationNode, /*#__PURE__*/_jsx(Init, {
|
|
121
|
+
store: store,
|
|
122
|
+
routerHistory: routerHistory,
|
|
123
|
+
contextPath: window.contextPath,
|
|
124
|
+
theme: theme,
|
|
125
|
+
ErrorFallbackComponent: ErrorFallbackComponent,
|
|
126
|
+
children: render()
|
|
127
|
+
}));
|
|
129
128
|
});
|
|
130
129
|
};
|
|
131
|
-
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
*/
|
|
133
|
+
const mountClient = (applicationNode, initComponent) => {
|
|
134
|
+
const isSSR = applicationNode.querySelector(".application");
|
|
135
|
+
if (isSSR) {
|
|
136
|
+
hydrate(initComponent, applicationNode);
|
|
137
|
+
} else {
|
|
138
|
+
render(initComponent, applicationNode);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Mount the webapplication to the DOM, setup redux store and caches, add unhandledRejectionEvent, used client side when JavaScript is enabled.
|
|
144
|
+
*/
|
|
145
|
+
export const client = _ref => {
|
|
146
|
+
let {
|
|
147
|
+
customReducers,
|
|
148
|
+
theme,
|
|
149
|
+
render,
|
|
150
|
+
beforeRenderHooks,
|
|
151
|
+
ErrorFallbackComponent
|
|
152
|
+
} = _ref;
|
|
153
|
+
const {
|
|
154
|
+
store,
|
|
155
|
+
routerHistory
|
|
156
|
+
} = setupClient(customReducers, beforeRenderHooks);
|
|
157
|
+
addContentLoadedEvent(store, routerHistory, theme, render, ErrorFallbackComponent, mountClient);
|
|
158
|
+
};
|
|
132
159
|
//# sourceMappingURL=client.js.map
|