@gitlab/ui 52.13.0 → 52.13.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
|
+
## [52.13.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v52.13.0...v52.13.1) (2023-01-19)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **GlListBox:** allow item.value to be a number ([40173e4](https://gitlab.com/gitlab-org/gitlab-ui/commit/40173e494d447cfdb8fc0b438d6125011749b78e))
|
|
7
|
+
|
|
1
8
|
# [52.13.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v52.12.0...v52.13.0) (2023-01-18)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import _isNumber from 'lodash/isNumber';
|
|
1
2
|
import _isString from 'lodash/isString';
|
|
2
3
|
|
|
3
|
-
const isOption = item => Boolean(item) && _isString(item.value);
|
|
4
|
+
const isOption = item => Boolean(item) && (_isString(item.value) || _isNumber(item.value));
|
|
4
5
|
const isGroup = function () {
|
|
5
6
|
let {
|
|
6
7
|
options
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { isString } from 'lodash';
|
|
1
|
+
import { isString, isNumber } from 'lodash';
|
|
2
2
|
|
|
3
|
-
const isOption = (item) => Boolean(item) && isString(item.value);
|
|
3
|
+
const isOption = (item) => Boolean(item) && (isString(item.value) || isNumber(item.value));
|
|
4
4
|
|
|
5
5
|
const isGroup = ({ options } = {}) => Array.isArray(options) && options.every(isOption);
|
|
6
6
|
|
|
@@ -9,12 +9,14 @@ describe('isOption', () => {
|
|
|
9
9
|
}
|
|
10
10
|
);
|
|
11
11
|
|
|
12
|
-
it.each([
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
)
|
|
12
|
+
it.each([
|
|
13
|
+
{ value: '' },
|
|
14
|
+
{ value: 5.3 },
|
|
15
|
+
{ value: 'foo', text: 'bar' },
|
|
16
|
+
{ value: 'qux', foo: true },
|
|
17
|
+
])('isOption(%p) === true', (option) => {
|
|
18
|
+
expect(isOption(option)).toBe(true);
|
|
19
|
+
});
|
|
18
20
|
});
|
|
19
21
|
|
|
20
22
|
describe('flattenedOptions', () => {
|