@flowselections/scan-module 1.0.46 → 1.0.50

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.
@@ -0,0 +1,4 @@
1
+ export declare const CAMERA_FORMATS: readonly ["code_128", "code_39", "ean_13", "qr_code"];
2
+ export declare const CAMERA_PAUSE_MS = 1500;
3
+ export declare function cameraMagLezen(nu: number, pauzeTot: number, enabled: boolean): boolean;
4
+ //# sourceMappingURL=cameraScan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cameraScan.d.ts","sourceRoot":"","sources":["../../src/lib/cameraScan.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,uDAAwD,CAAC;AACpF,eAAO,MAAM,eAAe,OAAO,CAAC;AAEpC,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAEtF"}
@@ -0,0 +1,5 @@
1
+ export const CAMERA_FORMATS = ["code_128", "code_39", "ean_13", "qr_code"];
2
+ export const CAMERA_PAUSE_MS = 1500;
3
+ export function cameraMagLezen(nu, pauzeTot, enabled) {
4
+ return enabled && nu >= pauzeTot;
5
+ }
@@ -25,7 +25,7 @@ export async function metScanHerstel(actie, herstellen) {
25
25
  }
26
26
  }
27
27
  export function controleMelding(res) {
28
- const tekst = [res.melding, res.message, res.error].find((v) => typeof v === 'string' && v.trim());
28
+ const tekst = [res.printMelding, res.melding, res.message, res.error].find((v) => typeof v === 'string' && v.trim());
29
29
  if (typeof tekst === 'string')
30
30
  return tekst;
31
31
  if (res.status === 'afleverbrief_aangevraagd')
@@ -1 +1 @@
1
- {"version":3,"file":"stationNaam.d.ts","sourceRoot":"","sources":["../../src/lib/stationNaam.ts"],"names":[],"mappings":"AAIA,wBAAgB,eAAe,IAAI,MAAM,GAAG,IAAI,CAO/C;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAQjD"}
1
+ {"version":3,"file":"stationNaam.d.ts","sourceRoot":"","sources":["../../src/lib/stationNaam.ts"],"names":[],"mappings":"AAKA,wBAAgB,eAAe,IAAI,MAAM,GAAG,IAAI,CAU/C;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAajD"}
@@ -1,16 +1,25 @@
1
1
  // Naam van medewerker/station op dit apparaat (geen login nodig).
2
2
  // Wordt meegestuurd naar het scanlogboek en de kar-sessie.
3
3
  const SLEUTEL = "scan-station-naam";
4
+ let sessieNaam = null;
4
5
  export function leesStationNaam() {
5
6
  try {
6
- const w = window.localStorage.getItem(SLEUTEL);
7
- return w && w.trim() ? w.trim() : null;
7
+ const w = window.localStorage.getItem(SLEUTEL) ?? window.sessionStorage.getItem(SLEUTEL);
8
+ sessieNaam = w && w.trim() ? w.trim() : sessieNaam;
9
+ return sessieNaam;
8
10
  }
9
- catch {
10
- return null;
11
+ catch (error) {
12
+ console.warn("[scanner] stationopslag niet beschikbaar", error);
13
+ try {
14
+ return window.sessionStorage.getItem(SLEUTEL) ?? sessieNaam;
15
+ }
16
+ catch {
17
+ return sessieNaam;
18
+ }
11
19
  }
12
20
  }
13
21
  export function zetStationNaam(naam) {
22
+ sessieNaam = naam.trim() || null;
14
23
  try {
15
24
  const schoon = naam.trim();
16
25
  if (schoon)
@@ -18,7 +27,16 @@ export function zetStationNaam(naam) {
18
27
  else
19
28
  window.localStorage.removeItem(SLEUTEL);
20
29
  }
21
- catch {
22
- /* opslaan is optioneel */
30
+ catch (error) {
31
+ console.warn("[scanner] station alleen in sessie onthouden", error);
32
+ try {
33
+ if (sessieNaam)
34
+ window.sessionStorage.setItem(SLEUTEL, sessieNaam);
35
+ else
36
+ window.sessionStorage.removeItem(SLEUTEL);
37
+ }
38
+ catch (sessionError) {
39
+ console.warn("[scanner] station alleen op deze pagina onthouden", sessionError);
40
+ }
23
41
  }
24
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowselections/scan-module",
3
- "version": "1.0.46",
3
+ "version": "1.0.50",
4
4
  "flowselections": {
5
5
  "moduleId": "scan-module",
6
6
  "pages": [
@@ -76,7 +76,7 @@
76
76
  "@eslint/js": "^9.32.0",
77
77
  "@flowselections/core": "1.0.37",
78
78
  "@flowselections/layout-maker": "^1.7.3",
79
- "@lovable.dev/vite-tanstack-config": "2.26.5",
79
+ "@lovable.dev/vite-tanstack-config": "2.27.1",
80
80
  "@rsbuild/core": "^1.0.0",
81
81
  "@tailwindcss/vite": "^4.2.1",
82
82
  "@tanstack/react-query": "^5.83.0",