@jield/solodb-react-components 1.0.12 → 1.0.14

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,17 @@
1
+ import { default as React } from 'react';
2
+ type ErrorBoundaryProps = {
3
+ fallback?: React.ReactNode;
4
+ children: React.ReactNode;
5
+ };
6
+ type ErrorBoundaryState = {
7
+ hasError: boolean;
8
+ error?: Error;
9
+ };
10
+ declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
11
+ constructor(props: ErrorBoundaryProps);
12
+ static getDerivedStateFromError(error: Error): ErrorBoundaryState;
13
+ componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
14
+ handleReset: () => void;
15
+ render(): import("react/jsx-runtime").JSX.Element;
16
+ }
17
+ export default ErrorBoundary;
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+ interface LoadingComponentProps {
3
+ message?: string;
4
+ }
5
+ /**
6
+ * A reusable loading component that displays a spinner and optional message
7
+ * @param message - Optional custom message to display (defaults to translated "Loading...")
8
+ */
9
+ declare const LoadingComponent: React.FC<LoadingComponentProps>;
10
+ export default LoadingComponent;
@@ -1,9 +1,10 @@
1
1
  import { Run, RunStep, RunStepPart } from '@jield/solodb-typescript-core';
2
- declare const RunPartsResearchRun: ({ run, runStep, runStepParts, editable, refetchFn, }: {
2
+ type RunPartsResearchRunProps = {
3
3
  run: Run;
4
4
  runStep: RunStep;
5
5
  runStepParts?: RunStepPart[];
6
6
  editable?: boolean;
7
7
  refetchFn?: () => void;
8
- }) => import("react/jsx-runtime").JSX.Element | null;
8
+ };
9
+ declare const RunPartsResearchRun: ({ run: _run, runStep, runStepParts, editable, refetchFn, }: RunPartsResearchRunProps) => import("react/jsx-runtime").JSX.Element | null;
9
10
  export default RunPartsResearchRun;
@@ -1,5 +1,9 @@
1
1
  import { RunStep } from '@jield/solodb-typescript-core';
2
- export default function StepRemark({ runStep, reloadRunStep }: {
2
+ type StepRemarkProps = {
3
3
  runStep?: RunStep;
4
4
  reloadRunStep?: () => void;
5
- }): import("react/jsx-runtime").JSX.Element;
5
+ title?: string;
6
+ titleClassName?: string;
7
+ };
8
+ export default function StepRemark({ runStep, reloadRunStep, title, titleClassName, }: StepRemarkProps): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -1,9 +1,14 @@
1
1
  import { ServiceEventReportResult } from '@jield/solodb-typescript-core';
2
- export default function Criterion({ result, value, onChange, error, onSubmit, saving, }: {
2
+ type SaveStatusState = "idle" | "dirty" | "saving" | "saved" | "error";
3
+ type SaveStatus = {
4
+ state: SaveStatusState;
5
+ message?: string;
6
+ savedAt?: number;
7
+ };
8
+ export default function Criterion({ result, status, onAutoSave, onDirty, }: {
3
9
  result: ServiceEventReportResult;
4
- value: any;
5
- onChange: (cv: ServiceEventReportResult, raw: any) => void;
6
- error?: string;
7
- onSubmit: (cv: ServiceEventReportResult) => void;
8
- saving?: boolean;
10
+ status?: SaveStatus;
11
+ onAutoSave: (cv: ServiceEventReportResult) => void;
12
+ onDirty: (resultId: number) => void;
9
13
  }): import("react/jsx-runtime").JSX.Element;
14
+ export {};
@@ -1 +1 @@
1
- .equipment_container{padding:10px;border:5px solid black;margin:10px}
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)}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jield/solodb-react-components",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
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.6",
30
+ "@jield/solodb-typescript-core": "^1.0.8",
31
31
  "@testing-library/dom": "^10.4.1",
32
32
  "moment": "^2.30.1",
33
33
  "moment-timezone": "^0.6.0",