@deviceinsight/ng-ui-components 7.23.0 → 7.24.0

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/dist/index.cjs CHANGED
@@ -17,7 +17,7 @@ var __copyProps = (to, from, except, desc) => {
17
17
  }
18
18
  return to;
19
19
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
21
21
  value: mod,
22
22
  enumerable: true
23
23
  }) : target, mod));
@@ -94,8 +94,10 @@ var setGlobalErrorMessageBoxOptions = (options) => {
94
94
  globalErrorMessageBoxOptions = options;
95
95
  };
96
96
  var storeGroupName = (groupName, toastId) => {
97
- if (groupName) if (groupNamesToToastIds[groupName]) groupNamesToToastIds[groupName] = [...groupNamesToToastIds[groupName], toastId];
98
- else groupNamesToToastIds[groupName] = [toastId];
97
+ if (groupName) {
98
+ if (groupNamesToToastIds[groupName]) groupNamesToToastIds[groupName] = [...groupNamesToToastIds[groupName], toastId];
99
+ else groupNamesToToastIds[groupName] = [toastId];
100
+ }
99
101
  };
100
102
  var messageBoxSuccess = (content, options, groupName) => {
101
103
  const toastId = react_toastify_unstyled.toast.success(content, {
@@ -271,8 +273,10 @@ function convertToTree({ childNodeKey, idKey, displayNameKey, typeKey, lazyLoada
271
273
  */
272
274
  function patchNode(node, patch) {
273
275
  let patchedChildren;
274
- if (patch.children !== void 0) if (node.children !== void 0) patchedChildren = [...node.children, ...patch.children];
275
- else patchedChildren = [...patch.children];
276
+ if (patch.children !== void 0) {
277
+ if (node.children !== void 0) patchedChildren = [...node.children, ...patch.children];
278
+ else patchedChildren = [...patch.children];
279
+ }
276
280
  return {
277
281
  ...node,
278
282
  ...patch,
@@ -842,8 +846,9 @@ function RouteLink({ to, confirm, className, title, children, keyboardShortcut,
842
846
  pushRoute();
843
847
  }
844
848
  };
849
+ const href = history.createHref(typeof to === "string" ? { pathname: to } : to);
845
850
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
846
- href: history.createHref(typeof to === "string" ? { pathname: to } : to),
851
+ href,
847
852
  onClick: handleClickEvent,
848
853
  className: `di route-link ${className || ""}`,
849
854
  title: title ? t(title.id, { defaultValue: title.defaultValue }) : void 0,
@@ -1084,8 +1089,9 @@ var NodeInfo = class extends react.PureComponent {
1084
1089
  }
1085
1090
  render() {
1086
1091
  const { node, node: { name }, leafNode, expanded, isLastChild, onExpand, selectionState, isLoading } = this.props;
1092
+ const selected = selectionState === SelectionState.ALL;
1087
1093
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1088
- className: `node-info ${selectionState === SelectionState.ALL ? "selected" : ""}`,
1094
+ className: `node-info ${selected ? "selected" : ""}`,
1089
1095
  children: [
1090
1096
  isLastChild !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Skeleton, { lastChild: isLastChild }),
1091
1097
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NodeImage, {
@@ -1779,10 +1785,12 @@ var ReactableTableHeader = class extends react.Component {
1779
1785
  this.getClassName = (columnDef) => {
1780
1786
  const { paginationSettings, tableName } = this.props;
1781
1787
  const className = getClassName(tableName, columnDef.name);
1782
- if (columnDef.sortable) if (columnDef.name === paginationSettings.sort.property) if (paginationSettings.sort.direction === "ASC") return `${className} sortable sortAsc`;
1783
- else return `${className} sortable sortDes`;
1784
- else return `${className} sortable`;
1785
- else return `${className}`;
1788
+ if (columnDef.sortable) {
1789
+ if (columnDef.name === paginationSettings.sort.property) {
1790
+ if (paginationSettings.sort.direction === "ASC") return `${className} sortable sortAsc`;
1791
+ else return `${className} sortable sortDes`;
1792
+ } else return `${className} sortable`;
1793
+ } else return `${className}`;
1786
1794
  };
1787
1795
  this.printLabel = (label) => {
1788
1796
  if (isTranslationDescriptor(label)) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Trans, {
@@ -2070,17 +2078,19 @@ var ReactableWithClientSidePagination = class extends react.Component {
2070
2078
  };
2071
2079
  this.handleSelectChange = (selected, item) => {
2072
2080
  const { onSelectedItemsChange, selectedItems = [], uniqueItemKey } = this.props;
2073
- if (onSelectedItemsChange) if (selected) onSelectedItemsChange(selectedItems.concat(uniqueItemKey(item)));
2074
- else onSelectedItemsChange(selectedItems.filter((key) => key !== uniqueItemKey(item)));
2075
- else console.warn("ReactableWithClientSidePagination: onSelectedItemsChange property is missing");
2081
+ if (onSelectedItemsChange) {
2082
+ if (selected) onSelectedItemsChange(selectedItems.concat(uniqueItemKey(item)));
2083
+ else onSelectedItemsChange(selectedItems.filter((key) => key !== uniqueItemKey(item)));
2084
+ } else console.warn("ReactableWithClientSidePagination: onSelectedItemsChange property is missing");
2076
2085
  };
2077
2086
  this.handleSelectAllChange = (selectedAll) => {
2078
2087
  const { onSelectedItemsChange, items, selectedItems = [], uniqueItemKey } = this.props;
2079
2088
  const { filteredItems } = this.state;
2080
2089
  const visibleItems = (filteredItems || items || []).map(uniqueItemKey);
2081
- if (onSelectedItemsChange) if (selectedAll) onSelectedItemsChange((0, lodash.uniqWith)([...selectedItems, ...visibleItems], lodash.isEqual).sort());
2082
- else onSelectedItemsChange((0, lodash.difference)(selectedItems, visibleItems));
2083
- else console.warn("ReactableWithClientSidePagination: onSelectedItemsChange property is missing");
2090
+ if (onSelectedItemsChange) {
2091
+ if (selectedAll) onSelectedItemsChange((0, lodash.uniqWith)([...selectedItems, ...visibleItems], lodash.isEqual).sort());
2092
+ else onSelectedItemsChange((0, lodash.difference)(selectedItems, visibleItems));
2093
+ } else console.warn("ReactableWithClientSidePagination: onSelectedItemsChange property is missing");
2084
2094
  };
2085
2095
  this.areSelectedAll = () => {
2086
2096
  const { items, selectedItems, uniqueItemKey } = this.props;
@@ -2120,8 +2130,9 @@ var ReactableWithClientSidePagination = class extends react.Component {
2120
2130
  }
2121
2131
  render() {
2122
2132
  const { uniqueItemKey, isLoading, columnDefs, rowDef, tableName, clickable, selectable, selectedItems, onChangeSize } = this.props;
2133
+ const finalColumnDefs = selectable ? extendColumnDefsWithCheckboxes(columnDefs, this.handleSelectChange, this.handleSelectAllChange, this.areSelectedAll(), selectedItems || [], uniqueItemKey) : columnDefs;
2123
2134
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Reactable, {
2124
- columnDefs: selectable ? extendColumnDefsWithCheckboxes(columnDefs, this.handleSelectChange, this.handleSelectAllChange, this.areSelectedAll(), selectedItems || [], uniqueItemKey) : columnDefs,
2135
+ columnDefs: finalColumnDefs,
2125
2136
  rowDef,
2126
2137
  uniqueItemKey,
2127
2138
  paginationSettings: this.state.paginationSettings,
@@ -2603,7 +2614,7 @@ var MultiMenuItem = class extends react.PureComponent {
2603
2614
  };
2604
2615
  //#endregion
2605
2616
  //#region src/components/periodpicker/components/Inputs.tsx
2606
- var ONE_HOUR = 3600 * 1e3;
2617
+ var ONE_HOUR = 36e5;
2607
2618
  function Inputs({ period, onChange, readOnly, locale, timezone }) {
2608
2619
  const [showWarningTarget, setShowWarningTarget] = (0, react.useState)("");
2609
2620
  const warningTimeoutRef = (0, react.useRef)(void 0);
@@ -2812,7 +2823,7 @@ function createLastXDays(days, timezone) {
2812
2823
  tsEnd: (0, dayjs.default)().endOf("day").valueOf()
2813
2824
  };
2814
2825
  }
2815
- var DAY_TO_MILLIS = 1e3 * 60 * 60 * 24;
2826
+ var DAY_TO_MILLIS = 864e5;
2816
2827
  function periodToDays({ tsStart, tsEnd }) {
2817
2828
  return Math.round((tsEnd - tsStart + 1) / DAY_TO_MILLIS);
2818
2829
  }
@@ -3411,9 +3422,10 @@ var Chart = class extends react.Component {
3411
3422
  }
3412
3423
  render() {
3413
3424
  const built = this.buildOptions();
3425
+ const options = this.props.updateOptions ? this.props.updateOptions(built) : built;
3414
3426
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(highcharts_react_official.default, {
3415
3427
  highcharts: highcharts.default,
3416
- options: this.props.updateOptions ? this.props.updateOptions(built) : built,
3428
+ options,
3417
3429
  containerProps: { className: this.props.className },
3418
3430
  callback: this.handleChart
3419
3431
  });
@@ -3510,12 +3522,13 @@ function useLimitStyling(limit, min, max) {
3510
3522
  if (!containerEl) throw new Error(".rc-slider-rail element missing");
3511
3523
  const disabledAreaEl = containerEl?.querySelector(`.disabled-area-element`);
3512
3524
  const sliderWidth = containerEl.getBoundingClientRect().width;
3513
- if (disabledAreaEl) if (limit == null) disabledAreaEl.remove();
3514
- else {
3515
- const width = Math.round((max - limit) / (max - min) * sliderWidth);
3516
- disabledAreaEl.style.width = `${width}px`;
3517
- }
3518
- else if (limit != null) {
3525
+ if (disabledAreaEl) {
3526
+ if (limit == null) disabledAreaEl.remove();
3527
+ else {
3528
+ const width = Math.round((max - limit) / (max - min) * sliderWidth);
3529
+ disabledAreaEl.style.width = `${width}px`;
3530
+ }
3531
+ } else if (limit != null) {
3519
3532
  const width = Math.round((max - limit) / (max - min) * sliderWidth);
3520
3533
  const disabledAreaEl = document.createElement("div");
3521
3534
  disabledAreaEl.classList.add("disabled-area-element");