@deviceinsight/ng-ui-components 7.23.0 → 7.25.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/README.md +52 -73
- package/dist/index.cjs +43 -71
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +42 -91
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -3
- package/dist/types/components/slider/RcSliderWithTooltip.d.ts.map +1 -1
- package/package.json +16 -15
package/README.md
CHANGED
|
@@ -95,9 +95,10 @@ npx yalc link "@deviceinsight/ng-ui-components"
|
|
|
95
95
|
|
|
96
96
|
# CI
|
|
97
97
|
|
|
98
|
-
`.gitlab-ci.yml` installs the dependencies and then runs `test`, `
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
`.gitlab-ci.yml` installs the dependencies and then runs `test`, `lint` and `typecheck`
|
|
99
|
+
on every branch except `main`. The `audit` job (`npm run scan`) only runs on `develop`,
|
|
100
|
+
`feature/*` and `renovate/*` branches, so hotfixes and tags are not blocked by it. On `develop` the
|
|
101
|
+
`pages` job publishes the static Storybook to GitLab Pages. The `publish` job runs for `develop` and for tags:
|
|
101
102
|
`-SNAPSHOT` versions are published to the internal Nexus registry under the `next`
|
|
102
103
|
tag, releases go to the public npm registry. A release older than the currently
|
|
103
104
|
published `latest` is published under a `hotfix-<major>.<minor>` tag so that `latest`
|
|
@@ -118,77 +119,55 @@ After git flow is installed, the repo needs to be initialized. Run `git flow ini
|
|
|
118
119
|
question with the default (press Enter/Return). The script verifies that the branches
|
|
119
120
|
are named `main` and `develop`.
|
|
120
121
|
|
|
121
|
-
##
|
|
122
|
+
## Releasing the develop branch
|
|
122
123
|
|
|
123
|
-
|
|
124
|
+
Run the release script from the repository root:
|
|
124
125
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
Vulnerabilities can occur at any time.
|
|
128
|
-
To be sure, the pipeline for the branches and the tags created
|
|
129
|
-
in the release process will not fail, the script runs the checks locally before building the
|
|
130
|
-
release:
|
|
131
|
-
|
|
132
|
-
```
|
|
133
|
-
npm install
|
|
134
|
-
npm run scan
|
|
135
|
-
npm run test
|
|
126
|
+
```shell
|
|
127
|
+
./release.sh
|
|
136
128
|
```
|
|
137
129
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
`
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
5.2. Run `npm install`.
|
|
183
|
-
|
|
184
|
-
5.3. Commit `package.json` and `package-lock.json`. Commit message should be `Starting $NEW_SNAPSHOT_VERSION`, e.g. `Starting 1.2.0`.
|
|
185
|
-
|
|
186
|
-
6. Push the branches and the tag:
|
|
187
|
-
|
|
188
|
-
On branch `develop`:
|
|
189
|
-
|
|
190
|
-
`git push`
|
|
191
|
-
`git checkout main`
|
|
192
|
-
`git push`
|
|
193
|
-
`git push --tags`
|
|
194
|
-
`git checkout develop`
|
|
130
|
+
Before running it, make sure the workarea is clean and all commits on `develop` are pushed; otherwise the script aborts.
|
|
131
|
+
It releases the current version from `package.json` (without `-SNAPSHOT`) and afterwards starts the next minor snapshot version.
|
|
132
|
+
|
|
133
|
+
## Building a hotfix for a specific version of this library
|
|
134
|
+
|
|
135
|
+
When building a hotfix in `ng-ui-scale`, first check which version of this library is used on the `main` branch of `ng-ui-scale`, e.g. with `git show origin/main:package.json | grep ng-ui-components`.
|
|
136
|
+
Then build the hotfix on top of exactly that version, so that no unrelated changes from newer releases end up in the `ng-ui-scale` hotfix.
|
|
137
|
+
Do not use `release.sh` or `git flow hotfix` for this: `git flow hotfix finish` merges into `main`, which already contains the newer release.
|
|
138
|
+
|
|
139
|
+
Example: `ng-ui-scale` uses 7.22.0 while 7.24.0 is already released (the version on `main` of this library):
|
|
140
|
+
|
|
141
|
+
1. Create the branch `hotfix/7.22.1` from the tag 7.22.0:
|
|
142
|
+
```shell
|
|
143
|
+
git fetch --tags
|
|
144
|
+
git checkout -b hotfix/7.22.1 7.22.0
|
|
145
|
+
```
|
|
146
|
+
2. Set the version in `package.json` and `package-lock.json` to 7.22.1:
|
|
147
|
+
```shell
|
|
148
|
+
npm version 7.22.1 --no-git-tag-version
|
|
149
|
+
```
|
|
150
|
+
If the `audit` job in `.gitlab-ci.yml` still runs on every branch except `main`, copy its `rules` from `develop`, so that the vulnerability audit does not block the hotfix pipeline.
|
|
151
|
+
3. Implement or cherry-pick the changes needed for the hotfix, either directly on the hotfix branch or in a feature branch that is merged into it.
|
|
152
|
+
4. Add a `## Version 7.22.1` entry to `CHANGELOG.md` describing the changes in the hotfix.
|
|
153
|
+
5. Run `npm run build`, `npm test -- --run` and `npm run lint` to verify there are no errors.
|
|
154
|
+
6. Commit the changes.
|
|
155
|
+
7. Tag the hotfix commit and push the tag:
|
|
156
|
+
```shell
|
|
157
|
+
git tag -a 7.22.1 -m "Hotfix 7.22.1"
|
|
158
|
+
git push origin 7.22.1
|
|
159
|
+
```
|
|
160
|
+
The `publish` CI job builds the tag and publishes it to npm.
|
|
161
|
+
Because 7.22.1 is older than the `latest` version, it is published under the dist-tag `hotfix-7.22` and `latest` stays at 7.24.0.
|
|
162
|
+
8. Merge the hotfix branch into `develop` and push `develop`:
|
|
163
|
+
```shell
|
|
164
|
+
git checkout develop
|
|
165
|
+
git pull
|
|
166
|
+
git merge --no-ff hotfix/7.22.1
|
|
167
|
+
git push
|
|
168
|
+
```
|
|
169
|
+
`package.json` and `package-lock.json` will conflict; keep the `-SNAPSHOT` version of `develop` and run `npm install` before committing the merge.
|
|
170
|
+
In `CHANGELOG.md`, keep the 7.22.1 entry between the entries for 7.23.0 and 7.22.0.
|
|
171
|
+
Do not merge the hotfix branch into `main`.
|
|
172
|
+
9. Delete the local hotfix branch: `git branch -d hotfix/7.22.1`.
|
|
173
|
+
10. Update `ng-ui-scale` on its hotfix branch to 7.22.1.
|
package/dist/index.cjs
CHANGED
|
@@ -6,7 +6,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
10
9
|
var __copyProps = (to, from, except, desc) => {
|
|
11
10
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
11
|
key = keys[i];
|
|
@@ -17,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
16
|
}
|
|
18
17
|
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
21
20
|
value: mod,
|
|
22
21
|
enumerable: true
|
|
23
22
|
}) : target, mod));
|
|
@@ -73,7 +72,6 @@ let _svgdotjs_svg_js = require("@svgdotjs/svg.js");
|
|
|
73
72
|
let highcharts = require("highcharts");
|
|
74
73
|
highcharts = __toESM(highcharts, 1);
|
|
75
74
|
let highcharts_react_official = require("highcharts-react-official");
|
|
76
|
-
highcharts_react_official = __toESM(highcharts_react_official, 1);
|
|
77
75
|
let _rc_component_slider = require("@rc-component/slider");
|
|
78
76
|
_rc_component_slider = __toESM(_rc_component_slider, 1);
|
|
79
77
|
let _rc_component_tooltip = require("@rc-component/tooltip");
|
|
@@ -94,8 +92,10 @@ var setGlobalErrorMessageBoxOptions = (options) => {
|
|
|
94
92
|
globalErrorMessageBoxOptions = options;
|
|
95
93
|
};
|
|
96
94
|
var storeGroupName = (groupName, toastId) => {
|
|
97
|
-
if (groupName)
|
|
98
|
-
|
|
95
|
+
if (groupName) {
|
|
96
|
+
if (groupNamesToToastIds[groupName]) groupNamesToToastIds[groupName] = [...groupNamesToToastIds[groupName], toastId];
|
|
97
|
+
else groupNamesToToastIds[groupName] = [toastId];
|
|
98
|
+
}
|
|
99
99
|
};
|
|
100
100
|
var messageBoxSuccess = (content, options, groupName) => {
|
|
101
101
|
const toastId = react_toastify_unstyled.toast.success(content, {
|
|
@@ -271,8 +271,10 @@ function convertToTree({ childNodeKey, idKey, displayNameKey, typeKey, lazyLoada
|
|
|
271
271
|
*/
|
|
272
272
|
function patchNode(node, patch) {
|
|
273
273
|
let patchedChildren;
|
|
274
|
-
if (patch.children !== void 0)
|
|
275
|
-
|
|
274
|
+
if (patch.children !== void 0) {
|
|
275
|
+
if (node.children !== void 0) patchedChildren = [...node.children, ...patch.children];
|
|
276
|
+
else patchedChildren = [...patch.children];
|
|
277
|
+
}
|
|
276
278
|
return {
|
|
277
279
|
...node,
|
|
278
280
|
...patch,
|
|
@@ -842,8 +844,9 @@ function RouteLink({ to, confirm, className, title, children, keyboardShortcut,
|
|
|
842
844
|
pushRoute();
|
|
843
845
|
}
|
|
844
846
|
};
|
|
847
|
+
const href = history.createHref(typeof to === "string" ? { pathname: to } : to);
|
|
845
848
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
846
|
-
href
|
|
849
|
+
href,
|
|
847
850
|
onClick: handleClickEvent,
|
|
848
851
|
className: `di route-link ${className || ""}`,
|
|
849
852
|
title: title ? t(title.id, { defaultValue: title.defaultValue }) : void 0,
|
|
@@ -1084,8 +1087,9 @@ var NodeInfo = class extends react.PureComponent {
|
|
|
1084
1087
|
}
|
|
1085
1088
|
render() {
|
|
1086
1089
|
const { node, node: { name }, leafNode, expanded, isLastChild, onExpand, selectionState, isLoading } = this.props;
|
|
1090
|
+
const selected = selectionState === SelectionState.ALL;
|
|
1087
1091
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1088
|
-
className: `node-info ${
|
|
1092
|
+
className: `node-info ${selected ? "selected" : ""}`,
|
|
1089
1093
|
children: [
|
|
1090
1094
|
isLastChild !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Skeleton, { lastChild: isLastChild }),
|
|
1091
1095
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NodeImage, {
|
|
@@ -1779,10 +1783,12 @@ var ReactableTableHeader = class extends react.Component {
|
|
|
1779
1783
|
this.getClassName = (columnDef) => {
|
|
1780
1784
|
const { paginationSettings, tableName } = this.props;
|
|
1781
1785
|
const className = getClassName(tableName, columnDef.name);
|
|
1782
|
-
if (columnDef.sortable)
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
+
if (columnDef.sortable) {
|
|
1787
|
+
if (columnDef.name === paginationSettings.sort.property) {
|
|
1788
|
+
if (paginationSettings.sort.direction === "ASC") return `${className} sortable sortAsc`;
|
|
1789
|
+
else return `${className} sortable sortDes`;
|
|
1790
|
+
} else return `${className} sortable`;
|
|
1791
|
+
} else return `${className}`;
|
|
1786
1792
|
};
|
|
1787
1793
|
this.printLabel = (label) => {
|
|
1788
1794
|
if (isTranslationDescriptor(label)) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Trans, {
|
|
@@ -2070,17 +2076,19 @@ var ReactableWithClientSidePagination = class extends react.Component {
|
|
|
2070
2076
|
};
|
|
2071
2077
|
this.handleSelectChange = (selected, item) => {
|
|
2072
2078
|
const { onSelectedItemsChange, selectedItems = [], uniqueItemKey } = this.props;
|
|
2073
|
-
if (onSelectedItemsChange)
|
|
2074
|
-
|
|
2075
|
-
|
|
2079
|
+
if (onSelectedItemsChange) {
|
|
2080
|
+
if (selected) onSelectedItemsChange(selectedItems.concat(uniqueItemKey(item)));
|
|
2081
|
+
else onSelectedItemsChange(selectedItems.filter((key) => key !== uniqueItemKey(item)));
|
|
2082
|
+
} else console.warn("ReactableWithClientSidePagination: onSelectedItemsChange property is missing");
|
|
2076
2083
|
};
|
|
2077
2084
|
this.handleSelectAllChange = (selectedAll) => {
|
|
2078
2085
|
const { onSelectedItemsChange, items, selectedItems = [], uniqueItemKey } = this.props;
|
|
2079
2086
|
const { filteredItems } = this.state;
|
|
2080
2087
|
const visibleItems = (filteredItems || items || []).map(uniqueItemKey);
|
|
2081
|
-
if (onSelectedItemsChange)
|
|
2082
|
-
|
|
2083
|
-
|
|
2088
|
+
if (onSelectedItemsChange) {
|
|
2089
|
+
if (selectedAll) onSelectedItemsChange((0, lodash.uniqWith)([...selectedItems, ...visibleItems], lodash.isEqual).sort());
|
|
2090
|
+
else onSelectedItemsChange((0, lodash.difference)(selectedItems, visibleItems));
|
|
2091
|
+
} else console.warn("ReactableWithClientSidePagination: onSelectedItemsChange property is missing");
|
|
2084
2092
|
};
|
|
2085
2093
|
this.areSelectedAll = () => {
|
|
2086
2094
|
const { items, selectedItems, uniqueItemKey } = this.props;
|
|
@@ -2120,8 +2128,9 @@ var ReactableWithClientSidePagination = class extends react.Component {
|
|
|
2120
2128
|
}
|
|
2121
2129
|
render() {
|
|
2122
2130
|
const { uniqueItemKey, isLoading, columnDefs, rowDef, tableName, clickable, selectable, selectedItems, onChangeSize } = this.props;
|
|
2131
|
+
const finalColumnDefs = selectable ? extendColumnDefsWithCheckboxes(columnDefs, this.handleSelectChange, this.handleSelectAllChange, this.areSelectedAll(), selectedItems || [], uniqueItemKey) : columnDefs;
|
|
2123
2132
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Reactable, {
|
|
2124
|
-
columnDefs:
|
|
2133
|
+
columnDefs: finalColumnDefs,
|
|
2125
2134
|
rowDef,
|
|
2126
2135
|
uniqueItemKey,
|
|
2127
2136
|
paginationSettings: this.state.paginationSettings,
|
|
@@ -2603,7 +2612,7 @@ var MultiMenuItem = class extends react.PureComponent {
|
|
|
2603
2612
|
};
|
|
2604
2613
|
//#endregion
|
|
2605
2614
|
//#region src/components/periodpicker/components/Inputs.tsx
|
|
2606
|
-
var ONE_HOUR =
|
|
2615
|
+
var ONE_HOUR = 36e5;
|
|
2607
2616
|
function Inputs({ period, onChange, readOnly, locale, timezone }) {
|
|
2608
2617
|
const [showWarningTarget, setShowWarningTarget] = (0, react.useState)("");
|
|
2609
2618
|
const warningTimeoutRef = (0, react.useRef)(void 0);
|
|
@@ -2812,7 +2821,7 @@ function createLastXDays(days, timezone) {
|
|
|
2812
2821
|
tsEnd: (0, dayjs.default)().endOf("day").valueOf()
|
|
2813
2822
|
};
|
|
2814
2823
|
}
|
|
2815
|
-
var DAY_TO_MILLIS =
|
|
2824
|
+
var DAY_TO_MILLIS = 864e5;
|
|
2816
2825
|
function periodToDays({ tsStart, tsEnd }) {
|
|
2817
2826
|
return Math.round((tsEnd - tsStart + 1) / DAY_TO_MILLIS);
|
|
2818
2827
|
}
|
|
@@ -3411,9 +3420,10 @@ var Chart = class extends react.Component {
|
|
|
3411
3420
|
}
|
|
3412
3421
|
render() {
|
|
3413
3422
|
const built = this.buildOptions();
|
|
3414
|
-
|
|
3423
|
+
const options = this.props.updateOptions ? this.props.updateOptions(built) : built;
|
|
3424
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(highcharts_react_official.HighchartsReact, {
|
|
3415
3425
|
highcharts: highcharts.default,
|
|
3416
|
-
options
|
|
3426
|
+
options,
|
|
3417
3427
|
containerProps: { className: this.props.className },
|
|
3418
3428
|
callback: this.handleChart
|
|
3419
3429
|
});
|
|
@@ -3421,54 +3431,15 @@ var Chart = class extends react.Component {
|
|
|
3421
3431
|
};
|
|
3422
3432
|
//#endregion
|
|
3423
3433
|
//#region src/components/slider/RcSliderWithTooltip.tsx
|
|
3424
|
-
var import_raf = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3425
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3426
|
-
exports.default = void 0;
|
|
3427
|
-
var raf = (callback) => +setTimeout(callback, 16);
|
|
3428
|
-
var caf = (num) => clearTimeout(num);
|
|
3429
|
-
if (typeof window !== "undefined" && "requestAnimationFrame" in window) {
|
|
3430
|
-
raf = (callback) => window.requestAnimationFrame(callback);
|
|
3431
|
-
caf = (handle) => window.cancelAnimationFrame(handle);
|
|
3432
|
-
}
|
|
3433
|
-
var rafUUID = 0;
|
|
3434
|
-
var rafIds = /* @__PURE__ */ new Map();
|
|
3435
|
-
function cleanup(id) {
|
|
3436
|
-
rafIds.delete(id);
|
|
3437
|
-
}
|
|
3438
|
-
var wrapperRaf = (callback, times = 1) => {
|
|
3439
|
-
rafUUID += 1;
|
|
3440
|
-
const id = rafUUID;
|
|
3441
|
-
function callRef(leftTimes) {
|
|
3442
|
-
if (leftTimes === 0) {
|
|
3443
|
-
cleanup(id);
|
|
3444
|
-
callback();
|
|
3445
|
-
} else {
|
|
3446
|
-
const realId = raf(() => {
|
|
3447
|
-
callRef(leftTimes - 1);
|
|
3448
|
-
});
|
|
3449
|
-
rafIds.set(id, realId);
|
|
3450
|
-
}
|
|
3451
|
-
}
|
|
3452
|
-
callRef(times);
|
|
3453
|
-
return id;
|
|
3454
|
-
};
|
|
3455
|
-
wrapperRaf.cancel = (id) => {
|
|
3456
|
-
const realId = rafIds.get(id);
|
|
3457
|
-
cleanup(id);
|
|
3458
|
-
return caf(realId);
|
|
3459
|
-
};
|
|
3460
|
-
if (process.env.NODE_ENV !== "production") wrapperRaf.ids = () => rafIds;
|
|
3461
|
-
exports.default = wrapperRaf;
|
|
3462
|
-
})))(), 1);
|
|
3463
3434
|
var HandleTooltip = (props) => {
|
|
3464
3435
|
const { value, children, visible, tipFormatter = (val) => `${val}`, ...restProps } = props;
|
|
3465
3436
|
const tooltipRef = (0, react.useRef)(null);
|
|
3466
3437
|
const rafRef = (0, react.useRef)(null);
|
|
3467
3438
|
function cancelKeepAlign() {
|
|
3468
|
-
if (rafRef.current)
|
|
3439
|
+
if (rafRef.current) cancelAnimationFrame(rafRef.current);
|
|
3469
3440
|
}
|
|
3470
3441
|
function keepAlign() {
|
|
3471
|
-
rafRef.current = (
|
|
3442
|
+
rafRef.current = requestAnimationFrame(() => {
|
|
3472
3443
|
tooltipRef.current?.forceAlign();
|
|
3473
3444
|
});
|
|
3474
3445
|
}
|
|
@@ -3510,12 +3481,13 @@ function useLimitStyling(limit, min, max) {
|
|
|
3510
3481
|
if (!containerEl) throw new Error(".rc-slider-rail element missing");
|
|
3511
3482
|
const disabledAreaEl = containerEl?.querySelector(`.disabled-area-element`);
|
|
3512
3483
|
const sliderWidth = containerEl.getBoundingClientRect().width;
|
|
3513
|
-
if (disabledAreaEl)
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3484
|
+
if (disabledAreaEl) {
|
|
3485
|
+
if (limit == null) disabledAreaEl.remove();
|
|
3486
|
+
else {
|
|
3487
|
+
const width = Math.round((max - limit) / (max - min) * sliderWidth);
|
|
3488
|
+
disabledAreaEl.style.width = `${width}px`;
|
|
3489
|
+
}
|
|
3490
|
+
} else if (limit != null) {
|
|
3519
3491
|
const width = Math.round((max - limit) / (max - min) * sliderWidth);
|
|
3520
3492
|
const disabledAreaEl = document.createElement("div");
|
|
3521
3493
|
disabledAreaEl.classList.add("disabled-area-element");
|