@beinformed/ui 1.58.0 → 1.58.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 CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
4
4
 
5
+ ## [1.58.1](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.58.0...v1.58.1) (2024-11-20)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **modelcatalog:** no initial state entrydate on server ([fb91f5f](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/fb91f5feaa860cbf1ce284509c07229316afeff5))
11
+
5
12
  ## [1.58.0](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.57.5...v1.58.0) (2024-11-19)
6
13
 
7
14
 
@@ -1,15 +1,8 @@
1
1
  import _URLSearchParams from "@babel/runtime-corejs3/core-js-stable/url-search-params";
2
2
  import { DateUtil } from "../../utils";
3
3
  import Cache from "../../utils/browser/Cache";
4
- const getQueryParam = paramName => {
5
- if (typeof window !== "undefined") {
6
- const urlParams = new _URLSearchParams(window.location?.search);
7
- return urlParams.get(paramName);
8
- }
9
- return null;
10
- };
11
4
  const initialState = {
12
- entryDate: getQueryParam("entryDate") || Cache.getItem("ModelCatalogEntryDate") || DateUtil.now()
5
+ entryDate: typeof window !== "undefined" ? new _URLSearchParams(window.location?.search).get("entryDate") || Cache.getItem("ModelCatalogEntryDate") || DateUtil.now() : null
13
6
  };
14
7
 
