@poirazis/supercomponents-shared 0.0.1
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/LICENSE +21 -0
- package/README.md +66 -0
- package/dist/index.js +30635 -0
- package/dist/index.umd.cjs +12 -0
- package/dist/style.css +1 -0
- package/package.json +117 -0
- package/src/index.js +29 -0
- package/src/index.ts +31 -0
- package/src/lib/Actions/autoresize_textarea.js +14 -0
- package/src/lib/Actions/click_outside.js +80 -0
- package/src/lib/Actions/index.js +4 -0
- package/src/lib/Actions/position_dropdown.js +129 -0
- package/src/lib/SuperButton/SuperButton.svelte +341 -0
- package/src/lib/SuperFieldLabel/SuperFieldLabel.svelte +91 -0
- package/src/lib/SuperFieldsCommon.css +54 -0
- package/src/lib/SuperList/SuperList.svelte +308 -0
- package/src/lib/SuperList/drag-handle.svelte +31 -0
- package/src/lib/SuperPopover/SuperPopover.svelte +134 -0
- package/src/lib/SuperTable/SuperTable.css +410 -0
- package/src/lib/SuperTable/SuperTable.svelte +1332 -0
- package/src/lib/SuperTable/constants.js +85 -0
- package/src/lib/SuperTable/controls/ColumnsSection.svelte +34 -0
- package/src/lib/SuperTable/controls/ControlSection.svelte +3 -0
- package/src/lib/SuperTable/controls/RowButtonsColumn.svelte +169 -0
- package/src/lib/SuperTable/controls/SelectionColumn.svelte +174 -0
- package/src/lib/SuperTable/controls/SuperTableWelcome.svelte +58 -0
- package/src/lib/SuperTable/overlays/AddNewRowOverlay.svelte +52 -0
- package/src/lib/SuperTable/overlays/EmptyResultSetOverlay.svelte +13 -0
- package/src/lib/SuperTable/overlays/LoadingOverlay.svelte +3 -0
- package/src/lib/SuperTable/overlays/RowContextMenu copy.svelte +57 -0
- package/src/lib/SuperTable/overlays/RowContextMenu.svelte +58 -0
- package/src/lib/SuperTable/overlays/ScrollbarsOverlay.svelte +184 -0
- package/src/lib/SuperTable/overlays/SelectedActionsOverlay.svelte +64 -0
- package/src/lib/SuperTable/state/API.js +0 -0
- package/src/lib/SuperTable/state/SuperTableStateMachine.js +0 -0
- package/src/lib/SuperTable/types.js +0 -0
- package/src/lib/SuperTableCells/CellAttachment.svelte +288 -0
- package/src/lib/SuperTableCells/CellBoolean.svelte +158 -0
- package/src/lib/SuperTableCells/CellColor.svelte +460 -0
- package/src/lib/SuperTableCells/CellCommon.css +319 -0
- package/src/lib/SuperTableCells/CellDatetime.svelte +180 -0
- package/src/lib/SuperTableCells/CellIcon.svelte +627 -0
- package/src/lib/SuperTableCells/CellJSON.svelte +297 -0
- package/src/lib/SuperTableCells/CellLink.svelte +274 -0
- package/src/lib/SuperTableCells/CellLinkAdvanced.svelte +298 -0
- package/src/lib/SuperTableCells/CellLinkPickerSelect.svelte +355 -0
- package/src/lib/SuperTableCells/CellLinkPickerTable.svelte +91 -0
- package/src/lib/SuperTableCells/CellLinkPickerTree.svelte +226 -0
- package/src/lib/SuperTableCells/CellNumber.svelte +179 -0
- package/src/lib/SuperTableCells/CellNumberSimple.svelte +56 -0
- package/src/lib/SuperTableCells/CellOptions.svelte +631 -0
- package/src/lib/SuperTableCells/CellOptionsAdvanced.svelte +684 -0
- package/src/lib/SuperTableCells/CellSkeleton.svelte +59 -0
- package/src/lib/SuperTableCells/CellString.svelte +178 -0
- package/src/lib/SuperTableCells/CellStringSimple.svelte +55 -0
- package/src/lib/SuperTableCells/index.js +21 -0
- package/src/lib/SuperTableCells/remixIcons.js +6772 -0
- package/src/lib/SuperTableColumn/SuperTableColumn.svelte +392 -0
- package/src/lib/SuperTableColumn/index.js +9 -0
- package/src/lib/SuperTableColumn/parts/SuperColumnBody.svelte +57 -0
- package/src/lib/SuperTableColumn/parts/SuperColumnFooter.svelte +14 -0
- package/src/lib/SuperTableColumn/parts/SuperColumnHeader.svelte +228 -0
- package/src/lib/SuperTableColumn/parts/SuperColumnRow.svelte +142 -0
- package/src/lib/SuperTableColumn/parts/SuperColumnRowNew.svelte +34 -0
- package/src/lib/SuperTree/SuperTree.svelte +117 -0
- package/src/types/svelte-portal.d.ts +1 -0
@@ -0,0 +1,85 @@
|
|
1
|
+
// Sizing temaplates for the Adobe Spectrum Table look
|
2
|
+
export const sizingMap = {
|
3
|
+
S: {
|
4
|
+
cellPadding: "0.4rem",
|
5
|
+
rowFontSize: 12,
|
6
|
+
rowHeight: 32,
|
7
|
+
headerFontSize: 10,
|
8
|
+
headerHeight: 32,
|
9
|
+
checkboxSize: 12,
|
10
|
+
},
|
11
|
+
M: {
|
12
|
+
cellPadding: "0.5rem",
|
13
|
+
rowFontSize: 13,
|
14
|
+
rowHeight: 36,
|
15
|
+
headerFontSize: 11,
|
16
|
+
headerHeight: 38,
|
17
|
+
checkboxSize: 14,
|
18
|
+
},
|
19
|
+
L: {
|
20
|
+
cellPadding: "0.85rem",
|
21
|
+
rowFontSize: 15,
|
22
|
+
rowHeight: 42,
|
23
|
+
headerFontSize: 12,
|
24
|
+
headerHeight: 48,
|
25
|
+
checkboxSize: 14,
|
26
|
+
},
|
27
|
+
};
|
28
|
+
|
29
|
+
export const defaultOperatorMap = {
|
30
|
+
string: "fuzzy",
|
31
|
+
longform: "fuzzy",
|
32
|
+
formula: "fuzzy",
|
33
|
+
array: "contains",
|
34
|
+
options: "equal",
|
35
|
+
datetime: "rangeLow",
|
36
|
+
boolean: "equal",
|
37
|
+
number: "equal",
|
38
|
+
bigint: "equal",
|
39
|
+
link: "fuzzy",
|
40
|
+
bb_reference_single: "equal",
|
41
|
+
bb_reference: "equal",
|
42
|
+
};
|
43
|
+
|
44
|
+
export const supportFilteringMap = {
|
45
|
+
string: true,
|
46
|
+
longform: true,
|
47
|
+
array: true,
|
48
|
+
options: true,
|
49
|
+
datetime: true,
|
50
|
+
boolean: true,
|
51
|
+
number: true,
|
52
|
+
bigint: true,
|
53
|
+
link: true,
|
54
|
+
bb_reference_single: false,
|
55
|
+
bb_reference: false,
|
56
|
+
};
|
57
|
+
|
58
|
+
export const supportSortingMap = {
|
59
|
+
string: true,
|
60
|
+
longform: true,
|
61
|
+
formula: true,
|
62
|
+
array: true,
|
63
|
+
options: true,
|
64
|
+
datetime: true,
|
65
|
+
boolean: true,
|
66
|
+
number: true,
|
67
|
+
bigint: true,
|
68
|
+
};
|
69
|
+
|
70
|
+
export const supportEditingMap = {
|
71
|
+
string: true,
|
72
|
+
longform: true,
|
73
|
+
array: true,
|
74
|
+
link: true,
|
75
|
+
json: true,
|
76
|
+
bb_reference: true,
|
77
|
+
bb_reference_single: true,
|
78
|
+
options: true,
|
79
|
+
datetime: true,
|
80
|
+
boolean: true,
|
81
|
+
number: true,
|
82
|
+
bigint: true,
|
83
|
+
attachment: true,
|
84
|
+
attachment_single: true,
|
85
|
+
};
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<script>
|
2
|
+
import SuperTableColumn from "../../SuperTableColumn/SuperTableColumn.svelte";
|
3
|
+
export let superColumns;
|
4
|
+
export let commonColumnOptions;
|
5
|
+
export let stbSettings;
|
6
|
+
|
7
|
+
export let columnsViewport;
|
8
|
+
export let showActionColumn;
|
9
|
+
export let canScroll;
|
10
|
+
let overflow;
|
11
|
+
</script>
|
12
|
+
|
13
|
+
<div bind:this={columnsViewport} class="st-master-columns" tabIndex="-1">
|
14
|
+
{#if $stbSettings.superColumnsPos == "first"}
|
15
|
+
<slot />
|
16
|
+
{/if}
|
17
|
+
|
18
|
+
{#each $superColumns as column, idx (idx)}
|
19
|
+
<SuperTableColumn
|
20
|
+
columnOptions={{
|
21
|
+
...column,
|
22
|
+
...$commonColumnOptions,
|
23
|
+
overflow,
|
24
|
+
isFirst: idx == 0,
|
25
|
+
isLast:
|
26
|
+
idx == $superColumns.length - 1 && !showActionColumn && canScroll,
|
27
|
+
}}
|
28
|
+
/>
|
29
|
+
{/each}
|
30
|
+
|
31
|
+
{#if $stbSettings.superColumnsPos == "last"}
|
32
|
+
<slot />
|
33
|
+
{/if}
|
34
|
+
</div>
|
@@ -0,0 +1,169 @@
|
|
1
|
+
<script>
|
2
|
+
import { getContext } from "svelte";
|
3
|
+
import SuperPopover from "../../SuperPopover/SuperPopover.svelte";
|
4
|
+
import SuperButton from "../../SuperButton/SuperButton.svelte";
|
5
|
+
|
6
|
+
const stbSettings = getContext("stbSettings");
|
7
|
+
const stbState = getContext("stbState");
|
8
|
+
const stbData = getContext("stbData");
|
9
|
+
const stbHorizontalScrollPos = getContext("stbHorizontalScrollPos");
|
10
|
+
const stbHovered = getContext("stbHovered");
|
11
|
+
const stbSelected = getContext("stbSelected");
|
12
|
+
const stbEditing = getContext("stbEditing");
|
13
|
+
const stbMenuID = getContext("stbMenuID");
|
14
|
+
const rowMetadata = getContext("stbRowMetadata");
|
15
|
+
const stbVisibleRows = getContext("stbVisibleRows");
|
16
|
+
|
17
|
+
const stbAPI = getContext("stbAPI");
|
18
|
+
|
19
|
+
export let right;
|
20
|
+
export let rowMenu;
|
21
|
+
export let rowMenuItems;
|
22
|
+
export let menuItemsVisible = 0;
|
23
|
+
export let canScroll;
|
24
|
+
|
25
|
+
let menuAnchor;
|
26
|
+
let openMenu;
|
27
|
+
|
28
|
+
$: quiet = $stbSettings.appearance.quiet;
|
29
|
+
$: menuIcon = $stbSettings.rowMenuIcon;
|
30
|
+
$: idColumn = $stbSettings.data.idColumn;
|
31
|
+
$: sticky = $stbHorizontalScrollPos > 0 && !right;
|
32
|
+
$: inInsert = $stbState == "Inserting";
|
33
|
+
|
34
|
+
$: inlineButtons =
|
35
|
+
menuItemsVisible < rowMenuItems?.length
|
36
|
+
? rowMenuItems.slice(0, menuItemsVisible)
|
37
|
+
: rowMenuItems;
|
38
|
+
|
39
|
+
$: menuItems =
|
40
|
+
menuItemsVisible < rowMenuItems?.length
|
41
|
+
? rowMenuItems.slice(menuItemsVisible, rowMenuItems.length)
|
42
|
+
: [];
|
43
|
+
|
44
|
+
const handleMenu = (e, index) => {
|
45
|
+
menuAnchor = e.detail;
|
46
|
+
openMenu = !openMenu;
|
47
|
+
$stbMenuID = openMenu ? index : -1;
|
48
|
+
};
|
49
|
+
</script>
|
50
|
+
|
51
|
+
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
52
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
53
|
+
<div class="super-column" class:right class:sticky>
|
54
|
+
{#if $stbSettings.showHeader}
|
55
|
+
<div class="super-column-header"><span> </span></div>
|
56
|
+
{/if}
|
57
|
+
|
58
|
+
<div
|
59
|
+
class="super-column-body"
|
60
|
+
style:margin-top={"var(--super-column-top-offset)"}
|
61
|
+
class:quiet
|
62
|
+
class:sticky
|
63
|
+
class:zebra={$stbSettings.appearance.zebraColors}
|
64
|
+
>
|
65
|
+
{#each $stbVisibleRows as index}
|
66
|
+
<div
|
67
|
+
class="super-row"
|
68
|
+
on:mouseenter={() => ($stbHovered = index)}
|
69
|
+
on:mouseleave={() => ($stbHovered = null)}
|
70
|
+
class:is-selected={$stbSelected?.includes(
|
71
|
+
$stbData.rows[index][idColumn]
|
72
|
+
)}
|
73
|
+
class:is-hovered={$stbHovered == index || $stbMenuID == index}
|
74
|
+
class:is-editing={$stbEditing == index}
|
75
|
+
style:min-height={$rowMetadata[index].height}
|
76
|
+
style:padding-right={canScroll && right ? "1.5rem" : "0.5rem"}
|
77
|
+
>
|
78
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
79
|
+
<div
|
80
|
+
class="row-buttons"
|
81
|
+
style:gap={inlineButtons.length > 1 ? "0.5rem" : "0rem"}
|
82
|
+
>
|
83
|
+
{#if rowMenu && inlineButtons?.length}
|
84
|
+
{#each inlineButtons as { text, icon, disabled, onClick, quiet, type }}
|
85
|
+
<SuperButton
|
86
|
+
size="S"
|
87
|
+
{icon}
|
88
|
+
{text}
|
89
|
+
disabled={disabled || $stbEditing == index}
|
90
|
+
{quiet}
|
91
|
+
type={type == "primary" ? "ink" : type}
|
92
|
+
on:click={() => stbAPI.executeRowButtonAction(index, onClick)}
|
93
|
+
/>
|
94
|
+
{/each}
|
95
|
+
{/if}
|
96
|
+
{#if rowMenu && menuItems?.length}
|
97
|
+
<SuperButton
|
98
|
+
size="S"
|
99
|
+
icon={menuIcon}
|
100
|
+
fillOnHover="true"
|
101
|
+
text=""
|
102
|
+
quiet="true"
|
103
|
+
type="secondary"
|
104
|
+
on:click={(e) => handleMenu(e, index)}
|
105
|
+
/>
|
106
|
+
{/if}
|
107
|
+
</div>
|
108
|
+
</div>
|
109
|
+
{/each}
|
110
|
+
</div>
|
111
|
+
{#if inInsert}
|
112
|
+
<div class="add-row" style="padding: unset;"></div>
|
113
|
+
{/if}
|
114
|
+
|
115
|
+
{#if $stbSettings.showFooter}
|
116
|
+
<div class="super-column-footer"></div>
|
117
|
+
{/if}
|
118
|
+
</div>
|
119
|
+
|
120
|
+
{#if openMenu}
|
121
|
+
<SuperPopover
|
122
|
+
open
|
123
|
+
anchor={menuAnchor}
|
124
|
+
minWidth={150}
|
125
|
+
align={right ? "right" : "left"}
|
126
|
+
on:close={() => {
|
127
|
+
openMenu = false;
|
128
|
+
$stbMenuID = undefined;
|
129
|
+
}}
|
130
|
+
>
|
131
|
+
{#if menuItems?.length}
|
132
|
+
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
133
|
+
<div class="action-menu">
|
134
|
+
{#each menuItems as { text, icon, disabled, onClick, size }}
|
135
|
+
<SuperButton
|
136
|
+
{size}
|
137
|
+
{icon}
|
138
|
+
{text}
|
139
|
+
{disabled}
|
140
|
+
menuItem
|
141
|
+
menuAlign={right ? "right" : "left"}
|
142
|
+
on:click={() => {
|
143
|
+
stbAPI.executeRowButtonAction($stbMenuID, onClick);
|
144
|
+
openMenu = false;
|
145
|
+
$stbMenuID = undefined;
|
146
|
+
}}
|
147
|
+
/>
|
148
|
+
{/each}
|
149
|
+
</div>
|
150
|
+
{/if}
|
151
|
+
</SuperPopover>
|
152
|
+
{/if}
|
153
|
+
|
154
|
+
<style>
|
155
|
+
.row-buttons {
|
156
|
+
display: flex;
|
157
|
+
flex-direction: row;
|
158
|
+
align-items: center;
|
159
|
+
padding-left: 0.5rem;
|
160
|
+
}
|
161
|
+
|
162
|
+
.action-menu {
|
163
|
+
min-width: 160px;
|
164
|
+
display: flex;
|
165
|
+
flex-direction: column;
|
166
|
+
align-items: stretch;
|
167
|
+
padding: 0.25rem;
|
168
|
+
}
|
169
|
+
</style>
|
@@ -0,0 +1,174 @@
|
|
1
|
+
<script>
|
2
|
+
import { getContext } from "svelte";
|
3
|
+
|
4
|
+
const stbState = getContext("stbState");
|
5
|
+
const stbSettings = getContext("stbSettings");
|
6
|
+
const stbData = getContext("stbData");
|
7
|
+
const stbHorizontalScrollPos = getContext("stbHorizontalScrollPos");
|
8
|
+
const stbHovered = getContext("stbHovered");
|
9
|
+
const stbMenuID = getContext("stbMenuID");
|
10
|
+
const stbSelected = getContext("stbSelected");
|
11
|
+
const stbEditing = getContext("stbEditing");
|
12
|
+
const stbAPI = getContext("stbAPI");
|
13
|
+
const rowMetadata = getContext("stbRowMetadata");
|
14
|
+
const stbVisibleRows = getContext("stbVisibleRows");
|
15
|
+
|
16
|
+
export let sticky;
|
17
|
+
export let hideSelectionColumn;
|
18
|
+
|
19
|
+
$: idColumn = $stbSettings.data.idColumn;
|
20
|
+
$: partialSelection = $stbSelected.length;
|
21
|
+
$: fullSelection =
|
22
|
+
$stbSelected.length == $stbData.rows?.length && $stbData.rows?.length > 0;
|
23
|
+
|
24
|
+
$: numbering = $stbSettings.appearance.numberingColumn;
|
25
|
+
$: checkBoxes = $stbSettings.features.canSelect && !hideSelectionColumn;
|
26
|
+
$: canDelete = $stbSettings.features.canDelete;
|
27
|
+
$: sticky = $stbHorizontalScrollPos > 0;
|
28
|
+
|
29
|
+
$: visible = numbering || checkBoxes || canDelete;
|
30
|
+
$: zebra = $stbSettings.appearance.zebraColors;
|
31
|
+
$: quiet = $stbSettings.appearance.quiet;
|
32
|
+
</script>
|
33
|
+
|
34
|
+
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
35
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
36
|
+
{#if visible}
|
37
|
+
<div class="super-column control-column" class:sticky>
|
38
|
+
{#if $stbSettings?.showHeader}
|
39
|
+
<div class="control-column-header">
|
40
|
+
{#if numbering}
|
41
|
+
<div class="row-number"></div>
|
42
|
+
{/if}
|
43
|
+
|
44
|
+
{#if canDelete}
|
45
|
+
{#if $stbSelected.length > 1}
|
46
|
+
<i
|
47
|
+
class="ri-delete-bin-line"
|
48
|
+
on:click={stbAPI.deleteSelectedRows}
|
49
|
+
/>
|
50
|
+
{:else}
|
51
|
+
<div class="row-number"></div>
|
52
|
+
{/if}
|
53
|
+
{/if}
|
54
|
+
|
55
|
+
{#if $stbSettings.features.canSelect && $stbSettings.features.maxSelected != 1 && !hideSelectionColumn}
|
56
|
+
{#if fullSelection}
|
57
|
+
<i class="ri-check-line" on:click={stbAPI.selectAllRows} />
|
58
|
+
{:else if partialSelection}
|
59
|
+
<i
|
60
|
+
class="ri-checkbox-indeterminate-line"
|
61
|
+
on:click={stbAPI.selectAllRows}
|
62
|
+
></i>
|
63
|
+
{:else}
|
64
|
+
<i
|
65
|
+
class="ri-checkbox-blank-line"
|
66
|
+
style:color={"var(--spectrum-global-color-gray-500)"}
|
67
|
+
on:click={stbAPI.selectAllRows}
|
68
|
+
/>
|
69
|
+
{/if}
|
70
|
+
{/if}
|
71
|
+
</div>
|
72
|
+
{/if}
|
73
|
+
|
74
|
+
<div
|
75
|
+
class="super-column-body"
|
76
|
+
class:zebra
|
77
|
+
class:quiet
|
78
|
+
class:sticky
|
79
|
+
style:margin-top={"var(--super-column-top-offset)"}
|
80
|
+
>
|
81
|
+
{#each $stbVisibleRows as visibleRow}
|
82
|
+
{@const row = $stbData?.rows?.[visibleRow]}
|
83
|
+
{#if row}
|
84
|
+
<div
|
85
|
+
class="super-row selection"
|
86
|
+
class:is-selected={$stbSelected?.includes(
|
87
|
+
row[idColumn] ?? visibleRow
|
88
|
+
)}
|
89
|
+
class:is-hovered={$stbHovered == visibleRow ||
|
90
|
+
$stbMenuID == visibleRow}
|
91
|
+
class:is-editing={$stbEditing == row[idColumn]}
|
92
|
+
style:min-height={$rowMetadata[visibleRow]?.height}
|
93
|
+
on:mouseenter={() => ($stbHovered = visibleRow)}
|
94
|
+
on:mouseleave={() => ($stbHovered = null)}
|
95
|
+
>
|
96
|
+
{#if numbering}
|
97
|
+
<span class="row-number">
|
98
|
+
{#if $stbEditing == row[idColumn]}
|
99
|
+
<i
|
100
|
+
class="ri-edit-line"
|
101
|
+
style:font-size={"14px"}
|
102
|
+
style:color={"lime"}
|
103
|
+
/>
|
104
|
+
{:else}
|
105
|
+
{visibleRow + 1}
|
106
|
+
{/if}
|
107
|
+
</span>
|
108
|
+
{/if}
|
109
|
+
|
110
|
+
{#if canDelete}
|
111
|
+
<i
|
112
|
+
class="ri-delete-bin-line delete"
|
113
|
+
on:click={(e) => stbAPI.deleteRow(visibleRow)}
|
114
|
+
/>
|
115
|
+
{/if}
|
116
|
+
|
117
|
+
{#if $stbSettings.features.canSelect && !hideSelectionColumn}
|
118
|
+
{#if $stbSelected?.includes(row[idColumn] ?? visibleRow)}
|
119
|
+
<i
|
120
|
+
class="ri-check-line"
|
121
|
+
style:color={"var(--spectrum-global-color-gray-800)"}
|
122
|
+
on:click={() => stbAPI.selectRow(visibleRow)}
|
123
|
+
/>
|
124
|
+
{:else}
|
125
|
+
<i
|
126
|
+
class="ri-checkbox-blank-line"
|
127
|
+
on:click={() => stbAPI.selectRow(visibleRow)}
|
128
|
+
/>
|
129
|
+
{/if}
|
130
|
+
{/if}
|
131
|
+
</div>
|
132
|
+
{/if}
|
133
|
+
{/each}
|
134
|
+
|
135
|
+
{#if $stbState == "Inserting"}
|
136
|
+
<div class="add-row" style="padding: unset;"></div>
|
137
|
+
{/if}
|
138
|
+
</div>
|
139
|
+
|
140
|
+
{#if $stbSettings.showFooter}
|
141
|
+
<div class="super-column-footer" style:padding={"unset"}></div>
|
142
|
+
{/if}
|
143
|
+
</div>
|
144
|
+
{/if}
|
145
|
+
|
146
|
+
<style>
|
147
|
+
.selection {
|
148
|
+
flex: auto;
|
149
|
+
padding-left: 0.75rem;
|
150
|
+
padding-right: 0.75rem;
|
151
|
+
gap: 1rem;
|
152
|
+
font-size: 14px;
|
153
|
+
font-weight: 500;
|
154
|
+
align-items: center;
|
155
|
+
&.is-hovered > .delete {
|
156
|
+
color: var(--spectrum-global-color-red-700);
|
157
|
+
}
|
158
|
+
&.is-selected > .delete {
|
159
|
+
color: var(--spectrum-global-color-red-700);
|
160
|
+
}
|
161
|
+
&.is-hovered > i {
|
162
|
+
color: var(--spectrum-global-color-gray-700);
|
163
|
+
}
|
164
|
+
}
|
165
|
+
|
166
|
+
i {
|
167
|
+
font-size: 16px;
|
168
|
+
color: var(--spectrum-global-color-gray-500);
|
169
|
+
|
170
|
+
&:hover {
|
171
|
+
cursor: pointer;
|
172
|
+
}
|
173
|
+
}
|
174
|
+
</style>
|
@@ -0,0 +1,58 @@
|
|
1
|
+
<script>
|
2
|
+
function autoSetup() {}
|
3
|
+
</script>
|
4
|
+
|
5
|
+
<div class="welcome">
|
6
|
+
<div class="welcome-icon">
|
7
|
+
<svg
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
9
|
+
width="64"
|
10
|
+
height="64"
|
11
|
+
viewBox="0 0 18 18"
|
12
|
+
>
|
13
|
+
<defs>
|
14
|
+
<style>
|
15
|
+
.fill {
|
16
|
+
fill: #1da1f2;
|
17
|
+
}
|
18
|
+
</style>
|
19
|
+
</defs>
|
20
|
+
<title>S Table 18 N</title>
|
21
|
+
<rect
|
22
|
+
id="Canvas"
|
23
|
+
fill="#ff13dc"
|
24
|
+
opacity="0"
|
25
|
+
width="18"
|
26
|
+
height="18"
|
27
|
+
/><path
|
28
|
+
class="fill"
|
29
|
+
d="M16.5,1H1.5a.5.5,0,0,0-.5.5v15a.5.5,0,0,0,.5.5h15a.5.5,0,0,0,.5-.5V1.5A.5.5,0,0,0,16.5,1ZM6,16H2V14H6Zm0-3H2V11H6Zm0-3H2V8H6Zm10,6H7V14h9Zm0-3H7V11h9Zm0-3H7V8h9Zm0-3H2V2H16Z"
|
30
|
+
/>
|
31
|
+
</svg>
|
32
|
+
</div>
|
33
|
+
|
34
|
+
<div class="welcome-text">
|
35
|
+
<h2>Welcome to the Super Table Component</h2>
|
36
|
+
<p>You need to connect your Super Table to a Data Provider</p>
|
37
|
+
<p>and select the <strong>Unique ID Column</strong></p>
|
38
|
+
<p>Then add some Super Columns to start designing you table</p>
|
39
|
+
</div>
|
40
|
+
</div>
|
41
|
+
|
42
|
+
<style>
|
43
|
+
h2 {
|
44
|
+
padding-top: none;
|
45
|
+
margin-top: unset;
|
46
|
+
}
|
47
|
+
.welcome {
|
48
|
+
display: flex;
|
49
|
+
flex-direction: row;
|
50
|
+
justify-content: flex-start;
|
51
|
+
align-content: middle;
|
52
|
+
gap: 20px;
|
53
|
+
}
|
54
|
+
|
55
|
+
.welcome-text,
|
56
|
+
.welcome-icon {
|
57
|
+
}
|
58
|
+
</style>
|
@@ -0,0 +1,52 @@
|
|
1
|
+
<script>
|
2
|
+
export let stbState;
|
3
|
+
export let tableAPI;
|
4
|
+
export let highlighted;
|
5
|
+
export let footer;
|
6
|
+
export let tableActions;
|
7
|
+
|
8
|
+
$: inInsert = $stbState == "Inserting";
|
9
|
+
</script>
|
10
|
+
|
11
|
+
{#if $stbState == "Idle" || inInsert || tableActions?.length}
|
12
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
13
|
+
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
14
|
+
<div
|
15
|
+
class="overlay-button add-row-overlay"
|
16
|
+
class:highlighted
|
17
|
+
class:footer
|
18
|
+
class:in-insert={inInsert}
|
19
|
+
on:click={() => (inInsert ? stbState.cancelAddRow() : stbState.addRow())}
|
20
|
+
>
|
21
|
+
<span> + </span>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
25
|
+
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
26
|
+
<div
|
27
|
+
class="overlay-button save-row-overlay"
|
28
|
+
class:highlighted
|
29
|
+
class:footer
|
30
|
+
class:in-insert={inInsert}
|
31
|
+
on:click={tableAPI.insertRow}
|
32
|
+
>
|
33
|
+
{#if $stbState == "Saving"}
|
34
|
+
<i class="ri-loader-2-line" />
|
35
|
+
{:else}
|
36
|
+
<i class="ri-save-fill"> </i>
|
37
|
+
{/if}
|
38
|
+
</div>
|
39
|
+
{/if}
|
40
|
+
|
41
|
+
{#if $stbState == "Filtered"}
|
42
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
43
|
+
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
44
|
+
<div
|
45
|
+
class="overlay-button filter-row-overlay"
|
46
|
+
class:highlighted
|
47
|
+
class:footer
|
48
|
+
on:click={stbState.clear()}
|
49
|
+
>
|
50
|
+
<i class="ri-filter-off-line" />
|
51
|
+
</div>
|
52
|
+
{/if}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<script>
|
2
|
+
export let top;
|
3
|
+
export let bottom;
|
4
|
+
export let isEmpty;
|
5
|
+
export let message = "No Records Found";
|
6
|
+
</script>
|
7
|
+
|
8
|
+
{#if isEmpty}
|
9
|
+
<div class="emptyTable" style:top style:bottom>
|
10
|
+
<i class="ri-search-line" />
|
11
|
+
{message}
|
12
|
+
</div>
|
13
|
+
{/if}
|
@@ -0,0 +1,57 @@
|
|
1
|
+
<script>
|
2
|
+
import { getContext } from "svelte";
|
3
|
+
import SuperPopover from "../../SuperPopover/SuperPopover.svelte";
|
4
|
+
import SuperButton from "../../SuperButton/SuperButton.svelte";
|
5
|
+
|
6
|
+
const stbAPI = getContext("stbAPI");
|
7
|
+
const stbMenuID = getContext("stbMenuID");
|
8
|
+
const stbMenuAnchor = getContext("stbMenuAnchor");
|
9
|
+
|
10
|
+
export let rowContextMenuItems;
|
11
|
+
export let right = true;
|
12
|
+
|
13
|
+
$: isOpen = $stbMenuAnchor != -1;
|
14
|
+
</script>
|
15
|
+
|
16
|
+
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
17
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
18
|
+
|
19
|
+
{#if isOpen && rowContextMenuItems.length}
|
20
|
+
<SuperPopover
|
21
|
+
open
|
22
|
+
anchor={$stbMenuAnchor}
|
23
|
+
align={right ? "right" : "left"}
|
24
|
+
on:close={() => ($stbMenuAnchor = -1)}
|
25
|
+
>
|
26
|
+
<div class="action-menu">
|
27
|
+
{#each rowContextMenuItems as { text, icon, disabled, onClick, size, type }}
|
28
|
+
<SuperButton
|
29
|
+
{size}
|
30
|
+
{type}
|
31
|
+
{icon}
|
32
|
+
fillOnHover="true"
|
33
|
+
{text}
|
34
|
+
disabled={disabled || !onClick}
|
35
|
+
quiet={true}
|
36
|
+
menuItem
|
37
|
+
menuAlign={right ? "right" : "left"}
|
38
|
+
on:click={() => {
|
39
|
+
stbAPI.executeRowContextMenuAction($stbMenuID, onClick);
|
40
|
+
$stbMenuID = -1;
|
41
|
+
$stbMenuAnchor = -1;
|
42
|
+
}}
|
43
|
+
/>
|
44
|
+
{/each}
|
45
|
+
</div>
|
46
|
+
</SuperPopover>
|
47
|
+
{/if}
|
48
|
+
|
49
|
+
<style>
|
50
|
+
.action-menu {
|
51
|
+
min-width: 120px;
|
52
|
+
display: flex;
|
53
|
+
flex-direction: column;
|
54
|
+
align-items: stretch;
|
55
|
+
border: 1px solid var(--spectrum-global-color-gray-100);
|
56
|
+
}
|
57
|
+
</style>
|