@poirazis/supercomponents-shared 1.2.11 → 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 +11081 -10997
- package/dist/index.umd.cjs +13 -13
- package/package.json +1 -1
- package/src/lib/SuperField/SuperField.svelte +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/CellAttachmentExpanded.svelte +0 -1
- package/src/lib/SuperTableCells/CellAttachmentSlider.svelte +0 -1
- package/src/lib/SuperTableCells/CellBoolean.svelte +0 -1
- package/src/lib/SuperTableCells/CellCommon.css +60 -88
- package/src/lib/SuperTableCells/CellDateRange.svelte +6 -32
- package/src/lib/SuperTableCells/CellDatetime.svelte +3 -4
- package/src/lib/SuperTableCells/CellJSON.svelte +1 -4
- package/src/lib/SuperTableCells/CellLink.svelte +22 -21
- 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 +39 -37
- package/src/lib/SuperTableCells/CellSQLLink.svelte +85 -66
- package/src/lib/SuperTableCells/CellSQLLinkPicker.svelte +66 -36
- package/src/lib/SuperTableCells/CellString.svelte +9 -25
- package/src/lib/SuperTableCells/CellStringMask.svelte +119 -26
- 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 +28 -23
- 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,51 +255,42 @@
|
|
|
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) {
|
|
306
277
|
border: 1px solid var(--spectrum-global-color-gray-400);
|
|
278
|
+
cursor: pointer;
|
|
307
279
|
}
|
|
308
280
|
|
|
309
281
|
&.disabled {
|
|
310
|
-
background-color: var(--spectrum-global-color-gray-
|
|
282
|
+
background-color: var(--spectrum-global-color-gray-200) !important;
|
|
311
283
|
border: 1px solid var(--spectrum-global-color-gray-200);
|
|
312
284
|
color: var(--spectrum-global-color-gray-600) !important;
|
|
313
|
-
cursor: not-allowed !important;
|
|
314
|
-
|
|
315
|
-
&:focus-within {
|
|
316
|
-
border: 1px dashed var(--spectrum-global-color-gray-500) !important;
|
|
317
|
-
}
|
|
318
285
|
}
|
|
319
286
|
|
|
320
287
|
&.readonly:not(.disabled) {
|
|
321
|
-
background-color:
|
|
322
|
-
|
|
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);
|
|
323
293
|
color: var(--spectrum-global-color-gray-700);
|
|
324
|
-
|
|
325
|
-
&:focus-within {
|
|
326
|
-
border: 1px dashed var(--spectrum-global-color-blue-500) !important;
|
|
327
|
-
}
|
|
328
294
|
}
|
|
329
295
|
|
|
330
296
|
&.error {
|
|
@@ -340,10 +306,23 @@
|
|
|
340
306
|
}
|
|
341
307
|
}
|
|
342
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
|
+
|
|
343
321
|
.superCell.tableCell {
|
|
344
322
|
min-height: unset;
|
|
345
323
|
max-height: unset;
|
|
346
324
|
border: 1px solid transparent;
|
|
325
|
+
padding: 0 0.5rem;
|
|
347
326
|
|
|
348
327
|
&:hover:not(.readonly):not(.inEdit) {
|
|
349
328
|
border: 1px dashed var(--spectrum-global-color-blue-400);
|
|
@@ -368,13 +347,12 @@
|
|
|
368
347
|
white-space: nowrap;
|
|
369
348
|
overflow: hidden;
|
|
370
349
|
gap: 0.25rem;
|
|
371
|
-
padding-left: 0.5rem;
|
|
372
|
-
padding-right: 0.5rem;
|
|
373
350
|
background-color: transparent;
|
|
374
351
|
outline: none;
|
|
375
352
|
border: none;
|
|
376
353
|
color: inherit;
|
|
377
354
|
letter-spacing: inherit;
|
|
355
|
+
font-size: inherit;
|
|
378
356
|
|
|
379
357
|
&:focus {
|
|
380
358
|
outline: none;
|
|
@@ -388,18 +366,11 @@
|
|
|
388
366
|
font-style: italic !important;
|
|
389
367
|
}
|
|
390
368
|
|
|
391
|
-
&.with-icon {
|
|
392
|
-
padding-left: 2rem;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
i {
|
|
396
|
-
font-size: 18px;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
369
|
&.textarea {
|
|
400
370
|
flex: 1 1 auto;
|
|
371
|
+
padding: 0.5rem 0rem;
|
|
372
|
+
justify-content: flex-start;
|
|
401
373
|
align-items: stretch;
|
|
402
|
-
padding: 0.5rem;
|
|
403
374
|
white-space: normal;
|
|
404
375
|
overflow: auto;
|
|
405
376
|
resize: none;
|
|
@@ -426,6 +397,7 @@
|
|
|
426
397
|
min-height: 1.8rem;
|
|
427
398
|
min-width: unset;
|
|
428
399
|
transition: all 130ms;
|
|
400
|
+
align-items: center !important;
|
|
429
401
|
}
|
|
430
402
|
|
|
431
403
|
.superCell.inline:hover:not(.disabled):not(.readonly):not(.inEdit) {
|
|
@@ -436,12 +408,12 @@
|
|
|
436
408
|
|
|
437
409
|
.superCell.inline.inEdit {
|
|
438
410
|
background-color: var(--spectrum-global-color-gray-50);
|
|
439
|
-
border: 1px solid var(--spectrum-global-color-
|
|
411
|
+
border: 1px solid var(--spectrum-global-color-gray-400);
|
|
440
412
|
cursor: text;
|
|
441
413
|
}
|
|
442
414
|
|
|
443
415
|
.superCell.inline.disabled {
|
|
444
|
-
background-color: var(--spectrum-global-color-gray-
|
|
416
|
+
background-color: var(--spectrum-global-color-gray-200) !important;
|
|
445
417
|
color: var(--spectrum-global-color-gray-600);
|
|
446
418
|
cursor: not-allowed;
|
|
447
419
|
}
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
dateFormat,
|
|
102
102
|
fromTime,
|
|
103
103
|
toTime,
|
|
104
|
-
showTime
|
|
104
|
+
showTime,
|
|
105
105
|
) {
|
|
106
106
|
if (!showTime) {
|
|
107
107
|
return {
|
|
@@ -120,14 +120,7 @@
|
|
|
120
120
|
|
|
121
121
|
// Date formatting helper function
|
|
122
122
|
function formatDateRange(fromDate, toDate, dateFormat) {
|
|
123
|
-
console.log("🔍 formatDateRange called with:", {
|
|
124
|
-
fromDate,
|
|
125
|
-
toDate,
|
|
126
|
-
dateFormat,
|
|
127
|
-
});
|
|
128
|
-
|
|
129
123
|
if (!dateFormat || dateFormat === "default") {
|
|
130
|
-
console.log("➡️ Using default format");
|
|
131
124
|
return {
|
|
132
125
|
from: fromDate.toDateString(),
|
|
133
126
|
to: toDate.toDateString(),
|
|
@@ -138,30 +131,18 @@
|
|
|
138
131
|
if (dateFormat === "MM/DD/YYYY") {
|
|
139
132
|
const fromFormatted = `${(fromDate.getMonth() + 1).toString().padStart(2, "0")}/${fromDate.getDate().toString().padStart(2, "0")}/${fromDate.getFullYear()}`;
|
|
140
133
|
const toFormatted = `${(toDate.getMonth() + 1).toString().padStart(2, "0")}/${toDate.getDate().toString().padStart(2, "0")}/${toDate.getFullYear()}`;
|
|
141
|
-
console.log("✅ MM/DD/YYYY formatted:", {
|
|
142
|
-
from: fromFormatted,
|
|
143
|
-
to: toFormatted,
|
|
144
|
-
});
|
|
145
134
|
return { from: fromFormatted, to: toFormatted };
|
|
146
135
|
}
|
|
147
136
|
|
|
148
137
|
if (dateFormat === "DD/MM/YYYY") {
|
|
149
138
|
const fromFormatted = `${fromDate.getDate().toString().padStart(2, "0")}/${(fromDate.getMonth() + 1).toString().padStart(2, "0")}/${fromDate.getFullYear()}`;
|
|
150
139
|
const toFormatted = `${toDate.getDate().toString().padStart(2, "0")}/${(toDate.getMonth() + 1).toString().padStart(2, "0")}/${toDate.getFullYear()}`;
|
|
151
|
-
console.log("✅ DD/MM/YYYY formatted:", {
|
|
152
|
-
from: fromFormatted,
|
|
153
|
-
to: toFormatted,
|
|
154
|
-
});
|
|
155
140
|
return { from: fromFormatted, to: toFormatted };
|
|
156
141
|
}
|
|
157
142
|
|
|
158
143
|
if (dateFormat === "YYYY-MM-DD") {
|
|
159
144
|
const fromFormatted = `${fromDate.getFullYear()}-${(fromDate.getMonth() + 1).toString().padStart(2, "0")}-${fromDate.getDate().toString().padStart(2, "0")}`;
|
|
160
145
|
const toFormatted = `${toDate.getFullYear()}-${(toDate.getMonth() + 1).toString().padStart(2, "0")}-${toDate.getDate().toString().padStart(2, "0")}`;
|
|
161
|
-
console.log("✅ YYYY-MM-DD formatted:", {
|
|
162
|
-
from: fromFormatted,
|
|
163
|
-
to: toFormatted,
|
|
164
|
-
});
|
|
165
146
|
return { from: fromFormatted, to: toFormatted };
|
|
166
147
|
}
|
|
167
148
|
|
|
@@ -182,22 +163,16 @@
|
|
|
182
163
|
};
|
|
183
164
|
|
|
184
165
|
const format = options[dateFormat];
|
|
185
|
-
console.log("📅 Format object:", format);
|
|
186
166
|
|
|
187
167
|
if (format) {
|
|
188
168
|
const fromFormatted = fromDate.toLocaleDateString("en-US", format);
|
|
189
169
|
const toFormatted = toDate.toLocaleDateString("en-US", format);
|
|
190
|
-
console.log("✅ Formatted result:", {
|
|
191
|
-
from: fromFormatted,
|
|
192
|
-
to: toFormatted,
|
|
193
|
-
});
|
|
194
170
|
return {
|
|
195
171
|
from: fromFormatted,
|
|
196
172
|
to: toFormatted,
|
|
197
173
|
};
|
|
198
174
|
}
|
|
199
175
|
|
|
200
|
-
console.log("⚠️ Format not found, using fallback");
|
|
201
176
|
// Fallback to default
|
|
202
177
|
return {
|
|
203
178
|
from: fromDate.toDateString(),
|
|
@@ -240,7 +215,7 @@
|
|
|
240
215
|
dateFormat,
|
|
241
216
|
fromTime,
|
|
242
217
|
fromTime,
|
|
243
|
-
true
|
|
218
|
+
true,
|
|
244
219
|
);
|
|
245
220
|
fromFormatted = formatted.from;
|
|
246
221
|
} else {
|
|
@@ -263,7 +238,7 @@
|
|
|
263
238
|
dateFormat,
|
|
264
239
|
toTime,
|
|
265
240
|
toTime,
|
|
266
|
-
true
|
|
241
|
+
true,
|
|
267
242
|
);
|
|
268
243
|
toFormatted = formatted.to;
|
|
269
244
|
} else {
|
|
@@ -359,9 +334,10 @@
|
|
|
359
334
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
360
335
|
<div
|
|
361
336
|
bind:this={anchor}
|
|
362
|
-
class="superCell"
|
|
337
|
+
class="superCell has-popup"
|
|
363
338
|
tabindex={cellOptions.readonly || cellOptions.disabled ? "-1" : "0"}
|
|
364
339
|
class:inEdit
|
|
340
|
+
class:open-popup={open}
|
|
365
341
|
class:isDirty={isDirty && cellOptions.showDirty}
|
|
366
342
|
class:inline
|
|
367
343
|
class:tableCell={cellOptions.role == "tableCell"}
|
|
@@ -377,13 +353,12 @@
|
|
|
377
353
|
on:focusout={cellState.focusout}
|
|
378
354
|
>
|
|
379
355
|
{#if cellOptions.icon}
|
|
380
|
-
<i class={cellOptions.icon + " icon"}></i>
|
|
356
|
+
<i class={cellOptions.icon + " field-icon"}></i>
|
|
381
357
|
{/if}
|
|
382
358
|
|
|
383
359
|
{#if inEdit}
|
|
384
360
|
<div
|
|
385
361
|
class="editor"
|
|
386
|
-
class:with-icon={cellOptions.icon}
|
|
387
362
|
class:placeholder={!value}
|
|
388
363
|
on:click={() => (open = !open)}
|
|
389
364
|
>
|
|
@@ -405,7 +380,6 @@
|
|
|
405
380
|
{:else}
|
|
406
381
|
<div
|
|
407
382
|
class="value"
|
|
408
|
-
class:with-icon={cellOptions.icon}
|
|
409
383
|
class:placeholder={!value}
|
|
410
384
|
style:justify-content={cellOptions.align}
|
|
411
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}
|