@jield/solodb-react-components 1.0.14 → 1.0.16

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 (20) hide show
  1. package/dist/index.cjs +24 -24
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.ts +1 -0
  4. package/dist/index.js +8424 -8244
  5. package/dist/index.js.map +1 -1
  6. package/dist/modules/run/components/shared/parts_table/element/partActionsDropdown.d.ts +14 -0
  7. package/dist/modules/run/components/shared/parts_table/element/partSelectionControls.d.ts +14 -0
  8. package/dist/modules/run/components/shared/{parts/runStepPartTableRow.d.ts → parts_table/element/runStepPartResearchTableRow.d.ts} +2 -2
  9. package/dist/modules/run/components/{step/view/element/parts → shared/parts_table}/runPartsProductionRun.d.ts +7 -2
  10. package/dist/modules/run/components/shared/parts_table/runPartsQrFlow.d.ts +14 -0
  11. package/dist/modules/run/components/{step/view/element/parts → shared/parts_table}/runPartsResearchRun.d.ts +5 -2
  12. package/dist/modules/run/components/shared/qr-scanner/selectRunWithQrScanner.d.ts +4 -2
  13. package/dist/modules/run/components/step/view/runStepExecuteMinimal.d.ts +8 -1
  14. package/dist/modules/run/hooks/run/parts/usePartActions.d.ts +20 -0
  15. package/dist/modules/run/hooks/run/parts/usePartSelection.d.ts +21 -0
  16. package/package.json +1 -1
  17. package/dist/utils/__tests__/datetime.test.d.ts +0 -1
  18. /package/dist/modules/run/components/{step/view/element/parts → shared/parts_table}/element/runPartProductionBadge.d.ts +0 -0
  19. /package/dist/modules/run/components/{step/view/element/parts → shared/parts_table}/element/runPartProductionTableRow.d.ts +0 -0
  20. /package/dist/modules/run/components/{step/view/element/parts → shared/parts_table}/element/runStepPartComment.d.ts +0 -0
