How to use the vue-types.func 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 paulschwoerer / leafplayer / frontend / src / components / administration / FolderList / FolderList.vue View on Github external
import { getValue } from 'utils/injector';
    import { ADAPTER } from 'data/Injectables';
    import Input from 'components/form/Input';
    import Icon from 'components/content/Icon';
    import CheckBox from 'components/form/CheckBox';
    import { serializeUrlParams } from 'utils/urlUtils';

    export default {
        name: 'ComponentFolderList',

        props: {
            folders: VueTypes.array.isRequired, // TODO: proper prop type
            updateFolderSelectedState: VueTypes.func.isRequired,
            loadAllFolders: VueTypes.func.isRequired,
            removeFolder: VueTypes.func.isRequired,
            addFolder: VueTypes.func.isRequired,
        },

        created() {
            this.loadAllFolders();
        },

        data() {
            return {
                newFolder: '',
                error: '',
            };
        },

        methods: {
            onSubmit() {
                if (this.newFolder.length) {
github Waavi / vue-wcharts / src / components / Line2 / WLine2.vue View on Github external
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,
            hoverRadius: VueTypes.number,
        }).def({}),
github Waavi / vue-wcharts / src / components / Scatter / WScatter.vue View on Github external
WDot,
        WSpread,
    },
    mixins: [
        themeMixin,
        animationMixin,
        visibleMixin,
    ],
    inject: ['Chart'],
    props: {
        // internal props set by the parent (WPieChart)
        index: VueTypes.number,
        datakey: VueTypes.string,
        trigger: VueTypes.oneOf(['hover', 'click', 'manual']).def('hover'),
        legend: VueTypes.string,
        curve: VueTypes.oneOfType([VueTypes.bool, VueTypes.func]).def(false),
        line: VueTypes.bool.def(false),
        lineStyles: VueTypes.shape({
            stroke: VueTypes.string,
            strokeWidth: VueTypes.number,
            strokeDasharray: VueTypes.string,
        }).loose.def({}),
        dotStyles: VueTypes.shape({
            fill: VueTypes.string,
            stroke: VueTypes.string,
            strokeWidth: VueTypes.number,
            radius: VueTypes.number,
            opacity: VueTypes.number,
        }).loose.def({}),
    },
    computed: {
        lineStylesCmp () {
github Waavi / vue-wcharts / src / components / Axis2 / axisMixin.js View on Github external
// Settings
        id: VueTypes.string.isRequired,
        type: VueTypes.oneOf(AXIS_TYPE_LIST).isRequired,
        reversed: VueTypes.bool.def(false),
        allowDuplicatedCategory: VueTypes.bool.def(false), // http://recharts.org/en-US/examples/LineChartHasMultiSeries
        datakey: VueTypes.string.optional,
        invisible: VueTypes.bool.def(false),
        domain: VueTypes.array.def([]),
        bounds: VueTypes.array.def([]),
        padding: VueTypes.object.def({}), // space between axis edges and bounds region

        // Ticks
        ticks: VueTypes.array.optional,
        numTicks: VueTypes.number.def(8),
        exactNumTicks: VueTypes.number.optional,
        tickFormatter: VueTypes.func.def(value => value),

        // Label
        label: VueTypes.oneOfType([
            VueTypes.string,
            VueTypes.arrayOf(VueTypes.string),
        ]).optional,
        labelFontSize: VueTypes.number.def(12),

        grid: VueTypes.oneOfType([
            VueTypes.bool, // same as "1"
            VueTypes.number, // number of grid lines per tick
        ]).optional,

        // Negative axis
        hideNegativeAxis: VueTypes.bool.def(false),
github appbaseio / reactivesearch / packages / vue / src / components / basic / StateProvider.jsx View on Github external
(components, componentId) => ({
			...components,
			[componentId]: Object.keys(state[componentId])
				.filter(key => allowedKeys.includes(key))
				.reduce((obj, key) => {
					// eslint-disable-next-line
					obj[key] = state[componentId][key];
					return obj;
				}, {}),
		}),
		{},
	);
const StateProvider = {
	name: 'StateProvider',
	props: {
		onChange: VueTypes.func,
		componentIds: VueTypes.oneOfType([VueTypes.string, VueTypes.arrayOf(VueTypes.string)]),
		includeKeys: VueTypes.arrayOf(VueTypes.string).def(defaultKeys),
		strict: VueTypes.bool.def(true),
	},
	data() {
		this.__state = {
			searchState: null,
		};
		return this.__state;
	},
	mounted() {
		this.searchState = filterByKeys(
			getSearchState(filterProps(this.searchStateProps)),
			this.includeKeys,
		);
	},
github Waavi / vue-wcharts / src / components / Line / WLine.vue View on Github external
components: {
        WDot,
        WSpread,
    },
    mixins: [
        themeMixin,
        animationMixin,
        visibleMixin,
    ],
    inject: ['Chart'],
    props: {
        index: VueTypes.number.isRequired, // internal props set by the parent (WCartesian)
        datakey: VueTypes.string.isRequired,
        trigger: VueTypes.oneOf(['hover', 'click', 'manual']).def('click'),
        legend: VueTypes.string,
        curve: VueTypes.oneOfType([VueTypes.bool, VueTypes.func]).def(false),
        area: VueTypes.bool.def(false),
        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,
            hoverRadius: VueTypes.number,
        }).def({}),
    },
github paulschwoerer / leafplayer / frontend / src / components / media / SongListEntry / SongListEntry.vue View on Github external
// Show 1 based song index
            showIndex: VueTypes.bool.isRequired,
            showArtist: VueTypes.bool.isRequired,
            showAlbum: VueTypes.bool.isRequired,
            showDuration: VueTypes.bool.isRequired,
            showOptions: VueTypes.bool.isRequired,
            isPlaying: VueTypes.bool.isRequired,
            song: LeafPlayerPropTypes.song.isRequired,
            isSortable: VueTypes.bool.def(false),
            isDragging: VueTypes.bool.isRequired,
            isOver: VueTypes.bool.isRequired,
            index: VueTypes.number.isRequired,
            allowSongSorting: VueTypes.bool.isRequired,

            // Callback when a song list entry is dropped on another
            onSongDropped: VueTypes.func.isRequired,

            // Callback for when the play/pause button is clicked
            onPlayPauseClicked: VueTypes.func.isRequired,

            // playlist & queue specific
            isPlaylist: VueTypes.bool.isRequired,
            onRemoveFromPlaylist: VueTypes.func.isRequired,
            isQueue: VueTypes.bool.isRequired,
            onRemoveFromQueue: VueTypes.func.isRequired,

            // Popover props
            onPopoverOpen: VueTypes.func.isRequired,
            onPopoverClose: VueTypes.func.isRequired,
            popoverOpened: VueTypes.bool.isRequired,
        },
github paulschwoerer / leafplayer / frontend / src / components / form / ValidationForm / ValidationForm.vue View on Github external
errorOverride: VueTypes.string,
                type: VueTypes.oneOf([
                    'text',
                    'email',
                    'password',
                    'search',
                    'url',
                    'number',
                    'date',
                    'textarea',
                    'checkbox',
                ]),
                required: VueTypes.bool,
                maximumLength: VueTypes.number,
                validators: VueTypes.arrayOf(VueTypes.shape({
                    validate: VueTypes.func,
                    message: VueTypes.string,
                })),
            })),
        },

        watch: {
            fields() {
                this.validateAllFields();
            },
        },

        data() {
            return {
                // hashmap to store all field errors
                errors: {},