@wpmoo/ui 1.0.0-rc.5 → 1.0.0-rc.6
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/ASSET_LICENSE.md +1 -1
- package/README.md +5 -6
- package/certification.json +1 -1
- package/dist/assets/css/moo-ui.css +63 -6
- package/dist/assets/css/moo-ui.min.css +1 -1
- package/dist/assets/css/moo.css +58 -6
- package/dist/assets/css/moo.min.css +1 -1
- package/dist/js/chart.js +1 -1
- package/dist/js/chart.min.js +1 -1
- package/dist/js/combobox.js +1 -1
- package/dist/js/context-menu.js +1 -1
- package/dist/js/datatable.js +1 -1
- package/dist/js/datepicker.js +1 -1
- package/dist/js/datepicker.min.js +1 -1
- package/dist/js/moo-ui.js +36 -11
- package/dist/js/moo-ui.min.js +2 -2
- package/dist/js/sidebar.js +40 -12
- package/dist/js/slider.js +1 -1
- package/package.json +1 -1
- package/scss/components/_datatable.scss +27 -3
- package/scss/components/_dropdown.scss +43 -3
- package/scss/components/_table.scss +6 -0
- package/scss/components/sidebar/_collapsed.scss +12 -0
- package/scss/settings/_component_variables.scss +7 -0
package/dist/js/sidebar.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Moo UI sidebar.js v1.0.0-rc.
|
|
2
|
+
* Moo UI sidebar.js v1.0.0-rc.6 (https://ui.wpmoo.org/)
|
|
3
3
|
* Copyright 2026 WPMoo (https://wpmoo.org)
|
|
4
4
|
* Licensed under MIT (https://github.com/wpmoo-org/ui/blob/main/LICENSE)
|
|
5
5
|
*/
|
|
@@ -230,7 +230,9 @@ export default class Sidebar {
|
|
|
230
230
|
}
|
|
231
231
|
delete item.dataset.sidebarDropdownPositioned;
|
|
232
232
|
item.style.removeProperty("--moo-sidebar-dropdown-block-start");
|
|
233
|
+
item.style.removeProperty("--moo-sidebar-dropdown-block-end");
|
|
233
234
|
item.style.removeProperty("--moo-sidebar-dropdown-inline-start");
|
|
235
|
+
item.style.removeProperty("--moo-sidebar-dropdown-inline-end");
|
|
234
236
|
}
|
|
235
237
|
|
|
236
238
|
_closeDropdowns(exceptControl = null) {
|
|
@@ -259,7 +261,10 @@ export default class Sidebar {
|
|
|
259
261
|
const isHeaderWorkspace =
|
|
260
262
|
control?.classList.contains("sidebar-menu-button--workspace") &&
|
|
261
263
|
control.closest('[data-slot="sidebar-header"]');
|
|
262
|
-
|
|
264
|
+
const isFooterAccount =
|
|
265
|
+
control?.classList.contains("sidebar-menu-button--account") &&
|
|
266
|
+
control.closest('[data-slot="sidebar-footer"]');
|
|
267
|
+
if (!control || !item || !(isHeaderWorkspace || isFooterAccount) || !this._isDesktop()) {
|
|
263
268
|
this._clearDropdownPosition(control);
|
|
264
269
|
return;
|
|
265
270
|
}
|
|
@@ -267,18 +272,41 @@ export default class Sidebar {
|
|
|
267
272
|
this._closeFlyouts();
|
|
268
273
|
const rect = control.getBoundingClientRect();
|
|
269
274
|
const gap = 4;
|
|
270
|
-
const
|
|
271
|
-
|
|
275
|
+
const sidebar = control.closest('[data-slot="sidebar"]');
|
|
276
|
+
const side = sidebar?.dataset.side || "left";
|
|
277
|
+
const isRtl = this._root.dir === "rtl";
|
|
278
|
+
if (side === "right") {
|
|
279
|
+
const inlineEnd = isRtl
|
|
280
|
+
? rect.right + gap
|
|
281
|
+
: this._window.innerWidth - rect.left + gap;
|
|
282
|
+
item.style.setProperty(
|
|
283
|
+
"--moo-sidebar-dropdown-inline-end",
|
|
284
|
+
`${Math.round(inlineEnd)}px`
|
|
285
|
+
);
|
|
286
|
+
item.style.removeProperty("--moo-sidebar-dropdown-inline-start");
|
|
287
|
+
} else {
|
|
288
|
+
const inlineStart = isRtl
|
|
272
289
|
? this._window.innerWidth - rect.left + gap
|
|
273
290
|
: rect.right + gap;
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
291
|
+
item.style.setProperty(
|
|
292
|
+
"--moo-sidebar-dropdown-inline-start",
|
|
293
|
+
`${Math.round(inlineStart)}px`
|
|
294
|
+
);
|
|
295
|
+
item.style.removeProperty("--moo-sidebar-dropdown-inline-end");
|
|
296
|
+
}
|
|
297
|
+
if (isHeaderWorkspace) {
|
|
298
|
+
item.style.setProperty(
|
|
299
|
+
"--moo-sidebar-dropdown-block-start",
|
|
300
|
+
`${Math.round(rect.bottom + gap)}px`
|
|
301
|
+
);
|
|
302
|
+
item.style.removeProperty("--moo-sidebar-dropdown-block-end");
|
|
303
|
+
} else {
|
|
304
|
+
item.style.setProperty(
|
|
305
|
+
"--moo-sidebar-dropdown-block-end",
|
|
306
|
+
`${Math.round(this._window.innerHeight - rect.top + gap)}px`
|
|
307
|
+
);
|
|
308
|
+
item.style.removeProperty("--moo-sidebar-dropdown-block-start");
|
|
309
|
+
}
|
|
282
310
|
item.dataset.sidebarDropdownPositioned = "";
|
|
283
311
|
}
|
|
284
312
|
|
package/dist/js/slider.js
CHANGED
package/package.json
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
// visible content changed.
|
|
13
13
|
.datatable {
|
|
14
14
|
--moo-datatable-min-width: #{$moo-datatable-min-width};
|
|
15
|
+
--moo-datatable-actions-cell-bg: #{$moo-datatable-actions-cell-bg};
|
|
15
16
|
--moo-datatable-actions-cell-fade-width: #{$moo-datatable-actions-cell-fade-width};
|
|
16
17
|
--moo-datatable-card-label-width: #{$moo-datatable-card-label-width};
|
|
17
18
|
--moo-datatable-frame-header-min-height: #{$moo-datatable-frame-header-min-height};
|
|
@@ -24,6 +25,10 @@
|
|
|
24
25
|
--moo-datatable-bulk-actions-bottom: #{$moo-datatable-bulk-actions-bottom};
|
|
25
26
|
}
|
|
26
27
|
|
|
28
|
+
.card .datatable {
|
|
29
|
+
--moo-datatable-actions-cell-bg: var(--bs-card-bg);
|
|
30
|
+
}
|
|
31
|
+
|
|
27
32
|
.datatable-table {
|
|
28
33
|
table-layout: fixed;
|
|
29
34
|
}
|
|
@@ -75,7 +80,7 @@
|
|
|
75
80
|
background: linear-gradient(
|
|
76
81
|
90deg,
|
|
77
82
|
transparent 0,
|
|
78
|
-
var(--
|
|
83
|
+
var(--moo-datatable-actions-cell-bg) var(--moo-datatable-actions-cell-fade-width)
|
|
79
84
|
);
|
|
80
85
|
}
|
|
81
86
|
|
|
@@ -84,7 +89,7 @@
|
|
|
84
89
|
background: linear-gradient(
|
|
85
90
|
270deg,
|
|
86
91
|
transparent 0,
|
|
87
|
-
var(--
|
|
92
|
+
var(--moo-datatable-actions-cell-bg) var(--moo-datatable-actions-cell-fade-width)
|
|
88
93
|
);
|
|
89
94
|
}
|
|
90
95
|
|
|
@@ -172,6 +177,15 @@
|
|
|
172
177
|
width: 100%;
|
|
173
178
|
}
|
|
174
179
|
|
|
180
|
+
// A filter menu is a direct child so Bootstrap can anchor it to the trigger.
|
|
181
|
+
// Clip the joined control while the menu is closed, matching the normal
|
|
182
|
+
// input-group surface; release that clipping only while the menu is open so
|
|
183
|
+
// the positioned dropdown can escape the control without leaking focus or
|
|
184
|
+
// child paint past its rounded border.
|
|
185
|
+
.datatable-searchbar:not(:has(> .dropdown-menu.show)) {
|
|
186
|
+
overflow: hidden;
|
|
187
|
+
}
|
|
188
|
+
|
|
175
189
|
.datatable-searchbar .datatable-search {
|
|
176
190
|
flex: 1 1 auto;
|
|
177
191
|
max-width: none;
|
|
@@ -184,7 +198,9 @@
|
|
|
184
198
|
position: absolute;
|
|
185
199
|
inset-block-start: 50%;
|
|
186
200
|
inset-inline-start: 0.625rem;
|
|
187
|
-
z-index:
|
|
201
|
+
// Bootstrap raises a focused form control to z-index: 5. Keep the
|
|
202
|
+
// decorative icon above that opaque surface so focus does not hide it.
|
|
203
|
+
z-index: 6;
|
|
188
204
|
display: inline-flex;
|
|
189
205
|
align-items: center;
|
|
190
206
|
justify-content: center;
|
|
@@ -735,6 +751,14 @@
|
|
|
735
751
|
background-color: var(--moo-muted-surface);
|
|
736
752
|
}
|
|
737
753
|
|
|
754
|
+
// Sticky action cells paint a gradient instead of using the row's
|
|
755
|
+
// background-color, so selected rows need the same surface at the opaque end
|
|
756
|
+
// of that fade.
|
|
757
|
+
.datatable-row-selected > [data-datatable-column="actions"] {
|
|
758
|
+
--moo-datatable-actions-cell-bg: var(--moo-muted-surface);
|
|
759
|
+
background: var(--moo-muted-surface);
|
|
760
|
+
}
|
|
761
|
+
|
|
738
762
|
.datatable-card.datatable-row-selected {
|
|
739
763
|
border-color: var(--moo-border);
|
|
740
764
|
background-color: var(--moo-muted-surface);
|
|
@@ -188,15 +188,55 @@
|
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
+
// The lg Offcanvas breakpoint still renders the sidebar as a drawer on
|
|
192
|
+
// tablets. Keep identity menus inside that drawer until the desktop fixed
|
|
193
|
+
// overlay contract becomes active.
|
|
194
|
+
@include media-breakpoint-between(sm, lg) {
|
|
195
|
+
[data-slot="sidebar-header"] .dropend > .dropdown-menu,
|
|
196
|
+
[data-slot="sidebar-footer"] .dropend > .dropdown-menu {
|
|
197
|
+
left: 0 !important;
|
|
198
|
+
right: 0 !important;
|
|
199
|
+
min-width: 100%;
|
|
200
|
+
margin: 0;
|
|
201
|
+
transform: none !important;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
[data-slot="sidebar-header"] .dropend > .dropdown-menu {
|
|
205
|
+
top: calc(100% + #{$spacer * 0.25}) !important;
|
|
206
|
+
bottom: auto !important;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
[data-slot="sidebar-footer"] .dropend > .dropdown-menu {
|
|
210
|
+
top: auto !important;
|
|
211
|
+
bottom: calc(100% + #{$spacer * 0.25}) !important;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
191
215
|
@include media-breakpoint-up(lg) {
|
|
192
|
-
[data-slot="sidebar-header"] [data-sidebar-dropdown-positioned] > .dropdown-menu
|
|
216
|
+
[data-slot="sidebar-header"] [data-sidebar-dropdown-positioned] > .dropdown-menu,
|
|
217
|
+
[data-slot="sidebar-footer"] [data-sidebar-dropdown-positioned] > .dropdown-menu {
|
|
193
218
|
position: fixed !important;
|
|
194
219
|
z-index: $zindex-dropdown;
|
|
195
|
-
inset-
|
|
196
|
-
inset-inline-
|
|
220
|
+
inset-inline-start: var(--moo-sidebar-dropdown-inline-start, auto) !important;
|
|
221
|
+
inset-inline-end: auto !important;
|
|
197
222
|
width: var(--moo-dropdown-sidebar-min-width);
|
|
198
223
|
min-width: var(--moo-dropdown-sidebar-min-width);
|
|
199
224
|
margin: 0;
|
|
200
225
|
transform: none !important;
|
|
201
226
|
}
|
|
227
|
+
|
|
228
|
+
[data-slot="sidebar-header"] [data-sidebar-dropdown-positioned] > .dropdown-menu {
|
|
229
|
+
inset-block-start: var(--moo-sidebar-dropdown-block-start) !important;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
[data-slot="sidebar-footer"] [data-sidebar-dropdown-positioned] > .dropdown-menu {
|
|
233
|
+
inset-block-start: auto !important;
|
|
234
|
+
inset-block-end: var(--moo-sidebar-dropdown-block-end) !important;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
[data-slot="sidebar"][data-side="right"] [data-slot="sidebar-header"] [data-sidebar-dropdown-positioned] > .dropdown-menu,
|
|
238
|
+
[data-slot="sidebar"][data-side="right"] [data-slot="sidebar-footer"] [data-sidebar-dropdown-positioned] > .dropdown-menu {
|
|
239
|
+
inset-inline-start: auto !important;
|
|
240
|
+
inset-inline-end: var(--moo-sidebar-dropdown-inline-end, auto) !important;
|
|
241
|
+
}
|
|
202
242
|
}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
.card .table {
|
|
2
|
+
// Keep the table surface transparent so a table composed inside a card
|
|
3
|
+
// inherits the card's light/dark surface.
|
|
4
|
+
--bs-table-bg: #{$moo-table-contained-bg};
|
|
5
|
+
}
|
|
6
|
+
|
|
1
7
|
.table-responsive:not(.scroll-fade-x):has(.table-row-actions > [aria-expanded="true"]) {
|
|
2
8
|
overflow: visible;
|
|
3
9
|
}
|
|
@@ -37,6 +37,18 @@
|
|
|
37
37
|
position: relative;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
.sidebar-wrapper:has([data-sidebar-dropdown-positioned] > .dropdown-menu.show) > .sidebar {
|
|
41
|
+
position: relative;
|
|
42
|
+
z-index: $zindex-dropdown;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// The sticky inner surface is its own stacking context. Elevate that
|
|
46
|
+
// context while an identity menu is open so the rail's hover indicator
|
|
47
|
+
// remains behind the fixed dropdown instead of painting across it.
|
|
48
|
+
.sidebar-wrapper:has([data-sidebar-dropdown-positioned] > .dropdown-menu.show) > .sidebar > .sidebar-inner {
|
|
49
|
+
z-index: $zindex-dropdown;
|
|
50
|
+
}
|
|
51
|
+
|
|
40
52
|
.sidebar-wrapper[data-sidebar-state="collapsed"] .sidebar[data-collapsible="icon"] {
|
|
41
53
|
flex-basis: var(--moo-sidebar-width-icon);
|
|
42
54
|
width: var(--moo-sidebar-width-icon);
|
|
@@ -400,6 +400,10 @@ $moo-datatable-bulk-actions-backdrop-blur: 8px !default;
|
|
|
400
400
|
// chrome. Keep the default component position unchanged while giving host
|
|
401
401
|
// surfaces a scoped override hook.
|
|
402
402
|
$moo-datatable-bulk-actions-bottom: 1rem !default;
|
|
403
|
+
// Bootstrap's table surface is opaque by default and has no context-aware
|
|
404
|
+
// Card composition knob, so card-contained tables consume this scoped Sass
|
|
405
|
+
// setting instead of hardcoding their transparent surface in the partial.
|
|
406
|
+
$moo-table-contained-bg: transparent !default;
|
|
403
407
|
// Bootstrap has no Data Table layout/card primitive, so these scoped knobs
|
|
404
408
|
// describe the generated table/card frames without becoming global widths.
|
|
405
409
|
$moo-datatable-min-width: 48rem !default;
|
|
@@ -409,6 +413,9 @@ $moo-datatable-card-label-width: 7rem !default;
|
|
|
409
413
|
// Sticky row-action cells need just enough opaque surface for the trigger;
|
|
410
414
|
// this fade prevents the pinned cell from reading as a dominant blank column.
|
|
411
415
|
$moo-datatable-actions-cell-fade-width: 1.25rem !default;
|
|
416
|
+
// Bootstrap has no Data Table action-cell surface token; keep this scoped
|
|
417
|
+
// knob aligned with the native body surface and override it for Card context.
|
|
418
|
+
$moo-datatable-actions-cell-bg: var(--bs-body-bg) !default;
|
|
412
419
|
// Bootstrap has no Data Table frame-header or layout-toggle row primitive, so
|
|
413
420
|
// these scoped knobs align Moo's table/card header controls to Bootstrap inputs.
|
|
414
421
|
$moo-datatable-frame-header-min-height: 2.78125rem !default;
|