@budibase/bbui 1.0.99 → 1.0.102
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/dist/bbui.es.js +35 -35
- package/dist/bbui.es.js.map +1 -1
- package/package.json +3 -3
- package/src/Button/Button.svelte +2 -0
- package/src/Modal/ModalContent.svelte +21 -9
- package/src/Table/Table.svelte +17 -6
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.
|
|
4
|
+
"version": "1.0.102",
|
|
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.
|
|
41
|
+
"@budibase/string-templates": "^1.0.102",
|
|
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": "
|
|
87
|
+
"gitHead": "665f572421060b82166b89c2114ffaea72390102"
|
|
88
88
|
}
|
package/src/Button/Button.svelte
CHANGED
|
@@ -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
|
-
<
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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>
|
package/src/Table/Table.svelte
CHANGED
|
@@ -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
|
-
$:
|
|
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
|
|
111
|
-
|
|
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 +
|
|
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={
|
|
278
|
+
<div class="loading" style={heightStyle}>
|
|
268
279
|
<ProgressCircle />
|
|
269
280
|
</div>
|
|
270
281
|
{:else}
|
|
271
|
-
<div class="spectrum-Table" style={`${
|
|
282
|
+
<div class="spectrum-Table" style={`${heightStyle}${gridStyle}`}>
|
|
272
283
|
{#if fields.length}
|
|
273
284
|
<div class="spectrum-Table-head">
|
|
274
285
|
{#if showEditColumn}
|