@budibase/bbui 2.5.6-alpha.9 → 2.5.7

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.5.6-alpha.9",
4
+ "version": "2.5.7",
5
5
  "license": "MPL-2.0",
6
6
  "svelte": "src/index.js",
7
7
  "module": "dist/bbui.es.js",
@@ -38,8 +38,8 @@
38
38
  ],
39
39
  "dependencies": {
40
40
  "@adobe/spectrum-css-workflow-icons": "1.2.1",
41
- "@budibase/shared-core": "2.5.6-alpha.9",
42
- "@budibase/string-templates": "2.5.6-alpha.9",
41
+ "@budibase/shared-core": "^2.5.7",
42
+ "@budibase/string-templates": "^2.5.7",
43
43
  "@spectrum-css/accordion": "3.0.24",
44
44
  "@spectrum-css/actionbutton": "1.0.1",
45
45
  "@spectrum-css/actiongroup": "1.0.1",
@@ -84,11 +84,11 @@
84
84
  "@spectrum-css/vars": "3.0.1",
85
85
  "dayjs": "^1.10.4",
86
86
  "easymde": "^2.16.1",
87
- "svelte-flatpickr": "^3.3.2",
87
+ "svelte-flatpickr": "^3.2.3",
88
88
  "svelte-portal": "^1.0.0"
89
89
  },
90
90
  "resolutions": {
91
91
  "loader-utils": "1.4.1"
92
92
  },
93
- "gitHead": "560204d82570bd22b987e6e35f8e659e9c047425"
93
+ "gitHead": "6c37b6a6c69a1da43a5c0930419e743cc18b5b42"
94
94
  }
@@ -71,7 +71,7 @@
71
71
  {/if}
