yiisoft / yii-bootstrap5

Yii Framework Bootstrap 5 support
https://www.yiiframework.com/
BSD 3-Clause "New" or "Revised" License
63 stars 19 forks source link

NavBar/Modal refactoring + Offcanvas widget #78

Closed Gerych1984 closed 2 years ago

Gerych1984 commented 2 years ago
Q A
Is bugfix?
New feature? ✔️
Breaks BC? ✔️

Main

  1. Remove unimportant LE which can add additional margins from NavBar, Nav, Alert and Modal
  2. New offcanvas widget

Nav

  1. Remove not usable encodeTags property
  2. Add activeAttributes method/property. With they can set some additional active link attribute like style, data-* etc

NavBar

  1. Add method/property brandImageAttributes
  2. Add short method/property expandSize instead of manual pass class name and helper constant NavBar::EXPAND_SM, NavBar::EXPAND_MD, NavBar::EXPAND_LG, NavBar::EXPAND_XL, NavBar::EXPAND_XXL
  3. Add short method/property theme instead of manual pass class name, helper constant NavBar::THEME_LIGHT and NavBar::THEME_DARK and short methods dark and light
  4. Add encode option for brand and toggle button
  5. Allow NavBar + Offcanvas instead of Collapse as in demo using new NavBar::offcanvas method
  6. Allow toggle external content

Modal

  1. Add full list of sizes with helper constants Modal::SIZE_SMALL, Modal::SIZE_DEFAULT, Modal::SIZE_LARGE, Modal::SIZE_EXTRA_LARGE
  2. Add property/method fullscreen and helper constant Modal::FULLSCREEN_ALWAYS, Modal::FULLSCREEN_BELOW_SM, Modal::FULLSCREEN_BELOW_MD, Modal::FULLSCREEN_BELOW_LG, Modal::FULLSCREEN_BELOW_XL, Modal::FULLSCREEN_BELOW_XXL
  3. Change close button default options as in demo
  4. Add separate encode option to closeButton, title, footer
  5. Add staticBackdrop method/property
  6. Add scrolling method/property
  7. Add centered method/property
  8. Add fade method/property for remove animation
  9. Add custom tag to title, closeButton, toggleButton, footer, header, body, content, dialog
  10. Change access renderToggleButton method to public. That can be useful for render many toggle buttons in random page places for one modal widget
  11. Allow empty title and footer. It can be useful for dynamic content using js

Alert

  1. Add new method type, helper constant Alert::TYPE_PRIMARY, Alert::TYPE_SECONDARY, Alert::TYPE_SUCCESS, Alert::TYPE_DANGER, Alert::TYPE_WARNING, Alert::TYPE_INFO, Alert::TYPE_LIGHT, Alert::TYPE_DARK and short methods primary, secondary, success, danger, warning, info, light, dark
  2. Add method/property fade
  3. Add method/property header and headerOptions
  4. Change access renderCloseButton method to public. It can be useful to render outside close button