@@ -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, Rework)
12
+ * and optionally an Init action for production runs.
13
+ */
14
+ export declare const PartActionsDropdown: ({ availableActions, onActionSelected, showInitAction, onInitSelected, }: PartActionsDropdownProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,14 @@
1
+ import { ReactNode } from 'react';
2
+ export interface PartSelectionControlsProps {
3
+ onSelectAll: () => void;
4
+ onSelectNone: () => void;
5
+ hasSelectedParts: boolean;
6
+ actionsDropdown?: ReactNode;
7
+ }
8
+ /**
9
+ * Control buttons for part selection (All/None) with optional actions dropdown
10
+ *
11
+ * Renders a button group for selecting/deselecting all parts,
12
+ * and conditionally displays an actions dropdown when parts are selected.
13
+ */
14
+ export declare const PartSelectionControls: ({ onSelectAll, onSelectNone, hasSelectedParts, actionsDropdown, }: PartSelectionControlsProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,9 @@
1
1
  import { RunStepPart } from '@jield/solodb-typescript-core';
2
- declare const RunStepPartTableRow: ({ runStepPart, editable, reloadFn, partIsSelected, setPartAsSelected, }: {
2
+ declare const RunStepPartResearchTableRow: ({ runStepPart, editable, reloadFn, partIsSelected, setPartAsSelected, }: {
3
3
  runStepPart: RunStepPart;
4
4
  editable?: boolean;
5
5
  reloadFn?: () => void;
6
6
  partIsSelected?: boolean;
7
7
  setPartAsSelected?: (partID: number) => void;
8
8
  }) => import("react/jsx-runtime").JSX.Element;
9
- export default RunStepPartTableRow;
9
+ export default RunStepPartResearchTableRow;
@@ -1,9 +1,14 @@
1
+ import { default as React } from 'react';
1
2
  import { Run, RunStep, RunStepPart, RunPart } from '@jield/solodb-typescript-core';
2
- declare const RunPartsProductionRun: ({ run, runStep, runStepParts, runParts, refetchFn, }: {
3
+ type Props = {
3
4
  run: Run;
4
5
  runStep: RunStep;
5
6
  runStepParts?: RunStepPart[];
6
7
  runParts?: RunPart[];
7
8
  refetchFn?: () => void;
8
- }) => import("react/jsx-runtime").JSX.Element;
9
+ toggleRunPartRef?: React.RefObject<{
10
+ setPart: (part: number) => void;
11
+ } | null>;
12
+ };
13
+ declare const RunPartsProductionRun: ({ run, runStep, runStepParts, runParts, refetchFn, toggleRunPartRef, }: Props) => import("react/jsx-runtime").JSX.Element;
9
14
  export default RunPartsProductionRun;
@@ -0,0 +1,14 @@
1
+ import { default as React } from 'react';
2
+ import { Run, RunStep, RunStepPart, RunPart } from '@jield/solodb-typescript-core';
3
+ type Props = {
4
+ run: Run;
5
+ runStep: RunStep;
6
+ runStepParts?: RunStepPart[];
7
+ runParts?: RunPart[];
8
+ refetchFn?: () => void;
9
+ toggleRunPartRef?: React.RefObject<{
10
+ setPart: (part: number) => void;
11
+ } | null>;
12
+ };
13
+ declare const RunPartsQrFlow: ({ run, runStep, runStepParts, runParts, refetchFn, toggleRunPartRef, }: Props) => import("react/jsx-runtime").JSX.Element;
14
+ export default RunPartsQrFlow;
@@ -1,10 +1,13 @@
1
1
  import { Run, RunStep, RunStepPart } from '@jield/solodb-typescript-core';
2
- type RunPartsResearchRunProps = {
2
+ type Props = {
3
3
  run: Run;
4
4
  runStep: RunStep;
5
5
  runStepParts?: RunStepPart[];
6
6
  editable?: boolean;
7
7
  refetchFn?: () => void;
8
+ toggleRunStepPartRef?: React.RefObject<{
9
+ setPart: (part: number) => void;
10
+ } | null>;
8
11
  };
9
- declare const RunPartsResearchRun: ({ run: _run, runStep, runStepParts, editable, refetchFn, }: RunPartsResearchRunProps) => import("react/jsx-runtime").JSX.Element | null;
12
+ declare const RunPartsResearchRun: ({ run: _run, runStep, runStepParts, editable, refetchFn, toggleRunStepPartRef, }: Props) => import("react/jsx-runtime").JSX.Element | null;
10
13
  export default RunPartsResearchRun;
@@ -1,5 +1,7 @@
1
1
  import { Run } from '@jield/solodb-typescript-core';
2
- export default function SelectRunWithQrScanner({ setRun, runsList }: {
3
- setRun: (run: Run) => void;
2
+ export default function NavigateInRunWithQrScanner({ runsList, setRun, setRunStepPartId, setRunPartId, }: {
4
3
  runsList: Run[];
4
+ setRun: (run: Run) => void;
5
+ setRunStepPartId?: (stepPart: number) => void;
6
+ setRunPartId?: (part: number) => void;
5
7
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,14 @@
1
1
  import { Run, RunStep } from '@jield/solodb-typescript-core';
2
- export default function RunStepExecuteMinimal({ run, runStep, showOnlyEmphasizedParameters, reloadRunStepFn, }: {
2
+ import { default as React } from 'react';
3
+ export default function RunStepExecuteMinimal({ run, runStep, showOnlyEmphasizedParameters, reloadRunStepFn, toggleRunStepPartRef, toggleRunPartRef, }: {
3
4
  run: Run;
4
5
  runStep: RunStep;
5
6
  showOnlyEmphasizedParameters: boolean;
6
7
  reloadRunStepFn: () => void;
8
+ toggleRunStepPartRef?: React.RefObject<{
9
+ setPart: (part: number) => void;
10
+ } | null>;
11
+ toggleRunPartRef?: React.RefObject<{
12
+ setPart: (part: number) => void;
13
+ } | null>;
7
14
  }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { RunStepPartActionEnum, RunStepPart, RunStep } from '@jield/solodb-typescript-core';
2
+ export interface UsePartActionsOptions<T> {
3
+ runStep: RunStep;
4
+ parts: T[];
5
+ selectedParts: Map<number, boolean>;
6
+ getPartId: (part: T) => number;
7
+ getRunStepPart: (part: T) => RunStepPart | undefined;
8
+ refetchFn?: () => void;
9
+ }
10
+ export interface UsePartActionsResult {
11
+ performActionToSelectedParts: (action: RunStepPartActionEnum) => void;
12
+ getAvailableActionsForSelection: () => Set<RunStepPartActionEnum>;
13
+ }
14
+ /**
15
+ * Hook for managing bulk actions on selected parts
16
+ *
17
+ * @param options Configuration object with parts, selection state, and action mappings
18
+ * @returns Functions for performing and querying available actions
19
+ */
20
+ export declare function usePartActions<T>({ runStep, parts, selectedParts, getPartId, getRunStepPart, refetchFn, }: UsePartActionsOptions<T>): UsePartActionsResult;
@@ -0,0 +1,21 @@
1
+ export interface UsePartSelectionOptions<T> {
2
+ parts: T[];
3
+ getPartId: (part: T) => number;
4
+ toggleRef?: React.RefObject<{
5
+ setPart: (part: number) => void;
6
+ } | null>;
7
+ }
8
+ export interface UsePartSelectionResult {
9
+ selectedParts: Map<number, boolean>;
10
+ setPartAsSelected: (partID: number) => void;
11
+ selectAllParts: () => void;
12
+ selectNoneParts: () => void;
13
+ hasSelectedParts: boolean;
14
+ }
15
+ /**
16
+ * Hook for managing part selection state across RunParts components
17
+ *
18
+ * @param options Configuration object with parts array, ID getter, and optional ref
19
+ * @returns Object with selection state and control functions
20
+ */
21
+ export declare function usePartSelection<T>({ parts, getPartId, toggleRef, }: UsePartSelectionOptions<T>): UsePartSelectionResult;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jield/solodb-react-components",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
4
4
  "type": "module",
5
5
  "repository": "jield-webdev/solodb-react-components",
6
6
  "main": "./dist/index.cjs",
@@ -1 +0,0 @@
1
- export {};