@budibase/bbui 2.1.39 → 2.1.40-alpha.0
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 +3 -3
- package/dist/bbui.es.js.map +1 -1
- package/package.json +3 -3
- package/src/Skeleton/Skeleton.svelte +56 -0
- package/src/Table/Table.svelte +14 -6
- package/src/index.js +1 -0
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.1.
|
|
4
|
+
"version": "2.1.40-alpha.0",
|
|
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": "
|
|
41
|
+
"@budibase/string-templates": "2.1.40-alpha.0",
|
|
42
42
|
"@spectrum-css/actionbutton": "^1.0.1",
|
|
43
43
|
"@spectrum-css/actiongroup": "^1.0.1",
|
|
44
44
|
"@spectrum-css/avatar": "^3.0.2",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"resolutions": {
|
|
89
89
|
"loader-utils": "1.4.1"
|
|
90
90
|
},
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "c1e2c04c89df9f5ce6d5b25d7f6726a9473d9a34"
|
|
92
92
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<div class="skeleton">
|
|
2
|
+
<div class="children">
|
|
3
|
+
<slot />
|
|
4
|
+
</div>
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<style>
|
|
8
|
+
.skeleton {
|
|
9
|
+
height: 100%;
|
|
10
|
+
width: 100%;
|
|
11
|
+
opacity: 0;
|
|
12
|
+
background-color: var(--spectrum-global-color-gray-300) !important;
|
|
13
|
+
border-radius: 7px;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
position: relative;
|
|
16
|
+
animation: fadeIn 130ms ease 0s 1 normal forwards;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.children {
|
|
20
|
+
pointer-events: none;
|
|
21
|
+
opacity: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.skeleton::after {
|
|
25
|
+
position: absolute;
|
|
26
|
+
top: 0;
|
|
27
|
+
right: 0;
|
|
28
|
+
bottom: 0;
|
|
29
|
+
left: 0;
|
|
30
|
+
transform: translateX(-100%);
|
|
31
|
+
background-image: linear-gradient(
|
|
32
|
+
90deg,
|
|
33
|
+
rgba(255, 255, 255, 0) 0,
|
|
34
|
+
rgba(255, 255, 255, 0.2) 20%,
|
|
35
|
+
rgba(255, 255, 255, 0.5) 60%,
|
|
36
|
+
rgba(255, 255, 255, 0)
|
|
37
|
+
);
|
|
38
|
+
animation: shimmer 2s infinite;
|
|
39
|
+
content: "";
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@keyframes fadeIn {
|
|
43
|
+
0% {
|
|
44
|
+
opacity: 0;
|
|
45
|
+
}
|
|
46
|
+
100% {
|
|
47
|
+
opacity: 1;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@keyframes shimmer {
|
|
52
|
+
100% {
|
|
53
|
+
transform: translateX(100%);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
</style>
|
package/src/Table/Table.svelte
CHANGED
|
@@ -71,7 +71,8 @@
|
|
|
71
71
|
visibleRowCount,
|
|
72
72
|
rowCount,
|
|
73
73
|
totalRowCount,
|
|
74
|
-
rowHeight
|
|
74
|
+
rowHeight,
|
|
75
|
+
loading
|
|
75
76
|
)
|
|
76
77
|
$: sortedRows = sortRows(rows, sortColumn, sortOrder)
|
|
77
78
|
$: gridStyle = getGridStyle(fields, schema, showEditColumn)
|
|
@@ -120,8 +121,12 @@
|
|
|
120
121
|
visibleRowCount,
|
|
121
122
|
rowCount,
|
|
122
123
|
totalRowCount,
|
|
123
|
-
rowHeight
|
|
124
|
+
rowHeight,
|
|
125
|
+
loading
|
|
124
126
|
) => {
|
|
127
|
+
if (loading) {
|
|
128
|
+
return `height: ${headerHeight + visibleRowCount * rowHeight}px;`
|
|
129
|
+
}
|
|
125
130
|
if (!rowCount || !visibleRowCount || totalRowCount <= rowCount) {
|
|
126
131
|
return ""
|
|
127
132
|
}
|
|
@@ -277,9 +282,11 @@
|
|
|
277
282
|
bind:offsetHeight={height}
|
|
278
283
|
style={`--row-height: ${rowHeight}px; --header-height: ${headerHeight}px;`}
|
|
279
284
|
>
|
|
280
|
-
{#if
|
|
285
|
+
{#if loading}
|
|
281
286
|
<div class="loading" style={heightStyle}>
|
|
282
|
-
<
|
|
287
|
+
<slot name="loadingIndicator">
|
|
288
|
+
<ProgressCircle />
|
|
289
|
+
</slot>
|
|
283
290
|
</div>
|
|
284
291
|
{:else}
|
|
285
292
|
<div class="spectrum-Table" style={`${heightStyle}${gridStyle}`}>
|
|
@@ -438,9 +445,10 @@
|
|
|
438
445
|
|
|
439
446
|
/* Loading */
|
|
440
447
|
.loading {
|
|
441
|
-
display:
|
|
442
|
-
|
|
448
|
+
display: flex;
|
|
449
|
+
align-items: center;
|
|
443
450
|
min-height: 100px;
|
|
451
|
+
justify-content: center;
|
|
444
452
|
}
|
|
445
453
|
|
|
446
454
|
/* Table */
|
package/src/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import "./bbui.css"
|
|
|
4
4
|
import "@spectrum-css/icon/dist/index-vars.css"
|
|
5
5
|
|
|
6
6
|
// Components
|
|
7
|
+
export { default as Skeleton } from "./Skeleton/Skeleton.svelte"
|
|
7
8
|
export { default as Input } from "./Form/Input.svelte"
|
|
8
9
|
export { default as Stepper } from "./Form/Stepper.svelte"
|
|
9
10
|
export { default as TextArea } from "./Form/TextArea.svelte"
|