removed unsed files and commented code for deprecated date-picker.js
This commit is contained in:
parent
d121517569
commit
73964ac387
|
@ -38,8 +38,6 @@ export {NAME as SUBMIT, directive as SubmitDirective} from './submit/submit';
|
|||
export {NAME as SUBMIT_MDL, factory as submitMdl} from './submit/submit.mdl';
|
||||
export {NAME as COMBO, directive as ComboDirective} from './combo/combo';
|
||||
export {NAME as COMBO_MDL, factory as comboMdl} from './combo/combo.mdl';
|
||||
/* export {NAME as DATE_PICKER, directive as DatePickerDirective} from './date-picker/date-picker';
|
||||
export {NAME as DATE_PICKER_MDL, factory as datePickerMdl} from './date-picker/date-picker.mdl';*/
|
||||
export {NAME as CARD, directive as CardDirective} from './card/card';
|
||||
export {NAME as CARD_MDL, factory as cardMdl} from './card/card.mdl';
|
||||
export {NAME as SWITCH, directive as SwitchDirective} from './switch/switch';
|
||||
|
|
|
@ -1,51 +0,0 @@
|
|||
import {module as _module} from '../module';
|
||||
import * as resolveFactory from '../lib/resolveDefaultComponents';
|
||||
import * as normalizerFactory from '../lib/inputAttrsNormalizer';
|
||||
import * as util from '../lib/util';
|
||||
import Flatpickr from 'vendor/src/flatpickr';
|
||||
|
||||
const _NAME = 'datePicker';
|
||||
export const NAME = util.getName(_NAME);
|
||||
|
||||
directive.$inject = [resolveFactory.NAME, normalizerFactory.NAME, '$translate'];
|
||||
export function directive(resolve, normalizer, $translate) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
template: function(_, attrs) {
|
||||
normalizer.normalize(attrs);
|
||||
return resolve.getTemplate(_NAME, attrs);
|
||||
},
|
||||
link: function(scope, element, attrs) {
|
||||
let input = element[0];
|
||||
let flatpickrInstance;
|
||||
let initOptions = {};
|
||||
|
||||
if (attrs.iniOpts)
|
||||
initOptions = scope.$eval(attrs.iniOpts);
|
||||
|
||||
if (!initOptions.locale)
|
||||
initOptions.locale = $translate.use();
|
||||
|
||||
/*if (!initOptions.dateFormat && initOptions.locale === 'es')
|
||||
initOptions.dateFormat = 'd-m-Y';*/
|
||||
|
||||
if (!input.matches('input'))
|
||||
input = input.querySelector('input');
|
||||
|
||||
if (input)
|
||||
flatpickrInstance = new Flatpickr(input, initOptions);
|
||||
|
||||
scope.$watch(attrs.model, () => {
|
||||
let mdlField = element[0].firstChild.MaterialCheckbox;
|
||||
if (mdlField)
|
||||
mdlField.updateClasses_();
|
||||
});
|
||||
componentHandler.upgradeElement(element[0].firstChild);
|
||||
|
||||
element.on('$destroy', function() {
|
||||
flatpickrInstance.destroy();
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
_module.directive(NAME, directive);
|
|
@ -1,4 +0,0 @@
|
|||
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
|
||||
<input class="mdl-textfield__input *[className]*" type="text" name="*[name]*" ng-model="*[model]*" rule="*[rule]*" *[enabled]*/>
|
||||
<label class="mdl-textfield__label" translate>*[label]*</label>
|
||||
</div>
|
|
@ -1,14 +0,0 @@
|
|||
import {module} from '../module';
|
||||
import template from './date-picker.mdl.html';
|
||||
|
||||
export const NAME = 'vnDatePickerMdlFactory';
|
||||
export function factory() {
|
||||
return {
|
||||
template: template,
|
||||
default: {
|
||||
label: 'Label',
|
||||
enabled: 'enabled'
|
||||
}
|
||||
};
|
||||
}
|
||||
module.factory(NAME, factory);
|
Loading…
Reference in New Issue