@lavalogic/scoria 0.38.15 → 0.39.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/README.md CHANGED
@@ -1,58 +1,58 @@
1
- # Svelte library
2
-
3
- Everything you need to build a Svelte library, powered by [`sv`](https://npmjs.com/package/sv).
4
-
5
- Read more about creating a library [in the docs](https://svelte.dev/docs/kit/packaging).
6
-
7
- ## Creating a project
8
-
9
- If you're seeing this, you've probably already done this step. Congrats!
10
-
11
- ```sh
12
- # create a new project in the current directory
13
- npx sv create
14
-
15
- # create a new project in my-app
16
- npx sv create my-app
17
- ```
18
-
19
- ## Developing
20
-
21
- Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
22
-
23
- ```sh
24
- npm run dev
25
-
26
- # or start the server and open the app in a new browser tab
27
- npm run dev -- --open
28
- ```
29
-
30
- Everything inside `src/lib` is part of your library, everything inside `src/routes` can be used as a showcase or preview app.
31
-
32
- ## Building
33
-
34
- To build your library:
35
-
36
- ```sh
37
- npm pack
38
- ```
39
-
40
- To create a production version of your showcase app:
41
-
42
- ```sh
43
- npm run build
44
- ```
45
-
46
- You can preview the production build with `npm run preview`.
47
-
48
- > To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
49
-
50
- ## Publishing
51
-
52
- Go into the `package.json` and give your package the desired name through the `"name"` option. Also consider adding a `"license"` field and point it to a `LICENSE` file which you can create from a template (one popular option is the [MIT license](https://opensource.org/license/mit/)).
53
-
54
- To publish your library to [npm](https://www.npmjs.com):
55
-
56
- ```sh
57
- npm publish
58
- ```
1
+ # Svelte library
2
+
3
+ Everything you need to build a Svelte library, powered by [`sv`](https://npmjs.com/package/sv).
4
+
5
+ Read more about creating a library [in the docs](https://svelte.dev/docs/kit/packaging).
6
+
7
+ ## Creating a project
8
+
9
+ If you're seeing this, you've probably already done this step. Congrats!
10
+
11
+ ```sh
12
+ # create a new project in the current directory
13
+ npx sv create
14
+
15
+ # create a new project in my-app
16
+ npx sv create my-app
17
+ ```
18
+
19
+ ## Developing
20
+
21
+ Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
22
+
23
+ ```sh
24
+ npm run dev
25
+
26
+ # or start the server and open the app in a new browser tab
27
+ npm run dev -- --open
28
+ ```
29
+
30
+ Everything inside `src/lib` is part of your library, everything inside `src/routes` can be used as a showcase or preview app.
31
+
32
+ ## Building
33
+
34
+ To build your library:
35
+
36
+ ```sh
37
+ npm pack
38
+ ```
39
+
40
+ To create a production version of your showcase app:
41
+
42
+ ```sh
43
+ npm run build
44
+ ```
45
+
46
+ You can preview the production build with `npm run preview`.
47
+
48
+ > To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
49
+
50
+ ## Publishing
51
+
52
+ Go into the `package.json` and give your package the desired name through the `"name"` option. Also consider adding a `"license"` field and point it to a `LICENSE` file which you can create from a template (one popular option is the [MIT license](https://opensource.org/license/mit/)).
53
+
54
+ To publish your library to [npm](https://www.npmjs.com):
55
+
56
+ ```sh
57
+ npm publish
58
+ ```
@@ -229,7 +229,12 @@
229
229
  let dragStartSlotIndex: number | null = $state(null);
230
230
  let dragEndSlotIndex: number | null = $state(null);
231
231
 
232
- function onSlotMouseDown(doorId: number, slotIndex: number): void {
232
+ function onSlotMouseDown(doorId: number, slotIndex: number, e: MouseEvent): void {
233
+ // Only start a drag-create on the primary (left) button. Otherwise a
234
+ // middle-click (autoscroll) or right-click would open the create modal.
235
+ if (e.button !== 0) {
236
+ return;
237
+ }
233
238
  if (!ondragcreate || appointmentDragStarted) {
234
239
  return;
235
240
  }
@@ -371,6 +376,11 @@
371
376
  let moveTargetSlotIndex: number | null = $state(null);
372
377
 
373
378
  function onAppointmentMouseDown(apt: CalendarAppointment, e: MouseEvent): void {
379
+ // Only react to the primary (left) button so middle/right clicks don't
380
+ // start a move or register as an appointment click.
381
+ if (e.button !== 0) {
382
+ return;
383
+ }
374
384
  if (!onappointmentmove) {
375
385
  return;
376
386
  }
@@ -664,8 +674,8 @@
664
674
  class:drag-selected={isSlotInDragRange(door.id, slotIdx)}
665
675
  class:move-target={isSlotInMoveTarget(door.id, slotIdx)}
666
676
  class:row-hover={hoveredSlotIndex === slotIdx}
667
- onmousedown={() => {
668
- onSlotMouseDown(door.id, slotIdx);
677
+ onmousedown={(e) => {
678
+ onSlotMouseDown(door.id, slotIdx, e);
669
679
  }}
670
680
  onmouseenter={() => {
671
681
  hoveredSlotIndex = slotIdx;
@@ -131,6 +131,14 @@ export declare class CustomRemoteRepository<TRow extends object> extends TableDa
131
131
  readonly setFilterMode: (id: string, mode: FilterMode | undefined) => void;
132
132
  readonly filterBy: (id: string, value: unknown) => void;
133
133
  readonly resetFilters: () => void;
134
+ /**
135
+ * Reset the current page to page 1 without touching `pageSize`. Used
136
+ * by every filter-mutation entrypoint so a fresh filter never leaves
137
+ * the user stranded on a page index that no longer exists once the
138
+ * remote re-query returns a smaller result set. Mirror of the helper
139
+ * on `BuiltInRemoteRepository`.
140
+ */
141
+ private resetToFirstPage;
134
142
  /** Jumps to the given 1-based page number, clamped at >= 1. */
135
143
  readonly setPage: (page: number) => void;
136
144
  /** Advances to the next page. */
@@ -403,6 +403,7 @@ export class CustomRemoteRepository extends TableDataRepository {
403
403
  else {
404
404
  this._filterModes.set(id, mode);
405
405
  }
406
+ this.resetToFirstPage();
406
407
  void this.reload();
407
408
  };
408
409
  filterBy = (id, value) => {
@@ -423,12 +424,34 @@ export class CustomRemoteRepository extends TableDataRepository {
423
424
  }
424
425
  }
425
426
  this._filtering = next;
427
+ // Any filter change should drop the user back on page 1; otherwise
428
+ // when typing in a filter while on page 2+ the new (smaller) result
429
+ // set leaves the pagination on an out-of-range page index. The user
430
+ // then sees "1 row" in the footer but the body is blank because
431
+ // the request still asks for `page=3` of a 1-page result set.
432
+ this.resetToFirstPage();
426
433
  void this.reload();
427
434
  };
428
435
  resetFilters = () => {
429
436
  this._filtering = [];
437
+ this.resetToFirstPage();
430
438
  void this.reload();
431
439
  };
440
+ /**
441
+ * Reset the current page to page 1 without touching `pageSize`. Used
442
+ * by every filter-mutation entrypoint so a fresh filter never leaves
443
+ * the user stranded on a page index that no longer exists once the
444
+ * remote re-query returns a smaller result set. Mirror of the helper
445
+ * on `BuiltInRemoteRepository`.
446
+ */
447
+ resetToFirstPage() {
448
+ if (this.paginationState.pageIndex !== 0) {
449
+ this.paginationState = {
450
+ ...this.paginationState,
451
+ pageIndex: 0,
452
+ };
453
+ }
454
+ }
432
455
  /** Jumps to the given 1-based page number, clamped at >= 1. */
433
456
  setPage = (page) => {
434
457
  this.paginationState = {
@@ -1,13 +1,13 @@
1
- <svelte:options runes />
2
-
3
- <script lang="ts">
4
- import { TestContext } from '../../Contexts/TestContext.svelte.js';
5
- import { getContext } from 'svelte';
6
-
7
- const testContext = getContext<TestContext>(TestContext.identifier);
8
- </script>
9
-
10
- <h1>counter 1: {testContext.value1.value}</h1>
11
- <p>Ref wrapper 1 is incremented every time you click the button</p>
12
- <h2>counter 2: {testContext.value2.value}</h2>
13
- <p>ref wrapper 2 adds ref wrapper 1's value every time ref wrapper 1's value is divisible by 3</p>
1
+ <svelte:options runes />
2
+
3
+ <script lang="ts">
4
+ import { TestContext } from '../../Contexts/TestContext.svelte.js';
5
+ import { getContext } from 'svelte';
6
+
7
+ const testContext = getContext<TestContext>(TestContext.identifier);
8
+ </script>
9
+
10
+ <h1>counter 1: {testContext.value1.value}</h1>
11
+ <p>Ref wrapper 1 is incremented every time you click the button</p>
12
+ <h2>counter 2: {testContext.value2.value}</h2>
13
+ <p>ref wrapper 2 adds ref wrapper 1's value every time ref wrapper 1's value is divisible by 3</p>
@@ -1,12 +1,12 @@
1
- @use './colours.scss';
2
-
3
- //border
4
- $border: solid 1px colours.$ui-blue-4;
5
- $border-mid: solid 2px colours.$ui-blue-4;
6
- $border-thick: solid 3px colours.$ui-blue-4;
7
-
8
- //box-shadow
9
- $table-focus: 0px 0px 1px 1px colours.$brand-primary inset;
10
-
11
- $box-shadow: 0px 0px 5px 0px #0002;
12
- $error-box-shadow: 0px 0px 5px 0px #aa141422;
1
+ @use './colours.scss';
2
+
3
+ //border
4
+ $border: solid 1px colours.$ui-blue-4;
5
+ $border-mid: solid 2px colours.$ui-blue-4;
6
+ $border-thick: solid 3px colours.$ui-blue-4;
7
+
8
+ //box-shadow
9
+ $table-focus: 0px 0px 1px 1px colours.$brand-primary inset;
10
+
11
+ $box-shadow: 0px 0px 5px 0px #0002;
12
+ $error-box-shadow: 0px 0px 5px 0px #aa141422;
@@ -1,134 +1,134 @@
1
- $transparent-0: rgba(0, 0, 0, 0);
2
- $transparent-10: rgba(0, 0, 0, 0.1);
3
- $transparent-20: rgba(0, 0, 0, 0.2);
4
-
5
- $ui-black: #000000;
6
- $ui-white: #ffffff;
7
- $purple: #9b51e0; // For Testing
8
-
9
- $ui-blue-1: #f4f7f9;
10
- $ui-blue-2: #e9ecf1;
11
- $ui-blue-3: #dae0e5;
12
- $ui-blue-4: #cbd4da; // Standard Border Colour
13
- $ui-blue-5: #bcc8d0;
14
- $ui-blue-6: #adbbc5;
15
- $ui-blue-7: #9eafba;
16
- $ui-blue-8: #8fa3b0;
17
- $ui-blue-9: #8096a5; // Font Disabled
18
- $ui-blue-10: #718a9b;
19
- $ui-blue-11: #647d8e; // Font Secondary
20
- $ui-blue-12: #5a707f;
21
- $ui-blue-13: #4f6370;
22
- $ui-blue-14: #455661;
23
- $ui-blue-15: #3a4952; // Font Primary
24
- $ui-blue-16: #2f3b43;
25
- $ui-blue-17: #252e34;
26
- $ui-blue-18: #1a2125;
27
- $ui-blue-19: #101416;
28
- $ui-blue-20: #050707;
29
-
30
- $primary-blue-1: #f4fbfd;
31
- $primary-blue-2: #e6f8fd;
32
- $primary-blue-3: #caeaf5;
33
- $primary-blue-4: #b4e2f0;
34
- $primary-blue-5: #9fdaec;
35
- $primary-blue-6: #8ad1e8;
36
- $primary-blue-7: #74c9e4;
37
- $primary-blue-8: #5fc1e0;
38
- $primary-blue-9: #49b8dc;
39
- $primary-blue-10: #34b0d8;
40
- $primary-blue-11: #259fc7; // Brand Primary
41
- $primary-blue-12: #2392b5;
42
- $primary-blue-13: #1f81a0; // Brand Dark
43
- $primary-blue-14: #1b708b;
44
- $primary-blue-15: #175f75;
45
- $primary-blue-16: #134d60;
46
- $primary-blue-17: #0f3c4b;
47
- $primary-blue-18: #0a2b35;
48
- $primary-blue-19: #061a20;
49
- $primary-blue-20: #02090b;
50
-
51
- $primary-background: #edfaff;
52
- $brand-primary: #259fc7;
53
- $brand-dark: #1f81a0;
54
- $brand-dark-transparent-20: rgba(31, 129, 160, 0.2);
55
- $brand-dark-transparent-40: rgba(31, 129, 160, 0.4);
56
-
57
- $font-primary: #3a4952;
58
- $font-secondary-heading: #46525b;
59
- $font-secondary: #647d8e;
60
- $font-disabled: #8096a5;
61
-
62
- $error: #c31818;
63
- $error-border: #aa1414;
64
- $error-background: #f9e9e9;
65
- $warning: #f8eab8;
66
- $warning-border: #e7b500;
67
-
68
- $allocated-background: #e7b100;
69
- $in-picking-background: #ec58c3;
70
- $in-picking-colour: #720653;
71
- $picked-background: #bd2e95;
72
- $in-sorting-background: #b259ea;
73
- $in-sorting-colour: #560985;
74
- $sorted-background: #9032ca;
75
- $in-kitting-background: #9d85fc;
76
- $in-kitting-colour: #4129a4;
77
- $kitted-background: #6e51e0;
78
- $in-packing-background: #8ab1df;
79
- $in-packing-colour: #103977;
80
- $packed-background: #3e6eb5;
81
- $in-marshalling-background: #8ad0df;
82
- $in-marshalling-colour: #13758a;
83
- $marshalled-background: #3ea0b5;
84
- $in-loading-background: #8adfc8;
85
- $in-loading-colour: #126a51;
86
- $loaded-background: #3eb592;
87
- $in-despatch-background: #7bbc6f;
88
- $in-despatch-colour: #104c05;
89
- $despatched-background: #2f921d;
90
-
91
- // Borders are $ui-blue-4
92
-
93
- // $ui-two: #ececec;
94
- // $ui-three: #c0c0c0;
95
- // $ui-four: #515b65;
96
- // $ui-four: #9B51E0;
97
- // $ui-seven: #d5dbe0;
98
- // $ui-eight: #fcfcfc;
99
- // $ui-grey: #c0c8ce;
100
- // $main: #54636d;
101
- $alt: #8f989e;
102
- // $background-light: #dce1e5;
103
- // $background: #f6f7f8;
104
- // $background-dark: #e8ebed;
105
- // $dark-blue: #3888c1;
106
- // $primary: #2f97ba;
107
- // $info-text: #0e82ae;
108
- // $info-light-text: #6ac1e8;
109
- // $primary-dark: #0e7598;
110
- // $primary-hover: hsl(205, 55%, 35%);
111
- // $brand-one: #4db0da;
112
- // $brand-two: #18769d;
113
- // $shipments: #129acd;
114
- // $progress: #259abf;
115
-
116
- // $dark-blue-transparent: rgba(56, 136, 193, 0.2);
117
- // $dark-blue-semi-transparent: rgba(56, 136, 193, 0.4);
118
- // $secondary: #4f5a63;
119
- // $info-background: #d6effa;
120
- // $info-light-background: #f3f9fb;
121
- // $hovered: rgba(166, 167, 168, 0.369);
122
- // $white: #fff;
123
- // $light-border: #ced2d6;
124
- // $state-info: #e8f6fd;
125
- // $state-info--alt: #f9fdff;
126
- // $ui-dark-opacity: rgba(0, 0, 0, 0.2);
127
- // $info-text-text: #525252;
128
- // $info-text-background: #f6fcfe;
129
- // $marked: #e8f6fd;
130
- // $marked: #f9fdff;
131
- // $side-menu-background: #eef1f3;
132
- // $label: #6d7883;
133
- // $warehouse-bubble: #c3cad3;
134
- // $warning: rgba(231, 181, 0, 0.228);
1
+ $transparent-0: rgba(0, 0, 0, 0);
2
+ $transparent-10: rgba(0, 0, 0, 0.1);
3
+ $transparent-20: rgba(0, 0, 0, 0.2);
4
+
5
+ $ui-black: #000000;
6
+ $ui-white: #ffffff;
7
+ $purple: #9b51e0; // For Testing
8
+
9
+ $ui-blue-1: #f4f7f9;
10
+ $ui-blue-2: #e9ecf1;
11
+ $ui-blue-3: #dae0e5;
12
+ $ui-blue-4: #cbd4da; // Standard Border Colour
13
+ $ui-blue-5: #bcc8d0;
14
+ $ui-blue-6: #adbbc5;
15
+ $ui-blue-7: #9eafba;
16
+ $ui-blue-8: #8fa3b0;
17
+ $ui-blue-9: #8096a5; // Font Disabled
18
+ $ui-blue-10: #718a9b;
19
+ $ui-blue-11: #647d8e; // Font Secondary
20
+ $ui-blue-12: #5a707f;
21
+ $ui-blue-13: #4f6370;
22
+ $ui-blue-14: #455661;
23
+ $ui-blue-15: #3a4952; // Font Primary
24
+ $ui-blue-16: #2f3b43;
25
+ $ui-blue-17: #252e34;
26
+ $ui-blue-18: #1a2125;
27
+ $ui-blue-19: #101416;
28
+ $ui-blue-20: #050707;
29
+
30
+ $primary-blue-1: #f4fbfd;
31
+ $primary-blue-2: #e6f8fd;
32
+ $primary-blue-3: #caeaf5;
33
+ $primary-blue-4: #b4e2f0;
34
+ $primary-blue-5: #9fdaec;
35
+ $primary-blue-6: #8ad1e8;
36
+ $primary-blue-7: #74c9e4;
37
+ $primary-blue-8: #5fc1e0;
38
+ $primary-blue-9: #49b8dc;
39
+ $primary-blue-10: #34b0d8;
40
+ $primary-blue-11: #259fc7; // Brand Primary
41
+ $primary-blue-12: #2392b5;
42
+ $primary-blue-13: #1f81a0; // Brand Dark
43
+ $primary-blue-14: #1b708b;
44
+ $primary-blue-15: #175f75;
45
+ $primary-blue-16: #134d60;
46
+ $primary-blue-17: #0f3c4b;
47
+ $primary-blue-18: #0a2b35;
48
+ $primary-blue-19: #061a20;
49
+ $primary-blue-20: #02090b;
50
+
51
+ $primary-background: #edfaff;
52
+ $brand-primary: #259fc7;
53
+ $brand-dark: #1f81a0;
54
+ $brand-dark-transparent-20: rgba(31, 129, 160, 0.2);
55
+ $brand-dark-transparent-40: rgba(31, 129, 160, 0.4);
56
+
57
+ $font-primary: #3a4952;
58
+ $font-secondary-heading: #46525b;
59
+ $font-secondary: #647d8e;
60
+ $font-disabled: #8096a5;
61
+
62
+ $error: #c31818;
63
+ $error-border: #aa1414;
64
+ $error-background: #f9e9e9;
65
+ $warning: #f8eab8;
66
+ $warning-border: #e7b500;
67
+
68
+ $allocated-background: #e7b100;
69
+ $in-picking-background: #ec58c3;
70
+ $in-picking-colour: #720653;
71
+ $picked-background: #bd2e95;
72
+ $in-sorting-background: #b259ea;
73
+ $in-sorting-colour: #560985;
74
+ $sorted-background: #9032ca;
75
+ $in-kitting-background: #9d85fc;
76
+ $in-kitting-colour: #4129a4;
77
+ $kitted-background: #6e51e0;
78
+ $in-packing-background: #8ab1df;
79
+ $in-packing-colour: #103977;
80
+ $packed-background: #3e6eb5;
81
+ $in-marshalling-background: #8ad0df;
82
+ $in-marshalling-colour: #13758a;
83
+ $marshalled-background: #3ea0b5;
84
+ $in-loading-background: #8adfc8;
85
+ $in-loading-colour: #126a51;
86
+ $loaded-background: #3eb592;
87
+ $in-despatch-background: #7bbc6f;
88
+ $in-despatch-colour: #104c05;
89
+ $despatched-background: #2f921d;
90
+
91
+ // Borders are $ui-blue-4
92
+
93
+ // $ui-two: #ececec;
94
+ // $ui-three: #c0c0c0;
95
+ // $ui-four: #515b65;
96
+ // $ui-four: #9B51E0;
97
+ // $ui-seven: #d5dbe0;
98
+ // $ui-eight: #fcfcfc;
99
+ // $ui-grey: #c0c8ce;
100
+ // $main: #54636d;
101
+ $alt: #8f989e;
102
+ // $background-light: #dce1e5;
103
+ // $background: #f6f7f8;
104
+ // $background-dark: #e8ebed;
105
+ // $dark-blue: #3888c1;
106
+ // $primary: #2f97ba;
107
+ // $info-text: #0e82ae;
108
+ // $info-light-text: #6ac1e8;
109
+ // $primary-dark: #0e7598;
110
+ // $primary-hover: hsl(205, 55%, 35%);
111
+ // $brand-one: #4db0da;
112
+ // $brand-two: #18769d;
113
+ // $shipments: #129acd;
114
+ // $progress: #259abf;
115
+
116
+ // $dark-blue-transparent: rgba(56, 136, 193, 0.2);
117
+ // $dark-blue-semi-transparent: rgba(56, 136, 193, 0.4);
118
+ // $secondary: #4f5a63;
119
+ // $info-background: #d6effa;
120
+ // $info-light-background: #f3f9fb;
121
+ // $hovered: rgba(166, 167, 168, 0.369);
122
+ // $white: #fff;
123
+ // $light-border: #ced2d6;
124
+ // $state-info: #e8f6fd;
125
+ // $state-info--alt: #f9fdff;
126
+ // $ui-dark-opacity: rgba(0, 0, 0, 0.2);
127
+ // $info-text-text: #525252;
128
+ // $info-text-background: #f6fcfe;
129
+ // $marked: #e8f6fd;
130
+ // $marked: #f9fdff;
131
+ // $side-menu-background: #eef1f3;
132
+ // $label: #6d7883;
133
+ // $warehouse-bubble: #c3cad3;
134
+ // $warning: rgba(231, 181, 0, 0.228);
@@ -1,8 +1,8 @@
1
- $transition-length: 0.15s;
2
- $transition-delay: 0s;
3
-
4
- $colours:
5
- border-color ease-out $transition-length $transition-delay,
6
- background-color ease-out $transition-length $transition-delay,
7
- color ease-out $transition-length $transition-delay,
8
- fill ease-out $transition-length $transition-delay;
1
+ $transition-length: 0.15s;
2
+ $transition-delay: 0s;
3
+
4
+ $colours:
5
+ border-color ease-out $transition-length $transition-delay,
6
+ background-color ease-out $transition-length $transition-delay,
7
+ color ease-out $transition-length $transition-delay,
8
+ fill ease-out $transition-length $transition-delay;
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.38.15",
4
+ "version": "0.39.0",
5
5
  "publishConfig": {
6
6
  "access": "restricted"
7
7
  },