@propriety/court-calendar 1.0.140 → 1.0.142
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.
- package/dev/App.tsx +31 -12
- package/dist/__tests__/WeekWidget.test.d.ts +1 -0
- package/dist/_components/WeekWidget/WeekWidget.d.ts +14 -0
- package/dist/helpers/api/cases.d.ts +22 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +7873 -7355
- package/package.json +1 -1
- package/src/__tests__/WeekWidget.test.tsx +143 -0
- package/src/_components/Modal/DateDetails/DateDetails.tsx +142 -26
- package/src/_components/WeekWidget/WeekWidget.tsx +537 -0
- package/src/helpers/api/cases.ts +70 -0
- package/src/index.ts +1 -0
package/dev/App.tsx
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
|
-
import { CCalendar } from '../src/';
|
|
2
|
+
import { CCalendar, WeekWidget } from '../src/';
|
|
3
3
|
|
|
4
4
|
function App() {
|
|
5
5
|
const [mode, setMode] = useState<'light' | 'dark'>('dark');
|
|
6
|
+
const [view, setView] = useState<'calendar' | 'widget'>('calendar');
|
|
7
|
+
|
|
8
|
+
const apiKey = import.meta.env.VITE_CALENDAR_API_KEY || '';
|
|
9
|
+
const buttonStyle = {
|
|
10
|
+
height: '2rem',
|
|
11
|
+
backgroundColor: mode === 'dark' ? '#121212' : '#ffffff',
|
|
12
|
+
color: mode === 'dark' ? '#ffffff' : '#212121',
|
|
13
|
+
};
|
|
6
14
|
|
|
7
15
|
return (
|
|
8
16
|
<div
|
|
@@ -13,21 +21,32 @@ function App() {
|
|
|
13
21
|
}}
|
|
14
22
|
>
|
|
15
23
|
<h1>Court Calendar Demo</h1>
|
|
16
|
-
<div style={{ flexDirection: '
|
|
17
|
-
<button
|
|
18
|
-
onClick={() => setMode(mode === 'light' ? 'dark' : 'light')}
|
|
19
|
-
style={{
|
|
20
|
-
marginBottom: '1rem',
|
|
21
|
-
height: '2rem',
|
|
22
|
-
backgroundColor: mode === 'dark' ? '#121212' : '#ffffff',
|
|
23
|
-
color: mode === 'dark' ? '#ffffff' : '#212121',
|
|
24
|
-
}}
|
|
25
|
-
>
|
|
24
|
+
<div style={{ flexDirection: 'row', display: 'flex', gap: '0.5rem', marginBottom: '1rem' }}>
|
|
25
|
+
<button onClick={() => setMode(mode === 'light' ? 'dark' : 'light')} style={buttonStyle}>
|
|
26
26
|
Theme toggle
|
|
27
27
|
</button>
|
|
28
|
+
<button onClick={() => setView(view === 'calendar' ? 'widget' : 'calendar')} style={buttonStyle}>
|
|
29
|
+
{view === 'calendar' ? 'Show week widget' : 'Show full calendar'}
|
|
30
|
+
</button>
|
|
28
31
|
</div>
|
|
29
32
|
|
|
30
|
-
|
|
33
|
+
{view === 'calendar' ? (
|
|
34
|
+
<CCalendar apiKey={apiKey} activeUser={27} mode={mode} />
|
|
35
|
+
) : (
|
|
36
|
+
// WeekWidget renders a bare grid — wrap it like a dashboard card so the
|
|
37
|
+
// compact week strip is easy to see against the page background.
|
|
38
|
+
<div
|
|
39
|
+
style={{
|
|
40
|
+
maxWidth: 900,
|
|
41
|
+
padding: '1rem',
|
|
42
|
+
borderRadius: 8,
|
|
43
|
+
border: `1px solid ${mode === 'dark' ? '#333' : '#e0e0e0'}`,
|
|
44
|
+
}}
|
|
45
|
+
>
|
|
46
|
+
<h3 style={{ margin: '0 0 0.75rem' }}>Court Calendar — This Week</h3>
|
|
47
|
+
<WeekWidget apiKey={apiKey} activeUser={27} mode={mode} />
|
|
48
|
+
</div>
|
|
49
|
+
)}
|
|
31
50
|
</div>
|
|
32
51
|
);
|
|
33
52
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compact current-week (Mon–Fri) view of the court calendar. Hearing badges,
|
|
3
|
+
* "Can Preclude" (motion-date) markers and "Upload" (deadline) markers all use
|
|
4
|
+
* the full calendar's styling. Powered by the real court-calendar data stack;
|
|
5
|
+
* clicking any item opens the in-package DateDetails modal.
|
|
6
|
+
*
|
|
7
|
+
* Renders a bare 5-column grid — wrap it in your own card/header.
|
|
8
|
+
*/
|
|
9
|
+
export default function WeekWidget({ apiKey, activeUser, mode, themeOverrides, }: {
|
|
10
|
+
apiKey: string;
|
|
11
|
+
activeUser: number;
|
|
12
|
+
mode?: 'light' | 'dark';
|
|
13
|
+
themeOverrides?: import('@mui/material/styles').ThemeOptions;
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -18,4 +18,26 @@ export interface FoilAffidavitResult {
|
|
|
18
18
|
skipped: string[];
|
|
19
19
|
}
|
|
20
20
|
export declare function prepareFoilAffidavit(parcelIds: string[], date: Date, year: number, apiKey: string, negotiatorId?: number, testing?: boolean): Promise<FoilAffidavitResult | null>;
|
|
21
|
+
/**
|
|
22
|
+
* Downloads the Motion to Preclude for a court date — a single PDF when the date has one
|
|
23
|
+
* case, or a ZIP archive when it has several. The filename is taken from the response's
|
|
24
|
+
* Content-Disposition header when present. Returns false on a non-2xx response.
|
|
25
|
+
*/
|
|
26
|
+
export declare function downloadMotionToPreclude(courtDateId: number, apiKey: string): Promise<boolean>;
|
|
27
|
+
export interface MotionUploadResult {
|
|
28
|
+
ok: boolean;
|
|
29
|
+
/** True when the backend skipped the upload because SkipMotion is set (HTTP 409). */
|
|
30
|
+
skipped?: boolean;
|
|
31
|
+
message?: string;
|
|
32
|
+
documentsSubmitted?: {
|
|
33
|
+
index_number: string;
|
|
34
|
+
status: string;
|
|
35
|
+
}[];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Triggers the NYSCEF upload of the Motion to Preclude for every case on a court date.
|
|
39
|
+
* The backend returns 409 (skipped) when SkipMotion is set for the date — surfaced here as
|
|
40
|
+
* `{ ok: false, skipped: true }` rather than a hard error. Pass `test` to run without submitting.
|
|
41
|
+
*/
|
|
42
|
+
export declare function uploadMotionToPreclude(courtDateId: number, apiKey: string, test?: boolean): Promise<MotionUploadResult>;
|
|
21
43
|
export declare function updateCaseAdjournment(parcelId: string, scarIndexNumber: string, adjournedDate: Date | null, apiKey: string): Promise<boolean>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { default as CCalendar } from './_components/CCalendar';
|
|
2
|
+
export { default as WeekWidget } from './_components/WeekWidget/WeekWidget';
|
|
2
3
|
export type { CalendarRouteParams } from './types';
|
|
3
4
|
export { parseCalendarSearchParams, serializeCalendarParams } from './helpers/routing';
|