How to use the cx/ui.VDOM.Component function in cx

To help you get started, we’ve selected a few cx 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 codaxy / dashboards / app / components / OnScreenLoader.js View on Github external
explore(context, instance) {
		if (instance.state.active) super.explore(context, instance);
	}

	render(context, instance, key) {
		return (
			
				{instance.state.active && this.renderChildren(context, instance)}
			
		);
	}
}

OnScreenLoader.prototype.styled = true;

class OnScreen extends VDOM.Component {
	render() {
		if (!this.elRef)
			this.elRef = el => {
				this.el = el;
			};

		let { children, data } = this.props;
		return (
			<div style="{data.style}">
				{children}
			</div>
		);
	}

	componentDidMount() {
		if (window.IntersectionObserver) {
github codaxy / tdo / app / routes / board / Task.js View on Github external
declareData() {
        super.declareData(...arguments, {
            task: undefined,
            styleRules: undefined,
            autoFocus: undefined,
            isNew: undefined
        })
    }

    render(context, instance, key) {
        return 
    }
}


class TaskCmp extends VDOM.Component {

    constructor(props) {
        super(props);

        this.state = {
            edit: props.data.isNew,
            scrollHeight: null
        };

        this.dom = {};
    }

    render() {
        let { instance, data } = this.props;
        let { widget } = instance;
        let { CSS } = widget;
github codaxy / dashboards / app / components / GridLayout.js View on Github external
}
}

GridLayout.prototype.baseClass = "gridlayout";
GridLayout.prototype.styled = true;

function createRef(scope, name) {
    return (
        scope[`${name}Ref`] ||
        (scope[`${name}Ref`] = function (el) {
            scope[name] = el;
        })
    );
}

class Grid extends VDOM.Component {
    render() {
        let {data, instance, children} = this.props;
        let {CSS, baseClass} = instance.widget;

        return (
            <div style="{data.style}">
                <div></div></div>