@nanahoshi/mona-ui 0.8.0 → 0.10.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/fesm2022/nanahoshi-mona-ui-check-box.mjs +8 -11
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-cell.component-BbBPZj7t.mjs → nanahoshi-mona-ui-grid-grid-footer-cell.component-CJmjLl7R.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-BkISJoqL.mjs → nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-pGhsAcVA.mjs} +2 -2
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-BhnFFIOl.mjs +145 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-toggle.component-QDo6TweF.mjs → nanahoshi-mona-ui-grid-grid-toggle.component-DE3ffsva.mjs} +120 -6
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-7acNUovW.mjs +233 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-DWzYyGnb.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-DaOemy_G.mjs} +534 -81
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/package.json +1 -1
- package/types/nanahoshi-mona-ui-check-box.d.ts +1 -2
- package/types/nanahoshi-mona-ui-grid.d.ts +172 -17
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-DReEfWfG.mjs +0 -121
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-BCIs_lmz.mjs +0 -231
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { computed, input, Directive, inject, Component, signal, ElementRef, viewChild, output, effect, untracked, afterNextRender, ChangeDetectionStrategy, Injector, LOCALE_ID, model } from '@angular/core';
|
|
3
|
-
import {
|
|
3
|
+
import { m as gridListTableCellThemeVariants, n as gridDetailContentCellThemeVariants, o as gridDetailIndentCellThemeVariants, p as gridDetailRowThemeVariants, c as GridService, q as gridListTableRowThemeVariants, r as gridCellEditorBaseThemeVariants, s as gridCellEditorInputThemeVariants, j as GridLockedCellDirective, i as GridLogicalCellDirective, G as GridNavigationService, t as gridCellBaseThemeVariants, u as gridCellContainerThemeVariants, v as gridCellDirtyIndicatorThemeVariants, w as gridCellTextThemeVariants, x as gridRowReorderHandleThemeVariants, y as gridSelectionCellThemeVariants } from './nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-DaOemy_G.mjs';
|
|
4
4
|
import { ImmutableList } from '@mirei/ts-collections';
|
|
5
5
|
import * as i1 from '@angular/cdk/a11y';
|
|
6
|
-
import { A11yModule } from '@angular/cdk/a11y';
|
|
6
|
+
import { A11yModule, LiveAnnouncer } from '@angular/cdk/a11y';
|
|
7
7
|
import { NgTemplateOutlet, formatDate } from '@angular/common';
|
|
8
8
|
import { LucideCheck, LucideOctagonAlert, LucideX, LucidePencil, LucideTrash2, LucideMinus, LucideChevronDown, LucidePlus, LucideChevronRight, LucideDynamicIcon } from '@lucide/angular';
|
|
9
9
|
import { ButtonDirective } from '@nanahoshi/mona-ui/button';
|
|
@@ -15,6 +15,7 @@ import { CheckBoxComponent } from '@nanahoshi/mona-ui/check-box';
|
|
|
15
15
|
import { DatePickerComponent } from '@nanahoshi/mona-ui/date-picker';
|
|
16
16
|
import { NumericTextBoxComponent } from '@nanahoshi/mona-ui/numeric-text-box';
|
|
17
17
|
import { TextBoxComponent } from '@nanahoshi/mona-ui/text-box';
|
|
18
|
+
import { CdkDragHandle } from '@angular/cdk/drag-drop';
|
|
18
19
|
|
|
19
20
|
class GridCellDirective {
|
|
20
21
|
constructor() {
|
|
@@ -547,7 +548,7 @@ class GridAddRowComponent {
|
|
|
547
548
|
this.gridService.patchAddCell(column.field, value);
|
|
548
549
|
}
|
|
549
550
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridAddRowComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
550
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: GridAddRowComponent, isStandalone: true, selector: "tr[monaGridAddRow]", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "row", "data-grid-add-row": "true" }, properties: { "class": "baseClass()" } }, ngImport: i0, template: "@if (gridService.addRowData(); as rowData) {\n @let session = gridService.editSession();\n @for (_ of gridService.groupColumns(); track $index) {\n <td\n monaGridCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n [grouped]=\"true\"\n [indentCell]=\"true\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.groupColumnWidth\"></td>\n }\n @if (gridService.
|
|
551
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: GridAddRowComponent, isStandalone: true, selector: "tr[monaGridAddRow]", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "row", "data-grid-add-row": "true" }, properties: { "class": "baseClass()" } }, ngImport: i0, template: "@if (gridService.addRowData(); as rowData) {\n @let session = gridService.editSession();\n @for (_ of gridService.groupColumns(); track $index) {\n <td\n monaGridCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n [grouped]=\"true\"\n [indentCell]=\"true\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.groupColumnWidth\"></td>\n }\n @if (gridService.rowReorderColumnVisible()) {\n <td\n monaGridCell\n monaGridLogicalCell\n monaGridLockedCell\n [structuralColumn]=\"'reorder'\"\n [rowIndex]=\"-1\"\n [colIndex]=\"gridService.structuralColIndexMap().get('reorder') ?? 0\"\n [cellKind]=\"'command'\"\n [columnId]=\"'$rowReorder'\"\n [firstInRow]=\"gridService.structuralColIndexMap().get('reorder') === 0\"\n [lastInRow]=\"columns().length === 0 && gridService.structuralLastKind() === 'reorder'\"\n [section]=\"'add'\"\n [style.width.px]=\"gridService.rowReorderColumnWidth\"></td>\n }\n @if (gridService.masterDetailTemplate()) {\n <td\n monaGridCell\n monaGridLogicalCell\n monaGridLockedCell\n [structuralColumn]=\"'detail'\"\n [masterDetailToggle]=\"true\"\n [rowIndex]=\"-1\"\n [colIndex]=\"gridService.structuralColIndexMap().get('detail') ?? 0\"\n [cellKind]=\"'detail'\"\n [firstInRow]=\"gridService.structuralColIndexMap().get('detail') === 0\"\n [lastInRow]=\"columns().length === 0 && gridService.structuralLastKind() === 'detail'\"\n [section]=\"'add'\"\n [style.width.px]=\"gridService.detailColumnWidth\"></td>\n }\n @if (gridService.selectionColumnVisible()) {\n <td\n monaGridCell\n monaGridLogicalCell\n monaGridLockedCell\n [structuralColumn]=\"'selection'\"\n [rowIndex]=\"-1\"\n [colIndex]=\"gridService.structuralColIndexMap().get('selection') ?? 0\"\n [cellKind]=\"'command'\"\n [columnId]=\"'$selection'\"\n [firstInRow]=\"gridService.structuralColIndexMap().get('selection') === 0\"\n [lastInRow]=\"columns().length === 0 && gridService.structuralLastKind() === 'selection'\"\n [section]=\"'add'\"\n [style.width.px]=\"gridService.selectionColumnWidth\"></td>\n }\n @for (column of columns(); track $index) {\n @let colIndex = $index + gridService.leadingLogicalColumnCount();\n <td\n monaGridCell\n monaGridLockedCell\n [column]=\"column\"\n [dataCell]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"column.kind\"\n [colIndex]=\"colIndex\"\n [columnId]=\"column.id\"\n [rowIndex]=\"-1\"\n [section]=\"'add'\"\n [firstInRow]=\"colIndex === gridService.leadingLogicalColumnCount()\"\n [lastInRow]=\"colIndex === gridService.leadingLogicalColumnCount() + columns().length - 1\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"column.calculatedWidth\"\n [style.min-width.px]=\"column.minWidth\">\n @if (column.kind === \"command\") {\n <mona-grid-command-cell [column]=\"column\" [newRow]=\"true\"></mona-grid-command-cell>\n } @else if (column.editable && session) {\n <mona-grid-editor\n [column]=\"column\"\n [autoFocus]=\"isFirstEditableColumn(column)\"\n [isNew]=\"true\"\n [session]=\"session\"\n (commit)=\"onCommit()\"\n (cancel)=\"onCancel()\"></mona-grid-editor>\n } @else {\n <span class=\"block truncate px-2\">{{ rowData[column.field] }}</span>\n }\n </td>\n }\n}\n", dependencies: [{ kind: "directive", type: GridCellDirective, selector: "td[monaGridCell]", inputs: ["dataCell", "groupHeader", "groupToggle", "grouped", "indentCell", "lastInRow", "masterDetailContent", "masterDetailToggle", "nextRowType", "prevRowType"] }, { kind: "component", type: GridCommandCellComponent, selector: "mona-grid-command-cell", inputs: ["column", "newRow", "row"] }, { kind: "component", type: GridEditorComponent, selector: "mona-grid-editor", inputs: ["autoFocus", "column", "isNew", "session", "tabNavigationEnabled"], outputs: ["cancel", "commit", "tabNavigate"] }, { kind: "directive", type: GridLockedCellDirective, selector: "td[monaGridLockedCell], th[monaGridLockedCell]", inputs: ["column", "groupPrefixWidth", "lockedCellHeader", "lockedStructuralOffset", "structuralColumn"] }, { kind: "directive", type: GridLogicalCellDirective, selector: "td[monaGridLogicalCell], th[monaGridLogicalCell]", inputs: ["cellKind", "colIndex", "columnId", "editable", "firstInRow", "groupHeader", "groupKey", "lastInRow", "rowIndex", "rowUid", "section"], outputs: ["edit", "toggle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
551
552
|
}
|
|
552
553
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridAddRowComponent, decorators: [{
|
|
553
554
|
type: Component,
|
|
@@ -561,7 +562,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
561
562
|
"[class]": "baseClass()",
|
|
562
563
|
role: "row",
|
|
563
564
|
"data-grid-add-row": "true"
|
|
564
|
-
}, template: "@if (gridService.addRowData(); as rowData) {\n @let session = gridService.editSession();\n @for (_ of gridService.groupColumns(); track $index) {\n <td\n monaGridCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n [grouped]=\"true\"\n [indentCell]=\"true\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.groupColumnWidth\"></td>\n }\n @if (gridService.
|
|
565
|
+
}, template: "@if (gridService.addRowData(); as rowData) {\n @let session = gridService.editSession();\n @for (_ of gridService.groupColumns(); track $index) {\n <td\n monaGridCell\n monaGridLockedCell\n [lockedCellHeader]=\"true\"\n [lockedStructuralOffset]=\"$index * gridService.groupColumnWidth\"\n [grouped]=\"true\"\n [indentCell]=\"true\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"gridService.groupColumnWidth\"></td>\n }\n @if (gridService.rowReorderColumnVisible()) {\n <td\n monaGridCell\n monaGridLogicalCell\n monaGridLockedCell\n [structuralColumn]=\"'reorder'\"\n [rowIndex]=\"-1\"\n [colIndex]=\"gridService.structuralColIndexMap().get('reorder') ?? 0\"\n [cellKind]=\"'command'\"\n [columnId]=\"'$rowReorder'\"\n [firstInRow]=\"gridService.structuralColIndexMap().get('reorder') === 0\"\n [lastInRow]=\"columns().length === 0 && gridService.structuralLastKind() === 'reorder'\"\n [section]=\"'add'\"\n [style.width.px]=\"gridService.rowReorderColumnWidth\"></td>\n }\n @if (gridService.masterDetailTemplate()) {\n <td\n monaGridCell\n monaGridLogicalCell\n monaGridLockedCell\n [structuralColumn]=\"'detail'\"\n [masterDetailToggle]=\"true\"\n [rowIndex]=\"-1\"\n [colIndex]=\"gridService.structuralColIndexMap().get('detail') ?? 0\"\n [cellKind]=\"'detail'\"\n [firstInRow]=\"gridService.structuralColIndexMap().get('detail') === 0\"\n [lastInRow]=\"columns().length === 0 && gridService.structuralLastKind() === 'detail'\"\n [section]=\"'add'\"\n [style.width.px]=\"gridService.detailColumnWidth\"></td>\n }\n @if (gridService.selectionColumnVisible()) {\n <td\n monaGridCell\n monaGridLogicalCell\n monaGridLockedCell\n [structuralColumn]=\"'selection'\"\n [rowIndex]=\"-1\"\n [colIndex]=\"gridService.structuralColIndexMap().get('selection') ?? 0\"\n [cellKind]=\"'command'\"\n [columnId]=\"'$selection'\"\n [firstInRow]=\"gridService.structuralColIndexMap().get('selection') === 0\"\n [lastInRow]=\"columns().length === 0 && gridService.structuralLastKind() === 'selection'\"\n [section]=\"'add'\"\n [style.width.px]=\"gridService.selectionColumnWidth\"></td>\n }\n @for (column of columns(); track $index) {\n @let colIndex = $index + gridService.leadingLogicalColumnCount();\n <td\n monaGridCell\n monaGridLockedCell\n [column]=\"column\"\n [dataCell]=\"true\"\n monaGridLogicalCell\n [cellKind]=\"column.kind\"\n [colIndex]=\"colIndex\"\n [columnId]=\"column.id\"\n [rowIndex]=\"-1\"\n [section]=\"'add'\"\n [firstInRow]=\"colIndex === gridService.leadingLogicalColumnCount()\"\n [lastInRow]=\"colIndex === gridService.leadingLogicalColumnCount() + columns().length - 1\"\n [attr.colspan]=\"1\"\n [style.width.px]=\"column.calculatedWidth\"\n [style.min-width.px]=\"column.minWidth\">\n @if (column.kind === \"command\") {\n <mona-grid-command-cell [column]=\"column\" [newRow]=\"true\"></mona-grid-command-cell>\n } @else if (column.editable && session) {\n <mona-grid-editor\n [column]=\"column\"\n [autoFocus]=\"isFirstEditableColumn(column)\"\n [isNew]=\"true\"\n [session]=\"session\"\n (commit)=\"onCommit()\"\n (cancel)=\"onCancel()\"></mona-grid-editor>\n } @else {\n <span class=\"block truncate px-2\">{{ rowData[column.field] }}</span>\n }\n </td>\n }\n}\n" }]
|
|
565
566
|
}], propDecorators: { columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }] } });
|
|
566
567
|
|
|
567
568
|
const FOCUSABLE_TARGET_SELECTOR = "button, input, select, textarea, a[href], [tabindex]";
|
|
@@ -762,6 +763,119 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
762
763
|
}, template: "@let dataItem = row().data;\n@let dataKey = column().field;\n\n@if (column().kind === \"command\") {\n <mona-grid-command-cell [column]=\"column()\" [row]=\"row()\"></mona-grid-command-cell>\n} @else {\n <div\n role=\"gridcell\"\n [class]=\"cellContainerClass()\"\n cdkMonitorSubtreeFocus\n [attr.data-uid]=\"cellUid()\"\n [attr.data-ruid]=\"row().uid\"\n [attr.data-field]=\"dataKey\"\n [attr.data-col-index]=\"column().index\"\n [attr.aria-readonly]=\"!(gridService.editableOptions().enabled && column().editable)\"\n (dblclick)=\"onCellDoubleClick($event)\">\n @if (isEditing() && gridService.editSession(); as session) {\n <mona-grid-editor\n [column]=\"column()\"\n [autoFocus]=\"shouldAutoFocusEditor()\"\n [session]=\"session\"\n [tabNavigationEnabled]=\"editContextIsCellMode()\"\n (commit)=\"onEditCommit()\"\n (cancel)=\"onEditCancel()\"\n (tabNavigate)=\"onEditTabNavigate($event)\"></mona-grid-editor>\n } @else if (column().cellTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"column().cellTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem, column: column().field }\"></ng-container>\n } @else {\n <span [class]=\"cellTextClass()\">{{ formattedDisplayValue() }}</span>\n }\n @if (!isCellPristine()) {\n <span aria-hidden=\"true\" [class]=\"cellDirtyIndicatorClass()\" title=\"Modified\"></span>\n }\n </div>\n}\n" }]
|
|
763
764
|
}], propDecorators: { column: [{ type: i0.Input, args: [{ isSignal: true, alias: "column", required: true }] }], row: [{ type: i0.Input, args: [{ isSignal: true, alias: "row", required: true }] }] } });
|
|
764
765
|
|
|
766
|
+
const ROW_REORDER_DISABLED_REASON_TEXT = {
|
|
767
|
+
disabled: "Row reordering is disabled.",
|
|
768
|
+
editing: "Finish editing to reorder rows.",
|
|
769
|
+
filtered: "Clear filters to reorder rows.",
|
|
770
|
+
grouped: "Clear grouping to reorder rows.",
|
|
771
|
+
"single-row": "At least two rows are needed to reorder.",
|
|
772
|
+
sorted: "Clear sorting to reorder rows.",
|
|
773
|
+
"virtual-scroll": "Row reordering isn't available while virtual scrolling is enabled."
|
|
774
|
+
};
|
|
775
|
+
class GridRowReorderHandleComponent {
|
|
776
|
+
constructor() {
|
|
777
|
+
this.#gridService = inject(GridService);
|
|
778
|
+
this.#liveAnnouncer = inject(LiveAnnouncer);
|
|
779
|
+
this.ariaLabel = computed(() => {
|
|
780
|
+
const absoluteIndex = this.pageIndex() + this.#gridService.paginationState().skip;
|
|
781
|
+
const label = this.#gridService.getRowReorderAriaLabel(this.row(), absoluteIndex);
|
|
782
|
+
const reasonText = this.disabledReasonText();
|
|
783
|
+
const suffix = reasonText == null ? "" : ` ${reasonText}`;
|
|
784
|
+
return `${label}. Use Alt plus Up Arrow or Alt plus Down Arrow to move.${suffix}`;
|
|
785
|
+
}, /* @ts-ignore */
|
|
786
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
787
|
+
this.disabled = computed(() => !this.#gridService.canReorderRow(this.row()), /* @ts-ignore */
|
|
788
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
789
|
+
this.disabledReasonText = computed(() => {
|
|
790
|
+
const reason = this.#gridService.rowReorderDisabledReason();
|
|
791
|
+
return reason == null ? null : ROW_REORDER_DISABLED_REASON_TEXT[reason];
|
|
792
|
+
}, /* @ts-ignore */
|
|
793
|
+
...(ngDevMode ? [{ debugName: "disabledReasonText" }] : /* istanbul ignore next */ []));
|
|
794
|
+
this.handleClass = computed(() => gridRowReorderHandleThemeVariants(), /* @ts-ignore */
|
|
795
|
+
...(ngDevMode ? [{ debugName: "handleClass" }] : /* istanbul ignore next */ []));
|
|
796
|
+
/**
|
|
797
|
+
* @description The row's position within the current page, used to move the row and derive its accessible label.
|
|
798
|
+
*/
|
|
799
|
+
this.pageIndex = input.required(/* @ts-ignore */
|
|
800
|
+
...(ngDevMode ? [{ debugName: "pageIndex" }] : /* istanbul ignore next */ []));
|
|
801
|
+
/**
|
|
802
|
+
* @description The grid row whose reorder handle this button controls.
|
|
803
|
+
*/
|
|
804
|
+
this.row = input.required(/* @ts-ignore */
|
|
805
|
+
...(ngDevMode ? [{ debugName: "row" }] : /* istanbul ignore next */ []));
|
|
806
|
+
}
|
|
807
|
+
#gridService;
|
|
808
|
+
#liveAnnouncer;
|
|
809
|
+
onKeydown(event) {
|
|
810
|
+
if ((event.key !== "ArrowUp" && event.key !== "ArrowDown") || !event.altKey) {
|
|
811
|
+
return;
|
|
812
|
+
}
|
|
813
|
+
event.preventDefault();
|
|
814
|
+
event.stopPropagation();
|
|
815
|
+
const direction = event.key === "ArrowUp" ? -1 : 1;
|
|
816
|
+
const targetIndex = this.pageIndex() + direction;
|
|
817
|
+
if (targetIndex < 0 || targetIndex >= this.#gridService.viewPageRows().length) {
|
|
818
|
+
return;
|
|
819
|
+
}
|
|
820
|
+
const moved = this.#gridService.requestRowReorder(this.row(), this.pageIndex(), targetIndex);
|
|
821
|
+
if (moved) {
|
|
822
|
+
const skip = this.#gridService.paginationState().skip;
|
|
823
|
+
this.#liveAnnouncer.announce(`Moved row ${skip + this.pageIndex() + 1} to position ${skip + targetIndex + 1}.`);
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridRowReorderHandleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
827
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.6", type: GridRowReorderHandleComponent, isStandalone: true, selector: "mona-grid-row-reorder-handle", inputs: { pageIndex: { classPropertyName: "pageIndex", publicName: "pageIndex", isSignal: true, isRequired: true, transformFunction: null }, row: { classPropertyName: "row", publicName: "row", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "$event.stopPropagation()", "contextmenu": "$event.stopPropagation()", "dblclick": "$event.stopPropagation()" } }, ngImport: i0, template: "<button\n type=\"button\"\n cdkDragHandle\n [class]=\"handleClass()\"\n [disabled]=\"disabled()\"\n [attr.title]=\"disabledReasonText()\"\n [attr.aria-label]=\"ariaLabel()\"\n aria-keyshortcuts=\"Alt+ArrowUp Alt+ArrowDown\"\n (keydown)=\"onKeydown($event)\">\n <i aria-hidden=\"true\" class=\"ri-draggable\"></i>\n</button>\n", dependencies: [{ kind: "directive", type: CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
828
|
+
}
|
|
829
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridRowReorderHandleComponent, decorators: [{
|
|
830
|
+
type: Component,
|
|
831
|
+
args: [{ selector: "mona-grid-row-reorder-handle", imports: [CdkDragHandle], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
832
|
+
"(click)": "$event.stopPropagation()",
|
|
833
|
+
"(contextmenu)": "$event.stopPropagation()",
|
|
834
|
+
"(dblclick)": "$event.stopPropagation()"
|
|
835
|
+
}, template: "<button\n type=\"button\"\n cdkDragHandle\n [class]=\"handleClass()\"\n [disabled]=\"disabled()\"\n [attr.title]=\"disabledReasonText()\"\n [attr.aria-label]=\"ariaLabel()\"\n aria-keyshortcuts=\"Alt+ArrowUp Alt+ArrowDown\"\n (keydown)=\"onKeydown($event)\">\n <i aria-hidden=\"true\" class=\"ri-draggable\"></i>\n</button>\n" }]
|
|
836
|
+
}], propDecorators: { pageIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageIndex", required: true }] }], row: [{ type: i0.Input, args: [{ isSignal: true, alias: "row", required: true }] }] } });
|
|
837
|
+
|
|
838
|
+
class GridSelectionCheckboxComponent {
|
|
839
|
+
constructor() {
|
|
840
|
+
this.#gridService = inject(GridService);
|
|
841
|
+
this.ariaLabel = computed(() => {
|
|
842
|
+
const labelFn = this.#gridService.selectableOptions().rowAriaLabel;
|
|
843
|
+
if (labelFn) {
|
|
844
|
+
return labelFn(this.row().data);
|
|
845
|
+
}
|
|
846
|
+
return `Select row ${this.rowIndex() + 1}`;
|
|
847
|
+
}, /* @ts-ignore */
|
|
848
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
849
|
+
this.checked = computed(() => this.#gridService.isRowSelected(this.row()), /* @ts-ignore */
|
|
850
|
+
...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
851
|
+
this.hostClass = computed(() => gridSelectionCellThemeVariants(), /* @ts-ignore */
|
|
852
|
+
...(ngDevMode ? [{ debugName: "hostClass" }] : /* istanbul ignore next */ []));
|
|
853
|
+
/**
|
|
854
|
+
* @description The grid row whose selected state this checkbox controls.
|
|
855
|
+
*/
|
|
856
|
+
this.row = input.required(/* @ts-ignore */
|
|
857
|
+
...(ngDevMode ? [{ debugName: "row" }] : /* istanbul ignore next */ []));
|
|
858
|
+
/**
|
|
859
|
+
* @description The row's position within its rendered list, used to derive a default accessible label.
|
|
860
|
+
*/
|
|
861
|
+
this.rowIndex = input.required(/* @ts-ignore */
|
|
862
|
+
...(ngDevMode ? [{ debugName: "rowIndex" }] : /* istanbul ignore next */ []));
|
|
863
|
+
}
|
|
864
|
+
#gridService;
|
|
865
|
+
onCheckedChange(checked) {
|
|
866
|
+
this.#gridService.setRowSelected(this.row(), checked);
|
|
867
|
+
}
|
|
868
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridSelectionCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
869
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.6", type: GridSelectionCheckboxComponent, isStandalone: true, selector: "mona-grid-selection-checkbox", inputs: { row: { classPropertyName: "row", publicName: "row", isSignal: true, isRequired: true, transformFunction: null }, rowIndex: { classPropertyName: "rowIndex", publicName: "rowIndex", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "$event.stopPropagation()" }, properties: { "class": "hostClass()" } }, ngImport: i0, template: "<mona-check-box\n [checked]=\"checked()\"\n (checkedChange)=\"onCheckedChange($event)\">\n <span class=\"sr-only\">{{ ariaLabel() }}</span>\n</mona-check-box>\n", dependencies: [{ kind: "component", type: CheckBoxComponent, selector: "mona-check-box", inputs: ["checked", "disabled", "indeterminate", "invalid", "label", "labelPosition", "labelSize", "required", "rounded", "tabIndex", "touched", "class"], outputs: ["checkedChange", "inputBlur", "inputChange", "inputFocus", "touch"] }] }); }
|
|
870
|
+
}
|
|
871
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: GridSelectionCheckboxComponent, decorators: [{
|
|
872
|
+
type: Component,
|
|
873
|
+
args: [{ selector: "mona-grid-selection-checkbox", imports: [CheckBoxComponent], host: {
|
|
874
|
+
"[class]": "hostClass()",
|
|
875
|
+
"(click)": "$event.stopPropagation()"
|
|
876
|
+
}, template: "<mona-check-box\n [checked]=\"checked()\"\n (checkedChange)=\"onCheckedChange($event)\">\n <span class=\"sr-only\">{{ ariaLabel() }}</span>\n</mona-check-box>\n" }]
|
|
877
|
+
}], propDecorators: { row: [{ type: i0.Input, args: [{ isSignal: true, alias: "row", required: true }] }], rowIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowIndex", required: true }] }] } });
|
|
878
|
+
|
|
765
879
|
class GridToggleComponent {
|
|
766
880
|
constructor() {
|
|
767
881
|
this.collapseIcon = computed(() => {
|
|
@@ -793,5 +907,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
793
907
|
args: [{ selector: "mona-grid-toggle", imports: [LucideDynamicIcon], changeDetection: ChangeDetectionStrategy.OnPush, template: "<span\n [style.width.px]=\"width()\"\n class=\"inline-flex items-center justify-center h-full aspect-square\"\n (click)=\"onToggleDetailClick($event)\">\n @if (expanded()) {\n <svg [lucideIcon]=\"collapseIcon()\" [size]=\"16\"></svg>\n } @else {\n <svg [lucideIcon]=\"expandIcon()\" [size]=\"16\"></svg>\n }\n</span>\n" }]
|
|
794
908
|
}], propDecorators: { expanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "expanded", required: true }] }, { type: i0.Output, args: ["expandedChange"] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: true }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: true }] }] } });
|
|
795
909
|
|
|
796
|
-
export { GridAddRowComponent as G, GridCellComponent as a, GridRowDirective as b, GridCellDirective as c, GridDetailRowDirective as d, GridDetailIndentCellDirective as e, GridDetailContentCellDirective as f, GridToggleComponent as g };
|
|
797
|
-
//# sourceMappingURL=nanahoshi-mona-ui-grid-grid-toggle.component-
|
|
910
|
+
export { GridAddRowComponent as G, GridCellComponent as a, GridRowDirective as b, GridCellDirective as c, GridDetailRowDirective as d, GridDetailIndentCellDirective as e, GridDetailContentCellDirective as f, GridToggleComponent as g, GridSelectionCheckboxComponent as h, GridRowReorderHandleComponent as i };
|
|
911
|
+
//# sourceMappingURL=nanahoshi-mona-ui-grid-grid-toggle.component-DE3ffsva.mjs.map
|