Learn more  » Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

jsarnowski / jsarnowski/jet-blocks   php

Repository URL to install this package:

Version: 1.2.8 

/ modules / vue-ui / assets / src / js / components / layout / component-wrapper.js

import { wrapperClasses } from '../../mixins/wrapper-classes';
import { checkConditions } from '../../mixins/check-conditions';

const ComponentWrapper = {

	name: 'cx-vui-component-wrapper',
	template: '#cx-vui-component-wrapper',
	mixins: [ wrapperClasses, checkConditions ],
	props: {
		elementId: {
			type: String
		},
		label: {
			type: String
		},
		description: {
			type: String
		},
		preventWrap: {
			type: Boolean,
			default: false
		},
		wrapperCss: {
			type: Array,
			default: function() {
				return [];
			}
		},
		conditions: {
			type: Array,
			default() {
				return [];
			}
		},
	},
	computed: {
		wrapperClassesRaw() {

			let classesList = [ 'cx-vui-component-raw' ];

			if ( this.wrapperCss ) {
				this.wrapperCss.forEach( className => {
					classesList.push( className );
				} );
			}

			return classesList;
		}
	}
};

export default ComponentWrapper;