15
8
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ModelCatalogReducer.js","names":["DateUtil","Cache","getQueryParam","paramName","window","urlParams","_URLSearchParams","location","search","get","initialState","entryDate","getItem","now","ModelCatalogReducer","state","arguments","length","undefined","action","type","addItem","payload"],"sources":["../../../src/redux/reducers/ModelCatalogReducer.js"],"sourcesContent":["// @flow\nimport { DateUtil } from \"../../utils\";\nimport Cache from \"../../utils/browser/Cache\";\n\nimport type { Reducer } from \"redux\";\nimport type { ReduxAction, ModelCatalogState } from \"../types\";\n\nconst getQueryParam = (paramName: string): ?string => {\n if (typeof window !== \"undefined\") {\n const urlParams = new URLSearchParams(window.location?.search);\n return urlParams.get(paramName);\n }\n return null;\n};\n\nconst initialState: ModelCatalogState = {\n entryDate:\n getQueryParam(\"entryDate\") ||\n Cache.getItem(\"ModelCatalogEntryDate\") ||\n DateUtil.now(),\n};\n\n/**\n * Keep track of the entry date for the modelcatalog\n */\nconst ModelCatalogReducer: Reducer<ModelCatalogState, ReduxAction> = (\n state = initialState,\n action,\n) => {\n if (!action) {\n return state;\n }\n\n switch (action.type) {\n case \"UPDATE_ENTRYDATE\":\n Cache.addItem(\"ModelCatalogEntryDate\", action.payload);\n return {\n ...state,\n entryDate: action.payload,\n };\n default:\n return state;\n }\n};\n\nexport default ModelCatalogReducer;\n"],"mappings":";AACA,SAASA,QAAQ,QAAQ,aAAa;AACtC,OAAOC,KAAK,MAAM,2BAA2B;AAK7C,MAAMC,aAAa,GAAIC,SAAiB,IAAc;EACpD,IAAI,OAAOC,MAAM,KAAK,WAAW,EAAE;IACjC,MAAMC,SAAS,GAAG,IAAAC,gBAAA,CAAoBF,MAAM,CAACG,QAAQ,EAAEC,MAAM,CAAC;IAC9D,OAAOH,SAAS,CAACI,GAAG,CAACN,SAAS,CAAC;EACjC;EACA,OAAO,IAAI;AACb,CAAC;AAED,MAAMO,YAA+B,GAAG;EACtCC,SAAS,EACPT,aAAa,CAAC,WAAW,CAAC,IAC1BD,KAAK,CAACW,OAAO,CAAC,uBAAuB,CAAC,IACtCZ,QAAQ,CAACa,GAAG,CAAC;AACjB,CAAC;;AAED;AACA;AACA;AACA,MAAMC,mBAA4D,GAAG,SAAAA,CAAA,EAGhE;EAAA,IAFHC,KAAK,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGN,YAAY;EAAA,IACpBS,MAAM,GAAAH,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;EAEN,IAAI,CAACC,MAAM,EAAE;IACX,OAAOJ,KAAK;EACd;EAEA,QAAQI,MAAM,CAACC,IAAI;IACjB,KAAK,kBAAkB;MACrBnB,KAAK,CAACoB,OAAO,CAAC,uBAAuB,EAAEF,MAAM,CAACG,OAAO,CAAC;MACtD,OAAO;QACL,GAAGP,KAAK;QACRJ,SAAS,EAAEQ,MAAM,CAACG;MACpB,CAAC;IACH;MACE,OAAOP,KAAK;EAChB;AACF,CAAC;AAED,eAAeD,mBAAmB","ignoreList":[]}
1
+ {"version":3,"file":"ModelCatalogReducer.js","names":["DateUtil","Cache","initialState","entryDate","window","_URLSearchParams","location","search","get","getItem","now","ModelCatalogReducer","state","arguments","length","undefined","action","type","addItem","payload"],"sources":["../../../src/redux/reducers/ModelCatalogReducer.js"],"sourcesContent":["// @flow\nimport { DateUtil } from \"../../utils\";\nimport Cache from \"../../utils/browser/Cache\";\n\nimport type { Reducer } from \"redux\";\nimport type { ReduxAction, ModelCatalogState } from \"../types\";\n\nconst initialState: ModelCatalogState = {\n entryDate:\n typeof window !== \"undefined\"\n ? new URLSearchParams(window.location?.search).get(\"entryDate\") ||\n Cache.getItem(\"ModelCatalogEntryDate\") ||\n DateUtil.now()\n : null,\n};\n\n/**\n * Keep track of the entry date for the modelcatalog\n */\nconst ModelCatalogReducer: Reducer<ModelCatalogState, ReduxAction> = (\n state = initialState,\n action,\n) => {\n if (!action) {\n return state;\n }\n\n switch (action.type) {\n case \"UPDATE_ENTRYDATE\":\n Cache.addItem(\"ModelCatalogEntryDate\", action.payload);\n return {\n ...state,\n entryDate: action.payload,\n };\n default:\n return state;\n }\n};\n\nexport default ModelCatalogReducer;\n"],"mappings":";AACA,SAASA,QAAQ,QAAQ,aAAa;AACtC,OAAOC,KAAK,MAAM,2BAA2B;AAK7C,MAAMC,YAA+B,GAAG;EACtCC,SAAS,EACP,OAAOC,MAAM,KAAK,WAAW,GACzB,IAAAC,gBAAA,CAAoBD,MAAM,CAACE,QAAQ,EAAEC,MAAM,CAAC,CAACC,GAAG,CAAC,WAAW,CAAC,IAC7DP,KAAK,CAACQ,OAAO,CAAC,uBAAuB,CAAC,IACtCT,QAAQ,CAACU,GAAG,CAAC,CAAC,GACd;AACR,CAAC;;AAED;AACA;AACA;AACA,MAAMC,mBAA4D,GAAG,SAAAA,CAAA,EAGhE;EAAA,IAFHC,KAAK,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGX,YAAY;EAAA,IACpBc,MAAM,GAAAH,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;EAEN,IAAI,CAACC,MAAM,EAAE;IACX,OAAOJ,KAAK;EACd;EAEA,QAAQI,MAAM,CAACC,IAAI;IACjB,KAAK,kBAAkB;MACrBhB,KAAK,CAACiB,OAAO,CAAC,uBAAuB,EAAEF,MAAM,CAACG,OAAO,CAAC;MACtD,OAAO;QACL,GAAGP,KAAK;QACRT,SAAS,EAAEa,MAAM,CAACG;MACpB,CAAC;IACH;MACE,OAAOP,KAAK;EAChB;AACF,CAAC;AAED,eAAeD,mBAAmB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../src/redux/types.js"],"sourcesContent":["// @flow\nimport type { Store, DispatchAPI } from \"redux\";\n\nimport type ErrorResponse from \"../models/error/ErrorResponse\";\n\nimport type FormModel from \"../models/form/FormModel\";\nimport typeof {\n NOTIFICATION_TYPES,\n AUTOSAVE_STATUS,\n} from \"../constants/Constants\";\n\nimport type { MessageObject } from \"../i18n/types\";\nimport type {\n I18nState,\n UpdateLocaleAction,\n SetLocalesAction,\n} from \"./_i18n/types\";\nimport type {\n ModularUIState,\n ModularUIAction,\n UpdateStatusAction,\n SetModelAction,\n UpdateModelAction,\n UpdateFormAction,\n RemoveModelByKeyAction,\n ResetModularUIAction,\n InitModelAction,\n} from \"./_modularui/types\";\nimport type {\n RouterState,\n LocationChangeAction,\n PushAction,\n ReplaceAction,\n GoAction,\n GoBackAction,\n GoForwardAction,\n} from \"./_router/types\";\n\nexport type PreferenceValue =\n | null\n | string\n | boolean\n | { [key: string]: any }\n | Array<PreferenceValue>;\n\nexport type UpdateFormOptions = {\n autosubmit: boolean,\n autosave: boolean,\n autoupdate: boolean,\n forceUpdate?: boolean,\n /** Default true: Activate/deactivate the form object validate by an update */\n validate?: boolean,\n};\n\nexport type NoAction = {\n type: \"NO_ACTION\",\n};\n\nexport type SaveErrorAction = {\n type: \"SAVE_ERROR\",\n payload: ErrorResponse,\n};\n\nexport type ShowModalAction = {\n type: \"SHOW_MODAL\",\n payload: string,\n};\n\nexport type CloseModalAction = {\n type: \"CLOSE_MODAL\",\n payload: string,\n};\n\nexport type DismissNotificationAction = {\n type: \"DISMISS_NOTIFICATION\",\n};\nexport type ShowNotificationAction = {\n type: \"SHOW_NOTIFICATION\",\n payload: {\n type: $Keys<NOTIFICATION_TYPES>,\n message: MessageObject,\n error: ?ErrorResponse,\n },\n};\n\nexport type SetPreferenceAction = {\n type: \"SET_PREFERENCE\",\n payload: { [name: string]: PreferenceValue },\n};\nexport type SetPreferencesAction = {\n type: \"SET_PREFERENCES\",\n payload: { [name: string]: PreferenceValue },\n};\n\nexport type StartProgressAction = {\n type: \"START_PROGRESS\",\n};\nexport type FinishProgressAction = {\n type: \"FINISH_PROGRESS\",\n};\nexport type ResetProgressAction = {\n type: \"RESET_PROGRESS\",\n};\nexport type UpdateProgressAction = {\n type: \"UPDATE_PROGRESS\",\n payload: { percentComplete: number },\n};\n\nexport type SendAuthenticationErrorAction = {\n type: \"AUTHENTICATION_ERROR\",\n payload: string,\n};\n\nexport type ResetAuthErrorsAction = {\n type: \"AUTHENTICATION_RESET_ERRORS\",\n};\n\nexport type LoginSuccessAction = {\n type: \"AUTHENTICATION_SUCCESS\",\n};\n\nexport type ChangePasswordAction = {\n type: \"CHANGE_PASSWORD\",\n};\n\nexport type LogoutSuccessAction = {\n type: \"AUTHENTICATION_LOGOUT\",\n};\n\nexport type UpdateAutosaveAction = {\n type: \"UPDATE_AUTOSAVE_STATUS\",\n payload: {\n status: $Keys<AUTOSAVE_STATUS>,\n model: FormModel,\n },\n};\n\nexport type UpdateEntryDateAction = {\n type: \"UPDATE_ENTRYDATE\",\n payload: ISO_DATE,\n};\n\nexport type ReduxAction =\n | UpdateStatusAction\n | SetModelAction\n | InitModelAction\n | UpdateModelAction\n | UpdateFormAction\n | RemoveModelByKeyAction\n | ResetModularUIAction\n | SaveErrorAction\n | UpdateLocaleAction\n | SetLocalesAction\n | ShowModalAction\n | CloseModalAction\n | DismissNotificationAction\n | ShowNotificationAction\n | SetPreferenceAction\n | SetPreferencesAction\n | StartProgressAction\n | FinishProgressAction\n | ResetProgressAction\n | UpdateProgressAction\n | ResetAuthErrorsAction\n | SendAuthenticationErrorAction\n | LoginSuccessAction\n | ChangePasswordAction\n | LogoutSuccessAction\n | UpdateAutosaveAction\n | UpdateEntryDateAction\n | LocationChangeAction\n | PushAction\n | ReplaceAction\n | GoAction\n | GoBackAction\n | GoForwardAction\n | ModularUIAction\n | NoAction;\n\n// Redux state\nexport type AuthState = {\n +mustChangePassword: boolean,\n +error: ?string,\n};\n\nexport type ErrorState = null | ErrorResponse;\n\nexport type ModalState = {\n +key: string,\n +visible: boolean,\n +size?: string,\n};\n\nexport type ModalsState = {\n +modals: Array<ModalState>,\n};\n\nexport type NotificationState = {\n +render: boolean,\n +messageType: string | null,\n +message: MessageObject | null,\n +error: ?ErrorResponse | null,\n};\n\nexport type PreferencesState = {\n +[name: string]: PreferenceValue,\n};\n\nexport type ProgressIndicatorState = {\n +count: number,\n +timestamp: number,\n +percentComplete: number,\n};\n\nexport type ModelCatalogState = {\n entryDate: ISO_DATE,\n};\n\nexport type ReduxState = {\n +router: RouterState,\n +modularui: ModularUIState,\n +i18n: I18nState,\n +auth: AuthState,\n +modelcatalog: ModelCatalogState,\n +error: ErrorState,\n +modals: ModalsState,\n +notification: NotificationState,\n +progressindicator: ProgressIndicatorState,\n +preferences: PreferencesState,\n ...\n};\n\nexport type GetState = () => ReduxState;\nexport type ThunkAction = (dispatch: Dispatch, getState: GetState) => any;\nexport type PromiseAction = Promise<PossibleAction>;\nexport type Dispatch = DispatchAPI<PossibleAction>;\nexport type ReduxStore = Store<ReduxState, ReduxAction, Dispatch>;\n\nexport type PossibleAction = ReduxAction | ThunkAction | PromiseAction;\n\nexport type CustomReducers = { [reducerKey: string]: any };\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/redux/types.js"],"sourcesContent":["// @flow\nimport type { Store, DispatchAPI } from \"redux\";\n\nimport type ErrorResponse from \"../models/error/ErrorResponse\";\n\nimport type FormModel from \"../models/form/FormModel\";\nimport typeof {\n NOTIFICATION_TYPES,\n AUTOSAVE_STATUS,\n} from \"../constants/Constants\";\n\nimport type { MessageObject } from \"../i18n/types\";\nimport type {\n I18nState,\n UpdateLocaleAction,\n SetLocalesAction,\n} from \"./_i18n/types\";\nimport type {\n ModularUIState,\n ModularUIAction,\n UpdateStatusAction,\n SetModelAction,\n UpdateModelAction,\n UpdateFormAction,\n RemoveModelByKeyAction,\n ResetModularUIAction,\n InitModelAction,\n} from \"./_modularui/types\";\nimport type {\n RouterState,\n LocationChangeAction,\n PushAction,\n ReplaceAction,\n GoAction,\n GoBackAction,\n GoForwardAction,\n} from \"./_router/types\";\n\nexport type PreferenceValue =\n | null\n | string\n | boolean\n | { [key: string]: any }\n | Array<PreferenceValue>;\n\nexport type UpdateFormOptions = {\n autosubmit: boolean,\n autosave: boolean,\n autoupdate: boolean,\n forceUpdate?: boolean,\n /** Default true: Activate/deactivate the form object validate by an update */\n validate?: boolean,\n};\n\nexport type NoAction = {\n type: \"NO_ACTION\",\n};\n\nexport type SaveErrorAction = {\n type: \"SAVE_ERROR\",\n payload: ErrorResponse,\n};\n\nexport type ShowModalAction = {\n type: \"SHOW_MODAL\",\n payload: string,\n};\n\nexport type CloseModalAction = {\n type: \"CLOSE_MODAL\",\n payload: string,\n};\n\nexport type DismissNotificationAction = {\n type: \"DISMISS_NOTIFICATION\",\n};\nexport type ShowNotificationAction = {\n type: \"SHOW_NOTIFICATION\",\n payload: {\n type: $Keys<NOTIFICATION_TYPES>,\n message: MessageObject,\n error: ?ErrorResponse,\n },\n};\n\nexport type SetPreferenceAction = {\n type: \"SET_PREFERENCE\",\n payload: { [name: string]: PreferenceValue },\n};\nexport type SetPreferencesAction = {\n type: \"SET_PREFERENCES\",\n payload: { [name: string]: PreferenceValue },\n};\n\nexport type StartProgressAction = {\n type: \"START_PROGRESS\",\n};\nexport type FinishProgressAction = {\n type: \"FINISH_PROGRESS\",\n};\nexport type ResetProgressAction = {\n type: \"RESET_PROGRESS\",\n};\nexport type UpdateProgressAction = {\n type: \"UPDATE_PROGRESS\",\n payload: { percentComplete: number },\n};\n\nexport type SendAuthenticationErrorAction = {\n type: \"AUTHENTICATION_ERROR\",\n payload: string,\n};\n\nexport type ResetAuthErrorsAction = {\n type: \"AUTHENTICATION_RESET_ERRORS\",\n};\n\nexport type LoginSuccessAction = {\n type: \"AUTHENTICATION_SUCCESS\",\n};\n\nexport type ChangePasswordAction = {\n type: \"CHANGE_PASSWORD\",\n};\n\nexport type LogoutSuccessAction = {\n type: \"AUTHENTICATION_LOGOUT\",\n};\n\nexport type UpdateAutosaveAction = {\n type: \"UPDATE_AUTOSAVE_STATUS\",\n payload: {\n status: $Keys<AUTOSAVE_STATUS>,\n model: FormModel,\n },\n};\n\nexport type UpdateEntryDateAction = {\n type: \"UPDATE_ENTRYDATE\",\n payload: ISO_DATE,\n};\n\nexport type ReduxAction =\n | UpdateStatusAction\n | SetModelAction\n | InitModelAction\n | UpdateModelAction\n | UpdateFormAction\n | RemoveModelByKeyAction\n | ResetModularUIAction\n | SaveErrorAction\n | UpdateLocaleAction\n | SetLocalesAction\n | ShowModalAction\n | CloseModalAction\n | DismissNotificationAction\n | ShowNotificationAction\n | SetPreferenceAction\n | SetPreferencesAction\n | StartProgressAction\n | FinishProgressAction\n | ResetProgressAction\n | UpdateProgressAction\n | ResetAuthErrorsAction\n | SendAuthenticationErrorAction\n | LoginSuccessAction\n | ChangePasswordAction\n | LogoutSuccessAction\n | UpdateAutosaveAction\n | UpdateEntryDateAction\n | LocationChangeAction\n | PushAction\n | ReplaceAction\n | GoAction\n | GoBackAction\n | GoForwardAction\n | ModularUIAction\n | NoAction;\n\n// Redux state\nexport type AuthState = {\n +mustChangePassword: boolean,\n +error: ?string,\n};\n\nexport type ErrorState = null | ErrorResponse;\n\nexport type ModalState = {\n +key: string,\n +visible: boolean,\n +size?: string,\n};\n\nexport type ModalsState = {\n +modals: Array<ModalState>,\n};\n\nexport type NotificationState = {\n +render: boolean,\n +messageType: string | null,\n +message: MessageObject | null,\n +error: ?ErrorResponse | null,\n};\n\nexport type PreferencesState = {\n +[name: string]: PreferenceValue,\n};\n\nexport type ProgressIndicatorState = {\n +count: number,\n +timestamp: number,\n +percentComplete: number,\n};\n\nexport type ModelCatalogState = {\n entryDate: ISO_DATE | null,\n};\n\nexport type ReduxState = {\n +router: RouterState,\n +modularui: ModularUIState,\n +i18n: I18nState,\n +auth: AuthState,\n +modelcatalog: ModelCatalogState,\n +error: ErrorState,\n +modals: ModalsState,\n +notification: NotificationState,\n +progressindicator: ProgressIndicatorState,\n +preferences: PreferencesState,\n ...\n};\n\nexport type GetState = () => ReduxState;\nexport type ThunkAction = (dispatch: Dispatch, getState: GetState) => any;\nexport type PromiseAction = Promise<PossibleAction>;\nexport type Dispatch = DispatchAPI<PossibleAction>;\nexport type ReduxStore = Store<ReduxState, ReduxAction, Dispatch>;\n\nexport type PossibleAction = ReduxAction | ThunkAction | PromiseAction;\n\nexport type CustomReducers = { [reducerKey: string]: any };\n"],"mappings":"","ignoreList":[]}
@@ -8,15 +8,8 @@ exports.default = void 0;
8
8
  var _urlSearchParams = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/url-search-params"));
