@nordicsemiconductor/pc-nrfconnect-shared 166.0.0 → 168.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 CHANGED
@@ -7,6 +7,20 @@ 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
+ ## 168.0.0 - 2024-03-22
11
+
12
+ ### Fixed
13
+
14
+ - `Slider` with range handle never reached max
15
+
16
+ ## 167.0.0 - 2024-03-08
17
+
18
+ ### Fixed
19
+
20
+ - `Group` will not collapse on click unless collapsible property is set
21
+ - `ConfirmCloseDialog` now cancels launcher's request to reload. Requires
22
+ engine version 4.4.1
23
+
10
24
  ## 166.0.0 - 2024-03-05
11
25
 
12
26
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nordicsemiconductor/pc-nrfconnect-shared",
3
- "version": "166.0.0",
3
+ "version": "168.0.0",
4
4
  "description": "Shared commodities for developing pc-nrfconnect-* packages",
5
5
  "repository": {
6
6
  "type": "git",
@@ -72,6 +72,7 @@ export default () => {
72
72
  }
73
73
  }}
74
74
  onCancel={() => {
75
+ getCurrentWindow().emit('restart-cancelled');
75
76
  dispatch(setShowCloseDialog(false));
76
77
  confirmedDialogs.forEach(confirmedDialog =>
77
78
  dispatch(addConfirmBeforeClose(confirmedDialog))
@@ -100,11 +100,14 @@ export const Group = ({
100
100
  <div className={className}>
101
101
  <button
102
102
  className={classNames(
103
- 'tw-row tw-preflight tw-flex tw-items-center tw-justify-between tw-text-left',
104
- headingFullWidth && 'tw-w-full'
103
+ 'tw-row tw-preflight tw- tw-flex tw-items-center tw-justify-between tw-text-left',
104
+ headingFullWidth && 'tw-w-full',
105
+ !collapsible && ' tw-cursor-default'
105
106
  )}
106
107
  type="button"
107
108
  onClick={() => {
109
+ if (!collapsible) return;
110
+
108
111
  if (!collapsibleDivRef.current || !initStateSet.current)
109
112
  return;
110
113
 
@@ -12,17 +12,20 @@ export const constrainedToPercentage = (percentage: number) => {
12
12
  return percentage;
13
13
  };
14
14
 
15
- export const toPercentage = (value: number, rangeOrValues: RangeOrValues) => {
15
+ export const toPercentage = (
16
+ valueOrIndex: number,
17
+ rangeOrValues: RangeOrValues
18
+ ) => {
16
19
  if (isValues(rangeOrValues)) {
17
- const max = rangeOrValues.length;
20
+ const max = Math.max(0, rangeOrValues.length - 1);
18
21
 
19
22
  // value is an index in the case of explicit values
20
- return (value * 100) / max;
23
+ return (valueOrIndex * 100) / max;
21
24
  }
22
25
  const min = getMin(rangeOrValues);
23
26
  const max = getMax(rangeOrValues);
24
27
 
25
- return ((value - min) * 100) / (max - min);
28
+ return ((valueOrIndex - min) * 100) / (max - min);
26
29
  };
27
30
 
28
31
  export const fromPercentage = (
@@ -57,7 +60,6 @@ export const fromPercentage = (
57
60
  : closestPrevIndex;
58
61
  }
59
62
 
60
- console.log(computedValue, closestIndex);
61
63
  return closestIndex;
62
64
  }
63
65
 
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmCloseDialog.d.ts","sourceRoot":"","sources":["../../../../src/ConfirmBeforeClose/ConfirmCloseDialog.tsx"],"names":[],"mappings":";;AAqBA,wBA+DE"}
1
+ {"version":3,"file":"ConfirmCloseDialog.d.ts","sourceRoot":"","sources":["../../../../src/ConfirmBeforeClose/ConfirmCloseDialog.tsx"],"names":[],"mappings":";;AAqBA,wBAgEE"}
@@ -1 +1 @@
1
- {"version":3,"file":"Group.d.ts","sourceRoot":"","sources":["../../../../src/Group/Group.tsx"],"names":[],"mappings":"AAMA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAmEhD,eAAO,MAAM,KAAK;;aAYL,MAAM;;;eAGJ,MAAM,SAAS;;;;iCAIE,OAAO,KAAK,IAAI;iBAmF/C,CAAC"}
1
+ {"version":3,"file":"Group.d.ts","sourceRoot":"","sources":["../../../../src/Group/Group.tsx"],"names":[],"mappings":"AAMA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAmEhD,eAAO,MAAM,KAAK;;aAYL,MAAM;;;eAGJ,MAAM,SAAS;;;;iCAIE,OAAO,KAAK,IAAI;iBAsF/C,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { RangeOrValues } from './range';
2
2
  export declare const constrainedToPercentage: (percentage: number) => number;
3
- export declare const toPercentage: (value: number, rangeOrValues: RangeOrValues) => number;
3
+ export declare const toPercentage: (valueOrIndex: number, rangeOrValues: RangeOrValues) => number;
4
4
  export declare const fromPercentage: (lastValue: number, value: number, rangeOrValues: RangeOrValues, directionForward: boolean) => number;
5
5
  //# sourceMappingURL=percentage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"percentage.d.ts","sourceRoot":"","sources":["../../../../src/Slider/percentage.ts"],"names":[],"mappings":"AAMA,OAAO,EAA4B,aAAa,EAAE,MAAM,SAAS,CAAC;AAElE,eAAO,MAAM,uBAAuB,eAAgB,MAAM,WAIzD,CAAC;AAEF,eAAO,MAAM,YAAY,UAAW,MAAM,iBAAiB,aAAa,WAWvE,CAAC;AAEF,eAAO,MAAM,cAAc,cACZ,MAAM,SACV,MAAM,iBACE,aAAa,oBACV,OAAO,WAyC5B,CAAC"}
1
+ {"version":3,"file":"percentage.d.ts","sourceRoot":"","sources":["../../../../src/Slider/percentage.ts"],"names":[],"mappings":"AAMA,OAAO,EAA4B,aAAa,EAAE,MAAM,SAAS,CAAC;AAElE,eAAO,MAAM,uBAAuB,eAAgB,MAAM,WAIzD,CAAC;AAEF,eAAO,MAAM,YAAY,iBACP,MAAM,iBACL,aAAa,WAY/B,CAAC;AAEF,eAAO,MAAM,cAAc,cACZ,MAAM,SACV,MAAM,iBACE,aAAa,oBACV,OAAO,WAwC5B,CAAC"}