@jield/solodb-react-components 1.0.28 → 1.0.29

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.
@@ -1,7 +1,8 @@
1
+ import { ScannedKeysType } from '../../../run/utils/parseScannerForRun';
1
2
  export interface ScannerContext {
2
3
  lastlyReadedKeys: string;
3
- addCallbackFn: (id: string, fun: (readedKeys: string) => void) => void;
4
- removeCallbackFn: (id: string) => void;
4
+ addCallbackFn: (type: ScannedKeysType, id: string, fun: (readedKeys: string) => void) => void;
5
+ removeCallbackFn: (type: ScannedKeysType, id: string) => void;
5
6
  addReadingCallbackFn: (id: string, fun: (readingKeys: string) => void) => void;
6
7
  removeReadingCallbackFn: (id: string) => void;
7
8
  }
@@ -1,8 +1,6 @@
1
- import { RunStep, RunStepPart, RunPart, Run } from '@jield/solodb-typescript-core';
2
- export default function StepDetails({ run, step, stepParts, parts, refetchFn, }: {
1
+ import { RunStep, Run } from '@jield/solodb-typescript-core';
2
+ export default function StepDetails({ run, step, refetchFn, }: {
3
3
  run?: Run;
4
4
  step: RunStep;
5
- stepParts: RunStepPart[];
6
- parts: RunPart[];
7
5
  refetchFn?: (keys: any[]) => void;
8
6
  }): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,14 @@
1
+ import { RunStepPartActionEnum } from '@jield/solodb-typescript-core';
2
+ export interface PartActionsDropdownProps {
3
+ availableActions: Set<RunStepPartActionEnum>;
4
+ onActionSelected: (action: RunStepPartActionEnum) => void;
5
+ showInitAction?: boolean;
6
+ onInitSelected?: () => void;
7
+ }
8
+ /**
9
+ * Dropdown component for bulk part actions
10
+ *
11
+ * Renders a dropdown menu with available actions (Start, Finish, Failed, Repair, Testing, Rework)
12
+ * and optionally an Init action for production runs.
13
+ */
14
+ export declare const PartActionsButtons: ({ availableActions, onActionSelected, showInitAction, onInitSelected, }: PartActionsDropdownProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -6,5 +6,5 @@ type Props = {
6
6
  runStepPartAction: RunStepPartActionEnum;
7
7
  }) => void;
8
8
  };
9
- declare const RunPartProductionActionsDropdown: ({ runStepPart, setRunStepPartAction }: Props) => import("react/jsx-runtime").JSX.Element;
10
- export default RunPartProductionActionsDropdown;
9
+ declare const RunPartProductionActionsButtons: ({ runStepPart, setRunStepPartAction }: Props) => import("react/jsx-runtime").JSX.Element;
10
+ export default RunPartProductionActionsButtons;
@@ -1,10 +1,8 @@
1
- import { Run, RunStep, RunStepPart, RunPart } from '@jield/solodb-typescript-core';
1
+ import { Run, RunStep } from '@jield/solodb-typescript-core';
2
2
  type Props = {
3
3
  run: Run;
4
4
  runStep: RunStep;
5
- runStepParts?: RunStepPart[];
6
- runParts?: RunPart[];
7
5
  refetchFn?: () => void;
8
6
  };
9
- declare const RunPartsQrFlow: ({ run, runStep, runStepParts, runParts, refetchFn }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ declare const RunPartsQrFlow: ({ run, runStep, refetchFn }: Props) => import("react/jsx-runtime").JSX.Element;
10
8
  export default RunPartsQrFlow;
@@ -1,10 +1,8 @@
1
- import { Run, RunPart, RunStep, RunStepPart } from '@jield/solodb-typescript-core';
1
+ import { Run, RunStep } from '@jield/solodb-typescript-core';
2
2
  type Props = {
3
3
  run: Run;
4
4
  runStep: RunStep;
5
- runStepParts?: RunStepPart[];
6
- runParts?: RunPart[];
7
5
  refetchFn?: () => void;
8
6
  };
9
- declare const RunPartsRegularFlow: ({ run, runStep, runStepParts, runParts, refetchFn }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ declare const RunPartsRegularFlow: ({ run, runStep, refetchFn }: Props) => import("react/jsx-runtime").JSX.Element;
10
8
  export default RunPartsRegularFlow;
@@ -6,6 +6,7 @@ export interface UsePartActionsOptions<T> {
6
6
  getPartId: (part: T) => number;
7
7
  getRunStepPart: (part: T) => RunStepPart | undefined;
8
8
  refetchFn?: () => void;
9
+ actionsFromScanner?: boolean;
9
10
  }
10
11
  export interface UsePartActionsResult {
11
12
  performActionToSelectedParts: (action: RunStepPartActionEnum) => void;
@@ -17,4 +18,4 @@ export interface UsePartActionsResult {
17
18
  * @param options Configuration object with parts, selection state, and action mappings
18
19
  * @returns Functions for performing and querying available actions
19
20
  */
20
- export declare function usePartActions<T>({ runStep, parts, selectedParts, getPartId, getRunStepPart, refetchFn, }: UsePartActionsOptions<T>): UsePartActionsResult;
21
+ export declare function usePartActions<T>({ runStep, parts, selectedParts, getPartId, getRunStepPart, refetchFn, actionsFromScanner, }: UsePartActionsOptions<T>): UsePartActionsResult;
@@ -0,0 +1,6 @@
1
+ export declare enum ScannedKeysType {
2
+ SELECT = 0,
3
+ PERFORM_ACTION = 1
4
+ }
5
+ export declare const PERFORM_ACTION_TRIGER = "_qr";
6
+ export default function parseScannerForRun(scannedKeys: string): ScannedKeysType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jield/solodb-react-components",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
4
4
  "type": "module",
5
5
  "repository": "jield-webdev/solodb-react-components",
6
6
  "main": "./dist/index.cjs",
@@ -27,7 +27,7 @@
27
27
  "coverage": "vitest run --coverage"
28
28
  },
29
29
  "dependencies": {
30
- "@jield/solodb-typescript-core": "^1.0.20",
30
+ "@jield/solodb-typescript-core": "^1.0.22",
31
31
  "@testing-library/dom": "^10.4.1",
32
32
  "moment": "^2.30.1",
33
33
  "moment-timezone": "^0.6.0",