How to use the vue-types.oneOf 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 appbaseio / reactivesearch / packages / vue / src / utils / vueTypes.js View on Github external
supportedOrientations: VueTypes.oneOf([
		'portrait',
		'portrait-upside-down',
		'landscape',
		'landscape-left',
		'landscape-right',
	]),
	sortBy: VueTypes.oneOf(['asc', 'desc']),
	sortOptions: VueTypes.arrayOf(
		VueTypes.shape({
			label: VueTypes.string,
			dataField: VueTypes.string,
			sortBy: VueTypes.string,
		}),
	),
	sortByWithCount: VueTypes.oneOf(['asc', 'desc', 'count']),
	stats: VueTypes.arrayOf(VueTypes.object),
	string: VueTypes.string,
	stringArray: VueTypes.arrayOf(VueTypes.string),
	stringOrArray: VueTypes.oneOfType([VueTypes.string, VueTypes.arrayOf(VueTypes.string)]),
	stringRequired: VueTypes.string.isRequired,
	style: VueTypes.object,
	themePreset: VueTypes.oneOf(['light', 'dark']),
	// queryFormatDate: VueTypes.oneOf(VueTypes.object.keys(dateFormats)),
	queryFormatSearch: VueTypes.oneOf(['and', 'or']),
	queryFormatNumberBox: VueTypes.oneOf(['exact', 'lte', 'gte']),
	params: VueTypes.object.isRequired,
	props: VueTypes.object,
	rangeLabelsAlign: VueTypes.oneOf(['left', 'right']),
	title: VueTypes.oneOfType([VueTypes.string, VueTypes.any]),
	tooltipTrigger: VueTypes.oneOf(['always', 'none', 'hover']),
	location: VueTypes.shape({
github Waavi / vue-wcharts / src / components / Bar / WBar.vue View on Github external
mixins: [animationMixin, themeMixin, visibleMixin],
    inject: ['Chart'],
    props: {
        index: VueTypes.number, // internal props set by the parent (WPieChart)
        datakey: VueTypes.string.isRequired,
        trigger: VueTypes.oneOf(['hover', 'click', 'manual']).def('hover'),
        legend: VueTypes.string, // Prop to apply filters
        stacked: VueTypes.bool.def(false),
        showLabel: VueTypes.bool.def(false),
        labelSize: VueTypes.number.def(12),
        labelAlign: VueTypes.oneOf(['start', 'middle', 'end']).def('middle'),
        labelPosition: VueTypes.oneOf(['inside', 'outside']).def('inside'),
        labelStyles: VueTypes.object,
        showStackedLabel: VueTypes.bool.def(false),
        stackedLabelSize: VueTypes.number.def(12),
        stackedLabelAlign: VueTypes.oneOf(['start', 'middle', 'end']).def('middle'),
        stackedLabelStyles: VueTypes.object,
        width: VueTypes.number.def(DEFAULT_WIDTH),
        color: VueTypes.oneOfType([
            VueTypes.string,
            VueTypes.arrayOf(VueTypes.string),
        ]),
        styles: VueTypes.object,
    },
    // It's called by parent components to necessary calcs before be rendering
    // Componen is not mounted and cannot access to default props
    preload ({ parent, props, index }) {
        const { snap, colors, data } = parent
        const { datakey, color, stacked } = props

        const isStacked = stacked !== undefined && stacked !== false
github Waavi / vue-wcharts / src / components / Axis2 / WYAxis2 / WYAxis2.vue View on Github external
dimension: AXIS_DIMENSION.Y,
    components: {
        WAxisText,
    },
    mixins: [axisMixin, outerElementMixin],
    props: {
        id: VueTypes.string.def(AXIS_DIMENSION.Y),
        type: VueTypes.oneOf(AXIS_TYPE_LIST).def(AXIS_TYPE.NUMERIC),
        position: VueTypes.oneOf(['left', 'right']).def('left'),
        padding: VueTypes.shape({
            top: VueTypes.number,
            bottom: VueTypes.number,
        }).def({}), // space between axis edges and bounds region
        width: VueTypes.number.def(30),

        labelAlign: VueTypes.oneOf(['start', 'middle', 'end']).def('end'),
        negativeAxisStyles: VueTypes.object.def({}),
    },
    layoutInOuterArea (props) {
        const {
            position, tickLength, width, invisible,
        } = props || {}
        return {
            reference: 'canvas',
            order: -1, // it should be the first one
            position,
            top: 0,
            height: '100%',
            width: invisible ? 0 : tickLength + width,
        }
    },
    computed: {
github Waavi / vue-wcharts / src / extraCharts / SimpleHStackBar / WSimpleHStackBar.vue View on Github external
},
    filters: {
        // Transform value to percentage string
        percentage (value) {
            return `${value.toFixed(2)}%`
        },
    },
    mixins: [
        activeMixin,
        themeMixin,
        animationMixin,
    ],
    props: {
        dataset: VueTypes.arrayOf(VueTypes.number).def([]),
        markers: VueTypes.arrayOf(VueTypes.number).def([]),
        trigger: VueTypes.oneOf(['hover', 'click', 'manual']).def('hover'),
        total: VueTypes.number,
        showLabel: VueTypes.bool.def(false),
        delay: VueTypes.number.def(300),
        minWidth: VueTypes.number,
        // Styles
        styles: VueTypes.object.def({}),
        labelStyles: VueTypes.object,
        markerStyles: VueTypes.object.def({}),
    },
    data () {
        return {
            launchAnimation: false,
            offset: this.minWidth || MIN_WIDTH,
        }
    },
    computed: {
github Waavi / vue-wcharts / src / components / Line2 / WLine2.vue View on Github external
// import { isFunc } from '../../utils/checks'

export default {
    name: 'WLine2',
    // components: {
    //     WDot,
    //     WSpread,
    // },
    mixins: [drawableCartesianMixin],
    props: {
        xAxisId: VueTypes.string.optional,
        xDatakey: VueTypes.string.optional,
        yAxisId: VueTypes.string.optional,
        yDatakey: VueTypes.string.optional,

        trigger: VueTypes.oneOf(['hover', 'click', 'manual']).def('click'),
        label: VueTypes.string,
        curve: VueTypes.oneOfType([VueTypes.bool, VueTypes.func]).def(false),
        area: VueTypes.bool.def(false),
        color: VueTypes.string.optional,
        styles: VueTypes.shape({
            fill: VueTypes.string,
            stroke: VueTypes.string,
            strokeWidth: VueTypes.number,
            strokeDasharray: VueTypes.string,
        }).def({}),
        dot: VueTypes.bool.def(false),
        dotStyles: VueTypes.shape({
            fill: VueTypes.string,
            stroke: VueTypes.string,
            strokeWidth: VueTypes.number,
            radius: VueTypes.number,
github Waavi / vue-wcharts / src / components / Widgets / WLegend.vue View on Github external
import sortBy from 'lodash.sortby'
import { toPx, getIsHorizontal, getSpacesByPos } from './utils'
import WLegendItem from './WLegendItem.vue'
import WBullet from './WBullet.vue'

export default {
    name: 'WLegend',
    type: 'plugins',
    inject: ['Chart'],
    components: {
        WLegendItem,
        WBullet,
    },
    props: {
        position: VueTypes.oneOf(['top', 'bottom', 'left', 'right']).def('bottom'),
        align: VueTypes.oneOf(['start', 'center', 'end']).def('center'),
        space: VueTypes.arrayOf(VueTypes.number).def([16, 16, 16, 16]),
        size: VueTypes.number, // Width or height, with different positiion prop top-bottom/left-right
        selectable: VueTypes.bool.def(false),
        componentsStyles: VueTypes.object,
        wrapperStyles: VueTypes.object,
        legendStyles: VueTypes.object,
        colors: VueTypes.arrayOf(VueTypes.string),
    },
    preload ({ parent, props, index }) {
        const { position, size, space } = props
        // Positions
        const isHorizontal = getIsHorizontal(position)
        const innerWidth = !isHorizontal ? size || 85 : null
        const innerHeight = isHorizontal ? size || 20 : null
        // Spaces
        const [top, right, bottom, left] = space || this.props.space.default()
github appbaseio / reactivesearch / packages / vue / src / components / list / SingleDropdownList.jsx View on Github external
defaultValue: types.string,
		value: types.value,
		filterLabel: types.string,
		innerClass: types.style,
		placeholder: VueTypes.string.def('Select a value'),
		react: types.react,
		renderLabel: types.func,
		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);
		});
github appbaseio / reactivesearch / packages / vue / src / components / search / DataSearch.jsx View on Github external
customHighlight: types.func,
		customQuery: types.func,
		dataField: types.dataFieldArray,
		aggregationField: types.string,
		size: VueTypes.number.def(20),
		debounce: VueTypes.number.def(0),
		defaultValue: types.string,
		value: types.value,
		defaultSuggestions: types.suggestions,
		fieldWeights: types.fieldWeights,
		filterLabel: types.string,
		fuzziness: types.fuzziness,
		highlight: types.bool,
		highlightField: types.stringOrArray,
		icon: types.children,
		iconPosition: VueTypes.oneOf(['left', 'right']).def('left'),
		innerClass: types.style,
		innerRef: types.func,
		render: types.func,
		parseSuggestion: types.func,
		renderNoSuggestion: types.title,
		renderError: types.title,
		placeholder: VueTypes.string.def('Search'),
		queryFormat: VueTypes.oneOf(['and', 'or']).def('or'),
		react: types.react,
		showClear: VueTypes.bool.def(true),
		showFilter: VueTypes.bool.def(true),
		showIcon: VueTypes.bool.def(true),
		title: types.title,
		theme: types.style,
		URLParams: VueTypes.bool.def(false),
		strictSelection: VueTypes.bool.def(false),