@budibase/bbui 2.5.6-alpha.6 → 2.5.6-alpha.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.6",
4
+ "version": "2.5.6-alpha.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.6",
42
- "@budibase/string-templates": "2.5.6-alpha.6",
41
+ "@budibase/shared-core": "2.5.6-alpha.7",
42
+ "@budibase/string-templates": "2.5.6-alpha.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.2.3",
87
+ "svelte-flatpickr": "^3.3.2",
88
88
  "svelte-portal": "^1.0.0"
89
89
  },
90
90
  "resolutions": {
91
91
  "loader-utils": "1.4.1"
92
92
  },
93
- "gitHead": "38e1d3a3a0a70b4a55b3a1a790d46151057af3c2"
93
+ "gitHead": "c34a935f5557c60d7bbf3556942828248057dd64"
94
94
  }
@@ -71,7 +71,7 @@
71
71
  {/if}
72
72
  {#if icon}
73
73
  <svg
74
- class="spectrum-Icon spectrum-Icon--size{size}"
74
+ class="spectrum-Icon spectrum-Icon--sizeS"
75
75
  focusable="false"
76
76
  aria-hidden="true"
77
77
  aria-label={icon}
@@ -6,6 +6,9 @@ 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
+ }
9
12
  for (let className of ignoredClasses) {
10
13
  if (event.target.closest(className)) {
11
14
  return
@@ -29,6 +32,7 @@ const handleClick = event => {
29
32
  })
30
33
  }
31
34
  document.documentElement.addEventListener("click", handleClick, true)
35
+ document.documentElement.addEventListener("contextmenu", handleClick, true)
32
36
 
33
37
  /**
34
38
  * Adds or updates a click handler
@@ -138,7 +138,7 @@
138
138
  }
139
139
  </script>
140
140
 
141
- <div class="container">
141
+ <div class="container" class:compact>
142
142
  {#if selectedImage}
143
143
  {#if gallery}
144
144
  <div class="gallery">
@@ -355,6 +355,9 @@
355
355
  input[type="file"] {
356
356
  display: none;
357
357
  }
358
+ .compact .spectrum-Dropzone {
359
+ padding: 6px 0 !important;
360
+ }
358
361
 
359
362
  .gallery {
360
363
  display: flex;
@@ -379,6 +382,17 @@
379
382
  object-fit: contain;
380
383
  margin: 20px 30px;
381
384
  }
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
+ }
382
396
  .title {
383
397
  display: flex;
384
398
  flex-direction: row;
@@ -447,6 +461,13 @@
447
461
  .disabled .spectrum-Heading--sizeL {
448
462
  color: var(--spectrum-alias-text-color-disabled);
449
463
  }
464
+ .compact .spectrum-Dropzone {
465
+ padding-top: 8px;
466
+ padding-bottom: 8px;
467
+ }
468
+ .compact .spectrum-IllustratedMessage-description {
469
+ margin: 0;
470
+ }
450
471
 
451
472
  .tags {
452
473
  margin-top: 20px;
@@ -20,12 +20,13 @@
20
20
 
21
21
  const dispatch = createEventDispatcher()
22
22
 
23
- $: selectedLookupMap = getSelectedLookupMap(value)
23
+ $: arrayValue = Array.isArray(value) ? value : [value].filter(x => !!x)
24
+ $: selectedLookupMap = getSelectedLookupMap(arrayValue)
24
25
  $: optionLookupMap = getOptionLookupMap(options)
25
26
 
26
- $: fieldText = getFieldText(value, optionLookupMap, placeholder)
27
+ $: fieldText = getFieldText(arrayValue, optionLookupMap, placeholder)
27
28
  $: isOptionSelected = optionValue => selectedLookupMap[optionValue] === true
28
- $: toggleOption = makeToggleOption(selectedLookupMap, value)
29
+ $: toggleOption = makeToggleOption(selectedLookupMap, arrayValue)
29
30
 
30
31
  const getFieldText = (value, map, placeholder) => {
31
32
  if (Array.isArray(value) && value.length > 0) {
@@ -84,7 +85,7 @@
84
85
  {readonly}
85
86
  {fieldText}
86
87
  {options}
87
- isPlaceholder={!value?.length}
88
+ isPlaceholder={!arrayValue.length}
88
89
  {autocomplete}
89
90
  bind:fetchTerm
90
91
  {useFetch}
@@ -16,6 +16,7 @@
16
16
  export let gallery = true
17
17
  export let fileTags = []
18
18
  export let maximum = undefined
19
+ export let compact = false
19
20
 
20
21
  const dispatch = createEventDispatcher()
21
22
  const onChange = e => {
@@ -37,6 +38,7 @@
37
38
  {gallery}
38
39
  {fileTags}
39
40
  {maximum}
41
+ {compact}
40
42
  on:change={onChange}
41
43
  />
42
44
  </Field>
@@ -20,6 +20,7 @@
20
20
  export let dismissible = true
21
21
  export let offset = 5
22
22
  export let customHeight
23
+ export let animate = true
23
24
 
24
25
  $: target = portalTarget || getContext(Context.PopoverRoot) || ".spectrum"
25
26
 
@@ -78,7 +79,7 @@
78
79
  class="spectrum-Popover is-open"
79
80
  role="presentation"
80
81
  style="height: {customHeight}"
81
- transition:fly|local={{ y: -20, duration: 200 }}
82
+ transition:fly|local={{ y: -20, duration: animate ? 200 : 0 }}
82
83
  >
83
84
  <slot />
84
85
  </div>
@@ -5,8 +5,9 @@
5
5
 
6
6
  const displayLimit = 5
7
7
 
8
- $: badges = Array.isArray(value) ? value.slice(0, displayLimit) : []
9
- $: leftover = (value?.length ?? 0) - badges.length
8
+ $: arrayValue = Array.isArray(value) ? value : [value].filter(x => !!x)
9
+ $: badges = arrayValue.slice(0, displayLimit)
10
+ $: leftover = arrayValue.length - badges.length
10
11
  </script>
11
12
 
12
13
  {#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) {
146
+ if (fieldSchema.width && typeof fieldSchema.width === "string") {
147
147
  style += ` ${fieldSchema.width}`
148
148
  } else {
149
149
  style += " minmax(auto, 1fr)"
package/src/bbui.css CHANGED
@@ -97,4 +97,22 @@
97
97
 
98
98
  a {
99
99
  text-decoration: none;
100
- }
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
+ }