@budibase/bbui 1.0.76-alpha.1 → 1.0.76-alpha.2
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 +239 -1
- package/dist/bbui.es.js.map +1 -1
- package/package.json +3 -2
- package/src/ColorPicker/ColorPicker.svelte +5 -0
- package/src/Drawer/Drawer.svelte +19 -2
- package/src/Table/AttachmentRenderer.svelte +10 -5
- package/src/Table/BoldRenderer.svelte +4 -0
- package/src/Table/CellRenderer.svelte +28 -4
- package/src/Table/CodeRenderer.svelte +9 -0
- package/src/Table/DateTimeRenderer.svelte +3 -1
- package/src/Table/InternalRenderer.svelte +0 -8
- package/src/Table/StringRenderer.svelte +2 -1
- package/src/Table/Table.svelte +316 -270
package/src/Table/Table.svelte
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import CellRenderer from "./CellRenderer.svelte"
|
|
5
5
|
import SelectEditRenderer from "./SelectEditRenderer.svelte"
|
|
6
6
|
import { cloneDeep, deepGet } from "../helpers"
|
|
7
|
+
import ProgressCircle from "../ProgressCircle/ProgressCircle.svelte"
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* The expected schema is our normal couch schemas for our tables.
|
|
@@ -14,6 +15,11 @@
|
|
|
14
15
|
* sortable: Set to false to disable sorting data by a certain column
|
|
15
16
|
* editable: Set to false to disable editing a certain column if the
|
|
16
17
|
* allowEditColumns prop is true
|
|
18
|
+
* width: the width of the column
|
|
19
|
+
* align: the alignment of the column
|
|
20
|
+
* template: a HBS or JS binding to use as the value
|
|
21
|
+
* background: the background color
|
|
22
|
+
* color: the text color
|
|
17
23
|
*/
|
|
18
24
|
export let data = []
|
|
19
25
|
export let schema = {}
|
|
@@ -28,13 +34,14 @@
|
|
|
28
34
|
export let editColumnTitle = "Edit"
|
|
29
35
|
export let customRenderers = []
|
|
30
36
|
export let disableSorting = false
|
|
37
|
+
export let autoSortColumns = true
|
|
38
|
+
export let compact = false
|
|
31
39
|
|
|
32
40
|
const dispatch = createEventDispatcher()
|
|
33
41
|
|
|
34
42
|
// Config
|
|
35
|
-
const rowHeight = 55
|
|
36
43
|
const headerHeight = 36
|
|
37
|
-
|
|
44
|
+
$: rowHeight = compact ? 46 : 55
|
|
38
45
|
|
|
39
46
|
// Sorting state
|
|
40
47
|
let sortColumn
|
|
@@ -45,32 +52,20 @@
|
|
|
45
52
|
let loaded = false
|
|
46
53
|
$: schema = fixSchema(schema)
|
|
47
54
|
$: if (!loading) loaded = true
|
|
48
|
-
$:
|
|
49
|
-
$:
|
|
50
|
-
$:
|
|
55
|
+
$: fields = getFields(schema, showAutoColumns, autoSortColumns)
|
|
56
|
+
$: rows = fields?.length ? data || [] : []
|
|
57
|
+
$: visibleRowCount = getVisibleRowCount(
|
|
58
|
+
loaded,
|
|
59
|
+
height,
|
|
60
|
+
rows.length,
|
|
61
|
+
rowCount,
|
|
62
|
+
rowHeight
|
|
63
|
+
)
|
|
64
|
+
$: contentStyle = getContentStyle(visibleRowCount, rowCount, rowHeight)
|
|
51
65
|
$: sortedRows = sortRows(rows, sortColumn, sortOrder)
|
|
52
|
-
$:
|
|
66
|
+
$: gridStyle = getGridStyle(fields, schema, showEditColumn)
|
|
53
67
|
$: showEditColumn = allowEditRows || allowSelectRows
|
|
54
|
-
|
|
55
|
-
// Scrolling state
|
|
56
|
-
let timeout
|
|
57
|
-
let nextScrollTop = 0
|
|
58
|
-
let scrollTop = 0
|
|
59
|
-
$: firstVisibleRow = calculateFirstVisibleRow(scrollTop)
|
|
60
|
-
$: lastVisibleRow = calculateLastVisibleRow(
|
|
61
|
-
firstVisibleRow,
|
|
62
|
-
visibleRowCount,
|
|
63
|
-
rows.length
|
|
64
|
-
)
|
|
65
|
-
|
|
66
|
-
// Reset state when data changes
|
|
67
|
-
$: rows.length, reset()
|
|
68
|
-
const reset = () => {
|
|
69
|
-
nextScrollTop = 0
|
|
70
|
-
scrollTop = 0
|
|
71
|
-
clearTimeout(timeout)
|
|
72
|
-
timeout = null
|
|
73
|
-
}
|
|
68
|
+
$: cellStyles = computeCellStyles(schema)
|
|
74
69
|
|
|
75
70
|
const fixSchema = schema => {
|
|
76
71
|
let fixedSchema = {}
|
|
@@ -90,7 +85,7 @@
|
|
|
90
85
|
return fixedSchema
|
|
91
86
|
}
|
|
92
87
|
|
|
93
|
-
const getVisibleRowCount = (loaded, height, allRows, rowCount) => {
|
|
88
|
+
const getVisibleRowCount = (loaded, height, allRows, rowCount, rowHeight) => {
|
|
94
89
|
if (!loaded) {
|
|
95
90
|
return rowCount || 0
|
|
96
91
|
}
|
|
@@ -100,11 +95,28 @@
|
|
|
100
95
|
return Math.min(allRows, Math.ceil(height / rowHeight))
|
|
101
96
|
}
|
|
102
97
|
|
|
103
|
-
const getContentStyle = (visibleRows, rowCount) => {
|
|
98
|
+
const getContentStyle = (visibleRows, rowCount, rowHeight) => {
|
|
104
99
|
if (!rowCount || !visibleRows) {
|
|
105
100
|
return ""
|
|
106
101
|
}
|
|
107
|
-
return `height: ${headerHeight + visibleRows *
|
|
102
|
+
return `height: ${headerHeight + visibleRows * rowHeight}px;`
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const getGridStyle = (fields, schema, showEditColumn) => {
|
|
106
|
+
let style = "grid-template-columns:"
|
|
107
|
+
if (showEditColumn) {
|
|
108
|
+
style += " auto"
|
|
109
|
+
}
|
|
110
|
+
fields?.forEach(field => {
|
|
111
|
+
const fieldSchema = schema[field]
|
|
112
|
+
if (fieldSchema.width) {
|
|
113
|
+
style += ` ${fieldSchema.width}`
|
|
114
|
+
} else {
|
|
115
|
+
style += " minmax(auto, 1fr)"
|
|
116
|
+
}
|
|
117
|
+
})
|
|
118
|
+
style += ";"
|
|
119
|
+
return style
|
|
108
120
|
}
|
|
109
121
|
|
|
110
122
|
const sortRows = (rows, sortColumn, sortOrder) => {
|
|
@@ -143,14 +155,14 @@
|
|
|
143
155
|
return name || ""
|
|
144
156
|
}
|
|
145
157
|
|
|
146
|
-
const getFields = (schema, showAutoColumns) => {
|
|
158
|
+
const getFields = (schema, showAutoColumns, autoSortColumns) => {
|
|
147
159
|
let columns = []
|
|
148
160
|
let autoColumns = []
|
|
149
161
|
Object.entries(schema || {}).forEach(([field, fieldSchema]) => {
|
|
150
162
|
if (!field || !fieldSchema) {
|
|
151
163
|
return
|
|
152
164
|
}
|
|
153
|
-
if (!fieldSchema?.autocolumn) {
|
|
165
|
+
if (!autoSortColumns || !fieldSchema?.autocolumn) {
|
|
154
166
|
columns.push(fieldSchema)
|
|
155
167
|
} else if (showAutoColumns) {
|
|
156
168
|
autoColumns.push(fieldSchema)
|
|
@@ -171,28 +183,6 @@
|
|
|
171
183
|
.map(column => column.name)
|
|
172
184
|
}
|
|
173
185
|
|
|
174
|
-
const onScroll = event => {
|
|
175
|
-
nextScrollTop = event.target.scrollTop
|
|
176
|
-
if (timeout) {
|
|
177
|
-
return
|
|
178
|
-
}
|
|
179
|
-
timeout = setTimeout(() => {
|
|
180
|
-
scrollTop = nextScrollTop
|
|
181
|
-
timeout = null
|
|
182
|
-
}, 50)
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
const calculateFirstVisibleRow = scrollTop => {
|
|
186
|
-
return Math.max(Math.floor(scrollTop / (rowHeight + 1)) - rowPreload, 0)
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
const calculateLastVisibleRow = (firstRow, visibleRowCount, allRowCount) => {
|
|
190
|
-
if (visibleRowCount === 0) {
|
|
191
|
-
return -1
|
|
192
|
-
}
|
|
193
|
-
return Math.min(firstRow + visibleRowCount + 2 * rowPreload, allRowCount)
|
|
194
|
-
}
|
|
195
|
-
|
|
196
186
|
const editColumn = (e, field) => {
|
|
197
187
|
e.stopPropagation()
|
|
198
188
|
dispatch("editcolumn", field)
|
|
@@ -213,170 +203,233 @@
|
|
|
213
203
|
selectedRows = [...selectedRows, row]
|
|
214
204
|
}
|
|
215
205
|
}
|
|
206
|
+
|
|
207
|
+
const computeCellStyles = schema => {
|
|
208
|
+
let styles = {}
|
|
209
|
+
Object.keys(schema || {}).forEach(field => {
|
|
210
|
+
styles[field] = ""
|
|
211
|
+
if (schema[field].color) {
|
|
212
|
+
styles[field] += `color: ${schema[field].color};`
|
|
213
|
+
}
|
|
214
|
+
if (schema[field].background) {
|
|
215
|
+
styles[field] += `background-color: ${schema[field].background};`
|
|
216
|
+
}
|
|
217
|
+
if (schema[field].align === "Center") {
|
|
218
|
+
styles[field] += "justify-content: center; text-align: center;"
|
|
219
|
+
}
|
|
220
|
+
if (schema[field].align === "Right") {
|
|
221
|
+
styles[field] += "justify-content: flex-end; text-align: right;"
|
|
222
|
+
}
|
|
223
|
+
})
|
|
224
|
+
return styles
|
|
225
|
+
}
|
|
216
226
|
</script>
|
|
217
227
|
|
|
218
|
-
<div
|
|
228
|
+
<div
|
|
229
|
+
class="wrapper"
|
|
230
|
+
class:wrapper--quiet={quiet}
|
|
231
|
+
class:wrapper--compact={compact}
|
|
232
|
+
bind:offsetHeight={height}
|
|
233
|
+
style={`--row-height: ${rowHeight}px; --header-height: ${headerHeight}px;`}
|
|
234
|
+
>
|
|
219
235
|
{#if !loaded}
|
|
220
|
-
<div class="loading" style={contentStyle}
|
|
236
|
+
<div class="loading" style={contentStyle}>
|
|
237
|
+
<ProgressCircle />
|
|
238
|
+
</div>
|
|
221
239
|
{:else}
|
|
222
|
-
<div
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
<thead class="spectrum-Table-head">
|
|
232
|
-
<tr>
|
|
233
|
-
{#if showEditColumn}
|
|
234
|
-
<th class="spectrum-Table-headCell">
|
|
235
|
-
<div class="spectrum-Table-headCell-content">
|
|
236
|
-
{editColumnTitle || ""}
|
|
237
|
-
</div>
|
|
238
|
-
</th>
|
|
239
|
-
{/if}
|
|
240
|
-
{#each fields as field}
|
|
241
|
-
<th
|
|
242
|
-
class="spectrum-Table-headCell"
|
|
243
|
-
class:is-sortable={schema[field].sortable !== false}
|
|
244
|
-
class:is-sorted-desc={sortColumn === field &&
|
|
245
|
-
sortOrder === "Descending"}
|
|
246
|
-
class:is-sorted-asc={sortColumn === field &&
|
|
247
|
-
sortOrder === "Ascending"}
|
|
248
|
-
on:click={() => sortBy(schema[field])}
|
|
249
|
-
>
|
|
250
|
-
<div class="spectrum-Table-headCell-content">
|
|
251
|
-
<div class="title">{getDisplayName(schema[field])}</div>
|
|
252
|
-
{#if schema[field]?.autocolumn}
|
|
253
|
-
<svg
|
|
254
|
-
class="spectrum-Icon spectrum-Table-autoIcon"
|
|
255
|
-
focusable="false"
|
|
256
|
-
>
|
|
257
|
-
<use xlink:href="#spectrum-icon-18-MagicWand" />
|
|
258
|
-
</svg>
|
|
259
|
-
{/if}
|
|
260
|
-
{#if sortColumn === field}
|
|
261
|
-
<svg
|
|
262
|
-
class="spectrum-Icon spectrum-UIIcon-ArrowDown100 spectrum-Table-sortedIcon"
|
|
263
|
-
focusable="false"
|
|
264
|
-
aria-hidden="true"
|
|
265
|
-
>
|
|
266
|
-
<use xlink:href="#spectrum-css-icon-Arrow100" />
|
|
267
|
-
</svg>
|
|
268
|
-
{/if}
|
|
269
|
-
{#if allowEditColumns && schema[field]?.editable !== false}
|
|
270
|
-
<svg
|
|
271
|
-
class="spectrum-Icon spectrum-Table-editIcon"
|
|
272
|
-
focusable="false"
|
|
273
|
-
on:click={e => editColumn(e, field)}
|
|
274
|
-
>
|
|
275
|
-
<use xlink:href="#spectrum-icon-18-Edit" />
|
|
276
|
-
</svg>
|
|
277
|
-
{/if}
|
|
278
|
-
</div>
|
|
279
|
-
</th>
|
|
280
|
-
{/each}
|
|
281
|
-
</tr>
|
|
282
|
-
</thead>
|
|
240
|
+
<div class="spectrum-Table" style={`${contentStyle}${gridStyle}`}>
|
|
241
|
+
{#if fields.length}
|
|
242
|
+
<div class="spectrum-Table-head">
|
|
243
|
+
{#if showEditColumn}
|
|
244
|
+
<div
|
|
245
|
+
class="spectrum-Table-headCell spectrum-Table-headCell--divider spectrum-Table-headCell--edit"
|
|
246
|
+
>
|
|
247
|
+
{editColumnTitle || ""}
|
|
248
|
+
</div>
|
|
283
249
|
{/if}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
250
|
+
{#each fields as field}
|
|
251
|
+
<div
|
|
252
|
+
class="spectrum-Table-headCell"
|
|
253
|
+
class:spectrum-Table-headCell--alignCenter={schema[field]
|
|
254
|
+
.align === "Center"}
|
|
255
|
+
class:spectrum-Table-headCell--alignRight={schema[field].align ===
|
|
256
|
+
"Right"}
|
|
257
|
+
class:is-sortable={schema[field].sortable !== false}
|
|
258
|
+
class:is-sorted-desc={sortColumn === field &&
|
|
259
|
+
sortOrder === "Descending"}
|
|
260
|
+
class:is-sorted-asc={sortColumn === field &&
|
|
261
|
+
sortOrder === "Ascending"}
|
|
262
|
+
on:click={() => sortBy(schema[field])}
|
|
263
|
+
>
|
|
264
|
+
<div class="title">{getDisplayName(schema[field])}</div>
|
|
265
|
+
{#if schema[field]?.autocolumn}
|
|
266
|
+
<svg
|
|
267
|
+
class="spectrum-Icon spectrum-Table-autoIcon"
|
|
268
|
+
focusable="false"
|
|
269
|
+
>
|
|
270
|
+
<use xlink:href="#spectrum-icon-18-MagicWand" />
|
|
271
|
+
</svg>
|
|
272
|
+
{/if}
|
|
273
|
+
{#if sortColumn === field}
|
|
274
|
+
<svg
|
|
275
|
+
class="spectrum-Icon spectrum-UIIcon-ArrowDown100 spectrum-Table-sortedIcon"
|
|
276
|
+
focusable="false"
|
|
277
|
+
aria-hidden="true"
|
|
292
278
|
>
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
{/if}
|
|
330
|
-
</tr>
|
|
331
|
-
{/each}
|
|
332
|
-
{:else}
|
|
333
|
-
<tr class="placeholder-row">
|
|
334
|
-
{#if showEditColumn}
|
|
335
|
-
<td class="placeholder-offset" />
|
|
336
|
-
{/if}
|
|
337
|
-
{#each fields as field}
|
|
338
|
-
<td />
|
|
339
|
-
{/each}
|
|
340
|
-
<div class="placeholder" class:has-fields={fields.length > 0}>
|
|
341
|
-
<div class="placeholder-content">
|
|
342
|
-
<svg
|
|
343
|
-
class="spectrum-Icon spectrum-Icon--sizeXXL"
|
|
344
|
-
focusable="false"
|
|
345
|
-
>
|
|
346
|
-
<use xlink:href="#spectrum-icon-18-Table" />
|
|
347
|
-
</svg>
|
|
348
|
-
<div>No rows found</div>
|
|
349
|
-
</div>
|
|
350
|
-
</div>
|
|
351
|
-
</tr>
|
|
279
|
+
<use xlink:href="#spectrum-css-icon-Arrow100" />
|
|
280
|
+
</svg>
|
|
281
|
+
{/if}
|
|
282
|
+
{#if allowEditColumns && schema[field]?.editable !== false}
|
|
283
|
+
<svg
|
|
284
|
+
class="spectrum-Icon spectrum-Table-editIcon"
|
|
285
|
+
focusable="false"
|
|
286
|
+
on:click={e => editColumn(e, field)}
|
|
287
|
+
>
|
|
288
|
+
<use xlink:href="#spectrum-icon-18-Edit" />
|
|
289
|
+
</svg>
|
|
290
|
+
{/if}
|
|
291
|
+
</div>
|
|
292
|
+
{/each}
|
|
293
|
+
</div>
|
|
294
|
+
{/if}
|
|
295
|
+
{#if sortedRows?.length}
|
|
296
|
+
{#each sortedRows as row, idx}
|
|
297
|
+
<div
|
|
298
|
+
class="spectrum-Table-row"
|
|
299
|
+
on:click={() => dispatch("click", row)}
|
|
300
|
+
on:click={() => toggleSelectRow(row)}
|
|
301
|
+
>
|
|
302
|
+
{#if showEditColumn}
|
|
303
|
+
<div
|
|
304
|
+
class="spectrum-Table-cell spectrum-Table-cell--divider spectrum-Table-cell--edit"
|
|
305
|
+
>
|
|
306
|
+
<SelectEditRenderer
|
|
307
|
+
data={row}
|
|
308
|
+
selected={selectedRows.includes(row)}
|
|
309
|
+
onToggleSelection={() => toggleSelectRow(row)}
|
|
310
|
+
onEdit={e => editRow(e, row)}
|
|
311
|
+
{allowSelectRows}
|
|
312
|
+
{allowEditRows}
|
|
313
|
+
/>
|
|
314
|
+
</div>
|
|
352
315
|
{/if}
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
316
|
+
{#each fields as field}
|
|
317
|
+
<div
|
|
318
|
+
class="spectrum-Table-cell"
|
|
319
|
+
class:spectrum-Table-cell--divider={!!schema[field].divider}
|
|
320
|
+
style={cellStyles[field]}
|
|
321
|
+
>
|
|
322
|
+
<CellRenderer
|
|
323
|
+
{customRenderers}
|
|
324
|
+
{row}
|
|
325
|
+
schema={schema[field]}
|
|
326
|
+
value={deepGet(row, field)}
|
|
327
|
+
on:clickrelationship
|
|
328
|
+
>
|
|
329
|
+
<slot />
|
|
330
|
+
</CellRenderer>
|
|
331
|
+
</div>
|
|
332
|
+
{/each}
|
|
333
|
+
</div>
|
|
334
|
+
{/each}
|
|
335
|
+
{:else}
|
|
336
|
+
<div class="placeholder" class:placeholder--no-fields={!fields?.length}>
|
|
337
|
+
<div class="placeholder-content">
|
|
338
|
+
<svg class="spectrum-Icon spectrum-Icon--sizeXXL" focusable="false">
|
|
339
|
+
<use xlink:href="#spectrum-icon-18-Table" />
|
|
340
|
+
</svg>
|
|
341
|
+
<div>No rows found</div>
|
|
342
|
+
</div>
|
|
343
|
+
</div>
|
|
344
|
+
{/if}
|
|
356
345
|
</div>
|
|
357
346
|
{/if}
|
|
358
347
|
</div>
|
|
359
348
|
|
|
360
349
|
<style>
|
|
350
|
+
/* Wrapper */
|
|
361
351
|
.wrapper {
|
|
362
|
-
background-color: var(--spectrum-alias-background-color-secondary);
|
|
363
|
-
overflow: hidden;
|
|
364
352
|
position: relative;
|
|
365
353
|
z-index: 0;
|
|
354
|
+
--table-bg: var(--spectrum-global-color-gray-50);
|
|
355
|
+
--table-border: 1px solid var(--spectrum-alias-border-color-mid);
|
|
356
|
+
--cell-padding: var(--spectrum-global-dimension-size-250);
|
|
366
357
|
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
height: 100%;
|
|
370
|
-
position: relative;
|
|
371
|
-
overflow: auto;
|
|
358
|
+
.wrapper--quiet {
|
|
359
|
+
--table-bg: var(--spectrum-alias-background-color-transparent);
|
|
372
360
|
}
|
|
373
|
-
.
|
|
374
|
-
|
|
361
|
+
.wrapper--compact {
|
|
362
|
+
--cell-padding: var(--spectrum-global-dimension-size-150);
|
|
375
363
|
}
|
|
376
|
-
|
|
364
|
+
|
|
365
|
+
/* Loading */
|
|
366
|
+
.loading {
|
|
367
|
+
display: grid;
|
|
368
|
+
place-items: center;
|
|
369
|
+
min-height: 100px;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/* Table */
|
|
373
|
+
.spectrum-Table {
|
|
377
374
|
width: 100%;
|
|
375
|
+
border-radius: 0;
|
|
376
|
+
display: grid;
|
|
377
|
+
overflow: auto;
|
|
378
378
|
}
|
|
379
379
|
|
|
380
|
+
/* Header */
|
|
381
|
+
.spectrum-Table-head {
|
|
382
|
+
display: contents;
|
|
383
|
+
}
|
|
384
|
+
.spectrum-Table-head > :first-child {
|
|
385
|
+
border-left: 1px solid transparent;
|
|
386
|
+
padding-left: var(--cell-padding);
|
|
387
|
+
}
|
|
388
|
+
.spectrum-Table-head > :last-child {
|
|
389
|
+
border-right: 1px solid transparent;
|
|
390
|
+
padding-right: var(--cell-padding);
|
|
391
|
+
}
|
|
392
|
+
.spectrum-Table-headCell {
|
|
393
|
+
height: var(--header-height);
|
|
394
|
+
position: sticky;
|
|
395
|
+
top: 0;
|
|
396
|
+
text-overflow: ellipsis;
|
|
397
|
+
white-space: nowrap;
|
|
398
|
+
background-color: var(--spectrum-alias-background-color-secondary);
|
|
399
|
+
z-index: 2;
|
|
400
|
+
border-bottom: var(--table-border);
|
|
401
|
+
padding: 0 calc(var(--cell-padding) / 1.33);
|
|
402
|
+
display: flex;
|
|
403
|
+
flex-direction: row;
|
|
404
|
+
justify-content: flex-start;
|
|
405
|
+
align-items: center;
|
|
406
|
+
user-select: none;
|
|
407
|
+
}
|
|
408
|
+
.spectrum-Table-headCell--alignCenter {
|
|
409
|
+
justify-content: center;
|
|
410
|
+
}
|
|
411
|
+
.spectrum-Table-headCell--alignRight {
|
|
412
|
+
justify-content: flex-end;
|
|
413
|
+
}
|
|
414
|
+
.spectrum-Table-headCell--divider {
|
|
415
|
+
padding-right: var(--cell-padding);
|
|
416
|
+
}
|
|
417
|
+
.spectrum-Table-headCell--divider + .spectrum-Table-headCell {
|
|
418
|
+
padding-left: var(--cell-padding);
|
|
419
|
+
}
|
|
420
|
+
.spectrum-Table-headCell--edit {
|
|
421
|
+
position: sticky;
|
|
422
|
+
left: 0;
|
|
423
|
+
z-index: 3;
|
|
424
|
+
}
|
|
425
|
+
.spectrum-Table-headCell .title {
|
|
426
|
+
overflow: hidden;
|
|
427
|
+
text-overflow: ellipsis;
|
|
428
|
+
}
|
|
429
|
+
.spectrum-Table-headCell:hover .spectrum-Table-editIcon {
|
|
430
|
+
opacity: 1;
|
|
431
|
+
transition: opacity 0.2s ease;
|
|
432
|
+
}
|
|
380
433
|
.spectrum-Table-headCell .spectrum-Icon {
|
|
381
434
|
pointer-events: all;
|
|
382
435
|
margin-left: var(
|
|
@@ -392,63 +445,93 @@
|
|
|
392
445
|
.spectrum-Table-editIcon {
|
|
393
446
|
opacity: 0;
|
|
394
447
|
}
|
|
395
|
-
.spectrum-Table-headCell:hover .spectrum-Table-editIcon {
|
|
396
|
-
opacity: 1;
|
|
397
|
-
transition: opacity 0.2s ease;
|
|
398
|
-
}
|
|
399
448
|
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
449
|
+
/* Table rows */
|
|
450
|
+
.spectrum-Table-row {
|
|
451
|
+
display: contents;
|
|
452
|
+
}
|
|
453
|
+
.spectrum-Table-row:hover .spectrum-Table-cell {
|
|
454
|
+
/*background-color: var(--hover-bg) !important;*/
|
|
455
|
+
}
|
|
456
|
+
.spectrum-Table-row:hover .spectrum-Table-cell:after {
|
|
457
|
+
background-color: var(--spectrum-alias-highlight-hover);
|
|
458
|
+
}
|
|
459
|
+
.wrapper--quiet .spectrum-Table-row {
|
|
460
|
+
border-left: none;
|
|
461
|
+
border-right: none;
|
|
462
|
+
}
|
|
463
|
+
.spectrum-Table-row > :first-child {
|
|
464
|
+
border-left: var(--table-border);
|
|
465
|
+
padding-left: var(--cell-padding);
|
|
466
|
+
}
|
|
467
|
+
.spectrum-Table-row > :last-child {
|
|
468
|
+
border-right: var(--table-border);
|
|
469
|
+
padding-right: var(--cell-padding);
|
|
409
470
|
}
|
|
410
|
-
|
|
471
|
+
|
|
472
|
+
/* Table cells */
|
|
473
|
+
.spectrum-Table-cell {
|
|
474
|
+
flex: 1 1 auto;
|
|
475
|
+
padding: 0 calc(var(--cell-padding) / 1.33);
|
|
476
|
+
border-top: none;
|
|
477
|
+
border-bottom: none;
|
|
478
|
+
border-radius: 0;
|
|
479
|
+
text-overflow: ellipsis;
|
|
411
480
|
white-space: nowrap;
|
|
481
|
+
height: var(--row-height);
|
|
412
482
|
display: flex;
|
|
413
483
|
flex-direction: row;
|
|
414
484
|
justify-content: flex-start;
|
|
415
485
|
align-items: center;
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
text-overflow: ellipsis;
|
|
486
|
+
gap: 4px;
|
|
487
|
+
border-bottom: 1px solid var(--spectrum-alias-border-color-mid);
|
|
488
|
+
background-color: var(--table-bg);
|
|
489
|
+
z-index: 1;
|
|
421
490
|
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
position: relative;
|
|
425
|
-
height: 150px;
|
|
491
|
+
.spectrum-Table-cell--divider {
|
|
492
|
+
padding-right: var(--cell-padding);
|
|
426
493
|
}
|
|
427
|
-
.
|
|
428
|
-
|
|
429
|
-
border-bottom: none !important;
|
|
494
|
+
.spectrum-Table-cell--divider + .spectrum-Table-cell {
|
|
495
|
+
padding-left: var(--cell-padding);
|
|
430
496
|
}
|
|
431
|
-
.
|
|
432
|
-
|
|
497
|
+
.spectrum-Table-cell--edit {
|
|
498
|
+
position: sticky;
|
|
499
|
+
left: 0;
|
|
500
|
+
z-index: 2;
|
|
433
501
|
}
|
|
434
|
-
.
|
|
435
|
-
|
|
502
|
+
.spectrum-Table-cell:after {
|
|
503
|
+
content: "";
|
|
504
|
+
position: absolute;
|
|
505
|
+
width: 100%;
|
|
436
506
|
height: 100%;
|
|
507
|
+
background-color: transparent;
|
|
508
|
+
top: 0;
|
|
437
509
|
left: 0;
|
|
438
|
-
|
|
439
|
-
|
|
510
|
+
pointer-events: none;
|
|
511
|
+
transition: background-color
|
|
512
|
+
var(--spectrum-global-animation-duration-100, 0.13s) ease-in-out;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
/* Placeholder */
|
|
516
|
+
.placeholder {
|
|
440
517
|
display: flex;
|
|
441
518
|
flex-direction: row;
|
|
442
519
|
justify-content: center;
|
|
443
520
|
align-items: center;
|
|
521
|
+
border: var(--table-border);
|
|
522
|
+
border-top: none;
|
|
523
|
+
grid-column: 1 / -1;
|
|
524
|
+
background-color: var(--table-bg);
|
|
444
525
|
}
|
|
445
|
-
.placeholder
|
|
446
|
-
top: var(--
|
|
447
|
-
|
|
526
|
+
.placeholder--no-fields {
|
|
527
|
+
border-top: var(--table-border);
|
|
528
|
+
}
|
|
529
|
+
.wrapper--quiet .placeholder {
|
|
530
|
+
border-left: none;
|
|
531
|
+
border-right: none;
|
|
448
532
|
}
|
|
449
|
-
|
|
450
533
|
.placeholder-content {
|
|
451
|
-
padding:
|
|
534
|
+
padding: 40px;
|
|
452
535
|
display: flex;
|
|
453
536
|
flex-direction: column;
|
|
454
537
|
justify-content: center;
|
|
@@ -466,41 +549,4 @@
|
|
|
466
549
|
);
|
|
467
550
|
text-align: center;
|
|
468
551
|
}
|
|
469
|
-
|
|
470
|
-
tbody {
|
|
471
|
-
z-index: 1;
|
|
472
|
-
}
|
|
473
|
-
tbody tr {
|
|
474
|
-
height: var(--row-height);
|
|
475
|
-
}
|
|
476
|
-
tbody tr.hidden {
|
|
477
|
-
height: calc(var(--row-height) + 1px);
|
|
478
|
-
}
|
|
479
|
-
td {
|
|
480
|
-
padding-top: 0;
|
|
481
|
-
padding-bottom: 0;
|
|
482
|
-
border-bottom: none;
|
|
483
|
-
border-top: 1px solid
|
|
484
|
-
var(--spectrum-table-border-color, var(--spectrum-alias-border-color-mid));
|
|
485
|
-
border-radius: 0;
|
|
486
|
-
}
|
|
487
|
-
tr:first-child td {
|
|
488
|
-
border-top: none;
|
|
489
|
-
}
|
|
490
|
-
tr:last-child td {
|
|
491
|
-
border-bottom: 1px solid
|
|
492
|
-
var(--spectrum-table-border-color, var(--spectrum-alias-border-color-mid));
|
|
493
|
-
}
|
|
494
|
-
td.spectrum-Table-cell--divider {
|
|
495
|
-
width: 1px;
|
|
496
|
-
}
|
|
497
|
-
.spectrum-Table-cell-content {
|
|
498
|
-
height: var(--row-height);
|
|
499
|
-
white-space: nowrap;
|
|
500
|
-
display: flex;
|
|
501
|
-
flex-direction: row;
|
|
502
|
-
justify-content: flex-start;
|
|
503
|
-
align-items: center;
|
|
504
|
-
gap: 4px;
|
|
505
|
-
}
|
|
506
552
|
</style>
|