@budibase/bbui 0.9.146 → 0.9.147-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 +1 -1
- package/dist/bbui.es.js.map +1 -1
- package/package.json +2 -2
- package/src/Modal/ModalContent.svelte +10 -1
- package/src/Table/Table.svelte +4 -2
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": "0.9.
|
|
4
|
+
"version": "0.9.147-alpha.0",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"svelte": "src/index.js",
|
|
7
7
|
"module": "dist/bbui.es.js",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"svelte-flatpickr": "^3.1.0",
|
|
82
82
|
"svelte-portal": "^1.0.0"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "50eb091381f90c254ea8817be1d5a5651af654b1"
|
|
85
85
|
}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
export let showConfirmButton = true
|
|
15
15
|
export let showCloseIcon = true
|
|
16
16
|
export let onConfirm = undefined
|
|
17
|
+
export let onCancel = undefined
|
|
17
18
|
export let disabled = false
|
|
18
19
|
export let showDivider = true
|
|
19
20
|
|
|
@@ -28,6 +29,14 @@
|
|
|
28
29
|
}
|
|
29
30
|
loading = false
|
|
30
31
|
}
|
|
32
|
+
|
|
33
|
+
async function close() {
|
|
34
|
+
loading = true
|
|
35
|
+
if (!onCancel || (await onCancel()) !== false) {
|
|
36
|
+
cancel()
|
|
37
|
+
}
|
|
38
|
+
loading = false
|
|
39
|
+
}
|
|
31
40
|
</script>
|
|
32
41
|
|
|
33
42
|
<div
|
|
@@ -65,7 +74,7 @@
|
|
|
65
74
|
>
|
|
66
75
|
<slot name="footer" />
|
|
67
76
|
{#if showCancelButton}
|
|
68
|
-
<Button group secondary on:click={
|
|
77
|
+
<Button group secondary on:click={close}>{cancelText}</Button>
|
|
69
78
|
{/if}
|
|
70
79
|
{#if showConfirmButton}
|
|
71
80
|
<Button
|
package/src/Table/Table.svelte
CHANGED
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
export let selectedRows = []
|
|
28
28
|
export let editColumnTitle = "Edit"
|
|
29
29
|
export let customRenderers = []
|
|
30
|
+
export let disableSorting = false
|
|
30
31
|
|
|
31
32
|
const dispatch = createEventDispatcher()
|
|
32
33
|
|
|
@@ -63,7 +64,7 @@
|
|
|
63
64
|
)
|
|
64
65
|
|
|
65
66
|
// Reset state when data changes
|
|
66
|
-
$:
|
|
67
|
+
$: rows.length, reset()
|
|
67
68
|
const reset = () => {
|
|
68
69
|
nextScrollTop = 0
|
|
69
70
|
scrollTop = 0
|
|
@@ -107,7 +108,7 @@
|
|
|
107
108
|
}
|
|
108
109
|
|
|
109
110
|
const sortRows = (rows, sortColumn, sortOrder) => {
|
|
110
|
-
if (!sortColumn || !sortOrder) {
|
|
111
|
+
if (!sortColumn || !sortOrder || disableSorting) {
|
|
111
112
|
return rows
|
|
112
113
|
}
|
|
113
114
|
return rows.slice().sort((a, b) => {
|
|
@@ -131,6 +132,7 @@
|
|
|
131
132
|
sortColumn = fieldSchema.name
|
|
132
133
|
sortOrder = "Descending"
|
|
133
134
|
}
|
|
135
|
+
dispatch("sort", { column: sortColumn, order: sortOrder })
|
|
134
136
|
}
|
|
135
137
|
|
|
136
138
|
const getDisplayName = schema => {
|