compostrap 1.0.0 → 1.0.1
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/dist/css/compostrap.css +10 -5
- package/dist/css/lightbox.css +6 -2
- package/dist/css/sidebar-menu.css +4 -3
- package/dist/css/theme.css +36 -8
- package/docs/blog.md +85 -85
- package/docs/layout.md +143 -143
- package/package.json +1 -1
- package/readme.md +198 -198
- package/src/js/datepicker.js +154 -154
- package/src/scss/datagrid.scss +5 -5
- package/src/scss/datepicker/_index.scss +557 -557
- package/src/scss/lightbox/_index.scss +9 -2
- package/src/scss/sidebar/_index.scss +8 -8
- package/src/scss/sidebar-menu/_compact.scss +2 -1
- package/src/scss/theme/_overlays.scss +14 -0
- package/src/scss/theme/_variables.scss +194 -189
package/docs/layout.md
CHANGED
|
@@ -1,143 +1,143 @@
|
|
|
1
|
-
# Layout
|
|
2
|
-
|
|
3
|
-
[← Compostrap](../readme.md#documentation)
|
|
4
|
-
|
|
5
|
-
## Page
|
|
6
|
-
|
|
7
|
-
The sidebar runs over the whole height with the brand on top, the navbar sits over the content only, in the color of the page and stuck to the top:
|
|
8
|
-
|
|
9
|
-
```html
|
|
10
|
-
<div class="d-flex wrapper">
|
|
11
|
-
<nav class="sidebar" id="navigation">
|
|
12
|
-
<div class="sidebar-menu"><div class="sidebar-menu-fixed">
|
|
13
|
-
<a class="sidebar-brand" href="/"><svg>…</svg><span>Compostrap</span></a>
|
|
14
|
-
<div class="scrollbar scrollbar-use-navbar">…menu…</div>
|
|
15
|
-
</div></div>
|
|
16
|
-
</nav>
|
|
17
|
-
<div class="layout-content">
|
|
18
|
-
<header class="navbar navbar-expand-md navbar-content navbar-bar sticky-top">…breadcrumb, icons, user…</header>
|
|
19
|
-
<div class="container-fluid"><main>…</main></div>
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
The layout comes in three combinations of the navbar and the brand of the sidebar, each with the navbar stuck to the top (`sticky-top`) or scrolling away with the page:
|
|
26
|
-
|
|
27
|
-
| Combination | Navbar | Brand |
|
|
28
|
-
|-------------|--------|-------|
|
|
29
|
-
| On the page: the navbar and the brand on the background of the page, the white menu below the brand as a panel with a rounded corner, in line with the first box | `navbar-content` | `sidebar-brand sidebar-brand-page` |
|
|
30
|
-
| The navbar on the page, a white sidebar | `navbar-content` | `sidebar-brand` |
|
|
31
|
-
| A white navbar and a white sidebar; a soft shadow under the navbar when the content scrolls under it | `navbar-content navbar-bar` | `sidebar-brand` |
|
|
32
|
-
|
|
33
|
-
The white navbar can take a color, together with the brand of the sidebar, so one colored strip runs over the top: `navbar-colored` and `sidebar-brand-colored` with a `theme-*` class (`theme-primary`, `theme-success`, `theme-danger`, `theme-info`, or `theme-gray`, a gray between the light secondary and dark). Its text and icons turn light, a status dot gets a light ring, and the nanobar takes the color of the navbar, lightened; the dropdowns in it keep the colors of the page.
|
|
34
|
-
|
|
35
|
-
```html
|
|
36
|
-
<a class="sidebar-brand sidebar-brand-colored theme-primary" href="/">…</a>
|
|
37
|
-
<header class="navbar navbar-expand-md navbar-content navbar-bar navbar-colored theme-primary sticky-top">…</header>
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
The demo has a *Customize* panel to try them.
|
|
41
|
-
|
|
42
|
-
Below `md`, where the sidebar is hidden, `navbar-brand-mobile` shows the brand in the navbar (as its first item; only the logo on phones under 360px); the open sidebar covers it with its own brand at the same place.
|
|
43
|
-
|
|
44
|
-
The layout with a navbar over the whole width (`wrapper-navbar-used wrapper-navbar-fixed`, `navbar fixed-top`) works too.
|
|
45
|
-
|
|
46
|
-
## Sidebar
|
|
47
|
-
|
|
48
|
-
The sidebar is the element `#navigation`, its toggle button is `#sidebar`. On small screens it opens as an overlay over the page and takes the focus; closed, it stands outside the window and is `inert`, so the keyboard and a screen reader skip its links. The backdrop, a click on it, Escape and the focus that leaves it (Tab after its last link) close it, and the toggle reports its state in `aria-expanded`. From the `md` breakpoint up it stays in the layout.
|
|
49
|
-
|
|
50
|
-
| Description | Class |
|
|
51
|
-
|----------------------------------------------------|-----------------------------|
|
|
52
|
-
| Layout without a navbar | `wrapper` |
|
|
53
|
-
| Layout with a navbar | `wrapper-navbar-used` |
|
|
54
|
-
| Layout with a fixed navbar | `wrapper-navbar-fixed` |
|
|
55
|
-
| Rounded top right corner of the sidebar | `sidebar-rounded-top-right` |
|
|
56
|
-
| Fixed menu in the sidebar | `sidebar-menu-fixed` |
|
|
57
|
-
| Toggle visible on small screens (used by `Sidebar`) | `sidebar-toggle` |
|
|
58
|
-
| Toggle visible on all screens | `sidebar-toggle-visible` |
|
|
59
|
-
|
|
60
|
-
## Sidebar menu
|
|
61
|
-
|
|
62
|
-
`SidebarMenuApp.init()` can be called again after menu items are added. It sets `aria-expanded` and `aria-controls` on submenu links, `aria-current="page"` on the current link, and opens a submenu at once; only its arrow rotates. Set `SidebarMenu.slideDuration = 200` (ms) before `init()` to slide submenus open instead; the slide is skipped when reduced motion is requested.
|
|
63
|
-
|
|
64
|
-
| Description | Class |
|
|
65
|
-
|-------------------------|----------------|
|
|
66
|
-
| Current item | `link-current` |
|
|
67
|
-
| Link with a submenu (without `href`, it becomes a button) | `link-arrow` |
|
|
68
|
-
| Hidden submenu | `list-hidden` |
|
|
69
|
-
| Shaking icon on hover | `bell` |
|
|
70
|
-
|
|
71
|
-
The colors of the menu come from the body color of Bootstrap (titles at 60 %, icons at 60 %, arrows at 85 %), so both themes work without settings; they can be changed by the `--sm-*` CSS variables, the sizes by the Sass variables in `src/scss/_variables.scss`. The pills of the links have `--sm-pill-border-radius`, `--sm-pill-icon-color`, `--sm-pill-link-bg` (the current page) and `--sm-pill-hover-bg` (a hovered link, a bit weaker).
|
|
72
|
-
|
|
73
|
-
### Compact sidebar
|
|
74
|
-
|
|
75
|
-
From the `md` breakpoint up the sidebar can be narrowed to the icons of the first level (`$sm-compact-width`, 72px); a phone keeps its sliding menu. A button with `data-sidebar-compact` switches the class `sidebar-compact` of `<html>`, keeps its `aria-pressed` in line and remembers the choice in `localStorage` (`sidebar-compact`); it is handled by `Sidebar.init()`. In the compact sidebar:
|
|
76
|
-
|
|
77
|
-
- the brand shows only its logo, a section title becomes a short line, badges and submenus are hidden (a group holding the current page gets its pill);
|
|
78
|
-
- the name of a hovered or focused link is shown next to it in the colors of the tooltip;
|
|
79
|
-
- a link with a submenu opens its links in a menu of the theme next to the icon (the group name over them, the current page marked); it is closed by another click on the icon, a click outside, Esc or a scroll, and works by the keyboard like a dropdown (Enter or Space moves the focus into it, the arrows between the links, Tab leaves it to the next icon).
|
|
80
|
-
|
|
81
|
-
```html
|
|
82
|
-
<html class="…">
|
|
83
|
-
<head>
|
|
84
|
-
<!-- the remembered compact sidebar before the page is drawn, so the menu does not jump -->
|
|
85
|
-
<script>try { if (localStorage.getItem('sidebar-compact') === '1') document.documentElement.classList.add('sidebar-compact'); } catch (e) { }</script>
|
|
86
|
-
</head>
|
|
87
|
-
…
|
|
88
|
-
<button type="button" class="navbar-icon" data-sidebar-compact aria-pressed="false" aria-label="Compact menu" data-tooltip="bottom">
|
|
89
|
-
<i class="bi bi-layout-sidebar" aria-hidden="true"></i>
|
|
90
|
-
</button>
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
`Sidebar.setCompact(true|false)` sets it from a script, `Sidebar.isCompact()` tells whether the compact sidebar is shown.
|
|
94
|
-
|
|
95
|
-
## Navbar
|
|
96
|
-
|
|
97
|
-
Icon buttons on the right of the navbar (module `dashboard`): `navbar-icon` is a quiet square for an icon, an icon with a short text (`navbar-icon-text`, e.g. the code of the language) widens it; tinted on hover and while its dropdown is open. A `status-dot` (module `elements`) marks that something waits; `status-dot-pulse` makes it pulse.
|
|
98
|
-
|
|
99
|
-
```html
|
|
100
|
-
<button type="button" class="navbar-icon" aria-label="Toggle theme" data-tooltip="bottom" data-theme-switcher
|
|
101
|
-
data-theme-light-icon="bi bi-sun" data-theme-dark-icon="bi bi-moon"><i data-theme-switcher-icon class="bi bi-moon"></i></button>
|
|
102
|
-
|
|
103
|
-
<div class="dropdown">
|
|
104
|
-
<button type="button" class="navbar-icon" data-bs-toggle="dropdown" aria-label="Notifications">
|
|
105
|
-
<i class="bi bi-bell"></i><span class="status-dot status-dot-pulse theme-danger"></span>
|
|
106
|
-
<span class="navbar-icon-text d-none d-lg-inline">Notifications</span>
|
|
107
|
-
</button>
|
|
108
|
-
<ul class="dropdown-menu dropdown-menu-end">…</ul>
|
|
109
|
-
</div>
|
|
110
|
-
|
|
111
|
-
<div class="dropdown">
|
|
112
|
-
<button type="button" class="navbar-icon" data-bs-toggle="dropdown"><i class="bi bi-translate" aria-hidden="true"></i><span class="visually-hidden">Language: </span><span class="navbar-icon-text">EN</span></button>
|
|
113
|
-
<ul class="dropdown-menu dropdown-menu-end">
|
|
114
|
-
<li><a class="dropdown-item" href="...">Čeština</a></li>
|
|
115
|
-
<li><a class="dropdown-item active" href="..." aria-current="true">English</a></li>
|
|
116
|
-
</ul>
|
|
117
|
-
</div>
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
The user sits in the navbar as `navbar-user`: an `avatar` (initials or a photo in a circle, in a `theme-*` color; `avatar-sm`, `avatar-lg`) with the name and the role, the account in its dropdown.
|
|
121
|
-
|
|
122
|
-
## Content boxes and the older navbar
|
|
123
|
-
|
|
124
|
-
The navbar `navbar fixed-top` gets the page background, `navbar-nav-breadcrumb` separates its items by an arrow, and `content-box` is a box of the page content on the surface color.
|
|
125
|
-
|
|
126
|
-
## Datagrid tables
|
|
127
|
-
|
|
128
|
-
A table of a datagrid stands in a `table-responsive`, so it scrolls inside its box on a narrow screen. The wrapper is `<div class="table-responsive" tabindex="0" role="region" aria-label="Articles">` (the name of the table): with `tabindex` the keyboard can scroll it in every browser, the role and the name tell a screen reader what the focused box is. The actions of a row are a menu: three vertical dots open a dropdown with the items, delete last after a divider. The button needs `data-bs-popper-config='{"strategy":"fixed"}'`, or the scrolling wrapper cuts the menu off.
|
|
129
|
-
|
|
130
|
-
```html
|
|
131
|
-
<td class="text-end">
|
|
132
|
-
<div class="dropdown">
|
|
133
|
-
<button type="button" class="btn btn-xs btn-icon btn-text" data-bs-toggle="dropdown" data-bs-popper-config='{"strategy":"fixed"}' aria-expanded="false" aria-label="Actions"><i class="bi bi-three-dots-vertical" aria-hidden="true"></i></button>
|
|
134
|
-
<ul class="dropdown-menu dropdown-menu-end">
|
|
135
|
-
<li><a class="dropdown-item" href="..."><i class="bi bi-pencil me-2" aria-hidden="true"></i>Edit</a></li>
|
|
136
|
-
<li><hr class="dropdown-divider"></li>
|
|
137
|
-
<li><a class="dropdown-item text-danger" href="..."><i class="bi bi-trash me-2" aria-hidden="true"></i>Delete</a></li>
|
|
138
|
-
</ul>
|
|
139
|
-
</div>
|
|
140
|
-
</td>
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
A datagrid can also open an item by a click on its row (`datagrid-row-clickable` on the `tr` and `row-click.js` of drago-ex/datagrid; compostrap has no script for it). Use it only with icon buttons as the row actions (`btn btn-xs btn-icon` with a `data-tooltip`), never with the menu of three dots: a click that misses the small button of the menu lands on the row and opens the item instead of the menu.
|
|
1
|
+
# Layout
|
|
2
|
+
|
|
3
|
+
[← Compostrap](../readme.md#documentation)
|
|
4
|
+
|
|
5
|
+
## Page
|
|
6
|
+
|
|
7
|
+
The sidebar runs over the whole height with the brand on top, the navbar sits over the content only, in the color of the page and stuck to the top:
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<div class="d-flex wrapper">
|
|
11
|
+
<nav class="sidebar" id="navigation">
|
|
12
|
+
<div class="sidebar-menu"><div class="sidebar-menu-fixed">
|
|
13
|
+
<a class="sidebar-brand" href="/"><svg>…</svg><span>Compostrap</span></a>
|
|
14
|
+
<div class="scrollbar scrollbar-use-navbar">…menu…</div>
|
|
15
|
+
</div></div>
|
|
16
|
+
</nav>
|
|
17
|
+
<div class="layout-content">
|
|
18
|
+
<header class="navbar navbar-expand-md navbar-content navbar-bar sticky-top">…breadcrumb, icons, user…</header>
|
|
19
|
+
<div class="container-fluid"><main>…</main></div>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
The layout comes in three combinations of the navbar and the brand of the sidebar, each with the navbar stuck to the top (`sticky-top`) or scrolling away with the page:
|
|
26
|
+
|
|
27
|
+
| Combination | Navbar | Brand |
|
|
28
|
+
|-------------|--------|-------|
|
|
29
|
+
| On the page: the navbar and the brand on the background of the page, the white menu below the brand as a panel with a rounded corner, in line with the first box | `navbar-content` | `sidebar-brand sidebar-brand-page` |
|
|
30
|
+
| The navbar on the page, a white sidebar | `navbar-content` | `sidebar-brand` |
|
|
31
|
+
| A white navbar and a white sidebar; a soft shadow under the navbar when the content scrolls under it | `navbar-content navbar-bar` | `sidebar-brand` |
|
|
32
|
+
|
|
33
|
+
The white navbar can take a color, together with the brand of the sidebar, so one colored strip runs over the top: `navbar-colored` and `sidebar-brand-colored` with a `theme-*` class (`theme-primary`, `theme-success`, `theme-danger`, `theme-info`, or `theme-gray`, a gray between the light secondary and dark). Its text and icons turn light, a status dot gets a light ring, and the nanobar takes the color of the navbar, lightened; the dropdowns in it keep the colors of the page.
|
|
34
|
+
|
|
35
|
+
```html
|
|
36
|
+
<a class="sidebar-brand sidebar-brand-colored theme-primary" href="/">…</a>
|
|
37
|
+
<header class="navbar navbar-expand-md navbar-content navbar-bar navbar-colored theme-primary sticky-top">…</header>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The demo has a *Customize* panel to try them.
|
|
41
|
+
|
|
42
|
+
Below `md`, where the sidebar is hidden, `navbar-brand-mobile` shows the brand in the navbar (as its first item; only the logo on phones under 360px); the open sidebar covers it with its own brand at the same place.
|
|
43
|
+
|
|
44
|
+
The layout with a navbar over the whole width (`wrapper-navbar-used wrapper-navbar-fixed`, `navbar fixed-top`) works too.
|
|
45
|
+
|
|
46
|
+
## Sidebar
|
|
47
|
+
|
|
48
|
+
The sidebar is the element `#navigation`, its toggle button is `#sidebar`. On small screens it opens as an overlay over the page and takes the focus; closed, it stands outside the window and is `inert`, so the keyboard and a screen reader skip its links. The backdrop, a click on it, Escape and the focus that leaves it (Tab after its last link) close it, and the toggle reports its state in `aria-expanded`. From the `md` breakpoint up it stays in the layout.
|
|
49
|
+
|
|
50
|
+
| Description | Class |
|
|
51
|
+
|----------------------------------------------------|-----------------------------|
|
|
52
|
+
| Layout without a navbar | `wrapper` |
|
|
53
|
+
| Layout with a navbar | `wrapper-navbar-used` |
|
|
54
|
+
| Layout with a fixed navbar | `wrapper-navbar-fixed` |
|
|
55
|
+
| Rounded top right corner of the sidebar | `sidebar-rounded-top-right` |
|
|
56
|
+
| Fixed menu in the sidebar | `sidebar-menu-fixed` |
|
|
57
|
+
| Toggle visible on small screens (used by `Sidebar`) | `sidebar-toggle` |
|
|
58
|
+
| Toggle visible on all screens | `sidebar-toggle-visible` |
|
|
59
|
+
|
|
60
|
+
## Sidebar menu
|
|
61
|
+
|
|
62
|
+
`SidebarMenuApp.init()` can be called again after menu items are added. It sets `aria-expanded` and `aria-controls` on submenu links, `aria-current="page"` on the current link, and opens a submenu at once; only its arrow rotates. Set `SidebarMenu.slideDuration = 200` (ms) before `init()` to slide submenus open instead; the slide is skipped when reduced motion is requested.
|
|
63
|
+
|
|
64
|
+
| Description | Class |
|
|
65
|
+
|-------------------------|----------------|
|
|
66
|
+
| Current item | `link-current` |
|
|
67
|
+
| Link with a submenu (without `href`, it becomes a button) | `link-arrow` |
|
|
68
|
+
| Hidden submenu | `list-hidden` |
|
|
69
|
+
| Shaking icon on hover | `bell` |
|
|
70
|
+
|
|
71
|
+
The colors of the menu come from the body color of Bootstrap (titles at 60 %, icons at 60 %, arrows at 85 %), so both themes work without settings; they can be changed by the `--sm-*` CSS variables, the sizes by the Sass variables in `src/scss/_variables.scss`. The pills of the links have `--sm-pill-border-radius`, `--sm-pill-icon-color`, `--sm-pill-link-bg` (the current page) and `--sm-pill-hover-bg` (a hovered link, a bit weaker).
|
|
72
|
+
|
|
73
|
+
### Compact sidebar
|
|
74
|
+
|
|
75
|
+
From the `md` breakpoint up the sidebar can be narrowed to the icons of the first level (`$sm-compact-width`, 72px); a phone keeps its sliding menu. A button with `data-sidebar-compact` switches the class `sidebar-compact` of `<html>`, keeps its `aria-pressed` in line and remembers the choice in `localStorage` (`sidebar-compact`); it is handled by `Sidebar.init()`. In the compact sidebar:
|
|
76
|
+
|
|
77
|
+
- the brand shows only its logo, a section title becomes a short line, badges and submenus are hidden (a group holding the current page gets its pill);
|
|
78
|
+
- the name of a hovered or focused link is shown next to it in the colors of the tooltip;
|
|
79
|
+
- a link with a submenu opens its links in a menu of the theme next to the icon (the group name over them, the current page marked); it is closed by another click on the icon, a click outside, Esc or a scroll, and works by the keyboard like a dropdown (Enter or Space moves the focus into it, the arrows between the links, Tab leaves it to the next icon).
|
|
80
|
+
|
|
81
|
+
```html
|
|
82
|
+
<html class="…">
|
|
83
|
+
<head>
|
|
84
|
+
<!-- the remembered compact sidebar before the page is drawn, so the menu does not jump -->
|
|
85
|
+
<script>try { if (localStorage.getItem('sidebar-compact') === '1') document.documentElement.classList.add('sidebar-compact'); } catch (e) { }</script>
|
|
86
|
+
</head>
|
|
87
|
+
…
|
|
88
|
+
<button type="button" class="navbar-icon" data-sidebar-compact aria-pressed="false" aria-label="Compact menu" data-tooltip="bottom">
|
|
89
|
+
<i class="bi bi-layout-sidebar" aria-hidden="true"></i>
|
|
90
|
+
</button>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
`Sidebar.setCompact(true|false)` sets it from a script, `Sidebar.isCompact()` tells whether the compact sidebar is shown.
|
|
94
|
+
|
|
95
|
+
## Navbar
|
|
96
|
+
|
|
97
|
+
Icon buttons on the right of the navbar (module `dashboard`): `navbar-icon` is a quiet square for an icon, an icon with a short text (`navbar-icon-text`, e.g. the code of the language) widens it; tinted on hover and while its dropdown is open. A `status-dot` (module `elements`) marks that something waits; `status-dot-pulse` makes it pulse.
|
|
98
|
+
|
|
99
|
+
```html
|
|
100
|
+
<button type="button" class="navbar-icon" aria-label="Toggle theme" data-tooltip="bottom" data-theme-switcher
|
|
101
|
+
data-theme-light-icon="bi bi-sun" data-theme-dark-icon="bi bi-moon"><i data-theme-switcher-icon class="bi bi-moon"></i></button>
|
|
102
|
+
|
|
103
|
+
<div class="dropdown">
|
|
104
|
+
<button type="button" class="navbar-icon" data-bs-toggle="dropdown" aria-label="Notifications">
|
|
105
|
+
<i class="bi bi-bell"></i><span class="status-dot status-dot-pulse theme-danger"></span>
|
|
106
|
+
<span class="navbar-icon-text d-none d-lg-inline">Notifications</span>
|
|
107
|
+
</button>
|
|
108
|
+
<ul class="dropdown-menu dropdown-menu-end">…</ul>
|
|
109
|
+
</div>
|
|
110
|
+
|
|
111
|
+
<div class="dropdown">
|
|
112
|
+
<button type="button" class="navbar-icon" data-bs-toggle="dropdown"><i class="bi bi-translate" aria-hidden="true"></i><span class="visually-hidden">Language: </span><span class="navbar-icon-text">EN</span></button>
|
|
113
|
+
<ul class="dropdown-menu dropdown-menu-end">
|
|
114
|
+
<li><a class="dropdown-item" href="...">Čeština</a></li>
|
|
115
|
+
<li><a class="dropdown-item active" href="..." aria-current="true">English</a></li>
|
|
116
|
+
</ul>
|
|
117
|
+
</div>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
The user sits in the navbar as `navbar-user`: an `avatar` (initials or a photo in a circle, in a `theme-*` color; `avatar-sm`, `avatar-lg`) with the name and the role, the account in its dropdown.
|
|
121
|
+
|
|
122
|
+
## Content boxes and the older navbar
|
|
123
|
+
|
|
124
|
+
The navbar `navbar fixed-top` gets the page background, `navbar-nav-breadcrumb` separates its items by an arrow, and `content-box` is a box of the page content on the surface color.
|
|
125
|
+
|
|
126
|
+
## Datagrid tables
|
|
127
|
+
|
|
128
|
+
A table of a datagrid stands in a `table-responsive`, so it scrolls inside its box on a narrow screen. The wrapper is `<div class="table-responsive" tabindex="0" role="region" aria-label="Articles">` (the name of the table): with `tabindex` the keyboard can scroll it in every browser, the role and the name tell a screen reader what the focused box is. The actions of a row are a menu: three vertical dots open a dropdown with the items, delete last after a divider. The button needs `data-bs-popper-config='{"strategy":"fixed"}'`, or the scrolling wrapper cuts the menu off.
|
|
129
|
+
|
|
130
|
+
```html
|
|
131
|
+
<td class="text-end">
|
|
132
|
+
<div class="dropdown">
|
|
133
|
+
<button type="button" class="btn btn-xs btn-icon btn-text" data-bs-toggle="dropdown" data-bs-popper-config='{"strategy":"fixed"}' aria-expanded="false" aria-label="Actions"><i class="bi bi-three-dots-vertical" aria-hidden="true"></i></button>
|
|
134
|
+
<ul class="dropdown-menu dropdown-menu-end">
|
|
135
|
+
<li><a class="dropdown-item" href="..."><i class="bi bi-pencil me-2" aria-hidden="true"></i>Edit</a></li>
|
|
136
|
+
<li><hr class="dropdown-divider"></li>
|
|
137
|
+
<li><a class="dropdown-item text-danger" href="..."><i class="bi bi-trash me-2" aria-hidden="true"></i>Delete</a></li>
|
|
138
|
+
</ul>
|
|
139
|
+
</div>
|
|
140
|
+
</td>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
A datagrid can also open an item by a click on its row (`datagrid-row-clickable` on the `tr` and `row-click.js` of drago-ex/datagrid; compostrap has no script for it). Use it only with icon buttons as the row actions (`btn btn-xs btn-icon` with a `data-tooltip`), never with the menu of three dots: a click that misses the small button of the menu lands on the row and opens the item instead of the menu.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "compostrap",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Bootstrap 5 for administrations and websites: a theme with the look and classes of Bootstrap 6, a layout with a sidebar, a multi-level menu and a navbar, and components Bootstrap does not have (datepicker, charts, gallery, lightbox, dropzone, sign-in pages, shop, blog).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|