@poirazis/supercomponents-shared 1.2.15 → 1.2.18
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 +17704 -22252
- package/dist/index.umd.cjs +19 -18
- package/package.json +11 -11
- package/src/lib/SuperButton/SuperButton.svelte +65 -35
- package/src/lib/SuperField/SuperField.svelte +8 -11
- package/src/lib/SuperForm/InnerForm.svelte +14 -8
- package/src/lib/SuperForm/SuperForm.svelte +5 -5
- package/src/lib/SuperPopover/SuperPopover.svelte +1 -1
- package/src/lib/SuperTable/SuperTable.css +13 -6
- package/src/lib/SuperTable/SuperTable.svelte +28 -19
- package/src/lib/SuperTable/constants.js +1 -1
- package/src/lib/SuperTable/controls/RowButtonsColumn.svelte +33 -17
- package/src/lib/SuperTable/controls/SelectionColumn.svelte +2 -2
- package/src/lib/SuperTableCells/CellBoolean.svelte +52 -45
- package/src/lib/SuperTableCells/CellCommon.css +97 -35
- package/src/lib/SuperTableCells/CellDatetime.svelte +267 -120
- package/src/lib/SuperTableCells/CellLink.svelte +22 -13
- package/src/lib/SuperTableCells/CellLinkPickerSelect.svelte +28 -24
- package/src/lib/SuperTableCells/CellLinkPickerTree.svelte +22 -20
- package/src/lib/SuperTableCells/CellNumber.svelte +55 -53
- package/src/lib/SuperTableCells/CellOptions.svelte +356 -246
- package/src/lib/SuperTableCells/CellOptionsAdvanced.svelte +199 -180
- package/src/lib/SuperTableCells/CellSQLLink.svelte +32 -32
- package/src/lib/SuperTableCells/CellSQLLinkPicker.svelte +2 -7
- package/src/lib/SuperTableCells/CellSkeleton.svelte +1 -1
- package/src/lib/SuperTableCells/CellString.svelte +62 -80
- package/src/lib/SuperTableCells/CellStringMask.svelte +41 -40
- package/src/lib/SuperTableCells/CellStringSimple.svelte +1 -4
- package/src/lib/SuperTableColumn/SuperTableColumn.svelte +3 -1
- package/src/lib/SuperTableColumn/parts/SuperColumnBody.svelte +3 -0
- package/src/lib/SuperTableColumn/parts/SuperColumnHeader.svelte +44 -42
- package/src/lib/SuperTableColumn/parts/SuperColumnRow.svelte +2 -4
- package/src/lib/SuperTabs/SuperTabs.svelte +33 -17
- package/src/lib/UI/elements/Checkbox.svelte +68 -10
- package/src/lib/UI/elements/Switch.svelte +162 -0
- package/src/lib/UI/elements/Tooltip.svelte +15 -43
- package/src/lib/SuperTableCells/JSDOC_GUIDE.md +0 -869
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@poirazis/supercomponents-shared",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.18",
|
|
4
4
|
"description": "Shared Svelte components library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "bun@1.0.0",
|
|
@@ -40,23 +40,23 @@
|
|
|
40
40
|
"@phosphor-icons/web": "^2.1.2",
|
|
41
41
|
"@sveltejs/svelte-virtual-list": "^3.0.1",
|
|
42
42
|
"date-picker-svelte": "^2.17.0",
|
|
43
|
-
"imask": "^
|
|
43
|
+
"imask": "^7.6.1",
|
|
44
44
|
"shortid": "^2.2.17",
|
|
45
45
|
"svelte-carousel": "^1.0.25",
|
|
46
46
|
"svelte-dnd-action": "^0.9.69",
|
|
47
47
|
"svelte-fsm": "^1.2.0",
|
|
48
|
-
"zod": "4.3
|
|
48
|
+
"zod": "4.4.3"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@budibase/types": "^3.
|
|
51
|
+
"@budibase/types": "^3.38.4",
|
|
52
52
|
"@sveltejs/package": "^2.5.7",
|
|
53
|
-
"@sveltejs/vite-plugin-svelte": "^
|
|
53
|
+
"@sveltejs/vite-plugin-svelte": "^7.1.2",
|
|
54
54
|
"@tsconfig/svelte": "^5.0.8",
|
|
55
|
-
"postcss": "^8.5.
|
|
56
|
-
"sass": "^1.
|
|
57
|
-
"svelte": "^5.
|
|
58
|
-
"typescript": "^
|
|
59
|
-
"vite": "^
|
|
60
|
-
"vite-plugin-css-injected-by-js": "^
|
|
55
|
+
"postcss": "^8.5.14",
|
|
56
|
+
"sass": "^1.99.0",
|
|
57
|
+
"svelte": "^5.55.7",
|
|
58
|
+
"typescript": "^6.0.3",
|
|
59
|
+
"vite": "^8.0.13",
|
|
60
|
+
"vite-plugin-css-injected-by-js": "^5.0.1"
|
|
61
61
|
}
|
|
62
62
|
}
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import { onDestroy, onMount } from "svelte";
|
|
2
|
+
import { onDestroy, onMount, getContext } from "svelte";
|
|
3
3
|
import Tooltip from "../UI/elements/Tooltip.svelte";
|
|
4
4
|
|
|
5
|
+
const { enrichButtonActions } = getContext("sdk");
|
|
6
|
+
const context = getContext("context");
|
|
7
|
+
|
|
5
8
|
export let size = "M";
|
|
6
9
|
export let menuItem = false;
|
|
7
10
|
export let menuAlign = "right";
|
|
8
11
|
export let icon = undefined;
|
|
9
12
|
export let iconAfterText = undefined;
|
|
10
13
|
export let iconColor = undefined;
|
|
14
|
+
export let filledIcon = undefined;
|
|
11
15
|
export let text = "";
|
|
12
16
|
export let quiet = undefined;
|
|
13
17
|
export let selected = undefined;
|
|
14
18
|
export let disabled = undefined;
|
|
15
|
-
export let onClick
|
|
19
|
+
export let onClick;
|
|
16
20
|
export let buttonClass = "actionButton";
|
|
17
21
|
export let type = "primary";
|
|
18
22
|
export let tooltip;
|
|
@@ -38,13 +42,16 @@
|
|
|
38
42
|
export let onFalseCondition = undefined;
|
|
39
43
|
|
|
40
44
|
$: loop = safeParse(loopSource);
|
|
45
|
+
$: buttonText = text || (actionsMode == "timer" ? timerDuration : "");
|
|
41
46
|
$: icon_class = working
|
|
42
47
|
? "ph ph-spinner-gap ph-spin"
|
|
43
48
|
: icon && !icon.startsWith("ri-")
|
|
44
49
|
? "ph ph-" + icon
|
|
45
50
|
: icon
|
|
46
51
|
? icon
|
|
47
|
-
:
|
|
52
|
+
: actionsMode == "timer"
|
|
53
|
+
? "ph ph-timer"
|
|
54
|
+
: undefined;
|
|
48
55
|
|
|
49
56
|
let working = false;
|
|
50
57
|
let ui_timer = undefined;
|
|
@@ -55,24 +62,31 @@
|
|
|
55
62
|
let tooltipTimer;
|
|
56
63
|
|
|
57
64
|
const showTooltip = () => {
|
|
58
|
-
if (disabled) return;
|
|
65
|
+
if (disabled || tooltipShow || !tooltip) return;
|
|
59
66
|
if (tooltipTimer) clearTimeout(tooltipTimer);
|
|
60
67
|
tooltipTimer = setTimeout(() => {
|
|
61
68
|
tooltipShow = true;
|
|
62
|
-
},
|
|
69
|
+
}, 500);
|
|
63
70
|
};
|
|
64
71
|
|
|
65
|
-
const hideTooltip = () => {
|
|
72
|
+
const hideTooltip = (e) => {
|
|
66
73
|
if (tooltipTimer) {
|
|
67
74
|
clearTimeout(tooltipTimer);
|
|
68
|
-
tooltipTimer = null;
|
|
69
75
|
}
|
|
70
76
|
tooltipShow = false;
|
|
71
77
|
};
|
|
72
78
|
|
|
73
79
|
async function handleClick(e) {
|
|
80
|
+
let enrichedAction;
|
|
81
|
+
if (Array.isArray(onClick)) {
|
|
82
|
+
enrichedAction = enrichButtonActions(onClick, $context);
|
|
83
|
+
} else {
|
|
84
|
+
enrichedAction = onClick;
|
|
85
|
+
}
|
|
86
|
+
|
|
74
87
|
if (disabled || working || actionsMode == "timer") return;
|
|
75
88
|
working = true;
|
|
89
|
+
tooltipShow = false;
|
|
76
90
|
if (actionsMode == "loop") {
|
|
77
91
|
if (onLoopStart) await onLoopStart({ iterations: loopSource?.length });
|
|
78
92
|
if (Array.isArray(loop) && loopEvent) {
|
|
@@ -85,8 +99,8 @@
|
|
|
85
99
|
} else if (actionsMode == "conditional") {
|
|
86
100
|
if (condition == true) await onTrueCondition?.();
|
|
87
101
|
else await onFalseCondition?.();
|
|
88
|
-
} else if (
|
|
89
|
-
await
|
|
102
|
+
} else if (enrichedAction) {
|
|
103
|
+
await enrichedAction?.(e);
|
|
90
104
|
}
|
|
91
105
|
working = false;
|
|
92
106
|
}
|
|
@@ -161,11 +175,12 @@
|
|
|
161
175
|
>
|
|
162
176
|
<i
|
|
163
177
|
class={icon_class}
|
|
178
|
+
class:ph-fill={filledIcon}
|
|
164
179
|
style:order={iconAfterText ? 1 : 0}
|
|
165
180
|
style:color={disabled ? "var(--spectrum-global-color-gray-400)" : iconColor}
|
|
166
181
|
></i>
|
|
167
182
|
|
|
168
|
-
<span>{
|
|
183
|
+
<span>{buttonText}</span>
|
|
169
184
|
</button>
|
|
170
185
|
|
|
171
186
|
{#if tooltip}
|
|
@@ -175,40 +190,54 @@
|
|
|
175
190
|
<style>
|
|
176
191
|
.super-button {
|
|
177
192
|
border: 1px solid var(--spectrum-global-color-gray-400);
|
|
178
|
-
background-color: var(--spectrum-global-color-gray-
|
|
193
|
+
background-color: var(--spectrum-global-color-gray-50);
|
|
179
194
|
color: var(--spectrum-global-color-gray-800);
|
|
180
195
|
display: flex;
|
|
181
196
|
align-items: center;
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
gap: 0.
|
|
197
|
+
justify-content: center;
|
|
198
|
+
padding: 0rem 1rem;
|
|
199
|
+
min-width: 4rem;
|
|
200
|
+
gap: 0.75rem;
|
|
186
201
|
height: 2rem;
|
|
187
202
|
|
|
203
|
+
&.spectrum-ActionButton {
|
|
204
|
+
padding: 0rem 0.75rem !important;
|
|
205
|
+
border-radius: 4px !important;
|
|
206
|
+
}
|
|
207
|
+
&.spectrum-ActionButton.xsmall {
|
|
208
|
+
padding: 0rem 0.5rem !important;
|
|
209
|
+
border-radius: 4px !important;
|
|
210
|
+
}
|
|
188
211
|
&.xsmall {
|
|
189
212
|
height: 1.5rem;
|
|
190
|
-
|
|
191
|
-
padding: 0rem 0.5rem;
|
|
213
|
+
padding: 0rem 0.75rem;
|
|
192
214
|
min-width: unset;
|
|
215
|
+
gap: 0.5rem;
|
|
216
|
+
font-size: 12px;
|
|
217
|
+
border-radius: 1rem;
|
|
193
218
|
}
|
|
194
219
|
|
|
195
220
|
&.small {
|
|
196
221
|
min-width: 4rem;
|
|
197
|
-
padding: 0rem 0.
|
|
222
|
+
padding: 0rem 0.75rem;
|
|
198
223
|
gap: 0.5rem;
|
|
199
|
-
height: 1.
|
|
200
|
-
|
|
201
|
-
&.ink {
|
|
202
|
-
height: 1.5rem;
|
|
203
|
-
}
|
|
224
|
+
height: 1.75rem;
|
|
225
|
+
font-size: 13px;
|
|
204
226
|
}
|
|
205
227
|
|
|
206
228
|
&.large {
|
|
207
229
|
height: 2.25rem;
|
|
230
|
+
font-size: 16px;
|
|
231
|
+
padding: 0rem 1.25rem;
|
|
232
|
+
|
|
233
|
+
& > i {
|
|
234
|
+
font-size: 18px;
|
|
235
|
+
}
|
|
208
236
|
}
|
|
209
237
|
|
|
210
238
|
& > span {
|
|
211
239
|
white-space: nowrap;
|
|
240
|
+
font-weight: 600;
|
|
212
241
|
}
|
|
213
242
|
|
|
214
243
|
&.icon {
|
|
@@ -229,6 +258,8 @@
|
|
|
229
258
|
& > i {
|
|
230
259
|
display: none;
|
|
231
260
|
opacity: 0.9;
|
|
261
|
+
font-weight: 400;
|
|
262
|
+
font-size: 15px;
|
|
232
263
|
}
|
|
233
264
|
}
|
|
234
265
|
|
|
@@ -255,6 +286,7 @@
|
|
|
255
286
|
i {
|
|
256
287
|
color: var(--iconColor);
|
|
257
288
|
transition: all 230ms ease-in-out;
|
|
289
|
+
font-size: 16px;
|
|
258
290
|
}
|
|
259
291
|
|
|
260
292
|
.cta {
|
|
@@ -286,12 +318,9 @@
|
|
|
286
318
|
}
|
|
287
319
|
}
|
|
288
320
|
.ink {
|
|
289
|
-
background-color: var(--spectrum-global-color-gray-
|
|
290
|
-
border: 1px solid
|
|
321
|
+
background-color: var(--spectrum-global-color-gray-800);
|
|
322
|
+
border: 1px solid transparent;
|
|
291
323
|
color: var(--spectrum-global-color-gray-50);
|
|
292
|
-
font-weight: 700;
|
|
293
|
-
opacity: 0.9;
|
|
294
|
-
max-height: 1.35rem;
|
|
295
324
|
|
|
296
325
|
&.quiet {
|
|
297
326
|
border-color: transparent !important;
|
|
@@ -300,12 +329,12 @@
|
|
|
300
329
|
&:hover,
|
|
301
330
|
&:focus {
|
|
302
331
|
color: var(--spectrum-global-color-gray-50);
|
|
303
|
-
background-color: var(--spectrum-global-color-gray-
|
|
332
|
+
background-color: var(--spectrum-global-color-gray-900);
|
|
304
333
|
}
|
|
305
334
|
}
|
|
306
335
|
&:hover,
|
|
307
336
|
&:focus {
|
|
308
|
-
background-color: var(--spectrum-global-color-gray-
|
|
337
|
+
background-color: var(--spectrum-global-color-gray-900);
|
|
309
338
|
}
|
|
310
339
|
|
|
311
340
|
&:active {
|
|
@@ -316,18 +345,19 @@
|
|
|
316
345
|
&:hover,
|
|
317
346
|
&:focus {
|
|
318
347
|
border: 1px solid var(--spectrum-global-color-gray-500);
|
|
348
|
+
background-color: var(--spectrum-global-color-gray-200);
|
|
319
349
|
color: var(--spectrum-global-color-gray-900);
|
|
320
350
|
}
|
|
321
351
|
&:active {
|
|
322
352
|
background-color: var(--spectrum-global-color-gray-100);
|
|
323
|
-
border: 1px solid var(--spectrum-global-color-gray-
|
|
353
|
+
border: 1px solid var(--spectrum-global-color-gray-500);
|
|
324
354
|
}
|
|
325
355
|
|
|
326
356
|
&.quiet {
|
|
327
357
|
border-color: transparent;
|
|
328
358
|
background-color: transparent;
|
|
329
359
|
&:hover {
|
|
330
|
-
background-color: var(--spectrum-global-color-gray-
|
|
360
|
+
background-color: var(--spectrum-global-color-gray-400);
|
|
331
361
|
color: var(--spectrum-global-color-gray-900);
|
|
332
362
|
}
|
|
333
363
|
}
|
|
@@ -340,12 +370,10 @@
|
|
|
340
370
|
font-weight: 500;
|
|
341
371
|
|
|
342
372
|
&.quiet {
|
|
343
|
-
border-color: transparent;
|
|
344
373
|
background-color: transparent;
|
|
345
374
|
|
|
346
375
|
&:hover {
|
|
347
|
-
background-color:
|
|
348
|
-
border-color: var(--spectrum-global-color-gray-400);
|
|
376
|
+
background-color: var(--spectrum-global-color-gray-300);
|
|
349
377
|
}
|
|
350
378
|
}
|
|
351
379
|
|
|
@@ -370,6 +398,8 @@
|
|
|
370
398
|
|
|
371
399
|
&:hover {
|
|
372
400
|
border-color: var(--spectrum-global-color-red-400);
|
|
401
|
+
background-color: var(--spectrum-global-color-red-400);
|
|
402
|
+
color: white;
|
|
373
403
|
font-weight: bolder;
|
|
374
404
|
}
|
|
375
405
|
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
showTooltip = false;
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
$: width = labelPos == "left" ? (labelWidth ? labelWidth : "
|
|
55
|
+
$: width = labelPos == "left" ? (labelWidth ? labelWidth : "6rem") : "auto";
|
|
56
56
|
$: isLabelTruncated = checkIfTruncated(labelElement);
|
|
57
57
|
</script>
|
|
58
58
|
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
min-height: var(--field-height, 2rem);
|
|
117
117
|
|
|
118
118
|
&.multirow {
|
|
119
|
-
max-height: var(--height);
|
|
119
|
+
max-height: var(--field-height);
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
&.left-label {
|
|
@@ -133,39 +133,35 @@
|
|
|
133
133
|
flex-direction: row;
|
|
134
134
|
align-items: stretch;
|
|
135
135
|
}
|
|
136
|
-
|
|
137
|
-
&:focus-within {
|
|
138
|
-
& > .superlabel {
|
|
139
|
-
color: var(--spectrum-global-golor-gray-700);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
136
|
}
|
|
143
137
|
|
|
144
138
|
.inline-cells {
|
|
139
|
+
flex: 1;
|
|
145
140
|
display: flex;
|
|
146
141
|
align-items: stretch;
|
|
147
142
|
min-height: 2rem;
|
|
148
143
|
overflow: hidden;
|
|
149
144
|
|
|
150
145
|
&.multirow {
|
|
146
|
+
flex: 1;
|
|
151
147
|
flex-direction: column;
|
|
152
148
|
align-items: stretch;
|
|
153
|
-
justify-content: flex;
|
|
154
149
|
}
|
|
155
150
|
}
|
|
156
151
|
|
|
157
152
|
.superlabel {
|
|
158
|
-
flex: 0 0 auto;
|
|
159
153
|
width: var(--label-width);
|
|
160
154
|
overflow: hidden;
|
|
161
155
|
display: flex;
|
|
162
156
|
align-items: center;
|
|
163
157
|
justify-content: space-between;
|
|
164
|
-
font-weight: 400;
|
|
165
158
|
line-height: 1.65rem;
|
|
166
159
|
color: var(--spectrum-global-color-gray-700);
|
|
160
|
+
font-family: "inter", sans-serif;
|
|
167
161
|
gap: 1rem;
|
|
168
162
|
transition: 130ms;
|
|
163
|
+
padding-left: 2px;
|
|
164
|
+
opacity: 0.9;
|
|
169
165
|
|
|
170
166
|
&.left {
|
|
171
167
|
flex-direction: column;
|
|
@@ -173,6 +169,7 @@
|
|
|
173
169
|
justify-content: center;
|
|
174
170
|
line-height: 1rem;
|
|
175
171
|
gap: 0px;
|
|
172
|
+
padding-left: unset;
|
|
176
173
|
|
|
177
174
|
&.tall {
|
|
178
175
|
justify-content: flex-start;
|
|
@@ -52,6 +52,8 @@
|
|
|
52
52
|
export let formValue: Record<string, any> = {};
|
|
53
53
|
export let labelPosition: string | boolean = "above";
|
|
54
54
|
export let columns: number = 1;
|
|
55
|
+
export let rowGap: string = "0.5rem";
|
|
56
|
+
export let columnGap: string = "0.5rem";
|
|
55
57
|
|
|
56
58
|
const {
|
|
57
59
|
Provider,
|
|
@@ -116,6 +118,11 @@
|
|
|
116
118
|
__editing: !readonly && !disabled,
|
|
117
119
|
};
|
|
118
120
|
|
|
121
|
+
$: scope =
|
|
122
|
+
provideContextScope === "local"
|
|
123
|
+
? ContextScopes.Local
|
|
124
|
+
: ContextScopes.Global;
|
|
125
|
+
|
|
119
126
|
const deriveFieldProperty = (
|
|
120
127
|
fieldStores: Readable<FieldInfo>[],
|
|
121
128
|
getProp: (_field: FieldInfo) => any,
|
|
@@ -582,19 +589,15 @@
|
|
|
582
589
|
|
|
583
590
|
{#key labelPosition}
|
|
584
591
|
{#if provideContext}
|
|
585
|
-
<Provider
|
|
586
|
-
{actions}
|
|
587
|
-
data={dataContext}
|
|
588
|
-
scope={provideContextScope === "local"
|
|
589
|
-
? ContextScopes.Local
|
|
590
|
-
: ContextScopes.Global}
|
|
591
|
-
>
|
|
592
|
+
<Provider {actions} data={dataContext} {scope}>
|
|
592
593
|
<div
|
|
593
594
|
class="super-form-inner-form"
|
|
594
595
|
class:labels-left={labelPosition === "left"}
|
|
595
596
|
class:no-labels={labelPosition === false || labelPosition === "none"}
|
|
596
597
|
class:field-group={columns > 1}
|
|
597
598
|
style:grid-template-columns={`repeat(${columns * 6}, 1fr)`}
|
|
599
|
+
style:row-gap={rowGap}
|
|
600
|
+
style:column-gap={columnGap}
|
|
598
601
|
>
|
|
599
602
|
<slot />
|
|
600
603
|
</div>
|
|
@@ -614,6 +617,8 @@
|
|
|
614
617
|
flex: auto;
|
|
615
618
|
display: grid;
|
|
616
619
|
column-gap: 0.5rem;
|
|
620
|
+
row-gap: 0.5rem;
|
|
621
|
+
align-content: flex-start;
|
|
617
622
|
}
|
|
618
623
|
|
|
619
624
|
:global(.super-form-inner-form.field-group > .component > *) {
|
|
@@ -621,7 +626,8 @@
|
|
|
621
626
|
}
|
|
622
627
|
|
|
623
628
|
.super-form-inner-form.labels-left {
|
|
624
|
-
row-gap: 0.
|
|
629
|
+
row-gap: 0.5rem;
|
|
630
|
+
column-gap: 1rem;
|
|
625
631
|
}
|
|
626
632
|
.super-form-inner-form.no-labels {
|
|
627
633
|
row-gap: 0.25rem;
|
|
@@ -30,6 +30,8 @@
|
|
|
30
30
|
export let provideContext: boolean = true;
|
|
31
31
|
export let provideContextScope: "local" | "global" = "global";
|
|
32
32
|
export let labelPosition: "above" | "left" | false;
|
|
33
|
+
export let rowGap: string = "0.5rem";
|
|
34
|
+
export let columnGap: string = "0.5rem";
|
|
33
35
|
|
|
34
36
|
// Export the full form API to be used by parents
|
|
35
37
|
export let form;
|
|
@@ -67,11 +69,7 @@
|
|
|
67
69
|
row,
|
|
68
70
|
);
|
|
69
71
|
$: resetKey = hashString(
|
|
70
|
-
schemaKey +
|
|
71
|
-
JSON.stringify(initialValues) +
|
|
72
|
-
actionType +
|
|
73
|
-
readonly +
|
|
74
|
-
disabled,
|
|
72
|
+
schemaKey + JSON.stringify(initialValues) + actionType,
|
|
75
73
|
);
|
|
76
74
|
|
|
77
75
|
const getInitialValues = (
|
|
@@ -152,6 +150,8 @@
|
|
|
152
150
|
{provideContext}
|
|
153
151
|
{provideContextScope}
|
|
154
152
|
{labelPosition}
|
|
153
|
+
{rowGap}
|
|
154
|
+
{columnGap}
|
|
155
155
|
on:change
|
|
156
156
|
on:reset
|
|
157
157
|
>
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
class:hide-popover={open && !showPopover}
|
|
111
111
|
role="presentation"
|
|
112
112
|
style="height: {customHeight}; --customZindex: {customZindex};"
|
|
113
|
-
transition:fly|local={{ y: -20, duration: animate ?
|
|
113
|
+
transition:fly|local={{ y: -20, duration: animate ? 350 : 0 }}
|
|
114
114
|
>
|
|
115
115
|
<slot />
|
|
116
116
|
</div>
|
|
@@ -8,12 +8,14 @@
|
|
|
8
8
|
border-radius: 0.25rem;
|
|
9
9
|
overflow: hidden;
|
|
10
10
|
height: 360px;
|
|
11
|
-
--row-selection-color:
|
|
12
|
-
--row-hover-color:
|
|
11
|
+
--row-selection-color: rgb(from var(--primaryColor) r g b / 0.25);
|
|
12
|
+
--row-hover-color: rgb(from var(--primaryColor) r g b / 0.05);
|
|
13
13
|
|
|
14
14
|
&.quiet {
|
|
15
|
-
background:
|
|
15
|
+
background: rgb(from var(--spectrum-global-color-gray-50) r g b / 0.75);
|
|
16
|
+
color: var(--spectrum-global-color-gray-700);
|
|
16
17
|
--row-selection-color: var(--spectrum-global-color-gray-200);
|
|
18
|
+
--row-hover-color: var(--spectrum-global-color-gray-100);
|
|
17
19
|
border-color: var(--spectrum-global-color-gray-200);
|
|
18
20
|
}
|
|
19
21
|
|
|
@@ -86,7 +88,7 @@
|
|
|
86
88
|
flex: auto;
|
|
87
89
|
position: relative;
|
|
88
90
|
flex-direction: column;
|
|
89
|
-
|
|
91
|
+
|
|
90
92
|
overflow: hidden;
|
|
91
93
|
scrollbar-width: none;
|
|
92
94
|
|
|
@@ -134,6 +136,10 @@
|
|
|
134
136
|
cursor: col-resize;
|
|
135
137
|
}
|
|
136
138
|
}
|
|
139
|
+
|
|
140
|
+
&:last-child .super-column-body {
|
|
141
|
+
border-right: unset;
|
|
142
|
+
}
|
|
137
143
|
}
|
|
138
144
|
|
|
139
145
|
.super-column-header {
|
|
@@ -193,6 +199,7 @@
|
|
|
193
199
|
flex: auto;
|
|
194
200
|
overflow: hidden;
|
|
195
201
|
max-height: var(--super-table-body-height);
|
|
202
|
+
border-right: var(--super-table-vertical-dividers);
|
|
196
203
|
height: 100%;
|
|
197
204
|
|
|
198
205
|
&.zebra:not(.sticky) > .super-row:nth-child(even) {
|
|
@@ -251,8 +258,8 @@
|
|
|
251
258
|
}
|
|
252
259
|
|
|
253
260
|
&.disabled {
|
|
254
|
-
color: var(--spectrum-global-color-gray-
|
|
255
|
-
font-style: italic;
|
|
261
|
+
color: var(--spectrum-global-color-gray-600) !important;
|
|
262
|
+
font-style: italic !important;
|
|
256
263
|
}
|
|
257
264
|
|
|
258
265
|
&.isLast {
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
import ControlSection from "./controls/ControlSection.svelte";
|
|
30
30
|
import ColumnsSection from "./controls/ColumnsSection.svelte";
|
|
31
31
|
import PaginationLimitOffset from "./controls/PaginationLimitOffset.svelte";
|
|
32
|
+
import { ta } from "zod/v4/locales";
|
|
32
33
|
|
|
33
34
|
const {
|
|
34
35
|
API,
|
|
@@ -132,6 +133,7 @@
|
|
|
132
133
|
const filterStore = memo(filter);
|
|
133
134
|
const cachedRows = writable([]);
|
|
134
135
|
const loading = writable(false);
|
|
136
|
+
const resizing = writable(false);
|
|
135
137
|
|
|
136
138
|
$: dataSourceStore.set(dataSource);
|
|
137
139
|
$: filterStore.set(filter);
|
|
@@ -659,11 +661,12 @@
|
|
|
659
661
|
// Clear errors on success
|
|
660
662
|
$new_row.errors = {};
|
|
661
663
|
$new_row = $new_row;
|
|
662
|
-
|
|
664
|
+
|
|
663
665
|
let richContext = { ...$context, [comp_id]: { row: saved_row } };
|
|
664
666
|
let cmd_after = enrichButtonActions(afterInsert, richContext);
|
|
665
667
|
await cmd_after?.({ row: saved_row });
|
|
666
668
|
stbState.endSave(); // Only on success
|
|
669
|
+
stbState.refresh();
|
|
667
670
|
return saved_row;
|
|
668
671
|
} catch (e) {
|
|
669
672
|
// Auto-clear errors after 2 seconds
|
|
@@ -691,6 +694,13 @@
|
|
|
691
694
|
} else {
|
|
692
695
|
// Fallback for generic errors
|
|
693
696
|
$new_row.errors = { general: e.message || "Save failed" };
|
|
697
|
+
stbState.endSave(); // End save state on generic errors as well
|
|
698
|
+
notificationStore.actions.error(
|
|
699
|
+
"Failed to insert " +
|
|
700
|
+
(entitySingular || "Row") +
|
|
701
|
+
": " +
|
|
702
|
+
(e.message || "Unknown error"),
|
|
703
|
+
);
|
|
694
704
|
}
|
|
695
705
|
}
|
|
696
706
|
}
|
|
@@ -896,6 +906,15 @@
|
|
|
896
906
|
? [ids]
|
|
897
907
|
: [];
|
|
898
908
|
},
|
|
909
|
+
refreshColumns: () => {
|
|
910
|
+
columnStates?.forEach(({ state }) => state.unlockWidth());
|
|
911
|
+
},
|
|
912
|
+
startResize: () => {
|
|
913
|
+
resizing.set(true);
|
|
914
|
+
},
|
|
915
|
+
endResize: () => {
|
|
916
|
+
resizing.set(false);
|
|
917
|
+
},
|
|
899
918
|
};
|
|
900
919
|
|
|
901
920
|
// Super Table State Machine
|
|
@@ -1496,6 +1515,9 @@
|
|
|
1496
1515
|
limit,
|
|
1497
1516
|
});
|
|
1498
1517
|
|
|
1518
|
+
// Allow Columns to resize
|
|
1519
|
+
$: tableAPI.refreshColumns(tableWidth, $stbData.loaded);
|
|
1520
|
+
|
|
1499
1521
|
// Virtual List Capabilities reacting to viewport change
|
|
1500
1522
|
$: stbState.calculateBoundaries(
|
|
1501
1523
|
clientHeight,
|
|
@@ -1584,19 +1606,6 @@
|
|
|
1584
1606
|
if (timer) clearInterval(timer);
|
|
1585
1607
|
if (scrollLockTimeout) clearTimeout(scrollLockTimeout);
|
|
1586
1608
|
});
|
|
1587
|
-
|
|
1588
|
-
// Unlock columns when table width changes to allow responsive re-rendering
|
|
1589
|
-
let previousTableWidth = 0;
|
|
1590
|
-
$: if (
|
|
1591
|
-
(tableWidth > 0 && tableWidth !== previousTableWidth) ||
|
|
1592
|
-
$columnsStore
|
|
1593
|
-
) {
|
|
1594
|
-
previousTableWidth = tableWidth;
|
|
1595
|
-
// Unlock all columns to allow responsive re-rendering
|
|
1596
|
-
columnStates?.forEach(({ state }) => state.unlockWidth());
|
|
1597
|
-
}
|
|
1598
|
-
|
|
1599
|
-
$: console.log($stbSchema);
|
|
1600
1609
|
</script>
|
|
1601
1610
|
|
|
1602
1611
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
@@ -1606,15 +1615,15 @@
|
|
|
1606
1615
|
<div
|
|
1607
1616
|
class="super-table"
|
|
1608
1617
|
class:quiet
|
|
1609
|
-
class:initializing
|
|
1618
|
+
class:initializing={initializing || $stbData.loading}
|
|
1610
1619
|
bind:this={viewport}
|
|
1611
1620
|
bind:clientWidth={tableWidth}
|
|
1612
1621
|
bind:clientHeight
|
|
1613
1622
|
style:font-size={sizingMap[size].rowFontSize}
|
|
1614
1623
|
style:--super-table-devider-color={$tableStyles.color}
|
|
1615
1624
|
style:--super-table-body-height={maxBodyHeight}
|
|
1616
|
-
style:--super-table-header-height={$tableStyles.headerHeight}
|
|
1617
|
-
style:--super-table-footer-height={$tableStyles.footerHeight}
|
|
1625
|
+
style:--super-table-header-height={$tableStyles.headerHeight + "px"}
|
|
1626
|
+
style:--super-table-footer-height={$tableStyles.footerHeight + "px"}
|
|
1618
1627
|
style:--super-table-horizontal-dividers={$tableStyles.horizontal}
|
|
1619
1628
|
style:--super-table-vertical-dividers={$tableStyles.vertical}
|
|
1620
1629
|
style:--super-table-cell-padding={sizingMap[size].cellPadding}
|
|
@@ -1637,7 +1646,7 @@
|
|
|
1637
1646
|
hideSelectionColumn={hideSelectionColumn || $superColumns.length === 0}
|
|
1638
1647
|
/>
|
|
1639
1648
|
|
|
1640
|
-
{#if showButtonColumnLeft}
|
|
1649
|
+
{#if showButtonColumnLeft && $superColumns.length > 0 && $stbData.loaded}
|
|
1641
1650
|
<RowButtonsColumn {rowMenuItems} {menuItemsVisible} {rowMenu} />
|
|
1642
1651
|
{/if}
|
|
1643
1652
|
|
|
@@ -1692,7 +1701,7 @@
|
|
|
1692
1701
|
/>
|
|
1693
1702
|
|
|
1694
1703
|
<EmptyResultSetOverlay
|
|
1695
|
-
{isEmpty}
|
|
1704
|
+
isEmpty={isEmpty && !$stbData.loading}
|
|
1696
1705
|
message={$stbSettings.data.emptyMessage}
|
|
1697
1706
|
top={$superColumns?.length
|
|
1698
1707
|
? $stbSettings.appearance.headerHeight + 16
|