@poirazis/supercomponents-shared 1.2.12 → 1.2.13
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 +11250 -11204
- package/dist/index.umd.cjs +15 -15
- package/package.json +1 -1
- package/src/lib/SuperForm/InnerForm.svelte +68 -19
- package/src/lib/SuperForm/SuperForm.svelte +13 -3
- package/src/lib/SuperTable/SuperTable.css +9 -6
- package/src/lib/SuperTable/SuperTable.svelte +207 -193
- package/src/lib/SuperTable/controls/ColumnsSection.svelte +11 -19
- package/src/lib/SuperTable/controls/RowButtonsColumn.svelte +4 -4
- package/src/lib/SuperTable/controls/SelectionColumn.svelte +9 -10
- package/src/lib/SuperTable/overlays/AddNewRowOverlay.svelte +1 -1
- package/src/lib/SuperTableCells/CellBoolean.svelte +0 -1
- package/src/lib/SuperTableCells/CellCommon.css +59 -88
- package/src/lib/SuperTableCells/CellDateRange.svelte +3 -4
- package/src/lib/SuperTableCells/CellDatetime.svelte +3 -4
- package/src/lib/SuperTableCells/CellJSON.svelte +1 -4
- package/src/lib/SuperTableCells/CellLink.svelte +20 -25
- package/src/lib/SuperTableCells/CellLinkAdvanced.svelte +3 -7
- package/src/lib/SuperTableCells/CellLinkPickerSelect.svelte +7 -4
- package/src/lib/SuperTableCells/CellNumber.svelte +18 -23
- package/src/lib/SuperTableCells/CellOptions.svelte +34 -31
- package/src/lib/SuperTableCells/CellSQLLink.svelte +84 -64
- package/src/lib/SuperTableCells/CellSQLLinkPicker.svelte +66 -36
- package/src/lib/SuperTableCells/CellString.svelte +9 -25
- package/src/lib/SuperTableCells/CellStringMask.svelte +0 -4
- package/src/lib/SuperTableCells/CellStringSimple.svelte +6 -8
- package/src/lib/SuperTableColumn/SuperTableColumn.svelte +10 -10
- package/src/lib/SuperTableColumn/parts/SuperColumnHeader.svelte +4 -1
- package/src/lib/SuperTableColumn/parts/SuperColumnRow.svelte +25 -21
- package/src/lib/SuperTabs/SuperTabs.svelte +7 -12
- package/src/lib/SuperTable/controls/SuperTableWelcome.svelte +0 -58
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
export let columnsViewport;
|
|
8
8
|
export let showActionColumn;
|
|
9
9
|
export let canScroll;
|
|
10
|
-
export let stbData;
|
|
11
10
|
</script>
|
|
12
11
|
|
|
13
12
|
<div bind:this={columnsViewport} class="st-master-columns" tabIndex="-1">
|
|
@@ -15,24 +14,17 @@
|
|
|
15
14
|
<slot />
|
|
16
15
|
{/if}
|
|
17
16
|
|
|
18
|
-
{#
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
isFirst: idx == 0,
|
|
30
|
-
isLast:
|
|
31
|
-
idx == $superColumns.length - 1 && !showActionColumn && canScroll,
|
|
32
|
-
}}
|
|
33
|
-
/>
|
|
34
|
-
{/each}
|
|
35
|
-
{/if}
|
|
17
|
+
{#each $superColumns as column, idx (idx)}
|
|
18
|
+
<SuperTableColumn
|
|
19
|
+
columnOptions={{
|
|
20
|
+
...$commonColumnOptions,
|
|
21
|
+
...column,
|
|
22
|
+
isFirst: idx == 0,
|
|
23
|
+
isLast:
|
|
24
|
+
idx == $superColumns.length - 1 && !showActionColumn && canScroll,
|
|
25
|
+
}}
|
|
26
|
+
/>
|
|
27
|
+
{/each}
|
|
36
28
|
|
|
37
29
|
{#if $stbSettings.superColumnsPos == "last"}
|
|
38
30
|
<slot />
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
class="super-row"
|
|
66
66
|
on:mouseenter={() => ($stbHovered = visibleRow)}
|
|
67
67
|
on:mouseleave={() => ($stbHovered = null)}
|
|
68
|
-
class:
|
|
69
|
-
class:
|
|
68
|
+
class:selected={$rowMetadata[visibleRow].selected}
|
|
69
|
+
class:hovered={$stbHovered == visibleRow || $stbMenuID == visibleRow}
|
|
70
70
|
class:is-editing={$stbEditing == visibleRow}
|
|
71
|
-
class:
|
|
71
|
+
class:disabled={$rowMetadata[visibleRow].disabled}
|
|
72
72
|
style:min-height={$rowMetadata[visibleRow].height}
|
|
73
73
|
style:padding-right={canScroll && right ? "1.5rem" : "0.5rem"}
|
|
74
74
|
>
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
$rowMetadata[visibleRow].disabled ||
|
|
88
88
|
stbAPI.shouldDisableButton(
|
|
89
89
|
disabledTemplate,
|
|
90
|
-
stbAPI.enrichContext($stbData?.rows?.[visibleRow])
|
|
90
|
+
stbAPI.enrichContext($stbData?.rows?.[visibleRow]),
|
|
91
91
|
)}
|
|
92
92
|
onClick={() => {
|
|
93
93
|
stbAPI.executeRowButtonAction(visibleRow, onClick);
|
|
@@ -13,22 +13,21 @@
|
|
|
13
13
|
const stbAPI = getContext("stbAPI");
|
|
14
14
|
const stbVisibleRows = getContext("stbVisibleRows");
|
|
15
15
|
const stbRowMetadata = getContext("stbRowMetadata");
|
|
16
|
+
const data = getContext("data");
|
|
16
17
|
|
|
17
18
|
export let sticky;
|
|
18
19
|
export let hideSelectionColumn;
|
|
19
|
-
export let stbData;
|
|
20
20
|
|
|
21
21
|
$: partialSelection =
|
|
22
|
-
$stbSelected.length && $stbSelected.length != $
|
|
22
|
+
$stbSelected.length && $stbSelected.length != $data.length;
|
|
23
23
|
|
|
24
|
-
$: fullSelection =
|
|
25
|
-
$stbSelected.length == $stbData?.rows?.length && $stbData?.rows?.length > 0;
|
|
24
|
+
$: fullSelection = $stbSelected.length == $data.length && $data.length > 0;
|
|
26
25
|
|
|
27
26
|
$: numbering = $stbSettings.appearance.numberingColumn;
|
|
28
27
|
$: checkBoxes = $stbSettings.features.canSelect && !hideSelectionColumn;
|
|
29
28
|
$: canDelete = $stbSettings.features.canDelete;
|
|
30
29
|
$: sticky = $stbHorizontalScrollPos > 0;
|
|
31
|
-
$: visible = numbering || checkBoxes || canDelete;
|
|
30
|
+
$: visible = (numbering || checkBoxes || canDelete) && !hideSelectionColumn;
|
|
32
31
|
$: zebra = $stbSettings.appearance.zebraColors;
|
|
33
32
|
$: quiet = $stbSettings.appearance.quiet;
|
|
34
33
|
$: headerCheckbox =
|
|
@@ -74,16 +73,16 @@
|
|
|
74
73
|
class:quiet
|
|
75
74
|
class:sticky
|
|
76
75
|
style:margin-top={"var(--super-column-top-offset)"}
|
|
76
|
+
style:border-right={"1px solid var(--spectrum-global-color-gray-200)"}
|
|
77
77
|
>
|
|
78
78
|
{#each $stbVisibleRows as visibleRow (visibleRow)}
|
|
79
79
|
{@const selected = $stbRowMetadata[visibleRow]?.selected}
|
|
80
80
|
<div
|
|
81
81
|
class="super-row selection"
|
|
82
|
-
class:
|
|
83
|
-
class:
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
style:min-height={$stbRowMetadata[visibleRow]?.height}
|
|
82
|
+
class:selected
|
|
83
|
+
class:hovered={$stbHovered == visibleRow || $stbMenuID == visibleRow}
|
|
84
|
+
class:disabled={$stbRowMetadata[visibleRow]?.disabled}
|
|
85
|
+
style:height={$stbRowMetadata[visibleRow]?.height}
|
|
87
86
|
on:mouseenter={() => ($stbHovered = visibleRow)}
|
|
88
87
|
on:mouseleave={() => ($stbHovered = null)}
|
|
89
88
|
>
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
.superCell {
|
|
2
2
|
flex: auto;
|
|
3
3
|
display: flex;
|
|
4
|
-
align-items:
|
|
4
|
+
align-items: stretch;
|
|
5
5
|
position: relative;
|
|
6
6
|
overflow: hidden;
|
|
7
7
|
transition: all 130ms;
|
|
8
8
|
transition: border 75ms ease-out;
|
|
9
9
|
width: 100%;
|
|
10
10
|
max-height: 2rem;
|
|
11
|
+
font-size: 13px;
|
|
12
|
+
padding: 0 0.5rem 0 0.75rem;
|
|
13
|
+
gap: 0.5rem;
|
|
11
14
|
|
|
12
15
|
&.multirow {
|
|
13
|
-
|
|
16
|
+
padding: unset;
|
|
17
|
+
max-height: 15rem;
|
|
14
18
|
align-items: stretch;
|
|
15
19
|
}
|
|
16
20
|
|
|
@@ -37,26 +41,11 @@
|
|
|
37
41
|
border-left: 2px solid var(--spectrum-global-color-orange-400) !important;
|
|
38
42
|
}
|
|
39
43
|
|
|
40
|
-
.icon {
|
|
41
|
-
position: absolute;
|
|
42
|
-
left: 0.5rem;
|
|
43
|
-
font-size: 16px;
|
|
44
|
-
color: var(--spectrum-global-color-gray-500);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.clearIcon {
|
|
48
|
-
position: absolute;
|
|
49
|
-
right: 8px;
|
|
50
|
-
color: var(--spectrum-global-color-red-500);
|
|
51
|
-
|
|
52
|
-
&:hover {
|
|
53
|
-
color: var(--spectrum-global-color-red-700);
|
|
54
|
-
cursor: pointer;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
44
|
.field-icon {
|
|
59
|
-
|
|
45
|
+
height: 100%;
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
font-size: 14px;
|
|
60
49
|
color: var(--spectrum-global-color-gray-600);
|
|
61
50
|
}
|
|
62
51
|
|
|
@@ -75,7 +64,6 @@
|
|
|
75
64
|
align-items: center;
|
|
76
65
|
min-width: 0;
|
|
77
66
|
overflow: hidden;
|
|
78
|
-
padding: 0.25rem 0.5rem;
|
|
79
67
|
gap: 0.5rem;
|
|
80
68
|
|
|
81
69
|
&:focus {
|
|
@@ -85,7 +73,6 @@
|
|
|
85
73
|
&.placeholder {
|
|
86
74
|
font-weight: 400;
|
|
87
75
|
color: var(--spectrum-global-color-gray-500);
|
|
88
|
-
justify-content: space-between;
|
|
89
76
|
overflow: hidden;
|
|
90
77
|
text-overflow: ellipsis;
|
|
91
78
|
white-space: nowrap;
|
|
@@ -95,10 +82,6 @@
|
|
|
95
82
|
}
|
|
96
83
|
}
|
|
97
84
|
|
|
98
|
-
&.with-icon {
|
|
99
|
-
padding-left: 2rem !important;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
85
|
& > span {
|
|
103
86
|
overflow: hidden;
|
|
104
87
|
text-overflow: ellipsis;
|
|
@@ -112,18 +95,6 @@
|
|
|
112
95
|
}
|
|
113
96
|
}
|
|
114
97
|
|
|
115
|
-
.clearIcon,
|
|
116
|
-
.endIcon {
|
|
117
|
-
color: var(--spectrum-global-color-red-500);
|
|
118
|
-
cursor: pointer;
|
|
119
|
-
z-index: 1;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
& > .valueicon {
|
|
123
|
-
font-size: 16px;
|
|
124
|
-
color: var(--spectrum-global-color-green-700);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
98
|
.items {
|
|
128
99
|
flex: auto;
|
|
129
100
|
display: flex;
|
|
@@ -131,7 +102,7 @@
|
|
|
131
102
|
align-items: stretch;
|
|
132
103
|
align-self: stretch;
|
|
133
104
|
gap: 0.5rem;
|
|
134
|
-
padding: 0.
|
|
105
|
+
padding: 0.4rem 0rem;
|
|
135
106
|
|
|
136
107
|
.item {
|
|
137
108
|
display: flex;
|
|
@@ -139,7 +110,7 @@
|
|
|
139
110
|
overflow: hidden;
|
|
140
111
|
padding: 0.15rem 0.5rem;
|
|
141
112
|
|
|
142
|
-
|
|
113
|
+
.loope {
|
|
143
114
|
display: none;
|
|
144
115
|
}
|
|
145
116
|
|
|
@@ -159,10 +130,6 @@
|
|
|
159
130
|
);
|
|
160
131
|
gap: 0.5rem;
|
|
161
132
|
border-radius: 4px;
|
|
162
|
-
|
|
163
|
-
i {
|
|
164
|
-
display: none;
|
|
165
|
-
}
|
|
166
133
|
}
|
|
167
134
|
}
|
|
168
135
|
|
|
@@ -188,13 +155,12 @@
|
|
|
188
155
|
}
|
|
189
156
|
}
|
|
190
157
|
|
|
191
|
-
.items.
|
|
158
|
+
.items.bullets {
|
|
192
159
|
.item {
|
|
193
160
|
gap: 0.5rem;
|
|
194
161
|
padding: unset;
|
|
195
162
|
|
|
196
|
-
|
|
197
|
-
color: var(--option-color);
|
|
163
|
+
.loope {
|
|
198
164
|
display: block;
|
|
199
165
|
}
|
|
200
166
|
}
|
|
@@ -231,21 +197,30 @@
|
|
|
231
197
|
|
|
232
198
|
.clear-icon {
|
|
233
199
|
display: none;
|
|
234
|
-
|
|
235
|
-
cursor: pointer;
|
|
200
|
+
transition: all 130ms;
|
|
236
201
|
}
|
|
237
202
|
|
|
238
203
|
.clear-icon.visible {
|
|
239
|
-
display:
|
|
204
|
+
display: flex;
|
|
205
|
+
height: 100%;
|
|
206
|
+
align-items: center;
|
|
207
|
+
justify-content: center;
|
|
240
208
|
color: var(--spectrum-global-color-red-400);
|
|
241
|
-
|
|
209
|
+
cursor: pointer;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.clear-icon.visible:hover {
|
|
213
|
+
color: var(--spectrum-global-color-red-600);
|
|
214
|
+
font-size: larger;
|
|
242
215
|
}
|
|
243
216
|
|
|
244
217
|
.control-icon {
|
|
218
|
+
height: 100%;
|
|
219
|
+
display: flex;
|
|
220
|
+
align-items: center;
|
|
245
221
|
color: var(--spectrum-global-color-gray-600);
|
|
222
|
+
font-size: 14px;
|
|
246
223
|
cursor: pointer;
|
|
247
|
-
padding: 0.5rem;
|
|
248
|
-
padding-left: 0.25rem;
|
|
249
224
|
}
|
|
250
225
|
|
|
251
226
|
&.error {
|
|
@@ -280,26 +255,22 @@
|
|
|
280
255
|
padding-left: 2px !important;
|
|
281
256
|
border-color: transparent !important;
|
|
282
257
|
border-width: 1px !important;
|
|
283
|
-
|
|
284
|
-
&.with-icon {
|
|
285
|
-
padding-left: 32px !important;
|
|
286
|
-
}
|
|
287
258
|
}
|
|
288
259
|
}
|
|
289
260
|
|
|
290
261
|
.superCell.formInput {
|
|
291
|
-
border-radius:
|
|
262
|
+
border-radius: 4px;
|
|
292
263
|
color: var(--spectrum-global-color-gray-800);
|
|
293
264
|
border: 1px solid var(--spectrum-global-color-gray-300);
|
|
294
265
|
background: var(--spectrum-global-color-gray-50);
|
|
295
266
|
min-height: 2rem;
|
|
296
267
|
|
|
297
|
-
|
|
268
|
+
&.inEdit:not(.naked-field):not(.has-popup) {
|
|
298
269
|
border: 1px solid var(--spectrum-global-color-blue-400);
|
|
299
|
-
}
|
|
300
270
|
|
|
301
|
-
|
|
302
|
-
|
|
271
|
+
&:focus-within:not(.naked-field):not(.has-popup) {
|
|
272
|
+
border: 1px solid var(--spectrum-global-color-blue-400);
|
|
273
|
+
}
|
|
303
274
|
}
|
|
304
275
|
|
|
305
276
|
&:hover:not(.disabled):not(.readonly):not(.inEdit) {
|
|
@@ -308,24 +279,18 @@
|
|
|
308
279
|
}
|
|
309
280
|
|
|
310
281
|
&.disabled {
|
|
311
|
-
background-color: var(--spectrum-global-color-gray-
|
|
282
|
+
background-color: var(--spectrum-global-color-gray-200) !important;
|
|
312
283
|
border: 1px solid var(--spectrum-global-color-gray-200);
|
|
313
284
|
color: var(--spectrum-global-color-gray-600) !important;
|
|
314
|
-
cursor: not-allowed !important;
|
|
315
|
-
|
|
316
|
-
&:focus-within {
|
|
317
|
-
border: 1px dashed var(--spectrum-global-color-gray-500) !important;
|
|
318
|
-
}
|
|
319
285
|
}
|
|
320
286
|
|
|
321
287
|
&.readonly:not(.disabled) {
|
|
322
|
-
background-color:
|
|
323
|
-
|
|
288
|
+
background-color: rgb(
|
|
289
|
+
from var(--spectrum-global-color-gray-50) r g b / 0.75
|
|
290
|
+
);
|
|
291
|
+
border: 1px solid
|
|
292
|
+
rgb(from var(--spectrum-global-color-gray-200) r g b / 0.75);
|
|
324
293
|
color: var(--spectrum-global-color-gray-700);
|
|
325
|
-
|
|
326
|
-
&:focus-within {
|
|
327
|
-
border: 1px dashed var(--spectrum-global-color-blue-500) !important;
|
|
328
|
-
}
|
|
329
294
|
}
|
|
330
295
|
|
|
331
296
|
&.error {
|
|
@@ -341,10 +306,23 @@
|
|
|
341
306
|
}
|
|
342
307
|
}
|
|
343
308
|
|
|
309
|
+
.superCell.formInput.has-popup {
|
|
310
|
+
&.inEdit {
|
|
311
|
+
border: 1px solid var(--spectrum-global-color-blue-400) !important;
|
|
312
|
+
background-color: var(--spectrum-global-color-gray-200) !important;
|
|
313
|
+
cursor: pointer !important;
|
|
314
|
+
}
|
|
315
|
+
&.inEdit.open-popup {
|
|
316
|
+
background-color: var(--spectrum-global-color-gray-200) !important;
|
|
317
|
+
border: 1px solid var(--spectrum-global-color-gray-200) !important;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
344
321
|
.superCell.tableCell {
|
|
345
322
|
min-height: unset;
|
|
346
323
|
max-height: unset;
|
|
347
324
|
border: 1px solid transparent;
|
|
325
|
+
padding: 0 0.5rem;
|
|
348
326
|
|
|
349
327
|
&:hover:not(.readonly):not(.inEdit) {
|
|
350
328
|
border: 1px dashed var(--spectrum-global-color-blue-400);
|
|
@@ -369,13 +347,12 @@
|
|
|
369
347
|
white-space: nowrap;
|
|
370
348
|
overflow: hidden;
|
|
371
349
|
gap: 0.25rem;
|
|
372
|
-
padding-left: 0.5rem;
|
|
373
|
-
padding-right: 0.5rem;
|
|
374
350
|
background-color: transparent;
|
|
375
351
|
outline: none;
|
|
376
352
|
border: none;
|
|
377
353
|
color: inherit;
|
|
378
354
|
letter-spacing: inherit;
|
|
355
|
+
font-size: inherit;
|
|
379
356
|
|
|
380
357
|
&:focus {
|
|
381
358
|
outline: none;
|
|
@@ -389,18 +366,11 @@
|
|
|
389
366
|
font-style: italic !important;
|
|
390
367
|
}
|
|
391
368
|
|
|
392
|
-
&.with-icon {
|
|
393
|
-
padding-left: 2rem;
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
i {
|
|
397
|
-
font-size: 18px;
|
|
398
|
-
}
|
|
399
|
-
|
|
400
369
|
&.textarea {
|
|
401
370
|
flex: 1 1 auto;
|
|
371
|
+
padding: 0.5rem 0rem;
|
|
372
|
+
justify-content: flex-start;
|
|
402
373
|
align-items: stretch;
|
|
403
|
-
padding: 0.5rem;
|
|
404
374
|
white-space: normal;
|
|
405
375
|
overflow: auto;
|
|
406
376
|
resize: none;
|
|
@@ -427,6 +397,7 @@
|
|
|
427
397
|
min-height: 1.8rem;
|
|
428
398
|
min-width: unset;
|
|
429
399
|
transition: all 130ms;
|
|
400
|
+
align-items: center !important;
|
|
430
401
|
}
|
|
431
402
|
|
|
432
403
|
.superCell.inline:hover:not(.disabled):not(.readonly):not(.inEdit) {
|
|
@@ -437,12 +408,12 @@
|
|
|
437
408
|
|
|
438
409
|
.superCell.inline.inEdit {
|
|
439
410
|
background-color: var(--spectrum-global-color-gray-50);
|
|
440
|
-
border: 1px solid var(--spectrum-global-color-
|
|
411
|
+
border: 1px solid var(--spectrum-global-color-gray-400);
|
|
441
412
|
cursor: text;
|
|
442
413
|
}
|
|
443
414
|
|
|
444
415
|
.superCell.inline.disabled {
|
|
445
|
-
background-color: var(--spectrum-global-color-gray-
|
|
416
|
+
background-color: var(--spectrum-global-color-gray-200) !important;
|
|
446
417
|
color: var(--spectrum-global-color-gray-600);
|
|
447
418
|
cursor: not-allowed;
|
|
448
419
|
}
|
|
@@ -334,9 +334,10 @@
|
|
|
334
334
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
335
335
|
<div
|
|
336
336
|
bind:this={anchor}
|
|
337
|
-
class="superCell"
|
|
337
|
+
class="superCell has-popup"
|
|
338
338
|
tabindex={cellOptions.readonly || cellOptions.disabled ? "-1" : "0"}
|
|
339
339
|
class:inEdit
|
|
340
|
+
class:open-popup={open}
|
|
340
341
|
class:isDirty={isDirty && cellOptions.showDirty}
|
|
341
342
|
class:inline
|
|
342
343
|
class:tableCell={cellOptions.role == "tableCell"}
|
|
@@ -352,13 +353,12 @@
|
|
|
352
353
|
on:focusout={cellState.focusout}
|
|
353
354
|
>
|
|
354
355
|
{#if cellOptions.icon}
|
|
355
|
-
<i class={cellOptions.icon + " icon"}></i>
|
|
356
|
+
<i class={cellOptions.icon + " field-icon"}></i>
|
|
356
357
|
{/if}
|
|
357
358
|
|
|
358
359
|
{#if inEdit}
|
|
359
360
|
<div
|
|
360
361
|
class="editor"
|
|
361
|
-
class:with-icon={cellOptions.icon}
|
|
362
362
|
class:placeholder={!value}
|
|
363
363
|
on:click={() => (open = !open)}
|
|
364
364
|
>
|
|
@@ -380,7 +380,6 @@
|
|
|
380
380
|
{:else}
|
|
381
381
|
<div
|
|
382
382
|
class="value"
|
|
383
|
-
class:with-icon={cellOptions.icon}
|
|
384
383
|
class:placeholder={!value}
|
|
385
384
|
style:justify-content={cellOptions.align}
|
|
386
385
|
>
|
|
@@ -183,7 +183,7 @@
|
|
|
183
183
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
184
184
|
<div
|
|
185
185
|
bind:this={anchor}
|
|
186
|
-
class="superCell"
|
|
186
|
+
class="superCell has-popup"
|
|
187
187
|
tabindex={cellOptions.readonly || cellOptions.disabled ? "-1" : "0"}
|
|
188
188
|
class:inEdit
|
|
189
189
|
class:isDirty={isDirty && cellOptions.showDirty}
|
|
@@ -193,6 +193,7 @@
|
|
|
193
193
|
class:disabled={cellOptions.disabled}
|
|
194
194
|
class:readonly={cellOptions.readonly}
|
|
195
195
|
class:error={cellOptions.error}
|
|
196
|
+
class:open-popup={open}
|
|
196
197
|
style:color={cellOptions.color}
|
|
197
198
|
style:background={cellOptions.background}
|
|
198
199
|
style:font-weight={cellOptions.fontWeight}
|
|
@@ -201,13 +202,12 @@
|
|
|
201
202
|
on:focusout={cellState.focusout}
|
|
202
203
|
>
|
|
203
204
|
{#if cellOptions.icon}
|
|
204
|
-
<i class={cellOptions.icon + " icon"}></i>
|
|
205
|
+
<i class={cellOptions.icon + " field-icon"}></i>
|
|
205
206
|
{/if}
|
|
206
207
|
|
|
207
208
|
{#if inEdit}
|
|
208
209
|
<div
|
|
209
210
|
class="editor"
|
|
210
|
-
class:with-icon={cellOptions.icon}
|
|
211
211
|
class:placeholder={!formattedValue}
|
|
212
212
|
on:click={() => (open = !open)}
|
|
213
213
|
>
|
|
@@ -220,7 +220,6 @@
|
|
|
220
220
|
{:else}
|
|
221
221
|
<div
|
|
222
222
|
class="value"
|
|
223
|
-
class:with-icon={cellOptions.icon}
|
|
224
223
|
class:placeholder={!formattedValue}
|
|
225
224
|
style:justify-content={cellOptions.align}
|
|
226
225
|
>
|
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
style:font-weight={cellOptions.fontWeight}
|
|
173
173
|
>
|
|
174
174
|
{#if cellOptions.icon && !cellOptions.multiline}
|
|
175
|
-
<i class={cellOptions.icon + " icon"}></i>
|
|
175
|
+
<i class={cellOptions.icon + " field-icon"}></i>
|
|
176
176
|
{/if}
|
|
177
177
|
|
|
178
178
|
{#if inEdit}
|
|
@@ -181,7 +181,6 @@
|
|
|
181
181
|
bind:this={editor}
|
|
182
182
|
tabindex="0"
|
|
183
183
|
class="editor"
|
|
184
|
-
class:with-icon={cellOptions.icon}
|
|
185
184
|
class:placeholder={!value && !formattedValue && !localValue}
|
|
186
185
|
value={displayValue}
|
|
187
186
|
placeholder={cellOptions?.placeholder ?? ""}
|
|
@@ -208,7 +207,6 @@
|
|
|
208
207
|
bind:this={editor}
|
|
209
208
|
tabindex="0"
|
|
210
209
|
class="editor"
|
|
211
|
-
class:with-icon={cellOptions.icon}
|
|
212
210
|
class:placeholder={!value && !formattedValue && !localValue}
|
|
213
211
|
value={localValue ?? ""}
|
|
214
212
|
placeholder={cellOptions?.placeholder ?? ""}
|
|
@@ -237,7 +235,6 @@
|
|
|
237
235
|
class="value"
|
|
238
236
|
class:multiline={cellOptions.multiline}
|
|
239
237
|
tabindex={cellOptions.readonly || cellOptions.disabled ? "-1" : "0"}
|
|
240
|
-
class:with-icon={cellOptions.icon}
|
|
241
238
|
class:placeholder={!value}
|
|
242
239
|
style:justify-content={cellOptions.align}
|
|
243
240
|
on:focusin={cellState.focus}
|
|
@@ -50,15 +50,17 @@
|
|
|
50
50
|
dispatch("exitedit");
|
|
51
51
|
},
|
|
52
52
|
focusout(e) {
|
|
53
|
-
if (
|
|
54
|
-
anchor?.contains(e?.relatedTarget) ||
|
|
55
|
-
popup?.contains(e?.relatedTarget)
|
|
56
|
-
)
|
|
57
|
-
return;
|
|
58
|
-
|
|
53
|
+
if (popup?.contains(e?.relatedTarget)) return;
|
|
59
54
|
this.submit();
|
|
60
55
|
},
|
|
61
|
-
|
|
56
|
+
popupfocusout(e) {
|
|
57
|
+
if (anchor != e?.relatedTarget) {
|
|
58
|
+
this.submit();
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
toggle(e) {
|
|
62
|
+
editorState.toggle();
|
|
63
|
+
},
|
|
62
64
|
clear() {
|
|
63
65
|
localValue = [];
|
|
64
66
|
},
|
|
@@ -71,9 +73,9 @@
|
|
|
71
73
|
|
|
72
74
|
return "View";
|
|
73
75
|
},
|
|
74
|
-
cancel() {
|
|
76
|
+
cancel(e) {
|
|
75
77
|
localValue = JSON.parse(originalValue);
|
|
76
|
-
anchor
|
|
78
|
+
anchor.blur();
|
|
77
79
|
return "View";
|
|
78
80
|
},
|
|
79
81
|
},
|
|
@@ -176,7 +178,7 @@
|
|
|
176
178
|
<!-- svelte-ignore a11y-no-noninteractive-tabindex -->
|
|
177
179
|
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
178
180
|
<div
|
|
179
|
-
class="superCell"
|
|
181
|
+
class="superCell has-popup"
|
|
180
182
|
tabindex={cellOptions?.disabled ? -1 : 0}
|
|
181
183
|
bind:this={anchor}
|
|
182
184
|
class:isDirty={isDirty && cellOptions.showDirty}
|
|
@@ -188,18 +190,13 @@
|
|
|
188
190
|
class:disabled={cellOptions.disabled}
|
|
189
191
|
class:readonly
|
|
190
192
|
class:error={cellOptions.error}
|
|
193
|
+
class:open-popup={$editorState == "Open"}
|
|
191
194
|
style:color={cellOptions.color}
|
|
192
195
|
style:background={cellOptions.background}
|
|
193
196
|
on:focusin={cellState.focus}
|
|
194
197
|
on:keydown|self={handleKeyboard}
|
|
195
198
|
on:focusout={cellState.focusout}
|
|
196
|
-
on:mousedown={
|
|
197
|
-
if (inEdit) {
|
|
198
|
-
// Prevent losing focus when clicking to open the picker
|
|
199
|
-
e.preventDefault();
|
|
200
|
-
editorState.toggle();
|
|
201
|
-
}
|
|
202
|
-
}}
|
|
199
|
+
on:mousedown={cellState.toggle}
|
|
203
200
|
>
|
|
204
201
|
{#if cellOptions?.icon}
|
|
205
202
|
<i class={cellOptions.icon + " field-icon"}></i>
|
|
@@ -227,7 +224,9 @@
|
|
|
227
224
|
}
|
|
228
225
|
: null}
|
|
229
226
|
>
|
|
230
|
-
|
|
227
|
+
{#if isUser}
|
|
228
|
+
<i class={valueIcon}></i>
|
|
229
|
+
{/if}
|
|
231
230
|
<span>{val.primaryDisplay}</span>
|
|
232
231
|
</div>
|
|
233
232
|
{/if}
|
|
@@ -253,16 +252,11 @@
|
|
|
253
252
|
</div>
|
|
254
253
|
|
|
255
254
|
{#if inEdit}
|
|
256
|
-
<SuperPopover
|
|
257
|
-
{anchor}
|
|
258
|
-
useAnchorWidth
|
|
259
|
-
open={$editorState == "Open"}
|
|
260
|
-
on:close={cellState.cancel}
|
|
261
|
-
bind:popup
|
|
262
|
-
>
|
|
255
|
+
<SuperPopover {anchor} useAnchorWidth open={$editorState == "Open"}>
|
|
263
256
|
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
264
257
|
<div
|
|
265
258
|
class="picker-container"
|
|
259
|
+
bind:this={popup}
|
|
266
260
|
on:keydown={(e) => {
|
|
267
261
|
if (e.key == "Escape" || e.key == "Tab") {
|
|
268
262
|
anchor.focus();
|
|
@@ -294,6 +288,7 @@
|
|
|
294
288
|
{search}
|
|
295
289
|
wide={cellOptions.wide && !singleSelect}
|
|
296
290
|
on:change={handleChange}
|
|
291
|
+
on:focusout={cellState.popupfocusout}
|
|
297
292
|
/>
|
|
298
293
|
{/if}
|
|
299
294
|
</div>
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
if (isDirty)
|
|
59
59
|
dispatch(
|
|
60
60
|
"change",
|
|
61
|
-
returnSingle && localValue ? localValue[0] : localValue
|
|
61
|
+
returnSingle && localValue ? localValue[0] : localValue,
|
|
62
62
|
);
|
|
63
63
|
editorState.close();
|
|
64
64
|
return "View";
|
|
@@ -178,14 +178,10 @@
|
|
|
178
178
|
on:mousedown={editorState.toggle}
|
|
179
179
|
>
|
|
180
180
|
{#if cellOptions?.icon}
|
|
181
|
-
<i class={cellOptions.icon + " icon"}></i>
|
|
181
|
+
<i class={cellOptions.icon + " field-icon"}></i>
|
|
182
182
|
{/if}
|
|
183
183
|
|
|
184
|
-
<div
|
|
185
|
-
class="value"
|
|
186
|
-
class:with-icon={cellOptions?.icon}
|
|
187
|
-
class:placeholder={localValue?.length < 1}
|
|
188
|
-
>
|
|
184
|
+
<div class="value" class:placeholder={localValue?.length < 1}>
|
|
189
185
|
{#if localValue?.length < 1}
|
|
190
186
|
<span>
|
|
191
187
|
{cellOptions.placeholder ?? null}
|