@k-int/stripes-kint-components 5.8.0 → 5.8.1

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
@@ -1,3 +1,10 @@
1
+ ## [5.8.1](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/compare/v5.8.0...v5.8.1) (2024-07-22)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * NumberField treating 0 as undefined ([75bd7d3](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/commit/75bd7d33c77f103df6dd0efdde059b90dc3a9b8f))
7
+
1
8
  # [5.8.0](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/compare/v5.7.1...v5.8.0) (2024-06-27)
2
9
 
3
10
 
@@ -32,7 +32,7 @@ const EditSettingValue = props => {
32
32
 
33
33
  // Adding default sort to refdata object in ascending order by label
34
34
  const sortByLabel = (a, b) => a.label.localeCompare(b.label);
35
- const sortedRefdata = refdata.sort(sortByLabel);
35
+ const sortedRefdata = refdata?.sort(sortByLabel);
36
36
  switch (setting.settingType) {
37
37
  case 'Refdata':
38
38
  // Grab refdata values corresponding to setting
@@ -55,7 +55,7 @@ const NumberField = props => {
55
55
  const parsedValue = parseFloat(e.target.value);
56
56
 
57
57
  // ReturnValue needed for contorlled components
58
- if (parsedValue) {
58
+ if (parsedValue || parsedValue === 0) {
59
59
  setNumValue(parsedValue);
60
60
  changeField(parsedValue);
61
61
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k-int/stripes-kint-components",
3
- "version": "5.8.0",
3
+ "version": "5.8.1",
4
4
  "description": "Stripes Component library for K-Int specific applications",
5
5
  "sideEffects": [
6
6
  "*.css"
@@ -9,7 +9,7 @@
9
9
  "scripts": {
10
10
  "lint": "eslint src --resolve-plugins-relative-to ./node_modules/@folio/eslint-config-stripes/",
11
11
  "test": "yarn run test:jest",
12
- "test:jest": "jest --ci --coverage",
12
+ "test:jest": "jest --ci --coverage --maxWorkers=50%",
13
13
  "build:es": "rm -rf ./es && babel --extensions .js --ignore ./src/**/tests/**/* ./src --out-dir es",
14
14
  "build": "yarn build:es",
15
15
  "clean": "rm -rf ./node_modules ./*/node_modules ./yarn.lock && yarn install --ignore-scripts",
@@ -29,7 +29,7 @@ const EditSettingValue = (props) => {
29
29
 
30
30
  // Adding default sort to refdata object in ascending order by label
31
31
  const sortByLabel = (a, b) => (a.label.localeCompare(b.label));
32
- const sortedRefdata = refdata.sort(sortByLabel);
32
+ const sortedRefdata = refdata?.sort(sortByLabel);
33
33
 
34
34
  switch (setting.settingType) {
35
35
  case 'Refdata':
@@ -65,7 +65,7 @@ const NumberField = (props) => {
65
65
  const parsedValue = parseFloat(e.target.value);
66
66
 
67
67
  // ReturnValue needed for contorlled components
68
- if (parsedValue) {
68
+ if (parsedValue || parsedValue === 0) {
69
69
  setNumValue(parsedValue);
70
70
  changeField(parsedValue);
71
71
  } else {