@poirazis/supercomponents-shared 1.1.7 → 1.2.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/index.js +21096 -44266
- package/dist/index.umd.cjs +19 -23
- package/dist/style.css +1 -1
- package/package.json +5 -6
- package/src/index.js +4 -0
- package/src/index.ts +3 -0
- package/src/lib/Actions/index.js +3 -3
- package/src/lib/SuperButton/SuperButton.svelte +39 -4
- package/src/lib/SuperField/SuperField.svelte +4 -1
- package/src/lib/SuperForm/InnerForm.svelte +2 -2
- package/src/lib/SuperList/SuperList.svelte +2 -2
- package/src/lib/SuperList/drag-handle.svelte +8 -8
- package/src/lib/SuperTable/SuperTable.css +11 -7
- package/src/lib/SuperTable/SuperTable.svelte +315 -186
- package/src/lib/SuperTable/controls/ColumnsSection.svelte +18 -14
- package/src/lib/SuperTable/controls/PaginationLimitOffset.svelte +133 -0
- package/src/lib/SuperTable/controls/RowButtonsColumn.svelte +9 -15
- package/src/lib/SuperTable/controls/SelectionColumn.svelte +58 -118
- package/src/lib/SuperTable/controls/SuperTableWelcome.svelte +1 -1
- package/src/lib/SuperTable/overlays/AddNewRowOverlay.svelte +3 -3
- package/src/lib/SuperTable/overlays/EmptyResultSetOverlay.svelte +1 -1
- package/src/lib/SuperTable/overlays/ScrollbarsOverlay.svelte +43 -43
- package/src/lib/SuperTableCells/CellAttachment.svelte +0 -11
- package/src/lib/SuperTableCells/CellAttachmentExpanded.svelte +1 -12
- package/src/lib/SuperTableCells/CellAttachmentSlider.svelte +2 -33
- package/src/lib/SuperTableCells/CellBoolean.svelte +1 -12
- package/src/lib/SuperTableCells/CellColor.svelte +7 -7
- package/src/lib/SuperTableCells/CellCommon.css +20 -4
- package/src/lib/SuperTableCells/CellDateRange.svelte +0 -11
- package/src/lib/SuperTableCells/CellDatetime.svelte +0 -11
- package/src/lib/SuperTableCells/CellIcon.svelte +8 -8
- package/src/lib/SuperTableCells/CellJSON.svelte +2 -30
- package/src/lib/SuperTableCells/CellLink.svelte +50 -43
- package/src/lib/SuperTableCells/CellLinkAdvanced.svelte +2 -15
- package/src/lib/SuperTableCells/CellLinkPickerSelect.svelte +10 -11
- package/src/lib/SuperTableCells/CellLinkPickerTree.svelte +5 -0
- package/src/lib/SuperTableCells/CellNumber.svelte +157 -75
- package/src/lib/SuperTableCells/CellOptions.svelte +18 -24
- package/src/lib/SuperTableCells/CellOptionsAdvanced.svelte +11 -9
- package/src/lib/SuperTableCells/CellSQLLink.svelte +301 -0
- package/src/lib/SuperTableCells/CellSQLLinkPicker.svelte +569 -0
- package/src/lib/SuperTableCells/CellString.svelte +90 -54
- package/src/lib/SuperTableCells/CellStringMask.svelte +1 -1
- package/src/lib/SuperTableCells/CellTags.svelte +151 -108
- package/src/lib/SuperTableCells/JSDOC_GUIDE.md +869 -0
- package/src/lib/SuperTableCells/index.js +3 -2
- package/src/lib/SuperTableCells/types.js +220 -0
- package/src/lib/SuperTableColumn/SuperTableColumn.svelte +2 -4
- package/src/lib/SuperTableColumn/parts/SuperColumnBody.svelte +13 -16
- package/src/lib/SuperTableColumn/parts/SuperColumnHeader.svelte +2 -2
- package/src/lib/SuperTableColumn/parts/SuperColumnRow.svelte +9 -16
- package/src/lib/SuperTabs/SuperTabs.svelte +7 -4
- package/src/lib/SuperTree/SuperTree.svelte +84 -38
- package/src/lib/UI/elements/Checkbox.svelte +79 -0
- package/src/lib/UI/elements/Icon.svelte +0 -0
- package/src/lib/UI/elements/IconButton.svelte +115 -0
- package/src/lib/UI/elements/Tooltip.svelte +65 -0
- package/src/lib/SuperTableCells/CellEditorStateMachine.js +0 -130
- package/src/lib/SuperTableCells/CellNumberSimple.svelte +0 -56
- package/src/lib/SuperTableCells/MaskUtils.js +0 -100
- package/src/lib/SuperTableCells/remixIcons.js +0 -6772
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
export let showActionColumn;
|
|
9
9
|
export let canScroll;
|
|
10
10
|
export let stbData;
|
|
11
|
-
let overflow;
|
|
12
11
|
</script>
|
|
13
12
|
|
|
14
13
|
<div bind:this={columnsViewport} class="st-master-columns" tabIndex="-1">
|
|
@@ -16,19 +15,24 @@
|
|
|
16
15
|
<slot />
|
|
17
16
|
{/if}
|
|
18
17
|
|
|
19
|
-
{#
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
18
|
+
{#if $superColumns.length === 0}
|
|
19
|
+
<div class="no-columns-placeholder">
|
|
20
|
+
No columns defined. Please add columns to the Super Table.
|
|
21
|
+
</div>
|
|
22
|
+
{:else}
|
|
23
|
+
{#each $superColumns as column, idx (idx)}
|
|
24
|
+
<SuperTableColumn
|
|
25
|
+
{stbData}
|
|
26
|
+
columnOptions={{
|
|
27
|
+
...$commonColumnOptions,
|
|
28
|
+
...column,
|
|
29
|
+
isFirst: idx == 0,
|
|
30
|
+
isLast:
|
|
31
|
+
idx == $superColumns.length - 1 && !showActionColumn && canScroll,
|
|
32
|
+
}}
|
|
33
|
+
/>
|
|
34
|
+
{/each}
|
|
35
|
+
{/if}
|
|
32
36
|
|
|
33
37
|
{#if $stbSettings.superColumnsPos == "last"}
|
|
34
38
|
<slot />
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { createEventDispatcher } from "svelte";
|
|
3
|
+
|
|
4
|
+
const dispatch = createEventDispatcher();
|
|
5
|
+
export let limit = 50;
|
|
6
|
+
export let pagination = "none";
|
|
7
|
+
export let currentOffset = 0;
|
|
8
|
+
export let dataSource = null;
|
|
9
|
+
export let fetch = null;
|
|
10
|
+
|
|
11
|
+
$: valid = hasParams($dataSource) && pagination === "limitOffset";
|
|
12
|
+
$: currentOffset = $dataSource?.queryParams?.offset || 0;
|
|
13
|
+
|
|
14
|
+
$: currentPage = Math.floor(currentOffset / limit) + 1;
|
|
15
|
+
$: hasMorePages = $fetch?.rows?.length >= limit;
|
|
16
|
+
|
|
17
|
+
function goToPrevious() {
|
|
18
|
+
if (currentOffset > 0) {
|
|
19
|
+
currentOffset = Math.max(0, currentOffset - limit);
|
|
20
|
+
updateDataSource();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function goToNext() {
|
|
25
|
+
if (hasMorePages) {
|
|
26
|
+
currentOffset += limit;
|
|
27
|
+
updateDataSource();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function goToFirst() {
|
|
32
|
+
currentOffset = 0;
|
|
33
|
+
updateDataSource();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function updateDataSource() {
|
|
37
|
+
if (dataSource) {
|
|
38
|
+
$dataSource = {
|
|
39
|
+
...$dataSource,
|
|
40
|
+
queryParams: {
|
|
41
|
+
...$dataSource.queryParams,
|
|
42
|
+
offset: currentOffset,
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const hasParams = (ds) => {
|
|
49
|
+
if (!ds || !ds.parameters) return false;
|
|
50
|
+
const paramNames = ds.parameters.map((p) => p.name.toLowerCase());
|
|
51
|
+
return paramNames.includes("offset") && paramNames.includes("limit");
|
|
52
|
+
};
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
{#if valid}
|
|
56
|
+
<div class="pagination-limit-offset">
|
|
57
|
+
<div class="pagination-controls">
|
|
58
|
+
<button
|
|
59
|
+
class="pagination-btn"
|
|
60
|
+
style:margin-right="-0.25rem"
|
|
61
|
+
on:click={goToFirst}
|
|
62
|
+
disabled={currentPage <= 1}
|
|
63
|
+
title="First Page"
|
|
64
|
+
>
|
|
65
|
+
<i class="ph ph-caret-double-left"></i>
|
|
66
|
+
</button>
|
|
67
|
+
|
|
68
|
+
<button
|
|
69
|
+
class="pagination-btn"
|
|
70
|
+
on:click={goToPrevious}
|
|
71
|
+
disabled={currentPage <= 1}
|
|
72
|
+
title="Previous Page"
|
|
73
|
+
>
|
|
74
|
+
<i class="ph ph-caret-left"></i>
|
|
75
|
+
</button>
|
|
76
|
+
|
|
77
|
+
<span class="pagination-info">
|
|
78
|
+
Page {currentPage}
|
|
79
|
+
( {currentOffset} - {currentOffset + ($fetch?.rows?.length || 0)} )
|
|
80
|
+
</span>
|
|
81
|
+
|
|
82
|
+
<button
|
|
83
|
+
class="pagination-btn"
|
|
84
|
+
on:click={goToNext}
|
|
85
|
+
disabled={!hasMorePages}
|
|
86
|
+
title="Next Page"
|
|
87
|
+
>
|
|
88
|
+
<i class="ph ph-caret-right"></i>
|
|
89
|
+
</button>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
{/if}
|
|
93
|
+
|
|
94
|
+
<style>
|
|
95
|
+
.pagination-limit-offset {
|
|
96
|
+
display: flex;
|
|
97
|
+
justify-content: flex-end;
|
|
98
|
+
padding: 0.25rem 0rem;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.pagination-controls {
|
|
102
|
+
display: flex;
|
|
103
|
+
align-items: center;
|
|
104
|
+
gap: 0.5rem;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.pagination-btn {
|
|
108
|
+
aspect-ratio: 1 / 1;
|
|
109
|
+
border-radius: 0.25rem;
|
|
110
|
+
color: var(--spectrum-global-color-gray-700);
|
|
111
|
+
background-color: transparent;
|
|
112
|
+
cursor: pointer;
|
|
113
|
+
transition: all 0.2s ease;
|
|
114
|
+
outline: none;
|
|
115
|
+
border: none;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.pagination-btn:hover:not(:disabled) {
|
|
119
|
+
background: var(--spectrum-global-color-gray-200);
|
|
120
|
+
border-color: var(--spectrum-global-color-gray-400);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.pagination-btn:disabled {
|
|
124
|
+
opacity: 0.5;
|
|
125
|
+
cursor: not-allowed;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.pagination-info {
|
|
129
|
+
color: var(--spectrum-global-color-gray-700);
|
|
130
|
+
white-space: nowrap;
|
|
131
|
+
opacity: 0.9;
|
|
132
|
+
}
|
|
133
|
+
</style>
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
const stbData = getContext("stbData");
|
|
9
9
|
const stbHorizontalScrollPos = getContext("stbHorizontalScrollPos");
|
|
10
10
|
const stbHovered = getContext("stbHovered");
|
|
11
|
-
const stbSelected = getContext("stbSelected");
|
|
12
11
|
const stbEditing = getContext("stbEditing");
|
|
13
12
|
const stbMenuID = getContext("stbMenuID");
|
|
14
13
|
const rowMetadata = getContext("stbRowMetadata");
|
|
@@ -16,8 +15,6 @@
|
|
|
16
15
|
|
|
17
16
|
const stbAPI = getContext("stbAPI");
|
|
18
17
|
|
|
19
|
-
const { processStringSync } = getContext("sdk");
|
|
20
|
-
|
|
21
18
|
export let right;
|
|
22
19
|
export let rowMenu;
|
|
23
20
|
export let rowMenuItems;
|
|
@@ -29,7 +26,6 @@
|
|
|
29
26
|
|
|
30
27
|
$: quiet = $stbSettings.appearance.quiet;
|
|
31
28
|
$: menuIcon = $stbSettings.rowMenuIcon;
|
|
32
|
-
$: idColumn = $stbSettings.data.idColumn;
|
|
33
29
|
$: sticky = $stbHorizontalScrollPos > 0 && !right;
|
|
34
30
|
$: inInsert = $stbState == "Inserting";
|
|
35
31
|
|
|
@@ -65,12 +61,11 @@
|
|
|
65
61
|
class:zebra={$stbSettings.appearance.zebraColors}
|
|
66
62
|
>
|
|
67
63
|
{#each $stbVisibleRows as visibleRow}
|
|
68
|
-
{@const row = $stbData?.rows?.[visibleRow]}
|
|
69
64
|
<div
|
|
70
65
|
class="super-row"
|
|
71
66
|
on:mouseenter={() => ($stbHovered = visibleRow)}
|
|
72
67
|
on:mouseleave={() => ($stbHovered = null)}
|
|
73
|
-
class:is-selected={$
|
|
68
|
+
class:is-selected={$rowMetadata[visibleRow].selected}
|
|
74
69
|
class:is-hovered={$stbHovered == visibleRow || $stbMenuID == visibleRow}
|
|
75
70
|
class:is-editing={$stbEditing == visibleRow}
|
|
76
71
|
class:is-disabled={$rowMetadata[visibleRow].disabled}
|
|
@@ -83,17 +78,17 @@
|
|
|
83
78
|
style:gap={inlineButtons.length > 1 ? "0.5rem" : "0rem"}
|
|
84
79
|
>
|
|
85
80
|
{#if rowMenu && inlineButtons?.length}
|
|
86
|
-
{#each inlineButtons as {
|
|
87
|
-
{#if stbAPI.shouldShowButton(conditions || [], stbAPI.enrichContext(
|
|
81
|
+
{#each inlineButtons as { conditions, disabledTemplate, onClick, disabled, ...rest }}
|
|
82
|
+
{#if stbAPI.shouldShowButton(conditions || [], stbAPI.enrichContext($stbData?.rows?.[visibleRow]))}
|
|
88
83
|
<SuperButton
|
|
89
|
-
|
|
90
|
-
{icon}
|
|
91
|
-
{text}
|
|
84
|
+
{...rest}
|
|
92
85
|
disabled={disabled ||
|
|
93
86
|
$stbEditing == visibleRow ||
|
|
94
|
-
$rowMetadata[visibleRow].disabled
|
|
95
|
-
|
|
96
|
-
|
|
87
|
+
$rowMetadata[visibleRow].disabled ||
|
|
88
|
+
stbAPI.shouldDisableButton(
|
|
89
|
+
disabledTemplate,
|
|
90
|
+
stbAPI.enrichContext($stbData?.rows?.[visibleRow])
|
|
91
|
+
)}
|
|
97
92
|
onClick={() => {
|
|
98
93
|
stbAPI.executeRowButtonAction(visibleRow, onClick);
|
|
99
94
|
}}
|
|
@@ -105,7 +100,6 @@
|
|
|
105
100
|
<SuperButton
|
|
106
101
|
size="S"
|
|
107
102
|
icon={menuIcon}
|
|
108
|
-
fillOnHover="true"
|
|
109
103
|
text=""
|
|
110
104
|
quiet="true"
|
|
111
105
|
type="secondary"
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { getContext } from "svelte";
|
|
3
3
|
|
|
4
|
+
import Checkbox from "../../UI/elements/Checkbox.svelte";
|
|
5
|
+
import IconButton from "../..//UI/elements/IconButton.svelte";
|
|
6
|
+
|
|
4
7
|
const stbState = getContext("stbState");
|
|
5
8
|
const stbSettings = getContext("stbSettings");
|
|
6
9
|
const stbHorizontalScrollPos = getContext("stbHorizontalScrollPos");
|
|
@@ -15,7 +18,6 @@
|
|
|
15
18
|
export let hideSelectionColumn;
|
|
16
19
|
export let stbData;
|
|
17
20
|
|
|
18
|
-
$: idColumn = $stbSettings.data.idColumn;
|
|
19
21
|
$: partialSelection =
|
|
20
22
|
$stbSelected.length && $stbSelected.length != $stbData?.rows?.length;
|
|
21
23
|
|
|
@@ -25,12 +27,14 @@
|
|
|
25
27
|
$: numbering = $stbSettings.appearance.numberingColumn;
|
|
26
28
|
$: checkBoxes = $stbSettings.features.canSelect && !hideSelectionColumn;
|
|
27
29
|
$: canDelete = $stbSettings.features.canDelete;
|
|
28
|
-
|
|
29
30
|
$: sticky = $stbHorizontalScrollPos > 0;
|
|
30
|
-
|
|
31
31
|
$: visible = numbering || checkBoxes || canDelete;
|
|
32
32
|
$: zebra = $stbSettings.appearance.zebraColors;
|
|
33
33
|
$: quiet = $stbSettings.appearance.quiet;
|
|
34
|
+
$: headerCheckbox =
|
|
35
|
+
checkBoxes &&
|
|
36
|
+
$stbSettings.features.maxSelected != 1 &&
|
|
37
|
+
$stbVisibleRows.length > 0;
|
|
34
38
|
</script>
|
|
35
39
|
|
|
36
40
|
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
@@ -43,26 +47,23 @@
|
|
|
43
47
|
<span class="row-number"></span>
|
|
44
48
|
{/if}
|
|
45
49
|
|
|
46
|
-
{#if
|
|
47
|
-
<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
>
|
|
53
|
-
<i class="ri-check-line" style:visibility={"hidden"} />
|
|
54
|
-
</div>
|
|
50
|
+
{#if headerCheckbox}
|
|
51
|
+
<Checkbox
|
|
52
|
+
checked={fullSelection}
|
|
53
|
+
partial={partialSelection}
|
|
54
|
+
on:change={stbAPI.selectAllRows}
|
|
55
|
+
/>
|
|
55
56
|
{/if}
|
|
56
57
|
|
|
57
|
-
{#if canDelete}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
58
|
+
{#if canDelete && $stbSelected.length > 1}
|
|
59
|
+
<IconButton
|
|
60
|
+
icon="trash"
|
|
61
|
+
size="small"
|
|
62
|
+
variant="warning"
|
|
63
|
+
disabled={$stbSelected.length == 0}
|
|
64
|
+
tooltip="Delete Selected Rows"
|
|
65
|
+
on:click={stbAPI.deleteSelectedRows}
|
|
66
|
+
/>
|
|
66
67
|
{/if}
|
|
67
68
|
</div>
|
|
68
69
|
{/if}
|
|
@@ -74,45 +75,44 @@
|
|
|
74
75
|
class:sticky
|
|
75
76
|
style:margin-top={"var(--super-column-top-offset)"}
|
|
76
77
|
>
|
|
77
|
-
{#each $stbVisibleRows as visibleRow}
|
|
78
|
-
{@const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
</div>
|
|
95
|
-
{/if}
|
|
78
|
+
{#each $stbVisibleRows as visibleRow (visibleRow)}
|
|
79
|
+
{@const selected = $stbRowMetadata[visibleRow]?.selected}
|
|
80
|
+
<div
|
|
81
|
+
class="super-row selection"
|
|
82
|
+
class:is-selected={selected}
|
|
83
|
+
class:is-hovered={$stbHovered == visibleRow ||
|
|
84
|
+
$stbMenuID == visibleRow}
|
|
85
|
+
class:is-disabled={$stbRowMetadata[visibleRow]?.disabled}
|
|
86
|
+
style:min-height={$stbRowMetadata[visibleRow]?.height}
|
|
87
|
+
on:mouseenter={() => ($stbHovered = visibleRow)}
|
|
88
|
+
on:mouseleave={() => ($stbHovered = null)}
|
|
89
|
+
>
|
|
90
|
+
{#if numbering}
|
|
91
|
+
<div class="row-number">
|
|
92
|
+
{visibleRow + 1}
|
|
93
|
+
</div>
|
|
94
|
+
{/if}
|
|
96
95
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
{/if}
|
|
96
|
+
{#if $stbSettings.features.canSelect && !hideSelectionColumn}
|
|
97
|
+
<Checkbox
|
|
98
|
+
checked={selected}
|
|
99
|
+
disabled={$stbRowMetadata[visibleRow]?.disabled}
|
|
100
|
+
hovered={$stbHovered == visibleRow}
|
|
101
|
+
on:change={() => stbAPI.selectRow(visibleRow)}
|
|
102
|
+
/>
|
|
103
|
+
{/if}
|
|
106
104
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
105
|
+
{#if canDelete}
|
|
106
|
+
<IconButton
|
|
107
|
+
icon="trash"
|
|
108
|
+
size="small"
|
|
109
|
+
variant="warning"
|
|
110
|
+
disabled={$stbRowMetadata[visibleRow]?.disabled}
|
|
111
|
+
tooltip="Delete Row"
|
|
112
|
+
on:click={() => stbAPI.deleteRow(visibleRow)}
|
|
113
|
+
/>
|
|
114
|
+
{/if}
|
|
115
|
+
</div>
|
|
116
116
|
{/each}
|
|
117
117
|
|
|
118
118
|
{#if $stbState == "Inserting"}
|
|
@@ -135,65 +135,5 @@
|
|
|
135
135
|
font-size: 13px;
|
|
136
136
|
font-weight: 500;
|
|
137
137
|
align-items: center;
|
|
138
|
-
&.is-hovered > .delete {
|
|
139
|
-
color: var(--spectrum-global-color-red-700) !important;
|
|
140
|
-
}
|
|
141
|
-
&.is-selected > .delete {
|
|
142
|
-
color: var(--spectrum-global-color-red-400);
|
|
143
|
-
}
|
|
144
|
-
&.is-hovered > i:not(.delete) {
|
|
145
|
-
color: var(--spectrum-global-color-gray-700);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
i {
|
|
150
|
-
font-size: 14px;
|
|
151
|
-
color: var(--spectrum-global-color-gray-500);
|
|
152
|
-
|
|
153
|
-
&.disabled {
|
|
154
|
-
color: var(--spectrum-global-color-gray-100);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
&.delete {
|
|
158
|
-
&.selected {
|
|
159
|
-
color: var(--spectrum-global-color-red-400);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
&:hover {
|
|
163
|
-
color: var(--spectrum-global-color-red-700);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
&.full {
|
|
168
|
-
color: var(--spectrum-global-color-gray-900);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
&:hover:not(.disabled) {
|
|
172
|
-
cursor: pointer;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
.checkbox {
|
|
177
|
-
width: 14px;
|
|
178
|
-
height: 14px;
|
|
179
|
-
border: 1px solid var(--spectrum-global-color-gray-500);
|
|
180
|
-
background-color: var(--spectrum-global-color-gray-50);
|
|
181
|
-
border-radius: 2px;
|
|
182
|
-
display: flex;
|
|
183
|
-
align-items: center;
|
|
184
|
-
justify-content: center;
|
|
185
|
-
cursor: pointer;
|
|
186
|
-
|
|
187
|
-
&.selected {
|
|
188
|
-
border: 1px solid var(--spectrum-global-color-gray-600);
|
|
189
|
-
& > i {
|
|
190
|
-
visibility: visible !important;
|
|
191
|
-
color: var(--spectrum-global-color-gray-700);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
&.partialSelection {
|
|
196
|
-
border-color: var(--spectrum-global-color-green-700);
|
|
197
|
-
}
|
|
198
138
|
}
|
|
199
139
|
</style>
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
on:click={tableAPI.insertRow}
|
|
32
32
|
>
|
|
33
33
|
{#if $stbState == "Saving"}
|
|
34
|
-
<i class="ri-loader-2-line"
|
|
34
|
+
<i class="ri-loader-2-line"></i>
|
|
35
35
|
{:else}
|
|
36
|
-
<i class="ri-save-fill"
|
|
36
|
+
<i class="ri-save-fill"></i>
|
|
37
37
|
{/if}
|
|
38
38
|
</div>
|
|
39
39
|
{/if}
|
|
@@ -47,6 +47,6 @@
|
|
|
47
47
|
class:footer
|
|
48
48
|
on:click={stbState.clear()}
|
|
49
49
|
>
|
|
50
|
-
<i class="ri-filter-off-line"
|
|
50
|
+
<i class="ri-filter-off-line"></i>
|
|
51
51
|
</div>
|
|
52
52
|
{/if}
|
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
let mouseoffset = 0;
|
|
29
29
|
let width;
|
|
30
30
|
let left;
|
|
31
|
-
let localWidth;
|
|
32
31
|
|
|
33
32
|
// Positioning Offsets
|
|
34
33
|
$: verticalTopOffset = $stbSettings.appearance.headerHeight + 8 + "px";
|
|
@@ -91,50 +90,47 @@
|
|
|
91
90
|
: () => {}}
|
|
92
91
|
/>
|
|
93
92
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
102
|
-
<div
|
|
103
|
-
class="stb-scrollbar-indicator"
|
|
104
|
-
class:dragging
|
|
105
|
-
style:top
|
|
106
|
-
style:height
|
|
107
|
-
on:mousedown|self={(e) => {
|
|
108
|
-
dragging = true;
|
|
109
|
-
startPos = e.clientY;
|
|
110
|
-
startScrollPos = $stbScrollPos;
|
|
111
|
-
}}
|
|
112
|
-
/>
|
|
113
|
-
</div>
|
|
114
|
-
{/if}
|
|
115
|
-
|
|
116
|
-
{#if horizontalRange}
|
|
93
|
+
<div
|
|
94
|
+
class="stb-scrollbar"
|
|
95
|
+
class:hidden={!verticalRange}
|
|
96
|
+
class:highlighted={highlighted || dragging}
|
|
97
|
+
style:--offset={verticalTopOffset}
|
|
98
|
+
style:--bottomOffset={verticalBottomOffset}
|
|
99
|
+
>
|
|
117
100
|
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
118
101
|
<div
|
|
119
|
-
|
|
120
|
-
class
|
|
121
|
-
|
|
122
|
-
style
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
{
|
|
102
|
+
class="stb-scrollbar-indicator"
|
|
103
|
+
class:dragging
|
|
104
|
+
style:top
|
|
105
|
+
style:height
|
|
106
|
+
on:mousedown|stopPropagation|preventDefault={(e) => {
|
|
107
|
+
dragging = true;
|
|
108
|
+
startPos = e.clientY;
|
|
109
|
+
startScrollPos = $stbScrollPos;
|
|
110
|
+
}}
|
|
111
|
+
></div>
|
|
112
|
+
</div>
|
|
113
|
+
|
|
114
|
+
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
115
|
+
<div
|
|
116
|
+
class="stb-scrollbar horizontal"
|
|
117
|
+
class:hidden={!horizontalRange}
|
|
118
|
+
class:highlighted={highlighted || horizontalDragging}
|
|
119
|
+
style:--horizontalOffset={horizontalOffset}
|
|
120
|
+
style:--horizontalBottomOffset={horizontalBotttomOffset}
|
|
121
|
+
>
|
|
122
|
+
<div
|
|
123
|
+
class="stb-scrollbar-indicator horizontal"
|
|
124
|
+
style:left
|
|
125
|
+
style:width
|
|
126
|
+
class:dragging={horizontalDragging}
|
|
127
|
+
on:mousedown|stopPropagation|preventDefault={(e) => {
|
|
128
|
+
horizontalDragging = true;
|
|
129
|
+
horizontalStartPos = e.clientX;
|
|
130
|
+
startScrollPos = $stbHorizontalScrollPos;
|
|
131
|
+
}}
|
|
132
|
+
></div>
|
|
133
|
+
</div>
|
|
138
134
|
|
|
139
135
|
<style>
|
|
140
136
|
.stb-scrollbar {
|
|
@@ -150,6 +146,10 @@
|
|
|
150
146
|
overflow: hidden;
|
|
151
147
|
}
|
|
152
148
|
|
|
149
|
+
.stb-scrollbar.hidden {
|
|
150
|
+
display: none;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
153
|
.stb-scrollbar.horizontal {
|
|
154
154
|
top: unset;
|
|
155
155
|
bottom: var(--horizontalBottomOffset);
|
|
@@ -40,17 +40,6 @@
|
|
|
40
40
|
if (!cellOptions.readonly) return "Editing";
|
|
41
41
|
},
|
|
42
42
|
},
|
|
43
|
-
Hovered: {
|
|
44
|
-
cancel: () => {
|
|
45
|
-
return "View";
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
Focused: {
|
|
49
|
-
unfocus() {
|
|
50
|
-
return "View";
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
Error: { check: "View" },
|
|
54
43
|
Editing: {
|
|
55
44
|
_enter() {
|
|
56
45
|
originalValue = value;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
export let fieldSchema: any;
|
|
10
10
|
export let tableid: string;
|
|
11
11
|
export let API;
|
|
12
|
-
export
|
|
12
|
+
export const height = "auto";
|
|
13
13
|
export let inBuilder;
|
|
14
14
|
|
|
15
15
|
const dispatch = createEventDispatcher();
|
|
@@ -57,17 +57,6 @@
|
|
|
57
57
|
if (!cellOptions.readonly) return "Editing";
|
|
58
58
|
},
|
|
59
59
|
},
|
|
60
|
-
Hovered: {
|
|
61
|
-
cancel: () => {
|
|
62
|
-
return "View";
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
Focused: {
|
|
66
|
-
unfocus() {
|
|
67
|
-
return "View";
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
Error: { check: "View" },
|
|
71
60
|
Editing: {
|
|
72
61
|
_enter() {
|
|
73
62
|
originalValue = value;
|