@dhasdk/simple-ui 1.0.19 → 1.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -0
- package/index.css +1 -1
- package/index.js +15 -15
- package/index.mjs +639 -631
- package/lib/SideBarNav.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1673,6 +1673,7 @@ Full list of props below
|
|
|
1673
1673
|
| image | string | No | undefined | string path to the application logo to display |
|
|
1674
1674
|
| classNameImage | string | Yes | (2) below | a group of alternate classes that can be specified for the logo image, and applied to the **`img`** element |
|
|
1675
1675
|
| classNameImageContainer | string | Yes | (2) below | a group of alternate classes that can be specified for the logo image's container, and applied to the **`img`** element |
|
|
1676
|
+
| customButton | boolean | Yes | false | When present (or true) this sets the SideBarNav to respond to the custom event handler **`toggleSideBarNav`**. This allows the developer to utilize their own button that simply executes the above custom event handler to toggle the SideBarNav open & closed state. |
|
|
1676
1677
|
| menu | boolean | Yes | false | when **`true`**, the default in-component hamburger menu is displayed and used to display or hide the SideBarNav |
|
|
1677
1678
|
| classNameMenu | string | Yes | empty string | alternate css classes to apply to the element that makes up the hamburger menu |
|
|
1678
1679
|
| classNameMenuContainer | string | Yes | (3) below | alternate css classes to apply to the **`button`** element that wraps up the hamburger menu |
|
|
@@ -1739,6 +1740,27 @@ const menuItems = [
|
|
|
1739
1740
|
</SideBarNav>
|
|
1740
1741
|
```
|
|
1741
1742
|
|
|
1743
|
+
If using the **`customButton`** prop, you're JSX might be:
|
|
1744
|
+
|
|
1745
|
+
```jsx
|
|
1746
|
+
// in the return JSX
|
|
1747
|
+
<Button
|
|
1748
|
+
className="my-4 mx-4"
|
|
1749
|
+
onClick={() => window.dispatchEvent(new Event('toggleSideBarNav'))}
|
|
1750
|
+
|
|
1751
|
+
>Toggle SideBar</Button>
|
|
1752
|
+
<SideBarNav
|
|
1753
|
+
appName='A.C.M.E. Tools'
|
|
1754
|
+
version="0.0.0"
|
|
1755
|
+
menuItems={menuItems}
|
|
1756
|
+
classNameMenuItem='pe-4'
|
|
1757
|
+
clickOutsideCloses
|
|
1758
|
+
customButton
|
|
1759
|
+
image={doctor}
|
|
1760
|
+
className='bg-slate-200 border border-slate-400 rounded-l-md h-full'
|
|
1761
|
+
/>
|
|
1762
|
+
```
|
|
1763
|
+
|
|
1742
1764
|
### Dependencies
|
|
1743
1765
|
|
|
1744
1766
|
**_none_**
|