aurelia-bootstrap-datetimepicker
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -68,8 +68,4 @@ define(['exports', 'aurelia-framework', 'moment', 'jquery', './picker-global-options', 'eonasdan-bootstrap-datetimepicker'], function (exports, _aureliaFramework, _moment, _jquery, _pickerGlobalOptions) { | ||
var _dec, _dec2, _dec3, _dec4, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12; | ||
var _dec, _dec2, _dec3, _dec4, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11; | ||
var _defaultPickerOptions = { | ||
allowInputToggle: true | ||
}; | ||
var AbpDatetimePickerCustomElement = exports.AbpDatetimePickerCustomElement = (_dec = (0, _aureliaFramework.inject)(Element), _dec2 = (0, _aureliaFramework.bindable)({ defaultBindingMode: _aureliaFramework.bindingMode.twoWay }), _dec3 = (0, _aureliaFramework.bindable)({ defaultBindingMode: _aureliaFramework.bindingMode.twoWay }), _dec4 = (0, _aureliaFramework.bindable)({ defaultBindingMode: _aureliaFramework.bindingMode.twoWay }), _dec(_class = (_class2 = function () { | ||
@@ -87,18 +83,16 @@ function AbpDatetimePickerCustomElement(elm) { | ||
_initDefineProp(this, 'timezone', _descriptor5, this); | ||
_initDefineProp(this, 'withDateIcon', _descriptor5, this); | ||
_initDefineProp(this, 'withDateIcon', _descriptor6, this); | ||
_initDefineProp(this, 'options', _descriptor6, this); | ||
_initDefineProp(this, 'options', _descriptor7, this); | ||
_initDefineProp(this, 'onHide', _descriptor7, this); | ||
_initDefineProp(this, 'onHide', _descriptor8, this); | ||
_initDefineProp(this, 'onShow', _descriptor8, this); | ||
_initDefineProp(this, 'onShow', _descriptor9, this); | ||
_initDefineProp(this, 'onChange', _descriptor9, this); | ||
_initDefineProp(this, 'onChange', _descriptor10, this); | ||
_initDefineProp(this, 'onError', _descriptor10, this); | ||
_initDefineProp(this, 'onError', _descriptor11, this); | ||
_initDefineProp(this, 'onUpdate', _descriptor11, this); | ||
_initDefineProp(this, 'onUpdate', _descriptor12, this); | ||
this._events = {}; | ||
@@ -123,3 +117,3 @@ this._methods = {}; | ||
pickerOptions = Object.assign({}, _defaultPickerOptions, pickerOptions); | ||
pickerOptions = Object.assign({}, _pickerGlobalOptions.globalPickerOptions, pickerOptions); | ||
this.domElm.datetimepicker(pickerOptions); | ||
@@ -311,30 +305,25 @@ | ||
initializer: function initializer() { | ||
return _pickerGlobalOptions.pickerGlobalOptions.iconBase; | ||
return _pickerGlobalOptions.globalExtraOptions.iconBase; | ||
} | ||
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, 'timezone', [_aureliaFramework.bindable], { | ||
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, 'withDateIcon', [_aureliaFramework.bindable], { | ||
enumerable: true, | ||
initializer: function initializer() { | ||
return _pickerGlobalOptions.pickerGlobalOptions.timezone; | ||
return _pickerGlobalOptions.globalExtraOptions.withDateIcon; | ||
} | ||
}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, 'withDateIcon', [_aureliaFramework.bindable], { | ||
}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, 'options', [_aureliaFramework.bindable], { | ||
enumerable: true, | ||
initializer: function initializer() { | ||
return _pickerGlobalOptions.pickerGlobalOptions.withDateIcon; | ||
} | ||
}), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, 'options', [_aureliaFramework.bindable], { | ||
enumerable: true, | ||
initializer: null | ||
}), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, 'onHide', [_aureliaFramework.bindable], { | ||
}), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, 'onHide', [_aureliaFramework.bindable], { | ||
enumerable: true, | ||
initializer: null | ||
}), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, 'onShow', [_aureliaFramework.bindable], { | ||
}), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, 'onShow', [_aureliaFramework.bindable], { | ||
enumerable: true, | ||
initializer: null | ||
}), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, 'onChange', [_aureliaFramework.bindable], { | ||
}), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, 'onChange', [_aureliaFramework.bindable], { | ||
enumerable: true, | ||
initializer: null | ||
}), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, 'onError', [_aureliaFramework.bindable], { | ||
}), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, 'onError', [_aureliaFramework.bindable], { | ||
enumerable: true, | ||
initializer: null | ||
}), _descriptor12 = _applyDecoratedDescriptor(_class2.prototype, 'onUpdate', [_aureliaFramework.bindable], { | ||
}), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, 'onUpdate', [_aureliaFramework.bindable], { | ||
enumerable: true, | ||
@@ -341,0 +330,0 @@ initializer: null |
@@ -18,4 +18,5 @@ define(['exports', './picker-global-options'], function (exports, _pickerGlobalOptions) { | ||
this.options = _pickerGlobalOptions.pickerGlobalOptions; | ||
this.extra = _pickerGlobalOptions.globalExtraOptions; | ||
this.options = _pickerGlobalOptions.globalPickerOptions; | ||
}; | ||
}); |
@@ -7,6 +7,10 @@ define(['exports'], function (exports) { | ||
}); | ||
var pickerGlobalOptions = exports.pickerGlobalOptions = { | ||
var globalExtraOptions = exports.globalExtraOptions = { | ||
iconBase: 'glyphicon', | ||
withDateIcon: true | ||
}; | ||
var globalPickerOptions = exports.globalPickerOptions = { | ||
allowInputToggle: true | ||
}; | ||
}); |
@@ -8,3 +8,3 @@ 'use strict'; | ||
var _dec, _dec2, _dec3, _dec4, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12; | ||
var _dec, _dec2, _dec3, _dec4, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11; | ||
@@ -72,6 +72,2 @@ var _aureliaFramework = require('aurelia-framework'); | ||
var _defaultPickerOptions = { | ||
allowInputToggle: true | ||
}; | ||
var AbpDatetimePickerCustomElement = exports.AbpDatetimePickerCustomElement = (_dec = (0, _aureliaFramework.inject)(Element), _dec2 = (0, _aureliaFramework.bindable)({ defaultBindingMode: _aureliaFramework.bindingMode.twoWay }), _dec3 = (0, _aureliaFramework.bindable)({ defaultBindingMode: _aureliaFramework.bindingMode.twoWay }), _dec4 = (0, _aureliaFramework.bindable)({ defaultBindingMode: _aureliaFramework.bindingMode.twoWay }), _dec(_class = (_class2 = function () { | ||
@@ -89,18 +85,16 @@ function AbpDatetimePickerCustomElement(elm) { | ||
_initDefineProp(this, 'timezone', _descriptor5, this); | ||
_initDefineProp(this, 'withDateIcon', _descriptor5, this); | ||
_initDefineProp(this, 'withDateIcon', _descriptor6, this); | ||
_initDefineProp(this, 'options', _descriptor6, this); | ||
_initDefineProp(this, 'options', _descriptor7, this); | ||
_initDefineProp(this, 'onHide', _descriptor7, this); | ||
_initDefineProp(this, 'onHide', _descriptor8, this); | ||
_initDefineProp(this, 'onShow', _descriptor8, this); | ||
_initDefineProp(this, 'onShow', _descriptor9, this); | ||
_initDefineProp(this, 'onChange', _descriptor9, this); | ||
_initDefineProp(this, 'onChange', _descriptor10, this); | ||
_initDefineProp(this, 'onError', _descriptor10, this); | ||
_initDefineProp(this, 'onError', _descriptor11, this); | ||
_initDefineProp(this, 'onUpdate', _descriptor11, this); | ||
_initDefineProp(this, 'onUpdate', _descriptor12, this); | ||
this._events = {}; | ||
@@ -125,3 +119,3 @@ this._methods = {}; | ||
pickerOptions = Object.assign({}, _defaultPickerOptions, pickerOptions); | ||
pickerOptions = Object.assign({}, _pickerGlobalOptions.globalPickerOptions, pickerOptions); | ||
this.domElm.datetimepicker(pickerOptions); | ||
@@ -313,32 +307,27 @@ | ||
initializer: function initializer() { | ||
return _pickerGlobalOptions.pickerGlobalOptions.iconBase; | ||
return _pickerGlobalOptions.globalExtraOptions.iconBase; | ||
} | ||
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, 'timezone', [_aureliaFramework.bindable], { | ||
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, 'withDateIcon', [_aureliaFramework.bindable], { | ||
enumerable: true, | ||
initializer: function initializer() { | ||
return _pickerGlobalOptions.pickerGlobalOptions.timezone; | ||
return _pickerGlobalOptions.globalExtraOptions.withDateIcon; | ||
} | ||
}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, 'withDateIcon', [_aureliaFramework.bindable], { | ||
}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, 'options', [_aureliaFramework.bindable], { | ||
enumerable: true, | ||
initializer: function initializer() { | ||
return _pickerGlobalOptions.pickerGlobalOptions.withDateIcon; | ||
} | ||
}), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, 'options', [_aureliaFramework.bindable], { | ||
enumerable: true, | ||
initializer: null | ||
}), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, 'onHide', [_aureliaFramework.bindable], { | ||
}), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, 'onHide', [_aureliaFramework.bindable], { | ||
enumerable: true, | ||
initializer: null | ||
}), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, 'onShow', [_aureliaFramework.bindable], { | ||
}), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, 'onShow', [_aureliaFramework.bindable], { | ||
enumerable: true, | ||
initializer: null | ||
}), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, 'onChange', [_aureliaFramework.bindable], { | ||
}), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, 'onChange', [_aureliaFramework.bindable], { | ||
enumerable: true, | ||
initializer: null | ||
}), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, 'onError', [_aureliaFramework.bindable], { | ||
}), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, 'onError', [_aureliaFramework.bindable], { | ||
enumerable: true, | ||
initializer: null | ||
}), _descriptor12 = _applyDecoratedDescriptor(_class2.prototype, 'onUpdate', [_aureliaFramework.bindable], { | ||
}), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, 'onUpdate', [_aureliaFramework.bindable], { | ||
enumerable: true, | ||
initializer: null | ||
})), _class2)) || _class); |
@@ -15,3 +15,4 @@ 'use strict'; | ||
this.options = _pickerGlobalOptions.pickerGlobalOptions; | ||
this.extra = _pickerGlobalOptions.globalExtraOptions; | ||
this.options = _pickerGlobalOptions.globalPickerOptions; | ||
}; |
@@ -6,5 +6,9 @@ 'use strict'; | ||
}); | ||
var pickerGlobalOptions = exports.pickerGlobalOptions = { | ||
var globalExtraOptions = exports.globalExtraOptions = { | ||
iconBase: 'glyphicon', | ||
withDateIcon: true | ||
}; | ||
var globalPickerOptions = exports.globalPickerOptions = { | ||
allowInputToggle: true | ||
}; |
@@ -1,2 +0,2 @@ | ||
var _dec, _dec2, _dec3, _dec4, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12; | ||
var _dec, _dec2, _dec3, _dec4, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11; | ||
@@ -50,8 +50,4 @@ function _initDefineProp(target, property, descriptor, context) { | ||
import 'eonasdan-bootstrap-datetimepicker'; | ||
import { pickerGlobalOptions } from './picker-global-options'; | ||
import { globalExtraOptions, globalPickerOptions } from './picker-global-options'; | ||
const _defaultPickerOptions = { | ||
allowInputToggle: true | ||
}; | ||
export let AbpDatetimePickerCustomElement = (_dec = inject(Element), _dec2 = bindable({ defaultBindingMode: bindingMode.twoWay }), _dec3 = bindable({ defaultBindingMode: bindingMode.twoWay }), _dec4 = bindable({ defaultBindingMode: bindingMode.twoWay }), _dec(_class = (_class2 = class AbpDatetimePickerCustomElement { | ||
@@ -68,18 +64,16 @@ | ||
_initDefineProp(this, 'timezone', _descriptor5, this); | ||
_initDefineProp(this, 'withDateIcon', _descriptor5, this); | ||
_initDefineProp(this, 'withDateIcon', _descriptor6, this); | ||
_initDefineProp(this, 'options', _descriptor6, this); | ||
_initDefineProp(this, 'options', _descriptor7, this); | ||
_initDefineProp(this, 'onHide', _descriptor7, this); | ||
_initDefineProp(this, 'onHide', _descriptor8, this); | ||
_initDefineProp(this, 'onShow', _descriptor8, this); | ||
_initDefineProp(this, 'onShow', _descriptor9, this); | ||
_initDefineProp(this, 'onChange', _descriptor9, this); | ||
_initDefineProp(this, 'onChange', _descriptor10, this); | ||
_initDefineProp(this, 'onError', _descriptor10, this); | ||
_initDefineProp(this, 'onError', _descriptor11, this); | ||
_initDefineProp(this, 'onUpdate', _descriptor11, this); | ||
_initDefineProp(this, 'onUpdate', _descriptor12, this); | ||
this._events = {}; | ||
@@ -102,3 +96,3 @@ this._methods = {}; | ||
pickerOptions = Object.assign({}, _defaultPickerOptions, pickerOptions); | ||
pickerOptions = Object.assign({}, globalPickerOptions, pickerOptions); | ||
this.domElm.datetimepicker(pickerOptions); | ||
@@ -282,32 +276,27 @@ | ||
initializer: function () { | ||
return pickerGlobalOptions.iconBase; | ||
return globalExtraOptions.iconBase; | ||
} | ||
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, 'timezone', [bindable], { | ||
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, 'withDateIcon', [bindable], { | ||
enumerable: true, | ||
initializer: function () { | ||
return pickerGlobalOptions.timezone; | ||
return globalExtraOptions.withDateIcon; | ||
} | ||
}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, 'withDateIcon', [bindable], { | ||
}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, 'options', [bindable], { | ||
enumerable: true, | ||
initializer: function () { | ||
return pickerGlobalOptions.withDateIcon; | ||
} | ||
}), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, 'options', [bindable], { | ||
enumerable: true, | ||
initializer: null | ||
}), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, 'onHide', [bindable], { | ||
}), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, 'onHide', [bindable], { | ||
enumerable: true, | ||
initializer: null | ||
}), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, 'onShow', [bindable], { | ||
}), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, 'onShow', [bindable], { | ||
enumerable: true, | ||
initializer: null | ||
}), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, 'onChange', [bindable], { | ||
}), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, 'onChange', [bindable], { | ||
enumerable: true, | ||
initializer: null | ||
}), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, 'onError', [bindable], { | ||
}), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, 'onError', [bindable], { | ||
enumerable: true, | ||
initializer: null | ||
}), _descriptor12 = _applyDecoratedDescriptor(_class2.prototype, 'onUpdate', [bindable], { | ||
}), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, 'onUpdate', [bindable], { | ||
enumerable: true, | ||
initializer: null | ||
})), _class2)) || _class); |
@@ -1,7 +0,8 @@ | ||
import { pickerGlobalOptions } from './picker-global-options'; | ||
import { globalExtraOptions, globalPickerOptions } from './picker-global-options'; | ||
export let PickerConfig = class PickerConfig { | ||
constructor() { | ||
this.options = pickerGlobalOptions; | ||
this.extra = globalExtraOptions; | ||
this.options = globalPickerOptions; | ||
} | ||
}; |
@@ -1,4 +0,9 @@ | ||
export let pickerGlobalOptions = { | ||
export let globalExtraOptions = { | ||
iconBase: 'glyphicon', | ||
withDateIcon: true | ||
}; | ||
export let globalPickerOptions = { | ||
allowInputToggle: true | ||
}; |
@@ -6,3 +6,3 @@ 'use strict'; | ||
var inject, bindable, bindingMode, moment, $, pickerGlobalOptions, _dec, _dec2, _dec3, _dec4, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _defaultPickerOptions, AbpDatetimePickerCustomElement; | ||
var inject, bindable, bindingMode, moment, $, globalExtraOptions, globalPickerOptions, _dec, _dec2, _dec3, _dec4, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, AbpDatetimePickerCustomElement; | ||
@@ -68,9 +68,6 @@ function _initDefineProp(target, property, descriptor, context) { | ||
}, function (_eonasdanBootstrapDatetimepicker) {}, function (_pickerGlobalOptions) { | ||
pickerGlobalOptions = _pickerGlobalOptions.pickerGlobalOptions; | ||
globalExtraOptions = _pickerGlobalOptions.globalExtraOptions; | ||
globalPickerOptions = _pickerGlobalOptions.globalPickerOptions; | ||
}], | ||
execute: function () { | ||
_defaultPickerOptions = { | ||
allowInputToggle: true | ||
}; | ||
_export('AbpDatetimePickerCustomElement', AbpDatetimePickerCustomElement = (_dec = inject(Element), _dec2 = bindable({ defaultBindingMode: bindingMode.twoWay }), _dec3 = bindable({ defaultBindingMode: bindingMode.twoWay }), _dec4 = bindable({ defaultBindingMode: bindingMode.twoWay }), _dec(_class = (_class2 = function () { | ||
@@ -88,18 +85,16 @@ function AbpDatetimePickerCustomElement(elm) { | ||
_initDefineProp(this, 'timezone', _descriptor5, this); | ||
_initDefineProp(this, 'withDateIcon', _descriptor5, this); | ||
_initDefineProp(this, 'withDateIcon', _descriptor6, this); | ||
_initDefineProp(this, 'options', _descriptor6, this); | ||
_initDefineProp(this, 'options', _descriptor7, this); | ||
_initDefineProp(this, 'onHide', _descriptor7, this); | ||
_initDefineProp(this, 'onHide', _descriptor8, this); | ||
_initDefineProp(this, 'onShow', _descriptor8, this); | ||
_initDefineProp(this, 'onShow', _descriptor9, this); | ||
_initDefineProp(this, 'onChange', _descriptor9, this); | ||
_initDefineProp(this, 'onChange', _descriptor10, this); | ||
_initDefineProp(this, 'onError', _descriptor10, this); | ||
_initDefineProp(this, 'onError', _descriptor11, this); | ||
_initDefineProp(this, 'onUpdate', _descriptor11, this); | ||
_initDefineProp(this, 'onUpdate', _descriptor12, this); | ||
this._events = {}; | ||
@@ -124,3 +119,3 @@ this._methods = {}; | ||
pickerOptions = Object.assign({}, _defaultPickerOptions, pickerOptions); | ||
pickerOptions = Object.assign({}, globalPickerOptions, pickerOptions); | ||
this.domElm.datetimepicker(pickerOptions); | ||
@@ -312,30 +307,25 @@ | ||
initializer: function initializer() { | ||
return pickerGlobalOptions.iconBase; | ||
return globalExtraOptions.iconBase; | ||
} | ||
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, 'timezone', [bindable], { | ||
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, 'withDateIcon', [bindable], { | ||
enumerable: true, | ||
initializer: function initializer() { | ||
return pickerGlobalOptions.timezone; | ||
return globalExtraOptions.withDateIcon; | ||
} | ||
}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, 'withDateIcon', [bindable], { | ||
}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, 'options', [bindable], { | ||
enumerable: true, | ||
initializer: function initializer() { | ||
return pickerGlobalOptions.withDateIcon; | ||
} | ||
}), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, 'options', [bindable], { | ||
enumerable: true, | ||
initializer: null | ||
}), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, 'onHide', [bindable], { | ||
}), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, 'onHide', [bindable], { | ||
enumerable: true, | ||
initializer: null | ||
}), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, 'onShow', [bindable], { | ||
}), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, 'onShow', [bindable], { | ||
enumerable: true, | ||
initializer: null | ||
}), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, 'onChange', [bindable], { | ||
}), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, 'onChange', [bindable], { | ||
enumerable: true, | ||
initializer: null | ||
}), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, 'onError', [bindable], { | ||
}), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, 'onError', [bindable], { | ||
enumerable: true, | ||
initializer: null | ||
}), _descriptor12 = _applyDecoratedDescriptor(_class2.prototype, 'onUpdate', [bindable], { | ||
}), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, 'onUpdate', [bindable], { | ||
enumerable: true, | ||
@@ -342,0 +332,0 @@ initializer: null |
@@ -6,3 +6,3 @@ 'use strict'; | ||
var pickerGlobalOptions, PickerConfig; | ||
var globalExtraOptions, globalPickerOptions, PickerConfig; | ||
@@ -17,3 +17,4 @@ function _classCallCheck(instance, Constructor) { | ||
setters: [function (_pickerGlobalOptions) { | ||
pickerGlobalOptions = _pickerGlobalOptions.pickerGlobalOptions; | ||
globalExtraOptions = _pickerGlobalOptions.globalExtraOptions; | ||
globalPickerOptions = _pickerGlobalOptions.globalPickerOptions; | ||
}], | ||
@@ -24,3 +25,4 @@ execute: function () { | ||
this.options = pickerGlobalOptions; | ||
this.extra = globalExtraOptions; | ||
this.options = globalPickerOptions; | ||
}); | ||
@@ -27,0 +29,0 @@ |
@@ -6,7 +6,7 @@ 'use strict'; | ||
var pickerGlobalOptions; | ||
var globalExtraOptions, globalPickerOptions; | ||
return { | ||
setters: [], | ||
execute: function () { | ||
_export('pickerGlobalOptions', pickerGlobalOptions = { | ||
_export('globalExtraOptions', globalExtraOptions = { | ||
iconBase: 'glyphicon', | ||
@@ -16,5 +16,11 @@ withDateIcon: true | ||
_export('pickerGlobalOptions', pickerGlobalOptions); | ||
_export('globalExtraOptions', globalExtraOptions); | ||
_export('globalPickerOptions', globalPickerOptions = { | ||
allowInputToggle: true | ||
}); | ||
_export('globalPickerOptions', globalPickerOptions); | ||
} | ||
}; | ||
}); |
{ | ||
"name": "aurelia-bootstrap-datetimepicker", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "An Aurelia Custom Element for the 3rd party addon [Eonasdan Bootstrap Datepicker]", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -15,5 +15,5 @@ # Aurelia-Bootstrap-Datetimepicker | ||
### Formatted Date / Date Object | ||
For conveniencies, we provide 2 bindable attributes (both are also `two-way` binding as well). The first is for the formatted date which is called with `value.bind`, while the second is called via `model.bind` to deal with a standard Date Object. | ||
For conveniencies, we provide 2 bindable attributes (both are also `two-way` binding as well). The first is for the formatted date which is available through `value.bind`, while the second binding is called via `model.bind` to deal with a standard Date Object. | ||
**Note:** since both attributes (`value.bind`,`model.bind`) are two-way binding, it also means that both can change the output. | ||
**Note:** since both attributes (`value.bind`,`model.bind`) are two-way binding, it also means that both can affect the picker. | ||
@@ -26,3 +26,3 @@ Example: | ||
_if we use the date string '2005-05-05 10:00', the output will be:_ | ||
_if we use the date string '2005-05-05 10:00', the output will be (also note that I'm on the Eastern Timezone):_ | ||
@@ -39,2 +39,4 @@ ```javascript | ||
**NOTE:** | ||
The extra attributes can also be defined globally through `main.js` via a `config.options` configuration, see [Global Options](#globaloption) | ||
@@ -64,4 +66,4 @@ Examples | ||
Some extra bindable attributes were added to the Custom Element to add extra flexibility. The way to call them is through an attribute call in the View. The list of these extras is the following | ||
* iconBase (`font-awesome` or `glyphicon`), (default: 'glyphicon') | ||
* withDateIcon (default: true) | ||
* iconBase: provide different set of icons (`font-awesome` or `glyphicon`), (default: `'glyphicon'`) | ||
* withDateIcon: add a Bootstrap `input group` with a Calendar icon on the right of the input (default: `true`) | ||
@@ -76,3 +78,3 @@ Example | ||
**NOTE:** | ||
The extra attributes can be changed globally through `main.js` configuration, see [Global Options](#globaloption) | ||
The extra attributes can also be defined globally through `main.js` via a `config.extra` configuration, see [Global Options](#globaloption) | ||
@@ -175,9 +177,6 @@ | ||
```javascript | ||
```diff | ||
const ENV... | ||
// add the following | ||
const ProvidePlugin = require('webpack/lib/ProvidePlugin') | ||
const ContextReplacementPlugin = require('webpack/lib/ContextReplacementPlugin') | ||
... | ||
+ const ProvidePlugin = require('webpack/lib/ProvidePlugin') | ||
+ const ContextReplacementPlugin = require('webpack/lib/ContextReplacementPlugin') | ||
let config = generateConfig( | ||
@@ -193,20 +192,18 @@ { | ||
}, | ||
// ADD THE FOLLOWING (start) | ||
plugins: [ | ||
new ContextReplacementPlugin(/moment[\/\\]locale$/, /en|fr/), | ||
new ProvidePlugin({ | ||
$: "jquery", | ||
jQuery: "jquery", | ||
'window.jQuery': 'jquery', | ||
'window.Tether': 'tether', | ||
Tether: 'tether' | ||
}) | ||
], | ||
resolve: { | ||
alias: { | ||
// Force all modules to use the same jquery version. | ||
'jquery': path.join(__dirname, 'node_modules/jquery/src/jquery') | ||
} | ||
} | ||
// ADD THE FOLLOWING (end) | ||
+ plugins: [ | ||
+ new ContextReplacementPlugin(/moment[\/\\]locale$/, /en|fr/), | ||
+ new ProvidePlugin({ | ||
+ $: "jquery", | ||
+ jQuery: "jquery", | ||
+ 'window.jQuery': 'jquery', | ||
+ 'window.Tether': 'tether', | ||
+ Tether: 'tether' | ||
+ }) | ||
+ ], | ||
+ resolve: { | ||
+ alias: { | ||
+ // Force all modules to use the same jquery version. | ||
+ 'jquery': path.join(__dirname, 'node_modules/jquery/src/jquery') | ||
+ } | ||
+ } | ||
}, | ||
@@ -217,9 +214,13 @@ ``` | ||
#### Aurelia (main) | ||
### Aurelia (main.js) | ||
Make the plugin available globally in your `main.js` file. Please note the exported class is `abp-tags-input` | ||
#### For WebPack only (main.js) | ||
```javascript | ||
// for WebPack only, also import CSS | ||
// import 'eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css'; | ||
import 'eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css'; | ||
``` | ||
#### CLI/WebPack (main.js) | ||
```javascript | ||
export function configure(aurelia) { | ||
@@ -238,8 +239,5 @@ aurelia.use | ||
### Global Options | ||
You can change any of the global options directly in the your `main.js` through a `config` as shown below: | ||
You can change any of the global options directly in the `main.js` through a `config` as shown below: | ||
```javascript | ||
// for WebPack only, also import CSS | ||
// import 'eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css'; | ||
export function configure(aurelia) { | ||
@@ -250,4 +248,8 @@ aurelia.use | ||
.plugin('aurelia-bootstrap-datetimepicker', config => { | ||
config.options.iconBase = 'glyphicon'; | ||
config.options.iconBase = true; | ||
// extra attributes, with config.extra | ||
config.extra.iconBase = 'glyphicon'; | ||
config.extra.withDateIcon = true; | ||
// or even any picker options, with config.options | ||
config.options.allowInputToggle = true; | ||
}); | ||
@@ -263,2 +265,4 @@ | ||
### Contributions/Comments | ||
Contributions are welcome. This plugin was created to help the community and myself, if you wish to suggest something and/or want to make a PR (Pull Request), please feel free to do so. Also, please be respectful. Finally, if you like and use this Aurelia-Bootstrap-Plugin, please click on the :star: and add it as a favorite. | ||
Contributions are welcome. This plugin was created to help the community and myself and was mainly done through my free time. If you wish to suggest something and/or want to make a PR (Pull Request), please feel free to do so. Also, please be respectful. | ||
Finally, if you like and use this Aurelia-Bootstrap-Plugin, please click on the :star: and add it as a favorite. |
@@ -5,8 +5,4 @@ import {inject, bindable, bindingMode} from 'aurelia-framework'; | ||
import 'eonasdan-bootstrap-datetimepicker'; | ||
import {pickerGlobalOptions} from './picker-global-options'; | ||
import {globalExtraOptions, globalPickerOptions} from './picker-global-options'; | ||
const _defaultPickerOptions = { | ||
allowInputToggle: true | ||
}; | ||
@inject(Element) | ||
@@ -19,5 +15,4 @@ export class AbpDatetimePickerCustomElement { | ||
// plugin own variables | ||
@bindable iconBase = pickerGlobalOptions.iconBase; | ||
@bindable timezone = pickerGlobalOptions.timezone; | ||
@bindable withDateIcon = pickerGlobalOptions.withDateIcon; | ||
@bindable iconBase = globalExtraOptions.iconBase; | ||
@bindable withDateIcon = globalExtraOptions.withDateIcon; | ||
@@ -60,3 +55,3 @@ // options (from the View) | ||
// finally create the datepicker with all options | ||
pickerOptions = Object.assign({}, _defaultPickerOptions, pickerOptions); | ||
pickerOptions = Object.assign({}, globalPickerOptions, pickerOptions); | ||
this.domElm.datetimepicker(pickerOptions); | ||
@@ -63,0 +58,0 @@ |
@@ -1,7 +0,8 @@ | ||
import {pickerGlobalOptions} from './picker-global-options'; | ||
import {globalExtraOptions, globalPickerOptions} from './picker-global-options'; | ||
export class PickerConfig { | ||
constructor() { | ||
this.options = pickerGlobalOptions; | ||
this.extra = globalExtraOptions; | ||
this.options = globalPickerOptions; | ||
} | ||
} |
@@ -1,4 +0,14 @@ | ||
export let pickerGlobalOptions = { | ||
/** | ||
* Extra options that can be passed to the Custom Element | ||
*/ | ||
export let globalExtraOptions = { | ||
iconBase: 'glyphicon', | ||
withDateIcon: true | ||
}; | ||
/** | ||
* Options that can be passed to the Bootstrap-Datetimepicker directly | ||
*/ | ||
export let globalPickerOptions = { | ||
allowInputToggle: true | ||
}; |
257
277534
1898