@budibase/bbui 1.2.5 → 1.2.6
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 +2 -2
- package/dist/bbui.es.js.map +1 -1
- package/package.json +3 -3
- package/src/Form/Core/PickerDropdown.svelte +19 -19
- package/src/Form/PickerDropdown.svelte +2 -0
- package/src/List/ListItem.svelte +8 -2
- package/src/Modal/ModalContent.svelte +3 -1
- package/src/Table/Table.svelte +0 -13
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.2.
|
|
4
|
+
"version": "1.2.6",
|
|
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.2.
|
|
41
|
+
"@budibase/string-templates": "^1.2.6",
|
|
42
42
|
"@spectrum-css/actionbutton": "^1.0.1",
|
|
43
43
|
"@spectrum-css/actiongroup": "^1.0.1",
|
|
44
44
|
"@spectrum-css/avatar": "^3.0.2",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"svelte-flatpickr": "^3.2.3",
|
|
86
86
|
"svelte-portal": "^1.0.0"
|
|
87
87
|
},
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "7aa3a20ecc0f6d0f4617c6e703bf4f6f1998071e"
|
|
89
89
|
}
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
export let id = null
|
|
16
16
|
export let placeholder = "Choose an option or type"
|
|
17
17
|
export let disabled = false
|
|
18
|
-
export let readonly = false
|
|
19
18
|
export let updateOnChange = true
|
|
20
19
|
export let error = null
|
|
21
20
|
export let secondaryOptions = []
|
|
@@ -35,6 +34,7 @@
|
|
|
35
34
|
export let isOptionSelected = () => false
|
|
36
35
|
export let isPlaceholder = false
|
|
37
36
|
export let placeholderOption = null
|
|
37
|
+
export let showClearIcon = true
|
|
38
38
|
|
|
39
39
|
const dispatch = createEventDispatcher()
|
|
40
40
|
let primaryOpen = false
|
|
@@ -50,17 +50,11 @@
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
const updateValue = newValue => {
|
|
53
|
-
if (readonly) {
|
|
54
|
-
return
|
|
55
|
-
}
|
|
56
53
|
dispatch("change", newValue)
|
|
57
54
|
}
|
|
58
55
|
|
|
59
56
|
const onClickSecondary = () => {
|
|
60
57
|
dispatch("click")
|
|
61
|
-
if (readonly) {
|
|
62
|
-
return
|
|
63
|
-
}
|
|
64
58
|
secondaryOpen = true
|
|
65
59
|
}
|
|
66
60
|
|
|
@@ -80,24 +74,15 @@
|
|
|
80
74
|
}
|
|
81
75
|
|
|
82
76
|
const onBlur = event => {
|
|
83
|
-
if (readonly) {
|
|
84
|
-
return
|
|
85
|
-
}
|
|
86
77
|
focus = false
|
|
87
78
|
updateValue(event.target.value)
|
|
88
79
|
}
|
|
89
80
|
|
|
90
81
|
const onInput = event => {
|
|
91
|
-
if (readonly || !updateOnChange) {
|
|
92
|
-
return
|
|
93
|
-
}
|
|
94
82
|
updateValue(event.target.value)
|
|
95
83
|
}
|
|
96
84
|
|
|
97
85
|
const updateValueOnEnter = event => {
|
|
98
|
-
if (readonly) {
|
|
99
|
-
return
|
|
100
|
-
}
|
|
101
86
|
if (event.key === "Enter") {
|
|
102
87
|
updateValue(event.target.value)
|
|
103
88
|
}
|
|
@@ -140,11 +125,12 @@
|
|
|
140
125
|
value={primaryLabel || ""}
|
|
141
126
|
placeholder={placeholder || ""}
|
|
142
127
|
{disabled}
|
|
143
|
-
|
|
128
|
+
readonly
|
|
144
129
|
class="spectrum-Textfield-input spectrum-InputGroup-input"
|
|
145
130
|
class:labelPadding={iconData}
|
|
131
|
+
class:open={primaryOpen}
|
|
146
132
|
/>
|
|
147
|
-
{#if primaryValue}
|
|
133
|
+
{#if primaryValue && showClearIcon}
|
|
148
134
|
<button
|
|
149
135
|
on:click={() => onClearPrimary()}
|
|
150
136
|
type="reset"
|
|
@@ -198,7 +184,7 @@
|
|
|
198
184
|
</li>
|
|
199
185
|
{/if}
|
|
200
186
|
{#each groupTitles as title}
|
|
201
|
-
<div class="spectrum-Menu-item">
|
|
187
|
+
<div class="spectrum-Menu-item title">
|
|
202
188
|
<Detail>{title}</Detail>
|
|
203
189
|
</div>
|
|
204
190
|
{#if primaryOptions}
|
|
@@ -433,4 +419,18 @@
|
|
|
433
419
|
.spectrum-Search-clearButton {
|
|
434
420
|
position: absolute;
|
|
435
421
|
}
|
|
422
|
+
|
|
423
|
+
/* Fix focus borders to show only when opened */
|
|
424
|
+
.spectrum-Textfield-input {
|
|
425
|
+
border-color: var(--spectrum-global-color-gray-400) !important;
|
|
426
|
+
border-right-width: 1px;
|
|
427
|
+
}
|
|
428
|
+
.spectrum-Textfield-input.open {
|
|
429
|
+
border-color: var(--spectrum-global-color-blue-400) !important;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/* Fix being able to hover and select titles */
|
|
433
|
+
.spectrum-Menu-item.title {
|
|
434
|
+
pointer-events: none;
|
|
435
|
+
}
|
|
436
436
|
</style>
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
export let primaryOptions = []
|
|
28
28
|
export let secondaryOptions = []
|
|
29
29
|
export let searchTerm
|
|
30
|
+
export let showClearIcon = true
|
|
30
31
|
|
|
31
32
|
let primaryLabel
|
|
32
33
|
let secondaryLabel
|
|
@@ -120,6 +121,7 @@
|
|
|
120
121
|
{secondaryValue}
|
|
121
122
|
{primaryLabel}
|
|
122
123
|
{secondaryLabel}
|
|
124
|
+
{showClearIcon}
|
|
123
125
|
on:pickprimary={onPickPrimary}
|
|
124
126
|
on:picksecondary={onPickSecondary}
|
|
125
127
|
on:search={updateSearchTerm}
|
package/src/List/ListItem.svelte
CHANGED
|
@@ -9,11 +9,12 @@
|
|
|
9
9
|
export let avatar = false
|
|
10
10
|
export let title = null
|
|
11
11
|
export let subtitle = null
|
|
12
|
+
export let hoverable = false
|
|
12
13
|
|
|
13
14
|
$: initials = avatar ? title?.[0] : null
|
|
14
15
|
</script>
|
|
15
16
|
|
|
16
|
-
<div class="list-item">
|
|
17
|
+
<div class="list-item" class:hoverable on:click>
|
|
17
18
|
<div class="left">
|
|
18
19
|
{#if icon}
|
|
19
20
|
<div class="icon" style="background: {iconBackground || `transparent`};">
|
|
@@ -39,11 +40,12 @@
|
|
|
39
40
|
.list-item {
|
|
40
41
|
padding: 0 16px;
|
|
41
42
|
height: 56px;
|
|
42
|
-
background: var(--spectrum-
|
|
43
|
+
background: var(--spectrum-global-color-gray-50);
|
|
43
44
|
display: flex;
|
|
44
45
|
flex-direction: row;
|
|
45
46
|
justify-content: space-between;
|
|
46
47
|
border: 1px solid var(--spectrum-global-color-gray-300);
|
|
48
|
+
transition: background 130ms ease-out;
|
|
47
49
|
}
|
|
48
50
|
.list-item:not(:first-child) {
|
|
49
51
|
border-top: none;
|
|
@@ -56,6 +58,10 @@
|
|
|
56
58
|
border-bottom-left-radius: 4px;
|
|
57
59
|
border-bottom-right-radius: 4px;
|
|
58
60
|
}
|
|
61
|
+
.hoverable:hover {
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
background: var(--spectrum-global-color-gray-75);
|
|
64
|
+
}
|
|
59
65
|
.left,
|
|
60
66
|
.right {
|
|
61
67
|
display: flex;
|
|
@@ -106,7 +106,9 @@
|
|
|
106
106
|
{/if}
|
|
107
107
|
|
|
108
108
|
{#if showCancelButton}
|
|
109
|
-
<Button group secondary on:click={close}>
|
|
109
|
+
<Button group secondary newStyles on:click={close}>
|
|
110
|
+
{cancelText}
|
|
111
|
+
</Button>
|
|
110
112
|
{/if}
|
|
111
113
|
{#if showConfirmButton}
|
|
112
114
|
<span class="confirm-wrap">
|
package/src/Table/Table.svelte
CHANGED
|
@@ -503,12 +503,6 @@
|
|
|
503
503
|
.spectrum-Table-headCell--alignRight {
|
|
504
504
|
justify-content: flex-end;
|
|
505
505
|
}
|
|
506
|
-
.spectrum-Table-headCell--divider {
|
|
507
|
-
padding-right: var(--cell-padding);
|
|
508
|
-
}
|
|
509
|
-
.spectrum-Table-headCell--divider + .spectrum-Table-headCell {
|
|
510
|
-
padding-left: var(--cell-padding);
|
|
511
|
-
}
|
|
512
506
|
.spectrum-Table-headCell--edit {
|
|
513
507
|
position: sticky;
|
|
514
508
|
left: 0;
|
|
@@ -580,13 +574,6 @@
|
|
|
580
574
|
background-color: var(--table-bg);
|
|
581
575
|
z-index: auto;
|
|
582
576
|
}
|
|
583
|
-
.spectrum-Table-cell--divider {
|
|
584
|
-
padding-right: var(--cell-padding);
|
|
585
|
-
}
|
|
586
|
-
.spectrum-Table-cell--divider + .spectrum-Table-cell {
|
|
587
|
-
padding-left: var(--cell-padding);
|
|
588
|
-
}
|
|
589
|
-
|
|
590
577
|
.spectrum-Table-cell--edit {
|
|
591
578
|
position: sticky;
|
|
592
579
|
left: 0;
|