@budibase/bbui 2.3.18-alpha.13 → 2.3.18-alpha.15

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.3.18-alpha.13",
4
+ "version": "2.3.18-alpha.15",
5
5
  "license": "MPL-2.0",
6
6
  "svelte": "src/index.js",
7
7
  "module": "dist/bbui.es.js",
@@ -38,7 +38,7 @@
38
38
  ],
39
39
  "dependencies": {
40
40
  "@adobe/spectrum-css-workflow-icons": "1.2.1",
41
- "@budibase/string-templates": "2.3.18-alpha.13",
41
+ "@budibase/string-templates": "2.3.18-alpha.15",
42
42
  "@spectrum-css/accordion": "3.0.24",
43
43
  "@spectrum-css/actionbutton": "1.0.1",
44
44
  "@spectrum-css/actiongroup": "1.0.1",
@@ -89,5 +89,5 @@
89
89
  "resolutions": {
90
90
  "loader-utils": "1.4.1"
91
91
  },
92
- "gitHead": "95ce3bb56c8db6b69b3b9081c0eeb0fff5180518"
92
+ "gitHead": "78287e11da6973374962afac59b35c598a54efc3"
93
93
  }
@@ -14,6 +14,8 @@
14
14
  export let autocomplete = false
15
15
  export let sort = false
16
16
  export let autoWidth = false
17
+ export let fetchTerm = null
18
+ export let customPopoverHeight
17
19
 
18
20
  const dispatch = createEventDispatcher()
19
21
 
@@ -83,10 +85,12 @@
83
85
  {options}
84
86
  isPlaceholder={!value?.length}
85
87
  {autocomplete}
88
+ bind:fetchTerm
86
89
  {isOptionSelected}
87
90
  {getOptionLabel}
88
91
  {getOptionValue}
89
92
  onSelectOption={toggleOption}
90
93
  {sort}
91
94
  {autoWidth}
95
+ {customPopoverHeight}
92
96
  />
@@ -31,7 +31,8 @@
31
31
  export let autoWidth = false
32
32
  export let autocomplete = false
33
33
  export let sort = false
34
-
34
+ export let fetchTerm = null
35
+ export let customPopoverHeight
35
36
  const dispatch = createEventDispatcher()
36
37
 
37
38
  let searchTerm = null
@@ -71,7 +72,7 @@
71
72
  }
72
73
 
73
74
  const getFilteredOptions = (options, term, getLabel) => {
74
- if (autocomplete && term) {
75
+ if (autocomplete && term && !fetchTerm) {
75
76
  const lowerCaseTerm = term.toLowerCase()
76
77
  return options.filter(option => {
77
78
  return `${getLabel(option)}`.toLowerCase().includes(lowerCaseTerm)
@@ -136,6 +137,7 @@
136
137
  on:close={() => (open = false)}
137
138
  useAnchorWidth={!autoWidth}
138
139
  maxWidth={autoWidth ? 400 : null}
140
+ customHeight={customPopoverHeight}
139
141
  >
140
142
  <div
141
143
  class="popover-content"
@@ -144,8 +146,9 @@
144
146
  >
145
147
  {#if autocomplete}
146
148
  <Search
147
- value={searchTerm}
148
- on:change={event => (searchTerm = event.detail)}
149
+ value={fetchTerm ? fetchTerm : searchTerm}
150
+ on:change={event =>
151
+ fetchTerm ? (fetchTerm = event.detail) : (searchTerm = event.detail)}
149
152
  {disabled}
150
153
  placeholder="Search"
151
154
  />
@@ -247,7 +250,7 @@
247
250
  }
248
251
  .popover-content.auto-width .spectrum-Menu-itemLabel {
249
252
  white-space: nowrap;
250
- overflow: hidden;
253
+ overflow: none;
251
254
  text-overflow: ellipsis;
252
255
  }
253
256
  .popover-content:not(.auto-width) .spectrum-Menu-itemLabel {
@@ -15,6 +15,10 @@
15
15
  export let getOptionValue = option => option
16
16
  export let sort = false
17
17
  export let autoWidth = false
18
+ export let autocomplete = false
19
+ export let fetchTerm = null
20
+ export let customPopoverHeight
21
+
18
22
  const dispatch = createEventDispatcher()
19
23
  const onChange = e => {
20
24
  value = e.detail
@@ -34,6 +38,9 @@
34
38
  {getOptionLabel}
35
39
  {getOptionValue}
36
40
  {autoWidth}
41
+ {autocomplete}
42
+ {customPopoverHeight}
43
+ bind:fetchTerm
37
44
  on:change={onChange}
38
45
  on:click
39
46
  />
@@ -20,6 +20,8 @@
20
20
  export let autoWidth = false
21
21
  export let sort = false
22
22
  export let tooltip = ""
23
+ export let autocomplete = false
24
+ export let customPopoverHeight
23
25
 
24
26
  const dispatch = createEventDispatcher()
25
27
  const onChange = e => {
@@ -51,6 +53,8 @@
51
53
  {getOptionIcon}
52
54
  {getOptionColour}
53
55
  {isOptionEnabled}
56
+ {autocomplete}
57
+ {customPopoverHeight}
54
58
  on:change={onChange}
55
59
  on:click
56
60
  />
@@ -18,6 +18,7 @@
18
18
  export let useAnchorWidth = false
19
19
  export let dismissible = true
20
20
  export let offset = 5
21
+ export let customHeight
21
22
 
22
23
  $: target = portalTarget || getContext(Context.PopoverRoot) || ".spectrum"
23
24
 
@@ -74,6 +75,7 @@
74
75
  on:keydown={handleEscape}
75
76
  class="spectrum-Popover is-open"
76
77
  role="presentation"
78
+ style="height: {customHeight}"
77
79
  transition:fly|local={{ y: -20, duration: 200 }}
78
80
  >
79
81
  <slot />