@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 +40 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +40 -27
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -3
- package/package.json +14 -14
package/dist/index.js
CHANGED
|
@@ -56,7 +56,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
56
56
|
}
|
|
57
57
|
return to;
|
|
58
58
|
};
|
|
59
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
59
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
60
60
|
value: mod,
|
|
61
61
|
enumerable: true
|
|
62
62
|
}) : target, mod));
|
|
@@ -77,8 +77,10 @@ var setGlobalErrorMessageBoxOptions = (options) => {
|
|
|
77
77
|
globalErrorMessageBoxOptions = options;
|
|
78
78
|
};
|
|
79
79
|
var storeGroupName = (groupName, toastId) => {
|
|
80
|
-
if (groupName)
|
|
81
|
-
|
|
80
|
+
if (groupName) {
|
|
81
|
+
if (groupNamesToToastIds[groupName]) groupNamesToToastIds[groupName] = [...groupNamesToToastIds[groupName], toastId];
|
|
82
|
+
else groupNamesToToastIds[groupName] = [toastId];
|
|
83
|
+
}
|
|
82
84
|
};
|
|
83
85
|
var messageBoxSuccess = (content, options, groupName) => {
|
|
84
86
|
const toastId = toast.success(content, {
|
|
@@ -254,8 +256,10 @@ function convertToTree({ childNodeKey, idKey, displayNameKey, typeKey, lazyLoada
|
|
|
254
256
|
*/
|
|
255
257
|
function patchNode(node, patch) {
|
|
256
258
|
let patchedChildren;
|
|
257
|
-
if (patch.children !== void 0)
|
|
258
|
-
|
|
259
|
+
if (patch.children !== void 0) {
|
|
260
|
+
if (node.children !== void 0) patchedChildren = [...node.children, ...patch.children];
|
|
261
|
+
else patchedChildren = [...patch.children];
|
|
262
|
+
}
|
|
259
263
|
return {
|
|
260
264
|
...node,
|
|
261
265
|
...patch,
|
|
@@ -825,8 +829,9 @@ function RouteLink({ to, confirm, className, title, children, keyboardShortcut,
|
|
|
825
829
|
pushRoute();
|
|
826
830
|
}
|
|
827
831
|
};
|
|
832
|
+
const href = history.createHref(typeof to === "string" ? { pathname: to } : to);
|
|
828
833
|
return /* @__PURE__ */ jsx("a", {
|
|
829
|
-
href
|
|
834
|
+
href,
|
|
830
835
|
onClick: handleClickEvent,
|
|
831
836
|
className: `di route-link ${className || ""}`,
|
|
832
837
|
title: title ? t(title.id, { defaultValue: title.defaultValue }) : void 0,
|
|
@@ -1067,8 +1072,9 @@ var NodeInfo = class extends React.PureComponent {
|
|
|
1067
1072
|
}
|
|
1068
1073
|
render() {
|
|
1069
1074
|
const { node, node: { name }, leafNode, expanded, isLastChild, onExpand, selectionState, isLoading } = this.props;
|
|
1075
|
+
const selected = selectionState === SelectionState.ALL;
|
|
1070
1076
|
return /* @__PURE__ */ jsxs("div", {
|
|
1071
|
-
className: `node-info ${
|
|
1077
|
+
className: `node-info ${selected ? "selected" : ""}`,
|
|
1072
1078
|
children: [
|
|
1073
1079
|
isLastChild !== void 0 && /* @__PURE__ */ jsx(Skeleton, { lastChild: isLastChild }),
|
|
1074
1080
|
/* @__PURE__ */ jsx(NodeImage, {
|
|
@@ -1762,10 +1768,12 @@ var ReactableTableHeader = class extends Component {
|
|
|
1762
1768
|
this.getClassName = (columnDef) => {
|
|
1763
1769
|
const { paginationSettings, tableName } = this.props;
|
|
1764
1770
|
const className = getClassName(tableName, columnDef.name);
|
|
1765
|
-
if (columnDef.sortable)
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1771
|
+
if (columnDef.sortable) {
|
|
1772
|
+
if (columnDef.name === paginationSettings.sort.property) {
|
|
1773
|
+
if (paginationSettings.sort.direction === "ASC") return `${className} sortable sortAsc`;
|
|
1774
|
+
else return `${className} sortable sortDes`;
|
|
1775
|
+
} else return `${className} sortable`;
|
|
1776
|
+
} else return `${className}`;
|
|
1769
1777
|
};
|
|
1770
1778
|
this.printLabel = (label) => {
|
|
1771
1779
|
if (isTranslationDescriptor(label)) return /* @__PURE__ */ jsx(Trans, {
|
|
@@ -2053,17 +2061,19 @@ var ReactableWithClientSidePagination = class extends Component {
|
|
|
2053
2061
|
};
|
|
2054
2062
|
this.handleSelectChange = (selected, item) => {
|
|
2055
2063
|
const { onSelectedItemsChange, selectedItems = [], uniqueItemKey } = this.props;
|
|
2056
|
-
if (onSelectedItemsChange)
|
|
2057
|
-
|
|
2058
|
-
|
|
2064
|
+
if (onSelectedItemsChange) {
|
|
2065
|
+
if (selected) onSelectedItemsChange(selectedItems.concat(uniqueItemKey(item)));
|
|
2066
|
+
else onSelectedItemsChange(selectedItems.filter((key) => key !== uniqueItemKey(item)));
|
|
2067
|
+
} else console.warn("ReactableWithClientSidePagination: onSelectedItemsChange property is missing");
|
|
2059
2068
|
};
|
|
2060
2069
|
this.handleSelectAllChange = (selectedAll) => {
|
|
2061
2070
|
const { onSelectedItemsChange, items, selectedItems = [], uniqueItemKey } = this.props;
|
|
2062
2071
|
const { filteredItems } = this.state;
|
|
2063
2072
|
const visibleItems = (filteredItems || items || []).map(uniqueItemKey);
|
|
2064
|
-
if (onSelectedItemsChange)
|
|
2065
|
-
|
|
2066
|
-
|
|
2073
|
+
if (onSelectedItemsChange) {
|
|
2074
|
+
if (selectedAll) onSelectedItemsChange(uniqWith([...selectedItems, ...visibleItems], isEqual).sort());
|
|
2075
|
+
else onSelectedItemsChange(difference(selectedItems, visibleItems));
|
|
2076
|
+
} else console.warn("ReactableWithClientSidePagination: onSelectedItemsChange property is missing");
|
|
2067
2077
|
};
|
|
2068
2078
|
this.areSelectedAll = () => {
|
|
2069
2079
|
const { items, selectedItems, uniqueItemKey } = this.props;
|
|
@@ -2103,8 +2113,9 @@ var ReactableWithClientSidePagination = class extends Component {
|
|
|
2103
2113
|
}
|
|
2104
2114
|
render() {
|
|
2105
2115
|
const { uniqueItemKey, isLoading, columnDefs, rowDef, tableName, clickable, selectable, selectedItems, onChangeSize } = this.props;
|
|
2116
|
+
const finalColumnDefs = selectable ? extendColumnDefsWithCheckboxes(columnDefs, this.handleSelectChange, this.handleSelectAllChange, this.areSelectedAll(), selectedItems || [], uniqueItemKey) : columnDefs;
|
|
2106
2117
|
return /* @__PURE__ */ jsx(Reactable, {
|
|
2107
|
-
columnDefs:
|
|
2118
|
+
columnDefs: finalColumnDefs,
|
|
2108
2119
|
rowDef,
|
|
2109
2120
|
uniqueItemKey,
|
|
2110
2121
|
paginationSettings: this.state.paginationSettings,
|
|
@@ -2586,7 +2597,7 @@ var MultiMenuItem = class extends React.PureComponent {
|
|
|
2586
2597
|
};
|
|
2587
2598
|
//#endregion
|
|
2588
2599
|
//#region src/components/periodpicker/components/Inputs.tsx
|
|
2589
|
-
var ONE_HOUR =
|
|
2600
|
+
var ONE_HOUR = 36e5;
|
|
2590
2601
|
function Inputs({ period, onChange, readOnly, locale, timezone }) {
|
|
2591
2602
|
const [showWarningTarget, setShowWarningTarget] = useState("");
|
|
2592
2603
|
const warningTimeoutRef = useRef(void 0);
|
|
@@ -2795,7 +2806,7 @@ function createLastXDays(days, timezone) {
|
|
|
2795
2806
|
tsEnd: dayjs().endOf("day").valueOf()
|
|
2796
2807
|
};
|
|
2797
2808
|
}
|
|
2798
|
-
var DAY_TO_MILLIS =
|
|
2809
|
+
var DAY_TO_MILLIS = 864e5;
|
|
2799
2810
|
function periodToDays({ tsStart, tsEnd }) {
|
|
2800
2811
|
return Math.round((tsEnd - tsStart + 1) / DAY_TO_MILLIS);
|
|
2801
2812
|
}
|
|
@@ -3394,9 +3405,10 @@ var Chart = class extends Component {
|
|
|
3394
3405
|
}
|
|
3395
3406
|
render() {
|
|
3396
3407
|
const built = this.buildOptions();
|
|
3408
|
+
const options = this.props.updateOptions ? this.props.updateOptions(built) : built;
|
|
3397
3409
|
return /* @__PURE__ */ jsx(HighchartsReact, {
|
|
3398
3410
|
highcharts: Highcharts,
|
|
3399
|
-
options
|
|
3411
|
+
options,
|
|
3400
3412
|
containerProps: { className: this.props.className },
|
|
3401
3413
|
callback: this.handleChart
|
|
3402
3414
|
});
|
|
@@ -3493,12 +3505,13 @@ function useLimitStyling(limit, min, max) {
|
|
|
3493
3505
|
if (!containerEl) throw new Error(".rc-slider-rail element missing");
|
|
3494
3506
|
const disabledAreaEl = containerEl?.querySelector(`.disabled-area-element`);
|
|
3495
3507
|
const sliderWidth = containerEl.getBoundingClientRect().width;
|
|
3496
|
-
if (disabledAreaEl)
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3508
|
+
if (disabledAreaEl) {
|
|
3509
|
+
if (limit == null) disabledAreaEl.remove();
|
|
3510
|
+
else {
|
|
3511
|
+
const width = Math.round((max - limit) / (max - min) * sliderWidth);
|
|
3512
|
+
disabledAreaEl.style.width = `${width}px`;
|
|
3513
|
+
}
|
|
3514
|
+
} else if (limit != null) {
|
|
3502
3515
|
const width = Math.round((max - limit) / (max - min) * sliderWidth);
|
|
3503
3516
|
const disabledAreaEl = document.createElement("div");
|
|
3504
3517
|
disabledAreaEl.classList.add("disabled-area-element");
|