@object-ui/plugin-calendar 0.3.1 → 2.0.0
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/.turbo/turbo-build.log +21 -0
- package/CHANGELOG.md +15 -0
- package/dist/index.js +539 -560
- package/dist/index.umd.cjs +2 -2
- package/dist/src/CalendarView.d.ts +3 -1
- package/dist/src/CalendarView.d.ts.map +1 -1
- package/dist/src/ObjectCalendar.d.ts +15 -1
- package/dist/src/ObjectCalendar.d.ts.map +1 -1
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.d.ts.map +1 -1
- package/package.json +10 -9
- package/src/CalendarView.test.tsx +118 -0
- package/src/CalendarView.tsx +95 -30
- package/src/ObjectCalendar.msw.test.tsx +100 -0
- package/src/ObjectCalendar.tsx +113 -149
- package/src/calendar-view-renderer.tsx +32 -76
- package/src/index.tsx +16 -3
- package/src/registration.test.tsx +25 -0
- package/test/setup.ts +32 -0
- package/vite.config.ts +6 -0
- package/vitest.config.ts +13 -0
- package/vitest.setup.ts +1 -0
package/test/setup.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
// Polyfill ResizeObserver
|
|
5
|
+
global.ResizeObserver = class ResizeObserver {
|
|
6
|
+
observe() {}
|
|
7
|
+
unobserve() {}
|
|
8
|
+
disconnect() {}
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
// Mock PointerEvent
|
|
12
|
+
class PointerEvent extends Event {
|
|
13
|
+
button: number;
|
|
14
|
+
ctrlKey: boolean;
|
|
15
|
+
metaKey: boolean;
|
|
16
|
+
shiftKey: boolean;
|
|
17
|
+
constructor(type: string, props: any = {}) {
|
|
18
|
+
super(type, props);
|
|
19
|
+
this.button = props.button || 0;
|
|
20
|
+
this.ctrlKey = props.ctrlKey || false;
|
|
21
|
+
this.metaKey = props.metaKey || false;
|
|
22
|
+
this.shiftKey = props.shiftKey || false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
global.PointerEvent = PointerEvent as any;
|
|
26
|
+
|
|
27
|
+
// Mock HTMLElement.offsetParent
|
|
28
|
+
Object.defineProperty(HTMLElement.prototype, 'offsetParent', {
|
|
29
|
+
get() {
|
|
30
|
+
return this.parentNode;
|
|
31
|
+
},
|
|
32
|
+
});
|
package/vite.config.ts
CHANGED
package/vitest.config.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="vitest" />
|
|
2
|
+
import { defineConfig } from 'vite';
|
|
3
|
+
import react from '@vitejs/plugin-react';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
|
|
6
|
+
export default defineConfig({
|
|
7
|
+
plugins: [react()],
|
|
8
|
+
test: {
|
|
9
|
+
environment: 'happy-dom',
|
|
10
|
+
globals: true,
|
|
11
|
+
setupFiles: ['./vitest.setup.ts'],
|
|
12
|
+
},
|
|
13
|
+
});
|
package/vitest.setup.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|