mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-10-01 01:14:20 +08:00
Add datepicker component (#716)
This commit is contained in:
parent
8285bf02fe
commit
68890f8083
6 changed files with 39 additions and 0 deletions
|
@ -290,6 +290,7 @@ class AbstractApp extends AbstractBoot
|
|||
ko.components.register('Select', require('Component/Select'));
|
||||
ko.components.register('Radio', require('Component/Radio'));
|
||||
ko.components.register('TextArea', require('Component/TextArea'));
|
||||
ko.components.register('Date', require('Component/Date'));
|
||||
|
||||
ko.components.register('x-script', require('Component/Script'));
|
||||
// ko.components.register('svg-icon', require('Component/SvgIcon'));
|
||||
|
|
7
dev/Component/Date.jsx
Normal file
7
dev/Component/Date.jsx
Normal file
|
@ -0,0 +1,7 @@
|
|||
|
||||
import {componentExportHelper} from 'Component/Abstract';
|
||||
import {AbstractInput} from 'Component/AbstractInput';
|
||||
|
||||
class DateComponent extends AbstractInput {}
|
||||
|
||||
module.exports = componentExportHelper(DateComponent, 'DateComponent');
|
15
dev/External/ko.js
vendored
15
dev/External/ko.js
vendored
|
@ -9,6 +9,7 @@
|
|||
$ = require('$'),
|
||||
JSON = require('JSON'),
|
||||
Opentip = require('Opentip'),
|
||||
Pikaday = require('pikaday'),
|
||||
|
||||
fDisposalTooltipHelper = function (oElement) {
|
||||
ko.utils.domNodeDisposal.addDisposeCallback(oElement, function () {
|
||||
|
@ -124,6 +125,20 @@
|
|||
}
|
||||
};
|
||||
|
||||
ko.bindingHandlers.pikaday = {
|
||||
'init': function (oElement, fValueAccessor, fAllBindingsAccessor, oViewModel) {
|
||||
|
||||
ko.bindingHandlers.textInput.init.apply(oViewModel, Array.prototype.slice.call(arguments));
|
||||
|
||||
if (Pikaday)
|
||||
{
|
||||
oElement.__pikaday = new Pikaday({
|
||||
field: oElement
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ko.bindingHandlers.tooltip = {
|
||||
'init': function (oElement, fValueAccessor) {
|
||||
|
||||
|
|
|
@ -135,6 +135,7 @@ cfg.paths.css = {
|
|||
'vendors/flags/flags-fixed.css',
|
||||
'vendors/lightGallery/dist/css/lightgallery.min.css',
|
||||
'vendors/lightGallery/dist/css/lg-transitions-lg-lollipop.css',
|
||||
'node_modules/pikaday/css/pikaday.css',
|
||||
cfg.paths.staticCSS + cfg.paths.less.main.name
|
||||
]
|
||||
}
|
||||
|
|
|
@ -86,6 +86,7 @@
|
|||
"json-loader": "^0.5.4",
|
||||
"node-fs": "*",
|
||||
"node-notifier": "~4.2.3",
|
||||
"pikaday": "^1.4.0",
|
||||
"raw-loader": "^0.5.1",
|
||||
"rimraf": "*",
|
||||
"webpack": "2.1.0-beta.13"
|
||||
|
|
14
rainloop/v/0.0.0/app/templates/Views/Components/Date.html
Normal file
14
rainloop/v/0.0.0/app/templates/Views/Components/Date.html
Normal file
|
@ -0,0 +1,14 @@
|
|||
<input class="i18n" type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
|
||||
data-bind="pikaday: value, attr: {'placeholder': placeholder}, enable: enable, css: className" />
|
||||
<!-- ko if: labeled -->
|
||||
|
||||
<span class="i18n" data-bind="attr: {'data-i18n': label}"></span>
|
||||
|
||||
<!-- /ko -->
|
||||
<!-- ko if: triggered -->
|
||||
|
||||
<div data-bind="component: {
|
||||
name: 'SaveTrigger',
|
||||
params: { value: trigger }
|
||||
}"></div>
|
||||
<!-- /ko -->
|
Loading…
Add table
Reference in a new issue