9
9
  var _utils = require("../../utils");
10
10
  var _Cache = _interopRequireDefault(require("../../utils/browser/Cache"));
11
- const getQueryParam = paramName => {
12
- if (typeof window !== "undefined") {
13
- const urlParams = new _urlSearchParams.default(window.location?.search);
14
- return urlParams.get(paramName);
15
- }
16
- return null;
17
- };
18
11
  const initialState = {
19
- entryDate: getQueryParam("entryDate") || _Cache.default.getItem("ModelCatalogEntryDate") || _utils.DateUtil.now()
12
+ entryDate: typeof window !== "undefined" ? new _urlSearchParams.default(window.location?.search).get("entryDate") || _Cache.default.getItem("ModelCatalogEntryDate") || _utils.DateUtil.now() : null
20
13
  };
21
14
 
22
15
  /**
@@ -5,19 +5,13 @@ import Cache from "../../utils/browser/Cache";
5
5
  import type { Reducer } from "redux";
6
6
  import type { ReduxAction, ModelCatalogState } from "../types";
7
7
 
8
- const getQueryParam = (paramName: string): ?string => {
9
- if (typeof window !== "undefined") {
10
- const urlParams = new URLSearchParams(window.location?.search);
11
- return urlParams.get(paramName);
12
- }
13
- return null;
14
- };
15
-
16
8
  const initialState: ModelCatalogState = {
17
9
  entryDate:
18
- getQueryParam("entryDate") ||
19
- Cache.getItem("ModelCatalogEntryDate") ||
20
- DateUtil.now(),
10
+ typeof window !== "undefined"
11
+ ? new URLSearchParams(window.location?.search).get("entryDate") ||
12
+ Cache.getItem("ModelCatalogEntryDate") ||
13
+ DateUtil.now()
14
+ : null,
21
15
  };
22
16
 
23
17
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ModelCatalogReducer.js","names":["_utils","require","_Cache","_interopRequireDefault","getQueryParam","paramName","window","urlParams","_urlSearchParams","default","location","search","get","initialState","entryDate","Cache","getItem","DateUtil","now","ModelCatalogReducer","state","arguments","length","undefined","action","type","addItem","payload","_default","exports"],"sources":["../../../src/redux/reducers/ModelCatalogReducer.js"],"sourcesContent":["// @flow\nimport { DateUtil } from \"../../utils\";\nimport Cache from \"../../utils/browser/Cache\";\n\nimport type { Reducer } from \"redux\";\nimport type { ReduxAction, ModelCatalogState } from \"../types\";\n\nconst getQueryParam = (paramName: string): ?string => {\n if (typeof window !== \"undefined\") {\n const urlParams = new URLSearchParams(window.location?.search);\n return urlParams.get(paramName);\n }\n return null;\n};\n\nconst initialState: ModelCatalogState = {\n entryDate:\n getQueryParam(\"entryDate\") ||\n Cache.getItem(\"ModelCatalogEntryDate\") ||\n DateUtil.now(),\n};\n\n/**\n * Keep track of the entry date for the modelcatalog\n */\nconst ModelCatalogReducer: Reducer<ModelCatalogState, ReduxAction> = (\n state = initialState,\n action,\n) => {\n if (!action) {\n return state;\n }\n\n switch (action.type) {\n case \"UPDATE_ENTRYDATE\":\n Cache.addItem(\"ModelCatalogEntryDate\", action.payload);\n return {\n ...state,\n entryDate: action.payload,\n };\n default:\n return state;\n }\n};\n\nexport default ModelCatalogReducer;\n"],"mappings":";;;;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAKA,MAAMG,aAAa,GAAIC,SAAiB,IAAc;EACpD,IAAI,OAAOC,MAAM,KAAK,WAAW,EAAE;IACjC,MAAMC,SAAS,GAAG,IAAAC,gBAAA,CAAAC,OAAA,CAAoBH,MAAM,CAACI,QAAQ,EAAEC,MAAM,CAAC;IAC9D,OAAOJ,SAAS,CAACK,GAAG,CAACP,SAAS,CAAC;EACjC;EACA,OAAO,IAAI;AACb,CAAC;AAED,MAAMQ,YAA+B,GAAG;EACtCC,SAAS,EACPV,aAAa,CAAC,WAAW,CAAC,IAC1BW,cAAK,CAACC,OAAO,CAAC,uBAAuB,CAAC,IACtCC,eAAQ,CAACC,GAAG,CAAC;AACjB,CAAC;;AAED;AACA;AACA;AACA,MAAMC,mBAA4D,GAAG,SAAAA,CAAA,EAGhE;EAAA,IAFHC,KAAK,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGR,YAAY;EAAA,IACpBW,MAAM,GAAAH,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;EAEN,IAAI,CAACC,MAAM,EAAE;IACX,OAAOJ,KAAK;EACd;EAEA,QAAQI,MAAM,CAACC,IAAI;IACjB,KAAK,kBAAkB;MACrBV,cAAK,CAACW,OAAO,CAAC,uBAAuB,EAAEF,MAAM,CAACG,OAAO,CAAC;MACtD,OAAO;QACL,GAAGP,KAAK;QACRN,SAAS,EAAEU,MAAM,CAACG;MACpB,CAAC;IACH;MACE,OAAOP,KAAK;EAChB;AACF,CAAC;AAAC,IAAAQ,QAAA,GAAAC,OAAA,CAAApB,OAAA,GAEaU,mBAAmB","ignoreList":[]}
1
+ {"version":3,"file":"ModelCatalogReducer.js","names":["_utils","require","_Cache","_interopRequireDefault","initialState","entryDate","window","_urlSearchParams","default","location","search","get","Cache","getItem","DateUtil","now","ModelCatalogReducer","state","arguments","length","undefined","action","type","addItem","payload","_default","exports"],"sources":["../../../src/redux/reducers/ModelCatalogReducer.js"],"sourcesContent":["// @flow\nimport { DateUtil } from \"../../utils\";\nimport Cache from \"../../utils/browser/Cache\";\n\nimport type { Reducer } from \"redux\";\nimport type { ReduxAction, ModelCatalogState } from \"../types\";\n\nconst initialState: ModelCatalogState = {\n entryDate:\n typeof window !== \"undefined\"\n ? new URLSearchParams(window.location?.search).get(\"entryDate\") ||\n Cache.getItem(\"ModelCatalogEntryDate\") ||\n DateUtil.now()\n : null,\n};\n\n/**\n * Keep track of the entry date for the modelcatalog\n */\nconst ModelCatalogReducer: Reducer<ModelCatalogState, ReduxAction> = (\n state = initialState,\n action,\n) => {\n if (!action) {\n return state;\n }\n\n switch (action.type) {\n case \"UPDATE_ENTRYDATE\":\n Cache.addItem(\"ModelCatalogEntryDate\", action.payload);\n return {\n ...state,\n entryDate: action.payload,\n };\n default:\n return state;\n }\n};\n\nexport default ModelCatalogReducer;\n"],"mappings":";;;;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAKA,MAAMG,YAA+B,GAAG;EACtCC,SAAS,EACP,OAAOC,MAAM,KAAK,WAAW,GACzB,IAAAC,gBAAA,CAAAC,OAAA,CAAoBF,MAAM,CAACG,QAAQ,EAAEC,MAAM,CAAC,CAACC,GAAG,CAAC,WAAW,CAAC,IAC7DC,cAAK,CAACC,OAAO,CAAC,uBAAuB,CAAC,IACtCC,eAAQ,CAACC,GAAG,CAAC,CAAC,GACd;AACR,CAAC;;AAED;AACA;AACA;AACA,MAAMC,mBAA4D,GAAG,SAAAA,CAAA,EAGhE;EAAA,IAFHC,KAAK,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGd,YAAY;EAAA,IACpBiB,MAAM,GAAAH,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;EAEN,IAAI,CAACC,MAAM,EAAE;IACX,OAAOJ,KAAK;EACd;EAEA,QAAQI,MAAM,CAACC,IAAI;IACjB,KAAK,kBAAkB;MACrBV,cAAK,CAACW,OAAO,CAAC,uBAAuB,EAAEF,MAAM,CAACG,OAAO,CAAC;MACtD,OAAO;QACL,GAAGP,KAAK;QACRZ,SAAS,EAAEgB,MAAM,CAACG;MACpB,CAAC;IACH;MACE,OAAOP,KAAK;EAChB;AACF,CAAC;AAAC,IAAAQ,QAAA,GAAAC,OAAA,CAAAlB,OAAA,GAEaQ,mBAAmB","ignoreList":[]}
@@ -213,7 +213,7 @@ export type ProgressIndicatorState = {
213
213
  };
