4141
4242<script >
4343import abstractField from " ../abstractField" ;
44- import { debounce , isFunction , isNumber } from " lodash" ;
44+ import { debounce , get as objGet , isFunction , isNumber } from " lodash" ;
4545import fecha from " fecha" ;
4646
4747const DATETIME_FORMATS = {
@@ -50,8 +50,6 @@ const DATETIME_FORMATS = {
5050 " datetime-local" : " YYYY-MM-DDTHH:mm:ss" ,
5151};
5252
53- const DEBOUNCE_FORMAT_MS = 1000 ;
54-
5553export default {
5654 mixins: [abstractField],
5755 methods: {
@@ -115,8 +113,7 @@ export default {
115113 case " range" :
116114 this .debouncedFormatFunc = debounce ((newValue , oldValue ) => {
117115 this .formatNumberToModel (newValue, oldValue);
118- }
119- , DEBOUNCE_FORMAT_MS , {
116+ }, parseInt (objGet (this .schema , " debounceFormatTimeout" , 1000 )), {
120117 trailing: true ,
121118 leading: false
122119 });
@@ -127,8 +124,7 @@ export default {
127124 // wait 1s before calling 'formatDatetimeToModel' to allow user to input data
128125 this .debouncedFormatFunc = debounce ((newValue , oldValue ) => {
129126 this .formatDatetimeToModel (newValue, oldValue);
130- }
131- , DEBOUNCE_FORMAT_MS , {
127+ }, parseInt (objGet (this .schema , " debounceFormatTimeout" , 1000 )), {
132128 trailing: true ,
133129 leading: false
134130 });
0 commit comments