@workday/canvas-kit-react 9.1.8 → 9.1.10

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.
@@ -7,10 +7,10 @@ export const reorganizeHiddenItems = (
7
7
  const totalSize = items.length;
8
8
  const itemSpace = totalSize - hiddenIds.length;
9
9
 
10
- if (itemSpace <= 2) {
10
+ if (totalSize > 2 && itemSpace <= 2) {
11
11
  // Keep only last items if there is place for two or less items
12
12
  updatedHiddenIds = items.slice(0, totalSize - 1).map(getId);
13
- } else if (itemSpace === 3) {
13
+ } else if (totalSize > 3 && itemSpace === 3) {
14
14
  // Always keep first and last item if there is place for 3 items
15
15
  updatedHiddenIds = items.slice(1, totalSize - 1).map(getId);
16
16
  } else if (itemSpace > 3 && itemSpace < totalSize) {
@@ -5,11 +5,11 @@ const reorganizeHiddenItems = (items, hiddenIds, getId) => {
5
5
  let updatedHiddenIds = hiddenIds;
6
6
  const totalSize = items.length;
7
7
  const itemSpace = totalSize - hiddenIds.length;
8
- if (itemSpace <= 2) {
8
+ if (totalSize > 2 && itemSpace <= 2) {
9
9
  // Keep only last items if there is place for two or less items
10
10
  updatedHiddenIds = items.slice(0, totalSize - 1).map(getId);
11
11
  }
12
- else if (itemSpace === 3) {
12
+ else if (totalSize > 3 && itemSpace === 3) {
13
13
  // Always keep first and last item if there is place for 3 items
14
14
  updatedHiddenIds = items.slice(1, totalSize - 1).map(getId);
15
15
  }
@@ -2,11 +2,11 @@ export const reorganizeHiddenItems = (items, hiddenIds, getId) => {
2
2
  let updatedHiddenIds = hiddenIds;
3
3
  const totalSize = items.length;
4
4
  const itemSpace = totalSize - hiddenIds.length;
5
- if (itemSpace <= 2) {
5
+ if (totalSize > 2 && itemSpace <= 2) {
6
6
  // Keep only last items if there is place for two or less items
7
7
  updatedHiddenIds = items.slice(0, totalSize - 1).map(getId);
8
8
  }
9
- else if (itemSpace === 3) {
9
+ else if (totalSize > 3 && itemSpace === 3) {
10
10
  // Always keep first and last item if there is place for 3 items
11
11
  updatedHiddenIds = items.slice(1, totalSize - 1).map(getId);
12
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-react",
3
- "version": "9.1.8",
3
+ "version": "9.1.10",
4
4
  "description": "The parent module that contains all Workday Canvas Kit React components",
5
5
  "author": "Workday, Inc. (https://www.workday.com)",
6
6
  "license": "Apache-2.0",
@@ -49,7 +49,7 @@
49
49
  "@emotion/styled": "^11.6.0",
50
50
  "@popperjs/core": "^2.5.4",
51
51
  "@workday/canvas-colors-web": "^2.0.0",
52
- "@workday/canvas-kit-popup-stack": "^9.1.8",
52
+ "@workday/canvas-kit-popup-stack": "^9.1.10",
53
53
  "@workday/canvas-system-icons-web": "^3.0.0",
54
54
  "@workday/design-assets-types": "^0.2.8",
55
55
  "chroma-js": "^2.1.0",
@@ -66,5 +66,5 @@
66
66
  "@workday/canvas-accent-icons-web": "^3.0.0",
67
67
  "@workday/canvas-applet-icons-web": "^2.0.0"
68
68
  },
69
- "gitHead": "c12505777b772a702fc76b668cea0bd0b70b0a96"
69
+ "gitHead": "5b580d6e1e0e3f6c2e036c5b83cac07f325905c2"
70
70
  }