214
214
 
215
215
  export type ModelCatalogState = {
216
- entryDate: ISO_DATE,
216
+ entryDate: ISO_DATE | null,
217
217
  };
218
218
 
219
219
  export type ReduxState = {
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../src/redux/types.js"],"sourcesContent":["// @flow\nimport type { Store, DispatchAPI } from \"redux\";\n\nimport type ErrorResponse from \"../models/error/ErrorResponse\";\n\nimport type FormModel from \"../models/form/FormModel\";\nimport typeof {\n NOTIFICATION_TYPES,\n AUTOSAVE_STATUS,\n} from \"../constants/Constants\";\n\nimport type { MessageObject } from \"../i18n/types\";\nimport type {\n I18nState,\n UpdateLocaleAction,\n SetLocalesAction,\n} from \"./_i18n/types\";\nimport type {\n ModularUIState,\n ModularUIAction,\n UpdateStatusAction,\n SetModelAction,\n UpdateModelAction,\n UpdateFormAction,\n RemoveModelByKeyAction,\n ResetModularUIAction,\n InitModelAction,\n} from \"./_modularui/types\";\nimport type {\n RouterState,\n LocationChangeAction,\n PushAction,\n ReplaceAction,\n GoAction,\n GoBackAction,\n GoForwardAction,\n} from \"./_router/types\";\n\nexport type PreferenceValue =\n | null\n | string\n | boolean\n | { [key: string]: any }\n | Array<PreferenceValue>;\n\nexport type UpdateFormOptions = {\n autosubmit: boolean,\n autosave: boolean,\n autoupdate: boolean,\n forceUpdate?: boolean,\n /** Default true: Activate/deactivate the form object validate by an update */\n validate?: boolean,\n};\n\nexport type NoAction = {\n type: \"NO_ACTION\",\n};\n\nexport type SaveErrorAction = {\n type: \"SAVE_ERROR\",\n payload: ErrorResponse,\n};\n\nexport type ShowModalAction = {\n type: \"SHOW_MODAL\",\n payload: string,\n};\n\nexport type CloseModalAction = {\n type: \"CLOSE_MODAL\",\n payload: string,\n};\n\nexport type DismissNotificationAction = {\n type: \"DISMISS_NOTIFICATION\",\n};\nexport type ShowNotificationAction = {\n type: \"SHOW_NOTIFICATION\",\n payload: {\n type: $Keys<NOTIFICATION_TYPES>,\n message: MessageObject,\n error: ?ErrorResponse,\n },\n};\n\nexport type SetPreferenceAction = {\n type: \"SET_PREFERENCE\",\n payload: { [name: string]: PreferenceValue },\n};\nexport type SetPreferencesAction = {\n type: \"SET_PREFERENCES\",\n payload: { [name: string]: PreferenceValue },\n};\n\nexport type StartProgressAction = {\n type: \"START_PROGRESS\",\n};\nexport type FinishProgressAction = {\n type: \"FINISH_PROGRESS\",\n};\nexport type ResetProgressAction = {\n type: \"RESET_PROGRESS\",\n};\nexport type UpdateProgressAction = {\n type: \"UPDATE_PROGRESS\",\n payload: { percentComplete: number },\n};\n\nexport type SendAuthenticationErrorAction = {\n type: \"AUTHENTICATION_ERROR\",\n payload: string,\n};\n\nexport type ResetAuthErrorsAction = {\n type: \"AUTHENTICATION_RESET_ERRORS\",\n};\n\nexport type LoginSuccessAction = {\n type: \"AUTHENTICATION_SUCCESS\",\n};\n\nexport type ChangePasswordAction = {\n type: \"CHANGE_PASSWORD\",\n};\n\nexport type LogoutSuccessAction = {\n type: \"AUTHENTICATION_LOGOUT\",\n};\n\nexport type UpdateAutosaveAction = {\n type: \"UPDATE_AUTOSAVE_STATUS\",\n payload: {\n status: $Keys<AUTOSAVE_STATUS>,\n model: FormModel,\n },\n};\n\nexport type UpdateEntryDateAction = {\n type: \"UPDATE_ENTRYDATE\",\n payload: ISO_DATE,\n};\n\nexport type ReduxAction =\n | UpdateStatusAction\n | SetModelAction\n | InitModelAction\n | UpdateModelAction\n | UpdateFormAction\n | RemoveModelByKeyAction\n | ResetModularUIAction\n | SaveErrorAction\n | UpdateLocaleAction\n | SetLocalesAction\n | ShowModalAction\n | CloseModalAction\n | DismissNotificationAction\n | ShowNotificationAction\n | SetPreferenceAction\n | SetPreferencesAction\n | StartProgressAction\n | FinishProgressAction\n | ResetProgressAction\n | UpdateProgressAction\n | ResetAuthErrorsAction\n | SendAuthenticationErrorAction\n | LoginSuccessAction\n | ChangePasswordAction\n | LogoutSuccessAction\n | UpdateAutosaveAction\n | UpdateEntryDateAction\n | LocationChangeAction\n | PushAction\n | ReplaceAction\n | GoAction\n | GoBackAction\n | GoForwardAction\n | ModularUIAction\n | NoAction;\n\n// Redux state\nexport type AuthState = {\n +mustChangePassword: boolean,\n +error: ?string,\n};\n\nexport type ErrorState = null | ErrorResponse;\n\nexport type ModalState = {\n +key: string,\n +visible: boolean,\n +size?: string,\n};\n\nexport type ModalsState = {\n +modals: Array<ModalState>,\n};\n\nexport type NotificationState = {\n +render: boolean,\n +messageType: string | null,\n +message: MessageObject | null,\n +error: ?ErrorResponse | null,\n};\n\nexport type PreferencesState = {\n +[name: string]: PreferenceValue,\n};\n\nexport type ProgressIndicatorState = {\n +count: number,\n +timestamp: number,\n +percentComplete: number,\n};\n\nexport type ModelCatalogState = {\n entryDate: ISO_DATE,\n};\n\nexport type ReduxState = {\n +router: RouterState,\n +modularui: ModularUIState,\n +i18n: I18nState,\n +auth: AuthState,\n +modelcatalog: ModelCatalogState,\n +error: ErrorState,\n +modals: ModalsState,\n +notification: NotificationState,\n +progressindicator: ProgressIndicatorState,\n +preferences: PreferencesState,\n ...\n};\n\nexport type GetState = () => ReduxState;\nexport type ThunkAction = (dispatch: Dispatch, getState: GetState) => any;\nexport type PromiseAction = Promise<PossibleAction>;\nexport type Dispatch = DispatchAPI<PossibleAction>;\nexport type ReduxStore = Store<ReduxState, ReduxAction, Dispatch>;\n\nexport type PossibleAction = ReduxAction | ThunkAction | PromiseAction;\n\nexport type CustomReducers = { [reducerKey: string]: any };\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/redux/types.js"],"sourcesContent":["// @flow\nimport type { Store, DispatchAPI } from \"redux\";\n\nimport type ErrorResponse from \"../models/error/ErrorResponse\";\n\nimport type FormModel from \"../models/form/FormModel\";\nimport typeof {\n NOTIFICATION_TYPES,\n AUTOSAVE_STATUS,\n} from \"../constants/Constants\";\n\nimport type { MessageObject } from \"../i18n/types\";\nimport type {\n I18nState,\n UpdateLocaleAction,\n SetLocalesAction,\n} from \"./_i18n/types\";\nimport type {\n ModularUIState,\n ModularUIAction,\n UpdateStatusAction,\n SetModelAction,\n UpdateModelAction,\n UpdateFormAction,\n RemoveModelByKeyAction,\n ResetModularUIAction,\n InitModelAction,\n} from \"./_modularui/types\";\nimport type {\n RouterState,\n LocationChangeAction,\n PushAction,\n ReplaceAction,\n GoAction,\n GoBackAction,\n GoForwardAction,\n} from \"./_router/types\";\n\nexport type PreferenceValue =\n | null\n | string\n | boolean\n | { [key: string]: any }\n | Array<PreferenceValue>;\n\nexport type UpdateFormOptions = {\n autosubmit: boolean,\n autosave: boolean,\n autoupdate: boolean,\n forceUpdate?: boolean,\n /** Default true: Activate/deactivate the form object validate by an update */\n validate?: boolean,\n};\n\nexport type NoAction = {\n type: \"NO_ACTION\",\n};\n\nexport type SaveErrorAction = {\n type: \"SAVE_ERROR\",\n payload: ErrorResponse,\n};\n\nexport type ShowModalAction = {\n type: \"SHOW_MODAL\",\n payload: string,\n};\n\nexport type CloseModalAction = {\n type: \"CLOSE_MODAL\",\n payload: string,\n};\n\nexport type DismissNotificationAction = {\n type: \"DISMISS_NOTIFICATION\",\n};\nexport type ShowNotificationAction = {\n type: \"SHOW_NOTIFICATION\",\n payload: {\n type: $Keys<NOTIFICATION_TYPES>,\n message: MessageObject,\n error: ?ErrorResponse,\n },\n};\n\nexport type SetPreferenceAction = {\n type: \"SET_PREFERENCE\",\n payload: { [name: string]: PreferenceValue },\n};\nexport type SetPreferencesAction = {\n type: \"SET_PREFERENCES\",\n payload: { [name: string]: PreferenceValue },\n};\n\nexport type StartProgressAction = {\n type: \"START_PROGRESS\",\n};\nexport type FinishProgressAction = {\n type: \"FINISH_PROGRESS\",\n};\nexport type ResetProgressAction = {\n type: \"RESET_PROGRESS\",\n};\nexport type UpdateProgressAction = {\n type: \"UPDATE_PROGRESS\",\n payload: { percentComplete: number },\n};\n\nexport type SendAuthenticationErrorAction = {\n type: \"AUTHENTICATION_ERROR\",\n payload: string,\n};\n\nexport type ResetAuthErrorsAction = {\n type: \"AUTHENTICATION_RESET_ERRORS\",\n};\n\nexport type LoginSuccessAction = {\n type: \"AUTHENTICATION_SUCCESS\",\n};\n\nexport type ChangePasswordAction = {\n type: \"CHANGE_PASSWORD\",\n};\n\nexport type LogoutSuccessAction = {\n type: \"AUTHENTICATION_LOGOUT\",\n};\n\nexport type UpdateAutosaveAction = {\n type: \"UPDATE_AUTOSAVE_STATUS\",\n payload: {\n status: $Keys<AUTOSAVE_STATUS>,\n model: FormModel,\n },\n};\n\nexport type UpdateEntryDateAction = {\n type: \"UPDATE_ENTRYDATE\",\n payload: ISO_DATE,\n};\n\nexport type ReduxAction =\n | UpdateStatusAction\n | SetModelAction\n | InitModelAction\n | UpdateModelAction\n | UpdateFormAction\n | RemoveModelByKeyAction\n | ResetModularUIAction\n | SaveErrorAction\n | UpdateLocaleAction\n | SetLocalesAction\n | ShowModalAction\n | CloseModalAction\n | DismissNotificationAction\n | ShowNotificationAction\n | SetPreferenceAction\n | SetPreferencesAction\n | StartProgressAction\n | FinishProgressAction\n | ResetProgressAction\n | UpdateProgressAction\n | ResetAuthErrorsAction\n | SendAuthenticationErrorAction\n | LoginSuccessAction\n | ChangePasswordAction\n | LogoutSuccessAction\n | UpdateAutosaveAction\n | UpdateEntryDateAction\n | LocationChangeAction\n | PushAction\n | ReplaceAction\n | GoAction\n | GoBackAction\n | GoForwardAction\n | ModularUIAction\n | NoAction;\n\n// Redux state\nexport type AuthState = {\n +mustChangePassword: boolean,\n +error: ?string,\n};\n\nexport type ErrorState = null | ErrorResponse;\n\nexport type ModalState = {\n +key: string,\n +visible: boolean,\n +size?: string,\n};\n\nexport type ModalsState = {\n +modals: Array<ModalState>,\n};\n\nexport type NotificationState = {\n +render: boolean,\n +messageType: string | null,\n +message: MessageObject | null,\n +error: ?ErrorResponse | null,\n};\n\nexport type PreferencesState = {\n +[name: string]: PreferenceValue,\n};\n\nexport type ProgressIndicatorState = {\n +count: number,\n +timestamp: number,\n +percentComplete: number,\n};\n\nexport type ModelCatalogState = {\n entryDate: ISO_DATE | null,\n};\n\nexport type ReduxState = {\n +router: RouterState,\n +modularui: ModularUIState,\n +i18n: I18nState,\n +auth: AuthState,\n +modelcatalog: ModelCatalogState,\n +error: ErrorState,\n +modals: ModalsState,\n +notification: NotificationState,\n +progressindicator: ProgressIndicatorState,\n +preferences: PreferencesState,\n ...\n};\n\nexport type GetState = () => ReduxState;\nexport type ThunkAction = (dispatch: Dispatch, getState: GetState) => any;\nexport type PromiseAction = Promise<PossibleAction>;\nexport type Dispatch = DispatchAPI<PossibleAction>;\nexport type ReduxStore = Store<ReduxState, ReduxAction, Dispatch>;\n\nexport type PossibleAction = ReduxAction | ThunkAction | PromiseAction;\n\nexport type CustomReducers = { [reducerKey: string]: any };\n"],"mappings":"","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beinformed/ui",
3
- "version": "1.58.0",
3
+ "version": "1.58.1",
4
4
  "description": "Toolbox for be informed javascript layouts",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "bugs": "http://support.beinformed.com",
@@ -5,19 +5,13 @@ import Cache from "../../utils/browser/Cache";
5
5
  import type { Reducer } from "redux";
6
6
  import type { ReduxAction, ModelCatalogState } from "../types";
7
7
 
8
- const getQueryParam = (paramName: string): ?string => {
9
- if (typeof window !== "undefined") {
10
- const urlParams = new URLSearchParams(window.location?.search);
11
- return urlParams.get(paramName);
12
- }
13
- return null;
14
- };
15
-
16
8
  const initialState: ModelCatalogState = {
17
9
  entryDate:
18
- getQueryParam("entryDate") ||
19
- Cache.getItem("ModelCatalogEntryDate") ||
20
- DateUtil.now(),
10
+ typeof window !== "undefined"
11
+ ? new URLSearchParams(window.location?.search).get("entryDate") ||
12
+ Cache.getItem("ModelCatalogEntryDate") ||
13
+ DateUtil.now()
14
+ : null,
21
15
  };
22
16
 
23
17
  /**
@@ -213,7 +213,7 @@ export type ProgressIndicatorState = {
213
213
  };
214
214
 
215
215
  export type ModelCatalogState = {
216
- entryDate: ISO_DATE,
216
+ entryDate: ISO_DATE | null,
217
217
  };
218
218
 
219
219
  export type ReduxState = {