How to use the vue-types.any function in vue-types

To help you get started, we’ve selected a few vue-types examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Waavi / vue-wcharts / src / components / Common / WDot / WDot.vue View on Github external
WTrans,
    },
    mixins: [themeMixin],
    props: {
        index: VueTypes.number.isRequired,
        cartesianIndex: VueTypes.number.isRequired,
        trigger: VueTypes.oneOf(['hover', 'click', 'manual']).def('hover'),
        x: VueTypes.number.isRequired,
        y: VueTypes.number.isRequired,
        fill: VueTypes.string,
        stroke: VueTypes.string,
        strokeWidth: VueTypes.number,
        radius: VueTypes.number,
        hoverRadius: VueTypes.number,
        info: VueTypes.shape({
            id: VueTypes.any,
            label: VueTypes.any,
            value: VueTypes.array,
        }).loose,
        styles: VueTypes.object.def({}),
        transition: VueTypes.string.isRequired,
    },
    computed: {
        dotStyles () {
            return {
                ...this.themeStyles.styles,
                ...this.styles,
                ...(this.trigger === 'click' ? { cursor: 'pointer' } : {}),
            }
        },
        // Event Listeners
        dotListeners () {
github appbaseio / reactivesearch / packages / vue / src / utils / vueTypes.js View on Github external
function validateLocation(props, propName) {
	// eslint-disable-next-line
	if (isNaN(props[propName])) {
		return new Error(`${propName} value must be a VueTypes.number`);
	}
	if (propName === 'lat' && (props[propName] < -90 || props[propName] > 90)) {
		return new Error(`${propName} value should be between -90 and 90.`);
	}
	if (propName === 'lng' && (props[propName] < -180 || props[propName] > 180)) {
		return new Error(`${propName} value should be between -180 and 180.`);
	}
	return null;
}

const types = {
	any: VueTypes.any,
	bool: VueTypes.bool,
	boolRequired: VueTypes.bool.isRequired,
	components: VueTypes.arrayOf(VueTypes.string),
	children: VueTypes.any,
	data: VueTypes.arrayOf(VueTypes.object),
	dataFieldArray: VueTypes.oneOfType([VueTypes.string, VueTypes.arrayOf(VueTypes.string)])
		.isRequired,
	dataNumberBox: VueTypes.shape({
		label: VueTypes.string,
		start: VueTypes.number.isRequired,
		end: VueTypes.number.isRequired,
	}).isRequired,
	date: VueTypes.oneOfType([VueTypes.string, VueTypes.arrayOf(VueTypes.string)]),
	dateObject: VueTypes.object,
	excludeFields: VueTypes.arrayOf(VueTypes.string),
	fieldWeights: VueTypes.arrayOf(VueTypes.number),
github appbaseio / reactivesearch / packages / vue / src / components / result / ReactiveList.jsx View on Github external
props: {
		currentPage: VueTypes.number.def(0),
		includeFields: types.includeFields.def(['*']),
		// component props
		className: types.string,
		componentId: types.stringRequired,
		dataField: types.stringRequired,
		aggregationField: types.string,
		defaultQuery: types.func,
		excludeFields: types.excludeFields.def([]),
		innerClass: types.style,
		listClass: VueTypes.string.def(''),
		loader: types.title,
		render: types.func,
		renderItem: types.func,
		renderNoResults: VueTypes.any.def('No Results found.'),
		renderError: types.title,
		renderResultStats: types.func,
		pages: VueTypes.number.def(5),
		pagination: VueTypes.bool.def(false),
		paginationAt: types.paginationAt.def('bottom'),
		react: types.react,
		showResultStats: VueTypes.bool.def(true),
		showEndPage: VueTypes.bool.def(false),
		size: VueTypes.number.def(10),
		sortBy: types.sortBy,
		sortOptions: types.sortOptions,
		stream: types.bool,
		URLParams: VueTypes.bool.def(false),
	},
	computed: {
		shouldRenderPagination() {
github Waavi / vue-wcharts / src / components / Common / WDot / WDot.vue View on Github external
},
    mixins: [themeMixin],
    props: {
        index: VueTypes.number.isRequired,
        cartesianIndex: VueTypes.number.isRequired,
        trigger: VueTypes.oneOf(['hover', 'click', 'manual']).def('hover'),
        x: VueTypes.number.isRequired,
        y: VueTypes.number.isRequired,
        fill: VueTypes.string,
        stroke: VueTypes.string,
        strokeWidth: VueTypes.number,
        radius: VueTypes.number,
        hoverRadius: VueTypes.number,
        info: VueTypes.shape({
            id: VueTypes.any,
            label: VueTypes.any,
            value: VueTypes.array,
        }).loose,
        styles: VueTypes.object.def({}),
        transition: VueTypes.string.isRequired,
    },
    computed: {
        dotStyles () {
            return {
                ...this.themeStyles.styles,
                ...this.styles,
                ...(this.trigger === 'click' ? { cursor: 'pointer' } : {}),
            }
        },
        // Event Listeners
        dotListeners () {
            return merge({}, this.$listeners, {
github appbaseio / reactivesearch / packages / vue / src / components / list / MultiDropdownList.jsx View on Github external
render: types.func,
		renderItem: types.func,
		renderError: types.title,
		transformData: types.func,
		selectAllLabel: types.string,
		showCount: VueTypes.bool.def(true),
		showFilter: VueTypes.bool.def(true),
		size: VueTypes.number.def(100),
		sortBy: VueTypes.oneOf(['asc', 'desc', 'count']).def('count'),
		title: types.title,
		URLParams: VueTypes.bool.def(false),
		showMissing: VueTypes.bool.def(false),
		missingLabel: VueTypes.string.def('N/A'),
		showSearch: VueTypes.bool.def(false),
		showLoadMore: VueTypes.bool.def(false),
		loadMoreLabel: VueTypes.oneOfType([VueTypes.string, VueTypes.any]).def('Load More'),
		nestedField: types.string,
	},
	created() {
		const onQueryChange = (...args) => {
			this.$emit('queryChange', ...args);
		};
		this.setQueryListener(this.$props.componentId, onQueryChange, e => {
			this.$emit('error', e);
		});
	},
	mounted() {
		const propsKeys = getValidPropsKeys(this.$props);
		this.updateComponentProps(this.componentId, this.$props);
		this.$watch(propsKeys.join('.'), (newVal, oldVal) => {
			checkSomePropChange(newVal, oldVal, propsKeys, () => {
				this.updateComponentProps(this.componentId, this.$props);
github appbaseio / reactivesearch / packages / vue / src / components / list / SingleDropdownList.jsx View on Github external
render: types.func,
		renderItem: types.func,
		renderError: types.title,
		transformData: types.func,
		selectAllLabel: types.string,
		showCount: VueTypes.bool.def(true),
		showFilter: VueTypes.bool.def(true),
		size: VueTypes.number.def(100),
		sortBy: VueTypes.oneOf(['asc', 'desc', 'count']).def('count'),
		title: types.title,
		URLParams: VueTypes.bool.def(false),
		showMissing: VueTypes.bool.def(false),
		missingLabel: VueTypes.string.def('N/A'),
		showSearch: VueTypes.bool.def(false),
		showLoadMore: VueTypes.bool.def(false),
		loadMoreLabel: VueTypes.oneOfType([VueTypes.string, VueTypes.any]).def('Load More'),
		nestedField: types.string,
	},
	created() {
		const onQueryChange = (...args) => {
			this.$emit('queryChange', ...args);
		};
		this.setQueryListener(this.$props.componentId, onQueryChange, e => {
			this.$emit('error', e);
		});
	},
	mounted() {
		const propsKeys = getValidPropsKeys(this.$props);
		this.updateComponentProps(this.componentId, this.$props);
		this.$watch(propsKeys.join('.'), (newVal, oldVal) => {
			checkSomePropChange(newVal, oldVal, propsKeys, () => {
				this.updateComponentProps(this.componentId, this.$props);
github Waavi / vue-wcharts / src / components / Marker / WMarker.vue View on Github external
name: 'WMarker',
    type: 'cartesian',
    inject: ['Chart'],
    mixins: [themeMixin],
    props: {
        x: VueTypes.oneOfType([VueTypes.number, VueTypes.arrayOf(VueTypes.number)]).optional,
        y: VueTypes.oneOfType([VueTypes.number, VueTypes.arrayOf(VueTypes.number)]).optional,
        borderSpacing: VueTypes.oneOfType([VueTypes.number, VueTypes.arrayOf(VueTypes.number)]).def([0, 0, 0, 0]),
        label: VueTypes.string.def(''),
        labelAlign: VueTypes.oneOf(['start', 'end']).def('end'),
        styles: VueTypes.object.def({}),
        labelStyles: VueTypes.object,
        trigger: VueTypes.oneOf(['hover', 'click', 'manual']).def('hover'),
        info: VueTypes.shape({
            id: VueTypes.any,
            label: VueTypes.any,
            value: VueTypes.array,
        }).loose,
    },
    computed: {
        scaledX () {
            if (Array.isArray(this.x) && this.x.length === 2) {
                return this.x.map(x => this.getScaledValue({ value: x, isX: true, isCategory: !this.Chart.scatter })).sort()
            }
            if (this.x !== undefined) {
                return this.getScaledValue({ value: this.x, isX: true, isCategory: !this.Chart.scatter })
            }
            return undefined
        },
        scaledY () {
            if (Array.isArray(this.y) && this.y.length === 2) {
                return this.y.map(y => this.getScaledValue({ value: y, isX: false, isCategory: false })).sort()
github Waavi / vue-wcharts / src / components / Marker / WMarker.vue View on Github external
export default {
    name: 'WMarker',
    type: 'cartesian',
    inject: ['Chart'],
    mixins: [themeMixin],
    props: {
        x: VueTypes.oneOfType([VueTypes.number, VueTypes.arrayOf(VueTypes.number)]).optional,
        y: VueTypes.oneOfType([VueTypes.number, VueTypes.arrayOf(VueTypes.number)]).optional,
        borderSpacing: VueTypes.oneOfType([VueTypes.number, VueTypes.arrayOf(VueTypes.number)]).def([0, 0, 0, 0]),
        label: VueTypes.string.def(''),
        labelAlign: VueTypes.oneOf(['start', 'end']).def('end'),
        styles: VueTypes.object.def({}),
        labelStyles: VueTypes.object,
        trigger: VueTypes.oneOf(['hover', 'click', 'manual']).def('hover'),
        info: VueTypes.shape({
            id: VueTypes.any,
            label: VueTypes.any,
            value: VueTypes.array,
        }).loose,
    },
    computed: {
        scaledX () {
            if (Array.isArray(this.x) && this.x.length === 2) {
                return this.x.map(x => this.getScaledValue({ value: x, isX: true, isCategory: !this.Chart.scatter })).sort()
            }
            if (this.x !== undefined) {
                return this.getScaledValue({ value: this.x, isX: true, isCategory: !this.Chart.scatter })
            }
            return undefined
        },
        scaledY () {
            if (Array.isArray(this.y) && this.y.length === 2) {
github appbaseio / reactivesearch / packages / vue / src / utils / vueTypes.js View on Github external
}
	if (propName === 'lat' && (props[propName] < -90 || props[propName] > 90)) {
		return new Error(`${propName} value should be between -90 and 90.`);
	}
	if (propName === 'lng' && (props[propName] < -180 || props[propName] > 180)) {
		return new Error(`${propName} value should be between -180 and 180.`);
	}
	return null;
}

const types = {
	any: VueTypes.any,
	bool: VueTypes.bool,
	boolRequired: VueTypes.bool.isRequired,
	components: VueTypes.arrayOf(VueTypes.string),
	children: VueTypes.any,
	data: VueTypes.arrayOf(VueTypes.object),
	dataFieldArray: VueTypes.oneOfType([VueTypes.string, VueTypes.arrayOf(VueTypes.string)])
		.isRequired,
	dataNumberBox: VueTypes.shape({
		label: VueTypes.string,
		start: VueTypes.number.isRequired,
		end: VueTypes.number.isRequired,
	}).isRequired,
	date: VueTypes.oneOfType([VueTypes.string, VueTypes.arrayOf(VueTypes.string)]),
	dateObject: VueTypes.object,
	excludeFields: VueTypes.arrayOf(VueTypes.string),
	fieldWeights: VueTypes.arrayOf(VueTypes.number),
	filterLabel: VueTypes.string,
	func: VueTypes.func,
	funcRequired: VueTypes.func.isRequired,
	fuzziness: VueTypes.oneOf([0, 1, 2, 'AUTO']),