@budibase/bbui 2.4.12-alpha.0 → 2.4.13

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/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.12-alpha.0",
4
+ "version": "2.4.13",
5
5
  "license": "MPL-2.0",
6
6
  "svelte": "src/index.js",
7
7
  "module": "dist/bbui.es.js",
@@ -38,8 +38,7 @@
38
38
  ],
39
39
  "dependencies": {
40
40
  "@adobe/spectrum-css-workflow-icons": "1.2.1",
41
- "@budibase/shared-core": "2.4.12-alpha.0",
42
- "@budibase/string-templates": "2.4.12-alpha.0",
41
+ "@budibase/string-templates": "^2.4.13",
43
42
  "@spectrum-css/accordion": "3.0.24",
44
43
  "@spectrum-css/actionbutton": "1.0.1",
45
44
  "@spectrum-css/actiongroup": "1.0.1",
@@ -90,5 +89,5 @@
90
89
  "resolutions": {
91
90
  "loader-utils": "1.4.1"
92
91
  },
93
- "gitHead": "b5b20e239ee8e5d1172dca2a16538587a58a91e4"
92
+ "gitHead": "dc9227e389c4e725cbf63ebae79d8f44e908973f"
94
93
  }
@@ -113,9 +113,6 @@
113
113
  .spectrum-ActionButton--quiet {
114
114
  padding: 0 8px;
115
115
  }
116
- .spectrum-ActionButton--quiet.is-selected {
117
- color: var(--spectrum-global-color-gray-900);
118
- }
119
116
  .is-selected:not(.emphasized) .spectrum-Icon {
120
117
  color: var(--spectrum-global-color-gray-900);
121
118
  }
@@ -31,7 +31,6 @@ export default function positionDropdown(element, opts) {
31
31
  styles.top = anchorBounds.top
32
32
  } else if (window.innerHeight - anchorBounds.bottom < 100) {
33
33
  styles.top = anchorBounds.top - elementBounds.height - offset
34
- styles.maxHeight = 240
35
34
  } else {
36
35
  styles.top = anchorBounds.bottom + offset
37
36
  styles.maxHeight = window.innerHeight - anchorBounds.bottom - 20
@@ -29,14 +29,6 @@
29
29
  visible = false
30
30
  }
31
31
 
32
- export function toggle() {
33
- if (visible) {
34
- hide()
35
- } else {
36
- show()
37
- }
38
- }
39
-
40
32
  export function cancel() {
41
33
  if (!visible) {
42
34
  return
@@ -69,7 +61,7 @@
69
61
  }
70
62
  }
71
63
 
72
- setContext(Context.Modal, { show, hide, toggle, cancel })
64
+ setContext(Context.Modal, { show, hide, cancel })
73
65
 
74
66
  onMount(() => {
75
67
  document.addEventListener("keydown", handleKey)
package/src/helpers.js CHANGED
@@ -1,6 +1,3 @@
1
- import { helpers } from "@budibase/shared-core"
2
- export const deepGet = helpers.deepGet
3
-
4
1
  /**
5
2
  * Generates a DOM safe UUID.
6
3
  * Starting with a letter is important to make it DOM safe.
@@ -44,6 +41,30 @@ export const hashString = string => {
44
41
  return hash.toString()
45
42
  }
46
43
 
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
+
47
68
  /**
48
69
  * Sets a key within an object. The key supports dot syntax for retrieving deep
49
70
  * fields - e.g. "a.b.c".