@nanahoshi/mona-ui 0.47.0 → 0.48.0
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 +18 -0
- package/docs/api/index.json +1 -1
- package/docs/grid-rows.md +36 -0
- package/docs/grid-server.md +6 -0
- package/docs/grid.md +3 -2
- package/docs/manifest.json +1 -1
- package/fesm2022/{grid-colgroup.component-B4jx10Yi.mjs → grid-colgroup.component-BFbiAvkG.mjs} +2 -2
- package/fesm2022/{grid-footer-row.component-CVUltI39.mjs → grid-footer-row.component-DpSu7jvG.mjs} +3 -2
- package/fesm2022/{grid-list.component-Cv1KB5VQ.mjs → grid-list.component-B-F4bvFL.mjs} +5 -5
- package/fesm2022/{grid-row.component-BauMmps5.mjs → grid-row.component-CuCQ_Z5F.mjs} +37 -9
- package/fesm2022/{grid-virtual-list.component-DNjoZfHq.mjs → grid-virtual-list.component-rIz5AUOU.mjs} +31 -12
- package/fesm2022/{grid.styles-BJHVTT_v.mjs → grid.styles-D6jP3vwD.mjs} +110 -35
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +16 -20
- package/llms.txt +1 -1
- package/package.json +1 -1
- package/types/nanahoshi-mona-ui-grid.d.ts +35 -4
|
@@ -411,6 +411,16 @@ export interface FilterableOptions {
|
|
|
411
411
|
enabled: boolean;
|
|
412
412
|
type: "menu" | "row" | "menu, row";
|
|
413
413
|
}
|
|
414
|
+
/** Emitted when the user activates a data row, the way a file list opens an item. */
|
|
415
|
+
interface GridRowActivateEvent<T = Record<PropertyKey, unknown>> {
|
|
416
|
+
/**
|
|
417
|
+
* The double-click or the `Enter` key press, to tell apart a modified one such as `Ctrl+Enter` or
|
|
418
|
+
* `Alt+Enter`, or to find the cell it happened in through its `target`.
|
|
419
|
+
*/
|
|
420
|
+
readonly originalEvent: KeyboardEvent | MouseEvent;
|
|
421
|
+
/** The row's item from `data`, the same object. */
|
|
422
|
+
readonly rowData: T;
|
|
423
|
+
}
|
|
414
424
|
/** The classes a {@link GridRowClass} function adds to a data row. Nullish values add nothing. */
|
|
415
425
|
type GridRowClassValue = string | readonly string[] | null | undefined;
|
|
416
426
|
/** Returns the classes to add to the data row that shows the given item. */
|
|
@@ -1827,6 +1837,7 @@ declare class GridService {
|
|
|
1827
1837
|
readonly renderedBodyRowCount: import("@angular/core").WritableSignal<number>;
|
|
1828
1838
|
readonly reorderableOptions: import("@angular/core").Signal<ReorderableOptions>;
|
|
1829
1839
|
readonly resizableOptions: import("@angular/core").Signal<ResizableOptions>;
|
|
1840
|
+
readonly rowActivate$: Subject<GridRowActivateEvent<Record<PropertyKey, unknown>>>;
|
|
1830
1841
|
readonly rowClass: import("@angular/core").WritableSignal<GridRowClass<unknown> | null>;
|
|
1831
1842
|
readonly rowDragInProgress: import("@angular/core").Signal<boolean>;
|
|
1832
1843
|
readonly rowEdit$: Subject<RowEditEvent>;
|
|
@@ -1877,12 +1888,12 @@ declare class GridService {
|
|
|
1877
1888
|
readonly viewPageRows: import("@angular/core").Signal<ImmutableList<Row>>;
|
|
1878
1889
|
readonly viewRowCount: import("@angular/core").Signal<number>;
|
|
1879
1890
|
readonly viewRows: import("@angular/core").Signal<ImmutableList<Row>>;
|
|
1880
|
-
readonly virtualGridMaxBuffer: import("@angular/core").Signal<number>;
|
|
1881
|
-
readonly virtualGridMinBuffer: import("@angular/core").WritableSignal<number>;
|
|
1882
1891
|
readonly virtualScrollOptions: import("@angular/core").WritableSignal<VirtualScrollOptions>;
|
|
1883
1892
|
readonly visibleColumns: import("@angular/core").Signal<ImmutableList<Column>>;
|
|
1884
1893
|
readonly visibleStructuralColumns: import("@angular/core").Signal<StructuralColumnDescriptor[]>;
|
|
1885
1894
|
constructor();
|
|
1895
|
+
/** Reports that the user activated a data row. Not while an edit is open, whose keys and clicks are its own. */
|
|
1896
|
+
activateRow(row: Row, originalEvent: KeyboardEvent | MouseEvent): void;
|
|
1886
1897
|
addGroupColumn(column: Column): void;
|
|
1887
1898
|
applyState(state: GridState | null, options?: GridStatePersistenceOptions): GridStateLoadResult;
|
|
1888
1899
|
canReorderRow(row: Row): boolean;
|
|
@@ -2055,6 +2066,10 @@ declare class GridService {
|
|
|
2055
2066
|
setRowKey(rowKey: GridKeySelector<unknown> | null): void;
|
|
2056
2067
|
setRowReorderableOptions(options: RowReorderableOptions): void;
|
|
2057
2068
|
setRowSelected(row: Row, selected: boolean): void;
|
|
2069
|
+
/**
|
|
2070
|
+
* Wraps the data items in rows. Flat data that keeps the items read last time and adds more at the end, as a
|
|
2071
|
+
* list that loads in pages does, keeps its rows: only the new items are read.
|
|
2072
|
+
*/
|
|
2058
2073
|
setRows(value: Iterable<Record<PropertyKey, unknown>>, rowKey?: GridKeySelector<unknown> | null): void;
|
|
2059
2074
|
setScrollEndThreshold(threshold: number): void;
|
|
2060
2075
|
/** Replaces the selection options; the feature is on unless `enabled` is `false`. */
|
|
@@ -2079,6 +2094,12 @@ declare class GridService {
|
|
|
2079
2094
|
updateColumn(columnId: string, patch: Partial<Omit<Column, "id">>): void;
|
|
2080
2095
|
/** Tells assistive technology why a commit didn't go through. */
|
|
2081
2096
|
private announceInvalid;
|
|
2097
|
+
/**
|
|
2098
|
+
* Reads only the new items when `items` start with the items read last time, each with the same `rowKey` value,
|
|
2099
|
+
* and add more. Returns false otherwise, for the caller to read them all: the same items given again are read
|
|
2100
|
+
* again, so a field changed in place shows.
|
|
2101
|
+
*/
|
|
2102
|
+
private appendRows;
|
|
2082
2103
|
private applyColumnIndexes;
|
|
2083
2104
|
private buildGroupAggregates;
|
|
2084
2105
|
private clearEditSession;
|
|
@@ -2107,6 +2128,8 @@ declare class GridService {
|
|
|
2107
2128
|
private measureFallbackScrollbarGutter;
|
|
2108
2129
|
/** Keeps each group's columns together, then moves left-locked columns to the start and right-locked ones to the end. */
|
|
2109
2130
|
private orderColumnsByLockBucket;
|
|
2131
|
+
/** Wraps an item in a row; a repeated item or key still gets its own identity, so rows never collide. */
|
|
2132
|
+
private readRow;
|
|
2110
2133
|
private reconcileColumn;
|
|
2111
2134
|
/** The column's `editable`, with the default (every column but the `rowKey` field) resolved. */
|
|
2112
2135
|
private resolveEditable;
|
|
@@ -2127,6 +2150,7 @@ declare class GridService {
|
|
|
2127
2150
|
private updateColumns;
|
|
2128
2151
|
private validateServerInteger;
|
|
2129
2152
|
private validateSessionForSave;
|
|
2153
|
+
private warnDuplicateKeys;
|
|
2130
2154
|
private withColumnIndices;
|
|
2131
2155
|
static ɵfac: i0.ɵɵFactoryDeclaration<GridService, never>;
|
|
2132
2156
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
@@ -2282,6 +2306,13 @@ export declare class GridComponent<T> implements GridVariantInput {
|
|
|
2282
2306
|
* @default "medium"
|
|
2283
2307
|
*/
|
|
2284
2308
|
readonly rounded: import("@angular/core").InputSignal<"small" | "none" | "large" | "medium" | null | undefined>;
|
|
2309
|
+
/**
|
|
2310
|
+
* @description Emitted when the user activates a data row, the way a file list opens an item: by
|
|
2311
|
+
* double-clicking it, or by pressing `Enter` on one of its cells where the key has no other use. Editing,
|
|
2312
|
+
* moving into a cell's controls and opening a detail row keep `Enter`. Not emitted for header, group, group
|
|
2313
|
+
* footer, detail or add rows, for a double-click on a control inside a cell, or while an edit is open.
|
|
2314
|
+
*/
|
|
2315
|
+
readonly rowActivate: import("@angular/core").OutputEmitterRef<GridRowActivateEvent<T>>;
|
|
2285
2316
|
/**
|
|
2286
2317
|
* @description Returns extra CSS classes for the data row that shows an item, merged onto the row's own
|
|
2287
2318
|
* classes via `tailwind-merge`. It runs again whenever the item's row is rebound.
|
|
@@ -2360,7 +2391,6 @@ export declare class GridComponent<T> implements GridVariantInput {
|
|
|
2360
2391
|
private setInitialCalculatedWidthOfColumns;
|
|
2361
2392
|
private setPageSizeEffect;
|
|
2362
2393
|
private setPagingEffects;
|
|
2363
|
-
private setResizeObserver;
|
|
2364
2394
|
private syncToolbarFocusTargets;
|
|
2365
2395
|
static ɵfac: i0.ɵɵFactoryDeclaration<GridComponent<any>, never>;
|
|
2366
2396
|
static ɵcmp: i0.ɵɵComponentDeclaration<GridComponent<any>, "mona-grid", never, {
|
|
@@ -2433,6 +2463,7 @@ export declare class GridComponent<T> implements GridVariantInput {
|
|
|
2433
2463
|
"expandedKeys": "expandedKeysChange";
|
|
2434
2464
|
"pageChange": "pageChange";
|
|
2435
2465
|
"pageSize": "pageSizeChange";
|
|
2466
|
+
"rowActivate": "rowActivate";
|
|
2436
2467
|
"skip": "skipChange";
|
|
2437
2468
|
}, ["columnDefinitions", "gridDetailTemplate", "noDataTemplate", "toolbarTemplate"], never, true, never>;
|
|
2438
2469
|
}
|
|
@@ -2497,4 +2528,4 @@ export declare const GRID_DEFAULT_MESSAGES: {
|
|
|
2497
2528
|
sortOrder: (position: number) => string;
|
|
2498
2529
|
toolbar: string;
|
|
2499
2530
|
};
|
|
2500
|
-
export type { AggregateFunction, Column, ColumnConfig, ColumnFormat, ColumnFormatFunction, ColumnGroup, ColumnKind, ColumnReorderEvent, ColumnResizeEvent, ColumnSortComparator, ColumnSortEvent, EditableOptions, GridCancelReason, GridCellRange, GridColumnLockedPosition, GridDataState, GridEditFormContext, GridEditOperation, GridEditSchemaFactory, GridEditSession, GridEditTemplateContext, GridKeySelector, GridPdfExportOptions, GridPdfFont, GridPdfFontSource, GridPdfPaperSize, GridRangePasteChange, GridRangePasteEvent, GridRowClass, GridRowClassValue, GridRowCommand, GridSaveOperation, GridToolbarContext, GridToolbarTemplateContext, GridTreeChildren, ReorderableOptions, ResizableOptions, ResizeMethod, Row, RowReorderableOptions };
|
|
2531
|
+
export type { AggregateFunction, Column, ColumnConfig, ColumnFormat, ColumnFormatFunction, ColumnGroup, ColumnKind, ColumnReorderEvent, ColumnResizeEvent, ColumnSortComparator, ColumnSortEvent, EditableOptions, GridCancelReason, GridCellRange, GridColumnLockedPosition, GridDataState, GridEditFormContext, GridEditOperation, GridEditSchemaFactory, GridEditSession, GridEditTemplateContext, GridKeySelector, GridPdfExportOptions, GridPdfFont, GridPdfFontSource, GridPdfPaperSize, GridRangePasteChange, GridRangePasteEvent, GridRowActivateEvent, GridRowClass, GridRowClassValue, GridRowCommand, GridSaveOperation, GridToolbarContext, GridToolbarTemplateContext, GridTreeChildren, ReorderableOptions, ResizableOptions, ResizeMethod, Row, RowReorderableOptions };
|