@budibase/bbui 2.7.36-alpha.2 → 2.7.36
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 +4 -4
- package/src/FancyForm/FancyCheckbox.svelte +3 -17
- package/src/FancyForm/FancyField.svelte +4 -11
- package/src/FancyForm/index.js +0 -1
- package/src/Form/Core/Checkbox.svelte +0 -2
- package/src/Modal/Modal.svelte +1 -2
- package/src/FancyForm/FancyCheckboxGroup.svelte +0 -69
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.7.36
|
|
4
|
+
"version": "2.7.36",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"svelte": "src/index.js",
|
|
7
7
|
"module": "dist/bbui.es.js",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@adobe/spectrum-css-workflow-icons": "1.2.1",
|
|
41
|
-
"@budibase/shared-core": "2.7.36
|
|
42
|
-
"@budibase/string-templates": "2.7.36
|
|
41
|
+
"@budibase/shared-core": "2.7.36",
|
|
42
|
+
"@budibase/string-templates": "2.7.36",
|
|
43
43
|
"@spectrum-css/accordion": "3.0.24",
|
|
44
44
|
"@spectrum-css/actionbutton": "1.0.1",
|
|
45
45
|
"@spectrum-css/actiongroup": "1.0.1",
|
|
@@ -104,5 +104,5 @@
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
|
-
"gitHead": "
|
|
107
|
+
"gitHead": "66929c1a9739fa64aae8cbb1b9af50919d9a306d"
|
|
108
108
|
}
|
|
@@ -8,8 +8,6 @@
|
|
|
8
8
|
export let disabled = false
|
|
9
9
|
export let error = null
|
|
10
10
|
export let validate = null
|
|
11
|
-
export let indeterminate = false
|
|
12
|
-
export let compact = false
|
|
13
11
|
|
|
14
12
|
const dispatch = createEventDispatcher()
|
|
15
13
|
|
|
@@ -23,19 +21,11 @@
|
|
|
23
21
|
}
|
|
24
22
|
</script>
|
|
25
23
|
|
|
26
|
-
<FancyField
|
|
27
|
-
{error}
|
|
28
|
-
{value}
|
|
29
|
-
{validate}
|
|
30
|
-
{disabled}
|
|
31
|
-
{compact}
|
|
32
|
-
clickable
|
|
33
|
-
on:click={onChange}
|
|
34
|
-
>
|
|
24
|
+
<FancyField {error} {value} {validate} {disabled} clickable on:click={onChange}>
|
|
35
25
|
<span>
|
|
36
|
-
<Checkbox {disabled} {value}
|
|
26
|
+
<Checkbox {disabled} {value} />
|
|
37
27
|
</span>
|
|
38
|
-
<div class="text"
|
|
28
|
+
<div class="text">
|
|
39
29
|
{#if text}
|
|
40
30
|
{text}
|
|
41
31
|
{/if}
|
|
@@ -57,10 +47,6 @@
|
|
|
57
47
|
line-clamp: 2;
|
|
58
48
|
-webkit-box-orient: vertical;
|
|
59
49
|
}
|
|
60
|
-
.text.compact {
|
|
61
|
-
font-size: 13px;
|
|
62
|
-
line-height: 15px;
|
|
63
|
-
}
|
|
64
50
|
.text > :global(*) {
|
|
65
51
|
font-size: inherit !important;
|
|
66
52
|
}
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
export let value
|
|
12
12
|
export let ref
|
|
13
13
|
export let autoHeight
|
|
14
|
-
export let compact = false
|
|
15
14
|
|
|
16
15
|
const formContext = getContext("fancy-form")
|
|
17
16
|
const id = Math.random()
|
|
@@ -43,7 +42,6 @@
|
|
|
43
42
|
class:disabled
|
|
44
43
|
class:focused
|
|
45
44
|
class:clickable
|
|
46
|
-
class:compact
|
|
47
45
|
class:auto-height={autoHeight}
|
|
48
46
|
>
|
|
49
47
|
<div class="content" on:click>
|
|
@@ -63,6 +61,7 @@
|
|
|
63
61
|
|
|
64
62
|
<style>
|
|
65
63
|
.fancy-field {
|
|
64
|
+
max-width: 400px;
|
|
66
65
|
background: var(--spectrum-global-color-gray-75);
|
|
67
66
|
border: 1px solid var(--spectrum-global-color-gray-300);
|
|
68
67
|
border-radius: 4px;
|
|
@@ -70,12 +69,6 @@
|
|
|
70
69
|
transition: border-color 130ms ease-out, background 130ms ease-out,
|
|
71
70
|
background 130ms ease-out;
|
|
72
71
|
color: var(--spectrum-global-color-gray-800);
|
|
73
|
-
--padding: 16px;
|
|
74
|
-
--height: 64px;
|
|
75
|
-
}
|
|
76
|
-
.fancy-field.compact {
|
|
77
|
-
--padding: 8px;
|
|
78
|
-
--height: 36px;
|
|
79
72
|
}
|
|
80
73
|
.fancy-field:hover {
|
|
81
74
|
border-color: var(--spectrum-global-color-gray-400);
|
|
@@ -98,8 +91,8 @@
|
|
|
98
91
|
}
|
|
99
92
|
.content {
|
|
100
93
|
position: relative;
|
|
101
|
-
height:
|
|
102
|
-
padding: 0
|
|
94
|
+
height: 64px;
|
|
95
|
+
padding: 0 16px;
|
|
103
96
|
}
|
|
104
97
|
.fancy-field.auto-height .content {
|
|
105
98
|
height: auto;
|
|
@@ -110,7 +103,7 @@
|
|
|
110
103
|
flex-direction: row;
|
|
111
104
|
justify-content: flex-start;
|
|
112
105
|
align-items: center;
|
|
113
|
-
gap:
|
|
106
|
+
gap: 16px;
|
|
114
107
|
}
|
|
115
108
|
.field {
|
|
116
109
|
flex: 1 1 auto;
|
package/src/FancyForm/index.js
CHANGED
|
@@ -4,5 +4,4 @@ export { default as FancySelect } from "./FancySelect.svelte"
|
|
|
4
4
|
export { default as FancyButton } from "./FancyButton.svelte"
|
|
5
5
|
export { default as FancyForm } from "./FancyForm.svelte"
|
|
6
6
|
export { default as FancyButtonRadio } from "./FancyButtonRadio.svelte"
|
|
7
|
-
export { default as FancyCheckboxGroup } from "./FancyCheckboxGroup.svelte"
|
|
8
7
|
export { default as ErrorMessage } from "./ErrorMessage.svelte"
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
export let text = null
|
|
10
10
|
export let disabled = false
|
|
11
11
|
export let size
|
|
12
|
-
export let indeterminate = false
|
|
13
12
|
|
|
14
13
|
const dispatch = createEventDispatcher()
|
|
15
14
|
const onChange = event => {
|
|
@@ -23,7 +22,6 @@
|
|
|
23
22
|
class="spectrum-Checkbox spectrum-Checkbox--emphasized {sizeClass}"
|
|
24
23
|
class:is-invalid={!!error}
|
|
25
24
|
class:checked={value}
|
|
26
|
-
class:is-indeterminate={indeterminate}
|
|
27
25
|
>
|
|
28
26
|
<input
|
|
29
27
|
checked={value}
|
package/src/Modal/Modal.svelte
CHANGED
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
|
|
9
9
|
export let fixed = false
|
|
10
10
|
export let inline = false
|
|
11
|
-
export let disableCancel = false
|
|
12
11
|
|
|
13
12
|
const dispatch = createEventDispatcher()
|
|
14
13
|
let visible = fixed || inline
|
|
@@ -39,7 +38,7 @@
|
|
|
39
38
|
}
|
|
40
39
|
|
|
41
40
|
export function cancel() {
|
|
42
|
-
if (!visible
|
|
41
|
+
if (!visible) {
|
|
43
42
|
return
|
|
44
43
|
}
|
|
45
44
|
dispatch("cancel")
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import FancyCheckbox from "./FancyCheckbox.svelte"
|
|
3
|
-
import FancyForm from "./FancyForm.svelte"
|
|
4
|
-
import { createEventDispatcher } from "svelte"
|
|
5
|
-
|
|
6
|
-
export let options = []
|
|
7
|
-
export let selected = []
|
|
8
|
-
export let showSelectAll = true
|
|
9
|
-
export let selectAllText = "Select all"
|
|
10
|
-
|
|
11
|
-
let selectedBooleans = reset()
|
|
12
|
-
const dispatch = createEventDispatcher()
|
|
13
|
-
|
|
14
|
-
$: updateSelected(selectedBooleans)
|
|
15
|
-
$: allSelected = selected?.length === options.length
|
|
16
|
-
$: noneSelected = !selected?.length
|
|
17
|
-
|
|
18
|
-
function reset() {
|
|
19
|
-
return Array(options.length).fill(true)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function updateSelected(selectedArr) {
|
|
23
|
-
const array = []
|
|
24
|
-
for (let [i, isSelected] of Object.entries(selectedArr)) {
|
|
25
|
-
if (isSelected) {
|
|
26
|
-
array.push(options[i])
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
selected = array
|
|
30
|
-
dispatch("change", selected)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function toggleSelectAll() {
|
|
34
|
-
if (allSelected === true) {
|
|
35
|
-
selectedBooleans = []
|
|
36
|
-
} else {
|
|
37
|
-
selectedBooleans = reset()
|
|
38
|
-
}
|
|
39
|
-
dispatch("change", selected)
|
|
40
|
-
}
|
|
41
|
-
</script>
|
|
42
|
-
|
|
43
|
-
{#if options && Array.isArray(options)}
|
|
44
|
-
<div class="checkbox-group" class:has-select-all={showSelectAll}>
|
|
45
|
-
<FancyForm on:change>
|
|
46
|
-
{#if showSelectAll}
|
|
47
|
-
<FancyCheckbox
|
|
48
|
-
bind:value={allSelected}
|
|
49
|
-
on:change={toggleSelectAll}
|
|
50
|
-
text={selectAllText}
|
|
51
|
-
indeterminate={!allSelected && !noneSelected}
|
|
52
|
-
compact
|
|
53
|
-
/>
|
|
54
|
-
{/if}
|
|
55
|
-
{#each options as option, i}
|
|
56
|
-
<FancyCheckbox bind:value={selectedBooleans[i]} text={option} compact />
|
|
57
|
-
{/each}
|
|
58
|
-
</FancyForm>
|
|
59
|
-
</div>
|
|
60
|
-
{/if}
|
|
61
|
-
|
|
62
|
-
<style>
|
|
63
|
-
.checkbox-group.has-select-all :global(.fancy-field:first-of-type) {
|
|
64
|
-
background: var(--spectrum-global-color-gray-100);
|
|
65
|
-
}
|
|
66
|
-
.checkbox-group.has-select-all :global(.fancy-field:first-of-type:hover) {
|
|
67
|
-
background: var(--spectrum-global-color-gray-200);
|
|
68
|
-
}
|
|
69
|
-
</style>
|