@michalrakus/x-react-web-lib 1.32.9 → 1.32.10

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.
@@ -50,6 +50,7 @@ export interface XLazyDataTableProps {
50
50
  entity: string;
51
51
  stateKey?: string;
52
52
  label?: string;
53
+ labelStyle?: React.CSSProperties;
53
54
  dataKey?: string;
54
55
  rowExpansionTemplate?: (row: any, options: DataTableRowExpansionTemplate) => React.ReactNode;
55
56
  showExpandedRow?: (row: any, multilineSwitchValue: XMultilineRenderType) => boolean;
@@ -1355,7 +1355,7 @@ var XLazyDataTable = function (props) {
1355
1355
  // x-lazy-datatable-label-right-compensation - vyvazuje label, aby item-y v strede isli aspon priblizne do stredu
1356
1356
  return (react_1.default.createElement("div", null,
1357
1357
  react_1.default.createElement("div", { className: "flex justify-content-center align-items-center" },
1358
- props.label ? react_1.default.createElement("div", { className: "x-lazy-datatable-label" }, props.label) : null,
1358
+ props.label ? react_1.default.createElement("div", { className: "x-lazy-datatable-label", style: props.labelStyle }, props.label) : null,
1359
1359
  ftsInputValue ? react_1.default.createElement(XFtsInput_1.XFtsInput, { value: ftsInputValue, onChange: function (value) { return setFtsInputValue(value); } }) : null,
1360
1360
  props.showFilterButtons ? react_1.default.createElement(XButton_1.XButton, { key: "filter", icon: isMobile ? "pi pi-search" : undefined, label: !isMobile ? (0, XLocale_1.xLocaleOption)('filter') : undefined, onClick: onClickFilter }) : null,
1361
1361
  props.showFilterButtons ? react_1.default.createElement(XButton_1.XButton, { key: "resetTable", icon: isMobile ? "pi pi-ban" : undefined, label: !isMobile ? (0, XLocale_1.xLocaleOption)('resetTable') : undefined, onClick: onClickResetTable }) : null,
@@ -110,6 +110,7 @@ export declare class XUtils {
110
110
  static saveValueIntoStorage(key: string, value: any): void;
111
111
  static getValueFromStorage(key: string, initValue: any): any;
112
112
  static removeValueFromStorage(key: string): void;
113
+ static clearStorage(): void;
113
114
  static reloadIfNewVersion(): void;
114
115
  static reloadIfNewVersionNow(): Promise<void>;
115
116
  static isNewVersion(): Promise<boolean>;
@@ -749,6 +749,9 @@ var XUtils = /** @class */ (function () {
749
749
  XUtils.removeValueFromStorage = function (key) {
750
750
  sessionStorage.removeItem(key);
751
751
  };
752
+ XUtils.clearStorage = function () {
753
+ sessionStorage.clear();
754
+ };
752
755
  // hleper method used for items of XLazyDataTable (shortcut ldt)
753
756
  // static getValueFromStorageLdt(entity: string, stateKeySuffix: XStateKeySuffix, initValue: any): any {
754
757
  // return XUtils.getValueFromStorage(`xldt-state-${entity}-${stateKeySuffix}`, initValue);
@@ -834,6 +837,10 @@ var XUtils = /** @class */ (function () {
834
837
  });
835
838
  };
836
839
  XUtils.reload = function () {
840
+ // data in session may not correspond with new structures in new version
841
+ // e.g. if we add new column to XLazyDataTable, filter operator/value for this column new column is missing in data from session and application will crash
842
+ // simple solution is to clear session
843
+ XUtils.clearStorage();
837
844
  // page reload (like pressing F5 or Enter on url bar)
838
845
  // warning - if user has typed some data in form, the data will be lost
839
846
  window.location.reload();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@michalrakus/x-react-web-lib",
3
- "version": "1.32.9",
3
+ "version": "1.32.10",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "clean": "rimraf lib",