mekari-ui-vue
Version:
--- General web components in Mekari. The components are made using vue.js as its framework. Styling of components on Mekari UI Vue uses [Mekari UI Toolkit](https://bitbucket.org/mid-kelola-indonesia/mekari-ui-toolkit/src/master/). Don't forget to import
25 lines (23 loc) • 885 B
JavaScript
import locale from '../locale';
export default {
methods: {
/**
* Function to return the corresponding shortcut button's copy.
* @param {String} options has a value between: 'day', 'month', 'year'. Will act as key to return the corresponding copy.
* @return {String} return string of corresponding shortcut button's copy in DayPicker, MonthPicker and YearPicker.
*/
getShortcutCopy(options) {
return locale.dictionary[this.language].shortcutCopy[options];
},
isSameWrapperOnBlur(event) {
const datePickerWrapper = this.$parent;
const currentElement = event.relatedTarget ? event.relatedTarget.closest('.date-picker__wrapper') : null;
return datePickerWrapper.$el === currentElement;
},
checkBlur(event) {
if (!this.isSameWrapperOnBlur(event)) {
this.$emit('hide-date-picker');
}
},
},
};