@jield/solodb-react-components 1.0.26 → 1.0.27

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,8 @@
1
+ export interface ScannerContext {
2
+ readingKeys: string;
3
+ readedKeys: string;
4
+ addCallbackFn: (id: string, fun: (readedKeys: string) => void) => void;
5
+ removeCallbackFn: (id: string) => void;
6
+ }
7
+ export declare const ScannerContext: import('react').Context<ScannerContext>;
8
+ export declare const useScannerContext: () => ScannerContext;
@@ -0,0 +1,4 @@
1
+ import { ReactElement } from 'react';
2
+ export declare const ScannerProvider: ({ children }: {
3
+ children: ReactElement;
4
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,3 @@
1
- import { default as React } from 'react';
2
1
  import { Run, RunStep, RunStepPart, RunPart } from '@jield/solodb-typescript-core';
3
2
  type Props = {
4
3
  run: Run;
@@ -6,9 +5,6 @@ type Props = {
6
5
  runStepParts?: RunStepPart[];
7
6
  runParts?: RunPart[];
8
7
  refetchFn?: () => void;
9
- toggleRunPartRef?: React.RefObject<{
10
- setPart: (part: number) => void;
11
- } | null>;
12
8
  };
13
- declare const RunPartsProductionRun: ({ run, runStep, runStepParts, runParts, refetchFn, toggleRunPartRef, }: Props) => import("react/jsx-runtime").JSX.Element;
9
+ declare const RunPartsProductionRun: ({ run, runStep, runStepParts, runParts, refetchFn, }: Props) => import("react/jsx-runtime").JSX.Element;
14
10
  export default RunPartsProductionRun;
@@ -1,4 +1,3 @@
1
- import { default as React } from 'react';
2
1
  import { Run, RunStep, RunStepPart, RunPart } from '@jield/solodb-typescript-core';
3
2
  type Props = {
4
3
  run: Run;
@@ -6,10 +5,6 @@ type Props = {
6
5
  runStepParts?: RunStepPart[];
7
6
  runParts?: RunPart[];
8
7
  refetchFn?: () => void;
9
- toggleRunPartRef?: React.RefObject<{
10
- setPart: (part: number) => void;
11
- setPartByLabel: (label: string) => void;
12
- } | null>;
13
8
  };
14
- declare const RunPartsQrFlow: ({ run, runStep, runStepParts, runParts, refetchFn, toggleRunPartRef }: Props) => import("react/jsx-runtime").JSX.Element;
9
+ declare const RunPartsQrFlow: ({ run, runStep, runStepParts, runParts, refetchFn }: Props) => import("react/jsx-runtime").JSX.Element;
15
10
  export default RunPartsQrFlow;
@@ -1,4 +1,3 @@
1
- import { RefObject } from 'react';
2
1
  import { Run, RunStep, RunStepPart } from '@jield/solodb-typescript-core';
3
2
  type Props = {
4
3
  run: Run;
@@ -6,9 +5,6 @@ type Props = {
6
5
  runStepParts?: RunStepPart[];
7
6
  editable?: boolean;
8
7
  refetchFn?: () => void;
9
- toggleRunStepPartRef?: RefObject<{
10
- setPart: (part: number) => void;
11
- } | null>;
12
8
  };
13
- declare const RunPartsResearchRun: ({ run: _run, runStep, runStepParts, editable, refetchFn, toggleRunStepPartRef, }: Props) => import("react/jsx-runtime").JSX.Element | null;
9
+ declare const RunPartsResearchRun: ({ run: _run, runStep, runStepParts, editable, refetchFn, }: Props) => import("react/jsx-runtime").JSX.Element | null;
14
10
  export default RunPartsResearchRun;
@@ -1,12 +1,7 @@
1
1
  import { Run, RunStep } from '@jield/solodb-typescript-core';
2
- import { default as React } from 'react';
3
- export default function RunStepExecuteMinimal({ run, runStep, showOnlyEmphasizedParameters, reloadRunStepFn, toggleRunPartRef, }: {
2
+ export default function RunStepExecuteMinimal({ run, runStep, showOnlyEmphasizedParameters, reloadRunStepFn, }: {
4
3
  run: Run;
5
4
  runStep: RunStep;
6
5
  showOnlyEmphasizedParameters: boolean;
7
6
  reloadRunStepFn: () => void;
8
- toggleRunPartRef?: React.RefObject<{
9
- setPart: (part: number) => void;
10
- setPartByLabel: (label: string) => void;
11
- } | null>;
12
7
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,10 +1,6 @@
1
- export interface UsePartSelectionOptions<T> {
2
- parts: T[];
3
- getPartId: (part: T) => number;
4
- toggleRef?: React.Ref<{
5
- setPart: (part: number) => void;
6
- setPartByLabel?: (label: string) => void;
7
- } | null>;
1
+ import { RunPart, RunStepPart } from '@jield/solodb-typescript-core';
2
+ export interface UsePartSelectionOptions {
3
+ parts: RunPart[] | RunStepPart[];
8
4
  }
9
5
  export interface UsePartSelectionResult {
10
6
  selectedParts: Map<number, boolean>;
@@ -16,7 +12,7 @@ export interface UsePartSelectionResult {
16
12
  /**
17
13
  * Hook for managing part selection state across RunParts components
18
14
  *
19
- * @param options Configuration object with parts array, ID getter, and optional ref
15
+ * @param options Configuration object with parts array, ID getter
20
16
  * @returns Object with selection state and control functions
21
17
  */
22
- export declare function usePartSelection<T>({ parts, getPartId, toggleRef, }: UsePartSelectionOptions<T>): UsePartSelectionResult;
18
+ export declare function usePartSelection({ parts }: UsePartSelectionOptions): UsePartSelectionResult;
@@ -0,0 +1,10 @@
1
+ import { Run } from '@jield/solodb-typescript-core';
2
+ export declare const enum FailStatus {
3
+ RunNotFound = "Run not found"
4
+ }
5
+ export default function useSelectRunWithScanner({ runsList, onFail, }: {
6
+ runsList: Run[];
7
+ onFail?: (status: FailStatus) => void;
8
+ }): {
9
+ selectedRun: Run | null;
10
+ };
@@ -1,13 +1,12 @@
1
- import { Dispatch, SetStateAction } from 'react';
1
+ import { ReactNode } from 'react';
2
2
  type NotificationVariant = "success" | "danger";
3
- export type NotificationType = {
4
- text: string;
5
- show: boolean;
6
- variant: NotificationVariant;
3
+ export type NotificationProps = {
4
+ notificationHeader: string;
5
+ notificationBody: string;
6
+ notificationType: NotificationVariant;
7
7
  };
8
- type NotificationProps = {
9
- notification: NotificationType;
10
- setNotification: Dispatch<SetStateAction<NotificationType>>;
11
- };
12
- export default function Notification({ notification, setNotification }: NotificationProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function notification(props: NotificationProps): void;
9
+ export declare function NotificationProvider({ children }: {
10
+ children: ReactNode;
11
+ }): import("react/jsx-runtime").JSX.Element;
13
12
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jield/solodb-react-components",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "type": "module",
5
5
  "repository": "jield-webdev/solodb-react-components",
6
6
  "main": "./dist/index.cjs",