@@ -817,7 +817,8 @@ var Calendar = function (_CalendarBase2) {
817817 value : function createComponent ( ch ) {
818818 var _this2 = this ;
819819
820- var children = [ ch ( 'i' , { attrs : { 'class' : this . _icon + ' icon' } } ) , ch ( 'input' , { attrs : { type : 'text' , name : this . name , placeholder : this . placeholder } } ) ] ;
820+ var attr = this . calendarOptions ( ) ;
821+ var children = [ ch ( 'i' , { attrs : { 'class' : attr . icon + ' icon' } } ) , ch ( 'input' , { attrs : { type : 'text' , name : this . name , placeholder : this . placeholder } } ) ] ;
821822 var css = 'ui input left icon' ;
822823 if ( this . canClear ) {
823824 css += ' action' ;
@@ -848,9 +849,10 @@ var Calendar = function (_CalendarBase2) {
848849 value : function setupUi ( ) {
849850 var _this3 = this ;
850851
852+ var attr = this . calendarOptions ( ) ;
851853 var sender = this ;
852854 var options$$1 = {
853- type : this . _type ,
855+ type : attr . type ,
854856 onChange : function onChange ( date , text ) {
855857 _this3 . $emit ( 'input' , date ) ;
856858 }
@@ -904,15 +906,18 @@ var Date = function (_DateBase2) {
904906
905907 function Date ( ) {
906908 classCallCheck ( this , Date ) ;
907-
908- var _this = possibleConstructorReturn ( this , ( Date . __proto__ || Object . getPrototypeOf ( Date ) ) . apply ( this , arguments ) ) ;
909-
910- _this . _type = 'date' ;
911- _this . _icon = 'calendar' ;
912- return _this ;
909+ return possibleConstructorReturn ( this , ( Date . __proto__ || Object . getPrototypeOf ( Date ) ) . apply ( this , arguments ) ) ;
913910 }
914911
915912 createClass ( Date , [ {
913+ key : 'calendarOptions' ,
914+ value : function calendarOptions ( ) {
915+ return {
916+ type : 'date' ,
917+ icon : 'calendar'
918+ } ;
919+ }
920+ } , {
916921 key : 'onSettingsChanged' ,
917922 value : function onSettingsChanged ( val ) {
918923 $ ( this . $el ) [ 'calendar' ] ( 'destroy' ) ;
@@ -963,15 +968,18 @@ var Time = function (_TimeBase2) {
963968
964969 function Time ( ) {
965970 classCallCheck ( this , Time ) ;
966-
967- var _this = possibleConstructorReturn ( this , ( Time . __proto__ || Object . getPrototypeOf ( Time ) ) . apply ( this , arguments ) ) ;
968-
969- _this . _type = 'time' ;
970- _this . _icon = 'time' ;
971- return _this ;
971+ return possibleConstructorReturn ( this , ( Time . __proto__ || Object . getPrototypeOf ( Time ) ) . apply ( this , arguments ) ) ;
972972 }
973973
974974 createClass ( Time , [ {
975+ key : 'calendarOptions' ,
976+ value : function calendarOptions ( ) {
977+ return {
978+ type : 'time' ,
979+ icon : 'time'
980+ } ;
981+ }
982+ } , {
975983 key : 'onSettingsChanged' ,
976984 value : function onSettingsChanged ( val ) {
977985 $ ( this . $el ) [ 'calendar' ] ( 'destroy' ) ;
@@ -1022,15 +1030,18 @@ var DateTime = function (_DatetimeBase2) {
10221030
10231031 function DateTime ( ) {
10241032 classCallCheck ( this , DateTime ) ;
1025-
1026- var _this = possibleConstructorReturn ( this , ( DateTime . __proto__ || Object . getPrototypeOf ( DateTime ) ) . apply ( this , arguments ) ) ;
1027-
1028- _this . _type = 'datetime' ;
1029- _this . _icon = 'calendar' ;
1030- return _this ;
1033+ return possibleConstructorReturn ( this , ( DateTime . __proto__ || Object . getPrototypeOf ( DateTime ) ) . apply ( this , arguments ) ) ;
10311034 }
10321035
10331036 createClass ( DateTime , [ {
1037+ key : 'calendarOptions' ,
1038+ value : function calendarOptions ( ) {
1039+ return {
1040+ type : 'datetime' ,
1041+ icon : 'calendar'
1042+ } ;
1043+ }
1044+ } , {
10341045 key : 'onSettingsChanged' ,
10351046 value : function onSettingsChanged ( val , old ) {
10361047 if ( old . dateFormat === val . dateFormat && old . timeFormat === val . timeFormat ) return ;
0 commit comments