@draftbit/core 48.5.0 → 48.5.1-cd9561.2
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/lib/commonjs/components/Picker/PickerCommon.js +1 -1
- package/lib/typescript/src/components/Picker/PickerCommon.js +4 -2
- package/lib/typescript/src/components/Picker/PickerCommon.js.map +1 -1
- package/lib/typescript/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/components/Picker/PickerCommon.js +4 -2
- package/src/components/Picker/PickerCommon.js.map +1 -1
- package/src/components/Picker/PickerCommon.ts +6 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "48.5.
|
|
3
|
+
"version": "48.5.1-cd9561.2+cd95611",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"types": "lib/typescript/src/index.d.ts",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@date-io/date-fns": "^1.3.13",
|
|
43
43
|
"@draftbit/react-theme-provider": "^2.1.1",
|
|
44
|
-
"@draftbit/types": "48.
|
|
44
|
+
"@draftbit/types": "^48.5.1-cd9561.2+cd95611",
|
|
45
45
|
"@expo/vector-icons": "^13.0.0",
|
|
46
46
|
"@material-ui/core": "^4.11.0",
|
|
47
47
|
"@material-ui/pickers": "^3.2.10",
|
|
@@ -102,5 +102,5 @@
|
|
|
102
102
|
],
|
|
103
103
|
"testEnvironment": "node"
|
|
104
104
|
},
|
|
105
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "cd956112ba83abec0850379b45850cdf38b345fd"
|
|
106
106
|
}
|
|
@@ -4,13 +4,15 @@ export function normalizeToPickerOptions(options) {
|
|
|
4
4
|
return [];
|
|
5
5
|
}
|
|
6
6
|
const firstOption = options[0];
|
|
7
|
-
if (typeof firstOption ===
|
|
7
|
+
if (typeof firstOption === "string" || typeof firstOption === "number") {
|
|
8
8
|
return options.map((option) => ({
|
|
9
9
|
label: option,
|
|
10
10
|
value: option,
|
|
11
11
|
}));
|
|
12
12
|
}
|
|
13
|
-
if (isObject(firstOption) &&
|
|
13
|
+
if (isObject(firstOption) &&
|
|
14
|
+
firstOption.value !== undefined &&
|
|
15
|
+
firstOption.label !== undefined) {
|
|
14
16
|
return options.map((option) => {
|
|
15
17
|
return {
|
|
16
18
|
label: option.label,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PickerCommon.js","sourceRoot":"","sources":["PickerCommon.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAkDlC,MAAM,UAAU,wBAAwB,CACtC,OAA6C;IAE7C,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;QACxB,OAAO,EAAE,CAAC;KACX;IAED,MAAM,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAE/B,IAAI,OAAO,WAAW,KAAK,
|
|
1
|
+
{"version":3,"file":"PickerCommon.js","sourceRoot":"","sources":["PickerCommon.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAkDlC,MAAM,UAAU,wBAAwB,CACtC,OAA6C;IAE7C,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;QACxB,OAAO,EAAE,CAAC;KACX;IAED,MAAM,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAE/B,IAAI,OAAO,WAAW,KAAK,QAAQ,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;QACtE,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YAC9B,KAAK,EAAE,MAAyB;YAChC,KAAK,EAAE,MAAyB;SACjC,CAAC,CAAC,CAAC;KACL;IAED,IACE,QAAQ,CAAC,WAAW,CAAC;QACrB,WAAW,CAAC,KAAK,KAAK,SAAS;QAC/B,WAAW,CAAC,KAAK,KAAK,SAAS,EAC/B;QACA,OAAQ,OAA0B,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YAChD,OAAO;gBACL,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,KAAK,EAAE,MAAM,CAAC,KAAK;aACpB,CAAC;QACJ,CAAC,CAAC,CAAC;KACJ;IAED,MAAM,IAAI,KAAK,CACb,6IAA6I,CAC9I,CAAC;AACJ,CAAC"}
|
|
@@ -59,14 +59,18 @@ export function normalizeToPickerOptions(
|
|
|
59
59
|
|
|
60
60
|
const firstOption = options[0];
|
|
61
61
|
|
|
62
|
-
if (typeof firstOption ===
|
|
62
|
+
if (typeof firstOption === "string" || typeof firstOption === "number") {
|
|
63
63
|
return options.map((option) => ({
|
|
64
64
|
label: option as string | number,
|
|
65
65
|
value: option as string | number,
|
|
66
66
|
}));
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
if (
|
|
69
|
+
if (
|
|
70
|
+
isObject(firstOption) &&
|
|
71
|
+
firstOption.value !== undefined &&
|
|
72
|
+
firstOption.label !== undefined
|
|
73
|
+
) {
|
|
70
74
|
return (options as PickerOption[]).map((option) => {
|
|
71
75
|
return {
|
|
72
76
|
label: option.label,
|