@jield/solodb-react-components 1.0.26 → 1.0.28

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 (24) hide show
  1. package/dist/index.cjs +24 -24
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.ts +4 -2
  4. package/dist/index.js +10400 -10442
  5. package/dist/index.js.map +1 -1
  6. package/dist/modules/core/contexts/scanner/ScannerContext.d.ts +9 -0
  7. package/dist/modules/core/contexts/scanner/ScannerProvider.d.ts +4 -0
  8. package/dist/modules/equipment/components/partial/moduleStatusElement.d.ts +1 -1
  9. package/dist/modules/run/components/shared/parts_table/element/partActionsDropdown.d.ts +1 -1
  10. package/dist/modules/run/components/shared/parts_table/element/partSelectionControls.d.ts +8 -1
  11. package/dist/modules/run/components/shared/parts_table/element/runPartProductionActionsButtons.d.ts +10 -0
  12. package/dist/modules/run/components/shared/parts_table/element/runPartProductionActionsDropdown.d.ts +11 -0
  13. package/dist/modules/run/components/shared/parts_table/element/runPartProductionTableRow.d.ts +7 -6
  14. package/dist/modules/run/components/shared/parts_table/runPartsQrFlow.d.ts +1 -6
  15. package/dist/modules/run/components/shared/parts_table/runPartsRegularFlow.d.ts +10 -0
  16. package/dist/modules/run/components/step/view/runStepExecuteMinimal.d.ts +1 -6
  17. package/dist/modules/run/hooks/run/parts/usePartSelection.d.ts +6 -9
  18. package/dist/modules/run/hooks/useSelectRunWithScanner.d.ts +10 -0
  19. package/dist/solodb-react-components.css +1 -1
  20. package/dist/utils/notification.d.ts +9 -10
  21. package/package.json +2 -2
  22. package/dist/modules/run/components/shared/parts_table/element/runStepPartResearchTableRow.d.ts +0 -9
  23. package/dist/modules/run/components/shared/parts_table/runPartsProductionRun.d.ts +0 -14
  24. package/dist/modules/run/components/shared/parts_table/runPartsResearchRun.d.ts +0 -14
@@ -0,0 +1,9 @@
1
+ export interface ScannerContext {
2
+ lastlyReadedKeys: string;
3
+ addCallbackFn: (id: string, fun: (readedKeys: string) => void) => void;
4
+ removeCallbackFn: (id: string) => void;
5
+ addReadingCallbackFn: (id: string, fun: (readingKeys: string) => void) => void;
6
+ removeReadingCallbackFn: (id: string) => void;
7
+ }
8
+ export declare const ScannerContext: import('react').Context<ScannerContext>;
9
+ 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,5 +1,5 @@
1
1
  import { EquipmentModule } from '@jield/solodb-typescript-core';
