@nanahoshi/mona-ui 0.50.0 → 0.51.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/docs/api/grid.json +1 -1
- package/docs/api/grid.md +1 -1
- package/docs/api/index.json +1 -1
- package/docs/api/theme.json +1 -1
- package/docs/api/theme.md +6 -3
- package/docs/grid-columns.md +3 -1
- package/docs/grid.md +1 -1
- package/docs/manifest.json +1 -1
- package/docs/theming-custom-themes.md +32 -10
- package/docs/theming.md +13 -13
- package/fesm2022/{grid-colgroup.component-BFbiAvkG.mjs → grid-colgroup.component-Ccz4jNGD.mjs} +2 -2
- package/fesm2022/{grid-footer-row.component-DpSu7jvG.mjs → grid-footer-row.component-3i2wvQ6a.mjs} +2 -2
- package/fesm2022/{grid-list.component-B-F4bvFL.mjs → grid-list.component-BaI4IOC6.mjs} +5 -5
- package/fesm2022/{grid-row.component-CuCQ_Z5F.mjs → grid-row.component-CK8q0Ecr.mjs} +3 -3
- package/fesm2022/{grid-virtual-list.component-rIz5AUOU.mjs → grid-virtual-list.component-BPLi0OaO.mjs} +5 -5
- package/fesm2022/{grid.styles-D6jP3vwD.mjs → grid.styles-DBLUtq2X.mjs} +18 -10
- package/fesm2022/nanahoshi-mona-ui-command.mjs +3 -4
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +3 -4
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +2 -3
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +42 -39
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +10 -1
- package/fesm2022/nanahoshi-mona-ui-sheet.mjs +2 -3
- package/fesm2022/nanahoshi-mona-ui-spinner.mjs +2 -1
- package/fesm2022/nanahoshi-mona-ui-theme.mjs +12 -0
- package/fesm2022/nanahoshi-mona-ui-window.mjs +3 -4
- package/package.json +1 -1
- package/types/nanahoshi-mona-ui-grid.d.ts +12 -4
- package/types/nanahoshi-mona-ui-internal.d.ts +10 -0
- package/types/nanahoshi-mona-ui-theme.d.ts +21 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as getGridCellText, A as gridHeaderThemeVariants, C as gridHeaderGroupTableRowThemeVariants, D as gridHeaderTableColumnWrapThemeVariants, E as gridHeaderTableColumnTitleThemeVariants, F as gridNoDataThemeVariants, G as observeGridCellTabStops, H as GridLogicalCellDirective, J as getColumnGroupDepth, K as GridLockedCellDirective, O as gridHeaderTableRowThemeVariants, R as gridSelectAllCellThemeVariants, S as gridHeaderGroupSpacerCellThemeVariants, T as gridHeaderTableCellThemeVariants, W as isKeyboardEntryElement, X as getColumnStepTarget, Y as getColumnGroups, Z as getSiblingRuns, _ as gridFooterThemeVariants, at as GridEditEvent, c as gridColumnActionsThemeVariants, ct as RowEditEvent, d as gridColumnResizerThemeVariants, et as RowReorderEvent, f as gridFilterRowCellThemeVariants, g as gridFooterTableThemeVariants, it as GridRemoveEvent, k as gridHeaderTableThemeVariants, l as gridColumnDragPreviewThemeVariants, lt as CellEditEvent, nt as GRID_DEFAULT_MESSAGES, ot as GridCancelEvent, p as gridFilterRowHeaderCellThemeVariants, q as GridService, rt as GridSaveEvent, st as GridAddEvent, t as gridBaseThemeVariants, tt as GridNavigationService, u as gridColumnDropHintThemeVariants, v as gridGroupPanelPlaceholderThemeVariants, w as gridHeaderGroupTitleThemeVariants, x as gridHeaderGroupCellThemeVariants, y as gridGroupPanelThemeVariants } from "./grid.styles-
|
|
2
|
-
import { n as removeGridRow, t as GridColgroupComponent } from "./grid-colgroup.component-
|
|
1
|
+
import { $ as getGridCellText, A as gridHeaderThemeVariants, C as gridHeaderGroupTableRowThemeVariants, D as gridHeaderTableColumnWrapThemeVariants, E as gridHeaderTableColumnTitleThemeVariants, F as gridNoDataThemeVariants, G as observeGridCellTabStops, H as GridLogicalCellDirective, J as getColumnGroupDepth, K as GridLockedCellDirective, O as gridHeaderTableRowThemeVariants, R as gridSelectAllCellThemeVariants, S as gridHeaderGroupSpacerCellThemeVariants, T as gridHeaderTableCellThemeVariants, W as isKeyboardEntryElement, X as getColumnStepTarget, Y as getColumnGroups, Z as getSiblingRuns, _ as gridFooterThemeVariants, at as GridEditEvent, c as gridColumnActionsThemeVariants, ct as RowEditEvent, d as gridColumnResizerThemeVariants, et as RowReorderEvent, f as gridFilterRowCellThemeVariants, g as gridFooterTableThemeVariants, it as GridRemoveEvent, k as gridHeaderTableThemeVariants, l as gridColumnDragPreviewThemeVariants, lt as CellEditEvent, nt as GRID_DEFAULT_MESSAGES, ot as GridCancelEvent, p as gridFilterRowHeaderCellThemeVariants, q as GridService, rt as GridSaveEvent, st as GridAddEvent, t as gridBaseThemeVariants, tt as GridNavigationService, u as gridColumnDropHintThemeVariants, v as gridGroupPanelPlaceholderThemeVariants, w as gridHeaderGroupTitleThemeVariants, x as gridHeaderGroupCellThemeVariants, y as gridGroupPanelThemeVariants } from "./grid.styles-DBLUtq2X.mjs";
|
|
2
|
+
import { n as removeGridRow, t as GridColgroupComponent } from "./grid-colgroup.component-Ccz4jNGD.mjs";
|
|
3
3
|
import { DOCUMENT, NgTemplateOutlet, isPlatformBrowser } from "@angular/common";
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
import { Component, DOCUMENT as DOCUMENT$1, DestroyRef, Directive, ElementRef, Injectable, InjectionToken, Injector, LOCALE_ID, PLATFORM_ID, Pipe, TemplateRef, afterEveryRender, afterNextRender, booleanAttribute, computed, contentChild, contentChildren, effect, forwardRef, inject, input, isDevMode, linkedSignal, model, output, signal, untracked, viewChild, viewChildren } from "@angular/core";
|
|
@@ -5965,31 +5965,29 @@ const TOOLBAR_ITEM_SELECTOR = ":is(button, input, select, textarea, a[href], [ta
|
|
|
5965
5965
|
var GridComponent = class GridComponent {
|
|
5966
5966
|
#destroyRef;
|
|
5967
5967
|
#document;
|
|
5968
|
-
#fitViewInitialScrollbarGutterWidth;
|
|
5969
|
-
#fitViewScrollbarSyncResolved;
|
|
5970
5968
|
#gridNavigationService;
|
|
5971
5969
|
#hostElementRef;
|
|
5972
5970
|
#injector;
|
|
5973
5971
|
#liveAnnouncer;
|
|
5974
|
-
#manuallyResized;
|
|
5975
5972
|
#registeredFooterScrollElement;
|
|
5976
5973
|
#dragCancelled;
|
|
5977
5974
|
#dragKeySubscription;
|
|
5975
|
+
#fitViewHeaderWidth;
|
|
5976
|
+
#fitViewRefitScheduled;
|
|
5978
5977
|
#toolbarActiveItem;
|
|
5979
5978
|
#toolbarActiveItemIndex;
|
|
5980
5979
|
constructor() {
|
|
5981
5980
|
this.#destroyRef = inject(DestroyRef);
|
|
5982
5981
|
this.#document = inject(DOCUMENT$1);
|
|
5983
|
-
this.#fitViewInitialScrollbarGutterWidth = signal(null, ...ngDevMode ? [{ debugName: "#fitViewInitialScrollbarGutterWidth" }] : /* istanbul ignore next */ []);
|
|
5984
|
-
this.#fitViewScrollbarSyncResolved = signal(false, ...ngDevMode ? [{ debugName: "#fitViewScrollbarSyncResolved" }] : /* istanbul ignore next */ []);
|
|
5985
5982
|
this.#gridNavigationService = inject(GridNavigationService);
|
|
5986
5983
|
this.#hostElementRef = inject(ElementRef);
|
|
5987
5984
|
this.#injector = inject(Injector);
|
|
5988
5985
|
this.#liveAnnouncer = injectLiveAnnouncer();
|
|
5989
|
-
this.#manuallyResized = signal(false, ...ngDevMode ? [{ debugName: "#manuallyResized" }] : /* istanbul ignore next */ []);
|
|
5990
5986
|
this.#registeredFooterScrollElement = signal(null, ...ngDevMode ? [{ debugName: "#registeredFooterScrollElement" }] : /* istanbul ignore next */ []);
|
|
5991
5987
|
this.#dragCancelled = false;
|
|
5992
5988
|
this.#dragKeySubscription = null;
|
|
5989
|
+
this.#fitViewHeaderWidth = null;
|
|
5990
|
+
this.#fitViewRefitScheduled = false;
|
|
5993
5991
|
this.#toolbarActiveItem = null;
|
|
5994
5992
|
this.#toolbarActiveItemIndex = 0;
|
|
5995
5993
|
this.columnDefinitions = contentChildren(GRID_COLUMN_DEFINITION, {
|
|
@@ -6176,7 +6174,6 @@ var GridComponent = class GridComponent {
|
|
|
6176
6174
|
this.setDataEffect();
|
|
6177
6175
|
this.setEditSessionEffect();
|
|
6178
6176
|
this.setFooterScrollElementEffect();
|
|
6179
|
-
this.setFitViewScrollbarSyncEffect();
|
|
6180
6177
|
afterEveryRender({ write: () => this.syncToolbarFocusTargets() });
|
|
6181
6178
|
this.#gridNavigationService.setViewport({
|
|
6182
6179
|
scrollElement: () => this.gridService.bodyScrollElement(),
|
|
@@ -6186,7 +6183,7 @@ var GridComponent = class GridComponent {
|
|
|
6186
6183
|
this.gridService.gridHeaderElement.set(this.gridHeaderElement().nativeElement);
|
|
6187
6184
|
this.gridService.headerTableElement.set(this.gridHeaderTableElement().nativeElement);
|
|
6188
6185
|
this.setInitialCalculatedWidthOfColumns();
|
|
6189
|
-
this.#
|
|
6186
|
+
this.#observeHeaderWidth();
|
|
6190
6187
|
this.gridWidthSet.set(true);
|
|
6191
6188
|
const stopObservingTabStops = observeGridCellTabStops(this.#hostElementRef.nativeElement);
|
|
6192
6189
|
this.#destroyRef.onDestroy(stopObservingTabStops);
|
|
@@ -6289,10 +6286,11 @@ var GridComponent = class GridComponent {
|
|
|
6289
6286
|
}
|
|
6290
6287
|
onColumnResizeEnd(event) {
|
|
6291
6288
|
this.resizing.set(false);
|
|
6289
|
+
if (event.newWidth !== event.oldWidth) this.gridService.markColumnSizedByUser(event.column.id);
|
|
6290
|
+
this.#scheduleFitViewRefit();
|
|
6292
6291
|
this.gridService.columnResize$.next(event);
|
|
6293
6292
|
}
|
|
6294
6293
|
onColumnResizeStart() {
|
|
6295
|
-
this.#manuallyResized.set(true);
|
|
6296
6294
|
this.resizing.set(true);
|
|
6297
6295
|
}
|
|
6298
6296
|
onColumnSort(column) {
|
|
@@ -6403,6 +6401,12 @@ var GridComponent = class GridComponent {
|
|
|
6403
6401
|
this.#liveAnnouncer.announce(this.messages().columnMoved(column.title, position));
|
|
6404
6402
|
this.#refocusHeader(column.id);
|
|
6405
6403
|
}
|
|
6404
|
+
#observeHeaderWidth() {
|
|
6405
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
6406
|
+
const resizeObserver = new ResizeObserver(() => this.#scheduleFitViewRefit());
|
|
6407
|
+
resizeObserver.observe(this.gridHeaderElement().nativeElement);
|
|
6408
|
+
this.#destroyRef.onDestroy(() => resizeObserver.disconnect());
|
|
6409
|
+
}
|
|
6406
6410
|
#refocusHeader(columnId) {
|
|
6407
6411
|
afterNextRender({ write: () => {
|
|
6408
6412
|
if (!this.#gridNavigationService.focusHeaderCell(columnId)) this.#gridNavigationService.focusActiveCellOrFirstHeader();
|
|
@@ -6432,6 +6436,19 @@ var GridComponent = class GridComponent {
|
|
|
6432
6436
|
column: visible[0]
|
|
6433
6437
|
};
|
|
6434
6438
|
}
|
|
6439
|
+
#scheduleFitViewRefit() {
|
|
6440
|
+
if (this.#fitViewRefitScheduled || this.resizeMethod() !== "fitView") return;
|
|
6441
|
+
this.#fitViewRefitScheduled = true;
|
|
6442
|
+
afterNextRender({
|
|
6443
|
+
earlyRead: () => this.gridHeaderElement().nativeElement.clientWidth,
|
|
6444
|
+
write: (headerWidth) => {
|
|
6445
|
+
this.#fitViewRefitScheduled = false;
|
|
6446
|
+
if (headerWidth === 0 || headerWidth === this.#fitViewHeaderWidth || this.gridService.columnResizeActive()) return;
|
|
6447
|
+
this.#fitViewHeaderWidth = headerWidth;
|
|
6448
|
+
this.gridService.setCalculatedWidths(this.createFitViewWidthMap(headerWidth));
|
|
6449
|
+
}
|
|
6450
|
+
}, { injector: this.#injector });
|
|
6451
|
+
}
|
|
6435
6452
|
clearDragState() {
|
|
6436
6453
|
this.dragColumn.set(null);
|
|
6437
6454
|
this.dropColumn.set(null);
|
|
@@ -6442,10 +6459,13 @@ var GridComponent = class GridComponent {
|
|
|
6442
6459
|
this.#dragKeySubscription = null;
|
|
6443
6460
|
}
|
|
6444
6461
|
createFitViewWidthMap(headerWidth) {
|
|
6445
|
-
const flexibleColumns =
|
|
6462
|
+
const flexibleColumns = [];
|
|
6463
|
+
let availableWidth = headerWidth - this.gridService.leadingStructuralWidth();
|
|
6464
|
+
for (const column of this.gridService.visibleColumns()) if (column.width == null && !this.gridService.isColumnSizedByUser(column.id)) flexibleColumns.push(column);
|
|
6465
|
+
else availableWidth -= this.gridService.getColumnWidth(column);
|
|
6446
6466
|
if (flexibleColumns.length === 0) return /* @__PURE__ */ new Map();
|
|
6447
6467
|
const devicePixelRatio = this.gridHeaderElement().nativeElement.ownerDocument.defaultView?.devicePixelRatio ?? 1;
|
|
6448
|
-
const totalWidthUnits = Math.max(0, Math.round(
|
|
6468
|
+
const totalWidthUnits = Math.max(0, Math.round(availableWidth * devicePixelRatio));
|
|
6449
6469
|
const widthByColumnId = /* @__PURE__ */ new Map();
|
|
6450
6470
|
const baseWidthUnits = Math.floor(totalWidthUnits / flexibleColumns.length);
|
|
6451
6471
|
let remainingWidthUnits = totalWidthUnits - baseWidthUnits * flexibleColumns.length;
|
|
@@ -6518,18 +6538,6 @@ var GridComponent = class GridComponent {
|
|
|
6518
6538
|
untracked(() => this.gridService.reconcileEditSession());
|
|
6519
6539
|
});
|
|
6520
6540
|
}
|
|
6521
|
-
setFitViewScrollbarSyncEffect() {
|
|
6522
|
-
effect(() => {
|
|
6523
|
-
if (this.resizeMethod() !== "fitView" || !this.gridWidthSet()) return;
|
|
6524
|
-
if (this.#fitViewScrollbarSyncResolved() || this.#manuallyResized()) return;
|
|
6525
|
-
if (!this.gridService.hasLiveScrollbarGutterWidth()) return;
|
|
6526
|
-
const initialScrollbarGutterWidth = this.#fitViewInitialScrollbarGutterWidth();
|
|
6527
|
-
if (initialScrollbarGutterWidth == null) return;
|
|
6528
|
-
const liveScrollbarGutterWidth = this.gridService.scrollbarGutterWidth();
|
|
6529
|
-
this.#fitViewScrollbarSyncResolved.set(true);
|
|
6530
|
-
if (liveScrollbarGutterWidth !== initialScrollbarGutterWidth) untracked(() => this.setInitialCalculatedWidthOfColumns());
|
|
6531
|
-
});
|
|
6532
|
-
}
|
|
6533
6541
|
setFooterScrollElementEffect() {
|
|
6534
6542
|
effect(() => {
|
|
6535
6543
|
const virtual = this.gridService.virtualScrollOptions().enabled;
|
|
@@ -6562,19 +6570,14 @@ var GridComponent = class GridComponent {
|
|
|
6562
6570
|
if (this.gridService.gridHeaderElement()) {
|
|
6563
6571
|
const headerElement = this.gridService.gridHeaderElement();
|
|
6564
6572
|
const headerCells = this.getTableColumnHeaderCellList();
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
if (columnsWithWidth.any()) headerWidth -= columnsWithWidth.sum((c) => c.width ?? 0);
|
|
6568
|
-
if (this.gridService.rowReorderColumnVisible()) headerWidth -= this.gridService.rowReorderColumnWidth;
|
|
6569
|
-
if (this.gridService.masterDetailTemplate()) headerWidth -= this.gridService.detailColumnWidth;
|
|
6570
|
-
if (this.gridService.selectionColumnVisible()) headerWidth -= this.gridService.selectionColumnWidth;
|
|
6571
|
-
headerWidth -= this.gridService.groupColumnWidth * this.gridService.groupColumns().length;
|
|
6573
|
+
const headerWidth = headerElement.clientWidth;
|
|
6574
|
+
this.#fitViewHeaderWidth = headerWidth;
|
|
6572
6575
|
const fitViewWidthByColumn = this.resizeMethod() === "fitView" ? this.createFitViewWidthMap(headerWidth) : /* @__PURE__ */ new Map();
|
|
6573
6576
|
const visibleColumns = this.gridService.visibleColumns().toArray();
|
|
6574
6577
|
const widthByColumnId = /* @__PURE__ */ new Map();
|
|
6575
6578
|
for (const [cx, gridCol] of visibleColumns.entries()) {
|
|
6576
6579
|
const columnTh = headerCells[cx];
|
|
6577
|
-
if (columnTh == null) continue;
|
|
6580
|
+
if (columnTh == null || this.gridService.isColumnSizedByUser(gridCol.id)) continue;
|
|
6578
6581
|
const explicitWidth = gridCol.width;
|
|
6579
6582
|
if (explicitWidth != null) {
|
|
6580
6583
|
widthByColumnId.set(gridCol.id, this.gridService.normalizeRenderedWidth(explicitWidth));
|
|
@@ -7199,9 +7202,9 @@ var GridComponent = class GridComponent {
|
|
|
7199
7202
|
deferBlockDependencies: [() => [
|
|
7200
7203
|
NgTemplateOutlet,
|
|
7201
7204
|
GridColgroupComponent,
|
|
7202
|
-
import("./grid-footer-row.component-
|
|
7203
|
-
import("./grid-list.component-
|
|
7204
|
-
import("./grid-virtual-list.component-
|
|
7205
|
+
import("./grid-footer-row.component-3i2wvQ6a.mjs").then((m) => m.GridFooterRowComponent),
|
|
7206
|
+
import("./grid-list.component-BaI4IOC6.mjs").then((m) => m.GridListComponent),
|
|
7207
|
+
import("./grid-virtual-list.component-BPLi0OaO.mjs").then((m) => m.GridVirtualListComponent),
|
|
7205
7208
|
import("@nanahoshi/mona-ui/spinner").then((m) => m.SpinnerComponent)
|
|
7206
7209
|
]]
|
|
7207
7210
|
});
|
|
@@ -7213,9 +7216,9 @@ i0.ɵɵngDeclareClassMetadataAsync({
|
|
|
7213
7216
|
ngImport: i0,
|
|
7214
7217
|
type: GridComponent,
|
|
7215
7218
|
resolveDeferredDeps: () => [
|
|
7216
|
-
import("./grid-footer-row.component-
|
|
7217
|
-
import("./grid-list.component-
|
|
7218
|
-
import("./grid-virtual-list.component-
|
|
7219
|
+
import("./grid-footer-row.component-3i2wvQ6a.mjs").then((m) => m.GridFooterRowComponent),
|
|
7220
|
+
import("./grid-list.component-BaI4IOC6.mjs").then((m) => m.GridListComponent),
|
|
7221
|
+
import("./grid-virtual-list.component-BPLi0OaO.mjs").then((m) => m.GridVirtualListComponent),
|
|
7219
7222
|
import("@nanahoshi/mona-ui/spinner").then((m) => m.SpinnerComponent)
|
|
7220
7223
|
],
|
|
7221
7224
|
resolveMetadata: (GridFooterRowComponent, GridListComponent, GridVirtualListComponent, SpinnerComponent) => ({
|
|
@@ -658,6 +658,15 @@ const themeOverlaySurfaceClasses = `
|
|
|
658
658
|
[background-color:var(--mona-effect-overlay-background-color,var(--color-surface-overlay))]
|
|
659
659
|
${themeOverlayBackdropClasses}
|
|
660
660
|
`;
|
|
661
|
+
const themeBackdropFilterClasses = `
|
|
662
|
+
[backdrop-filter:var(--mona-effect-backdrop-backdrop-filter,blur(4px))]
|
|
663
|
+
[-webkit-backdrop-filter:var(--mona-effect-backdrop-backdrop-filter,blur(4px))]
|
|
664
|
+
`;
|
|
665
|
+
const themeBackdropClassList = [
|
|
666
|
+
"[background-color:var(--mona-effect-backdrop-background-color,color-mix(in_oklab,var(--color-background)_50%,transparent))]",
|
|
667
|
+
"[background-image:var(--mona-effect-backdrop-background-image,none)]",
|
|
668
|
+
...themeBackdropFilterClasses.trim().split(/\s+/)
|
|
669
|
+
];
|
|
661
670
|
const HOVER_GRACE = 100;
|
|
662
671
|
var HoverIntent = class {
|
|
663
672
|
#config;
|
|
@@ -960,6 +969,6 @@ const setupTypeahead = (typeaheadKey$) => {
|
|
|
960
969
|
})));
|
|
961
970
|
return merge(keypress$, resetTrigger$).pipe(scan((buffer, action) => action.type === "reset" ? "" : buffer + action.value.toLowerCase(), ""), filter((buffer) => buffer.length > 0));
|
|
962
971
|
};
|
|
963
|
-
export { AttributeBinderDirective, FIELD_ASSOCIATION_BOUNDARY, HOVER_GRACE, HoverIntent, MONA_FIELDSET_DISABLED, MONA_FORM_FIELD, MONA_LABEL, NavigationKeys, RovingToolbar, TYPEAHEAD_RESET_DELAY, addAriaReference, colorKey, createElementControlId, createPageScrollBlockStrategy, focusCanReturn, focusElement, formatAlpha, hex2rgba, hsla2hsva, hsva2rgba, inertOutside, injectEffectiveDisabled, injectLabelAssociation, injectLabelledByText, isNavigationKey, isTypeaheadKey, isValidHex, listenForHover, matchesAccept, navigationKeysList, onDisconnect, overlaySidePositions, parseAccept, parseColor, positionGlobalOverlay, removeAriaReference, resolveOverlaySide, restoreOverlayScroll, rgba2hex, rgba2hsla, rgba2hsva, runUpload, rxFromResize, rxTimeout, setupTypeahead, sideOfPosition, themeControlBackdropClasses, themeControlSurfaceClasses, themeOverlayBackdropClasses, themeOverlaySurfaceClasses, themeRaisedBackdropClasses, themeRaisedSurfaceClasses, themeSelectionBarClasses, themeSelectionBorderClasses, toCssValue, toHeadingLevel };
|
|
972
|
+
export { AttributeBinderDirective, FIELD_ASSOCIATION_BOUNDARY, HOVER_GRACE, HoverIntent, MONA_FIELDSET_DISABLED, MONA_FORM_FIELD, MONA_LABEL, NavigationKeys, RovingToolbar, TYPEAHEAD_RESET_DELAY, addAriaReference, colorKey, createElementControlId, createPageScrollBlockStrategy, focusCanReturn, focusElement, formatAlpha, hex2rgba, hsla2hsva, hsva2rgba, inertOutside, injectEffectiveDisabled, injectLabelAssociation, injectLabelledByText, isNavigationKey, isTypeaheadKey, isValidHex, listenForHover, matchesAccept, navigationKeysList, onDisconnect, overlaySidePositions, parseAccept, parseColor, positionGlobalOverlay, removeAriaReference, resolveOverlaySide, restoreOverlayScroll, rgba2hex, rgba2hsla, rgba2hsva, runUpload, rxFromResize, rxTimeout, setupTypeahead, sideOfPosition, themeBackdropClassList, themeBackdropFilterClasses, themeControlBackdropClasses, themeControlSurfaceClasses, themeOverlayBackdropClasses, themeOverlaySurfaceClasses, themeRaisedBackdropClasses, themeRaisedSurfaceClasses, themeSelectionBarClasses, themeSelectionBorderClasses, toCssValue, toHeadingLevel };
|
|
964
973
|
|
|
965
974
|
//# sourceMappingURL=nanahoshi-mona-ui-internal.mjs.map
|
|
@@ -7,7 +7,7 @@ import { MonaI18nService, injectComponentDirection, mergeMessages } from "@nanah
|
|
|
7
7
|
import { twMerge } from "tailwind-merge";
|
|
8
8
|
import { cva } from "class-variance-authority";
|
|
9
9
|
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
10
|
-
import { createElementControlId, inertOutside, themeOverlaySurfaceClasses } from "@nanahoshi/mona-ui/internal";
|
|
10
|
+
import { createElementControlId, inertOutside, themeBackdropClassList, themeOverlaySurfaceClasses } from "@nanahoshi/mona-ui/internal";
|
|
11
11
|
import { merge, take } from "rxjs";
|
|
12
12
|
import { PopupCloseEvent, PopupCloseSource, PopupService, slideFromBottomPopupAnimation, slideFromLeftPopupAnimation, slideFromRightPopupAnimation, slideFromTopPopupAnimation } from "@nanahoshi/mona-ui/popup";
|
|
13
13
|
import { CdkTrapFocus } from "@angular/cdk/a11y";
|
|
@@ -129,8 +129,7 @@ var SheetComponent = class SheetComponent {
|
|
|
129
129
|
backdropClass: [
|
|
130
130
|
"fixed",
|
|
131
131
|
"inset-0",
|
|
132
|
-
|
|
133
|
-
"backdrop-blur-xs",
|
|
132
|
+
...themeBackdropClassList,
|
|
134
133
|
"[transition-duration:240ms]!"
|
|
135
134
|
],
|
|
136
135
|
blockScroll: true,
|
|
@@ -6,6 +6,7 @@ import { MonaI18nService } from "@nanahoshi/mona-ui/i18n";
|
|
|
6
6
|
import { injectLiveAnnouncer } from "@nanahoshi/mona-ui/internal/live-announcer";
|
|
7
7
|
import { twMerge } from "tailwind-merge";
|
|
8
8
|
import { cva } from "class-variance-authority";
|
|
9
|
+
import { themeBackdropFilterClasses } from "@nanahoshi/mona-ui/internal";
|
|
9
10
|
import { Subject, defer, finalize, takeUntil } from "rxjs";
|
|
10
11
|
import { v4 } from "uuid";
|
|
11
12
|
const SPINNER_DEFAULT_MESSAGES = {
|
|
@@ -191,7 +192,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
191
192
|
const spinnerOverlayThemeVariants = cva(`
|
|
192
193
|
isolate flex items-center justify-center
|
|
193
194
|
pointer-events-auto select-none
|
|
194
|
-
bg-background/60
|
|
195
|
+
bg-background/60 ${themeBackdropFilterClasses}
|
|
195
196
|
text-foreground
|
|
196
197
|
`, {
|
|
197
198
|
variants: { fullPage: {
|
|
@@ -228,8 +228,17 @@ function normalizeHue(hue) {
|
|
|
228
228
|
function clamp(value, minimum, maximum) {
|
|
229
229
|
return Math.min(Math.max(value, minimum), maximum);
|
|
230
230
|
}
|
|
231
|
+
function createDefaultBackdropEffects() {
|
|
232
|
+
return Object.freeze({
|
|
233
|
+
"--mona-effect-backdrop-background-color": "color-mix(in oklab, var(--color-background) 50%, transparent)",
|
|
234
|
+
"--mona-effect-backdrop-fallback-background-color": "color-mix(in oklab, var(--color-background) 50%, transparent)",
|
|
235
|
+
"--mona-effect-backdrop-background-image": "none",
|
|
236
|
+
"--mona-effect-backdrop-backdrop-filter": "blur(4px)"
|
|
237
|
+
});
|
|
238
|
+
}
|
|
231
239
|
function createDefaultThemeEffects() {
|
|
232
240
|
return Object.freeze({
|
|
241
|
+
...createDefaultBackdropEffects(),
|
|
233
242
|
"--mona-effect-control-background-color": "var(--color-input-background)",
|
|
234
243
|
"--mona-effect-control-fallback-background-color": "var(--color-input-background)",
|
|
235
244
|
"--mona-effect-control-background-image": "none",
|
|
@@ -686,6 +695,7 @@ const lunaTheme = Object.freeze({
|
|
|
686
695
|
"--mona-motion-standard": "320ms"
|
|
687
696
|
}),
|
|
688
697
|
effects: Object.freeze({
|
|
698
|
+
...createDefaultBackdropEffects(),
|
|
689
699
|
"--mona-effect-control-background-color": "rgb(243 244 245 / 0.78)",
|
|
690
700
|
"--mona-effect-control-fallback-background-color": "#f3f4f5",
|
|
691
701
|
"--mona-effect-control-background-image": "none",
|
|
@@ -733,6 +743,7 @@ const lunaTheme = Object.freeze({
|
|
|
733
743
|
"--mona-motion-standard": "320ms"
|
|
734
744
|
}),
|
|
735
745
|
effects: Object.freeze({
|
|
746
|
+
...createDefaultBackdropEffects(),
|
|
736
747
|
"--mona-effect-control-background-color": "rgb(37 37 39 / 0.74)",
|
|
737
748
|
"--mona-effect-control-fallback-background-color": "#252527",
|
|
738
749
|
"--mona-effect-control-background-image": "none",
|
|
@@ -1744,6 +1755,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1744
1755
|
});
|
|
1745
1756
|
const contrastBorders = [["--color-border-control", "--color-border-control-contrast"], ["--color-border-control-hover", "--color-border-control-contrast-hover"]];
|
|
1746
1757
|
const effectLevels = [
|
|
1758
|
+
"backdrop",
|
|
1747
1759
|
"control",
|
|
1748
1760
|
"raised",
|
|
1749
1761
|
"overlay"
|
|
@@ -6,7 +6,7 @@ import { ButtonDirective } from "@nanahoshi/mona-ui/button";
|
|
|
6
6
|
import { MonaI18nService, mergeMessages } from "@nanahoshi/mona-ui/i18n";
|
|
7
7
|
import { cva } from "class-variance-authority";
|
|
8
8
|
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
9
|
-
import { createElementControlId, focusElement, inertOutside, positionGlobalOverlay, themeOverlaySurfaceClasses } from "@nanahoshi/mona-ui/internal";
|
|
9
|
+
import { createElementControlId, focusElement, inertOutside, positionGlobalOverlay, themeBackdropClassList, themeOverlaySurfaceClasses } from "@nanahoshi/mona-ui/internal";
|
|
10
10
|
import { ReplaySubject, Subject, asapScheduler, fromEvent, map, merge, take, takeUntil } from "rxjs";
|
|
11
11
|
import { PopupCloseEvent, PopupCloseSource, PopupDataInjectionToken, PopupService } from "@nanahoshi/mona-ui/popup";
|
|
12
12
|
import * as i1 from "@angular/cdk/a11y";
|
|
@@ -1417,10 +1417,9 @@ var WindowService = class WindowService {
|
|
|
1417
1417
|
backdropClass: modal ? [
|
|
1418
1418
|
"fixed",
|
|
1419
1419
|
"inset-0",
|
|
1420
|
-
|
|
1420
|
+
...themeBackdropClassList,
|
|
1421
1421
|
"transition-opacity",
|
|
1422
|
-
"z-40"
|
|
1423
|
-
"backdrop-blur-xs"
|
|
1422
|
+
"z-40"
|
|
1424
1423
|
] : "transparent",
|
|
1425
1424
|
blockScroll: modal,
|
|
1426
1425
|
closeOnBackdropClick: false,
|
package/package.json
CHANGED
|
@@ -1806,7 +1806,6 @@ declare class GridService {
|
|
|
1806
1806
|
readonly groupableOptions: import("@angular/core").WritableSignal<GroupableOptions>;
|
|
1807
1807
|
readonly hasFooter: import("@angular/core").Signal<boolean>;
|
|
1808
1808
|
readonly hasLeftLockedColumns: import("@angular/core").Signal<boolean>;
|
|
1809
|
-
readonly hasLiveScrollbarGutterWidth: import("@angular/core").Signal<boolean>;
|
|
1810
1809
|
/** How many group rows sit above the column headers: the deepest `mona-grid-column-group` nesting shown. */
|
|
1811
1810
|
readonly headerGroupDepth: import("@angular/core").Signal<number>;
|
|
1812
1811
|
/** The rows of column group headers, outermost first; empty without groups. */
|
|
@@ -1964,6 +1963,8 @@ declare class GridService {
|
|
|
1964
1963
|
handleRowClick(event: GridSelectionModifiers, row: Row): void;
|
|
1965
1964
|
handleSingleSelection(event: GridSelectionModifiers, row: Row): void;
|
|
1966
1965
|
isCellInRange(rowUid: string, columnId: string): boolean;
|
|
1966
|
+
/** Whether the user gave the column its width, by resizing it or through restored state. */
|
|
1967
|
+
isColumnSizedByUser(columnId: string): boolean;
|
|
1967
1968
|
isGroupCollapsed(groupKey: string): boolean;
|
|
1968
1969
|
/** Whether a selection value came from the `selectedKeys` input rather than from the user. */
|
|
1969
1970
|
isLoadedSelection(keys: ImmutableSet<unknown>): boolean;
|
|
@@ -1991,6 +1992,8 @@ declare class GridService {
|
|
|
1991
1992
|
loadSorts(sorts: Iterable<SortDescriptor> | null | undefined): void;
|
|
1992
1993
|
/** Sets the expanded tree rows from the `expandedKeys` input, without reporting a change. */
|
|
1993
1994
|
loadTreeExpandedKeys(keys: Iterable<unknown> | null | undefined): void;
|
|
1995
|
+
/** Records that the user gave the column its width, which `fitView` then keeps as the grid's width changes. */
|
|
1996
|
+
markColumnSizedByUser(columnId: string): void;
|
|
1994
1997
|
moveGroupColumn(column: Column, moveAs: "prev" | "next"): void;
|
|
1995
1998
|
normalizeRenderedWidth(width: number): number;
|
|
1996
1999
|
/** Ends an update whose row left the data or the view; the cancel can't be prevented. */
|
|
@@ -2286,9 +2289,11 @@ export declare class GridComponent<T> implements GridVariantInput {
|
|
|
2286
2289
|
*/
|
|
2287
2290
|
readonly pageSizeValues: import("@angular/core").InputSignal<number[]>;
|
|
2288
2291
|
/**
|
|
2289
|
-
* @description The method to be used to
|
|
2292
|
+
* @description The method to be used to size the columns that have no `width`.
|
|
2290
2293
|
* It can be the following values:
|
|
2291
|
-
* - `fitView`: The columns
|
|
2294
|
+
* - `fitView`: The columns share the width the other columns leave, and follow the grid's width as it changes,
|
|
2295
|
+
* such as when the window is resized. A column the user resized, or whose width came from restored state,
|
|
2296
|
+
* keeps its width.
|
|
2292
2297
|
* - `auto`: The columns will be resized based on the content.
|
|
2293
2298
|
* - A number representing the width of the columns. All columns except the columns with a specified width
|
|
2294
2299
|
* will have the same width.
|
|
@@ -2375,6 +2380,10 @@ export declare class GridComponent<T> implements GridVariantInput {
|
|
|
2375
2380
|
protected openColumnFilterMenu(column: Column): void;
|
|
2376
2381
|
private clampCalculatedWidth;
|
|
2377
2382
|
private clearDragState;
|
|
2383
|
+
/**
|
|
2384
|
+
* fitView: shares the header's width, less the structural columns and the columns that keep their width, among
|
|
2385
|
+
* the columns that have no `width` and that the user didn't size.
|
|
2386
|
+
*/
|
|
2378
2387
|
private createFitViewWidthMap;
|
|
2379
2388
|
private getColumnLockBucket;
|
|
2380
2389
|
private getTableColumnHeaderCellList;
|
|
@@ -2385,7 +2394,6 @@ export declare class GridComponent<T> implements GridVariantInput {
|
|
|
2385
2394
|
private setDataEffect;
|
|
2386
2395
|
/** An edit whose row was replaced follows the new data; one whose row left the data or the view ends. */
|
|
2387
2396
|
private setEditSessionEffect;
|
|
2388
|
-
private setFitViewScrollbarSyncEffect;
|
|
2389
2397
|
private setFooterScrollElementEffect;
|
|
2390
2398
|
private setGridDetailEffect;
|
|
2391
2399
|
private setInitialCalculatedWidthOfColumns;
|
|
@@ -315,6 +315,16 @@ export declare const themeRaisedBackdropClasses = "\n [background-image:var(-
|
|
|
315
315
|
export declare const themeRaisedSurfaceClasses = "\n [background-color:var(--mona-effect-raised-background-color,var(--color-surface-raised))]\n \n [background-image:var(--mona-effect-raised-background-image,none)]\n [backdrop-filter:var(--mona-effect-raised-backdrop-filter,none)]\n [-webkit-backdrop-filter:var(--mona-effect-raised-backdrop-filter,none)]\n\n";
|
|
316
316
|
export declare const themeOverlayBackdropClasses = "\n [background-image:var(--mona-effect-overlay-background-image,none)]\n [backdrop-filter:var(--mona-effect-overlay-backdrop-filter,none)]\n [-webkit-backdrop-filter:var(--mona-effect-overlay-backdrop-filter,none)]\n";
|
|
317
317
|
export declare const themeOverlaySurfaceClasses = "\n [background-color:var(--mona-effect-overlay-background-color,var(--color-surface-overlay))]\n \n [background-image:var(--mona-effect-overlay-background-image,none)]\n [backdrop-filter:var(--mona-effect-overlay-backdrop-filter,none)]\n [-webkit-backdrop-filter:var(--mona-effect-overlay-backdrop-filter,none)]\n\n";
|
|
318
|
+
/**
|
|
319
|
+
* Blurs what's behind a modal's backdrop or a spinner's overlay, as much as the theme's backdrop asks. The fallback is
|
|
320
|
+
* Mona's, for a page without a theme provider.
|
|
321
|
+
*/
|
|
322
|
+
export declare const themeBackdropFilterClasses = "\n [backdrop-filter:var(--mona-effect-backdrop-backdrop-filter,blur(4px))]\n [-webkit-backdrop-filter:var(--mona-effect-backdrop-backdrop-filter,blur(4px))]\n";
|
|
323
|
+
/**
|
|
324
|
+
* The backdrop behind a modal dialog, window or sheet, which dims the page and blurs it if the theme does. As a list,
|
|
325
|
+
* for a popup's `backdropClass`, which takes one class per entry.
|
|
326
|
+
*/
|
|
327
|
+
export declare const themeBackdropClassList: readonly string[];
|
|
318
328
|
/**
|
|
319
329
|
* How long a popup opened by hovering waits after the pointer leaves its anchor, so the pointer can cross the gap
|
|
320
330
|
* onto the popup and stay there (WCAG 1.4.13, Content on Hover or Focus).
|
|
@@ -29,7 +29,11 @@ type ThemeVariable = `--${string}`;
|
|
|
29
29
|
type ThemeVariables = Readonly<Record<ThemeVariable, string>>;
|
|
30
30
|
type ThemeMotionVariable = "--mona-motion-fast" | "--mona-motion-standard";
|
|
31
31
|
type ThemeMotion = Readonly<Record<ThemeMotionVariable, string>>;
|
|
32
|
-
|
|
32
|
+
/**
|
|
33
|
+
* The materials a theme defines: `control` for fields, `raised` for elevated panels, `overlay` for menus, popups and
|
|
34
|
+
* dialogs, and `backdrop` for what dims the page behind a modal dialog, window or sheet.
|
|
35
|
+
*/
|
|
36
|
+
type ThemeEffectLevel = "backdrop" | "control" | "overlay" | "raised";
|
|
33
37
|
type ThemeEffectVariable = `--mona-effect-${ThemeEffectLevel}-background-color` | `--mona-effect-${ThemeEffectLevel}-fallback-background-color` | `--mona-effect-${ThemeEffectLevel}-background-image` | `--mona-effect-${ThemeEffectLevel}-backdrop-filter`;
|
|
34
38
|
type ThemeEffects = Readonly<Record<ThemeEffectVariable, string>>;
|
|
35
39
|
type ThemeShapeVariable = "--radius-sm" | "--radius-md" | "--radius-lg";
|
|
@@ -243,6 +247,10 @@ export declare const builtInThemes: Readonly<{
|
|
|
243
247
|
"--mona-effect-overlay-fallback-background-color": "#f9f9fa";
|
|
244
248
|
"--mona-effect-overlay-background-image": "none";
|
|
245
249
|
"--mona-effect-overlay-backdrop-filter": "blur(28px) saturate(115%)";
|
|
250
|
+
"--mona-effect-backdrop-background-color": string;
|
|
251
|
+
"--mona-effect-backdrop-fallback-background-color": string;
|
|
252
|
+
"--mona-effect-backdrop-background-image": string;
|
|
253
|
+
"--mona-effect-backdrop-backdrop-filter": string;
|
|
246
254
|
}>;
|
|
247
255
|
shape: Readonly<Record<ThemeShapeVariable, string>>;
|
|
248
256
|
custom: Readonly<{
|
|
@@ -290,6 +298,10 @@ export declare const builtInThemes: Readonly<{
|
|
|
290
298
|
"--mona-effect-overlay-fallback-background-color": "#262628";
|
|
291
299
|
"--mona-effect-overlay-background-image": "none";
|
|
292
300
|
"--mona-effect-overlay-backdrop-filter": "blur(28px) saturate(115%)";
|
|
301
|
+
"--mona-effect-backdrop-background-color": string;
|
|
302
|
+
"--mona-effect-backdrop-fallback-background-color": string;
|
|
303
|
+
"--mona-effect-backdrop-background-image": string;
|
|
304
|
+
"--mona-effect-backdrop-backdrop-filter": string;
|
|
293
305
|
}>;
|
|
294
306
|
shape: Readonly<Record<ThemeShapeVariable, string>>;
|
|
295
307
|
custom: Readonly<{
|
|
@@ -397,6 +409,10 @@ export declare const lunaTheme: Readonly<{
|
|
|
397
409
|
"--mona-effect-overlay-fallback-background-color": "#f9f9fa";
|
|
398
410
|
"--mona-effect-overlay-background-image": "none";
|
|
399
411
|
"--mona-effect-overlay-backdrop-filter": "blur(28px) saturate(115%)";
|
|
412
|
+
"--mona-effect-backdrop-background-color": string;
|
|
413
|
+
"--mona-effect-backdrop-fallback-background-color": string;
|
|
414
|
+
"--mona-effect-backdrop-background-image": string;
|
|
415
|
+
"--mona-effect-backdrop-backdrop-filter": string;
|
|
400
416
|
}>;
|
|
401
417
|
shape: Readonly<Record<ThemeShapeVariable, string>>;
|
|
402
418
|
custom: Readonly<{
|
|
@@ -444,6 +460,10 @@ export declare const lunaTheme: Readonly<{
|
|
|
444
460
|
"--mona-effect-overlay-fallback-background-color": "#262628";
|
|
445
461
|
"--mona-effect-overlay-background-image": "none";
|
|
446
462
|
"--mona-effect-overlay-backdrop-filter": "blur(28px) saturate(115%)";
|
|
463
|
+
"--mona-effect-backdrop-background-color": string;
|
|
464
|
+
"--mona-effect-backdrop-fallback-background-color": string;
|
|
465
|
+
"--mona-effect-backdrop-background-image": string;
|
|
466
|
+
"--mona-effect-backdrop-backdrop-filter": string;
|
|
447
467
|
}>;
|
|
448
468
|
shape: Readonly<Record<ThemeShapeVariable, string>>;
|
|
449
469
|
custom: Readonly<{
|