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

[1806] Updated Drawer to have custom widgets and functions #1824

Merged
merged 4 commits into from
Feb 7, 2025

Conversation

TheNoumanDev
Copy link
Member

@TheNoumanDev TheNoumanDev commented Jan 8, 2025

issue: #1806

  1. Custom Drawer Item Support

    • Added support for custom widgets in drawer items using customItem property
    • Support for different states (normal/selected) of custom items
    - customItem:
        widget: CustomDrawerItem      # Normal state widget
        selectedWidget: CustomActiveDrawerItem  # required only for app level drawer not requried for screen level. 
      page: Settings
  2. Drawer Control Actions

    • Added new actions to control drawer programmatically as there could be only one drawer at one moment, if app level is configured, then screen level is not built by default.:
      • openDrawer: Opens the drawer from any widget onTap
      • closeDrawer: Closes the drawer from any widget onTap
    Button:
      label: Open Menu
      onTap:
        openDrawer:
  3. Custom Leading Widget Support

    • Added leadingWidget property in header to replace default hamburger icon
    header:
      leadingWidget:
        Icon:
          name: arrow_back
          onTap:
            openDrawer:
  4. Enhanced MenuItem Properties

    • Added isClickable property to control item interaction for section headers with isClickable: false
    - label: "Security Section"
      isClickable: false
  5. Drawer Layout Improvements

    • Added support for header and footer sections in drawer
    • Proper handling of scrollable content between header and footer
    Drawer:
      header:
        Column:
          # Header content
      footer:
        Column:
          # Footer content
  6. Custom Navigation Control

    • Added switchScreen property to control navigation behavior
    • Support for custom onTap actions
    - label: "Card Management"
      page: "card_management"
      switchScreen: false
      onTap:
        closeDrawer:
  7. Visibility Control

    • Items can be conditionally shown/hidden based on visibility conditions
    • Better menu item filtering and management

Docs: EnsembleUI/ensemble_docs#67
Schema: https://github.com/EnsembleUI/ensemble-web-studio/pull/1542
Recording:
https://github.com/user-attachments/assets/840cbce6-d6e2-47e8-8944-f007b8be1b4a

@TheNoumanDev TheNoumanDev requested a review from snehmehta January 8, 2025 21:25
@TheNoumanDev TheNoumanDev changed the title Drawer branch [1806] Updated Drawer to have custom widgets and functions Jan 8, 2025
@TheNoumanDev TheNoumanDev self-assigned this Jan 27, 2025
@TheNoumanDev TheNoumanDev merged commit 0e81616 into main Feb 7, 2025
3 checks passed
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.

require widget support for Drawer items and controllable drawer actions from drawer id
2 participants