@budibase/bbui 2.4.17 → 2.4.19
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/dist/bbui.es.js +3 -3
- package/dist/bbui.es.js.map +1 -1
- package/package.json +4 -3
- package/src/helpers.js +3 -24
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/bbui",
|
|
3
3
|
"description": "A UI solution used in the different Budibase projects.",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.19",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"svelte": "src/index.js",
|
|
7
7
|
"module": "dist/bbui.es.js",
|
|
@@ -38,7 +38,8 @@
|
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@adobe/spectrum-css-workflow-icons": "1.2.1",
|
|
41
|
-
"@budibase/
|
|
41
|
+
"@budibase/shared-core": "^2.4.19",
|
|
42
|
+
"@budibase/string-templates": "^2.4.19",
|
|
42
43
|
"@spectrum-css/accordion": "3.0.24",
|
|
43
44
|
"@spectrum-css/actionbutton": "1.0.1",
|
|
44
45
|
"@spectrum-css/actiongroup": "1.0.1",
|
|
@@ -89,5 +90,5 @@
|
|
|
89
90
|
"resolutions": {
|
|
90
91
|
"loader-utils": "1.4.1"
|
|
91
92
|
},
|
|
92
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "fa438f99d138fd265394d68a9d1cd164852b96bb"
|
|
93
94
|
}
|
package/src/helpers.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { helpers } from "@budibase/shared-core"
|
|
2
|
+
export const deepGet = helpers.deepGet
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* Generates a DOM safe UUID.
|
|
3
6
|
* Starting with a letter is important to make it DOM safe.
|
|
@@ -41,30 +44,6 @@ export const hashString = string => {
|
|
|
41
44
|
return hash.toString()
|
|
42
45
|
}
|
|
43
46
|
|
|
44
|
-
/**
|
|
45
|
-
* Gets a key within an object. The key supports dot syntax for retrieving deep
|
|
46
|
-
* fields - e.g. "a.b.c".
|
|
47
|
-
* Exact matches of keys with dots in them take precedence over nested keys of
|
|
48
|
-
* the same path - e.g. getting "a.b" from { "a.b": "foo", a: { b: "bar" } }
|
|
49
|
-
* will return "foo" over "bar".
|
|
50
|
-
* @param obj the object
|
|
51
|
-
* @param key the key
|
|
52
|
-
* @return {*|null} the value or null if a value was not found for this key
|
|
53
|
-
*/
|
|
54
|
-
export const deepGet = (obj, key) => {
|
|
55
|
-
if (!obj || !key) {
|
|
56
|
-
return null
|
|
57
|
-
}
|
|
58
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
59
|
-
return obj[key]
|
|
60
|
-
}
|
|
61
|
-
const split = key.split(".")
|
|
62
|
-
for (let i = 0; i < split.length; i++) {
|
|
63
|
-
obj = obj?.[split[i]]
|
|
64
|
-
}
|
|
65
|
-
return obj
|
|
66
|
-
}
|
|
67
|
-
|
|
68
47
|
/**
|
|
69
48
|
* Sets a key within an object. The key supports dot syntax for retrieving deep
|
|
70
49
|
* fields - e.g. "a.b.c".
|