@lavalogic/scoria 0.18.2 → 0.19.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.
Files changed (28) hide show
  1. package/dist/Components/Base/Snippets.svelte +26 -0
  2. package/dist/Components/Base/Snippets.svelte.d.ts +5 -0
  3. package/dist/Components/CollapsibleCard.svelte +6 -3
  4. package/dist/Components/GridInput.svelte +18 -6
  5. package/dist/Components/LoadingAnimation.svelte +7 -2
  6. package/dist/Components/Table/Body/QuickSearchCell.svelte +30 -32
  7. package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCell.svelte +15 -21
  8. package/dist/Components/Table/Body/Rows/Columns/TableAction.svelte +8 -2
  9. package/dist/Components/Table/Body/Rows/Columns/TableDatePicker.svelte +43 -13
  10. package/dist/Components/Table/Body/Rows/Columns/TableDatePicker.svelte.d.ts +6 -6
  11. package/dist/Components/Table/Body/Rows/Columns/TableNumberInput.svelte +27 -2
  12. package/dist/Components/Table/Body/Rows/Columns/TableNumberInput.svelte.d.ts +6 -6
  13. package/dist/Components/Table/Body/Rows/Columns/TableQuerySelect.svelte +60 -15
  14. package/dist/Components/Table/Body/Rows/Columns/TableQuerySelect.svelte.d.ts +6 -6
  15. package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte +56 -44
  16. package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte.d.ts +6 -6
  17. package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte +30 -6
  18. package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte.d.ts +6 -6
  19. package/dist/Components/Table/Body/TableBody.svelte +15 -16
  20. package/dist/Components/Table/Headers/HighlightAllHeader.svelte +6 -3
  21. package/dist/Components/Table/Headers/SelectAllHeader.svelte +4 -1
  22. package/dist/Components/Table/Headers/TableHead.svelte +6 -0
  23. package/dist/Components/Table/Table.svelte +128 -133
  24. package/dist/Components/Table/Types/Context/TableContext.svelte.d.ts +1 -1
  25. package/dist/Components/Touch/TouchModal.svelte +20 -6
  26. package/dist/Helpers/Helpers.svelte.d.ts +1 -0
  27. package/dist/Helpers/Helpers.svelte.js +1 -0
  28. package/package.json +1 -1
@@ -103,12 +103,9 @@
103
103
  });
104
104
 
105
105
  $effect(() => {
106
- // eslint-disable-next-line @typescript-eslint/no-unused-expressions
107
- tableContext.dataRepo.data.length;
108
- // eslint-disable-next-line @typescript-eslint/no-unused-expressions
109
- tableContext.selectedItems;
110
- // eslint-disable-next-line @typescript-eslint/no-unused-expressions
111
- tableContext.paginationRepo?.pageStartIndex;
106
+ void tableContext.dataRepo.data.length;
107
+ void tableContext.selectedItems;
108
+ void tableContext.paginationRepo?.pageStartIndex;
112
109
 
113
110
  untrack(() => {
114
111
  tableContext.recalculateAllSelectedInCurrentPage();
@@ -359,151 +356,149 @@
359
356
  }}
360
357
  />
361
358
 
362
- <svelte:boundary>
359
+ <div
360
+ class="grid"
361
+ class:nested
362
+ >
363
+ {#if tableContext.dataRepo.isLoading}
364
+ <LoadingOverlay
365
+ absolute
366
+ borderRadius="4px"
367
+ />
368
+ {/if}
369
+
363
370
  <div
364
- class="grid"
365
- class:nested
371
+ class="horizontal-bar"
372
+ class:border={tableContext.toolbarPosition === ToolbarPosition.Top}
366
373
  >
367
- {#if tableContext.dataRepo.isLoading}
368
- <LoadingOverlay
369
- absolute
370
- borderRadius="4px"
371
- />
374
+ {#if tableContext.toolbarPosition === ToolbarPosition.Top}
375
+ <TableHorizontalBar />
372
376
  {/if}
377
+ </div>
373
378
 
374
- <div
375
- class="horizontal-bar"
376
- class:border={tableContext.toolbarPosition === ToolbarPosition.Top}
377
- >
378
- {#if tableContext.toolbarPosition === ToolbarPosition.Top}
379
- <TableHorizontalBar />
380
- {/if}
381
- </div>
382
-
383
- <div
384
- class="sidebar-wrapper sidebar-wrapper-left"
385
- class:nested
386
- style="--nested-height: {nestedHeight}px;"
387
- >
388
- {#if tableContext.toolbarPosition === ToolbarPosition.Left}
389
- <div class="sidebar toolbar-left">
390
- <TableSidebar />
391
- </div>
392
- {/if}
393
- </div>
394
- <div
395
- class="sidebar-wrapper sidebar-wrapper-right"
396
- class:nested
397
- style="--nested-height: {nestedHeight}px;"
398
- >
399
- {#if tableContext.toolbarPosition === ToolbarPosition.Right}
400
- <div class="sidebar toolbar-right">
401
- <TableSidebar />
402
- </div>
403
- {/if}
404
- </div>
379
+ <div
380
+ class="sidebar-wrapper sidebar-wrapper-left"
381
+ class:nested
382
+ style="--nested-height: {nestedHeight}px;"
383
+ >
384
+ {#if tableContext.toolbarPosition === ToolbarPosition.Left}
385
+ <div class="sidebar toolbar-left">
386
+ <TableSidebar />
387
+ </div>
388
+ {/if}
389
+ </div>
390
+ <div
391
+ class="sidebar-wrapper sidebar-wrapper-right"
392
+ class:nested
393
+ style="--nested-height: {nestedHeight}px;"
394
+ >
395
+ {#if tableContext.toolbarPosition === ToolbarPosition.Right}
396
+ <div class="sidebar toolbar-right">
397
+ <TableSidebar />
398
+ </div>
399
+ {/if}
400
+ </div>
405
401
 
406
- <div class="footer">
407
- {#if tableContext.displayFooter}
408
- <TableFooter />
409
- {/if}
410
- </div>
402
+ <div class="footer">
403
+ {#if tableContext.displayFooter}
404
+ <TableFooter />
405
+ {/if}
406
+ </div>
411
407
 
412
- <!-- svelte-ignore a11y_no_static_element_interactions -->
408
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
409
+ <div
410
+ bind:this={tableRef}
411
+ class="datatable"
412
+ class:nested
413
+ class:compact={tableContext.isCompact}
414
+ class:quick-filtering={tableContext.showQuickFiltering}
415
+ onkeydown={tableContext.handleTdKeydown}
416
+ >
413
417
  <div
414
- bind:this={tableRef}
415
- class="datatable"
418
+ class="flex_table"
419
+ bind:this={ref}
416
420
  class:nested
417
- class:compact={tableContext.isCompact}
418
- class:quick-filtering={tableContext.showQuickFiltering}
419
- onkeydown={tableContext.handleTdKeydown}
420
421
  >
421
422
  <div
422
- class="flex_table"
423
- bind:this={ref}
424
- class:nested
423
+ bind:this={unfocusRef}
424
+ class="table-wrapper"
425
+ oncontextmenu={openContextMenu}
425
426
  >
426
- <div
427
- bind:this={unfocusRef}
428
- class="table-wrapper"
429
- oncontextmenu={openContextMenu}
427
+ <!-- {#if leftTotalSize > 0} -->
428
+ <table
429
+ class="datatable__table left"
430
+ style="min-width: {leftTotalSize}px"
430
431
  >
431
- <!-- {#if leftTotalSize > 0} -->
432
- <table
433
- class="datatable__table left"
434
- style="min-width: {leftTotalSize}px"
435
- >
436
- <TableHead
437
- showHighlight={leftTotalSize > 0}
438
- side="left"
439
- />
440
- <TableBody
441
- includeHighlight={appropriateSide == 'left'}
442
- columns={leftColumns}
443
- side="left"
444
- />
445
- <!-- heights={totalRowSizes} -->
446
- <!-- bind:this={leftTable} -->
447
- </table>
448
- <!-- {/if} -->
449
-
450
- <!-- {#if centreTotalSize > 0} -->
451
-
452
- <table
453
- class="datatable__table centre"
454
- style="min-width: {centreTotalSize}px"
455
- >
456
- <TableHead
457
- showHighlight={leftTotalSize == 0}
458
- side="centre"
459
- />
460
- <TableBody
461
- includeHighlight={appropriateSide == 'centre'}
462
- columns={centreColumns}
463
- side="centre"
464
- />
465
- <!-- heights={totalRowSizes}
432
+ <TableHead
433
+ showHighlight={leftTotalSize > 0}
434
+ side="left"
435
+ />
436
+ <TableBody
437
+ includeHighlight={appropriateSide == 'left'}
438
+ columns={leftColumns}
439
+ side="left"
440
+ />
441
+ <!-- heights={totalRowSizes} -->
442
+ <!-- bind:this={leftTable} -->
443
+ </table>
444
+ <!-- {/if} -->
445
+
446
+ <!-- {#if centreTotalSize > 0} -->
447
+
448
+ <table
449
+ class="datatable__table centre"
450
+ style="min-width: {centreTotalSize}px"
451
+ >
452
+ <TableHead
453
+ showHighlight={leftTotalSize == 0}
454
+ side="centre"
455
+ />
456
+ <TableBody
457
+ includeHighlight={appropriateSide == 'centre'}
458
+ columns={centreColumns}
459
+ side="centre"
460
+ />
461
+ <!-- heights={totalRowSizes}
466
462
  bind:this={centreTable} -->
467
- </table>
468
- <!-- {/if} -->
469
-
470
- <!-- {#if rightTotalSize > 0} -->
471
- <table
472
- class="datatable__table right"
473
- style="min-width: {rightTotalSize}px"
474
- >
475
- <TableHead
476
- showHighlight={false}
477
- side="right"
478
- />
479
- <TableBody
480
- includeHighlight={appropriateSide == 'right'}
481
- columns={rightColumns}
482
- side="right"
483
- />
484
- <!-- heights={totalRowSizes}
485
- bind:this={rightTable} -->
486
- </table>
487
- <!-- {/if} -->
488
- </div>
463
+ </table>
464
+ <!-- {/if} -->
489
465
 
490
- <!-- TODO add filter callbacks -->
466
+ <!-- {#if rightTotalSize > 0} -->
467
+ <table
468
+ class="datatable__table right"
469
+ style="min-width: {rightTotalSize}px"
470
+ >
471
+ <TableHead
472
+ showHighlight={false}
473
+ side="right"
474
+ />
475
+ <TableBody
476
+ includeHighlight={appropriateSide == 'right'}
477
+ columns={rightColumns}
478
+ side="right"
479
+ />
480
+ <!-- heights={totalRowSizes}
481
+ bind:this={rightTable} -->
482
+ </table>
483
+ <!-- {/if} -->
491
484
  </div>
492
485
 
493
- {#if nested}
494
- <!-- svelte-ignore a11y_no_static_element_interactions -->
495
- <div
496
- class:isResizing
497
- class="resizer"
498
- onmousedown={(e) => {
499
- e.preventDefault();
500
- addOverrideResizeHandler();
501
- }}
502
- ></div>
503
- {/if}
486
+ <!-- TODO add filter callbacks -->
504
487
  </div>
488
+
489
+ {#if nested}
490
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
491
+ <div
492
+ class:isResizing
493
+ class="resizer"
494
+ onmousedown={(e) => {
495
+ e.preventDefault();
496
+ addOverrideResizeHandler();
497
+ }}
498
+ ></div>
499
+ {/if}
505
500
  </div>
506
- </svelte:boundary>
501
+ </div>
507
502
 
508
503
  <style>div.grid {
509
504
  border-radius: 4px;
@@ -32,7 +32,7 @@ export declare class TableContext<T extends object, RowIdType extends Primitive>
32
32
  selectionExtractor: TableInitOptions<T, RowIdType>['selectionExtractor'];
33
33
  getUserId: () => string | undefined;
34
34
  private _onEditCell;
35
- private readonly debug;
35
+ readonly debug: boolean;
36
36
  static readonly identifier: unique symbol;
37
37
  static init<T extends object, RowIdType extends Primitive>(defaultColumnDefs: DefsWrapper<T>, tableName: string, dataRepo: IDataRepository<T>, options: TableInitOptions<T, RowIdType>): TableContext<T, RowIdType>;
38
38
  protected constructor(INTERNAL_ONLY: symbol, defaultColumnDefs: DefsWrapper<T>, tableName: string, dataRepo: IDataRepository<T>, allowCopy: boolean, enableResize: boolean, allowColumnReordering: boolean, allowQuickFiltering: boolean, showQuickFilterByDefault: boolean, allowAdvancedFiltering: boolean, toolbarPosition: ToolbarPosition, displayFooter: boolean, selectionExtractor: TableInitOptions<T, RowIdType>['selectionExtractor'], getUserId: () => string | undefined, _onEditCell: TableInitOptions<T, RowIdType>['onEditCell'], debug: boolean);
@@ -33,7 +33,7 @@
33
33
  onclose,
34
34
  row,
35
35
  wrap,
36
- submitRef = $bindable()
36
+ submitRef = $bindable(),
37
37
  }: TouchModalProps = $props();
38
38
 
39
39
  let dialog: HTMLDialogElement | undefined;
@@ -137,7 +137,7 @@
137
137
  }}
138
138
  icon={{
139
139
  name: 'cross',
140
- size: Size.DoubleXLarge
140
+ size: Size.DoubleXLarge,
141
141
  }}
142
142
  onkeydown={handleEsc}
143
143
  colourSet={ColourSet.Primary}
@@ -155,11 +155,19 @@
155
155
  {#if defaultTimer}
156
156
  <!-- class:paused -->
157
157
  <div class="bar-container">
158
- <div class:paused class="bar-timer"></div>
158
+ <div
159
+ class:paused
160
+ class="bar-timer"
161
+ ></div>
159
162
  </div>
160
163
  {/if}
161
164
 
162
- <div class="modal-main" class:row class:wrap class:noscroll>
165
+ <div
166
+ class="modal-main"
167
+ class:row
168
+ class:wrap
169
+ class:noscroll
170
+ >
163
171
  {#if explanation}
164
172
  {@render explanation()}
165
173
  {/if}
@@ -175,7 +183,10 @@
175
183
  <div class="button-barcode-set">
176
184
  {#if button.barcodeValue}
177
185
  {@const icon = DATAMatrix(button.barcodeValue)}
178
- <DataMatrixIcon title={button.label} {icon} />
186
+ <DataMatrixIcon
187
+ title={button.label}
188
+ {icon}
189
+ />
179
190
  {/if}
180
191
  {#await button.isValid}
181
192
  <button
@@ -207,7 +218,10 @@
207
218
  <div class="button-barcode-set">
208
219
  {#if button.barcodeValue}
209
220
  {@const icon = DATAMatrix(button.barcodeValue)}
210
- <DataMatrixIcon title={button.label} {icon} />
221
+ <DataMatrixIcon
222
+ title={button.label}
223
+ {icon}
224
+ />
211
225
  {/if}
212
226
  {#await button.isValid}
213
227
  <button
@@ -51,3 +51,4 @@ export declare function hasQuery<FilterValueType>(customFilter: CustomFilter<Fil
51
51
  export declare function isDateTuple(value: unknown): value is [Date | null, Date | null];
52
52
  export declare function isNumberTuple(value: unknown): value is [number | null, number | null];
53
53
  export declare function isValidityTuple(v: Validity | ValidityWrapper | undefined): v is ValidityWrapper;
54
+ export declare const loadingText = "loading\u2026";
@@ -268,3 +268,4 @@ export function isNumberTuple(value) {
268
268
  export function isValidityTuple(v) {
269
269
  return v != null && typeof v == 'object';
270
270
  }
271
+ export const loadingText = 'loading…';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lavalogic/scoria",
3
3
  "description": "Svelte components used for the FloWMS Web Frontend",
4
- "version": "0.18.2",
4
+ "version": "0.19.1",
5
5
  "publishConfig": {
6
6
  "access": "restricted"
7
7
  },