@nordicsemiconductor/pc-nrfconnect-shared 158.0.0 → 159.0.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/Changelog.md +29 -0
- package/package.json +1 -1
- package/src/App/App.tsx +2 -0
- package/src/ConfirmBeforeClose/ConfirmCloseDialog.tsx +85 -0
- package/src/ConfirmBeforeClose/confirmBeforeCloseSlice.ts +96 -0
- package/src/Device/deviceSetup.ts +13 -1
- package/src/Dropdown/Dropdown.tsx +19 -4
- package/src/InlineInput/InlineInput.tsx +3 -0
- package/src/InlineInput/NumberInlineInput.tsx +31 -6
- package/src/NumberInput/NumberInput.tsx +133 -0
- package/src/StateSelector/state-selector.scss +0 -1
- package/src/index.ts +7 -1
- package/src/store.ts +2 -0
- package/typings/generated/src/App/App.d.ts.map +1 -1
- package/typings/generated/src/ConfirmBeforeClose/ConfirmCloseDialog.d.ts +4 -0
- package/typings/generated/src/ConfirmBeforeClose/ConfirmCloseDialog.d.ts.map +1 -0
- package/typings/generated/src/ConfirmBeforeClose/confirmBeforeCloseSlice.d.ts +16 -0
- package/typings/generated/src/ConfirmBeforeClose/confirmBeforeCloseSlice.d.ts.map +1 -0
- package/typings/generated/src/Device/deviceSetup.d.ts.map +1 -1
- package/typings/generated/src/Dropdown/Dropdown.d.ts +3 -1
- package/typings/generated/src/Dropdown/Dropdown.d.ts.map +1 -1
- package/typings/generated/src/InlineInput/InlineInput.d.ts +1 -0
- package/typings/generated/src/InlineInput/InlineInput.d.ts.map +1 -1
- package/typings/generated/src/InlineInput/NumberInlineInput.d.ts +2 -1
- package/typings/generated/src/InlineInput/NumberInlineInput.d.ts.map +1 -1
- package/typings/generated/src/NumberInput/NumberInput.d.ts +23 -0
- package/typings/generated/src/NumberInput/NumberInput.d.ts.map +1 -0
- package/typings/generated/src/index.d.ts +2 -1
- package/typings/generated/src/index.d.ts.map +1 -1
- package/typings/generated/src/store.d.ts +5 -0
- package/typings/generated/src/store.d.ts.map +1 -1
- package/src/NumberInputWithSlider/NumberInputSliderWithUnit.tsx +0 -74
- package/typings/generated/src/NumberInputWithSlider/NumberInputSliderWithUnit.d.ts +0 -14
- package/typings/generated/src/NumberInputWithSlider/NumberInputSliderWithUnit.d.ts.map +0 -1
package/Changelog.md
CHANGED
|
@@ -7,6 +7,35 @@ This project does _not_ adhere to
|
|
|
7
7
|
[Semantic Versioning](https://semver.org/spec/v2.0.0.html) but contrary to it
|
|
8
8
|
every new version is a new major version.
|
|
9
9
|
|
|
10
|
+
## 159.0.0 - 2024-02-23
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- `minWidth` parameter to `Dropdown` component.
|
|
15
|
+
- `transparentButtonBg` parameter to `Dropdown` component.
|
|
16
|
+
- `NumberInput` component (provides text, input, optional unit, and slider).
|
|
17
|
+
- Common way to queue ongoing pending tasks. If an app is closed, a dialog is
|
|
18
|
+
prompted to alert users before clo sing app. Redux states for this are:
|
|
19
|
+
- `addConfirmBeforeClose`
|
|
20
|
+
- `clearConfirmBeforeClose`
|
|
21
|
+
- `preventAppCloseUntilComplete` can be used to wrap some promise and
|
|
22
|
+
secure app from closing until promise is resolved
|
|
23
|
+
|
|
24
|
+
### Removed
|
|
25
|
+
|
|
26
|
+
- `NumberInputWithSlider` component.
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
|
|
30
|
+
- `StateSelector` no longer has 16px margin on the bottom. Apps are now
|
|
31
|
+
responsible to add the appropriate gap per container
|
|
32
|
+
|
|
33
|
+
### Steps to upgrade
|
|
34
|
+
|
|
35
|
+
- Change all occurrences of `NumberInputWithSlider` to `NumberInput`.
|
|
36
|
+
- Check all use cases of `StateSelector` and that the gap between components
|
|
37
|
+
is correct if not adjust spacing from the app side
|
|
38
|
+
|
|
10
39
|
## 158.0.0 - 2024-02-22
|
|
11
40
|
|
|
12
41
|
### Added
|
package/package.json
CHANGED
package/src/App/App.tsx
CHANGED
|
@@ -15,6 +15,7 @@ import { Reducer } from 'redux';
|
|
|
15
15
|
import { inMain as openWindow } from '../../ipc/openWindow';
|
|
16
16
|
import { setNrfutilLogger } from '../../nrfutil/nrfutilLogger';
|
|
17
17
|
import About from '../About/About';
|
|
18
|
+
import ConfirmCloseDialog from '../ConfirmBeforeClose/ConfirmCloseDialog';
|
|
18
19
|
import BrokenDeviceDialog from '../Device/BrokenDeviceDialog/BrokenDeviceDialog';
|
|
19
20
|
import { setAutoReselect } from '../Device/deviceAutoSelectSlice';
|
|
20
21
|
import {
|
|
@@ -181,6 +182,7 @@ const ConnectedApp: FC<ConnectedAppProps> = ({
|
|
|
181
182
|
|
|
182
183
|
<ErrorDialog />
|
|
183
184
|
<BrokenDeviceDialog />
|
|
185
|
+
<ConfirmCloseDialog />
|
|
184
186
|
{children}
|
|
185
187
|
</div>
|
|
186
188
|
);
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2015 Nordic Semiconductor ASA
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import React, { useEffect, useState } from 'react';
|
|
8
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
9
|
+
import { getCurrentWindow } from '@electron/remote';
|
|
10
|
+
|
|
11
|
+
import { ConfirmationDialog } from '../Dialog/Dialog';
|
|
12
|
+
import { AppThunk } from '../store';
|
|
13
|
+
import {
|
|
14
|
+
addConfirmBeforeClose,
|
|
15
|
+
clearConfirmBeforeClose,
|
|
16
|
+
ConfirmBeforeCloseApp,
|
|
17
|
+
getNextConfirmDialog,
|
|
18
|
+
getShowConfirmCloseDialog,
|
|
19
|
+
setShowCloseDialog,
|
|
20
|
+
} from './confirmBeforeCloseSlice';
|
|
21
|
+
|
|
22
|
+
export default () => {
|
|
23
|
+
const dispatch = useDispatch();
|
|
24
|
+
const [confirmedDialogs, setConfirmedDialogs] = useState<
|
|
25
|
+
ConfirmBeforeCloseApp[]
|
|
26
|
+
>([]);
|
|
27
|
+
|
|
28
|
+
const showCloseDialog = useSelector(getShowConfirmCloseDialog);
|
|
29
|
+
const nextConfirmDialog = useSelector(getNextConfirmDialog);
|
|
30
|
+
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
if (!nextConfirmDialog && showCloseDialog) {
|
|
33
|
+
confirmedDialogs.forEach(confirmedDialog => {
|
|
34
|
+
if (confirmedDialog.onClose) confirmedDialog.onClose();
|
|
35
|
+
});
|
|
36
|
+
setConfirmedDialogs([]);
|
|
37
|
+
getCurrentWindow().close();
|
|
38
|
+
}
|
|
39
|
+
}, [nextConfirmDialog, dispatch, showCloseDialog, confirmedDialogs]);
|
|
40
|
+
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
const action = (ev: BeforeUnloadEvent) =>
|
|
43
|
+
dispatch<AppThunk>((_, getState) => {
|
|
44
|
+
const hasToGetExplicitConform =
|
|
45
|
+
getState().confirmBeforeCloseDialog.confirmCloseApp.length >
|
|
46
|
+
0;
|
|
47
|
+
if (hasToGetExplicitConform) {
|
|
48
|
+
dispatch(setShowCloseDialog(true));
|
|
49
|
+
ev.returnValue = true;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
window.addEventListener('beforeunload', action, true);
|
|
54
|
+
|
|
55
|
+
return () => {
|
|
56
|
+
window.removeEventListener('beforeunload', action);
|
|
57
|
+
};
|
|
58
|
+
}, [dispatch]);
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<ConfirmationDialog
|
|
62
|
+
headerIcon="alert-outline"
|
|
63
|
+
title="Closing nPM PowerUP"
|
|
64
|
+
isVisible={showCloseDialog && !!nextConfirmDialog}
|
|
65
|
+
onConfirm={() => {
|
|
66
|
+
if (nextConfirmDialog) {
|
|
67
|
+
setConfirmedDialogs([
|
|
68
|
+
...confirmedDialogs,
|
|
69
|
+
nextConfirmDialog,
|
|
70
|
+
]);
|
|
71
|
+
dispatch(clearConfirmBeforeClose(nextConfirmDialog.id));
|
|
72
|
+
}
|
|
73
|
+
}}
|
|
74
|
+
onCancel={() => {
|
|
75
|
+
dispatch(setShowCloseDialog(false));
|
|
76
|
+
confirmedDialogs.forEach(confirmedDialog =>
|
|
77
|
+
dispatch(addConfirmBeforeClose(confirmedDialog))
|
|
78
|
+
);
|
|
79
|
+
setConfirmedDialogs([]);
|
|
80
|
+
}}
|
|
81
|
+
>
|
|
82
|
+
{nextConfirmDialog?.message}
|
|
83
|
+
</ConfirmationDialog>
|
|
84
|
+
);
|
|
85
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 Nordic Semiconductor ASA
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
|
|
8
|
+
import { v4 as uuid } from 'uuid';
|
|
9
|
+
|
|
10
|
+
import type { AppThunk, RootState } from '../store';
|
|
11
|
+
|
|
12
|
+
export interface ConfirmBeforeCloseApp {
|
|
13
|
+
id: string;
|
|
14
|
+
message: React.ReactNode;
|
|
15
|
+
onClose?: () => void;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ConfirmBeforeCloseState {
|
|
19
|
+
confirmCloseApp: ConfirmBeforeCloseApp[];
|
|
20
|
+
showCloseDialog: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const initialState: ConfirmBeforeCloseState = {
|
|
24
|
+
confirmCloseApp: [],
|
|
25
|
+
showCloseDialog: false,
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const slice = createSlice({
|
|
29
|
+
name: 'confirmBeforeCloseDialog',
|
|
30
|
+
initialState,
|
|
31
|
+
reducers: {
|
|
32
|
+
addConfirmBeforeClose(
|
|
33
|
+
state,
|
|
34
|
+
action: PayloadAction<ConfirmBeforeCloseApp>
|
|
35
|
+
) {
|
|
36
|
+
const index = state.confirmCloseApp.findIndex(
|
|
37
|
+
confirmCloseApp => confirmCloseApp.id === action.payload.id
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
if (index !== -1) {
|
|
41
|
+
state.confirmCloseApp[index] = action.payload;
|
|
42
|
+
} else {
|
|
43
|
+
state.confirmCloseApp = [
|
|
44
|
+
action.payload,
|
|
45
|
+
...state.confirmCloseApp,
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
clearConfirmBeforeClose(state, action: PayloadAction<string>) {
|
|
50
|
+
state.confirmCloseApp = state.confirmCloseApp.filter(
|
|
51
|
+
confirmCloseApp => confirmCloseApp.id !== action.payload
|
|
52
|
+
);
|
|
53
|
+
},
|
|
54
|
+
setShowCloseDialog(state, action: PayloadAction<boolean>) {
|
|
55
|
+
state.showCloseDialog = action.payload;
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
export const {
|
|
61
|
+
reducer,
|
|
62
|
+
actions: {
|
|
63
|
+
addConfirmBeforeClose,
|
|
64
|
+
setShowCloseDialog,
|
|
65
|
+
clearConfirmBeforeClose,
|
|
66
|
+
},
|
|
67
|
+
} = slice;
|
|
68
|
+
|
|
69
|
+
export const getNextConfirmDialog = (state: RootState) =>
|
|
70
|
+
state.confirmBeforeCloseDialog.confirmCloseApp.length > 0
|
|
71
|
+
? state.confirmBeforeCloseDialog.confirmCloseApp[0]
|
|
72
|
+
: undefined;
|
|
73
|
+
|
|
74
|
+
export const getShowConfirmCloseDialog = (state: RootState) =>
|
|
75
|
+
state.confirmBeforeCloseDialog.showCloseDialog;
|
|
76
|
+
|
|
77
|
+
export const preventAppCloseUntilComplete =
|
|
78
|
+
(
|
|
79
|
+
dialogInfo: Omit<ConfirmBeforeCloseApp, 'id'>,
|
|
80
|
+
promise: Promise<unknown>,
|
|
81
|
+
abortController?: AbortController
|
|
82
|
+
): AppThunk =>
|
|
83
|
+
dispatch => {
|
|
84
|
+
const id = uuid();
|
|
85
|
+
dispatch(
|
|
86
|
+
addConfirmBeforeClose({
|
|
87
|
+
...dialogInfo,
|
|
88
|
+
id,
|
|
89
|
+
onClose: () => {
|
|
90
|
+
dialogInfo.onClose?.();
|
|
91
|
+
abortController?.abort();
|
|
92
|
+
},
|
|
93
|
+
})
|
|
94
|
+
);
|
|
95
|
+
promise.finally(() => dispatch(clearConfirmBeforeClose(id)));
|
|
96
|
+
};
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
5
|
*/
|
|
6
6
|
import { DeviceInfo } from '../../nrfutil/device/deviceInfo';
|
|
7
|
+
import { preventAppCloseUntilComplete } from '../ConfirmBeforeClose/confirmBeforeCloseSlice';
|
|
7
8
|
import logger from '../logging';
|
|
8
9
|
import describeError from '../logging/describeError';
|
|
9
10
|
import { AppThunk, RootState } from '../store';
|
|
@@ -151,7 +152,7 @@ export const prepareDevice =
|
|
|
151
152
|
if (!selectedDeviceSetup) {
|
|
152
153
|
onFail('No firmware was selected'); // Should never happen
|
|
153
154
|
} else {
|
|
154
|
-
dispatch(
|
|
155
|
+
const task = dispatch(
|
|
155
156
|
selectedDeviceSetup.programDevice(
|
|
156
157
|
(progress: number, message?: string) => {
|
|
157
158
|
dispatch(setDeviceSetupProgress(progress));
|
|
@@ -164,6 +165,17 @@ export const prepareDevice =
|
|
|
164
165
|
)
|
|
165
166
|
.then(onSuccessWrapper)
|
|
166
167
|
.catch(onFail);
|
|
168
|
+
|
|
169
|
+
dispatch(
|
|
170
|
+
preventAppCloseUntilComplete(
|
|
171
|
+
{
|
|
172
|
+
message: `The device is being programmed.
|
|
173
|
+
Closing application right now might result in some unknown behavior and might also brick the device.
|
|
174
|
+
Are you sure you want to continue?`,
|
|
175
|
+
},
|
|
176
|
+
task
|
|
177
|
+
)
|
|
178
|
+
);
|
|
167
179
|
}
|
|
168
180
|
};
|
|
169
181
|
|
|
@@ -22,6 +22,8 @@ export type DropdownProps<T> = {
|
|
|
22
22
|
defaultButtonLabel?: string;
|
|
23
23
|
items: DropdownItem<T>[];
|
|
24
24
|
onSelect: (item: DropdownItem<T>) => void;
|
|
25
|
+
transparentButtonBg?: boolean;
|
|
26
|
+
minWidth?: boolean;
|
|
25
27
|
disabled?: boolean;
|
|
26
28
|
selectedItem: DropdownItem<T>;
|
|
27
29
|
numItemsBeforeScroll?: number;
|
|
@@ -34,6 +36,8 @@ export default <T,>({
|
|
|
34
36
|
defaultButtonLabel = '',
|
|
35
37
|
items,
|
|
36
38
|
onSelect,
|
|
39
|
+
transparentButtonBg = false,
|
|
40
|
+
minWidth = false,
|
|
37
41
|
disabled = false,
|
|
38
42
|
selectedItem,
|
|
39
43
|
numItemsBeforeScroll = 0,
|
|
@@ -48,7 +52,11 @@ export default <T,>({
|
|
|
48
52
|
|
|
49
53
|
return (
|
|
50
54
|
<div
|
|
51
|
-
className={
|
|
55
|
+
className={classNames(
|
|
56
|
+
'tw-preflight tw-relative',
|
|
57
|
+
minWidth ? '' : 'tw-w-full',
|
|
58
|
+
className
|
|
59
|
+
)}
|
|
52
60
|
onBlur={event => {
|
|
53
61
|
if (!event.currentTarget.contains(event.relatedTarget)) {
|
|
54
62
|
setIsActive(false);
|
|
@@ -61,7 +69,13 @@ export default <T,>({
|
|
|
61
69
|
<button
|
|
62
70
|
id={id}
|
|
63
71
|
type="button"
|
|
64
|
-
className=
|
|
72
|
+
className={classNames(
|
|
73
|
+
'tw-flex tw-items-center tw-justify-between tw-border-0',
|
|
74
|
+
minWidth ? '' : 'tw-w-full',
|
|
75
|
+
transparentButtonBg
|
|
76
|
+
? 'tw-bg-transparent'
|
|
77
|
+
: 'tw-h-8 tw-bg-gray-700 tw-px-2 tw-text-white'
|
|
78
|
+
)}
|
|
65
79
|
onClick={() => setIsActive(!isActive)}
|
|
66
80
|
disabled={disabled}
|
|
67
81
|
>
|
|
@@ -71,7 +85,7 @@ export default <T,>({
|
|
|
71
85
|
: selectedItem.label}
|
|
72
86
|
</span>
|
|
73
87
|
<span
|
|
74
|
-
className={`mdi mdi-chevron-down tw-text-lg ${classNames(
|
|
88
|
+
className={`mdi mdi-chevron-down tw-text-lg/none ${classNames(
|
|
75
89
|
isActive && 'tw-rotate-180'
|
|
76
90
|
)}`}
|
|
77
91
|
/>
|
|
@@ -93,8 +107,9 @@ export default <T,>({
|
|
|
93
107
|
numItemsBeforeScroll > 0 &&
|
|
94
108
|
items.length > numItemsBeforeScroll
|
|
95
109
|
}
|
|
96
|
-
className={`tw-text-while tw-absolute tw-
|
|
110
|
+
className={`tw-text-while tw-absolute tw-z-10 tw-border-t-2 tw-border-solid tw-border-gray-600 tw-bg-gray-700 tw-p-0 ${classNames(
|
|
97
111
|
styles.content,
|
|
112
|
+
minWidth ? '' : 'tw-right-0 tw-w-full',
|
|
98
113
|
!isActive && 'tw-hidden'
|
|
99
114
|
)}`}
|
|
100
115
|
>
|
|
@@ -57,6 +57,7 @@ interface Props {
|
|
|
57
57
|
onKeyboardIncrementAction?: () => string;
|
|
58
58
|
onKeyboardDecrementAction?: () => string;
|
|
59
59
|
className?: string;
|
|
60
|
+
title?: string;
|
|
60
61
|
textAlignLeft?: boolean;
|
|
61
62
|
onValidityChanged?: (validity: boolean) => void;
|
|
62
63
|
preventDefaultInvalidStyle?: boolean;
|
|
@@ -73,6 +74,7 @@ const InlineInput = React.forwardRef<HTMLInputElement, Props>(
|
|
|
73
74
|
onKeyboardIncrementAction = () => externalValue,
|
|
74
75
|
onKeyboardDecrementAction = () => externalValue,
|
|
75
76
|
className = '',
|
|
77
|
+
title,
|
|
76
78
|
textAlignLeft = false,
|
|
77
79
|
onValidityChanged,
|
|
78
80
|
preventDefaultInvalidStyle,
|
|
@@ -161,6 +163,7 @@ const InlineInput = React.forwardRef<HTMLInputElement, Props>(
|
|
|
161
163
|
<input
|
|
162
164
|
ref={ref}
|
|
163
165
|
type="text"
|
|
166
|
+
title={title}
|
|
164
167
|
className={classNames(
|
|
165
168
|
'inline-input',
|
|
166
169
|
preventDefaultInvalidStyle
|
|
@@ -24,6 +24,7 @@ interface NumberInlineInput {
|
|
|
24
24
|
value: number;
|
|
25
25
|
range: RangeOrValues;
|
|
26
26
|
className?: string;
|
|
27
|
+
title?: string;
|
|
27
28
|
onChange: (value: number) => void;
|
|
28
29
|
onChangeComplete?: (value: number) => void;
|
|
29
30
|
textAlignLeft?: boolean;
|
|
@@ -81,11 +82,25 @@ const changeValueStepwise = (
|
|
|
81
82
|
return nextValue != null ? nextValue : current;
|
|
82
83
|
};
|
|
83
84
|
|
|
85
|
+
const handleInfinityToString = (val: number) =>
|
|
86
|
+
Math.abs(val) === Infinity ? `${val < 0 ? '-' : ''}∞` : String(val);
|
|
87
|
+
|
|
88
|
+
const handleInfinityToNumber = (val: string) => {
|
|
89
|
+
if (val === '∞') {
|
|
90
|
+
return Infinity;
|
|
91
|
+
}
|
|
92
|
+
if (val === '-∞') {
|
|
93
|
+
return -Infinity;
|
|
94
|
+
}
|
|
95
|
+
return Number(val);
|
|
96
|
+
};
|
|
97
|
+
|
|
84
98
|
export default ({
|
|
85
99
|
disabled,
|
|
86
100
|
value,
|
|
87
101
|
range,
|
|
88
102
|
className,
|
|
103
|
+
title,
|
|
89
104
|
onChange,
|
|
90
105
|
onChangeComplete = () => {},
|
|
91
106
|
textAlignLeft,
|
|
@@ -97,19 +112,29 @@ export default ({
|
|
|
97
112
|
return (
|
|
98
113
|
<InlineInput
|
|
99
114
|
className={`${className} number-inline-input`}
|
|
115
|
+
title={title}
|
|
100
116
|
disabled={disabled}
|
|
101
|
-
value={
|
|
102
|
-
onChange={newValue => onChange(
|
|
103
|
-
onChangeComplete={newValue =>
|
|
117
|
+
value={handleInfinityToString(value)}
|
|
118
|
+
onChange={newValue => onChange(handleInfinityToNumber(newValue))}
|
|
119
|
+
onChangeComplete={newValue =>
|
|
120
|
+
onChangeComplete(handleInfinityToNumber(newValue))
|
|
121
|
+
}
|
|
104
122
|
onKeyboardIncrementAction={() =>
|
|
105
|
-
|
|
123
|
+
handleInfinityToString(
|
|
124
|
+
changeValueStepwise(value, range, 1)
|
|
125
|
+
).toString()
|
|
106
126
|
}
|
|
107
127
|
onKeyboardDecrementAction={() =>
|
|
108
|
-
|
|
128
|
+
handleInfinityToString(
|
|
129
|
+
changeValueStepwise(value, range, -1)
|
|
130
|
+
).toString()
|
|
109
131
|
}
|
|
110
132
|
textAlignLeft={textAlignLeft}
|
|
111
133
|
isValid={newValue => {
|
|
112
|
-
const validity = isValid(
|
|
134
|
+
const validity = isValid(
|
|
135
|
+
handleInfinityToNumber(newValue),
|
|
136
|
+
range
|
|
137
|
+
);
|
|
113
138
|
if (onValidityChanged != null) {
|
|
114
139
|
// Then propagate the validity back to parent
|
|
115
140
|
onValidityChanged(validity);
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023 Nordic Semiconductor ASA
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import React from 'react';
|
|
8
|
+
|
|
9
|
+
import Dropdown, { type DropdownItem } from '../Dropdown/Dropdown';
|
|
10
|
+
import NumberInlineInput from '../InlineInput/NumberInlineInput';
|
|
11
|
+
import { RangeOrValues } from '../Slider/range';
|
|
12
|
+
import BaseSlider from '../Slider/Slider';
|
|
13
|
+
import classNames from '../utils/classNames';
|
|
14
|
+
|
|
15
|
+
const Slider = ({
|
|
16
|
+
range,
|
|
17
|
+
value,
|
|
18
|
+
onChange,
|
|
19
|
+
onChangeComplete,
|
|
20
|
+
disabled,
|
|
21
|
+
}: {
|
|
22
|
+
range: RangeOrValues;
|
|
23
|
+
value: number;
|
|
24
|
+
onChange: (value: number) => void;
|
|
25
|
+
onChangeComplete?: (value: number) => void;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
}) =>
|
|
28
|
+
Array.isArray(range) ? (
|
|
29
|
+
<BaseSlider
|
|
30
|
+
values={[range.indexOf(value)]}
|
|
31
|
+
onChange={[i => onChange(range[i])]}
|
|
32
|
+
onChangeComplete={() => onChangeComplete?.(value)}
|
|
33
|
+
range={{
|
|
34
|
+
min: 0,
|
|
35
|
+
max: range.length - 1,
|
|
36
|
+
}}
|
|
37
|
+
disabled={disabled}
|
|
38
|
+
/>
|
|
39
|
+
) : (
|
|
40
|
+
<BaseSlider
|
|
41
|
+
values={[value]}
|
|
42
|
+
onChange={[onChange]}
|
|
43
|
+
onChangeComplete={() => onChangeComplete?.(value)}
|
|
44
|
+
range={range}
|
|
45
|
+
disabled={disabled}
|
|
46
|
+
/>
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
interface DropdownUnit<T> {
|
|
50
|
+
selectedItem: DropdownItem<T>;
|
|
51
|
+
items: DropdownItem<T>[];
|
|
52
|
+
onUnitChange: (unit: DropdownItem<T>) => void;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const isDropdownUnit = <T,>(
|
|
56
|
+
unit: React.ReactNode | DropdownUnit<T>
|
|
57
|
+
): unit is DropdownUnit<T> =>
|
|
58
|
+
unit != null &&
|
|
59
|
+
Object.keys(unit).includes('selectedItem') &&
|
|
60
|
+
Object.keys(unit).includes('items') &&
|
|
61
|
+
Object.keys(unit).includes('onUnitChange');
|
|
62
|
+
|
|
63
|
+
export default <T,>({
|
|
64
|
+
range,
|
|
65
|
+
value,
|
|
66
|
+
onChange,
|
|
67
|
+
onChangeComplete,
|
|
68
|
+
className,
|
|
69
|
+
disabled,
|
|
70
|
+
label,
|
|
71
|
+
title,
|
|
72
|
+
unit,
|
|
73
|
+
showSlider = false,
|
|
74
|
+
minWidth = false,
|
|
75
|
+
}: {
|
|
76
|
+
range: RangeOrValues;
|
|
77
|
+
value: number;
|
|
78
|
+
onChange: (value: number) => void;
|
|
79
|
+
onChangeComplete?: (value: number) => void;
|
|
80
|
+
className?: string;
|
|
81
|
+
disabled?: boolean;
|
|
82
|
+
label: React.ReactNode;
|
|
83
|
+
title?: string;
|
|
84
|
+
showSlider?: boolean;
|
|
85
|
+
unit?: React.ReactNode | DropdownUnit<T>;
|
|
86
|
+
minWidth?: boolean;
|
|
87
|
+
}) => (
|
|
88
|
+
<div
|
|
89
|
+
className={`tw-flex tw-flex-col tw-gap-1 tw-text-xs ${classNames(
|
|
90
|
+
className
|
|
91
|
+
)}`}
|
|
92
|
+
>
|
|
93
|
+
<div
|
|
94
|
+
className={classNames(
|
|
95
|
+
'tw-flex tw-flex-row',
|
|
96
|
+
minWidth ? '' : 'tw-justify-between'
|
|
97
|
+
)}
|
|
98
|
+
title={title}
|
|
99
|
+
>
|
|
100
|
+
{label}
|
|
101
|
+
<div className="tw-flex tw-flex-row">
|
|
102
|
+
<NumberInlineInput
|
|
103
|
+
value={value}
|
|
104
|
+
range={range}
|
|
105
|
+
onChange={onChange}
|
|
106
|
+
onChangeComplete={onChangeComplete}
|
|
107
|
+
disabled={disabled}
|
|
108
|
+
/>
|
|
109
|
+
{isDropdownUnit(unit) ? (
|
|
110
|
+
<Dropdown
|
|
111
|
+
items={unit.items}
|
|
112
|
+
selectedItem={unit.selectedItem}
|
|
113
|
+
transparentButtonBg
|
|
114
|
+
minWidth
|
|
115
|
+
onSelect={unit.onUnitChange}
|
|
116
|
+
/>
|
|
117
|
+
) : (
|
|
118
|
+
unit
|
|
119
|
+
)}
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
|
|
123
|
+
{showSlider && (
|
|
124
|
+
<Slider
|
|
125
|
+
range={range}
|
|
126
|
+
value={value}
|
|
127
|
+
onChange={onChange}
|
|
128
|
+
onChangeComplete={onChangeComplete}
|
|
129
|
+
disabled={disabled}
|
|
130
|
+
/>
|
|
131
|
+
)}
|
|
132
|
+
</div>
|
|
133
|
+
);
|
package/src/index.ts
CHANGED
|
@@ -48,7 +48,7 @@ export { Group, CollapsibleGroup } from './SidePanel/Group';
|
|
|
48
48
|
|
|
49
49
|
export { default as InlineInput } from './InlineInput/InlineInput';
|
|
50
50
|
export { default as NumberInlineInput } from './InlineInput/NumberInlineInput';
|
|
51
|
-
export { default as
|
|
51
|
+
export { default as NumberInput } from './NumberInput/NumberInput';
|
|
52
52
|
export { default as NumberInputWithDropdown } from './InlineInput/NumberInputWithDropdown';
|
|
53
53
|
export type { NumberDropdownItem } from './InlineInput/NumberInputWithDropdown';
|
|
54
54
|
|
|
@@ -120,6 +120,12 @@ export {
|
|
|
120
120
|
getWaitForDevice,
|
|
121
121
|
clearWaitForDevice,
|
|
122
122
|
} from './Device/deviceAutoSelectSlice';
|
|
123
|
+
|
|
124
|
+
export {
|
|
125
|
+
addConfirmBeforeClose,
|
|
126
|
+
clearConfirmBeforeClose,
|
|
127
|
+
preventAppCloseUntilComplete,
|
|
128
|
+
} from './ConfirmBeforeClose/confirmBeforeCloseSlice';
|
|
123
129
|
export { deviceInfo } from './Device/deviceInfo/deviceInfo';
|
|
124
130
|
export { isDeviceInDFUBootloader } from './Device/sdfuOperations';
|
|
125
131
|
export {
|
package/src/store.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { Reducer } from 'redux';
|
|
|
9
9
|
|
|
10
10
|
import { reducer as shortcuts } from './About/shortcutSlice';
|
|
11
11
|
import { reducer as appLayout } from './App/appLayout';
|
|
12
|
+
import { reducer as confirmBeforeCloseDialog } from './ConfirmBeforeClose/confirmBeforeCloseSlice';
|
|
12
13
|
import { reducer as brokenDeviceDialog } from './Device/BrokenDeviceDialog/brokenDeviceDialogSlice';
|
|
13
14
|
import { reducer as deviceAutoSelect } from './Device/deviceAutoSelectSlice';
|
|
14
15
|
import { reducer as deviceSetup } from './Device/deviceSetupSlice';
|
|
@@ -33,6 +34,7 @@ export const rootReducerSpec = (appReducer: Reducer = noopReducer) => ({
|
|
|
33
34
|
log,
|
|
34
35
|
shortcuts,
|
|
35
36
|
flashMessages,
|
|
37
|
+
confirmBeforeCloseDialog,
|
|
36
38
|
});
|
|
37
39
|
|
|
38
40
|
const store = (appReducer?: Reducer) =>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../../../src/App/App.tsx"],"names":[],"mappings":"AAMA,OAAO,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,EAAE,EAAE,EAAE,SAAS,EAA8B,MAAM,OAAO,CAAC;AAIzE,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../../../src/App/App.tsx"],"names":[],"mappings":"AAMA,OAAO,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,EAAE,EAAE,EAAE,SAAS,EAA8B,MAAM,OAAO,CAAC;AAIzE,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAehC,OAAqB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAuB3E,OAAO,YAAY,CAAC;AACpB,OAAO,eAAe,CAAC;AACvB,OAAO,gBAAgB,CAAC;AAExB,MAAM,WAAW,SAAS;IACtB,MAAM,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,IAAI;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC;IACpB,SAAS,CAAC,EAAE,EAAE,CAAC;CAClB;AAED,UAAU,iBAAiB;IACvB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,aAAa,CAAC,EAAE,SAAS,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAAC;IACvC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACnC;;;;AAqID,wBASE;AAiDF,eAAO,MAAM,MAAM,QAAS,MAAM,YAAY,SAM7C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfirmCloseDialog.d.ts","sourceRoot":"","sources":["../../../../src/ConfirmBeforeClose/ConfirmCloseDialog.tsx"],"names":[],"mappings":";;AAqBA,wBA+DE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { AppThunk, RootState } from '../store';
|
|
3
|
+
export interface ConfirmBeforeCloseApp {
|
|
4
|
+
id: string;
|
|
5
|
+
message: React.ReactNode;
|
|
6
|
+
onClose?: () => void;
|
|
7
|
+
}
|
|
8
|
+
export interface ConfirmBeforeCloseState {
|
|
9
|
+
confirmCloseApp: ConfirmBeforeCloseApp[];
|
|
10
|
+
showCloseDialog: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const reducer: import("redux").Reducer<ConfirmBeforeCloseState, import("redux").AnyAction>, addConfirmBeforeClose: import("@reduxjs/toolkit").ActionCreatorWithPayload<ConfirmBeforeCloseApp, "confirmBeforeCloseDialog/addConfirmBeforeClose">, setShowCloseDialog: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "confirmBeforeCloseDialog/setShowCloseDialog">, clearConfirmBeforeClose: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "confirmBeforeCloseDialog/clearConfirmBeforeClose">;
|
|
13
|
+
export declare const getNextConfirmDialog: (state: RootState) => ConfirmBeforeCloseApp | undefined;
|
|
14
|
+
export declare const getShowConfirmCloseDialog: (state: RootState) => boolean;
|
|
15
|
+
export declare const preventAppCloseUntilComplete: (dialogInfo: Omit<ConfirmBeforeCloseApp, 'id'>, promise: Promise<unknown>, abortController?: AbortController) => AppThunk;
|
|
16
|
+
//# sourceMappingURL=confirmBeforeCloseSlice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirmBeforeCloseSlice.d.ts","sourceRoot":"","sources":["../../../../src/ConfirmBeforeClose/confirmBeforeCloseSlice.ts"],"names":[],"mappings":";AASA,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAEpD,MAAM,WAAW,qBAAqB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,uBAAuB;IACpC,eAAe,EAAE,qBAAqB,EAAE,CAAC;IACzC,eAAe,EAAE,OAAO,CAAC;CAC5B;AAuCD,eAAO,MACH,OAAO,+EAEH,qBAAqB,gIACrB,kBAAkB,+GAClB,uBAAuB,iHAEtB,CAAC;AAEV,eAAO,MAAM,oBAAoB,UAAW,SAAS,sCAGlC,CAAC;AAEpB,eAAO,MAAM,yBAAyB,UAAW,SAAS,YACR,CAAC;AAEnD,eAAO,MAAM,4BAA4B,eAErB,KAAK,qBAAqB,EAAE,IAAI,CAAC,WACpC,QAAQ,OAAO,CAAC,oBACP,eAAe,KAClC,QAcF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deviceSetup.d.ts","sourceRoot":"","sources":["../../../../src/Device/deviceSetup.ts"],"names":[],"mappings":";AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"deviceSetup.d.ts","sourceRoot":"","sources":["../../../../src/Device/deviceSetup.ts"],"names":[],"mappings":";AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAI7D,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAO/C,OAAO,EAAE,MAAM,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,WAAW,QAAQ;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW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AAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,eAAO,MAAM,aAAa,WAEV,MAAM,qBACK,iBAAiB,sBAChB,MAAM,KAAK,IAAI,oBACjB,OAAO,KAAK,IAAI,cACtB,UAAU,GAAG,SAAS,+EAGnC,SAAS,SAAS,EAAE,QAAQ,IAAI,CAAC,CAuKnC,CAAC;AAEN,eAAO,MAAM,WAAW,WAER,sBAAsB,qBACX,iBAAiB,4BACV,MAAM,KAAK,IAAI,8BACb,MAAM,KAAK,IAAI,cAC/B,UAAU,GAAG,SAAS,KACnC,SAAS,SAAS,CA8BhB,CAAC"}
|
|
@@ -9,11 +9,13 @@ export type DropdownProps<T> = {
|
|
|
9
9
|
defaultButtonLabel?: string;
|
|
10
10
|
items: DropdownItem<T>[];
|
|
11
11
|
onSelect: (item: DropdownItem<T>) => void;
|
|
12
|
+
transparentButtonBg?: boolean;
|
|
13
|
+
minWidth?: boolean;
|
|
12
14
|
disabled?: boolean;
|
|
13
15
|
selectedItem: DropdownItem<T>;
|
|
14
16
|
numItemsBeforeScroll?: number;
|
|
15
17
|
className?: string;
|
|
16
18
|
};
|
|
17
|
-
declare const _default: <T>({ id, label, defaultButtonLabel, items, onSelect, disabled, selectedItem, numItemsBeforeScroll, className, }: DropdownProps<T>) => JSX.Element;
|
|
19
|
+
declare const _default: <T>({ id, label, defaultButtonLabel, items, onSelect, transparentButtonBg, minWidth, disabled, selectedItem, numItemsBeforeScroll, className, }: DropdownProps<T>) => JSX.Element;
|
|
18
20
|
export default _default;
|
|
19
21
|
//# sourceMappingURL=Dropdown.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../../../src/Dropdown/Dropdown.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAOxC,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,MAAM;IACpC,KAAK,EAAE,KAAK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AAY,CAAC,CAAC,CAAC,CAAC;IAC9B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;;AAEF,wBAgGE"}
|
|
@@ -10,6 +10,7 @@ interface Props {
|
|
|
10
10
|
onKeyboardIncrementAction?: () => string;
|
|
11
11
|
onKeyboardDecrementAction?: () => string;
|
|
12
12
|
className?: string;
|
|
13
|
+
title?: string;
|
|
13
14
|
textAlignLeft?: boolean;
|
|
14
15
|
onValidityChanged?: (validity: boolean) => void;
|
|
15
16
|
preventDefaultInvalidStyle?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlineInput.d.ts","sourceRoot":"","sources":["../../../../src/InlineInput/InlineInput.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAI3D,OAAO,qBAAqB,CAAC;AA0B7B,eAAO,MAAM,sCAAsC,wDAEf,IAAI,MAUvC,CAAC;AAEF,UAAU,KAAK;IACX,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IACrC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,yBAAyB,CAAC,EAAE,MAAM,MAAM,CAAC;IACzC,yBAAyB,CAAC,EAAE,MAAM,MAAM,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACxC;AAED,QAAA,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"InlineInput.d.ts","sourceRoot":"","sources":["../../../../src/InlineInput/InlineInput.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAI3D,OAAO,qBAAqB,CAAC;AA0B7B,eAAO,MAAM,sCAAsC,wDAEf,IAAI,MAUvC,CAAC;AAEF,UAAU,KAAK;IACX,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IACrC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,yBAAyB,CAAC,EAAE,MAAM,MAAM,CAAC;IACzC,yBAAyB,CAAC,EAAE,MAAM,MAAM,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACxC;AAED,QAAA,MAAM,WAAW,gFA+HhB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -6,12 +6,13 @@ interface NumberInlineInput {
|
|
|
6
6
|
value: number;
|
|
7
7
|
range: RangeOrValues;
|
|
8
8
|
className?: string;
|
|
9
|
+
title?: string;
|
|
9
10
|
onChange: (value: number) => void;
|
|
10
11
|
onChangeComplete?: (value: number) => void;
|
|
11
12
|
textAlignLeft?: boolean;
|
|
12
13
|
onValidityChanged?: (validity: boolean) => void;
|
|
13
14
|
preventDefaultInvalidStyle?: boolean;
|
|
14
15
|
}
|
|
15
|
-
declare const _default: ({ disabled, value, range, className, onChange, onChangeComplete, textAlignLeft, onValidityChanged, preventDefaultInvalidStyle, }: NumberInlineInput) => JSX.Element;
|
|
16
|
+
declare const _default: ({ disabled, value, range, className, title, onChange, onChangeComplete, textAlignLeft, onValidityChanged, preventDefaultInvalidStyle, }: NumberInlineInput) => JSX.Element;
|
|
16
17
|
export default _default;
|
|
17
18
|
//# sourceMappingURL=NumberInlineInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInlineInput.d.ts","sourceRoot":"","sources":["../../../../src/InlineInput/NumberInlineInput.tsx"],"names":[],"mappings":";AASA,OAAO,EAIH,aAAa,EAGhB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,4BAA4B,CAAC;AAEpC,UAAU,iBAAiB;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,aAAa,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACxC;
|
|
1
|
+
{"version":3,"file":"NumberInlineInput.d.ts","sourceRoot":"","sources":["../../../../src/InlineInput/NumberInlineInput.tsx"],"names":[],"mappings":";AASA,OAAO,EAIH,aAAa,EAGhB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,4BAA4B,CAAC;AAEpC,UAAU,iBAAiB;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,aAAa,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACxC;kKA4EE,iBAAiB;AAXpB,wBAkDE"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type DropdownItem } from '../Dropdown/Dropdown';
|
|
3
|
+
import { RangeOrValues } from '../Slider/range';
|
|
4
|
+
interface DropdownUnit<T> {
|
|
5
|
+
selectedItem: DropdownItem<T>;
|
|
6
|
+
items: DropdownItem<T>[];
|
|
7
|
+
onUnitChange: (unit: DropdownItem<T>) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: <T>({ range, value, onChange, onChangeComplete, className, disabled, label, title, unit, showSlider, minWidth, }: {
|
|
10
|
+
range: RangeOrValues;
|
|
11
|
+
value: number;
|
|
12
|
+
onChange: (value: number) => void;
|
|
13
|
+
onChangeComplete?: ((value: number) => void) | undefined;
|
|
14
|
+
className?: string | undefined;
|
|
15
|
+
disabled?: boolean | undefined;
|
|
16
|
+
label: React.ReactNode;
|
|
17
|
+
title?: string | undefined;
|
|
18
|
+
showSlider?: boolean | undefined;
|
|
19
|
+
unit?: React.ReactNode | DropdownUnit<T>;
|
|
20
|
+
minWidth?: boolean | undefined;
|
|
21
|
+
}) => JSX.Element;
|
|
22
|
+
export default _default;
|
|
23
|
+
//# sourceMappingURL=NumberInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../../../src/NumberInput/NumberInput.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAiB,EAAE,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAsChD,UAAU,YAAY,CAAC,CAAC;IACpB,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IAC9B,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;IACzB,YAAY,EAAE,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;CACjD;;WAuBU,aAAa;WACb,MAAM;sBACK,MAAM,KAAK,IAAI;gCACN,MAAM,KAAK,IAAI;;;WAGnC,MAAM,SAAS;;;;;;AAnB1B,wBAsEE"}
|
|
@@ -35,7 +35,7 @@ export { default as SidePanel } from './SidePanel/SidePanel';
|
|
|
35
35
|
export { Group, CollapsibleGroup } from './SidePanel/Group';
|
|
36
36
|
export { default as InlineInput } from './InlineInput/InlineInput';
|
|
37
37
|
export { default as NumberInlineInput } from './InlineInput/NumberInlineInput';
|
|
38
|
-
export { default as
|
|
38
|
+
export { default as NumberInput } from './NumberInput/NumberInput';
|
|
39
39
|
export { default as NumberInputWithDropdown } from './InlineInput/NumberInputWithDropdown';
|
|
40
40
|
export type { NumberDropdownItem } from './InlineInput/NumberInputWithDropdown';
|
|
41
41
|
export { default as Spinner } from './Spinner/Spinner';
|
|
@@ -64,6 +64,7 @@ export { jprogDeviceSetup } from './Device/jprogOperations';
|
|
|
64
64
|
export { sdfuDeviceSetup } from './Device/sdfuOperations';
|
|
65
65
|
export { selectedDevice, selectedDeviceInfo, getReadbackProtection, persistSerialPortOptions, type Device, } from './Device/deviceSlice';
|
|
66
66
|
export { setWaitForDevice, getAutoReselect, getWaitingForDeviceTimeout, getWaitingToAutoReselect, getWaitForDevice, clearWaitForDevice, } from './Device/deviceAutoSelectSlice';
|
|
67
|
+
export { addConfirmBeforeClose, clearConfirmBeforeClose, preventAppCloseUntilComplete, } from './ConfirmBeforeClose/confirmBeforeCloseSlice';
|
|
67
68
|
export { deviceInfo } from './Device/deviceInfo/deviceInfo';
|
|
68
69
|
export { isDeviceInDFUBootloader } from './Device/sdfuOperations';
|
|
69
70
|
export { default as sdfuOperations, switchToBootloaderMode, switchToApplicationMode, } from './Device/sdfuOperations';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,kBAAkB;;;;;;;;;CAA6B,CAAC;AAE7D,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EACH,OAAO,IAAI,cAAc,EACzB,KAAK,KAAK,IAAI,mBAAmB,GACpC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACH,MAAM,EACN,aAAa,EACb,kBAAkB,EAClB,UAAU,EACV,WAAW,EACX,YAAY,EACZ,YAAY,GACf,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACpD,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,E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AAM,IAAI,WAAW,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -11,6 +11,7 @@ export declare const rootReducerSpec: (appReducer?: Reducer) => {
|
|
|
11
11
|
log: Reducer<import("./Log/logSlice").Log, AnyAction>;
|
|
12
12
|
shortcuts: Reducer<import("./About/shortcutSlice").ShortcutState, AnyAction>;
|
|
13
13
|
flashMessages: Reducer<import("./FlashMessage/FlashMessageSlice").FlashMessages, AnyAction>;
|
|
14
|
+
confirmBeforeCloseDialog: Reducer<import("./ConfirmBeforeClose/confirmBeforeCloseSlice").ConfirmBeforeCloseState, AnyAction>;
|
|
14
15
|
};
|
|
15
16
|
declare const store: (appReducer?: Reducer) => import("@reduxjs/toolkit/dist/configureStore").ToolkitStore<{
|
|
16
17
|
app: any;
|
|
@@ -23,6 +24,7 @@ declare const store: (appReducer?: Reducer) => import("@reduxjs/toolkit/dist/con
|
|
|
23
24
|
log: import("./Log/logSlice").Log;
|
|
24
25
|
shortcuts: import("./About/shortcutSlice").ShortcutState;
|
|
25
26
|
flashMessages: import("./FlashMessage/FlashMessageSlice").FlashMessages;
|
|
27
|
+
confirmBeforeCloseDialog: import("./ConfirmBeforeClose/confirmBeforeCloseSlice").ConfirmBeforeCloseState;
|
|
26
28
|
}, AnyAction, import("@reduxjs/toolkit").MiddlewareArray<[import("@reduxjs/toolkit").ThunkMiddleware<{
|
|
27
29
|
app: any;
|
|
28
30
|
appLayout: import("./App/appLayout").AppLayout;
|
|
@@ -34,6 +36,7 @@ declare const store: (appReducer?: Reducer) => import("@reduxjs/toolkit/dist/con
|
|
|
34
36
|
log: import("./Log/logSlice").Log;
|
|
35
37
|
shortcuts: import("./About/shortcutSlice").ShortcutState;
|
|
36
38
|
flashMessages: import("./FlashMessage/FlashMessageSlice").FlashMessages;
|
|
39
|
+
confirmBeforeCloseDialog: import("./ConfirmBeforeClose/confirmBeforeCloseSlice").ConfirmBeforeCloseState;
|
|
37
40
|
}, AnyAction, undefined>]>>;
|
|
38
41
|
declare const concreteStore: import("@reduxjs/toolkit/dist/configureStore").ToolkitStore<{
|
|
39
42
|
app: any;
|
|
@@ -46,6 +49,7 @@ declare const concreteStore: import("@reduxjs/toolkit/dist/configureStore").Tool
|
|
|
46
49
|
log: import("./Log/logSlice").Log;
|
|
47
50
|
shortcuts: import("./About/shortcutSlice").ShortcutState;
|
|
48
51
|
flashMessages: import("./FlashMessage/FlashMessageSlice").FlashMessages;
|
|
52
|
+
confirmBeforeCloseDialog: import("./ConfirmBeforeClose/confirmBeforeCloseSlice").ConfirmBeforeCloseState;
|
|
49
53
|
}, AnyAction, import("@reduxjs/toolkit").MiddlewareArray<[import("@reduxjs/toolkit").ThunkMiddleware<{
|
|
50
54
|
app: any;
|
|
51
55
|
appLayout: import("./App/appLayout").AppLayout;
|
|
@@ -57,6 +61,7 @@ declare const concreteStore: import("@reduxjs/toolkit/dist/configureStore").Tool
|
|
|
57
61
|
log: import("./Log/logSlice").Log;
|
|
58
62
|
shortcuts: import("./About/shortcutSlice").ShortcutState;
|
|
59
63
|
flashMessages: import("./FlashMessage/FlashMessageSlice").FlashMessages;
|
|
64
|
+
confirmBeforeCloseDialog: import("./ConfirmBeforeClose/confirmBeforeCloseSlice").ConfirmBeforeCloseState;
|
|
60
65
|
}, AnyAction, undefined>]>>;
|
|
61
66
|
export type AppThunk<AppLayout = RootState, ReturnType = void> = ThunkAction<ReturnType, AppLayout, unknown, AnyAction>;
|
|
62
67
|
export type RootState = ReturnType<typeof concreteStore.getState>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/store.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAkB,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/store.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAkB,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAkBhC,eAAO,MAAM,eAAe,gBAAgB,OAAO;;;;;;;;;;;;CAYjD,CAAC;AAEH,QAAA,MAAM,KAAK,gBAAiB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;2BAW7B,CAAC;AAGP,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;2BAAU,CAAC;AAE9B,MAAM,MAAM,QAAQ,CAAC,SAAS,GAAG,SAAS,EAAE,UAAU,GAAG,IAAI,IAAI,WAAW,CACxE,UAAU,EACV,SAAS,EACT,OAAO,EACP,SAAS,CACZ,CAAC;AACF,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,QAAQ,CAAC,CAAC;AAClE,MAAM,MAAM,WAAW,GAAG,OAAO,aAAa,CAAC,QAAQ,CAAC;AAExD,MAAM,WAAW,eAAe,CAAC,QAAQ,CAAE,SAAQ,SAAS;IACxD,GAAG,EAAE,QAAQ,CAAC;CACjB;AAED,eAAe,KAAK,CAAC"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2023 Nordic Semiconductor ASA
|
|
3
|
-
*
|
|
4
|
-
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React from 'react';
|
|
8
|
-
|
|
9
|
-
import NumberInlineInput from '../InlineInput/NumberInlineInput';
|
|
10
|
-
import { RangeOrValues } from '../Slider/range';
|
|
11
|
-
import Slider from '../Slider/Slider';
|
|
12
|
-
import classNames from '../utils/classNames';
|
|
13
|
-
|
|
14
|
-
export default ({
|
|
15
|
-
range,
|
|
16
|
-
value,
|
|
17
|
-
onChange,
|
|
18
|
-
onChangeComplete,
|
|
19
|
-
className,
|
|
20
|
-
disabled,
|
|
21
|
-
label,
|
|
22
|
-
unit,
|
|
23
|
-
}: {
|
|
24
|
-
range: RangeOrValues;
|
|
25
|
-
value: number;
|
|
26
|
-
onChange: (value: number) => void;
|
|
27
|
-
onChangeComplete?: (value: number) => void;
|
|
28
|
-
className?: string;
|
|
29
|
-
disabled?: boolean;
|
|
30
|
-
label?: React.ReactNode;
|
|
31
|
-
unit?: React.ReactNode;
|
|
32
|
-
}) => (
|
|
33
|
-
<div
|
|
34
|
-
className={`tw-flex tw-flex-col tw-gap-1 tw-text-xs ${classNames(
|
|
35
|
-
className
|
|
36
|
-
)}`}
|
|
37
|
-
>
|
|
38
|
-
{label && (
|
|
39
|
-
<div className="tw-flex tw-justify-between">
|
|
40
|
-
{label}
|
|
41
|
-
<div className="tw-flex tw-flex-row">
|
|
42
|
-
<NumberInlineInput
|
|
43
|
-
value={value}
|
|
44
|
-
range={range}
|
|
45
|
-
onChange={onChange}
|
|
46
|
-
onChangeComplete={onChangeComplete}
|
|
47
|
-
disabled={disabled}
|
|
48
|
-
/>
|
|
49
|
-
{unit}
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
|
-
)}
|
|
53
|
-
{Array.isArray(range) ? (
|
|
54
|
-
<Slider
|
|
55
|
-
values={[range.indexOf(value)]}
|
|
56
|
-
onChange={[i => onChange(range[i])]}
|
|
57
|
-
onChangeComplete={() => onChangeComplete?.(value)}
|
|
58
|
-
range={{
|
|
59
|
-
min: 0,
|
|
60
|
-
max: range.length - 1,
|
|
61
|
-
}}
|
|
62
|
-
disabled={disabled}
|
|
63
|
-
/>
|
|
64
|
-
) : (
|
|
65
|
-
<Slider
|
|
66
|
-
values={[value]}
|
|
67
|
-
onChange={[onChange]}
|
|
68
|
-
onChangeComplete={() => onChangeComplete?.(value)}
|
|
69
|
-
range={range}
|
|
70
|
-
disabled={disabled}
|
|
71
|
-
/>
|
|
72
|
-
)}
|
|
73
|
-
</div>
|
|
74
|
-
);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { RangeOrValues } from '../Slider/range';
|
|
3
|
-
declare const _default: ({ range, value, onChange, onChangeComplete, className, disabled, label, unit, }: {
|
|
4
|
-
range: RangeOrValues;
|
|
5
|
-
value: number;
|
|
6
|
-
onChange: (value: number) => void;
|
|
7
|
-
onChangeComplete?: ((value: number) => void) | undefined;
|
|
8
|
-
className?: string | undefined;
|
|
9
|
-
disabled?: boolean | undefined;
|
|
10
|
-
label?: React.ReactNode;
|
|
11
|
-
unit?: React.ReactNode;
|
|
12
|
-
}) => JSX.Element;
|
|
13
|
-
export default _default;
|
|
14
|
-
//# sourceMappingURL=NumberInputSliderWithUnit.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInputSliderWithUnit.d.ts","sourceRoot":"","sources":["../../../../src/NumberInputWithSlider/NumberInputSliderWithUnit.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;;WAcrC,aAAa;WACb,MAAM;sBACK,MAAM,KAAK,IAAI;gCACN,MAAM,KAAK,IAAI;;;YAGlC,MAAM,SAAS;WAChB,MAAM,SAAS;;AAjB1B,wBA4DE"}
|