diff --git a/client/core/src/components.js b/client/core/src/components.js index 04e5d7287..82a90196c 100644 --- a/client/core/src/components.js +++ b/client/core/src/components.js @@ -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'; diff --git a/client/core/src/date-picker/date-picker.js b/client/core/src/date-picker/date-picker.js deleted file mode 100644 index b68d57fd2..000000000 --- a/client/core/src/date-picker/date-picker.js +++ /dev/null @@ -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); diff --git a/client/core/src/date-picker/date-picker.mdl.html b/client/core/src/date-picker/date-picker.mdl.html deleted file mode 100644 index 292b43c09..000000000 --- a/client/core/src/date-picker/date-picker.mdl.html +++ /dev/null @@ -1,4 +0,0 @@ -
- - -
diff --git a/client/core/src/date-picker/date-picker.mdl.js b/client/core/src/date-picker/date-picker.mdl.js deleted file mode 100644 index 277b6331d..000000000 --- a/client/core/src/date-picker/date-picker.mdl.js +++ /dev/null @@ -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);