-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐨 new update for more optimized datepicker with three added features
- Loading branch information
Showing
10 changed files
with
908 additions
and
1,153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "jv-datepicker", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"authors": [ | ||
"motss <[email protected]>" | ||
], | ||
|
@@ -28,18 +28,21 @@ | |
"README.md" | ||
], | ||
"dependencies": { | ||
"polymer": "Polymer/polymer#^1.1.3", | ||
"iron-media-query": "PolymerElements/iron-media-query#~1.0.2", | ||
"neon-animation": "PolymerElements/neon-animation#~1.0.6", | ||
"paper-checkbox": "PolymerElements/paper-checkbox#~1.0.10", | ||
"paper-dialog": "PolymerElements/paper-dialog#~1.0.1", | ||
"paper-icon-button": "PolymerElements/paper-icon-button#~1.0.3", | ||
"iron-list": "PolymerElements/iron-list#~1.1.5", | ||
"paper-slider": "PolymerElements/paper-slider#~1.0.7", | ||
"test-fixture": "PolymerElements/test-fixture#~1.0.1", | ||
"iron-test-helpers": "PolymerElements/iron-test-helpers#~1.0.6" | ||
"polymer": "Polymer/polymer#^1.2.0", | ||
"iron-list": "PolymerElements/iron-list#~1.1.7", | ||
"iron-selector": "PolymerElements/iron-selector#~1.0.8", | ||
"neon-animation": "PolymerElements/neon-animation#~1.0.9", | ||
"paper-icon-button": "PolymerElements/paper-icon-button#~1.0.6" | ||
}, | ||
"devDependencies": { | ||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0" | ||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0", | ||
"iron-demo-helpers": "PolymerElements/iron-demo-helpers#~1.0.3", | ||
"iron-label": "PolymerElements/iron-label#~1.0.1", | ||
"iron-validator-behavior": "PolymerElements/iron-validator-behavior#~1.0.1", | ||
"paper-button": "PolymerElements/paper-button#~1.0.11", | ||
"paper-checkbox": "PolymerElements/paper-checkbox#~1.1.0", | ||
"paper-dialog": "PolymerElements/paper-dialog#~1.0.3", | ||
"paper-input": "PolymerElements/paper-input#~1.1.4", | ||
"web-component-tester": "^3.4.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,76 @@ | ||
<link rel="import" href="../polymer/polymer.html"> | ||
<link rel="import" href="jv-datepicker.html"> | ||
<link rel="import" href="../neon-animation/neon-animation-runner-behavior.html"> | ||
|
||
<link rel="import" href="../paper-dialog-behavior/paper-dialog-behavior.html"> | ||
<link rel="import" href="../paper-styles/paper-styles.html"> | ||
<link rel="import" href="../paper-button/paper-button.html"> | ||
<link rel="import" href="jv-datepicker-dialog-theme.html"> | ||
|
||
<link rel="import" href="../neon-animation/neon-animation-runner-behavior.html"> | ||
|
||
<dom-module id="jv-datepicker-dialog"> | ||
<template strip-whitespace> | ||
<style include="jv-datepicker-dialog-theme"></style> | ||
<style> | ||
:host { | ||
-webkit-user-select: none; | ||
-moz-user-select: none; | ||
-ms-user-select: none; | ||
user-select: none; | ||
box-sizing: border-box; | ||
|
||
<!-- Main codes starts here --> | ||
<div class="container layout vertical flex-auto"> | ||
<!-- jv-datepicker's code --> | ||
<jv-datepicker class="flex-auto layout vertical content" | ||
first-day-of-week="{{firstDayOfWeek}}" | ||
disable-days="{{disableDays}}" | ||
date-format="{{dateFormat}}" | ||
bind-date="{{_dateOnHold}}"></jv-datepicker> | ||
display: block; | ||
} | ||
</style> | ||
|
||
<!-- Dialog buttons --> | ||
<div id="buttonContainer" class="buttons layout horizontal"> | ||
<jv-datepicker class="no-padding" first-day-of-week="[[firstDayOfWeek]]" disable-days="[[disableDays]]" min-date="[[minDate]]" max-date="[[maxDate]]" format="format" date="{{date}}" show-long-date="[[showLongDate]]"> | ||
<div class="buttons"> | ||
<paper-button dialog-dismiss>cancel</paper-button> | ||
<paper-button dialog-confirm autofocus on-tap="updateBindDate">ok</paper-button> | ||
<paper-button dialog-confirm>ok</paper-button> | ||
</div> | ||
</div> | ||
</jv-datepicker> | ||
</template> | ||
|
||
<script> | ||
(function() { | ||
Polymer({ | ||
is: 'jv-datepicker-dialog', | ||
|
||
properties: { | ||
firstDayOfWeek: Number, | ||
disableDays: Array, | ||
dateFormat: String, | ||
bindDate: { | ||
type: String, | ||
notify: true | ||
}, | ||
_dateOnHold: String | ||
}, | ||
Polymer({ | ||
is: 'jv-datepicker-dialog', | ||
|
||
behaviors: [ | ||
Polymer.PaperDialogBehavior, | ||
Polymer.NeonAnimationRunnerBehavior | ||
], | ||
|
||
listeners: { | ||
'neon-animation-finish': '_onNeonAnimationFinish' | ||
}, | ||
_renderOpened: function() { | ||
if (this.withBackdrop) { | ||
this.backdropElement.open(); | ||
} | ||
this.playAnimation('entry'); | ||
}, | ||
_renderClosed: function() { | ||
if (this.withBackdrop) { | ||
this.backdropElement.close(); | ||
} | ||
this.playAnimation('exit'); | ||
}, | ||
_onNeonAnimationFinish: function() { | ||
if (this.opened) { | ||
this._finishRenderOpened(); | ||
} else { | ||
this._finishRenderClosed(); | ||
} | ||
properties: { | ||
firstDayOfWeek: Number, | ||
disableDays: Array, | ||
minDate: String, | ||
maxDate: String, | ||
format: String, | ||
date: { | ||
type: String, | ||
notify: true | ||
}, | ||
showLongDate: Boolean, | ||
}, | ||
|
||
updateBindDate: function(ev) { | ||
this.set('bindDate', this._dateOnHold); | ||
this.fire('format-date', {date: this._dateOnHold}); | ||
behaviors: [ | ||
Polymer.PaperDialogBehavior, | ||
Polymer.NeonAnimationRunnerBehavior | ||
], | ||
listeners: { | ||
'neon-animation-finish': '_onNeonAnimationFinish' | ||
}, | ||
_renderOpened: function() { | ||
if (this.withBackdrop) { | ||
this.backdropElement.open(); | ||
} | ||
}); | ||
})(); | ||
this.playAnimation('entry'); | ||
}, | ||
_renderClosed: function() { | ||
if (this.withBackdrop) { | ||
this.backdropElement.close(); | ||
} | ||
this.playAnimation('exit'); | ||
}, | ||
_onNeonAnimationFinish: function() { | ||
if (this.opened) { | ||
this._finishRenderOpened(); | ||
} else { | ||
this._finishRenderClosed(); | ||
} | ||
}, | ||
|
||
}); | ||
</script> | ||
</dom-module> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<link rel="import" href="../iron-icon/iron-icon.html"> | ||
<link rel="import" href="../iron-iconset-svg/iron-iconset-svg.html"> | ||
|
||
<iron-iconset-svg size="24" name="icons"> | ||
<svg><defs> | ||
<g id="chevron-left"><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/></g> | ||
<g id="chevron-right"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/></g> | ||
</defs></svg> | ||
</iron-iconset-svg> |
Oops, something went wrong.