@shotleybuilder/svelte-gridlite-kit 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/GridLite.svelte +57 -37
- package/dist/GridLite.svelte.d.ts +13 -1
- package/package.json +1 -1
package/dist/GridLite.svelte
CHANGED
|
@@ -720,6 +720,9 @@ onDestroy(() => {
|
|
|
720
720
|
{:else}
|
|
721
721
|
{#if table && toolbarLayout !== 'aggrid'}
|
|
722
722
|
<div class="gridlite-toolbar">
|
|
723
|
+
<!-- Custom toolbar content (start) -->
|
|
724
|
+
<slot name="toolbar-start" />
|
|
725
|
+
|
|
723
726
|
<!-- Column Visibility (data control) -->
|
|
724
727
|
{#if features.columnVisibility}
|
|
725
728
|
<div class="gridlite-toolbar-columns gridlite-view-control">
|
|
@@ -898,6 +901,9 @@ onDestroy(() => {
|
|
|
898
901
|
</div>
|
|
899
902
|
</div>
|
|
900
903
|
{/if}
|
|
904
|
+
|
|
905
|
+
<!-- Custom toolbar content (end) -->
|
|
906
|
+
<slot name="toolbar-end" />
|
|
901
907
|
</div>
|
|
902
908
|
{/if}
|
|
903
909
|
|
|
@@ -905,6 +911,9 @@ onDestroy(() => {
|
|
|
905
911
|
<!-- AG Grid layout: sidebar on right, minimal toolbar on top -->
|
|
906
912
|
<!-- TODO(#1): aggrid layout is experimental — not production-ready. Needs debugging. -->
|
|
907
913
|
<div class="gridlite-toolbar gridlite-toolbar-aggrid-top">
|
|
914
|
+
<!-- Custom toolbar content (start) -->
|
|
915
|
+
<slot name="toolbar-start" />
|
|
916
|
+
|
|
908
917
|
{#if features.globalSearch}
|
|
909
918
|
<div class="gridlite-toolbar-search">
|
|
910
919
|
<div class="gridlite-search">
|
|
@@ -1012,6 +1021,9 @@ onDestroy(() => {
|
|
|
1012
1021
|
{/if}
|
|
1013
1022
|
</div>
|
|
1014
1023
|
</div>
|
|
1024
|
+
|
|
1025
|
+
<!-- Custom toolbar content (end) -->
|
|
1026
|
+
<slot name="toolbar-end" />
|
|
1015
1027
|
</div>
|
|
1016
1028
|
{/if}
|
|
1017
1029
|
|
|
@@ -1160,16 +1172,18 @@ onDestroy(() => {
|
|
|
1160
1172
|
class={`gridlite-td ${classNames.td ?? ''}`}
|
|
1161
1173
|
on:contextmenu={(e) => handleCellContextMenu(e, row, col)}
|
|
1162
1174
|
>
|
|
1163
|
-
{
|
|
1164
|
-
{
|
|
1165
|
-
|
|
1166
|
-
{colConfig
|
|
1175
|
+
<slot name="cell" value={row[col.name]} {row} column={col.name}>
|
|
1176
|
+
{#if config?.columns}
|
|
1177
|
+
{@const colConfig = config.columns.find((c) => c.name === col.name)}
|
|
1178
|
+
{#if colConfig?.format}
|
|
1179
|
+
{colConfig.format(row[col.name])}
|
|
1180
|
+
{:else}
|
|
1181
|
+
{row[col.name] ?? ''}
|
|
1182
|
+
{/if}
|
|
1167
1183
|
{:else}
|
|
1168
1184
|
{row[col.name] ?? ''}
|
|
1169
1185
|
{/if}
|
|
1170
|
-
|
|
1171
|
-
{row[col.name] ?? ''}
|
|
1172
|
-
{/if}
|
|
1186
|
+
</slot>
|
|
1173
1187
|
</td>
|
|
1174
1188
|
{/each}
|
|
1175
1189
|
</tr>
|
|
@@ -1209,16 +1223,18 @@ onDestroy(() => {
|
|
|
1209
1223
|
class={`gridlite-td ${classNames.td ?? ''}`}
|
|
1210
1224
|
on:contextmenu={(e) => handleCellContextMenu(e, row, col)}
|
|
1211
1225
|
>
|
|
1212
|
-
{
|
|
1213
|
-
{
|
|
1214
|
-
|
|
1215
|
-
{colConfig
|
|
1226
|
+
<slot name="cell" value={row[col.name]} {row} column={col.name}>
|
|
1227
|
+
{#if config?.columns}
|
|
1228
|
+
{@const colConfig = config.columns.find((c) => c.name === col.name)}
|
|
1229
|
+
{#if colConfig?.format}
|
|
1230
|
+
{colConfig.format(row[col.name])}
|
|
1231
|
+
{:else}
|
|
1232
|
+
{row[col.name] ?? ''}
|
|
1233
|
+
{/if}
|
|
1216
1234
|
{:else}
|
|
1217
1235
|
{row[col.name] ?? ''}
|
|
1218
1236
|
{/if}
|
|
1219
|
-
|
|
1220
|
-
{row[col.name] ?? ''}
|
|
1221
|
-
{/if}
|
|
1237
|
+
</slot>
|
|
1222
1238
|
</td>
|
|
1223
1239
|
{/each}
|
|
1224
1240
|
</tr>
|
|
@@ -1328,32 +1344,36 @@ onDestroy(() => {
|
|
|
1328
1344
|
onNext={nextRowDetail}
|
|
1329
1345
|
>
|
|
1330
1346
|
{#if rowDetailRow}
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
+
{#if $$slots['row-detail']}
|
|
1348
|
+
<slot name="row-detail" row={rowDetailRow} close={closeRowDetail} />
|
|
1349
|
+
{:else}
|
|
1350
|
+
<dl class="gridlite-row-detail">
|
|
1351
|
+
{#each orderedColumns as col}
|
|
1352
|
+
<div class="gridlite-row-detail-field">
|
|
1353
|
+
<dt>
|
|
1354
|
+
{#if config?.columns}
|
|
1355
|
+
{@const colConfig = config.columns.find((c) => c.name === col.name)}
|
|
1356
|
+
{colConfig?.label ?? col.name}
|
|
1357
|
+
{:else}
|
|
1358
|
+
{col.name}
|
|
1359
|
+
{/if}
|
|
1360
|
+
</dt>
|
|
1361
|
+
<dd>
|
|
1362
|
+
{#if config?.columns}
|
|
1363
|
+
{@const colConfig = config.columns.find((c) => c.name === col.name)}
|
|
1364
|
+
{#if colConfig?.format}
|
|
1365
|
+
{colConfig.format(rowDetailRow[col.name])}
|
|
1366
|
+
{:else}
|
|
1367
|
+
{rowDetailRow[col.name] ?? '—'}
|
|
1368
|
+
{/if}
|
|
1347
1369
|
{:else}
|
|
1348
1370
|
{rowDetailRow[col.name] ?? '—'}
|
|
1349
1371
|
{/if}
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
{/each}
|
|
1356
|
-
</dl>
|
|
1372
|
+
</dd>
|
|
1373
|
+
</div>
|
|
1374
|
+
{/each}
|
|
1375
|
+
</dl>
|
|
1376
|
+
{/if}
|
|
1357
1377
|
{/if}
|
|
1358
1378
|
</RowDetailModal>
|
|
1359
1379
|
{/if}
|
|
@@ -24,7 +24,19 @@ declare const __propDef: {
|
|
|
24
24
|
events: {
|
|
25
25
|
[evt: string]: CustomEvent<any>;
|
|
26
26
|
};
|
|
27
|
-
slots: {
|
|
27
|
+
slots: {
|
|
28
|
+
'toolbar-start': {};
|
|
29
|
+
'toolbar-end': {};
|
|
30
|
+
cell: {
|
|
31
|
+
value: unknown;
|
|
32
|
+
row: Record<string, unknown>;
|
|
33
|
+
column: string;
|
|
34
|
+
};
|
|
35
|
+
'row-detail': {
|
|
36
|
+
row: Record<string, unknown> | null;
|
|
37
|
+
close: () => void;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
28
40
|
exports?: {} | undefined;
|
|
29
41
|
bindings?: string | undefined;
|
|
30
42
|
};
|