Skip to content

Commit

Permalink
feat: migrate back to Vanilla-Calendar-Pro (#1256)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding authored Aug 24, 2024
1 parent c68395d commit 40f2c34
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 98 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
- See the [Editors - Wiki](../Editors.md) for more general info about Editors (validators, event handlers, ...)

### Information
The Date Editor is provided through an external library named [Vanilla-Calendar-Picker](https://github.com/ghiscoding/vanilla-calendar-picker) (a fork of [Vanilla-Calendar-Pro](https://vanilla-calendar.pro)) and all options from that library can be added to your `editorOptions` (see below), so in order to add things like minimum date, disabling dates, ... just review all the [Vanilla-Calendar-Pro](https://vanilla-calendar.pro/docs/reference/additionally/settings) and then add them into `editorOptions`. We use [Tempo](https://tempo.formkit.com/) to parse and format Dates to the chosen format (when `type`, `outputType` and/or `saveType` are provided in your column definition)

We use an external lib named [Vanilla-Calendar](https://vanilla-calendar.pro/), however please note that since there were some features missing, I forked the project as [vanilla-calendar-picker](https://github.com/ghiscoding/vanilla-calendar-picker) with the hope that all features will eventually be merged to the original repo (if and what that happens, it will be entirely transparent to the user).
The Date Editor is provided through an external library named [Vanilla-Calendar-Pro](https://vanilla-calendar.pro) and all options from that library can be added to your `editorOptions` (see below), so in order to add things like minimum date, disabling dates, ... just review all the [Vanilla-Calendar-Pro](https://vanilla-calendar.pro/docs/reference/additionally/settings) and then add them into `editorOptions`. We use [Tempo](https://tempo.formkit.com/) to parse and format Dates to the chosen format (when `type`, `outputType` and/or `saveType` are provided in your column definition)

> **Note** Also just so you know, `editorOptions` is used by all other editors as well to expose external library like Autocompleter, Multiple-Select, etc...
Expand Down
4 changes: 2 additions & 2 deletions docs/migrations/migration-to-8.x.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Version 8 - Better UI and Dark Mode with Pure CSS SVG icons ✨
This new release brings a lot of changes oriented towards better UI/UX, our SVG icons are now pure CSS and can be colorized like any other text via the native CSS `color` property (which helps a lot to improve the Dark Mode Theme).

Another noticeable UI change is the migration from [Flatpickr](https://flatpickr.js.org/) to [Vanilla-Calendar-Picker](https://github.com/ghiscoding/vanilla-calendar-picker) (which is a fork of [Vanilla-Calendar-Pro](https://vanilla-calendar.pro/) and we'll hopefully drop the fork in the near future if possible), there are multiple reasons to migrate our date picker to another library as shown below. Another change that is mostly internal but is also indirectly connected to the date picker is the migration from MomentJS to [Tempo](https://tempo.formkit.com/) which is modern and is packaged as ESM which is great for Tree Shaking.
Another noticeable UI change is the migration from [Flatpickr](https://flatpickr.js.org/) to [Vanilla-Calendar-Pro](https://vanilla-calendar.pro/), there are multiple reasons to migrate our date picker to another library as shown below. Another change that is mostly internal but is also indirectly connected to the date picker is the migration from MomentJS to [Tempo](https://tempo.formkit.com/) which is modern and is packaged as ESM which is great for Tree Shaking.

##### Flatpickr cons:
- barely supported (lots of opened PR but nothing merged for the past 2 years)
Expand Down Expand Up @@ -218,7 +218,7 @@ prepareGrid() {
}
```

> **Note** the `'today'` shortcut currently only exist in `Vanilla-Calendar-Picker` fork (a PR has also been opened on the original lib), however the rest of the settings should be the same, visit `Vanilla-Calendar-Pro` [settings](https://vanilla-calendar.pro/docs/reference/additionally/settings) website for all other options. The hope is to hopefully drop the fork whenever the original project receives all missing features.
> **Note** visit `Vanilla-Calendar-Pro` [settings](https://vanilla-calendar.pro/docs/reference/additionally/settings) website for all other options.
> **Note** to keep docs available for older as well as newer versions, I renamed the old one doc as [Date-Picker (flatpickr)](https://ghiscoding.gitbook.io/slickgrid-universal/column-functionalities/editors/date-editor-flatpickr) and created a new one named [Date-Picker (vanilla-calendar)](https://ghiscoding.gitbook.io/slickgrid-universal/column-functionalities/editors/date-editor-vanilla-calendar).
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@jest/types": "^29.6.3",
"@lerna-lite/cli": "^3.8.0",
"@lerna-lite/publish": "^3.8.0",
"@slickgrid-universal/common": "^5.5.2",
"@slickgrid-universal/common": "^5.6.0",
"@types/jest": "^29.5.12",
"@types/node": "^22.5.0",
"conventional-changelog-conventionalcommits": "^7.0.2",
Expand Down
10 changes: 5 additions & 5 deletions packages/aurelia-slickgrid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@
"@aurelia/runtime": "^2.0.0-beta.21",
"@aurelia/runtime-html": "^2.0.0-beta.21",
"@formkit/tempo": "^0.1.2",
"@slickgrid-universal/common": "~5.5.2",
"@slickgrid-universal/custom-footer-component": "~5.5.2",
"@slickgrid-universal/empty-warning-component": "~5.5.2",
"@slickgrid-universal/common": "~5.6.0",
"@slickgrid-universal/custom-footer-component": "~5.6.0",
"@slickgrid-universal/empty-warning-component": "~5.6.0",
"@slickgrid-universal/event-pub-sub": "~5.5.2",
"@slickgrid-universal/pagination-component": "~5.5.2",
"@slickgrid-universal/row-detail-view-plugin": "~5.5.2",
"@slickgrid-universal/pagination-component": "~5.6.0",
"@slickgrid-universal/row-detail-view-plugin": "~5.6.0",
"@slickgrid-universal/utils": "~5.5.1",
"dequal": "^2.0.3",
"sortablejs": "^1.15.2"
Expand Down
20 changes: 10 additions & 10 deletions packages/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,19 @@
"@fnando/sparkline": "^0.3.10",
"@formkit/tempo": "^0.1.2",
"@popperjs/core": "^2.11.8",
"@slickgrid-universal/common": "^5.5.2",
"@slickgrid-universal/composite-editor-component": "^5.5.2",
"@slickgrid-universal/custom-tooltip-plugin": "^5.5.2",
"@slickgrid-universal/excel-export": "^5.5.2",
"@slickgrid-universal/graphql": "^5.5.2",
"@slickgrid-universal/odata": "^5.5.2",
"@slickgrid-universal/row-detail-view-plugin": "^5.5.2",
"@slickgrid-universal/rxjs-observable": "^5.5.2",
"@slickgrid-universal/text-export": "^5.5.2",
"@slickgrid-universal/common": "^5.6.0",
"@slickgrid-universal/composite-editor-component": "^5.6.0",
"@slickgrid-universal/custom-tooltip-plugin": "^5.6.0",
"@slickgrid-universal/excel-export": "^5.6.0",
"@slickgrid-universal/graphql": "^5.6.0",
"@slickgrid-universal/odata": "^5.6.0",
"@slickgrid-universal/row-detail-view-plugin": "^5.6.0",
"@slickgrid-universal/rxjs-observable": "^5.6.0",
"@slickgrid-universal/text-export": "^5.6.0",
"aurelia": "^2.0.0-beta.21",
"aurelia-slickgrid": "workspace:*",
"bootstrap": "^5.3.3",
"i18next": "^23.13.0",
"i18next": "^23.14.0",
"i18next-fetch-backend": "^6.0.0",
"rxjs": "^7.8.1"
},
Expand Down
150 changes: 75 additions & 75 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions test/cypress/e2e/example06.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,10 @@ describe('Example 6 - GraphQL Grid', () => {
});

it('should open Date picker and expect date range between 01-Jan to 15-Feb', () => {
cy.get('.search-filter.filter-finish.filled')
.click();
cy.get('.search-filter.filter-finish.filled input')
.click({ force: true });

cy.get('.vanilla-calendar:visible');

cy.get('.vanilla-calendar-column:nth(0) .vanilla-calendar-month')
.should('have.text', 'January');
Expand Down

0 comments on commit 40f2c34

Please sign in to comment.