Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes 1.2 Add missing imports #34

Open
wants to merge 61 commits into
base: 0.26-beta
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
b4bf48f
Add unit argument to onZoom and onTimeChange callbacks
hckr Oct 30, 2019
39817fa
Update CHANGELOG.md
hckr Oct 30, 2019
c81ef85
Merge branch 'master' into feature/unit-in-onZoom-and-onTimeChange-ca…
Ilaiwi Nov 8, 2019
8aa758e
Fix injecting custom class names for vertical lines
Mar 18, 2020
eb2b196
Update changelog
Mar 18, 2020
03bbff8
update create-react-context version to v0.3.0
LinZhao1 May 15, 2020
992530e
Merge pull request #749 from linzhaoken/update-create-react-context-v…
Ilaiwi May 20, 2020
feb9b26
0.27.0
Ilaiwi May 20, 2020
9182d7e
yarn lock
Ilaiwi May 20, 2020
845b3e7
Fix for Context Menu unintentionally disabled by default. Also a docu…
dsgipe Oct 29, 2020
086b666
various changes to add seconds resolution to calendar timeline
Sep 28, 2021
e058989
add seconds config to show seconds timeline
Oct 6, 2021
5b2fff8
remove lib folder from repo
Oct 6, 2021
b7c5c43
Merge pull request #836 from horizon-plaza/seconds-zoom-config
Ilaiwi Oct 11, 2021
989e31d
Merge pull request #786 from dsgipe/master
Ilaiwi Nov 10, 2021
db8fdb9
Merge pull request #729 from RafikiTiki/patch-1
Ilaiwi Nov 10, 2021
8e4063d
Merge branch 'master' into feature/unit-in-onZoom-and-onTimeChange-ca…
Ilaiwi Nov 10, 2021
44bed94
Merge pull request #676 from hckr/feature/unit-in-onZoom-and-onTimeCh…
Ilaiwi Nov 10, 2021
2b11cc9
WIP
Ilaiwi May 30, 2022
98d742f
webpack 5 for dev
Ilaiwi May 30, 2022
c6b8b83
0.28.0
Ilaiwi May 30, 2022
9fd0f57
Merge pull request #863 from namespace-ee/0.28.0
Ilaiwi May 30, 2022
9d2d800
convert to latest version . of react
remcoblumink Dec 4, 2023
1c54cfc
upgraded dependencies and so on..
remcoblumink Dec 4, 2023
ff1df2a
Wio on conversion to typescript
remcoblumink Dec 10, 2023
7e0afc8
Renamed package name to react-calendar-timeline-4ef to avoid duplicates
Remco4EF Dec 13, 2023
7ff4505
Types v1
Dec 15, 2023
6aca27f
types v2
Dec 21, 2023
296eb6c
build working
Dec 21, 2023
a9c390e
changes
Dec 22, 2023
83a0d3b
Fix loop
Jan 8, 2024
0301e43
Fix todos
Jan 9, 2024
dc6c6d1
Types fixes & drop webpack
Jan 10, 2024
dee7717
Types fixes
Jan 10, 2024
2cf9931
Types improvements
Jan 15, 2024
876cc91
More type exported and couple version released
Jan 15, 2024
97d463e
more type fixes
Jan 16, 2024
93567a1
Fix header rendering
Jan 16, 2024
79aae94
version update
Jan 16, 2024
32893b6
fixes and way to set dayjs locale
Jan 18, 2024
d931c77
fix items stuck
Feb 27, 2024
57e43ec
fix items stuck 2
Feb 27, 2024
759eef6
fix items stuck 3
Feb 27, 2024
87f32f2
Drag performance improvements
Feb 28, 2024
b537f26
release + ignore
Feb 28, 2024
b40cd71
release and item drag setstate improvements
Feb 28, 2024
2bd2579
populate item interact with custom event
Feb 29, 2024
7f9ebfc
fix custom header render / resize
Mar 12, 2024
145b72e
wip
Remco4EF Jul 19, 2024
a0031a6
Update dependencies and devDependencies
remcoblumink Oct 13, 2024
d076261
Merge pull request #920 from 4Efficiency-Services/master
Ilaiwi Oct 17, 2024
7e37ba9
Improved typescript definitions
remcoblumink Oct 17, 2024
8217985
Removed -4ef addition to react-calendar timeline package.
remcoblumink Oct 17, 2024
d9386b2
remove some more references to 4ef
remcoblumink Oct 17, 2024
3a70fb8
Merge pull request #933 from 4Efficiency-Services/master
Ilaiwi Nov 17, 2024
396d686
publish 0.30.0-beta.1
Ilaiwi Nov 17, 2024
35b7334
beta release
Ilaiwi Nov 17, 2024
ce4a4f8
externalize react/jsx-runtime and react-dom/client
KlotzJesse Nov 22, 2024
cce01b7
Merge pull request #938 from KlotzJesse/patch-1
Ilaiwi Nov 24, 2024
f6ffe8f
0.30.0-beta.2
Ilaiwi Nov 24, 2024
1dd6507
add missing imports
Dec 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 23 additions & 5 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,20 +1,38 @@
{
"presets": ["@babel/preset-env", "@babel/preset-react"],
"presets": [
"@babel/preset-env",
[
"@babel/preset-react",
{
"runtime": "automatic"
}
]
],
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-object-rest-spread"
"@babel/plugin-transform-class-properties",
"@babel/plugin-transform-object-rest-spread",
[
"@babel/plugin-transform-react-jsx",
{
"runtime": "automatic"
}
]
],
"env": {
"production": {
"plugins": [
[
"react-remove-properties",
{
"properties": ["data-testid"]
"properties": [
"data-testid"
]
}
]
],
"ignore": ["src/lib/__tests__/**"]
"ignore": [
"src/lib/__tests__/**"
]
}
}
}
34 changes: 0 additions & 34 deletions .eslintrc

This file was deleted.

41 changes: 41 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"env": {
"browser": true,
"jest/globals": true,
"node": true,
"es6": true
},
"settings": {
"react": {
"version": "detect"
}
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"react",
"jest",
"prettier"
],
"rules": {
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "off",
"react/jsx-uses-vars": 2,
"react/no-children-prop": 0,
"react/no-unused-prop-types": 0,
"no-labels": 0,
"arrow-parens": 0,
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off"
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ package-lock.json
coverage

*.orig
dist
4 changes: 3 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"printWidth": 120,
"singleQuote": true,
"semi": false
"semi": false,
"trailingComma": "all"
}
26 changes: 22 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,25 @@ and this project adheres (more or less) to [Semantic Versioning](http://semver.o

## Unreleased

## 0.30.0 (beta)
Huge update made by @Remco4EF and @remcoblumink
* full rewrite to typescript
* uses Vite as bundler
* Updates dependencies to latest versions
* Updates react usage to 18+
* REMOVED enzyme for tests --> testing does not work atm


## 0.28.0

* Add unit argument to onZoom and onTimeChange callbacks @hckr #655
* Add `className` prop to Timeline component to override `react-calendar-timeline` class #682
* support zoom level seconds #835 @horizon-plaza
* custom buffer prop (help with controlled scrolling) @Ilaiwi
* Fix injecting custom vertical line's class names for time periods longer than day @RafikiTiki
* fix Context Menu unintentionally disabled by default @dsgipe #769
* delete props `headerLabelFormats` and `subHeaderLabelFormats` not you can pass `formatLabel` function to `DateHeader` with label width and start and end time of intervals


## 0.26.7

Expand Down Expand Up @@ -49,11 +67,11 @@ Using controlled scroll and react-spring to trigger scrolling and create an anim

* add documentation for `onItemDeselect` #350 @ilaiwi
* solve a bug where `onItemDeselect` is not triggered as expected for several item clicks #350 @ilaiwi
* fix row height on browser scaling #615 @gaston-niglia
* fix row height on browser scaling #615 @gaston-niglia

### Packages

update to `[email protected]` for newer versions of node.
update to `[email protected]` for newer versions of node.

## 0.26.2

Expand Down Expand Up @@ -85,7 +103,7 @@ you can as well solve the issue without upgrading by adding the following style

#### Breaking

* Removed `<InfoLabel />` in favour of allowing for custom component to be rendered on move or resize. Check out the demo in `demo/app/demo-custom-info-label` for an example on how to display your own custom info label or [this example](https://codesandbox.io/s/timeline-demo-info-label-neec9).
* Removed `<InfoLabel />` in favour of allowing for custom component to be rendered on move or resize. Check out the demo in `demo/app/demo-custom-info-label` for an example on how to display your own custom info label or [this example](https://codesandbox.io/s/timeline-demo-info-label-neec9).


## 0.25.4
Expand Down Expand Up @@ -383,7 +401,7 @@ from 'react-calendar-timeline'

* added `stickyHeader` to disable/enable timeline header sticking on scroll.
* removed `fullUpdate` prop and functionality. Labels rely on `position: sticky` to show for items that start before `visibleTimeStart`. This (should) greatly improve scroll performance.
* removed extraneous css such as `text-align: center` on `.rct-item`, `.rct-item-overflow` to simplify the dom structure of `Item.js`
* removed extraneous css such as `text-align: center` on `.rct-item`, `.rct-item-overflow` to simplify the dom structure of `Item.tsx`
* added `headerRef` callback to receive a reference to the header element. Due to the change in how the header positioning is implemented (i.e. using `position: sticky`), there is a need to use a polyfill in [certain browsers](https://caniuse.com/#feat=css-sticky) that don't support `position: sticky`. With a reference to the header dom element, you can use a polyfill to apply sticky behavior.
* `minimumWidthForItemContentVisibility` prop to control at what width inner item content is rendered.

Expand Down
48 changes: 43 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@

# React Calendar Timeline

A modern and responsive React timeline component.

**🎉 Version 0.30.0-beta.1 Now Available!**

We're excited to announce the beta release of v0.30.0 which includes:
- Full TypeScript rewrite
- Vite as bundler
- Updated dependencies to latest versions
- React 18+ support

The beta version is available via:
```bash
npm install react-calendar-timeline@beta
```

We encourage users to try out the beta and provide feedback before the stable release. Please report any issues on GitHub.

Note: Testing framework has been updated and some tests are currently being migrated.

# ⚠️⚠️⚠️⚠️ HELP WANTED
please email me [[email protected]](mailto:[email protected]) and we will setup some time to speak and see if you can help maintain this library.

![calendar demo](https://raw.githubusercontent.com/namespace-ee/react-calendar-timeline/master/demo.gif)

Checkout the [examples here](https://github.com/namespace-ee/react-calendar-timeline/tree/master/examples)!
Expand Down Expand Up @@ -140,6 +161,14 @@ The exact viewport of the calendar. When these are specified, scrolling in the c

**Note that you need to provide either `defaultTimeStart/End` or `visibleTimeStart/End` for the timeline to function**

## buffer

a number (default to 3) which represents the extra timeline rendered on right and lift of the visible area which the user will scroll through before the time rerenders.

more explication in section [behind the scenes](#behind-the-scenes)

Note: setting buffer to 1 will disable the scrolling on the timeline

## selected

An array with id's corresponding to id's in items (`item.id`). If this prop is set you have to manage the selected items yourself within the `onItemSelect` handler to update the property with new id's and use `onItemDeselect` handler to clear selection. This overwrites the default behaviour of selecting one item on click.
Expand Down Expand Up @@ -202,6 +231,7 @@ What percentage of the height of the line is taken by the item? Default `0.65`

Smallest time the calendar can zoom to in milliseconds. Default `60 * 60 * 1000` (1 hour)

__notes__: please note than second won't show up unless you change this to `60 * 1000`
## maxZoom

Largest time the calendar can zoom to in milliseconds. Default `5 * 365.24 * 86400 * 1000` (5 years)
Expand Down Expand Up @@ -312,7 +342,7 @@ Called when an empty spot on the canvas was double clicked. Get the group ID and

Called when the canvas is clicked by the right button of the mouse. Note: If this property is set the default context menu doesn't appear

## onZoom(timelineContext)
## onZoom(timelineContext, unit)

Called when the timeline is zoomed, either via mouse/pinch zoom or clicking header to change timeline units

Expand Down Expand Up @@ -342,7 +372,7 @@ function (action, item, time, resizeEdge) {
```


## onTimeChange(visibleTimeStart, visibleTimeEnd, updateScrollCanvas)
## onTimeChange(visibleTimeStart, visibleTimeEnd, updateScrollCanvas, unit)

A function that's called when the user tries to scroll. Call the passed `updateScrollCanvas(start, end)` with the updated visibleTimeStart and visibleTimeEnd (as unix timestamps in milliseconds) to change the scroll behavior, for example to limit scrolling.

Expand Down Expand Up @@ -435,8 +465,8 @@ Rather than applying props on the element yourself and to avoid your props being
* onTouchEnd: event handler
* onDoubleClick: event handler
* onContextMenu: event handler
* style: inline object
* style: inline object


\*\* _the given styles will only override the styles that are not a requirement for positioning the item. Other styles like `color`, `radius` and others_

Expand Down Expand Up @@ -915,6 +945,12 @@ by default we provide a responsive format for the dates based on the label width
mediumLong: 'HH:mm',
medium: 'HH:mm',
short: 'mm',
},
second: {
"long": 'mm:ss',
mediumLong: 'mm:ss',
medium: 'mm:ss',
"short": 'ss'
}
}
```
Expand Down Expand Up @@ -1236,6 +1272,8 @@ This results in a visually endless scrolling canvas with optimal performance.

Extensibility and usability: While some parameters (`onTimeChange`, `moveResizeValidator`) might be hard to configure, these are design decisions to make it as extensible as possible. If you have recipes for common tasks regarding those parameters, send a PR to add them to this doc.

Note: 3x can be controlled by changing the buffer

## Interaction

To interact and navigate within the timeline there are the following options for the user:
Expand Down Expand Up @@ -1263,7 +1301,7 @@ $ yarn start

Check http://0.0.0.0:8888/ in your browser and have fun!

Please run `npm run lint` before you send a pull request. `npm run jest` runs the tests.
Please run `npm run lint` before you send a pull request. `npm run test` runs the jest tests.

<!--

Expand Down
1 change: 1 addition & 0 deletions __fixtures__/stateAndProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const props = {
itemHeightRatio: 0.75,
visibleTimeEnd,
visibleTimeStart,
buffer: 3,
}

export const propsNoStack = {
Expand Down
Loading