72
72
  {#if icon}
73
73
  <svg
74
- class="spectrum-Icon spectrum-Icon--sizeS"
74
+ class="spectrum-Icon spectrum-Icon--size{size}"
75
75
  focusable="false"
76
76
  aria-hidden="true"
77
77
  aria-label={icon}
@@ -6,9 +6,6 @@ let clickHandlers = []
6
6
  */
7
7
  const handleClick = event => {
8
8
  // Ignore click if this is an ignored class
9
- if (event.target.closest('[data-ignore-click-outside="true"]')) {
10
- return
11
- }
12
9
  for (let className of ignoredClasses) {
13
10
  if (event.target.closest(className)) {
14
11
  return
@@ -32,7 +29,6 @@ const handleClick = event => {
32
29
  })
33
30
  }
34
31
  document.documentElement.addEventListener("click", handleClick, true)
35
- document.documentElement.addEventListener("contextmenu", handleClick, true)
36
32
 
37
33
  /**
38
34
  * Adds or updates a click handler
@@ -10,14 +10,7 @@ export default function positionDropdown(element, opts) {
10
10
 
11
11
  // Updates the position of the dropdown
12
12
  const updatePosition = opts => {
13
- const {
14
- anchor,
15
- align,
16
- maxHeight,
17
- maxWidth,
18
- useAnchorWidth,
19
- offset = 5,
20
- } = opts
13
+ const { anchor, align, maxWidth, useAnchorWidth, offset = 5 } = opts
21
14
  if (!anchor) {
22
15
  return
23
16
  }
@@ -38,11 +31,10 @@ export default function positionDropdown(element, opts) {
38
31
  styles.top = anchorBounds.top
39
32
  } else if (window.innerHeight - anchorBounds.bottom < 100) {
40
33
  styles.top = anchorBounds.top - elementBounds.height - offset
41
- styles.maxHeight = maxHeight || 240
34
+ styles.maxHeight = 240
42
35
  } else {
43
36
  styles.top = anchorBounds.bottom + offset
44
- styles.maxHeight =
45
- maxHeight || window.innerHeight - anchorBounds.bottom - 20
37
+ styles.maxHeight = window.innerHeight - anchorBounds.bottom - 20
46
38
  }
47
39
 
48
40
  // Determine horizontal styles
@@ -138,7 +138,7 @@
138
138
  }
139
139
  </script>
140
140
 
141
- <div class="container" class:compact>
141
+ <div class="container">
142
142
  {#if selectedImage}
143
143
  {#if gallery}
144
144
  <div class="gallery">
@@ -355,9 +355,6 @@
355
355
  input[type="file"] {
356
356
  display: none;
357
357
  }
358
- .compact .spectrum-Dropzone {
359
- padding: 6px 0 !important;
360
- }
361
358
 
362
359
  .gallery {
363
360
  display: flex;
@@ -382,17 +379,6 @@
382
379
  object-fit: contain;
383
380
  margin: 20px 30px;
384
381
  }
385
- .compact .placeholder,
386
- .compact img {
387
- margin: 10px 16px;
388
- }
389
- .compact img {
390
- height: 90px;
391
- }
392
- .compact .gallery {
393
- padding: 6px 10px;
394
- margin-bottom: 8px;
395
- }
396
382
  .title {
397
383
  display: flex;
398
384
  flex-direction: row;
@@ -461,13 +447,6 @@
461
447
  .disabled .spectrum-Heading--sizeL {
462
448
  color: var(--spectrum-alias-text-color-disabled);
463
449
  }
464
- .compact .spectrum-Dropzone {
465
- padding-top: 8px;
466
- padding-bottom: 8px;
467
- }
468
- .compact .spectrum-IllustratedMessage-description {
469
- margin: 0;
470
- }
471
450
 
472
451
  .tags {
473
452
  margin-top: 20px;
@@ -20,13 +20,12 @@
20
20
 
21
21
  const dispatch = createEventDispatcher()
22
22
 
23
- $: arrayValue = Array.isArray(value) ? value : [value].filter(x => !!x)
24
- $: selectedLookupMap = getSelectedLookupMap(arrayValue)
23
+ $: selectedLookupMap = getSelectedLookupMap(value)
25
24
  $: optionLookupMap = getOptionLookupMap(options)
26
25
 
27
- $: fieldText = getFieldText(arrayValue, optionLookupMap, placeholder)
26
+ $: fieldText = getFieldText(value, optionLookupMap, placeholder)
28
27
  $: isOptionSelected = optionValue => selectedLookupMap[optionValue] === true
29
- $: toggleOption = makeToggleOption(selectedLookupMap, arrayValue)
28
+ $: toggleOption = makeToggleOption(selectedLookupMap, value)
30
29
 
31
30
  const getFieldText = (value, map, placeholder) => {
32
31
  if (Array.isArray(value) && value.length > 0) {
@@ -85,7 +84,7 @@
85
84
  {readonly}
86
85
  {fieldText}
87
86
  {options}
88
- isPlaceholder={!arrayValue.length}
87
+ isPlaceholder={!value?.length}
89
88
  {autocomplete}
90
89
  bind:fetchTerm
91
90
  {useFetch}
@@ -16,7 +16,6 @@
16
16
  export let gallery = true
17
17
  export let fileTags = []
18
18
  export let maximum = undefined
19
- export let compact = false
20
19
 
21
20
  const dispatch = createEventDispatcher()
22
21
  const onChange = e => {
@@ -38,7 +37,6 @@
38
37
  {gallery}
39
38
  {fileTags}
40
39
  {maximum}
41
- {compact}
42
40
  on:change={onChange}
43
41
  />
44
42
  </Field>
@@ -9,7 +9,6 @@
9
9
 
10
10
  <TooltipWrapper {tooltip} {size}>
11
11
  <label
12
- data-testid="label"
13
12
  class:muted
14
13
  for=""
15
14
  class={`spectrum-FieldLabel spectrum-FieldLabel--size${size}`}
@@ -14,13 +14,11 @@
14
14
  export let align = "right"
15
15
  export let portalTarget
16
16
  export let maxWidth
17
- export let maxHeight
18
17
  export let open = false
19
18
  export let useAnchorWidth = false
20
19
  export let dismissible = true
21
20
  export let offset = 5
22
21
  export let customHeight
23
- export let animate = true
24
22
 
25
23
  $: target = portalTarget || getContext(Context.PopoverRoot) || ".spectrum"
26
24
 
@@ -66,7 +64,6 @@
66
64
  use:positionDropdown={{
67
65
  anchor,
68
66
  align,
69
- maxHeight,
70
67
  maxWidth,
71
68
  useAnchorWidth,
72
69
  offset,
@@ -79,7 +76,7 @@
79
76
  class="spectrum-Popover is-open"
80
77
  role="presentation"
81
78
  style="height: {customHeight}"
82
- transition:fly|local={{ y: -20, duration: animate ? 200 : 0 }}
79
+ transition:fly|local={{ y: -20, duration: 200 }}
83
80
  >
84
81
  <slot />
85
82
  </div>
@@ -5,9 +5,8 @@
5
5
 
6
6
  const displayLimit = 5
7
7
 
8
- $: arrayValue = Array.isArray(value) ? value : [value].filter(x => !!x)
9
- $: badges = arrayValue.slice(0, displayLimit)
10
- $: leftover = arrayValue.length - badges.length
8
+ $: badges = Array.isArray(value) ? value.slice(0, displayLimit) : []
9
+ $: leftover = (value?.length ?? 0) - badges.length
11
10
  </script>
12
11
 
13
12
  {#each badges as badge}
@@ -143,7 +143,7 @@
143
143
  }
144
144
  fields?.forEach(field => {
145
145
  const fieldSchema = schema[field]
146
- if (fieldSchema.width && typeof fieldSchema.width === "string") {
146
+ if (fieldSchema.width) {
147
147
  style += ` ${fieldSchema.width}`
148
148
  } else {
149
149
  style += " minmax(auto, 1fr)"
@@ -9,7 +9,6 @@
9
9
  </script>
10
10
 
11
11
  <p
12
- data-testid="typography-body"
13
12
  style={`
14
13
  ${weight ? `font-weight:${weight};` : ""}
15
14
  ${textAlign ? `text-align:${textAlign};` : ""}
@@ -9,7 +9,6 @@
9
9
  </script>
10
10
 
11
11
  <h1
12
- data-testid="typography-heading"
13
12
  style={textAlign ? `text-align:${textAlign}` : ``}
14
13
  class:noPadding
15
14
  class="spectrum-Heading spectrum-Heading--size{size} spectrum-Heading--{weight}"
package/src/bbui.css CHANGED
@@ -97,22 +97,4 @@
97
97
 
98
98
  a {
99
99
  text-decoration: none;
100
- }
101
-
102
- /* Custom theme additions */
103
- .spectrum--darkest {
104
- --drop-shadow: rgba(0, 0, 0, 0.6);
105
- --spectrum-global-color-blue-100: rgb(28, 33, 43);
106
- }
107
- .spectrum--dark {
108
- --drop-shadow: rgba(0, 0, 0, 0.3);
109
- --spectrum-global-color-blue-100: rgb(42, 47, 57);
110
- }
111
- .spectrum--light {
112
- --drop-shadow: rgba(0, 0, 0, 0.075);
113
- --spectrum-global-color-blue-100: rgb(240, 245, 255);
114
- }
115
- .spectrum--lightest {
116
- --drop-shadow: rgba(0, 0, 0, 0.05);
117
- --spectrum-global-color-blue-100: rgb(240, 244, 255);
118
- }
100
+ }