Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tree component #33

Merged
merged 16 commits into from
Aug 19, 2024
Merged

Tree component #33

merged 16 commits into from
Aug 19, 2024

Conversation

ibelar
Copy link
Member

@ibelar ibelar commented Jul 16, 2024

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:

  • support single, multiple or checkbox selection mode;
  • server callback when node is select / deselect;
  • user selection value can be retrieve/restore;
  • Html Template specific to each node type;
  • Apply filter on Tree by field;
  • Collapsable / Expandable

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

  • require fonh-js v.1.8.0
  • require fohn-css v.1.4.0

@ibelar ibelar marked this pull request as draft July 16, 2024 20:00
@ibelar ibelar marked this pull request as ready for review August 19, 2024 14:05
@ibelar ibelar merged commit f8e5c3c into dev-develop Aug 19, 2024
2 checks passed
@ibelar ibelar deleted the tree-component branch August 19, 2024 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant