@lavalogic/scoria 0.0.13 → 0.0.15

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 (187) hide show
  1. package/dist/Components/Button.svelte +0 -3
  2. package/dist/Components/Contexts/ContextMenuOption.svelte +0 -3
  3. package/dist/Components/DatePicker.svelte +1 -6
  4. package/dist/Components/DimensionInput.svelte +5 -6
  5. package/dist/Components/DimensionInput.svelte.d.ts +4 -4
  6. package/dist/Components/FileUpload.svelte +4 -2
  7. package/dist/Components/GridInput.svelte +3 -3
  8. package/dist/Components/MultiSelect.svelte +0 -4
  9. package/dist/Components/ProgressBubble.svelte +1 -2
  10. package/dist/Components/Table/Body/QuickSearchCell.svelte +0 -9
  11. package/dist/Components/Table/Body/Rows/ColumnListRow.svelte +1 -5
  12. package/dist/Components/Table/Body/Rows/Columns/TableAction.svelte +2 -2
  13. package/dist/Components/Table/Body/Rows/Columns/TableCheckbox.svelte +1 -2
  14. package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte +6 -7
  15. package/dist/Components/Table/Body/Rows/Columns/TableDatePicker.svelte +2 -5
  16. package/dist/Components/Table/Body/Rows/Columns/TableNumberInput.svelte +0 -3
  17. package/dist/Components/Table/Body/Rows/Columns/TableQuerySelect.svelte +8 -6
  18. package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte +12 -19
  19. package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte +2 -5
  20. package/dist/Components/Table/Body/Rows/TableRow.svelte +3 -17
  21. package/dist/Components/Table/Headers/TableHead.svelte +1 -5
  22. package/dist/Components/Table/Misc/FilterInput.svelte +10 -27
  23. package/dist/Components/Table/Table.svelte +1 -2
  24. package/dist/Components/Table/Types/Columns/Definitions/ColumnDef.svelte.js +6 -5
  25. package/dist/Components/Table/Types/Context/TableContext.svelte.js +11 -30
  26. package/dist/Components/Table/Types/DataRepository/LocalTableDataRepository.svelte.d.ts +0 -1
  27. package/dist/Components/Table/Types/DataRepository/LocalTableDataRepository.svelte.js +3 -16
  28. package/dist/Components/Table/Types/DataRepository/TableDataRepository.svelte.js +2 -5
  29. package/dist/Components/Table/Types/Filtering/CustomRemoteFilters.d.ts +1 -2
  30. package/dist/Components/Table/Types/Focus/TableFocusDetails.svelte.js +1 -5
  31. package/dist/Components/Touch/DateModal.svelte +0 -5
  32. package/dist/Components/Touch/UtilityButton.svelte +12 -7
  33. package/dist/Components/Touch/UtilityButton.svelte.d.ts +1 -1
  34. package/dist/Contexts/UntypedInputContext.svelte.d.ts +2 -1
  35. package/dist/Contexts/UntypedInputContext.svelte.js +1 -17
  36. package/dist/Helpers/Helpers.svelte.d.ts +21 -95
  37. package/dist/Helpers/Helpers.svelte.js +54 -395
  38. package/dist/Types/Examples/ExampleItem.d.ts +3 -3
  39. package/dist/Types/Internal/Misc.d.ts +12 -267
  40. package/dist/Types/Internal/Misc.js +1 -129
  41. package/dist/index.d.ts +4 -76
  42. package/dist/index.js +4 -76
  43. package/package.json +16 -16
  44. package/dist/Components/Table/Types/DataRepository/RemoteTableDataRepository.svelte.d.ts +0 -74
  45. package/dist/Components/Table/Types/DataRepository/RemoteTableDataRepository.svelte.js +0 -521
  46. package/dist/Components/Table/Types/Filtering/CustomProxyFilter.d.ts +0 -10
  47. package/dist/Components/Table/Types/Filtering/CustomProxyFilter.js +0 -1
  48. package/dist/Types/Internal/ApplicationIdentifier.d.ts +0 -39
  49. package/dist/Types/Internal/ApplicationIdentifier.js +0 -2080
  50. package/dist/Types/Internal/FloService.d.ts +0 -7
  51. package/dist/Types/Internal/FloService.js +0 -30
  52. package/dist/Types/Requests/IFillablePodLineDateRequestBody.d.ts +0 -13
  53. package/dist/Types/Requests/IFillablePodLineDateRequestBody.js +0 -10
  54. package/dist/Types/Requests/IRequiredPodLineDateRequestBody.d.ts +0 -14
  55. package/dist/Types/Requests/IRequiredPodLineDateRequestBody.js +0 -8
  56. package/dist/Types/Requests/IValidatedPodLineDateRequestBody.d.ts +0 -16
  57. package/dist/Types/Requests/IValidatedPodLineDateRequestBody.js +0 -10
  58. package/dist/Types/Responses/AddressType.d.ts +0 -3
  59. package/dist/Types/Responses/AddressType.js +0 -2
  60. package/dist/Types/Responses/IAddress.d.ts +0 -39
  61. package/dist/Types/Responses/IAddress.js +0 -30
  62. package/dist/Types/Responses/IBaseAddress.d.ts +0 -17
  63. package/dist/Types/Responses/IBaseAddress.js +0 -15
  64. package/dist/Types/Responses/ICountry.d.ts +0 -16
  65. package/dist/Types/Responses/ICountry.js +0 -1
  66. package/dist/Types/Responses/IDBEntry.d.ts +0 -13
  67. package/dist/Types/Responses/IDBEntry.js +0 -12
  68. package/dist/Types/Responses/IErrorResponse.d.ts +0 -10
  69. package/dist/Types/Responses/IErrorResponse.js +0 -1
  70. package/dist/Types/Responses/ILabelPrinter.d.ts +0 -4
  71. package/dist/Types/Responses/ILabelPrinter.js +0 -1
  72. package/dist/Types/Responses/ILaserPrinter.d.ts +0 -4
  73. package/dist/Types/Responses/ILaserPrinter.js +0 -1
  74. package/dist/Types/Responses/ILoginResponse.d.ts +0 -8
  75. package/dist/Types/Responses/ILoginResponse.js +0 -1
  76. package/dist/Types/Responses/IPaginatedPayload.d.ts +0 -5
  77. package/dist/Types/Responses/IPaginatedPayload.js +0 -1
  78. package/dist/Types/Responses/IPaginatedResponse.d.ts +0 -5
  79. package/dist/Types/Responses/IPaginatedResponse.js +0 -1
  80. package/dist/Types/Responses/IPagination.d.ts +0 -9
  81. package/dist/Types/Responses/IPagination.js +0 -1
  82. package/dist/Types/Responses/IPayload.d.ts +0 -3
  83. package/dist/Types/Responses/IPayload.js +0 -1
  84. package/dist/Types/Responses/IPrinter.d.ts +0 -11
  85. package/dist/Types/Responses/IPrinter.js +0 -1
  86. package/dist/Types/Responses/IProcessTypeSelectionMethodOutboundType.d.ts +0 -18
  87. package/dist/Types/Responses/IProcessTypeSelectionMethodOutboundType.js +0 -12
  88. package/dist/Types/Responses/IProcessTypeSelectionMethodWarehouseCustomer.d.ts +0 -20
  89. package/dist/Types/Responses/IProcessTypeSelectionMethodWarehouseCustomer.js +0 -14
  90. package/dist/Types/Responses/IProcessTypeSelectionMethodWarehouseCustomerType.d.ts +0 -20
  91. package/dist/Types/Responses/IProcessTypeSelectionMethodWarehouseCustomerType.js +0 -14
  92. package/dist/Types/Responses/IProductCategory.d.ts +0 -19
  93. package/dist/Types/Responses/IProductCategory.js +0 -13
  94. package/dist/Types/Responses/IProductCategoryDetails.d.ts +0 -33
  95. package/dist/Types/Responses/IProductCategoryDetails.js +0 -13
  96. package/dist/Types/Responses/IProductIgnoreOnAllocationOutboundType.d.ts +0 -17
  97. package/dist/Types/Responses/IProductIgnoreOnAllocationOutboundType.js +0 -11
  98. package/dist/Types/Responses/IProductLocation.d.ts +0 -23
  99. package/dist/Types/Responses/IProductLocation.js +0 -17
  100. package/dist/Types/Responses/IResponse.d.ts +0 -8
  101. package/dist/Types/Responses/IResponse.js +0 -1
  102. package/dist/Types/Responses/IStockSortationMethodCustomer.d.ts +0 -18
  103. package/dist/Types/Responses/IStockSortationMethodCustomer.js +0 -12
  104. package/dist/Types/Responses/Pods/IAttributeTypeWithAI.d.ts +0 -8
  105. package/dist/Types/Responses/Pods/IAttributeTypeWithAI.js +0 -1
  106. package/dist/Types/Responses/Pods/IBatchType.d.ts +0 -5
  107. package/dist/Types/Responses/Pods/IBatchType.js +0 -1
  108. package/dist/Types/Responses/Pods/IDateType.d.ts +0 -6
  109. package/dist/Types/Responses/Pods/IDateType.js +0 -1
  110. package/dist/Types/Responses/Pods/IFillablePodLineAttribute.d.ts +0 -10
  111. package/dist/Types/Responses/Pods/IFillablePodLineAttribute.js +0 -9
  112. package/dist/Types/Responses/Pods/IFillablePodLineBatch.d.ts +0 -18
  113. package/dist/Types/Responses/Pods/IFillablePodLineBatch.js +0 -12
  114. package/dist/Types/Responses/Pods/IFillablePodLineDate.d.ts +0 -19
  115. package/dist/Types/Responses/Pods/IFillablePodLineDate.js +0 -13
  116. package/dist/Types/Responses/Pods/IFillablePodLinePurchaseOrder.d.ts +0 -18
  117. package/dist/Types/Responses/Pods/IFillablePodLinePurchaseOrder.js +0 -12
  118. package/dist/Types/Responses/Pods/IFillablePodLineSerial.d.ts +0 -18
  119. package/dist/Types/Responses/Pods/IFillablePodLineSerial.js +0 -12
  120. package/dist/Types/Responses/Pods/IFillablePodLineTag.d.ts +0 -18
  121. package/dist/Types/Responses/Pods/IFillablePodLineTag.js +0 -12
  122. package/dist/Types/Responses/Pods/IPurchaseOrderType.d.ts +0 -5
  123. package/dist/Types/Responses/Pods/IPurchaseOrderType.js +0 -1
  124. package/dist/Types/Responses/Pods/IRequiredOrValidatedAttribute.d.ts +0 -7
  125. package/dist/Types/Responses/Pods/IRequiredOrValidatedAttribute.js +0 -7
  126. package/dist/Types/Responses/Pods/IRequiredPodLineBatch.d.ts +0 -18
  127. package/dist/Types/Responses/Pods/IRequiredPodLineBatch.js +0 -8
  128. package/dist/Types/Responses/Pods/IRequiredPodLineDate.d.ts +0 -19
  129. package/dist/Types/Responses/Pods/IRequiredPodLineDate.js +0 -8
  130. package/dist/Types/Responses/Pods/IRequiredPodLinePurchaseOrder.d.ts +0 -19
  131. package/dist/Types/Responses/Pods/IRequiredPodLinePurchaseOrder.js +0 -8
  132. package/dist/Types/Responses/Pods/IRequiredPodLineSerial.d.ts +0 -19
  133. package/dist/Types/Responses/Pods/IRequiredPodLineSerial.js +0 -8
  134. package/dist/Types/Responses/Pods/IRequiredPodLineTag.d.ts +0 -19
  135. package/dist/Types/Responses/Pods/IRequiredPodLineTag.js +0 -8
  136. package/dist/Types/Responses/Pods/ISerialType.d.ts +0 -6
  137. package/dist/Types/Responses/Pods/ISerialType.js +0 -1
  138. package/dist/Types/Responses/Pods/ITagType.d.ts +0 -6
  139. package/dist/Types/Responses/Pods/ITagType.js +0 -1
  140. package/dist/Types/Responses/Pods/IValidatedPodLineAttribute.d.ts +0 -13
  141. package/dist/Types/Responses/Pods/IValidatedPodLineAttribute.js +0 -10
  142. package/dist/Types/Responses/Pods/IValidatedPodLineBatch.d.ts +0 -19
  143. package/dist/Types/Responses/Pods/IValidatedPodLineBatch.js +0 -10
  144. package/dist/Types/Responses/Pods/IValidatedPodLineDate.d.ts +0 -21
  145. package/dist/Types/Responses/Pods/IValidatedPodLineDate.js +0 -10
  146. package/dist/Types/Responses/Pods/IValidatedPodLinePurchaseOrder.d.ts +0 -20
  147. package/dist/Types/Responses/Pods/IValidatedPodLinePurchaseOrder.js +0 -10
  148. package/dist/Types/Responses/Pods/IValidatedPodLineSerial.d.ts +0 -20
  149. package/dist/Types/Responses/Pods/IValidatedPodLineSerial.js +0 -10
  150. package/dist/Types/Responses/Pods/IValidatedPodLineTag.d.ts +0 -20
  151. package/dist/Types/Responses/Pods/IValidatedPodLineTag.js +0 -10
  152. package/dist/Types/Responses/Products/IAttributeRule.d.ts +0 -34
  153. package/dist/Types/Responses/Products/IAttributeRule.js +0 -28
  154. package/dist/Types/Responses/Products/IBarcode.d.ts +0 -18
  155. package/dist/Types/Responses/Products/IBarcode.js +0 -12
  156. package/dist/Types/Responses/Products/IBatchRule.d.ts +0 -36
  157. package/dist/Types/Responses/Products/IBatchRule.js +0 -9
  158. package/dist/Types/Responses/Products/ICustomerRule.d.ts +0 -23
  159. package/dist/Types/Responses/Products/ICustomerRule.js +0 -17
  160. package/dist/Types/Responses/Products/IDateRule.d.ts +0 -36
  161. package/dist/Types/Responses/Products/IDateRule.js +0 -9
  162. package/dist/Types/Responses/Products/IPrice.d.ts +0 -19
  163. package/dist/Types/Responses/Products/IPrice.js +0 -12
  164. package/dist/Types/Responses/Products/IProduct.d.ts +0 -436
  165. package/dist/Types/Responses/Products/IProduct.js +0 -77
  166. package/dist/Types/Responses/Products/IProductKit.d.ts +0 -24
  167. package/dist/Types/Responses/Products/IProductKit.js +0 -18
  168. package/dist/Types/Responses/Products/IProductKitMatrix.d.ts +0 -13
  169. package/dist/Types/Responses/Products/IProductKitMatrix.js +0 -1
  170. package/dist/Types/Responses/Products/IProductSupplier.d.ts +0 -18
  171. package/dist/Types/Responses/Products/IProductSupplier.js +0 -12
  172. package/dist/Types/Responses/Products/IProductTag.d.ts +0 -33
  173. package/dist/Types/Responses/Products/IProductTag.js +0 -14
  174. package/dist/Types/Responses/Products/IProductTagType.d.ts +0 -18
  175. package/dist/Types/Responses/Products/IProductTagType.js +0 -12
  176. package/dist/Types/Responses/Products/IProductUnitOfMeasure.d.ts +0 -97
  177. package/dist/Types/Responses/Products/IProductUnitOfMeasure.js +0 -35
  178. package/dist/Types/Responses/Products/IProductUnitOfMeasurePrice.d.ts +0 -36
  179. package/dist/Types/Responses/Products/IProductUnitOfMeasurePrice.js +0 -17
  180. package/dist/Types/Responses/Products/IPurchaseOrderRule.d.ts +0 -36
  181. package/dist/Types/Responses/Products/IPurchaseOrderRule.js +0 -9
  182. package/dist/Types/Responses/Products/ISerialRule.d.ts +0 -36
  183. package/dist/Types/Responses/Products/ISerialRule.js +0 -9
  184. package/dist/Types/Responses/Products/ITagRule.d.ts +0 -36
  185. package/dist/Types/Responses/Products/ITagRule.js +0 -9
  186. package/dist/Types/Responses/Products/IUnitOfMeasure.d.ts +0 -18
  187. package/dist/Types/Responses/Products/IUnitOfMeasure.js +0 -12
@@ -1,7 +1,6 @@
1
1
  <svelte:options runes />
2
2
 
3
3
  <script module lang="ts">
4
- import { dev } from '$app/environment';
5
4
  import Button from '../../Button.svelte';
6
5
  import MultiSelect from '../../MultiSelect.svelte';
7
6
  import NumberInput from '../../NumberInput.svelte';
@@ -167,11 +166,7 @@
167
166
  value = (x ?? null) as SelectOption<string | number> | null;
168
167
  }
169
168
  } catch (e) {
170
- if (dev) {
171
- console.log(e);
172
- // eslint-disable-next-line no-debugger
173
- debugger;
174
- }
169
+ console.warn(e);
175
170
  }
176
171
  });
177
172
  } else if (def instanceof SelectDef) {
@@ -185,11 +180,7 @@
185
180
  });
186
181
  selectedOptions = x;
187
182
  } catch (e) {
188
- if (dev) {
189
- console.log(e);
190
- // eslint-disable-next-line no-debugger
191
- debugger;
192
- }
183
+ console.warn(e);
193
184
  }
194
185
  });
195
186
  } else if (isNumeric) {
@@ -221,11 +212,8 @@
221
212
  const gotValue = getFilteringStateValue();
222
213
  if (gotValue == null || typeof gotValue == 'string' || typeof gotValue == 'number') {
223
214
  value = gotValue;
224
- } else if (dev) {
225
- console.log(gotValue);
226
- // eslint-disable-next-line no-debugger
227
- debugger;
228
215
  } else {
216
+ console.log('unknown value type:', gotValue);
229
217
  value = gotValue as string; // HACK attempt to keep production running
230
218
  }
231
219
  }
@@ -248,11 +236,8 @@
248
236
  const gotValue = filterOption.value;
249
237
  if (gotValue == null || typeof gotValue == 'string' || typeof gotValue == 'number') {
250
238
  value = gotValue;
251
- } else if (dev) {
252
- console.log(gotValue);
253
- // eslint-disable-next-line no-debugger
254
- debugger;
255
239
  } else {
240
+ console.warn('unknown value type:', gotValue);
256
241
  value = gotValue as string; // HACK attempt to keep production running
257
242
  }
258
243
  }
@@ -336,8 +321,6 @@
336
321
  }}
337
322
  />
338
323
  {/if}
339
- {:else if dev}
340
- DEBUG: INVALID DATE FILTER VALUES
341
324
  {/if}
342
325
  {:else if def instanceof SelectDef && !isRemoteSelect}
343
326
  <div class="maxwidth">
@@ -388,8 +371,8 @@
388
371
  tableContext.__queryValues.set(label ?? _uuid, newValue);
389
372
  }}
390
373
  />
391
- {:else if dev}
392
- expected select option or null, got {typeof value}
374
+ {:else}
375
+ {@debug value}
393
376
  {/if}
394
377
  {:else}
395
378
  <MultiSelect
@@ -517,8 +500,8 @@
517
500
  e.stopPropagation();
518
501
  }}
519
502
  />
520
- {:else if dev}
521
- expected string, got {typeof value}
503
+ {:else}
504
+ {@debug value}
522
505
  {/if}
523
506
  </div>
524
507
  {:else}
@@ -554,8 +537,8 @@
554
537
  e.stopPropagation();
555
538
  }}
556
539
  />
557
- {:else if dev}
558
- expected string, got {typeof value}
540
+ {:else}
541
+ {@debug value}
559
542
  {/if}
560
543
  </div>
561
544
  {/if}
@@ -1,7 +1,6 @@
1
1
  <svelte:options runes />
2
2
 
3
3
  <script lang="ts" module>
4
- import { browser } from '$app/environment';
5
4
  import {
6
5
  ContextMenuContext,
7
6
  type IContextMenuOption
@@ -240,7 +239,7 @@
240
239
  const idToFocusTo = `#${tableContext.tableName}-cell-${fs.row}-${fs.id}`;
241
240
 
242
241
  tick().then(() => {
243
- if (idToFocusTo && browser) {
242
+ if (idToFocusTo) {
244
243
  (document.querySelector(idToFocusTo) as HTMLTableCellElement | undefined)?.focus();
245
244
  }
246
245
  });
@@ -1,5 +1,4 @@
1
1
  import { ColumnType } from '../ColumnType.js';
2
- import { dev } from '$app/environment';
3
2
  export class ColumnDef {
4
3
  constructor(props) {
5
4
  this.id = $derived(props.id);
@@ -53,8 +52,9 @@ export class ColumnDef {
53
52
  return this._isResizing;
54
53
  }
55
54
  set isResizing(v) {
56
- if (v && !this.resizable && dev) {
57
- throw new Error(`Column ${this.id} is not resizable`);
55
+ if (v && !this.resizable) {
56
+ console.warn(`Column ${this.id} is not resizable`);
57
+ return;
58
58
  }
59
59
  this._isResizing = v;
60
60
  }
@@ -63,8 +63,9 @@ export class ColumnDef {
63
63
  return this._visible;
64
64
  }
65
65
  set visible(v) {
66
- if (v && !this.enableSorting && dev) {
67
- throw new Error(`Column ${this.id} is not sortable`);
66
+ if (v && !this.enableSorting) {
67
+ console.warn(`Column ${this.id} is not sortable`);
68
+ return;
68
69
  }
69
70
  this._isResizing = v;
70
71
  }
@@ -1,4 +1,3 @@
1
- import { browser, dev } from '$app/environment';
2
1
  import { SvelteMap, SvelteSet } from 'svelte/reactivity';
3
2
  import { ColumnType } from '../Columns/ColumnType.js';
4
3
  import { ToolbarPosition } from '../Toolbar/ToolbarPosition.js';
@@ -36,9 +35,7 @@ export class TableContext {
36
35
  }
37
36
  // #region constructor
38
37
  constructor(INTERNAL_ONLY, defaultColumnDefs, tableName, dataRepo, allowCopy, enableResize, allowColumnReordering, allowQuickFiltering, allowAdvancedFiltering, toolbarPosition, displayFooter, selectionExtractor, getUserId, _onEditCell = async () => {
39
- if (dev) {
40
- throw new Error('Cannot edit immutable table');
41
- }
38
+ console.warn('Cannot edit immutable table');
42
39
  }) {
43
40
  this.defaultColumnDefs = defaultColumnDefs;
44
41
  this.tableName = tableName;
@@ -66,12 +63,10 @@ export class TableContext {
66
63
  // this.tableOptions.manualSorting = dataRepo.manualSorting;
67
64
  }
68
65
  this.userId = $derived(getUserId());
69
- if (browser) {
66
+ if (localStorage) {
70
67
  this._getUserDefaults();
71
68
  const removeInvalidPresets = () => {
72
- if (dev) {
73
- console.warn('invalid presets');
74
- }
69
+ console.warn('invalid presets');
75
70
  localStorage.removeItem(`${this.userId}-${tableName}-presets`);
76
71
  localStorage.removeItem(`${this.userId}-${tableName}-selected-preset-name`);
77
72
  const visibilityState = {};
@@ -877,9 +872,6 @@ export class TableContext {
877
872
  case 'Enter':
878
873
  case 'F2':
879
874
  if (!e.target?.classList?.contains('editable')) {
880
- if (dev) {
881
- console.log('not editable. cancelling...');
882
- }
883
875
  break;
884
876
  }
885
877
  e.preventDefault();
@@ -1014,7 +1006,7 @@ export class TableContext {
1014
1006
  : `#${this.tableName}-cell-quicksearch-${fs.id}`);
1015
1007
  this.showQuickFiltering = !this.showQuickFiltering;
1016
1008
  tick().then(() => {
1017
- if (idToFocusTo && browser) {
1009
+ if (idToFocusTo) {
1018
1010
  document.querySelector(idToFocusTo)?.focus();
1019
1011
  }
1020
1012
  });
@@ -1052,7 +1044,7 @@ export class TableContext {
1052
1044
  lastPage = $derived(this.dataRepo?.lastPage ?? 0);
1053
1045
  measureHeaderWidth = (columnDef) => {
1054
1046
  const label = columnDef.header;
1055
- if (typeof label === 'string' && browser) {
1047
+ if (typeof label === 'string' && localStorage) {
1056
1048
  const extraWidth = columnDef.enableSorting ? SORTING_ICON_WIDTH : 0;
1057
1049
  const canvasContext = getCanvasContext();
1058
1050
  if (canvasContext) {
@@ -1072,7 +1064,7 @@ export class TableContext {
1072
1064
  return 0;
1073
1065
  };
1074
1066
  autoResize = async (columnDef) => {
1075
- if (!browser) {
1067
+ if (!localStorage) {
1076
1068
  return;
1077
1069
  }
1078
1070
  const ctx = getCanvasContext();
@@ -1114,9 +1106,7 @@ export class TableContext {
1114
1106
  });
1115
1107
  const originalIndex = newDefs.findIndex((it) => it.id === this.dragTarget?.id);
1116
1108
  if (originalIndex === -1) {
1117
- if (dev) {
1118
- alert("couldn't find target's original index");
1119
- }
1109
+ console.warn("couldn't find target's original index");
1120
1110
  return newDefs;
1121
1111
  }
1122
1112
  newDefs.splice(originalIndex, 1);
@@ -1532,8 +1522,8 @@ export class TableContext {
1532
1522
  setSelectedPreset = (preset) => {
1533
1523
  this.columnDefs = preset.columnDefs;
1534
1524
  if (preset.sortingState) {
1535
- if (!this.paginationRepo?.updateSorting && dev) {
1536
- alert('no sorting state found');
1525
+ if (!this.paginationRepo?.updateSorting) {
1526
+ console.warn('no sorting state found');
1537
1527
  }
1538
1528
  this.paginationRepo?.updateSorting?.(preset.sortingState);
1539
1529
  }
@@ -1612,9 +1602,7 @@ export class TableContext {
1612
1602
  return;
1613
1603
  }
1614
1604
  if (!this.focusEnd) {
1615
- if (dev) {
1616
- console.warn('no current found');
1617
- }
1605
+ console.warn('no focusEnd found');
1618
1606
  return;
1619
1607
  }
1620
1608
  const rows = this.paginationRowModel.rows;
@@ -1626,9 +1614,7 @@ export class TableContext {
1626
1614
  }
1627
1615
  _moveFocusRow(offset) {
1628
1616
  if (!this.focusStart) {
1629
- if (dev) {
1630
- console.warn('no this.focusStart found');
1631
- }
1617
+ console.warn('no focusStart found');
1632
1618
  return null;
1633
1619
  }
1634
1620
  const newEndRowIndex = (() => {
@@ -1736,11 +1722,6 @@ export class TableContext {
1736
1722
  const startRowIndex = model?.rows.findIndex((row) => row.index === startRowIndexId) ?? -1;
1737
1723
  const endRowIndex = model?.rows.findIndex((row) => row.index === endRowIndexId) ?? -1;
1738
1724
  if (!this.dataRepo || startRowIndex == -1 || endRowIndex == -1) {
1739
- if (dev) {
1740
- console.warn('was missing one of the two indices');
1741
- // eslint-disable-next-line no-debugger
1742
- debugger;
1743
- }
1744
1725
  throw new Error(`copy was missing one of the two indices. First: ${startRowIndex}, second: ${endRowIndex}`);
1745
1726
  }
1746
1727
  const minRowIndex = Math.min(startRowIndex, endRowIndex);
@@ -15,7 +15,6 @@ export declare class LocalTableDataRepository<T extends object> extends TableDat
15
15
  private _isLoading;
16
16
  get isLoading(): boolean;
17
17
  set isLoading(v: boolean);
18
- readonly onPaginationChange: (...args: unknown[]) => void;
19
18
  private _dataRef;
20
19
  get data(): T[];
21
20
  private _lastPage;
@@ -1,4 +1,3 @@
1
- import { dev } from '$app/environment';
2
1
  import { FilterType } from '../Filtering/FilterType.js';
3
2
  import { NumberDateFilterMode } from '../Filtering/NumberDateFilterMode.js';
4
3
  import { StringFilterMode } from '../Filtering/StringFilterMode.js';
@@ -22,13 +21,6 @@ export class LocalTableDataRepository extends TableDataRepository {
22
21
  set isLoading(v) {
23
22
  this._isLoading = v;
24
23
  }
25
- onPaginationChange = (...args) => {
26
- if (dev) {
27
- // eslint-disable-next-line no-debugger
28
- debugger;
29
- console.log(args);
30
- }
31
- };
32
24
  _dataRef;
33
25
  get data() {
34
26
  return this._dataRef.value;
@@ -113,9 +105,6 @@ export class LocalTableDataRepository extends TableDataRepository {
113
105
  return;
114
106
  }
115
107
  const lastIndex = Math.ceil(this._dataRef.value.length / size) - 1;
116
- if (dev) {
117
- console.log(`changing page size. Page size is now ${size} and the last page index is ${lastIndex}`);
118
- }
119
108
  this.paginationState = {
120
109
  pageSize: size,
121
110
  pageIndex: Math.max(0, Math.min(this.paginationState.pageIndex, lastIndex))
@@ -166,9 +155,7 @@ export class LocalTableDataRepository extends TableDataRepository {
166
155
  return columnValue <= dateToTimestamp;
167
156
  }
168
157
  else {
169
- if (dev) {
170
- alert('no valid dateFrom or dateTo exist in filter');
171
- }
158
+ console.warn('no valid dateFrom or dateTo exist in filter');
172
159
  //should never happen
173
160
  }
174
161
  return true;
@@ -302,8 +289,8 @@ export class LocalTableDataRepository extends TableDataRepository {
302
289
  if (filterType === StringFilterMode.StartsWith) {
303
290
  return columnValue.startsWith(filterValue);
304
291
  }
305
- if (dev && filterType !== StringFilterMode.Contains) {
306
- throw new Error(`unhandled filter type value ${filterType}`);
292
+ if (filterType !== StringFilterMode.Contains) {
293
+ console.warn(`unhandled filter type value ${filterType}`);
307
294
  }
308
295
  //default
309
296
  return columnValue.includes(filterValue);
@@ -1,4 +1,3 @@
1
- import { browser, dev } from '$app/environment';
2
1
  import { SvelteMap } from 'svelte/reactivity';
3
2
  export class TableDataRepository {
4
3
  tableName;
@@ -17,7 +16,7 @@ export class TableDataRepository {
17
16
  set paginationState(v) {
18
17
  this._previouslyViewedPage = this._paginationState?.pageIndex;
19
18
  this._paginationState = v;
20
- if (browser) {
19
+ if (localStorage) {
21
20
  localStorage.setItem(`${this.getUserId()}-${this.tableName}-page-size`, v.pageSize.toString());
22
21
  }
23
22
  }
@@ -30,9 +29,7 @@ export class TableDataRepository {
30
29
  }
31
30
  filterModes = $state(new SvelteMap());
32
31
  _forceRefresh = $state(() => {
33
- if (dev) {
34
- console.warn('tried to force refresh without a callback registered');
35
- }
32
+ console.warn('tried to force refresh without a callback registered');
36
33
  });
37
34
  get forceRefresh() {
38
35
  return this._forceRefresh;
@@ -1,3 +1,2 @@
1
1
  import type { CustomFilter } from './CustomFilter.js';
2
- import type { CustomProxyFilter } from './CustomProxyFilter.js';
3
- export type CustomRemoteFilters = Map<string, CustomFilter | CustomProxyFilter>;
2
+ export type CustomRemoteFilters = Map<string, CustomFilter>;
@@ -1,4 +1,3 @@
1
- import { dev } from '$app/environment';
2
1
  import { Colour } from '../../../../scss/colours.js';
3
2
  import { Validity } from '../../../../Types/Internal/Validity.js';
4
3
  import { tick } from 'svelte';
@@ -128,10 +127,7 @@ export class TableFocusDetails {
128
127
  }
129
128
  }
130
129
  catch (e) {
131
- if (dev) {
132
- console.log(e);
133
- alert('validity error');
134
- }
130
+ console.warn('validity error:', e);
135
131
  return tick().then(() => {
136
132
  this.toastCallback(e);
137
133
  return [Validity.Valid, undefined];
@@ -2,7 +2,6 @@
2
2
 
3
3
  <script lang="ts" module>
4
4
  import { tick, type Snippet } from 'svelte';
5
- import { dev } from '$app/environment';
6
5
  import TouchModal from './TouchModal.svelte';
7
6
  import { passthrough } from '../../Helpers/Helpers.svelte.js';
8
7
  import { ColourSet } from '../../scss/colours.js';
@@ -183,10 +182,6 @@
183
182
  colourSet={isBeingEdited ? ColourSet.Primary : ColourSet.Secondary}
184
183
  onclick={() => {
185
184
  if (!allowOverride) {
186
- if (dev) {
187
- // eslint-disable-next-line no-debugger
188
- debugger;
189
- }
190
185
  return;
191
186
  }
192
187
  isBeingEdited = !isBeingEdited;
@@ -1,8 +1,7 @@
1
1
  <svelte:options runes />
2
2
 
3
3
  <script lang="ts" module>
4
- import type { Snippet } from 'svelte';
5
- import { browser } from '$app/environment';
4
+ import { onMount, type Snippet } from 'svelte';
6
5
  import { passthrough } from '../../Helpers/Helpers.svelte.js';
7
6
  import { ColourSet } from '../../scss/colours.js';
8
7
  import { Side } from '../../Types/Internal/Side.js';
@@ -44,12 +43,18 @@
44
43
  children
45
44
  }: UtilityButtonProps = $props();
46
45
 
46
+ let isMounted = $state(false);
47
+
48
+ onMount(() => {
49
+ isMounted = true;
50
+ });
47
51
  const size = $derived(
48
- (explicitSize ?? icon instanceof SVGSVGElement)
49
- ? Size.DoubleXLarge
50
- : (icon?.size ?? Size.DoubleXLarge)
52
+ isMounted
53
+ ? (explicitSize ?? icon instanceof SVGSVGElement)
54
+ ? Size.DoubleXLarge
55
+ : (icon?.size ?? Size.DoubleXLarge)
56
+ : Size.DoubleXLarge
51
57
  );
52
-
53
58
  let slotSpan: HTMLSpanElement | undefined = $state();
54
59
  </script>
55
60
 
@@ -73,7 +78,7 @@
73
78
  }}
74
79
  onkeydown={passthrough}
75
80
  >
76
- {#if browser && icon}
81
+ {#if isMounted && icon}
77
82
  <div
78
83
  class="expand"
79
84
  class:left={side == Side.Left}
@@ -1,4 +1,4 @@
1
- import type { Snippet } from 'svelte';
1
+ import { type Snippet } from 'svelte';
2
2
  import { ColourSet } from '../../scss/colours.js';
3
3
  import { Side } from '../../Types/Internal/Side.js';
4
4
  import { Size } from '../../Types/Internal/Size.js';
@@ -1,4 +1,5 @@
1
- import type { StringCallback, Unsubscriber } from '../Types/Internal/Misc.js';
1
+ export type StringCallback = (value: string) => boolean | void | Promise<boolean | void>;
2
+ import type { Unsubscriber } from '../Types/Internal/Misc.js';
2
3
  export declare class UntypedInputContext {
3
4
  static readonly identifier: unique symbol;
4
5
  private readonly registeredListeners;
@@ -1,32 +1,19 @@
1
- import { dev } from '$app/environment';
2
1
  export class UntypedInputContext {
3
2
  static identifier = Symbol();
4
3
  registeredListeners = [];
5
4
  registerListener = (listener) => {
6
- if (dev) {
7
- console.log('subscribing');
8
- }
9
5
  this.registeredListeners.push(listener);
10
6
  return () => {
11
7
  const foundListenerIndex = this.registeredListeners.findIndex((it) => it === listener);
12
8
  if (foundListenerIndex > -1) {
13
9
  this.registeredListeners.splice(foundListenerIndex, 1);
14
- if (dev) {
15
- console.log('successfully unsubscribed');
16
- }
17
10
  }
18
11
  else {
19
- if (dev) {
20
- alert('listener not found');
21
- console.log(`listeners: ${this.registeredListeners}, this listener: ${listener}`);
22
- }
12
+ console.warn(`listener not found. listeners: ${this.registeredListeners}, this listener: ${listener}`);
23
13
  }
24
14
  };
25
15
  };
26
16
  fire = async () => {
27
- if (dev) {
28
- console.log(`firing with ${this.untypedValue}`);
29
- }
30
17
  for (let i = this.registeredListeners.length - 1; i > -1; i--) {
31
18
  const shouldStop = await this.registeredListeners[i](this.untypedValue);
32
19
  if (shouldStop) {
@@ -60,9 +47,6 @@ export class UntypedInputContext {
60
47
  return;
61
48
  }
62
49
  if (e.key.length == 1) {
63
- if (dev) {
64
- console.log(`adding ${e.key}`);
65
- }
66
50
  this.untypedValue += e.key;
67
51
  }
68
52
  // else {
@@ -1,102 +1,28 @@
1
- import type { FloDate, InputDate, InputDateWithTime } from '../Types/Internal/Misc.js';
2
- import type { IResponse } from '../Types/Responses/IResponse.js';
3
- import type { Static, TSchema } from '@sinclair/typebox';
4
- import type { INamed } from './INamed.js';
5
- import type { IErrorResponse } from '../Types/Responses/IErrorResponse.js';
6
- import type { IPrinter } from '../Types/Responses/IPrinter.js';
7
- import type { ILaserPrinter } from '../Types/Responses/ILaserPrinter.js';
8
- import type { ILabelPrinter } from '../Types/Responses/ILabelPrinter.js';
9
- import type { ToastMessage } from '../Types/Internal/ToastMessage.js';
10
- import type { IFillablePodLineDate } from '../Types/Responses/Pods/IFillablePodLineDate.js';
11
- import type { IFillablePodLineAttribute } from '../Types/Responses/Pods/IFillablePodLineAttribute.js';
12
- import type { IValidatedPodLineAttribute } from '../Types/Responses/Pods/IValidatedPodLineAttribute.js';
1
+ import type { InputDate, InputDateWithTime, SQLDate } from '../Types/Internal/Misc.js';
13
2
  import type { RefWrapper } from '../Types/Internal/RefWrapper.js';
14
- export declare function capitalise(string: string): string;
15
3
  export declare function autoPluralise(text: string, quantity?: number, { capitalise }?: {
16
4
  capitalise?: boolean | undefined;
17
5
  }): string;
18
- export declare const utc: Intl.DateTimeFormat;
19
- export declare const local: Intl.DateTimeFormat;
20
- export declare function tomorrow(): Date;
21
- export declare function inputFriendly(date: FloDate | Date): InputDate;
22
- export declare function inputFriendlyWithTime(date: FloDate | Date): InputDateWithTime;
23
- export declare function floFriendly(date: InputDate | FloDate | Date): FloDate;
24
- /** @deprecated Use floFriendlyWithLocalTime() instead */
25
- export declare function floFriendlyWithTime(date: InputDate | FloDate | Date, timeDate?: InputDate | FloDate | Date | null): FloDate;
26
- export declare function floFriendlyWithLocalTime(date: InputDate | InputDateWithTime | FloDate | Date, timeDate?: InputDate | InputDateWithTime | FloDate | Date | null): FloDate;
27
- export declare function lastSec(): Date;
28
- export declare function isErrorResponse(error: unknown): error is IErrorResponse;
29
- export declare function isMessage(response: unknown): response is IResponse<string | string[]>;
30
- export declare function isThrowable(error: unknown): error is Error;
31
- export declare function getErrorMessage(error: unknown, includeUUID?: boolean): string;
32
- export declare function isValidEmailAddress(emailAddress: string): RegExpMatchArray | null;
33
- export declare function validateBarcodeCommand(value: string, allBarcodes: Set<string>, previousValue: string, hasDynamicParameter?: boolean): BarcodeValidationResult;
34
- export type BarcodeValidationResult = {
35
- shouldUpdate: false;
36
- isError: boolean;
37
- reason: ToastMessage;
38
- finalValue?: undefined;
39
- } | {
40
- shouldUpdate: boolean;
41
- isError: false;
42
- reason?: undefined;
43
- finalValue: string;
44
- };
45
- export declare function isValidLaserPrinter(printer: IPrinter): printer is ILaserPrinter;
46
- export declare function isValidLabelPrinter(printer: IPrinter): printer is ILabelPrinter;
47
- export declare const getLocalStorageStringOrDefault: (key: string, defaultValue: string) => string;
48
- export declare const getLocalStorageIntOrDefault: <T extends number>(key: string, defaultValue: T) => T;
49
- export declare const getLocalStorageFloatOrDefault: <T extends number>(key: string, defaultValue: T) => T;
50
- export declare const getLocalStorageBoolOrDefault: (key: string, defaultValue: boolean) => boolean;
51
- export declare const FormatAccountNames: (accounts: INamed[]) => string;
52
- export declare const FormatWarehouseNames: (accounts: INamed[]) => string;
53
- export declare function getCanvasContext(): CanvasRenderingContext2D;
54
- export declare function assertIsOnBrowser(): void;
55
- export declare function asyncMap<T, R>(array: Array<T>, asyncCallback: (item: T, index: number) => Promise<R>): Promise<Awaited<R>[]>;
56
- export declare function asyncForEach<T>(array: Array<T>, asyncCallback: (item: T, index: number) => Promise<void>): Promise<void>;
57
- export declare function asyncFlatMap<T, R>(array: Array<T>, asyncCallback: (item: T, index: number) => Promise<R>): Promise<(Awaited<R> extends infer T_1 ? T_1 extends Awaited<R> ? T_1 extends readonly (infer InnerArr)[] ? InnerArr : T_1 : never : never)[]>;
58
- export declare function asyncSome<T>(array: Array<T>, asyncCallback: (item: T, index: number) => Promise<boolean>): Promise<boolean>;
59
6
  export declare const vowels: Set<string>;
60
- export declare function assertUnreachable(_: never): never;
61
- export declare function isFocusable(item: HTMLElement): boolean;
62
- export declare function focusNextFocusable(element: HTMLElement): boolean;
63
- export declare const readonly: {
64
- readOnly: boolean;
65
- };
66
- export declare function assert<T extends TSchema>(schema: T, value: Static<T>): void;
67
- export declare function toFloFriendlyWithLocalTime(date: IFillablePodLineDate & {
68
- podValue?: FloDate | null;
69
- }): {
70
- value: FloDate | null;
71
- overwriteValue: boolean;
72
- _overwrittenValue: (string & {
73
- __brand: "FloDate";
74
- }) | null;
75
- type: "requiredAt" | "validateAt";
76
- dateType_id: import("../Types/Internal/Misc.js").PodLineDateTypeID;
77
- podValue?: FloDate | null;
78
- };
79
- /** @deprecated Use toFloFriendlyWithLocalTime() instead */
80
- export declare function toFloFriendlyWithTime(date: IFillablePodLineDate & {
81
- podValue?: FloDate | null;
82
- }): {
83
- value: FloDate | null;
84
- overwriteValue: boolean;
85
- _overwrittenValue: (string & {
86
- __brand: "FloDate";
87
- }) | null;
88
- type: "requiredAt" | "validateAt";
89
- dateType_id: import("../Types/Internal/Misc.js").PodLineDateTypeID;
90
- podValue?: FloDate | null;
91
- };
92
- export declare function saveBlob(blob: Blob, fileName: string): void;
93
- export declare function isAttributeMissing(item: IFillablePodLineAttribute): boolean;
94
- export declare function isAttributeInvalid(item: IValidatedPodLineAttribute): boolean;
95
- export declare function isAttributeDateInvalid(item: IValidatedPodLineAttribute): boolean;
96
- export type Milliseconds = number;
97
- export declare function asyncSleep(delay: Milliseconds): Promise<void>;
98
- export declare function getOrCreateDeviceUUID(): string;
99
- export declare function passthrough(e: KeyboardEvent): void;
100
- export declare function generateUUID<T extends string>(): T;
101
7
  export declare function generateShortUUID<T extends string>(): T;
8
+ export declare function generateUUID<T extends string>(): T;
102
9
  export declare function refWrapper<T>(initial: T): RefWrapper<T>;
10
+ export declare function SQLFriendly(date: InputDate | SQLDate | Date): SQLDate;
11
+ export declare function SQLFriendlyWithLocalTime(date: InputDate | InputDateWithTime | SQLDate | Date, timeDate?: InputDate | InputDateWithTime | SQLDate | Date | null): SQLDate;
12
+ export declare const localTimeFormat: Intl.DateTimeFormat;
13
+ export declare function passthrough(e: KeyboardEvent): void;
14
+ export declare function getCanvasContext(): CanvasRenderingContext2D;
15
+ interface IErrorResponse {
16
+ readonly errors: readonly {
17
+ code: string;
18
+ message: string;
19
+ originatingService: string;
20
+ }[] | string;
21
+ readonly payload: unknown;
22
+ readonly statusCode: number;
23
+ readonly uuid: string | null;
24
+ }
25
+ export declare function isErrorResponse(error: unknown): error is IErrorResponse;
26
+ export declare function getErrorMessage(error: unknown, includeUUID?: boolean): string;
27
+ export declare function isValidEmailAddress(emailAddress: string): RegExpMatchArray | null;
28
+ export {};