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

Lit element v2 RC #129

Merged
merged 70 commits into from
Jan 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
c00e292
Added 5 star rating badge (#121)
binhbbui411 Apr 12, 2018
002a2c3
:boom: :truck: Upgrade to Polymer 3 (#125)
jordanfinners Dec 3, 2018
38fe6f2
🔥 Minor cleanup
motss Dec 3, 2018
0b9f920
📝 Updated README
motss Dec 3, 2018
e186d52
🐛 Trying to fix broken fallback for unsupported browsers without nati…
motss Dec 3, 2018
e36bedd
✅ Trying to fix broken tests
motss Dec 3, 2018
b018910
✅ Trying to fix broken tests
motss Dec 3, 2018
d77518b
✅ Trying to fix broken tests
motss Dec 3, 2018
1238898
📝 Updated browser support section
motss Dec 3, 2018
ff2ea09
🔖 v3.0.0-alpha.0
motss Dec 4, 2018
15e3259
🚧 WIP - Migrating to LitElement
motss Dec 4, 2018
2a9b85f
🚧 WIP - Implemented simple datepicker dialog, working on datepicker
motss Dec 5, 2018
1484692
🚧 WIP - working on calendar
motss Dec 6, 2018
39003e5
✨ Added `weekNumberType` to compute calendar's week number by differe…
motss Dec 7, 2018
12eaa94
🐛 src: Fixed calendar rendering
motss Dec 8, 2018
76cc7e7
💄 src: Material Design 2 UI
motss Dec 9, 2018
299162d
🚧 src: Added implementation logics for date selection
motss Dec 9, 2018
a79fcf4
🐛 src: Updated calendar to display week numbers
motss Dec 10, 2018
b3bf2de
⚡️ src: Improved perf when rendering full calendar
motss Dec 10, 2018
ba6661d
💩 src: Minor code fix
motss Dec 10, 2018
d1f5996
✨ src: Implemented dragging functionality
motss Dec 13, 2018
5d0248e
🐛 src: Fixed tracking not working on touch devices
motss Dec 14, 2018
a64214f
⬆️ package.json: Upgraded deps
motss Dec 14, 2018
a448922
🐛 src: Fixed re-rendering issue that causes perf hit
motss Dec 16, 2018
c2a8f88
🐛 src: Bug fix for calendar rendering when `showWeekNumber` is set
motss Dec 16, 2018
820cd9f
⚡️ src: Improved perf in tracking on calendar
motss Dec 17, 2018
e12e74d
💩 src: Minor code update
motss Dec 18, 2018
d4c658f
💩 src: Code refactoring then minor cleanup
motss Dec 18, 2018
eca4b97
🚨 src: Fixed linter warnings
motss Dec 18, 2018
8503d5a
⚡️ src: Reduced re-render overhead
motss Dec 18, 2018
79c0f02
🚧 WIP - migrating to use `PointerTracker`
motss Dec 20, 2018
24514af
💄 src: Added missing `disabled` styling for disabled calendar day
motss Dec 21, 2018
5b1d3cb
🔥 src: Removed all Polymer-based elements
motss Dec 21, 2018
f68cbc9
✨ src: Added keyboard support for calendar
motss Dec 22, 2018
933a36d
✨ Added getter and setter for new attribute/ property `value`
motss Dec 23, 2018
37c6935
✨ src: Added `landscape` and `startView` attributes
motss Dec 23, 2018
eff97ec
✨ src: Fired first updated event with 1st focusable element
motss Dec 23, 2018
42bc099
✨ src: Added abort dragging functionality for out-of-bound calendar
motss Dec 23, 2018
a5b3d12
🐛 src: Out-of-bound `max` date
motss Dec 23, 2018
e939cb1
🔥 src: Temporarily removed tracking functionality
motss Dec 25, 2018
e15fca7
✨ src: Added new Tracker class for tracking/ dragging element
motss Dec 26, 2018
e55d8e6
⬆️ package.json: Upgraded Rollup
motss Dec 30, 2018
a108fcd
✨ src: Implemented <AppDatepickerDialog>
motss Jan 2, 2019
55a4156
⬆️ package.json: Upgraded deps
motss Jan 4, 2019
d933510
💄 src: Minor CSS update to match that of native Android datepicker
motss Jan 4, 2019
f4cf001
✨ src: Improved keyboard support on datepicker dialog
motss Jan 6, 2019
71e5e38
🔥 src: Code cleanup
motss Jan 7, 2019
5ca1bea
💥 src: Updated to latest lit-element and lit-html
motss Jan 11, 2019
9cd429d
💥 src: Updated to latest lit-element and reinstall @material/mwc-button
motss Jan 12, 2019
00d5834
🔖 v4.0.0-rc.0
motss Jan 12, 2019
6c011c9
🔖 v4.0.0-rc.1
motss Jan 12, 2019
dd6a830
🔧 package.json: Fixed entrypoint
motss Jan 12, 2019
74c768b
🔖 v4.0.0-rc.2
motss Jan 12, 2019
9db60d2
✅ test: WIP - adding missing tests
motss Jan 14, 2019
c7f5ae5
⬆️ dep: Upgraded deps
motss Jan 19, 2019
0ddb5eb
🔖 v4.0.0-rc.3
motss Jan 19, 2019
0e26f0b
🔖 v4.0.0-rc.4
motss Jan 19, 2019
fd582c3
✅ src: Updated tests
motss Jan 19, 2019
5863b41
🐛 src: Fixes a formatted date bug in different time zone, e.g. PST
motss Jan 21, 2019
758a395
🐛 src: Fixes a bug where year is not formatted with `locale`
motss Jan 22, 2019
306c05f
🐛 src: Fixes polyfill.io not working as expected
motss Jan 23, 2019
d82cae9
✅ ci: Fixes tests due to SauceLabs' configuration on different browsers
motss Jan 24, 2019
8f5dbaf
💚 ci: Added `firefox` for local testings on CI only
motss Jan 24, 2019
3d60a15
✅ test: Adds more tests to perfect the datepicker
motss Jan 27, 2019
02507e6
✅ src: Removes redundant tests and fixes failed tests due to LTR mark
motss Jan 28, 2019
f845061
✅ test: Improved tests
motss Jan 28, 2019
f4dd988
✅ src: Fixes broken tests due to IE11 on Windows 7
motss Jan 28, 2019
b3fffc8
✅ test: Adds more tests and minor update on .gitignore
motss Jan 29, 2019
5699a55
✅ test: Updates tests to test formatted weekdays in different locale
motss Jan 30, 2019
4d4984a
✅ test: Fixes broken test on Safari 9
motss Jan 30, 2019
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
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
trim_trailing_whitespace = false
6 changes: 4 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@
# checkin and prevent conversion to CRLF when they are checked out
# (this is required in order to prevent newline related issues like,
# for example, after the build script is run)
*.* text eol=lf
.* text eol=lf
*.css text eol=lf
*.html text eol=lf
*.js text eol=lf
*.json text eol=lf
*.scss text eol=lf
*.md text eol=lf
*.scss text eol=lf
*.sh text eol=lf
*.ts text eol=lf
*.tsx text eol=lf
*.txt text eol=lf
*.xml text eol=lf
*.yaml text eol=lf
*.yml text eol=lf
20 changes: 18 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
bower_components*
bower-*.json
# .gitignore 101 - https://www.quora.com/Does-gitignore-file-only-work-on-current-folder

# dot files
.*cache
.build/
.DS_Store
.tmp/
.vscode
*.env

# debug
*.log*

# folders
coverage*/
dist*/
node_modules/

# Do not ignore
5 changes: 5 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# User config
package-lock=true
progress=true
quiet=true
update-binary=true
48 changes: 37 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,42 @@
language: node_js
sudo: required
before_script:
- npm install -g polymer-cli
- polymer install --variants
node_js: stable
dist: trusty
node_js:
- '8'
- '10'
addons:
firefox: latest
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
chrome: stable
cache:
directories:
- node_modules
before_install:
- npm i -g npm@latest polymer-cli@latest
install:
- npm ci --quiet
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- npm run ts
script:
- xvfb-run polymer test
dist: trusty
- npm run test:ci
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
npm run test:ci --
-s 'windows 7/internet explorer@11'
-s 'windows 10/microsoftedge@18'
-s 'windows 10/microsoftedge@17'
-s 'windows 10/microsoftedge@13'
-s 'os x 10.11/safari@9'
-s 'macos 10.12/[email protected]'
-s 'macos 10.13/[email protected]'
-s 'macos 10.13/safari@12'
-s 'Linux/chrome@41'
-s 'windows 10/chrome@70'
-s 'windows 10/firefox@62'
-s 'windows 10/firefox@63';
fi

# Should you require setup for TravisCI with Saucelabs?
# Watch https://www.youtube.com/watch?v=afy_EEq_4Go

# Platform configuration: https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/
5 changes: 0 additions & 5 deletions .yo-rc.json

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
The MIT License (MIT)
Copyright © 2017 Rong Sen Ng <wes_ngrongsen@hotmail.com>
Copyright © 2018 Rong Sen Ng <wes.ngrongsen@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
136 changes: 20 additions & 116 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,127 +1,31 @@
[![GitHub version](https://badge.fury.io/gh/motss%2Fapp-datepicker.svg)](http://badge.fury.io/gh/motss%2Fapp-datepicker)
[![Bower version](https://badge.fury.io/bo/app-datepicker.svg)](http://badge.fury.io/bo/app-datepicker)
[![Build Status](https://travis-ci.org/motss/app-datepicker.svg?branch=master)](https://travis-ci.org/motss/app-datepicker)
<div align="center" style="text-align: center;">
<h1 style="border-bottom: none;">app-datepicker</h1>

# app-datepicker (formerly `jv-datepicker`)
![img-app-datepicker](https://cloud.githubusercontent.com/assets/10607759/26274668/48b75cce-3d81-11e7-81aa-b79ab9b90d36.png)
<p>Datepicker element built with lit-element and Material Design 2</p>
</div>

<!-- ![light-themed-app-datepicker-landscape](https://cloud.githubusercontent.com/assets/10607759/10119266/ce6d5b0e-64c3-11e5-843d-1310de755315.png)
![dark-themed-app-datepicker-portrait](https://cloud.githubusercontent.com/assets/10607759/10119265/c9ad900c-64c3-11e5-937e-338a770eebea.png) -->
<!-- ![app-datepicker-landscape](https://cloud.githubusercontent.com/assets/10607759/9871233/c9e33d04-5bc4-11e5-8af9-d93d080d8815.PNG) -->
<!-- ![app-datepicker-portrait](https://cloud.githubusercontent.com/assets/10607759/9871234/cacf33c6-5bc4-11e5-833a-96cbd3dbf440.PNG) -->
<!-- ![dark-themed-app-datepicker](https://cloud.githubusercontent.com/assets/10607759/10106751/1bec71c0-63e9-11e5-93f2-ee197d2ba0f2.png) -->
<hr />

> A different way of `datepicker`-ing on the web.

Stay tuned for more update on imminent release! 🎉

See the [component page](http://motss.github.io/app-datepicker/components/app-datepicker/) for more information.
Meantime, feel free to check the older version out at:

An custom Polymer element built from scratch to provide a datepicker based on Google's Material Design that is more compelling and rich with features.
1. [`2.x` branch][2-x-url] - Built with Material Design and [Polymer 2][polymer-2-url], published at Bower.
2. [`3.x` branch][3-x-url] - Built with Material Design and [Polymer 3][polymer-3-url], published at NPM.

![screen shot 2019-01-30 at 12 49 30](https://user-images.githubusercontent.com/10607759/51959002-857c1100-248d-11e9-8d1a-9abbafdb2385.png)

## Update (v2.11.0)
- **Pleased to announce that `app-datepicker` is now compatible with both Polymer 1.x and Polymer 2.0 stable.**
- **Now Intl polyfill will not load (previously it does) if the browser does not natively support it and it is recommended for users to load the polyfill at the top-level document by some feature detections.**
- `alwaysResetSelectedDateOnDialogClose` - proposed by [#74](https://github.com/motss/app-datepicker/issues/74) to allow datepicker to reset the selected date to today's date once the datepicker closes and the demo has this included as well.
- As of `v2.11`, all dates will no longer include users' local system's timezone offset and all will be default to GMT/ UTC timezone. For more info, please see [#89](https://github.com/motss/app-datepicker/pull/89).

Example:

<app-datepicker></app-datepicker>
<app-datepicker view="horizontal"></app-datepicker>
<app-datepicker theme="dark-theme"></app-datepicker>
<app-datepicker-dialog modal></app-datepicker-dialog>
<app-datepicker-dialog with-backdrop></app-datepicker-dialog>
<app-datepicker-dialog></app-datepicker-dialog>

`app-datepicker` provides a regular datepicker element.
While `app-datepicker-dialog` has a `app-datepicker` being wrapped inside a dialog.


~~## ( Coming soon!) Generating your own boilerplate code of the compounds~~
~~At the end of the demo, there is a section where user can play around with to generate your own boilerplate code with the attributes provided.~~


## Styling
Now with mixins, head over to the [component page](http://motss.github.io/app-datepicker/components/app-datepicker/) for more details.


## Getting Started
1. Install with bower.
`bower install --save app-datepicker`

2. Load the dependencies and the Intl polyfill if needed.

Load [`Intl Polyfill`](https://github.com/andyearnshaw/Intl.js) for unsupported browsers via feature detection,

```js
if (window.Intl) {
var intlPolyfill = document.createElement('script');
intlPolyfill.src = 'path_to_intl_polyfill';
document.head.appendChild(intlPolyfill);
}
```

For `app-datepicker`,

```html
<link rel="import" href="path-to-bower-components/app-datepicker/app-datepicker.html">
```
For `app-datepicker-dialog`,

```html
<link rel="import" href="path-to-bower-components/app-datepicker/app-datepicker-dialog.html">
```

3. Markup with `<app-datepicker></app-datepicker>` or `<app-datepicker-dialog></app-datepicker-dialog>`.

4. Done.

## Browser Support

### `app-datepicker` and `app-datepicker-dialog`:

#### Microsoft Windows x64
| ![Internet Explorer](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/internet-explorer/internet-explorer_48x48.png) | ![Microsoft Edge](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/edge/edge_48x48.png) | ![Mozilla Firefox](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/firefox/firefox_48x48.png) ![Mozilla Firefox Developer Edition](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/firefox-developer-edition/firefox-developer-edition_48x48.png) | ![Google Chrome](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/chrome/chrome_48x48.png) ![Google Chrome Canary](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/archive/chrome-canary_19-48/chrome-canary_19-48_48x48.png) | ![Opera](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/opera/opera_48x48.png) ![Opera Developer Edition](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/opera-developer/opera-developer_48x48.png)
| --- | --- | --- | --- | ---
| 11 | 12+ | latest | latest | latest


#### Linux x64
| ![Mozilla Firefox](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/firefox/firefox_48x48.png) ![Mozilla Firefox Developer Edition](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/firefox-developer-edition/firefox-developer-edition_48x48.png) | ![Google Chrome](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/chrome/chrome_48x48.png) ![Google Chrome Canary](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/archive/chrome-canary_19-48/chrome-canary_19-48_48x48.png) | ![Opera](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/opera/opera_48x48.png) ![Opera Developer Edition](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/opera-developer/opera-developer_48x48.png)
| --- | --- | ---
| latest | latest | latest


#### Mac OS X
| ![Mozilla Firefox](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/firefox/firefox_48x48.png) ![Mozilla Firefox Developer Edition](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/firefox-developer-edition/firefox-developer-edition_48x48.png) | ![Google Chrome](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/chrome/chrome_48x48.png) ![Google Chrome Canary](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/archive/chrome-canary_19-48/chrome-canary_19-48_48x48.png) | ![Opera](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/opera/opera_48x48.png) ![Opera Developer Edition](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/opera-developer/opera-developer_48x48.png) | ![Safari](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/safari/safari_48x48.png) ![Safari Technology Preview](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/safari-technology-preview/safari-technology-preview_48x48.png)
| --- | --- | --- | ---
| latest | latest | latest | 7+


#### Android 4.4.4 and above

| ![Mozilla Firefox](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/firefox/firefox_48x48.png) | ![Google Chrome](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/chrome/chrome_48x48.png) ![Google Chrome Dev](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/chrome-dev/chrome-dev_48x48.png) | ![Opera](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/opera/opera_48x48.png) | ![Android WebView](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/android-webview-beta/android-webview-beta_48x48.png)
| --- | --- | --- | ---
| latest | latest | latest | latest

#### iOS 7.1 and above
| ![Mozilla Firefox](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/firefox/firefox_48x48.png) | ![Google Chrome](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/chrome/chrome_48x48.png) | ![Opera](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/opera/opera_48x48.png) | ![Safari for iOS](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/safari-ios/safari-ios_48x48.png)
| --- | --- | --- | ---
| latest | latest | latest | 7+

### [Intl.DateTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat)

ECMAScript Internationalization API for `locale`. For more details please visit [Can I use... Intl?](http://caniuse.com/#search=intl):


| ![Internet Explorer](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/internet-explorer/internet-explorer_48x48.png) | ![Microsoft Edge](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/edge/edge_48x48.png) | ![Mozilla Firefox](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/firefox/firefox_48x48.png) ![Mozilla Firefox Developer Edition](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/firefox-developer-edition/firefox-developer-edition_48x48.png) | ![Google Chrome](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/chrome/chrome_48x48.png) ![Google Chrome Canary](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/archive/chrome-canary_19-48/chrome-canary_19-48_48x48.png) | ![Opera](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/opera/opera_48x48.png) ![Opera Developer Edition](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/opera-developer/opera-developer_48x48.png) | ![Safari](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/safari/safari_48x48.png) ![Safari Technology Preview](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/35.1.0/safari-technology-preview/safari-technology-preview_48x48.png)
| --- | --- | --- | --- | --- | --- |
| 11 | 12+ | latest | latest | latest | 10+ **
## License

___** [Intl Polyfill for unsupported browsers](https://github.com/andyearnshaw/Intl.js)___
[MIT License](http://motss.mit-license.org/) © Rong Sen Ng

## Throughput
[![Throughput Graph](https://graphs.waffle.io/motss/app-datepicker/throughput.svg)](https://waffle.io/motss/app-datepicker/metrics/throughput)
[2-x-url]: https://github.com/motss/app-datepicker/tree/2.x
[3-x-url]: https://github.com/motss/app-datepicker/tree/3.x
[polymer-2-url]: https://polymer-library.polymer-project.org/2.0/docs/devguide/feature-overview
[polymer-3-url]: https://polymer-library.polymer-project.org/3.0/docs/devguide/feature-overview

## License
[MIT License](http://motss.mit-license.org/) © Rong Sen Ng
[intl-polyfill-url]: https://github.com/andyearnshaw/Intl.js
[web-animations-js-polyfill-url]: https://www.npmjs.com/package/web-animations-js
[polymer-3-browser-support-url]: https://polymer-library.polymer-project.org/3.0/docs/browsers
42 changes: 0 additions & 42 deletions animations/datepicker-slide-from-bottom-animation.html

This file was deleted.

44 changes: 0 additions & 44 deletions animations/datepicker-slide-from-left-animation.html

This file was deleted.

Loading