@jield/solodb-react-components 1.0.15 → 1.0.17

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 (19) hide show
  1. package/dist/index.cjs +24 -24
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +9628 -9500
  4. package/dist/index.js.map +1 -1
  5. package/dist/modules/equipment/components/setup/equipmentTable.d.ts +2 -1
  6. package/dist/modules/equipment/components/setup/selectedEquipmentTable.d.ts +1 -4
  7. package/dist/modules/run/components/shared/parts_table/element/partActionsDropdown.d.ts +14 -0
  8. package/dist/modules/run/components/shared/parts_table/element/partSelectionControls.d.ts +14 -0
  9. package/dist/modules/run/components/shared/{parts/runStepPartTableRow.d.ts → parts_table/element/runStepPartResearchTableRow.d.ts} +2 -2
  10. package/dist/modules/run/components/shared/parts_table/runPartsQrFlow.d.ts +14 -0
  11. package/dist/modules/run/hooks/run/parts/usePartActions.d.ts +20 -0
  12. package/dist/modules/run/hooks/run/parts/usePartSelection.d.ts +21 -0
  13. package/package.json +1 -1
  14. package/dist/utils/__tests__/datetime.test.d.ts +0 -1
  15. /package/dist/modules/run/components/{step/view/element/parts → shared/parts_table}/element/runPartProductionBadge.d.ts +0 -0
  16. /package/dist/modules/run/components/{step/view/element/parts → shared/parts_table}/element/runPartProductionTableRow.d.ts +0 -0
  17. /package/dist/modules/run/components/{step/view/element/parts → shared/parts_table}/element/runStepPartComment.d.ts +0 -0
  18. /package/dist/modules/run/components/{step/view/element/parts → shared/parts_table}/runPartsProductionRun.d.ts +0 -0
  19. /package/dist/modules/run/components/{step/view/element/parts → shared/parts_table}/runPartsResearchRun.d.ts +0 -0
@@ -1,9 +1,10 @@
1
1
  import { Dispatch, SetStateAction } from 'react';
2
2
  import { Equipment, FilterData } from '@jield/solodb-typescript-core';
3
- export default function EquipmentTable({ equipmentList, currentFilter, setEquipmentSort, addEquipment, }: {
3
+ export default function EquipmentTable({ equipmentList, currentFilter, setEquipmentSort, addEquipment, addDisabled, }: {
4
4
  equipmentList: Equipment[];
5
5
  currentFilter: FilterData | undefined;
6
6
  addEquipment: (equipment: Equipment) => void;
7
+ addDisabled?: boolean;
7
8
  setEquipmentSort: Dispatch<SetStateAction<{
8
9
  order: string;
9
10
  direction?: "asc" | "desc";
@@ -1,8 +1,5 @@
1
- import { Setup } from '@jield/solodb-typescript-core/dist/equipment/interfaces/setup';
2
1
  import { Equipment } from '@jield/solodb-typescript-core';
3
- export default function SelectedEquipmentTable({ setup, equipmentList, removeEquipment, refetchQueries, }: {
4
- setup: Setup;
2
+ export default function SelectedEquipmentTable({ equipmentList, removeEquipment, }: {
5
3
  equipmentList: Equipment[];
6
4
  removeEquipment: (equipment: Equipment) => void;
7
- refetchQueries: (key: any[]) => void;
8
5
  }): import("react/jsx-runtime").JSX.Element;
@@ -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;
@@ -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;
@@ -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.15",
3
+ "version": "1.0.17",
4
4
  "type": "module",
5
5
  "repository": "jield-webdev/solodb-react-components",
6
6
  "main": "./dist/index.cjs",
@@ -1 +0,0 @@
1
- export {};