@budibase/bbui 1.1.31 → 1.1.32-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 +35 -35
- package/dist/bbui.es.js.map +1 -1
- package/package.json +3 -3
- package/src/Avatar/Avatar.svelte +16 -3
- package/src/Form/Core/InputDropdown.svelte +218 -0
- package/src/Form/Core/Multiselect.svelte +2 -0
- package/src/Form/Core/PickerDropdown.svelte +430 -0
- package/src/Form/Core/Select.svelte +0 -1
- package/src/Form/InputDropdown.svelte +55 -0
- package/src/Form/Multiselect.svelte +2 -1
- package/src/Form/PickerDropdown.svelte +125 -0
- package/src/IconPicker/IconPicker.svelte +177 -0
- package/src/List/List.svelte +28 -0
- package/src/List/ListItem.svelte +92 -0
- package/src/Table/Table.svelte +19 -2
- package/src/index.js +6 -0
- package/src/List/Items/DetailSummary.svench +0 -53
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
//import { createEventDispatcher } from "svelte"
|
|
3
|
+
import "@spectrum-css/popover/dist/index-vars.css"
|
|
4
|
+
import clickOutside from "../Actions/click_outside"
|
|
5
|
+
import { fly } from "svelte/transition"
|
|
6
|
+
import Icon from "../Icon/Icon.svelte"
|
|
7
|
+
import { createEventDispatcher } from "svelte"
|
|
8
|
+
|
|
9
|
+
export let value
|
|
10
|
+
export let size = "M"
|
|
11
|
+
export let alignRight = false
|
|
12
|
+
|
|
13
|
+
let open = false
|
|
14
|
+
|
|
15
|
+
const dispatch = createEventDispatcher()
|
|
16
|
+
|
|
17
|
+
const iconList = [
|
|
18
|
+
{
|
|
19
|
+
label: "Icons",
|
|
20
|
+
icons: [
|
|
21
|
+
"Apps",
|
|
22
|
+
"Actions",
|
|
23
|
+
"ConversionFunnel",
|
|
24
|
+
"App",
|
|
25
|
+
"Briefcase",
|
|
26
|
+
"Money",
|
|
27
|
+
"ShoppingCart",
|
|
28
|
+
"Form",
|
|
29
|
+
"Help",
|
|
30
|
+
"Monitoring",
|
|
31
|
+
"Sandbox",
|
|
32
|
+
"Project",
|
|
33
|
+
"Organisations",
|
|
34
|
+
"Magnify",
|
|
35
|
+
"Launch",
|
|
36
|
+
"Car",
|
|
37
|
+
"Camera",
|
|
38
|
+
"Bug",
|
|
39
|
+
"Channel",
|
|
40
|
+
"Calculator",
|
|
41
|
+
"Calendar",
|
|
42
|
+
"GraphDonut",
|
|
43
|
+
"GraphBarHorizontal",
|
|
44
|
+
"Demographic",
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
const onChange = value => {
|
|
50
|
+
dispatch("change", value)
|
|
51
|
+
open = false
|
|
52
|
+
}
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<div class="container">
|
|
56
|
+
<div class="preview size--{size || 'M'}" on:click={() => (open = true)}>
|
|
57
|
+
<div
|
|
58
|
+
class="fill"
|
|
59
|
+
style={value ? `background: ${value};` : ""}
|
|
60
|
+
class:placeholder={!value}
|
|
61
|
+
>
|
|
62
|
+
<Icon name={value || "UserGroup"} />
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
{#if open}
|
|
66
|
+
<div
|
|
67
|
+
use:clickOutside={() => (open = false)}
|
|
68
|
+
transition:fly={{ y: -20, duration: 200 }}
|
|
69
|
+
class="spectrum-Popover spectrum-Popover--bottom spectrum-Picker-popover is-open"
|
|
70
|
+
class:spectrum-Popover--align-right={alignRight}
|
|
71
|
+
>
|
|
72
|
+
{#each iconList as icon}
|
|
73
|
+
<div class="category">
|
|
74
|
+
<div class="heading">{icon.label}</div>
|
|
75
|
+
<div class="icons">
|
|
76
|
+
{#each icon.icons as icon}
|
|
77
|
+
<div
|
|
78
|
+
on:click={() => {
|
|
79
|
+
onChange(icon)
|
|
80
|
+
}}
|
|
81
|
+
>
|
|
82
|
+
<Icon name={icon} />
|
|
83
|
+
</div>
|
|
84
|
+
{/each}
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
{/each}
|
|
88
|
+
</div>
|
|
89
|
+
{/if}
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
<style>
|
|
93
|
+
.container {
|
|
94
|
+
position: relative;
|
|
95
|
+
}
|
|
96
|
+
.preview {
|
|
97
|
+
width: 32px;
|
|
98
|
+
height: 32px;
|
|
99
|
+
position: relative;
|
|
100
|
+
box-shadow: 0 0 0 1px var(--spectrum-global-color-gray-400);
|
|
101
|
+
}
|
|
102
|
+
.preview:hover {
|
|
103
|
+
cursor: pointer;
|
|
104
|
+
}
|
|
105
|
+
.fill {
|
|
106
|
+
width: 100%;
|
|
107
|
+
height: 100%;
|
|
108
|
+
position: absolute;
|
|
109
|
+
top: 0;
|
|
110
|
+
left: 0;
|
|
111
|
+
display: grid;
|
|
112
|
+
place-items: center;
|
|
113
|
+
}
|
|
114
|
+
.size--S {
|
|
115
|
+
width: 20px;
|
|
116
|
+
height: 20px;
|
|
117
|
+
}
|
|
118
|
+
.size--M {
|
|
119
|
+
width: 32px;
|
|
120
|
+
height: 32px;
|
|
121
|
+
}
|
|
122
|
+
.size--L {
|
|
123
|
+
width: 48px;
|
|
124
|
+
height: 48px;
|
|
125
|
+
}
|
|
126
|
+
.spectrum-Popover {
|
|
127
|
+
width: 210px;
|
|
128
|
+
z-index: 999;
|
|
129
|
+
top: 100%;
|
|
130
|
+
padding: var(--spacing-l) var(--spacing-xl);
|
|
131
|
+
display: flex;
|
|
132
|
+
flex-direction: column;
|
|
133
|
+
justify-content: flex-start;
|
|
134
|
+
align-items: stretch;
|
|
135
|
+
gap: var(--spacing-xl);
|
|
136
|
+
}
|
|
137
|
+
.spectrum-Popover--align-right {
|
|
138
|
+
right: 0;
|
|
139
|
+
}
|
|
140
|
+
.icons {
|
|
141
|
+
display: grid;
|
|
142
|
+
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
|
|
143
|
+
gap: var(--spacing-m);
|
|
144
|
+
}
|
|
145
|
+
.heading {
|
|
146
|
+
font-size: var(--font-size-s);
|
|
147
|
+
font-weight: 600;
|
|
148
|
+
letter-spacing: 0.14px;
|
|
149
|
+
flex: 1 1 auto;
|
|
150
|
+
text-transform: uppercase;
|
|
151
|
+
grid-column: 1 / 5;
|
|
152
|
+
margin-bottom: var(--spacing-s);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.icon {
|
|
156
|
+
height: 16px;
|
|
157
|
+
width: 16px;
|
|
158
|
+
border-radius: 100%;
|
|
159
|
+
box-shadow: 0 0 0 1px var(--spectrum-global-color-gray-300);
|
|
160
|
+
position: relative;
|
|
161
|
+
}
|
|
162
|
+
.icon:hover {
|
|
163
|
+
cursor: pointer;
|
|
164
|
+
box-shadow: 0 0 2px 2px var(--spectrum-global-color-gray-300);
|
|
165
|
+
}
|
|
166
|
+
.custom {
|
|
167
|
+
display: grid;
|
|
168
|
+
grid-template-columns: 1fr auto;
|
|
169
|
+
align-items: center;
|
|
170
|
+
gap: var(--spacing-m);
|
|
171
|
+
margin-right: var(--spacing-xs);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.spectrum-wrapper {
|
|
175
|
+
background-color: transparent;
|
|
176
|
+
}
|
|
177
|
+
</style>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import Detail from "../Typography/Detail.svelte"
|
|
3
|
+
|
|
4
|
+
export let title = null
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<div>
|
|
8
|
+
{#if title}
|
|
9
|
+
<div class="title">
|
|
10
|
+
<Detail>{title}</Detail>
|
|
11
|
+
</div>
|
|
12
|
+
{/if}
|
|
13
|
+
<div class="list-items">
|
|
14
|
+
<slot />
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<style>
|
|
19
|
+
.title {
|
|
20
|
+
margin-bottom: 6px;
|
|
21
|
+
}
|
|
22
|
+
.list-items {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
justify-content: flex-start;
|
|
26
|
+
align-items: stretch;
|
|
27
|
+
}
|
|
28
|
+
</style>
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import Body from "../Typography/Body.svelte"
|
|
3
|
+
import Icon from "../Icon/Icon.svelte"
|
|
4
|
+
import Label from "../Label/Label.svelte"
|
|
5
|
+
import Avatar from "../Avatar/Avatar.svelte"
|
|
6
|
+
|
|
7
|
+
export let icon = null
|
|
8
|
+
export let iconBackground = null
|
|
9
|
+
export let avatar = false
|
|
10
|
+
export let title = null
|
|
11
|
+
export let subtitle = null
|
|
12
|
+
|
|
13
|
+
$: initials = avatar ? title?.[0] : null
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<div class="list-item">
|
|
17
|
+
<div class="left">
|
|
18
|
+
{#if icon}
|
|
19
|
+
<div class="icon" style="background: {iconBackground || `transparent`};">
|
|
20
|
+
<Icon name={icon} size="S" color={iconBackground ? "white" : null} />
|
|
21
|
+
</div>
|
|
22
|
+
{/if}
|
|
23
|
+
{#if avatar}
|
|
24
|
+
<Avatar {initials} />
|
|
25
|
+
{/if}
|
|
26
|
+
{#if title}
|
|
27
|
+
<Body>{title}</Body>
|
|
28
|
+
{/if}
|
|
29
|
+
{#if subtitle}
|
|
30
|
+
<Label>{subtitle}</Label>
|
|
31
|
+
{/if}
|
|
32
|
+
</div>
|
|
33
|
+
<div class="right">
|
|
34
|
+
<slot />
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<style>
|
|
39
|
+
.list-item {
|
|
40
|
+
padding: 0 16px;
|
|
41
|
+
height: 56px;
|
|
42
|
+
background: var(--spectrum-alias-background-color-tertiary);
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: row;
|
|
45
|
+
justify-content: space-between;
|
|
46
|
+
border: 1px solid var(--spectrum-global-color-gray-300);
|
|
47
|
+
}
|
|
48
|
+
.list-item:not(:first-child) {
|
|
49
|
+
border-top: none;
|
|
50
|
+
}
|
|
51
|
+
.list-item:first-child {
|
|
52
|
+
border-top-left-radius: 4px;
|
|
53
|
+
border-top-right-radius: 4px;
|
|
54
|
+
}
|
|
55
|
+
.list-item:last-child {
|
|
56
|
+
border-bottom-left-radius: 4px;
|
|
57
|
+
border-bottom-right-radius: 4px;
|
|
58
|
+
}
|
|
59
|
+
.left,
|
|
60
|
+
.right {
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-direction: row;
|
|
63
|
+
align-items: center;
|
|
64
|
+
gap: var(--spacing-xl);
|
|
65
|
+
}
|
|
66
|
+
.left {
|
|
67
|
+
width: 0;
|
|
68
|
+
flex: 1 1 auto;
|
|
69
|
+
}
|
|
70
|
+
.right {
|
|
71
|
+
flex: 0 0 auto;
|
|
72
|
+
}
|
|
73
|
+
.list-item :global(.spectrum-Icon),
|
|
74
|
+
.list-item :global(.spectrum-Avatar) {
|
|
75
|
+
flex: 0 0 auto;
|
|
76
|
+
}
|
|
77
|
+
.list-item :global(.spectrum-Body) {
|
|
78
|
+
color: var(--spectrum-global-color-gray-900);
|
|
79
|
+
}
|
|
80
|
+
.list-item :global(.spectrum-Body) {
|
|
81
|
+
white-space: nowrap;
|
|
82
|
+
overflow: hidden;
|
|
83
|
+
text-overflow: ellipsis;
|
|
84
|
+
}
|
|
85
|
+
.icon {
|
|
86
|
+
width: var(--spectrum-alias-avatar-size-400);
|
|
87
|
+
height: var(--spectrum-alias-avatar-size-400);
|
|
88
|
+
display: grid;
|
|
89
|
+
place-items: center;
|
|
90
|
+
border-radius: 50%;
|
|
91
|
+
}
|
|
92
|
+
</style>
|
package/src/Table/Table.svelte
CHANGED
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
export let autoSortColumns = true
|
|
38
38
|
export let compact = false
|
|
39
39
|
export let customPlaceholder = false
|
|
40
|
+
export let showHeaderBorder = true
|
|
40
41
|
export let placeholderText = "No rows found"
|
|
41
42
|
|
|
42
43
|
const dispatch = createEventDispatcher()
|
|
@@ -286,6 +287,7 @@
|
|
|
286
287
|
<div class="spectrum-Table-head">
|
|
287
288
|
{#if showEditColumn}
|
|
288
289
|
<div
|
|
290
|
+
class:noBorderHeader={!showHeaderBorder}
|
|
289
291
|
class="spectrum-Table-headCell spectrum-Table-headCell--divider spectrum-Table-headCell--edit"
|
|
290
292
|
>
|
|
291
293
|
{#if allowSelectRows}
|
|
@@ -301,6 +303,7 @@
|
|
|
301
303
|
{#each fields as field}
|
|
302
304
|
<div
|
|
303
305
|
class="spectrum-Table-headCell"
|
|
306
|
+
class:noBorderHeader={!showHeaderBorder}
|
|
304
307
|
class:spectrum-Table-headCell--alignCenter={schema[field]
|
|
305
308
|
.align === "Center"}
|
|
306
309
|
class:spectrum-Table-headCell--alignRight={schema[field].align ===
|
|
@@ -348,6 +351,7 @@
|
|
|
348
351
|
<div class="spectrum-Table-row">
|
|
349
352
|
{#if showEditColumn}
|
|
350
353
|
<div
|
|
354
|
+
class:noBorderCheckbox={!showHeaderBorder}
|
|
351
355
|
class="spectrum-Table-cell spectrum-Table-cell--divider spectrum-Table-cell--edit"
|
|
352
356
|
on:click={e => {
|
|
353
357
|
toggleSelectRow(row)
|
|
@@ -481,6 +485,18 @@
|
|
|
481
485
|
.spectrum-Table-headCell:last-of-type {
|
|
482
486
|
border-right: var(--table-border);
|
|
483
487
|
}
|
|
488
|
+
|
|
489
|
+
.noBorderHeader {
|
|
490
|
+
border-top: none !important;
|
|
491
|
+
border-right: none !important;
|
|
492
|
+
border-left: none !important;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
.noBorderCheckbox {
|
|
496
|
+
border-top: none !important;
|
|
497
|
+
border-right: none !important;
|
|
498
|
+
}
|
|
499
|
+
|
|
484
500
|
.spectrum-Table-headCell--alignCenter {
|
|
485
501
|
justify-content: center;
|
|
486
502
|
}
|
|
@@ -499,7 +515,7 @@
|
|
|
499
515
|
z-index: 3;
|
|
500
516
|
}
|
|
501
517
|
.spectrum-Table-headCell .title {
|
|
502
|
-
overflow:
|
|
518
|
+
overflow: visible;
|
|
503
519
|
text-overflow: ellipsis;
|
|
504
520
|
}
|
|
505
521
|
.spectrum-Table-headCell:hover .spectrum-Table-editIcon {
|
|
@@ -562,7 +578,7 @@
|
|
|
562
578
|
gap: 4px;
|
|
563
579
|
border-bottom: 1px solid var(--spectrum-alias-border-color-mid);
|
|
564
580
|
background-color: var(--table-bg);
|
|
565
|
-
z-index:
|
|
581
|
+
z-index: auto;
|
|
566
582
|
}
|
|
567
583
|
.spectrum-Table-cell--divider {
|
|
568
584
|
padding-right: var(--cell-padding);
|
|
@@ -570,6 +586,7 @@
|
|
|
570
586
|
.spectrum-Table-cell--divider + .spectrum-Table-cell {
|
|
571
587
|
padding-left: var(--cell-padding);
|
|
572
588
|
}
|
|
589
|
+
|
|
573
590
|
.spectrum-Table-cell--edit {
|
|
574
591
|
position: sticky;
|
|
575
592
|
left: 0;
|
package/src/index.js
CHANGED
|
@@ -23,6 +23,8 @@ export { default as Icon, directions } from "./Icon/Icon.svelte"
|
|
|
23
23
|
export { default as Toggle } from "./Form/Toggle.svelte"
|
|
24
24
|
export { default as RadioGroup } from "./Form/RadioGroup.svelte"
|
|
25
25
|
export { default as Checkbox } from "./Form/Checkbox.svelte"
|
|
26
|
+
export { default as InputDropdown } from "./Form/InputDropdown.svelte"
|
|
27
|
+
export { default as PickerDropdown } from "./Form/PickerDropdown.svelte"
|
|
26
28
|
export { default as DetailSummary } from "./DetailSummary/DetailSummary.svelte"
|
|
27
29
|
export { default as Popover } from "./Popover/Popover.svelte"
|
|
28
30
|
export { default as ProgressBar } from "./ProgressBar/ProgressBar.svelte"
|
|
@@ -58,12 +60,15 @@ export { default as Pagination } from "./Pagination/Pagination.svelte"
|
|
|
58
60
|
export { default as Badge } from "./Badge/Badge.svelte"
|
|
59
61
|
export { default as StatusLight } from "./StatusLight/StatusLight.svelte"
|
|
60
62
|
export { default as ColorPicker } from "./ColorPicker/ColorPicker.svelte"
|
|
63
|
+
export { default as IconPicker } from "./IconPicker/IconPicker.svelte"
|
|
61
64
|
export { default as InlineAlert } from "./InlineAlert/InlineAlert.svelte"
|
|
62
65
|
export { default as Banner } from "./Banner/Banner.svelte"
|
|
63
66
|
export { default as BannerDisplay } from "./Banner/BannerDisplay.svelte"
|
|
64
67
|
export { default as MarkdownEditor } from "./Markdown/MarkdownEditor.svelte"
|
|
65
68
|
export { default as MarkdownViewer } from "./Markdown/MarkdownViewer.svelte"
|
|
66
69
|
export { default as RichTextField } from "./Form/RichTextField.svelte"
|
|
70
|
+
export { default as List } from "./List/List.svelte"
|
|
71
|
+
export { default as ListItem } from "./List/ListItem.svelte"
|
|
67
72
|
export { default as IconSideNav } from "./IconSideNav/IconSideNav.svelte"
|
|
68
73
|
export { default as IconSideNavItem } from "./IconSideNav/IconSideNavItem.svelte"
|
|
69
74
|
export { default as Slider } from "./Form/Slider.svelte"
|
|
@@ -71,6 +76,7 @@ export { default as Slider } from "./Form/Slider.svelte"
|
|
|
71
76
|
// Renderers
|
|
72
77
|
export { default as BoldRenderer } from "./Table/BoldRenderer.svelte"
|
|
73
78
|
export { default as CodeRenderer } from "./Table/CodeRenderer.svelte"
|
|
79
|
+
export { default as InternalRenderer } from "./Table/InternalRenderer.svelte"
|
|
74
80
|
|
|
75
81
|
// Typography
|
|
76
82
|
export { default as Body } from "./Typography/Body.svelte"
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { View } from "svench";
|
|
3
|
-
import DetailSummary from "./DetailSummary.svelte";
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
<svelte:head>
|
|
7
|
-
<link href="https://cdn.jsdelivr.net/npm/remixicon@2.5.0/fonts/remixicon.css" rel="stylesheet">
|
|
8
|
-
</svelte:head>
|
|
9
|
-
|
|
10
|
-
<style>
|
|
11
|
-
div {
|
|
12
|
-
display: flex;
|
|
13
|
-
flex-direction: column;
|
|
14
|
-
justify-content: flex-start;
|
|
15
|
-
align-items: stretch;
|
|
16
|
-
gap: var(--spacing-m);
|
|
17
|
-
width: 120px;
|
|
18
|
-
}
|
|
19
|
-
</style>
|
|
20
|
-
|
|
21
|
-
<View name="default">
|
|
22
|
-
<div>
|
|
23
|
-
<DetailSummary name="Category 1">
|
|
24
|
-
<span>1</span>
|
|
25
|
-
<span>2</span>
|
|
26
|
-
<span>3</span>
|
|
27
|
-
<span>4</span>
|
|
28
|
-
</DetailSummary>
|
|
29
|
-
<DetailSummary name="Category 2">
|
|
30
|
-
<span>1</span>
|
|
31
|
-
<span>2</span>
|
|
32
|
-
<span>3</span>
|
|
33
|
-
<span>4</span>
|
|
34
|
-
</DetailSummary>
|
|
35
|
-
</div>
|
|
36
|
-
</View>
|
|
37
|
-
|
|
38
|
-
<View name="thin">
|
|
39
|
-
<div>
|
|
40
|
-
<DetailSummary thin name="Category 1">
|
|
41
|
-
<span>1</span>
|
|
42
|
-
<span>2</span>
|
|
43
|
-
<span>3</span>
|
|
44
|
-
<span>4</span>
|
|
45
|
-
</DetailSummary>
|
|
46
|
-
<DetailSummary thin name="Category 2">
|
|
47
|
-
<span>1</span>
|
|
48
|
-
<span>2</span>
|
|
49
|
-
<span>3</span>
|
|
50
|
-
<span>4</span>
|
|
51
|
-
</DetailSummary>
|
|
52
|
-
</div>
|
|
53
|
-
</View>
|