How to use ra-tree-core - 6 common examples

To help you get started, weā€™ve selected a few ra-tree-core 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 marmelab / react-admin / packages / ra-tree-ui-materialui / src / TreeNode.tsx View on Github external
const mapStateToProps = (state, { record, resource }) => {
    const hasRecord = record && record.id != undefined; // eslint-disable-line eqeqeq

    return {
        expanded: hasRecord ? getIsExpanded(state, resource, record.id) : false,
        loading: hasRecord ? getIsLoading(state, resource, record.id) : false,
        nodes: hasRecord ? getChildrenNodes(state, resource, record.id) : [],
    };
};
github marmelab / react-admin / packages / ra-tree-ui-materialui / src / TreeNode.tsx View on Github external
const mapStateToProps = (state, { record, resource }) => {
    const hasRecord = record && record.id != undefined; // eslint-disable-line eqeqeq

    return {
        expanded: hasRecord ? getIsExpanded(state, resource, record.id) : false,
        loading: hasRecord ? getIsLoading(state, resource, record.id) : false,
        nodes: hasRecord ? getChildrenNodes(state, resource, record.id) : [],
    };
};
github marmelab / react-admin / packages / ra-tree-ui-materialui / src / TreeNode.tsx View on Github external
const mapStateToProps = (state, { record, resource }) => {
    const hasRecord = record && record.id != undefined; // eslint-disable-line eqeqeq

    return {
        expanded: hasRecord ? getIsExpanded(state, resource, record.id) : false,
        loading: hasRecord ? getIsLoading(state, resource, record.id) : false,
        nodes: hasRecord ? getChildrenNodes(state, resource, record.id) : [],
    };
};
github marmelab / react-admin / packages / ra-tree-ui-materialui / src / AddChildNodeMenuItem.tsx View on Github external
const mapStateToProps = (state, props) => ({
    nodeChildren:
        props.record && props.record.id
            ? getChildrenNodes(state, props.resource, props.record.id)
            : [],
});
github marmelab / react-admin / packages / ra-tree-ui-materialui / src / TreeNode.tsx View on Github external
resource: props.resource,
            data: {
                ...draggedRecord,
                [props.parentSource]: nodeParent,
                [props.positionSource]: nodePosition,
            },
            parentSource: props.parentSource,
            positionSource: props.positionSource,
            previousData: draggedRecord,
            basePath: props.basePath,
            refresh: false,
            redirectTo: undefined,
        };

        if (props.undoable) {
            props.startUndoable(crudMoveNodeAction(actionPayload));
        } else {
            props.crudMoveNode(actionPayload);
        }
    },
};
github marmelab / react-admin / packages / ra-tree-ui-materialui / src / TreeNodeList.tsx View on Github external
const mapStateToProps = (state, { resource, nodes }) => ({
    data: getTreeNodes(state, resource, nodes),
});

ra-tree-core

A treeview component without ui to use with react-admin

MIT
Latest version published 5 years ago

Package Health Score

73 / 100
Full package analysis