@budibase/bbui 1.0.98 → 1.0.101

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": "1.0.98",
4
+ "version": "1.0.101",
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": "^1.0.98",
41
+ "@budibase/string-templates": "^1.0.101",
42
42
  "@spectrum-css/actionbutton": "^1.0.1",
43
43
  "@spectrum-css/actiongroup": "^1.0.1",
44
44
  "@spectrum-css/avatar": "^3.0.2",
@@ -84,5 +84,5 @@
84
84
  "svelte-flatpickr": "^3.2.3",
85
85
  "svelte-portal": "^1.0.0"
86
86
  },
87
- "gitHead": "c13a6db9c74b50786732c52d2827e018a3542047"
87
+ "gitHead": "3862854f5b44c63494d6e5fc060c16a5e1890d1a"
88
88
  }
@@ -13,6 +13,7 @@
13
13
  export let icon = undefined
14
14
  export let active = false
15
15
  export let tooltip = undefined
16
+ export let dataCy
16
17
 
17
18
  let showTooltip = false
18
19
  </script>
@@ -27,6 +28,7 @@
27
28
  class:active
28
29
  class="spectrum-Button spectrum-Button--size{size.toUpperCase()}"
29
30
  {disabled}
31
+ data-cy={dataCy}
30
32
  on:click|preventDefault
31
33
  on:mouseover={() => (showTooltip = true)}
32
34
  on:focus={() => (showTooltip = true)}
@@ -5,6 +5,7 @@
5
5
  import Divider from "../Divider/Divider.svelte"
6
6
  import Icon from "../Icon/Icon.svelte"
7
7
  import Context from "../context"
8
+ import ProgressCircle from "../ProgressCircle/ProgressCircle.svelte"
8
9
 
9
10
  export let title = undefined
10
11
  export let size = "S"
@@ -102,15 +103,22 @@
102
103
  <Button group secondary on:click={close}>{cancelText}</Button>
103
104
  {/if}
104
105
  {#if showConfirmButton}
105
- <Button
106
- group
107
- cta
108
- {...$$restProps}
109
- disabled={confirmDisabled}
110
- on:click={confirm}
111
- >
112
- {confirmText}
113
- </Button>
106
+ <span class="confirm-wrap">
107
+ <Button
108
+ group
109
+ cta
110
+ {...$$restProps}
111
+ disabled={confirmDisabled}
112
+ on:click={confirm}
113
+ >
114
+ {#if loading}
115
+ <ProgressCircle overBackground={true} size="S" />
116
+ {/if}
117
+ {#if !loading}
118
+ {confirmText}
119
+ {/if}
120
+ </Button>
121
+ </span>
114
122
  {/if}
115
123
  </div>
116
124
  {/if}
@@ -169,4 +177,8 @@
169
177
  .spectrum-Dialog-buttonGroup {
170
178
  padding-left: 0;
171
179
  }
180
+
181
+ .confirm-wrap :global(.spectrum-Button-label) {
182
+ display: contents;
183
+ }
172
184
  </style>
@@ -56,6 +56,7 @@
56
56
  $: if (!loading) loaded = true
57
57
  $: fields = getFields(schema, showAutoColumns, autoSortColumns)
58
58
  $: rows = fields?.length ? data || [] : []
59
+ $: totalRowCount = rows?.length || 0
59
60
  $: visibleRowCount = getVisibleRowCount(
60
61
  loaded,
61
62
  height,
@@ -63,7 +64,12 @@
63
64
  rowCount,
64
65
  rowHeight
65
66
  )
66
- $: contentStyle = getContentStyle(visibleRowCount, rowCount, rowHeight)
67
+ $: heightStyle = getHeightStyle(
68
+ visibleRowCount,
69
+ rowCount,
70
+ totalRowCount,
71
+ rowHeight
72
+ )
67
73
  $: sortedRows = sortRows(rows, sortColumn, sortOrder)
68
74
  $: gridStyle = getGridStyle(fields, schema, showEditColumn)
69
75
  $: showEditColumn = allowEditRows || allowSelectRows
@@ -107,11 +113,16 @@
107
113
  return Math.min(allRows, Math.ceil(height / rowHeight))
108
114
  }
109
115
 
110
- const getContentStyle = (visibleRows, rowCount, rowHeight) => {
111
- if (!rowCount || !visibleRows) {
116
+ const getHeightStyle = (
117
+ visibleRowCount,
118
+ rowCount,
119
+ totalRowCount,
120
+ rowHeight
121
+ ) => {
122
+ if (!rowCount || !visibleRowCount || totalRowCount <= rowCount) {
112
123
  return ""
113
124
  }
114
- return `height: ${headerHeight + visibleRows * rowHeight}px;`
125
+ return `height: ${headerHeight + visibleRowCount * rowHeight}px;`
115
126
  }
116
127
 
117
128
  const getGridStyle = (fields, schema, showEditColumn) => {
@@ -264,11 +275,11 @@
264
275
  style={`--row-height: ${rowHeight}px; --header-height: ${headerHeight}px;`}
265
276
  >
266
277
  {#if !loaded}
267
- <div class="loading" style={contentStyle}>
278
+ <div class="loading" style={heightStyle}>
268
279
  <ProgressCircle />
269
280
  </div>
270
281
  {:else}
271
- <div class="spectrum-Table" style={`${contentStyle}${gridStyle}`}>
282
+ <div class="spectrum-Table" style={`${heightStyle}${gridStyle}`}>
272
283
  {#if fields.length}
273
284
  <div class="spectrum-Table-head">
274
285
  {#if showEditColumn}