All files / src/components/FormField/mixins datePickerOptions.ts

100% Statements 13/13
100% Branches 2/2
100% Functions 2/2
100% Lines 10/10

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 327x 7x       7x       7x             7x 5x             5x 4x     1x   7x  
import Vue from 'vue';
import Component from 'vue-class-component';
 
import { Options } from '@cnamts/vue-dot/src/mixins/customizable';
 
import merge from 'deepmerge';
 
/** Merge default options (eg. menu position fix) with fieldOptions */
@Component
export class DatePickerOptions extends Vue {
	/**
	 * Get Vuetify options object
	 *
	 * @param {Options} fieldOptions The fieldOptions to merge with
	 * @returns {Options} The merged options
	 */
	getVuetifyOptions(fieldOptions?: Options): Options {
		const defaultOptions = {
			menu: {
				nudgeBottom: 55,
				nudgeRight: 0
			}
		};
 
		if (fieldOptions) {
			return merge(defaultOptions, fieldOptions) as unknown as Options;
		}
 
		return defaultOptions;
	}
}