2
- export default function ModuleStatusElement({ module, refetchFn }: {
2
+ export default function ModuleStatusElement({ module, refetchFn, }: {
3
3
  module: EquipmentModule;
4
4
  refetchFn?: () => void;
5
5
  }): import("react/jsx-runtime").JSX.Element;
@@ -8,7 +8,7 @@ export interface PartActionsDropdownProps {
8
8
  /**
9
9
  * Dropdown component for bulk part actions
10
10
  *
11
- * Renders a dropdown menu with available actions (Start, Finish, Failed, Rework)
11
+ * Renders a dropdown menu with available actions (Start, Finish, Failed, Repair, Testing, Rework)
12
12
  * and optionally an Init action for production runs.
13
13
  */
14
14
  export declare const PartActionsDropdown: ({ availableActions, onActionSelected, showInitAction, onInitSelected, }: PartActionsDropdownProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -4,6 +4,13 @@ export interface PartSelectionControlsProps {
4
4
  onSelectNone: () => void;
5
5
  hasSelectedParts: boolean;
6
6
  actionsDropdown?: ReactNode;
7
+ traySelections?: {
8
+ id: number;
9
+ label: string;
10
+ partIds: number[];
11
+ allSelected: boolean;
12
+ }[];
13
+ onToggleTray?: (partIds: number[], nextSelected: boolean) => void;
7
14
  }
8
15
  /**
9
16
  * Control buttons for part selection (All/None) with optional actions dropdown
@@ -11,4 +18,4 @@ export interface PartSelectionControlsProps {
11
18
  * Renders a button group for selecting/deselecting all parts,
12
19
  * and conditionally displays an actions dropdown when parts are selected.
13
20
  */
14
- export declare const PartSelectionControls: ({ onSelectAll, onSelectNone, hasSelectedParts, actionsDropdown, }: PartSelectionControlsProps) => import("react/jsx-runtime").JSX.Element;
21
+ export declare const PartSelectionControls: ({ onSelectAll, onSelectNone, hasSelectedParts, actionsDropdown, traySelections, onToggleTray, }: PartSelectionControlsProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { RunStepPartActionEnum, RunStepPart } from '@jield/solodb-typescript-core';
2
+ type Props = {
3
+ runStepPart: RunStepPart;
4
+ setRunStepPartAction: ({ runStepPart, runStepPartAction, }: {
5
+ runStepPart: RunStepPart;
6
+ runStepPartAction: RunStepPartActionEnum;
7
+ }) => void;
8
+ };
9
+ declare const RunPartProductionActionsDropdown: ({ runStepPart, setRunStepPartAction }: Props) => import("react/jsx-runtime").JSX.Element;
10
+ export default RunPartProductionActionsDropdown;
@@ -0,0 +1,11 @@
1
+ import { RunStepPartActionEnum, RunStepPart } from '@jield/solodb-typescript-core';
2
+ type Props = {
3
+ runStepPart: RunStepPart;
4
+ createRunStepPart: () => void;
5
+ setRunStepPartAction: ({ runStepPart, runStepPartAction, }: {
6
+ runStepPart: RunStepPart;
7
+ runStepPartAction: RunStepPartActionEnum;
8
+ }) => void;
9
+ };
10
+ declare const RunPartProductionActionsDropdown: ({ runStepPart, setRunStepPartAction, createRunStepPart }: Props) => import("react/jsx-runtime").JSX.Element;
11
+ export default RunPartProductionActionsDropdown;
@@ -1,13 +1,14 @@
1
1
  import { RunPart, RunStepPart, RunStep } from '@jield/solodb-typescript-core';
2
- declare const RunStepPartProductionTableRow: ({ runPart, runStepParts, runStep, refetchFn, partIsSelected, setPartAsSelected, dropdown, layout, onRunStepPartUpdated, }: {
2
+ type Props = {
3
3
  runPart: RunPart;
4
+ partIsSelected?: boolean;
5
+ setPartAsSelected?: (partID: number) => void;
4
6
  runStepParts: RunStepPart[];
7
+ canInit: boolean;
5
8
  runStep: RunStep;
6
9
  refetchFn?: () => void;
7
- partIsSelected?: boolean;
8
- setPartAsSelected?: (partID: number) => void;
9
- dropdown?: boolean;
10
- layout?: "default" | "research";
10
+ dropdown: boolean;
11
11
  onRunStepPartUpdated?: (runStepPart: RunStepPart) => void;
12
- }) => import("react/jsx-runtime").JSX.Element;
12
+ };
13
+ declare const RunStepPartProductionTableRow: (props: Props) => import("react/jsx-runtime").JSX.Element | null;
13
14
  export default RunStepPartProductionTableRow;
@@ -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;
@@ -0,0 +1,10 @@
1
+ import { Run, RunPart, RunStep, RunStepPart } from '@jield/solodb-typescript-core';
2
+ type Props = {
3
+ run: Run;
4
+ runStep: RunStep;
5
+ runStepParts?: RunStepPart[];
6
+ runParts?: RunPart[];
7
+ refetchFn?: () => void;
8
+ };
9
+ declare const RunPartsRegularFlow: ({ run, runStep, runStepParts, runParts, refetchFn }: Props) => import("react/jsx-runtime").JSX.Element;
10
+ export default RunPartsRegularFlow;
@@ -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,14 +1,11 @@
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 } from '@jield/solodb-typescript-core';
2
+ export interface UsePartSelectionOptions {
3
+ parts: RunPart[];
8
4
  }
9
5
  export interface UsePartSelectionResult {
10
6
  selectedParts: Map<number, boolean>;
11
7
  setPartAsSelected: (partID: number) => void;
8
+ setPartsSelection: (partIDs: number[], nextSelected: boolean) => void;
12
9
  selectAllParts: () => void;
13
10
  selectNoneParts: () => void;
14
11
  hasSelectedParts: boolean;
@@ -16,7 +13,7 @@ export interface UsePartSelectionResult {
16
13
  /**
17
14
  * Hook for managing part selection state across RunParts components
18
15
  *
19
- * @param options Configuration object with parts array, ID getter, and optional ref
16
+ * @param options Configuration object with parts array, ID getter
20
17
  * @returns Object with selection state and control functions
21
18
  */
22
- export declare function usePartSelection<T>({ parts, getPartId, toggleRef, }: UsePartSelectionOptions<T>): UsePartSelectionResult;
19
+ 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 +1 @@
1
- .equipment_container{padding:10px;border:5px solid black;margin:10px}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;min-height:400px;padding:20px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0,0,0,.1);border-radius:50%;border-top:4px solid #0d6efd;animation:spin 1s linear infinite;margin-bottom:10px}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.tray-grid-group{display:flex;flex-direction:row;flex-wrap:nowrap;gap:20px;align-items:flex-start;overflow-x:auto;padding-bottom:4px}.tray-grid-wrapper{display:flex;flex-direction:column;gap:10px;flex:0 0 auto}.tray-grid__label{font-size:.85rem;color:#f1f3f5;background:#33383e;border-radius:10px;padding:8px 12px;text-align:center;letter-spacing:.2px}.tray-grid{--tray-columns: 1;--tray-rows: 1;--tray-gap: 10px;--tray-padding: 0px;--tray-cell-size: 25px;--tray-cell-radius: 5px;display:grid;grid-template-columns:repeat(var(--tray-columns),minmax(var(--tray-cell-size),1fr));grid-template-rows:repeat(var(--tray-rows),minmax(var(--tray-cell-size),1fr));gap:var(--tray-gap);padding:var(--tray-padding);background:transparent;border-radius:12px}.tray-grid[data-orientation=ttb]{grid-auto-flow:column}.tray-grid__cell{display:flex;align-items:center;justify-content:center;min-height:var(--tray-cell-size);min-width:var(--tray-cell-size);background:transparent;border:none;border-radius:var(--tray-cell-radius);font-size:.85rem;color:#f8f9fa;text-align:center;padding:0}.tray-grid__cell--empty{background:transparent}.tray-grid__cell--inactive{background:#3b4148}.tray-grid__cell-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tray-grid__badge{display:inline-flex;align-items:center;justify-content:center;width:100%;min-height:var(--tray-cell-size);min-width:var(--tray-cell-size);padding:0 6px;border-radius:var(--tray-cell-radius);color:#f8f9fa;background:#3b4148;text-align:center;line-height:1}.tray-grid__badge--init{font-size:.75rem;text-transform:none;background:#3b4148;border-color:#3b4148;color:#f8f9fa}.step-part-processed{background:#0ca04b;color:#f8f9fa}.step-part-started{background:#e28b22;color:#f8f9fa}.step-part-failed{background:#c11a1a;color:#f8f9fa}.step-part-failed-other{background:#7c0c0c;color:#f8f9fa}.step-part-inactive{background:#3b4148;color:#f8f9fa}.step-part-selected{box-shadow:0 0 0 2px #0d6efd59}
1
+ .equipment_container{padding:10px;border:5px solid black;margin:10px}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;min-height:400px;padding:20px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0,0,0,.1);border-radius:50%;border-top:4px solid #0d6efd;animation:spin 1s linear infinite;margin-bottom:10px}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.tray-grid-group{display:flex;flex-direction:row;flex-wrap:nowrap;gap:20px;align-items:flex-start;overflow-x:auto;padding-bottom:4px}.tray-grid-wrapper{display:flex;flex-direction:column;gap:10px;flex:0 0 auto}.tray-grid__label{font-size:.85rem;color:#f1f3f5;background:#33383e;border-radius:10px;padding:8px 12px;text-align:center;letter-spacing:.2px}.tray-grid{--tray-columns: 1;--tray-rows: 1;--tray-gap: 10px;--tray-padding: 0px;--tray-cell-size: 25px;--tray-cell-radius: 5px;display:grid;grid-template-columns:repeat(var(--tray-columns),minmax(var(--tray-cell-size),1fr));grid-template-rows:repeat(var(--tray-rows),minmax(var(--tray-cell-size),1fr));gap:var(--tray-gap);padding:var(--tray-padding);background:transparent;border-radius:12px}.tray-grid[data-orientation=ttb]{grid-auto-flow:column}.tray-grid__cell{display:flex;align-items:center;justify-content:center;min-height:var(--tray-cell-size);min-width:var(--tray-cell-size);background:transparent;border:none;border-radius:var(--tray-cell-radius);font-size:.85rem;color:#f8f9fa;text-align:center;padding:0}.tray-grid__cell--multi{flex-direction:column;justify-content:center;gap:4px}.tray-grid__cell--empty{background:transparent}.tray-grid__cell--inactive{background:#3b4148}.tray-grid__cell-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tray-grid__badge{display:inline-flex;align-items:center;justify-content:center;width:100%;min-height:var(--tray-cell-size);min-width:var(--tray-cell-size);padding:0 6px;border-radius:var(--tray-cell-radius);color:#f8f9fa;text-align:center;line-height:1}.tray-grid__badge--init{font-size:.75rem;text-transform:none;background:#3b4148;border-color:#3b4148;color:#f8f9fa}.step-part-processed{background:#0ca04b;color:#f8f9fa}.step-part-started{background:#e28b22;color:#f8f9fa}.step-part-failed{background:#c11a1a;color:#f8f9fa}.step-part-failed-other{background:#7c0c0c;color:#f8f9fa}.step-part-inactive{background:#3b4148;color:#f8f9fa}.step-part-selected{box-shadow:0 0 0 2px #0d6efd59}
@@ -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.28",
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.18",
30
+ "@jield/solodb-typescript-core": "^1.0.20",
31
31
  "@testing-library/dom": "^10.4.1",
32
32
  "moment": "^2.30.1",
33
33
  "moment-timezone": "^0.6.0",
@@ -1,9 +0,0 @@
1
- import { RunStepPart } from '@jield/solodb-typescript-core';
2
- declare const RunStepPartResearchTableRow: ({ runStepPart, editable, reloadFn, partIsSelected, setPartAsSelected, }: {
3
- runStepPart: RunStepPart;
4
- editable?: boolean;
5
- reloadFn?: () => void;
6
- partIsSelected?: boolean;
7
- setPartAsSelected?: (partID: number) => void;
8
- }) => import("react/jsx-runtime").JSX.Element;
9
- export default RunStepPartResearchTableRow;
@@ -1,14 +0,0 @@
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 RunPartsProductionRun: ({ run, runStep, runStepParts, runParts, refetchFn, toggleRunPartRef, }: Props) => import("react/jsx-runtime").JSX.Element;
14
- export default RunPartsProductionRun;
@@ -1,14 +0,0 @@
1
- import { RefObject } from 'react';
2
- import { Run, RunStep, RunStepPart } from '@jield/solodb-typescript-core';
3
- type Props = {
4
- run: Run;
5
- runStep: RunStep;
6
- runStepParts?: RunStepPart[];
7
- editable?: boolean;
8
- refetchFn?: () => void;
9
- toggleRunStepPartRef?: RefObject<{
10
- setPart: (part: number) => void;
11
- } | null>;
12
- };
13
- declare const RunPartsResearchRun: ({ run: _run, runStep, runStepParts, editable, refetchFn, toggleRunStepPartRef, }: Props) => import("react/jsx-runtime").JSX.Element | null;
14
- export default RunPartsResearchRun;