Fohn-Group / fohn-ui

PHP framework using Tailwind Css
MIT License
2 stars 2 forks source link

Tree component #33

Closed ibelar closed 2 months ago

ibelar commented 4 months ago

Implementation of PrimeVue component: Tree

Since PrimeVue 4.0 compatibility with TailwindCss is out-of-the-box, Fohn-Ui will start integrating some of their Vue Ui component.

Features:

More info on: PrimeVue

Usage

$fileModel = new File(Data::db());
$tree = Tree::addTo(Ui::layout());

$tree->setNodes($fileModel->getFilesHierarchy());
$tree->setSelectionMode('checkbox') // 'single' or 'multiple' are also supported.
    ->setHeight('600px')
    ->setFilter(['label', 'type'], 'lenient', 'Search file');

$tree->onNodeSelected(static function ($tree, $key) {
    return JsToast::notify('node selected', $key);
});

Preview

Screenshot 2024-07-16 at 3 43 45 PM

Note