@isma91/react-scheduler 4.0.3 → 4.0.5

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 (134) hide show
  1. package/.github/workflows/publish.yml +29 -0
  2. package/.github/workflows/tests.yml +35 -0
  3. package/.gitignore +32 -0
  4. package/.husky/pre-commit +2 -0
  5. package/.prettierignore +1 -0
  6. package/.prettierrc.json +7 -0
  7. package/.yarnrc.yml +1 -0
  8. package/README.md +1 -0
  9. package/dist/LICENSE +24 -0
  10. package/dist/README.md +174 -0
  11. package/{index.js → dist/index.js} +572 -558
  12. package/dist/package.json +65 -0
  13. package/{store → dist/store}/default.d.ts +2 -0
  14. package/{types.d.ts → dist/types.d.ts} +6 -0
  15. package/eslint.config.js +79 -0
  16. package/index.html +41 -0
  17. package/isma91-react-scheduler-4.0.5.tgz +0 -0
  18. package/jest.config.ts +194 -0
  19. package/package.json +76 -4
  20. package/public/favicon.ico +0 -0
  21. package/public/logo192.png +0 -0
  22. package/public/logo512.png +0 -0
  23. package/public/manifest.json +25 -0
  24. package/public/robots.txt +3 -0
  25. package/scripts/post-pack.js +34 -0
  26. package/src/App.tsx +25 -0
  27. package/src/Page1.tsx +67 -0
  28. package/src/events.tsx +227 -0
  29. package/src/index.tsx +21 -0
  30. package/src/lib/SchedulerComponent.tsx +78 -0
  31. package/src/lib/__tests__/index.test.tsx +24 -0
  32. package/src/lib/components/common/Cell.tsx +52 -0
  33. package/src/lib/components/common/LocaleArrow.tsx +38 -0
  34. package/src/lib/components/common/ResourceHeader.tsx +73 -0
  35. package/src/lib/components/common/Tabs.tsx +119 -0
  36. package/src/lib/components/common/TodayTypo.tsx +44 -0
  37. package/src/lib/components/common/WithResources.tsx +98 -0
  38. package/src/lib/components/events/Actions.tsx +65 -0
  39. package/src/lib/components/events/AgendaEventsList.tsx +126 -0
  40. package/src/lib/components/events/CurrentTimeBar.tsx +59 -0
  41. package/src/lib/components/events/EmptyAgenda.tsx +27 -0
  42. package/src/lib/components/events/EventItem.tsx +180 -0
  43. package/src/lib/components/events/EventItemPopover.tsx +179 -0
  44. package/src/lib/components/events/MonthEvents.tsx +141 -0
  45. package/src/lib/components/events/TodayEvents.tsx +99 -0
  46. package/src/lib/components/hoc/DateProvider.tsx +19 -0
  47. package/src/lib/components/inputs/DatePicker.tsx +95 -0
  48. package/src/lib/components/inputs/Input.tsx +113 -0
  49. package/src/lib/components/inputs/SelectInput.tsx +164 -0
  50. package/src/lib/components/month/MonthTable.tsx +207 -0
  51. package/src/lib/components/nav/DayDateBtn.tsx +77 -0
  52. package/src/lib/components/nav/MonthDateBtn.tsx +80 -0
  53. package/src/lib/components/nav/Navigation.tsx +201 -0
  54. package/src/lib/components/nav/WeekDateBtn.tsx +89 -0
  55. package/src/lib/components/week/WeekTable.tsx +229 -0
  56. package/src/lib/helpers/constants.ts +4 -0
  57. package/src/lib/helpers/generals.tsx +354 -0
  58. package/src/lib/hooks/useArrowDisable.ts +26 -0
  59. package/src/lib/hooks/useCellAttributes.ts +67 -0
  60. package/src/lib/hooks/useDragAttributes.ts +31 -0
  61. package/src/lib/hooks/useEventPermissions.ts +42 -0
  62. package/src/lib/hooks/useStore.ts +8 -0
  63. package/src/lib/hooks/useSyncScroll.ts +31 -0
  64. package/src/lib/hooks/useWindowResize.ts +37 -0
  65. package/src/lib/index.tsx +14 -0
  66. package/src/lib/positionManger/context.ts +14 -0
  67. package/src/lib/positionManger/provider.tsx +113 -0
  68. package/src/lib/positionManger/usePosition.ts +8 -0
  69. package/src/lib/store/context.ts +5 -0
  70. package/src/lib/store/default.ts +159 -0
  71. package/src/lib/store/provider.tsx +226 -0
  72. package/src/lib/store/types.ts +40 -0
  73. package/src/lib/styles/styles.ts +256 -0
  74. package/src/lib/types.ts +429 -0
  75. package/src/lib/views/Day.tsx +272 -0
  76. package/src/lib/views/DayAgenda.tsx +57 -0
  77. package/src/lib/views/Editor.tsx +258 -0
  78. package/src/lib/views/Month.tsx +82 -0
  79. package/src/lib/views/MonthAgenda.tsx +84 -0
  80. package/src/lib/views/Week.tsx +92 -0
  81. package/src/lib/views/WeekAgenda.tsx +81 -0
  82. package/src/vite-env.d.ts +3 -0
  83. package/tsconfig.build.json +5 -0
  84. package/tsconfig.json +27 -0
  85. package/vite.config.js +40 -0
  86. /package/{SchedulerComponent.d.ts → dist/SchedulerComponent.d.ts} +0 -0
  87. /package/{components → dist/components}/common/Cell.d.ts +0 -0
  88. /package/{components → dist/components}/common/LocaleArrow.d.ts +0 -0
  89. /package/{components → dist/components}/common/ResourceHeader.d.ts +0 -0
  90. /package/{components → dist/components}/common/Tabs.d.ts +0 -0
  91. /package/{components → dist/components}/common/TodayTypo.d.ts +0 -0
  92. /package/{components → dist/components}/common/WithResources.d.ts +0 -0
  93. /package/{components → dist/components}/events/Actions.d.ts +0 -0
  94. /package/{components → dist/components}/events/AgendaEventsList.d.ts +0 -0
  95. /package/{components → dist/components}/events/CurrentTimeBar.d.ts +0 -0
  96. /package/{components → dist/components}/events/EmptyAgenda.d.ts +0 -0
  97. /package/{components → dist/components}/events/EventItem.d.ts +0 -0
  98. /package/{components → dist/components}/events/EventItemPopover.d.ts +0 -0
  99. /package/{components → dist/components}/events/MonthEvents.d.ts +0 -0
  100. /package/{components → dist/components}/events/TodayEvents.d.ts +0 -0
  101. /package/{components → dist/components}/hoc/DateProvider.d.ts +0 -0
  102. /package/{components → dist/components}/inputs/DatePicker.d.ts +0 -0
  103. /package/{components → dist/components}/inputs/Input.d.ts +0 -0
  104. /package/{components → dist/components}/inputs/SelectInput.d.ts +0 -0
  105. /package/{components → dist/components}/month/MonthTable.d.ts +0 -0
  106. /package/{components → dist/components}/nav/DayDateBtn.d.ts +0 -0
  107. /package/{components → dist/components}/nav/MonthDateBtn.d.ts +0 -0
  108. /package/{components → dist/components}/nav/Navigation.d.ts +0 -0
  109. /package/{components → dist/components}/nav/WeekDateBtn.d.ts +0 -0
  110. /package/{components → dist/components}/week/WeekTable.d.ts +0 -0
  111. /package/{helpers → dist/helpers}/constants.d.ts +0 -0
  112. /package/{helpers → dist/helpers}/generals.d.ts +0 -0
  113. /package/{hooks → dist/hooks}/useArrowDisable.d.ts +0 -0
  114. /package/{hooks → dist/hooks}/useCellAttributes.d.ts +0 -0
  115. /package/{hooks → dist/hooks}/useDragAttributes.d.ts +0 -0
  116. /package/{hooks → dist/hooks}/useEventPermissions.d.ts +0 -0
  117. /package/{hooks → dist/hooks}/useStore.d.ts +0 -0
  118. /package/{hooks → dist/hooks}/useSyncScroll.d.ts +0 -0
  119. /package/{hooks → dist/hooks}/useWindowResize.d.ts +0 -0
  120. /package/{index.d.ts → dist/index.d.ts} +0 -0
  121. /package/{positionManger → dist/positionManger}/context.d.ts +0 -0
  122. /package/{positionManger → dist/positionManger}/provider.d.ts +0 -0
  123. /package/{positionManger → dist/positionManger}/usePosition.d.ts +0 -0
  124. /package/{store → dist/store}/context.d.ts +0 -0
  125. /package/{store → dist/store}/provider.d.ts +0 -0
  126. /package/{store → dist/store}/types.d.ts +0 -0
  127. /package/{styles → dist/styles}/styles.d.ts +0 -0
  128. /package/{views → dist/views}/Day.d.ts +0 -0
  129. /package/{views → dist/views}/DayAgenda.d.ts +0 -0
  130. /package/{views → dist/views}/Editor.d.ts +0 -0
  131. /package/{views → dist/views}/Month.d.ts +0 -0
  132. /package/{views → dist/views}/MonthAgenda.d.ts +0 -0
  133. /package/{views → dist/views}/Week.d.ts +0 -0
  134. /package/{views → dist/views}/WeekAgenda.d.ts +0 -0
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@isma91/react-scheduler",
3
+ "version": "4.0.5",
4
+ "description": "React scheduler component based on Material-UI & date-fns",
5
+ "files": [
6
+ "*"
7
+ ],
8
+ "type": "module",
9
+ "exports": {
10
+ "./types": {
11
+ "import": "./types.d.ts"
12
+ },
13
+ ".": {
14
+ "import": "./index.js"
15
+ }
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "https://github.com/isma91/react-scheduler.git"
20
+ },
21
+ "author": "isma91 (fork of Aldabil)",
22
+ "bugs": {
23
+ "url": "https://github.com/isma91/react-scheduler/issues"
24
+ },
25
+ "keywords": [
26
+ "react",
27
+ "material-ui",
28
+ "calendar",
29
+ "scheduler"
30
+ ],
31
+ "license": "MIT",
32
+ "peerDependencies": {
33
+ "@mui/icons-material": ">=7.0.0",
34
+ "@mui/material": ">=7.0.0",
35
+ "@mui/x-date-pickers": ">=7.0.0",
36
+ "date-fns": ">=4.0.0",
37
+ "react": ">=18.0.0",
38
+ "react-dom": ">=18.0.0",
39
+ "rrule": ">=2.8.1"
40
+ },
41
+ "peerDependenciesMeta": {
42
+ "rrule": {
43
+ "optional": true
44
+ }
45
+ },
46
+ "eslintConfig": {
47
+ "extends": [
48
+ "react-app",
49
+ "react-app/jest"
50
+ ]
51
+ },
52
+ "browserslist": {
53
+ "production": [
54
+ ">0.2%",
55
+ "not dead",
56
+ "not op_mini all"
57
+ ],
58
+ "development": [
59
+ "last 1 chrome version",
60
+ "last 1 firefox version",
61
+ "last 1 safari version"
62
+ ]
63
+ },
64
+ "homepage": "https://github.com/aldabil21/react-scheduler#readme"
65
+ }
@@ -45,6 +45,7 @@ export declare const defaultProps: (props: Partial<SchedulerProps>) => {
45
45
  showCurrentTimeBar: boolean;
46
46
  currentTimeBarColor?: string | undefined;
47
47
  forceInlineMultiDay: boolean;
48
+ displayHourRange?: boolean | undefined;
48
49
  translations: {
49
50
  moreEvents: string;
50
51
  loading: string;
@@ -176,6 +177,7 @@ export declare const initialStore: {
176
177
  showCurrentTimeBar: boolean;
177
178
  currentTimeBarColor?: string | undefined;
178
179
  forceInlineMultiDay: boolean;
180
+ displayHourRange?: boolean | undefined;
179
181
  translations: {
180
182
  moreEvents: string;
181
183
  loading: string;
@@ -362,6 +362,12 @@ export interface SchedulerProps {
362
362
  * @default false
363
363
  */
364
364
  forceInlineMultiDay?: boolean;
365
+ /**
366
+ * Controls visibility of the secondary information in Agenda list items.
367
+ * When false, hides the secondary text.
368
+ * @default true
369
+ */
370
+ displayHourRange?: boolean;
365
371
  }
366
372
  export interface SchedulerRef {
367
373
  el: HTMLDivElement;
@@ -0,0 +1,79 @@
1
+ import react from "eslint-plugin-react";
2
+ import tseslint, { configs as tseslintConfigs } from "typescript-eslint";
3
+ import globals from "globals";
4
+ import js from "@eslint/js";
5
+ import * as reactHooks from "eslint-plugin-react-hooks";
6
+ import reactRefresh from "eslint-plugin-react-refresh";
7
+ import pluginImport from "eslint-plugin-import";
8
+ import pluginJsxA11y from "eslint-plugin-jsx-a11y";
9
+ import pluginPromise from "eslint-plugin-promise";
10
+
11
+ export default tseslint.config(
12
+ { ignores: ["jest.config.ts", "scripts", "dist", "vite.config.js"] },
13
+ pluginJsxA11y.flatConfigs.recommended,
14
+ pluginPromise.configs["flat/recommended"],
15
+ pluginImport.flatConfigs.recommended,
16
+ {
17
+ extends: [js.configs.recommended, ...tseslintConfigs.recommended],
18
+ plugins: {
19
+ "react-hooks": reactHooks,
20
+ "react-refresh": reactRefresh,
21
+ react,
22
+ },
23
+ files: ["**/*.{ts,tsx}"],
24
+ languageOptions: {
25
+ globals: {
26
+ ...globals.browser,
27
+ React: "readonly",
28
+ },
29
+ ecmaVersion: "latest",
30
+ sourceType: "module",
31
+ },
32
+
33
+ settings: {
34
+ react: {
35
+ version: "detect",
36
+ },
37
+ },
38
+
39
+ rules: {
40
+ ...reactHooks.configs.recommended.rules,
41
+ "linebreak-style": ["error", "unix"],
42
+
43
+ quotes: [
44
+ "error",
45
+ "double",
46
+ {
47
+ allowTemplateLiterals: true,
48
+ },
49
+ ],
50
+
51
+ semi: ["error", "always"],
52
+ "@typescript-eslint/no-non-null-assertion": 0,
53
+ "no-useless-catch": 0,
54
+ "@typescript-eslint/no-explicit-any": 0,
55
+ "@typescript-eslint/no-non-null-asserted-optional-chain": 0,
56
+ "no-case-declarations": 0,
57
+ "@typescript-eslint/no-empty-interface": 0,
58
+ "@typescript-eslint/no-empty-function": 0,
59
+ "@typescript-eslint/no-empty-object-type": [
60
+ "error",
61
+ { allowInterfaces: "with-single-extends" },
62
+ ],
63
+ },
64
+ },
65
+ {
66
+ // Checks importing of different files
67
+ settings: {
68
+ "import/parsers": {
69
+ "@typescript-eslint/parser": [".ts", ".tsx"],
70
+ },
71
+ "import/resolver": {
72
+ typescript: {
73
+ alwaysTryTypes: true,
74
+ project: "./",
75
+ },
76
+ },
77
+ },
78
+ }
79
+ );
package/index.html ADDED
@@ -0,0 +1,41 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en" dir="ltr">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <link rel="icon" href="/favicon.ico" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
7
+ <meta name="theme-color" content="#000000" />
8
+ <meta name="description" content="Web site created using create-react-app" />
9
+ <link rel="apple-touch-icon" href="/logo192.png" />
10
+ <!--
11
+ manifest.json provides metadata used when your web app is installed on a
12
+ user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
13
+ -->
14
+ <link rel="manifest" href="/manifest.json" />
15
+ <!--
16
+ Notice the use of in the tags above.
17
+ It will be replaced with the URL of the `public` folder during the build.
18
+ Only files inside the `public` folder can be referenced from the HTML.
19
+
20
+ Unlike "/favicon.ico" or "favicon.ico", "/favicon.ico" will
21
+ work correctly both with client-side routing and a non-root public URL.
22
+ Learn how to configure a non-root public URL by running `npm run build`.
23
+ -->
24
+ <title>React App</title>
25
+ </head>
26
+ <body>
27
+ <noscript>You need to enable JavaScript to run this app.</noscript>
28
+ <div id="root"></div>
29
+ <!--
30
+ This HTML file is a template.
31
+ If you open it directly in the browser, you will see an empty page.
32
+
33
+ You can add webfonts, meta tags, or analytics to this file.
34
+ The build step will place the bundled scripts into the <body> tag.
35
+
36
+ To begin the development, run `npm start` or `yarn start`.
37
+ To create a production bundle, use `npm run build` or `yarn build`.
38
+ -->
39
+ <script type="module" src="/src/index.tsx"></script>
40
+ </body>
41
+ </html>
Binary file
package/jest.config.ts ADDED
@@ -0,0 +1,194 @@
1
+ /*
2
+ * For a detailed explanation regarding each configuration property and type check, visit:
3
+ * https://jestjs.io/docs/configuration
4
+ */
5
+
6
+ export default {
7
+ // All imported modules in your tests should be mocked automatically
8
+ // automock: false,
9
+
10
+ // Stop running tests after `n` failures
11
+ // bail: 0,
12
+
13
+ // The directory where Jest should store its cached dependency information
14
+ // cacheDirectory: "/tmp/jest_rs",
15
+
16
+ // Automatically clear mock calls, instances and results before every test
17
+ // clearMocks: false,
18
+
19
+ // Indicates whether the coverage information should be collected while executing the test
20
+ // collectCoverage: false,
21
+
22
+ // An array of glob patterns indicating a set of files for which coverage information should be collected
23
+ // collectCoverageFrom: undefined,
24
+
25
+ // The directory where Jest should output its coverage files
26
+ // coverageDirectory: undefined,
27
+
28
+ // An array of regexp pattern strings used to skip coverage collection
29
+ // coveragePathIgnorePatterns: [
30
+ // "/node_modules/"
31
+ // ],
32
+
33
+ // Indicates which provider should be used to instrument code for coverage
34
+ // coverageProvider: "babel",
35
+
36
+ // A list of reporter names that Jest uses when writing coverage reports
37
+ // coverageReporters: [
38
+ // "json",
39
+ // "text",
40
+ // "lcov",
41
+ // "clover"
42
+ // ],
43
+
44
+ // An object that configures minimum threshold enforcement for coverage results
45
+ // coverageThreshold: undefined,
46
+
47
+ // A path to a custom dependency extractor
48
+ // dependencyExtractor: undefined,
49
+
50
+ // Make calling deprecated APIs throw helpful error messages
51
+ // errorOnDeprecated: false,
52
+
53
+ // Force coverage collection from ignored files using an array of glob patterns
54
+ // forceCoverageMatch: [],
55
+
56
+ // A path to a module which exports an async function that is triggered once before all test suites
57
+ // globalSetup: undefined,
58
+
59
+ // A path to a module which exports an async function that is triggered once after all test suites
60
+ // globalTeardown: undefined,
61
+
62
+ // A set of global variables that need to be available in all test environments
63
+ // globals: {},
64
+
65
+ // The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
66
+ // maxWorkers: "50%",
67
+
68
+ // An array of directory names to be searched recursively up from the requiring module's location
69
+ // moduleDirectories: [
70
+ // "node_modules"
71
+ // ],
72
+
73
+ // An array of file extensions your modules use
74
+ // moduleFileExtensions: [
75
+ // "js",
76
+ // "jsx",
77
+ // "ts",
78
+ // "tsx",
79
+ // "json",
80
+ // "node"
81
+ // ],
82
+
83
+ // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
84
+ // moduleNameMapper: {},
85
+
86
+ // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
87
+ // modulePathIgnorePatterns: [],
88
+
89
+ // Activates notifications for test results
90
+ // notify: false,
91
+
92
+ // An enum that specifies notification mode. Requires { notify: true }
93
+ // notifyMode: "failure-change",
94
+
95
+ // A preset that is used as a base for Jest's configuration
96
+ // preset: undefined,
97
+
98
+ // Run tests from one or more projects
99
+ // projects: undefined,
100
+
101
+ // Use this configuration option to add custom reporters to Jest
102
+ // reporters: undefined,
103
+
104
+ // Automatically reset mock state before every test
105
+ // resetMocks: false,
106
+
107
+ // Reset the module registry before running each individual test
108
+ // resetModules: false,
109
+
110
+ // A path to a custom resolver
111
+ // resolver: undefined,
112
+
113
+ // Automatically restore mock state and implementation before every test
114
+ // restoreMocks: false,
115
+
116
+ // The root directory that Jest should scan for tests and modules within
117
+ // rootDir: undefined,
118
+
119
+ // A list of paths to directories that Jest should use to search for files in
120
+ roots: ["<rootDir>/src"],
121
+
122
+ // Allows you to use a custom runner instead of Jest's default test runner
123
+ // runner: "jest-runner",
124
+
125
+ // The paths to modules that run some code to configure or set up the testing environment before each test
126
+ // setupFiles: [],
127
+
128
+ // A list of paths to modules that run some code to configure or set up the testing framework before each test
129
+ // setupFilesAfterEnv: [],
130
+
131
+ // The number of seconds after which a test is considered as slow and reported as such in the results.
132
+ // slowTestThreshold: 5,
133
+
134
+ // A list of paths to snapshot serializer modules Jest should use for snapshot testing
135
+ // snapshotSerializers: [],
136
+
137
+ // The test environment that will be used for testing
138
+ testEnvironment: "jest-environment-jsdom",
139
+
140
+ // Options that will be passed to the testEnvironment
141
+ // testEnvironmentOptions: {},
142
+
143
+ // Adds a location field to test results
144
+ // testLocationInResults: false,
145
+
146
+ // The glob patterns Jest uses to detect test files
147
+ // testMatch: [
148
+ // "**/__tests__/**/*.[jt]s?(x)",
149
+ // "**/?(*.)+(spec|test).[tj]s?(x)"
150
+ // ],
151
+
152
+ // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
153
+ // testPathIgnorePatterns: [
154
+ // "/node_modules/"
155
+ // ],
156
+
157
+ // The regexp pattern or array of patterns that Jest uses to detect test files
158
+ // testRegex: [],
159
+
160
+ // This option allows the use of a custom results processor
161
+ // testResultsProcessor: undefined,
162
+
163
+ // This option allows use of a custom test runner
164
+ // testRunner: "jest-circus/runner",
165
+
166
+ // This option sets the URL for the jsdom environment. It is reflected in properties such as location.href
167
+ // testURL: "http://localhost",
168
+
169
+ // Setting this value to "fake" allows the use of fake timers for functions such as "setTimeout"
170
+ // timers: "real",
171
+
172
+ // A map from regular expressions to paths to transformers
173
+ transform: {
174
+ "^.+\\.(ts|js)x?$": "ts-jest",
175
+ },
176
+
177
+ // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
178
+ // transformIgnorePatterns: [
179
+ // "/node_modules/",
180
+ // "\\.pnp\\.[^\\/]+$"
181
+ // ],
182
+
183
+ // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
184
+ // unmockedModulePathPatterns: undefined,
185
+
186
+ // Indicates whether each individual test should be reported during the run
187
+ // verbose: undefined,
188
+
189
+ // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
190
+ // watchPathIgnorePatterns: [],
191
+
192
+ // Whether to use watchman for file crawling
193
+ // watchman: true,
194
+ };
package/package.json CHANGED
@@ -1,11 +1,27 @@
1
1
  {
2
2
  "name": "@isma91/react-scheduler",
3
- "version": "4.0.3",
3
+ "version": "4.0.5",
4
4
  "description": "React scheduler component based on Material-UI & date-fns",
5
5
  "files": [
6
6
  "*"
7
7
  ],
8
8
  "type": "module",
9
+ "scripts": {
10
+ "start": "vite serve",
11
+ "build": "vite build --mode production",
12
+ "postbuild": "node ./scripts/post-pack.js",
13
+ "local:pack": "npm run build && cd dist && npm pack && mv *.tgz ../",
14
+ "format": "prettier --check \"**/*.{js,jsx,ts,tsx,json}\"",
15
+ "format:write": "prettier --write \"**/*.{js,jsx,ts,tsx,json}\"",
16
+ "lint": "npm run types && eslint .",
17
+ "lint:fix": "eslint . --fix",
18
+ "types": "tsc --noEmit",
19
+ "prepare": "husky install",
20
+ "pre:commit": "lint-staged",
21
+ "test": "jest",
22
+ "test:watch": "jest --watch",
23
+ "test:ci": "jest --ci"
24
+ },
9
25
  "exports": {
10
26
  "./types": {
11
27
  "import": "./types.d.ts"
@@ -14,6 +30,14 @@
14
30
  "import": "./index.js"
15
31
  }
16
32
  },
33
+ "lint-staged": {
34
+ "**/*.{ts,js,tsx,jsx}": [
35
+ "npm run lint"
36
+ ],
37
+ "**/*.{ts,js,tsx,jsx,json,yml}": [
38
+ "npm run format:write"
39
+ ]
40
+ },
17
41
  "repository": {
18
42
  "type": "git",
19
43
  "url": "https://github.com/isma91/react-scheduler.git"
@@ -29,6 +53,55 @@
29
53
  "scheduler"
30
54
  ],
31
55
  "license": "MIT",
56
+ "devDependencies": {
57
+ "@emotion/react": "^11.14.0",
58
+ "@emotion/styled": "^11.14.0",
59
+ "@eslint/compat": "^1.2.6",
60
+ "@eslint/eslintrc": "^3.2.0",
61
+ "@eslint/js": "^9.20.0",
62
+ "@mui/icons-material": ">=7.0.2",
63
+ "@mui/material": ">=7.0.2",
64
+ "@mui/x-date-pickers": ">=8.0.0",
65
+ "@testing-library/dom": "^10.4.0",
66
+ "@testing-library/jest-dom": "^6.6.3",
67
+ "@testing-library/react": "^16.2.0",
68
+ "@testing-library/user-event": "^14.6.1",
69
+ "@types/jest": "^29.5.14",
70
+ "@types/react": "^19.0.10",
71
+ "@types/react-dom": "^19.0.4",
72
+ "@types/rollup-plugin-peer-deps-external": "^2",
73
+ "@typescript-eslint/parser": "^8.24.1",
74
+ "@vitejs/plugin-react": "^4.3.4",
75
+ "date-fns": ">=4.1.0",
76
+ "eslint": "^9.20.1",
77
+ "eslint-import-resolver-typescript": "^3.8.3",
78
+ "eslint-plugin-import": "^2.31.0",
79
+ "eslint-plugin-jsx-a11y": "^6.10.2",
80
+ "eslint-plugin-promise": "^7.2.1",
81
+ "eslint-plugin-react": "^7.37.4",
82
+ "eslint-plugin-react-hooks": "^5.2.0",
83
+ "eslint-plugin-react-refresh": "^0.4.19",
84
+ "globals": "^16.0.0",
85
+ "husky": "^9.1.7",
86
+ "jest": "^29.7.0",
87
+ "jest-environment-jsdom": "^29.7.0",
88
+ "lint-staged": "^15.4.3",
89
+ "prettier": "^3.5.1",
90
+ "react": ">=19.0.0",
91
+ "react-dom": "^19.0.0",
92
+ "react-router-dom": "^7.3.0",
93
+ "rollup-plugin-peer-deps-external": "^2.2.4",
94
+ "rrule": "^2.8.1",
95
+ "ts-jest": "^29.2.5",
96
+ "ts-node": "^10.9.2",
97
+ "typescript": "^5.7.3",
98
+ "typescript-eslint": "^8.24.1",
99
+ "vite": "^6.1.1",
100
+ "vite-plugin-checker": "^0.9.0",
101
+ "vite-plugin-dts": "^4.5.0",
102
+ "vite-plugin-svgr": "^4.3.0",
103
+ "vite-tsconfig-paths": "^5.1.4"
104
+ },
32
105
  "peerDependencies": {
33
106
  "@mui/icons-material": ">=7.0.0",
34
107
  "@mui/material": ">=7.0.0",
@@ -60,6 +133,5 @@
60
133
  "last 1 firefox version",
61
134
  "last 1 safari version"
62
135
  ]
63
- },
64
- "homepage": "https://github.com/aldabil21/react-scheduler#readme"
65
- }
136
+ }
137
+ }
Binary file
Binary file
Binary file
@@ -0,0 +1,25 @@
1
+ {
2
+ "short_name": "React App",
3
+ "name": "Create React App Sample",
4
+ "icons": [
5
+ {
6
+ "src": "favicon.ico",
7
+ "sizes": "64x64 32x32 24x24 16x16",
8
+ "type": "image/x-icon"
9
+ },
10
+ {
11
+ "src": "logo192.png",
12
+ "type": "image/png",
13
+ "sizes": "192x192"
14
+ },
15
+ {
16
+ "src": "logo512.png",
17
+ "type": "image/png",
18
+ "sizes": "512x512"
19
+ }
20
+ ],
21
+ "start_url": ".",
22
+ "display": "standalone",
23
+ "theme_color": "#000000",
24
+ "background_color": "#ffffff"
25
+ }
@@ -0,0 +1,3 @@
1
+ # https://www.robotstxt.org/robotstxt.html
2
+ User-agent: *
3
+ Disallow:
@@ -0,0 +1,34 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+
4
+ const init = async () => {
5
+ try {
6
+ const base = path.resolve("");
7
+ const files = ["LICENSE", "README.md"];
8
+ for (const file of files) {
9
+ await fs.promises.copyFile(path.join(base, file), path.join(base, "dist", file));
10
+ }
11
+
12
+ // clean up package.json on the fly
13
+ const pkg = await fs.promises.readFile(path.join(base, "package.json"), {
14
+ encoding: "utf-8",
15
+ });
16
+ const obj = JSON.parse(pkg);
17
+ delete obj.scripts;
18
+ delete obj.devDependencies;
19
+ delete obj["lint-staged"];
20
+ obj.homepage = "https://github.com/aldabil21/react-scheduler#readme";
21
+
22
+ await fs.promises.writeFile(
23
+ path.join(base, "dist", "package.json"),
24
+ JSON.stringify(obj, null, 2),
25
+ {
26
+ encoding: "utf-8",
27
+ }
28
+ );
29
+ } catch (error) {
30
+ throw error;
31
+ }
32
+ };
33
+
34
+ init();
package/src/App.tsx ADDED
@@ -0,0 +1,25 @@
1
+ import { Scheduler } from "./lib";
2
+ import { EVENTS } from "./events";
3
+ import { useRef } from "react";
4
+ import { SchedulerRef } from "./lib/types";
5
+ import { Link } from "react-router-dom";
6
+
7
+ function App() {
8
+ const calendarRef = useRef<SchedulerRef>(null);
9
+
10
+ return (
11
+ <>
12
+ <div>
13
+ <Link to="/1">Go to page 1</Link>
14
+ </div>
15
+
16
+ <Scheduler
17
+ ref={calendarRef}
18
+ events={EVENTS}
19
+ // events={generateRandomEvents(200)}
20
+ />
21
+ </>
22
+ );
23
+ }
24
+
25
+ export default App;